class i18n_menu_node_context_condition in Menu translation - Node 7
Expose translated node menu items as a context condition.
Hierarchy
- class \context_condition
- class \context_condition_menu
Expanded class hierarchy of i18n_menu_node_context_condition
2 string references to 'i18n_menu_node_context_condition'
- i18n_menu_node_context_plugins in ./
i18n_menu_node.module - Implementation of hook_context_plugins().
- i18n_menu_node_context_registry_alter in ./
i18n_menu_node.module - Implementation of hook_context_registry().
File
- plugins/
i18n_menu_node_context_condition.inc, line 6
View source
class i18n_menu_node_context_condition extends context_condition_menu {
/**
* Override of execute().
*/
function execute() {
// Getting the current active trail may trigger a menu tree rendering.
i18n_select(FALSE);
// Execute the 'plain' menu condition. This will work for the source nodes.
parent::execute();
$trail = menu_get_active_trail();
foreach ($trail as $item) {
// If we do not have a matching context we try with the node translations:
// $item['link_path'] holds the source node path, which can be checked
// against the condition map successfully. If it is equal to $item['href']
// we skip the item as it has been already checked before.
if (isset($item['link_path'])) {
$value = $item['link_path'];
if (empty($this->values[$value]) && $item['href'] != $value && i18n_menu_node_enabled($item)) {
foreach ($this
->get_contexts($value) as $context) {
$this
->condition_met($context, $value);
}
}
}
}
// Restore language selection mode.
i18n_select(TRUE);
}
}
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. | ||
context_condition_menu:: |
function |
Override of condition_form().
Use multiselect widget. Overrides context_condition:: |
||
context_condition_menu:: |
function |
Override of condition_form_submit().
Trim any identifier padding for non-unique path menu items. Overrides context_condition:: |
||
context_condition_menu:: |
function |
Override of condition_values(). Overrides context_condition:: |
||
i18n_menu_node_context_condition:: |
function |
Override of execute(). Overrides context_condition_menu:: |