Изменения в файле jquerymenu.module решают проблему отображения активного пункта меню. Изменения выделены красным цветом. Версия модуля 6.x-3.3.
function recursive_link_creator($items = array(), $trail) {
$url_array = $trail;
$i = 0;
if (!empty($items)) {
foreach ($items as $item) {
$classes = array();
$state = 'closed';
// If there are submenu items we assign the parent a class.
if (!empty($item['link']['has_children'])) {
$nextlevel = '';
$nextlevel = recursive_link_creator($item['below'],$url_array);
if (!empty($nextlevel)) {
$classes[] = 'parent';
}
}
// BOF patch: active menu item highlight
$current_path_alias = drupal_get_path_alias($_GET["q"]);
$menu_link_alias = drupal_get_path_alias($item['link']['href']);
$current_prod_menu_alias = substr($current_path_alias,0,strlen($menu_link_alias));
if ($current_prod_menu_alias == $menu_link_alias) {
$classes[] = 'active';
}
// EOF patch
// If the menu item is expanded or in the active trail and if has children add the "open" class.
if (!empty($item['link']['expanded']) || ((in_array($item['link']['href'], $url_array) || ($_GET['q'] == $item['link']['href'])) && !empty($item['link']['has_children']) && !empty($nextlevel))) {
$classes[] = 'open';
$state = 'open';
}
// BOF patch: expanded parent menu item
elseif ($current_prod_menu_alias == $menu_link_alias) {
$classes[] = 'open';
$state = 'open';
}
// EOF patch
elseif (!empty($item['below']) && !empty($nextlevel)) {
$classes[] = 'closed';
}
if (in_array($item['link']['href'], $url_array)) {
$classes[] = 'active-trail';
}
if ($_GET['q'] == $item['link']['href']) {
$classes[] = 'active';
}
$options = array();
if (isset($item['link']['options'])) {
$options = $item['link']['options'];
}
if (variable_get('jq_edit_link', 1) == 1) {
if (empty($item['link']['editpath'] )) {
if (!empty($item['link']['mlid'])) {
$editpath = 'admin/build/menu/item/'.$item['link']['mlid'].'/edit';
}
}
else {
$editpath = $item['link']['editpath'];
}
}
if (empty($item['link']['editaccess'])) {
$editaccess = 'administer menu';
}
else {
$editaccess = $item['link']['editaccess'];
}
if (empty($item['link']['edit_text'])) {
$edit_text = t('Edit this link');
}
else {
$edit_text = $item['link']['edit_text'];
}
if (!empty($item['link']['to_arg_functions'])) {
$toarg_array = array();
$patharray = explode('/', $item['link']['href']);
foreach ($patharray as $chunk) {
if ($chunk != '%') {
$toarg_array[] = $chunk;
}
else {
$function = $item['link']['to_arg_functions'];
$function = explode('"', $function);
$function = $function[1];
$toarg_array[] = $function('%');
}
}
$path = implode('/', $toarg_array);
}
else {
$path = $item['link']['href'];
}
if ($item['link']['hidden'] == 1 && !empty($item['link']['has_children'])) {
$output .= recursive_link_creator($item['below'], $url_array);
}
if ($item['link']['hidden'] != 1 && $item['link']['hidden'] != -1) {
$output .= '<li'. (empty($classes) ? '>' : ' class="'. implode(' ', $classes) .'">');
$output .= theme('jqmenu_links', $item['link']['title'], $path, $options, $state, $classes, $item['link']['has_children'], $editpath, $edit_text, $edit_access);
if (!empty($item['link']['has_children'])) {
if (!empty($nextlevel)) {
$output .= '<ul>';
// If the link has children call the function on itself.
$output .= $nextlevel;
$output .= '</ul>';
}
}
$output .= '</li>';
}
}
}
return $output;
}
function recursive_link_creator($items = array(), $trail) {
//BOF patch: current path estimation
$current_path_alias = drupal_get_path_alias($_GET["q"]); // i.e. catalog/canon/canon-7D
$curr_path_alias_arr = explode("/",$current_path_alias); // i.e. Array ( [0] => catalog [1] => canon [2] => canon-7D )
$cur_cat = $curr_path_alias_arr[1]; // canon
//EOF patch
$url_array = $trail;
$i = 0;
if (!empty($items)) {
foreach ($items as $item) {
$classes = array();
$state = 'closed';
// If there are submenu items we assign the parent a class.
if (!empty($item['link']['has_children'])) {
$nextlevel = '';
$nextlevel = recursive_link_creator($item['below'],$url_array);
if (!empty($nextlevel)) {
$classes[] = 'parent';
}
}
// BOF patch: active menu item highlight
$menu_link_alias = drupal_get_path_alias($item['link']['href']); //i.e. catalog/canon
$menu_link_arr = explode("/",$menu_link_alias); // i.e. Array ( [0] => catalog [1] => canon )
$cur_link = $menu_link_arr[1]; // canon
if ($cur_link == $cur_cat) {
$classes[] = 'active';
}
// EOF patch
// If the menu item is expanded or in the active trail and if has children add the "open" class.
if (!empty($item['link']['expanded']) || ((in_array($item['link']['href'], $url_array) || ($_GET['q'] == $item['link']['href'])) && !empty($item['link']['has_children']) && !empty($nextlevel))) {
$classes[] = 'open';
$state = 'open';
}
// BOF patch: expanded parent menu item
elseif ($cur_link == $cur_cat) {
$classes[] = 'open';
$state = 'open';
}
// EOF patch
elseif (!empty($item['below']) && !empty($nextlevel)) {
$classes[] = 'closed';
}
if (in_array($item['link']['href'], $url_array)) {
$classes[] = 'active-trail';
}
if ($_GET['q'] == $item['link']['href']) {
$classes[] = 'active';
}
$options = array();
if (isset($item['link']['options'])) {
$options = $item['link']['options'];
}
if (variable_get('jq_edit_link', 1) == 1) {
if (empty($item['link']['editpath'] )) {
if (!empty($item['link']['mlid'])) {
$editpath = 'admin/build/menu/item/'.$item['link']['mlid'].'/edit';
}
}
else {
$editpath = $item['link']['editpath'];
}
}
if (empty($item['link']['editaccess'])) {
$editaccess = 'administer menu';
}
else {
$editaccess = $item['link']['editaccess'];
}
if (empty($item['link']['edit_text'])) {
$edit_text = t('Edit this link');
}
else {
$edit_text = $item['link']['edit_text'];
}
if (!empty($item['link']['to_arg_functions'])) {
$toarg_array = array();
$patharray = explode('/', $item['link']['href']);
foreach ($patharray as $chunk) {
if ($chunk != '%') {
$toarg_array[] = $chunk;
}
else {
$function = $item['link']['to_arg_functions'];
$function = explode('"', $function);
$function = $function[1];
$toarg_array[] = $function('%');
}
}
$path = implode('/', $toarg_array);
}
else {
$path = $item['link']['href'];
}
if ($item['link']['hidden'] == 1 && !empty($item['link']['has_children'])) {
$output .= recursive_link_creator($item['below'], $url_array);
}
if ($item['link']['hidden'] != 1 && $item['link']['hidden'] != -1) {
$output .= '<li'. (empty($classes) ? '>' : ' class="'. implode(' ', $classes) .'">');
$output .= theme('jqmenu_links', $item['link']['title'], $path, $options, $state, $classes, $item['link']['has_children'], $editpath, $edit_text, $edit_access);
if (!empty($item['link']['has_children'])) {
if (!empty($nextlevel)) {
$output .= '<ul>';
// If the link has children call the function on itself.
$output .= $nextlevel;
$output .= '</ul>';
}
}
$output .= '</li>';
}
}
}
return $output;
}
|
Стилизация сайтов, создание стилевых шаблонов (Новый Год, 8 марта...), брендирование сайтов, Flash-анимация. |
Современный, быстрый и надежный движок сайта, позволяющий наращивать функциональность. Регулярное обновление ядра и модулей. Разработка новых модулей, позволяющих решать индивидуальные задачи клиента |
|
|
Максимальный уровень автоматизации для облегчения наполнения и обслуживания сайта! Автоматическая обработка изображений, обновление карты сайта для быстрой индексации поисковиками, автоматическая проверка обновлений и другие полезные функции. |
|
Поисковая о Начальная поисковая оптимизация уже включена в любой создаваемый нами сайт! Автоматическая карта сайта для Google, Yandex, Bing, а также панель Google analytics входит в стоимость всех наших сайтов. |
Удобная и интуитивная админка. Создание и правка контента прямо с административной страницы. Простой и добный редактор (похож на MS Word). Разграничение прав доступа пользователей, возможность оперативно менять дизайн сайта (темы оформления) и др. |
|
Оперативное устрание неполадок, консультация пользователей, техническое обслуживание и контент менеджмент. Мы можем взять все заботы о вашем сайте на себя. |
Гаран Мы гарантируем стабильность и надежность созданных нами сайтов. Полную гарантию работоспособности мы предоставляем лишь при условии использования нашего хостинга. |