Passed
Pull Request — master (#585)
by
unknown
17:41
created
htdocs/class/xoopseditor/tinymce4/editor_registry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php

/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license             GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Taiwen Jiang <[email protected]>
 * @version         $Id: editor_registry.php 8066 2011-11-06 05:09:33Z beckmi $
 */

return $config = array(
        "name"      =>  "tinymce4",
        "class"     =>  "XoopsFormTinymce4",
        "file"      =>  \XoopsBaseConfig::get('root-path') . "/class/xoopseditor/tinymce4/formtinymce.php",
        "title"     =>  _XOOPS_EDITOR_TINYMCE4,
        "order"     =>  5,
        "nohtml"    =>  0
    );
2 1
\ No newline at end of file
2
+<?php

/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license             GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Taiwen Jiang <[email protected]>
 * @version         $Id: editor_registry.php 8066 2011-11-06 05:09:33Z beckmi $
 */

return $config = array("name"      =>  "tinymce4", "class"     =>  "XoopsFormTinymce4", "file"      =>  \XoopsBaseConfig::get('root-path')."/class/xoopseditor/tinymce4/formtinymce.php", "title"     =>  _XOOPS_EDITOR_TINYMCE4, "order"     =>  5, "nohtml"    =>  0);
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/include/xoopsimagemanager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@
 block discarded – undo
15 15
  */
16 16
 
17 17
 // check categories readability by group
18
-$groups = is_object($GLOBALS["xoopsUser"]) ? $GLOBALS["xoopsUser"]->getGroups() : array(FixedGroups::ANONYMOUS );
19
-$imgcat_handler =& xoops_getHandler('imagecategory');
18
+$groups = is_object($GLOBALS["xoopsUser"]) ? $GLOBALS["xoopsUser"]->getGroups() : array(FixedGroups::ANONYMOUS);
19
+$imgcat_handler = & xoops_getHandler('imagecategory');
20 20
 if (count($imgcat_handler->getList($groups, 'imgcat_read', 1)) == 0) {
21 21
     return false;
22 22
 }
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/include/xoopsmlcontent.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php

/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Laurent JEN <[email protected]>
 * @version         $Id: xoopsmlcontent.php 8066 2011-11-06 05:09:33Z beckmi $
 */

// Xlanguage
if ( $GLOBALS["module_handler"]->getByDirname("xlanguage") && defined("XLANGUAGE_LANG_TAG") ) {
    return true;
}

// Easiest Multi-Language Hack (EMLH)
if ( defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES') ) {
    return true;
}

return false;
2 1
\ No newline at end of file
2
+<?php

/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Laurent JEN <[email protected]>
 * @version         $Id: xoopsmlcontent.php 8066 2011-11-06 05:09:33Z beckmi $
 */

// Xlanguage
if ($GLOBALS["module_handler"]->getByDirname("xlanguage") && defined("XLANGUAGE_LANG_TAG")) {
    return true; }

// Easiest Multi-Language Hack (EMLH)
if (defined('EASIESTML_LANGS') && defined('EASIESTML_LANGNAMES')) {
    return true; }

return false;
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/include/xoopsemotions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,1 +1,1 @@
 block discarded – undo
1
-<?php
/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Laurent JEN <[email protected]>
 * @version         $Id: xoopsemotions.php 8066 2011-11-06 05:09:33Z beckmi $
 */

include_once \XoopsBaseConfig::get('root-path') . "/modules/system/constants.php";
// Add your code here to check acces by groups
return true;
2 1
\ No newline at end of file
2
+<?php
/**
 *  TinyMCE adapter for XOOPS
 *
 * @copyright       XOOPS Project (http://xoops.org)
 * @license         GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
 * @package         class
 * @subpackage      editor
 * @since           2.3.0
 * @author          Laurent JEN <[email protected]>
 * @version         $Id: xoopsemotions.php 8066 2011-11-06 05:09:33Z beckmi $
 */

include_once \XoopsBaseConfig::get('root-path')."/modules/system/constants.php"; // Add your code here to check acces by groups
return true;
3 3
\ No newline at end of file
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/language/english.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,12 +14,12 @@
 block discarded – undo
14 14
  * Assocated with editor_registry.php
15 15
  */
16 16
 // Name of the editor
17
-define("_XOOPS_EDITOR_TINYMCE4","TinyMCE4");
17
+define("_XOOPS_EDITOR_TINYMCE4", "TinyMCE4");
18 18
 
19 19
 // The value must be the same as /tinymce/jscripts/langs/your_language_code, for example, "en" for English, "fr" for French
20 20
 // For details, check http://tinymce.moxiecode.com/download_i18n.php
21
-define("_XOOPS_EDITOR_TINYMCE4_LANGUAGE","en");
21
+define("_XOOPS_EDITOR_TINYMCE4_LANGUAGE", "en");
22 22
 
23 23
 // FONT LIST, FORMAT: "Name=value1,value2;Name=value"
24 24
 
25
-define("_XOOPS_EDITOR_TINYMCE4_FONTS","Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings");
25
+define("_XOOPS_EDITOR_TINYMCE4_FONTS", "Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings");
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/language/french.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,11 +14,11 @@
 block discarded – undo
14 14
  * Assocated with editor_registry.php
15 15
  */
16 16
 // Name of the editor
17
-define("_XOOPS_EDITOR_TINYMCE4","TinyMCE4");
17
+define("_XOOPS_EDITOR_TINYMCE4", "TinyMCE4");
18 18
 
19 19
 // The value must be the same as /tinymce/jscripts/langs/your_language_code, for example, "en" for English, "fr" for French
20 20
 // For details, check http://tinymce.moxiecode.com/download_i18n.php
21
-define("_XOOPS_EDITOR_TINYMCE4_LANGUAGE","fr_FR");
21
+define("_XOOPS_EDITOR_TINYMCE4_LANGUAGE", "fr_FR");
22 22
 
23 23
 // FONT LIST, FORMAT: "Name=value1,value2;Name=value"
24
-define("_XOOPS_EDITOR_TINYMCE4_FONTS","Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings");
24
+define("_XOOPS_EDITOR_TINYMCE4_FONTS", "Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings");
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/tinymce4/tinymce.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -216,10 +216,10 @@
 block discarded – undo
216 216
     }
