Uploaded image for project: 'Observium'
  1. Observium
  2. OBS-4185

Menu Graphs, Minigraphs, Quick Filters : the "active" class doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Professional Edition
    • Ports
    • None

    Description

      On the page "device/device=XXX/tab=ports", the submenu "Menu Graphs", "Minigraphs", or "Quick Filters" don't show the current choice in the drop-down list.

      When we select a choice, or multichoice (for Quick Filters), the submenu doesn't have an active <li> after the page refresh, even if the choice was correctly applied.

      This makes it difficult to know which Quick Filters are activated for example.

       

      After small search, this menu seems be generate by the fuction "navbar_entry()" (print_navbar > navbar_entry). But the navbar_entry() function doesn't handle the "class" option.

       

      html/pages/device/ports.inc.php :

      if ($filters_array[$option])     {      $navbar['options_right']['filters']['class'] .= ' active';           $navbar['options_right']['filters']['suboptions'][$option]['class'] = 'active';
      

       

      We can solve the problem with handle "class" in function navbar_entry()

      includes/print/navbar.inc.php :

         if (isset($entry['title']))
          {
            $entry_text .= $entry['title'];
          } elseif (isset($entry['text'])) {
            $entry_text .= $entry['text'];
          }
      +    if (isset($entry['class'])) {
      +      $entry_class = $entry['class'];
      +    } else {
      +      $entry_class = "";
      +    }
           echo(str_pad('',($level-1)*2) . '                <li class="'.$entry_class.'">' . generate_menu_link_new($entry) . '</li>' . PHP_EOL);
      

       

      I'm not sure it's the correct method with Obserivum implementation, but I hope that's can be help to understand the bug and correct this with correct way

       

      Attachments

        Activity

          People

            landy Mike Stupalov
            johann Johann Mallet
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: