From a140ef9c53edb2e249eab2eafccc6eb8c0952dab Mon Sep 17 00:00:00 2001 From: pete Date: Mon, 22 Mar 2010 13:31:19 +0000 Subject: Updated avatar menu: Removed links to tools, provided a view to extend menu, added @username to menu, cleaned-up and simplified menu generation. git-svn-id: http://code.elgg.org/elgg/trunk@5467 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/file/start.php | 3 - mod/file/views/default/file/menu.php | 16 ---- mod/messages/start.php | 2 +- mod/messages/views/default/messages/menu.php | 15 ++-- mod/pages/start.php | 3 - mod/pages/views/default/pages/menu.php | 14 ---- mod/profile/languages/en.php | 12 +-- mod/profile/start.php | 9 --- mod/profile/views/default/profile/css.php | 20 +++-- mod/profile/views/default/profile/icon.php | 92 +++++++++++++--------- mod/profile/views/default/profile/menu/actions.php | 32 -------- .../views/default/profile/menu/adminwrapper.php | 17 ---- .../views/default/profile/menu/friendlinks.php | 27 +++++++ mod/profile/views/default/profile/menu/links.php | 21 +---- .../views/default/profile/menu/linksownpage.php | 29 ------- .../default/profile/profile_contents/widgets.php | 0 .../views/default/profile/profile_ownerblock.php | 4 +- mod/profile/views/default/profile/submenu.php | 22 ------ .../views/default/reportedcontent/user_report.php | 3 +- 19 files changed, 110 insertions(+), 231 deletions(-) delete mode 100644 mod/file/views/default/file/menu.php delete mode 100644 mod/pages/views/default/pages/menu.php delete mode 100644 mod/profile/views/default/profile/menu/actions.php delete mode 100644 mod/profile/views/default/profile/menu/adminwrapper.php create mode 100644 mod/profile/views/default/profile/menu/friendlinks.php delete mode 100644 mod/profile/views/default/profile/menu/linksownpage.php delete mode 100644 mod/profile/views/default/profile/profile_contents/widgets.php delete mode 100644 mod/profile/views/default/profile/submenu.php (limited to 'mod') diff --git a/mod/file/start.php b/mod/file/start.php index 745f087f4..e3b5497e6 100644 --- a/mod/file/start.php +++ b/mod/file/start.php @@ -36,9 +36,6 @@ // Extend CSS elgg_extend_view('css', 'file/css'); - // Extend hover-over and profile menu - elgg_extend_view('profile/menu/links','file/menu'); - // extend group main page elgg_extend_view('groups/left_column','file/groupprofile_files'); diff --git a/mod/file/views/default/file/menu.php b/mod/file/views/default/file/menu.php deleted file mode 100644 index 7cde6b91a..000000000 --- a/mod/file/views/default/file/menu.php +++ /dev/null @@ -1,16 +0,0 @@ - - -
  • - -
  • \ No newline at end of file diff --git a/mod/messages/start.php b/mod/messages/start.php index b74402ac3..6e130edca 100644 --- a/mod/messages/start.php +++ b/mod/messages/start.php @@ -44,7 +44,7 @@ function messages_init() { // Register a URL handler for shouts posts register_entity_url_handler('messages_url','object','messages'); - // Extend hover-over and profile menu + // Extend avatar user-menu elgg_extend_view('profile/menu/links','messages/menu'); // Register a notification handler for site messages diff --git a/mod/messages/views/default/messages/menu.php b/mod/messages/views/default/messages/menu.php index 150c9a73c..5afb7d409 100644 --- a/mod/messages/views/default/messages/menu.php +++ b/mod/messages/views/default/messages/menu.php @@ -8,14 +8,9 @@ * @copyright Curverider Ltd 2008-2010 * @link http://elgg.com/ */ - - //need to be logged in to send a message - if (isloggedin()) { -?> -
  • - -
  • - - +
  • + +
  • \ No newline at end of file diff --git a/mod/pages/start.php b/mod/pages/start.php index a849807e8..fd9d253f7 100644 --- a/mod/pages/start.php +++ b/mod/pages/start.php @@ -27,9 +27,6 @@ add_menu(elgg_echo('pages'), $CONFIG->wwwroot . "mod/pages/world.php"); } - // Extend hover-over menu - elgg_extend_view('profile/menu/links','pages/menu'); - // Register a page handler, so we can have nice URLs register_page_handler('pages','pages_page_handler'); diff --git a/mod/pages/views/default/pages/menu.php b/mod/pages/views/default/pages/menu.php deleted file mode 100644 index 9c92648ab..000000000 --- a/mod/pages/views/default/pages/menu.php +++ /dev/null @@ -1,14 +0,0 @@ - -
  • - -
  • \ No newline at end of file diff --git a/mod/profile/languages/en.php b/mod/profile/languages/en.php index 90f49ca0a..67420836b 100644 --- a/mod/profile/languages/en.php +++ b/mod/profile/languages/en.php @@ -27,16 +27,16 @@ $english = array( 'profile:user' => "%s's profile", 'profile:edit' => "Edit profile", - 'profile:profilepictureinstructions' => "The profile picture is the image that's displayed on your profile page.
    You can change it as often as you'd like. (File formats accepted: GIF, JPG or PNG)", - 'profile:icon' => "Profile picture", + 'profile:profilepictureinstructions' => "Your avatar is the image that's displayed on your profile page.
    You can change it as often as you'd like. (File formats accepted: GIF, JPG or PNG)", + 'profile:icon' => "Avatar", 'profile:createicon' => "Create your avatar", 'profile:currentavatar' => "Current avatar", 'profile:createicon:header' => "Profile picture", - 'profile:profilepicturecroppingtool' => "Profile picture cropping tool", - 'profile:createicon:instructions' => "Click and drag a square below to match how you want your picture cropped. A preview of your cropped picture will appear in the box on the right. When you are happy with the preview, click 'Create your avatar'. This cropped image will be used throughout the site as your avatar. ", + 'profile:profilepicturecroppingtool' => "Avatar cropping tool", + 'profile:createicon:instructions' => "Click and drag a square below to match how you want your avatar cropped. A preview will appear in the box on the right. When you are happy with the preview, click 'Create your avatar'. This cropped version will be used throughout the site as your avatar. ", - 'profile:editdetails' => "Edit details", - 'profile:editicon' => "Edit profile icon", + 'profile:editdetails' => "Edit profile", + 'profile:editicon' => "Edit avatar", 'profile:aboutme' => "About me", 'profile:description' => "About me", diff --git a/mod/profile/start.php b/mod/profile/start.php index bb2f3d5cc..e66554d08 100644 --- a/mod/profile/start.php +++ b/mod/profile/start.php @@ -48,15 +48,6 @@ function profile_init() { elgg_extend_view('css', 'profile/css'); elgg_extend_view('js/initialise_elgg', 'profile/javascript'); - if (get_context() == 'profile') { - elgg_extend_view('canvas_header/submenu', 'profile/submenu'); - } - - // Extend context menu with admin links - if (isadminloggedin()){ - elgg_extend_view('profile/menu/links', 'profile/menu/adminwrapper', 10000); - } - // Now override icons register_plugin_hook('entity:icon:url', 'user', 'profile_usericon_hook'); diff --git a/mod/profile/views/default/profile/css.php b/mod/profile/views/default/profile/css.php index ed5b050b3..7a82b2bec 100644 --- a/mod/profile/views/default/profile/css.php +++ b/mod/profile/views/default/profile/css.php @@ -352,8 +352,8 @@ p.visit_twitter a { width:164px; background:#FFFFFF; text-align:left; - -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); /* safari v3+ */ - -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); /* FF v3.5+ */ + -webkit-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); + -moz-box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.50); } div.usericon a.icon img { z-index:10; @@ -367,17 +367,21 @@ div.usericon a.icon img { background:#cccccc; text-decoration:none; } -.usericon .sub_menu h3 { - font-size:1.3em; - line-height: 1.1em; +.usericon .sub_menu h3.displayname { + font-size:1.3em !important; /* make sure nothing overrides our sub menu h3 */ + line-height: 1.1em !important; padding:0 !important; margin:0 !important; - border-bottom:solid 1px #dddddd; - color: #4690d6; + border-bottom:solid 1px #dddddd !important; } -.usericon .sub_menu h3 a { +.usericon .sub_menu h3.displayname a { padding:3px 3px 3px 8px; } +.usericon .sub_menu h3.displayname a .username { + display:block; + font-weight: normal; + font-size: 0.8em; +} .usericon .sub_menu a { padding:2px 3px 2px 8px; } diff --git a/mod/profile/views/default/profile/icon.php b/mod/profile/views/default/profile/icon.php index 83015766a..d5623e0c8 100644 --- a/mod/profile/views/default/profile/icon.php +++ b/mod/profile/views/default/profile/icon.php @@ -43,49 +43,67 @@ if ($vars['entity'] instanceof ElggUser) { // Override if (isset($vars['override']) && $vars['override'] == true) { $override = true; - } else $override = false; - + } else { + $override = false; + } + // profile avatar drop-down menu if (!$override) { - -?> -
    -
    - - - isBanned())) { - ?>"> +
    +
    + isBanned())) { + ?> alt="name, ENT_QUOTES, 'UTF-8'); ?>" title="name, ENT_QUOTES, 'UTF-8'); ?>" /> -
    - - + + - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - */ - -if (isloggedin()) { - if ($_SESSION['user']->getGUID() != $vars['entity']->getGUID()) { - $ts = time(); - $token = generate_action_token($ts); - if ($vars['entity']->isFriend()) { - echo elgg_view('output/confirmlink', array( - 'href' => "{$vars['url']}action/friends/remove?friend={$vars['entity']->getGUID()}", - 'text' => elgg_echo('friend:remove'), - 'class' => 'user_menu_removefriend' - )); - } else { - echo elgg_view('output/confirmlink', array( - 'href' => "{$vars['url']}action/friends/add?friend={$vars['entity']->getGUID()}", - 'text' => elgg_echo('friend:add'), - 'class' => 'user_menu_addfriend' - )); - } - } -} \ No newline at end of file diff --git a/mod/profile/views/default/profile/menu/adminwrapper.php b/mod/profile/views/default/profile/menu/adminwrapper.php deleted file mode 100644 index eec5a6d3f..000000000 --- a/mod/profile/views/default/profile/menu/adminwrapper.php +++ /dev/null @@ -1,17 +0,0 @@ -{$adminlinks}"; -} \ No newline at end of file diff --git a/mod/profile/views/default/profile/menu/friendlinks.php b/mod/profile/views/default/profile/menu/friendlinks.php new file mode 100644 index 000000000..f7ca3c2fd --- /dev/null +++ b/mod/profile/views/default/profile/menu/friendlinks.php @@ -0,0 +1,27 @@ + + * @copyright Curverider Ltd 2008-2010 + * @link http://elgg.com/ + * + * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. + */ +$ts = time(); +$token = generate_action_token($ts); +if ($vars['entity']->isFriend()) { + echo elgg_view('output/confirmlink', array( + 'href' => "{$vars['url']}action/friends/remove?friend={$vars['entity']->getGUID()}", + 'text' => elgg_echo('friend:remove'), + 'class' => 'remove_friend' + )); +} else { + echo elgg_view('output/confirmlink', array( + 'href' => "{$vars['url']}action/friends/add?friend={$vars['entity']->getGUID()}", + 'text' => elgg_echo('friend:add'), + 'class' => 'add_friend' + )); +} \ No newline at end of file diff --git a/mod/profile/views/default/profile/menu/links.php b/mod/profile/views/default/profile/menu/links.php index fd04e2e99..de2b28926 100644 --- a/mod/profile/views/default/profile/menu/links.php +++ b/mod/profile/views/default/profile/menu/links.php @@ -1,6 +1,6 @@ - -
  • - -
  • -canEdit()){ -?> -
  • - -
  • - -
  • - -
  • -
  • - -
  • diff --git a/mod/profile/views/default/profile/menu/linksownpage.php b/mod/profile/views/default/profile/menu/linksownpage.php deleted file mode 100644 index 2d41c6c31..000000000 --- a/mod/profile/views/default/profile/menu/linksownpage.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @copyright Curverider Ltd 2008-2010 - * @link http://elgg.com/ - * - * @uses $vars['entity'] The user entity. If none specified, the current user is assumed. - */ -?> -canEdit()){ -?> -
  • - -
  • - -
  • - -
  • -
  • - -
  • - diff --git a/mod/profile/views/default/profile/profile_contents/widgets.php b/mod/profile/views/default/profile/profile_contents/widgets.php deleted file mode 100644 index e69de29bb..000000000 diff --git a/mod/profile/views/default/profile/profile_ownerblock.php b/mod/profile/views/default/profile/profile_ownerblock.php index 7f89d3782..4a6622fc8 100755 --- a/mod/profile/views/default/profile/profile_ownerblock.php +++ b/mod/profile/views/default/profile/profile_ownerblock.php @@ -31,8 +31,8 @@ if($section == 'details'){ $profile_actions = ""; if(get_loggedin_user()->getGuid() == page_owner()){ $profile_actions = "
    "; - $profile_actions .= "username}/edit/details' class='action_button'>Edit profile"; - $profile_actions .= "username}/edit/icon' class='action_button'>Edit profile icon"; + $profile_actions .= "username}/edit/details' class='action_button'>". elgg_echo('profile:edit') .""; + $profile_actions .= "username}/edit/icon' class='action_button'>". elgg_echo('profile:editicon') .""; $profile_actions .= "
    "; }else{ $profile_actions = "
    "; diff --git a/mod/profile/views/default/profile/submenu.php b/mod/profile/views/default/profile/submenu.php deleted file mode 100644 index 682b910c2..000000000 --- a/mod/profile/views/default/profile/submenu.php +++ /dev/null @@ -1,22 +0,0 @@ - - - \ No newline at end of file diff --git a/mod/reportedcontent/views/default/reportedcontent/user_report.php b/mod/reportedcontent/views/default/reportedcontent/user_report.php index e341bb6d3..1b5ff9501 100644 --- a/mod/reportedcontent/views/default/reportedcontent/user_report.php +++ b/mod/reportedcontent/views/default/reportedcontent/user_report.php @@ -1,6 +1,5 @@ -
  • wwwroot . "mod/reportedcontent/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">" . elgg_echo('reportedcontent:report') . ""; + echo "wwwroot . "mod/reportedcontent/add.php?address='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">" . elgg_echo('reportedcontent:report') . ""; ?>
  • \ No newline at end of file -- cgit v1.2.3