mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-08 19:21:40 +09:00
XE의 문서 다국어 기능 지원.
- 글작성시 작성당시 작성자의 언어코드가 문서의 기본 언어로 문서 저장됨 - 글 수정시 글 수정 당시 수정자의 언어코드가 기본 언어와 다르면 원글을 수정하는 것이 아니라 새로운 언어코드로 등록됨 - 글을 볼때 보는 사용자의 언어코드에 따라서 같은 언어코드 > 원문서 기본 언어 > 기타 로 보여짐 - 즉 하나의 글에 대해서 여러 언어코드가 지원이 되는 구조임 - 제목/ 내용/ 확장변수 모두 적용 git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5808 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c7af0de65e
commit
02b8e5684f
15 changed files with 249 additions and 133 deletions
|
|
@ -92,6 +92,10 @@
|
|||
|
||||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true;
|
||||
|
||||
// 2009. 03. 09 documents에 lang_code 컬럼 추가
|
||||
if(!$oDB->isColumnExists("documents","lang_code")) return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -176,6 +180,13 @@
|
|||
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'))
|
||||
$oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before');
|
||||
|
||||
// 2009. 03. 09 documents에 lang_code 컬럼 추가
|
||||
if(!$oDB->isColumnExists("documents","lang_code")) {
|
||||
$db_info = Context::getDBInfo();
|
||||
$oDB->addColumn('documents',"lang_code","varchar",10, $db_info->lang_code);
|
||||
$obj->lang_code = $db_info->lang_type;
|
||||
executeQuery('document.updateDocumentsLangCode', $obj);
|
||||
}
|
||||
|
||||
return new Object(0,'success_updated');
|
||||
|
||||
|
|
|
|||
|
|
@ -192,6 +192,8 @@
|
|||
// 로그인정보가 없고 사용자 이름이 없으면 오류 표시
|
||||
if(!$logged_info->member_srl && !$obj->nick_name) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
$obj->lang_code = Context::getLangType();
|
||||
|
||||
// DB에 입력
|
||||
$output = executeQuery('document.insertDocument', $obj);
|
||||
if(!$output->toBool()) {
|
||||
|
|
@ -254,13 +256,11 @@
|
|||
if(!isset($document_config->use_history)) $document_config->use_history = 'N';
|
||||
$bUseHistory = $document_config->use_history == 'Y' || $document_config->use_history == 'Trace';
|
||||
|
||||
if($bUseHistory)
|
||||
{
|
||||
if($bUseHistory) {
|
||||
$args->history_srl = getNextSequence();
|
||||
$args->document_srl = $obj->document_srl;
|
||||
$args->module_srl = $module_srl;
|
||||
if($document_config->use_history == 'Y')
|
||||
$args->content = $source_obj->get('content');
|
||||
if($document_config->use_history == 'Y') $args->content = $source_obj->get('content');
|
||||
$args->nick_name = $source_obj->get('nick_name');
|
||||
$args->member_srl = $source_obj->get('member_srl');
|
||||
$args->regdate = $source_obj->get('last_update');
|
||||
|
|
@ -329,6 +329,14 @@
|
|||
// 내용에서 XE만의 태그를 삭제
|
||||
$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
|
||||
|
||||
// 글쓴이의 언어변수와 원문의 언어변수가 다르면 확장변수로 처리
|
||||
if($source_obj->lang_code != Context::getLangType()) {
|
||||
$extra_content->title = $obj->title;
|
||||
$extra_content->content = $obj->content;
|
||||
$obj->title = $source_obj->title;
|
||||
$obj->content = $source_obj->content;
|
||||
}
|
||||
|
||||
// 세션에서 최고 관리자가 아니면 iframe, script 제거
|
||||
if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content);
|
||||
|
||||
|
|
@ -342,7 +350,9 @@
|
|||
// 등록 성공시 확장 변수 등록
|
||||
$extra_keys = $oDocumentModel->getExtraKeys($obj->module_srl);
|
||||
if(count($extra_keys)) {
|
||||
$this->deleteDocumentExtraVars($obj->module_srl, $obj->document_srl);
|
||||
$this->deleteDocumentExtraVars($obj->module_srl, $obj->document_srl, Context::getLangType());
|
||||
|
||||
// 관리자 설정 확장변수 등록
|
||||
foreach($extra_keys as $idx => $extra_item) {
|
||||
$value = '';
|
||||
if(isset($obj->{'extra_vars'.$idx})) $value = trim($obj->{'extra_vars'.$idx});
|
||||
|
|
@ -350,6 +360,10 @@
|
|||
if(!isset($value)) continue;
|
||||
$this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, $idx, $value);
|
||||
}
|
||||
|
||||
// 제목/내용의 다국어 확장변수 등록
|
||||
if($extra_content->title) $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, -1, $extra_content->title);
|
||||
if($extra_content->content) $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, -2, $extra_content->content);
|
||||
}
|
||||
|
||||
// 성공하였을 경우 category_srl이 있으면 카테고리 update
|
||||
|
|
@ -549,10 +563,11 @@
|
|||
/**
|
||||
* @brief documents 확장변수 값 제거
|
||||
**/
|
||||
function deleteDocumentExtraVars($module_srl, $document_srl = null, $var_idx = null) {
|
||||
function deleteDocumentExtraVars($module_srl, $document_srl = null, $var_idx = null, $lang_type = null) {
|
||||
$obj->module_srl = $module_srl;
|
||||
if(!is_null($document_srl)) $obj->document_srl = $document_srl;
|
||||
if(!is_null($var_idx)) $obj->var_idx = $var_idx;
|
||||
if(!is_null($lang_type)) $obj->lang_type = $lang_type;
|
||||
return executeQuery('document.deleteDocumentExtraVars', $obj);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
class documentItem extends Object {
|
||||
|
||||
var $document_srl = 0;
|
||||
var $lang_code = null;
|
||||
|
||||
var $allow_trackback_status = null;
|
||||
|
||||
|
|
@ -36,6 +37,7 @@
|
|||
return;
|
||||
}
|
||||
$this->document_srl = $attribute->document_srl;
|
||||
$this->lang_code = $attribute->lang_code;
|
||||
$this->adds($attribute);
|
||||
|
||||
// 태그 정리
|
||||
|
|
@ -163,6 +165,10 @@
|
|||
$oCommunicationController->sendMessage($sender_member_srl, $receiver_srl, $title, $content, false);
|
||||
}
|
||||
|
||||
function getLangCode() {
|
||||
return $this->get('lang_code');
|
||||
}
|
||||
|
||||
function getIpaddress() {
|
||||
if($this->isGranted()) return $this->get('ipaddress');
|
||||
return preg_replace('/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/','*.$2.$3.$4', $this->get('ipaddress'));
|
||||
|
|
@ -378,6 +384,7 @@
|
|||
|
||||
function getExtraVars() {
|
||||
if(!$this->get('module_srl') || !$this->document_srl) return null;
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
return $oDocumentModel->getExtraVars($this->get('module_srl'), $this->document_srl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,139 +20,72 @@
|
|||
return $_SESSION['own_document'][$document_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 확장변수를 매 문서마다 처리하지 않기 위해 매크로성으로 일괄 select 및 적용
|
||||
**/
|
||||
function setToAllDocumentExtraVars() {
|
||||
// XE에서 모든 문서 객체는 XE_DOCUMENT_LIST라는 전역 변수에 세팅을 함
|
||||
if(!count($GLOBALS['XE_DOCUMENT_LIST'])) continue;
|
||||
|
||||
// 모든 호출된 문서 객체를 찾아서 확장변수가 설정되었는지를 확인
|
||||
$document_srls = array();
|
||||
foreach($GLOBALS['XE_DOCUMENT_LIST'] as $key => $val) {
|
||||
if(!$val->document_srl || isset($GLOBALS['XE_EXTRA_VARS'][$val->document_srl])) continue;
|
||||
$document_srls[$key] = $val->document_srl;
|
||||
}
|
||||
|
||||
// 검출된 문서 번호가 없으면 return
|
||||
if(!count($document_srls)) return;
|
||||
|
||||
$lang_code = Context::getLangType();
|
||||
|
||||
// 확장변수 미지정된 문서에 대해서 일단 현재 접속자의 언어코드로 확장변수를 검색
|
||||
$obj->document_srl = implode(',',$document_srls);
|
||||
$output = executeQueryArray('document.getDocumentsExtraVars', $obj);
|
||||
if($output->toBool() && $output->data) {
|
||||
$setted = array();
|
||||
foreach($output->data as $key => $val) {
|
||||
if(!$val->document_srl) continue;
|
||||
if($val->idx == -1 && $val->lang_code == $lang_code) $GLOBALS['XE_DOCUMENT_LIST'][$val->document_srl]->add('title', $val->value);
|
||||
else if($val->idx == -2 && $val->lang_code == $lang_code) $GLOBALS['XE_DOCUMENT_LIST'][$val->document_srl]->add('content', $val->value);
|
||||
|
||||
if($val->idx<0) continue;
|
||||
|
||||
if($lang_code == $val->lang_code) {
|
||||
$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value);
|
||||
$GLOBALS['XE_EXTRA_VARS'][$val->document_srl][$obj->idx] = $obj;
|
||||
} else if($lang_code == $GLOBALS['XE_DOCUMENT_LIST'][$val->document_srl]->lang_code && !isset($GLOBALS['XE_EXTRA_VARS'][$val->document_srl][$obj->idx])) {
|
||||
$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value);
|
||||
$GLOBALS['XE_EXTRA_VARS'][$val->document_srl][$obj->idx] = $obj;
|
||||
} else if(!isset($GLOBALS['XE_EXTRA_VARS'][$val->document_srl][$obj->idx])) {
|
||||
$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value);
|
||||
$GLOBALS['XE_EXTRA_VARS'][$val->document_srl][$obj->idx] = $obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($document_srls as $key => $document_srl) {
|
||||
if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl])) $GLOBALS['XE_EXTRA_VARS'][$document_srl] = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 문서 가져오기
|
||||
**/
|
||||
function getDocument($document_srl=0, $is_admin = false) {
|
||||
static $document_list = array();
|
||||
if(!$document_srl) return new documentItem();
|
||||
|
||||
if(!isset($document_list[$document_srl])) {
|
||||
if(!isset($GLOBALS['XE_DOCUMENT_LIST'][$document_srl])) {
|
||||
$oDocument = new documentItem($document_srl);
|
||||
$document_list[$document_srl] = &$oDocument;
|
||||
} else $oDocument = $document_list[$document_srl];
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument;
|
||||
$this->setToAllDocumentExtraVars();
|
||||
} else $oDocument = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl];
|
||||
if($is_admin) $oDocument->setGrant();
|
||||
|
||||
return $oDocument;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief document의 확장 변수 키값을 가져오는 함수
|
||||
* $form_include : 글 작성시에 필요한 확장변수의 input form 추가 여부
|
||||
**/
|
||||
function getExtraKeys($module_srl) {
|
||||
$oExtraVar = &ExtraVar::getInstance($module_srl);
|
||||
if(!$oExtraVar->isSettedExtraVars()) {
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->sort_index = 'var_idx';
|
||||
$obj->order = 'asc';
|
||||
$output = executeQueryArray('document.getDocumentExtraKeys', $obj);
|
||||
$oExtraVar->setExtraVarKeys($output->data);
|
||||
}
|
||||
return $oExtraVar->getExtraVars();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 document의 확장 변수 값을 가져오는 함수
|
||||
**/
|
||||
function getExtraVars($module_srl, $document_srl) {
|
||||
static $extra_vars = array();
|
||||
|
||||
if(!isset($extra_vars[$module_srl][$document_srl])) {
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->document_srl = $document_srl;
|
||||
$obj->sort_index = 'extra_keys.var_idx';
|
||||
$obj->order = 'asc';
|
||||
$obj->lang_code = Context::getLangType();
|
||||
$output = executeQueryArray('document.getDocumentExtraVars', $obj);
|
||||
|
||||
if($output->data) {
|
||||
foreach($output->data as $key => $val) {
|
||||
$obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value);
|
||||
$extra_vars[$module_srl][$document_srl][$obj->idx] = $obj;
|
||||
}
|
||||
} else {
|
||||
$extra_vars[$module_srl][$document_srl] = array();
|
||||
}
|
||||
}
|
||||
return $extra_vars[$module_srl][$document_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 회원이어야만 가능한 기능
|
||||
if($logged_info->member_srl) {
|
||||
|
||||
// 추천 버튼 추가
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript');
|
||||
|
||||
// 비추천 버튼 추가
|
||||
$url= sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript');
|
||||
|
||||
// 신고 기능 추가
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_declare','./modules/document/tpl/icons/declare.gif','javascript');
|
||||
|
||||
// 스크랩 버튼 추가
|
||||
$url = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_scrap','./modules/document/tpl/icons/scrap.gif','javascript');
|
||||
}
|
||||
|
||||
// 인쇄 버튼 추가
|
||||
$url = getUrl('','module','document','act','dispDocumentPrint','document_srl',$document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_print','./modules/document/tpl/icons/print.gif','printDocument');
|
||||
|
||||
// trigger 호출 (after)
|
||||
ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list);
|
||||
|
||||
// 관리자일 경우 ip로 글 찾기
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
|
||||
if($oDocument->isExists()) {
|
||||
// ip주소에 해당하는 글 찾기
|
||||
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->get('ipaddress'));
|
||||
$icon_path = './modules/member/tpl/images/icon_management.gif';
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
||||
|
||||
$url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument-> getIpAddress());
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_add_ip_to_spamfilter','./modules/document/tpl/icons/declare.gif','javascript');
|
||||
}
|
||||
}
|
||||
|
||||
// 팝업메뉴의 언어 변경
|
||||
$menus = Context::get('document_popup_menu_list');
|
||||
$menus_count = count($menus);
|
||||
for($i=0;$i<$menus_count;$i++) {
|
||||
$menus[$i]->str = Context::getLang($menus[$i]->str);
|
||||
}
|
||||
|
||||
// 최종적으로 정리된 팝업메뉴 목록을 구함
|
||||
$this->add('menus', $menus);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 여러개의 문서들을 가져옴 (페이징 아님)
|
||||
**/
|
||||
|
|
@ -181,7 +114,10 @@
|
|||
if($is_admin) $oDocument->setGrant();
|
||||
|
||||
$result[$attribute->document_srl] = $oDocument;
|
||||
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl] = $oDocument;
|
||||
}
|
||||
$this->setToAllDocumentExtraVars();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
@ -414,10 +350,13 @@
|
|||
$oDocument->setAttribute($attribute);
|
||||
if($is_admin) $oDocument->setGrant();
|
||||
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$attribute->document_srl] = $oDocument;
|
||||
|
||||
$output->data[$virtual_number] = $oDocument;
|
||||
$virtual_number --;
|
||||
|
||||
}
|
||||
$this->setToAllDocumentExtraVars();
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -446,11 +385,117 @@
|
|||
$oDocument = null;
|
||||
$oDocument = new documentItem();
|
||||
$oDocument->setAttribute($val);
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$val->document_srl] = $oDocument;
|
||||
$result->data[$val->document_srl] = $oDocument;
|
||||
}
|
||||
$this->setToAllDocumentExtraVars();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief document의 확장 변수 키값을 가져오는 함수
|
||||
* $form_include : 글 작성시에 필요한 확장변수의 input form 추가 여부
|
||||
**/
|
||||
function getExtraKeys($module_srl) {
|
||||
$oExtraVar = &ExtraVar::getInstance($module_srl);
|
||||
if(!$oExtraVar->isSettedExtraVars()) {
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->sort_index = 'var_idx';
|
||||
$obj->order = 'asc';
|
||||
$output = executeQueryArray('document.getDocumentExtraKeys', $obj);
|
||||
$oExtraVar->setExtraVarKeys($output->data);
|
||||
}
|
||||
return $oExtraVar->getExtraVars();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 document의 확장 변수 값을 가져오는 함수
|
||||
**/
|
||||
function getExtraVars($module_srl, $document_srl) {
|
||||
if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl])) {
|
||||
$oDocument = $this->getDocument($document_srl);
|
||||
$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument;
|
||||
$this->setToAllDocumentExtraVars();
|
||||
}
|
||||
return $GLOBALS['XE_EXTRA_VARS'][$document_srl];
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
// 회원이어야만 가능한 기능
|
||||
if($logged_info->member_srl) {
|
||||
|
||||
// 추천 버튼 추가
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript');
|
||||
|
||||
// 비추천 버튼 추가
|
||||
$url= sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript');
|
||||
|
||||
// 신고 기능 추가
|
||||
$url = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_declare','./modules/document/tpl/icons/declare.gif','javascript');
|
||||
|
||||
// 스크랩 버튼 추가
|
||||
$url = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_scrap','./modules/document/tpl/icons/scrap.gif','javascript');
|
||||
}
|
||||
|
||||
// 인쇄 버튼 추가
|
||||
$url = getUrl('','module','document','act','dispDocumentPrint','document_srl',$document_srl);
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_print','./modules/document/tpl/icons/print.gif','printDocument');
|
||||
|
||||
// trigger 호출 (after)
|
||||
ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list);
|
||||
|
||||
// 관리자일 경우 ip로 글 찾기
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
|
||||
if($oDocument->isExists()) {
|
||||
// ip주소에 해당하는 글 찾기
|
||||
$url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->get('ipaddress'));
|
||||
$icon_path = './modules/member/tpl/images/icon_management.gif';
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress');
|
||||
|
||||
$url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument-> getIpAddress());
|
||||
$oDocumentController->addDocumentPopupMenu($url,'cmd_add_ip_to_spamfilter','./modules/document/tpl/icons/declare.gif','javascript');
|
||||
}
|
||||
}
|
||||
|
||||
// 팝업메뉴의 언어 변경
|
||||
$menus = Context::get('document_popup_menu_list');
|
||||
$menus_count = count($menus);
|
||||
for($i=0;$i<$menus_count;$i++) {
|
||||
$menus[$i]->str = Context::getLang($menus[$i]->str);
|
||||
}
|
||||
|
||||
// 최종적으로 정리된 팝업메뉴 목록을 구함
|
||||
$this->add('menus', $menus);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief module_srl에 해당하는 문서의 전체 갯수를 가져옴
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -6,5 +6,6 @@
|
|||
<condition operation="equal" column="module_srl" var="module_srl" filter="number" notnull="notnull" />
|
||||
<condition operation="equal" column="document_srl" var="document_srl" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="var_idx" var="var_idx" filter="number" pipe="and" />
|
||||
<condition operation="equal" column="lang_type" var="lang_type" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
|
|||
|
|
@ -4,9 +4,10 @@
|
|||
<table name="document_extra_vars" alias="extra_vars" type="left join">
|
||||
<conditions>
|
||||
<condition operation="equal" column="extra_vars.module_srl" default="extra_keys.module_srl" />
|
||||
<condition operation="equal" column="extra_vars.document_srl" var="document_srl" pipe="and" notnull="notnull" />
|
||||
<condition operation="in" column="extra_vars.document_srl" var="document_srl" pipe="and" notnull="notnull" />
|
||||
<condition operation="equal" column="extra_vars.var_idx" default="extra_keys.var_idx" pipe="and" />
|
||||
<condition operation="equal" column="extra_vars.lang_code" var="lang_code" pipe="and" />
|
||||
<condition operation="in" column="extra_vars.lang_code" var="lang_codes" pipe="and" />
|
||||
</conditions>
|
||||
</table>
|
||||
</tables>
|
||||
|
|
|
|||
27
modules/document/queries/getDocumentsExtraVars.xml
Normal file
27
modules/document/queries/getDocumentsExtraVars.xml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<query id="getDocumentsExtraVars" action="select">
|
||||
<tables>
|
||||
<table name="document_extra_vars" alias="extra_vars" />
|
||||
<table name="document_extra_keys" alias="extra_keys" type="left join">
|
||||
<conditions>
|
||||
<condition operation="equal" column="extra_keys.module_srl" default="extra_vars.module_srl" />
|
||||
<condition operation="equal" column="extra_keys.var_idx" default="extra_vars.var_idx" pipe="and" />
|
||||
</conditions>
|
||||
</table>
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="extra_keys.module_srl" alias="module_srl" />
|
||||
<column name="extra_keys.var_name" alias="name" />
|
||||
<column name="extra_keys.var_type" alias="type" />
|
||||
<column name="extra_keys.var_is_required" alias="is_required" />
|
||||
<column name="extra_keys.var_search" alias="search" />
|
||||
<column name="extra_keys.var_default" alias="default" />
|
||||
<column name="extra_keys.var_desc" alias="desc" />
|
||||
<column name="extra_vars.var_idx" alias="idx" />
|
||||
<column name="extra_vars.document_srl" alias="document_srl" />
|
||||
<column name="extra_vars.lang_code" alias="lang_code" />
|
||||
<column name="extra_vars.value" alias="value" />
|
||||
</columns>
|
||||
<conditions>
|
||||
<condition operation="in" column="extra_vars.document_srl" var="document_srl" pipe="and" />
|
||||
</conditions>
|
||||
</query>
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
<column name="document_srl" var="document_srl" filter="number" notnull="notnull" />
|
||||
<column name="module_srl" var="module_srl" filter="number" default="0" />
|
||||
<column name="category_srl" var="category_srl" filter="number" default="0" />
|
||||
<column name="lang_code" var="lang_code" default="" />
|
||||
<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" />
|
||||
|
|
|
|||
8
modules/document/queries/updateDocumentsLangCode.xml
Normal file
8
modules/document/queries/updateDocumentsLangCode.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<query id="updateDocumentsLangCode" action="update">
|
||||
<tables>
|
||||
<table name="documents" />
|
||||
</tables>
|
||||
<columns>
|
||||
<column name="lang_code" var="lang_code" notnull="notnull" />
|
||||
</columns>
|
||||
</query>
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
<column name="document_srl" type="number" size="11" notnull="notnull" primary_key="primary_key" />
|
||||
<column name="module_srl" type="number" size="11" default="0" notnull="notnull" index="idx_module_srl" />
|
||||
<column name="category_srl" type="number" size="11" default="0" notnull="notnull" index="idx_category_srl" />
|
||||
<column name="lang_code" type="varchar" size="10" default="" notnull="notnull" />
|
||||
<column name="is_notice" type="char" size="1" default="N" notnull="notnull" index="idx_is_notice" />
|
||||
<column name="is_secret" type="char" size="1" default="N" notnull="notnull" index="idx_is_secret" />
|
||||
<column name="title" type="varchar" size="250" />
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@
|
|||
<table cellspacing="0" class="crossTable ">
|
||||
<tr>
|
||||
<th><div>{$lang->column_name}</div></th>
|
||||
<td class="wide"><input type="text" name="name" value="{$selected_var->name}" class="inputTypeText w200" id="name" /><a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','name')}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a> </td>
|
||||
<td class="wide">
|
||||
<input type="text" name="name" value="{$selected_var->name}" class="inputTypeText w200" id="name" /><a href="{getUrl('','module','module','act','dispModuleAdminLangcode','target','name')}" onclick="popopen(this.href);return false;" class="buttonSet buttonSetting"><span>{$lang->cmd_find_langcode}</span></a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><div>{$lang->column_type}</div></th>
|
||||
|
|
|
|||
|
|
@ -132,7 +132,6 @@
|
|||
* @brief 레이아웃 미리 보기
|
||||
**/
|
||||
function dispLayoutAdminPreview() {
|
||||
// debugPrint(Context::getRequestVars());
|
||||
$layout_srl = Context::get('layout_srl');
|
||||
$code = Context::get('code');
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
<div class="fr">
|
||||
<select name="widget_list">
|
||||
<!--@foreach($widget_list as $widget)-->
|
||||
<option value="{$widget->widget}">{$widget->title}</option>
|
||||
<option value="{$widget->widget}" <!--@if($widget->widget=='content')-->selected="selected"<!--@end-->>{$widget->title}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<span class="button blue"><input type="button" value="{$lang->cmd_insert}" onclick="doAddWidget(this.form); return false;"/></span>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
if($obj->title == '') $obj->title = cut_str(strip_tags($obj->content),20,'...');
|
||||
//그래도 없으면 Untitled
|
||||
if($obj->title == '') $obj->title = 'Untitled';
|
||||
debugPrint($obj);
|
||||
|
||||
// document module의 model 객체 생성
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
|
|
|||
|
|
@ -88,7 +88,6 @@
|
|||
$obj->page = $page;
|
||||
$obj->list_count = 50;
|
||||
$output = $oDocumentModel->getDocumentList($obj);
|
||||
debugPrint($output);
|
||||
|
||||
Context::set('document_list', $output->data);
|
||||
Context::set('total_count', $output->total_count);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue