Minahito
minah****@users*****
2006年 1月 14日 (土) 22:19:13 JST
Index: xoops2jp/html/modules/legacyRender/admin/actions/TplsetListAction.class.php diff -u xoops2jp/html/modules/legacyRender/admin/actions/TplsetListAction.class.php:1.1.2.4 xoops2jp/html/modules/legacyRender/admin/actions/TplsetListAction.class.php:1.1.2.5 --- xoops2jp/html/modules/legacyRender/admin/actions/TplsetListAction.class.php:1.1.2.4 Sat Jan 14 21:22:34 2006 +++ xoops2jp/html/modules/legacyRender/admin/actions/TplsetListAction.class.php Sat Jan 14 22:19:13 2006 @@ -3,9 +3,19 @@ require_once XOOPS_ROOT_PATH . "/class/XCube_PageNavigator.class.php"; require_once XOOPS_MODULE_PATH . "/legacyRender/admin/class/AbstractListAction.class.php"; require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetFilterForm.class.php"; +require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetSelectForm.class.php"; class LegacyRender_TplsetListAction extends LegacyRender_AbstractListAction { + var $mActionForm = null; + var $mActiveTemplateSet = null; + + function prepare(&$controller, &$xoopsUser) + { + $this->mActionForm = new TplsetSelectForm(); + $this->mActionForm->prepare(); + } + function &_getHandler() { $handler =& xoops_getmodulehandler('tplset'); @@ -22,6 +32,28 @@ { return "./index.php?action=TplsetList"; } + + function execute(&$controller, &$xoopsUser) + { + $this->mActionForm->fetch(); + $this->mActionForm->validate(); + if (!$this->mActionForm->hasError()) { + $configHandler =& xoops_gethandler('config'); + + $criteria =& new CriteriaCompo(); + $criteria->add(new Criteria('conf_name', 'template_set')); + $criteria->add(new Criteria('conf_catid', XOOPS_CONF)); + + $configs =& $configHandler->getConfigs($criteria); + if (count($configs) > 0) { + $configs[0]->setVar('conf_value', $this->mActionForm->get('tplset_name')); + $configHandler->insertConfig($configs[0]); + $this->mActiveTemplateSet = $this->mActionForm->get('tplset_name'); + } + } + + return $this->getDefaultView(&$controller, &$xoopsUser); + } function executeViewIndex(&$controller, &$xoopsUser, &$render) { @@ -32,10 +64,15 @@ $this->mObjects[$key]->loadModuletpl(); } + if ($this->mActiveTemplateSet == null) { + $this->mActiveTemplateSet = $controller->getConfig('template_set'); + } + $render->setTemplateName("tplset_list.html"); $render->setAttribute('objects', $this->mObjects); $render->setAttribute('pageNavi', $this->mPageNavi); - $render->setAttribute('activeTemplateSet', $controller->getConfig('template_set')); + $render->setAttribute('activeTemplateSet', $this->mActiveTemplateSet); + $render->setAttribute('actionForm', $this->mActionForm); } }