better forwarc ompatibility, using an arrayk

This commit is contained in:
Garvin Hicking 2011-01-02 16:50:48 +00:00
parent b448739802
commit 49bff3f7a7

View File

@ -22,8 +22,8 @@ if (!defined('S9Y_FRAMEWORK_FUNCTIONS')) {
* or during runtime, * or during runtime,
*/ */
$serendipity['capabilities']['jquery'] = true; $serendipity['capabilities']['jquery'] = true;
$serendipity['core_events']['frontend_header'] = 'serendipity_plugin_api_frontend_header'; $serendipity['core_events']['frontend_header']['jquery'] = 'serendipity_plugin_api_frontend_header';
$serendipity['core_events']['backend_header'] = 'serendipity_plugin_api_frontend_header'; $serendipity['core_events']['backend_header']['jquery'] = 'serendipity_plugin_api_frontend_header';
// Add jquery to all frontend and backend templates // Add jquery to all frontend and backend templates
function serendipity_plugin_api_frontend_header($event_name, &$bag, &$eventData, $addData) { function serendipity_plugin_api_frontend_header($event_name, &$bag, &$eventData, $addData) {
@ -1042,9 +1042,10 @@ class serendipity_plugin_api
$plugins = serendipity_plugin_api::get_event_plugins(); $plugins = serendipity_plugin_api::get_event_plugins();
if ($serendipity['core_events'][$event_name]) { if ($serendipity['core_events'][$event_name]) {
$apifunc = $serendipity['core_events'][$event_name]; foreach($serendipity['core_events'][$event_name] as $apifunc_key => $apifunc) {
$apifunc($event_name, $bag, $eventData, $addData); $apifunc($event_name, $bag, $eventData, $addData);
} }
}
if (function_exists('serendipity_plugin_api_pre_event_hook')) { if (function_exists('serendipity_plugin_api_pre_event_hook')) {
$apifunc = 'serendipity_plugin_api_pre_event_hook'; $apifunc = 'serendipity_plugin_api_pre_event_hook';