Add new parameter "empty" to {serendipity_showPlugin}

This commit is contained in:
Garvin Hicking 2010-12-31 18:00:43 +00:00
parent c3c3ee18db
commit f080241c61
2 changed files with 16 additions and 1 deletions

View File

@ -3,6 +3,15 @@
Version 1.6 ()
------------------------------------------------------------------------
* Added new parameter "empty" to {serendipity_showPlugin}. When
no callable plugins were found, the string in the "empty" parameter
will be shown instead, allowing users to get notified of a missing
plugin:
{serendipity_showPlugin
class="serendipity_plugin_twitter"
empty="Twitter plugin not found!"}
* Bundle jquery by default and enable it in frontend and backend
templates; overrides serendipity_event_jquery. If your template
contains its own "jquery.js" file, the core will NOT use it.

View File

@ -469,7 +469,13 @@ function serendipity_smarty_showPlugin($params, &$smarty) {
$params['template'] = 'sidebar.tpl';
}
return serendipity_plugin_api::generate_plugins($params['side'], null, $params['negate'], $params['class'], $params['id'], $params['template']);
$out = serendipity_plugin_api::generate_plugins($params['side'], null, $params['negate'], $params['class'], $params['id'], $params['template']);
if (empty($out) && !empty($params['empty'])) {
return $params['empty'];
}
return $out;
}
/**