From 9d810a6331a025c28052eadcbfe7e6e77b8a7334 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 19 Nov 2010 21:23:20 +0000 Subject: updating widget contents when settings are changed git-svn-id: http://code.elgg.org/elgg/trunk@7351 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/widgets/editwrapper.php | 12 +++++------- views/default/widgets/wrapper.php | 27 +++++++++++---------------- 2 files changed, 16 insertions(+), 23 deletions(-) (limited to 'views/default/widgets') diff --git a/views/default/widgets/editwrapper.php b/views/default/widgets/editwrapper.php index cf985445b..73166b718 100644 --- a/views/default/widgets/editwrapper.php +++ b/views/default/widgets/editwrapper.php @@ -11,15 +11,15 @@ $widget = $vars['widget']; $edit_view = "widgets/$widget->handler/edit"; $custom_form_section = elgg_view($edit_view, array('entity' => $widget)); +$access_text = elgg_echo('access'); $access = elgg_view('input/access', array('internalname' => 'params[access_id]','value' => $widget->access_id)); -$hidden = elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $widget->guid)) . -$hidden .= elgg_view('input/hidden', array('internalname' => 'noforward', 'value' => 'true')); -$submit = elgg_view('input/submit', array('internalname' => "submit$guid", 'value' => elgg_echo('save'))); +$hidden = elgg_view('input/hidden', array('internalname' => 'guid', 'value' => $widget->guid)); +$submit = elgg_view('input/submit', array('value' => elgg_echo('save'))); $body = <<<___END $custom_form_section

- $access + $access

$hidden @@ -32,10 +32,8 @@ ___END; $body, - 'action' => "action/widgets/save", - 'internalid' => "widgetform$guid" + 'action' => "action/widgets/save" ); echo elgg_view('input/form', $params); -// _guid; ?> diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php index 52ca87cab..a113d114e 100644 --- a/views/default/widgets/wrapper.php +++ b/views/default/widgets/wrapper.php @@ -6,24 +6,20 @@ * @subpackage Core */ -$widgettypes = get_widget_types(); - $widget = $vars['entity']; - -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"); +if (!elgg_instanceof($widget, 'object', 'widget')) { + return true; } -$title = "Widget Title"; +// @todo catch for disabled plugins +$widgettypes = get_widget_types(); + +$handler = $widget->handler; -$display_view = "widgets/$handler/view"; +$title = $widget->title; +if (!$title) { + $title = $widgettypes[$handler]->name; +} $can_edit = $widget->canEdit(); @@ -43,7 +39,6 @@ $can_edit = $widget->canEdit(); } ?>

- -

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

+
-- cgit v1.2.3