aboutsummaryrefslogtreecommitdiff
path: root/views/default/layout/elements
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-25 22:18:16 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-12-25 22:18:16 +0000
commita201a5bba863a6d0dfa3b68d73a227cfcc7f66b6 (patch)
treeaf382c4f81d43b63c4afe60ace1824c298390d47 /views/default/layout/elements
parent58bd19d7cf35e6159124716d0da48d91354d3a2f (diff)
downloadelgg-a201a5bba863a6d0dfa3b68d73a227cfcc7f66b6.tar.gz
elgg-a201a5bba863a6d0dfa3b68d73a227cfcc7f66b6.tar.bz2
updated owner blocks for users and groups
git-svn-id: http://code.elgg.org/elgg/trunk@7721 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/layout/elements')
-rw-r--r--views/default/layout/elements/owner_block.php79
-rw-r--r--views/default/layout/elements/sidebar.php21
2 files changed, 38 insertions, 62 deletions
diff --git a/views/default/layout/elements/owner_block.php b/views/default/layout/elements/owner_block.php
index 66fc180dd..862b0b5a6 100644
--- a/views/default/layout/elements/owner_block.php
+++ b/views/default/layout/elements/owner_block.php
@@ -8,70 +8,27 @@
*
*/
-$contents = "";
+elgg_push_context('owner_block');
-// Are there feeds to display?
-global $autofeed;
-if (isset($autofeed) && $autofeed == true) {
- $url = full_url();
- if (substr_count($url,'?')) {
- $url .= "&view=rss";
- } else {
- $url .= "?view=rss";
- }
- $url = elgg_format_url($url);
- $label = elgg_echo('feed:rss');
- $contents .= <<<END
- <div class="rss-link clearfix"><a href="{$url}" rel="nofollow" title="{$label}">{$label}</a></div>
-END;
-}
-
-if(is_plugin_enabled('profile')) {
- // Is there a page owner?
- $owner = elgg_get_page_owner();
- if ($owner instanceof ElggGroup ||
- ($owner instanceof ElggUser && $owner->getGUID() != get_loggedin_userid())
- ) {
- $icon = elgg_view('profile/icon', array('entity' => $owner, 'size' => 'tiny'));
- $owner_url = $owner->getURL();
- $display = "<div class='owner_block_icon'>$icon</div>";
- $display .= '<div class="owner_block_contents clearfix">';
- $display .= "<h3><a href=\"$owner_url\">{$owner->name}</a></h3>";
+// groups and other users get owner block
+$owner = elgg_get_page_owner();
+if ($owner instanceof ElggGroup ||
+ ($owner instanceof ElggUser && $owner->getGUID() != get_loggedin_userid())) {
- if ($owner->briefdescription) {
- $display .= "<p class=\"profile_info briefdescription\">{$owner->briefdescription}</p>";
- }
-
- $location = elgg_view('output/tags', array('value' => $owner->location));
- $display .= "<p class=\"profile_info location\">$location</p>";
-
- $display .= '</div>';
-
- // Trigger owner block menu
- $params = array('owner' => $owner);
- $links = elgg_trigger_plugin_hook('profile_menu', 'profile', $params, array());
- if (is_array($links) && !empty($links)) {
- // sort the links by name
- usort($links, create_function(
- '$a, $b',
- 'return strnatcasecmp($a[\'text\'], $b[\'text\']);'
- ));
-
- $display .= '<div class="owners_content_links"><ul>';
- foreach ($links as $link) {
- $display .= "<li><a href=\"{$link['href']}\">{$link['text']}</a></li>";
- }
- $display .= '</ul></div>';
- }
-
- // Allow plugins to extend the owner block contents
- $display .= elgg_view('owner_block/profile_extend');
+ $header = elgg_view_entity($owner, false);
- $contents .= "<div id='owner_block' class='clearfix'>$display</div>";
- }
-}
+ $body = elgg_view_menu('owner_block', array(
+ 'entity' => $owner,
+ 'class' => 'elgg-owner-block-menu',
+ ));
-$contents .= elgg_view('owner_block/extend');
+ $body .= elgg_view('layout/elements/owner_block/extend', $vars);
+ echo elgg_view('layout/objects/module', array(
+ 'header' => $header,
+ 'body' => $body,
+ 'class' => 'elgg-owner-block',
+ ));
+}
-echo $contents;
+elgg_pop_context(); \ No newline at end of file
diff --git a/views/default/layout/elements/sidebar.php b/views/default/layout/elements/sidebar.php
index 7605c4e70..c03700c8a 100644
--- a/views/default/layout/elements/sidebar.php
+++ b/views/default/layout/elements/sidebar.php
@@ -5,10 +5,29 @@
* @uses $vars['sidebar'] Optional content that is displayed at the bottom of sidebar
*/
+// Are there feeds to display?
+global $autofeed;
+if (isset($autofeed) && $autofeed == true) {
+ $url = full_url();
+ if (substr_count($url,'?')) {
+ $url .= "&view=rss";
+ } else {
+ $url .= "?view=rss";
+ }
+ $url = elgg_format_url($url);
+ $label = elgg_echo('feed:rss');
+ echo <<<END
+ <div class="rss-link clearfix"><a href="{$url}" rel="nofollow" title="{$label}">{$label}</a></div>
+END;
+}
+
echo elgg_view('layout/elements/owner_block');
echo elgg_view('navigation/sidebar_menu');
-echo elgg_view_menu('page', array('sort_by' => 'name'));
+echo elgg_view_menu('page', array(
+ 'sort_by' => 'name',
+ 'class' => 'elgg-page-menu',
+));
// optional 'sidebar' parameter
if (isset($vars['sidebar'])) {