You are here

function rate_ui_widget_load_widget in Rate 7.2

Load widget settings from database into storage array.

Parameters

int $wid:

array $storage:

Return value

int

1 call to rate_ui_widget_load_widget()
rate_ui_widget_form in ui/rate_ui.form.inc
Implements hook_form().

File

ui/rate_ui.form.inc, line 857
This file contains the differtent Rate UI forms.

Code

function rate_ui_widget_load_widget($type, &$storage) {

  // Select widget by type.
  $widget = db_select('rate_widget', 'w')
    ->fields('w', array(
    'wid',
    'type',
    'name',
    'mode',
    'sprites',
    'highlight_voted',
    'highlight_mouseover',
    'desc_norating',
    'desc_notvoted',
    'desc_voted',
    'desc_justvoted',
    'desc_mouseover',
    'css_file',
    'js_file',
  ))
    ->condition('w.type', $type)
    ->execute()
    ->fetchObject();
  if (!$widget) {
    return $storage;
  }
  $storage = (array) $widget;
  rate_ui_widget_load_buttons($storage['wid'], $storage);
  rate_ui_widget_load_layout($storage['wid'], $storage);
  return $storage['wid'];
}