"Apps", 'class' => "navbar-narrow", 'options' => array('mysql' => array('text' => "MySQL", 'url' => generate_url($vars, * 'app' => "mysql"))))) * * @param array $vars * * @return null * */ function print_tabbar($tabbar) { $output = ''; echo $output; } /** * Generate Bootstrap-format navigation bar * * A little messy, but it works and lets us move to having no navbar markup on pages :) * Examples: * print_navbar(array('brand' => "Apps", 'class' => "navbar-narrow", 'options' => array('mysql' => array('text' => "MySQL", 'url' => generate_url($vars, * 'app' => "mysql"))))) * * @param array $vars * * @return void * */ function print_navbar($navbar) { global $config; if (OBSERVIUM_EDITION === 'community' && isset($navbar['community']) && $navbar['community'] === FALSE) { // Skip nonexistent features on a community edition return; } $id = random_string(); // Detect an allowed screen ratio for current browser, cached! $ua_info = detect_browser(); ?> '); if ($count > 5) { foreach ($array['entries'] as $entry => $entry_data) { $icon = 'location'; if ($entry_data['level'] === "location_country") { $entry = $entry === '' ? OBS_VAR_UNSET : country_from_code($entry); $icon = get_icon_country($entry); } elseif ($entry_data['level'] === "location") { $name = $entry === '' ? OBS_VAR_UNSET : $entry; echo('
  • ' . generate_menu_link_ng([ 'url' => generate_location_url($entry), 'icon' => $icon, 'count' => $entry_data['count'] ], $name) . '
  • '); continue; } if ($entry_data['level'] === "location_country") { $url = $entry; // Attach country code to sublevel $entry_data['country'] = $entry; } else { $url = $entry; // Attach country code to sublevel $entry_data['country'] = $array['country']; } if ($url === '') { $url = ['']; } $link_array = [ 'page' => 'devices', $entry_data['level'] => var_encode($url) ]; if (isset($array['country'])) { $link_array['location_country'] = var_encode($array['country']); } echo(''); } } else { $new_entry_array = []; foreach ($array['entries'] as $new_entry => $new_entry_data) { $icon = 'location'; if ($new_entry_data['level'] === "location_country") { $new_entry = country_from_code($new_entry); $icon = get_icon_country($new_entry); } elseif ($new_entry_data['level'] === "location") { $name = $new_entry === '' ? OBS_VAR_UNSET : $new_entry; //echo('
  • ' . generate_menu_link(generate_location_url($new_entry), $image . ' ' . $name, $new_entry_data['count']) . '
  • '); echo('
  • ' . generate_menu_link_ng([ 'url' => generate_location_url($new_entry), 'icon' => $icon, 'count' => $new_entry_data['count'] ], $name) . '
  • '); continue; } echo(''); foreach ($new_entry_data['entries'] as $sub_entry => $sub_entry_data) { if (is_array($sub_entry_data['entries'])) { $link_array = [ 'page' => 'devices', $sub_entry_data['level'] => var_encode($sub_entry) ]; if (isset($array['country'])) { $link_array['location_country'] = var_encode($array['country']); } //echo('
  • ' . generate_menu_link(generate_location_url($sub_entry), $image . ' ' . $name, $sub_entry_data['count']) . '
  • '); echo('
  • ' . generate_menu_link_ng([ 'url' => generate_location_url($sub_entry), 'icon' => $icon, 'count' => $sub_entry_data['count'] ], $name) . '
  • '); } } } } echo(''); } // DOCME needs phpdoc block function navbar_submenu($entry, $level = 1) { // autoscroll set by navbar-narrow + dropdown-menu, but override max-height echo(str_pad('', ($level - 1) * 2) . '
  • ' . PHP_EOL); } // DOCME needs phpdoc block // FIXME. Move to print navbar function navbar_entry($entry, $level = 1) { global $cache; if (isset($entry['divider']) && $entry['divider']) { echo(str_pad('', ($level - 1) * 2) . '
  • ' . PHP_EOL); } elseif (isset($entry['userlevel'], $_SESSION['userlevel']) && $_SESSION['userlevel'] < $entry['userlevel']) { // skip not permitted menu items return; } elseif (OBSERVIUM_EDITION === 'community' && isset($entry['community']) && !$entry['community']) { // Skip not exist features on community return; } elseif (isset($entry['locations']) && $entry['locations']) {// Workaround until the menu builder returns an array instead of echo() echo(str_pad('', ($level - 1) * 2) . ' ' . PHP_EOL); } else { if (isset($entry['class'])) { $entry_class = ' class="' . $entry['class'] . '"'; } else { $entry_class = ''; } echo(str_pad('', ($level - 1) * 2) . '
  • ' . generate_menu_link_ng($entry) . '
  • ' . PHP_EOL); } } function print_navbar_stats_debug() { global $config, $sql_profile; if ($_SESSION['userlevel'] < 7) { return; } if (!safe_empty($GLOBALS['dump'])) { ?>