Skip to content

Commit

Permalink
MDL-39178 add missing update callback for all theme settings
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Apr 20, 2013
1 parent 3a8c438 commit abea8b4
Show file tree
Hide file tree
Showing 14 changed files with 74 additions and 0 deletions.
2 changes: 2 additions & 0 deletions theme/afterburner/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
$description = get_string('footnotedesc', 'theme_afterburner');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Custom CSS file
Expand All @@ -26,6 +27,7 @@
$description = get_string('customcssdesc', 'theme_afterburner');
$default = '';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

}
2 changes: 2 additions & 0 deletions theme/anomaly/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$description = get_string('taglinedesc', 'theme_anomaly');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Custom CSS file
Expand All @@ -18,6 +19,7 @@
$description = get_string('customcssdesc', 'theme_anomaly');
$default = '';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

}
5 changes: 5 additions & 0 deletions theme/arialist/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
$title = get_string('logo','theme_arialist');
$description = get_string('logodesc', 'theme_arialist');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Tagline setting
$name = 'theme_arialist/tagline';
$title = get_string('tagline','theme_arialist');
$description = get_string('taglinedesc', 'theme_arialist');
$setting = new admin_setting_configtext($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Link colour setting
Expand All @@ -28,6 +30,7 @@
$default = '#f25f0f';
$previewconfig = array('selector'=>'.block .content', 'style'=>'linkcolor');
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Block region width
Expand All @@ -37,12 +40,14 @@
$default = 250;
$choices = array(180=>'180px', 190=>'190px', 200=>'200px', 210=>'210px', 220=>'220px', 240=>'240px', 250=>'250px');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Custom CSS file
$name = 'theme_arialist/customcss';
$title = get_string('customcss','theme_arialist');
$description = get_string('customcssdesc', 'theme_arialist');
$setting = new admin_setting_configtextarea($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
}
6 changes: 6 additions & 0 deletions theme/brick/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
$title = get_string('logo','theme_brick');
$description = get_string('logodesc', 'theme_brick');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// link color setting
Expand All @@ -19,6 +20,7 @@
$default = '#06365b';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// link hover color setting
Expand All @@ -28,6 +30,7 @@
$default = '#5487ad';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// main color setting
Expand All @@ -37,6 +40,7 @@
$default = '#8e2800';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// main color accent setting
Expand All @@ -46,6 +50,7 @@
$default = '#fff0a5';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// heading color setting
Expand All @@ -55,6 +60,7 @@
$default = '#5c3500';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

}
15 changes: 15 additions & 0 deletions theme/formal_white/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
$default = '13';
$choices = array(11=>'11px', 12=>'12px', 13=>'13px', 14=>'14px', 15=>'15px', 16=>'16px');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// moodle 1.* like setting
Expand All @@ -22,6 +23,7 @@
$description = get_string('noframedesc', 'theme_formal_white');
$default = '0';
$setting = new admin_setting_configcheckbox($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Frame margin
Expand All @@ -31,6 +33,7 @@
$default = '15';
$choices = array(0=>'0px', 5=>'5px', 10=>'10px', 15=>'15px', 20=>'20px', 25=>'25px', 30=>'30px', 35=>'35px', 40=>'40px', 45=>'45px', 50=>'50px');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Display logo or heading
Expand All @@ -40,6 +43,7 @@
$default = '1';
$choices = array(1=>get_string('displaylogo', 'theme_formal_white'), 0=>get_string('displayheading', 'theme_formal_white'));
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Custom site logo setting
Expand All @@ -48,6 +52,7 @@
$description = get_string('customlogourldesc', 'theme_formal_white');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_RAW); // we want it accepting ../ at the beginning. Security is not at its top but Moodle trusts admins.
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Custom front page site logo setting
Expand All @@ -56,6 +61,7 @@
$description = get_string('frontpagelogourldesc', 'theme_formal_white');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_RAW); // we want it accepting ../ at the beginning. Security is not at its top but Moodle trusts admins.
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// page header background colour setting
Expand All @@ -65,6 +71,7 @@
$default = '#E3DFD4';
$previewconfig = array('selector'=>'#page-header', 'style'=>'backgroundColor');
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// creditstomoodleorg: ctmo
Expand All @@ -74,6 +81,7 @@
$default = '2';
$choices = array(2 => get_string('ctmo_ineverypage', 'theme_formal_white'), 1 => get_string('ctmo_onfrontpageonly', 'theme_formal_white'), 0 => get_string('ctmo_no', 'theme_formal_white'));
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Block region width
Expand All @@ -83,6 +91,7 @@
$default = '200';
$choices = array(150=>'150px', 170=>'170px', 200=>'200px', 240=>'240px', 290=>'290px', 350=>'350px', 420=>'420px');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Block padding
Expand All @@ -92,6 +101,7 @@
$default = '8';
$choices = array(1=>'1px', 2=>'2px', 4=>'4px', 8=>'8px', 12=>'12px', 16=>'16px');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Block content background colour setting
Expand All @@ -101,6 +111,7 @@
$default = '#F6F6F6';
$previewconfig = array('selector'=>'.block .content', 'style'=>'backgroundColor');
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Left column colour setting
Expand All @@ -110,6 +121,7 @@
$default = '#E3DFD4';
$previewconfig = array('selector'=>'#page-content, #page-content #region-pre, #page-content #region-post-box', 'style'=>'backgroundColor');
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Right column colour setting
Expand All @@ -119,6 +131,7 @@
$default = '';
$previewconfig = array('selector'=>'#page-content #region-post-box, #page-content #region-post', 'style'=>'backgroundColor');
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Foot note setting
Expand All @@ -127,6 +140,7 @@
$description = get_string('footnotedesc', 'theme_formal_white');
$default = '';
$setting = new admin_setting_confightmleditor($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Custom CSS file
Expand All @@ -135,5 +149,6 @@
$description = get_string('customcssdesc', 'theme_formal_white');
$default = '';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
}
4 changes: 4 additions & 0 deletions theme/fusion/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,31 @@
$default = '#2d83d5';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Tag line setting
$name = 'theme_fusion/tagline';
$title = get_string('tagline','theme_fusion');
$description = get_string('taglinedesc', 'theme_fusion');
$setting = new admin_setting_configtext($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Foot note setting
$name = 'theme_fusion/footertext';
$title = get_string('footertext','theme_fusion');
$description = get_string('footertextdesc', 'theme_fusion');
$setting = new admin_setting_confightmleditor($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// Custom CSS file
$name = 'theme_fusion/customcss';
$title = get_string('customcss','theme_fusion');
$description = get_string('customcssdesc', 'theme_fusion');
$setting = new admin_setting_configtextarea($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

}
9 changes: 9 additions & 0 deletions theme/magazine/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
$title = get_string('background','theme_magazine');
$description = get_string('backgrounddesc', 'theme_magazine');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// logo image setting
$name = 'theme_magazine/logo';
$title = get_string('logo','theme_magazine');
$description = get_string('logodesc', 'theme_magazine');
$setting = new admin_setting_configtext($name, $title, $description, '', PARAM_URL);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// link color setting
Expand All @@ -25,6 +27,7 @@
$default = '#32529a';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// link hover color setting
Expand All @@ -34,6 +37,7 @@
$default = '#4e2300';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// main color setting
Expand All @@ -43,6 +47,7 @@
$default = '#002f2f';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// main color accent setting
Expand All @@ -52,6 +57,7 @@
$default = '#092323';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// heading color setting
Expand All @@ -61,6 +67,7 @@
$default = '#4e0000';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// block heading color setting
Expand All @@ -70,6 +77,7 @@
$default = '#002f2f';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

// forum subject background color setting
Expand All @@ -79,6 +87,7 @@
$default = '#e6e2af';
$previewconfig = NULL;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

}
6 changes: 6 additions & 0 deletions theme/mymobile/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@
'grey' => get_string('grey', 'theme_mymobile')
);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

$name = 'theme_mymobile/showmobileintro';
$title = get_string('showmobileintro','theme_mymobile');
$description = get_string('showmobileintro_desc', 'theme_mymobile');
$setting = new admin_setting_confightmleditor($name, $title, $description, '');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

$name = 'theme_mymobile/showsitetopic';
Expand All @@ -56,6 +58,7 @@
$default = 'topicshow';
$choices = array('topicshow' => $yesstr, 'topicnoshow' => $nostr);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

$name = 'theme_mymobile/showfullsizeimages';
Expand All @@ -64,6 +67,7 @@
$default = 'ithumb';
$choices = array('ithumb' => $nostr, 'ithumbno' => $yesstr);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

$name = 'theme_mymobile/usetableview';
Expand All @@ -72,13 +76,15 @@
$default = 'tabshow';
$choices = array('tabshow' => $yesstr, 'tabnoshow' => $nostr);
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

$name = 'theme_mymobile/customcss';
$title = get_string('customcss','theme_mymobile');
$description = get_string('customcssdesc', 'theme_mymobile');
$default = '';
$setting = new admin_setting_configtextarea($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);

unset($yesstr);
Expand Down
Loading

0 comments on commit abea8b4

Please sign in to comment.