diff options
author | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-01 16:55:17 +0000 |
---|---|---|
committer | ben <ben@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-08-01 16:55:17 +0000 |
commit | 18d930d4e2c7149e74df65b40a42a7d602b5dc54 (patch) | |
tree | caecedbf18f5e022e7abee3045e567210c96489f | |
parent | c5a46b76d68a6042b793549dcc0e3a9c5784d629 (diff) | |
download | elgg-18d930d4e2c7149e74df65b40a42a7d602b5dc54.tar.gz elgg-18d930d4e2c7149e74df65b40a42a7d602b5dc54.tar.bz2 |
Spotlight state persists.
git-svn-id: https://code.elgg.org/elgg/trunk@1658 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | actions/user/spotlight.php | 15 | ||||
-rw-r--r-- | engine/lib/users.php | 3 | ||||
-rw-r--r-- | views/default/page_elements/spotlight.php | 25 |
3 files changed, 40 insertions, 3 deletions
diff --git a/actions/user/spotlight.php b/actions/user/spotlight.php new file mode 100644 index 000000000..b43af2f16 --- /dev/null +++ b/actions/user/spotlight.php @@ -0,0 +1,15 @@ +<?php
+
+ gatekeeper();
+
+ $closed = get_input('closed','true');
+ if ($closed != 'true') {
+ $closed = false;
+ } else {
+ $closed = true;
+ }
+
+ $_SESSION['user']->spotlightclosed = $closed;
+ exit;
+
+?>
\ No newline at end of file diff --git a/engine/lib/users.php b/engine/lib/users.php index d17d8bfe4..9e3270aa7 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1138,7 +1138,8 @@ register_action("email/confirm");
register_action('friends/addcollection');
register_action('friends/deletecollection');
- register_action('friends/editcollection'); + register_action('friends/editcollection');
+ register_action("user/spotlight"); register_action("usersettings/save"); diff --git a/views/default/page_elements/spotlight.php b/views/default/page_elements/spotlight.php index ea508bee3..446d5902c 100644 --- a/views/default/page_elements/spotlight.php +++ b/views/default/page_elements/spotlight.php @@ -19,10 +19,31 @@ <div class="collapsable_box no_space_after"> <div class="collapsable_box_header"> - <a href="javascript:void(0);" class="toggle_box_contents">-</a> +<?php + + $closed = false; + if ($_SESSION['user'] instanceof ElggUser) { + if ($_SESSION['user']->spotlightclosed) { + + $closed = true; + + } + } + if ($closed) { +?> + <a href="javascript:void(0);" class="toggle_box_contents" onClick="$.post('<?php echo $vars['url']; ?>action/user/spotlight?closed=false')">+</a> +<?php + } else { +?> + <a href="javascript:void(0);" class="toggle_box_contents" onClick="$.post('<?php echo $vars['url']; ?>action/user/spotlight?closed=true')">-</a> +<?php + + } + +?> <h1><?php echo elgg_echo("spotlight"); ?></h1> </div> - <div class="collapsable_box_content"> + <div class="collapsable_box_content" <?php if ($closed) echo "style=\"display:none\"" ?>> <?php $context = get_context(); |