위젯 검출 정규 표현식을 수정

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2892 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-11-01 10:28:42 +00:00
parent f9896fe51a
commit 90aa62a6ac
993 changed files with 9190 additions and 10457 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<module version="0.1">
<module version="0.1" category="utility">
<title xml:lang="ko">문서</title>
<title xml:lang="en">Document</title>
<title xml:lang="es">Documento</title>

View file

@ -13,10 +13,16 @@
<action name="dispDocumentAdminList" type="view" admin_index="true" standalone="true" />
<action name="dispDocumentAdminConfig" type="view" standalone="true" />
<action name="dispDocumentAdminDeclared" type="view" standalone="true" />
<action name="dispDocumentAdminManageDocument" type="view" standalone="true"/>
<action name="procDocumentVoteUp" type="controller" standalone="true" />
<action name="procDocumentVoteDown" type="controller" standalone="true" />
<action name="procDocumentDeclare" type="controller" standalone="true" />
<action name="getDocumentCategories" type="model" standalone="true"/>
<action name="getDocumentMenu" type="model" standalone="true"/>
<action name="procDocumentAdminAddCart" type="controller" standalone="true" />
<action name="procDocumentAdminManageCheckedDocument" type="controller" standalone="true" />

View file

@ -156,8 +156,8 @@
// 카테고리가 변경되었으면 검사후 없는 카테고리면 0으로 세팅
if($source_category_srl != $category_srl) {
if($source_category_srl) $oDocumentController->updateCategoryCount($source_category_srl);
if($category_srl) $oDocumentController->updateCategoryCount($category_srl);
if($source_category_srl) $oDocumentController->updateCategoryCount($oDocument->get('module_srl'), $source_category_srl);
if($category_srl) $oDocumentController->updateCategoryCount($module_srl, $category_srl);
}
}
@ -197,7 +197,6 @@
$oDocumentModel = &getModel('document');
$oDocumentController = &getController('document');
$oFileController = &getController('file');
$oDB = &DB::getInstance();
$oDB->begin();
@ -223,6 +222,7 @@
$file_info = array();
$file_info['tmp_name'] = $val->uploaded_filename;
$file_info['name'] = $val->source_filename;
$oFileController = &getController('file');
$oFileController->insertFile($file_info, $module_srl, $obj->document_srl, 0, true);
}
}
@ -248,146 +248,6 @@
return $output;
}
/**
* @brief 카테고리 추가
**/
function insertCategory($module_srl, $title, $category_srl = 0) {
if(!$category_srl) $args->list_order = $args->category_srl = getNextSequence();
else $args->list_order = $args->category_srl = $category_srl;
$args->module_srl = $module_srl;
$args->title = $title;
$args->document_count = 0;
$output = executeQuery('document.insertCategory', $args);
if($output->toBool()) $output->add('category_srl', $args->category_srl);
return $output;
}
/**
* @brief 카테고리 정보 수정
**/
function updateCategory($args) {
return executeQuery('document.updateCategory', $args);
}
/**
* @brief 카테고리 삭제
**/
function deleteCategory($category_srl) {
$args->category_srl = $category_srl;
// 카테고리 정보를 삭제
$output = executeQuery('document.deleteCategory', $args);
if(!$output->toBool()) return $output;
// 현 카테고리 값을 가지는 문서들의 category_srl을 0 으로 세팅
unset($args);
$args->target_category_srl = 0;
$args->source_category_srl = $category_srl;
$output = executeQuery('document.updateDocumentCategory', $args);
return $output;
}
/**
* @brief 특정 모듈의 카테고리를 모두 삭제
**/
function deleteModuleCategory($module_srl) {
$args->module_srl = $module_srl;
$output = executeQuery('document.deleteModuleCategory', $args);
return $output;
}
/**
* @brief 카테고리를 상단으로 이동
**/
function moveCategoryUp($category_srl) {
$oDocumentModel = &getModel('document');
// 선택된 카테고리의 정보를 구한다
$args->category_srl = $category_srl;
$output = executeQuery('document.getCategory', $args);
$category = $output->data;
$list_order = $category->list_order;
$module_srl = $category->module_srl;
// 전체 카테고리 목록을 구한다
$category_list = $oDocumentModel->getCategoryList($module_srl);
$category_srl_list = array_keys($category_list);
if(count($category_srl_list)<2) return new Object();
$prev_category = NULL;
foreach($category_list as $key => $val) {
if($key==$category_srl) break;
$prev_category = $val;
}
// 이전 카테고리가 없으면 그냥 return
if(!$prev_category) return new Object(-1,Context::getLang('msg_category_not_moved'));
// 선택한 카테고리가 가장 위의 카테고리이면 그냥 return
if($category_srl_list[0]==$category_srl) return new Object(-1,Context::getLang('msg_category_not_moved'));
// 선택한 카테고리의 정보
$cur_args->category_srl = $category_srl;
$cur_args->list_order = $prev_category->list_order;
$cur_args->title = $category->title;
$this->updateCategory($cur_args);
// 대상 카테고리의 정보
$prev_args->category_srl = $prev_category->category_srl;
$prev_args->list_order = $list_order;
$prev_args->title = $prev_category->title;
$this->updateCategory($prev_args);
return new Object();
}
/**
* @brief 카테고리를 아래로 이동
**/
function moveCategoryDown($category_srl) {
$oDocumentModel = &getModel('document');
// 선택된 카테고리의 정보를 구한다
$args->category_srl = $category_srl;
$output = executeQuery('document.getCategory', $args);
$category = $output->data;
$list_order = $category->list_order;
$module_srl = $category->module_srl;
// 전체 카테고리 목록을 구한다
$category_list = $oDocumentModel->getCategoryList($module_srl);
$category_srl_list = array_keys($category_list);
if(count($category_srl_list)<2) return new Object();
for($i=0;$i<count($category_srl_list);$i++) {
if($category_srl_list[$i]==$category_srl) break;
}
$next_category_srl = $category_srl_list[$i+1];
if(!$category_list[$next_category_srl]) return new Object(-1,Context::getLang('msg_category_not_moved'));
$next_category = $category_list[$next_category_srl];
// 선택한 카테고리의 정보
$cur_args->category_srl = $category_srl;
$cur_args->list_order = $next_category->list_order;
$cur_args->title = $category->title;
$this->updateCategory($cur_args);
// 대상 카테고리의 정보
$next_args->category_srl = $next_category->category_srl;
$next_args->list_order = $list_order;
$next_args->title = $next_category->title;
$this->updateCategory($next_args);
return new Object();
}
/**
* @brief 문서 모듈의 기본설정 저장
**/

View file

@ -111,7 +111,7 @@
}
// 모듈의 목록을 가져옴
$args->select_module = "'board','blog'";
//$args->select_module = "'board','blog'";
$output = executeQuery('document.getAllModules', $args);
$module_list = $output->data;
@ -125,5 +125,43 @@
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('checked_list');
}
/**
* @brief 관리자 페이지의 신고 목록 보기
**/
function dispDocumentAdminDeclared() {
// 목록을 구하기 위한 옵션
$args->page = Context::get('page'); ///< 페이지
$args->list_count = 50; ///< 한페이지에 보여줄 글 수
$args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수
$args->sort_index = 'document_declared.declared_count'; ///< 소팅 값
$args->order_type = 'desc'; ///< 소팅 정렬 값
// 목록을 구함
$declared_output = executeQuery('document.getDeclaredList', $args);
if($declared_output->data && count($declared_output->data)) {
$document_list = array();
$oDocumentModel = &getModel('document');
foreach($declared_output->data as $key => $document) {
$document_list[$key] = new documentItem();
$document_list[$key]->setAttribute($document);
}
$declared_output->data = $document_list;
}
// 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅
Context::set('total_count', $declared_output->total_count);
Context::set('total_page', $declared_output->total_page);
Context::set('page', $declared_output->page);
Context::set('document_list', $declared_output->data);
Context::set('page_navigation', $declared_output->page_navigation);
// 템플릿 지정
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('declared_list');
}
}
?>

