diff options
-rw-r--r--[-rwxr-xr-x] | installer/install.sql | 2 | ||||
-rw-r--r-- | modules/gallery/controllers/albums.php | 5 | ||||
-rw-r--r-- | modules/gallery/controllers/photos.php | 5 | ||||
-rw-r--r-- | modules/gallery/helpers/module.php | 2 | ||||
-rw-r--r-- | modules/gallery/helpers/photo.php | 2 |
5 files changed, 11 insertions, 5 deletions
diff --git a/installer/install.sql b/installer/install.sql index da349c36..9ec6ff48 100755..100644 --- 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; diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 9733d1cd..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; @@ -216,7 +218,8 @@ class Albums_Controller extends Items_Controller { array("album_title" => html::purify($album->title)))); print json_encode( - array("result" => "success")); + array("result" => "success", + "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 fbff53ce..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; @@ -113,7 +115,8 @@ class Photos_Controller extends Items_Controller { array("photo_title" => html::purify($photo->title)))); print json_encode( - array("result" => "success")); + array("result" => "success", + "location" => $watching_album ? $location : $photo->url())); } else { print json_encode( array("result" => "error", 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(); 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 |