@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | //\defined('XOOPS_ROOT_PATH') || die('XOOPS root path not defined'); |
27 | 27 | |
28 | -require_once \dirname(__DIR__, 4) . '/mainfile.php'; |
|
28 | +require_once \dirname(__DIR__, 4).'/mainfile.php'; |
|
29 | 29 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
30 | 30 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
31 | 31 | \xoops_loadLanguage('filechecker', $moduleDirName); |
@@ -57,24 +57,24 @@ discard block |
||
57 | 57 | if (null === $original_file_path) { |
58 | 58 | if (self::fileExists($file_path)) { |
59 | 59 | $path_status = "<img src='$pathIcon16/1.png' >"; |
60 | - $path_status .= "$file_path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_AVAILABLE') . ') '; |
|
60 | + $path_status .= "$file_path (".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_AVAILABLE').') '; |
|
61 | 61 | } else { |
62 | 62 | $path_status = "<img src='$pathIcon16/0.png' >"; |
63 | - $path_status .= "$file_path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_NOTAVAILABLE') . ') '; |
|
63 | + $path_status .= "$file_path (".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_NOTAVAILABLE').') '; |
|
64 | 64 | } |
65 | 65 | } else { |
66 | 66 | if (self::compareFiles($file_path, $original_file_path)) { |
67 | 67 | $path_status = "<img src='$pathIcon16/1.png' >"; |
68 | - $path_status .= "$file_path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_AVAILABLE') . ') '; |
|
68 | + $path_status .= "$file_path (".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_AVAILABLE').') '; |
|
69 | 69 | } else { |
70 | 70 | $path_status = "<img src='$pathIcon16/0.png' >"; |
71 | - $path_status .= "$file_path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_NOTAVAILABLE') . ') '; |
|
72 | - $path_status .= "<form action='" . $_SERVER['SCRIPT_NAME'] . "' method='post'>"; |
|
71 | + $path_status .= "$file_path (".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_NOTAVAILABLE').') '; |
|
72 | + $path_status .= "<form action='".$_SERVER['SCRIPT_NAME']."' method='post'>"; |
|
73 | 73 | $path_status .= "<input type='hidden' name='op' value='copyfile'>"; |
74 | 74 | $path_status .= "<input type='hidden' name='file_path' value='$file_path'>"; |
75 | 75 | $path_status .= "<input type='hidden' name='original_file_path' value='$original_file_path'>"; |
76 | 76 | $path_status .= "<input type='hidden' name='redirect' value='$redirectFile'>"; |
77 | - $path_status .= "<button class='submit' onClick='this.form.submit();'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_CREATETHEFILE') . '</button>'; |
|
77 | + $path_status .= "<button class='submit' onClick='this.form.submit();'>".\constant('CO_'.$moduleDirNameUpper.'_'.'FC_CREATETHEFILE').'</button>'; |
|
78 | 78 | $path_status .= '</form>'; |
79 | 79 | } |
80 | 80 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | { |
140 | 140 | $target = \str_replace('..', '', $target); |
141 | 141 | |
142 | - return @\chmod($target, (int)$mode); |
|
142 | + return @\chmod($target, (int) $mode); |
|
143 | 143 | } |
144 | 144 | } |
145 | 145 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | if (\Xmf\Request::hasVar('redirect', 'POST')) { |
156 | 156 | $redirect = $_POST['redirect']; |
157 | 157 | } |
158 | - $msg = FileChecker::copyFile($original_file_path, $file_path) ? \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_FILECOPIED') : \constant('CO_' . $moduleDirNameUpper . '_' . 'FC_FILENOTCOPIED'); |
|
159 | - \redirect_header($redirect, 2, $msg . ': ' . $file_path); |
|
158 | + $msg = FileChecker::copyFile($original_file_path, $file_path) ? \constant('CO_'.$moduleDirNameUpper.'_'.'FC_FILECOPIED') : \constant('CO_'.$moduleDirNameUpper.'_'.'FC_FILENOTCOPIED'); |
|
159 | + \redirect_header($redirect, 2, $msg.': '.$file_path); |
|
160 | 160 | break; |
161 | 161 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | use XoopsModules\Wggithub; |
25 | 25 | |
26 | 26 | |
27 | -require_once \dirname(__DIR__, 4) . '/mainfile.php'; |
|
27 | +require_once \dirname(__DIR__, 4).'/mainfile.php'; |
|
28 | 28 | $moduleDirName = \basename(\dirname(__DIR__, 2)); |
29 | 29 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
30 | 30 | \xoops_loadLanguage('directorychecker', $moduleDirName); |
@@ -56,38 +56,38 @@ discard block |
||
56 | 56 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
57 | 57 | if (!@\is_dir($path)) { |
58 | 58 | $path_status = "<img src='$pathIcon16/0.png' >"; |
59 | - $path_status .= "$path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTAVAILABLE') . ') '; |
|
60 | - $path_status .= "<form action='" . $_SERVER['SCRIPT_NAME'] . "' method='post'>"; |
|
59 | + $path_status .= "$path (".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_NOTAVAILABLE').') '; |
|
60 | + $path_status .= "<form action='".$_SERVER['SCRIPT_NAME']."' method='post'>"; |
|
61 | 61 | $path_status .= "<input type='hidden' name='op' value='createdir'>"; |
62 | 62 | $path_status .= "<input type='hidden' name='path' value='$path'>"; |
63 | 63 | $path_status .= "<input type='hidden' name='redirect' value='$redirectFile'>"; |
64 | - $path_status .= "<button class='submit' onClick='this.form.submit();'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_CREATETHEDIR') . '</button>'; |
|
64 | + $path_status .= "<button class='submit' onClick='this.form.submit();'>".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_CREATETHEDIR').'</button>'; |
|
65 | 65 | $path_status .= '</form>'; |
66 | 66 | } elseif (@\is_writable($path)) { |
67 | 67 | $path_status = "<img src='$pathIcon16/1.png' >"; |
68 | - $path_status .= "$path (" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_AVAILABLE') . ') '; |
|
68 | + $path_status .= "$path (".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_AVAILABLE').') '; |
|
69 | 69 | $currentMode = \mb_substr(\decoct(\fileperms($path)), 2); |
70 | 70 | if ($currentMode != \decoct($mode)) { |
71 | 71 | $path_status = "<img src='$pathIcon16/0.png' >"; |
72 | - $path_status .= $path . \sprintf(\constant('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTWRITABLE'), \decoct($mode), $currentMode); |
|
73 | - $path_status .= "<form action='" . $_SERVER['SCRIPT_NAME'] . "' method='post'>"; |
|
72 | + $path_status .= $path.\sprintf(\constant('CO_'.$moduleDirNameUpper.'_'.'DC_NOTWRITABLE'), \decoct($mode), $currentMode); |
|
73 | + $path_status .= "<form action='".$_SERVER['SCRIPT_NAME']."' method='post'>"; |
|
74 | 74 | $path_status .= "<input type='hidden' name='op' value='setdirperm'>"; |
75 | 75 | $path_status .= "<input type='hidden' name='mode' value='$mode'>"; |
76 | 76 | $path_status .= "<input type='hidden' name='path' value='$path'>"; |
77 | 77 | $path_status .= "<input type='hidden' name='redirect' value='$redirectFile'>"; |
78 | - $path_status .= "<button class='submit' onClick='this.form.submit();'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_SETMPERM') . '</button>'; |
|
78 | + $path_status .= "<button class='submit' onClick='this.form.submit();'>".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_SETMPERM').'</button>'; |
|
79 | 79 | $path_status .= '</form>'; |
80 | 80 | } |
81 | 81 | } else { |
82 | 82 | $currentMode = \mb_substr(\decoct(\fileperms($path)), 2); |
83 | 83 | $path_status = "<img src='$pathIcon16/0.png' >"; |
84 | - $path_status .= $path . \sprintf(\constant('CO_' . $moduleDirNameUpper . '_' . 'DC_NOTWRITABLE'), \decoct($mode), $currentMode); |
|
85 | - $path_status .= "<form action='" . $_SERVER['SCRIPT_NAME'] . "' method='post'>"; |
|
84 | + $path_status .= $path.\sprintf(\constant('CO_'.$moduleDirNameUpper.'_'.'DC_NOTWRITABLE'), \decoct($mode), $currentMode); |
|
85 | + $path_status .= "<form action='".$_SERVER['SCRIPT_NAME']."' method='post'>"; |
|
86 | 86 | $path_status .= "<input type='hidden' name='op' value='setdirperm'>"; |
87 | 87 | $path_status .= "<input type='hidden' name='mode' value='$mode'>"; |
88 | 88 | $path_status .= "<input type='hidden' name='path' value='$path'>"; |
89 | 89 | $path_status .= "<input type='hidden' name='redirect' value='$redirectFile'>"; |
90 | - $path_status .= "<button class='submit' onClick='this.form.submit();'>" . \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_SETMPERM') . '</button>'; |
|
90 | + $path_status .= "<button class='submit' onClick='this.form.submit();'>".\constant('CO_'.$moduleDirNameUpper.'_'.'DC_SETMPERM').'</button>'; |
|
91 | 91 | $path_status .= '</form>'; |
92 | 92 | } |
93 | 93 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | { |
119 | 119 | $target = \str_replace('..', '', $target); |
120 | 120 | |
121 | - return @\chmod($target, (int)$mode); |
|
121 | + return @\chmod($target, (int) $mode); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | if (\Xmf\Request::hasVar('redirect', 'POST')) { |
142 | 142 | $redirect = $_POST['redirect']; |
143 | 143 | } |
144 | - $msg = DirectoryChecker::createDirectory($path) ? \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_DIRCREATED') : \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_DIRNOTCREATED'); |
|
145 | - \redirect_header($redirect, 2, $msg . ': ' . $path); |
|
144 | + $msg = DirectoryChecker::createDirectory($path) ? \constant('CO_'.$moduleDirNameUpper.'_'.'DC_DIRCREATED') : \constant('CO_'.$moduleDirNameUpper.'_'.'DC_DIRNOTCREATED'); |
|
145 | + \redirect_header($redirect, 2, $msg.': '.$path); |
|
146 | 146 | break; |
147 | 147 | case 'setdirperm': |
148 | 148 | if (\Xmf\Request::hasVar('path', 'POST')) { |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | if (\Xmf\Request::hasVar('mode', 'POST')) { |
155 | 155 | $mode = $_POST['mode']; |
156 | 156 | } |
157 | - $msg = DirectoryChecker::setDirectoryPermissions($path, $mode) ? \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMSET') : \constant('CO_' . $moduleDirNameUpper . '_' . 'DC_PERMNOTSET'); |
|
158 | - \redirect_header($redirect, 2, $msg . ': ' . $path); |
|
157 | + $msg = DirectoryChecker::setDirectoryPermissions($path, $mode) ? \constant('CO_'.$moduleDirNameUpper.'_'.'DC_PERMSET') : \constant('CO_'.$moduleDirNameUpper.'_'.'DC_PERMNOTSET'); |
|
158 | + \redirect_header($redirect, 2, $msg.': '.$path); |
|
159 | 159 | break; |
160 | 160 | } |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | 'license_url' => 'http://www.gnu.org/licenses/gpl-3.0.en.html', |
40 | 40 | 'help' => 'page=help', |
41 | 41 | 'release_info' => 'release_info', |
42 | - 'release_file' => \XOOPS_URL . '/modules/wggithub/docs/release_info file', |
|
42 | + 'release_file' => \XOOPS_URL.'/modules/wggithub/docs/release_info file', |
|
43 | 43 | 'release_date' => '2021/03/31', |
44 | 44 | 'manual' => 'link to manual file', |
45 | - 'manual_file' => \XOOPS_URL . '/modules/wggithub/docs/install.txt', |
|
45 | + 'manual_file' => \XOOPS_URL.'/modules/wggithub/docs/install.txt', |
|
46 | 46 | 'min_php' => '7.4', |
47 | 47 | 'min_xoops' => '2.5.11 Beta1', |
48 | 48 | 'min_admin' => '1.2', |
@@ -299,8 +299,8 @@ discard block |
||
299 | 299 | // Make Sample button visible? |
300 | 300 | $modversion['config'][] = [ |
301 | 301 | 'name' => 'displaySampleButton', |
302 | - 'title' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON', |
|
303 | - 'description' => 'CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLE_BUTTON_DESC', |
|
302 | + 'title' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON', |
|
303 | + 'description' => 'CO_'.$moduleDirNameUpper.'_'.'SHOW_SAMPLE_BUTTON_DESC', |
|
304 | 304 | 'formtype' => 'yesno', |
305 | 305 | 'valuetype' => 'int', |
306 | 306 | 'default' => 1, |
@@ -32,4 +32,4 @@ |
||
32 | 32 | $GLOBALS['xoopsTpl']->assign('admin', \WGGITHUB_ADMIN); |
33 | 33 | $GLOBALS['xoopsTpl']->assign('copyright', $copyright); |
34 | 34 | // |
35 | -include_once \XOOPS_ROOT_PATH . '/footer.php'; |
|
35 | +include_once \XOOPS_ROOT_PATH.'/footer.php'; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | global $xoopsDB; |
33 | 33 | |
34 | 34 | if (!\defined('WGGITHUB_URL')) { |
35 | - \define('WGGITHUB_URL', \XOOPS_URL . '/modules/wggithub'); |
|
35 | + \define('WGGITHUB_URL', \XOOPS_URL.'/modules/wggithub'); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | switch ($category) { |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | return $item; |
43 | 43 | break; |
44 | 44 | case 'repositories': |
45 | - $sql = 'SELECT repo_name FROM ' . $xoopsDB->prefix('wggithub_repositories') . ' WHERE repo_id = '. $item_id; |
|
45 | + $sql = 'SELECT repo_name FROM '.$xoopsDB->prefix('wggithub_repositories').' WHERE repo_id = '.$item_id; |
|
46 | 46 | $result = $xoopsDB->query($sql); |
47 | 47 | $result_array = $xoopsDB->fetchArray($result); |
48 | 48 | $item['name'] = $result_array['repo_name']; |
49 | - $item['url'] = \WGGITHUB_URL . '/repositories.php?repo_id=' . $item_id; |
|
49 | + $item['url'] = \WGGITHUB_URL.'/repositories.php?repo_id='.$item_id; |
|
50 | 50 | return $item; |
51 | 51 | break; |
52 | 52 | } |
@@ -20,29 +20,29 @@ |
||
20 | 20 | * @author Goffy - XOOPS Development Team - Email:<[email protected]> - Website:<https://wedega.com> |
21 | 21 | */ |
22 | 22 | if (!\defined('XOOPS_ICONS32_PATH')) { |
23 | - \define('XOOPS_ICONS32_PATH', \XOOPS_ROOT_PATH . '/Frameworks/moduleclasses/icons/32'); |
|
23 | + \define('XOOPS_ICONS32_PATH', \XOOPS_ROOT_PATH.'/Frameworks/moduleclasses/icons/32'); |
|
24 | 24 | } |
25 | 25 | if (!\defined('XOOPS_ICONS32_URL')) { |
26 | - \define('XOOPS_ICONS32_URL', \XOOPS_URL . '/Frameworks/moduleclasses/icons/32'); |
|
26 | + \define('XOOPS_ICONS32_URL', \XOOPS_URL.'/Frameworks/moduleclasses/icons/32'); |
|
27 | 27 | } |
28 | 28 | \define('WGGITHUB_DIRNAME', 'wggithub'); |
29 | -\define('WGGITHUB_PATH', \XOOPS_ROOT_PATH . '/modules/' . \WGGITHUB_DIRNAME); |
|
30 | -\define('WGGITHUB_URL', \XOOPS_URL . '/modules/' . \WGGITHUB_DIRNAME); |
|
31 | -\define('WGGITHUB_ICONS_PATH', \WGGITHUB_PATH . '/assets/icons'); |
|
32 | -\define('WGGITHUB_ICONS_URL', \WGGITHUB_URL . '/assets/icons'); |
|
33 | -\define('WGGITHUB_IMAGE_PATH', \WGGITHUB_PATH . '/assets/images'); |
|
34 | -\define('WGGITHUB_IMAGE_URL', \WGGITHUB_URL . '/assets/images'); |
|
35 | -\define('WGGITHUB_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . \WGGITHUB_DIRNAME); |
|
36 | -\define('WGGITHUB_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . \WGGITHUB_DIRNAME); |
|
37 | -\define('WGGITHUB_UPLOAD_FILES_PATH', \WGGITHUB_UPLOAD_PATH . '/files'); |
|
38 | -\define('WGGITHUB_UPLOAD_FILES_URL', \WGGITHUB_UPLOAD_URL . '/files'); |
|
39 | -\define('WGGITHUB_UPLOAD_IMAGE_PATH', \WGGITHUB_UPLOAD_PATH . '/images'); |
|
40 | -\define('WGGITHUB_UPLOAD_IMAGE_URL', \WGGITHUB_UPLOAD_URL . '/images'); |
|
41 | -\define('WGGITHUB_UPLOAD_SHOTS_PATH', \WGGITHUB_UPLOAD_PATH . '/images/shots'); |
|
42 | -\define('WGGITHUB_UPLOAD_SHOTS_URL', \WGGITHUB_UPLOAD_URL . '/images/shots'); |
|
43 | -\define('WGGITHUB_ADMIN', \WGGITHUB_URL . '/admin/index.php'); |
|
44 | -$localLogo = \WGGITHUB_IMAGE_URL . '/wedega_logo.png'; |
|
29 | +\define('WGGITHUB_PATH', \XOOPS_ROOT_PATH.'/modules/'.\WGGITHUB_DIRNAME); |
|
30 | +\define('WGGITHUB_URL', \XOOPS_URL.'/modules/'.\WGGITHUB_DIRNAME); |
|
31 | +\define('WGGITHUB_ICONS_PATH', \WGGITHUB_PATH.'/assets/icons'); |
|
32 | +\define('WGGITHUB_ICONS_URL', \WGGITHUB_URL.'/assets/icons'); |
|
33 | +\define('WGGITHUB_IMAGE_PATH', \WGGITHUB_PATH.'/assets/images'); |
|
34 | +\define('WGGITHUB_IMAGE_URL', \WGGITHUB_URL.'/assets/images'); |
|
35 | +\define('WGGITHUB_UPLOAD_PATH', XOOPS_UPLOAD_PATH.'/'.\WGGITHUB_DIRNAME); |
|
36 | +\define('WGGITHUB_UPLOAD_URL', XOOPS_UPLOAD_URL.'/'.\WGGITHUB_DIRNAME); |
|
37 | +\define('WGGITHUB_UPLOAD_FILES_PATH', \WGGITHUB_UPLOAD_PATH.'/files'); |
|
38 | +\define('WGGITHUB_UPLOAD_FILES_URL', \WGGITHUB_UPLOAD_URL.'/files'); |
|
39 | +\define('WGGITHUB_UPLOAD_IMAGE_PATH', \WGGITHUB_UPLOAD_PATH.'/images'); |
|
40 | +\define('WGGITHUB_UPLOAD_IMAGE_URL', \WGGITHUB_UPLOAD_URL.'/images'); |
|
41 | +\define('WGGITHUB_UPLOAD_SHOTS_PATH', \WGGITHUB_UPLOAD_PATH.'/images/shots'); |
|
42 | +\define('WGGITHUB_UPLOAD_SHOTS_URL', \WGGITHUB_UPLOAD_URL.'/images/shots'); |
|
43 | +\define('WGGITHUB_ADMIN', \WGGITHUB_URL.'/admin/index.php'); |
|
44 | +$localLogo = \WGGITHUB_IMAGE_URL.'/wedega_logo.png'; |
|
45 | 45 | // Module Information |
46 | -$copyright = "<a href='https://wedega.com' title='XOOPS on Wedega' target='_blank'><img src='" . $localLogo . "' alt='XOOPS on Wedega' /></a>"; |
|
47 | -include_once \XOOPS_ROOT_PATH . '/class/xoopsrequest.php'; |
|
48 | -include_once \WGGITHUB_PATH . '/include/functions.php'; |
|
46 | +$copyright = "<a href='https://wedega.com' title='XOOPS on Wedega' target='_blank'><img src='".$localLogo."' alt='XOOPS on Wedega' /></a>"; |
|
47 | +include_once \XOOPS_ROOT_PATH.'/class/xoopsrequest.php'; |
|
48 | +include_once \WGGITHUB_PATH.'/include/functions.php'; |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | } |
60 | 60 | if ($elementCount > 0) { |
61 | 61 | $crKeywords = new \CriteriaCompo(); |
62 | - for ($i = 0; $i < $elementCount; $i++) { |
|
63 | - $crKeywords->add(new \Criteria('repo_name', '%' . $queryarray[$i] . '%', 'LIKE'), 'OR'); |
|
62 | + for ($i = 0; $i < $elementCount; $i++) { |
|
63 | + $crKeywords->add(new \Criteria('repo_name', '%'.$queryarray[$i].'%', 'LIKE'), 'OR'); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | // search user(s) |
67 | 67 | if ($userid && \is_array($userid)) { |
68 | 68 | $userid = array_map('intval', $userid); |
69 | 69 | $crUser = new \CriteriaCompo(); |
70 | - $crUser->add(new \Criteria('repo_submitter', '(' . \implode(',', $userid) . ')', 'IN'), 'OR'); |
|
70 | + $crUser->add(new \Criteria('repo_submitter', '('.\implode(',', $userid).')', 'IN'), 'OR'); |
|
71 | 71 | } elseif (is_numeric($userid) && $userid > 0) { |
72 | 72 | $crUser = new \CriteriaCompo(); |
73 | 73 | $crUser->add(new \Criteria('repo_submitter', $userid), 'OR'); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | if (isset($crUser)) { |
80 | 80 | $crSearch->add($crUser, 'AND'); |
81 | 81 | } |
82 | - if (0 === (int)$helper->getConfig('autoapproved')) { |
|
82 | + if (0 === (int) $helper->getConfig('autoapproved')) { |
|
83 | 83 | $crSearch->add(new \Criteria('repo_approved', 1)); |
84 | 84 | } |
85 | 85 | $crSearch->add(new \Criteria('repo_status', Constants::STATUS_UPTODATE)); |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | foreach (\array_keys($repositoriesAll) as $i) { |
92 | 92 | $ret[] = [ |
93 | 93 | 'image' => 'assets/icons/16/github.png', |
94 | - 'link' => 'index.php?op=show&dir_id=' . $directories[$repositoriesAll[$i]->getVar('repo_user')] . '&repo_id=' . $i, |
|
95 | - 'title' => $repositoriesAll[$i]->getVar('repo_name') . ' (' . $repositoriesAll[$i]->getVar('repo_user') . ')', |
|
94 | + 'link' => 'index.php?op=show&dir_id='.$directories[$repositoriesAll[$i]->getVar('repo_user')].'&repo_id='.$i, |
|
95 | + 'title' => $repositoriesAll[$i]->getVar('repo_name').' ('.$repositoriesAll[$i]->getVar('repo_user').')', |
|
96 | 96 | 'time' => $repositoriesAll[$i]->getVar('repo_datecreated') |
97 | 97 | ]; |
98 | 98 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | $this->storage->set('auth.state', $state); |
66 | 66 | |
67 | - $url = $this->authUrl . '?' . \http_build_query($params); |
|
67 | + $url = $this->authUrl.'?'.\http_build_query($params); |
|
68 | 68 | if ($redirectCb === NULL) { |
69 | 69 | header("Location: $url"); |
70 | 70 | die(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $logsHandler = $this->helper->getHandler('Logs'); |
85 | 85 | $logsHandler->updateTableLogs(Constants::LOG_TYPE_REQUEST, '', 'START Test API1'); |
86 | 86 | |
87 | - $url = static::BASE_URL . $url; |
|
87 | + $url = static::BASE_URL.$url; |
|
88 | 88 | $logsHandler->updateTableLogs(Constants::LOG_TYPE_REQUEST, $url, 'URL'); |
89 | 89 | $data = $this->_get($url); |
90 | 90 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | $token = new Github\OAuth\Token('{myKey}', 'bearer', ['repo', 'user', 'public_repo']); |
101 | 101 | $api->setToken($token); |
102 | - $response = $api->get(static::BASE_URL . $url); |
|
102 | + $response = $api->get(static::BASE_URL.$url); |
|
103 | 103 | |
104 | 104 | $data = $api->decode($response); |
105 | 105 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $logsHandler = $this->helper->getHandler('Logs'); |
125 | 125 | $logsHandler->updateTableLogs(Constants::LOG_TYPE_REQUEST, '', 'START Test UserRepositories'); |
126 | 126 | |
127 | - $url = static::BASE_URL . 'users/' . \rawurlencode($this->userAuth) . '/repos?per_page=1&page=1'; |
|
127 | + $url = static::BASE_URL.'users/'.\rawurlencode($this->userAuth).'/repos?per_page=1&page=1'; |
|
128 | 128 | $logsHandler->updateTableLogs(Constants::LOG_TYPE_REQUEST, $url, 'URL'); |
129 | 129 | |
130 | 130 | $data = $this->_get($url); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function getUserRepositories($username, $per_page = 100, $page = 1) |
147 | 147 | { |
148 | - $url = static::BASE_URL . 'users/' . \rawurlencode($username) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
148 | + $url = static::BASE_URL.'users/'.\rawurlencode($username).'/repos?per_page='.$per_page.'&page='.$page; |
|
149 | 149 | |
150 | 150 | return $this->_get($url); |
151 | 151 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function getOrgRepositories($org, $per_page = 100, $page = 1) |
162 | 162 | { |
163 | - $url = static::BASE_URL . 'orgs/' . \rawurlencode($org) . '/repos?per_page=' . $per_page . '&page=' . $page; |
|
163 | + $url = static::BASE_URL.'orgs/'.\rawurlencode($org).'/repos?per_page='.$per_page.'&page='.$page; |
|
164 | 164 | |
165 | 165 | return $this->_get($url); |
166 | 166 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function getReadme($username, $repository) |
176 | 176 | { |
177 | - $url = static::BASE_URL . 'repos/' . \rawurlencode($username) . '/' . \rawurlencode($repository) . '/readme'; |
|
177 | + $url = static::BASE_URL.'repos/'.\rawurlencode($username).'/'.\rawurlencode($repository).'/readme'; |
|
178 | 178 | |
179 | 179 | return $this->_get($url, true); |
180 | 180 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function getReleases($username, $repository) |
190 | 190 | { |
191 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases'; |
|
191 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases'; |
|
192 | 192 | |
193 | 193 | return $this->_get($url, true); |
194 | 194 | } |
@@ -205,9 +205,9 @@ discard block |
||
205 | 205 | { |
206 | 206 | //function currently not used |
207 | 207 | if ($prerelease) { |
208 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases'; |
|
208 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases'; |
|
209 | 209 | } else { |
210 | - $url = static::BASE_URL . 'repos/' . $username . '/' . $repository . '/releases/latest'; |
|
210 | + $url = static::BASE_URL.'repos/'.$username.'/'.$repository.'/releases/latest'; |
|
211 | 211 | } |
212 | 212 | $result = $this->_get($url); |
213 | 213 | |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function getRepositoryContent($username, $repository) |
233 | 233 | { |
234 | - $url = static::BASE_URL . 'repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents'; |
|
234 | + $url = static::BASE_URL.'repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/contents'; |
|
235 | 235 | |
236 | 236 | return $this->_get($url); |
237 | 237 | } |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } else { |
265 | 265 | $error = true; |
266 | 266 | $errMsg = $response->getContent(); |
267 | - $logsHandler->updateTableLogs(Constants::LOG_TYPE_ERROR, $errMsg, 'ERROR ' . $code); |
|
267 | + $logsHandler->updateTableLogs(Constants::LOG_TYPE_ERROR, $errMsg, 'ERROR '.$code); |
|
268 | 268 | } |
269 | 269 | } |
270 | 270 | if ($error) { |
@@ -285,13 +285,13 @@ discard block |
||
285 | 285 | break; |
286 | 286 | case 0: |
287 | 287 | default: |
288 | - $message = \_MA_WGGITHUB_READGH_ERROR_API . '(' .$code . ' - ' . $errMsg . ')'; |
|
288 | + $message = \_MA_WGGITHUB_READGH_ERROR_API.'('.$code.' - '.$errMsg.')'; |
|
289 | 289 | break; |
290 | 290 | } |
291 | - \redirect_header('index.php?op=api_error&message='. $message . '&url='. $url, 5, $message); |
|
291 | + \redirect_header('index.php?op=api_error&message='.$message.'&url='.$url, 5, $message); |
|
292 | 292 | //throw new \RuntimeException('"' . $message . '"'); |
293 | 293 | } else { |
294 | - $data = (array)$api->decode($response); |
|
294 | + $data = (array) $api->decode($response); |
|
295 | 295 | } |
296 | 296 | |
297 | 297 | return $data; |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $setting = $settingsHandler->getPrimarySetting(); |
370 | 370 | |
371 | 371 | if (0 == \count($setting)) { |
372 | - \redirect_header(\XOOPS_URL . '/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
372 | + \redirect_header(\XOOPS_URL.'/index.php', 3, \_AM_WGGITHUB_THEREARENT_SETTINGS); |
|
373 | 373 | } |
374 | 374 | $this->userAuth = $setting['user']; |
375 | 375 | $this->tokenAuth = $setting['token']; |