From a201a5bba863a6d0dfa3b68d73a227cfcc7f66b6 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 25 Dec 2010 22:18:16 +0000 Subject: updated owner blocks for users and groups git-svn-id: http://code.elgg.org/elgg/trunk@7721 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/css/elements/navigation.php | 11 +++- views/default/css/elements/skin.php | 3 + views/default/layout/elements/owner_block.php | 79 ++++++--------------------- views/default/layout/elements/sidebar.php | 21 ++++++- views/default/layout/objects/list/body.php | 7 ++- views/default/navigation/menu/default.php | 15 ++++- views/default/user/default.php | 47 +++++++++++++--- 7 files changed, 108 insertions(+), 75 deletions(-) (limited to 'views') diff --git a/views/default/css/elements/navigation.php b/views/default/css/elements/navigation.php index f9488c64d..e1a3c6866 100644 --- a/views/default/css/elements/navigation.php +++ b/views/default/css/elements/navigation.php @@ -210,7 +210,7 @@ /* *************************************** PAGE MENU *************************************** */ -.elgg-sidebar .elgg-menu a { +.elgg-page-menu a { display: block; -webkit-border-radius: 8px; -moz-border-radius: 8px; @@ -218,12 +218,12 @@ margin: 0 0 3px 0; padding: 2px 4px 2px 8px; } -.elgg-sidebar .elgg-menu a:hover { +.elgg-page-menu a:hover { background-color: #0054A7; color: white; text-decoration: none; } -.elgg-sidebar .elgg-menu .selected a { +.elgg-page-menu .selected a { background-color: #4690D6; color: white; } @@ -268,3 +268,8 @@ text-decoration:none; } +.elgg-owner-block-menu li { + float: left; + width: 50%; + font-size: 90%; +} \ No newline at end of file diff --git a/views/default/css/elements/skin.php b/views/default/css/elements/skin.php index 5d9af8e63..91a61dacb 100644 --- a/views/default/css/elements/skin.php +++ b/views/default/css/elements/skin.php @@ -89,6 +89,9 @@ a.selected { /***** PAGE BODY ******/ +.elgg-page-body > .elgg-inner { + min-height: 360px; +} .elgg-classic .elgg-page-body > .elgg-inner { width: 990px; margin: 0 auto; 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 .= <<{$label} -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 = "
$icon
"; - $display .= '
'; - $display .= "

{$owner->name}

"; +// 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 .= "

{$owner->briefdescription}

"; - } - - $location = elgg_view('output/tags', array('value' => $owner->location)); - $display .= "

$location

"; - - $display .= '
'; - - // 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 .= ''; - } - - // Allow plugins to extend the owner block contents - $display .= elgg_view('owner_block/profile_extend'); + $header = elgg_view_entity($owner, false); - $contents .= "
$display
"; - } -} + $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 <<{$label} +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'])) { diff --git a/views/default/layout/objects/list/body.php b/views/default/layout/objects/list/body.php index 8a59cd364..97331c1d1 100644 --- a/views/default/layout/objects/list/body.php +++ b/views/default/layout/objects/list/body.php @@ -21,8 +21,13 @@ $entity = $vars['entity']; $title_link = elgg_get_array_value('title', $vars, ''); if ($title_link === '') { + if (isset($entity->title)) { + $text = $entity->title; + } else { + $text = $entity->name; + } $params = array( - 'text' => $entity->title, + 'text' => $text, 'href' => $entity->getURL(), ); $title_link = elgg_view('output/url', $params); diff --git a/views/default/navigation/menu/default.php b/views/default/navigation/menu/default.php index a63a26771..d849fb80e 100644 --- a/views/default/navigation/menu/default.php +++ b/views/default/navigation/menu/default.php @@ -1,9 +1,20 @@ $menu_items) { - echo '
    '; + echo "
      "; foreach ($menu_items as $menu_item) { echo elgg_view('navigation/menu/elements/item', array('item' => $menu_item)); } echo '
    '; -} \ No newline at end of file +} diff --git a/views/default/user/default.php b/views/default/user/default.php index 744a54595..3e2b9f433 100644 --- a/views/default/user/default.php +++ b/views/default/user/default.php @@ -6,12 +6,45 @@ * @subpackage Core */ -if ($vars['full']) { - echo elgg_view("profile/userdetails",$vars); +$user = $vars['entity']; + +$icon = elgg_view('profile/icon', array('entity' => $user, 'size' => 'tiny')); + +// Simple XFN +$rel = ''; +if (get_loggedin_userid() == $user->guid) { + $rel = 'rel="me"'; +} elseif (check_entity_relationship(get_loggedin_userid(), 'friend', $user->guid)) { + $rel = 'rel="friend"'; +} + +$title = "getUrl() . "\" $rel>" . $user->name . ""; + + +$metadata = "
    • $user->location
    • "; +$metadata .= elgg_view("entity/metadata", array('entity' => $user)); +$metadata .= "
    "; + +if (elgg_in_context('owner_block') || elgg_in_context('widgets')) { + $metadata = ''; +} + +if ($user->isBanned()) { + $params = array( + 'entity' => $user, + 'title' => $title, + 'metadata' => '', + ); } else { - if (get_input('listtype') == "gallery") { - echo elgg_view('profile/gallery',$vars); - } else { - echo elgg_view("profile/listing",$vars); - } + $params = array( + 'entity' => $user, + 'title' => $title, + 'metadata' => $metadata, + 'subtitle' => $user->briefdescription, + 'content' => elgg_view('user/status', array('entity' => $user)), + ); } + +$list_body = elgg_view('layout/objects/list/body', $params); + +echo elgg_view_image_block($icon, $list_body); -- cgit v1.2.3