New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added option in og_context_plugin_argument_default_group_context.inc to accompany the permission rewrite in og_context(). #131
Changes from 2 commits
f9e77de
4982107
0e33e39
16be973
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,13 +32,21 @@ 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' => 'select', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Solved. |
||
'#options' => array(t('No'), t('Yes')), | ||
'#title' => t('Check access'), | ||
'#default_value' => $this->options['check_access'], | ||
'#description' => t('Determines if access to the group should be done. Defaults to "Yes".') | ||
); | ||
} | ||
|
||
/** | ||
* Return the group context argument. | ||
*/ | ||
function get_argument() { | ||
if ($group = og_context($this->options['group_type'])) { | ||
$check_access = (isset($this->options['check_access']) && $this->options['check_access'] == 0) ? FALSE : TRUE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and then you can do |
||
if ($group = og_context($this->options['group_type'], NULL, NULL, $check_access)) { | ||
return $group['gid']; | ||
} | ||
return FALSE; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to define it also in
option_definition