summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_installer.php2
-rw-r--r--modules/gallery/helpers/gallery_menu.php2
-rw-r--r--modules/gallery/helpers/gallery_task.php13
-rw-r--r--modules/gallery/helpers/graphics.php12
-rw-r--r--modules/gallery/helpers/locale.php1
5 files changed, 24 insertions, 6 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index b97adcd0..242bb486 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -249,7 +249,7 @@ class gallery_installer {
block_manager::add("dashboard_center", "gallery", "log_entries");
module::set_version("gallery", 1);
- module::set_var("gallery", "version", "3.0 pre-beta git");
+ module::set_var("gallery", "version", "3.0 beta 1");
module::set_var("gallery", "choose_default_tookit", 1);
// @todo this string needs to be picked up by l10n_scanner
diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php
index 97f0fd81..9729a868 100644
--- a/modules/gallery/helpers/gallery_menu.php
+++ b/modules/gallery/helpers/gallery_menu.php
@@ -127,7 +127,7 @@ class gallery_menu_Core {
access::csrf_token())))
->append(Menu::factory("link")
->id("advanced")
- ->label("Advanced")
+ ->label(t("Advanced"))
->url(url::site("admin/advanced_settings"))))
->append(Menu::factory("link")
->id("modules")
diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php
index 6046bfc4..2493c49e 100644
--- a/modules/gallery/helpers/gallery_task.php
+++ b/modules/gallery/helpers/gallery_task.php
@@ -46,14 +46,22 @@ class gallery_task_Core {
*/
static function rebuild_dirty_images($task) {
$result = graphics::find_dirty_images_query();
- $remaining = $result->count();
$completed = $task->get("completed", 0);
+ $ignored = $task->get("ignored", array());
+ $remaining = $result->count() - count($ignored);
$i = 0;
foreach ($result as $row) {
+ if (array_key_exists($row->id, $ignored)) {
+ continue;
+ }
+
$item = ORM::factory("item", $row->id);
if ($item->loaded) {
- graphics::generate($item);
+ $success = graphics::generate($item);
+ if (!$success) {
+ $ignored[$item->id] = 1;
+ }
}
$completed++;
@@ -76,6 +84,7 @@ class gallery_task_Core {
}
$task->set("completed", $completed);
+ $task->set("ignored", $ignored);
if ($remaining == 0) {
$task->done = true;
$task->state = "success";
diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php
index 605b9ff8..4846fa8a 100644
--- a/modules/gallery/helpers/graphics.php
+++ b/modules/gallery/helpers/graphics.php
@@ -102,11 +102,12 @@ class graphics_Core {
/**
* Rebuild the thumb and resize for the given item.
* @param Item_Model $item
+ * @return true on successful generation
*/
static function generate($item) {
if ($item->is_album()) {
if (!$cover = $item->album_cover()) {
- return;
+ return false;
}
$input_file = $cover->file_path();
$input_item = $cover;
@@ -123,7 +124,10 @@ class graphics_Core {
}
if (empty($ops)) {
- return;
+ $item->thumb_dirty = 0;
+ $item->resize_dirty = 0;
+ $item->save();
+ return true;
}
try {
@@ -166,8 +170,12 @@ class graphics_Core {
// Something went wrong rebuilding the image. Leave it dirty and move on.
// @todo we should handle this better.
Kohana::log("error", "Caught exception rebuilding image: {$item->title}\n" .
+ $e->getMessage() . "\n" .
$e->getTraceAsString());
+ return false;
}
+
+ return true;
}
/**
diff --git a/modules/gallery/helpers/locale.php b/modules/gallery/helpers/locale.php
index 2ba0f255..c176dcc6 100644
--- a/modules/gallery/helpers/locale.php
+++ b/modules/gallery/helpers/locale.php
@@ -59,6 +59,7 @@ class locale_Core {
private static function _init_language_data() {
$l["af_ZA"] = "Afrikaans"; // Afrikaans
$l["ar_SA"] = "العربية"; // Arabic
+ $l["be_BY"] = "Беларускі"; // Belarusian
$l["bg_BG"] = "Български"; // Bulgarian
$l["ca_ES"] = "Catalan"; // Catalan
$l["cs_CZ"] = "Česky"; // Czech