Commit 60d9f3ba authored by amitaibu's avatar amitaibu Committed by GitHub

Merge pull request #131 from alesrebec/7.x-2.x

Added option in og_context_plugin_argument_default_group_context.inc to accompany the permission rewrite in og_context().
parents e477daff 16be973d
......@@ -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;
}
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment