From: pdontthink Date: Sun, 31 Dec 2006 05:40:57 +0000 (+0000) Subject: Remove span tags from core X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=b0215f910166d59ba9f3ffec1f57c82fa2168cb1;p=squirrelmail.git Remove span tags from core git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12034 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/html.php b/functions/html.php index 3172bc50..ecdafd2e 100644 --- a/functions/html.php +++ b/functions/html.php @@ -112,8 +112,36 @@ function create_image($src, $alt='', $width='', $height='', } +/** + * Generates a span tag + * + * @param string $value The contents that belong inside the span + * @param string $class The CSS class name (OPTIONAL; default + * not used) + * @param string $id The ID name (OPTIONAL; default not used) + * + * @return string The desired span tag. + * + * @since 1.5.2 + * + */ +function create_span($value, $class='', $id='') { + + global $oTemplate; + + $oTemplate->assign('value', $value); + $oTemplate->assign('class', $class); + $oTemplate->assign('id', $id); + + return $oTemplate->fetch('span.tpl'); + +} + + /** * Generates html tags +//FIXME: this should not be used anywhere in the core, or we should +// convert this to use templates. We sould not be assuming HTML output. * * @param string $tag Tag to output * @param string $val Value between tags diff --git a/functions/template/message_list_util.php b/functions/template/message_list_util.php index cdd8825b..8ffa17a4 100644 --- a/functions/template/message_list_util.php +++ b/functions/template/message_list_util.php @@ -174,16 +174,15 @@ function getPriorityIcon ($priority, $icon_theme_path) { switch ($priority) { case 1: case 2: - $icon = getIcon($icon_theme_path, 'prio_high.png', '!'); + $icon = getIcon($icon_theme_path, 'prio_high.png', create_span('!', 'high_priority')); break; case 5: - $icon = getIcon($icon_theme_path, 'prio_low.png', ''); + $icon = getIcon($icon_theme_path, 'prio_low.png', create_span('↓', 'low_priority')); break; default: $icon = getIcon($icon_theme_path, 'transparent.png', '', '', 5); break; } - echo "prio = $priority
icon = $icon
"; return $icon; } diff --git a/templates/default/span.tpl b/templates/default/span.tpl new file mode 100644 index 00000000..2bbda59b --- /dev/null +++ b/templates/default/span.tpl @@ -0,0 +1,26 @@ +>