aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2009-02-05 02:29:57 +0000
committerrvelices <rv-github@modusoptimus.com>2009-02-05 02:29:57 +0000
commita44e905d0ba68c995ebe066792b9b348c45599cc (patch)
tree58a62d350a0cc6f4bfec3d63eeed7d4b4a17d443
parent52281b5f44f000ea3b10c32a7039a32669d0b47b (diff)
merge r3124 from trunk
- removed triggers loc_index_thumbnail and loc_index_category_thumbnail - changed triggers loc_end_index_thumbnails and loc_end_index_category_thumbnails from actions to events git-svn-id: http://piwigo.org/svn/branches/2.0@3125 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/category_cats.inc.php19
-rw-r--r--include/category_default.inc.php14
2 files changed, 15 insertions, 18 deletions
diff --git a/include/category_cats.inc.php b/include/category_cats.inc.php
index adb5121a7..b923ec569 100644
--- a/include/category_cats.inc.php
+++ b/include/category_cats.inc.php
@@ -220,6 +220,8 @@ if (count($categories) > 0)
trigger_action('loc_begin_index_category_thumbnails', $categories);
+ $tpl_thumbnails_var = array();
+
foreach ($categories as $category)
{
$category['name'] = trigger_event(
@@ -237,14 +239,12 @@ if (count($categories) > 0)
$name = $category['name'];
}
- $icon_ts = get_icon($category['max_date_last'], $category['is_child_date_last']);
-
$tpl_var =
array(
'ID' => $category['id'],
'TN_SRC' => $thumbnail_src_of[$category['representative_picture_id']],
'TN_ALT' => strip_tags($category['name']),
- 'ICON_TS' => $icon_ts,
+ 'ICON_TS' => get_icon($category['max_date_last'], $category['is_child_date_last']),
'URL' => make_index_url(
array(
@@ -295,14 +295,13 @@ if (count($categories) > 0)
}
}//fromto
- //plugins need to add/modify sth in this loop ?
- $tpl_var = trigger_event('loc_index_category_thumbnail',
- $tpl_var, $category );
-
- $template->append( 'category_thumbnails', $tpl_var);
+ $tpl_thumbnails_var[] = $tpl_var;
}
- trigger_action('loc_end_index_category_thumbnails', $categories);
+ $tpl_thumbnails_var = trigger_event('loc_end_index_category_thumbnails', $tpl_thumbnails_var, $categories);
+ $template->assign( 'category_thumbnails', $tpl_thumbnails_var);
+
$template->assign_var_from_handle('CATEGORIES', 'index_category_thumbnails');
}
-?>
+pwg_debug('end include/category_cats.inc.php');
+?> \ No newline at end of file
diff --git a/include/category_default.inc.php b/include/category_default.inc.php
index da2386445..804f2a5fa 100644
--- a/include/category_default.inc.php
+++ b/include/category_default.inc.php
@@ -90,11 +90,10 @@ SELECT image_id, COUNT(*) AS nb_comments
$template->set_filenames( array( 'index_thumbnails' => 'thumbnails.tpl',));
trigger_action('loc_begin_index_thumbnails', $pictures);
+$tpl_thumbnails_var = array();
foreach ($pictures as $row)
{
- $thumbnail_url = get_thumbnail_url($row);
-
// link on picture.php page
$url = duplicate_picture_url(
array(
@@ -107,7 +106,7 @@ foreach ($pictures as $row)
$tpl_var =
array(
'ID' => $row['id'],
- 'TN_SRC' => $thumbnail_url,
+ 'TN_SRC' => get_thumbnail_url($row),
'TN_ALT' => $row['file'],
'TN_TITLE' => get_thumbnail_title($row),
'ICON_TS' => get_icon($row['date_available']),
@@ -171,13 +170,12 @@ foreach ($pictures as $row)
$tpl_var['NB_COMMENTS'] = $row['nb_comments'];
}
- //plugins need to add/modify sth in this loop ?
- $tpl_var = trigger_event('loc_index_thumbnail', $tpl_var, $row);
-
- $template->append('thumbnails', $tpl_var);
+ $tpl_thumbnails_var[] = $tpl_var;
}
-trigger_action('loc_end_index_thumbnails', $pictures);
+$tpl_thumbnails_var = trigger_event('loc_end_index_thumbnails', $tpl_thumbnails_var, $pictures);
+$template->assign('thumbnails', $tpl_thumbnails_var);
+
$template->assign_var_from_handle('THUMBNAILS', 'index_thumbnails');
pwg_debug('end include/category_default.inc.php');