diff options
author | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-10 22:05:49 +0000 |
---|---|---|
committer | ewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-10 22:05:49 +0000 |
commit | adae1958a95d7e801de91d673e927cac348236d9 (patch) | |
tree | deb60ecca44c95abc5301b0d64bcd08585e85798 /mod/bookmarks | |
parent | ea14bfe87eda3af8e8002c64ad909cf592d7fe76 (diff) | |
download | elgg-adae1958a95d7e801de91d673e927cac348236d9.tar.gz elgg-adae1958a95d7e801de91d673e927cac348236d9.tar.bz2 |
Fixes #2228: Major cleanup of urls -- remove leading pg/ and trailing / from most urls in core and plugins
git-svn-id: http://code.elgg.org/elgg/trunk@8653 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/bookmarks')
-rw-r--r-- | mod/bookmarks/actions/bookmarks/delete.php | 4 | ||||
-rw-r--r-- | mod/bookmarks/actions/bookmarks/save.php | 2 | ||||
-rw-r--r-- | mod/bookmarks/pages/friends.php | 2 | ||||
-rw-r--r-- | mod/bookmarks/pages/view.php | 4 | ||||
-rw-r--r-- | mod/bookmarks/start.php | 46 | ||||
-rw-r--r-- | mod/bookmarks/views/default/bookmarks/bookmarklet.php | 2 | ||||
-rw-r--r-- | mod/bookmarks/views/default/bookmarks/group_module.php | 4 | ||||
-rw-r--r-- | mod/bookmarks/views/default/object/bookmarks.php | 2 | ||||
-rw-r--r-- | mod/bookmarks/views/default/widgets/bookmarks/content.php | 2 |
9 files changed, 34 insertions, 34 deletions
diff --git a/mod/bookmarks/actions/bookmarks/delete.php b/mod/bookmarks/actions/bookmarks/delete.php index ba89ec228..410a67bb7 100644 --- a/mod/bookmarks/actions/bookmarks/delete.php +++ b/mod/bookmarks/actions/bookmarks/delete.php @@ -13,9 +13,9 @@ if (elgg_instanceof($bookmark, 'object', 'bookmarks') && $bookmark->canEdit()) { if ($bookmark->delete()) { system_message(elgg_echo("bookmarks:delete:success")); if (elgg_instanceof($container, 'group')) { - forward("pg/bookmarks/group/$container->guid/owner"); + forward("bookmarks/group/$container->guid/owner"); } else { - forward("pg/bookmarks/owner/$container->username/"); + forward("bookmarks/owner/$container->username"); } } } diff --git a/mod/bookmarks/actions/bookmarks/save.php b/mod/bookmarks/actions/bookmarks/save.php index 2f4f7b685..19bb3c73a 100644 --- a/mod/bookmarks/actions/bookmarks/save.php +++ b/mod/bookmarks/actions/bookmarks/save.php @@ -71,5 +71,5 @@ if ($bookmark->save()) { forward($bookmark->getURL()); } else { register_error(elgg_echo('bookmarks:save:failed')); - forward("pg/bookmarks"); + forward("bookmarks"); } diff --git a/mod/bookmarks/pages/friends.php b/mod/bookmarks/pages/friends.php index dedeeb5e9..6e3f77cf6 100644 --- a/mod/bookmarks/pages/friends.php +++ b/mod/bookmarks/pages/friends.php @@ -7,7 +7,7 @@ $owner = elgg_get_page_owner_entity(); -elgg_push_breadcrumb($owner->name, "pg/bookmarks/owner/$owner->username"); +elgg_push_breadcrumb($owner->name, "bookmarks/owner/$owner->username"); elgg_push_breadcrumb(elgg_echo('friends')); $title = elgg_echo('bookmarks:friends'); diff --git a/mod/bookmarks/pages/view.php b/mod/bookmarks/pages/view.php index b5a857857..142e0b246 100644 --- a/mod/bookmarks/pages/view.php +++ b/mod/bookmarks/pages/view.php @@ -12,9 +12,9 @@ $page_owner = elgg_get_page_owner_entity(); $crumbs_title = $page_owner->name; if (elgg_instanceof($page_owner, 'group')) { - elgg_push_breadcrumb($crumbs_title, "pg/bookmarks/group/$page_owner->guid/owner"); + elgg_push_breadcrumb($crumbs_title, "bookmarks/group/$page_owner->guid/owner"); } else { - elgg_push_breadcrumb($crumbs_title, "pg/bookmarks/owner/$page_owner->username"); + elgg_push_breadcrumb($crumbs_title, "bookmarks/owner/$page_owner->username"); } $title = $bookmark->title; diff --git a/mod/bookmarks/start.php b/mod/bookmarks/start.php index 0bd2e3134..bf7e372a3 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'), - 'href' => 'pg/bookmarks/all' + 'href' => 'bookmarks/all' )); elgg_register_plugin_hook_handler('register', 'menu:page', 'bookmarks_page_menu'); @@ -45,7 +45,7 @@ function bookmarks_init() { elgg_register_menu_item('extras', array( 'name' => 'bookmark', 'text' => elgg_view_icon('bookmark'), - 'href' => "pg/bookmarks/add/$user_guid?address=$address", + 'href' => "bookmarks/add/$user_guid?address=$address", 'title' => elgg_echo('bookmarks:this'), 'rel' => 'nofollow', )); @@ -73,14 +73,14 @@ function bookmarks_init() { * Dispatcher for bookmarks. * * URLs take the form of - * All bookmarks: pg/bookmarks/all - * User's bookmarks: pg/bookmarks/owner/<username> - * Friends' bookmarks: pg/bookmarks/friends/<username> - * View bookmark: pg/bookmarks/view/<guid>/<title> - * New bookmark: pg/bookmarks/add/<guid> (container: user, group, parent) - * Edit bookmark: pg/bookmarks/edit/<guid> - * Group bookmarks: pg/bookmarks/group/<guid>/owner - * Bookmarklet: pg/bookmarks/bookmarklet/<guid> (user) + * All bookmarks: bookmarks/all + * User's bookmarks: bookmarks/owner/<username> + * Friends' bookmarks: bookmarks/friends/<username> + * View bookmark: bookmarks/view/<guid>/<title> + * New bookmark: bookmarks/add/<guid> (container: user, group, parent) + * Edit bookmark: bookmarks/edit/<guid> + * Group bookmarks: bookmarks/group/<guid>/owner + * Bookmarklet: bookmarks/bookmarklet/<guid> (user) * * Title is ignored * @@ -89,7 +89,7 @@ function bookmarks_init() { function bookmarks_page_handler($page) { elgg_load_library('elgg:bookmarks'); - elgg_push_breadcrumb(elgg_echo('bookmarks'), 'pg/bookmarks/all'); + elgg_push_breadcrumb(elgg_echo('bookmarks'), 'bookmarks/all'); elgg_push_context('bookmarks'); // old group usernames @@ -172,22 +172,22 @@ function bookmarks_url_forwarder($page) { switch ($page[1]) { case "read": - $url = "{$CONFIG->wwwroot}pg/bookmarks/view/{$page[2]}/{$page[3]}"; + $url = "{$CONFIG->wwwroot}bookmarks/view/{$page[2]}/{$page[3]}"; break; case "inbox": - $url = "{$CONFIG->wwwroot}pg/bookmarks/inbox/{$page[0]}/"; + $url = "{$CONFIG->wwwroot}bookmarks/inbox/{$page[0]}"; break; case "friends": - $url = "{$CONFIG->wwwroot}pg/bookmarks/friends/{$page[0]}/"; + $url = "{$CONFIG->wwwroot}bookmarks/friends/{$page[0]}"; break; case "add": - $url = "{$CONFIG->wwwroot}pg/bookmarks/add/{$page[0]}/"; + $url = "{$CONFIG->wwwroot}bookmarks/add/{$page[0]}"; break; case "items": - $url = "{$CONFIG->wwwroot}pg/bookmarks/owner/{$page[0]}/"; + $url = "{$CONFIG->wwwroot}bookmarks/owner/{$page[0]}"; break; case "bookmarklet": - $url = "{$CONFIG->wwwroot}pg/bookmarks/bookmarklet/{$page[0]}/"; + $url = "{$CONFIG->wwwroot}bookmarks/bookmarklet/{$page[0]}"; break; } @@ -206,7 +206,7 @@ function bookmark_url($entity) { $title = $entity->title; $title = elgg_get_friendly_title($title); - return $CONFIG->url . "pg/bookmarks/view/" . $entity->getGUID() . "/" . $title; + return $CONFIG->url . "bookmarks/view/" . $entity->getGUID() . "/" . $title; } /** @@ -214,12 +214,12 @@ function bookmark_url($entity) { */ function bookmarks_owner_block_menu($hook, $type, $return, $params) { if (elgg_instanceof($params['entity'], 'user')) { - $url = "pg/bookmarks/owner/{$params['entity']->username}"; + $url = "bookmarks/owner/{$params['entity']->username}"; $item = new ElggMenuItem('bookmarks', elgg_echo('bookmarks'), $url); $return[] = $item; } else { if ($params['entity']->bookmarks_enable != 'no') { - $url = "pg/bookmarks/group/{$params['entity']->guid}/owner"; + $url = "bookmarks/group/{$params['entity']->guid}/owner"; $item = new ElggMenuItem('bookmarks', elgg_echo('bookmarks:group'), $url); $return[] = $item; } @@ -244,7 +244,7 @@ function bookmarks_notify_message($hook, $entity_type, $returnvalue, $params) { $descr = $entity->description; $title = $entity->title; global $CONFIG; - $url = elgg_get_site_url() . "pg/view/" . $entity->guid; + $url = elgg_get_site_url() . "view/" . $entity->guid; if ($method == 'sms') { $owner = $entity->getOwnerEntity(); return $owner->name . ' ' . elgg_echo("bookmarks:via") . ': ' . $url . ' (' . $title . ')'; @@ -274,7 +274,7 @@ function bookmarks_user_hover_menu($hook, $type, $return, $params) { $user = $params['entity']; $title = elgg_echo('bookmarks'); - $url = "pg/bookmarks/owner/$user->username"; + $url = "bookmarks/owner/$user->username"; $return[] = new ElggMenuItem('bookmarks', $title, $url); return $return; @@ -299,7 +299,7 @@ function bookmarks_page_menu($hook, $type, $return, $params) { $title = elgg_echo('bookmarks:bookmarklet'); } - $return[] = new ElggMenuItem('bookmarklet', $title, 'pg/bookmarks/bookmarklet/' . $page_owner->getGUID()); + $return[] = new ElggMenuItem('bookmarklet', $title, 'bookmarks/bookmarklet/' . $page_owner->getGUID()); } } diff --git a/mod/bookmarks/views/default/bookmarks/bookmarklet.php b/mod/bookmarks/views/default/bookmarks/bookmarklet.php index 091a15997..1d0b25498 100644 --- a/mod/bookmarks/views/default/bookmarks/bookmarklet.php +++ b/mod/bookmarks/views/default/bookmarks/bookmarklet.php @@ -21,7 +21,7 @@ if (!$name && ($user = elgg_get_logged_in_user_entity())) { $url = elgg_get_site_url(); -$bookmarklet = "<a href=\"javascript:location.href='{$url}pg/bookmarks/add/$guid?address='" +$bookmarklet = "<a href=\"javascript:location.href='{$url}bookmarks/add/$guid?address='" . "+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)\">" . "<img src=\"{$url}mod/bookmarks/graphics/bookmarklet.gif\" alt=\"$title\" /> </a>"; diff --git a/mod/bookmarks/views/default/bookmarks/group_module.php b/mod/bookmarks/views/default/bookmarks/group_module.php index 202f87783..ea1358aeb 100644 --- a/mod/bookmarks/views/default/bookmarks/group_module.php +++ b/mod/bookmarks/views/default/bookmarks/group_module.php @@ -12,7 +12,7 @@ if ($group->bookmarks_enable == "no") { } $all_link = elgg_view('output/url', array( - 'href' => "pg/bookmarks/group/$group->guid/owner", + 'href' => "bookmarks/group/$group->guid/owner", 'text' => elgg_echo('link:view:all'), )); @@ -36,7 +36,7 @@ if (!$content) { } $new_link = elgg_view('output/url', array( - 'href' => "pg/bookmarks/add/$group->guid", + 'href' => "bookmarks/add/$group->guid", 'text' => elgg_echo('bookmarks:add'), )); $content .= "<span class='elgg-widget-more'>$new_link</span>"; diff --git a/mod/bookmarks/views/default/object/bookmarks.php b/mod/bookmarks/views/default/object/bookmarks.php index 8a4b982e1..9ee564173 100644 --- a/mod/bookmarks/views/default/object/bookmarks.php +++ b/mod/bookmarks/views/default/object/bookmarks.php @@ -21,7 +21,7 @@ $link = filter_tags(elgg_view('output/url', array('href' => $bookmark->address)) $description = elgg_view('output/longtext', array('value' => $bookmark->description, 'class' => 'pbl')); $owner_link = elgg_view('output/url', array( - 'href' => "pg/bookmarks/owner/$owner->username", + 'href' => "bookmarks/owner/$owner->username", 'text' => $owner->name, )); $author_text = elgg_echo('byline', array($owner_link)); diff --git a/mod/bookmarks/views/default/widgets/bookmarks/content.php b/mod/bookmarks/views/default/widgets/bookmarks/content.php index 5f9f469d1..ea7816345 100644 --- a/mod/bookmarks/views/default/widgets/bookmarks/content.php +++ b/mod/bookmarks/views/default/widgets/bookmarks/content.php @@ -20,7 +20,7 @@ $content = elgg_list_entities($options); echo $content; if ($content) { - $url = "pg/bookmarks/owner/" . elgg_get_page_owner_entity()->username; + $url = "bookmarks/owner/" . elgg_get_page_owner_entity()->username; $more_link = elgg_view('output/url', array( 'href' => $url, 'text' => elgg_echo('bookmarks:more'), |