| 1 |
<?php
|
| 2 |
|
| 3 |
/**
|
| 4 |
* Initialize the admin "theme".
|
| 5 |
*/
|
| 6 |
function _admin_init_theme() {
|
| 7 |
global $theme, $theme_key;
|
| 8 |
if (empty($theme)) {
|
| 9 |
_admin_theme_rebuild();
|
| 10 |
|
| 11 |
$theme = $theme_key = 'admin';
|
| 12 |
|
| 13 |
$path = drupal_get_path('module', 'admin') .'/theme';
|
| 14 |
|
| 15 |
$theme_info = new StdClass();
|
| 16 |
$theme_info->name = 'admin';
|
| 17 |
$theme_info->filename = "{$path}/admin.theme.info";
|
| 18 |
$theme_info->engine = 'phptemplate';
|
| 19 |
$theme_info->owner = drupal_get_path('theme_engine', 'phptemplate') .'/phptemplate.engine';
|
| 20 |
|
| 21 |
$theme_info->stylesheets = array();
|
| 22 |
$theme_info->stylesheets['screen'][] = "{$path}/reset.css";
|
| 23 |
$theme_info->stylesheets['screen'][] = "{$path}/style.css";
|
| 24 |
|
| 25 |
$theme_info->scripts = array();
|
| 26 |
$theme_info->scripts[] = "{$path}/theme.js";
|
| 27 |
|
| 28 |
_init_theme($theme_info);
|
| 29 |
return TRUE;
|
| 30 |
}
|
| 31 |
}
|
| 32 |
|
| 33 |
/**
|
| 34 |
* Generate the 1st level of navigation links under 'admin'.
|
| 35 |
*/
|
| 36 |
function admin_navigation_primary() {
|
| 37 |
$tree = menu_tree_all_data();
|
| 38 |
foreach ($tree as $item) {
|
| 39 |
if ($item['link']['link_path'] == 'admin' && !empty($item['below'])) {
|
| 40 |
return admin_menu_navigation_links($item['below']);
|
| 41 |
break;
|
| 42 |
}
|
| 43 |
}
|
| 44 |
return NULL;
|
| 45 |
}
|
| 46 |
|
| 47 |
/**
|
| 48 |
* Generate the 2nd level of navigation links under 'admin/*'.
|
| 49 |
*/
|
| 50 |
function admin_navigation_secondary() {
|
| 51 |
$is_duplicated = theme('admin_block_content', NULL, TRUE);
|
| 52 |
if (!$is_duplicated) {
|
| 53 |
$tree = menu_tree_page_data();
|
| 54 |
foreach ($tree as $item) {
|
| 55 |
if ($item['link']['link_path'] == 'admin' && !empty($item['below'])) {
|
| 56 |
foreach ($item['below'] as $child) {
|
| 57 |
if (!empty($child['link']['in_active_trail']) && !empty($child['below'])) {
|
| 58 |
return admin_menu_navigation_links($child['below']);
|
| 59 |
}
|
| 60 |
}
|
| 61 |
break;
|
| 62 |
}
|
| 63 |
}
|
| 64 |
}
|
| 65 |
return NULL;
|
| 66 |
}
|