1
|
<?php
|
2
|
function kanji_preprocess_page(&$variables) {
|
3
|
if (isset($variables['main_menu'])) {
|
4
|
$pid = variable_get('menu_main_links_source', 'main-menu');
|
5
|
$tree = menu_tree($pid);
|
6
|
$variables['primary_nav'] = str_replace('menu', 'sf-menu menu', drupal_render($tree));
|
7
|
} else {
|
8
|
$variables['primary_nav'] = FALSE;
|
9
|
}
|
10
|
}
|
11
|
|
12
|
function kanji_breadcrumb(&$variables) {
|
13
|
$output = '';
|
14
|
$breadcrumb = $variables['breadcrumb'];
|
15
|
$show_breadcrumb = theme_get_setting('breadcrumb_display');
|
16
|
if ($show_breadcrumb == 'yes') {
|
17
|
if (!empty($breadcrumb)) {
|
18
|
|
19
|
|
20
|
$output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
|
21
|
|
22
|
$output .= '<div class="breadcrumb">' . implode(' | ', $breadcrumb) . '</div>';
|
23
|
} else {
|
24
|
$output = '<div class="breadcrumb">' . t('Home') . '</div>';
|
25
|
}
|
26
|
}
|
27
|
return $output;
|
28
|
}
|
29
|
|
30
|
function kanji_feed_icon(&$variables) {
|
31
|
$text = t('Subscribe to @feed-title', array('@feed-title' => $variables['title']));
|
32
|
if ($image = theme('image', array('path' => path_to_theme() . '/images/rss.png', 'alt' => $text))) {
|
33
|
return l($image, $variables['url'], array('html' => TRUE, 'attributes' => array('class' => array('feed-icon'), 'title' => $text)));
|
34
|
}
|
35
|
}
|
36
|
|
37
|
function kanji_preprocess_html(&$variables) {
|
38
|
|
39
|
drupal_add_css(path_to_theme() . '/ie_styles.css', array('group' => CSS_THEME, 'browsers' => array('IE' => 'IE', '!IE' => FALSE), 'preprocess' => FALSE));
|
40
|
global $base_url;
|
41
|
|
42
|
if (theme_get_setting('default_background') == 1) {
|
43
|
$variables['background'] = 'background-image: url(\'' . $base_url . '/' . path_to_theme() . '/images/bg.jpg\')';
|
44
|
}
|
45
|
elseif (theme_get_setting('background_color') && theme_get_setting('background_color_value')) {
|
46
|
$variables['background'] = 'background: #' . theme_get_setting('background_color_value');
|
47
|
}
|
48
|
elseif (theme_get_setting('path_background')) {
|
49
|
$bg = variable_get('kanji:path_background', '');
|
50
|
$bg = file_create_url($bg);
|
51
|
$variables['background'] = 'background-image: url(\'' . $bg . '\')';
|
52
|
}
|
53
|
}
|