summaryrefslogtreecommitdiff
path: root/core/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'core/controllers')
-rw-r--r--core/controllers/move.php2
-rw-r--r--core/controllers/permissions.php4
-rw-r--r--core/controllers/quick.php6
3 files changed, 6 insertions, 6 deletions
diff --git a/core/controllers/move.php b/core/controllers/move.php
index 26c507f9..069de771 100644
--- a/core/controllers/move.php
+++ b/core/controllers/move.php
@@ -39,7 +39,7 @@ class Move_Controller extends Controller {
// If the target has no cover item, make this it.
if ($target->album_cover_item_id == null) {
$target->album_cover_item_id =
- $source->type == "album" ? $source->album_cover_item_id : $source->id;
+ $source->is_album() ? $source->album_cover_item_id : $source->id;
$target->save();
graphics::generate($target);
}
diff --git a/core/controllers/permissions.php b/core/controllers/permissions.php
index 8ffb63de..f99124dd 100644
--- a/core/controllers/permissions.php
+++ b/core/controllers/permissions.php
@@ -22,7 +22,7 @@ class Permissions_Controller extends Controller {
$item = ORM::factory("item", $id);
access::required("edit", $item);
- if ($item->type != "album") {
+ if (!$item->is_album()) {
access::forbidden();
}
@@ -38,7 +38,7 @@ class Permissions_Controller extends Controller {
$item = ORM::factory("item", $id);
access::required("edit", $item);
- if ($item->type != "album") {
+ if (!$item->is_album()) {
access::forbidden();
}
diff --git a/core/controllers/quick.php b/core/controllers/quick.php
index 6fd0ae62..77a39bf5 100644
--- a/core/controllers/quick.php
+++ b/core/controllers/quick.php
@@ -80,9 +80,9 @@ class Quick_Controller extends Controller {
$parent = $item->parent();
access::required("edit", $parent);
- if ($item->type == "photo") {
+ if ($item->is_photo()) {
$parent->album_cover_item_id = $item->id;
- } else if ($item->type == "album") {
+ } else if ($item->is_album()) {
$parent->album_cover_item_id = $item->album_cover_item_id;
}
@@ -100,7 +100,7 @@ class Quick_Controller extends Controller {
$parent = $item->parent();
- if ($item->type == "album") {
+ if ($item->is_album()) {
$msg = t("Deleted album <b>%title</b>", array("title" => $item->title));
} else {
$msg = t("Deleted photo <b>%title</b>", array("title" => $item->title));