summaryrefslogtreecommitdiff
path: root/core/models
diff options
context:
space:
mode:
Diffstat (limited to 'core/models')
-rw-r--r--core/models/item.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/models/item.php b/core/models/item.php
index 6f56e726..a684b713 100644
--- a/core/models/item.php
+++ b/core/models/item.php
@@ -105,13 +105,19 @@ class Item_Model extends ORM_MPTT {
/**
* album: url::site("albums/2")
* photo: url::site("photos/3")
+ *
+ * @param string $query the query string (eg "show=3")
*/
- public function url() {
+ public function url($query=array()) {
if ($this->is_album()) {
- return url::site("albums/$this->id");
+ $url = url::site("albums/$this->id");
} else {
- return url::site("photos/$this->id");
+ $url = url::site("photos/$this->id");
+ }
+ if ($query) {
+ $url .= "?$query";
}
+ return $url;
}
/**