Skip to content

Commit

Permalink
Merge pull request #131 from alesrebec/7.x-2.x
Browse files Browse the repository at this point in the history
Added option in og_context_plugin_argument_default_group_context.inc to accompany the permission rewrite in og_context().
  • Loading branch information
amitaibu committed Jul 11, 2017
2 parents e477daf + 16be973 commit 60d9f3b
Showing 1 changed file with 8 additions and 1 deletion.
Expand Up @@ -17,6 +17,7 @@ class og_context_plugin_argument_default_group_context extends views_plugin_argu
function option_definition() {
$options = parent::option_definition();
$options['group_type'] = array('default' => 'node');
$options['check_access'] = array('default' => TRUE, 'bool' => TRUE);

return $options;
}
Expand All @@ -32,13 +33,19 @@ class og_context_plugin_argument_default_group_context extends views_plugin_argu
'#default_value' => $this->options['group_type'],
'#description' => t('Determine what entity type that group should be of.')
);
$form['check_access'] = array(
'#type' => 'checkbox',
'#title' => t('Check access'),
'#description' => t('Determines if access to the group should be done. Defaults to "Checked".'),
'#default_value' => $this->options['check_access'],
);
}

/**
* Return the group context argument.
*/
function get_argument() {
if ($group = og_context($this->options['group_type'])) {
if ($group = og_context($this->options['group_type'], NULL, NULL, $this->options['check_access'])) {
return $group['gid'];
}
return FALSE;
Expand Down

0 comments on commit 60d9f3b

Please sign in to comment.