/** * Validate data. * * This ensures that key file is provided if URL is provided. * * @param string $data * @return mixed True on success, else error message. */ public function validate($data) { $result = parent::validate($data); if ($result !== true) { return $result; } $usercontext = context_user::instance($USER->id); $url = get_config('filter_cloudfront_signurl', 'distributionurl'); $fs = get_file_storage(); if ($url != '' && empty($data)) { return get_string('errornoprivatekey', 'filter_cloudfront_signurl'); } return true; }
$name = 'theme_mmcmonkwearmouth/teacher_buttons'; $title = get_string('teacherbuttons', 'theme_mmcmonkwearmouth'); $description = get_string('settingbuttonsdesc', 'theme_mmcmonkwearmouth'); $setting = new theme_mmcmonkwearmouth_admin_setting_buttons($name, $title, $description, 0); $setting->set_updatedcallback('theme_reset_all_caches'); $settings->add($setting); $name = 'theme_mmcmonkwearmouth/student_buttons'; $title = get_string('studentbuttons', 'theme_mmcmonkwearmouth'); $description = get_string('settingbuttonsdesc', 'theme_mmcmonkwearmouth'); $setting = new theme_mmcmonkwearmouth_admin_setting_buttons($name, $title, $description, 0); $setting->set_updatedcallback('theme_reset_all_caches'); $settings->add($setting); $name = 'theme_mmcmonkwearmouth/staff_buttons'; $title = get_string('staffbuttons', 'theme_mmcmonkwearmouth'); $description = get_string('settingbuttonsdesc', 'theme_mmcmonkwearmouth'); $setting = new theme_mmcmonkwearmouth_admin_setting_buttons($name, $title, $description, 0); $setting->set_updatedcallback('theme_reset_all_caches'); $settings->add($setting); $name = 'theme_mmcmonkwearmouth/logo'; $title = get_string('logo', 'theme_mmcmonkwearmouth'); $description = get_string('logodesc', 'theme_mmcmonkwearmouth'); $setting = new admin_setting_configstoredfile($name, $title, $description, 'logo'); $setting->set_updatedcallback('theme_reset_all_caches'); $settings->add($setting); $name = 'theme_mmcmonkwearmouth/customcss'; $title = get_string('customcss', 'theme_mmcmonkwearmouth'); $description = get_string('customcssdesc', 'theme_mmcmonkwearmouth'); $default = ''; $setting = new admin_setting_configtextarea($name, $title, $description, $default); $setting->set_updatedcallback('theme_reset_all_caches'); $settings->add($setting);
$configdesc = get_string('cfg_redirecturi_desc', 'auth_oidc'); $settings->add(new \auth_oidc\form\adminsetting\redirecturi('auth_oidc/redirecturi', $configkey, $configdesc)); $configkey = get_string('cfg_autoappend_key', 'auth_oidc'); $configdesc = get_string('cfg_autoappend_desc', 'auth_oidc'); $configdefault = ''; $settings->add(new admin_setting_configtext('auth_oidc/autoappend', $configkey, $configdesc, $configdefault, PARAM_TEXT)); $configkey = get_string('cfg_domainhint_key', 'auth_oidc'); $configdesc = get_string('cfg_domainhint_desc', 'auth_oidc'); $configdefault = ''; $settings->add(new admin_setting_configtext('auth_oidc/domainhint', $configkey, $configdesc, $configdefault, PARAM_TEXT)); $configkey = get_string('cfg_loginflow_key', 'auth_oidc'); $configdesc = ''; $configdefault = 'authcode'; $settings->add(new \auth_oidc\form\adminsetting\loginflow('auth_oidc/loginflow', $configkey, $configdesc, $configdefault)); $configkey = get_string('cfg_userrestrictions_key', 'auth_oidc'); $configdesc = get_string('cfg_userrestrictions_desc', 'auth_oidc'); $configdefault = ''; $settings->add(new admin_setting_configtextarea('auth_oidc/userrestrictions', $configkey, $configdesc, $configdefault, PARAM_TEXT)); $label = get_string('cfg_debugmode_key', 'auth_oidc'); $desc = get_string('cfg_debugmode_desc', 'auth_oidc'); $settings->add(new \admin_setting_configcheckbox('auth_oidc/debugmode', $label, $desc, '0')); $configkey = get_string('cfg_icon_key', 'auth_oidc'); $configdesc = get_string('cfg_icon_desc', 'auth_oidc'); $configdefault = 'auth_oidc:o365'; $icons = [['pix' => 'o365', 'alt' => get_string('cfg_iconalt_o365', 'auth_oidc'), 'component' => 'auth_oidc'], ['pix' => 't/locked', 'alt' => get_string('cfg_iconalt_locked', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 't/lock', 'alt' => get_string('cfg_iconalt_lock', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 't/go', 'alt' => get_string('cfg_iconalt_go', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 't/stop', 'alt' => get_string('cfg_iconalt_stop', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 't/user', 'alt' => get_string('cfg_iconalt_user', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 'u/user35', 'alt' => get_string('cfg_iconalt_user2', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 'i/permissions', 'alt' => get_string('cfg_iconalt_key', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 'i/cohort', 'alt' => get_string('cfg_iconalt_group', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 'i/groups', 'alt' => get_string('cfg_iconalt_group2', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 'i/mnethost', 'alt' => get_string('cfg_iconalt_mnet', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 'i/permissionlock', 'alt' => get_string('cfg_iconalt_userlock', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 't/more', 'alt' => get_string('cfg_iconalt_plus', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 't/approve', 'alt' => get_string('cfg_iconalt_check', 'auth_oidc'), 'component' => 'moodle'], ['pix' => 't/right', 'alt' => get_string('cfg_iconalt_rightarrow', 'auth_oidc'), 'component' => 'moodle']]; $settings->add(new \auth_oidc\form\adminsetting\iconselect('auth_oidc/icon', $configkey, $configdesc, $configdefault, $icons)); $configkey = get_string('cfg_customicon_key', 'auth_oidc'); $configdesc = get_string('cfg_customicon_desc', 'auth_oidc'); $setting = new admin_setting_configstoredfile('auth_oidc/customicon', $configkey, $configdesc, 'customicon'); $setting->set_updatedcallback('auth_oidc_initialize_customicon'); $settings->add($setting);
public function add_file($setting) { $file = new admin_setting_configstoredfile($this->name_for($setting), $this->title_for($setting), $this->description_for($setting), $setting); $file->set_updatedcallback('theme_reset_all_caches'); $this->settingspage->add($file); }
public function add_files($setting, $instance) { $file = new admin_setting_configstoredfile($this->name_for($setting . $instance), $this->title_for($setting, $instance), $this->description_for($setting), $setting . $instance); $file->set_updatedcallback('theme_reset_all_caches'); return $file; }
$setting->set_updatedcallback('theme_reset_all_caches'); $settings->add($setting); // Favicon file setting. $name = 'theme_snap/favicon'; $title = new lang_string('favicon', 'theme_snap'); $description = new lang_string('favicondesc', 'theme_snap'); $opts = array('accepted_types' => array('.ico')); $setting = new admin_setting_configstoredfile($name, $title, $description, 'favicon', 0, $opts); $setting->set_updatedcallback('theme_reset_all_caches'); $settings->add($setting); // Cover image file setting. $name = 'theme_snap/poster'; $title = new lang_string('poster', 'theme_snap'); $description = new lang_string('posterdesc', 'theme_snap'); $opts = array('accepted_types' => array('.png', '.jpg', '.gif', '.webp', '.tiff', '.svg')); $setting = new admin_setting_configstoredfile($name, $title, $description, 'poster', 0, $opts); $setting->set_updatedcallback('theme_snap_process_site_coverimage'); $settings->add($setting); $name = 'theme_snap/menusandnavheading'; $title = new lang_string('menusandnavheading', 'theme_snap'); $description = new lang_string('menusandnavheadingdesc', 'theme_snap'); $setting = new admin_setting_heading($name, $title, $description); $settings->add($setting); // Hide navigation block. $name = 'theme_snap/hidenavblock'; $title = new lang_string('hidenavblock', 'theme_snap'); $description = new lang_string('hidenavblockdesc', 'theme_snap'); $checked = '1'; $unchecked = '0'; $default = $checked; $setting = new admin_setting_configcheckbox($name, $title, $description, $default, $checked, $unchecked);
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. 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()) { $logos_options = new admin_settingpage('theme_archaius_logos', get_string('logossectiontitle', 'theme_archaius')); $logos_options->add(new admin_setting_heading('theme_archaius_logos', get_string('logossectionsub', 'theme_archaius'), format_text(get_string('logossectiondesc', 'theme_archaius'), FORMAT_MARKDOWN))); // Logo file setting $name = 'theme_archaius/logo'; $title = get_string('logo', 'theme_archaius'); $description = get_string('logodesc', 'theme_archaius'); $setting = new admin_setting_configstoredfile($name, $title, $description, 'logo'); $setting->set_updatedcallback('theme_reset_all_caches'); $logos_options->add($setting); //Mobile Logo setting $name = 'theme_archaius/mobilelogo'; $title = get_string('mlogo', 'theme_archaius'); $description = get_string('mlogodesc', 'theme_archaius'); $setting = new admin_setting_configstoredfile($name, $title, $description, 'mobilelogo'); $setting->set_updatedcallback('theme_reset_all_caches'); $logos_options->add($setting); //Add options to admin tree $ADMIN->add('theme_archaius', $logos_options); }
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()) { $layout_color_options = new admin_settingpage('theme_archaius_layout_colors', get_string('layoutcolorssectiontitle', 'theme_archaius')); $layout_color_options->add(new admin_setting_heading('theme_archaius_layout_colors', get_string('layoutcolorssectionsub', 'theme_archaius'), format_text(get_string('layoutcolorssectiondesc', 'theme_archaius'), FORMAT_MARKDOWN))); // Login background image $name = 'theme_archaius/loginbackgroundimage'; $title = get_string('loginbackgroundimage', 'theme_archaius'); $description = get_string('loginbackgroundimagedesc', 'theme_archaius'); $setting = new admin_setting_configstoredfile($name, $title, $description, 'loginbackgroundimage'); $setting->set_updatedcallback('theme_reset_all_caches'); $layout_color_options->add($setting); //Background color $name = 'theme_archaius/bgcolor'; $title = get_string('bgcolor', 'theme_archaius'); $description = get_string('bgcolordesc', 'theme_archaius'); $default = '#fff'; $previewconfig = array('selector' => 'html,body', 'style' => 'backgroundColor'); $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig); $setting->set_updatedcallback('theme_reset_all_caches'); $layout_color_options->add($setting); // theme color setting $name = 'theme_archaius/themecolor'; $title = get_string('themecolor', 'theme_archaius'); $description = get_string('themecolordesc', 'theme_archaius');