diff options
-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(); |