diff options
-rw-r--r-- | languages/en.php | 2 | ||||
-rw-r--r-- | views/default/widgets/wrapper.php | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/languages/en.php b/languages/en.php index 6465ec785..f27c7aacc 100644 --- a/languages/en.php +++ b/languages/en.php @@ -219,7 +219,7 @@ To remove a widget drag it back to the <b>Widget gallery</b>.", 'widgets:panel:save:failure' => "There was a problem saving your widgets. Please try again.",
'widgets:save:success' => "The widget was successfully saved.",
'widgets:save:failure' => "We could not save your widget. Please try again.",
-
+ 'widgets:handlernotfound' => 'This widget is either broken or has been disabled by the site administrator.',
/**
* Groups
diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php index 846cf9e7f..63c024cc4 100644 --- a/views/default/widgets/wrapper.php +++ b/views/default/widgets/wrapper.php @@ -20,6 +20,8 @@ if ($vars['entity'] instanceof ElggObject && $vars['entity']->getSubtype() == 'widget') {
$handler = $vars['entity']->handler;
$title = $widgettypes[$vars['entity']->handler]->name;
+ if (!$title)
+ $title = $handler;
} else {
$handler = "error";
$title = elgg_echo("error");
@@ -63,7 +65,10 @@ } else { // end if callback != "true"
- echo elgg_view("widgets/{$handler}/view",$vars);
+ if (elgg_view_exists("widgets/{$handler}/view"))
+ echo elgg_view("widgets/{$handler}/view",$vars);
+ else
+ echo elgg_echo('widgets:handlernotfound');
?>
|