]> git.mjollnir.org Git - moodle.git/commitdiff
added/changed custom corners lib and calls to add the necessary divs
authorurs_hunkler <urs_hunkler>
Wed, 9 May 2007 15:03:01 +0000 (15:03 +0000)
committerurs_hunkler <urs_hunkler>
Wed, 9 May 2007 15:03:01 +0000 (15:03 +0000)
course/format/social/format.php
course/format/topics/format.php
course/format/weeks/format.php
lib/adminlib.php
lib/weblib.php
mod/chat/view.php
mod/data/view.php
mod/quiz/view.php
mod/resource/lib.php

index 4a3566b3a672b75212a03983f193f50719998129..1662888d43181fefbeb00369bbe395f1a34576e6 100644 (file)
@@ -2,6 +2,10 @@
       // format.php - course format featuring social forum
       //              included from view.php
 
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
+    
     // Bounds for block widths
     // more flexible for theme designers taken from theme config.php
     $lmin = (empty($THEME->block_l_min_width)) ? 100 : $THEME->block_l_min_width;
 
     if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
         echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
     }
 
-    echo '<td id="middle-column"><a name="startofcontent"></a>';
+    echo '<td id="middle-column">';
+    if (!empty($THEME->customcorners)) print_custom_corners_start();
+    echo '<a name="startofcontent"></a>';
     if ($forum = forum_get_course_forum($course->id, 'social')) {
         print_heading_block(get_string('socialheadline'));
         if (forum_is_forcesubscribed($forum->id)) {
     } else {
         notify('Could not find or create a social forum here');
     }
+    if (!empty($THEME->customcorners)) print_custom_corners_end();
     echo '</td>';
 
     // The right column
     if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
         echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
     }
 
index 507682759646da50d3b95a3bf54c954fdf2638c2..514f91a78ae5394409ef5e5a0b278625099e72cd 100644 (file)
@@ -8,6 +8,10 @@
       
 
     require_once($CFG->libdir.'/ajax/ajaxlib.php');
+    
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
   
     $topic = optional_param('topic', -1, PARAM_INT);
 
 
     if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
         echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
-        if (!empty($THEME->roundcorners)) {
-            echo '<div class="bt"><div></div></div>';
-            echo '<div class="i1"><div class="i2"><div class="i3">';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
-        if (!empty($THEME->roundcorners)) {
-            echo '</div></div></div>';
-            echo '<div class="bb"><div></div></div>';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
     }
 
             case 'middle':
 /// Start main column
     echo '<td id="middle-column">';
-    if (!empty($THEME->roundcorners)) {
-        echo '<div class="bt"><div></div></div>';
-        echo '<div class="i1"><div class="i2"><div class="i3">';
-    }
+    if (!empty($THEME->customcorners)) print_custom_corners_start();
     echo '<a name="startofcontent"></a>';
 
     print_heading_block(get_string('topicoutline'), 'outline');
         echo '</div>';
     }
 
-    if (!empty($THEME->roundcorners)) {
-        echo '</div></div></div>';
-        echo '<div class="bb"><div></div></div>';
-    }
+    if (!empty($THEME->customcorners)) print_custom_corners_end();
     echo '</td>';
 
             break;
     // The right column
     if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
         echo '<td style="width:'.$preferred_width_right.'px" id="right-column">';
