@@ -32,25 +32,25 @@ |
||
32 | 32 | */ |
33 | 33 | class Permissions extends \XoopsObject |
34 | 34 | { |
35 | - /** |
|
36 | - * Constructor |
|
37 | - * |
|
38 | - * @param null |
|
39 | - */ |
|
40 | - public function __construct() |
|
41 | - { |
|
42 | - } |
|
43 | - |
|
44 | - /** |
|
45 | - * @static function &getInstance |
|
46 | - * |
|
47 | - * @param null |
|
48 | - */ |
|
49 | - public static function getInstance() |
|
50 | - { |
|
51 | - static $instance = false; |
|
52 | - if (!$instance) { |
|
53 | - $instance = new self(); |
|
54 | - } |
|
55 | - } |
|
35 | + /** |
|
36 | + * Constructor |
|
37 | + * |
|
38 | + * @param null |
|
39 | + */ |
|
40 | + public function __construct() |
|
41 | + { |
|
42 | + } |
|
43 | + |
|
44 | + /** |
|
45 | + * @static function &getInstance |
|
46 | + * |
|
47 | + * @param null |
|
48 | + */ |
|
49 | + public static function getInstance() |
|
50 | + { |
|
51 | + static $instance = false; |
|
52 | + if (!$instance) { |
|
53 | + $instance = new self(); |
|
54 | + } |
|
55 | + } |
|
56 | 56 | } |
@@ -31,94 +31,94 @@ |
||
31 | 31 | */ |
32 | 32 | class DirectoriesHandler extends \XoopsPersistableObjectHandler |
33 | 33 | { |
34 | - /** |
|
35 | - * Constructor |
|
36 | - * |
|
37 | - * @param \XoopsDatabase $db |
|
38 | - */ |
|
39 | - public function __construct(\XoopsDatabase $db) |
|
40 | - { |
|
41 | - parent::__construct($db, 'wggithub_directories', Directories::class, 'dir_id', 'dir_name'); |
|
42 | - } |
|
34 | + /** |
|
35 | + * Constructor |
|
36 | + * |
|
37 | + * @param \XoopsDatabase $db |
|
38 | + */ |
|
39 | + public function __construct(\XoopsDatabase $db) |
|
40 | + { |
|
41 | + parent::__construct($db, 'wggithub_directories', Directories::class, 'dir_id', 'dir_name'); |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @param bool $isNew |
|
46 | - * |
|
47 | - * @return object |
|
48 | - */ |
|
49 | - public function create($isNew = true) |
|
50 | - { |
|
51 | - return parent::create($isNew); |
|
52 | - } |
|
44 | + /** |
|
45 | + * @param bool $isNew |
|
46 | + * |
|
47 | + * @return object |
|
48 | + */ |
|
49 | + public function create($isNew = true) |
|
50 | + { |
|
51 | + return parent::create($isNew); |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * retrieve a field |
|
56 | - * |
|
57 | - * @param int $i field id |
|
58 | - * @param null fields |
|
59 | - * @return mixed reference to the {@link Get} object |
|
60 | - */ |
|
61 | - public function get($i = null, $fields = null) |
|
62 | - { |
|
63 | - return parent::get($i, $fields); |
|
64 | - } |
|
54 | + /** |
|
55 | + * retrieve a field |
|
56 | + * |
|
57 | + * @param int $i field id |
|
58 | + * @param null fields |
|
59 | + * @return mixed reference to the {@link Get} object |
|
60 | + */ |
|
61 | + public function get($i = null, $fields = null) |
|
62 | + { |
|
63 | + return parent::get($i, $fields); |
|
64 | + } |
|
65 | 65 | |
66 | - /** |
|
67 | - * get inserted id |
|
68 | - * |
|
69 | - * @param null |
|
70 | - * @return int reference to the {@link Get} object |
|
71 | - */ |
|
72 | - public function getInsertId() |
|
73 | - { |
|
74 | - return $this->db->getInsertId(); |
|
75 | - } |
|
66 | + /** |
|
67 | + * get inserted id |
|
68 | + * |
|
69 | + * @param null |
|
70 | + * @return int reference to the {@link Get} object |
|
71 | + */ |
|
72 | + public function getInsertId() |
|
73 | + { |
|
74 | + return $this->db->getInsertId(); |
|
75 | + } |
|
76 | 76 | |
77 | - /** |
|
78 | - * Get Count Directories in the database |
|
79 | - * @param int $start |
|
80 | - * @param int $limit |
|
81 | - * @param string $sort |
|
82 | - * @param string $order |
|
83 | - * @return int |
|
84 | - */ |
|
85 | - public function getCountDirectories($start = 0, $limit = 0, $sort = 'dir_id ASC, dir_name', $order = 'ASC') |
|
86 | - { |
|
87 | - $crCountDirectories = new \CriteriaCompo(); |
|
88 | - $crCountDirectories = $this->getDirectoriesCriteria($crCountDirectories, $start, $limit, $sort, $order); |
|
89 | - return $this->getCount($crCountDirectories); |
|
90 | - } |
|
77 | + /** |
|
78 | + * Get Count Directories in the database |
|
79 | + * @param int $start |
|
80 | + * @param int $limit |
|
81 | + * @param string $sort |
|
82 | + * @param string $order |
|
83 | + * @return int |
|
84 | + */ |
|
85 | + public function getCountDirectories($start = 0, $limit = 0, $sort = 'dir_id ASC, dir_name', $order = 'ASC') |
|
86 | + { |
|
87 | + $crCountDirectories = new \CriteriaCompo(); |
|
88 | + $crCountDirectories = $this->getDirectoriesCriteria($crCountDirectories, $start, $limit, $sort, $order); |
|
89 | + return $this->getCount($crCountDirectories); |
|
90 | + } |
|
91 | 91 | |
92 | - /** |
|
93 | - * Get All Directories in the database |
|
94 | - * @param int $start |
|
95 | - * @param int $limit |
|
96 | - * @param string $sort |
|
97 | - * @param string $order |
|
98 | - * @return array |
|
99 | - */ |
|
100 | - public function getAllDirectories($start = 0, $limit = 0, $sort = 'dir_id ASC, dir_name', $order = 'ASC') |
|
101 | - { |
|
102 | - $crAllDirectories = new \CriteriaCompo(); |
|
103 | - $crAllDirectories = $this->getDirectoriesCriteria($crAllDirectories, $start, $limit, $sort, $order); |
|
104 | - return $this->getAll($crAllDirectories); |
|
105 | - } |
|
92 | + /** |
|
93 | + * Get All Directories in the database |
|
94 | + * @param int $start |
|
95 | + * @param int $limit |
|
96 | + * @param string $sort |
|
97 | + * @param string $order |
|
98 | + * @return array |
|
99 | + */ |
|
100 | + public function getAllDirectories($start = 0, $limit = 0, $sort = 'dir_id ASC, dir_name', $order = 'ASC') |
|
101 | + { |
|
102 | + $crAllDirectories = new \CriteriaCompo(); |
|
103 | + $crAllDirectories = $this->getDirectoriesCriteria($crAllDirectories, $start, $limit, $sort, $order); |
|
104 | + return $this->getAll($crAllDirectories); |
|
105 | + } |
|
106 | 106 | |
107 | - /** |
|
108 | - * Get Criteria Directories |
|
109 | - * @param $crDirectories |
|
110 | - * @param int $start |
|
111 | - * @param int $limit |
|
112 | - * @param string $sort |
|
113 | - * @param string $order |
|
114 | - * @return int |
|
115 | - */ |
|
116 | - private function getDirectoriesCriteria($crDirectories, $start, $limit, $sort, $order) |
|
117 | - { |
|
118 | - $crDirectories->setStart($start); |
|
119 | - $crDirectories->setLimit($limit); |
|
120 | - $crDirectories->setSort($sort); |
|
121 | - $crDirectories->setOrder($order); |
|
122 | - return $crDirectories; |
|
123 | - } |
|
107 | + /** |
|
108 | + * Get Criteria Directories |
|
109 | + * @param $crDirectories |
|
110 | + * @param int $start |
|
111 | + * @param int $limit |
|
112 | + * @param string $sort |
|
113 | + * @param string $order |
|
114 | + * @return int |
|
115 | + */ |
|
116 | + private function getDirectoriesCriteria($crDirectories, $start, $limit, $sort, $order) |
|
117 | + { |
|
118 | + $crDirectories->setStart($start); |
|
119 | + $crDirectories->setLimit($limit); |
|
120 | + $crDirectories->setSort($sort); |
|
121 | + $crDirectories->setOrder($order); |
|
122 | + return $crDirectories; |
|
123 | + } |
|
124 | 124 | } |
@@ -33,61 +33,61 @@ discard block |
||
33 | 33 | */ |
34 | 34 | function b_wggithub_repositories_show($options) |
35 | 35 | { |
36 | - include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php'; |
|
37 | - $myts = MyTextSanitizer::getInstance(); |
|
38 | - $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
39 | - $block = []; |
|
40 | - $typeBlock = $options[0]; |
|
41 | - $limit = $options[1]; |
|
42 | - $lenghtTitle = $options[2]; |
|
43 | - $helper = Helper::getInstance(); |
|
44 | - $repositoriesHandler = $helper->getHandler('Repositories'); |
|
45 | - $crRepositories = new \CriteriaCompo(); |
|
46 | - \array_shift($options); |
|
47 | - \array_shift($options); |
|
48 | - \array_shift($options); |
|
36 | + include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php'; |
|
37 | + $myts = MyTextSanitizer::getInstance(); |
|
38 | + $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
39 | + $block = []; |
|
40 | + $typeBlock = $options[0]; |
|
41 | + $limit = $options[1]; |
|
42 | + $lenghtTitle = $options[2]; |
|
43 | + $helper = Helper::getInstance(); |
|
44 | + $repositoriesHandler = $helper->getHandler('Repositories'); |
|
45 | + $crRepositories = new \CriteriaCompo(); |
|
46 | + \array_shift($options); |
|
47 | + \array_shift($options); |
|
48 | + \array_shift($options); |
|
49 | 49 | |
50 | - switch ($typeBlock) { |
|
51 | - case 'last': |
|
52 | - default: |
|
53 | - // For the block: repositories last |
|
54 | - $crRepositories->setSort('repo_datecreated'); |
|
55 | - $crRepositories->setOrder('DESC'); |
|
56 | - break; |
|
57 | - case 'new': |
|
58 | - // For the block: repositories new |
|
59 | - $crRepositories->add(new \Criteria('repo_datecreated', \DateTime::createFromFormat(_SHORTDATESTRING), '>=')); |
|
60 | - $crRepositories->add(new \Criteria('repo_datecreated', \DateTime::createFromFormat(_SHORTDATESTRING) + 86400, '<=')); |
|
61 | - $crRepositories->setSort('repo_datecreated'); |
|
62 | - $crRepositories->setOrder('ASC'); |
|
63 | - break; |
|
64 | - case 'hits': |
|
65 | - // For the block: repositories hits |
|
66 | - $crRepositories->setSort('repo_hits'); |
|
67 | - $crRepositories->setOrder('DESC'); |
|
68 | - break; |
|
69 | - case 'top': |
|
70 | - // For the block: repositories top |
|
71 | - $crRepositories->setSort('repo_top'); |
|
72 | - $crRepositories->setOrder('ASC'); |
|
73 | - break; |
|
74 | - case 'random': |
|
75 | - // For the block: repositories random |
|
76 | - $crRepositories->setSort('RAND()'); |
|
77 | - break; |
|
78 | - } |
|
50 | + switch ($typeBlock) { |
|
51 | + case 'last': |
|
52 | + default: |
|
53 | + // For the block: repositories last |
|
54 | + $crRepositories->setSort('repo_datecreated'); |
|
55 | + $crRepositories->setOrder('DESC'); |
|
56 | + break; |
|
57 | + case 'new': |
|
58 | + // For the block: repositories new |
|
59 | + $crRepositories->add(new \Criteria('repo_datecreated', \DateTime::createFromFormat(_SHORTDATESTRING), '>=')); |
|
60 | + $crRepositories->add(new \Criteria('repo_datecreated', \DateTime::createFromFormat(_SHORTDATESTRING) + 86400, '<=')); |
|
61 | + $crRepositories->setSort('repo_datecreated'); |
|
62 | + $crRepositories->setOrder('ASC'); |
|
63 | + break; |
|
64 | + case 'hits': |
|
65 | + // For the block: repositories hits |
|
66 | + $crRepositories->setSort('repo_hits'); |
|
67 | + $crRepositories->setOrder('DESC'); |
|
68 | + break; |
|
69 | + case 'top': |
|
70 | + // For the block: repositories top |
|
71 | + $crRepositories->setSort('repo_top'); |
|
72 | + $crRepositories->setOrder('ASC'); |
|
73 | + break; |
|
74 | + case 'random': |
|
75 | + // For the block: repositories random |
|
76 | + $crRepositories->setSort('RAND()'); |
|
77 | + break; |
|
78 | + } |
|
79 | 79 | |
80 | - $crRepositories->setLimit($limit); |
|
81 | - $repositoriesAll = $repositoriesHandler->getAll($crRepositories); |
|
82 | - unset($crRepositories); |
|
83 | - if (\count($repositoriesAll) > 0) { |
|
84 | - foreach (\array_keys($repositoriesAll) as $i) { |
|
85 | - $block[$i]['name'] = $myts->htmlSpecialChars($repositoriesAll[$i]->getVar('repo_name')); |
|
86 | - $block[$i]['htmlurl'] = $myts->htmlSpecialChars($repositoriesAll[$i]->getVar('repo_htmlurl')); |
|
87 | - } |
|
88 | - } |
|
80 | + $crRepositories->setLimit($limit); |
|
81 | + $repositoriesAll = $repositoriesHandler->getAll($crRepositories); |
|
82 | + unset($crRepositories); |
|
83 | + if (\count($repositoriesAll) > 0) { |
|
84 | + foreach (\array_keys($repositoriesAll) as $i) { |
|
85 | + $block[$i]['name'] = $myts->htmlSpecialChars($repositoriesAll[$i]->getVar('repo_name')); |
|
86 | + $block[$i]['htmlurl'] = $myts->htmlSpecialChars($repositoriesAll[$i]->getVar('repo_htmlurl')); |
|
87 | + } |
|
88 | + } |
|
89 | 89 | |
90 | - return $block; |
|
90 | + return $block; |
|
91 | 91 | |
92 | 92 | } |
93 | 93 | |
@@ -98,32 +98,32 @@ discard block |
||
98 | 98 | */ |
99 | 99 | function b_wggithub_repositories_edit($options) |
100 | 100 | { |
101 | - include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php'; |
|
102 | - $helper = Helper::getInstance(); |
|
103 | - $repositoriesHandler = $helper->getHandler('Repositories'); |
|
104 | - $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
105 | - $form = _MB_WGGITHUB_DISPLAY; |
|
106 | - $form .= "<input type='hidden' name='options[0]' value='".$options[0]."' />"; |
|
107 | - $form .= "<input type='text' name='options[1]' size='5' maxlength='255' value='" . $options[1] . "' /> <br>"; |
|
108 | - $form .= _MB_WGGITHUB_TITLE_LENGTH . " : <input type='text' name='options[2]' size='5' maxlength='255' value='" . $options[2] . "' /><br><br>"; |
|
109 | - \array_shift($options); |
|
110 | - \array_shift($options); |
|
111 | - \array_shift($options); |
|
101 | + include_once XOOPS_ROOT_PATH . '/modules/wggithub/class/repositories.php'; |
|
102 | + $helper = Helper::getInstance(); |
|
103 | + $repositoriesHandler = $helper->getHandler('Repositories'); |
|
104 | + $GLOBALS['xoopsTpl']->assign('wggithub_upload_url', WGGITHUB_UPLOAD_URL); |
|
105 | + $form = _MB_WGGITHUB_DISPLAY; |
|
106 | + $form .= "<input type='hidden' name='options[0]' value='".$options[0]."' />"; |
|
107 | + $form .= "<input type='text' name='options[1]' size='5' maxlength='255' value='" . $options[1] . "' /> <br>"; |
|
108 | + $form .= _MB_WGGITHUB_TITLE_LENGTH . " : <input type='text' name='options[2]' size='5' maxlength='255' value='" . $options[2] . "' /><br><br>"; |
|
109 | + \array_shift($options); |
|
110 | + \array_shift($options); |
|
111 | + \array_shift($options); |
|
112 | 112 | |
113 | - $crRepositories = new \CriteriaCompo(); |
|
114 | - $crRepositories->add(new \Criteria('repo_id', 0, '!=')); |
|
115 | - $crRepositories->setSort('repo_id'); |
|
116 | - $crRepositories->setOrder('ASC'); |
|
117 | - $repositoriesAll = $repositoriesHandler->getAll($crRepositories); |
|
118 | - unset($crRepositories); |
|
119 | - $form .= _MB_WGGITHUB_REPOSITORIES_TO_DISPLAY . "<br><select name='options[]' multiple='multiple' size='5'>"; |
|
120 | - $form .= "<option value='0' " . (\in_array(0, $options) == false ? '' : "selected='selected'") . '>' . _MB_WGGITHUB_ALL_REPOSITORIES . '</option>'; |
|
121 | - foreach (\array_keys($repositoriesAll) as $i) { |
|
122 | - $repo_id = $repositoriesAll[$i]->getVar('repo_id'); |
|
123 | - $form .= "<option value='" . $repo_id . "' " . (\in_array($repo_id, $options) == false ? '' : "selected='selected'") . '>' . $repositoriesAll[$i]->getVar('repo_name') . '</option>'; |
|
124 | - } |
|
125 | - $form .= '</select>'; |
|
113 | + $crRepositories = new \CriteriaCompo(); |
|
114 | + $crRepositories->add(new \Criteria('repo_id', 0, '!=')); |
|
115 | + $crRepositories->setSort('repo_id'); |
|
116 | + $crRepositories->setOrder('ASC'); |
|
117 | + $repositoriesAll = $repositoriesHandler->getAll($crRepositories); |
|
118 | + unset($crRepositories); |
|
119 | + $form .= _MB_WGGITHUB_REPOSITORIES_TO_DISPLAY . "<br><select name='options[]' multiple='multiple' size='5'>"; |
|
120 | + $form .= "<option value='0' " . (\in_array(0, $options) == false ? '' : "selected='selected'") . '>' . _MB_WGGITHUB_ALL_REPOSITORIES . '</option>'; |
|
121 | + foreach (\array_keys($repositoriesAll) as $i) { |
|
122 | + $repo_id = $repositoriesAll[$i]->getVar('repo_id'); |
|
123 | + $form .= "<option value='" . $repo_id . "' " . (\in_array($repo_id, $options) == false ? '' : "selected='selected'") . '>' . $repositoriesAll[$i]->getVar('repo_name') . '</option>'; |
|
124 | + } |
|
125 | + $form .= '</select>'; |
|
126 | 126 | |
127 | - return $form; |
|
127 | + return $form; |
|
128 | 128 | |
129 | 129 | } |
@@ -27,34 +27,34 @@ |
||
27 | 27 | $moduleDirName = \basename(\dirname(__DIR__)); |
28 | 28 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
29 | 29 | return (object)[ |
30 | - 'name' => \mb_strtoupper($moduleDirName) . ' Module Configurator', |
|
31 | - 'paths' => [ |
|
32 | - 'dirname' => $moduleDirName, |
|
33 | - 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
34 | - 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
35 | - 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
36 | - 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
37 | - 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
38 | - ], |
|
39 | - 'uploadFolders' => [ |
|
40 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
41 | - ], |
|
42 | - 'copyBlankFiles' => [ |
|
43 | - ], |
|
44 | - 'copyTestFolders' => [ |
|
45 | - [XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads', |
|
46 | - XOOPS_UPLOAD_PATH . '/' . $moduleDirName], |
|
47 | - ], |
|
48 | - 'templateFolders' => [ |
|
49 | - '/templates/', |
|
50 | - ], |
|
51 | - 'oldFiles' => [ |
|
52 | - ], |
|
53 | - 'oldFolders' => [ |
|
54 | - ], |
|
55 | - 'renameTables' => [ |
|
56 | - ], |
|
57 | - 'moduleStats' => [ |
|
58 | - ], |
|
59 | - 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'><img src='" . XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/assets/images/logo/logoModule.png' alt='XOOPS Project'></a>", |
|
30 | + 'name' => \mb_strtoupper($moduleDirName) . ' Module Configurator', |
|
31 | + 'paths' => [ |
|
32 | + 'dirname' => $moduleDirName, |
|
33 | + 'admin' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/admin', |
|
34 | + 'modPath' => XOOPS_ROOT_PATH . '/modules/' . $moduleDirName, |
|
35 | + 'modUrl' => XOOPS_URL . '/modules/' . $moduleDirName, |
|
36 | + 'uploadPath' => XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
37 | + 'uploadUrl' => XOOPS_UPLOAD_URL . '/' . $moduleDirName, |
|
38 | + ], |
|
39 | + 'uploadFolders' => [ |
|
40 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName, |
|
41 | + ], |
|
42 | + 'copyBlankFiles' => [ |
|
43 | + ], |
|
44 | + 'copyTestFolders' => [ |
|
45 | + [XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . '/testdata/uploads', |
|
46 | + XOOPS_UPLOAD_PATH . '/' . $moduleDirName], |
|
47 | + ], |
|
48 | + 'templateFolders' => [ |
|
49 | + '/templates/', |
|
50 | + ], |
|
51 | + 'oldFiles' => [ |
|
52 | + ], |
|
53 | + 'oldFolders' => [ |
|
54 | + ], |
|
55 | + 'renameTables' => [ |
|
56 | + ], |
|
57 | + 'moduleStats' => [ |
|
58 | + ], |
|
59 | + 'modCopyright' => "<a href='https://xoops.org' title='XOOPS Project' target='_blank'><img src='" . XOOPS_ROOT_PATH . '/modules/' . $moduleDirName . "/assets/images/logo/logoModule.png' alt='XOOPS Project'></a>", |
|
60 | 60 | ]; |
@@ -45,38 +45,38 @@ |
||
45 | 45 | $GLOBALS['xoopsTpl']->assign('showItem', $rmId > 0); |
46 | 46 | |
47 | 47 | switch ($op) { |
48 | - case 'show': |
|
49 | - case 'list': |
|
50 | - default: |
|
51 | - $crReadmes = new \CriteriaCompo(); |
|
52 | - if ($rmId > 0) { |
|
53 | - $crReadmes->add(new \Criteria('rm_id', $rmId)); |
|
54 | - } |
|
55 | - $readmesCount = $readmesHandler->getCount($crReadmes); |
|
56 | - $GLOBALS['xoopsTpl']->assign('readmesCount', $readmesCount); |
|
57 | - $crReadmes->setStart($start); |
|
58 | - $crReadmes->setLimit($limit); |
|
59 | - $readmesAll = $readmesHandler->getAll($crReadmes); |
|
60 | - if ($readmesCount > 0) { |
|
61 | - $readmes = []; |
|
62 | - // Get All Readmes |
|
63 | - foreach (\array_keys($readmesAll) as $i) { |
|
64 | - $readmes[$i] = $readmesAll[$i]->getValuesReadmes(); |
|
65 | - $keywords[$i] = $readmesAll[$i]->getVar('rm_name'); |
|
66 | - } |
|
67 | - $GLOBALS['xoopsTpl']->assign('readmes', $readmes); |
|
68 | - unset($readmes); |
|
69 | - // Display Navigation |
|
70 | - if ($readmesCount > $limit) { |
|
71 | - include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
72 | - $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
73 | - $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
74 | - } |
|
75 | - $GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type')); |
|
76 | - $GLOBALS['xoopsTpl']->assign('divideby', $helper->getConfig('divideby')); |
|
77 | - $GLOBALS['xoopsTpl']->assign('numb_col', $helper->getConfig('numb_col')); |
|
78 | - } |
|
79 | - break; |
|
48 | + case 'show': |
|
49 | + case 'list': |
|
50 | + default: |
|
51 | + $crReadmes = new \CriteriaCompo(); |
|
52 | + if ($rmId > 0) { |
|
53 | + $crReadmes->add(new \Criteria('rm_id', $rmId)); |
|
54 | + } |
|
55 | + $readmesCount = $readmesHandler->getCount($crReadmes); |
|
56 | + $GLOBALS['xoopsTpl']->assign('readmesCount', $readmesCount); |
|
57 | + $crReadmes->setStart($start); |
|
58 | + $crReadmes->setLimit($limit); |
|
59 | + $readmesAll = $readmesHandler->getAll($crReadmes); |
|
60 | + if ($readmesCount > 0) { |
|
61 | + $readmes = []; |
|
62 | + // Get All Readmes |
|
63 | + foreach (\array_keys($readmesAll) as $i) { |
|
64 | + $readmes[$i] = $readmesAll[$i]->getValuesReadmes(); |
|
65 | + $keywords[$i] = $readmesAll[$i]->getVar('rm_name'); |
|
66 | + } |
|
67 | + $GLOBALS['xoopsTpl']->assign('readmes', $readmes); |
|
68 | + unset($readmes); |
|
69 | + // Display Navigation |
|
70 | + if ($readmesCount > $limit) { |
|
71 | + include_once XOOPS_ROOT_PATH . '/class/pagenav.php'; |
|
72 | + $pagenav = new \XoopsPageNav($readmesCount, $limit, $start, 'start', 'op=list&limit=' . $limit); |
|
73 | + $GLOBALS['xoopsTpl']->assign('pagenav', $pagenav->renderNav(4)); |
|
74 | + } |
|
75 | + $GLOBALS['xoopsTpl']->assign('type', $helper->getConfig('table_type')); |
|
76 | + $GLOBALS['xoopsTpl']->assign('divideby', $helper->getConfig('divideby')); |
|
77 | + $GLOBALS['xoopsTpl']->assign('numb_col', $helper->getConfig('numb_col')); |
|
78 | + } |
|
79 | + break; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | // Breadcrumbs |