mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 03:01:43 +09:00
moduleModel 및 moduleController에서 제공하던 각 모듈별 설정을 이용시 너무 많은 설정값들이 생길 경우 이를 serialize/ unserialize하는데 드는 부하가 커짐을 방지하기 위해서 module_config외에 module_part_config 테이블을 주고 module_srl 별 설정을 분산하도록 하여 쓸데없는 부하가 생기지 않도록 수정.
files/cache/module_info내에 있던 module_config 캐시 파일도 사용하지 않도록 변경 git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4696 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
cc7dd67ed2
commit
5934906056
41 changed files with 372 additions and 445 deletions
|
|
@ -73,32 +73,21 @@
|
||||||
* @brief 댓글의 모듈별 추가 확장 폼을 저장
|
* @brief 댓글의 모듈별 추가 확장 폼을 저장
|
||||||
**/
|
**/
|
||||||
function procCommentAdminInsertModuleConfig() {
|
function procCommentAdminInsertModuleConfig() {
|
||||||
// 기존 설정을 가져옴
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('comment');
|
|
||||||
|
|
||||||
// 대상을 구함
|
|
||||||
$module_srl = Context::get('target_module_srl');
|
$module_srl = Context::get('target_module_srl');
|
||||||
|
|
||||||
// 여러개의 모듈 일괄 설정일 경우
|
|
||||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||||
else $module_srl = array($module_srl);
|
else $module_srl = array($module_srl);
|
||||||
|
|
||||||
$comment_config = null;
|
$comment_config = null;
|
||||||
|
|
||||||
$comment_config->comment_count = (int)Context::get('comment_count');
|
$comment_config->comment_count = (int)Context::get('comment_count');
|
||||||
if(!$comment_config->comment_count) $comment_config->comment_count = 50;
|
if(!$comment_config->comment_count) $comment_config->comment_count = 50;
|
||||||
|
|
||||||
|
$oModuleController = &getController('module');
|
||||||
for($i=0;$i<count($module_srl);$i++) {
|
for($i=0;$i<count($module_srl);$i++) {
|
||||||
$srl = trim($module_srl[$i]);
|
$srl = trim($module_srl[$i]);
|
||||||
if(!$srl) continue;
|
if(!$srl) continue;
|
||||||
$config->module_config[$srl] = $comment_config;
|
$output = $oModuleController->insertModulePartConfig('comment',$srl,$comment_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
// module Controller 객체 생성하여 입력
|
|
||||||
$oModuleController = &getController('module');
|
|
||||||
$output = $oModuleController->insertModuleConfig('comment',$config);
|
|
||||||
|
|
||||||
$this->setError(-1);
|
$this->setError(-1);
|
||||||
$this->setMessage('success_updated');
|
$this->setMessage('success_updated');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -386,18 +386,9 @@
|
||||||
* @brief 모듈별 댓글 설정을 return
|
* @brief 모듈별 댓글 설정을 return
|
||||||
**/
|
**/
|
||||||
function getCommentConfig($module_srl) {
|
function getCommentConfig($module_srl) {
|
||||||
if(!$GLOBLAS['__comment_module_config__']) {
|
$oModuleModel = &getModel('module');
|
||||||
// 선택된 모듈의 trackback설정을 가져옴
|
$comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl);
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$GLOBLAS['__comment_module_config__'] = $oModuleModel->getModuleConfig('comment');
|
|
||||||
}
|
|
||||||
|
|
||||||
$comment_config = $GLOBLAS['__comment_module_config__']->module_config[$module_srl];
|
|
||||||
|
|
||||||
if(!is_object($comment_config)) $comment_config = null;
|
|
||||||
|
|
||||||
if(!isset($comment_config->comment_count)) $comment_count->comment_count = 50;
|
if(!isset($comment_config->comment_count)) $comment_count->comment_count = 50;
|
||||||
|
|
||||||
return $comment_config;
|
return $comment_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -358,11 +358,11 @@
|
||||||
**/
|
**/
|
||||||
function procDocumentAdminInsertConfig() {
|
function procDocumentAdminInsertConfig() {
|
||||||
// 기본 정보를 받음
|
// 기본 정보를 받음
|
||||||
$args = Context::gets('thumbnail_type');
|
$config = Context::gets('thumbnail_type');
|
||||||
|
|
||||||
// module Controller 객체 생성하여 입력
|
// module Controller 객체 생성하여 입력
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
$output = $oModuleController->insertModuleConfig('document',$args);
|
$output = $oModuleController->insertModuleConfig('document',$config);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,31 +80,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function allowTrackback() {
|
function allowTrackback() {
|
||||||
// allowTrackback()의 경우 여러번 호출됨으로 자체 변수 설정후 사용
|
static $allow_trackback_status = null;
|
||||||
if(!isset($this->allow_trackback_status)) {
|
if(is_null($allow_trackback_status)) {
|
||||||
|
|
||||||
// 엮인글 관리 모듈의 사용금지 설정 상태이면 무조건 금지, 그렇지 않으면 개별 체크
|
// 엮인글 관리 모듈의 사용금지 설정 상태이면 무조건 금지, 그렇지 않으면 개별 체크
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$trackback_config = $oModuleModel->getModuleConfig('trackback');
|
$trackback_config = $oModuleModel->getModuleConfig('trackback');
|
||||||
if(!isset($trackback_config->enable_trackback)) $trackback_config->enable_trackback = 'Y';
|
if(!isset($trackback_config->enable_trackback)) $trackback_config->enable_trackback = 'Y';
|
||||||
|
if($trackback_config->enable_trackback != 'Y') $allow_trackback_status = false;
|
||||||
if($trackback_config->enable_trackback != 'Y') $this->allow_trackback_status = false;
|
|
||||||
else {
|
else {
|
||||||
$module_srl = $this->get('module_srl');
|
$module_srl = $this->get('module_srl');
|
||||||
if(!$module_srl) $module_srl = Context::get('module_srl');
|
|
||||||
|
|
||||||
// 모듈별 설정을 체크
|
// 모듈별 설정을 체크
|
||||||
$module_config = $trackback_config->module_config[$module_srl];
|
$module_config = $oModuleModel->getModulePartConfig('trackback', $module_srl);
|
||||||
|
if($module_config->enable_trackback == 'N') $allow_trackback_status = false;
|
||||||
if($module_config->enable_trackback == 'N') $this->allow_trackback_status = false;
|
else if($this->get('allow_trackback')=='Y' || !$this->isExists()) $allow_trackback_status = true;
|
||||||
else {
|
|
||||||
// 글쓴이가 허용하였거나 원본 글이 없으면 허용
|
|
||||||
if($this->get('allow_trackback')=='Y' || !$this->isExists()) $this->allow_trackback_status = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return $allow_trackback_status;
|
||||||
return $this->allow_trackback_status;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isLocked() {
|
function isLocked() {
|
||||||
|
|
|
||||||
|
|
@ -668,14 +668,12 @@
|
||||||
* @brief 문서 설정 정보를 구함
|
* @brief 문서 설정 정보를 구함
|
||||||
**/
|
**/
|
||||||
function getDocumentConfig() {
|
function getDocumentConfig() {
|
||||||
if(!$GLOBLAS['__document_config__']) {
|
if(!$GLOBLAS['__document_config__']) {
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('document');
|
$config = $oModuleModel->getModuleConfig('document');
|
||||||
|
|
||||||
if(!$config->thumbnail_type) $config->thumbnail_type = 'crop';
|
if(!$config->thumbnail_type) $config->thumbnail_type = 'crop';
|
||||||
$GLOBLAS['__document_config__'] = $config;
|
$GLOBLAS['__document_config__'] = $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $GLOBLAS['__document_config__'];
|
return $GLOBLAS['__document_config__'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,11 +103,6 @@
|
||||||
* @brief 에디터의 모듈별 추가 확장 폼을 저장
|
* @brief 에디터의 모듈별 추가 확장 폼을 저장
|
||||||
**/
|
**/
|
||||||
function procEditorAdminInsertModuleConfig() {
|
function procEditorAdminInsertModuleConfig() {
|
||||||
// 기존 설정을 가져옴
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('editor');
|
|
||||||
|
|
||||||
// 대상을 구함
|
|
||||||
$module_srl = Context::get('target_module_srl');
|
$module_srl = Context::get('target_module_srl');
|
||||||
|
|
||||||
// 여러개의 모듈 일괄 설정일 경우
|
// 여러개의 모듈 일괄 설정일 경우
|
||||||
|
|
@ -165,16 +160,13 @@
|
||||||
if($editor_config->enable_comment_height_resizable != 'Y') $editor_config->enable_comment_height_resizable = 'N';
|
if($editor_config->enable_comment_height_resizable != 'Y') $editor_config->enable_comment_height_resizable = 'N';
|
||||||
if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N';
|
if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N';
|
||||||
|
|
||||||
|
$oModuleController = &getController('module');
|
||||||
for($i=0;$i<count($module_srl);$i++) {
|
for($i=0;$i<count($module_srl);$i++) {
|
||||||
$srl = trim($module_srl[$i]);
|
$srl = trim($module_srl[$i]);
|
||||||
if(!$srl) continue;
|
if(!$srl) continue;
|
||||||
$config->module_config[$srl] = $editor_config;
|
$oModuleController->insertModulePartConfig('editor',$srl,$editor_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
// module Controller 객체 생성하여 입력
|
|
||||||
$oModuleController = &getController('module');
|
|
||||||
$output = $oModuleController->insertModuleConfig('editor',$config);
|
|
||||||
|
|
||||||
$this->setError(-1);
|
$this->setError(-1);
|
||||||
$this->setMessage('success_updated');
|
$this->setMessage('success_updated');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,13 +23,13 @@
|
||||||
* @brief 모듈별 에디터 설정을 return
|
* @brief 모듈별 에디터 설정을 return
|
||||||
**/
|
**/
|
||||||
function getEditorConfig($module_srl) {
|
function getEditorConfig($module_srl) {
|
||||||
if(!$GLOBLAS['__editor_module_config__']) {
|
if(!$GLOBLAS['__editor_module_config__'][$module_srl]) {
|
||||||
// 선택된 모듈의 trackback설정을 가져옴
|
// 선택된 모듈의 trackback설정을 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$GLOBLAS['__editor_module_config__'] = $oModuleModel->getModuleConfig('editor');
|
$GLOBLAS['__editor_module_config__'][$module_srl] = $oModuleModel->getModulePartConfig('editor', $module_srl);
|
||||||
}
|
}
|
||||||
|
|
||||||
$editor_config = $GLOBLAS['__editor_module_config__']->module_config[$module_srl];
|
$editor_config = $GLOBLAS['__editor_module_config__'][$module_srl];
|
||||||
|
|
||||||
if(!is_object($editor_config)) $editor_config = null;
|
if(!is_object($editor_config)) $editor_config = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,6 @@
|
||||||
**/
|
**/
|
||||||
function procFileAdminInsertConfig() {
|
function procFileAdminInsertConfig() {
|
||||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('file');
|
|
||||||
$config->allowed_filesize = Context::get('allowed_filesize');
|
$config->allowed_filesize = Context::get('allowed_filesize');
|
||||||
$config->allowed_attach_size = Context::get('allowed_attach_size');
|
$config->allowed_attach_size = Context::get('allowed_attach_size');
|
||||||
$config->allowed_filetypes = Context::get('allowed_filetypes');
|
$config->allowed_filetypes = Context::get('allowed_filetypes');
|
||||||
|
|
@ -103,27 +101,19 @@
|
||||||
|
|
||||||
$download_grant = trim(Context::get('download_grant'));
|
$download_grant = trim(Context::get('download_grant'));
|
||||||
|
|
||||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
$file_config->allowed_filesize = Context::get('allowed_filesize');
|
||||||
$oModuleModel = &getModel('module');
|
$file_config->allowed_attach_size = Context::get('allowed_attach_size');
|
||||||
$config = $oModuleModel->getModuleConfig('file');
|
$file_config->allowed_filetypes = Context::get('allowed_filetypes');
|
||||||
|
if($download_grant) $file_config->download_grant = explode('|@|',$download_grant);
|
||||||
$module_file_config->module_srl = $module_srl;
|
else $file_config->download_grant = array();
|
||||||
$module_file_config->allowed_filesize = Context::get('allowed_filesize');
|
|
||||||
$module_file_config->allowed_attach_size = Context::get('allowed_attach_size');
|
|
||||||
$module_file_config->allowed_filetypes = Context::get('allowed_filetypes');
|
|
||||||
if($download_grant) $module_file_config->download_grant = explode('|@|',$download_grant);
|
|
||||||
else $module_file_config->download_grant = array();
|
|
||||||
|
|
||||||
|
$oModuleController = &getController('module');
|
||||||
for($i=0;$i<count($module_srl);$i++) {
|
for($i=0;$i<count($module_srl);$i++) {
|
||||||
$srl = trim($module_srl[$i]);
|
$srl = trim($module_srl[$i]);
|
||||||
if(!$srl) continue;
|
if(!$srl) continue;
|
||||||
$config->module_config[$srl] = $module_file_config;
|
$oModuleController->insertModulePartConfig('file',$srl,$file_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
// module Controller 객체 생성하여 입력
|
|
||||||
$oModuleController = &getController('module');
|
|
||||||
$output = $oModuleController->insertModuleConfig('file',$config);
|
|
||||||
|
|
||||||
$this->setError(-1);
|
$this->setError(-1);
|
||||||
$this->setMessage('success_updated');
|
$this->setMessage('success_updated');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,23 +72,19 @@
|
||||||
function getFileConfig($module_srl = null) {
|
function getFileConfig($module_srl = null) {
|
||||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$file_config = $oModuleModel->getModuleConfig('file');
|
|
||||||
|
|
||||||
$config->allowed_filesize = $file_config->allowed_filesize;
|
|
||||||
$config->allowed_attach_size = $file_config->allowed_attach_size;
|
|
||||||
$config->allowed_filetypes = $file_config->allowed_filetypes;
|
|
||||||
|
|
||||||
|
if($module_srl) $file_config = $oModuleModel->getModulePartConfig('file',$module_srl);
|
||||||
|
if(!$file_config) $file_config = $oModuleModel->getModuleConfig('file');
|
||||||
|
if($file_config) {
|
||||||
|
$config->allowed_filesize = $file_config->allowed_filesize;
|
||||||
|
$config->allowed_attach_size = $file_config->allowed_attach_size;
|
||||||
|
$config->allowed_filetypes = $file_config->allowed_filetypes;
|
||||||
|
$config->download_grant = $file_config->download_grant;
|
||||||
|
}
|
||||||
if(!$config->allowed_filesize) $config->allowed_filesize = '2';
|
if(!$config->allowed_filesize) $config->allowed_filesize = '2';
|
||||||
if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
|
if(!$config->allowed_attach_size) $config->allowed_attach_size = '3';
|
||||||
if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
|
if(!$config->allowed_filetypes) $config->allowed_filetypes = '*.*';
|
||||||
|
if(!$config->download_grant) $config->download_grant = array();
|
||||||
if($module_srl && $file_config->module_config[$module_srl]) {
|
|
||||||
$module_config = $file_config->module_config[$module_srl];
|
|
||||||
$config->allowed_filesize = $module_config->allowed_filesize;
|
|
||||||
$config->allowed_attach_size = $module_config->allowed_attach_size;
|
|
||||||
$config->allowed_filetypes = $module_config->allowed_filetypes;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -136,8 +132,6 @@
|
||||||
function getUploadConfig() {
|
function getUploadConfig() {
|
||||||
$logged_info = Context::get('logged_info');
|
$logged_info = Context::get('logged_info');
|
||||||
if($logged_info->is_admin == 'Y') {
|
if($logged_info->is_admin == 'Y') {
|
||||||
//$file_config->allowed_filesize = 1024;
|
|
||||||
//$file_config->allowed_attach_size = 1024;
|
|
||||||
$file_config->allowed_filesize = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
|
$file_config->allowed_filesize = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
|
||||||
$file_config->allowed_attach_size = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
|
$file_config->allowed_attach_size = preg_replace("/[a-z]/is","",ini_get('upload_max_filesize'));
|
||||||
$file_config->allowed_filetypes = '*.*';
|
$file_config->allowed_filetypes = '*.*';
|
||||||
|
|
@ -172,24 +166,7 @@
|
||||||
* @brief 특정 모듈의 file 설정을 return
|
* @brief 특정 모듈의 file 설정을 return
|
||||||
**/
|
**/
|
||||||
function getFileModuleConfig($module_srl) {
|
function getFileModuleConfig($module_srl) {
|
||||||
// file 모듈의 config를 가져옴
|
return $this->getFileConfig($module_srl);
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$file_config = $oModuleModel->getModuleConfig('file');
|
|
||||||
|
|
||||||
$module_file_config = $file_config->module_config[$module_srl];
|
|
||||||
if(!is_object($module_file_config)) $module_file_config = null;
|
|
||||||
|
|
||||||
if(!$module_file_config->module_srl) {
|
|
||||||
$module_file_config->module_srl = $module_srl;
|
|
||||||
$module_file_config->allowed_filesize = $file_config->allowed_filesize;
|
|
||||||
$module_file_config->allowed_attach_size = $file_config->allowed_attach_size;
|
|
||||||
$module_file_config->allowed_filetypes = $file_config->allowed_filetypes;
|
|
||||||
$module_file_config->download_grant = array();
|
|
||||||
} else {
|
|
||||||
if(!$module_file_config->download_grant) $module_file_config->download_grant = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $module_file_config;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -120,9 +120,8 @@
|
||||||
// header script를 레이아웃 모듈의 config에 저장
|
// header script를 레이아웃 모듈의 config에 저장
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
$layout_config = $oModuleModel->getModuleConfig('layout');
|
$layout_config->header_script = Context::get('header_script');
|
||||||
$layout_config->header_script[$args->layout_srl] = Context::get('header_script');
|
$oModuleController->insertModulePartConfig('layout',$args->layout_srl,$layout_config);
|
||||||
$output = $oModuleController->insertModuleConfig('layout',$layout_config);
|
|
||||||
|
|
||||||
// DB에 입력하기 위한 변수 설정
|
// DB에 입력하기 위한 변수 설정
|
||||||
$args->extra_vars = serialize($extra_vars);
|
$args->extra_vars = serialize($extra_vars);
|
||||||
|
|
|
||||||
|
|
@ -331,8 +331,8 @@
|
||||||
|
|
||||||
// header_script
|
// header_script
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$layout_config = $oModuleModel->getModuleConfig('layout');
|
$layout_config = $oModuleModel->getModulePartConfig('layout', $layout_srl);
|
||||||
$header_script = trim($layout_config->header_script[$layout_srl]);
|
$header_script = trim($layout_config->header_script);
|
||||||
|
|
||||||
if($header_script) $buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace('"','\\"',$header_script));
|
if($header_script) $buff .= sprintf(' $layout_info->header_script = "%s"; ', str_replace('"','\\"',$header_script));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row"><div>{$lang->header_script}</div></th>
|
<th scope="row"><div>{$lang->header_script}</div></th>
|
||||||
<td>
|
<td>
|
||||||
<textarea name="header_script" class="inputTypeText">{htmlspecialchars($selected_layout->header_script)}</textarea>
|
<textarea name="header_script" class="inputTypeTextArea w400">{htmlspecialchars($selected_layout->header_script)}</textarea>
|
||||||
<p>{$lang->about_header_script}</p>
|
<p>{$lang->about_header_script}</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
||||||
|
|
@ -110,16 +110,6 @@
|
||||||
**/
|
**/
|
||||||
function dispMemberAdminInfo() {
|
function dispMemberAdminInfo() {
|
||||||
return $this->dispMemberAdminInsert();
|
return $this->dispMemberAdminInsert();
|
||||||
|
|
||||||
/*
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$member_config = $oModuleModel->getModuleConfig('member');
|
|
||||||
|
|
||||||
Context::set('member_config', $member_config);
|
|
||||||
Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($this->member_info));
|
|
||||||
|
|
||||||
$this->setTemplateFile('member_info');
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,9 @@
|
||||||
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminCategory');
|
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminCategory');
|
||||||
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminInfo');
|
$oModuleController->insertActionForward('module', 'view', 'dispModuleAdminInfo');
|
||||||
|
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
|
||||||
|
|
||||||
// module 모듈에서 사용할 디렉토리 생성
|
// module 모듈에서 사용할 디렉토리 생성
|
||||||
FileHandler::makeDir('./files/cache/module_info');
|
FileHandler::makeDir('./files/cache/module_info');
|
||||||
FileHandler::makeDir('./files/cache/triggers');
|
FileHandler::makeDir('./files/cache/triggers');
|
||||||
|
|
@ -29,6 +32,11 @@
|
||||||
* @brief 설치가 이상이 없는지 체크하는 method
|
* @brief 설치가 이상이 없는지 체크하는 method
|
||||||
**/
|
**/
|
||||||
function checkUpdate() {
|
function checkUpdate() {
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
|
// 2008. 10. 27 module_part_config 테이블의 결합 인덱스 추가
|
||||||
|
if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,6 +44,61 @@
|
||||||
* @brief 업데이트 실행
|
* @brief 업데이트 실행
|
||||||
**/
|
**/
|
||||||
function moduleUpdate() {
|
function moduleUpdate() {
|
||||||
|
$oDB = &DB::getInstance();
|
||||||
|
|
||||||
|
// 2008. 10. 27 module_part_config 테이블의 결합 인덱스 추가하고 기존에 module_config에 몰려 있던 모든 정보를 재점검
|
||||||
|
if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) {
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$oModuleController = &getController('module');
|
||||||
|
$modules = $oModuleModel->getModuleList();
|
||||||
|
foreach($modules as $key => $module_info) {
|
||||||
|
$module = $module_info->module;
|
||||||
|
if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue;
|
||||||
|
$config = $oModuleModel->getModuleConfig($module);
|
||||||
|
|
||||||
|
$module_config = null;
|
||||||
|
switch($module) {
|
||||||
|
case 'point' :
|
||||||
|
$module_config = $config->module_point;
|
||||||
|
unset($config->module_point);
|
||||||
|
break;
|
||||||
|
case 'trackback' :
|
||||||
|
case 'rss' :
|
||||||
|
case 'file' :
|
||||||
|
case 'comment' :
|
||||||
|
case 'editor' :
|
||||||
|
$module_config = $config->module_config;
|
||||||
|
unset($config->module_config);
|
||||||
|
if(is_array($module_config) && count($module_config)) {
|
||||||
|
foreach($module_config as $key => $val) {
|
||||||
|
if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'layout' :
|
||||||
|
$tmp = $config->header_script;
|
||||||
|
if(is_array($tmp) && count($tmp)) {
|
||||||
|
foreach($tmp as $k => $v) {
|
||||||
|
if(!$v && !trim($v)) continue;
|
||||||
|
$module_config[$k]->header_script = $v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$config = null;
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$oModuleController->insertModuleConfig($module, $config);
|
||||||
|
|
||||||
|
if(is_array($module_config) && count($module_config)) {
|
||||||
|
foreach($module_config as $module_srl => $module_part_config) {
|
||||||
|
$oModuleController->insertModulePartConfig($module,$module_srl,$module_part_config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
|
||||||
|
}
|
||||||
|
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,27 +47,37 @@
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 모듈의 기본 정보 입력
|
* @brief 특정 모듈의 설정 입력
|
||||||
* 모듈의 정보를 입력받은 데이터를 serialize하여 등록한다.
|
* board, member등 특정 모듈의 global config 관리용
|
||||||
**/
|
**/
|
||||||
function insertModuleConfig($module, $config) {
|
function insertModuleConfig($module, $config) {
|
||||||
// 변수 정리
|
|
||||||
$args->module = $module;
|
$args->module = $module;
|
||||||
$args->config = serialize($config);
|
$args->config = serialize($config);
|
||||||
|
|
||||||
// 일단 삭제 (캐쉬 파일도 지운다)
|
|
||||||
$output = executeQuery('module.deleteModuleConfig', $args);
|
$output = executeQuery('module.deleteModuleConfig', $args);
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
FileHandler::removeFile( sprintf('./files/cache/module_info/%s.config.php',$module) );
|
|
||||||
|
|
||||||
// 변수 정리후 query 실행
|
|
||||||
$output = executeQuery('module.insertModuleConfig', $args);
|
$output = executeQuery('module.insertModuleConfig', $args);
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 특정 mid의 모듈 설정 정보 저장
|
||||||
|
* mid의 모듈 의존적인 설정을 관리
|
||||||
|
**/
|
||||||
|
function insertModulePartConfig($module, $module_srl, $config) {
|
||||||
|
$args->module = $module;
|
||||||
|
$args->module_srl = $module_srl;
|
||||||
|
$args->config = serialize($config);
|
||||||
|
|
||||||
|
$output = executeQuery('module.deleteModulePartConfig', $args);
|
||||||
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
|
$output = executeQuery('module.insertModulePartConfig', $args);
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 모듈 입력
|
* @brief 모듈 입력
|
||||||
**/
|
**/
|
||||||
|
|
|
||||||
|
|
@ -575,31 +575,48 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 특정 모듈의 설정 정보 return
|
* @brief 특정 모듈의 설정 return
|
||||||
* 캐시된 설정 정보가 없으면 만들 후 캐시하고 return
|
* board, member등 특정 모듈의 global config 관리용
|
||||||
**/
|
**/
|
||||||
function getModuleConfig($module) {
|
function getModuleConfig($module) {
|
||||||
if(!$GLOBALS['__ModuleConfig__'][$module]) {
|
if(!$GLOBALS['__ModuleConfig__'][$module]) {
|
||||||
$cache_file = sprintf('./files/cache/module_info/%s.config.php',$module);
|
$args->module = $module;
|
||||||
|
$output = executeQuery('module.getModuleConfig', $args);
|
||||||
if(!file_exists($cache_file)) {
|
$config = unserialize($output->data->config);
|
||||||
$args->module = $module;
|
$GLOBALS['__ModuleConfig__'][$module] = $config;
|
||||||
$output = executeQuery('module.getModuleConfig', $args);
|
|
||||||
|
|
||||||
$config = base64_encode($output->data->config);
|
|
||||||
|
|
||||||
$buff = sprintf('<?php if(!defined("__ZBXE__")) exit(); $config = "%s"; ?>', $config);
|
|
||||||
|
|
||||||
FileHandler::writeFile($cache_file, $buff);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!$config && file_exists($cache_file)) @include($cache_file);
|
|
||||||
|
|
||||||
$GLOBALS['__ModuleConfig__'][$module] = unserialize(base64_decode($config));
|
|
||||||
}
|
}
|
||||||
return $GLOBALS['__ModuleConfig__'][$module];
|
return $GLOBALS['__ModuleConfig__'][$module];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 특정 mid의 모듈 설정 정보 return
|
||||||
|
* mid의 모듈 의존적인 설정을 관리
|
||||||
|
**/
|
||||||
|
function getModulePartConfig($module, $module_srl) {
|
||||||
|
if(!$GLOBALS['__ModulePartConfig__'][$module][$module_srl]) {
|
||||||
|
$args->module = $module;
|
||||||
|
$args->module_srl = $module_srl;
|
||||||
|
$output = executeQuery('module.getModulePartConfig', $args);
|
||||||
|
$config = unserialize($output->data->config);
|
||||||
|
$GLOBALS['__ModulePartConfig__'][$module][$module_srl] = $config;
|
||||||
|
}
|
||||||
|
return $GLOBALS['__ModulePartConfig__'][$module][$module_srl];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief mid별 모듈 설정 정보 전체를 구함
|
||||||
|
**/
|
||||||
|
function getModulePartConfigs($module) {
|
||||||
|
$args->module = $module;
|
||||||
|
$output = executeQueryArray('module.getModulePartConfigs', $args);
|
||||||
|
if(!$output->toBool() || !$output->data) return array();
|
||||||
|
|
||||||
|
foreach($output->data as $key => $val) {
|
||||||
|
$result[$val->module_srl] = unserialize($val->config);
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
|
* @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
|
||||||
|
|
|
||||||
9
modules/module/queries/deleteModulePartConfig.xml
Normal file
9
modules/module/queries/deleteModulePartConfig.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<query id="deleteModulePartConfig" action="delete">
|
||||||
|
<tables>
|
||||||
|
<table name="module_part_config" />
|
||||||
|
</tables>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="module" var="module" notnull="notnull" />
|
||||||
|
<condition operation="equal" column="module_srl" var="module_srl" notnull="notnull" pipe="and"/>
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
12
modules/module/queries/getModulePartConfig.xml
Normal file
12
modules/module/queries/getModulePartConfig.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<query id="getModulePartConfig" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="module_part_config" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="config" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="module" var="module" notnull="notnull" />
|
||||||
|
<condition operation="equal" column="module_srl" var="module_srl" notnull="notnull" pipe="and" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
12
modules/module/queries/getModulePartConfigs.xml
Normal file
12
modules/module/queries/getModulePartConfigs.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
<query id="getModulePartConfigs" action="select">
|
||||||
|
<tables>
|
||||||
|
<table name="module_part_config" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="module_srl" />
|
||||||
|
<column name="config" />
|
||||||
|
</columns>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="equal" column="module" var="module" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
11
modules/module/queries/insertModulePartConfig.xml
Normal file
11
modules/module/queries/insertModulePartConfig.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
<query id="insertModulePartConfig" action="insert">
|
||||||
|
<tables>
|
||||||
|
<table name="module_part_config" />
|
||||||
|
</tables>
|
||||||
|
<columns>
|
||||||
|
<column name="module" var="module" notnull="notnull" />
|
||||||
|
<column name="module_srl" var="module_srl" notnull="notnull" />
|
||||||
|
<column name="config" var="config" />
|
||||||
|
<column name="regdate" default="curdate()" />
|
||||||
|
</columns>
|
||||||
|
</query>
|
||||||
6
modules/module/schemas/module_part_config.xml
Normal file
6
modules/module/schemas/module_part_config.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<table name="module_part_config">
|
||||||
|
<column name="module" type="varchar" size="250" notnull="notnull" />
|
||||||
|
<column name="module_srl" type="number" size="11" notnull="notnull" />
|
||||||
|
<column name="config" type="text" />
|
||||||
|
<column name="regdate" type="date" />
|
||||||
|
</table>
|
||||||
|
|
@ -4,12 +4,10 @@
|
||||||
<actions>
|
<actions>
|
||||||
<action name="dispPointAdminConfig" type="view" admin_index="true" standalone="true" />
|
<action name="dispPointAdminConfig" type="view" admin_index="true" standalone="true" />
|
||||||
<action name="dispPointAdminModuleConfig" type="view" standalone="true" />
|
<action name="dispPointAdminModuleConfig" type="view" standalone="true" />
|
||||||
<action name="dispPointAdminActConfig" type="view" standalone="true" />
|
|
||||||
<action name="dispPointAdminPointList" type="view" standalone="true" />
|
<action name="dispPointAdminPointList" type="view" standalone="true" />
|
||||||
|
|
||||||
<action name="procPointAdminInsertConfig" type="controller" standalone="true" />
|
<action name="procPointAdminInsertConfig" type="controller" standalone="true" />
|
||||||
<action name="procPointAdminInsertModuleConfig" type="controller" standalone="true" />
|
<action name="procPointAdminInsertModuleConfig" type="controller" standalone="true" />
|
||||||
<action name="procPointAdminInsertActConfig" type="controller" standalone="true" />
|
|
||||||
<action name="procPointAdminUpdatePoint" type="controller" standalone="true" />
|
<action name="procPointAdminUpdatePoint" type="controller" standalone="true" />
|
||||||
<action name="procPointAdminInsertPointModuleConfig" type="controller" standalone="true" />
|
<action name="procPointAdminInsertPointModuleConfig" type="controller" standalone="true" />
|
||||||
<action name="procPointAdminApplyPoint" type="controller" standalone="true" />
|
<action name="procPointAdminApplyPoint" type="controller" standalone="true" />
|
||||||
|
|
|
||||||
|
|
@ -83,11 +83,6 @@
|
||||||
* @brief 모듈별 설정 저장
|
* @brief 모듈별 설정 저장
|
||||||
**/
|
**/
|
||||||
function procPointAdminInsertModuleConfig() {
|
function procPointAdminInsertModuleConfig() {
|
||||||
// 설정 정보 가져오기
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
// 변수 정리
|
|
||||||
$args = Context::getRequestVars();
|
$args = Context::getRequestVars();
|
||||||
|
|
||||||
foreach($args as $key => $val) {
|
foreach($args as $key => $val) {
|
||||||
|
|
@ -95,13 +90,15 @@
|
||||||
if(!$matches[1]) continue;
|
if(!$matches[1]) continue;
|
||||||
$name = $matches[1];
|
$name = $matches[1];
|
||||||
$module_srl = $matches[2];
|
$module_srl = $matches[2];
|
||||||
if(strlen($val)==0) unset($config->module_point[$module_srl][$name]);
|
if(strlen($val)>0) $module_config[$module_srl][$name] = (int)$val;
|
||||||
else $config->module_point[$module_srl][$name] = (int)$val;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 저장
|
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
$oModuleController->insertModuleConfig('point', $config);
|
if(count($module_config)) {
|
||||||
|
foreach($module_config as $module_srl => $config) {
|
||||||
|
$oModuleController->insertModulePartConfig('point',$module_srl,$config);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->cacheActList();
|
$this->cacheActList();
|
||||||
|
|
||||||
|
|
@ -119,58 +116,26 @@
|
||||||
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
|
||||||
else $module_srl = array($module_srl);
|
else $module_srl = array($module_srl);
|
||||||
|
|
||||||
// 설정 정보 가져오기
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
// 설정 저장
|
// 설정 저장
|
||||||
|
$oModuleController = &getController('module');
|
||||||
for($i=0;$i<count($module_srl);$i++) {
|
for($i=0;$i<count($module_srl);$i++) {
|
||||||
$srl = trim($module_srl[$i]);
|
$srl = trim($module_srl[$i]);
|
||||||
if(!$srl) continue;
|
if(!$srl) continue;
|
||||||
$config->module_point[$srl]['insert_document'] = (int)Context::get('insert_document');
|
unset($config);
|
||||||
$config->module_point[$srl]['insert_comment'] = (int)Context::get('insert_comment');
|
$config['insert_document'] = (int)Context::get('insert_document');
|
||||||
$config->module_point[$srl]['upload_file'] = (int)Context::get('upload_file');
|
$config['insert_comment'] = (int)Context::get('insert_comment');
|
||||||
$config->module_point[$srl]['download_file'] = (int)Context::get('download_file');
|
$config['upload_file'] = (int)Context::get('upload_file');
|
||||||
$config->module_point[$srl]['read_document'] = (int)Context::get('read_document');
|
$config['download_file'] = (int)Context::get('download_file');
|
||||||
$config->module_point[$srl]['voted'] = (int)Context::get('voted');
|
$config['read_document'] = (int)Context::get('read_document');
|
||||||
$config->module_point[$srl]['blamed'] = (int)Context::get('blamed');
|
$config['voted'] = (int)Context::get('voted');
|
||||||
|
$config['blamed'] = (int)Context::get('blamed');
|
||||||
|
$oModuleController->insertModulePartConfig('point', $srl, $config);
|
||||||
}
|
}
|
||||||
|
|
||||||
$oModuleController = &getController('module');
|
|
||||||
$oModuleController->insertModuleConfig('point', $config);
|
|
||||||
|
|
||||||
$this->setError(-1);
|
$this->setError(-1);
|
||||||
$this->setMessage('success_updated');
|
$this->setMessage('success_updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 기능별 act 저장
|
|
||||||
**/
|
|
||||||
function procPointAdminInsertActConfig() {
|
|
||||||
// 설정 정보 가져오기
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
// 변수 정리
|
|
||||||
$args = Context::getRequestVars();
|
|
||||||
|
|
||||||
$config->insert_document_act = $args->insert_document_act;
|
|
||||||
$config->delete_document_act = $args->delete_document_act;
|
|
||||||
$config->insert_comment_act = $args->insert_comment_act;
|
|
||||||
$config->delete_comment_act = $args->delete_comment_act;
|
|
||||||
$config->upload_file_act = $args->upload_file_act;
|
|
||||||
$config->delete_file_act = $args->delete_file_act;
|
|
||||||
$config->download_file_act = $args->download_file_act;
|
|
||||||
|
|
||||||
// 저장
|
|
||||||
$oModuleController = &getController('module');
|
|
||||||
$oModuleController->insertModuleConfig('point', $config);
|
|
||||||
|
|
||||||
$this->cacheActList();
|
|
||||||
|
|
||||||
$this->setMessage('success_updated');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief 회원 포인트 변경
|
* @brief 회원 포인트 변경
|
||||||
**/
|
**/
|
||||||
|
|
@ -192,6 +157,8 @@
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
|
||||||
|
$module_config = $oModuleModel->getModulePartConfigs('point');
|
||||||
|
|
||||||
// 회원의 포인트 저장을 위한 변수
|
// 회원의 포인트 저장을 위한 변수
|
||||||
$member = array();
|
$member = array();
|
||||||
|
|
||||||
|
|
@ -201,7 +168,7 @@
|
||||||
|
|
||||||
if($output->data) {
|
if($output->data) {
|
||||||
foreach($output->data as $key => $val) {
|
foreach($output->data as $key => $val) {
|
||||||
if($config->module_point[$val->module_srl]['insert_document']) $insert_point = $config->module_point[$val->module_srl]['insert_document'];
|
if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document'];
|
||||||
else $insert_point = $config->insert_document;
|
else $insert_point = $config->insert_document;
|
||||||
|
|
||||||
if(!$val->member_srl) continue;
|
if(!$val->member_srl) continue;
|
||||||
|
|
@ -217,7 +184,7 @@
|
||||||
|
|
||||||
if($output->data) {
|
if($output->data) {
|
||||||
foreach($output->data as $key => $val) {
|
foreach($output->data as $key => $val) {
|
||||||
if($config->module_point[$val->module_srl]['insert_comment']) $insert_point = $config->module_point[$val->module_srl]['insert_comment'];
|
if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment'];
|
||||||
else $insert_point = $config->insert_comment;
|
else $insert_point = $config->insert_comment;
|
||||||
|
|
||||||
if(!$val->member_srl) continue;
|
if(!$val->member_srl) continue;
|
||||||
|
|
@ -233,7 +200,7 @@
|
||||||
|
|
||||||
if($output->data) {
|
if($output->data) {
|
||||||
foreach($output->data as $key => $val) {
|
foreach($output->data as $key => $val) {
|
||||||
if($config->module_point[$val->module_srl]['upload_file']) $insert_point = $config->module_point[$val->module_srl]['upload_file'];
|
if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file'];
|
||||||
else $insert_point = $config->upload_file;
|
else $insert_point = $config->upload_file;
|
||||||
|
|
||||||
if(!$val->member_srl) continue;
|
if(!$val->member_srl) continue;
|
||||||
|
|
@ -306,23 +273,7 @@
|
||||||
* @brief 캐시파일 저장
|
* @brief 캐시파일 저장
|
||||||
**/
|
**/
|
||||||
function cacheActList() {
|
function cacheActList() {
|
||||||
// 설정 정보 가져오기
|
return;
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
// 각 act값을 정리
|
|
||||||
$act_list = sprintf("%s,%s,%s,%s,%s,%s,%s",
|
|
||||||
$config->insert_document_act,
|
|
||||||
$config->delete_document_act,
|
|
||||||
$config->insert_comment_act,
|
|
||||||
$config->delete_comment_act,
|
|
||||||
$config->upload_file_act,
|
|
||||||
$config->delete_file_act,
|
|
||||||
$config->download_file_act
|
|
||||||
);
|
|
||||||
|
|
||||||
$act_cache_file = "./files/cache/point.act.cache";
|
|
||||||
FileHandler::writeFile($act_cache_file, $act_list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@
|
||||||
$mid_list = $oModuleModel->getMidList();
|
$mid_list = $oModuleModel->getMidList();
|
||||||
Context::set('mid_list', $mid_list);
|
Context::set('mid_list', $mid_list);
|
||||||
|
|
||||||
|
Context::set('module_config', $oModuleModel->getModulePartConfigs('point'));
|
||||||
|
|
||||||
// 템플릿 지정
|
// 템플릿 지정
|
||||||
$this->setTemplateFile('module_config');
|
$this->setTemplateFile('module_config');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -113,7 +113,6 @@
|
||||||
function checkUpdate() {
|
function checkUpdate() {
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
// 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가
|
// 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가
|
||||||
if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true;
|
if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true;
|
||||||
|
|
@ -144,8 +143,6 @@
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
|
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
// 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가
|
// 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가
|
||||||
if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'))
|
if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'))
|
||||||
$oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after');
|
$oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after');
|
||||||
|
|
|
||||||
|
|
@ -81,17 +81,18 @@
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point',$module_srl);
|
||||||
|
|
||||||
// 대상 회원의 포인트를 구함
|
// 대상 회원의 포인트를 구함
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
|
||||||
$point = $config->module_point[$module_srl]['insert_document'];
|
$point = $module_config['insert_document'];
|
||||||
if(!isset($point)) $point = $config->insert_document;
|
if(!isset($point)) $point = $config->insert_document;
|
||||||
$cur_point += $point;
|
$cur_point += $point;
|
||||||
|
|
||||||
// 첨부파일 등록에 대한 포인트 추가
|
// 첨부파일 등록에 대한 포인트 추가
|
||||||
$point = $config->module_point[$module_srl]['upload_file'];
|
$point = $module_config['upload_file'];
|
||||||
if(!isset($point)) $point = $config->upload_file;
|
if(!isset($point)) $point = $config->upload_file;
|
||||||
if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count;
|
if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count;
|
||||||
|
|
||||||
|
|
@ -108,12 +109,17 @@
|
||||||
$document_srl = $obj->document_srl;
|
$document_srl = $obj->document_srl;
|
||||||
$member_srl = $obj->member_srl;
|
$member_srl = $obj->member_srl;
|
||||||
|
|
||||||
|
$oDocumentModel = &getModel('document');
|
||||||
|
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||||
|
if(!$oDocument->isExists()) return new Object();
|
||||||
|
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point',$oDocument->get('module_srl'));
|
||||||
|
|
||||||
// 지울 대상 글의 댓글에 대한 처리
|
// 지울 대상 글의 댓글에 대한 처리
|
||||||
$comment_point = $config->module_point[$module_srl]['insert_comment'];
|
$comment_point = $module_config['insert_comment'];
|
||||||
if(!isset($comment_point)) $comment_point = $config->insert_comment;
|
if(!isset($comment_point)) $comment_point = $config->insert_comment;
|
||||||
|
|
||||||
// 댓글 포인트가 있으면 증감(+) 이면 차감 시도
|
// 댓글 포인트가 있으면 증감(+) 이면 차감 시도
|
||||||
|
|
@ -142,7 +148,7 @@
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
|
|
||||||
// 포인트를 구해옴
|
// 포인트를 구해옴
|
||||||
$point = $config->module_point[$module_srl]['download_file'];
|
$point = $module_config['download_file'];
|
||||||
foreach($member_srls as $member_srl => $cnt) {
|
foreach($member_srls as $member_srl => $cnt) {
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
$cur_point -= $cnt * $comment_point;
|
$cur_point -= $cnt * $comment_point;
|
||||||
|
|
@ -173,8 +179,9 @@
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
|
|
||||||
$point = $config->module_point[$module_srl]['insert_document'];
|
$point = $module_config['insert_document'];
|
||||||
if(!isset($point)) $point = $config->insert_document;
|
if(!isset($point)) $point = $config->insert_document;
|
||||||
|
|
||||||
// 포인트가 마이너스 즉 글을 작성시 마다 차감되는 경우라면 글 삭제시 증가시켜주지 않도록 수정
|
// 포인트가 마이너스 즉 글을 작성시 마다 차감되는 경우라면 글 삭제시 증가시켜주지 않도록 수정
|
||||||
|
|
@ -182,7 +189,7 @@
|
||||||
$cur_point -= $point;
|
$cur_point -= $point;
|
||||||
|
|
||||||
// 첨부파일 삭제에 대한 포인트 추가
|
// 첨부파일 삭제에 대한 포인트 추가
|
||||||
$point = $config->module_point[$module_srl]['upload_file'];
|
$point = $module_config['upload_file'];
|
||||||
if(!isset($point)) $point = $config->upload_file;
|
if(!isset($point)) $point = $config->upload_file;
|
||||||
if($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count;
|
if($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count;
|
||||||
|
|
||||||
|
|
@ -209,12 +216,13 @@
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
|
|
||||||
// 대상 회원의 포인트를 구함
|
// 대상 회원의 포인트를 구함
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
|
||||||
$point = $config->module_point[$module_srl]['insert_comment'];
|
$point = $module_config['insert_comment'];
|
||||||
if(!isset($point)) $point = $config->insert_comment;
|
if(!isset($point)) $point = $config->insert_comment;
|
||||||
|
|
||||||
// 포인트 증감
|
// 포인트 증감
|
||||||
|
|
@ -235,12 +243,13 @@
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
|
|
||||||
// 대상 회원의 포인트를 구함
|
// 대상 회원의 포인트를 구함
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
|
||||||
$point = $config->module_point[$module_srl]['insert_comment'];
|
$point = $module_config['insert_comment'];
|
||||||
if(!isset($point)) $point = $config->insert_comment;
|
if(!isset($point)) $point = $config->insert_comment;
|
||||||
|
|
||||||
// 포인트가 마이너스 즉 댓글을 작성시 마다 차감되는 경우라면 댓글 삭제시 증가시켜주지 않도록 수정
|
// 포인트가 마이너스 즉 댓글을 작성시 마다 차감되는 경우라면 댓글 삭제시 증가시켜주지 않도록 수정
|
||||||
|
|
@ -259,26 +268,6 @@
|
||||||
**/
|
**/
|
||||||
function triggerInsertFile(&$obj) {
|
function triggerInsertFile(&$obj) {
|
||||||
return new Object();
|
return new Object();
|
||||||
$module_srl = $obj->module_srl;
|
|
||||||
$member_srl = $obj->member_srl;
|
|
||||||
if(!$module_srl || !$member_srl) return new Object();
|
|
||||||
|
|
||||||
// point 모듈 정보 가져옴
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
// 대상 회원의 포인트를 구함
|
|
||||||
$oPointModel = &getModel('point');
|
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
|
||||||
|
|
||||||
$point = $config->module_point[$module_srl]['upload_file'];
|
|
||||||
if(!isset($point)) $point = $config->upload_file;
|
|
||||||
|
|
||||||
// 포인트 증감
|
|
||||||
$cur_point += $point;
|
|
||||||
$this->setPoint($member_srl,$cur_point);
|
|
||||||
|
|
||||||
return new Object();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -295,12 +284,13 @@
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
|
|
||||||
// 대상 회원의 포인트를 구함
|
// 대상 회원의 포인트를 구함
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
|
||||||
$point = $config->module_point[$module_srl]['upload_file'];
|
$point = $module_config['upload_file'];
|
||||||
if(!isset($point)) $point = $config->upload_file;
|
if(!isset($point)) $point = $config->upload_file;
|
||||||
|
|
||||||
// 포인트 증감
|
// 포인트 증감
|
||||||
|
|
@ -314,27 +304,25 @@
|
||||||
* @brief 파일 다운로드 전에 호출되는 trigger
|
* @brief 파일 다운로드 전에 호출되는 trigger
|
||||||
**/
|
**/
|
||||||
function triggerBeforeDownloadFile(&$obj) {
|
function triggerBeforeDownloadFile(&$obj) {
|
||||||
// point 모듈 정보 가져옴
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
// 포인트가 없으면 다운로드가 안되도록 하였으면 비로그인 회원일 경우 중지
|
|
||||||
if(!Context::get('is_logged') && $config->disable_download == 'Y') return new Object(-1,'msg_not_permitted_download');
|
|
||||||
|
|
||||||
// 로그인 상태일때만 실행
|
|
||||||
$logged_info = Context::get('logged_info');
|
$logged_info = Context::get('logged_info');
|
||||||
if(!$logged_info->member_srl) return new Object();
|
if(!$logged_info->member_srl) return new Object();
|
||||||
|
|
||||||
$member_srl = $logged_info->member_srl;
|
$member_srl = $logged_info->member_srl;
|
||||||
$module_srl = $obj->module_srl;
|
$module_srl = $obj->module_srl;
|
||||||
if(!$module_srl) return new Object();
|
if(!$module_srl) return new Object();
|
||||||
|
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
|
|
||||||
|
// 포인트가 없으면 다운로드가 안되도록 하였으면 비로그인 회원일 경우 중지
|
||||||
|
if(!Context::get('is_logged') && $config->disable_download == 'Y') return new Object(-1,'msg_not_permitted_download');
|
||||||
|
|
||||||
// 대상 회원의 포인트를 구함
|
// 대상 회원의 포인트를 구함
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
|
||||||
// 포인트를 구해옴
|
// 포인트를 구해옴
|
||||||
$point = $config->module_point[$module_srl]['download_file'];
|
$point = $module_config['download_file'];
|
||||||
if(!isset($point)) $point = $config->download_file;
|
if(!isset($point)) $point = $config->download_file;
|
||||||
|
|
||||||
// 포인트가 0보다 작고 포인트가 없으면 파일 다운로드가 안되도록 했다면 오류
|
// 포인트가 0보다 작고 포인트가 없으면 파일 다운로드가 안되도록 했다면 오류
|
||||||
|
|
@ -350,7 +338,6 @@
|
||||||
// 로그인 상태일때만 실행
|
// 로그인 상태일때만 실행
|
||||||
$logged_info = Context::get('logged_info');
|
$logged_info = Context::get('logged_info');
|
||||||
if(!$logged_info->member_srl) return new Object();
|
if(!$logged_info->member_srl) return new Object();
|
||||||
|
|
||||||
$module_srl = $obj->module_srl;
|
$module_srl = $obj->module_srl;
|
||||||
$member_srl = $logged_info->member_srl;
|
$member_srl = $logged_info->member_srl;
|
||||||
if(!$module_srl) return new Object();
|
if(!$module_srl) return new Object();
|
||||||
|
|
@ -358,13 +345,14 @@
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
|
|
||||||
// 대상 회원의 포인트를 구함
|
// 대상 회원의 포인트를 구함
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
|
||||||
// 포인트를 구해옴
|
// 포인트를 구해옴
|
||||||
$point = $config->module_point[$module_srl]['download_file'];
|
$point = $module_config['download_file'];
|
||||||
if(!isset($point)) $point = $config->download_file;
|
if(!isset($point)) $point = $config->download_file;
|
||||||
|
|
||||||
// 포인트 증감
|
// 포인트 증감
|
||||||
|
|
@ -381,20 +369,20 @@
|
||||||
// 로그인 상태일때만 실행
|
// 로그인 상태일때만 실행
|
||||||
$logged_info = Context::get('logged_info');
|
$logged_info = Context::get('logged_info');
|
||||||
if(!$logged_info->member_srl) return new Object();
|
if(!$logged_info->member_srl) return new Object();
|
||||||
|
$member_srl = $logged_info->member_srl;
|
||||||
|
$module_srl = $obj->get('module_srl');
|
||||||
|
|
||||||
// point 모듈 정보 가져옴
|
// point 모듈 정보 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
$member_srl = $logged_info->member_srl;
|
|
||||||
$module_srl = $obj->get('module_srl');
|
|
||||||
|
|
||||||
// 대상 회원의 포인트를 구함
|
// 대상 회원의 포인트를 구함
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
|
||||||
// 포인트를 구해옴
|
// 포인트를 구해옴
|
||||||
$point = $config->module_point[$obj->get('module_srl')]['read_document'];
|
$point = $module_config['read_document'];
|
||||||
if(!isset($point)) $point = $config->read_document;
|
if(!isset($point)) $point = $config->read_document;
|
||||||
|
|
||||||
// 조회 포인트가 없으면 패스
|
// 조회 포인트가 없으면 패스
|
||||||
|
|
@ -427,18 +415,16 @@
|
||||||
|
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
|
$module_config = $oModuleModel->getModulePartConfig('point', $module_srl);
|
||||||
|
|
||||||
$oPointModel = &getModel('point');
|
$oPointModel = &getModel('point');
|
||||||
$cur_point = $oPointModel->getPoint($member_srl, true);
|
$cur_point = $oPointModel->getPoint($member_srl, true);
|
||||||
|
|
||||||
if( $obj->point > 0 )
|
if( $obj->point > 0 ) {
|
||||||
{
|
$point = $module_config['voted'];
|
||||||
$point = $config->module_point[$module_srl]['voted'];
|
|
||||||
if(!isset($point)) $point = $config->voted;
|
if(!isset($point)) $point = $config->voted;
|
||||||
}
|
} else {
|
||||||
else
|
$point = $module_config['blamed'];
|
||||||
{
|
|
||||||
$point = $config->module_point[$module_srl]['blamed'];
|
|
||||||
if(!isset($point)) $point = $config->blamed;
|
if(!isset($point)) $point = $config->blamed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,6 @@
|
||||||
$current_module_srls = Context::get('module_srls');
|
$current_module_srls = Context::get('module_srls');
|
||||||
|
|
||||||
if(!$current_module_srl && !$current_module_srls) {
|
if(!$current_module_srl && !$current_module_srls) {
|
||||||
// 선택된 모듈의 정보를 가져옴
|
|
||||||
$current_module_info = Context::get('current_module_info');
|
$current_module_info = Context::get('current_module_info');
|
||||||
$current_module_srl = $current_module_info->module_srl;
|
$current_module_srl = $current_module_info->module_srl;
|
||||||
if(!$current_module_srl) return new Object();
|
if(!$current_module_srl) return new Object();
|
||||||
|
|
@ -33,24 +32,23 @@
|
||||||
|
|
||||||
// 설정 정보 가져오기
|
// 설정 정보 가져오기
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$config = $oModuleModel->getModuleConfig('point');
|
|
||||||
|
|
||||||
if($config->module_point[$current_module_srl]) $module_config = $config->module_point[$current_module_srl];
|
if($current_module_srl) {
|
||||||
else {
|
$module_config = $oModuleModel->getModulePartConfig('point', $current_module_srl);
|
||||||
$module_config['insert_document'] = $config->insert_document;
|
if(!$module_config) {
|
||||||
$module_config['insert_comment'] = $config->insert_comment;
|
$config = $oModuleModel->getModuleConfig('point');
|
||||||
$module_config['upload_file'] = $config->upload_file;
|
$module_config['insert_document'] = $config->insert_document;
|
||||||
$module_config['download_file'] = $config->download_file;
|
$module_config['insert_comment'] = $config->insert_comment;
|
||||||
$module_config['read_document'] = $config->read_document;
|
$module_config['upload_file'] = $config->upload_file;
|
||||||
|
$module_config['download_file'] = $config->download_file;
|
||||||
//2008.05.13 haneul
|
$module_config['read_document'] = $config->read_document;
|
||||||
$module_config['voted'] = $config->voted;
|
$module_config['voted'] = $config->voted;
|
||||||
$module_config['blamed'] = $config->blamed;
|
$module_config['blamed'] = $config->blamed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$module_config['module_srl'] = $current_module_srl;
|
$module_config['module_srl'] = $current_module_srl;
|
||||||
$module_config['point_name'] = $config->point_name;
|
$module_config['point_name'] = $config->point_name;
|
||||||
|
|
||||||
Context::set('module_config', $module_config);
|
Context::set('module_config', $module_config);
|
||||||
|
|
||||||
// 템플릿 파일 지정
|
// 템플릿 파일 지정
|
||||||
|
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
<!--%import("filter/insert_act_config.xml")-->
|
|
||||||
<!--#include("./header.html")-->
|
|
||||||
|
|
||||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_act_config);" id="fo_point">
|
|
||||||
|
|
||||||
<div class="infoText">{$lang->about_act_config}</div>
|
|
||||||
|
|
||||||
<table cellspacing="0" class="tableType2 topGap">
|
|
||||||
<tr>
|
|
||||||
<th><div>{$lang->point_insert_document}</div></th>
|
|
||||||
<td><input type="text" name="insert_document_act" value="{$config->insert_document_act}" class="inputTypeText w100" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="row2">
|
|
||||||
<th><div>{$lang->point_delete_document}</div></th>
|
|
||||||
<td><input type="text" name="delete_document_act" value="{$config->delete_document_act}" class="inputTypeText w100" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><div>{$lang->point_insert_comment}</div></th>
|
|
||||||
<td><input type="text" name="insert_comment_act" value="{$config->insert_comment_act}" class="inputTypeText w100" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="row2">
|
|
||||||
<th><div>{$lang->point_delete_comment}</div></th>
|
|
||||||
<td><input type="text" name="delete_comment_act" value="{$config->delete_comment_act}" class="inputTypeText w100" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><div>{$lang->point_upload_file}</div></th>
|
|
||||||
<td><input type="text" name="upload_file_act" value="{$config->upload_file_act}" class="inputTypeText w100" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="row2">
|
|
||||||
<th><div>{$lang->point_delete_file}</div></th>
|
|
||||||
<td><input type="text" name="delete_file_act" value="{$config->delete_file_act}" class="inputTypeText w100" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th><div>{$lang->point_download_file}</div></th>
|
|
||||||
<td><input type="text" name="download_file_act" value="{$config->download_file_act}" class="inputTypeText w100" /></td>
|
|
||||||
</tr>
|
|
||||||
<tr class="row2">
|
|
||||||
<td colspan="2" class="right">
|
|
||||||
<span class="button"><input type="submit" value="{$lang->cmd_registration}" accesskey="s" /></span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<!--@foreach($member_list as $no => $val)-->
|
<!--@foreach($member_list as $no => $val)-->
|
||||||
<tr>
|
<tr>
|
||||||
<td class="number">{$no}</td>
|
<td class="center number">{$no}</td>
|
||||||
<td class="nowrap">{htmlspecialchars($val->user_id)}</td>
|
<td class="nowrap">{htmlspecialchars($val->user_id)}</td>
|
||||||
<td class="nowrap">{htmlspecialchars($val->user_name)}</td>
|
<td class="nowrap">{htmlspecialchars($val->user_name)}</td>
|
||||||
<td class="nowrap"><span class="member_{$val->member_srl}">{htmlspecialchars($val->nick_name)}</span></td>
|
<td class="nowrap"><span class="member_{$val->member_srl}">{htmlspecialchars($val->nick_name)}</span></td>
|
||||||
|
|
|
||||||
|
|
@ -25,17 +25,17 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
<!--@foreach($mid_list as $key => $val)-->
|
<!--@foreach($mid_list as $key => $val)-->
|
||||||
<!--@if(in_array($val->module,array('guestbook','board','blog')))-->
|
<!--@if(in_array($val->module,array('guestbook','board','blog')))-->
|
||||||
<tr>
|
<tr class="row2">
|
||||||
<th colspan="7" scope="col"><div><strong>{$val->browser_title}</strong> ({$val->mid})</div></th>
|
<th colspan="7" scope="col"><div><strong>{$val->browser_title}</strong> ({$val->mid})</div></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="text" name="insert_document_{$val->module_srl}" value="{$config->module_point[$val->module_srl]['insert_document']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
<td><input type="text" name="insert_document_{$val->module_srl}" value="{$module_config[$val->module_srl]['insert_document']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
||||||
<td><input type="text" name="insert_comment_{$val->module_srl}" value="{$config->module_point[$val->module_srl]['insert_comment']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
<td><input type="text" name="insert_comment_{$val->module_srl}" value="{$module_config[$val->module_srl]['insert_comment']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
||||||
<td><input type="text" name="upload_file_{$val->module_srl}" value="{$config->module_point[$val->module_srl]['upload_file']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
<td><input type="text" name="upload_file_{$val->module_srl}" value="{$module_config[$val->module_srl]['upload_file']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
||||||
<td><input type="text" name="download_file_{$val->module_srl}" value="{$config->module_point[$val->module_srl]['download_file']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
<td><input type="text" name="download_file_{$val->module_srl}" value="{$module_config[$val->module_srl]['download_file']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
||||||
<td><input type="text" name="read_document_{$val->module_srl}" value="{$config->module_point[$val->module_srl]['read_document']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
<td><input type="text" name="read_document_{$val->module_srl}" value="{$module_config[$val->module_srl]['read_document']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
||||||
<td><input type="text" name="voted_{$val->module_srl}" value="{$config->module_point[$val->module_srl]['voted']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
<td><input type="text" name="voted_{$val->module_srl}" value="{$module_config[$val->module_srl]['voted']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
||||||
<td><input type="text" name="blamed_{$val->module_srl}" value="{$config->module_point[$val->module_srl]['blamed']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
<td><input type="text" name="blamed_{$val->module_srl}" value="{$module_config[$val->module_srl]['blamed']}" class="inputTypeText w40" /> {$config->point_name}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
|
||||||
36
modules/point/tpl/point_module_config.html
Normal file
36
modules/point/tpl/point_module_config.html
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
<!--%import("filter/insert_point_module_config.xml")-->
|
||||||
|
|
||||||
|
<form action="./" method="get" onsubmit="return procFilter(this, insert_point_module_config);" id="fo_point">
|
||||||
|
<input type="hidden" name="target_module_srl" value="{$module_config['module_srl']?$module_config['module_srl']:$module_srls}" />
|
||||||
|
|
||||||
|
<table cellspacing="0" class="adminTable">
|
||||||
|
<caption>{$lang->point}</caption>
|
||||||
|
<tr>
|
||||||
|
<th><div>{$lang->point_insert_document}</div></th>
|
||||||
|
<td class="wide"><input type="text" name="insert_document" value="{$module_config['insert_document']}" class="inputTypeText w80" /> {$module_config['point_name']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><div>{$lang->point_insert_comment}</div></th>
|
||||||
|
<td><input type="text" name="insert_comment" value="{$module_config['insert_comment']}" class="inputTypeText w80" /> {$module_config['point_name']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><div>{$lang->point_upload_file}</div></th>
|
||||||
|
<td><input type="text" name="upload_file" value="{$module_config['upload_file']}" class="inputTypeText w80" /> {$module_config['point_name']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><div>{$lang->point_download_file}</div></th>
|
||||||
|
<td><input type="text" name="download_file" value="{$module_config['download_file']}" class="inputTypeText w80" /> {$module_config['point_name']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><div>{$lang->point_read_document}</div></th>
|
||||||
|
<td><input type="text" name="read_document" value="{$module_config['read_document']}" class="inputTypeText w80" /> {$module_config['point_name']}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="right"><span class="button"><input type="submit" value="{$lang->cmd_save}" /></span></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<!-- 버튼 -->
|
||||||
|
|
||||||
|
</form>
|
||||||
|
<div class="gap1"></div>
|
||||||
|
|
@ -47,15 +47,9 @@
|
||||||
* @brief RSS 모듈별 설정 함수
|
* @brief RSS 모듈별 설정 함수
|
||||||
**/
|
**/
|
||||||
function setRssModuleConfig($module_srl, $open_rss) {
|
function setRssModuleConfig($module_srl, $open_rss) {
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
|
$config->open_rss = $open_rss;
|
||||||
$rss_config = $oModuleModel->getModuleConfig('rss');
|
$oModuleController->insertModulePartConfig('rss',$module_srl,$config);
|
||||||
$rss_config->module_config[$module_srl]->module_srl = $module_srl;
|
|
||||||
$rss_config->module_config[$module_srl]->open_rss = $open_rss;
|
|
||||||
|
|
||||||
$oModuleController->insertModuleConfig('rss', $rss_config);
|
|
||||||
|
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@
|
||||||
$current_module_srl = Context::get('module_srl');
|
$current_module_srl = Context::get('module_srl');
|
||||||
|
|
||||||
if(!$current_module_srl) {
|
if(!$current_module_srl) {
|
||||||
// 선택된 모듈의 정보를 가져옴
|
|
||||||
$current_module_info = Context::get('current_module_info');
|
$current_module_info = Context::get('current_module_info');
|
||||||
$current_module_srl = $current_module_info->module_srl;
|
$current_module_srl = $current_module_info->module_srl;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,8 @@
|
||||||
function getRssModuleConfig($module_srl) {
|
function getRssModuleConfig($module_srl) {
|
||||||
// rss 모듈의 config를 가져옴
|
// rss 모듈의 config를 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$rss_config = $oModuleModel->getModuleConfig('rss');
|
$module_rss_config = $oModuleModel->getModuleConfig('rss', $module_srl);
|
||||||
|
if(!$module_rss_config) {
|
||||||
$module_rss_config = $rss_config->module_config[$module_srl];
|
|
||||||
|
|
||||||
if(!$module_rss_config->module_srl) {
|
|
||||||
$module_rss_config->module_srl = $module_srl;
|
$module_rss_config->module_srl = $module_srl;
|
||||||
$module_rss_config->open_rss = 'N';
|
$module_rss_config->open_rss = 'N';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,72 +25,38 @@
|
||||||
**/
|
**/
|
||||||
$mid = Context::get('mid'); ///< 대상 모듈 id, 없으면 전체로
|
$mid = Context::get('mid'); ///< 대상 모듈 id, 없으면 전체로
|
||||||
|
|
||||||
// rss module config를 가져옴
|
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$rss_config = $oModuleModel->getModuleConfig('rss');
|
|
||||||
|
|
||||||
/**
|
$module_srls = array();
|
||||||
* 요청된 모듈 혹은 전체 모듈의 정보를 구하고 open_rss의 값을 체크
|
$rss_config = array();
|
||||||
**/
|
|
||||||
$mid_list = array();
|
|
||||||
|
|
||||||
// mid값이 없으면 전체 mid중 open_rss == 'Y|H'인 걸 고름
|
// 하나의 mid가 지정되어 있으면 그 mid에 대한 것만 추출
|
||||||
if(!$mid) {
|
if($mid) {
|
||||||
|
$module_srl = $this->module_info->module_srl;
|
||||||
|
$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
|
||||||
|
if($config->open_rss && $config->open_rss != 'N') {
|
||||||
|
$module_srls[] = $module_srl;
|
||||||
|
$rss_config[$module_srl] = $config->open_rss;
|
||||||
|
}
|
||||||
|
|
||||||
$module_srl_list = null;
|
// mid 가 선택되어 있지 않으면 전체
|
||||||
|
} else {
|
||||||
// rss config에 등록된 모듈중 rss 공개하는 것들의 module_srl을 고름
|
$rss_config = $oModuleModel->getModulePartConfigs('rss');
|
||||||
if($rss_config->module_config && count($rss_config->module_config)) {
|
if($rss_config) {
|
||||||
foreach($rss_config->module_config as $key => $val) {
|
foreach($rss_config as $module_srl => $config) {
|
||||||
if($val->open_rss == 'N' || !$val->open_rss) continue;
|
if($config && $config->open_rss != 'N') {
|
||||||
$module_srl_list[] = $val->module_srl;
|
$module_srls[] = $module_srl;
|
||||||
|
$rss_config[$module_srl] = $config->open_rss;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 선택된 모듈이 없으면 패스
|
|
||||||
if(!$module_srl_list || !count($module_srl_list)) return $this->dispError();
|
|
||||||
|
|
||||||
// 선택된 모듈들을 정리
|
|
||||||
$args->module_srls = implode(',',$module_srl_list);
|
|
||||||
$module_list = $oModuleModel->getMidList($args);
|
|
||||||
if(!$module_list) return $this->dispError();
|
|
||||||
|
|
||||||
// 대상 모듈을 정리함
|
|
||||||
$module_srl_list = array();
|
|
||||||
foreach($module_list as $mid => $val) {
|
|
||||||
$val->open_rss = $rss_config->module_config[$val->module_srl]->open_rss;
|
|
||||||
$module_srl_list[] = $val->module_srl;
|
|
||||||
$mid_list[$val->module_srl] = $val;
|
|
||||||
}
|
|
||||||
if(!count($module_srl_list)) return $this->dispError();
|
|
||||||
unset($output);
|
|
||||||
unset($args);
|
|
||||||
|
|
||||||
$module_srl = implode(',',$module_srl_list);
|
|
||||||
|
|
||||||
// 있으면 해당 모듈의 정보를 구함
|
|
||||||
} else {
|
|
||||||
// 모듈의 설정 정보를 받아옴 (module model 객체를 이용)
|
|
||||||
$module_info = $oModuleModel->getModuleInfoByMid($mid);
|
|
||||||
if($module_info->mid != $mid) return $this->dispError();
|
|
||||||
|
|
||||||
// 해당 모듈이 rss를 사용하는지 확인
|
|
||||||
$rss_module_config = $rss_config->module_config[$module_info->module_srl];
|
|
||||||
if(!$rss_module_config->open_rss) $rss_module_config->open_rss = 'N';
|
|
||||||
|
|
||||||
// RSS 비활성화 되었는지 체크하여 비활성화시 에러 출력
|
|
||||||
if($rss_module_config->open_rss == 'N') return $this->dispError();
|
|
||||||
|
|
||||||
$module_srl = $module_info->module_srl;
|
|
||||||
$module_info->open_rss = $rss_module_config->open_rss;
|
|
||||||
$mid_list[$module_info->module_srl] = $module_info;
|
|
||||||
|
|
||||||
unset($args);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
if(!count($module_srls)) return $this->dispError();
|
||||||
* 출력할 컨텐츠 추출을 위한 인자 정리
|
|
||||||
**/
|
$args->module_srls = implode(',',$module_srls);
|
||||||
$args->module_srl = $module_srl;
|
$module_list = $oModuleModel->getMidList($args);
|
||||||
|
|
||||||
$args->search_target = 'is_secret';
|
$args->search_target = 'is_secret';
|
||||||
$args->search_keyword = 'N';
|
$args->search_keyword = 'N';
|
||||||
$args->page = 1;
|
$args->page = 1;
|
||||||
|
|
@ -107,7 +73,7 @@
|
||||||
$document_list = $output->data;
|
$document_list = $output->data;
|
||||||
|
|
||||||
// rss 제목 및 정보등을 추출
|
// rss 제목 및 정보등을 추출
|
||||||
if($this->mid) {
|
if($mid) {
|
||||||
$info->title = Context::getBrowserTitle();
|
$info->title = Context::getBrowserTitle();
|
||||||
$info->description = $this->module_info->description;
|
$info->description = $this->module_info->description;
|
||||||
$info->link = getUrl('','mid',Context::get('mid'));
|
$info->link = getUrl('','mid',Context::get('mid'));
|
||||||
|
|
@ -121,7 +87,7 @@
|
||||||
|
|
||||||
// RSS 출력물에서 사용될 변수 세팅
|
// RSS 출력물에서 사용될 변수 세팅
|
||||||
Context::set('info', $info);
|
Context::set('info', $info);
|
||||||
Context::set('mid_list', $mid_list);
|
Context::set('rss_config', $rss_config);
|
||||||
Context::set('document_list', $document_list);
|
Context::set('document_list', $document_list);
|
||||||
|
|
||||||
// 결과 출력을 XMLRPC로 강제 지정
|
// 결과 출력을 XMLRPC로 강제 지정
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
<title><![CDATA[{$oDocument->getTitleText()}]]></title>
|
<title><![CDATA[{$oDocument->getTitleText()}]]></title>
|
||||||
<author><![CDATA[{$oDocument->getNickName()}]]></author>
|
<author><![CDATA[{$oDocument->getNickName()}]]></author>
|
||||||
<link><![CDATA[{$oDocument->getPermanentUrl()}]]></link>
|
<link><![CDATA[{$oDocument->getPermanentUrl()}]]></link>
|
||||||
<!--@if($mid_list[$oDocument->get('module_srl')]->open_rss=='Y')-->
|
<!--@if($rss_config[$oDocument->get('module_srl')]->open_rss=='Y')-->
|
||||||
<description><![CDATA[{$oDocument->getContent(false,false,true)}]]></description>
|
<description><![CDATA[{$oDocument->getContent(false,false,true)}]]></description>
|
||||||
<!--@else-->
|
<!--@else-->
|
||||||
<description><![CDATA[{$oDocument->getContentText(100)}]]></description>
|
<description><![CDATA[{$oDocument->getContentText(100)}]]></description>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
<td class="wide">
|
<td class="wide">
|
||||||
<select name="open_rss" class="w400">
|
<select name="open_rss" class="w400">
|
||||||
<!--@foreach($lang->open_rss_types as $key=>$val)-->
|
<!--@foreach($lang->open_rss_types as $key=>$val)-->
|
||||||
<option value="{$key}" <!--@if($rss_config->open_rss==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
<option value="{$key}" <!--@if(!$rss_config->open_rss && $key=='N')-->selected="selected"<!--@elseif($rss_config->open_rss==$key)-->selected="selected"<!--@end-->>{$val}</option>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
</select>
|
</select>
|
||||||
<p>{$lang->about_open_rss}</p>
|
<p>{$lang->about_open_rss}</p>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
<title><![CDATA[{$oDocument->getTitleText()}]]></title>
|
<title><![CDATA[{$oDocument->getTitleText()}]]></title>
|
||||||
<author><![CDATA[{$oDocument->getNickName()}]]></author>
|
<author><![CDATA[{$oDocument->getNickName()}]]></author>
|
||||||
<link><![CDATA[{$oDocument->getPermanentUrl()}]]></link>
|
<link><![CDATA[{$oDocument->getPermanentUrl()}]]></link>
|
||||||
<!--@if($mid_list[$oDocument->get('module_srl')]->open_rss=='Y')-->
|
<!--@if($rss_config[$oDocument->get('module_srl')]->open_rss=='Y')-->
|
||||||
<description><![CDATA[{$oDocument->getContent(false)}]]></description>
|
<description><![CDATA[{$oDocument->getContent(false)}]]></description>
|
||||||
<!--@else-->
|
<!--@else-->
|
||||||
<description><![CDATA[{$oDocument->getContentText(100)}]]></description>
|
<description><![CDATA[{$oDocument->getContentText(100)}]]></description>
|
||||||
|
|
|
||||||
|
|
@ -41,14 +41,9 @@
|
||||||
* @brief 설정 저장
|
* @brief 설정 저장
|
||||||
**/
|
**/
|
||||||
function procTrackbackAdminInsertConfig() {
|
function procTrackbackAdminInsertConfig() {
|
||||||
// 기존 설정을 가져옴
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('trackback');
|
|
||||||
|
|
||||||
$config->enable_trackback = Context::get('enable_trackback');
|
$config->enable_trackback = Context::get('enable_trackback');
|
||||||
if($config->enable_trackback != 'Y') $config->enable_trackback = 'N';
|
if($config->enable_trackback != 'Y') $config->enable_trackback = 'N';
|
||||||
|
|
||||||
// module Controller 객체 생성하여 입력
|
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
$output = $oModuleController->insertModuleConfig('trackback',$config);
|
$output = $oModuleController->insertModuleConfig('trackback',$config);
|
||||||
return $output;
|
return $output;
|
||||||
|
|
@ -84,15 +79,10 @@
|
||||||
* @brief Trackback 모듈별 설정 함수
|
* @brief Trackback 모듈별 설정 함수
|
||||||
**/
|
**/
|
||||||
function setTrackbackModuleConfig($module_srl, $enable_trackback) {
|
function setTrackbackModuleConfig($module_srl, $enable_trackback) {
|
||||||
$oModuleModel = &getModel('module');
|
$config->enable_trackback = $enable_trackback;
|
||||||
|
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
|
$oModuleController->insertModulePartConfig('trackback', $module_srl, $config);
|
||||||
$trackback_config = $oModuleModel->getModuleConfig('trackback');
|
|
||||||
$trackback_config->module_config[$module_srl]->module_srl = $module_srl;
|
|
||||||
$trackback_config->module_config[$module_srl]->enable_trackback = $enable_trackback;
|
|
||||||
|
|
||||||
$oModuleController->insertModuleConfig('trackback', $trackback_config);
|
|
||||||
|
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,15 +103,14 @@
|
||||||
if($key != $given_key) return $this->stop('fail');
|
if($key != $given_key) return $this->stop('fail');
|
||||||
|
|
||||||
// 엮인글 모듈의 기본 설정을 받음
|
// 엮인글 모듈의 기본 설정을 받음
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
$config = $oModuleModel->getModuleConfig('trackback');
|
|
||||||
|
|
||||||
// 현재 모듈의 설정을 구함
|
|
||||||
$module_srl = Context::get('module_srl');
|
$module_srl = Context::get('module_srl');
|
||||||
$enable_trackback = $config->module_config[$module_srl]->enable_trackback;
|
$oModuleModel = &getModel('module');
|
||||||
|
$config = $oModuleModel->getModulePartConfig('trackback', $module_srl);
|
||||||
// 설정 구함
|
$enable_trackback = $config->enable_trackback;
|
||||||
if(!$enable_trackback) $enable_trackback = $config->enable_trackback;
|
if(!$enable_trackback) {
|
||||||
|
$config = $oModuleModel->getModuleConfig('trackback');
|
||||||
|
$enable_trackback = $config->enable_trackback;
|
||||||
|
}
|
||||||
|
|
||||||
// 관리자가 금지하였을 경우에는 엮인글을 받지 않음
|
// 관리자가 금지하였을 경우에는 엮인글을 받지 않음
|
||||||
if($enable_trackback == 'N') return $this->stop('fail');
|
if($enable_trackback == 'N') return $this->stop('fail');
|
||||||
|
|
|
||||||
|
|
@ -88,11 +88,11 @@
|
||||||
function getTrackbackModuleConfig($module_srl) {
|
function getTrackbackModuleConfig($module_srl) {
|
||||||
// trackback 모듈의 config를 가져옴
|
// trackback 모듈의 config를 가져옴
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$trackback_config = $oModuleModel->getModuleConfig('trackback');
|
$module_trackback_config = $oModuleModel->getModulePartConfig('trackback', $module_srl);
|
||||||
|
|
||||||
$module_trackback_config = $trackback_config->module_config[$module_srl];
|
|
||||||
if(!$module_trackback_config->module_srl) {
|
if(!$module_trackback_config->module_srl) {
|
||||||
$module_trackback_config->module_srl = $module_srl;
|
$module_trackback_config->module_srl = $module_srl;
|
||||||
|
|
||||||
|
$trackback_config = $oModuleModel->getModuleConfig('trackback');
|
||||||
$module_trackback_config->enable_trackback = $trackback_config->enable_trackback=='Y'?'Y':'N';
|
$module_trackback_config->enable_trackback = $trackback_config->enable_trackback=='Y'?'Y':'N';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue