@@ -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 | $logId = Request::getInt('log_id'); |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | } |
59 | 59 | // Display Navigation |
60 | 60 | if ($logsCount > $limit) { |
61 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
62 | - $pagenav = new \XoopsPageNav($logsCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
61 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
62 | + $pagenav = new \XoopsPageNav($logsCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
63 | 63 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
64 | 64 | } |
65 | 65 | } else { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | $logsObj->setVar('log_submitter', Request::getInt('log_submitter', 0)); |
96 | 96 | // Insert Data |
97 | 97 | if ($logsHandler->insert($logsObj)) { |
98 | - \redirect_header('logs.php?op=list&start=' . $start . '&limit=' . $limit, 2, _AM_WGGITHUB_FORM_OK); |
|
98 | + \redirect_header('logs.php?op=list&start='.$start.'&limit='.$limit, 2, _AM_WGGITHUB_FORM_OK); |
|
99 | 99 | } |
100 | 100 | // Get Form |
101 | 101 | $GLOBALS['xoopsTpl']->assign('error', $logsObj->getHtmlErrors()); |
@@ -156,4 +156,4 @@ discard block |
||
156 | 156 | } |
157 | 157 | break; |
158 | 158 | } |
159 | -require __DIR__ . '/footer.php'; |
|
159 | +require __DIR__.'/footer.php'; |
@@ -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 | $setId = Request::getInt('set_id'); |
@@ -59,8 +59,8 @@ discard block |
||
59 | 59 | } |
60 | 60 | // Display Navigation |
61 | 61 | if ($settingsCount > $limit) { |
62 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
63 | - $pagenav = new \XoopsPageNav($settingsCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
62 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
63 | + $pagenav = new \XoopsPageNav($settingsCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
64 | 64 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
65 | 65 | } |
66 | 66 | } else { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $setId = $setId > 0 ? $setId : $newSetId; |
103 | 103 | $settingsHandler->setPrimarySetting($setId); |
104 | 104 | } |
105 | - \redirect_header('settings.php?op=list&start=' . $start . '&limit=' . $limit, 2, _AM_WGGITHUB_FORM_OK); |
|
105 | + \redirect_header('settings.php?op=list&start='.$start.'&limit='.$limit, 2, _AM_WGGITHUB_FORM_OK); |
|
106 | 106 | } |
107 | 107 | // Get Form |
108 | 108 | $GLOBALS['xoopsTpl']->assign('error', $settingsObj->getHtmlErrors()); |
@@ -144,4 +144,4 @@ discard block |
||
144 | 144 | } |
145 | 145 | break; |
146 | 146 | } |
147 | -require __DIR__ . '/footer.php'; |
|
147 | +require __DIR__.'/footer.php'; |
@@ -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 | $rmId = Request::getInt('rm_id'); |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | } |
58 | 58 | // Display Navigation |
59 | 59 | if ($readmesCount > $limit) { |
60 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
61 | - $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
60 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
61 | + $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
62 | 62 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
63 | 63 | } |
64 | 64 | } else { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $readmesObj->setVar('rm_submitter', Request::getInt('rm_submitter', 0)); |
98 | 98 | // Insert Data |
99 | 99 | if ($readmesHandler->insert($readmesObj)) { |
100 | - \redirect_header('readmes.php?op=list&start=' . $start . '&limit=' . $limit, 2, _AM_WGGITHUB_FORM_OK); |
|
100 | + \redirect_header('readmes.php?op=list&start='.$start.'&limit='.$limit, 2, _AM_WGGITHUB_FORM_OK); |
|
101 | 101 | } |
102 | 102 | // Get Form |
103 | 103 | $GLOBALS['xoopsTpl']->assign('error', $readmesObj->getHtmlErrors()); |
@@ -139,4 +139,4 @@ discard block |
||
139 | 139 | } |
140 | 140 | break; |
141 | 141 | } |
142 | -require __DIR__ . '/footer.php'; |
|
142 | +require __DIR__.'/footer.php'; |
@@ -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); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | foreach (\array_keys($directoriesAll) as $i) { |
128 | 128 | $directories[$i] = $directoriesAll[$i]->getValuesDirectories(); |
129 | 129 | $dirName = $directoriesAll[$i]->getVar('dir_name'); |
130 | - $dirFilterRelease = (bool)$directoriesAll[$i]->getVar('dir_filterrelease'); |
|
130 | + $dirFilterRelease = (bool) $directoriesAll[$i]->getVar('dir_filterrelease'); |
|
131 | 131 | $repos = []; |
132 | 132 | $crRepositories = new \CriteriaCompo(); |
133 | 133 | //first block/parentheses |
@@ -202,9 +202,9 @@ discard block |
||
202 | 202 | } |
203 | 203 | $directories[$i]['repos'] = $repos; |
204 | 204 | $directories[$i]['previousRepos'] = $start > 0; |
205 | - $directories[$i]['previousOp'] = '&start=' . ($start - $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
205 | + $directories[$i]['previousOp'] = '&start='.($start - $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
206 | 206 | $directories[$i]['nextRepos'] = ($repositoriesCount - $start) > $limit; |
207 | - $directories[$i]['nextOp'] = '&start=' . ($start + $limit) . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
207 | + $directories[$i]['nextOp'] = '&start='.($start + $limit).'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
208 | 208 | $GLOBALS['xoopsTpl']->assign('start', $start); |
209 | 209 | $GLOBALS['xoopsTpl']->assign('limit', $limit); |
210 | 210 | $GLOBALS['xoopsTpl']->assign('menu', $menu); |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | unset($crDirectories, $directories); |
215 | 215 | // Display Navigation |
216 | 216 | if ($directoriesCount > $limit) { |
217 | - require_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
218 | - $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
217 | + require_once \XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
218 | + $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
219 | 219 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
220 | 220 | } |
221 | 221 | $GLOBALS['xoopsTpl']->assign('lang_thereare', \sprintf(\_MA_WGGITHUB_INDEX_THEREARE, $directoriesCount)); |
@@ -228,12 +228,12 @@ discard block |
||
228 | 228 | // Permissions |
229 | 229 | if (!$permGlobalRead) { |
230 | 230 | $GLOBALS['xoopsTpl']->assign('error', \_NOPERM); |
231 | - require __DIR__ . '/footer.php'; |
|
231 | + require __DIR__.'/footer.php'; |
|
232 | 232 | } |
233 | 233 | $dirName = Request::getString('dir_name', ''); |
234 | 234 | $githubClient = GithubClient::getInstance(); |
235 | 235 | $result = $githubClient->executeUpdate($dirName); |
236 | - $redir = 'index.php?op=list_afterupdate&start=' . $start . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
236 | + $redir = 'index.php?op=list_afterupdate&start='.$start.'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
237 | 237 | if ($result) { |
238 | 238 | \redirect_header($redir, 2, \_MA_WGGITHUB_READGH_SUCCESS); |
239 | 239 | } else { |
@@ -245,13 +245,13 @@ discard block |
||
245 | 245 | // Permissions |
246 | 246 | if (!$permReadmeUpdate) { |
247 | 247 | $GLOBALS['xoopsTpl']->assign('error', \_NOPERM); |
248 | - require __DIR__ . '/footer.php'; |
|
248 | + require __DIR__.'/footer.php'; |
|
249 | 249 | } |
250 | 250 | $repoId = Request::getInt('repo_id', 0); |
251 | 251 | $repoUser = Request::getString('repo_user', 'none'); |
252 | 252 | $repoName = Request::getString('repo_name', 'none'); |
253 | 253 | $result = $helper->getHandler('Readmes')->updateReadmes($repoId, $repoUser, $repoName); |
254 | - $redir = 'index.php?op=list_afterupdate&start=' . $start . '&limit=' . $limit . '&release=' . $filterRelease . '&sortby=' . $filterSortby; |
|
254 | + $redir = 'index.php?op=list_afterupdate&start='.$start.'&limit='.$limit.'&release='.$filterRelease.'&sortby='.$filterSortby; |
|
255 | 255 | if ($result) { |
256 | 256 | \redirect_header($redir, 2, \_MA_WGGITHUB_READGH_SUCCESS); |
257 | 257 | } else { |
@@ -264,11 +264,11 @@ discard block |
||
264 | 264 | // Breadcrumbs |
265 | 265 | $xoBreadcrumbs[] = ['title' => \_MA_WGGITHUB_INDEX]; |
266 | 266 | // Keywords |
267 | -wggithubMetaKeywords($helper->getConfig('keywords') . ', ' . \implode(',', $keywords)); |
|
267 | +wggithubMetaKeywords($helper->getConfig('keywords').', '.\implode(',', $keywords)); |
|
268 | 268 | unset($keywords); |
269 | 269 | // Description |
270 | 270 | wggithubMetaDescription(\_MA_WGGITHUB_INDEX_DESC); |
271 | 271 | $GLOBALS['xoopsTpl']->assign('xoops_mpageurl', WGGITHUB_URL.'/index.php'); |
272 | 272 | $GLOBALS['xoopsTpl']->assign('xoops_icons32_url', XOOPS_ICONS32_URL); |
273 | 273 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
274 | -require __DIR__ . '/footer.php'; |
|
274 | +require __DIR__.'/footer.php'; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | public function testMilo($url) { |
83 | 83 | $api = new Github\Api; |
84 | - $response = $api->get(static::BASE_URL . $url); |
|
84 | + $response = $api->get(static::BASE_URL.$url); |
|
85 | 85 | $data = $api->decode($response); |
86 | 86 | |
87 | 87 | return $data; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | $token = new Github\OAuth\Token('{myKey}', 'bearer', ['repo', 'user', 'public_repo']); |
94 | 94 | $api->setToken($token); |
95 | - $response = $api->get(static::BASE_URL . $url); |
|
95 | + $response = $api->get(static::BASE_URL.$url); |
|
96 | 96 | |
97 | 97 | $data = $api->decode($response); |
98 | 98 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getUserRepositories($username, $per_page = 100, $page = 1) |
119 | 119 | { |
120 | - $url = static::BASE_URL . 'users/' . \rawurlencode($username) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
120 | + $url = static::BASE_URL.'users/'.\rawurlencode($username).'/repos?per_page='.$per_page.'&page='.$page; |
|
121 | 121 | |
122 | 122 | return $this->_get($url); |
123 | 123 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function getOrgRepositories($org, $per_page = 100, $page = 1) |
134 | 134 | { |
135 | - $url = static::BASE_URL . 'orgs/' . \rawurlencode($org) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
135 | + $url = static::BASE_URL.'orgs/'.\rawurlencode($org).'/repos?per_page='.$per_page.'&page='.$page; |
|
136 | 136 | |
137 | 137 | return $this->_get($url); |
138 | 138 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function getReadme($username, $repository) |
148 | 148 | { |
149 | - $url = static::BASE_URL . 'repos/' . \rawurlencode($username) . '/' . \rawurlencode($repository) . '/readme'; |
|
149 | + $url = static::BASE_URL.'repos/'.\rawurlencode($username).'/'.\rawurlencode($repository).'/readme'; |
|
150 | 150 | |
151 | 151 | return $this->_get($url, true); |
152 | 152 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function getReleases($username, $repository) |
162 | 162 | { |
163 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases'; |
|
163 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases'; |
|
164 | 164 | |
165 | 165 | return $this->_get($url, true); |
166 | 166 | } |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | public function getLatestRelease($username, $repository, $prerelease = false) |
177 | 177 | { |
178 | 178 | if ($prerelease) { |
179 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases'; |
|
179 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases'; |
|
180 | 180 | } else { |
181 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases/latest'; |
|
181 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases/latest'; |
|
182 | 182 | } |
183 | 183 | $result = $this->_get($url); |
184 | 184 | |
@@ -223,14 +223,14 @@ discard block |
||
223 | 223 | } else { |
224 | 224 | $error = true; |
225 | 225 | $errMsg = $response->getContent(); |
226 | - $logsHandler->updateTableLogs(Constants::LOG_TYPE_ERROR, $errMsg, 'ERROR ' . $code); |
|
226 | + $logsHandler->updateTableLogs(Constants::LOG_TYPE_ERROR, $errMsg, 'ERROR '.$code); |
|
227 | 227 | } |
228 | 228 | } |
229 | 229 | if ($error) { |
230 | 230 | //catch common errors |
231 | 231 | switch ($code) { |
232 | 232 | case 401: |
233 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_401 . '"'); |
|
233 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_401.'"'); |
|
234 | 234 | break; |
235 | 235 | case 403: |
236 | 236 | /* |
@@ -238,21 +238,21 @@ discard block |
||
238 | 238 | $GLOBALS['xoopsTpl']->assign('apiexceed', true); |
239 | 239 | } |
240 | 240 | */ |
241 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_403 . '"'); |
|
241 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_403.'"'); |
|
242 | 242 | break; |
243 | 243 | case 404: |
244 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_404 . '"'); |
|
244 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_404.'"'); |
|
245 | 245 | break; |
246 | 246 | case 405: |
247 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API_405 . '"'); |
|
247 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API_405.'"'); |
|
248 | 248 | break; |
249 | 249 | case 0: |
250 | 250 | default: |
251 | - throw new \RuntimeException('"' . \_MA_WGGITHUB_READGH_ERROR_API . $errMsg . '"'); |
|
251 | + throw new \RuntimeException('"'.\_MA_WGGITHUB_READGH_ERROR_API.$errMsg.'"'); |
|
252 | 252 | break; |
253 | 253 | } |
254 | 254 | } |
255 | - $data = (array)$api->decode($response); |
|
255 | + $data = (array) $api->decode($response); |
|
256 | 256 | |
257 | 257 | return $data; |
258 | 258 | } |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | $setting = $settingsHandler->getPrimarySetting(); |
329 | 329 | |
330 | 330 | if (0 == \count($setting)) { |
331 | - \redirect_header(\XOOPS_URL . '/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
331 | + \redirect_header(\XOOPS_URL.'/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
332 | 332 | } |
333 | 333 | //$this->userAuth = $setting['user']; |
334 | 334 | $this->tokenAuth = $setting['token']; |
@@ -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 | // Example: 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 | // Example: 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 | // Example: 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 | // Example: 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 | // Example: 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 | // Example: 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 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | Github\GithubClient |
28 | 28 | }; |
29 | 29 | |
30 | -require __DIR__ . '/header.php'; |
|
30 | +require __DIR__.'/header.php'; |
|
31 | 31 | // It recovered the value of argument op in URL$ |
32 | 32 | $op = Request::getCmd('op', 'list'); |
33 | 33 | $dirId = Request::getInt('dir_id'); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $GLOBALS['xoopsTpl']->assign('directories_count', $directoriesCount); |
51 | 51 | $GLOBALS['xoopsTpl']->assign('wggithub_url', WGGITHUB_URL); |
52 | 52 | $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
53 | - $GLOBALS['xoopsTpl']->assign('wggithub_icons_url_16', WGGITHUB_ICONS_URL . '/16'); |
|
53 | + $GLOBALS['xoopsTpl']->assign('wggithub_icons_url_16', WGGITHUB_ICONS_URL.'/16'); |
|
54 | 54 | // Table view directories |
55 | 55 | if ($directoriesCount > 0) { |
56 | 56 | foreach (\array_keys($directoriesAll) as $i) { |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | } |
61 | 61 | // Display Navigation |
62 | 62 | if ($directoriesCount > $limit) { |
63 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
64 | - $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
63 | + include_once XOOPS_ROOT_PATH.'/class/pagenav.php'; |
|
64 | + $pagenav = new \XoopsPageNav($directoriesCount, $limit, $start, 'start', 'op=list&limit='.$limit); |
|
65 | 65 | $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
66 | 66 | } |
67 | 67 | } else { |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $directoriesObj->setVar('dir_submitter', Request::getInt('dir_submitter', 0)); |
102 | 102 | // Insert Data |
103 | 103 | if ($directoriesHandler->insert($directoriesObj)) { |
104 | - \redirect_header('directories.php?op=list&start=' . $start . '&limit=' . $limit, 2, _AM_WGGITHUB_FORM_OK); |
|
104 | + \redirect_header('directories.php?op=list&start='.$start.'&limit='.$limit, 2, _AM_WGGITHUB_FORM_OK); |
|
105 | 105 | } |
106 | 106 | // Get Form |
107 | 107 | $GLOBALS['xoopsTpl']->assign('error', $directoriesObj->getHtmlErrors()); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $crReadmes = new \CriteriaCompo(); |
141 | 141 | $crReadmes->add(new \Criteria('rm_repoid', $repoId)); |
142 | 142 | if (!$readmesHandler->deleteAll($crReadmes)) { |
143 | - $errors[] = \_AM_WGGITHUB_ERROR_DELETE_DATA . ' READMES'; |
|
143 | + $errors[] = \_AM_WGGITHUB_ERROR_DELETE_DATA.' READMES'; |
|
144 | 144 | } |
145 | 145 | } |
146 | 146 | if ($repositoriesAll[$i]->getVar('repo_release') > 0 || $repositoriesAll[$i]->getVar('repo_prerelease') > 0) { |
@@ -148,17 +148,17 @@ discard block |
||
148 | 148 | $crReleases = new \CriteriaCompo(); |
149 | 149 | $crReleases->add(new \Criteria('rel_repoid', $repoId)); |
150 | 150 | if (!$releasesHandler->deleteAll($crReleases)) { |
151 | - $errors[] = \_AM_WGGITHUB_ERROR_DELETE_DATA . ' RELEASES'; |
|
151 | + $errors[] = \_AM_WGGITHUB_ERROR_DELETE_DATA.' RELEASES'; |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 | } |
155 | 155 | if (!$repositoriesHandler->deleteAll($crRepositories)) { |
156 | - $errors[] = \_AM_WGGITHUB_ERROR_DELETE_DATA . ' REPOSITORIES'; |
|
156 | + $errors[] = \_AM_WGGITHUB_ERROR_DELETE_DATA.' REPOSITORIES'; |
|
157 | 157 | } |
158 | 158 | unset($crReadmes, $crReleases, $repositoriesAll); |
159 | 159 | //delete directory |
160 | 160 | if (!$directoriesHandler->delete($directoriesObj)) { |
161 | - $errors[] = \_AM_WGGITHUB_ERROR_DELETE_DATA . ' DIRECTORIES - ' . $directoriesObj->getHtmlErrors(); |
|
161 | + $errors[] = \_AM_WGGITHUB_ERROR_DELETE_DATA.' DIRECTORIES - '.$directoriesObj->getHtmlErrors(); |
|
162 | 162 | } |
163 | 163 | if (0 == \count($errors)) { |
164 | 164 | \redirect_header('directories.php', 3, _AM_WGGITHUB_FORM_DELETE_OK); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $dirName = $directoriesObj->getVar('dir_name'); |
180 | 180 | $githubClient = GithubClient::getInstance(); |
181 | 181 | $result = $githubClient->executeUpdate($dirName); |
182 | - $redir = 'directories.php?op=list&start=' . $start . '&limit=' . $limit; |
|
182 | + $redir = 'directories.php?op=list&start='.$start.'&limit='.$limit; |
|
183 | 183 | if ($result) { |
184 | 184 | \redirect_header($redir, 2, \_MA_WGGITHUB_READGH_SUCCESS); |
185 | 185 | } else { |
@@ -192,9 +192,9 @@ discard block |
||
192 | 192 | $directoriesObj->setVar(Request::getString('field'), Request::getInt('value', 0)); |
193 | 193 | // Insert Data |
194 | 194 | if ($directoriesHandler->insert($directoriesObj, true)) { |
195 | - \redirect_header('directories.php?op=list&start=' . $start . '&limit=' . $limit, 2, _AM_WGGITHUB_FORM_OK); |
|
195 | + \redirect_header('directories.php?op=list&start='.$start.'&limit='.$limit, 2, _AM_WGGITHUB_FORM_OK); |
|
196 | 196 | } |
197 | 197 | } |
198 | 198 | break; |
199 | 199 | } |
200 | -require __DIR__ . '/footer.php'; |
|
200 | +require __DIR__.'/footer.php'; |
@@ -140,7 +140,7 @@ |
||
140 | 140 | $submitter = isset($GLOBALS['xoopsUser']) && \is_object($GLOBALS['xoopsUser']) ? $GLOBALS['xoopsUser']->getVar('uid') : 0; |
141 | 141 | // add/update all items from table repositories |
142 | 142 | foreach ($repos as $key => $repo) { |
143 | - $fork = (bool)$repo['fork']; |
|
143 | + $fork = (bool) $repo['fork']; |
|
144 | 144 | if (Constants::DIRECTORY_CONTENT_ALL == $dirContent || false === $fork) { |
145 | 145 | $crRepositories = new \CriteriaCompo(); |
146 | 146 | $crRepositories->add(new \Criteria('repo_nodeid', $repo['node_id'])); |
@@ -157,11 +157,11 @@ discard block |
||
157 | 157 | $ret = $this->getValues($keys, $format, $maxDepth); |
158 | 158 | $ret['id'] = $this->getVar('dir_id'); |
159 | 159 | $ret['name'] = $this->getVar('dir_name'); |
160 | - $ret['descr'] = $this->getVar('dir_descr'); |
|
160 | + $ret['descr'] = $this->getVar('dir_descr'); |
|
161 | 161 | $ret['type'] = $this->getVar('dir_type'); |
162 | 162 | $ret['type_text'] = Constants::DIRECTORY_TYPE_USER == $this->getVar('dir_type') ? \_AM_WGGITHUB_DIRECTORY_TYPE_USER : \_AM_WGGITHUB_DIRECTORY_TYPE_ORG; |
163 | 163 | $content = $this->getVar('dir_content'); |
164 | - $ret['content'] = $content; |
|
164 | + $ret['content'] = $content; |
|
165 | 165 | switch ($content) { |
166 | 166 | case Constants::DIRECTORY_CONTENT_ALL: |
167 | 167 | default: |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | break; |
173 | 173 | } |
174 | 174 | $ret['content_shorttext'] = Utility::truncateHtml($content_text); |
175 | - $ret['autoupdate'] = (int)$this->getVar('dir_autoupdate') > 0 ? _YES : _NO; |
|
176 | - $ret['online'] = (int)$this->getVar('dir_online') > 0 ? _YES : _NO; |
|
177 | - $ret['filterrelease'] = (int)$this->getVar('dir_filterrelease') > 0 ? _YES : _NO; |
|
175 | + $ret['autoupdate'] = (int) $this->getVar('dir_autoupdate') > 0 ? _YES : _NO; |
|
176 | + $ret['online'] = (int) $this->getVar('dir_online') > 0 ? _YES : _NO; |
|
177 | + $ret['filterrelease'] = (int) $this->getVar('dir_filterrelease') > 0 ? _YES : _NO; |
|
178 | 178 | $ret['datecreated'] = \formatTimestamp($this->getVar('dir_datecreated'), 's'); |
179 | 179 | $ret['submitter'] = \XoopsUser::getUnameFromId($this->getVar('dir_submitter')); |
180 | 180 | return $ret; |