Skip to content

Commit 7ec8c64

Browse files
committed
fixed bug with wrong icon and link
1 parent 296641a commit 7ec8c64

3 files changed

Lines changed: 12 additions & 10 deletions

File tree

assets/icons/32/a.png

-4.99 KB
Binary file not shown.

docs/changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
- replaced index.html by index.php (alain01/goffy)
66
- permanent display of filter with enabled/disabled buttons (alain01/goffy)
77
- added new bt4 templates (alain01/goffy)
8+
- fixed bug with wrong icon and link (alain01/goffy)
89

910
===================================================================
1011
2021/03/31 Version 1.03 Final

include/search.inc.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ function wggithub_search($queryarray, $andor, $limit, $offset, $userid)
3737
{
3838
$ret = [];
3939
$helper = \XoopsModules\Wggithub\Helper::getInstance();
40+
$repositoriesHandler = $helper->getHandler('Repositories');
41+
$directoriesHandler = $helper->getHandler('Directories');
42+
43+
$directoriesAll = $directoriesHandler->getAll();
44+
foreach (\array_keys($directoriesAll) as $i) {
45+
$directories[$directoriesAll[$i]->getVar('dir_name')] = $directoriesAll[$i]->getVar('dir_id');
46+
}
47+
unset ($directoriesAll);
4048

4149
// search in table repositories
4250
// search keywords
4351
$elementCount = 0;
44-
$repositoriesHandler = $helper->getHandler('Repositories');
4552
if (\is_array($queryarray)) {
4653
$elementCount = \count($queryarray);
4754
}
@@ -75,19 +82,13 @@ function wggithub_search($queryarray, $andor, $limit, $offset, $userid)
7582
$repositoriesAll = $repositoriesHandler->getAll($crSearch);
7683
foreach (\array_keys($repositoriesAll) as $i) {
7784
$ret[] = [
78-
'image' => 'assets/icons/16/repositories.png',
79-
'link' => 'repositories.php?op=show&repo_id=' . $repositoriesAll[$i]->getVar('repo_id'),
85+
'image' => 'assets/icons/16/github.png',
86+
'link' => 'index.php?op=show&menu=' . $directories[$repositoriesAll[$i]->getVar('repo_user')],
8087
'title' => $repositoriesAll[$i]->getVar('repo_name'),
8188
'time' => $repositoriesAll[$i]->getVar('repo_datecreated')
8289
];
8390
}
84-
unset($crKeywords);
85-
unset($crKeyword);
86-
unset($crUser);
87-
unset($crSearch);
88-
89-
90-
91+
unset($crKeywords, $crKeyword, $crUser, $crSearch, $repositoriesAll);
9192

9293
return $ret;
9394

0 commit comments

Comments
 (0)