]> git.mjollnir.org Git - moodle.git/commitdiff
'set sideblock left and right min/max width with values set in theme/config.php'
authorurs_hunkler <urs_hunkler>
Sun, 28 Jan 2007 17:11:05 +0000 (17:11 +0000)
committerurs_hunkler <urs_hunkler>
Sun, 28 Jan 2007 17:11:05 +0000 (17:11 +0000)
admin/pagelib.php
blog/header.php
course/format/lams/format.php
course/format/scorm/format.php
course/format/social/format.php
course/format/weeks/format.php

index 905e442554ee8b4d25ad44b16aa6da8b20a49ee7..3f6df27c24422d6870a4d88000090ce73006d426 100644 (file)
@@ -4,11 +4,23 @@ require_once($CFG->libdir.'/pagelib.php');
 
 define('PAGE_ADMIN', 'admin');
 
-define('BLOCK_L_MIN_WIDTH',0);
-define('BLOCK_L_MAX_WIDTH',210);
-define('BLOCK_R_MIN_WIDTH',0);
-define('BLOCK_R_MAX_WIDTH',210);
-
+// define('BLOCK_L_MIN_WIDTH',0);
+// define('BLOCK_L_MAX_WIDTH',210);
+// define('BLOCK_R_MIN_WIDTH',0);
+// define('BLOCK_R_MAX_WIDTH',210);
+
+// Bounds for block widths
+// more flexible for theme designers taken from theme config.php
+$lmin = (empty($THEME->block_l_min_width)) ? 0 :   $THEME->block_l_min_width;
+$lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
+$rmin = (empty($THEME->block_r_min_width)) ? 0 :   $THEME->block_r_min_width;
+$rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
+
+define('BLOCK_L_MIN_WIDTH', $lmin);
+define('BLOCK_L_MAX_WIDTH', $lmax);
+define('BLOCK_R_MIN_WIDTH', $rmin);
+define('BLOCK_R_MAX_WIDTH', $rmax);
+  
 page_map_class(PAGE_ADMIN, 'page_admin');
 
 class page_admin extends page_base {
index a5c1002bdf39c9ab21eeb90ed7a7ab0eae4afe88..4a7dde7d69f5a46d92de48e1b83b117793b8cafa 100755 (executable)
@@ -21,11 +21,23 @@ if (!$course = get_record('course', 'id', $courseid)) {
 }
 
 // Bounds for block widths within this page
-define('BLOCK_L_MIN_WIDTH', 160);
-define('BLOCK_L_MAX_WIDTH', 210);
-define('BLOCK_R_MIN_WIDTH', 160);
-define('BLOCK_R_MAX_WIDTH', 210);
-
+// define('BLOCK_L_MIN_WIDTH', 160);
+// define('BLOCK_L_MAX_WIDTH', 210);
+// define('BLOCK_R_MIN_WIDTH', 160);
+// define('BLOCK_R_MAX_WIDTH', 210);
+
+// Bounds for block widths
+// more flexible for theme designers taken from theme config.php
+$lmin = (empty($THEME->block_l_min_width)) ? 160 : $THEME->block_l_min_width;
+$lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
+$rmin = (empty($THEME->block_r_min_width)) ? 160 : $THEME->block_r_min_width;
+$rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
+
+define('BLOCK_L_MIN_WIDTH', $lmin);
+define('BLOCK_L_MAX_WIDTH', $lmax);
+define('BLOCK_R_MIN_WIDTH', $rmin);
+define('BLOCK_R_MAX_WIDTH', $rmax);
+  
 //_____________ new page class code ________
 $pagetype = PAGE_BLOG_VIEW;
 $pageclass = 'page_blog';
index b8166d6d7feb299d8c63b279c263f97231e9a5fe..a53d8b8c5709da10933e35e68463cd65fa3819f5 100644 (file)
@@ -10,11 +10,23 @@ require_once($CFG->dirroot.'/lib/weblib.php');
 $topic = optional_param('topic', -1, PARAM_INT);
 
 // Bounds for block widths
-define('BLOCK_L_MIN_WIDTH', 100);
-define('BLOCK_L_MAX_WIDTH', 210);
-define('BLOCK_R_MIN_WIDTH', 100);
-define('BLOCK_R_MAX_WIDTH', 210);
+// define('BLOCK_L_MIN_WIDTH', 100);
+// define('BLOCK_L_MAX_WIDTH', 210);
+// define('BLOCK_R_MIN_WIDTH', 100);
+// define('BLOCK_R_MAX_WIDTH', 210);
 
+// 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;
+$lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
+$rmin = (empty($THEME->block_r_min_width)) ? 100 : $THEME->block_r_min_width;
+$rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
+
+define('BLOCK_L_MIN_WIDTH', $lmin);
+define('BLOCK_L_MAX_WIDTH', $lmax);
+define('BLOCK_R_MIN_WIDTH', $rmin);
+define('BLOCK_R_MAX_WIDTH', $rmax);
+  
 $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),  
                                         BLOCK_L_MAX_WIDTH);
 $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 
