Changeset 2379 in ExiteCMS
- Timestamp:
- 07/10/11 14:00:17 (11 months ago)
- File:
-
- 1 edited
-
trunk/includes/menu_include.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/menu_include.php
r2375 r2379 98 98 99 99 // get all menu records for this panel and this parent 100 $result = dbquery("SELECT * FROM ".$db_prefix."site_links ".$where." ORDER BY link_ order");100 $result = dbquery("SELECT * FROM ".$db_prefix."site_links ".$where." ORDER BY link_parent ASC, link_order ASC"); 101 101 // process the results 102 $total = dbrows($result); 103 $current = 0; 102 $current = $start = count($linkinfo); 104 103 while($data = dbarray($result)) { 105 104 // only include records that the user is allowed to see (unless showall is specified) 106 105 if ($no_sec || checkgroup($data['link_visibility'])) { 107 106 // true if this is the first menu item 108 $data['menu_first'] = $current == 0? 1 : 0;107 $data['menu_first'] = $current == $start ? 1 : 0; 109 108 // for the first menu item, check if there's a menu_state cookie stored for this menu 110 109 $data['div_state'] = -1; … … 133 132 // get the name of the user group attached to this link 134 133 $data['link_visibility_name'] = getgroupname($data['link_visibility'], '-1'); 135 $data['has_submenu'] = 0;134 $data['has_submenu'] = false; 136 135 $linkinfo[$current] = $data; 137 136 $current++; … … 145 144 } 146 145 147 // set the flag of the last menu entry 148 isset($linkinfo[$current-1]) && $linkinfo[$current-1]['menu_last'] = 1; 149 150 return ($total == 0 ? 0 : 1); 146 // any entries found? 147 if ($current != $start) { 148 // set the flag of the last menu entry 149 $linkinfo[$current-1]['menu_last'] = 1; 150 return true; 151 } else { 152 return false; 153 } 151 154 } 152 155 ?>
Note: See TracChangeset
for help on using the changeset viewer.
