Passed
Push — master ( d35171...b3de3c )
by Michael
02:47
created
config/config.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -21,33 +21,33 @@  discard block
 block discarded – undo
21 21
 $moduleDirNameUpper = mb_strtoupper($moduleDirName);
22 22
 xoops_loadLanguage('common', $moduleDirName);
23 23
 
24
-return (object)[
25
-    'name'           => $moduleDirNameUpper . ' ModuleConfigurator',
24
+return (object) [
25
+    'name'           => $moduleDirNameUpper.' ModuleConfigurator',
26 26
     'paths'          => [
27 27
         'dirname'    => $moduleDirName,
28
-        'admin'      => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin',
29
-        'modPath'    => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName,
30
-        'modUrl'     => XOOPS_URL . '/modules/' . $moduleDirName,
31
-        'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
32
-        'uploadUrl'  => XOOPS_UPLOAD_URL . '/' . $moduleDirName,
28
+        'admin'      => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin',
29
+        'modPath'    => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName,
30
+        'modUrl'     => XOOPS_URL.'/modules/'.$moduleDirName,
31
+        'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName,
32
+        'uploadUrl'  => XOOPS_UPLOAD_URL.'/'.$moduleDirName,
33 33
     ],
34 34
     'uploadFolders'  => [
35
-        XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
36
-        XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/midsize',
37
-        XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs',
35
+        XOOPS_UPLOAD_PATH.'/'.$moduleDirName,
36
+        XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/midsize',
37
+        XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/thumbs',
38 38
         //XOOPS_UPLOAD_PATH . '/flags'
39 39
     ],
40 40
     'copyBlankFiles' => [
41
-        XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
42
-        XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/midsize',
43
-        XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/thumbs',
41
+        XOOPS_UPLOAD_PATH.'/'.$moduleDirName,
42
+        XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/midsize',
43
+        XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/thumbs',
44 44
         //XOOPS_UPLOAD_PATH . '/flags'
45 45
     ],
46 46
 
47 47
     'copyTestFolders' => [
48 48
         [
49
-            XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads',
50
-            XOOPS_UPLOAD_PATH . '/' . $moduleDirName,
49
+            XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/testdata/uploads',
50
+            XOOPS_UPLOAD_PATH.'/'.$moduleDirName,
51 51
         ],
52 52
         //            [
53 53
         //                XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/thumbs',
@@ -84,6 +84,6 @@  discard block
 block discarded – undo
84 84
         //            'totalsubmitted'  => $helper->getHandler('Item')->getItemsCount(-1, [Constants::PUBLISHER_STATUS_SUBMITTED]),
85 85
     ],
86 86
     'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'>
87
-                     <img src='" . Admin::iconUrl('xoopsmicrobutton.gif') . "' alt='XOOPS Project'></a>",
87
+                     <img src='" . Admin::iconUrl('xoopsmicrobutton.gif')."' alt='XOOPS Project'></a>",
88 88
 ];
89 89
 
Please login to merge, or discard this patch.
class/Utility.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                 if (!\mkdir($folder) && !\is_dir($folder)) {
36 36
                     throw new RuntimeException(\sprintf('Unable to create the %s directory', $folder));
37 37
                 } else {
38
-                    file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>');
38
+                    file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>');
39 39
                 }
40 40
             }
