Merge branch 'install_24_STABLE' of git://git.moodle.cz/moodle-install into MOODLE_24...
[moodle.git] / theme / mymobile / config.php
blob482c88968971b563ef88501202e03a9fd9a9d444
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.
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/>.
17 /**
18 * Config file for mymobile theme
20 * @package 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(
31 'canvas',
32 'base',
35 // Set the stylesheets that we want to include for this theme
36 $THEME->sheets = array(
37 'jmobile11',
38 'jmobile11_rtl',
39 'core',
40 'media'
43 // Exclude parent sheets that we don't want
44 $THEME->parents_exclude_sheets = array(
45 'base' => array(
46 'pagelayout',
47 'dock',
48 'editor',
50 'canvas' => array(
51 'pagelayout',
52 'tabs',
53 'editor',
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(
63 'base' => array(
64 'file' => 'general.php',
65 'regions' => array(),
67 'standard' => array(
68 'file' => 'general.php',
69 'regions' => array(),
71 'course' => array(
72 'file' => 'general.php',
73 'regions' => array(),
75 'coursecategory' => array(
76 'file' => 'general.php',
77 'regions' => array(),
79 'incourse' => array(
80 'file' => 'general.php',
81 'regions' => array(),
83 'frontpage' => array(
84 'file' => 'general.php',
85 'regions' => array(),
87 'admin' => array(
88 'file' => 'general.php',
89 'regions' => array(),
91 'mydashboard' => array(
92 'file' => 'general.php',
93 'regions' => array(),
94 'options' => array('nonavbar' => true),
96 'mypublic' => array(
97 'file' => 'general.php',
98 'regions' => array(),
100 'login' => array(
101 'file' => 'general.php',
102 'regions' => array(),
103 'options' => array('langmenu'=>true, 'nonavbar'=>true),
105 'popup' => array(
106 'file' => 'embedded.php',
107 'regions' => array(),
108 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true, 'nocourseheaderfooter'=>true),
110 'frametop' => array(
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),
120 'embedded' => array(
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.
126 'print' => array(
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.
132 'redirect' => array(
133 'file' => 'embedded.php',
134 'regions' => array(),
135 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true, 'nocourseheaderfooter'=>true),
137 // The pagelayout used for reports
138 'report' => array(
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(
159 'jquery-1.7.1.min',
160 'custom',
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;