mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 09:05:55 +00:00
Fixing more statics that weren't private, and nested_urls deprecated usage
This commit is contained in:
parent
8ffeeb1ee6
commit
306cb79b19
@ -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);
|
||||
|
@ -122,7 +122,7 @@ class SubsitesVirtualPage extends VirtualPage {
|
||||
$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 {
|
||||
|
@ -90,11 +90,12 @@ class SiteTreeSubsites extends DataExtension {
|
||||
|
||||
// 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user