@@ -6,16 +6,12 @@ |
||
| 6 | 6 | use Ffcms\Core\Cache\MemoryObject; |
| 7 | 7 | use Ffcms\Core\Debug\DebugMeasure; |
| 8 | 8 | use Ffcms\Core\Debug\Manager as Debug; |
| 9 | -use Ffcms\Core\Exception\ForbiddenException; |
|
| 10 | -use Ffcms\Core\Exception\JsonException; |
|
| 11 | 9 | use Ffcms\Core\Exception\NativeException; |
| 12 | 10 | use Ffcms\Core\Exception\NotFoundException; |
| 13 | -use Ffcms\Core\Exception\SyntaxException; |
|
| 14 | 11 | use Ffcms\Core\Exception\TemplateException; |
| 15 | 12 | use Ffcms\Core\Helper\Mailer; |
| 16 | 13 | use Ffcms\Core\Helper\Security; |
| 17 | 14 | use Ffcms\Core\Helper\Type\Any; |
| 18 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 19 | 15 | use Ffcms\Core\Helper\Type\Str; |
| 20 | 16 | use Ffcms\Core\I18n\Translate; |
| 21 | 17 | use Ffcms\Core\Managers\BootManager; |
@@ -187,24 +187,24 @@ discard block |
||
| 187 | 187 | $html = null; |
| 188 | 188 | // lets try to get html full content to page render |
| 189 | 189 | try { |
| 190 | - $this->startMeasure(__METHOD__ . '::callback'); |
|
| 190 | + $this->startMeasure(__METHOD__.'::callback'); |
|
| 191 | 191 | /** @var \Ffcms\Core\Arch\Controller $callClass */ |
| 192 | 192 | $callClass = null; |
| 193 | - $callMethod = 'action' . self::$Request->getAction(); |
|
| 193 | + $callMethod = 'action'.self::$Request->getAction(); |
|
| 194 | 194 | |
| 195 | 195 | // define callback class namespace/name full path |
| 196 | - $cName = (self::$Request->getCallbackAlias() ?? '\Apps\Controller\\' . env_name . '\\' . self::$Request->getController()); |
|
| 196 | + $cName = (self::$Request->getCallbackAlias() ?? '\Apps\Controller\\'.env_name.'\\'.self::$Request->getController()); |
|
| 197 | 197 | if (!class_exists($cName)) { |
| 198 | - throw new NotFoundException('Callback class not found: ' . App::$Security->strip_tags($cName)); |
|
| 198 | + throw new NotFoundException('Callback class not found: '.App::$Security->strip_tags($cName)); |
|
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | $callClass = new $cName; |
| 202 | 202 | // check if callback method (action) is exist in class object |
| 203 | 203 | if (!method_exists($callClass, $callMethod)) { |
| 204 | - throw new NotFoundException('Method "' . App::$Security->strip_tags($callMethod) . '()" not founded in "' . get_class($callClass) . '"'); |
|
| 204 | + throw new NotFoundException('Method "'.App::$Security->strip_tags($callMethod).'()" not founded in "'.get_class($callClass).'"'); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - $this->stopMeasure(__METHOD__ . '::callback'); |
|
| 207 | + $this->stopMeasure(__METHOD__.'::callback'); |
|
| 208 | 208 | $params = []; |
| 209 | 209 | if (!Str::likeEmpty(self::$Request->getID())) { |
| 210 | 210 | $params[] = self::$Request->getID(); |
@@ -231,10 +231,10 @@ discard block |
||
| 231 | 231 | ])); |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | - $this->startMeasure($cName . '::' . $callMethod); |
|
| 234 | + $this->startMeasure($cName.'::'.$callMethod); |
|
| 235 | 235 | // make callback call to action in controller and get response |
| 236 | 236 | $actionResponse = call_user_func_array([$callClass, $callMethod], $params); |
| 237 | - $this->stopMeasure($cName . '::' . $callMethod); |
|
| 237 | + $this->stopMeasure($cName.'::'.$callMethod); |
|
| 238 | 238 | |
| 239 | 239 | // set response to controller attribute |
| 240 | 240 | if (!Str::likeEmpty($actionResponse)) { |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | $html = $e->display(); |
| 250 | 250 | } else { // or hook exception to system based :))) |
| 251 | 251 | if (App::$Debug) { |
| 252 | - $msg = $e->getMessage() . $e->getTraceAsString(); |
|
| 252 | + $msg = $e->getMessage().$e->getTraceAsString(); |
|
| 253 | 253 | $html = (new NativeException($msg))->display(); |
| 254 | 254 | } else { |
| 255 | 255 | $html = (new NativeException($e->getMessage()))->display(); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | /** |
| 42 | 42 | * Get label value by variable name |
| 43 | 43 | * @param string $param |
| 44 | - * @return mixed |
|
| 44 | + * @return string |
|
| 45 | 45 | */ |
| 46 | 46 | final public function getLabel($param) |
| 47 | 47 | { |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * Set attribute labels for model variables |
| 68 | - * @return array |
|
| 68 | + * @return string |
|
| 69 | 69 | */ |
| 70 | 70 | public function labels(): array |
| 71 | 71 | { |
@@ -6,7 +6,6 @@ |
||
| 6 | 6 | use Ffcms\Core\App; |
| 7 | 7 | use Ffcms\Core\Exception\SyntaxException; |
| 8 | 8 | use Ffcms\Core\Helper\Type\Any; |
| 9 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 10 | 9 | use Ffcms\Core\Helper\Type\Str; |
| 11 | 10 | use Ffcms\Core\Interfaces\iModel; |
| 12 | 11 | use Ffcms\Core\Traits\DynamicGlobal; |
@@ -249,7 +249,7 @@ |
||
| 249 | 249 | /** |
| 250 | 250 | * Show custom code library link |
| 251 | 251 | * @param string $type - js or css allowed |
| 252 | - * @return array|null|string |
|
| 252 | + * @return null|string |
|
| 253 | 253 | */ |
| 254 | 254 | public function showCodeLink(string $type) |
| 255 | 255 | { |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use Ffcms\Core\Helper\FileSystem\File; |
| 10 | 10 | use Ffcms\Core\Helper\FileSystem\Normalize; |
| 11 | 11 | use Ffcms\Core\Helper\Type\Any; |
| 12 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 13 | 12 | use Ffcms\Core\Helper\Type\Str; |
| 14 | 13 | use Ffcms\Core\Template\Variables; |
| 15 | 14 | use Ffcms\Core\Traits\DynamicGlobal; |
@@ -55,16 +55,16 @@ discard block |
||
| 55 | 55 | $this->lang = App::$Request->getLanguage(); |
| 56 | 56 | // get theme config and build full path |
| 57 | 57 | $themeConfig = App::$Properties->get('theme'); |
| 58 | - $this->themePath = root . DIRECTORY_SEPARATOR . 'Apps' . DIRECTORY_SEPARATOR . 'View' . DIRECTORY_SEPARATOR . env_name; |
|
| 58 | + $this->themePath = root.DIRECTORY_SEPARATOR.'Apps'.DIRECTORY_SEPARATOR.'View'.DIRECTORY_SEPARATOR.env_name; |
|
| 59 | 59 | if (isset($themeConfig[env_name]) && Str::length($themeConfig[env_name]) > 0) { |
| 60 | - $this->themePath .= DIRECTORY_SEPARATOR . $themeConfig[env_name]; |
|
| 60 | + $this->themePath .= DIRECTORY_SEPARATOR.$themeConfig[env_name]; |
|
| 61 | 61 | } else { |
| 62 | - $this->themePath .= DIRECTORY_SEPARATOR . 'default'; |
|
| 62 | + $this->themePath .= DIRECTORY_SEPARATOR.'default'; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // check if theme is available |
| 66 | 66 | if (!Directory::exist($this->themePath)) { |
| 67 | - throw new NativeException('Apps theme is not founded: ' . Str::replace(root, null, $this->themePath)); |
|
| 67 | + throw new NativeException('Apps theme is not founded: '.Str::replace(root, null, $this->themePath)); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // get input args and build class properties |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | // path still not defined? |
| 108 | 108 | if (!$path) { |
| 109 | - throw new SyntaxException('View not found: ' . App::$Security->strip_tags($path)); |
|
| 109 | + throw new SyntaxException('View not found: '.App::$Security->strip_tags($path)); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | // cleanup from slashes on start/end |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | // lets try to get full path for current theme |
| 136 | 136 | $tmpPath = $path; |
| 137 | 137 | if (!Str::startsWith($this->themePath, $path)) { |
| 138 | - $tmpPath = Normalize::diskPath($this->themePath . '/' . $path . '.php'); |
|
| 138 | + $tmpPath = Normalize::diskPath($this->themePath.'/'.$path.'.php'); |
|
| 139 | 139 | } |
| 140 | 140 | } else { // sounds like a object-depended view call from controller or etc |
| 141 | 141 | // get stack trace of callbacks |
@@ -151,14 +151,14 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | // depended controller is not founded? Let finish |
| 153 | 153 | if (!$calledController) { |
| 154 | - throw new SyntaxException('View render is failed: callback controller not founded! Call with relative path: ' . $path); |
|
| 154 | + throw new SyntaxException('View render is failed: callback controller not founded! Call with relative path: '.$path); |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // get controller name |
| 158 | - $controllerName = Str::sub($calledController, Str::length('Apps\Controller\\' . env_name . '\\')); |
|
| 158 | + $controllerName = Str::sub($calledController, Str::length('Apps\Controller\\'.env_name.'\\')); |
|
| 159 | 159 | $controllerName = Str::lowerCase($controllerName); |
| 160 | 160 | // get full path |
| 161 | - $tmpPath = $this->themePath . DIRECTORY_SEPARATOR . $controllerName . DIRECTORY_SEPARATOR . $path . '.php'; |
|
| 161 | + $tmpPath = $this->themePath.DIRECTORY_SEPARATOR.$controllerName.DIRECTORY_SEPARATOR.$path.'.php'; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | // check if builded view full path is exist |
@@ -168,11 +168,11 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | // hmm, not founded. Lets try to find in caller directory (for widgets, apps packages and other) |
| 170 | 170 | if ($source !== null) { |
| 171 | - $tmpPath = Normalize::diskPath($source . DIRECTORY_SEPARATOR . $path . '.php'); |
|
| 171 | + $tmpPath = Normalize::diskPath($source.DIRECTORY_SEPARATOR.$path.'.php'); |
|
| 172 | 172 | if (File::exist($tmpPath)) { |
| 173 | 173 | // add notify for native views |
| 174 | 174 | if (App::$Debug) { |
| 175 | - App::$Debug->addMessage('Render native viewer: ' . Str::replace(root, null, $tmpPath), 'info'); |
|
| 175 | + App::$Debug->addMessage('Render native viewer: '.Str::replace(root, null, $tmpPath), 'info'); |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | return $tmpPath; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | if (App::$Debug) { |
| 183 | - App::$Debug->addMessage('Viewer not founded on rendering: ' . $path, 'warning'); |
|
| 183 | + App::$Debug->addMessage('Viewer not founded on rendering: '.$path, 'warning'); |
|
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | return null; |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | foreach ($items as $item) { |
| 277 | 277 | $item = trim($item, '/'); |
| 278 | 278 | if (!Str::startsWith(App::$Alias->scriptUrl, $item) && !Str::startsWith('http', $item)) { // is local without proto and domain |
| 279 | - $item = App::$Alias->scriptUrl . '/' . $item; |
|
| 279 | + $item = App::$Alias->scriptUrl.'/'.$item; |
|
| 280 | 280 | } |
| 281 | 281 | $output[] = $item; |
| 282 | 282 | } |
@@ -285,9 +285,9 @@ discard block |
||
| 285 | 285 | $output = null; |
| 286 | 286 | foreach ($clear as $row) { |
| 287 | 287 | if ($type === 'css') { |
| 288 | - $output .= '<link rel="stylesheet" type="text/css" href="' . $row . '">' . "\n"; |
|
| 288 | + $output .= '<link rel="stylesheet" type="text/css" href="'.$row.'">'."\n"; |
|
| 289 | 289 | } elseif ($type === 'js') { |
| 290 | - $output .= '<script src="' . $row . '"></script>' . "\n"; |
|
| 290 | + $output .= '<script src="'.$row.'"></script>'."\n"; |
|
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | $code = null; |
| 312 | 312 | foreach (App::$Alias->getPlainCode($type) as $row) { |
| 313 | - $code .= $row . "\n"; |
|
| 313 | + $code .= $row."\n"; |
|
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | return $code; |
@@ -4,7 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Apps\ActiveRecord\App as AppRecord; |
| 6 | 6 | use Ffcms\Core\Helper\Type\Any; |
| 7 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 8 | 7 | use Ffcms\Core\Helper\Type\Str; |
| 9 | 8 | use Ffcms\Core\Interfaces\iWidget; |
| 10 | 9 | use Ffcms\Core\Traits\DynamicGlobal; |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | // check if class exist |
| 27 | 27 | if (!class_exists(self::$class)) { |
| 28 | - return 'Error: Widget is not founded: ' . self::$class; |
|
| 28 | + return 'Error: Widget is not founded: '.self::$class; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | // init class and pass properties |
@@ -5,10 +5,8 @@ |
||
| 5 | 5 | use Cassandra\Exception; |
| 6 | 6 | use DebugBar\DataCollector\ConfigCollector; |
| 7 | 7 | use DebugBar\DebugBarException; |
| 8 | -use DebugBar\StandardDebugBar; |
|
| 9 | 8 | use Ffcms\Core\App; |
| 10 | 9 | use Ffcms\Core\Helper\Type\Any; |
| 11 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 12 | 10 | |
| 13 | 11 | /** |
| 14 | 12 | * Class Debug. Provide methods of display information about debug and collected data in debug bar |
@@ -210,7 +210,7 @@ |
||
| 210 | 210 | /** |
| 211 | 211 | * Get file md5 hash |
| 212 | 212 | * @param string $path |
| 213 | - * @return bool|string |
|
| 213 | + * @return false|string |
|
| 214 | 214 | */ |
| 215 | 215 | public static function getMd5($path) |
| 216 | 216 | { |
@@ -192,15 +192,15 @@ |
||
| 192 | 192 | return []; |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | - $dir = opendir($path . '/.'); |
|
| 195 | + $dir = opendir($path.'/.'); |
|
| 196 | 196 | while ($item = readdir($dir)) { |
| 197 | - if (is_file($sub = $path . '/' . $item)) { |
|
| 197 | + if (is_file($sub = $path.'/'.$item)) { |
|
| 198 | 198 | $item_ext = Str::lastIn($item, '.'); |
| 199 | 199 | if ($ext === null || Arr::in($item_ext, $ext)) { |
| 200 | 200 | if ($returnRelative) { |
| 201 | 201 | $files[] = $item; |
| 202 | 202 | } else { |
| 203 | - $files[] = $path . DIRECTORY_SEPARATOR . $item; |
|
| 203 | + $files[] = $path.DIRECTORY_SEPARATOR.$item; |
|
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | } else { |
@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Ffcms\Core\Helper\HTML\System\NativeGenerator; |
| 8 | 8 | use Ffcms\Core\Helper\Type\Any; |
| 9 | 9 | use Ffcms\Core\Helper\Type\Arr; |
| 10 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 11 | 10 | use Ffcms\Core\Helper\Type\Str; |
| 12 | 11 | |
| 13 | 12 | class Nav extends NativeGenerator |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | } elseif ($item['type'] === 'tab') { |
| 63 | 63 | $activeObject = false; |
| 64 | 64 | $item['type'] = 'link'; // fix for global Listing builder |
| 65 | - $item['link'] = '#' . $elements['tabAnchor'] . $tabIdx; |
|
| 65 | + $item['link'] = '#'.$elements['tabAnchor'].$tabIdx; |
|
| 66 | 66 | |
| 67 | 67 | $item['property']['role'] = 'presentation'; |
| 68 | 68 | |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // mark active tab |
| 79 | 79 | if ($activeObject === true) { |
| 80 | - $item['property']['class'] .= (Str::length($item['property']['class']) > 0 ? ' ' : null) . 'active'; |
|
| 80 | + $item['property']['class'] .= (Str::length($item['property']['class']) > 0 ? ' ' : null).'active'; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | // tab special properties for bootstrap |
| 84 | - $item['linkProperty']['aria-controls'] = $elements['tabAnchor'] . $tabIdx; |
|
| 84 | + $item['linkProperty']['aria-controls'] = $elements['tabAnchor'].$tabIdx; |
|
| 85 | 85 | $item['linkProperty']['role'] = 'tab'; |
| 86 | 86 | $item['linkProperty']['data-toggle'] = 'tab'; |
| 87 | 87 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $items[] = $item; |
| 91 | 91 | |
| 92 | 92 | // draw tab content |
| 93 | - $tabContent .= $dom->div(function () use ($item, $itemContent) { |
|
| 93 | + $tabContent .= $dom->div(function() use ($item, $itemContent) { |
|
| 94 | 94 | if ($item['html'] === true) { |
| 95 | 95 | if ($item['!secure'] === true) { |
| 96 | 96 | return $itemContent; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | } else { |
| 101 | 101 | return self::nohtml($itemContent); |
| 102 | 102 | } |
| 103 | - }, ['role' => 'tabpanel', 'class' => 'tab-pane fade' . ($activeObject === true ? ' in active' : null), 'id' => $elements['tabAnchor'] . $tabIdx]); |
|
| 103 | + }, ['role' => 'tabpanel', 'class' => 'tab-pane fade'.($activeObject === true ? ' in active' : null), 'id' => $elements['tabAnchor'].$tabIdx]); |
|
| 104 | 104 | $tabIdx++; |
| 105 | 105 | } |
| 106 | 106 | } |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | // check if global class "nav" isset |
| 109 | 109 | if ($elements['property']['class'] !== null) { |
| 110 | 110 | if (!Str::contains('nav ', $elements['property']['class'])) { |
| 111 | - $elements['property']['class'] = 'nav ' . $elements['property']['class']; |
|
| 111 | + $elements['property']['class'] = 'nav '.$elements['property']['class']; |
|
| 112 | 112 | } |
| 113 | 113 | } else { |
| 114 | 114 | $elements['property']['class'] = 'nav'; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // render final output |
| 118 | - return $dom->div(function () use ($elements, $items, $tabContent, $dom) { |
|
| 118 | + return $dom->div(function() use ($elements, $items, $tabContent, $dom) { |
|
| 119 | 119 | // drow listing |
| 120 | 120 | $listing = Listing::display([ |
| 121 | 121 | 'type' => 'ul', |
@@ -128,11 +128,11 @@ discard block |
||
| 128 | 128 | $elements['tabProperty']['class'] = 'tab-content'; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - $tabContent = $dom->div(function () use ($tabContent) { |
|
| 131 | + $tabContent = $dom->div(function() use ($tabContent) { |
|
| 132 | 132 | return $tabContent; |
| 133 | 133 | }, $elements['tabProperty']); |
| 134 | 134 | } |
| 135 | - return $listing . $tabContent; |
|
| 135 | + return $listing.$tabContent; |
|
| 136 | 136 | }, $blockProperty); |
| 137 | 137 | } |
| 138 | 138 | } |
@@ -4,16 +4,11 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Ffcms\Core\App; |
| 6 | 6 | use Ffcms\Core\Arch\Model; |
| 7 | -use Ffcms\Core\Exception\NativeException; |
|
| 8 | 7 | use Ffcms\Core\Exception\SyntaxException; |
| 9 | 8 | use Ffcms\Core\Helper\FileSystem\File; |
| 10 | -use Ffcms\Core\Helper\HTML\Form\Constructor; |
|
| 11 | 9 | use Ffcms\Core\Helper\HTML\Form\FieldSelector; |
| 12 | 10 | use Ffcms\Core\Helper\HTML\System\NativeGenerator; |
| 13 | 11 | use Ffcms\Core\Helper\Type\Any; |
| 14 | -use Ffcms\Core\Helper\Type\Arr; |
|
| 15 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 16 | -use Ffcms\Core\Helper\Type\Str; |
|
| 17 | 12 | |
| 18 | 13 | /** |
| 19 | 14 | * Class Form. Simple HTML model generator for fast form building. |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | $form = self::buildSingleTag('form', $this->formProperty, false); |
| 91 | 91 | if ($this->model->_tokenRequired) { |
| 92 | - $form .= PHP_EOL . $this->field->hidden('_csrf_token', ['value' => $this->model->_csrf_token]); |
|
| 92 | + $form .= PHP_EOL.$this->field->hidden('_csrf_token', ['value' => $this->model->_csrf_token]); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | return $form; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | public function submitButton($title, array $property = []) |
| 125 | 125 | { |
| 126 | 126 | $property['type'] = 'submit'; |
| 127 | - $property['name'] = $this->name . '[submit]'; |
|
| 127 | + $property['name'] = $this->name.'[submit]'; |
|
| 128 | 128 | $property['value'] = $title; |
| 129 | 129 | return self::buildSingleTag('input', $property); |
| 130 | 130 | } |
@@ -138,10 +138,10 @@ discard block |
||
| 138 | 138 | { |
| 139 | 139 | // pre-validate form fields based on model rules and jquery.validation |
| 140 | 140 | if ($validate) { |
| 141 | - App::$Alias->addPlainCode('js', '$().ready(function() { $("#' . $this->name . '").validate(); });'); |
|
| 141 | + App::$Alias->addPlainCode('js', '$().ready(function() { $("#'.$this->name.'").validate(); });'); |
|
| 142 | 142 | App::$Alias->setCustomLibrary('js', '/vendor/bower/jquery-validation/dist/jquery.validate.min.js'); |
| 143 | 143 | if (App::$Request->getLanguage() !== 'en') { |
| 144 | - $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_' . App::$Request->getLanguage() . '.js'; |
|
| 144 | + $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_'.App::$Request->getLanguage().'.js'; |
|
| 145 | 145 | if (File::exist($localeFile)) { |
| 146 | 146 | App::$Alias->setCustomLibrary('js', $localeFile); |
| 147 | 147 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $formName = $this->model->getFormName(); |
| 153 | 153 | if (Any::isArray($badAttr) && count($badAttr) > 0) { |
| 154 | 154 | foreach ($badAttr as $attr) { |
| 155 | - $itemId = $formName . '-' . $attr; |
|
| 155 | + $itemId = $formName.'-'.$attr; |
|
| 156 | 156 | try { |
| 157 | 157 | $render = App::$View->render(static::$structLayer['jsnotify'], ['itemId' => $itemId]); |
| 158 | 158 | App::$Alias->addPlainCode('js', $render); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
| 51 | - * @param string|array $name |
|
| 51 | + * @param string $name |
|
| 52 | 52 | * @param string|array|null $value |
| 53 | 53 | * @param array|null $properties |
| 54 | 54 | * @return null|string |
@@ -4,9 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Ffcms\Core\App; |
| 6 | 6 | use Ffcms\Core\Arch\Model; |
| 7 | -use Ffcms\Core\Exception\SyntaxException; |
|
| 8 | 7 | use Ffcms\Core\Helper\Type\Any; |
| 9 | -use Ffcms\Core\Helper\Type\Obj; |
|
| 10 | 8 | use Ffcms\Core\Helper\Type\Str; |
| 11 | 9 | |
| 12 | 10 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | break; |
| 109 | 109 | default: |
| 110 | 110 | if (App::$Debug) { |
| 111 | - App::$Debug->addMessage('Field has unknown type: ' . App::$Security->strip_tags($name)); |
|
| 111 | + App::$Debug->addMessage('Field has unknown type: '.App::$Security->strip_tags($name)); |
|
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
@@ -160,12 +160,12 @@ discard block |
||
| 160 | 160 | if (Str::contains('.', $name)) { |
| 161 | 161 | $splitedName = explode('.', $name); |
| 162 | 162 | foreach ($splitedName as $nameKey) { |
| 163 | - $properties['name'] .= '[' . $nameKey . ']'; |
|
| 164 | - $properties['id'] .= '-' . $nameKey; |
|
| 163 | + $properties['name'] .= '['.$nameKey.']'; |
|
| 164 | + $properties['id'] .= '-'.$nameKey; |
|
| 165 | 165 | } |
| 166 | 166 | } else { // standard property definition - add field name |
| 167 | - $properties['name'] .= '[' . $name . ']'; |
|
| 168 | - $properties['id'] .= '-' . $name; |
|
| 167 | + $properties['name'] .= '['.$name.']'; |
|
| 168 | + $properties['id'] .= '-'.$name; |
|
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | } |