@@ -30,9 +30,9 @@ |
||
30 | 30 | if (Obj::isArray($notify) && count($notify) > 0) { |
31 | 31 | foreach ($notify as $type => $messages) { |
32 | 32 | foreach ($messages as $message) { |
33 | - echo '<p class="alert ' . type2html($type) . '"> |
|
33 | + echo '<p class="alert '.type2html($type).'"> |
|
34 | 34 | <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' |
35 | - . \Ffcms\Core\App::$Security->strip_tags($message) . '</p>'; |
|
35 | + . \Ffcms\Core\App::$Security->strip_tags($message).'</p>'; |
|
36 | 36 | } |
37 | 37 | } |
38 | 38 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | <?php |
17 | 17 | $customCssCode = \App::$View->showPlainCode('css'); |
18 | 18 | if ($customCssCode !== null) { |
19 | - echo '<style>' . $customCssCode . '</style>'; |
|
19 | + echo '<style>'.$customCssCode.'</style>'; |
|
20 | 20 | } ?> |
21 | 21 | <script> |
22 | 22 | window.jQ = []; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | <?php |
63 | 63 | $customJsCode = \App::$View->showPlainCode('js'); |
64 | 64 | if ($customJsCode !== null) { |
65 | - echo '<script>' . $customJsCode . '</script>'; |
|
65 | + echo '<script>'.$customJsCode.'</script>'; |
|
66 | 66 | } |
67 | 67 | ?> |
68 | 68 | </body> |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | public function before() |
40 | 40 | { |
41 | 41 | foreach ($this->_apps as $app) { |
42 | - $this->_definedControllers[] = (string)$app->sys_name; |
|
42 | + $this->_definedControllers[] = (string) $app->sys_name; |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | parent::before(); |
@@ -70,14 +70,14 @@ discard block |
||
70 | 70 | public function make() |
71 | 71 | { |
72 | 72 | $cName = ucfirst(Str::lowerCase($this->sysname)); |
73 | - $cPath = 'Apps\Controller\Admin\\' . $cName; |
|
73 | + $cPath = 'Apps\Controller\Admin\\'.$cName; |
|
74 | 74 | // if object class is not loaded - prevent install |
75 | - if (!class_exists($cPath) || !defined($cPath . '::VERSION')) { |
|
75 | + if (!class_exists($cPath) || !defined($cPath.'::VERSION')) { |
|
76 | 76 | return false; |
77 | 77 | } |
78 | 78 | |
79 | 79 | // get ext version |
80 | - $cVersion = (float)constant($cPath . '::VERSION'); |
|
80 | + $cVersion = (float) constant($cPath.'::VERSION'); |
|
81 | 81 | if ($cVersion < 0.1) { |
82 | 82 | $cVersion = 0.1; |
83 | 83 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | |
94 | 94 | // callback to install method in extension |
95 | 95 | if (method_exists($cPath, 'install')) { |
96 | - call_user_func($cPath . '::install'); |
|
96 | + call_user_func($cPath.'::install'); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | return true; |
@@ -62,8 +62,8 @@ |
||
62 | 62 | ]; |
63 | 63 | |
64 | 64 | foreach (App::$Properties->get('languages') as $lang) { |
65 | - $rules[] = ['name.' . $lang, 'required']; |
|
66 | - $rules[] = ['name.' . $lang, 'length_max', 50]; |
|
65 | + $rules[] = ['name.'.$lang, 'required']; |
|
66 | + $rules[] = ['name.'.$lang, 'length_max', 50]; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | return $rules; |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $configData = [ |
59 | 59 | ucfirst(Str::lowerCase($this->type)) => [ |
60 | 60 | ucfirst(Str::lowerCase($this->loader)) => [ |
61 | - '/' . trim($this->source, '/') => '/' . trim($this->target, '/') |
|
61 | + '/'.trim($this->source, '/') => '/'.trim($this->target, '/') |
|
62 | 62 | ] |
63 | 63 | ] |
64 | 64 | ]; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | // prepare source path |
50 | 50 | if ($this->type === 'Alias') { |
51 | - $this->source = '/' . trim($this->source, '/'); |
|
51 | + $this->source = '/'.trim($this->source, '/'); |
|
52 | 52 | } else { |
53 | 53 | $this->source = ucfirst($this->source); |
54 | 54 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // get all depended category ids |
78 | - $cats = ContentCategory::where('path', 'like', $this->_record->path . '%')->get(['id'])->toArray(); |
|
78 | + $cats = ContentCategory::where('path', 'like', $this->_record->path.'%')->get(['id'])->toArray(); |
|
79 | 79 | $allCategoryIds = Arr::ploke('id', $cats); |
80 | 80 | |
81 | 81 | // update category_id in content |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | $response = []; |
111 | 111 | foreach ($data as $key=>$val) { |
112 | 112 | if ($this->_record->id !== $key) { |
113 | - $response[] = (string)$key; |
|
113 | + $response[] = (string) $key; |
|
114 | 114 | } |
115 | 115 | } |
116 | 116 | return $response; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function copyFile(iUser $user) |
48 | 48 | { |
49 | 49 | // move file to original folder |
50 | - $upload = $this->file->move(root . '/upload/user/avatar/original/', $user->id . '.' . $this->file->guessExtension()); |
|
50 | + $upload = $this->file->move(root.'/upload/user/avatar/original/', $user->id.'.'.$this->file->guessExtension()); |
|
51 | 51 | |
52 | 52 | try { |
53 | 53 | // big image |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | $image = new Image(); |
85 | - $image->setCacheDir(root . '/Private/Cache/images'); |
|
85 | + $image->setCacheDir(root.'/Private/Cache/images'); |
|
86 | 86 | |
87 | 87 | $image->open($original->getPathname()) |
88 | 88 | ->cropResize($sizeConvert[$size][0], $sizeConvert[$size][1]) |
89 | - ->save(root . '/upload/user/avatar/' . $size . '/' . $user_id . '.jpg', 'jpg', static::COMPRESS_QUALITY); |
|
89 | + ->save(root.'/upload/user/avatar/'.$size.'/'.$user_id.'.jpg', 'jpg', static::COMPRESS_QUALITY); |
|
90 | 90 | |
91 | 91 | return null; |
92 | 92 | } |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | const COMPRESS_QUALITY = 90; |
21 | 21 | |
22 | 22 | /** |
23 | - * Form text helper data with translation |
|
24 | - */ |
|
23 | + * Form text helper data with translation |
|
24 | + */ |
|
25 | 25 | public function labels() |
26 | 26 | { |
27 | 27 | return [ |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | - * Validation rules for avatar uploading |
|
34 | - */ |
|
33 | + * Validation rules for avatar uploading |
|
34 | + */ |
|
35 | 35 | public function rules() |
36 | 36 | { |
37 | 37 | return [ |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | $objectTemplate = null; |
30 | 30 | |
31 | 31 | if ($singleName) { |
32 | - $objectDirPath = root . '/Apps/' . $type . '/'; |
|
33 | - $objectNamespace = 'Apps\\' . $type; |
|
32 | + $objectDirPath = root.'/Apps/'.$type.'/'; |
|
33 | + $objectNamespace = 'Apps\\'.$type; |
|
34 | 34 | $objectName = ucfirst($name); |
35 | 35 | } else { |
36 | 36 | $split = explode('/', $name); |
@@ -47,46 +47,46 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | if ($type === 'Widget') { |
50 | - $objectDirPath = root . '/Widgets/' . $workground; |
|
51 | - $objectNamespace = 'Widgets\\' . $workground; |
|
50 | + $objectDirPath = root.'/Widgets/'.$workground; |
|
51 | + $objectNamespace = 'Widgets\\'.$workground; |
|
52 | 52 | } else { |
53 | - $objectDirPath = root . '/Apps/' . $type . '/' . $workground; |
|
54 | - $objectNamespace = 'Apps\\' . $type . '\\' . $workground; |
|
53 | + $objectDirPath = root.'/Apps/'.$type.'/'.$workground; |
|
54 | + $objectNamespace = 'Apps\\'.$type.'\\'.$workground; |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | if (false !== $subName) { |
58 | - $objectDirPath .= '/' . implode('/', $subName); |
|
59 | - $objectNamespace .= '\\' . implode('\\', $subName); |
|
58 | + $objectDirPath .= '/'.implode('/', $subName); |
|
59 | + $objectNamespace .= '\\'.implode('\\', $subName); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
63 | 63 | // try to find workground-based controller |
64 | - if (File::exist('/Private/Carcase/' . $workground . '/' . $type . '.tphp')) { |
|
65 | - $objectTemplate = File::read('/Private/Carcase/' . $workground . '/' . $type . '.tphp'); |
|
64 | + if (File::exist('/Private/Carcase/'.$workground.'/'.$type.'.tphp')) { |
|
65 | + $objectTemplate = File::read('/Private/Carcase/'.$workground.'/'.$type.'.tphp'); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | 69 | if (!Directory::exist($objectDirPath) && !Directory::create($objectDirPath)) { |
70 | - $this->message = 'Directory could not be created: ' . $objectDirPath; |
|
70 | + $this->message = 'Directory could not be created: '.$objectDirPath; |
|
71 | 71 | return false; |
72 | 72 | } |
73 | 73 | |
74 | 74 | if ($objectTemplate === null) { |
75 | - $objectTemplate = File::read('/Private/Carcase/' . $type . '.tphp'); |
|
75 | + $objectTemplate = File::read('/Private/Carcase/'.$type.'.tphp'); |
|
76 | 76 | if (false === $objectTemplate) { |
77 | - $this->message = 'Php template file is not founded: /Private/Carcase/' . $type . '.tphp'; |
|
77 | + $this->message = 'Php template file is not founded: /Private/Carcase/'.$type.'.tphp'; |
|
78 | 78 | return false; |
79 | 79 | } |
80 | 80 | } |
81 | 81 | |
82 | 82 | $objectContent = Str::replace(['%namespace%', '%name%'], [$objectNamespace, $objectName], $objectTemplate); |
83 | - $objectFullPath = $objectDirPath . '/' . $objectName . '.php'; |
|
83 | + $objectFullPath = $objectDirPath.'/'.$objectName.'.php'; |
|
84 | 84 | if (File::exist($objectFullPath)) { |
85 | - $this->message = $type . ' is always exist: ' . $objectFullPath; |
|
85 | + $this->message = $type.' is always exist: '.$objectFullPath; |
|
86 | 86 | return false; |
87 | 87 | } |
88 | 88 | File::write($objectFullPath, $objectContent); |
89 | - $this->message = $type . ' template was created: [' . $objectName . '] in path: ' . Str::replace(root, '', $objectDirPath); |
|
89 | + $this->message = $type.' template was created: ['.$objectName.'] in path: '.Str::replace(root, '', $objectDirPath); |
|
90 | 90 | return true; |
91 | 91 | } |
92 | 92 | } |
93 | 93 | \ No newline at end of file |
@@ -10,6 +10,10 @@ |
||
10 | 10 | { |
11 | 11 | public $message; |
12 | 12 | |
13 | + /** |
|
14 | + * @param string $name |
|
15 | + * @param string $type |
|
16 | + */ |
|
13 | 17 | public function createObject($name, $type) |
14 | 18 | { |
15 | 19 | $singleName = false; |