]> git.mjollnir.org Git - moodle.git/commitdiff
merged from 1.9 :: MDL-12221 :: removed the "nocoursepage" hack, which was an attempt...
authorurs_hunkler <urs_hunkler>
Fri, 11 Jan 2008 09:29:53 +0000 (09:29 +0000)
committerurs_hunkler <urs_hunkler>
Fri, 11 Jan 2008 09:29:53 +0000 (09:29 +0000)
Now I added a JavaScript layout-table check which works great.

lib/weblib.php
theme/custom_corners/header.html
theme/custom_corners/js/jquery.php
theme/custom_corners/rtl.css
theme/custom_corners/styles_ie6.css
theme/custom_corners/user_styles.css

index 344d9db2c7ea0c37880b01b60dc80cdbf063a6aa..af6bc989683661c22755b678da867875ab1e4fd5 100644 (file)
@@ -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';
     }
index 5197909621554c7e49817b16320a1694f478ea7e..048b32d96cfd92f7c8ae7049a5b881bce76b19c6 100644 (file)
     <?php include($CFG->themedir.'/custom_corners/js/jquery.php'); ?>
 
     <?php
-
-        global $PAGE;
         
+        // check if page is opened within a popup window
         if (function_exists('is_in_popup')) {
             $inpopup = is_in_popup();
         } else {
             $inpopup = false;
         }
-
-        // handle pages which get displayed wrong
-        // either no custom corners or too much
-
-        // all admin pages are build with the layout-table: sideblocks and content
-        if (!empty($PAGE) && ($PAGE->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 = '<div id="infocontent">&nbsp;</div>';
+        
     ?>
 </head>
 
index 027ebbebd8d447a6fcc442d6894d95f108863422..7ba83024b5c80ff58b5165daa76c71b20dd02959 100644 (file)
@@ -1,9 +1,8 @@
-<script src="<?php echo $CFG->themewww .'/'. current_theme() ?>/js/jquery-latest.pack.js" type="text/javascript"></script>
+<script src="<?php echo $CFG->themewww ?>/custom_corners/js/jquery-latest.pack.js" type="text/javascript"></script>
 
 <script type="text/javascript" charset="utf-8">
 /* <![CDATA[ */
     var script = {
-        themepath: '<?php echo $CFG->themewww .'/'. current_theme() ?>',
         
         corrections: function () {
             if (top.user) {
             }
             
             // check for layouttabel and add haslayouttable class to body
-            // remove nocoursepage class from body
             var layoutTable = $('#layout-table #middle-column');
             
             if (layoutTable.length) {
                 $('body').addClass('haslayouttable');
-                $('body').removeClass('nocoursepage');
             } else {
                 $('body').addClass('nolayouttable');
             }
@@ -39,6 +36,8 @@
         },
         
         info: function() {
+            $('#infooverlay').text($('body').attr('class'));
+            
             window.setTimeout(function(){$('#infowrapper').click();}, 4000);
             $('#infowrapper').toggle(function() {
                 $('#infooverlay').animate({height: 'toggle'}, "fast");
@@ -51,7 +50,7 @@
         
         init: function() {
             script.corrections();
-            // script.info();
+//            script.info();
         }
     };
 /* ]]> */
index ba8cf36e52687dc2a5fdbff778085a5b2eafdc97..768185933716885b7b00228cfe39870c90530b4f 100644 (file)
@@ -193,33 +193,33 @@ div#header-home div.i2 {
 div#header-home div.i3 {
   /*background: transparent;*/
 }
-body.nocoursepage div#content div.bt div {
+body.nolayouttable div#content div.bt div {
   background-position: 100% 0;
   right: -13px;
 }
-body.nocoursepage div#content div.bt {
+body.nolayouttable div#content div.bt {
   background-position: 0 0;
   left: -13px;
   margin: 0 13px 0 0;
 }
-body.nocoursepage div#content div.bb div {
+body.nolayouttable div#content div.bb div {
   background-position: 100% 100%;
   right: -13px;
 }
-body.nocoursepage div#content div.bb {
+body.nolayouttable div#content div.bb {
   background-position: 0 100%;
   left: -13px;
   margin: 0 13px 0 0;
 }
-body.nocoursepage div#content div.i1 {
+body.nolayouttable div#content div.i1 {
   background-position: 100% 0;
   padding: 0;
 }
-body.nocoursepage div#content div.i2 {
+body.nolayouttable div#content div.i2 {
   background-position: 0 0;
   padding: 0 12px;
 }
-body.nocoursepage div#content div.i3 {
+body.nolayouttable div#content div.i3 {
   /*background: transparent;*/
 }
 div#content div.ccbox div.i1 {
