@@ -76,8 +76,8 @@ discard block |
||
76 | 76 | |
77 | 77 | // Does this element have errors ? |
78 | 78 | if (!empty($elementErrors) && !empty($inputErrorClass) && $this->layout != Form::LAYOUT_BARE) { |
79 | - $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class') . ' ' : ''); |
|
80 | - $classAttributes = $classAttributes . $inputErrorClass; |
|
79 | + $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class').' ' : ''); |
|
80 | + $classAttributes = $classAttributes.$inputErrorClass; |
|
81 | 81 | |
82 | 82 | $element->setAttribute('class', $classAttributes); |
83 | 83 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | if (!$element->hasAttribute('id')) { |
86 | 86 | $elementId = preg_replace( |
87 | 87 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
88 | - array('-' , '-', ''), |
|
88 | + array('-', '-', ''), |
|
89 | 89 | $element->getName() |
90 | 90 | ); |
91 | 91 | $element->setAttribute('id', $elementId); |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | // moved label here so we can change it in the ElementViewHelper |
134 | - $label = $element->getLabel(); |
|
134 | + $label = $element->getLabel(); |
|
135 | 135 | if (isset($label) && '' !== $label && !$element instanceof \Zend\Form\Element\Button) { |
136 | 136 | // Translate the label |
137 | 137 | if (null !== ($translator = $this->getTranslator())) { |
@@ -173,11 +173,11 @@ discard block |
||
173 | 173 | } |
174 | 174 | $element->setLabelAttributes($labelAttributes); |
175 | 175 | |
176 | - $label = $labelHelper($element,$label); |
|
176 | + $label = $labelHelper($element, $label); |
|
177 | 177 | if ($this->shouldWrap) { |
178 | 178 | $spanWidth = 12 - $labelWidth; |
179 | 179 | $elementString = sprintf( |
180 | - '<div class="col-md-%d%s" id="' . $elementId . '-span">%s</div>', |
|
180 | + '<div class="col-md-%d%s" id="'.$elementId.'-span">%s</div>', |
|
181 | 181 | $spanWidth, |
182 | 182 | $elementErrors ? " $inputErrorClass" : '', |
183 | 183 | $elementString |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ); |
190 | 190 | |
191 | 191 | } |
192 | - $markup = $label . $elementString; |
|
192 | + $markup = $label.$elementString; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | } else { |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | && !$element instanceof \Zend\Form\Element\Button |
211 | 211 | && $this->layout != Form::LAYOUT_BARE |
212 | 212 | ) { |
213 | - $markup = sprintf('<div class="controls controls-row ' . $form_row_class . '">%s</div>', $markup); |
|
213 | + $markup = sprintf('<div class="controls controls-row '.$form_row_class.'">%s</div>', $markup); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | return $markup; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | $class = $form->getAttribute('class'); |
90 | 90 | $class = preg_replace('~\bform-[^ ]+\b~', '', $class); |
91 | - $class .= ' ' . $layout; |
|
91 | + $class .= ' '.$layout; |
|
92 | 92 | |
93 | 93 | $form->setAttribute('class', $class); |
94 | 94 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | 'id', |
98 | 98 | preg_replace( |
99 | 99 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
100 | - array('-' , '-' , '' ), |
|
100 | + array('-', '-', ''), |
|
101 | 101 | $formId |
102 | 102 | ) |
103 | 103 | ); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | if (!$element->hasAttribute('id')) { |
119 | 119 | $elementId = preg_replace( |
120 | 120 | array('~[^A-Za-z0-9_-]~', '~--+~', '~^-|-$~'), |
121 | - array('-' , '-', ''), |
|
121 | + array('-', '-', ''), |
|
122 | 122 | $element->getName() |
123 | 123 | ); |
124 | 124 | $element->setAttribute('id', $elementId); |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | } |
157 | 157 | } |
158 | 158 | |
159 | - return $this->openTag($form) . $formContent . $this->closeTag(); |
|
159 | + return $this->openTag($form).$formContent.$this->closeTag(); |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | ); |
185 | 185 | |
186 | 186 | if ($desc = $form->getOption('description', '')) { |
187 | - $descriptionParams=$form->getOption('description_params'); |
|
187 | + $descriptionParams = $form->getOption('description_params'); |
|
188 | 188 | $translator = $this->getTranslator(); |
189 | 189 | $textDomain = $this->getTranslatorTextDomain(); |
190 | 190 | $desc = $translator->translate($desc, $textDomain); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $desc |
206 | 206 | ); |
207 | 207 | } else { |
208 | - $formContent = '<div class="form-content">' . $formContent . '</div>'; |
|
208 | + $formContent = '<div class="form-content">'.$formContent.'</div>'; |
|
209 | 209 | } |
210 | 210 | |
211 | 211 | $markup = '<div id="form-%s" class="form-container">' |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | . '</div>'; |
215 | 215 | |
216 | 216 | if ($label = $form->getLabel()) { |
217 | - $label = '<div class="form-headline"><h3>' . $renderer->translate($label) . '</h3></div>'; |
|
217 | + $label = '<div class="form-headline"><h3>'.$renderer->translate($label).'</h3></div>'; |
|
218 | 218 | } |
219 | 219 | |
220 | 220 | return sprintf( |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @var string |
28 | 28 | */ |
29 | - protected $language="de"; |
|
29 | + protected $language = "de"; |
|
30 | 30 | |
31 | 31 | public function __invoke(ElementInterface $element = null) |
32 | 32 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /* |
61 | 61 | * |
62 | 62 | */ |
63 | - $markup = '<div class="input-group date">%s<div data-toggle="description" data-target="%s" class="input-group-addon" onClick="$(this).parent().find(\':input\').datepicker(\'show\')">' . |
|
63 | + $markup = '<div class="input-group date">%s<div data-toggle="description" data-target="%s" class="input-group-addon" onClick="$(this).parent().find(\':input\').datepicker(\'show\')">'. |
|
64 | 64 | '<i class="fa fa-calendar"></i></div></div><div class="checkbox"></div>'; |
65 | 65 | |
66 | 66 | $markup = sprintf( |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | if ($headline) { |
37 | - $headline = '<h6>' . $translator->translate($headline, $textDomain) . '</h6>'; |
|
37 | + $headline = '<h6>'.$translator->translate($headline, $textDomain).'</h6>'; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $markup = '<div class="checkbox"><label for="%s">%s %s</label></div>'; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $label |
47 | 47 | ); |
48 | 48 | |
49 | - return $headline . $markup; |
|
49 | + return $headline.$markup; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -44,26 +44,26 @@ discard block |
||
44 | 44 | $href = $this->getView()->url($route, $params, true); |
45 | 45 | } else { |
46 | 46 | /*@todo add more options like providing url... */ |
47 | - $href=""; |
|
47 | + $href = ""; |
|
48 | 48 | } |
49 | 49 | $linktext = $translator->translate($linktext); |
50 | - $link = '<a data-toggle="modal" href="' . $href . '" ' |
|
51 | - . 'data-target="#modal-' . $element->getAttribute('id') . '">' |
|
52 | - . $linktext . '</a>'; |
|
50 | + $link = '<a data-toggle="modal" href="'.$href.'" ' |
|
51 | + . 'data-target="#modal-'.$element->getAttribute('id').'">' |
|
52 | + . $linktext.'</a>'; |
|
53 | 53 | |
54 | 54 | $label = sprintf($label, $link); |
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
58 | 58 | if ($headline) { |
59 | - $headline = '<h6>' . $translator->translate($headline, $textDomain) . '</h6>'; |
|
59 | + $headline = '<h6>'.$translator->translate($headline, $textDomain).'</h6>'; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $markup = ' |
63 | 63 | <div class="checkbox"> |
64 | 64 | <label for="%s">%s %s</label> |
65 | 65 | </div> |
66 | - <div class="modal fade modal-scrollable" id="modal-' . $element->getAttribute('id') . '" tabindex="-1" role="dialog" aria-labelledby="label-search-user" aria-hidden="true"> |
|
66 | + <div class="modal fade modal-scrollable" id="modal-' . $element->getAttribute('id').'" tabindex="-1" role="dialog" aria-labelledby="label-search-user" aria-hidden="true"> |
|
67 | 67 | <div class="modal-dialog modal-lg"> |
68 | 68 | <div class="modal-content"> |
69 | 69 | </div> |
@@ -77,6 +77,6 @@ discard block |
||
77 | 77 | $label |
78 | 78 | ); |
79 | 79 | |
80 | - return $headline . $markup; |
|
80 | + return $headline.$markup; |
|
81 | 81 | } |
82 | 82 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * |
44 | 44 | * @var string |
45 | 45 | */ |
46 | - protected $language="de"; |
|
46 | + protected $language = "de"; |
|
47 | 47 | |
48 | 48 | /** |
49 | 49 | * @var |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function render(ElementInterface $element) |
59 | 59 | { |
60 | - $name = $element->getName(); |
|
60 | + $name = $element->getName(); |
|
61 | 61 | if (empty($name) && $name !== 0) { |
62 | 62 | throw new \DomainException( |
63 | 63 | sprintf( |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | $headscript->prependFile($basepath('js/jquery.min.js')); |
79 | 79 | |
80 | 80 | $headscript->offsetSetScript( |
81 | - '1000_tinymce_' . $this->getTheme(), |
|
81 | + '1000_tinymce_'.$this->getTheme(), |
|
82 | 82 | ' |
83 | 83 | $(document).ready(function() { |
84 | - tinyMCE.init({' . $this->additionalOptions() . ', |
|
84 | + tinyMCE.init({' . $this->additionalOptions().', |
|
85 | 85 | setup: function(editor) { |
86 | 86 | setPlaceHolder = function(editor, show) { |
87 | 87 | placeHolder = $("#placeholder-" + editor.id); |
@@ -127,15 +127,15 @@ discard block |
||
127 | 127 | } |
128 | 128 | if (is_string($content)) { |
129 | 129 | |
130 | - $class = array_key_exists('class', $attributes)?$attributes['class']:''; |
|
131 | - $class .= (empty($class)?:' ') . ' tinymce_' . $this->getTheme(); |
|
130 | + $class = array_key_exists('class', $attributes) ? $attributes['class'] : ''; |
|
131 | + $class .= (empty($class) ?: ' ').' tinymce_'.$this->getTheme(); |
|
132 | 132 | $attributes['class'] = $class; |
133 | 133 | $placeHolder = ''; |
134 | 134 | $elementOptions = $element->getOptions(); |
135 | 135 | if (array_key_exists('placeholder', $elementOptions) && !empty($elementOptions['placeholder'])) { |
136 | - $placeHolder = '<div id="placeholder-' . $name . '" style="border: 0 none; position: relative; top: 0ex; left: 10px; color: #aaa; height: 0px; overflow: visible;' . |
|
137 | - (empty($content)?'':'display:none;') . |
|
138 | - '">' . $this->translator->translate($elementOptions['placeholder']) . '</div>'; |
|
136 | + $placeHolder = '<div id="placeholder-'.$name.'" style="border: 0 none; position: relative; top: 0ex; left: 10px; color: #aaa; height: 0px; overflow: visible;'. |
|
137 | + (empty($content) ? '' : 'display:none;'). |
|
138 | + '">'.$this->translator->translate($elementOptions['placeholder']).'</div>'; |
|
139 | 139 | } |
140 | 140 | return |
141 | 141 | $placeHolder |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | |
163 | 163 | protected function additionalOptions() |
164 | 164 | { |
165 | - $str = json_encode($this->options, ~JSON_HEX_QUOT & ~JSON_FORCE_OBJECT ); |
|
166 | - $str = preg_replace('/"([a-zA-Z_]+[a-zA-Z0-9_]*)":/','$1:',$str); |
|
167 | - return trim($str,'{}'); |
|
165 | + $str = json_encode($this->options, ~JSON_HEX_QUOT & ~JSON_FORCE_OBJECT); |
|
166 | + $str = preg_replace('/"([a-zA-Z_]+[a-zA-Z0-9_]*)":/', '$1:', $str); |
|
167 | + return trim($str, '{}'); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @param $language |
174 | 174 | */ |
175 | 175 | public function setLanguage($language) { |
176 | - $this->language=$language; |
|
176 | + $this->language = $language; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | * @param $languagePath |
183 | 183 | */ |
184 | 184 | public function setLanguagePath($languagePath) { |
185 | - $this->languagePath=$languagePath; |
|
185 | + $this->languagePath = $languagePath; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -191,14 +191,14 @@ discard block |
||
191 | 191 | * @param $name |
192 | 192 | * @param $value |
193 | 193 | */ |
194 | - public function setOption($name,$value){ |
|
194 | + public function setOption($name, $value) { |
|
195 | 195 | if (array_key_exists($name, $this->options)) { |
196 | 196 | $this->options[$name] = $value; |
197 | - }elseif ('language' == $name or 'language_url' == $name ) { |
|
197 | + }elseif ('language' == $name or 'language_url' == $name) { |
|
198 | 198 | $this->options[$name] = $value; |
199 | 199 | |
200 | - }else{ |
|
201 | - throw new \InvalidArgumentException('Unknown Option ' . $name . ' in ' . __FILE__ . ' Line ' . __LINE__ ); |
|
200 | + } else { |
|
201 | + throw new \InvalidArgumentException('Unknown Option '.$name.' in '.__FILE__.' Line '.__LINE__); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function setOptions($options) |
211 | 211 | { |
212 | - foreach($options as $key => $val) { |
|
212 | + foreach ($options as $key => $val) { |
|
213 | 213 | $this->setOption($key, $val); |
214 | 214 | } |
215 | 215 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | use Zend\Form\ElementInterface; |
16 | 16 | use Zend\Form\Exception; |
17 | 17 | |
18 | -class RequiredMarkInFormLabel extends FormLabel{ |
|
18 | +class RequiredMarkInFormLabel extends FormLabel { |
|
19 | 19 | public function __invoke(ElementInterface $element = null, $labelContent = null, $position = null) |
20 | 20 | { |
21 | 21 | // Set $required to a default of true | existing elements required-value |
@@ -28,6 +28,6 @@ discard block |
||
28 | 28 | ); |
29 | 29 | } |
30 | 30 | |
31 | - return $this->openTag($element) . $labelContent . $this->closeTag(); |
|
31 | + return $this->openTag($element).$labelContent.$this->closeTag(); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | \ No newline at end of file |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | |
64 | 64 | return sprintf( |
65 | - '<div class="controls controls-row ' . $form_row_class . '">%s%s</div>', |
|
65 | + '<div class="controls controls-row '.$form_row_class.'">%s%s</div>', |
|
66 | 66 | $labelMarkup, |
67 | 67 | $markups |
68 | 68 | ); |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | |
45 | 45 | // Does this element have errors ? |
46 | 46 | if (count($element->getMessages()) > 0 && !empty($inputErrorClass)) { |
47 | - $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class') . ' ' : ''); |
|
48 | - $classAttributes = $classAttributes . $inputErrorClass; |
|
47 | + $classAttributes = ($element->hasAttribute('class') ? $element->getAttribute('class').' ' : ''); |
|
48 | + $classAttributes = $classAttributes.$inputErrorClass; |
|
49 | 49 | |
50 | 50 | $element->setAttribute('class', $classAttributes); |
51 | 51 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | if ($label !== '' && !$element->hasAttribute('id')) { |
99 | - $label = '<span>' . $label . '</span>'; |
|
99 | + $label = '<span>'.$label.'</span>'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | // Button element is a special case, because label is always rendered inside it |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | |
107 | 107 | switch ($this->labelPosition) { |
108 | 108 | case self::LABEL_PREPEND: |
109 | - $markup = $labelOpen . $label . $elementString . $labelClose; |
|
109 | + $markup = $labelOpen.$label.$elementString.$labelClose; |
|
110 | 110 | break; |
111 | 111 | case self::LABEL_APPEND: |
112 | 112 | default: |
113 | - $markup = $labelOpen . $elementString . $label . $labelClose; |
|
113 | + $markup = $labelOpen.$elementString.$label.$labelClose; |
|
114 | 114 | break; |
115 | 115 | } |
116 | 116 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | } |
121 | 121 | } else { |
122 | 122 | if (!empty($this->renderErrors)) { |
123 | - $markup = $elementString . $elementErrors; |
|
123 | + $markup = $elementString.$elementErrors; |
|
124 | 124 | } else { |
125 | 125 | $markup = $elementString; |
126 | 126 | } |