@@ -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) |
@@ -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() |
@@ -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))) { |
@@ -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; |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use HexMakina\BlackBox\Database\SelectInterface; |
| 6 | 6 | use HexMakina\BlackBox\Auth\OperatorInterface; |
| 7 | -use HexMakina\TightORM\{TightModel,RelationManyToMany}; |
|
| 7 | +use HexMakina\TightORM\{TightModel, RelationManyToMany}; |
|
| 8 | 8 | |
| 9 | 9 | class Operator extends TightModel implements OperatorInterface |
| 10 | 10 | { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | if (isset($filters['model']) && !empty($filters['model'])) { |
| 94 | - $Query->join([static::otm('t'), static::otm('a')], [[static::otm('a'),static::otm('k'), 't_from','id']], 'INNER'); |
|
| 94 | + $Query->join([static::otm('t'), static::otm('a')], [[static::otm('a'), static::otm('k'), 't_from', 'id']], 'INNER'); |
|
| 95 | 95 | $Query->whereFieldsEQ(['model_id' => $filters['model']->getId(), 'model_type' => get_class($filters['model'])::model_type()], static::otm('a')); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | public function hasPermission($p): bool |
| 147 | 147 | { |
| 148 | 148 | // new instances or inactive operators, none shall pass |
| 149 | - if ($this->isNew() === true || $this->isActive() === false) { |
|
| 149 | + if ($this->isNew() === true || $this->isActive() === false) { |
|
| 150 | 150 | return false; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -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())) { |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function operator(): OperatorInterface |
| 26 | 26 | { |
| 27 | - if(is_null($this->operator)){ |
|
| 27 | + if (is_null($this->operator)) { |
|
| 28 | 28 | $op_id = $this->get('HexMakina\BlackBox\StateAgentInterface')->operatorId(); |
| 29 | 29 | $op_class = get_class($this->get('HexMakina\BlackBox\Auth\OperatorInterface')); |
| 30 | 30 | $op = $op_class::safeLoading($op_id); |
@@ -74,15 +74,15 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | private function trim_request_data() |
| 76 | 76 | { |
| 77 | - array_walk_recursive($_GET, function (&$value) { |
|
| 77 | + array_walk_recursive($_GET, function(&$value) { |
|
| 78 | 78 | $value = trim($value); |
| 79 | 79 | }); |
| 80 | - array_walk_recursive($_REQUEST, function (&$value) { |
|
| 80 | + array_walk_recursive($_REQUEST, function(&$value) { |
|
| 81 | 81 | $value = trim($value); |
| 82 | 82 | }); |
| 83 | 83 | |
| 84 | 84 | if ($this->router()->submits()) { |
| 85 | - array_walk_recursive($_POST, function (&$value) { |
|
| 85 | + array_walk_recursive($_POST, function(&$value) { |
|
| 86 | 86 | $value = trim($value); |
| 87 | 87 | }); |
| 88 | 88 | } |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | public function update_file($lang = 'fra') |
| 23 | 23 | { |
| 24 | 24 | try { |
| 25 | - $locale_path = $this->get('settings.locale.directory_path') . '/' . $this->get('settings.locale.file_name'); |
|
| 25 | + $locale_path = $this->get('settings.locale.directory_path').'/'.$this->get('settings.locale.file_name'); |
|
| 26 | 26 | self::create_file($locale_path, $lang); |
| 27 | 27 | |
| 28 | 28 | $this->logger()->notice($this->l('KADRO_SYSTEM_FILE_UPDATED')); |