41 41
         } catch (\Exception $e) {
@@ -73,10 +73,10 @@  discard block
 block discarded – undo
73 73
         //    @mkdir($dst);
74 74
         while (false !== ($file = \readdir($dir))) {
75 75
             if (($file !== '.') && ($file !== '..')) {
76
-                if (\is_dir($src . '/' . $file)) {
77
-                    self::recurseCopy($src . '/' . $file, $dst . '/' . $file);
76
+                if (\is_dir($src.'/'.$file)) {
77
+                    self::recurseCopy($src.'/'.$file, $dst.'/'.$file);
78 78
                 } else {
79
-                    \copy($src . '/' . $file, $dst . '/' . $file);
79
+                    \copy($src.'/'.$file, $dst.'/'.$file);
80 80
                 }
81 81
             }
82 82
         }
Please login to merge, or discard this patch.
class/ContactHandler.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -144,34 +144,34 @@  discard block
 block discarded – undo
144 144
         $info          = '';
145 145
         $subjectPrefix = '';
146 146
         if ($GLOBALS['xoopsModuleConfig']['form_dept'] && $GLOBALS['xoopsModuleConfig']['subject_prefix'] && $GLOBALS['xoopsModuleConfig']['contact_dept']) {
147
-            $subjectPrefix = '[' . $GLOBALS['xoopsModuleConfig']['prefix_text'] . ' ' . $contact['contact_department'] . ']: ';
148
-            $info          .= _MD_CONTACT_DEPARTMENT . ': ' . $contact['contact_department'] . "\n";
147
+            $subjectPrefix = '['.$GLOBALS['xoopsModuleConfig']['prefix_text'].' '.$contact['contact_department'].']: ';
148
+            $info .= _MD_CONTACT_DEPARTMENT.': '.$contact['contact_department']."\n";
149 149
         }
150
-        $xoopsMailer->setSubject($subjectPrefix . \html_entity_decode($contact['contact_subject'], \ENT_QUOTES, 'UTF-8'));
150
+        $xoopsMailer->setSubject($subjectPrefix.\html_entity_decode($contact['contact_subject'], \ENT_QUOTES, 'UTF-8'));
151 151
 
152 152
         if ($contact['contact_url']) {
153
-            $info .= _MD_CONTACT_URL . ': ' . $contact['contact_url'] . "\n";
153
+            $info .= _MD_CONTACT_URL.': '.$contact['contact_url']."\n";
154 154
         }
155 155
         if ($contact['contact_icq']) {
156
-            $info .= _MD_CONTACT_ICQ . ': ' . $contact['contact_icq'] . "\n";
156
+            $info .= _MD_CONTACT_ICQ.': '.$contact['contact_icq']."\n";
157 157
         }
158 158
         if ($contact['contact_skype']) {
159
-            $info .= _MD_CONTACT_SKYPE . ': ' . $contact['contact_skype'] . "\n";
159
+            $info .= _MD_CONTACT_SKYPE.': '.$contact['contact_skype']."\n";
160 160
         }
161 161
         if ($contact['contact_phone']) {
162
-            $info .= _MD_CONTACT_PHONE . ': ' . $contact['contact_phone'] . "\n";
162
+            $info .= _MD_CONTACT_PHONE.': '.$contact['contact_phone']."\n";
163 163
         }
164 164
         if ($contact['contact_company']) {
165
-            $info .= _MD_CONTACT_COMPANY . ': ' . $contact['contact_company'] . "\n";
165
+            $info .= _MD_CONTACT_COMPANY.': '.$contact['contact_company']."\n";
166 166
         }
167 167
         if ($contact['contact_location']) {
168
-            $info .= _MD_CONTACT_LOCATION . ': ' . $contact['contact_location'] . "\n";
168
+            $info .= _MD_CONTACT_LOCATION.': '.$contact['contact_location']."\n";
169 169
         }
170 170
         if ($contact['contact_address']) {
171
-            $info .= _MD_CONTACT_ADDRESS . ': ' . $contact['contact_address'] . "\n";
171
+            $info .= _MD_CONTACT_ADDRESS.': '.$contact['contact_address']."\n";
172 172
         }
173 173
         if ('' !== $info) {
174
-            $info = "\n" . $info . "\n";
174
+            $info = "\n".$info."\n";
175 175
         }
176 176
 
177 177
         $body = \str_replace('{BODY}', \html_entity_decode($contact['contact_message'], \ENT_QUOTES, 'UTF-8'), \_MD_CONTACT_MAIL_BODY);
@@ -204,28 +204,28 @@  discard block
 block discarded – undo
204 204
 
205 205
         $info = '';
206 206
         if ($contact['contact_url']) {
207
-            $info .= _MD_CONTACT_URL . ': ' . $contact['contact_url'] . "\n";
207
+            $info .= _MD_CONTACT_URL.': '.$contact['contact_url']."\n";
208 208
         }
209 209
         if ($contact['contact_icq']) {
210
-            $info .= _MD_CONTACT_ICQ . ': ' . $contact['contact_icq'] . "\n";
210
+            $info .= _MD_CONTACT_ICQ.': '.$contact['contact_icq']."\n";
211 211
         }
212 212
         if ($contact['contact_skype']) {
213
-            $info .= _MD_CONTACT_SKYPE . ': ' . $contact['contact_skype'] . "\n";
213
+            $info .= _MD_CONTACT_SKYPE.': '.$contact['contact_skype']."\n";
214 214
         }
215 215
         if ($contact['contact_phone']) {
216
-            $info .= _MD_CONTACT_PHONE . ': ' . $contact['contact_phone'] . "\n";
216
+            $info .= _MD_CONTACT_PHONE.': '.$contact['contact_phone']."\n";
217 217
         }
218 218
         if ($contact['contact_company']) {
219
-            $info .= _MD_CONTACT_COMPANY . ': ' . $contact['contact_company'] . "\n";
219
+            $info .= _MD_CONTACT_COMPANY.': '.$contact['contact_company']."\n";
220 220
         }
221 221
         if ($contact['contact_location']) {
222
-            $info .= _MD_CONTACT_LOCATION . ': ' . $contact['contact_location'] . "\n";
222
+            $info .= _MD_CONTACT_LOCATION.': '.$contact['contact_location']."\n";
223 223
         }
224 224
         if ($contact['contact_address']) {
225
-            $info .= _MD_CONTACT_ADDRESS . ': ' . $contact['contact_address'] . "\n";
225
+            $info .= _MD_CONTACT_ADDRESS.': '.$contact['contact_address']."\n";
226 226
         }
227 227
         if ('' !== $info) {
228
-            $info = "\n" . $info . "\n";
228
+            $info = "\n".$info."\n";
229 229
         }
230 230
 
231 231
         $body = \str_replace('{NAME}', \html_entity_decode($contact['contact_name'], \ENT_QUOTES, 'UTF-8'), _MD_CONTACT_MAILCONFIRM_BODY);
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
         $criteria = new \CriteriaCompo();
313 313
         $criteria->add(new \Criteria('contact_cid', $contact_id));
314 314
         $criteria->add(new \Criteria('contact_type', 'Contact'));
315
-        $contacts =& $this->getObjects($criteria, false);
315
+        $contacts = & $this->getObjects($criteria, false);
316 316
         if ($contacts) {
317 317
             $ret = [];
318 318
             /** @var Contact $root */
@@ -343,7 +343,7 @@  discard block
 block discarded – undo
343 343
         $criteria->setOrder($contact['order']);
344 344
         $criteria->setStart($contact['start']);
345 345
         $criteria->setLimit($contact['limit']);
346
-        $contacts =& $this->getObjects($criteria, false);
346
+        $contacts = & $this->getObjects($criteria, false);
347 347
         if ($contacts) {
348 348
             /** @var Contact $root */
349 349
             foreach ($contacts as $root) {
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
         }
484 484
         $criteria->setSort('contact_create');
485 485
         $criteria->setOrder('DESC');
486
-        $contacts =& $this->getObjects($criteria, false);
486
+        $contacts = & $this->getObjects($criteria, false);
487 487
         if ($contacts) {
488 488
             /** @var Contact $root */
489 489
             foreach ($contacts as $root) {
Please login to merge, or discard this patch.
class/Common/SysUtility.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
     {
60 60
         if ($considerHtml) {
61 61
             // if the plain text is shorter than the maximum length, return the whole text
62
-            if (mb_strlen(\preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
62
+            if (mb_strlen(\preg_replace('/<.*?'.'>/', '', $text)) <= $length) {
63 63
                 return $text;
64 64
             }
65 65
             // splits all html-tags to scanable lines
66
-            \preg_match_all('/(<.+?' . '>)?([^<>]*)/s', $text, $lines, \PREG_SET_ORDER);
66
+            \preg_match_all('/(<.+?'.'>)?([^<>]*)/s', $text, $lines, \PREG_SET_ORDER);
67 67
             $total_length = mb_strlen($ending);
68 68
             $open_tags    = [];
69 69
             $truncate     = '';
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                             unset($open_tags[$pos]);
82 82
                         }
83 83
                         // if tag is an opening tag
84
-                    } elseif (\preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $line_matchings[1], $tag_matchings)) {
84
+                    } elseif (\preg_match('/^<\s*([^\s>!]+).*?'.'>$/s', $line_matchings[1], $tag_matchings)) {
85 85
                         // add tag to the beginning of $open_tags list
86 86
                         \array_unshift($open_tags, mb_strtolower($tag_matchings[1]));
87 87
                     }
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         if ($considerHtml) {
140 140
             // close all unclosed html-tags
141 141
             foreach ($open_tags as $tag) {
142
-                $truncate .= '</' . $tag . '>';
142
+                $truncate .= '</'.$tag.'>';
143 143
             }
144 144
         }
145 145
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
         // set the auto-incremented id's value to blank.
220 220
         unset($tempTable[$id_field]);
221 221
         // insert cloned copy of the original  record 
222
-        $sql    = "INSERT INTO $table (" . \implode(', ', \array_keys($tempTable)) . ") VALUES ('" . \implode("', '", \array_values($tempTable)) . "')";
222
+        $sql    = "INSERT INTO $table (".\implode(', ', \array_keys($tempTable)).") VALUES ('".\implode("', '", \array_values($tempTable))."')";
223 223
         $result = $GLOBALS['xoopsDB']->queryF($sql);
224 224
         if (!$result) {
225 225
             exit($GLOBALS['xoopsDB']->error());
Please login to merge, or discard this patch.
class/Common/FilesManagement.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
                     throw new RuntimeException(\sprintf('Unable to create the %s directory', $folder));
41 41
                 }
42 42
 
43
-                file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>');
43
+                file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>');
44 44
             }
45 45
         } catch (Exception $e) {
46 46
             echo 'Caught exception: ', $e->getMessage(), "\n", '<br>';
@@ -66,14 +66,14 @@  discard block
 block discarded – undo
66 66
         $dir = \opendir($src);
67 67
         //        @mkdir($dst);
68 68
         if (!@\mkdir($dst) && !\is_dir($dst)) {
69
-            throw new RuntimeException('The directory ' . $dst . ' could not be created.');
69
+            throw new RuntimeException('The directory '.$dst.' could not be created.');
70 70
         }
71 71
         while (false !== ($file = \readdir($dir))) {
72 72
             if (('.' !== $file) && ('..' !== $file)) {
73
-                if (\is_dir($src . '/' . $file)) {
74
-                    self::recurseCopy($src . '/' . $file, $dst . '/' . $file);
73
+                if (\is_dir($src.'/'.$file)) {
74
+                    self::recurseCopy($src.'/'.$file, $dst.'/'.$file);
75 75
                 } else {
76
-                    \copy($src . '/' . $file, $dst . '/' . $file);
76
+                    \copy($src.'/'.$file, $dst.'/'.$file);
77 77
                 }
78 78
             }
79 79
         }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 self::rrmdir($fObj->getPathname());
164 164
             }
165 165
         }
166
-        $iterator = null;   // clear iterator Obj to close file/directory
166
+        $iterator = null; // clear iterator Obj to close file/directory
167 167
         return \rmdir($src); // remove the directory & return results
168 168
     }
169 169
 
@@ -196,14 +196,14 @@  discard block
 block discarded – undo
196 196
         $iterator = new DirectoryIterator($src);
197 197
         foreach ($iterator as $fObj) {
198 198
             if ($fObj->isFile()) {
199
-                \rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename());
199
+                \rename($fObj->getPathname(), "{$dest}/".$fObj->getFilename());
200 200
             } elseif (!$fObj->isDot() && $fObj->isDir()) {
201 201
                 // Try recursively on directory
202
-                self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename());
202
+                self::rmove($fObj->getPathname(), "{$dest}/".$fObj->getFilename());
203 203
                 //                rmdir($fObj->getPath()); // now delete the directory
204 204
             }
205 205
         }
206
-        $iterator = null;   // clear iterator Obj to close file/directory
206
+        $iterator = null; // clear iterator Obj to close file/directory
207 207
         return \rmdir($src); // remove the directory & return results
208 208
     }
209 209
 
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
         $iterator = new DirectoryIterator($src);
240 240
         foreach ($iterator as $fObj) {
241 241
             if ($fObj->isFile()) {
242
-                \copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename());
242
+                \copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename());
243 243
             } elseif (!$fObj->isDot() && $fObj->isDir()) {
244
-                self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename());
244
+                self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename());
245 245
             }
