aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/category_cats.inc.php12
-rw-r--r--index.php3
-rw-r--r--picture.php7
3 files changed, 18 insertions, 4 deletions
diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php
index f50f9ff77..3ef955b4c 100644
--- a/include/category_cats.inc.php
+++ b/include/category_cats.inc.php
@@ -177,6 +177,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, \'<a><br><p><b><i><small><strong><font>\');'));
+
trigger_action('loc_begin_index_category_thumbnails', $categories);
if ($conf['subcatify'])
{
@@ -184,7 +190,6 @@ if (count($categories) > 0)
foreach ($categories as $category)
{
- $comment = strip_tags(@$category['comment'], '<a><br><p><b><i><small><strong><font>');
if ($page['section']=='recent_cats')
{
$name = get_cat_display_name_cache($category['uppercats'], null, false);
@@ -217,7 +222,10 @@ if (count($categories) > 0)
true,
'<br />'
),
- 'DESCRIPTION' => @$comment,
+ 'DESCRIPTION' =>
+ trigger_event('render_category_literal_description',
+ trigger_event('render_category_description',
+ @$category['comment'])),
'NAME' => $name,
)
);
diff --git a/index.php b/index.php
index 6116828f3..f3edd49de 100644
--- a/index.php
+++ b/index.php
@@ -296,7 +296,8 @@ if (isset($page['comment']) and $page['comment'] != '')
$template->assign_block_vars(
'cat_infos.comment',
array(
- 'COMMENTS' => $page['comment']
+ 'COMMENTS' =>
+ trigger_event('render_category_description', $page['comment'])
)
);
$header_infos['COMMENT'] = strip_tags($page['comment']);
diff --git a/picture.php b/picture.php
index 216355be4..ca9c01e9f 100644
--- a/picture.php
+++ b/picture.php
@@ -55,6 +55,9 @@ add_event_handler(
EVENT_HANDLER_PRIORITY_NEUTRAL,
2
);
+// add default event handler for rendering element description
+add_event_handler('render_element_description', 'nl2br');
+
trigger_action('loc_begin_picture');
// this is the default handler that generates the display for the element
@@ -638,7 +641,9 @@ if (isset($picture['current']['comment'])
$template->assign_block_vars(
'legend',
array(
- 'COMMENT_IMG' => nl2br($picture['current']['comment'])
+ 'COMMENT_IMG' =>
+ trigger_event('render_element_description',
+ $picture['current']['comment'])
));
$header_infos['COMMENT'] = strip_tags($picture['current']['comment']);
}