--- menu.inc	Thu Jun  1 15:22:02 2006
+++ menu.inc	Tue Oct  3 16:04:16 2006
@@ -1,5 +1,13 @@
 <?php
-// $Id: menu.inc,v 1.120.2.1 2006/06/01 13:22:02 killes Exp $
+/**
+ *  Navigation bugfix: primary links was not distinguished when secondary link is active.
+ *  Modifyed functions:
+ *     menu_primary_links
+ *     menu_item_link
+ *     theme_menu_item_link
+ *  0:16:00 2006/09/01
+ *   on base $Id: menu.inc,v 1.120.2.1 2006/06/01 13:22:02 killes Exp $
+ */
 
 /**
  * @file
@@ -691,11 +699,19 @@ function theme_menu_item($mid, $children
  *   The menu item to render.
  * @param $link_item
  *   The menu item which should be used to find the correct path.
+ * @param $act
+ *   если равен TRUE в ссылку добавляется класс active
+ *   по умолчанию равен FALSE
+ *   Navigation bugfix: primary links was not distinguished when secondary link is active.
+ *   0:16:00 2006/09/01
  *
  * @ingroup themeable
  */
-function theme_menu_item_link($item, $link_item) {
-  return l($item['title'], $link_item['path'], isset($item['description']) ? array('title' => $item['description']) : array());
+function theme_menu_item_link($item, $link_item, $act = false) {
+  $a = array();
+  if ($act) $a = array('class' => 'active');
+  $a = array_merge($a, isset($item['description']) ? array('title' => $item['description']) : array());
+  return l($item['title'], $link_item['path'], $a);
 }
 
 /**
@@ -703,16 +719,22 @@ function theme_menu_item_link($item, $li
  *
  * @param $mid
  *   The menu item id to render.
+ * @param $act
+ *   if equal TRUE в added class active in the link,
+ *   equal FALSE by defoult
+ *   Navigation bugfix: primary links was not distinguished when secondary link is active.
+ *  0:16:00 2006/09/01
+ *
  */
-function menu_item_link($mid) {
+function menu_item_link($mid, $act = false) {
   $item = menu_get_item($mid);
   $link_item = $item;
-
+  
   while ($link_item['type'] & MENU_LINKS_TO_PARENT) {
     $link_item = menu_get_item($link_item['pid']);
   }
-
-  return theme('menu_item_link', $item, $link_item);
+  
+  return theme('menu_item_link', $item, $link_item, $act);
 }
 
 /**
@@ -799,6 +821,9 @@ function theme_menu_local_task($mid, $ac
  * current node for a specified number of levels and return that submenu.
  * Used to generate a primary/secondary menu from different levels of one menu.
  *
+ *  Navigation bugfix: primary links was not distinguished when secondary link is active.
+ *  0:16:00 2006/09/01 
+ *
  * @param $start_level
  *   This optional parameter can be used to retrieve a context-sensitive array
  *   of links at $start_level levels deep into the Primary links menu.
@@ -812,6 +837,8 @@ function theme_menu_local_task($mid, $ac
  *   level is the depth within the menu tree of this list.
  *   num is the number within this array, used only to make the key unique.
  *   -active is appended if this element is in the active trail.
+ *
+ *
  */
 function menu_primary_links($start_level = 1, $pid = 0) {
   if (!module_exist('menu')) {
@@ -843,14 +870,15 @@ function menu_primary_links($start_level
     $count = 1;
     foreach ($menu['visible'][$pid]['children'] as $cid) {
       $index = "menu-$start_level-$count";
+	  $act = false;
       if (menu_in_active_trail_in_submenu($cid, $pid)) {
         $index .= "-active";
+		$act = true;
       }
-      $links[$index] = menu_item_link($cid);
+      $links[$index] = menu_item_link($cid, $act);
       $count++;
     }
   }
-
   // Special case - provide link to admin/menu if primary links is empty.
   if (empty($links) && $start_level == 1 && $pid == variable_get('menu_primary_menu', 0)) {
     $links['1-1'] = l(t('edit primary links'),'admin/menu');
