From c147b8ab087af94503db3c3766c39b55d784fd78 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 25 Jan 2005 13:36:57 +0000 Subject: [PATCH] Removed $THEME from everywhere :-) --- lib/weblib.php | 48 +++++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index d1406fc3e1..cfe06d6346 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1475,7 +1475,6 @@ function highlightfast($needle, $haystack) { * * @uses $USER * @uses $CFG - * @uses $THEME * @uses $SESSION * @param string $title Appears at the top of the window * @param string $heading Appears at the top of the page @@ -1491,7 +1490,7 @@ function highlightfast($needle, $haystack) { function print_header ($title='', $heading='', $navigation='', $focus='', $meta='', $cache=true, $button=' ', $menu='', $usexml=false, $bodytags='') { - global $USER, $CFG, $THEME, $SESSION, $ME; + global $USER, $CFG, $SESSION, $ME; global $course; // This is a bit of an ugly hack to be gotten rid of later if (!empty($course->lang)) { @@ -1689,13 +1688,12 @@ function print_header_simple($title='', $heading='', $navigation='', $focus='', * * @uses $CFG * @uses $USER - * @uses $THEME * @param course $course {@link $COURSE} object containing course information * @param ? $usercourse ? * @todo Finish documenting this function */ function print_footer($course=NULL, $usercourse=NULL) { - global $USER, $CFG, $THEME; + global $USER, $CFG; /// Course links if ($course) { @@ -1890,7 +1888,7 @@ function print_continue($link) { * @param string $class ? * @todo Finish documenting this function */ -function print_simple_box($message, $align='', $width='', $color='#FFFFFF', $padding=5, $class='generalbox') { +function print_simple_box($message, $align='', $width='', $color='', $padding=5, $class='generalbox') { print_simple_box_start($align, $width, $color, $padding, $class); echo stripslashes_safe($message); print_simple_box_end(); @@ -1906,16 +1904,19 @@ function print_simple_box($message, $align='', $width='', $color='#FFFFFF', $pad * @param string $class ? * @todo Finish documenting this function */ -function print_simple_box_start($align='', $width='', $color='#FFFFFF', $padding=5, $class='generalbox') { - global $THEME; +function print_simple_box_start($align='', $width='', $color='', $padding=5, $class='generalbox') { + if ($color) { + $color = 'bgcolor="'. $color .'"'; + } if ($align) { $align = 'align="'. $align .'"'; } if ($width) { $width = 'width="'. $width .'"'; } - echo "
"; + echo "". + "
"; } /** @@ -2255,7 +2256,6 @@ function print_png($url, $sizex, $sizey, $returnstring, $parameters='alt=""') { /** * Print a nicely formatted table. * - * @uses $THEME * @param array $table is an object with several properties. * $table->head - An array of heading names. *
  • $table->align - An array of column alignments @@ -2271,8 +2271,6 @@ function print_png($url, $sizex, $sizey, $returnstring, $parameters='alt=""') { */ function print_table($table) { - global $THEME; - if (isset($table->align)) { foreach ($table->align as $key => $aa) { if ($aa) { @@ -3056,7 +3054,6 @@ function error ($message, $link='') { * Print a help button. * * @uses $CFG - * @uses $THEME * @param string $page The keyword that defines a help page * @param string $title The title of links, rollover tips, alt tags etc * @param string $module Which module is the page defined in @@ -3070,7 +3067,7 @@ function error ($message, $link='') { */ function helpbutton ($page, $title='', $module='moodle', $image=true, $linktext=false, $text='', $return=false, $imagetext='') { - global $CFG, $THEME; + global $CFG; if ($module == '') { $module = 'moodle'; @@ -3136,13 +3133,12 @@ function emoticonhelpbutton($form, $field) { * Print a message and exit. * * @uses $CFG - * @uses $THEME * @param string $message ? * @param string $link ? * @todo Finish documenting this function */ function notice ($message, $link='') { - global $CFG, $THEME; + global $CFG; $message = clean_text($message); $link = clean_text($link); @@ -3156,7 +3152,7 @@ function notice ($message, $link='') { } echo '
    '; - print_simple_box($message, 'center', '50%', $THEME->cellheading, '20', 'noticebox'); + print_simple_box($message, 'center', '50%', '', '20', 'noticebox'); print_heading(''. get_string('continue') .''); print_footer(get_site()); die; @@ -3165,19 +3161,17 @@ function notice ($message, $link='') { /** * Print a message along with "Yes" and "No" links for the user to continue. * - * @uses $THEME * @param string $message The text to display * @param string $linkyes The link to take the user to if they choose "Yes" * @param string $linkno The link to take the user to if they choose "No" */ function notice_yesno ($message, $linkyes, $linkno) { - global $THEME; $message = clean_text($message); $linkyes = clean_text($linkyes); $linkno = clean_text($linkno); - print_simple_box_start('center', '60%', $THEME->cellheading); + print_simple_box_start('center', '60%'); echo '

    '. $message .'

    '; echo '

    '; echo ''. get_string('yes') .''; @@ -3396,7 +3390,6 @@ function rebuildnolinktag($text) { * Prints a nice side block with an optional header. The content can either * be a block of HTML or a list of text with optional icons. * - * @uses $THEME * @param string $heading ? * @param string $content ? * @param array $list ? @@ -3407,8 +3400,6 @@ function rebuildnolinktag($text) { */ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $footer='', $attributes = array()) { - global $THEME; - print_side_block_start($heading, $attributes); if ($content) { @@ -3420,7 +3411,7 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo echo ''; if ($list) { foreach ($list as $key => $string) { - echo ''; + echo ''; if ($icons) { echo ''; } @@ -3429,7 +3420,7 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo } } if ($footer) { - echo ''; + echo ''; echo '