public function add_colourpicker($setting, $default = '#666')
 {
     $colorpicker = new admin_setting_configcolourpicker($this->name_for($setting), $this->title_for($setting), $this->description_for($setting), $default, null);
     $colorpicker->set_updatedcallback('theme_reset_all_caches');
     $this->settingspage->add($colorpicker);
 }
示例#2
0
// YouTube url setting.
$name = 'theme_lambda/youtube';
$title = get_string('youtube', 'theme_lambda');
$description = get_string('youtubedesc', 'theme_lambda');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// social icons color setting.
$name = 'theme_lambda/socials_color';
$title = get_string('socials_color', 'theme_lambda');
$description = get_string('socials_color_desc', 'theme_lambda');
$default = '#a9a9a9';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
// social icons position
$name = 'theme_lambda/socials_position';
$title = get_string('socials_position', 'theme_lambda');
$description = get_string('socials_position_desc', 'theme_lambda');
$default = '0';
$choices = array('0' => 'footer', '1' => 'header');
$setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
$setting->set_updatedcallback('theme_reset_all_caches');
$temp->add($setting);
$ADMIN->add('theme_lambda', $temp);
// "settings fonts" settingpage
$temp = new admin_settingpage('theme_lambda_fonts', get_string('settings_fonts', 'theme_lambda'));
$name = 'theme_lambda/font_body';
$title = get_string('fontselect_body', 'theme_lambda');
 public function add_colourpickers($setting, $default = '#666', $instance)
 {
     $colorpicker = new admin_setting_configcolourpicker($this->name_for($setting . $instance), $this->title_for($setting, $instance), $this->description_for($setting), $default, null);
     $colorpicker->set_updatedcallback('theme_reset_all_caches');
     return $colorpicker;
 }