Minahito
minah****@users*****
2005年 12月 1日 (木) 21:41:50 JST
Index: xoops2jp/html/modules/base/admin/actions/LegacyModuleInfoAction.class.php diff -u /dev/null xoops2jp/html/modules/base/admin/actions/LegacyModuleInfoAction.class.php:1.1.2.1 --- /dev/null Thu Dec 1 21:41:50 2005 +++ xoops2jp/html/modules/base/admin/actions/LegacyModuleInfoAction.class.php Thu Dec 1 21:41:50 2005 @@ -0,0 +1,64 @@ +<?php +/** + * @version $Id: LegacyModuleInfoAction.class.php,v 1.1.2.1 2005/12/01 12:41:50 minahito Exp $ + */ + +/** + * This action will show the information of a module specified to user. + */ +class LegacyModuleInfoAction extends LegacyAdminAction +{ + /** + * XoopsModule instance specified. + */ + var $mModuleObject=null; + + function getDefaultView(&$controller,&$xoopsUser) + { + $dirname=$_GET['dirname']; + if(!preg_match("/^[a-z\_]+$/i",$dirname)) { + die($dirname); + return LEGACY_ADMIN_FRAME_VIEW_ERROR; + } + + if(!is_dir(XOOPS_MODULE_PATH."/".$dirname)) { + return LEGACY_ADMIN_FRAME_VIEW_ERROR; + } + + $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)) { + $this->mModuleObject->loadAdminMenu(); + $this->mModuleObject->loadInfo($dirname); + return LEGACY_ADMIN_FRAME_VIEW_SUCCESS; + } + + $this->mModuleObject=&$moduleHandler->create(); + $this->mModuleObject->loadInfoAsVar($dirname); + + return LEGACY_ADMIN_FRAME_VIEW_INPUT; + } + + function executeViewSuccess(&$controller,&$xoopsUser,&$renderer) + { + $renderer->setTemplateName("legacy_admin_inst_moduleinfo.html"); + $renderer->setAttribute('module',$this->mModuleObject); + } + + function executeViewInput(&$controller,&$xoopsUser,&$renderer) + { + $renderer->setTemplateName("legacy_admin_uninst_moduleinfo.html"); + $renderer->setAttribute('module',$this->mModuleObject); + } + + function executeViewError(&$controller,&$xoopsUser,&$renderer) + { + XCube_Utils::redirectHeader('./index.php?action=ModuleList',1,"*ERROR*"); + } +} + +?> \ No newline at end of file