aboutsummaryrefslogtreecommitdiff
path: root/views/default
diff options
context:
space:
mode:
Diffstat (limited to 'views/default')
-rw-r--r--views/default/account/forms/useradd.php2
-rw-r--r--views/default/friends/collection.php8
-rw-r--r--views/default/friends/collectiontabs.php4
-rw-r--r--views/default/input/autocomplete.php2
-rw-r--r--views/default/page_elements/title.php33
-rw-r--r--views/default/usersettings/plugins_opt/plugin.php2
-rw-r--r--views/default/usersettings/statistics_opt/numentities.php2
-rw-r--r--views/default/usersettings/statistics_opt/online.php6
8 files changed, 20 insertions, 39 deletions
diff --git a/views/default/account/forms/useradd.php b/views/default/account/forms/useradd.php
index 11323ab14..7794e3b93 100644
--- a/views/default/account/forms/useradd.php
+++ b/views/default/account/forms/useradd.php
@@ -9,7 +9,7 @@
*/
$admin_option = false;
-if (($_SESSION['user']->isAdmin()) && ($vars['show_admin'])) {
+if ((get_loggedin_user()->isAdmin()) && ($vars['show_admin'])) {
$admin_option = true;
}
diff --git a/views/default/friends/collection.php b/views/default/friends/collection.php
index deadb2f6a..ddd0a0ed0 100644
--- a/views/default/friends/collection.php
+++ b/views/default/friends/collection.php
@@ -24,7 +24,7 @@ if (is_array($vars['collection']->members)) {
echo "<li><h2>";
//as collections are private, check that the logged in user is the owner
-if($coll->owner_guid == $_SESSION['user']->getGUID()) {
+if ($coll->owner_guid == get_loggedin_userid()) {
echo "<div class=\"friends_collections_controls\">";
echo elgg_view('output/confirmlink', array(
'href' => $vars['url'] . 'action/friends/deletecollection?collection=' . $coll->id,
@@ -36,8 +36,8 @@ echo $coll->name;
echo " (<span id=\"friends_membership_count{$vars['friendspicker']}\">{$count}</span>) </h2>";
// individual collection panels
-if($friends = $vars['collection']->entities) {
- $content = elgg_view('friends/collectiontabs', array('owner' => $_SESSION['user'], 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker']));
+if ($friends = $vars['collection']->entities) {
+ $content = elgg_view('friends/collectiontabs', array('owner' => get_loggedin_user(), 'collection' => $vars['collection'], 'friendspicker' => $vars['friendspicker']));
echo elgg_view('friends/picker',array('entities' => $friends, 'value' => $members, 'content' => $content, 'replacement' => '', 'friendspicker' => $vars['friendspicker']));
?>
@@ -45,7 +45,7 @@ if($friends = $vars['collection']->entities) {
<script type="text/javascript">
$(document).ready(function () {
- $('#friends_picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
+ $('#friends_picker_placeholder<?php echo $vars['friendspicker']; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=list&collection=<?php echo $vars['collection']->id; ?>');
});
</script>
diff --git a/views/default/friends/collectiontabs.php b/views/default/friends/collectiontabs.php
index 453cbb112..9a6577671 100644
--- a/views/default/friends/collectiontabs.php
+++ b/views/default/friends/collectiontabs.php
@@ -32,7 +32,7 @@ $(document).ready(function () {
$('a.collectionmembers<?php echo $friendspicker; ?>').click(function () {
// load collection members pane
- $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+ $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=list&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
// remove selected state from previous tab
$(this).parent().parent().find("li.selected").removeClass("selected");
@@ -44,7 +44,7 @@ $(document).ready(function () {
$('a.editmembers<?php echo $friendspicker; ?>').click(function () {
// load friends picker pane
- $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo $_SESSION['user']->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
+ $('#friends_picker_placeholder<?php echo $friendspicker; ?>').load('<?php echo $vars['url']; ?>friends/pickercallback.php?username=<?php echo get_loggedin_user()->username; ?>&type=picker&collection=<?php echo $collectionid; ?>&friendspicker=<?php echo $friendspicker; ?>');
// remove selected state from previous tab
$(this).parent().parent().find("li.selected").removeClass("selected");
diff --git a/views/default/input/autocomplete.php b/views/default/input/autocomplete.php
index 7dc088d0e..b6044e55f 100644
--- a/views/default/input/autocomplete.php
+++ b/views/default/input/autocomplete.php
@@ -7,7 +7,7 @@
* @author Curverider Ltd
* @link http://elgg.org/
*
- * @TODO: This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page.
+ * @todo This currently only works for ONE AUTOCOMPLETE TEXT FIELD on a page.
*
* @uses $vars['value'] The current value, if any
* @uses $vars['js'] Any Javascript to enter into the input tag
diff --git a/views/default/page_elements/title.php b/views/default/page_elements/title.php
index c89371013..a340e7a09 100644
--- a/views/default/page_elements/title.php
+++ b/views/default/page_elements/title.php
@@ -5,37 +5,18 @@
*/
$page_owner = page_owner();
-$page_owner_user = get_entity($page_owner);
+$page_owner_entity = get_entity($page_owner);
-$submenu = get_submenu(); // elgg_view('canvas_header/submenu');
+$display = "<h2>" . $vars['title'] . "</h2>";
+
+$submenu = get_submenu();
if (!empty($submenu)) {
$submenu = "<ul class='submenu extended'>" . $submenu . "</ul>";
}
-if (($_SESSION['guid']) && ($page_owner && $page_owner_user->guid != $_SESSION['user']->getGUID())) {
- $info = "<h2>" . $vars['title'] . "</h2>";
- if($page_owner_user instanceOf ElggGroup) {
- $display = $info;
- } else {
- $display = $info;
- }
- if (!empty($submenu) && $vars['submenu'] == true) {
- // plugins can extend this to add menu options
- $display .= $submenu;
- }
-} else {
- $info = "<h2>" . $vars['title'] . "</h2>";
- if($page_owner_user instanceOf ElggGroup) {
- $display = $info;
- } else {
- $display = $info;
- }
- if (!empty($submenu) && $vars['submenu'] == true) {
- // plugins can extend this to add menu options
- $display .= $submenu;
- }
+if (!empty($submenu) && $vars['submenu'] == true) {
+ // plugins can extend this to add menu options
+ $display .= $submenu;
}
-
-//print to screen
echo $display; \ No newline at end of file
diff --git a/views/default/usersettings/plugins_opt/plugin.php b/views/default/usersettings/plugins_opt/plugin.php
index d32e44283..79286ec90 100644
--- a/views/default/usersettings/plugins_opt/plugin.php
+++ b/views/default/usersettings/plugins_opt/plugin.php
@@ -20,7 +20,7 @@ $manifest = $details['manifest'];
$user_guid = $details['user_guid'];
if ($user_guid) {
- $user_guid = $_SESSION['user']->guid;
+ $user_guid = get_loggedin_userid();
}
if (elgg_view("usersettings/{$plugin}/edit")) {
diff --git a/views/default/usersettings/statistics_opt/numentities.php b/views/default/usersettings/statistics_opt/numentities.php
index 1c4b127ec..ee38bdfee 100644
--- a/views/default/usersettings/statistics_opt/numentities.php
+++ b/views/default/usersettings/statistics_opt/numentities.php
@@ -9,7 +9,7 @@
*/
// Get entity statistics
-$entity_stats = get_entity_statistics($_SESSION['user']->guid);
+$entity_stats = get_entity_statistics(get_loggedin_userid());
if ($entity_stats) {
?>
diff --git a/views/default/usersettings/statistics_opt/online.php b/views/default/usersettings/statistics_opt/online.php
index 817b18cde..e176aaf9f 100644
--- a/views/default/usersettings/statistics_opt/online.php
+++ b/views/default/usersettings/statistics_opt/online.php
@@ -8,13 +8,13 @@
* @link http://elgg.org/
*/
-$user = $_SESSION['user'];
+$user = get_loggedin_user();
$logged_in = 0;
-$log = get_system_log($_SESSION['user']->guid, "login", "", 'user', '', 1);
+$log = get_system_log($user->guid, "login", "", 'user', '', 1);
if ($log) {
- $logged_in=$log[0]->time_created;
+ $logged_in = $log[0]->time_created;
}
?>