cfmgrv4 init...1
This commit is contained in:
parent
d5fd167712
commit
6ac8f794ce
@ -105,7 +105,7 @@ define('DEFAULTS', [
|
|||||||
define('FORMS', [
|
define('FORMS', [
|
||||||
'MODAL' => 'modal_form',
|
'MODAL' => 'modal_form',
|
||||||
'IFRAME' => 'iframe_form',
|
'IFRAME' => 'iframe_form',
|
||||||
'ACTION' => 'action_form',
|
'DIRECT' => 'direct_form',
|
||||||
]);
|
]);
|
||||||
//URL
|
//URL
|
||||||
define('URLS', [
|
define('URLS', [
|
||||||
|
|||||||
@ -18,5 +18,6 @@ abstract class AdminController extends MVController
|
|||||||
$this->root = "Admin/";
|
$this->root = "Admin/";
|
||||||
$this->layout = "admin";
|
$this->layout = "admin";
|
||||||
$this->session = $this->session_AuthTrait();
|
$this->session = $this->session_AuthTrait();
|
||||||
|
$this->action_form = FORMS['MODAL'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,6 @@ class AccountController extends CloudflareController
|
|||||||
$this->class_name = "Account";
|
$this->class_name = "Account";
|
||||||
$this->class_path = $this->root . $this->class_name;
|
$this->class_path = $this->root . $this->class_name;
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
$this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form";
|
|
||||||
helper($this->class_path);
|
helper($this->class_path);
|
||||||
}
|
}
|
||||||
final protected function getModel(): AccountModel
|
final protected function getModel(): AccountModel
|
||||||
|
|||||||
@ -19,7 +19,6 @@ class AuthController extends CloudflareController
|
|||||||
$this->class_name = "Auth";
|
$this->class_name = "Auth";
|
||||||
$this->class_path = $this->root . $this->class_name;
|
$this->class_path = $this->root . $this->class_name;
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
$this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form";
|
|
||||||
helper($this->class_path);
|
helper($this->class_path);
|
||||||
}
|
}
|
||||||
final protected function getModel(): AuthModel
|
final protected function getModel(): AuthModel
|
||||||
|
|||||||
@ -10,7 +10,6 @@ use App\Models\Cloudflare\ZoneModel;
|
|||||||
use App\Models\Cloudflare\RecordModel;
|
use App\Models\Cloudflare\RecordModel;
|
||||||
use App\Models\Cloudflare\AuthModel;
|
use App\Models\Cloudflare\AuthModel;
|
||||||
use App\Models\Cloudflare\AccountModel;
|
use App\Models\Cloudflare\AccountModel;
|
||||||
use App\Entities\Cloudflare\AccountEntity;
|
|
||||||
use App\Controllers\Admin\AdminController;
|
use App\Controllers\Admin\AdminController;
|
||||||
|
|
||||||
abstract class CloudflareController extends AdminController
|
abstract class CloudflareController extends AdminController
|
||||||
|
|||||||
@ -19,7 +19,6 @@ class RecordController extends CloudflareController
|
|||||||
$this->class_name = "Record";
|
$this->class_name = "Record";
|
||||||
$this->class_path = $this->root . $this->class_name;
|
$this->class_path = $this->root . $this->class_name;
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
$this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form";
|
|
||||||
helper($this->class_path);
|
helper($this->class_path);
|
||||||
}
|
}
|
||||||
final protected function getModel(): RecordModel
|
final protected function getModel(): RecordModel
|
||||||
|
|||||||
@ -22,7 +22,6 @@ class ZoneController extends CloudflareController
|
|||||||
$this->class_name = "Zone";
|
$this->class_name = "Zone";
|
||||||
$this->class_path = $this->root . $this->class_name;
|
$this->class_path = $this->root . $this->class_name;
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
$this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form";
|
|
||||||
helper($this->class_path);
|
helper($this->class_path);
|
||||||
}
|
}
|
||||||
final protected function getModel(): ZoneModel
|
final protected function getModel(): ZoneModel
|
||||||
|
|||||||
@ -19,7 +19,6 @@ class MapurlController extends AdminController
|
|||||||
$this->class_name = "Mapurl";
|
$this->class_name = "Mapurl";
|
||||||
$this->class_path = $this->root . $this->class_name;
|
$this->class_path = $this->root . $this->class_name;
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
$this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form";
|
|
||||||
helper($this->class_path);
|
helper($this->class_path);
|
||||||
}
|
}
|
||||||
protected function getModel(): MapurlModel
|
protected function getModel(): MapurlModel
|
||||||
|
|||||||
@ -20,7 +20,6 @@ class UserController extends AdminController
|
|||||||
$this->class_name = "User";
|
$this->class_name = "User";
|
||||||
$this->class_path = $this->root . $this->class_name;
|
$this->class_path = $this->root . $this->class_name;
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
$this->action_form = getenv("mvc.default." . strtolower($this->class_name) . ".form") ?: "modal_form";
|
|
||||||
helper($this->class_path);
|
helper($this->class_path);
|
||||||
}
|
}
|
||||||
protected function getModel(): UserModel
|
protected function getModel(): UserModel
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Entities\Cloudflare\AccountEntity;
|
|
||||||
use App\Models\Cloudflare\AccountModel;
|
use App\Models\Cloudflare\AccountModel;
|
||||||
|
|
||||||
function getFieldLabel_AccountHelper(string $field, array $viewDatas, array $extras = []): string
|
function getFieldLabel_AccountHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
@ -53,17 +52,17 @@ function getFieldForm_AccountHelper(string $field, mixed $value, array $viewData
|
|||||||
}
|
}
|
||||||
return $form;
|
return $form;
|
||||||
} //
|
} //
|
||||||
function getFieldView_AccountHelper(string $field, AccountEntity $entity, array $viewDatas, array $extras = [])
|
function getFieldView_AccountHelper(string $field, array $viewDatas, array $extras = [])
|
||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case AccountModel::PARENT:
|
case AccountModel::PARENT:
|
||||||
if ($extras['old_auth'] === $entity->getParent()) {
|
if ($viewDatas['old_auth'] === $viewDatas['entity']->getParent()) {
|
||||||
$value = "";
|
$value = "";
|
||||||
} else {
|
} else {
|
||||||
// dd($viewDatas['field_options']);
|
// dd($viewDatas['field_options']);
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . "auth/reload/" . $entity->getParent(),
|
base_url() . strtolower($viewDatas['root']) . "auth/reload/" . $viewDatas['entity']->getParent(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -76,7 +75,7 @@ function getFieldView_AccountHelper(string $field, AccountEntity $entity, array
|
|||||||
break;
|
break;
|
||||||
case AccountModel::TITLE:
|
case AccountModel::TITLE:
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
current_url() . '/reload/' . $entity->getPK(),
|
current_url() . '/reload/' . $viewDatas['entity']->getPK(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -84,7 +83,7 @@ function getFieldView_AccountHelper(string $field, AccountEntity $entity, array
|
|||||||
]
|
]
|
||||||
) . " " .
|
) . " " .
|
||||||
anchor(
|
anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . "zone?account_uid=" . $entity->getPK(),
|
base_url() . strtolower($viewDatas['root']) . "zone?account_uid=" . $viewDatas['entity']->getPK(),
|
||||||
ICONS["FLAG"],
|
ICONS["FLAG"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -110,17 +109,17 @@ function getFieldView_AccountHelper(string $field, AccountEntity $entity, array
|
|||||||
// $extras["onChange"] = sprintf(
|
// $extras["onChange"] = sprintf(
|
||||||
// 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
// 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
||||||
// current_url(),
|
// current_url(),
|
||||||
// $entity->getPK(),
|
// $viewDatas['entity']->getPK(),
|
||||||
// $field,
|
// $field,
|
||||||
// $field
|
// $field
|
||||||
// );
|
// );
|
||||||
// $value = getFieldForm_AccountHelper($field, $entity->$field, $viewDatas, $extras);
|
// $value = getFieldForm_AccountHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
||||||
// }
|
// }
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
} //
|
} //
|
||||||
function getListColumns_AccountHelper(string $field, array $viewDatas, array $extras = []): string
|
function getListLabel_AccountHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
{
|
{
|
||||||
$label = getFieldLabel_AccountHelper($field, $viewDatas, $extras);
|
$label = getFieldLabel_AccountHelper($field, $viewDatas, $extras);
|
||||||
if ($field == $viewDatas['order_field']) {
|
if ($field == $viewDatas['order_field']) {
|
||||||
@ -131,10 +130,66 @@ function getListColumns_AccountHelper(string $field, array $viewDatas, array $ex
|
|||||||
$viewDatas['uri']->addQuery('order_value', $order_value);
|
$viewDatas['uri']->addQuery('order_value', $order_value);
|
||||||
$label = anchor((string)$viewDatas['uri'], $label);
|
$label = anchor((string)$viewDatas['uri'], $label);
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case AccountModel::PARENT:
|
|
||||||
break;
|
|
||||||
case AccountModel::TITLE:
|
case AccountModel::TITLE:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
||||||
}
|
}
|
||||||
|
function getListButtonLabel_AccountHelper(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$label = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $viewDatas['list_action_url'],
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
if ($action == 'create') {
|
||||||
|
$label = form_label($label, "", [
|
||||||
|
"onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')",
|
||||||
|
...$extras,
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$label = "";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$label = anchor($viewDatas['list_action_url'], $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
function getListButton_AccountHelper(string $action, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
$viewDatas['list_action_url'] = $url = current_url() . '/' . $action;
|
||||||
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = getListButtonLabel_AccountHelper($action, '입력', $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
// $checkbox = form_checkbox([
|
||||||
|
// "id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||||
|
// "name" => "batchjob_uids[]",
|
||||||
|
// "value" => $viewDatas['entity']->getPK(),
|
||||||
|
// "class" => "batchjobuids_checkboxs"
|
||||||
|
// ]);
|
||||||
|
// $viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
// $action = $checkbox . getListButtonLabel_AccountHelper($action, $viewDatas['cnt'], $viewDatas, $extras);
|
||||||
|
$action = $viewDatas['cnt'];
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $action;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Entities\Cloudflare\AuthEntity;
|
|
||||||
use App\Models\Cloudflare\AuthModel;
|
use App\Models\Cloudflare\AuthModel;
|
||||||
|
|
||||||
function getFieldLabel_AuthHelper(string $field, array $viewDatas, array $extras = []): string
|
function getFieldLabel_AuthHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
@ -38,13 +37,13 @@ function getFieldForm_AuthHelper(string $field, mixed $value, array $viewDatas,
|
|||||||
}
|
}
|
||||||
return $form;
|
return $form;
|
||||||
} //
|
} //
|
||||||
function getFieldView_AuthHelper(string $field, AuthEntity $entity, array $viewDatas, array $extras = [])
|
function getFieldView_AuthHelper(string $field, array $viewDatas, array $extras = [])
|
||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case AuthModel::TITLE:
|
case AuthModel::TITLE:
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
current_url() . '/reload/' . $entity->getPK(),
|
current_url() . '/reload/' . $viewDatas['entity']->getPK(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -52,7 +51,7 @@ function getFieldView_AuthHelper(string $field, AuthEntity $entity, array $viewD
|
|||||||
]
|
]
|
||||||
) . " " .
|
) . " " .
|
||||||
anchor(
|
anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . "account?auth_uid=" . $entity->getPK(),
|
base_url() . strtolower($viewDatas['root']) . "account?auth_uid=" . $viewDatas['entity']->getPK(),
|
||||||
ICONS["FLAG"],
|
ICONS["FLAG"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -78,64 +77,17 @@ function getFieldView_AuthHelper(string $field, AuthEntity $entity, array $viewD
|
|||||||
$extras["onChange"] = sprintf(
|
$extras["onChange"] = sprintf(
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
||||||
current_url(),
|
current_url(),
|
||||||
$entity->getPK(),
|
$viewDatas['entity']->getPK(),
|
||||||
$field,
|
$field,
|
||||||
$field
|
$field
|
||||||
);
|
);
|
||||||
$value = getFieldForm_AuthHelper($field, $entity->$field, $viewDatas, $extras);
|
$value = getFieldForm_AuthHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
} //
|
} //
|
||||||
function getListAction_AuthHelper(string $action, $entity, array $viewDatas, array $extras = []): string
|
function getListLabel_AuthHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'modify':
|
|
||||||
$cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']);
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$entity->getPK()}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $entity->getPK(),
|
|
||||||
"class" => "batchjobuids_checkboxs"
|
|
||||||
]);
|
|
||||||
$url = current_url() . '/' . $action . '/' . $entity->getPK();
|
|
||||||
switch ($viewDatas['action_form']) {
|
|
||||||
case FORMS['MODAL']:
|
|
||||||
$value = form_label(
|
|
||||||
$cnt,
|
|
||||||
"",
|
|
||||||
[
|
|
||||||
"data-src" => $url,
|
|
||||||
"data-bs-toggle" => "modal",
|
|
||||||
"data-bs-target" => "#index_action_form",
|
|
||||||
...$extras
|
|
||||||
]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case FORMS['IFRAME']:
|
|
||||||
$value = form_label($cnt, "", [
|
|
||||||
"onClick" => "changeIframe_src('{$url}')",
|
|
||||||
...$extras
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$value = anchor($url, $cnt, $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$result = $checkbox . $value;
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$result = anchor(
|
|
||||||
current_url() . '/delete/' . $entity->getPK(),
|
|
||||||
ICONS['DELETE'],
|
|
||||||
["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
function getListColumns_AuthHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
{
|
||||||
$label = getFieldLabel_AuthHelper($field, $viewDatas, $extras);
|
$label = getFieldLabel_AuthHelper($field, $viewDatas, $extras);
|
||||||
if ($field == $viewDatas['order_field']) {
|
if ($field == $viewDatas['order_field']) {
|
||||||
@ -151,3 +103,60 @@ function getListColumns_AuthHelper(string $field, array $viewDatas, array $extra
|
|||||||
}
|
}
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
||||||
}
|
}
|
||||||
|
function getListButtonLabel_AuthHelper(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$label = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $viewDatas['list_action_url'],
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
if ($action == 'create') {
|
||||||
|
$label = form_label($label, "", [
|
||||||
|
"onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')",
|
||||||
|
...$extras,
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$label = "";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$label = anchor($viewDatas['list_action_url'], $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
function getListButton_AuthHelper(string $action, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
$viewDatas['list_action_url'] = $url = current_url() . '/' . $action;
|
||||||
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = getListButtonLabel_AuthHelper($action, '입력', $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
$checkbox = form_checkbox([
|
||||||
|
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||||
|
"name" => "batchjob_uids[]",
|
||||||
|
"value" => $viewDatas['entity']->getPK(),
|
||||||
|
"class" => "batchjobuids_checkboxs"
|
||||||
|
]);
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$action = $checkbox . getListButtonLabel_AuthHelper($action, $viewDatas['cnt'], $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $action;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Entities\Cloudflare\RecordEntity;
|
|
||||||
use App\Models\Cloudflare\RecordModel;
|
use App\Models\Cloudflare\RecordModel;
|
||||||
|
|
||||||
function getFieldLabel_RecordHelper(string $field, array $viewDatas, array $extras = []): string
|
function getFieldLabel_RecordHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
@ -62,16 +61,16 @@ function getFieldForm_RecordHelper(string $field, mixed $value, array $viewDatas
|
|||||||
}
|
}
|
||||||
return $form;
|
return $form;
|
||||||
} //
|
} //
|
||||||
function getFieldView_RecordHelper(string $field, RecordEntity $entity, array $viewDatas, array $extras = [])
|
function getFieldView_RecordHelper(string $field, array $viewDatas, array $extras = [])
|
||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case RecordModel::PARENT:
|
case RecordModel::PARENT:
|
||||||
if ($extras['old_zone'] === $entity->getParent()) {
|
if ($viewDatas['old_zone'] === $viewDatas['entity']->getParent()) {
|
||||||
$value = "";
|
$value = "";
|
||||||
} else {
|
} else {
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . 'zone/reload/' . $entity->getParent(),
|
base_url() . strtolower($viewDatas['root']) . 'zone/reload/' . $viewDatas['entity']->getParent(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -81,8 +80,8 @@ function getFieldView_RecordHelper(string $field, RecordEntity $entity, array $v
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RecordModel::TITLE:
|
case RecordModel::TITLE:
|
||||||
$url = sprintf("%s/toggle/%s?fixed=%s", current_url(), $entity->getPK(), $entity->fixed == 'on' ? "off" : "on");
|
$url = sprintf("%s/toggle/%s?fixed=%s", current_url(), $viewDatas['entity']->getPK(), $viewDatas['entity']->fixed == 'on' ? "off" : "on");
|
||||||
$value = sprintf("%s%s", $entity->fixed == 'on' ? ICONS['LOCK'] : "", $value);
|
$value = sprintf("%s%s", $viewDatas['entity']->fixed == 'on' ? ICONS['LOCK'] : "", $value);
|
||||||
$value = anchor($url, $value, ["target" => "_self"]);
|
$value = anchor($url, $value, ["target" => "_self"]);
|
||||||
break;
|
break;
|
||||||
case 'category_uid':
|
case 'category_uid':
|
||||||
@ -108,45 +107,18 @@ function getFieldView_RecordHelper(string $field, RecordEntity $entity, array $v
|
|||||||
$extras["onChange"] = sprintf(
|
$extras["onChange"] = sprintf(
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
||||||
current_url(),
|
current_url(),
|
||||||
$entity->getPK(),
|
$viewDatas['entity']->getPK(),
|
||||||
$field,
|
$field,
|
||||||
$field
|
$field
|
||||||
);
|
);
|
||||||
$value = getFieldForm_RecordHelper($field, $entity->$field, $viewDatas, $extras);
|
$value = getFieldForm_RecordHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
} //
|
} //
|
||||||
function getListAction_RecordHelper(string $action, $entity, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
function getListLabel_RecordHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
switch ($action) {
|
|
||||||
case 'sync':
|
|
||||||
$cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']);
|
|
||||||
$checkbox = "";
|
|
||||||
if ($entity->fixed == 'off' && $entity->type == 'A') {
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$entity->getPK()}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $entity->getPK(),
|
|
||||||
"class" => "batchjobuids_checkboxs",
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
$url = current_url() . '/' . $action . '/' . $entity->getPK();
|
|
||||||
$value = anchor($url, $cnt, $extras);
|
|
||||||
$result = $checkbox . $value;
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$result = anchor(
|
|
||||||
current_url() . '/delete/' . $entity->getPK(),
|
|
||||||
ICONS['DELETE'],
|
|
||||||
["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
function getListColumns_RecordHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
{
|
||||||
$label = getFieldLabel_RecordHelper($field, $viewDatas, $extras);
|
$label = getFieldLabel_RecordHelper($field, $viewDatas, $extras);
|
||||||
if ($field == $viewDatas['order_field']) {
|
if ($field == $viewDatas['order_field']) {
|
||||||
@ -166,3 +138,86 @@ function getListColumns_RecordHelper(string $field, array $viewDatas, array $ext
|
|||||||
}
|
}
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
||||||
}
|
}
|
||||||
|
function getListButtonLabel_RecordHelper(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$value = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $viewDatas['list_action_url'],
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
$value = "";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = anchor($viewDatas['list_action_url'], $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$value = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $viewDatas['list_action_url'],
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
$value = form_label($label, "", [
|
||||||
|
"onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')",
|
||||||
|
...$extras
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = anchor($viewDatas['list_action_url'], $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
function getListButton_RecordHelper(string $action, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
$viewDatas['list_action_url'] = $url = current_url() . '/' . $action;
|
||||||
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = getListButtonLabel_RecordHelper($action, '입력', $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'sync':
|
||||||
|
$checkbox = "";
|
||||||
|
if ($viewDatas['entity']->type == "A" && $viewDatas['entity']->fixed != 'on')
|
||||||
|
$checkbox = form_checkbox([
|
||||||
|
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||||
|
"name" => "batchjob_uids[]",
|
||||||
|
"value" => $viewDatas['entity']->getPK(),
|
||||||
|
"class" => "batchjobuids_checkboxs"
|
||||||
|
]);
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$action = $checkbox . anchor($viewDatas['list_action_url'], $viewDatas['cnt'], $extras);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $action;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Entities\Cloudflare\ZoneEntity;
|
|
||||||
use App\Models\Cloudflare\ZoneModel;
|
use App\Models\Cloudflare\ZoneModel;
|
||||||
|
|
||||||
function getFieldLabel_ZoneHelper(string $field, array $viewDatas, array $extras = []): string
|
function getFieldLabel_ZoneHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
@ -71,16 +70,16 @@ function getFieldForm_ZoneHelper(string $field, mixed $value, array $viewDatas,
|
|||||||
}
|
}
|
||||||
return $form;
|
return $form;
|
||||||
} //
|
} //
|
||||||
function getFieldView_ZoneHelper(string $field, ZoneEntity $entity, array $viewDatas, array $extras = [])
|
function getFieldView_ZoneHelper(string $field, array $viewDatas, array $extras = [])
|
||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case ZoneModel::PARENT:
|
case ZoneModel::PARENT:
|
||||||
if ($extras['old_account'] === $entity->getParent()) {
|
if ($viewDatas['old_account'] === $viewDatas['entity']->getParent()) {
|
||||||
$value = "";
|
$value = "";
|
||||||
} else {
|
} else {
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . "account/reload/" . $entity->getParent(),
|
base_url() . strtolower($viewDatas['root']) . "account/reload/" . $viewDatas['entity']->getParent(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -93,7 +92,7 @@ function getFieldView_ZoneHelper(string $field, ZoneEntity $entity, array $viewD
|
|||||||
break;
|
break;
|
||||||
case ZoneModel::TITLE:
|
case ZoneModel::TITLE:
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
current_url() . '/reload/' . $entity->getPK(),
|
current_url() . '/reload/' . $viewDatas['entity']->getPK(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -101,7 +100,7 @@ function getFieldView_ZoneHelper(string $field, ZoneEntity $entity, array $viewD
|
|||||||
]
|
]
|
||||||
) . " " .
|
) . " " .
|
||||||
anchor(
|
anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . "record?zone_uid=" . $entity->getPK(),
|
base_url() . strtolower($viewDatas['root']) . "record?zone_uid=" . $viewDatas['entity']->getPK(),
|
||||||
ICONS["FLAG"],
|
ICONS["FLAG"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -136,42 +135,17 @@ function getFieldView_ZoneHelper(string $field, ZoneEntity $entity, array $viewD
|
|||||||
$extras["onChange"] = sprintf(
|
$extras["onChange"] = sprintf(
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
||||||
current_url(),
|
current_url(),
|
||||||
$entity->getPK(),
|
$viewDatas['entity']->getPK(),
|
||||||
$field,
|
$field,
|
||||||
$field
|
$field
|
||||||
);
|
);
|
||||||
$value = getFieldForm_ZoneHelper($field, $entity->$field, $viewDatas, $extras);
|
$value = getFieldForm_ZoneHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
} //
|
} //
|
||||||
function getListAction_ZoneHelper(string $action, $entity, array $viewDatas, array $extras = []): string
|
function getListLabel_ZoneHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'sync':
|
|
||||||
$cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']);
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$entity->getPK()}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $entity->getPK(),
|
|
||||||
"class" => "batchjobuids_checkboxs",
|
|
||||||
]);
|
|
||||||
$url = current_url() . '/' . $action . '/' . $entity->getPK();
|
|
||||||
$value = anchor($url, $cnt, $extras);
|
|
||||||
$result = $checkbox . $value;
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$result = anchor(
|
|
||||||
current_url() . '/delete/' . $entity->getPK(),
|
|
||||||
ICONS['DELETE'],
|
|
||||||
["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
function getListColumns_ZoneHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
{
|
||||||
$label = getFieldLabel_ZoneHelper($field, $viewDatas, $extras);
|
$label = getFieldLabel_ZoneHelper($field, $viewDatas, $extras);
|
||||||
if ($field == $viewDatas['order_field']) {
|
if ($field == $viewDatas['order_field']) {
|
||||||
@ -190,3 +164,84 @@ function getListColumns_ZoneHelper(string $field, array $viewDatas, array $extra
|
|||||||
}
|
}
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
||||||
}
|
}
|
||||||
|
function getListButtonLabel_ZoneHelper(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$value = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $viewDatas['list_action_url'],
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
$value = "";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = anchor($viewDatas['list_action_url'], $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$value = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $viewDatas['list_action_url'],
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
$value = form_label($label, "", [
|
||||||
|
"onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')",
|
||||||
|
...$extras
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = anchor($viewDatas['list_action_url'], $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
function getListButton_ZoneHelper(string $action, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
$viewDatas['list_action_url'] = $url = current_url() . '/' . $action;
|
||||||
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = getListButtonLabel_ZoneHelper($action, '입력', $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'sync':
|
||||||
|
$checkbox = form_checkbox([
|
||||||
|
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||||
|
"name" => "batchjob_uids[]",
|
||||||
|
"value" => $viewDatas['entity']->getPK(),
|
||||||
|
"class" => "batchjobuids_checkboxs"
|
||||||
|
]);
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$action = $checkbox . anchor($viewDatas['list_action_url'], $viewDatas['cnt'], $extras);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $action;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Entities\MapurlEntity;
|
|
||||||
use App\Models\MapurlModel;
|
use App\Models\MapurlModel;
|
||||||
|
|
||||||
function getFieldLabel_MapurlHelper(string $field, array $viewDatas, array $extras = []): string
|
function getFieldLabel_MapurlHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
@ -41,13 +40,13 @@ function getFieldForm_MapurlHelper(string $field, mixed $value, array $viewDatas
|
|||||||
}
|
}
|
||||||
return $form;
|
return $form;
|
||||||
} //
|
} //
|
||||||
function getFieldView_MapurlHelper(string $field, MapurlEntity $entity, array $viewDatas, array $extras = [])
|
function getFieldView_MapurlHelper(string $field, array $viewDatas, array $extras = [])
|
||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case MapurlModel::TITLE:
|
case MapurlModel::TITLE:
|
||||||
// $value = anchor(
|
// $value = anchor(
|
||||||
// current_url() . '/view/' . $entity->getPK(),
|
// current_url() . '/view/' . $viewDatas['entity']->getPK(),
|
||||||
// $value,
|
// $value,
|
||||||
// [
|
// [
|
||||||
// "target" => "_self",
|
// "target" => "_self",
|
||||||
@ -72,64 +71,17 @@ function getFieldView_MapurlHelper(string $field, MapurlEntity $entity, array $v
|
|||||||
$extras["onChange"] = sprintf(
|
$extras["onChange"] = sprintf(
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
||||||
current_url(),
|
current_url(),
|
||||||
$entity->getPK(),
|
$viewDatas['entity']->getPK(),
|
||||||
$field,
|
$field,
|
||||||
$field
|
$field
|
||||||
);
|
);
|
||||||
$value = getFieldForm_MapurlHelper($field, $entity->$field, $viewDatas, $extras);
|
$value = getFieldForm_MapurlHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
} //
|
} //
|
||||||
function getListAction_MapurlHelper(string $action, $entity, array $viewDatas, array $extras = []): string
|
function getListLabel_MapurlHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'modify':
|
|
||||||
$cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']);
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$entity->getPK()}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $entity->getPK(),
|
|
||||||
"class" => "batchjobuids_checkboxs"
|
|
||||||
]);
|
|
||||||
$url = current_url() . '/' . $action . '/' . $entity->getPK();
|
|
||||||
switch ($viewDatas['action_form']) {
|
|
||||||
case FORMS['MODAL']:
|
|
||||||
$value = form_label(
|
|
||||||
$cnt,
|
|
||||||
"",
|
|
||||||
[
|
|
||||||
"data-src" => $url,
|
|
||||||
"data-bs-toggle" => "modal",
|
|
||||||
"data-bs-target" => "#index_action_form",
|
|
||||||
...$extras
|
|
||||||
]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case FORMS['IFRAME']:
|
|
||||||
$value = form_label($cnt, "", [
|
|
||||||
"onClick" => "changeIframe_src('{$url}')",
|
|
||||||
...$extras
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$value = anchor($url, $cnt, $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$result = $checkbox . $value;
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$result = anchor(
|
|
||||||
current_url() . '/delete/' . $entity->getPK(),
|
|
||||||
ICONS['DELETE'],
|
|
||||||
["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
function getListColumns_MapurlHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
{
|
||||||
$label = getFieldLabel_MapurlHelper($field, $viewDatas, $extras);
|
$label = getFieldLabel_MapurlHelper($field, $viewDatas, $extras);
|
||||||
if ($field == $viewDatas['order_field']) {
|
if ($field == $viewDatas['order_field']) {
|
||||||
@ -145,22 +97,78 @@ function getListColumns_MapurlHelper(string $field, array $viewDatas, array $ext
|
|||||||
}
|
}
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
||||||
}
|
}
|
||||||
|
function getListButtonLabel_MapurlHelper(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$label = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $viewDatas['list_action_url'],
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
if ($action == 'create') {
|
||||||
|
$label = form_label($label, "", [
|
||||||
|
"onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')",
|
||||||
|
...$extras,
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$label = "";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$label = anchor($viewDatas['list_action_url'], $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
function getListButton_MapurlHelper(string $action, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
$viewDatas['list_action_url'] = $url = current_url() . '/' . $action;
|
||||||
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = getListButtonLabel_MapurlHelper($action, '입력', $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
$checkbox = form_checkbox([
|
||||||
|
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||||
|
"name" => "batchjob_uids[]",
|
||||||
|
"value" => $viewDatas['entity']->getPK(),
|
||||||
|
"class" => "batchjobuids_checkboxs"
|
||||||
|
]);
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$action = $checkbox . getListButtonLabel_MapurlHelper($action, $viewDatas['cnt'], $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $action;
|
||||||
|
}
|
||||||
function getRemapPage_MapurlHelper(array $viewDatas): string
|
function getRemapPage_MapurlHelper(array $viewDatas): string
|
||||||
{
|
{
|
||||||
$urls = [];
|
$urls = [];
|
||||||
foreach ($viewDatas['entitys'] as $entity) {
|
foreach ($viewDatas['entitys'] as $viewDatas['entity']) {
|
||||||
//한글을 포함하고 있는지 체크 HTTP 나 HTTPS 와 도메인 분리해서 한글도메인을 Punycode로 변환
|
//한글을 포함하고 있는지 체크 HTTP 나 HTTPS 와 도메인 분리해서 한글도메인을 Punycode로 변환
|
||||||
if (preg_match("/[\xE0-\xFF][\x80-\xFF][\x80-\xFF]/", $entity->oldurl)) {
|
if (preg_match("/[\xE0-\xFF][\x80-\xFF][\x80-\xFF]/", $viewDatas['entity']->oldurl)) {
|
||||||
preg_match("/^(https?:\/\/)(.*)/", $entity->oldurl, $matches);
|
preg_match("/^(https?:\/\/)(.*)/", $viewDatas['entity']->oldurl, $matches);
|
||||||
$oldurl = $matches[1] . idn_to_ascii($matches[2]);
|
$oldurl = $matches[1] . idn_to_ascii($matches[2]);
|
||||||
} else {
|
} else {
|
||||||
$oldurl = trim($entity->oldurl);
|
$oldurl = trim($viewDatas['entity']->oldurl);
|
||||||
}
|
}
|
||||||
$urls[] = sprintf(
|
$urls[] = sprintf(
|
||||||
"case '%s': window.location.href='%s'; break;",
|
"case '%s': window.location.href='%s'; break;",
|
||||||
$oldurl,
|
$oldurl,
|
||||||
trim($entity->newurl)
|
trim($viewDatas['entity']->newurl)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return sprintf("
|
return sprintf("
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Entities\UserEntity;
|
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
|
|
||||||
function getFieldLabel_UserHelper(string $field, array $viewDatas, array $extras = []): string
|
function getFieldLabel_UserHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
@ -62,13 +61,13 @@ function getFieldForm_UserHelper(string $field, mixed $value, array $viewDatas,
|
|||||||
}
|
}
|
||||||
return $form;
|
return $form;
|
||||||
} //
|
} //
|
||||||
function getFieldView_UserHelper(string $field, UserEntity $entity, array $viewDatas, array $extras = [])
|
function getFieldView_UserHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case UserModel::TITLE:
|
case UserModel::TITLE:
|
||||||
// $value = anchor(
|
// $value = anchor(
|
||||||
// current_url() . '/view/' . $entity->getPK(),
|
// current_url() . '/view/' . $viewDatas['entity']->getPK(),
|
||||||
// $value,
|
// $value,
|
||||||
// [
|
// [
|
||||||
// "target" => "_self",
|
// "target" => "_self",
|
||||||
@ -91,64 +90,17 @@ function getFieldView_UserHelper(string $field, UserEntity $entity, array $viewD
|
|||||||
$extras["onChange"] = sprintf(
|
$extras["onChange"] = sprintf(
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
||||||
current_url(),
|
current_url(),
|
||||||
$entity->getPK(),
|
$viewDatas['entity']->getPK(),
|
||||||
$field,
|
$field,
|
||||||
$field
|
$field
|
||||||
);
|
);
|
||||||
$value = getFieldForm_UserHelper($field, $entity->$field, $viewDatas, $extras);
|
$value = getFieldForm_UserHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
} //
|
} //
|
||||||
function getListAction_UserHelper(string $action, $entity, array $viewDatas, array $extras = []): string
|
function getListLabel_UserHelper(string $field, array $viewDatas, array $extras = []): string
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'modify':
|
|
||||||
$cnt = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $extras['cnt']);
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$entity->getPK()}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $entity->getPK(),
|
|
||||||
"class" => "batchjobuids_checkboxs"
|
|
||||||
]);
|
|
||||||
$url = current_url() . '/' . $action . '/' . $entity->getPK();
|
|
||||||
switch ($viewDatas['action_form']) {
|
|
||||||
case FORMS['MODAL']:
|
|
||||||
$value = form_label(
|
|
||||||
$cnt,
|
|
||||||
"",
|
|
||||||
[
|
|
||||||
"data-src" => $url,
|
|
||||||
"data-bs-toggle" => "modal",
|
|
||||||
"data-bs-target" => "#index_action_form",
|
|
||||||
...$extras
|
|
||||||
]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case FORMS['IFRAME']:
|
|
||||||
$value = form_label($cnt, "", [
|
|
||||||
"onClick" => "changeIframe_src('{$url}')",
|
|
||||||
...$extras
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$value = anchor($url, $cnt, $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$result = $checkbox . $value;
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$result = anchor(
|
|
||||||
current_url() . '/delete/' . $entity->getPK(),
|
|
||||||
ICONS['DELETE'],
|
|
||||||
["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
function getListColumns_UserHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
{
|
||||||
$label = getFieldLabel_UserHelper($field, $viewDatas, $extras);
|
$label = getFieldLabel_UserHelper($field, $viewDatas, $extras);
|
||||||
if ($field == $viewDatas['order_field']) {
|
if ($field == $viewDatas['order_field']) {
|
||||||
@ -164,3 +116,60 @@ function getListColumns_UserHelper(string $field, array $viewDatas, array $extra
|
|||||||
}
|
}
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
||||||
}
|
}
|
||||||
|
function getListButtonLabel_UserHelper(string $action, string $label, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$label = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $viewDatas['list_action_url'],
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
if ($action == 'create') {
|
||||||
|
$label = form_label($label, "", [
|
||||||
|
"onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')",
|
||||||
|
...$extras,
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
$label = "";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$label = anchor($viewDatas['list_action_url'], $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
function getListButton_UserHelper(string $action, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
$viewDatas['list_action_url'] = $url = current_url() . '/' . $action;
|
||||||
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = getListButtonLabel_UserHelper($action, '입력', $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
$checkbox = form_checkbox([
|
||||||
|
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||||
|
"name" => "batchjob_uids[]",
|
||||||
|
"value" => $viewDatas['entity']->getPK(),
|
||||||
|
"class" => "batchjobuids_checkboxs"
|
||||||
|
]);
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$action = $checkbox . getListButtonLabel_UserHelper($action, $viewDatas['cnt'], $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
||||||
|
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $action;
|
||||||
|
}
|
||||||
|
|||||||
@ -53,12 +53,11 @@ class AccountSocket extends CloudflareSocket
|
|||||||
log_message("notice", "-----{$this->_auth_entity->getTitle()} 처리 시작-----");
|
log_message("notice", "-----{$this->_auth_entity->getTitle()} 처리 시작-----");
|
||||||
$entity_uids = [];
|
$entity_uids = [];
|
||||||
$results = $this->reload_procedure("accounts");
|
$results = $this->reload_procedure("accounts");
|
||||||
|
//DB수정
|
||||||
foreach ($results as $result) {
|
foreach ($results as $result) {
|
||||||
foreach ($result as $item) {
|
$formDatas = $this->getArrayByResult($result);
|
||||||
$formDatas = $this->getArrayByResult($item);
|
$entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas);
|
||||||
$entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas);
|
$entity_uids[] = $entity->getPK();
|
||||||
$entity_uids[] = $entity->getPK();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용
|
//부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용
|
||||||
$this->getModel()->where(AccountModel::PARENT, $this->_auth_entity);
|
$this->getModel()->where(AccountModel::PARENT, $this->_auth_entity);
|
||||||
|
|||||||
@ -6,7 +6,6 @@ use App\Models\Cloudflare\RecordModel;
|
|||||||
use App\Libraries\MySocket\CloudflareSocket;
|
use App\Libraries\MySocket\CloudflareSocket;
|
||||||
use App\Entities\Cloudflare\ZoneEntity;
|
use App\Entities\Cloudflare\ZoneEntity;
|
||||||
use App\Entities\Cloudflare\RecordEntity;
|
use App\Entities\Cloudflare\RecordEntity;
|
||||||
use App\Entities\Cloudflare\AuthEntity;
|
|
||||||
|
|
||||||
class RecordSocket extends CloudflareSocket
|
class RecordSocket extends CloudflareSocket
|
||||||
{
|
{
|
||||||
@ -136,13 +135,10 @@ class RecordSocket extends CloudflareSocket
|
|||||||
$entity_uids = [];
|
$entity_uids = [];
|
||||||
$results = $this->reload_procedure("zones/{$this->_zone_entity->getPK()}/dns_records");
|
$results = $this->reload_procedure("zones/{$this->_zone_entity->getPK()}/dns_records");
|
||||||
//DB수정
|
//DB수정
|
||||||
dd($results);
|
|
||||||
foreach ($results as $result) {
|
foreach ($results as $result) {
|
||||||
foreach ($result as $item) {
|
$formDatas = $this->getArrayByResult($result);
|
||||||
$formDatas = $this->getArrayByResult($item);
|
$entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas);
|
||||||
$entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas);
|
$entity_uids[] = $entity->getPK();
|
||||||
$entity_uids[] = $entity->getPK();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//부모키를 기준으로 CF에 존재하지 않는 데이터 DB삭제
|
//부모키를 기준으로 CF에 존재하지 않는 데이터 DB삭제
|
||||||
$this->getModel()->where(RecordModel::PARENT, $this->_zone_entity);
|
$this->getModel()->where(RecordModel::PARENT, $this->_zone_entity);
|
||||||
|
|||||||
@ -5,7 +5,6 @@ namespace App\Libraries\MySocket\Cloudflare;
|
|||||||
use App\Models\Cloudflare\ZoneModel;
|
use App\Models\Cloudflare\ZoneModel;
|
||||||
use App\Libraries\MySocket\CloudflareSocket;
|
use App\Libraries\MySocket\CloudflareSocket;
|
||||||
use App\Entities\Cloudflare\ZoneEntity;
|
use App\Entities\Cloudflare\ZoneEntity;
|
||||||
use App\Entities\Cloudflare\AuthEntity;
|
|
||||||
use App\Entities\Cloudflare\AccountEntity;
|
use App\Entities\Cloudflare\AccountEntity;
|
||||||
|
|
||||||
class ZoneSocket extends CloudflareSocket
|
class ZoneSocket extends CloudflareSocket
|
||||||
@ -167,12 +166,11 @@ class ZoneSocket extends CloudflareSocket
|
|||||||
log_message("notice", "-----{$this->_account_entity->getTitle()} 처리 시작-----");
|
log_message("notice", "-----{$this->_account_entity->getTitle()} 처리 시작-----");
|
||||||
$entity_uids = [];
|
$entity_uids = [];
|
||||||
$results = $this->reload_procedure('zones');
|
$results = $this->reload_procedure('zones');
|
||||||
|
//DB수정
|
||||||
foreach ($results as $result) {
|
foreach ($results as $result) {
|
||||||
foreach ($result as $item) {
|
$formDatas = $this->getArrayByResult($result);
|
||||||
$formDatas = $this->getArrayByResult($item);
|
$entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas);
|
||||||
$entity = $this->getModel()->modify($this->getModel()->getEntity(), $formDatas);
|
$entity_uids[] = $entity->getPK();
|
||||||
$entity_uids[] = $entity->getPK();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용
|
//부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용
|
||||||
$this->getModel()->where(ZoneModel::PARENT, $this->_account_entity);
|
$this->getModel()->where(ZoneModel::PARENT, $this->_account_entity);
|
||||||
|
|||||||
@ -83,9 +83,14 @@ abstract class CloudflareSocket extends CommonLibrary
|
|||||||
if (!$cf->success) {
|
if (!$cf->success) {
|
||||||
throw new \Exception(__FUNCTION__ . "에서 실패:\n" . var_export($cf, true));
|
throw new \Exception(__FUNCTION__ . "에서 실패:\n" . var_export($cf, true));
|
||||||
}
|
}
|
||||||
$results[] = $cf->result;
|
|
||||||
//Loop 제한 : 한페이지에서 가져온 갯수가 perpage_max보다 적다는것은 더이상 다음페이지기 없으므로 0로 종료시키기 위함
|
//Loop 제한 : 한페이지에서 가져온 갯수가 perpage_max보다 적다는것은 더이상 다음페이지기 없으므로 0로 종료시키기 위함
|
||||||
$page = count($cf->result) < $perpage_max ? 0 : $page + 1;
|
if (count($cf->result) < $perpage_max) {
|
||||||
|
$results = $cf->result;
|
||||||
|
$page = 0;
|
||||||
|
} else {
|
||||||
|
$results = array_merge($results, $cf->result);
|
||||||
|
$page++;
|
||||||
|
}
|
||||||
} while (0 < $page);
|
} while (0 < $page);
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,31 +3,53 @@
|
|||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
||||||
|
<?= form_open("", $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="index_table table table-bordered table-hover table-striped">
|
<table class="index_table table table-bordered table-hover table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>번호</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<?= getListColumns_AccountHelper($field, $viewDatas) ?>
|
<?= getListLabel_AccountHelper($field, $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
<th>작업</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php $old_auth = '' ?>
|
<?php $old_auth = "" ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
||||||
<tr id="<?= $entity->getPK() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
||||||
|
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
|
<?php $viewDatas['old_auth'] = $old_auth ?>
|
||||||
<td class="text-center text-wrap">
|
<td class="text-center text-wrap">
|
||||||
<?= anchor(current_url() . '/sync/' . $entity->getPK(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
<?= getListButton_AccountHelper('modify', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<td><?= getFieldView_AccountHelper($field, $entity, $viewDatas, ['old_auth' => $old_auth]) ?></td>
|
<td><?= getFieldView_AccountHelper($field, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
<td>
|
||||||
|
<?= getListButton_AccountHelper('delete', $viewDatas) ?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php $old_auth = $entity->getParent() ?>
|
||||||
<?php $cnt++ ?>
|
<?php $cnt++ ?>
|
||||||
<?php $old_auth = $entity->getParent(); ?>
|
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="index_pagination"><?= $viewDatas['pagination'] ?></div>
|
<div class="index_bottom">
|
||||||
|
<ul class="nav justify-content-center">
|
||||||
|
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
||||||
|
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
|
||||||
|
<?= getFieldForm_AccountHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
||||||
|
<li class="nav-item"><?= getListButton_AccountHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<?= form_close() ?>
|
||||||
|
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||||
|
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
||||||
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
||||||
|
<?php endif ?>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<?= $this->extend("layouts/empty") ?>
|
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>번호</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<?= getListColumns_AuthHelper($field, $viewDatas) ?>
|
<?= getListLabel_AuthHelper($field, $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>작업</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -17,15 +17,17 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
||||||
<tr id="<?= $entity->getPK() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
||||||
|
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
<td class="text-center text-wrap">
|
<td class="text-center text-wrap">
|
||||||
<?= getListAction_AuthHelper('modify', $entity, $viewDatas, ["cnt" => $cnt, "style" => "cursor:pointer"]) ?>
|
<?= getListButton_AuthHelper('modify', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<td><?= getFieldView_AuthHelper($field, $entity, $viewDatas) ?></td>
|
<td><?= getFieldView_AuthHelper($field, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td>
|
<td>
|
||||||
<?= getListAction_AuthHelper('delete', $entity, $viewDatas) ?>
|
<?= getListButton_AuthHelper('delete', $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $cnt++ ?>
|
<?php $cnt++ ?>
|
||||||
@ -39,10 +41,12 @@
|
|||||||
<?= getFieldForm_AuthHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
<?= getFieldForm_AuthHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
||||||
<li class="nav-item"><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="<?= current_url() . '/create' ?>">입력</button></li>
|
<li class="nav-item"><?= getListButton_AuthHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?= form_close() ?>
|
<?= form_close() ?>
|
||||||
<div class="index_pagination"><?= $viewDatas['pagination'] ?></div>
|
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
||||||
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
||||||
|
<?php endif ?>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<?= $this->extend("layouts/empty") ?>
|
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?= $this->extend("layouts/empty") ?>
|
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
|||||||
@ -9,28 +9,31 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>번호</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<?= getListColumns_RecordHelper($field, $viewDatas) ?>
|
<?= getListLabel_RecordHelper($field, $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>작업</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php $old_zone = '' ?>
|
<?php $old_zone = "" ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
||||||
<tr id="<?= $entity->getPK() ?>" <?= $entity->locked != 'on' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
<tr <?= $entity->locked != 'on' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
||||||
|
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
|
<?php $viewDatas['old_zone'] = $old_zone ?>
|
||||||
<td class="text-center text-wrap">
|
<td class="text-center text-wrap">
|
||||||
<?= getListAction_RecordHelper('sync', $entity, $viewDatas, ["cnt" => $cnt, "style" => "cursor:pointer"]) ?>
|
<?= getListButton_RecordHelper('sync', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<td><?= getFieldView_RecordHelper($field, $entity, $viewDatas, ['old_zone' => $old_zone]) ?></td>
|
<td><?= getFieldView_RecordHelper($field, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td>
|
<td>
|
||||||
<?= getListAction_RecordHelper('delete', $entity, $viewDatas) ?>
|
<?= getListButton_RecordHelper('delete', $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php $old_zone = $entity->getParent() ?>
|
||||||
<?php $cnt++ ?>
|
<?php $cnt++ ?>
|
||||||
<?php $old_zone = $entity->getParent(); ?>
|
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -41,10 +44,12 @@
|
|||||||
<?= getFieldForm_RecordHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
<?= getFieldForm_RecordHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
||||||
<li class="nav-item"><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="<?= current_url() . '/create' ?>">입력</button></li>
|
<li class="nav-item"><?= getListButton_RecordHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?= form_close() ?>
|
<?= form_close() ?>
|
||||||
<div class="index_pagination"><?= $viewDatas['pagination'] ?></div>
|
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
||||||
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
||||||
|
<?php endif ?>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<?= $this->extend("layouts/empty") ?>
|
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
|||||||
@ -9,28 +9,31 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>번호</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<?= getListColumns_ZoneHelper($field, $viewDatas) ?>
|
<?= getListLabel_ZoneHelper($field, $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>작업</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php $old_account = '' ?>
|
<?php $old_account = "" ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
||||||
<tr id="<?= $entity->getPK() ?>" <?= $entity->status != 'active' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
<tr <?= $entity->status != 'active' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
||||||
|
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity ?>
|
||||||
|
<?php $viewDatas['old_account'] = $old_account ?>
|
||||||
<td class="text-center text-wrap">
|
<td class="text-center text-wrap">
|
||||||
<?= getListAction_ZoneHelper('sync', $entity, $viewDatas, ["cnt" => $cnt, "style" => "cursor:pointer"]) ?>
|
<?= getListButton_ZoneHelper('sync', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<td><?= getFieldView_ZoneHelper($field, $entity, $viewDatas, ['old_account' => $old_account]) ?></td>
|
<td><?= getFieldView_ZoneHelper($field, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td>
|
<td>
|
||||||
<?= getListAction_ZoneHelper('delete', $entity, $viewDatas) ?>
|
<?= getListButton_ZoneHelper('delete', $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php $old_account = $entity->getParent() ?>
|
||||||
<?php $cnt++ ?>
|
<?php $cnt++ ?>
|
||||||
<?php $old_account = $entity->getParent(); ?>
|
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -41,10 +44,12 @@
|
|||||||
<?= getFieldForm_ZoneHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
<?= getFieldForm_ZoneHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
||||||
<li class="nav-item"><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="<?= current_url() . '/create' ?>">입력</button></li>
|
<li class="nav-item"><?= getListButton_ZoneHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?= form_close() ?>
|
<?= form_close() ?>
|
||||||
<div class="index_pagination"><?= $viewDatas['pagination'] ?></div>
|
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
||||||
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
||||||
|
<?php endif ?>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<?= $this->extend("layouts/empty") ?>
|
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
|||||||
@ -2,14 +2,14 @@
|
|||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
||||||
<?= form_open("", $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
||||||
|
<?= form_open("", $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="index_table table table-bordered table-hover table-striped">
|
<table class="index_table table table-bordered table-hover table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>번호</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<?= getListColumns_MapurlHelper($field, $viewDatas) ?>
|
<?= getListLabel_MapurlHelper($field, $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>작업</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -17,15 +17,17 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
||||||
<tr id="<?= $entity->getPK() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
||||||
|
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
<td class="text-center text-wrap">
|
<td class="text-center text-wrap">
|
||||||
<?= getListAction_MapurlHelper('modify', $entity, $viewDatas, ["cnt" => $cnt, "style" => "cursor:pointer"]) ?>
|
<?= getListButton_MapurlHelper('modify', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<td><?= getFieldView_MapurlHelper($field, $entity, $viewDatas) ?></td>
|
<td><?= getFieldView_MapurlHelper($field, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td>
|
<td>
|
||||||
<?= getListAction_MapurlHelper('delete', $entity, $viewDatas) ?>
|
<?= getListButton_MapurlHelper('delete', $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $cnt++ ?>
|
<?php $cnt++ ?>
|
||||||
@ -39,10 +41,12 @@
|
|||||||
<?= getFieldForm_MapurlHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
<?= getFieldForm_MapurlHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
||||||
<li class="nav-item"><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="<?= current_url() . '/create' ?>">입력</button></li>
|
<li class="nav-item"><?= getListButton_MapurlHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?= form_close() ?>
|
<?= form_close() ?>
|
||||||
<div class="index_pagination"><?= $viewDatas['pagination'] ?></div>
|
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
||||||
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
||||||
|
<?php endif ?>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<?= $this->extend("layouts/empty") ?>
|
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?= $this->extend("layouts/empty") ?>
|
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>번호</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<?= getListColumns_UserHelper($field, $viewDatas) ?>
|
<?= getListLabel_UserHelper($field, $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>작업</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -18,14 +18,16 @@
|
|||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
||||||
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
||||||
|
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
<td class="text-center text-wrap">
|
<td class="text-center text-wrap">
|
||||||
<?= getListAction_UserHelper('modify', $entity, $viewDatas, ["cnt" => $cnt, "style" => "cursor:pointer"]) ?>
|
<?= getListButton_UserHelper('modify', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<td><?= getFieldView_UserHelper($field, $entity, $viewDatas) ?></td>
|
<td><?= getFieldView_UserHelper($field, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td>
|
<td>
|
||||||
<?= getListAction_UserHelper('delete', $entity, $viewDatas) ?>
|
<?= getListButton_UserHelper('delete', $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $cnt++ ?>
|
<?php $cnt++ ?>
|
||||||
@ -39,10 +41,12 @@
|
|||||||
<?= getFieldForm_UserHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
<?= getFieldForm_UserHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
<li class="nav-item"><?= form_submit("", '일괄처리', ['formaction' => current_url() . '/batchjob', "class" => "btn btn-outline btn-warning"]) ?></li>
|
||||||
<li class="nav-item"><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="<?= current_url() . '/create' ?>">입력</button></li>
|
<li class="nav-item"><?= getListButton_UserHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?= form_close() ?>
|
<?= form_close() ?>
|
||||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
||||||
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
||||||
|
<?php endif ?>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,4 +1,4 @@
|
|||||||
<?= $this->extend("layouts/empty") ?>
|
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
|||||||
42
app/Views/layouts/admin/direct_form.php
Normal file
42
app/Views/layouts/admin/direct_form.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
|
<title><?= $viewDatas['title'] ?></title>
|
||||||
|
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
|
||||||
|
<?= $stylesheet ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
|
||||||
|
<?= $javascript ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
|
||||||
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||||
|
<!-- WARNING: Respond.js doesn' t work if you view the page via file:// -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||||
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="top">
|
||||||
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?>
|
||||||
|
</div>
|
||||||
|
<div class="middle">
|
||||||
|
<div class="left"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?></div>
|
||||||
|
<div class="center">
|
||||||
|
<div class="header"><?= $this->include('templates/admin/header'); ?></div>
|
||||||
|
<div class="content"><?= $this->renderSection('content') ?></div>
|
||||||
|
<div class="footer"><?= $this->include('templates/admin/footer'); ?></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="bottom">
|
||||||
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
29
app/Views/layouts/admin/iframe_form.php
Normal file
29
app/Views/layouts/admin/iframe_form.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
|
<title><?= $viewDatas['title'] ?></title>
|
||||||
|
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
|
||||||
|
<?= $stylesheet ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
|
||||||
|
<?= $javascript ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
|
||||||
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||||
|
<!-- WARNING: Respond.js doesn' t work if you view the page via file:// -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||||
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="content"><?= $this->renderSection('content') ?></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
29
app/Views/layouts/admin/modal_form.php
Normal file
29
app/Views/layouts/admin/modal_form.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="ko">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
|
<title><?= $viewDatas['title'] ?></title>
|
||||||
|
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
|
||||||
|
<?= $stylesheet ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
|
||||||
|
<?= $javascript ?>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
|
||||||
|
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||||
|
<!-- WARNING: Respond.js doesn' t work if you view the page via file:// -->
|
||||||
|
<!--[if lt IE 9]>
|
||||||
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||||
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||||
|
<![endif]-->
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="content"><?= $this->renderSection('content') ?></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@ -8,7 +8,9 @@
|
|||||||
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable"> <!-- modal-lg는 모달 크기를 크게 설정 -->
|
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable"> <!-- modal-lg는 모달 크기를 크게 설정 -->
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title" id="iframeModalLabel">Iframe Modal</h5>
|
<h5 class="modal-title" id="iframeModalLabel">
|
||||||
|
<h4> <?= ICONS['DESKTOP'] ?> <?= $viewDatas['title'] ?> </h4>
|
||||||
|
</h5>
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user