| 1 | 
           efrain | 
           1 | 
           <?php
  | 
        
        
            | 
            | 
           2 | 
           // This file is part of Moodle - http://moodle.org/
  | 
        
        
            | 
            | 
           3 | 
           //
  | 
        
        
            | 
            | 
           4 | 
           // Moodle is free software: you can redistribute it and/or modify
  | 
        
        
            | 
            | 
           5 | 
           // it under the terms of the GNU General Public License as published by
  | 
        
        
            | 
            | 
           6 | 
           // the Free Software Foundation, either version 3 of the License, or
  | 
        
        
            | 
            | 
           7 | 
           // (at your option) any later version.
  | 
        
        
            | 
            | 
           8 | 
           //
  | 
        
        
            | 
            | 
           9 | 
           // Moodle is distributed in the hope that it will be useful,
  | 
        
        
            | 
            | 
           10 | 
           // but WITHOUT ANY WARRANTY; without even the implied warranty of
  | 
        
        
            | 
            | 
           11 | 
           // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  | 
        
        
            | 
            | 
           12 | 
           // GNU General Public License for more details.
  | 
        
        
            | 
            | 
           13 | 
           //
  | 
        
        
            | 
            | 
           14 | 
           // You should have received a copy of the GNU General Public License
  | 
        
        
            | 
            | 
           15 | 
           // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  | 
        
        
            | 
            | 
           16 | 
              | 
        
        
            | 
            | 
           17 | 
           /**
  | 
        
        
            | 
            | 
           18 | 
            * universe config.
  | 
        
        
            | 
            | 
           19 | 
            *
  | 
        
        
            | 
            | 
           20 | 
            * @package   theme_universe
  | 
        
        
            | 
            | 
           21 | 
            * @copyright 2023 Marcin Czaja (https://rosea.io)
  | 
        
        
            | 
            | 
           22 | 
            * @license   Commercial https://themeforest.net/licenses
  | 
        
        
            | 
            | 
           23 | 
            */
  | 
        
        
            | 
            | 
           24 | 
              | 
        
        
            | 
            | 
           25 | 
           defined('MOODLE_INTERNAL') || die();
  | 
        
        
            | 
            | 
           26 | 
              | 
        
        
            | 
            | 
           27 | 
           require_once(__DIR__ . '/lib.php');
  | 
        
        
            | 
            | 
           28 | 
              | 
        
        
            | 
            | 
           29 | 
           $THEME->name = 'universe';
  | 
        
        
            | 
            | 
           30 | 
           $THEME->sheets = [];
  | 
        
        
            | 
            | 
           31 | 
           $THEME->editor_sheets = [];
  | 
        
        
            | 
            | 
           32 | 
           $THEME->editor_scss = ['editor'];
  | 
        
        
            | 
            | 
           33 | 
           $THEME->usefallback = true;
  | 
        
        
           | 1441 | 
           ariadna | 
           34 | 
           $THEME->scss = function($theme) {
  | 
        
        
           | 1 | 
           efrain | 
           35 | 
               return theme_universe_get_main_scss_content($theme);
  | 
        
        
            | 
            | 
           36 | 
           };
  | 
        
        
            | 
            | 
           37 | 
              | 
        
        
            | 
            | 
           38 | 
           $THEME->layouts = [
  | 
        
        
            | 
            | 
           39 | 
               // Most backwards compatible layout without the blocks - this is the layout used by default.
  | 
        
        
            | 
            | 
           40 | 
               'base' => array(
  | 
        
        
            | 
            | 
           41 | 
                   'file' => 'tmpl-columns2.php',
  | 
        
        
            | 
            | 
           42 | 
                   'regions' => array('side-pre'),
  | 
        
        
            | 
            | 
           43 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           44 | 
               ),
  | 
        
        
            | 
            | 
           45 | 
               // Standard layout with blocks, this is recommended for most pages with general information.
  | 
        
        
            | 
            | 
           46 | 
               'standard' => array(
  | 
        
        
            | 
            | 
           47 | 
                   'file' => 'tmpl-columns2.php',
  | 
        
        
            | 
            | 
           48 | 
                   'regions' => array('side-pre'),
  | 
        
        
            | 
            | 
           49 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           50 | 
               ),
  | 
        
        
            | 
            | 
           51 | 
               // Main course page.
  | 
        
        
            | 
            | 
           52 | 
               'course' => array(
  | 
        
        
            | 
            | 
           53 | 
                   'file' => 'tmpl-course.php',
  | 
        
        
            | 
            | 
           54 | 
                   'regions' => array(
  | 
        
        
            | 
            | 
           55 | 
                       'coursetab-a',
  | 
        
        
            | 
            | 
           56 | 
                       'coursetab-b',
  | 
        
        
            | 
            | 
           57 | 
                       'coursetab-c',
  | 
        
        
            | 
            | 
           58 | 
                       'coursetab-d',
  | 
        
        
            | 
            | 
           59 | 
                       'coursetab-e',
  | 
        
        
            | 
            | 
           60 | 
                       'side-pre',
  | 
        
        
            | 
            | 
           61 | 
                       'ctopbl',
  | 
        
        
            | 
            | 
           62 | 
                       'cbottombl',
  | 
        
        
            | 
            | 
           63 | 
                       'cstopbl',
  | 
        
        
           | 1441 | 
           ariadna | 
           64 | 
                       'csbottombl'),
  | 
        
        
           | 131 | 
           ariadna | 
           65 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
           | 1 | 
           efrain | 
           66 | 
                   'options' => array('langmenu' => true),
  | 
        
        
            | 
            | 
           67 | 
               ),
  | 
        
        
            | 
            | 
           68 | 
               'coursecategory' => array(
  | 
        
        
           | 1441 | 
           ariadna | 
           69 | 
                   'file' => 'tmpl-category.php',
  | 
        
        
            | 
            | 
           70 | 
                   'regions' => array(
  | 
        
        
            | 
            | 
           71 | 
                       'side-pre'
  | 
        
        
            | 
            | 
           72 | 
                   ),
  | 
        
        
           | 1 | 
           efrain | 
           73 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           74 | 
               ),
  | 
        
        
            | 
            | 
           75 | 
               // Part of course, typical for modules - default page layout if $cm specified in require_login().
  | 
        
        
            | 
            | 
           76 | 
               'incourse' => array(
  | 
        
        
            | 
            | 
           77 | 
                   'file' => 'tmpl-incourse.php',
  | 
        
        
           | 1441 | 
           ariadna | 
           78 | 
                   'regions' => array('side-pre'),
  | 
        
        
           | 739 | 
           ariadna | 
           79 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
           | 1 | 
           efrain | 
           80 | 
               ),
  | 
        
        
            | 
            | 
           81 | 
               // The site home page.
  | 
        
        
            | 
            | 
           82 | 
               'frontpage' => array(
  | 
        
        
            | 
            | 
           83 | 
                   'file' => 'tmpl-frontpage.php',
  | 
        
        
            | 
            | 
           84 | 
                   'regions' => array(
  | 
        
        
            | 
            | 
           85 | 
                       'side-pre',
  | 
        
        
            | 
            | 
           86 | 
                       'fpblocks-t',
  | 
        
        
           | 1441 | 
           ariadna | 
           87 | 
                       'fpblocks-b'),
  | 
        
        
           | 1 | 
           efrain | 
           88 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           89 | 
                   'options' => array('nonavbar' => true),
  | 
        
        
            | 
            | 
           90 | 
               ),
  | 
        
        
            | 
            | 
           91 | 
               // Server administration scripts.
  | 
        
        
            | 
            | 
           92 | 
               'admin' => array(
  | 
        
        
            | 
            | 
           93 | 
                   'file' => 'tmpl-admin.php',
  | 
        
        
            | 
            | 
           94 | 
                   'regions' => array('side-pre'),
  | 
        
        
            | 
            | 
           95 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           96 | 
               ),
  | 
        
        
            | 
            | 
           97 | 
               // Moodle 4. - My courses page.
  | 
        
        
            | 
            | 
           98 | 
               'mycourses' => array(
  | 
        
        
            | 
            | 
           99 | 
                   'file' => 'tmpl-columns2.php',
  | 
        
        
           | 1441 | 
           ariadna | 
           100 | 
                   'regions' => array('side-pre'),
  | 
        
        
           | 1 | 
           efrain | 
           101 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           102 | 
               ),
  | 
        
        
            | 
            | 
           103 | 
               // My dashboard page.
  | 
        
        
            | 
            | 
           104 | 
               'mydashboard' => array(
  | 
        
        
            | 
            | 
           105 | 
                   'file' => 'tmpl-dashboard.php',
  | 
        
        
            | 
            | 
           106 | 
                   'regions' => array(
  | 
        
        
            | 
            | 
           107 | 
                       'side-pre',
  | 
        
        
            | 
            | 
           108 | 
                       'dtopblocks',
  | 
        
        
           | 1441 | 
           ariadna | 
           109 | 
                       'dbottomblocks'),
  | 
        
        
           | 1 | 
           efrain | 
           110 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           111 | 
                   'options' => array('nonavbar' => true, 'langmenu' => true, 'nocontextheader' => true),
  | 
        
        
            | 
            | 
           112 | 
               ),
  | 
        
        
            | 
            | 
           113 | 
               // My public page.
  | 
        
        
            | 
            | 
           114 | 
               'mypublic' => array(
  | 
        
        
            | 
            | 
           115 | 
                   'file' => 'tmpl-mypublic.php',
  | 
        
        
            | 
            | 
           116 | 
                   'regions' => array(),
  | 
        
        
            | 
            | 
           117 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           118 | 
               ),
  | 
        
        
            | 
            | 
           119 | 
               'login' => array(
  | 
        
        
            | 
            | 
           120 | 
                   'file' => 'tmpl-login.php',
  | 
        
        
            | 
            | 
           121 | 
                   'regions' => array(),
  | 
        
        
            | 
            | 
           122 | 
                   'options' => array('langmenu' => true),
  | 
        
        
            | 
            | 
           123 | 
               ),
  | 
        
        
            | 
            | 
           124 | 
              | 
        
        
            | 
            | 
           125 | 
               // Pages that appear in pop-up windows - no navigation, no blocks, no header and bare activity header.
  | 
        
        
            | 
            | 
           126 | 
               'popup' => array(
  | 
        
        
            | 
            | 
           127 | 
                   'file' => 'tmpl-popup.php',
  | 
        
        
            | 
            | 
           128 | 
                   'regions' => array(),
  | 
        
        
            | 
            | 
           129 | 
                   'options' => array(
  | 
        
        
            | 
            | 
           130 | 
                       'nofooter' => true,
  | 
        
        
            | 
            | 
           131 | 
                       'nonavbar' => true,
  | 
        
        
            | 
            | 
           132 | 
                       'activityheader' => [
  | 
        
        
            | 
            | 
           133 | 
                           'notitle' => true,
  | 
        
        
            | 
            | 
           134 | 
                           'nocompletion' => true,
  | 
        
        
            | 
            | 
           135 | 
                           'nodescription' => true
  | 
        
        
            | 
            | 
           136 | 
                       ]
  | 
        
        
            | 
            | 
           137 | 
                   )
  | 
        
        
            | 
            | 
           138 | 
               ),
  | 
        
        
            | 
            | 
           139 | 
               // No blocks and minimal footer - used for legacy frame layouts only!
  | 
        
        
            | 
            | 
           140 | 
               'frametop' => array(
  | 
        
        
            | 
            | 
           141 | 
                   'file' => 'tmpl-columns1.php',
  | 
        
        
            | 
            | 
           142 | 
                   'regions' => array(),
  | 
        
        
            | 
            | 
           143 | 
                   'options' => array(
  | 
        
        
            | 
            | 
           144 | 
                       'nofooter' => true,
  | 
        
        
            | 
            | 
           145 | 
                       'nocoursefooter' => true,
  | 
        
        
            | 
            | 
           146 | 
                       'activityheader' => [
  | 
        
        
            | 
            | 
           147 | 
                           'nocompletion' => true
  | 
        
        
            | 
            | 
           148 | 
                       ]
  | 
        
        
            | 
            | 
           149 | 
                   ),
  | 
        
        
            | 
            | 
           150 | 
               ),
  | 
        
        
            | 
            | 
           151 | 
               // Embeded pages, like iframe/object embeded in moodleform - it needs as much universe as possible.
  | 
        
        
            | 
            | 
           152 | 
               'embedded' => array(
  | 
        
        
            | 
            | 
           153 | 
                   'file' => 'embedded.php',
  | 
        
        
            | 
            | 
           154 | 
                   'regions' => array()
  | 
        
        
            | 
            | 
           155 | 
               ),
  | 
        
        
            | 
            | 
           156 | 
               // Used during upgrade and install, and for the 'This site is undergoing maintenance' message.
  | 
        
        
            | 
            | 
           157 | 
               // This must not have any blocks, links, or API calls that would lead to database or cache interaction.
  | 
        
        
            | 
            | 
           158 | 
               // Please be extremely careful if you are modifying this layout.
  | 
        
        
            | 
            | 
           159 | 
               'maintenance' => array(
  | 
        
        
            | 
            | 
           160 | 
                   'file' => 'tmpl-maintenance.php',
  | 
        
        
            | 
            | 
           161 | 
                   'regions' => array(),
  | 
        
        
            | 
            | 
           162 | 
               ),
  | 
        
        
            | 
            | 
           163 | 
               // Should display the content and basic headers only.
  | 
        
        
            | 
            | 
           164 | 
               'print' => array(
  | 
        
        
            | 
            | 
           165 | 
                   'file' => 'tmpl-columns1.php',
  | 
        
        
            | 
            | 
           166 | 
                   'regions' => array(),
  | 
        
        
            | 
            | 
           167 | 
                   'options' => array('nofooter' => true, 'nonavbar' => false, 'noactivityheader' => true),
  | 
        
        
            | 
            | 
           168 | 
               ),
  | 
        
        
            | 
            | 
           169 | 
               // The pagelayout used when a redirection is occuring.
  | 
        
        
            | 
            | 
           170 | 
               'redirect' => array(
  | 
        
        
            | 
            | 
           171 | 
                   'file' => 'embedded.php',
  | 
        
        
            | 
            | 
           172 | 
                   'regions' => array(),
  | 
        
        
            | 
            | 
           173 | 
               ),
  | 
        
        
            | 
            | 
           174 | 
               // The pagelayout used for reports.
  | 
        
        
            | 
            | 
           175 | 
               'report' => array(
  | 
        
        
            | 
            | 
           176 | 
                   'file' => 'tmpl-report.php',
  | 
        
        
            | 
            | 
           177 | 
                   'regions' => array('side-pre'),
  | 
        
        
            | 
            | 
           178 | 
                   'defaultregion' => 'side-pre',
  | 
        
        
            | 
            | 
           179 | 
               ),
  | 
        
        
            | 
            | 
           180 | 
               // The pagelayout used for safebrowser and securewindow.
  | 
        
        
            | 
            | 
           181 | 
               'secure' => array(
  | 
        
        
            | 
            | 
           182 | 
                   'file' => 'secure.php',
  | 
        
        
            | 
            | 
           183 | 
                   'regions' => array('side-pre'),
  | 
        
        
            | 
            | 
           184 | 
                   'defaultregion' => 'side-pre'
  | 
        
        
            | 
            | 
           185 | 
               )
  | 
        
        
            | 
            | 
           186 | 
           ];
  | 
        
        
            | 
            | 
           187 | 
              | 
        
        
           | 1441 | 
           ariadna | 
           188 | 
           $THEME->parents = [];
  | 
        
        
           | 1 | 
           efrain | 
           189 | 
           $THEME->enable_dock = false;
  | 
        
        
            | 
            | 
           190 | 
           $THEME->extrascsscallback = 'theme_universe_get_extra_scss';
  | 
        
        
            | 
            | 
           191 | 
           $THEME->prescsscallback = 'theme_universe_get_pre_scss';
  | 
        
        
            | 
            | 
           192 | 
           $THEME->precompiledcsscallback = 'theme_universe_get_precompiled_css';
  | 
        
        
            | 
            | 
           193 | 
           $THEME->yuicssmodules = array();
  | 
        
        
            | 
            | 
           194 | 
           $THEME->rendererfactory = 'theme_overridden_renderer_factory';
  | 
        
        
            | 
            | 
           195 | 
           $THEME->requiredblocks = '';
  | 
        
        
            | 
            | 
           196 | 
           $THEME->addblockposition = BLOCK_ADDBLOCK_POSITION_FLATNAV;
  | 
        
        
            | 
            | 
           197 | 
           $THEME->haseditswitch = true;
  | 
        
        
            | 
            | 
           198 | 
           $THEME->iconsystem = \core\output\icon_system::FONTAWESOME;
  | 
        
        
            | 
            | 
           199 | 
              | 
        
        
           | 1441 | 
           ariadna | 
           200 | 
           if (isset($THEME->settings->hidecourseindexnav) == 0) {
  | 
        
        
           | 1 | 
           efrain | 
           201 | 
               $THEME->usescourseindex = true;
  | 
        
        
            | 
            | 
           202 | 
           } else {
  | 
        
        
            | 
            | 
           203 | 
               $THEME->usescourseindex = false;
  | 
        
        
            | 
            | 
           204 | 
           }
  | 
        
        
            | 
            | 
           205 | 
           $THEME->removedprimarynavitems = explode(',', get_config('theme_universe', 'hidenodesprimarynavigation'));
  | 
        
        
            | 
            | 
           206 | 
           // By default, all boost theme do not need their titles displayed.
  | 
        
        
            | 
            | 
           207 | 
           $THEME->activityheaderconfig = [
  | 
        
        
            | 
            | 
           208 | 
               'notitle' => true
  | 
        
        
            | 
            | 
           209 | 
           ];
  |