mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 17:44:38 +09:00
english comments added
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0_english@8278 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
693e215bc1
commit
4d272994dd
219 changed files with 6407 additions and 8705 deletions
|
|
@ -2,23 +2,23 @@
|
|||
/**
|
||||
* @class integration_searchAdminController
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief integration_search module의 admin view class
|
||||
* @brief admin view class of the integration_search module
|
||||
*
|
||||
* 통합검색 관리
|
||||
* Search Management
|
||||
*
|
||||
**/
|
||||
|
||||
class integration_searchAdminController extends integration_search {
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {}
|
||||
|
||||
/**
|
||||
* @brief 설정 저장
|
||||
* @brief Save Settings
|
||||
**/
|
||||
function procIntegration_searchAdminInsertConfig() {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
// Get configurations (using module model object)
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('integration_search');
|
||||
|
||||
|
|
@ -33,79 +33,67 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 스킨 정보 저장
|
||||
* @brief Save the skin information
|
||||
**/
|
||||
function procIntegration_searchAdminInsertSkin() {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
// Get configurations (using module model object)
|
||||
$oModuleModel = &getModel('module');
|
||||
$config = $oModuleModel->getModuleConfig('integration_search');
|
||||
|
||||
$args->skin = $config->skin;
|
||||
$args->target_module_srl = $config->target_module_srl;
|
||||
|
||||
// 스킨의 정보를 구해옴 (extra_vars를 체크하기 위해서)
|
||||
// Get skin information (to check extra_vars)
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $config->skin);
|
||||
|
||||
// 입력받은 변수들을 체크 (mo, act, module_srl, page등 기본적인 변수들 없앰)
|
||||
// Check received variables (delete the basic variables such as mo, act, module_srl, page)
|
||||
$obj = Context::getRequestVars();
|
||||
unset($obj->act);
|
||||
unset($obj->module_srl);
|
||||
unset($obj->page);
|
||||
|
||||
// 원 skin_info에서 extra_vars의 type이 image일 경우 별도 처리를 해줌
|
||||
// Separately handle if the extra_vars is an image type in the original skin_info
|
||||
if($skin_info->extra_vars) {
|
||||
foreach($skin_info->extra_vars as $vars) {
|
||||
if($vars->type!='image') continue;
|
||||
|
||||
$image_obj = $obj->{$vars->name};
|
||||
|
||||
// 삭제 요청에 대한 변수를 구함
|
||||
// Get a variable on a request to delete
|
||||
$del_var = $obj->{"del_".$vars->name};
|
||||
unset($obj->{"del_".$vars->name});
|
||||
if($del_var == 'Y') {
|
||||
FileHandler::removeFile($module_info->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 업로드 되지 않았다면 이전 데이터를 그대로 사용
|
||||
// Use the previous data if not uploaded
|
||||
if(!$image_obj['tmp_name']) {
|
||||
$obj->{$vars->name} = $module_info->{$vars->name};
|
||||
continue;
|
||||
}
|
||||
|
||||
// 정상적으로 업로드된 파일이 아니면 무시
|
||||
// Ignore if the file is not successfully uploaded
|
||||
if(!is_uploaded_file($image_obj['tmp_name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 이미지 파일이 아니어도 무시
|
||||
// Ignore if the file is not an image
|
||||
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 경로를 정해서 업로드
|
||||
// Upload the file to a path
|
||||
$path = sprintf("./files/attach/images/%s/", $module_srl);
|
||||
|
||||
// 디렉토리 생성
|
||||
// Create a directory
|
||||
if(!FileHandler::makeDir($path)) return false;
|
||||
|
||||
$filename = $path.$image_obj['name'];
|
||||
|
||||
// 파일 이동
|
||||
// Move the file
|
||||
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) {
|
||||
unset($obj->{$vars->name});
|
||||
continue;
|
||||
}
|
||||
|
||||
// 변수를 바꿈
|
||||
// Change a variable
|
||||
unset($obj->{$vars->name});
|
||||
$obj->{$vars->name} = $filename;
|
||||
}
|
||||
}
|
||||
|
||||
// serialize하여 저장
|
||||
// Serialize and save
|
||||
$args->skin_vars = serialize($obj);
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
/**
|
||||
* @class integration_searchAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief integration_search module의 admin view class
|
||||
* @brief admin view class of the integration_search module
|
||||
*
|
||||
* 통합검색 관리
|
||||
* Search Management
|
||||
*
|
||||
**/
|
||||
|
||||
|
|
@ -13,10 +13,10 @@
|
|||
var $config = null;
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
// 설정 정보를 받아옴 (module model 객체를 이용)
|
||||
// Get configurations (using module model object)
|
||||
$oModuleModel = &getModel('module');
|
||||
$this->config = $oModuleModel->getModuleConfig('integration_search');
|
||||
Context::set('config',$this->config);
|
||||
|
|
@ -25,22 +25,19 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 모듈 선정 및 스킨 설정
|
||||
* @brief Module selection and skin set
|
||||
**/
|
||||
function dispIntegration_searchAdminContent() {
|
||||
// 스킨 목록을 구해옴
|
||||
// Get a list of skins(themes)
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_list = $oModuleModel->getSkins($this->module_path);
|
||||
Context::set('skin_list',$skin_list);
|
||||
|
||||
// 모듈 카테고리 목록을 구함
|
||||
// Get a list of module categories
|
||||
$module_categories = $oModuleModel->getModuleCategories();
|
||||
|
||||
// 생성된 mid목록을 구함
|
||||
// Generated mid Wanted list
|
||||
$obj->site_srl = 0;
|
||||
$mid_list = $oModuleModel->getMidList($obj);
|
||||
|
||||
// module_category와 module의 조합
|
||||
// module_category and module combination
|
||||
if($module_categories) {
|
||||
foreach($mid_list as $module_srl => $module) {
|
||||
$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
||||
|
|
@ -50,22 +47,20 @@
|
|||
}
|
||||
|
||||
Context::set('mid_list',$module_categories);
|
||||
|
||||
// 샘플코드
|
||||
// Sample Code
|
||||
Context::set('sample_code', htmlspecialchars('<form action="{getUrl()}" method="get"><input type="hidden" name="vid" value="{$vid}" /><input type="hidden" name="mid" value="{$mid}" /><input type="hidden" name="act" value="IS" /><input type="text" name="is_keyword" class="inputTypeText" value="{$is_keyword}" /><span class="button"><input type="submit" value="{$lang->cmd_search}" /></span></form>') );
|
||||
|
||||
$this->setTemplateFile("index");
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 스킨 설정
|
||||
* @brief Skin Settings
|
||||
**/
|
||||
function dispIntegration_searchAdminSkinInfo() {
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $this->config->skin);
|
||||
$skin_vars = unserialize($this->config->skin_vars);
|
||||
|
||||
// skin_info에 extra_vars 값을 지정
|
||||
// value for skin_info extra_vars
|
||||
if(count($skin_info->extra_vars)) {
|
||||
foreach($skin_info->extra_vars as $key => $val) {
|
||||
$name = $val->name;
|
||||
|
|
|
|||
|
|
@ -2,16 +2,16 @@
|
|||
/**
|
||||
* @class integration_search
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief integration_search module의 view class
|
||||
* @brief view class of the integration_search module
|
||||
**/
|
||||
|
||||
class integration_search extends ModuleObject {
|
||||
|
||||
/**
|
||||
* @brief 설치시 추가 작업이 필요할시 구현
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// action forward에 등록
|
||||
// Registered in action forward
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertActionForward('integration_search', 'view', 'IS');
|
||||
|
||||
|
|
@ -19,21 +19,21 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 설치가 이상이 없는지 체크하는 method
|
||||
* @brief a method to check if successfully installed
|
||||
**/
|
||||
function checkUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업데이트 실행
|
||||
* @brief Execute update
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 캐시 파일 재생성
|
||||
* @brief Re-generate the cache file
|
||||
**/
|
||||
function recompileCache() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,18 +2,18 @@
|
|||
/**
|
||||
* @class integrationModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief integration 모듈의 Model class
|
||||
* @brief Model class of integration module
|
||||
**/
|
||||
|
||||
class integration_searchModel extends module {
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 게시글 검색
|
||||
* @brief Search documents
|
||||
**/
|
||||
function getDocuments($target, $module_srls_list, $search_target, $search_keyword, $page=1, $list_count = 20) {
|
||||
if(is_array($module_srls_list)) $module_srls_list = implode(',',$module_srls_list);
|
||||
|
|
@ -35,15 +35,14 @@
|
|||
$args->sort_index = 'list_order';
|
||||
$args->order_type = 'asc';
|
||||
if(!$args->module_srl) unset($args->module_srl);
|
||||
|
||||
// 대상 문서들을 가져옴
|
||||
// Get a list of documents
|
||||
$oDocumentModel = &getModel('document');
|
||||
|
||||
return $oDocumentModel->getDocumentList($args);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 댓글 검색
|
||||
* @brief Comment Search
|
||||
**/
|
||||
function getComments($target, $module_srls_list, $search_keyword, $page=1, $list_count = 20) {
|
||||
if(is_array($module_srls_list)) $module_srls = implode(',',$module_srls_list);
|
||||
|
|
@ -57,8 +56,7 @@
|
|||
$args->search_keyword = $search_keyword;
|
||||
$args->sort_index = 'list_order';
|
||||
$args->order_type = 'asc';
|
||||
|
||||
// 대상 문서들을 가져옴
|
||||
// Get a list of documents
|
||||
$oCommentModel = &getModel('comment');
|
||||
$output = $oCommentModel->getTotalCommentList($args);
|
||||
if(!$output->toBool()|| !$output->data) return $output;
|
||||
|
|
@ -66,7 +64,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 엮인글 검색
|
||||
* @brief Search trackbacks
|
||||
**/
|
||||
function getTrackbacks($target, $module_srls_list, $search_target = "title", $search_keyword, $page=1, $list_count = 20) {
|
||||
if(is_array($module_srls_list)) $module_srls = implode(',',$module_srls_list);
|
||||
|
|
@ -80,8 +78,7 @@
|
|||
$args->search_keyword = $search_keyword;
|
||||
$args->sort_index = 'list_order';
|
||||
$args->order_type = 'asc';
|
||||
|
||||
// 대상 문서들을 가져옴
|
||||
// Get a list of documents
|
||||
$oTrackbackModel = &getAdminModel('trackback');
|
||||
$output = $oTrackbackModel->getTotalTrackbackList($args);
|
||||
if(!$output->toBool()|| !$output->data) return $output;
|
||||
|
|
@ -89,7 +86,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 파일 검색
|
||||
* @brief File Search
|
||||
**/
|
||||
function _getFiles($target, $module_srls_list, $search_keyword, $page, $list_count, $direct_download = 'Y') {
|
||||
if(is_array($module_srls_list)) $module_srls = implode(',',$module_srls_list);
|
||||
|
|
@ -105,8 +102,7 @@
|
|||
$args->order_type = 'desc';
|
||||
$args->isvalid = 'Y';
|
||||
$args->direct_download = $direct_download=='Y'?'Y':'N';
|
||||
|
||||
// 대상 문서들을 가져옴
|
||||
// Get a list of documents
|
||||
$oFileAdminModel = &getAdminModel('file');
|
||||
$output = $oFileAdminModel->getFileList($args);
|
||||
if(!$output->toBool() || !$output->data) return $output;
|
||||
|
|
@ -120,8 +116,7 @@
|
|||
$obj->download_url = Context::getRequestUri().$val->download_url;
|
||||
$obj->target_srl = $val->upload_target_srl;
|
||||
$obj->file_size = $val->file_size;
|
||||
|
||||
// 이미지
|
||||
// Images
|
||||
if(preg_match('/\.(jpg|jpeg|gif|png)$/i', $val->source_filename)) {
|
||||
$obj->type = 'image';
|
||||
|
||||
|
|
@ -131,13 +126,11 @@
|
|||
$thumbnail_url = Context::getRequestUri().$thumbnail_file;
|
||||
if(!file_exists($thumbnail_file)) FileHandler::createImageFile($val->uploaded_filename, $thumbnail_file, 120, 120, 'jpg', 'crop');
|
||||
$obj->src = sprintf('<img src="%s" alt="%s" width="%d" height="%d" />', $thumbnail_url, htmlspecialchars($obj->filename), 120, 120);
|
||||
|
||||
// 동영상
|
||||
// Videos
|
||||
} elseif(preg_match('/\.(swf|flv|wmv|avi|mpg|mpeg|asx|asf|mp3)$/i', $val->source_filename)) {
|
||||
$obj->type = 'multimedia';
|
||||
$obj->src = sprintf('<script type="text/javascript">displayMultimedia("%s",120,120);</script>', $obj->download_url);
|
||||
|
||||
// 기타
|
||||
// Others
|
||||
} else {
|
||||
$obj->type = 'binary';
|
||||
$obj->src = '';
|
||||
|
|
@ -176,14 +169,14 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 멀티미디어 검색
|
||||
* @brief Multimedia Search
|
||||
**/
|
||||
function getImages($target, $module_srls_list, $search_keyword, $page=1, $list_count = 20) {
|
||||
return $this->_getFiles($target, $module_srls_list, $search_keyword, $page, $list_count);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 첨부파일 검색
|
||||
* @brief Search for attachments
|
||||
**/
|
||||
function getFiles($target, $module_srls_list, $search_keyword, $page=1, $list_count = 20) {
|
||||
return $this->_getFiles($target, $module_srls_list, $search_keyword, $page, $list_count, 'N');
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
/**
|
||||
* @class integration_searchView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief integration_search module의 view class
|
||||
* @brief view class of the integration_search module
|
||||
*
|
||||
* 통합검색 출력
|
||||
* Search Output
|
||||
*
|
||||
**/
|
||||
|
||||
|
|
@ -14,19 +14,18 @@
|
|||
var $skin = 'default';
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 통합 검색 출력
|
||||
* @brief Search Result
|
||||
**/
|
||||
function IS() {
|
||||
$oFile = &getClass('file');
|
||||
$oModuleModel = &getModel('module');
|
||||
|
||||
// 권한 체크
|
||||
// Check permissions
|
||||
if(!$this->grant->access) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
$config = $oModuleModel->getModuleConfig('integration_search');
|
||||
|
|
@ -37,18 +36,14 @@
|
|||
$target = $config->target;
|
||||
if(!$target) $target = 'include';
|
||||
$module_srl_list = explode(',',$config->target_module_srl);
|
||||
|
||||
// 검색어 변수 설정
|
||||
// Set a variable for search keyword
|
||||
$is_keyword = Context::get('is_keyword');
|
||||
|
||||
// 페이지 변수 설정
|
||||
// Set page variables
|
||||
$page = (int)Context::get('page');
|
||||
if(!$page) $page = 1;
|
||||
|
||||
// 검색탭에 따른 검색
|
||||
// Search by search tab
|
||||
$where = Context::get('where');
|
||||
|
||||
// integration search model객체 생성
|
||||
// Create integration search model object
|
||||
if($is_keyword) {
|
||||
$oIS = &getModel('integration_search');
|
||||
switch($where) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue