function adaptivetheme_html_head_alter

cis7 alter.inc adaptivetheme_html_head_alter(&$head_elements)
cle7 alter.inc adaptivetheme_html_head_alter(&$head_elements)
elmsmedia7 alter.inc adaptivetheme_html_head_alter(&$head_elements)
icor7 alter.inc adaptivetheme_html_head_alter(&$head_elements)
meedjum_blog7 alter.inc adaptivetheme_html_head_alter(&$head_elements)
mooc7 alter.inc adaptivetheme_html_head_alter(&$head_elements)

hook_html_head_alter()

File

sites/all/themes/ulmus/adaptivetheme/at_core/inc/alter.inc, line 11
General alters.

Code

function adaptivetheme_html_head_alter(&$head_elements) {
  global $theme_key;
  $theme_name = $theme_key;

  // charset utf-8
  $head_elements['system_meta_content_type']['#attributes'] = array('charset' => 'utf-8');

  // IE Document Mode
  if ($adaptivetheme_meta_ie_document_mode = at_get_setting('adaptivetheme_meta_ie_document_mode', $theme_name)) {
    $head_elements['adaptivetheme_meta_ie_document_mode'] = array(
      '#type' => 'html_tag',
      '#tag' => 'meta',
      '#attributes' => array(
        'http-equiv' => "X-UA-Compatible",
        'content' => $adaptivetheme_meta_ie_document_mode,
      ),
      '#weight' => -999, // 1 less than the charset
    );
  }

  // cleartype
  if (at_get_setting('adaptivetheme_meta_clear_type', $theme_name) === 1) {
    $head_elements['adaptivetheme_meta_clear_type'] = array(
      '#type' => 'html_tag',
      '#tag' => 'meta',
      '#attributes' => array(
        'http-equiv' => "cleartype",
        'content' => "on",
      ),
      '#weight' => -998,
    );
  }

  // Don't add these if responsive styles are disabled
  if (at_get_setting('disable_responsive_styles', $theme_name) === 0) {

    // Viewport
    if ($adaptivetheme_meta_viewport = at_get_setting('adaptivetheme_meta_viewport', $theme_name)) {
      $head_elements['adaptivetheme_meta_viewport'] = array(
        '#type' => 'html_tag',
        '#tag' => 'meta',
        '#attributes' => array(
          'name' => 'viewport',
          'content' => check_plain($adaptivetheme_meta_viewport),
        ),
        '#weight' => 1,
      );
    }

    // MobileOptimized
    if ($adaptivetheme_meta_mobileoptimized = at_get_setting('adaptivetheme_meta_mobileoptimized', $theme_name)) {
      $head_elements['adaptivetheme_meta_mobileoptimized'] = array(
        '#type' => 'html_tag',
        '#tag' => 'meta',
        '#attributes' => array(
          'name' => "MobileOptimized",
          'content' => check_plain($adaptivetheme_meta_mobileoptimized),
        ),
        '#weight' => 2,
      );
    }

    // HandheldFriendly
    if ($adaptivetheme_meta_handheldfriendly = at_get_setting('adaptivetheme_meta_handheldfriendly', $theme_name)) {
      $head_elements['adaptivetheme_meta_handheldfriendly'] = array(
        '#type' => 'html_tag',
        '#tag' => 'meta',
        '#attributes' => array(
          'name' => "HandheldFriendly",
          'content' => check_plain($adaptivetheme_meta_handheldfriendly),
        ),
        '#weight' => 3,
      );
    }

    // apple-mobile-web-app-capable
    if ($adaptivetheme_meta_apple_mobile_web_app_capable = at_get_setting('adaptivetheme_meta_apple_mobile_web_app_capable', $theme_name)) {
      $head_elements['adaptivetheme_meta_apple_mobile_web_app_capable'] = array(
        '#type' => 'html_tag',
        '#tag' => 'meta',
        '#attributes' => array(
          'name' => "apple-mobile-web-app-capable",
          'content' => check_plain($adaptivetheme_meta_apple_mobile_web_app_capable),
        ),
        '#weight' => 4,
      );
    }
  }

  // Apple touch icons - low, medium and high (see the Apple docs on touch icons)
  if (at_get_setting('enable_apple_touch_icons') === 1) {
    $path_to_theme = drupal_get_path('theme', $theme_name);

    $rel = 'apple-touch-icon';
    if (at_get_setting('enable_apple_touch_icon_precomposed') === 1) {
      $rel = 'apple-touch-icon-precomposed';
    }

    // Apple default icon and Nokia shortcut icon.
    $icon_path_default = check_plain(at_get_setting('icon_path_default', $theme_name));
    if (!empty($icon_path_default)) {
      $default_icon_path = $path_to_theme . '/' . $icon_path_default;
      $default_icon_url = file_create_url($default_icon_path);
      $head_elements['adaptivetheme_touch_icon_nokia'] = array(
        '#type' => 'html_tag',
        '#tag' => 'link',
        '#weight' => -97,
        '#attributes' => array(
          'href' => $default_icon_url,
          'rel' => "shortcut icon",
        ),
      );
      $head_elements['adaptivetheme_touch_icon_default'] = array(
        '#type' => 'html_tag',
        '#tag' => 'link',
        '#weight' => -98,
        '#attributes' => array(
          'href' => $default_icon_url,
          'rel' => $rel,
        ),
      );
    }
    // iPad (standard display).
    $apple_touch_icon_path_ipad = check_plain(at_get_setting('apple_touch_icon_path_ipad', $theme_name));
    if (!empty($apple_touch_icon_path_ipad)) {
      $ipad_icon_path = $path_to_theme . '/' . $apple_touch_icon_path_ipad;
      $ipad_icon_url = file_create_url($ipad_icon_path);
      $head_elements['adaptivetheme_touch_icon_ipad'] = array(
        '#type' => 'html_tag',
        '#tag' => 'link',
        '#weight' => -99,
        '#attributes' => array(
          'href' => $ipad_icon_url,
          'rel' => $rel,
          'sizes' => "76x76",
        ),
      );
    }
    // iPhone retina.
    $apple_touch_icon_path_iphone_retina = check_plain(at_get_setting('apple_touch_icon_path_iphone_retina', $theme_name));
    if (!empty($apple_touch_icon_path_iphone_retina)) {
      $iphone_retina_icon_path = $path_to_theme . '/' . $apple_touch_icon_path_iphone_retina;
      $iphone_retina_icon_url = file_create_url($iphone_retina_icon_path);
      $head_elements['adaptivetheme_touch_icon_iphone_retina'] = array(
        '#type' => 'html_tag',
        '#tag' => 'link',
        '#weight' => -100,
        '#attributes' => array(
          'href' => $iphone_retina_icon_url,
          'rel' => $rel,
          'sizes' => "120x120",
        ),
      );
    }
    // iPad retina.
    $apple_touch_icon_path_ipad_retina = check_plain(at_get_setting('apple_touch_icon_path_ipad_retina', $theme_name));
    if (!empty($apple_touch_icon_path_ipad_retina)) {
      $ipad_retina_icon_path = $path_to_theme . '/' . $apple_touch_icon_path_ipad_retina;
      $ipad_retina_icon_url = file_create_url($ipad_retina_icon_path);
      $head_elements['adaptivetheme_touch_icon_ipad_retina'] = array(
        '#type' => 'html_tag',
        '#tag' => 'link',
        '#weight' => -100,
        '#attributes' => array(
          'href' => $ipad_retina_icon_url,
          'rel' => $rel,
          'sizes' => "152x152",
        ),
      );
    }
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.