Changeset 222


Ignore:
Timestamp:
07/05/10 10:19:53 (19 months ago)
Author:
fuze
Message:

Модуль "горизонтальное меню" вынесен в шаблон. target ссылки теперь выводится.

Location:
branches/fuze
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • branches/fuze/modules/mod_hmenu/module.php

    r181 r222  
    2121                                ORDER BY NSLeft ASC"; 
    2222                $result = $inDB->query($sql) ; 
    23  
     23                $items = array(); 
    2424                if ($inDB->num_rows($result)){ 
    25                         echo '<table align="center" cellpadding="0" cellspacing="0" border="0"><tr>'; 
    2625                        while ($item=$inDB->fetch_assoc($result)){ 
    27                                 //make link URL 
    28                                 $link = $item['link']; 
    29                                                                  
    30                                 if ($item['id']!=$menuid){ 
    31                                         $link = '<td class="menutd"><a target="'.$target.'" class="menulink" href="'.$link.'" >'.$item['title'].'</a></td>';     
    32                                 } else { 
    33                                         $link = '<td class="menutd_active"><a target="'.$target.'" class="menulink_active" href="'.$link.'">'.$item['title'].'</a></td>';                                        
    34                                 } 
    35                                  
    36                                 echo $link."\n"; 
    37                                  
     26                                $items[] = $item; 
    3827                        } 
    39                         echo '</tr></table>'; 
    4028                } 
     29                $smarty = $inCore->initSmarty('modules', 'mod_hmenu.tpl');                       
     30                $smarty->assign('items', $items); 
     31                $smarty->assign('menuid', $menuid); 
     32                $smarty->display('mod_hmenu.tpl');       
    4133                return true;     
    4234        } 
Note: See TracChangeset for help on using the changeset viewer.