diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-10-02 05:42:22 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-10-02 05:42:22 +0000 |
commit | 530e3e6974f95be5a5cca823b33ec8f7562fbcf6 (patch) | |
tree | 7eb1cb1f5b66c90c8e032b33833a2c1c331ee496 /include/functions_html.inc.php | |
parent | 58977351dd282cd14b53bbf04494acbddc185900 (diff) |
- merge r 2117 from trunk (render_category_description and render_category_literal_description events refactoring)
- fix admin multiview plugin
git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2118 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions_html.inc.php')
-rw-r--r-- | include/functions_html.inc.php | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/include/functions_html.inc.php b/include/functions_html.inc.php index cae82be2e..c875cfb7a 100644 --- a/include/functions_html.inc.php +++ b/include/functions_html.inc.php @@ -58,7 +58,7 @@ function get_icon($date, $is_child_date = false) if (!isset($page['get_icon_cache']['unix_timestamp'])) { // Use MySql date in order to standardize all recent "actions/queries" - list($page['get_icon_cache']['unix_timestamp']) = + list($page['get_icon_cache']['unix_timestamp']) = mysql_fetch_array(pwg_query('select UNIX_TIMESTAMP(CURRENT_DATE)')); } @@ -455,7 +455,7 @@ function get_html_menu_category($categories, $selected_category) {// at least one direct or indirect image $menu.= "\n".'<span class="'; // at least one image in this category -> class menuInfoCat - $menu.= ($category['nb_images'] > 0 ? "menuInfoCat" + $menu.= ($category['nb_images'] > 0 ? "menuInfoCat" : "menuInfoCatByChild").'"'; $menu.= ' title=" '.$title.'">'; // show total number of images @@ -735,10 +735,32 @@ function set_status_header($code, $text='') */ function set_span_class($count) { - if ($count > 1) - { + if ($count > 1) + { return 'plural'; } - return ( $count == 0 ) ? 'zero':'one'; + return ( $count == 0 ) ? 'zero':'one'; +} + +/** returns the category comment for rendering in html. + * this is an event handler. don't call directly + */ +function render_category_description($desc) +{ + global $conf; + if ( !( $conf['allow_html_descriptions'] and + preg_match('/<(div|br|img|script).*>/i', $desc) ) ) + { + $desc = nl2br($desc); + } + return $desc; +} + +/** returns the category comment for rendering in html textual mode (subcatify) + * this is an event handler. don't call directly + */ +function render_category_literal_description($desc) +{ + return strip_tags($desc, '<span><p><a><br><b><i><small><big><strong><em>'); } -?> +?>
\ No newline at end of file |