"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 community edition return; } $id = strgen(); // Detect allowed screen ratio for current browser, cached! $ua_info = detect_browser(); ?> '); if ($count > 5) { foreach ($array['entries'] as $entry => $entry_data) { $image = get_icon('location'); if ($entry_data['level'] === "location_country") { $entry = country_from_code($entry); $image = get_icon_country($entry); } elseif ($entry_data['level'] === "location") { $name = ($entry === '' ? OBS_VAR_UNSET : escape_html($entry)); echo('
  • ' . generate_menu_link(generate_location_url($entry), $image . ' ' . $name, $entry_data['count']) . '
  • '); 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 = array(''); } $link_array = 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 = array(); foreach ($array['entries'] as $new_entry => $new_entry_data) { $image = get_icon('location'); if ($new_entry_data['level'] === "location_country") { $new_entry = country_from_code($new_entry); $image = get_icon_country($new_entry); } elseif ($new_entry_data['level'] === "location") { $name = ($new_entry === '' ? OBS_VAR_UNSET : escape_html($new_entry)); echo('
  • ' . generate_menu_link(generate_location_url($new_entry), $image . ' ' . $name, $new_entry_data['count']) . '
  • '); continue; } echo(''); foreach ($new_entry_data['entries'] as $sub_entry => $sub_entry_data) { if (is_array($sub_entry_data['entries'])) { $link_array = 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(''); } // DOCME needs phpdoc block function navbar_submenu($entry, $level = 1) { if(isset($entry['text'])) { $entry['title'] = $entry['text']; } // 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 ($entry['divider']) { echo(str_pad('',($level-1)*2) . '
  • ' . PHP_EOL); } elseif (isset($entry['userlevel']) && isset($_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 ($entry['locations']) {// Workaround until the menu builder returns an array instead of echo() echo(str_pad('',($level-1)*2) . ' ' . PHP_EOL); } else { //$entry_text = ' '; $entry_text = ''; if (isset($entry['image'])) { // Detect allowed screen ratio for current browser, cached! $ua_info = detect_browser(); if (isset($entry['image_2x']) && $ua_info['screen_ratio'] > 1) { // Add hidpi image set $srcset = ' srcset="' . $entry['image_2x'] . ' 2x"'; } else { $srcset = ''; } $entry_text .= ' '; } if (isset($entry['title'])) { $entry_text .= $entry['title']; } elseif (isset($entry['text'])) { $entry_text .= $entry['text']; } $entry['text'] = $entry_text; echo(str_pad('',($level-1)*2) . '
  • ' . generate_menu_link_new($entry) . '
  • ' . PHP_EOL); } } // EOF