@@ -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()->nice($this->l('KADRO_SYSTEM_FILE_UPDATED')); |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace HexMakina\kadro\Controllers; |
4 | 4 | |
5 | -use HexMakina\kadro\Auth\{Operator,Permission,ACL}; |
|
6 | -use HexMakina\kadro\Auth\{OperatorInterface,AccessRefusedException}; |
|
5 | +use HexMakina\kadro\Auth\{Operator, Permission, ACL}; |
|
6 | +use HexMakina\kadro\Auth\{OperatorInterface, AccessRefusedException}; |
|
7 | 7 | use HexMakina\LeMarchand\LeMarchand; |
8 | 8 | |
9 | 9 | class ReceptionController extends KadroController |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->logger()->nice($this->l('PAGE_CHECKIN_WELCOME', [$operator->name()])); |
72 | 72 | $this->router()->hop(); |
73 | 73 | } catch (\Exception $e) { |
74 | - $this->logger()->warning($this->l('KADRO_operator_' . $e->getMessage())); |
|
74 | + $this->logger()->warning($this->l('KADRO_operator_'.$e->getMessage())); |
|
75 | 75 | $this->router()->hop('checkin'); |
76 | 76 | } |
77 | 77 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | self::$box->get('template_engine')->assign('lezer', $lezer); |
47 | 47 | self::$box->get('template_engine')->assign('language', $language); |
48 | 48 | |
49 | - setcookie('lang', $language, time() + (365 * 24 * 60 * 60), "/", ""); |
|
49 | + setcookie('lang', $language, time()+(365 * 24 * 60 * 60), "/", ""); |
|
50 | 50 | |
51 | 51 | return self::$box; |
52 | 52 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $setting = 'settings.default.charset'; |
103 | 103 | if (is_string(self::$box->get($setting))) { |
104 | 104 | ini_set('default_charset', self::$box->get($setting)); |
105 | - header('Content-type: text/html; charset=' . strtolower(self::$box->get($setting))); |
|
105 | + header('Content-type: text/html; charset='.strtolower(self::$box->get($setting))); |
|
106 | 106 | } else { |
107 | 107 | throw new \UnexpectedValueException($setting); |
108 | 108 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // ---- parametroj:linguo |
111 | 111 | $setting = 'settings.default.language'; |
112 | 112 | if (is_string(self::$box->get($setting))) { |
113 | - putenv('LANG=' . self::$box->get($setting)); |
|
113 | + putenv('LANG='.self::$box->get($setting)); |
|
114 | 114 | setlocale(LC_ALL, self::$box->get($setting)); |
115 | 115 | } else { |
116 | 116 | throw new \UnexpectedValueException($setting); |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | foreach (self::$box->get('settings.smarty.template_extra_directories') as $i => $template_dir) { |
137 | 137 | $smarty->addTemplateDir($template_dir); |
138 | 138 | } |
139 | - $smarty->addTemplateDir(__DIR__ . '/Views/'); //kadro templates |
|
139 | + $smarty->addTemplateDir(__DIR__.'/Views/'); //kadro templates |
|
140 | 140 | |
141 | 141 | $setting = 'settings.smarty.compiled_path'; |
142 | 142 | if (is_string(self::$box->get($setting))) { |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | $this->viewport('user_messages', $this->logger()->getUserReport()); |
50 | 50 | |
51 | 51 | $this->viewport('web_root', $this->router()->webRoot()); |
52 | - $this->viewport('view_path', $this->router()->filePath() . $this->get('settings.smarty.template_path') . 'app/'); |
|
53 | - $this->viewport('view_url', $this->router()->webRoot() . $this->get('settings.smarty.template_path')); |
|
54 | - $this->viewport('images_url', $this->router()->webRoot() . $this->get('settings.smarty.template_path') . 'images/'); |
|
52 | + $this->viewport('view_path', $this->router()->filePath().$this->get('settings.smarty.template_path').'app/'); |
|
53 | + $this->viewport('view_url', $this->router()->webRoot().$this->get('settings.smarty.template_path')); |
|
54 | + $this->viewport('images_url', $this->router()->webRoot().$this->get('settings.smarty.template_path').'images/'); |
|
55 | 55 | |
56 | 56 | foreach ($this->viewport() as $template_var_name => $value) { |
57 | 57 | $smarty->assign($template_var_name, $value); |
@@ -81,8 +81,8 @@ discard block |
||
81 | 81 | // 1. check for custom template in the current controller directory |
82 | 82 | $templates ['custom_3'] = sprintf('%s/%s.html', $controller_template_path, $custom_template); |
83 | 83 | // 2. check for custom template formatted as controller/view |
84 | - $templates ['custom_2'] = $custom_template . '.html'; |
|
85 | - $templates ['custom_1'] = '_layouts/' . $custom_template . '.html'; |
|
84 | + $templates ['custom_2'] = $custom_template.'.html'; |
|
85 | + $templates ['custom_1'] = '_layouts/'.$custom_template.'.html'; |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | if (!empty($this->router()->targetMethod())) { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $ret = $this->modelType(); |
58 | 58 | |
59 | 59 | if (!is_null($suffix)) { |
60 | - $ret .= '_' . $suffix; |
|
60 | + $ret .= '_'.$suffix; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return $ret; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | { |
108 | 108 | if (is_null($this->model_class_name)) { |
109 | 109 | preg_match(LeMarchand::RX_CLASS_NAME, get_called_class(), $m); |
110 | - $this->model_class_name = $this->get($m[1] . 'Class'); |
|
110 | + $this->model_class_name = $this->get($m[1].'Class'); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return $this->model_class_name; |
@@ -175,8 +175,8 @@ discard block |
||
175 | 175 | $this->viewport('listing_fields', $listing_fields); |
176 | 176 | $this->viewport('listing_template', $listing_template); |
177 | 177 | |
178 | - $this->viewport('route_new', $this->router()->hyp($class_name::model_type() . '_new')); |
|
179 | - $this->viewport('route_export', $this->router()->hyp($class_name::model_type() . '_export')); |
|
178 | + $this->viewport('route_new', $this->router()->hyp($class_name::model_type().'_new')); |
|
179 | + $this->viewport('route_export', $this->router()->hyp($class_name::model_type().'_export')); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | public function copy() |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | { |
208 | 208 | $this->errors = $model->save($this->operator()->operator_id()); // returns [errors] |
209 | 209 | if (empty($this->errors())) { |
210 | - $this->logger()->nice($this->l('CRUDITES_INSTANCE_ALTERED', [$this->l('MODEL_' . get_class($model)::model_type() . '_INSTANCE')])); |
|
210 | + $this->logger()->nice($this->l('CRUDITES_INSTANCE_ALTERED', [$this->l('MODEL_'.get_class($model)::model_type().'_INSTANCE')])); |
|
211 | 211 | return $model; |
212 | 212 | } |
213 | 213 | foreach ($this->errors() as $field => $error_msg) { |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | public function before_edit() |
221 | 221 | { |
222 | 222 | if (!is_null($this->router()->params('id')) && is_null($this->load_model)) { |
223 | - $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->modelClassName()::model_type() . '_INSTANCE')])); |
|
223 | + $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->modelClassName()::model_type().'_INSTANCE')])); |
|
224 | 224 | $this->router()->hop($this->modelClassName()::model_type()); |
225 | 225 | } |
226 | 226 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | public function destroy_confirm() |
240 | 240 | { |
241 | 241 | if (is_null($this->load_model)) { |
242 | - $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')])); |
|
242 | + $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')])); |
|
243 | 243 | $this->router()->hop($this->model_type); |
244 | 244 | } |
245 | 245 | |
@@ -251,10 +251,10 @@ discard block |
||
251 | 251 | public function before_destroy() // default: checks for load_model and immortality, hops back to object on failure |
252 | 252 | { |
253 | 253 | if (is_null($this->load_model)) { |
254 | - $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')])); |
|
254 | + $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')])); |
|
255 | 255 | $this->router()->hop($this->model_type); |
256 | 256 | } elseif ($this->load_model->immortal()) { |
257 | - $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_IS_IMMORTAL', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')])); |
|
257 | + $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_IS_IMMORTAL', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')])); |
|
258 | 258 | $this->router()->hop($this->route_model($this->load_model)); |
259 | 259 | } |
260 | 260 | } |
@@ -266,10 +266,10 @@ discard block |
||
266 | 266 | } |
267 | 267 | |
268 | 268 | if ($this->load_model->destroy($this->operator()->operator_id()) === false) { |
269 | - $this->logger()->info($this->l('CRUDITES_ERR_INSTANCE_IS_UNDELETABLE', ['' . $this->load_model])); |
|
269 | + $this->logger()->info($this->l('CRUDITES_ERR_INSTANCE_IS_UNDELETABLE', [''.$this->load_model])); |
|
270 | 270 | $this->route_back($this->load_model); |
271 | 271 | } else { |
272 | - $this->logger()->nice($this->l('CRUDITES_INSTANCE_DESTROYED', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')])); |
|
272 | + $this->logger()->nice($this->l('CRUDITES_INSTANCE_DESTROYED', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')])); |
|
273 | 273 | $this->route_back($this->model_type); |
274 | 274 | } |
275 | 275 | } |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | public function collection_to_csv($collection, $filename) |
294 | 294 | { |
295 | 295 | // TODO use Format/File/CSV class to generate file |
296 | - $file_path = $this->get('settings.export.directory') . $filename . '.csv'; |
|
296 | + $file_path = $this->get('settings.export.directory').$filename.'.csv'; |
|
297 | 297 | $fp = fopen($file_path, 'w'); |
298 | 298 | |
299 | 299 | $header = false; |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | |
331 | 331 | public function route_new(ModelInterface $model): string |
332 | 332 | { |
333 | - return $this->router()->hyp(get_class($model)::model_type() . '_new'); |
|
333 | + return $this->router()->hyp(get_class($model)::model_type().'_new'); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | public function route_list(ModelInterface $model): string |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | { |
343 | 343 | $route_params = []; |
344 | 344 | |
345 | - $route_name = get_class($model)::model_type() . '_'; |
|
345 | + $route_name = get_class($model)::model_type().'_'; |
|
346 | 346 | if ($model->is_new()) { |
347 | 347 | $route_name .= 'new'; |
348 | 348 | } else { |