From 5c13d6a8f1416abb5712bc77aadb959dc1c9d333 Mon Sep 17 00:00:00 2001 From: rub Date: Sat, 25 Aug 2007 23:10:12 +0000 Subject: Resolved 0000728: Add description triggers for categories and elements Add: o render_category_description o render_category_literal_description o render_element_description Merge branch-1_7 2048:2050 into BSF git-svn-id: http://piwigo.org/svn/trunk@2079 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/category_cats.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php index 4acd7dff4..68b0ec4c2 100644 --- a/include/category_cats.inc.php +++ b/include/category_cats.inc.php @@ -217,6 +217,12 @@ if (count($categories) > 0) { update_cats_with_filtered_data($categories); } + + // add default event handler for rendering category literal description + add_event_handler('render_category_literal_description', + create_function('$d', + 'return strip_tags($d, \'

\');')); + trigger_action('loc_begin_index_category_thumbnails', $categories); if ($conf['subcatify']) { @@ -224,7 +230,6 @@ if (count($categories) > 0) foreach ($categories as $category) { - $comment = strip_tags(@$category['comment'], '

'); if ($page['section']=='recent_cats') { $name = get_cat_display_name_cache($category['uppercats'], null, false); @@ -257,7 +262,10 @@ if (count($categories) > 0) true, '
' ), - 'DESCRIPTION' => @$comment, + 'DESCRIPTION' => + trigger_event('render_category_literal_description', + trigger_event('render_category_description', + @$category['comment'])), 'NAME' => $name, ) ); -- cgit v1.2.3