MINOR: Replaced deprecated extraStatics() with static variables

This commit is contained in:
Ed 2012-04-25 20:42:05 -03:00 committed by Kirk Mayo
parent 0cec9a6f33
commit a2b612570b
4 changed files with 39 additions and 47 deletions

View File

@ -10,13 +10,10 @@ class FileSubsites extends DataExtension {
// considered 'global', unless set otherwise
static $default_root_folders_global = false;
function extraStatics() {
return array(
'has_one' => array(
'Subsite' => 'Subsite',
)
);
}
public static $has_one=array(
'Subsite' => 'Subsite',
);
/**
* Amends the CMS tree title for folders in the Files & Images section.

View File

@ -6,19 +6,17 @@
*/
class GroupSubsites extends DataExtension implements PermissionProvider {
function extraStatics() {
return array(
'db' => array(
'AccessAllSubsites' => 'Boolean',
),
'many_many' => array(
'Subsites' => 'Subsite',
),
'defaults' => array(
'AccessAllSubsites' => 1,
),
);
}
public static $db=array(
'AccessAllSubsites' => 'Boolean'
);
public static $many_many=array(
'Subsites' => 'Subsite'
);
public static $defaults=array(
'AccessAllSubsites' => true
);
/**

View File

@ -4,13 +4,10 @@
* Extension for the SiteConfig object to add subsites support
*/
class SiteConfigSubsites extends DataExtension {
function extraStatics() {
return array(
'has_one' => array(
'Subsite' => 'Subsite', // The subsite that this page belongs to
)
);
}
public static $has_one=array(
'Subsite' => 'Subsite', // The subsite that this page belongs to
);
/**
* Update any requests to limit the results to the current site

View File

@ -27,26 +27,26 @@ class SiteTreeSubsites extends DataExtension {
}
function extraStatics() {
return array(
'has_one' => array(
'Subsite' => 'Subsite', // The subsite that this page belongs to
'MasterPage' => 'SiteTree',// Optional; the page that is the content master
),
'has_many' => array(
'RelatedPages' => 'RelatedPageLink'
),
'many_many' => array(
'CrossSubsiteLinkTracking' => 'SiteTree' // Stored separately, as the logic for URL rewriting is different
),
'belongs_many_many' => array(
'BackCrossSubsiteLinkTracking' => 'SiteTree'
),
'many_many_extraFields' => array(
"CrossSubsiteLinkTracking" => array("FieldName" => "Varchar")
)
);
}
public static $has_one=array(
'Subsite' => 'Subsite', // The subsite that this page belongs to
'MasterPage' => 'SiteTree',// Optional; the page that is the content master
);
public static $has_many=array(
'RelatedPages' => 'RelatedPageLink'
);
public static $many_many=array(
'CrossSubsiteLinkTracking' => 'SiteTree' // Stored separately, as the logic for URL rewriting is different
);
public static $belongs_many_many=array(
'BackCrossSubsiteLinkTracking' => 'SiteTree'
);
public static $many_many_extraFields=array(
"CrossSubsiteLinkTracking" => array("FieldName" => "Varchar")
);
function isMainSite() {
if($this->owner->SubsiteID == 0) return true;