diff options
Diffstat (limited to 'modules/gallery')
-rw-r--r-- | modules/gallery/controllers/albums.php | 4 | ||||
-rw-r--r-- | modules/gallery/controllers/quick.php | 5 | ||||
-rw-r--r-- | modules/gallery/helpers/MY_url.php | 21 | ||||
-rw-r--r-- | modules/gallery/views/simple_uploader.html.php | 2 |
4 files changed, 21 insertions, 11 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index efde4f09..f37609e6 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -23,16 +23,16 @@ class Albums_Controller extends Items_Controller { * @see REST_Controller::_show($resource) */ public function _show($album) { + $page_size = module::get_var("gallery", "page_size", 9); if (!access::can("view", $album)) { if ($album->id == 1) { - print new Theme_View("login_page.html", "album"); + print new Theme_View("login_page.html"); return; } else { access::forbidden(); } } - $page_size = module::get_var("gallery", "page_size", 9); $show = $this->input->get("show"); if ($show) { diff --git a/modules/gallery/controllers/quick.php b/modules/gallery/controllers/quick.php index 6efcb9de..d6f5213f 100644 --- a/modules/gallery/controllers/quick.php +++ b/modules/gallery/controllers/quick.php @@ -87,9 +87,12 @@ class Quick_Controller extends Controller { access::required("view", $item->parent()); access::required("edit", $item->parent()); + $msg = t("Made <b>%title</b> this album's cover", array("title" => $item->title)); + item::make_album_cover($item); + message::success($msg); - print json_encode(array("result" => "success")); + print json_encode(array("result" => "success", "reload" => 1)); } public function delete($id) { diff --git a/modules/gallery/helpers/MY_url.php b/modules/gallery/helpers/MY_url.php index c8645c4d..7bee70ca 100644 --- a/modules/gallery/helpers/MY_url.php +++ b/modules/gallery/helpers/MY_url.php @@ -46,7 +46,19 @@ class url extends url_Core { return; } - $current_uri = html_entity_decode(Router::$current_uri, ENT_QUOTES); + $item = self::get_item_from_uri(Router::$current_uri); + if ($item && $item->loaded) { + Router::$controller = "{$item->type}s"; + Router::$controller_path = MODPATH . "gallery/controllers/{$item->type}s.php"; + Router::$method = $item->id; + } + } + + /** + * Return the item that the uri is referencing + */ + static function get_item_from_uri($uri) { + $current_uri = html_entity_decode($uri); $item = ORM::factory("item")->where("relative_path_cache", $current_uri)->find(); if (!$item->loaded) { // It's possible that the relative path cache for the item we're looking for is out of date, @@ -61,12 +73,7 @@ class url extends url_Core { } } } - - if ($item && $item->loaded) { - Router::$controller = "{$item->type}s"; - Router::$controller_path = MODPATH . "gallery/controllers/{$item->type}s.php"; - Router::$method = $item->id; - } + return $item; } /** diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php index 79919d50..f10d764c 100644 --- a/modules/gallery/views/simple_uploader.html.php +++ b/modules/gallery/views/simple_uploader.html.php @@ -93,7 +93,7 @@ button_width: "202", button_height: "45", button_placeholder_id: "gChooseFilesButtonPlaceholder", - button_text: '<span class="swfUploadFont">Select photos...</span>', + button_text: '<span class="swfUploadFont"><?= t("Select photos...") ?></span>', button_text_style: ".swfUploadFont { color: #2E6E9E; font-size: 16px; font-family: Lucida Grande,Lucida Sans,Arial,sans-serif; font-weight: bold; }", button_text_left_padding: 30, button_text_top_padding: 10, |