@@ -273,7 +273,7 @@ |
||
| 273 | 273 | 'Modify' => 'Modificar', |
| 274 | 274 | 'Loading' => 'Cargando', |
| 275 | 275 | 'Load more data' => 'Cargar máis datos', |
| 276 | - '%d / ' => array('%d / ','%d / '), |
|
| 276 | + '%d / ' => array('%d / ', '%d / '), |
|
| 277 | 277 | 'Limit rows' => 'Limitar filas', |
| 278 | 278 | 'Default value' => 'Valor por defecto', |
| 279 | 279 | 'Full table scan' => 'Escaneo completo da táboa', |
@@ -62,8 +62,7 @@ discard block |
||
| 62 | 62 | private function getEnumItemValue(string $val, int $i, $value): array |
| 63 | 63 | { |
| 64 | 64 | $val = stripcslashes(str_replace("''", "'", $val)); |
| 65 | - $checked = (is_int($value) ? $value == $i + 1 : |
|
| 66 | - (is_array($value) ? in_array($i+1, $value) : $value === $val)); |
|
| 65 | + $checked = (is_int($value) ? $value == $i + 1 : (is_array($value) ? in_array($i + 1, $value) : $value === $val)); |
|
| 67 | 66 | return ['value' => $i + 1, 'checked' => $checked, 'text' => $this->utils->str->html($val)]; |
| 68 | 67 | } |
| 69 | 68 | |
@@ -82,7 +81,7 @@ discard block |
||
| 82 | 81 | 'text' => '<i>' . $this->utils->trans->lang('original') . '</i>']; |
| 83 | 82 | } |
| 84 | 83 | if ($field->null) { |
| 85 | - $values[] = ['value' => '', 'checked' => $value === null && !$select, 'text' => '<i>NULL</i>']; |
|
| 84 | + $values[] = ['value' => '', 'checked' => $value === null && !$select, 'text' => '<i>NULL</i>']; |
|
| 86 | 85 | } |
| 87 | 86 | |
| 88 | 87 | // From functions.inc.php (function enum_input()) |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | if ($row === null) { |
| 122 | 122 | return !$update && $field->autoIncrement ? "" : (isset($queryOptions["select"]) ? false : $default); |
| 123 | 123 | } |
| 124 | - if ($row[$name] != "" && $this->driver->jush() == "sql" && preg_match("~enum|set~", $field->type) ) { |
|
| 124 | + if ($row[$name] != "" && $this->driver->jush() == "sql" && preg_match("~enum|set~", $field->type)) { |
|
| 125 | 125 | return is_array($row[$name]) ? array_sum($row[$name]) : +$row[$name]; |
| 126 | 126 | } |
| 127 | 127 | return is_bool($row[$name]) ? +$row[$name] : $row[$name]; |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | return "SQL"; |
| 142 | 142 | } |
| 143 | 143 | if ($queryOptions["save"]) { |
| 144 | - return (string)$queryOptions["function"][$name]; |
|
| 144 | + return (string) $queryOptions["function"][$name]; |
|
| 145 | 145 | } |
| 146 | 146 | if ($update && preg_match('~^CURRENT_TIMESTAMP~i', $field->onUpdate)) { |
| 147 | 147 | return 'now'; |
@@ -120,8 +120,7 @@ |
||
| 120 | 120 | } |
| 121 | 121 | $foreignKey = $this->foreignKeys[$field->type] ?? null; |
| 122 | 122 | //! Can collide with user defined type |
| 123 | - $typeField = ($foreignKey === null ? $field : |
|
| 124 | - TableFieldEntity::make($this->referencableTables[$foreignKey])); |
|
| 123 | + $typeField = ($foreignKey === null ? $field : TableFieldEntity::make($this->referencableTables[$foreignKey])); |
|
| 125 | 124 | $processedField = $this->driver->processField($field, $typeField); |
| 126 | 125 | $origField = $this->fields[$field->name] ?? null; |
| 127 | 126 | $this->after = ''; |
@@ -49,8 +49,7 @@ discard block |
||
| 49 | 49 | $row[$key] = '"' . str_replace('"', '""', $val) . '"'; |
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | - $separator = $this->options['format'] === 'csv' ? ',' : |
|
| 53 | - ($this->options['format'] === 'tsv' ? "\t" : ';'); |
|
| 52 | + $separator = $this->options['format'] === 'csv' ? ',' : ($this->options['format'] === 'tsv' ? "\t" : ';'); |
|
| 54 | 53 | $this->queries[] = implode($separator, $row); |
| 55 | 54 | } |
| 56 | 55 | |
@@ -143,7 +142,7 @@ discard block |
||
| 143 | 142 | } |
| 144 | 143 | if (!$this->insert) { |
| 145 | 144 | $this->insert = 'INSERT INTO ' . $this->driver->escapeTableName($table) . ' (' . |
| 146 | - implode(', ', array_map(function ($key) { |
|
| 145 | + implode(', ', array_map(function($key) { |
|
| 147 | 146 | return $this->driver->escapeId($key); |
| 148 | 147 | }, $keys)) . ') VALUES'; |
| 149 | 148 | } |
@@ -176,8 +176,7 @@ discard block |
||
| 176 | 176 | foreach ($grants as $object => $grant) { |
| 177 | 177 | //! separate db, table, columns, PROCEDURE|FUNCTION, routine |
| 178 | 178 | $headers[] = $object === '*.*' ? |
| 179 | - '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : |
|
| 180 | - '<input name="objects[' . $i . ']" value="' . $this->utils->str->html($object) . '" autocapitalize="off" />'; |
|
| 179 | + '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . $this->utils->str->html($object) . '" autocapitalize="off" />'; |
|
| 181 | 180 | $i++; |
| 182 | 181 | } |
| 183 | 182 | |
@@ -230,8 +229,7 @@ discard block |
||
| 230 | 229 | foreach ($userEntity->grants as $object => $grant) { |
| 231 | 230 | //! separate db, table, columns, PROCEDURE|FUNCTION, routine |
| 232 | 231 | $headers[] = $object === '*.*' ? |
| 233 | - '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : |
|
| 234 | - '<input name="objects[' . $i . ']" value="' . |
|
| 232 | + '<input type="hidden" name="objects[' . $i . ']" value="*.*" />*.*' : '<input name="objects[' . $i . ']" value="' . |
|
| 235 | 233 | $this->utils->str->html($object) . '" autocapitalize="off" />'; |
| 236 | 234 | $i++; |
| 237 | 235 | } |
@@ -247,11 +245,11 @@ discard block |
||
| 247 | 245 | ], |
| 248 | 246 | 'pass' => [ |
| 249 | 247 | 'label' => $this->utils->trans->lang('Password'), |
| 250 | - 'value' => $userEntity->password , |
|
| 248 | + 'value' => $userEntity->password, |
|
| 251 | 249 | ], |
| 252 | 250 | 'hashed' => [ |
| 253 | 251 | 'label' => $this->utils->trans->lang('Hashed'), |
| 254 | - 'value' => ($userEntity->password !== ''), |
|
| 252 | + 'value' => ($userEntity->password !== ''), |
|
| 255 | 253 | ], |
| 256 | 254 | ]; |
| 257 | 255 | |
@@ -45,8 +45,7 @@ |
||
| 45 | 45 | // From table.inc.php |
| 46 | 46 | $status = $this->status($view); |
| 47 | 47 | $name = $this->admin->tableName($status); |
| 48 | - $title = ($status->engine == 'materialized view' ? $this->utils->trans->lang('Materialized view') : |
|
| 49 | - $this->utils->trans->lang('View')) . ': ' . ($name != '' ? $name : $this->utils->str->html($view)); |
|
| 48 | + $title = ($status->engine == 'materialized view' ? $this->utils->trans->lang('Materialized view') : $this->utils->trans->lang('View')) . ': ' . ($name != '' ? $name : $this->utils->str->html($view)); |
|
| 50 | 49 | |
| 51 | 50 | $comment = $status->comment; |
| 52 | 51 | |
@@ -200,14 +200,14 @@ |
||
| 200 | 200 | $target .= '<b>' . $this->utils->str->html($foreignKey->schema) . '</b>.'; |
| 201 | 201 | } |
| 202 | 202 | $target = $this->utils->str->html($foreignKey->table) . |
| 203 | - '(' . implode(', ', array_map(function ($key) { |
|
| 203 | + '(' . implode(', ', array_map(function($key) { |
|
| 204 | 204 | return $this->utils->str->html($key); |
| 205 | 205 | }, $foreignKey->target)) . ')'; |
| 206 | 206 | $details[] = [ |
| 207 | 207 | 'name' => $this->utils->str->html($name), |
| 208 | 208 | 'source' => '<i>' . implode( |
| 209 | 209 | '</i>, <i>', |
| 210 | - array_map(function ($key) { |
|
| 210 | + array_map(function($key) { |
|
| 211 | 211 | return $this->utils->str->html($key); |
| 212 | 212 | }, $foreignKey->source) |
| 213 | 213 | ) . '</i>', |
@@ -1,26 +1,26 @@ |
||
| 1 | -<?php if(is_array($this->headers)): ?> |
|
| 1 | +<?php if (is_array($this->headers)): ?> |
|
| 2 | 2 | <thead> |
| 3 | 3 | <tr> |
| 4 | -<?php if(isset($this->checkbox)): ?> |
|
| 4 | +<?php if (isset($this->checkbox)): ?> |
|
| 5 | 5 | <th class="dbadmin-table-checkbox"><input id="dbadmin-table-<?php |
| 6 | 6 | echo $this->checkbox ?>-all" type="checkbox" /></th> |
| 7 | 7 | <?php endif ?> |
| 8 | -<?php foreach($this->headers as $header): ?> |
|
| 8 | +<?php foreach ($this->headers as $header): ?> |
|
| 9 | 9 | <th><?php echo $header ?></th> |
| 10 | 10 | <?php endforeach ?> |
| 11 | 11 | </tr> |
| 12 | 12 | </thead> |
| 13 | 13 | <?php endif ?> |
| 14 | 14 | <tbody> |
| 15 | -<?php foreach($this->details as $details): ?> |
|
| 15 | +<?php foreach ($this->details as $details): ?> |
|
| 16 | 16 | <tr> |
| 17 | -<?php if(isset($this->checkbox)): ?> |
|
| 17 | +<?php if (isset($this->checkbox)): ?> |
|
| 18 | 18 | <td><input type="checkbox" class="dbadmin-table-<?php echo |
| 19 | 19 | $this->checkbox ?>" name="<?php echo $this->checkbox ?>[]" /></td> |
| 20 | 20 | <?php endif ?> |
| 21 | -<?php foreach($details as $detail): ?> |
|
| 22 | -<?php if(is_array($detail)): ?> |
|
| 23 | - <td<?php foreach($detail['props'] as $name => $value): ?> <?php |
|
| 21 | +<?php foreach ($details as $detail): ?> |
|
| 22 | +<?php if (is_array($detail)): ?> |
|
| 23 | + <td<?php foreach ($detail['props'] as $name => $value): ?> <?php |
|
| 24 | 24 | echo $name ?>="<?php echo $value ?>"<?php |
| 25 | 25 | endforeach ?>><?php echo $detail['label'] ?></td> |
| 26 | 26 | <?php else: ?> |