Permalink
Browse files

MDL-27622 theme_mymobile: Pre-integration clean up

  • Loading branch information...
1 parent 2fd7abb commit 3c0c2bf080a16d71e7338dcaebb4c76eef71b430 Sam Hemelryk committed Nov 9, 2011
View
@@ -23,177 +23,41 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+// The name of the theme
$THEME->name = 'mymobile';
-////////////////////////////////////////////////////
-// Name of the theme. Most likely the name of
-// the directory in which this file resides.
-////////////////////////////////////////////////////
-
-
+// This theme relies on canvas and of course base themes
$THEME->parents = array(
'canvas',
'base',
);
-/////////////////////////////////////////////////////
-// Which existing theme(s) in the /theme/ directory
-// do you want this theme to extend. A theme can
-// extend any number of themes. Rather than
-// creating an entirely new theme and copying all
-// of the CSS, you can simply create a new theme,
-// extend the theme you like and just add the
-// changes you want to your theme.
-////////////////////////////////////////////////////
-
-
+// Set the stylesheets that we want to include for this theme
$THEME->sheets = array(
'jmobilerc2',
'core',
'media'
);
-////////////////////////////////////////////////////
-// Name of the stylesheet(s) you've including in
-// this theme's /styles/ directory.
-////////////////////////////////////////////////////
-
+// Exclude parent sheets that we don't want
$THEME->parents_exclude_sheets = array(
- 'base'=>array(
- 'pagelayout',
- 'dock',
- 'editor',
- ),
- 'canvas'=>array(
- 'pagelayout',
- 'tabs',
- 'editor',
-
- ),
-
-
-);
-
-
-$THEME->enable_dock = false;
-
-
-////////////////////////////////////////////////////
-// Do you want to use the new navigation dock?
-////////////////////////////////////////////////////
-
-
-//$THEME->editor_sheets = array('editor');
-
-////////////////////////////////////////////////////
-// An array of stylesheets to include within the
-// body of the editor.
-////////////////////////////////////////////////////
-$toblock = optional_param('mymobile_blocks', false, PARAM_BOOL);
-$thisdevice = get_device_type();
-if ($thisdevice == "default" || $thisdevice == "tablet") {
- $gowide = "true";
-} else {
- $gowide = "false";
-}
-//get whether to show blocks and use appropriate pagelayout
-//this is necessary for block JS errors and other block problems
-if($toblock || $gowide == "true") {
-$THEME->layouts = array(
'base' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- ),
- 'standard' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- ),
- 'course' => array(
- 'file' => 'general.php',
- 'regions' => array('myblocks'),
- 'defaultregion' => 'myblocks'
- ),
- 'coursecategory' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- ),
- 'incourse' => array(
- 'file' => 'general.php',
- 'regions' => array('myblocks'),
- 'defaultregion' => 'myblocks',
- ),
-
- 'frontpage' => array(
- 'file' => 'general.php',
- 'regions' => array('myblocks'),
- 'defaultregion' => 'myblocks',
-
- //'options' => array('nonavbar'=>true),
- ),
- 'admin' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- ),
- 'mydashboard' => array(
- 'file' => 'general.php',
- 'regions' => array('myblocks'),
- 'defaultregion' => 'myblocks',
- 'options' => array('nonavbar'=>true),
- ),
- 'mypublic' => array(
- 'file' => 'general.php',
- 'regions' => array('myblocks'),
- 'defaultregion' => 'myblocks',
- ),
- 'login' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- 'options' => array('langmenu'=>true, 'nonavbar'=>true),
- ),
- 'popup' => array(
- 'file' => 'embedded.php',
- 'regions' => array(),
- 'options' => array('nofooter'=>true, 'noblocks'=>true, 'nonavbar'=>true),
- ),
- 'frametop' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- 'options' => array('nofooter'=>true),
- ),
- 'maintenance' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true),
- ),
- 'embedded' => array(
- 'file' => 'embedded.php',
- 'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true),
+ 'pagelayout',
+ 'dock',
+ 'editor',
),
- // Should display the content and basic headers only.
- 'print' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
- ),
- // The pagelayout used when a redirection is occuring.
- 'redirect' => array(
- 'file' => 'embedded.php',
- 'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>true, 'nocustommenu'=>true),
- ),
- // The pagelayout used for reports
- 'report' => array(
- 'file' => 'general.php',
- 'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
+ 'canvas' => array(
+ 'pagelayout',
+ 'tabs',
+ 'editor',
),
+);
+// Disable the dock - this theme does not support it.
+$THEME->enable_dock = false;
-);
-}
-else {
-//get rid of block region
+// Set up the default layout options. Note that none of these have block
+// regions. See the code below this for where and when block regions are added.
$THEME->layouts = array(
'base' => array(
'file' => 'general.php',
@@ -215,12 +79,9 @@
'file' => 'general.php',
'regions' => array(),
),
-
'frontpage' => array(
'file' => 'general.php',
'regions' => array(),
-
- //'options' => array('nonavbar'=>true),
),
'admin' => array(
'file' => 'general.php',
@@ -229,8 +90,7 @@
'mydashboard' => array(
'file' => 'general.php',
'regions' => array(),
-
- 'options' => array('nonavbar'=>true),
+ 'options' => array('nonavbar' => true),
),
'mypublic' => array(
'file' => 'general.php',
@@ -277,105 +137,30 @@
'report' => array(
'file' => 'general.php',
'regions' => array(),
- 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
+ 'options' => array('nofooter'=>true, 'nonavbar'=>false, 'noblocks'=>true),
),
-
-
);
-}
-
-///////////////////////////////////////////////////////////////
-// These are all of the possible layouts in Moodle. The
-// simplest way to do this is to keep the theme and file
-// variables the same for every layout. Including them
-// all in this way allows some flexibility down the road
-// if you want to add a different layout template to a
-// specific page.
-///////////////////////////////////////////////////////////////
-
-
-
-////////////////////////////////////////////////////
-// Allows the user to provide the name of a function
-// that all CSS should be passed to before being
-// delivered.
-////////////////////////////////////////////////////
-
-// $THEME->filter_mediaplugin_colors
-
-////////////////////////////////////////////////////
-// Used to control the colours used in the small
-// media player for the filters
-////////////////////////////////////////////////////
-
- //$THEME->javascripts = 'jquery.mobile-1.0a1.min';
- //$THEME->javascripts = array('jquery.mobile-1.0a1.min');
- $THEME->javascripts = array('jquery-1.6.4.min', 'custom', 'jquery.mobile-1.0rc2','scrollview','easing');
-
-////////////////////////////////////////////////////
-// An array containing the names of JavaScript files
-// located in /javascript/ to include in the theme.
-// (gets included in the head)
-////////////////////////////////////////////////////
-
-// $THEME->javascripts_footer
-
-////////////////////////////////////////////////////
-// As above but will be included in the page footer.
-////////////////////////////////////////////////////
-
-// $THEME->larrow
-
-////////////////////////////////////////////////////
-// Overrides the left arrow image used throughout
-// Moodle
-////////////////////////////////////////////////////
-// $THEME->rarrow
-
-////////////////////////////////////////////////////
-// Overrides the right arrow image used throughout Moodle
-////////////////////////////////////////////////////
-
-// $THEME->layouts
-
-////////////////////////////////////////////////////
-// An array setting the layouts for the theme
-////////////////////////////////////////////////////
-
-// $THEME->parents_exclude_javascripts
-
-////////////////////////////////////////////////////
-// An array of JavaScript files NOT to inherit from
-// the themes parents
-////////////////////////////////////////////////////
-
-// $THEME->parents_exclude_sheets
-
-////////////////////////////////////////////////////
-// An array of stylesheets not to inherit from the
-// themes parents
-////////////////////////////////////////////////////
-
-// $THEME->plugins_exclude_sheets
-
-////////////////////////////////////////////////////
-// An array of plugin sheets to ignore and not
-// include.
-////////////////////////////////////////////////////
-
-// $THEME->renderfactory
-
-////////////////////////////////////////////////////
-// Sets a custom render factory to use with the
-// theme, used when working with custom renderers.
-////////////////////////////////////////////////////
-
-// $THEME->resource_mp3player_colors
+// Get whether to show blocks and use appropriate pagelayout
+// this is necessary for block JS errors and other block problems
+$thisdevice = get_device_type();
+if ($thisdevice == "default" || $thisdevice == "tablet" || optional_param('mymobile_blocks', false, PARAM_BOOL)) {
+ // These are layouts with blocks
+ $blocklayouts = array('course', 'incourse', 'frontpage', 'mydashboard', 'mypublic');
+ foreach ($blocklayouts as $layout) {
+ $THEME->layouts[$layout]['regions'] = array('myblocks');
+ $THEME->layouts[$layout]['defaultregion'] = 'myblocks';
+ }
+}
-////////////////////////////////////////////////////
-// Controls the colours for the MP3 player
-////////////////////////////////////////////////////
+// Add the required JavaScript to the page
+$THEME->javascripts = array(
+ 'jquery-1.6.4.min',
+ 'custom',
+ 'jquery.mobile-1.0rc2',
+ 'scrollview',
+ 'easing'
+);
-$THEME->rendererfactory = 'theme_overridden_renderer_factory';
-//$THEME->csspostprocess = 'mymobile_process_css';
+// Sets a custom render factory to use with the theme, used when working with custom renderers.
+$THEME->rendererfactory = 'theme_overridden_renderer_factory';
Oops, something went wrong.

0 comments on commit 3c0c2bf

Please sign in to comment.