'Home', 'path' => '/index.php' ), array( 'name' => 'Virtual Hosts', 'path' => '/vhosts.php' ), array( 'name' => 'Emails', 'path' => '/mail.php' ) ), array( 'name' => 'Databases', 'menu' => array( array( 'name' => 'MySQL DB', 'path' => '/db_mysql.php' ), array( 'name' => 'PgSQL DB', 'path' => '/db_pgsql.php' ), array( 'name' => 'Redis DB', 'path' => '/db_redis.php' ), array( 'name' => 'Memcached DB', 'path' => '/db_memcd.php' ) ) ), array( 'name' => 'Info', 'menu' => array( array( 'name' => 'PHP Info', 'path' => '/info_php.php' ), array( 'name' => 'MySQL Info', 'path' => '/info_mysql.php' ), array( 'name' => 'PgSQL Info', 'path' => '/info_pgsql.php' ), array( 'name' => 'Redis Info', 'path' => '/info_redis.php' ), array( 'name' => 'Memcached Info', 'path' => '/info_memcd.php' ) ) ), array( 'name' => 'Tools', 'menu' => array( array( 'name' => 'phpMyAdmin', 'path' => (strpos(loadClass('Php')->getVersion(), '5.4') !== false) ? '/vendor/phpmyadmin-4.0/index.php' : '/vendor/phpmyadmin-4.7/index.php', 'target' => '_blank' ), array( 'name' => 'Adminer', 'path' => '/vendor/adminer-4.3.1/adminer/index.php' ), array( 'name' => 'Opcache GUI', 'path' => '/opcache.php' ) ) ) ); /** * Get Navigation menu * @param mixed[] $menu Menu Array * @return string */ function get_menu($menu) { $path = $_SERVER['PHP_SELF']; $html = ''; foreach ($menu as $type => $elements) { if (!isset($elements['menu'])) { foreach ($elements as $el) { if ($path == $el['path']) { $class = 'active'; $span = '(current)'; } else { $class = ''; $span = ''; } $html .= ''; } } else { $name = $elements['name']; $class = ''; $id = md5($name); // Make submenu active foreach ($elements['menu'] as $el) { if (strpos($path, $el['path']) !== false) { $class = 'active'; break; } } $html .= ''; } } return $html; } ?>