22 public $mpageArr = [5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 70, 80, 90, 100, 0];
24 public function &_getHandler()
26 $handler =& xoops_getmodulehandler(
'newblocks');
30 public function &_getPageNavi()
32 $navi =
new XCube_PageNavigator($this->_getBaseUrl(), XCUBE_PAGENAVI_START | XCUBE_PAGENAVI_PERPAGE);
34 $root =& XCube_Root::getSingleton();
35 $perpage = $root->mContext->mRequest->getRequest($navi->mPrefix.
'perpage');
37 if (isset($perpage) && 0 == (
int)$perpage) {
43 public function &_getFilterForm()
49 public function _getBaseUrl()
51 return './index.php?action=BlockInstallList';
54 public function executeViewIndex(&$controller, &$xoopsUser, &$render)
56 $render->setTemplateName(
'blockinstall_list.html');
61 foreach (array_keys($this->mObjects) as $key) {
62 $this->mObjects[$key]->loadModule();
67 foreach ($mods as $mod) {
70 $sadmin = $moduleperm_handler->checkRight(
'module_admin', $mod->getVar(
'mid'), $xoopsUser->getGroups());
71 if ($sadmin && ($mod->getVar(
'hasnotification') || is_array($mod->getInfo(
'config')) || is_array($mod->getInfo(
'comments')))) {
72 $rtn[
'link'] = XOOPS_URL .
'/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar(
'mid');
73 $rtn[
'title'] = htmlspecialchars($mod->name(), ENT_QUOTES);
75 $rtn[
'icon'] = XOOPS_ADMINTHEME_URL .
'/icons/prefs_small.png';
79 $render->setAttribute(
'objects', $this->mObjects);
80 $render->setAttribute(
'pageNavi', $this->mFilter->mNavi);
81 $moduleHandler =& xoops_gethandler(
'module');
82 $modules =& $moduleHandler->getObjects(
new Criteria(
'isactive', 1));
83 $render->setAttribute(
'modules', $modules);
84 $render->setAttribute(
'filterForm', $this->mFilter);
85 $render->setAttribute(
'pageArr', $this->mpageArr);
87 $block_handler =& $this->_getHandler();
88 $block_total = $block_handler->getCount();
89 $inactive_block_total = $block_handler->getCount(
new Criteria(
'isactive', 0));
90 $active_block_total = $block_total-$inactive_block_total;
91 $render->setAttribute(
'BlockTotal', $block_total);
92 $render->setAttribute(
'ActiveBlockTotal', $active_block_total);
93 $render->setAttribute(
'InactiveBlockTotal', $inactive_block_total);
96 $active_installed_criteria->add(
new Criteria(
'isactive', 1));
97 $active_installed_block_total = $block_handler->getCount($active_installed_criteria);
98 $render->setAttribute(
'ActiveInstalledBlockTotal', $active_installed_block_total);
99 $render->setAttribute(
'ActiveUninstalledBlockTotal', $active_block_total - $active_installed_block_total);
102 $inactive_installed_criteria->add(
new Criteria(
'isactive', 0));
103 $inactive_installed_block_total = $block_handler->getCount($inactive_installed_criteria);
104 $render->setAttribute(
'InactiveInstalledBlockTotal', $inactive_installed_block_total);
105 $render->setAttribute(
'InactiveUninstalledBlockTotal', $inactive_block_total - $inactive_installed_block_total);