summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/controllers/packager.php5
-rw-r--r--modules/gallery/controllers/quick.php14
-rw-r--r--modules/gallery/helpers/album.php1
-rw-r--r--modules/gallery/helpers/block_manager.php2
-rw-r--r--modules/gallery/helpers/gallery_installer.php3
-rw-r--r--modules/gallery/helpers/identity.php3
-rw-r--r--modules/gallery/helpers/item.php1
-rw-r--r--modules/gallery/helpers/movie.php1
-rw-r--r--modules/gallery/helpers/photo.php1
-rw-r--r--modules/gallery/models/item.php11
-rw-r--r--modules/gallery/tests/Albums_Controller_Test.php1
-rw-r--r--modules/gallery/views/upgrader.html.php2
-rw-r--r--modules/rss/views/feed.mrss.php2
13 files changed, 31 insertions, 16 deletions
diff --git a/modules/gallery/controllers/packager.php b/modules/gallery/controllers/packager.php
index 82c3c938..1354a01b 100644
--- a/modules/gallery/controllers/packager.php
+++ b/modules/gallery/controllers/packager.php
@@ -134,6 +134,11 @@ class Packager_Controller extends Controller {
$line = preg_replace("/ENGINE=\S+ /", "", $line);
}
+ // Null out ids in the vars table since it's an auto_increment table and this will result in
+ // more stable values so we'll have less churn in install.sql.
+ $line = preg_replace(
+ "/^INSERT INTO {vars} VALUES \(\d+/", "INSERT INTO {vars} VALUES (NULL", $line);
+
$buf .= $line;
}
$fd = fopen($sql_file, "wb");
diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php
index f2a77033..7f1ad43b 100644
--- a/modules/gallery/controllers/quick.php
+++ b/modules/gallery/controllers/quick.php
@@ -131,11 +131,15 @@ class Quick_Controller extends Controller {
access::required("view", $item);
access::required("edit", $item);
- if ($item->is_album()) {
- $form = album::get_edit_form($item);
- } else {
- $form = photo::get_edit_form($item);
+ switch ($item->type) {
+ case "album":
+ return print album::get_edit_form($item);
+
+ case "photo":
+ return print photo::get_edit_form($item);
+
+ case "movie":
+ return print movie::get_edit_form($item);
}
- print $form;
}
}
diff --git a/modules/gallery/helpers/album.php b/modules/gallery/helpers/album.php
index e9a0f6ec..cc631be4 100644
--- a/modules/gallery/helpers/album.php
+++ b/modules/gallery/helpers/album.php
@@ -115,7 +115,6 @@ class album_Core {
static function get_edit_form($parent) {
$form = new Forge("albums/update/{$parent->id}", "", "post", array("id" => "g-edit-album-form"));
- $form->hidden("_method")->value("put");
$group = $form->group("edit_item")->label(t("Edit Album"));
$group->input("title")->label(t("Title"))->value($parent->title);
diff --git a/modules/gallery/helpers/block_manager.php b/modules/gallery/helpers/block_manager.php
index b003f1d8..978ef9ba 100644
--- a/modules/gallery/helpers/block_manager.php
+++ b/modules/gallery/helpers/block_manager.php
@@ -37,7 +37,7 @@ class block_manager_Core {
$block_class = "{$module_name}_block";
if (method_exists($block_class, "get_site_list")) {
$blocks = call_user_func(array($block_class, "get_site_list"));
- foreach (array_keys($blocks) as $block_id) {
+ foreach (array_keys($blocks) as $block_id) {
self::add("site_sidebar", $module_name, $block_id);
}
}
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index 39859b36..410b6413 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -268,7 +268,8 @@ class gallery_installer {
module::set_var("gallery", "show_credits", 1);
// @todo this string needs to be picked up by l10n_scanner
module::set_var("gallery", "credits", "Powered by <a href=\"%url\">Gallery %version</a>");
- module::set_version("gallery", 19);
+ module::set_var("gallery", "simultaneous_upload_limit", 5);
+ module::set_version("gallery", 21);
}
static function upgrade($version) {
diff --git a/modules/gallery/helpers/identity.php b/modules/gallery/helpers/identity.php
index 72e3312d..83ba9e1e 100644
--- a/modules/gallery/helpers/identity.php
+++ b/modules/gallery/helpers/identity.php
@@ -82,7 +82,8 @@ class identity_Core {
}
} catch (Exception $e) {
// Log it, so we at least have so notification that we swallowed the exception.
- Kohana::log("error", "Load_user Exception: " . $e->__toString());
+ Kohana::log("error", "Load_user Exception: " .
+ $e->getMessage() . "\n" . $e->getTraceAsString());
try {
Session::instance()->destroy();
} catch (Exception $e) {
diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php
index 8f96c3d9..f8e6534e 100644
--- a/modules/gallery/helpers/item.php
+++ b/modules/gallery/helpers/item.php
@@ -127,7 +127,6 @@ class item_Core {
$page_type = Input::instance()->get("page_type");
$form = new Forge(
"quick/delete/$item->id?page_type=$page_type", "", "post", array("id" => "g-confirm-delete"));
- $form->hidden("_method")->value("put");
$group = $form->group("confirm_delete")->label(t("Confirm Deletion"));
$group->submit("")->value(t("Delete"));
return $form;
diff --git a/modules/gallery/helpers/movie.php b/modules/gallery/helpers/movie.php
index 536d5143..20ac8592 100644
--- a/modules/gallery/helpers/movie.php
+++ b/modules/gallery/helpers/movie.php
@@ -130,7 +130,6 @@ class movie_Core {
static function get_edit_form($movie) {
$form = new Forge("movies/update/$movie->id", "", "post", array("id" => "g-edit-movie-form"));
- $form->hidden("_method")->value("put");
$group = $form->group("edit_item")->label(t("Edit Movie"));
$group->input("title")->label(t("Title"))->value($movie->title);
$group->textarea("description")->label(t("Description"))->value($movie->description);
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php
index 4188e192..dab98436 100644
--- a/modules/gallery/helpers/photo.php
+++ b/modules/gallery/helpers/photo.php
@@ -139,7 +139,6 @@ class photo_Core {
static function get_edit_form($photo) {
$form = new Forge("photos/update/$photo->id", "", "post", array("id" => "g-edit-photo-form"));
- $form->hidden("_method")->value("put");
$group = $form->group("edit_item")->label(t("Edit Photo"));
$group->input("title")->label(t("Title"))->value($photo->title);
$group->textarea("description")->label(t("Description"))->value($photo->description);
diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php
index d27e331b..96415b3d 100644
--- a/modules/gallery/models/item.php
+++ b/modules/gallery/models/item.php
@@ -157,7 +157,16 @@ class Item_Model extends ORM_MPTT {
@rename(VARPATH . "albums/$old_relative_path", VARPATH . "albums/$new_relative_path");
@rename(VARPATH . "resizes/$old_relative_path", VARPATH . "resizes/$new_relative_path");
- @rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
+ if ($this->is_movie()) {
+ // Movie thumbnails have a .jpg extension
+ $old_relative_thumb_path = preg_replace("/...$/", "jpg", $old_relative_path);
+ $new_relative_thumb_path = preg_replace("/...$/", "jpg", $new_relative_path);
+ @rename(VARPATH . "thumbs/$old_relative_thumb_path",
+ VARPATH . "thumbs/$new_relative_thumb_path");
+ } else {
+ @rename(VARPATH . "thumbs/$old_relative_path", VARPATH . "thumbs/$new_relative_path");
+ }
+
$this->name = $new_name;
if ($this->is_album()) {
diff --git a/modules/gallery/tests/Albums_Controller_Test.php b/modules/gallery/tests/Albums_Controller_Test.php
index 9b904387..5f23f821 100644
--- a/modules/gallery/tests/Albums_Controller_Test.php
+++ b/modules/gallery/tests/Albums_Controller_Test.php
@@ -44,7 +44,6 @@ class Albums_Controller_Test extends Unit_Test_Case {
$_POST["direction"] = "ASC";
$_POST["csrf"] = access::csrf_token();
$_POST["slug"] = "new-name";
- $_POST["_method"] = "put";
access::allow(identity::everybody(), "edit", $root);
ob_start();
diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php
index 5cd1cd77..6cf0068d 100644
--- a/modules/gallery/views/upgrader.html.php
+++ b/modules/gallery/views/upgrader.html.php
@@ -26,7 +26,7 @@
<h1> <?= t("That's it!") ?> </h1>
<p>
<?= t("Your <a href=\"%url\">Gallery</a> is up to date.",
- array("url" => html::mark_clean(item::root()->url()))) ?>
+ array("url" => html::mark_clean(url::base()))) ?>
</p>
</div>
</div>
diff --git a/modules/rss/views/feed.mrss.php b/modules/rss/views/feed.mrss.php
index 5fce8699..a61ee96c 100644
--- a/modules/rss/views/feed.mrss.php
+++ b/modules/rss/views/feed.mrss.php
@@ -56,7 +56,6 @@
type="<?= $child->mime_type ?>"
height="<?= $child->resize_height ?>"
width="<?= $child->resize_width ?>"
- isDefault="true"
/>
<? if (access::can("view_full", $child)): ?>
<media:content url="<?= $child->file_url(true) ?>"
@@ -64,6 +63,7 @@
type="<?= $child->mime_type ?>"
height="<?= $child->height ?>"
width="<?= $child->width ?>"
+ isDefault="true"
/>
<? endif ?>
<? else: ?>