mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
css 및 js 호출순서 조정기능 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5785 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4f380d9c48
commit
61851f1dfe
2149 changed files with 109090 additions and 18689 deletions
|
|
@ -36,98 +36,6 @@
|
|||
$this->setMessage( sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자가 글 선택시 세션에 담음
|
||||
**/
|
||||
function procDocumentAdminAddCart() {
|
||||
$document_srls = explode(',',Context::get('srls'));
|
||||
$cnt = count($document_srls);
|
||||
for($i=0;$i<$cnt;$i++) {
|
||||
$document_srl = (int)trim($document_srls[$i]);
|
||||
if(!$document_srls) continue;
|
||||
if($_SESSION['document_management'][$document_srl]) unset($_SESSION['document_management'][$document_srl]);
|
||||
else $_SESSION['document_management'][$document_srl] = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 세션에 담긴 선택글의 이동/ 삭제
|
||||
**/
|
||||
function procDocumentAdminManageCheckedDocument() {
|
||||
$type = Context::get('type');
|
||||
$module_srl = Context::get('target_module');
|
||||
$category_srl = Context::get('target_category');
|
||||
$message_content = Context::get('message_content');
|
||||
if($message_content) $message_content = nl2br($message_content);
|
||||
|
||||
$cart = Context::get('cart');
|
||||
if($cart) $document_srl_list = explode('|@|', $cart);
|
||||
else $document_srl_list = array();
|
||||
|
||||
$document_srl_count = count($document_srl_list);
|
||||
|
||||
// 쪽지 발송
|
||||
if($message_content) {
|
||||
|
||||
$oCommunicationController = &getController('communication');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
||||
$title = cut_str($message_content,10,'...');
|
||||
$sender_member_srl = $logged_info->member_srl;
|
||||
|
||||
for($i=0;$i<$document_srl_count;$i++) {
|
||||
$document_srl = $document_srl_list[$i];
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
if(!$oDocument->get('member_srl') || $oDocument->get('member_srl')==$sender_member_srl) continue;
|
||||
|
||||
if($type=='move') $purl = sprintf("<a href=\"%s\" onclick=\"window.open(this.href);return false;\">%s</a>", $oDocument->getPermanentUrl(), $oDocument->getPermanentUrl());
|
||||
else $purl = "";
|
||||
$content .= sprintf("<div>%s</div><hr />%s<div style=\"font-weight:bold\">%s</div>%s",$message_content, $purl, $oDocument->getTitleText(), $oDocument->getContent(false, false, false));
|
||||
|
||||
$oCommunicationController->sendMessage($sender_member_srl, $oDocument->get('member_srl'), $title, $content, false);
|
||||
}
|
||||
}
|
||||
|
||||
// 스팸 처리가 되지 않도록 스팸필터 설정
|
||||
$oSpamController = &getController('spamfilter');
|
||||
$oSpamController->setAvoidLog();
|
||||
|
||||
if($type == 'move') {
|
||||
if(!$module_srl) return new Object(-1, 'fail_to_move');
|
||||
|
||||
$output = $this->moveDocumentModule($document_srl_list, $module_srl, $category_srl);
|
||||
if(!$output->toBool()) return new Object(-1, 'fail_to_move');
|
||||
|
||||
$msg_code = 'success_moved';
|
||||
|
||||
} elseif($type == 'copy') {
|
||||
if(!$module_srl) return new Object(-1, 'fail_to_move');
|
||||
|
||||
$output = $this->copyDocumentModule($document_srl_list, $module_srl, $category_srl);
|
||||
if(!$output->toBool()) return new Object(-1, 'fail_to_move');
|
||||
|
||||
$msg_code = 'success_registed';
|
||||
|
||||
} elseif($type =='delete') {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
$oDocumentController = &getController('document');
|
||||
for($i=0;$i<$document_srl_count;$i++) {
|
||||
$document_srl = $document_srl_list[$i];
|
||||
$output = $oDocumentController->deleteDocument($document_srl, true);
|
||||
if(!$output->toBool()) return new Object(-1, 'fail_to_delete');
|
||||
}
|
||||
$oDB->commit();
|
||||
$msg_code = 'success_deleted';
|
||||
}
|
||||
|
||||
$_SESSION['document_management'] = array();
|
||||
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 게시물들의 소속 모듈 변경 (게시글 이동시에 사용)
|
||||
**/
|
||||
|
|
@ -182,6 +90,11 @@
|
|||
$oFileController->setFilesValid($obj->document_srl);
|
||||
}
|
||||
|
||||
if($module_srl != $obj->module_srl)
|
||||
{
|
||||
$oDocumentController->deleteDocumentAliasByDocument($obj->document_srl);
|
||||
}
|
||||
|
||||
// 게시물의 모듈 이동
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->category_srl = $category_srl;
|
||||
|
|
@ -411,6 +324,303 @@
|
|||
}
|
||||
$directory->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈의 확장 변수 추가 또는 수정
|
||||
**/
|
||||
function procDocumentAdminInsertExtraVar() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
$var_idx = Context::get('var_idx');
|
||||
$name = Context::get('name');
|
||||
$type = Context::get('type');
|
||||
$is_required = Context::get('is_required');
|
||||
$default = Context::get('default');
|
||||
$desc = Context::get('desc');
|
||||
$search = Context::get('search');
|
||||
|
||||
if(!$module_srl || !$name) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
// idx가 지정되어 있지 않으면 최고 값을 지정
|
||||
if(!$var_idx) {
|
||||
$obj->module_srl = $module_srl;
|
||||
$output = executeQuery('document.getDocumentMaxExtraKeyIdx', $obj);
|
||||
$var_idx = $output->data->var_idx+1;
|
||||
}
|
||||
|
||||
// insert or update
|
||||
$oDocumentController = &getController('document');
|
||||
$output = $oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $name, $type, $is_required, $search, $default, $desc);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈의 확장 변수 삭제
|
||||
**/
|
||||
function procDocumentAdminDeleteExtraVar() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
$var_idx = Context::get('var_idx');
|
||||
if(!$module_srl || !$var_idx) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
$output = $oDocumentController->deleteDocumentExtraKeys($module_srl, $var_idx);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리 추가
|
||||
**/
|
||||
function procDocumentAdminInsertCategory($args = null) {
|
||||
// 입력할 변수 정리
|
||||
if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','title','expand','group_srls','color');
|
||||
|
||||
if($args->expand !="Y") $args->expand = "N";
|
||||
$args->group_srls = str_replace('|@|',',',$args->group_srls);
|
||||
$args->parent_srl = (int)$args->parent_srl;
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 이미 존재하는지를 확인
|
||||
if($args->category_srl) {
|
||||
$category_info = $oDocumentModel->getCategory($args->category_srl);
|
||||
if($category_info->category_srl != $args->category_srl) $args->category_srl = null;
|
||||
}
|
||||
|
||||
// 존재하게 되면 update를 해준다
|
||||
if($args->category_srl) {
|
||||
$output = $oDocumentController->updateCategory($args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 존재하지 않으면 insert를 해준다
|
||||
} else {
|
||||
$output = $oDocumentController->insertCategory($args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// XML 파일을 갱신하고 위치을 넘겨 받음
|
||||
$xml_file = $oDocumentController->makeCategoryFile($args->module_srl);
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$this->add('xml_file', $xml_file);
|
||||
$this->add('module_srl', $args->module_srl);
|
||||
$this->add('category_srl', $args->category_srl);
|
||||
$this->add('parent_srl', $args->parent_srl);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 카테고리 삭제
|
||||
**/
|
||||
function procDocumentAdminDeleteCategory() {
|
||||
// 변수 정리
|
||||
$args = Context::gets('module_srl','category_srl');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
// 원정보를 가져옴
|
||||
$category_info = $oDocumentModel->getCategory($args->category_srl);
|
||||
if($category_info->parent_srl) $parent_srl = $category_info->parent_srl;
|
||||
|
||||
// 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력
|
||||
if($oDocumentModel->getCategoryChlidCount($args->category_srl)) return new Object(-1, 'msg_cannot_delete_for_child');
|
||||
|
||||
// DB에서 삭제
|
||||
$oDocumentController = &getController('document');
|
||||
$output = $oDocumentController->deleteCategory($args->category_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// XML 파일을 갱신하고 위치을 넘겨 받음
|
||||
$xml_file = $oDocumentController->makeCategoryFile($args->module_srl);
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$this->add('xml_file', $xml_file);
|
||||
$this->add('category_srl', $parent_srl);
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
function procDocumentAdminMoveCategory() {
|
||||
$source_category_srl = Context::get('source_srl');
|
||||
|
||||
// parent_srl 이 있으면 첫 자식으로 들어간다
|
||||
$parent_category_srl = Context::get('parent_srl');
|
||||
|
||||
// target_srl 이 있으면 target_srl 아래로 형제로 들어간다
|
||||
$target_category_srl = Context::get('target_srl');
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentController = &getController('document');
|
||||
$source_category = $oDocumentModel->getCategory($source_category_srl);
|
||||
|
||||
|
||||
//parent_category_srl 의 첫 자식으로 넣자
|
||||
if($parent_category_srl > 0 || ($parent_category_srl == 0 && $target_category_srl == 0)){
|
||||
$parent_category = $oDocumentModel->getCategory($parent_category_srl);
|
||||
|
||||
$args->module_srl = $source_category->module_srl;
|
||||
$args->parent_srl = $parent_category_srl;
|
||||
$output = executeQuery('document.getChildCategoryMinListOrder', $args);
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
$args->list_order = (int)$output->data->list_order;
|
||||
if(!$args->list_order) $args->list_order = 0;
|
||||
$args->list_order--;
|
||||
|
||||
|
||||
$source_args->category_srl = $source_category_srl;
|
||||
$source_args->parent_srl = $parent_category_srl;
|
||||
$source_args->list_order = $args->list_order;
|
||||
$output = $oDocumentController->updateCategory($source_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
||||
// $target_category_srl의 아래동생으로
|
||||
}else if($target_category_srl > 0){
|
||||
$target_category = $oDocumentModel->getCategory($target_category_srl);
|
||||
|
||||
//$target_category의 아래 동생을 모두 내린다
|
||||
$output = $oDocumentController->updateCategoryListOrder($target_category->module_srl, $target_category->list_order+1);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
|
||||
$source_args->category_srl = $source_category_srl;
|
||||
$source_args->parent_srl = $target_category->parent_srl;
|
||||
$source_args->list_order = $target_category->list_order+1;
|
||||
$output = $oDocumentController->updateCategory($source_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// xml파일 재생성
|
||||
$xml_file = $oDocumentController->makeCategoryFile($source_category->module_srl);
|
||||
|
||||
// return 변수 설정
|
||||
$this->add('xml_file', $xml_file);
|
||||
$this->add('source_category_srl', $source_category_srl);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief xml 파일을 갱신
|
||||
* 관리자페이지에서 메뉴 구성 후 간혹 xml파일이 재생성 안되는 경우가 있는데\n
|
||||
* 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n
|
||||
* 개발 중간의 문제인 것 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능
|
||||
**/
|
||||
function procDocumentAdminMakeXmlFile() {
|
||||
// 입력값을 체크
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// xml파일 재생성
|
||||
$oDocumentController = &getController('document');
|
||||
$xml_file = $oDocumentController->makeCategoryFile($module_srl);
|
||||
|
||||
// return 값 설정
|
||||
$this->add('xml_file',$xml_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 확장변수 순서 조절
|
||||
**/
|
||||
function procAdminMoveExtraVar() {
|
||||
$type = Context::get('type');
|
||||
$module_srl = Context::get('module_srl');
|
||||
$var_idx = Context::get('var_idx');
|
||||
|
||||
if(!$type || !$module_srl || !$var_idx) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$module_info->module_srl) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$extra_keys = $oDocumentModel->getExtraKeys($module_srl);
|
||||
if(!$extra_keys[$var_idx]) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
if($type == 'up') $new_idx = $var_idx-1;
|
||||
else $new_idx = $var_idx+1;
|
||||
if($new_idx<1) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
// 바꿀 idx가 없으면 바로 업데이트
|
||||
if(!$extra_keys[$new_idx]) {
|
||||
$args->module_srl = $module_srl;
|
||||
$args->var_idx = $var_idx;
|
||||
$args->new_idx = $new_idx;
|
||||
$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
// 있으면 기존의 꺼랑 교체
|
||||
} else {
|
||||
$args->module_srl = $module_srl;
|
||||
$args->var_idx = $new_idx;
|
||||
$args->new_idx = -1;
|
||||
$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$args->var_idx = $var_idx;
|
||||
$args->new_idx = $new_idx;
|
||||
$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$args->var_idx = -1;
|
||||
$args->new_idx = $var_idx;
|
||||
$output = executeQuery('document.updateDocumentExtraKeyIdx', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
$output = executeQuery('document.updateDocumentExtraVarIdx', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
}
|
||||
|
||||
function procDocumentAdminInsertAlias() {
|
||||
$args = Context::gets('module_srl','document_srl', 'alias_title');
|
||||
$alias_srl = Context::get('alias_srl');
|
||||
if(!$alias_srl)
|
||||
{
|
||||
$args->alias_srl = getNextSequence();
|
||||
$query = "document.insertAlias";
|
||||
}
|
||||
else
|
||||
{
|
||||
$args->alias_srl = $alias_srl;
|
||||
$query = "document.updateAlias";
|
||||
}
|
||||
$output = executeQuery($query, $args);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
function procDocumentAdminDeleteAlias() {
|
||||
$alias_srl = Context::get('alias_srl');
|
||||
$args->alias_srl = $alias_srl;
|
||||
$output = executeQuery("document.deleteAlias", $args);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue