summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-09-08 17:01:59 -0700
committerBharat Mediratta <bharat@menalto.com>2009-09-08 17:01:59 -0700
commitcf0c8b63196cb856dd8de0759f6cbb74243d41f1 (patch)
tree5cc78385c81bfd7a836d650ca9e22b0e3e8d3a29
parent2aad580f53dbc06bb170c710467b47a5a532c6c8 (diff)
Minor tweaks to the url refactor.
-rw-r--r--modules/gallery/controllers/movies.php4
-rw-r--r--modules/gallery/models/item.php16
-rw-r--r--themes/admin_default/views/admin.html.php2
3 files changed, 11 insertions, 11 deletions
diff --git a/modules/gallery/controllers/movies.php b/modules/gallery/controllers/movies.php
index 1c266cc8..04e15315 100644
--- a/modules/gallery/controllers/movies.php
+++ b/modules/gallery/controllers/movies.php
@@ -105,9 +105,9 @@ class Movies_Controller extends Items_Controller {
$photo->save();
module::event("item_edit_form_completed", $photo, $form);
- log::success("content", "Updated photo", "<a href=\"{$photo->url()}\">view</a>");
+ log::success("content", "Updated movie", "<a href=\"{$photo->url()}\">view</a>");
message::success(
- t("Saved photo %photo_title", array("photo_title" => $photo->title)));
+ t("Saved movie %movie_title", array("movie_title" => $photo->title)));
print json_encode(
array("result" => "success"));
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index 6e9debea..d2223270 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -163,14 +163,14 @@ class Item_Model extends ORM_MPTT {
}
/**
- * album: url::site("albums/2")
- * photo: url::site("photos/3")
+ * Return the server-relative url to this item, eg:
+ * /gallery3/index.php/BobsWedding?page=2
+ * /gallery3/index.php/BobsWedding/Eating-Cake.jpg
*
* @param string $query the query string (eg "show=3")
*/
public function url($query=null) {
- $relative_url = $this->relative_url();
- $url = url::site($relative_url);
+ $url = url::site($this->relative_url());
if ($query) {
$url .= "?$query";
}
@@ -178,14 +178,14 @@ class Item_Model extends ORM_MPTT {
}
/**
- * album: url::abs_site("albums/2")
- * photo: url::abs_site("photos/3")
+ * Return the full url to this item, eg:
+ * http://example.com/gallery3/index.php/BobsWedding?page=2
+ * http://example.com/gallery3/index.php/BobsWedding/Eating-Cake.jpg
*
* @param string $query the query string (eg "show=3")
*/
public function abs_url($query=null) {
- $relative_url = $this->relative_url();
- $url = url::abs_site($relative_url);
+ $url = url::abs_site($this->relative_url());
if ($query) {
$url .= "?$query";
}
diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php
index 5564484c..f77881bb 100644
--- a/themes/admin_default/views/admin.html.php
+++ b/themes/admin_default/views/admin.html.php
@@ -44,7 +44,7 @@
<?= $theme->admin_header_top() ?>
<ul id="gLoginMenu">
<li class="first"><?= html::anchor(item::root()->url(), "&larr; ".t("Back to the Gallery")) ?></li>
- <li id="gLogoutLink"><a href="<?= url::site("logout?continue=items/1&amp;csrf=$csrf") ?>"><?= t("Logout") ?></a></li>
+ <li id="gLogoutLink"><a href="<?= url::site("logout?csrf=$csrf&amp;continue=" . urlencode(item::root()->url())) ?>"><?= t("Logout") ?></a></li>
</ul>
<a id="gLogo" href="<?= item::root()->url() ?>" title="<?= t("go back to the Gallery")->for_html_attr() ?>">
&larr; <?= t("back to the ...") ?>