Skip to content

Commit

Permalink
Fixes #78: Gives attention to details in topbar changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewinslow committed Dec 4, 2011
1 parent f6d5437 commit ada3047
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 57 deletions.
81 changes: 45 additions & 36 deletions start.php
Expand Up @@ -95,9 +95,18 @@ function facebook_theme_pagesetup_handler() {
'contexts' => array('dashboard'),
));

if (elgg_is_active_plugin('messages')) {
elgg_register_menu_item('page', array(
'name' => 'messages',
'text' => elgg_view_icon('mail') . elgg_echo('messages'),
'href' => "/messages/inbox/$user->username",
'contexts' => array('dashboard'),
));
}

elgg_register_menu_item('page', array(
'name' => 'friends',
'text' => elgg_echo('friends'),
'text' => elgg_view_icon('users') . elgg_echo('friends'),
'href' => "/friends/$user->username",
'priority' => 500,
'contexts' => array('dashboard'),
Expand Down Expand Up @@ -153,7 +162,7 @@ function facebook_theme_pagesetup_handler() {
elgg_register_menu_item('page', array(
'section' => 'groups',
'name' => "group-$group->guid",
'text' => $group->name,
'text' => elgg_view_icon('users') . $group->name,
'href' => $group->getURL(),
'contexts' => array('dashboard'),
));
Expand Down Expand Up @@ -238,21 +247,12 @@ function facebook_theme_pagesetup_handler() {
));
}

if (elgg_is_active_plugin('messages')) {
elgg_register_menu_item('page', array(
'name' => 'messages',
'text' => elgg_echo('messages'),
'href' => "/messages/inbox/$user->username",
'contexts' => array('dashboard'),
));
}

$address = urlencode(current_page_url());

if (elgg_is_active_plugin('bookmarks')) {
elgg_register_menu_item('extras', array(
'name' => 'bookmark',
'text' => elgg_view_icon('push-pin-alt') . elgg_echo('bookmarks:this'),
'text' => elgg_view_icon('link') . elgg_echo('bookmarks:this'),
'href' => "bookmarks/add/$user->guid?address=$address",
'title' => elgg_echo('bookmarks:this'),
'rel' => 'nofollow',
Expand Down Expand Up @@ -282,67 +282,76 @@ function facebook_theme_pagesetup_handler() {
$site = elgg_get_site_entity();
elgg_unregister_menu_item('topbar', 'elgg_logo');
elgg_register_menu_item('topbar', array(
'name' => 'logo',
'href' => '/',
'text' => "<h1 id=\"facebook-topbar-logo\">$site->name</h1>",
'name' => 'logo',
'priority' => 1,
'text' => "<h1 id=\"facebook-topbar-logo\">$site->name</h1>",
));

elgg_register_menu_item('topbar', array(
'name' => 'account',
'section' => 'alt',
'text' => elgg_echo('account'),
'href' => "#",
'priority' => 1000,
));

elgg_register_menu_item('topbar', array(
'name' => 'home',
'href' => '/dashboard',
'text' => elgg_echo('home'),
'name' => 'home',
'priority' => 2,
'section' => 'alt',
'priority' => 1,
'text' => elgg_echo('home'),
));

if (elgg_is_active_plugin('profile')) {
elgg_unregister_menu_item('topbar', 'profile');
elgg_register_menu_item('topbar', array(
'name' => 'profile',
'section' => 'alt',
'text' => elgg_echo('profile'),
'text' => "<img src=\"{$user->getIcon('topbar')}\" class=\"elgg-icon elgg-inline-block\" alt=\"$user->name\"/>" . $user->name,
'href' => "/profile/$user->username",
'priority' => 2,
'priority' => 1,
));
}

elgg_register_menu_item('topbar', array(
'href' => "#",
'name' => 'account',
'priority' => 1000,
'section' => 'alt',
'text' => '',
));

elgg_unregister_menu_item('topbar', 'usersettings');
elgg_register_menu_item('topbar', array(
'href' => "/settings/user/$user->username",
'name' => 'usersettings',
'parent_name' => 'account',
'href' => "/settings/user/$user->username",
'section' => 'alt',
'text' => elgg_echo('settings:user'),
));

elgg_unregister_menu_item('topbar', 'administration');
elgg_register_menu_item('topbar', array(
'href' => '/admin',
'name' => 'administration',
'parent_name' => 'account',
'section' => 'alt',
'text' => elgg_echo('admin'),
));

if (elgg_is_active_plugin('notifications')) {
elgg_register_menu_item('topbar', array(
'href' => "/notifications/personal",
'name' => 'notifications',
'parent_name' => 'account',
'href' => "/notifications/personal",
'text' => elgg_echo('notifications:personal'),
'section' => 'alt',
'text' => elgg_echo('notifications:personal'),
));
}

elgg_unregister_menu_item('topbar', 'logout');
elgg_register_menu_item('topbar', array(
'name' => 'logout',
'parent_name' => 'account',
'href' => '/action/logout',
'is_action' => TRUE,
'text' => elgg_echo('logout'),
'section' => 'alt',
'name' => 'logout',
'parent_name' => 'account',
'priority' => 1000, //want this to be at the bottom of the list no matter what
'section' => 'alt',
'text' => elgg_echo('logout'),
));
}

Expand Down Expand Up @@ -507,7 +516,7 @@ function facebook_theme_owner_block_menu_handler($hook, $type, $items, $params)
if ($owner instanceof ElggUser) {
$items['info'] = ElggMenuItem::factory(array(
'name' => 'info',
'text' => elgg_echo('profile:info'),
'text' => elgg_view_icon('info') . elgg_echo('profile:info'),
'href' => "/profile/$owner->username/info",
'priority' => 2,
));
Expand All @@ -521,7 +530,7 @@ function facebook_theme_owner_block_menu_handler($hook, $type, $items, $params)

$items['friends'] = ElggMenuItem::factory(array(
'name' => 'friends',
'text' => elgg_echo('friends'),
'text' => elgg_view_icon('users') . elgg_echo('friends'),
'href' => "/friends/$owner->username"
));
}
Expand Down
18 changes: 9 additions & 9 deletions views/default/css/elements/layout.php
Expand Up @@ -4,31 +4,31 @@
*
* Contains CSS for the page shell and page layout
*
* Default layout: 990px wide, centered. Used in default page shell
* Default layout: 981px wide, centered. Used in default page shell
*
*/
?>

/* <style>
/* ***************************************
PAGE LAYOUT
*************************************** */
/***** DEFAULT LAYOUT ******/
.elgg-page-default .elgg-page-header > .elgg-inner {
width: 990px;
width: 981px;
margin: 0 auto;
height: 90px;
}
.elgg-page-default .elgg-page-body > .elgg-inner {
width: 990px;
width: 981px;
margin: 0 auto;
}

.elgg-page-footer {
width: 990px;
width: 981px;
margin: 0 auto;
}
.elgg-page-default .elgg-page-footer > .elgg-inner {
margin-left: 200px;
margin-left: 181px;
padding: 8px;
}

Expand All @@ -52,7 +52,7 @@

.elgg-page-topbar > .elgg-inner {
padding-top: 6px;
width: 990px;
width: 981px;
margin: 0 auto;
position: relative;
}
Expand Down Expand Up @@ -98,13 +98,13 @@
position: relative;
padding: 20px 0;
float: left;
width: 200px;
width: 181px;
min-height: 360px;
}
.elgg-sidebar-alt {
position: relative;
float: right;
width: 240px;
width: 244px;
margin-left: 20px;
min-height: 360px;
}
Expand Down
22 changes: 11 additions & 11 deletions views/default/css/elements/navigation.php
Expand Up @@ -6,9 +6,7 @@
* @subpackage UI
*/
?>



/* <style>
/* ***************************************
PAGINATION
*************************************** */
Expand Down Expand Up @@ -148,7 +146,7 @@
color: white;
display: block;
font-weight: bold;
height: 22px;
height: 24px;
}

.elgg-menu-topbar-default > li > a {
Expand All @@ -162,10 +160,10 @@

.elgg-menu-topbar-alt {
float:right;
margin-right:1px;
margin-right: 1px;
}
.elgg-menu-topbar-alt > li > a {
padding: 8px 10px 0;
padding: 8px 7px 0;
}
.elgg-menu-topbar-alt > li > a:hover {
background: #6D86B7;
Expand All @@ -183,7 +181,7 @@
margin-right: -1px;
margin-top: -1px;
min-width: 200px;
padding: 10px 0 5px;
padding: 4px 0;
position: absolute;
right: 0;
top: 100%;
Expand All @@ -196,11 +194,14 @@
}

.elgg-menu-topbar .elgg-child-menu > li > a {
color: #3A579A;
border-bottom: 1px solid white;
border-top: 1px solid white;
color: #333;
display: block;
font-weight: normal;
height: auto;
padding: 4px 10px 5px;
height: 18px;
line-height: 18px;
padding: 0px 22px;
white-space: nowrap;
}

Expand All @@ -209,7 +210,6 @@
border-bottom: 1px solid #3B5998;
border-top: 1px solid #3B5998;
color: white;
padding: 3px 10px 4px;
text-decoration: none;
}

Expand Down
3 changes: 2 additions & 1 deletion views/default/search/css.php
Expand Up @@ -12,6 +12,7 @@
width: 330px;
background: white url(<?php echo elgg_get_site_url(); ?>_graphics/elgg_sprites.png) no-repeat 335px -934px;
border: 1px solid #3B5998;
border-radius: 1px;
height: 20px;
padding: 0 23px 0 0;
}
Expand Down Expand Up @@ -41,7 +42,7 @@
}

.elgg-page-topbar .elgg-search {
margin: 4px 0 4px 205px;
margin: 4px 0 4px 181px;
position: relative;
}

Expand Down

0 comments on commit ada3047

Please sign in to comment.