class masquerade_is_masquerading_context_condition in Masquerade Extras 6
@file Expose current user role as a context condition.
Hierarchy
- class \masquerade_is_masquerading_context_condition extends \context_condition
Expanded class hierarchy of masquerade_is_masquerading_context_condition
1 string reference to 'masquerade_is_masquerading_context_condition'
- masquerade_context_context_plugins in masquerade_context/
masquerade_context.module - Implements hook_context_plugins().
File
- masquerade_context/
plugins/ condition/ masquerade_is_masquerading.inc, line 6 - Expose current user role as a context condition.
View source
class masquerade_is_masquerading_context_condition extends context_condition {
/**
* For whatever reason, custom plugins' settings get ignored when the context
* editor saves values.
*/
function condition_values() {
return array(
1 => t('Evaluate this context when the current user is posing as someone else.'),
);
}
/**
* Evaluates the condition.
*/
function execute() {
if (isset($_SESSION['masquerading']) && is_numeric($_SESSION['masquerading'])) {
foreach ($this
->get_contexts() as $context) {
$this
->condition_met($context, 'is_masquerading');
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
masquerade_is_masquerading_context_condition:: |
function | For whatever reason, custom plugins' settings get ignored when the context editor saves values. | ||
masquerade_is_masquerading_context_condition:: |
function | Evaluates the condition. |