aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets
diff options
context:
space:
mode:
authorben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-23 17:23:30 +0000
committerben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-06-23 17:23:30 +0000
commit982389815df230607100c9ee2ec1c40583026e4b (patch)
treee485b12d4412d6430bf03d06f5b4dd3146e5f379 /views/default/widgets
parent2dad5867569b3b30920220c8ed1edd912b55811c (diff)
downloadelgg-982389815df230607100c9ee2ec1c40583026e4b.tar.gz
elgg-982389815df230607100c9ee2ec1c40583026e4b.tar.bz2
Widgets now save on a per-widget basis. TODO: get the collapsing widgets to work once they've saved ..
git-svn-id: https://code.elgg.org/elgg/trunk@1073 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/widgets')
-rw-r--r--views/default/widgets/editwrapper.php20
-rw-r--r--views/default/widgets/wrapper.php4
2 files changed, 21 insertions, 3 deletions
diff --git a/views/default/widgets/editwrapper.php b/views/default/widgets/editwrapper.php
index 2914068fe..ad8c90b2a 100644
--- a/views/default/widgets/editwrapper.php
+++ b/views/default/widgets/editwrapper.php
@@ -13,7 +13,7 @@
?>
-<form action="<?php echo $vars['url']; ?>action/widgets/save" method="post">
+<form id="widgetform<?php echo $vars['entity']->getGUID(); ?>" action="<?php echo $vars['url']; ?>action/widgets/save" method="post">
<?php
@@ -36,4 +36,20 @@
?>" />
</p>
-</form> \ No newline at end of file
+</form>
+
+<script type="text/javascript">
+$(document).ready(function() {
+
+ $("#widgetform<?php echo $vars['entity']->getGUID(); ?>").submit(function () {
+
+ var variables = $("#widgetform<?php echo $vars['entity']->getGUID(); ?>").serialize();
+ $.post($("#widgetform<?php echo $vars['entity']->getGUID(); ?>").attr("action"),variables,function() {
+ $("#widget<?php echo $vars['entity']->getGUID(); ?>").load("<?php echo $vars['url']; ?>pg/view/<?php echo $vars['entity']->getGUID(); ?>?shell=no&username=<?php echo page_owner_entity()->username; ?>&context=<?php echo get_context(); ?>");
+ });
+ return false;
+
+ });
+
+});
+</script> \ No newline at end of file
diff --git a/views/default/widgets/wrapper.php b/views/default/widgets/wrapper.php
index 1c1d6a0dc..dfb8b2279 100644
--- a/views/default/widgets/wrapper.php
+++ b/views/default/widgets/wrapper.php
@@ -24,6 +24,7 @@
?>
+ <div id="widget<?php echo $vars['entity']->getGUID(); ?>">
<div class="collapsable_box">
<div class="collapsable_box_header">
<a href="javascript:void(0);" class="toggle_box_contents">-</a><?php if ($vars['entity']->canEdit()) { ?><a href="javascript:void(0);" class="toggle_box_edit_panel"><?php echo elgg_echo('edit'); ?></a><?php } ?>
@@ -52,4 +53,5 @@
<div class="collapsable_box_content">
<?php echo elgg_view("widgets/{$handler}/view",$vars); ?>
</div><!-- /.collapsable_box_content -->
- </div><!-- /.collapsable_box --> \ No newline at end of file
+ </div><!-- /.collapsable_box -->
+ </div> \ No newline at end of file