Completed
Push — master ( 720064...d5ad83 )
by Michael
02:05
created
blocks/block_contact_form_map.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
     xoops_loadLanguage('main', 'contact');
72 72
 
73
-    require_once XOOPS_ROOT_PATH . '/modules/contact/class/contact.php';
73
+    require_once XOOPS_ROOT_PATH.'/modules/contact/class/contact.php';
74 74
 
75 75
     $block['lng_username'] = 'name';
76 76
 
Please login to merge, or discard this patch.
header.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,9 +19,9 @@
 block discarded – undo
19 19
  * @author      Hossein Azizabadi (AKA Voltan)
20 20
  */
21 21
 
22
-include __DIR__ . '/../../mainfile.php';
23
-include __DIR__ . '/class/contact.php';
24
-require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
22
+include __DIR__.'/../../mainfile.php';
23
+include __DIR__.'/class/contact.php';
24
+require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php';
25 25
 
26 26
 /** @var ContactContactHandler $contactHandler*/
27 27
 $contactHandler = xoops_getModuleHandler('contact', $moduleDirName);
Please login to merge, or discard this patch.
include/config.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -17,27 +17,27 @@  discard block
 block discarded – undo
17 17
  * @author       XOOPS Development Team
18 18
  */
19 19
 
20
-require_once __DIR__ . '/../../../mainfile.php';
20
+require_once __DIR__.'/../../../mainfile.php';
21 21
 
22 22
 $moduleDirName = basename(dirname(__DIR__));
23 23
 $capsDirName   = strtoupper($moduleDirName);
24 24
 
