diff options
-rw-r--r-- | entities/index.php | 12 | ||||
-rw-r--r-- | views/default/widgets/editwrapper.php | 20 | ||||
-rw-r--r-- | views/default/widgets/wrapper.php | 4 |
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 |