95 lines
3.0 KiB
PHP
95 lines
3.0 KiB
PHP
<?php
|
|
// $Id$
|
|
|
|
/**
|
|
* Override or insert variables into the page template.
|
|
*/
|
|
function seven_process_html(&$vars) {
|
|
$vars['styles'] .= "\n<!--[if lt IE 7]>\n" . '<link type="text/css" rel="stylesheet" media="all" href="' . file_create_url(path_to_theme() . '/ie6.css') . '" />' . "\n" . "<![endif]-->\n";
|
|
}
|
|
function seven_preprocess_page(&$vars) {
|
|
$vars['primary_local_tasks'] = menu_primary_local_tasks();
|
|
$vars['secondary_local_tasks'] = menu_secondary_local_tasks();
|
|
}
|
|
|
|
/**
|
|
* Display the list of available node types for node creation.
|
|
*/
|
|
function seven_node_add_list($variables) {
|
|
$content = $variables['content'];
|
|
$output = '';
|
|
if ($content) {
|
|
$output = '<ul class="node-type-list">';
|
|
foreach ($content as $item) {
|
|
$output .= '<li class="clearfix">';
|
|
$output .= '<span class="label">' . l($item['title'], $item['href'], $item['localized_options']) . '</span>';
|
|
$output .= '<div class="description">' . filter_xss_admin($item['description']) . '</div>';
|
|
$output .= '</li>';
|
|
}
|
|
$output .= '</ul>';
|
|
}
|
|
return $output;
|
|
}
|
|
|
|
/**
|
|
* Override of theme_admin_block_content().
|
|
*
|
|
* Use unordered list markup in both compact and extended move.
|
|
*/
|
|
function seven_admin_block_content($variables) {
|
|
$content = $variables['content'];
|
|
$output = '';
|
|
if (!empty($content)) {
|
|
$output = system_admin_compact_mode() ? '<ul class="admin-list compact">' : '<ul class="admin-list">';
|
|
foreach ($content as $item) {
|
|
$output .= '<li class="leaf">';
|
|
$output .= l($item['title'], $item['href'], $item['localized_options']);
|
|
if (!system_admin_compact_mode()) {
|
|
$output .= '<div class="description">' . $item['description'] . '</div>';
|
|
}
|
|
$output .= '</li>';
|
|
}
|
|
$output .= '</ul>';
|
|
}
|
|
return $output;
|
|
}
|
|
|
|
/**
|
|
* Override of theme_tablesort_indicator().
|
|
*
|
|
* Use our own image versions, so they show up as black and not gray on gray.
|
|
*/
|
|
function seven_tablesort_indicator($variables) {
|
|
$style = $variables['style'];
|
|
$theme_path = drupal_get_path('theme', 'seven');
|
|
if ($style == "asc") {
|
|
return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'title' => t('sort ascending')));
|
|
}
|
|
else {
|
|
return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'title' => t('sort descending')));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Override of theme_fieldset().
|
|
*
|
|
* Add span to legend tag, so we can style it to be inside the fieldset.
|
|
*/
|
|
function seven_fieldset($variables) {
|
|
$element = $variables['element'];
|
|
|
|
$output = '<fieldset' . drupal_attributes($element['#attributes']) . '>';
|
|
if (!empty($element['#title'])) {
|
|
$output .= '<legend><span>' . $element['#title'] . '</span></legend>';
|
|
}
|
|
if (!empty($element['#description'])) {
|
|
$output .= '<div class="fieldset-description">' . $element['#description'] . '</div>';
|
|
}
|
|
$output .= $element['#children'];
|
|
if (isset($element['#value'])) {
|
|
$output .= $element['#value'];
|
|
}
|
|
$output .= "</fieldset>\n";
|
|
return $output;
|
|
}
|