aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--entities/index.php12
-rw-r--r--views/default/widgets/editwrapper.php20
-rw-r--r--views/default/widgets/wrapper.php4
3 files changed, 32 insertions, 4 deletions
diff --git a/entities/index.php b/entities/index.php
index 6c2d4fd0d..cc523a0eb 100644
--- a/entities/index.php
+++ b/entities/index.php
@@ -17,6 +17,12 @@
// Get the GUID of the entity we want to view
$guid = (int) get_input('guid');
+ $shell = get_input('shell');
+ if ($shell == "no") {
+ $shell = false;
+ } else {
+ $shell = true;
+ }
// Get the entity, if possible
if ($entity = get_entity($guid)) {
@@ -32,6 +38,10 @@
}
// Display the page
- page_draw("", $body);
+ if ($shell) {
+ page_draw("", $body);
+ } else {
+ echo $body;
+ }
?> \ No newline at end of file
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