View file

@ -9,9 +9,6 @@
class document extends ModuleObject {
// 공지사항용 값
var $notice_list_order = -2100000000;
// 관리자페이지에서 사용할 검색 옵션
var $search_option = array('title','content','title_content','user_name',); ///< 검색 옵션
@ -24,6 +21,8 @@
$oModuleController->insertActionForward('document', 'view', 'dispDocumentAdminList');
$oModuleController->insertActionForward('document', 'view', 'dispDocumentPrint');
$oModuleController->insertActionForward('document', 'view', 'dispDocumentAdminConfig');
$oModuleController->insertActionForward('document', 'view', 'dispDocumentAdminManageDocument');
$oModuleController->insertActionForward('document', 'view', 'dispDocumentAdminDeclared');
$oDB = &DB::getInstance();
$oDB->addIndex("documents","idx_module_list_order", array("module_srl","list_order"));
@ -31,6 +30,10 @@
$oDB->addIndex("documents","idx_module_readed_count", array("module_srl","readed_count"));
$oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count"));
// 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가
$oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after');
return new Object();
}
@ -65,6 +68,19 @@
if(!$oModuleModel->getActionForward('dispDocumentAdminConfig')) return true;
if(!$oModuleModel->getActionForward('dispDocumentAdminManageDocument')) return true;
// 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가
if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) return true;
/**
* 2007. 10. 18 : 관리자 페이지의 신고된 목록 보기 action 추가
**/
if(!$oModuleModel->getActionForward('dispDocumentAdminDeclared')) return true;
// 2007. 10. 25 문서 분류에 parent_srl, expand를 추가
if(!$oDB->isColumnExists("document_categories","parent_srl")) return true;
if(!$oDB->isColumnExists("document_categories","expand")) return true;
if(!$oDB->isColumnExists("document_categories","group_srls")) return true;
return false;
}
@ -120,6 +136,21 @@
if(!$oModuleModel->getActionForward('dispDocumentAdminManageDocument'))
$oModuleController->insertActionForward('document', 'view', 'dispDocumentAdminManageDocument');
// 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가
if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'))
$oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after');
/**
* 2007. 10. 18 : 관리자 페이지의 신고된 목록 보기 action 추가
**/
if(!$oModuleModel->getActionForward('dispDocumentAdminDeclared'))
$oModuleController->insertActionForward('document', 'view', 'dispDocumentAdminDeclared');
// 2007. 10. 25 문서 분류에 parent_srl, expand를 추가
if(!$oDB->isColumnExists("document_categories","parent_srl")) $oDB->addColumn('document_categories',"parent_srl","number",12,0);
if(!$oDB->isColumnExists("document_categories","expand")) $oDB->addColumn('document_categories',"expand","char",1,"N");
if(!$oDB->isColumnExists("document_categories","group_srls")) $oDB->addColumn('document_categories',"group_srls","text");
return new Object(0,'success_updated');
}

View file

