|
@@ -29,7 +29,7 @@ discard block |
|
|
block discarded – undo |
|
29
|
29
|
function xoops_module_pre_install_contact(XoopsModule $module) |
|
30
|
30
|
{ |
|
31
|
31
|
$moduleDirName = basename(dirname(__DIR__)); |
|
32
|
|
- $classUtility = ucfirst($moduleDirName) . 'Utility'; |
|
|
32
|
+ $classUtility = ucfirst($moduleDirName).'Utility'; |
|
33
|
33
|
if (!class_exists($classUtility)) { |
|
34
|
34
|
xoops_load('utility', $moduleDirName); |
|
35
|
35
|
} |
|
@@ -43,9 +43,9 @@ discard block |
|
|
block discarded – undo |
|
43
|
43
|
return false; |
|
44
|
44
|
} |
|
45
|
45
|
|
|
46
|
|
- $mod_tables =& $module->getInfo('tables'); |
|
|
46
|
+ $mod_tables = & $module->getInfo('tables'); |
|
47
|
47
|
foreach ($mod_tables as $table) { |
|
48
|
|
- $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS ' . $GLOBALS['xoopsDB']->prefix($table) . ';'); |
|
|
48
|
+ $GLOBALS['xoopsDB']->queryF('DROP TABLE IF EXISTS '.$GLOBALS['xoopsDB']->prefix($table).';'); |
|
49
|
49
|
} |
|
50
|
50
|
|
|
51
|
51
|
return true; |
|
@@ -60,8 +60,8 @@ discard block |
|
|
block discarded – undo |
|
60
|
60
|
*/ |
|
61
|
61
|
function xoops_module_install_contact(XoopsModule $module) |
|
62
|
62
|
{ |
|
63
|
|
- require_once __DIR__ . '/../../../mainfile.php'; |
|
64
|
|
- require_once __DIR__ . '/../include/config.php'; |
|
|
63
|
+ require_once __DIR__.'/../../../mainfile.php'; |
|
|
64
|
+ require_once __DIR__.'/../include/config.php'; |
|
65
|
65
|
|
|
66
|
66
|
$moduleDirName = basename(dirname(__DIR__)); |
|
67
|
67
|
|
|
@@ -75,7 +75,7 @@ discard block |
|
|
block discarded – undo |
|
75
|
75
|
$moduleHelper->loadLanguage('modinfo'); |
|
76
|
76
|
|
|
77
|
77
|
$configurator = new ContactConfigurator(); |
|
78
|
|
- $classUtility = ucfirst($moduleDirName) . 'Utility'; |
|
|
78
|
+ $classUtility = ucfirst($moduleDirName).'Utility'; |
|
79
|
79
|
if (!class_exists($classUtility)) { |
|
80
|
80
|
xoops_load('utility', $moduleDirName); |
|
81
|
81
|
} |
|
@@ -86,11 +86,11 @@ discard block |
|
|
block discarded – undo |
|
86
|
86
|
$moduleId2 = $moduleHelper->getModule()->mid(); |
|
87
|
87
|
$gpermHandler = xoops_getHandler('groupperm'); |
|
88
|
88
|
// access rights ------------------------------------------ |
|
89
|
|
- $gpermHandler->addRight($moduleDirName . '_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
90
|
|
- $gpermHandler->addRight($moduleDirName . '_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
91
|
|
- $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
92
|
|
- $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
93
|
|
- $gpermHandler->addRight($moduleDirName . '_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
|
89
|
+ $gpermHandler->addRight($moduleDirName.'_approve', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
|
90
|
+ $gpermHandler->addRight($moduleDirName.'_submit', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
|
91
|
+ $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ADMIN, $moduleId); |
|
|
92
|
+ $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_USERS, $moduleId); |
|
|
93
|
+ $gpermHandler->addRight($moduleDirName.'_view', 1, XOOPS_GROUP_ANONYMOUS, $moduleId); |
|
94
|
94
|
|
|
95
|
95
|
// --- CREATE FOLDERS --------------- |
|
96
|
96
|
if (count($configurator->uploadFolders) > 0) { |
|
@@ -102,14 +102,14 @@ discard block |
|
|
block discarded – undo |
|
102
|
102
|
|
|
103
|
103
|
// --- COPY blank.png FILES --------------- |
|
104
|
104
|
if (count($configurator->blankFiles) > 0) { |
|
105
|
|
- $file = __DIR__ . '/../assets/images/blank.png'; |
|
|
105
|
+ $file = __DIR__.'/../assets/images/blank.png'; |
|
106
|
106
|
foreach (array_keys($configurator->blankFiles) as $i) { |
|
107
|
|
- $dest = $configurator->blankFiles[$i] . '/blank.png'; |
|
|
107
|
+ $dest = $configurator->blankFiles[$i].'/blank.png'; |
|
108
|
108
|
$classUtility::copyFile($file, $dest); |
|
109
|
109
|
} |
|
110
|
110
|
} |
|
111
|
111
|
//delete .html entries from the tpl table |
|
112
|
|
- $sql = 'DELETE FROM ' . $GLOBALS['xoopsDB']->prefix('tplfile') . " WHERE `tpl_module` = '" . $xoopsModule->getVar('dirname', 'n') . "' AND `tpl_file` LIKE '%.html%'"; |
|
|
112
|
+ $sql = 'DELETE FROM '.$GLOBALS['xoopsDB']->prefix('tplfile')." WHERE `tpl_module` = '".$xoopsModule->getVar('dirname', 'n')."' AND `tpl_file` LIKE '%.html%'"; |
|
113
|
113
|
$GLOBALS['xoopsDB']->queryF($sql); |
|
114
|
114
|
|
|
115
|
115
|
return true; |