You are here

function icon_theme in Icon API 8

Same name and namespace in other branches
  1. 7 includes/theme.inc \icon_theme()

Implements hook_theme().

File

includes/theme.inc, line 13
theme.inc Provides hooks and functions for theme related tasks.

Code

function icon_theme($existing, $type, $theme, $path) {
  $include_path = drupal_get_path('module', 'icon') . '/includes';
  $hooks['icon_bundle_overview_form'] = array(
    'render element' => 'form',
    'file' => 'admin.inc',
    'path' => $include_path,
  );
  $hooks['icon'] = array(
    'file' => 'theme.inc',
    'path' => $include_path,
    'variables' => array(
      'attributes' => array(),
      'icon' => NULL,
      'bundle' => NULL,
      'token_data' => array(),
      'wrapper' => '',
      'wrapper_attributes' => array(),
      'wrapper_class' => '',
    ),
  );

  // Add theming hooks for render hooks so they can control their own output.
  // Due to a nasty bug in template suggestions and preprocessing, we can't do
  // something like icon_RENDER_HOOK__BUNDLE and have it be completely dynamic
  // as it probably should be.
  // @see: http://drupal.org/node/956520
  $render_hooks = array();
  foreach (icon_render_hooks() as $hook) {
    if (!isset($render_hooks[$hook['name']])) {
      $hooks['icon_' . $hook['name']] = array(
        'file' => $hook['file'],
        'path' => $hook['path'],
        'variables' => array(
          'attributes' => array(),
          'icon' => NULL,
          'bundle' => NULL,
          'token_data' => array(),
          'wrapper' => '',
          'wrapper_attributes' => array(),
          'wrapper_class' => '',
        ),
      );
    }
  }
  return $hooks;
}