Added Subsite::set_allowed_themes() to specify the content of the sub-site theme dropdown

Added Theme dropdown in subsite details
This commit is contained in:
Sam Minnee 2008-06-24 02:31:26 +00:00
parent 0d3cdcf7b4
commit 94a754baf0

View File

@ -27,13 +27,16 @@ class Subsite extends DataObject implements PermissionProvider {
'Subdomain' => true, 'Subdomain' => true,
'Domain' => true 'Domain' => true
); );
static $defaults = array(
'IsPublic' => 1,
);
static $base_domain, $default_subdomain; static $base_domain, $default_subdomain;
static $cached_subsite = null; static $cached_subsite = null;
public static $allowed_domains = array( public static $allowed_domains = array();
); protected static $allowed_themes = array();
static function set_allowed_domains($domain){ static function set_allowed_domains($domain){
if(is_array($domain)){ if(is_array($domain)){
@ -44,6 +47,11 @@ class Subsite extends DataObject implements PermissionProvider {
self::$allowed_domains[] = $domain; self::$allowed_domains[] = $domain;
} }
} }
static function set_allowed_themes($themes) {
self::$allowed_themes = $themes;
}
/** /**
* Return the base domain for this set of subsites. * Return the base domain for this set of subsites.
* You can set this by setting Subsite::$Base_domain, otherwise it defaults to HTTP_HOST * You can set this by setting Subsite::$Base_domain, otherwise it defaults to HTTP_HOST
@ -86,7 +94,9 @@ class Subsite extends DataObject implements PermissionProvider {
), ),
// new TextField('RedirectURL', 'Redirect to URL', $this->RedirectURL), // new TextField('RedirectURL', 'Redirect to URL', $this->RedirectURL),
new CheckboxField('DefaultSite', 'Use this subsite as the default site', $this->DefaultSite), new CheckboxField('DefaultSite', 'Use this subsite as the default site', $this->DefaultSite),
new CheckboxField('IsPublic', 'Can access this subsite publicly?', $this->IsPublic) new CheckboxField('IsPublic', 'Can access this subsite publicly?', $this->IsPublic),
new DropdownField('Theme','Theme', ArrayLib::valuekey($this->stat('allowed_themes')), $this->Theme)
) )
), ),
new HiddenField('ID', '', $this->ID), new HiddenField('ID', '', $this->ID),