Page titles filled in

This commit is contained in:
Marcin Kurczewski 2013-10-05 21:22:28 +02:00
parent 377bdcf7c9
commit 046968b815
10 changed files with 24 additions and 4 deletions

View file

@ -1,4 +1,4 @@
booru szurubooru
===== =====
????booru repository. Repository name is subject to changes. Another danbooru clone.

View file

@ -4,6 +4,7 @@ prettyPrint=1
[main] [main]
dbPath=./db.sqlite dbPath=./db.sqlite
title=szurubooru
[registration] [registration]
emailActivation = 0 emailActivation = 0

View file

@ -27,6 +27,7 @@ class Bootstrap
R::setup('sqlite:' . $this->config->main->dbPath); R::setup('sqlite:' . $this->config->main->dbPath);
session_start(); session_start();
$this->context->title = $this->config->main->title;
$this->context->layoutName = isset($_GET['json']) $this->context->layoutName = isset($_GET['json'])
? 'layout-json' ? 'layout-json'
: 'layout-normal'; : 'layout-normal';

View file

@ -12,6 +12,8 @@ class AuthController extends AbstractController
*/ */
public function loginAction() public function loginAction()
{ {
$this->context->subTitle = 'login form';
//check if already logged in //check if already logged in
if ($this->context->loggedIn) if ($this->context->loggedIn)
{ {
@ -59,6 +61,8 @@ class AuthController extends AbstractController
*/ */
public function registerAction() public function registerAction()
{ {
$this->context->subTitle = 'registration form';
//check if already logged in //check if already logged in
if ($this->context->loggedIn) if ($this->context->loggedIn)
{ {
@ -177,6 +181,8 @@ class AuthController extends AbstractController
*/ */
public function activationAction($token) public function activationAction($token)
{ {
$this->context->subTitle = 'account activation';
//check if already logged in //check if already logged in
if ($this->context->loggedIn) if ($this->context->loggedIn)
{ {

View file

@ -6,6 +6,7 @@ class CommentController extends AbstractController
*/ */
public function listAction() public function listAction()
{ {
$this->context->subTitle = 'comments';
throw new Exception('Not implemented'); throw new Exception('Not implemented');
} }
} }

View file

@ -5,7 +5,8 @@ class IndexController extends AbstractController
* @route / * @route /
* @route /index * @route /index
*/ */
public static function indexAction() public function indexAction()
{ {
$this->context->subTitle = 'home';
} }
} }

View file

@ -8,6 +8,7 @@ class PostController extends AbstractController
*/ */
public function listAction($query = null) public function listAction($query = null)
{ {
$this->context->subTitle = 'browsing posts';
throw new Exception('Not implemented'); throw new Exception('Not implemented');
} }
@ -16,6 +17,7 @@ class PostController extends AbstractController
*/ */
public function uploadAction() public function uploadAction()
{ {
$this->context->subTitle = 'upload';
throw new Exception('Not implemented'); throw new Exception('Not implemented');
} }
@ -24,6 +26,7 @@ class PostController extends AbstractController
*/ */
public function showAction($id) public function showAction($id)
{ {
$this->context->subTitle = 'showing @' . $id;
throw new Exception('Not implemented'); throw new Exception('Not implemented');
} }
} }

View file

@ -6,6 +6,7 @@ class TagController extends AbstractController
*/ */
public static function listAction() public static function listAction()
{ {
$this->context->subTitle = 'tags';
throw new Exception('Not implemented'); throw new Exception('Not implemented');
} }
} }

View file

@ -6,6 +6,7 @@ class UserController extends AbstractController
*/ */
public function listAction() public function listAction()
{ {
$this->context->subTitle = 'users';
throw new Exception('Not implemented'); throw new Exception('Not implemented');
} }
@ -15,6 +16,7 @@ class UserController extends AbstractController
*/ */
public function showAction($name) public function showAction($name)
{ {
$this->context->subTitle = $name;
throw new Exception('Not implemented'); throw new Exception('Not implemented');
} }
} }

View file

@ -2,7 +2,11 @@
<html> <html>
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>no title yet...</title> <?php if (isset($this->context->subTitle)): ?>
<title><?php printf('%s&nbsp;&ndash;&nbsp;%s', $this->context->title, $this->context->subTitle) ?></title>
<?php else: ?>
<title><?php echo $this->context->title ?></title>
<?php endif ?>
</head> </head>
<body> <body>