servermgrv2 init...

This commit is contained in:
최준흠git config git config --helpgit config --global user.name 최준흠 2023-08-05 08:02:30 +09:00
parent 49d53fb635
commit 56fab113b1
2 changed files with 10 additions and 10 deletions

View File

@ -10,7 +10,7 @@ use Psr\Log\LoggerInterface;
class BoardController extends FrontController class BoardController extends FrontController
{ {
private $_category_uid = null; private $_category = null;
private $_categoryModel = null; private $_categoryModel = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{ {
@ -69,8 +69,8 @@ class BoardController extends FrontController
//Insert관련 //Insert관련
protected function insert_form_process() protected function insert_form_process()
{ {
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다."); $this->_category = $this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]); $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
//사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인 //사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인
if (!isRole_CommonHelper( if (!isRole_CommonHelper(
$this->_viewDatas['currentRoles'], $this->_viewDatas['currentRoles'],
@ -83,8 +83,8 @@ class BoardController extends FrontController
} }
protected function insert_process() protected function insert_process()
{ {
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다."); $this->_category = $this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]); $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
//사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인 //사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인
if (!isRole_CommonHelper( if (!isRole_CommonHelper(
$this->_viewDatas['currentRoles'], $this->_viewDatas['currentRoles'],
@ -180,8 +180,8 @@ class BoardController extends FrontController
//Index관련 //Index관련
protected function index_process() protected function index_process()
{ {
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다."); $this->_category = $this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]); $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
//사용자가 Category에서 해당 게시판의 ACCESS권한이 있는지 확인 //사용자가 Category에서 해당 게시판의 ACCESS권한이 있는지 확인
if (!isRole_CommonHelper( if (!isRole_CommonHelper(
$this->_viewDatas['currentRoles'], $this->_viewDatas['currentRoles'],
@ -195,7 +195,7 @@ class BoardController extends FrontController
//Category 및 Status 조건추가 //Category 및 Status 조건추가
protected function index_setCondition() protected function index_setCondition()
{ {
$this->_model->where("category_uid", $this->_viewDatas['category']->getPrimaryKey()); $this->_model->where("category", $this->_viewDatas['category']->getPrimaryKey());
$this->_model->where("status", DEFAULTS['STATUS']); $this->_model->where("status", DEFAULTS['STATUS']);
parent::index_setCondition(); parent::index_setCondition();
} }

View File

@ -1,6 +1,6 @@
<div class="accordion-item"> <div class="accordion-item">
<h2><a href="/front/board?category_uid=3"><?= CLASS_ICONS['BOARD'] ?>공지사항</a></h2> <h2><a href="/front/board?category=3"><?= CLASS_ICONS['BOARD'] ?>공지사항</a></h2>
</div> </div>
<div class="accordion-item"> <div class="accordion-item">
<h2><a href="/front/board?category_uid=4"><?= CLASS_ICONS['BOARD'] ?>FAQ</a></h2> <h2><a href="/front/board?category=4"><?= CLASS_ICONS['BOARD'] ?>FAQ</a></h2>
</div> </div>