summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/controllers/albums.php12
-rw-r--r--themes/default/views/page.html.php7
2 files changed, 17 insertions, 2 deletions
diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php
index efde4f09..0fd89f05 100644
--- a/modules/gallery/controllers/albums.php
+++ b/modules/gallery/controllers/albums.php
@@ -23,16 +23,24 @@ 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");
+ $template = new Theme_View("page.html", "album");
+ $template->set_global("page_size", $page_size);
+ $template->set_global("item", $album);
+ $template->set_global("children", array());
+ $template->set_global("children_count", 0);
+ $template->set_global("parents", $album->parents());
+ $template->unauthorized = true;
+ $template->content = new View("album.html");
+ print $template;
return;
} else {
access::forbidden();
}
}
- $page_size = module::get_var("gallery", "page_size", 9);
$show = $this->input->get("show");
if ($show) {
diff --git a/themes/default/views/page.html.php b/themes/default/views/page.html.php
index 6c77fb72..a17b643d 100644
--- a/themes/default/views/page.html.php
+++ b/themes/default/views/page.html.php
@@ -52,6 +52,13 @@
<script src="<?= $theme->url("js/jquery.localscroll.js") ?>" type="text/javascript"></script>
<script src="<?= $theme->url("js/ui.init.js") ?>" type="text/javascript"></script>
<?= $theme->head() ?>
+ <? if (!empty($unauthorized)): ?>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ $("#gLoginLink").click();
+ });
+ </script>
+ <? endif ?>
</head>
<body <?= $theme->main_element_attributes() ?>>