*
* @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
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)) {
*
* @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) {
* @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();
* @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 "<table $align $width class=\"$class\" border=\"0\" cellpadding=\"$padding\" cellspacing=\"0\"><tr><td bgcolor=\"$color\" class=\"$class"."content\">";
+ echo "<table $align $width class=\"$class\" border=\"0\" cellpadding=\"$padding\" cellspacing=\"0\">".
+ "<tr><td $color class=\"$class"."content\">";
}
/**
/**
* Print a nicely formatted table.
*
- * @uses $THEME
* @param array $table is an object with several properties.
* <ul<li>$table->head - An array of heading names.
* <li>$table->align - An array of column alignments
*/
function print_table($table) {
- global $THEME;
-
if (isset($table->align)) {
foreach ($table->align as $key => $aa) {
if ($aa) {
* 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
*/
function helpbutton ($page, $title='', $module='moodle', $image=true, $linktext=false, $text='', $return=false,
$imagetext='') {
- global $CFG, $THEME;
+ global $CFG;
if ($module == '') {
$module = 'moodle';
* 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);
}
echo '<br />';
- print_simple_box($message, 'center', '50%', $THEME->cellheading, '20', 'noticebox');
+ print_simple_box($message, 'center', '50%', '', '20', 'noticebox');
print_heading('<a href="'. $link .'">'. get_string('continue') .'</a>');
print_footer(get_site());
die;
/**
* 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 '<p align="center"><font size="3">'. $message .'</font></p>';
echo '<p align="center"><font size="3"><strong>';
echo '<a href="'. $linkyes .'">'. get_string('yes') .'</a>';
* 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 ?
*/
function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $footer='', $attributes = array()) {
- global $THEME;
-
print_side_block_start($heading, $attributes);
if ($content) {
echo '<table width="100%" border="0" cellspacing="0" cellpadding="2">';
if ($list) {
foreach ($list as $key => $string) {
- echo '<tr bgcolor="'. $THEME->cellcontent2 .'">';
+ echo '<tr>';
if ($icons) {
echo '<td class="sideblocklinks" valign="top" width="16">'. $icons[$key] .'</td>';
}
}
}
if ($footer) {
- echo '<tr bgcolor="'. $THEME->cellcontent2 .'">';
+ echo '<tr>';
echo '<td class="sideblocklinks" ';
if ($icons) {
echo ' colspan="2" ';
/**
* Starts a nice side block with an optional header.
*
- * @uses $THEME
* @param string $heading ?
* @param array $attributes ?
* @todo Finish documenting this function
*/
function print_side_block_start($heading='', $attributes = array()) {
- global $THEME;
// If there are no special attributes, give a default CSS class
if(empty($attributes) || !is_array($attributes)) {
$attrtext .= ' '.$attr.'="'.$val.'"';
}
- // [pj] UGLY UGLY UGLY! I hate myself for doing this!
- // When the Lord Moodle 2.0 cometh, his mercy shalt move all this mess
- // to CSS and banish the evil to the abyss from whence it came.
- echo '<table style="width: 100%;" cellspacing="0" cellpadding="5"'.$attrtext.'>';
+ echo '<table class="sideblock" cellspacing="0" cellpadding="5"'.$attrtext.'>';
if ($heading) {
echo '<thead><tr><td class="sideblockheading">'.$heading.'</td></tr></thead>';
}
- echo '<tbody style="background-color: '.$THEME->cellcontent2.';"><tr><td class="sideblockmain">';
+ echo '<tbody><tr><td class="sideblockmain">';
}