246 246
         }
247 247
 
Please login to merge, or discard this patch.
class/Common/Configurator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      */
43 43
     public function __construct()
44 44
     {
45
-        $config = require \dirname(__DIR__, 2) . '/config/config.php';
45
+        $config = require \dirname(__DIR__, 2).'/config/config.php';
46 46
 
47 47
         $this->name            = $config->name;
48 48
         $this->paths           = $config->paths;
Please login to merge, or discard this patch.
include/oninstall.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
     if ($xoopsSuccess && $phpSuccess) {
39 39
         $mod_tables = &$module->getInfo('tables');
40 40
         foreach ($mod_tables as $table) {
41
-            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
41
+            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';');
42 42
         }
43 43
     }
44 44
 
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
  */
54 54
 function xoops_module_install_contact(\XoopsModule $module)
55 55
 {
56
-    require dirname(__DIR__, 3) . '/mainfile.php';
56
+    require dirname(__DIR__, 3).'/mainfile.php';
57 57
 
58 58
     $moduleDirName = \basename(\dirname(__DIR__));
59 59
 
@@ -71,11 +71,11 @@  discard block
 block discarded – undo
71 71
     /** @var \XoopsGroupPermHandler $grouppermHandler */
72 72
     $grouppermHandler = xoops_getHandler('groupperm');
73 73
     // access rights ------------------------------------------
74
-    $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
75
-    $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
76
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
77
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
78
-    $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
74
+    $grouppermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
75
+    $grouppermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
76
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
77
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId);
78
+    $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
79 79
 
