From f145c2482d9ddc73f89eecc47fa47f7f9c8a7168 Mon Sep 17 00:00:00 2001 From: urs_hunkler Date: Wed, 9 May 2007 15:03:01 +0000 Subject: [PATCH] added/changed custom corners lib and calls to add the necessary divs --- course/format/social/format.php | 13 ++++++++++- course/format/topics/format.php | 34 +++++++++------------------- course/format/weeks/format.php | 38 +++++++++---------------------- lib/adminlib.php | 40 +++++++++++++-------------------- lib/weblib.php | 26 +++++++++++---------- mod/chat/view.php | 8 +++++++ mod/data/view.php | 10 +++++++++ mod/quiz/view.php | 10 ++++++++- mod/resource/lib.php | 10 +++++++++ 9 files changed, 98 insertions(+), 91 deletions(-) diff --git a/course/format/social/format.php b/course/format/social/format.php index 4a3566b3a6..1662888d43 100644 --- a/course/format/social/format.php +++ b/course/format/social/format.php @@ -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; @@ -28,11 +32,15 @@ if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { echo ''; + 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 ''; } - echo ''; + echo ''; + if (!empty($THEME->customcorners)) print_custom_corners_start(); + echo ''; if ($forum = forum_get_course_forum($course->id, 'social')) { print_heading_block(get_string('socialheadline')); if (forum_is_forcesubscribed($forum->id)) { @@ -48,12 +56,15 @@ } else { notify('Could not find or create a social forum here'); } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; // The right column if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { echo ''; + 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 ''; } diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 5076827596..514f91a78a 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -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); @@ -78,15 +82,9 @@ if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { echo ''; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_start(); blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; } @@ -94,10 +92,7 @@ case 'middle': /// Start main column echo ''; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_start(); echo ''; print_heading_block(get_string('topicoutline'), 'outline'); @@ -279,10 +274,7 @@ echo '
'; } - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; break; @@ -290,15 +282,9 @@ // The right column if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { echo ''; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_start(); blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; } diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 7d7480db71..d551508198 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -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); @@ -63,17 +67,9 @@ if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $editing) { echo ''; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } - + if (!empty($THEME->customcorners)) print_custom_corners_start(); blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); - - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; } @@ -82,10 +78,7 @@ /// Start main column echo ''; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_start(); echo ''; @@ -281,10 +274,7 @@ echo '
'; } - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; @@ -294,17 +284,9 @@ if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT) || $editing) { echo ''; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } - + if (!empty($THEME->customcorners)) print_custom_corners_start(); blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); - - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo ''; } diff --git a/lib/adminlib.php b/lib/adminlib.php index 5cef9f04e1..4392c8d785 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -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 ''; echo ''; echo ''; if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) { echo ''; } echo '
'; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_start(); blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT); - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo '
'; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + 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 '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo '
'; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_start(); blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT); - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_end(); echo '
'; diff --git a/lib/weblib.php b/lib/weblib.php index 6cb9edfd9c..ae44db4391 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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
with H2; no, H2 more appropriate in moodleblock.class.php: _title_html. // echo '
'.$heading.'
'; echo '
'; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; - } + if (!empty($THEME->customcorners)) print_custom_corners_start(); echo $heading; - if (!empty($THEME->roundcorners)) { + if (!empty($THEME->customcorners)) { echo '
'; } echo '
'; } else { - if (!empty($THEME->roundcorners)) { + if (!empty($THEME->customcorners)) { echo '
'; } } - if (!empty($THEME->roundcorners)) { + if (!empty($THEME->customcorners)) { echo '
'; } echo '
'; @@ -5731,12 +5732,12 @@ function print_side_block_start($heading='', $attributes = array()) { */ function print_side_block_end($attributes = array()) { global $CFG, $THEME; - + echo '
'; - if (!empty($THEME->roundcorners)) { - echo '
'; - echo '
'; + if (!empty($THEME->customcorners)) { + require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); + print_custom_corners_end(); } echo '
'; @@ -6148,5 +6149,6 @@ function print_location_comment($file, $line, $return = false) echo "\n"; } } + // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140: ?> \ No newline at end of file diff --git a/mod/chat/view.php b/mod/chat/view.php index 412e9342cb..8d1f0deae9 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -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); @@ -70,11 +74,14 @@ if(!empty($CFG->showblocksonmodpages) && (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing())) { echo ''; + 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 ''; } echo ''; + if (!empty($THEME->customcorners)) print_custom_corners_start(); if ($chat->studentlogs or has_capability('mod/chat:readlog',$context)) { echo '