@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | //Substyle handling |
61 | - if ( !empty($data['message_array']['substyle']) |
|
61 | + if (!empty($data['message_array']['substyle']) |
|
62 | 62 | && !preg_match('/^builtin:/', $data['message_array']['substyle'])) { |
63 | 63 | debug_add("Appending substyle {$data['message_array']['substyle']}"); |
64 | 64 | midcom::get()->style->append_substyle($data['message_array']['substyle']); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | private function _real_show_compose($handler_id, array &$data) |
118 | 118 | { |
119 | 119 | $prefix = ''; |
120 | - if ( !empty($data['message_array']['substyle']) |
|
120 | + if (!empty($data['message_array']['substyle']) |
|
121 | 121 | && preg_match('/^builtin:(.*)/', $data['message_array']['substyle'], $matches_style)) { |
122 | 122 | $prefix = $matches_style[1] . '-'; |
123 | 123 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $contacts = $importer->parse($input); |
155 | 155 | if (count($contacts) > 0) { |
156 | 156 | $this->_request_data['import_status'] = $importer->import_subscribers($contacts, $this->_request_data['campaign']); |
157 | - if ( $this->_request_data['import_status']['subscribed_new'] > 0 |
|
157 | + if ($this->_request_data['import_status']['subscribed_new'] > 0 |
|
158 | 158 | || $this->_request_data['import_status']['already_subscribed'] > 0) { |
159 | 159 | $this->_import_success = true; |
160 | 160 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | // Update the breadcrumb line |
193 | 193 | $this->_update_breadcrumb($handler_id, $args); |
194 | 194 | |
195 | - if ( array_key_exists('org_openpsa_directmarketing_import', $_POST) |
|
195 | + if (array_key_exists('org_openpsa_directmarketing_import', $_POST) |
|
196 | 196 | && is_uploaded_file($_FILES['org_openpsa_directmarketing_import_upload']['tmp_name'])) { |
197 | 197 | $importer = new org_openpsa_directmarketing_importer_vcards($this->_schemadbs); |
198 | 198 | $this->_run_import($importer, $_FILES['org_openpsa_directmarketing_import_upload']['tmp_name']); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $read_rows = 0; |
247 | 247 | $handle = fopen($_FILES['org_openpsa_directmarketing_import_upload']['tmp_name'], 'r'); |
248 | 248 | $total_columns = 0; |
249 | - while ( $read_rows < 2 |
|
249 | + while ($read_rows < 2 |
|
250 | 250 | && $csv_line = fgetcsv($handle, 1000, $data['separator'])) { |
251 | 251 | if ($total_columns == 0) { |
252 | 252 | $total_columns = count($csv_line); |
@@ -24,7 +24,7 @@ |
||
24 | 24 | if (!$this->timestamp) { |
25 | 25 | $this->timestamp = time(); |
26 | 26 | } |
27 | - if ( !$this->referrer |
|
27 | + if (!$this->referrer |
|
28 | 28 | && !empty($_SERVER['HTTP_REFERER'])) { |
29 | 29 | $this->referrer = $_SERVER['HTTP_REFERER']; |
30 | 30 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | $recipient = $_ENV["RECIPIENT"]; |
47 | 47 | $token_length = strlen($recipient) - strlen($prefix) - strlen($suffix); |
48 | -if ( $token_length <= 0 |
|
48 | +if ($token_length <= 0 |
|
49 | 49 | || substr($recipient, 0, strlen($prefix)) != $prefix |
50 | 50 | || substr($recipient, strlen($prefix) + $token_length) != $suffix) { |
51 | 51 | error_log("Recipient address does not match address template: $recipient"); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | fclose($fh); |
62 | 62 | exit(0); |
63 | 63 | } |
64 | -} elseif ( substr($BOUNCE_LOGGER, 0, strlen("http://")) == "http://" |
|
64 | +} elseif (substr($BOUNCE_LOGGER, 0, strlen("http://")) == "http://" |
|
65 | 65 | || substr($BOUNCE_LOGGER, 0, strlen("https://")) == "https://") { |
66 | 66 | $client = new org_openpsa_httplib(); |
67 | 67 | $client->post($BOUNCE_LOGGER, array("token" => $token)); |
@@ -55,13 +55,13 @@ |
||
55 | 55 | foreach (array_filter($csv_line) as $field => $value) { |
56 | 56 | // Process the row accordingly |
57 | 57 | $field_matching = $this->_settings['fields'][$field]; |
58 | - if ( $field_matching |
|
58 | + if ($field_matching |
|
59 | 59 | && strstr($field_matching, ':')) { |
60 | 60 | $matching_parts = explode(':', $field_matching); |
61 | 61 | $schemadb = $matching_parts[0]; |
62 | 62 | $schema_field = $matching_parts[1]; |
63 | 63 | |
64 | - if ( !array_key_exists($schemadb, $this->_schemadbs) |
|
64 | + if (!array_key_exists($schemadb, $this->_schemadbs) |
|
65 | 65 | || !array_key_exists($schema_field, $this->_schemadbs[$schemadb]['default']->fields)) { |
66 | 66 | // Invalid matching, skip |
67 | 67 | continue; |
@@ -34,7 +34,7 @@ |
||
34 | 34 | echo " <th>{$type}</th>\n"; |
35 | 35 | echo " <td style=\"text-align: right;\">" . number_format($count) . "</td>\n"; |
36 | 36 | if (isset($cleanups_kept[$type])) { |
37 | - echo " <td style=\"text-align: right;\">" . number_format($cleanups_kept[$type]) ."</td>\n"; |
|
37 | + echo " <td style=\"text-align: right;\">" . number_format($cleanups_kept[$type]) . "</td>\n"; |
|
38 | 38 | } |
39 | 39 | echo " </tr>\n"; |
40 | 40 | } |
@@ -103,7 +103,7 @@ |
||
103 | 103 | $this->_person = new midcom_db_person; |
104 | 104 | if (!$this->_person->create()) { |
105 | 105 | debug_print_r('We operated on this object:', $this->_person); |
106 | - throw new midcom_error('Failed to create a new person. Last Midgard error was: '. midcom_connection::get_error_string()); |
|
106 | + throw new midcom_error('Failed to create a new person. Last Midgard error was: ' . midcom_connection::get_error_string()); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | return $this->_person; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | return; |
258 | 258 | } |
259 | 259 | |
260 | - if ( isset($this->_get_params[$name]) |
|
260 | + if (isset($this->_get_params[$name]) |
|
261 | 261 | && $this->_get_params[$name] == $value) { |
262 | 262 | return; |
263 | 263 | } |
@@ -393,8 +393,8 @@ discard block |
||
393 | 393 | $classes = array(); |
394 | 394 | |
395 | 395 | if ($child[MIDCOM_NAV_TYPE] === 'node') { |
396 | - if ( $item[MIDCOM_NAV_ID] === $this->_nap->get_current_node() |
|
397 | - && ( !$this->_nap->get_current_leaf() |
|
396 | + if ($item[MIDCOM_NAV_ID] === $this->_nap->get_current_node() |
|
397 | + && (!$this->_nap->get_current_leaf() |
|
398 | 398 | || !$this->_nap->get_leaf($this->_nap->get_current_leaf()))) { |
399 | 399 | $classes[] = $this->css_active; |
400 | 400 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | } |
442 | 442 | |
443 | 443 | // Add information about the object's status |
444 | - if ( $this->object_status_to_class |
|
444 | + if ($this->object_status_to_class |
|
445 | 445 | && isset($item[MIDCOM_NAV_OBJECT]) |
446 | 446 | && $css_status_class = midcom::get()->metadata->get_object_classes($item[MIDCOM_NAV_OBJECT])) { |
447 | 447 | $classes[] = $css_status_class; |
@@ -462,12 +462,12 @@ discard block |
||
462 | 462 | echo "<a href=\"{$item[MIDCOM_NAV_ABSOLUTEURL]}{$get_params}\"{$link_class}>{$item[MIDCOM_NAV_NAME]}</a>"; |
463 | 463 | // If either of the follow nodes switches is on, follow all the nodes |
464 | 464 | |
465 | - if ( $item[MIDCOM_NAV_TYPE] === 'node' |
|
465 | + if ($item[MIDCOM_NAV_TYPE] === 'node' |
|
466 | 466 | && !$this->show_only_current |
467 | - && ( $this->list_levels === 0 |
|
467 | + && ($this->list_levels === 0 |
|
468 | 468 | || $this->_level < $this->list_levels)) { |
469 | - if ( $this->follow_all |
|
470 | - || ( $this->follow_selected |
|
469 | + if ($this->follow_all |
|
470 | + || ($this->follow_selected |
|
471 | 471 | && in_array($item[MIDCOM_NAV_ID], $this->node_path, true))) { |
472 | 472 | $this->_level++; |
473 | 473 | $this->_list_child_elements($item[MIDCOM_NAV_ID]); |
@@ -48,7 +48,8 @@ |
||
48 | 48 | |
49 | 49 | try { |
50 | 50 | $interface = \midcom::get()->componentloader->get_interface_class($this->component); |
51 | - } catch (\midcom_error $e) { |
|
51 | + } |
|
52 | + catch (\midcom_error $e) { |
|
52 | 53 | debug_add("Failed to load the component {$this->component}: " . $e->getMessage(), MIDCOM_LOG_INFO); |
53 | 54 | return; |
54 | 55 | } |