aboutsummaryrefslogtreecommitdiff
path: root/mod/blog
diff options
context:
space:
mode:
authorewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-10 22:05:49 +0000
committerewinslow <ewinslow@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-10 22:05:49 +0000
commitadae1958a95d7e801de91d673e927cac348236d9 (patch)
treedeb60ecca44c95abc5301b0d64bcd08585e85798 /mod/blog
parentea14bfe87eda3af8e8002c64ad909cf592d7fe76 (diff)
downloadelgg-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/blog')
-rw-r--r--mod/blog/actions/blog/delete.php4
-rw-r--r--mod/blog/actions/blog/save.php2
-rw-r--r--mod/blog/lib/blog.php22
-rw-r--r--mod/blog/start.php28
-rw-r--r--mod/blog/views/default/blog/group_module.php4
-rw-r--r--mod/blog/views/default/blog/sidebar/archives.php2
-rw-r--r--mod/blog/views/default/blog/sidebar/revisions.php2
-rw-r--r--mod/blog/views/default/object/blog.php2
-rw-r--r--mod/blog/views/default/widgets/blog/content.php2
9 files changed, 34 insertions, 34 deletions
diff --git a/mod/blog/actions/blog/delete.php b/mod/blog/actions/blog/delete.php
index 64179e09c..6028480ff 100644
--- a/mod/blog/actions/blog/delete.php
+++ b/mod/blog/actions/blog/delete.php
@@ -13,9 +13,9 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {
if ($blog->delete()) {
system_message(elgg_echo('blog:message:deleted_post'));
if (elgg_instanceof($container, 'group')) {
- forward("pg/blog/group/$container->guid/owner");
+ forward("blog/group/$container->guid/owner");
} else {
- forward("pg/blog/owner/$container->username/");
+ forward("blog/owner/$container->username");
}
} else {
register_error(elgg_echo('blog:error:cannot_delete_post'));
diff --git a/mod/blog/actions/blog/save.php b/mod/blog/actions/blog/save.php
index 099a89cc0..3f9e5e355 100644
--- a/mod/blog/actions/blog/save.php
+++ b/mod/blog/actions/blog/save.php
@@ -157,7 +157,7 @@ if (!$error) {
if ($blog->status == 'published') {
forward($blog->getURL());
} else {
- forward("pg/blog/edit/$blog->guid");
+ forward("blog/edit/$blog->guid");
}
} else {
register_error(elgg_echo('blog:error:cannot_save'));
diff --git a/mod/blog/lib/blog.php b/mod/blog/lib/blog.php
index 0a2c3a8ac..81d06ca0a 100644
--- a/mod/blog/lib/blog.php
+++ b/mod/blog/lib/blog.php
@@ -32,9 +32,9 @@ function blog_get_page_content_read($guid = NULL) {
$container = $blog->getContainerEntity();
$crumbs_title = $container->name;
if (elgg_instanceof($container, 'group')) {
- elgg_push_breadcrumb($crumbs_title, "pg/blog/group/$container->guid/owner");
+ elgg_push_breadcrumb($crumbs_title, "blog/group/$container->guid/owner");
} else {
- elgg_push_breadcrumb($crumbs_title, "pg/blog/owner/$container->username");
+ elgg_push_breadcrumb($crumbs_title, "blog/owner/$container->username");
}
elgg_push_breadcrumb($blog->title);
@@ -88,7 +88,7 @@ function blog_get_page_content_list($container_guid = NULL) {
if (elgg_instanceof($container, 'group')) {
$return['filter'] = '';
if ($container->isMember(elgg_get_logged_in_user_entity())) {
- $url = "pg/blog/add/$container->guid";
+ $url = "blog/add/$container->guid";
$params = array(
'href' => $url,
'text' => elgg_echo("blog:add"),
@@ -137,7 +137,7 @@ function blog_get_page_content_friends($user_guid) {
$return['title'] = elgg_echo('blog:title:friends');
$crumbs_title = $user->name;
- elgg_push_breadcrumb($crumbs_title, "pg/blog/owner/{$user->username}");
+ elgg_push_breadcrumb($crumbs_title, "blog/owner/{$user->username}");
elgg_push_breadcrumb(elgg_echo('friends'));
if (!$friends = get_user_friends($user_guid, ELGG_ENTITIES_ANY_VALUE, 0)) {
@@ -193,7 +193,7 @@ function blog_get_page_content_archive($owner_guid, $lower = 0, $upper = 0) {
elgg_set_page_owner_guid($owner_guid);
$crumbs_title = $user->name;
- elgg_push_breadcrumb($crumbs_title, "pg/blog/owner/{$user->username}");
+ elgg_push_breadcrumb($crumbs_title, "blog/owner/{$user->username}");
elgg_push_breadcrumb(elgg_echo('blog:archives'));
if ($lower) {
@@ -405,7 +405,7 @@ function blog_url_forwarder($page) {
$guid = $matches[1];
$entity = get_entity($guid);
if ($entity) {
- $url = "{$CONFIG->wwwroot}pg/blog/group/$guid/owner";
+ $url = "{$CONFIG->wwwroot}blog/group/$guid/owner";
register_error(elgg_echo("changebookmark"));
forward($url);
}
@@ -423,19 +423,19 @@ function blog_url_forwarder($page) {
switch ($page[1]) {
case "read":
- $url = "{$CONFIG->wwwroot}pg/blog/view/{$page[2]}/{$page[3]}";
+ $url = "{$CONFIG->wwwroot}blog/view/{$page[2]}/{$page[3]}";
break;
case "archive":
- $url = "{$CONFIG->wwwroot}pg/blog/archive/{$page[0]}/{$page[2]}/{$page[3]}";
+ $url = "{$CONFIG->wwwroot}blog/archive/{$page[0]}/{$page[2]}/{$page[3]}";
break;
case "friends":
- $url = "{$CONFIG->wwwroot}pg/blog/friends/{$page[0]}";
+ $url = "{$CONFIG->wwwroot}blog/friends/{$page[0]}";
break;
case "new":
- $url = "{$CONFIG->wwwroot}pg/blog/add/$user->guid";
+ $url = "{$CONFIG->wwwroot}blog/add/$user->guid";
break;
case "owner":
- $url = "{$CONFIG->wwwroot}pg/blog/owner/{$page[0]}";
+ $url = "{$CONFIG->wwwroot}blog/owner/{$page[0]}";
break;
}
diff --git a/mod/blog/start.php b/mod/blog/start.php
index 344da21d4..01d78b4dd 100644
--- a/mod/blog/start.php
+++ b/mod/blog/start.php
@@ -22,7 +22,7 @@ function blog_init() {
elgg_register_library('elgg:blog', elgg_get_plugins_path() . 'blog/lib/blog.php');
// add a site navigation item
- $item = new ElggMenuItem('blog', elgg_echo('blog:blogs'), 'pg/blog/all');
+ $item = new ElggMenuItem('blog', elgg_echo('blog:blogs'), 'blog/all');
elgg_register_menu_item('site', $item);
elgg_register_event_handler('upgrade', 'upgrade', 'blog_run_upgrades');
@@ -73,15 +73,15 @@ function blog_init() {
/**
* Dispatches blog pages.
* URLs take the form of
- * All blogs: pg/blog/all
- * User's blogs: pg/blog/owner/<username>
- * Friends' blog: pg/blog/friends/<username>
- * User's archives: pg/blog/archives/<username>/<time_start>/<time_stop>
- * Blog post: pg/blog/view/<guid>/<title>
- * New post: pg/blog/add/<guid>
- * Edit post: pg/blog/edit/<guid>/<revision>
- * Preview post: pg/blog/preview/<guid>
- * Group blog: pg/blog/group/<guid>/owner
+ * All blogs: blog/all
+ * User's blogs: blog/owner/<username>
+ * Friends' blog: blog/friends/<username>
+ * User's archives: blog/archives/<username>/<time_start>/<time_stop>
+ * Blog post: blog/view/<guid>/<title>
+ * New post: blog/add/<guid>
+ * Edit post: blog/edit/<guid>/<revision>
+ * Preview post: blog/preview/<guid>
+ * Group blog: blog/group/<guid>/owner
*
* Title is ignored
*
@@ -99,7 +99,7 @@ function blog_page_handler($page) {
blog_url_forwarder($page);
// push all blogs breadcrumb
- elgg_push_breadcrumb(elgg_echo('blog:blogs'), "pg/blog/all/");
+ elgg_push_breadcrumb(elgg_echo('blog:blogs'), "blog/all");
if (!isset($page[0])) {
$page[0] = 'all';
@@ -161,7 +161,7 @@ function blog_url_handler($entity) {
$friendly_title = elgg_get_friendly_title($entity->title);
- return "pg/blog/view/{$entity->guid}/$friendly_title";
+ return "blog/view/{$entity->guid}/$friendly_title";
}
/**
@@ -169,12 +169,12 @@ function blog_url_handler($entity) {
*/
function blog_owner_block_menu($hook, $type, $return, $params) {
if (elgg_instanceof($params['entity'], 'user')) {
- $url = "pg/blog/owner/{$params['entity']->username}";
+ $url = "blog/owner/{$params['entity']->username}";
$item = new ElggMenuItem('blog', elgg_echo('blog'), $url);
$return[] = $item;
} else {
if ($params['entity']->blog_enable != "no") {
- $url = "pg/blog/group/{$params['entity']->guid}/owner";
+ $url = "blog/group/{$params['entity']->guid}/owner";
$item = new ElggMenuItem('blog', elgg_echo('blog:group'), $url);
$return[] = $item;
}
diff --git a/mod/blog/views/default/blog/group_module.php b/mod/blog/views/default/blog/group_module.php
index 312c89c0c..14d41f07a 100644
--- a/mod/blog/views/default/blog/group_module.php
+++ b/mod/blog/views/default/blog/group_module.php
@@ -10,7 +10,7 @@ if ($group->blog_enable == "no") {
}
$all_link = elgg_view('output/url', array(
- 'href' => "pg/blog/group/$group->guid/owner",
+ 'href' => "blog/group/$group->guid/owner",
'text' => elgg_echo('link:view:all'),
));
@@ -35,7 +35,7 @@ if (!$content) {
}
$new_link = elgg_view('output/url', array(
- 'href' => "pg/blog/add/$group->guid",
+ 'href' => "blog/add/$group->guid",
'text' => elgg_echo('blog:write'),
));
$content .= "<span class='elgg-widget-more'>$new_link</span>";
diff --git a/mod/blog/views/default/blog/sidebar/archives.php b/mod/blog/views/default/blog/sidebar/archives.php
index 5eda64afb..3aa3db44f 100644
--- a/mod/blog/views/default/blog/sidebar/archives.php
+++ b/mod/blog/views/default/blog/sidebar/archives.php
@@ -17,7 +17,7 @@ if ($page_owner && $vars['page'] != 'friends') {
$timestamplow = mktime(0, 0, 0, substr($date,4,2) , 1, substr($date, 0, 4));
$timestamphigh = mktime(0, 0, 0, ((int) substr($date, 4, 2)) + 1, 1, substr($date, 0, 4));
- $link = elgg_get_site_url() . 'pg/blog/archive/' . $page_owner->username . '/' . $timestamplow . '/' . $timestamphigh;
+ $link = elgg_get_site_url() . 'blog/archive/' . $page_owner->username . '/' . $timestamplow . '/' . $timestamphigh;
$month = elgg_echo('date:month:' . substr($date, 4, 2), array(substr($date, 0, 4)));
$content .= "<li><a href=\"$link\" title=\"$month\">$month</a></li>";
}
diff --git a/mod/blog/views/default/blog/sidebar/revisions.php b/mod/blog/views/default/blog/sidebar/revisions.php
index 01eab01c4..e19516f71 100644
--- a/mod/blog/views/default/blog/sidebar/revisions.php
+++ b/mod/blog/views/default/blog/sidebar/revisions.php
@@ -33,7 +33,7 @@ if (elgg_instanceof($blog, 'object', 'blog') && $blog->canEdit()) {
$n = count($revisions);
$body = '<ul class="blog-revisions">';
- $load_base_url = "pg/blog/edit/{$blog->getGUID()}/";
+ $load_base_url = "blog/edit/{$blog->getGUID()}";
// show the "published revision"
if ($blog->status == 'published') {
diff --git a/mod/blog/views/default/object/blog.php b/mod/blog/views/default/object/blog.php
index 9687e8f34..c5425056e 100644
--- a/mod/blog/views/default/object/blog.php
+++ b/mod/blog/views/default/object/blog.php
@@ -19,7 +19,7 @@ $excerpt = $blog->excerpt;
$owner_icon = elgg_view_entity_icon($owner, 'tiny');
$owner_link = elgg_view('output/url', array(
- 'href' => "pg/blog/owner/$owner->username",
+ 'href' => "blog/owner/$owner->username",
'text' => $owner->name,
));
$author_text = elgg_echo('byline', array($owner_link));
diff --git a/mod/blog/views/default/widgets/blog/content.php b/mod/blog/views/default/widgets/blog/content.php
index 713c0f07d..7bbfc3c74 100644
--- a/mod/blog/views/default/widgets/blog/content.php
+++ b/mod/blog/views/default/widgets/blog/content.php
@@ -18,7 +18,7 @@ $content = elgg_list_entities($options);
echo $content;
if ($content) {
- $blog_url = "pg/blog/owner/" . elgg_get_page_owner_entity()->username;
+ $blog_url = "blog/owner/" . elgg_get_page_owner_entity()->username;
$more_link = elgg_view('output/url', array(
'href' => $blog_url,
'text' => elgg_echo('blog:moreblogs'),