'utf-8' ); } /** * Return a themed breadcrumb trail. * * @param $breadcrumb * An array containing the breadcrumb links. * @return a string containing the breadcrumb output. */ function berry_breadcrumb($variables) { $breadcrumb = $variables['breadcrumb']; if (!empty($breadcrumb)) { // Provide a navigational heading to give context for breadcrumb links to // screen-reader users. Make the heading invisible with .element-invisible. $heading = '

' . t('You are here') . '

'; // Uncomment to add current page to breadcrumb $breadcrumb[] = drupal_get_title(); return ''; } } /** * Duplicate of theme_menu_local_tasks() but adds clearfix to tabs. */ function berry_menu_local_tasks(&$variables) { $output = ''; if (!empty($variables['primary'])) { $variables['primary']['#prefix'] = '

' . t('Primary tabs') . '

'; $variables['primary']['#prefix'] .= ''; $output .= drupal_render($variables['primary']); } if (!empty($variables['secondary'])) { $variables['secondary']['#prefix'] = '

' . t('Secondary tabs') . '

'; $variables['secondary']['#prefix'] .= ''; $output .= drupal_render($variables['secondary']); } return $output; } /** * Override or insert variables into the node template. */ function berry_preprocess_node(&$variables) { $variables['submitted'] = t('Published by !username on !datetime', array('!username' => $variables['name'], '!datetime' => $variables['date'])); if ($variables['view_mode'] == 'full' && node_is_page($variables['node'])) { $variables['classes_array'][] = 'node-full'; } } /** * Preprocess variables for region.tpl.php * * @param $variables * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("region" in this case.) */ function berry_preprocess_region(&$variables, $hook) { // Use a bare template for the content region. if ($variables['region'] == 'content') { $variables['theme_hook_suggestions'][] = 'region__bare'; } } /** * Override or insert variables into the block templates. * * @param $variables * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("block" in this case.) */ function berry_preprocess_block(&$variables, $hook) { // Use a bare template for the page's main content. if ($variables['block_html_id'] == 'block-system-main') { $variables['theme_hook_suggestions'][] = 'block__bare'; } $variables['title_attributes_array']['class'][] = 'block-title'; } /** * Override or insert variables into the block templates. * * @param $variables * An array of variables to pass to the theme template. * @param $hook * The name of the template being rendered ("block" in this case.) */ function berry_process_block(&$variables, $hook) { // Drupal 7 should use a $title variable instead of $block->subject. $variables['title'] = $variables['block']->subject; } /** * Changes the search form to use the "search" input element of HTML5. */ function berry_preprocess_search_block_form(&$vars) { $vars['search_form'] = str_replace('type="text"', 'type="search"', $vars['search_form']); } /** * Tell Drupal to look for a custom page template for each node type. */ function berry_preprocess_page(&$vars, $hook) { if (isset($vars['node'])) { $suggest = "page__node__{$vars['node']->type}"; $vars['theme_hook_suggestions'][] = $suggest; } }