Skip to content

Commit

Permalink
Fixing more statics that weren't private, and nested_urls deprecated …
Browse files Browse the repository at this point in the history
…usage
  • Loading branch information
halkyon committed May 6, 2013
1 parent 8ffeeb1 commit 306cb79
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions code/SubsiteAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@
*/
class SubsiteAdmin extends ModelAdmin {

static $managed_models = array('Subsite');
static $url_segment = 'subsites';
private static $managed_models = array('Subsite');

private static $url_segment = 'subsites';

static $menu_title = "Subsites";
private static $menu_title = "Subsites";

public $showImportForm=false;

static $tree_class = 'Subsite';
private static $tree_class = 'Subsite';

public function getEditForm($id = null, $fields = null) {
$form = parent::getEditForm($id, $fields);
Expand Down
2 changes: 1 addition & 1 deletion code/SubsitesVirtualPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public function validURLSegment() {
$IDFilter = ($this->ID) ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null;
$parentFilter = null;

if(self::nested_urls()) {
if(Config::inst()->get('SiteTree', 'nested_urls')) {
if($this->ParentID) {
$parentFilter = " AND \"SiteTree\".\"ParentID\" = $this->ParentID";
} else {
Expand Down
3 changes: 2 additions & 1 deletion code/extensions/SiteTreeSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ function updateCMSFields(FieldList $fields) {

// replace readonly link prefix
$subsite = $this->owner->Subsite();
$nested_urls_enabled = Config::inst()->get('SiteTree', 'nested_urls');
if($subsite && $subsite->ID) {
$baseUrl = 'http://' . $subsite->domain() . '/';
$baseLink = Controller::join_links (
$baseUrl,
(SiteTree::nested_urls() && $this->owner->ParentID ? $this->owner->Parent()->RelativeLink(true) : null)
($nested_urls_enabled && $this->owner->ParentID ? $this->owner->Parent()->RelativeLink(true) : null)
);

$url = (strlen($baseLink) > 36 ? "..." .substr($baseLink, -32) : $baseLink);
Expand Down

0 comments on commit 306cb79

Please sign in to comment.