aboutsummaryrefslogtreecommitdiff
path: root/app/layout/header.phtml
blob: 028e63d8a65c6c2df8ed6d9a2c8ba57eaf798c59 (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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
if (Minz_Configuration::canLogIn()) {
	?><ul class="nav nav-head nav-login"><?php
	switch (Minz_Configuration::authType()) {
	case 'form':
		if ($this->loginOk) {
			?><li class="item"><?php echo _i('logout'); ?> <a class="signout" href="<?php echo _url('index', 'formLogout'); ?>"><?php echo _t('logout'); ?></a></li><?php
		} else {
			?><li class="item"><?php echo _i('login'); ?> <a class="signin" href="<?php echo _url('index', 'formLogin'); ?>"><?php echo _t('login'); ?></a></li><?php
		}
		break;
	case 'persona':
		if ($this->loginOk) {
			?><li class="item"><?php echo _i('logout'); ?> <a class="signout" href="#"><?php echo _t('logout'); ?></a></li><?php
		} else {
			?><li class="item"><?php echo _i('login'); ?> <a class="signin" href="#"><?php echo _t('login'); ?></a></li><?php
		}
		break;
	}
	?></ul><?php
}
?>

<div class="header">
	<div class="item title">
		<h1>
			<a href="<?php echo _url('index', 'index'); ?>">
				<img class="logo" src="<?php echo _i('icon', true); ?>" alt="⊚" />
				<?php echo Minz_Configuration::title(); ?>
			</a>
		</h1>
	</div>

	<div class="item search">
		<?php if ($this->loginOk || Minz_Configuration::allowAnonymous()) { ?>
		<form action="<?php echo _url('index', 'index'); ?>" method="get">
			<div class="stick">
				<?php $search = Minz_Request::param('search', ''); ?>
				<input type="search" name="search" id="search" class="extend" value="<?php echo $search; ?>" placeholder="<?php echo _t('search'); ?>" />

				<?php $get = Minz_Request::param('get', ''); ?>
				<?php if ($get != '') { ?>
				<input type="hidden" name="get" value="<?php echo $get; ?>" />
				<?php } ?>

				<?php $order = Minz_Request::param('order', ''); ?>
				<?php if ($order != '') { ?>
				<input type="hidden" name="order" value="<?php echo $order; ?>" />
				<?php } ?>

				<?php $state = Minz_Request::param('state', ''); ?>
				<?php if ($state != '') { ?>
				<input type="hidden" name="state" value="<?php echo $state; ?>" />
				<?php } ?>

				<button class="btn" type="submit"><?php echo _i('search'); ?></button>
			</div>
		</form>
		<?php } ?>
	</div>

	<?php if ($this->loginOk) { ?>
	<div class="item configure">
		<div class="dropdown">
			<div id="dropdown-configure" class="dropdown-target"></div>
			<a class="btn dropdown-toggle" href="#dropdown-configure"><?php echo _i('configure'); ?></a>
			<ul class="dropdown-menu">
				<li class="dropdown-close"><a href="#close">❌</a></li>
				<li class="dropdown-header"><?php echo _t('configuration'); ?></li>
				<li class="item"><a href="<?php echo _url('configure', 'display'); ?>"><?php echo _t('display_configuration'); ?></a></li>
				<li class="item"><a href="<?php echo _url('configure', 'reading'); ?>"><?php echo _t('reading_configuration'); ?></a></li>
				<li class="item"><a href="<?php echo _url('configure', 'archiving'); ?>"><?php echo _t('archiving_configuration'); ?></a></li>
				<li class="item"><a href="<?php echo _url('configure', 'sharing'); ?>"><?php echo _t('sharing'); ?></a></li>
				<li class="item"><a href="<?php echo _url('configure', 'shortcut'); ?>"><?php echo _t('shortcuts'); ?></a></li>
				<li class="item"><a href="<?php echo _url('configure', 'queries'); ?>"><?php echo _t('queries'); ?></a></li>
				<li class="separator"></li>
				<li class="item"><a href="<?php echo _url('configure', 'users'); ?>"><?php echo _t('users'); ?></a></li>
				<?php
					$current_user = Minz_Session::param('currentUser', '');
					if (Minz_Configuration::isAdmin($current_user)) {
				?>
				<li class="item"><a href="<?php echo _url('update', 'index'); ?>"><?php echo _t('update'); ?></a></li>
				<?php } ?>
				<li class="separator"></li>
				<li class="item"><a href="<?php echo _url('stats', 'index'); ?>"><?php echo _t('stats'); ?></a></li>
				<li class="item"><a href="<?php echo _url('index', 'logs'); ?>"><?php echo _t('logs'); ?></a></li>
				<li class="item"><a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('about'); ?></a></li>
				<?php
				if (Minz_Configuration::canLogIn()) {
					?><li class="separator"></li><?php
					switch (Minz_Configuration::authType()) {
					case 'form':
						?><li class="item"><a class="signout" href="<?php echo _url('index', 'formLogout'); ?>"><?php echo _i('logout'), ' ', _t('logout'); ?></a></li><?php
						break;
					case 'persona':
						?><li class="item"><a class="signout" href="#"><?php echo _i('logout'), ' ', _t('logout'); ?></a></li><?php
						break;
					}
				} ?>
			</ul>
		</div>
	</div>
	<?php } elseif (Minz_Configuration::canLogIn()) {
		?><div class="item configure"><?php
		switch (Minz_Configuration::authType()) {
		case 'form':
			echo _i('login'); ?><a class="signin" href="<?php echo _url('index', 'formLogin'); ?>"><?php echo _t('login'); ?></a></li><?php
			break;
		case 'persona':
			echo _i('login'); ?><a class="signin" href="#"><?php echo _t('login'); ?></a></li><?php
			break;
		}
		?></div><?php
	} ?>
</div>