diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-11 07:39:20 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2008-11-11 07:39:20 +0000 |
commit | bba5289035eebb0c4a9c6c5f3d1598b538fc3586 (patch) | |
tree | cf0b00fca3c618e339cc3d1e92832b91b16f01be | |
parent | 87f1115113f36b197003a45f32f295bb4cd19891 (diff) |
Change Album and Photo controllers to set the user object as a global variable; change the header so it links to the user controllers; and add the user controllers which don't do anything.
-rw-r--r-- | core/controllers/album.php | 1 | ||||
-rw-r--r-- | core/controllers/photo.php | 1 | ||||
-rw-r--r-- | modules/user/controllers/user.php | 32 | ||||
-rw-r--r-- | themes/default/views/header.html.php | 9 |
4 files changed, 40 insertions, 3 deletions
diff --git a/core/controllers/album.php b/core/controllers/album.php index 9357c986..63290853 100644 --- a/core/controllers/album.php +++ b/core/controllers/album.php @@ -34,6 +34,7 @@ class Album_Controller extends Item_Controller { $template->set_global('children', $item->children($page_size, ($page-1) * $page_size)); $template->set_global('parents', $item->parents()); $template->set_global('theme', $theme); + $template->set_global('user', Session::instance()->get('user', null)); $template->content = new View("album.html"); print $template->render(); diff --git a/core/controllers/photo.php b/core/controllers/photo.php index b56c29b9..78287afa 100644 --- a/core/controllers/photo.php +++ b/core/controllers/photo.php @@ -29,6 +29,7 @@ class Photo_Controller extends Item_Controller { $template->set_global('children', $item->children()); $template->set_global('parents', $item->parents()); $template->set_global('theme', $theme); + $template->set_global('user', Session::instance()->get('user', null)); $template->content = new View("photo.html"); print $template->render(); diff --git a/modules/user/controllers/user.php b/modules/user/controllers/user.php new file mode 100644 index 00000000..9b41a11e --- /dev/null +++ b/modules/user/controllers/user.php @@ -0,0 +1,32 @@ +<?php defined("SYSPATH") or die("No direct script access."); +/** + * Gallery - a web based photo album viewer and editor + * Copyright (C) 2000-2008 Bharat Mediratta + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. + */ +class User_Controller extends Controller { + public function login() { + + } + + public function logout() { + + } + + public function register() { + + } +}
\ No newline at end of file diff --git a/themes/default/views/header.html.php b/themes/default/views/header.html.php index 37884315..2e9da463 100644 --- a/themes/default/views/header.html.php +++ b/themes/default/views/header.html.php @@ -3,10 +3,13 @@ <h1><?= $item->title_edit ?></h1> <div id="gLoginMenu"> - <a href="#"><?= _("Register") ?></a> | - <a href="#"><?= _("Login") ?></a> + <? if (empty($user)): ?> + <a href="<?= url::site("user/register")?>"><?= _("Register") ?></a> | + <a href="<?= url::site("user/login")?>"><?= _("Login") ?></a> + <? else: ?> + <a href="<?= url::site("user/logout")?>"><?= _("Logout") ?></a> + <? endif; ?> </div> - <ul id="gSiteMenu"> <li><a href="index.php"><?= _("HOME") ?></a></li> <li><a class="active" href="index.php/album/1"><?= _("BROWSE") ?></a></li> |