@@ -35,60 +35,60 @@ |
||
35 | 35 | */ |
36 | 36 | function wggithub_search($queryarray, $andor, $limit, $offset, $userid) |
37 | 37 | { |
38 | - $ret = []; |
|
39 | - $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
38 | + $ret = []; |
|
39 | + $helper = \XoopsModules\Wggithub\Helper::getInstance(); |
|
40 | 40 | |
41 | - // search in table repositories |
|
42 | - // search keywords |
|
43 | - $elementCount = 0; |
|
44 | - $repositoriesHandler = $helper->getHandler('Repositories'); |
|
45 | - if (\is_array($queryarray)) { |
|
46 | - $elementCount = \count($queryarray); |
|
47 | - } |
|
48 | - if ($elementCount > 0) { |
|
49 | - $crKeywords = new \CriteriaCompo(); |
|
50 | - for ($i = 0; $i < $elementCount; $i++) { |
|
51 | - $crKeyword = new \CriteriaCompo(); |
|
52 | - unset($crKeyword); |
|
53 | - } |
|
54 | - } |
|
55 | - // search user(s) |
|
56 | - if ($userid && \is_array($userid)) { |
|
57 | - $userid = array_map('intval', $userid); |
|
58 | - $crUser = new \CriteriaCompo(); |
|
59 | - $crUser->add(new \Criteria('repo_submitter', '(' . \implode(',', $userid) . ')', 'IN'), 'OR'); |
|
60 | - } elseif (is_numeric($userid) && $userid > 0) { |
|
61 | - $crUser = new \CriteriaCompo(); |
|
62 | - $crUser->add(new \Criteria('repo_submitter', $userid), 'OR'); |
|
63 | - } |
|
64 | - $crSearch = new \CriteriaCompo(); |
|
65 | - if (isset($crKeywords)) { |
|
66 | - $crSearch->add($crKeywords, 'AND'); |
|
67 | - } |
|
68 | - if (isset($crUser)) { |
|
69 | - $crSearch->add($crUser, 'AND'); |
|
70 | - } |
|
71 | - $crSearch->setStart($offset); |
|
72 | - $crSearch->setLimit($limit); |
|
73 | - $crSearch->setSort('repo_datecreated'); |
|
74 | - $crSearch->setOrder('DESC'); |
|
75 | - $repositoriesAll = $repositoriesHandler->getAll($crSearch); |
|
76 | - foreach (\array_keys($repositoriesAll) as $i) { |
|
77 | - $ret[] = [ |
|
78 | - 'image' => 'assets/icons/16/repositories.png', |
|
79 | - 'link' => 'repositories.php?op=show&repo_id=' . $repositoriesAll[$i]->getVar('repo_id'), |
|
80 | - 'title' => $repositoriesAll[$i]->getVar('repo_name'), |
|
81 | - 'time' => $repositoriesAll[$i]->getVar('repo_datecreated') |
|
82 | - ]; |
|
83 | - } |
|
84 | - unset($crKeywords); |
|
85 | - unset($crKeyword); |
|
86 | - unset($crUser); |
|
87 | - unset($crSearch); |
|
41 | + // search in table repositories |
|
42 | + // search keywords |
|
43 | + $elementCount = 0; |
|
44 | + $repositoriesHandler = $helper->getHandler('Repositories'); |
|
45 | + if (\is_array($queryarray)) { |
|
46 | + $elementCount = \count($queryarray); |
|
47 | + } |
|
48 | + if ($elementCount > 0) { |
|
49 | + $crKeywords = new \CriteriaCompo(); |
|
50 | + for ($i = 0; $i < $elementCount; $i++) { |
|
51 | + $crKeyword = new \CriteriaCompo(); |
|
52 | + unset($crKeyword); |
|
53 | + } |
|
54 | + } |
|
55 | + // search user(s) |
|
56 | + if ($userid && \is_array($userid)) { |
|
57 | + $userid = array_map('intval', $userid); |
|
58 | + $crUser = new \CriteriaCompo(); |
|
59 | + $crUser->add(new \Criteria('repo_submitter', '(' . \implode(',', $userid) . ')', 'IN'), 'OR'); |
|
60 | + } elseif (is_numeric($userid) && $userid > 0) { |
|
61 | + $crUser = new \CriteriaCompo(); |
|
62 | + $crUser->add(new \Criteria('repo_submitter', $userid), 'OR'); |
|
63 | + } |
|
64 | + $crSearch = new \CriteriaCompo(); |
|
65 | + if (isset($crKeywords)) { |
|
66 | + $crSearch->add($crKeywords, 'AND'); |
|
67 | + } |
|
68 | + if (isset($crUser)) { |
|
69 | + $crSearch->add($crUser, 'AND'); |
|
70 | + } |
|
71 | + $crSearch->setStart($offset); |
|
72 | + $crSearch->setLimit($limit); |
|
73 | + $crSearch->setSort('repo_datecreated'); |
|
74 | + $crSearch->setOrder('DESC'); |
|
75 | + $repositoriesAll = $repositoriesHandler->getAll($crSearch); |
|
76 | + foreach (\array_keys($repositoriesAll) as $i) { |
|
77 | + $ret[] = [ |
|
78 | + 'image' => 'assets/icons/16/repositories.png', |
|
79 | + 'link' => 'repositories.php?op=show&repo_id=' . $repositoriesAll[$i]->getVar('repo_id'), |
|
80 | + 'title' => $repositoriesAll[$i]->getVar('repo_name'), |
|
81 | + 'time' => $repositoriesAll[$i]->getVar('repo_datecreated') |
|
82 | + ]; |
|
83 | + } |
|
84 | + unset($crKeywords); |
|
85 | + unset($crKeyword); |
|
86 | + unset($crUser); |
|
87 | + unset($crSearch); |
|
88 | 88 | |
89 | 89 | |
90 | 90 | |
91 | 91 | |
92 | - return $ret; |
|
92 | + return $ret; |
|
93 | 93 | |
94 | 94 | } |
@@ -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(); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | function wggithub_check_db($module) |
114 | 114 | { |
115 | 115 | $ret = true; |
116 | - //insert here code for database check |
|
116 | + //insert here code for database check |
|
117 | 117 | |
118 | 118 | // Example: update table (add new field) |
119 | 119 | $table = $GLOBALS['xoopsDB']->prefix('wggithub_repositories'); |
@@ -29,26 +29,26 @@ |
||
29 | 29 | */ |
30 | 30 | function wggithub_notify_iteminfo($category, $item_id) |
31 | 31 | { |
32 | - global $xoopsDB; |
|
32 | + global $xoopsDB; |
|
33 | 33 | |
34 | - if (!\defined('WGGITHUB_URL')) { |
|
35 | - \define('WGGITHUB_URL', \XOOPS_URL . '/modules/wggithub'); |
|
36 | - } |
|
34 | + if (!\defined('WGGITHUB_URL')) { |
|
35 | + \define('WGGITHUB_URL', \XOOPS_URL . '/modules/wggithub'); |
|
36 | + } |
|
37 | 37 | |
38 | - switch ($category) { |
|
39 | - case 'global': |
|
40 | - $item['name'] = ''; |
|
41 | - $item['url'] = ''; |
|
42 | - return $item; |
|
43 | - break; |
|
44 | - case 'repositories': |
|
45 | - $sql = 'SELECT repo_name FROM ' . $xoopsDB->prefix('wggithub_repositories') . ' WHERE repo_id = '. $item_id; |
|
46 | - $result = $xoopsDB->query($sql); |
|
47 | - $result_array = $xoopsDB->fetchArray($result); |
|
48 | - $item['name'] = $result_array['repo_name']; |
|
49 | - $item['url'] = WGGITHUB_URL . '/repositories.php?repo_id=' . $item_id; |
|
50 | - return $item; |
|
51 | - break; |
|
52 | - } |
|
53 | - return null; |
|
38 | + switch ($category) { |
|
39 | + case 'global': |
|
40 | + $item['name'] = ''; |
|
41 | + $item['url'] = ''; |
|
42 | + return $item; |
|
43 | + break; |
|
44 | + case 'repositories': |
|
45 | + $sql = 'SELECT repo_name FROM ' . $xoopsDB->prefix('wggithub_repositories') . ' WHERE repo_id = '. $item_id; |
|
46 | + $result = $xoopsDB->query($sql); |
|
47 | + $result_array = $xoopsDB->fetchArray($result); |
|
48 | + $item['name'] = $result_array['repo_name']; |
|
49 | + $item['url'] = WGGITHUB_URL . '/repositories.php?repo_id=' . $item_id; |
|
50 | + return $item; |
|
51 | + break; |
|
52 | + } |
|
53 | + return null; |
|
54 | 54 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $dest = $configurator->copyBlankFiles[$i] . '/blank.gif'; |
85 | 85 | $utility::copyFile($file, $dest); |
86 | 86 | } |
87 | - $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
87 | + $file = \dirname(__DIR__) . '/assets/images/blank.png'; |
|
88 | 88 | foreach (\array_keys($configurator->copyBlankFiles) as $i) { |
89 | 89 | $dest = $configurator->copyBlankFiles[$i] . '/blank.png'; |
90 | 90 | $utility::copyFile($file, $dest); |
@@ -20,10 +20,10 @@ |
||
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 | 29 | \define('WGGITHUB_PATH', XOOPS_ROOT_PATH . '/modules/' . WGGITHUB_DIRNAME); |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | */ |
29 | 29 | function wggithub_block_addCatSelect($cats) |
30 | 30 | { |
31 | - $cat_sql = '('; |
|
32 | - if (\is_array($cats)) { |
|
33 | - $cat_sql .= current($cats); |
|
34 | - array_shift($cats); |
|
35 | - foreach ($cats as $cat) { |
|
36 | - $cat_sql .= ',' . $cat; |
|
37 | - } |
|
38 | - } |
|
39 | - $cat_sql .= ')'; |
|
40 | - return $cat_sql; |
|
31 | + $cat_sql = '('; |
|
32 | + if (\is_array($cats)) { |
|
33 | + $cat_sql .= current($cats); |
|
34 | + array_shift($cats); |
|
35 | + foreach ($cats as $cat) { |
|
36 | + $cat_sql .= ',' . $cat; |
|
37 | + } |
|
38 | + } |
|
39 | + $cat_sql .= ')'; |
|
40 | + return $cat_sql; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -49,17 +49,17 @@ discard block |
||
49 | 49 | */ |
50 | 50 | function wggithubGetMyItemIds($permtype, $dirname) |
51 | 51 | { |
52 | - global $xoopsUser; |
|
53 | - static $permissions = []; |
|
54 | - if (\is_array($permissions) && \array_key_exists($permtype, $permissions)) { |
|
55 | - return $permissions[$permtype]; |
|
56 | - } |
|
57 | - $moduleHandler = \xoops_getHandler('module'); |
|
58 | - $wggithubModule = $moduleHandler->getByDirname($dirname); |
|
59 | - $groups = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; |
|
60 | - $grouppermHandler = \xoops_getHandler('groupperm'); |
|
61 | - $itemIds = $grouppermHandler->getItemIds($permtype, $groups, $wggithubModule->getVar('mid')); |
|
62 | - return $itemIds; |
|
52 | + global $xoopsUser; |
|
53 | + static $permissions = []; |
|
54 | + if (\is_array($permissions) && \array_key_exists($permtype, $permissions)) { |
|
55 | + return $permissions[$permtype]; |
|
56 | + } |
|
57 | + $moduleHandler = \xoops_getHandler('module'); |
|
58 | + $wggithubModule = $moduleHandler->getByDirname($dirname); |
|
59 | + $groups = \is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS; |
|
60 | + $grouppermHandler = \xoops_getHandler('groupperm'); |
|
61 | + $itemIds = $grouppermHandler->getItemIds($permtype, $groups, $wggithubModule->getVar('mid')); |
|
62 | + return $itemIds; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | case 'none': |
135 | 135 | if($topic_name) { |
136 | - $topic_name = 'topic=' . $topic_name . '&'; |
|
136 | + $topic_name = 'topic=' . $topic_name . '&'; |
|
137 | 137 | } |
138 | 138 | $rewrite_base = '/modules/'; |
139 | 139 | $page = 'page=' . $array['content_alias']; |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | return XOOPS_URL . $rewrite_base . $module_name . $type . $topic_name . $id . $page . $rewrite_ext; |
164 | 164 | break; |
165 | 165 | |
166 | - case 'short': |
|
166 | + case 'short': |
|
167 | 167 | if($topic_name) { |
168 | 168 | $topic_name .= '/'; |
169 | 169 | } |
@@ -49,7 +49,7 @@ |
||
49 | 49 | public function __construct($value) |
50 | 50 | { |
51 | 51 | if ($value instanceof static) { |
52 | - /** @psalm-var T */ |
|
52 | + /** @psalm-var T */ |
|
53 | 53 | $value = $value->getValue(); |
54 | 54 | } |
55 | 55 |
@@ -69,8 +69,8 @@ |
||
69 | 69 | |
70 | 70 | if (\substr($path, 0, \strlen($prepend)) !== $prepend) { |
71 | 71 | $request = $request->withUri($request->getUri() |
72 | - ->withPath($prepend.$path) |
|
73 | - ); |
|
72 | + ->withPath($prepend.$path) |
|
73 | + ); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | return $next($request); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | private $defaultOptions = self::OPTIONS_DEFAULTS + [ |
41 | 41 | 'auth_ntlm' => null, // array|string - an array containing the username as first value, and optionally the |
42 | - // password as the second one; or string like username:password - enabling NTLM auth |
|
42 | + // password as the second one; or string like username:password - enabling NTLM auth |
|
43 | 43 | 'extra' => [ |
44 | 44 | 'curl' => [], // A list of extra curl options indexed by their corresponding CURLOPT_* |
45 | 45 | ], |