@@ -38,7 +38,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** @var Configurator $configurator */ |
33 | 33 | if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) |
34 | 34 | || !$GLOBALS['xoopsUser']->isAdmin()) { |
35 | - exit('Restricted access' . PHP_EOL); |
|
35 | + exit('Restricted access'.PHP_EOL); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -77,7 +77,7 @@ discard block |
||
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,31 +102,31 @@ discard block |
||
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 | |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | //delete old HTML templates |
138 | 138 | if (count($configurator->templateFolders) > 0) { |
139 | 139 | foreach ($configurator->templateFolders as $folder) { |
140 | - $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
140 | + $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder); |
|
141 | 141 | if (is_dir($templateFolder)) { |
142 | 142 | $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
143 | 143 | foreach ($templateList as $k => $v) { |
144 | - $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
144 | + $fileInfo = new \SplFileInfo($templateFolder.$v); |
|
145 | 145 | if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
146 | - if (is_file($templateFolder . $v)) { |
|
147 | - unlink($templateFolder . $v); |
|
146 | + if (is_file($templateFolder.$v)) { |
|
147 | + unlink($templateFolder.$v); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | if (count($configurator->oldFiles) > 0) { |
157 | 157 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
158 | 158 | foreach (array_keys($configurator->oldFiles) as $i) { |
159 | - $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
159 | + $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]); |
|
160 | 160 | if (is_file($tempFile)) { |
161 | 161 | unlink($tempFile); |
162 | 162 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | if (count($configurator->oldFolders) > 0) { |
169 | 169 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
170 | 170 | foreach (array_keys($configurator->oldFolders) as $i) { |
171 | - $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
171 | + $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]); |
|
172 | 172 | /** @var XoopsObjectHandler $folderHandler */ |
173 | 173 | $folderHandler = XoopsFile::getHandler('folder', $tempFolder); |
174 | 174 | $folderHandler->delete($tempFolder); |
@@ -185,15 +185,15 @@ discard block |
||
185 | 185 | |
186 | 186 | // --- COPY blank.png FILES --------------- |
187 | 187 | if (count($configurator->copyBlankFiles) > 0) { |
188 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
188 | + $file = \dirname(__DIR__).'/assets/images/blank.png'; |
|
189 | 189 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
190 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
190 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
191 | 191 | $utility::copyFile($file, $dest); |
192 | 192 | } |
193 | 193 | } |
194 | 194 | |
195 | 195 | //delete .html entries from the tpl table |
196 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\''; |
|
196 | + $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\''; |
|
197 | 197 | $GLOBALS['xoopsDB']->queryF($sql); |
198 | 198 | |
199 | 199 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | |
205 | 205 | if ($previousVersion < 227) { |
206 | 206 | // Add contact_skype |
207 | - $sql = 'ALTER TABLE `' . $xoopsDB->prefix('contact') . '` ADD `contact_skype` VARCHAR(255) NULL AFTER `contact_icq`'; |
|
207 | + $sql = 'ALTER TABLE `'.$xoopsDB->prefix('contact').'` ADD `contact_skype` VARCHAR(255) NULL AFTER `contact_icq`'; |
|
208 | 208 | $xoopsDB->query($sql); |
209 | 209 | } |
210 | 210 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | use Xmf\Module\Admin; |
23 | 23 | use XoopsModules\Contact; |
24 | 24 | |
25 | -require_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
25 | +require_once \dirname(__DIR__).'/preloads/autoloader.php'; |
|
26 | 26 | |
27 | 27 | $moduleDirName = \basename(\dirname(__DIR__)); |
28 | 28 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
@@ -41,20 +41,20 @@ discard block |
||
41 | 41 | //$categoryHandler = new Contact\CategoryHandler($db); |
42 | 42 | //$downloadHandler = new Contact\DownloadHandler($db); |
43 | 43 | |
44 | -if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
|
45 | - define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
|
46 | - define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
47 | - define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/'); |
|
48 | - define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName . '/'); |
|
49 | - define($moduleDirNameUpper . '_IMAGE_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images/'); |
|
50 | - define($moduleDirNameUpper . '_IMAGE_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images'); |
|
51 | - define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin/'); |
|
52 | - define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
|
53 | - define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
|
54 | - define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
|
55 | - define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
56 | - define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
|
57 | - define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
|
44 | +if (!defined($moduleDirNameUpper.'_CONSTANTS_DEFINED')) { |
|
45 | + define($moduleDirNameUpper.'_DIRNAME', basename(dirname(__DIR__))); |
|
46 | + define($moduleDirNameUpper.'_ROOT_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
47 | + define($moduleDirNameUpper.'_PATH', XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/'); |
|
48 | + define($moduleDirNameUpper.'_URL', XOOPS_URL.'/modules/'.$moduleDirName.'/'); |
|
49 | + define($moduleDirNameUpper.'_IMAGE_URL', constant($moduleDirNameUpper.'_URL').'/assets/images/'); |
|
50 | + define($moduleDirNameUpper.'_IMAGE_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/assets/images'); |
|
51 | + define($moduleDirNameUpper.'_ADMIN_URL', constant($moduleDirNameUpper.'_URL').'/admin/'); |
|
52 | + define($moduleDirNameUpper.'_ADMIN_PATH', constant($moduleDirNameUpper.'_ROOT_PATH').'/admin/'); |
|
53 | + define($moduleDirNameUpper.'_ADMIN', constant($moduleDirNameUpper.'_URL').'/admin/index.php'); |
|
54 | + define($moduleDirNameUpper.'_AUTHOR_LOGOIMG', constant($moduleDirNameUpper.'_URL').'/assets/images/logoModule.png'); |
|
55 | + define($moduleDirNameUpper.'_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
56 | + define($moduleDirNameUpper.'_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.$moduleDirName); // WITHOUT Trailing slash |
|
57 | + define($moduleDirNameUpper.'_CONSTANTS_DEFINED', 1); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $pathIcon16 = Admin::iconUrl('', '16'); |
@@ -63,15 +63,15 @@ discard block |
||
63 | 63 | //$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
64 | 64 | |
65 | 65 | $icons = [ |
66 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
|
67 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
|
68 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
|
69 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
|
70 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
|
71 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
|
72 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
|
73 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
|
74 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
|
66 | + 'edit' => "<img src='".$pathIcon16."/edit.png' alt="._EDIT."' align='middle'>", |
|
67 | + 'delete' => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>", |
|
68 | + 'clone' => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>", |
|
69 | + 'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>", |
|
70 | + 'print' => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>", |
|
71 | + 'pdf' => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>", |
|
72 | + 'add' => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>", |
|
73 | + '0' => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>", |
|
74 | + '1' => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>", |
|
75 | 75 | ]; |
76 | 76 | |
77 | 77 | $debug = false; |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | $pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
91 | 91 | $pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
92 | 92 | |
93 | - $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
|
93 | + $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL.'/modules/'.$moduleDirName.'/'.$pathModIcon16); |
|
94 | 94 | $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
95 | 95 | } |
96 | 96 |
@@ -4,12 +4,12 @@ discard block |
||
4 | 4 | * @see https://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | 6 | spl_autoload_register( |
7 | - static function ($class): void { |
|
7 | + static function($class): void { |
|
8 | 8 | // project-specific namespace prefix |
9 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
9 | + $prefix = 'XoopsModules\\'.ucfirst(basename(dirname(__DIR__))); |
|
10 | 10 | |
11 | 11 | // base directory for the namespace prefix |
12 | - $baseDir = \dirname(__DIR__) . '/class/'; |
|
12 | + $baseDir = \dirname(__DIR__).'/class/'; |
|
13 | 13 | |
14 | 14 | // does the class use the namespace prefix? |
15 | 15 | $len = mb_strlen($prefix); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | // replace the namespace prefix with the base directory, replace namespace |
25 | 25 | // separators with directory separators in the relative class name, append |
26 | 26 | // with .php |
27 | - $file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php'; |
|
27 | + $file = $baseDir.str_replace('\\', '/', $relativeClass).'.php'; |
|
28 | 28 | |
29 | 29 | // if the file exists, require it |
30 | 30 | if (is_file($file)) { |
@@ -26,6 +26,6 @@ |
||
26 | 26 | */ |
27 | 27 | public static function eventCoreIncludeCommonEnd($args): void |
28 | 28 | { |
29 | - require_once __DIR__ . '/autoloader.php'; |
|
29 | + require_once __DIR__.'/autoloader.php'; |
|
30 | 30 | } |
31 | 31 | } |
@@ -144,34 +144,34 @@ discard block |
||
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 |
||
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); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | if (!\mkdir($folder) && !\is_dir($folder)) { |
35 | 35 | throw new RuntimeException(\sprintf('Unable to create the %s directory', $folder)); |
36 | 36 | } |
37 | - file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>'); |
|
37 | + file_put_contents($folder.'/index.html', '<script>history.go(-1);</script>'); |
|
38 | 38 | } |
39 | 39 | } catch (\Exception $e) { |
40 | 40 | echo 'Caught exception: ', $e->getMessage(), "\n", '<br>'; |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | // @mkdir($dst); |
52 | 52 | while (false !== ($file = \readdir($dir))) { |
53 | 53 | if (('.' !== $file) && ('..' !== $file)) { |
54 | - if (\is_dir($src . '/' . $file)) { |
|
55 | - self::recurseCopy($src . '/' . $file, $dst . '/' . $file); |
|
54 | + if (\is_dir($src.'/'.$file)) { |
|
55 | + self::recurseCopy($src.'/'.$file, $dst.'/'.$file); |
|
56 | 56 | } else { |
57 | - \copy($src . '/' . $file, $dst . '/' . $file); |
|
57 | + \copy($src.'/'.$file, $dst.'/'.$file); |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
@@ -93,30 +93,30 @@ discard block |
||
93 | 93 | echo $GLOBALS['xoopsSecurity']->getTokenHTML(); |
94 | 94 | echo "<table width='100%' class='outer' cellpadding='4' cellspacing='1'> |
95 | 95 | <tr valign='middle'><th align='center'>" |
96 | - . \_AM_SYSTEM_BLOCKS_TITLE |
|
97 | - . "</th><th align='center' nowrap='nowrap'>" |
|
98 | - . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'SIDE') |
|
99 | - . '<br>' |
|
100 | - . _LEFT |
|
101 | - . '-' |
|
102 | - . _CENTER |
|
103 | - . '-' |
|
104 | - . _RIGHT |
|
105 | - . "</th><th align='center'>" |
|
106 | - . \constant( |
|
107 | - 'CO_' . $this->moduleDirNameUpper . '_' . 'WEIGHT' |
|
108 | - ) |
|
109 | - . "</th><th align='center'>" |
|
110 | - . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLE') |
|
111 | - . "</th><th align='center'>" |
|
112 | - . \_AM_SYSTEM_BLOCKS_VISIBLEIN |
|
113 | - . "</th><th align='center'>" |
|
114 | - . \_AM_SYSTEM_ADGS |
|
115 | - . "</th><th align='center'>" |
|
116 | - . \_AM_SYSTEM_BLOCKS_BCACHETIME |
|
117 | - . "</th><th align='center'>" |
|
118 | - . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'ACTION') |
|
119 | - . '</th></tr> |
|
96 | + . \_AM_SYSTEM_BLOCKS_TITLE |
|
97 | + . "</th><th align='center' nowrap='nowrap'>" |
|
98 | + . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'SIDE') |
|
99 | + . '<br>' |
|
100 | + . _LEFT |
|
101 | + . '-' |
|
102 | + . _CENTER |
|
103 | + . '-' |
|
104 | + . _RIGHT |
|
105 | + . "</th><th align='center'>" |
|
106 | + . \constant( |
|
107 | + 'CO_' . $this->moduleDirNameUpper . '_' . 'WEIGHT' |
|
108 | + ) |
|
109 | + . "</th><th align='center'>" |
|
110 | + . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLE') |
|
111 | + . "</th><th align='center'>" |
|
112 | + . \_AM_SYSTEM_BLOCKS_VISIBLEIN |
|
113 | + . "</th><th align='center'>" |
|
114 | + . \_AM_SYSTEM_ADGS |
|
115 | + . "</th><th align='center'>" |
|
116 | + . \_AM_SYSTEM_BLOCKS_BCACHETIME |
|
117 | + . "</th><th align='center'>" |
|
118 | + . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'ACTION') |
|
119 | + . '</th></tr> |
|
120 | 120 | '; |
121 | 121 | $blockArray = \XoopsBlock::getByModule($xoopsModule->mid()); |
122 | 122 | $blockCount = \count($blockArray); |
@@ -204,69 +204,69 @@ discard block |
||
204 | 204 | } |
205 | 205 | $name = $i->getVar('name'); |
206 | 206 | echo "<tr valign='top'><td class='$class' align='center'><input type='text' name='title[" |
207 | - . $i->getVar('bid') |
|
208 | - . "]' value='" |
|
209 | - . $title |
|
210 | - . "'></td><td class='$class' align='center' nowrap='nowrap'> |
|
207 | + . $i->getVar('bid') |
|
208 | + . "]' value='" |
|
209 | + . $title |
|
210 | + . "'></td><td class='$class' align='center' nowrap='nowrap'> |
|
211 | 211 | <div align='center' > |
212 | 212 | <input type='radio' name='side[" |
213 | - . $i->getVar('bid') |
|
214 | - . "]' value='" |
|
215 | - . \XOOPS_CENTERBLOCK_LEFT |
|
216 | - . "'$ssel2> |
|
213 | + . $i->getVar('bid') |
|
214 | + . "]' value='" |
|
215 | + . \XOOPS_CENTERBLOCK_LEFT |
|
216 | + . "'$ssel2> |
|
217 | 217 | <input type='radio' name='side[" |
218 | - . $i->getVar('bid') |
|
219 | - . "]' value='" |
|
220 | - . \XOOPS_CENTERBLOCK_CENTER |
|
221 | - . "'$ssel3> |
|
218 | + . $i->getVar('bid') |
|
219 | + . "]' value='" |
|
220 | + . \XOOPS_CENTERBLOCK_CENTER |
|
221 | + . "'$ssel3> |
|
222 | 222 | <input type='radio' name='side[" |
223 | - . $i->getVar('bid') |
|
224 | - . "]' value='" |
|
225 | - . \XOOPS_CENTERBLOCK_RIGHT |
|
226 | - . "'$ssel4> |
|
223 | + . $i->getVar('bid') |
|
224 | + . "]' value='" |
|
225 | + . \XOOPS_CENTERBLOCK_RIGHT |
|
226 | + . "'$ssel4> |
|
227 | 227 | </div> |
228 | 228 | <div> |
229 | 229 | <span style='float:right;'><input type='radio' name='side[" |
230 | - . $i->getVar('bid') |
|
231 | - . "]' value='" |
|
232 | - . \XOOPS_SIDEBLOCK_RIGHT |
|
233 | - . "'$ssel1></span> |
|
230 | + . $i->getVar('bid') |
|
231 | + . "]' value='" |
|
232 | + . \XOOPS_SIDEBLOCK_RIGHT |
|
233 | + . "'$ssel1></span> |
|
234 | 234 | <div align='left'><input type='radio' name='side[" |
235 | - . $i->getVar('bid') |
|
236 | - . "]' value='" |
|
237 | - . \XOOPS_SIDEBLOCK_LEFT |
|
238 | - . "'$ssel0></div> |
|
235 | + . $i->getVar('bid') |
|
236 | + . "]' value='" |
|
237 | + . \XOOPS_SIDEBLOCK_LEFT |
|
238 | + . "'$ssel0></div> |
|
239 | 239 | </div> |
240 | 240 | <div align='center'> |
241 | 241 | <input type='radio' name='side[" |
242 | - . $i->getVar('bid') |
|
243 | - . "]' value='" |
|
244 | - . \XOOPS_CENTERBLOCK_BOTTOMLEFT |
|
245 | - . "'$ssel5> |
|
242 | + . $i->getVar('bid') |
|
243 | + . "]' value='" |
|
244 | + . \XOOPS_CENTERBLOCK_BOTTOMLEFT |
|
245 | + . "'$ssel5> |
|
246 | 246 | <input type='radio' name='side[" |
247 | - . $i->getVar('bid') |
|
248 | - . "]' value='" |
|
249 | - . \XOOPS_CENTERBLOCK_BOTTOM |
|
250 | - . "'$ssel7> |
|
247 | + . $i->getVar('bid') |
|
248 | + . "]' value='" |
|
249 | + . \XOOPS_CENTERBLOCK_BOTTOM |
|
250 | + . "'$ssel7> |
|
251 | 251 | <input type='radio' name='side[" |
252 | - . $i->getVar('bid') |
|
253 | - . "]' value='" |
|
254 | - . \XOOPS_CENTERBLOCK_BOTTOMRIGHT |
|
255 | - . "'$ssel6> |
|
252 | + . $i->getVar('bid') |
|
253 | + . "]' value='" |
|
254 | + . \XOOPS_CENTERBLOCK_BOTTOMRIGHT |
|
255 | + . "'$ssel6> |
|
256 | 256 | </div> |
257 | 257 | </td><td class='$class' align='center'><input type='text' name='weight[" |
258 | - . $i->getVar('bid') |
|
259 | - . "]' value='" |
|
260 | - . $i->getVar('weight') |
|
261 | - . "' size='5' maxlength='5'></td><td class='$class' align='center' nowrap><input type='radio' name='visible[" |
|
262 | - . $i->getVar('bid') |
|
263 | - . "]' value='1'$sel1>" |
|
264 | - . _YES |
|
265 | - . " <input type='radio' name='visible[" |
|
266 | - . $i->getVar('bid') |
|
267 | - . "]' value='0'$sel0>" |
|
268 | - . _NO |
|
269 | - . '</td>'; |
|
258 | + . $i->getVar('bid') |
|
259 | + . "]' value='" |
|
260 | + . $i->getVar('weight') |
|
261 | + . "' size='5' maxlength='5'></td><td class='$class' align='center' nowrap><input type='radio' name='visible[" |
|
262 | + . $i->getVar('bid') |
|
263 | + . "]' value='1'$sel1>" |
|
264 | + . _YES |
|
265 | + . " <input type='radio' name='visible[" |
|
266 | + . $i->getVar('bid') |
|
267 | + . "]' value='0'$sel0>" |
|
268 | + . _NO |
|
269 | + . '</td>'; |
|
270 | 270 | |
271 | 271 | echo "<td class='$class' align='center'><select size='5' name='bmodule[" . $i->getVar('bid') . "][]' id='bmodule[" . $i->getVar('bid') . "][]' multiple='multiple'>"; |
272 | 272 | foreach ($moduleList as $k => $v) { |
@@ -657,11 +657,11 @@ discard block |
||
657 | 657 | $form->addElement($textarea, true); |
658 | 658 | $ctypeSelect = new \XoopsFormSelect(\_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); |
659 | 659 | $ctypeSelect->addOptionArray([ |
660 | - 'H' => \_AM_SYSTEM_BLOCKS_HTML, |
|
661 | - 'P' => \_AM_SYSTEM_BLOCKS_PHP, |
|
662 | - 'S' => \_AM_SYSTEM_BLOCKS_AFWSMILE, |
|
663 | - 'T' => \_AM_SYSTEM_BLOCKS_AFNOSMILE, |
|
664 | - ]); |
|
660 | + 'H' => \_AM_SYSTEM_BLOCKS_HTML, |
|
661 | + 'P' => \_AM_SYSTEM_BLOCKS_PHP, |
|
662 | + 'S' => \_AM_SYSTEM_BLOCKS_AFWSMILE, |
|
663 | + 'T' => \_AM_SYSTEM_BLOCKS_AFNOSMILE, |
|
664 | + ]); |
|
665 | 665 | $form->addElement($ctypeSelect); |
666 | 666 | } |
667 | 667 | else { |
@@ -685,18 +685,18 @@ discard block |
||
685 | 685 | } |
686 | 686 | $cache_select = new \XoopsFormSelect(\_AM_SYSTEM_BLOCKS_BCACHETIME, 'bcachetime', $block['bcachetime']); |
687 | 687 | $cache_select->addOptionArray([ |
688 | - 0 => _NOCACHE, |
|
689 | - 30 => \sprintf(_SECONDS, 30), |
|
690 | - 60 => _MINUTE, |
|
691 | - 300 => \sprintf(_MINUTES, 5), |
|
692 | - 1800 => \sprintf(_MINUTES, 30), |
|
693 | - 3600 => _HOUR, |
|
694 | - 18000 => \sprintf(_HOURS, 5), |
|
695 | - 86400 => _DAY, |
|
696 | - 259200 => \sprintf(_DAYS, 3), |
|
697 | - 604800 => _WEEK, |
|
698 | - 2592000 => _MONTH, |
|
699 | - ]); |
|
688 | + 0 => _NOCACHE, |
|
689 | + 30 => \sprintf(_SECONDS, 30), |
|
690 | + 60 => _MINUTE, |
|
691 | + 300 => \sprintf(_MINUTES, 5), |
|
692 | + 1800 => \sprintf(_MINUTES, 30), |
|
693 | + 3600 => _HOUR, |
|
694 | + 18000 => \sprintf(_HOURS, 5), |
|
695 | + 86400 => _DAY, |
|
696 | + 259200 => \sprintf(_DAYS, 3), |
|
697 | + 604800 => _WEEK, |
|
698 | + 2592000 => _MONTH, |
|
699 | + ]); |
|
700 | 700 | $form->addElement($cache_select); |
701 | 701 | |
702 | 702 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | : void |
68 | 68 | { |
69 | 69 | global $xoopsModule, $pathIcon16; |
70 | - require_once XOOPS_ROOT_PATH . '/class/xoopslists.php'; |
|
70 | + require_once XOOPS_ROOT_PATH.'/class/xoopslists.php'; |
|
71 | 71 | // xoops_loadLanguage('admin', 'system'); |
72 | 72 | // xoops_loadLanguage('admin/blocksadmin', 'system'); |
73 | 73 | // xoops_loadLanguage('admin/groups', 'system'); |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | $moduleList[0] = \_AM_SYSTEM_BLOCKS_ALLPAGES; |
89 | 89 | \ksort($moduleList); |
90 | 90 | echo " |
91 | - <h4 style='text-align:left;'>" . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</h4>'; |
|
92 | - echo "<form action='" . $_SERVER['SCRIPT_NAME'] . "' name='blockadmin' method='post'>"; |
|
91 | + <h4 style='text-align:left;'>" . \constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</h4>'; |
|
92 | + echo "<form action='".$_SERVER['SCRIPT_NAME']."' name='blockadmin' method='post'>"; |
|
93 | 93 | echo $GLOBALS['xoopsSecurity']->getTokenHTML(); |
94 | 94 | echo "<table width='100%' class='outer' cellpadding='4' cellspacing='1'> |
95 | 95 | <tr valign='middle'><th align='center'>" |
96 | 96 | . \_AM_SYSTEM_BLOCKS_TITLE |
97 | 97 | . "</th><th align='center' nowrap='nowrap'>" |
98 | - . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'SIDE') |
|
98 | + . \constant('CO_'.$this->moduleDirNameUpper.'_'.'SIDE') |
|
99 | 99 | . '<br>' |
100 | 100 | . _LEFT |
101 | 101 | . '-' |
@@ -104,10 +104,10 @@ discard block |
||
104 | 104 | . _RIGHT |
105 | 105 | . "</th><th align='center'>" |
106 | 106 | . \constant( |
107 | - 'CO_' . $this->moduleDirNameUpper . '_' . 'WEIGHT' |
|
107 | + 'CO_'.$this->moduleDirNameUpper.'_'.'WEIGHT' |
|
108 | 108 | ) |
109 | 109 | . "</th><th align='center'>" |
110 | - . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLE') |
|
110 | + . \constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLE') |
|
111 | 111 | . "</th><th align='center'>" |
112 | 112 | . \_AM_SYSTEM_BLOCKS_VISIBLEIN |
113 | 113 | . "</th><th align='center'>" |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | . "</th><th align='center'>" |
116 | 116 | . \_AM_SYSTEM_BLOCKS_BCACHETIME |
117 | 117 | . "</th><th align='center'>" |
118 | - . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'ACTION') |
|
118 | + . \constant('CO_'.$this->moduleDirNameUpper.'_'.'ACTION') |
|
119 | 119 | . '</th></tr> |
120 | 120 | '; |
121 | 121 | $blockArray = \XoopsBlock::getByModule($xoopsModule->mid()); |
@@ -136,14 +136,14 @@ discard block |
||
136 | 136 | ]; |
137 | 137 | foreach ($blockArray as $i) { |
138 | 138 | $groupsPermissions = $grouppermHandler->getGroupIds('block_read', $i->getVar('bid')); |
139 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $i->getVar('bid'); |
|
139 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$i->getVar('bid'); |
|
140 | 140 | $result = $this->db->query($sql); |
141 | 141 | $modules = []; |
142 | 142 | if (!$result instanceof \mysqli_result) { |
143 | - \trigger_error("Query Failed! SQL: $sql Error: " . $this->db->error(), \E_USER_ERROR); |
|
143 | + \trigger_error("Query Failed! SQL: $sql Error: ".$this->db->error(), \E_USER_ERROR); |
|
144 | 144 | } |
145 | 145 | while (false !== ($row = $this->db->fetchArray($result))) { |
146 | - $modules[] = (int)$row['module_id']; |
|
146 | + $modules[] = (int) $row['module_id']; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | $cachetimeOptions = ''; |
@@ -268,27 +268,27 @@ discard block |
||
268 | 268 | . _NO |
269 | 269 | . '</td>'; |
270 | 270 | |
271 | - echo "<td class='$class' align='center'><select size='5' name='bmodule[" . $i->getVar('bid') . "][]' id='bmodule[" . $i->getVar('bid') . "][]' multiple='multiple'>"; |
|
271 | + echo "<td class='$class' align='center'><select size='5' name='bmodule[".$i->getVar('bid')."][]' id='bmodule[".$i->getVar('bid')."][]' multiple='multiple'>"; |
|
272 | 272 | foreach ($moduleList as $k => $v) { |
273 | - echo "<option value='$k'" . (\in_array($k, $modules) ? " selected='selected'" : '') . ">$v</option>"; |
|
273 | + echo "<option value='$k'".(\in_array($k, $modules) ? " selected='selected'" : '').">$v</option>"; |
|
274 | 274 | } |
275 | 275 | echo '</select></td>'; |
276 | 276 | |
277 | - echo "<td class='$class' align='center'><select size='5' name='groups[" . $i->getVar('bid') . "][]' id='groups[" . $i->getVar('bid') . "][]' multiple='multiple'>"; |
|
277 | + echo "<td class='$class' align='center'><select size='5' name='groups[".$i->getVar('bid')."][]' id='groups[".$i->getVar('bid')."][]' multiple='multiple'>"; |
|
278 | 278 | foreach ($groups as $grp) { |
279 | - echo "<option value='" . $grp->getVar('groupid') . "' " . (\in_array($grp->getVar('groupid'), $groupsPermissions) ? " selected='selected'" : '') . '>' . $grp->getVar('name') . '</option>'; |
|
279 | + echo "<option value='".$grp->getVar('groupid')."' ".(\in_array($grp->getVar('groupid'), $groupsPermissions) ? " selected='selected'" : '').'>'.$grp->getVar('name').'</option>'; |
|
280 | 280 | } |
281 | 281 | echo '</select></td>'; |
282 | 282 | |
283 | 283 | // Cache lifetime |
284 | - echo '<td class="' . $class . '" align="center"> <select name="bcachetime[' . $i->getVar('bid') . ']" size="1">' . $cachetimeOptions . '</select> |
|
284 | + echo '<td class="'.$class.'" align="center"> <select name="bcachetime['.$i->getVar('bid').']" size="1">'.$cachetimeOptions.'</select> |
|
285 | 285 | </td>'; |
286 | 286 | |
287 | 287 | // Actions |
288 | 288 | |
289 | 289 | echo "<td class='$class' align='center'> |
290 | - <a href='blocksadmin.php?op=edit&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/edit.png' . " alt='" . _EDIT . "' title='" . _EDIT . "'></a> |
|
291 | - <a href='blocksadmin.php?op=clone&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/editcopy.png' . " alt='" . _CLONE . "' title='" . _CLONE . "'></a>"; |
|
290 | + <a href='blocksadmin.php?op=edit&bid=".$i->getVar('bid')."'><img src=".$pathIcon16.'/edit.png'." alt='"._EDIT."' title='"._EDIT."'></a> |
|
291 | + <a href='blocksadmin.php?op=clone&bid=" . $i->getVar('bid')."'><img src=".$pathIcon16.'/editcopy.png'." alt='"._CLONE."' title='"._CLONE."'></a>"; |
|
292 | 292 | // if ('S' !== $i->getVar('block_type') && 'M' !== $i->getVar('block_type')) { |
293 | 293 | // echo " <a href='" . XOOPS_URL . '/modules/system/admin.php?fct=blocksadmin&op=delete&bid=' . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/delete.png' . " alt='" . _DELETE . "' title='" . _DELETE . "'> |
294 | 294 | // </a>"; |
@@ -297,25 +297,25 @@ discard block |
||
297 | 297 | // if ('S' !== $i->getVar('block_type') && 'M' !== $i->getVar('block_type')) { |
298 | 298 | if (!\in_array($i->getVar('block_type'), ['M', 'S'])) { |
299 | 299 | echo " |
300 | - <a href='blocksadmin.php?op=delete&bid=" . $i->getVar('bid') . "'><img src=" . $pathIcon16 . '/delete.png' . " alt='" . _DELETE . "' title='" . _DELETE . "'> |
|
300 | + <a href='blocksadmin.php?op=delete&bid=" . $i->getVar('bid')."'><img src=".$pathIcon16.'/delete.png'." alt='"._DELETE."' title='"._DELETE."'> |
|
301 | 301 | </a>"; |
302 | 302 | } |
303 | 303 | echo " |
304 | - <input type='hidden' name='oldtitle[" . $i->getVar('bid') . "]' value='" . $i->getVar('title') . "'> |
|
305 | - <input type='hidden' name='oldside[" . $i->getVar('bid') . "]' value='" . $i->getVar('side') . "'> |
|
306 | - <input type='hidden' name='oldweight[" . $i->getVar('bid') . "]' value='" . $i->getVar('weight') . "'> |
|
307 | - <input type='hidden' name='oldvisible[" . $i->getVar('bid') . "]' value='" . $i->getVar('visible') . "'> |
|
308 | - <input type='hidden' name='oldgroups[" . $i->getVar('groups') . "]' value='" . $i->getVar('groups') . "'> |
|
309 | - <input type='hidden' name='oldbcachetime[" . $i->getVar('bid') . "]' value='" . $i->getVar('bcachetime') . "'> |
|
310 | - <input type='hidden' name='bid[" . $i->getVar('bid') . "]' value='" . $i->getVar('bid') . "'> |
|
304 | + <input type='hidden' name='oldtitle[" . $i->getVar('bid')."]' value='".$i->getVar('title')."'> |
|
305 | + <input type='hidden' name='oldside[" . $i->getVar('bid')."]' value='".$i->getVar('side')."'> |
|
306 | + <input type='hidden' name='oldweight[" . $i->getVar('bid')."]' value='".$i->getVar('weight')."'> |
|
307 | + <input type='hidden' name='oldvisible[" . $i->getVar('bid')."]' value='".$i->getVar('visible')."'> |
|
308 | + <input type='hidden' name='oldgroups[" . $i->getVar('groups')."]' value='".$i->getVar('groups')."'> |
|
309 | + <input type='hidden' name='oldbcachetime[" . $i->getVar('bid')."]' value='".$i->getVar('bcachetime')."'> |
|
310 | + <input type='hidden' name='bid[" . $i->getVar('bid')."]' value='".$i->getVar('bid')."'> |
|
311 | 311 | </td></tr> |
312 | 312 | "; |
313 | 313 | $class = ('even' === $class) ? 'odd' : 'even'; |
314 | 314 | } |
315 | 315 | echo "<tr><td class='foot' align='center' colspan='8'> |
316 | 316 | <input type='hidden' name='op' value='order'> |
317 | - " . $GLOBALS['xoopsSecurity']->getTokenHTML() . " |
|
318 | - <input type='submit' name='submit' value='" . _SUBMIT . "'> |
|
317 | + " . $GLOBALS['xoopsSecurity']->getTokenHTML()." |
|
318 | + <input type='submit' name='submit' value='" . _SUBMIT."'> |
|
319 | 319 | </td></tr></table> |
320 | 320 | </form> |
321 | 321 | <br><br>"; |
@@ -350,18 +350,18 @@ discard block |
||
350 | 350 | \xoops_loadLanguage('admin/groups', 'system'); |
351 | 351 | |
352 | 352 | $myblock = new \XoopsBlock($bid); |
353 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $bid; |
|
353 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$bid; |
|
354 | 354 | $result = $this->db->query($sql); |
355 | 355 | $modules = []; |
356 | 356 | if ($result instanceof \mysqli_result) { |
357 | 357 | while (false !== ($row = $this->db->fetchArray($result))) { |
358 | - $modules[] = (int)$row['module_id']; |
|
358 | + $modules[] = (int) $row['module_id']; |
|
359 | 359 | } |
360 | 360 | } |
361 | 361 | $isCustom = \in_array($myblock->getVar('block_type'), ['C', 'E']); |
362 | 362 | $block = [ |
363 | - 'title' => $myblock->getVar('title') . ' Clone', |
|
364 | - 'form_title' => \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BLOCKS_CLONEBLOCK'), |
|
363 | + 'title' => $myblock->getVar('title').' Clone', |
|
364 | + 'form_title' => \constant('CO_'.$this->moduleDirNameUpper.'_'.'BLOCKS_CLONEBLOCK'), |
|
365 | 365 | 'name' => $myblock->getVar('name'), |
366 | 366 | 'side' => $myblock->getVar('side'), |
367 | 367 | 'weight' => $myblock->getVar('weight'), |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | 'template' => $myblock->getVar('template'), |
378 | 378 | 'options' => $myblock->getVar('options'), |
379 | 379 | ]; |
380 | - echo '<a href="blocksadmin.php">' . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</a> <span style="font-weight:bold;">»»</span> ' . \_AM_SYSTEM_BLOCKS_CLONEBLOCK . '<br><br>'; |
|
380 | + echo '<a href="blocksadmin.php">'.\constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</a> <span style="font-weight:bold;">»»</span> '.\_AM_SYSTEM_BLOCKS_CLONEBLOCK.'<br><br>'; |
|
381 | 381 | // $form = new Blockform(); |
382 | 382 | // $form->render(); |
383 | 383 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | // $newid = $clone->store(); //see https://github.com/XOOPS/XoopsCore25/issues/1105 |
422 | 422 | if ($clone->store()) { |
423 | - $newid = $clone->id(); //get the id of the cloned block |
|
423 | + $newid = $clone->id(); //get the id of the cloned block |
|
424 | 424 | } |
425 | 425 | if (!$newid) { |
426 | 426 | // \xoops_cp_header(); |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | if ('' !== $clone->getVar('template')) { |
432 | 432 | /** @var \XoopsTplfileHandler $tplfileHandler */ |
433 | 433 | $tplfileHandler = \xoops_getHandler('tplfile'); |
434 | - $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', (string)$bid); |
|
434 | + $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', (string) $bid); |
|
435 | 435 | if (\count($btemplate) > 0) { |
436 | 436 | $tplclone = $btemplate[0]->xoopsClone(); |
437 | 437 | $tplclone->setVar('tpl_id', 0); |
@@ -441,12 +441,12 @@ discard block |
||
441 | 441 | } |
442 | 442 | |
443 | 443 | foreach ($bmodule as $bmid) { |
444 | - $sql = 'INSERT INTO ' . $this->db->prefix('block_module_link') . ' (block_id, module_id) VALUES (' . $newid . ', ' . $bmid . ')'; |
|
444 | + $sql = 'INSERT INTO '.$this->db->prefix('block_module_link').' (block_id, module_id) VALUES ('.$newid.', '.$bmid.')'; |
|
445 | 445 | $this->db->query($sql); |
446 | 446 | } |
447 | 447 | //$groups = &$GLOBALS['xoopsUser']->getGroups(); |
448 | 448 | foreach ($groups as $iValue) { |
449 | - $sql = 'INSERT INTO ' . $this->db->prefix('group_permission') . ' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES (' . $iValue . ', ' . $newid . ", 1, 'block_read')"; |
|
449 | + $sql = 'INSERT INTO '.$this->db->prefix('group_permission').' (gperm_groupid, gperm_itemid, gperm_modid, gperm_name) VALUES ('.$iValue.', '.$newid.", 1, 'block_read')"; |
|
450 | 450 | $this->db->query($sql); |
451 | 451 | } |
452 | 452 | $this->helper->redirect('admin/blocksadmin.php?op=list', 1, _AM_DBUPDATED); |
@@ -475,12 +475,12 @@ discard block |
||
475 | 475 | \xoops_loadLanguage('admin/groups', 'system'); |
476 | 476 | // mpu_adm_menu(); |
477 | 477 | $myblock = new \XoopsBlock($bid); |
478 | - $sql = 'SELECT module_id FROM ' . $this->db->prefix('block_module_link') . ' WHERE block_id=' . $bid; |
|
478 | + $sql = 'SELECT module_id FROM '.$this->db->prefix('block_module_link').' WHERE block_id='.$bid; |
|
479 | 479 | $result = $this->db->query($sql); |
480 | 480 | $modules = []; |
481 | 481 | if ($result instanceof \mysqli_result) { |
482 | 482 | while (false !== ($row = $this->db->fetchArray($result))) { |
483 | - $modules[] = (int)$row['module_id']; |
|
483 | + $modules[] = (int) $row['module_id']; |
|
484 | 484 | } |
485 | 485 | } |
486 | 486 | $isCustom = \in_array($myblock->getVar('block_type'), ['C', 'E']); |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | 'template' => $myblock->getVar('template'), |
503 | 503 | 'options' => $myblock->getVar('options'), |
504 | 504 | ]; |
505 | - echo '<a href="blocksadmin.php">' . \constant('CO_' . $this->moduleDirNameUpper . '_' . 'BADMIN') . '</a> <span style="font-weight:bold;">»»</span> ' . \_AM_SYSTEM_BLOCKS_EDITBLOCK . '<br><br>'; |
|
505 | + echo '<a href="blocksadmin.php">'.\constant('CO_'.$this->moduleDirNameUpper.'_'.'BADMIN').'</a> <span style="font-weight:bold;">»»</span> '.\_AM_SYSTEM_BLOCKS_EDITBLOCK.'<br><br>'; |
|
506 | 506 | |
507 | 507 | echo $this->render($block); |
508 | 508 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | } |
544 | 544 | else { |
545 | 545 | foreach ($bmodule as $bmid) { |
546 | - $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid, (int)$bmid); |
|
546 | + $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid, (int) $bmid); |
|
547 | 547 | $this->db->query($sql); |
548 | 548 | } |
549 | 549 | } |
@@ -556,7 +556,7 @@ discard block |
||
556 | 556 | $this->db->query($sql); |
557 | 557 | } |
558 | 558 | } |
559 | - $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_' . $this->moduleDirNameUpper . '_' . 'UPDATE_SUCCESS')); |
|
559 | + $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_'.$this->moduleDirNameUpper.'_'.'UPDATE_SUCCESS')); |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | public function orderBlock( |
@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | } |
599 | 599 | else { |
600 | 600 | foreach ($bmodule[$i] as $bmid) { |
601 | - $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid[$i], (int)$bmid); |
|
601 | + $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid[$i], (int) $bmid); |
|
602 | 602 | $this->db->query($sql); |
603 | 603 | } |
604 | 604 | } |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | } |
614 | 614 | } |
615 | 615 | |
616 | - $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_' . $this->moduleDirNameUpper . '_' . 'UPDATE_SUCCESS')); |
|
616 | + $this->helper->redirect('admin/blocksadmin.php', 1, \constant('CO_'.$this->moduleDirNameUpper.'_'.'UPDATE_SUCCESS')); |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | public function render(?array $block = null) |
@@ -637,9 +637,9 @@ discard block |
||
637 | 637 | 9 => \_AM_SYSTEM_BLOCKS_CBBOTTOM, |
638 | 638 | ]); |
639 | 639 | $form->addElement($sideSelect); |
640 | - $form->addElement(new \XoopsFormText(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'WEIGHT'), 'bweight', 2, 5, $block['weight'])); |
|
641 | - $form->addElement(new \XoopsFormRadioYN(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLE'), 'bvisible', $block['visible'])); |
|
642 | - $modSelect = new \XoopsFormSelect(\constant('CO_' . $this->moduleDirNameUpper . '_' . 'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); |
|
640 | + $form->addElement(new \XoopsFormText(\constant('CO_'.$this->moduleDirNameUpper.'_'.'WEIGHT'), 'bweight', 2, 5, $block['weight'])); |
|
641 | + $form->addElement(new \XoopsFormRadioYN(\constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLE'), 'bvisible', $block['visible'])); |
|
642 | + $modSelect = new \XoopsFormSelect(\constant('CO_'.$this->moduleDirNameUpper.'_'.'VISIBLEIN'), 'bmodule', $block['modules'], 5, true); |
|
643 | 643 | /** @var \XoopsModuleHandler $moduleHandler */ |
644 | 644 | $moduleHandler = \xoops_getHandler('module'); |
645 | 645 | $criteria = new \CriteriaCompo(new \Criteria('hasmain', '1')); |
@@ -653,7 +653,7 @@ discard block |
||
653 | 653 | $form->addElement(new \XoopsFormText(\_AM_SYSTEM_BLOCKS_TITLE, 'btitle', 50, 255, $block['title']), false); |
654 | 654 | if ($block['is_custom']) { |
655 | 655 | $textarea = new \XoopsFormDhtmlTextArea(\_AM_SYSTEM_BLOCKS_CONTENT, 'bcontent', $block['content'], 15, 70); |
656 | - $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">' . \_AM_SYSTEM_BLOCKS_USEFULTAGS . '</span><br><span style="font-size:x-small;font-weight:normal;">' . \sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL . '/') . '</span>'); |
|
656 | + $textarea->setDescription('<span style="font-size:x-small;font-weight:bold;">'.\_AM_SYSTEM_BLOCKS_USEFULTAGS.'</span><br><span style="font-size:x-small;font-weight:normal;">'.\sprintf(_AM_BLOCKTAG1, '{X_SITEURL}', XOOPS_URL.'/').'</span>'); |
|
657 | 657 | $form->addElement($textarea, true); |
658 | 658 | $ctypeSelect = new \XoopsFormSelect(\_AM_SYSTEM_BLOCKS_CTYPE, 'bctype', $block['ctype']); |
659 | 659 | $ctypeSelect->addOptionArray([ |
@@ -670,12 +670,12 @@ discard block |
||
670 | 670 | $tplfileHandler = \xoops_getHandler('tplfile'); |
671 | 671 | $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']); |
672 | 672 | if (\count($btemplate) > 0) { |
673 | - $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar('tpl_id') . '">' . \_AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); |
|
673 | + $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate[0]->getVar('tpl_id').'">'.\_AM_SYSTEM_BLOCKS_EDITTPL.'</a>')); |
|
674 | 674 | } |
675 | 675 | else { |
676 | 676 | $btemplate2 = $tplfileHandler->find('default', 'block', $block['bid']); |
677 | 677 | if (\count($btemplate2) > 0) { |
678 | - $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate2[0]->getVar('tpl_id') . '" target="_blank">' . \_AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); |
|
678 | + $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="'.XOOPS_URL.'/modules/system/admin.php?fct=tplsets&op=edittpl&id='.$btemplate2[0]->getVar('tpl_id').'" target="_blank">'.\_AM_SYSTEM_BLOCKS_EDITTPL.'</a>')); |
|
679 | 679 | } |
680 | 680 | } |
681 | 681 | } |
@@ -150,8 +150,7 @@ discard block |
||
150 | 150 | foreach ($cachetimes as $cachetime => $cachetimeName) { |
151 | 151 | if ($i->getVar('bcachetime') == $cachetime) { |
152 | 152 | $cachetimeOptions .= "<option value='$cachetime' selected='selected'>$cachetimeName</option>\n"; |
153 | - } |
|
154 | - else { |
|
153 | + } else { |
|
155 | 154 | $cachetimeOptions .= "<option value='$cachetime'>$cachetimeName</option>\n"; |
156 | 155 | } |
157 | 156 | } |
@@ -168,38 +167,29 @@ discard block |
||
168 | 167 | $sel0 = $sel1; |
169 | 168 | if (1 === $i->getVar('visible')) { |
170 | 169 | $sel1 = ' checked'; |
171 | - } |
|
172 | - else { |
|
170 | + } else { |
|
173 | 171 | $sel0 = ' checked'; |
174 | 172 | } |
175 | 173 | if (\XOOPS_SIDEBLOCK_LEFT === $i->getVar('side')) { |
176 | 174 | $ssel0 = ' checked'; |
177 | - } |
|
178 | - elseif (\XOOPS_SIDEBLOCK_RIGHT === $i->getVar('side')) { |
|
175 | + } elseif (\XOOPS_SIDEBLOCK_RIGHT === $i->getVar('side')) { |
|
179 | 176 | $ssel1 = ' checked'; |
180 | - } |
|
181 | - elseif (\XOOPS_CENTERBLOCK_LEFT === $i->getVar('side')) { |
|
177 | + } elseif (\XOOPS_CENTERBLOCK_LEFT === $i->getVar('side')) { |
|
182 | 178 | $ssel2 = ' checked'; |
183 | - } |
|
184 | - elseif (\XOOPS_CENTERBLOCK_RIGHT === $i->getVar('side')) { |
|
179 | + } elseif (\XOOPS_CENTERBLOCK_RIGHT === $i->getVar('side')) { |
|
185 | 180 | $ssel4 = ' checked'; |
186 | - } |
|
187 | - elseif (\XOOPS_CENTERBLOCK_CENTER === $i->getVar('side')) { |
|
181 | + } elseif (\XOOPS_CENTERBLOCK_CENTER === $i->getVar('side')) { |
|
188 | 182 | $ssel3 = ' checked'; |
189 | - } |
|
190 | - elseif (\XOOPS_CENTERBLOCK_BOTTOMLEFT === $i->getVar('side')) { |
|
183 | + } elseif (\XOOPS_CENTERBLOCK_BOTTOMLEFT === $i->getVar('side')) { |
|
191 | 184 | $ssel5 = ' checked'; |
192 | - } |
|
193 | - elseif (\XOOPS_CENTERBLOCK_BOTTOMRIGHT === $i->getVar('side')) { |
|
185 | + } elseif (\XOOPS_CENTERBLOCK_BOTTOMRIGHT === $i->getVar('side')) { |
|
194 | 186 | $ssel6 = ' checked'; |
195 | - } |
|
196 | - elseif (\XOOPS_CENTERBLOCK_BOTTOM === $i->getVar('side')) { |
|
187 | + } elseif (\XOOPS_CENTERBLOCK_BOTTOM === $i->getVar('side')) { |
|
197 | 188 | $ssel7 = ' checked'; |
198 | 189 | } |
199 | 190 | if ('' === $i->getVar('title')) { |
200 | 191 | $title = ' '; |
201 | - } |
|
202 | - else { |
|
192 | + } else { |
|
203 | 193 | $title = $i->getVar('title'); |
204 | 194 | } |
205 | 195 | $name = $i->getVar('name'); |
@@ -414,8 +404,7 @@ discard block |
||
414 | 404 | $clone->setVar('bid', 0); |
415 | 405 | if (\in_array($block->getVar('block_type'), ['C', 'E'])) { |
416 | 406 | $clone->setVar('block_type', 'E'); |
417 | - } |
|
418 | - else { |
|
407 | + } else { |
|
419 | 408 | $clone->setVar('block_type', 'D'); |
420 | 409 | } |
421 | 410 | // $newid = $clone->store(); //see https://github.com/XOOPS/XoopsCore25/issues/1105 |
@@ -540,8 +529,7 @@ discard block |
||
540 | 529 | if (\in_array(0, $bmodule)) { |
541 | 530 | $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid, 0); |
542 | 531 | $this->db->query($sql); |
543 | - } |
|
544 | - else { |
|
532 | + } else { |
|
545 | 533 | foreach ($bmodule as $bmid) { |
546 | 534 | $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid, (int)$bmid); |
547 | 535 | $this->db->query($sql); |
@@ -595,8 +583,7 @@ discard block |
||
595 | 583 | if (\in_array(0, $bmodule[$i], true)) { |
596 | 584 | $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid[$i], 0); |
597 | 585 | $this->db->query($sql); |
598 | - } |
|
599 | - else { |
|
586 | + } else { |
|
600 | 587 | foreach ($bmodule[$i] as $bmid) { |
601 | 588 | $sql = \sprintf('INSERT INTO `%s` (block_id, module_id) VALUES (%u, %d)', $this->db->prefix('block_module_link'), $bid[$i], (int)$bmid); |
602 | 589 | $this->db->query($sql); |
@@ -663,16 +650,14 @@ discard block |
||
663 | 650 | 'T' => \_AM_SYSTEM_BLOCKS_AFNOSMILE, |
664 | 651 | ]); |
665 | 652 | $form->addElement($ctypeSelect); |
666 | - } |
|
667 | - else { |
|
653 | + } else { |
|
668 | 654 | if ('' !== $block['template']) { |
669 | 655 | /** @var \XoopsTplfileHandler $tplfileHandler */ |
670 | 656 | $tplfileHandler = \xoops_getHandler('tplfile'); |
671 | 657 | $btemplate = $tplfileHandler->find($GLOBALS['xoopsConfig']['template_set'], 'block', $block['bid']); |
672 | 658 | if (\count($btemplate) > 0) { |
673 | 659 | $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate[0]->getVar('tpl_id') . '">' . \_AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); |
674 | - } |
|
675 | - else { |
|
660 | + } else { |
|
676 | 661 | $btemplate2 = $tplfileHandler->find('default', 'block', $block['bid']); |
677 | 662 | if (\count($btemplate2) > 0) { |
678 | 663 | $form->addElement(new \XoopsFormLabel(\_AM_SYSTEM_BLOCKS_CONTENT, '<a href="' . XOOPS_URL . '/modules/system/admin.php?fct=tplsets&op=edittpl&id=' . $btemplate2[0]->getVar('tpl_id') . '" target="_blank">' . \_AM_SYSTEM_BLOCKS_EDITTPL . '</a>')); |
@@ -40,13 +40,13 @@ discard block |
||
40 | 40 | //check for minimum XOOPS version |
41 | 41 | $currentVer = mb_substr(\XOOPS_VERSION, 6); // get the numeric part of string |
42 | 42 | if (null === $requiredVer) { |
43 | - $requiredVer = '' . $module->getInfo('min_xoops'); //making sure it's a string |
|
43 | + $requiredVer = ''.$module->getInfo('min_xoops'); //making sure it's a string |
|
44 | 44 | } |
45 | 45 | $success = true; |
46 | 46 | |
47 | 47 | if (\version_compare($currentVer, $requiredVer, '<')) { |
48 | 48 | $success = false; |
49 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
49 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_XOOPS'), $requiredVer, $currentVer)); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | return $success; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | |
78 | 78 | if (false !== $reqVer && '' !== $reqVer) { |
79 | 79 | if (\version_compare($verNum, $reqVer, '<')) { |
80 | - $module->setErrors(\sprintf(\constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
80 | + $module->setErrors(\sprintf(\constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_PHP'), $reqVer, $verNum)); |
|
81 | 81 | $success = false; |
82 | 82 | } |
83 | 83 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
101 | 101 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
102 | 102 | $update = ''; |
103 | - $repository = 'XoopsModules25x/' . $moduleDirName; |
|
103 | + $repository = 'XoopsModules25x/'.$moduleDirName; |
|
104 | 104 | // $repository = 'XoopsModules25x/publisher'; //for testing only |
105 | 105 | $ret = null; |
106 | 106 | $infoReleasesUrl = "https://api.github.com/repos/$repository/releases"; |
@@ -114,14 +114,14 @@ discard block |
||
114 | 114 | if (false === $curlReturn) { |
115 | 115 | \trigger_error(\curl_error($curlHandle)); |
116 | 116 | } elseif (false !== \mb_strpos($curlReturn, 'Not Found')) { |
117 | - \trigger_error('Repository Not Found: ' . $infoReleasesUrl); |
|
117 | + \trigger_error('Repository Not Found: '.$infoReleasesUrl); |
|
118 | 118 | } else { |
119 | 119 | $file = json_decode($curlReturn, false); |
120 | 120 | $latestVersionLink = \sprintf("https://github.com/$repository/archive/%s.zip", $file ? \reset($file)->tag_name : $default); |
121 | 121 | $latestVersion = $file[0]->tag_name; |
122 | 122 | $prerelease = $file[0]->prerelease; |
123 | 123 | if ('master' !== $latestVersionLink) { |
124 | - $update = \constant('CO_' . $moduleDirNameUpper . '_' . 'NEW_VERSION') . $latestVersion; |
|
124 | + $update = \constant('CO_'.$moduleDirNameUpper.'_'.'NEW_VERSION').$latestVersion; |
|
125 | 125 | } |
126 | 126 | //"PHP-standardized" version |
127 | 127 | $latestVersion = \mb_strtolower($latestVersion); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $latestVersion = \str_replace('_', '', \mb_strtolower($latestVersion)); |
130 | 130 | $latestVersion = \str_replace('final', '', \mb_strtolower($latestVersion)); |
131 | 131 | } |
132 | - $moduleVersion = ($helper->getModule()->getInfo('version') . '_' . $helper->getModule()->getInfo('module_status')); |
|
132 | + $moduleVersion = ($helper->getModule()->getInfo('version').'_'.$helper->getModule()->getInfo('module_status')); |
|
133 | 133 | //"PHP-standardized" version |
134 | 134 | $moduleVersion = \str_replace(' ', '', \mb_strtolower($moduleVersion)); |
135 | 135 | // $moduleVersion = '1.0'; //for testing only |