From 60c1387a16ea4944674b0c9da2273158d1fbf0b4 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 22 Aug 2010 23:15:43 +0000 Subject: Merged r6757:6810 from 1.7 branch into trunk git-svn-id: http://code.elgg.org/elgg/trunk@6850 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/account/forms/useradd.php | 2 +- views/default/friends/collection.php | 8 +++--- views/default/friends/collectiontabs.php | 4 +-- views/default/input/autocomplete.php | 2 +- views/default/page_elements/title.php | 33 +++++----------------- views/default/usersettings/plugins_opt/plugin.php | 2 +- .../usersettings/statistics_opt/numentities.php | 2 +- .../default/usersettings/statistics_opt/online.php | 6 ++-- 8 files changed, 20 insertions(+), 39 deletions(-) (limited to 'views') 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 "
  • "; //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 "
    "; echo elgg_view('output/confirmlink', array( 'href' => $vars['url'] . 'action/friends/deletecollection?collection=' . $coll->id, @@ -36,8 +36,8 @@ echo $coll->name; echo " ({$count})

    "; // 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) { 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').click(function () { // load collection members pane - $('#friends_picker_placeholder').load('friends/pickercallback.php?username=username; ?>&type=list&collection=&friendspicker='); + $('#friends_picker_placeholder').load('friends/pickercallback.php?username=username; ?>&type=list&collection=&friendspicker='); // remove selected state from previous tab $(this).parent().parent().find("li.selected").removeClass("selected"); @@ -44,7 +44,7 @@ $(document).ready(function () { $('a.editmembers').click(function () { // load friends picker pane - $('#friends_picker_placeholder').load('friends/pickercallback.php?username=username; ?>&type=picker&collection=&friendspicker='); + $('#friends_picker_placeholder').load('friends/pickercallback.php?username=username; ?>&type=picker&collection=&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 = "

    " . $vars['title'] . "

    "; + +$submenu = get_submenu(); if (!empty($submenu)) { $submenu = ""; } -if (($_SESSION['guid']) && ($page_owner && $page_owner_user->guid != $_SESSION['user']->getGUID())) { - $info = "

    " . $vars['title'] . "

    "; - 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 = "

    " . $vars['title'] . "

    "; - 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; } ?> -- cgit v1.2.3