@@ -191,7 +191,7 @@ |
||
191 | 191 | $this->html_body = preg_replace("/\n\r|\r\n|\r/", "\n", $this->html_body); |
192 | 192 | |
193 | 193 | //Try to translate HTML-only body to plaintext as well |
194 | - if ( strlen($this->body) == 0 |
|
194 | + if (strlen($this->body) == 0 |
|
195 | 195 | && strlen($this->html_body) > 0 |
196 | 196 | && !$this->allow_only_html) { |
197 | 197 | $this->body = $this->html2text($this->html_body); |
@@ -102,7 +102,7 @@ |
||
102 | 102 | if (is_string($value)) { |
103 | 103 | $this->_headers[$header] = trim($value); |
104 | 104 | } |
105 | - if ( strtolower($header) == 'from' |
|
105 | + if (strtolower($header) == 'from' |
|
106 | 106 | || strtolower($header) == 'reply-to' |
107 | 107 | || strtolower($header) == 'to') { |
108 | 108 | $this->_headers[$header] = $this->_encode_address_field($value); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $images = $qb->execute(); |
64 | 64 | $failed = 0; |
65 | 65 | foreach ($images as $image) { |
66 | - if ( !$image->generate_image('thumbnail', $this->_config->get('thumbnail_filter')) |
|
66 | + if (!$image->generate_image('thumbnail', $this->_config->get('thumbnail_filter')) |
|
67 | 67 | || !$image->generate_image('image', $this->_config->get('image_filter'))) { |
68 | 68 | $failed++; |
69 | 69 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | //Fall-through |
246 | 246 | case 'create': |
247 | - if ( !isset($_POST['title']) |
|
247 | + if (!isset($_POST['title']) |
|
248 | 248 | || !isset($_POST['description']) |
249 | 249 | || !isset($_POST['position'])) { |
250 | 250 | throw new midcom_error('Invalid request'); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $attachment->title = $_POST['title']; |
268 | 268 | $attachment->mimetype = $file['type']; |
269 | 269 | $attachment->parentguid = $image->guid; |
270 | - if ( !$attachment->create() |
|
270 | + if (!$attachment->create() |
|
271 | 271 | || !$attachment->copy_from_file($file['tmp_name'])) { |
272 | 272 | throw new midcom_error('Failed to create attachment: ' . midcom_connection::get_error_string()); |
273 | 273 | } |
@@ -150,7 +150,7 @@ |
||
150 | 150 | $rows = $mc->get_rows(array('id', 'name', 'guid'), 'id'); |
151 | 151 | |
152 | 152 | foreach ($images as $image) { |
153 | - if ( !isset($rows[$image->attachment]) |
|
153 | + if (!isset($rows[$image->attachment]) |
|
154 | 154 | || !isset($rows[$image->image]) |
155 | 155 | || !isset($rows[$image->thumbnail])) { |
156 | 156 | continue; |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | { |
16 | 16 | public function write_acls(midcom_core_dbaobject $object, $owner_id, $accesstype) |
17 | 17 | { |
18 | - if ( empty($owner_id) |
|
18 | + if (empty($owner_id) |
|
19 | 19 | || empty($accesstype)) { |
20 | 20 | return false; |
21 | 21 | } |
@@ -63,14 +63,14 @@ discard block |
||
63 | 63 | |
64 | 64 | if ($privileges) { |
65 | 65 | foreach ($privileges as $privilege) { |
66 | - if ( !empty($needed_privileges[$privilege->privilegename]) |
|
66 | + if (!empty($needed_privileges[$privilege->privilegename]) |
|
67 | 67 | && $needed_privileges[$privilege->privilegename]['assignee'] == $privilege->assignee |
68 | 68 | && $needed_privileges[$privilege->privilegename]['value'] == $privilege->value) { |
69 | 69 | unset($needed_privileges[$privilege->privilegename]); |
70 | 70 | continue; |
71 | 71 | } |
72 | 72 | // Clear old ACLs applying to others than current user or selected owner group |
73 | - if ( $privilege->assignee != midcom::get()->auth->user->id |
|
73 | + if ($privilege->assignee != midcom::get()->auth->user->id |
|
74 | 74 | && $privilege->assignee != $owner_id) { |
75 | 75 | if (is_array($privilege->assignee)) { |
76 | 76 | $assignee_key = $privilege->assignee['identifier']; |
@@ -77,7 +77,7 @@ |
||
77 | 77 | echo '<select class="filter_input" onchange="document.forms[\'' . $this->name . '_filter\'].submit();" name="' . $this->name . '">'; |
78 | 78 | |
79 | 79 | foreach ($options as $option) { |
80 | - echo '<option value="' . $option['id'] . '"'; |
|
80 | + echo '<option value="' . $option['id'] . '"'; |
|
81 | 81 | if ($option['selected'] == true) { |
82 | 82 | echo " selected=\"selected\""; |
83 | 83 | } |
@@ -77,9 +77,9 @@ |
||
77 | 77 | $filter_id = $this->_identifier . '_' . $filtername; |
78 | 78 | $user = midcom::get()->auth->user->get_storage(); |
79 | 79 | |
80 | - if ( isset($_POST['unset_filter']) |
|
80 | + if (isset($_POST['unset_filter']) |
|
81 | 81 | && $_POST['unset_filter'] == $filter_id) { |
82 | - if ( $user->get_parameter("org_openpsa_core_filter", $filter_id) |
|
82 | + if ($user->get_parameter("org_openpsa_core_filter", $filter_id) |
|
83 | 83 | && !$user->delete_parameter("org_openpsa_core_filter", $filter_id)) { |
84 | 84 | $message_content = sprintf( |
85 | 85 | $l10n->get('the handed filter for %s could not be set as parameter'), |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | private function _convert_to_localdata() |
234 | 234 | { |
235 | - return "var " . $this->_grid->get_identifier() . '_entries = ' . json_encode($this->get_rows()) . ";\n"; |
|
235 | + return "var " . $this->_grid->get_identifier() . '_entries = ' . json_encode($this->get_rows()) . ";\n"; |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | private function _render_json() |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $this->_sort_field = $query['sidx']; |
267 | 267 | $this->_sort_direction = strtoupper($query['sord']); |
268 | 268 | } |
269 | - if ( !empty($query['_search']) |
|
269 | + if (!empty($query['_search']) |
|
270 | 270 | && $query['_search'] === 'true') { |
271 | 271 | foreach ($query as $field => $value) { |
272 | 272 | if (in_array($field, array('_search', 'nd', 'page', 'rows', 'sidx', 'sord'))) { |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | $this->_total_rows = $qb->count(); |
293 | 293 | |
294 | - if ( $this->_datatype == 'json' |
|
294 | + if ($this->_datatype == 'json' |
|
295 | 295 | && !empty($this->_results_per_page)) { |
296 | 296 | $qb->set_limit($this->_results_per_page); |
297 | 297 | if (!empty($this->_offset)) { |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | $config = array_merge($defaults, $config); |
38 | 38 | |
39 | 39 | $node_url = $siteconfig->get_node_full_url($component); |
40 | - if ( $node_url |
|
41 | - && ( !$user_id |
|
40 | + if ($node_url |
|
41 | + && (!$user_id |
|
42 | 42 | || midcom::get()->auth->acl->can_do_byguid('midgard:read', $siteconfig->get_node_guid($component), 'midcom_db_topic', $user_id))) { |
43 | 43 | $providers[] = array( |
44 | 44 | 'placeholder' => midcom::get()->i18n->get_string('search title', $component), |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | echo '<div id="tabs">'; |
115 | 115 | echo "\n<ul>\n"; |
116 | 116 | foreach ($tabdata as $key => $tab) { |
117 | - echo "<li><a id='key_" . $key ."' class='tabs_link' href='" . $prefix . $tab['url'] . "' ><span> " . $tab['title'] . "</span></a></li>"; |
|
117 | + echo "<li><a id='key_" . $key . "' class='tabs_link' href='" . $prefix . $tab['url'] . "' ><span> " . $tab['title'] . "</span></a></li>"; |
|
118 | 118 | } |
119 | 119 | echo "\n</ul>\n"; |
120 | 120 | echo "</div>\n"; |