1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-11 15:45:07 +02:00

Add Monstra from HG Commit 683dcb70c4cc

This commit is contained in:
Awilum
2012-09-25 19:09:50 +03:00
parent d2db42b2bb
commit 4a5fea5f5b
251 changed files with 35026 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
<?php
$anchor_active = '';
$li_active = '';
$target = '';
if (count($items) > 0) {
foreach ($items as $item) {
$item['link'] = Html::toText($item['link']);
$item['name'] = Html::toText($item['name']);
$pos = strpos($item['link'], 'http://');
if ($pos === false) {
$link = Option::get('siteurl').$item['link'];
} else {
$link = $item['link'];
}
if (isset($uri[1])) {
$child_link = explode("/",$item['link']);
if (isset($child_link[1])) {
if (in_array($child_link[1], $uri)) {
$anchor_active = ' class="current" ';
$li_active = ' class="active"';
}
}
}
if (isset($uri[0]) && $uri[0] !== '') {
if (in_array($item['link'], $uri)) {
$anchor_active = ' class="current" ';
$li_active = ' class="active"';
}
} else {
if ($defpage == trim($item['link'])) {
$anchor_active = ' class="current" ';
$li_active = ' class="active"';
}
}
if (trim($item['target']) !== '') {
$target = ' target="'.$item['target'].'" ';
}
echo '<li'.$li_active.'>'.'<a href="'.$link.'"'.$anchor_active.$target.'>'.$item['name'].'</a>'.'</li>';
$anchor_active = '';
$li_active = '';
$target = '';
}
}