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,19 +2,19 @@
/**
* @class pollAdminController
* @author NHN (developers@xpressengine.com)
* @brief poll모듈의 admin controller class
* @brief The admin controller class of the poll module
**/
class pollAdminController extends poll {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
}
/**
* @brief 설정 저장
* @brief Save the configurations
**/
function procPollAdminInsertConfig() {
$config->skin = Context::get('skin');
@ -27,18 +27,17 @@
}
/**
* @brief 관리자 페이지에서 선택된 설문조사들을 삭제
* @brief Delete the polls selected in the administrator's page
**/
function procPollAdminDeleteChecked() {
// 선택된 글이 없으면 오류 표시
// Display an error no post is selected
$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');
// 글삭제
// Delete the post
for($i=0;$i<$poll_count;$i++) {
$poll_index_srl = trim($poll_srl_list[$i]);
if(!$poll_index_srl) continue;
@ -51,7 +50,7 @@
}
/**
* @brief 설문조사 삭제 (한번에 여러개의 설문 등록시 하나의 설문만 삭제)
* @brief Delete the poll (when several questions are registered in one poll, delete this question)
**/
function deletePollTitle($poll_index_srl) {
$args->poll_index_srl = $poll_index_srl;
@ -77,7 +76,7 @@
}
/**
* @brief 설문조사 삭제 (하나의 묶인 설문조사를 통째로 삭제)
* @brief Delete the poll (delete the entire poll)
**/
function deletePoll($poll_srl) {
$args->poll_srl = $poll_srl;

View file

@ -2,19 +2,19 @@
/**
* @class pollAdminModel
* @author NHN (developers@xpressengine.com)
* @brief poll 모듈의 admin model class
* @brief The admin model class of the poll module
**/
class pollAdminModel extends poll {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
}
/**
* @brief 설문 목록 구해옴
* @brief Get the list of polls
**/
function getPollList($args) {
$output = executeQuery('poll.getPollList', $args);
@ -25,7 +25,7 @@
}
/**
* @brief 설문조사의 원본을 구함
* @brief Get the original poll
**/
function getPollAdminTarget() {
$poll_srl = Context::get('poll_srl');

View file

@ -2,22 +2,22 @@
/**
* @class pollAdminView
* @author NHN (developers@xpressengine.com)
* @brief poll모듈의 admin view class
* @brief The admin view class of the poll module
**/
class pollAdminView extends poll {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
}
/**
* @brief 관리자 페이지
* @brief Administrator's Page
**/
function dispPollAdminList() {
// 검색 옵션 정리
// Arrange the search options
$search_target = trim(Context::get('search_target'));
$search_keyword = trim(Context::get('search_keyword'));
@ -35,62 +35,56 @@
break;
}
}
// 목록을 구하기 위한 옵션
$args->page = Context::get('page'); ///< 페이지
$args->list_count = 50; ///< 한페이지에 보여줄 글 수
$args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수
// Options to get a list of pages
$args->page = Context::get('page');
$args->list_count = 50; // The number of posts to show on one page
$args->page_count = 10; // The number of pages to display in the page navigation
$args->sort_index = 'list_order'; ///< 소팅 값
$args->sort_index = 'list_order'; // Sorting value
// 목록 구함
// Get the list
$oPollAdminModel = &getAdminModel('poll');
$output = $oPollAdminModel->getPollList($args);
// 템플릿 변수 설정
// Configure the template variables
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('poll_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
Context::set('module_list', $module_list);
// 템플릿 지정
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('poll_list');
}
/**
* @brief 설문조사 스킨, 컬러셋 설정
* @brief Confgure the poll skin and colorset
**/
function dispPollAdminConfig() {
$oModuleModel = &getModel('module');
// 설정 정보 가져오기
// Get the configuration information
$config = $oModuleModel->getModuleConfig('poll');
Context::set('config', $config);
// 스킨 정보 가져오기
// Get the skin information
$skin_list = $oModuleModel->getSkins($this->module_path);
Context::set('skin_list', $skin_list);
if(!$skin_list[$config->skin]) $config->skin = "default";
// 설정된 스킨의 컬러셋 설정
// Set the skin colorset once the configurations is completed
Context::set('colorset_list', $skin_list[$config->skin]->colorset);
// 템플릿 지정
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config');
}
/**
* @brief 설문조사 결과
* @brief Poll Results
**/
function dispPollAdminResult() {
// 팝업 레이아웃
// Popup layout
$this->setLayoutFile("popup_layout");
// 결과 뽑기
// Draw results
$args->poll_srl = Context::get('poll_srl');
$args->poll_index_srl = Context::get('poll_index_srl');
@ -114,8 +108,7 @@
$poll->poll_srl = $poll_srl;
Context::set('poll',$poll);
// 기본 설정의 스킨, 컬러셋 설정
// Configure the skin and the colorset for the default configuration
$oModuleModel = &getModel('module');
$poll_config = $oModuleModel->getModuleConfig('poll');
Context::set('poll_config', $poll_config);

View file

@ -2,25 +2,23 @@
/**
* @class poll
* @author NHN (developers@xpressengine.com)
* @brief poll모듈의 high class
* @brief The parent class of the poll module
**/
class poll extends ModuleObject {
/**
* @brief 설치시 추가 작업이 필요할시 구현
* @brief Additional tasks required to accomplish during the installation
**/
function moduleInstall() {
// action forward에 등록 (관리자 모드에서 사용하기 위함)
// Register in the action forward (to use in administrator mode)
$oModuleController = &getController('module');
// 기본 스킨 설정
// Set the default skin
$oModuleController = &getController('module');
$config->skin = 'default';
$config->colorset = 'normal';
$oModuleController->insertModuleConfig('poll', $config);
// 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제
// 2007.10.17 When deleting posts/comments delete the poll as well
$oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
$oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after');
$oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after');
@ -32,12 +30,11 @@
}
/**
* @brief 설치가 이상이 없는지 체크하는 method
* @brief A method to check if the installation has been successful
**/
function checkUpdate() {
$oModuleModel = &getModel('module');
// 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제
// 2007.10.17 When deleting posts/comments delete the poll as well
if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) return true;
@ -49,19 +46,17 @@
}
/**
* @brief 업데이트 실행
* @brief Execute update
**/
function moduleUpdate() {
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제
// 2007.10.17 When deleting posts/comments delete the poll as well
if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'))
$oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'))
$oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
// 2008. 04. 22 글/댓글의 추가기 설문조사의 연결
// 2008.04.22 A poll connection to add posts/comments
if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'))
$oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'))
@ -75,7 +70,7 @@
}
/**
* @brief 캐시 파일 재생성
* @brief Re-generate the cache file
**/
function recompileCache() {
}

View file

@ -2,19 +2,19 @@
/**
* @class pollController
* @author NHN (developers@xpressengine.com)
* @brief poll모듈의 Controller class
* @brief Controller class for poll module
**/
class pollController extends poll {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
}
/**
* @brief 팝업창에서 설문 작성 완료후 저장을 누를때 설문 등록
* @brief after a qeustion is created in the popup window, register the question during the save time
**/
function procInsert() {
$stop_date = Context::get('stop_date');
@ -32,7 +32,7 @@
if(Context::get('is_logged')) {
$logged_info = Context::get('logged_info');
// 세션에서 최고 관리자가 아니면 태그 제거
// Remove the tag if the it is not the top administrator in the session
if($logged_info->is_admin != 'Y') $val = htmlspecialchars($val);
}
@ -49,8 +49,7 @@
if(!count($args->poll)) return new Object(-1, 'cmd_null_item');
$args->stop_date = $stop_date;
// 변수 설정
// Configure the variables
$poll_srl = getNextSequence();
$logged_info = Context::get('logged_info');
@ -58,8 +57,7 @@
$oDB = &DB::getInstance();
$oDB->begin();
// 설문의 등록
// Register the poll
unset($poll_args);
$poll_args->poll_srl = $poll_srl;
$poll_args->member_srl = $member_srl;
@ -71,8 +69,7 @@
$oDB->rollback();
return $output;
}
// 개별 설문 등록
// Individual poll registration
foreach($args->poll as $key => $val) {
unset($title_args);
$title_args->poll_srl = $poll_srl;
@ -88,8 +85,7 @@
$oDB->rollback();
return $output;
}
// 개별 설문의 항목 추가
// Add the individual survey items
foreach($val->item as $k => $v) {
unset($item_args);
$item_args->poll_srl = $poll_srl;
@ -112,7 +108,7 @@
}
/**
* @brief 설문 조사에 응함
* @brief Accept the poll
**/
function procPoll() {
$poll_srl = Context::get('poll_srl');
@ -123,11 +119,9 @@
if(!$srl) continue;
$item_srls[] = $srl;
}
// 응답항목이 없으면 오류
// If there is no response item, display an error
if(!count($item_srls)) return new Object(-1, 'msg_check_poll_item');
// 이미 설문하였는지 조사
// Make sure is the poll has already been taken
$oPollModel = &getModel('poll');
if($oPollModel->isPolled($poll_srl)) return new Object(-1, 'msg_already_poll');
@ -135,24 +129,21 @@
$oDB->begin();
$args->poll_srl = $poll_srl;
// 해당 글의 모든 설문조사의 응답수 올림
// Update all poll responses related to the post
$output = executeQuery('poll.updatePoll', $args);
$output = executeQuery('poll.updatePollTitle', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 각 설문조사의 선택된 항목을 기록
// Record each polls selected items
$args->poll_item_srl = implode(',',$item_srls);
$output = executeQuery('poll.updatePollItems', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// 응답자 정보를 로그로 남김
// Log the respondent's information
$log_args->poll_srl = $poll_srl;
$logged_info = Context::get('logged_info');
@ -170,8 +161,7 @@
$skin = Context::get('skin');
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
// tpl 가져오기
// Get tpl
$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
$this->add('poll_srl', $poll_srl);
@ -180,7 +170,7 @@
}
/**
* @brief 결과 미리 보기
* @brief Preview the results
**/
function procPollViewResult() {
$poll_srl = Context::get('poll_srl');
@ -196,7 +186,7 @@
}
/**
* @brief 게시글 등록시 poll 연결하는 trigger
* @brief A poll synchronization trigger when a new post is registered
**/
function triggerInsertDocumentPoll(&$obj) {
$this->syncPoll($obj->document_srl, $obj->content);
@ -204,7 +194,7 @@
}
/**
* @brief 댓글 등록시 poll 연결하는 trigger
* @brief A poll synchronization trigger when a new comment is registered
**/
function triggerInsertCommentPoll(&$obj) {
$this->syncPoll($obj->comment_srl, $obj->content);
@ -212,7 +202,7 @@
}
/**
* @brief 게시글 수정시 poll 연결하는 trigger
* @brief A poll synchronization trigger when a post is updated
**/
function triggerUpdateDocumentPoll(&$obj) {
$this->syncPoll($obj->document_srl, $obj->content);
@ -220,7 +210,7 @@
}
/**
* @brief 댓글 등록시 poll 연결하는 trigger
* @brief A poll synchronization trigger when a comment is updated
**/
function triggerUpdateCommentPoll(&$obj) {
$this->syncPoll($obj->comment_srl, $obj->content);
@ -228,13 +218,12 @@
}
/**
* @brief 게시글 삭제시 poll 삭제하는 trigger
* @brief A poll deletion trigger when a post is removed
**/
function triggerDeleteDocumentPoll(&$obj) {
$document_srl = $obj->document_srl;
if(!$document_srl) return new Object();
// 설문조사를 구함
// Get the poll
$args->upload_target_srl = $document_srl;
$output = executeQuery('poll.getPollByTargetSrl', $args);
if(!$output->data) return new Object();
@ -260,13 +249,12 @@
}
/**
* @brief 댓글 삭제시 poll 삭제하는 trigger
* @brief A poll deletion trigger when a comment is removed
**/
function triggerDeleteCommentPoll(&$obj) {
$comment_srl = $obj->comment_srl;
if(!$comment_srl) return new Object();
// 설문조사를 구함
// Get the poll
$args->upload_target_srl = $comment_srl;
$output = executeQuery('poll.getPollByTargetSrl', $args);
if(!$output->data) return new Object();
@ -292,7 +280,7 @@
}
/**
* @brief 게시글 내용의 설문조사를 구해와서 문서 번호와 연결
* @brief As post content's poll is obtained, synchronize the poll using the document number
**/
function syncPoll($upload_target_srl, $content) {
$match_cnt = preg_match_all('!<img([^\>]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^\>]*?)\>!is',$content, $matches);

View file

@ -2,19 +2,19 @@
/**
* @class pollModel
* @author NHN (developers@xpressengine.com)
* @brief poll 모듈의 model class
* @brief The model class for the poll modules
**/
class pollModel extends poll {
/**
* @brief 초기화
* @brief Initialization
**/
function init() {
}
/**
* @brief 이미 설문 조사를 하였는지 검사하는 함수
* @brief The function examines if the user has already been polled
**/
function isPolled($poll_srl) {
$args->poll_srl = $poll_srl;
@ -31,14 +31,13 @@
}
/**
* @brief 설문조사의 html데이터를 return
* 설문조사에 응하였는지에 대한 체크를 결과를 return
* @brief Return the HTML data of the survey
* Return the result after checking if the poll has responses
**/
function getPollHtml($poll_srl, $style = '', $skin = 'default') {
$args->poll_srl = $poll_srl;
// 해당 설문조사에 대한 내용을 조사
// Get the information related to the survey
$output = executeQuery('poll.getPoll', $args);
if(!$output->data) return '';
@ -61,8 +60,7 @@
}
$poll->poll_srl = $poll_srl;
// 종료일이 지났으면 무조건 결과만
// Only ongoing poll results
if($poll->stop_date > date("Ymd")) {
if($this->isPolled($poll_srl)) $tpl_file = "result";
else $tpl_file = "form";
@ -72,8 +70,7 @@
Context::set('poll',$poll);
Context::set('skin',$skin);
// 기본 설정의 스킨, 컬러셋 설정
// The skin for the default configurations, and the colorset configurations
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
$oTemplate = &TemplateHandler::getInstance();
@ -81,12 +78,11 @@
}
/**
* @brief 결과 html을 return
* @brief Return the result's HTML
**/
function getPollResultHtml($poll_srl, $skin = 'default') {
$args->poll_srl = $poll_srl;
// 해당 설문조사에 대한 내용을 조사
// Get the information related to the survey
$output = executeQuery('poll.getPoll', $args);
if(!$output->data) return '';
@ -113,16 +109,14 @@
$tpl_file = "result";
Context::set('poll',$poll);
// 기본 설정의 스킨, 컬러셋 설정
// The skin for the default configurations, and the colorset configurations
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
/**
* @brief 선택된 설문조사 - 스킨의 컬러셋을 return
/** [TO REVIEW]
* @brief Selected poll - return the colorset of the skin
**/
function getPollGetColorsetList() {
$skin = Context::get('skin');