From fea009129f49f4f8d51654ceb569aae04387077b Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 19 Dec 2010 00:59:12 +0000 Subject: more profile clean up git-svn-id: http://code.elgg.org/elgg/trunk@7675 36083f99-b078-4883-b0ff-0f9b5a30f544 --- .../views/default/profile/content_wrapper.php | 13 ++ mod/profile/views/default/profile/metatags.php | 9 +- mod/profile/views/default/profile/ownerblock.php | 136 +++++++++++++++++++++ .../views/default/profile/profile_content.php | 13 -- .../default/profile/profile_contents/activity.php | 32 ----- .../profile/profile_contents/commentwall.php | 10 -- .../default/profile/profile_contents/details.php | 41 ------- .../default/profile/profile_contents/friends.php | 12 -- .../default/profile/profile_contents/groups.php | 11 -- .../default/profile/profile_contents/twitter.php | 17 --- .../views/default/profile/profile_navigation.php | 68 ----------- .../views/default/profile/profile_ownerblock.php | 136 --------------------- mod/profile/views/default/profile/sidebar.php | 2 +- .../views/default/profile/tab_navigation.php | 68 +++++++++++ .../views/default/profile/tabs/activity.php | 32 +++++ .../views/default/profile/tabs/commentwall.php | 13 ++ mod/profile/views/default/profile/tabs/details.php | 41 +++++++ mod/profile/views/default/profile/tabs/friends.php | 12 ++ mod/profile/views/default/profile/tabs/groups.php | 11 ++ mod/profile/views/default/profile/tabs/twitter.php | 17 +++ 20 files changed, 350 insertions(+), 344 deletions(-) create mode 100644 mod/profile/views/default/profile/content_wrapper.php create mode 100755 mod/profile/views/default/profile/ownerblock.php delete mode 100644 mod/profile/views/default/profile/profile_content.php delete mode 100755 mod/profile/views/default/profile/profile_contents/activity.php delete mode 100644 mod/profile/views/default/profile/profile_contents/commentwall.php delete mode 100755 mod/profile/views/default/profile/profile_contents/details.php delete mode 100755 mod/profile/views/default/profile/profile_contents/friends.php delete mode 100644 mod/profile/views/default/profile/profile_contents/groups.php delete mode 100755 mod/profile/views/default/profile/profile_contents/twitter.php delete mode 100755 mod/profile/views/default/profile/profile_navigation.php delete mode 100755 mod/profile/views/default/profile/profile_ownerblock.php create mode 100755 mod/profile/views/default/profile/tab_navigation.php create mode 100755 mod/profile/views/default/profile/tabs/activity.php create mode 100644 mod/profile/views/default/profile/tabs/commentwall.php create mode 100755 mod/profile/views/default/profile/tabs/details.php create mode 100755 mod/profile/views/default/profile/tabs/friends.php create mode 100644 mod/profile/views/default/profile/tabs/groups.php create mode 100755 mod/profile/views/default/profile/tabs/twitter.php (limited to 'mod/profile/views/default') diff --git a/mod/profile/views/default/profile/content_wrapper.php b/mod/profile/views/default/profile/content_wrapper.php new file mode 100644 index 000000000..4fb43e7c9 --- /dev/null +++ b/mod/profile/views/default/profile/content_wrapper.php @@ -0,0 +1,13 @@ + +
+ +
\ No newline at end of file diff --git a/mod/profile/views/default/profile/metatags.php b/mod/profile/views/default/profile/metatags.php index a90b12494..1197a2e0a 100644 --- a/mod/profile/views/default/profile/metatags.php +++ b/mod/profile/views/default/profile/metatags.php @@ -1,11 +1,14 @@ +if (elgg_get_page_owner()) { +?> - \ No newline at end of file +container_guid); + } else { + $user = get_entity($vars['entity']->guid); + } +} else { + $user = elgg_get_page_owner(); +} +if (!$user) { + // no user so we quit view + echo elgg_echo('viewfailure', array(__FILE__)); + return TRUE; +} + +$more_info = ''; + +$location = elgg_view("output/tags",array('value' => $user->location)); +$section = $vars['section']; +if ($section == 'details') { + $icon = elgg_view("profile/icon",array('entity' => $user, 'size' => 'large', 'override' => 'true')); + $icon_class = "large"; +} else { + $icon = elgg_view("profile/icon",array('entity' => $user, 'size' => 'small')); + $more_info = "
"; + $more_info .= "

{$user->name}

"; + $more_info .= "

{$user->briefdescription}

"; + $more_info .= "

{$location}

"; + $more_info .= "
"; +} +$profile_actions = ""; +if (isloggedin() && (get_loggedin_userid() == elgg_get_page_owner_guid())) { + $profile_actions = "
"; + $profile_actions .= "". elgg_echo('profile:edit') .""; + $profile_actions .= "". elgg_echo('avatar:edit') .""; + $profile_actions .= "
"; +} else { + $profile_actions = "
"; + if (isloggedin()) { + if (get_loggedin_userid() != $user->getGUID()) { + if ($user->isFriend()) { + $url = elgg_get_site_url()."action/friends/remove?friend={$user->getGUID()}"; + $url = elgg_add_action_tokens_to_url($url); + $profile_actions .= "" . elgg_echo('friend:remove') . ""; + } else { + $url = elgg_get_site_url()."action/friends/add?friend={$user->getGUID()}"; + $url = elgg_add_action_tokens_to_url($url); + $profile_actions .= "" . elgg_echo('friend:add') . ""; + } + } + } + if (is_plugin_enabled('messages') && isloggedin()) { + $profile_actions .= "guid}\" class='action-button'>". elgg_echo('messages:send') .""; + } + $profile_actions .= "
"; +} + +$username = $user->username; +$email = $user->email; +$phone = $user->phone; + + +//if admin display admin links +if (isadminloggedin()) { + $admin_links = elgg_view('profile/admin_menu'); +} else { + $admin_links = ''; +} + + +//check tools are enabled - hard-coded for phase1 +// @todo - provide a view to extend for profile pages ownerblock tool-links +if(is_plugin_enabled('blog')){ + $blog_link = "
  • Blog
  • "; +}else{ + $blog_link = ""; +} +if(is_plugin_enabled('bookmarks')){ + $bookmark_link = "
  • Bookmarks
  • "; +}else{ + $bookmark_link = ""; +} +if(is_plugin_enabled('document')){ + $docs_link = "
  • Documents
  • "; +}else{ + $docs_link = ""; +} +if(is_plugin_enabled('feeds')){ + $feeds_link = "
  • Feeds
  • "; +}else{ + $feeds_link = ""; +} +if(is_plugin_enabled('tidypics')){ + $tidypics_link = "
  • Photos
  • "; +}else{ + $tidypics_link = ""; +} +if(is_plugin_enabled('videolist')){ + $video_link = "
  • Videos
  • "; +}else{ + $video_link = ""; +} + +//contruct the display +$display = << +
    + {$icon} +
    + {$more_info} + {$profile_actions} + + + {$admin_links} + + +EOT; + +echo $display; diff --git a/mod/profile/views/default/profile/profile_content.php b/mod/profile/views/default/profile/profile_content.php deleted file mode 100644 index 4fb43e7c9..000000000 --- a/mod/profile/views/default/profile/profile_content.php +++ /dev/null @@ -1,13 +0,0 @@ - -
    - -
    \ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_contents/activity.php b/mod/profile/views/default/profile/profile_contents/activity.php deleted file mode 100755 index ccd2a3915..000000000 --- a/mod/profile/views/default/profile/profile_contents/activity.php +++ /dev/null @@ -1,32 +0,0 @@ - $vars['entity'])); -} - -if (is_plugin_enabled('conversations')) { - // users last status msg, if they posted one - echo elgg_view("profile/status", array("entity" => $vars['entity'])); -} - -if (is_plugin_enabled('riverdashboard')) { - //select the correct river - if (get_plugin_setting('activitytype', 'riverdashboard') == 'classic') { - echo elgg_view_river_items($vars['entity']->getGuid(), 0, '', '', '', '', $limit,0,0,false,true); - } else { - echo elgg_view_river_items($vars['entity']->getGuid(), 0, '', '', '', '', $limit,0,0,false,false); - echo elgg_view('riverdashboard/js'); - } -} else { - // @todo this should not be here. - echo "Riverdashboard not loaded"; -} \ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_contents/commentwall.php b/mod/profile/views/default/profile/profile_contents/commentwall.php deleted file mode 100644 index 7e8a1d97d..000000000 --- a/mod/profile/views/default/profile/profile_contents/commentwall.php +++ /dev/null @@ -1,10 +0,0 @@ - $vars['comments'])); diff --git a/mod/profile/views/default/profile/profile_contents/details.php b/mod/profile/views/default/profile/profile_contents/details.php deleted file mode 100755 index 27b0f943b..000000000 --- a/mod/profile/views/default/profile/profile_contents/details.php +++ /dev/null @@ -1,41 +0,0 @@ -profile) && sizeof($vars['config']->profile) > 0) { - foreach($vars['config']->profile as $shortname => $valtype) { - if ($shortname != "description") { - $value = $vars['entity']->$shortname; - if (!empty($value)) { - //This function controls the alternating class - $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; - ?> -

    - : - $vars['entity']->$shortname)); - ?> -

    - isBanned()) { - echo "
    "; - echo elgg_echo('profile:banned'); - echo "
    "; - } else { - if ($vars['entity']->description) { - echo "

    " . elgg_echo("profile:aboutme") . "

    "; - echo "
    " . elgg_view('output/longtext', array('value' => $vars['entity']->description)) . "
    "; - } - } -} diff --git a/mod/profile/views/default/profile/profile_contents/friends.php b/mod/profile/views/default/profile/profile_contents/friends.php deleted file mode 100755 index 9195629e5..000000000 --- a/mod/profile/views/default/profile/profile_contents/friends.php +++ /dev/null @@ -1,12 +0,0 @@ -getGUID(), FALSE, 'user', '', 0, 10, FALSE); - -if(!$friends) { - $friends = '

    ' . elgg_echo('profile:no_friends') . '

    '; -} - -echo $friends; \ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_contents/groups.php b/mod/profile/views/default/profile/profile_contents/groups.php deleted file mode 100644 index 323bb61f1..000000000 --- a/mod/profile/views/default/profile/profile_contents/groups.php +++ /dev/null @@ -1,11 +0,0 @@ -getGUID(),false,'group','',0, $limit,false, false); - -if(!$groups) { - $groups = '

    ' . elgg_echo('profile:no_groups') . '

    '; -} - -echo $groups; \ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_contents/twitter.php b/mod/profile/views/default/profile/profile_contents/twitter.php deleted file mode 100755 index 06a0551d4..000000000 --- a/mod/profile/views/default/profile/profile_contents/twitter.php +++ /dev/null @@ -1,17 +0,0 @@ -twitter; - -// if the twitter username is empty, then do not show -if($twitter_username){ -?> - -

    - - - -getURL()}/"; - -//select section -switch($section){ - case 'friends': - $friends = 'class="selected"'; - break; - - case 'details': - $details = 'class="selected"'; - break; - case 'groups': - $groups = 'class="selected"'; - break; - case 'twitter': - $twitter = 'class="selected"'; - break; - - case 'commentwall': - $commentwall = 'class="selected"'; - break; - case 'activity': - default: - $activity = 'class="selected"'; - break; -} -?> -
    -

    name; ?>

    -
      -
    • >
    • -
    • >
    • -
    • >
    • -
    • >
    • -
    • >
    • - twitter){ - ?> -
    • >Twitter
    • - $user)); - ?> -
    -
    \ No newline at end of file diff --git a/mod/profile/views/default/profile/profile_ownerblock.php b/mod/profile/views/default/profile/profile_ownerblock.php deleted file mode 100755 index 3fb5f509e..000000000 --- a/mod/profile/views/default/profile/profile_ownerblock.php +++ /dev/null @@ -1,136 +0,0 @@ -container_guid); - } else { - $user = get_entity($vars['entity']->guid); - } -} else { - $user = elgg_get_page_owner(); -} -if (!$user) { - // no user so we quit view - echo elgg_echo('viewfailure', array(__FILE__)); - return TRUE; -} - -$more_info = ''; - -$location = elgg_view("output/tags",array('value' => $user->location)); -$section = $vars['section']; -if ($section == 'details') { - $icon = elgg_view("profile/icon",array('entity' => $user, 'size' => 'large', 'override' => 'true')); - $icon_class = "large"; -} else { - $icon = elgg_view("profile/icon",array('entity' => $user, 'size' => 'small')); - $more_info = "
    "; - $more_info .= "

    {$user->name}

    "; - $more_info .= "

    {$user->briefdescription}

    "; - $more_info .= "

    {$location}

    "; - $more_info .= "
    "; -} -$profile_actions = ""; -if (isloggedin() && (get_loggedin_userid() == elgg_get_page_owner_guid())) { - $profile_actions = "
    "; - $profile_actions .= "". elgg_echo('profile:edit') .""; - $profile_actions .= "". elgg_echo('avatar:edit') .""; - $profile_actions .= "
    "; -} else { - $profile_actions = "
    "; - if (isloggedin()) { - if (get_loggedin_userid() != $user->getGUID()) { - if ($user->isFriend()) { - $url = elgg_get_site_url()."action/friends/remove?friend={$user->getGUID()}"; - $url = elgg_add_action_tokens_to_url($url); - $profile_actions .= "" . elgg_echo('friend:remove') . ""; - } else { - $url = elgg_get_site_url()."action/friends/add?friend={$user->getGUID()}"; - $url = elgg_add_action_tokens_to_url($url); - $profile_actions .= "" . elgg_echo('friend:add') . ""; - } - } - } - if (is_plugin_enabled('messages') && isloggedin()) { - $profile_actions .= "guid}\" class='action-button'>". elgg_echo('messages:send') .""; - } - $profile_actions .= "
    "; -} - -$username = $user->username; -$email = $user->email; -$phone = $user->phone; - - -//if admin display admin links -if (isadminloggedin()) { - $admin_links = elgg_view('profile/admin_menu'); -} else { - $admin_links = ''; -} - - -//check tools are enabled - hard-coded for phase1 -// @todo - provide a view to extend for profile pages ownerblock tool-links -if(is_plugin_enabled('blog')){ - $blog_link = "
  • Blog
  • "; -}else{ - $blog_link = ""; -} -if(is_plugin_enabled('bookmarks')){ - $bookmark_link = "
  • Bookmarks
  • "; -}else{ - $bookmark_link = ""; -} -if(is_plugin_enabled('document')){ - $docs_link = "
  • Documents
  • "; -}else{ - $docs_link = ""; -} -if(is_plugin_enabled('feeds')){ - $feeds_link = "
  • Feeds
  • "; -}else{ - $feeds_link = ""; -} -if(is_plugin_enabled('tidypics')){ - $tidypics_link = "
  • Photos
  • "; -}else{ - $tidypics_link = ""; -} -if(is_plugin_enabled('videolist')){ - $video_link = "
  • Videos
  • "; -}else{ - $video_link = ""; -} - -//contruct the display -$display = << -
    - {$icon} -
    - {$more_info} - {$profile_actions} - - - {$admin_links} - - -EOT; - -echo $display; diff --git a/mod/profile/views/default/profile/sidebar.php b/mod/profile/views/default/profile/sidebar.php index 96b4a1955..525a2da81 100644 --- a/mod/profile/views/default/profile/sidebar.php +++ b/mod/profile/views/default/profile/sidebar.php @@ -8,6 +8,6 @@
    $section)); + echo elgg_view('profile/ownerblock', array('section' => $section)); ?>
    \ No newline at end of file diff --git a/mod/profile/views/default/profile/tab_navigation.php b/mod/profile/views/default/profile/tab_navigation.php new file mode 100755 index 000000000..ca0873ebd --- /dev/null +++ b/mod/profile/views/default/profile/tab_navigation.php @@ -0,0 +1,68 @@ +getURL()}/"; + +//select section +switch($section){ + case 'friends': + $friends = 'class="selected"'; + break; + + case 'details': + $details = 'class="selected"'; + break; + case 'groups': + $groups = 'class="selected"'; + break; + case 'twitter': + $twitter = 'class="selected"'; + break; + + case 'commentwall': + $commentwall = 'class="selected"'; + break; + case 'activity': + default: + $activity = 'class="selected"'; + break; +} +?> +
    +

    name; ?>

    +
      +
    • >
    • +
    • >
    • +
    • >
    • +
    • >
    • +
    • >
    • + twitter){ + ?> +
    • >Twitter
    • + $user)); + ?> +
    +
    \ No newline at end of file diff --git a/mod/profile/views/default/profile/tabs/activity.php b/mod/profile/views/default/profile/tabs/activity.php new file mode 100755 index 000000000..ccd2a3915 --- /dev/null +++ b/mod/profile/views/default/profile/tabs/activity.php @@ -0,0 +1,32 @@ + $vars['entity'])); +} + +if (is_plugin_enabled('conversations')) { + // users last status msg, if they posted one + echo elgg_view("profile/status", array("entity" => $vars['entity'])); +} + +if (is_plugin_enabled('riverdashboard')) { + //select the correct river + if (get_plugin_setting('activitytype', 'riverdashboard') == 'classic') { + echo elgg_view_river_items($vars['entity']->getGuid(), 0, '', '', '', '', $limit,0,0,false,true); + } else { + echo elgg_view_river_items($vars['entity']->getGuid(), 0, '', '', '', '', $limit,0,0,false,false); + echo elgg_view('riverdashboard/js'); + } +} else { + // @todo this should not be here. + echo "Riverdashboard not loaded"; +} \ No newline at end of file diff --git a/mod/profile/views/default/profile/tabs/commentwall.php b/mod/profile/views/default/profile/tabs/commentwall.php new file mode 100644 index 000000000..bf54bd7e7 --- /dev/null +++ b/mod/profile/views/default/profile/tabs/commentwall.php @@ -0,0 +1,13 @@ +getAnnotations('commentwall', 200, 0, 'desc'); + +if (isloggedin()) { + echo elgg_view("profile/commentwall/commentwalladd"); +} + +echo elgg_view("profile/commentwall/commentwall", array('annotation' => $comments)); diff --git a/mod/profile/views/default/profile/tabs/details.php b/mod/profile/views/default/profile/tabs/details.php new file mode 100755 index 000000000..27b0f943b --- /dev/null +++ b/mod/profile/views/default/profile/tabs/details.php @@ -0,0 +1,41 @@ +profile) && sizeof($vars['config']->profile) > 0) { + foreach($vars['config']->profile as $shortname => $valtype) { + if ($shortname != "description") { + $value = $vars['entity']->$shortname; + if (!empty($value)) { + //This function controls the alternating class + $even_odd = ( 'odd' != $even_odd ) ? 'odd' : 'even'; + ?> +

    + : + $vars['entity']->$shortname)); + ?> +

    + isBanned()) { + echo "
    "; + echo elgg_echo('profile:banned'); + echo "
    "; + } else { + if ($vars['entity']->description) { + echo "

    " . elgg_echo("profile:aboutme") . "

    "; + echo "
    " . elgg_view('output/longtext', array('value' => $vars['entity']->description)) . "
    "; + } + } +} diff --git a/mod/profile/views/default/profile/tabs/friends.php b/mod/profile/views/default/profile/tabs/friends.php new file mode 100755 index 000000000..9195629e5 --- /dev/null +++ b/mod/profile/views/default/profile/tabs/friends.php @@ -0,0 +1,12 @@ +getGUID(), FALSE, 'user', '', 0, 10, FALSE); + +if(!$friends) { + $friends = '

    ' . elgg_echo('profile:no_friends') . '

    '; +} + +echo $friends; \ No newline at end of file diff --git a/mod/profile/views/default/profile/tabs/groups.php b/mod/profile/views/default/profile/tabs/groups.php new file mode 100644 index 000000000..323bb61f1 --- /dev/null +++ b/mod/profile/views/default/profile/tabs/groups.php @@ -0,0 +1,11 @@ +getGUID(),false,'group','',0, $limit,false, false); + +if(!$groups) { + $groups = '

    ' . elgg_echo('profile:no_groups') . '

    '; +} + +echo $groups; \ No newline at end of file diff --git a/mod/profile/views/default/profile/tabs/twitter.php b/mod/profile/views/default/profile/tabs/twitter.php new file mode 100755 index 000000000..06a0551d4 --- /dev/null +++ b/mod/profile/views/default/profile/tabs/twitter.php @@ -0,0 +1,17 @@ +twitter; + +// if the twitter username is empty, then do not show +if($twitter_username){ +?> +
      +

      + + + +