@@ -170,11 +170,11 @@ |
||
170 | 170 | */ |
171 | 171 | public function validate_number($fields) |
172 | 172 | { |
173 | - if ( $this->minimum !== null |
|
173 | + if ($this->minimum !== null |
|
174 | 174 | && $fields[$this->name] < $this->minimum) { |
175 | 175 | return array($this->name => sprintf($this->_l10n->get('type number: value must not be smaller than %s'), $this->minimum)); |
176 | 176 | } |
177 | - if ( $this->maximum !== null |
|
177 | + if ($this->maximum !== null |
|
178 | 178 | && $fields[$this->name] > $this->maximum) { |
179 | 179 | return array($this->name => sprintf($this->_l10n->get('type number: value must not be larger than %s'), $this->maximum)); |
180 | 180 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | return true; |
77 | 77 | } |
78 | 78 | |
79 | - if ( !isset($this->_datamanager->types[$this->later_than]) |
|
79 | + if (!isset($this->_datamanager->types[$this->later_than]) |
|
80 | 80 | || !is_a($this->_datamanager->types[$this->later_than], 'midcom_helper_datamanager2_type_date') |
81 | 81 | || !$this->_datamanager->types[$this->later_than]->value) { |
82 | 82 | debug_add("Failed to validate date field {$this->name} with {$this->later_than}, as such date field wasn't found.", |
@@ -196,10 +196,10 @@ discard block |
||
196 | 196 | { |
197 | 197 | // FIXME: This is not exactly an elegant way to do this |
198 | 198 | $widget_conf = $this->storage->_schema->fields[$this->name]['widget_config']; |
199 | - if ( $this->storage_type != 'ISO_DATE' |
|
200 | - && ( !array_key_exists('show_time', $widget_conf) |
|
199 | + if ($this->storage_type != 'ISO_DATE' |
|
200 | + && (!array_key_exists('show_time', $widget_conf) |
|
201 | 201 | || $widget_conf['show_time'])) { |
202 | - if ( array_key_exists('hide_seconds', $widget_conf) |
|
202 | + if (array_key_exists('hide_seconds', $widget_conf) |
|
203 | 203 | && !$widget_conf['hide_seconds']) { |
204 | 204 | return 'medium'; |
205 | 205 | } |
@@ -230,13 +230,13 @@ discard block |
||
230 | 230 | } |
231 | 231 | |
232 | 232 | //sometimes the date-compare function seems to corrupt the date, by changing timezone maybe |
233 | - if ( !empty($this->min_date) |
|
233 | + if (!empty($this->min_date) |
|
234 | 234 | && $this->value < new DateTime($this->min_date)) { |
235 | 235 | $min_date = new DateTime($this->min_date); |
236 | 236 | $this->validation_error = sprintf($this->_l10n->get('type date: this date must be %s or later'), htmlspecialchars($this->_l10n->get_formatter()->date($min_date))); |
237 | 237 | return false; |
238 | 238 | } |
239 | - if ( !empty($this->max_date) |
|
239 | + if (!empty($this->max_date) |
|
240 | 240 | && $this->value > new DateTime($this->max_date)) { |
241 | 241 | $max_date = new DateTime($this->max_date); |
242 | 242 | $this->validation_error = sprintf($this->_l10n->get('type date: this date must be %s or earlier'), htmlspecialchars($this->_l10n->get_formatter()->date($max_date))); |
@@ -25,7 +25,7 @@ |
||
25 | 25 | */ |
26 | 26 | protected function _prepare_recreate($force = true) |
27 | 27 | { |
28 | - if ( !empty($this->_original_tmpname) |
|
28 | + if (!empty($this->_original_tmpname) |
|
29 | 29 | && !$force) { |
30 | 30 | // We have prepared. |
31 | 31 | return true; |
@@ -87,7 +87,7 @@ |
||
87 | 87 | */ |
88 | 88 | public function _on_validate() |
89 | 89 | { |
90 | - if ( is_array($this->value) |
|
90 | + if (is_array($this->value) |
|
91 | 91 | || is_object($this->value)) { |
92 | 92 | $this->validation_error = $this->_l10n->get('type text: value may not be array or object'); |
93 | 93 | return false; |
@@ -66,7 +66,7 @@ |
||
66 | 66 | */ |
67 | 67 | public function _on_initialize() |
68 | 68 | { |
69 | - if ( !$this->name |
|
69 | + if (!$this->name |
|
70 | 70 | || !$this->assignee) { |
71 | 71 | throw new midcom_error("The field {$this->name} had no name or assignee specified with it, cannot start up."); |
72 | 72 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | private function _update_cache() |
145 | 145 | { |
146 | 146 | $this->_merged = $this->_global; |
147 | - if ( !empty($this->_local) |
|
147 | + if (!empty($this->_local) |
|
148 | 148 | && is_array($this->_local)) { |
149 | 149 | $this->_merged = array_merge($this->_merged, $this->_local); |
150 | 150 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function store(array $params, $reset = true) |
188 | 188 | { |
189 | - if ( !$this->_object_stored |
|
189 | + if (!$this->_object_stored |
|
190 | 190 | && $this->_object) { |
191 | 191 | $this->_store_from_object(); |
192 | 192 | } |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | */ |
247 | 247 | public function get($key) |
248 | 248 | { |
249 | - if ( !$this->_object_stored |
|
249 | + if (!$this->_object_stored |
|
250 | 250 | && $this->_object) { |
251 | 251 | $this->_store_from_object(); |
252 | 252 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function get_all() |
280 | 280 | { |
281 | - if ( !$this->_object_stored |
|
281 | + if (!$this->_object_stored |
|
282 | 282 | && $this->_object) { |
283 | 283 | $this->_store_from_object(); |
284 | 284 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function exists($key) |
296 | 296 | { |
297 | - if ( !$this->_object_stored |
|
297 | + if (!$this->_object_stored |
|
298 | 298 | && $this->_object) { |
299 | 299 | $this->_store_from_object(); |
300 | 300 | } |
@@ -69,7 +69,8 @@ |
||
69 | 69 | // Use the DB Factory to resolve the class and to get the object |
70 | 70 | try { |
71 | 71 | $object = midcom::get()->dbfactory->get_object_by_guid($identifier); |
72 | - } catch (midcom_error $e) { |
|
72 | + } |
|
73 | + catch (midcom_error $e) { |
|
73 | 74 | // This is probably a pseudo leaf, store the score to the current node |
74 | 75 | $this->_topic->set_parameter('midcom.helper.nav.score', $identifier, $score); |
75 | 76 | return true; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | // Approve if possible |
92 | - if ( $approval_status |
|
92 | + if ($approval_status |
|
93 | 93 | && $object->can_do('midcom:approve')) { |
94 | 94 | $object->metadata->approve(); |
95 | 95 | } |
@@ -135,10 +135,10 @@ discard block |
||
135 | 135 | // jQuery sorting |
136 | 136 | midcom::get()->head->enable_jquery_ui(array('mouse', 'sortable')); |
137 | 137 | |
138 | - midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL.'/midcom.admin.folder/jquery-postfix.js'); |
|
138 | + midcom::get()->head->add_jsfile(MIDCOM_STATIC_URL . '/midcom.admin.folder/jquery-postfix.js'); |
|
139 | 139 | |
140 | 140 | // Custom styles |
141 | - $this->add_stylesheet(MIDCOM_STATIC_URL.'/midcom.admin.folder/midcom-admin-order.css'); |
|
141 | + $this->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.admin.folder/midcom-admin-order.css'); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function _handler_approval($handler_id, array $args, array &$data) |
25 | 25 | { |
26 | - if ( !array_key_exists('guid', $_REQUEST) |
|
26 | + if (!array_key_exists('guid', $_REQUEST) |
|
27 | 27 | || !array_key_exists('return_to', $_REQUEST)) { |
28 | 28 | throw new midcom_error('Cannot process approval request, request is incomplete.'); |
29 | 29 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $select_attributes['class'] .= ' selectcomponent'; |
46 | 46 | |
47 | 47 | $select_element = $this->_form->createElement('select', $this->name, $this->_translate($this->_field['title']), |
48 | - array(), $select_attributes); |
|
48 | + array(), $select_attributes); |
|
49 | 49 | |
50 | 50 | // Translate and add |
51 | 51 | foreach ($this->_all_elements as $key => $value) { |