diff --git a/app/Config/Constants.php b/app/Config/Constants.php
index a45e15e..c98800b 100644
--- a/app/Config/Constants.php
+++ b/app/Config/Constants.php
@@ -154,6 +154,15 @@ define('SESSION_NAMES', [
'CART' => 'cart'
]);
define('AUTH_FIELDS', ['ID' => 'id', 'TITLE' => 'title', 'ROLE' => 'role']);
+//Category관련 Role Fields
+define('CATEGORY_ROLE_FIELDS', [
+ 'ACCESS' => 'isaccess',
+ 'READ' => 'isread',
+ 'WRITE' => 'iswrite',
+ 'REPLY' => 'isreply',
+ 'UPLOAD' => 'isupload',
+ 'DOWNLOAD' => 'isdownload',
+]);
//인증 관련
define('AUTH_ADAPTERS', [
@@ -212,7 +221,7 @@ define('AUDIOS', [
//Default값 정의
define('DEFAULTS', [
- 'ROLE' => getenv('default.role') ?: "user",
+ 'ROLE' => getenv('default.role') ?: "guest",
'STATUS' => getenv('default.status') ?: "use",
'EMPTY' => getenv('default.empty') ?: "",
'PERPAGE' => getenv('default.perpage') ?: 20,
diff --git a/app/Controllers/Admin/BoardController.php b/app/Controllers/Admin/BoardController.php
index e4c6257..7f005a2 100644
--- a/app/Controllers/Admin/BoardController.php
+++ b/app/Controllers/Admin/BoardController.php
@@ -13,9 +13,7 @@ class BoardController extends AdminController
{
$this->_model = new BoardModel();
parent::initController($request, $response, $logger);
- $this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
$this->_viewPath .= strtolower($this->_model->getClassName());
- helper($this->_model->getClassName());
}
public function getFields(string $action = ""): array
diff --git a/app/Controllers/Admin/CategoryController.php b/app/Controllers/Admin/CategoryController.php
index 858083d..c97c942 100644
--- a/app/Controllers/Admin/CategoryController.php
+++ b/app/Controllers/Admin/CategoryController.php
@@ -13,9 +13,7 @@ class CategoryController extends AdminController
{
$this->_model = new CategoryModel();
parent::initController($request, $response, $logger);
- $this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
$this->_viewPath .= strtolower($this->_model->getClassName());
- helper($this->_model->getClassName());
}
public function getFields(string $action = ""): array
diff --git a/app/Controllers/Admin/HPILOController.php b/app/Controllers/Admin/HPILOController.php
index 615952c..c3bcefc 100644
--- a/app/Controllers/Admin/HPILOController.php
+++ b/app/Controllers/Admin/HPILOController.php
@@ -14,9 +14,9 @@ class HPILOController extends \App\Controllers\Admin\AdminController
private $_adapter = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
- $this->_backend = service('hpilo');
+ $this->_model = new HPILOModel();
parent::initController($request, $response, $logger);
- $this->_viewPath .= strtolower($this->_backend->getClassName());
+ $this->_viewPath .= strtolower($this->_model->getClassName());
}
private function getAdapter(HPILOEntity $entity)
@@ -30,6 +30,27 @@ class HPILOController extends \App\Controllers\Admin\AdminController
return $this->_adapter;
}
+ public function getFields(string $action = ""): array
+ {
+ $fields = ['customer', 'ip', 'port', 'id', 'passwd', 'status'];
+ switch ($action) {
+ case "index":
+ case "excel":
+ return ['customer', 'ip', 'port', 'model', 'processor', 'memory', 'health', 'power', 'status', 'created_at'];
+ break;
+ case "view":
+ return ['customer', 'ip', 'port', 'id', 'model', 'processor', 'memory', 'health', 'power', 'detail', 'status', 'updated_at', 'created_at'];
+ break;
+ default:
+ return $fields;
+ break;
+ }
+ }
+ public function getFieldFilters(array $fields = array()): array
+ {
+ return ["power", "status", ...$fields];
+ }
+
//Insert관련
protected function insert_validate()
{
diff --git a/app/Controllers/Admin/UserController.php b/app/Controllers/Admin/UserController.php
index da47dbf..e19a9cc 100644
--- a/app/Controllers/Admin/UserController.php
+++ b/app/Controllers/Admin/UserController.php
@@ -13,9 +13,7 @@ class UserController extends AdminController
{
$this->_model = new UserModel();
parent::initController($request, $response, $logger);
- $this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
$this->_viewPath .= strtolower($this->_model->getClassName());
- helper($this->_model->getClassName());
}
//Field별 Form Datas 처리용
diff --git a/app/Controllers/Admin/UserSNSController.php b/app/Controllers/Admin/UserSNSController.php
index 72fa184..9753f41 100644
--- a/app/Controllers/Admin/UserSNSController.php
+++ b/app/Controllers/Admin/UserSNSController.php
@@ -13,9 +13,7 @@ class UserSNSController extends AdminController
{
$this->_model = new UserSNSModel();
parent::initController($request, $response, $logger);
- $this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
$this->_viewPath .= strtolower($this->_model->getClassName());
- helper($this->_model->getClassName());
}
public function getFields(string $action = ""): array
{
diff --git a/app/Controllers/AuthController.php b/app/Controllers/AuthController.php
index aba7733..bb5cc1c 100644
--- a/app/Controllers/AuthController.php
+++ b/app/Controllers/AuthController.php
@@ -75,7 +75,7 @@ class AuthController extends Controller
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
helper(['form']);
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
- return view('auth/login', $this->_viewDatas);
+ return view('auth/login', ['viewDatas' => $this->_viewDatas]);
}
public function signup(string $site)
diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php
index cc70320..368dff3 100644
--- a/app/Controllers/BaseController.php
+++ b/app/Controllers/BaseController.php
@@ -37,7 +37,7 @@ abstract class BaseController extends Controller
*
* @var array
*/
- protected $helpers = ['Common'];
+ protected $helpers = ['Common', 'Base'];
/**
* Be sure to declare properties for any property fetch you initialized.
@@ -62,8 +62,19 @@ abstract class BaseController extends Controller
$this->_viewDatas['layout'] = LAYOUTS['empty'];
$this->_viewDatas['session'] = $this->_session;
$this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
+ $this->_viewDatas['className'] = $this->_model->getClassName();
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_model->getClassName())];
helper($this->_model->getClassName());
+
+ //사용자 기본 Role 지정
+ $this->_viewDatas[SESSION_NAMES['ISLOGIN']] = false;
+ $this->_viewDatas['currentRoles'] = [DEFAULTS["ROLE"]];
+ if ($this->_session->get(SESSION_NAMES['ISLOGIN'])) {
+ $this->_viewDatas[SESSION_NAMES['ISLOGIN']] = true;
+ $this->_viewDatas['auth'] = $this->_session->get(SESSION_NAMES['AUTH']);
+ $currentRoles = explode(DEFAULTS['DELIMITER_ROLE'], $this->_viewDatas['auth'][AUTH_FIELDS['ROLE']]);
+ $this->_viewDatas['currentRoles'] = is_array($currentRoles) ? $currentRoles : [DEFAULTS["ROLE"]];
+ }
}
abstract public function getFields(string $action): array;
@@ -137,17 +148,21 @@ abstract class BaseController extends Controller
}
//Insert관련
- final public function insert_form()
+ protected function insert_form_process()
+ {
+ }
+ 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', $this->_viewDatas);
+ return view($this->_viewPath . '/insert', ['viewDatas' => $this->_viewDatas]);
} catch (\Exception $e) {
log_message("error", $e->getMessage());
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
}
}
protected function insert_validate()
@@ -180,7 +195,7 @@ abstract class BaseController extends Controller
$this->insert_validate();
$entity = $this->insert_process();
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} catch (\Exception $e) {
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage();
log_message("error", $e->getMessage());
@@ -192,18 +207,23 @@ abstract class BaseController extends Controller
}
//Update관련
- final public function update_form($uid)
+ protected function update_form_process($entity)
+ {
+ return $entity;
+ }
+ public function update_form($uid)
{
try {
$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']);
- $this->_viewDatas['entity'] = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
- return view($this->_viewPath . '/update', $this->_viewDatas);
+ return view($this->_viewPath . '/update', ['viewDatas' => $this->_viewDatas]);
} catch (\Exception $e) {
log_message("error", $e->getMessage());
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
}
}
protected function update_validate($entity)
@@ -240,7 +260,7 @@ abstract class BaseController extends Controller
$this->update_validate($entity);
$entity = $this->update_process($entity);
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} catch (\Exception $e) {
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage();
log_message("error", $e->getMessage());
@@ -252,23 +272,27 @@ abstract class BaseController extends Controller
}
//Reply관련
- final public function reply_form($uid)
+ protected function reply_form_process($entity)
+ {
+ $titleField = $this->_model->getTitleField();
+ $entity->$titleField = "RE: " . $entity->$titleField;
+ $contentField = $this->_model->getContentField();
+ $entity->$contentField .= "\n----------------------------------------------\n";
+ return $entity;
+ }
+ public function reply_form($uid)
{
try {
$this->_viewDatas = $this->init(__FUNCTION__);
- $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
- helper(['form']);
- $this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
- $titleField = $this->_model->getTitleField();
- $entity->$titleField = "RE: " . $entity->$titleField;
- $contentField = $this->_model->getContentField();
- $entity->$contentField .= "\n----------------------------------------------\n";
- $this->_viewDatas['entity'] = $entity;
- return view($this->_viewPath . '/reply', $this->_viewDatas);
+ $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) {
log_message("error", $e->getMessage());
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
}
}
protected function reply_validate($entity)
@@ -288,7 +312,7 @@ abstract class BaseController extends Controller
$this->reply_validate($entity);
$entity = $this->reply_process($entity);
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} catch (\Exception $e) {
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage();
log_message("error", $e->getMessage());
@@ -317,11 +341,11 @@ abstract class BaseController extends Controller
$this->toggle_validate($entity);
$entity = $this->toggle_process($entity);
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} catch (\Exception $e) {
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage();
log_message("error", $e->getMessage());
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} finally {
$this->_session->setFlashdata("return_message", $msg);
}
@@ -376,7 +400,7 @@ abstract class BaseController extends Controller
count($entitys),
__FUNCTION__
);
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} catch (\Exception $e) {
//Transaction Rollback
$this->_model->transRollback();
@@ -389,7 +413,7 @@ abstract class BaseController extends Controller
__FUNCTION__,
);
log_message("error", $e->getMessage());
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} finally {
$this->_session->setFlashdata("return_message", $msg);
}
@@ -412,11 +436,11 @@ abstract class BaseController extends Controller
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
$this->delete_process($entity);
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} catch (\Exception $e) {
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage();
log_message("error", $e->getMessage());
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
} finally {
$this->_session->setFlashdata("return_message", $msg);
}
@@ -431,18 +455,21 @@ abstract class BaseController extends Controller
{
try {
$this->_viewDatas = $this->init(__FUNCTION__);
- helper(['form']);
- $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
$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', $this->_viewDatas);
+ return view($this->_viewPath . '/view', ['viewDatas' => $this->_viewDatas]);
} catch (\Exception $e) {
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
}
}
//Index 관련
+ protected function index_process()
+ {
+ }
protected function index_setCondition()
{
//조건절 처리
@@ -452,12 +479,19 @@ abstract class BaseController extends Controller
$filterFields[$field] = $this->request->getVar($field);
}
}
- $word = $this->request->getVar('word');
- $start = $this->request->getVar('start');
- $end = $this->request->getVar('end');
- $order_field = $this->request->getVar('order_field');
- $order_value = $this->request->getVar('order_value');
- $this->_model->setCondition($filterFields, $word, $start, $end, $order_field, $order_value);
+ $this->_viewDatas['word'] = $this->request->getVar('word') ?: '';
+ $this->_viewDatas['start'] = $this->request->getVar('start') ?: '';
+ $this->_viewDatas['end'] = $this->request->getVar('end') ?: '';
+ $this->_viewDatas['order_field'] = $this->request->getVar('order_field') ?: 'uid';
+ $this->_viewDatas['order_value'] = $this->request->getVar('order_value') ?: 'DESC';
+ $this->_model->setCondition(
+ $filterFields,
+ $this->_viewDatas['word'],
+ $this->_viewDatas['start'],
+ $this->_viewDatas['end'],
+ $this->_viewDatas['order_field'],
+ $this->_viewDatas['order_value']
+ );
}
private function index_getPagination($pager_group = 'default', int $segment = 0, $template = 'bootstrap_full'): string
{
@@ -490,23 +524,20 @@ abstract class BaseController extends Controller
{
try {
$this->_viewDatas = $this->init(__FUNCTION__);
- helper(['form']);
- $this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
+ $this->index_process();
foreach ($this->_viewDatas['fieldFilters'] as $field) {
$this->_viewDatas[$field] = $this->request->getVar($field) ?: DEFAULTS['EMPTY'];
}
- $this->_viewDatas['word'] = $this->request->getVar('word') ?: '';
- $this->_viewDatas['start'] = $this->request->getVar('start') ?: '';
- $this->_viewDatas['end'] = $this->request->getVar('end') ?: '';
- $this->_viewDatas['order_field'] = $this->request->getVar('order_field') ?: 'uid';
- $this->_viewDatas['order_value'] = $this->request->getVar('order_value') ?: 'DESC';
- $this->_viewDatas['page'] = (int)$this->request->getVar('page') ?: 1;
- $this->_viewDatas['per_page'] = (int)$this->request->getVar('per_page') ?: DEFAULTS['PERPAGE'];
- $this->_viewDatas['uri'] = $this->request->getUri();
//Totalcount 처리
$this->index_setCondition();
$this->_viewDatas['total_count'] = $this->_model->countAllResults();
+ // echo $this->_model->getLastQuery();
+ // echo "
";
// log_message("debug", __METHOD__ . "에서 TotalCount 호출:" . $this->_model->getLastQuery());
+ //Page, Per_page필요부분
+ $this->_viewDatas['page'] = (int)$this->request->getVar('page') ?: 1;
+ $this->_viewDatas['per_page'] = (int)$this->request->getVar('per_page') ?: DEFAULTS['PERPAGE'];
+ $this->_viewDatas['uri'] = $this->request->getUri();
//줄수 처리용
$this->_viewDatas['pageOptions'] = array("" => "줄수선택");
for ($i = 10; $i <= $this->_viewDatas['total_count'] + $this->_viewDatas['per_page']; $i += 10) {
@@ -519,10 +550,13 @@ abstract class BaseController extends Controller
// echo $this->_model->getLastQuery();
// 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', $this->_viewDatas);
+ return view($this->_viewPath . '/index', ['viewDatas' => $this->_viewDatas]);
} catch (\Exception $e) {
- return redirect()->back()->with('return_message', $e->getMessage());
+ return alert_CommonHelper($e->getMessage(), "back");
+ // return redirect()->back()->with('return_message', $e->getMessage());
}
}
@@ -569,7 +603,7 @@ abstract class BaseController extends Controller
// return readfile(PATHS['EXCEL'] . '/' . $fileName);
return $writer->save('php://output');
} catch (\Exception $e) {
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
}
}
//File Download관련
@@ -586,7 +620,7 @@ abstract class BaseController extends Controller
}
return $this->response->download(WRITEPATH . PATHS['UPLOAD'] . "/" . $filename, null)->setFileName(date("YmdHms") . '_' . $origin_filename);
} catch (\Exception $e) {
- return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
+ return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
}
}
}
diff --git a/app/Controllers/Front/BoardController.php b/app/Controllers/Front/BoardController.php
index 8898442..49154f8 100644
--- a/app/Controllers/Front/BoardController.php
+++ b/app/Controllers/Front/BoardController.php
@@ -3,19 +3,25 @@
namespace App\Controllers\Front;
use App\Models\BoardModel;
+use App\Models\CategoryModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class BoardController extends FrontController
{
+ private $_category_uid = null;
+ private $_categoryModel = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->_model = new BoardModel($this->getFields());
parent::initController($request, $response, $logger);
- $this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
$this->_viewPath .= strtolower($this->_model->getClassName());
- helper($this->_model->getClassName());
+ }
+
+ private function getCategoryModel(): CategoryModel
+ {
+ return $this->_categoryModel = $this->_categoryModel ?: new CategoryModel();
}
public function getFields(string $action = ""): array
@@ -60,10 +66,137 @@ class BoardController extends FrontController
return $this->_viewDatas['fieldDatas'];
}
+ //Insert관련
+ protected function insert_form_process()
+ {
+ $this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
+ $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
+ //사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인
+ if (!isRole_CommonHelper(
+ $this->_viewDatas['currentRoles'],
+ $this->_viewDatas['category'],
+ CATEGORY_ROLE_FIELDS['WRITE']
+ )) {
+ throw new \Exception("고객님은 쓰기권한이 없습니다.");
+ }
+ return parent::insert_form();
+ }
+ protected function insert_process()
+ {
+ $this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
+ $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
+ //사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인
+ if (!isRole_CommonHelper(
+ $this->_viewDatas['currentRoles'],
+ $this->_viewDatas['category'],
+ CATEGORY_ROLE_FIELDS['WRITE']
+ )) {
+ throw new \Exception("고객님은 쓰기권한이 없습니다.");
+ }
+ return parent::insert();
+ }
+
+ //Update관련
+ protected function update_form_process($entity)
+ {
+ //본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 수정을 시도방지용
+ if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
+ throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
+ }
+ return parent::update_form_process($entity);
+ }
+ protected function update_process($entity)
+ {
+ //본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 수정을 시도방지용
+ if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
+ throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
+ }
+ return parent::update_process($entity);
+ }
+ //Reply관련
+ protected function reply_form_process($entity)
+ {
+ $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity(
+ [$this->getCategoryModel()->getPrimaryKey() => $entity->getCategory_Uid()]
+ );
+ // echo var_export(isRole_CommonHelper(
+ // $this->_viewDatas['currentRoles'],
+ // $this->_viewDatas['category'],
+ // CATEGORY_ROLE_FIELDS['REPLY']
+ // ), true);
+ // exit;
+ //사용자가 Category에서 해당 게시판의 REPLY권한이 있는지 확인
+ if (!isRole_CommonHelper(
+ $this->_viewDatas['currentRoles'],
+ $this->_viewDatas['category'],
+ CATEGORY_ROLE_FIELDS['REPLY']
+ )) {
+ throw new \Exception("고객님은 답변권한이 없습니다.");
+ }
+ return parent::reply_form_process($entity);
+ }
+ protected function reply_process($entity)
+ {
+ $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity(
+ [$this->getCategoryModel()->getPrimaryKey() => $entity->getCategory_Uid()]
+ );
+ //사용자가 Category에서 해당 게시판의 REPLY권한이 있는지 확인
+ if (!isRole_CommonHelper(
+ $this->_viewDatas['currentRoles'],
+ $this->_viewDatas['category'],
+ CATEGORY_ROLE_FIELDS['REPLY']
+ )) {
+ throw new \Exception("고객님은 답변권한이 없습니다.");
+ }
+ return parent::reply_process($entity);
+ }
+ //Delete 관련
+ protected function delete_process($entity)
+ {
+ //본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 삭제 시도 방지용
+ if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
+ throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
+ }
+ return parent::delete_process($entity);
+ }
//View관련
protected function view_process($entity)
{
- $entity = parent::view_process($entity);
- return $this->_model->addViewCount($entity);
+ $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity(
+ [$this->getCategoryModel()->getPrimaryKey() => $entity->getCategory_Uid()]
+ );
+ //사용자가 Category에서 해당 게시판의 READ권한이 있는지 확인
+ if (!isRole_CommonHelper(
+ $this->_viewDatas['currentRoles'],
+ $this->_viewDatas['category'],
+ CATEGORY_ROLE_FIELDS['READ']
+ )) {
+ throw new \Exception("고객님은 읽기권한이 없습니다.");
+ }
+ //조회수 올리기
+ $this->_model->addViewCount($entity);
+ return parent::view_process($entity);
+ }
+ //Index관련
+ protected function index_process()
+ {
+ $this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
+ $this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
+ //사용자가 Category에서 해당 게시판의 ACCESS권한이 있는지 확인
+ if (!isRole_CommonHelper(
+ $this->_viewDatas['currentRoles'],
+ $this->_viewDatas['category'],
+ CATEGORY_ROLE_FIELDS['ACCESS']
+ )) {
+ throw new \Exception("고객님은 접속권한이 없습니다.");
+ }
+ return parent::index_process();
+ }
+ //Category 및 Status 조건추가
+ protected function index_setCondition()
+ {
+ $this->_model->where("category_uid", $this->_viewDatas['category']->getPrimaryKey());
+ $this->_model->where("status", DEFAULTS['STATUS']);
+ parent::index_setCondition();
}
}
diff --git a/app/Controllers/Front/UserController.php b/app/Controllers/Front/UserController.php
index 17f52fa..a49e403 100644
--- a/app/Controllers/Front/UserController.php
+++ b/app/Controllers/Front/UserController.php
@@ -13,9 +13,7 @@ class UserController extends FrontController
{
$this->_model = new UserModel();
parent::initController($request, $response, $logger);
- $this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
$this->_viewPath .= strtolower($this->_model->getClassName());
- helper($this->_model->getClassName());
}
//Field별 Form Datas 처리용
diff --git a/app/Database/base.sql b/app/Database/base.sql
index 635de37..d32f2dd 100644
--- a/app/Database/base.sql
+++ b/app/Database/base.sql
@@ -1,7 +1,7 @@
-DROP TABLE IF EXISTS servermgr.tw_user;
+DROP TABLE IF EXISTS baseproject.tw_user;
-CREATE TABLE servermgr.tw_user (
+CREATE TABLE baseproject.tw_user (
uid varchar(36) NOT NULL COMMENT "사용자 UUID",
id varchar(30) NOT NULL,
passwd varchar(100) NOT NULL,
@@ -17,11 +17,11 @@ CREATE TABLE servermgr.tw_user (
UNIQUE KEY (email)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사용자 정보';
-- insert into tw_user (uid,id,passwd,name,email,role,status) select uuid(),id,passwd,name,email,role,status from cfmgr.user;
-DROP TABLE IF EXISTS servermgr.tw_user_profile;
+DROP TABLE IF EXISTS baseproject.tw_user_profile;
-DROP TABLE IF EXISTS servermgr.tw_user_sns;
+DROP TABLE IF EXISTS baseproject.tw_user_sns;
-CREATE TABLE servermgr.tw_user_sns (
+CREATE TABLE baseproject.tw_user_sns (
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
user_uid varchar(36) NULL COMMENT '사용자 정보',
site varchar(20) NOT NULL COMMENT 'Site: GOOGLE,FACEBOOK 등등',
@@ -38,14 +38,14 @@ CREATE TABLE servermgr.tw_user_sns (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='SNS 로그인 후 정보';
-DROP TABLE IF EXISTS servermgr.tw_category;
+DROP TABLE IF EXISTS baseproject.tw_category;
-- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업
-- update tw_category set grporder=grporder+1 where grpno=그룹번호 and grporder > 선택한 grpno
-- 2. 게시물 추가시 작업
-- insert tw_category grpno=그룹번호,grporder=grporder+1,grpdepth=grpdepth+1
-- 3. 게시물 조회시 작업
-- select * from tw_category order by grpno desc,grporder asc
-CREATE TABLE servermgr.tw_category (
+CREATE TABLE baseproject.tw_category (
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
@@ -66,14 +66,14 @@ CREATE TABLE servermgr.tw_category (
PRIMARY KEY (uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='범주';
-DROP TABLE IF EXISTS servermgr.tw_board;
+DROP TABLE IF EXISTS baseproject.tw_board;
-- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업
-- update tw_board set grporder=grporder+1 where grpno=그룹번호 and grporder > 선택한 grpno
-- 2. 게시물 추가시 작업
-- insert tw_board grpno=그룹번호,grporder=grporder+1,grpdepth=grpdepth+1
-- 3. 게시물 조회시 작업
-- select * from tw_board order by grpno desc,grporder asc
-CREATE TABLE servermgr.tw_board (
+CREATE TABLE baseproject.tw_board (
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
diff --git a/app/Entities/CategoryEntity.php b/app/Entities/CategoryEntity.php
index 4e90eb5..3941df8 100644
--- a/app/Entities/CategoryEntity.php
+++ b/app/Entities/CategoryEntity.php
@@ -31,4 +31,11 @@ class CategoryEntity extends BaseHierarchyEntity
{
return $this->attributes['tail'];
}
+ public function getRole($field = 'isaccess')
+ {
+ return array_key_exists(
+ $field,
+ $this->attributes
+ ) ? $this->attributes[$field] : DEFAULTS['ROLE'];
+ }
}
diff --git a/app/Entities/HPILOEntity.php b/app/Entities/HPILOEntity.php
index bf05598..73e1c01 100644
--- a/app/Entities/HPILOEntity.php
+++ b/app/Entities/HPILOEntity.php
@@ -15,11 +15,11 @@ class HPILOEntity extends BaseEntity
{
return $this->attributes['uid'];
}
- public function getTitle()
+ public function getTitle(): string
{
return $this->attributes['title'];
}
- public function getStatus()
+ public function getStatus(): string
{
return $this->attributes['status'];
}
diff --git a/app/Helpers/Board_helper.php b/app/Helpers/Board_helper.php
index a740168..5e46a53 100644
--- a/app/Helpers/Board_helper.php
+++ b/app/Helpers/Board_helper.php
@@ -1,67 +1,71 @@
%s", implode(" ", [...$attributes]), lang("Board.label.{$field}"));
+ return sprintf("%s", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
break;
}
}
-
//header.php에서 getFieldForm_Helper사용
-function getFieldForm_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldForm_BoardHelper($field, $value, array $viewDatas, array $attributes = array())
{
+ $value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case "category_uid":
case "user_uid":
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
break;
- case "status":
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, $attributes);
- break;
- case 'updated_at':
- case 'created_at':
- return form_input($field, $value, [...$attributes, 'class' => 'calender']);
+ case 'title':
+ case 'name':
+ return form_input($field, $value, ["placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
case 'passwd':
return sprintf(
"%s %s %s",
- form_password($field, DEFAULTS['EMPTY'], [...$attributes]),
- lang("Board.label.confirmpassword"),
- form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
+ form_password($field, DEFAULTS['EMPTY']),
+ lang("{$viewDatas['className']}.label.confirmpassword"),
+ form_password('confirmpassword', DEFAULTS['EMPTY']),
);
break;
case 'content':
- return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
+ case 'head':
+ case 'tail':
+ return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case 'upload_file':
case 'board_file':
return form_upload($field);
break;
- case 'title':
- return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
- break;
case 'view_cnt':
- return form_input($field, $value, [...$attributes, 'type' => 'number']);
+ return form_input($field, $value, ['type' => 'number']);
+ break;
+ case "status":
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, $attributes);
+ break;
+ case 'updated_at':
+ case 'created_at':
+ return form_input($field, $value, ['class' => 'calender']);
break;
default:
- return form_input($field, $value, [...$attributes]);
+ return form_input($field, $value);
break;
}
} //
-function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
+function getFieldView_BoardHelper($field, $entity, array $viewDatas)
{
$value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'category_uid':
$categorys = array();
- foreach (array_values($fieldFormOptions[$field]) as $category_2depth) {
+ foreach (array_values($viewDatas['fieldFormOptions'][$field]) as $category_2depth) {
foreach ($category_2depth as $key => $label) {
$categorys[$key] = $label;
}
@@ -69,27 +73,27 @@ function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $f
return $categorys[$value];
break;
case 'title':
+ case 'name':
+ $reply = anchor(
+ current_url() . '/reply/' . $entity->getPrimaryKey(),
+ ICONS['REPLY'],
+ ["target" => "_self"]
+ );
+ $view = anchor(
+ current_url() . '/view/' . $entity->getPrimaryKey(),
+ $value,
+ ["target" => "_self"]
+ );
return sprintf(
- "%s %s
",
- anchor(
- current_url() . '/reply/' . $entity->getPrimaryKey(),
- ICONS['REPLY'],
- [
- ...$attributes,
- "style" => sprintf("padding-left:%spx", $entity->getHierarchy_Depth() * DEFAULTS['HIERARCHY_GRPDEPTH']),
- "target" => "_self"
- ]
- ),
- anchor(
- current_url() . '/view/' . $entity->getPrimaryKey(),
- $value,
- ["target" => "_self"]
- )
+ "%s %s
",
+ $entity->getHierarchy_Depth() * DEFAULTS['HIERARCHY_GRPDEPTH'],
+ $reply,
+ $view
);
break;
case 'board_file':
case 'upload_file':
- return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
+ return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
break;
case 'view_cnt':
return number_format(!$value ? 0 : $value);
@@ -102,47 +106,48 @@ function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $f
return $value ? str_split($value, 10)[0] : "";
break;
default:
- return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
+ return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
break;
}
} //
-function getFieldFilter_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldFilter_BoardHelper($field, $value, array $viewDatas)
+{
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, ['class' => "select-field"]);
+} //
+
+function getFieldIndex_Column_BoardHelper($field, array $viewDatas)
+{
+ $label = lang("{$viewDatas['className']}.label.{$field}");
+ $label = $field == $viewDatas['order_field'] ? sprintf('%s ', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
+ $value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
+ return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
+} //
+
+function getFieldIndex_Row_BoardHelper($field, $entity, array $viewDatas): string
{
- $value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
default:
- return getFieldForm_BoardHelper($field, $value, $fieldFormOptions, $attributes);
+ return getFieldView_BoardHelper($field, $entity, $viewDatas);
break;
}
} //
-
-function getFieldIndex_Column_BoardHelper($field, $order_field, $order_value, array $attributes = array())
-{
- $label = lang("Board.label.{$field}");
- $label = $field == $order_field ? sprintf('%s ', $label, $order_value == 'ASC' ? "up" : "down") : $label;
- $order_value = $order_value == 'DESC' ? "ASC" : "DESC";
- return anchor(current_url() . "?order_field={$field}&order_value={$order_value}", $label, [...$attributes]);
-} //
-
-function getFieldIndex_Row_BoardHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
+function getFieldIndex_Row_BoardHelper_Admin($field, $entity, array $viewDatas): string
{
switch ($field) {
default:
- return getFieldView_BoardHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
- break;
- }
-} //
-
-function getFieldIndex_Row_BoardHelper_Admin($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
-{
- switch ($field) {
- default:
- if (in_array($field, $fieldFilters)) {
- $attributes["onChange"] = sprintf('location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), $entity->getPrimaryKey(), $field, $field);
- return getFieldForm_BoardHelper($field, $entity->$field, $fieldFormOptions, $attributes);
+ if (in_array($field, $viewDatas['fieldFilters'])) {
+ $attributes["onChange"] = sprintf(
+ 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
+ current_url(),
+ $entity->getPrimaryKey(),
+ $field,
+ $field
+ );
+ return getFieldForm_BoardHelper($field, $entity->$field, $viewDatas, $attributes);
}
- return getFieldIndex_Row_BoardHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
+ return getFieldView_BoardHelper($field, $entity, $viewDatas);
break;
}
} //
\ No newline at end of file
diff --git a/app/Helpers/Category_helper.php b/app/Helpers/Category_helper.php
index ddbc04b..f4d16f9 100644
--- a/app/Helpers/Category_helper.php
+++ b/app/Helpers/Category_helper.php
@@ -1,18 +1,18 @@
%s", implode(" ", [...$attributes]), lang("Category.label.{$field}"));
+ return sprintf("%s", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
break;
}
}
-
//header.php에서 getFieldForm_Helper사용
-function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldForm_CategoryHelper($field, $value, array $viewDatas, array $attributes = array())
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
@@ -22,131 +22,127 @@ function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, ar
case 'isreply':
case 'isupload':
case 'isdownload':
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Category.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
- // return form_multiselect($field, $fieldFormOptions[$field], $value, [...$attributes]);
- // foreach ($fieldFormOptions[$field] as $key => $label) {
- // $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, is_array($value) ? [...$value] : explode(DEFAULTS['DELIMITER_ROLE'], $value)), $attributes) . $label;
- // }
- // return implode(" ", $checkboxs);
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
break;
- case "status":
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Category.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, $attributes);
- break;
- case 'updated_at':
- case 'created_at':
- return form_input($field, $value, [...$attributes, 'class' => 'calender']);
+ case 'title':
+ case 'name':
+ return form_input($field, $value, ["placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
case 'passwd':
return sprintf(
"%s %s %s",
- form_password($field, DEFAULTS['EMPTY'], [...$attributes]),
- lang("Category.label.confirmpassword"),
- form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
+ form_password($field, DEFAULTS['EMPTY']),
+ lang("{$viewDatas['className']}.label.confirmpassword"),
+ form_password('confirmpassword', DEFAULTS['EMPTY']),
);
break;
+ case 'content':
case 'head':
case 'tail':
- return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
+ return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case 'upload_file':
+ case 'board_file':
return form_upload($field);
break;
- case 'name':
- return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
+ case 'view_cnt':
+ return form_input($field, $value, ['type' => 'number']);
break;
- default:
- return form_input($field, $value, [...$attributes]);
- break;
- }
-} //
-
-function getFieldView_CategoryHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
-{
- $value = $entity->$field ?: DEFAULTS['EMPTY'];
- switch ($field) {
- case 'name':
- return sprintf(
- "%s %s
",
- anchor(
- current_url() . '/reply/' . $entity->getPrimaryKey(),
- ICONS['REPLY'],
- [
- ...$attributes,
- "style" => sprintf("padding-left:%spx", $entity->getHierarchy_Depth() * DEFAULTS['HIERARCHY_GRPDEPTH']),
- "target" => "_self"
- ]
- ),
- anchor(
- current_url() . '/view/' . $entity->getPrimaryKey(),
- $value,
- ["target" => "_self"]
- )
- );
- break;
- case 'upload_file':
- return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
+ case "status":
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, $attributes);
break;
case 'updated_at':
case 'created_at':
- return isset($value) ? str_split($value, 10)[0] : "";
+ return form_input($field, $value, ['class' => 'calender']);
break;
- case 'head':
- case 'tail':
+ default:
+ return form_input($field, $value);
+ break;
+ }
+} //
+
+function getFieldView_CategoryHelper($field, $entity, array $viewDatas)
+{
+ $value = $entity->$field ?: DEFAULTS['EMPTY'];
+ switch ($field) {
+ case 'title':
+ case 'name':
+ $reply = anchor(
+ current_url() . '/reply/' . $entity->getPrimaryKey(),
+ ICONS['REPLY'],
+ ["target" => "_self"]
+ );
+ $view = anchor(
+ current_url() . '/view/' . $entity->getPrimaryKey(),
+ $value,
+ ["target" => "_self"]
+ );
+ return sprintf(
+ "%s %s
",
+ $entity->getHierarchy_Depth() * DEFAULTS['HIERARCHY_GRPDEPTH'],
+ $reply,
+ $view
+ );
+ break;
+ case 'board_file':
+ case 'upload_file':
+ return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
+ break;
+ case 'view_cnt':
+ return number_format(!$value ? 0 : $value);
+ break;
+ case 'content':
return html_entity_decode($value);
break;
+ case 'updated_at':
+ case 'created_at':
+ return $value ? str_split($value, 10)[0] : "";
+ break;
default:
- return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
+ return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
break;
}
} //
-function getFieldFilter_CategoryHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldFilter_CategoryHelper($field, $value, array $viewDatas)
+{
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, ['class' => "select-field"]);
+} //
+
+function getFieldIndex_Column_CategoryHelper($field, array $viewDatas)
+{
+ $label = lang("{$viewDatas['className']}.label.{$field}");
+ $label = $field == $viewDatas['order_field'] ? sprintf('%s ', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
+ $value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
+ return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
+} //
+
+function getFieldIndex_Row_CategoryHelper($field, $entity, array $viewDatas): string
{
- $value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
- case 'isaccess':
- case 'isread':
- case 'iswrite':
- case 'isreply':
- case 'isupload':
- case 'isdownload':
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Category.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
- break;
default:
- return getFieldForm_CategoryHelper($field, $value, $fieldFormOptions, $attributes);
+ return getFieldView_CategoryHelper($field, $entity, $viewDatas);
break;
}
} //
-
-function getFieldIndex_Column_CategoryHelper($field, $order_field, $order_value, array $attributes = array())
-{
- $label = lang("Category.label.{$field}");
- $label = $field == $order_field ? sprintf('%s ', $label, $order_value == 'ASC' ? "up" : "down") : $label;
- $order_value = $order_value == 'DESC' ? "ASC" : "DESC";
- return anchor(current_url() . "?order_field={$field}&order_value={$order_value}", $label, [...$attributes]);
-} //
-
-function getFieldIndex_Row_CategoryHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
+function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $viewDatas): string
{
switch ($field) {
default:
- return getFieldView_CategoryHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
- break;
- }
-} //
-
-function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
-{
- switch ($field) {
- default:
- if (in_array($field, $fieldFilters)) {
- $attributes["onChange"] = sprintf('location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), $entity->getPrimaryKey(), $field, $field);
- return getFieldForm_CategoryHelper($field, $entity->$field, $fieldFormOptions, $attributes);
+ if (in_array($field, $viewDatas['fieldFilters'])) {
+ $attributes["onChange"] = sprintf(
+ 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
+ current_url(),
+ $entity->getPrimaryKey(),
+ $field,
+ $field
+ );
+ return getFieldForm_CategoryHelper($field, $entity->$field, $viewDatas, $attributes);
}
- return getFieldIndex_Row_CategoryHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
+ return getFieldView_CategoryHelper($field, $entity, $viewDatas);
break;
}
} //
\ No newline at end of file
diff --git a/app/Helpers/Common_helper.php b/app/Helpers/Common_helper.php
index a759c0f..1f03706 100644
--- a/app/Helpers/Common_helper.php
+++ b/app/Helpers/Common_helper.php
@@ -1,4 +1,10 @@
getRole($roleField), $userRoles);
+}
+
function getValueByKey_CommonHelper($key, array $attributes)
{
$options = array();
diff --git a/app/Helpers/HPILO_helper.php b/app/Helpers/HPILO_helper.php
index 8f8fbd3..6b41b80 100644
--- a/app/Helpers/HPILO_helper.php
+++ b/app/Helpers/HPILO_helper.php
@@ -1,110 +1,133 @@
%s", implode(" ", [...$attributes]), lang("HPILO.label.{$field}"));
+ return sprintf("%s", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
break;
}
}
-
//header.php에서 getFieldForm_Helper사용
-function getFieldForm_HPILOHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldForm_HPILOHelper($field, $value, array $viewDatas, array $attributes = array())
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
- case 'power':
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("HPILO.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes, 'class' => "select-field"]);
- // foreach ($fieldFormOptions[$field] as $key => $label) {
- // $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, is_array($value) ? [...$value] : [$value]), $attributes) . $label;
- // }
- // return implode(" ", $checkboxs);
- // return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
+ case "power":
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
break;
- case 'status':
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("HPILO.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], $attributes);
- break;
- case 'updated_at':
- case 'created_at':
- return form_input($field, $value, [...$attributes, 'class' => 'calender']);
+ case 'title':
+ case 'name':
+ return form_input($field, $value, ["placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
case 'passwd':
return sprintf(
"%s %s %s",
- form_password($field, DEFAULTS['EMPTY'], [...$attributes]),
- lang("HPILO.label.confirmpassword"),
- form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
+ form_password($field, DEFAULTS['EMPTY']),
+ lang("{$viewDatas['className']}.label.confirmpassword"),
+ form_password('confirmpassword', DEFAULTS['EMPTY']),
);
break;
case 'content':
- return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
+ case 'head':
+ case 'tail':
+ return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case 'upload_file':
+ case 'HPILO_file':
return form_upload($field);
break;
+ case 'view_cnt':
+ return form_input($field, $value, ['type' => 'number']);
+ break;
+ case "status":
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, $attributes);
+ break;
+ case 'updated_at':
+ case 'created_at':
+ return form_input($field, $value, ['class' => 'calender']);
+ break;
default:
- return form_input($field, $value, [...$attributes]);
+ return form_input($field, $value);
break;
}
} //
-function getFieldView_HPILOHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
+function getFieldView_HPILOHelper($field, $entity, array $viewDatas)
{
$value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) {
- case 'customer':
- return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]);
+ case 'title':
+ case 'name':
+ return anchor(
+ current_url() . '/view/' . $entity->getPrimaryKey(),
+ $value,
+ ["target" => "_self"]
+ );
break;
- case 'memory':
- return $value . "GB";
- break;
- case 'detail':
- return nl2br($value);
break;
+ case 'HPILO_file':
case 'upload_file':
- return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode("||", $value)[0], [...$attributes, "target" => "_self"]);
+ return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
+ break;
+ case 'view_cnt':
+ return number_format(!$value ? 0 : $value);
break;
case 'content':
return html_entity_decode($value);
break;
+ case 'updated_at':
+ case 'created_at':
+ return $value ? str_split($value, 10)[0] : "";
+ break;
default:
- return in_array($field, $fieldFilters) ? $fieldFormOptions[$field][$value] : $value;
+ return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
break;
}
} //
-function getFieldFilter_HPILOHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldFilter_HPILOHelper($field, $value, array $viewDatas)
+{
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, ['class' => "select-field"]);
+} //
+
+function getFieldIndex_Column_HPILOHelper($field, array $viewDatas)
+{
+ $label = lang("{$viewDatas['className']}.label.{$field}");
+ $label = $field == $viewDatas['order_field'] ? sprintf('%s ', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
+ $value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
+ return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
+} //
+
+function getFieldIndex_Row_HPILOHelper($field, $entity, array $viewDatas): string
{
- $value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
default:
- return getFieldForm_HPILOHelper($field, $value, $fieldFormOptions, $attributes);
+ return getFieldView_HPILOHelper($field, $entity, $viewDatas);
break;
}
} //
-
-function getFieldIndex_Column_HPILOHelper($field, $order_field, $order_value, array $attributes = array())
-{
- $label = lang("HPILO.label.{$field}");
- $label = $field == $order_field ? sprintf('%s ', $label, $order_value == 'ASC' ? "up" : "down") : $label;
- $order_value = $order_value == 'DESC' ? "ASC" : "DESC";
- return anchor(current_url() . "?order_field={$field}&order_value={$order_value}", $label, [...$attributes]);
-} //
-
-function getFieldIndex_Row_HPILOHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
+function getFieldIndex_Row_HPILOHelper_Admin($field, $entity, array $viewDatas): string
{
switch ($field) {
default:
- if (in_array($field, $fieldFilters)) {
- $attributes["onChange"] = sprintf('location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), $entity->getPrimaryKey(), $field, $field);
- return getFieldFilter_HPILOHelper($field, $entity->$field, $fieldFormOptions, $attributes);
+ if (in_array($field, $viewDatas['fieldFilters'])) {
+ $attributes["onChange"] = sprintf(
+ 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
+ current_url(),
+ $entity->getPrimaryKey(),
+ $field,
+ $field
+ );
+ return getFieldForm_HPILOHelper($field, $entity->$field, $viewDatas, $attributes);
}
- return getFieldView_HPILOHelper($field, $entity, $fieldFormOptions, $attributes);
+ return getFieldView_HPILOHelper($field, $entity, $viewDatas);
break;
}
} //
\ No newline at end of file
diff --git a/app/Helpers/UserSNS_helper.php b/app/Helpers/UserSNS_helper.php
index 5f35544..5053ccb 100644
--- a/app/Helpers/UserSNS_helper.php
+++ b/app/Helpers/UserSNS_helper.php
@@ -1,112 +1,141 @@
%s", implode(" ", [...$attributes]), lang("UserSNS.label.{$field}"));
+ return sprintf("%s", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
break;
}
}
-
//header.php에서 getFieldForm_Helper사용
-function getFieldForm_UserSNSHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldForm_UserSNSHelper($field, $value, array $viewDatas, array $attributes = array())
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
- case "user_uid":
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("UserSNS.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
+ case 'user_uid':
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
break;
- case "status":
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("UserSNS.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, $attributes);
- break;
- case 'updated_at':
- case 'created_at':
- return form_input($field, $value, [...$attributes, 'class' => 'calender']);
+ case 'title':
+ case 'name':
+ return form_input($field, $value, ["placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
case 'passwd':
return sprintf(
"%s %s %s",
- form_password($field, DEFAULTS['EMPTY'], [...$attributes]),
- lang("UserSNS.label.confirmpassword"),
- form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
+ form_password($field, DEFAULTS['EMPTY']),
+ lang("{$viewDatas['className']}.label.confirmpassword"),
+ form_password('confirmpassword', DEFAULTS['EMPTY']),
);
break;
case 'content':
- return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
+ case 'head':
+ case 'tail':
+ return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case 'upload_file':
+ case 'board_file':
return form_upload($field);
break;
+ case 'view_cnt':
+ return form_input($field, $value, ['type' => 'number']);
+ break;
+ case "status":
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, $attributes);
+ break;
+ case 'updated_at':
+ case 'created_at':
+ return form_input($field, $value, ['class' => 'calender']);
+ break;
default:
- return form_input($field, $value, [...$attributes]);
+ return form_input($field, $value);
break;
}
} //
-function getFieldView_UserSNSHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
+function getFieldView_UserSNSHelper($field, $entity, array $viewDatas)
{
$value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) {
- case 'id':
- return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]);
+ case 'user_uid':
+ $categorys = array();
+ foreach (array_values($viewDatas['fieldFormOptions'][$field]) as $category_2depth) {
+ foreach ($category_2depth as $key => $label) {
+ $categorys[$key] = $label;
+ }
+ }
+ return $categorys[$value];
break;
+ case 'title':
+ case 'name':
+ return anchor(
+ current_url() . '/view/' . $entity->getPrimaryKey(),
+ $value,
+ ["target" => "_self"]
+ );
+ break;
+ case 'board_file':
case 'upload_file':
- return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
+ return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
+ break;
+ case 'view_cnt':
+ return number_format(!$value ? 0 : $value);
break;
case 'content':
return html_entity_decode($value);
break;
case 'updated_at':
case 'created_at':
- return isset($value) ? str_split($value, 10)[0] : "";
+ return $value ? str_split($value, 10)[0] : "";
break;
default:
- return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
+ return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
break;
}
} //
-function getFieldFilter_UserSNSHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldFilter_UserSNSHelper($field, $value, array $viewDatas)
+{
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, ['class' => "select-field"]);
+} //
+
+function getFieldIndex_Column_UserSNSHelper($field, array $viewDatas)
+{
+ $label = lang("{$viewDatas['className']}.label.{$field}");
+ $label = $field == $viewDatas['order_field'] ? sprintf('%s ', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
+ $value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
+ return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
+} //
+
+function getFieldIndex_Row_UserSNSHelper($field, $entity, array $viewDatas): string
{
- $value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
default:
- return getFieldForm_UserSNSHelper($field, $value, $fieldFormOptions, $attributes);
+ return getFieldView_UserSNSHelper($field, $entity, $viewDatas);
break;
}
} //
-
-function getFieldIndex_Column_UserSNSHelper($field, $order_field, $order_value, array $attributes = array())
-{
- $label = lang("UserSNS.label.{$field}");
- $label = $field == $order_field ? sprintf('%s ', $label, $order_value == 'ASC' ? "up" : "down") : $label;
- $order_value = $order_value == 'DESC' ? "ASC" : "DESC";
- return anchor(current_url() . "?order_field={$field}&order_value={$order_value}", $label, [...$attributes]);
-} //
-
-function getFieldIndex_Row_UserSNSHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
+function getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, array $viewDatas): string
{
switch ($field) {
default:
- return getFieldView_UserSNSHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
- break;
- }
-} //
-
-function getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
-{
- switch ($field) {
- default:
- if (in_array($field, $fieldFilters)) {
- $attributes["onChange"] = sprintf('location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), $entity->getPrimaryKey(), $field, $field);
- return getFieldForm_UserSNSHelper($field, $entity->$field, $fieldFormOptions, $attributes);
+ if (in_array($field, $viewDatas['fieldFilters'])) {
+ $attributes["onChange"] = sprintf(
+ 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
+ current_url(),
+ $entity->getPrimaryKey(),
+ $field,
+ $field
+ );
+ return getFieldForm_UserSNSHelper($field, $entity->field, $viewDatas, $attributes);
}
- return getFieldIndex_Row_UserSNSHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
+ return getFieldView_UserSNSHelper($field, $entity, $viewDatas);
break;
}
} //
\ No newline at end of file
diff --git a/app/Helpers/User_helper.php b/app/Helpers/User_helper.php
index 2bfa7fd..2771da9 100644
--- a/app/Helpers/User_helper.php
+++ b/app/Helpers/User_helper.php
@@ -1,127 +1,147 @@
%s", implode(" ", [...$attributes]), lang("User.label.{$field}"));
+ return sprintf("%s", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
break;
}
}
-
//header.php에서 getFieldForm_Helper사용
-function getFieldForm_UserHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldForm_UserHelper($field, $value, array $viewDatas, array $attributes = array())
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'role':
- // $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("User.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- // return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
- // return form_multiselect($field, $fieldFormOptions[$field], $value, [...$attributes]);
- foreach ($fieldFormOptions[$field] as $key => $label) {
- $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, is_array($value) ? [...$value] : explode(DEFAULTS['DELIMITER_ROLE'], $value)), $attributes) . $label;
+ // $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ // return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
+ // return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
+ foreach ($viewDatas['fieldFormOptions'][$field] as $key => $label) {
+ $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
}
return implode(" ", $checkboxs);
break;
- case "status":
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("User.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, $attributes);
- break;
- case 'updated_at':
- case 'created_at':
- return form_input($field, $value, [...$attributes, 'class' => 'calender']);
+ case 'title':
+ case 'name':
+ return form_input($field, $value, ["placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
case 'passwd':
return sprintf(
"%s %s %s",
- form_password($field, DEFAULTS['EMPTY'], [...$attributes]),
- lang("User.label.confirmpassword"),
- form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
+ form_password($field, DEFAULTS['EMPTY']),
+ lang("{$viewDatas['className']}.label.confirmpassword"),
+ form_password('confirmpassword', DEFAULTS['EMPTY']),
);
break;
case 'content':
- return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
+ case 'head':
+ case 'tail':
+ return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case 'upload_file':
+ case 'board_file':
return form_upload($field);
break;
- case 'name':
- return form_input($field, $value, [...$attributes, "placeholder" => "예)홍길동", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
+ case 'view_cnt':
+ return form_input($field, $value, ['type' => 'number']);
+ break;
+ case "status":
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, $attributes);
+ break;
+ case 'updated_at':
+ case 'created_at':
+ return form_input($field, $value, ['class' => 'calender']);
break;
default:
- return form_input($field, $value, [...$attributes]);
+ return form_input($field, $value);
break;
}
} //
-function getFieldView_UserHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
+function getFieldView_UserHelper($field, $entity, array $viewDatas)
{
$value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) {
- case 'id':
- return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]);
+ case 'title':
+ case 'name':
+ return anchor(
+ current_url() . '/view/' . $entity->getPrimaryKey(),
+ $value,
+ ["target" => "_self"]
+ );
break;
+ case 'board_file':
case 'upload_file':
- return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
+ return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
+ break;
+ case 'view_cnt':
+ return number_format(!$value ? 0 : $value);
+ break;
+ case 'content':
+ return html_entity_decode($value);
break;
case 'updated_at':
case 'created_at':
return $value ? str_split($value, 10)[0] : "";
break;
- case 'upload_file':
- return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
- break;
- case 'content':
- return html_entity_decode($value);
- break;
default:
- return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
+ return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
break;
}
} //
-function getFieldFilter_UserHelper($field, $value, array $fieldFormOptions, array $attributes = array())
+function getFieldFilter_UserHelper($field, $value, array $viewDatas)
+{
+ $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, ['class' => "select-field"]);
+} //
+
+function getFieldIndex_Column_UserHelper($field, array $viewDatas)
+{
+ $label = lang("{$viewDatas['className']}.label.{$field}");
+ $label = $field == $viewDatas['order_field'] ? sprintf('%s ', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
+ $value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
+ return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
+} //
+
+function getFieldIndex_Row_UserHelper($field, $entity, array $viewDatas): string
+{
+ switch ($field) {
+ default:
+ return getFieldView_UserHelper($field, $entity, $viewDatas);
+ break;
+ }
+} //
+function getFieldIndex_Row_UserHelper_Admin($field, $entity, array $viewDatas): string
{
- $value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'role':
- $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("User.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
- return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
- break;
- default:
- return getFieldForm_UserHelper($field, $value, $fieldFormOptions, $attributes);
- break;
- }
-} //
-
-function getFieldIndex_Column_UserHelper($field, $order_field, $order_value, array $attributes = array())
-{
- $label = lang("User.label.{$field}");
- $label = $field == $order_field ? sprintf('%s ', $label, $order_value == 'ASC' ? "up" : "down") : $label;
- $order_value = $order_value == 'DESC' ? "ASC" : "DESC";
- return anchor(current_url() . "?order_field={$field}&order_value={$order_value}", $label, [...$attributes]);
-} //
-
-function getFieldIndex_Row_UserHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
-{
- switch ($field) {
- default:
- return getFieldView_UserHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
- break;
- }
-} //
-
-function getFieldIndex_Row_UserHelper_Admin($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
-{
- switch ($field) {
- default:
- if (in_array($field, $fieldFilters)) {
- $attributes["onChange"] = sprintf('location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), $entity->getPrimaryKey(), $field, $field);
- return getFieldForm_UserHelper($field, $entity->$field, $fieldFormOptions, $attributes);
+ $value = $entity->$field ?: DEFAULTS['EMPTY'];
+ // $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
+ // return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
+ // return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
+ foreach ($viewDatas['fieldFormOptions'][$field] as $key => $label) {
+ $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
}
- return getFieldIndex_Row_UserHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
+ return implode(" ", $checkboxs);
+ break;
+ default:
+ if (in_array($field, $viewDatas['fieldFilters'])) {
+ $attributes["onChange"] = sprintf(
+ 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
+ current_url(),
+ $entity->getPrimaryKey(),
+ $field,
+ $field
+ );
+ return getFieldForm_UserHelper($field, $entity->field, $viewDatas, $attributes);
+ }
+ return getFieldView_UserHelper($field, $entity, $viewDatas);
break;
}
} //
\ No newline at end of file
diff --git a/app/Language/ko/HPILO.php b/app/Language/ko/HPILO.php
index 4bad94d..f557f9e 100644
--- a/app/Language/ko/HPILO.php
+++ b/app/Language/ko/HPILO.php
@@ -20,5 +20,5 @@ return [
'created_at' => "작성일"
],
"POWER" => ["On" => "On", "Off" => "Off", "Restart" => "Restart"],
- "STATUS" => FORM_OPTIONS['STATUS'],
+ 'STATUS' => ['use' => '사용', 'unuse' => '사용않함'],
];
diff --git a/app/Language/ko/User.php b/app/Language/ko/User.php
index a66064c..0a45307 100644
--- a/app/Language/ko/User.php
+++ b/app/Language/ko/User.php
@@ -1,6 +1,6 @@
'일반회원', 'vip' => 'VIP회원',
+ 'guest' => '비회원', 'user' => '일반회원', 'vip' => 'VIP회원',
'bronze' => '일반판매자', 'silver' => '고급판매자', 'gold' => '파워리셀러',
'manager' => '관리자', 'cloudflare' => "Cloudflare관리자", 'director' => '감독자', 'master' => "마스터",
];
diff --git a/app/Models/BaseModel.php b/app/Models/BaseModel.php
index 3ca3e65..c5a3cd3 100644
--- a/app/Models/BaseModel.php
+++ b/app/Models/BaseModel.php
@@ -272,8 +272,10 @@ abstract class BaseModel extends Model
}
public function setIndexDateFilter($start, $end)
{
- $this->where("created_at >=", $start);
- $this->where("created_at <=", $end);
+ if ($start !== DEFAULTS['EMPTY'] && $end !== DEFAULTS['EMPTY']) {
+ $this->where("created_at >=", $start);
+ $this->where("created_at <=", $end);
+ }
}
public function setIndexOrderBy(?string $field, ?string $order)
{
diff --git a/app/Models/BoardModel.php b/app/Models/BoardModel.php
index 12bd14d..cbf1cc6 100644
--- a/app/Models/BoardModel.php
+++ b/app/Models/BoardModel.php
@@ -91,9 +91,11 @@ class BoardModel extends BaseHierarchyModel
//Index관련
public function setIndexWordFilter(string $word)
{
- parent::setIndexWordFilter($word);
- $this->orLike($this->getTitleField(), $word, "both");
- $this->orLike("content", $word, "both"); //befor , after , both
+ if ($word !== DEFAULTS['EMPTY']) {
+ parent::setIndexWordFilter($word);
+ $this->orLike($this->getTitleField(), $word, "both");
+ $this->orLike("content", $word, "both"); //befor , after , both
+ }
}
//조회수 올리기
diff --git a/app/Models/CategoryModel.php b/app/Models/CategoryModel.php
index ad37038..2d7bcd1 100644
--- a/app/Models/CategoryModel.php
+++ b/app/Models/CategoryModel.php
@@ -75,7 +75,6 @@ class CategoryModel extends BaseHierarchyModel
case "isreply":
case "isupload":
case "isdownload":
- case "isaccess":
if (array_key_exists($field, $formDatas) && !is_null($formDatas[$field])) {
$entity->$field = is_array($formDatas[$field]) ? implode(DEFAULTS['DELIMITER_ROLE'], $formDatas[$field]) : $formDatas[$field];
}
@@ -114,15 +113,8 @@ class CategoryModel extends BaseHierarchyModel
public function setIndexWordFilter(string $word)
{
parent::setIndexWordFilter($word);
- $this->orLike($this->getTitle(), $word, "both"); //befor , after , both
- $this->orLike($word, "both"); //befor , after , both
+ $this->orLike($this->getTitleField(), $word, "both");
$this->orLike("head", $word, "both"); //befor , after , both
$this->orLike("tail", $word, "both"); //befor , after , both
- $this->orLike("isaccess", $word, "both"); //befor , after , both
- $this->orLike("isread", $word, "both"); //befor , after , both
- $this->orLike("iswrite", $word, "both"); //befor , after , both
- $this->orLike("isreply", $word, "both"); //befor , after , both
- $this->orLike("isupload", $word, "both"); //befor , after , both
- $this->orLike("isdownload", $word, "both"); //befor , after , both
}
}
diff --git a/app/Models/HPILOModel.php b/app/Models/HPILOModel.php
index 259746c..609fbf9 100644
--- a/app/Models/HPILOModel.php
+++ b/app/Models/HPILOModel.php
@@ -10,33 +10,24 @@ class HPILOModel extends BaseModel
protected $returnType = HPILOEntity::class;
public function __construct()
{
- parent::__construct();
- $this->allowedFields = [...$this->allowedFields, ...$this->getFields(), 'model', 'processor', 'memory', 'health', 'power', 'detail',];
- $this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
+ parent::__construct('HPILO');
+ $this->allowedFields = [
+ ...$this->allowedFields,
+ 'customer', 'ip', 'port', 'id', 'passwd', 'status',
+ 'model', 'processor', 'memory', 'health', 'power', 'detail',
+ ];
+ $this->validationRules = [
+ ...$this->validationRules,
+ ...$this->getFieldRules($this->allowedFields),
+ ];
}
- public function getTitle(): string
+ public function getTitleField(): string
{
return 'customer';
}
- public function getFields(string $action = ""): array
+ public function getContentField(): string
{
- $fields = [$this->getTitle(), 'ip', 'port', 'id', 'passwd', 'status'];
- switch ($action) {
- case "index":
- case "excel":
- return [$this->getTitle(), 'ip', 'port', 'model', 'processor', 'memory', 'health', 'power', 'status', 'created_at'];
- break;
- case "view":
- return [$this->getTitle(), 'ip', 'port', 'id', 'model', 'processor', 'memory', 'health', 'power', 'detail', 'status', 'updated_at', 'created_at'];
- break;
- default:
- return $fields;
- break;
- }
- }
- public function getFieldFilters(array $fields = array()): array
- {
- return ["power", "status", ...$fields];
+ return 'model';
}
protected function getFieldRule(string $field, array $rules, string $action = ""): array
{
@@ -102,7 +93,9 @@ class HPILOModel extends BaseModel
//Index관련
public function setIndexWordFilter(string $word)
{
- parent::setIndexWordFilter($word);
- $this->orLike($this->getTitle(), $word, "both"); //befor , after , both
+ if ($word !== DEFAULTS['EMPTY']) {
+ parent::setIndexWordFilter($word);
+ $this->orLike($this->getTitleField(), $word, "both"); //befor , after , both
+ }
}
}
diff --git a/app/Models/UserModel.php b/app/Models/UserModel.php
index 0793a37..c41b5a5 100644
--- a/app/Models/UserModel.php
+++ b/app/Models/UserModel.php
@@ -106,7 +106,7 @@ class UserModel extends BaseModel
public function setIndexWordFilter(string $word)
{
parent::setIndexWordFilter($word);
- $this->orLike("id", $word, "both");
$this->orLike($this->getTitleField(), $word, "both"); //befor , after , both
+ $this->orLike("id", $word, "both");
}
}
diff --git a/app/Views/admin/board/index.php b/app/Views/admin/board/index.php
index 0e4ec9b..92f4da4 100644
--- a/app/Views/admin/board/index.php
+++ b/app/Views/admin/board/index.php
@@ -4,42 +4,42 @@
= form_open(current_url(), array("method" => "get")) ?>
- 조건검색:- = getFieldFilter_BoardHelper($field, $$field, $fieldFormOptions) ?>
- = $this->include('templates/admin/index_head'); ?>
+ 조건검색:= getFieldFilter_BoardHelper($field, $viewDatas[$field], $viewDatas) ?>
+ = $this->include('templates/admin/index_head') ?>
- = form_close(); ?>
+ = form_close() ?>
- = form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
+ = form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
| 번호 |
- = getFieldIndex_Column_BoardHelper($field, $order_field, $order_value) ?> |
+ = getFieldIndex_Column_BoardHelper($field, $viewDatas) ?> |
작업 |
-
-
- getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this);">
+
+
+
getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
- = anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?>
+ = anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
-
- = getFieldIndex_Row_BoardHelper_Admin($field, $entity, $fieldFilters, $fieldFormOptions) ?> |
-
+
+ = getFieldIndex_Row_BoardHelper_Admin($field, $entity, $viewDatas) ?> |
+
= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?> |
-
-
+
+
- = form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL
- - = getFieldFilter_BoardHelper($field, DEFAULTS['EMPTY'], $fieldFormOptions) ?>
- - = form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")); ?>
+ = getFieldFilter_BoardHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
+ - = form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")) ?>
- = anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
- = $pagination ?>
+ = $viewDatas['pagination'] ?>
- = form_close(); ?>
+ = form_close() ?>
= $this->endSection() ?>
\ No newline at end of file
diff --git a/app/Views/admin/board/insert.php b/app/Views/admin/board/insert.php
index 4f58b75..3f6857e 100644
--- a/app/Views/admin/board/insert.php
+++ b/app/Views/admin/board/insert.php
@@ -1,13 +1,13 @@
= $this->extend('layouts/admin') ?>
= $this->section('content') ?>
- = form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
+ = form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>