<?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/>.

/**
 * Version details
 *
 * @package    theme_oficial
 * @copyright 2015 Jeremy Hopkins (Coventry University)
 * @copyright 2015 Fernando Acedo (3-bits.com)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 *
 */

defined('MOODLE_INTERNAL') || die;

$temp = new admin_settingpage('theme_oficial_blocks', get_string('blocksettings', 'theme_oficial'));
if ($ADMIN->fulltree) {
    // General.
    $name = 'theme_oficial/settingsblocksgeneral';
    $heading = get_string('settingsblocksgeneral', 'theme_oficial');
    $setting = new admin_setting_heading($name, $heading, '');
    $temp->add($setting);

    // Show the navigation block on the course page.
    $name = 'theme_oficial/shownavigationblockoncoursepage';
    $title = get_string('shownavigationblockoncoursepage', 'theme_oficial');
    $description = get_string('shownavigationblockoncoursepagedesc', 'theme_oficial');
    $default = true;
    $setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
    $temp->add($setting);

    // Colours.
    $name = 'theme_oficial/settingscolors';
    $heading = get_string('settingscolors', 'theme_oficial');
    $setting = new admin_setting_heading($name, $heading, '');
    $temp->add($setting);

    $name = 'theme_oficial/blockbackgroundcolor';
    $title = get_string('blockbackgroundcolor', 'theme_oficial');
    $description = get_string('blockbackgroundcolordesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '#FFFFFF', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockheaderbackgroundcolor';
    $title = get_string('blockheaderbackgroundcolor', 'theme_oficial');
    $description = get_string('blockheaderbackgroundcolordesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '#FFFFFF', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockbordercolor';
    $title = get_string('blockbordercolor', 'theme_oficial');
    $description = get_string('blockbordercolordesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '#59585D', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockregionbackgroundcolor';
    $title = get_string('blockregionbackground', 'theme_oficial');
    $description = get_string('blockregionbackgrounddesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, 'transparent', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Borders.
    $name = 'theme_oficial/settingsborders';
    $heading = get_string('settingsborders', 'theme_oficial');
    $setting = new admin_setting_heading($name, $heading, '');
    $temp->add($setting);

    $name = 'theme_oficial/blockheaderbordertopstyle';
    $title = get_string('blockheaderbordertopstyle', 'theme_oficial');
    $description = get_string('blockheaderbordertopstyledesc', 'theme_oficial');
    $radchoices = $borderstyles;
    $setting = new admin_setting_configselect($name, $title, $description, 'dashed', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockheadertopradius';
    $title = get_string('blockheadertopradius', 'theme_oficial');
    $description = get_string('blockheadertopradiusdesc', 'theme_oficial');
    $radchoices = $from0to20px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockheaderbottomradius';
    $title = get_string('blockheaderbottomradius', 'theme_oficial');
    $description = get_string('blockheaderbottomradiusdesc', 'theme_oficial');
    $radchoices = $from0to20px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockheaderbordertop';
    $title = get_string('blockheaderbordertop', 'theme_oficial');
    $description = get_string('blockheaderbordertopdesc', 'theme_oficial');
    $radchoices = $from0to6px;
    $setting = new admin_setting_configselect($name, $title, $description, '1px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockheaderborderleft';
    $title = get_string('blockheaderborderleft', 'theme_oficial');
    $description = get_string('blockheaderborderleftdesc', 'theme_oficial');
    $radchoices = $from0to6px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockheaderborderright';
    $title = get_string('blockheaderborderright', 'theme_oficial');
    $description = get_string('blockheaderborderrightdesc', 'theme_oficial');
    $radchoices = $from0to6px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockheaderborderbottom';
    $title = get_string('blockheaderborderbottom', 'theme_oficial');
    $description = get_string('blockheaderborderbottomdesc', 'theme_oficial');
    $radchoices = $from0to6px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockmainbordertopstyle';
    $title = get_string('blockmainbordertopstyle', 'theme_oficial');
    $description = get_string('blockmainbordertopstyledesc', 'theme_oficial');
    $radchoices = $borderstyles;
    $setting = new admin_setting_configselect($name, $title, $description, 'none', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockmaintopradius';
    $title = get_string('blockmaintopradius', 'theme_oficial');
    $description = get_string('blockmaintopradiusdesc', 'theme_oficial');
    $radchoices = $from0to20px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockmainbottomradius';
    $title = get_string('blockmainbottomradius', 'theme_oficial');
    $description = get_string('blockmainbottomradiusdesc', 'theme_oficial');
    $radchoices = $from0to20px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockmainbordertop';
    $title = get_string('blockmainbordertop', 'theme_oficial');
    $description = get_string('blockmainbordertopdesc', 'theme_oficial');
    $radchoices = $from0to6px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockmainborderleft';
    $title = get_string('blockmainborderleft', 'theme_oficial');
    $description = get_string('blockmainborderleftdesc', 'theme_oficial');
    $radchoices = $from0to6px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockmainborderright';
    $title = get_string('blockmainborderright', 'theme_oficial');
    $description = get_string('blockmainborderrightdesc', 'theme_oficial');
    $radchoices = $from0to6px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/blockmainborderbottom';
    $title = get_string('blockmainborderbottom', 'theme_oficial');
    $description = get_string('blockmainborderbottomdesc', 'theme_oficial');
    $radchoices = $from0to6px;
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $radchoices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Fonts heading.
    $name = 'theme_oficial/settingsfonts';
    $heading = get_string('settingsfonts', 'theme_oficial');
    $setting = new admin_setting_heading($name, $heading, '');
    $temp->add($setting);

    // Block Header Font size.
    $name = 'theme_oficial/fontblockheadersize';
    $title = get_string('fontblockheadersize', 'theme_oficial');
    $description = get_string('fontblockheadersizedesc', 'theme_oficial');
    $default = '22px';
    $choices = $standardfontsize;
    $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Block Header Font weight.
    $name = 'theme_oficial/fontblockheaderweight';
    $title = get_string('fontblockheaderweight', 'theme_oficial');
    $description = get_string('fontblockheaderweightdesc', 'theme_oficial');
    $setting = new admin_setting_configselect($name, $title, $description, 400, $from100to900);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Block Header Font color.
    $name = 'theme_oficial/fontblockheadercolor';
    $title = get_string('fontblockheadercolor', 'theme_oficial');
    $description = get_string('fontblockheadercolordesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '#3A454b', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Icons heading.
    $name = 'theme_oficial/settingsblockicons';
    $heading = get_string('settingsblockicons', 'theme_oficial');
    $setting = new admin_setting_heading($name, $heading, '');
    $temp->add($setting);

    // Add icon to the title.
    $name = 'theme_oficial/blockicons';
    $title = get_string('blockicons', 'theme_oficial');
    $description = get_string('blockiconsdesc', 'theme_oficial');
    $default = true;
    $setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
    $temp->add($setting);

    // Block Header Icon size.
    $name = 'theme_oficial/blockiconsheadersize';
    $title = get_string('blockiconsheadersize', 'theme_oficial');
    $description = get_string('blockiconsheadersizedesc', 'theme_oficial');
    $default = '20px';
    $choices = $standardfontsize;
    $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);
}
$ADMIN->add('theme_oficial', $temp);
