diff --git a/docs/NEWS b/docs/NEWS index ae9ffb79..8e592776 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -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. diff --git a/include/functions_smarty.inc.php b/include/functions_smarty.inc.php index a65f388b..8d1f87ff 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -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; } /**