diff options
author | rvelices <rv-github@modusoptimus.com> | 2007-03-09 03:37:56 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2007-03-09 03:37:56 +0000 |
commit | 81030a7ab40a481d6d8c93539162a4a035ea09d1 (patch) | |
tree | 69cf4d569a7185a000f896ca9e5a91020bb46b94 /picture.php | |
parent | f266c3b4cb4dd517eb4ccf7aa4e5a46936e5ccff (diff) |
plugins only:
- fix in category_default.inc.php (action parameters were wrong if show_nb_comments was true)
- refactor actions and events in picture.php in order to give more flexibility to plugins
- added some variables in index.tpl (not used by pwg itself) to allow plugins to add their own content
git-svn-id: http://piwigo.org/svn/trunk@1882 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r-- | picture.php | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/picture.php b/picture.php index 2366987c6..71fb2d3eb 100644 --- a/picture.php +++ b/picture.php @@ -70,20 +70,16 @@ function default_picture_content($content, $element_info) return $content; } - global $user, $page; + global $user, $page, $template; - $my_template = new Template( - PHPWG_ROOT_PATH.'template/'.$user['template'], - $user['theme'] - ); - $my_template->set_filenames( + $template->set_filenames( array('default_content'=>'picture_content.tpl') ); if ( !isset($page['slideshow']) and isset($element_info['high_url']) ) { $uuid = uniqid(rand()); - $my_template->assign_block_vars( + $template->assign_block_vars( 'high', array( 'U_HIGH' => $element_info['high_url'], @@ -91,14 +87,14 @@ function default_picture_content($content, $element_info) ) ); } - $my_template->assign_vars( array( + $template->assign_vars( array( 'SRC_IMG' => $element_info['image_url'], 'ALT_IMG' => $element_info['file'], 'WIDTH_IMG' => @$element_info['scaled_width'], 'HEIGHT_IMG' => @$element_info['scaled_height'], ) ); - return $my_template->parse( 'default_content', true); + return $template->parse( 'default_content', true); } // +-----------------------------------------------------------------------+ @@ -482,13 +478,9 @@ if ($metadata_showable) $page['body_id'] = 'thePicturePage'; -// maybe someone wants a special display (call it before page_header so that -// they can add stylesheets) -$element_content = trigger_event( - 'render_element_content', - '', - $picture['current'] - ); +// allow plugins to change what we computed before passing data to template +$picture = trigger_event('picture_pictures_data', $picture); + if (isset($picture['next']['image_url']) and isset($picture['next']['is_picture'])) @@ -530,7 +522,6 @@ $template->assign_vars( 'PICTURE_TITLE' => $picture['current']['name'], 'PHOTO' => $title_nb, 'TITLE' => $picture['current']['name'], - 'ELEMENT_CONTENT' => $element_content, 'LEVEL_SEPARATOR' => $conf['level_separator'], @@ -801,6 +792,15 @@ if (isset($_GET['slideshow'])) ); } +// maybe someone wants a special display (call it before page_header so that +// they can add stylesheets) +$element_content = trigger_event( + 'render_element_content', + '', + $picture['current'] + ); +$template->assign_var( 'ELEMENT_CONTENT', $element_content ); + // +-----------------------------------------------------------------------+ // | sub pages | // +-----------------------------------------------------------------------+ |