Commit 34bf3f2e authored by Taddeus Kroes's avatar Taddeus Kroes

This should have been in the previous commit too...

parent acbe79bd
...@@ -49,29 +49,32 @@ a, input { ...@@ -49,29 +49,32 @@ a, input {
padding: 41px 10px 41px 0; padding: 41px 10px 41px 0;
border-right: 1px solid #c5c5c5; border-right: 1px solid #c5c5c5;
font: normal 21px/23px BebasNeueRegular; font: normal 21px/23px BebasNeueRegular;
color: #7e7e7e;
list-style: none; list-style: none;
}
a {
#menu li { position: relative;
position: relative; display: block;
width: 138px; width: 138px;
height: 31px; height: 31px;
padding: 10px 40px 0 12px; padding: 10px 40px 0 12px;
cursor: pointer; color: #7e7e7e;
} text-decoration: none;
#menu li:hover {
background-color: #e9e9e9; self:hover {
} background-color: #e9e9e9;
#menu .active { }
background-color: #9b9b9b !important; }
color: #fff;
} .active {
background-color: #9b9b9b !important;
#menu .icon { color: #fff;
position: absolute; }
top: 14px;
right: 12px; .icon {
width: 16px; position: absolute;
height: 14px; top: 14px;
right: 12px;
width: 16px;
height: 14px;
}
} }
\ No newline at end of file
<?php <?php
//include_once '../debug.php';
include_once 'pquery.config.php'; include_once 'pquery.config.php';
include_once PQUERY_ROOT.'pquery.php'; include_once PQUERY_ROOT.'pquery.php';
__p::require_plugins('template', 'sql'); __p::require_plugins('template', 'sql', 'url', 'js', 'css');
__tpl::set_root('templates'); __tpl::set_root('templates');
$menu = array( __url::add_handlers(array(
array('Pagina\'s', 'pages'), 'css/(.*)' => 'css_handler',
array('Nieuws', 'news'), 'js/(.*)' => 'js_handler',
array('Foto\'s', 'photos'), '' => 'layout',
array('Accounts', 'accounts'), '(.*)' => 'content'
array('Instellingen', 'settings'), ));
array('Uitloggen', 'logout')
); header('Vary: Accept-Encoding');
$layout = _tpl('layout'); $handler = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false ? 'ob_gzhandler' : '';
foreach( $menu as $i => $item ) { ob_start($handler);
list($title, $icon) = $item; _url($_SERVER['QUERY_STRING'])->handler();
$item = $layout->data->add('menu')->set(array('title' => $title, 'icon' => $icon)); ob_end_flush();
$i || $item->set('active', 'active');
/**
*
*
* @param string $files One or more scripts separated by commas (',').
*/
function js_handler($files) {
$prepend_folder = create_function('$x', 'return "js/$x";');
_js(array_map($prepend_folder, explode(',', $files)))->output();
}
function css_handler($files) {
$prepend_folder = create_function('$x', 'return "css/$x";');
_css(array_map($prepend_folder, explode(',', $files)))->output();
}
function content() {
header('Content-Type: text/html; charset=utf-8');
echo 'content';
} }
echo $layout->parse(); function layout() {
header('Content-Type: text/html; charset=utf-8');
$menu = array(
array('Pagina\'s', 'pages'),
array('Nieuws', 'news'),
array('Foto\'s', 'photos'),
array('Accounts', 'accounts'),
array('Instellingen', 'settings'),
array('Uitloggen', 'logout')
);
$layout = _tpl('layout');
foreach( $menu as $i => $item ) {
list($title, $icon) = $item;
$item = $layout->data->add('menu')->set(array('title' => $title, 'icon' => $icon));
$i || $item->set('active', 'active');
}
echo $layout->parse();
}
?> ?>
\ No newline at end of file
...@@ -3,19 +3,26 @@ ...@@ -3,19 +3,26 @@
<head> <head>
<title>Tcms</title> <title>Tcms</title>
<meta charset="utf-8" /> <meta charset="utf-8" />
<link href="css/main.css" rel="stylesheet" /> <link href="css/main" rel="stylesheet" />
<script async type="text/javascript" src="js/jquery-1.7.min,menu,list"></script>
<!--
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$.getScript('js/menu,list');
</script>
-->
</head> </head>
<body> <body>
<div id="wrapper"> <div id="wrapper">
<ul id="menu"> <div id="menu">
{block:menu} {block:menu}
<li class="{active}"> <a href="#{icon}" class="{active}">
{title} {title}
<div class="icon {icon}"></div> <div class="icon {icon}"></div>
</li> </a>
{end} {end}
</ul> </div>
</div> </div>
</body> </body>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment