aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-07-24 20:48:44 +0000
committerrvelices <rv-github@modusoptimus.com>2012-07-24 20:48:44 +0000
commit0bb3361cf1594d620bf82c4ac398a8340419ae1a (patch)
treeeaf8e7a4c953139bf234445fbb8207b18cb6fe79 /index.php
parent8197cd440fe41c92ed6bb798e8e4e97797fd297d (diff)
Merged revision(s) 16986-16987 from trunk: refactor code when selected derivative on index page is changed by a plugin ...
fix ie7 display and unwanted text in print git-svn-id: http://piwigo.org/svn/branches/2.4@16988 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--index.php41
1 files changed, 19 insertions, 22 deletions
diff --git a/index.php b/index.php
index e6f6b5965..02cd6369f 100644
--- a/index.php
+++ b/index.php
@@ -273,28 +273,6 @@ if ( $conf['index_sort_order_input']
}
}
-if ( count($page['items']) > 0 )
-{
- $url = add_url_params(
- duplicate_index_url(),
- array('display' => '')
- );
- $selected_type = trigger_event('get_index_derivative_params', ImageStdParams::get_by_type( pwg_get_session_var('index_deriv', IMG_THUMB) ) )->type;
- $type_map = ImageStdParams::get_defined_type_map();
- unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]);
- foreach($type_map as $params)
- {
- $template->append(
- 'image_derivatives',
- array(
- 'DISPLAY' => l10n($params->type),
- 'URL' => $url.$params->type,
- 'SELECTED' => ($params->type == $selected_type ? true:false),
- )
- );
- }
-}
-
// category comment
if ($page['start']==0 and !isset($page['chronology_field']) and !empty($page['comment']) )
{
@@ -322,6 +300,25 @@ if ( 0==$page['start']
if ( !empty($page['items']) )
{
include(PHPWG_ROOT_PATH.'include/category_default.inc.php');
+ $url = add_url_params(
+ duplicate_index_url(),
+ array('display' => '')
+ );
+ $selected_type = $template->get_template_vars('derivative_params')->type;
+ $template->clear_assign( 'derivative_params' );
+ $type_map = ImageStdParams::get_defined_type_map();
+ unset($type_map[IMG_XXLARGE], $type_map[IMG_XLARGE]);
+ foreach($type_map as $params)
+ {
+ $template->append(
+ 'image_derivatives',
+ array(
+ 'DISPLAY' => l10n($params->type),
+ 'URL' => $url.$params->type,
+ 'SELECTED' => ($params->type == $selected_type ? true:false),
+ )
+ );
+ }
}
//------------------------------------------------------- category informations