"", "result" => "", "table" => "", "form" => "", ); //---------------------------- // request parameter //---------------------------- $qID = isset($_REQUEST["q_id"]) ? $_REQUEST["q_id"] : REQ_NON; $qViewMode = isset($_REQUEST["q_view_mode"]) ? $_REQUEST["q_view_mode"] : REQ_NON; $qViewReply = isset($_REQUEST["q_view_reply"]) ? $_REQUEST["q_view_reply"] : REQ_NON; $qOrder = isset($_REQUEST["q_order"]) ? $_REQUEST["q_order"] : REQ_NON; //---------------------------- // judge post //---------------------------- //---------------------------- // set types //---------------------------- Util::setType($qID, "int"); Util::setType($qViewMode, "int"); Util::setType($qViewReply, "int"); Util::setType($qOrder, "int"); //---------------------------- // Auth-Before validate //---------------------------- if ( $result === RES_OK ){ if ( ! Validate::isNumeric($qID) ){ $result = RES_NG; $gResult->push("{$WORD($wk, 1)}"); } } //---------------------------- // Auth //---------------------------- if ( $result === RES_OK ){ $auth = Auth::instance("bbs"); if ( ! $auth->read($qID) ){ $result = RES_NG; $gResult->push("{$WORD($wk, 2)}"); } } //---------------------------- // Auth-After validate //---------------------------- if ( $result === RES_OK ){ if ( ! Validate::inKeyArray($qViewMode, View_system_bbs_post::VIEW_MODE_TABLE()) ){ $qViewMode = INIT_VIEW_MODE; } if ( ! Validate::inKeyArray($qViewReply, View_system_bbs_post::VIEW_REPLY_TABLE()) ){ $qViewReply = INIT_VIEW_REPLY; } if ( ! Validate::inKeyArray($qOrder, View_system_bbs_post::ORDER_TABLE()) ){ $qOrder = INIT_ORDER; } } //---------------------------- // function //---------------------------- //---------------------------- // process //---------------------------- if ( $result === RES_OK ){ DAO::begin(); $objDAOBbs = DAO::instance("bbs"); $objDAOBbsPost = DAO::instance("bbs_post"); $objViewBbsPost = View::instance("system_bbs_post"); // 掲示板 -------------------- if ( $result === RES_OK ){ $objDAOBbs->setAuth($auth); $resDAOBbs = $objDAOBbs->get($qID, DAO::T_BBS_PROJECT_ID_SYSTEM); $result = $resDAOBbs["result"]; if ( $result === RES_OK ){ // } else if ( $result === RES_NO_DATA ){ $gResult->push("{$WORD($wk, 3)}"); } else { $gResult->push("{$WORD($wk, 4)}"); } } // 投稿一覧 -------------------- if ( $result === RES_OK ){ $resDAOBbsPost = $objDAOBbsPost->get(NULL, $qID); $result = $resDAOBbsPost["result"]; if ( $result === RES_OK ){ $arrHtml["table"] = Printer::alert( FALSE, "{$WORD($wk, 5)}" ); $arrHtml["table"] .= $objViewBbsPost->thread("bbs-post", TRUE, $qOrder, $resDAOBbsPost["data"]); $arrHtml["table"] .= $objViewBbsPost->threadDropdown(); } else if ( $result === RES_NO_DATA ){ $gResult->push("{$WORD($wk, 6)}"); } else { $gResult->push("{$WORD($wk, 7)}"); } } DAO::end($result); } //---------------------------- // html //---------------------------- { // menu ---------------------------------------------------------------- if ( $result !== RES_NG ){ $arrMenu = array(); //----- $arrMenu[0] = $objViewBbsPost->tab_list($auth, NULL, $qID, $qViewMode, $qViewReply, $qOrder); $arrMenu[1] = $objViewBbsPost->tab(View_system_bbs_post::TAB_NEW, $auth, NULL, $qID); //----- $arrHtml["menu"] = Printer::menuTab($arrMenu, 0); } // title --------------------------------------------------------------- $title = "{$WORD($wk, 8)}"; // form ---------------------------------------------------------------- if ( $result !== RES_NG ){ $arrControl = array(); $arrAction = array(); $arrControl[] = array( "id" => NULL, "name" => NULL, "form" => Printer::input("hidden", "q_id", "q_id", $qID), ); $arrControl[] = array( "id" => NULL, "name" => NULL, "form" => Printer::input("hidden", "q_view_mode", "q_view_mode", $qViewMode), ); $arrControl[] = array( "id" => NULL, "name" => NULL, "form" => Printer::input("hidden", "q_view_reply", "q_view_reply", $qViewReply), ); $arrControl[] = array( "id" => NULL, "name" => NULL, "form" => Printer::input("hidden", "q_order", "q_order", $qOrder), ); $arrHtml["form"] = Printer::form("form_bbs_search", "form_bbs_serach", "./detail.html", "get", $arrControl, $arrAction); } else { // アクション(OK) $arrHtml["form"] = Printer::link("OK", "btn btn-default", NULL, NULL, "/content/bbs_system/"); } // result -------------------------------------------------------------- $arrHtml["result"] = $gResult->string(TRUE, $result); } ?>