Пример #1
0
$temp->add($setting);
// 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';
 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);
 }
 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;
 }
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
This plugin is part of Archaius theme.
@copyright  2015 onwards Daniel Munera Sanchez
*/
defined('MOODLE_INTERNAL') || die;
if (is_siteadmin()) {
    $footer_options = new admin_settingpage('theme_archaius_footer', get_string('footersectiontitle', 'theme_archaius'));
    $footer_options->add(new admin_setting_heading('theme_archaius_footer', get_string('footersectionsub', 'theme_archaius'), format_text(get_string('footersectiondesc', 'theme_archaius'), FORMAT_MARKDOWN)));
    // Foot note setting
    $name = 'theme_archaius/footnote';
    $title = get_string('footnote', 'theme_archaius');
    $description = get_string('footnotedesc', 'theme_archaius');
    $default = '';
    $setting = new admin_setting_confightmleditor($name, $title, $description, $default);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $footer_options->add($setting);
    // footer text color
    $name = 'theme_archaius/footertextcolor';
    $title = get_string('footertextcolor', 'theme_archaius');
    $description = get_string('footertextcolordesc', 'theme_archaius');
    $default = '#F5F5F5';
    $previewconfig = array('selector' => '#page-footer, #page-footer a', 'style' => 'color');
    $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $footer_options->add($setting);
    //Add options to admin tree
    $ADMIN->add('theme_archaius', $footer_options);
}
Пример #5
0
// Slide button colour setting.
$name = 'theme_essentials/slidebuttoncolor';
$title = get_string('slidebuttoncolor', 'theme_essential');
$description = get_string('slidebuttoncolordesc', 'theme_essential');
$default = '#30add1';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$generalsettings->add($setting);
// Slide button hover colour setting.
$name = 'theme_essentials/slidebuttonhovercolor';
$title = get_string('slidebuttonhovercolor', 'theme_essential');
$description = get_string('slidebuttonhovercolordesc', 'theme_essential');
$default = '#217a94';
$previewconfig = null;
$setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
$setting->set_updatedcallback('theme_reset_all_caches');
$generalsettings->add($setting);
$numberofslides = get_config('theme_essentials', 'numberofslides');
for ($i = 1; $i <= $numberofslides; $i++) {
    // This is the descriptor.
    $name = 'theme_essentials/slide' . $i . 'info';
    $heading = get_string('slideno', 'theme_essential', array('slide' => $i));
    $information = get_string('slidenodesc', 'theme_essential', array('slide' => $i));
    $setting = new admin_setting_heading($name, $heading, $information);
    $generalsettings->add($setting);
    // Title.
    $name = 'theme_essentials/slide' . $i;
    $title = get_string('slidetitle', 'theme_essential');
    $description = get_string('slidetitledesc', 'theme_essential');
    $default = '';
    $layout_color_options->add($setting);
    // custommenu color
    $name = 'theme_archaius/custommenucolor';
    $title = get_string('custommenucolor', 'theme_archaius');
    $description = get_string('custommenucolor', 'theme_archaius');
    $default = '#697F6F';
    $previewconfig = array('selector' => '#custommenu', 'style' => 'backgroundColor');
    $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $layout_color_options->add($setting);
    // custommenucurrent color
    $name = 'theme_archaius/currentcustommenucolor';
    $title = get_string('currentcustommenucolor', 'theme_archaius');
    $description = get_string('currentcustommenucolor', 'theme_archaius');
    $default = '#2E3332';
    $previewconfig = array('selector' => 'div.region-content div.header.current', 'style' => 'backgroundColor');
    $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $layout_color_options->add($setting);
    // header text color
    $name = 'theme_archaius/headertextcolor';
    $title = get_string('headertextcolor', 'theme_archaius');
    $description = get_string('headertextcolordesc', 'theme_archaius');
    $default = '#F5F5F5';
    $previewconfig = array('selector' => '#page-header, #page-header a:link, #page-header a:visited, #page-header .usermenu .moodle-actionmenu .toggle-display .userbutton .usertext, #page-header .usermenu .moodle-actionmenu:hover .toggle-display .userbutton .usertext', 'style' => 'color');
    $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $layout_color_options->add($setting);
    //Add options to admin tree
    $ADMIN->add('theme_archaius', $layout_color_options);
}