Completed
Push — develop ( 3f3474...3fec75 )
by
unknown
06:42
created
module/Core/src/Core/Form/View/Helper/FormEditor.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
78 78
         $headscript->prependFile($basepath('/assets/jquery/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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.