Minahito
minah****@users*****
2005年 12月 21日 (水) 13:08:12 JST
Index: xoops2jp/html/modules/base/admin/actions/LegacyModuleInfoAction.class.php diff -u xoops2jp/html/modules/base/admin/actions/LegacyModuleInfoAction.class.php:1.1.2.1 xoops2jp/html/modules/base/admin/actions/LegacyModuleInfoAction.class.php:1.1.2.2 --- xoops2jp/html/modules/base/admin/actions/LegacyModuleInfoAction.class.php:1.1.2.1 Thu Dec 1 21:41:50 2005 +++ xoops2jp/html/modules/base/admin/actions/LegacyModuleInfoAction.class.php Wed Dec 21 13:08:12 2005 @@ -1,6 +1,6 @@ <?php /** - * @version $Id: LegacyModuleInfoAction.class.php,v 1.1.2.1 2005/12/01 12:41:50 minahito Exp $ + * @version $Id: LegacyModuleInfoAction.class.php,v 1.1.2.2 2005/12/21 04:08:12 minahito Exp $ */ /** @@ -11,53 +11,50 @@ /** * XoopsModule instance specified. */ - var $mModuleObject=null; + var $mModuleObject = null; + var $mInstalledFlag = false; - function getDefaultView(&$controller,&$xoopsUser) + function getDefaultView(&$controller, &$xoopsUser) { - $dirname=$_GET['dirname']; - if(!preg_match("/^[a-z\_]+$/i",$dirname)) { - die($dirname); + $dirname = $_GET['dirname']; + if (!preg_match("/^[a-z\_]+$/i", $dirname)) { return LEGACY_ADMIN_FRAME_VIEW_ERROR; } - if(!is_dir(XOOPS_MODULE_PATH."/".$dirname)) { + if (!is_dir(XOOPS_MODULE_PATH . "/" . $dirname)) { return LEGACY_ADMIN_FRAME_VIEW_ERROR; } - $moduleHandler=&xoops_gethandler('module'); - $this->mModuleObject=&$moduleHandler->getByDirname($dirname); + $moduleHandler =& xoops_gethandler('module'); + $this->mModuleObject =& $moduleHandler->getByDirname($dirname); // // If a module is installed, load modinfo and go to special displaying. // - if(is_object($this->mModuleObject)) { + if (is_object($this->mModuleObject)) { $this->mModuleObject->loadAdminMenu(); $this->mModuleObject->loadInfo($dirname); - return LEGACY_ADMIN_FRAME_VIEW_SUCCESS; + $this->mInstalledFlag = true; + } + else { + $this->mModuleObject =& $moduleHandler->create(); + $this->mModuleObject->loadInfoAsVar($dirname); + $this->mInstalledFlag = false; } - $this->mModuleObject=&$moduleHandler->create(); - $this->mModuleObject->loadInfoAsVar($dirname); - - return LEGACY_ADMIN_FRAME_VIEW_INPUT; + return LEGACY_ADMIN_FRAME_VIEW_SUCCESS; } - function executeViewSuccess(&$controller,&$xoopsUser,&$renderer) - { - $renderer->setTemplateName("legacy_admin_inst_moduleinfo.html"); - $renderer->setAttribute('module',$this->mModuleObject); - } - - function executeViewInput(&$controller,&$xoopsUser,&$renderer) + function executeViewSuccess(&$controller, &$xoopsUser, &$renderer) { - $renderer->setTemplateName("legacy_admin_uninst_moduleinfo.html"); - $renderer->setAttribute('module',$this->mModuleObject); + $renderer->setTemplateName("module_information.html"); + $renderer->setAttribute('module', $this->mModuleObject); + $renderer->setAttribute('installed', $this->mInstalledFlag); } - function executeViewError(&$controller,&$xoopsUser,&$renderer) + function executeViewError(&$controller, &$xoopsUser, &$renderer) { - XCube_Utils::redirectHeader('./index.php?action=ModuleList',1,"*ERROR*"); + XCube_Utils::redirectHeader('./index.php?action=ModuleList', 1, "*Module not found*"); } }