From 50819c5fa176be18ae311fb323c4490fe030647a Mon Sep 17 00:00:00 2001 From: tjhunt Date: Fri, 11 Jul 2008 14:17:21 +0000 Subject: [PATCH] Document print_side_block, and eliminate a bit of duplicated code. --- lib/weblib.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index e5f2ab12f4..6b11ea5436 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -6365,12 +6365,14 @@ function rebuildnolinktag($text) { * @param string $heading HTML for the heading. Can include full HTML or just * plain text - plain text will automatically be enclosed in the appropriate * heading tags. - * @param string $content HTML for the content - * @param array $list ? - * @param array $icons ? - * @param string $footer ? - * @param array $attributes ? - * @param string $title Plain text title, as embedded in the $heading. + * @param string $content HTML for the content + * @param array $list an alternative to $content, it you want a list of things with optional icons. + * @param array $icons optional icons for the things in $list. + * @param string $footer Extra HTML content that gets output at the end, inside a <div class="footer"> + * @param array $attributes an array of attribute => value pairs that are put on the + * outer div of this block. If there is a class attribute ' sideblock' gets appended to it. If there isn't + * already a class, class='sideblock' is used. + * @param string $title Plain text title, as embedded in the $heading. * @todo Finish documenting this function. Show example of various attributes, etc. */ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $footer='', $attributes = array(), $title='') { @@ -6394,11 +6396,9 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo print_side_block_start($heading, $attributes); + // The content. if ($content) { echo $content; - if ($footer) { - echo ''; - } } else { if ($list) { $row = 0; @@ -6415,10 +6415,11 @@ function print_side_block($heading='', $content='', $list=NULL, $icons=NULL, $fo } echo "\n"; } - if ($footer) { - echo ''; - } + } + // Footer, if any. + if ($footer) { + echo ''; } print_side_block_end($attributes, $title); -- 2.39.5