. /** * General layout for the mymobile theme * * @package theme * @subpackage mymobile * @copyright John Stabinger * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ // get blocks? $toblock = optional_param('mymobile_blocks', false, PARAM_BOOL); // get settings? $toset = optional_param('mymobile_settings', false, PARAM_BOOL); $mypagetype = $PAGE->pagetype; $mylayoutype = $PAGE->pagelayout; $mydevice = $PAGE->devicetypeinuse; if (!empty($PAGE->theme->settings->colourswatch)) { $showswatch = $PAGE->theme->settings->colourswatch; } else { $showswatch = 'light'; } if ($showswatch == 'light') { $dtheme = 'd'; $dthemeb = 'd'; $datatheme = 'data-theme="b"'; $databodytheme = 'data-theme="d"'; } else { $dtheme = 'd'; $dthemeb = 'c'; $datatheme = 'data-theme="a"'; $databodytheme = ''; } //custom settings $hasshowmobileintro = (!empty($PAGE->theme->settings->showmobileintro)); if (!empty($PAGE->theme->settings->showfullsizeimages)) { $hasithumb = $PAGE->theme->settings->showfullsizeimages; } else { $hasithumb = 'ithumb'; } if (!empty($PAGE->theme->settings->showsitetopic)) { $showsitetopic = $PAGE->theme->settings->showsitetopic; } else { $showsitetopic = 'topicnoshow'; } if (!empty($PAGE->theme->settings->usetableview)) { $showusetableview = $PAGE->theme->settings->usetableview; } else { $showusetableview = 'tabshow'; } // TODO: Fix this hardcoding there are other course formats that peopleuse. // Probably changing to an appropriate regex will do. if ($mypagetype == 'course-view-topics' || $mypagetype == 'course-view-weeks') { // jump to current topic only in course pages $jumptocurrent = 'true'; } else { $jumptocurrent = 'false'; } // below sets a URL variable to use in some links $urlblocks = new moodle_url($PAGE->url, array('mymobile_blocks' => 'true')); $urlsettings = new moodle_url($PAGE->url, array('mymobile_settings' => 'true')); $hasheading = ($PAGE->heading); $hasnavbar = (empty($PAGE->layout_options['nonavbar']) && $PAGE->has_navbar()); $hasfooter = (empty($PAGE->layout_options['nofooter'])); $hasmyblocks = $PAGE->blocks->region_has_content('myblocks', $OUTPUT); $bodyclasses = array(); $bodyclasses[] = (string)$hasithumb; $bodyclasses[] = (string)$showsitetopic; // add ithumb class to decide whether to show or hide images and site topic // TODO: Better illustrate preceedence $gowide = ($mydevice == 'default' && $showusetableview == 'tabshow' || $mydevice == 'tablet' && $showusetableview == 'tabshow'); if ($gowide) { // initialize column position choices. mymobile_initialise_colpos($PAGE); } $usercol = (mymobile_get_colpos() == 'on'); $renderer = $PAGE->get_renderer('theme_mymobile'); echo $OUTPUT->doctype() ?> htmlattributes() ?>>