@@ -54,8 +54,7 @@ discard block |
||
54 | 54 | if (!empty($this->items[$field])) { |
55 | 55 | if ($this->options['type'] == 'separator') { |
56 | 56 | return implode(check_plain($this->options['separator']), $this->items[$field]); |
57 | - } |
|
58 | - else { |
|
57 | + } else { |
|
59 | 58 | return theme('item_list', $this->items[$field], NULL, $this->options['type']); |
60 | 59 | } |
61 | 60 | } |
@@ -71,8 +70,7 @@ discard block |
||
71 | 70 | if (!empty($items)) { |
72 | 71 | if ($this->options['type'] == 'separator') { |
73 | 72 | return implode(check_plain($this->options['separator']), $items); |
74 | - } |
|
75 | - else { |
|
73 | + } else { |
|
76 | 74 | return theme('item_list', $items, NULL, $this->options['type']); |
77 | 75 | } |
78 | 76 | } |
@@ -108,8 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | if (!empty($def['join_handler']) && class_exists($def['join_handler'])) { |
110 | 110 | $join = new $def['join_handler']; |
111 | - } |
|
112 | - else { |
|
111 | + } else { |
|
113 | 112 | $join = new views_join(); |
114 | 113 | } |
115 | 114 | |
@@ -132,8 +131,10 @@ discard block |
||
132 | 131 | return t('Broken/missing handler'); |
133 | 132 | } |
134 | 133 | |
135 | - function ensure_my_table() { /* No table to ensure! */ } |
|
136 | - function query() { /* No query to run */ } |
|
134 | + function ensure_my_table() { |
|
135 | +/* No table to ensure! */ } |
|
136 | + function query() { |
|
137 | +/* No query to run */ } |
|
137 | 138 | function options_form(&$form, &$form_state) { |
138 | 139 | $form['markup'] = array( |
139 | 140 | '#prefix' => '<div class="form-item description">', |
@@ -171,8 +171,7 @@ discard block |
||
171 | 171 | if (empty($this->options['expose']['use_operator']) || empty($this->options['expose']['operator'])) { |
172 | 172 | // exposed and locked. |
173 | 173 | $which = in_array($this->operator, $this->operator_values(1)) ? 'value' : 'none'; |
174 | - } |
|
175 | - else { |
|
174 | + } else { |
|
176 | 175 | $source = 'edit-' . form_clean_id($this->options['expose']['operator']); |
177 | 176 | } |
178 | 177 | } |
@@ -260,8 +259,7 @@ discard block |
||
260 | 259 | |
261 | 260 | if ($this->operator == 'word') { |
262 | 261 | $where = '(' . implode(' OR ', $where) . ')'; |
263 | - } |
|
264 | - else { |
|
262 | + } else { |
|
265 | 263 | $where = implode(' AND ', $where); |
266 | 264 | } |
267 | 265 | // previously this was a call_user_func_array but that's unnecessary |
@@ -292,8 +290,7 @@ discard block |
||
292 | 290 | function op_empty($field) { |
293 | 291 | if ($this->operator == 'empty') { |
294 | 292 | $operator = "IS NULL"; |
295 | - } |
|
296 | - else { |
|
293 | + } else { |
|
297 | 294 | $operator = "IS NOT NULL"; |
298 | 295 | } |
299 | 296 |
@@ -295,8 +295,7 @@ discard block |
||
295 | 295 | if (!empty($defaults[$which])) { |
296 | 296 | return $defaults[$which]; |
297 | 297 | } |
298 | - } |
|
299 | - else { |
|
298 | + } else { |
|
300 | 299 | return $defaults; |
301 | 300 | } |
302 | 301 | } |
@@ -372,8 +371,7 @@ discard block |
||
372 | 371 | |
373 | 372 | if (!empty($info['method args'])) { |
374 | 373 | return call_user_func_array(array(&$this, $info['method']), $info['method args']); |
375 | - } |
|
376 | - else { |
|
374 | + } else { |
|
377 | 375 | return $this->{$info['method']}(); |
378 | 376 | } |
379 | 377 | } |
@@ -515,19 +513,16 @@ discard block |
||
515 | 513 | $join->left_table = $this->table_alias; |
516 | 514 | $this->name_table_alias = $this->query->add_table($this->name_table, $this->relationship, $join); |
517 | 515 | } |
518 | - } |
|
519 | - else { |
|
516 | + } else { |
|
520 | 517 | $this->name_table_alias = $this->query->ensure_table($this->name_table, $this->relationship); |
521 | 518 | } |
522 | - } |
|
523 | - else { |
|
519 | + } else { |
|
524 | 520 | $this->name_table_alias = $this->table_alias; |
525 | 521 | } |
526 | 522 | |
527 | 523 | if (isset($this->name_field)) { |
528 | 524 | $this->name_alias = $this->query->add_field($this->name_table_alias, $this->name_field); |
529 | - } |
|
530 | - else { |
|
525 | + } else { |
|
531 | 526 | $this->name_alias = $this->base_alias; |
532 | 527 | } |
533 | 528 | } |
@@ -617,8 +612,7 @@ discard block |
||
617 | 612 | function get_title() { |
618 | 613 | if (isset($this->validated_title)) { |
619 | 614 | return $this->validated_title; |
620 | - } |
|
621 | - else { |
|
615 | + } else { |
|
622 | 616 | return $this->title(); |
623 | 617 | } |
624 | 618 | } |
@@ -753,8 +747,10 @@ discard block |
||
753 | 747 | return t('Broken/missing handler'); |
754 | 748 | } |
755 | 749 | |
756 | - function ensure_my_table() { /* No table to ensure! */ } |
|
757 | - function query() { /* No query to run */ } |
|
750 | + function ensure_my_table() { |
|
751 | +/* No table to ensure! */ } |
|
752 | + function query() { |
|
753 | +/* No query to run */ } |
|
758 | 754 | function options_form(&$form, &$form_state) { |
759 | 755 | $form['markup'] = array( |
760 | 756 | '#prefix' => '<div class="form-item description">', |
@@ -32,12 +32,10 @@ |
||
32 | 32 | global $db_type; |
33 | 33 | if (isset($this->formula[$db_type])) { |
34 | 34 | $formula = $this->formula[$db_type]; |
35 | - } |
|
36 | - else { |
|
35 | + } else { |
|
37 | 36 | $formula = $this->formula['default']; |
38 | 37 | } |
39 | - } |
|
40 | - else { |
|
38 | + } else { |
|
41 | 39 | $formula = $this->formula; |
42 | 40 | } |
43 | 41 | $this->ensure_my_table(); |
@@ -55,8 +55,7 @@ discard block |
||
55 | 55 | $value = &$form_state['values'][$this->options['expose']['identifier']]; |
56 | 56 | if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator'])) { |
57 | 57 | $operator = $form_state['values'][$this->options['expose']['operator']]; |
58 | - } |
|
59 | - else { |
|
58 | + } else { |
|
60 | 59 | $operator = $this->operator; |
61 | 60 | } |
62 | 61 | |
@@ -75,8 +74,7 @@ discard block |
||
75 | 74 | if (!empty($form['value']) && ($convert == -1 || $convert === FALSE)) { |
76 | 75 | form_error($form['value'], t('Invalid date format.')); |
77 | 76 | } |
78 | - } |
|
79 | - elseif ($operators[$operator]['values'] == 2) { |
|
77 | + } elseif ($operators[$operator]['values'] == 2) { |
|
80 | 78 | $min = strtotime($value['min']); |
81 | 79 | if ($min == -1 || $min === FALSE) { |
82 | 80 | form_error($form['min'], t('Invalid date format.')); |
@@ -101,8 +99,7 @@ discard block |
||
101 | 99 | $operators = $this->operators(); |
102 | 100 | if (!empty($this->options['expose']['use_operator']) && !empty($this->options['expose']['operator'])) { |
103 | 101 | $operator = $input[$this->options['expose']['operator']]; |
104 | - } |
|
105 | - else { |
|
102 | + } else { |
|
106 | 103 | $operator = $this->operator; |
107 | 104 | } |
108 | 105 | |
@@ -110,8 +107,7 @@ discard block |
||
110 | 107 | if ($this->value['value'] == '') { |
111 | 108 | return FALSE; |
112 | 109 | } |
113 | - } |
|
114 | - else { |
|
110 | + } else { |
|
115 | 111 | if ($this->value['min'] == '' || $this->value['max'] == '') { |
116 | 112 | return FALSE; |
117 | 113 | } |
@@ -126,8 +122,7 @@ discard block |
||
126 | 122 | if ($this->operator == 'between') { |
127 | 123 | $a = intval(strtotime($this->value['min'], 0)); |
128 | 124 | $b = intval(strtotime($this->value['max'], 0)); |
129 | - } |
|
130 | - else { |
|
125 | + } else { |
|
131 | 126 | $a = intval(strtotime($this->value['max'], 0)); |
132 | 127 | $b = intval(strtotime($this->value['min'], 0)); |
133 | 128 | } |
@@ -141,8 +136,7 @@ discard block |
||
141 | 136 | if ($this->operator == 'between') { |
142 | 137 | $this->query->add_where($this->options['group'], "$field >= %s", $a); |
143 | 138 | $this->query->add_where($this->options['group'], "$field <= %s", $b); |
144 | - } |
|
145 | - else { |
|
139 | + } else { |
|
146 | 140 | $this->query->add_where($this->options['group'], "$field >= %s OR $field <= %s", array($a, $b)); |
147 | 141 | } |
148 | 142 | } |
@@ -50,8 +50,7 @@ |
||
50 | 50 | // does not allow the value to be passed in, it is copied. |
51 | 51 | if (!empty($this->options['set_precision'])) { |
52 | 52 | $value = number_format($value, $this->options['precision'], $this->options['decimal'], $this->options['separator']); |
53 | - } |
|
54 | - else { |
|
53 | + } else { |
|
55 | 54 | $remainder = abs($value) - intval(abs($value)); |
56 | 55 | $value = $value > 0 ? floor($value) : ceil($value); |
57 | 56 | $value = number_format($value, 0, '', $this->options['separator']); |
@@ -30,8 +30,7 @@ |
||
30 | 30 | $value = $values->{$this->field_alias}; |
31 | 31 | if (!empty($this->options['display_as_link'])) { |
32 | 32 | return l(check_plain($value), $value, array('html' => TRUE)); |
33 | - } |
|
34 | - else { |
|
33 | + } else { |
|
35 | 34 | return check_url($value); |
36 | 35 | } |
37 | 36 | } |
@@ -79,8 +79,7 @@ discard block |
||
79 | 79 | if (empty($this->argument)) { |
80 | 80 | $empty = TRUE; |
81 | 81 | } |
82 | - } |
|
83 | - else { |
|
82 | + } else { |
|
84 | 83 | if (!isset($this->argument)) { |
85 | 84 | $empty = TRUE; |
86 | 85 | } |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | |
94 | 93 | if (!empty($this->options['break_phrase'])) { |
95 | 94 | views_break_phrase($this->argument, $this); |
96 | - } |
|
97 | - else { |
|
95 | + } else { |
|
98 | 96 | $this->value = array($this->argument); |
99 | 97 | $this->operator = 'or'; |
100 | 98 | } |
@@ -109,8 +107,7 @@ discard block |
||
109 | 107 | |
110 | 108 | if (!empty($this->options['break_phrase'])) { |
111 | 109 | views_break_phrase($this->argument, $this); |
112 | - } |
|
113 | - else { |
|
110 | + } else { |
|
114 | 111 | $this->value = array($this->argument); |
115 | 112 | $this->operator = 'or'; |
116 | 113 | } |
@@ -138,8 +135,7 @@ discard block |
||
138 | 135 | |
139 | 136 | if (empty($this->options['add_table']) || empty($this->view->many_to_one_tables[$field])) { |
140 | 137 | $this->table_alias = $this->query->ensure_table($this->table, $this->relationship, $join); |
141 | - } |
|
142 | - else { |
|
138 | + } else { |
|
143 | 139 | $this->table_alias = $this->helper->summary_join(); |
144 | 140 | } |
145 | 141 |