PageRenderTime 46ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/themes/bartik/templates/page.tpl.php

https://bitbucket.org/hjain/trinet
PHP | 239 lines | 129 code | 25 blank | 85 comment | 30 complexity | bd94c2e8b0e36d90ee61cbd92ab6eeb3 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0, AGPL-1.0
  1. <?php
  2. //echo "<pre>"; print_r($node);exit;
  3. /**
  4. * @file
  5. * Bartik's theme implementation to display a single Drupal page.
  6. *
  7. * The doctype, html, head and body tags are not in this template. Instead they
  8. * can be found in the html.tpl.php template normally located in the
  9. * modules/system folder.
  10. *
  11. * Available variables:
  12. *
  13. * General utility variables:
  14. * - $base_path: The base URL path of the Drupal installation. At the very
  15. * least, this will always default to /.
  16. * - $directory: The directory the template is located in, e.g. modules/system
  17. * or themes/bartik.
  18. * - $is_front: TRUE if the current page is the front page.
  19. * - $logged_in: TRUE if the user is registered and signed in.
  20. * - $is_admin: TRUE if the user has permission to access administration pages.
  21. *
  22. * Site identity:
  23. * - $front_page: The URL of the front page. Use this instead of $base_path,
  24. * when linking to the front page. This includes the language domain or
  25. * prefix.
  26. * - $logo: The path to the logo image, as defined in theme configuration.
  27. * - $site_name: The name of the site, empty when display has been disabled
  28. * in theme settings.
  29. * - $site_slogan: The slogan of the site, empty when display has been disabled
  30. * in theme settings.
  31. * - $hide_site_name: TRUE if the site name has been toggled off on the theme
  32. * settings page. If hidden, the "element-invisible" class is added to make
  33. * the site name visually hidden, but still accessible.
  34. * - $hide_site_slogan: TRUE if the site slogan has been toggled off on the
  35. * theme settings page. If hidden, the "element-invisible" class is added to
  36. * make the site slogan visually hidden, but still accessible.
  37. *
  38. * Navigation:
  39. * - $main_menu (array): An array containing the Main menu links for the
  40. * site, if they have been configured.
  41. * - $secondary_menu (array): An array containing the Secondary menu links for
  42. * the site, if they have been configured.
  43. * - $breadcrumb: The breadcrumb trail for the current page.
  44. *
  45. * Page content (in order of occurrence in the default page.tpl.php):
  46. * - $title_prefix (array): An array containing additional output populated by
  47. * modules, intended to be displayed in front of the main title tag that
  48. * appears in the template.
  49. * - $title: The page title, for use in the actual HTML content.
  50. * - $title_suffix (array): An array containing additional output populated by
  51. * modules, intended to be displayed after the main title tag that appears in
  52. * the template.
  53. * - $messages: HTML for status and error messages. Should be displayed
  54. * prominently.
  55. * - $tabs (array): Tabs linking to any sub-pages beneath the current page
  56. * (e.g., the view and edit tabs when displaying a node).
  57. * - $action_links (array): Actions local to the page, such as 'Add menu' on the
  58. * menu administration interface.
  59. * - $feed_icons: A string of all feed icons for the current page.
  60. * - $node: The node object, if there is an automatically-loaded node
  61. * associated with the page, and the node ID is the second argument
  62. * in the page's path (e.g. node/12345 and node/12345/revisions, but not
  63. * comment/reply/12345).
  64. *
  65. * Regions:
  66. * - $page['header']: Items for the header region.
  67. * - $page['featured']: Items for the featured region.
  68. * - $page['highlighted']: Items for the highlighted content region.
  69. * - $page['help']: Dynamic help text, mostly for admin pages.
  70. * - $page['content']: The main content of the current page.
  71. * - $page['sidebar_first']: Items for the first sidebar.
  72. * - $page['triptych_first']: Items for the first triptych.
  73. * - $page['triptych_middle']: Items for the middle triptych.
  74. * - $page['triptych_last']: Items for the last triptych.
  75. * - $page['footer_firstcolumn']: Items for the first footer column.
  76. * - $page['footer_secondcolumn']: Items for the second footer column.
  77. * - $page['footer_thirdcolumn']: Items for the third footer column.
  78. * - $page['footer_fourthcolumn']: Items for the fourth footer column.
  79. * - $page['footer']: Items for the footer region.
  80. *
  81. * @see template_preprocess()
  82. * @see template_preprocess_page()
  83. * @see template_process()
  84. * @see bartik_process_page()
  85. */
  86. ?>
  87. <div id="page-wrapper"><div id="page">
  88. <div id="header" class="<?php print $secondary_menu ? 'with-secondary-menu': 'without-secondary-menu'; ?>"><div class="section clearfix">
  89. <?php if ($logo): ?>
  90. <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home" id="logo">
  91. <img src="<?php print $logo; ?>" alt="<?php print t('Home'); ?>" />
  92. </a>
  93. <?php endif; ?>
  94. <?php if ($site_name || $site_slogan): ?>
  95. <div id="name-and-slogan"<?php if ($hide_site_name && $hide_site_slogan) { print ' class="element-invisible"'; } ?>>
  96. <?php if ($site_name): ?>
  97. <?php if ($title): ?>
  98. <div id="site-name"<?php if ($hide_site_name) { print ' class="element-invisible"'; } ?>>
  99. <strong>
  100. <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
  101. </strong>
  102. </div>
  103. <?php else: /* Use h1 when the content title is empty */ ?>
  104. <h1 id="site-name"<?php if ($hide_site_name) { print ' class="element-invisible"'; } ?>>
  105. <a href="<?php print $front_page; ?>" title="<?php print t('Home'); ?>" rel="home"><span><?php print $site_name; ?></span></a>
  106. </h1>
  107. <?php endif; ?>
  108. <?php endif; ?>
  109. <?php if ($site_slogan): ?>
  110. <div id="site-slogan"<?php if ($hide_site_slogan) { print ' class="element-invisible"'; } ?>>
  111. <?php print $site_slogan; ?>
  112. </div>
  113. <?php endif; ?>
  114. </div> <!-- /#name-and-slogan -->
  115. <?php endif; ?>
  116. <?php print render($page['header']); ?>
  117. <?php if ($main_menu): ?>
  118. <div id="main-menu" class="navigation">
  119. <?php
  120. // id, direction, depth should have the values you want them to have.
  121. $menu = theme('nice_menus', array('id' => 0, 'direction' => 'down', 'depth' => 1, 'menu_name' => 'main-menu', 'menu' => NULL));
  122. print $menu['content'];
  123. ?>
  124. </div> <!-- /#main-menu -->
  125. <?php endif; ?>
  126. <?php if ($secondary_menu): ?>
  127. <div id="secondary-menu" class="navigation">
  128. <?php print theme('links__system_secondary_menu', array(
  129. 'links' => $secondary_menu,
  130. 'attributes' => array(
  131. 'id' => 'secondary-menu-links',
  132. 'class' => array('links', 'inline', 'clearfix'),
  133. ),
  134. 'heading' => array(
  135. 'text' => t('Secondary menu'),
  136. 'level' => 'h2',
  137. 'class' => array('element-invisible'),
  138. ),
  139. )); ?>
  140. </div> <!-- /#secondary-menu -->
  141. <?php endif; ?>
  142. </div></div> <!-- /.section, /#header -->
  143. <?php if ($messages): ?>
  144. <div id="messages"><div class="section clearfix">
  145. <?php print $messages; ?>
  146. </div></div> <!-- /.section, /#messages -->
  147. <?php endif; ?>
  148. <?php if ($page['featured']): ?>
  149. <div id="featured"><div class="section clearfix">
  150. <?php print render($page['featured']); ?>
  151. </div></div> <!-- /.section, /#featured -->
  152. <?php endif; ?>
  153. <div id="main-wrapper" class="clearfix"><div id="main" class="clearfix">
  154. <?php if ($breadcrumb): ?>
  155. <div id="breadcrumb"><?php print $breadcrumb; ?></div>
  156. <?php endif; ?>
  157. <?php if ($page['sidebar_first']): ?>
  158. <div id="sidebar-first" class="column sidebar"><div class="section">
  159. <?php print render($page['sidebar_first']); ?>
  160. </div></div> <!-- /.section, /#sidebar-first -->
  161. <?php endif; ?>
  162. <div id="content" class="column"><div class="section">
  163. <?php if ($page['highlighted']): ?><div id="highlighted"><?php print render($page['highlighted']); ?></div><?php endif; ?>
  164. <a id="main-content"></a>
  165. <?php print render($title_prefix); ?>
  166. <?php if ($title): ?>
  167. <h1 class="title" id="page-title">
  168. <?php print $title; ?>
  169. </h1>
  170. <?php endif; ?>
  171. <?php print render($title_suffix); ?>
  172. <?php if ($tabs): ?>
  173. <div class="tabs">
  174. <?php print render($tabs); ?>
  175. </div>
  176. <?php endif; ?>
  177. <?php print render($page['help']); ?>
  178. <?php if ($action_links): ?>
  179. <ul class="action-links">
  180. <?php print render($action_links); ?>
  181. </ul>
  182. <?php endif; ?>
  183. <?php print render($page['content']); ?>
  184. <?php print $feed_icons; ?>
  185. </div></div> <!-- /.section, /#content -->
  186. <?php if ($page['sidebar_second']): ?>
  187. <div id="sidebar-second" class="column sidebar"><div class="section">
  188. <?php print render($page['sidebar_second']); ?>
  189. </div></div> <!-- /.section, /#sidebar-second -->
  190. <?php endif; ?>
  191. </div></div> <!-- /#main, /#main-wrapper -->
  192. <?php if ($page['triptych_first'] || $page['triptych_middle'] || $page['triptych_last']): ?>
  193. <div id="triptych-wrapper"><div id="triptych" class="clearfix">
  194. <?php print render($page['triptych_first']); ?>
  195. <?php print render($page['triptych_middle']); ?>
  196. <?php print render($page['triptych_last']); ?>
  197. </div></div> <!-- /#triptych, /#triptych-wrapper -->
  198. <?php endif; ?>
  199. <div id="footer-wrapper"><div class="section">
  200. <?php if ($page['footer_firstcolumn'] || $page['footer_secondcolumn'] || $page['footer_thirdcolumn'] || $page['footer_fourthcolumn']): ?>
  201. <div id="footer-columns" class="clearfix">
  202. <?php print render($page['footer_firstcolumn']); ?>
  203. <?php print render($page['footer_secondcolumn']); ?>
  204. <?php print render($page['footer_thirdcolumn']); ?>
  205. <?php print render($page['footer_fourthcolumn']); ?>
  206. </div> <!-- /#footer-columns -->
  207. <?php endif; ?>
  208. <?php if ($page['footer']): ?>
  209. <div id="footer" class="clearfix">
  210. <?php print render($page['footer']); ?>
  211. </div> <!-- /#footer -->
  212. <?php endif; ?>
  213. </div></div> <!-- /.section, /#footer-wrapper -->
  214. </div></div> <!-- /#page, /#page-wrapper -->