servermgrv2 init...
This commit is contained in:
parent
0e168f667b
commit
7f1aa0e0b0
@ -78,20 +78,20 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
|
|||||||
$routes->get('toggle/(:num)/(:hash)', 'CategoryController::toggle/$1/$2');
|
$routes->get('toggle/(:num)/(:hash)', 'CategoryController::toggle/$1/$2');
|
||||||
$routes->post('batchjob', 'CategoryController::batchjob');
|
$routes->post('batchjob', 'CategoryController::batchjob');
|
||||||
});
|
});
|
||||||
$routes->group('hpilo', static function ($routes) {
|
$routes->group('board', static function ($routes) {
|
||||||
$routes->get('', 'HPILOController::index');
|
$routes->get('', 'BoardController::index');
|
||||||
$routes->get('excel', 'HPILOController::excel');
|
$routes->get('excel', 'BoardController::excel/$1');
|
||||||
$routes->get('insert', 'HPILOController::insert_form');
|
$routes->get('insert', 'BoardController::insert_form');
|
||||||
$routes->post('insert', 'HPILOController::insert');
|
$routes->post('insert', 'BoardController::insert');
|
||||||
$routes->get('update/(:num)', 'HPILOController::update_form/$1');
|
$routes->get('update/(:num)', 'BoardController::update_form/$1');
|
||||||
$routes->post('update/(:num)', 'HPILOController::update/$1');
|
$routes->post('update/(:num)', 'BoardController::update/$1');
|
||||||
$routes->get('view/(:num)', 'HPILOController::view/$1');
|
$routes->get('view/(:num)', 'BoardController::view/$1');
|
||||||
$routes->get('delete/(:num)', 'HPILOController::delete/$1', ['filter' => 'authFilter:master']);
|
$routes->get('reply/(:num)', 'BoardController::reply_form/$1');
|
||||||
$routes->get('toggle/(:num)/(:hash)', 'HPILOController::toggle/$1/$2');
|
$routes->post('reply/(:num)', 'BoardController::reply/$1');
|
||||||
$routes->post('batchjob', 'HPILOController::batchjob');
|
$routes->get('delete/(:num)', 'BoardController::delete/$1', ['filter' => 'authFilter:master']);
|
||||||
$routes->get('console/(:num)', 'HPILOController::console/$1');
|
$routes->get('toggle/(:num)/(:hash)', 'BoardController::toggle/$1/$2');
|
||||||
$routes->get('reset/(:num)/(:alpha)', 'HPILOController::reset/$1/$2');
|
$routes->post('batchjob', 'BoardController::batchjob');
|
||||||
$routes->get('reload/(:num)', 'HPILOController::reload/$1');
|
$routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) {
|
$routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) {
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin;
|
namespace App\Controllers\Admin;
|
||||||
|
|
||||||
use App\Models\BoardConfigModel;
|
|
||||||
use App\Models\BoardModel;
|
use App\Models\BoardModel;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
|||||||
@ -21,14 +21,14 @@ class CategoryController extends AdminController
|
|||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"status", "head", "tail",
|
"status", "head", "tail",
|
||||||
];
|
];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case "index":
|
case "index":
|
||||||
case "excel":
|
case "excel":
|
||||||
return [
|
return [
|
||||||
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"status", "created_at"
|
"status", "created_at"
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -20,14 +20,14 @@ class BoardController extends FrontController
|
|||||||
|
|
||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
{
|
{
|
||||||
$fields = ["category_uid", 'title', "board_file", "passwd", "content"];
|
$fields = ['title', "board_file", "passwd", "content"];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case "index":
|
case "index":
|
||||||
case "excel":
|
case "excel":
|
||||||
return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at"];
|
return ['title', "board_file", "view_cnt", "created_at"];
|
||||||
break;
|
break;
|
||||||
case "view":
|
case "view":
|
||||||
return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at", "content"];
|
return ['title', "board_file", "view_cnt", "created_at", "content"];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return $fields;
|
return $fields;
|
||||||
@ -36,7 +36,7 @@ class BoardController extends FrontController
|
|||||||
}
|
}
|
||||||
public function getFieldFilters(): array
|
public function getFieldFilters(): array
|
||||||
{
|
{
|
||||||
return ["category_uid", "user_uid"];
|
return [];
|
||||||
}
|
}
|
||||||
public function getFieldBatchFilters(): array
|
public function getFieldBatchFilters(): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -51,7 +51,6 @@ CREATE TABLE servermgr.tw_category (
|
|||||||
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
||||||
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
||||||
name varchar(255) NOT NULL COMMENT '범주명',
|
name varchar(255) NOT NULL COMMENT '범주명',
|
||||||
linkurl varchar(255) NULL COMMENT '연결URL',
|
|
||||||
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
||||||
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
||||||
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
||||||
@ -79,7 +78,7 @@ CREATE TABLE servermgr.tw_board (
|
|||||||
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
||||||
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
||||||
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
||||||
cartory_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID',
|
category_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID',
|
||||||
user_uid varchar(36) NULL COMMENT '작성자 정보',
|
user_uid varchar(36) NULL COMMENT '작성자 정보',
|
||||||
title varchar(255) NOT NULL COMMENT '제목',
|
title varchar(255) NOT NULL COMMENT '제목',
|
||||||
content text NOT NULL COMMENT '내용',
|
content text NOT NULL COMMENT '내용',
|
||||||
|
|||||||
@ -23,6 +23,14 @@ class BoardEntity extends BaseHierarchyEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
//추가기능
|
//추가기능
|
||||||
|
public function getCategory_Uid()
|
||||||
|
{
|
||||||
|
return $this->attributes['category_uid'];
|
||||||
|
}
|
||||||
|
public function getUser_Uid()
|
||||||
|
{
|
||||||
|
return $this->attributes['user_uid'];
|
||||||
|
}
|
||||||
public function getPassword()
|
public function getPassword()
|
||||||
{
|
{
|
||||||
return $this->attributes['passwd'];
|
return $this->attributes['passwd'];
|
||||||
@ -31,8 +39,4 @@ class BoardEntity extends BaseHierarchyEntity
|
|||||||
{
|
{
|
||||||
return $this->attributes['view_cnt'];
|
return $this->attributes['view_cnt'];
|
||||||
}
|
}
|
||||||
public function getUser_Uid()
|
|
||||||
{
|
|
||||||
return $this->attributes['user_uid'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,10 +23,6 @@ class CategoryEntity extends BaseHierarchyEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
//추가기능
|
//추가기능
|
||||||
public function getLinkURL()
|
|
||||||
{
|
|
||||||
return $this->attributes['linkurl'];
|
|
||||||
}
|
|
||||||
public function getHead()
|
public function getHead()
|
||||||
{
|
{
|
||||||
return $this->attributes['head'];
|
return $this->attributes['head'];
|
||||||
|
|||||||
@ -15,7 +15,7 @@ function getFieldLabel_BoardHelper($field, array $fieldRules, array $attributes
|
|||||||
function getFieldForm_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
function getFieldForm_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "board_config_uid":
|
case "category_uid":
|
||||||
case "user_uid":
|
case "user_uid":
|
||||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
|
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
|
||||||
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
|
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
|
||||||
@ -59,6 +59,15 @@ function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $f
|
|||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
case 'category_uid':
|
||||||
|
$categorys = array();
|
||||||
|
foreach (array_values($fieldFormOptions[$field]) as $category_2depth) {
|
||||||
|
foreach ($category_2depth as $key => $label) {
|
||||||
|
$categorys[$key] = $label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $categorys[$value];
|
||||||
|
break;
|
||||||
case 'title':
|
case 'title':
|
||||||
return sprintf(
|
return sprintf(
|
||||||
"<div style=\"text-align:left;\">%s %s</div>",
|
"<div style=\"text-align:left;\">%s %s</div>",
|
||||||
|
|||||||
@ -56,9 +56,6 @@ function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, ar
|
|||||||
case 'name':
|
case 'name':
|
||||||
return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
|
return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
|
||||||
break;
|
break;
|
||||||
case 'linkurl':
|
|
||||||
return form_input($field, $value, [...$attributes, "placeholder" => "예)/front/board", "style" => "width:100%; ::placeholder{ color:silver; opacity: 1; }"]);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return form_input($field, $value, [...$attributes]);
|
return form_input($field, $value, [...$attributes]);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -9,7 +9,6 @@ return [
|
|||||||
'label' => [
|
'label' => [
|
||||||
'uid' => "번호",
|
'uid' => "번호",
|
||||||
'name' => "범주제목",
|
'name' => "범주제목",
|
||||||
'linkurl' => "연결URL",
|
|
||||||
'isaccess' => "접속권한",
|
'isaccess' => "접속권한",
|
||||||
'isread' => "읽기권한",
|
'isread' => "읽기권한",
|
||||||
'iswrite' => "쓰기권한",
|
'iswrite' => "쓰기권한",
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
parent::__construct('Category');
|
parent::__construct('Category');
|
||||||
$this->allowedFields = [
|
$this->allowedFields = [
|
||||||
...$this->allowedFields,
|
...$this->allowedFields,
|
||||||
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"head", "tail", "status"
|
"head", "tail", "status"
|
||||||
];
|
];
|
||||||
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
||||||
@ -33,10 +33,6 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
$rules[$field] = "required|trim|string";
|
$rules[$field] = "required|trim|string";
|
||||||
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||||
break;
|
break;
|
||||||
case "linkurl":
|
|
||||||
$rules[$field] = "if_exist|trim|string";
|
|
||||||
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
|
||||||
break;
|
|
||||||
case "isaccess":
|
case "isaccess":
|
||||||
case "isread":
|
case "isread":
|
||||||
case "iswrite":
|
case "iswrite":
|
||||||
@ -119,7 +115,7 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
{
|
{
|
||||||
parent::setIndexWordFilter($word);
|
parent::setIndexWordFilter($word);
|
||||||
$this->orLike($this->getTitle(), $word, "both"); //befor , after , both
|
$this->orLike($this->getTitle(), $word, "both"); //befor , after , both
|
||||||
$this->orLike("linkurl", $word, "both"); //befor , after , both
|
$this->orLike($word, "both"); //befor , after , both
|
||||||
$this->orLike("head", $word, "both"); //befor , after , both
|
$this->orLike("head", $word, "both"); //befor , after , both
|
||||||
$this->orLike("tail", $word, "both"); //befor , after , both
|
$this->orLike("tail", $word, "both"); //befor , after , both
|
||||||
$this->orLike("isaccess", $word, "both"); //befor , after , both
|
$this->orLike("isaccess", $word, "both"); //befor , after , both
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user