vhost init...1

This commit is contained in:
최준흠 2024-05-07 13:42:33 +09:00
parent 87f2fbe878
commit eebf9d005b
18 changed files with 45 additions and 77 deletions

View File

@ -18,8 +18,6 @@ class BoardController extends FrontController
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
helper($this->_viewDatas['className']);
// echo var_export($this->_viewDatas['layout'], true);
// exit;
}
public function getFields(string $action = ""): array
{
@ -46,28 +44,17 @@ class BoardController extends FrontController
return parent::getFieldBatchFilters();
}
//권한체크
protected function isRole($action)
{
$this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
parent::isRole($action);
}
//Insert관련
protected function insert_form_process()
{
//권한체크
$this->isRole('insert');
$this->isRole('isaccess');
parent::insert_form_process();
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
'category_uid' => $this->_category,
'category' => $this->_category
]];
}
protected function insert_process()
{
//권한체크
$this->isRole('insert');
$this->isRole('iswrite');
return parent::insert_process();
}
//Update관련
@ -77,13 +64,7 @@ class BoardController extends FrontController
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->user_uid != $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
}
//권한체크
$this->isRole('update');
$entity = parent::update_form_process($entity);
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
'category' => $this->_category
]];
return $entity;
return parent::update_form_process($entity);
}
protected function update_process($entity)
{
@ -97,13 +78,8 @@ class BoardController extends FrontController
protected function reply_form_process($entity)
{
//권한체크
$this->isRole('reply');
$entity = parent::reply_form_process($entity);
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
'category_uid' => $entity->category_uid,
'category' => $this->_category
]];
return $entity;
$this->isRole('isreply');
return parent::reply_form_process($entity);
}
//Delete 관련
protected function delete_process($entity)
@ -121,11 +97,7 @@ class BoardController extends FrontController
$this->isRole('view');
//조회수 올리기
$entity = $this->_model->addViewCount($entity);
$entity = parent::view_process($entity);
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
'category' => $this->_category
]];
return $entity;
return parent::view_process($entity);
}
//Index관련
protected function index_process()
@ -133,14 +105,11 @@ class BoardController extends FrontController
//권한체크
$this->isRole('index');
parent::index_process();
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
'category' => $this->_category
]];
}
//Category 및 Status 조건추가
protected function index_setCondition()
{
$this->_model->where("category_uid", $this->_viewDatas['category']->getPrimaryKey());
$this->_model->where("category_uid", $this->getCurrentCategory()->getPrimaryKey());
$this->_model->where("status", DEFAULTS['STATUS']);
parent::index_setCondition();
}
@ -149,12 +118,11 @@ class BoardController extends FrontController
{
$entity = parent::download_process($field, $entity);
//권한체크
$this->isRole('download', $entity);
$this->isRole('download');
list($filename, $uploaded_filename) = explode(DEFAULTS['DELIMITER_FILE'], $entity->$field);
if (!is_file(PATHS['UPLOAD'] . "/" . $uploaded_filename)) {
throw new \Exception("파일이 확인되지 않습니다.\n" . PATHS['UPLOAD'] . "/" . $uploaded_filename);
}
return array($filename, $uploaded_filename);
return parent::download_process($field, $entity);
}
}

View File

@ -107,7 +107,7 @@ function getFieldIndex_Column_BoardHelper($field, array $viewDatas)
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
$viewDatas['uri']->addQuery('order_field', $field);
$viewDatas['uri']->addQuery('order_value', $value);
$columnData = anchor($viewDatas['uri'], $label);
$columnData = anchor((string)$viewDatas['uri'], $label);
switch ($field) {
case 'title':
case 'name':

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<tr>
@ -30,6 +30,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<tr>
@ -44,6 +44,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<div class="top"><?= $this->include('templates/front/index_head') ?></div>
<table class="table table-hover">
<thead>
@ -29,6 +29,6 @@
<div class="bottom">
<?= $viewDatas['pagination'] ?>
</div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<table class="form table table-bordered table-hover table-striped">
<tr>
<td class="label">주문정보</td>
@ -37,6 +37,6 @@
</tr>
<?php endforeach; ?>
</table>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<div class="top"><?= $this->include('templates/front/index_head') ?></div>
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-hover">
@ -20,7 +20,7 @@
<td nowrap>
<!-- 사용자가 자신의 작성한것인지 확인되면 update 가능-->
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->user_uid == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
<?php else : ?>
<?= $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt) ?>
<?php endif ?>
@ -31,7 +31,7 @@
<td>
<!-- 사용자가 자신의 작성한것인지 확인되면 delete 가능-->
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->user_uid == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
<?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
<?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['currentCategory']->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
<?php endif ?>
</td>
</tr>
@ -41,12 +41,12 @@
</table>
<div class="bottom">
<!-- 사용자가 쓰기권한이 있는지 확인-->
<?php if (isRole_CommonHelper($viewDatas['currentRoles'], $viewDatas['category'], 'iswrite')) : ?>
<?= anchor(current_url() . '/insert?category=' . $viewDatas['category']->getPrimaryKey(), '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
<?php if (isRole_CommonHelper($viewDatas['currentRoles'], $viewDatas['currentCategory'], 'iswrite')) : ?>
<?= anchor(current_url() . '/insert?category=' . $viewDatas['currentCategory']->getPrimaryKey(), '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
<?php endif ?>
<?= $viewDatas['pagination'] ?>
</div>
<?= form_close() ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -19,6 +19,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -19,6 +19,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -19,6 +19,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<table class="form table table-bordered table-striped">
<tbody>
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -16,6 +16,6 @@
<?php endforeach; ?>
</tbody>
</table>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -3,7 +3,7 @@
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/front/order.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<div class="container">
<div class="row">
<div class="col-10">
@ -76,7 +76,7 @@
</div>
</div>
<div class="bottom"><?= $viewDatas['pagination'] ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" ype="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<table class="form table table-bordered table-striped">
<tbody>
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -16,6 +16,6 @@
<?php endforeach; ?>
</tbody>
</table>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<div class="top">
<?= $this->include('templates/front/index_head_product') ?>
</div>
@ -34,6 +34,6 @@
<?php endforeach ?>
<div class=" bottom"><?= $viewDatas['pagination'] ?>
</div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<table class="form table table-bordered table-striped">
<tbody>
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -70,6 +70,6 @@
<?php else : ?>
이제품은 현재[<?= lang('Product.STATUS.' . $viewDatas['entity']->status) ?>]입니다.
<?php endif ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<div class="top"><?= $this->include('templates/front/index_head') ?></div>
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-hover">
@ -36,6 +36,6 @@
<?= $viewDatas['pagination'] ?>
</div>
<?= form_close() ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -19,6 +19,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -19,6 +19,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div><?= html_entity_decode($viewDatas['currentCategory']->head) ?></div>
</div>
<?= $this->endSection() ?>