Minahito
minah****@users*****
2006年 1月 29日 (日) 00:49:28 JST
Index: xoops2jp/html/modules/base/admin/actions/SmilesEditAction.class.php diff -u /dev/null xoops2jp/html/modules/base/admin/actions/SmilesEditAction.class.php:1.1.2.1 --- /dev/null Sun Jan 29 00:49:28 2006 +++ xoops2jp/html/modules/base/admin/actions/SmilesEditAction.class.php Sun Jan 29 00:49:28 2006 @@ -0,0 +1,62 @@ +<?php + +require_once XOOPS_MODULE_PATH . "/base/class/AbstractEditAction.class.php"; +require_once XOOPS_MODULE_PATH . "/base/admin/forms/SmilesAdminEditForm.class.php"; + +class Legacy_SmilesEditAction extends Legacy_AbstractEditAction +{ + function _getId() + { + return isset($_REQUEST['id']) ? $_REQUEST['id'] : 0; + } + + function &_getHandler() + { + $handler =& xoops_getmodulehandler('smiles'); + return $handler; + } + + function _setupActionForm() + { + $this->mActionForm =& new Legacy_SmilesAdminEditForm(); + $this->mActionForm->prepare(); + } + + + function _doExecute() + { + if ($this->mActionForm->mFormFile != null) { + if (!$this->mActionForm->mFormFile->saveAs(XOOPS_UPLOAD_PATH)) { + return false; + } + } + + // + // 古いファイルがあれば削る + // + if ($this->mActionForm->mOldAvatarFilename != null && $this->mActionForm->mOldAvatarFilename != "blank.gif") { + @unlink(XOOPS_UPLOAD_PATH . "/" . $this->mActionForm->mOldAvatarFilename); + } + + return parent::_doExecute(); + } + + function executeViewInput(&$controller, &$xoopsUser, &$render) + { + $render->setTemplateName("smiles_edit.html"); + $render->setAttribute('actionForm', $this->mActionForm); + $render->setAttribute('object', $this->mObject); + } + + function executeViewSuccess(&$controller, &$xoopsUser, &$render) + { + $controller->executeForward("./index.php?action=SmilesList"); + } + + function executeViewError(&$controller, &$xoopsUser, &$render) + { + redirect_header("./index.php?action=SmilesList", 1, _AD_BASE_ERROR_DBUPDATE_FAILED); + } +} + +?> Index: xoops2jp/html/modules/base/admin/actions/SmilesDeleteAction.class.php diff -u /dev/null xoops2jp/html/modules/base/admin/actions/SmilesDeleteAction.class.php:1.1.2.1 --- /dev/null Sun Jan 29 00:49:28 2006 +++ xoops2jp/html/modules/base/admin/actions/SmilesDeleteAction.class.php Sun Jan 29 00:49:28 2006 @@ -0,0 +1,43 @@ +<?php + +require_once XOOPS_MODULE_PATH . "/base/class/AbstractDeleteAction.class.php"; +require_once XOOPS_MODULE_PATH . "/base/admin/forms/SmilesAdminDeleteForm.class.php"; + +class Legacy_SmilesDeleteAction extends Legacy_AbstractDeleteAction +{ + function _getId() + { + return isset($_REQUEST['id']) ? $_REQUEST['id'] : 0; + } + + function &_getHandler() + { + $handler =& xoops_getmodulehandler('smiles'); + return $handler; + } + + function _setupActionForm() + { + $this->mActionForm =& new Legacy_SmilesAdminDeleteForm(); + $this->mActionForm->prepare(); + } + + function executeViewInput(&$controller, &$xoopsUser, &$render) + { + $render->setTemplateName("smiles_delete.html"); + $render->setAttribute('actionForm', $this->mActionForm); + $render->setAttribute('object', $this->mObject); + } + + function executeViewSuccess(&$controller, &$xoopsUser, &$render) + { + $controller->executeForward("./index.php?action=SmilesList"); + } + + function executeViewError(&$controller, &$xoopsUser, &$render) + { + redirect_header("./index.php?action=SmilesList", 1, _AD_BASE_ERROR_DBUPDATE_FAILED); + } +} + +?> Index: xoops2jp/html/modules/base/admin/actions/SmilesListAction.class.php diff -u /dev/null xoops2jp/html/modules/base/admin/actions/SmilesListAction.class.php:1.1.2.1 --- /dev/null Sun Jan 29 00:49:28 2006 +++ xoops2jp/html/modules/base/admin/actions/SmilesListAction.class.php Sun Jan 29 00:49:28 2006 @@ -0,0 +1,34 @@ +<?php + +require_once XOOPS_MODULE_PATH . "/base/class/PageNavigator.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/AbstractListAction.class.php"; +require_once XOOPS_MODULE_PATH . "/base/admin/forms/SmilesFilterForm.class.php"; + +class Legacy_SmilesListAction extends Legacy_AbstractListAction +{ + function &_getHandler() + { + $handler =& xoops_getmodulehandler('smiles'); + return $handler; + } + + function &_getFilterForm(&$navi) + { + $filter =& new Legacy_SmilesFilterForm($navi); + return $filter; + } + + function _getBaseUrl() + { + return "./index.php?action=SmilesList"; + } + + function executeViewIndex(&$controller, &$xoopsUser, &$render) + { + $render->setTemplateName("smiles_list.html"); + $render->setAttribute("objects", $this->mObjects); + $render->setAttribute("pageNavi", $this->mNavi); + } +} + +?>