@@ -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 | } |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | */ |
| 65 | 65 | public function set_privilege($privilege, $assignee = null, int $value = MIDCOM_PRIVILEGE_ALLOW, string $classname = '') : bool |
| 66 | 66 | { |
| 67 | - if ( !$this->can_do('midgard:update') |
|
| 67 | + if (!$this->can_do('midgard:update') |
|
| 68 | 68 | || !$this->can_do('midgard:privileges')) { |
| 69 | 69 | debug_add("Failed to set a privilege, midgard:update or midgard:privileges on the " . get_class($this) . " {$this->guid} not granted for the current user.", |
| 70 | 70 | MIDCOM_LOG_ERROR); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | */ |
| 95 | 95 | public function unset_privilege($privilege, $assignee = null, string $classname = '') : bool |
| 96 | 96 | { |
| 97 | - if ( !$this->can_do('midgard:update') |
|
| 97 | + if (!$this->can_do('midgard:update') |
|
| 98 | 98 | || !$this->can_do('midgard:privileges')) { |
| 99 | 99 | debug_add("Failed to unset a privilege, midgard:update or midgard:privileges on the " . get_class($this) . " {$this->guid} not granted for the current user.", |
| 100 | 100 | MIDCOM_LOG_ERROR); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | if (file_exists(MIDCOM_STATIC_ROOT . $jqgrid_path . 'i18n/grid.locale-' . $language . '.js')) { |
| 110 | 110 | $lang = $language; |
| 111 | 111 | } |
| 112 | - $head->add_jsfile(MIDCOM_STATIC_URL . $jqgrid_path . 'i18n/grid.locale-'. $lang . '.js'); |
|
| 112 | + $head->add_jsfile(MIDCOM_STATIC_URL . $jqgrid_path . 'i18n/grid.locale-' . $lang . '.js'); |
|
| 113 | 113 | $head->add_jsfile(MIDCOM_STATIC_URL . $jqgrid_path . 'jquery.jqgrid.min.js'); |
| 114 | 114 | |
| 115 | 115 | \org_openpsa_widgets_ui::add_head_elements(); |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | public function set_option(string $key, $value, bool $autoquote_string = true) : self |
| 157 | 157 | { |
| 158 | 158 | $this->_raw_options[$key] = $value; |
| 159 | - if ( $autoquote_string |
|
| 159 | + if ($autoquote_string |
|
| 160 | 160 | && is_string($value)) { |
| 161 | 161 | $value = '"' . str_replace('"', '\\"', $value) . '"'; |
| 162 | 162 | } elseif ($value === true) { |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | public function set_select_column(string $name, string $label, string $options, array $selectdata) : self |
| 187 | 187 | { |
| 188 | 188 | $selectstring = implode(';', array_map( |
| 189 | - function ($key, $value) { |
|
| 189 | + function($key, $value) { |
|
| 190 | 190 | return $key . ':' . $value; |
| 191 | 191 | }, |
| 192 | 192 | array_keys($selectdata), |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | */ |
| 233 | 233 | public function remove_column(string $name) |
| 234 | 234 | { |
| 235 | - if ( empty($name) |
|
| 235 | + if (empty($name) |
|
| 236 | 236 | || !array_key_exists($name, $this->_columns)) { |
| 237 | 237 | throw new midcom_error('Invalid column name ' . $name); |
| 238 | 238 | } |