Completed
Push — master ( e9c2cc...266444 )
by Michael
01:47
created
include/oninstall.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 {
31 31
     $moduleDirName = basename(dirname(__DIR__));
32 32
     /** @var ContactUtility $utilityClass */
33
-    $utilityClass    = ucfirst($moduleDirName) . 'Utility';
33
+    $utilityClass = ucfirst($moduleDirName).'Utility';
34 34
     if (!class_exists($utilityClass)) {
35 35
         xoops_load('utility', $moduleDirName);
36 36
     }
@@ -38,10 +38,10 @@  discard block
 block discarded – undo
38 38
     $xoopsSuccess = $utilityClass::checkVerXoops($module);
39 39
     $phpSuccess   = $utilityClass::checkVerPhp($module);
40 40
 
41
-    if (false !== $xoopsSuccess && false !==  $phpSuccess) {
42
-        $mod_tables =& $module->getInfo('tables');
41
+    if (false !== $xoopsSuccess && false !== $phpSuccess) {
42
+        $mod_tables = & $module->getInfo('tables');
43 43
         foreach ($mod_tables as $table) {
44
-            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
44
+            $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';');
45 45
         }
46 46
     }
47 47
     return $xoopsSuccess && $phpSuccess;
@@ -56,8 +56,8 @@  discard block
 block discarded – undo
56 56
  */
57 57
 function xoops_module_install_contact(XoopsModule $module)
58 58
 {
59
-    require_once  __DIR__ . '/../../../mainfile.php';
60
-    require_once  __DIR__ . '/../include/config.php';
59
+    require_once  __DIR__.'/../../../mainfile.php';
60
+    require_once  __DIR__.'/../include/config.php';
61 61
 
62 62
     $moduleDirName = basename(dirname(__DIR__));
63 63
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     $moduleHelper->loadLanguage('modinfo');
72 72
 
73 73
     $configurator = new ContactConfigurator();
74
-    $classUtility    = ucfirst($moduleDirName) . 'Utility';
74
+    $classUtility = ucfirst($moduleDirName).'Utility';
75 75
     if (!class_exists($classUtility)) {
76 76
         xoops_load('utility', $moduleDirName);
77 77
     }
@@ -82,11 +82,11 @@  discard block
 block discarded – undo
82 82
     $moduleId2    = $moduleHelper->getModule()->mid();
83 83
     $gpermHandler = xoops_getHandler('groupperm');
84 84
     // access rights ------------------------------------------
85
-    $gpermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
86
-    $gpermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
87
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
88
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
89
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
85
+    $gpermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
86
+    $gpermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
87
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
88
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId);
89
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
90 90
 
91 91
     //  ---  CREATE FOLDERS ---------------
92 92
     if (count($configurator->uploadFolders) > 0) {
@@ -98,14 +98,14 @@  discard block
 block discarded – undo
98 98
 
99 99
     //  ---  COPY blank.png FILES ---------------
100 100
     if (count($configurator->blankFiles) > 0) {
101
-        $file = __DIR__ . '/../assets/images/blank.png';
101
+        $file = __DIR__.'/../assets/images/blank.png';
102 102
         foreach (array_keys($configurator->blankFiles) as $i) {
103
-            $dest = $configurator->blankFiles[$i] . '/blank.png';
103
+            $dest = $configurator->blankFiles[$i].'/blank.png';
104 104
             $classUtility::copyFile($file, $dest);
105 105
         }
106 106
     }
107 107
     //delete .html entries from the tpl table
108
-    $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
108
+    $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'";
109 109
     $GLOBALS['xoopsDB']->queryF($sql);
110 110
 
111 111
     return true;
Please login to merge, or discard this patch.
include/onupdate.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof XoopsUser)
25 25
     || !$GLOBALS['xoopsUser']->IsAdmin()
26 26
 ) {
27
-    exit('Restricted access' . PHP_EOL);
27
+    exit('Restricted access'.PHP_EOL);
28 28
 }
29 29
 
30 30
 /**
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 {
51 51
     $moduleDirName = basename(dirname(__DIR__));
52 52
     /** @var ContactUtility $utilityClass */
