diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php
index 1c19550..bcba7ef 100644
--- a/app/Controllers/Front/BoardController.php
+++ b/app/Controllers/Front/BoardController.php
@@ -18,8 +18,6 @@ class BoardController extends FrontController
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
helper($this->_viewDatas['className']);
- // echo var_export($this->_viewDatas['layout'], true);
- // exit;
}
public function getFields(string $action = ""): array
{
@@ -46,28 +44,17 @@ class BoardController extends FrontController
return parent::getFieldBatchFilters();
}
- //권한체크
- protected function isRole($action)
- {
- $this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
- parent::isRole($action);
- }
-
//Insert관련
protected function insert_form_process()
{
//권한체크
- $this->isRole('insert');
+ $this->isRole('isaccess');
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');
+ $this->isRole('iswrite');
return parent::insert_process();
}
//Update관련
@@ -77,13 +64,7 @@ class BoardController extends FrontController
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->user_uid != $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
}
- //권한체크
- $this->isRole('update');
- $entity = parent::update_form_process($entity);
- $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
- 'category' => $this->_category
- ]];
- return $entity;
+ return parent::update_form_process($entity);
}
protected function update_process($entity)
{
@@ -97,13 +78,8 @@ class BoardController extends FrontController
protected function reply_form_process($entity)
{
//권한체크
- $this->isRole('reply');
- $entity = parent::reply_form_process($entity);
- $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
- 'category_uid' => $entity->category_uid,
- 'category' => $this->_category
- ]];
- return $entity;
+ $this->isRole('isreply');
+ return parent::reply_form_process($entity);
}
//Delete 관련
protected function delete_process($entity)
@@ -121,11 +97,7 @@ class BoardController extends FrontController
$this->isRole('view');
//조회수 올리기
$entity = $this->_model->addViewCount($entity);
- $entity = parent::view_process($entity);
- $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
- 'category' => $this->_category
- ]];
- return $entity;
+ return parent::view_process($entity);
}
//Index관련
protected function index_process()
@@ -133,14 +105,11 @@ class BoardController extends FrontController
//권한체크
$this->isRole('index');
parent::index_process();
- $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
- 'category' => $this->_category
- ]];
}
//Category 및 Status 조건추가
protected function index_setCondition()
{
- $this->_model->where("category_uid", $this->_viewDatas['category']->getPrimaryKey());
+ $this->_model->where("category_uid", $this->getCurrentCategory()->getPrimaryKey());
$this->_model->where("status", DEFAULTS['STATUS']);
parent::index_setCondition();
}
@@ -149,12 +118,11 @@ class BoardController extends FrontController
{
$entity = parent::download_process($field, $entity);
//권한체크
- $this->isRole('download', $entity);
+ $this->isRole('download');
list($filename, $uploaded_filename) = explode(DEFAULTS['DELIMITER_FILE'], $entity->$field);
if (!is_file(PATHS['UPLOAD'] . "/" . $uploaded_filename)) {
throw new \Exception("파일이 확인되지 않습니다.\n" . PATHS['UPLOAD'] . "/" . $uploaded_filename);
}
return array($filename, $uploaded_filename);
- return parent::download_process($field, $entity);
}
}
diff --git a/app/Helpers/Board_helper.php b/app/Helpers/Board_helper.php
index c4625bc..21d1f5c 100644
--- a/app/Helpers/Board_helper.php
+++ b/app/Helpers/Board_helper.php
@@ -107,7 +107,7 @@ function getFieldIndex_Column_BoardHelper($field, array $viewDatas)
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
$viewDatas['uri']->addQuery('order_field', $field);
$viewDatas['uri']->addQuery('order_value', $value);
- $columnData = anchor($viewDatas['uri'], $label);
+ $columnData = anchor((string)$viewDatas['uri'], $label);
switch ($field) {
case 'title':
case 'name':
diff --git a/app/Views/front/billing/card/update.php b/app/Views/front/billing/card/update.php
index b88ab95..f3c02ff 100644
--- a/app/Views/front/billing/card/update.php
+++ b/app/Views/front/billing/card/update.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
= form_close(); ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/billing/deposit/update.php b/app/Views/front/billing/deposit/update.php
index 0c7fd65..0802109 100644
--- a/app/Views/front/billing/deposit/update.php
+++ b/app/Views/front/billing/deposit/update.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
= form_close(); ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/billing/index.php b/app/Views/front/billing/index.php
index b5ba845..1546f03 100644
--- a/app/Views/front/billing/index.php
+++ b/app/Views/front/billing/index.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= $this->include('templates/front/index_head') ?>
@@ -29,6 +29,6 @@
= $viewDatas['pagination'] ?>
- = html_entity_decode($viewDatas['category']->tail) ?>
+ = html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/billing/view.php b/app/Views/front/billing/view.php
index 9041b6c..763ace0 100644
--- a/app/Views/front/billing/view.php
+++ b/app/Views/front/billing/view.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/board/index.php b/app/Views/front/board/index.php
index 40dc696..711f5a7 100644
--- a/app/Views/front/board/index.php
+++ b/app/Views/front/board/index.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= $this->include('templates/front/index_head') ?>
= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
@@ -20,7 +20,7 @@
user_uid == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
- = anchor(current_url() . '/update/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
+ = anchor(current_url() . '/update/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
= $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt) ?>
@@ -31,7 +31,7 @@
user_uid == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
- = anchor(current_url() . '/delete/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
+ = anchor(current_url() . '/delete/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
@@ -41,12 +41,12 @@
-
- = anchor(current_url() . '/insert?category=' . $viewDatas['category']->getPrimaryKey(), '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
+
+ = anchor(current_url() . '/insert?category=' . $viewDatas['currentCategory']->getPrimaryKey(), '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
= $viewDatas['pagination'] ?>
= form_close() ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/board/insert.php b/app/Views/front/board/insert.php
index 9b5d077..54367f0 100644
--- a/app/Views/front/board/insert.php
+++ b/app/Views/front/board/insert.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
= form_close(); ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/board/reply.php b/app/Views/front/board/reply.php
index ba39997..7c8e4af 100644
--- a/app/Views/front/board/reply.php
+++ b/app/Views/front/board/reply.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
= form_close(); ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/board/update.php b/app/Views/front/board/update.php
index 964ebe4..87409a7 100644
--- a/app/Views/front/board/update.php
+++ b/app/Views/front/board/update.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
= form_close(); ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/board/view.php b/app/Views/front/board/view.php
index af22457..58e2833 100644
--- a/app/Views/front/board/view.php
+++ b/app/Views/front/board/view.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/order/index.php b/app/Views/front/order/index.php
index 7ee5e07..1955463 100644
--- a/app/Views/front/order/index.php
+++ b/app/Views/front/order/index.php
@@ -3,7 +3,7 @@
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= $viewDatas['pagination'] ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/order/view.php b/app/Views/front/order/view.php
index cc92a5c..6dae013 100644
--- a/app/Views/front/order/view.php
+++ b/app/Views/front/order/view.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/product/index.php b/app/Views/front/product/index.php
index 746c840..e7c178c 100644
--- a/app/Views/front/product/index.php
+++ b/app/Views/front/product/index.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>
= $this->include('templates/front/index_head_product') ?>
@@ -34,6 +34,6 @@
= $viewDatas['pagination'] ?>
-
= html_entity_decode($viewDatas['category']->tail) ?>
+
= html_entity_decode($viewDatas['currentCategory']->tail) ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/front/product/view.php b/app/Views/front/product/view.php
index ae54358..b74fa12 100644
--- a/app/Views/front/product/view.php
+++ b/app/Views/front/product/view.php
@@ -2,7 +2,7 @@
= $this->section('content') ?>
-
= html_entity_decode($viewDatas['category']->head) ?>
+
= html_entity_decode($viewDatas['currentCategory']->head) ?>