diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/user/helpers/user_block.php | 33 | ||||
-rw-r--r-- | modules/user/views/login.html.php | 20 |
2 files changed, 53 insertions, 0 deletions
diff --git a/modules/user/helpers/user_block.php b/modules/user/helpers/user_block.php new file mode 100644 index 00000000..05767253 --- /dev/null +++ b/modules/user/helpers/user_block.php @@ -0,0 +1,33 @@ +<?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_block_Core { + public static function head($theme) { + $user = Session::instance()->get('user', null); + $url = url::file("lib/jquery.jeditable.js"); + return empty($user) ? "" : "<script src=\"$url\" type=\"text/javascript\"></script>"; + } + + public static function top($theme) { + $view = new View("login.html"); + $view->user = Session::instance()->get('user', null); + return $view->render(); + } + +} diff --git a/modules/user/views/login.html.php b/modules/user/views/login.html.php new file mode 100644 index 00000000..a4005ebf --- /dev/null +++ b/modules/user/views/login.html.php @@ -0,0 +1,20 @@ +<? defined("SYSPATH") or die("No direct script access."); ?> +<ul id="gLoginMenu"> + <? if ($user): ?> + <a href="<?= url::site("user/{$user->id}?continue=" . url::current(true))?>"><?= _("Modify Profile") ?></a> + | <a href="<?= url::site("logout?continue=" . url::current(true)) ?>" id="gLogoutLink"> + <?= _("Logout") ?> + </a> + <? else: ?> + <span id="gLoginLink"> + <a href="javascript:show_login('<?= url::site("login") ?>')"> + <?= _("Login") ?> + </a> + </span> + <span id="gLoginClose" class="gDisplayNone"> + <?= _("Login") ?> | <a href="javascript:close_login()">X</a> + </span> + <div id="gLoginFormContainer"></div> + <? endif; ?> +</ul> + |