-        if (!empty($THEME->roundcorners)) {
-            echo '<div class="bt"><div></div></div>';
-            echo '<div class="i1"><div class="i2"><div class="i3">';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
-        if (!empty($THEME->roundcorners)) {
-            echo '</div></div></div>';
-            echo '<div class="bb"><div></div></div>';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
     }
 
index 7d7480db7140a0791a118a9594383bd17d34a83e..d551508198958caade14275334cc0d08baa091ba 100644 (file)
@@ -3,6 +3,10 @@
       // Included from "view.php"
 
     require_once($CFG->libdir.'/ajax/ajaxlib.php');
+    
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
 
     $week = optional_param('week', -1, PARAM_INT);
 
     if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) {
         echo '<td style="width:'.$preferred_width_left.'px" id="left-column">';
 
-        if (!empty($THEME->roundcorners)) {
-            echo '<div class="bt"><div></div></div>';
-            echo '<div class="i1"><div class="i2"><div class="i3">';
-        }
-        
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
-
-        if (!empty($THEME->roundcorners)) {
-            echo '</div></div></div>';
-            echo '<div class="bb"><div></div></div>';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
 
         echo '</td>';
     }
 /// Start main column
     echo '<td id="middle-column">';
 
-    if (!empty($THEME->roundcorners)) {
-       echo '<div class="bt"><div></div></div>';
-       echo '<div class="i1"><div class="i2"><div class="i3">';
-    }
+    if (!empty($THEME->customcorners)) print_custom_corners_start();
         
     echo '<a name="startofcontent"></a>';
 
         echo '</div>';
     }
 
