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 {
|
class SubsiteAdmin extends ModelAdmin {
|
||||||
|
|
||||||
static $managed_models = array('Subsite');
|
private static $managed_models = array('Subsite');
|
||||||
static $url_segment = 'subsites';
|
|
||||||
|
private static $url_segment = 'subsites';
|
||||||
|
|
||||||
static $menu_title = "Subsites";
|
private static $menu_title = "Subsites";
|
||||||
|
|
||||||
public $showImportForm=false;
|
public $showImportForm=false;
|
||||||
|
|
||||||
static $tree_class = 'Subsite';
|
private static $tree_class = 'Subsite';
|
||||||
|
|
||||||
public function getEditForm($id = null, $fields = null) {
|
public function getEditForm($id = null, $fields = null) {
|
||||||
$form = parent::getEditForm($id, $fields);
|
$form = parent::getEditForm($id, $fields);
|
||||||
|
@ -122,7 +122,7 @@ class SubsitesVirtualPage extends VirtualPage {
|
|||||||
$IDFilter = ($this->ID) ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null;
|
$IDFilter = ($this->ID) ? "AND \"SiteTree\".\"ID\" <> $this->ID" : null;
|
||||||
$parentFilter = null;
|
$parentFilter = null;
|
||||||
|
|
||||||
if(self::nested_urls()) {
|
if(Config::inst()->get('SiteTree', 'nested_urls')) {
|
||||||
if($this->ParentID) {
|
if($this->ParentID) {
|
||||||
$parentFilter = " AND \"SiteTree\".\"ParentID\" = $this->ParentID";
|
$parentFilter = " AND \"SiteTree\".\"ParentID\" = $this->ParentID";
|
||||||
} else {
|
} else {
|
||||||
|
@ -90,11 +90,12 @@ class SiteTreeSubsites extends DataExtension {
|
|||||||
|
|
||||||
// replace readonly link prefix
|
// replace readonly link prefix
|
||||||
$subsite = $this->owner->Subsite();
|
$subsite = $this->owner->Subsite();
|
||||||
|
$nested_urls_enabled = Config::inst()->get('SiteTree', 'nested_urls');
|
||||||
if($subsite && $subsite->ID) {
|
if($subsite && $subsite->ID) {
|
||||||
$baseUrl = 'http://' . $subsite->domain() . '/';
|
$baseUrl = 'http://' . $subsite->domain() . '/';
|
||||||
$baseLink = Controller::join_links (
|
$baseLink = Controller::join_links (
|
||||||
$baseUrl,
|
$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);
|
$url = (strlen($baseLink) > 36 ? "..." .substr($baseLink, -32) : $baseLink);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user