You are here

function styles_theme in Styles 6

Same name and namespace in other branches
  1. 6.2 styles.module \styles_theme()
  2. 7.2 styles.module \styles_theme()
  3. 7 styles.module \styles_theme()

Implements hook_theme().

File

./styles.module, line 31
Bundles similar display formatters together.

Code

function styles_theme($existing, $type, $theme, $path) {
  $themes = array(
    'styles' => array(
      'arguments' => array(
        'field_type' => NULL,
        'style_name' => NULL,
        'object' => NULL,
      ),
      'template' => 'styles',
      'path' => $path . '/themes',
      'file' => 'styles.theme.inc',
    ),
    'field_formatter_styles' => array(
      'arguments' => array(
        'element' => NULL,
      ),
      'path' => $path . '/themes',
      'file' => 'styles.theme.inc',
    ),
  );
  foreach (styles_presets() as $field_name => $presets) {
    foreach ($presets as $preset_name => $preset) {
      $themes['styles_formatter_styles_' . $field_name . '_' . $preset_name] = array(
        'arguments' => array(
          'element' => NULL,
        ),
        'function' => 'theme_field_formatter_styles',
        'path' => $path . '/themes',
        'file' => 'styles.theme.inc',
      );
    }
  }
  return $themes;
}