function RulesContainerPluginUI::addOperations

Gets the Add-* operations for the given element.

3 calls to RulesContainerPluginUI::addOperations()
RulesActionContainerUI::form in ui/ui.core.inc
Implements RulesPluginUIInterface::form().
RulesConditionContainerUI::form in ui/ui.core.inc
Implements RulesPluginUIInterface::form().
RulesContainerPluginUI::operations in ui/ui.core.inc
Implements RulesPluginUIInterface.

File

ui/ui.core.inc, line 1092

Class

RulesContainerPluginUI
UI for Rules Container.

Code

public function addOperations() {
    $name = $this->element
        ->root()->name;
    $render = array(
        '#theme' => 'links__rules',
    );
    $render['#attributes']['class'][] = 'rules-operations-add';
    $render['#attributes']['class'][] = 'action-links';
    foreach (rules_fetch_data('plugin_info') as $plugin => $info) {
        if (!empty($info['embeddable']) && $this->element instanceof $info['embeddable']) {
            $render['#links']['add_' . $plugin] = array(
                'title' => t('Add !name', array(
                    '!name' => $plugin,
                )),
                'href' => RulesPluginUI::path($name, 'add', $this->element, $plugin),
            );
        }
    }
    return $render;
}