You are here

function rate_rate_widgets in Rate 7.2

Implements hook_rate_widgets().

File

./rate.module, line 352
Main module file for the Rate module.

Code

function rate_rate_widgets() {
  $output = array();
  $widgets = db_select('rate_widget', 'w')
    ->fields('w', array(
    'type',
    'name',
  ))
    ->execute()
    ->fetchAll();
  foreach ($widgets as $widget) {
    $output[$widget->type] = new stdClass();
    $output[$widget->type]->name = $widget->name;
    $output[$widget->type]->class = 'RateDefaultWidget';
    $output[$widget->type]->file = 'classes/default.inc';
  }
  return $output;
}