You are here

function fivestar_theme in Fivestar 8

Same name and namespace in other branches
  1. 6.2 fivestar.module \fivestar_theme()
  2. 6 fivestar.module \fivestar_theme()
  3. 7.2 fivestar.module \fivestar_theme()

Implements hook_theme().

File

./fivestar.module, line 55
A simple n-star voting widget, usable in other forms.

Code

function fivestar_theme() {
  return [
    'fivestar' => [
      'function' => 'theme_fivestar',
      'render element' => 'element',
      'file' => 'includes/fivestar.theme.inc',
    ],
    'fivestar_select' => [
      'function' => 'theme_fivestar_select',
      'render element' => 'element',
      'file' => 'includes/fivestar.theme.inc',
    ],
    'fivestar_static' => [
      'variables' => [
        'rating' => NULL,
        'stars' => 5,
        'vote_type' => 'vote',
        'widget' => [
          'name' => 'default',
          'css' => '',
        ],
      ],
    ],
    'fivestar_static_element' => [
      'variables' => [
        'star_display' => NULL,
        'title' => NULL,
        'description' => NULL,
      ],
    ],
    'fivestar_summary' => [
      'variables' => [
        'user_rating' => NULL,
        'average_rating' => NULL,
        'votes' => 0,
        'stars' => 5,
        'microdata' => [],
      ],
    ],
    'fivestar_preview' => [
      'function' => 'theme_fivestar_preview',
      'variables' => [
        'style' => NULL,
        'text' => NULL,
        'stars' => NULL,
        'unvote' => NULL,
        'title' => NULL,
      ],
      'file' => 'includes/fivestar.theme.inc',
    ],
    'fivestar_preview_widget' => [
      'function' => 'theme_fivestar_preview_widget',
      'variables' => [
        'css' => NULL,
        'name' => NULL,
      ],
      'file' => 'includes/fivestar.theme.inc',
    ],
    'fivestar_preview_wrapper' => [
      'function' => 'theme_fivestar_preview_wrapper',
      'variables' => [
        'content' => NULL,
        'type' => 'direct',
      ],
      'file' => 'includes/fivestar.theme.inc',
    ],
    // Field formatters.
    'fivestar_formatter_default' => [
      'function' => 'theme_fivestar_formatter_default',
      'render element' => 'element',
      'file' => 'includes/fivestar.theme.inc',
    ],
    'fivestar_formatter_rating' => [
      'render element' => 'element',
    ],
    'fivestar_formatter_percentage' => [
      'render element' => 'element',
    ],
  ];
}