@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function read_login_data(Request $request) : ?array |
| 42 | 42 | { |
| 43 | - if ( !$request->request->has('midcom_services_auth_frontend_form_submit') |
|
| 43 | + if (!$request->request->has('midcom_services_auth_frontend_form_submit') |
|
| 44 | 44 | || !$request->request->has('username') |
| 45 | 45 | || !$request->request->has('password')) { |
| 46 | 46 | return null; |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | { |
| 77 | 77 | // Store the submitted form if the session expired, but user wants to save the data |
| 78 | 78 | if (!empty($_POST)) { |
| 79 | - $data =& midcom_core_context::get()->get_custom_key('request_data'); |
|
| 79 | + $data = & midcom_core_context::get()->get_custom_key('request_data'); |
|
| 80 | 80 | |
| 81 | 81 | $data['restored_form_data'] = []; |
| 82 | 82 | |
@@ -361,11 +361,11 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | $item = array_replace($defaults, $item); |
| 363 | 363 | |
| 364 | - if ( !empty($item[MIDCOM_TOOLBAR_ACCESSKEY]) |
|
| 364 | + if (!empty($item[MIDCOM_TOOLBAR_ACCESSKEY]) |
|
| 365 | 365 | && !array_key_exists($item[MIDCOM_TOOLBAR_ACCESSKEY], $used_access_keys)) { |
| 366 | 366 | // We have valid access key, add it to help text |
| 367 | 367 | $prefix = 'Alt-'; |
| 368 | - if ( isset($_SERVER['HTTP_USER_AGENT']) |
|
| 368 | + if (isset($_SERVER['HTTP_USER_AGENT']) |
|
| 369 | 369 | && strstr($_SERVER['HTTP_USER_AGENT'], 'Macintosh')) { |
| 370 | 370 | // Mac users |
| 371 | 371 | $prefix = 'Ctrl-Alt-'; |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | private function set_url(array &$item, string $url) |
| 388 | 388 | { |
| 389 | 389 | $item[MIDCOM_TOOLBAR__ORIGINAL_URL] = $url; |
| 390 | - if ( ( empty($item[MIDCOM_TOOLBAR_OPTIONS]["rel"]) |
|
| 390 | + if ((empty($item[MIDCOM_TOOLBAR_OPTIONS]["rel"]) |
|
| 391 | 391 | // Some items may want to keep their links unmutilated |
| 392 | 392 | || $item[MIDCOM_TOOLBAR_OPTIONS]["rel"] != "directlink") |
| 393 | 393 | && !str_starts_with($url, '/') |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | |
| 413 | 413 | if ($index == 0) { |
| 414 | 414 | array_shift($this->items); |
| 415 | - } elseif ($index == count($this->items) -1) { |
|
| 415 | + } elseif ($index == count($this->items) - 1) { |
|
| 416 | 416 | array_pop($this->items); |
| 417 | 417 | } else { |
| 418 | 418 | $this->items = array_merge(array_slice($this->items, 0, $index - 1), |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | */ |
| 537 | 537 | public function render() : string |
| 538 | 538 | { |
| 539 | - $visible_items = array_filter($this->items, function ($item) { |
|
| 539 | + $visible_items = array_filter($this->items, function($item) { |
|
| 540 | 540 | return !$item[MIDCOM_TOOLBAR_HIDDEN]; |
| 541 | 541 | }); |
| 542 | 542 | $this->rendered = true; |
@@ -601,7 +601,7 @@ discard block |
||
| 601 | 601 | // Try finding uppercase version of the accesskey first |
| 602 | 602 | $accesskey = strtoupper($item[MIDCOM_TOOLBAR_ACCESSKEY]); |
| 603 | 603 | $position = strpos($label, $accesskey); |
| 604 | - if ( $position === false |
|
| 604 | + if ($position === false |
|
| 605 | 605 | && midcom::get()->i18n->get_current_language() == 'en') { |
| 606 | 606 | // Try lowercase, too |
| 607 | 607 | $accesskey = strtolower($accesskey); |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | $attributes['title'] = $item[MIDCOM_TOOLBAR_HELPTEXT]; |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | - if ( $item[MIDCOM_TOOLBAR_ENABLED] |
|
| 667 | + if ($item[MIDCOM_TOOLBAR_ENABLED] |
|
| 668 | 668 | && $item[MIDCOM_TOOLBAR_ACCESSKEY] !== null) { |
| 669 | 669 | $attributes['class'] = 'accesskey'; |
| 670 | 670 | $attributes['accesskey'] = $item[MIDCOM_TOOLBAR_ACCESSKEY]; |
@@ -731,7 +731,7 @@ discard block |
||
| 731 | 731 | public function get_index_from_url($url) : ?int |
| 732 | 732 | { |
| 733 | 733 | foreach ($this->items as $i => $item) { |
| 734 | - if ( $item[MIDCOM_TOOLBAR_URL] == $url |
|
| 734 | + if ($item[MIDCOM_TOOLBAR_URL] == $url |
|
| 735 | 735 | || $item[MIDCOM_TOOLBAR__ORIGINAL_URL] == $url) { |
| 736 | 736 | return $i; |
| 737 | 737 | } |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | * |
| 750 | 750 | * @param mixed $index The integer index or URL to check |
| 751 | 751 | */ |
| 752 | - protected function _check_index($index, bool $raise_error = true) :?int |
|
| 752 | + protected function _check_index($index, bool $raise_error = true) : ?int |
|
| 753 | 753 | { |
| 754 | 754 | if (is_string($index)) { |
| 755 | 755 | $url = $index; |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) : ?string |
| 46 | 46 | { |
| 47 | - if ( $object instanceof midcom_db_article |
|
| 47 | + if ($object instanceof midcom_db_article |
|
| 48 | 48 | && $topic->id == $object->topic) { |
| 49 | 49 | if ($object->name == 'index') { |
| 50 | 50 | return ''; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | public function get_parent_guid_uncached() : ?string |
| 95 | 95 | { |
| 96 | - if ( $this->up |
|
| 96 | + if ($this->up |
|
| 97 | 97 | || $this->title != '__org_openpsa_calendar') { |
| 98 | 98 | $root_event = org_openpsa_calendar_interface::find_root_event(); |
| 99 | 99 | if ($this->id != $root_event->id) { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | //Check up |
| 156 | - if ( !$this->up |
|
| 156 | + if (!$this->up |
|
| 157 | 157 | && $this->title != '__org_openpsa_calendar') { |
| 158 | 158 | $root_event = org_openpsa_calendar_interface::find_root_event(); |
| 159 | 159 | $this->up = $root_event->id; |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | |
| 179 | 179 | private function _check_timerange() : bool |
| 180 | 180 | { |
| 181 | - if ( !$this->start |
|
| 181 | + if (!$this->start |
|
| 182 | 182 | || !$this->end) { |
| 183 | 183 | debug_add('Event must have start and end timestamps'); |
| 184 | 184 | midcom_connection::set_error(MGD_ERR_RANGE); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | |
| 41 | 41 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) : ?string |
| 42 | 42 | { |
| 43 | - if ( $object instanceof org_openpsa_documents_document_dba |
|
| 43 | + if ($object instanceof org_openpsa_documents_document_dba |
|
| 44 | 44 | && $object->topic == $topic->id) { |
| 45 | 45 | return "document/{$object->guid}/"; |
| 46 | 46 | } |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | public function resolve_object_link(midcom_db_topic $topic, midcom_core_dbaobject $object) : ?string |
| 79 | 79 | { |
| 80 | - if ( $object instanceof org_openpsa_contacts_group_dba |
|
| 80 | + if ($object instanceof org_openpsa_contacts_group_dba |
|
| 81 | 81 | || $object instanceof midcom_db_group) { |
| 82 | 82 | return "group/{$object->guid}/"; |
| 83 | 83 | } |
| 84 | - if ( $object instanceof org_openpsa_contacts_person_dba |
|
| 84 | + if ($object instanceof org_openpsa_contacts_person_dba |
|
| 85 | 85 | || $object instanceof midcom_db_person) { |
| 86 | 86 | return "person/{$object->guid}/"; |
| 87 | 87 | } |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | // We have a feed URL, but we should check if it is GeoRSS as well |
| 111 | 111 | $items = net_nemein_rss_fetch::raw_fetch($data['rss_url'])->get_items(); |
| 112 | 112 | |
| 113 | - if ( !empty($items) |
|
| 114 | - && ( $items[0]->get_latitude() |
|
| 113 | + if (!empty($items) |
|
| 114 | + && ($items[0]->get_latitude() |
|
| 115 | 115 | || $items[0]->get_longitude())) { |
| 116 | 116 | // This is a GeoRSS feed |
| 117 | 117 | $data['georss_url'] = $data['rss_url']; |