@@ -6,8 +6,8 @@ discard block |
||
6 | 6 | // extra module configs |
7 | 7 | $modversion['config'][] = [ |
8 | 8 | 'name' => 'imageConfigs', |
9 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', |
|
10 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', |
|
9 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG', |
|
10 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_CONFIG_DSC', |
|
11 | 11 | 'formtype' => 'line_break', |
12 | 12 | 'valuetype' => 'textbox', |
13 | 13 | 'default' => 'head', |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | |
16 | 16 | $modversion['config'][] = [ |
17 | 17 | 'name' => 'imageWidth', |
18 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', |
|
19 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', |
|
18 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH', |
|
19 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_WIDTH_DSC', |
|
20 | 20 | 'formtype' => 'textbox', |
21 | 21 | 'valuetype' => 'int', |
22 | 22 | 'default' => 1200, |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | |
25 | 25 | $modversion['config'][] = [ |
26 | 26 | 'name' => 'imageHeight', |
27 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', |
|
28 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', |
|
27 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT', |
|
28 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_HEIGHT_DSC', |
|
29 | 29 | 'formtype' => 'textbox', |
30 | 30 | 'valuetype' => 'int', |
31 | 31 | 'default' => 800, |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | |
34 | 34 | $modversion['config'][] = [ |
35 | 35 | 'name' => 'imageUploadPath', |
36 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', |
|
37 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', |
|
36 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH', |
|
37 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'IMAGE_UPLOAD_PATH_DSC', |
|
38 | 38 | 'formtype' => 'textbox', |
39 | 39 | 'valuetype' => 'text', |
40 | - 'default' => 'uploads/' . $modversion['dirname'] . '/images', |
|
40 | + 'default' => 'uploads/'.$modversion['dirname'].'/images', |
|
41 | 41 | ]; |
@@ -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 | } |
@@ -20,26 +20,26 @@ discard block |
||
20 | 20 | $moduleDirName = \basename(\dirname(__DIR__)); |
21 | 21 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
22 | 22 | |
23 | -return (object)[ |
|
24 | - 'name' => $moduleDirNameUpper . ' Module Configurator', |
|
23 | +return (object) [ |
|
24 | + 'name' => $moduleDirNameUpper.' Module Configurator', |
|
25 | 25 | 'paths' => [ |
26 | 26 | 'dirname' => $moduleDirName, |
27 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
28 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
29 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
30 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
31 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
27 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
28 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
29 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
30 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
31 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
32 | 32 | ], |
33 | 33 | 'uploadFolders' => [ |
34 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
35 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
36 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
34 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
35 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/category', |
|
36 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/screenshots', |
|
37 | 37 | //XOOPS_UPLOAD_PATH . '/flags' |
38 | 38 | ], |
39 | 39 | 'copyBlankFiles' => [ |
40 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
41 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
42 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
40 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
41 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/category', |
|
42 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/screenshots', |
|
43 | 43 | //XOOPS_UPLOAD_PATH . '/flags' |
44 | 44 | ], |
45 | 45 | |
@@ -79,5 +79,5 @@ discard block |
||
79 | 79 | // 'totalsubmitted' => $helper->getHandler('Item')->getItemsCount(-1, [Constants::PUBLISHER_STATUS_SUBMITTED]), |
80 | 80 | ], |
81 | 81 | 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
82 | - <img src='" . Admin::iconUrl('xoopsmicrobutton.gif') . "' alt='XOOPS Project'></a>", |
|
82 | + <img src='" . Admin::iconUrl('xoopsmicrobutton.gif')."' alt='XOOPS Project'></a>", |
|
83 | 83 | ]; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) |
22 | 22 | || !$GLOBALS['xoopsUser']->isAdmin()) { |
23 | - exit('Restricted access' . PHP_EOL); |
|
23 | + exit('Restricted access'.PHP_EOL); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -71,21 +71,21 @@ discard block |
||
71 | 71 | if ($tables->useTable($table)) { |
72 | 72 | $tables->alterColumn($table, $column, $attributes, $newName); |
73 | 73 | if (!$tables->executeQueue()) { |
74 | - echo '<br>' . _AM_MYIFRAME_UPGRADEFAILED0 . ' ' . $tables->getLastError(); |
|
74 | + echo '<br>'._AM_MYIFRAME_UPGRADEFAILED0.' '.$tables->getLastError(); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
78 | 78 | //delete old HTML templates |
79 | 79 | if (count($configurator->templateFolders) > 0) { |
80 | 80 | foreach ($configurator->templateFolders as $folder) { |
81 | - $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
81 | + $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder); |
|
82 | 82 | if (is_dir($templateFolder)) { |
83 | 83 | $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
84 | 84 | foreach ($templateList as $k => $v) { |
85 | - $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
85 | + $fileInfo = new \SplFileInfo($templateFolder.$v); |
|
86 | 86 | if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
87 | - if (is_file($templateFolder . $v)) { |
|
88 | - unlink($templateFolder . $v); |
|
87 | + if (is_file($templateFolder.$v)) { |
|
88 | + unlink($templateFolder.$v); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if (count($configurator->oldFiles) > 0) { |
98 | 98 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
99 | 99 | foreach (array_keys($configurator->oldFiles) as $i) { |
100 | - $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
100 | + $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]); |
|
101 | 101 | if (is_file($tempFile)) { |
102 | 102 | unlink($tempFile); |
103 | 103 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | if (count($configurator->oldFolders) > 0) { |
110 | 110 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
111 | 111 | foreach (array_keys($configurator->oldFolders) as $i) { |
112 | - $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
112 | + $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]); |
|
113 | 113 | /** @var XoopsObjectHandler $folderHandler */ |
114 | 114 | $folderHandler = XoopsFile::getHandler('folder', $tempFolder); |
115 | 115 | $folderHandler->delete($tempFolder); |
@@ -126,15 +126,15 @@ discard block |
||
126 | 126 | |
127 | 127 | // --- COPY blank.png FILES --------------- |
128 | 128 | if (count($configurator->copyBlankFiles) > 0) { |
129 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
129 | + $file = \dirname(__DIR__).'/assets/images/blank.png'; |
|
130 | 130 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
131 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
131 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
132 | 132 | $utility::copyFile($file, $dest); |
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | 136 | //delete .html entries from the tpl table |
137 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\''; |
|
137 | + $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\''; |
|
138 | 138 | $GLOBALS['xoopsDB']->queryF($sql); |
139 | 139 | |
140 | 140 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function xoops_module_pre_install_myiframe(\XoopsModule $module) |
30 | 30 | { |
31 | - require_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
31 | + require_once \dirname(__DIR__).'/preloads/autoloader.php'; |
|
32 | 32 | /** @var \Utility $utility */ |
33 | 33 | $utility = new Utility(); |
34 | 34 | $xoopsSuccess = $utility::checkVerXoops($module); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | if (false !== $xoopsSuccess && false !== $phpSuccess) { |
38 | 38 | $moduleTables = &$module->getInfo('tables'); |
39 | 39 | foreach ($moduleTables as $table) { |
40 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
40 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | function xoops_module_install_myiframe(\XoopsModule $module) |
54 | 54 | { |
55 | - require \dirname(__DIR__, 3) . '/mainfile.php'; |
|
55 | + require \dirname(__DIR__, 3).'/mainfile.php'; |
|
56 | 56 | |
57 | 57 | $moduleDirName = \basename(\dirname(__DIR__)); |
58 | 58 | |
@@ -73,11 +73,11 @@ discard block |
||
73 | 73 | /** @var \XoopsGroupPermHandler $grouppermHandler */ |
74 | 74 | $grouppermHandler = xoops_getHandler('groupperm'); |
75 | 75 | // access rights ------------------------------------------ |
76 | - $grouppermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | - $grouppermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
78 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
79 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
80 | - $grouppermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
76 | + $grouppermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | + $grouppermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
78 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
79 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
80 | + $grouppermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
81 | 81 | |
82 | 82 | // --- CREATE FOLDERS --------------- |
83 | 83 | if (count($configurator->uploadFolders) > 0) { |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | |
90 | 90 | // --- COPY blank.png FILES --------------- |
91 | 91 | if (count($configurator->copyBlankFiles) > 0) { |
92 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
92 | + $file = \dirname(__DIR__).'/assets/images/blank.png'; |
|
93 | 93 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
94 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
94 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
95 | 95 | $utility::copyFile($file, $dest); |
96 | 96 | } |
97 | 97 | } |
98 | 98 | //delete .html entries from the tpl table |
99 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
99 | + $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'"; |
|
100 | 100 | $GLOBALS['xoopsDB']->queryF($sql); |
101 | 101 | |
102 | 102 | return true; |
@@ -51,8 +51,8 @@ |
||
51 | 51 | if ($dirInfo->isDir()) { |
52 | 52 | // The directory exists so rename it |
53 | 53 | $date = date('Y-m-d'); |
54 | - if (!rename($uploadDirectory, $uploadDirectory . "_bak_$date")) { |
|
55 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $uploadDirectory)); |
|
54 | + if (!rename($uploadDirectory, $uploadDirectory."_bak_$date")) { |
|
55 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $uploadDirectory)); |
|
56 | 56 | $success = false; |
57 | 57 | } |
58 | 58 | } |
@@ -67,7 +67,7 @@ |
||
67 | 67 | { |
68 | 68 | $ret = false; |
69 | 69 | |
70 | - $class = __NAMESPACE__ . '\\' . \ucfirst($name) . 'Handler'; |
|
70 | + $class = __NAMESPACE__.'\\'.\ucfirst($name).'Handler'; |
|
71 | 71 | if (!\class_exists($class)) { |
72 | 72 | throw new \RuntimeException("Class '$class' not found"); |
73 | 73 | } |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | |
63 | 63 | if (self::SHOW_BUTTONS == $displaySampleButton) { |
64 | 64 | \xoops_loadLanguage('admin/modulesadmin', 'system'); |
65 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add'); |
|
66 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add'); |
|
67 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'CLEAR_SAMPLEDATA'), $helper->url('testdata/index.php?op=clear'), 'alert'); |
|
65 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'LOAD_SAMPLEDATA'), $helper->url('testdata/index.php?op=load'), 'add'); |
|
66 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA'), $helper->url('testdata/index.php?op=save'), 'add'); |
|
67 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'CLEAR_SAMPLEDATA'), $helper->url('testdata/index.php?op=clear'), 'alert'); |
|
68 | 68 | // $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), $helper->url( 'testdata/index.php?op=exportschema'), 'add'); |
69 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete'); |
|
69 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete'); |
|
70 | 70 | } else { |
71 | - $adminObject->addItemButton(\constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add'); |
|
71 | + $adminObject->addItemButton(\constant('CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add'); |
|
72 | 72 | // $displaySampleButton = $config['displaySampleButton']; |
73 | 73 | } |
74 | 74 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public static function hideButtons(): void |
82 | 82 | { |
83 | - $yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml'; |
|
83 | + $yamlFile = \dirname(__DIR__, 2).'/config/admin.yml'; |
|
84 | 84 | $app = []; |
85 | 85 | $app['displaySampleButton'] = 0; |
86 | 86 | Yaml::save($app, $yamlFile); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public static function showButtons(): void |
96 | 96 | { |
97 | - $yamlFile = \dirname(__DIR__, 2) . '/config/admin.yml'; |
|
97 | + $yamlFile = \dirname(__DIR__, 2).'/config/admin.yml'; |
|
98 | 98 | $app = []; |
99 | 99 | $app['displaySampleButton'] = 1; |
100 | 100 | Yaml::save($app, $yamlFile); |