You are here

function custom_formatters_theme in Custom Formatters 6

Same name and namespace in other branches
  1. 8.3 custom_formatters.module \custom_formatters_theme()
  2. 7.2 includes/system.inc \custom_formatters_theme()

Implements hook_theme().

File

./custom_formatters.module, line 26
Contains core functions for the Custom Formatters module.

Code

function custom_formatters_theme() {
  $theme = array();
  $theme['custom_formatters_overview'] = array(
    'arguments' => array(
      'form' => NULL,
    ),
    'file' => 'custom_formatters.admin.inc',
  );
  $theme['custom_formatters_formatter'] = array(
    'arguments' => array(
      'element' => NULL,
    ),
  );
  $theme['custom_formatters_export_info'] = array(
    'arguments' => array(
      'formatters' => NULL,
      'name' => NULL,
    ),
    'template' => 'templates/custom_formatters_export_info',
    'file' => 'custom_formatters.admin.inc',
  );
  $theme['custom_formatters_export_module'] = array(
    'arguments' => array(
      'formatters' => NULL,
      'name' => NULL,
      'mode' => NULL,
    ),
    'template' => 'templates/custom_formatters_export_module',
    'file' => 'custom_formatters.admin.inc',
  );
  $theme['custom_formatters_export_features'] = array(
    'arguments' => array(
      'formatters' => NULL,
    ),
    'template' => 'templates/custom_formatters_export_features',
  );
  $theme['custom_formatters_convert'] = array(
    'arguments' => array(
      'code' => NULL,
    ),
    'template' => 'templates/custom_formatters_convert',
  );
  $theme['custom_formatters_token_tree'] = array(
    'arguments' => array(
      'field' => NULL,
      'global_types' => TRUE,
      'click_insert' => TRUE,
    ),
    'file' => 'custom_formatters.admin.inc',
  );
  $theme['custom_formatters_preview'] = array(
    'arguments' => array(
      'formatter' => NULL,
    ),
    'file' => 'custom_formatters.admin.inc',
  );
  foreach (custom_formatters_formatters() as $formatter) {
    if ($formatter->status) {
      $theme["custom_formatters_formatter_custom_formatters_{$formatter->name}"] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_custom_formatters_formatter',
      );
    }
  }

  // Invoke hook_custom_formatters_theme().
  foreach (module_implements('custom_formatters_theme') as $module) {
    $function = "{$module}_custom_formatters_theme";
    $function($theme);
  }
  return $theme;
}