index a6e079aea0dac6c98fe6cea0eaa994babb284172..44d9e8acca66354f62f1550314a68b5fc8bad936 100644 (file)
@@ -216,31 +216,31 @@ body.dir-rtl div#header-home div.bb div {
 div#header-home div.bb {
   background-image: url(pix/beige_box.gif);
 }
-body.nocoursepage div#content div.bt div {
+body.nolayouttable div#content div.bt div {
   background-image: url(pix/box.gif);
 }
-body.nocoursepage.dir-rtl div#content div.bt div {
+body.nolayouttable.dir-rtl div#content div.bt div {
   right: -12px;
 }
-body.nocoursepage div#content div.bt {
+body.nolayouttable div#content div.bt {
   background-image: url(pix/box.gif);
 }
-body.nocoursepage div#content div.i1 {
+body.nolayouttable div#content div.i1 {
   background-image: url(pix/borders.gif);
 }
-body.nocoursepage div#content div.i2 {
+body.nolayouttable div#content div.i2 {
   background-image: url(pix/borders.gif);
 }
-body.nocoursepage div#content div.bb div {
+body.nolayouttable div#content div.bb div {
   background-image: url(pix/box.gif);
 }
-body.nocoursepage.dir-rtl div#content div.bb div {
+body.nolayouttable.dir-rtl div#content div.bb div {
   right: -12px;
 }
-body.nocoursepage div#content div.bb {
+body.nolayouttable div#content div.bb {
   background-image: url(pix/box.gif);
 }
-body.nocoursepage.dir-rtl div#content div.bb {
+body.nolayouttable.dir-rtl div#content div.bb {
   right: -12px;
 }
 div#content div.ccbox div.bt div {
index aaacdd643cbe4050319062b44f60c9d70dc305b7..4780adcfbcba5c84d0d2d8dccee523a2967850e8 100644 (file)
@@ -996,7 +996,7 @@ div#header-home div.bb {
   height: 12px;
   background-color: transparent;
 }
-body.nocoursepage div#content div.bt div {
+body.nolayouttable div#content div.bt div {
   background-image: url(pix/box.png);
   background-repeat: no-repeat;
   background-position: 0 0;
@@ -1006,7 +1006,7 @@ body.nocoursepage div#content div.bt div {
   position: relative;
   width: 13px;
 }
-body.nocoursepage div#content div.bt {
+body.nolayouttable div#content div.bt {
   background-image: url(pix/box.png);
   background-repeat: no-repeat;
   background-position: 100% 0;
@@ -1014,14 +1014,14 @@ body.nocoursepage div#content div.bt {
   height: 12px;
   background-color: transparent;
 }
-body.nocoursepage div#content div.i1 {
+body.nolayouttable div#content div.i1 {
   background-image: url(pix/borders.png);
   background-repeat: repeat-y;
   background-position: 0 0;
   background-color: transparent;
   padding: 0 0 0 12px;
 }
-body.nocoursepage div#content div.i2 {
+body.nolayouttable div#content div.i2 {
   background-image: url(pix/borders.png);
   background-repeat: repeat-y;
   background-attachment: scroll;
@@ -1029,14 +1029,14 @@ body.nocoursepage div#content div.i2 {
   background-color: transparent;
   padding: 0 12px 0 0;
 }
-body.nocoursepage div#content div.i3 {
+body.nolayouttable div#content div.i3 {
   background-color: #FFFFFF;
   padding: 0 10px;
   border-width: 1px 0;
   border-style: solid;
   border-color: #FFFFFF;
 }
-body.nocoursepage div#content div.bb div {
+body.nolayouttable div#content div.bb div {
   background-image: url(pix/box.png);
   background-repeat: no-repeat;
   background-position: 0 100%;
@@ -1046,7 +1046,7 @@ body.nocoursepage div#content div.bb div {
   position: relative;
   width: 13px;
 }
-body.nocoursepage div#content div.bb {
+body.nolayouttable div#content div.bb {
   background-image: url(pix/box.png);
   background-repeat: no-repeat;
   background-position: 100% 100%;
@@ -1292,9 +1292,15 @@ body.grade-report-grader table#user-grades td.cat {
 body.grade-report-grader table#user-grades td.course {
   font-weight: bold;
 }
-body#admin-roles-override td.cell.c1 {\r  padding-top: 0.5em;\r}
-body#admin-roles-assign td.cell.c3 {\r  padding-top: 0.5em;\r}
-body#admin-roles-assign td.cell.c1 {\r  padding-top: 0.5em;\r}
+body#admin-roles-override td.cell.c1 {
+  padding-top: 0.5em;
+}
+body#admin-roles-assign td.cell.c3 {
+  padding-top: 0.5em;
+}
+body#admin-roles-assign td.cell.c1 {
+  padding-top: 0.5em;
+}
 
 #admin-roles-override .capcurrent {
   background-color:#eeeeee;