80 80
     //  ---  CREATE FOLDERS ---------------
81 81
     if (count($configurator->uploadFolders) > 0) {
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 
88 88
     //  ---  COPY blank.png FILES ---------------
89 89
     if (count($configurator->copyBlankFiles) > 0) {
90
-        $file = dirname(__DIR__) . '/assets/images/blank.png';
90
+        $file = dirname(__DIR__).'/assets/images/blank.png';
91 91
         foreach (array_keys($configurator->copyBlankFiles) as $i) {
92
-            $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
92
+            $dest = $configurator->copyBlankFiles[$i].'/blank.png';
93 93
             $utility::copyFile($file, $dest);
94 94
         }
95 95
     }
Please login to merge, or discard this patch.
include/onupdate.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser)
28 28
     || !$GLOBALS['xoopsUser']->isAdmin()) {
29
-    exit('Restricted access' . PHP_EOL);
29
+    exit('Restricted access'.PHP_EOL);
30 30
 }
31 31
 
32 32
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     $xoopsDB = \XoopsDatabaseFactory::getDatabaseConnection();
73 73
 
74 74
     if ($previousVersion < 180) {
75
-        $sql = 'CREATE TABLE ' . $xoopsDB->prefix('contact') . ' (
75
+        $sql = 'CREATE TABLE '.$xoopsDB->prefix('contact').' (
76 76
         contact_id int(10) unsigned NOT NULL auto_increment,
77 77
         contact_uid int(10) NOT NULL,
78 78
         contact_cid int(10) NOT NULL,
@@ -97,31 +97,31 @@  discard block
 block discarded – undo
97 97
 
98 98
     if ($previousVersion < 181) {
99 99
         // Add contact_platform
100
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . "` ADD `contact_platform` ENUM('Android','Ios','Web') NOT NULL DEFAULT 'Web'";
100
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact')."` ADD `contact_platform` ENUM('Android','Ios','Web') NOT NULL DEFAULT 'Web'";
101 101
         $xoopsDB->query($sql);
102 102
         // Add contact_type
103
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . "` ADD `contact_type` ENUM('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact'";
103
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact')."` ADD `contact_type` ENUM('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact'";
104 104
         $xoopsDB->query($sql);
105 105
         // Add index contact_uid
106
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_uid` ( `contact_uid` )';
106
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_uid` ( `contact_uid` )';
107 107
         $xoopsDB->query($sql);
108 108
         // Add index contact_cid
109
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_cid` ( `contact_cid` )';
109
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_cid` ( `contact_cid` )';
110 110
         $xoopsDB->query($sql);
111 111
         // Add index contact_create
112
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_create` ( `contact_create` )';
112
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_create` ( `contact_create` )';
113 113
         $xoopsDB->query($sql);
114 114
         // Add index contact_mail
115
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_mail` ( `contact_mail` )';
115
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_mail` ( `contact_mail` )';
116 116
         $xoopsDB->query($sql);
117 117
         // Add index contact_phone
118
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_phone` ( `contact_phone` )';
118
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_phone` ( `contact_phone` )';
119 119
         $xoopsDB->query($sql);
120 120
         // Add index contact_platform
121
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_platform` ( `contact_platform` )';
121
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_platform` ( `contact_platform` )';
122 122
         $xoopsDB->query($sql);
123 123
         // Add index contact_type
124
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_type` ( `contact_type` )';
124
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_type` ( `contact_type` )';
125 125
         $xoopsDB->query($sql);
126 126
     }
127 127
 
@@ -132,14 +132,14 @@  discard block
 block discarded – undo
132 132
         //delete old HTML templates
133 133
         if (count($configurator->templateFolders) > 0) {
134 134
             foreach ($configurator->templateFolders as $folder) {
135
-                $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder);
135
+                $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder);
136 136
                 if (is_dir($templateFolder)) {
137 137
                     $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']);
138 138
                     foreach ($templateList as $k => $v) {
139
-                        $fileInfo = new \SplFileInfo($templateFolder . $v);
139
+                        $fileInfo = new \SplFileInfo($templateFolder.$v);
140 140
                         if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) {
141
-                            if (is_file($templateFolder . $v)) {
142
-                                unlink($templateFolder . $v);
141
+                            if (is_file($templateFolder.$v)) {
142
+                                unlink($templateFolder.$v);
143 143
                             }
144 144
                         }
145 145
                     }
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         if (count($configurator->oldFiles) > 0) {
152 152
             //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
153 153
             foreach (array_keys($configurator->oldFiles) as $i) {
154
-                $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]);
154
+                $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]);
155 155
                 if (is_file($tempFile)) {
156 156
                     unlink($tempFile);
157 157
                 }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         if (count($configurator->oldFolders) > 0) {
164 164
             //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
165 165
             foreach (array_keys($configurator->oldFolders) as $i) {
166
-                $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]);
166
+                $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]);
167 167
                 /* @var XoopsObjectHandler $folderHandler */
168 168
                 $folderHandler = XoopsFile::getHandler('folder', $tempFolder);
169 169
                 $folderHandler->delete($tempFolder);
@@ -180,15 +180,15 @@  discard block
 block discarded – undo
180 180
 
181 181
         //  ---  COPY blank.png FILES ---------------
182 182
         if (count($configurator->copyBlankFiles) > 0) {
183
-            $file = dirname(__DIR__) . '/assets/images/blank.png';
183
+            $file = dirname(__DIR__).'/assets/images/blank.png';
184 184
             foreach (array_keys($configurator->copyBlankFiles) as $i) {
185
-                $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
185
+                $dest = $configurator->copyBlankFiles[$i].'/blank.png';
186 186
                 $utility::copyFile($file, $dest);
187 187
             }
188 188
         }
189 189
 
190 190
         //delete .html entries from the tpl table
191
-        $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\'';
191
+        $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\'';
192 192
         $GLOBALS['xoopsDB']->queryF($sql);
193 193
 
194 194
         /** @var \XoopsGroupPermHandler $grouppermHandler */
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
     if ($previousVersion < 227) {
201 201
         // Add contact_skype
202
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD `contact_skype` VARCHAR(255) NULL AFTER `contact_icq`';
202
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD `contact_skype` VARCHAR(255) NULL AFTER `contact_icq`';
203 203
         $xoopsDB->query($sql);
204 204
     }
