@@ -82,7 +82,7 @@ |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // OPML subscription list import support |
| 85 | - if ( array_key_exists('net_nemein_rss_manage_opml', $_FILES) |
|
| 85 | + if (array_key_exists('net_nemein_rss_manage_opml', $_FILES) |
|
| 86 | 86 | && is_uploaded_file($_FILES['net_nemein_rss_manage_opml']['tmp_name'])) { |
| 87 | 87 | $opml_file = $_FILES['net_nemein_rss_manage_opml']['tmp_name']; |
| 88 | 88 | |
@@ -210,8 +210,7 @@ |
||
| 210 | 210 | { |
| 211 | 211 | $ret = []; |
| 212 | 212 | |
| 213 | - foreach ($this->storage as $field => $value) |
|
| 214 | - { |
|
| 213 | + foreach ($this->storage as $field => $value) { |
|
| 215 | 214 | $ret[$field] = $value->get_value(); |
| 216 | 215 | $config = $this->schema->get_field($field); |
| 217 | 216 | if (!empty($config['type_config']['allow_multiple'])) { |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | public function set_storage(midcom_core_dbaobject $storage = null, string $schemaname = null) : self |
| 75 | 75 | { |
| 76 | - if ( $schemaname === null |
|
| 76 | + if ($schemaname === null |
|
| 77 | 77 | && !empty($storage->id)) { |
| 78 | 78 | $schemaname = $storage->get_parameter('midcom.helper.datamanager2', 'schema_name'); |
| 79 | 79 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | $name = $this->get_name($name); |
| 166 | 166 | |
| 167 | - if ( $this->form === null |
|
| 167 | + if ($this->form === null |
|
| 168 | 168 | || $this->form->getName() != $name) { |
| 169 | 169 | $this->build_form($this->get_builder($name)); |
| 170 | 170 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | { |
| 262 | 262 | $ret = true; |
| 263 | 263 | foreach ($this->storage as $field) { |
| 264 | - if ( $field instanceof recreateable |
|
| 264 | + if ($field instanceof recreateable |
|
| 265 | 265 | && !$field->recreate()) { |
| 266 | 266 | $ret = false; |
| 267 | 267 | } |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | |
| 73 | 73 | $this->_group = new org_openpsa_contacts_group_dba(); |
| 74 | 74 | |
| 75 | - if ( $this->_type == 'organization' |
|
| 75 | + if ($this->_type == 'organization' |
|
| 76 | 76 | && $this->_parent_group) { |
| 77 | 77 | $this->_group->owner = $this->_parent_group->id; |
| 78 | 78 | } else { |
@@ -50,6 +50,6 @@ |
||
| 50 | 50 | $indexer = new org_openpsa_documents_midcom_indexer($this->_topic); |
| 51 | 51 | $indexer->index($controller->get_datamanager()); |
| 52 | 52 | |
| 53 | - return $controller->get_datamanager()->get_storage()->get_value()->name. "/"; |
|
| 53 | + return $controller->get_datamanager()->get_storage()->get_value()->name . "/"; |
|
| 54 | 54 | } |
| 55 | 55 | } |
@@ -30,7 +30,8 @@ |
||
| 30 | 30 | $this->config = $config; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - protected function cast($value) { |
|
| 33 | + protected function cast($value) |
|
| 34 | + { |
|
| 34 | 35 | if ($this->config['type'] == 'number' && !is_numeric($value)) { |
| 35 | 36 | $value = (float) $value; |
| 36 | 37 | } |
@@ -30,7 +30,8 @@ |
||
| 30 | 30 | foreach ($result as $wikipage) { |
| 31 | 31 | try { |
| 32 | 32 | $datamanager->set_storage($wikipage); |
| 33 | - } catch (midcom_error $e) { |
|
| 33 | + } |
|
| 34 | + catch (midcom_error $e) { |
|
| 34 | 35 | $e->log(MIDCOM_LOG_WARN); |
| 35 | 36 | continue; |
| 36 | 37 | } |
@@ -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 ''; |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | // Get the calendar root event |
| 24 | 24 | if ($root_event = org_openpsa_calendar_interface::find_root_event()) { |
| 25 | - $field =& $schemadb->get('default')->get_field('calendar'); |
|
| 25 | + $field = & $schemadb->get('default')->get_field('calendar'); |
|
| 26 | 26 | $field['type_config']['privilege_object'] = $root_event; |
| 27 | 27 | $field['type_config']['assignee'] = 'group:' . $group->guid; |
| 28 | 28 | } |
@@ -409,7 +409,8 @@ |
||
| 409 | 409 | foreach ($this->_articles as $article_counter => $article) { |
| 410 | 410 | try { |
| 411 | 411 | $data['datamanager']->set_storage($article); |
| 412 | - } catch (midcom_error $e) { |
|
| 412 | + } |
|
| 413 | + catch (midcom_error $e) { |
|
| 413 | 414 | $e->log(); |
| 414 | 415 | continue; |
| 415 | 416 | } |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | $year_data = []; |
| 132 | 132 | $first_post = $this->_compute_welcome_first_post(); |
| 133 | 133 | $this->_request_data['first_post'] = $first_post; |
| 134 | - $this->_request_data['total_count'] =& $total_count; |
|
| 135 | - $this->_request_data['year_data'] =& $year_data; |
|
| 134 | + $this->_request_data['total_count'] = & $total_count; |
|
| 135 | + $this->_request_data['year_data'] = & $year_data; |
|
| 136 | 136 | if (!$first_post) { |
| 137 | 137 | return; |
| 138 | 138 | } |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | switch ($handler_id) { |
| 262 | 262 | case 'archive-year-category': |
| 263 | 263 | $category = trim(strip_tags($args[1])); |
| 264 | - if ( $data['datamanager']->get_schema('default')->has_field('categories') |
|
| 264 | + if ($data['datamanager']->get_schema('default')->has_field('categories') |
|
| 265 | 265 | && !$data['datamanager']->get_schema('default')->get_field('categories')['type_config']['allow_multiple']) { |
| 266 | 266 | $qb->add_constraint('extra1', '=', $category); |
| 267 | 267 | } else { |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | throw new midcom_error_notfound("The year '{$year}' is not valid."); |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | - if ( $month < 1 |
|
| 348 | + if ($month < 1 |
|
| 349 | 349 | || $month > 12) { |
| 350 | 350 | throw new midcom_error_notfound("The month {$month} is not valid."); |
| 351 | 351 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | ]); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if ( $this->_article->topic === $this->_topic->id |
|
| 49 | + if ($this->_article->topic === $this->_topic->id |
|
| 50 | 50 | && $this->_article->can_do('midgard:delete')) { |
| 51 | 51 | $delete = $this->get_workflow('delete', ['object' => $this->_article]); |
| 52 | 52 | $buttons[] = $delete->get_button("delete/{$this->_article->guid}/"); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $this->_datamanager->set_storage($this->_article); |
| 115 | 115 | |
| 116 | 116 | $arg = $this->_article->name ?: $this->_article->guid; |
| 117 | - if ( $arg != 'index' |
|
| 117 | + if ($arg != 'index' |
|
| 118 | 118 | && $this->_config->get('hide_navigation')) { |
| 119 | 119 | $this->add_breadcrumb("{$arg}/", $this->_article->title); |
| 120 | 120 | } |
@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | midcom::get()->metadata->set_request_metadata($this->_article->metadata->revised, $this->_article->guid); |
| 125 | 125 | $this->bind_view_to_object($this->_article, $this->_datamanager->get_schema()->get_name()); |
| 126 | 126 | |
| 127 | - if ( $this->_config->get('indexinnav') |
|
| 127 | + if ($this->_config->get('indexinnav') |
|
| 128 | 128 | || $this->_config->get('autoindex') |
| 129 | 129 | || $this->_article->name != 'index') { |
| 130 | 130 | $this->set_active_leaf($this->_article->id); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - if ( $this->_config->get('folder_in_title') |
|
| 133 | + if ($this->_config->get('folder_in_title') |
|
| 134 | 134 | && $this->_topic->extra != $this->_article->title) { |
| 135 | 135 | midcom::get()->head->set_pagetitle("{$this->_topic->extra}: {$this->_article->title}"); |
| 136 | 136 | } else { |