2009-07-31 19:35:57 +00:00
|
|
|
<?php
|
|
|
|
// $Id$
|
|
|
|
|
2010-05-12 09:22:24 +00:00
|
|
|
/**
|
|
|
|
* Override or insert variables into the maintenance page template.
|
|
|
|
*/
|
|
|
|
function seven_preprocess_maintenance_page(&$vars) {
|
|
|
|
// While markup for normal pages is split into page.tpl.php and html.tpl.php,
|
|
|
|
// the markup for the maintenance page is all in the single
|
|
|
|
// maintenance-page.tpl.php template. So, to have what's done in
|
|
|
|
// seven_preprocess_html() also happen on the maintenance page, it has to be
|
|
|
|
// called here.
|
|
|
|
seven_preprocess_html($vars);
|
|
|
|
}
|
|
|
|
|
2009-07-31 19:35:57 +00:00
|
|
|
/**
|
2010-02-25 20:57:39 +00:00
|
|
|
* Override or insert variables into the html template.
|
2009-07-31 19:35:57 +00:00
|
|
|
*/
|
2010-02-25 20:57:39 +00:00
|
|
|
function seven_preprocess_html(&$vars) {
|
2010-03-03 19:46:26 +00:00
|
|
|
// Add conditional CSS for IE8 and below.
|
|
|
|
drupal_add_css(path_to_theme() . '/ie.css', array('weight' => CSS_THEME, 'browsers' => array('IE' => 'lte IE 8', '!IE' => FALSE), 'preprocess' => FALSE));
|
2010-02-25 20:57:39 +00:00
|
|
|
// Add conditional CSS for IE6.
|
|
|
|
drupal_add_css(path_to_theme() . '/ie6.css', array('weight' => CSS_THEME, 'browsers' => array('IE' => 'lt IE 7', '!IE' => FALSE), 'preprocess' => FALSE));
|
2009-09-15 17:10:39 +00:00
|
|
|
}
|
2010-02-25 20:57:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Override or insert variables into the page template.
|
|
|
|
*/
|
2009-07-31 19:35:57 +00:00
|
|
|
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.
|
|
|
|
*/
|
2009-10-09 01:00:08 +00:00
|
|
|
function seven_node_add_list($variables) {
|
|
|
|
$content = $variables['content'];
|
2009-07-31 19:35:57 +00:00
|
|
|
$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.
|
|
|
|
*/
|
2009-10-09 01:00:08 +00:00
|
|
|
function seven_admin_block_content($variables) {
|
|
|
|
$content = $variables['content'];
|
2009-07-31 19:35:57 +00:00
|
|
|
$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()) {
|
2010-03-24 09:26:37 +00:00
|
|
|
$output .= '<div class="description">' . filter_xss_admin($item['description']) . '</div>';
|
2009-07-31 19:35:57 +00:00
|
|
|
}
|
|
|
|
$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.
|
|
|
|
*/
|
2009-10-09 01:00:08 +00:00
|
|
|
function seven_tablesort_indicator($variables) {
|
|
|
|
$style = $variables['style'];
|
2009-07-31 19:35:57 +00:00
|
|
|
$theme_path = drupal_get_path('theme', 'seven');
|
2010-04-21 06:55:23 +00:00
|
|
|
if ($style == 'asc') {
|
2009-11-02 00:25:32 +00:00
|
|
|
return theme('image', array('path' => $theme_path . '/images/arrow-asc.png', 'alt' => t('sort ascending'), 'title' => t('sort ascending')));
|
2009-07-31 19:35:57 +00:00
|
|
|
}
|
|
|
|
else {
|
2009-11-02 00:25:32 +00:00
|
|
|
return theme('image', array('path' => $theme_path . '/images/arrow-desc.png', 'alt' => t('sort descending'), 'title' => t('sort descending')));
|
2009-07-31 19:35:57 +00:00
|
|
|
}
|
|
|
|
}
|
2009-08-12 11:32:07 +00:00
|
|
|
|
2010-01-04 03:46:31 +00:00
|
|
|
/**
|
|
|
|
* Implements hook_css_alter().
|
|
|
|
*/
|
|
|
|
function seven_css_alter(&$css) {
|
|
|
|
// Use Seven's vertical tabs style instead of the default one.
|
|
|
|
if (isset($css['misc/vertical-tabs.css'])) {
|
|
|
|
$css['misc/vertical-tabs.css']['data'] = drupal_get_path('theme', 'seven') . '/vertical-tabs.css';
|
|
|
|
}
|
|
|
|
}
|