Projet

Général

Profil

Révision 950416da

Ajouté par Assos Assos il y a plus de 5 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/rules/ui/ui.plugins.inc
1 1
<?php
2 2

  
3 3
/**
4
 * @file Contains UI for diverse plugins provided by Rules.
4
 * @file
5
 * Contains UI for diverse plugins provided by Rules.
5 6
 */
6 7

  
7 8
/**
......
9 10
 */
10 11
class RulesRuleUI extends RulesActionContainerUI {
11 12

  
12
  protected $rule, $conditions;
13
  protected $rule;
14
  protected $conditions;
13 15

  
16
  /**
17
   * Constructs a RulesRuleUI object.
18
   *
19
   * @param FacesExtendable $object
20
   */
14 21
  public function __construct(FacesExtendable $object) {
15 22
    parent::__construct($object);
16 23
    $this->rule = $object;
......
58 65
  /**
59 66
   * Applies the values of the form to the rule configuration.
60 67
   */
61
  function form_extract_values($form, &$form_state) {
68
  public function form_extract_values($form, &$form_state) {
62 69
    $form_values = RulesPluginUI::getFormStateValues($form, $form_state);
63 70
    // Run condition and action container value extraction.
64 71
    if (isset($form['conditions'])) {
......
70 77
    parent::form_extract_values($form, $form_state);
71 78
  }
72 79

  
73

  
74 80
  public function operations() {
75 81
    // When rules are listed only show the edit and delete operations.
76 82
    $ops = parent::operations();
77 83
    $ops['#links'] = array_intersect_key($ops['#links'], array_flip(array('edit', 'delete')));
78 84
    return $ops;
79 85
  }
86

  
80 87
}
81 88

  
82 89
/**
......
94 101
    $form['events']['table'] = array(
95 102
      '#theme' => 'table',
96 103
      '#caption' => 'Events',
97
      '#header' => array('Event', 'Operations'),
104
      '#header' => array(t('Event'), t('Operations')),
98 105
      '#empty' => t('None'),
99 106
    );
100 107
    $form['events']['table']['#attributes']['class'][] = 'rules-elements-table';
......
170 177
    $this->rule->active = $form_values['active'];
171 178
    $this->rule->weight = $form_values['weight'];
172 179
  }
180

  
173 181
}
174 182

  
175 183
/**
......
186 194
    $form['elements']['#attributes']['class'][] = 'rules-rule-set';
187 195
    $form['elements']['#caption'] = t('Rules');
188 196
  }
197

  
189 198
}
190 199

  
191 200
/**
......
219 228
    );
220 229
  }
221 230

  
222
  function form_extract_values($form, &$form_state) {
231
  public function form_extract_values($form, &$form_state) {
223 232
    parent::form_extract_values($form, $form_state);
224 233
    $form_values = RulesPluginUI::getFormStateValues($form, $form_state);
225 234

  
......
251 260
    );
252 261
    return $content;
253 262
  }
263

  
254 264
}

Formats disponibles : Unified diff