<?
// вывод списка пунктом меню админки - главное меню
function clss_95_list_items($list_recs,$options=array())
{  if (is_object($options['to_member'])) $list_items=execSQL('select obj_name from '.TM_PERSONAL.' where parent='.$options['to_member']->id) ;
   foreach($list_recs as $rasd_name=>$rasd_items)
   { if (_sizeof($rasd_items))
     {?><h1><? echo $rasd_name?></h1><?
         foreach ($rasd_items as $item) if (_sizeof($item))
            if (!is_object($options['to_member'])) show_menu_item($item) ;
            else                                   show_menu_item_check($item,isset($list_items[$item['href']])) ;
      ?><div class=clear></div><?
     }
   }
}
    function show_menu_item($rec_item)
       { //$img_name=(($rec_item['icon'])? _PATH_TO_ADMIN.'/img/'.$rec_item['icon']:_PATH_TO_ADMIN_IMG.'/document.gif') ;
   		 //if ($rec_item['icon_ext']) $img_name=$rec_item['icon_ext'] ;
   		 //if (mb_substr($rec_item['icon'],0,1)=='/') $img_name=$rec_item['icon'] ;
         //$target=($rec_item['target'])? $target='target='.$rec_item['target']:'' ;
         //$id=($rec_item['id'])? $id='class='.$rec_item['id']:'' ;

   		 //$img="<img src='".$img_name."' alt='' border=0	/>" ;
   		 //$href=(strpos($rec_item['href'],_MAIN_PROTOCOL)!==false)? $rec_item['href']:_PATH_TO_ADMIN.'/'.$rec_item['href'] ;
   		 //$href=(strpos($rec_item['href'],_MAIN_PROTOCOL)!==false)? $rec_item['href']:'/admin/'.$rec_item['href'] ;

         $arr=array() ; $img_src=_PATH_TO_ADMIN_IMG.'/document.gif' ; $title='' ;
         if (_sizeof($rec_item))  foreach($rec_item as $tag=>$value)
          switch($tag)
             {  case 'onclick':     $arr[]=$value ; break ; // для совместимости
                case 'name':        $title=$value ; break ;
                case 'icon':        $img_src=(mb_substr($value,0,1)=='/')? $value:_PATH_TO_ADMIN.'/img/'.$value ; break ;
                case 'icon_ext':    $img_src=$value ; break ;
                case 'href':        $href=$value ;
                                    $arr[]='href="'.$href.'"' ;
                                    break ;
                default: $arr[]=$tag.'="'.$value.'"' ;
             }

            //damp_array($arr) ;
          if (_sizeof($arr)) $a_tags=implode(' ',$arr) ;
            ?><div class=item>
                  <a <?echo $a_tags?>><img src='<?echo $img_src?>' alt='' border=0	/></a><br />
                  <a <?echo $a_tags?>><? echo $title?></a>
              </div>
            <?
       }

    function show_menu_item_check($rec_item,$status)
       { $img_name=($status)? 'document.gif':'document_off.gif' ;
   		 $img="<img src='"._PATH_TO_ADMIN_IMG.'/'.$img_name."' width=48 height=48 alt='' border=0	/>" ;
            ?><div class=item>
                  <? echo $img ?><br />
                  <input name="menu_item_check[<?echo $rec_item['href']?>]" type="checkbox" value="1" <?if ($status) echo 'checked'; ?>><br />
                  <? echo $rec_item['name']?>
              </div>
            <?
       }



?>
