OK, we really need to revert this ASAP.
We can not start asking all the modules to identify particular boxes for custom_corners support. It's too hard on the API.
Two other solutions could be (in order of preference):
1) Leave things alone (were they really that bad?)
2) Fix print_box functions so that they do this when $THEME->customcorners is on, fix all the calls to them that might not provide good IDs to work with, and then fix the custom_corners theme so that it excludes any extra custom_corner boxes that should really not have corners displayed.
And if this is really too much overhead then,
3) come up with a more generic function like print_text_box or print_content_box ... it would work something like the patch in this bug but would at least be a bit more generic and describe the structure of the data rather than the appearance.
The wrapper functions are:
/**
*
*/
function print_custom_corners_box($message, $classes='generalbox', $ids='', $return=false) {
$output = print_custom_corners_box_start($classes, $ids, true);
$output .= stripslashes_safe($message);
$output .= print_custom_corners_box_end(true);
if ($return) { return $output; } else { echo $output; }
}
/**
* Function adds custom_corners to boxes
* Calls print_box_start
*
* @param string $classes, space-separated class names.
* @param string $ids, space-separated id names.
* @param boolean $return, return as string or just print it
*/
function print_custom_corners_box_start($classes='generalbox', $ids='', $return=false) {
global $CFG, $THEME;
$output = print_box_start('ccbox '.$classes, $ids, true);
if (!empty($THEME->customcorners)) { require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); $output .= print_custom_corners_start(true, true); }
if ($return) { return $output; } } else { echo $output; }
}
/**
* Function adds custom_corners to boxes
* Calls print_box_end
*
* @param boolean $return, return as string or just print it
*/
function print_custom_corners_box_end($return=false) {
global $CFG, $THEME;
if (!empty($THEME->customcorners)) { require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); $output .= print_custom_corners_end(true); }
$output .= print_box_end(true);;
if ($return) { return $output; } else { echo $output; } }
}
- Function adds custom_corners to boxes
*
- @param string $message, the content of the box
- @param string $classes, space-separated class names.
- @param string $ids, space-separated id names.
- @param boolean $return, return as string or just print it
*/
function print_custom_corners_box($message, $classes='generalbox', $ids='', $return=false) {
$output = print_custom_corners_box_start($classes, $ids, true); $output .= stripslashes_safe($message); $output .= print_custom_corners_box_end(true); if ($return) { return $output; } else { echo $output; } } /** * Function adds custom_corners to boxes * Calls print_box_start * * @param string $classes, space-separated class names. * @param string $ids, space-separated id names. * @param boolean $return, return as string or just print it */ function print_custom_corners_box_start($classes='generalbox', $ids='', $return=false) { global $CFG, $THEME; $output = print_box_start('ccbox '.$classes, $ids, true); if (!empty($THEME->customcorners)) { require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); $output .= print_custom_corners_start(true, true); } if ($return) { return $output; } } else { echo $output; } } /** * Function adds custom_corners to boxes * Calls print_box_end * * @param boolean $return, return as string or just print it */ function print_custom_corners_box_end($return=false) { global $CFG, $THEME; if (!empty($THEME->customcorners)) { require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); $output .= print_custom_corners_end(true); } $output .= print_box_end(true);; if ($return) { return $output; } else { echo $output; } } }