Subversion Repositories Sites.obs-saisons.fr

Compare Revisions

Ignore whitespace Rev 108 → Rev 109

/trunk/themes/ods/template.php
34,7 → 34,7
* @return
* A string containing an unordered list of links.
*/
function ods_links($links, $attributes = array('class' => 'links')) {
function primary_links($links, $attributes = array('class' => 'links')) {
global $language;
$output = '';
60,9 → 60,10
$class .= ' active';
}
$class .= ' lien_primaire_'.$i;
$id = 'lien_primaire_'.$i;
$class .= ' lien_primaire';
$output .= '<li'. drupal_attributes(array('class' => $class)) .'>';
$output .= '<li'. drupal_attributes(array('id' => $id, 'class' => $class)) .'>';
 
if (isset($link['href'])) {
97,6 → 98,85
}
 
/**
* Override or insert PHPTemplate variables into the search_theme_form template.
*
* @param $vars
* A sequential array of variables to pass to the theme template.
* @param $hook
* The name of the theme function being called (not used in this case.)
*/
function ods_preprocess_search_theme_form(&$vars, $hook) {
// Remove the "Search this site" label from the form.
$vars['form']['search_theme_form']['#title'] = t('');
// Set a default value for text inside the search box field.
$vars['form']['search_theme_form']['#value'] = t('');
// Add a custom class and placeholder text to the search box.
$vars['form']['search_theme_form']['#attributes'] = array('class' => 'NormalTextBox txtSearch',
'onfocus' => "if (this.value == '') {this.value = '';}",
'onblur' => "if (this.value == '') {this.value = '';}");
// Change the text on the submit button
//$vars['form']['submit']['#value'] = t('Go');
 
// Rebuild the rendered version (search form only, rest remains unchanged)
unset($vars['form']['search_theme_form']['#printed']);
$vars['search']['search_theme_form'] = drupal_render($vars['form']['search_theme_form']);
 
$vars['form']['submit']['#type'] = 'image_button';
$vars['form']['submit']['#src'] = path_to_theme() . '/images/search.jpg';
// Rebuild the rendered version (submit button, rest remains unchanged)
unset($vars['form']['submit']['#printed']);
$vars['search']['submit'] = drupal_render($vars['form']['submit']);
 
// Collect all form elements to make it easier to print the whole form.
$vars['search_form'] = implode($vars['search']);
}
 
/**
* Override or insert PHPTemplate variables into the search_block_form template.
*
* @param $vars
* A sequential array of variables to pass to the theme template.
* @param $hook
* The name of the theme function being called (not used in this case.)
*/
function ods_preprocess_search_block_form(&$vars, $hook) {
// Remove the "Search this site" label from the form.
$vars['form']['search_block_form']['#title'] = t('');
// Set a default value for text inside the search box field.
$vars['form']['search_block_form']['#value'] = t('Rechercher');
// Add a custom class and placeholder text to the search box.
$vars['form']['search_block_form']['#attributes'] = array('class' => 'NormalTextBox txtSearch',
'onfocus' => "if (this.value == 'Rechercher') {this.value = '';}",
'onblur' => "if (this.value == 'Rechercher') {this.value = '';}");
// Change the text on the submit button
//$vars['form']['submit']['#value'] = t('Go');
$vars['form']['search_block_form']['#label'] = t('');
// Rebuild the rendered version (search form only, rest remains unchanged)
unset($vars['form']['search_block_form']['#printed']);
$vars['search']['search_block_form'] = drupal_render($vars['form']['search_block_form']);
 
$vars['form']['submit']['#type'] = 'image_button';
$vars['form']['submit']['#src'] = path_to_theme() . '/images/search.jpg';
// Rebuild the rendered version (submit button, rest remains unchanged)
unset($vars['form']['submit']['#printed']);
$vars['search']['submit'] = drupal_render($vars['form']['submit']);
 
// Collect all form elements to make it easier to print the whole form.
$vars['search_form'] = implode($vars['search']);
}
 
/**
* Return a themed breadcrumb trail.
*
* @param $breadcrumb