@@ -22,7 +22,7 @@ |
||
| 22 | 22 | |
| 23 | 23 | public function event_label() |
| 24 | 24 | { |
| 25 | - return '' . $this; |
|
| 25 | + return ''.$this; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | public static function today($format = Dato::FORMAT) |
@@ -58,15 +58,15 @@ |
||
| 58 | 58 | |
| 59 | 59 | private function trim_request_data() |
| 60 | 60 | { |
| 61 | - array_walk_recursive($_GET, function (&$value) { |
|
| 61 | + array_walk_recursive($_GET, function(&$value) { |
|
| 62 | 62 | $value = trim($value); |
| 63 | 63 | }); |
| 64 | - array_walk_recursive($_REQUEST, function (&$value) { |
|
| 64 | + array_walk_recursive($_REQUEST, function(&$value) { |
|
| 65 | 65 | $value = trim($value); |
| 66 | 66 | }); |
| 67 | 67 | |
| 68 | 68 | if ($this->router()->submits()) { |
| 69 | - array_walk_recursive($_POST, function (&$value) { |
|
| 69 | + array_walk_recursive($_POST, function(&$value) { |
|
| 70 | 70 | $value = trim($value); |
| 71 | 71 | }); |
| 72 | 72 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | namespace HexMakina\kadro\Controllers; |
| 14 | 14 | |
| 15 | 15 | use HexMakina\Crudites\Crudites; |
| 16 | -use HexMakina\kadro\Auth\{ACL,AccessRefusedException}; |
|
| 16 | +use HexMakina\kadro\Auth\{ACL, AccessRefusedException}; |
|
| 17 | 17 | |
| 18 | 18 | class Operator extends \HexMakina\kadro\Controllers\ORM |
| 19 | 19 | { |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function dashboard() |
| 57 | 57 | { |
| 58 | 58 | $real_operator_class = get_class($this->operator()); |
| 59 | - $this->viewport('users', $real_operator_class::filter([], ['order_by' => [null,'username', 'ASC']])); |
|
| 59 | + $this->viewport('users', $real_operator_class::filter([], ['order_by' => [null, 'username', 'ASC']])); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | public function destroy() |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | namespace HexMakina\kadro; |
| 4 | 4 | |
| 5 | 5 | use HexMakina\BlackBox\ORM\ModelInterface; |
| 6 | -use HexMakina\Marker\{Form,Element}; |
|
| 6 | +use HexMakina\Marker\{Form, Element}; |
|
| 7 | 7 | |
| 8 | 8 | class TableToForm |
| 9 | 9 | { |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $form_field = new Element('div', $form_field, ['class' => $group_class]); |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | - $ret .= PHP_EOL . $form_field; |
|
| 85 | + $ret .= PHP_EOL.$form_field; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | return $ret; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | $ret = ''; |
| 13 | 13 | if (method_exists($model, $field_name)) { |
| 14 | 14 | $ret = $model->$field_name(); |
| 15 | - }elseif (property_exists($model, $field_name)) { |
|
| 15 | + } elseif (property_exists($model, $field_name)) { |
|
| 16 | 16 | $ret = $model->$field_name; |
| 17 | 17 | } |
| 18 | 18 | |
@@ -93,31 +93,23 @@ discard block |
||
| 93 | 93 | $ret = null; |
| 94 | 94 | if ($field->isAutoIncremented()) { |
| 95 | 95 | $ret = Form::hidden($field->name(), $field_value); |
| 96 | - } |
|
| 97 | - elseif ($field->type()->isBoolean()) { |
|
| 96 | + } elseif ($field->type()->isBoolean()) { |
|
| 98 | 97 | $option_list = $attributes['values'] ?? [0 => 0, 1 => 1]; |
| 99 | 98 | $ret = Form::select($field->name(), $option_list, $field_value, $attributes); // |
| 100 | - } |
|
| 101 | - elseif ($field->type()->isInteger()) { |
|
| 99 | + } elseif ($field->type()->isInteger()) { |
|
| 102 | 100 | $ret = Form::input($field->name(), $field_value, $attributes, $errors); |
| 103 | - } |
|
| 104 | - elseif ($field->type()->isYear()) { |
|
| 101 | + } elseif ($field->type()->isYear()) { |
|
| 105 | 102 | $attributes['size'] = $attributes['maxlength'] = 4; |
| 106 | 103 | $ret = Form::input($field->name(), $field_value, $attributes, $errors); |
| 107 | - } |
|
| 108 | - elseif ($field->type()->isDate()) { |
|
| 104 | + } elseif ($field->type()->isDate()) { |
|
| 109 | 105 | $ret = Form::date($field->name(), $field_value, $attributes, $errors); |
| 110 | - } |
|
| 111 | - elseif ($field->type()->isTime()) { |
|
| 106 | + } elseif ($field->type()->isTime()) { |
|
| 112 | 107 | $ret = Form::time($field->name(), $field_value, $attributes, $errors); |
| 113 | - } |
|
| 114 | - elseif ($field->type()->isDatetime()) { |
|
| 108 | + } elseif ($field->type()->isDatetime()) { |
|
| 115 | 109 | $ret = Form::datetime($field->name(), $field_value, $attributes, $errors); |
| 116 | - } |
|
| 117 | - elseif ($field->type()->isText()) { |
|
| 110 | + } elseif ($field->type()->isText()) { |
|
| 118 | 111 | $ret = Form::textarea($field->name(), $field_value, $attributes, $errors); |
| 119 | - } |
|
| 120 | - elseif ($field->type()->isEnum()) { |
|
| 112 | + } elseif ($field->type()->isEnum()) { |
|
| 121 | 113 | $enum_values = []; |
| 122 | 114 | foreach ($field->type()->getEnumValues() as $e_val) { |
| 123 | 115 | $enum_values[$e_val] = $e_val; |
@@ -125,14 +117,13 @@ discard block |
||
| 125 | 117 | |
| 126 | 118 | $selected = $attributes['value'] ?? $field_value ?? ''; |
| 127 | 119 | $ret = Form::select($field->name(), $enum_values, $selected, $attributes); // |
| 128 | - } |
|
| 129 | - elseif ($field->type()->isString()) { |
|
| 120 | + } elseif ($field->type()->isString()) { |
|
| 130 | 121 | $max_length = $field->type()->getLength(); |
| 131 | 122 | $attributes['size'] = $attributes['maxlength'] = $max_length; |
| 132 | 123 | $ret = Form::input($field->name(), $field_value, $attributes, $errors); |
| 124 | + } else { |
|
| 125 | + $ret = Form::input($field->name(), $field_value, $attributes, $errors); |
|
| 133 | 126 | } |
| 134 | - else |
|
| 135 | - $ret = Form::input($field->name(), $field_value, $attributes, $errors); |
|
| 136 | 127 | |
| 137 | 128 | return $ret; |
| 138 | 129 | } |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace HexMakina\kadro\Controllers; |
| 4 | 4 | |
| 5 | -use Psr\Container\{ContainerInterface,ContainerExceptionInterface,NotFoundExceptionInterface}; |
|
| 5 | +use Psr\Container\{ContainerInterface, ContainerExceptionInterface, NotFoundExceptionInterface}; |
|
| 6 | 6 | use HexMakina\BlackBox\RouterInterface; |
| 7 | 7 | use HexMakina\BlackBox\Controllers\BaseControllerInterface; |
| 8 | 8 | use Psr\Log\LoggerInterface; |
@@ -51,9 +51,9 @@ discard block |
||
| 51 | 51 | $this->viewport('user_messages', $this->get('HexMakina\BlackBox\StateAgentInterface')->messages()); |
| 52 | 52 | |
| 53 | 53 | $this->viewport('web_root', $this->router()->webRoot()); |
| 54 | - $this->viewport('view_path', $this->router()->filePath() . $this->get('settings.smarty.template_path') . 'app/'); |
|
| 55 | - $this->viewport('view_url', $this->router()->webRoot() . $this->get('settings.smarty.template_path')); |
|
| 56 | - $this->viewport('images_url', $this->router()->webRoot() . $this->get('settings.smarty.template_path') . 'images/'); |
|
| 54 | + $this->viewport('view_path', $this->router()->filePath().$this->get('settings.smarty.template_path').'app/'); |
|
| 55 | + $this->viewport('view_url', $this->router()->webRoot().$this->get('settings.smarty.template_path')); |
|
| 56 | + $this->viewport('images_url', $this->router()->webRoot().$this->get('settings.smarty.template_path').'images/'); |
|
| 57 | 57 | |
| 58 | 58 | foreach ($this->viewport() as $template_var_name => $value) { |
| 59 | 59 | $smarty->assign($template_var_name, $value); |
@@ -83,8 +83,8 @@ discard block |
||
| 83 | 83 | // 1. check for custom template in the current controller directory |
| 84 | 84 | $templates ['custom_3'] = sprintf('%s/%s.html', $controller_template_path, $custom_template); |
| 85 | 85 | // 2. check for custom template formatted as controller/view |
| 86 | - $templates ['custom_2'] = $custom_template . '.html'; |
|
| 87 | - $templates ['custom_1'] = '_layouts/' . $custom_template . '.html'; |
|
| 86 | + $templates ['custom_2'] = $custom_template.'.html'; |
|
| 87 | + $templates ['custom_1'] = '_layouts/'.$custom_template.'.html'; |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | if (!empty($this->router()->targetMethod())) { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | public function __toString() |
| 30 | 30 | { |
| 31 | - return $this->iso_name() . ' (' . $this->get(self::ISO_3) . ')'; |
|
| 31 | + return $this->iso_name().' ('.$this->get(self::ISO_3).')'; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | public function traceable(): bool |
@@ -74,11 +74,11 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | if (isset($filter['types'])) { |
| 77 | - $wc = sprintf("AND " . self::ISO_TYPE . " IN ('%s') ", implode('\', \'', array_keys(self::ISO_TYPES))); |
|
| 77 | + $wc = sprintf("AND ".self::ISO_TYPE." IN ('%s') ", implode('\', \'', array_keys(self::ISO_TYPES))); |
|
| 78 | 78 | $Query->where($wc); |
| 79 | 79 | } |
| 80 | 80 | if (isset($filter['scopes'])) { |
| 81 | - $wc = sprintf("AND " . self::ISO_SCOPE . " IN ('%s') ", implode('\', \'', array_keys(self::ISO_SCOPES))); |
|
| 81 | + $wc = sprintf("AND ".self::ISO_SCOPE." IN ('%s') ", implode('\', \'', array_keys(self::ISO_SCOPES))); |
|
| 82 | 82 | $Query->where($wc); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | namespace HexMakina\kadro\Controllers; |
| 4 | 4 | |
| 5 | -use HexMakina\kadro\Auth\{Operator,Permission,ACL}; |
|
| 5 | +use HexMakina\kadro\Auth\{Operator, Permission, ACL}; |
|
| 6 | 6 | use HexMakina\kadro\Auth\AccessRefusedException; |
| 7 | 7 | use HexMakina\BlackBox\Auth\OperatorInterface; |
| 8 | 8 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | // MVC Cascade |
| 28 | - $target_controller = $this->get('Controllers\\' . $router->targetController()); |
|
| 28 | + $target_controller = $this->get('Controllers\\'.$router->targetController()); |
|
| 29 | 29 | |
| 30 | 30 | if ($target_controller->requiresOperator()) { |
| 31 | 31 | if (is_null($operator_id = $this->get('HexMakina\BlackBox\StateAgentInterface')->operatorId())) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $this->logger()->notice('PAGE_CHECKIN_WELCOME', [$operator->name()]); |
| 73 | 73 | $this->router()->hop(); |
| 74 | 74 | } catch (\Exception $e) { |
| 75 | - $this->logger()->warning('KADRO_operator_' . $e->getMessage()); |
|
| 75 | + $this->logger()->warning('KADRO_operator_'.$e->getMessage()); |
|
| 76 | 76 | $this->router()->hop('checkin'); |
| 77 | 77 | } |
| 78 | 78 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | //-- router |
| 28 | 28 | $router = self::$box->get('HexMakina\BlackBox\RouterInterface'); |
| 29 | - $router->addRoutes(require(__DIR__ . '/routes.php')); |
|
| 29 | + $router->addRoutes(require(__DIR__.'/routes.php')); |
|
| 30 | 30 | |
| 31 | 31 | //-- session |
| 32 | 32 | $StateAgent = self::$box->get('HexMakina\BlackBox\StateAgentInterface'); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | self::$box->get('\Smarty')->assign('lezer', $lezer); |
| 52 | 52 | self::$box->get('\Smarty')->assign('language', $language); |
| 53 | 53 | |
| 54 | - setcookie('lang', $language, time() + (365 * 24 * 60 * 60), "/", ""); |
|
| 54 | + setcookie('lang', $language, time()+(365 * 24 * 60 * 60), "/", ""); |
|
| 55 | 55 | |
| 56 | 56 | return self::$box; |
| 57 | 57 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | $setting = 'settings.default.charset'; |
| 63 | 63 | if (is_string(self::$box->get($setting))) { |
| 64 | 64 | ini_set('default_charset', self::$box->get($setting)); |
| 65 | - header('Content-type: text/html; charset=' . strtolower(self::$box->get($setting))); |
|
| 65 | + header('Content-type: text/html; charset='.strtolower(self::$box->get($setting))); |
|
| 66 | 66 | } else { |
| 67 | 67 | throw new \UnexpectedValueException($setting); |
| 68 | 68 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | // ---- parametroj:linguo |
| 71 | 71 | $setting = 'settings.default.language'; |
| 72 | 72 | if (is_string(self::$box->get($setting))) { |
| 73 | - putenv('LANG=' . self::$box->get($setting)); |
|
| 73 | + putenv('LANG='.self::$box->get($setting)); |
|
| 74 | 74 | setlocale(LC_ALL, self::$box->get($setting)); |
| 75 | 75 | } else { |
| 76 | 76 | throw new \UnexpectedValueException($setting); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | foreach (self::$box->get('settings.smarty.template_extra_directories') as $i => $template_dir) { |
| 95 | 95 | $smarty->addTemplateDir($template_dir); |
| 96 | 96 | } |
| 97 | - $smarty->addTemplateDir(__DIR__ . '/Views/'); //kadro templates |
|
| 97 | + $smarty->addTemplateDir(__DIR__.'/Views/'); //kadro templates |
|
| 98 | 98 | |
| 99 | 99 | $setting = 'settings.smarty.compiled_path'; |
| 100 | 100 | if (is_string(self::$box->get($setting))) { |