diff --git a/app/Controllers/Admin/AdminController.php b/app/Controllers/Admin/AdminController.php index 31f1654..daa9ee1 100644 --- a/app/Controllers/Admin/AdminController.php +++ b/app/Controllers/Admin/AdminController.php @@ -48,7 +48,7 @@ abstract class AdminController extends CommonController $this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters()); $this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions()); $this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFilters()); - $this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons()); + $this->addViewDatas('index_batchjobButtons', $this->service->getFormService()->getBatchjobButtons()); parent::action_init_process($action); } protected function create_form_process(array $formDatas = []): array diff --git a/app/Forms/CommonForm.php b/app/Forms/CommonForm.php index 74d9047..2576909 100644 --- a/app/Forms/CommonForm.php +++ b/app/Forms/CommonForm.php @@ -13,6 +13,8 @@ abstract class CommonForm private array $_formFilters = []; private array $_batchjobFilters = []; private array $_formOptions = []; + private array $_actionButtons = ['view' => ICONS['SEARCH'], 'delete' => ICONS['DELETE']]; + private array $_batchjobButtons = ['batchjob' => '일괄처리', 'batchjob_delete' => '일괄삭제']; protected function __construct() {} final public function setAttributes(array $attributes): void { @@ -94,12 +96,21 @@ abstract class CommonForm { return $this->_batchjobFilters; } - final public function getBatchjobButtons(array $buttions = [ - 'batchjob' => '일괄 처리', - 'batchjob_delete' => '일괄 삭제', - ]): array + final public function setActionButtons(array $buttions): array { - return $buttions; + return $this->_actionButtons = $buttions; + } + final public function getActionButtons(): array + { + return $this->_actionButtons; + } + final public function setBatchjobButtons(array $buttions): array + { + return $this->_batchjobButtons = $buttions; + } + final public function getBatchjobButtons(): array + { + return $this->_batchjobButtons; } //Validation용 public function validate(array $formDatas): bool diff --git a/app/Helpers/CommonHelper.php b/app/Helpers/CommonHelper.php index b0dc85a..f01900e 100644 --- a/app/Helpers/CommonHelper.php +++ b/app/Helpers/CommonHelper.php @@ -212,7 +212,7 @@ class CommonHelper switch ($action) { case 'create': $action = form_label( - $label ? $label : '입력', + $label, $action, [ "data-src" => current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(), @@ -234,7 +234,7 @@ class CommonHelper "checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids) ]); $action = $checkbox . form_label( - $label ? $label : '수정', + $label, $action, [ "data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(), @@ -247,7 +247,7 @@ class CommonHelper break; case 'view': $action = form_label( - $label ? $label : ICONS['SEARCH'], + $label, $action, [ "data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(), @@ -261,7 +261,7 @@ class CommonHelper case 'delete': $action = anchor( current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(), - $label ? $label : ICONS['DELETE'], + $label, [ "class" => "btn btn-sm btn-danger form-label-sm", ...$extras @@ -269,7 +269,7 @@ class CommonHelper ); break; case 'batchjob': - $action = form_submit("batchjob_submit", $label ? $label : '일괄처리', [ + $action = form_submit("batchjob_submit", $label, [ "formaction" => current_url() . '/batchjob', "class" => "btn btn-sm btn-warning form-label-sm", ...$extras, @@ -277,7 +277,7 @@ class CommonHelper ]); break; case 'batchjob_delete': - $action = form_submit("batchjob_submit", $label ? $label : '일괄삭제', [ + $action = form_submit("batchjob_submit", $label, [ "formaction" => current_url() . '/batchjob_delete', "class" => "btn btn-sm btn-danger form-label-sm", ...$extras, diff --git a/app/Helpers/TrafficHelper.php b/app/Helpers/TrafficHelper.php index f3a038a..ac6f4ff 100644 --- a/app/Helpers/TrafficHelper.php +++ b/app/Helpers/TrafficHelper.php @@ -16,7 +16,7 @@ class TrafficHelper extends CommonHelper switch ($action) { case 'dashboard': $action = form_label( - $label ? $label : ICONS['SEARCH'], + $label, $action, [ "data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(), diff --git a/app/Views/admin/index.php b/app/Views/admin/index.php index 433b4e8..dc4ea5f 100644 --- a/app/Views/admin/index.php +++ b/app/Views/admin/index.php @@ -37,8 +37,9 @@ $template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";