template.php

  1. cis7 sites/all/themes/ulmus/omega/starterkits/alpha-xhtml/template.php
  2. cis7 sites/all/themes/ulmus/rubik/template.php
  3. cis7 sites/all/themes/local_contrib/zurb-foundation/template.php
  4. cis7 sites/all/themes/ulmus/skeletontheme/template.php
  5. cis7 sites/all/themes/ulmus/corolla/template.php
  6. cis7 sites/all/themes/ulmus/ember/template.php
  7. cis7 sites/all/themes/ulmus/respond/template.php
  8. cis7 sites/all/themes/ulmus/aurora/template.php
  9. cis7 sites/all/themes/ulmus/tao/template.php
  10. cis7 sites/all/themes/ulmus/fontfolio/template.php
  11. cis7 modules/simpletest/tests/themes/test_theme/template.php
  12. cis7 profiles/cis/themes/cis-theme/template.php
  13. cis7 sites/all/themes/local_contrib/zurb-foundation/STARTER/template.php
  14. cis7 sites/all/themes/ulmus/omega/alpha/template.php
  15. cis7 sites/all/themes/ulmus/omega/omega/template.php
  16. cis7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/template.php
  17. cis7 sites/all/themes/ulmus/adaptivetheme/at_core/template.php
  18. cis7 sites/all/themes/ulmus/adaptivetheme/at_admin/template.php
  19. cis7 sites/all/themes/ulmus/omega/starterkits/omega-html5/template.php
  20. cis7 sites/all/themes/ulmus/omega/starterkits/omega-xhtml/template.php
  21. cis7 sites/all/modules/ulmus/libraries/tests/themes/libraries_test_theme/template.php
  22. cis7 sites/all/themes/elmsln_contrib/chamfer/template.php
  23. cis7 themes/garland/template.php
  24. cis7 themes/bartik/template.php
  25. cis7 themes/seven/template.php
  26. cis7 sites/all/themes/elmsln_contrib/foundation_access/template.php
  27. cle7 sites/all/themes/ulmus/omega/omega/template.php
  28. cle7 sites/all/themes/local_contrib/zurb_foundation/STARTER/template.php
  29. cle7 sites/all/modules/ulmus/libraries/tests/themes/libraries_test_theme/template.php
  30. cle7 sites/all/themes/ulmus/omega/starterkits/omega-xhtml/template.php
  31. cle7 sites/all/themes/ulmus/skeletontheme/template.php
  32. cle7 sites/all/themes/ulmus/omega/starterkits/omega-html5/template.php
  33. cle7 sites/all/themes/ulmus/omega/starterkits/alpha-xhtml/template.php
  34. cle7 sites/all/themes/ulmus/adaptivetheme/at_admin/template.php
  35. cle7 sites/all/themes/ulmus/adaptivetheme/at_core/template.php
  36. cle7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/template.php
  37. cle7 sites/all/themes/local_contrib/bootstrap/bootstrap_subtheme/template.php
  38. cle7 sites/all/themes/ulmus/omega/alpha/template.php
  39. cle7 sites/all/themes/elmsln_contrib/chamfer/template.php
  40. cle7 modules/simpletest/tests/themes/test_theme/template.php
  41. cle7 sites/all/themes/ulmus/rubik/template.php
  42. cle7 sites/all/themes/ulmus/fontfolio/template.php
  43. cle7 sites/all/themes/ulmus/tao/template.php
  44. cle7 sites/all/themes/ulmus/aurora/template.php
  45. cle7 sites/all/themes/ulmus/respond/template.php
  46. cle7 sites/all/themes/ulmus/ember/template.php
  47. cle7 sites/all/themes/ulmus/corolla/template.php
  48. cle7 sites/all/themes/local_contrib/bootstrap/template.php
  49. cle7 sites/all/themes/local_contrib/zurb_foundation/STARTER/template.php
  50. cle7 themes/garland/template.php
  51. cle7 themes/bartik/template.php
  52. cle7 sites/all/themes/local_contrib/zurb_foundation/template.php
  53. cle7 sites/all/themes/elmsln_contrib/foundation_access/template.php
  54. cle7 themes/seven/template.php
  55. ecd7 sites/all/themes/ulmus/adaptivetheme/at_admin/template.php
  56. ecd7 sites/all/themes/ulmus/adaptivetheme/at_core/template.php
  57. ecd7 sites/all/themes/ulmus/omega/omega/template.php
  58. ecd7 sites/all/themes/ulmus/omega/alpha/template.php
  59. ecd7 sites/all/themes/local_contrib/zurb_foundation/STARTER/template.php
  60. ecd7 modules/simpletest/tests/themes/test_theme/template.php
  61. ecd7 sites/all/themes/ulmus/rubik/template.php
  62. ecd7 sites/all/themes/ulmus/fontfolio/template.php
  63. ecd7 sites/all/themes/ulmus/tao/template.php
  64. ecd7 sites/all/themes/ulmus/aurora/template.php
  65. ecd7 sites/all/themes/ulmus/respond/template.php
  66. ecd7 sites/all/themes/ulmus/ember/template.php
  67. ecd7 sites/all/modules/ulmus/libraries/tests/themes/libraries_test_theme/template.php
  68. ecd7 themes/garland/template.php
  69. ecd7 themes/bartik/template.php
  70. ecd7 themes/seven/template.php
  71. ecd7 sites/all/themes/ulmus/omega/starterkits/omega-xhtml/template.php
  72. ecd7 sites/all/themes/ulmus/omega/starterkits/omega-html5/template.php
  73. ecd7 sites/all/themes/ulmus/omega/starterkits/alpha-xhtml/template.php
  74. ecd7 sites/all/themes/elmsln_contrib/chamfer/template.php
  75. ecd7 sites/all/themes/elmsln_contrib/foundation_access/template.php
  76. ecd7 sites/all/themes/local_contrib/zurb_foundation/template.php
  77. ecd7 sites/all/themes/ulmus/skeletontheme/template.php
  78. ecd7 sites/all/themes/ulmus/corolla/template.php
  79. ecd7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/template.php
  80. elmsmedia7 sites/all/themes/ulmus/omega/starterkits/omega-xhtml/template.php
  81. elmsmedia7 sites/all/themes/ulmus/omega/starterkits/omega-html5/template.php
  82. elmsmedia7 sites/all/modules/ulmus/libraries/tests/themes/libraries_test_theme/template.php
  83. elmsmedia7 sites/all/themes/elmsln_contrib/foundation_access/template.php
  84. elmsmedia7 sites/all/themes/local_contrib/zurb_foundation/template.php
  85. elmsmedia7 sites/all/themes/ulmus/adaptivetheme/at_admin/template.php
  86. elmsmedia7 sites/all/themes/local_contrib/zurb_foundation/STARTER/template.php
  87. elmsmedia7 sites/all/themes/ulmus/omega/starterkits/alpha-xhtml/template.php
  88. elmsmedia7 sites/all/themes/ulmus/respond/template.php
  89. elmsmedia7 sites/all/themes/ulmus/adaptivetheme/at_core/template.php
  90. elmsmedia7 themes/seven/template.php
  91. elmsmedia7 themes/garland/template.php
  92. elmsmedia7 sites/all/themes/elmsln_contrib/chamfer/template.php
  93. elmsmedia7 sites/all/themes/ulmus/rubik/template.php
  94. elmsmedia7 sites/all/themes/ulmus/skeletontheme/template.php
  95. elmsmedia7 sites/all/themes/ulmus/fontfolio/template.php
  96. elmsmedia7 sites/all/themes/ulmus/tao/template.php
  97. elmsmedia7 sites/all/themes/ulmus/aurora/template.php
  98. elmsmedia7 sites/all/themes/ulmus/ember/template.php
  99. elmsmedia7 sites/all/themes/ulmus/corolla/template.php
  100. elmsmedia7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/template.php
  101. elmsmedia7 modules/simpletest/tests/themes/test_theme/template.php
  102. elmsmedia7 sites/all/themes/ulmus/omega/alpha/template.php
  103. elmsmedia7 sites/all/themes/ulmus/omega/omega/template.php
  104. elmsmedia7 themes/bartik/template.php
  105. harmony7 sites/all/themes/elmsln_contrib/foundation_access/template.php
  106. harmony7 sites/all/themes/local_contrib/zurb_foundation/template.php
  107. harmony7 sites/all/themes/elmsln_contrib/chamfer/template.php
  108. harmony7 sites/all/themes/local_contrib/bootstrap/template.php
  109. harmony7 sites/all/themes/local_contrib/bootstrap/bootstrap_subtheme/template.php
  110. harmony7 modules/simpletest/tests/themes/test_theme/template.php
  111. harmony7 sites/all/themes/local_contrib/zurb_foundation/STARTER/template.php
  112. harmony7 sites/all/themes/ulmus/corolla/template.php
  113. harmony7 sites/all/themes/ulmus/omega/alpha/template.php
  114. harmony7 sites/all/themes/ulmus/omega/omega/template.php
  115. harmony7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/template.php
  116. harmony7 sites/all/themes/ulmus/adaptivetheme/at_core/template.php
  117. harmony7 sites/all/themes/ulmus/adaptivetheme/at_admin/template.php
  118. harmony7 sites/all/themes/ulmus/omega/starterkits/alpha-xhtml/template.php
  119. harmony7 sites/all/themes/ulmus/omega/starterkits/omega-html5/template.php
  120. harmony7 sites/all/themes/ulmus/omega/starterkits/omega-xhtml/template.php
  121. harmony7 sites/all/modules/ulmus/libraries/tests/themes/libraries_test_theme/template.php
  122. harmony7 themes/seven/template.php
  123. harmony7 themes/bartik/template.php
  124. harmony7 themes/garland/template.php
  125. harmony7 sites/all/themes/ulmus/skeletontheme/template.php
  126. harmony7 sites/all/themes/ulmus/tao/template.php
  127. harmony7 sites/all/themes/ulmus/ember/template.php
  128. harmony7 sites/all/themes/ulmus/aurora/template.php
  129. harmony7 sites/all/themes/ulmus/fontfolio/template.php
  130. harmony7 sites/all/themes/ulmus/rubik/template.php
  131. harmony7 sites/all/themes/ulmus/respond/template.php
  132. icor7 sites/all/themes/ulmus/respond/template.php
  133. icor7 sites/all/themes/local_contrib/zurb_foundation/STARTER/template.php
  134. icor7 sites/all/themes/local_contrib/zurb_foundation/template.php
  135. icor7 themes/seven/template.php
  136. icor7 themes/bartik/template.php
  137. icor7 themes/garland/template.php
  138. icor7 sites/all/themes/elmsln_contrib/foundation_access/template.php
  139. icor7 sites/all/themes/elmsln_contrib/chamfer/template.php
  140. icor7 sites/all/themes/ulmus/skeletontheme/template.php
  141. icor7 sites/all/themes/ulmus/corolla/template.php
  142. icor7 sites/all/themes/ulmus/ember/template.php
  143. icor7 sites/all/themes/ulmus/fontfolio/template.php
  144. icor7 sites/all/themes/ulmus/aurora/template.php
  145. icor7 sites/all/themes/ulmus/tao/template.php
  146. icor7 modules/simpletest/tests/themes/test_theme/template.php
  147. icor7 sites/all/themes/ulmus/omega/alpha/template.php
  148. icor7 sites/all/themes/ulmus/omega/omega/template.php
  149. icor7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/template.php
  150. icor7 sites/all/themes/ulmus/adaptivetheme/at_core/template.php
  151. icor7 sites/all/themes/ulmus/adaptivetheme/at_admin/template.php
  152. icor7 sites/all/themes/ulmus/omega/starterkits/alpha-xhtml/template.php
  153. icor7 sites/all/themes/ulmus/omega/starterkits/omega-html5/template.php
  154. icor7 sites/all/themes/ulmus/omega/starterkits/omega-xhtml/template.php
  155. icor7 sites/all/modules/ulmus/libraries/tests/themes/libraries_test_theme/template.php
  156. icor7 sites/all/themes/ulmus/rubik/template.php
  157. meedjum_blog7 themes/seven/template.php
  158. meedjum_blog7 themes/bartik/template.php
  159. meedjum_blog7 sites/all/themes/ulmus/fontfolio/template.php
  160. meedjum_blog7 sites/all/modules/ulmus/libraries/tests/themes/libraries_test_theme/template.php
  161. meedjum_blog7 sites/all/themes/ulmus/omega/starterkits/omega-xhtml/template.php
  162. meedjum_blog7 sites/all/themes/ulmus/omega/starterkits/omega-html5/template.php
  163. meedjum_blog7 sites/all/themes/ulmus/omega/starterkits/alpha-xhtml/template.php
  164. meedjum_blog7 sites/all/themes/ulmus/adaptivetheme/at_admin/template.php
  165. meedjum_blog7 sites/all/themes/ulmus/adaptivetheme/at_core/template.php
  166. meedjum_blog7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/template.php
  167. meedjum_blog7 sites/all/themes/ulmus/omega/omega/template.php
  168. meedjum_blog7 sites/all/themes/ulmus/omega/alpha/template.php
  169. meedjum_blog7 modules/simpletest/tests/themes/test_theme/template.php
  170. meedjum_blog7 sites/all/themes/ulmus/rubik/template.php
  171. meedjum_blog7 sites/all/themes/ulmus/tao/template.php
  172. meedjum_blog7 sites/all/themes/ulmus/aurora/template.php
  173. meedjum_blog7 sites/all/themes/ulmus/respond/template.php
  174. meedjum_blog7 sites/all/themes/ulmus/ember/template.php
  175. meedjum_blog7 sites/all/themes/ulmus/corolla/template.php
  176. meedjum_blog7 sites/all/themes/ulmus/skeletontheme/template.php
  177. meedjum_blog7 sites/all/themes/elmsln_contrib/chamfer/template.php
  178. meedjum_blog7 sites/all/themes/elmsln_contrib/foundation_access/template.php
  179. meedjum_blog7 sites/all/themes/local_contrib/zurb_foundation/template.php
  180. meedjum_blog7 sites/all/themes/local_contrib/meedjum/template.php
  181. meedjum_blog7 sites/all/themes/local_contrib/zurb_foundation/STARTER/template.php
  182. meedjum_blog7 themes/garland/template.php
  183. mooc7 themes/seven/template.php
  184. mooc7 sites/all/themes/local_contrib/zurb_foundation/STARTER/template.php
  185. mooc7 sites/all/themes/elmsln_contrib/chamfer/template.php
  186. mooc7 themes/bartik/template.php
  187. mooc7 sites/all/themes/ulmus/omega/alpha/template.php
  188. mooc7 sites/all/themes/elmsln_contrib/foundation_access/template.php
  189. mooc7 sites/all/modules/ulmus/libraries/tests/themes/libraries_test_theme/template.php
  190. mooc7 sites/all/themes/ulmus/omega/starterkits/omega-xhtml/template.php
  191. mooc7 sites/all/themes/ulmus/omega/starterkits/omega-html5/template.php
  192. mooc7 sites/all/themes/ulmus/omega/starterkits/alpha-xhtml/template.php
  193. mooc7 sites/all/themes/ulmus/adaptivetheme/at_admin/template.php
  194. mooc7 sites/all/themes/ulmus/adaptivetheme/at_core/template.php
  195. mooc7 sites/all/themes/ulmus/adaptivetheme/at_subtheme/template.php
  196. mooc7 sites/all/themes/ulmus/omega/omega/template.php
  197. mooc7 modules/simpletest/tests/themes/test_theme/template.php
  198. mooc7 themes/garland/template.php
  199. mooc7 sites/all/themes/ulmus/rubik/template.php
  200. mooc7 sites/all/themes/ulmus/fontfolio/template.php
  201. mooc7 sites/all/themes/ulmus/tao/template.php
  202. mooc7 sites/all/themes/ulmus/aurora/template.php
  203. mooc7 sites/all/themes/ulmus/respond/template.php
  204. mooc7 sites/all/themes/ulmus/ember/template.php
  205. mooc7 sites/all/themes/ulmus/corolla/template.php
  206. mooc7 sites/all/themes/ulmus/skeletontheme/template.php
  207. mooc7 sites/all/themes/local_contrib/zurb_foundation/template.php
  208. mooc7 sites/all/modules/local_contrib/omega_tools/default/template.php

