updated webform, webform_localization, profile2, term_merge, search_api_saved_pages, rules, redirect, overide_node_options

This commit is contained in:
2019-05-13 18:47:27 +02:00
parent 58cd990c8c
commit 9adc940a67
281 changed files with 28658 additions and 7138 deletions

View File

@@ -1,7 +1,8 @@
<?php
/**
* @file Contains UI for diverse plugins provided by Rules.
* @file
* Contains UI for diverse plugins provided by Rules.
*/
/**
@@ -9,15 +10,21 @@
*/
class RulesRuleUI extends RulesActionContainerUI {
protected $rule, $conditions;
protected $rule;
protected $conditions;
/**
* Constructs a RulesRuleUI object.
*
* @param FacesExtendable $object
*/
public function __construct(FacesExtendable $object) {
parent::__construct($object);
$this->rule = $object;
$this->conditions = $this->rule->conditionContainer();
}
public function form(&$form, &$form_state, $options = array()) {
public function form(&$form, &$form_state, $options = array(), $iterator = NULL) {
$form_state['rules_element'] = $this->rule;
$label = $this->element->label();
// Automatically add a counter to unlabelled rules.
@@ -58,7 +65,7 @@ class RulesRuleUI extends RulesActionContainerUI {
/**
* Applies the values of the form to the rule configuration.
*/
function form_extract_values($form, &$form_state) {
public function form_extract_values($form, &$form_state) {
$form_values = RulesPluginUI::getFormStateValues($form, $form_state);
// Run condition and action container value extraction.
if (isset($form['conditions'])) {
@@ -70,13 +77,13 @@ class RulesRuleUI extends RulesActionContainerUI {
parent::form_extract_values($form, $form_state);
}
public function operations() {
// When rules are listed only show the edit and delete operations.
$ops = parent::operations();
$ops['#links'] = array_intersect_key($ops['#links'], array_flip(array('edit', 'delete')));
return $ops;
}
}
/**
@@ -84,26 +91,46 @@ class RulesRuleUI extends RulesActionContainerUI {
*/
class RulesReactionRuleUI extends RulesRuleUI {
public function form(&$form, &$form_state, $options = array()) {
public function form(&$form, &$form_state, $options = array(), $iterator = NULL) {
$form['events'] = array(
'#type' => 'container',
'#weight' => -10,
'#access' => empty($options['init']),
);
$event_info = rules_fetch_data('event_info');
$form['events']['table'] = array(
'#theme' => 'table',
'#caption' => 'Events',
'#header' => array('Event', 'Operations'),
'#header' => array(t('Event'), t('Operations')),
'#empty' => t('None'),
);
$form['events']['table']['#attributes']['class'][] = 'rules-elements-table';
foreach ($this->rule->events() as $event_name) {
$event_info += array($event_name => array('label' => t('Unknown event "!event_name"', array('!event_name' => $event_name))));
$event_handler = rules_get_event_handler($event_name, $this->rule->getEventSettings($event_name));
$event_operations = array(
'#theme' => 'links__rules',
'#attributes' => array(
'class' => array(
'rules-operations',
'action-links',
'rules_rule_event',
),
),
'#links' => array(
'delete_event' => array(
'title' => t('delete'),
'href' => RulesPluginUI::path($this->rule->name, 'delete/event/' . $event_name),
'query' => drupal_get_destination(),
),
),
);
$form['events']['table']['#rows'][$event_name] = array(
check_plain($event_info[$event_name]['label']),
'<span class="rules_rule_event">' . l(t('delete'), RulesPluginUI::path($this->rule->name, 'delete/event/' . $event_name)) . '</span>',
'data' => array(
$event_handler->summary(),
array('data' => $event_operations),
),
);
}
@@ -150,6 +177,7 @@ class RulesReactionRuleUI extends RulesRuleUI {
$this->rule->active = $form_values['active'];
$this->rule->weight = $form_values['weight'];
}
}
/**
@@ -166,6 +194,7 @@ class RulesRuleSetUI extends RulesActionContainerUI {
$form['elements']['#attributes']['class'][] = 'rules-rule-set';
$form['elements']['#caption'] = t('Rules');
}
}
/**
@@ -173,7 +202,7 @@ class RulesRuleSetUI extends RulesActionContainerUI {
*/
class RulesLoopUI extends RulesActionContainerUI {
public function form(&$form, &$form_state, $options = array()) {
public function form(&$form, &$form_state, $options = array(), $iterator = NULL) {
parent::form($form, $form_state, $options);
$settings = $this->element->settings;
@@ -199,7 +228,7 @@ class RulesLoopUI extends RulesActionContainerUI {
);
}
function form_extract_values($form, &$form_state) {
public function form_extract_values($form, &$form_state) {
parent::form_extract_values($form, $form_state);
$form_values = RulesPluginUI::getFormStateValues($form, $form_state);
@@ -231,4 +260,5 @@ class RulesLoopUI extends RulesActionContainerUI {
);
return $content;
}
}