html.pre.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?php
  2. if (module_exists('rdf')) {
  3. $vars['doctype'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML+RDFa 1.1//EN">' . "\n";
  4. $vars['rdf_profile'] = ' profile="' . $vars['grddl_profile'] . '"';
  5. }
  6. else {
  7. $vars['doctype'] = '<!DOCTYPE html>' . "\n";
  8. $vars['rdf_profile'] = '';
  9. }
  10. # Add mobile meta tags to $head ADD this to your subtheme
  11. $heads = array();
  12. $heads['HandheldFriendly'] = array(
  13. '#tag' => 'meta',
  14. '#attributes' => array(
  15. 'name' => 'HandheldFriendly',
  16. 'content' => 'true',
  17. ),
  18. );
  19. # Mobile Viewport Fix
  20. # j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag
  21. # device-width : Occupy full width of the screen in its current orientation
  22. # initial-scale = 1.0 retains dimensions instead of zooming out if page height > device height
  23. # maximum-scale = 1.0 retains dimensions instead of zooming in if page width < device width
  24. $heads['viewport'] = array(
  25. '#tag' => 'meta',
  26. '#attributes' => array(
  27. 'name' => 'viewport',
  28. 'content' => 'width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no',
  29. ),
  30. );
  31. # Add these icons links to your sub theme
  32. # or Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references
  33. // $head[] = '<link rel="apple-touch-icon" sizes="72x72" href="'. base_path() . path_to_theme() .'/touch-icon-ipad.png'.'"/>' . "\n";
  34. // $head[] = '<link rel="apple-touch-icon" sizes="114x114" href="'. base_path() . path_to_theme() .'/touch-icon-iphone4.png'.'"/>' . "\n";
  35. $heads['icon'] = array(
  36. '#tag' => 'link',
  37. '#attributes' => array(
  38. 'href' => base_path() . path_to_theme() .'/icon.png',
  39. 'rel' => 'shortcut icon',
  40. 'type' => 'image/png',
  41. ),
  42. );
  43. $heads['apple-touch-icon'] = array(
  44. '#tag' => 'link',
  45. '#attributes' => array(
  46. 'href' => base_path() . path_to_theme() .'/apple-touch-icon.png',
  47. 'rel' => 'apple-touch-icon',
  48. ),
  49. );
  50. $heads['manifest'] = array(
  51. '#tag' => 'link',
  52. '#attributes' => array(
  53. 'href' => base_path() . path_to_theme() .'/manifest.webapp'
  54. ),
  55. );
  56. $heads['manifest'] = array(
  57. '#tag' => 'meta',
  58. '#attributes' => array(
  59. 'name' => "application-name",
  60. 'content' => "Store Finder"
  61. ),
  62. );
  63. foreach ($heads as $type=>$head)
  64. drupal_add_html_head($head, $type);
  65. // $vars['head'] = implode('', $head);
  66. # add body classes
  67. if(isset($vars['node'])){
  68. # from taxonomy
  69. foreach ($vars['node']->taxonomy as $tid => $term) {
  70. $vars['classes_array'][] = 'term-vid-'. $term->vid .' term-tid-'. $tid;
  71. }
  72. # from menu
  73. $mlid = db_result(db_query("SELECT mlid FROM {menu_links} WHERE link_path = '%s'", 'node/'. $vars['node']->nid));
  74. // Now get the menu related information.
  75. if (!empty($mlid) || !empty($node->menu['mlid']) || !empty($node->menu['plid'])) {
  76. $menu_link = menu_link_load($mlid);
  77. // krumo($menu_link);
  78. $vars['classes_array'][] = ' mlid-'. $menu_link['mlid'] .' plid-'. $menu_link['plid'];
  79. }
  80. }
  81. # theme layout settings
  82. // if(isset($vars['page']['sidebar_first']) && isset($vars['page']['sidebar_second'])){
  83. // $layout = 'two-sidebars';
  84. // }else if(isset($vars['page']['sidebar_first']) || isset($vars['page']['sidebar_second'])){
  85. // $layout = isset($vars['page']['sidebar_first']) ? 'sidebar-first' : 'sidebar-second';
  86. // }else{
  87. // $layout = 'no-sidebar';
  88. // }
  89. // $vars['classes_array'][] = $layout;
  90. // if (theme_get_setting('layout_enable_settings') == 'on') {
  91. // $method = theme_get_setting('layout_method');
  92. // $vars['method'] = $method;
  93. // $vars['classes_array'][] .= ' layout-method-'.$method;
  94. // }
  95. // $vars['off_canvas_menu'] = block_get_blocks_by_region('off_canvas_menu');