@@ -37,10 +37,10 @@ discard block |
||
| 37 | 37 | 'license_url' => 'http://www.gnu.org/licenses/gpl-3.0.en.html', |
| 38 | 38 | 'help' => 'page=help', |
| 39 | 39 | 'release_info' => 'release_info', |
| 40 | - 'release_file' => XOOPS_URL . '/modules/wggithub/docs/release_info file', |
|
| 40 | + 'release_file' => XOOPS_URL.'/modules/wggithub/docs/release_info file', |
|
| 41 | 41 | 'release_date' => '2021/01/13', |
| 42 | 42 | 'manual' => 'link to manual file', |
| 43 | - 'manual_file' => XOOPS_URL . '/modules/wggithub/docs/install.txt', |
|
| 43 | + 'manual_file' => XOOPS_URL.'/modules/wggithub/docs/install.txt', |
|
| 44 | 44 | 'min_php' => '7.2', |
| 45 | 45 | 'min_xoops' => '2.5.11', |
| 46 | 46 | 'min_admin' => '1.2', |
@@ -279,8 +279,8 @@ discard block |
||
| 279 | 279 | // Make Sample button visible? |
| 280 | 280 | $modversion['config'][] = [ |
| 281 | 281 | 'name' => 'displaySampleButton', |
| 282 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
|
| 283 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
|
| 282 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', |
|
| 283 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', |
|
| 284 | 284 | 'formtype' => 'yesno', |
| 285 | 285 | 'valuetype' => 'int', |
| 286 | 286 | 'default' => 1, |
@@ -28,15 +28,15 @@ discard block |
||
| 28 | 28 | Github\GithubClient |
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | -require __DIR__ . '/header.php'; |
|
| 31 | +require __DIR__.'/header.php'; |
|
| 32 | 32 | $GLOBALS['xoopsOption']['template_main'] = 'wggithub_index.tpl'; |
| 33 | -include_once \XOOPS_ROOT_PATH . '/header.php'; |
|
| 33 | +include_once \XOOPS_ROOT_PATH.'/header.php'; |
|
| 34 | 34 | |
| 35 | 35 | // Permissions |
| 36 | 36 | $permGlobalView = $permissionsHandler->getPermGlobalView(); |
| 37 | 37 | if (!$permGlobalView) {
|
| 38 | 38 | $GLOBALS['xoopsTpl']->assign('error', _NOPERM);
|
| 39 | - require __DIR__ . '/footer.php'; |
|
| 39 | + require __DIR__.'/footer.php'; |
|
| 40 | 40 | } |
| 41 | 41 | $permGlobalRead = $permissionsHandler->getPermGlobalRead(); |
| 42 | 42 | $permReadmeUpdate = $permissionsHandler->getPermReadmeUpdate(); |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | // Define Stylesheet |
| 52 | 52 | $GLOBALS['xoTheme']->addStylesheet($style, null); |
| 53 | -$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL . '/assets/css/tabs.css', null); |
|
| 53 | +$GLOBALS['xoTheme']->addStylesheet(WGGITHUB_URL.'/assets/css/tabs.css', null); |
|
| 54 | 54 | $keywords = []; |
| 55 | 55 | // |
| 56 | 56 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL);
|
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | unset($crLogs); |
| 117 | 117 | |
| 118 | - $menu = Request::getInt('menu', 0);
|
|
| 118 | + $menu = Request::getInt('menu', 0);
|
|
| 119 | 119 | |
| 120 | 120 | $crDirectories = new \CriteriaCompo(); |
| 121 | 121 | $crDirectories->add(new \Criteria('dir_online', 1));
|
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | foreach (\array_keys($directoriesAll) as $i) {
|
| 131 | 131 | $directories[$i] = $directoriesAll[$i]->getValuesDirectories(); |
| 132 | 132 | $dirName = $directoriesAll[$i]->getVar('dir_name');
|
| 133 | - $dirFilterRelease = (bool)$directoriesAll[$i]->getVar('dir_filterrelease');
|
|
| 133 | + $dirFilterRelease = (bool) $directoriesAll[$i]->getVar('dir_filterrelease');
|
|
| 134 | 134 | $repos = []; |
| 135 | 135 | $crRepositories = new \CriteriaCompo(); |
| 136 | 136 | //first block/parentheses |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $crRepo2->add(new Criteria('repo_status', Constants::STATUS_UPTODATE), 'OR');
|
| 144 | 144 | $crRepositories->add($crRepo2); |
| 145 | 145 | //third |
| 146 | - $autoApproved = (int)$helper->getConfig('autoapproved');
|
|
| 146 | + $autoApproved = (int) $helper->getConfig('autoapproved');
|
|
| 147 | 147 | if (!$autoApproved) {
|
| 148 | 148 | //third |
| 149 | 149 | $crRepo3 = new CriteriaCompo(); |
@@ -222,9 +222,9 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | $directories[$i]['repos'] = $repos; |
| 224 | 224 | $directories[$i]['previousRepos'] = $dirStart[$i] > 0; |
| 225 | - $directories[$i]['previousOp'] = '&dirId=' . $i . '&start=' . ($dirStart[$i] - $dirLimit[$i]) . '&limit=' . $dirLimit[$i] . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 225 | + $directories[$i]['previousOp'] = '&dirId='.$i.'&start='.($dirStart[$i] - $dirLimit[$i]).'&limit='.$dirLimit[$i].'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 226 | 226 | $directories[$i]['nextRepos'] = ($repositoriesCount - $dirStart[$i]) > $dirLimit[$i]; |
| 227 | - $directories[$i]['nextOp'] = '&dirId=' . $i . '&start=' . ($dirStart[$i] + $dirLimit[$i]) . '&limit=' . $dirLimit[$i] . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 227 | + $directories[$i]['nextOp'] = '&dirId='.$i.'&start='.($dirStart[$i] + $dirLimit[$i]).'&limit='.$dirLimit[$i].'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 228 | 228 | $GLOBALS['xoopsTpl']->assign('menu', $menu);
|
| 229 | 229 | $GLOBALS['xoopsTpl']->assign('directories', $directories);
|
| 230 | 230 | } |
@@ -241,10 +241,10 @@ discard block |
||
| 241 | 241 | // Permissions |
| 242 | 242 | if (!$permGlobalRead) {
|
| 243 | 243 | $GLOBALS['xoopsTpl']->assign('error', \_NOPERM);
|
| 244 | - require __DIR__ . '/footer.php'; |
|
| 244 | + require __DIR__.'/footer.php'; |
|
| 245 | 245 | } |
| 246 | 246 | $dirName = Request::getString('dir_name', '');
|
| 247 | - $redir = 'index.php?op=list_afterupdate&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 247 | + $redir = 'index.php?op=list_afterupdate&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 248 | 248 | $githubClient = GithubClient::getInstance(); |
| 249 | 249 | $result = $githubClient->executeUpdate($dirName); |
| 250 | 250 | if ($result) {
|
@@ -258,12 +258,12 @@ discard block |
||
| 258 | 258 | // Permissions |
| 259 | 259 | if (!$permReadmeUpdate) {
|
| 260 | 260 | $GLOBALS['xoopsTpl']->assign('error', \_NOPERM);
|
| 261 | - require __DIR__ . '/footer.php'; |
|
| 261 | + require __DIR__.'/footer.php'; |
|
| 262 | 262 | } |
| 263 | 263 | $repoId = Request::getInt('repo_id', 0);
|
| 264 | 264 | $repoUser = Request::getString('repo_user', 'none');
|
| 265 | 265 | $repoName = Request::getString('repo_name', 'none');
|
| 266 | - $redir = 'index.php?op=list_afterupdate&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
| 266 | + $redir = 'index.php?op=list_afterupdate&release='.$filterRelease.'&sortby='.$filterSortby; |
|
| 267 | 267 | $result = $helper->getHandler('Readmes')->updateReadmes($repoId, $repoUser, $repoName);
|
| 268 | 268 | if ($result) {
|
| 269 | 269 | \redirect_header($redir, 2, \_MA_WGGITHUB_READGH_SUCCESS); |
@@ -277,11 +277,11 @@ discard block |
||
| 277 | 277 | // Breadcrumbs |
| 278 | 278 | $xoBreadcrumbs[] = ['title' => \_MA_WGGITHUB_INDEX]; |
| 279 | 279 | // Keywords |
| 280 | -wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords));
|
|
| 280 | +wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords));
|
|
| 281 | 281 | unset($keywords); |
| 282 | 282 | // Description |
| 283 | 283 | wggithubMetaDescription(\_MA_WGGITHUB_INDEX_DESC); |
| 284 | 284 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/index.php');
|
| 285 | 285 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL);
|
| 286 | 286 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL);
|
| 287 | -require __DIR__ . '/footer.php'; |
|
| 287 | +require __DIR__.'/footer.php'; |
|
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | $ret = wggithub_check_db($module); |
| 40 | 40 | |
| 41 | 41 | //check upload directory |
| 42 | - include_once __DIR__ . '/install.php'; |
|
| 42 | + include_once __DIR__.'/install.php'; |
|
| 43 | 43 | $ret = xoops_module_install_wggithub($module); |
| 44 | 44 | |
| 45 | 45 | $errors = $module->getErrors(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | {
|
| 62 | 62 | global $xoopsDB; |
| 63 | 63 | $result = $xoopsDB->query( |
| 64 | - 'SELECT t1.tpl_id FROM ' . $xoopsDB->prefix('tplfile') . ' t1, ' . $xoopsDB->prefix('tplfile') . ' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id'
|
|
| 64 | + 'SELECT t1.tpl_id FROM '.$xoopsDB->prefix('tplfile').' t1, '.$xoopsDB->prefix('tplfile').' t2 WHERE t1.tpl_refid = t2.tpl_refid AND t1.tpl_module = t2.tpl_module AND t1.tpl_tplset=t2.tpl_tplset AND t1.tpl_file = t2.tpl_file AND t1.tpl_type = t2.tpl_type AND t1.tpl_id > t2.tpl_id'
|
|
| 65 | 65 | ); |
| 66 | 66 | $tplids = []; |
| 67 | 67 | while (false !== (list($tplid) = $xoopsDB->fetchRow($result))) {
|
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | if (\count($tplids) > 0) {
|
| 71 | 71 | $tplfileHandler = \xoops_getHandler('tplfile');
|
| 72 | - $duplicate_files = $tplfileHandler->getObjects(new \Criteria('tpl_id', '(' . \implode(',', $tplids) . ')', 'IN'));
|
|
| 72 | + $duplicate_files = $tplfileHandler->getObjects(new \Criteria('tpl_id', '('.\implode(',', $tplids).')', 'IN'));
|
|
| 73 | 73 | |
| 74 | 74 | if (\count($duplicate_files) > 0) {
|
| 75 | 75 | foreach (\array_keys($duplicate_files) as $i) {
|
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | - $sql = 'SHOW INDEX FROM ' . $xoopsDB->prefix('tplfile') . " WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
|
|
| 80 | + $sql = 'SHOW INDEX FROM '.$xoopsDB->prefix('tplfile')." WHERE KEY_NAME = 'tpl_refid_module_set_file_type'";
|
|
| 81 | 81 | if (!$result = $xoopsDB->queryF($sql)) {
|
| 82 | - xoops_error($xoopsDB->error() . '<br>' . $sql); |
|
| 82 | + xoops_error($xoopsDB->error().'<br>'.$sql); |
|
| 83 | 83 | |
| 84 | 84 | return false; |
| 85 | 85 | } |
@@ -92,9 +92,9 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | return true; |
| 94 | 94 | } |
| 95 | - $sql = 'ALTER TABLE ' . $xoopsDB->prefix('tplfile') . ' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )';
|
|
| 95 | + $sql = 'ALTER TABLE '.$xoopsDB->prefix('tplfile').' ADD UNIQUE tpl_refid_module_set_file_type ( tpl_refid, tpl_module, tpl_tplset, tpl_file, tpl_type )';
|
|
| 96 | 96 | if (!$result = $xoopsDB->queryF($sql)) {
|
| 97 | - xoops_error($xoopsDB->error() . '<br>' . $sql); |
|
| 97 | + xoops_error($xoopsDB->error().'<br>'.$sql); |
|
| 98 | 98 | $module->setErrors("'tpl_refid_module_set_file_type' unique index is not added to 'tplfile' table. Warning: do not use XOOPS until you add this unique index.");
|
| 99 | 99 | |
| 100 | 100 | return false; |
@@ -118,12 +118,12 @@ discard block |
||
| 118 | 118 | // update table (add new field) |
| 119 | 119 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories');
|
| 120 | 120 | $field = 'repo_release'; |
| 121 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 121 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 122 | 122 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 123 | 123 | if (!$numRows) {
|
| 124 | 124 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 125 | 125 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 126 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 126 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 127 | 127 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 128 | 128 | $ret = false; |
| 129 | 129 | } |
@@ -132,12 +132,12 @@ discard block |
||
| 132 | 132 | // update table (add new field) |
| 133 | 133 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories');
|
| 134 | 134 | $field = 'repo_prerelease'; |
| 135 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 135 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 136 | 136 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 137 | 137 | if (!$numRows) {
|
| 138 | 138 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 139 | 139 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 140 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 140 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 141 | 141 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 142 | 142 | $ret = false; |
| 143 | 143 | } |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | // update table (add new field) |
| 146 | 146 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories');
|
| 147 | 147 | $field = 'repo_readme'; |
| 148 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 148 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 149 | 149 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 150 | 150 | if (!$numRows) {
|
| 151 | 151 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_htmlurl`;"; |
| 152 | 152 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 153 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 153 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 154 | 154 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 155 | 155 | $ret = false; |
| 156 | 156 | } |
@@ -159,12 +159,12 @@ discard block |
||
| 159 | 159 | // update table (add new field) |
| 160 | 160 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories');
|
| 161 | 161 | $field = 'dir_filterrelease'; |
| 162 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 162 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 163 | 163 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 164 | 164 | if (!$numRows) {
|
| 165 | 165 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `dir_online`;"; |
| 166 | 166 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 167 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 167 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 168 | 168 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 169 | 169 | $ret = false; |
| 170 | 170 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | PRIMARY KEY (`log_id`) |
| 187 | 187 | ) ENGINE=InnoDB;"; |
| 188 | 188 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 189 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 189 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 190 | 190 | $module->setErrors("Error when creating table '$table'.");
|
| 191 | 191 | $ret = false; |
| 192 | 192 | } |
@@ -195,12 +195,12 @@ discard block |
||
| 195 | 195 | // update table (add new field) |
| 196 | 196 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories');
|
| 197 | 197 | $field = 'dir_content'; |
| 198 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 198 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 199 | 199 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 200 | 200 | if (!$numRows) {
|
| 201 | 201 | $sql = "ALTER TABLE `$table` ADD `$field` INT(10) NOT NULL DEFAULT '0' AFTER `dir_type`;"; |
| 202 | 202 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 203 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 203 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 204 | 204 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 205 | 205 | $ret = false; |
| 206 | 206 | } |
@@ -209,12 +209,12 @@ discard block |
||
| 209 | 209 | // update table (add new field) |
| 210 | 210 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories');
|
| 211 | 211 | $field = 'dir_descr'; |
| 212 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 212 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 213 | 213 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 214 | 214 | if (!$numRows) {
|
| 215 | 215 | $sql = "ALTER TABLE `$table` ADD `$field` TEXT NOT NULL AFTER `dir_type`;"; |
| 216 | 216 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 217 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 217 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 218 | 218 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 219 | 219 | $ret = false; |
| 220 | 220 | } |
@@ -223,12 +223,12 @@ discard block |
||
| 223 | 223 | // update table (add new field) |
| 224 | 224 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_readmes');
|
| 225 | 225 | $field = 'rm_baseurl'; |
| 226 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 226 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 227 | 227 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 228 | 228 | if (!$numRows) {
|
| 229 | 229 | $sql = "ALTER TABLE `$table` ADD `$field` VARCHAR(255) NOT NULL DEFAULT '' AFTER `rm_downloadurl`;"; |
| 230 | 230 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 231 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 231 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 232 | 232 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 233 | 233 | $ret = false; |
| 234 | 234 | } |
@@ -237,12 +237,12 @@ discard block |
||
| 237 | 237 | // update table (add new field) |
| 238 | 238 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_directories');
|
| 239 | 239 | $field = 'dir_weight'; |
| 240 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 240 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 241 | 241 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 242 | 242 | if (!$numRows) {
|
| 243 | 243 | $sql = "ALTER TABLE `$table` ADD `$field` INT(10) NOT NULL DEFAULT '0' AFTER `dir_filterrelease`;"; |
| 244 | 244 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 245 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 245 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 246 | 246 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 247 | 247 | $ret = false; |
| 248 | 248 | } |
@@ -251,12 +251,12 @@ discard block |
||
| 251 | 251 | // update table (add new field) |
| 252 | 252 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories');
|
| 253 | 253 | $field = 'repo_approved'; |
| 254 | - $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `' . $table . "` LIKE '" . $field . "'");
|
|
| 254 | + $check = $GLOBALS['xoopsDB']->queryF('SHOW COLUMNS FROM `'.$table."` LIKE '".$field."'");
|
|
| 255 | 255 | $numRows = $GLOBALS['xoopsDB']->getRowsNum($check); |
| 256 | 256 | if (!$numRows) {
|
| 257 | 257 | $sql = "ALTER TABLE `$table` ADD `$field` INT(1) NOT NULL DEFAULT '0' AFTER `repo_release`;"; |
| 258 | 258 | if (!$result = $GLOBALS['xoopsDB']->queryF($sql)) {
|
| 259 | - xoops_error($GLOBALS['xoopsDB']->error() . '<br>' . $sql); |
|
| 259 | + xoops_error($GLOBALS['xoopsDB']->error().'<br>'.$sql); |
|
| 260 | 260 | $module->setErrors("Error when adding '$field' to table '$table'.");
|
| 261 | 261 | $ret = false; |
| 262 | 262 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | use XoopsModules\Wggithub\Constants; |
| 26 | 26 | use XoopsModules\Wggithub\Common; |
| 27 | 27 | |
| 28 | -require __DIR__ . '/header.php'; |
|
| 28 | +require __DIR__.'/header.php'; |
|
| 29 | 29 | // It recovered the value of argument op in URL$ |
| 30 | 30 | $op = Request::getCmd('op', 'list');
|
| 31 | 31 | $repoId = Request::getInt('repo_id');
|
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | $adminObject->addItemButton(_AM_WGGITHUB_ADD_REPOSITORY, 'repositories.php?op=new', 'add'); |
| 46 | 46 | $GLOBALS['xoopsTpl']->assign('buttons', $adminObject->displayButton('left'));
|
| 47 | 47 | |
| 48 | - $autoApproved = (int)$helper->getConfig('autoapproved');
|
|
| 48 | + $autoApproved = (int) $helper->getConfig('autoapproved');
|
|
| 49 | 49 | $GLOBALS['xoopsTpl']->assign('autoApproved', !$autoApproved);
|
| 50 | - $GLOBALS['xoopsTpl']->assign('wggithub_icons_url_16', WGGITHUB_ICONS_URL . '/16');
|
|
| 50 | + $GLOBALS['xoopsTpl']->assign('wggithub_icons_url_16', WGGITHUB_ICONS_URL.'/16');
|
|
| 51 | 51 | |
| 52 | 52 | $filterValue = ''; |
| 53 | 53 | $filterStatus = 0; |
@@ -84,8 +84,8 @@ discard block |
||
| 84 | 84 | } |
| 85 | 85 | // Display Navigation |
| 86 | 86 | if ($repositoriesCount > $limit) {
|
| 87 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
| 88 | - $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
| 87 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
| 88 | + $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
| 89 | 89 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4));
|
| 90 | 90 | } |
| 91 | 91 | } else {
|
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | $repositoriesObj->setVar('repo_submitter', Request::getInt('repo_submitter', 0));
|
| 137 | 137 | // Insert Data |
| 138 | 138 | if ($repositoriesHandler->insert($repositoriesObj)) {
|
| 139 | - \redirect_header('repositories.php?op=list&start=' . $start . '&limit=' . $limit, 2, _AM_WGGITHUB_FORM_OK);
|
|
| 139 | + \redirect_header('repositories.php?op=list&start='.$start.'&limit='.$limit, 2, _AM_WGGITHUB_FORM_OK);
|
|
| 140 | 140 | } |
| 141 | 141 | // Get Form |
| 142 | 142 | $GLOBALS['xoopsTpl']->assign('error', $repositoriesObj->getHtmlErrors());
|
@@ -183,9 +183,9 @@ discard block |
||
| 183 | 183 | $repositoriesObj->setVar(Request::getString('field'), Request::getInt('value', 0));
|
| 184 | 184 | // Insert Data |
| 185 | 185 | if ($repositoriesHandler->insert($repositoriesObj, true)) {
|
| 186 | - \redirect_header('repositories.php?op=list&start=' . $start . '&limit=' . $limit, 2, _AM_WGGITHUB_FORM_OK);
|
|
| 186 | + \redirect_header('repositories.php?op=list&start='.$start.'&limit='.$limit, 2, _AM_WGGITHUB_FORM_OK);
|
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | break; |
| 190 | 190 | } |
| 191 | -require __DIR__ . '/footer.php'; |
|
| 191 | +require __DIR__.'/footer.php'; |
|
@@ -164,7 +164,7 @@ |
||
| 164 | 164 | $ret['readme'] = $this->getVar('repo_readme');
|
| 165 | 165 | $ret['prerelease'] = $this->getVar('repo_prerelease');
|
| 166 | 166 | $ret['release'] = $this->getVar('repo_release');
|
| 167 | - $ret['approved'] = (int)$this->getVar('repo_approved') > 0 ? _YES : _NO;
|
|
| 167 | + $ret['approved'] = (int) $this->getVar('repo_approved') > 0 ? _YES : _NO;
|
|
| 168 | 168 | $status = $this->getVar('repo_status');
|
| 169 | 169 | $ret['status'] = $status; |
| 170 | 170 | switch ($status) {
|