Changeset 8263
- Timestamp:
- Dec 23, 2010, 9:46:16 PM (13 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r7495 r8263 736 736 function get_thumbnail_url($element_info) 737 737 { 738 $path = get_thumbnail_location($element_info); 739 if ( !url_is_remote($path) ) 740 { 741 $path = embellish_url(get_root_url().$path); 742 } 743 738 $loc = $url = get_thumbnail_location($element_info); 739 if ( !url_is_remote($loc) ) 740 { 741 $url = (get_root_url().$loc); 742 } 744 743 // plugins want another url ? 745 $ path = trigger_event('get_thumbnail_url', $path, $element_info);746 return $path;744 $url = trigger_event('get_thumbnail_url', $url, $element_info, $loc); 745 return embellish_url($url); 747 746 } 748 747 … … 767 766 $path = get_themeconf('mime_icon_dir') 768 767 .strtolower(get_extension($element_info['path'])).'.png'; 769 } 770 771 // plugins want another location ? 772 $path = trigger_event( 'get_thumbnail_location', $path, $element_info); 768 // plugins want another location ? 769 $path = trigger_event( 'get_thumbnail_location', $path, $element_info); 770 } 773 771 return $path; 774 772 } -
trunk/include/functions_plugins.inc.php
r6363 r8263 120 120 return $data; 121 121 } 122 $args = array_slice(func_get_args(), 2);122 $args = func_get_args(); 123 123 124 124 foreach ($pwg_event_handlers[$event] as $priority => $handlers) … … 126 126 foreach($handlers as $handler) 127 127 { 128 $all_args = array_merge( array($data), $args);129 128 $function_name = $handler['function']; 130 129 $accepted_args = $handler['accepted_args']; 131 132 if ( $accepted_args == 1 ) 133 $the_args = array($data); 134 elseif ( $accepted_args > 1 ) 135 $the_args = array_slice($all_args, 0, $accepted_args); 136 elseif ( $accepted_args == 0 ) 137 $the_args = NULL; 138 else 139 $the_args = $all_args; 140 141 $data = call_user_func_array($function_name, $the_args); 130 $args[1] = $data; 131 $data = call_user_func_array($function_name, array_slice($args,1,$accepted_args) ); 142 132 } 143 133 } … … 160 150 return; 161 151 } 162 $args = array_slice(func_get_args(), 2);152 $args = func_get_args(); 163 153 164 154 foreach ($pwg_event_handlers[$event] as $priority => $handlers) … … 166 156 foreach($handlers as $handler) 167 157 { 168 $all_args = array_merge( array($data), $args);169 158 $function_name = $handler['function']; 170 159 $accepted_args = $handler['accepted_args']; 171 160 172 if ( $accepted_args == 1 ) 173 $the_args = array($data); 174 elseif ( $accepted_args > 1 ) 175 $the_args = array_slice($all_args, 0, $accepted_args); 176 elseif ( $accepted_args == 0 ) 177 $the_args = NULL; 178 else 179 $the_args = $all_args; 180 181 call_user_func_array($function_name, $the_args); 161 call_user_func_array($function_name, array_slice($args,1,$accepted_args) ); 182 162 } 183 163 }
Note: See TracChangeset
for help on using the changeset viewer.