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;
}
#menu li { a {
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 {
self:hover {
background-color: #e9e9e9; background-color: #e9e9e9;
} }
#menu .active { }
.active {
background-color: #9b9b9b !important; background-color: #9b9b9b !important;
color: #fff; color: #fff;
} }
#menu .icon { .icon {
position: absolute; position: absolute;
top: 14px; top: 14px;
right: 12px; right: 12px;
width: 16px; width: 16px;
height: 14px; 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(
'css/(.*)' => 'css_handler',
'js/(.*)' => 'js_handler',
'' => 'layout',
'(.*)' => 'content'
));
header('Vary: Accept-Encoding');
$handler = strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false ? 'ob_gzhandler' : '';
ob_start($handler);
_url($_SERVER['QUERY_STRING'])->handler();
ob_end_flush();
/**
*
*
* @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';
}
function layout() {
header('Content-Type: text/html; charset=utf-8');
$menu = array(
array('Pagina\'s', 'pages'), array('Pagina\'s', 'pages'),
array('Nieuws', 'news'), array('Nieuws', 'news'),
array('Foto\'s', 'photos'), array('Foto\'s', 'photos'),
array('Accounts', 'accounts'), array('Accounts', 'accounts'),
array('Instellingen', 'settings'), array('Instellingen', 'settings'),
array('Uitloggen', 'logout') array('Uitloggen', 'logout')
); );
$layout = _tpl('layout');
$layout = _tpl('layout'); foreach( $menu as $i => $item ) {
foreach( $menu as $i => $item ) {
list($title, $icon) = $item; list($title, $icon) = $item;
$item = $layout->data->add('menu')->set(array('title' => $title, 'icon' => $icon)); $item = $layout->data->add('menu')->set(array('title' => $title, 'icon' => $icon));
$i || $item->set('active', 'active'); $i || $item->set('active', 'active');
} }
echo $layout->parse(); 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