217 217
 
218 218
     /**
219
-      * loadPlugins - load all plugins execpt the plugins in setting["exclude_plugins"]
220
-      *
221
-      * @return array plugins
222
-      */
219
+     * loadPlugins - load all plugins execpt the plugins in setting["exclude_plugins"]
220
+     *
221
+     * @return array plugins
222
+     */
223 223
     public function loadPlugins()
224 224
     {
225 225
         $plugins = array();
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function __construct($config)
38 38
     {
39 39
         $this->setConfig($config);
40
-        $this->rootpath = $this->config["rootpath"] . "/tinymce/js/tinymce";
40
+        $this->rootpath = $this->config["rootpath"]."/tinymce/js/tinymce";
41 41
     }
42 42
 
43 43
     /**
@@ -80,11 +80,11 @@  discard block
 block discarded – undo
80 80
 
81 81
         // Load default settings
82 82
         if (!($this->setting = @include($GLOBALS['xoops']->path("var/configs/tinymce.php")))) {
83
-            $this->setting = include __DIR__ . "/settings.php";
83
+            $this->setting = include __DIR__."/settings.php";
84 84
         }
85 85
 
86 86
         // get editor language (from ...)
87
-        if (is_readable(\XoopsBaseConfig::get('root-path') . $this->rootpath . '/langs/' . $this->config["language"] . '.js')) {
87
+        if (is_readable(\XoopsBaseConfig::get('root-path').$this->rootpath.'/langs/'.$this->config["language"].'.js')) {
88 88
             $this->setting["language"] = $this->config["language"];
89 89
             $configured[] = "language";
90 90
         }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         $configured[] = "content_css";
94 94
 
95 95
         if (!empty($this->config["theme"])
96
-            && is_dir(\XoopsBaseConfig::get('root-path') . $this->rootpath . "/themes/" . $this->config["theme"])
96
+            && is_dir(\XoopsBaseConfig::get('root-path').$this->rootpath."/themes/".$this->config["theme"])
97 97
         ) {
98 98
             $this->setting["theme"] = $this->config["theme"];
99 99
             $configured[] = "theme";
@@ -127,63 +127,63 @@  discard block
 block discarded – undo
127 127
             foreach ($this->config["buttons"] as $button) {
128 128
                 $i++;
129 129
                 if (isset($button["before"])) {
130
-                    $this->setting["theme_" . $this->setting["theme"] . "_buttons{$i}_add_before"] = $button["before"];
130
+                    $this->setting["theme_".$this->setting["theme"]."_buttons{$i}_add_before"] = $button["before"];
131 131
                 }
132 132
                 if (isset($button["add"])) {
133
-                    $this->setting["theme_" . $this->setting["theme"] . "_buttons{$i}_add"] = $button["add"];
133
+                    $this->setting["theme_".$this->setting["theme"]."_buttons{$i}_add"] = $button["add"];
134 134
                 }
135 135
                 if (isset($button[""])) {
136
-                    $this->setting["theme_" . $this->setting["theme"] . "_buttons{$i}"] = $button[""];
136
+                    $this->setting["theme_".$this->setting["theme"]."_buttons{$i}"] = $button[""];
137 137
                 }
138 138
             }
139 139
             $configured[] = "buttons";
140 140
 
141 141
             if (isset($this->config["toolbar_location"])) {
142
-                $this->setting["theme_" . $this->setting["theme"] . "_toolbar_location"]
142
+                $this->setting["theme_".$this->setting["theme"]."_toolbar_location"]
143 143
                     = $this->config["toolbar_location"];
144 144
                 $configured[] = "toolbar_location";
145 145
             } else {
146
-                $this->setting["theme_" . $this->setting["theme"] . "_toolbar_location"] = "top";
146
+                $this->setting["theme_".$this->setting["theme"]."_toolbar_location"] = "top";
147 147
             }
148 148
 
149 149
             if (isset($this->config["toolbar_align"])) {
150
-                $this->setting["theme_" . $this->setting["theme"] . "_toolbar_align"] = $this->config["toolbar_align"];
150
+                $this->setting["theme_".$this->setting["theme"]."_toolbar_align"] = $this->config["toolbar_align"];
151 151
                 $configured[] = "toolbar_align";
152 152
             } else {
153
-                $this->setting["theme_" . $this->setting["theme"] . "_toolbar_align"] = "left";
153
+                $this->setting["theme_".$this->setting["theme"]."_toolbar_align"] = "left";
154 154
             }
155 155
 
156 156
             if (isset($this->config["statusbar_location"])) {
157
-                $this->setting["theme_" . $this->setting["theme"] . "_statusbar_location"]
157
+                $this->setting["theme_".$this->setting["theme"]."_statusbar_location"]
158 158
                     = $this->config["statusbar_location"];
159 159
                 $configured[] = "statusbar_location";
160 160
             }
161 161
 
162 162
             if (isset($this->config["path_location"])) {
163
-                $this->setting["theme_" . $this->setting["theme"] . "_path_location"] = $this->config["path_location"];
163
+                $this->setting["theme_".$this->setting["theme"]."_path_location"] = $this->config["path_location"];
164 164
                 $configured[] = "path_location";
165 165
             }
166 166
 
167 167
             if (isset($this->config["resize_horizontal"])) {
168
-                $this->setting["theme_" . $this->setting["theme"] . "_resize_horizontal"]
168
+                $this->setting["theme_".$this->setting["theme"]."_resize_horizontal"]
169 169
                     = $this->config["resize_horizontal"];
170 170
                 $configured[] = "resize_horizontal";
171 171
             }
172 172
 
173 173
             if (isset($this->config["resizing"])) {
174
-                $this->setting["theme_" . $this->setting["theme"] . "_resizing"] = $this->config["resizing"];
174
+                $this->setting["theme_".$this->setting["theme"]."_resizing"] = $this->config["resizing"];
175 175
                 $configured[] = "resizing";
176 176
             }
177 177
 
178 178
             if (!empty($this->config["fonts"])) {
179
-                $this->setting["theme_" . $this->setting["theme"] . "_fonts"] = $this->config["fonts"];
179
+                $this->setting["theme_".$this->setting["theme"]."_fonts"] = $this->config["fonts"];
180 180
                 $configured[] = "fonts";
181 181
             }
182 182
 
183
-            for ($i=1; $i <= 4; $i++) {
183
+            for ($i = 1; $i <= 4; $i++) {
184 184
                 $buttons = array();
185
-                if (isset($this->setting["theme_" . $this->setting["theme"] . "_buttons{$i}"])) {
186
-                    $checklist = explode(",", $this->setting["theme_" . $this->setting["theme"] . "_buttons{$i}"]);
185
+                if (isset($this->setting["theme_".$this->setting["theme"]."_buttons{$i}"])) {
186
+                    $checklist = explode(",", $this->setting["theme_".$this->setting["theme"]."_buttons{$i}"]);
187 187
                     foreach ($checklist as $plugin) {
188 188
                         if (strpos(strtolower($plugin), "xoops") !== false) {
189 189
                             if (in_array($plugin, $this->xoopsPlugins)) {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
                             $buttons[] = $plugin;
194 194
                         }
195 195
                     }
196
-                    $this->setting["theme_" . $this->setting["theme"] . "_buttons{$i}"] = implode(",", $buttons);
196
+                    $this->setting["theme_".$this->setting["theme"]."_buttons{$i}"] = implode(",", $buttons);
197 197
                 }
198 198
             }
199 199
         }
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             $this->setting[$key] = $val;
207 207
         }
208 208
 
209
-        if (!is_dir(\XoopsBaseConfig::get('root-path') . $this->rootpath . "/themes/" . $this->setting["theme"] . '/docs/' . $this->setting["language"] . '/')) {
209
+        if (!is_dir(\XoopsBaseConfig::get('root-path').$this->rootpath."/themes/".$this->setting["theme"].'/docs/'.$this->setting["language"].'/')) {
210 210
             $this->setting["docs_language"] = "en";
211 211
         }
212 212
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     public function loadPlugins()
224 224
     {
225 225
         $plugins = array();
226
-        $plugins_list = XoopsLists::getDirListAsArray(\XoopsBaseConfig::get('root-path') . $this->rootpath . "/plugins");
226
+        $plugins_list = XoopsLists::getDirListAsArray(\XoopsBaseConfig::get('root-path').$this->rootpath."/plugins");
227 227
         if (empty($this->setting["plugins"])) {
228 228
             $plugins = $plugins_list;
229 229
         } else {
@@ -248,11 +248,11 @@  discard block
 block discarded – undo
248 248
     {
249 249
         $xoopsPlugins = array();
250 250
         $xoops_root_path = \XoopsBaseConfig::get('root-path');
251
-        $allplugins = XoopsLists::getDirListAsArray ($xoops_root_path . $this->rootpath . "/plugins");
251
+        $allplugins = XoopsLists::getDirListAsArray($xoops_root_path.$this->rootpath."/plugins");
252 252
         foreach ($allplugins as $plugin) {
253 253
             if (strpos(strtolower($plugin), "xoops") !== false
254
-                && file_exists($xoops_root_path . $this->config["rootpath"] . "/include/$plugin.php")) {
255
-                if ($right = @include $xoops_root_path . $this->config["rootpath"] . "/include/$plugin.php") {
254
+                && file_exists($xoops_root_path.$this->config["rootpath"]."/include/$plugin.php")) {
255
+                if ($right = @include $xoops_root_path.$this->config["rootpath"]."/include/$plugin.php") {
256 256
                     $xoopsPlugins[$plugin] = $plugin;
257 257
                 }
258 258
             }
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
         }
272 272
 
273 273
         $css = array();
274
-        $css[] = $css_url . '/' . $css_file;
275
-        $css_content = file_get_contents($css_path . '/' . $css_file);
274
+        $css[] = $css_url.'/'.$css_file;
275
+        $css_content = file_get_contents($css_path.'/'.$css_file);
276 276
 
277 277
         // get all import css files
278 278
         if (preg_match_all("~\@import url\((.*\.css)\);~sUi", $css_content, $matches, PREG_PATTERN_ORDER)) {
@@ -307,15 +307,15 @@  discard block
 block discarded – undo
307 307
             $callback = "";
308 308
         }
309 309
 
310
-        $ret = '<script language="javascript" type="text/javascript" src="' . \XoopsBaseConfig::get('url') . $this->rootpath . '/tinymce.min.js"></script>';
310
+        $ret = '<script language="javascript" type="text/javascript" src="'.\XoopsBaseConfig::get('url').$this->rootpath.'/tinymce.min.js"></script>';
311 311
         $ret .= '<script language="javascript" type="text/javascript">
312 312
                 tinyMCE.init({
313 313
             ';
314 314
 
315 315
         foreach ($this->setting as $key => $val) {
316
-            $ret .= $key . ":";
316
+            $ret .= $key.":";
317 317
             if ($val === true) {
318
-                $ret.= "true,";
318
+                $ret .= "true,";
319 319
             } elseif ($val === false) {
320 320
                 $ret .= "false,";
321 321
             } else {
@@ -326,14 +326,14 @@  discard block
 block discarded – undo
326 326
 
327 327
         //	 Ajout alain01 tinymce v4
328 328
 
329
-        $chemin_array=parse_url(\XoopsBaseConfig::get('url'));
330
-        $chemin_scheme =  $chemin_array["scheme"]; // http
331
-        $chemin_host =  $chemin_array["host"]; // www.example.com  or // localhost
329
+        $chemin_array = parse_url(\XoopsBaseConfig::get('url'));
330
+        $chemin_scheme = $chemin_array["scheme"]; // http
331
+        $chemin_host = $chemin_array["host"]; // www.example.com  or // localhost
332 332
         //$chemin_path =  $chemin_array["path"]; // /myweb1
333 333
         if (!isset($chemin_array['path'])) {
334 334
             $chemin_path = '';
335 335
         } else {
336
-            $chemin_path =  $chemin_array["path"];
336
+            $chemin_path = $chemin_array["path"];
337 337
         }
338 338
 
339 339
         //$ret .='language_url : "'.$chemin_path.'/class/xoopseditor/tinymce4/tinymce/js/tinymce/langs/fr_FR.js",';
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
         $ret .= '"external_filemanager_path": "'.$chemin_path.'/class/xoopseditor/tinymce4/external_plugins/filemanager/",';
370 370
         $ret .= "\n";
371 371
 
372
-        $ret .='templates: "'.$chemin_path.'/uploads/filemanager/templates/liste-templates.js",';
372
+        $ret .= 'templates: "'.$chemin_path.'/uploads/filemanager/templates/liste-templates.js",';
373 373
         $ret .= "\n";
374 374
         // fin ajout alain01
375 375
 
@@ -387,6 +387,6 @@  discard block
 block discarded – undo
387 387
                 </script>
388 388
             ';
389 389
 
390
-        return $ret ;
390
+        return $ret;
391 391
     }
392 392
 }
Please login to merge, or discard this patch.
htdocs/class/xoopseditor/textarea/editor_registry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
 
24 24
 return $config = array(
25 25
     "class"  => "FormTextArea",
26
-    "file"   => \XoopsBaseConfig::get('root-path') . "/class/xoopseditor/textarea/textarea.php",
26
+    "file"   => \XoopsBaseConfig::get('root-path')."/class/xoopseditor/textarea/textarea.php",
27 27
     "title"  => _XOOPS_EDITOR_TEXTAREA, // display to end user
28 28
     "order"  => 1, // 0 will disable the editor
29 29
     "nohtml" => 1 // For forms that have "dohtml" disabled
Please login to merge, or discard this patch.
htdocs/class/captcha/xoopscaptcha.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -73,8 +73,8 @@
 block discarded – undo
73 73
     protected function __construct()
74 74
     {
75 75
         // Load static configurations
76
-		$xoops_root_path = \XoopsBaseConfig::get('root-path');
77
-		$xoops_var_path = \XoopsBaseConfig::get('var-path');
76
+        $xoops_root_path = \XoopsBaseConfig::get('root-path');
77
+        $xoops_var_path = \XoopsBaseConfig::get('var-path');
78 78
         $this->path_basic = $xoops_root_path . '/class/captcha';
79 79
         $this->path_plugin = $xoops_root_path . '/Frameworks/captcha';
80 80
         $this->configPath = $xoops_var_path . '/configs/';
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
         // Load static configurations
76 76
 		$xoops_root_path = \XoopsBaseConfig::get('root-path');
77 77
 		$xoops_var_path = \XoopsBaseConfig::get('var-path');
78
-        $this->path_basic = $xoops_root_path . '/class/captcha';
79
-        $this->path_plugin = $xoops_root_path . '/Frameworks/captcha';
80
-        $this->configPath = $xoops_var_path . '/configs/';
78
+        $this->path_basic = $xoops_root_path.'/class/captcha';
79
+        $this->path_plugin = $xoops_root_path.'/Frameworks/captcha';
80
+        $this->configPath = $xoops_var_path.'/configs/';
81 81
         $this->config = $this->loadConfig();
82 82
         $this->name = $this->config['name'];
83 83
     }
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
      *
105 105
      * @return array
106 106
      */
107
-    function loadConfig( $name = 'config') {
108
-        if ( $name === 'config' ) {
107
+    function loadConfig($name = 'config') {
108
+        if ($name === 'config') {
109 109
             $filename = 'captcha.config';
110 110
         } else {
111
-            $filename = 'captcha.config.' . $name;
111
+            $filename = 'captcha.config.'.$name;
112 112
         }
113
-        if ( !$config = $this->readConfig($filename) ) {
114
-            $config = $this->loadBasicConfig( $name );
115
-            $this->writeConfig($filename, $config );
113
+        if (!$config = $this->readConfig($filename)) {
114
+            $config = $this->loadBasicConfig($name);
115
+            $this->writeConfig($filename, $config);
116 116
         }
117 117
 
118 118
         return $config;
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
     {
130 130
         $basic_config = array();
131 131
         $plugin_config = array();
132
-        $filename = ($filename === 'config') ? 'config.php' : 'config.' . $filename . '.php';
133
-        if (XoopsLoad::fileExists($file = $this->path_basic . '/' . $filename)) {
132
+        $filename = ($filename === 'config') ? 'config.php' : 'config.'.$filename.'.php';
133
+        if (XoopsLoad::fileExists($file = $this->path_basic.'/'.$filename)) {
134 134
             $basic_config = include $file;
135 135
         }
136
-        if (XoopsLoad::fileExists($file = $this->path_plugin . '/' . $filename)) {
136
+        if (XoopsLoad::fileExists($file = $this->path_plugin.'/'.$filename)) {
137 137
             $plugin_config = include $file;
138 138
         }
139 139
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     function readConfig($filename = 'config')
152 152
     {
153
-        $path_file = $this->configPath . $filename . '.php';
153
+        $path_file = $this->configPath.$filename.'.php';
154 154
         $file = XoopsFile::getHandler('file', $path_file);
155 155
         return eval(@$file->read());
156 156
     }
@@ -165,9 +165,9 @@  discard block
 block discarded – undo
165 165
      */
166 166
     function writeConfig($filename = 'config', $config)
167 167
     {
168
-        $path_file = $this->configPath . $filename . '.php';
168
+        $path_file = $this->configPath.$filename.'.php';
169 169
         $file = XoopsFile::getHandler('file', $path_file);
170
-        return $file->write( 'return ' . var_export($config, true) . ';');
170
+        return $file->write('return '.var_export($config, true).';');
171 171
     }
172 172
 
173 173
     /**
@@ -207,22 +207,22 @@  discard block
 block discarded – undo
207 207
     public function loadHandler($name = null)
208 208
     {
209 209
         $name = !empty($name) ? $name : (empty($this->config['mode']) ? 'text' : $this->config['mode']);
210
-        $class = 'XoopsCaptcha' . ucfirst($name);
210
+        $class = 'XoopsCaptcha'.ucfirst($name);
211 211
         if (!empty($this->handler) && get_class($this->handler) == $class) {
212 212
             return $this->handler;
213 213
         }
214 214
         $this->handler = null;
215
-        if (XoopsLoad::fileExists($file = $this->path_basic . '/' . $name . '.php')) {
215
+        if (XoopsLoad::fileExists($file = $this->path_basic.'/'.$name.'.php')) {
216 216
             require_once $file;
217 217
         } else {
218
-            if (XoopsLoad::fileExists($file = $this->path_plugin . '/' . $name . '.php')) {
218
+            if (XoopsLoad::fileExists($file = $this->path_plugin.'/'.$name.'.php')) {
219 219
                 require_once $file;
220 220
             }
221 221
         }
222 222
 
223 223
         if (!class_exists($class)) {
224 224
             $class = 'XoopsCaptchaText';
225
-            require_once $this->path_basic . '/text.php';
225
+            require_once $this->path_basic.'/text.php';
226 226
         }
227 227
         /* @var $handler XoopsCaptchaMethod */
228 228
         $handler = new $class($this);
@@ -348,8 +348,8 @@  discard block
 block discarded – undo
348 348
         $this->handler->destroyGarbage();
349 349
 
350 350
         if ($clearSession) {
351
-            foreach ($this->config as $k => $config ) {
352
-                $_SESSION[$this->name . '_' . $k] = null;
351
+            foreach ($this->config as $k => $config) {
352
+                $_SESSION[$this->name.'_'.$k] = null;
353 353
             }
354 354
         }
355 355
         return true;
@@ -363,9 +363,9 @@  discard block
 block discarded – undo
363 363
     public function render()
364 364
     {
365 365
         $sessionName = $this->config['name'];
366
-        $_SESSION[$sessionName . '_name'] = $sessionName;
367
-        foreach ($this->config as $k => $config ) {
368
-            $_SESSION[$sessionName . '_' . $k] = $config;
366
+        $_SESSION[$sessionName.'_name'] = $sessionName;
367
+        foreach ($this->config as $k => $config) {
368
+            $_SESSION[$sessionName.'_'.$k] = $config;
369 369
         }
370 370
         $form = '';
371 371
         if (!$this->active || empty($this->config['name'])) {
@@ -373,8 +373,8 @@  discard block
 block discarded – undo
373 373
         }
374 374
 
375 375
         $maxAttempts = $this->config['maxattempts'];
376
-        $attempt = isset($_SESSION[$sessionName . '_attempt']) ? $_SESSION[$sessionName . '_attempt'] : 0;
377
-        $_SESSION[$sessionName . '_attempt'] = $attempt;
376
+        $attempt = isset($_SESSION[$sessionName.'_attempt']) ? $_SESSION[$sessionName.'_attempt'] : 0;
377
+        $_SESSION[$sessionName.'_attempt'] = $attempt;
378 378
 
379 379
         // Failure on too many attempts
380 380
         if (!empty($maxAttempts) && $attempt > $maxAttempts) {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
     {
411 411
         $code = ($code === null) ? $this->handler->getCode() : $code;
412 412
         if (!empty($code)) {
413
-            $_SESSION[$this->name . '_code'] = $code;
413
+            $_SESSION[$this->name.'_code'] = $code;
414 414
             return true;
415 415
         }
416 416
         return false;
Please login to merge, or discard this patch.