Here is the code I ran
<?php
class Page extends SiteTree {
static $db = array(
'Theme' => "Enum('higherground,blackcandy','higherground')"
);
static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldToTab('Root.Content.Main', new DropdownField(
'Theme',
'Select A Theme:',
singleton('Page')->dbObject('Theme')->enumValues()
));
if (!Permission::check("ADMIN")){
$fields->removeFieldFromTab('Root','Access');
}
return $fields;}
}
class Page_Controller extends ContentController {
function init() {
Debug::show($Theme);
SSViewer::set_theme($Theme);
parent::init();
Requirements::themedCSS("layout");
Requirements::themedCSS("typography");
Requirements::themedCSS("form");
}
}
?>
This is the output at the top of the rendered page:
Notice: Undefined variable: Theme in C:\wamp\www\testit\mysite\code\Page.php on line 26
Debug (Page_Controller->init() in line 26 of Page.php)
Notice: Undefined variable: Theme in C:\wamp\www\testit\mysite\code\Page.php on line 27
Thank you soooo much for your efforts with this... it has been driving me nuts...
An old salty sea captain walks into a bar and sits down to have a drink. The bartender walks over and notices that he has a big ship steering wheel hanging out the front of his pants, but chooses not to say anything and serve the man his drink. As the night wears on finally the bartender can no longer help himself... "So whats with the huge steering wheel hanging out of your pants??" The man looks up and replies "Arrrgg... it's drivin me nuts!"