205 205
 }
Please login to merge, or discard this patch.
include/common.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 use Xmf\Module\Admin;
24 24
 use XoopsModules\Contact;
25 25
 
26
-require_once dirname(__DIR__) . '/preloads/autoloader.php';
26
+require_once dirname(__DIR__).'/preloads/autoloader.php';
27 27
 
28 28
 $moduleDirName      = \basename(\dirname(__DIR__));
29 29
 $moduleDirNameUpper = mb_strtoupper($moduleDirName); //$capsDirName
@@ -42,20 +42,20 @@  discard block
 block discarded – undo
42 42
 //$categoryHandler     = new Contact\CategoryHandler($db);
43 43
 //$downloadHandler     = new Contact\DownloadHandler($db);
44 44
 
45
-if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) {
46
-    define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__)));
47
-    define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
48
-    define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/');
49
-    define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/');
50
-    define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/');
51
-    define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images');
52
-    define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/');
53
-    define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/');
54
-    define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php');
55
-    define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png');
56
-    define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
57
-    define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
58
-    define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1);
45
+if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) {
46
+    define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__)));
47
+    define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/');
48
+    define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/');
49
+    define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/');
50
+    define($moduleDirNameUpper.'_IMAGE_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/');
51
+    define($moduleDirNameUpper.'_IMAGE_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images');
52
+    define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/');
53
+    define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/');
54
+    define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php');
55
+    define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', constant($moduleDirNameUpper.'_URL').'/assets/images/logoModule.png');
56
+    define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash
57
+    define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash
58
+    define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1);
59 59
 }
