|
| 1 | +<?php |
| 2 | +/* |
| 3 | + You may not change or alter any portion of this comment or credits |
| 4 | + of supporting developers from this source code or any supporting source code |
| 5 | + which is considered copyrighted (c) material of the original comment or credit authors. |
| 6 | +
|
| 7 | + This program is distributed in the hope that it will be useful, |
| 8 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 10 | +*/ |
| 11 | + |
| 12 | +/** |
| 13 | + * wgGitHub module for xoops |
| 14 | + * |
| 15 | + * @copyright 2020 XOOPS Project (https://xooops.org) |
| 16 | + * @license GPL 2.0 or later |
| 17 | + * @package wggithub |
| 18 | + * @since 1.0 |
| 19 | + * @min_xoops 2.5.10 |
| 20 | + * @author TDM XOOPS - Email:<goffy@wedega.com> - Website:<https://wedega.com> |
| 21 | + */ |
| 22 | + |
| 23 | +use Xmf\Request; |
| 24 | +use XoopsModules\Wggithub; |
| 25 | +use XoopsModules\Wggithub\Constants; |
| 26 | + |
| 27 | +require __DIR__ . '/header.php'; |
| 28 | + |
| 29 | +// Define Stylesheet |
| 30 | +$GLOBALS['xoTheme']->addStylesheet($style, null); |
| 31 | +$templateMain = 'wggithub_admin_broken.tpl'; |
| 32 | +$GLOBALS['xoopsTpl']->assign('navigation', $adminObject->displayNavigation('broken.php')); |
| 33 | + |
| 34 | +// Check table repositories |
| 35 | +$start = Request::getInt('startRepositories', 0); |
| 36 | +$limit = Request::getInt('limitRepositories', $helper->getConfig('adminpager')); |
| 37 | +$crRepositories = new \CriteriaCompo(); |
| 38 | +$crRepositories->add(new \Criteria('repo_status', Constants::STATUS_BROKEN)); |
| 39 | +$repositoriesCount = $repositoriesHandler->getCount($crRepositories); |
| 40 | +$GLOBALS['xoopsTpl']->assign('repositories_count', $repositoriesCount); |
| 41 | +$GLOBALS['xoopsTpl']->assign('repositories_result', \sprintf(\_AM_WGGITHUB_BROKEN_RESULT, 'Repositories')); |
| 42 | +$crRepositories->setStart($start); |
| 43 | +$crRepositories->setLimit($limit); |
| 44 | +if ($repositoriesCount > 0) { |
| 45 | + $repositoriesAll = $repositoriesHandler->getAll($crRepositories); |
| 46 | + foreach (\array_keys($repositoriesAll) as $i) { |
| 47 | + $repository['table'] = 'Repositories'; |
| 48 | + $repository['key'] = 'repo_id'; |
| 49 | + $repository['keyval'] = $repositoriesAll[$i]->getVar('repo_id'); |
| 50 | + $repository['main'] = $repositoriesAll[$i]->getVar('repo_name'); |
| 51 | + $GLOBALS['xoopsTpl']->append('repositories_list', $repository); |
| 52 | + } |
| 53 | + // Display Navigation |
| 54 | + if ($repositoriesCount > $limit) { |
| 55 | + include_once \XOOPS_ROOT_PATH . '/class/pagenav.php'; |
| 56 | + $pagenav = new \XoopsPageNav($repositoriesCount, $limit, $start, 'startRepositories', 'op=list&limitRepositories=' . $limit); |
| 57 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
| 58 | + } |
| 59 | +} else { |
| 60 | + $GLOBALS['xoopsTpl']->assign('nodataRepositories', \sprintf(\_AM_WGGITHUB_BROKEN_NODATA, 'Repositories')); |
| 61 | +} |
| 62 | +unset($crRepositories); |
| 63 | + |
| 64 | +require __DIR__ . '/footer.php'; |
0 commit comments