index 1241f0d312bae2b9af03f3332999cecba04eddc2..2aa5a2e3997db0052e28e272c6c1fb9b910850f2 100644 (file)
@@ -7,11 +7,23 @@
     require_once($CFG->dirroot.'/mod/'.$module.'/locallib.php');
 
     // Bounds for block widths
-    define('BLOCK_L_MIN_WIDTH', 100);
-    define('BLOCK_L_MAX_WIDTH', 210);
-    define('BLOCK_R_MIN_WIDTH', 100);
-    define('BLOCK_R_MAX_WIDTH', 210);
+    // define('BLOCK_L_MIN_WIDTH', 100);
+    // define('BLOCK_L_MAX_WIDTH', 210);
+    // define('BLOCK_R_MIN_WIDTH', 100);
+    // define('BLOCK_R_MAX_WIDTH', 210);
 
+    // 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;
+    $lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
+    $rmin = (empty($THEME->block_r_min_width)) ? 100 : $THEME->block_r_min_width;
+    $rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
+
+    define('BLOCK_L_MIN_WIDTH', $lmin);
+    define('BLOCK_L_MAX_WIDTH', $lmax);
+    define('BLOCK_R_MIN_WIDTH', $rmin);
+    define('BLOCK_R_MAX_WIDTH', $rmax);
+  
     $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),  
                                             BLOCK_L_MAX_WIDTH);
     $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 
index 88e2a8cfadc3596bad67471c8ccc517a8e9225ba..26b30e4b15149eff1c8203205b666f2021efdf7e 100644 (file)
@@ -5,11 +5,23 @@
     require_once($CFG->dirroot.'/mod/forum/lib.php');
 
     // Bounds for block widths
-    define('BLOCK_L_MIN_WIDTH', 100);
-    define('BLOCK_L_MAX_WIDTH', 210);
-    define('BLOCK_R_MIN_WIDTH', 100);
-    define('BLOCK_R_MAX_WIDTH', 210);
+    // define('BLOCK_L_MIN_WIDTH', 100);
+    // define('BLOCK_L_MAX_WIDTH', 210);
+    // define('BLOCK_R_MIN_WIDTH', 100);
+    // define('BLOCK_R_MAX_WIDTH', 210);
 
+    // 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;
+    $lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
+    $rmin = (empty($THEME->block_r_min_width)) ? 100 : $THEME->block_r_min_width;
+    $rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
+
+    define('BLOCK_L_MIN_WIDTH', $lmin);
+    define('BLOCK_L_MAX_WIDTH', $lmax);
+    define('BLOCK_R_MIN_WIDTH', $rmin);
+    define('BLOCK_R_MAX_WIDTH', $rmax);
+  
     $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),  
                                             BLOCK_L_MAX_WIDTH);
     $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]), 
index 3093ef5ec59aa76e9ff12e9e2660fba02fbd979e..f49c096c8c6a5a6156b0c3da45f16359ce790ba0 100644 (file)
@@ -8,11 +8,23 @@
     $week = optional_param('week', -1, PARAM_INT);
 
     // Bounds for block widths
-    define('BLOCK_L_MIN_WIDTH', 100);
-    define('BLOCK_L_MAX_WIDTH', 210);
-    define('BLOCK_R_MIN_WIDTH', 100);
-    define('BLOCK_R_MAX_WIDTH', 210);
+    // define('BLOCK_L_MIN_WIDTH', 100);
+    // define('BLOCK_L_MAX_WIDTH', 210);
+    // define('BLOCK_R_MIN_WIDTH', 100);
+    // define('BLOCK_R_MAX_WIDTH', 210);
 
+    // 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;
+    $lmax = (empty($THEME->block_l_max_width)) ? 210 : $THEME->block_l_max_width;
+    $rmin = (empty($THEME->block_r_min_width)) ? 100 : $THEME->block_r_min_width;
+    $rmax = (empty($THEME->block_r_max_width)) ? 210 : $THEME->block_r_max_width;
+
+    define('BLOCK_L_MIN_WIDTH', $lmin);
+    define('BLOCK_L_MAX_WIDTH', $lmax);
+    define('BLOCK_R_MIN_WIDTH', $rmin);
+    define('BLOCK_R_MAX_WIDTH', $rmax);
+  
     $preferred_width_left  = bounded_number(BLOCK_L_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]),  
                                             BLOCK_L_MAX_WIDTH);
     $preferred_width_right = bounded_number(BLOCK_R_MIN_WIDTH, blocks_preferred_width($pageblocks[BLOCK_POS_RIGHT]),