mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@1541 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f2e47e336d
commit
2de087f399
51 changed files with 3495 additions and 130 deletions
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class addonController
|
||||
* @class addonAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief addon 모듈의 Controller class
|
||||
* @brief addon 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class addonController extends addon {
|
||||
class addonAdminController extends addon {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
* @brief 애드온의 활성/비활성 체인지
|
||||
**/
|
||||
function procAddonAdminToggleActivate() {
|
||||
$oAddonModel = &getModel('addon');
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
|
||||
// addon값을 받아옴
|
||||
$addon = Context::get('addon');
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class addonModel
|
||||
* @class addonAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief addon 모듈의 Model class
|
||||
* @brief addon 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class addonModel extends addon {
|
||||
class addonAdminModel extends addon {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -129,6 +129,5 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class addonView
|
||||
* @class addonAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief addon 모듈의 View class
|
||||
* @brief addon 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class addonView extends addon {
|
||||
class addonAdminView extends addon {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
**/
|
||||
function dispAddonAdminIndex() {
|
||||
// 애드온 목록을 세팅
|
||||
$oAddonModel = &getModel('addon');
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
$addon_list = $oAddonModel->getAddonList();
|
||||
Context::set('addon_list', $addon_list);
|
||||
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
$selected_addon = Context::get('selected_addon');
|
||||
|
||||
// 요청된 애드온의 정보를 구함
|
||||
$oAddonModel = &getModel('addon');
|
||||
$oAddonModel = &getAdminModel('addon');
|
||||
$addon_info = $oAddonModel->getAddonInfoXml($selected_addon);
|
||||
Context::set('addon_info', $addon_info);
|
||||
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class adminController
|
||||
* @class adminAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief admin 모듈의 controller class
|
||||
* @brief admin 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class adminController extends admin {
|
||||
class adminAdminController extends admin {
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class adminModel
|
||||
* @class adminAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief admin 모듈의 model class
|
||||
* @brief admin 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class adminModel extends admin {
|
||||
class adminAdminModel extends admin {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class adminView
|
||||
* @class adminAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief admin 모듈의 view class
|
||||
* @brief admin 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class adminView extends admin {
|
||||
class adminAdminView extends admin {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
$this->setLayoutFile('layout.html');
|
||||
|
||||
// shortcut 가져오기
|
||||
$oAdminModel = &getModel('admin');
|
||||
$oAdminModel = &getAdminModel('admin');
|
||||
$shortcut_list = $oAdminModel->getShortCuts();
|
||||
Context::set('shortcut_list', $shortcut_list);
|
||||
|
||||
565
modules/blog/blog.admin.controller.php
Normal file
565
modules/blog/blog.admin.controller.php
Normal file
|
|
@ -0,0 +1,565 @@
|
|||
<?php
|
||||
/**
|
||||
* @class blogAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief blog 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class blogAdminController extends blog {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 = &getAdminController('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);
|
||||
|
||||
$oLayoutAdminController = &getAdminController('layout');
|
||||
$output = $oLayoutAdminController->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;
|
||||
|
||||
$oLayoutAdminController = &getAdminController('layout');
|
||||
$output = $oLayoutAdminController->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 = &getAdminController('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 = &getAdminController('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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
66
modules/blog/blog.admin.model.php
Normal file
66
modules/blog/blog.admin.model.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
|
||||
<?php
|
||||
/**
|
||||
* @class blogAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @version 0.1
|
||||
* @brief blog 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class blogAdminModel extends blog {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
$oBlogModel = &getModel('blog');
|
||||
|
||||
// parent_srl이 있고 category_srl 이 없으면 하부 메뉴 추가임
|
||||
if(!$category_srl && $parent_srl) {
|
||||
// 상위 메뉴의 정보를 가져옴
|
||||
$parent_info = $oBlogModel->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 = $oBlogModel->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);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
208
modules/blog/blog.admin.view.php
Normal file
208
modules/blog/blog.admin.view.php
Normal file
|
|
@ -0,0 +1,208 @@
|
|||
<?php
|
||||
/**
|
||||
* @class blogAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief blog 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class blogAdminView extends blog {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
*
|
||||
* blog 모듈은 일반 사용과 관리자용으로 나누어진다.\n
|
||||
**/
|
||||
function init() {
|
||||
// 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);
|
||||
|
||||
// 만약 블로그 서비스 페이지에서 관리자 기능 호출시 요청된 블로그의 정보와 레이아웃 가져옴
|
||||
if($this->mid) {
|
||||
$oView = &getView('blog');
|
||||
$oView->setModuleInfo($this->module_info, $this->xml_info);
|
||||
$oView->init();
|
||||
}
|
||||
|
||||
// 템플릿 경로 지정 (blog의 경우 tpl에 관리자용 템플릿 모아놓음)
|
||||
$this->setTemplatePath($this->module_path."tpl");
|
||||
}
|
||||
|
||||
/**
|
||||
* @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};
|
||||
}
|
||||
}
|
||||
|
||||
// 메뉴를 가져옴
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$menu_list = $oMenuAdminModel->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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
318
modules/board/board.admin.controller.php
Normal file
318
modules/board/board.admin.controller.php
Normal file
|
|
@ -0,0 +1,318 @@
|
|||
<?php
|
||||
/**
|
||||
* @class boardAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief board 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class boardAdminController extends board {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 = &getAdminController('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 = &getAdminController('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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
241
modules/board/board.admin.view.php
Normal file
241
modules/board/board.admin.view.php
Normal file
|
|
@ -0,0 +1,241 @@
|
|||
<?php
|
||||
/**
|
||||
* @class boardAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief board 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class boardAdminView extends board {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
*
|
||||
* board 모듈은 일반 사용과 관리자용으로 나누어진다.\n
|
||||
**/
|
||||
function init() {
|
||||
// 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 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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
52
modules/comment/comment.admin.controller.php
Normal file
52
modules/comment/comment.admin.controller.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* @class commentAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief comment 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class commentAdminController extends comment {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
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');
|
||||
|
||||
$oCommentController = &getController('comment');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$comment_count;$i++) {
|
||||
$comment_srl = trim($comment_srl_list[$i]);
|
||||
if(!$comment_srl) continue;
|
||||
|
||||
$output = $oCommentController->deleteComment($comment_srl, true);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $comment_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 특정 모듈의 모든 댓글 삭제
|
||||
**/
|
||||
function deleteModuleComments($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('comment.deleteModuleComments', $args);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class commentView
|
||||
* @class commentAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief comment 모듈의 view 클래스
|
||||
* @brief comment 모듈의 admin view 클래스
|
||||
**/
|
||||
|
||||
class commentView extends comment {
|
||||
class commentAdminView extends comment {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class counterView
|
||||
* @class counterAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief counter 모듈의 View class
|
||||
* @brief counter 모듈의 Admin view class
|
||||
**/
|
||||
|
||||
class counterView extends counter {
|
||||
class counterAdminView extends counter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
251
modules/document/document.admin.controller.php
Normal file
251
modules/document/document.admin.controller.php
Normal file
|
|
@ -0,0 +1,251 @@
|
|||
<?php
|
||||
/**
|
||||
* @class documentAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief document 모듈의 admin controller 클래스
|
||||
**/
|
||||
|
||||
class documentAdminController extends document {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
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');
|
||||
|
||||
// 글삭제
|
||||
$oDocumentController = &getController('document');
|
||||
for($i=0;$i<$document_count;$i++) {
|
||||
$document_srl = trim($document_srl_list[$i]);
|
||||
if(!$document_srl) continue;
|
||||
|
||||
$oDocumentController->deleteDocument($document_srl, true);
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 카테고리 추가
|
||||
**/
|
||||
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 카테고리 삭제
|
||||
**/
|
||||
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();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class documentView
|
||||
* @class documentAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief document 모듈의 view 클래스
|
||||
* @brief document 모듈의 admin view 클래스
|
||||
**/
|
||||
|
||||
class documentView extends document {
|
||||
class documentAdminView extends document {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
118
modules/editor/editor.admin.controller.php
Normal file
118
modules/editor/editor.admin.controller.php
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
<?php
|
||||
/**
|
||||
* @class editorAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief editor 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class editorAdminController extends editor {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 컴포넌트를 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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
47
modules/editor/editor.admin.view.php
Normal file
47
modules/editor/editor.admin.view.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
/**
|
||||
* @class editorAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief editor 모듈의 admin view 클래스
|
||||
**/
|
||||
|
||||
class editorAdminView extends editor {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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");
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
71
modules/file/file.admin.controller.php
Normal file
71
modules/file/file.admin.controller.php
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
/**
|
||||
* @class fileAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief file 모듈의 admin controller 클래스
|
||||
**/
|
||||
|
||||
class fileAdminController extends file {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 관리자 페이지에서 선택된 파일들을 삭제
|
||||
**/
|
||||
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');
|
||||
|
||||
$oFileController = &getController('file');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$file_count;$i++) {
|
||||
$file_srl = trim($file_srl_list[$i]);
|
||||
if(!$file_srl) continue;
|
||||
|
||||
$oFileController->deleteFile($file_srl);
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_file_is_deleted'), $file_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
72
modules/file/file.admin.model.php
Normal file
72
modules/file/file.admin.model.php
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
/**
|
||||
* @class fileAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief file 모듈의 admin model 클래스
|
||||
**/
|
||||
|
||||
class fileAdminModel extends file {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
foreach($output->data as $key => $file) {
|
||||
$file->download_url = $oFileModel->getDownloadUrl($file->file_srl, $file->sid);
|
||||
$output->data[$key] = $file;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class fileView
|
||||
* @class fileAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief file 모듈의 view 클래스
|
||||
* @brief file 모듈의 admin view 클래스
|
||||
**/
|
||||
|
||||
class fileView extends file {
|
||||
class fileAdminView extends file {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
$args->isvalid = Context::get('isvalid');
|
||||
|
||||
// 목록 구함
|
||||
$oFileModel = &getModel('file');
|
||||
$oFileModel = &getAdminModel('file');
|
||||
$output = $oFileModel->getFileList($args);
|
||||
|
||||
// 목록의 loop를 돌면서 mid를 구하기 위한 module_srl값을 구함
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class importerController
|
||||
* @class importerAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief importer 모듈의 Controller class
|
||||
* @brief importer 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class importerController extends importer {
|
||||
class importerAdminController extends importer {
|
||||
|
||||
var $oXml = null;
|
||||
var $oMemberController = null;
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class importerView
|
||||
* @class importerAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief importer 모듈의 View class
|
||||
* @brief importer 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class importerView extends importer {
|
||||
class importerAdminView extends importer {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
31
modules/install/install.admin.controller.php
Normal file
31
modules/install/install.admin.controller.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/**
|
||||
* @class installAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief install module의 admin controller class
|
||||
**/
|
||||
|
||||
class installAdminController extends install {
|
||||
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 설치
|
||||
**/
|
||||
function procInstallAdminInstall() {
|
||||
$module_name = Context::get('module_name');
|
||||
if(!$module_name) return new object(-1, 'invalid_request');
|
||||
|
||||
$oInstallController = &getController('install');
|
||||
$oInstallController->installModule($module_name, './modules/'.$module_name);
|
||||
|
||||
$this->setMessage('success_installed');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class krzipController
|
||||
* @class krzipAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief krzip 모듈의 controller class
|
||||
* @brief krzip 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class krzipController extends krzip {
|
||||
class krzipAdminController extends krzip {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -1,17 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* @class krzipView
|
||||
* @class krzipAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief krzip 모듈의 View class
|
||||
* @brief krzip 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class krzipView extends krzip {
|
||||
class krzipAdminView extends krzip {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -24,6 +23,7 @@
|
|||
Context::set('config',$config);
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('index');
|
||||
}
|
||||
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layoutController
|
||||
* @class layoutAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief layout 모듈의 Controller class
|
||||
* @brief layout 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class layoutController extends layout {
|
||||
class layoutAdminController extends layout {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -63,8 +63,8 @@
|
|||
// 정해진 메뉴가 있으면 모듈 및 메뉴에 대한 레이아웃 연동
|
||||
if(count($menu_srl_list)) {
|
||||
// 해당 메뉴와 레이아웃 값을 매핑
|
||||
$oMenuController = &getController('menu');
|
||||
$oMenuController->updateMenuLayout($args->layout_srl, $menu_srl_list);
|
||||
$oMenuAdminController = &getAdminController('menu');
|
||||
$oMenuAdminController->updateMenuLayout($args->layout_srl, $menu_srl_list);
|
||||
|
||||
// 해당 메뉴에 속한 mid의 layout값을 모두 변경
|
||||
$oModuleController = &getController('module');
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class layoutView
|
||||
* @class layoutAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief layout 모듈의 View class
|
||||
* @brief layout 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class layoutView extends layout {
|
||||
class layoutAdminView extends layout {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -55,8 +55,8 @@
|
|||
Context::set('selected_layout', $layout_info);
|
||||
|
||||
// 메뉴 목록을 가져옴
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_list = $oMenuModel->getMenus();
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$menu_list = $oMenuAdminModel->getMenus();
|
||||
Context::set('menu_list', $menu_list);
|
||||
|
||||
$this->setTemplateFile('layout_modify');
|
||||
443
modules/member/member.admin.controller.php
Normal file
443
modules/member/member.admin.controller.php
Normal file
|
|
@ -0,0 +1,443 @@
|
|||
<?php
|
||||
/**
|
||||
* @class memberAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief member module의 admin controller class
|
||||
**/
|
||||
|
||||
class memberAdminController extends member {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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 관리자를 추가한다
|
||||
**/
|
||||
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 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();
|
||||
}
|
||||
}
|
||||
?>
|
||||
79
modules/member/member.admin.model.php
Normal file
79
modules/member/member.admin.model.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
/**
|
||||
* @class memberAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief member module의 admin model class
|
||||
**/
|
||||
|
||||
class memberAdminModel extends member {
|
||||
|
||||
/**
|
||||
* @brief 자주 호출될거라 예상되는 데이터는 내부적으로 가지고 있자...
|
||||
**/
|
||||
var $member_info = NULL;
|
||||
var $member_groups = NULL;
|
||||
var $join_form_list = NULL;
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
187
modules/member/member.admin.view.php
Normal file
187
modules/member/member.admin.view.php
Normal file
|
|
@ -0,0 +1,187 @@
|
|||
<?php
|
||||
/**
|
||||
* @class memberAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief member module의 admin view class
|
||||
**/
|
||||
|
||||
class memberAdminView extends member {
|
||||
|
||||
var $group_list = NULL; ///< 그룹 목록 정보
|
||||
var $member_info = NULL; ///< 선택된 사용자의 정보
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
// 멤버모델 객체 생성
|
||||
$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');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 회원 목록 출력
|
||||
**/
|
||||
function dispMemberAdminList() {
|
||||
|
||||
// member model 객체 생성후 목록을 구해옴
|
||||
$oMemberModel = &getAdminModel('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');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class menuController
|
||||
* @class menuAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief menu 모듈의 Controller class
|
||||
* @brief menu 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class menuController extends menu {
|
||||
class menuAdminController extends menu {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -101,7 +101,7 @@
|
|||
$args->group_srls = $source_args->group_srls;
|
||||
|
||||
// 이미 존재하는지를 확인
|
||||
$oMenuModel = &getModel('menu');
|
||||
$oMenuModel = &getAdminModel('menu');
|
||||
$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
|
||||
|
||||
// 존재하게 되면 update를 해준다
|
||||
|
|
@ -228,8 +228,8 @@
|
|||
$menu_srl = Context::get('menu_srl');
|
||||
|
||||
// 해당 메뉴의 정보를 구함
|
||||
$oMenuModel = &getModel('menu');
|
||||
$menu_info = $oMenuModel->getMenu($menu_srl);
|
||||
$oMenuAdminModel = &getAdminModel('menu');
|
||||
$menu_info = $oMenuAdminModel->getMenu($menu_srl);
|
||||
$menu_title = $menu_info->title;
|
||||
|
||||
// xml파일 재생성
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* @class menuModel
|
||||
* @class menuAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @version 0.1
|
||||
* @brief menu 모듈의 Model class
|
||||
* @brief menu 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class menuModel extends menu {
|
||||
class menuAdminModel extends menu {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class menuView
|
||||
* @class menuAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief menu 모듈의 View class
|
||||
* @brief menu 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class menuView extends menu {
|
||||
class menuAdminView extends menu {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
$obj->list_count = 20;
|
||||
$obj->page_count = 20;
|
||||
|
||||
$oMenuModel = &getModel('menu');
|
||||
$oMenuModel = &getAdminModel('menu');
|
||||
$output = $oMenuModel->getMenuList($obj);
|
||||
|
||||
Context::set('total_count', $output->total_count);
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
|
||||
if($menu_srl) {
|
||||
// 메뉴의 정보를 가져옴
|
||||
$oMenuModel = &getModel('menu');
|
||||
$oMenuModel = &getAdminModel('menu');
|
||||
$menu_info = $oMenuModel->getMenu($menu_srl);
|
||||
if($menu_info->menu_srl == $menu_srl) Context::set('menu_info', $menu_info);
|
||||
}
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
if(!$menu_srl) return $this->dispMenuAdminContent();
|
||||
|
||||
// 메뉴의 정보를 가져옴
|
||||
$oMenuModel = &getModel('menu');
|
||||
$oMenuModel = &getAdminModel('menu');
|
||||
$menu_info = $oMenuModel->getMenu($menu_srl);
|
||||
if($menu_info->menu_srl != $menu_srl) return $this->dispMenuAdminContent();
|
||||
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class messageController
|
||||
* @class messageAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief message module의 view class
|
||||
* @brief message module의 admin controller class
|
||||
**/
|
||||
|
||||
class messageController extends message {
|
||||
class messageAdminController extends message {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
31
modules/message/message.admin.view.php
Normal file
31
modules/message/message.admin.view.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/**
|
||||
* @class messageAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief message모듈의 admin view class
|
||||
**/
|
||||
|
||||
class messageAdminView extends message {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
66
modules/module/module.admin.controller.php
Normal file
66
modules/module/module.admin.controller.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
/**
|
||||
* @class moduleAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief module 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class moduleAdminController extends module {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
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 모듈 카테고리의 제목 변경
|
||||
**/
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class moduleView
|
||||
* @class moduleAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief module 모듈의 View class
|
||||
* @brief module 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class moduleView extends module {
|
||||
class moduleAdminView extends module {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pageController
|
||||
* @class pageAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief page 모듈의 controller class
|
||||
* @brief page 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class pageController extends page {
|
||||
class pageAdminController extends page {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
153
modules/page/page.admin.view.php
Normal file
153
modules/page/page.admin.view.php
Normal file
|
|
@ -0,0 +1,153 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pageAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief page 모듈의 admin view 클래스
|
||||
**/
|
||||
|
||||
class pageAdminView extends page {
|
||||
|
||||
var $module_srl = 0;
|
||||
var $list_count = 20;
|
||||
var $page_count = 10;
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
// 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);
|
||||
|
||||
// 템플릿 경로 구함 (page의 경우 tpl에 관리자용 템플릿 모아놓음)
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
/**
|
||||
* @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');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
29
modules/plugin/plugin.admin.view.php
Normal file
29
modules/plugin/plugin.admin.view.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pluginAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief plugin 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class pluginAdminView extends plugin {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
$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');
|
||||
}
|
||||
}
|
||||
?>
|
||||
111
modules/poll/poll.admin.controller.php
Normal file
111
modules/poll/poll.admin.controller.php
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class pollAdminController extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정 저장
|
||||
**/
|
||||
function procPollAdminInsertConfig() {
|
||||
$config->skin = Context::get('skin');
|
||||
$config->colorset = Context::get('colorset');
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertModuleConfig('poll', $config);
|
||||
|
||||
$this->setMessage('success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @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();
|
||||
}
|
||||
}
|
||||
?>
|
||||
28
modules/poll/poll.admin.model.php
Normal file
28
modules/poll/poll.admin.model.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class pollAdminModel extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollView
|
||||
* @class pollAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll모듈의 View class
|
||||
* @brief poll모듈의 admin view class
|
||||
**/
|
||||
|
||||
class pollView extends poll {
|
||||
class pollAdminView extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -43,8 +43,8 @@
|
|||
$args->sort_index = 'list_order'; ///< 소팅 값
|
||||
|
||||
// 목록 구함
|
||||
$oPollModel = &getModel('poll');
|
||||
$output = $oPollModel->getPollList($args);
|
||||
$oPollAdminModel = &getAdminModel('poll');
|
||||
$output = $oPollAdminModel->getPollList($args);
|
||||
|
||||
// 템플릿 변수 설정
|
||||
Context::set('total_count', $output->total_count);
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* @class rssController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief rss module의 view class
|
||||
*
|
||||
* RSS 2.0형식으로 문서 출력
|
||||
*
|
||||
**/
|
||||
|
||||
class rssController extends rss {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 설정
|
||||
**/
|
||||
function procRssAdminInsertConfig() {
|
||||
// 기본 정보를 받음
|
||||
$args = Context::gets('rss_disable', 'rss_type');
|
||||
if($args->rss_disable!='Y') $args->rss_disable = 'N';
|
||||
if(!$args->rss_type) $args->rss_type = "rss20";
|
||||
|
||||
// module Controller 객체 생성하여 입력
|
||||
$oModuleController = &getController('module');
|
||||
$output = $oModuleController->insertModuleConfig('rss',$args);
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
98
modules/spamfilter/spamfilter.admin.controller.php
Normal file
98
modules/spamfilter/spamfilter.admin.controller.php
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
<?php
|
||||
/**
|
||||
* @class spamfilterAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief spamfilter 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class spamfilterAdminController extends spamfilter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
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');
|
||||
|
||||
$oSpamfilterController = &getController('spamfilter');
|
||||
return $oSpamfilterController->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를 제거
|
||||
**/
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class spamfilterView
|
||||
* @class spamfilterAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief spamfilter 모듈의 View class
|
||||
* @brief spamfilter 모듈의 admin view class
|
||||
**/
|
||||
|
||||
class spamfilterView extends spamfilter {
|
||||
class spamfilterAdminView extends spamfilter {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
17
modules/tag/tag.admin.controller.php
Normal file
17
modules/tag/tag.admin.controller.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
/**
|
||||
* @class tagAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief tag 모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class tagAdminController extends tag {
|
||||
/**
|
||||
* @brief 특정 모듈의 태그 삭제
|
||||
**/
|
||||
function deleteModuleTags($module_srl) {
|
||||
$args->module_srl = $module_srl;
|
||||
return executeQuery('tag.deleteModuleTags', $args);
|
||||
}
|
||||
}
|
||||
?>
|
||||
52
modules/trackback/trackback.admin.controller.php
Normal file
52
modules/trackback/trackback.admin.controller.php
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackAdminController
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback모듈의 admin controller class
|
||||
**/
|
||||
|
||||
class trackbackAdminController extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
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');
|
||||
|
||||
$oTrackbackController = &getController('trackback');
|
||||
|
||||
// 글삭제
|
||||
for($i=0;$i<$trackback_count;$i++) {
|
||||
$trackback_srl = trim($trackback_srl_list[$i]);
|
||||
if(!$trackback_srl) continue;
|
||||
|
||||
$oTrackbackController->deleteTrackback($trackback_srl, true);
|
||||
}
|
||||
|
||||
$this->setMessage( sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count) );
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈에 속한 모든 트랙백 삭제
|
||||
**/
|
||||
function deleteModuleTrackbacks($module_srl) {
|
||||
// 삭제
|
||||
$args->module_srl = $module_srl;
|
||||
$output = executeQuery('trackback.deleteModuleTrackbacks', $args);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
66
modules/trackback/trackback.admin.model.php
Normal file
66
modules/trackback/trackback.admin.model.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackAdminModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback 모듈의 admin model class
|
||||
**/
|
||||
|
||||
class trackbackAdminModel extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
/**
|
||||
* @class trackbackView
|
||||
* @class trackbackAdminView
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief trackback모듈의 View class
|
||||
* @brief trackback모듈의 admin view class
|
||||
**/
|
||||
|
||||
class trackbackView extends trackback {
|
||||
class trackbackAdminView extends trackback {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
|
|
@ -25,8 +25,8 @@
|
|||
$args->sort_index = 'list_order'; ///< 소팅 값
|
||||
|
||||
// 목록 구함
|
||||
$oTrackbackModel = &getModel('trackback');
|
||||
$output = $oTrackbackModel->getTotalTrackbackList($args);
|
||||
$oTrackbackAdminModel = &getAdminModel('trackback');
|
||||
$output = $oTrackbackAdminModel->getTotalTrackbackList($args);
|
||||
|
||||
// 목록의 loop를 돌면서 mid를 구하기 위한 module_srl값을 구함
|
||||
$trackback_count = count($output->data);
|
||||
Loading…
Add table
Add a link
Reference in a new issue