Contains theme override functions and preprocess functions for FontFolio Drupal theme.

Functions

Namesort descending Description
fontfolio_feed_icon Overrides core theme_feed_icon() to call fontfolio custom feed icon
fontfolio_form_search_block_form_alter Implements hook_form_FORM_ID_alter.
fontfolio_html_head_alter Implements template_html_head_alter();
fontfolio_pager Overrides core theme_pager function to manipulate pager classes
fontfolio_preprocess_block Override or insert vars into the block template.
fontfolio_preprocess_html Override or insert variables into the html template.
fontfolio_preprocess_node Override or insert vars into the node template.
fontfolio_preprocess_page Override or insert vars into the page template.
fontfolio_process_html Override or insert vars into the html templates.
fontfolio_process_html_tag Override or insert vars in the html_tag theme function.

File

sites/all/themes/ulmus/fontfolio/template.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Contains theme override functions and preprocess functions
  5. * for FontFolio Drupal theme.
  6. */
  7. /**
  8. * Implements template_html_head_alter();
  9. *
  10. * Changes the default meta content-type tag to the shorter HTML5 version
  11. * This function copied as is from Boron theme
  12. */
  13. function fontfolio_html_head_alter(&$head_elements) {
  14. $head_elements['system_meta_content_type']['#attributes'] = array(
  15. 'charset' => 'utf-8'
  16. );
  17. }
  18. /**
  19. * Override or insert variables into the html template.
  20. *
  21. * @param $vars
  22. * An array of variables to pass to the theme template.
  23. */
  24. function fontfolio_preprocess_html(&$vars) {
  25. // We want to use core's body class 'no-sidebars' but is useless for us
  26. // because it doesn't ccounts fontfolio's 'sidebar' region as sidebar.
  27. // So we first remove it.
  28. $vars['classes_array'] = array_diff($vars['classes_array'], array('no-sidebars'));
  29. // And restore it if appropriate.
  30. if ( empty($vars['page']['sidebar']) ) {
  31. $vars['classes_array'][] = 'no-sidebars';
  32. }
  33. $vars['path_to_fontfolio'] = drupal_get_path('theme', 'fontfolio');
  34. $vars['base_path'] = base_path();
  35. // Attributes for html element.
  36. $vars['html_attributes_array'] = array(
  37. 'lang' => $vars['language']->language,
  38. 'dir' => $vars['language']->dir,
  39. );
  40. // Send X-UA-Compatible HTTP header to force IE to use the most recent
  41. // rendering engine or use Chrome's frame rendering engine if available.
  42. // This also prevents the IE compatibility mode button to appear when using
  43. // conditional classes on the html tag.
  44. if (is_null(drupal_get_http_header('X-UA-Compatible'))) {
  45. drupal_add_http_header('X-UA-Compatible', 'IE=edge,chrome=1');
  46. }
  47. // We want to insert inline css rules based on fonfolio theme settings.
  48. $bg_color = check_plain(theme_get_setting('body_bg_color'));
  49. $data = 'body { background-color: ' . $bg_color . '}';
  50. drupal_add_css($data, 'inline');
  51. }
  52. /**
  53. * Override or insert vars into the html templates.
  54. *
  55. * @param $vars
  56. * An array of vars to pass to the theme template.
  57. * @param $hook
  58. * The name of the template being rendered ("html" in this case.)
  59. */
  60. function fontfolio_process_html(&$vars, $hook) {
  61. // Flatten out html_attributes.
  62. $vars['html_attributes'] = drupal_attributes($vars['html_attributes_array']);
  63. }
  64. /**
  65. * Override or insert vars in the html_tag theme function.
  66. */
  67. function fontfolio_process_html_tag(&$vars) {
  68. $tag = &$vars['element'];
  69. if ($tag['#tag'] == 'style' || $tag['#tag'] == 'script') {
  70. // Remove redundant type attribute and CDATA comments.
  71. unset($tag['#attributes']['type'], $tag['#value_prefix'], $tag['#value_suffix']);
  72. // Remove media="all" but leave others unaffected.
  73. if (isset($tag['#attributes']['media']) && $tag['#attributes']['media'] === 'all') {
  74. unset($tag['#attributes']['media']);
  75. }
  76. }
  77. }
  78. /**
  79. * Override or insert vars into the page template.
  80. */
  81. function fontfolio_preprocess_page(&$vars) {
  82. // Create variables according to theme settings information.
  83. $social['facebook'] = theme_get_setting('facebook');
  84. $social['twitter'] = theme_get_setting('twitter');
  85. $social['plus'] = theme_get_setting('plus');
  86. $social['dribble'] = theme_get_setting('dribble');
  87. $vars['social_links'] = '';
  88. // Set $options['html'] to TRUE to enable image as l() function text
  89. $options['html'] = TRUE;
  90. foreach ($social as $key => $value) {
  91. if ($value != '') {
  92. $imgvars['path'] = drupal_get_path('theme', 'fontfolio') . '/styles/images/' . $key . '-icon.png';
  93. $imgvars['attributes']['class'] = array($key);
  94. if ($key == 'plus') {
  95. $key = 'Google+';
  96. }
  97. $imgvars['alt'] = t("@site_name's at @social_network", array(
  98. '@social_network' => $key,
  99. '@site_name' => $vars['site_name'],
  100. ));
  101. $icon = theme('image', $imgvars);
  102. $vars['social_links'] .= l($icon, $value, $options);
  103. }
  104. }
  105. // Show page title on taxonomy term pages?
  106. if (arg(0) == 'taxonomy' && arg(1) == 'term' && theme_get_setting('hide_page_tile') == 1) {
  107. $vars['title'] = '';
  108. }
  109. // If site is multilingual and not disabled in theme settings Create links to all
  110. // frontpages in all enabled languages and attach them to main manu.
  111. $vars['lang_links'] = array();
  112. if (theme_get_setting('show_lang_links') == 1) {
  113. $languages = language_list('enabled');
  114. if (count($languages[1]) > 1) {
  115. // We dont want to include language code
  116. // as part of the default language frontpage link.
  117. $default_lang_object = language_default();
  118. $default_lang = $default_lang_object->language;
  119. global $base_url;
  120. foreach ($languages[1] as $language) {
  121. if ($vars['language']->language != $language->language) {
  122. if ($language->language == $default_lang) {
  123. $href = $base_url . '/';
  124. }
  125. else {
  126. $href = $base_url . '/' . $language->language;
  127. }
  128. $vars['lang_links'][$language->language] = array(
  129. 'href' => $href,
  130. 'title' => $language->native,
  131. 'attributes' => array('class' => array('language-link')),
  132. );
  133. // Insert language links to main_menu array of links.
  134. }
  135. }
  136. }
  137. }
  138. }
  139. /**
  140. * Override or insert vars into the node template.
  141. */
  142. function fontfolio_preprocess_node(&$vars) {
  143. if ($vars['view_mode'] == 'full' && node_is_page($vars['node'])) {
  144. // @TODOS: see if needed.
  145. $vars['classes_array'][] = 'node-full';
  146. }
  147. else {
  148. // We need to distinguish the first node on front page teasers.
  149. // So we count the nodes for each teasers page request.
  150. static $numbered = 1;
  151. // Initialize default fonfolio node teaser class to 'post-box'.
  152. // 'post-box' class styles the smaller node boxes on typical FontFolio
  153. // teaser lists.
  154. $teaser_box_type = 'post-box';
  155. // FontFolio has different way to style node teasers if presented as part
  156. // of default blog teasers list. We recognize such list if its first URL
  157. // parameter is "blog".
  158. // But we dont want to use this style if blog displayed at site frontpage.
  159. // So we set different class for Blog teaser.
  160. if (arg(0) == 'blog' && !($vars['is_front'])) {
  161. $teaser_box_type = 'blog-box';
  162. }
  163. $vars['classes_array'][] = $vars['zebra'];
  164. // Set first teaser node classes to allow the bigger dimentions for first teaser.
  165. if ($numbered == 1) {
  166. $vars['classes_array'][] = 'first';
  167. $numbered++;
  168. if ($vars['is_front']) {
  169. $teaser_box_type = 'big-post-box';
  170. }
  171. }
  172. $vars['classes_array'][] = $teaser_box_type;
  173. }
  174. }
  175. /**
  176. * Override or insert vars into the block template.
  177. */
  178. function fontfolio_preprocess_block(&$vars) {
  179. // On sidebar block insert 'side-box' class.
  180. if ($vars['elements']['#block']->region == 'sidebar') {
  181. $vars['classes_array'][] = 'side-box';
  182. }
  183. }
  184. /**
  185. * Implements hook_form_FORM_ID_alter.
  186. */
  187. function fontfolio_form_search_block_form_alter(&$form, &$form_state) {
  188. // Change the text on the label element.
  189. $form['search_block_form']['#title'] = t('Search');
  190. // Toggle label visibilty.
  191. $form['search_block_form']['#title_display'] = 'invisible';
  192. // Set a default value for the textfield.
  193. $form['search_block_form']['#default_value'] = t('Search');
  194. // default_value onfocus/Blurr behaviour.
  195. $form['search_block_form']['#attributes']['onblur'] = "if (this.value == '') {this.value = '" . t('Search') . "';}";
  196. $form['search_block_form']['#attributes']['onfocus'] = "if (this.value == '" . t('Search') . "') {this.value = '';}";
  197. // Submit Button.
  198. $form['actions']['submit'] = array('#type' => 'image_button', '#src' => base_path() . path_to_theme() . '/styles/images/search-icon.png');
  199. $form['actions']['submit']['#attributes']['class'] = array('search_icon');
  200. }
  201. /**
  202. * Overrides core theme_pager function to manipulate pager classes
  203. */
  204. function fontfolio_pager($vars) {
  205. $tags = $vars['tags'];
  206. $element = $vars['element'];
  207. $parameters = $vars['parameters'];
  208. $quantity = $vars['quantity'];
  209. global $pager_page_array, $pager_total;
  210. // Calculate various markers within this pager piece:
  211. // Middle is used to "center" pages around the current page.
  212. $pager_middle = ceil($quantity / 2);
  213. // Current is the page we are currently paged to.
  214. $pager_current = $pager_page_array[$element] + 1;
  215. // First is the first page listed by this pager piece (re quantity).
  216. $pager_first = $pager_current - $pager_middle + 1;
  217. // Last is the last page listed by this pager piece (re quantity).
  218. $pager_last = $pager_current + $quantity - $pager_middle;
  219. // Max is the maximum page number.
  220. $pager_max = $pager_total[$element];
  221. // End of marker calculations.
  222. // Prepare for generation loop.
  223. $i = $pager_first;
  224. if ($pager_last > $pager_max) {
  225. // Adjust "center" if at end of query.
  226. $i = $i + ($pager_max - $pager_last);
  227. $pager_last = $pager_max;
  228. }
  229. if ($i <= 0) {
  230. // Adjust "center" if at start of query.
  231. $pager_last = $pager_last + (1 - $i);
  232. $i = 1;
  233. }
  234. // End of generation loop preparation.
  235. $li_first = theme('pager_first', array(
  236. 'text' => (isset($tags[0]) ? $tags[0] : t('« first')),
  237. 'element' => $element,
  238. 'parameters' => $parameters,
  239. ));
  240. $li_previous = theme('pager_previous', array(
  241. 'text' => (isset($tags[1]) ? $tags[1] : t('‹ previous')),
  242. 'element' => $element,
  243. 'interval' => 1,
  244. 'parameters' => $parameters,
  245. ));
  246. $li_next = theme('pager_next', array(
  247. 'text' => (isset($tags[3]) ? $tags[3] : t('next ›')),
  248. 'element' => $element,
  249. 'interval' => 1,
  250. 'parameters' => $parameters,
  251. ));
  252. $li_last = theme('pager_last', array(
  253. 'text' => (isset($tags[4]) ? $tags[4] : t('last »')),
  254. 'element' => $element,
  255. 'parameters' => $parameters,
  256. ));
  257. if ($pager_total[$element] > 1) {
  258. if ($li_first) {
  259. $items[] = array(
  260. 'class' => array('pager-first', 'load_more_text'),
  261. 'data' => $li_first,
  262. );
  263. }
  264. if ($li_previous) {
  265. $items[] = array(
  266. 'class' => array('pager-previous', 'load_more_text'),
  267. 'data' => $li_previous,
  268. );
  269. }
  270. // When there is more than one page, create the pager list.
  271. if ($i != $pager_max) {
  272. if ($i > 1) {
  273. $items[] = array(
  274. 'class' => array('pager-ellipsis', 'load_more_text'),
  275. 'data' => '…',
  276. );
  277. }
  278. // Now generate the actual pager piece.
  279. for (; $i <= $pager_last && $i <= $pager_max; $i++) {
  280. if ($i < $pager_current) {
  281. $items[] = array(
  282. 'class' => array('pager-item', 'load_more_text'),
  283. 'data' => theme('pager_previous', array(
  284. 'text' => $i,
  285. 'element' => $element,
  286. 'interval' => ($pager_current - $i),
  287. 'parameters' => $parameters,
  288. )),
  289. );
  290. }
  291. if ($i == $pager_current) {
  292. $items[] = array(
  293. 'class' => array('pager-current', 'load_more_text'),
  294. 'data' => $i,
  295. );
  296. }
  297. if ($i > $pager_current) {
  298. $items[] = array(
  299. 'class' => array('pager-item', 'load_more_text'),
  300. 'data' => theme('pager_next', array(
  301. 'text' => $i,
  302. 'element' => $element,
  303. 'interval' => ($i - $pager_current),
  304. 'parameters' => $parameters,
  305. )),
  306. );
  307. }
  308. }
  309. if ($i < $pager_max) {
  310. $items[] = array(
  311. 'class' => array('pager-ellipsis', 'load_more_text'),
  312. 'data' => '…',
  313. );
  314. }
  315. }
  316. // End generation.
  317. if ($li_next) {
  318. $items[] = array(
  319. 'class' => array('pager-next', 'load_more_text'),
  320. 'data' => $li_next,
  321. );
  322. }
  323. if ($li_last) {
  324. $items[] = array(
  325. 'class' => array('pager-last', 'load_more_text'),
  326. 'data' => $li_last,
  327. );
  328. }
  329. return '<h2 class="element-invisible">' . t('Pages') . '</h2>' . theme('item_list', array(
  330. 'items' => $items,
  331. 'attributes' => array('class' => array('pager', 'load_more_cont')),
  332. ));
  333. }
  334. }
  335. /**
  336. * Overrides core theme_feed_icon() to call fontfolio custom feed icon
  337. */
  338. function fontfolio_feed_icon($vars) {
  339. $path = drupal_get_path('theme', 'fontfolio') . '/styles/images/feed.png';
  340. $text = t('Subscribe to @feed-title', array('@feed-title' => $vars['title']));
  341. if ($image = theme('image', array(
  342. 'path' => $path,
  343. 'width' => 20,
  344. 'height' => 20,
  345. 'alt' => $text,
  346. ))) {
  347. return l($image, $vars['url'], array(
  348. 'html' => TRUE,
  349. 'attributes' => array('class' => array('feed-icon'), 'title' => $text),
  350. ));
  351. }
  352. }
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.