diff options
-rw-r--r-- | installer/install.sql | 45 | ||||
-rw-r--r-- | lib/gallery.common.css | 10 | ||||
-rw-r--r-- | modules/gallery/controllers/packager.php | 5 | ||||
-rw-r--r-- | modules/gallery/controllers/quick.php | 14 | ||||
-rw-r--r-- | modules/gallery/helpers/album.php | 1 | ||||
-rw-r--r-- | modules/gallery/helpers/block_manager.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/gallery_installer.php | 3 | ||||
-rw-r--r-- | modules/gallery/helpers/identity.php | 3 | ||||
-rw-r--r-- | modules/gallery/helpers/item.php | 1 | ||||
-rw-r--r-- | modules/gallery/helpers/movie.php | 1 | ||||
-rw-r--r-- | modules/gallery/helpers/photo.php | 1 | ||||
-rw-r--r-- | modules/gallery/models/item.php | 11 | ||||
-rw-r--r-- | modules/gallery/tests/Albums_Controller_Test.php | 1 | ||||
-rw-r--r-- | modules/gallery/views/upgrader.html.php | 2 | ||||
-rw-r--r-- | modules/rss/views/feed.mrss.php | 2 |
15 files changed, 64 insertions, 38 deletions
diff --git a/installer/install.sql b/installer/install.sql index 38851eff..916cb3e3 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -228,7 +228,7 @@ CREATE TABLE {modules} ( UNIQUE KEY `name` (`name`) ) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -INSERT INTO {modules} VALUES (1,1,'gallery',19); +INSERT INTO {modules} VALUES (1,1,'gallery',21); INSERT INTO {modules} VALUES (2,1,'user',2); INSERT INTO {modules} VALUES (3,1,'comment',2); INSERT INTO {modules} VALUES (4,1,'organize',1); @@ -366,25 +366,26 @@ CREATE TABLE {vars} ( `value` text, PRIMARY KEY (`id`), UNIQUE KEY `module_name` (`module_name`,`name`) -) AUTO_INCREMENT=35 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=36 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -INSERT INTO {vars} VALUES (1,'gallery','active_site_theme','wind'); -INSERT INTO {vars} VALUES (2,'gallery','active_admin_theme','admin_wind'); -INSERT INTO {vars} VALUES (3,'gallery','page_size','9'); -INSERT INTO {vars} VALUES (4,'gallery','thumb_size','200'); -INSERT INTO {vars} VALUES (5,'gallery','resize_size','640'); -INSERT INTO {vars} VALUES (6,'gallery','default_locale','en_US'); -INSERT INTO {vars} VALUES (7,'gallery','image_quality','75'); -INSERT INTO {vars} VALUES (8,'gallery','image_sharpen','15'); -INSERT INTO {vars} VALUES (21,'gallery','time_format','H:i:s'); -INSERT INTO {vars} VALUES (22,'gallery','show_credits','1'); -INSERT INTO {vars} VALUES (23,'gallery','credits','Powered by <a href=\"%url\">Gallery %version</a>'); -INSERT INTO {vars} VALUES (10,'gallery','blocks_dashboard_sidebar','a:4:{i:2;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"block_adder\";}i:3;a:2:{i:0;s:7:\"gallery\";i:1;s:5:\"stats\";}i:4;a:2:{i:0;s:7:\"gallery\";i:1;s:13:\"platform_info\";}i:5;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"project_news\";}}'); -INSERT INTO {vars} VALUES (20,'gallery','date_time_format','Y-M-d H:i:s'); -INSERT INTO {vars} VALUES (19,'gallery','date_format','Y-M-d'); -INSERT INTO {vars} VALUES (15,'gallery','blocks_dashboard_center','a:3:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}}'); -INSERT INTO {vars} VALUES (18,'gallery','choose_default_tookit','1'); -INSERT INTO {vars} VALUES (26,'user','mininum_password_length','5'); -INSERT INTO {vars} VALUES (27,'comment','spam_caught','0'); -INSERT INTO {vars} VALUES (25,'gallery','identity_provider','user'); -INSERT INTO {vars} VALUES (29,'gallery','blocks_site_sidebar','a:3:{i:9;a:2:{i:0;s:4:\"info\";i:1;s:8:\"metadata\";}i:10;a:2:{i:0;s:3:\"rss\";i:1;s:9:\"rss_feeds\";}i:11;a:2:{i:0;s:3:\"tag\";i:1;s:3:\"tag\";}}'); +INSERT INTO {vars} VALUES (NULL,'gallery','active_site_theme','wind'); +INSERT INTO {vars} VALUES (NULL,'gallery','active_admin_theme','admin_wind'); +INSERT INTO {vars} VALUES (NULL,'gallery','page_size','9'); +INSERT INTO {vars} VALUES (NULL,'gallery','thumb_size','200'); +INSERT INTO {vars} VALUES (NULL,'gallery','resize_size','640'); +INSERT INTO {vars} VALUES (NULL,'gallery','default_locale','en_US'); +INSERT INTO {vars} VALUES (NULL,'gallery','image_quality','75'); +INSERT INTO {vars} VALUES (NULL,'gallery','image_sharpen','15'); +INSERT INTO {vars} VALUES (NULL,'gallery','time_format','H:i:s'); +INSERT INTO {vars} VALUES (NULL,'gallery','show_credits','1'); +INSERT INTO {vars} VALUES (NULL,'gallery','credits','Powered by <a href=\"%url\">Gallery %version</a>'); +INSERT INTO {vars} VALUES (NULL,'gallery','simultaneous_upload_limit','5'); +INSERT INTO {vars} VALUES (NULL,'gallery','blocks_dashboard_sidebar','a:4:{i:2;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"block_adder\";}i:3;a:2:{i:0;s:7:\"gallery\";i:1;s:5:\"stats\";}i:4;a:2:{i:0;s:7:\"gallery\";i:1;s:13:\"platform_info\";}i:5;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"project_news\";}}'); +INSERT INTO {vars} VALUES (NULL,'gallery','date_time_format','Y-M-d H:i:s'); +INSERT INTO {vars} VALUES (NULL,'gallery','date_format','Y-M-d'); +INSERT INTO {vars} VALUES (NULL,'gallery','blocks_dashboard_center','a:3:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}}'); +INSERT INTO {vars} VALUES (NULL,'gallery','choose_default_tookit','1'); +INSERT INTO {vars} VALUES (NULL,'user','mininum_password_length','5'); +INSERT INTO {vars} VALUES (NULL,'comment','spam_caught','0'); +INSERT INTO {vars} VALUES (NULL,'gallery','identity_provider','user'); +INSERT INTO {vars} VALUES (NULL,'gallery','blocks_site_sidebar','a:3:{i:9;a:2:{i:0;s:4:\"info\";i:1;s:8:\"metadata\";}i:10;a:2:{i:0;s:3:\"rss\";i:1;s:9:\"rss_feeds\";}i:11;a:2:{i:0;s:3:\"tag\";i:1;s:3:\"tag\";}}'); diff --git a/lib/gallery.common.css b/lib/gallery.common.css index e586f29a..87498b40 100644 --- a/lib/gallery.common.css +++ b/lib/gallery.common.css @@ -145,6 +145,10 @@ input[type="reset"] { display: none; } +input[readonly] { + background-color: #F4F4FC; +} + #g-dialog input.textbox, #g-dialog input[type=text], #g-dialog input[type=password], @@ -316,6 +320,7 @@ tr.g-warning td.g-warning { form .g-error { background-color: #fff; + padding-left: 20px; } .g-open { @@ -488,6 +493,7 @@ ul.sf-menu li li li.sfHover ul { /* Status and validation messages ~~~~ */ .g-message-block { + background-position: .4em .3em; border: 1px solid #ccc; padding: 0; } @@ -512,6 +518,10 @@ div#g-action-status { margin-bottom: 1em; } +.g-message { + background-position: 0 50%; +} + /* Breadcrumbs ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ .g-breadcrumbs { 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: ?> |