process.inc

  1. cis7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc
  2. cle7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc
  3. ecd7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc
  4. elmsmedia7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc
  5. harmony7 sites/all/themes/local_contrib/bootstrap/theme/process.inc
  6. harmony7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc
  7. icor7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc
  8. meedjum_blog7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc
  9. mooc7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc

All Process functions for templates and theme fucntions.

If you need to add or modify process functions do it in your sub-theme.

Functions

Namesort descending Description
adaptivetheme_process_block Process variables for block.tpl.php
adaptivetheme_process_comment Process variables for comment.tpl.php
adaptivetheme_process_html Process variables for html.tpl.php
adaptivetheme_process_html_tag Process variables for the html tag
adaptivetheme_process_maintenance_page Process variables for maintenance-page.tpl.php
adaptivetheme_process_menubar Process variables for adaptivtheme_menubar()
adaptivetheme_process_node Process variables for node.tpl.php
adaptivetheme_process_page Process variables for page.tpl.php
adaptivetheme_process_region Process variables for region.tpl.php
adaptivetheme_process_user_profile Process variables for user-profile.tpl.php

File

sites/all/themes/ulmus/adaptivetheme/at_core/inc/process.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * All Process functions for templates and theme fucntions.
  5. *
  6. * If you need to add or modify process functions do it in your sub-theme.
  7. */
  8. /**
  9. * Process variables for html.tpl.php
  10. */
  11. function adaptivetheme_process_html(&$vars) {
  12. // Flatten attributes arrays
  13. $vars['html_attributes'] = empty($vars['html_attributes_array']) ? '' : drupal_attributes($vars['html_attributes_array']);
  14. // $rdf_namespaces is kept to maintain backwards compatibility, and because we
  15. // only want this to print once in html.tpl.php, and not in every conditional
  16. // comment for IE.
  17. $vars['rdf_namespaces'] = empty($vars['rdf_namespaces_array']) ? '' : drupal_attributes($vars['rdf_namespaces_array']);
  18. // Render polyfills
  19. if ($vars['polyfills']) {
  20. $vars['polyfills'] = drupal_render($vars['polyfills']);
  21. }
  22. }
  23. /**
  24. * Process variables for the html tag
  25. */
  26. function adaptivetheme_process_html_tag(&$vars) {
  27. $tag = &$vars['element'];
  28. if ($tag['#tag'] === 'style' || $tag['#tag'] === 'script') {
  29. // Remove redundant type attribute and CDATA comments.
  30. unset($tag['#attributes']['type'], $tag['#value_prefix'], $tag['#value_suffix']);
  31. // Remove media="all" but leave others unaffected.
  32. if (isset($tag['#attributes']['media']) && $tag['#attributes']['media'] === 'all') {
  33. unset($tag['#attributes']['media']);
  34. }
  35. }
  36. }
  37. /**
  38. * Process variables for page.tpl.php
  39. */
  40. function adaptivetheme_process_page(&$vars) {
  41. global $theme_key;
  42. $theme_name = $theme_key;
  43. // Attributes
  44. $vars['page_attributes'] = empty($vars['page_attributes_array']) ? '' : drupal_attributes($vars['page_attributes_array']);
  45. $vars['header_attributes'] = empty($vars['header_attributes_array']) ? '' : drupal_attributes($vars['header_attributes_array']);
  46. $vars['branding_attributes'] = empty($vars['branding_attributes_array']) ? '' : drupal_attributes($vars['branding_attributes_array']);
  47. $vars['hgroup_attributes'] = empty($vars['hgroup_attributes_array']) ? '' : drupal_attributes($vars['hgroup_attributes_array']);
  48. $vars['site_name_attributes'] = empty($vars['site_name_attributes_array']) ? '' : drupal_attributes($vars['site_name_attributes_array']);
  49. $vars['site_slogan_attributes'] = empty($vars['site_slogan_attributes_array']) ? '' : drupal_attributes($vars['site_slogan_attributes_array']);
  50. $vars['content_header_attributes'] = empty($vars['content_header_attributes_array']) ? '' : drupal_attributes($vars['content_header_attributes_array']);
  51. $vars['footer_attributes'] = empty($vars['footer_attributes_array']) ? '' : drupal_attributes($vars['footer_attributes_array']);
  52. // Theme the menu bars
  53. if (!empty($vars['primary_navigation'])) {
  54. $vars['primary_navigation'] = theme('menubar', array('menu' => $vars['primary_navigation'],'type' => 'primary'));
  55. }
  56. if (!empty($vars['secondary_navigation'])) {
  57. $vars['secondary_navigation'] = theme('menubar', array('menu' => $vars['secondary_navigation'], 'type' => 'secondary'));
  58. }
  59. // Generate the wrapper element for the main content
  60. $vars['tag'] = $vars['title'] ? 'section' : 'div';
  61. // Process enabled Extensions
  62. if (at_get_setting('enable_extensions', $theme_name) === 1) {
  63. if (at_get_setting('enable_markup_overides', $theme_name) === 1) {
  64. // Add page template suggestions per node type, but make the suggestion weak
  65. // so other suggestions can easily override it.
  66. if (at_get_setting('page_content_type_suggestions', $theme_name) === 1) {
  67. if (isset($vars['node'])) {
  68. $suggestion = 'page__' . $vars['node']->type;
  69. array_unshift($vars['theme_hook_suggestions'], $suggestion);
  70. }
  71. }
  72. // Force full width wrapper template suggestion if enabled
  73. if (at_get_setting('page_full_width_wrappers', $theme_name) === 1) {
  74. array_unshift($vars['theme_hook_suggestions'], 'page__full_width_wrappers');
  75. }
  76. // Remove the frontpage title if set in theme settings
  77. if (at_get_setting('frontpage_remove_title') === 1 && $vars['is_front'] === TRUE) {
  78. $vars['title'] = '';
  79. }
  80. }
  81. }
  82. // Page template suggestions for Panels pages
  83. if (module_exists('page_manager')) {
  84. if($panel_page = page_manager_get_current_page()) {
  85. // add a generic suggestion for all panel pages
  86. $suggestions[] = 'page__panels';
  87. // add the panel page machine name to the template suggestions
  88. $suggestions[] = 'page__' . $panel_page['name'];
  89. // merge the suggestions in to the existing suggestions (as more specific than the existing suggestions)
  90. $vars['theme_hook_suggestions'] = array_merge($vars['theme_hook_suggestions'], $suggestions);
  91. }
  92. }
  93. }
  94. /**
  95. * Process variables for region.tpl.php
  96. */
  97. function adaptivetheme_process_region(&$vars) {
  98. // Initialize and populate the outer wrapper variables
  99. $vars['outer_prefix'] = '<div class="' . $vars['classes'] . '">';
  100. $vars['outer_suffix'] = '</div>';
  101. // Initialize and populate the inner wrapper variables
  102. $vars['inner_prefix'] = '<div class="region-inner clearfix">';
  103. $vars['inner_suffix'] = '</div>';
  104. // Some regions need different or no markup
  105. // Use a region template with no wrappers for the main content
  106. if ($vars['region'] === 'content') {
  107. $vars['outer_prefix'] = '';
  108. $vars['outer_suffix'] = '';
  109. $vars['inner_prefix'] = '';
  110. $vars['inner_suffix'] = '';
  111. }
  112. // Menu bar needs an id, nav class and no inner wrapper
  113. if ($vars['region'] === 'menu_bar') {
  114. $vars['outer_prefix'] = '<div id="menu-bar" class="nav clearfix">';
  115. $vars['inner_prefix'] = '';
  116. $vars['inner_suffix'] = '';
  117. }
  118. }
  119. /**
  120. * Process variables for block.tpl.php
  121. */
  122. function adaptivetheme_process_block(&$vars) {
  123. // Now we know all the block $tag's, we can generate our wrapper, $tag is
  124. // set in preprocess. We cant introduce these in preprocess due to attributes
  125. // and classes not being flattened untill we hit process.
  126. $vars['outer_prefix'] = '<' . $vars['tag'] . ' id="' . $vars['block_html_id'] . '" class="' . $vars['classes'] . '" ' . $vars['attributes'] . '>';
  127. $vars['outer_suffix'] = '</' . $vars['tag'] . '>';
  128. // Block inner attributes
  129. $vars['block_inner_attributes'] = empty($vars['block_inner_attributes_array']) ? '' : drupal_attributes($vars['block_inner_attributes_array']);
  130. // Populate the default inner wrappers
  131. $vars['inner_prefix'] = '<div' . $vars['block_inner_attributes'] . '>';
  132. $vars['inner_suffix'] = '</div>';
  133. // Wrap the content variable in a div with attributes
  134. $vars['content_processed'] = '<div' . $vars['content_attributes'] . '>' . $vars['content'] . '</div>';
  135. // The menu bar region gets special treatment for the block template
  136. if ($vars['block']->region === 'menu_bar') {
  137. $vars['inner_prefix'] = '';
  138. $vars['inner_suffix'] = '';
  139. $vars['content_processed'] = $vars['content']; // remove the default wrapper
  140. }
  141. // Navigation or menu blocks get special treatment in these regions
  142. if ($vars['block']->region === 'leaderboard' || $vars['block']->region === 'header') {
  143. if ($vars['tag'] == 'nav') {
  144. $vars['content_processed'] = $vars['content']; // remove the default wrapper
  145. }
  146. }
  147. // Some blocks look bad with wrappers so we strip them
  148. if ($vars['block']->region === 'content') {
  149. $vars['inner_prefix'] = '';
  150. $vars['inner_suffix'] = '';
  151. $vars['content_processed'] = $vars['content'];
  152. }
  153. if ($vars['block']->module === 'panels_mini') {
  154. $vars['inner_prefix'] = '';
  155. $vars['inner_suffix'] = '';
  156. }
  157. // Provide additional suggestions so the block__menu suggestion can be overridden easily
  158. $vars['theme_hook_suggestions'][] = 'block__' . $vars['block']->region . '__' . $vars['block']->module;
  159. $vars['theme_hook_suggestions'][] = 'block__' . $vars['block']->region . '__' . $vars['block']->delta;
  160. }
  161. /**
  162. * Process variables for node.tpl.php
  163. */
  164. function adaptivetheme_process_node(&$vars) {
  165. global $theme_key;
  166. $theme_name = $theme_key;
  167. // Strip default drupal classes if not required
  168. if (at_get_setting('extra_article_classes', $theme_name) === 0) {
  169. $classes = explode(' ', $vars['classes']);
  170. $striped_classes = array('node-sticky', 'node-promoted', 'node-teaser', 'node-preview');
  171. foreach ($striped_classes as $class) {
  172. if (in_array($class, $classes)) {
  173. $classes = str_replace($class, '', $classes);
  174. }
  175. }
  176. $vars['classes'] = trim(implode(' ', $classes));
  177. }
  178. // Flatten the additional wrapper attributes array
  179. $vars['header_attributes'] = empty($vars['header_attributes_array']) ? '' : drupal_attributes($vars['header_attributes_array']);
  180. $vars['footer_attributes'] = empty($vars['footer_attributes_array']) ? '' : drupal_attributes($vars['footer_attributes_array']);
  181. $vars['links_attributes'] = empty($vars['links_attributes_array']) ? '' : drupal_attributes($vars['links_attributes_array']);
  182. // If a panels layout is being rendered by Display Suite in a node we wrap the
  183. // the layout in markup to make the themers life a little easier and remove
  184. // the requirement to add a DS template override.
  185. if (isset($vars['rendered_by_ds']) && $vars['rendered_by_ds'] == TRUE) {
  186. $vars['panel_prefix'] = '<article id="node-' . $vars['node']->nid . '" class="' . $vars['classes'] . ' rendered-by-ds clearfix"' . $vars['attributes'] . '>';
  187. $vars['panel_prefix'] .= render($vars['title_prefix']);
  188. $vars['panel_prefix'] .= render($vars['title_suffix']);
  189. $vars['panel_suffix'] = '</article>';
  190. }
  191. }
  192. /**
  193. * Process variables for comment.tpl.php
  194. */
  195. function adaptivetheme_process_comment(&$vars) {
  196. global $theme_key;
  197. $theme_name = $theme_key;
  198. // Strip default drupal classes if not required.
  199. if (at_get_setting('extra_comment_classes', $theme_name) === 0) {
  200. $classes = explode(' ', $vars['classes']);
  201. $striped_classes = array('comment-by-anonymous', 'comment-by-node-autho', 'comment-by-viewer', 'comment-new');
  202. foreach ($striped_classes as $class) {
  203. if (in_array($class, $classes)) {
  204. $classes = str_replace($class, '', $classes);
  205. }
  206. }
  207. $vars['classes'] = trim(implode(' ', $classes));
  208. }
  209. // Flatten the additional wrapper attributes array
  210. $vars['header_attributes'] = empty($vars['header_attributes_array']) ? '' : drupal_attributes($vars['header_attributes_array']);
  211. $vars['footer_attributes'] = empty($vars['footer_attributes_array']) ? '' : drupal_attributes($vars['footer_attributes_array']);
  212. $vars['links_attributes'] = empty($vars['links_attributes_array']) ? '' : drupal_attributes($vars['links_attributes_array']);
  213. }
  214. /**
  215. * Process variables for adaptivtheme_menubar()
  216. */
  217. function adaptivetheme_process_menubar(&$vars) {
  218. // The default theme implementation is a function, so template_process() does
  219. // not automatically run, so we need to flatten the classes and attributes
  220. // here. For best performance, only call drupal_attributes() when needed, and
  221. // note that template_preprocess_menubar() does not initialize the
  222. // *_attributes_array variables.
  223. $vars['classes'] = implode(' ', $vars['classes_array']);
  224. $vars['attributes'] = empty($vars['attributes_array']) ? '' : drupal_attributes($vars['attributes_array']);
  225. $vars['content_attributes'] = empty($vars['content_attributes_array']) ? '' : drupal_attributes($vars['content_attributes_array']);
  226. }
  227. /**
  228. * Process variables for maintenance-page.tpl.php
  229. */
  230. function adaptivetheme_process_maintenance_page(&$vars) {
  231. // Render polyfills
  232. if ($vars['polyfills']) {
  233. $vars['polyfills'] = drupal_render($vars['polyfills']);
  234. }
  235. }
  236. /**
  237. * Process variables for user-profile.tpl.php
  238. */
  239. function adaptivetheme_process_user_profile(&$vars) {
  240. // If a panels layout is rendered by Display Suite in a user profile we wrap the
  241. // the layout in markup to make the themers life a little easier and remove
  242. // the requirement to add a DS template override.
  243. if (isset($vars['rendered_by_ds']) && $vars['rendered_by_ds'] == TRUE) {
  244. $vars['panel_prefix'] = '<article id="user-' . $vars['user']->uid . '" class="' . $vars['classes'] . ' rendered-by-ds clearfix"' . $vars['attributes'] . '>';
  245. $vars['panel_suffix'] = '</article>';
  246. }
  247. }
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.