<?php
/**
@brief STATUS 登録時の確認 & CSRF ガード
@author minahito
@version $Id: status_confirm.php,v 1.1 2004/07/26 10:29:01 minahito Exp $
*/

$xoopsOption['nocommon']=true;
include_once "../../../mainfile.php";
require_once XOOPS_ROOT_PATH."/modules/exFrame/frameloader.php";
require_once "../class/global.php";

// Form を読み込む
include_once "exComponent/Preview.php";

// Session からの復元に必要
require_once "./include/AdminStatusEditForm.php";
include_once "../class/status.php";

// session_start
include_once XOOPS_ROOT_PATH."/include/common.php";
include XOOPS_ROOT_PATH."/include/cp_header.php";

$compo = new exPreviewComponent(null,null,'edit_status');

switch($ret=$compo->init()) {
	case COMPONENT_INIT_FAIL:
		die;
		break;

	case ACTIONFORM_POST_SUCCESS:
		$handler=bxParty::getHandler("status");
		$editform=&Session::get($compo->name_);
		$editform->data_->setDirty();
		if($handler->insert($editform->data_)) {
			Session::unregister($compo->name_);
			redirect_header("./status_list.php", 1, _MD_A_BXPARTY_DB_SUCCESS);
		}
		else {
			print _MD_A_BXPARTY_DB_FAIL;
		}
		break;

	case ACTIONFORM_INIT_FAIL:
	case ACTIONFORM_INIT_SUCCESS:
	case COMPONENT_INIT_SUCCESS:
		xoops_cp_header();
		$compo->display();
		xoops_cp_footer();
		break;
}

?>