themes MDL-22223 Added hidefromselector setting for theme.

This commit is contained in:
Sam Hemelryk
2010-04-28 03:32:16 +00:00
parent cbf964dfac
commit 4d56ee95e0
3 changed files with 17 additions and 6 deletions
+8 -1
View File
@@ -323,6 +323,13 @@ class theme_config {
*/
public $enable_dock = false;
/**
* If set to true then this theme will not be shown in the theme selector unless
* theme designer mode is turned on.
* @var bool
*/
public $hidefromselector = false;
/**
* Instance of the renderer_factory implementation
* we are using. Implementation detail.
@@ -400,7 +407,7 @@ class theme_config {
$configurable = array('parents', 'sheets', 'parents_exclude_sheets', 'plugins_exclude_sheets', 'javascripts', 'javascripts_footer',
'parents_exclude_javascripts', 'layouts', 'resource_mp3player_colors', 'enable_dock',
'filter_mediaplugin_colors', 'rendererfactory', 'csspostprocess', 'editor_sheets', 'rarrow', 'larrow');
'filter_mediaplugin_colors', 'rendererfactory', 'csspostprocess', 'editor_sheets', 'rarrow', 'larrow', 'hidefromselector');
foreach ($config as $key=>$value) {
if (in_array($key, $configurable)) {
+4
View File
@@ -141,6 +141,10 @@ $THEME->layouts = array(
),
);
// We don't want the base theme to be shown on the theme selection screen, by setting
// this to true it will only be shown if theme designer mode is switched on.
$THEME->hidefromselector = true;
/** List of javascript files that need to included on each page */
$THEME->javascripts = array();
$THEME->javascripts_footer = array();
+5 -5
View File
@@ -70,11 +70,6 @@ $table->head = array(get_string('theme'), get_string('info'));
$themes = get_plugin_list('theme');
foreach ($themes as $themename => $themedir) {
// Skip the base theme unless we are in theme designer mode (they might want to look at it)
if (!$CFG->themedesignermode && $themename == 'base') {
continue;
}
// Load the theme config.
try {
@@ -87,6 +82,11 @@ foreach ($themes as $themename => $themedir) {
//obsoleted or broken theme, just skip for now
continue;
}
if (!$CFG->themedesignermode && $theme->hidefromselector) {
// The theme doesn't want to be shown in the theme selector and as theme
// designer mode is switched off we will respect that decision.
continue;
}
// Build the table row, and also a list of items to go in the second cell.
$row = array();