aboutsummaryrefslogtreecommitdiff
path: root/mod/file
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/file
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/file')
-rw-r--r--mod/file/actions/file/delete.php6
-rw-r--r--mod/file/actions/file/upload.php4
-rw-r--r--mod/file/edit.php2
-rw-r--r--mod/file/friends.php4
-rw-r--r--mod/file/index.php4
-rw-r--r--mod/file/search.php8
-rw-r--r--mod/file/start.php24
-rw-r--r--mod/file/upload.php6
-rw-r--r--mod/file/view.php6
-rw-r--r--mod/file/views/default/file/embed_upload.php2
-rw-r--r--mod/file/views/default/file/group_module.php4
-rw-r--r--mod/file/views/default/object/file.php2
-rw-r--r--mod/file/views/default/widgets/filerepo/content.php2
13 files changed, 37 insertions, 37 deletions
diff --git a/mod/file/actions/file/delete.php b/mod/file/actions/file/delete.php
index fe03e5077..622d02277 100644
--- a/mod/file/actions/file/delete.php
+++ b/mod/file/actions/file/delete.php
@@ -10,7 +10,7 @@ $guid = (int) get_input('guid');
$file = new FilePluginFile($guid);
if (!$file->guid) {
register_error(elgg_echo("file:deletefailed"));
- forward('pg/file/all');
+ forward('file/all');
}
if (!$file->canEdit()) {
@@ -27,7 +27,7 @@ if (!$file->delete()) {
}
if (elgg_instanceof($container, 'group')) {
- forward("pg/file/group/$container->guid/owner");
+ forward("file/group/$container->guid/owner");
} else {
- forward("pg/file/owner/$container->username");
+ forward("file/owner/$container->username");
}
diff --git a/mod/file/actions/file/upload.php b/mod/file/actions/file/upload.php
index 2749812d5..4deaabcac 100644
--- a/mod/file/actions/file/upload.php
+++ b/mod/file/actions/file/upload.php
@@ -187,9 +187,9 @@ if ($new_file) {
if (!$ajax) {
$container = get_entity($container_guid);
if (elgg_instanceof($container, 'group')) {
- forward("pg/file/group/$container->guid/owner");
+ forward("file/group/$container->guid/owner");
} else {
- forward("pg/file/owner/$container->username");
+ forward("file/owner/$container->username");
}
}
diff --git a/mod/file/edit.php b/mod/file/edit.php
index 12e910a26..66529af0b 100644
--- a/mod/file/edit.php
+++ b/mod/file/edit.php
@@ -20,7 +20,7 @@ if (!$file->canEdit()) {
$title = elgg_echo('file:edit');
-elgg_push_breadcrumb(elgg_echo('file'), "pg/file/all/");
+elgg_push_breadcrumb(elgg_echo('file'), "file/all");
elgg_push_breadcrumb($file->title, $file->getURL());
elgg_push_breadcrumb($title);
diff --git a/mod/file/friends.php b/mod/file/friends.php
index dada7494e..65fc66f62 100644
--- a/mod/file/friends.php
+++ b/mod/file/friends.php
@@ -7,8 +7,8 @@
$owner = elgg_get_page_owner_entity();
-elgg_push_breadcrumb(elgg_echo('file'), "pg/file/all/");
-elgg_push_breadcrumb($owner->name, "pg/file/owner/$owner->username");
+elgg_push_breadcrumb(elgg_echo('file'), "file/all");
+elgg_push_breadcrumb($owner->name, "file/owner/$owner->username");
elgg_push_breadcrumb(elgg_echo('friends'));
diff --git a/mod/file/index.php b/mod/file/index.php
index de2e46408..44382ce02 100644
--- a/mod/file/index.php
+++ b/mod/file/index.php
@@ -10,7 +10,7 @@ group_gatekeeper();
$owner = elgg_get_page_owner_entity();
-elgg_push_breadcrumb(elgg_echo('file'), "pg/file/all/");
+elgg_push_breadcrumb(elgg_echo('file'), "file/all");
elgg_push_breadcrumb($owner->name);
$params = array();
@@ -30,7 +30,7 @@ if ($owner->guid == elgg_get_logged_in_user_guid()) {
$title = elgg_echo("file:user", array($owner->name));
$params['filter'] = '';
if ($owner->isMember(elgg_get_logged_in_user_entity())) {
- $url = "pg/file/add/$owner->guid";
+ $url = "file/add/$owner->guid";
$vars = array(
'href' => $url,
'text' => elgg_echo("file:add"),
diff --git a/mod/file/search.php b/mod/file/search.php
index b7f82e951..bcaa2cad9 100644
--- a/mod/file/search.php
+++ b/mod/file/search.php
@@ -24,16 +24,16 @@ $friends = get_input('friends', false);
// breadcrumbs
-elgg_push_breadcrumb(elgg_echo('file'), "pg/file/all/");
+elgg_push_breadcrumb(elgg_echo('file'), "file/all");
if ($owner) {
if (elgg_instanceof($owner, 'user')) {
- elgg_push_breadcrumb($owner->name, "pg/file/owner/$owner->username");
+ elgg_push_breadcrumb($owner->name, "file/owner/$owner->username");
} else {
- elgg_push_breadcrumb($owner->name, "pg/file/group/$owner->guid/owner");
+ elgg_push_breadcrumb($owner->name, "file/group/$owner->guid/owner");
}
}
if ($friends && $owner) {
- elgg_push_breadcrumb(elgg_echo('friends'), "pg/file/friends/$owner->username");
+ elgg_push_breadcrumb(elgg_echo('friends'), "file/friends/$owner->username");
}
if ($tag) {
elgg_push_breadcrumb(elgg_echo("file:type:$tag"));
diff --git a/mod/file/start.php b/mod/file/start.php
index c2f445d5d..f7642c166 100644
--- a/mod/file/start.php
+++ b/mod/file/start.php
@@ -16,7 +16,7 @@ function file_init() {
elgg_register_library('elgg:file', elgg_get_plugins_path() . 'file/lib/file.php');
// Site navigation
- $item = new ElggMenuItem('file', elgg_echo('file'), 'pg/file/all');
+ $item = new ElggMenuItem('file', elgg_echo('file'), 'file/all');
elgg_register_menu_item('site', $item);
// Extend CSS
@@ -67,13 +67,13 @@ function file_init() {
/**
* Dispatches file pages.
* URLs take the form of
- * All files: pg/file/all
- * User's files: pg/file/owner/<username>
- * Friends' files: pg/file/friends/<username>
- * View file: pg/file/view/<guid>/<title>
- * New file: pg/file/add/<guid>
- * Edit file: pg/file/edit/<guid>
- * Group files: pg/file/group/<guid>/owner
+ * All files: file/all
+ * User's files: file/owner/<username>
+ * Friends' files: file/friends/<username>
+ * View file: file/view/<guid>/<title>
+ * New file: file/add/<guid>
+ * Edit file: file/edit/<guid>
+ * Group files: file/group/<guid>/owner
*
* Title is ignored
*
@@ -132,7 +132,7 @@ function file_notify_message($hook, $entity_type, $returnvalue, $params) {
if (($entity instanceof ElggEntity) && ($entity->getSubtype() == 'file')) {
$descr = $entity->description;
$title = $entity->title;
- $url = elgg_get_site_url() . "pg/view/" . $entity->guid;
+ $url = elgg_get_site_url() . "view/" . $entity->guid;
$owner = $entity->getOwnerEntity();
return $owner->name . ' ' . elgg_echo("file:via") . ': ' . $entity->title . "\n\n" . $descr . "\n\n" . $entity->getURL();
}
@@ -144,12 +144,12 @@ function file_notify_message($hook, $entity_type, $returnvalue, $params) {
*/
function file_owner_block_menu($hook, $type, $return, $params) {
if (elgg_instanceof($params['entity'], 'user')) {
- $url = "pg/file/owner/{$params['entity']->username}";
+ $url = "file/owner/{$params['entity']->username}";
$item = new ElggMenuItem('file', elgg_echo('file'), $url);
$return[] = $item;
} else {
if ($params['entity']->files_enable != "no") {
- $url = "pg/file/group/{$params['entity']->guid}/owner";
+ $url = "file/group/{$params['entity']->guid}/owner";
$item = new ElggMenuItem('file', elgg_echo('file:group'), $url);
$return[] = $item;
}
@@ -261,7 +261,7 @@ function get_filetype_cloud($owner_guid = "", $friends = false) {
function file_url_override($entity) {
$title = $entity->title;
$title = elgg_get_friendly_title($title);
- return "pg/file/view/" . $entity->getGUID() . "/" . $title;
+ return "file/view/" . $entity->getGUID() . "/" . $title;
}
/**
diff --git a/mod/file/upload.php b/mod/file/upload.php
index 9f0220b95..c19522530 100644
--- a/mod/file/upload.php
+++ b/mod/file/upload.php
@@ -15,11 +15,11 @@ group_gatekeeper();
$title = elgg_echo('file:add');
// set up breadcrumbs
-elgg_push_breadcrumb(elgg_echo('file'), "pg/file/all/");
+elgg_push_breadcrumb(elgg_echo('file'), "file/all");
if (elgg_instanceof($owner, 'user')) {
- elgg_push_breadcrumb($owner->name, "pg/file/owner/$owner->username");
+ elgg_push_breadcrumb($owner->name, "file/owner/$owner->username");
} else {
- elgg_push_breadcrumb($owner->name, "pg/file/group/$owner->guid/owner");
+ elgg_push_breadcrumb($owner->name, "file/group/$owner->guid/owner");
}
elgg_push_breadcrumb($title);
diff --git a/mod/file/view.php b/mod/file/view.php
index 9e89fbd56..1d7c27337 100644
--- a/mod/file/view.php
+++ b/mod/file/view.php
@@ -9,13 +9,13 @@ $file = get_entity(get_input('guid'));
$owner = elgg_get_page_owner_entity();
-elgg_push_breadcrumb(elgg_echo('file'), 'pg/file/all');
+elgg_push_breadcrumb(elgg_echo('file'), 'file/all');
$crumbs_title = $owner->name;
if (elgg_instanceof($owner, 'group')) {
- elgg_push_breadcrumb($crumbs_title, "pg/file/group/$owner->guid/owner");
+ elgg_push_breadcrumb($crumbs_title, "file/group/$owner->guid/owner");
} else {
- elgg_push_breadcrumb($crumbs_title, "pg/file/owner/$owner->username");
+ elgg_push_breadcrumb($crumbs_title, "file/owner/$owner->username");
}
$title = $file->title;
diff --git a/mod/file/views/default/file/embed_upload.php b/mod/file/views/default/file/embed_upload.php
index 8536acd77..9014809c1 100644
--- a/mod/file/views/default/file/embed_upload.php
+++ b/mod/file/views/default/file/embed_upload.php
@@ -17,7 +17,7 @@ $(document).ready(function() {
var info = jQuery.parseJSON(data);
if (info.status == 'success') {
- $('.popup .content').load('<?php echo elgg_get_site_url() . 'pg/embed/embed'; ?>?active_section=file');
+ $('.popup .content').load('<?php echo elgg_get_site_url() . 'embed/embed'; ?>?active_section=file');
} else {
$('.popup .content').find('form').prepend('<p>' + info.message + '</p>');
}
diff --git a/mod/file/views/default/file/group_module.php b/mod/file/views/default/file/group_module.php
index c3ca5cf9e..c82e499ec 100644
--- a/mod/file/views/default/file/group_module.php
+++ b/mod/file/views/default/file/group_module.php
@@ -10,7 +10,7 @@ if ($group->file_enable == "no") {
}
$all_link = elgg_view('output/url', array(
- 'href' => "pg/file/group/$group->guid/owner",
+ 'href' => "file/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/file/add/$group->guid",
+ 'href' => "file/add/$group->guid",
'text' => elgg_echo('file:add'),
));
$content .= "<span class='elgg-widget-more'>$new_link</span>";
diff --git a/mod/file/views/default/object/file.php b/mod/file/views/default/object/file.php
index 75c72e2b5..2c2a5f3af 100644
--- a/mod/file/views/default/object/file.php
+++ b/mod/file/views/default/object/file.php
@@ -22,7 +22,7 @@ $base_type = substr($mime, 0, strpos($mime,'/'));
$body = elgg_view('output/longtext', array('value' => $file->description));
$owner_link = elgg_view('output/url', array(
- 'href' => "pg/file/owner/$owner->username",
+ 'href' => "file/owner/$owner->username",
'text' => $owner->name,
));
$author_text = elgg_echo('byline', array($owner_link));
diff --git a/mod/file/views/default/widgets/filerepo/content.php b/mod/file/views/default/widgets/filerepo/content.php
index d3deece56..4288b9e56 100644
--- a/mod/file/views/default/widgets/filerepo/content.php
+++ b/mod/file/views/default/widgets/filerepo/content.php
@@ -21,7 +21,7 @@ $content = elgg_list_entities($options);
echo $content;
if ($content) {
- $url = "pg/file/owner/" . elgg_get_page_owner_entity()->username;
+ $url = "file/owner/" . elgg_get_page_owner_entity()->username;
$more_link = elgg_view('output/url', array(
'href' => $url,
'text' => elgg_echo('file:more'),