mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1540 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
86e8af5b3f
commit
f2e47e336d
37 changed files with 27 additions and 3019 deletions
|
|
@ -128,9 +128,10 @@
|
|||
// type, grant 값 구함
|
||||
$type = $xml_info->action->{$this->act}->type;
|
||||
$grant = $xml_info->action->{$this->act}->grant;
|
||||
$kind = strpos(strtolower($this->act),'admin')!==false?'admin':'';
|
||||
|
||||
// 모듈 객체 생성
|
||||
$oModule = &$this->getModuleInstance($this->module, $type);
|
||||
$oModule = &$this->getModuleInstance($this->module, $type, $kind);
|
||||
if(!is_object($oModule)) {
|
||||
$this->error = 'msg_module_is_not_exists';
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
$this->grant = $grant;
|
||||
Context::set('grant', $grant);
|
||||
|
||||
$this->init();
|
||||
if(method_exists($this, 'init')) $this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -285,7 +285,8 @@
|
|||
$forward = $oModuleModel->getActionForward($this->act);
|
||||
if($forward->module && $forward->type && $forward->act) {
|
||||
|
||||
$oModule = &getModule($forward->module, $forward->type);
|
||||
$kind = strpos(strtolower($forward->act),'admin')!==false?'admin':'';
|
||||
$oModule = &getModule($forward->module, $forward->type, $kind);
|
||||
$xml_info = $oModuleModel->getModuleActionXml($forward->module);
|
||||
$oModule->setAct($forward->act);
|
||||
$oModule->init();
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
* 2 : 1 + DB 쿼리
|
||||
* 3 : 모든 로그
|
||||
**/
|
||||
define('__DEBUG__', 1);
|
||||
define('__DEBUG__', 3);
|
||||
|
||||
/**
|
||||
* @brief 간단하게 사용하기 위한 함수 정의한 파일 require
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
$oModuleController->insertActionForward('addon', 'view', 'dispAddonAdminIndex');
|
||||
|
||||
// 몇가지 애드온을 기본으로 설치 상태로 지정
|
||||
$oAddonController = &getController('addon');
|
||||
$oAddonController = &getAdminController('addon');
|
||||
$oAddonController->doActivate('spamfilter');
|
||||
$oAddonController->doActivate('message');
|
||||
$oAddonController->doActivate('member_extra_info');
|
||||
|
|
|
|||
|
|
@ -206,553 +206,5 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 권한 추가
|
||||
**/
|
||||
function procBlogAdminInsertGrant() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 현 모듈의 권한 목록을 가져옴
|
||||
$grant_list = $this->xml_info->grant;
|
||||
|
||||
if(count($grant_list)) {
|
||||
foreach($grant_list as $key => $val) {
|
||||
$group_srls = Context::get($key);
|
||||
if($group_srls) $arr_grant[$key] = explode('|@|',$group_srls);
|
||||
}
|
||||
$grants = serialize($arr_grant);
|
||||
}
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleGrant($module_srl, $grants);
|
||||
|
||||
$this->add('module_srl',Context::get('module_srl'));
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스킨 정보 업데이트
|
||||
**/
|
||||
function procBlogAdminUpdateSkinInfo() {
|
||||
// module_srl에 해당하는 정보들을 가져오기
|
||||
$module_srl = Context::get('module_srl');
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
$skin = $module_info->skin;
|
||||
|
||||
// 스킨의 정보르 구해옴 (extra_vars를 체크하기 위해서)
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
// 입력받은 변수들을 체크 (mo, act, module_srl, page등 기본적인 변수들 없앰)
|
||||
$obj = Context::getRequestVars();
|
||||
unset($obj->act);
|
||||
unset($obj->module_srl);
|
||||
unset($obj->page);
|
||||
|
||||
// 원 skin_info에서 extra_vars의 type이 image일 경우 별도 처리를 해줌
|
||||
if($skin_info->extra_vars) {
|
||||
foreach($skin_info->extra_vars as $vars) {
|
||||
if($vars->type!='image') continue;
|
||||
|
||||
$image_obj = $obj->{$vars->name};
|
||||
|
||||
// 삭제 요청에 대한 변수를 구함
|
||||
$del_var = $obj->{"del_".$vars->name};
|
||||
unset($obj->{"del_".$vars->name});
|
||||
if($del_var == 'Y') {
|
||||
@unlink($module_info->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 업로드 되지 않았다면 이전 데이터를 그대로 사용
|
||||
if(!$image_obj['tmp_name']) {
|
||||
$obj->{$vars->name} = $module_info->{$vars->name};
|
||||
continue;
|
||||
}
|
||||
|
||||
// 정상적으로 업로드된 파일이 아니면 무시
|
||||
if(!is_uploaded_file($image_obj['tmp_name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 경로를 정해서 업로드
|
||||
$path = sprintf("./files/attach/images/%s/", $module_srl);
|
||||
|
||||
// 디렉토리 생성
|
||||
if(!FileHandler::makeDir($path)) return false;
|
||||
|
||||
$filename = $path.$image_obj['name'];
|
||||
|
||||
// 파일 이동
|
||||
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 변수를 바꿈
|
||||
unset($obj->{$vars->name});
|
||||
$obj->{$vars->name} = $filename;
|
||||
}
|
||||
}
|
||||
|
||||
// 메뉴 관리
|
||||
$menus = get_object_vars($skin_info->menu);
|
||||
if(count($menus)) {
|
||||
foreach($menus as $menu_id => $val) {
|
||||
$menu_srl = Context::get($menu_id);
|
||||
if($menu_srl) {
|
||||
$obj->menu->{$menu_id} = $menu_srl;
|
||||
$obj->{$menu_id} = $menu_srl;
|
||||
$menu_srl_list[] = $menu_srl;
|
||||
}
|
||||
}
|
||||
|
||||
// 정해진 메뉴가 있으면 모듈 및 메뉴에 대한 레이아웃 연동
|
||||
if(count($menu_srl_list)) {
|
||||
// 해당 메뉴와 레이아웃 값을 매핑
|
||||
$oMenuController = &getController('menu');
|
||||
$oMenuController->updateMenuLayout($module_srl, $menu_srl_list);
|
||||
|
||||
// 해당 메뉴에 속한 mid의 layout값을 모두 변경
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleLayout($module_srl, $menu_srl_list);
|
||||
}
|
||||
}
|
||||
|
||||
// serialize하여 저장
|
||||
$obj->category_xml_file = sprintf("./files/cache/blog_category/%s.xml.php", $module_srl);
|
||||
$obj->mid = $module_info->mid;
|
||||
$skin_vars = serialize($obj);
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleSkinVars($module_srl, $skin_vars);
|
||||
|
||||
// 레이아웃 확장변수 수정
|
||||
$layout_args->extra_vars = $skin_vars;
|
||||
$layout_args->layout_srl = $module_srl;
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->updateLayout($layout_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('default_layout.html');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile("top_refresh.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 블로그 추가
|
||||
**/
|
||||
function procBlogAdminInsertBlog() {
|
||||
// 일단 입력된 값들을 모두 받아서 db 입력항목과 그외 것으로 분리
|
||||
$args = Context::gets('module_srl','module_category_srl','blog_name','skin','browser_title','description','is_default','header_text','footer_text','admin_id','open_rss');
|
||||
$args->module = 'blog';
|
||||
$args->mid = $args->blog_name;
|
||||
unset($args->blog_name);
|
||||
if($args->is_default!='Y') $args->is_default = 'N';
|
||||
|
||||
// 기본 값외의 것들을 정리
|
||||
$extra_var = delObjectVars(Context::getRequestVars(), $args);
|
||||
unset($extra_var->act);
|
||||
unset($extra_var->page);
|
||||
unset($extra_var->blog_name);
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// module_srl이 넘어오면 원 모듈이 있는지 확인
|
||||
if($args->module_srl) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
|
||||
|
||||
// 만약 원래 모듈이 없으면 새로 입력하기 위한 처리
|
||||
if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
|
||||
}
|
||||
|
||||
// $extra_var를 serialize
|
||||
$args->extra_vars = serialize($extra_var);
|
||||
|
||||
// module 모듈의 controller 객체 생성
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
// is_default=='Y' 이면
|
||||
if($args->is_default=='Y') $oModuleController->clearDefaultModule();
|
||||
|
||||
// module_srl의 값에 따라 insert/update
|
||||
if(!$args->module_srl) {
|
||||
// 블로그 등록
|
||||
$output = $oModuleController->insertModule($args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 글작성, 파일첨부, 댓글 파일첨부, 관리에 대한 권한 지정
|
||||
if($output->toBool()) {
|
||||
$oMemberModel = &getModel('member');
|
||||
$admin_group = $oMemberModel->getAdminGroup();
|
||||
$admin_group_srl = $admin_group->group_srl;
|
||||
|
||||
$module_srl = $output->get('module_srl');
|
||||
$grants = serialize(array('write_document'=>array($admin_group_srl), 'fileupload'=>array($admin_group_srl), 'comment_fileupload'=>array($admin_group_srl), 'manager'=>array($admin_group_srl)));
|
||||
|
||||
$output = $oModuleController->updateModuleGrant($module_srl, $grants);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// 레이아웃 등록
|
||||
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
|
||||
$layout_args->layout = 'blog';
|
||||
$layout_args->title = sprintf('%s - %s',$args->browser_title, $args->mid);
|
||||
$layout_args->layout_path = sprintf('./modules/blog/skins/%s/layout.html', $args->skin);
|
||||
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->insertLayout($layout_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 기본 카테고리 등록
|
||||
$category_args->module_srl = $module_srl;
|
||||
$category_args->category_srl = getNextSequence();
|
||||
$category_args->name = 'Story';
|
||||
$category_args->expand = 'N';
|
||||
$this->procBlogAdminInsertCategory($category_args);
|
||||
|
||||
$msg_code = 'success_registed';
|
||||
} else {
|
||||
// 블로그 데이터 수정
|
||||
$output = $oModuleController->updateModule($args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 레이아웃 수정
|
||||
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
|
||||
$layout_args->title = $args->browser_title;
|
||||
$layout_args->layout_path = sprintf('./modules/blog/skins/%s/layout.html', $args->skin);
|
||||
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->updateLayout($layout_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$msg_code = 'success_updated';
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->add('module_srl',$output->get('module_srl'));
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 블로그 삭제
|
||||
**/
|
||||
function procBlogAdminDeleteBlog() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 블로그 모듈 삭제
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->deleteModule($module_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 레이아웃 삭제
|
||||
$layout_args->layout_srl = $layout_args->module_srl = $module_srl;
|
||||
|
||||
$oLayoutController = &getController('layout');
|
||||
$output = $oLayoutController->deleteLayout($layout_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 블로그 카테고리 삭제
|
||||
$category_args->module_srl = $module_srl;
|
||||
$output = executeQuery('blog.deleteCategories', $category_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
@unlink( sprintf('./files/cache/blog_category/%d.xml.php', $module_srl) );
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$this->add('module','blog');
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리 추가
|
||||
**/
|
||||
function procBlogAdminInsertCategory($args = null) {
|
||||
// 입력할 변수 정리
|
||||
if(!$args) $args = Context::gets('module_srl','category_srl','parent_srl','name','expand','group_srls');
|
||||
|
||||
if($args->expand !="Y") $args->expand = "N";
|
||||
$args->group_srls = str_replace('|@|',',',$args->group_srls);
|
||||
$args->parent_srl = (int)$args->parent_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 이미 존재하는지를 확인
|
||||
$oBlogModel = &getModel('blog');
|
||||
$category_info = $oBlogModel->getCategoryInfo($args->category_srl);
|
||||
|
||||
// 존재하게 되면 update를 해준다
|
||||
if($category_info->category_srl == $args->category_srl) {
|
||||
$output = executeQuery('blog.updateCategory', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
$document_args->category_srl = $args->category_srl;
|
||||
$document_args->title = $args->name ;
|
||||
$output = $oDocumentController->updateCategory($document_args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 존재하지 않으면 insert를 해준다
|
||||
} else {
|
||||
$args->listorder = -1*$args->category_srl;
|
||||
$output = executeQuery('blog.insertCategory', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
$output = $oDocumentController->insertCategory($args->module_srl, $args->name, $args->category_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
// XML 파일을 갱신하고 위치을 넘겨 받음
|
||||
$xml_file = $this->makeXmlFile($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 procBlogAdminDeleteCategory() {
|
||||
// 변수 정리
|
||||
$args = Context::gets('module_srl','category_srl');
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$oBlogModel = &getModel('blog');
|
||||
|
||||
// 원정보를 가져옴
|
||||
$category_info = $oBlogModel->getCategoryInfo($args->category_srl);
|
||||
if($category_info->parent_srl) $parent_srl = $category_info->parent_srl;
|
||||
|
||||
// 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력
|
||||
$output = executeQuery('blog.getChildCategoryCount', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
if($output->data->count>0) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1, 'msg_cannot_delete_for_child');
|
||||
}
|
||||
|
||||
// DB에서 삭제
|
||||
$output = executeQuery("blog.deleteCategory", $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
$output = $oDocumentController->deleteCategory($args->category_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// XML 파일을 갱신하고 위치을 넘겨 받음
|
||||
$xml_file = $this->makeXmlFile($args->module_srl);
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
$this->add('xml_file', $xml_file);
|
||||
$this->add('category_srl', $parent_srl);
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리 이동
|
||||
**/
|
||||
function procBlogAdminMoveCategory() {
|
||||
$source_category_srl = Context::get('source_category_srl');
|
||||
$target_category_srl = Context::get('target_category_srl');
|
||||
|
||||
$oBlogModel = &getModel('blog');
|
||||
$target_category = $oBlogModel->getCategoryInfo($target_category_srl);
|
||||
$source_category = $oBlogModel->getCategoryInfo($source_category_srl);
|
||||
|
||||
// source_category에 target_category_srl의 parent_srl, listorder 값을 입력
|
||||
$source_args->category_srl = $source_category_srl;
|
||||
$source_args->parent_srl = $target_category->parent_srl;
|
||||
$source_args->listorder = $target_category->listorder;
|
||||
$output = executeQuery('blog.updateCategoryParent', $source_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// target_category의 listorder값을 +1해 준다
|
||||
$target_args->category_srl = $target_category_srl;
|
||||
$target_args->parent_srl = $target_category->parent_srl;
|
||||
$target_args->listorder = $target_category->listorder -1;
|
||||
$output = executeQuery('blog.updateCategoryParent', $target_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// xml파일 재생성
|
||||
$xml_file = $this->makeXmlFile($target_category->module_srl);
|
||||
|
||||
// return 변수 설정
|
||||
$this->add('xml_file', $xml_file);
|
||||
$this->add('source_category_srl', $source_category_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief xml 파일을 갱신
|
||||
* 관리자페이지에서 메뉴 구성 후 간혹 xml파일이 재생성 안되는 경우가 있는데\n
|
||||
* 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n
|
||||
* 개발 중간의 문제인 것 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능
|
||||
**/
|
||||
function procBlogAdminMakeXmlFile() {
|
||||
// 입력값을 체크
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// xml파일 재생성
|
||||
$xml_file = $this->makeXmlFile($module_srl);
|
||||
|
||||
// return 값 설정
|
||||
$this->add('xml_file',$xml_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 블로그 카테고리를 xml파일로 저장
|
||||
**/
|
||||
function makeXmlFile($module_srl) {
|
||||
// xml파일 생성시 필요한 정보가 없으면 그냥 return
|
||||
if(!$module_srl) return;
|
||||
|
||||
// 캐시 파일의 이름을 지정
|
||||
$xml_file = sprintf("./files/cache/blog_category/%s.xml.php", $module_srl);
|
||||
|
||||
// 모듈정보를 구해옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$this->module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
|
||||
// DB에서 module_srl 에 해당하는 메뉴 아이템 목록을 listorder순으로 구해옴
|
||||
$oBlogModel = &getModel('blog');
|
||||
$list = $oBlogModel->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 구성
|
||||
$list_count = count($list);
|
||||
for($i=0;$i<$list_count;$i++) {
|
||||
$node = $list[$i];
|
||||
$category_srl = $node->category_srl;
|
||||
$parent_srl = $node->parent_srl;
|
||||
|
||||
$tree[$parent_srl][$category_srl] = $node;
|
||||
}
|
||||
|
||||
// xml 캐시 파일 생성
|
||||
$xml_buff = sprintf('<?php 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>', $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);
|
||||
|
||||
// 변수 정리
|
||||
$name = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->name);
|
||||
$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" ',
|
||||
$category_srl,
|
||||
$group_check_code,
|
||||
$name,
|
||||
getUrl('','mid',$this->module_info->mid,'category',$category_srl),
|
||||
$expand
|
||||
);
|
||||
|
||||
if($child_buff) $buff .= sprintf('<node %s>%s</node>', $attribute, $child_buff);
|
||||
else $buff .= sprintf('<node %s />', $attribute);
|
||||
}
|
||||
return $buff;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -78,50 +78,5 @@
|
|||
return $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 카테고리의 정보를 이용하여 템플릿을 구한후 return
|
||||
* 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return
|
||||
**/
|
||||
function getBlogAdminCategoryTplInfo() {
|
||||
// 해당 메뉴의 정보를 가져오기 위한 변수 설정
|
||||
$category_srl = Context::get('category_srl');
|
||||
$parent_srl = Context::get('parent_srl');
|
||||
|
||||
// 회원 그룹의 목록을 가져옴
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
// parent_srl이 있고 category_srl 이 없으면 하부 메뉴 추가임
|
||||
if(!$category_srl && $parent_srl) {
|
||||
// 상위 메뉴의 정보를 가져옴
|
||||
$parent_info = $this->getCategoryInfo($parent_srl);
|
||||
|
||||
// 추가하려는 메뉴의 기본 변수 설정
|
||||
$category_info->category_srl = getNextSequence();
|
||||
$category_info->parent_srl = $parent_srl;
|
||||
$category_info->parent_category_name = $parent_info->name;
|
||||
|
||||
// root에 메뉴 추가하거나 기존 메뉴의 수정일 경우
|
||||
} else {
|
||||
// category_srl 이 있으면 해당 메뉴의 정보를 가져온다
|
||||
if($category_srl) $category_info = $this->getCategoryInfo($category_srl);
|
||||
|
||||
// 찾아진 값이 없다면 신규 메뉴 추가로 보고 category_srl값만 구해줌
|
||||
if(!$category_info->category_srl) {
|
||||
$category_info->category_srl = getNextSequence();
|
||||
}
|
||||
}
|
||||
|
||||
Context::set('category_info', $category_info);
|
||||
|
||||
// template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다.
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
$tpl = $oTemplate->compile($this->module_path.'tpl', 'category_info');
|
||||
|
||||
// return 할 변수 설정
|
||||
$this->add('tpl', $tpl);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -13,48 +13,6 @@
|
|||
* blog 모듈은 일반 사용과 관리자용으로 나누어진다.\n
|
||||
**/
|
||||
function init() {
|
||||
if(substr_count($this->act, 'Admin')) $this->initAdmin();
|
||||
else $this->initNormal();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 act 호출시에 관련 정보들 세팅해줌
|
||||
**/
|
||||
function initAdmin() {
|
||||
// module_srl이 있으면 미리 체크하여 존재하는 모듈이면 module_info 세팅
|
||||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl && $this->module_srl) {
|
||||
$module_srl = $this->module_srl;
|
||||
Context::set('module_srl', $module_srl);
|
||||
}
|
||||
|
||||
// module model 객체 생성
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// module_srl이 넘어오면 해당 모듈의 정보를 미리 구해 놓음
|
||||
if($module_srl) {
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if($module_info->module_srl == $module_srl) {
|
||||
$this->module_info = $module_info;
|
||||
Context::set('module_info',$module_info);
|
||||
}
|
||||
}
|
||||
|
||||
// 모듈 카테고리 목록을 구함
|
||||
$module_category = $oModuleModel->getModuleCategories();
|
||||
Context::set('module_category', $module_category);
|
||||
|
||||
// 만약 블로그 서비스 페이지에서 관리자 기능 호출시 관련 정보를 위해서 initNoraml() method 호출
|
||||
if($this->mid) $this->initNormal();
|
||||
|
||||
// 템플릿 경로 지정 (blog의 경우 tpl에 관리자용 템플릿 모아놓음)
|
||||
$this->setTemplatePath($this->module_path."tpl");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 일반 블로그 호출시에 관련 정보를 세팅해줌
|
||||
**/
|
||||
function initNormal() {
|
||||
// 템플릿에서 사용할 변수를 Context::set()
|
||||
if($this->module_srl) Context::set('module_srl',$this->module_srl);
|
||||
|
||||
|
|
@ -408,162 +366,5 @@
|
|||
Context::set('comment_editor', $comment_editor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 블로그 관리 목록 보여줌
|
||||
**/
|
||||
function dispBlogAdminContent() {
|
||||
// 등록된 blog 모듈을 불러와 세팅
|
||||
$args->sort_index = "module_srl";
|
||||
$args->page = Context::get('page');
|
||||
$args->list_count = 40;
|
||||
$args->page_count = 10;
|
||||
$args->s_module_category_srl = Context::get('module_category_srl');
|
||||
$output = executeQuery('blog.getBlogList', $args);
|
||||
|
||||
// 템플릿에 쓰기 위해서 context::set
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('blog_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 선택된 블로그의 정보 출력
|
||||
**/
|
||||
function dispBlogAdminBlogInfo() {
|
||||
|
||||
// module_srl 값이 없다면 그냥 index 페이지를 보여줌
|
||||
if(!Context::get('module_srl')) return $this->dispBlogAdminContent();
|
||||
|
||||
// 레이아웃이 정해져 있다면 레이아웃 정보를 추가해줌(layout_title, layout)
|
||||
if($this->module_info->layout_srl) {
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($this->module_info->layout_srl);
|
||||
$this->module_info->layout = $layout_info->layout;
|
||||
$this->module_info->layout_title = $layout_info->layout_title;
|
||||
}
|
||||
|
||||
// 정해진 스킨이 있으면 해당 스킨의 정보를 구함
|
||||
if($this->module_info->skin) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $this->module_info->skin);
|
||||
$this->module_info->skin_title = $skin_info->title;
|
||||
}
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('blog_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 블로그 추가 폼 출력
|
||||
**/
|
||||
function dispBlogAdminInsertBlog() {
|
||||
|
||||
// 스킨 목록을 구해옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_list = $oModuleModel->getSkins($this->module_path);
|
||||
Context::set('skin_list',$skin_list);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('blog_insert');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 블로그 삭제 화면 출력
|
||||
**/
|
||||
function dispBlogAdminDeleteBlog() {
|
||||
|
||||
if(!Context::get('module_srl')) return $this->dispBlogAdminContent();
|
||||
|
||||
$module_info = Context::get('module_info');
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$document_count = $oDocumentModel->getDocumentCount($module_info->module_srl);
|
||||
$module_info->document_count = $document_count;
|
||||
|
||||
Context::set('module_info',$module_info);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('blog_delete');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스킨 정보 보여줌
|
||||
**/
|
||||
function dispBlogAdminSkinInfo() {
|
||||
|
||||
// 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
|
||||
$module_info = Context::get('module_info');
|
||||
$skin = $module_info->skin;
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
// skin_info에 extra_vars 값을 지정
|
||||
if(count($skin_info->extra_vars)) {
|
||||
foreach($skin_info->extra_vars as $key => $val) {
|
||||
$name = $val->name;
|
||||
$type = $val->type;
|
||||
$value = $module_info->{$name};
|
||||
if($type=="checkbox"&&!$value) $value = array();
|
||||
$skin_info->extra_vars[$key]->value= $value;
|
||||
}
|
||||
}
|
||||
|
||||
// skin_info에 menu값을 지정
|
||||
if(count($skin_info->menu)) {
|
||||
foreach($skin_info->menu as $key => $val) {
|
||||
if($module_info->{$key}) $skin_info->menu->{$key}->menu_srl = $module_info->{$key};
|
||||
}
|
||||
}
|
||||
|
||||
// 메뉴를 가져옴
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_list = $oMenuModel->getMenus();
|
||||
Context::set('menu_list', $menu_list);
|
||||
|
||||
Context::set('skin_info', $skin_info);
|
||||
$this->setTemplateFile('skin_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리의 정보 출력
|
||||
**/
|
||||
function dispBlogAdminCategoryInfo() {
|
||||
// module_srl을 구함
|
||||
$module_srl = $this->module_info->module_srl;
|
||||
|
||||
// 카테고리 정보를 가져옴
|
||||
$oBlogModel = &getModel('blog');
|
||||
$category_info = $oBlogModel->getCategory($module_srl);
|
||||
|
||||
Context::set('category_info', $category_info);
|
||||
Context::addJsFile('./common/js/tree_menu.js');
|
||||
|
||||
$this->setTemplateFile('category_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 권한 목록 출력
|
||||
**/
|
||||
function dispBlogAdminGrantInfo() {
|
||||
// module_srl을 구함
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// module.xml에서 권한 관련 목록을 구해옴
|
||||
$grant_list = $this->xml_info->grant;
|
||||
Context::set('grant_list', $grant_list);
|
||||
|
||||
// 권한 그룹의 목록을 가져온다
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
$this->setTemplateFile('grant_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
<!--%import("filter/insert_comment.xml")-->
|
||||
<!--%import("js/blog.js")-->
|
||||
|
||||
<!--@if($source_comment)-->
|
||||
<!--#include("header.html")-->
|
||||
<!--%import("js/blog.js")-->
|
||||
<!--@end-->
|
||||
|
||||
<!-- 만약 댓글의 답을 다는 것이라면 원문 보여줌 -->
|
||||
<!--@if($source_comment)-->
|
||||
<!--%import("filter/insert_comment.xml")-->
|
||||
<div>
|
||||
<table border="1" width="100%">
|
||||
<col width="120" />
|
||||
|
|
@ -29,7 +30,7 @@
|
|||
<!-- 글쓰기 폼 -->
|
||||
<form action="./" method="post" onsubmit="return procFilter(this, insert_comment)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end-->>
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl}" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl?$document_srl:$comment->document_srl}" />
|
||||
<input type="hidden" name="comment_srl" value="{$comment_srl}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($comment->content)}" />
|
||||
<input type="hidden" name="parent_srl" value="{$parent_srl}" />
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
$oModuleController->insertActionForward('board', 'controller', 'procBoardAdminUpdateSkinInfo');
|
||||
|
||||
// 기본 게시판 생성
|
||||
// 설치된 기본 모듈이 있는지 확인
|
||||
$output = executeQuery('module.getDefaultMidInfo');
|
||||
if($output->data) return new Object();
|
||||
|
||||
|
|
@ -43,7 +42,7 @@
|
|||
$args->skin = 'default';
|
||||
|
||||
// 게시판 controller 생성
|
||||
$oBoardController = &getController('board');
|
||||
$oBoardController = &getAdminController('board');
|
||||
$oBoardController->procBoardAdminInsertBoard($args);
|
||||
|
||||
return new Object();
|
||||
|
|
|
|||
|
|
@ -217,306 +217,5 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자가 글 선택시 세션에 담음
|
||||
**/
|
||||
function procBoardAdminAddCart() {
|
||||
$document_srl = Context::get('srl');
|
||||
$check_flag = Context::get('check_flag');
|
||||
if(!$document_srl || !in_array($check_flag, array('add','remove'))) return;
|
||||
|
||||
$flag_list = $_SESSION['document_management'][$this->module_srl];
|
||||
|
||||
if($check_flag == 'remove') unset($flag_list[$document_srl]);
|
||||
else $flag_list[$document_srl] = true;
|
||||
|
||||
$_SESSION['document_management'][$this->module_srl] = $flag_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 세션에 담긴 선택글의 이동/ 삭제
|
||||
**/
|
||||
function procBoardAdminManageCheckedDocument() {
|
||||
$type = Context::get('type');
|
||||
$module_srl = Context::get('target_board');
|
||||
$flag_list = $_SESSION['document_management'][$this->module_srl];
|
||||
|
||||
$document_srl_list = array_keys($flag_list);
|
||||
|
||||
$oDocumentController = &getController('document');
|
||||
$document_srl_count = count($document_srl_list);
|
||||
|
||||
if($type == 'move') {
|
||||
if(!$module_srl) return new Object(-1, 'fail_to_move');
|
||||
else {
|
||||
$output = $oDocumentController->moveDocumentModule($document_srl_list, $module_srl, $this->module_srl);
|
||||
if(!$output->toBool()) return new Object(-1, 'fail_to_move');
|
||||
$msg_code = 'success_moved';
|
||||
$_SESSION['document_management'][$this->module_srl] = null;
|
||||
}
|
||||
|
||||
} elseif($type =='delete') {
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
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'][$this->module_srl] = null;
|
||||
}
|
||||
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 권한 추가
|
||||
**/
|
||||
function procBoardAdminInsertGrant() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 현 모듈의 권한 목록을 가져옴
|
||||
$grant_list = $this->xml_info->grant;
|
||||
|
||||
if(count($grant_list)) {
|
||||
foreach($grant_list as $key => $val) {
|
||||
$group_srls = Context::get($key);
|
||||
if($group_srls) $arr_grant[$key] = explode('|@|',$group_srls);
|
||||
}
|
||||
$grants = serialize($arr_grant);
|
||||
}
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleGrant($module_srl, $grants);
|
||||
|
||||
$this->add('module_srl',Context::get('module_srl'));
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스킨 정보 업데이트
|
||||
**/
|
||||
function procBoardAdminUpdateSkinInfo() {
|
||||
// module_srl에 해당하는 정보들을 가져오기
|
||||
$module_srl = Context::get('module_srl');
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
$skin = $module_info->skin;
|
||||
|
||||
// 스킨의 정보르 구해옴 (extra_vars를 체크하기 위해서)
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
// 입력받은 변수들을 체크 (mo, act, module_srl, page등 기본적인 변수들 없앰)
|
||||
$obj = Context::getRequestVars();
|
||||
unset($obj->act);
|
||||
unset($obj->module_srl);
|
||||
unset($obj->page);
|
||||
|
||||
// 원 skin_info에서 extra_vars의 type이 image일 경우 별도 처리를 해줌
|
||||
if($skin_info->extra_vars) {
|
||||
foreach($skin_info->extra_vars as $vars) {
|
||||
if($vars->type!='image') continue;
|
||||
|
||||
$image_obj = $obj->{$vars->name};
|
||||
|
||||
// 삭제 요청에 대한 변수를 구함
|
||||
$del_var = $obj->{"del_".$vars->name};
|
||||
unset($obj->{"del_".$vars->name});
|
||||
if($del_var == 'Y') {
|
||||
@unlink($module_info->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 업로드 되지 않았다면 이전 데이터를 그대로 사용
|
||||
if(!$image_obj['tmp_name']) {
|
||||
$obj->{$vars->name} = $module_info->{$vars->name};
|
||||
continue;
|
||||
}
|
||||
|
||||
// 정상적으로 업로드된 파일이 아니면 무시
|
||||
if(!is_uploaded_file($image_obj['tmp_name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
if(!eregi("\.(jpg|jpeg|gif|png)$", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 경로를 정해서 업로드
|
||||
$path = sprintf("./files/attach/images/%s/", $module_srl);
|
||||
|
||||
// 디렉토리 생성
|
||||
if(!FileHandler::makeDir($path)) return false;
|
||||
|
||||
$filename = $path.$image_obj['name'];
|
||||
|
||||
// 파일 이동
|
||||
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 변수를 바꿈
|
||||
unset($obj->{$vars->name});
|
||||
$obj->{$vars->name} = $filename;
|
||||
}
|
||||
}
|
||||
|
||||
// serialize하여 저장
|
||||
$skin_vars = serialize($obj);
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->updateModuleSkinVars($module_srl, $skin_vars);
|
||||
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('default_layout.html');
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile("top_refresh.html");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 게시판 추가
|
||||
**/
|
||||
function procBoardAdminInsertBoard($args = null) {
|
||||
// 일단 입력된 값들을 모두 받아서 db 입력항목과 그외 것으로 분리
|
||||
if(!$args) {
|
||||
$args = Context::gets('module_srl','module_category_srl','board_name','layout_srl','skin','browser_title','description','is_default','header_text','footer_text','admin_id','open_rss');
|
||||
}
|
||||
|
||||
$args->module = 'board';
|
||||
$args->mid = $args->board_name;
|
||||
unset($args->board_name);
|
||||
if($args->is_default!='Y') $args->is_default = 'N';
|
||||
|
||||
// 기본 값외의 것들을 정리
|
||||
$extra_var = delObjectVars(Context::getRequestVars(), $args);
|
||||
if($extra_var->use_category!='Y') $extra_var->use_category = 'N';
|
||||
unset($extra_var->act);
|
||||
unset($extra_var->page);
|
||||
unset($extra_var->board_name);
|
||||
|
||||
// module_srl이 넘어오면 원 모듈이 있는지 확인
|
||||
if($args->module_srl) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
|
||||
|
||||
// 만약 원래 모듈이 없으면 새로 입력하기 위한 처리
|
||||
if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
|
||||
}
|
||||
|
||||
// $extra_var를 serialize
|
||||
$args->extra_vars = serialize($extra_var);
|
||||
|
||||
// module 모듈의 controller 객체 생성
|
||||
$oModuleController = &getController('module');
|
||||
|
||||
// is_default=='Y' 이면
|
||||
if($args->is_default=='Y') $oModuleController->clearDefaultModule();
|
||||
|
||||
// module_srl의 값에 따라 insert/update
|
||||
if(!$args->module_srl) {
|
||||
$output = $oModuleController->insertModule($args);
|
||||
$msg_code = 'success_registed';
|
||||
|
||||
// 파일업로드, 댓글 파일업로드, 관리에 대한 권한 지정
|
||||
if($output->toBool()) {
|
||||
$oMemberModel = &getModel('member');
|
||||
$admin_group = $oMemberModel->getAdminGroup();
|
||||
$admin_group_srl = $admin_group->group_srl;
|
||||
|
||||
$module_srl = $output->get('module_srl');
|
||||
$grants = serialize(array('fileupload'=>array($admin_group_srl), 'comment_fileupload'=>array($admin_group_srl), 'manager'=>array($admin_group_srl)));
|
||||
|
||||
$oModuleController->updateModuleGrant($module_srl, $grants);
|
||||
}
|
||||
} else {
|
||||
$output = $oModuleController->updateModule($args);
|
||||
$msg_code = 'success_updated';
|
||||
}
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->add('module_srl',$output->get('module_srl'));
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 게시판 삭제
|
||||
**/
|
||||
function procBoardAdminDeleteBoard() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 원본을 구해온다
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->deleteModule($module_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('module','board');
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->setMessage('success_deleted');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리 추가
|
||||
**/
|
||||
function procBoardAdminInsertCategory() {
|
||||
// 일단 입력된 값들을 모두 받아서 db 입력항목과 그외 것으로 분리
|
||||
$module_srl = Context::get('module_srl');
|
||||
$category_title = Context::get('category_title');
|
||||
|
||||
// module_srl이 있으면 원본을 구해온다
|
||||
$oDocumentController = &getController('document');
|
||||
$output = $oDocumentController->insertCategory($module_srl, $category_title);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->add('module_srl',$module_srl);
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리의 내용 수정
|
||||
**/
|
||||
function procBoardAdminUpdateCategory() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
$category_srl = Context::get('category_srl');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
switch($mode) {
|
||||
case 'up' :
|
||||
$output = $oDocumentController->moveCategoryUp($category_srl);
|
||||
$msg_code = 'success_moved';
|
||||
break;
|
||||
case 'down' :
|
||||
$output = $oDocumentController->moveCategoryDown($category_srl);
|
||||
$msg_code = 'success_moved';
|
||||
break;
|
||||
case 'delete' :
|
||||
$output = $oDocumentController->deleteCategory($category_srl);
|
||||
$msg_code = 'success_deleted';
|
||||
break;
|
||||
case 'update' :
|
||||
$selected_category = $oDocumentModel->getCategory($category_srl);
|
||||
$args->category_srl = $selected_category->category_srl;
|
||||
$args->title = Context::get('category_title');
|
||||
$args->list_order = $selected_category->list_order;
|
||||
$output = $oDocumentController->updateCategory($args);
|
||||
$msg_code = 'success_updated';
|
||||
break;
|
||||
}
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('module_srl', $module_srl);
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -13,49 +13,6 @@
|
|||
* board 모듈은 일반 사용과 관리자용으로 나누어진다.\n
|
||||
**/
|
||||
function init() {
|
||||
if(substr_count($this->act, 'Admin')) $this->initAdmin();
|
||||
else $this->initNormal();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 act 호출시에 관련 정보들 세팅해줌
|
||||
**/
|
||||
function initAdmin() {
|
||||
// module_srl이 있으면 미리 체크하여 존재하는 모듈이면 module_info 세팅
|
||||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl && $this->module_srl) {
|
||||
$module_srl = $this->module_srl;
|
||||
Context::set('module_srl', $module_srl);
|
||||
}
|
||||
|
||||
// module model 객체 생성
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// module_srl이 넘어오면 해당 모듈의 정보를 미리 구해 놓음
|
||||
if($module_srl) {
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$module_info) {
|
||||
Context::set('module_srl','');
|
||||
$this->act = 'list';
|
||||
} else {
|
||||
$this->module_info = $module_info;
|
||||
Context::set('module_info',$module_info);
|
||||
}
|
||||
}
|
||||
|
||||
// 모듈 카테고리 목록을 구함
|
||||
$module_category = $oModuleModel->getModuleCategories();
|
||||
Context::set('module_category', $module_category);
|
||||
|
||||
// 템플릿 경로 지정 (board의 경우 tpl에 관리자용 템플릿 모아놓음)
|
||||
$template_path = sprintf("%stpl/",$this->module_path);
|
||||
$this->setTemplatePath($template_path);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 일반 게시판 호출시에 관련 정보를 세팅해줌
|
||||
**/
|
||||
function initNormal() {
|
||||
// 카테고리를 사용하는지 확인후 사용시 카테고리 목록을 구해와서 Context에 세팅
|
||||
if($this->module_info->use_category=='Y') {
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
|
@ -370,198 +327,5 @@
|
|||
Context::set('comment_editor', $comment_editor);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 게시판 관리 목록 보여줌
|
||||
**/
|
||||
function dispBoardAdminContent() {
|
||||
// 등록된 board 모듈을 불러와 세팅
|
||||
$args->sort_index = "module_srl";
|
||||
$args->page = Context::get('page');
|
||||
$args->list_count = 40;
|
||||
$args->page_count = 10;
|
||||
$args->s_module_category_srl = Context::get('module_category_srl');
|
||||
$output = executeQuery('board.getBoardList', $args);
|
||||
|
||||
// 템플릿에 쓰기 위해서 context::set
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('board_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 선택된 게시판의 정보 출력
|
||||
**/
|
||||
function dispBoardAdminBoardInfo() {
|
||||
|
||||
// module_srl 값이 없다면 그냥 index 페이지를 보여줌
|
||||
if(!Context::get('module_srl')) return $this->dispBoardAdminContent();
|
||||
|
||||
// 레이아웃이 정해져 있다면 레이아웃 정보를 추가해줌(layout_title, layout)
|
||||
if($this->module_info->layout_srl) {
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($this->module_info->layout_srl);
|
||||
$this->module_info->layout = $layout_info->layout;
|
||||
$this->module_info->layout_title = $layout_info->layout_title;
|
||||
}
|
||||
|
||||
// 정해진 스킨이 있으면 해당 스킨의 정보를 구함
|
||||
if($this->module_info->skin) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $this->module_info->skin);
|
||||
$this->module_info->skin_title = $skin_info->title;
|
||||
}
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('board_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 게시판 추가 폼 출력
|
||||
**/
|
||||
function dispBoardAdminInsertBoard() {
|
||||
|
||||
// 스킨 목록을 구해옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_list = $oModuleModel->getSkins($this->module_path);
|
||||
Context::set('skin_list',$skin_list);
|
||||
|
||||
// 레이아웃 목록을 구해옴
|
||||
$oLayoutMode = &getModel('layout');
|
||||
$layout_list = $oLayoutMode->getLayoutList();
|
||||
Context::set('layout_list', $layout_list);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('board_insert');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 게시판 삭제 화면 출력
|
||||
**/
|
||||
function dispBoardAdminDeleteBoard() {
|
||||
|
||||
if(!Context::get('module_srl')) return $this->dispBoardAdminContent();
|
||||
|
||||
$module_info = Context::get('module_info');
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$document_count = $oDocumentModel->getDocumentCount($module_info->module_srl);
|
||||
$module_info->document_count = $document_count;
|
||||
|
||||
Context::set('module_info',$module_info);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('board_delete');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스킨 정보 보여줌
|
||||
**/
|
||||
function dispBoardAdminSkinInfo() {
|
||||
|
||||
// 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
|
||||
$module_info = Context::get('module_info');
|
||||
$skin = $module_info->skin;
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
|
||||
|
||||
// skin_info에 extra_vars 값을 지정
|
||||
if(count($skin_info->extra_vars)) {
|
||||
foreach($skin_info->extra_vars as $key => $val) {
|
||||
$name = $val->name;
|
||||
$type = $val->type;
|
||||
$value = $module_info->{$name};
|
||||
if($type=="checkbox"&&!$value) $value = array();
|
||||
$skin_info->extra_vars[$key]->value= $value;
|
||||
}
|
||||
}
|
||||
|
||||
Context::set('skin_info', $skin_info);
|
||||
$this->setTemplateFile('skin_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리의 정보 출력
|
||||
**/
|
||||
function dispBoardAdminCategoryInfo() {
|
||||
|
||||
// module_srl을 구함
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// 카테고리의 목록을 구해옴
|
||||
$oDocumentModel = &getModel('document');
|
||||
$category_list = $oDocumentModel->getCategoryList($module_srl);
|
||||
Context::set('category_list', $category_list);
|
||||
|
||||
// 수정하려는 카테고리가 있다면해당 카테고리의 정보를 가져옴
|
||||
$category_srl = Context::get('category_srl');
|
||||
|
||||
if($category_srl) {
|
||||
|
||||
$selected_category = $oDocumentModel->getCategory($category_srl);
|
||||
|
||||
if(!$selected_category) Context::set('category_srl','');
|
||||
else Context::set('selected_category',$selected_category);
|
||||
|
||||
$this->setTemplateFile('category_update_form');
|
||||
|
||||
} else {
|
||||
|
||||
$this->setTemplateFile('category_list');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 권한 목록 출력
|
||||
**/
|
||||
function dispBoardAdminGrantInfo() {
|
||||
// module_srl을 구함
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// module.xml에서 권한 관련 목록을 구해옴
|
||||
$grant_list = $this->xml_info->grant;
|
||||
Context::set('grant_list', $grant_list);
|
||||
|
||||
// 권한 그룹의 목록을 가져온다
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $group_list);
|
||||
|
||||
$this->setTemplateFile('grant_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 선택한 목록 출력
|
||||
**/
|
||||
function dispBoardAdminManageDocument() {
|
||||
// 선택한 목록을 세션에서 가져옴
|
||||
$flag_list = $_SESSION['document_management'][$this->module_srl];
|
||||
|
||||
// 목록이 있으면 게시글을 가져옴
|
||||
if(count($flag_list)) $document_srl_list = array_keys($flag_list);
|
||||
if(is_array($document_srl_list) && count($document_srl_list)) {
|
||||
$oDocumentModeul = &getModel('document');
|
||||
$document_list = $oDocumentModeul->getDocuments($document_srl_list, $this->grant->is_admin);
|
||||
Context::set('document_list', $document_list);
|
||||
}
|
||||
|
||||
// 게시판의 목록을 가져옴
|
||||
$output = executeQuery('board.getAllBoard', $args);
|
||||
$board_list = $output->data;
|
||||
if($board_list && !is_array($board_list)) $board_list = array($board_list);
|
||||
Context::set('board_list', $board_list);
|
||||
|
||||
// 팝업 레이아웃 선택
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
$this->setTemplateFile('checked_list');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
<!--%import("filter/insert_comment.xml")-->
|
||||
<!--%import("js/board.js")-->
|
||||
|
||||
<!--@if($source_comment)-->
|
||||
<!--#include("header.html")-->
|
||||
<!--@else-->
|
||||
<!--%import("js/board.js")-->
|
||||
<!--@end-->
|
||||
|
||||
<!-- 만약 댓글의 답을 다는 것이라면 원문 보여줌 -->
|
||||
|
|
@ -31,7 +30,7 @@
|
|||
<!-- 글쓰기 폼 -->
|
||||
<form action="./" method="post" onsubmit="return procFilter(this, insert_comment)" <!--@if($grant->fileupload)-->enctype="multipart/form-data"<!--@end-->>
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl}" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl?$document_srl:$comment->document_srl}" />
|
||||
<input type="hidden" name="comment_srl" value="{$comment_srl}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($comment->content)}" />
|
||||
<input type="hidden" name="parent_srl" value="{$parent_srl}" />
|
||||
|
|
|
|||
|
|
@ -13,30 +13,6 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 댓글들을 삭제
|
||||
**/
|
||||
function procCommentAdminDeleteChecked() {
|
||||
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
$comment_srl_list= explode('|@|', $cart);
|
||||
$comment_count = count($comment_srl_list);
|
||||
if(!$comment_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$comment_count;$i++) {
|
||||
$comment_srl = trim($comment_srl_list[$i]);
|
||||
if(!$comment_srl) continue;
|
||||
|
||||
$output = $this->deleteComment($comment_srl, true);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $comment_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 코멘트의 권한 부여
|
||||
* 세션값으로 현 접속상태에서만 사용 가능
|
||||
|
|
@ -257,13 +233,5 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 모듈의 모든 댓글 삭제
|
||||
**/
|
||||
function deleteModuleComments($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('comment.deleteModuleComments', $args);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
<td>{$no}</td>
|
||||
<td><input type="checkbox" name="cart" value="{$val->comment_srl}" /></td>
|
||||
<td><a href="#" onclick="window.open('./?mid={$module_list[$val->module_srl]->mid}');return false">{htmlspecialchars($module_list[$val->module_srl]->browser_title)}</a></td>
|
||||
<td>{htmlspecialchars($val->user_name)}</td>
|
||||
<td><div class="member_{$val->member_srl}">{htmlspecialchars($val->nick_name)}</div></td>
|
||||
<td>{cut_str(strip_tags($val->content),50,'...')}</td>
|
||||
<td>{zdate($val->regdate,"Y-m-d")}</td>
|
||||
<td><!--@if($val->last_upgdate)-->{zdate($val->last_upgdate,"Y-m-d")}<!--@end--></td>
|
||||
|
|
|
|||
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
$oCounterController = &getController('counter');
|
||||
|
||||
// 00000000 일자로 기록될 전체 방문 기록 row 추가
|
||||
$oCounterController->insertTodayStatus('000000');
|
||||
// 0 일자로 기록될 전체 방문 기록 row 추가
|
||||
$oCounterController->insertTodayStatus('0');
|
||||
|
||||
// 오늘자 row입력
|
||||
$oCounterController->insertTodayStatus();
|
||||
|
|
|
|||
|
|
@ -13,28 +13,6 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 문서들 삭제
|
||||
**/
|
||||
function procDocumentAdminDeleteChecked() {
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
$document_srl_list= explode('|@|', $cart);
|
||||
$document_count = count($document_srl_list);
|
||||
if(!$document_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$document_count;$i++) {
|
||||
$document_srl = trim($document_srl_list[$i]);
|
||||
if(!$document_srl) continue;
|
||||
|
||||
$this->deleteDocument($document_srl, true);
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 문서의 권한 부여
|
||||
* 세션값으로 현 접속상태에서만 사용 가능
|
||||
|
|
@ -290,82 +268,6 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 게시물들의 소속 모듈 변경 (게시글 이동시에 사용)
|
||||
**/
|
||||
function moveDocumentModule($document_srl_list, $module_srl, $source_module_srl) {
|
||||
$args->document_srls = implode(',',$document_srl_list);
|
||||
$args->module_srl = $module_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// 게시물의 이동
|
||||
$output = executeQuery('document.updateDocumentModule', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 댓글의 이동
|
||||
$output = executeQuery('comment.updateCommentModule', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 엮인글의 이동
|
||||
$output = executeQuery('trackback.updateTrackbackModule', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 태그
|
||||
$output = executeQuery('tag.updateTagModule', $args);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
// 첨부파일의 이동 (다운로드나 본문 첨부의 문제로 인하여 첨부파일은 이동하지 않기로 결정. 차후에 다시 고민)
|
||||
/*
|
||||
$image_dir = sprintf('./files/attach/images/%s/%s/', $source_module_srl, $document_srl);
|
||||
$binary_dir = sprintf('./files/attach/binaries/%s/%s/', $source_module_srl, $document_srl);
|
||||
|
||||
$target_image_dir = sprintf('./files/attach/images/%s/%s/', $module_srl, $document_srl);
|
||||
$target_binary_dir = sprintf('./files/attach/binaries/%s/%s/', $module_srl, $document_srl);
|
||||
|
||||
if(is_dir($image_dir)) {
|
||||
FileHandler::moveDir($image_dir, $target_image_dir);
|
||||
if(!is_dir($target_image_dir)) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1,'fail');
|
||||
}
|
||||
}
|
||||
|
||||
if(is_dir($binary_dir)) {
|
||||
FileHandler::moveDir($binary_dir, $target_binary_dir);
|
||||
if(!is_dir($target_binary_dir)) {
|
||||
$oDB->rollback();
|
||||
return new Object(-1,'fail');
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$oDB->commit();
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 모듈의 전체 문서 삭제
|
||||
**/
|
||||
function deleteModuleDocument($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('document.deleteModuleDocument', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 해당 document의 조회수 증가
|
||||
**/
|
||||
|
|
@ -494,26 +396,6 @@
|
|||
return executeQuery('document.updateTrackbackCount', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
|
||||
return executeQuery('document.insertCategory', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리 정보 수정
|
||||
**/
|
||||
function updateCategory($args) {
|
||||
return executeQuery('document.updateCategory', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리에 문서의 숫자를 변경
|
||||
**/
|
||||
|
|
@ -526,121 +408,5 @@
|
|||
$args->document_count = $document_count;
|
||||
return executeQuery('document.updateCategoryCount', $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();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
$oModuleController->insertActionForward('editor', 'view', 'dispEditorAdminSetupComponent');
|
||||
|
||||
// 기본 에디터 컴포넌트를 추가
|
||||
$oEditorController = &getController('editor');
|
||||
$oEditorController = &getAdminController('editor');
|
||||
$oEditorController->insertComponent('colorpicker_text',true);
|
||||
$oEditorController->insertComponent('colorpicker_bg',true);
|
||||
$oEditorController->insertComponent('emoticon',true);
|
||||
|
|
|
|||
|
|
@ -66,88 +66,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컴포넌트의 활성화
|
||||
**/
|
||||
function procEditorAdminEnableComponent() {
|
||||
$args->component_name = Context::get('component_name');
|
||||
$args->enabled = 'Y';
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컴포넌트의 비활성화
|
||||
**/
|
||||
function procEditorAdminDisableComponent() {
|
||||
$args->component_name = Context::get('component_name');
|
||||
$args->enabled = 'N';
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컴포넌트의 위치 변경
|
||||
**/
|
||||
function procEditorAdminMoveListOrder() {
|
||||
$args->component_name = Context::get('component_name');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
// DB에서 전체 목록 가져옴
|
||||
$output = executeQuery('editor.getComponentList', $args);
|
||||
$db_list = $output->data;
|
||||
foreach($db_list as $key => $val) {
|
||||
if($val->component_name == $args->component_name) break;
|
||||
}
|
||||
|
||||
if($mode=="up") {
|
||||
if($key == 2) return new Object(-1,'msg_component_is_first_order');
|
||||
|
||||
$prev_args->component_name = $db_list[$key-1]->component_name;
|
||||
$prev_args->list_order = $db_list[$key]->list_order;
|
||||
executeQuery('editor.updateComponent', $prev_args);
|
||||
|
||||
$cur_args->component_name = $db_list[$key]->component_name;
|
||||
$cur_args->list_order = $db_list[$key-1]->list_order;
|
||||
executeQuery('editor.updateComponent', $cur_args);
|
||||
} else {
|
||||
if($key == count($db_list)-1) return new Object(-1,'msg_component_is_last_order');
|
||||
|
||||
$next_args->component_name = $db_list[$key+1]->component_name;
|
||||
$next_args->list_order = $db_list[$key]->list_order;
|
||||
executeQuery('editor.updateComponent', $next_args);
|
||||
|
||||
$cur_args->component_name = $db_list[$key]->component_name;
|
||||
$cur_args->list_order = $db_list[$key+1]->list_order;
|
||||
executeQuery('editor.updateComponent', $cur_args);
|
||||
}
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컴포넌트 설정
|
||||
**/
|
||||
function procEditorAdminSetupComponent() {
|
||||
$component_name = Context::get('component_name');
|
||||
$extra_vars = Context::getRequestVars();
|
||||
unset($extra_vars->component_name);
|
||||
unset($extra_vars->module);
|
||||
unset($extra_vars->act);
|
||||
|
||||
$args->component_name = $component_name;
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
|
||||
$output = executeQuery('editor.updateComponent', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 자동 저장된 글을 삭제
|
||||
* 현재 접속한 사용자를 기준
|
||||
|
|
@ -163,25 +81,5 @@
|
|||
// 일단 이전 저장본 삭제
|
||||
executeQuery('editor.deleteSavedDoc', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컴포넌트를 DB에 추가
|
||||
**/
|
||||
function insertComponent($component_name, $enabled = false) {
|
||||
if($enabled) $enabled = 'Y';
|
||||
else $enabled = 'N';
|
||||
|
||||
$args->component_name = $component_name;
|
||||
$args->enabled = $enabled;
|
||||
|
||||
// 컴포넌트가 있는지 확인
|
||||
$output = executeQuery('editor.isComponentInserted', $args);
|
||||
if($output->data->count) return new Object(-1, 'msg_component_is_not_founded');
|
||||
|
||||
// 입력
|
||||
$args->list_order = getNextSequence();
|
||||
$output = executeQuery('editor.insertComponent', $args);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -60,36 +60,5 @@
|
|||
$this->setTemplateFile('view_component');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 설정 페이지
|
||||
* 에디터 컴포넌트의 on/off 및 설정을 담당
|
||||
**/
|
||||
function dispEditorAdminIndex() {
|
||||
// 컴포넌트의 종류를 구해옴
|
||||
$oEditorModel = &getModel('editor');
|
||||
$component_list = $oEditorModel->getComponentList(false);
|
||||
|
||||
Context::set('component_list', $component_list);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('admin_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컴퍼넌트 setup
|
||||
**/
|
||||
function dispEditorAdminSetupComponent() {
|
||||
$component_name = Context::get('component_name');
|
||||
|
||||
$oEditorModel = &getModel('editor');
|
||||
$component = $oEditorModel->getComponent($component_name);
|
||||
Context::set('component', $component);
|
||||
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('setup_component');
|
||||
$this->setLayoutFile("popup_layout");
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -184,23 +184,6 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 모두의 첨부파일 모두 삭제
|
||||
**/
|
||||
function deleteModuleFiles($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('file.deleteModuleFiles', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 실제 파일 삭제
|
||||
$path[0] = sprintf("./files/attach/images/%s/", $module_srl);
|
||||
$path[1] = sprintf("./files/attach/binaries/%s/", $module_srl);
|
||||
FileHandler::removeDir($path[0]);
|
||||
FileHandler::removeDir($path[1]);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 글의 첨부파일을 다른 글로 이동
|
||||
**/
|
||||
|
|
@ -294,28 +277,6 @@
|
|||
$this->setTemplateFile('print_uploaded_file_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 파일들을 삭제
|
||||
**/
|
||||
function procFileAdminDeleteChecked() {
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
$file_srl_list= explode('|@|', $cart);
|
||||
$file_count = count($file_srl_list);
|
||||
if(!$file_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$file_count;$i++) {
|
||||
$file_srl = trim($file_srl_list[$i]);
|
||||
if(!$file_srl) continue;
|
||||
|
||||
$this->deleteFile($file_srl);
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_file_is_deleted'), $file_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 첨부파일 다운로드
|
||||
* 직접 요청을 받음
|
||||
|
|
@ -361,18 +322,5 @@
|
|||
fpassthru($fp);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 파일 기본 정보의 추가
|
||||
**/
|
||||
function procFileAdminInsertConfig() {
|
||||
// 기본 정보를 받음
|
||||
$args = Context::gets('allowed_filesize','allowed_attach_size','allowed_filetypes');
|
||||
|
||||
// module Controller 객체 생성하여 입력
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('file',$args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -79,59 +79,5 @@
|
|||
|
||||
return $file_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모든 첨부파일을 시간 역순으로 가져옴 (관리자용)
|
||||
**/
|
||||
function getFileList($obj) {
|
||||
// 검색 옵션 정리
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'filename' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_filename = $search_keyword;
|
||||
break;
|
||||
case 'filesize' :
|
||||
$args->s_filesize = (int)$search_keyword;
|
||||
break;
|
||||
case 'download_count' :
|
||||
$args->s_download_count = (int)$search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
$args->s_regdate = $search_keyword;
|
||||
break;
|
||||
case 'ipaddress' :
|
||||
$args->s_ipaddress= $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 유효/대기 상태 설정
|
||||
if($obj->isvalid == 'Y') $args->isvalid = 'Y';
|
||||
elseif($obj->isvalid == 'N') $args->isvalid = 'N';
|
||||
|
||||
// 변수 설정
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->page = $obj->page?$obj->page:1;
|
||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
|
||||
// file.getFileList쿼리 실행
|
||||
$output = executeQuery('file.getFileList', $args);
|
||||
|
||||
// 결과가 없거나 오류 발생시 그냥 return
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
foreach($output->data as $key => $file) {
|
||||
$file->download_url = $this->getDownloadUrl($file->file_srl, $file->sid);
|
||||
$output->data[$key] = $file;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
**/
|
||||
function init() {
|
||||
// 설치가 되어 있으면 오류
|
||||
if($this->act != 'procInstallAdminInstall' && Context::isInstalled()) return $this->dispMessage('msg_already_installed');
|
||||
if(Context::isInstalled()) return $this->dispMessage('msg_already_installed');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -49,18 +49,6 @@
|
|||
$this->setMessage('msg_install_completed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 설치
|
||||
**/
|
||||
function procInstallAdminInstall() {
|
||||
$module_name = Context::get('module_name');
|
||||
if(!$module_name) return new object(-1, 'invalid_request');
|
||||
|
||||
$this->installModule($module_name, './modules/'.$module_name);
|
||||
|
||||
$this->setMessage('success_installed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 인스톨 환경을 체크하여 결과 return
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -388,225 +388,6 @@
|
|||
return executeQuery('member.setMessageReaded', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 사용자 추가 (관리자용)
|
||||
**/
|
||||
function procMemberAdminInsert() {
|
||||
// 필수 정보들을 미리 추출
|
||||
$args = Context::gets('member_srl','user_id','user_name','nick_name','homepage','blog','birthday','email_address','password','allow_mailing','allow_message','denied','is_admin','description','group_srl_list');
|
||||
|
||||
// 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제
|
||||
$all_args = Context::getRequestVars();
|
||||
unset($all_args->module);
|
||||
unset($all_args->act);
|
||||
|
||||
// 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력
|
||||
$extra_vars = delObjectVars($all_args, $args);
|
||||
$args->extra_vars = serialize($extra_vars);
|
||||
|
||||
// member_srl이 넘어오면 원 회원이 있는지 확인
|
||||
if($args->member_srl) {
|
||||
// 멤버 모델 객체 생성
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 회원 정보 구하기
|
||||
$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
|
||||
|
||||
// 만약 원래 회원이 없으면 새로 입력하기 위한 처리
|
||||
if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
|
||||
}
|
||||
|
||||
// member_srl의 값에 따라 insert/update
|
||||
if(!$args->member_srl) {
|
||||
$output = $this->insertMember($args);
|
||||
$msg_code = 'success_registed';
|
||||
} else {
|
||||
$output = $this->updateMember($args);
|
||||
$msg_code = 'success_updated';
|
||||
}
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 서명 저장
|
||||
$signature = Context::get('signature');
|
||||
$this->putSignature($args->member_srl, $signature);
|
||||
|
||||
// 결과 리턴
|
||||
$this->add('member_srl', $args->member_srl);
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 사용자 삭제 (관리자용)
|
||||
**/
|
||||
function procMemberAdminDelete() {
|
||||
// 일단 입력된 값들을 모두 받아서 db 입력항목과 그외 것으로 분리
|
||||
$member_srl = Context::get('member_srl');
|
||||
|
||||
$output = $this->deleteMember($member_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->setMessage("success_deleted");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 관리용 기본 정보의 추가
|
||||
**/
|
||||
function procMemberAdminInsertConfig() {
|
||||
// 기본 정보를 받음
|
||||
$args = Context::gets('enable_join','limit_day','redirect_url','content','image_name','image_mark', 'image_name_max_width', 'image_name_max_height','image_mark_max_width','image_mark_max_height');
|
||||
if($args->enable_join!='Y') $args->enable_join = 'N';
|
||||
if($args->image_name!='Y') $args->image_name = 'N';
|
||||
if($args->image_mark!='Y') $args->image_mark = 'N';
|
||||
$args->limit_day = (int)$args->limit_day;
|
||||
$args->agreement = $args->content;
|
||||
unset($args->content);
|
||||
|
||||
// module Controller 객체 생성하여 입력
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('member',$args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 사용자 그룹 추가
|
||||
**/
|
||||
function procMemberAdminInsertGroup() {
|
||||
$args = Context::gets('title','description','is_default');
|
||||
$output = $this->insertGroup($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('group_srl','');
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 사용자 그룹 정보 수정
|
||||
**/
|
||||
function procMemberAdminUpdateGroup() {
|
||||
$group_srl = Context::get('group_srl');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
switch($mode) {
|
||||
case 'delete' :
|
||||
$output = $this->deleteGroup($group_srl);
|
||||
if(!$output->toBool()) return $output;
|
||||
$msg_code = 'success_deleted';
|
||||
break;
|
||||
case 'update' :
|
||||
$args = Context::gets('group_srl','title','description','is_default');
|
||||
$output = $this->updateGroup($args);
|
||||
if(!$output->toBool()) return $output;
|
||||
$msg_code = 'success_updated';
|
||||
break;
|
||||
}
|
||||
|
||||
$this->add('group_srl','');
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 가입 항목 추가
|
||||
**/
|
||||
function procMemberAdminInsertJoinForm() {
|
||||
$args->member_join_form_srl = Context::get('member_join_form_srl');
|
||||
|
||||
$args->column_type = Context::get('column_type');
|
||||
$args->column_name = Context::get('column_name');
|
||||
$args->column_title = Context::get('column_title');
|
||||
$args->default_value = explode('|@|', Context::get('default_value'));
|
||||
$args->is_active = Context::get('is_active');
|
||||
if(!in_array(strtoupper($args->is_active), array('Y','N'))) $args->is_active = 'N';
|
||||
$args->required = Context::get('required');
|
||||
if(!in_array(strtoupper($args->required), array('Y','N'))) $args->required = 'N';
|
||||
$args->description = Context::get('description');
|
||||
$args->list_order = getNextSequence();
|
||||
|
||||
// 기본값의 정리
|
||||
if(in_array($args->column_type, array('checkbox','select')) && count($args->default_value) ) {
|
||||
$args->default_value = serialize($args->default_value);
|
||||
} else {
|
||||
$args->default_value = '';
|
||||
}
|
||||
|
||||
// member_join_form_srl이 있으면 수정, 없으면 추가
|
||||
if(!$args->member_join_form_srl) $output = executeQuery('member.insertJoinForm', $args);
|
||||
else $output = executeQuery('member.updateJoinForm', $args);
|
||||
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('act','dispJoinForm');
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 가입 항목의 상/하 이동 및 내용 수정
|
||||
**/
|
||||
function procMemberAdminUpdateJoinForm() {
|
||||
$member_join_form_srl = Context::get('member_join_form_srl');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
switch($mode) {
|
||||
case 'up' :
|
||||
$output = $this->moveJoinFormUp($member_join_form_srl);
|
||||
$msg_code = 'success_moved';
|
||||
break;
|
||||
case 'down' :
|
||||
$output = $this->moveJoinFormDown($member_join_form_srl);
|
||||
$msg_code = 'success_moved';
|
||||
break;
|
||||
case 'delete' :
|
||||
$output = $this->deleteJoinForm($member_join_form_srl);
|
||||
$msg_code = 'success_deleted';
|
||||
break;
|
||||
case 'update' :
|
||||
break;
|
||||
}
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 아이디 추가
|
||||
**/
|
||||
function procMemberAdminInsertDeniedID() {
|
||||
$user_id = Context::get('user_id');
|
||||
$description = Context::get('description');
|
||||
|
||||
$oMemberController = &getController('member');
|
||||
$output = $oMemberController->insertDeniedID($user_id, $description);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->add('group_srl','');
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->setMessage('success_registed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 아이디 업데이트
|
||||
**/
|
||||
function procMemberAdminUpdateDeniedID() {
|
||||
$user_id = Context::get('user_id');
|
||||
$mode = Context::get('mode');
|
||||
|
||||
$oMemberController = &getController('member');
|
||||
|
||||
switch($mode) {
|
||||
case 'delete' :
|
||||
$output = $oMemberController->deleteDeniedID($user_id);
|
||||
if(!$output->toBool()) return $output;
|
||||
$msg_code = 'success_deleted';
|
||||
break;
|
||||
}
|
||||
|
||||
$this->add('page',Context::get('page'));
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 가입 or 정보 수정
|
||||
**/
|
||||
|
|
@ -843,21 +624,6 @@
|
|||
@unlink($filename);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자를 추가한다
|
||||
**/
|
||||
function insertAdmin($args) {
|
||||
// 관리자임을 설정
|
||||
$args->is_admin = 'Y';
|
||||
|
||||
// 관리자 그룹을 구해와서 설정
|
||||
$oMemberModel = &getModel('member');
|
||||
$admin_group = $oMemberModel->getAdminGroup();
|
||||
$args->group_srl_list = $admin_group->group_srl;
|
||||
|
||||
return $this->insertMember($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 로그인 시킴
|
||||
**/
|
||||
|
|
@ -1118,199 +884,6 @@
|
|||
return executeQuery('member.deleteMember', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief member_srl에 group_srl을 추가
|
||||
**/
|
||||
function addMemberToGroup($member_srl,$group_srl) {
|
||||
$args->member_srl = $member_srl;
|
||||
$args->group_srl = $group_srl;
|
||||
|
||||
// 추가
|
||||
return executeQuery('member.addMemberToGroup',$args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원의 그룹값을 변경
|
||||
**/
|
||||
function changeGroup($source_group_srl, $target_group_srl) {
|
||||
$args->source_group_srl = $source_group_srl;
|
||||
$args->target_group_srl = $target_group_srl;
|
||||
|
||||
return executeQuery('member.changeGroup', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 그룹 등록
|
||||
**/
|
||||
function insertGroup($args) {
|
||||
// is_default값을 체크, Y일 경우 일단 모든 is_default에 대해서 N 처리
|
||||
if($args->is_default!='Y') {
|
||||
$args->is_default = 'N';
|
||||
} else {
|
||||
$output = executeQuery('member.updateGroupDefaultClear');
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
return executeQuery('member.insertGroup', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 그룹 정보 수정
|
||||
**/
|
||||
function updateGroup($args) {
|
||||
// is_default값을 체크, Y일 경우 일단 모든 is_default에 대해서 N 처리
|
||||
if($args->is_default!='Y') $args->is_default = 'N';
|
||||
else {
|
||||
$output = executeQuery('member.updateGroupDefaultClear');
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
return executeQuery('member.updateGroup', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* 그룹 삭제
|
||||
**/
|
||||
function deleteGroup($group_srl) {
|
||||
// 멤버모델 객체 생성
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 삭제 대상 그룹을 가져와서 체크 (is_default == 'Y'일 경우 삭제 불가)
|
||||
$group_info = $oMemberModel->getGroup($group_srl);
|
||||
|
||||
if(!$group_info) return new Object(-1, 'lang->msg_not_founded');
|
||||
if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default');
|
||||
|
||||
// is_default == 'Y'인 그룹을 가져옴
|
||||
$default_group = $oMemberModel->getDefaultGroup();
|
||||
$default_group_srl = $default_group->group_srl;
|
||||
|
||||
// default_group_srl로 변경
|
||||
$this->changeGroup($group_srl, $default_group_srl);
|
||||
|
||||
$args->group_srl = $group_srl;
|
||||
return executeQuery('member.deleteGroup', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지아이디 등록
|
||||
**/
|
||||
function insertDeniedID($user_id, $desription = '') {
|
||||
$args->user_id = $user_id;
|
||||
$args->description = $description;
|
||||
$args->list_order = -1*getNextSequence();
|
||||
|
||||
return executeQuery('member.insertDeniedID', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지아이디 삭제
|
||||
**/
|
||||
function deleteDeniedID($user_id) {
|
||||
$args->user_id = $user_id;
|
||||
return executeQuery('member.deleteDeniedID', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 가입폼 항목을 삭제
|
||||
**/
|
||||
function deleteJoinForm($member_join_form_srl) {
|
||||
$args->member_join_form_srl = $member_join_form_srl;
|
||||
$output = executeQuery('member.deleteJoinForm', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 가입항목을 상단으로 이동
|
||||
**/
|
||||
function moveJoinFormUp($member_join_form_srl) {
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 선택된 가입항목의 정보를 구한다
|
||||
$args->member_join_form_srl = $member_join_form_srl;
|
||||
$output = executeQuery('member.getJoinForm', $args);
|
||||
|
||||
$join_form = $output->data;
|
||||
$list_order = $join_form->list_order;
|
||||
|
||||
// 전체 가입항목 목록을 구한다
|
||||
$join_form_list = $oMemberModel->getJoinFormList();
|
||||
$join_form_srl_list = array_keys($join_form_list);
|
||||
if(count($join_form_srl_list)<2) return new Object();
|
||||
|
||||
$prev_member_join_form = NULL;
|
||||
foreach($join_form_list as $key => $val) {
|
||||
if($val->member_join_form_srl == $member_join_form_srl) break;
|
||||
$prev_member_join_form = $val;
|
||||
}
|
||||
|
||||
// 이전 가입항목가 없으면 그냥 return
|
||||
if(!$prev_member_join_form) return new Object();
|
||||
|
||||
// 선택한 가입항목의 정보
|
||||
$cur_args->member_join_form_srl = $member_join_form_srl;
|
||||
$cur_args->list_order = $prev_member_join_form->list_order;
|
||||
|
||||
// 대상 가입항목의 정보
|
||||
$prev_args->member_join_form_srl = $prev_member_join_form->member_join_form_srl;
|
||||
$prev_args->list_order = $list_order;
|
||||
|
||||
// DB 처리
|
||||
$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
executeQuery('member.updateMemberJoinFormListorder', $prev_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 가입항목을 하단으로 이동
|
||||
**/
|
||||
function moveJoinFormDown($member_join_form_srl) {
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 선택된 가입항목의 정보를 구한다
|
||||
$args->member_join_form_srl = $member_join_form_srl;
|
||||
$output = executeQuery('member.getJoinForm', $args);
|
||||
|
||||
$join_form = $output->data;
|
||||
$list_order = $join_form->list_order;
|
||||
|
||||
// 전체 가입항목 목록을 구한다
|
||||
$join_form_list = $oMemberModel->getJoinFormList();
|
||||
$join_form_srl_list = array_keys($join_form_list);
|
||||
if(count($join_form_srl_list)<2) return new Object();
|
||||
|
||||
for($i=0;$i<count($join_form_srl_list);$i++) {
|
||||
if($join_form_srl_list[$i]==$member_join_form_srl) break;
|
||||
}
|
||||
|
||||
$next_member_join_form_srl = $join_form_srl_list[$i+1];
|
||||
|
||||
// 이전 가입항목가 없으면 그냥 return
|
||||
if(!$next_member_join_form_srl) return new Object();
|
||||
$next_member_join_form = $join_form_list[$next_member_join_form_srl];
|
||||
|
||||
// 선택한 가입항목의 정보
|
||||
$cur_args->member_join_form_srl = $member_join_form_srl;
|
||||
$cur_args->list_order = $next_member_join_form->list_order;
|
||||
|
||||
// 대상 가입항목의 정보
|
||||
$next_args->member_join_form_srl = $next_member_join_form->member_join_form_srl;
|
||||
$next_args->list_order = $list_order;
|
||||
|
||||
// DB 처리
|
||||
$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$output = executeQuery('member.updateMemberJoinFormListorder', $next_args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 최종 출력물에서 이미지 이름을 변경
|
||||
* member_extra_info 애드온에서 요청이 됨
|
||||
|
|
@ -1401,6 +974,5 @@
|
|||
}
|
||||
return sprintf('%08x%08x', $nr, $nr2);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -196,61 +196,6 @@
|
|||
return $logged_info->user_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 목록을 구함
|
||||
**/
|
||||
function getMemberList() {
|
||||
// 검색 옵션 정리
|
||||
$args->is_admin = Context::get('is_admin')=='Y'?'Y':'';
|
||||
$args->is_denied = Context::get('is_denied')=='Y'?'Y':'';
|
||||
$args->selected_group_srl = Context::get('selected_group_srl');
|
||||
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'user_id' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_id = $search_keyword;
|
||||
break;
|
||||
case 'user_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_user_name = $search_keyword;
|
||||
break;
|
||||
case 'nick_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_nick_name = $search_keyword;
|
||||
break;
|
||||
case 'email_address' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_email_address = $search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
$args->s_regdate = $search_keyword;
|
||||
break;
|
||||
case 'last_login' :
|
||||
$args->s_last_login = $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// selected_group_srl이 있으면 query id를 변경 (table join때문에)
|
||||
if($args->selected_group_srl) {
|
||||
$query_id = 'member.getMemberListWithinGroup';
|
||||
$args->sort_index = "member.member_srl";
|
||||
} else {
|
||||
$query_id = 'member.getMemberList';
|
||||
$args->sort_index = "member_srl";
|
||||
}
|
||||
|
||||
// 기타 변수들 정리
|
||||
$args->page = Context::get('page');
|
||||
$args->list_count = 40;
|
||||
$args->page_count = 10;
|
||||
return executeQuery($query_id, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief member_srl이 속한 group 목록을 가져옴
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -15,31 +15,6 @@
|
|||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
// 관리자 모듈에서 요청중이면 initAdmin(), 아니면 initNormal()
|
||||
if(Context::get('module')=='admin') $this->initAdmin();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지의 초기화
|
||||
**/
|
||||
function initAdmin() {
|
||||
// 멤버모델 객체 생성
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// member_srl이 있으면 미리 체크하여 member_info 세팅
|
||||
$member_srl = Context::get('member_srl');
|
||||
if($member_srl) {
|
||||
$this->member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
|
||||
if(!$this->member_info) Context::set('member_srl','');
|
||||
else Context::set('member_info',$this->member_info);
|
||||
}
|
||||
|
||||
// group 목록 가져오기
|
||||
$this->group_list = $oMemberModel->getGroups();
|
||||
Context::set('group_list', $this->group_list);
|
||||
|
||||
// template path 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -364,155 +339,5 @@
|
|||
$this->setTemplateFile('add_friend_group');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 목록 출력
|
||||
**/
|
||||
function dispMemberAdminList() {
|
||||
|
||||
// member model 객체 생성후 목록을 구해옴
|
||||
$oMemberModel = &getModel('member');
|
||||
$output = $oMemberModel->getMemberList();
|
||||
|
||||
// 템플릿에 쓰기 위해서 context::set
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('member_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('member_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 관리에 필요한 기본 설정들
|
||||
**/
|
||||
function dispMemberAdminConfig() {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('member');
|
||||
if(!$config->image_name_max_width) $config->image_name_max_width = 90;
|
||||
if(!$config->image_name_max_height) $config->image_name_max_height = 20;
|
||||
if(!$config->image_mark_max_width) $config->image_mark_max_width = 20;
|
||||
if(!$config->image_mark_max_height) $config->image_mark_max_height = 20;
|
||||
Context::set('config',$config);
|
||||
|
||||
// 회원 관리 모듈의 스킨 목록을 구함
|
||||
$skin_list = $oModuleModel->getSkins($this->module_path);
|
||||
Context::set('skin_list', $skin_list);
|
||||
|
||||
// 에디터를 받음
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor(0, false, true);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('member_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 정보 출력
|
||||
**/
|
||||
function dispMemberAdminInfo() {
|
||||
// 추가 가입폼 목록을 받음
|
||||
$oMemberModel = &getModel('member');
|
||||
Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($this->member_info));
|
||||
|
||||
$this->setTemplateFile('member_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 정보 입력 화면 출력
|
||||
**/
|
||||
function dispMemberAdminInsert() {
|
||||
// 추가 가입폼 목록을 받음
|
||||
$oMemberModel = &getModel('member');
|
||||
Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($this->member_info));
|
||||
|
||||
$member_info = Context::get('member_info');
|
||||
$member_info->signature = $oMemberModel->getSignature($this->member_info->member_srl);
|
||||
Context::set('member_info', $member_info);
|
||||
|
||||
// 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅
|
||||
if($this->member_info->member_srl) {
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor($this->member_info->member_srl, false, false);
|
||||
Context::set('editor', $editor);
|
||||
}
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('insert_member');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 삭제 화면 출력
|
||||
**/
|
||||
function dispMemberAdminDeleteForm() {
|
||||
if(!Context::get('member_srl')) return $this->dispContent();
|
||||
$this->setTemplateFile('delete_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 그룹 목록 출력
|
||||
**/
|
||||
function dispMemberAdminGroupList() {
|
||||
$group_srl = Context::get('group_srl');
|
||||
|
||||
if($group_srl && $this->group_list[$group_srl]) {
|
||||
Context::set('selected_group', $this->group_list[$group_srl]);
|
||||
$this->setTemplateFile('group_update_form');
|
||||
} else {
|
||||
$this->setTemplateFile('group_list');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 가입 폼 목록 출력
|
||||
**/
|
||||
function dispMemberAdminJoinFormList() {
|
||||
// 멤버모델 객체 생성
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 추가로 설정한 가입 항목 가져오기
|
||||
$form_list = $oMemberModel->getJoinFormList();
|
||||
Context::set('form_list', $form_list);
|
||||
|
||||
$this->setTemplateFile('join_form_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 가입 폼 관리 화면 출력
|
||||
**/
|
||||
function dispMemberAdminInsertJoinForm() {
|
||||
// 수정일 경우 대상 join_form의 값을 구함
|
||||
$member_join_form_srl = Context::get('member_join_form_srl');
|
||||
if($member_join_form_srl) {
|
||||
$oMemberModel = &getModel('member');
|
||||
$join_form = $oMemberModel->getJoinForm($member_join_form_srl);
|
||||
if(!$join_form) Context::set('member_join_form_srl','',true);
|
||||
else Context::set('join_form', $join_form);
|
||||
}
|
||||
$this->setTemplateFile('insert_join_form');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 목록 아이디 출력
|
||||
**/
|
||||
function dispMemberAdminDeniedIDList() {
|
||||
// 멤버모델 객체 생성
|
||||
$oMemberModel = &getModel('member');
|
||||
|
||||
// 사용금지 목록 가져오기
|
||||
$output = $oMemberModel->getDeniedIDList();
|
||||
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('member_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
$this->setTemplateFile('denied_id_list');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -31,19 +31,5 @@
|
|||
$this->setTemplateFile('system_message');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정
|
||||
**/
|
||||
function dispMessageAdminConfig() {
|
||||
// 스킨 목록을 구해옴
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_list = $oModuleModel->getskins($this->module_path);
|
||||
Context::set('skin_list', $skin_list);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('config');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* @class moduleController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief module 모듈의 Controller class
|
||||
* @brief module 모듈의 controller class
|
||||
**/
|
||||
|
||||
class moduleController extends module {
|
||||
|
|
@ -13,38 +13,6 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 카테고리 추가
|
||||
**/
|
||||
function procModuleAdminInsertCategory() {
|
||||
$args->title = Context::get('title');
|
||||
$output = executeQuery('module.insertModuleCategory', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage("success_registed");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 카테고리의 내용 수정
|
||||
**/
|
||||
function procModuleAdminUpdateCategory() {
|
||||
$mode = Context::get('mode');
|
||||
|
||||
switch($mode) {
|
||||
case 'delete' :
|
||||
$output = $this->doDeleteModuleCategory();
|
||||
$msg_code = 'success_deleted';
|
||||
break;
|
||||
case 'update' :
|
||||
$output = $this->doUpdateModuleCategory();
|
||||
$msg_code = 'success_updated';
|
||||
break;
|
||||
}
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
$this->setMessage($msg_code);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈의 기본 정보 입력
|
||||
* 모듈의 정보를 입력받은 데이터를 serialize하여 등록한다.
|
||||
|
|
@ -193,7 +161,7 @@
|
|||
// plugin 삭제
|
||||
|
||||
// document 삭제
|
||||
$oDocumentController = &getController('document');
|
||||
$oDocumentController = &getAdminController('document');
|
||||
$output = $oDocumentController->deleteModuleDocument($module_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
|
|
@ -208,7 +176,7 @@
|
|||
}
|
||||
|
||||
// trackbacks 삭제
|
||||
$oTrackbackController = &getController('trackback');
|
||||
$oTrackbackController = &getAdminController('trackback');
|
||||
$output = $oTrackbackController->deleteModuleTrackbacks($module_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
|
|
@ -216,7 +184,7 @@
|
|||
}
|
||||
|
||||
// comments 삭제
|
||||
$oCommentController = &getController('comment');
|
||||
$oCommentController = &getAdminController('comment');
|
||||
$output = $oCommentController->deleteModuleComments($module_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
|
|
@ -224,7 +192,7 @@
|
|||
}
|
||||
|
||||
// tags 삭제
|
||||
$oTagController = &getController('tag');
|
||||
$oTagController = &getAdminController('tag');
|
||||
$output = $oTagController->deleteModuleTags($module_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
|
|
@ -232,7 +200,7 @@
|
|||
}
|
||||
|
||||
// 첨부 파일 삭제
|
||||
$oFileController = &getController('file');
|
||||
$oFileController = &getAdminController('file');
|
||||
$output = $oFileController->deleteModuleFiles($module_srl);
|
||||
if(!$output->toBool()) {
|
||||
$oDB->rollback();
|
||||
|
|
@ -262,23 +230,6 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 카테고리의 제목 변경
|
||||
**/
|
||||
function doUpdateModuleCategory() {
|
||||
$args->title = Context::get('title');
|
||||
$args->module_category_srl = Context::get('module_category_srl');
|
||||
return executeQuery('module.updateModuleCategory', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 카테고리 삭제
|
||||
**/
|
||||
function doDeleteModuleCategory() {
|
||||
$args->module_category_srl = Context::get('module_category_srl');
|
||||
return executeQuery('module.deleteModuleCategory', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 지정된 menu_srl에 속한 mid 의 menu_srl 을 변경
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
{$lang->category_title} :
|
||||
<input type="text" name="title" value="{$selected_category->title}" />
|
||||
<input type="submit" value="{$lang->cmd_modify}" />
|
||||
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('category_srl','')}'" />
|
||||
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('module_category_srl','')}'" />
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ function completeUpdateCategory(ret_obj) {
|
|||
|
||||
alert(message);
|
||||
|
||||
var url = current_url.setQuery('act','dispModuleAdminCategory');
|
||||
var url = current_url.setQuery('act','dispModuleAdminCategory').setQuery('module_category_srl','');
|
||||
location.href = url;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,27 +15,10 @@
|
|||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
if(substr_count($this->act, 'Admin')) $this->initAdmin();
|
||||
|
||||
// 템플릿 경로 구함 (page의 경우 tpl에 관리자용 템플릿 모아놓음)
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 기능 호출시에 관련 정보들 세팅해줌
|
||||
**/
|
||||
function initAdmin() {
|
||||
// module_srl이 있으면 미리 체크하여 존재하는 모듈이면 module_info 세팅
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// module model 객체 생성
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// 모듈 카테고리 목록을 구함
|
||||
$module_category = $oModuleModel->getModuleCategories();
|
||||
Context::set('module_category', $module_category);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 일반 요청시 출력
|
||||
**/
|
||||
|
|
@ -49,125 +32,5 @@
|
|||
$this->setTemplateFile('content');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 페이지 관리 목록 보여줌
|
||||
**/
|
||||
function dispPageAdminContent() {
|
||||
$args->sort_index = "module_srl";
|
||||
$args->page = Context::get('page');
|
||||
$args->list_count = 40;
|
||||
$args->page_count = 10;
|
||||
$args->s_module_category_srl = Context::get('module_category_srl');
|
||||
$output = executeQuery('page.getPageList', $args);
|
||||
|
||||
// 템플릿에 쓰기 위해서 context::set
|
||||
Context::set('total_count', $output->total_count);
|
||||
Context::set('total_page', $output->total_page);
|
||||
Context::set('page', $output->page);
|
||||
Context::set('page_list', $output->data);
|
||||
Context::set('page_navigation', $output->page_navigation);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 페이지에 필요한 기본 설정들
|
||||
**/
|
||||
function dispPageAdminModuleConfig() {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('page');
|
||||
Context::set('config',$config);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('page_config');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 선택된 페이지의 정보 출력
|
||||
**/
|
||||
function dispPageAdminInfo() {
|
||||
// GET parameter에서 module_srl을 가져옴
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// module model 객체 생성
|
||||
if($module_srl) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if($module_info->module_srl == $module_srl) Context::set('module_info',$module_info);
|
||||
else {
|
||||
unset($module_info);
|
||||
unset($module_srl);
|
||||
}
|
||||
}
|
||||
|
||||
// module_srl 값이 없다면 그냥 index 페이지를 보여줌
|
||||
if(!$module_srl) return $this->dispPageAdminContent();
|
||||
|
||||
// 레이아웃이 정해져 있다면 레이아웃 정보를 추가해줌(layout_title, layout)
|
||||
if($module_info->layout_srl) {
|
||||
$oLayoutModel = &getModel('layout');
|
||||
$layout_info = $oLayoutModel->getLayout($module_info->layout_srl);
|
||||
$module_info->layout = $layout_info->layout;
|
||||
$module_info->layout_title = $layout_info->layout_title;
|
||||
}
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('page_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 페이지 추가 폼 출력
|
||||
**/
|
||||
function dispPageAdminInsert() {
|
||||
|
||||
// GET parameter에서 module_srl을 가져옴
|
||||
$module_srl = Context::get('module_srl');
|
||||
|
||||
// module_srl이 있으면 해당 모듈의 정보를 구해서 세팅
|
||||
if($module_srl) {
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if($module_info->module_srl == $module_srl) Context::set('module_info',$module_info);
|
||||
else {
|
||||
unset($module_info);
|
||||
unset($module_srl);
|
||||
}
|
||||
}
|
||||
|
||||
// module_srl이 없으면 sequence값으로 미리 구해 놓음
|
||||
if(!$module_srl) $module_srl = getNextSequence();
|
||||
Context::set('module_srl',$module_srl);
|
||||
|
||||
// 플러그인 목록을 세팅
|
||||
$oPluginModel = &getModel('plugin');
|
||||
$plugin_list = $oPluginModel->getDownloadedPluginList();
|
||||
Context::set('plugin_list', $plugin_list);
|
||||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getEditor($module_srl, true);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('page_insert');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 페이지 삭제 화면 출력
|
||||
**/
|
||||
function dispPageAdminDelete() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl) return $this->dispContent();
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
Context::set('module_info',$module_info);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('page_delete');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -14,18 +14,6 @@
|
|||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 플러그인 목록을 보여줌
|
||||
**/
|
||||
function dispPluginAdminDownloadedList() {
|
||||
// 플러그인 목록을 세팅
|
||||
$oPluginModel = &getModel('plugin');
|
||||
$plugin_list = $oPluginModel->getDownloadedPluginList();
|
||||
Context::set('plugin_list', $plugin_list);
|
||||
|
||||
$this->setTemplateFile('downloaded_plugin_list');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 플러그인의 상세 정보(conf/info.xml)를 팝업 출력
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -181,100 +181,5 @@
|
|||
$this->add('tpl',$tpl);
|
||||
$this->setMessage('success_poll');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 설문조사들을 삭제
|
||||
**/
|
||||
function procPollAdminDeleteChecked() {
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
|
||||
$poll_srl_list= explode('|@|', $cart);
|
||||
$poll_count = count($poll_srl_list);
|
||||
if(!$poll_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$poll_count;$i++) {
|
||||
$poll_index_srl = trim($poll_srl_list[$i]);
|
||||
if(!$poll_index_srl) continue;
|
||||
|
||||
$output = $this->deletePollTitle($poll_index_srl, true);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사 삭제 (한번에 여러개의 설문 등록시 그 중 하나의 설문만 삭제)
|
||||
**/
|
||||
function deletePollTitle($poll_index_srl) {
|
||||
$args->poll_index_srl = $poll_index_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollItem', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문조사 삭제 (하나의 묶인 설문조사를 통째로 삭제)
|
||||
**/
|
||||
function deletePoll($poll_srl) {
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePoll', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output = $oDB->executeQuery('poll.deletePollItem', $args);
|
||||
if(!$output) {
|
||||
$oDB->rollback();
|
||||
return $output;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정 저장
|
||||
**/
|
||||
function procPollAdminInsertConfig() {
|
||||
$config->skin = Context::get('skin');
|
||||
$config->colorset = Context::get('colorset');
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('poll', $config);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -13,17 +13,6 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설문 목록 구해옴 (관리자용)
|
||||
**/
|
||||
function getPollList($args) {
|
||||
$output = executeQuery('poll.getPollList', $args);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
if($output->data && !is_array($output->data)) $output->data = array($output->data);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 이미 설문 조사를 하였는지 검사하는 함수
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -13,52 +13,6 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸필터 설정
|
||||
**/
|
||||
function procSpamfilterAdminInsertConfig() {
|
||||
// 기본 정보를 받음
|
||||
$args = Context::gets('interval','limit_count','check_trackback');
|
||||
if($args->check_trackback!='Y') $args->check_trackback = 'N';
|
||||
|
||||
// module Controller 객체 생성하여 입력
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('spamfilter',$args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 IP등록
|
||||
**/
|
||||
function procSpamfilterAdminInsertDeniedIP() {
|
||||
$ipaddress = Context::get('ipaddress');
|
||||
return $this->insertIP($ipaddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 IP삭제
|
||||
**/
|
||||
function procSpamfilterAdminDeleteDeniedIP() {
|
||||
$ipaddress = Context::get('ipaddress');
|
||||
return $this->deleteIP($ipaddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 Word등록
|
||||
**/
|
||||
function procSpamfilterAdminInsertDeniedWord() {
|
||||
$word = Context::get('word');
|
||||
return $this->insertWord($word);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 금지 Word삭제
|
||||
**/
|
||||
function procSpamfilterAdminDeleteDeniedWord() {
|
||||
$word = Context::get('word');
|
||||
return $this->deleteWord($word);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief IP 등록
|
||||
* 등록된 IP는 스패머로 간주
|
||||
|
|
@ -68,39 +22,6 @@
|
|||
return executeQuery('spamfilter.insertDeniedIP', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief IP 제거
|
||||
* 스패머로 등록된 IP를 제거
|
||||
**/
|
||||
function deleteIP($ipaddress) {
|
||||
if(!$ipaddress) return;
|
||||
|
||||
$args->ipaddress = $ipaddress;
|
||||
return executeQuery('spamfilter.deleteDeniedIP', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸단어 등록
|
||||
* 등록된 단어가 포함된 글은 스팸글로 간주
|
||||
**/
|
||||
function insertWord($word) {
|
||||
if(!$word) return;
|
||||
|
||||
$args->word = $word;
|
||||
return executeQuery('spamfilter.insertDeniedWord', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스팸단어 제거
|
||||
* 스팸 단어로 등록된 단어 제거
|
||||
**/
|
||||
function deleteWord($word) {
|
||||
if(!$word) return;
|
||||
|
||||
$args->word = $word;
|
||||
return executeQuery('spamfilter.deleteDeniedWord', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 로그 등록
|
||||
* 현 접속 IP를 로그에 등록, 로그의 간격이 특정 시간 이내일 경우 도배로 간주하여
|
||||
|
|
@ -110,6 +31,5 @@
|
|||
$output = executeQuery('spamfilter.insertLog');
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -53,12 +53,5 @@
|
|||
return executeQuery('tag.deleteTag', $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 모듈의 태그 삭제
|
||||
**/
|
||||
function deleteModuleTags($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
return executeQuery('tag.deleteModuleTags', $args);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -13,28 +13,6 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 관리자 페이지에서 선택된 엮인글들을 삭제
|
||||
**/
|
||||
function procTrackbackAdminDeleteChecked() {
|
||||
// 선택된 글이 없으면 오류 표시
|
||||
$cart = Context::get('cart');
|
||||
if(!$cart) return $this->stop('msg_cart_is_null');
|
||||
$trackback_srl_list= explode('|@|', $cart);
|
||||
$trackback_count = count($trackback_srl_list);
|
||||
if(!$trackback_count) return $this->stop('msg_cart_is_null');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$trackback_count;$i++) {
|
||||
$trackback_srl = trim($trackback_srl_list[$i]);
|
||||
if(!$trackback_srl) continue;
|
||||
|
||||
$this->deleteTrackback($trackback_srl, true);
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 엮인글 입력
|
||||
**/
|
||||
|
|
@ -141,17 +119,6 @@
|
|||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈에 속한 모든 트랙백 삭제
|
||||
**/
|
||||
function deleteModuleTrackbacks($module_srl) {
|
||||
// 삭제
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('trackback.deleteModuleTrackbacks', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 엮인글을 발송
|
||||
*
|
||||
|
|
|
|||
|
|
@ -82,56 +82,5 @@
|
|||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 모든 엮인글를 시간 역순으로 가져옴 (관리자용)
|
||||
**/
|
||||
function getTotalTrackbackList($obj) {
|
||||
// 검색 옵션 정리
|
||||
$search_target = trim(Context::get('search_target'));
|
||||
$search_keyword = trim(Context::get('search_keyword'));
|
||||
|
||||
if($search_target && $search_keyword) {
|
||||
switch($search_target) {
|
||||
case 'url' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_url = $search_keyword;
|
||||
break;
|
||||
case 'title' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_title= $search_keyword;
|
||||
break;
|
||||
case 'blog_name' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_blog_name= $search_keyword;
|
||||
break;
|
||||
case 'excerpt' :
|
||||
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
|
||||
$args->s_excerpt = $search_keyword;
|
||||
break;
|
||||
case 'regdate' :
|
||||
$args->s_regdate = $search_keyword;
|
||||
break;
|
||||
case 'ipaddress' :
|
||||
$args->s_ipaddress= $search_keyword;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 변수 설정
|
||||
$args->sort_index = $obj->sort_index;
|
||||
$args->page = $obj->page?$obj->page:1;
|
||||
$args->list_count = $obj->list_count?$obj->list_count:20;
|
||||
$args->page_count = $obj->page_count?$obj->page_count:10;
|
||||
|
||||
// trackback.getTotalTrackbackList 쿼리 실행
|
||||
$output = executeQuery('trackback.getTotalTrackbackList', $args);
|
||||
|
||||
// 결과가 없거나 오류 발생시 그냥 return
|
||||
if(!$output->toBool()||!count($output->data)) return $output;
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue