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:
mosmartin 2011-04-06 16:48:06 +00:00
parent 693e215bc1
commit 4d272994dd
219 changed files with 6407 additions and 8705 deletions

View file

@ -2,22 +2,22 @@
/**
* @class rssAdminController
* @author NHN (developers@xpressengine.com)
* @brief rss module의 admin controller class
* @brief The admin controller class of the rss module
*
* RSS 2.0형식으로 문서 출력
* RSS 2.0 format document output
*
**/
class rssAdminController extends rss {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
}
/**
* @brief RSS 전체피드 설정
* @brief All RSS feeds configurations
**/
function procRssAdminInsertConfig() {
$oModuleModel = &getModel('module');
@ -33,28 +33,26 @@
if($config_vars->image || $config_vars->del_image) {
$image_obj = $config_vars->image;
$config_vars->image = $total_config->image;
// 삭제 요청에 대한 변수를 구함
// Get a variable for the delete request
if($config_vars->del_image == 'Y' || $image_obj) {
FileHandler::removeFile($config_vars->image);
$config_vars->image = '';
$total_config->image = '';
}
// 정상적으로 업로드된 파일이 아니면 무시
// Ignore if the file is not the one which has been successfully uploaded
if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name'])) {
// 이미지 파일이 아니어도 무시 (swf는 패스~)
// Ignore if the file is not an image (swf is accepted ~)
$image_obj['name'] = Context::convertEncodingStr($image_obj['name']);
if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format';
else {
// 경로를 정해서 업로드
// Upload the file to a path
$path = './files/attach/images/rss/';
// 디렉토리 생성
// Create a directory
if(!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured';
else{
$filename = $path.$image_obj['name'];
// 파일 이동
// Move the file
if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured';
else {
$config_vars->image = $filename;
@ -80,13 +78,12 @@
/**
* @brief RSS 모듈별 설정
* @brief RSS Module configurations
**/
function procRssAdminInsertModuleConfig() {
// 대상을 구함
// Get the object
$module_srl = Context::get('target_module_srl');
// 여러개의 모듈 일괄 설정일 경우
// In case of batch configuration of several modules
if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl);
else $module_srl = array($module_srl);
if(!is_array($module_srl)) $module_srl[0] = $module_srl;
@ -101,8 +98,7 @@
if(!$module_srl || !$open_rss) return new Object(-1, 'msg_invalid_request');
if(!in_array($open_rss, array('Y','H','N'))) $open_rss = 'N';
// 설정 저장
// Save configurations
for($i=0;$i<count($module_srl);$i++) {
$srl = trim($module_srl[$i]);
if(!$srl) continue;
@ -115,12 +111,11 @@
/**
* @brief Feed 전체 포함/미포함 체인지
* @brief All Feeds with or without change
**/
function procRssAdminToggleActivate() {
$oRssModel = &getModel('rss');
// mid값을 받아옴
// Get mid value
$module_srl = Context::get('module_srl');
if($module_srl) {
$config = $oRssModel->getRssModuleConfig($module_srl);
@ -139,7 +134,7 @@
/**
* @brief RSS모듈의 전체 Feed 설정용 함수
* @brief A funciton to configure all Feeds of the RSS module
**/
function setFeedConfig($config) {
$oModuleController = &getController('module');
@ -149,7 +144,7 @@
/**
* @brief RSS 모듈별 설정 함수
* @brief A function t configure the RSS module
**/
function setRssModuleConfig($module_srl, $open_rss, $open_total_feed = 'N', $feed_description = 'N', $feed_copyright = 'N') {
$oModuleController = &getController('module');

View file

@ -2,21 +2,21 @@
/**
* @class rssAdminView
* @author misol (misol@korea.ac.kr)
* @brief rss 모듈의 admin view class
* @brief The admin view class of the rss module
**/
class rssAdminView extends rss {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
// 템플릿 경로 지정
//Set template path
$this->setTemplatePath($this->module_path.'tpl');
}
/**
* @brief 관리자 페이지 초기화면
* @brief In case an administrator page has been initialized
**/
function dispRssAdminIndex() {
$oModuleModel = &getModel('module');

View file

@ -2,43 +2,38 @@
/**
* @class rss
* @author NHN (developers@xpressengine.com)
* @brief rss module의 view class
* @brief The view class of the rss module
**/
class rss extends ModuleObject {
/**
* @brief 설치시 추가 작업이 필요할시 구현
* @brief Additional tasks required to accomplish during the installation
**/
function moduleInstall() {
// action forward에 등록
// Register in action forward
$oModuleController = &getController('module');
$oModuleController->insertActionForward('rss', 'view', 'rss');
$oModuleController->insertActionForward('rss', 'view', 'atom');
// 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가
// 2007.10.18 Add a trigger for participating additional configurations of the service module
$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
// 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출
// 2007. 10. 19 Call the trigger to set RSS URL before outputing
$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
return new Object();
}
/**
* @brief 설치가 이상이 없는지 체크하는 method
* @brief A method to check if the installation has been successful
**/
function checkUpdate() {
$oModuleModel = &getModel('module');
// atom 을 위한 Action forward 추가
// Add the Action forward for atom
if(!$oModuleModel->getActionForward('atom')) return true;
// 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가
// 2007. 10. Add a trigger for participating additional configurations of the service module
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true;
// 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출
// 2007. 10. 19 Call the trigger to set RSS URL before outputing
if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true;
if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true;
@ -47,21 +42,18 @@
}
/**
* @brief 업데이트 실행
* @brief Execute update
**/
function moduleUpdate() {
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// atom act 추가
// Add atom act
if(!$oModuleModel->getActionForward('atom'))
$oModuleController->insertActionForward('rss', 'view', 'atom');
// 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가
// 2007. 10. An additional set of 18 to participate in a service module, add a trigger
if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'))
$oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before');
// 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출
// 2007. 10. 19 outputs the trigger before you call to set up rss url
if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'))
$oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after');
if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'))
@ -71,7 +63,7 @@
}
/**
* @brief 캐시 파일 재생성
* @brief Re-generate the cache file
**/
function recompileCache() {
}

View file

@ -2,22 +2,22 @@
/**
* @class rssController
* @author NHN (developers@xpressengine.com)
* @brief rss module의 controller class
* @brief rss module of the controller class
*
* Feed 문서 출력
* Feed the document output
*
**/
class rssController extends rss {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
}
/**
* @brief RSS 사용 유무를 체크하여 rss url 추가
* @brief Check whether to use RSS rss url by adding
**/
function triggerRssUrlInsert() {
$oModuleModel = &getModel('module');
@ -31,8 +31,7 @@
}
if(!$current_module_srl) return new Object();
// 선택된 모듈의 rss설정을 가져옴
// Imported rss settings of the selected module
$oRssModel = &getModel('rss');
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);

View file

@ -2,20 +2,20 @@
/**
* @class rssModel
* @author NHN (developers@xpressengine.com)
* @brief rss module의 model class
* @brief The model class of the rss module
*
* Feed 문서 출력
* Feed the document output
*
**/
class rssModel extends rss {
/**
* @brief Feed url 생성.
* @brief Create the Feed url.
**/
function getModuleFeedUrl($vid = null, $mid, $format) {
if(Context::isAllowRewrite()) {
$request_uri = Context::getRequestUri();
// 가상 사이트 변수가 있고 이 변수가 mid와 다를때. (vid와 mid는 같을 수 없다고 함)
// If the virtual site variable exists and it is different from mid (vid and mid should not be the same)
if($vid && $vid != $mid) {
return $request_uri.$vid.'/'.$mid.'/'.$format;
}
@ -30,10 +30,10 @@
/**
* @brief 특정 모듈의 rss 설정을 return
* @brief Return the RSS configurations of the specific modules
**/
function getRssModuleConfig($module_srl) {
// rss 모듈의 config를 가져옴
// Get the configurations of the rss module
$oModuleModel = &getModel('module');
$module_rss_config = $oModuleModel->getModulePartConfig('rss', $module_srl);
if(!$module_rss_config) $module_rss_config->open_rss = 'N';

View file

@ -2,34 +2,33 @@
/**
* @class rssView
* @author NHN (developers@xpressengine.com)
* @brief rss module의 view class
* @brief The view class of the rss module
*
* Feed 문서 출력
* Feed the document output
*
**/
class rssView extends rss {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
}
/**
* @brief 피드 출력
* 직접 RSS를 출력하려고 할때에는 $oRssView->rss($document_list) 통해서 결과값을 직접 지정 가능
* @brief Feed output
* When trying to directly print out the RSS, the results variable can be directly specified through $oRssView->rss($document_list)
**/
function rss($document_list = null, $rss_title = null, $add_description = null) {
$oDocumentModel = &getModel('document');
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// 다른 모듈에서 method로 호출되는 것이 아니라면 현재 요청된 모듈을 대상으로 글과 정보를 구함
// Get the content and information for the current requested module if the method is not called from another module
if(!$document_list) {
$site_module_info = Context::get('site_module_info');
$site_srl = $site_module_info->site_srl;
$mid = Context::get('mid'); ///< 대상 모듈 id, 없으면 전체로
$mid = Context::get('mid'); // The target module id, if absent, then all
$start_date = (int)Context::get('start_date');
$end_date = (int)Context::get('end_date');
@ -37,8 +36,7 @@
$rss_config = array();
$total_config = '';
$total_config = $oModuleModel->getModuleConfig('rss');
// 하나의 mid가 지정되어 있으면 그 mid에 대한 것만 추출
// If one is specified, extract only for this mid
if($mid) {
$module_srl = $this->module_info->module_srl;
$config = $oModuleModel->getModulePartConfig('rss', $module_srl);
@ -46,8 +44,7 @@
$module_srls[] = $module_srl;
$open_rss_config[$module_srl] = $config->open_rss;
}
// mid 가 선택되어 있지 않으면 전체
// If mid is not selected, then get all
} else {
if($total_config->use_total_feed != 'N') {
$rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl);
@ -83,8 +80,7 @@
$args->order_type = 'asc';
$output = $oDocumentModel->getDocumentList($args);
$document_list = $output->data;
// 피드 제목 및 정보등을 추출 Context::getBrowserTitle
// Extract the feed title and information with Context::getBrowserTitle
if($mid) {
$info->title = Context::getBrowserTitle();
$oModuleController->replaceDefinedLangCode($info->title);
@ -150,17 +146,14 @@
}
$info->language = Context::getLangType();
// RSS 출력물에서 사용될 변수 세팅
// Set the variables used in the RSS output
Context::set('info', $info);
Context::set('feed_config', $config);
Context::set('open_rss_config', $open_rss_config);
Context::set('document_list', $document_list);
// 결과 출력을 XMLRPC로 강제 지정
// Force the result output to be of XMLRPC
Context::setResponseMethod("XMLRPC");
// 결과물을 얻어와서 에디터 컴포넌트등의 전처리 기능을 수행시킴
// Perform the preprocessing function of the editor component as the results are obtained
$path = $this->module_path.'tpl/';
//if($args->start_date || $args->end_date) $file = 'xe_rss';
//else $file = 'rss20';
@ -183,47 +176,45 @@
$content = $oTemplate->compile($path, $file);
Context::set('content', $content);
// 템플릿 파일 지정
// Set the template file
$this->setTemplatePath($path);
$this->setTemplateFile('display');
}
/** @brief ATOM 출력 **/
/**
* @brief ATOM output
**/
function atom() {
Context::set('format', 'atom');
$this->rss();
}
/**
* @brief 에러 출력
* @brief Error output
**/
function dispError() {
// 출력 메세지 작성
// Prepare the output message
$this->rss(null, null, Context::getLang('msg_rss_is_disabled') );
}
/**
* @brief 서비스형 모듈의 추가 설정을 위한 부분
* rss의 사용 형태에 대한 설정만 받음
* @brief Additional configurations for a service module
* Receive the form for the form used by rss
**/
function triggerDispRssAdditionSetup(&$obj) {
$current_module_srl = Context::get('module_srl');
$current_module_srls = Context::get('module_srls');
if(!$current_module_srl && !$current_module_srls) {
// 선택된 모듈의 정보를 가져옴
// Get information of the selected module
$current_module_info = Context::get('current_module_info');
$current_module_srl = $current_module_info->module_srl;
if(!$current_module_srl) return new Object();
}
// 선택된 모듈의 rss설정을 가져옴
// Get teh RSS configurations for the selected module
$oRssModel = &getModel('rss');
$rss_config = $oRssModel->getRssModuleConfig($current_module_srl);
Context::set('rss_config', $rss_config);
// 템플릿 파일 지정
// Set the template file
$oTemplate = &TemplateHandler::getInstance();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'rss_module_config');
$obj .= $tpl;