mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-10 00:29:27 +00:00
8b28b48ff9
- Removed controller application/controllers/system/infocenter/InfocenterDetails.php - Removed method _getFilterList from controller system/infocenter/InfoCenter.php - Added method _setNavigationMenuArray to controller system/infocenter/InfoCenter.php to generate the array for the left menu - Added public method getFilterList to model Filters_model - Removed view application/views/widgets/navigation.php - Removed widget application/widgets/navigation.php - Widget application/widgets/FHC_navigation.php now is usable to print any menu from an array
59 lines
1.2 KiB
PHP
59 lines
1.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
*
|
|
*/
|
|
class FHC_navigation extends Widget
|
|
{
|
|
const NAVIGATION_MENU = 'navigationMenu'; //
|
|
|
|
private $navigationMenu;
|
|
|
|
private static $FHC_navigationInstance;
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function display($widgetData)
|
|
{
|
|
$this->navigationMenu = $widgetData;
|
|
|
|
self::$FHC_navigationInstance = $this;
|
|
|
|
$this->view('widgets/fhcnavigation');
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public static function printNavigationMenu()
|
|
{
|
|
foreach (self::$FHC_navigationInstance->navigationMenu as $item)
|
|
self::printNavItem($item);
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public static function printNavItem($item, $depth = 1)
|
|
{
|
|
$expanded = isset($item['expand']) && $item['expand'] === true ? ' active' : '';
|
|
echo '<li class="'.$expanded.'">
|
|
<a href="'.$item['link'].'"'.$expanded.'>'.(isset($item['icon']) ? '<i class="fa fa-'.$item['icon'].' fa-fw"></i> ' : '').$item['description'].(!empty($item['children']) ? '<span class="fa arrow"></span>':'').'</a>';
|
|
if (!empty($item['children']))
|
|
{
|
|
$level = '';
|
|
if ($depth === 1)
|
|
$level = 'second';
|
|
elseif ($depth > 1)
|
|
$level = 'third';
|
|
|
|
echo '<ul class="nav nav-'.$level.'-level" '.$expanded.'>';
|
|
foreach ($item['children'] as $child)
|
|
self::printNavItem($child, ++$depth);
|
|
echo '</ul>';
|
|
}
|
|
echo '</li>';
|
|
}
|
|
}
|