On Wo, 19 oktober, 2005 4:07 pm, Moshe Weitzman zei:
Calm down Steef ... Perhaps you want to submit a patch.
I do not, and I repeat _not_ like this approach!
A nicer solution would imo be:
/** * Return a themed list of items. * * @param $items * An array of items to be displayed in the list. * @param $title * The (optional) title of the list. * @return * A string containing the list output. */ function theme_item_list($items = array(), $title = NULL, $type = 'unordered list') { $class = str_replace('-', ' ', $type);
if (isset($items)) { switch($type) { case 'unordered list': $list .= '<ul>'; foreach ($items as $item) { $list .= '<li>'. $item .'</li>'; } $list .= '</ul>';
case 'ordered list': $list .= '<ol>'; foreach ($items as $item) { $list .= '<li>'. $item .'</li>'; } $list .= '</ol>';
case 'definition list': $list .= '<dl>'; foreach ($items as $item) { $list .= '<dt>'. $item .'</dt>'; } $list .= '</dl>'; }
if (isset($title)) { $output .= '<h3>'. $title .'</h3>'; }
$output .= '<div class="'. $class .'">'. $list .'</div>';
return $output; }
Isn't something like this nicer? And, easier to use?
Moshe, I'm sorry if this sounds rude to you. This was never my intention.. Probably the words i choose weren't the right ones to show I'm against this change.. Don't get me wrong, I admire your work and _really_ like the idea of making theme_item_list() a little more flexible, but not the choosen solution.. If you think my solution is better than yours, please let me know or give some feedback. After that I'll start making a patch.. Once again, my apoligize to you if this post express' anger, any form of frustration or made you upset.. Steef