@@ -5,17 +5,17 @@ |
||
5 | 5 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
6 | 6 | |
7 | 7 | return [ |
8 | - 'name' => \mb_strtoupper($moduleDirName) . ' PathConfigurator', |
|
9 | - 'dirname' => $moduleDirName, |
|
10 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
11 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
12 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
13 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
14 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
15 | - 'uploadFolders' => [ |
|
16 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
17 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
18 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
19 | - //XOOPS_UPLOAD_PATH . '/flags' |
|
20 | - ], |
|
8 | + 'name' => \mb_strtoupper($moduleDirName) . ' PathConfigurator', |
|
9 | + 'dirname' => $moduleDirName, |
|
10 | + 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
11 | + 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
12 | + 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
13 | + 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
14 | + 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
15 | + 'uploadFolders' => [ |
|
16 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
17 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
18 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
19 | + //XOOPS_UPLOAD_PATH . '/flags' |
|
20 | + ], |
|
21 | 21 | ]; |
@@ -5,17 +5,17 @@ |
||
5 | 5 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
6 | 6 | |
7 | 7 | return [ |
8 | - 'name' => \mb_strtoupper($moduleDirName) . ' PathConfigurator', |
|
8 | + 'name' => \mb_strtoupper($moduleDirName).' PathConfigurator', |
|
9 | 9 | 'dirname' => $moduleDirName, |
10 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
11 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
12 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
13 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
14 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
10 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
11 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
12 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
13 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
14 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
15 | 15 | 'uploadFolders' => [ |
16 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
17 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
18 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
16 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
17 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/category', |
|
18 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/screenshots', |
|
19 | 19 | //XOOPS_UPLOAD_PATH . '/flags' |
20 | 20 | ], |
21 | 21 | ]; |
@@ -5,37 +5,37 @@ |
||
5 | 5 | |
6 | 6 | // extra module configs |
7 | 7 | $modversion['config'][] = [ |
8 | - 'name' => 'imageConfigs', |
|
9 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', |
|
10 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', |
|
11 | - 'formtype' => 'line_break', |
|
12 | - 'valuetype' => 'textbox', |
|
13 | - 'default' => 'head', |
|
8 | + 'name' => 'imageConfigs', |
|
9 | + 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG', |
|
10 | + 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_CONFIG_DSC', |
|
11 | + 'formtype' => 'line_break', |
|
12 | + 'valuetype' => 'textbox', |
|
13 | + 'default' => 'head', |
|
14 | 14 | ]; |
15 | 15 | |
16 | 16 | $modversion['config'][] = [ |
17 | - 'name' => 'imageWidth', |
|
18 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', |
|
19 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', |
|
20 | - 'formtype' => 'textbox', |
|
21 | - 'valuetype' => 'int', |
|
22 | - 'default' => 1200, |
|
17 | + 'name' => 'imageWidth', |
|
18 | + 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH', |
|
19 | + 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_WIDTH_DSC', |
|
20 | + 'formtype' => 'textbox', |
|
21 | + 'valuetype' => 'int', |
|
22 | + 'default' => 1200, |
|
23 | 23 | ]; // =1024/16 |
24 | 24 | |
25 | 25 | $modversion['config'][] = [ |
26 | - 'name' => 'imageHeight', |
|
27 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', |
|
28 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', |
|
29 | - 'formtype' => 'textbox', |
|
30 | - 'valuetype' => 'int', |
|
31 | - 'default' => 800, |
|
26 | + 'name' => 'imageHeight', |
|
27 | + 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT', |
|
28 | + 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_HEIGHT_DSC', |
|
29 | + 'formtype' => 'textbox', |
|
30 | + 'valuetype' => 'int', |
|
31 | + 'default' => 800, |
|
32 | 32 | ]; // =768/16 |
33 | 33 | |
34 | 34 | $modversion['config'][] = [ |
35 | - 'name' => 'imageUploadPath', |
|
36 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', |
|
37 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', |
|
38 | - 'formtype' => 'textbox', |
|
39 | - 'valuetype' => 'text', |
|
40 | - 'default' => 'uploads/' . $modversion['dirname'] . '/images', |
|
35 | + 'name' => 'imageUploadPath', |
|
36 | + 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH', |
|
37 | + 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'IMAGE_UPLOAD_PATH_DSC', |
|
38 | + 'formtype' => 'textbox', |
|
39 | + 'valuetype' => 'text', |
|
40 | + 'default' => 'uploads/' . $modversion['dirname'] . '/images', |
|
41 | 41 | ]; |
@@ -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,31 +4,31 @@ |
||
4 | 4 | * @see https://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | 6 | spl_autoload_register( |
7 | - static function ($class): void { |
|
8 | - // project-specific namespace prefix |
|
9 | - $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
7 | + static function ($class): void { |
|
8 | + // project-specific namespace prefix |
|
9 | + $prefix = 'XoopsModules\\' . ucfirst(basename(dirname(__DIR__))); |
|
10 | 10 | |
11 | - // base directory for the namespace prefix |
|
12 | - $baseDir = \dirname(__DIR__) . '/class/'; |
|
11 | + // base directory for the namespace prefix |
|
12 | + $baseDir = \dirname(__DIR__) . '/class/'; |
|
13 | 13 | |
14 | - // does the class use the namespace prefix? |
|
15 | - $len = mb_strlen($prefix); |
|
14 | + // does the class use the namespace prefix? |
|
15 | + $len = mb_strlen($prefix); |
|
16 | 16 | |
17 | - if (0 !== strncmp($prefix, $class, $len)) { |
|
18 | - return; |
|
19 | - } |
|
17 | + if (0 !== strncmp($prefix, $class, $len)) { |
|
18 | + return; |
|
19 | + } |
|
20 | 20 | |
21 | - // get the relative class name |
|
22 | - $relativeClass = mb_substr($class, $len); |
|
21 | + // get the relative class name |
|
22 | + $relativeClass = mb_substr($class, $len); |
|
23 | 23 | |
24 | - // replace the namespace prefix with the base directory, replace namespace |
|
25 | - // separators with directory separators in the relative class name, append |
|
26 | - // with .php |
|
27 | - $file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php'; |
|
24 | + // replace the namespace prefix with the base directory, replace namespace |
|
25 | + // separators with directory separators in the relative class name, append |
|
26 | + // with .php |
|
27 | + $file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php'; |
|
28 | 28 | |
29 | - // if the file exists, require it |
|
30 | - if (is_file($file)) { |
|
31 | - require_once $file; |
|
32 | - } |
|
33 | - } |
|
29 | + // if the file exists, require it |
|
30 | + if (is_file($file)) { |
|
31 | + require_once $file; |
|
32 | + } |
|
33 | + } |
|
34 | 34 | ); |
@@ -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)) { |
@@ -20,12 +20,12 @@ |
||
20 | 20 | */ |
21 | 21 | class MyiframeCorePreload extends \XoopsPreloadItem |
22 | 22 | { |
23 | - // to add PSR-4 autoloader |
|
24 | - /** |
|
25 | - * @param $args |
|
26 | - */ |
|
27 | - public static function eventCoreIncludeCommonEnd($args): void |
|
28 | - { |
|
29 | - require_once __DIR__ . '/autoloader.php'; |
|
30 | - } |
|
23 | + // to add PSR-4 autoloader |
|
24 | + /** |
|
25 | + * @param $args |
|
26 | + */ |
|
27 | + public static function eventCoreIncludeCommonEnd($args): void |
|
28 | + { |
|
29 | + require_once __DIR__ . '/autoloader.php'; |
|
30 | + } |
|
31 | 31 | } |
@@ -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 | } |
@@ -21,63 +21,63 @@ |
||
21 | 21 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
22 | 22 | |
23 | 23 | return (object)[ |
24 | - 'name' => $moduleDirNameUpper . ' Module Configurator', |
|
25 | - 'paths' => [ |
|
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, |
|
32 | - ], |
|
33 | - 'uploadFolders' => [ |
|
34 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
35 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
36 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
37 | - //XOOPS_UPLOAD_PATH . '/flags' |
|
38 | - ], |
|
39 | - 'copyBlankFiles' => [ |
|
40 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
41 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
42 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
43 | - //XOOPS_UPLOAD_PATH . '/flags' |
|
44 | - ], |
|
24 | + 'name' => $moduleDirNameUpper . ' Module Configurator', |
|
25 | + 'paths' => [ |
|
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, |
|
32 | + ], |
|
33 | + 'uploadFolders' => [ |
|
34 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
35 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
36 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
37 | + //XOOPS_UPLOAD_PATH . '/flags' |
|
38 | + ], |
|
39 | + 'copyBlankFiles' => [ |
|
40 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
41 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
42 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
43 | + //XOOPS_UPLOAD_PATH . '/flags' |
|
44 | + ], |
|
45 | 45 | |
46 | - 'copyTestFolders' => [ |
|
47 | - //[ |
|
48 | - // constant($moduleDirNameUpper . '_PATH') . '/testdata/images', |
|
49 | - // XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images', |
|
50 | - //] |
|
51 | - ], |
|
46 | + 'copyTestFolders' => [ |
|
47 | + //[ |
|
48 | + // constant($moduleDirNameUpper . '_PATH') . '/testdata/images', |
|
49 | + // XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/images', |
|
50 | + //] |
|
51 | + ], |
|
52 | 52 | |
53 | - 'templateFolders' => [ |
|
54 | - '/templates/', |
|
55 | - '/templates/blocks/', |
|
56 | - '/templates/admin/', |
|
57 | - ], |
|
58 | - 'oldFiles' => [ |
|
59 | - '/class/request.php', |
|
60 | - '/class/registry.php', |
|
61 | - '/class/utilities.php', |
|
62 | - '/class/util.php', |
|
63 | - // '/include/constants.php', |
|
64 | - // '/include/functions.php', |
|
65 | - '/ajaxrating.txt', |
|
66 | - ], |
|
67 | - 'oldFolders' => [ |
|
68 | - '/images', |
|
69 | - '/css', |
|
70 | - '/js', |
|
71 | - '/tcpdf', |
|
72 | - '/images', |
|
73 | - ], |
|
74 | - 'renameTables' => [// 'XX_archive' => 'ZZZZ_archive', |
|
75 | - ], |
|
76 | - 'moduleStats' => [ |
|
77 | - // 'totalcategories' => $helper->getHandler('Category')->getCategoriesCount(-1), |
|
78 | - // 'totalitems' => $helper->getHandler('Item')->getItemsCount(), |
|
79 | - // 'totalsubmitted' => $helper->getHandler('Item')->getItemsCount(-1, [Constants::PUBLISHER_STATUS_SUBMITTED]), |
|
80 | - ], |
|
81 | - 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
|
53 | + 'templateFolders' => [ |
|
54 | + '/templates/', |
|
55 | + '/templates/blocks/', |
|
56 | + '/templates/admin/', |
|
57 | + ], |
|
58 | + 'oldFiles' => [ |
|
59 | + '/class/request.php', |
|
60 | + '/class/registry.php', |
|
61 | + '/class/utilities.php', |
|
62 | + '/class/util.php', |
|
63 | + // '/include/constants.php', |
|
64 | + // '/include/functions.php', |
|
65 | + '/ajaxrating.txt', |
|
66 | + ], |
|
67 | + 'oldFolders' => [ |
|
68 | + '/images', |
|
69 | + '/css', |
|
70 | + '/js', |
|
71 | + '/tcpdf', |
|
72 | + '/images', |
|
73 | + ], |
|
74 | + 'renameTables' => [// 'XX_archive' => 'ZZZZ_archive', |
|
75 | + ], |
|
76 | + 'moduleStats' => [ |
|
77 | + // 'totalcategories' => $helper->getHandler('Category')->getCategoriesCount(-1), |
|
78 | + // 'totalitems' => $helper->getHandler('Item')->getItemsCount(), |
|
79 | + // 'totalsubmitted' => $helper->getHandler('Item')->getItemsCount(-1, [Constants::PUBLISHER_STATUS_SUBMITTED]), |
|
80 | + ], |
|
81 | + 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'> |
|
82 | 82 | <img src='" . Admin::iconUrl('xoopsmicrobutton.gif') . "' alt='XOOPS Project'></a>", |
83 | 83 | ]; |
@@ -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 | ]; |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | use XoopsModules\Myiframe; |
20 | 20 | |
21 | 21 | if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) |
22 | - || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
23 | - exit('Restricted access' . PHP_EOL); |
|
22 | + || !$GLOBALS['xoopsUser']->isAdmin()) { |
|
23 | + exit('Restricted access' . PHP_EOL); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | */ |
32 | 32 | function xoops_module_pre_update_myiframe(\XoopsModule $module) |
33 | 33 | { |
34 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
35 | - /** @var Myiframe\Helper $helper */ |
|
36 | - /** @var Myiframe\Utility $utility */ |
|
37 | - $helper = Myiframe\Helper::getInstance(); |
|
38 | - $utility = new Myiframe\Utility(); |
|
34 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
35 | + /** @var Myiframe\Helper $helper */ |
|
36 | + /** @var Myiframe\Utility $utility */ |
|
37 | + $helper = Myiframe\Helper::getInstance(); |
|
38 | + $utility = new Myiframe\Utility(); |
|
39 | 39 | |
40 | - $xoopsSuccess = $utility::checkVerXoops($module); |
|
41 | - $phpSuccess = $utility::checkVerPhp($module); |
|
40 | + $xoopsSuccess = $utility::checkVerXoops($module); |
|
41 | + $phpSuccess = $utility::checkVerPhp($module); |
|
42 | 42 | |
43 | - return $xoopsSuccess && $phpSuccess; |
|
43 | + return $xoopsSuccess && $phpSuccess; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -52,96 +52,96 @@ discard block |
||
52 | 52 | */ |
53 | 53 | function xoops_module_update_myiframe(\XoopsModule $module, $previousVersion = null) |
54 | 54 | { |
55 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
56 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
57 | - |
|
58 | - /** @var Myiframe\Helper $helper */ /** @var Myiframe\Utility $utility */ |
|
59 | - /** @var Myiframe\Common\Configurator $configurator */ |
|
60 | - $helper = Myiframe\Helper::getInstance(); |
|
61 | - $utility = new Myiframe\Utility(); |
|
62 | - $configurator = new Myiframe\Common\Configurator(); |
|
63 | - |
|
64 | - if ($previousVersion < 240) { |
|
65 | - //rename column EXAMPLE |
|
66 | - $tables = new Tables(); |
|
67 | - $table = 'myiframex_categories'; |
|
68 | - $column = 'ordre'; |
|
69 | - $newName = 'order'; |
|
70 | - $attributes = "INT(5) NOT NULL DEFAULT '0'"; |
|
71 | - if ($tables->useTable($table)) { |
|
72 | - $tables->alterColumn($table, $column, $attributes, $newName); |
|
73 | - if (!$tables->executeQueue()) { |
|
74 | - echo '<br>' . _AM_MYIFRAME_UPGRADEFAILED0 . ' ' . $tables->getLastError(); |
|
75 | - } |
|
76 | - } |
|
77 | - |
|
78 | - //delete old HTML templates |
|
79 | - if (count($configurator->templateFolders) > 0) { |
|
80 | - foreach ($configurator->templateFolders as $folder) { |
|
81 | - $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
82 | - if (is_dir($templateFolder)) { |
|
83 | - $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
|
84 | - foreach ($templateList as $k => $v) { |
|
85 | - $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
86 | - if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
|
87 | - if (is_file($templateFolder . $v)) { |
|
88 | - unlink($templateFolder . $v); |
|
89 | - } |
|
90 | - } |
|
91 | - } |
|
92 | - } |
|
93 | - } |
|
94 | - } |
|
95 | - |
|
96 | - // --- DELETE OLD FILES --------------- |
|
97 | - if (count($configurator->oldFiles) > 0) { |
|
98 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
99 | - foreach (array_keys($configurator->oldFiles) as $i) { |
|
100 | - $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
101 | - if (is_file($tempFile)) { |
|
102 | - unlink($tempFile); |
|
103 | - } |
|
104 | - } |
|
105 | - } |
|
106 | - |
|
107 | - // --- DELETE OLD FOLDERS --------------- |
|
108 | - xoops_load('XoopsFile'); |
|
109 | - if (count($configurator->oldFolders) > 0) { |
|
110 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
111 | - foreach (array_keys($configurator->oldFolders) as $i) { |
|
112 | - $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
113 | - /** @var XoopsObjectHandler $folderHandler */ |
|
114 | - $folderHandler = XoopsFile::getHandler('folder', $tempFolder); |
|
115 | - $folderHandler->delete($tempFolder); |
|
116 | - } |
|
117 | - } |
|
118 | - |
|
119 | - // --- CREATE FOLDERS --------------- |
|
120 | - if (count($configurator->uploadFolders) > 0) { |
|
121 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
122 | - foreach (array_keys($configurator->uploadFolders) as $i) { |
|
123 | - $utility::createFolder($configurator->uploadFolders[$i]); |
|
124 | - } |
|
125 | - } |
|
126 | - |
|
127 | - // --- COPY blank.png FILES --------------- |
|
128 | - if (count($configurator->copyBlankFiles) > 0) { |
|
129 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
130 | - foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
131 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
132 | - $utility::copyFile($file, $dest); |
|
133 | - } |
|
134 | - } |
|
135 | - |
|
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%\''; |
|
138 | - $GLOBALS['xoopsDB']->queryF($sql); |
|
139 | - |
|
140 | - /** @var \XoopsGroupPermHandler $grouppermHandler */ |
|
141 | - $grouppermHandler = xoops_getHandler('groupperm'); |
|
142 | - |
|
143 | - return $grouppermHandler->deleteByModule($module->getVar('mid'), 'item_read'); |
|
144 | - } |
|
145 | - |
|
146 | - return true; |
|
55 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
56 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
57 | + |
|
58 | + /** @var Myiframe\Helper $helper */ /** @var Myiframe\Utility $utility */ |
|
59 | + /** @var Myiframe\Common\Configurator $configurator */ |
|
60 | + $helper = Myiframe\Helper::getInstance(); |
|
61 | + $utility = new Myiframe\Utility(); |
|
62 | + $configurator = new Myiframe\Common\Configurator(); |
|
63 | + |
|
64 | + if ($previousVersion < 240) { |
|
65 | + //rename column EXAMPLE |
|
66 | + $tables = new Tables(); |
|
67 | + $table = 'myiframex_categories'; |
|
68 | + $column = 'ordre'; |
|
69 | + $newName = 'order'; |
|
70 | + $attributes = "INT(5) NOT NULL DEFAULT '0'"; |
|
71 | + if ($tables->useTable($table)) { |
|
72 | + $tables->alterColumn($table, $column, $attributes, $newName); |
|
73 | + if (!$tables->executeQueue()) { |
|
74 | + echo '<br>' . _AM_MYIFRAME_UPGRADEFAILED0 . ' ' . $tables->getLastError(); |
|
75 | + } |
|
76 | + } |
|
77 | + |
|
78 | + //delete old HTML templates |
|
79 | + if (count($configurator->templateFolders) > 0) { |
|
80 | + foreach ($configurator->templateFolders as $folder) { |
|
81 | + $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
82 | + if (is_dir($templateFolder)) { |
|
83 | + $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
|
84 | + foreach ($templateList as $k => $v) { |
|
85 | + $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
86 | + if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
|
87 | + if (is_file($templateFolder . $v)) { |
|
88 | + unlink($templateFolder . $v); |
|
89 | + } |
|
90 | + } |
|
91 | + } |
|
92 | + } |
|
93 | + } |
|
94 | + } |
|
95 | + |
|
96 | + // --- DELETE OLD FILES --------------- |
|
97 | + if (count($configurator->oldFiles) > 0) { |
|
98 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
99 | + foreach (array_keys($configurator->oldFiles) as $i) { |
|
100 | + $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
101 | + if (is_file($tempFile)) { |
|
102 | + unlink($tempFile); |
|
103 | + } |
|
104 | + } |
|
105 | + } |
|
106 | + |
|
107 | + // --- DELETE OLD FOLDERS --------------- |
|
108 | + xoops_load('XoopsFile'); |
|
109 | + if (count($configurator->oldFolders) > 0) { |
|
110 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
111 | + foreach (array_keys($configurator->oldFolders) as $i) { |
|
112 | + $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
113 | + /** @var XoopsObjectHandler $folderHandler */ |
|
114 | + $folderHandler = XoopsFile::getHandler('folder', $tempFolder); |
|
115 | + $folderHandler->delete($tempFolder); |
|
116 | + } |
|
117 | + } |
|
118 | + |
|
119 | + // --- CREATE FOLDERS --------------- |
|
120 | + if (count($configurator->uploadFolders) > 0) { |
|
121 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
122 | + foreach (array_keys($configurator->uploadFolders) as $i) { |
|
123 | + $utility::createFolder($configurator->uploadFolders[$i]); |
|
124 | + } |
|
125 | + } |
|
126 | + |
|
127 | + // --- COPY blank.png FILES --------------- |
|
128 | + if (count($configurator->copyBlankFiles) > 0) { |
|
129 | + $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
130 | + foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
131 | + $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
132 | + $utility::copyFile($file, $dest); |
|
133 | + } |
|
134 | + } |
|
135 | + |
|
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%\''; |
|
138 | + $GLOBALS['xoopsDB']->queryF($sql); |
|
139 | + |
|
140 | + /** @var \XoopsGroupPermHandler $grouppermHandler */ |
|
141 | + $grouppermHandler = xoops_getHandler('groupperm'); |
|
142 | + |
|
143 | + return $grouppermHandler->deleteByModule($module->getVar('mid'), 'item_read'); |
|
144 | + } |
|
145 | + |
|
146 | + return true; |
|
147 | 147 | } |
@@ -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 */ |
@@ -21,33 +21,33 @@ discard block |
||
21 | 21 | */ |
22 | 22 | function myiframe_getmoduleoption($option, $repmodule = 'myiframe') |
23 | 23 | { |
24 | - global $xoopsModuleConfig, $xoopsModule; |
|
25 | - static $tbloptions = []; |
|
26 | - if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) { |
|
27 | - return $tbloptions[$option]; |
|
28 | - } |
|
24 | + global $xoopsModuleConfig, $xoopsModule; |
|
25 | + static $tbloptions = []; |
|
26 | + if (is_array($tbloptions) && array_key_exists($option, $tbloptions)) { |
|
27 | + return $tbloptions[$option]; |
|
28 | + } |
|
29 | 29 | |
30 | - $retval = false; |
|
31 | - if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) { |
|
32 | - if (isset($xoopsModuleConfig[$option])) { |
|
33 | - $retval = $xoopsModuleConfig[$option]; |
|
34 | - } |
|
35 | - } else { |
|
36 | - /** @var \XoopsModuleHandler $moduleHandler */ |
|
37 | - $moduleHandler = xoops_getHandler('module'); |
|
38 | - $module = $moduleHandler->getByDirname($repmodule); |
|
39 | - /** @var \XoopsConfigHandler $configHandler */ |
|
40 | - $configHandler = xoops_getHandler('config'); |
|
41 | - if ($module) { |
|
42 | - $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
|
43 | - if (isset($moduleConfig[$option])) { |
|
44 | - $retval = $moduleConfig[$option]; |
|
45 | - } |
|
46 | - } |
|
47 | - } |
|
48 | - $tbloptions[$option] = $retval; |
|
30 | + $retval = false; |
|
31 | + if (isset($xoopsModuleConfig) && (is_object($xoopsModule) && $xoopsModule->getVar('dirname') == $repmodule && $xoopsModule->getVar('isactive'))) { |
|
32 | + if (isset($xoopsModuleConfig[$option])) { |
|
33 | + $retval = $xoopsModuleConfig[$option]; |
|
34 | + } |
|
35 | + } else { |
|
36 | + /** @var \XoopsModuleHandler $moduleHandler */ |
|
37 | + $moduleHandler = xoops_getHandler('module'); |
|
38 | + $module = $moduleHandler->getByDirname($repmodule); |
|
39 | + /** @var \XoopsConfigHandler $configHandler */ |
|
40 | + $configHandler = xoops_getHandler('config'); |
|
41 | + if ($module) { |
|
42 | + $moduleConfig = $configHandler->getConfigsByCat(0, $module->getVar('mid')); |
|
43 | + if (isset($moduleConfig[$option])) { |
|
44 | + $retval = $moduleConfig[$option]; |
|
45 | + } |
|
46 | + } |
|
47 | + } |
|
48 | + $tbloptions[$option] = $retval; |
|
49 | 49 | |
50 | - return $retval; |
|
50 | + return $retval; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -61,9 +61,9 @@ discard block |
||
61 | 61 | */ |
62 | 62 | function myiframe_FieldExists($fieldname, $table) |
63 | 63 | { |
64 | - $result = $GLOBALS['xoopsDB']->queryF("SHOW COLUMNS FROM $table LIKE '$fieldname'"); |
|
64 | + $result = $GLOBALS['xoopsDB']->queryF("SHOW COLUMNS FROM $table LIKE '$fieldname'"); |
|
65 | 65 | |
66 | - return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0); |
|
66 | + return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -78,21 +78,21 @@ discard block |
||
78 | 78 | */ |
79 | 79 | function myiframe_set_metas($page_title = '', $meta_description = '', $meta_keywords = ''): void |
80 | 80 | { |
81 | - global $xoTheme, $xoTheme, $xoopsTpl; |
|
82 | - $xoopsTpl->assign('xoops_pagetitle', $page_title); |
|
83 | - if (isset($xoTheme) && is_object($xoTheme)) { |
|
84 | - if (!empty($meta_keywords)) { |
|
85 | - $xoTheme->addMeta('meta', 'keywords', $meta_keywords); |
|
86 | - } |
|
87 | - if (!empty($meta_description)) { |
|
88 | - $xoTheme->addMeta('meta', 'description', $meta_description); |
|
89 | - } |
|
90 | - } elseif (isset($xoopsTpl) && is_object($xoopsTpl)) { // Compatibility for old Xoops versions |
|
91 | - if (!empty($meta_keywords)) { |
|
92 | - $xoopsTpl->assign('xoops_meta_keywords', $meta_keywords); |
|
93 | - } |
|
94 | - if (!empty($meta_description)) { |
|
95 | - $xoopsTpl->assign('xoops_meta_description', $meta_description); |
|
96 | - } |
|
97 | - } |
|
81 | + global $xoTheme, $xoTheme, $xoopsTpl; |
|
82 | + $xoopsTpl->assign('xoops_pagetitle', $page_title); |
|
83 | + if (isset($xoTheme) && is_object($xoTheme)) { |
|
84 | + if (!empty($meta_keywords)) { |
|
85 | + $xoTheme->addMeta('meta', 'keywords', $meta_keywords); |
|
86 | + } |
|
87 | + if (!empty($meta_description)) { |
|
88 | + $xoTheme->addMeta('meta', 'description', $meta_description); |
|
89 | + } |
|
90 | + } elseif (isset($xoopsTpl) && is_object($xoopsTpl)) { // Compatibility for old Xoops versions |
|
91 | + if (!empty($meta_keywords)) { |
|
92 | + $xoopsTpl->assign('xoops_meta_keywords', $meta_keywords); |
|
93 | + } |
|
94 | + if (!empty($meta_description)) { |
|
95 | + $xoopsTpl->assign('xoops_meta_description', $meta_description); |
|
96 | + } |
|
97 | + } |
|
98 | 98 | } |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function xoops_module_pre_install_myiframe(\XoopsModule $module) |
30 | 30 | { |
31 | - require_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
32 | - /** @var \Utility $utility */ |
|
33 | - $utility = new Utility(); |
|
34 | - $xoopsSuccess = $utility::checkVerXoops($module); |
|
35 | - $phpSuccess = $utility::checkVerPhp($module); |
|
31 | + require_once \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
32 | + /** @var \Utility $utility */ |
|
33 | + $utility = new Utility(); |
|
34 | + $xoopsSuccess = $utility::checkVerXoops($module); |
|
35 | + $phpSuccess = $utility::checkVerPhp($module); |
|
36 | 36 | |
37 | - if (false !== $xoopsSuccess && false !== $phpSuccess) { |
|
38 | - $moduleTables = &$module->getInfo('tables'); |
|
39 | - foreach ($moduleTables as $table) { |
|
40 | - $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
41 | - } |
|
42 | - } |
|
37 | + if (false !== $xoopsSuccess && false !== $phpSuccess) { |
|
38 | + $moduleTables = &$module->getInfo('tables'); |
|
39 | + foreach ($moduleTables as $table) { |
|
40 | + $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
41 | + } |
|
42 | + } |
|
43 | 43 | |
44 | - return $xoopsSuccess && $phpSuccess; |
|
44 | + return $xoopsSuccess && $phpSuccess; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -52,52 +52,52 @@ 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 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
57 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
58 | 58 | |
59 | - /** @var Myiframe\Helper $helper */ |
|
60 | - $helper = Myiframe\Helper::getInstance(); |
|
61 | - /** @var Myiframe\Utility $helper */ |
|
62 | - $utility = new Utility(); |
|
63 | - /** @var Myiframe\Common\Configurator $helper */ |
|
64 | - $configurator = new Myiframe\Common\Configurator(); |
|
65 | - // Load language files |
|
66 | - $helper->loadLanguage('admin'); |
|
67 | - $helper->loadLanguage('modinfo'); |
|
59 | + /** @var Myiframe\Helper $helper */ |
|
60 | + $helper = Myiframe\Helper::getInstance(); |
|
61 | + /** @var Myiframe\Utility $helper */ |
|
62 | + $utility = new Utility(); |
|
63 | + /** @var Myiframe\Common\Configurator $helper */ |
|
64 | + $configurator = new Myiframe\Common\Configurator(); |
|
65 | + // Load language files |
|
66 | + $helper->loadLanguage('admin'); |
|
67 | + $helper->loadLanguage('modinfo'); |
|
68 | 68 | |
69 | - // default Permission Settings ---------------------- |
|
70 | - global $xoopsModule; |
|
71 | - $moduleId = $xoopsModule->getVar('mid'); |
|
72 | - // $moduleId2 = $helper->getModule()->mid(); |
|
73 | - /** @var \XoopsGroupPermHandler $grouppermHandler */ |
|
74 | - $grouppermHandler = xoops_getHandler('groupperm'); |
|
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); |
|
69 | + // default Permission Settings ---------------------- |
|
70 | + global $xoopsModule; |
|
71 | + $moduleId = $xoopsModule->getVar('mid'); |
|
72 | + // $moduleId2 = $helper->getModule()->mid(); |
|
73 | + /** @var \XoopsGroupPermHandler $grouppermHandler */ |
|
74 | + $grouppermHandler = xoops_getHandler('groupperm'); |
|
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); |
|
81 | 81 | |
82 | - // --- CREATE FOLDERS --------------- |
|
83 | - if (count($configurator->uploadFolders) > 0) { |
|
84 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
85 | - foreach (array_keys($configurator->uploadFolders) as $i) { |
|
86 | - $utility::createFolder($configurator->uploadFolders[$i]); |
|
87 | - } |
|
88 | - } |
|
82 | + // --- CREATE FOLDERS --------------- |
|
83 | + if (count($configurator->uploadFolders) > 0) { |
|
84 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
85 | + foreach (array_keys($configurator->uploadFolders) as $i) { |
|
86 | + $utility::createFolder($configurator->uploadFolders[$i]); |
|
87 | + } |
|
88 | + } |
|
89 | 89 | |
90 | - // --- COPY blank.png FILES --------------- |
|
91 | - if (count($configurator->copyBlankFiles) > 0) { |
|
92 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
93 | - foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
94 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
95 | - $utility::copyFile($file, $dest); |
|
96 | - } |
|
97 | - } |
|
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%'"; |
|
100 | - $GLOBALS['xoopsDB']->queryF($sql); |
|
90 | + // --- COPY blank.png FILES --------------- |
|
91 | + if (count($configurator->copyBlankFiles) > 0) { |
|
92 | + $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
93 | + foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
94 | + $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
95 | + $utility::copyFile($file, $dest); |
|
96 | + } |
|
97 | + } |
|
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%'"; |
|
100 | + $GLOBALS['xoopsDB']->queryF($sql); |
|
101 | 101 | |
102 | - return true; |
|
102 | + return true; |
|
103 | 103 | } |
@@ -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 | } |
@@ -20,8 +20,8 @@ discard block |
||
20 | 20 | */ |
21 | 21 | function xoops_module_pre_uninstall_myiframe(\XoopsModule $module) |
22 | 22 | { |
23 | - // Do some synchronization |
|
24 | - return true; |
|
23 | + // Do some synchronization |
|
24 | + return true; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -32,32 +32,32 @@ discard block |
||
32 | 32 | */ |
33 | 33 | function xoops_module_uninstall_myiframe(\XoopsModule $module) |
34 | 34 | { |
35 | - // return true; |
|
35 | + // return true; |
|
36 | 36 | |
37 | - $moduleDirName = \basename(\dirname(__DIR__)); |
|
38 | - $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
39 | - /** @var Myiframe\Helper $helper */ |
|
40 | - $helper = Myiframe\Helper::getInstance(); |
|
37 | + $moduleDirName = \basename(\dirname(__DIR__)); |
|
38 | + $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
|
39 | + /** @var Myiframe\Helper $helper */ |
|
40 | + $helper = Myiframe\Helper::getInstance(); |
|
41 | 41 | |
42 | - /** @var Myiframe\Utility $utility */ |
|
43 | - $utility = new Utility(); |
|
42 | + /** @var Myiframe\Utility $utility */ |
|
43 | + $utility = new Utility(); |
|
44 | 44 | |
45 | - $success = true; |
|
46 | - $helper->loadLanguage('admin'); |
|
45 | + $success = true; |
|
46 | + $helper->loadLanguage('admin'); |
|
47 | 47 | |
48 | - // Rename uploads folder to BAK and add date to name |
|
49 | - $uploadDirectory = $GLOBALS['xoops']->path("uploads/$moduleDirName"); |
|
50 | - $dirInfo = new \SplFileInfo($uploadDirectory); |
|
51 | - if ($dirInfo->isDir()) { |
|
52 | - // The directory exists so rename it |
|
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)); |
|
56 | - $success = false; |
|
57 | - } |
|
58 | - } |
|
59 | - unset($dirInfo); |
|
60 | - /* |
|
48 | + // Rename uploads folder to BAK and add date to name |
|
49 | + $uploadDirectory = $GLOBALS['xoops']->path("uploads/$moduleDirName"); |
|
50 | + $dirInfo = new \SplFileInfo($uploadDirectory); |
|
51 | + if ($dirInfo->isDir()) { |
|
52 | + // The directory exists so rename it |
|
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)); |
|
56 | + $success = false; |
|
57 | + } |
|
58 | + } |
|
59 | + unset($dirInfo); |
|
60 | + /* |
|
61 | 61 | //------------ START ---------------- |
62 | 62 | //------------------------------------------------------------------ |
63 | 63 | // Remove xsitemap.xml from XOOPS root folder if it exists |
@@ -71,6 +71,6 @@ discard block |
||
71 | 71 | // return $success && $delOk; // use this if you're using this routine |
72 | 72 | */ |
73 | 73 | |
74 | - return $success; |
|
75 | - //------------ END ---------------- |
|
74 | + return $success; |
|
75 | + //------------ END ---------------- |
|
76 | 76 | } |