class mobile_tools_context_condition_mobile in Mobile Tools 7.2
Same name and namespace in other branches
- 6.3 plugins/mobile_tools_context_condition_mobile.inc \mobile_tools_context_condition_mobile
- 6.2 plugins/mobile_tools_context_condition_mobile.inc \mobile_tools_context_condition_mobile
@file Integration with the Context module
Triggers a context for a mobile device vs a desktop device @todo add arbitrary group contexts?
Hierarchy
- class \context_condition
Expanded class hierarchy of mobile_tools_context_condition_mobile
2 string references to 'mobile_tools_context_condition_mobile'
- mobile_tools_context_context_plugins in mobile_tools_context/
mobile_tools_context.module - Implementation of hook_context_plugins().
- mobile_tools_context_context_registry in mobile_tools_context/
mobile_tools_context.module - Implements hook_context_registry().
File
- mobile_tools_context/
mobile_tools_context.condition_mobile.inc, line 9 - Integration with the Context module
View source
class mobile_tools_context_condition_mobile extends context_condition {
/**
* Default values
*/
function condition_values() {
return array();
}
/**
* Process condition logic
*/
function execute() {
// Get active device group
$active = mobile_tools_get_active_device_group();
// Trigger the context condition based on the active device group
// @todo
}
/**
* Configuration form
*/
function condition_form($context) {
$form = parent::condition_form($context);
$form['#type'] = 'checkboxes';
$form['#description'] = t('Trigger this context when the given device groups are active.');
$form['#options'] = mobile_tools_device_groups();
$form['#default_value'] = $this
->fetch_from_context($context, 'values');
return $form;
}
/**
* Form submit handler
*/
function condition_form_submit($values) {
// @todo
//dpm($values);
return $values;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
context_condition:: |
property | |||
context_condition:: |
property | |||
context_condition:: |
property | |||
context_condition:: |
property | |||
context_condition:: |
function | Marks a context as having met this particular condition. | ||
context_condition:: |
function | Check whether this condition is used by any contexts. Can be used to prevent expensive condition checks from being triggered when no contexts use this condition. | ||
context_condition:: |
function | Context editor form for conditions. | 2 | |
context_condition:: |
function | Context editor form submit handler. | ||
context_condition:: |
function | Retrieve options from the context provided. | ||
context_condition:: |
function | Retrieve all contexts with the condition value provided. | 2 | |
context_condition:: |
function | Options form. Provide additional options for your condition. | 4 | |
context_condition:: |
function | Options form submit handler. | ||
context_condition:: |
function | Settings form. Provide variable settings for your condition. | ||
context_condition:: |
function | Clone our references when we're being cloned. | ||
context_condition:: |
function | Constructor. Do not override. | ||
mobile_tools_context_condition_mobile:: |
function |
Configuration form Overrides context_condition:: |
||
mobile_tools_context_condition_mobile:: |
function |
Form submit handler Overrides context_condition:: |
||
mobile_tools_context_condition_mobile:: |
function |
Default values Overrides context_condition:: |
||
mobile_tools_context_condition_mobile:: |
function | Process condition logic |