| 1 |
<?php |
<?php |
| 2 |
// $Id: template.php,v 1.36.2.36 2009/09/11 18:26:20 sign Exp $ |
// $Id: template.php,v 1.36.2.37 2009/10/25 10:15:20 sign Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 85 |
if ($menu_tree) { |
if ($menu_tree) { |
| 86 |
$size = theme_get_setting('rootcandy_navigation_icons_size'); |
$size = theme_get_setting('rootcandy_navigation_icons_size'); |
| 87 |
$icons_disabled = theme_get_setting('rootcandy_navigation_icons'); |
$icons_disabled = theme_get_setting('rootcandy_navigation_icons'); |
| 88 |
$class = ' class = "i'. $size .'"'; |
$list_class = 'i'. $size; |
|
$output = '<ul'. $class .'>'; |
|
| 89 |
|
|
| 90 |
$custom_icons = rootcandy_custom_icons(); |
$custom_icons = rootcandy_custom_icons(); |
| 91 |
if (!isset($custom_icons)) { |
if (!isset($custom_icons)) { |
| 93 |
} |
} |
| 94 |
|
|
| 95 |
$match = _rootcandy_besturlmatch($_GET['q'], $menu_tree); |
$match = _rootcandy_besturlmatch($_GET['q'], $menu_tree); |
| 96 |
|
$items = array(); |
| 97 |
foreach ($menu_tree as $key => $item) { |
foreach ($menu_tree as $key => $item) { |
| 98 |
$id = ''; |
$id = ''; |
| 99 |
$icon = ''; |
$icon = ''; |
| 107 |
if ($icon) $icon = $icon .'<br />'; |
if ($icon) $icon = $icon .'<br />'; |
| 108 |
} |
} |
| 109 |
if ($key == $match) { |
if ($key == $match) { |
| 110 |
$id = ' id="current"'; |
$id = 'current'; |
| 111 |
if (!$icons_disabled && $size) { |
if (!$icons_disabled && $size) { |
| 112 |
$id = ' id="current-'. $size .'"'; |
$id = 'current-'. $size; |
| 113 |
} |
} |
| 114 |
} |
} |
| 115 |
|
|
| 116 |
// add a class to li |
// add a class to li |
| 117 |
$class = ""; |
$class = ""; |
| 118 |
if (is_array($arg)) { |
if (is_array($arg)) { |
| 119 |
$class = ' class="'. implode($arg, '-') .'"'; |
$class = implode($arg, '-'); |
| 120 |
} |
} |
| 121 |
|
|
| 122 |
$output .= '<li'. $id . $class .'><a href="'. url($item['href']) .'">'. $icon . $item['title'] .'</a>'; |
$item['data'] = l($icon . $item['title'], $item['href'], array('html' => TRUE)); |
| 123 |
$output .= '</li>'; |
if (!empty($id)) $item['id'] = $id; |
| 124 |
|
if (!empty($class)) $item['class'] = $class; |
| 125 |
|
$items[] = $item; |
| 126 |
|
|
| 127 |
} |
} |
| 128 |
$output .= '</ul>'; |
$output .= theme('admin_navigation', $items, $list_class); |
| 129 |
} |
} |
| 130 |
|
|
| 131 |
return $output; |
return $output; |
| 132 |
} |
} |
| 133 |
|
|
| 134 |
|
function rootcandy_admin_navigation($items, $class) { |
| 135 |
|
return theme('item_list', $items, NULL, 'ul', array('class' => $class)); |
| 136 |
|
} |
| 137 |
|
|
| 138 |
function _rootcandy_besturlmatch($needle, $menuitems) { |
function _rootcandy_besturlmatch($needle, $menuitems) { |
| 139 |
$needle = drupal_get_path_alias($needle); |
$needle = drupal_get_path_alias($needle); |
| 140 |
$lastmatch = NULL; |
$lastmatch = NULL; |
| 515 |
'system_settings_form' => array( |
'system_settings_form' => array( |
| 516 |
'arguments' => array('form' => NULL), |
'arguments' => array('form' => NULL), |
| 517 |
), |
), |
| 518 |
|
'admin_navigation' => array( |
| 519 |
|
'arguments' => array('items' => NULL, 'class' => NULL), |
| 520 |
|
), |
| 521 |
); |
); |
| 522 |
} |
} |
| 523 |
|
|