summaryrefslogtreecommitdiff
path: root/core/models/item.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/models/item.php')
-rw-r--r--core/models/item.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/models/item.php b/core/models/item.php
index a419c2f1..ffdaa7e9 100644
--- a/core/models/item.php
+++ b/core/models/item.php
@@ -103,6 +103,18 @@ class Item_Model extends ORM_MPTT {
}
/**
+ * album: url::site("albums/2")
+ * photo: url::site("photos/3")
+ */
+ public function url() {
+ if ($this->is_album()) {
+ return url::site("albums/$this->id");
+ } else {
+ return url::site("photos/$this->id");
+ }
+ }
+
+ /**
* album: /var/albums/album1/album2
* photo: /var/albums/album1/album2/photo.jpg
*/