You are here

function _rate_check_widget in Rate 7

Same name and namespace in other branches
  1. 6.2 rate.module \_rate_check_widget()

Check widget object for missing values. We use this for legacy reasons. Values may not be available after updating from an old version.

Parameters

object $widget:

3 calls to _rate_check_widget()
rate_generate_widget in ./rate.module
Generate a widget.
rate_node_view in ./rate.module
Implements hook_node_view().
rate_widget_form in ./rate.admin.inc
Form for adding and editing widgets.

File

./rate.module, line 1103
Rate module

Code

function _rate_check_widget(&$widget) {
  isset($widget->translate) or $widget->translate = TRUE;
  isset($widget->node_display) or $widget->node_display = RATE_DISPLAY_BELOW_CONTENT;
  isset($widget->teaser_display) or $widget->teaser_display = TRUE;
  isset($widget->comment_display) or $widget->comment_display = RATE_DISPLAY_BELOW_CONTENT;
  isset($widget->node_display_mode) or $widget->node_display_mode = RATE_FULL;
  isset($widget->teaser_display_mode) or $widget->teaser_display_mode = RATE_FULL;
  isset($widget->comment_display_mode) or $widget->comment_display_mode = RATE_FULL;
  isset($widget->roles) or $widget->roles = array();
  isset($widget->allow_voting_by_author) or $widget->allow_voting_by_author = TRUE;
  isset($widget->noperm_behaviour) or $widget->noperm_behaviour = RATE_NOPERM_REDIRECT_WITH_MESSAGE;
  isset($widget->displayed) or $widget->displayed = RATE_AVERAGE;
  isset($widget->displayed_just_voted) or $widget->displayed_just_voted = RATE_USER;
  isset($widget->template) or $widget->template = 'custom';
  isset($widget->customizable) or $widget->customizable = TRUE;
  isset($widget->description) or $widget->description = '';
  isset($widget->description_in_compact) or $widget->description_in_compact = TRUE;
}