Projet

Général

Profil

Révision 39a181a4

Ajouté par Assos Assos il y a environ 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/link/views/link_views_handler_argument_target.inc
7 7

  
8 8
/**
9 9
 * Argument handler to filter results by target.
10
 *
11
 * @codingStandardsIgnoreStart
10 12
 */
11 13
class link_views_handler_argument_target extends views_handler_argument {
12 14

  
13 15
  /**
14 16
   * Provide defaults for the argument when a new one is created.
15 17
   */
16
  function options(&$options) {
17
    parent::options($options);
18
  }
18
  function option_definition() {
19
    $options = parent::option_definition();
19 20

  
21
    return $options;
22
  }
20 23
  /**
21 24
   * Provide a default options form for the argument.
25
   *
26
   * @codingStandardsIgnoreStart
22 27
   */
23
  function options_form(&$form, &$form_state) {
28
  public function options_form(&$form, &$form_state) {
29
    // @codingStandardsIgnoreEnd
24 30
    $defaults = $this->default_actions();
25 31

  
26 32
    $form['title'] = array(
......
52 58

  
53 59
    $form['wildcard'] = array(
54 60
      '#prefix' => '<div class="views-right-50">',
55
      // prefix and no suffix means these two items will be grouped together.
61
      // Prefix and no suffix means these two items will be grouped together.
56 62
      '#type' => 'textfield',
57 63
      '#title' => t('Wildcard'),
58 64
      '#size' => 20,
......
125 131

  
126 132
    asort($validate_types);
127 133
    $form['validate_type']['#options'] = $validate_types;
128
    // Show this gadget if *anything* but 'none' is selected
129 134

  
135
    // Show this gadget if *anything* but 'none' is selected.
130 136
    $form['validate_fail'] = array(
131 137
      '#type' => 'select',
132 138
      '#title' => t('Action to take if argument does not validate'),
......
140 146
   *
141 147
   * The argument sent may be found at $this->argument.
142 148
   */
143
  function query($group_by = FALSE) {
149
  public function query($group_by = FALSE) {
144 150
    $this->ensure_my_table();
145 151
    // Because attributes are stored serialized, our only option is to also
146 152
    // serialize the data we're searching for and use LIKE to find similar data.
147 153
    $this->query->add_where(0, $this->table_alias . ' . ' . $this->real_field . " LIKE '%%%s%'", serialize(array('target' => $this->argument)));
148 154
  }
155

  
149 156
}

Formats disponibles : Unified diff