summaryrefslogtreecommitdiffstats
path: root/views/layouts/default.html.php
blob: 289ec8a382468d6850c9f4d35b65bdd044aafa08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
use \lithium\security\Auth;
?>
<!DOCTYPE html>
<html>
<head>
	<?= $this->html->charset(); ?>
	<title>OtakuHub<?php $title = $this->title(); if ($title) echo " > $title" ?></title>
	<?= $this->html->style('style') ?>
	<?= $this->html->style('base') ?>
	<?= $this->html->style('themes/light') ?>
	<?= $this->html->style('ribbon'); ?>
	<?= $this->html->style('jquery.fancybox-1.3.4') ?>
	<?= $this->html->style('http://fonts.googleapis.com/css?family=Cantarell:regular,bold&amp;v1') ?>
	<?= $this->styles(); ?>
</head>
<body>
<aside id="ribbon">
	<a href="http://github.com/jbalogh">
		<?= lithium\core\Environment::is('development') ? "Development" : "Production" ?>
	</a>
</aside>
<header>
	<?php
	$links = array(
		'Home' => '/',
		'Anime' => '/anime',
		'Manga' => '/manga',
	);
	$user = Auth::check('default');
	if ($user)
	{
		$links['Feed'] = '/users/feed';
		$links['Profile'] = '/users/feed';
		$links['Logout'] = '/logout';
	}
	else
	{
		$links['Sign up'] = '/signup';
		$links['Login'] = '/login'; // overwritten with JS; see functions.js
		echo '
		<div style="display: none"><div id="login">
		<h2>Login</h2>
		';
		echo $this->form->create(null, array('url' => '/login'));
		echo $this->form->field('username',
				array('type' => 'text', 'id' => 'f_username'));
		echo $this->form->field('password',
				array('type' => 'password', 'id' => 'f_password'));
		echo $this->form->field('remember',
				array('type' => 'checkbox', 'id' => 'f_remember', 'label' => 'Remember me'));
		echo $this->form->submit('Login');
		echo $this->form->end();
		echo '</div></div>';
	}
	echo '
	<nav>
	<ul>
	';
	foreach ($links as $name => $path) {
		if (($path == '/') || ($name == $this->request()->controller))
			echo '<li class="current">';
		else
			echo '<li>';
		echo "<a href=\"$path\">$name</a></li>";
	}
	echo '
	</ul>
	</nav>
	';
	?>

	<?= $this->form->create(null, array('url' => '/search/', 'class' => 'navsearch', 'method' => 'get')); ?>
	<?= $this->form->text('q', array('placeholder' => 'Search...')); ?>
	<input type="submit" value="Go">
	<?= $this->form->end(); ?>

	<br class="cl" />
</header>
<article>
	<?php echo $this->content() ?>
</article>
<footer>
	<p>Copyright ©2011, <a href="http://www.melenion.org">Melenion Dev Studios</a></p>
	<br class="cl" />
</footer>

<?= $this->html->script("http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"); ?>
<?= $this->html->script("/js/jquery.anchor.js"); ?>
<?= $this->html->script("/js/jquery.tools.min.js"); ?>
<?= $this->html->script("/js/jquery.form.js"); ?>
<?= $this->html->script("/js/jquery.tipsy.js"); ?>
<?= $this->html->script("/js/jquery.fancybox-1.3.4.pack.js") ?>
<?= $this->html->script("/js/functions.js"); ?>
<?= $this->scripts(); ?>

</body>
</html>