template.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * @file template.php
  4. *
  5. */
  6. /**
  7. * Implementation of hook_theme
  8. */
  9. function perfarttimeline_theme() {
  10. $path = drupal_get_path('theme', 'perfarttimeline');
  11. # Register theme function for the system_settings_form.
  12. return array(
  13. 'system_settings_form' => array(
  14. 'arguments' => array('form' => NULL, 'key' => 'perfarttimeline'),
  15. ),
  16. );
  17. # Include the theme settings.
  18. include($path .'/inc/template.theme-settings.inc');
  19. }
  20. /**
  21. * Implementation of hook_preprocess()
  22. *
  23. * This function checks to see if a hook has a preprocess file associated with
  24. * it, and if so, loads it.
  25. *
  26. * @param $vars
  27. * An array of variables to pass to the theme template.
  28. * @param $hook
  29. * The name of the template being rendered.
  30. */
  31. function perfarttimeline_preprocess(&$vars, $hook) {
  32. global $theme, $theme_info, $user, $language;
  33. $vars['is_admin'] = in_array('admin', $user->roles);
  34. $vars['logged_in'] = ($user->uid > 0) ? TRUE : FALSE;
  35. $vars['theme_path'] = base_path() . path_to_theme() .'/';
  36. // $vars['classes_array'][] = $hook.' '.$hook.'-'.$vars['zebra'];
  37. # Include preprocess functions if and when required.
  38. $path = drupal_get_path('theme', 'perfarttimeline');
  39. $file = $path .'/preprocess/'. str_replace('_', '-', $hook) .'.pre.php';
  40. if (is_file($file)) {
  41. include($file);
  42. }
  43. }
  44. $path = drupal_get_path('theme', 'perfarttimeline');
  45. # Include custom functions.
  46. include_once($path .'/inc/template.custom-functions.inc');
  47. # Include theme overrides.
  48. include_once($path .'/inc/template.theme-overrides.inc');
  49. # Include some jQuery.
  50. // include_once(drupal_get_path('theme', 'perfarttimeline') .'/inc/template.theme-js.inc');