/
default.php
162 lines (118 loc) · 4.75 KB
/
default.php
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?php
/**
* ProcessWire 2.x Admin Markup Template
*
* Copyright 2010 by Ryan Cramer
* Teflon Theme 2011 by Soma Philipp Urlich
*
* @modified 2012-08-29
* @version 1.0.2
*/
$searchForm = $user->hasPermission('page-edit') ? $modules->get('ProcessPageSearch')->renderSearchForm() : '';
$bodyClass = $input->get->modal ? 'modal' : '';
$bodyClass .= $page->id == 23 ? ' ProcessLoginForm' : '';
$sitename = $config->siteName ? $config->siteName : $_SERVER['SERVER_NAME'];
if(!isset($content)) $content = '';
$config->styles->prepend($config->urls->adminTemplates . "styles/main.css");
$config->styles->append($config->urls->adminTemplates . "styles/ui.css");
$config->styles->append($config->urls->adminTemplates . "styles/droppy.css");
$config->scripts->append($config->urls->adminTemplates . "scripts/main.js");
$config->scripts->append($config->urls->adminTemplates . "scripts/jquery.droppy.js");
$config->scripts->append($config->urls->adminTemplates . "scripts/jquery.hoverintent.js");
$config->scripts->append($config->urls->adminTemplates . "scripts/jquery.scrollto.min.js");
/*
* Dynamic phrases that we want to be automatically translated
*
* These are in a comment so that they register with the parser, in place of the dynamic __() function calls with page titles.
*
* __("Pages");
* __("Setup");
* __("Modules");
* __("Access");
* __("Admin");
*
*/
?>
<!DOCTYPE html>
<html lang="<?php echo __('en', __FILE__); // HTML tag lang attribute
/* this intentionally on a separate line */ ?>">
<head>
<meta charset="utf-8" />
<meta name="robots" content="noindex, nofollow" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php echo __(strip_tags($page->get("title|name")), __FILE__); ?> • <?php echo $sitename ?> • ProcessWire</title>
<script type="text/javascript">
<?php
$jsConfig = $config->js();
$jsConfig['debug'] = $config->debug;
$jsConfig['urls'] = array(
'root' => $config->urls->root,
'admin' => $config->urls->admin,
'modules' => $config->urls->modules,
'core' => $config->urls->core,
'files' => $config->urls->files,
'templates' => $config->urls->templates,
'adminTemplates' => $config->urls->adminTemplates,
);
?>
var config = <?php echo json_encode($jsConfig); ?>;
</script>
<?php foreach($config->styles->unique() as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />"; ?>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->adminTemplates; ?>styles/ie.css" />
<![endif]-->
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="<?php echo $config->urls->adminTemplates; ?>styles/ie7.css" />
<![endif]-->
<?php foreach($config->scripts->unique() as $file) echo "\n\t<script type='text/javascript' src='$file'></script>"; ?>
</head>
<body<?php if($bodyClass) echo " class='$bodyClass'"; ?>>
<div id="masthead" class="masthead">
<div class="container">
<p id="logo">ProcessWire</p>
<ul id='topnav' class='nav droppy'>
<li><a id='sitelink' href='<?php echo $config->urls->root; ?>'><?php echo __('Site', __FILE__); ?></a></li>
<?php include($config->paths->templatesAdmin . "topnav.inc"); ?>
</ul>
<?php if(!$user->isGuest()): ?>
<ul id='breadcrumb' class='nav'><?php
foreach($this->fuel('breadcrumbs') as $breadcrumb) {
$title = __($breadcrumb->title, __FILE__);
echo "\n\t\t\t\t<li><a href='{$breadcrumb->url}'>{$title}</a><span> </span></li>";
}
?>
</ul>
<?php endif; ?>
<?php if(!$user->isGuest()): ?>
<span id='userinfo_top'>
<?php echo $user->name?>
<?php if($user->hasPermission('profile-edit')): ?> :
<a class='action' href='<?php echo $config->urls->admin; ?>profile/'><?php echo __('profile', __FILE__); ?></a> :
<?php endif; ?>
<a class='action' href='<?php echo $config->urls->admin; ?>login/logout/'><?php echo __('logout', __FILE__); ?></a>
</span>
<?php endif; ?>
<?php echo $searchForm; ?>
</div>
</div>
<div id="wrapper-content">
<?php if(count($notices)) include($config->paths->adminTemplates . "notices.inc"); ?>
<div id="content" class="content">
<div class="container">
<h1 id='title'><?php echo __(strip_tags($this->fuel->processHeadline ? $this->fuel->processHeadline : $page->get("title|name")), __FILE__); ?></h1>
<?php if(trim($page->summary)) echo "<h2>{$page->summary}</h2>"; ?>
<?php if($page->body) echo $page->body; ?>
<?php echo $content?>
</div>
</div>
</div>
<div id="footer" class="footer">
<div class="container">
<p>
ProcessWire <?php echo $config->version; ?> © <?php echo date("Y"); ?> by Ryan Cramer
</p>
<?php if($config->debug && $this->user->isSuperuser()) include($config->paths->adminTemplates . "debug.inc"); ?>
</div>
</div>
</body>
</html>