class flag_handler_relationship_user_content in Flag 6
Same name and namespace in other branches
- 6.2 includes/flag_handler_relationships.inc \flag_handler_relationship_user_content
- 7.3 includes/views/flag_handler_relationships.inc \flag_handler_relationship_user_content
- 7.2 includes/flag_handler_relationships.inc \flag_handler_relationship_user_content
Specialized relationship handler associating flags and users.
Hierarchy
- class \flag_handler_relationship_user_content extends \views_handler_relationship
Expanded class hierarchy of flag_handler_relationship_user_content
1 string reference to 'flag_handler_relationship_user_content'
- flag_views_data_alter in includes/
flag.views.inc - Implementation of hook_views_data_alter().
File
- includes/
flag_handler_relationships.inc, line 155 - Contains various relationship handlers.
View source
class flag_handler_relationship_user_content extends views_handler_relationship {
function option_definition() {
$options = parent::option_definition();
$options['flag'] = array(
'default' => flag_views_flag_default(NULL),
);
$options['required'] = array(
'default' => 1,
);
return $options;
}
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['label']['#description'] .= ' ' . t('Including name of the selected flag helps identify this relationship.');
$form['flag'] = flag_views_flag_config_form('radios', NULL, $this->options['flag']);
$form['flag']['#title'] = t('Flagged');
$form['required']['#title'] = t('Include only users who have flagged content.');
$form['required']['#description'] = t('If checked, only users that have flagged any content with this flag will be included.');
}
function admin_summary() {
return $this->options['flag'];
}
/**
* Called to implement a relationship in a query.
*/
function query() {
$flag = flag_get_flag($this->options['flag']);
$this->definition['extra'][] = array(
'field' => 'fid',
'value' => $flag->fid,
'numeric' => TRUE,
);
parent::query();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
flag_handler_relationship_user_content:: |
function | |||
flag_handler_relationship_user_content:: |
function | |||
flag_handler_relationship_user_content:: |
function | |||
flag_handler_relationship_user_content:: |
function | Called to implement a relationship in a query. |