@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | 22 | |
23 | -include dirname(__DIR__, 2) . '/mainfile.php'; |
|
24 | -include __DIR__ . '/include/common.php'; |
|
23 | +include dirname(__DIR__, 2).'/mainfile.php'; |
|
24 | +include __DIR__.'/include/common.php'; |
|
25 | 25 | $moduleDirName = \basename(__DIR__); |
26 | 26 | // Breadcrumbs |
27 | 27 | $xoBreadcrumbs = []; |
28 | -$xoBreadcrumbs[] = ['title' => _MA_WGGITHUB_TITLE, 'link' => WGGITHUB_URL . '/']; |
|
28 | +$xoBreadcrumbs[] = ['title' => _MA_WGGITHUB_TITLE, 'link' => WGGITHUB_URL.'/']; |
|
29 | 29 | // Get instance of module |
30 | 30 | $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
31 | 31 | $settingsHandler = $helper->getHandler('Settings'); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | // |
39 | 39 | $myts = MyTextSanitizer::getInstance(); |
40 | 40 | // Default Css Style |
41 | -$style = WGGITHUB_URL . '/assets/css/style.css'; |
|
41 | +$style = WGGITHUB_URL.'/assets/css/style.css'; |
|
42 | 42 | // Smarty Default |
43 | 43 | $sysPathIcon16 = $GLOBALS['xoopsModule']->getInfo('sysicons16'); |
44 | 44 | $sysPathIcon32 = $GLOBALS['xoopsModule']->getInfo('sysicons32'); |
@@ -5,18 +5,18 @@ |
||
5 | 5 | $pathIcon16 = \Xmf\Module\Admin::iconUrl('', 16); |
6 | 6 | $moduleDirName = \basename(\dirname(__DIR__)); |
7 | 7 | |
8 | - return (object)[ |
|
9 | - 'name' => \mb_strtoupper($moduleDirName) . ' IconConfigurator', |
|
8 | + return (object) [ |
|
9 | + 'name' => \mb_strtoupper($moduleDirName).' IconConfigurator', |
|
10 | 10 | 'icons' => [ |
11 | - 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
|
12 | - 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
|
13 | - 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
|
14 | - 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
|
15 | - 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
|
16 | - 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
|
17 | - 'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
|
18 | - '0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
|
19 | - '1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
|
11 | + 'edit' => "<img src='".$pathIcon16."/edit.png' alt="._EDIT."' align='middle'>", |
|
12 | + 'delete' => "<img src='".$pathIcon16."/delete.png' alt='"._DELETE."' align='middle'>", |
|
13 | + 'clone' => "<img src='".$pathIcon16."/editcopy.png' alt='"._CLONE."' align='middle'>", |
|
14 | + 'preview' => "<img src='".$pathIcon16."/view.png' alt='"._PREVIEW."' align='middle'>", |
|
15 | + 'print' => "<img src='".$pathIcon16."/printer.png' alt='"._CLONE."' align='middle'>", |
|
16 | + 'pdf' => "<img src='".$pathIcon16."/pdf.png' alt='"._CLONE."' align='middle'>", |
|
17 | + 'add' => "<img src='".$pathIcon16."/add.png' alt='"._ADD."' align='middle'>", |
|
18 | + '0' => "<img src='".$pathIcon16."/0.png' alt='".0."' align='middle'>", |
|
19 | + '1' => "<img src='".$pathIcon16."/1.png' alt='".1."' align='middle'>", |
|
20 | 20 | ], |
21 | 21 | ]; |
22 | 22 | } |
@@ -5,20 +5,20 @@ |
||
5 | 5 | $moduleDirName = \basename(\dirname(__DIR__)); |
6 | 6 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
7 | 7 | |
8 | - return (object)[ |
|
9 | - 'name' => \mb_strtoupper($moduleDirName) . ' PathConfigurator', |
|
8 | + return (object) [ |
|
9 | + 'name' => \mb_strtoupper($moduleDirName).' PathConfigurator', |
|
10 | 10 | 'paths' => [ |
11 | 11 | 'dirname' => $moduleDirName, |
12 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
13 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
14 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
15 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
16 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
12 | + 'admin' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName.'/admin', |
|
13 | + 'modPath' => XOOPS_ROOT_PATH.'/modules/'.$moduleDirName, |
|
14 | + 'modUrl' => XOOPS_URL.'/modules/'.$moduleDirName, |
|
15 | + 'uploadPath' => XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
16 | + 'uploadUrl' => XOOPS_UPLOAD_URL.'/'.$moduleDirName, |
|
17 | 17 | ], |
18 | 18 | 'uploadFolders' => [ |
19 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
20 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/category', |
|
21 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/screenshots', |
|
19 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName, |
|
20 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/category', |
|
21 | + XOOPS_UPLOAD_PATH.'/'.$moduleDirName.'/screenshots', |
|
22 | 22 | //XOOPS_UPLOAD_PATH . '/flags' |
23 | 23 | ], |
24 | 24 | ]; |
@@ -4,12 +4,12 @@ discard block |
||
4 | 4 | * @see http://www.php-fig.org/psr/psr-4/examples/ |
5 | 5 | */ |
6 | 6 | spl_autoload_register( |
7 | - static function ($class) { |
|
7 | + static function($class) { |
|
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 = __DIR__ . '/../class/'; |
|
12 | + $baseDir = __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 (\file_exists($file)) { |
@@ -28,6 +28,6 @@ |
||
28 | 28 | */ |
29 | 29 | public static function eventCoreIncludeCommonEnd($args) |
30 | 30 | { |
31 | - include __DIR__ . '/autoloader.php'; |
|
31 | + include __DIR__.'/autoloader.php'; |
|
32 | 32 | } |
33 | 33 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | use XoopsModules\Wggithub; |
25 | 25 | use XoopsModules\Wggithub\Constants; |
26 | 26 | |
27 | -require __DIR__ . '/header.php'; |
|
27 | +require __DIR__.'/header.php'; |
|
28 | 28 | |
29 | 29 | // Template Index |
30 | 30 | $templateMain = 'wggithub_admin_permissions.tpl'; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $op = Request::getCmd('op', 'global'); |
34 | 34 | |
35 | 35 | // Get Form |
36 | -include_once XOOPS_ROOT_PATH . '/class/xoopsform/grouppermform.php'; |
|
36 | +include_once XOOPS_ROOT_PATH.'/class/xoopsform/grouppermform.php'; |
|
37 | 37 | \xoops_load('XoopsFormLoader'); |
38 | 38 | |
39 | 39 | $formTitle = \_AM_WGGITHUB_PERMISSIONS_GLOBAL; |
@@ -61,4 +61,4 @@ discard block |
||
61 | 61 | exit(); |
62 | 62 | } |
63 | 63 | |
64 | -require __DIR__ . '/footer.php'; |
|
64 | +require __DIR__.'/footer.php'; |
@@ -24,8 +24,8 @@ discard block |
||
24 | 24 | Utility |
25 | 25 | }; |
26 | 26 | |
27 | -require_once dirname(__DIR__, 3) . '/include/cp_header.php'; |
|
28 | -require \dirname(__DIR__) . '/preloads/autoloader.php'; |
|
27 | +require_once dirname(__DIR__, 3).'/include/cp_header.php'; |
|
28 | +require \dirname(__DIR__).'/preloads/autoloader.php'; |
|
29 | 29 | |
30 | 30 | $op = \Xmf\Request::getCmd('op', ''); |
31 | 31 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | loadSampleData(); |
46 | 46 | } else { |
47 | 47 | xoops_cp_header(); |
48 | - xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', \sprintf(\constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA_OK')), \constant('CO_' . $moduleDirNameUpper . '_' . 'CONFIRM'), true); |
|
48 | + xoops_confirm(['ok' => 1, 'op' => 'load'], 'index.php', \sprintf(\constant('CO_'.$moduleDirNameUpper.'_'.'ADD_SAMPLEDATA_OK')), \constant('CO_'.$moduleDirNameUpper.'_'.'CONFIRM'), true); |
|
49 | 49 | xoops_cp_footer(); |
50 | 50 | } |
51 | 51 | break; |
@@ -68,20 +68,20 @@ discard block |
||
68 | 68 | $tables = Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); |
69 | 69 | |
70 | 70 | $language = 'english/'; |
71 | - if (\is_dir(__DIR__ . '/' . $xoopsConfig['language'])) { |
|
72 | - $language = $xoopsConfig['language'] . '/'; |
|
71 | + if (\is_dir(__DIR__.'/'.$xoopsConfig['language'])) { |
|
72 | + $language = $xoopsConfig['language'].'/'; |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | // load module tables |
76 | 76 | foreach ($tables as $table) { |
77 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
77 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
78 | 78 | TableLoad::truncateTable($table); |
79 | 79 | TableLoad::loadTableFromArray($table, $tabledata); |
80 | 80 | } |
81 | 81 | |
82 | 82 | // load permissions |
83 | 83 | $table = 'group_permission'; |
84 | - $tabledata = Yaml::readWrapped($language . $table . '.yml'); |
|
84 | + $tabledata = Yaml::readWrapped($language.$table.'.yml'); |
|
85 | 85 | $mid = Helper::getHelper($moduleDirName)->getModule()->getVar('mid'); |
86 | 86 | loadTableFromArrayWithReplace($table, $tabledata, 'gperm_modid', $mid); |
87 | 87 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $utility::rcopy($src, $dest); |
95 | 95 | } |
96 | 96 | } |
97 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAMPLEDATA_SUCCESS')); |
|
97 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAMPLEDATA_SUCCESS')); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | function saveSampleData() |
@@ -108,23 +108,23 @@ discard block |
||
108 | 108 | |
109 | 109 | $tables = Helper::getHelper($moduleDirName)->getModule()->getInfo('tables'); |
110 | 110 | |
111 | - $languageFolder = __DIR__ . '/' . $xoopsConfig['language']; |
|
112 | - if (!\file_exists($languageFolder . '/')) { |
|
113 | - Utility::createFolder($languageFolder . '/'); |
|
111 | + $languageFolder = __DIR__.'/'.$xoopsConfig['language']; |
|
112 | + if (!\file_exists($languageFolder.'/')) { |
|
113 | + Utility::createFolder($languageFolder.'/'); |
|
114 | 114 | } |
115 | - $exportFolder = $languageFolder . '/Exports-' . date('Y-m-d-H-i-s') . '/'; |
|
115 | + $exportFolder = $languageFolder.'/Exports-'.date('Y-m-d-H-i-s').'/'; |
|
116 | 116 | Utility::createFolder($exportFolder); |
117 | 117 | |
118 | 118 | // save module tables |
119 | 119 | foreach ($tables as $table) { |
120 | - TableLoad::saveTableToYamlFile($table, $exportFolder . $table . '.yml'); |
|
120 | + TableLoad::saveTableToYamlFile($table, $exportFolder.$table.'.yml'); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | // save permissions |
124 | 124 | $criteria = new \CriteriaCompo(); |
125 | 125 | $criteria->add(new \Criteria('gperm_modid', Helper::getHelper($moduleDirName)->getModule()->getVar('mid'))); |
126 | 126 | $skipColumns[] = 'gperm_id'; |
127 | - TableLoad::saveTableToYamlFile('group_permission', $exportFolder . 'group_permission.yml', $criteria, $skipColumns); |
|
127 | + TableLoad::saveTableToYamlFile('group_permission', $exportFolder.'group_permission.yml', $criteria, $skipColumns); |
|
128 | 128 | unset($criteria); |
129 | 129 | |
130 | 130 | // --- COPY test folder files --------------- |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | Utility::rcopy($src, $dest); |
136 | 136 | } |
137 | 137 | } |
138 | - \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA_SUCCESS')); |
|
138 | + \redirect_header('../admin/index.php', 1, \constant('CO_'.$moduleDirNameUpper.'_'.'SAVE_SAMPLEDATA_SUCCESS')); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | function exportSchema() |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | // |
151 | 151 | // \redirect_header('../admin/index.php', 1, \constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_SUCCESS')); |
152 | 152 | } catch (\Exception $e) { |
153 | - exit(\constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA_ERROR')); |
|
153 | + exit(\constant('CO_'.$moduleDirNameUpper.'_'.'EXPORT_SCHEMA_ERROR')); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | } |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
174 | 174 | $prefixedTable = $db->prefix($table); |
175 | 175 | $count = 0; |
176 | - $sql = 'DELETE FROM ' . $prefixedTable . ' WHERE `' . $search . '`=' . $db->quote($replace); |
|
176 | + $sql = 'DELETE FROM '.$prefixedTable.' WHERE `'.$search.'`='.$db->quote($replace); |
|
177 | 177 | $db->queryF($sql); |
178 | 178 | foreach ($data as $row) { |
179 | - $insertInto = 'INSERT INTO ' . $prefixedTable . ' ('; |
|
179 | + $insertInto = 'INSERT INTO '.$prefixedTable.' ('; |
|
180 | 180 | $valueClause = ' VALUES ('; |
181 | 181 | $first = true; |
182 | 182 | foreach ($row as $column => $value) { |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $valueClause .= $db->quote($value); |
194 | 194 | } |
195 | 195 | } |
196 | - $sql = $insertInto . ') ' . $valueClause . ')'; |
|
196 | + $sql = $insertInto.') '.$valueClause.')'; |
|
197 | 197 | $result = $db->queryF($sql); |
198 | 198 | if (false !== $result) { |
199 | 199 | ++$count; |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $readmesObj->setVar('rm_content', $readme['content']); |
171 | 171 | $readmesObj->setVar('rm_encoding', $readme['encoding']); |
172 | 172 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
173 | - $readmesObj->setVar('rm_datecreated',time()); |
|
173 | + $readmesObj->setVar('rm_datecreated', time()); |
|
174 | 174 | $readmesObj->setVar('rm_submitter', $submitter); |
175 | 175 | // Insert Data |
176 | 176 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $readmesObj->setVar('rm_content', $readme['content']); |
241 | 241 | $readmesObj->setVar('rm_encoding', $readme['encoding']); |
242 | 242 | $readmesObj->setVar('rm_downloadurl', $readme['download_url']); |
243 | - $readmesObj->setVar('rm_datecreated',time()); |
|
243 | + $readmesObj->setVar('rm_datecreated', time()); |
|
244 | 244 | $readmesObj->setVar('rm_submitter', $submitter); |
245 | 245 | // Insert Data |
246 | 246 | if (!$readmesHandler->insert($readmesObj)) { |
@@ -278,10 +278,10 @@ discard block |
||
278 | 278 | public function updateRepoReadme() |
279 | 279 | { |
280 | 280 | // update repo_readme |
281 | - $sql = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . ' INNER JOIN ' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
|
282 | - $sql .= ' ON ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_id = ' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes') . '.rm_repoid '; |
|
283 | - $sql .= 'SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_repositories') . '.repo_readme = 1 '; |
|
284 | - $sql .= 'WHERE (((' . $GLOBALS['xoopsDB']->prefix('wggithub_readmes') . '.rm_id)>0));'; |
|
281 | + $sql = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').' INNER JOIN '.$GLOBALS['xoopsDB']->prefix('wggithub_readmes'); |
|
282 | + $sql .= ' ON '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_id = '.$GLOBALS['xoopsDB']->prefix('wggithub_readmes').'.rm_repoid '; |
|
283 | + $sql .= 'SET '.$GLOBALS['xoopsDB']->prefix('wggithub_repositories').'.repo_readme = 1 '; |
|
284 | + $sql .= 'WHERE ((('.$GLOBALS['xoopsDB']->prefix('wggithub_readmes').'.rm_id)>0));'; |
|
285 | 285 | $GLOBALS['xoopsDB']->queryF($sql); |
286 | 286 | |
287 | 287 | return true; |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public function setPrimarySetting($setId) |
150 | 150 | { |
151 | - $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
151 | + $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
152 | 152 | $settingsObj = null; |
153 | 153 | $settingsHandler = $helper->getHandler('Settings'); |
154 | 154 | if (isset($setId)) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | } |
159 | 159 | |
160 | 160 | // reset all |
161 | - $strSQL = 'UPDATE ' . $GLOBALS['xoopsDB']->prefix('wggithub_settings') . ' SET ' . $GLOBALS['xoopsDB']->prefix('wggithub_settings') . '.set_primary = 0'; |
|
161 | + $strSQL = 'UPDATE '.$GLOBALS['xoopsDB']->prefix('wggithub_settings').' SET '.$GLOBALS['xoopsDB']->prefix('wggithub_settings').'.set_primary = 0'; |
|
162 | 162 | $GLOBALS['xoopsDB']->queryF($strSQL); |
163 | 163 | // Set Vars |
164 | 164 | $settingsObj->setVar('set_primary', 1); |