From 312811c783a14d33556acfb4ecdbd335c2605df0 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 08:07:49 -0700 Subject: Change the default install.sql such that the owner id of root album is the defined admin (id = 2) --- installer/install.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/installer/install.sql b/installer/install.sql index da349c36..9ec6ff48 100755 --- a/installer/install.sql +++ b/installer/install.sql @@ -175,7 +175,7 @@ CREATE TABLE {items} ( KEY `weight` (`weight`) ) AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; SET character_set_client = @saved_cs_client; -INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,NULL,0,NULL,'','',1,NULL,NULL,2,NULL,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1'); +INSERT INTO {items} VALUES (1,NULL,NULL,UNIX_TIMESTAMP(),'',NULL,1,1,NULL,NULL,2,0,NULL,'','',1,NULL,NULL,2,NULL,'weight','ASC',1,NULL,NULL,'Gallery','album',UNIX_TIMESTAMP(),0,1,NULL,'1','1'); DROP TABLE IF EXISTS {items_tags}; SET @saved_cs_client = @@character_set_client; SET character_set_client = utf8; -- cgit v1.2.3 From b91da7472651ac5efab668ea6215a4fbaea43f0f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 21 Oct 2009 11:47:21 -0700 Subject: Correct phpDoc --- modules/gallery/helpers/photo.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index 6677ddc9..d1d8fb1f 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -26,7 +26,7 @@ class photo_Core { /** * Create a new photo. - * @param integer $parent_id id of parent album + * @param integer $parent parent album * @param string $filename path to the photo file on disk * @param string $name the filename to use for this photo in the album * @param integer $title the title of the new photo -- cgit v1.2.3 From 416470fcb2063359bcf5bd2f11c4ae82e1cf43be Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 22 Oct 2009 07:35:26 -0700 Subject: Internationalize confirmation message. --- modules/gallery/views/admin_sidebar.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/admin_sidebar.html.php b/modules/gallery/views/admin_sidebar.html.php index f784b1a5..67752f75 100644 --- a/modules/gallery/views/admin_sidebar.html.php +++ b/modules/gallery/views/admin_sidebar.html.php @@ -21,7 +21,7 @@ if (data.result == "success") { $("ul#g-available-blocks").html(data.available); $("ul#g-active-blocks").html(data.active); - var message = "Updated blocks"; + var message = for_js() ?>; $("#g-action-status").remove(); $("#g-block-admin").before("
  • " + message + "
"); $("#g-action-status").fadeTo(1000,1).fadeTo(2000,0); -- cgit v1.2.3 From 95f3eb3aad3700c883ef6d865ae8d6512883b432 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 07:37:14 -0700 Subject: When an album or photo is updated always return the photo/album location as part of the response. This insures that if the internet address changes, then the page will reload properly. --- modules/gallery/controllers/albums.php | 3 ++- modules/gallery/controllers/photos.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 9733d1cd..ae4ad395 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -216,7 +216,8 @@ class Albums_Controller extends Items_Controller { array("album_title" => html::purify($album->title)))); print json_encode( - array("result" => "success")); + array("result" => "success", + "location" => $album->url())); } else { print json_encode( array("result" => "error", diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index fbff53ce..6bb5af89 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -113,7 +113,8 @@ class Photos_Controller extends Items_Controller { array("photo_title" => html::purify($photo->title)))); print json_encode( - array("result" => "success")); + array("result" => "success", + "location" => $photo->url())); } else { print json_encode( array("result" => "error", -- cgit v1.2.3 From e906e6bcbd6ed99b1029d4ceae45c03d77edc9ff Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 10:09:25 -0700 Subject: Use the request::referrer to determine if we are editting the photo or album from the context menu or from its photo or album page. Fixes ticket #745. Thanks to jankoprowski for the referrer approach. --- modules/gallery/controllers/albums.php | 4 +++- modules/gallery/controllers/photos.php | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index ae4ad395..21e37073 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -200,6 +200,8 @@ class Albums_Controller extends Items_Controller { } if ($valid) { + $watching_album = $album->url() != ($location = parse_url(request::referrer(), PHP_URL_PATH)); + $album->title = $form->edit_item->title->value; $album->description = $form->edit_item->description->value; $album->sort_column = $form->edit_item->sort_order->column->value; @@ -217,7 +219,7 @@ class Albums_Controller extends Items_Controller { print json_encode( array("result" => "success", - "location" => $album->url())); + "location" => $watching_album ? $location : $album->url())); } else { print json_encode( array("result" => "error", diff --git a/modules/gallery/controllers/photos.php b/modules/gallery/controllers/photos.php index 6bb5af89..54cd63c6 100644 --- a/modules/gallery/controllers/photos.php +++ b/modules/gallery/controllers/photos.php @@ -100,6 +100,8 @@ class Photos_Controller extends Items_Controller { } if ($valid) { + $watching_album = $photo->url() != ($location = parse_url(request::referrer(), PHP_URL_PATH)); + $photo->title = $form->edit_item->title->value; $photo->description = $form->edit_item->description->value; $photo->slug = $form->edit_item->slug->value; @@ -114,7 +116,7 @@ class Photos_Controller extends Items_Controller { print json_encode( array("result" => "success", - "location" => $photo->url())); + "location" => $watching_album ? $location : $photo->url())); } else { print json_encode( array("result" => "error", -- cgit v1.2.3 From 3607ddf7ff434794bc61ed1a30d068abcdf1270f Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 22 Oct 2009 17:05:00 -0700 Subject: When uninstalling a module call graphics:remove_rules instead of graphics remove_rule. --- modules/gallery/helpers/module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index 77ec6f63..5b34f453 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -253,7 +253,7 @@ class module_Core { call_user_func(array($installer_class, "uninstall")); } - graphics::remove_rule($module_name); + graphics::remove_rules($module_name); $module = self::get($module_name); if ($module->loaded) { $module->delete(); -- cgit v1.2.3