@@ -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"; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function merge($obj1, $obj2, $merge_mode) |
| 47 | 47 | { |
| 48 | - if ( $merge_mode !== 'all' |
|
| 48 | + if ($merge_mode !== 'all' |
|
| 49 | 49 | && $merge_mode !== 'future') { |
| 50 | 50 | debug_add("invalid mode {$merge_mode}", MIDCOM_LOG_ERROR); |
| 51 | 51 | throw new midcom_error('invalid merge mode'); |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | if (!empty($conf['duplicate_check'])) { |
| 88 | 88 | $dup = $this->check_duplicate($results, $result, $conf['duplicate_check']); |
| 89 | 89 | |
| 90 | - if ( is_object($dup) |
|
| 90 | + if (is_object($dup) |
|
| 91 | 91 | || $dup === false) { |
| 92 | - if ( !is_object($dup) |
|
| 92 | + if (!is_object($dup) |
|
| 93 | 93 | || !array_key_exists($dup->id, $todelete)) { |
| 94 | 94 | $todelete[$result->id] = $result; |
| 95 | 95 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | - if ( $needs_update |
|
| 101 | + if ($needs_update |
|
| 102 | 102 | && !$result->update()) { |
| 103 | 103 | throw new midcom_error("Failed to update {$classname} #{$result->id}, errstr: " . midcom_connection::get_error_string()); |
| 104 | 104 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | foreach ($results as $result) { |
| 150 | - if ( $result->$field === $object->$field |
|
| 150 | + if ($result->$field === $object->$field |
|
| 151 | 151 | && $result->id !== $object->id) { |
| 152 | 152 | return $result; |
| 153 | 153 | } |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $changed = false; |
| 166 | 166 | foreach ($person2 as $property => $value) { |
| 167 | 167 | // Copy only simple properties not marked to be skipped missing from person1 |
| 168 | - if ( empty($person2->$property) |
|
| 168 | + if (empty($person2->$property) |
|
| 169 | 169 | || !empty($person1->$property) |
| 170 | 170 | || isset($skip_properties[$property]) |
| 171 | 171 | || !is_scalar($value)) { |