Модуль "Горизонтальное выпадающее меню"
Попытки вставить
Код PHP:1 $(this).addClass('selected');
Может быть кто-нибудь поможет?
$menu_name = 'mainmenu'; //какое меню выводить $max_items = 7; //Количетсво полностью отображаемых пунктов /*End Конфиг************************************************************************************/ function mod_hmenu($module_id,$menu_name,$max_items){ global $_CFG; $menuid = cmsMenuId(); if (isset($_SESSION['user']['id'])){ $user_group = $_SESSION['user']['group_id']; } else { $user_group = cmsGuestGroup(); } $sql = "SELECT NSLeft, NSRight, NSLevel FROM cms_menu WHERE id = $menuid"; $result = mysql_query($sql) or die(mysql_error()); $currentmenu = mysql_fetch_assoc($result); mysql_free_result($result); $root_id = dbGetField('cms_menu', 'parent_id=0', 'id'); $nested_sets = cmsNestedSetsInit('cms_menu'); $rs_rows = $nested_sets->SelectSubNodes($root_id); $last_level = -1; ob_start(); echo '<div id="hmenu" class="hmenu" align="center"><ul>'; $m_count = 0; $splitit = 0; $is_admin = false; if(isset($_SESSION['user']['id'])) { if (cmsUserIsAdmin($_SESSION['user']['id'])) { $is_admin = true; } } while ($row = mysql_fetch_assoc($rs_rows)){ if ($row['menu'] == $menu_name){ $_2levellink=''; $menulink = cmsMenuSeoLink($row['link'], $row['linktype'], $row['id']); if ($row['allow_group']==-1 || $row['allow_group']==$user_group || $is_admin){ if($row['published']){ // BUILD ITEM ///////////////////////////////////////////////////////////////////// if (!$row['iconurl']) { $fileicon = '/includes/jquery/treeview/images/file.gif'; $foldericon = '/includes/jquery/treeview/images/folder-closed.gif'; } else { $fileicon = '/images/menuicons/'.$row['iconurl']; $foldericon = '/images/menuicons/'.$row['iconurl']; } ////// if ( $row['NSLevel']==1) {$m_count++;} if ($row['id']!=$menuid){ //link target if ($row['target']) { $target = $row['target']; } else { $target = '_self'; } $link = '<a target="'.$target.'" class="'.$css_menulink.'" href="'.$menulink.'" style="background: url('.$fileicon.')">'.$row['title'].'</a>'; } else { $link = '<div class="file" style="background: url('.$fileicon.')">'.$row['title'].'</div>'; } if ($m_count==$max_items && !$splitit ){$_2levellink='<a href="#" style="background: url('.$fileicon.')">More.....</a><ul><li>';$splitit = 1;} if ( $row['NSLevel'] < $last_level ) { echo str_repeat('</ul></li>', $last_level-$row['NSLevel']); } if ( $row['NSRight'] - $row['NSLeft'] == 1 ){ // если разница единица, то значит у него нет потомков echo '<li>'.$_2levellink.$link.'</li>'; } else { echo '<li>'.$_2levellink.'<a href="'.$menulink.'" style="background: url('.$foldericon.')">'.$row['title'].'</a><ul>'; } $last_level = $row['NSLevel']; //////////////////////////////////////////////////////////////////////////////////// } } } } echo ($splitit)?'</ul></ul></div>':'</ul></div>'; ?> <link href="/templates/<?php echo $_CFG['template']; ?>/css/hmenu.css" rel="stylesheet" type="text/css"> <?php return true; } mod_hmenu(0,$menu_name,$max_items); ?>