function _rate_check_widget in Rate 6.2
Same name and namespace in other branches
- 7 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:
5 calls to _rate_check_widget()
- rate_comment in ./
rate.module - Implements hook_comment().
- rate_generate_widget in ./
rate.module - Generate a widget.
- rate_link in ./
rate.module - Implements hook_link()
- rate_nodeapi in ./
rate.module - Implements hook_nodeapi().
- rate_widget_form in ./
rate.admin.inc - Form for adding and editing widgets.
File
- ./
rate.module, line 904 - 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;
}