/** * Implements hook_html_head_alter(). * This will overwrite the default meta character type tag with HTML5 version. */ function skeletontheme_html_head_alter(&$head_elements) { $head_elements['system_meta_content_type']['#attributes'] = array( 'charset' => 'utf-8' ); } /** * Override or insert variables into the page template for HTML output. */ function skeletontheme_process_html(&$variables) { // Hook into color.module. if (module_exists('color')) { _color_html_alter($variables); } } /** * Override or insert variables into the page template. */ function skeletontheme_process_page(&$variables) { // Always print the site name and slogan, but if they are toggled off, we'll // just hide them visually. $variables['hide_site_name'] = theme_get_setting('toggle_name') ? FALSE : TRUE; $variables['hide_site_slogan'] = theme_get_setting('toggle_slogan') ? FALSE : TRUE; if ($variables['hide_site_name']) { // If toggle_name is FALSE, the site_name will be empty, so we rebuild it. $variables['site_name'] = filter_xss_admin(variable_get('site_name', 'Drupal')); } if ($variables['hide_site_slogan']) { // If toggle_site_slogan is FALSE, the site_slogan will be empty, so we rebuild it. $variables['site_slogan'] = filter_xss_admin(variable_get('site_slogan', '')); } // Since the title and the shortcut link are both block level elements, // positioning them next to each other is much simpler with a wrapper div. if (!empty($variables['title_suffix']['add_or_remove_shortcut']) && $variables['title']) { // Add a wrapper div using the title_prefix and title_suffix render elements. $variables['title_prefix']['shortcut_wrapper'] = array( '#markup' => '
', '#weight' => 100, ); $variables['title_suffix']['shortcut_wrapper'] = array( '#markup' => '
', '#weight' => -99, ); // Make sure the shortcut link is the first item in title_suffix. $variables['title_suffix']['add_or_remove_shortcut']['#weight'] = -100; } } function skeletontheme_page_alter($page) { $mobileoptimized = array( '#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array( 'name' => 'MobileOptimized', 'content' => 'width' ) ); $handheldfriendly = array( '#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array( 'name' => 'HandheldFriendly', 'content' => 'true' ) ); $viewport = array( '#type' => 'html_tag', '#tag' => 'meta', '#attributes' => array( 'name' => 'viewport', 'content' => 'width=device-width, initial-scale=1' ) ); drupal_add_html_head($mobileoptimized, 'MobileOptimized'); drupal_add_html_head($handheldfriendly, 'HandheldFriendly'); drupal_add_html_head($viewport, 'viewport'); } function skeletontheme_breadcrumb($variables) { $breadcrumb = $variables['breadcrumb']; if (!empty($breadcrumb)) { // Use CSS to hide titile .element-invisible. $output = '

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

'; // comment below line to hide current page to breadcrumb $breadcrumb[] = drupal_get_title(); $output .= ''; return $output; } } /** * Add Javascript for responsive mobile menu */ if (theme_get_setting('responsive_menu_state')) { drupal_add_js(drupal_get_path('theme', 'skeletontheme') .'/js/jquery.mobilemenu.js'); $responsive_menu_switchwidth = (int) theme_get_setting('responsive_menu_switchwidth','skeletontheme'); $responsive_menu_topoptiontext = theme_get_setting('responsive_menu_topoptiontext','skeletontheme'); drupal_add_js(array('skeletontheme' => array('topoptiontext' => $responsive_menu_topoptiontext)), 'setting'); drupal_add_js('jQuery(document).ready(function($) { $("#navigation .content > ul").mobileMenu({ prependTo: "#navigation", combine: false, switchWidth: '.$responsive_menu_switchwidth.', topOptionText: Drupal.settings.skeletontheme[\'topoptiontext\'] }); });', array('type' => 'inline', 'scope' => 'header')); } //EOF:Javascript