25
-if (!defined($capsDirName . '_DIRNAME')) {
25
+if (!defined($capsDirName.'_DIRNAME')) {
26 26
     //if (!defined(constant($capsDirName . '_DIRNAME'))) {
27
-    define($capsDirName . '_DIRNAME', $GLOBALS['xoopsModule']->dirname());
28
-    define($capsDirName . '_PATH', XOOPS_ROOT_PATH . '/modules/' . constant($capsDirName . '_DIRNAME'));
29
-    define($capsDirName . '_URL', XOOPS_URL . '/modules/' . constant($capsDirName . '_DIRNAME'));
30
-    define($capsDirName . '_ADMIN', constant($capsDirName . '_URL') . '/admin/index.php');
31
-    define($capsDirName . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . constant($capsDirName . '_DIRNAME'));
32
-    define($capsDirName . '_AUTHOR_LOGOIMG', constant($capsDirName . '_URL') . '/assets/images/logoModule.png');
27
+    define($capsDirName.'_DIRNAME', $GLOBALS['xoopsModule']->dirname());
28
+    define($capsDirName.'_PATH', XOOPS_ROOT_PATH.'/modules/'.constant($capsDirName.'_DIRNAME'));
29
+    define($capsDirName.'_URL', XOOPS_URL.'/modules/'.constant($capsDirName.'_DIRNAME'));
30
+    define($capsDirName.'_ADMIN', constant($capsDirName.'_URL').'/admin/index.php');
31
+    define($capsDirName.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.constant($capsDirName.'_DIRNAME'));
32
+    define($capsDirName.'_AUTHOR_LOGOIMG', constant($capsDirName.'_URL').'/assets/images/logoModule.png');
33 33
 }
34 34
 
35 35
 // Define here the place where main upload path
36 36
 
37 37
 //$img_dir = $GLOBALS['xoopsModuleConfig']['uploaddir'];
38 38
 
39
-define($capsDirName . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash
40
-define($capsDirName . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash
39
+define($capsDirName.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash
40
+define($capsDirName.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash
41 41
 
42 42
 //constant($cloned_lang . '_CATEGORY_NOTIFY')
43 43
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             //            constant($capsDirName . '_UPLOAD_PATH') . '/midsize',
85 85
             //            constant($capsDirName . '_UPLOAD_PATH') . '/thumbs',
86 86
         ];
87
-        $this->blankFiles    = [
87
+        $this->blankFiles = [
88 88
             //            constant($capsDirName . '_UPLOAD_PATH'),
89 89
             //            constant($capsDirName . '_UPLOAD_PATH') . '/midsize',
90 90
             //            constant($capsDirName . '_UPLOAD_PATH') . '/thumbs',
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
             '/templates/admin/'
97 97
 
98 98
         ];
99
-        $this->oldFiles        = [
99
+        $this->oldFiles = [
100 100
             '/include/functions.php',
101 101
             '/include/functions_update.php',
102 102
             '/LICENSE',
103 103
             '/readme.html',
104 104
         ];
105
-        $this->oldFolders      = [
105
+        $this->oldFolders = [
106 106
             '/images',
107 107
             '/css',
108 108
             '/js',
@@ -112,4 +112,4 @@  discard block
 block discarded – undo
112 112
 
113 113
 // module information
114 114
 $modCopyright = "<a href='http://xoops.org' title='XOOPS Project' target='_blank'>
115
-                     <img src='" . constant($capsDirName . '_AUTHOR_LOGOIMG') . '\' alt=\'XOOPS Project\' /></a>';
115
+                     <img src='" . constant($capsDirName.'_AUTHOR_LOGOIMG').'\' alt=\'XOOPS Project\' /></a>';
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
 /**
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 function xoops_module_pre_update_xxxx(XoopsModule $module)
50 50
 {
51 51
     $moduleDirName = basename(dirname(__DIR__));
52
-    $classUtility     = ucfirst($moduleDirName) . 'Utility';
52
+    $classUtility = ucfirst($moduleDirName).'Utility';
53 53
     if (!class_exists($classUtility)) {
54 54
         xoops_load('utility', $moduleDirName);
55 55
     }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
     $xoopsDB = XoopsDatabaseFactory::getDatabaseConnection();
83 83
 
84 84
     if ($previousVersion < 180) {
85
-        $sql = 'CREATE TABLE ' . $xoopsDB->prefix('contact') . ' (
85
+        $sql = 'CREATE TABLE '.$xoopsDB->prefix('contact').' (
86 86
         contact_id int(10) unsigned NOT NULL auto_increment,
87 87
         contact_uid int(10) NOT NULL,
88 88
         contact_cid int(10) NOT NULL,
@@ -107,39 +107,39 @@  discard block
 block discarded – undo
107 107
 
108 108
     if ($previousVersion < 181) {
109 109
         // Add contact_platform
110
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . "` ADD `contact_platform` ENUM('Android','Ios','Web') NOT NULL DEFAULT 'Web'";
110
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact')."` ADD `contact_platform` ENUM('Android','Ios','Web') NOT NULL DEFAULT 'Web'";
111 111
         $xoopsDB->query($sql);
112 112
         // Add contact_type
113
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . "` ADD `contact_type` ENUM('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact'";
113
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact')."` ADD `contact_type` ENUM('Contact','Phone','Mail') NOT NULL DEFAULT 'Contact'";
114 114
         $xoopsDB->query($sql);
115 115
         // Add index contact_uid
116
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_uid` ( `contact_uid` )';
116
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_uid` ( `contact_uid` )';
117 117
         $xoopsDB->query($sql);
118 118
         // Add index contact_cid
119
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_cid` ( `contact_cid` )';
119
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_cid` ( `contact_cid` )';
120 120
         $xoopsDB->query($sql);
121 121
         // Add index contact_create
122
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_create` ( `contact_create` )';
122
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_create` ( `contact_create` )';
123 123
         $xoopsDB->query($sql);
124 124
         // Add index contact_mail
125
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_mail` ( `contact_mail` )';
125
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_mail` ( `contact_mail` )';
126 126
         $xoopsDB->query($sql);
127 127
         // Add index contact_phone
128
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_phone` ( `contact_phone` )';
128
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_phone` ( `contact_phone` )';
129 129
         $xoopsDB->query($sql);
130 130
         // Add index contact_platform
131
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_platform` ( `contact_platform` )';
131
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_platform` ( `contact_platform` )';
132 132
         $xoopsDB->query($sql);
133 133
         // Add index contact_type
134
-        $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD INDEX `contact_type` ( `contact_type` )';
134
+        $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD INDEX `contact_type` ( `contact_type` )';
135 135
         $xoopsDB->query($sql);
136 136
     }
137 137
 
138 138
     if ($previousVersion < 226) {
139 139
 
140
-        require_once __DIR__ . '/config.php';
140
+        require_once __DIR__.'/config.php';
141 141
         $configurator = new ContentConfigurator();
142
-        $classUtility    = ucfirst($moduleDirName) . 'Utility';
142
+        $classUtility = ucfirst($moduleDirName).'Utility';
143 143
         if (!class_exists($classUtility)) {
144 144
             xoops_load('utility', $moduleDirName);
145 145
         }
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
         //delete old HTML templates
148 148
         if (count($configurator->templateFolders) > 0) {
149 149
             foreach ($configurator->templateFolders as $folder) {
150
-                $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder);
150
+                $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder);
151 151
                 if (is_dir($templateFolder)) {
152 152
                     $templateList = array_diff(scandir($templateFolder), array('..', '.'));
153 153
                     foreach ($templateList as $k => $v) {
154
-                        $fileInfo = new SplFileInfo($templateFolder . $v);
154
+                        $fileInfo = new SplFileInfo($templateFolder.$v);
155 155
                         if ($fileInfo->getExtension() === 'html' && $fileInfo->getFilename() !== 'index.html') {
156
-                            if (file_exists($templateFolder . $v)) {
157
-                                unlink($templateFolder . $v);
156
+                            if (file_exists($templateFolder.$v)) {
157
+                                unlink($templateFolder.$v);
158 158
                             }
159 159
                         }
160 160
                     }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         if (count($configurator->oldFiles) > 0) {
167 167
             //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
168 168
             foreach (array_keys($configurator->oldFiles) as $i) {
169
-                $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]);
169
+                $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]);
170 170
                 if (is_file($tempFile)) {
171 171
                     unlink($tempFile);
172 172
                 }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         if (count($configurator->oldFolders) > 0) {
179 179
             //    foreach (array_keys($GLOBALS['uploadFolders']) as $i) {
180 180
             foreach (array_keys($configurator->oldFolders) as $i) {
181
-                $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]);
181
+                $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]);
182 182
                 /* @var $folderHandler XoopsObjectHandler */
183 183
                 $folderHandler = XoopsFile::getHandler('folder', $tempFolder);
184 184
                 $folderHandler->delete($tempFolder);
@@ -195,15 +195,15 @@  discard block
 block discarded – undo
195 195
 
196 196
         //  ---  COPY blank.png FILES ---------------
197 197
         if (count($configurator->blankFiles) > 0) {
198
-            $file = __DIR__ . '/../assets/images/blank.png';
198
+            $file = __DIR__.'/../assets/images/blank.png';
199 199
             foreach (array_keys($configurator->blankFiles) as $i) {
200
-                $dest = $configurator->blankFiles[$i] . '/blank.png';
200
+                $dest = $configurator->blankFiles[$i].'/blank.png';
201 201
                 $classUtility::copyFile($file, $dest);
202 202
             }
203 203
         }
204 204
 
205 205
         //delete .html entries from the tpl table
206
-        $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\'';
206
+        $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\'';
207 207
         $GLOBALS['xoopsDB']->queryF($sql);
208 208
 
209 209
         /** @var XoopsGroupPermHandler $gpermHandler */
Please login to merge, or discard this patch.
include/oninstall.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 function xoops_module_pre_install_contact(XoopsModule $module)
30 30
 {
31 31
     $moduleDirName = basename(dirname(__DIR__));
32
-    $classUtility     = ucfirst($moduleDirName) . 'Utility';
32
+    $classUtility = ucfirst($moduleDirName).'Utility';
33 33
     if (!class_exists($classUtility)) {
34 34
         xoops_load('utility', $moduleDirName);
35 35
     }
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
         return false;
44 44
     }
45 45
 
46
-    $mod_tables =& $module->getInfo('tables');
46
+    $mod_tables = & $module->getInfo('tables');
47 47
     foreach ($mod_tables as $table) {
48
-        $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';');
48
+        $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';');
49 49
     }
50 50
 
51 51
     return true;
@@ -60,8 +60,8 @@  discard block
 block discarded – undo
60 60
  */
61 61
 function xoops_module_install_contact(XoopsModule $module)
62 62
 {
63
-    require_once  __DIR__ . '/../../../mainfile.php';
64
-    require_once  __DIR__ . '/../include/config.php';
63
+    require_once  __DIR__.'/../../../mainfile.php';
64
+    require_once  __DIR__.'/../include/config.php';
65 65
 
66 66
     if (!isset($moduleDirName)) {
67 67
         $moduleDirName = basename(dirname(__DIR__));
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     $moduleHelper->loadLanguage('modinfo');
78 78
 
79 79
     $configurator = new ContactConfigurator();
80
-    $classUtility    = ucfirst($moduleDirName) . 'Utility';
80
+    $classUtility = ucfirst($moduleDirName).'Utility';
81 81
     if (!class_exists($classUtility)) {
82 82
         xoops_load('utility', $moduleDirName);
83 83
     }
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
     $moduleId2    = $moduleHelper->getModule()->mid();
89 89
     $gpermHandler = xoops_getHandler('groupperm');
90 90
     // access rights ------------------------------------------
91
-    $gpermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
92
-    $gpermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
93
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
94
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId);
95
-    $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
91
+    $gpermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId);
92
+    $gpermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId);
93
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId);
94
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId);
95
+    $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId);
96 96
 
97 97
     //  ---  CREATE FOLDERS ---------------
98 98
     if (count($configurator->uploadFolders) > 0) {
@@ -104,14 +104,14 @@  discard block
 block discarded – undo
104 104
 
105 105
     //  ---  COPY blank.png FILES ---------------
106 106
     if (count($configurator->blankFiles) > 0) {
107
-        $file = __DIR__ . '/../assets/images/blank.png';
107
+        $file = __DIR__.'/../assets/images/blank.png';
108 108
         foreach (array_keys($configurator->blankFiles) as $i) {
109
-            $dest = $configurator->blankFiles[$i] . '/blank.png';
109
+            $dest = $configurator->blankFiles[$i].'/blank.png';
110 110
             $classUtility::copyFile($file, $dest);
111 111
         }
112 112
     }
113 113
     //delete .html entries from the tpl table
114
-    $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'";
114
+    $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'";
115 115
     $GLOBALS['xoopsDB']->queryF($sql);
116 116
 
117 117
     return true;
Please login to merge, or discard this patch.
send.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,10 +22,10 @@  discard block
 block discarded – undo
22 22
 
23 23
 use Xmf\Request;
24 24
 
25
-include __DIR__ . '/header.php';
25
+include __DIR__.'/header.php';
26 26
 $GLOBALS['xoopsOption']['template_main'] = 'contact_index.tpl';
27 27
 //unset($_SESSION);
28
-include XOOPS_ROOT_PATH . '/header.php';
28
+include XOOPS_ROOT_PATH.'/header.php';
29 29
 
30 30
 /** reCaptcha by google **/
31 31
 global $xoopsConfig, $xoopsModuleConfig;
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 if (!$captcha && $xoopsModuleConfig['recaptchause']) {
42 42
     redirect_header('index.php', 2, _MD_CONTACT_MES_NOCAPTCHA);
43 43
 } else {
44
-    $response = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . $xoopsModuleConfig['recaptchakey'] . '&response=' . $captcha . '&remoteip=' . $_SERVER['REMOTE_ADDR']);
44
+    $response = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$xoopsModuleConfig['recaptchakey'].'&response='.$captcha.'&remoteip='.$_SERVER['REMOTE_ADDR']);
45 45
     if ($response['success'] === false && $xoopsModuleConfig['recaptchause']) {
46 46
         redirect_header('index.php', 2, _MD_CONTACT_MES_CAPTCHAINCORRECT);
47 47
     } else {
@@ -87,4 +87,4 @@  discard block
 block discarded – undo
87 87
     }
88 88
 }
89 89
 
90
-include XOOPS_ROOT_PATH . '/footer.php';
90
+include XOOPS_ROOT_PATH.'/footer.php';
Please login to merge, or discard this patch.