Minahito
minah****@users*****
2006年 10月 12日 (木) 20:01:45 JST
Index: xoops2jp/html/modules/base/admin/actions/ActSearchAction.class.php diff -u xoops2jp/html/modules/base/admin/actions/ActSearchAction.class.php:1.1.2.10.2.1 xoops2jp/html/modules/base/admin/actions/ActSearchAction.class.php:1.1.2.10.2.2 --- xoops2jp/html/modules/base/admin/actions/ActSearchAction.class.php:1.1.2.10.2.1 Thu Sep 28 14:01:28 2006 +++ xoops2jp/html/modules/base/admin/actions/ActSearchAction.class.php Thu Oct 12 20:01:44 2006 @@ -2,7 +2,6 @@ if (!defined('XOOPS_ROOT_PATH')) exit(); -require_once XOOPS_BASE_PATH."/class/Legacy_ModuleAdapter.class.php"; require_once XOOPS_BASE_PATH."/admin/forms/ActionSearchForm.class.php"; class Legacy_ActionSearchArgs @@ -89,6 +88,7 @@ parent::Legacy_Action($flag); $this->mSearchAction =& new XCube_Delegate(); + $this->mSearchAction->add(array(&$this, 'defaultSearch')); $this->mSearchAction->register('Legacy_ActSearchAction.SearchAction'); } @@ -105,21 +105,24 @@ $perm = $db->prefix("group_permission"); $groups = implode(",", $xoopsUser->getGroups()); - $sql = "SELECT ${mod}.* FROM ${mod},${perm} " . - "WHERE ${mod}.mid=${perm}.gperm_itemid AND ${perm}.gperm_name='module_admin' AND ${perm}.gperm_groupid IN (${groups}) " . - "ORDER BY ${mod}.weight"; - - $result = $db->query($sql); - while ($row = $db->fetchArray($result)) { - $xoopsModule =& new XoopsModule(); - $xoopsModule->assignVars($row); - - $adapter =& new Legacy_ModuleAdapter($xoopsModule); - $adapter->prepareAdmin($controller); + // + // FIXME ActiveCheck + // +// $sql = "SELECT ${mod}.* FROM ${mod},${perm} " . +// "WHERE ${perm}.gperm_modid=1 AND ${mod}.mid=${perm}.gperm_itemid AND ${perm}.gperm_name='module_admin' AND ${perm}.gperm_groupid IN (${groups}) " . +// "ORDER BY ${mod}.weight"; + + $handler =& xoops_gethandler('groupperm'); + $midArr = $handler->getItemIds('module_admin', $xoopsUser->getGroups()); + + $handler =& xoops_gethandler('module'); + foreach ($midArr as $mid) { + $module =& $handler->get($mid); + $adapter =& new Legacy_ModuleAdapter($module); // FIXMED $this->mModules[] =& $adapter; - - unset($xoopsModule); + + unset($module); unset($adapter); } } @@ -153,6 +156,13 @@ } } + function defaultSearch(&$searchArgs) + { + foreach (array_keys($this->mModules) as $key) { + $this->mModules[$key]->searchAction($searchArgs); + } + } + function execute(&$controller, &$xoopsUser) { return $this->getDefaultView($controller, $xoopsUser);