'links')) { global $language; $output = ''; if (count($links) > 0) { $output = ''; $num_links = count($links); $i = 1; foreach ($links as $key => $link) { $class = $key; // Add first, last and active classes to the list of links to help out themers. if ($i == 1) { $class .= ' first'; } if ($i == $num_links) { $class .= ' last'; } if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '' && drupal_is_front_page())) && (empty($link['language']) || $link['language']->language == $language->language)) { $class .= ' active'; } $id = 'lien_primaire_'.$i; $class .= ' lien_primaire'; $output .= ' $id, 'class' => $class)) .'>'; if (isset($link['href'])) { if($i == 1) { $link['html'] = true; $link['title'] = ''.$link['title'].''; } // Pass in $link as $options, they share the same keys. $output .= l($link['title'], $link['href'], $link); } else if (!empty($link['title'])) { // Some links are actually not links, but we wrap these in for adding title and class attributes if (empty($link['html'])) { $link['title'] = check_plain($link['title']); } $span_attributes = ''; if (isset($link['attributes'])) { $span_attributes = drupal_attributes($link['attributes']); } $output .= ''. $link['title'] .''; } $i++; $output .= "\n"; } $output .= ''; } return $output; } /** * 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 * An array containing the breadcrumb links. * @return a string containing the breadcrumb output. */ function phptemplate_breadcrumb($breadcrumb) { if (!empty($breadcrumb)) { return ''; } } /** * Override or insert PHPTemplate variables into the templates. */ function phptemplate_preprocess_page(&$vars) { $vars['tabs2'] = menu_secondary_local_tasks(); // Hook into color.module if (module_exists('color')) { _color_page_alter($vars); } } /** * Add a "Comments" heading above comments except on forum pages. */ function ods_preprocess_comment_wrapper(&$vars) { if ($vars['content'] && $vars['node']->type != 'forum') { $vars['content'] = '

'. t('Comments') .'

'. $vars['content']; } } /** * Returns the rendered local tasks. The default implementation renders * them as tabs. Overridden to split the secondary tasks. * * @ingroup themeable */ function phptemplate_menu_local_tasks() { return menu_primary_local_tasks(); } /** * Returns the themed submitted-by string for the comment. */ function phptemplate_comment_submitted($comment) { return t('!datetime — !username', array( '!username' => theme('username', $comment), '!datetime' => format_date($comment->timestamp) )); } /** * Returns the themed submitted-by string for the node. */ function phptemplate_node_submitted($node) { return t('!datetime — !username', array( '!username' => theme('username', $node), '!datetime' => format_date($node->created), )); } /** * Generates IE CSS links for LTR and RTL languages. */ function phptemplate_get_ie_styles() { global $language; $iecss = ''; if ($language->direction == LANGUAGE_RTL) { $iecss .= ''; } return $iecss; }