summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers')
-rw-r--r--modules/gallery/controllers/admin_themes.php4
-rw-r--r--modules/gallery/controllers/after_install.php2
-rw-r--r--modules/gallery/controllers/albums.php16
-rw-r--r--modules/gallery/controllers/move.php2
-rw-r--r--modules/gallery/controllers/movies.php2
-rw-r--r--modules/gallery/controllers/photos.php2
-rw-r--r--modules/gallery/controllers/quick.php2
7 files changed, 15 insertions, 15 deletions
diff --git a/modules/gallery/controllers/admin_themes.php b/modules/gallery/controllers/admin_themes.php
index da001c55..24f91aba 100644
--- a/modules/gallery/controllers/admin_themes.php
+++ b/modules/gallery/controllers/admin_themes.php
@@ -38,7 +38,7 @@ class Admin_Themes_Controller extends Admin_Controller {
$theme_info = new ArrayObject(parse_ini_file($file), ArrayObject::ARRAY_AS_PROPS);
$theme_info->description = t($theme_info->description);
$theme_info->name = t($theme_info->name);
-
+
$themes[$theme_name] = $theme_info;
}
return $themes;
@@ -54,7 +54,7 @@ class Admin_Themes_Controller extends Admin_Controller {
if ($type == "admin") {
$view->url = url::site("admin?theme=$theme_name");
} else {
- $view->url = url::site("albums/1?theme=$theme_name");
+ $view->url = item::root()->url("theme=$theme_name");
}
print $view;
}
diff --git a/modules/gallery/controllers/after_install.php b/modules/gallery/controllers/after_install.php
index f066afe4..b640092f 100644
--- a/modules/gallery/controllers/after_install.php
+++ b/modules/gallery/controllers/after_install.php
@@ -20,7 +20,7 @@
class After_Install_Controller extends Controller {
public function index() {
if (!user::active()->admin) {
- url::redirect("albums/1");
+ url::redirect(item::root()->url());
}
$v = new View("after_install.html");
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index b7a9f339..abcabfa6 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -42,9 +42,9 @@ class Albums_Controller extends Items_Controller {
$index = $album->get_position($show);
$page = ceil($index / $page_size);
if ($page == 1) {
- url::redirect("albums/$album->id");
+ url::redirect($album->url());
} else {
- url::redirect("albums/$album->id?page=$page");
+ url::redirect($album->url("page=$page"));
}
}
@@ -55,9 +55,9 @@ class Albums_Controller extends Items_Controller {
// Make sure that the page references a valid offset
if ($page < 1) {
- url::redirect("albums/$album->id");
+ url::redirect($album->url());
} else if ($page > $max_pages) {
- url::redirect("albums/$album->id?page=$max_pages");
+ url::redirect($album->url("page=$max_pages"));
}
$template = new Theme_View("page.html", "album");
@@ -116,8 +116,8 @@ class Albums_Controller extends Items_Controller {
print json_encode(
array("result" => "success",
- "location" => url::site("albums/$new_album->id"),
- "resource" => url::site("albums/$new_album->id")));
+ "location" => $new_album->url(),
+ "resource" => $new_album->url()));
} else {
print json_encode(
array(
@@ -149,8 +149,8 @@ class Albums_Controller extends Items_Controller {
print json_encode(
array("result" => "success",
- "resource" => url::site("photos/$photo->id"),
- "location" => url::site("photos/$photo->id")));
+ "resource" => $photo->url(),
+ "location" => $photo->url()));
} else {
print json_encode(
array("result" => "error",
diff --git a/modules/gallery/controllers/move.php b/modules/gallery/controllers/move.php
index 93ef05a6..87b73436 100644
--- a/modules/gallery/controllers/move.php
+++ b/modules/gallery/controllers/move.php
@@ -43,7 +43,7 @@ class Move_Controller extends Controller {
print json_encode(
array("result" => "success",
- "location" => url::site("albums/{$target->id}")));
+ "location" => $target->url()));
}
public function show_sub_tree($source_id, $target_id) {
diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php
index c549dbf8..1c266cc8 100644
--- a/modules/gallery/controllers/movies.php
+++ b/modules/gallery/controllers/movies.php
@@ -105,7 +105,7 @@ class Movies_Controller extends Items_Controller {
$photo->save();
module::event("item_edit_form_completed", $photo, $form);
- log::success("content", "Updated photo", "<a href=\"photos/$photo->id\">view</a>");
+ log::success("content", "Updated photo", "<a href=\"{$photo->url()}\">view</a>");
message::success(
t("Saved photo %photo_title", array("photo_title" => $photo->title)));
diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php
index 959097b2..79ad674a 100644
--- a/modules/gallery/controllers/photos.php
+++ b/modules/gallery/controllers/photos.php
@@ -97,7 +97,7 @@ class Photos_Controller extends Items_Controller {
$photo->save();
module::event("item_edit_form_completed", $photo, $form);
- log::success("content", "Updated photo", "<a href=\"photos/$photo->id\">view</a>");
+ log::success("content", "Updated photo", "<a href=\"{$photo->url()}\">view</a>");
message::success(
t("Saved photo %photo_title",
array("photo_title" => html::purify($photo->title))));
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php
index 20731f9c..2ac54754 100644
--- a/modules/gallery/controllers/quick.php
+++ b/modules/gallery/controllers/quick.php
@@ -121,7 +121,7 @@ class Quick_Controller extends Controller {
print json_encode(array("result" => "success", "reload" => 1));
} else {
print json_encode(array("result" => "success",
- "location" => url::site("albums/$parent->id")));
+ "location" => $parent->url()));
}
}