aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-24 10:17:19 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-24 10:17:19 +0000
commit8f175fb48e3e748fae0003214a1eabbb296c19e5 (patch)
treeb0ca796f425c4502c954440f776b962c8347c2ed /views
parentb9a2ed42e6a85a14113a5509accdb16ae9d8d180 (diff)
downloadelgg-8f175fb48e3e748fae0003214a1eabbb296c19e5.tar.gz
elgg-8f175fb48e3e748fae0003214a1eabbb296c19e5.tar.bz2
Widgets now reload properly
git-svn-id: https://code.elgg.org/elgg/trunk@1089 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views')
-rw-r--r--views/default/widgets/editwrapper.php5
-rw-r--r--views/default/widgets/wrapper.php27
2 files changed, 29 insertions, 3 deletions
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<?php echo $guid; ?>").attr("disabled","disabled");
$("#submit<?php echo $guid; ?>").attr("value","<?php echo elgg_echo("saving"); ?>");
+ $("#widgetcontent<?php echo $guid; ?>").html('<?php echo elgg_view('ajax/loader',array('slashes' => true)); ?>');
var variables = $("#widgetform<?php echo $guid; ?>").serialize();
$.post($("#widgetform<?php echo $guid; ?>").attr("action"),variables,function() {
- $("#widget<?php echo $guid; ?>").load("<?php echo $vars['url']; ?>pg/view/<?php echo $guid; ?>?shell=no&username=<?php echo page_owner_entity()->username; ?>&context=<?php echo get_context(); ?>");
+ $("#submit<?php echo $guid; ?>").attr("disabled","");
+ $("#submit<?php echo $guid; ?>").attr("value","<?php echo elgg_echo("save"); ?>");
+ $("#widgetcontent<?php echo $guid; ?>").load("<?php echo $vars['url']; ?>pg/view/<?php echo $guid; ?>?shell=no&username=<?php echo page_owner_entity()->username; ?>&context=<?php echo get_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") {
+
?>
<div id="widget<?php echo $vars['entity']->getGUID(); ?>">
@@ -51,7 +56,25 @@
?>
<div class="collapsable_box_content">
- <?php echo elgg_view("widgets/{$handler}/view",$vars); ?>
+ <?php
+
+ } // end if callback != "true"
+
+ echo "<div id=\"widgetcontent{$vars['entity']->getGUID()}\">";
+
+ echo elgg_view("widgets/{$handler}/view",$vars);
+
+ echo "</div>";
+
+ if ($callback != "true") {
+
+ ?>
</div><!-- /.collapsable_box_content -->
</div><!-- /.collapsable_box -->
- </div> \ No newline at end of file
+ </div>
+
+<?php
+
+ }
+
+?> \ No newline at end of file