From 8f175fb48e3e748fae0003214a1eabbb296c19e5 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 24 Jun 2008 10:17:19 +0000 Subject: Widgets now reload properly git-svn-id: https://code.elgg.org/elgg/trunk@1089 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/widgets/editwrapper.php | 5 ++++- views/default/widgets/wrapper.php | 27 +++++++++++++++++++++++++-- 2 files changed, 29 insertions(+), 3 deletions(-) (limited to 'views/default') diff --git a/views/default/widgets/editwrapper.php b/views/default/widgets/editwrapper.php index a01f18310..bc7d497d9 100644 --- a/views/default/widgets/editwrapper.php +++ b/views/default/widgets/editwrapper.php @@ -47,10 +47,13 @@ $(document).ready(function() { $("#submit").attr("disabled","disabled"); $("#submit").attr("value",""); + $("#widgetcontent").html(' true)); ?>'); var variables = $("#widgetform").serialize(); $.post($("#widgetform").attr("action"),variables,function() { - $("#widget").load("pg/view/?shell=no&username=username; ?>&context="); + $("#submit").attr("disabled",""); + $("#submit").attr("value",""); + $("#widgetcontent").load("pg/view/?shell=no&username=username; ?>&context=&callback=true"); }); return false; diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php index dfb8b2279..6e3e26e5d 100644 --- a/views/default/widgets/wrapper.php +++ b/views/default/widgets/wrapper.php @@ -12,6 +12,9 @@ */ static $widgettypes; + + $callback = get_input('callback'); + if (!isset($widgettypes)) $widgettypes = get_widget_types(); if ($vars['entity'] instanceof ElggObject && $vars['entity']->getSubtype() == 'widget') { @@ -22,6 +25,8 @@ $title = elgg_echo("error"); } + if ($callback != "true") { + ?>
@@ -51,7 +56,25 @@ ?>
- + getGUID()}\">"; + + echo elgg_view("widgets/{$handler}/view",$vars); + + echo "
"; + + if ($callback != "true") { + + ?>
- \ No newline at end of file + + + \ No newline at end of file -- cgit v1.2.3