60 60
 
61 61
 $pathIcon16 = Admin::iconUrl('', 16);
@@ -64,15 +64,15 @@  discard block
 block discarded – undo
64 64
 //$pathModIcon32 = $helper->getModule()->getInfo('modicons32');
65 65
 
66 66
 $icons = [
67
-    'edit'    => "<img src='" . $pathIcon16 . "/edit.png'  alt=" . _EDIT . "' align='middle'>",
68
-    'delete'  => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>",
69
-    'clone'   => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>",
70
-    'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>",
71
-    'print'   => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>",
72
-    'pdf'     => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>",
73
-    'add'     => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>",
74
-    '0'       => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>",
75
-    '1'       => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>",
67
+    'edit'    => "<img src='".$pathIcon16."/edit.png'  alt="._EDIT."' align='middle'>",
68
+    'delete'  => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>",
69
+    'clone'   => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>",
70
+    'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>",
71
+    'print'   => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>",
72
+    'pdf'     => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>",
73
+    'add'     => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>",
74
+    '0'       => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>",
75
+    '1'       => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>",
76 76
 ];
77 77
 
78 78
 $debug = false;
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
     $GLOBALS['xoopsTpl'] = new \XoopsTpl();
86 86
 }
87 87
 
88
-$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL . '/modules/' . $moduleDirName);
88
+$GLOBALS['xoopsTpl']->assign('mod_url', XOOPS_URL.'/modules/'.$moduleDirName);
89 89
 // Local icons path
90 90
 if (is_object($helper->getModule())) {
91 91
     $pathModIcon16 = $helper->getModule()->getInfo('modicons16');
92 92
     $pathModIcon32 = $helper->getModule()->getInfo('modicons32');
93 93
 
94
-    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16);
94
+    $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16);
95 95
     $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32);
96 96
 }
97 97
 
Please login to merge, or discard this patch.