@ -13,6 +13,58 @@
function init() {
}
/**
* @breif 게시글의 추천을 처리하는 action (Up)
**/
function procDocumentVoteUp() {
$document_srl = Context::get('target_srl');
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
$point = 1;
return $this->updateVotedCount($document_srl, $point);
}
/**
* @breif 게시글의 추천을 처리하는 action (Down)
**/
function procDocumentVoteDown() {
$document_srl = Context::get('target_srl');
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
$point = -1;
return $this->updateVotedCount($document_srl, $point);
}
/**
* @brief 게시글이 신고될 경우 호출되는 action
**/
function procDocumentDeclare() {
$document_srl = Context::get('target_srl');
if(!$document_srl) return new Object(-1, 'msg_invalid_request');
return $this->declaredDocument($document_srl);
}
/**
* @brief 모듈이 삭제될때 등록된 모든 글을 삭제하는 trigger
**/
function triggerDeleteModuleDocuments(&$obj) {
$module_srl = $obj->module_srl;
if(!$module_srl) return new Object();
// document 삭제
$oDocumentAdminController = &getAdminController('document');
$output = $oDocumentAdminController->deleteModuleDocument($module_srl);
if(!$output->toBool()) return $output;
// category 삭제
$oDocumentController = &getController('document');
$output = $oDocumentController->deleteModuleCategory($module_srl);
if(!$output->toBool()) return $output;
return new Object();
}
/**
* @brief 문서의 권한 부여
* 세션값으로 접속상태에서만 사용 가능
@ -25,6 +77,9 @@
* @brief 문서 입력
**/
function insertDocument($obj, $manual_inserted = false) {
// trigger 호출 (before)
$output = ModuleHandler::triggerCall('document.insertDocument', 'before', $obj);
if(!$output->toBool()) return $output;
// begin transaction
$oDB = &DB::getInstance();
@ -38,26 +93,14 @@
if($obj->homepage && !eregi('^http:\/\/',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
if($obj->notify_message != "Y") $obj->notify_message = "N";
// 내용의 경우 javascript, iframe제거
$obj->content = removeHackTag($obj->content);
// 자동저장용 필드 제거
unset($obj->_saved_doc_srl);
unset($obj->_saved_doc_title);
unset($obj->_saved_doc_content);
unset($obj->_saved_doc_message);
// 문서 번호가 이미 있다면 첨부파일을 확인
if($obj->document_srl) {
// file의 Model객체 생성
$oFileModel = &getModel('file');
// 첨부 파일의 갯수를 구함
$obj->uploaded_count = $oFileModel->getFilesCount($obj->document_srl);
// 문서 번호가 없다면 문서 번호 할당
} else {
$obj->document_srl = getNextSequence();
}
// 주어진 문서 번호가 없으면 문서 번호 등록
if(!$obj->document_srl) $obj->document_srl = getNextSequence();
// 카테고리가 있나 검사하여 없는 카테고리면 0으로 세팅
if($obj->category_srl) {
@ -66,19 +109,15 @@
if(!$category_list[$obj->category_srl]) $obj->category_srl = 0;
}
// 태그 처리
$oTagController = &getController('tag');
$obj->tags = $oTagController->insertTag($obj->module_srl, $obj->document_srl, $obj->tags);
// 글 입력
// 조회수, 등록순서 설정
if(!$obj->readed_count) $obj->readed_count = 0;
$obj->update_order = $obj->list_order = $obj->document_srl * -1;
$obj->update_order = $obj->list_order = getNextSequence() * -1;
// 수동입력을 대비해서 비밀번호의 hash상태를 점검, 수동입력이 아니면 무조건 md5 hash
if($obj->password && !$obj->password_is_hashed) $obj->password = md5($obj->password);
// 공지사항일 경우 list_order에 무지막지한 값;;을 입력
if($obj->is_notice=='Y') $obj->list_order = $this->notice_list_order;
// 로그인 된 회원일 경우 회원의 정보를 입력
// 수동 등록이 아니고 로그인 된 회원일 경우 회원의 정보를 입력
if(Context::get('is_logged')&&!$manual_inserted) {
$logged_info = Context::get('logged_info');
$obj->member_srl = $logged_info->member_srl;
@ -89,32 +128,34 @@
$obj->homepage = $logged_info->homepage;
}
// 내용에서 제로보드XE만의 태그를 삭제
$obj->content = preg_replace('!<\!--(Before|After)Document\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
// 세션에서 최고 관리자가 아니면 iframe, script 제거
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
// DB에 입력
$output = executeQuery('document.insertDocument', $obj);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 성공하였을 경우 category_srl이 있으면 카테고리 update
if($obj->category_srl) $this->updateCategoryCount($obj->category_srl);
if($obj->category_srl) $this->updateCategoryCount($obj->module_srl, $obj->category_srl);
// 첨부 파일이 있었을 경우 해당 첨부파일들의 valid값을 Y로 변경
if($obj->uploaded_count) {
$oFileController = &getController('file');
$oFileController->setFilesValid($obj->document_srl);
// trigger 호출 (after)
if($output->toBool()) {
$trigger_output = ModuleHandler::triggerCall('document.insertDocument', 'after', $obj);
if(!$trigger_output->toBool()) {
$oDB->rollback();
return $trigger_output;
}
}
// commit
$oDB->commit();
// 자동 저장 문서 삭제
if(!$manual_inserted) {
$oEditorController = &getController('editor');
$oEditorController->deleteSavedDoc();
}
// return
$this->addGrant($obj->document_srl);
$output->add('document_srl',$obj->document_srl);
@ -126,6 +167,9 @@
* @brief 문서 수정
**/
function updateDocument($source_obj, $obj) {
// trigger 호출 (before)
$output = ModuleHandler::triggerCall('document.updateDocument', 'before', $obj);
if(!$output->toBool()) return $output;
// begin transaction
$oDB = &DB::getInstance();
@ -138,7 +182,6 @@
if($obj->allow_trackback!='Y') $obj->allow_trackback = 'N';
if($obj->homepage && !eregi('^http:\/\/',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage;
if($obj->notify_message != "Y") $obj->notify_message = "N";
$obj->content = removeHackTag($obj->content);
// 자동저장용 필드 제거
unset($obj->_saved_doc_srl);
@ -146,12 +189,6 @@
unset($obj->_saved_doc_content);
unset($obj->_saved_doc_message);
// file의 Model객체 생성
$oFileModel = &getModel('file');
// 첨부 파일의 갯수를 구함
$obj->uploaded_count = $oFileModel->getFilesCount($obj->document_srl);
// 카테고리가 변경되었으면 검사후 없는 카테고리면 0으로 세팅
if($source_obj->get('category_srl')!=$obj->category_srl) {
$oDocumentModel = &getModel('document');
@ -159,19 +196,10 @@
if(!$category_list[$obj->category_srl]) $obj->category_srl = 0;
}
// 태그 처리
if($source_obj->get('tags') != $obj->tags) {
$oTagController = &getController('tag');
$obj->tags = $oTagController->insertTag($obj->module_srl, $obj->document_srl, $obj->tags);
}
// 수정
// 수정 순서를 조절
$obj->update_order = getNextSequence() * -1;
// 공지사항일 경우 list_order에 무지막지한 값을, 그렇지 않으면 document_srl*-1값을
if($obj->is_notice=='Y') $obj->list_order = $this->notice_list_order;
else $obj->list_order = $obj->document_srl*-1;
// 비밀번호가 있으면 md5 hash
if($obj->password) $obj->password = md5($obj->password);
// 원본 작성인과 수정하려는 수정인이 동일할 시에 로그인 회원의 정보를 입력
@ -195,9 +223,14 @@
$obj->homepage = $source_obj->get('homepage');
}
// 내용에서 제로보드XE만의 태그를 삭제
$obj->content = preg_replace('!<\!--(Before|After)Document\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
// 세션에서 최고 관리자가 아니면 iframe, script 제거
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
// DB에 입력
$output = executeQuery('document.updateDocument', $obj);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
@ -205,20 +238,19 @@
// 성공하였을 경우 category_srl이 있으면 카테고리 update
if($source_obj->get('category_srl')!=$obj->category_srl) {
if($source_obj->get('category_srl')) $this->updateCategoryCount($source_obj->get('category_srl'));
if($obj->category_srl) $this->updateCategoryCount($obj->category_srl);
if($source_obj->get('category_srl')) $this->updateCategoryCount($obj->module_srl, $source_obj->get('category_srl'));
if($obj->category_srl) $this->updateCategoryCount($obj->module_srl, $obj->category_srl);
}
// 첨부 파일이 있었을 경우 해당 첨부파일들의 valid값을 Y로 변경
if($obj->uploaded_count) {
$oFileController = &getController('file');
$oFileController->setFilesValid($obj->document_srl);
// trigger 호출 (after)
if($output->toBool()) {
$trigger_output = ModuleHandler::triggerCall('document.updateDocument', 'after', $obj);
if(!$trigger_output->toBool()) {
$oDB->rollback();
return $trigger_output;
}
}
// 자동 저장 문서 삭제
$oEditorController = &getController('editor');
$oEditorController->deleteSavedDoc();
// commit
$oDB->commit();
@ -230,6 +262,10 @@
* @brief 문서 삭제
**/
function deleteDocument($document_srl, $is_admin = false) {
// trigger 호출 (before)
$trigger_obj->document_srl = $document_srl;
$output = ModuleHandler::triggerCall('document.deleteDocument', 'before', $trigger_obj);
if(!$output->toBool()) return $output;
// begin transaction
$oDB = &DB::getInstance();
@ -253,26 +289,21 @@
return $output;
}
// 댓글 삭제
$oCommentController = &getController('comment');
$output = $oCommentController->deleteComments($document_srl, $is_admin);
// 엮인글 삭제
$oTrackbackController = &getController('trackback');
$output = $oTrackbackController->deleteTrackbacks($document_srl, $is_admin);
// 태그 삭제
$oTagController = &getController('tag');
$oTagController->deleteTag($document_srl, $is_admin);
// 첨부 파일 삭제
if($oDocument->hasUploadedFiles()) {
$oFileController = &getController('file');
$oFileController->deleteFiles($document_srl);
}
// 카테고리가 있으면 카테고리 정보 변경
if($oDocument->get('category_srl')) $this->updateCategoryCount($oDocument->get('category_srl'));
if($oDocument->get('category_srl')) $this->updateCategoryCount($oDocument->get('module_srl'),$oDocument->get('category_srl'));
// 신고 삭제
executeQuery('document.deleteDeclared', $args);
// trigger 호출 (after)
if($output->toBool()) {
$trigger_obj = $oDocument->getObjectVars();
$trigger_output = ModuleHandler::triggerCall('document.deleteDocument', 'after', $trigger_obj);
if(!$trigger_output->toBool()) {
$oDB->rollback();
return $trigger_output;
}
}
// commit
$oDB->commit();
@ -332,7 +363,7 @@
/**
* @brief 해당 document의 추천수 증가
**/
function updateVotedCount($document_srl) {
function updateVotedCount($document_srl, $point = 1) {
// 세션 정보에 추천 정보가 있으면 중단
if($_SESSION['voted_document'][$document_srl]) return new Object(-1, 'failed_voted');
@ -375,6 +406,7 @@
}
// 추천수 업데이트
$args->voted_count = $oDocument->get('voted_count') + $point;
$output = executeQuery('document.updateVotedCount', $args);
// 로그 남기기
@ -388,13 +420,81 @@
}
/**
* @brief 해당 document의 댓글 증가
* @brief 게시글 신고
**/
function updateCommentCount($document_srl, $comment_count, $comment_inserted = false) {
function declaredDocument($document_srl) {
// 세션 정보에 신고 정보가 있으면 중단
if($_SESSION['declared_document'][$document_srl]) return new Object(-1, 'failed_declared');
// 이미 신고되었는지 검사
$args->document_srl = $document_srl;
$output = executeQuery('document.getDeclaredDocument', $args);
if(!$output->toBool()) return $output;
// 문서 원본을 가져옴
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl, false, false);
// 글의 작성 ip와 현재 접속자의 ip가 동일하면 패스
if($oDocument->get('ipaddress') == $_SERVER['REMOTE_ADDR']) {
$_SESSION['declared_document'][$document_srl] = true;
return new Object(-1, 'failed_declared');
}
// document의 작성자가 회원일때 조사
if($oDocument->get('member_srl')) {
// member model 객체 생성
$oMemberModel = &getModel('member');
$member_srl = $oMemberModel->getLoggedMemberSrl();
// 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 생각하고 세션 등록후 패스
if($member_srl && $member_srl == $oDocument->get('member_srl')) {
$_SESSION['declared_document'][$document_srl] = true;
return new Object(-1, 'failed_declared');
}
}
// 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단
if($member_srl) {
$args->member_srl = $member_srl;
} else {
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
}
$args->document_srl = $document_srl;
$output = executeQuery('document.getDocumentDeclaredLogInfo', $args);
// 로그 정보에 신고 로그가 있으면 세션 등록후 패스
if($output->data->count) {
$_SESSION['declared_document'][$document_srl] = true;
return new Object(-1, 'failed_declared');
}
// 신고글 추가
if($output->data->declared_count > 0) $output = executeQuery('document.updateDeclaredDocument', $args);
else $output = executeQuery('document.insertDeclaredDocument', $args);
if(!$output->toBool()) return $output;
// 로그 남기기
$output = executeQuery('document.insertDocumentDeclaredLog', $args);
// 세션 정보에 남김
$_SESSION['declared_document'][$document_srl] = true;
$this->setMessage('success_declared');
}
/**
* @brief 해당 document의 댓글 증가
* 댓글수를 증가시키면서 수정 순서와 수정일, 수정자를 등록
**/
function updateCommentCount($document_srl, $comment_count, $last_updater, $comment_inserted = false) {
$args->document_srl = $document_srl;
$args->comment_count = $comment_count;
if($comment_inserted) $args->update_order = -1*getNextSequence();
if($comment_inserted) {
$args->update_order = -1*getNextSequence();
$args->last_updater = $last_updater;
}
return executeQuery('document.updateCommentCount', $args);
}
@ -409,17 +509,156 @@
return executeQuery('document.updateTrackbackCount', $args);
}
/**
* @brief 카테고리 추가
**/
function insertCategory($obj) {
$obj->list_order = $obj->category_srl = getNextSequence();
$output = executeQuery('document.insertCategory', $obj);
if($output->toBool()) $output->add('category_srl', $obj->category_srl);
return $output;
}
/**
* @brief 카테고리에 문서의 숫자를 변경
**/
function updateCategoryCount($category_srl, $document_count = 0) {
function updateCategoryCount($module_srl, $category_srl, $document_count = 0) {
// document model 객체 생성
$oDocumentModel = &getModel('document');
if(!$document_count) $document_count = $oDocumentModel->getCategoryDocumentCount($category_srl);
$args->category_srl = $category_srl;
$args->document_count = $document_count;
return executeQuery('document.updateCategoryCount', $args);
$output = executeQuery('document.updateCategoryCount', $args);
if($output->toBool()) $this->makeCategoryXmlFile($module_srl);
return $output;
}
/**
* @brief 카테고리의 정보를 수정
**/
function updateCategory($obj) {
return executeQuery('document.updateCategory', $obj);
}
/**
/**
* @brief 카테고리 삭제
**/
function deleteCategory($category_srl) {
$args->category_srl = $category_srl;
// 카테고리 정보를 삭제
$output = executeQuery('document.deleteCategory', $args);
if(!$output->toBool()) return $output;
// 현 카테고리 값을 가지는 문서들의 category_srl을 0 으로 세팅
unset($args);
$args->target_category_srl = 0;
$args->source_category_srl = $category_srl;
$output = executeQuery('document.updateDocumentCategory', $args);
return $output;
}
/**
* @brief 특정 모듈의 카테고리를 모두 삭제
**/
function deleteModuleCategory($module_srl) {
$args->module_srl = $module_srl;
$output = executeQuery('document.deleteModuleCategory', $args);
return $output;
}
/**
* @brief 카테고리를 상단으로 이동
**/
function moveCategoryUp($category_srl) {
$oDocumentModel = &getModel('document');
// 선택된 카테고리의 정보를 구한다
$args->category_srl = $category_srl;
$output = executeQuery('document.getCategory', $args);
$category = $output->data;
$list_order = $category->list_order;
$module_srl = $category->module_srl;
// 전체 카테고리 목록을 구한다
$category_list = $oDocumentModel->getCategoryList($module_srl);
$category_srl_list = array_keys($category_list);
if(count($category_srl_list)<2) return new Object();
$prev_category = NULL;
foreach($category_list as $key => $val) {
if($key==$category_srl) break;
$prev_category = $val;
}
// 이전 카테고리가 없으면 그냥 return
if(!$prev_category) return new Object(-1,Context::getLang('msg_category_not_moved'));
// 선택한 카테고리가 가장 위의 카테고리이면 그냥 return
if($category_srl_list[0]==$category_srl) return new Object(-1,Context::getLang('msg_category_not_moved'));
// 선택한 카테고리의 정보
$cur_args->category_srl = $category_srl;
$cur_args->list_order = $prev_category->list_order;
$cur_args->title = $category->title;
$this->updateCategory($cur_args);
// 대상 카테고리의 정보
$prev_args->category_srl = $prev_category->category_srl;
$prev_args->list_order = $list_order;
$prev_args->title = $prev_category->title;
$this->updateCategory($prev_args);
return new Object();
}
/**
* @brief 카테고리를 아래로 이동
**/
function moveCategoryDown($category_srl) {
$oDocumentModel = &getModel('document');
// 선택된 카테고리의 정보를 구한다
$args->category_srl = $category_srl;
$output = executeQuery('document.getCategory', $args);
$category = $output->data;
$list_order = $category->list_order;
$module_srl = $category->module_srl;
// 전체 카테고리 목록을 구한다
$category_list = $oDocumentModel->getCategoryList($module_srl);
$category_srl_list = array_keys($category_list);
if(count($category_srl_list)<2) return new Object();
for($i=0;$i<count($category_srl_list);$i++) {
if($category_srl_list[$i]==$category_srl) break;
}
$next_category_srl = $category_srl_list[$i+1];
if(!$category_list[$next_category_srl]) return new Object(-1,Context::getLang('msg_category_not_moved'));
$next_category = $category_list[$next_category_srl];
// 선택한 카테고리의 정보
$cur_args->category_srl = $category_srl;
$cur_args->list_order = $next_category->list_order;
$cur_args->title = $category->title;
$this->updateCategory($cur_args);
// 대상 카테고리의 정보
$next_args->category_srl = $next_category->category_srl;
$next_args->list_order = $list_order;
$next_args->title = $next_category->title;
$this->updateCategory($next_args);
return new Object();
}
/**
@ -442,5 +681,101 @@
$js_code = "<script type=\"text/javascript\">//<![CDATA[\n".$js_code."\n//]]></script>";
Context::addHtmlHeader($js_code);
}
/**
* @brief 카테고리를 xml파일로 저장
**/
function makeCategoryXmlFile($module_srl) {
// xml파일 생성시 필요한 정보가 없으면 그냥 return
if(!$module_srl) return;
// 모듈 정보를 가져옴 (mid를 구하기 위해)
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
$mid = $module_info->mid;
if(!is_dir('./files/cache/document_category')) FileHandler::makeDir('./files/cache/document_category');
// 캐시 파일의 이름을 지정
$xml_file = sprintf("./files/cache/document_category/%s.xml.php", $module_srl);
// DB에서 module_srl 에 해당하는 카테고리 목록을 listorder순으로 구해옴
$oDocumentModel = &getModel('document');
$list = $oDocumentModel->getCategoryList($module_srl);
// 구해온 데이터가 없다면 노드데이터가 없는 xml 파일만 생성
if(!$list) {
$xml_buff = "<root />";
FileHandler::writeFile($xml_file, $xml_buff);
return $xml_file;
}
// 구해온 데이터가 하나라면 array로 바꾸어줌
if(!is_array($list)) $list = array($list);
// 루프를 돌면서 tree 구성
foreach($list as $category_srl => $node) {
$node->mid = $mid;
$parent_srl = (int)$node->parent_srl;
$tree[$parent_srl][$category_srl] = $node;
}
// 세션 디렉토리 변경 구문
$php_script = "";
if(!ini_get('session.auto_start')) {
if(!is_dir("./files/sessions")) {
FileHandler::makeDir("./files/sessions");
@chmod("./files/sessions", 0777);
}
$php_script = 'session_cache_limiter("no-cache, must-revalidate"); ini_set("session.gc_maxlifetime", "18000"); if(is_dir("../../sessions")) session_save_path("../../sessions/"); session_start();';
}
// xml 캐시 파일 생성
$xml_buff = sprintf('<?php %s header("Content-Type: text/xml; charset=UTF-8"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); @session_start(); ?><root>%s</root>', $php_script, $this->getXmlTree($tree[0], $tree));
// 파일 저장
FileHandler::writeFile($xml_file, $xml_buff);
return $xml_file;
}
/**
* @brief array로 정렬된 노드들을 parent_srl을 참조하면서 recursive하게 돌면서 xml 데이터 생성
* 메뉴 xml파일은 node라는 tag가 중첩으로 사용되며 xml doc으로 관리자 페이지에서 메뉴를 구성해줌\n
* (tree_menu.js 에서 xml파일을 바로 읽고 tree menu를 구현)
**/
function getXmlTree($source_node, $tree) {
if(!$source_node) return;
foreach($source_node as $category_srl => $node) {
$child_buff = "";
// 자식 노드의 데이터 가져옴
if($category_srl && $tree[$category_srl]) $child_buff = $this->getXmlTree($tree[$category_srl], $tree);
// 변수 정리
$title = str_replace(array('&','"','<','>'),array('&amp;','&quot;','&lt;','&gt;'),$node->title);
$expand = $node->expand;
$group_srls = $node->group_srls;
// node->group_srls값이 있으면
if($group_srls) $group_check_code = sprintf('($_SESSION["is_admin"]==true||(is_array($_SESSION["group_srls"])&&count(array_intersect($_SESSION["group_srls"], array(%s)))))',$group_srls);
else $group_check_code = "true";
$attribute = sprintf(
'node_srl="%s" text="<?=(%s?"%s":"")?>" url="%s" expand="%s" document_count="%d" ',
$category_srl,
$group_check_code,
$title,
getUrl('','mid',$node->mid,'category',$category_srl),
$expand,
$node->document_count
);
if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
else $buff .= sprintf('<node %s />', $attribute);
}
return $buff;
}
}
?>

View file

@ -169,17 +169,25 @@
function getNickName() {
return htmlspecialchars($this->get('nick_name'));
}
function getTitleText($cut_size = 0, $tail='...') {
return htmlspecialchars($this->getTitle($cut_size, $tail));
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
if($cut_size) $title = cut_str($this->get('title'), $cut_size, $tail);
else $title = $this->get('title');
return $title;
}
function getTitle($cut_size = 0, $tail='...') {
if($this->isSecret() && !$this->isGranted()) return Context::getLang('msg_is_secret');
$title = $this->getTitleText($cut_size, $tail);
if($cut_size) return cut_str($this->get('title'), $cut_size, $tail);
$attrs = array();
if($this->get('title_bold')=='Y') $attrs[] = "font-weight:bold;";
if($this->get('title_color')) $attrs[] = "color:#".$this->get('title_color');
return $this->get('title');
if(count($attrs)) return sprintf("<span style=\"%s\">%s</span>", implode(';',$attrs), htmlspecialchars($title));
else return htmlspecialchars($title);
}
function getContentText($strlen = 0) {
@ -206,14 +214,22 @@
// url에 대해서 정규표현식으로 치환
$content = preg_replace('!([^>^"^\'^=])(http|https|ftp|mms):\/\/([^ ^<^"^\']*)!is','$1<a href="$2://$3" onclick="window.open(this.href);return false;">$2://$3</a>',' '.$content);
if($add_document_info) return sprintf('<!--BeforeDocument(%d,%d)-->%s<!--AfterDocument(%d,%d)-->', $this->document_srl, $this->get('member_srl'), $content, $this->document_srl, $this->get('member_srl'));
if(!$add_document_info) return $content;
$content = sprintf(
'<!--BeforeDocument(%d,%d)--><div class="document_%d_%d">%s</div><div class="document_popup_menu"><span class="document_popup_menu document_%d">%s</span></div><!--AfterDocument(%d,%d)-->',
$this->document_srl, $this->get('member_srl'),
$this->document_srl, $this->get('member_srl'),
$content,
$this->document_srl, Context::getLang('cmd_document_do'),
$this->document_srl, $this->get('member_srl'),
$this->document_srl, $this->get('member_srl')
);
return $content;
}
function getSummary($str_size = 50) {
$content = htmlspecialchars(strip_tags(str_replace("&nbsp;"," ",$this->getContent())));
$content = htmlspecialchars(strip_tags(str_replace("&nbsp;"," ",$this->getContent(false))));
return cut_str($content, $str_size, '...');
}
@ -294,7 +310,8 @@
if(!$this->isGranted() && $this->isSecret()) return;
$oCommentModel = &getModel('comment');
return $oCommentModel->getCommentList($this->document_srl, $is_admin);
$output = $oCommentModel->getCommentList($this->document_srl, $is_admin);
return $output;
}
function getTrackbackCount() {
@ -315,14 +332,21 @@
function getThumbnail($width = 80, $height = 0, $thumbnail_type = '') {
if(!$height) $height = $width;
// 문서 모듈의 기본 설정에서 Thumbnail의 생성 방법을 구함
if(!in_array($thumbnail_type, array('crop','ratio'))) {
$oDocumentModel = &getModel('document');
$config = $oDocumentModel->getDocumentConfig();
$thumbnail_type = $config->thumbnail_type;
}
// 문서의 이미지 첨부파일 위치를 구함
$document_path = sprintf('./files/attach/images/%d/%d/',$this->get('module_srl'), $this->get('document_srl'));
if(!is_dir($document_path)) FileHandler::makeDir($document_path);
// 썸네일 임시 파일명을 구함
if($width != $height) $thumbnail_file = sprintf('%sthumbnail_%dx%d.jpg', $document_path, $width, $height);
else $thumbnail_file = sprintf('%sthumbnail_%d.jpg', $document_path, $width);
if($width != $height) $thumbnail_file = sprintf('%sthumbnail_%dx%d_%s.jpg', $document_path, $width, $height, $thumbnail_type);
else $thumbnail_file = sprintf('%sthumbnail_%d_%s.jpg', $document_path, $width, $thumbnail_type);
// 썸네일이 있더라도 글의 수정시간과 비교해서 다르면 다시 생성함
if(file_exists($thumbnail_file)) {
@ -336,13 +360,6 @@
// 썸네일 파일이 있으면 url return
if(file_exists($thumbnail_file)) return Context::getRequestUri().$thumbnail_file;
// 문서 모듈의 기본 설정에서 Thumbnail의 생성 방법을 구함
if(!in_array($thumbnail_type, array('crop','ratio'))) {
$oDocumentModel = &getModel('document');
$config = $oDocumentModel->getDocumentConfig();
$thumbnail_type = $config->thumbnail_type;
}
// 생성 시작
FileHandler::writeFile($thumbnail_file, '', 'w');

View file

@ -23,13 +23,68 @@
/**
* @brief 문서 가져오기
**/
function getDocument($document_srl, $is_admin = false) {
function getDocument($document_srl=0, $is_admin = false) {
$oDocument = new documentItem($document_srl);
if($is_admin) $oDocument->setGrant();
return $oDocument;
}
/**
* @brief 선택된 게시물의 팝업메뉴 표시
*
* 인쇄, 스크랩, 추천, 비추천, 신고 기능 추가
**/
function getDocumentMenu() {
// 요청된 게시물 번호와 현재 로그인 정보 구함
$document_srl = Context::get('target_srl');
$mid = Context::get('cur_mid');
$logged_info = Context::get('logged_info');
$act = Context::get('cur_act');
// menu_list 에 "표시할글,target,url" 을 배열로 넣는다
$menu_list = array();
// trigger 호출
ModuleHandler::triggerCall('document.getDocumentMenu', 'before', $menu_list);
// 인쇄 버튼 추가
$menu_str = Context::getLang('cmd_print');
$menu_link = sprintf("%s?document_srl=%s&act=dispDocumentPrint",Context::getRequestUri(),$document_srl);
$menu_list[] = sprintf("\n%s,%s,winopen('%s','MemberModifyInfo')", '' ,$menu_str, $menu_link);
// 추천 버튼 추가
$menu_str = Context::getLang('cmd_vote');
$menu_link = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
// 비추천 버튼 추가
$menu_str = Context::getLang('cmd_vote_down');
$menu_link = sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
// 신고 기능 추가
$menu_str = Context::getLang('cmd_declare');
$menu_link = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl);
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
// 회원이어야만 가능한 기능
if($logged_info->member_srl) {
// 스크랩 버튼 추가
$menu_str = Context::getLang('cmd_scrap');
$menu_link = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl);
$menu_list[] = sprintf("\n%s,%s,%s", '', $menu_str, $menu_link);
}
// trigger 호출 (after)
ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list);
// 정보를 저장
$this->add("menu_list", implode("\n",$menu_list));
}
/**
* @brief 여러개의 문서들을 가져옴 (페이징 아님)
**/
@ -59,7 +114,7 @@
/**
* @brief module_srl값을 가지는 문서의 목록을 가져옴
**/
function getDocumentList($obj) {
function getDocumentList($obj, $except_notice = false) {
// 정렬 대상과 순서 체크
if(!in_array($obj->sort_index, array('list_order','regdate','last_update','update_order','readed_count','voted_count'))) $obj->sort_index = 'list_order';
if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc';
@ -84,6 +139,7 @@
$args->page_count = $obj->page_count?$obj->page_count:10;
$args->start_date = $obj->start_date?$obj->start_date:null;
$args->end_date = $obj->end_date?$obj->end_date:null;
if($except_notice) $args->s_is_notice = 'N';
$query_id = 'document.getDocumentList';
@ -165,6 +221,11 @@
case 'ipaddress' :
$args->s_ipaddress= $search_keyword;
break;
case 'comment' :
$args->s_comment = $search_keyword;
$args->sort_index = 'documents.'.$args->sort_index;
$query_id = 'document.getDocumentListWithinComment';
break;
default :
preg_match('/^extra_vars([0-9]+)$/',$search_target,$matches);
if($matches[1]) {
@ -175,7 +236,7 @@
}
// document.getDocumentList 쿼리 실행
$output = executeQuery($query_id, $args);
$output = executeQueryArray($query_id, $args);
// 결과가 없거나 오류 발생시 그냥 return
if(!$output->toBool()||!count($output->data)) return $output;
@ -194,6 +255,33 @@
return $output;
}
/**
* @brief module_srl값을 가지는 문서의 공지사항만 가져옴
**/
function getNoticeList($obj) {
$args->module_srl = $obj->module_srl;
$args->category_srl = $obj->category_srl;
$args->sort_index = 'list_order';
$args->order_type = 'asc';
$output = executeQueryArray('document.getNoticeList', $args);
// 결과가 없거나 오류 발생시 그냥 return
if(!$output->toBool()||!count($output->data)) return $output;
foreach($output->data as $key => $attribute) {
$document_srl = $attribute->document_srl;
$oDocument = null;
$oDocument = new documentItem();
$oDocument->setAttribute($attribute);
$output->data[$key] = $oDocument;
}
return $output;
}
/**
* @brief module_srl에 해당하는 문서의 전체 갯수를 가져옴
**/
@ -235,7 +323,20 @@
function getCategory($category_srl) {
$args->category_srl = $category_srl;
$output = executeQuery('document.getCategory', $args);
return $output->data;
$node = $output->data;
if($node->group_srls) $node->group_srls = explode(',',$node->group_srls);
else $node->group_srls = array();
return $node;
}
/**
* @brief 특정 카테고리에 child가 있는지 체크
**/
function getCategoryChlidCount($category_srl) {
$output = executeQuery('document.getChildCategoryCount');
if($output->data->count > 0) return true;
return false;
}
/**
@ -268,6 +369,18 @@
return (int)$output->data->count;
}
/**
* @brief 문서 category정보의 xml 캐시 파일을 return
**/
function getCategoryXmlFile($module_srl) {
$xml_file = sprintf('files/cache/document_category/%s.xml.php',$module_srl);
if(!file_exists($xml_file)) {
$oDocumentController = &getController('document');
$oDocumentController->makeCategoryXmlFile($module_srl);
}
return $xml_file;
}
/**
* @brief 월별 보관현황을 가져옴
**/

View file

@ -11,9 +11,12 @@
$lang->thumbnail_ratio = 'Ratio';
$lang->cmd_delete_all_thumbnail = 'Delete all thumbnails';
$lang->move_target_module = "Target module for changing position";
$lang->title_bold = '제목 굵게';
$lang->title_color = '제목 색깔';
$lang->cmd_toggle_checked_document = '선택항목 반전';
$lang->cmd_toggle_checked_document = 'Reverse selected items';
$lang->cmd_delete_checked_document = 'Delete selected';
$lang->cmd_document_do = '이 게시물을..';
$lang->msg_cart_is_null = 'Select the articles you wish to delete';
$lang->msg_category_not_moved = 'Unabled to move';

View file

@ -11,9 +11,12 @@
$lang->thumbnail_ratio = 'Ratio';
$lang->cmd_delete_all_thumbnail = 'Delete all thumbnails';
$lang->move_target_module = "Módulo para cambiar de posición";
$lang->title_bold = '제목 굵게';
$lang->title_color = '제목 색깔';
$lang->cmd_toggle_checked_document = '선택항목 반전';
$lang->cmd_delete_checked_document = 'Eliminar lo seleccionado';
$lang->cmd_document_do = '이 게시물을..';
$lang->msg_cart_is_null = 'Selecciona el documento que desea eliminar';
$lang->msg_category_not_moved = 'No puede se movido';

View file

@ -11,9 +11,12 @@
$lang->thumbnail_ratio = 'Ratio';
$lang->cmd_delete_all_thumbnail = 'Delete all thumbnails';
$lang->move_target_module = "移動対象モジュール";
$lang->title_bold = '제목 굵게';
$lang->title_color = '제목 색깔';
$lang->cmd_toggle_checked_document = '선택항목 반전';
$lang->cmd_delete_checked_document = '選択項目削除';
$lang->cmd_document_do = '이 게시물을..';
$lang->msg_cart_is_null = '削除する書き込みを選択してください。';
$lang->msg_category_not_moved = '移動することができません。';

View file

@ -10,9 +10,12 @@
$lang->thumbnail_crop = '잘라내기 (정해진 크기에 꽉 찬 모습의 썸네일을 만듭니다)';
$lang->thumbnail_ratio = '비율 맞추기 (원본 이미지의 비율에 맞춥니다. 다만 정해진 크기에 여백이 생깁니다)';
$lang->cmd_delete_all_thumbnail = '썸네일 모두 삭제';
$lang->title_bold = '제목 굵게';
$lang->title_color = '제목 색깔';
$lang->cmd_toggle_checked_document = '선택항목 반전';
$lang->cmd_delete_checked_document = '선택항목 삭제';
$lang->cmd_document_do = '이 게시물을..';
$lang->msg_cart_is_null = '삭제할 글을 선택해주세요';
$lang->msg_category_not_moved = '이동할 수가 없습니다';

View file

@ -11,9 +11,12 @@
$lang->thumbnail_ratio = '比例';
$lang->cmd_delete_all_thumbnail = '删除全部缩略图';
$lang->move_target_module = "移动目标模块";
$lang->title_bold = '제목 굵게';
$lang->title_color = '제목 색깔';
$lang->cmd_toggle_checked_document = '反选';
$lang->cmd_delete_checked_document = '删除所选';
$lang->cmd_document_do = '이 게시물을..';
$lang->msg_cart_is_null = '请选择要删除的文章。';
$lang->msg_category_not_moved = '不能移动!';

View file

@ -0,0 +1,8 @@
<query id="deleteDeclared" action="delete">
<tables>
<table name="document_declared" />
</tables>
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="getChildCategoryCount" action="select">
<tables>
<table name="document_categories" />
</tables>
<columns>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="equal" column="parent_srl" var="category_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,8 @@
<query id="getDeclaredDocument" action="select">
<tables>
<table name="document_declared" />
</tables>
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -0,0 +1,18 @@
<query id="getDeclaredList" action="select">
<tables>
<table name="documents" alias="documents"/>
<table name="document_declared" alias="document_declared"/>
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="in" column="documents.document_srl" default="document_declared.document_srl" />
</conditions>
<navigation>
<index var="sort_index" default="document_declared.declared_count" order="order_type" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>

View file

@ -0,0 +1,15 @@
<query id="getDocumentDeclaredLogInfo" action="select">
<tables>
<table name="document_declared_log" />
</tables>
<columns>
<column name="count(*)" alias="count" />
</columns>
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
<group pipe="and">
<condition operation="equal" column="member_srl" var="member_srl" filter="number" pipe="and" />
<condition operation="equal" column="ipaddress" var="ipaddress" pipe="and" />
</group>
</conditions>
</query>

View file

@ -17,7 +17,6 @@
<condition operation="like" column="email_address" var="s_email_addres" pipe="or" />
<condition operation="like" column="homepage" var="s_homepage" pipe="or" />
<condition operation="like" column="tags" var="s_tags" pipe="or" />
<condition operation="equal" column="is_notice" var="s_is_notice" pipe="or" />
<condition operation="equal" column="is_secret" var="s_is_secret" pipe="or" />
<condition operation="equal" column="member_srl" var="s_member_srl" pipe="or" />
<condition operation="more" column="readed_count" var="s_readed_count" pipe="or" />
@ -49,6 +48,7 @@
<condition operation="like" column="extra_vars19" var="s_extra_vars19" pipe="or" />
<condition operation="like" column="extra_vars20" var="s_extra_vars20" pipe="or" />
</group>
<condition operation="equal" column="is_notice" var="s_is_notice" pipe="and" />
<group pipe="and">
<condition operation="more" column="last_update" var="start_date" pipe="and" />
<condition operation="less" column="last_update" var="end_date" pipe="and" />

View file

@ -0,0 +1,22 @@
<query id="getDocumentListWithinMember" action="select">
<tables>
<table name="documents" alias="documents" />
<table name="comments" alias="comments"/>
</tables>
<columns>
<column name="documents.*" />
</columns>
<conditions>
<condition operation="equal" column="documents.document_srl" default="comments.document_srl" notnull="notnull" />
<condition operation="like" column="comments.content" var="s_comment" notnull="notnull" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="comments.list_order" order="asc" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
<groups>
<group column="documents.document_srl" />
</groups>
</query>

View file

@ -0,0 +1,16 @@
<query id="getNoticeList" action="select">
<tables>
<table name="documents" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="in" column="module_srl" var="module_srl" filter="number" />
<condition operation="equal" column="is_notice" default="Y" pipe="and" />
<condition operation="equal" column="category_srl" var="category_srl" pipe="and" />
</conditions>
<navigation>
<index var="sort_index" default="list_order" order="order_type" />
</navigation>
</query>

View file

@ -8,6 +8,9 @@
<column name="title" var="title" notnull="notnull" minlength="2" maxlength="250" />
<column name="document_count" var="document_count" default="0" />
<column name="regdate" var="regdate" default="curdate()" />
<column name="expand" var="expand" />
<column name="parent_srl" var="parent_srl" filter="number" default="0" />
<column name="group_srls" var="group_srls" />
<column name="last_update" var="last_update" default="curdate()" />
<column name="list_order" var="list_order" default="0" />
</columns>

View file

@ -0,0 +1,9 @@
<query id="insertDeclaredDocument" action="insert">
<tables>
<table name="document_declared" />
</tables>
<columns>
<column name="document_srl" var="document_srl" filter="number" notnull="notnull" />
<column name="declared_count" default="1" />
</columns>
</query>

View file

@ -9,6 +9,8 @@
<column name="is_notice" var="is_notice" notnull="notnull" default="N" />
<column name="is_secret" var="is_secret" notnull="notnull" default="N" />
<column name="title" var="title" notnull="notnull" minlength="1" maxlength="250" />
<column name="title_bold" var="title_bold" default="N" />
<column name="title_color" var="title_color" default="N" />
<column name="content" var="content" notnull="notnull" />
<column name="readed_count" var="readed_count" default="0" />
<column name="voted_count" var="voted_count" default="0" />

View file

@ -0,0 +1,11 @@
<query id="insertDocumentDeclaredLog" action="insert">
<tables>
<table name="document_declared_log" />
</tables>
<columns>
<column name="document_srl" var="document_srl" filter="number" default="0" notnull="notnull" />
<column name="member_srl" var="member_srl" filter="number" default="0" />
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
<column name="regdate" var="regdate" default="curdate()" />
</columns>
</query>

View file

@ -6,6 +6,9 @@
<column name="title" var="title" />
<column name="list_order" var="list_order" />
<column name="last_update" var="last_update" default="curdate()" />
<column name="expand" var="expand" />
<column name="parent_srl" var="parent_srl" filter="number" />
<column name="group_srls" var="group_srls" />
</columns>
<conditions>
<condition operation="equal" column="category_srl" var="category_srl" filter="number" notnull="notnull" />

View file

@ -5,6 +5,8 @@
<columns>
<column name="comment_count" var="comment_count" notnull="notnull" />
<column name="update_order" var="update_order" />
<column name="last_update" var="last_update" default="curdate()" />
<column name="last_updater" var="last_updater" />
</columns>
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />

View file

@ -0,0 +1,11 @@
<query id="updateDeclaredDocument" action="update">
<tables>
<table name="document_declared" />
</tables>
<columns>
<column name="declared_count" default="plus(1)" />
</columns>
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -8,6 +8,8 @@
<column name="is_notice" var="is_notice" notnull="notnull" default="N" />
<column name="is_secret" var="is_secret" notnull="notnull" default="N" />
<column name="title" var="title" notnull="notnull" minlength="2" maxlength="250" />
<column name="title_bold" var="title_bold" default="N" />
<column name="title_color" var="title_color" default="N" />
<column name="content" var="content" notnull="notnull" />
<column name="uploaded_count" var="uploaded_count" default="0" />
<column name="password" var="password" minlength="2" maxlength="60" />

View file

@ -3,7 +3,7 @@
<table name="documents" />
</tables>
<columns>
<column name="voted_count" var="voted_count" default="plus(1)" />
<column name="voted_count" var="voted_count" notnull="notnull" />
</columns>
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />

View file

@ -1,9 +1,12 @@
<table name="document_categories">
<column name="category_srl" type="number" size="11" default="0" notnull="notnull" primary_key="primary_key" />
<column name="module_srl" type="number" size="11" default="0" notnull="notnull" index="idx_module_srl" />
<column name="parent_srl" type="number" size="12" notnull="notnull" default="0" />
<column name="title" type="varchar" size="250" />
<column name="expand" type="char" size="1" default="N" />
<column name="document_count" type="number" size="11" default="0" notnull="notnull" />
<column name="regdate" type="date" index="idx_regdate" />
<column name="last_update" type="date" />
<column name="list_order" type="number" size="11" notnull="notnull" />
<column name="group_srls" type="text" />
</table>

View file

@ -0,0 +1,4 @@
<table name="document_declared">
<column name="document_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
<column name="declared_count" type="number" size="11" default="0" notnull="notnull" index="idx_declared_count" />
</table>

View file

@ -0,0 +1,6 @@
<table name="document_declared_log">
<column name="document_srl" type="number" size="11" notnull="notnull" index="idx_document_srl" />
<column name="member_srl" type="number" size="11" notnull="notnull" index="idx_member_srl" />
<column name="ipaddress" type="varchar" size="128" notnull="notnull" index="idx_ipaddress"/>
<column name="regdate" type="date" index="idx_regdate" />
</table>

View file

@ -10,7 +10,7 @@
<input type="hidden" name="type" value="" />
<div id="popBody">
<table cellspacing="0" class="tableType5">
<table cellspacing="0" class="adminTable">
<col width="150" />
<col />
<tr>
@ -20,7 +20,7 @@
<input type="checkbox" onclick="checkboxSelectAll(this.form, 'cart'); return false;" /> {$lang->cmd_select}
<ul class="document_list_box">
<!--@foreach($document_list as $key => $document)-->
<li class="document_list"><input type="checkbox" checked="checked" name="cart" value="{$document->document_srl}" onclick="doAddDocumentCart(this);"/> <address>{$document->getNickName()}</address> <span class="document_title">{$document->getTitle()}</li>
<li class="document_list"><input type="checkbox" checked="checked" name="cart" value="{$document->document_srl}" onclick="doAddDocumentCart(this);"/> <address>{$document->getNickName()}</address> <span class="document_title">{$document->getTitle()}</span></li>
<!--@end-->
</ul>
<!--@else-->

View file

@ -0,0 +1,80 @@
<!--%import("filter/delete_checked.xml")-->
<!--%import("filter/manage_checked_document.xml")-->
<!--#include("header.html")-->
<!-- 정보 -->
<div class="tableSummaryType1">
Total <strong>{number_format($total_count)}</strong>, Page <strong>{number_format($page)}</strong>/{number_format($total_page)}
</div>
<form id="fo_list" action="./" method="get" onsubmit="return procFilter(this, delete_checked)">
<input type="hidden" name="page" value="{$page}" />
<!-- 목록 -->
<table cellspacing="0" class="adminTable">
<col width="60" />
<col width="40" />
<col />
<col width="120" />
<col width="60" />
<col width="60" />
<col width="60" />
<col width="80" />
<thead>
<tr>
<th scope="col">{$lang->no}</th>
<th scope="col"><input type="checkbox" onclick="checkboxSelectAll(this.form, 'cart'); return false;" /></th>
<th scope="col">{$lang->title}</th>
<th scope="col">{$lang->user_name}</th>
<th scope="col">{$lang->cmd_declare}</th>
<th scope="col">{$lang->readed_count}</th>
<th scope="col">{$lang->voted_count}</th>
<th scope="col">{$lang->date}</th>
</tr>
</thead>
<tbody>
<!--@foreach($document_list as $no => $oDocument)-->
<tr>
<td class="tahoma">{$no}</td>
<td><input type="checkbox" name="cart" value="{$oDocument->document_srl}" onclick="doAddDocumentCart(this)" <!--@if($oDocument->isCarted())-->checked="checked"<!--@end-->/></td>
<td class="left subject">
<a href="{getUrl('','document_srl',$oDocument->document_srl)}" onclick="window.open(this.href);return false">{$oDocument->getTitleText()}</a>
<!--@if($oDocument->getCommentCount())-->
[{$oDocument->getCommentCount()}]
<!--@end-->
<!--@if($oDocument->getTrackbackCount())-->
[{$oDocument->getTrackbackCount()}]
<!--@end-->
</td>
<td class="left"><div class="member_{$oDocument->get('member_srl')}">{$oDocument->getNickName()}</div></td>
<td class="tahoma red"><strong>{$oDocument->get('declared_count')}</strong></td>
<td class="tahoma">{$oDocument->get('readed_count')}</td>
<td class="tahoma">{$oDocument->get('voted_count')}</td>
<td class="tahoma">{$oDocument->getRegdate("Y-m-d")}</td>
</tr>
<!--@end-->
</tbody>
</table>
<!-- 버튼 -->
<div class="fr gap1">
<a href="{getUrl('','module','document','act','dispDocumentAdminManageDocument')}" onclick="popopen(this.href,'manageDocument'); return false;" class="button"><span>{$lang->cmd_manage_document}</span></a>
</div>
</form>
<!-- 페이지 네비게이션 -->
<div class="pageNavigation">
<a href="{getUrl('page','','module_srl','')}" class="goToFirst"><img src="../../admin/tpl/images/bottomGotoFirst.gif" alt="{$lang->first_page}" width="7" height="5" /></a>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
<span class="current">{$page_no}</span>
<!--@else-->
<a href="{getUrl('page',$page_no,'module_srl','')}">{$page_no}</a>
<!--@end-->
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'module_srl','')}" class="goToLast"><img src="../../admin/tpl/images/bottomGotoLast.gif" alt="{$lang->last_page}" width="7" height="5" /></a>
</div>

View file

@ -2,7 +2,7 @@
<!--%import("filter/insert_config.xml")-->
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
<table cellspacing="0" class="tableType2 gap1">
<table cellspacing="0" class="adminTable">
<col width="200" />
<col />
<tr>

View file

@ -12,12 +12,13 @@
<input type="hidden" name="page" value="{$page}" />
<!-- 목록 -->
<table cellspacing="0" class="tableType1">
<table cellspacing="0" class="adminTable">
<col width="60" />
<col width="20" />
<col width="35" />
<col />
<col width="120" />
<col width="60" />
<col width="60" />
<col width="80" />
<thead>
<tr>
@ -25,12 +26,13 @@
<th scope="col"><input type="checkbox" onclick="checkboxSelectAll(this.form, 'cart'); return false;" /></th>
<th scope="col">
<div class="nowrap">
<select name="module_srl" class="mid_list" id="module_srl">
<select name="module_srl" id="module_srl">
<option value="">{$lang->module}</option>
<!--@foreach($mid_list as $key => $val)-->
<option value="{$val->module_srl}" <!--@if($module_srl == $val->module_srl)-->selected="selected"<!--@end-->>{$val->browser_title}</option>
<!--@end-->
</select><a href="#" onclick="location.href=current_url.setQuery('module_srl',xGetElementById('module_srl').options[xGetElementById('module_srl').selectedIndex].value);return false;" class="button"><span>GO</span></a>
</select>
<input type="button" name="go_button" id="go_button" value="GO" class="buttonTypeGo" onclick="location.href=current_url.setQuery('module_srl',xGetElementById('module_srl').options[xGetElementById('module_srl').selectedIndex].value);return false;"/>
</div>
</th>
<th scope="col">{$lang->user_name}</th>
@ -46,7 +48,7 @@
<td><input type="checkbox" name="cart" value="{$oDocument->document_srl}" onclick="doAddDocumentCart(this)" <!--@if($oDocument->isCarted())-->checked="checked"<!--@end-->/></td>
<td class="left subject">
<a href="{getUrl('','mid',$module_list[$oDocument->get('module_srl')]->mid)}" class="blue" onclick="window.open(this.href);return false">[{htmlspecialchars($module_list[$oDocument->get('module_srl')]->browser_title)}]</a><br />
<a href="{getUrl('','document_srl',$oDocument->document_srl)}" onclick="window.open(this.href);return false">{$oDocument->getTitleText()}</a>
<a href="{getUrl('','document_srl',$oDocument->document_srl)}" onclick="window.open(this.href);return false">{$oDocument->getTitle()}</a>
<!--@if($oDocument->getCommentCount())-->
[{$oDocument->getCommentCount()}]

View file

@ -2,9 +2,10 @@
<h3>{$lang->document} <span class="gray">{$lang->cmd_management}</span></h3>
<div class="header4">
<div class="header4 gap1">
<ul class="localNavigation">
<li <!--@if($act=='dispDocumentAdminList')-->class="on"<!--@end-->><a href="{getUrl('act','dispDocumentAdminList')}">{$lang->document_list}</a></li>
<li <!--@if($act=='dispDocumentAdminConfig')-->class="on"<!--@end-->><a href="{getUrl('act','dispDocumentAdminConfig')}">{$lang->cmd_module_config}</a></li>
<li <!--@if($act=='dispDocumentAdminDeclared')-->class="on"<!--@end-->><a href="{getUrl('act','dispDocumentAdminDeclared')}">{$lang->cmd_declared_list}</a></li>
</ul>
</div>

View file

@ -8,7 +8,7 @@
<div class="clear"></div>
<div class="gap1">{$oDocument->getContent()}</div>
<div class="gap1">{$oDocument->getContent(false)}</div>
<script type="text/javascript">//<![CDATA[