diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-24 01:46:08 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-02-24 01:46:08 +0000 |
commit | 2aa481c0ac877eacf643cd71c5701c1c271140da (patch) | |
tree | 8502b3be1c16cdbfa655ec96c2da378f7ed05cf9 | |
parent | c667ce609dc3c1f9f071e39293f8c176d3e1c5dc (diff) | |
download | elgg-2aa481c0ac877eacf643cd71c5701c1c271140da.tar.gz elgg-2aa481c0ac877eacf643cd71c5701c1c271140da.tar.bz2 |
Fixes #2997 - href used instead of url in menu system
git-svn-id: http://code.elgg.org/elgg/trunk@8456 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | engine/classes/ElggMenuBuilder.php | 4 | ||||
-rw-r--r-- | engine/classes/ElggMenuItem.php | 24 | ||||
-rw-r--r-- | engine/lib/admin.php | 4 | ||||
-rw-r--r-- | engine/lib/deprecated-1.8.php | 4 | ||||
-rw-r--r-- | engine/lib/navigation.php | 6 | ||||
-rw-r--r-- | engine/lib/user_settings.php | 6 | ||||
-rw-r--r-- | engine/lib/users.php | 12 | ||||
-rw-r--r-- | engine/lib/views.php | 2 | ||||
-rw-r--r-- | mod/bookmarks/start.php | 2 | ||||
-rw-r--r-- | mod/developers/start.php | 2 | ||||
-rw-r--r-- | mod/file/views/default/file/typecloud.php | 4 | ||||
-rw-r--r-- | mod/invitefriends/start.php | 2 | ||||
-rw-r--r-- | mod/messages/start.php | 4 | ||||
-rw-r--r-- | mod/notifications/start.php | 4 | ||||
-rw-r--r-- | mod/pages/lib/pages.php | 4 |
15 files changed, 42 insertions, 42 deletions
diff --git a/engine/classes/ElggMenuBuilder.php b/engine/classes/ElggMenuBuilder.php index 4f9e7b447..9112c9535 100644 --- a/engine/classes/ElggMenuBuilder.php +++ b/engine/classes/ElggMenuBuilder.php @@ -153,8 +153,8 @@ class ElggMenuBuilder { // scan looking for a selected item foreach ($this->menu as $menu_item) { - if ($menu_item->getURL()) { - if (elgg_http_url_is_identical(full_url(), $menu_item->getURL())) { + if ($menu_item->getHref()) { + if (elgg_http_url_is_identical(full_url(), $menu_item->getHref())) { $menu_item->setSelected(true); return $menu_item; } diff --git a/engine/classes/ElggMenuItem.php b/engine/classes/ElggMenuItem.php index 0a1b948cc..8bff0abba 100644 --- a/engine/classes/ElggMenuItem.php +++ b/engine/classes/ElggMenuItem.php @@ -21,7 +21,7 @@ class ElggMenuItem { /** * @var string The menu url */ - protected $url = null; + protected $href = null; /** * @var array Classes to apply to the anchor tag. @@ -78,13 +78,13 @@ class ElggMenuItem { * * @param string $name Identifier of the menu item * @param string $text Display text of the menu item - * @param string $url URL of the menu item + * @param string $href URL of the menu item */ - public function __construct($name, $text, $url) { + public function __construct($name, $text, $href) { $this->name = $name; $this->text = $text; - if ($url) { - $this->url = elgg_normalize_url($url); + if ($href) { + $this->href = elgg_normalize_url($href); } } @@ -92,7 +92,7 @@ class ElggMenuItem { * ElggMenuItem factory method * * This static method creates an ElggMenuItem from an associative array. - * Required keys are name, title, and url. + * Required keys are name, text, and href. * * @param array $options Option array of key value pairs * @@ -103,10 +103,10 @@ class ElggMenuItem { return NULL; } - $item = new ElggMenuItem($options['name'], $options['text'], $options['url']); + $item = new ElggMenuItem($options['name'], $options['text'], $options['href']); unset($options['name']); unset($options['text']); - unset($options['url']); + unset($options['href']); // special catch in case someone uses context rather than contexts if (isset($options['context'])) { @@ -149,8 +149,8 @@ class ElggMenuItem { * * @return string */ - public function getURL() { - return $this->url; + public function getHref() { + return $this->href; } /** @@ -409,8 +409,8 @@ class ElggMenuItem { */ public function getLink(array $vars = array()) { $vars['text'] = $this->text; - if ($this->url) { - $vars['href'] = $this->url; + if ($this->href) { + $vars['href'] = $this->href; } if ($this->linkClass) { $vars['class'] = $this->linkClass; diff --git a/engine/lib/admin.php b/engine/lib/admin.php index 3f4a331de..1c78ce210 100644 --- a/engine/lib/admin.php +++ b/engine/lib/admin.php @@ -137,7 +137,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, + 'href' => $href, 'text' => $section_title, 'context' => 'admin', 'parent_name' => $parent_id, @@ -204,7 +204,7 @@ function admin_init() { // dashboard elgg_register_menu_item('page', array( 'name' => 'dashboard', - 'url' => 'pg/admin/dashboard', + 'href' => 'pg/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 e31a9f8ba..8aaf003dc 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, 'text' => $label, 'url' => $link, 'context' => $context, + $item = array('name' => $label, 'text' => $label, 'href' => $link, 'context' => $context, 'section' => $group,); if ($selected) { @@ -1251,7 +1251,7 @@ 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, 'text' => $menu_name, - 'url' => $menu_url,)); + 'href' => $menu_url,)); } /** diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index 1d3098938..5e03641a1 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -14,11 +14,11 @@ * userprofile, groupprofile, or any custom menu * @param mixed $menu_item A ElggMenuItem object or an array of options in format: * name => STR Menu item identifier (required) - * title => STR Menu item title (required) - * url => STR Menu item URL (required) + * text => STR Menu item display text (required) + * href => STR Menu item URL (required) * contexts => ARR Page context strings * section => STR Menu section identifier - * tooltip => STR Menu item tooltip + * title => STR Menu item tooltip * selected => BOOL Is this menu item currently selected * parent_name => STR Identifier of the parent menu item * diff --git a/engine/lib/user_settings.php b/engine/lib/user_settings.php index 25aa36dbd..f3e586851 100644 --- a/engine/lib/user_settings.php +++ b/engine/lib/user_settings.php @@ -254,19 +254,19 @@ function usersettings_pagesetup() { $params = array( 'name' => '1_account', 'text' => elgg_echo('usersettings:user:opt:linktext'), - 'url' => "pg/settings/user/{$user->username}", + 'href' => "pg/settings/user/{$user->username}", ); elgg_register_menu_item('page', $params); $params = array( 'name' => '1_plugins', 'text' => elgg_echo('usersettings:plugins:opt:linktext'), - 'url' => "pg/settings/plugins/{$user->username}", + 'href' => "pg/settings/plugins/{$user->username}", ); elgg_register_menu_item('page', $params); $params = array( 'name' => '1_statistics', 'text' => elgg_echo('usersettings:statistics:opt:linktext'), - 'url' => "pg/settings/statistics/{$user->username}", + 'href' => "pg/settings/statistics/{$user->username}", ); elgg_register_menu_item('page', $params); } diff --git a/engine/lib/users.php b/engine/lib/users.php index 9d1cb1ff6..8a5289a03 100644 --- a/engine/lib/users.php +++ b/engine/lib/users.php @@ -1089,13 +1089,13 @@ function collections_submenu_items() { elgg_register_menu_item('page', array( 'name' => 'friends:collections:view', 'text' => elgg_echo('friends:collections'), - 'url' => "pg/collections/$user->username", + 'href' => "pg/collections/$user->username", )); elgg_register_menu_item('page', array( 'name' => 'friends:collections:add', 'text' => elgg_echo('friends:collections:add'), - 'url' => "pg/collections/add", + 'href' => "pg/collections/add", )); } @@ -1468,7 +1468,7 @@ function users_pagesetup() { $params = array( 'name' => 'friends', 'text' => elgg_echo('friends'), - 'url' => 'pg/friends/' . elgg_get_page_owner_entity()->username, + 'href' => 'pg/friends/' . elgg_get_page_owner_entity()->username, 'contexts' => array('friends') ); elgg_register_menu_item('page', $params); @@ -1476,7 +1476,7 @@ function users_pagesetup() { $params = array( 'name' => 'friendsof', 'text' => elgg_echo('friends:of'), - 'url' => 'pg/friendsof/' . elgg_get_page_owner_entity()->username, + 'href' => 'pg/friendsof/' . elgg_get_page_owner_entity()->username, 'contexts' => array('friends') ); elgg_register_menu_item('page', $params); @@ -1509,14 +1509,14 @@ function users_init() { if ($user) { $params = array( 'name' => 'edit_avatar', - 'url' => "pg/avatar/edit/{$user->username}", + 'href' => "pg/avatar/edit/{$user->username}", '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", + 'href' => "pg/profile/{$user->username}/edit", 'text' => elgg_echo('profile:edit'), 'contexts' => array('profile_edit'), ); diff --git a/engine/lib/views.php b/engine/lib/views.php index db510a275..1ae89bac2 100644 --- a/engine/lib/views.php +++ b/engine/lib/views.php @@ -681,7 +681,7 @@ function elgg_view_menu($menu_name, array $vars = array()) { $vars['name'] = $menu_name; - $sort_by = elgg_extract('sort_by', $vars, 'title'); + $sort_by = elgg_extract('sort_by', $vars, 'text'); $menu = $CONFIG->menus[$menu_name]; diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 9f8179823..a58ec37c5 100644 --- a/mod/bookmarks/start.php +++ b/mod/bookmarks/start.php @@ -26,7 +26,7 @@ function bookmarks_init() { elgg_register_menu_item('site', array( 'name' => 'bookmarks', 'text' => elgg_echo('bookmarks'), - 'url' => 'pg/bookmarks/all' + 'href' => 'pg/bookmarks/all' )); elgg_register_plugin_hook_handler('register', 'menu:page', 'bookmarks_page_menu'); diff --git a/mod/developers/start.php b/mod/developers/start.php index f9527cd44..dd74493f4 100644 --- a/mod/developers/start.php +++ b/mod/developers/start.php @@ -48,7 +48,7 @@ function developers_theme_preview_controller($page) { elgg_register_menu_item('page', array( 'name' => $page_name, 'text' => elgg_echo("theme_preview:$page_name"), - 'url' => "pg/theme_preview/$page_name", + 'href' => "pg/theme_preview/$page_name", )); } diff --git a/mod/file/views/default/file/typecloud.php b/mod/file/views/default/file/typecloud.php index 6d329d831..c0db7932b 100644 --- a/mod/file/views/default/file/typecloud.php +++ b/mod/file/views/default/file/typecloud.php @@ -38,13 +38,13 @@ $all->tag = "all"; elgg_register_menu_item('page', array( 'name' => 'file:all', 'text' => elgg_echo('all'), - 'url' => file_type_cloud_get_url($all, $friends), + 'href' => file_type_cloud_get_url($all, $friends), )); foreach ($types as $type) { elgg_register_menu_item('page', array( 'name' => "file:$type->tag", 'text' => elgg_echo("file:type:$type->tag"), - 'url' => file_type_cloud_get_url($type, $friends), + 'href' => file_type_cloud_get_url($type, $friends), )); } diff --git a/mod/invitefriends/start.php b/mod/invitefriends/start.php index 9ab602d37..123ab7364 100644 --- a/mod/invitefriends/start.php +++ b/mod/invitefriends/start.php @@ -15,7 +15,7 @@ function invitefriends_init() { $params = array( 'name' => 'invite', 'text' => elgg_echo('friends:invite'), - 'url' => "pg/invite/", + 'href' => "pg/invite/", 'contexts' => array('friends'), ); elgg_register_menu_item('page', $params); diff --git a/mod/messages/start.php b/mod/messages/start.php index b7194d03b..44f024024 100644 --- a/mod/messages/start.php +++ b/mod/messages/start.php @@ -19,13 +19,13 @@ function messages_init() { elgg_register_menu_item('page', array( 'name' => 'messages:inbox', 'text' => elgg_echo('messages:inbox'), - 'url' => "pg/messages/inbox/" . elgg_get_logged_in_user_entity()->username, + 'href' => "pg/messages/inbox/" . elgg_get_logged_in_user_entity()->username, 'context' => 'messages', )); elgg_register_menu_item('page', array( 'name' => 'messages:sentmessages', 'text' => elgg_echo('messages:sentmessages'), - 'url' => "pg/messages/sent/" . elgg_get_logged_in_user_entity()->username, + 'href' => "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 13a21c420..b8c2aae1d 100644 --- a/mod/notifications/start.php +++ b/mod/notifications/start.php @@ -70,7 +70,7 @@ function notifications_plugin_pagesetup() { $params = array( 'name' => '2_a_user_notify', 'text' => elgg_echo('notifications:subscriptions:changesettings'), - 'url' => "pg/notifications/personal", + 'href' => "pg/notifications/personal", ); elgg_register_menu_item('page', $params); @@ -78,7 +78,7 @@ function notifications_plugin_pagesetup() { $params = array( 'name' => '2_group_notify', 'text' => elgg_echo('notifications:subscriptions:changesettings:groups'), - 'url' => "pg/notifications/group", + 'href' => "pg/notifications/group", ); elgg_register_menu_item('page', $params); } diff --git a/mod/pages/lib/pages.php b/mod/pages/lib/pages.php index c9a1b27b6..079155190 100644 --- a/mod/pages/lib/pages.php +++ b/mod/pages/lib/pages.php @@ -81,7 +81,7 @@ function pages_register_navigation_tree($container) { elgg_register_menu_item('pages_nav', array( 'name' => $page->getGUID(), 'text' => $page->title, - 'url' => $page->getURL(), + 'href' => $page->getURL(), )); $stack = array(); @@ -99,7 +99,7 @@ function pages_register_navigation_tree($container) { elgg_register_menu_item('pages_nav', array( 'name' => $child->getGUID(), 'text' => $child->title, - 'url' => $child->getURL(), + 'href' => $child->getURL(), 'parent_name' => $parent->getGUID(), )); array_push($stack, $child); |