Location: PHPKode > projects > OpenBizMap > obm2007.1/mydata/script/inc_menu.txt
<?php
/*
OpenDataBag - Data Web Interface
Copyright (C) 2004 Nawara

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

$accesskey_array=array();

echo '<ul id="csstopmenu" style="margin-left:1px;">';

  $is_first_menu=1;
  reset($menu_array);
  while(list($menu_name,$submenu)=each($menu_array))
  {
    $menu_link='';
    $submenu_array=array();

    if($mm1==$menu_name)
      echo '<li class="mainitems glow">';
    else
      echo '<li class="mainitems">';

    if(is_array($submenu))
    {
      $is_first_submenu=1;
      $submenu_array=$submenu;

      echo '<div class="headerlinks"><a>';
      echo myecho($menu_name,'RETURN');
      echo '</a></div>';
      echo '<ul class="submenus">';
      while(list($submenu_name,$submenu_link)=each($submenu_array))
      {
        if($submenu_link=='')
        {
          echo '<li> ------------------- ';
          echo '</li>';
        }
        else
        {
          if($mm2==$submenu_name)
            echo '<li class="glow">';
          else
            echo '<li>';

          $accesskey_letter='';
          if(substr($submenu_link,0,4)=='http')
            echo '<a href="'.$submenu_link.'">';
          else
          {
            if(file_exists(cfg_base_path.'/'.linkname($menu_name).'-'.linkname($submenu_name).'.php'))
            {
              $accesskey_name=purename(myecho($submenu_name,'RETURN')).'abcdefghijklmnopqrstuwvxyz';
              $accesskey_pos=0;
              while(isset($accesskey_array[$accesskey_name[$accesskey_pos]]))
              {
                $accesskey_pos++;
                if($accesskey_pos>=30)
                  break;
              }
    
              if($accesskey_pos<30)
              {
                $accesskey_array[$accesskey_name[$accesskey_pos]]=1;
                $accesskey_letter=$accesskey_name[$accesskey_pos];
              }

              echo '<a accesskey="'.$accesskey_letter.'" href="'.linkname($menu_name).'-'.linkname($submenu_name).'.php">';
            }
            else
              echo '<a href="index.php?'.$submenu_link.'&amp;odb_mm1='.$menu_name.'&amp;odb_mm2='.$submenu_name.'&amp;">';
          }
          $accesskey_name=myecho($submenu_name,'RETURN');
          $tmp_pos=strpos('_'.strtolower($accesskey_name),$accesskey_letter);
          if($tmp_pos)
            $accesskey_name=substr($accesskey_name,0,$tmp_pos-1).'<u>'.substr($accesskey_name,$tmp_pos-1,1).'</u>'.substr($accesskey_name,$tmp_pos);
          elseif($accesskey_letter)
            $accesskey_name=$accesskey_name.' ('.$accesskey_letter.')';
          echo $accesskey_name;
          echo '</a>';
          echo '</li>';
          $is_first_submenu=0;
        }
      }
      echo '</ul>';
    }
    else
    {
      $accesskey_letter='';
      $menu_link=$submenu;
      if(substr($menu_link,0,4)=='http')
        echo '<div class="headerlinks"><a href="'.$menu_link.'">';
      else
      {
        if(file_exists(cfg_base_path.'/'.linkname($menu_name).'.php'))
        {
          $accesskey_name=purename(myecho($menu_name,'RETURN')).'abcdefghijklmnopqrstuwvxyz';
          $accesskey_pos=0;
          while(isset($accesskey_array[$accesskey_name[$accesskey_pos]]))
          {
            $accesskey_pos++;
            if($accesskey_pos>=30)
              break;
          }

          if($accesskey_pos<30)
          {
            $accesskey_array[$accesskey_name[$accesskey_pos]]=1;
            $accesskey_letter=$accesskey_name[$accesskey_pos];
          }
          echo '<div class="headerlinks"><a accesskey="'.$accesskey_letter.'" href="'.linkname($menu_name).'.php">';
        }
        else
          echo '<div class="headerlinks"><a href="index.php?'.$menu_link.'&amp;odb_mm1='.$menu_name.'&amp;odb_mm2=">';
      }
      $accesskey_name=myecho($menu_name,'RETURN');
      $tmp_pos=strpos('_'.strtolower($accesskey_name),$accesskey_letter);
      if($tmp_pos)
        $accesskey_name=substr($accesskey_name,0,$tmp_pos-1).'<u>'.substr($accesskey_name,$tmp_pos-1,1).'</u>'.substr($accesskey_name,$tmp_pos);
      elseif($accesskey_letter)
        $accesskey_name=$accesskey_name.' ('.$accesskey_letter.')';
      echo $accesskey_name;
      echo '</a></div>';
    }

    echo '</li>';
    $is_first_menu=0;
  }
  
echo '</ul>';

?>
Return current item: OpenBizMap