@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
16 | 16 | |
17 | 17 | if (!@require_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
18 | - return null; |
|
18 | + return null; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | // Specify the addons to skip for the module |
@@ -28,41 +28,41 @@ discard block |
||
28 | 28 | */ |
29 | 29 | class ModuleTransferHandler extends TransferHandler |
30 | 30 | { |
31 | - /** |
|
32 | - * ModuleTransferHandler constructor. |
|
33 | - */ |
|
34 | - public function __construct() |
|
35 | - { |
|
36 | - parent::__construct(); |
|
37 | - } |
|
31 | + /** |
|
32 | + * ModuleTransferHandler constructor. |
|
33 | + */ |
|
34 | + public function __construct() |
|
35 | + { |
|
36 | + parent::__construct(); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * Get valid addon list |
|
41 | - * |
|
42 | - * @param array $skip Addons to skip |
|
43 | - * @param boolean $sort To sort the list upon 'level' |
|
44 | - * return array $list |
|
45 | - */ |
|
46 | - public function &getList($skip = [], $sort = true) |
|
47 | - { |
|
48 | - $list = parent::getList($skip, $sort); |
|
39 | + /** |
|
40 | + * Get valid addon list |
|
41 | + * |
|
42 | + * @param array $skip Addons to skip |
|
43 | + * @param boolean $sort To sort the list upon 'level' |
|
44 | + * return array $list |
|
45 | + */ |
|
46 | + public function &getList($skip = [], $sort = true) |
|
47 | + { |
|
48 | + $list = parent::getList($skip, $sort); |
|
49 | 49 | |
50 | - return $list; |
|
51 | - } |
|
50 | + return $list; |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * If need change config of an item |
|
55 | - * 1 parent::load_item |
|
56 | - * 2 $this->config |
|
57 | - * 3 $this->do_transfer |
|
58 | - * @param $item |
|
59 | - * @param $data |
|
60 | - * @return |
|
61 | - */ |
|
62 | - public function do_transfer($item, &$data) |
|
63 | - { |
|
64 | - $ret = parent::do_transfer($item, $data); |
|
53 | + /** |
|
54 | + * If need change config of an item |
|
55 | + * 1 parent::load_item |
|
56 | + * 2 $this->config |
|
57 | + * 3 $this->do_transfer |
|
58 | + * @param $item |
|
59 | + * @param $data |
|
60 | + * @return |
|
61 | + */ |
|
62 | + public function do_transfer($item, &$data) |
|
63 | + { |
|
64 | + $ret = parent::do_transfer($item, $data); |
|
65 | 65 | |
66 | - return $ret; |
|
67 | - } |
|
66 | + return $ret; |
|
67 | + } |
|
68 | 68 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
16 | 16 | |
17 | -if (!@require_once XOOPS_ROOT_PATH . '/Frameworks/transfer/transfer.php') { |
|
17 | +if (!@require_once XOOPS_ROOT_PATH.'/Frameworks/transfer/transfer.php') { |
|
18 | 18 | return null; |
19 | 19 | } |
20 | 20 |
@@ -28,20 +28,20 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function xoops_module_pre_install_planet(\XoopsModule $module) |
30 | 30 | { |
31 | - include __DIR__ . '/../preloads/autoloader.php'; |
|
32 | - /** @var \Utility $utility */ |
|
33 | - $utility = new \XoopsModules\Planet\Utility(); |
|
34 | - $xoopsSuccess = $utility::checkVerXoops($module); |
|
35 | - $phpSuccess = $utility::checkVerPhp($module); |
|
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 | - } |
|
43 | - |
|
44 | - return $xoopsSuccess && $phpSuccess; |
|
31 | + include __DIR__ . '/../preloads/autoloader.php'; |
|
32 | + /** @var \Utility $utility */ |
|
33 | + $utility = new \XoopsModules\Planet\Utility(); |
|
34 | + $xoopsSuccess = $utility::checkVerXoops($module); |
|
35 | + $phpSuccess = $utility::checkVerPhp($module); |
|
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 | + } |
|
43 | + |
|
44 | + return $xoopsSuccess && $phpSuccess; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -53,51 +53,51 @@ discard block |
||
53 | 53 | */ |
54 | 54 | function xoops_module_install_planet(\XoopsModule $module) |
55 | 55 | { |
56 | - require_once __DIR__ . '/../../../mainfile.php'; |
|
57 | - require_once __DIR__ . '/../include/config.php'; |
|
58 | - |
|
59 | - $moduleDirName = basename(dirname(__DIR__)); |
|
60 | - |
|
61 | - $helper = Planet\Helper::getInstance(); |
|
62 | - $utility = new Planet\Utility(); |
|
63 | - $configurator = new Planet\Configurator(); |
|
64 | - // Load language files |
|
65 | - $helper->loadLanguage('admin'); |
|
66 | - $helper->loadLanguage('modinfo'); |
|
67 | - |
|
68 | - // default Permission Settings ---------------------- |
|
69 | - global $xoopsModule; |
|
70 | - $moduleId = $xoopsModule->getVar('mid'); |
|
71 | - $moduleId2 = $helper->getModule()->mid(); |
|
72 | - $gpermHandler = xoops_getHandler('groupperm'); |
|
73 | - // access rights ------------------------------------------ |
|
74 | - $gpermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
75 | - $gpermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
76 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
78 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
79 | - |
|
80 | - // --- CREATE FOLDERS --------------- |
|
81 | - if (count($configurator->uploadFolders) > 0) { |
|
82 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
83 | - foreach (array_keys($configurator->uploadFolders) as $i) { |
|
84 | - $utilityClass::createFolder($configurator->uploadFolders[$i]); |
|
85 | - } |
|
86 | - } |
|
87 | - |
|
88 | - // --- COPY blank.png FILES --------------- |
|
89 | - if (count($configurator->copyBlankFiles) > 0) { |
|
90 | - $file = __DIR__ . '/../assets/images/blank.png'; |
|
91 | - foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
92 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
93 | - $utilityClass::copyFile($file, $dest); |
|
94 | - } |
|
95 | - } |
|
96 | - //delete .html entries from the tpl table |
|
97 | - $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
98 | - $xoopsDB->queryF($sql); |
|
99 | - |
|
100 | - return true; |
|
56 | + require_once __DIR__ . '/../../../mainfile.php'; |
|
57 | + require_once __DIR__ . '/../include/config.php'; |
|
58 | + |
|
59 | + $moduleDirName = basename(dirname(__DIR__)); |
|
60 | + |
|
61 | + $helper = Planet\Helper::getInstance(); |
|
62 | + $utility = new Planet\Utility(); |
|
63 | + $configurator = new Planet\Configurator(); |
|
64 | + // Load language files |
|
65 | + $helper->loadLanguage('admin'); |
|
66 | + $helper->loadLanguage('modinfo'); |
|
67 | + |
|
68 | + // default Permission Settings ---------------------- |
|
69 | + global $xoopsModule; |
|
70 | + $moduleId = $xoopsModule->getVar('mid'); |
|
71 | + $moduleId2 = $helper->getModule()->mid(); |
|
72 | + $gpermHandler = xoops_getHandler('groupperm'); |
|
73 | + // access rights ------------------------------------------ |
|
74 | + $gpermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
75 | + $gpermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
76 | + $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | + $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
78 | + $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
79 | + |
|
80 | + // --- CREATE FOLDERS --------------- |
|
81 | + if (count($configurator->uploadFolders) > 0) { |
|
82 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
83 | + foreach (array_keys($configurator->uploadFolders) as $i) { |
|
84 | + $utilityClass::createFolder($configurator->uploadFolders[$i]); |
|
85 | + } |
|
86 | + } |
|
87 | + |
|
88 | + // --- COPY blank.png FILES --------------- |
|
89 | + if (count($configurator->copyBlankFiles) > 0) { |
|
90 | + $file = __DIR__ . '/../assets/images/blank.png'; |
|
91 | + foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
92 | + $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
93 | + $utilityClass::copyFile($file, $dest); |
|
94 | + } |
|
95 | + } |
|
96 | + //delete .html entries from the tpl table |
|
97 | + $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
98 | + $xoopsDB->queryF($sql); |
|
99 | + |
|
100 | + return true; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | //====================================================== |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | //Creation du dossier "uploads" pour le module à la racine du site |
109 | 109 | $module_uploads = $GLOBALS['xoops']->path('uploads/randomquote'); |
110 | 110 | if (!is_dir($module_uploads)) { |
111 | - mkdir($module_uploads, 0777); |
|
111 | + mkdir($module_uploads, 0777); |
|
112 | 112 | } |
113 | 113 | chmod($module_uploads, 0777); |
114 | 114 | copy($indexFile, $GLOBALS['xoops']->path('uploads/randomquote/index.html')); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | //Creation du fichier citas dans uploads |
117 | 117 | $module_uploads = $GLOBALS['xoops']->path('uploads/randomquote/citas'); |
118 | 118 | if (!is_dir($module_uploads)) { |
119 | - mkdir($module_uploads, 0777); |
|
119 | + mkdir($module_uploads, 0777); |
|
120 | 120 | } |
121 | 121 | chmod($module_uploads, 0777); |
122 | 122 | copy($indexFile, $GLOBALS['xoops']->path('uploads/randomquote/citas/index.html')); |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function xoops_module_pre_install_planet(\XoopsModule $module) |
30 | 30 | { |
31 | - include __DIR__ . '/../preloads/autoloader.php'; |
|
31 | + include __DIR__.'/../preloads/autoloader.php'; |
|
32 | 32 | /** @var \Utility $utility */ |
33 | 33 | $utility = new \XoopsModules\Planet\Utility(); |
34 | 34 | $xoopsSuccess = $utility::checkVerXoops($module); |
35 | 35 | $phpSuccess = $utility::checkVerPhp($module); |
36 | 36 | |
37 | - if (false !== $xoopsSuccess && false !== $phpSuccess) { |
|
38 | - $moduleTables =& $module->getInfo('tables'); |
|
37 | + if (false !== $xoopsSuccess && false !== $phpSuccess) { |
|
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 | |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | */ |
54 | 54 | function xoops_module_install_planet(\XoopsModule $module) |
55 | 55 | { |
56 | - require_once __DIR__ . '/../../../mainfile.php'; |
|
57 | - require_once __DIR__ . '/../include/config.php'; |
|
56 | + require_once __DIR__.'/../../../mainfile.php'; |
|
57 | + require_once __DIR__.'/../include/config.php'; |
|
58 | 58 | |
59 | 59 | $moduleDirName = basename(dirname(__DIR__)); |
60 | 60 | |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | $moduleId2 = $helper->getModule()->mid(); |
72 | 72 | $gpermHandler = xoops_getHandler('groupperm'); |
73 | 73 | // access rights ------------------------------------------ |
74 | - $gpermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
75 | - $gpermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
76 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
78 | - $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
74 | + $gpermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
75 | + $gpermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
76 | + $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
77 | + $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
78 | + $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
79 | 79 | |
80 | 80 | // --- CREATE FOLDERS --------------- |
81 | - if (count($configurator->uploadFolders) > 0) { |
|
81 | + if (count($configurator->uploadFolders)>0) { |
|
82 | 82 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
83 | 83 | foreach (array_keys($configurator->uploadFolders) as $i) { |
84 | 84 | $utilityClass::createFolder($configurator->uploadFolders[$i]); |
@@ -86,15 +86,15 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | // --- COPY blank.png FILES --------------- |
89 | - if (count($configurator->copyBlankFiles) > 0) { |
|
90 | - $file = __DIR__ . '/../assets/images/blank.png'; |
|
89 | + if (count($configurator->copyBlankFiles)>0) { |
|
90 | + $file = __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 | $utilityClass::copyFile($file, $dest); |
94 | 94 | } |
95 | 95 | } |
96 | 96 | //delete .html entries from the tpl table |
97 | - $sql = 'DELETE FROM ' . $xoopsDB->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
97 | + $sql = 'DELETE FROM '.$xoopsDB->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'"; |
|
98 | 98 | $xoopsDB->queryF($sql); |
99 | 99 | |
100 | 100 | return true; |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
29 | 29 | |
30 | -include __DIR__ . '/vars.php'; |
|
30 | +include __DIR__.'/vars.php'; |
|
31 | 31 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
32 | 32 | |
33 | 33 | PlanetUtility::planetParseFunction(' |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | |
19 | 19 | function xoops_module_pre_uninstall_xxxx(\XoopsModule $module) |
20 | 20 | { |
21 | - // Do some synchronization |
|
22 | - return true; |
|
21 | + // Do some synchronization |
|
22 | + return true; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -33,36 +33,36 @@ discard block |
||
33 | 33 | { |
34 | 34 | // return true; |
35 | 35 | |
36 | - $moduleDirName = basename(dirname(__DIR__)); |
|
37 | - $xsitemapHelper = \Xmf\Module\Helper::getHelper($moduleDirName); |
|
36 | + $moduleDirName = basename(dirname(__DIR__)); |
|
37 | + $xsitemapHelper = \Xmf\Module\Helper::getHelper($moduleDirName); |
|
38 | 38 | |
39 | - /** @var XXXXXXUtility $utilityClass */ |
|
40 | - $utilityClass = ucfirst($moduleDirName) . 'Utility'; |
|
41 | - if (!class_exists($utilityClass)) { |
|
42 | - xoops_load('utility', $moduleDirName); |
|
43 | - } |
|
39 | + /** @var XXXXXXUtility $utilityClass */ |
|
40 | + $utilityClass = ucfirst($moduleDirName) . 'Utility'; |
|
41 | + if (!class_exists($utilityClass)) { |
|
42 | + xoops_load('utility', $moduleDirName); |
|
43 | + } |
|
44 | 44 | |
45 | - $success = true; |
|
46 | - $xsitemapHelper->loadLanguage('admin'); |
|
45 | + $success = true; |
|
46 | + $xsitemapHelper->loadLanguage('admin'); |
|
47 | 47 | |
48 | 48 | |
49 | - //------------------------------------------------------------------ |
|
50 | - // Remove uploads folder (and all subfolders) if they exist |
|
51 | - //------------------------------------------------------------------ |
|
49 | + //------------------------------------------------------------------ |
|
50 | + // Remove uploads folder (and all subfolders) if they exist |
|
51 | + //------------------------------------------------------------------ |
|
52 | 52 | |
53 | - $old_directories = [$GLOBALS['xoops']->path("uploads/{$moduleDirName}")]; |
|
54 | - foreach ($old_directories as $old_dir) { |
|
55 | - $dirInfo = new \SplFileInfo($old_dir); |
|
56 | - if ($dirInfo->isDir()) { |
|
57 | - // The directory exists so delete it |
|
58 | - if (false === $utilityClass::rrmdir($old_dir)) { |
|
59 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
60 | - $success = false; |
|
61 | - } |
|
62 | - } |
|
63 | - unset($dirInfo); |
|
64 | - } |
|
65 | - /* |
|
53 | + $old_directories = [$GLOBALS['xoops']->path("uploads/{$moduleDirName}")]; |
|
54 | + foreach ($old_directories as $old_dir) { |
|
55 | + $dirInfo = new \SplFileInfo($old_dir); |
|
56 | + if ($dirInfo->isDir()) { |
|
57 | + // The directory exists so delete it |
|
58 | + if (false === $utilityClass::rrmdir($old_dir)) { |
|
59 | + $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
60 | + $success = false; |
|
61 | + } |
|
62 | + } |
|
63 | + unset($dirInfo); |
|
64 | + } |
|
65 | + /* |
|
66 | 66 | //------------ START ---------------- |
67 | 67 | //------------------------------------------------------------------ |
68 | 68 | // Remove xsitemap.xml from XOOPS root folder if it exists |
@@ -76,6 +76,6 @@ discard block |
||
76 | 76 | // return $success && $delOk; // use this if you're using this routine |
77 | 77 | */ |
78 | 78 | |
79 | - return $success; |
|
80 | - //------------ END ---------------- |
|
79 | + return $success; |
|
80 | + //------------ END ---------------- |
|
81 | 81 | } |
@@ -34,10 +34,10 @@ discard block |
||
34 | 34 | // return true; |
35 | 35 | |
36 | 36 | $moduleDirName = basename(dirname(__DIR__)); |
37 | - $xsitemapHelper = \Xmf\Module\Helper::getHelper($moduleDirName); |
|
37 | + $xsitemapHelper = \Xmf\Module\Helper::getHelper($moduleDirName); |
|
38 | 38 | |
39 | 39 | /** @var XXXXXXUtility $utilityClass */ |
40 | - $utilityClass = ucfirst($moduleDirName) . 'Utility'; |
|
40 | + $utilityClass = ucfirst($moduleDirName).'Utility'; |
|
41 | 41 | if (!class_exists($utilityClass)) { |
42 | 42 | xoops_load('utility', $moduleDirName); |
43 | 43 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if ($dirInfo->isDir()) { |
57 | 57 | // The directory exists so delete it |
58 | 58 | if (false === $utilityClass::rrmdir($old_dir)) { |
59 | - $module->setErrors(sprintf(constant('CO_' . $moduleDirNameUpper . '_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
59 | + $module->setErrors(sprintf(constant('CO_'.$moduleDirNameUpper.'_ERROR_BAD_DEL_PATH'), $old_dir)); |
|
60 | 60 | $success = false; |
61 | 61 | } |
62 | 62 | } |
@@ -19,7 +19,7 @@ |
||
19 | 19 | |
20 | 20 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
21 | 21 | |
22 | -include __DIR__ . '/vars.php'; |
|
22 | +include __DIR__.'/vars.php'; |
|
23 | 23 | //mod_loadFunctions('', $GLOBALS['moddirname']); |
24 | 24 | |
25 | 25 | PlanetUtility::planetParseFunction(' |
@@ -43,28 +43,28 @@ |
||
43 | 43 | $categories_option = $categoryHandler->getList(); |
44 | 44 | natsort($categories_option); |
45 | 45 | if (count($categories_option)) { |
46 | - $cat_option_tray = new \XoopsFormElementTray(planet_constant('MD_CATEGORY'), '<br>'); |
|
47 | - $options = [0 => _NONE]; |
|
48 | - foreach ($categories_option as $id => $title) { |
|
49 | - $options[$id] = $title; |
|
50 | - } |
|
51 | - $cat_select = new \XoopsFormSelect('', 'categories', $categories, 3, true); |
|
52 | - $cat_select->addOptionArray($options); |
|
53 | - $cat_option_tray->addElement($cat_select); |
|
54 | - $form->addElement($cat_option_tray); |
|
46 | + $cat_option_tray = new \XoopsFormElementTray(planet_constant('MD_CATEGORY'), '<br>'); |
|
47 | + $options = [0 => _NONE]; |
|
48 | + foreach ($categories_option as $id => $title) { |
|
49 | + $options[$id] = $title; |
|
50 | + } |
|
51 | + $cat_select = new \XoopsFormSelect('', 'categories', $categories, 3, true); |
|
52 | + $cat_select->addOptionArray($options); |
|
53 | + $cat_option_tray->addElement($cat_select); |
|
54 | + $form->addElement($cat_option_tray); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /* For admin only */ |
58 | 58 | if (is_object($xoopsUser) && $xoopsUser->isAdmin()) { |
59 | - $status_option_tray = new \XoopsFormElementTray(planet_constant('MD_STATUS'), '<br>'); |
|
60 | - $status_select = new \XoopsFormSelect('', 'blog_status', $blog_obj->getVar('blog_status')); |
|
61 | - $status_select->addOptionArray([ |
|
62 | - '0' => planet_constant('MD_PENDING'), |
|
63 | - '1' => planet_constant('MD_ACTIVE'), |
|
64 | - '2' => planet_constant('MD_FEATURED') |
|
65 | - ]); |
|
66 | - $status_option_tray->addElement($status_select); |
|
67 | - $form->addElement($status_option_tray); |
|
59 | + $status_option_tray = new \XoopsFormElementTray(planet_constant('MD_STATUS'), '<br>'); |
|
60 | + $status_select = new \XoopsFormSelect('', 'blog_status', $blog_obj->getVar('blog_status')); |
|
61 | + $status_select->addOptionArray([ |
|
62 | + '0' => planet_constant('MD_PENDING'), |
|
63 | + '1' => planet_constant('MD_ACTIVE'), |
|
64 | + '2' => planet_constant('MD_FEATURED') |
|
65 | + ]); |
|
66 | + $status_option_tray->addElement($status_select); |
|
67 | + $form->addElement($status_option_tray); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $form->addElement(new \XoopsFormHidden('blog', $blog_id)); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | // ------------------------------------------------------------------------ // |
27 | 27 | // defined('XOOPS_ROOT_PATH') || die('Restricted access'); |
28 | 28 | |
29 | -require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
|
29 | +require_once XOOPS_ROOT_PATH.'/class/xoopsformloader.php'; |
|
30 | 30 | $categoryHandler = xoops_getModuleHandler('category', $GLOBALS['moddirname']); |
31 | 31 | |
32 | 32 | $form = new \XoopsThemeForm(_EDIT, 'formblog', xoops_getenv('PHP_SELF'), 'POST', true); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $butt_save = new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'); |
77 | 77 | $button_tray->addElement($butt_save); |
78 | 78 | $butt_cancel = new \XoopsFormButton('', 'cancel', _CANCEL, 'button'); |
79 | -$butt_cancel->setExtra("onclick='window.document.location=\"" . XOOPS_URL . '/modules/' . $GLOBALS['moddirname'] . '/index.php' . URL_DELIMITER . 'b' . (int)$blog_id . "\"'"); |
|
79 | +$butt_cancel->setExtra("onclick='window.document.location=\"".XOOPS_URL.'/modules/'.$GLOBALS['moddirname'].'/index.php'.URL_DELIMITER.'b'.(int) $blog_id."\"'"); |
|
80 | 80 | $button_tray->addElement($butt_cancel); |
81 | 81 | $form->addElement($button_tray); |
82 | 82 | $form->display(); |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | */ |
19 | 19 | |
20 | 20 | if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) |
21 | - || !$GLOBALS['xoopsUser']->IsAdmin() |
|
21 | + || !$GLOBALS['xoopsUser']->IsAdmin() |
|
22 | 22 | ) { |
23 | - exit('Restricted access' . PHP_EOL); |
|
23 | + exit('Restricted access' . PHP_EOL); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -30,9 +30,9 @@ discard block |
||
30 | 30 | */ |
31 | 31 | function tableExists($tablename) |
32 | 32 | { |
33 | - $result = $GLOBALS['xoopsDB']->queryF("SHOW TABLES LIKE '$tablename'"); |
|
33 | + $result = $GLOBALS['xoopsDB']->queryF("SHOW TABLES LIKE '$tablename'"); |
|
34 | 34 | |
35 | - return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0) ? true : false; |
|
35 | + return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0) ? true : false; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | */ |
45 | 45 | function xoops_module_pre_update_planet(\XoopsModule $module) |
46 | 46 | { |
47 | - $moduleDirName = basename(dirname(__DIR__)); |
|
48 | - /** @var Planet\Helper $helper */ |
|
49 | - /** @var Planet\Utility $utility */ |
|
50 | - $helper = Planet\Helper::getInstance(); |
|
51 | - $utility = new Planet\Utility(); |
|
52 | - |
|
53 | - $xoopsSuccess = $utility::checkVerXoops($module); |
|
54 | - $phpSuccess = $utility::checkVerPhp($module); |
|
55 | - return $xoopsSuccess && $phpSuccess; |
|
47 | + $moduleDirName = basename(dirname(__DIR__)); |
|
48 | + /** @var Planet\Helper $helper */ |
|
49 | + /** @var Planet\Utility $utility */ |
|
50 | + $helper = Planet\Helper::getInstance(); |
|
51 | + $utility = new Planet\Utility(); |
|
52 | + |
|
53 | + $xoopsSuccess = $utility::checkVerXoops($module); |
|
54 | + $phpSuccess = $utility::checkVerPhp($module); |
|
55 | + return $xoopsSuccess && $phpSuccess; |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -66,96 +66,96 @@ discard block |
||
66 | 66 | |
67 | 67 | function xoops_module_update_planet(\XoopsModule $module, $previousVersion = null) |
68 | 68 | { |
69 | - $moduleDirName = basename(dirname(__DIR__)); |
|
70 | - $capsDirName = strtoupper($moduleDirName); |
|
71 | - |
|
72 | - /** @var Planet\Helper $helper */ |
|
73 | - /** @var Planet\Utility $utility */ |
|
74 | - /** @var Planet\Configurator $configurator */ |
|
75 | - $helper = Planet\Helper::getInstance(); |
|
76 | - $utility = new Planet\Utility(); |
|
77 | - $configurator = new Planet\Configurator(); |
|
78 | - |
|
79 | - if ($previousVersion < 240) { |
|
80 | - |
|
81 | - //rename column EXAMPLE |
|
82 | - $tables = new Tables(); |
|
83 | - $table = 'planetx_categories'; |
|
84 | - $column = 'ordre'; |
|
85 | - $newName = 'order'; |
|
86 | - $attributes = "INT(5) NOT NULL DEFAULT '0'"; |
|
87 | - if ($tables->useTable($table)) { |
|
88 | - $tables->alterColumn($table, $column, $attributes, $newName); |
|
89 | - if (!$tables->executeQueue()) { |
|
90 | - echo '<br>' . _AM_XXXXX_UPGRADEFAILED0 . ' ' . $migrate->getLastError(); |
|
91 | - } |
|
92 | - } |
|
93 | - |
|
94 | - //delete old HTML templates |
|
95 | - if (count($configurator->templateFolders) > 0) { |
|
96 | - foreach ($configurator->templateFolders as $folder) { |
|
97 | - $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
98 | - if (is_dir($templateFolder)) { |
|
99 | - $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
|
100 | - foreach ($templateList as $k => $v) { |
|
101 | - $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
102 | - if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
|
103 | - if (file_exists($templateFolder . $v)) { |
|
104 | - unlink($templateFolder . $v); |
|
105 | - } |
|
106 | - } |
|
107 | - } |
|
108 | - } |
|
109 | - } |
|
110 | - } |
|
111 | - |
|
112 | - // --- DELETE OLD FILES --------------- |
|
113 | - if (count($configurator->oldFiles) > 0) { |
|
114 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
115 | - foreach (array_keys($configurator->oldFiles) as $i) { |
|
116 | - $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
117 | - if (is_file($tempFile)) { |
|
118 | - unlink($tempFile); |
|
119 | - } |
|
120 | - } |
|
121 | - } |
|
122 | - |
|
123 | - // --- DELETE OLD FOLDERS --------------- |
|
124 | - xoops_load('XoopsFile'); |
|
125 | - if (count($configurator->oldFolders) > 0) { |
|
126 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
127 | - foreach (array_keys($configurator->oldFolders) as $i) { |
|
128 | - $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
129 | - /* @var $folderHandler XoopsObjectHandler */ |
|
130 | - $folderHandler = XoopsFile::getHandler('folder', $tempFolder); |
|
131 | - $folderHandler->delete($tempFolder); |
|
132 | - } |
|
133 | - } |
|
134 | - |
|
135 | - // --- CREATE FOLDERS --------------- |
|
136 | - if (count($configurator->uploadFolders) > 0) { |
|
137 | - // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
138 | - foreach (array_keys($configurator->uploadFolders) as $i) { |
|
139 | - $utilityClass::createFolder($configurator->uploadFolders[$i]); |
|
140 | - } |
|
141 | - } |
|
142 | - |
|
143 | - // --- COPY blank.png FILES --------------- |
|
144 | - if (count($configurator->copyBlankFiles) > 0) { |
|
145 | - $file = __DIR__ . '/../assets/images/blank.png'; |
|
146 | - foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
147 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
148 | - $utilityClass::copyFile($file, $dest); |
|
149 | - } |
|
150 | - } |
|
151 | - |
|
152 | - //delete .html entries from the tpl table |
|
153 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\''; |
|
154 | - $GLOBALS['xoopsDB']->queryF($sql); |
|
155 | - |
|
156 | - /** @var XoopsGroupPermHandler $gpermHandler */ |
|
157 | - $gpermHandler = xoops_getHandler('groupperm'); |
|
158 | - return $gpermHandler->deleteByModule($module->getVar('mid'), 'item_read'); |
|
159 | - } |
|
160 | - return true; |
|
69 | + $moduleDirName = basename(dirname(__DIR__)); |
|
70 | + $capsDirName = strtoupper($moduleDirName); |
|
71 | + |
|
72 | + /** @var Planet\Helper $helper */ |
|
73 | + /** @var Planet\Utility $utility */ |
|
74 | + /** @var Planet\Configurator $configurator */ |
|
75 | + $helper = Planet\Helper::getInstance(); |
|
76 | + $utility = new Planet\Utility(); |
|
77 | + $configurator = new Planet\Configurator(); |
|
78 | + |
|
79 | + if ($previousVersion < 240) { |
|
80 | + |
|
81 | + //rename column EXAMPLE |
|
82 | + $tables = new Tables(); |
|
83 | + $table = 'planetx_categories'; |
|
84 | + $column = 'ordre'; |
|
85 | + $newName = 'order'; |
|
86 | + $attributes = "INT(5) NOT NULL DEFAULT '0'"; |
|
87 | + if ($tables->useTable($table)) { |
|
88 | + $tables->alterColumn($table, $column, $attributes, $newName); |
|
89 | + if (!$tables->executeQueue()) { |
|
90 | + echo '<br>' . _AM_XXXXX_UPGRADEFAILED0 . ' ' . $migrate->getLastError(); |
|
91 | + } |
|
92 | + } |
|
93 | + |
|
94 | + //delete old HTML templates |
|
95 | + if (count($configurator->templateFolders) > 0) { |
|
96 | + foreach ($configurator->templateFolders as $folder) { |
|
97 | + $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
98 | + if (is_dir($templateFolder)) { |
|
99 | + $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
|
100 | + foreach ($templateList as $k => $v) { |
|
101 | + $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
102 | + if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
|
103 | + if (file_exists($templateFolder . $v)) { |
|
104 | + unlink($templateFolder . $v); |
|
105 | + } |
|
106 | + } |
|
107 | + } |
|
108 | + } |
|
109 | + } |
|
110 | + } |
|
111 | + |
|
112 | + // --- DELETE OLD FILES --------------- |
|
113 | + if (count($configurator->oldFiles) > 0) { |
|
114 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
115 | + foreach (array_keys($configurator->oldFiles) as $i) { |
|
116 | + $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
117 | + if (is_file($tempFile)) { |
|
118 | + unlink($tempFile); |
|
119 | + } |
|
120 | + } |
|
121 | + } |
|
122 | + |
|
123 | + // --- DELETE OLD FOLDERS --------------- |
|
124 | + xoops_load('XoopsFile'); |
|
125 | + if (count($configurator->oldFolders) > 0) { |
|
126 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
127 | + foreach (array_keys($configurator->oldFolders) as $i) { |
|
128 | + $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
129 | + /* @var $folderHandler XoopsObjectHandler */ |
|
130 | + $folderHandler = XoopsFile::getHandler('folder', $tempFolder); |
|
131 | + $folderHandler->delete($tempFolder); |
|
132 | + } |
|
133 | + } |
|
134 | + |
|
135 | + // --- CREATE FOLDERS --------------- |
|
136 | + if (count($configurator->uploadFolders) > 0) { |
|
137 | + // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
|
138 | + foreach (array_keys($configurator->uploadFolders) as $i) { |
|
139 | + $utilityClass::createFolder($configurator->uploadFolders[$i]); |
|
140 | + } |
|
141 | + } |
|
142 | + |
|
143 | + // --- COPY blank.png FILES --------------- |
|
144 | + if (count($configurator->copyBlankFiles) > 0) { |
|
145 | + $file = __DIR__ . '/../assets/images/blank.png'; |
|
146 | + foreach (array_keys($configurator->copyBlankFiles) as $i) { |
|
147 | + $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
148 | + $utilityClass::copyFile($file, $dest); |
|
149 | + } |
|
150 | + } |
|
151 | + |
|
152 | + //delete .html entries from the tpl table |
|
153 | + $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\''; |
|
154 | + $GLOBALS['xoopsDB']->queryF($sql); |
|
155 | + |
|
156 | + /** @var XoopsGroupPermHandler $gpermHandler */ |
|
157 | + $gpermHandler = xoops_getHandler('groupperm'); |
|
158 | + return $gpermHandler->deleteByModule($module->getVar('mid'), 'item_read'); |
|
159 | + } |
|
160 | + return true; |
|
161 | 161 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | if ((!defined('XOOPS_ROOT_PATH')) || !($GLOBALS['xoopsUser'] instanceof \XoopsUser) |
21 | 21 | || !$GLOBALS['xoopsUser']->IsAdmin() |
22 | 22 | ) { |
23 | - exit('Restricted access' . PHP_EOL); |
|
23 | + exit('Restricted access'.PHP_EOL); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $result = $GLOBALS['xoopsDB']->queryF("SHOW TABLES LIKE '$tablename'"); |
34 | 34 | |
35 | - return ($GLOBALS['xoopsDB']->getRowsNum($result) > 0) ? true : false; |
|
35 | + return ($GLOBALS['xoopsDB']->getRowsNum($result)>0) ? true : false; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $utility = new Planet\Utility(); |
77 | 77 | $configurator = new Planet\Configurator(); |
78 | 78 | |
79 | - if ($previousVersion < 240) { |
|
79 | + if ($previousVersion<240) { |
|
80 | 80 | |
81 | 81 | //rename column EXAMPLE |
82 | 82 | $tables = new Tables(); |
@@ -87,21 +87,21 @@ discard block |
||
87 | 87 | if ($tables->useTable($table)) { |
88 | 88 | $tables->alterColumn($table, $column, $attributes, $newName); |
89 | 89 | if (!$tables->executeQueue()) { |
90 | - echo '<br>' . _AM_XXXXX_UPGRADEFAILED0 . ' ' . $migrate->getLastError(); |
|
90 | + echo '<br>'._AM_XXXXX_UPGRADEFAILED0.' '.$migrate->getLastError(); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | 94 | //delete old HTML templates |
95 | - if (count($configurator->templateFolders) > 0) { |
|
95 | + if (count($configurator->templateFolders)>0) { |
|
96 | 96 | foreach ($configurator->templateFolders as $folder) { |
97 | - $templateFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $folder); |
|
97 | + $templateFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$folder); |
|
98 | 98 | if (is_dir($templateFolder)) { |
99 | 99 | $templateList = array_diff(scandir($templateFolder, SCANDIR_SORT_NONE), ['..', '.']); |
100 | 100 | foreach ($templateList as $k => $v) { |
101 | - $fileInfo = new \SplFileInfo($templateFolder . $v); |
|
101 | + $fileInfo = new \SplFileInfo($templateFolder.$v); |
|
102 | 102 | if ('html' === $fileInfo->getExtension() && 'index.html' !== $fileInfo->getFilename()) { |
103 | - if (file_exists($templateFolder . $v)) { |
|
104 | - unlink($templateFolder . $v); |
|
103 | + if (file_exists($templateFolder.$v)) { |
|
104 | + unlink($templateFolder.$v); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | } |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | // --- DELETE OLD FILES --------------- |
113 | - if (count($configurator->oldFiles) > 0) { |
|
113 | + if (count($configurator->oldFiles)>0) { |
|
114 | 114 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
115 | 115 | foreach (array_keys($configurator->oldFiles) as $i) { |
116 | - $tempFile = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFiles[$i]); |
|
116 | + $tempFile = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFiles[$i]); |
|
117 | 117 | if (is_file($tempFile)) { |
118 | 118 | unlink($tempFile); |
119 | 119 | } |
@@ -122,10 +122,10 @@ discard block |
||
122 | 122 | |
123 | 123 | // --- DELETE OLD FOLDERS --------------- |
124 | 124 | xoops_load('XoopsFile'); |
125 | - if (count($configurator->oldFolders) > 0) { |
|
125 | + if (count($configurator->oldFolders)>0) { |
|
126 | 126 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
127 | 127 | foreach (array_keys($configurator->oldFolders) as $i) { |
128 | - $tempFolder = $GLOBALS['xoops']->path('modules/' . $moduleDirName . $configurator->oldFolders[$i]); |
|
128 | + $tempFolder = $GLOBALS['xoops']->path('modules/'.$moduleDirName.$configurator->oldFolders[$i]); |
|
129 | 129 | /* @var $folderHandler XoopsObjectHandler */ |
130 | 130 | $folderHandler = XoopsFile::getHandler('folder', $tempFolder); |
131 | 131 | $folderHandler->delete($tempFolder); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | // --- CREATE FOLDERS --------------- |
136 | - if (count($configurator->uploadFolders) > 0) { |
|
136 | + if (count($configurator->uploadFolders)>0) { |
|
137 | 137 | // foreach (array_keys($GLOBALS['uploadFolders']) as $i) { |
138 | 138 | foreach (array_keys($configurator->uploadFolders) as $i) { |
139 | 139 | $utilityClass::createFolder($configurator->uploadFolders[$i]); |
@@ -141,16 +141,16 @@ discard block |
||
141 | 141 | } |
142 | 142 | |
143 | 143 | // --- COPY blank.png FILES --------------- |
144 | - if (count($configurator->copyBlankFiles) > 0) { |
|
145 | - $file = __DIR__ . '/../assets/images/blank.png'; |
|
144 | + if (count($configurator->copyBlankFiles)>0) { |
|
145 | + $file = __DIR__.'/../assets/images/blank.png'; |
|
146 | 146 | foreach (array_keys($configurator->copyBlankFiles) as $i) { |
147 | - $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
|
147 | + $dest = $configurator->copyBlankFiles[$i].'/blank.png'; |
|
148 | 148 | $utilityClass::copyFile($file, $dest); |
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | 152 | //delete .html entries from the tpl table |
153 | - $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $module->getVar('dirname', 'n') . '\' AND `tpl_file` LIKE \'%.html%\''; |
|
153 | + $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$module->getVar('dirname', 'n').'\' AND `tpl_file` LIKE \'%.html%\''; |
|
154 | 154 | $GLOBALS['xoopsDB']->queryF($sql); |
155 | 155 | |
156 | 156 | /** @var XoopsGroupPermHandler $gpermHandler */ |