aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'views/default')
-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