aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2010-12-23 20:46:16 +0000
committerrvelices <rv-github@modusoptimus.com>2010-12-23 20:46:16 +0000
commit7d7544476103fe66b65ba544452280c2bf6de0e7 (patch)
tree301a370bc15cb99a0d9e4606bc64d159e20efee9 /include/functions.inc.php
parent70b02e28f1252885e8e2c1821d175683a1f8094a (diff)
- faster trigger_event/trigger_action (it was overly complicated)
- added a new param to get_thumbnail_url event - get_thumbnail_location is called only if the thumbnail does not exist git-svn-id: http://piwigo.org/svn/trunk@8263 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r--include/functions.inc.php16
1 files changed, 7 insertions, 9 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 61db92ab5..460c32cdf 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -735,15 +735,14 @@ function get_thumbnail_path($element_info)
*/
function get_thumbnail_url($element_info)
{
- $path = get_thumbnail_location($element_info);
- if ( !url_is_remote($path) )
+ $loc = $url = get_thumbnail_location($element_info);
+ if ( !url_is_remote($loc) )
{
- $path = embellish_url(get_root_url().$path);
+ $url = (get_root_url().$loc);
}
-
// plugins want another url ?
- $path = trigger_event('get_thumbnail_url', $path, $element_info);
- return $path;
+ $url = trigger_event('get_thumbnail_url', $url, $element_info, $loc);
+ return embellish_url($url);
}
/* returns the relative path of the thumnail with regards to to the root
@@ -766,10 +765,9 @@ function get_thumbnail_location($element_info)
{
$path = get_themeconf('mime_icon_dir')
.strtolower(get_extension($element_info['path'])).'.png';
+ // plugins want another location ?
+ $path = trigger_event( 'get_thumbnail_location', $path, $element_info);
}
-
- // plugins want another location ?
- $path = trigger_event( 'get_thumbnail_location', $path, $element_info);
return $path;
}