You are here

function simpleads_theme in SimpleAds 7.2

Same name and namespace in other branches
  1. 8 simpleads.module \simpleads_theme()
  2. 7 includes/simpleads.theme.inc \simpleads_theme()

Implements hook_theme().

File

includes/theme.inc, line 11
SimpleAds theme.

Code

function simpleads_theme($existing, $type, $theme, $path) {
  $templates = array();
  $templates_path = $path . '/templates';
  $docroot = DRUPAL_ROOT . base_path() . $templates_path;
  foreach (_simpleads_ad_types() as $type => $name) {
    if (file_exists($docroot . '/simpleads-type-' . $type . '.tpl.php')) {
      $templates['simpleads_type_' . $type] = array(
        'variables' => array(
          'output' => NULL,
          'type' => NULL,
          'entity' => NULL,
          'options' => NULL,
          'css_classes' => NULL,
        ),
        'template' => 'simpleads-type-' . $type,
        'path' => $templates_path,
        'preprocess functions' => array(
          'simpleads_type_' . $type . '_preprocess',
        ),
      );
    }
  }
  return $templates;
}