settings.php 5.24 KB
Newer Older
Camille Tardy's avatar
Camille Tardy committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<?php

defined('MOODLE_INTERNAL') || die();

if ($ADMIN->fulltree) {
    $settings = new theme_boost_admin_settingspage_tabs('themesettingunige', get_string('settingstitle', 'theme_unige'));
    $page = new admin_settingpage('theme_unige_general', get_string('generalsettings', 'theme_unige'));

    // Variable $body-color.
    // We use an empty default value because the default colour should come from the preset.
    $name = 'theme_unige/brandcolor';
    $title = get_string('brandcolor', 'theme_unige');
    $description = get_string('brandcolor_desc', 'theme_unige');
    $setting = new admin_setting_configcolourpicker($name, $title, $description, '');
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    $settings->add($page);

    // Navbar
    $page = new admin_settingpage('theme_unige_header', get_string('navbar', 'theme_unige'));

    // Navigation menu links
    $name = 'theme_unige/navigation_menu';
    $title = get_string('navigationmenu', 'theme_unige');
    $description = get_string('navigationmenu_desc', 'theme_unige');
    $default = "/my;
28
    /course;";
Camille Tardy's avatar
Camille Tardy committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
    $setting = new admin_setting_configtextarea($name, $title, $description, $default);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    // Redirection menu links
    $name = 'theme_unige/redirection_menu';
    $title = get_string('redirectionmenu', 'theme_unige');
    $description = get_string('redirectionmenu_desc', 'theme_unige');;
    $default = "https://moodle.unige.ch/;
        https://mediaserver.unige.ch/;
        https://portfolio.unige.ch/;
        https://outlook.unige.ch/;
        https://portail.unige.ch/;
        https://www.unige.ch/dife/enseigner-apprendre/soutien-apprentissage/;";
    $setting = new admin_setting_configtextarea($name, $title, $description, $default);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    $settings->add($page);

    // Footer
    $page = new admin_settingpage('theme_unige_footer', get_string('footer', 'theme_unige'));

    // Column left links
    $name = 'theme_unige/footer_column_left';
    $title = get_string('footercolumnleft', 'theme_unige');
    $description = get_string('footercolumnleft_desc', 'theme_unige');
    $default = "https://moodle.unige.ch/pluginfile.php/32140/block_html/content/guide_etu_moodle_201617.pdf;
        https://moodle.unige.ch/pluginfile.php/32140/block_html/content/guide_etu_moodle_en_201617.pdf;
        https://elearning.unige.ch/ressources/plateformes/moodle/fichesinteractives/;
        https://plone.unige.ch/distic/pub/cad/;";
    $setting = new admin_setting_configtextarea($name, $title, $description, $default);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    // Column middle display
    $name = 'theme_unige/footer_column_middle_display';
    $title = get_string('footercolumnmiddledisplay', 'theme_unige');
    $description = get_string('footercolumnmiddledisplay_desc', 'theme_unige');
    $default = "0";
    $setting = new admin_setting_configcheckbox($name, $title, $description, $default);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    // Column middle links
    $name = 'theme_unige/footer_column_middle';
    $title = get_string('footercolumnmiddle', 'theme_unige');
    $description = get_string('footercolumnmiddle_desc', 'theme_unige');
    $default = "";
    $setting = new admin_setting_configtextarea($name, $title, $description, $default);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    // Column right iOS app url
    $name = 'theme_unige/footer_column_right_app_ios_url';
    $title = get_string('footercolumnrightappiosurl', 'theme_unige');
    $description = get_string('footercolumnrightappiosurl_desc', 'theme_unige');
    $default = "https://www.unige.ch/";
    $setting = new admin_setting_configtext($name, $title, $description, $default);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    // Column right Android app url
    $name = 'theme_unige/footer_column_right_app_android_url';
    $title = get_string('footercolumnrightappandroidurl', 'theme_unige');
    $description = get_string('footercolumnrightappandroidurl_desc', 'theme_unige');
    $default = "https://www.unige.ch/";
    $setting = new admin_setting_configtext($name, $title, $description, $default);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    $settings->add($page);

    // Advanced settings
    $page = new admin_settingpage('theme_unige_advanced', get_string('advancedsettings', 'theme_unige'));

    // Raw SCSS to include before the content
    $setting = new admin_setting_scsscode('theme_unige/scsspre',
        get_string('rawscsspre', 'theme_unige'), get_string('rawscsspre_desc', 'theme_unige'), '', PARAM_RAW);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    // Raw SCSS to include after the content
    $setting = new admin_setting_scsscode('theme_unige/scss', get_string('rawscss', 'theme_unige'),
        get_string('rawscss_desc', 'theme_unige'), '', PARAM_RAW);
    $setting->set_updatedcallback('theme_reset_all_caches');
    $page->add($setting);

    $settings->add($page);
}