servermgrv2 init...
This commit is contained in:
parent
23a9977c93
commit
dbe7393bbd
@ -150,13 +150,13 @@ abstract class BaseController extends Controller
|
||||
//Insert관련
|
||||
protected function insert_form_process()
|
||||
{
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
}
|
||||
public function insert_form()
|
||||
{
|
||||
try {
|
||||
$this->_viewDatas = $this->init(__FUNCTION__);
|
||||
$this->insert_form_process();
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
helper(['form']);
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view($this->_viewPath . '/insert', ['viewDatas' => $this->_viewDatas]);
|
||||
@ -209,6 +209,7 @@ abstract class BaseController extends Controller
|
||||
//Update관련
|
||||
protected function update_form_process($entity)
|
||||
{
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
return $entity;
|
||||
}
|
||||
public function update_form($uid)
|
||||
@ -217,7 +218,6 @@ abstract class BaseController extends Controller
|
||||
$this->_viewDatas = $this->init(__FUNCTION__);
|
||||
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
$this->_viewDatas['entity'] = $this->update_form_process($entity);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
helper(['form']);
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view($this->_viewPath . '/update', ['viewDatas' => $this->_viewDatas]);
|
||||
@ -278,6 +278,7 @@ abstract class BaseController extends Controller
|
||||
$entity->$titleField = "RE: " . $entity->$titleField;
|
||||
$contentField = $this->_model->getContentField();
|
||||
$entity->$contentField .= "\n----------------------------------------------\n";
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
return $entity;
|
||||
}
|
||||
public function reply_form($uid)
|
||||
@ -287,7 +288,6 @@ abstract class BaseController extends Controller
|
||||
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
$this->_viewDatas['entity'] = $this->reply_form_process($entity);
|
||||
helper(['form']);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view($this->_viewPath . '/reply', ['viewDatas' => $this->_viewDatas]);
|
||||
} catch (\Exception $e) {
|
||||
@ -449,6 +449,7 @@ abstract class BaseController extends Controller
|
||||
//View 관련
|
||||
protected function view_process($entity)
|
||||
{
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
return $entity;
|
||||
}
|
||||
public function view($uid)
|
||||
@ -458,7 +459,6 @@ abstract class BaseController extends Controller
|
||||
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
$this->_viewDatas['entity'] = $this->view_process($entity);
|
||||
helper(['form']);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view($this->_viewPath . '/view', ['viewDatas' => $this->_viewDatas]);
|
||||
} catch (\Exception $e) {
|
||||
@ -469,6 +469,7 @@ abstract class BaseController extends Controller
|
||||
//Index 관련
|
||||
protected function index_process()
|
||||
{
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
}
|
||||
protected function index_setCondition()
|
||||
{
|
||||
@ -524,10 +525,10 @@ abstract class BaseController extends Controller
|
||||
{
|
||||
try {
|
||||
$this->_viewDatas = $this->init(__FUNCTION__);
|
||||
$this->index_process();
|
||||
foreach ($this->_viewDatas['fieldFilters'] as $field) {
|
||||
$this->_viewDatas[$field] = $this->request->getVar($field) ?: DEFAULTS['EMPTY'];
|
||||
}
|
||||
$this->index_process();
|
||||
//Totalcount 처리
|
||||
$this->index_setCondition();
|
||||
$this->_viewDatas['total_count'] = $this->_model->countAllResults();
|
||||
@ -551,7 +552,6 @@ abstract class BaseController extends Controller
|
||||
// log_message("debug", __METHOD__ . "에서 findAll 호출:" . $this->_model->getLastQuery());
|
||||
//setting return_url to session flashdata
|
||||
helper(['form']);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
$this->_session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: "");
|
||||
return view($this->_viewPath . '/index', ['viewDatas' => $this->_viewDatas]);
|
||||
} catch (\Exception $e) {
|
||||
|
||||
@ -64,7 +64,17 @@ class BoardController extends FrontController
|
||||
{
|
||||
//권한체크
|
||||
$this->isRole('insert');
|
||||
return parent::insert_form_process();
|
||||
parent::insert_form_process();
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
|
||||
'category_uid' => $this->_category,
|
||||
'category' => $this->_category
|
||||
]];
|
||||
}
|
||||
protected function insert_process()
|
||||
{
|
||||
//권한체크
|
||||
$this->isRole('insert');
|
||||
return parent::insert_process();
|
||||
}
|
||||
//Update관련
|
||||
protected function update_form_process($entity)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user