Conditions | 4 |
Paths | 6 |
Total Lines | 24 |
Code Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
30 | function wggithub_notify_iteminfo($category, $item_id) |
||
31 | { |
||
32 | global $xoopsDB; |
||
33 | |||
34 | if (!\defined('WGGITHUB_URL')) { |
||
35 | \define('WGGITHUB_URL', \XOOPS_URL . '/modules/wggithub'); |
||
|
|||
36 | } |
||
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; |
||
54 | } |
||
55 |