cfmgrv4 init...1
This commit is contained in:
parent
5821780796
commit
0de303678f
@ -56,7 +56,6 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin'], function ($rou
|
|||||||
$routes->group('account', function ($routes) {
|
$routes->group('account', function ($routes) {
|
||||||
$routes->get('/', 'AccountController::index');
|
$routes->get('/', 'AccountController::index');
|
||||||
$routes->post('create/(:uuid)', 'AccountController::create');
|
$routes->post('create/(:uuid)', 'AccountController::create');
|
||||||
$routes->get('reload/(:alphanum)', 'AccountController::reload/$1');
|
|
||||||
$routes->get('reload/(:num)', 'AccountController::reload/$1');
|
$routes->get('reload/(:num)', 'AccountController::reload/$1');
|
||||||
$routes->get('download/(:alpha)', 'AccountController::download/$1');
|
$routes->get('download/(:alpha)', 'AccountController::download/$1');
|
||||||
});
|
});
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class AccountController extends CloudflareController
|
|||||||
{
|
{
|
||||||
private $_myLibrary = null;
|
private $_myLibrary = null;
|
||||||
private $_model = null;
|
private $_model = null;
|
||||||
private $_auth_key = null;
|
private $_auth_entity = null;
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
@ -33,7 +33,7 @@ class AccountController extends CloudflareController
|
|||||||
final protected function getMyLibrary(): Account
|
final protected function getMyLibrary(): Account
|
||||||
{
|
{
|
||||||
if ($this->_myLibrary === null) {
|
if ($this->_myLibrary === null) {
|
||||||
$this->_myLibrary = new Account($this->_auth_key);
|
$this->_myLibrary = new Account($this->_auth_entity);
|
||||||
}
|
}
|
||||||
return $this->_myLibrary;
|
return $this->_myLibrary;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -126,12 +126,25 @@ class RecordController extends CloudflareController
|
|||||||
if ($this->entity === null) {
|
if ($this->entity === null) {
|
||||||
throw new \Exception("{$uid} 정보를 찾을수 없습니다.");
|
throw new \Exception("{$uid} 정보를 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
//부모데이터정의
|
//fixed 필드가 있고 값이 변경되었을때
|
||||||
$this->_zone_entity = $this->getZoneModel()->getEntityByPK($this->entity->getParent());
|
if (in_array('fixed', $this->fields) && $this->formDatas['fixed'] !== $this->entity->fixed) {
|
||||||
//Socket처리
|
$entity = $this->getModel()->modify($this->entity, $this->formDatas);
|
||||||
$entity = $this->getMyLibrary()->modify($this->entity, $this->formDatas);
|
} else {
|
||||||
|
//부모데이터정의
|
||||||
|
$this->_zone_entity = $this->getZoneModel()->getEntityByPK($this->entity->getParent());
|
||||||
|
//Socket처리
|
||||||
|
$entity = $this->getMyLibrary()->modify($this->entity, $this->formDatas);
|
||||||
|
}
|
||||||
log_message("debug", "Record:{$entity->getTitle()} 수정 작업을 완료하였습니다.");
|
log_message("debug", "Record:{$entity->getTitle()} 수정 작업을 완료하였습니다.");
|
||||||
}
|
}
|
||||||
|
//단일필드작업
|
||||||
|
public function toggle(string $uid, string $field): RedirectResponse
|
||||||
|
{
|
||||||
|
$this->action = __FUNCTION__;
|
||||||
|
$this->fields = [$field];
|
||||||
|
$this->modify_process($uid);
|
||||||
|
return $this->modify_procedure($uid);
|
||||||
|
}
|
||||||
//일괄처리작업
|
//일괄처리작업
|
||||||
public function batcjob(): RedirectResponse
|
public function batcjob(): RedirectResponse
|
||||||
{
|
{
|
||||||
|
|||||||
@ -220,7 +220,7 @@ abstract class MVController extends CommonController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//단일필드작업
|
//단일필드작업
|
||||||
final public function toggle(string $uid, string $field): RedirectResponse
|
public function toggle(string $uid, string $field): RedirectResponse
|
||||||
{
|
{
|
||||||
$this->action = __FUNCTION__;
|
$this->action = __FUNCTION__;
|
||||||
$this->fields = [$field];
|
$this->fields = [$field];
|
||||||
|
|||||||
@ -62,7 +62,7 @@ function getFieldView_AccountHelper(string $field, array $viewDatas, array $extr
|
|||||||
} else {
|
} else {
|
||||||
// dd($viewDatas['field_options']);
|
// dd($viewDatas['field_options']);
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . "auth/reload/" . $viewDatas['entity']->getParent(),
|
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -75,7 +75,7 @@ function getFieldView_AccountHelper(string $field, array $viewDatas, array $extr
|
|||||||
break;
|
break;
|
||||||
case AccountModel::TITLE:
|
case AccountModel::TITLE:
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
current_url() . '/reload/' . $viewDatas['entity']->getPK(),
|
base_url() . strtolower($viewDatas['root']) . 'zone/reload/' . $viewDatas['entity']->getPK(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
|||||||
@ -43,7 +43,7 @@ function getFieldView_AuthHelper(string $field, array $viewDatas, array $extras
|
|||||||
switch ($field) {
|
switch ($field) {
|
||||||
case AuthModel::TITLE:
|
case AuthModel::TITLE:
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
current_url() . '/reload/' . $viewDatas['entity']->getPK(),
|
base_url() . strtolower($viewDatas['root']) . 'account/reload/' . $viewDatas['entity']->getPK(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
|||||||
@ -76,7 +76,7 @@ function getFieldView_RecordHelper(string $field, array $viewDatas, array $extra
|
|||||||
$value = "";
|
$value = "";
|
||||||
} else {
|
} else {
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . 'zone/reload/' . $viewDatas['entity']->getParent(),
|
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -86,8 +86,8 @@ function getFieldView_RecordHelper(string $field, array $viewDatas, array $extra
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RecordModel::TITLE:
|
case RecordModel::TITLE:
|
||||||
$url = sprintf("%s/toggle/%s?fixed=%s", current_url(), $viewDatas['entity']->getPK(), $viewDatas['entity']->fixed == 'on' ? "off" : "on");
|
$url = sprintf("%s/toggle/%s/fixed?fixed=%s", current_url(), $viewDatas['entity']->getPK(), $viewDatas['entity']->fixed == 'on' ? "off" : "on");
|
||||||
$value = sprintf("%s%s", $viewDatas['entity']->fixed == 'on' ? ICONS['LOCK'] : "", $value);
|
$value = sprintf("%s%s", $viewDatas['entity']->fixed == 'on' ? "<span class=\"text-danger\">" . ICONS['LOCK'] . "</span>" : "", $value);
|
||||||
$value = anchor($url, $value, ["target" => "_self"]);
|
$value = anchor($url, $value, ["target" => "_self"]);
|
||||||
break;
|
break;
|
||||||
case 'content':
|
case 'content':
|
||||||
|
|||||||
@ -79,7 +79,7 @@ function getFieldView_ZoneHelper(string $field, array $viewDatas, array $extras
|
|||||||
$value = "";
|
$value = "";
|
||||||
} else {
|
} else {
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
base_url() . strtolower($viewDatas['root']) . "account/reload/" . $viewDatas['entity']->getParent(),
|
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
@ -92,7 +92,7 @@ function getFieldView_ZoneHelper(string $field, array $viewDatas, array $extras
|
|||||||
break;
|
break;
|
||||||
case ZoneModel::TITLE:
|
case ZoneModel::TITLE:
|
||||||
$value = anchor(
|
$value = anchor(
|
||||||
current_url() . '/reload/' . $viewDatas['entity']->getPK(),
|
base_url() . strtolower($viewDatas['root']) . 'record/reload/' . $viewDatas['entity']->getPK(),
|
||||||
ICONS["RELOAD"],
|
ICONS["RELOAD"],
|
||||||
[
|
[
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user