53
-    $utilityClass = ucfirst($moduleDirName) . 'Utility';
53
+    $utilityClass = ucfirst($moduleDirName).'Utility';
54 54
     if (!class_exists($utilityClass)) {
55 55
         xoops_load('utility', $moduleDirName);
56 56
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
78 78
 
79 79
     if ($previousVersion < 180) {
80
-        $sql = 'CREATE TABLE ' . $xoopsDB->prefix('contact') . ' (
80
+        $sql = 'CREATE TABLE '.$xoopsDB->prefix('contact').' (
81 81
         contact_id int(10) unsigned NOT NULL auto_increment,
82 82
         contact_uid int(10) NOT NULL,
83 83
         contact_cid int(10) NOT NULL,
@@ -102,39 +102,39 @@  discard block
 block discarded – undo
102 102
 
103 103
     if ($previousVersion < 181) {
104 104
         // Add contact_platform
105
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . "` ADD `contact_platform` ENUM('Android','Ios','Web') NOT NULL DEFAULT 'Web'";
105
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact')."` ADD `contact_platform` ENUM('Android','Ios','Web') NOT NULL DEFAULT 'Web'";
106 106
         $xoopsDB->query($sql);
107 107
         // Add contact_type
108
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . "` ADD `contact_type` ENUM('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact'";
108
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact')."` ADD `contact_type` ENUM('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact'";
109 109
         $xoopsDB->query($sql);
110 110
         // Add index contact_uid
111
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_uid` ( `contact_uid` )';
111
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_uid` ( `contact_uid` )';
112 112
         $xoopsDB->query($sql);
113 113
         // Add index contact_cid
114
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_cid` ( `contact_cid` )';
114
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_cid` ( `contact_cid` )';
115 115
         $xoopsDB->query($sql);
116 116
         // Add index contact_create
117
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_create` ( `contact_create` )';
117
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_create` ( `contact_create` )';
118 118
         $xoopsDB->query($sql);
119 119
         // Add index contact_mail
120
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_mail` ( `contact_mail` )';
120
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_mail` ( `contact_mail` )';
121 121
         $xoopsDB->query($sql);
122 122
         // Add index contact_phone
123
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_phone` ( `contact_phone` )';
123
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_phone` ( `contact_phone` )';
124 124
         $xoopsDB->query($sql);
125 125
         // Add index contact_platform
126
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_platform` ( `contact_platform` )';
126
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_platform` ( `contact_platform` )';
127 127
         $xoopsDB->query($sql);
128 128
         // Add index contact_type
129
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_type` ( `contact_type` )';
129
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_type` ( `contact_type` )';
130 130
         $xoopsDB->query($sql);
131 131
     }
132 132
 
133 133
     if ($previousVersion < 226) {
134
-        require_once __DIR__ . '/config.php';
134
+        require_once __DIR__.'/config.php';
135 135
         $configurator = new ContactConfigurator();
136 136
         /** @var ContactUtility $utilityClass */
137
-        $utilityClass    = ucfirst($moduleDirName) . 'Utility';
137
+        $utilityClass = ucfirst($moduleDirName).'Utility';
138 138
         if (!class_exists($utilityClass)) {
139 139
             xoops_load('utility', $moduleDirName);
140 140
         }
@@ -142,14 +142,14 @@  discard block
 block discarded – undo
142 142
         //delete old HTML templates
143 143
         if (count($configurator->templateFolders) > 0) {
144 144
             foreach ($configurator->templateFolders as $folder) {
145
-                $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder);
145
+                $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder);
146 146
                 if (is_dir($templateFolder)) {
147 147
                     $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), array('..', '.'));
148 148
                     foreach ($templateList as $k => $v) {
149
-                        $fileInfo = new SplFileInfo($templateFolder . $v);
149
+                        $fileInfo = new SplFileInfo($templateFolder.$v);
150 150
                         if ($fileInfo->getExtension() === 'html' && $fileInfo->getFilename() !== 'index.html') {
151
-                            if (file_exists($templateFolder . $v)) {
152
-                                unlink($templateFolder . $v);
151
+                            if (file_exists($templateFolder.$v)) {
152
+                                unlink($templateFolder.$v);
153 153
                             }
154 154
                         }
155 155
                     }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         if (count($configurator->oldFiles) > 0) {
162 162
             //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
163 163
             foreach (array_keys($configurator->oldFiles) as $i) {
164
-                $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]);
164
+                $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]);
165 165
                 if (is_file($tempFile)) {
166 166
                     unlink($tempFile);
167 167
                 }
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         if (count($configurator->oldFolders) > 0) {
174 174
             //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
175 175
             foreach (array_keys($configurator->oldFolders) as $i) {
176
-                $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]);
176
+                $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]);
177 177
                 /* @var $folderHandler XoopsObjectHandler */
178 178
                 $folderHandler = XoopsFile::getHandler('folder', $tempFolder);
179 179
                 $folderHandler->delete($tempFolder);
@@ -190,15 +190,15 @@  discard block
 block discarded – undo
190 190
 
191 191
         //  ---  COPY blank.png FILES ---------------
192 192
         if (count($configurator->blankFiles) > 0) {
193
-            $file = __DIR__ . '/../assets/images/blank.png';
193
+            $file = __DIR__.'/../assets/images/blank.png';
194 194
             foreach (array_keys($configurator->blankFiles) as $i) {
195
-                $dest = $configurator->blankFiles[$i] . '/blank.png';
195
+                $dest = $configurator->blankFiles[$i].'/blank.png';
196 196
                 $utilityClass::copyFile($file, $dest);
197 197
             }
198 198
         }
199 199
 
200 200
         //delete .html entries from the tpl table
201
-        $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\'';
201
+        $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\'';
202 202
         $GLOBALS['xoopsDB']->queryF($sql);
203 203
 
204 204
         /** @var XoopsGroupPermHandler $gpermHandler */
Please login to merge, or discard this patch.