Passed
Push — master ( 834a16...1c3825 )
by Goffy
09:06 queued 04:27
created
commonfiles/include/install.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@
 block discarded – undo
84 84
             $dest = $configurator->copyBlankFiles[$i] . '/blank.gif';
85 85
             $utility::copyFile($file, $dest);
86 86
         }
87
-		$file = dirname(__DIR__) . '/assets/images/blank.png';
87
+        $file = dirname(__DIR__) . '/assets/images/blank.png';
88 88
         foreach (array_keys($configurator->copyBlankFiles) as $i) {
89 89
             $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
90 90
             $utility::copyFile($file, $dest);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
  */
30 30
 function xoops_module_pre_install_tdmcreate(\XoopsModule $module)
31 31
 {
32
-    require dirname(__DIR__) . '/preloads/autoloader.php';
32
+    require dirname(__DIR__).'/preloads/autoloader.php';
33 33
     /** @var Tdmcreate\Utility $utility */
34 34
     $utility = new Tdmcreate\Utility();
35 35
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
     if (false !== $xoopsSuccess && false !== $phpSuccess) {
43 43
         $moduleTables = &$module->getInfo('tables');
44 44
         foreach ($moduleTables as $table) {
45
-            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
45
+            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';');
46 46
         }
47 47
     }
48 48
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
  */
56 56
 function xoops_module_install_tdmcreate(\XoopsModule $module)
57 57
 {
58
-    require dirname(__DIR__) . '/preloads/autoloader.php';
58
+    require dirname(__DIR__).'/preloads/autoloader.php';
59 59
 
60 60
     /** @var Tdmcreate\Helper $helper */ 
61 61
     /** @var Tdmcreate\Utility $utility */
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
 
80 80
     //  ---  COPY blank.gif FILES ---------------
81 81
     if ($configurator->copyBlankFiles && is_array($configurator->copyBlankFiles)) {
82
-        $file = dirname(__DIR__) . '/assets/images/blank.gif';
82
+        $file = dirname(__DIR__).'/assets/images/blank.gif';
83 83
         foreach (array_keys($configurator->copyBlankFiles) as $i) {
84
-            $dest = $configurator->copyBlankFiles[$i] . '/blank.gif';
84
+            $dest = $configurator->copyBlankFiles[$i].'/blank.gif';
85 85
             $utility::copyFile($file, $dest);
86 86
         }
87
-		$file = dirname(__DIR__) . '/assets/images/blank.png';
87
+		$file = dirname(__DIR__).'/assets/images/blank.png';
88 88
         foreach (array_keys($configurator->copyBlankFiles) as $i) {
89
-            $dest = $configurator->copyBlankFiles[$i] . '/blank.png';
89
+            $dest = $configurator->copyBlankFiles[$i].'/blank.png';
90 90
             $utility::copyFile($file, $dest);
91 91
         }
92 92
     }
Please login to merge, or discard this patch.
commonfiles/include/update.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     $ret = tdmcreate_check_db($module);
40 40
 
41 41
     //check upload directory
42
-	include_once __DIR__ . '/install.php';
42
+    include_once __DIR__ . '/install.php';
43 43
     $ret = xoops_module_install_tdmcreate($module);
44 44
 
45 45
     $errors = $module->getErrors();
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 function tdmcreate_check_db($module)
114 114
 {
115 115
     $ret = true;
116
-	//insert here code for database check
116
+    //insert here code for database check
117 117
 
118 118
     /*
119 119
     // Example: update table (add new field)
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     $ret = tdmcreate_check_db($module);
40 40
 
41 41
     //check upload directory
42
-	include_once __DIR__ . '/install.php';
42
+	include_once __DIR__.'/install.php';
43 43
     $ret = xoops_module_install_tdmcreate($module);
44 44
 
45 45
     $errors = $module->getErrors();
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 {
62 62
     global $xoopsDB;
63 63
     $result = $xoopsDB->query(
64
-        'SELECT t1.tpl_id FROM ' . $xoopsDB->prefix('tplfile') . ' t1, ' . $xoopsDB->prefix('tplfile') . ' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id'
64
+        'SELECT t1.tpl_id FROM '.$xoopsDB->prefix('tplfile').' t1, '.$xoopsDB->prefix('tplfile').' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id'
65 65
     );
66 66
     $tplids = [];
67 67
     while (false !== (list($tplid) = $xoopsDB->fetchRow($result))) {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     }
70 70
     if (count($tplids) > 0) {
71 71
         $tplfileHandler  = xoops_getHandler('tplfile');
72
-        $duplicate_files = $tplfileHandler->getObjects(new \Criteria('tpl_id', '(' . implode(',', $tplids) . ')', 'IN'));
72
+        $duplicate_files = $tplfileHandler->getObjects(new \Criteria('tpl_id', '('.implode(',', $tplids).')', 'IN'));
73 73
 
74 74
         if (count($duplicate_files) > 0) {
75 75
             foreach (array_keys($duplicate_files) as $i) {
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
             }
78 78
         }
79 79
     }
80
-    $sql = 'SHOW INDEX FROM ' . $xoopsDB->prefix('tplfile') . " WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
80
+    $sql = 'SHOW INDEX FROM '.$xoopsDB->prefix('tplfile')." WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
81 81
     if (!$result = $xoopsDB->queryF($sql)) {
82
-        xoops_error($xoopsDB->error() . '<br>' . $sql);
82
+        xoops_error($xoopsDB->error().'<br>'.$sql);
83 83
 
84 84
         return false;
85 85
     }
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
 
93 93
         return true;
94 94
     }
95
-    $sql = 'ALTER TABLE ' . $xoopsDB->prefix('tplfile') . ' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )';
95
+    $sql = 'ALTER TABLE '.$xoopsDB->prefix('tplfile').' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )';
96 96
     if (!$result = $xoopsDB->queryF($sql)) {
97
-        xoops_error($xoopsDB->error() . '<br>' . $sql);
97
+        xoops_error($xoopsDB->error().'<br>'.$sql);
98 98
         $module->setErrors("'tpl_refid_module_set_file_type' unique index is not added to 'tplfile' table. Warning: do not use XOOPS until you add this unique index.");
99 99
 
100 100
         return false;
Please login to merge, or discard this patch.
commonfiles/testdata/index.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -67,14 +67,14 @@  discard block
 block discarded – undo
67 67
         $language = $xoopsConfig['language'] . '/';
68 68
     }
69 69
 
70
-	// load module tables
70
+    // load module tables
71 71
     foreach ($tables as $table) {
72 72
         $tabledata = \Xmf\Yaml::readWrapped($language . $table . '.yml');
73 73
         \Xmf\Database\TableLoad::truncateTable($table);
74 74
         \Xmf\Database\TableLoad::loadTableFromArray($table, $tabledata);
75 75
     }
76 76
 	
77
-	// load permissions
77
+    // load permissions
78 78
     $table     = 'group_permission';
79 79
     $tabledata = \Xmf\Yaml::readWrapped($language . $table . '.yml');
80 80
     $mid       = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid');
@@ -105,18 +105,18 @@  discard block
 block discarded – undo
105 105
 
106 106
     $languageFolder = __DIR__ . '/' . $xoopsConfig['language'];
107 107
     if (!file_exists($languageFolder . '/')) {
108
-       Utility::createFolder($languageFolder . '/');
108
+        Utility::createFolder($languageFolder . '/');
109 109
     }
110 110
     $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/';
111 111
     Utility::createFolder($exportFolder);
112 112
 
113
-	// save module tables
113
+    // save module tables
114 114
     foreach ($tables as $table) {
115 115
         \Xmf\Database\TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml');
116 116
     }
117 117
 	
118
-	// save permissions
119
-	$criteria = new \CriteriaCompo();
118
+    // save permissions
119
+    $criteria = new \CriteriaCompo();
120 120
     $criteria->add(new \Criteria('gperm_modid', \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid')));
121 121
     $skipColumns[] = 'gperm_id';
122 122
     \Xmf\Database\TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns);
Please login to merge, or discard this patch.
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
 use XoopsModules\Tdmcreate\Common;
19 19
 use XoopsModules\Tdmcreate\Utility;
20 20
 
21
-require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
22
-require dirname(__DIR__) . '/preloads/autoloader.php';
21
+require_once dirname(dirname(dirname(__DIR__))).'/include/cp_header.php';
22
+require dirname(__DIR__).'/preloads/autoloader.php';
23 23
 
24 24
 $op = \Xmf\Request::getCmd('op', '');
25 25
 
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             loadSampleData();
40 40
         } else {
41 41
             xoops_cp_header();
42
-            xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', sprintf(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA_OK')), constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true);
42
+            xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', sprintf(constant('CO_'.$moduleDirNameUpper.'_'.'ADD_SAMPLEDATA_OK')), constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true);
43 43
             xoops_cp_footer();
44 44
         }
45 45
         break;
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
     $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables');
64 64
 
65 65
     $language = 'english/';
66
-    if (is_dir(__DIR__ . '/' . $xoopsConfig['language'])) {
67
-        $language = $xoopsConfig['language'] . '/';
66
+    if (is_dir(__DIR__.'/'.$xoopsConfig['language'])) {
67
+        $language = $xoopsConfig['language'].'/';
68 68
     }
69 69
 
70 70
 	// load module tables
71 71
     foreach ($tables as $table) {
72
-        $tabledata = \Xmf\Yaml::readWrapped($language . $table . '.yml');
72
+        $tabledata = \Xmf\Yaml::readWrapped($language.$table.'.yml');
73 73
         \Xmf\Database\TableLoad::truncateTable($table);
74 74
         \Xmf\Database\TableLoad::loadTableFromArray($table, $tabledata);
75 75
     }
76 76
 	
77 77
 	// load permissions
78 78
     $table     = 'group_permission';
79
-    $tabledata = \Xmf\Yaml::readWrapped($language . $table . '.yml');
79
+    $tabledata = \Xmf\Yaml::readWrapped($language.$table.'.yml');
80 80
     $mid       = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid');
81 81
     loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid);
82 82
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $utility::rcopy($src, $dest);
90 90
         }
91 91
     }
92
-    redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS'));
92
+    redirect_header('../admin/index.php', 1, constant('CO_'.$moduleDirNameUpper.'_'.'SAMPLEDATA_SUCCESS'));
93 93
 }
94 94
 
95 95
 function saveSampleData()
@@ -103,23 +103,23 @@  discard block
 block discarded – undo
103 103
 
104 104
     $tables = \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getInfo('tables');
105 105
 
106
-    $languageFolder = __DIR__ . '/' . $xoopsConfig['language'];
107
-    if (!file_exists($languageFolder . '/')) {
108
-       Utility::createFolder($languageFolder . '/');
106
+    $languageFolder = __DIR__.'/'.$xoopsConfig['language'];
107
+    if (!file_exists($languageFolder.'/')) {
108
+       Utility::createFolder($languageFolder.'/');
109 109
     }
110
-    $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/';
110
+    $exportFolder = $languageFolder.'/Exports-'.date('Y-m-d-H-i-s').'/';
111 111
     Utility::createFolder($exportFolder);
112 112
 
113 113
 	// save module tables
114 114
     foreach ($tables as $table) {
115
-        \Xmf\Database\TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml');
115
+        \Xmf\Database\TableLoad::saveTableToYamlFile($table, $exportFolder.$table.'.yml');
116 116
     }
117 117
 	
118 118
 	// save permissions
119 119
 	$criteria = new \CriteriaCompo();
120 120
     $criteria->add(new \Criteria('gperm_modid', \Xmf\Module\Helper::getHelper($moduleDirName)->getModule()->getVar('mid')));
121 121
     $skipColumns[] = 'gperm_id';
122
-    \Xmf\Database\TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns);
122
+    \Xmf\Database\TableLoad::saveTableToYamlFile('group_permission', $exportFolder.'group_permission.yml', $criteria, $skipColumns);
123 123
     unset($criteria);
124 124
     
125 125
     //  ---  COPY test folder files ---------------
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
             Utility::rcopy($src, $dest);
131 131
         }
132 132
     }
133
-    redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS'));
133
+    redirect_header('../admin/index.php', 1, constant('CO_'.$moduleDirNameUpper.'_'.'SAMPLEDATA_SUCCESS'));
134 134
 }
135 135
 
136 136
 function exportSchema()
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         //        redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS'));
147 147
     }
148 148
     catch (\Exception $e) {
149
-        exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR'));
149
+        exit(constant('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR'));
150 150
     }
151 151
 
152 152
 }
@@ -171,12 +171,12 @@  discard block
 block discarded – undo
171 171
     $prefixedTable = $db->prefix($table);
172 172
     $count         = 0;
173 173
 
174
-    $sql = 'DELETE FROM ' . $prefixedTable . ' WHERE `' . $search . '`=' . $db->quote($replace);
174
+    $sql = 'DELETE FROM '.$prefixedTable.' WHERE `'.$search.'`='.$db->quote($replace);
175 175
 
176 176
     $result = $db->queryF($sql);
177 177
 
178 178
     foreach ($data as $row) {
179
-        $insertInto  = 'INSERT INTO ' . $prefixedTable . ' (';
179
+        $insertInto  = 'INSERT INTO '.$prefixedTable.' (';
180 180
         $valueClause = ' VALUES (';
181 181
         $first       = true;
182 182
         foreach ($row as $column => $value) {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             }
196 196
         }
197 197
 
198
-        $sql = $insertInto . ') ' . $valueClause . ')';
198
+        $sql = $insertInto.') '.$valueClause.')';
199 199
 
200 200
         $result = $db->queryF($sql);
201 201
         if (false !== $result) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,8 +119,7 @@
 block discarded – undo
119 119
         //        $migrate->saveCurrentSchema();
120 120
         //
121 121
         //        redirect_header('../admin/index.php', 1, constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS'));
122
-    }
123
-    catch (\Exception $e) {
122
+    } catch (\Exception $e) {
124 123
         exit(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR'));
125 124
     }
126 125
 
Please login to merge, or discard this patch.
commonfiles/class/Helper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
      */
71 71
     public function getHandler($name)
72 72
     {
73
-        $class = '\\XoopsModules\\' . ucfirst(mb_strtolower(basename(dirname(__DIR__)))) . '\\' . $name . 'Handler';
73
+        $class = '\\XoopsModules\\'.ucfirst(mb_strtolower(basename(dirname(__DIR__)))).'\\'.$name.'Handler';
74 74
         if (!class_exists($class)) {
75 75
             throw new \RuntimeException("Class '$class' not found");
76 76
         }
Please login to merge, or discard this patch.
commonfiles/class/Utility.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -189,14 +189,14 @@
 block discarded – undo
189 189
         $donationform = [
190 190
             0   => '<form name="donation" id="donation" action="http://www.txmodxoops.org/modules/xdonations/" method="post" onsubmit="return xoopsFormValidate_donation();">',
191 191
             1   => '<table class="outer" cellspacing="1" width="100%"><tbody><tr><th colspan="2">'
192
-                   . _AM_TDMCREATE_ABOUT_MAKE_DONATION
193
-                   . '</th></tr><tr align="left" valign="top"><td class="head"><div class="xoops-form-element-caption-required"><span class="caption-text">'
194
-                   . _AM_TDMCREATE_DONATION_AMOUNT
195
-                   . '</span><span class="caption-marker">*</span></div></td><td class="even"><select size="1" name="item[A][amount]" id="item[A][amount]" title="Donation Amount"><option value="5">5.00 EUR</option><option value="10">10.00 EUR</option><option value="20">20.00 EUR</option><option value="40">40.00 EUR</option><option value="60">60.00 EUR</option><option value="80">80.00 EUR</option><option value="90">90.00 EUR</option><option value="100">100.00 EUR</option><option value="200">200.00 EUR</option></select></td></tr><tr align="left" valign="top"><td class="head"></td><td class="even"><input class="formButton" name="submit" id="submit" value="'
196
-                   . _SUBMIT
197
-                   . '" title="'
198
-                   . _SUBMIT
199
-                   . '" type="submit"></td></tr></tbody></table>',
192
+                    . _AM_TDMCREATE_ABOUT_MAKE_DONATION
193
+                    . '</th></tr><tr align="left" valign="top"><td class="head"><div class="xoops-form-element-caption-required"><span class="caption-text">'
194
+                    . _AM_TDMCREATE_DONATION_AMOUNT
195
+                    . '</span><span class="caption-marker">*</span></div></td><td class="even"><select size="1" name="item[A][amount]" id="item[A][amount]" title="Donation Amount"><option value="5">5.00 EUR</option><option value="10">10.00 EUR</option><option value="20">20.00 EUR</option><option value="40">40.00 EUR</option><option value="60">60.00 EUR</option><option value="80">80.00 EUR</option><option value="90">90.00 EUR</option><option value="100">100.00 EUR</option><option value="200">200.00 EUR</option></select></td></tr><tr align="left" valign="top"><td class="head"></td><td class="even"><input class="formButton" name="submit" id="submit" value="'
196
+                    . _SUBMIT
197
+                    . '" title="'
198
+                    . _SUBMIT
199
+                    . '" type="submit"></td></tr></tbody></table>',
200 200
             2   => '<input name="op" id="op" value="createinvoice" type="hidden"><input name="plugin" id="plugin" value="donations" type="hidden"><input name="donation" id="donation" value="1" type="hidden"><input name="drawfor" id="drawfor" value="Chronolabs Co-Operative" type="hidden"><input name="drawto" id="drawto" value="%s" type="hidden"><input name="drawto_email" id="drawto_email" value="%s" type="hidden"><input name="key" id="key" value="%s" type="hidden"><input name="currency" id="currency" value="EUR" type="hidden"><input name="weight_unit" id="weight_unit" value="kgs" type="hidden"><input name="item[A][cat]" id="item[A][cat]" value="XDN%s" type="hidden"><input name="item[A][name]" id="item[A][name]" value="Donation for %s" type="hidden"><input name="item[A][quantity]" id="item[A][quantity]" value="1" type="hidden"><input name="item[A][shipping]" id="item[A][shipping]" value="0" type="hidden"><input name="item[A][handling]" id="item[A][handling]" value="0" type="hidden"><input name="item[A][weight]" id="item[A][weight]" value="0" type="hidden"><input name="item[A][tax]" id="item[A][tax]" value="0" type="hidden"><input name="return" id="return" value="http://www.txmodxoops.org/modules/xdonations/success.php" type="hidden"><input name="cancel" id="cancel" value="http://www.txmodxoops.org/modules/xdonations/success.php" type="hidden"></form>',
201 201
             'D' => '',
202 202
             3   => '',
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,11 +56,11 @@  discard block
 block discarded – undo
56 56
     {
57 57
         if ($considerHtml) {
58 58
             // if the plain text is shorter than the maximum length, return the whole text
59
-            if (mb_strlen(preg_replace('/<.*?' . '>/', '', $text)) <= $length) {
59
+            if (mb_strlen(preg_replace('/<.*?'.'>/', '', $text)) <= $length) {
60 60
                 return $text;
61 61
             }
62 62
             // splits all html-tags to scanable lines
63
-            preg_match_all('/(<.+?' . '>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);
63
+            preg_match_all('/(<.+?'.'>)?([^<>]*)/s', $text, $lines, PREG_SET_ORDER);
64 64
             $total_length = mb_strlen($ending);
65 65
             $open_tags    = [];
66 66
             $truncate     = '';
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                             unset($open_tags[$pos]);
79 79
                         }
80 80
                         // if tag is an opening tag
81
-                    } elseif (preg_match('/^<\s*([^\s>!]+).*?' . '>$/s', $line_matchings[1], $tag_matchings)) {
81
+                    } elseif (preg_match('/^<\s*([^\s>!]+).*?'.'>$/s', $line_matchings[1], $tag_matchings)) {
82 82
                         // add tag to the beginning of $open_tags list
83 83
                         array_unshift($open_tags, mb_strtolower($tag_matchings[1]));
84 84
                     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         if ($considerHtml) {
137 137
             // close all unclosed html-tags
138 138
             foreach ($open_tags as $tag) {
139
-                $truncate .= '</' . $tag . '>';
139
+                $truncate .= '</'.$tag.'>';
140 140
             }
141 141
         }
142 142
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 //--></script>
210 210
 <!-- End Form Validation JavaScript //-->',
211 211
         ];
212
-        $paypalform   = [
212
+        $paypalform = [
213 213
             0 => '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">',
214 214
             1 => '<input name="cmd" value="_s-xclick" type="hidden">',
215 215
             2 => '<input name="hosted_button_id" value="%s" type="hidden">',
@@ -222,11 +222,11 @@  discard block
 block discarded – undo
222 222
                 case 2:
223 223
                     $donationform[$key] = sprintf(
224 224
                         $donationform[$key],
225
-                        $GLOBALS['xoopsConfig']['sitename'] . ' - ' . ('' != $GLOBALS['xoopsUser']->getVar('name') ? $GLOBALS['xoopsUser']->getVar('name') . ' [' . $GLOBALS['xoopsUser']->getVar('uname') . ']' : $GLOBALS['xoopsUser']->getVar('uname')),
225
+                        $GLOBALS['xoopsConfig']['sitename'].' - '.('' != $GLOBALS['xoopsUser']->getVar('name') ? $GLOBALS['xoopsUser']->getVar('name').' ['.$GLOBALS['xoopsUser']->getVar('uname').']' : $GLOBALS['xoopsUser']->getVar('uname')),
226 226
                         $GLOBALS['xoopsUser']->getVar('email'),
227 227
                         XOOPS_LICENSE_KEY,
228 228
                         mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')),
229
-                        mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')) . ' ' . $GLOBALS['xoopsModule']->getVar('name')
229
+                        mb_strtoupper($GLOBALS['xoopsModule']->getVar('dirname')).' '.$GLOBALS['xoopsModule']->getVar('name')
230 230
                     );
231 231
                     break;
232 232
             }
Please login to merge, or discard this patch.
commonfiles/class/Common/Configurator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         //        require dirname(dirname(__DIR__)) . '/config/config.php';
52 52
         //        $config = getConfig();
53 53
 
54
-        $config = include dirname(dirname(__DIR__)) . '/config/config.php';
54
+        $config = include dirname(dirname(__DIR__)).'/config/config.php';
55 55
 
56 56
         $this->name            = $config->name;
57 57
         $this->paths           = $config->paths;
Please login to merge, or discard this patch.
commonfiles/class/Common/FilesManagement.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                     throw new \RuntimeException(sprintf('Unable to create the %s directory', $folder));
36 36
                 }
37 37
 
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
         } catch (\Exception $e) {
41 41
             echo 'Caught exception: ', $e->getMessage(), '<br>';
@@ -61,14 +61,14 @@  discard block
 block discarded – undo
61 61
         $dir = opendir($src);
62 62
         //        @mkdir($dst);
63 63
         if (!@mkdir($dst) && !is_dir($dst)) {
64
-            throw new \RuntimeException('The directory ' . $dst . ' could not be created.');
64
+            throw new \RuntimeException('The directory '.$dst.' could not be created.');
65 65
         }
66 66
         while (false !== ($file = readdir($dir))) {
67 67
             if (('.' !== $file) && ('..' !== $file)) {
68
-                if (is_dir($src . '/' . $file)) {
69
-                    self::recurseCopy($src . '/' . $file, $dst . '/' . $file);
68
+                if (is_dir($src.'/'.$file)) {
69
+                    self::recurseCopy($src.'/'.$file, $dst.'/'.$file);
70 70
                 } else {
71
-                    copy($src . '/' . $file, $dst . '/' . $file);
71
+                    copy($src.'/'.$file, $dst.'/'.$file);
72 72
                 }
73 73
             }
74 74
         }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                 self::rrmdir($fObj->getPathname());
208 208
             }
209 209
         }
210
-        $iterator = null;   // clear iterator Obj to close file/directory
210
+        $iterator = null; // clear iterator Obj to close file/directory
211 211
         return rmdir($src); // remove the directory & return results
212 212
     }
213 213
 
@@ -240,14 +240,14 @@  discard block
 block discarded – undo
240 240
         $iterator = new \DirectoryIterator($src);
241 241
         foreach ($iterator as $fObj) {
242 242
             if ($fObj->isFile()) {
243
-                rename($fObj->getPathname(), "{$dest}/" . $fObj->getFilename());
243
+                rename($fObj->getPathname(), "{$dest}/".$fObj->getFilename());
244 244
             } elseif (!$fObj->isDot() && $fObj->isDir()) {
245 245
                 // Try recursively on directory
246
-                self::rmove($fObj->getPathname(), "{$dest}/" . $fObj->getFilename());
246
+                self::rmove($fObj->getPathname(), "{$dest}/".$fObj->getFilename());
247 247
                 //                rmdir($fObj->getPath()); // now delete the directory
248 248
             }
249 249
         }
250
-        $iterator = null;   // clear iterator Obj to close file/directory
250
+        $iterator = null; // clear iterator Obj to close file/directory
251 251
         return rmdir($src); // remove the directory & return results
252 252
     }
253 253
 
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
         $iterator = new \DirectoryIterator($src);
284 284
         foreach ($iterator as $fObj) {
285 285
             if ($fObj->isFile()) {
286
-                copy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename());
286
+                copy($fObj->getPathname(), "{$dest}/".$fObj->getFilename());
287 287
             } elseif (!$fObj->isDot() && $fObj->isDir()) {
288
-                self::rcopy($fObj->getPathname(), "{$dest}/" . $fObj->getFilename());
288
+                self::rcopy($fObj->getPathname(), "{$dest}/".$fObj->getFilename());
289 289
             }
290 290
         }
291 291
 
Please login to merge, or discard this patch.
commonfiles/class/Common/ServerStats.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -36,19 +36,19 @@  discard block
 block discarded – undo
36 36
         //        $query = $GLOBALS['xoopsDB']->query($sql);
37 37
         //        list($meta) = $GLOBALS['xoopsDB']->fetchRow($query);
38 38
         $html .= '<fieldset>';
39
-        $html .= "<legend style='font-weight: bold; color: #900;'>" . constant('CO_' . $moduleDirNameUpper . '_IMAGEINFO') . '</legend>';
39
+        $html .= "<legend style='font-weight: bold; color: #900;'>".constant('CO_'.$moduleDirNameUpper.'_IMAGEINFO').'</legend>';
40 40
         $html .= "<div style='padding: 8px;'>";
41 41
         //        $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_METAVERSION') . $meta . "</div>";
42 42
         //        $html .= "<br>";
43 43
         //        $html .= "<br>";
44
-        $html .= '<div>' . constant('CO_' . $moduleDirNameUpper . '_SPHPINI') . '</div>';
44
+        $html .= '<div>'.constant('CO_'.$moduleDirNameUpper.'_SPHPINI').'</div>';
45 45
         $html .= '<ul>';
46 46
 
47
-        $gdlib = function_exists('gd_info') ? '<span style="color: #008000;">' . constant('CO_' . $moduleDirNameUpper . '_GDON') . '</span>' : '<span style="color: #ff0000;">' . constant('CO_' . $moduleDirNameUpper . '_GDOFF') . '</span>';
48
-        $html  .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBSTATUS') . $gdlib;
47
+        $gdlib = function_exists('gd_info') ? '<span style="color: #008000;">'.constant('CO_'.$moduleDirNameUpper.'_GDON').'</span>' : '<span style="color: #ff0000;">'.constant('CO_'.$moduleDirNameUpper.'_GDOFF').'</span>';
48
+        $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBSTATUS').$gdlib;
49 49
         if (function_exists('gd_info')) {
50 50
             if (true === ($gdlib = gd_info())) {
51
-                $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_GDLIBVERSION') . '<b>' . $gdlib['GD Version'] . '</b>';
51
+                $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_GDLIBVERSION').'<b>'.$gdlib['GD Version'].'</b>';
52 52
             }
53 53
         }
54 54
 
@@ -58,18 +58,18 @@  discard block
 block discarded – undo
58 58
         //    $registerglobals = (!ini_get('register_globals')) ? "<span style=\"color: #008000;\">" . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>' : "<span style=\"color: #ff0000;\">" . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>';
59 59
         //    $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_REGISTERGLOBALS . $registerglobals;
60 60
 
61
-        $downloads = ini_get('file_uploads') ? '<span style="color: #008000;">' . constant('CO_' . $moduleDirNameUpper . '_ON') . '</span>' : '<span style="color: #ff0000;">' . constant('CO_' . $moduleDirNameUpper . '_OFF') . '</span>';
62
-        $html      .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERUPLOADSTATUS') . $downloads;
61
+        $downloads = ini_get('file_uploads') ? '<span style="color: #008000;">'.constant('CO_'.$moduleDirNameUpper.'_ON').'</span>' : '<span style="color: #ff0000;">'.constant('CO_'.$moduleDirNameUpper.'_OFF').'</span>';
62
+        $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERUPLOADSTATUS').$downloads;
63 63
 
64
-        $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXUPLOADSIZE') . ' <b><span style="color: #0000ff;">' . ini_get('upload_max_filesize') . '</span></b>';
65
-        $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MAXPOSTSIZE') . ' <b><span style="color: #0000ff;">' . ini_get('post_max_size') . '</span></b>';
66
-        $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_MEMORYLIMIT') . ' <b><span style="color: #0000ff;">' . ini_get('memory_limit') . '</span></b>';
64
+        $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXUPLOADSIZE').' <b><span style="color: #0000ff;">'.ini_get('upload_max_filesize').'</span></b>';
65
+        $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MAXPOSTSIZE').' <b><span style="color: #0000ff;">'.ini_get('post_max_size').'</span></b>';
66
+        $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_MEMORYLIMIT').' <b><span style="color: #0000ff;">'.ini_get('memory_limit').'</span></b>';
67 67
         $html .= '</ul>';
68 68
         $html .= '<ul>';
69
-        $html .= '<li>' . constant('CO_' . $moduleDirNameUpper . '_SERVERPATH') . ' <b>' . XOOPS_ROOT_PATH . '</b>';
69
+        $html .= '<li>'.constant('CO_'.$moduleDirNameUpper.'_SERVERPATH').' <b>'.XOOPS_ROOT_PATH.'</b>';
70 70
         $html .= '</ul>';
71 71
         $html .= '<br>';
72
-        $html .= constant('CO_' . $moduleDirNameUpper . '_UPLOADPATHDSC') . '';
72
+        $html .= constant('CO_'.$moduleDirNameUpper.'_UPLOADPATHDSC').'';
73 73
         $html .= '</div>';
74 74
         $html .= '</fieldset><br>';
75 75
 
Please login to merge, or discard this patch.
commonfiles/class/Common/ModuleFeedback.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -71,29 +71,29 @@  discard block
 block discarded – undo
71 71
         $moduleDirNameUpper = mb_strtoupper($moduleDirName);
72 72
         // Get Theme Form
73 73
         xoops_load('XoopsFormLoader');
74
-        $form = new \XoopsThemeForm(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_FORM_TITLE'), 'formfeedback', 'feedback.php', 'post', true);
74
+        $form = new \XoopsThemeForm(constant('CO_'.$moduleDirNameUpper.'_'.'FB_FORM_TITLE'), 'formfeedback', 'feedback.php', 'post', true);
75 75
         $form->setExtra('enctype="multipart/form-data"');
76 76
 
77
-        $recipient = new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_RECIPIENT'), 'recipient', 50, 255, $GLOBALS['xoopsModule']->getInfo('author_mail'));
77
+        $recipient = new \XoopsFormText(constant('CO_'.$moduleDirNameUpper.'_'.'FB_RECIPIENT'), 'recipient', 50, 255, $GLOBALS['xoopsModule']->getInfo('author_mail'));
78 78
         $recipient->setExtra('disabled="disabled"');
79 79
         $form->addElement($recipient);
80
-        $your_name = new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME'), 'your_name', 50, 255, $this->name);
81
-        $your_name->setExtra('placeholder="' . constant('CO_' . $moduleDirNameUpper . '_' . 'FB_NAME_PLACEHOLER') . '"');
80
+        $your_name = new \XoopsFormText(constant('CO_'.$moduleDirNameUpper.'_'.'FB_NAME'), 'your_name', 50, 255, $this->name);
81
+        $your_name->setExtra('placeholder="'.constant('CO_'.$moduleDirNameUpper.'_'.'FB_NAME_PLACEHOLER').'"');
82 82
         $form->addElement($your_name);
83
-        $your_site = new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE'), 'your_site', 50, 255, $this->site);
84
-        $your_site->setExtra('placeholder="' . constant('CO_' . $moduleDirNameUpper . '_' . 'FB_SITE_PLACEHOLER') . '"');
83
+        $your_site = new \XoopsFormText(constant('CO_'.$moduleDirNameUpper.'_'.'FB_SITE'), 'your_site', 50, 255, $this->site);
84
+        $your_site->setExtra('placeholder="'.constant('CO_'.$moduleDirNameUpper.'_'.'FB_SITE_PLACEHOLER').'"');
85 85
         $form->addElement($your_site);
86
-        $your_mail = new \XoopsFormText(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL'), 'your_mail', 50, 255, $this->email);
87
-        $your_mail->setExtra('placeholder="' . constant('CO_' . $moduleDirNameUpper . '_' . 'FB_MAIL_PLACEHOLER') . '"');
86
+        $your_mail = new \XoopsFormText(constant('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL'), 'your_mail', 50, 255, $this->email);
87
+        $your_mail->setExtra('placeholder="'.constant('CO_'.$moduleDirNameUpper.'_'.'FB_MAIL_PLACEHOLER').'"');
88 88
         $form->addElement($your_mail);
89 89
 
90
-        $fbtypeSelect = new \XoopsFormSelect(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE'), 'fb_type', $this->type);
90
+        $fbtypeSelect = new \XoopsFormSelect(constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE'), 'fb_type', $this->type);
91 91
         $fbtypeSelect->addOption('', '');
92
-        $fbtypeSelect->addOption(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION'), constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_SUGGESTION'));
93
-        $fbtypeSelect->addOption(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS'), constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_BUGS'));
94
-        $fbtypeSelect->addOption(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL'), constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_TESTIMONIAL'));
95
-        $fbtypeSelect->addOption(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES'), constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_FEATURES'));
96
-        $fbtypeSelect->addOption(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS'), constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_OTHERS'));
92
+        $fbtypeSelect->addOption(constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_SUGGESTION'), constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_SUGGESTION'));
93
+        $fbtypeSelect->addOption(constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_BUGS'), constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_BUGS'));
94
+        $fbtypeSelect->addOption(constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_TESTIMONIAL'), constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_TESTIMONIAL'));
95
+        $fbtypeSelect->addOption(constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_FEATURES'), constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_FEATURES'));
96
+        $fbtypeSelect->addOption(constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_OTHERS'), constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_OTHERS'));
97 97
         $form->addElement($fbtypeSelect, true);
98 98
 
99 99
         $editorConfigs           = [];
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $configHandler           = xoops_getHandler('config');
109 109
         $config                  = &$configHandler->getConfigsByCat(0, $module->getVar('mid'));
110 110
         $editorConfigs['editor'] = $config['general_editor'];
111
-        $editor                  = new \XoopsFormEditor(constant('CO_' . $moduleDirNameUpper . '_' . 'FB_TYPE_CONTENT'), 'fb_content', $editorConfigs);
111
+        $editor                  = new \XoopsFormEditor(constant('CO_'.$moduleDirNameUpper.'_'.'FB_TYPE_CONTENT'), 'fb_content', $editorConfigs);
112 112
         $form->addElement($editor, true);
113 113
 
114 114
         $form->addElement(new \XoopsFormHidden('op', 'send'));
Please login to merge, or discard this patch.