From ba92d2f50cc3a91bfc6e4548a39f08c5dbb1c666 Mon Sep 17 00:00:00 2001 From: urs_hunkler Date: Fri, 11 Jan 2008 09:29:53 +0000 Subject: [PATCH] merged from 1.9 :: MDL-12221 :: removed the "nocoursepage" hack, which was an attempt to find out if a page has a layout-table. I developed this hack because Martin said, that he does not see any chance to implement a layout-table check. This hack followed several exception hacks because Moodel pages are inconsistently created. All those exceptions I could delete too. Now I added a JavaScript layout-table check which works great. --- lib/weblib.php | 5 ---- theme/custom_corners/header.html | 39 +++------------------------- theme/custom_corners/js/jquery.php | 9 +++---- theme/custom_corners/rtl.css | 14 +++++----- theme/custom_corners/styles_ie6.css | 18 ++++++------- theme/custom_corners/user_styles.css | 26 ++++++++++++------- 6 files changed, 40 insertions(+), 71 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 344d9db2c7..af6bc98968 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2535,11 +2535,6 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $pageclass .= ' course-'.$COURSE->id; - if (($pageid != 'site-index') && ($pageid != 'course-view') && - (strstr($pageid, 'admin') === FALSE)) { - $pageclass .= ' nocoursepage'; - } - if (!isloggedin()) { $pageclass .= ' notloggedin'; } diff --git a/theme/custom_corners/header.html b/theme/custom_corners/header.html index 5197909621..048b32d96c 100644 --- a/theme/custom_corners/header.html +++ b/theme/custom_corners/header.html @@ -11,52 +11,18 @@ themedir.'/custom_corners/js/jquery.php'); ?> type == 'admin') && (strpos($bodytags, ' nocoursepage'))) { - $bodytags = str_replace(' nocoursepage', '', $bodytags); - } - - // list of pages using the layout-table to be able to view sideblocks - $excludelist = array('mod-chat-view', 'mod-data-view', 'mod-quiz-view', - 'my-index'); - - if (!empty($PAGE) && (in_array($PAGE->type, $excludelist)) && - (strpos($bodytags, ' nocoursepage'))) { - $bodytags = str_replace(' nocoursepage', '', $bodytags); - } // get class list preg_match('/class="([^"]*)"/i', $bodytags, $classes); $classlist = explode (' ', $classes[1]); - // add 'nocoursepage' to the list of CLASSes on several pages - if (strpos($bodytags, 'nocoursepage') === false) { - $includelist = array('admin-roles-assign', 'admin-roles-override', - 'mod-data-view'); - preg_match('/id="([^"]*)"/i', $bodytags, $ids); - if (in_array($ids[1], $includelist)) { - // exclude roles called from the admin area (courseid 1) - // include user roles for the Moodle user settings called - // from the start page - if (($COURSE->id > 1) || ($_GET['contextid'] == 30) || ($_GET['contextid'] == 61)) { - if (!in_array('nocoursepage', $classlist)) { - array_push($classlist, 'nocoursepage'); - } - } - } - } // add "inpopup" or "notinpopup" to class list if ($inpopup) { @@ -68,6 +34,9 @@ //replace classlist with new one $bodytags = str_replace($classes[0], 'class="'.implode(' ', $classlist).'"', $bodytags); + +// $infooutput = '
 
'; + ?> diff --git a/theme/custom_corners/js/jquery.php b/theme/custom_corners/js/jquery.php index 027ebbebd8..7ba83024b5 100644 --- a/theme/custom_corners/js/jquery.php +++ b/theme/custom_corners/js/jquery.php @@ -1,9 +1,8 @@ - +