AutorÃa | Ultima modificación | Ver Log |
<?php// This file is part of Moodle - http://moodle.org///// Moodle is free software: you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation, either version 3 of the License, or// (at your option) any later version.//// Moodle 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.//// You should have received a copy of the GNU General Public License// along with Moodle. If not, see <http://www.gnu.org/licenses/>./**** @package theme_monocolor* @copyright 2022 - 2023 Marcin Czaja (https://rosea.io)* @license Commercial https://themeforest.net/licenses**/defined('MOODLE_INTERNAL') || die();$page = new admin_settingpage('theme_monocolor_settingstopbar', get_string('settingstopbar', 'theme_monocolor'));// Prepare hide nodes options.$hidenodesoptions = array('home' => get_string('home'),'myhome' => get_string('myhome'),'courses' => get_string('mycourses'));// Setting: Hide nodes in primary navigation.$name = 'theme_monocolor/hidenodesprimarynavigation';$title = get_string('hidenodesprimarynavigationsetting', 'theme_monocolor', null, true);$description = get_string('hidenodesprimarynavigationsetting_desc', 'theme_monocolor', null, true);$setting = new admin_setting_configmulticheckbox($name, $title, $description, array(), $hidenodesoptions);$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/topbareditmode';$title = get_string('topbareditmode', 'theme_monocolor');$description = get_string('topbareditmode_desc', 'theme_monocolor');$default = 0;$setting = new admin_setting_configcheckbox($name, $title, $description, $default);$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/topbarlogoareaon';$title = get_string('topbarlogoareaon', 'theme_monocolor');$description = get_string('topbarlogoareaon_desc', 'theme_monocolor');$default = 1;$setting = new admin_setting_configcheckbox($name, $title, $description, $default);$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/customlogo';$title = get_string('customlogo', 'theme_monocolor');$description = get_string('customlogo_desc', 'theme_monocolor');$opts = array('accepted_types' => array('.png', '.jpg', '.svg', 'gif'));$setting = new admin_setting_configstoredfile($name, $title, $description, 'customlogo', 0, $opts);$page->add($setting);$name = 'theme_monocolor/customdmlogo';$title = get_string('customdmlogo', 'theme_monocolor');$description = get_string('customdmlogo_desc', 'theme_monocolor');$opts = array('accepted_types' => array('.png', '.jpg', '.svg', 'gif'));$setting = new admin_setting_configstoredfile($name, $title, $description, 'customdmlogo', 0, $opts);$page->add($setting);$name = 'theme_monocolor/customlogoandname';$title = get_string('customlogoandname', 'theme_monocolor');$description = get_string('customlogoandname_desc', 'theme_monocolor');$default = 1;$setting = new admin_setting_configcheckbox($name, $title, $description, $default);$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/customlogotxt';$title = get_string('customlogotxt', 'theme_monocolor');$description = get_string('customlogotxt_desc', 'theme_monocolor');$default = 'monocolor';$setting = new admin_setting_configtext($name, $title, $description, $default);$page->add($setting);$name = 'theme_monocolor/topbarcustomhtml';$title = get_string('topbarcustomhtml', 'theme_monocolor');$description = get_string('topbarcustomhtml_desc', 'theme_monocolor');$default = '';$setting = new admin_setting_confightmleditor($name, $title, $description, $default);$page->add($setting);// Additional Button next to the Log in button.$name = 'theme_monocolor/topbaradditionalbtn';$title = get_string('topbaradditionalbtn', 'theme_monocolor');$description = get_string('topbaradditionalbtn_desc', 'theme_monocolor');$default = 1;$setting = new admin_setting_configcheckbox($name, $title, $description, $default);$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/stopbaradditionalbtn';$title = get_string('stopbaradditionalbtn', 'theme_monocolor');$description = get_string('stopbaradditionalbtn_desc', 'theme_monocolor');$default = '';$setting = new admin_setting_configtextarea($name, $title, $description, $default);$page->add($setting);$name = 'theme_monocolor/topbaradditionalbtnurl';$title = get_string('topbaradditionalbtnurl', 'theme_monocolor');$description = get_string('topbaradditionalbtnurl_desc', 'theme_monocolor');$default = '';$setting = new admin_setting_configtext($name, $title, $description, $default);$page->add($setting);// Colors.$name = 'theme_monocolor/htopbarcolors';$heading = get_string('htopbarcolors', 'theme_monocolor');$title = get_string('htopbarcolors_desc', 'theme_monocolor');$setting = new admin_setting_heading($name, $heading, format_text($title, FORMAT_MARKDOWN));$page->add($setting);$name = 'theme_monocolor/colortopbarbg';$title = get_string('colortopbarbg', 'theme_monocolor');$description = get_string('color_desc', 'theme_monocolor');$setting = new admin_setting_configcolourpicker($name, $title, $description, '');$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/colortopbartext';$title = get_string('colortopbartext', 'theme_monocolor');$description = get_string('color_desc', 'theme_monocolor');$setting = new admin_setting_configcolourpicker($name, $title, $description, '');$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/colortopbarbtn';$title = get_string('colortopbarbtn', 'theme_monocolor');$description = get_string('color_desc', 'theme_monocolor');$setting = new admin_setting_configcolourpicker($name, $title, $description, '');$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/colortopbarbtntext';$title = get_string('colortopbarbtntext', 'theme_monocolor');$description = get_string('color_desc', 'theme_monocolor');$setting = new admin_setting_configcolourpicker($name, $title, $description, '');$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/colortopbarbtnhover';$title = get_string('colortopbarbtnhover', 'theme_monocolor');$description = get_string('color_desc', 'theme_monocolor');$setting = new admin_setting_configcolourpicker($name, $title, $description, '');$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);$name = 'theme_monocolor/colortopbarbtnhovertext';$title = get_string('colortopbarbtnhovertext', 'theme_monocolor');$description = get_string('color_desc', 'theme_monocolor');$setting = new admin_setting_configcolourpicker($name, $title, $description, '');$setting->set_updatedcallback('theme_reset_all_caches');$page->add($setting);// Must add the page after definiting all the settings!$settings->add($page);