Changeset 1705 for trunk/include/functions_plugins.inc.php
- Timestamp:
- Jan 9, 2007, 12:38:54 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_plugins.inc.php
r1699 r1705 2 2 // +-----------------------------------------------------------------------+ 3 3 // | PhpWebGallery - a PHP based picture gallery | 4 // | Copyright (C) 2003-200 6PhpWebGallery Team - http://phpwebgallery.net |4 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 5 5 // +-----------------------------------------------------------------------+ 6 6 // | branch : BSF (Best So Far) … … 153 153 } 154 154 155 156 155 function trigger_action($event, $data=null) 157 156 { … … 196 195 } 197 196 197 /** Saves some data with the associated plugim id. It can be retrieved later ( 198 * during this script lifetime) using get_plugin_data 199 * @param string plugin_id 200 * @param mixed data 201 * returns true on success, false otherwise 202 */ 203 function set_plugin_data($plugin_id, &$data) 204 { 205 global $pwg_loaded_plugins; 206 if ( isset($pwg_loaded_plugins[$plugin_id]) ) 207 { 208 $pwg_loaded_plugins[$plugin_id]['plugin_data'] = &$data; 209 return true; 210 } 211 return false; 212 } 213 214 /** Retrieves plugin data saved previously with set_plugin_data 215 * @param string plugin_id 216 */ 217 function &get_plugin_data($plugin_id) 218 { 219 global $pwg_loaded_plugins; 220 if ( isset($pwg_loaded_plugins[$plugin_id]) ) 221 { 222 return $pwg_loaded_plugins[$plugin_id]['plugin_data']; 223 } 224 return null; 225 } 198 226 199 227 /* Returns an array of plugins defined in the database … … 236 264 if ( file_exists($file_name) ) 237 265 { 266 global $pwg_loaded_plugins; 267 $pwg_loaded_plugins[ $plugin['id'] ] = $plugin; 238 268 include_once( $file_name ); 239 269 } … … 243 273 function load_plugins() 244 274 { 245 global $conf; 275 global $conf, $pwg_loaded_plugins; 276 $pwg_loaded_plugins = array(); 246 277 if ($conf['enable_plugins']) 247 278 {
Note: See TracChangeset
for help on using the changeset viewer.