summaryrefslogtreecommitdiff
path: root/core/helpers
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-02-06 03:47:36 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-02-06 03:47:36 +0000
commit80d4df3a4a6fefcf69de5245934b4b0bfc0f8e20 (patch)
tree7035bf37330fabce2996f6a867c77ea00295b216 /core/helpers
parent196ef392ab1dc32154ec8dbe49340d4aefb0d082 (diff)
Convert all item->type == "album" to item->is_album()
Convert all item->type == "photo" to item->is_photo()
Diffstat (limited to 'core/helpers')
-rw-r--r--core/helpers/access.php2
-rw-r--r--core/helpers/album.php2
-rw-r--r--core/helpers/core_menu.php4
-rw-r--r--core/helpers/graphics.php4
-rw-r--r--core/helpers/photo.php2
5 files changed, 7 insertions, 7 deletions
diff --git a/core/helpers/access.php b/core/helpers/access.php
index 23db5782..60e8557d 100644
--- a/core/helpers/access.php
+++ b/core/helpers/access.php
@@ -188,7 +188,7 @@ class access_Core {
if (!$album->loaded) {
throw new Exception("@todo INVALID_ALBUM $album->id");
}
- if ($album->type != "album") {
+ if (!$album->is_album()) {
throw new Exception("@todo INVALID_ALBUM_TYPE not an album");
}
$access = model_cache::get("access_intent", $album->id, "item_id");
diff --git a/core/helpers/album.php b/core/helpers/album.php
index 223a057d..c45b9bd8 100644
--- a/core/helpers/album.php
+++ b/core/helpers/album.php
@@ -33,7 +33,7 @@ class album_Core {
* @return Item_Model
*/
static function create($parent, $name, $title, $description=null, $owner_id=null) {
- if (!$parent->loaded || $parent->type != "album") {
+ if (!$parent->loaded || !$parent->is_album()) {
throw new Exception("@todo INVALID_PARENT");
}
diff --git a/core/helpers/core_menu.php b/core/helpers/core_menu.php
index 4720a00d..bb87c760 100644
--- a/core/helpers/core_menu.php
+++ b/core/helpers/core_menu.php
@@ -38,12 +38,12 @@ class core_menu_Core {
->label(t("Options"))
->append(Menu::factory("dialog")
->id("edit_item")
- ->label($item->type == "album" ? t("Edit album") : t("Edit photo"))
+ ->label($item->is_album() ? t("Edit album") : t("Edit photo"))
->url(url::site("form/edit/{$item->type}s/$item->id"))));
// @todo Move album options menu to the album quick edit pane
// @todo Create resized item quick edit pane menu
- if ($item->type == "album") {
+ if ($item->is_album()) {
$options_menu
->append(Menu::factory("dialog")
->id("add_item")
diff --git a/core/helpers/graphics.php b/core/helpers/graphics.php
index cd112e1b..4c8f3bb1 100644
--- a/core/helpers/graphics.php
+++ b/core/helpers/graphics.php
@@ -68,7 +68,7 @@ class graphics_Core {
* @param Item_Model $item
*/
static function generate($item) {
- if ($item->type == "album") {
+ if ($item->is_album()) {
$cover = $item->album_cover();
if (!$cover) {
return;
@@ -82,7 +82,7 @@ class graphics_Core {
if ($item->thumb_dirty) {
$ops["thumb"] = $item->thumb_path();
}
- if ($item->resize_dirty && $item->type != "album") {
+ if ($item->resize_dirty && !$item->is_album()) {
$ops["resize"] = $item->resize_path();
}
diff --git a/core/helpers/photo.php b/core/helpers/photo.php
index a2958aec..349e8760 100644
--- a/core/helpers/photo.php
+++ b/core/helpers/photo.php
@@ -35,7 +35,7 @@ class photo_Core {
*/
static function create($parent, $filename, $name, $title,
$description=null, $owner_id=null) {
- if (!$parent->loaded || $parent->type != "album") {
+ if (!$parent->loaded || !$parent->is_album()) {
throw new Exception("@todo INVALID_PARENT");
}