aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-24 01:27:47 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-02-24 01:27:47 +0000
commitc667ce609dc3c1f9f071e39293f8c176d3e1c5dc (patch)
tree1ec44df08297b396809af545dcf9568ba7c27aff
parent64547b21f0e0cb4efc55212a5a6ae92824b274aa (diff)
downloadelgg-c667ce609dc3c1f9f071e39293f8c176d3e1c5dc.tar.gz
elgg-c667ce609dc3c1f9f071e39293f8c176d3e1c5dc.tar.bz2
Refs #2997 switching from title to text for menu items
git-svn-id: http://code.elgg.org/elgg/trunk@8455 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/classes/ElggMenuBuilder.php12
-rw-r--r--engine/classes/ElggMenuItem.php31
-rw-r--r--engine/lib/admin.php4
-rw-r--r--engine/lib/deprecated-1.8.php4
-rw-r--r--engine/lib/user_settings.php6
-rw-r--r--engine/lib/users.php30
-rw-r--r--engine/lib/views.php4
-rw-r--r--mod/bookmarks/start.php2
-rw-r--r--mod/developers/start.php2
-rw-r--r--mod/file/views/default/file/typecloud.php4
-rw-r--r--mod/invitefriends/start.php2
-rw-r--r--mod/messages/start.php4
-rw-r--r--mod/notifications/start.php4
-rw-r--r--mod/pages/lib/pages.php4
-rw-r--r--views/default/forms/admin/menu/save.php2
15 files changed, 58 insertions, 57 deletions
diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php
index 33abc0c6b..4f9e7b447 100644
--- a/engine/classes/ElggMenuBuilder.php
+++ b/engine/classes/ElggMenuBuilder.php
@@ -176,8 +176,8 @@ class ElggMenuBuilder {
ksort($this->menu);
switch ($sort_by) {
- case 'title':
- $sort_callback = array('ElggMenuBuilder', 'compareByTitle');
+ case 'text':
+ $sort_callback = array('ElggMenuBuilder', 'compareByText');
break;
case 'name':
$sort_callback = array('ElggMenuBuilder', 'compareByName');
@@ -221,15 +221,15 @@ class ElggMenuBuilder {
}
/**
- * Compare two menu items by their titles
+ * Compare two menu items by their display text
*
* @param ElggMenuItem $a
* @param ElggMenuItem $b
* @return bool
*/
- public static function compareByTitle($a, $b) {
- $a = $a->getTitle();
- $b = $b->getTitle();
+ public static function compareByText($a, $b) {
+ $a = $a->getText();
+ $b = $b->getText();
return strnatcmp($a, $b);
}
diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php
index 0de5feddb..0a1b948cc 100644
--- a/engine/classes/ElggMenuItem.php
+++ b/engine/classes/ElggMenuItem.php
@@ -16,7 +16,7 @@ class ElggMenuItem {
/**
* @var string The menu display string
*/
- protected $title;
+ protected $text;
/**
* @var string The menu url
@@ -46,7 +46,7 @@ class ElggMenuItem {
/**
* @var string Tooltip
*/
- protected $tooltip = '';
+ protected $title = '';
/**
* @var int Menu weight - smaller weights float to the top
@@ -77,12 +77,12 @@ class ElggMenuItem {
* ElggMenuItem constructor
*
* @param string $name Identifier of the menu item
- * @param string $title Title of the menu item
+ * @param string $text Display text of the menu item
* @param string $url URL of the menu item
*/
- public function __construct($name, $title, $url) {
+ public function __construct($name, $text, $url) {
$this->name = $name;
- $this->title = $title;
+ $this->text = $text;
if ($url) {
$this->url = elgg_normalize_url($url);
}
@@ -99,13 +99,13 @@ class ElggMenuItem {
* @return ElggMenuItem or NULL on error
*/
public static function factory($options) {
- if (!isset($options['name']) || !isset($options['title'])) {
+ if (!isset($options['name']) || !isset($options['text'])) {
return NULL;
}
- $item = new ElggMenuItem($options['name'], $options['title'], $options['url']);
+ $item = new ElggMenuItem($options['name'], $options['text'], $options['url']);
unset($options['name']);
- unset($options['title']);
+ unset($options['text']);
unset($options['url']);
// special catch in case someone uses context rather than contexts
@@ -136,12 +136,12 @@ class ElggMenuItem {
}
/**
- * Get the display title of the menu
+ * Get the display text of the menu
*
* @return string
*/
- public function getTitle() {
- return $this->title;
+ public function getText() {
+ return $this->text;
}
/**
@@ -229,7 +229,7 @@ class ElggMenuItem {
* @return void
*/
public function setTooltip($text) {
- $this->tooltip = $text;
+ $this->title = $text;
}
/**
@@ -238,7 +238,7 @@ class ElggMenuItem {
* @return string
*/
public function getTooltip() {
- return $this->tooltip;
+ return $this->title;
}
/**
@@ -408,13 +408,16 @@ class ElggMenuItem {
* @return string
*/
public function getLink(array $vars = array()) {
- $vars['text'] = $this->title;
+ $vars['text'] = $this->text;
if ($this->url) {
$vars['href'] = $this->url;
}
if ($this->linkClass) {
$vars['class'] = $this->linkClass;
}
+ if ($this->title) {
+ $vars['title'] = $this->title;
+ }
return elgg_view('output/url', $vars);
}
diff --git a/engine/lib/admin.php b/engine/lib/admin.php
index d4ebbdd0d..3f4a331de 100644
--- a/engine/lib/admin.php
+++ b/engine/lib/admin.php
@@ -138,7 +138,7 @@ function elgg_add_admin_menu_item($section_id, $section_title, $parent_id = NULL
return elgg_register_menu_item('page', array(
'name' => $name,
'url' => $href,
- 'title' => $section_title,
+ 'text' => $section_title,
'context' => 'admin',
'parent_name' => $parent_id,
'weight' => $weight,
@@ -205,7 +205,7 @@ function admin_init() {
elgg_register_menu_item('page', array(
'name' => 'dashboard',
'url' => 'pg/admin/dashboard',
- 'title' => elgg_echo('admin:dashboard'),
+ 'text' => elgg_echo('admin:dashboard'),
'context' => 'admin',
'weight' => 10,
));
diff --git a/engine/lib/deprecated-1.8.php b/engine/lib/deprecated-1.8.php
index 58ea3d48a..e31a9f8ba 100644
--- a/engine/lib/deprecated-1.8.php
+++ b/engine/lib/deprecated-1.8.php
@@ -1205,7 +1205,7 @@ function add_submenu_item($label, $link, $group = 'default', $onclick = false, $
$context = 'all';
}
- $item = array('name' => $label, 'title' => $label, 'url' => $link, 'context' => $context,
+ $item = array('name' => $label, 'text' => $label, 'url' => $link, 'context' => $context,
'section' => $group,);
if ($selected) {
@@ -1250,7 +1250,7 @@ function get_submenu() {
function add_menu($menu_name, $menu_url, $menu_children = array(), $context = "") {
elgg_deprecated_notice('add_menu() deprecated by elgg_register_menu_item()', 1.8);
- return elgg_register_menu_item('site', array('name' => $menu_name, 'title' => $menu_name,
+ return elgg_register_menu_item('site', array('name' => $menu_name, 'text' => $menu_name,
'url' => $menu_url,));
}
diff --git a/engine/lib/user_settings.php b/engine/lib/user_settings.php
index 0247dc5d9..25aa36dbd 100644
--- a/engine/lib/user_settings.php
+++ b/engine/lib/user_settings.php
@@ -253,19 +253,19 @@ function usersettings_pagesetup() {
$params = array(
'name' => '1_account',
- 'title' => elgg_echo('usersettings:user:opt:linktext'),
+ 'text' => elgg_echo('usersettings:user:opt:linktext'),
'url' => "pg/settings/user/{$user->username}",
);
elgg_register_menu_item('page', $params);
$params = array(
'name' => '1_plugins',
- 'title' => elgg_echo('usersettings:plugins:opt:linktext'),
+ 'text' => elgg_echo('usersettings:plugins:opt:linktext'),
'url' => "pg/settings/plugins/{$user->username}",
);
elgg_register_menu_item('page', $params);
$params = array(
'name' => '1_statistics',
- 'title' => elgg_echo('usersettings:statistics:opt:linktext'),
+ 'text' => elgg_echo('usersettings:statistics:opt:linktext'),
'url' => "pg/settings/statistics/{$user->username}",
);
elgg_register_menu_item('page', $params);
diff --git a/engine/lib/users.php b/engine/lib/users.php
index a78b9565b..9d1cb1ff6 100644
--- a/engine/lib/users.php
+++ b/engine/lib/users.php
@@ -1087,14 +1087,14 @@ function collections_submenu_items() {
$user = elgg_get_logged_in_user_entity();
elgg_register_menu_item('page', array(
- 'name' => 'friends:collections',
- 'title' => elgg_echo('friends:collections'),
+ 'name' => 'friends:collections:view',
+ 'text' => elgg_echo('friends:collections'),
'url' => "pg/collections/$user->username",
));
elgg_register_menu_item('page', array(
- 'name' => 'friends:collections',
- 'title' => elgg_echo('friends:collections:add'),
+ 'name' => 'friends:collections:add',
+ 'text' => elgg_echo('friends:collections:add'),
'url' => "pg/collections/add",
));
}
@@ -1112,7 +1112,7 @@ function friends_page_handler($page_elements) {
}
if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) {
// disabled for now as we no longer use friends collections (replaced by shared access)
- // collections_submenu_items();
+ collections_submenu_items();
}
require_once(dirname(dirname(dirname(__FILE__))) . "/pages/friends/index.php");
}
@@ -1131,7 +1131,7 @@ function friends_of_page_handler($page_elements) {
}
if (elgg_get_logged_in_user_guid() == elgg_get_page_owner_guid()) {
// disabled for now as we no longer use friends collections (replaced by shared access)
- // collections_submenu_items();
+ collections_submenu_items();
}
require_once(dirname(dirname(dirname(__FILE__))) . "/pages/friends/of.php");
}
@@ -1467,7 +1467,7 @@ function users_pagesetup() {
if (elgg_get_page_owner_guid()) {
$params = array(
'name' => 'friends',
- 'title' => elgg_echo('friends'),
+ 'text' => elgg_echo('friends'),
'url' => 'pg/friends/' . elgg_get_page_owner_entity()->username,
'contexts' => array('friends')
);
@@ -1475,7 +1475,7 @@ function users_pagesetup() {
$params = array(
'name' => 'friendsof',
- 'title' => elgg_echo('friends:of'),
+ 'text' => elgg_echo('friends:of'),
'url' => 'pg/friendsof/' . elgg_get_page_owner_entity()->username,
'contexts' => array('friends')
);
@@ -1500,8 +1500,7 @@ function users_init() {
elgg_register_page_handler('members', 'elgg_members_page_handler');
elgg_register_page_handler('avatar', 'elgg_avatar_page_handler');
elgg_register_page_handler('profile', 'elgg_profile_page_handler');
-
- //elgg_register_page_handler('collections', 'collections_page_handler');
+ elgg_register_page_handler('collections', 'collections_page_handler');
$item = new ElggMenuItem('members', elgg_echo('members'), 'pg/members');
elgg_register_menu_item('site', $item);
@@ -1511,14 +1510,14 @@ function users_init() {
$params = array(
'name' => 'edit_avatar',
'url' => "pg/avatar/edit/{$user->username}",
- 'title' => elgg_echo('avatar:edit'),
+ 'text' => elgg_echo('avatar:edit'),
'contexts' => array('profile_edit'),
);
elgg_register_menu_item('page', $params);
$params = array(
'name' => 'edit_profile',
'url' => "pg/profile/{$user->username}/edit",
- 'title' => elgg_echo('profile:edit'),
+ 'text' => elgg_echo('profile:edit'),
'contexts' => array('profile_edit'),
);
elgg_register_menu_item('page', $params);
@@ -1534,10 +1533,9 @@ function users_init() {
elgg_register_action('avatar/crop');
elgg_register_action('profile/edit');
- //elgg_register_action('friends/addcollection');
- //elgg_register_action('friends/deletecollection');
- //elgg_register_action('friends/editcollection');
- //elgg_register_action("user/spotlight");
+ elgg_register_action('friends/addcollection');
+ elgg_register_action('friends/deletecollection');
+ elgg_register_action('friends/editcollection');
elgg_register_plugin_hook_handler('entity:icon:url', 'user', 'user_avatar_hook');
diff --git a/engine/lib/views.php b/engine/lib/views.php
index b1c42680a..db510a275 100644
--- a/engine/lib/views.php
+++ b/engine/lib/views.php
@@ -1493,8 +1493,8 @@ function elgg_views_boot() {
elgg_register_simplecache_view('js/friendsPickerv1');
elgg_register_simplecache_view('js/elgg');
- elgg_register_js("/vendors/jquery/jquery-1.5.min.js", 'jquery');
- elgg_register_js("/vendors/jquery/jquery-ui-1.8.9.min.js", 'jquery-ui');
+ elgg_register_js("/vendors/jquery/jquery-1.4.2.min.js", 'jquery');
+ elgg_register_js("/vendors/jquery/jquery-ui-1.7.2.min.js", 'jquery-ui');
elgg_register_js("/vendors/jquery/jquery.form.js", 'jquery.form');
elgg_register_event_handler('ready', 'system', 'elgg_views_register_core_head_elements');
diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php
index a80cda857..9f8179823 100644
--- a/mod/bookmarks/start.php
+++ b/mod/bookmarks/start.php
@@ -25,7 +25,7 @@ function bookmarks_init() {
// menus
elgg_register_menu_item('site', array(
'name' => 'bookmarks',
- 'title' => elgg_echo('bookmarks'),
+ 'text' => elgg_echo('bookmarks'),
'url' => 'pg/bookmarks/all'
));
diff --git a/mod/developers/start.php b/mod/developers/start.php
index 9e1d02361..f9527cd44 100644
--- a/mod/developers/start.php
+++ b/mod/developers/start.php
@@ -47,7 +47,7 @@ function developers_theme_preview_controller($page) {
foreach ($pages as $page_name) {
elgg_register_menu_item('page', array(
'name' => $page_name,
- 'title' => elgg_echo("theme_preview:$page_name"),
+ 'text' => elgg_echo("theme_preview:$page_name"),
'url' => "pg/theme_preview/$page_name",
));
}
diff --git a/mod/file/views/default/file/typecloud.php b/mod/file/views/default/file/typecloud.php
index 0552f7e8e..6d329d831 100644
--- a/mod/file/views/default/file/typecloud.php
+++ b/mod/file/views/default/file/typecloud.php
@@ -37,14 +37,14 @@ $all = new stdClass;
$all->tag = "all";
elgg_register_menu_item('page', array(
'name' => 'file:all',
- 'title' => elgg_echo('all'),
+ 'text' => elgg_echo('all'),
'url' => file_type_cloud_get_url($all, $friends),
));
foreach ($types as $type) {
elgg_register_menu_item('page', array(
'name' => "file:$type->tag",
- 'title' => elgg_echo("file:type:$type->tag"),
+ 'text' => elgg_echo("file:type:$type->tag"),
'url' => file_type_cloud_get_url($type, $friends),
));
}
diff --git a/mod/invitefriends/start.php b/mod/invitefriends/start.php
index e05a2e128..9ab602d37 100644
--- a/mod/invitefriends/start.php
+++ b/mod/invitefriends/start.php
@@ -14,7 +14,7 @@ function invitefriends_init() {
$params = array(
'name' => 'invite',
- 'title' => elgg_echo('friends:invite'),
+ 'text' => elgg_echo('friends:invite'),
'url' => "pg/invite/",
'contexts' => array('friends'),
);
diff --git a/mod/messages/start.php b/mod/messages/start.php
index 9868cce49..b7194d03b 100644
--- a/mod/messages/start.php
+++ b/mod/messages/start.php
@@ -18,13 +18,13 @@ function messages_init() {
if (elgg_is_logged_in()) {
elgg_register_menu_item('page', array(
'name' => 'messages:inbox',
- 'title' => elgg_echo('messages:inbox'),
+ 'text' => elgg_echo('messages:inbox'),
'url' => "pg/messages/inbox/" . elgg_get_logged_in_user_entity()->username,
'context' => 'messages',
));
elgg_register_menu_item('page', array(
'name' => 'messages:sentmessages',
- 'title' => elgg_echo('messages:sentmessages'),
+ 'text' => elgg_echo('messages:sentmessages'),
'url' => "pg/messages/sent/" . elgg_get_logged_in_user_entity()->username,
'context' => 'messages',
));
diff --git a/mod/notifications/start.php b/mod/notifications/start.php
index 1c12dbf63..13a21c420 100644
--- a/mod/notifications/start.php
+++ b/mod/notifications/start.php
@@ -69,7 +69,7 @@ function notifications_plugin_pagesetup() {
$params = array(
'name' => '2_a_user_notify',
- 'title' => elgg_echo('notifications:subscriptions:changesettings'),
+ 'text' => elgg_echo('notifications:subscriptions:changesettings'),
'url' => "pg/notifications/personal",
);
elgg_register_menu_item('page', $params);
@@ -77,7 +77,7 @@ function notifications_plugin_pagesetup() {
if (elgg_is_active_plugin('groups')) {
$params = array(
'name' => '2_group_notify',
- 'title' => elgg_echo('notifications:subscriptions:changesettings:groups'),
+ 'text' => elgg_echo('notifications:subscriptions:changesettings:groups'),
'url' => "pg/notifications/group",
);
elgg_register_menu_item('page', $params);
diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php
index 72aad2aed..c9a1b27b6 100644
--- a/mod/pages/lib/pages.php
+++ b/mod/pages/lib/pages.php
@@ -80,7 +80,7 @@ function pages_register_navigation_tree($container) {
foreach ($top_pages as $page) {
elgg_register_menu_item('pages_nav', array(
'name' => $page->getGUID(),
- 'title' => $page->title,
+ 'text' => $page->title,
'url' => $page->getURL(),
));
@@ -98,7 +98,7 @@ function pages_register_navigation_tree($container) {
foreach ($children as $child) {
elgg_register_menu_item('pages_nav', array(
'name' => $child->getGUID(),
- 'title' => $child->title,
+ 'text' => $child->title,
'url' => $child->getURL(),
'parent_name' => $parent->getGUID(),
));
diff --git a/views/default/forms/admin/menu/save.php b/views/default/forms/admin/menu/save.php
index c55ff3367..7b8a9a6cb 100644
--- a/views/default/forms/admin/menu/save.php
+++ b/views/default/forms/admin/menu/save.php
@@ -14,7 +14,7 @@ $featured_menu_names = elgg_get_config('site_featured_menu_names');
$dropdown_values = array();
foreach ($menu_items as $item) {
- $dropdown_values[$item->getName()] = $item->getTitle();
+ $dropdown_values[$item->getName()] = $item->getText();
}
$dropdown_values[''] = elgg_echo('none');