2 // This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 * Config file for mymobile theme
21 * @subpackage mymobile
22 * @copyright John Stabinger
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 // The name of the theme
27 $THEME->name
= 'mymobile';
29 // This theme relies on canvas and of course base themes
30 $THEME->parents
= array(
35 // Set the stylesheets that we want to include for this theme
36 $THEME->sheets
= array(
43 // Exclude parent sheets that we don't want
44 $THEME->parents_exclude_sheets
= array(
57 // Disable the dock - this theme does not support it.
58 $THEME->enable_dock
= false;
60 // Set up the default layout options. Note that none of these have block
61 // regions. See the code below this for where and when block regions are added.
62 $THEME->layouts
= array(
64 'file' => 'general.php',
68 'file' => 'general.php',
72 'file' => 'general.php',
75 'coursecategory' => array(
76 'file' => 'general.php',
80 'file' => 'general.php',
84 'file' => 'general.php',
88 'file' => 'general.php',
91 'mydashboard' => array(
92 'file' => 'general.php',
94 'options' => array('nonavbar' => true),
97 'file' => 'general.php',
101 'file' => 'general.php',
102 'regions' => array(),
103 'options' => array('langmenu'=>true, 'nonavbar'=>true),
106 'file' => 'embedded.php',
107 'regions' => array(),
108 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
111 'file' => 'general.php',
112 'regions' => array(),
113 'options' => array('nofooter'=>true, 'nocoursefooter'=>true),
115 'maintenance' => array(
116 'file' => 'general.php',
117 'regions' => array(),
118 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
121 'file' => 'embedded.php',
122 'regions' => array(),
123 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
125 // Should display the content and basic headers only.
127 'file' => 'general.php',
128 'regions' => array(),
129 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true, 'nocourseheaderfooter'=>true),
131 // The pagelayout used when a redirection is occuring.
133 'file' => 'embedded.php',
134 'regions' => array(),
135 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
137 // The pagelayout used for reports
139 'file' => 'general.php',
140 'regions' => array(),
141 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
145 // Get whether to show blocks and use appropriate pagelayout
146 // this is necessary for block JS errors and other block problems
147 $thisdevice = get_device_type();
148 if ($thisdevice == "default" ||
$thisdevice == "tablet" ||
optional_param('mymobile_blocks', false, PARAM_BOOL
)) {
149 // These are layouts with blocks
150 $blocklayouts = array('course', 'incourse', 'frontpage', 'mydashboard', 'mypublic');
151 foreach ($blocklayouts as $layout) {
152 $THEME->layouts
[$layout]['regions'] = array('myblocks');
153 $THEME->layouts
[$layout]['defaultregion'] = 'myblocks';
157 // Add the required JavaScript to the page
158 $THEME->javascripts
= array(
161 'jquery.mobile-1.1.1'
164 // Sets a custom render factory to use with the theme, used when working with custom renderers.
165 $THEME->rendererfactory
= 'theme_overridden_renderer_factory';
166 $THEME->csspostprocess
= 'mymobile_user_settings';
168 // Disables CSS Optimiser for MyMobile theme.
169 $THEME->supportscssoptimisation
= false;