@@ -2,7 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Ffcms\Core\Helper\HTML\Bootstrap; |
4 | 4 | |
5 | -use Ffcms\Core\App; |
|
6 | 5 | use Ffcms\Core\Helper\Type\Arr; |
7 | 6 | use Ffcms\Core\Helper\HTML\Listing; |
8 | 7 | use Ffcms\Core\Helper\Type\Obj; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $form = self::buildSingleTag('form', $this->formProperty, false); |
83 | 83 | if ($this->model->_tokenRequired) { |
84 | - $form .= PHP_EOL . $this->field('_csrf_token', 'hidden', ['value' => $this->model->_csrf_token]); |
|
84 | + $form .= PHP_EOL.$this->field('_csrf_token', 'hidden', ['value' => $this->model->_csrf_token]); |
|
85 | 85 | } |
86 | 86 | return $form; |
87 | 87 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | { |
102 | 102 | if ($this->model === null) { |
103 | 103 | if (App::$Debug !== null) { |
104 | - App::$Debug->addMessage('Form model is not defined for field name: [' . strip_tags($object) . ']'); |
|
104 | + App::$Debug->addMessage('Form model is not defined for field name: ['.strip_tags($object).']'); |
|
105 | 105 | } |
106 | 106 | return null; |
107 | 107 | } |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | // check if model contains current tag name as property |
116 | 116 | if (!property_exists($this->model, $propertyName)) { |
117 | 117 | if (App::$Debug !== null) { |
118 | - App::$Debug->addMessage('Form field ["' . $object . '"] is not defined in model: [' . get_class($this->model) . ']', 'error'); |
|
118 | + App::$Debug->addMessage('Form field ["'.$object.'"] is not defined in model: ['.get_class($this->model).']', 'error'); |
|
119 | 119 | } |
120 | 120 | return null; |
121 | 121 | } |
@@ -136,13 +136,13 @@ discard block |
||
136 | 136 | } |
137 | 137 | |
138 | 138 | // prepare labels text and label "for" attr |
139 | - $labelFor = $this->name . '-' . $propertyName; |
|
139 | + $labelFor = $this->name.'-'.$propertyName; |
|
140 | 140 | $labelText = $this->model->getLabel($object); |
141 | 141 | $itemValue = $this->model->{$propertyName}; |
142 | 142 | // sounds like a dot-separated $object |
143 | 143 | if ($propertyName !== $object) { |
144 | 144 | $nesting = trim(strstr($object, '.'), '.'); |
145 | - $labelFor .= '-' . Str::replace('.', '-', $nesting); |
|
145 | + $labelFor .= '-'.Str::replace('.', '-', $nesting); |
|
146 | 146 | $itemValue = Arr::getByPath($nesting, $itemValue); |
147 | 147 | } |
148 | 148 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | public function submitButton($title, array $property = []) |
174 | 174 | { |
175 | 175 | $property['type'] = 'submit'; |
176 | - $property['name'] = $this->name . '[submit]'; |
|
176 | + $property['name'] = $this->name.'[submit]'; |
|
177 | 177 | $property['value'] = $title; |
178 | 178 | return self::buildSingleTag('input', $property); |
179 | 179 | } |
@@ -187,10 +187,10 @@ discard block |
||
187 | 187 | { |
188 | 188 | // pre-validate form fields based on model rules and jquery.validation |
189 | 189 | if ($validate) { |
190 | - App::$Alias->addPlainCode('js', '$().ready(function() { $("#' . $this->name . '").validate(); });'); |
|
190 | + App::$Alias->addPlainCode('js', '$().ready(function() { $("#'.$this->name.'").validate(); });'); |
|
191 | 191 | App::$Alias->setCustomLibrary('js', '/vendor/bower/jquery-validation/dist/jquery.validate.min.js'); |
192 | 192 | if (App::$Request->getLanguage() !== 'en') { |
193 | - $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_' . App::$Request->getLanguage() . '.js'; |
|
193 | + $localeFile = '/vendor/bower/jquery-validation/src/localization/messages_'.App::$Request->getLanguage().'.js'; |
|
194 | 194 | if (File::exist($localeFile)) { |
195 | 195 | App::$Alias->setCustomLibrary('js', $localeFile); |
196 | 196 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $formName = $this->model->getFormName(); |
202 | 202 | if (Obj::isArray($badAttr) && count($badAttr) > 0) { |
203 | 203 | foreach ($badAttr as $attr) { |
204 | - $itemId = $formName . '-' . $attr; |
|
204 | + $itemId = $formName.'-'.$attr; |
|
205 | 205 | $render = App::$View->render(static::$structLayer['jsnotify'], ['itemId' => $itemId]); |
206 | 206 | App::$Alias->addPlainCode('js', $render); |
207 | 207 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $purifier = App::$Memory->get('object.purifier.helpers'); |
25 | 25 | } else { |
26 | 26 | $config = \HTMLPurifier_Config::createDefault(); |
27 | - $config->set('Cache.SerializerPath', root . '/Private/Cache/HTMLPurifier/'); |
|
27 | + $config->set('Cache.SerializerPath', root.'/Private/Cache/HTMLPurifier/'); |
|
28 | 28 | $config->set('AutoFormat.AutoParagraph', false); |
29 | 29 | |
30 | 30 | // allow use target=_blank for links |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | $build = null; |
65 | 65 | foreach ($property as $p => $v) { |
66 | 66 | if ($v === null || $v === false || $v === true) { |
67 | - $build .= ' ' . self::nohtml($p); |
|
67 | + $build .= ' '.self::nohtml($p); |
|
68 | 68 | } else { |
69 | - $build .= ' ' . self::nohtml($p) . '="' . self::nohtml($v) . '"'; |
|
69 | + $build .= ' '.self::nohtml($p).'="'.self::nohtml($v).'"'; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | return $build; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public static function buildSingleTag($tagName, array $property = null, $closeSlash = true) |
83 | 83 | { |
84 | - return '<' . self::nohtml($tagName) . self::applyProperty($property) . ($closeSlash ? '/>' : '>'); |
|
84 | + return '<'.self::nohtml($tagName).self::applyProperty($property).($closeSlash ? '/>' : '>'); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $value = self::nohtml($value); |
100 | 100 | } |
101 | 101 | |
102 | - return '<' . $tagName . self::applyProperty($property) . '>' . $value . '</' . $tagName . '>'; |
|
102 | + return '<'.$tagName.self::applyProperty($property).'>'.$value.'</'.$tagName.'>'; |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -141,15 +141,15 @@ discard block |
||
141 | 141 | if (!Str::contains('/', $elementPoint) || count($elementArray) < 2) { |
142 | 142 | $active = $elementPoint === $currentPoint; |
143 | 143 | } else { |
144 | - $elementPoint = $elementArray[0] . '/' . $elementArray[1]; |
|
144 | + $elementPoint = $elementArray[0].'/'.$elementArray[1]; |
|
145 | 145 | $active = Str::startsWith($elementPoint, $currentPoint); |
146 | 146 | } |
147 | 147 | break; |
148 | 148 | case 'id': |
149 | 149 | $elementArray = explode('/', $elementPoint); |
150 | - $elementPoint = $elementArray[0] . '/' . $elementArray[1]; |
|
150 | + $elementPoint = $elementArray[0].'/'.$elementArray[1]; |
|
151 | 151 | if (null !== $elementArray[2]) { |
152 | - $elementPoint .= '/' . $elementArray[2]; |
|
152 | + $elementPoint .= '/'.$elementArray[2]; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | $active = Str::startsWith($elementPoint, $currentPoint); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public static function convertLink($uri) |
207 | 207 | { |
208 | - $link = App::$Alias->baseUrl . '/'; |
|
208 | + $link = App::$Alias->baseUrl.'/'; |
|
209 | 209 | if (Obj::isArray($uri)) { |
210 | 210 | $link .= Url::buildPathway($uri); |
211 | 211 | } elseif (Str::startsWith('http', $uri)) { |