<?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;

// Header Navbar.
$temp = new admin_settingpage('theme_oficial_navbar_styles', get_string('navbarstyles', 'theme_oficial'));
if ($ADMIN->fulltree) {
    $temp->add(new admin_setting_heading('theme_oficial_navbar_styles', get_string('navbarstylesheading', 'theme_oficial'),
        format_text(get_string('navbarstylesdesc', 'theme_oficial'), FORMAT_MARKDOWN)));

    // Main menu background color.
    $name = 'theme_oficial/menubkcolor';
    $title = get_string('menubkcolor', 'theme_oficial');
    $description = get_string('menubkcolordesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '#ffffff', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Main menu text color.
    $name = 'theme_oficial/menufontcolor';
    $title = get_string('menufontcolor', 'theme_oficial');
    $description = get_string('menufontcolordesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '#222222', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Main menu hover color.
    $name = 'theme_oficial/menuhovercolor';
    $title = get_string('menuhovercolor', 'theme_oficial');
    $description = get_string('menuhovercolordesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '#00B3A1', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Main menu bottom border color.
    $name = 'theme_oficial/menubordercolor';
    $title = get_string('menubordercolor', 'theme_oficial');
    $description = get_string('menubordercolordesc', 'theme_oficial');
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '#00B3A1', $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    $name = 'theme_oficial/navbardisplayicons';
    $title = get_string('navbardisplayicons', 'theme_oficial');
    $description = get_string('navbardisplayiconsdesc', 'theme_oficial');
    $default = true;
    $setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
    $temp->add($setting);

    $name = 'theme_oficial/navbardisplaysubmenuarrow';
    $title = get_string('navbardisplaysubmenuarrow', 'theme_oficial');
    $description = get_string('navbardisplaysubmenuarrowdesc', 'theme_oficial');
    $default = false;
    $setting = new admin_setting_configcheckbox($name, $title, $description, $default, true, false);
    $temp->add($setting);

    // Dropdown border radius.
    $name = 'theme_oficial/navbardropdownborderradius';
    $title = get_string('navbardropdownborderradius', 'theme_oficial');
    $description = get_string('navbardropdownborderradiusdesc', 'theme_oficial');
    $setting = new admin_setting_configselect($name, $title, $description, '0px', $from0to20px);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Dropdown Menu Item Link background hover colour.
    $name = 'theme_oficial/navbardropdownhovercolor';
    $title = get_string('navbardropdownhovercolor', 'theme_oficial');
    $description = get_string('navbardropdownhovercolordesc', 'theme_oficial');
    $default = '#EEE';
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Dropdown Menu Item Link text colour.
    $name = 'theme_oficial/navbardropdowntextcolor';
    $title = get_string('navbardropdowntextcolor', 'theme_oficial');
    $description = get_string('navbardropdowntextcolordesc', 'theme_oficial');
    $default = '#007';
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Dropdown Menu Item Link text hover colour.
    $name = 'theme_oficial/navbardropdowntexthovercolor';
    $title = get_string('navbardropdowntexthovercolor', 'theme_oficial');
    $description = get_string('navbardropdowntexthovercolordesc', 'theme_oficial');
    $default = '#000';
    $previewconfig = null;
    $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);

    // Dropdown transition time.
    $name = 'theme_oficial/navbardropdowntransitiontime';
    $title = get_string('navbardropdowntransitiontime', 'theme_oficial');
    $description = get_string('navbardropdowntransitiontimedesc', 'theme_oficial');
    $setting = new admin_setting_configselect($name, $title, $description, '0.2s', $from0to1second);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $temp->add($setting);
}

// Create page.
$ADMIN->add('theme_oficial', $temp);