-    if (!empty($THEME->roundcorners)) {
-        echo '</div></div></div>';
-        echo '<div class="bb"><div></div></div>';
-    }
+    if (!empty($THEME->customcorners)) print_custom_corners_end();
 
     echo '</td>';
 
     if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) {
         echo '<td style="width: '.$preferred_width_right.'px;" id="right-column">';
 
-        if (!empty($THEME->roundcorners)) {
-            echo '<div class="bt"><div></div></div>';
-            echo '<div class="i1"><div class="i2"><div class="i3">';
-        }
-
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
-
-        if (!empty($THEME->roundcorners)) {
-            echo '</div></div></div>';
-            echo '<div class="bb"><div></div></div>';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
 
         echo '</td>';
     }
index 5cef9f04e1c93cfdc49ef95f670253b48d83d336..4392c8d7850d32ca6d5a1b1573581831b4ca9b22 100644 (file)
@@ -2685,6 +2685,10 @@ function admin_externalpage_setup($section) {
 function admin_externalpage_print_header() {
 
     global $CFG, $PAGE, $SITE, $THEME;
+    
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
 
     define('ADMIN_EXT_HEADER_PRINTED', 'true');
 
@@ -2697,21 +2701,12 @@ function admin_externalpage_print_header() {
         $PAGE->print_header();
         echo '<table id="layout-table" summary=""><tr>';
         echo '<td style="width: ' . $preferred_width_left . 'px;" id="left-column">';
-        if (!empty($THEME->roundcorners)) {
-            echo '<div class="bt"><div></div></div>';
-            echo '<div class="i1"><div class="i2"><div class="i3">';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
-        if (!empty($THEME->roundcorners)) {
-            echo '</div></div></div>';
-            echo '<div class="bb"><div></div></div>';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
         echo '<td id="middle-column">';
-        if (!empty($THEME->roundcorners)) {
-            echo '<div class="bt"><div></div></div>';
-            echo '<div class="i1"><div class="i2"><div class="i3">';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
     } else {
         print_header();
     }
@@ -2720,7 +2715,11 @@ function admin_externalpage_print_header() {
 function admin_externalpage_print_footer() {
 
     global $CFG, $PAGE, $SITE, $THEME;
-
+    
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
+    
     define('ADMIN_EXT_FOOTER_PRINTED', 'true');
 
     if (!empty($SITE->fullname)) {
@@ -2728,22 +2727,13 @@ function admin_externalpage_print_footer() {
         $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH,
                                                 blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),
                                                 BLOCK_R_MAX_WIDTH);
-        if (!empty($THEME->roundcorners)) {
-            echo '</div></div></div>';
-            echo '<div class="bb"><div></div></div>';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
         if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
             echo '<td style="width: ' . $preferred_width_right . 'px;" id="right-column">';
-            if (!empty($THEME->roundcorners)) {
-                echo '<div class="bt"><div></div></div>';
-                echo '<div class="i1"><div class="i2"><div class="i3">';
-            }
+            if (!empty($THEME->customcorners)) print_custom_corners_start();
             blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
-            if (!empty($THEME->roundcorners)) {
-                echo '</div></div></div>';
-                echo '<div class="bb"><div></div></div>';
-            }
+            if (!empty($THEME->customcorners)) print_custom_corners_end();
             echo '</td>';
         }
         echo '</tr></table>';
index 6cb9edfd9c4b7fdffa2e77c887425c1814979d7b..ae44db43919ed832c2e0d440a5f81dcdf2a85692 100644 (file)
@@ -5667,7 +5667,11 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo
 function print_side_block_start($heading='', $attributes = array()) {
 
     global $CFG, $THEME;
-
+    
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
+    
     // If there are no special attributes, give a default CSS class
     if (empty($attributes) || !is_array($attributes)) {
         $attributes = array('class' => 'sideblock');
@@ -5703,22 +5707,19 @@ function print_side_block_start($heading='', $attributes = array()) {
         //Accessibility: replaced <div> with H2; no, H2 more appropriate in moodleblock.class.php: _title_html.
         // echo '<div class="header">'.$heading.'</div>';
         echo '<div class="header">';
-        if (!empty($THEME->roundcorners)) {
-            echo '<div class="bt"><div></div></div>';
-            echo '<div class="i1"><div class="i2"><div class="i3">';
-        }
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         echo $heading;
-        if (!empty($THEME->roundcorners)) {
+        if (!empty($THEME->customcorners)) {
             echo '</div></div></div>';
         }
         echo '</div>';
     } else {
-        if (!empty($THEME->roundcorners)) {
+        if (!empty($THEME->customcorners)) {
             echo '<div class="bt"><div></div></div>';
         }
     }
 
-    if (!empty($THEME->roundcorners)) {
+    if (!empty($THEME->customcorners)) {
         echo '<div class="i1"><div class="i2"><div class="i3">';
     }
     echo '<div class="content">';
@@ -5731,12 +5732,12 @@ function print_side_block_start($heading='', $attributes = array()) {
  */
 function print_side_block_end($attributes = array()) {
     global $CFG, $THEME;
-
+    
     echo '</div>';
 
-    if (!empty($THEME->roundcorners)) {
-        echo '</div></div></div>';
-        echo '<div class="bb"><div></div></div>';
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+        print_custom_corners_end();
     }
 
     echo '</div>';
@@ -6148,5 +6149,6 @@ function print_location_comment($file, $line, $return = false)
         echo "<!-- $file at line $line -->\n";
     }
 }
+
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
 ?>
\ No newline at end of file
index 412e9342cb5c44ff2e85a4fc19efb364d62edbcd..8d1f0deae9f784db3466fe8e0ee4ca60286cab9f 100644 (file)
@@ -6,6 +6,10 @@
     require_once('lib.php');
     require_once($CFG->libdir.'/blocklib.php');
     require_once('pagelib.php');
+    
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
 
     $id   = optional_param('id', 0, PARAM_INT);
     $c    = optional_param('c', 0, PARAM_INT);
 
     if(!empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
         echo '<td style="width: '.$blocks_preferred_width.'px;" id="left-column">';
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
     }
 
     echo '<td id="middle-column">';
+    if (!empty($THEME->customcorners)) print_custom_corners_start();
     
     if ($chat->studentlogs or has_capability('mod/chat:readlog',$context)) {
         echo '<div class="reportlink">';
 
 
 /// Finish the page
+    if (!empty($THEME->customcorners)) print_custom_corners_end();
     echo '</td></tr></table>';
 
     print_footer($course);
index bae0ca5ba32dd80f47f40df084bffabd26743cc5..03d134952e9e5c24747db5bc311c72be22f6cc1c 100755 (executable)
 
     require_once('pagelib.php');
     
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
+    
     
 /// One of these is necessary!
     $id    = optional_param('id', 0, PARAM_INT);  // course module id
         echo '<table id="layout-table"><tr>';
         if ((blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
             echo '<td style="width: '.$blocks_preferred_width.'px;" id="left-column">';
+            if (!empty($THEME->customcorners)) print_custom_corners_start();
             blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+            if (!empty($THEME->customcorners)) print_custom_corners_end();
             echo '</td>';
         }
         echo '<td id="middle-column">';
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
     }
 
     print_heading(format_string($data->name));
 
 /// If we have blocks, then print the left side here
     if (!empty($CFG->showblocksonmodpages)) {
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';   // Middle column
         if ((blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing())) {
             echo '<td style="width: '.$blocks_preferred_width.'px;" id="right-column">';
+            if (!empty($THEME->customcorners)) print_custom_corners_start();
             blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+            if (!empty($THEME->customcorners)) print_custom_corners_end();
             echo '</td>';
         }
         echo '</tr></table>';
index 0405da83ea155f36b5dbbd965133bcf2497236c1..a59f9f2531b0c521d078caaf610735f5aec9ed34 100644 (file)
@@ -6,6 +6,10 @@
     require_once("locallib.php");
     require_once($CFG->libdir.'/blocklib.php');
     require_once('pagelib.php');
+    
+    if (!empty($THEME->customcorners)) {
+        require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+    }
 
     $id   = optional_param('id', 0, PARAM_INT); // Course Module ID, or
     $q    = optional_param('q',  0, PARAM_INT);  // quiz ID
@@ -39,7 +43,7 @@
 
     // if no questions have been set up yet redirect to edit.php
     if (!$quiz->questions and has_capability('mod/quiz:manage', $context)) {
-        redirect('edit.php?quizid='.$quiz->id);
+        redirect('edit.php?cmid='.$cm->id);
     }
 
     add_to_log($course->id, "quiz", "view", "view.php?id=$cm->id", $quiz->id, $cm->id);
 
     if(!empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
         echo '<td style="width: '.$blocks_preferred_width.'px;" id="left-column">';
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
     }
 
     echo '<td id="middle-column">';
+    if (!empty($THEME->customcorners)) print_custom_corners_start();
 
     // Print the main part of the page
 
@@ -404,6 +411,7 @@ document.write('<input type="button" value="<?php echo $buttontext ?>" onclick="
     // Should we not be seeing if we need to print right-hand-side blocks?
 
     // Finish the page.
+    if (!empty($THEME->customcorners)) print_custom_corners_end();
     echo '</td></tr></table>';
     print_footer($course);
 
index a1437a0db50733ff59465b99cfdc28b3cbdc52f7..c0bcfab7c298e5714d521a6de31adc1466fd134e 100644 (file)
@@ -66,6 +66,10 @@ foreach ($RESOURCE_WINDOW_OPTIONS as $popupoption) {
     }
 }
 
+if (!empty($THEME->customcorners)) {
+    require_once($CFG->dirroot.'/lib/custom_corners_lib.php');
+}
+
 /**
 * resource_base is the base class for resource types
 *
@@ -168,11 +172,14 @@ function display_course_blocks_start() {
 
     if((blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) {
         echo '<td style="width: '.$blocks_preferred_width.'px;" id="left-column">';
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
     }
 
     echo '<td id="middle-column">';
+    if (!empty($THEME->customcorners)) print_custom_corners_start();
     echo '<div id="resource">';
 
 }
@@ -190,11 +197,14 @@ function display_course_blocks_end() {
     $blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 210);
 
     echo '</div>';
+    if (!empty($THEME->customcorners)) print_custom_corners_end();
     echo '</td>';
 
     if((blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $PAGE->user_is_editing())) {
         echo '<td style="width: '.$blocks_preferred_width.'px;" id="right-column">';
+        if (!empty($THEME->customcorners)) print_custom_corners_start();
         blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+        if (!empty($THEME->customcorners)) print_custom_corners_end();
         echo '</td>';
     }