diff --git a/addons/autolink/autolink.addon.php b/addons/autolink/autolink.addon.php
index 831254057..56ad64f85 100644
--- a/addons/autolink/autolink.addon.php
+++ b/addons/autolink/autolink.addon.php
@@ -4,7 +4,7 @@
/**
* @file autolink.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief 자동 링크 애드온
+ * @brief Automatic link add-on
**/
if($called_position == 'after_module_proc' && Context::getResponseMethod()!="XMLRPC") {
Context::addJsFile('./addons/autolink/autolink.js', false ,'', null, 'body');
diff --git a/addons/blogapi/blogapi.addon.php b/addons/blogapi/blogapi.addon.php
index 6fc86aadc..c17ecb9ed 100644
--- a/addons/blogapi/blogapi.addon.php
+++ b/addons/blogapi/blogapi.addon.php
@@ -4,57 +4,47 @@
/**
* @file blogapicounter.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief blogAPI 애드온
+ * @brief Add blogAPI
*
- * ms live writer, 파이어폭스의 performancing, zoundry 등의 외부 툴을 이용하여 글을 입력할 수 있게 합니다.
- * 모듈 실행 이전(before_module_proc)에 호출이 되어야 하며 정상동작후에는 강제 종료를 한다.
+ * It enables to write a post by using an external tool such as ms live writer, firefox performancing, zoundry and so on.
+ * It should be called before executing the module(before_module_proc). If not, it is forced to shut down.
**/
-
- // called_position가 after_module_proc일때 rsd 태그 삽입
+ // Insert a rsd tag when called_position is after_module_proc
if($called_position == 'after_module_proc') {
- // 현재 모듈의 rsd주소를 만듬
+ // Create rsd address of the current module
$site_module_info = Context::get('site_module_info');
$rsd_url = getFullSiteUrl($site_module_info->domain, '', 'mid',$site_module_info->mid, 'act','api');
-
- // 헤더에 rsd태그 삽입
+ // Insert rsd tag into the header
Context::addHtmlHeader(" ".'');
}
-
- // act가 api가 아니면 그냥 리턴~
+ // If act isnot api, just return
if($_REQUEST['act']!='api') return;
-
- // 관련 func 파일 읽음
+ // Read func file
require_once('./addons/blogapi/blogapi.func.php');
-
- // xmlprc 파싱
- // 요청된 xmlrpc를 파싱
+ // xmlprc parsing
+ // Parse the requested xmlrpc
$oXmlParser = new XmlParser();
$xmlDoc = $oXmlParser->parse();
$method_name = $xmlDoc->methodcall->methodname->body;
$params = $xmlDoc->methodcall->params->param;
if($params && !is_array($params)) $params = array($params);
-
- // 일부 methodname에 대한 호환
+ // Compatible with some of methodname
if(in_array($method_name, array('metaWeblog.deletePost', 'metaWeblog.getUsersBlogs', 'metaWeblog.getUserInfo'))) {
$method_name = str_replace('metaWeblog.', 'blogger.', $method_name);
}
-
- // blogger.deletePost일 경우 첫번째 인자 값 삭제
+ // Delete the first argument if it is blogger.deletePost
if($method_name == 'blogger.deletePost') array_shift($params);
-
- // user_id, password를 구해서 로그인 시도
+ // Get user_id, password and attempt log-in
$user_id = trim($params[1]->value->string->body);
$password = trim($params[2]->value->string->body);
-
- // 모듈 실행전이라면 인증을 처리한다.
+ // Before executing the module, authentication is processed.
if($called_position == 'before_module_init') {
-
- // member controller을 이용해서 로그인 시도
+ // Attempt log-in by using member controller
if($user_id && $password) {
$oMemberController = &getController('member');
$output = $oMemberController->doLogin($user_id, $password);
- // 로그인 실패시 에러 메시지 출력
+ // If login fails, an error message appears
if(!$output->toBool()) {
$content = getXmlRpcFailure(1, $output->getMessage());
printContent($content);
@@ -64,25 +54,21 @@
printContent($content);
}
}
-
- // 모듈에서 무언가 작업을 하기 전에 blogapi tool의 요청에 대한 처리를 하고 강제 종료한다.
+ // Before module processing, handle requests from blogapi tool and then terminate.
if($called_position == 'before_module_proc') {
-
- // 글쓰기 권한 체크 (권한명의 경우 약속이 필요할듯..)
+ // Check writing permission
if(!$this->grant->write_document) {
printContent( getXmlRpcFailure(1, 'no permission') );
}
-
- // 카테고리의 정보를 구해옴
+ // Get information of the categories
$oDocumentModel = &getModel('document');
$category_list = $oDocumentModel->getCategoryList($this->module_srl);
-
- // 임시 파일 저장 장소 지정
+ // Specifies a temporary file storage
$tmp_uploaded_path = sprintf('./files/cache/blogapi/%s/%s/', $this->mid, $user_id);
$uploaded_target_path = sprintf('/files/cache/blogapi/%s/%s/', $this->mid, $user_id);
switch($method_name) {
- // 블로그 정보
+ // Blog information
case 'blogger.getUsersBlogs' :
$obj->url = getFullSiteUrl('');
$obj->blogid = $this->mid;
@@ -92,8 +78,7 @@
$content = getXmlRpcResponse($blog_list);
printContent($content);
break;
-
- // 카테고리 목록 return
+ // Return a list of categories
case 'metaWeblog.getCategories' :
$category_obj_list = array();
if($category_list) {
@@ -111,10 +96,9 @@
$content = getXmlRpcResponse($category_obj_list);
printContent($content);
break;
-
- // 파일 업로드
+ // Upload file
case 'metaWeblog.newMediaObject' :
- // 파일 업로드 권한 체크
+ // Check a file upload permission
$oFileModel = &getModel('file');
$file_module_config = $oFileModel->getFileModuleConfig($this->module_srl);
if(is_array($file_module_config->download_grant) && count($file_module_config->download_grant)>0) {
@@ -151,8 +135,7 @@
$content = getXmlRpcResponse($obj);
printContent($content);
break;
-
- // 글 가져오기
+ // Get posts
case 'metaWeblog.getPost' :
$document_srl = $params[0]->value->string->body;
if(!$document_srl) {
@@ -163,7 +146,7 @@
if(!$oDocument->isExists() || !$oDocument->isGranted()) {
printContent( getXmlRpcFailure(1, 'no permission') );
} else {
- // 카테고리를 사용하는지 확인후 사용시 카테고리 목록을 구해와서 Context에 세팅
+ // Get a list of categories and set Context
$category = "";
if($oDocument->get('category_srl')) {
$oDocumentModel = &getModel('document');
@@ -203,12 +186,11 @@
}
}
break;
-
- // 글작성
+ // Write a new post
case 'metaWeblog.newPost' :
unset($obj);
$info = $params[3];
- // 글, 제목, 카테고리 정보 구함
+ // Get information of post, title, and category
for($i=0;$ivalue->struct->member);$i++) {
$val = $info->value->struct->member[$i];
switch($val->name->body) {
@@ -239,13 +221,11 @@
}
}
-
- // 문서 번호 설정
+ // Set document srl
$document_srl = getNextSequence();
$obj->document_srl = $document_srl;
$obj->module_srl = $this->module_srl;
-
- // 첨부파일 정리
+ // Attachment
if(is_dir($tmp_uploaded_path)) {
$file_list = FileHandler::readDir($tmp_uploaded_path);
$file_count = count($file_list);
@@ -276,8 +256,7 @@
printContent($content);
break;
-
- // 글 수정
+ // Edit post
case 'metaWeblog.editPost' :
$tmp_val = $params[0]->value->string->body;
if(!$tmp_val) $tmp_val = $params[0]->value->i4->body;
@@ -294,8 +273,7 @@
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
-
- // 글 수정 권한 체크
+ // Check if a permission to modify a document is granted
if(!$oDocument->isGranted()) {
$content = getXmlRpcFailure(1, 'no permission');
break;
@@ -304,8 +282,7 @@
$obj = $oDocument->getObjectVars();
$info = $params[3];
-
- // 글, 제목, 카테고리 정보 구함
+ // Get information of post, title, and category
for($i=0;$ivalue->struct->member);$i++) {
$val = $info->value->struct->member[$i];
switch($val->name->body) {
@@ -336,12 +313,10 @@
}
}
-
- // 문서 번호 설정
+ // Document srl
$obj->document_srl = $document_srl;
$obj->module_srl = $this->module_srl;
-
- // 첨부파일 정리
+ // Attachment
if(is_dir($tmp_uploaded_path)) {
$file_list = FileHandler::readDir($tmp_uploaded_path);
$file_count = count($file_list);
@@ -374,27 +349,22 @@
printContent($content);
break;
-
- // 글삭제
+ // Delete the post
case 'blogger.deletePost' :
$tmp_val = $params[0]->value->string->body;
$tmp_arr = explode('/', $tmp_val);
$document_srl = array_pop($tmp_arr);
-
- // 글 받아오기
+ // Get a document
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
-
- // 글 존재
+ // If the document exists
if(!$oDocument->isExists()) {
$content = getXmlRpcFailure(1, 'not exists');
-
- // 글 삭제 권한 체크
+ // Check if a permission to delete a document is granted
} elseif(!$oDocument->isGranted()) {
$content = getXmlRpcFailure(1, 'no permission');
break;
-
- // 삭제
+ // Delete
} else {
$oDocumentController = &getController('document');
$output = $oDocumentController->deleteDocument($document_srl);
@@ -404,14 +374,13 @@
printContent($content);
break;
-
- // 최신글 받기
+ // Get recent posts
case 'metaWeblog.getRecentPosts' :
- // 목록을 구하기 위한 옵션
- $args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl
+ // Options to get a list
+ $args->module_srl = $this->module_srl; // /< module_srl of the current module
$args->page = 1;
$args->list_count = 20;
- $args->sort_index = 'list_order'; ///< 소팅 값
+ $args->sort_index = 'list_order'; // /< Sorting values
$logged_info = Context::get('logged_info');
$args->search_target = 'member_srl';
$args->search_keyword = $logged_info->member_srl;
@@ -441,8 +410,7 @@
printContent($content);
}
break;
-
- // 아무런 요청이 없을 경우 RSD 출력
+ // Display RSD if there is no request
default :
$homepagelink = getUrl('','mid',$this->mid);
diff --git a/addons/blogapi/blogapi.func.php b/addons/blogapi/blogapi.func.php
index f89fff237..8d779a0c9 100644
--- a/addons/blogapi/blogapi.func.php
+++ b/addons/blogapi/blogapi.func.php
@@ -4,10 +4,10 @@
/**
* @file ./addons/blogapi/blogapi.func.php
* @author NHN (developers@xpressengine.com)
- * @brief blogapi구현을 위한 함수 모음집
+ * @brief Function collections for the implementation of blogapi
**/
- // 오류 표시
+ // Error messages
function getXmlRpcFailure($error, $message) {
return
sprintf(
@@ -16,8 +16,7 @@
htmlspecialchars($message)
);
}
-
- // 결과 표시
+ // Display results
function getXmlRpcResponse($params) {
$buff = ''."\n";
$buff .= _getEncodedVal($params);
@@ -25,8 +24,7 @@
return $buff;
}
-
- // 인코딩 처리
+ // Encoding
function _getEncodedVal($val, $is_sub_set = false) {
if(is_int($val)) $buff = sprintf("%d", $val);
elseif(is_string($val)&&preg_match('/^([0-9]+)T([0-9\:]+)$/', $val)) $buff = sprintf("%s\n", $val);
@@ -53,8 +51,7 @@
if(!$is_sub_set) return sprintf("\n%s", $buff);
return $buff;
}
-
- // 결과 출력
+ // Display the result
function printContent($content) {
header("Content-Type: text/xml; charset=UTF-8");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php
index 4bc424d4e..a80984e2a 100644
--- a/addons/captcha/captcha.addon.php
+++ b/addons/captcha/captcha.addon.php
@@ -4,8 +4,8 @@
/**
* @file captcha.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief 특정 action을 실행할때 captcha를 띄우도록 함
- * 영어 알파벳을 입력, 음성기능 추가
+ * @brief Captcha for a particular action
+ * English alphabets and voice verification added
**/
if(!class_exists('AddonCaptcha'))
@@ -43,8 +43,8 @@
Context::addHtmlHeader('');
Context::addJsFile('./addons/captcha/captcha.js',false, '', null, 'body');
}
-
- // 게시판/ 이슈트래커의 글쓰기/댓글쓰기 액션 호출시 세션 비교
+ // compare session when calling actions such as writing a post or a comment on the board/issue tracker module
+
if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts)) {
Context::loadLang('./addons/captcha/lang');
$ModuleHandler->error = "captcha_denied";
@@ -56,11 +56,11 @@
function before_module_init_setCaptchaSession()
{
if($_SESSION['captcha_authed']) return false;
-
- // 언어파일 로드
+ // Load language files
+
Context::loadLang(_XE_PATH_.'addons/captcha/lang');
-
- // 키워드 생성
+ // Generate keywords
+
$arr = range('A','Y');
shuffle($arr);
$arr = array_slice($arr,0,6);
@@ -106,31 +106,31 @@
{
$arr = array();
for($i=0,$c=strlen($string);$i<$c;$i++) $arr[] = $string{$i};
-
- // 글자 하나 사이즈
+ // Font site
+
$w = 18;
$h = 25;
-
- // 글자 수
+ // Character length
+
$c = count($arr);
-
- // 글자 이미지
+ // Character image
+
$im = array();
-
- // 총사이즈로 바탕 이미지 생성
+ // Create an image by total size
+
$im[] = imagecreate(($w+2)*count($arr), $h);
$deg = range(-30,30);
shuffle($deg);
-
- // 글자별 이미지 생성
+ // Create an image for each letter
+
foreach($arr as $i => $str)
{
$im[$i+1] = @imagecreate($w, $h);
$background_color = imagecolorallocate($im[$i+1], 255, 255, 255);
$text_color = imagecolorallocate($im[$i+1], 0, 0, 0);
-
- // 글자폰트(사이즈) 조절
+ // Control font size
+
$ran = range(1,20);
shuffle($ran);
@@ -148,22 +148,23 @@
}
}
- // 각글자 이미지를 합침
+ // Combine images of each character
+
for($i=1;$iprocCounterExecute();
diff --git a/addons/member_communication/member_communication.addon.php b/addons/member_communication/member_communication.addon.php
index 1222339e0..e018e1b78 100644
--- a/addons/member_communication/member_communication.addon.php
+++ b/addons/member_communication/member_communication.addon.php
@@ -4,31 +4,27 @@
/**
* @file member_communication.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief 사용자의 커뮤니케이션 기능을 활성화
+ * @brief Promote user communication
*
- * - 새로운 쪽지가 왔을 경우 팝업으로 띄움
- * - MemberModel::getMemberMenu 호출시 대상이 회원일 경우 쪽지 보내기 기능 추가합니다.
- * - MemberModel::getMemberMenu 호출시 친구 등록 메뉴를 추가합니다.
+ * - Pop-up the message if new message comes in
+ * - When calling MemberModel::getMemberMenu, feature to send a message is added
+ * - When caliing MemberModel::getMemberMenu, feature to add a friend is added
**/
-
- // 비로그인 사용자면 중지
+ // Stop if non-logged-in user is
$logged_info = Context::get('logged_info');
if(!$logged_info) return;
/**
- * 기능 수행 : 팝업 및 회원정보 보기에서 쪽지/친구 메뉴 추가. 시작할때 새쪽지가 왔는지 검사
+ * Message/Friend munus are added on the pop-up window and member profile. Check if a new message is received
**/
if($called_position == 'before_module_init' && $this->module != 'member') {
-
- // 커뮤니케이션 모듈의 언어파일을 읽음
+ // Load a language file from the communication module
Context::loadLang('./modules/communication/lang');
-
- // 회원 로그인 정보중에서 쪽지등의 메뉴를 추가
+ // Add menus on the member login information
$oMemberController = &getController('member');
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
-
- // 새로운 쪽지에 대한 플래그가 있으면 쪽지 보기 팝업 띄움
+ // Pop-up to display messages if a flag on new message is set
$flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl);
$flag_file = sprintf('%s%s', $flag_path, $logged_info->member_srl);
@@ -43,41 +39,33 @@
}
/**
- * 기능 수행 : 사용자 이름을 클릭시 요청되는 팝업메뉴의 메뉴에 쪽지 발송, 친구추가등의 링크 추가
+ * Links are added on the pop-up menu which appears when clicking user name
**/
} elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') {
$oMemberController = &getController('member');
$member_srl = Context::get('target_srl');
$mid = Context::get('cur_mid');
-
- // communication 모델 객체 생성
+ // Creates communication model object
$oCommunicationModel = &getModel('communication');
-
- // 자신이라면 쪽지함 보기 기능 추가
+ // Add a feature to display own message box.
if($logged_info->member_srl == $member_srl) {
-
- // 자신의 쪽지함 보기 기능 추가
+ // Add your own viewing Note Template
$oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationMessages'), 'cmd_view_message_box', './modules/communication/tpl/images/icon_message_box.gif', 'self');
-
- // 친구 목록 보기
+ // Display a list of friends
$oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationFriend'), 'cmd_view_friend', './modules/communication/tpl/images/icon_friend_box.gif', 'self');
-
- // 아니라면 쪽지 발송, 친구 등록 추가
+ // If not, Add menus to send message and to add friends
} else {
- // 대상 회원의 정보를 가져옴
+ // Get member information
$oMemberModel = &getModel('member');
$target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
if(!$target_member_info->member_srl) return;
-
- // 로그인된 사용자 정보를 구함
+ // Get logged-in user information
$logged_info = Context::get('logged_info');
-
- // 쪽지 발송 메뉴를 만듬
+ // Add a menu for sending message
if( $logged_info->is_admin == 'Y' || $target_member_info->allow_message =='Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl)))
$oMemberController->addMemberPopupMenu(getUrl('','module','communication','act','dispCommunicationSendMessage','receiver_srl',$member_srl), 'cmd_send_message', './modules/communication/tpl/images/icon_write_message.gif', 'popup');
-
- // 친구 등록 메뉴를 만듬 (이미 등록된 친구가 아닐 경우)
+ // Add a menu for listing friends (if a friend is new)
if(!$oCommunicationModel->isAddedFriend($member_srl))
$oMemberController->addMemberPopupMenu(getUrl('','module','communication','act','dispCommunicationAddFriend','target_srl',$member_srl), 'cmd_add_friend', './modules/communication/tpl/images/icon_add_friend.gif', 'popup');
}
diff --git a/addons/member_extra_info/member_extra_info.addon.php b/addons/member_extra_info/member_extra_info.addon.php
index 9dfcb9b16..df80261d1 100644
--- a/addons/member_extra_info/member_extra_info.addon.php
+++ b/addons/member_extra_info/member_extra_info.addon.php
@@ -4,20 +4,18 @@
/**
* @file image_name.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief 사용자의 이미지이름/ 이미지마크등을 출력
+ * @brief Display user image name/image mark
*
- *
....
로 정의가 된 부분을 찾아 회원번호를 구해서
- * 이미지이름, 이미지마크가 있는지를 확인하여 있으면 내용을 변경해버립니다.
+ * Find member_srl in the part with
....
+ * Check if ther is image name and image mark. Then change it.
**/
/**
- * 출력되기 바로 직전일 경우에 이미지이름/이미지마크등을 변경
+ * Just before displaying, change image name/ image mark
**/
if($called_position != "before_display_content" || Context::get('act')=='dispPageAdminContentModify') return;
-
- // 회원 이미지이름/ 마크/ 찾아서 대체할 함수를 담고 있는 파일을 include
+ // Include a file having functions to replace member image name/mark
require_once('./addons/member_extra_info/member_extra_info.lib.php');
-
- // 1. 출력문서중에서
content
를 찾아 MemberController::transImageName() 를 이용하여 이미지이름/마크로 변경
+ // 1. Find a part
content
in the output document, change it to image name/mark by using MemberController::transImageName()
$output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'memberTransImageName', $output);
?>
diff --git a/addons/member_extra_info/member_extra_info.lib.php b/addons/member_extra_info/member_extra_info.lib.php
index 10d6ef72c..3cb808e31 100644
--- a/addons/member_extra_info/member_extra_info.lib.php
+++ b/addons/member_extra_info/member_extra_info.lib.php
@@ -1,22 +1,19 @@
getGroupImageMark($member_srl,$site_module_info->site_srl);
-
- // 회원이 아닐경우(member_srl = 0) 본문 전체를 return
+ // If member_srl=o(not a member), return the entire body
$nick_name = $matches[5];
if(!$member_srl) return $matches[0];
-
- // 전역변수에 미리 설정한 데이터가 있다면 그걸 return
+ // If pre-defined data in the global variablesm return it
if(!$GLOBALS['_transImageNameList'][$member_srl]->cached) {
$GLOBALS['_transImageNameList'][$member_srl]->cached = true;
$image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl);
@@ -29,8 +26,7 @@
$image_name_file = $GLOBALS['_transImageNameList'][$member_srl]->image_name_file;
$image_mark_file = $GLOBALS['_transImageNameList'][$member_srl]->image_mark_file;
}
-
- // 이미지이름이나 마크가 없으면 원본 정보를 세팅
+ // If image name and mark doesn't exist, set the original information
if(!$image_name_file && !$image_mark_file && !$group_image) return $matches[0];
if($image_name_file) $nick_name = sprintf('', Context::getRequestUri(),$image_name_file, strip_tags($nick_name), strip_tags($nick_name));
diff --git a/addons/mobile/classes/hdml.class.php b/addons/mobile/classes/hdml.class.php
index bb20afef1..fbad40d06 100644
--- a/addons/mobile/classes/hdml.class.php
+++ b/addons/mobile/classes/hdml.class.php
@@ -13,7 +13,7 @@
}
/**
- * @brief hdml 헤더 출력
+ * @brief hdml header output
**/
function printHeader() {
header("Content-Type:text/x-hdml; charset=".$this->charset);
@@ -33,7 +33,7 @@
}
/**
- * @brief 제목을 출력
+ * @brief Output title
**/
function printTitle() {
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
@@ -41,8 +41,8 @@
}
/**
- * @brief 내용을 출력
- * hasChilds()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력
+ * @brief Output information
+ * hasChilds() if there is a list of content types, otherwise output
**/
function printContent() {
if($this->hasChilds()) {
@@ -56,10 +56,10 @@
}
/**
- * @brief 버튼을 출력함
+ * @brief Button to output
**/
function printBtn() {
- // 메뉴 형식
+ // Menu Types
if($this->hasChilds()) {
if($this->nextUrl) {
$url = $this->nextUrl;
@@ -73,7 +73,7 @@
$url = $this->homeUrl;
printf('%s%s', $url->text, $url->url, $url->text, "\n");
}
- // 컨텐츠 형식
+ // Content Types
} else {
if($this->nextUrl) {
$url = $this->nextUrl;
@@ -91,7 +91,7 @@
}
/**
- * @brief 푸터 정보를 출력
+ * @brief Footer information output
**/
function printFooter() {
print $this->hasChilds()?'':'';
diff --git a/addons/mobile/classes/mhtml.class.php b/addons/mobile/classes/mhtml.class.php
index 32626e155..a03ffb20b 100644
--- a/addons/mobile/classes/mhtml.class.php
+++ b/addons/mobile/classes/mhtml.class.php
@@ -13,23 +13,22 @@
}
/**
- * @brief hdml 헤더 출력
+ * @brief hdml header output
**/
function printHeader() {
print("\n");
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf("%s%s\n", htmlspecialchars($this->title),htmlspecialchars($titlePageStr));
}
-
- // 제목을 출력
+ // Output title
function printTitle() {
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
printf('<%s%s> %s', htmlspecialchars($this->title),htmlspecialchars($titlePageStr),"\n");
}
/**
- * @brief 내용을 출력
- * hasChilds()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력
+ * @brief Output information
+ * hasChilds() if there is a list of content types, otherwise output
**/
function printContent() {
if($this->hasChilds()) {
@@ -45,7 +44,7 @@
}
/**
- * @brief 버튼을 출력함
+ * @brief Button to output
**/
function printBtn() {
if($this->nextUrl) {
@@ -56,7 +55,7 @@
$url = $this->prevUrl;
printf('%s %s', $url->url, $url->text, "\n");
}
- // 언어선택
+ // Select Language
if(!parent::isLangChange()){
$url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url'));
printf('%s %s', $url, 'Language : '.Context::getLang('select_lang'), "\n");
@@ -73,8 +72,7 @@
printf('%s %s', $url->text, $url->url, $url->text, "\n");
}
}
-
- // 푸터 정보를 출력
+ // Footer information output
function printFooter() {
print("\n");
}
diff --git a/addons/mobile/classes/mobile.class.php b/addons/mobile/classes/mobile.class.php
index 5fb4a843a..e59b1ebf9 100644
--- a/addons/mobile/classes/mobile.class.php
+++ b/addons/mobile/classes/mobile.class.php
@@ -2,48 +2,40 @@
/**
* Mobile XE Library Class ver 0.1
* @author NHN (developers@xpressengine.com) / lang_select : misol
- * @brief WAP 태그 출력을 위한 XE 라이브러리
+ * @brief XE library for WAP tag output
**/
class mobileXE {
-
- // 기본 url
+ // Base url
var $homeUrl = NULL;
var $upperUrl = NULL;
var $nextUrl = NULL;
var $prevUrl = NULL;
var $etcBtn = NULL;
-
- // 메뉴 네비게이션을 위한 변수
+ // Variable for menu navigation
var $childs = null;
-
- // 기본 변수
+ // Basic variable
var $title = NULL;
var $content = NULL;
var $mobilePage = 0;
var $totalPage = 1;
var $charset = 'UTF-8';
var $no = 0;
-
- // 네비게이션 관련 변수
+ // Navigation-related variables
var $menu = null;
var $listed_items = null;
var $node_list = null;
var $index_mid = null;
-
- // Navigation On/ Off 상태 값
+ // Navigation On/Off status value
var $navigationMode = 0;
-
- // 현재 요청된 XE 모듈 정보
+ // XE module information currently requested
var $module_info = null;
-
- // 현재 실행중인 모듈의 instance
+ // Currently running instance of the module
var $oModule = null;
// Deck size
var $deckSize = 1024;
-
- // 언어 설정 변경
+ // Changing the language setting
var $languageMode = 0;
var $lang = null;
/**
@@ -59,8 +51,7 @@
$class_file = sprintf('%saddons/mobile/classes/%s.class.php', _XE_PATH_, $browserType);
require_once($class_file);
-
- // 모바일 언어설정 로드(쿠키가 안되어 생각해낸 방법...-캐시파일 재생성을 클릭하면 초기화된다..)
+ // Download mobile language settings (cookies, not willing to come up when you click create cache file ...- is initialized ..)
$this->lang = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php');
if($this->lang) {
$lang_supported = Context::get('lang_supported');
@@ -85,7 +76,7 @@
* @brief constructor
**/
function mobileXE() {
- // navigation mode 체크
+ // Check navigation mode
if(Context::get('nm')) {
$this->navigationMode = 1;
$this->cmid = (int)Context::get('cmid');
@@ -98,16 +89,16 @@
}
/**
- * @brief navigation mode 체크
- * navigationMode 세팅과 모듈 정보의 menu_srl이 있어야 navigation mode = true로 return
+ * @brief Check navigation mode
+ * navigationMode settings and modules of information must be menu_srl return to navigation mode = true
**/
function isNavigationMode() {
return ($this->navigationMode && $this->module_info->menu_srl)?true:false;
}
/**
- * @brief langchange mode 체크
- * languageMode 세팅 있어야 true return
+ * @brief Check langchange mode
+ * true return should be set languageMode
**/
function isLangChange() {
if($this->languageMode) return true;
@@ -115,12 +106,12 @@
}
/**
- * @brief 언어 설정
- * 쿠키가 안되기 때문에 휴대전화마다 고유한 파일로 언어설정을 저장하는 파일 생성
+ * @brief Language settings
+ * Cookies Since you set your phone to store language-specific file, file creation
**/
function setLangType() {
$lang_supported = Context::get('lang_supported');
- // 언어 변수가 있는지 확인하고 변수가 유효한지 확인
+ // Make sure that the language variables and parameters are valid
if($this->lang && isset($lang_supported[$this->lang])) {
$langbuff = FileHandler::readFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php');
if($langbuff) FileHandler::removeFile('./files/cache/addons/mobile/setLangType/personal_settings/'.md5(trim($_SERVER['HTTP_USER_AGENT']).trim($_SERVER['HTTP_PHONE_NUMBER']).trim($_SERVER['HTTP_HTTP_PHONE_NUMBER'])).'.php');
@@ -130,7 +121,7 @@
}
/**
- * @brief 현재 요청된 모듈 정보 세팅
+ * @brief Information currently requested module settings
**/
function setModuleInfo(&$module_info) {
if($this->module_info) return;
@@ -138,21 +129,18 @@
}
/**
- * @brief 현재 실행중인 모듈 instance 세팅
+ * @brief Set the module instance is currently running
**/
function setModuleInstance(&$oModule) {
if($this->oModule) return;
-
- // instance 저장
+ // Save instance
$this->oModule = $oModule;
-
- // 현재 모듈의 메뉴가 설정되어 있으면 메뉴 정리
+ // Of the current module if there is a menu by menu
$menu_cache_file = sprintf(_XE_PATH_.'files/cache/menu/%d.php', $this->module_info->menu_srl);
if(!file_exists($menu_cache_file)) return;
include $menu_cache_file;
-
- // 정리된 menu들을 1차원으로 변경
+ // One-dimensional arrangement of menu changes
$this->getListedItems($menu->list, $listed_items, $node_list);
$this->listed_items = $listed_items;
@@ -162,8 +150,7 @@
$k = array_keys($node_list);
$v = array_values($node_list);
$this->index_mid = $k[0];
-
- // 현재 메뉴의 depth가 1이상이면 상위 버튼을 지정
+ // The depth of the current menu, the top button to specify if one or more
$cur_menu_item = $listed_items[$node_list[$this->module_info->mid]];
if($cur_menu_item['parent_srl']) {
$parent_srl = $cur_menu_item['parent_srl'];
@@ -177,12 +164,12 @@
}
/**
- * @brief 접속 브라우저의 헤더를 판단하여 브라우저 타입을 return
- * 모바일 브라우저가 아닐 경우 null return
+ * @brief Access the browser's header to determine the return type of the browser
+ * Mobile browser, if not null return
**/
function getBrowserType() {
if(Context::get('smartphone')) return null;
- // 브라우저 타입을 판별
+ // Determine the type of browser
$browserAccept = $_SERVER['HTTP_ACCEPT'];
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$wap_sid = $_SERVER['HTTP_X_UP_SUBNO'];
@@ -197,19 +184,18 @@
}
/**
- * @brief charset 지정
+ * @brief Specify charset
**/
function setCharSet($charset = 'UTF-8') {
if(!$charset) $charset = 'UTF-8';
-
- //SKT는 euc-kr만 지원
+ // SKT supports the euc-kr
if(Context::get('mobile_skt')==1) $charset = 'euc-kr';
$this->charset = $charset;
}
/**
- * @brief 모바일 기기의 용량 제한에 다른 가상 페이지 지정
+ * @brief Limited capacity of mobile devices, specifying a different virtual page
**/
function setMobilePage($page=1) {
if(!$page) $page = 1;
@@ -217,10 +203,10 @@
}
/**
- * @brief 목록형 데이터 설정을 위한 child menu지정
+ * @brief Mokrokhyeong child menu for specifying the data set
**/
function setChilds($childs) {
- // menu개수가 9개 이상일 경우 자체 페이징 처리
+ // If more than nine the number of menu paging processing itself
$menu_count = count($childs);
if($menu_count>9) {
$startNum = ($this->mobilePage-1)*9;
@@ -235,8 +221,7 @@
$childs = $new_childs;
$this->totalPage = (int)(($menu_count-1)/9)+1;
-
- // next/prevUrl 지정
+ // next/prevUrl specify
if($this->mobilePage>1) {
$url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage-1);
$text = sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $this->mobilePage-1, $this->totalPage);
@@ -253,21 +238,21 @@
}
/**
- * @brief menu 출력대상이 있는지 확인
+ * @brief Check the menu to be output
**/
function hasChilds() {
return count($this->childs)?true:0;
}
/**
- * @brief child menu반환
+ * @brief Returns the child menu
**/
function getChilds() {
return $this->childs;
}
/**
- * @brief title 지정
+ * @brief Specify title
**/
function setTitle($title) {
$oModuleController = &getController('module');
@@ -276,28 +261,24 @@
}
/**
- * @brief title 반환
+ * @brief return title
**/
function getTitle() {
return $this->title;
}
/**
- * @brief 컨텐츠 정리
- * HTML 컨텐츠에서 텍스트와 링크만 추출하는 기능
+ * @brief Content Cleanup
+ * In HTML content, the ability to extract text and links
**/
function setContent($content) {
$oModuleController = &getController('module');
$allow_tag_array = array('',' ','
',' ',$content);
}
-
- // 모바일의 경우 한 덱에 필요한 사이즈가 적어서 내용을 모두 페이지로 나눔
+ // If the required size of a deck of mobile content to write down all the dividing pages
$contents = array();
while($content) {
$tmp = $this->cutStr($content, $this->deckSize, '');
@@ -335,8 +315,7 @@
}
$this->totalPage = count($contents);
-
- // next/prevUrl 지정
+ // next/prevUrl specify
if($this->mobilePage>1) {
$url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage-1);
$text = sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $this->mobilePage-1, $this->totalPage);
@@ -355,21 +334,21 @@
}
/**
- * @brief byte수로 자르는 함수
+ * @brief cutting the number of byte functions
**/
function cutStr($string, $cut_size) {
return preg_match('/.{'.$cut_size.'}/su', $string, $arr) ? $arr[0] : $string;
}
/**
- * @brief 컨텐츠 반환
+ * @brief Return content
**/
function getContent() {
return $this->content;
}
/**
- * @brief home url 지정
+ * @brief Specifies the home url
**/
function setHomeUrl($url, $text) {
if(!$url) $url = '#';
@@ -378,7 +357,7 @@
}
/**
- * @brief upper url 지정
+ * @brief Specify upper url
**/
function setUpperUrl($url, $text) {
if(!$url) $url = '#';
@@ -387,7 +366,7 @@
}
/**
- * @brief prev url 지정
+ * @brief Specify prev url
**/
function setPrevUrl($url, $text) {
if(!$url) $url = '#';
@@ -396,7 +375,7 @@
}
/**
- * @brief next url 지정
+ * @brief Specify next url
**/
function setNextUrl($url, $text) {
if(!$url) $url = '#';
@@ -405,7 +384,7 @@
}
/**
- * @brief 다음, 이전, 상위 이외에 기타 버튼 지정
+ * @brief Next, Previous, Top button assignments other than
**/
function setEtcBtn($url, $text) {
if(!$url) $url = '#';
@@ -418,32 +397,25 @@
* @brief display
**/
function display() {
- // 홈버튼 지정
+ // Home button assignments
$this->setHomeUrl(getUrl(), Context::getLang('cmd_go_home'));
-
- // 제목 지정
+ // Specify the title
if(!$this->title) $this->setTitle(Context::getBrowserTitle());
ob_start();
-
- // 헤더를 출력
+ // Output header
$this->printHeader();
-
- // 제목을 출력
+ // Output title
$this->printTitle();
-
- // 내용 출력
+ // Information output
$this->printContent();
-
- // 버튼 출력
+ // Button output
$this->printBtn();
-
- // 푸터를 출력
+ // Footer output
$this->printFooter();
$content = ob_get_clean();
-
- // 변환 후 출력
+ // After conversion output
if(strtolower($this->charset) == 'utf-8') print $content;
else print iconv('UTF-8',$this->charset."//TRANSLIT//IGNORE", $content);
@@ -451,7 +423,7 @@
}
/**
- * @brief 페이지 이동
+ * @brief Move page
**/
function movepage($url) {
header("location:$url");
@@ -459,7 +431,7 @@
}
/**
- * @brief 목록등에서 일련 번호를 리턴한다
+ * @brief And returns a list of serial numbers in
**/
function getNo() {
$this->no++;
@@ -468,7 +440,7 @@
}
/**
- * @brief XE의 Menu 모듈이 값을 사용하기 쉽게 정리해주는 함수
+ * @brief XE is easy to use Menu module is relieved during the function, value
**/
function getListedItems($menu, &$listed_items, &$node_list) {
if(!count($menu)) return;
@@ -486,7 +458,7 @@
}
/**
- * @brief XE 네비게이션 출력
+ * @brief XE navigation output
**/
function displayNavigationContent() {
$childs = array();
@@ -523,13 +495,12 @@
}
$this->setChilds($childs);
}
-
- // 출력
+ // Output
$this->display();
}
/**
- * @brief 언어설정 메뉴 출력
+ * @brief Language Settings menu, the output
**/
function displayLangSelect() {
$childs = array();
@@ -561,37 +532,33 @@
}
/**
- * @brief 모듈의 WAP 클래스 객체 생성하여 WAP 준비
+ * @brief Module to create a class object of the WAP WAP ready
**/
function displayModuleContent() {
- // 선택된 모듈의 WAP class 객체 생성
+ // Create WAP class objects of the selected module
$oModule = &getWap($this->module_info->module);
if(!$oModule || !method_exists($oModule, 'procWAP') ) return;
$vars = get_object_vars($this->oModule);
if(count($vars)) foreach($vars as $key => $val) $oModule->{$key} = $val;
-
- // 실행
+ // Run
$oModule->procWAP($this);
-
- // 출력
+ // Output
$this->display();
}
/**
- * @brief WAP 컨텐츠를 별도로 구할 수 없으면 최종 결과물을 출력
+ * @brief WAP content is available as a separate output if the final results
**/
function displayContent() {
Context::set('layout','none');
-
- // 템플릿 컴파일
+ // Compile a template
$oTemplate = new TemplateHandler();
$oContext = &Context::getInstance();
$content = $oTemplate->compile($this->oModule->getTemplatePath(), $this->oModule->getTemplateFile());
$this->setContent($content);
-
- // 출력
+ // Output
$this->display();
}
}
diff --git a/addons/mobile/classes/wml.class.php b/addons/mobile/classes/wml.class.php
index 11e6ae35e..a9a91fb95 100644
--- a/addons/mobile/classes/wml.class.php
+++ b/addons/mobile/classes/wml.class.php
@@ -13,19 +13,19 @@
}
/**
- * @brief wml 헤더 출력
+ * @brief wml header output
**/
function printHeader() {
header("Content-Type: text/vnd.wap.wml");
header("charset: ".$this->charset);
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
print("charset."\"?>\n");
- // 카드제목
+ // Card Title
printf("\n\n
\n",htmlspecialchars($this->title),htmlspecialchars($titlePageStr));
}
/**
- * @brief 제목을 출력
+ * @brief Output title
**/
function printTitle() {
if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage);
@@ -33,8 +33,8 @@
}
/**
- * @brief 내용을 출력
- * hasChilds()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력
+ * @brief Output information
+ * hasChilds() if there is a list of content types, otherwise output
**/
function printContent() {
if($this->hasChilds()) {
@@ -50,7 +50,7 @@
}
/**
- * @brief 버튼을 출력함
+ * @brief Button to output
**/
function printBtn() {
if($this->nextUrl) {
@@ -61,7 +61,7 @@
$url = $this->prevUrl;
printf('%s', $url->text, $url->url, "\n");
}
- // 기타 해당사항 없는 버튼 출력 담당 (array로 전달) type??
+ // Others are not applicable in charge of the button output (array passed) type??
if($this->etcBtn) {
if(is_array($this->etcBtn)) {
foreach($this->etcBtn as $key=>$val) {
@@ -69,7 +69,7 @@
}
}
}
- // 언어선택
+ // Select Language
if(!parent::isLangChange()){
$url = getUrl('','lcm','1','sel_lang',Context::getLangType(),'return_uri',Context::get('current_url'));
printf('%s', 'Language : '.Context::getLang('select_lang'), $url, "\n");
@@ -86,13 +86,11 @@
printf('%s', $url->text, $url->url, "\n");
}
}
-
- // 푸터 정보를 출력
+ // Footer information output
function printFooter() {
print("
\n\n");
}
-
- // 목록등에서 일련 번호를 리턴한다
+ // And returns a list of serial numbers in
function getNo() {
if(Context::get('mobile_skt')==1) {
return "vnd.skmn".parent::getNo();
diff --git a/addons/mobile/lang/jp.lang.php b/addons/mobile/lang/jp.lang.php
index fc891f187..6cbbed47f 100644
--- a/addons/mobile/lang/jp.lang.php
+++ b/addons/mobile/lang/jp.lang.php
@@ -1,11 +1,10 @@
president_lang = '現在言語';
$lang->select_lang = '言語選択';
$lang->lang_return = '戻る';
diff --git a/addons/mobile/lang/ko.lang.php b/addons/mobile/lang/ko.lang.php
index 90b08f866..746da3c3c 100644
--- a/addons/mobile/lang/ko.lang.php
+++ b/addons/mobile/lang/ko.lang.php
@@ -2,10 +2,9 @@
/**
* @file addons/mobile/lang/ko.lang.php
* @author NHN (developers@xpressengine.com)
- * @brief 한국어 언어팩 (기본적인 내용만 수록)
+ * @brief Korean language pack (only the more basic)
**/
-
- // 언어 선택부분 by misol
+ // Language selection by misol
$lang->president_lang = '현재 언어';
$lang->select_lang = '언어 선택';
$lang->lang_return = '돌아가기';
diff --git a/addons/mobile/lang/ru.lang.php b/addons/mobile/lang/ru.lang.php
index 929a5689c..1ddc447e5 100644
--- a/addons/mobile/lang/ru.lang.php
+++ b/addons/mobile/lang/ru.lang.php
@@ -2,10 +2,9 @@
/**
* @file addons/mobile/lang/ko.lang.php
* @author NHN (developers@xpressengine.com)
- * @brief 한국어 언어팩 (기본적인 내용만 수록)
+ * @brief Korean language pack (only the more basic)
**/
-
- // 언어 선택부분 by misol
+ // Language selection by misol
$lang->president_lang = 'Дейсвующй язык';
$lang->select_lang = 'Выбор языка';
$lang->lang_return = 'Вернуться';
diff --git a/addons/mobile/lang/zh-CN.lang.php b/addons/mobile/lang/zh-CN.lang.php
index 96dc8d5cb..974687c74 100644
--- a/addons/mobile/lang/zh-CN.lang.php
+++ b/addons/mobile/lang/zh-CN.lang.php
@@ -1,8 +1,8 @@
cmd_go_upper = '上一级';
diff --git a/addons/mobile/lang/zh-TW.lang.php b/addons/mobile/lang/zh-TW.lang.php
index 0435b4be0..1c7bb7b55 100644
--- a/addons/mobile/lang/zh-TW.lang.php
+++ b/addons/mobile/lang/zh-TW.lang.php
@@ -1,8 +1,8 @@
president_lang = '已選擇語言';
diff --git a/addons/mobile/mobile.addon.php b/addons/mobile/mobile.addon.php
index ce99e39ea..79d50e7c0 100644
--- a/addons/mobile/mobile.addon.php
+++ b/addons/mobile/mobile.addon.php
@@ -4,58 +4,47 @@
/**
* @file mobile.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief 모바일XE 애드온
+ * @brief Mobile XE add-on
*
- * 헤더정보를 가로채서 모바일에서의 접속일 경우 WAP 태그로 컨텐츠를 출력함
+ * If a mobile connection is made (see the header information), display contents with WAP tags
*
- * 동작 시점
+ * Time to call
*
- * before_module_proc > 모바일 처리를 위해 모듈의 일반 설정을 변경해야 할 경우 호출
+ * before_module_proc > call when changing general settings for mobile
*
- * after_module_proc > 모바일 컨텐츠 출력
- * 동작 조건
+ * after_module_proc > display mobile content
+ * Condition
**/
-
- // 관리자 페이지는 무시
+ // Ignore admin page
if(Context::get('module')=='admin') return;
-
- // 동작 시점 관리
+ // Manage when to call it
if($called_position != 'before_module_proc' && $called_position != 'after_module_proc' ) return;
-
- // 모바일 브라우저가 아니라면 무시
+ // Ignore if not mobile browser
require_once(_XE_PATH_.'addons/mobile/classes/mobile.class.php');
if(!mobileXE::getBrowserType()) return;
-
- // mobile instance 생성
+ // Generate mobile instance
$oMobile = &mobileXE::getInstance();
if(!$oMobile) return;
-
- // 애드온 설정에서 지정된 charset으로 지정
+ // Specify charset on the add-on settings
$oMobile->setCharSet($addon_info->charset);
-
- // 모듈의 정보를 세팅
+ // Set module information
$oMobile->setModuleInfo($this->module_info);
-
- // 현재 모듈 객체 등록
+ // Register the current module object
$oMobile->setModuleInstance($this);
-
- // 네비게이트 모드이거나 WAP class가 있을 경우 미리 컨텐츠를 추출하여 출력/ 종료
+ // Extract content and display/exit if navigate mode is or if WAP class exists
if($called_position == 'before_module_proc') {
if($oMobile->isLangChange()) {
$oMobile->setLangType();
$oMobile->displayLangSelect();
}
-
- // 네비게이트 모드이면 네비게이션 컨텐츠 출력
+ // On navigation mode, display navigation content
if($oMobile->isNavigationMode()) $oMobile->displayNavigationContent();
-
- // WAP class가 있으면 WAP class를 통해 컨텐츠 출력
+ // If you have a WAP class content output via WAP class
else $oMobile->displayModuleContent();
-
- // 네비게이트 모드가 아니고 WAP 클래스가 아니면 모듈의 결과를 출력
+ // If neither navigation mode nor WAP class is, display the module's result
} else if($called_position == 'after_module_proc') {
- // 내용 준비
+ // Display
$oMobile->displayContent();
}
?>
diff --git a/addons/openid_delegation_id/openid_delegation_id.addon.php b/addons/openid_delegation_id/openid_delegation_id.addon.php
index be01816ff..4207ef43f 100644
--- a/addons/openid_delegation_id/openid_delegation_id.addon.php
+++ b/addons/openid_delegation_id/openid_delegation_id.addon.php
@@ -4,16 +4,14 @@
/**
* @file openid_delegation_id.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief OpenID Delegation ID 애드온
+ * @brief OpenID Delegation ID Add-on
*
- * 오픈아이디를 자신의 홈페이지나 블로그 주소로 이용할 수 있도록 해줍니다.
- * 꼭 설정을 통해서 사용하시는 오픈아이디 서비스에 해당하는 정보를 입력해주세요.
+ * This enables to use openID as user's homepage or blog url.
+ * Enter your open ID service information on the configuration.
**/
-
- // called_position이 before_module_init일때만 실행
+ // Execute only wen called_position is before_module_init
if($called_position != 'before_module_init') return;
-
- // openid_delegation_id 애드온 설정 정보를 가져옴
+ // Get add-on settings(openid_delegation_id)
if(!$addon_info->server||!$addon_info->delegate||!$addon_info->xrds) return;
$header_script = sprintf(
diff --git a/addons/point_level_icon/point_level_icon.addon.php b/addons/point_level_icon/point_level_icon.addon.php
index 6395590c3..77fa75fb4 100644
--- a/addons/point_level_icon/point_level_icon.addon.php
+++ b/addons/point_level_icon/point_level_icon.addon.php
@@ -4,12 +4,11 @@
/**
* @file point.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief 포인트 레벨 아이콘 표시 애드온
+ * @brief Icon-on-point level
*
- * 포인트 시스템 사용중일때 사용자 이름 앞에 포인트 레벨 아이콘을 표시합니다.
+ * Display point level icon before user name when point system is enabled.
**/
-
- // before_display_content 가 아니면 return
+ // return unless before_display_content
if($called_position != "before_display_content" || Context::get('act')=='dispPageAdminContentModify') return;
require_once('./addons/point_level_icon/point_level_icon.lib.php');
diff --git a/addons/point_level_icon/point_level_icon.lib.php b/addons/point_level_icon/point_level_icon.lib.php
index 471025c80..014e31e23 100644
--- a/addons/point_level_icon/point_level_icon.lib.php
+++ b/addons/point_level_icon/point_level_icon.lib.php
@@ -1,34 +1,29 @@
getModuleConfig('point');
}
$config = $GLOBALS['_pointConfig'];
-
- // 포인트 모델을 구해 놓음
+ // Get point model
if(!$GLOBALS['_pointModel']) $GLOBALS['_pointModel'] = getModel('point');
$oPointModel = &$GLOBALS['_pointModel'];
-
- // 포인트를 구함
+ // Get points
$point = $oPointModel->getPoint($member_srl);
-
- // 레벨을 구함
+ // Get level
$level = $oPointModel->getLevel($point, $config->level_step);
$text = $matches[5];
-
- // 레벨 아이콘의 위치를 구함
+ // Get a path where level icon is
$level_icon = sprintf('%smodules/point/icons/%s/%d.gif', Context::getRequestUri(), $config->level_icon, $level);
-
- // 최고 레벨이 아니면 다음 레벨로 가기 위한 per을 구함 :: 주석과 실제 내용이 맞지 않아 실제 내용을 수정
+ // Get per to go to the next level if not a top level
if($level < $config->max_level) {
$next_point = $config->level_step[$level+1];
$present_point = $config->level_step[$level];
diff --git a/addons/resize_image/resize_image.addon.php b/addons/resize_image/resize_image.addon.php
index b6b3ecdfc..758a20249 100644
--- a/addons/resize_image/resize_image.addon.php
+++ b/addons/resize_image/resize_image.addon.php
@@ -4,7 +4,7 @@
/**
* @file resize_image.addon.php
* @author NHN (developers@xpressengine.com)
- * @brief 본문내 이미지 조절 애드온
+ * @brief Add-on to resize images in the body
**/
if($called_position == 'after_module_proc' && Context::getResponseMethod()=="HTML") {
diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php
index c5e315fc8..5ac4d029a 100644
--- a/classes/context/Context.class.php
+++ b/classes/context/Context.class.php
@@ -857,7 +857,7 @@ class Context {
}
/**
- * @brief 요청이 들어온 URL에서 argument를 제거하여 return
+ * @brief Return after removing an argument on the requested URL
**/
function getRequestUri($ssl_mode = FOLLOW_REQUEST_SSL, $domain = null) {
static $url = array();
@@ -919,7 +919,7 @@ class Context {
}
/**
- * @brief key값에 해당하는 값을 return
+ * @brief return key value
**/
function get($key) {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -927,9 +927,9 @@ class Context {
}
/**
- * @brief 받고자 하는 변수만 object에 입력하여 받음
- *
- * key1, key2, key3 .. 등의 인자를 주어 여러개의 변수를 object vars로 세팅하여 받을 수 있음
+ * @brief get a specified var in object
+ *
+ * get one more vars in object vars with given arguments(key1, key2, key3,...)
**/
function gets() {
$num_args = func_num_args();
@@ -944,7 +944,7 @@ class Context {
}
/**
- * @brief 모든 데이터를 return
+ * @brief Return all data
**/
function getAll() {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -952,7 +952,7 @@ class Context {
}
/**
- * @brief GET/POST/XMLRPC에서 넘어온 변수값을 return
+ * @brief Return values from the GET/POST/XMLRPC
**/
function getRequestVars() {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -960,8 +960,8 @@ class Context {
}
/**
- * @brief SSL로 인증되어야 할 action이 있을 경우 등록
- * common/js/xml_handler.js에서 이 action들에 대해서 https로 전송되도록 함
+ * @brief Register if actions is to be encrypted by SSL
+ * Those actions are sent to https in common/js/xml_handler.js
**/
function addSSLAction($action) {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -992,7 +992,7 @@ class Context {
}
/**
- * @brief js file을 추가
+ * @brief Add the js file
**/
function addJsFile($file, $optimized = false, $targetie = '',$index=0, $type='head') {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -1009,7 +1009,7 @@ class Context {
}
/**
- * @brief js file을 제거
+ * @brief Remove the js file
**/
function unloadJsFile($file, $optimized = false, $targetie = '') {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -1034,14 +1034,14 @@ class Context {
}
/**
- * @brief javascript filter 추가
+ * @brief Add javascript filter
**/
function addJsFilter($path, $filename) {
$oXmlFilter = new XmlJSFilter($path, $filename);
$oXmlFilter->compile();
}
/**
- * @brief array_unique와 동작은 동일하나 file 첨자에 대해서만 동작함
+ * @brief Same as array_unique but works only for file subscript
* @deprecated
**/
function _getUniqueFileList($files) {
@@ -1080,7 +1080,7 @@ class Context {
}
/**
- * @brief CSS file 추가
+ * @brief Add CSS file
**/
function addCSSFile($file, $optimized=false, $media='all', $targetie='',$index=0) {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -1092,7 +1092,7 @@ class Context {
}
/**
- * @brief css file을 제거
+ * @brief Remove css file
**/
function unloadCSSFile($file, $optimized = false, $media = 'all', $targetie = '') {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -1163,7 +1163,7 @@ class Context {
}
/**
- * @brief HtmlHeader 추가
+ * @brief Add HtmlHeader
**/
function addHtmlHeader($header) {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -1179,7 +1179,7 @@ class Context {
}
/**
- * @brief Html Body에 css class 추가
+ * @brief Add css class to Html Body
**/
function addBodyClass($class_name) {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -1187,7 +1187,7 @@ class Context {
}
/**
- * @brief Html Body에 css class return
+ * @brief Return css class to Html Body
**/
function getBodyClass() {
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
@@ -1251,7 +1251,7 @@ class Context {
}
/**
- * @brief 내용의 위젯이나 기타 기능에 대한 code를 실제 code로 변경
+ * @brief Transforms codes about widget or other features into the actual code, deprecatred
**/
function transContent($content) {
return $content;
diff --git a/classes/db/DB.class.php b/classes/db/DB.class.php
index 0c58dee8c..dffd0ed42 100644
--- a/classes/db/DB.class.php
+++ b/classes/db/DB.class.php
@@ -241,7 +241,7 @@
}
/**
- * @brief query xml 파일을 실행하여 결과를 return
+ * @brief Run the result of the query xml file
* @param[in] $query_id query id (module.queryname
* @param[in] $args arguments for query
* @return result of query
diff --git a/classes/db/DBCubrid.class.php b/classes/db/DBCubrid.class.php
index 493db32bb..8fa85b48f 100644
--- a/classes/db/DBCubrid.class.php
+++ b/classes/db/DBCubrid.class.php
@@ -2,34 +2,34 @@
/**
* @class DBCubrid
* @author NHN (developers@xpressengine.com)
- * @brief Cubrid DBMS를 이용하기 위한 class
+ * @brief Cubrid DBMS to use the class
* @version 0.1p1
*
- * CUBRID2008 R1.3 에 대응하도록 수정 Prototype (prototype@cubrid.com) / 09.02.23
- * 7.3 ~ 2008 R1.3 까지 테스트 완료함.
- * 기본 쿼리만 사용하였기에 특화된 튜닝이 필요
+ * Modified to work with CUBRID2008 R1.3 verion by Prototype (prototype@cubrid.com)/09.02.23
+ * Test completed for CUBRID 7.3 ~ 2008 R1.3 versions.
+ * Only basic query used so query tunning and optimization needed
**/
class DBCubrid extends DB
{
/**
- * @brief Cubrid DB에 접속하기 위한 정보
+ * @brief CUBRID DB connection information
**/
var $hostname = '127.0.0.1'; ///< hostname
var $userid = NULL; ///< user id
var $password = NULL; ///< password
var $database = NULL; ///< database
var $port = 33000; ///< db server port
- var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
- var $cutlen = 12000; ///< 큐브리드의 최대 상수 크기(스트링이 이보다 크면 '...'+'...' 방식을 사용해야 한다
+ var $prefix = 'xe'; // / 'numeric(20)',
@@ -61,7 +61,7 @@
}
/**
- * @brief 설치 가능 여부를 return
+ * @brief Return if installable
**/
function isSupported()
{
@@ -70,7 +70,7 @@
}
/**
- * @brief DB정보 설정 및 connect/ close
+ * @brief DB settings and connect/close
**/
function _setDBInfo()
{
@@ -86,17 +86,17 @@
}
/**
- * @brief DB 접속
+ * @brief DB Connection
**/
function _connect()
{
- // db 정보가 없으면 무시
+ // ignore if db information not exists
if (!$this->hostname || !$this->userid || !$this->password || !$this->database || !$this->port) return;
- // 접속시도
+ // attempts to connect
$this->fd = @cubrid_connect ($this->hostname, $this->port, $this->database, $this->userid, $this->password);
- // 접속체크
+ // check connections
if (!$this->fd) {
$this->setError (-1, 'database connect fail');
return $this->is_connected = false;
@@ -107,7 +107,7 @@
}
/**
- * @brief DB접속 해제
+ * @brief DB disconnect
**/
function close()
{
@@ -119,7 +119,7 @@
}
/**
- * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
+ * @brief handles quatation of the string variables from the query
**/
function addQuotes($string)
{
@@ -147,7 +147,7 @@
}
/**
- * @brief 트랜잭션 시작
+ * @brief Begin transaction
**/
function begin()
{
@@ -156,7 +156,7 @@
}
/**
- * @brief 롤백
+ * @brief Rollback
**/
function rollback()
{
@@ -166,7 +166,7 @@
}
/**
- * @brief 커밋
+ * @brief Commit
**/
function commit()
{
@@ -178,24 +178,24 @@
}
/**
- * @brief : 쿼리문의 실행 및 결과의 fetch 처리
+ * @brief : executing the query and fetching the result
*
- * query : query문 실행하고 result return\n
- * fetch : reutrn 된 값이 없으면 NULL\n
- * rows이면 array object\n
- * row이면 object\n
- * return\n
+ * query: run a query and return the result\n
+ * fetch: NULL if no value returned \n
+ * array object if rows returned \n
+ * object if a row returned \n
+ * return\n
**/
function _query($query)
{
if (!$query || !$this->isConnected ()) return;
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$this->actStart ($query);
- // 쿼리 문 실행
+ // Execute the query
$result = @cubrid_execute ($this->fd, $query);
- // 오류 체크
+ // error check
if (cubrid_error_code ()) {
$code = cubrid_error_code ();
$msg = cubrid_error_msg ();
@@ -203,15 +203,15 @@
$this->setError ($code, $msg);
}
- // 쿼리 실행 종료를 알림
+ // Notify to complete a query execution
$this->actFinish ();
- // 결과 리턴
+ // Return the result
return $result;
}
/**
- * @brief 결과를 fetch
+ * @brief Fetch the result
**/
function _fetch($result)
{
@@ -246,7 +246,7 @@
}
/**
- * @brief 1씩 증가되는 sequence 값을 return (cubrid의 auto_increment는 sequence테이블에서만 사용)
+ * @brief return the sequence value incremented by 1(auto_increment column only used in the CUBRID sequence table)
**/
function getNextSequence()
{
@@ -260,7 +260,7 @@
}
/**
- * @brief 마이그레이션시 sequence 가 없을 경우 생성
+ * @brief return if the table already exists
**/
function _makeSequence()
{
@@ -302,7 +302,7 @@
/**
- * @brief 테이블 기생성 여부 return
+ * brief return a table if exists
**/
function isTableExists ($target_name)
{
@@ -327,7 +327,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 추가
+ * @brief add a column to the table
**/
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = '', $notnull = false)
{
@@ -362,7 +362,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 제거
+ * @brief drop a column from the table
**/
function dropColumn ($table_name, $column_name)
{
@@ -372,7 +372,7 @@
}
/**
- * @brief 특정 테이블의 column의 정보를 return
+ * @brief return column information of the table
**/
function isColumnExists ($table_name, $column_name)
{
@@ -388,7 +388,7 @@
}
/**
- * @brief 특정 테이블에 특정 인덱스 추가
+ * @brief add an index to the table
* $target_columns = array(col1, col2)
* $is_unique? unique : none
**/
@@ -404,7 +404,7 @@
}
/**
- * @brief 특정 테이블의 특정 인덱스 삭제
+ * @brief drop an index from the table
**/
function dropIndex ($table_name, $index_name, $is_unique = false)
{
@@ -414,7 +414,7 @@
}
/**
- * @brief 특정 테이블의 index 정보를 return
+ * @brief return index information of the table
**/
function isIndexExists ($table_name, $index_name)
{
@@ -430,7 +430,7 @@
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief creates a table by using xml file
**/
function createTableByXml ($xml_doc)
{
@@ -438,19 +438,19 @@
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief creates a table by using xml file
**/
function createTableByXmlFile ($file_name)
{
if (!file_exists ($file_name)) return;
- // xml 파일을 읽음
+ // read xml file
$buff = FileHandler::readFile ($file_name);
return $this->_createTable ($buff);
}
/**
- * @brief schema xml을 이용하여 create class query생성
+ * @brief create table by using the schema xml
*
* type : number, varchar, tinytext, text, bigtext, char, date, \n
* opt : notnull, default, size\n
@@ -461,14 +461,13 @@
// xml parsing
$oXml = new XmlParser();
$xml_obj = $oXml->parse($xml_doc);
-
- // 테이블 생성 schema 작성
+ // Create a table schema
$table_name = $xml_obj->table->attrs->name;
// if the table already exists exit function
if ($this->isTableExists($table_name)) return;
- // 만약 테이블 이름이 sequence라면 serial 생성
+ // If the table name is sequence, it creates a serial
if ($table_name == 'sequence') {
$query = sprintf ('create serial "%s" start with 1 increment by 1'.
' minvalue 1 '.
@@ -563,7 +562,7 @@
}
/**
- * @brief 조건문 작성하여 return
+ * @brief return the condition
**/
function getCondition ($output)
{
@@ -651,16 +650,16 @@
}
/**
- * @brief insertAct 처리
+ * @brief handles insertAct
**/
function _executeInsertAct ($output)
{
- // 테이블 정리
+ // tables
foreach ($output->tables as $val) {
$table_list[] = '"'.$this->prefix.$val.'"';
}
- // 컬럼 정리
+ // columns
foreach ($output->columns as $key => $val) {
$name = $val['name'];
$value = $val['value'];
@@ -699,18 +698,18 @@
}
/**
- * @brief updateAct 처리
+ * @brief handles updateAct
**/
function _executeUpdateAct ($output)
{
- // 테이블 정리
+ // tables
foreach ($output->tables as $key => $val) {
$table_list[] = '"'.$this->prefix.$val.'" as "'.$key.'"';
}
$check_click_count = true;
- // 컬럼 정리
+ // columns
foreach ($output->columns as $key => $val) {
if (!isset ($val['value'])) continue;
$name = $val['name'];
@@ -721,10 +720,10 @@
}
for ($i = 0; $i < $key; $i++) {
- /* 한문장에 같은 속성에 대한 중복 설정은 큐브리드에서는 허용치 않음 */
+ // not allows to define the same property repeatedly in a single query in CUBRID
if ($output->columns[$i]['name'] == $name) break;
}
- if ($i < $key) continue; // 중복이 발견되면 이후의 설정은 무시
+ if ($i < $key) continue; // ignore the rest of properties if duplicated property found
if (strpos ($name, '.') !== false && strpos ($value, '.') !== false) {
$column_list[] = $name.' = '.$value;
@@ -742,7 +741,7 @@
}
}
- // 조건절 정리
+ // conditional clause
$condition = $this->getCondition ($output);
$check_click_count_condition = false;
@@ -792,16 +791,16 @@
}
/**
- * @brief deleteAct 처리
+ * @brief handles deleteAct
**/
function _executeDeleteAct ($output)
{
- // 테이블 정리
+ // tables
foreach ($output->tables as $val) {
$table_list[] = '"'.$this->prefix.$val.'"';
}
- // 조건절 정리
+ // Conditional clauses
$condition = $this->getCondition ($output);
$query = sprintf ("delete from %s %s", implode (',',$table_list), $condition);
@@ -812,14 +811,14 @@
}
/**
- * @brief selectAct 처리
+ * @brief Handle selectAct
*
- * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n
- * navigation이라는 method를 제공
+ * to get a specific page list easily in select statement,\n
+ * a method, navigation, is used
**/
function _executeSelectAct ($output)
{
- // 테이블 정리
+ // tables
$table_list = array ();
foreach ($output->tables as $key => $val) {
$table_list[] = '"'.$this->prefix.$val.'" as "'.$key.'"';
@@ -966,7 +965,7 @@
}
- // list_count를 사용할 경우 적용
+ // apply when using list_count
if ($output->list_count['value']) {
$start_count = 0;
$list_count = $output->list_count['value'];
@@ -1050,7 +1049,7 @@
}
/**
- * @brief 현재 시점의 Stack trace를 보여줌.결과를 fetch
+ * @brief displays the current stack trace. Fetch the result
**/
function backtrace ()
{
@@ -1102,9 +1101,9 @@
}
/**
- * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다
+ * @brief paginates when navigation info exists in the query xml
*
- * 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
+ * it is convenient although its structure is not good .. -_-;
**/
function _getNavigationData ($table_list, $columns, $left_join, $condition, $output) {
require_once (_XE_PATH_.'classes/page/PageHandler.class.php');
@@ -1129,7 +1128,7 @@
$page = $output->page['value'];
if (!$page) $page = 1;
- // 전체 페이지를 구함
+ // total pages
if ($total_count) {
$total_page = (int) (($total_count - 1) / $list_count) + 1;
}
@@ -1137,7 +1136,7 @@
$total_page = 1;
}
- // 페이지 변수를 체크
+ // check the page variables
if ($page > $total_page) $page = $total_page;
$start_count = ($page - 1) * $list_count;
diff --git a/classes/db/DBFirebird.class.php b/classes/db/DBFirebird.class.php
index 12ab747a4..239903d58 100644
--- a/classes/db/DBFirebird.class.php
+++ b/classes/db/DBFirebird.class.php
@@ -1,8 +1,8 @@
'BIGINT',
@@ -55,7 +55,7 @@
}
/**
- * @brief 설치 가능 여부를 return
+ * @brief Return if installable
**/
function isSupported() {
if(!function_exists('ibase_connect')) return false;
@@ -63,7 +63,7 @@
}
/**
- * @brief DB정보 설정 및 connect/ close
+ * @brief DB settings and connect/close
**/
function _setDBInfo() {
$db_info = Context::getDBInfo();
@@ -77,16 +77,14 @@
}
/**
- * @brief DB 접속
+ * @brief DB Connection
**/
function _connect() {
- // db 정보가 없으면 무시
+ // ignore if db information not exists
if(!$this->hostname || !$this->port || !$this->userid || !$this->password || !$this->database) return;
//if(strpos($this->hostname, ':')===false && $this->port) $this->hostname .= ':'.$this->port;
-
- // 접속시도
-
+ // attempts to connect
$host = $this->hostname."/".$this->port.":".$this->database;
$this->fd = @ibase_connect($host, $this->userid, $this->password);
@@ -94,8 +92,7 @@
$this->setError(ibase_errcode(), ibase_errmsg());
return $this->is_connected = false;
}
-
- // Firebird 버전 확인후 2.0 이하면 오류 표시
+ // Error when Firebird version is lower than 2.0
if (($service = ibase_service_attach($this->hostname, $this->userid, $this->password)) != FALSE) {
// get server version and implementation strings
$server_info = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);
@@ -118,14 +115,13 @@
@ibase_close($this->fd);
return $this->is_connected = false;
}
-
- // 접속체크
+ // Check connections
$this->is_connected = true;
$this->password = md5($this->password);
}
/**
- * @brief DB접속 해제
+ * @brief DB disconnect
**/
function close() {
if(!$this->isConnected()) return;
@@ -135,7 +131,7 @@
}
/**
- * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
+ * @brief handles quatation of the string variables from the query
**/
function addQuotes($string) {
// if(get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
@@ -144,7 +140,7 @@
}
/**
- * @brief 쿼리에서 입력되는 table, column 명에 더블쿼터를 넣어줌
+ * @brief put double quotes for tabls, column names in the query statement
**/
function addDoubleQuotes($string) {
if($string == "*") return $string;
@@ -162,12 +158,11 @@
}
/**
- * @brief 쿼리에서 입력되는 table, column 명에 더블쿼터를 넣어줌
+ * @brief put double quotes for tabls, column names in the query statement
**/
function autoQuotes($string){
$string = strtolower($string);
-
- // substr 함수 일경우
+ // for substr function
if(strpos($string, "substr(") !== false) {
$tokken = strtok($string, "(,)");
$tokken = strtok("(,)");
@@ -190,8 +185,7 @@
$as = trim($as);
$as = $this->addDoubleQuotes($as);
}
-
- // 함수 사용시
+ // for functions
$tmpFunc1 = null;
$tmpFunc2 = null;
if(($no1 = strpos($string,'('))!==false && ($no2 = strpos($string, ')'))!==false) {
@@ -199,8 +193,7 @@
$tmpFunc2 = substr($string, $no2, strlen($string)-$no2+1);
$string = trim(substr($string, $no1+1, $no2-$no1-1));
}
-
- // (테이블.컬럼) 구조 일때 처리
+ // for (table.column) structure
preg_match("/((?i)[a-z0-9_-]+)[.]((?i)[a-z0-9_\-\*]+)/", $string, $matches);
if($matches) {
@@ -225,7 +218,7 @@
}
foreach($values as $val1) {
- // (테이블.컬럼) 구조 일때 처리
+ // for (table.column) structure
preg_match("/((?i)[a-z0-9_-]+)[.]((?i)[a-z0-9_\-\*]+)/", $val1, $matches);
if($matches) {
$isTable = false;
@@ -257,7 +250,7 @@
}
/**
- * @brief 트랜잭션 시작
+ * @brief Begin transaction
**/
function begin() {
if(!$this->isConnected() || $this->transaction_started) return;
@@ -265,7 +258,7 @@
}
/**
- * @brief 롤백
+ * @brief Rollback
**/
function rollback() {
if(!$this->isConnected() || !$this->transaction_started) return;
@@ -274,7 +267,7 @@
}
/**
- * @brief 커밋
+ * @brief Commits
**/
function commit() {
if(!$force && (!$this->isConnected() || !$this->transaction_started)) return;
@@ -283,48 +276,43 @@
}
/**
- * @brief : 쿼리문의 실행 및 결과의 fetch 처리
+ * @brief : Run a query and fetch the result
*
- * query : query문 실행하고 result return\n
- * fetch : reutrn 된 값이 없으면 NULL\n
- * rows이면 array object\n
- * row이면 object\n
- * return\n
+ * query: run a query and return the result\n
+ * fetch: NULL if no value returned \n
+ * array object if rows returned \n
+ * object if a row returned \n
+ * return\n
**/
function _query($query, $params=null) {
if(!$this->isConnected()) return;
if(count($params) == 0) {
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$this->actStart($query);
-
- // 쿼리 문 실행
+ // Execute the query statement
$result = ibase_query($this->fd, $query);
}
else {
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$log = $query."\n\t\t\t";
$log .= implode(",", $params);
$this->actStart($log);
-
- // 쿼리 문 실행 (blob type 입력하기 위한 방법)
+ // Execute the query(for blob type)
$query = ibase_prepare($this->fd, $query);
$fnarr = array_merge(array($query), $params);
$result = call_user_func_array("ibase_execute", $fnarr);
}
-
- // 오류 체크
+ // Error Check
if(ibase_errmsg()) $this->setError(ibase_errcode(), ibase_errmsg());
-
- // 쿼리 실행 종료를 알림
+ // Notify to complete a query execution
$this->actFinish();
-
- // 결과 리턴
+ // Return the result
return $result;
}
/**
- * @brief 결과를 fetch
+ * @brief Fetch the result
**/
function _fetch($result, $output = null) {
if(!$this->isConnected() || $this->isError() || !$result) return;
@@ -332,12 +320,11 @@
while($tmp = ibase_fetch_object($result)) {
foreach($tmp as $key => $val) {
$type = $output->column_type[$key];
-
- // type 값이 null 일때는 $key값이 alias인 경우라 실제 column 이름을 찾아 type을 구함
+ // type value is null when $key is an alias. so get a type by finding actual coloumn name
if($type == null && $output->columns && count($output->columns)) {
foreach($output->columns as $cols) {
if($cols['alias'] == $key) {
- // table.column 형식인지 정규식으로 검사 함
+ // checks if the format is table.column or a regular expression
preg_match("/\w+[.](\w+)/", $cols['name'], $matches);
if($matches) {
$type = $output->column_type[$matches[1]];
@@ -356,7 +343,7 @@
ibase_blob_close($blob_hndl);
}
else if($type == "char") {
- $tmp->{$key} = trim($tmp->{$key}); // DB의 character set이 UTF8일때 생기는 빈칸을 제거
+ $tmp->{$key} = trim($tmp->{$key}); // remove blanks generated when DB character set is UTF8
}
}
@@ -368,7 +355,7 @@
}
/**
- * @brief 1씩 증가되는 sequence값을 return (firebird의 generator 값을 증가)
+ * @brief return sequence value incremented by 1(increase the value of the generator in firebird)
**/
function getNextSequence() {
$gen = "GEN_".$this->prefix."sequence_ID";
@@ -377,7 +364,7 @@
}
/**
- * @brief 테이블 기생성 여부 return
+ * @brief returns if the table already exists
**/
function isTableExists($target_name) {
$query = sprintf("select rdb\$relation_name from rdb\$relations where rdb\$system_flag=0 and rdb\$relation_name = '%s%s';", $this->prefix, $target_name);
@@ -392,7 +379,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 추가
+ * @brief add a column to the table
**/
function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) {
$type = $this->column_type[$type];
@@ -412,7 +399,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 제거
+ * @brief drop a column from the table
**/
function dropColumn($table_name, $column_name) {
$query = sprintf("alter table %s%s drop %s ", $this->prefix, $table_name, $column_name);
@@ -422,7 +409,7 @@
/**
- * @brief 특정 테이블의 column의 정보를 return
+ * @brief return column information of the table
**/
function isColumnExists($table_name, $column_name) {
$query = sprintf("SELECT RDB\$FIELD_NAME as \"FIELD\" FROM RDB\$RELATION_FIELDS WHERE RDB\$RELATION_NAME = '%s%s'", $this->prefix, $table_name);
@@ -446,15 +433,14 @@
}
/**
- * @brief 특정 테이블에 특정 인덱스 추가
+ * @brief add an index to the table
* $target_columns = array(col1, col2)
* $is_unique? unique : none
**/
function addIndex($table_name, $index_name, $target_columns, $is_unique = false) {
- // index name 크기가 31byte로 제한으로 index name을 넣지 않음
- // Firebird에서는 index name을 넣지 않으면 "RDB$10"처럼 자동으로 이름을 부여함
- // table을 삭제 할 경우 인덱스도 자동으로 삭제 됨
-
+ // index name size should be limited to 31 byte. no index name assigned
+ // if index name omitted, Firebird automatically assign its name like "RDB $10"
+ // deletes indexes when deleting the table
if(!is_array($target_columns)) $target_columns = array($target_columns);
$query = sprintf('CREATE %s INDEX "" ON "%s%s" ("%s");', $is_unique?'UNIQUE':'', $this->prefix, $table_name, implode('", "',$target_columns));
@@ -464,7 +450,7 @@
}
/**
- * @brief 특정 테이블의 특정 인덱스 삭제
+ * @brief drop an index from the table
**/
function dropIndex($table_name, $index_name, $is_unique = false) {
$query = sprintf('DROP INDEX "%s" ON "%s%s"', $index_name, $this->prefix, $table_name);
@@ -475,7 +461,7 @@
/**
- * @brief 특정 테이블의 index 정보를 return
+ * @brief return index information of the table
**/
function isIndexExists($table_name, $index_name) {
$query = "SELECT\n";
@@ -512,24 +498,24 @@
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief creates a table by using xml file
**/
function createTableByXml($xml_doc) {
return $this->_createTable($xml_doc);
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief creates a table by using xml file
**/
function createTableByXmlFile($file_name) {
if(!file_exists($file_name)) return;
- // xml 파일을 읽음
+ // read xml file
$buff = FileHandler::readFile($file_name);
return $this->_createTable($buff);
}
/**
- * @brief schema xml을 이용하여 create table query생성
+ * @brief create table by using the schema xml
*
* type : number, varchar, text, char, date, \n
* opt : notnull, default, size\n
@@ -539,8 +525,7 @@
// xml parsing
$oXml = new XmlParser();
$xml_obj = $oXml->parse($xml_doc);
-
- // 테이블 생성 schema 작성
+ // Create a table schema
$table_name = $xml_obj->table->attrs->name;
if($this->isTableExists($table_name)) return;
$table_name = $this->prefix.$table_name;
@@ -596,10 +581,9 @@
if(count($index_list)) {
foreach($index_list as $key => $val) {
- // index name 크기가 31byte로 제한으로 index name을 넣지 않음
- // Firebird에서는 index name을 넣지 않으면 "RDB$10"처럼 자동으로 이름을 부여함
- // table을 삭제 할 경우 인덱스도 자동으로 삭제 됨
-
+ // index name size should be limited to 31 byte. no index name assigned
+ // if index name omitted, Firebird automatically assign its name like "RDB $10"
+ // deletes indexes when deleting the table
$schema = sprintf("CREATE INDEX \"\" ON \"%s\" (\"%s\");",
$table_name, implode($val, "\",\""));
$output = $this->_query($schema);
@@ -613,12 +597,11 @@
$output = $this->_query($schema);
if(!$this->transaction_started) @ibase_commit($this->fd);
if(!$output) return false;
-
- // Firebird에서 auto increment는 generator를 만들어 insert 발생시 트리거를 실행시켜
- // generator의 값을 증가시키고 그값을 테이블에 넣어주는 방식을 사용함.
- // 아래 트리거가 auto increment 역할을 하지만 쿼리로 트리거 등록이 되지 않아 주석처리 하였음.
- // php 함수에서 generator 값을 증가시켜 주는 함수가 있어 XE에서는 굳이
- // auto increment를 사용 할 필요가 없어보임.
+ // auto_increment in Firebird creates a generator which activates a trigger when insert occurs
+ // the generator increases the value of the generator and then insert to the table
+ // The trigger below acts like auto_increment however I commented the below because the trigger cannot be defined by a query statement
+ // php api has a function to increase a generator, so
+ // no need to use auto increment in XE
/*
$schema = 'SET TERM ^ ; ';
$schema .= sprintf('CREATE TRIGGER "%s_BI" FOR "%s" ', $table_name, $table_name);
@@ -634,7 +617,7 @@
}
/**
- * @brief 조건문 작성하여 return
+ * @brief Return conditional clause
**/
function getCondition($output) {
if(!$output->conditions) return;
@@ -683,15 +666,14 @@
}
/**
- * @brief insertAct 처리
+ * @brief Handle the insertAct
**/
function _executeInsertAct($output) {
- // 테이블 정리
+ // tables
foreach($output->tables as $key => $val) {
$table_list[] = '"'.$this->prefix.$val.'"';
}
-
- // 컬럼 정리
+ // Columns
foreach($output->columns as $key => $val) {
$name = $val['name'];
$value = $val['value'];
@@ -721,15 +703,14 @@
}
/**
- * @brief updateAct 처리
+ * @brief handles updateAct
**/
function _executeUpdateAct($output) {
- // 테이블 정리
+ // Tables
foreach($output->tables as $key => $val) {
$table_list[] = '"'.$this->prefix.$val.'"';
}
-
- // 컬럼 정리
+ // Columns
foreach($output->columns as $key => $val) {
if(!isset($val['value'])) continue;
$name = $val['name'];
@@ -747,7 +728,7 @@
else if($output->column_type[$name]=='number' ||
$output->column_type[$name]=='bignumber' ||
$output->column_type[$name]=='float') {
- // 연산식이 들어갔을 경우 컬럼명이 있는 지 체크해 더블쿼터를 넣어줌
+ // put double-quotes on column name if an expression is entered
preg_match("/(?i)[a-z][a-z0-9_]+/", $value, $matches);
foreach($matches as $key => $val) {
@@ -764,8 +745,7 @@
$column_list[] = sprintf('"%s" = ?', $name);
}
}
-
- // 조건절 정리
+ // conditional clause
$condition = $this->getCondition($output);
$query = sprintf("update %s set %s %s;", implode(',',$table_list), implode(',',$column_list), $condition);
@@ -775,15 +755,14 @@
}
/**
- * @brief deleteAct 처리
+ * @brief handles deleteAct
**/
function _executeDeleteAct($output) {
- // 테이블 정리
+ // Tables
foreach($output->tables as $key => $val) {
$table_list[] = '"'.$this->prefix.$val.'"';
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("delete from %s %s;", implode(',',$table_list), $condition);
@@ -794,13 +773,13 @@
}
/**
- * @brief selectAct 처리
+ * @brief Handle selectAct
*
- * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n
- * navigation이라는 method를 제공
+ * In order to get a list of pages easily when selecting \n
+ * it supports a method as navigation
**/
function _executeSelectAct($output) {
- // 테이블 정리
+ // Tables
$table_list = array();
foreach($output->tables as $key => $val) {
$table_list[] = sprintf("\"%s%s\" as \"%s\"", $this->prefix, $val, $key);
@@ -839,8 +818,7 @@
$output->column_list = $column_list;
if($output->list_count && $output->page) return $this->_getNavigationData($table_list, $columns, $left_join, $condition, $output);
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // query added in the condition to use an index when ordering by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -852,8 +830,7 @@
}
}
}
-
- // list_count를 사용할 경우 적용
+ // apply when using list_count
if($output->list_count['value']) $limit = sprintf('FIRST %d', $output->list_count['value']);
else $limit = '';
@@ -910,9 +887,9 @@
}
/**
- * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다
+ * @brief paginates when navigation info exists in the query xml
*
- * 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
+ * it is convenient although its structure is not good .. -_-;
**/
function _getNavigationData($table_list, $columns, $left_join, $condition, $output) {
require_once(_XE_PATH_.'classes/page/PageHandler.class.php');
@@ -929,8 +906,8 @@
}
/*
- // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정
- // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다.
+ // modified to get the number of rows by SELECT query with group by clause
+ // activate the commented codes when you confirm it works correctly
//
$count_condition = strlen($query_groupby) ? sprintf('%s group by %s', $condition, $query_groupby) : $condition;
$total_count = $this->getCountCache($output->tables, $count_condition);
@@ -944,8 +921,7 @@
$this->putCountCache($output->tables, $count_condition, $total_count);
}
*/
-
- // 전체 개수를 구함
+ // total number of rows
$count_query = sprintf("select count(*) as \"count\" from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition);
$count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id . ' count(*)'):'';
$result = $this->_query($count_query);
@@ -960,16 +936,13 @@
if(!$page_count) $page_count = 10;
$page = $output->page['value'];
if(!$page) $page = 1;
-
- // 전체 페이지를 구함
+ // total pages
if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1;
else $total_page = 1;
-
- // 페이지 변수를 체크
+ // check the page variables
if($page > $total_page) $page = $total_page;
$start_count = ($page-1)*$list_count;
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // query added in the condition to use an index when ordering by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -1025,12 +998,11 @@
while($tmp = ibase_fetch_object($result)) {
foreach($tmp as $key => $val){
$type = $output->column_type[$key];
-
- // type 값이 null 일때는 $key값이 alias인 경우라 실제 column 이름을 찾아 type을 구함
+ // $key value is an alias when type value is null. get type by finding the actual column name
if($type == null && $output->columns && count($output->columns)) {
foreach($output->columns as $cols) {
if($cols['alias'] == $key) {
- // table.column 형식인지 정규식으로 검사 함
+ // checks if the format is table.column or a regular expression
preg_match("/\w+[.](\w+)/", $cols['name'], $matches);
if($matches) {
$type = $output->column_type[$matches[1]];
diff --git a/classes/db/DBMssql.class.php b/classes/db/DBMssql.class.php
index 3a0b75bb0..0bebd948c 100644
--- a/classes/db/DBMssql.class.php
+++ b/classes/db/DBMssql.class.php
@@ -3,26 +3,26 @@
/**
* @class DBMSSQL
* @author NHN (developers@xpressengine.com)
- * @brief MSSQL driver로 수정 sol (sol@ngleader.com)
+ * @brief Modified to use MSSQL driver by sol (sol@ngleader.com)
* @version 0.1
**/
class DBMssql extends DB {
/**
- * DB를 이용하기 위한 정보
+ * information to connect to DB
**/
var $conn = NULL;
var $database = NULL; ///< database
- var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
+ var $prefix = 'xe'; // / 'bigint',
@@ -52,7 +52,7 @@
}
/**
- * @brief 설치 가능 여부를 return
+ * @brief Return if installable
**/
function isSupported() {
if (!extension_loaded("sqlsrv")) return false;
@@ -60,7 +60,7 @@
}
/**
- * @brief DB정보 설정 및 connect/ close
+ * @brief DB settings and connect/close
**/
function _setDBInfo() {
$db_info = Context::getDBInfo();
@@ -75,10 +75,10 @@
}
/**
- * @brief DB 접속
+ * @brief DB Connection
**/
function _connect() {
- // db 정보가 없으면 무시
+ // ignore if db information not exists
if(!$this->hostname || !$this->database) return;
//sqlsrv_configure( 'WarningsReturnAsErrors', 0 );
@@ -89,7 +89,8 @@
array( 'Database' => $this->database,'UID'=>$this->userid,'PWD'=>$this->password ));
- // 접속체크
+// Check connections
+
if($this->conn){
$this->is_connected = true;
$this->password = md5($this->password);
@@ -99,7 +100,7 @@
}
/**
- * @brief DB접속 해제
+ * @brief DB disconnect
**/
function close() {
if($this->is_connected == false) return;
@@ -110,7 +111,7 @@
}
/**
- * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
+ * @brief handles quatation of the string variables from the query
**/
function addQuotes($string) {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
@@ -120,7 +121,7 @@
}
/**
- * @brief 트랜잭션 시작
+ * @brief Begin transaction
**/
function begin() {
if($this->is_connected == false || $this->transaction_started) return;
@@ -130,7 +131,7 @@
}
/**
- * @brief 롤백
+ * @brief Rollback
**/
function rollback() {
if($this->is_connected == false || !$this->transaction_started) return;
@@ -140,7 +141,7 @@
}
/**
- * @brief 커밋
+ * @brief Commit
**/
function commit($force = false) {
if(!$force && ($this->is_connected == false || !$this->transaction_started)) return;
@@ -150,13 +151,13 @@
}
/**
- * @brief : 쿼리문의 실행 및 결과의 fetch 처리
+ * @brief : executing the query and fetching the result
*
- * query : query문 실행하고 result return\n
- * fetch : reutrn 된 값이 없으면 NULL\n
- * rows이면 array object\n
- * row이면 object\n
- * return\n
+ * query: run a query and return the result\n
+ * fetch: NULL if no value returned \n
+ * array object if rows returned \n
+ * object if a row returned \n
+ * return\n
**/
function _query($query) {
if($this->is_connected == false || !$query) return;
@@ -173,21 +174,21 @@
}
}
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$this->actStart($query);
- // 쿼리 문 실행
+ // Run the query statement
$result = false;
if(count($_param)){
$result = @sqlsrv_query($this->conn, $query, $_param);
}else{
$result = @sqlsrv_query($this->conn, $query);
}
-
- // 오류 체크
+// Error Check
+
if(!$result) $this->setError(print_r(sqlsrv_errors(),true));
- // 쿼리 실행 종료를 알림
+ // Notify to complete a query execution
$this->actFinish();
$this->param = array();
@@ -195,7 +196,7 @@
}
/**
- * @brief 결과를 fetch
+ * @brief Fetch results
**/
function _fetch($result) {
if(!$this->isConnected() || $this->isError() || !$result) return;
@@ -219,7 +220,7 @@
}
/**
- * @brief 1씩 증가되는 sequence값을 return (mssql의 auto_increment는 sequence테이블에서만 사용)
+ * @brief Return sequence value incremented by 1(auto_increment is usd in the sequence table only)
**/
function getNextSequence() {
$query = sprintf("insert into %ssequence (seq) values (ident_incr('%ssequence'))", $this->prefix, $this->prefix);
@@ -234,7 +235,7 @@
}
/**
- * @brief 테이블 기생성 여부 return
+ * @brief Return if a table already exists
**/
function isTableExists($target_name) {
$query = sprintf("select name from sysobjects where name = '%s%s' and xtype='U'", $this->prefix, $this->addQuotes($target_name));
@@ -246,7 +247,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 추가
+ * @brief Add a column to a table
**/
function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) {
if($this->isColumnExists($table_name, $column_name)) return;
@@ -263,7 +264,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 제거
+ * @brief Delete a column from a table
**/
function dropColumn($table_name, $column_name) {
if(!$this->isColumnExists($table_name, $column_name)) return;
@@ -272,7 +273,7 @@
}
/**
- * @brief 특정 테이블의 column의 정보를 return
+ * @brief Return column information of a table
**/
function isColumnExists($table_name, $column_name) {
$query = sprintf("select syscolumns.name as name from syscolumns, sysobjects where sysobjects.name = '%s%s' and sysobjects.id = syscolumns.id and syscolumns.name = '%s'", $this->prefix, $table_name, $column_name);
@@ -284,7 +285,7 @@
}
/**
- * @brief 특정 테이블에 특정 인덱스 추가
+ * @brief Add an index to a table
* $target_columns = array(col1, col2)
* $is_unique? unique : none
**/
@@ -297,7 +298,7 @@
}
/**
- * @brief 특정 테이블의 특정 인덱스 삭제
+ * @brief Drop an index from a table
**/
function dropIndex($table_name, $index_name, $is_unique = false) {
if(!$this->isIndexExists($table_name, $index_name)) return;
@@ -306,7 +307,7 @@
}
/**
- * @brief 특정 테이블의 index 정보를 return
+ * @brief Return index information of a table
**/
function isIndexExists($table_name, $index_name) {
$query = sprintf("select sysindexes.name as name from sysindexes, sysobjects where sysobjects.name = '%s%s' and sysobjects.id = sysindexes.id and sysindexes.name = '%s'", $this->prefix, $table_name, $index_name);
@@ -320,24 +321,24 @@
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief Create a table by using xml file
**/
function createTableByXml($xml_doc) {
return $this->_createTable($xml_doc);
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief Create a table by using xml file
**/
function createTableByXmlFile($file_name) {
if(!file_exists($file_name)) return;
- // xml 파일을 읽음
+ // read xml file
$buff = FileHandler::readFile($file_name);
return $this->_createTable($buff);
}
/**
- * @brief schema xml을 이용하여 create table query생성
+ * @brief generate a query statement to create a table by using schema xml
*
* type : number, varchar, text, char, date, \n
* opt : notnull, default, size\n
@@ -347,8 +348,7 @@
// xml parsing
$oXml = new XmlParser();
$xml_obj = $oXml->parse($xml_doc);
-
- // 테이블 생성 schema 작성
+ // Create a table schema
$table_name = $xml_obj->table->attrs->name;
if($this->isTableExists($table_name)) return;
@@ -409,7 +409,7 @@
}
/**
- * @brief 조건문 작성하여 return
+ * @brief Return conditional clause
**/
function getCondition($output) {
if(!$output->conditions) return;
@@ -525,16 +525,15 @@
}
/**
- * @brief insertAct 처리
+ * @brief Handle the insertAct
**/
function _executeInsertAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = '['.$this->prefix.$val.']';
}
-
- // 컬럼 정리
+ // List columns
foreach($output->columns as $key => $val) {
$name = $val['name'];
$value = $val['value'];
@@ -561,15 +560,16 @@
}
/**
- * @brief updateAct 처리
+ * @brief Handle updateAct
**/
function _executeUpdateAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = '['.$this->prefix.$val.']';
}
- // 컬럼 정리
+// List columns
+
foreach($output->columns as $key => $val) {
if(!isset($val['value'])) continue;
@@ -597,8 +597,7 @@
}
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("update %s set %s %s", implode(',',$table_list), implode(',',$column_list), $condition);
@@ -607,15 +606,14 @@
}
/**
- * @brief deleteAct 처리
+ * @brief Handle deleteAct
**/
function _executeDeleteAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = '['.$this->prefix.$val.']';
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("delete from %s %s", implode(',',$table_list), $condition);
@@ -624,13 +622,13 @@
}
/**
- * @brief selectAct 처리
+ * @brief Handle selectAct
*
- * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n
- * navigation이라는 method를 제공
+ * In order to get a list of pages easily when selecting \n
+ * it supports a method as navigation
**/
function _executeSelectAct($output) {
- // 테이블 정리
+ // List tables
$table_list = array();
foreach($output->tables as $key => $val) {
$table_list[] = '['.$this->prefix.$val.'] as '.$key;
@@ -675,8 +673,7 @@
$output->column_list = $column_list;
if($output->list_count && $output->page) return $this->_getNavigationData($table_list, $columns, $left_join, $condition, $output);
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -718,7 +715,7 @@
}
$query = sprintf("%s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query);
- // list_count를 사용할 경우 적용
+ // Apply when using list_count
if($output->list_count['value']) $query = sprintf('select top %d %s', $output->list_count['value'], $query);
else $query = "select ".$query;
@@ -741,16 +738,16 @@
}
/**
- * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다
+ * @brief Paging is handled if navigation information exists in the query xml
*
- * 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
+ * It is quite convenient although its structure is not good at all .. -_-;
**/
function _getNavigationData($table_list, $columns, $left_join, $condition, $output) {
require_once(_XE_PATH_.'classes/page/PageHandler.class.php');
$column_list = $output->column_list;
- // 전체 개수를 구함
+ // Get a total count
if(count($output->groups)){
foreach($output->groups as $k => $v ){
if(preg_match('/^substr\(/i',$v)) $output->groups[$k] = preg_replace('/^substr\(/i','substring(',$v);
@@ -780,16 +777,13 @@
if(!$page_count) $page_count = 10;
$page = $output->page['value'];
if(!$page) $page = 1;
-
- // 전체 페이지를 구함
+ // Get a total page
if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1;
else $total_page = 1;
-
- // 페이지 변수를 체크
+ // Check Page variables
if($page > $total_page) $page = $total_page;
$start_count = ($page-1)*$list_count;
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
$conditions = $this->getConditionList($output);
if($output->order) {
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -802,7 +796,7 @@
}
}
- // group by 절 추가
+ // Add group by clause
if(count($output->groups)){
foreach($output->groups as $k => $v ){
if(preg_match('/^substr\(/i',$v)) $output->groups[$k] = preg_replace('/^substr\(/i','substring(',$v);
@@ -812,7 +806,7 @@
$group = sprintf('group by %s', implode(',',$output->groups));
}
- // order 절 추가
+ // Add order by clause
$order_targets = array();
if($output->order) {
foreach($output->order as $key => $val) {
@@ -848,7 +842,7 @@
$first_sub_columns[] = $k;
}
- // 1차로 order 대상에 해당 하는 값을 가져옴
+ // Fetch values to sort
$param = $this->param;
$first_query = sprintf("select %s from (select top %d %s from %s %s %s %s %s) xet", implode(',',$first_columns), $start_count, implode(',',$first_sub_columns), implode(',',$table_list), implode(' ',$left_join), $condition, $group, $order);
$result = $this->_query($first_query);
@@ -857,7 +851,7 @@
- // 1차에서 나온 값을 이용 다시 쿼리 실행
+ // Re-execute a query by using fetched values
$sub_cond = array();
foreach($order_targets as $k => $v) {
$sub_cond[] = sprintf("%s %s '%s'", $k, $v=='asc'?'>':'<', $tmp->{$k});
diff --git a/classes/db/DBMysql.class.php b/classes/db/DBMysql.class.php
index 1caab871c..e34fe35d9 100644
--- a/classes/db/DBMysql.class.php
+++ b/classes/db/DBMysql.class.php
@@ -2,7 +2,7 @@
/**
* @class DBMysql
* @author NHN (developers@xpressengine.com)
- * @brief MySQL DBMS를 이용하기 위한 class
+ * @brief Class to use MySQL DBMS
* @version 0.1
*
* mysql handling class
@@ -11,20 +11,20 @@
class DBMysql extends DB {
/**
- * @brief Mysql DB에 접속하기 위한 정보
+ * @brief Connection information for Mysql DB
**/
var $hostname = '127.0.0.1'; ///< hostname
var $userid = NULL; ///< user id
var $password = NULL; ///< password
var $database = NULL; ///< database
- var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
+ var $prefix = 'xe'; // / 'bigint',
@@ -50,7 +50,7 @@
}
/**
- * @brief 설치 가능 여부를 return
+ * @brief Return if it is installable
**/
function isSupported() {
if(!function_exists('mysql_connect')) return false;
@@ -58,7 +58,7 @@
}
/**
- * @brief DB정보 설정 및 connect/ close
+ * @brief DB settings and connect/close
**/
function _setDBInfo() {
$db_info = Context::getDBInfo();
@@ -72,44 +72,39 @@
}
/**
- * @brief DB 접속
+ * @brief DB Connection
**/
function _connect() {
- // db 정보가 없으면 무시
+ // Ignore if no DB information exists
if(!$this->hostname || !$this->userid || !$this->password || !$this->database) return;
if(strpos($this->hostname, ':')===false && $this->port) $this->hostname .= ':'.$this->port;
-
- // 접속시도
+ // Attempt to connect
$this->fd = @mysql_connect($this->hostname, $this->userid, $this->password);
if(mysql_error()) {
$this->setError(mysql_errno(), mysql_error());
return;
}
-
- // 버전 확인후 4.1 이하면 오류 표시
+ // Error appears if the version is lower than 4.1
if(mysql_get_server_info($this->fd)<"4.1") {
$this->setError(-1, "XE cannot be installed under the version of mysql 4.1. Current mysql version is ".mysql_get_server_info());
return;
}
-
- // db 선택
+ // select db
@mysql_select_db($this->database, $this->fd);
if(mysql_error()) {
$this->setError(mysql_errno(), mysql_error());
return;
}
-
- // 접속체크
+ // Check connections
$this->is_connected = true;
$this->password = md5($this->password);
-
- // mysql의 경우 utf8임을 지정
+ // Set utf8 if a database is MySQL
$this->_query("set names 'utf8'");
}
/**
- * @brief DB접속 해제
+ * @brief DB disconnection
**/
function close() {
if(!$this->isConnected()) return;
@@ -117,7 +112,7 @@
}
/**
- * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
+ * @brief Add quotes on the string variables in a query
**/
function addQuotes($string) {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
@@ -126,53 +121,48 @@
}
/**
- * @brief 트랜잭션 시작
+ * @brief Begin transaction
**/
function begin() {
}
/**
- * @brief 롤백
+ * @brief Rollback
**/
function rollback() {
}
/**
- * @brief 커밋
+ * @brief Commits
**/
function commit() {
}
/**
- * @brief : 쿼리문의 실행 및 결과의 fetch 처리
+ * @brief : Run a query and fetch the result
*
- * query : query문 실행하고 result return\n
- * fetch : reutrn 된 값이 없으면 NULL\n
- * rows이면 array object\n
- * row이면 object\n
+ * query: run a query and return the result \n
+ * fetch: NULL if no value is returned \n
+ * array object if rows are returned \n
+ * object if a row is returned \n
* return\n
**/
function _query($query) {
if(!$this->isConnected()) return;
-
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$this->actStart($query);
-
- // 쿼리 문 실행
+ // Run the query statement
$result = @mysql_query($query, $this->fd);
-
- // 오류 체크
+ // Error Check
if(mysql_error($this->fd)) $this->setError(mysql_errno($this->fd), mysql_error($this->fd));
-
- // 쿼리 실행 종료를 알림
+ // Notify to complete a query execution
$this->actFinish();
-
- // 결과 리턴
+ // Return result
return $result;
}
/**
- * @brief 결과를 fetch
+ * @brief Fetch results
**/
function _fetch($result) {
if(!$this->isConnected() || $this->isError() || !$result) return;
@@ -184,7 +174,7 @@
}
/**
- * @brief 1씩 증가되는 sequence값을 return (mysql의 auto_increment는 sequence테이블에서만 사용)
+ * @brief Return sequence value incremented by 1(auto_increment is used in sequence table only in MySQL)
**/
function getNextSequence() {
$query = sprintf("insert into `%ssequence` (seq) values ('0')", $this->prefix);
@@ -199,7 +189,7 @@
}
/**
- * @brief mysql old password를 가져오는 함수 (mysql에서만 사용)
+ * @brief Function to obtain mysql old password(mysql only)
**/
function isValidOldPassword($password, $saved_password) {
$query = sprintf("select password('%s') as password, old_password('%s') as old_password", $this->addQuotes($password), $this->addQuotes($password));
@@ -210,7 +200,7 @@
}
/**
- * @brief 테이블 기생성 여부 return
+ * @brief Return if a table already exists
**/
function isTableExists($target_name) {
$query = sprintf("show tables like '%s%s'", $this->prefix, $this->addQuotes($target_name));
@@ -221,7 +211,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 추가
+ * @brief Add a column to a table
**/
function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) {
$type = $this->column_type[$type];
@@ -237,7 +227,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 제거
+ * @brief Delete a column from a table
**/
function dropColumn($table_name, $column_name) {
$query = sprintf("alter table `%s%s` drop `%s` ", $this->prefix, $table_name, $column_name);
@@ -245,7 +235,7 @@
}
/**
- * @brief 특정 테이블의 column의 정보를 return
+ * @brief Return column information of a table
**/
function isColumnExists($table_name, $column_name) {
$query = sprintf("show fields from `%s%s`", $this->prefix, $table_name);
@@ -263,7 +253,7 @@
}
/**
- * @brief 특정 테이블에 특정 인덱스 추가
+ * @brief Add an index to a table
* $target_columns = array(col1, col2)
* $is_unique? unique : none
**/
@@ -275,7 +265,7 @@
}
/**
- * @brief 특정 테이블의 특정 인덱스 삭제
+ * @brief Drop an index from a table
**/
function dropIndex($table_name, $index_name, $is_unique = false) {
$query = sprintf("alter table `%s%s` drop index `%s`", $this->prefix, $table_name, $index_name);
@@ -284,7 +274,7 @@
/**
- * @brief 특정 테이블의 index 정보를 return
+ * @brief Return index information of a table
**/
function isIndexExists($table_name, $index_name) {
//$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name);
@@ -302,24 +292,24 @@
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief Create a table by using xml file
**/
function createTableByXml($xml_doc) {
return $this->_createTable($xml_doc);
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief Create a table by using xml file
**/
function createTableByXmlFile($file_name) {
if(!file_exists($file_name)) return;
- // xml 파일을 읽음
+ // read xml file
$buff = FileHandler::readFile($file_name);
return $this->_createTable($buff);
}
/**
- * @brief schema xml을 이용하여 create table query생성
+ * @brief generate a query statement to create a table by using schema xml
*
* type : number, varchar, text, char, date, \n
* opt : notnull, default, size\n
@@ -329,8 +319,7 @@
// xml parsing
$oXml = new XmlParser();
$xml_obj = $oXml->parse($xml_doc);
-
- // 테이블 생성 schema 작성
+ // Create a table schema
$table_name = $xml_obj->table->attrs->name;
if($this->isTableExists($table_name)) return;
$table_name = $this->prefix.$table_name;
@@ -386,7 +375,7 @@
}
/**
- * @brief 조건문 작성하여 return
+ * @brief Return conditional clause
**/
function getCondition($output) {
if(!$output->conditions) return;
@@ -429,15 +418,14 @@
}
/**
- * @brief insertAct 처리
+ * @brief Handle the insertAct
**/
function _executeInsertAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = '`'.$this->prefix.$val.'`';
}
-
- // 컬럼 정리
+ // List columns
foreach($output->columns as $key => $val) {
$name = $val['name'];
$value = $val['value'];
@@ -466,15 +454,14 @@
}
/**
- * @brief updateAct 처리
+ * @brief Handle updateAct
**/
function _executeUpdateAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = '`'.$this->prefix.$val.'` as '.$key;
}
-
- // 컬럼 정리
+ // List columns
foreach($output->columns as $key => $val) {
if(!isset($val['value'])) continue;
$name = $val['name'];
@@ -487,8 +474,7 @@
$column_list[] = sprintf("`%s` = %s", $name, $value);
}
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("update %s set %s %s", implode(',',$table_list), implode(',',$column_list), $condition);
@@ -497,15 +483,14 @@
}
/**
- * @brief deleteAct 처리
+ * @brief Handle deleteAct
**/
function _executeDeleteAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = '`'.$this->prefix.$val.'`';
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("delete from %s %s", implode(',',$table_list), $condition);
@@ -514,13 +499,13 @@
}
/**
- * @brief selectAct 처리
+ * @brief Handle selectAct
*
- * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n
- * navigation이라는 method를 제공
+ * In order to get a list of pages easily when selecting \n
+ * it supports a method as navigation
**/
function _executeSelectAct($output) {
- // 테이블 정리
+ // List tables
$table_list = array();
foreach($output->tables as $key => $val) {
$table_list[] = '`'.$this->prefix.$val.'` as '.$key;
@@ -584,8 +569,7 @@
$condition = $this->getCondition($output);
if($output->list_count && $output->page) return $this->_getNavigationData($table_list, $columns, $left_join, $condition, $output);
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -633,7 +617,7 @@
$query = sprintf("select %s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query);
- // list_count를 사용할 경우 적용
+ // Apply when using list_count
if($output->list_count['value']) $query = sprintf('%s limit %d', $query, $output->list_count['value']);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
@@ -656,16 +640,16 @@
}
/**
- * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다
+ * @brief Paging is handled if navigation information exists in the query xml
*
- * 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
+ * It is quite convenient although its structure is not good at all .. -_-;
**/
function _getNavigationData($table_list, $columns, $left_join, $condition, $output) {
require_once(_XE_PATH_.'classes/page/PageHandler.class.php');
$column_list = $output->column_list;
- // 전체 개수를 구함
+ // Get a total count
$count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition;
$count_query = sprintf("select count(*) as count from %s %s %s", implode(', ', $table_list), implode(' ', $left_join), $count_condition);
if (count($output->groups)) $count_query = sprintf('select count(*) as count from (%s) xet', $count_query);
@@ -681,16 +665,13 @@
if(!$page_count) $page_count = 10;
$page = $output->page['value'];
if(!$page) $page = 1;
-
- // 전체 페이지를 구함
+ // Get a total page
if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1;
else $total_page = 1;
-
- // 페이지 변수를 체크
+ // Check Page variables
if($page > $total_page) $page = $total_page;
$start_count = ($page-1)*$list_count;
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
diff --git a/classes/db/DBMysql_innodb.class.php b/classes/db/DBMysql_innodb.class.php
index 2ada937b0..0c0a6bc87 100644
--- a/classes/db/DBMysql_innodb.class.php
+++ b/classes/db/DBMysql_innodb.class.php
@@ -4,7 +4,7 @@
/**
* @class DBMysql_innodb
* @author NHN (developers@xpressengine.com)
- * @brief MySQL DBMS를 이용하기 위한 class
+ * @brief class to use MySQL DBMS
* @version 0.1
*
* mysql innodb handling class
@@ -29,7 +29,7 @@
}
/**
- * @brief DB접속 해제
+ * @brief DB disconnection
**/
function close() {
if(!$this->isConnected()) return;
@@ -38,7 +38,7 @@
}
/**
- * @brief 트랜잭션 시작
+ * @brief Begin transaction
**/
function begin() {
if(!$this->isConnected() || $this->transaction_started) return;
@@ -47,7 +47,7 @@
}
/**
- * @brief 롤백
+ * @brief Rollback
**/
function rollback() {
if(!$this->isConnected() || !$this->transaction_started) return;
@@ -56,7 +56,7 @@
}
/**
- * @brief 커밋
+ * @brief Commits
**/
function commit($force = false) {
if(!$force && (!$this->isConnected() || !$this->transaction_started)) return;
@@ -65,35 +65,30 @@
}
/**
- * @brief : 쿼리문의 실행 및 결과의 fetch 처리
+ * @brief : Run a query and fetch the result
*
- * query : query문 실행하고 result return\n
- * fetch : reutrn 된 값이 없으면 NULL\n
- * rows이면 array object\n
- * row이면 object\n
+ * query: run a query and return the result \n
+ * fetch: NULL if no value is returned \n
+ * array object if rows are returned \n
+ * object if a row is returned \n
* return\n
**/
function _query($query) {
if(!$this->isConnected()) return;
-
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$this->actStart($query);
-
- // 쿼리 문 실행
+ // Run the query statement
$result = @mysql_query($query, $this->fd);
-
- // 오류 체크
+ // Error Check
if(mysql_error($this->fd)) $this->setError(mysql_errno($this->fd), mysql_error($this->fd));
-
- // 쿼리 실행 종료를 알림
+ // Notify to complete a query execution
$this->actFinish();
-
- // 결과 리턴
+ // Return result
return $result;
}
/**
- * @brief schema xml을 이용하여 create table query생성
+ * @brief generate a query statement to create a table by using schema xml
*
* type : number, varchar, text, char, date, \n
* opt : notnull, default, size\n
@@ -103,8 +98,7 @@
// xml parsing
$oXml = new XmlParser();
$xml_obj = $oXml->parse($xml_doc);
-
- // 테이블 생성 schema 작성
+ // Create a table schema
$table_name = $xml_obj->table->attrs->name;
if($this->isTableExists($table_name)) return;
$table_name = $this->prefix.$table_name;
diff --git a/classes/db/DBMysqli.class.php b/classes/db/DBMysqli.class.php
index 354571fd8..ff37d9871 100644
--- a/classes/db/DBMysqli.class.php
+++ b/classes/db/DBMysqli.class.php
@@ -3,7 +3,7 @@
/**
* @class DBMysqli
* @author NHN (developers@xpressengine.com)
- * @brief MySQL DBMS를 mysqli_* 로 이용하기 위한 class
+ * @brief Class to use MySQL DBMS as mysqli_*
* @version 0.1
*
* mysql handling class
@@ -21,7 +21,7 @@
}
/**
- * @brief 설치 가능 여부를 return
+ * @brief Return if it is installable
**/
function isSupported() {
if(!function_exists('mysqli_connect')) return false;
@@ -37,13 +37,12 @@
}
/**
- * @brief DB 접속
+ * @brief DB Connection
**/
function _connect() {
- // db 정보가 없으면 무시
+ // Ignore if no DB information exists
if(!$this->hostname || !$this->userid || !$this->password || !$this->database) return;
-
- // 접속시도
+ // Attempt to connect
if($this->port){
$this->fd = @mysqli_connect($this->hostname, $this->userid, $this->password, $this->database, $this->port);
}else{
@@ -55,14 +54,13 @@
return;
}
mysqli_set_charset($this->fd,'utf8');
-
- // 접속체크
+ // Check connections
$this->is_connected = true;
$this->password = md5($this->password);
}
/**
- * @brief DB접속 해제
+ * @brief DB disconnection
**/
function close() {
if(!$this->isConnected()) return;
@@ -70,7 +68,7 @@
}
/**
- * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
+ * @brief Add quotes on the string variables in a query
**/
function addQuotes($string) {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
@@ -79,32 +77,29 @@
}
/**
- * @brief : 쿼리문의 실행 및 결과의 fetch 처리
+ * @brief : Run a query and fetch the result
*
- * query : query문 실행하고 result return\n
- * fetch : reutrn 된 값이 없으면 NULL\n
- * rows이면 array object\n
- * row이면 object\n
+ * query: run a query and return the result \n
+ * fetch: NULL if no value is returned \n
+ * array object if rows are returned \n
+ * object if a row is returned \n
* return\n
**/
function _query($query) {
if(!$this->isConnected()) return;
-
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$this->actStart($query);
-
- // 쿼리 문 실행
+ // Run the query statement
$result = mysqli_query($this->fd,$query);
- // 오류 체크
+ // Error Check
$error = mysqli_error($this->fd);
if($error){
$this->setError(mysqli_errno($this->fd), $error);
}
- // 쿼리 실행 종료를 알림
+ // Notify to complete a query execution
$this->actFinish();
-
- // 결과 리턴
+ // Return result
return $result;
}
diff --git a/classes/db/DBPostgresql.class.php b/classes/db/DBPostgresql.class.php
index 308b495b4..a9fa38653 100644
--- a/classes/db/DBPostgresql.class.php
+++ b/classes/db/DBPostgresql.class.php
@@ -2,34 +2,34 @@
/**
* @class DBPostgreSQL
* @author ioseph (ioseph@postgresql.kr) updated by yoonjong.joh@gmail.com
- * @brief MySQL DBMS를 이용하기 위한 class
+ * @brief Class to use PostgreSQL DBMS
* @version 0.2
*
* postgresql handling class
- * 2009.02.10 update 와 delete query를 실행할때 table 이름에 alias 사용하는 것을 없앰. 지원 안함
- * order by clause를 실행할때 함수를 실행 하는 부분을 column alias로 대체.
- * 2009.02.11 dropColumn() function이 추가
- * 2009.02.13 addColumn() 함수 변경
+ * 2009.02.10 update and delete query for the table name at runtime, eliminating the alias to use. Not Supported
+ * when running order by clause column alias to run a function to replace parts.
+ * 2009.02.11 dropColumn() function added
+ * 2009.02.13 addColumn() function changes
**/
class DBPostgresql extends DB
{
/**
- * @brief PostgreSQL DB에 접속하기 위한 정보
+ * @brief Connection information for PostgreSQL DB
**/
var $hostname = '127.0.0.1'; ///< hostname
var $userid = null; ///< user id
var $password = null; ///< password
var $database = null; ///< database
- var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE설치 가능)
+ var $prefix = 'xe'; // / 'bigint',
@@ -60,7 +60,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 설치 가능 여부를 return
+ * @brief Return if it is installable
**/
function isSupported()
{
@@ -70,7 +70,7 @@ class DBPostgresql extends DB
}
/**
- * @brief DB정보 설정 및 connect/ close
+ * @brief DB settings and connect/close
**/
function _setDBInfo()
{
@@ -86,40 +86,36 @@ class DBPostgresql extends DB
}
/**
- * @brief DB 접속
+ * @brief DB Connection
**/
function _connect()
{
- // pg용 connection string
+ // the connection string for PG
$conn_string = "";
-
- // db 정보가 없으면 무시
+ // Ignore if no DB information exists
if (!$this->hostname || !$this->userid || !$this->database)
return;
-
- // connection string 만들기
+ // Create connection string
$conn_string .= ($this->hostname) ? " host=$this->hostname" : "";
$conn_string .= ($this->userid) ? " user=$this->userid" : "";
$conn_string .= ($this->password) ? " password=$this->password" : "";
$conn_string .= ($this->database) ? " dbname=$this->database" : "";
$conn_string .= ($this->port) ? " port=$this->port" : "";
-
- // 접속시도
+ // Attempt to connect
$this->fd = @pg_connect($conn_string);
if (!$this->fd || pg_connection_status($this->fd) != PGSQL_CONNECTION_OK) {
$this->setError(-1, "CONNECTION FAILURE");
return;
}
-
- // 접속체크
+ // Check connections
$this->is_connected = true;
$this->password = md5($this->password);
- // utf8임을 지정
+ // Set utf8
//$this ->_query('set client_encoding to uhc');
}
/**
- * @brief DB접속 해제
+ * @brief DB disconnection
**/
function close()
{
@@ -129,7 +125,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
+ * @brief Add quotes on the string variables in a query
**/
function addQuotes($string)
{
@@ -141,7 +137,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 트랜잭션 시작
+ * @brief Begin transaction
**/
function begin()
{
@@ -152,7 +148,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 롤백
+ * @brief Rollback
**/
function rollback()
{
@@ -163,7 +159,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 커밋
+ * @brief Commits
**/
function commit()
{
@@ -174,12 +170,12 @@ class DBPostgresql extends DB
}
/**
- * @brief : 쿼리문의 실행 및 결과의 fetch 처리
+ * @brief : Run a query and fetch the result
*
- * query : query문 실행하고 result return\n
- * fetch : reutrn 된 값이 없으면 NULL\n
- * rows이면 array object\n
- * row이면 object\n
+ * query: run a query and return the result \n
+ * fetch: NULL if no value is returned \n
+ * array object if rows are returned \n
+ * object if a row is returned \n
* return\n
**/
function _query($query)
@@ -208,16 +204,12 @@ class DBPostgresql extends DB
}
}
*/
-
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$this->actStart($query);
$arr = array('Hello', 'World!', 'Beautiful', 'Day!');
-
-
- // 쿼리 문 실행
+ // Run the query statement
$result = @pg_query($this->fd, $query);
-
- // 오류 체크
+ // Error Check
if (!$result) {
// var_dump($l_query_array);
//var_dump($query);
@@ -225,16 +217,14 @@ class DBPostgresql extends DB
//var_dump(debug_backtrace());
$this->setError(1, pg_last_error($this->fd));
}
-
- // 쿼리 실행 종료를 알림
+ // Notify to complete a query execution
$this->actFinish();
-
- // 결과 리턴
+ // Return result
return $result;
}
/**
- * @brief 결과를 fetch
+ * @brief Fetch results
**/
function _fetch($result)
{
@@ -249,7 +239,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 1씩 증가되는 sequence값을 return (postgresql의 auto_increment는 sequence테이블에서만 사용)
+ * @brief Return sequence value incremented by 1(in postgresql, auto_increment is used in the sequence table only)
**/
function getNextSequence()
{
@@ -260,7 +250,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 테이블 기생성 여부 return
+ * @brief Return if a table already exists
**/
function isTableExists($target_name)
{
@@ -277,7 +267,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 특정 테이블에 특정 column 추가
+ * @brief Add a column to a table
**/
function addColumn($table_name, $column_name, $type = 'number', $size = '', $default =
NULL, $notnull = false)
@@ -309,7 +299,7 @@ class DBPostgresql extends DB
/**
- * @brief 특정 테이블의 column의 정보를 return
+ * @brief Return column information of a table
**/
function isColumnExists($table_name, $column_name)
{
@@ -329,7 +319,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 특정 테이블에 특정 인덱스 추가
+ * @brief Add an index to a table
* $target_columns = array(col1, col2)
* $is_unique? unique : none
**/
@@ -340,8 +330,7 @@ class DBPostgresql extends DB
if (strpos($table_name, $this->prefix) === false)
$table_name = $this->prefix . $table_name;
-
- // index_name의 경우 앞에 table이름을 붙여줘서 중복을 피함
+ // Use a tablename before an index name to avoid defining the same index
$index_name = $table_name . $index_name;
$query = sprintf("create %s index %s on %s (%s);", $is_unique ? 'unique' : '', $index_name,
@@ -350,7 +339,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 특정 테이블에 특정 column 제거
+ * @brief Delete a column from a table
**/
function dropColumn($table_name, $column_name)
{
@@ -359,14 +348,13 @@ class DBPostgresql extends DB
}
/**
- * @brief 특정 테이블의 특정 인덱스 삭제
+ * @brief Drop an index from a table
**/
function dropIndex($table_name, $index_name, $is_unique = false)
{
if (strpos($table_name, $this->prefix) === false)
$table_name = $this->prefix . $table_name;
-
- // index_name의 경우 앞에 table이름을 붙여줘서 중복을 피함
+ // Use a tablename before an index name to avoid defining the same index
$index_name = $table_name . $index_name;
$query = sprintf("drop index %s", $index_name);
@@ -375,14 +363,13 @@ class DBPostgresql extends DB
/**
- * @brief 특정 테이블의 index 정보를 return
+ * @brief Return index information of a table
**/
function isIndexExists($table_name, $index_name)
{
if (strpos($table_name, $this->prefix) === false)
$table_name = $this->prefix . $table_name;
-
- // index_name의 경우 앞에 table이름을 붙여줘서 중복을 피함
+ // Use a tablename before an index name to avoid defining the same index
$index_name = $table_name . $index_name;
//$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name);
@@ -402,7 +389,7 @@ class DBPostgresql extends DB
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief Create a table by using xml file
**/
function createTableByXml($xml_doc)
{
@@ -410,19 +397,19 @@ class DBPostgresql extends DB
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief Create a table by using xml file
**/
function createTableByXmlFile($file_name)
{
if (!file_exists($file_name))
return;
- // xml 파일을 읽음
+ // read xml file
$buff = FileHandler::readFile($file_name);
return $this->_createTable($buff);
}
/**
- * @brief schema xml을 이용하여 create table query생성
+ * @brief generate a query statement to create a table by using schema xml
*
* type : number, varchar, text, char, date, \n
* opt : notnull, default, size\n
@@ -433,8 +420,7 @@ class DBPostgresql extends DB
// xml parsing
$oXml = new XmlParser();
$xml_obj = $oXml->parse($xml_doc);
-
- // 테이블 생성 schema 작성
+ // Create a table schema
$table_name = $xml_obj->table->attrs->name;
if ($table_name == 'sequence') {
@@ -508,7 +494,7 @@ class DBPostgresql extends DB
}
/**
- * @brief 조건문 작성하여 return
+ * @brief Return conditional clause
**/
function getCondition($output)
{
@@ -564,16 +550,15 @@ class DBPostgresql extends DB
/**
- * @brief insertAct 처리
+ * @brief Handle the insertAct
**/
function _executeInsertAct($output)
{
- // 테이블 정리
+ // List tables
foreach ($output->tables as $key => $val) {
$table_list[] = $this->prefix . $val;
}
-
- // 컬럼 정리
+ // List columns
foreach ($output->columns as $key => $val) {
$name = $val['name'];
$value = $val['value'];
@@ -594,17 +579,16 @@ class DBPostgresql extends DB
}
/**
- * @brief updateAct 처리
+ * @brief Handle updateAct
**/
function _executeUpdateAct($output)
{
- // 테이블 정리
+ // List tables
foreach ($output->tables as $key => $val) {
//$table_list[] = $this->prefix.$val.' as '.$key;
$table_list[] = $this->prefix . $val;
}
-
- // 컬럼 정리
+ // List columns
foreach ($output->columns as $key => $val) {
if (!isset($val['value']))
continue;
@@ -621,8 +605,7 @@ class DBPostgresql extends DB
$column_list[] = sprintf("%s = %s", $name, $value);
}
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("update %s set %s %s", implode(',', $table_list), implode(',',
@@ -632,16 +615,15 @@ class DBPostgresql extends DB
}
/**
- * @brief deleteAct 처리
+ * @brief Handle deleteAct
**/
function _executeDeleteAct($output)
{
- // 테이블 정리
+ // List tables
foreach ($output->tables as $key => $val) {
$table_list[] = $this->prefix . $val;
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("delete from %s %s", implode(',', $table_list), $condition);
@@ -650,14 +632,14 @@ class DBPostgresql extends DB
}
/**
- * @brief selectAct 처리
+ * @brief Handle selectAct
*
- * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n
- * navigation이라는 method를 제공
+ * In order to get a list of pages easily when selecting \n
+ * it supports a method as navigation
**/
function _executeSelectAct($output)
{
- // 테이블 정리
+ // List tables
$table_list = array();
foreach ($output->tables as $key => $val) {
$table_list[] = $this->prefix . $val . ' as ' . $key;
@@ -709,8 +691,7 @@ class DBPostgresql extends DB
if ($output->list_count && $output->page)
return $this->_getNavigationData($table_list, $columns, $left_join, $condition,
$output);
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
if ($output->order) {
$conditions = $this->getConditionList($output);
if (!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -794,9 +775,9 @@ class DBPostgresql extends DB
}
/**
- * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다
+ * @brief Paging is handled if navigation information exists in the query xml
*
- * 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
+ * It is quite convenient although its structure is not good at all .. -_-;
**/
function _getNavigationData($table_list, $columns, $left_join, $condition, $output)
{
@@ -804,8 +785,8 @@ class DBPostgresql extends DB
$column_list = $output->column_list;
/*
- // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정
- // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다.
+ // Modified to find total number of SELECT queries having group by clause
+ // If it works correctly, uncomment the following codes
//
$count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition;
$total_count = $this->getCountCache($output->tables, $count_condition);
@@ -820,7 +801,7 @@ class DBPostgresql extends DB
}
*/
- // 전체 개수를 구함
+ // Get a total count
$count_query = sprintf("select count(*) as count from %s %s %s", implode(',', $table_list), implode(' ', $left_join), $condition);
$count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id . ' count(*)'):'';
$result = $this->_query($count_query);
@@ -835,15 +816,14 @@ class DBPostgresql extends DB
if (!$page)
$page = 1;
- // 전체 페이지를 구함
+ // Get a total page
if ($total_count) $total_page = (int)(($total_count - 1) / $list_count) + 1;
else $total_page = 1;
- // 페이지 변수를 체크
+ // Check Page variables
if ($page > $total_page) $page = $total_page;
$start_count = ($page - 1) * $list_count;
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
if ($output->order) {
$conditions = $this->getConditionList($output);
if (!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
diff --git a/classes/db/DBSqlite2.class.php b/classes/db/DBSqlite2.class.php
index 5d4c447b7..ad4a83c37 100644
--- a/classes/db/DBSqlite2.class.php
+++ b/classes/db/DBSqlite2.class.php
@@ -2,7 +2,7 @@
/**
* @class DBSqlite2
* @author NHN (developers@xpressengine.com)
- * @brief SQLite ver 2.x 를 이용하기 위한 class
+ * @brief Class for using SQLite ver 2.x
* @version 0.1
*
* sqlite handling class (sqlite ver 2.x)
@@ -11,17 +11,17 @@
class DBSqlite2 extends DB {
/**
- * DB를 이용하기 위한 정보
+ * DB information
**/
var $database = NULL; ///< database
- var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE설치 가능)
+ var $prefix = 'xe'; // / 'INTEGER',
@@ -51,7 +51,7 @@
}
/**
- * @brief 설치 가능 여부를 return
+ * @brief Return if it is installable
**/
function isSupported() {
if(!function_exists('sqlite_open')) return false;
@@ -59,7 +59,7 @@
}
/**
- * @brief DB정보 설정 및 connect/ close
+ * @brief DB settings and connect/close
**/
function _setDBInfo() {
$db_info = Context::getDBInfo();
@@ -69,27 +69,25 @@
}
/**
- * @brief DB 접속
+ * @brief DB Connection
**/
function _connect() {
- // db 정보가 없으면 무시
+ // Ignore if no DB information exists
if(!$this->database) return;
-
- // 데이터 베이스 파일 접속 시도
+ // Attempt to access the database file
$this->fd = sqlite_open($this->database, 0666, $error);
if(!file_exists($this->database) || $error) {
$this->setError(-1,$error);
$this->is_connected = false;
return;
}
-
- // 접속체크
+ // Check connections
$this->is_connected = true;
$this->password = md5($this->password);
}
/**
- * @brief DB접속 해제
+ * @brief DB disconnection
**/
function close() {
if(!$this->isConnected()) return;
@@ -97,7 +95,7 @@
}
/**
- * @brief 트랜잭션 시작
+ * @brief Begin transaction
**/
function begin() {
if(!$this->is_connected || $this->transaction_started) return;
@@ -105,7 +103,7 @@
}
/**
- * @brief 롤백
+ * @brief Rollback
**/
function rollback() {
if(!$this->is_connected || !$this->transaction_started) return;
@@ -114,7 +112,7 @@
}
/**
- * @brief 커밋
+ * @brief Commits
**/
function commit($force = false) {
if(!$force && (!$this->isConnected() || !$this->transaction_started)) return;
@@ -124,7 +122,7 @@
}
/**
- * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
+ * @brief Add quotes on the string variables in a query
**/
function addQuotes($string) {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
@@ -133,34 +131,30 @@
}
/**
- * @brief : 쿼리문의 실행 및 결과의 fetch 처리
+ * @brief : Run a query and fetch the result
*
- * query : query문 실행하고 result return\n
- * fetch : reutrn 된 값이 없으면 NULL\n
- * rows이면 array object\n
- * row이면 object\n
+ * query: run a query and return the result \n
+ * fetch: NULL if no value is returned \n
+ * array object if rows are returned \n
+ * object if a row is returned \n
* return\n
**/
function _query($query) {
if(!$this->isConnected()) return;
-
- // 쿼리 시작을 알림
+ // Notify to start a query execution
$this->actStart($query);
-
- // 쿼리 문 실행
+ // Run the query statement
$result = @sqlite_query($query, $this->fd);
-
- // 오류 체크
+ // Error Check
if(sqlite_last_error($this->fd)) $this->setError(sqlite_last_error($this->fd), sqlite_error_string(sqlite_last_error($this->fd)));
-
- // 쿼리 실행 알림
+ // Notify to complete a query execution
$this->actFinish();
return $result;
}
/**
- * @brief 결과를 fetch
+ * @brief Fetch results
**/
function _fetch($result) {
if($this->isError() || !$result) return;
@@ -180,7 +174,7 @@
}
/**
- * @brief 1씩 증가되는 sequence값을 return
+ * @brief Return the sequence value is incremented by 1
**/
function getNextSequence() {
$query = sprintf("insert into %ssequence (seq) values ('')", $this->prefix);
@@ -195,7 +189,7 @@
}
/**
- * @brief 테이블 기생성 여부 return
+ * @brief Return if a table already exists
**/
function isTableExists($target_name) {
$query = sprintf('pragma table_info(%s%s)', $this->prefix, $this->addQuotes($target_name));
@@ -205,7 +199,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 추가
+ * @brief Add a column to a table
**/
function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) {
$type = $this->column_type[$type];
@@ -221,7 +215,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 제거
+ * @brief Delete a column from a table
**/
function dropColumn($table_name, $column_name) {
$query = sprintf("alter table %s%s drop column %s ", $this->prefix, $table_name, $column_name);
@@ -229,7 +223,7 @@
}
/**
- * @brief 특정 테이블의 column의 정보를 return
+ * @brief Return column information of a table
**/
function isColumnExists($table_name, $column_name) {
$query = sprintf("pragma table_info(%s%s)", $this->prefix, $table_name);
@@ -246,7 +240,7 @@
}
/**
- * @brief 특정 테이블에 특정 인덱스 추가
+ * @brief Add an index to a table
* $target_columns = array(col1, col2)
* $is_unique? unique : none
**/
@@ -261,7 +255,7 @@
}
/**
- * @brief 특정 테이블의 특정 인덱스 삭제
+ * @brief Drop an index from a table
**/
function dropIndex($table_name, $index_name, $is_unique = false) {
$key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name);
@@ -270,7 +264,7 @@
}
/**
- * @brief 특정 테이블의 index 정보를 return
+ * @brief Return index information of a table
**/
function isIndexExists($table_name, $index_name) {
$key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name);
@@ -282,24 +276,24 @@
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief Create a table by using xml file
**/
function createTableByXml($xml_doc) {
return $this->_createTable($xml_doc);
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief Create a table by using xml file
**/
function createTableByXmlFile($file_name) {
if(!file_exists($file_name)) return;
- // xml 파일을 읽음
+ // read xml file
$buff = FileHandler::readFile($file_name);
return $this->_createTable($buff);
}
/**
- * @brief schema xml을 이용하여 create table query생성
+ * @brief generate a query statement to create a table by using schema xml
*
* type : number, varchar, text, char, date, \n
* opt : notnull, default, size\n
@@ -309,8 +303,7 @@
// xml parsing
$oXml = new XmlParser();
$xml_obj = $oXml->parse($xml_doc);
-
- // 테이블 생성 schema 작성
+ // Create a table schema
$table_name = $xml_obj->table->attrs->name;
if($this->isTableExists($table_name)) return;
$table_name = $this->prefix.$table_name;
@@ -371,7 +364,7 @@
}
/**
- * @brief 조건문 작성하여 return
+ * @brief Return conditional clause
**/
function getCondition($output) {
if(!$output->conditions) return;
@@ -415,15 +408,14 @@
}
/**
- * @brief insertAct 처리
+ * @brief Handle the insertAct
**/
function _executeInsertAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = $this->prefix.$val;
}
-
- // 컬럼 정리
+ // List columns
foreach($output->columns as $key => $val) {
$name = $val['name'];
$value = $val['value'];
@@ -441,18 +433,16 @@
}
/**
- * @brief updateAct 처리
+ * @brief Handle updateAct
**/
function _executeUpdateAct($output) {
$table_count = count(array_values($output->tables));
-
- // 대상 테이블이 1개일 경우
+ // If one day the destination table
if($table_count == 1) {
- // 테이블 정리
+ // List tables
list($target_table) = array_values($output->tables);
$target_table = $this->prefix.$target_table;
-
- // 컬럼 정리
+ // List columns
foreach($output->columns as $key => $val) {
if(!isset($val['value'])) continue;
$name = $val['name'];
@@ -465,27 +455,23 @@
$column_list[] = sprintf("%s = %s", $name, $value);
}
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("update %s set %s %s", $target_table, implode(',',$column_list), $condition);
-
- // 대상 테이블이 2개일 경우 (sqlite에서 update 테이블을 1개 이상 지정 못해서 이렇게 꽁수로... 다른 방법이 있으려나..)
+ // trick to handle if targt table to update is more than one (sqlite doesn't support update to multi-tables)
} elseif($table_count == 2) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[$val] = $this->prefix.$key;
}
list($source_table, $target_table) = array_values($table_list);
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
foreach($table_list as $key => $val) {
$condition = eregi_replace($key.'\\.', $val.'.', $condition);
}
-
- // 컬럼 정리
+ // List columns
foreach($output->columns as $key => $val) {
if(!isset($val['value'])) continue;
$name = $val['name'];
@@ -507,15 +493,14 @@
}
/**
- * @brief deleteAct 처리
+ * @brief Handle deleteAct
**/
function _executeDeleteAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = $this->prefix.$val;
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("delete from %s %s", implode(',',$table_list), $condition);
@@ -524,13 +509,13 @@
}
/**
- * @brief selectAct 처리
+ * @brief Handle selectAct
*
- * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n
- * navigation이라는 method를 제공
+ * In order to get a list of pages easily when selecting \n
+ * it supports a method as navigation
**/
function _executeSelectAct($output) {
- // 테이블 정리
+ // List tables
$table_list = array();
foreach($output->tables as $key => $val) {
$table_list[] = $this->prefix.$val.' as '.$key;
@@ -573,8 +558,7 @@
$output->column_list = $column_list;
if($output->list_count && $output->page) return $this->_getNavigationData($table_list, $columns, $left_join, $condition, $output);
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -597,8 +581,7 @@
}
if(count($index_list)) $query .= ' order by '.implode(',',$index_list);
}
-
- // list_count를 사용할 경우 적용
+ // Apply when using list_count
if($output->list_count['value']) $query = sprintf('%s limit %d', $query, $output->list_count['value']);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
@@ -620,17 +603,17 @@
}
/**
- * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다
+ * @brief Paging is handled if navigation information exists in the query xml
*
- * 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
+ * It is quite convenient although its structure is not good at all .. -_-;
**/
function _getNavigationData($table_list, $columns, $left_join, $condition, $output) {
require_once(_XE_PATH_.'classes/page/PageHandler.class.php');
$column_list = $output->column_list;
/*
- // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정
- // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다.
+ // Modified to find total number of SELECT queries having group by clause
+ // If it works correctly, uncomment the following codes
//
$count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition;
$total_count = $this->getCountCache($output->tables, $count_condition);
@@ -644,8 +627,7 @@
$this->putCountCache($output->tables, $count_condition, $total_count);
}
*/
-
- // 전체 개수를 구함
+ // Get a total count
$count_query = sprintf("select count(*) as count from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition);
$count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id . ' count(*)'):'';
$result = $this->_query($count_query);
@@ -658,16 +640,13 @@
if(!$page_count) $page_count = 10;
$page = $output->page['value'];
if(!$page) $page = 1;
-
- // 전체 페이지를 구함
+ // Get a total page
if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1;
else $total_page = 1;
-
- // 페이지 변수를 체크
+ // Check Page variables
if($page > $total_page) $page = $total_page;
$start_count = ($page-1)*$list_count;
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
diff --git a/classes/db/DBSqlite3_pdo.class.php b/classes/db/DBSqlite3_pdo.class.php
index e1ed6168a..e734bc53e 100644
--- a/classes/db/DBSqlite3_pdo.class.php
+++ b/classes/db/DBSqlite3_pdo.class.php
@@ -2,21 +2,21 @@
/**
* @class DBSqlite3_pdo
* @author NHN (developers@xpressengine.com)
- * @brief SQLite3를 PDO로 이용하여 class
+ * @brief class to use SQLite3 with PDO
* @version 0.1
**/
class DBSqlite3_pdo extends DB {
/**
- * DB를 이용하기 위한 정보
+ * DB information
**/
var $database = NULL; ///< database
- var $prefix = 'xe'; ///< XE에서 사용할 테이블들의 prefix (한 DB에서 여러개의 XE 설치 가능)
+ var $prefix = 'xe'; // /< prefix of a tablename (many XEs can be installed in a single DB)
var $comment_syntax = '/* %s */';
/**
- * PDO 사용시 필요한 변수들
+ * Variables for using PDO
**/
var $handler = NULL;
var $stmt = NULL;
@@ -24,10 +24,10 @@
var $bind_vars = array();
/**
- * @brief sqlite3 에서 사용될 column type
+ * @brief column type used in sqlite3
*
- * column_type은 schema/query xml에서 공통 선언된 type을 이용하기 때문에
- * 각 DBMS에 맞게 replace 해주어야 한다
+ * column_type should be replaced for each DBMS properly
+ * because column_type uses a commonly defined type in schema/query xml files
**/
var $column_type = array(
'bignumber' => 'INTEGER',
@@ -57,14 +57,14 @@
}
/**
- * @brief 설치 가능 여부를 return
+ * @brief Return if installable
**/
function isSupported() {
return class_exists('PDO');
}
/**
- * @brief DB정보 설정 및 connect/ close
+ * @brief DB settings and connect/close
**/
function _setDBInfo() {
$db_info = Context::getDBInfo();
@@ -74,13 +74,13 @@
}
/**
- * @brief DB 접속
+ * @brief DB Connection
**/
function _connect() {
- // db 정보가 없으면 무시
+ // override if db information not exists
if(!$this->database) return;
- // 데이터 베이스 파일 접속 시도
+ // Attempt to access the database file
try {
// PDO is only supported with PHP5,
// so it is allowed to use try~catch statment in this class.
@@ -91,13 +91,13 @@
return;
}
- // 접속체크
+ // Check connections
$this->is_connected = true;
$this->password = md5($this->password);
}
/**
- * @brief DB접속 해제
+ * @brief disconnect to DB
**/
function close() {
if(!$this->is_connected) return;
@@ -105,7 +105,7 @@
}
/**
- * @brief 트랜잭션 시작
+ * @brief Begin a transaction
**/
function begin() {
if(!$this->is_connected || $this->transaction_started) return;
@@ -113,7 +113,7 @@
}
/**
- * @brief 롤백
+ * @brief Rollback
**/
function rollback() {
if(!$this->is_connected || !$this->transaction_started) return;
@@ -122,7 +122,7 @@
}
/**
- * @brief 커밋
+ * @brief Commit
**/
function commit($force = false) {
if(!$force && (!$this->is_connected || !$this->transaction_started)) return;
@@ -131,7 +131,7 @@
}
/**
- * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절
+ * @brief Add or change quotes to the query string variables
**/
function addQuotes($string) {
if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string));
@@ -140,12 +140,12 @@
}
/**
- * @brief : 쿼리문의 prepare
+ * @brief : Prepare a query statement
**/
function _prepare($query) {
if(!$this->is_connected) return;
- // 쿼리 시작을 알림
+ // notify to start a query execution
$this->actStart($query);
$this->stmt = $this->handler->prepare($query);
@@ -159,7 +159,7 @@
}
/**
- * @brief : stmt에 binding params
+ * @brief : Binding params in stmt
**/
function _bind($val) {
if(!$this->is_connected || !$this->stmt) return;
@@ -170,7 +170,7 @@
}
/**
- * @brief : prepare된 쿼리의 execute
+ * @brief : execute the prepared statement
**/
function _execute() {
if(!$this->is_connected || !$this->stmt) return;
@@ -200,7 +200,7 @@
}
/**
- * @brief 1씩 증가되는 sequence값을 return
+ * @brief Return the sequence value incremented by 1
**/
function getNextSequence() {
$query = sprintf("insert into %ssequence (seq) values (NULL)", $this->prefix);
@@ -217,7 +217,7 @@
}
/**
- * @brief 테이블 기생성 여부 return
+ * @brief return if the table already exists
**/
function isTableExists($target_name) {
$query = sprintf('pragma table_info(%s%s)', $this->prefix, $target_name);
@@ -227,7 +227,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 추가
+ * @brief Add a column to a table
**/
function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) {
$type = $this->column_type[$type];
@@ -244,7 +244,7 @@
}
/**
- * @brief 특정 테이블에 특정 column 제거
+ * @brief Remove a column from a table
**/
function dropColumn($table_name, $column_name) {
$query = sprintf("alter table %s%s drop column %s ", $this->prefix, $table_name, $column_name);
@@ -252,7 +252,7 @@
}
/**
- * @brief 특정 테이블의 column의 정보를 return
+ * @brief Return column information of a table
**/
function isColumnExists($table_name, $column_name) {
$query = sprintf("pragma table_info(%s%s)", $this->prefix, $table_name);
@@ -270,7 +270,7 @@
}
/**
- * @brief 특정 테이블에 특정 인덱스 추가
+ * @brief Add an index to a table
* $target_columns = array(col1, col2)
* $is_unique? unique : none
**/
@@ -285,7 +285,7 @@
}
/**
- * @brief 특정 테이블의 특정 인덱스 삭제
+ * @brief Drop an index from a table
**/
function dropIndex($table_name, $index_name, $is_unique = false) {
$key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name);
@@ -294,7 +294,7 @@
}
/**
- * @brief 특정 테이블의 index 정보를 return
+ * @brief Return index information of a table
**/
function isIndexExists($table_name, $index_name) {
$key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name);
@@ -307,24 +307,24 @@
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief create a table from xml file
**/
function createTableByXml($xml_doc) {
return $this->_createTable($xml_doc);
}
/**
- * @brief xml 을 받아서 테이블을 생성
+ * @brief create a table from xml file
**/
function createTableByXmlFile($file_name) {
if(!file_exists($file_name)) return;
- // xml 파일을 읽음
+ // read xml file
$buff = FileHandler::readFile($file_name);
return $this->_createTable($buff);
}
/**
- * @brief schema xml을 이용하여 create table query생성
+ * @brief generate a query to create a table using the schema xml
*
* type : number, varchar, text, char, date, \n
* opt : notnull, default, size\n
@@ -334,8 +334,7 @@
// xml parsing
$oXml = new XmlParser();
$xml_obj = $oXml->parse($xml_doc);
-
- // 테이블 생성 schema 작성
+ // Create a table schema
$table_name = $xml_obj->table->attrs->name;
if($this->isTableExists($table_name)) return;
$table_name = $this->prefix.$table_name;
@@ -401,7 +400,7 @@
}
/**
- * @brief 조건문 작성하여 return
+ * @brief Return conditional clause(where)
**/
function getCondition($output) {
if(!$output->conditions) return;
@@ -445,15 +444,14 @@
}
/**
- * @brief insertAct 처리
+ * @brief insertAct
**/
function _executeInsertAct($output) {
- // 테이블 정리
+ // list tables
foreach($output->tables as $key => $val) {
$table_list[] = $this->prefix.$val;
}
-
- // 컬럼 정리
+ // list columns
foreach($output->columns as $key => $val) {
$name = $val['name'];
$value = $val['value'];
@@ -480,18 +478,16 @@
}
/**
- * @brief updateAct 처리
+ * @brief updateAct
**/
function _executeUpdateAct($output) {
$table_count = count(array_values($output->tables));
-
- // 대상 테이블이 1개일 경우
+ // If a target table is one
if($table_count == 1) {
- // 테이블 정리
+ // list tables
list($target_table) = array_values($output->tables);
$target_table = $this->prefix.$target_table;
-
- // 컬럼 정리
+ // list columns
foreach($output->columns as $key => $val) {
if(!isset($val['value'])) continue;
$name = $val['name'];
@@ -504,27 +500,23 @@
$column_list[] = sprintf("%s = %s", $name, $value);
}
}
-
- // 조건절 정리
+ // List where cluase
$condition = $this->getCondition($output);
$query = sprintf("update %s set %s %s", $target_table, implode(',',$column_list), $condition);
-
- // 대상 테이블이 2개일 경우 (sqlite에서 update 테이블을 1개 이상 지정 못해서 이렇게 꽁수로... 다른 방법이 있으려나..)
+ // If tables to update are morea than two (In sqlite, it is possible to update a single table only. Let me know if you know a better way)
} elseif($table_count == 2) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[$val] = $this->prefix.$key;
}
list($source_table, $target_table) = array_values($table_list);
-
- // 조건절 정리
+ // List where cluase
$condition = $this->getCondition($output);
foreach($table_list as $key => $val) {
$condition = eregi_replace($key.'\\.', $val.'.', $condition);
}
-
- // 컬럼 정리
+ // List columns
foreach($output->columns as $key => $val) {
if(!isset($val['value'])) continue;
$name = $val['name'];
@@ -547,15 +539,14 @@
}
/**
- * @brief deleteAct 처리
+ * @brief deleteAct
**/
function _executeDeleteAct($output) {
- // 테이블 정리
+ // List tables
foreach($output->tables as $key => $val) {
$table_list[] = $this->prefix.$val;
}
-
- // 조건절 정리
+ // List the conditional clause
$condition = $this->getCondition($output);
$query = sprintf("delete from %s %s", implode(',',$table_list), $condition);
@@ -565,13 +556,13 @@
}
/**
- * @brief selectAct 처리
+ * @brief selectAct
*
- * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n
- * navigation이라는 method를 제공
+ * To fetch a list of the page conveniently when selecting, \n
+ * navigation method supported
**/
function _executeSelectAct($output) {
- // 테이블 정리
+ // List tables
$table_list = array();
foreach($output->tables as $key => $val) {
$table_list[] = $this->prefix.$val.' as '.$key;
@@ -616,8 +607,7 @@
$output->column_list = $column_list;
if($output->list_count && $output->page) return $this->_getNavigationData($table_list, $columns, $left_join, $condition, $output);
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // add the condition to the query to use an index for ordering by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -655,7 +645,7 @@
}
$query = sprintf("select %s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query);
- // list_count를 사용할 경우 적용
+ // apply when using list_count
if($output->list_count['value']) $query = sprintf('%s limit %d', $query, $output->list_count['value']);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
@@ -676,17 +666,17 @@
}
/**
- * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다
+ * @brief Paging is handled if navigation information exists in the query xml
*
- * 그닥 좋지는 않은 구조이지만 편리하다.. -_-;
+ * It is quite convenient although its structure is not good at all .. -_-;
**/
function _getNavigationData($table_list, $columns, $left_join, $condition, $output) {
require_once(_XE_PATH_.'classes/page/PageHandler.class.php');
$column_list = $output->column_list;
/*
- // group by 절이 포함된 SELECT 쿼리의 전체 갯수를 구하기 위한 수정
- // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다.
+ // Modified to find total number of SELECT queries having group by clause
+ // If it works correctly, uncomment the following codes
//
$count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition;
$total_count = $this->getCountCache($output->tables, $count_condition);
@@ -700,8 +690,7 @@
$this->putCountCache($output->tables, $count_condition, $total_count);
}
*/
-
- // 전체 개수를 구함
+ // Get a total count
$count_query = sprintf("select count(*) as count from %s %s %s", implode(',',$table_list),implode(' ',$left_join), $condition);
$count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id . ' count(*)'):'';
$this->_prepare($count_query);
@@ -714,16 +703,13 @@
if(!$page_count) $page_count = 10;
$page = $output->page['value'];
if(!$page) $page = 1;
-
- // 전체 페이지를 구함
+ // Get a total page
if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1;
else $total_page = 1;
-
- // 페이지 변수를 체크
+ // Check Page variables
if($page > $total_page) $page = $total_page;
$start_count = ($page-1)*$list_count;
-
- // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가
+ // Add a condition to use an index when sorting in order by list_order, update_order
if($output->order) {
$conditions = $this->getConditionList($output);
if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) {
@@ -760,7 +746,7 @@
$columns = join(',',$output->arg_columns);
}
- // return 결과물 생성
+ // Return the result
$buff = new Object();
$buff->total_count = 0;
$buff->total_page = 0;
@@ -768,7 +754,7 @@
$buff->data = array();
$buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count);
- // 쿼리 실행
+ // Query Execution
$query = sprintf("select %s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query);
$query = sprintf('%s limit %d, %d', $query, $start_count, $list_count);
$query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):'';
diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php
index 251605ac7..84d0a8c32 100644
--- a/classes/display/DisplayHandler.class.php
+++ b/classes/display/DisplayHandler.class.php
@@ -10,9 +10,9 @@
class DisplayHandler extends Handler {
- var $content_size = 0; ///< 출력하는 컨텐츠의 사이즈
+ var $content_size = 0; // /< The size of displaying contents
- var $gz_enabled = false; ///< gzip 압축하여 컨텐츠 호출할 것인지에 대한 flag변수
+ var $gz_enabled = false; // / gz_enabled = true;
-
- // request method에 따른 컨텐츠 결과물 추출
+ // Extract contents to display by the request method
if(Context::get('xeVirtualRequestMethod')=='xml') {
require_once("./classes/display/VirtualXMLDisplayHandler.php");
$handler = new VirtualXMLDisplayHandler();
@@ -51,33 +49,27 @@
}
$output = $handler->toDoc($oModule);
-
- // 출력하기 전에 trigger 호출 (before)
+ // call a trigger before display
ModuleHandler::triggerCall('display', 'before', $output);
-
- // 애드온 실행
+ // execute add-on
$called_position = 'before_display_content';
$oAddonController = &getController('addon');
$addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone()?"mobile":"pc");
@include($addon_file);
if(method_exists($handler, "prepareToPrint")) $handler->prepareToPrint($output);
-
- // header 출력
+ // header output
if($this->gz_enabled) header("Content-Encoding: gzip");
if(Context::getResponseMethod() == 'JSON') $this->_printJSONHeader();
else if(Context::getResponseMethod() != 'HTML') $this->_printXMLHeader();
else $this->_printHTMLHeader();
-
- // debugOutput 출력
+ // debugOutput output
$this->content_size = strlen($output);
$output .= $this->_debugOutput();
-
- // 결과물 직접 출력
+ // results directly output
if($this->gz_enabled) print ob_gzhandler($output, 5);
else print $output;
-
- // 출력 후 trigger 호출 (after)
+ // call a trigger after display
ModuleHandler::triggerCall('display', 'after', $content);
}
@@ -91,8 +83,7 @@
if(!__DEBUG__) return;
$end = getMicroTime();
-
- // Firebug 콘솔 출력
+ // Firebug console output
if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1) {
static $firephp;
if(!isset($firephp)) $firephp = FirePHP::getInstance(true);
@@ -101,8 +92,7 @@
$firephp->fb('Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php', 'The IP address is not allowed.');
return;
}
-
- // 전체 실행 시간 출력, Request/Response info 출력
+ // display total execution time and Request/Response info
if(__DEBUG__ & 2) {
$firephp->fb(
array('Request / Response info >>> '.$_SERVER['REQUEST_METHOD'].' / '.Context::getResponseMethod(),
@@ -135,8 +125,7 @@
'TABLE'
);
}
-
- // DB 쿼리 내역 출력
+ // display DB query history
if((__DEBUG__ & 4) && $GLOBALS['__db_queries__']) {
$queries_output = array(array('Query', 'Elapsed time', 'Result'));
foreach($GLOBALS['__db_queries__'] as $query) {
@@ -150,43 +139,34 @@
'TABLE'
);
}
-
-
- // 파일 및 HTML 주석으로 출력
+ // dislpay the file and HTML comments
} else {
-
- // 전체 실행 시간 출력, Request/Response info 출력
+ // display total execution time and Request/Response info
if(__DEBUG__ & 2) {
if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) {
return;
}
-
- // Request/Response 정보 작성
+ // Request/Response information
$buff .= "\n- Request/ Response info\n";
$buff .= sprintf("\tRequest URI \t\t\t: %s:%s%s%s%s\n", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']?'?':'', $_SERVER['QUERY_STRING']);
$buff .= sprintf("\tRequest method \t\t\t: %s\n", $_SERVER['REQUEST_METHOD']);
$buff .= sprintf("\tResponse method \t\t: %s\n", Context::getResponseMethod());
$buff .= sprintf("\tResponse contents size\t\t: %d byte\n", $this->content_size);
-
- // 전체 실행 시간
+ // total execution time
$buff .= sprintf("\n- Total elapsed time : %0.5f sec\n", $end-__StartTime__);
$buff .= sprintf("\tclass file load elapsed time \t: %0.5f sec\n", $GLOBALS['__elapsed_class_load__']);
$buff .= sprintf("\tTemplate compile elapsed time\t: %0.5f sec (%d called)\n", $GLOBALS['__template_elapsed__'], $GLOBALS['__TemplateHandlerCalled__']);
$buff .= sprintf("\tXmlParse compile elapsed time\t: %0.5f sec\n", $GLOBALS['__xmlparse_elapsed__']);
$buff .= sprintf("\tPHP elapsed time \t\t: %0.5f sec\n", $end-__StartTime__-$GLOBALS['__template_elapsed__']-$GLOBALS['__xmlparse_elapsed__']-$GLOBALS['__db_elapsed_time__']-$GLOBALS['__elapsed_class_load__']);
-
- // 위젯 실행 시간 작성
+ // widget execution time
$buff .= sprintf("\n\tWidgets elapsed time \t\t: %0.5f sec", $GLOBALS['__widget_excute_elapsed__']);
-
- // 레이아웃 실행 시간
+ // layout execution time
$buff .= sprintf("\n\tLayout compile elapsed time \t: %0.5f sec", $GLOBALS['__layout_compile_elapsed__']);
-
- // 위젯, 에디터 컴포넌트 치환 시간
+ // Widgets, the editor component replacement time
$buff .= sprintf("\n\tTrans Content \t\t\t: %0.5f sec\n", $GLOBALS['__trans_content_elapsed__']);
}
-
- // DB 로그 작성
+ // DB Logging
if(__DEBUG__ & 4) {
if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) {
return;
@@ -206,8 +186,7 @@
}
}
}
-
- // HTML 주석으로 출력
+ // Output in HTML comments
if($buff && __DEBUG_OUTPUT__ == 1 && Context::getResponseMethod() == 'HTML') {
$buff = sprintf("[%s %s:%d]\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, print_r($buff, true));
@@ -217,8 +196,7 @@
return "";
}
-
- // 파일에 출력
+ // Output to a file
if($buff && __DEBUG_OUTPUT__ == 0) {
$debug_file = _XE_PATH_.'files/_debug_message.php';
$buff = sprintf("[%s %s:%d]\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, print_r($buff, true));
diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php
index 577f98163..8a8c5a93f 100644
--- a/classes/display/HTMLDisplayHandler.php
+++ b/classes/display/HTMLDisplayHandler.php
@@ -28,21 +28,21 @@ class HTMLDisplayHandler {
$edited_layout_file = $oModule->getEditedLayoutFile();
- // 현재 요청된 레이아웃 정보를 구함
+ // get the layout information currently requested
$oLayoutModel = &getModel('layout');
$layout_info = Context::get('layout_info');
$layout_srl = $layout_info->layout_srl;
- // 레이아웃과 연결되어 있으면 레이아웃 컴파일
+ // compile if connected to the layout
if($layout_srl > 0){
- // faceoff 레이아웃일 경우 별도 처리
+ // handle separately if the layout is faceoff
if($layout_info && $layout_info->type == 'faceoff') {
$oLayoutModel->doActivateFaceOff($layout_info);
Context::set('layout_info', $layout_info);
}
- // 관리자 레이아웃 수정화면에서 변경된 CSS가 있는지 조사
+ // search if the changes CSS exists in the admin layout edit window
$edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl);
if(file_exists($edited_layout_css)) Context::addCSSFile($edited_layout_css,true,'all','',100);
@@ -66,13 +66,13 @@ class HTMLDisplayHandler {
if(__DEBUG__==3) $start = getMicroTime();
- // body 내의 를 header로 이동
+ // move in body to the header
$output = preg_replace_callback('!");
-
- // 레이아웃 정보중 extra_vars의 이름과 값을 $layout_info에 입력
+ // Set names and values of extra_vars to $layout_info
if($layout_info->extra_var_count) {
foreach($layout_info->extra_var as $var_id => $val) {
$layout_info->{$var_id} = $val->value;
}
}
-
- // 레이아웃 정보중 menu를 Context::set
+ // menu in layout information becomes an argument for Context:: set
if($layout_info->menu_count) {
foreach($layout_info->menu as $menu_id => $menu) {
if(file_exists($menu->php_file)) @include($menu->php_file);
@@ -184,12 +170,10 @@
Context::set('layout_info', $layout_info);
Context::set('content', Context::getLang('layout_preview_content'));
-
- // 코드를 임시로 저장
+ // Temporary save the codes
$edited_layout_file = sprintf('./files/cache/layout/tmp.tpl');
FileHandler::writeFile($edited_layout_file, $code);
-
- // 컴파일
+ // Compile
$oTemplate = &TemplateHandler::getInstance();
$layout_path = $layout_info->path;
@@ -197,44 +181,39 @@
$layout_tpl = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
Context::set('layout','none');
-
- // 위젯등을 변환
+ // Convert widgets and others
$oContext = &Context::getInstance();
Context::set('layout_tpl', $layout_tpl);
-
- // 임시 파일 삭제
+ // Delete Temporary Files
FileHandler::removeFile($edited_layout_file);
$this->setTemplateFile('layout_preview');
}
/**
- * @brief 레이아웃의 상세 정보(conf/info.xml)를 팝업 출력
+ * @brief Pop-up details of the layout(conf/info.xml)
**/
function dispLayoutAdminInfo() {
- // 선택된 레이아웃 정보를 구함
+ // Get the layout information
$oLayoutModel = &getModel('layout');
$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
Context::set('layout_info', $layout_info);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('layout_detail_info');
}
/**
- * @brief faceoff의 관리자 layout 수정
+ * @brief Modify admin layout of faceoff
**/
function dispLayoutAdminLayoutModify(){
- //layout_srl 를 가져온다
+ // Get layout_srl
$current_module_info = Context::get('current_module_info');
$layout_srl = $current_module_info->layout_srl;
-
- // 파일로 임시저장을 하기때문에 남아 있을지 모르는 tmp를 지운다
- // to do 개선이 필요
+ // Remove the remaining tmp files because of temporarily saving
+ // This part needs to be modified
$delete_tmp = Context::get('delete_tmp');
if($delete_tmp =='Y'){
$oLayoutAdminController = &getAdminController('layout');
@@ -242,11 +221,9 @@
}
$oLayoutModel = &getModel('layout');
-
- // layout file들은 temp로 사용한다.
+ // layout file is used as a temp.
$oLayoutModel->setUseUserLayoutTemp();
-
- // css 를 inline style로 뽑는다
+ // Apply CSS in inline style
$faceoffcss = $oLayoutModel->_getUserLayoutFaceOffCss($current_module_info->layout_srl);
$css = FileHandler::readFile($faceoffcss);
@@ -267,24 +244,20 @@
$oTemplate = &TemplateHandler::getInstance();
Context::set('content', $oTemplate->compile($this->module_path.'tpl','about_faceoff'));
-
- // 위젯 코드를 Javascript 수정모드로 변경
+ // Change widget codes in Javascript mode
$oWidgetController = &getController('widget');
$oWidgetController->setWidgetCodeInJavascriptMode();
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('faceoff_layout_edit');
}
function dispLayoutAdminLayoutImageList(){
$layout_srl = Context::get('layout_srl');
$oLayoutModel = &getModel('layout');
-
- // 이미지 목록
+ // Image List
$layout_image_list = $oLayoutModel->getUserLayoutImageList($layout_srl);
Context::set('layout_image_list',$layout_image_list);
-
- // 경로
+ // Path
$layout_image_path = $oLayoutModel->getUserLayoutImagePath($layout_srl);
Context::set('layout_image_path',$layout_image_path);
diff --git a/modules/layout/layout.class.php b/modules/layout/layout.class.php
index 72339bb91..dcf4e3540 100644
--- a/modules/layout/layout.class.php
+++ b/modules/layout/layout.class.php
@@ -2,31 +2,29 @@
/**
* @class layout
* @author NHN (developers@xpressengine.com)
- * @brief layout 모듈의 high class
+ * @brief high class of the layout module
**/
class layout extends ModuleObject {
/**
- * @brief 설치시 추가 작업이 필요할시 구현
+ * @brief Implement if additional tasks are necessary when installing
**/
function moduleInstall() {
- // 레이아웃에서 사용할 디렉토리 생성
+ // Create a directory to be used in the layout
FileHandler::makeDir('./files/cache/layout');
return new Object();
}
/**
- * @brief 설치가 이상이 없는지 체크하는 method
+ * @brief a method to check if successfully installed
**/
function checkUpdate() {
$oDB = &DB::getInstance();
-
- // 2009. 02. 11 layout 테이블에 site_srl 추가
+ // 2009. 02. 11 Add site_srl to layout table
if(!$oDB->isColumnExists('layouts', 'site_srl')) return true;
-
- // 2009. 02. 26 faceOff에 맞춰 기존 레이아웃 편집본을 이동
+ // 2009. 02. 26 Move the previous layout for faceoff
$files = FileHandler::readDir('./files/cache/layout');
for($i=0,$c=count($files);$i<$c;$i++) {
$filename = $files[$i];
@@ -39,17 +37,15 @@
}
/**
- * @brief 업데이트 실행
+ * @brief Execute update
**/
function moduleUpdate() {
$oDB = &DB::getInstance();
-
- // 2009. 02. 11 menu 테이블에 site_srl 추가
+ // 2009. 02. 11 Add site_srl to menu table
if(!$oDB->isColumnExists('layouts', 'site_srl')) {
$oDB->addColumn('layouts','site_srl','number',11,0,true);
}
-
- // 2009. 02. 26 faceOff에 맞춰 기존 레이아웃 편집본을 이동
+ // 2009. 02. 26 Move the previous layout for faceoff
$oLayoutModel = &getModel('layout');
$files = FileHandler::readDir('./files/cache/layout');
for($i=0,$c=count($files);$i<$c;$i++) {
@@ -72,10 +68,10 @@
/**
- * @brief 캐시 파일 재생성
+ * @brief Re-generate the cache file
**/
function recompileCache() {
- // 레이아웃 캐시 삭제 (수정본은 지우지 않음)
+ // Remove layout cache(modified layout is not deleted)
$path = './files/cache/layout';
if(!is_dir($path)) {
FileHandler::makeDir($path);
diff --git a/modules/layout/layout.model.php b/modules/layout/layout.model.php
index 5874b9ce8..e7b19b8bd 100644
--- a/modules/layout/layout.model.php
+++ b/modules/layout/layout.model.php
@@ -3,21 +3,21 @@
* @class layoutModel
* @author NHN (developers@xpressengine.com)
* @version 0.1
- * @brief layout 모듈의 Model class
+ * @brief Model class of the layout module
**/
class layoutModel extends layout {
var $useUserLayoutTemp = null;
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief DB 에 생성된 레이아웃의 목록을 구함
- * 생성되었다는 것은 DB에 등록이 되었다는 것을 의미
+ * @brief Get a layout list created in the DB
+ * If you found a new list, it means that the layout list is inserted to the DB
**/
function getLayoutList($site_srl = 0, $layout_type="P") {
if(!$site_srl) {
@@ -33,22 +33,21 @@
}
/**
- * @brief DB 에 생성된 한개의 레이아웃 정보를 구함
- * 생성된 레이아웃의 DB정보+XML정보를 return
+ * @brief Get one of layout information created in the DB
+ * Return DB info + XML info of the generated layout
**/
function getLayout($layout_srl) {
- // 일단 DB에서 정보를 가져옴
+ // Get information from the DB
$args->layout_srl = $layout_srl;
$output = executeQuery('layout.getLayout', $args);
if(!$output->data) return;
-
- // layout, extra_vars를 정리한 후 xml 파일 정보를 정리해서 return
+ // Return xml file informaton after listing up the layout and extra_vars
$layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
return $layout_info;
}
/**
- * @brief 레이아웃의 경로를 구함
+ * @brief Get a layout path
**/
function getLayoutPath($layout_name, $layout_type = "P") {
if($layout_name == 'faceoff'){
@@ -65,11 +64,11 @@
}
/**
- * @brief 레이아웃의 종류와 정보를 구함
- * 다운로드되어 있는 레이아웃의 종류 (생성과 다른 의미)
+ * @brief Get a type and information of the layout
+ * A type of downloaded layout
**/
function getDownloadedLayoutList($layout_type = "P") {
- // 다운받은 레이아웃과 설치된 레이아웃의 목록을 구함
+ // Get a list of downloaded layout and installed layout
if($layout_type == "M")
{
$directory = "./m.layouts";
@@ -84,13 +83,11 @@
if(!$searched_count) return;
natcasesort($searched_list);
-
- // 찾아진 레이아웃 목록을 loop돌면서 필요한 정보를 간추려 return
+ // Return information for looping searched list of layouts
for($i=0;$i<$searched_count;$i++) {
- // 레이아웃의 이름
+ // Name of the layout
$layout = $searched_list[$i];
-
- // 해당 레이아웃의 정보를 구함
+ // Get information of the layout
$layout_info = $this->getLayoutInfo($layout, null, $layout_type);
$list[] = $layout_info;
@@ -99,8 +96,8 @@
}
/**
- * @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
- * 이것 역시 캐싱을 통해서 xml parsing 시간을 줄인다..
+ * @brief Get information by reading conf/info.xml in the module
+ * It uses caching to reduce time for xml parsing ..
**/
function getLayoutInfo($layout, $info = null, $layout_type = "P") {
if($info) {
@@ -115,12 +112,10 @@
$xml_file = sprintf('%sskin.xml', $layout_path);
}
}
-
- // 요청된 모듈의 경로를 구한다. 없으면 return
+ // Get a path of the requested module. Return if not exists.
if(!$layout_path) $layout_path = $this->getLayoutPath($layout, $layout_type);
if(!is_dir($layout_path)) return;
-
- // 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
+ // Read the xml file for module skin information
if(!$xml_file) $xml_file = sprintf("%sconf/info.xml", $layout_path);
if(!file_exists($xml_file)) {
$layout_info->layout = $layout;
@@ -130,8 +125,7 @@
$layout_info->layout_type = $layout_type;
return $layout_info;
}
-
- // cache 파일을 비교하여 문제 없으면 include하고 $layout_info 변수를 return
+ // Include the cache file if it is valid and then return $layout_info variable
if(!$layout_srl){
$cache_file = $this->getLayoutCache($layout, Context::getLangType());
}else{
@@ -149,8 +143,7 @@
}
return $layout_info;
}
-
- // cache 파일이 없으면 xml parsing하고 변수화 한 후에 캐시 파일에 쓰고 변수 바로 return
+ // If no cache file exists, parse the xml and then return the variable.
$oXmlParser = new XmlParser();
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
if($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout;
@@ -162,7 +155,7 @@
$buff .= sprintf('$layout_info->site_srl = "%s";', $site_srl);
if($xml_obj->version && $xml_obj->attrs->version == '0.2') {
- // 레이아웃의 제목, 버전
+ // Layout title, version and other information
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
@@ -178,8 +171,7 @@
$buff .= sprintf('$layout_info->license = "%s";', $xml_obj->license->body);
$buff .= sprintf('$layout_info->license_link = "%s";', $xml_obj->license->attrs->link);
$buff .= sprintf('$layout_info->layout_type = "%s";', $layout_type);
-
- // 작성자 정보
+ // Author information
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
else $author_list = $xml_obj->author;
@@ -188,10 +180,7 @@
$buff .= sprintf('$layout_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
$buff .= sprintf('$layout_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
}
-
-
-
- // 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
+ // Extra vars (user defined variables to use in a template)
$extra_var_groups = $xml_obj->extra_vars->group;
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
@@ -239,8 +228,7 @@
}
}
}
-
- // 메뉴
+ // Menu
if($xml_obj->menus->menu) {
$menus = $xml_obj->menus->menu;
if(!is_array($menus)) $menus = array($menus);
@@ -297,8 +285,7 @@
} else {
-
- // 레이아웃의 제목, 버전
+ // Layout title, version and other information
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
@@ -309,13 +296,11 @@
$buff .= sprintf('$layout_info->date = "%s";', $date);
$buff .= sprintf('$layout_info->layout_srl = $layout_srl;');
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
-
- // 작성자 정보
+ // Author information
$buff .= sprintf('$layout_info->author[0]->name = "%s";', $xml_obj->author->name->body);
$buff .= sprintf('$layout_info->author[0]->email_address = "%s";', $xml_obj->author->attrs->email_address);
$buff .= sprintf('$layout_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link);
-
- // 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
+ // Extra vars (user defined variables to use in a template)
$extra_var_groups = $xml_obj->extra_vars->group;
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
@@ -350,8 +335,7 @@
}
}
}
-
- // 메뉴
+ // Menu
if($xml_obj->menus->menu) {
$menus = $xml_obj->menus->menu;
if(!is_array($menus)) $menus = array($menus);
@@ -389,7 +373,7 @@
/**
- * @brief layout설정화면에서의 업로드한 이미지목록을 반환한다
+ * @brief Return a list of images which are uploaded on the layout setting page
**/
function getUserLayoutImageList($layout_srl){
$path = $this->getUserLayoutImagePath($layout_srl);
@@ -399,7 +383,7 @@
/**
- * @brief ini config들을 가져온다 array다.
+ * @brief Get ini configurations and make them an array.
**/
function getUserLayoutIniConfig($layout_srl, $layout_name=null){
$file = $this->getUserLayoutIni($layout_srl);
@@ -426,7 +410,7 @@
}
/**
- * @brief user layout css 관리자가 설정화면에서 저장한 css
+ * @brief css which is set by an administrator on the layout setting page
**/
function getUserLayoutCss($layout_srl){
return $this->getUserLayoutPath($layout_srl). 'layout.css';
@@ -434,7 +418,7 @@
/**
- * @brief faceoff용 css module handler에서 import 한다
+ * @brief Import faceoff css from css module handler
**/
function getUserLayoutFaceOffCss($layout_srl){
$src = $this->_getUserLayoutFaceOffCss($layout_srl);
@@ -444,7 +428,7 @@
/**
- * @brief faceoff용 css module handler에서 import 한다
+ * @brief Import faceoff css from css module handler
**/
function _getUserLayoutFaceOffCss($layout_srl){
return $this->getUserLayoutPath($layout_srl). 'faceoff.css';
@@ -504,7 +488,7 @@
/**
* @brief user layout cache
- * todo 파일 자체를 삭제 필요가 있다
+ * todo It may need to remove the file itself
**/
function getUserLayoutCache($layout_srl,$lang_type){
return $this->getUserLayoutPath($layout_srl). "{$lang_type}.cache.php";
@@ -518,28 +502,28 @@
}
/**
- * @brief default layout ini 사용자의 임의 수정을 막기 위해
+ * @brief default layout ini to prevent arbitrary changes by a user
**/
function getDefaultLayoutIni($layout_name){
return $this->getDefaultLayoutPath($layout_name). 'layout.ini';
}
/**
- * @brief default layout html 사용자의 임의 수정을 막기 위해
+ * @brief default layout html to prevent arbitrary changes by a user
**/
function getDefaultLayoutHtml($layout_name){
return $this->getDefaultLayoutPath($layout_name). 'layout.html';
}
/**
- * @brief default layout css 사용자의 임의 수정을 막기 위해
+ * @brief default layout css to prevent arbitrary changes by a user
**/
function getDefaultLayoutCss($layout_name){
return $this->getDefaultLayoutPath($layout_name). 'css/layout.css';
}
/**
- * @brief default layout path 사용자의 임의 수정을 막기 위해
+ * @brief default layout path to prevent arbitrary changes by a user
**/
function getDefaultLayoutPath() {
return "./modules/layout/faceoff/";
@@ -547,7 +531,7 @@
/**
- * @brief faceoff 인지
+ * @brief faceoff is
**/
function useDefaultLayout($layout_name){
$info = $this->getLayoutInfo($layout_name);
@@ -557,7 +541,7 @@
/**
- * @brief User Layout 을 임시 저장 모드로
+ * @brief Set user layout as temporary save mode
**/
function setUseUserLayoutTemp($flag='temp'){
$this->useUserLayoutTemp = $flag;
@@ -565,7 +549,7 @@
/**
- * @brief User Layout 임시 저장 파일 목록.
+ * @brief Temp file list for User Layout
**/
function getUserLayoutTempFileList($layout_srl){
$file_list = array(
@@ -578,7 +562,7 @@
/**
- * @brief User Layout 저장 파일 목록.
+ * @brief Saved file list for User Layout
**/
function getUserLayoutFileList($layout_srl){
$file_list = array(
@@ -596,32 +580,26 @@
}
/**
- * @brief faceOff관련 서비스 출력을 위한 동작 실행
+ * @brief faceOff related services for the operation run out
**/
function doActivateFaceOff(&$layout_info) {
$layout_info->faceoff_ini_config = $this->getUserLayoutIniConfig($layout_info->layout_srl, $layout_info->layout);
-
- // 기본 faceoff layout CSS
+ // faceoff layout CSS
Context::addCSSFile($this->getDefaultLayoutCss($layout_info->layout));
-
- // 레이아웃 매니져에서 생성된 CSS
+ // CSS generated in the layout manager
$faceoff_layout_css = $this->getUserLayoutFaceOffCss($layout_info->layout_srl);
if($faceoff_layout_css) Context::addCSSFile($faceoff_layout_css);
-
- // 레이아웃의 위젯을 위한 css출력
+ // CSS output for the widget
Context::addCSSFile($this->module_path.'/tpl/css/widget.css');
if($layout_info->extra_var->colorset->value == 'black') Context::addCSSFile($this->module_path.'/tpl/css/widget@black.css');
else Context::addCSSFile($this->module_path.'/tpl/css/widget@white.css');
-
- // 권한에 따른 다른 내용 출력
+ // Different page displayed upon user's permission
$logged_info = Context::get('logged_info');
-
- // faceOff 레이아웃 편집 버튼 노출
+ // Display edit button for faceoff layout
if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')===false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) {
Context::addHtmlFooter("
");
}
-
- // faceOff페이지 수정시에 메뉴 출력
+ // Display menu when editing the faceOff page
if(Context::get('act')=='dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) {
$oTemplate = &TemplateHandler::getInstance();
Context::addBodyHeader($oTemplate->compile($this->module_path.'/tpl', 'faceoff_layout_menu'));
diff --git a/modules/layout/layout.view.php b/modules/layout/layout.view.php
index c0d4f25d5..c1aed24ff 100644
--- a/modules/layout/layout.view.php
+++ b/modules/layout/layout.view.php
@@ -2,32 +2,30 @@
/**
* @class layoutView
* @author NHN (developers@xpressengine.com)
- * @brief layout 모듈의 admin view class
+ * @brief admin view class of the layout module
**/
class layoutView extends layout {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
$this->setTemplatePath($this->module_path.'tpl');
}
/**
- * @brief 레이아웃의 상세 정보(conf/info.xml)를 팝업 출력
+ * @brief Pop-up layout details(conf/info.xml)
**/
function dispLayoutInfo() {
- // 선택된 레이아웃 정보를 구함
+ // Get the layout information
$oLayoutModel = &getModel('layout');
$layout_info = $oLayoutModel->getLayoutInfo(Context::get('selected_layout'));
if(!$layout_info) exit();
Context::set('layout_info', $layout_info);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('layout_detail_info');
}
}
diff --git a/modules/member/member.admin.controller.php b/modules/member/member.admin.controller.php
index caab036e7..25e095afc 100644
--- a/modules/member/member.admin.controller.php
+++ b/modules/member/member.admin.controller.php
@@ -2,50 +2,44 @@
/**
* @class memberAdminController
* @author NHN (developers@xpressengine.com)
- * @brief member module의 admin controller class
+ * @brief member module of the admin controller class
**/
class memberAdminController extends member {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 사용자 추가 (관리자용)
+ * @brief Add a user (Administrator)
**/
function procMemberAdminInsert() {
if(Context::getRequestMethod() == "GET") return new Object(-1, "msg_invalid_request");
- // 필수 정보들을 미리 추출
+ // Extract the necessary information in advance
$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','limit_date');
-
- // 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제
+ // Remove some unnecessary variables from all the vars
$all_args = Context::getRequestVars();
unset($all_args->module);
unset($all_args->act);
if(!isset($args->limit_date)) $args->limit_date = "";
-
- // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력
+ // Add extra vars after excluding necessary information from all the requested arguments
$extra_vars = delObjectVars($all_args, $args);
$args->extra_vars = serialize($extra_vars);
-
- // member_srl이 넘어오면 원 회원이 있는지 확인
+ // Check if an original member exists having the member_srl
if($args->member_srl) {
- // 멤버 모델 객체 생성
+ // Create a member model object
$oMemberModel = &getModel('member');
-
- // 회원 정보 구하기
+ // Get memebr profile
$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
-
- // 만약 원래 회원이 없으면 새로 입력하기 위한 처리
+ // If no original member exists, make a new one
if($member_info->member_srl != $args->member_srl) unset($args->member_srl);
}
$oMemberController = &getController('member');
-
- // member_srl의 값에 따라 insert/update
+ // Execute insert or update depending on the value of member_srl
if(!$args->member_srl) {
$output = $oMemberController->insertMember($args);
$msg_code = 'success_registed';
@@ -55,21 +49,19 @@
}
if(!$output->toBool()) return $output;
-
- // 서명 저장
+ // Save Signature
$signature = Context::get('signature');
$oMemberController->putSignature($args->member_srl, $signature);
-
- // 결과 리턴
+ // Return result
$this->add('member_srl', $args->member_srl);
$this->setMessage($msg_code);
}
/**
- * @brief 사용자 삭제 (관리자용)
+ * @brief Delete a user (Administrator)
**/
function procMemberAdminDelete() {
- // 일단 입력된 값들을 모두 받아서 db 입력항목과 그외 것으로 분리
+ // Separate all the values into DB entries and others
$member_srl = Context::get('member_srl');
$oMemberController = &getController('member');
@@ -81,10 +73,10 @@
}
/**
- * @brief 회원 관리용 기본 정보의 추가
+ * @brief Add information for member administration
**/
function procMemberAdminInsertConfig() {
- // 기본 정보를 받음
+ // Get the basic information
$args = Context::gets(
'webmaster_name', 'webmaster_email',
'skin', 'colorset',
@@ -119,7 +111,7 @@
}
/**
- * @brief 사용자 그룹 추가
+ * @brief Add a user group
**/
function procMemberAdminInsertGroup() {
$args = Context::gets('title','description','is_default','image_mark');
@@ -132,7 +124,7 @@
}
/**
- * @brief 사용자 그룹 정보 수정
+ * @brief Update user group information
**/
function procMemberAdminUpdateGroup() {
$group_srl = Context::get('group_srl');
@@ -159,7 +151,7 @@
}
/**
- * @brief 가입 항목 추가
+ * @brief Add a join form
**/
function procMemberAdminInsertJoinForm() {
$args->member_join_form_srl = Context::get('member_join_form_srl');
@@ -173,15 +165,13 @@
$args->required = Context::get('required');
if(!in_array(strtoupper($args->required), array('Y','N'))) $args->required = 'N';
$args->description = Context::get('description');
-
- // 기본값의 정리
+ // Default values
if(in_array($args->column_type, array('checkbox','select','radio')) && count($args->default_value) ) {
$args->default_value = serialize($args->default_value);
} else {
$args->default_value = '';
}
-
- // member_join_form_srl이 있으면 수정, 없으면 추가
+ // Fix if member_join_form_srl exists. Add if not exists.
if(!$args->member_join_form_srl){
$args->list_order = getNextSequence();
$output = executeQuery('member.insertJoinForm', $args);
@@ -196,7 +186,7 @@
}
/**
- * @brief 가입 항목의 상/하 이동 및 내용 수정
+ * @brief Move up/down the member join form and modify it
**/
function procMemberAdminUpdateJoinForm() {
$member_join_form_srl = Context::get('member_join_form_srl');
@@ -224,7 +214,7 @@
}
/**
- * @brief 선택된 회원들을 일괄 삭제
+ * @brief Delete the selected members
*/
function procMemberAdminDeleteMembers() {
$target_member_srls = Context::get('target_member_srls');
@@ -244,7 +234,7 @@
}
/**
- * @brief 선택된 회원들의 그룹을 일괄 변경
+ * @brief Update a group of selected memebrs
**/
function procMemberAdminUpdateMembersGroup() {
$member_srl = Context::get('member_srl');
@@ -257,16 +247,14 @@
$oDB = &DB::getInstance();
$oDB->begin();
-
- // 선택된 회원들의 그룹을 삭제
+ // Delete a group of selected members
$args->member_srl = $member_srl;
$output = executeQuery('member.deleteMembersGroup', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
-
- // 선택된 그룹으로 추가
+ // Add to a selected group
$group_count = count($group_srls);
$member_count = count($member_srls);
for($j=0;$j<$group_count;$j++) {
@@ -293,7 +281,7 @@
}
/**
- * @brief 금지 아이디 추가
+ * @brief Add a denied ID
**/
function procMemberAdminInsertDeniedID() {
$user_id = Context::get('user_id');
@@ -308,7 +296,7 @@
}
/**
- * @brief 금지 아이디 업데이트
+ * @brief Update denied ID
**/
function procMemberAdminUpdateDeniedID() {
$user_id = Context::get('user_id');
@@ -327,13 +315,12 @@
}
/**
- * @brief 관리자를 추가한다
+ * @brief Add an administrator
**/
function insertAdmin($args) {
- // 관리자임을 설정
+ // Assign an administrator
$args->is_admin = 'Y';
-
- // 관리자 그룹을 구해와서 설정
+ // Get admin group and set
$oMemberModel = &getModel('member');
$admin_group = $oMemberModel->getAdminGroup();
$args->group_srl_list = $admin_group->group_srl;
@@ -343,7 +330,7 @@
}
/**
- * @brief 회원의 그룹값을 변경
+ * @brief Change the group values of member
**/
function changeGroup($source_group_srl, $target_group_srl) {
$args->source_group_srl = $source_group_srl;
@@ -353,11 +340,11 @@
}
/**
- * @brief 그룹 등록
+ * @brief Insert a group
**/
function insertGroup($args) {
if(!$args->site_srl) $args->site_srl = 0;
- // is_default값을 체크, Y일 경우 일단 모든 is_default에 대해서 N 처리
+ // Check the value of is_default.
if($args->is_default!='Y') {
$args->is_default = 'N';
} else {
@@ -369,10 +356,10 @@
}
/**
- * @brief 그룹 정보 수정
+ * @brief Modify Group Information
**/
function updateGroup($args) {
- // is_default값을 체크, Y일 경우 일단 모든 is_default에 대해서 N 처리
+ // Check the value of is_default.
if($args->is_default!='Y') $args->is_default = 'N';
else {
$output = executeQuery('member.updateGroupDefaultClear', $args);
@@ -383,23 +370,20 @@
}
/**
- * 그룹 삭제
+ * Delete a Group
**/
function deleteGroup($group_srl, $site_srl = null) {
- // 멤버모델 객체 생성
+ // Create a member model object
$oMemberModel = &getModel('member');
-
- // 삭제 대상 그룹을 가져와서 체크 (is_default == 'Y'일 경우 삭제 불가)
+ // Check the group_srl (If is_default == 'Y', it cannot be deleted)
$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'인 그룹을 가져옴
+ // Get groups where is_default == 'Y'
$default_group = $oMemberModel->getDefaultGroup($site_srl);
$default_group_srl = $default_group->group_srl;
-
- // default_group_srl로 변경
+ // Change to default_group_srl
$this->changeGroup($group_srl, $default_group_srl);
$args->group_srl = $group_srl;
@@ -418,7 +402,7 @@
}
/**
- * @brief 금지아이디 등록
+ * @brief Register denied ID
**/
function insertDeniedID($user_id, $description = '') {
$args->user_id = $user_id;
@@ -429,7 +413,7 @@
}
/**
- * @brief 금지아이디 삭제
+ * @brief Delete a denied ID
**/
function deleteDeniedID($user_id) {
$args->user_id = $user_id;
@@ -437,7 +421,7 @@
}
/**
- * @brief 가입폼 항목을 삭제
+ * @brief Delete a join form
**/
function deleteJoinForm($member_join_form_srl) {
$args->member_join_form_srl = $member_join_form_srl;
@@ -446,19 +430,17 @@
}
/**
- * @brief 가입항목을 상단으로 이동
+ * @brief Move up a join form
**/
function moveJoinFormUp($member_join_form_srl) {
$oMemberModel = &getModel('member');
-
- // 선택된 가입항목의 정보를 구한다
+ // Get information of the join form
$args->member_join_form_srl = $member_join_form_srl;
$output = executeQuery('member.getJoinForm', $args);
$join_form = $output->data;
$list_order = $join_form->list_order;
-
- // 전체 가입항목 목록을 구한다
+ // Get a list of all join forms
$join_form_list = $oMemberModel->getJoinFormList();
$join_form_srl_list = array_keys($join_form_list);
if(count($join_form_srl_list)<2) return new Object();
@@ -468,19 +450,15 @@
if($val->member_join_form_srl == $member_join_form_srl) break;
$prev_member_join_form = $val;
}
-
- // 이전 가입항목가 없으면 그냥 return
+ // Return if no previous join form exists
if(!$prev_member_join_form) return new Object();
-
- // 선택한 가입항목의 정보
+ // Information of the join form
$cur_args->member_join_form_srl = $member_join_form_srl;
$cur_args->list_order = $prev_member_join_form->list_order;
-
- // 대상 가입항목의 정보
+ // Information of the target join form
$prev_args->member_join_form_srl = $prev_member_join_form->member_join_form_srl;
$prev_args->list_order = $list_order;
-
- // DB 처리
+ // Execute Query
$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
if(!$output->toBool()) return $output;
@@ -491,19 +469,17 @@
}
/**
- * @brief 가입항목을 하단으로 이동
+ * @brief Move down a join form
**/
function moveJoinFormDown($member_join_form_srl) {
$oMemberModel = &getModel('member');
-
- // 선택된 가입항목의 정보를 구한다
+ // Get information of the join form
$args->member_join_form_srl = $member_join_form_srl;
$output = executeQuery('member.getJoinForm', $args);
$join_form = $output->data;
$list_order = $join_form->list_order;
-
- // 전체 가입항목 목록을 구한다
+ // Get information of all join forms
$join_form_list = $oMemberModel->getJoinFormList();
$join_form_srl_list = array_keys($join_form_list);
if(count($join_form_srl_list)<2) return new Object();
@@ -513,20 +489,16 @@
}
$next_member_join_form_srl = $join_form_srl_list[$i+1];
-
- // 이전 가입항목가 없으면 그냥 return
+ // Return if no previous join form exists
if(!$next_member_join_form_srl) return new Object();
$next_member_join_form = $join_form_list[$next_member_join_form_srl];
-
- // 선택한 가입항목의 정보
+ // Information of the join form
$cur_args->member_join_form_srl = $member_join_form_srl;
$cur_args->list_order = $next_member_join_form->list_order;
-
- // 대상 가입항목의 정보
+ // Information of the target join form
$next_args->member_join_form_srl = $next_member_join_form->member_join_form_srl;
$next_args->list_order = $list_order;
-
- // DB 처리
+ // Execute Query
$output = executeQuery('member.updateMemberJoinFormListorder', $cur_args);
if(!$output->toBool()) return $output;
diff --git a/modules/member/member.admin.model.php b/modules/member/member.admin.model.php
index efc5cc72d..bed2aca44 100644
--- a/modules/member/member.admin.model.php
+++ b/modules/member/member.admin.model.php
@@ -2,29 +2,29 @@
/**
* @class memberAdminModel
* @author NHN (developers@xpressengine.com)
- * @brief member module의 admin model class
+ * @brief admin model class of member module
**/
class memberAdminModel extends member {
/**
- * @brief 자주 호출될거라 예상되는 데이터는 내부적으로 가지고 있자...
+ * @brief Keep data internally which may be frequently called.
**/
var $member_info = NULL;
var $member_groups = NULL;
var $join_form_list = NULL;
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 회원 목록을 구함
+ * @brief Get a member list
**/
function getMemberList() {
- // 검색 옵션 정리
+ // Search options
$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');
@@ -74,7 +74,7 @@
}
}
- // selected_group_srl이 있으면 query id를 변경 (table join때문에)
+ // Change the query id if selected_group_srl exists (for table join)
$sort_order = Context::get('sort_order');
$sort_index = Context::get('sort_index');
if($sort_index != 'last_login') {
@@ -92,8 +92,7 @@
if($sort_order != "desc") $sort_order = "asc";
$args->sort_order = $sort_order;
Context::set('sort_order', $sort_order);
-
- // 기타 변수들 정리
+ // Other variables
$args->page = Context::get('page');
$args->list_count = 40;
$args->page_count = 10;
@@ -102,7 +101,7 @@
}
/**
- * @brief 사이트별 회원 목록을 구함
+ * @brief Get a memebr list for each site
**/
function getSiteMemberList($site_srl, $page = 1) {
$args->site_srl = $site_srl;
@@ -115,7 +114,7 @@
}
/**
- * @brief 회원 모듈의 특정 스킨에 속한 컬러셋 목록을 return
+ * @brief Return colorset list of a skin in the member module
**/
function getMemberAdminColorset() {
$skin = Context::get('skin');
diff --git a/modules/member/member.admin.view.php b/modules/member/member.admin.view.php
index 6da3e2e9a..3cd995e81 100644
--- a/modules/member/member.admin.view.php
+++ b/modules/member/member.admin.view.php
@@ -160,13 +160,12 @@
}
/**
- * @brief 회원 가입 폼 목록 출력
+ * @brief Display a list of member join form
**/
function dispMemberAdminJoinFormList() {
- // 멤버모델 객체 생성
+ // Create a member model object
$oMemberModel = &getModel('member');
-
- // 추가로 설정한 가입 항목 가져오기
+ // Get join form list which is additionally set
$form_list = $oMemberModel->getJoinFormList();
Context::set('form_list', $form_list);
@@ -174,10 +173,10 @@
}
/**
- * @brief 회원 가입 폼 관리 화면 출력
+ * @brief Display an admin page for memebr join forms
**/
function dispMemberAdminInsertJoinForm() {
- // 수정일 경우 대상 join_form의 값을 구함
+ // Get the value of join_form
$member_join_form_srl = Context::get('member_join_form_srl');
if($member_join_form_srl) {
$oMemberModel = &getModel('member');
@@ -190,13 +189,12 @@
}
/**
- * @brief 금지 목록 아이디 출력
+ * @brief Display denied ID list
**/
function dispMemberAdminDeniedIDList() {
- // 멤버모델 객체 생성
+ // Create a member model object
$oMemberModel = &getModel('member');
-
- // 사용금지 목록 가져오기
+ // Get a denied ID list
$output = $oMemberModel->getDeniedIDList();
Context::set('total_count', $output->total_count);
@@ -209,15 +207,14 @@
}
/**
- * @brief 회원 그룹 일괄 변경
+ * @brief Update all the member groups
**/
function dispMemberAdminManageGroup() {
- // 선택된 회원 목록을 구함
+ // Get a list of the selected member
$args->member_srl = trim(Context::get('member_srls'));
$output = executeQueryArray('member.getMembers', $args);
Context::set('member_list', $output->data);
-
- // 회원 그룹 목록을 구함
+ // Get a list of the selected member
$oMemberModel = &getModel('member');
Context::set('member_groups', $oMemberModel->getGroups());
@@ -226,10 +223,10 @@
}
/**
- * @brief 회원 일괄 삭제
+ * @brief Delete all members
**/
function dispMemberAdminDeleteMembers() {
- // 선택된 회원 목록을 구함
+ // Get a list of the selected member
$args->member_srl = trim(Context::get('member_srls'));
$output = executeQueryArray('member.getMembers', $args);
Context::set('member_list', $output->data);
diff --git a/modules/member/member.api.php b/modules/member/member.api.php
index 619ae2308..87c2cb696 100644
--- a/modules/member/member.api.php
+++ b/modules/member/member.api.php
@@ -2,14 +2,14 @@
/**
* @class memberAPI
* @author NHN (developers@xpressengine.com)
- * @brief member 모듈의 View Action에 대한 API 처리
+ * @brief API Processing of View Action in the member module
**/
class memberAPI extends member {
/**
- * @brief 컨텐츠 목록
+ * @brief Content List
**/
function dispSavedDocumentList(&$oModule) {
$document_list = $this->arrangeContentList(Context::get('document_list'));
diff --git a/modules/member/member.class.php b/modules/member/member.class.php
index 88a9fd88b..a67571416 100644
--- a/modules/member/member.class.php
+++ b/modules/member/member.class.php
@@ -2,7 +2,7 @@
/**
* @class member
* @author NHN (developers@xpressengine.com)
- * @brief member module의 high class
+ * @brief high class of the member module
**/
class member extends ModuleObject {
@@ -14,8 +14,7 @@
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
-
- // SSL 사용시 회원가입/정보/비밀번호등과 관련된 action에 대해 SSL 전송하도록 지정
+ // Set to use SSL upon actions related member join/information/password and so on
if(Context::get('_use_ssl') == 'optional') {
Context::addSSLAction('dispMemberModifyPassword');
Context::addSSLAction('dispMemberSignUpForm');
@@ -29,10 +28,10 @@
}
/**
- * @brief 설치시 추가 작업이 필요할시 구현
+ * @brief Implement if additional tasks are necessary when installing
**/
function moduleInstall() {
- // action forward에 등록 (관리자 모드에서 사용하기 위함)
+ // Register action forward (to use in administrator mode)
$oModuleController = &getController('module');
$oDB = &DB::getInstance();
@@ -40,8 +39,7 @@
$oModuleModel = &getModel('module');
$args = $oModuleModel->getModuleConfig('member');
-
- // 기본 정보를 세팅
+ // Set the basic information
$args->enable_join = 'Y';
if(!$args->enable_openid) $args->enable_openid = 'N';
if(!$args->enable_auth_mail) $args->enable_auth_mail = 'N';
@@ -57,15 +55,14 @@
if($args->group_image_mark!='Y') $args->group_image_mark = 'N';
$oModuleController->insertModuleConfig('member',$args);
-
- // 멤버 컨트롤러 객체 생성
+ // Create a member controller object
$oMemberModel = &getModel('member');
$oMemberController = &getController('member');
$oMemberAdminController = &getAdminController('member');
$groups = $oMemberModel->getGroups();
if(!count($groups)) {
- // 관리자, 정회원, 준회원 그룹을 입력
+ // Set an administrator, regular member(group1), and associate member(group2)
$group_args->title = Context::getLang('admin_group');
$group_args->is_default = 'N';
$group_args->is_admin = 'Y';
@@ -83,22 +80,19 @@
$group_args->is_admin = 'N';
$oMemberAdminController->insertGroup($group_args);
}
-
- // 관리자 정보 세팅
+ // Configure administrator information
$admin_args->is_admin = 'Y';
$output = executeQuery('member.getMemberList', $admin_args);
if(!$output->data) {
$admin_info = Context::gets('user_id','password','nick_name','user_name', 'email_address');
if($admin_info->user_id) {
- // 관리자 정보 입력
+ // Insert admin information
$oMemberAdminController->insertAdmin($admin_info);
-
- // 로그인 처리시킴
+ // Log-in Processing
$output = $oMemberController->doLogin($admin_info->user_id);
}
}
-
- // 금지 아이디 등록 (기본 + 모듈명)
+ // Register denied ID(default + module name)
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getModuleList();
foreach($module_list as $key => $val) {
@@ -110,8 +104,7 @@
$oMemberAdminController->insertDeniedID('telnet','');
$oMemberAdminController->insertDeniedID('ftp','');
$oMemberAdminController->insertDeniedID('http','');
-
- // member 에서 사용할 cache디렉토리 생성
+ // Create cache directory to use in the member module
FileHandler::makeDir('./files/member_extra_info/image_name');
FileHandler::makeDir('./files/member_extra_info/image_mark');
FileHandler::makeDir('./files/member_extra_info/profile_image');
@@ -122,34 +115,28 @@
}
/**
- * @brief 설치가 이상이 없는지 체크하는 method
+ * @brief a method to check if successfully installed
**/
function checkUpdate() {
$oDB = &DB::getInstance();
$oModuleModel = &getModel('module');
-
- // member 디렉토리 체크 (2007. 8. 11 추가)
+ // check member directory (11/08/2007 added)
if(!is_dir("./files/member_extra_info")) return true;
-
- // member 디렉토리 체크 (2007. 10. 22 추가)
+ // check member directory (22/10/2007 added)
if(!is_dir("./files/member_extra_info/profile_image")) return true;
-
- // member_auth_mail 테이블에 is_register 필드 추가 (2008. 04. 22)
+ // Add a column(is_register) to "member_auth_mail" table (22/04/2008)
$act = $oDB->isColumnExists("member_auth_mail", "is_register");
if(!$act) return true;
-
- // member_group_member 테이블에 site_srl 추가 (2008. 11. 15)
+ // Add a column(site_srl) to "member_group_member" table (11/15/2008)
if(!$oDB->isColumnExists("member_group_member", "site_srl")) return true;
if(!$oDB->isColumnExists("member_group", "site_srl")) return true;
if($oDB->isIndexExists("member_group","uni_member_group_title")) return true;
-
- // image_mark 추가 (2009. 02. 14)
+ // Add a column for image_mark (02/14/2009)
if(!$oDB->isColumnExists("member_group", "image_mark")) return true;
-
- // password 유효기간을 위한 추가
+ // Add c column for password expiration date
if(!$oDB->isColumnExists("member", "change_password_date")) return true;
- // 비밀번호 찾기 질문/답변을 위한 추가
+ // Add columns of question and answer to verify a password
if(!$oDB->isColumnExists("member", "find_account_question")) return true;
if(!$oDB->isColumnExists("member", "find_account_answer")) return true;
@@ -160,24 +147,21 @@
}
/**
- * @brief 업데이트 실행
+ * @brief Execute update
**/
function moduleUpdate() {
$oDB = &DB::getInstance();
$oModuleController = &getController('module');
-
- // member 디렉토리 체크
+ // Check member directory
FileHandler::makeDir('./files/member_extra_info/image_name');
FileHandler::makeDir('./files/member_extra_info/image_mark');
FileHandler::makeDir('./files/member_extra_info/signature');
FileHandler::makeDir('./files/member_extra_info/profile_image');
-
- // DB 필드 추가
+ // Add a column
if (!$oDB->isColumnExists("member_auth_mail", "is_register")) {
$oDB->addColumn("member_auth_mail", "is_register", "char", 1, "N", true);
}
-
- // member_group_member 테이블에 site_srl 추가 (2008. 11. 15)
+ // Add a column(site_srl) to "member_group_member" table (11/15/2008)
if (!$oDB->isColumnExists("member_group_member", "site_srl")) {
$oDB->addColumn("member_group_member", "site_srl", "number", 11, 0, true);
$oDB->addIndex("member_group_member", "idx_site_srl", "site_srl", false);
@@ -189,19 +173,17 @@
if($oDB->isIndexExists("member_group","uni_member_group_title")) {
$oDB->dropIndex("member_group","uni_member_group_title",true);
}
-
- // image_mark 추가 (2009. 02. 14)
+ // Add a column for image_mark (02/14/2009)
if(!$oDB->isColumnExists("member_group", "image_mark")) {
$oDB->addColumn("member_group", "image_mark", "text");
}
-
- // password 유효기간을 위한 추가
+ // Add a column for password expiration date
if(!$oDB->isColumnExists("member", "change_password_date")) {
$oDB->addColumn("member", "change_password_date", "date");
executeQuery('member.updateAllChangePasswordDate');
}
- // 비밀번호 찾기 질문/답변을 위한 추가
+ // Add columns of question and answer to verify a password
if(!$oDB->isColumnExists("member", "find_account_question")) {
$oDB->addColumn("member", "find_account_question", "number", 11);
}
@@ -225,7 +207,7 @@
}
/**
- * @brief 캐시 파일 재생성
+ * @brief Re-generate the cache file
**/
function recompileCache() {
set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3");
diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php
index 26dd1560d..da539239b 100644
--- a/modules/member/member.controller.php
+++ b/modules/member/member.controller.php
@@ -2,22 +2,22 @@
/**
* @class memberController
* @author NHN (developers@xpressengine.com)
- * @brief member module의 Controller class
+ * @brief Controller class of member module
**/
class memberController extends member {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief user_id, password를 체크하여 로그인 시킴
+ * @brief Log-in by checking user_id and password
**/
function procMemberLogin($user_id = null, $password = null, $keep_signed = null) {
- // 변수 정리
+ // Variables
if(!$user_id) $user_id = Context::get('user_id');
$user_id = trim($user_id);
@@ -25,8 +25,7 @@
$password = trim($password);
if(!$keep_signed) $keep_signed = Context::get('keep_signed');
-
- // 아이디나 비밀번호가 없을때 오류 return
+ // Return an error when id and password doesn't exist
if(!$user_id) return new Object(-1,'null_user_id');
if(!$password) return new Object(-1,'null_password');
@@ -36,10 +35,10 @@
$config = $oModuleModel->getModuleConfig('member');
if($config->after_login_url) $this->setRedirectUrl($config->after_login_url);
- // 설정된 change_password_date 확인
+ // Check change_password_date
$limit_date = $config->change_password_date;
- // change_password_date가 설정되어 있으면 확인
+ // Check if change_password_date is set
if ($limit_date > 0) {
$oMemberModel = &getModel('member');
$member_info = $oMemberModel->getMemberInfoByUserID($user_id);
@@ -57,7 +56,7 @@
}
/**
- * @brief openid로그인
+ * @brief Login by openid
**/
function procMemberOpenIDLogin($validator = "procMemberOpenIDValidate") {
$oModuleModel = &getModel('module');
@@ -141,7 +140,7 @@
}
/**
- * @brief openid 인증 체크
+ * @brief openid authentication check
**/
function procMemberOpenIDValidate() {
set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3");
@@ -155,22 +154,20 @@
$response = $consumer->complete($_GET);
switch($response->status) {
case Auth_OpenID_CANCEL :
- // 사용자가 인증을 취소했을 때의 처리
+ // Handle if user authentication is canceled
return $this->stop('authorization_canceled');
case Auth_OpenID_FAILURE :
- // 무언가의 문제로 인해 인증이 실패했을 때의 처리(인증을 요구한 openid가 없다든가..)
+ // Handle if user authentication is failed due to a certain problem (for example, openid doesn't exist) (there is no authentication required deunga openid ..)
return $this->stop('invalid_authorization');
case Auth_OpenID_SUCCESS :
- // 인증성공!!
+ // Authentication success!
break;
default:
return $this->stop('invalid_authorization');
}
-
- // 인증 성공
+ // Authentication success
$oMemberModel = &getModel('member');
-
- // 이 오픈아이디와 연결된 (또는 연결되어 있을 가능성이 있는) 제로보드 아이디들을 받아온다.
+ // Get zeroboard ID which is corresponded to the openID ID.
$login_success = false;
$assoc_member_info = null;
$openid_identity = $response->signed_args["openid.identity"];
@@ -195,13 +192,12 @@
foreach($user_id_candidates as $user_id) {
$args->user_id = $args->nick_name = $user_id;
- // 기본 정보들을 받음
+ // Get basic information
$args->email_address = $sreg['email'];
$args->user_name = $sreg['fullname'];
if(!$args->user_name) list($args->user_name) = explode('@', $args->email_address);
$args->birthday = str_replace('-','',$sreg['dob']);
-
- // 자체 인증 시도
+ // Attempts self-authentication
$output = $this->doLogin($args->user_id);
if ($output->toBool()) {
@@ -215,8 +211,7 @@
break;
}
}
-
- // 자체 인증 실패시 회원 가입시킴
+ // Member join if self-authentication is failed
if(!$login_success) {
$args->user_id = $args->nick_name = $default_user_id;
$args->password = md5(getmicrotime());
@@ -233,8 +228,7 @@
}
Context::close();
-
- // 페이지 이동
+ // Move the page
if(Context::get('goto')) {
$goto = Context::get('goto');
header("location:" . $goto);
@@ -246,14 +240,14 @@
}
/**
- * @brief 오픈아이디 연결 요청
+ * @brief Request member join by openID
**/
function procMemberAddOpenIDToMember() {
return $this->procMemberOpenIDLogin("procMemberValidateAddOpenIDToMember");
}
/**
- * @brief 오픈아이디 연결 요청 마무리
+ * @brief Validate openID processing
**/
function procMemberValidateAddOpenIDToMember() {
set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3");
@@ -268,10 +262,10 @@
switch($response->status) {
case Auth_OpenID_CANCEL :
- // 사용자가 인증을 취소했을 때의 처리
+ // Handle if user authentication is canceled
return $this->stop('authorization_canceled');
case Auth_OpenID_FAILURE :
- // 무언가의 문제로 인해 인증이 실패했을 때의 처리(인증을 요구한 openid가 없다든가..)
+ // Handle if user authentication is failed due to a certain problem (for example, openid doesn't exist) (there is no authentication required deunga openid ..)
return $this->stop('invalid_authorization');
case Auth_OpenID_SUCCESS :
{
@@ -297,7 +291,7 @@
}
exit();
}
- // 인증성공!!
+ // Authentication success!
break;
default:
return $this->stop('invalid_authorization');
@@ -305,7 +299,7 @@
}
/**
- * @brief 오픈아이디 연결 해제
+ * @brief Disconnect OpenID
**/
function procMemberDeleteOpenIDFromMember() {
$logged_info = Context::get('logged_info');
@@ -337,18 +331,16 @@
/**
- * @brief 로그아웃
+ * @brief Log-out
**/
function procMemberLogout() {
- // 로그아웃 이전에 trigger 호출 (before)
+ // Call a trigger before log-out (before)
$logged_info = Context::get('logged_info');
$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info);
if(!$trigger_output->toBool()) return $trigger_output;
-
- // 세션 정보 파기
+ // Destroy session information
$this->destroySessionInfo();
-
- // 로그아웃 이후 trigger 호출 (after)
+ // Call a trigger after log-out (after)
$trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info);
if(!$trigger_output->toBool()) return $trigger_output;
@@ -362,22 +354,20 @@
}
/**
- * @brief 스크랩 기능
+ * @brief Scrap
**/
function procMemberScrapDocument() {
- // 로그인 정보 체크
+ // Check login information
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
$logged_info = Context::get('logged_info');
$document_srl = (int)Context::get('document_srl');
if(!$document_srl) $document_srl = (int)Context::get('target_srl');
if(!$document_srl) return new Object(-1,'msg_invalid_request');
-
- // 문서 가져오기
+ // Get document
$oDocumentModel = &getModel('document');
$oDocument = $oDocumentModel->getDocument($document_srl);
-
- // 변수 정리
+ // Variables
$args->document_srl = $document_srl;
$args->member_srl = $logged_info->member_srl;
$args->user_id = $oDocument->get('user_id');
@@ -385,12 +375,10 @@
$args->nick_name = $oDocument->get('nick_name');
$args->target_member_srl = $oDocument->get('member_srl');
$args->title = $oDocument->get('title');
-
- // 있는지 조사
+ // Check if already scrapped
$output = executeQuery('member.getScrapDocument', $args);
if($output->data->count) return new Object(-1, 'msg_alreay_scrapped');
-
- // 입력
+ // Insert
$output = executeQuery('member.addScrapDocument', $args);
if(!$output->toBool()) return $output;
@@ -399,63 +387,56 @@
}
/**
- * @brief 스크랩 삭제
+ * @brief Delete a scrap
**/
function procMemberDeleteScrap() {
- // 로그인 정보 체크
+ // Check login information
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
$logged_info = Context::get('logged_info');
$document_srl = (int)Context::get('document_srl');
if(!$document_srl) return new Object(-1,'msg_invalid_request');
-
- // 변수 정리
+ // Variables
$args->member_srl = $logged_info->member_srl;
$args->document_srl = $document_srl;
return executeQuery('member.deleteScrapDocument', $args);
}
/**
- * @brief 게시글 저장
+ * @brief Save posts
**/
function procMemberSaveDocument() {
- // 로그인 정보 체크
+ // Check login information
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
$logged_info = Context::get('logged_info');
-
- // form 정보를 모두 받음
+ // Get form information
$obj = Context::getRequestVars();
-
- // 글의 대상 모듈을 회원 정보로 변경
+ // Change the target module to log-in information
$obj->module_srl = $logged_info->member_srl;
unset($obj->is_notice);
- // 제목을 사용하지 않는 방명록 등에서 내용 앞 부분을 제목 가져오기
+ // Extract from beginning part of contents in the guestbook
if(!$obj->title) {
$obj->title = cut_str(strip_tags($obj->content), 20, '...');
}
$oDocumentModel = &getModel('document');
$oDocumentController = &getController('document');
-
- // 이미 존재하는 글인지 체크
+ // Check if already exist geulinji
$oDocument = $oDocumentModel->getDocument($obj->document_srl, $this->grant->manager);
-
- // 이미 존재하는 경우 수정
+ // Update if already exists
if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) {
$output = $oDocumentController->updateDocument($oDocument, $obj);
$msg_code = 'success_updated';
-
- // 그렇지 않으면 신규 등록
+ // Otherwise, get a new
} else {
$output = $oDocumentController->insertDocument($obj);
$msg_code = 'success_registed';
$obj->document_srl = $output->get('document_srl');
$oDocument = $oDocumentModel->getDocument($obj->document_srl, $this->grant->manager);
}
-
- // 등록된 첨부파일의 상태를 무효로 지정
+ // Set the attachment to be invalid state
if($oDocument->hasUploadedFiles()) {
$args->upload_target_srl = $oDocument->document_srl;
$args->isvalid = 'N';
@@ -467,23 +448,22 @@
}
/**
- * @brief 저장된 글 삭제
+ * @brief Delete the post
**/
function procMemberDeleteSavedDocument() {
- // 로그인 정보 체크
+ // Check login information
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
$logged_info = Context::get('logged_info');
$document_srl = (int)Context::get('document_srl');
if(!$document_srl) return new Object(-1,'msg_invalid_request');
-
- // 변수 정리
+ // Variables
$oDocumentController = &getController('document');
$oDocumentController->deleteDocument($document_srl, true);
}
/**
- * @brief 회원 가입시 특정 항목들에 대한 값 체크
+ * @brief Check values when member joining
**/
function procMemberCheckValue() {
$name = Context::get('name');
@@ -491,28 +471,26 @@
if(!$value) return;
$oMemberModel = &getModel('member');
-
- // 로그인 여부 체크
+ // Check if logged-in
$logged_info = Context::get('logged_info');
switch($name) {
case 'user_id' :
- // 금지 아이디 검사
+ // Check denied ID
if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id');
-
- // 중복 검사
+ // Check if duplicated
$member_srl = $oMemberModel->getMemberSrlByUserID($value);
if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_user_id');
break;
case 'nick_name' :
- // 중복 검사
+ // Check if duplicated
$member_srl = $oMemberModel->getMemberSrlByNickName($value);
if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_nick_name');
break;
case 'email_address' :
- // 중복 검사
+ // Check if duplicated
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($value);
if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address');
break;
@@ -520,29 +498,29 @@
}
/**
- * @brief 회원 가입
+ * @brief Join Membership
**/
function procMemberInsert() {
if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request");
$oMemberModel = &getModel ('member');
$config = $oMemberModel->getMemberConfig ();
- // before 트리거 호출
+ // call a trigger (before)
$trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config);
if (!$trigger_output->toBool ()) return $trigger_output;
- // 관리자가 회원가입을 허락하였는지 검사
+ // Check if an administrator allows a membership
if ($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled');
- // 약관에 동의하였는지 검사 (약관이 있을 경우만)
+ // Check if the user accept the license terms (only if terms exist)
if ($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement');
- // 필수 정보들을 미리 추출
+ // Extract the necessary information in advance
$args = Context::gets('user_id','user_name','nick_name','homepage','blog','birthday','email_address','password','allow_mailing','find_account_question','find_account_answer');
$args->member_srl = getNextSequence();
$args->list_order = -1 * $args->member_srl;
- // 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제
+ // Remove some unnecessary variables from all the vars
$all_args = Context::getRequestVars();
unset($all_args->module);
unset($all_args->act);
@@ -554,18 +532,15 @@
unset($all_args->signature);
unset($all_args->password2);
- // 메일 인증 기능 사용시 회원 상태를 denied로 설정
+ // Set the user state as "denied" when using mail authentication
if ($config->enable_confirm == 'Y') $args->denied = 'Y';
-
- // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력
+ // Add extra vars after excluding necessary information from all the requested arguments
$extra_vars = delObjectVars($all_args, $args);
$args->extra_vars = serialize($extra_vars);
-
- // member_srl의 값에 따라 insert/update
+ // Execute insert or update depending on the value of member_srl
$output = $this->insertMember($args);
if(!$output->toBool()) return $output;
-
- // 가상사이트일 경우 사이트 가입
+ // If a virtual site, join the site
$site_module_info = Context::get('site_module_info');
if($site_module_info->site_srl > 0) {
$default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl);
@@ -574,11 +549,9 @@
}
}
-
- // 로그인 시킴
+ // Log-in
if ($config->enable_confirm != 'Y') $this->doLogin($args->user_id);
-
- // 결과 정리
+ // Results
$this->add('member_srl', $args->member_srl);
if($config->redirect_url) $this->add('redirect_url', $config->redirect_url);
if ($config->enable_confirm == 'Y') {
@@ -586,26 +559,22 @@
$this->setMessage($msg);
}
else $this->setMessage('success_registed');
-
- // after 트리거 호출
+ // Call a trigger (after)
$trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config);
if(!$trigger_output->toBool()) return $trigger_output;
}
/**
- * @brief 회원 정보 수정
+ * @brief Edit member profile
**/
function procMemberModifyInfo() {
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
-
- // 필수 정보들을 미리 추출
+ // Extract the necessary information in advance
$args = Context::gets('user_name','nick_name','homepage','blog','birthday','email_address','allow_mailing','find_account_question','find_account_answer');
-
- // 로그인 정보
+ // Login Information
$logged_info = Context::get('logged_info');
$args->member_srl = $logged_info->member_srl;
-
- // 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제
+ // Remove some unnecessary variables from all the vars
$all_args = Context::getRequestVars();
unset($all_args->module);
unset($all_args->act);
@@ -617,62 +586,51 @@
unset($all_args->signature);
unset($all_args->_filter);
- // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력
+ // Add extra vars after excluding necessary information from all the requested arguments
$extra_vars = delObjectVars($all_args, $args);
$args->extra_vars = serialize($extra_vars);
-
- // 멤버 모델 객체 생성
+ // Create a member model object
$oMemberModel = &getModel('member');
-
- // member_srl의 값에 따라 insert/update
+ // Execute insert or update depending on the value of member_srl
$output = $this->updateMember($args);
if(!$output->toBool()) return $output;
-
- // 서명 저장
+ // Save Signature
$signature = Context::get('signature');
$this->putSignature($args->member_srl, $signature);
-
- // user_id 에 따른 정보 가져옴
+ // Get user_id information
$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
-
- // 로그인 성공후 trigger 호출 (after)
+ // Call a trigger after successfully log-in (after)
$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $member_info);
if(!$trigger_output->toBool()) return $trigger_output;
$this->setSessionInfo($member_info);
-
- // 결과 리턴
+ // Return result
$this->add('member_srl', $args->member_srl);
$this->setMessage('success_updated');
}
/**
- * @brief 회원 비밀번호 수정
+ * @brief Change the user password
**/
function procMemberModifyPassword() {
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
-
- // 필수 정보들을 미리 추출
+ // Extract the necessary information in advance
$current_password = trim(Context::get('current_password'));
$password = trim(Context::get('password'));
-
- // 로그인한 유저의 정보를 가져옴
+ // Get information of logged-in user
$logged_info = Context::get('logged_info');
$member_srl = $logged_info->member_srl;
-
- // member model 객체 생성
+ // Create a member model object
$oMemberModel = &getModel('member');
-
- // member_srl 에 따른 정보 가져옴
+ // Get information of member_srl
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
-
- // 현재 비밀번호가 맞는지 확인
+ // Verify the cuttent password
if(!$oMemberModel->isValidPassword($member_info->password, $current_password)) return new Object(-1, 'invalid_password');
- // 이전 비밀번호와 같은지 확인
+ // Check if a new password is as same as the previous password
if ($current_password == $password) return new Object(-1, 'invalid_new_password');
- // member_srl의 값에 따라 insert/update
+ // Execute insert or update depending on the value of member_srl
$args->member_srl = $member_srl;
$args->password = $password;
$output = $this->updateMemberPassword($args);
@@ -683,166 +641,141 @@
}
/**
- * @brief 탈퇴
+ * @brief Membership withdrawal
**/
function procMemberLeave() {
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
-
- // 필수 정보들을 미리 추출
+ // Extract the necessary information in advance
$password = trim(Context::get('password'));
-
- // 로그인한 유저의 정보를 가져옴
+ // Get information of logged-in user
$logged_info = Context::get('logged_info');
$member_srl = $logged_info->member_srl;
-
- // member model 객체 생성
+ // Create a member model object
$oMemberModel = &getModel('member');
-
- // member_srl 에 따른 정보 가져옴
+ // Get information of member_srl
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
-
- // 현재 비밀번호가 맞는지 확인
+ // Verify the cuttent password
if(!$oMemberModel->isValidPassword($member_info->password, $password)) return new Object(-1, 'invalid_password');
$output = $this->deleteMember($member_srl);
if(!$output->toBool()) return $output;
-
- // 모든 세션 정보 파기
+ // Destroy all session information
$this->destroySessionInfo();
-
- // 성공 메세지 리턴
+ // Return success message
$this->setMessage('success_leaved');
}
/**
- * @brief 오픈아이디 탈퇴
+ * @brief OpenID Withdrawal
**/
function procMemberOpenIDLeave() {
- // 비로그인 상태이면 에러
+ // Return an error if in the non-login state
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
-
- // 현재 ip와 세션 아이피 비교
+ // Compare the current IP with session IP
if($_SESSION['ipaddress']!=$_SERVER['REMOTE_ADDR']) return $this->stop('msg_not_permitted');
-
- // 로그인한 유저의 정보를 가져옴
+ // Get information of logged-in user
$logged_info = Context::get('logged_info');
$member_srl = $logged_info->member_srl;
$output = $this->deleteMember($member_srl);
if(!$output->toBool()) return $output;
-
- // 모든 세션 정보 파기
+ // Destroy all session information
$this->destroySessionInfo();
-
- // 성공 메세지 리턴
+ // Return success message
$this->setMessage('success_leaved');
}
/**
- * @brief 프로필 이미지 추가
+ * @brief Add a profile image
**/
function procMemberInsertProfileImage() {
- // 정상적으로 업로드 된 파일인지 검사
+ // Check if the file is successfully uploaded
$file = $_FILES['profile_image'];
if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image');
-
- // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시
+ // Ignore if member_srl is invalid or doesn't exist.
$member_srl = Context::get('member_srl');
if(!$member_srl) return $this->stop('msg_not_uploaded_profile_image');
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_profile_image');
-
- // 회원 모듈 설정에서 이미지 이름 사용 금지를 하였을 경우 관리자가 아니면 return;
+ // Return if member module is set not to use an image name or the user is not an administrator ;
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
if($logged_info->is_admin != 'Y' && $config->profile_image != 'Y') return $this->stop('msg_not_uploaded_profile_image');
$this->insertProfileImage($member_srl, $file['tmp_name']);
-
- // 페이지 리프레쉬
+ // Page refresh
$this->setRefreshPage();
}
function insertProfileImage($member_srl, $target_file) {
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
-
- // 정해진 사이즈를 구함
+ // Get an image size
$max_width = $config->profile_image_max_width;
if(!$max_width) $max_width = "90";
$max_height = $config->profile_image_max_height;
if(!$max_height) $max_height = "20";
-
- // 저장할 위치 구함
+ // Get a target path to save
$target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl));
FileHandler::makeDir($target_path);
-
- // 파일 정보 구함
+ // Get file information
list($width, $height, $type, $attrs) = @getimagesize($target_file);
if($type == 3) $ext = 'png';
elseif($type == 2) $ext = 'jpg';
else $ext = 'gif';
$target_filename = sprintf('%s%d.%s', $target_path, $member_srl, $ext);
-
- // 지정된 사이즈보다 크거나 gif가 아니면 변환
+ // Convert if the image size is larger than a given size or if the format is not a gif
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, $ext);
else @copy($target_file, $target_filename);
}
/**
- * @brief 이미지 이름을 추가
+ * @brief Add an image name
**/
function procMemberInsertImageName() {
- // 정상적으로 업로드 된 파일인지 검사
+ // Check if the file is successfully uploaded
$file = $_FILES['image_name'];
if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name');
-
- // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시
+ // Ignore if member_srl is invalid or doesn't exist.
$member_srl = Context::get('member_srl');
if(!$member_srl) return $this->stop('msg_not_uploaded_image_name');
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_name');
-
- // 회원 모듈 설정에서 이미지 이름 사용 금지를 하였을 경우 관리자가 아니면 return;
+ // Return if member module is set not to use an image name or the user is not an administrator ;
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
if($logged_info->is_admin != 'Y' && $config->image_name != 'Y') return $this->stop('msg_not_uploaded_image_name');
$this->insertImageName($member_srl, $file['tmp_name']);
-
- // 페이지 리프레쉬
+ // Page refresh
$this->setRefreshPage();
}
function insertImageName($member_srl, $target_file) {
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
-
- // 정해진 사이즈를 구함
+ // Get an image size
$max_width = $config->image_name_max_width;
if(!$max_width) $max_width = "90";
$max_height = $config->image_name_max_height;
if(!$max_height) $max_height = "20";
-
- // 저장할 위치 구함
+ // Get a target path to save
$target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($member_srl));
FileHandler::makeDir($target_path);
$target_filename = sprintf('%s%d.gif', $target_path, $member_srl);
-
- // 파일 정보 구함
+ // Get file information
list($width, $height, $type, $attrs) = @getimagesize($target_file);
-
- // 지정된 사이즈보다 크거나 gif가 아니면 변환
+ // Convert if the image size is larger than a given size or if the format is not a gif
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
else @copy($target_file, $target_filename);
}
/**
- * @brief 프로필 이미지를 삭제
+ * @brief Delete profile image
**/
function procMemberDeleteProfileImage() {
$member_srl = Context::get('member_srl');
@@ -865,7 +798,7 @@
}
/**
- * @brief 이미지 이름을 삭제
+ * @brief Delete Image name
**/
function procMemberDeleteImageName() {
$member_srl = Context::get('member_srl');
@@ -888,36 +821,32 @@
}
/**
- * @brief 이미지 마크를 추가
+ * @brief Add an image to mark
**/
function procMemberInsertImageMark() {
- // 정상적으로 업로드 된 파일인지 검사
+ // Check if the file is successfully uploaded
$file = $_FILES['image_mark'];
if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark');
-
- // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시
+ // Ignore if member_srl is invalid or doesn't exist.
$member_srl = Context::get('member_srl');
if(!$member_srl) return $this->stop('msg_not_uploaded_image_mark');
$logged_info = Context::get('logged_info');
if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_srl) return $this->stop('msg_not_uploaded_image_mark');
-
- // 회원 모듈 설정에서 이미지 마크 사용 금지를 하였을 경우 관리자가 아니면 return;
+ // Membership in the images mark the module using the ban was set by an administrator or return;
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
if($logged_info->is_admin != 'Y' && $config->image_mark != 'Y') return $this->stop('msg_not_uploaded_image_mark');
$this->insertImageMark($member_srl, $file['tmp_name']);
-
- // 페이지 리프레쉬
+ // Page refresh
$this->setRefreshPage();
}
function insertImageMark($member_srl, $target_file) {
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
-
- // 정해진 사이즈를 구함
+ // Get an image size
$max_width = $config->image_mark_max_width;
if(!$max_width) $max_width = "20";
$max_height = $config->image_mark_max_height;
@@ -927,8 +856,7 @@
FileHandler::makeDir($target_path);
$target_filename = sprintf('%s%d.gif', $target_path, $member_srl);
-
- // 파일 정보 구함
+ // Get file information
list($width, $height, $type, $attrs) = @getimagesize($target_file);
if($width > $max_width || $height > $max_height || $type!=1) FileHandler::createImageFile($target_file, $target_filename, $max_width, $max_height, 'gif');
@@ -937,7 +865,7 @@
}
/**
- * @brief 이미지 마크를 삭제
+ * @brief Delete Image Mark
**/
function procMemberDeleteImageMark() {
$member_srl = Context::get('member_srl');
@@ -953,7 +881,7 @@
}
/**
- * @brief 아이디/ 비밀번호 찾기
+ * @brief Find ID/Password
**/
function procMemberFindAccount() {
$email_address = Context::get('email_address');
@@ -961,22 +889,18 @@
$oMemberModel = &getModel('member');
$oModuleModel = &getModel('module');
-
- // 메일 주소에 해당하는 회원이 있는지 검사
+ // Check if a member having the same email address exists
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
-
- // 회원의 정보를 가져옴
+ // Get information of the member
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
-
- // 아이디/비밀번호 찾기가 가능한 상태의 회원인지 검사
+ // Check if possible to find member's ID and password
if ($member_info->denied == 'Y') {
$chk_args->member_srl = $member_info->member_srl;
$output = executeQuery('member.chkAuthMail', $chk_args);
if ($output->toBool() && $output->data->count != '0') return new Object(-1, 'msg_user_not_confirmed');
}
-
- // 인증 DB에 데이터를 넣음
+ // Insert data into the authentication DB
$args->user_id = $member_info->user_id;
$args->member_srl = $member_info->member_srl;
$args->new_password = rand(111111,999999);
@@ -985,8 +909,7 @@
$output = executeQuery('member.insertAuthMail', $args);
if(!$output->toBool()) return $output;
-
- // 메일 내용을 구함
+ // Get content of the email to send a member
Context::set('auth_args', $args);
Context::set('member_info', $member_info);
@@ -1004,27 +927,24 @@
$oTemplate = &TemplateHandler::getInstance();
$content = $oTemplate->compile($tpl_path, 'find_member_account_mail');
-
- // 사이트 웹마스터 정보를 구함
+ // Get information of the Webmaster
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
-
- // 메일 발송
+ // Send a mail
$oMail = new Mail();
$oMail->setTitle( Context::getLang('msg_find_account_title') );
$oMail->setContent($content);
$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
$oMail->send();
-
- // 메세지 return
+ // Return message
$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
return new Object(0,$msg);
}
/**
- * @brief 질문/답변을 통한 임시 비밀번호 생성
+ * @brief Generate a temp password by answering to the pre-determined question
**/
function procMemberFindAccountByQuestion() {
$email_address = Context::get('email_address');
@@ -1036,20 +956,18 @@
$oMemberModel = &getModel('member');
$oModuleModel = &getModel('module');
-
- // 메일 주소에 해당하는 회원이 있는지 검사
+ // Check if a member having the same email address exists
$member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address);
if(!$member_srl) return new Object(-1, 'msg_email_not_exists');
-
- // 회원의 정보를 가져옴
+ // Get information of the member
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
- // 질문 응답이 없으면
+ // Display a message if no answer is entered
if (!$member_info->find_account_question || !$member_info->find_account_answer) return new Object(-1, 'msg_question_not_exists');
if(trim($member_info->find_account_question) != $find_account_question || trim($member_info->find_account_answer) != $find_account_answer) return new Object(-1, 'msg_answer_not_matches');
- // 임시비밀번호로 변경 및 비밀번호 변경시간을 1로 설정
+ // Update to a temporary password and set change_password_date to 1
$args->member_srl = $member_srl;
list($usec, $sec) = explode(" ", microtime());
$temp_password = substr(md5($user_id . $member_info->find_account_answer. $usec . $sec),0,15);
@@ -1065,22 +983,20 @@
}
/**
- * @brief 아이디/비밀번호 찾기 기능 실행
- * 메일에 등록된 링크를 선택시 호출되는 method로 비밀번호를 바꾸고 인증을 시켜버림
+ * @brief Execute finding ID/Passoword
+ * When clicking the link in the verification email, a method is called to change the old password and to authenticate it
**/
function procMemberAuthAccount() {
- // user_id, authkey 검사
+ // Test user_id and authkey
$member_srl = Context::get('member_srl');
$auth_key = Context::get('auth_key');
if(!$member_srl || !$auth_key) return $this->stop('msg_invalid_request');
-
- // user_id, authkey로 비밀번호 찾기 로그 검사
+ // Test logs for finding password by user_id and authkey
$args->member_srl = $member_srl;
$args->auth_key = $auth_key;
$output = executeQuery('member.getAuthMail', $args);
if(!$output->toBool() || $output->data->auth_key != $auth_key) return $this->stop('msg_invalid_auth_key');
-
- // 인증 정보가 맞다면 새비밀번호로 비밀번호를 바꿈
+ // If credentials are correct, change the password to a new one
if ($output->data->is_register == 'Y') {
$args->password = $output->data->new_password;
$args->denied = 'N';
@@ -1088,44 +1004,38 @@
$args->password = md5($output->data->new_password);
unset($args->denied);
}
-
- // $output->data->is_register 값을 백업해 둔다.
+ // Back up the value of $Output->data->is_register
$is_register = $output->data->is_register;
$output = executeQuery('member.updateMemberPassword', $args);
if(!$output->toBool()) return $this->stop($output->getMessage());
-
- // 인증 테이블에서 member_srl에 해당하는 모든 값을 지움
+ // Remove all values having the member_srl from authentication table
executeQuery('member.deleteAuthMail',$args);
-
- // 결과를 통보
+ // Notify the result
Context::set('is_register', $is_register);
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('msg_success_authed');
}
/**
- * @brief 아이디/비밀번호 찾기 기능 실행
- * 메일에 등록된 링크를 선택시 호출되는 method로 비밀번호를 바꾸고 인증을 시켜버림
+ * @brief Execute finding ID/Passoword
+ * When clicking the link in the verification email, a method is called to change the old password and to authenticate it
**/
function procMemberUpdateAuthMail() {
$member_srl = Context::get('member_srl');
if(!$member_srl) return new Object(-1, 'msg_invalid_request');
$oMemberModel = &getModel('member');
-
- // 회원의 정보를 가져옴
+ // Get information of the member
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
-
- // 인증메일 재발송 요청이 가능한 상태의 회원인지 검사
+ // Check if the member is set to allow a request to re-send an authentication mail
if ($member_info->denied != 'Y')
return new Object(-1, 'msg_invalid_request');
$chk_args->member_srl = $member_srl;
$output = executeQuery('member.chkAuthMail', $chk_args);
if ($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
-
- // 인증 DB에 데이터를 넣음
+ // Insert data into the authentication DB
$auth_args->member_srl = $member_srl;
$auth_args->auth_key = md5(rand(0, 999999));
@@ -1134,8 +1044,7 @@
$oDB->rollback();
return $output;
}
-
- // 메일 내용을 구함
+ // Get content of the email to send a member
Context::set('auth_args', $auth_args);
Context::set('member_info', $member_info);
@@ -1154,33 +1063,29 @@
$oTemplate = &TemplateHandler::getInstance();
$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
-
- // 사이트 웹마스터 정보를 구함
+ // Get information of the Webmaster
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
-
- // 메일 발송
+ // Send a mail
$oMail = new Mail();
$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
$oMail->setContent($content);
$oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email);
$oMail->setReceiptor( $member_info->user_name, $member_info->email_address );
$oMail->send();
-
- // 메세지 return
+ // Return message
$msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address);
return new Object(-1, $msg);
}
/**
- * @brief 인증 메일 재발송
+ * @brief Request to re-send the authentication mail
**/
function procMemberResendAuthMail() {
- // email_address 검사
+ // Get an email_address
$email_address = Context::get('email_address');
if(!$email_address) return $this->stop('msg_invalid_request');
-
- // email_address로 비밀번호 찾기 로그 검사
+ // Log test by using email_address
$oMemberModel = &getModel('member');
$args->email_address = $email_address;
@@ -1189,7 +1094,7 @@
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_info);
- // 이전에 인증 메일을 보냈는지 확인
+ // Check if a authentication mail has been sent previously
$chk_args->member_srl = $member_info->member_srl;
$output = executeQuery('member.chkAuthMail', $chk_args);
if($output->toBool() && $output->data->count == '0') return new Object(-1, 'msg_invalid_request');
@@ -1198,8 +1103,7 @@
$output = executeQueryArray('member.getAuthMailInfo', $auth_args);
if(!$output->data || !$output->data[0]->auth_key) return new Object(-1, 'msg_invalid_request');
$auth_info = $output->data[0];
-
- // 메일 내용을 구함
+ // Get content of the email to send a member
Context::set('member_info', $member_info);
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
@@ -1216,12 +1120,10 @@
$oTemplate = &TemplateHandler::getInstance();
$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
-
- // 사이트 웹마스터 정보를 구함
+ // Get information of the Webmaster
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
-
- // 메일 발송
+ // Send a mail
$oMail = new Mail();
$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
$oMail->setContent($content);
@@ -1234,7 +1136,7 @@
}
/**
- * @brief 가상 사이트 가입
+ * @brief Join a virtual site
**/
function procModuleSiteSignUp() {
$site_module_info = Context::get('site_module_info');
@@ -1249,7 +1151,7 @@
}
/**
- * @brief 가상 사이트 탈퇴
+ * @brief Leave the virtual site
**/
function procModuleSiteLeave() {
$site_module_info = Context::get('site_module_info');
@@ -1264,7 +1166,7 @@
}
/**
- * @brief 회원 설정 정보를 저장
+ * @brief Save the member configurations
**/
function setMemberConfig($args) {
if(!$args->skin) $args->skin = "default";
@@ -1294,7 +1196,7 @@
}
/**
- * @brief 서명을 파일로 저장
+ * @brief Save the signature as a file
**/
function putSignature($member_srl, $signature) {
$signature = trim(removeHackTag($signature));
@@ -1312,7 +1214,7 @@
}
/**
- * @brief 서명 파일 삭제
+ * @brief Delete the signature file
**/
function delSignature($member_srl) {
$filename = sprintf('files/member_extra_info/signature/%s%d.gif', getNumberingPath($member_srl), $member_srl);
@@ -1320,7 +1222,7 @@
}
/**
- * @brief member_srl에 group_srl을 추가
+ * @brief Add group_srl to member_srl
**/
function addMemberToGroup($member_srl,$group_srl,$site_srl=0) {
$args->member_srl = $member_srl;
@@ -1331,7 +1233,7 @@
$groups = $oModel->getMemberGroups($member_srl, $site_srl, true);
if($groups[$group_srl]) return new Object();
- // 추가
+ // Add
$output = executeQuery('member.addMemberToGroup',$args);
$output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args);
@@ -1339,8 +1241,8 @@
}
/**
- * @brief 특정 회원들의 그룹을 일괄 변경
- * 가상 사이트와 같이 한 회원이 하나의 그룹만 가질 경우 사용할 수 있음
+ * @brief Change a group of certain members
+ * Available only when a member has a single group
**/
function replaceMemberGroup($args) {
$obj->site_srl = $args->site_srl;
@@ -1370,16 +1272,14 @@
/**
- * @brief 자동 로그인 시킴
+ * @brief Auto-login
**/
function doAutologin() {
- // 자동 로그인 키 값을 구함
+ // Get a key value of auto log-in
$args->autologin_key = $_COOKIE['xeak'];
-
- // 키값에 해당하는 정보 구함
+ // Get information of the key
$output = executeQuery('member.getAutologin', $args);
-
- // 정보가 없으면 쿠키 삭제
+ // If no information exists, delete a cookie
if(!$output->toBool() || !$output->data) {
setCookie('xeak',null,time()+60*60*24*365, '/');
return;
@@ -1394,17 +1294,17 @@
$do_auto_login = false;
- // 정보를 바탕으로 키값 비교
+ // Compare key values based on the information
$key = md5($user_id.$password.$_SERVER['REMOTE_ADDR']);
if($key == $args->autologin_key) {
- // 설정된 change_password_date 확인
+ // Check change_password_date
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
$limit_date = $member_config->change_password_date;
- // change_password_date가 설정되어 있으면 확인
+ // Check if change_password_date is set
if($limit_date > 0) {
$oMemberModel = &getModel('member');
$member_info = $oMemberModel->getMemberInfoByUserID($user_id);
@@ -1428,51 +1328,41 @@
}
/**
- * @brief 로그인 시킴
+ * @brief Log-in
**/
function doLogin($user_id, $password = '', $keep_signed = false) {
$user_id = strtolower($user_id);
-
- // 로그인 이전에 trigger 호출 (before)
+ // Call a trigger before log-in (before)
$trigger_obj->user_id = $user_id;
$trigger_obj->password = $password;
$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'before', $trigger_obj);
if(!$trigger_output->toBool()) return $trigger_output;
-
- // member model 객체 생성
+ // Create a member model object
$oMemberModel = &getModel('member');
-
- // user_id 에 따른 정보 가져옴
+ // Get user_id information
$member_info = $oMemberModel->getMemberInfoByUserID($user_id);
-
- // return 값이 없으면 존재하지 않는 사용자로 지정
+ // Set an invalid user if no value returned
if(!$user_id || strtolower($member_info->user_id) != strtolower($user_id)) return new Object(-1, 'invalid_user_id');
-
- // 비밀번호 검사
+ // Password Check
if($password && !$oMemberModel->isValidPassword($member_info->password, $password)) return new Object(-1, 'invalid_password');
-
- // denied == 'Y' 이면 알림
+ // If denied == 'Y', notify
if($member_info->denied == 'Y') {
$args->member_srl = $member_info->member_srl;
$output = executeQuery('member.chkAuthMail', $args);
if ($output->toBool() && $output->data->count != '0') return new Object(-1,'msg_user_not_confirmed');
return new Object(-1,'msg_user_denied');
}
-
- // denied_date가 현 시간보다 적으면 알림
+ // Notify if denied_date is less than the current time
if($member_info->limit_date && substr($member_info->limit_date,0,8) >= date("Ymd")) return new Object(-1,sprintf(Context::getLang('msg_user_limited'),zdate($member_info->limit_date,"Y-m-d")));
-
- // 사용자 정보의 최근 로그인 시간을 기록
+ // Update the latest login time
$args->member_srl = $member_info->member_srl;
$output = executeQuery('member.updateLastLogin', $args);
-
- // 로그인 성공후 trigger 호출 (after)
+ // Call a trigger after successfully log-in (after)
$trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $member_info);
if(!$trigger_output->toBool()) return $trigger_output;
-
- // 자동 로그인 사용시 정보 처리
+ // When user checked to use auto-login
if($keep_signed) {
- // 자동 로그인 키 생성
+ // Key generate for auto login
$autologin_args->autologin_key = md5(strtolower($user_id).$member_info->password.$_SERVER['REMOTE_ADDR']);
$autologin_args->member_srl = $member_info->member_srl;
executeQuery('member.deleteAutologin', $autologin_args);
@@ -1486,60 +1376,50 @@
}
/**
- * @brief 세션 정보 갱싱 또는 생성
+ * @brief Update or create session information
**/
function setSessionInfo($member_info = null) {
$oMemberModel = &getModel('member');
-
- // 사용자 정보가 넘어오지 않았다면 현재 세션 정보에서 사용자 정보를 추출
+ // If your information came through the current session information to extract information from the users
if(!$member_info && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) {
$member_info = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']);
-
- // 회원정보가 없다면 세션 파기
+ // If you do not destroy the session Profile
if($member_info->member_srl != $_SESSION['member_srl']) {
$this->destroySessionInfo();
return;
}
}
-
- // 사용중지 아이디이면 세션 파기
+ // Stop using the session id is destroyed
if($member_info->denied=='Y') {
$this->destroySessionInfo();
return;
}
-
- // 오픈아이디인지 체크 (일단 아이디 형식으로만 결정)
+ // OpenID is a check (only for a determined identity types)
if(preg_match("/^([_0-9a-zA-Z]+)$/is", $member_info->user_id)) $member_info->is_openid = false;
else $member_info->is_openid = true;
-
- // 로그인 처리를 위한 세션 설정
+ // Log in for treatment sessions set
$_SESSION['is_logged'] = true;
$_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR'];
$_SESSION['member_srl'] = $member_info->member_srl;
$_SESSION['is_admin'] = '';
-
- // 비밀번호는 세션에 저장되지 않도록 지워줌;;
+ // Do not save your password in the session jiwojum;;
//unset($member_info->password);
-
- // 사용자 그룹 설정
+ // User Group Settings
/*
if($member_info->group_list) {
$group_srl_list = array_keys($member_info->group_list);
$_SESSION['group_srls'] = $group_srl_list;
-
- // 관리자 그룹일 경우 관리자로 지정
+ // If the group is designated as an administrator administrator
$oMemberModel = &getModel('member');
$admin_group = $oMemberModel->getAdminGroup();
if($admin_group->group_srl && in_array($admin_group->group_srl, $group_srl_list)) $_SESSION['is_admin'] = 'Y';
}
*/
-
- // 세션에 로그인 사용자 정보 저장
+ // Information stored in the session login user
$_SESSION['logged_info'] = $member_info;
Context::set('is_logged', true);
Context::set('logged_info', $member_info);
-
- // 사용자의 전용 메뉴 구성 (이 메뉴는 애드온등으로 변경될 수 있음)
+ // Only the menu configuration of the user (such as an add-on to the menu can be changed)
$this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info');
$this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document');
$this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document');
@@ -1547,8 +1427,8 @@
}
/**
- * @brief 로그인한 사용자의 개인화된 메뉴 제공을 위한 method
- * 로그인 정보 출력 위젯 또는 개인화 페이지에서 사용됨
+ * @brief Logged method for providing a personalized menu
+ * Login information is used in the output widget, or personalized page
**/
function addMemberMenu($act, $str) {
$logged_info = Context::get('logged_info');
@@ -1560,7 +1440,7 @@
}
/**
- * @brief 로그인 회원의 닉네임등을 클릭할때 나타나는 팝업 메뉴를 추가하는 method
+ * @brief Nickname and click Log In to add a pop-up menu that appears when the method
**/
function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') {
$member_popup_menu_list = Context::get('member_popup_menu_list');
@@ -1576,26 +1456,22 @@
}
/**
- * @brief member 테이블에 사용자 추가
+ * @brief Add users to the member table
**/
function insertMember(&$args, $password_is_hashed = false) {
- // trigger 호출 (before)
+ // Call a trigger (before)
$output = ModuleHandler::triggerCall('member.insertMember', 'before', $args);
if(!$output->toBool()) return $output;
-
- // 멤버 설정 정보에서 가입약관 부분을 재확인
+ // Terms and Conditions portion of the information set up by members reaffirmed
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
$logged_info = Context::get('logged_info');
-
- // 임시 제한 일자가 있을 경우 제한 일자에 내용 추가
+ // If the date of the temporary restrictions limit further information on the date of
if($config->limit_day) $args->limit_date = date("YmdHis", time()+$config->limit_day*60*60*24);
-
- // 입력할 사용자의 아이디를 소문자로 변경
+ // Enter the user's identity changed to lowercase
$args->user_id = strtolower($args->user_id);
-
- // 필수 변수들의 조절
+ // Control of essential parameters
if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
if($args->denied!='Y') $args->denied = 'N';
$args->allow_message= 'Y';
@@ -1607,17 +1483,14 @@
}
list($args->email_id, $args->email_host) = explode('@', $args->email_address);
-
- // 홈페이지, 블로그의 주소 검사
+ // Website, blog, checks the address
if($args->homepage && !preg_match("/^[a-z]+:\/\//i",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
if($args->blog && !preg_match("/^[a-z]+:\/\//i",$args->blog)) $args->blog = 'http://'.$args->blog;
-
- // 모델 객체 생성
+ // Create a model object
$oMemberModel = &getModel('member');
- // 금지 아이디인지 체크
+ // ID check is prohibited
if($oMemberModel->isDeniedID($args->user_id)) return new Object(-1,'denied_user_id');
-
- // 아이디, 닉네임, email address 의 중복 체크
+ // ID, nickname, email address of the redundancy check
$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
if($member_srl) return new Object(-1,'msg_exists_user_id');
@@ -1629,8 +1502,7 @@
$oDB = &DB::getInstance();
$oDB->begin();
-
- // DB에 입력
+ // Insert data into the DB
$args->member_srl = getNextSequence();
$args->list_order = -1 * $args->member_srl;
if($args->password && !$password_is_hashed) $args->password = md5($args->password);
@@ -1641,19 +1513,16 @@
$oDB->rollback();
return $output;
}
-
- // 입력된 그룹 값이 없으면 기본 그룹의 값을 등록
+ // If no value is entered the default group, the value of group registration
if(!$args->group_srl_list) {
$default_group = $oMemberModel->getDefaultGroup(0);
-
- // 기본 그룹에 추가
+ // Add to the default group
$output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
-
- // 입력된 그룹 값이 있으면 해당 그룹의 값을 등록
+ // If the value is the value of the group entered the group registration
} else {
$group_srl_list = explode('|@|', $args->group_srl_list);
for($i=0;$idenied == 'Y') {
- // 인증 DB에 데이터를 넣음
+ // Insert data into the authentication DB
$auth_args->user_id = $args->user_id;
$auth_args->member_srl = $args->member_srl;
$auth_args->new_password = $args->password;
@@ -1680,8 +1548,7 @@
$oDB->rollback();
return $output;
}
-
- // 메일 내용을 구함
+ // Get content of the email to send a member
Context::set('auth_args', $auth_args);
Context::set('member_info', $args);
@@ -1699,12 +1566,10 @@
$oTemplate = &TemplateHandler::getInstance();
$content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail');
-
- // 사이트 웹마스터 정보를 구함
+ // Get information of the Webmaster
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
-
- // 메일 발송
+ // Send a mail
$oMail = new Mail();
$oMail->setTitle( Context::getLang('msg_confirm_account_title') );
$oMail->setContent($content);
@@ -1712,8 +1577,7 @@
$oMail->setReceiptor( $args->user_name, $args->email_address );
$oMail->send();
}
-
- // trigger 호출 (after)
+ // Call a trigger (after)
if($output->toBool()) {
$trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args);
if(!$trigger_output->toBool()) {
@@ -1729,23 +1593,20 @@
}
/**
- * @brief member 정보 수정
+ * @brief Modify member information
**/
function updateMember($args) {
- // trigger 호출 (before)
+ // Call a trigger (before)
$output = ModuleHandler::triggerCall('member.updateMember', 'before', $args);
if(!$output->toBool()) return $output;
-
- // 모델 객체 생성
+ // Create a model object
$oMemberModel = &getModel('member');
$logged_info = Context::get('logged_info');
-
- // 수정하려는 대상의 원래 정보 가져오기
+ // Get what you want to modify the original information
$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
if(!$args->user_id) $args->user_id = $member_info->user_id;
-
- // 필수 변수들의 조절
+ // Control of essential parameters
if($args->allow_mailing!='Y') $args->allow_mailing = 'N';
if($args->allow_message && !in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y';
@@ -1758,12 +1619,10 @@
}
list($args->email_id, $args->email_host) = explode('@', $args->email_address);
-
- // 홈페이지, 블로그의 주소 검사
+ // Website, blog, checks the address
if($args->homepage && !preg_match("/^[a-z]+:\/\//is",$args->homepage)) $args->homepage = 'http://'.$args->homepage;
if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog;
-
- // 아이디, 닉네임, email address 의 중복 체크
+ // ID, nickname, email address of the redundancy check
$member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id);
if($member_srl&&$args->member_srl!=$member_srl) return new Object(-1,'msg_exists_user_id');
@@ -1775,8 +1634,7 @@
$oDB = &DB::getInstance();
$oDB->begin();
-
- // DB에 update
+ // DB in the update
if($args->password) $args->password = md5($args->password);
else $args->password = $member_info->password;
if(!$args->user_name) $args->user_name = $member_info->user_name;
@@ -1787,20 +1645,17 @@
$oDB->rollback();
return $output;
}
-
- // 그룹 정보가 있으면 그룹 정보를 변경
+ // If the group information, group information changes
if($args->group_srl_list) {
$group_srl_list = explode('|@|', $args->group_srl_list);
$args->site_srl = 0;
-
- // 일단 해당 회원의 모든 그룹 정보를 삭제
+ // One of its members to delete all the group
$output = executeQuery('member.deleteMemberGroupMember', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
-
- // 하나 하나 루프를 돌면서 입력
+ // Enter one of the loop a
for($i=0;$iaddMemberToGroup($args->member_srl,$group_srl_list[$i]);
if(!$output->toBool()) {
@@ -1809,8 +1664,7 @@
}
}
}
-
- // trigger 호출 (after)
+ // Call a trigger (after)
if($output->toBool()) {
$trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args);
if(!$trigger_output->toBool()) {
@@ -1820,8 +1674,7 @@
}
$oDB->commit();
-
- // 세션에 저장
+ // Save Session
$member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl);
$logged_info = Context::get('logged_info');
@@ -1834,7 +1687,7 @@
}
/**
- * @brief member 비밀번호 수정
+ * @brief Modify member password
**/
function updateMemberPassword($args) {
$output = executeQuery('member.updateChangePasswordDate', $args);
@@ -1843,61 +1696,53 @@
}
/**
- * @brief 사용자 삭제
+ * @brief Delete User
**/
function deleteMember($member_srl) {
- // trigger 호출 (before)
+ // Call a trigger (before)
$trigger_obj->member_srl = $member_srl;
$output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj);
if(!$output->toBool()) return $output;
-
- // 모델 객체 생성
+ // Create a model object
$oMemberModel = &getModel('member');
-
- // 해당 사용자의 정보를 가져옴
+ // Bringing the user's information
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
if(!$member_info) return new Object(-1, 'msg_not_exists_member');
-
- // 관리자의 경우 삭제 불가능
+ // If managers can not be deleted
if($member_info->is_admin == 'Y') return new Object(-1, 'msg_cannot_delete_admin');
$oDB = &DB::getInstance();
$oDB->begin();
$args->member_srl = $member_srl;
- // member_auth_mail에서 해당 항목들 삭제
+ // Delete the entries in member_auth_mail
$output = executeQuery('member.deleteAuthMail', $args);
if (!$output->toBool()) {
$oDB->rollback();
return $output;
}
-
- // member_openid에서 해당 항목들 삭제
+ // Delete the entries in member_openid
$output = executeQuery('member.deleteMemberOpenIDByMemberSrl', $ags);
-
- // TODO: 테이블 업그레이드를 하지 않은 경우에 실패할 수 있다.
+ // TODO: If the table is not an upgrade may fail.
/*
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
*/
-
- // member_group_member에서 해당 항목들 삭제
+ // Delete the entries in member_group_member
$output = executeQuery('member.deleteMemberGroupMember', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
-
- // member 테이블에서 삭제
+ // member removed from the table
$output = executeQuery('member.deleteMember', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
-
- // trigger 호출 (after)
+ // Call a trigger (after)
if($output->toBool()) {
$trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj);
if(!$trigger_output->toBool()) {
@@ -1907,8 +1752,7 @@
}
$oDB->commit();
-
- // 이름이미지, 이미지마크, 서명 삭제
+ // Name, image, image, mark, sign, delete
$this->procMemberDeleteImageName();
$this->procMemberDeleteImageMark();
$this->delSignature($member_srl);
@@ -1917,7 +1761,7 @@
}
/**
- * @brief 모든 세션 정보 파기
+ * @brief Destroy all session information
**/
function destroySessionInfo() {
if(!$_SESSION || !is_array($_SESSION)) return;
diff --git a/modules/member/member.mobile.php b/modules/member/member.mobile.php
index 990179938..3a67c783f 100644
--- a/modules/member/member.mobile.php
+++ b/modules/member/member.mobile.php
@@ -3,7 +3,7 @@
class memberMobile extends member
{
function init() {
- // 회원 관리 정보를 받음
+ // Get the member configuration
$oModuleModel = &getModel('module');
$this->member_config = $oModuleModel->getModuleConfig('member');
@@ -20,7 +20,7 @@ class memberMobile extends member
return;
}
- // 템플릿 파일 지정
+ // Set a template file
Context::set('referer_url', $_SERVER['HTTP_REFERER']);
$this->setTemplateFile('login_form');
@@ -47,7 +47,7 @@ class memberMobile extends member
$oMemberModel = &getModel('member');
$logged_info = Context::get('logged_info');
- // 비회원일 경우 정보 열람 중지
+ // Don't display member info to non-logged user
if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
$member_srl = Context::get('member_srl');
if(!$member_srl && Context::get('is_logged')) {
@@ -73,14 +73,14 @@ class memberMobile extends member
}
/**
- * @brief 회원 정보 수정
+ * @brief Edit member profile
**/
function dispMemberModifyInfo() {
$oMemberModel = &getModel('member');
$oModuleModel = &getModel('module');
$memberModuleConfig = $oModuleModel->getModuleConfig('member');
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -90,12 +90,12 @@ class memberMobile extends member
$member_info->signature = $oMemberModel->getSignature($member_srl);
Context::set('member_info',$member_info);
- // 추가 가입폼 목록을 받음
+ // Receive a member join form
Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info));
Context::set('openids', $oMemberModel->getMemberOpenIDByMemberSrl($member_srl));
- // 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅
+ // Call getEditor of the editor module and set it for signiture
if($member_info->member_srl) {
$oEditorModel = &getModel('editor');
$option->primary_key_name = 'member_srl';
@@ -113,17 +113,17 @@ class memberMobile extends member
Context::set('editor', $editor);
}
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('modify_info');
}
/**
- * @brief 회원 비밀번호 수정
+ * @brief Change the user password
**/
function dispMemberModifyPassword() {
$oMemberModel = &getModel('member');
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -132,17 +132,17 @@ class memberMobile extends member
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
Context::set('member_info',$member_info);
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('modify_password');
}
/**
- * @brief 탈퇴 화면
+ * @brief Member withdrawl
**/
function dispMemberLeave() {
$oMemberModel = &getModel('member');
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -151,7 +151,7 @@ class memberMobile extends member
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
Context::set('member_info',$member_info);
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('leave_form');
}
}
diff --git a/modules/member/member.model.php b/modules/member/member.model.php
index e495cd87d..1012da27e 100644
--- a/modules/member/member.model.php
+++ b/modules/member/member.model.php
@@ -2,31 +2,30 @@
/**
* @class memberModel
* @author NHN (developers@xpressengine.com)
- * @brief member module의 Model class
+ * @brief Model class of the member module
**/
class memberModel extends member {
/**
- * @brief 자주 호출될거라 예상되는 데이터는 내부적으로 가지고 있자...
+ * @brief Keep data internally which may be frequently called ...
**/
var $join_form_list = NULL;
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 회원 설정 정보를 return
+ * @brief Return member's configuration
**/
function getMemberConfig() {
- // DB에 저장되는 회원 설정 정보 구함
+ // Get member configuration stored in the DB
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('member');
-
- // 회원가입 약관 구함
+ // Get terms of user
$agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt';
if(file_exists($agreement_file)) $config->agreement = FileHandler::readFile($agreement_file);
@@ -45,62 +44,52 @@
}
/**
- * @brief 선택된 회원의 간단한 메뉴를 표시
+ * @brief Display menus of the member
**/
function getMemberMenu() {
- // 요청된 회원 번호와 현재 사용자의 로그인 정보 구함
+ // Get member_srl of he target member and logged info of the current user
$member_srl = Context::get('target_srl');
$mid = Context::get('cur_mid');
$logged_info = Context::get('logged_info');
$act = Context::get('cur_act');
-
- // 자신의 아이디를 클릭한 경우
+ // When click user's own nickname
if($member_srl == $logged_info->member_srl) $member_info = $logged_info;
-
- // 다른 사람의 아이디를 클릭한 경우
+ // When click other's nickname
else $member_info = $this->getMemberInfoByMemberSrl($member_srl);
$member_srl = $member_info->member_srl;
if(!$member_srl) return;
-
- // 변수 정리
+ // List variables
$user_id = $member_info->user_id;
$user_name = $member_info->user_name;
ModuleHandler::triggerCall('member.getMemberMenu', 'before', $null);
$oMemberController = &getController('member');
-
- // 회원 정보 보기 (비회원일 경우 볼 수 없도록 수정)
+ // Display member information (Don't display to non-logged user)
if($logged_info->member_srl) {
$url = getUrl('','mid',$mid,'act','dispMemberInfo','member_srl',$member_srl);
$icon_path = './modules/member/tpl/images/icon_view_info.gif';
$oMemberController->addMemberPopupMenu($url,'cmd_view_member_info',$icon_path,'self');
}
-
- // 다른 사람의 아이디를 클릭한 경우
+ // When click other's nickname
if($member_srl != $logged_info->member_srl) {
-
- // 메일 보내기
+ // Send an email
if($member_info->email_address) {
$url = 'mailto:'.htmlspecialchars($member_info->email_address);
$icon_path = './modules/member/tpl/images/icon_sendmail.gif';
$oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path);
}
}
-
- // 홈페이지 보기
+ // View homepage info
if($member_info->homepage)
$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage), 'homepage', './modules/member/tpl/images/icon_homepage.gif','blank');
-
- // 블로그 보기
+ // View blog info
if($member_info->blog)
$oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog), 'blog', './modules/member/tpl/images/icon_blog.gif','blank');
-
- // trigger 호출 (after)
+ // Call a trigger (after)
ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null);
-
- // 최고 관리자라면 회원정보 수정 메뉴 만듬
+ // Display a menu for editting member info to a top administrator
if($logged_info->is_admin == 'Y') {
$url = getUrl('','module','admin','act','dispMemberAdminInsert','member_srl',$member_srl);
$icon_path = './modules/member/tpl/images/icon_management.gif';
@@ -114,20 +103,18 @@
$icon_path = './modules/member/tpl/images/icon_trace_comment.gif';
$oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment');
}
-
- // 팝업메뉴의 언어 변경
+ // Change a language of pop-up menu
$menus = Context::get('member_popup_menu_list');
$menus_count = count($menus);
for($i=0;$i<$menus_count;$i++) {
$menus[$i]->str = Context::getLang($menus[$i]->str);
}
-
- // 최종적으로 정리된 팝업메뉴 목록을 구함
+ // Get a list of finalized pop-up menu
$this->add('menus', $menus);
}
/**
- * @brief 로그인 되어 있는지에 대한 체크
+ * @brief Check if logged-in
**/
function isLogged() {
if($_SESSION['is_logged']&&$_SESSION['ipaddress']==$_SERVER['REMOTE_ADDR']) return true;
@@ -138,24 +125,22 @@
}
/**
- * @brief 인증된 사용자의 정보 return
+ * @brief Return session information of the logged-in user
**/
function getLoggedInfo() {
- // 로그인 되어 있고 세션 정보를 요청하면 세션 정보를 return
+ // Return session info if session info is requested and the user is logged-in
if($this->isLogged()) {
$logged_info = $_SESSION['logged_info'];
-
- // site_module_info에 따라서 관리자/ 그룹 목록을 매번 재지정
+ // Admin/Group list defined depending on site_module_info
$site_module_info = Context::get('site_module_info');
if($site_module_info->site_srl) {
$logged_info->group_list = $this->getMemberGroups($logged_info->member_srl, $site_module_info->site_srl);
-
- // 사이트 관리자이면 로그인 정보에 is_site_admin bool변수를 추가
+ // Add is_site_admin bool variable into logged_info if site_administrator is
$oModuleModel = &getModel('module');
if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true;
else $logged_info->is_site_admin = false;
} else {
- // 만약 기본 사이트인데 회원 그룹이 존재하지 않으면 등록
+ // Register a default group if the site doesn't have a member group
if(!count($logged_info->group_list)) {
$default_group = $this->getDefaultGroup(0);
$oMemberController = &getController('member');
@@ -175,7 +160,7 @@
}
/**
- * @brief user_id에 해당하는 사용자 정보 return
+ * @brief Return member information with user_id
**/
function getMemberInfoByUserID($user_id) {
if(!$user_id) return;
@@ -191,7 +176,7 @@
}
/**
- * @brief member_srl로 사용자 정보 return
+ * @brief Return member information with member_srl
**/
function getMemberInfoByMemberSrl($member_srl, $site_srl = 0) {
if(!$member_srl) return;
@@ -208,7 +193,7 @@
}
/**
- * @brief 사용자 정보 중 extra_vars와 기타 정보를 알맞게 편집
+ * @brief Add member info from extra_vars and other information
**/
function arrangeMemberInfo($info, $site_srl = 0) {
if(!$GLOBALS['__member_info__'][$info->member_srl]) {
@@ -241,7 +226,7 @@
}
/**
- * @brief userid에 해당하는 member_srl을 구함
+ * @brief Get member_srl corresponding to userid
**/
function getMemberSrlByUserID($user_id) {
$args->user_id = $user_id;
@@ -250,7 +235,7 @@
}
/**
- * @brief EmailAddress에 해당하는 member_srl을 구함
+ * @brief Get member_srl corresponding to EmailAddress
**/
function getMemberSrlByEmailAddress($email_address) {
$args->email_address = $email_address;
@@ -259,7 +244,7 @@
}
/**
- * @brief NickName에 해당하는 member_srl을 구함
+ * @brief Get member_srl corresponding to nickname
**/
function getMemberSrlByNickName($nick_name) {
$args->nick_name = $nick_name;
@@ -268,7 +253,7 @@
}
/**
- * @brief 현재 접속자의 member_srl을 return
+ * @brief Return member_srl of the current logged-in user
**/
function getLoggedMemberSrl() {
if(!$this->isLogged()) return;
@@ -276,7 +261,7 @@
}
/**
- * @brief 현재 접속자의 user_id을 return
+ * @brief Return user_id of the current logged-in user
**/
function getLoggedUserID() {
if(!$this->isLogged()) return;
@@ -285,7 +270,7 @@
}
/**
- * @brief member_srl이 속한 group 목록을 가져옴
+ * @brief Get a list of groups which the member_srl belongs to
**/
function getMemberGroups($member_srl, $site_srl = 0, $force_reload = false) {
static $member_groups = array();
@@ -307,7 +292,7 @@
}
/**
- * @brief member_srl들이 속한 group 목록을 가져옴
+ * @brief Get a list of groups which member_srls belong to
**/
function getMembersGroups($member_srls, $site_srl = 0) {
$args->member_srls = implode(',',$member_srls);
@@ -323,7 +308,7 @@
}
/**
- * @brief 기본 그룹을 가져옴
+ * @brief Get a default group
**/
function getDefaultGroup($site_srl = 0) {
$args->site_srl = $site_srl;
@@ -332,7 +317,7 @@
}
/**
- * @brief 관리자 그룹을 가져옴
+ * @brief Get an admin group
**/
function getAdminGroup() {
$output = executeQuery('member.getAdminGroup');
@@ -340,7 +325,7 @@
}
/**
- * @brief group_srl에 해당하는 그룹 정보 가져옴
+ * @brief Get group info corresponding to group_srl
**/
function getGroup($group_srl) {
$args->group_srl = $group_srl;
@@ -349,7 +334,7 @@
}
/**
- * @brief 그룹 목록을 가져옴
+ * @brief Get a list of groups
**/
function getGroups($site_srl = 0) {
if(!$GLOBALS['__group_info__'][$site_srl]) {
@@ -370,28 +355,25 @@
}
/**
- * @brief 회원 가입폼 추가 확장 목록 가져오기
+ * @brief Get a list of member join forms
*
- * 이 메소드는 modules/member/tpl/filter/insert.xml 의 extend_filter로 동작을 한다.
- * extend_filter로 사용을 하기 위해서는 인자값으로 boolean값을 받도록 규정한다.
- * 이 인자값이 true일 경우 filter 타입에 맞는 형태의 object로 결과를 return하여야 한다.
+ * This method works as an extend filter of modules/member/tpl/filter/insert.xml.
+ * To use as extend_filter, the argument should be boolean.
+ * When the argument is true, it returns object result in type of filter.
**/
function getJoinFormList($filter_response = false) {
global $lang;
-
- // 최고관리자는 무시하도록 설정
+ // Set to ignore if a super administrator.
$logged_info = Context::get('logged_info');
if(!$this->join_form_list) {
- // list_order 컬럼의 정렬을 위한 인자 세팅
+ // Argument setting to sort list_order column
$args->sort_index = "list_order";
$output = executeQuery('member.getJoinFormList', $args);
-
- // 결과 데이터가 없으면 NULL return
+ // NULL if output data deosn't exist
$join_form_list = $output->data;
if(!$join_form_list) return NULL;
-
- // default_value의 경우 DB에 array가 serialize되어 입력되므로 unserialize가 필요
+ // Need to unserialize because serialized array is inserted into DB in case of default_value
if(!is_array($join_form_list)) $join_form_list = array($join_form_list);
$join_form_count = count($join_form_list);
for($i=0;$i<$join_form_count;$i++) {
@@ -402,11 +384,9 @@
$column_name = $join_form_list[$i]->column_name;
$column_title = $join_form_list[$i]->column_title;
$default_value = $join_form_list[$i]->default_value;
-
- // 언어변수에 추가
+ // Add language variable
$lang->extend_vars[$column_name] = $column_title;
-
- // checkbox, select등 다수 데이터 형식일 경우 unserialize해줌
+ // unserialize if the data type if checkbox, select and so on
if(in_array($column_type, array('checkbox','select','radio'))) {
$join_form_list[$i]->default_value = unserialize($default_value);
if(!$join_form_list[$i]->default_value[0]) $join_form_list[$i]->default_value = '';
@@ -418,8 +398,7 @@
}
$this->join_form_list = $list;
}
-
- // filter_response가 true일 경우 object 스타일을 구함
+ // Get object style if the filter_response is true
if($filter_response && count($this->join_form_list)) {
foreach($this->join_form_list as $key => $val) {
@@ -441,19 +420,17 @@
return $filter_output;
}
-
- // 결과 리턴
+ // Return the result
return $this->join_form_list;
}
/**
- * @brief 추가 회원가입폼과 특정 회원의 정보를 조합 (회원정보 수정등에 사용)
+ * @brief Combine extend join form and member information (used to modify member information)
**/
function getCombineJoinForm($member_info) {
$extend_form_list = $this->getJoinFormlist();
if(!$extend_form_list) return;
-
- // 관리자이거나 자기 자신이 아니면 비공개의 경우 무조건 패스해버림
+ // Member info is open only to an administrator and him/herself when is_private is true.
$logged_info = Context::get('logged_info');
foreach($extend_form_list as $srl => $item) {
@@ -464,8 +441,7 @@
$extend_form_list[$srl]->is_private = true;
continue;
}
-
- // 추가 확장폼의 종류에 따라 값을 변경
+ // Change values depening on the type of extend form
switch($item->column_type) {
case 'checkbox' :
if($value && !is_array($value)) $value = array($value);
@@ -489,7 +465,7 @@
}
/**
- * @brief 한개의 가입항목을 가져옴
+ * @brief Get a join form
**/
function getJoinForm($member_join_form_srl) {
$args->member_join_form_srl = $member_join_form_srl;
@@ -510,7 +486,7 @@
}
/**
- * @brief 금지 아이디 목록 가져오기
+ * @brief Get a list of denied IDs
**/
function getDeniedIDList() {
if(!$this->denied_id_list) {
@@ -526,7 +502,7 @@
}
/**
- * @brief 금지 아이디인지 확인
+ * @brief Verify if ID is denied
**/
function isDeniedID($user_id) {
$args->user_id = $user_id;
@@ -536,7 +512,7 @@
}
/**
- * @brief 프로필 이미지의 정보를 구함
+ * @brief Get information of the profile image
**/
function getProfileImage($member_srl) {
if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) {
@@ -561,7 +537,7 @@
}
/**
- * @brief 이미지이름의 정보를 구함
+ * @brief Get the image name
**/
function getImageName($member_srl) {
if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) {
@@ -579,7 +555,7 @@
}
/**
- * @brief 이미지마크의 정보를 구함
+ * @brief Get the image mark
**/
function getImageMark($member_srl) {
if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) {
@@ -599,7 +575,7 @@
/**
- * @brief group의 이미지마크 정보를 구함
+ * @brief Get the image mark of the group
**/
function getGroupImageMark($member_srl,$site_srl=0) {
$oModuleModel = &getModel('module');
@@ -626,7 +602,7 @@
}
/**
- * @brief 사용자의 signature를 구함
+ * @brief Get user's signature
**/
function getSignature($member_srl) {
if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) {
@@ -641,19 +617,16 @@
}
/**
- * @brief 입력된 plain text 비밀번호와 DB에 저장된 비밀번호와의 비교
+ * @brief Compare plain text password to the password saved in DB
**/
function isValidPassword($hashed_password, $password_text) {
- // 입력된 비밀번호가 없으면 무조건 falase
+ // False if no password in entered
if(!$password_text) return false;
-
- // md5 해쉬된값가 맞으면 return true
+ // Return true if the user input is equal to md5 hash value
if($hashed_password == md5($password_text)) return true;
-
- // mysql_pre4_hash_password함수의 값과 동일하면 return true
+ // Return true if the user input is equal to the value of mysql_pre4_hash_password
if(mysql_pre4_hash_password($password_text) == $hashed_password) return true;
-
- // 현재 DB에서 mysql DB를 이용시 직접 old_password를 이용하여 검사하고 맞으면 비밀번호를 변경
+ // Verify the password by using old_password if the current db is MySQL. If correct, return true.
if(substr(Context::getDBType(),0,5)=='mysql') {
$oDB = &DB::getInstance();
if($oDB->isValidOldPassword($password_text, $hashed_password)) return true;
@@ -663,7 +636,7 @@
}
/**
- * @brief 멤버와 연결된 오픈아이디들을 모두 리턴한다.
+ * @brief Return all the open IDs of the member
**/
function getMemberOpenIDByMemberSrl($member_srl) {
$oModuleModel = &getModel('module');
@@ -697,7 +670,7 @@
}
/**
- * @brief 오픈아이디에 연결된 멤버를 리턴한다.
+ * @brief Return the member of the open ID.
**/
function getMemberSrlByOpenID($openid) {
$oModuleModel = &getModel('module');
diff --git a/modules/member/member.view.php b/modules/member/member.view.php
index 4b9cf74f3..fc7a986c3 100644
--- a/modules/member/member.view.php
+++ b/modules/member/member.view.php
@@ -2,20 +2,20 @@
/**
* @class memberView
* @author NHN (developers@xpressengine.com)
- * @brief member module의 View class
+ * @brief View class of member module
**/
class memberView extends member {
- var $group_list = NULL; ///< 그룹 목록 정보
- var $member_info = NULL; ///< 선택된 사용자의 정보
+ var $group_list = NULL; // /< Group list information
+ var $member_info = NULL; // /< Member information of the user
var $skin = 'default';
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
- // 회원 관리 정보를 받음
+ // Get the member configuration
$oModuleModel = &getModel('module');
$this->member_config = $oModuleModel->getModuleConfig('member');
if(!$this->member_config->skin) $this->member_config->skin = "default";
@@ -23,21 +23,19 @@
Context::set('member_config', $this->member_config);
$skin = $this->member_config->skin;
-
- // template path 지정
+ // Set the template path
$tpl_path = sprintf('%sskins/%s', $this->module_path, $skin);
if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default');
$this->setTemplatePath($tpl_path);
}
/**
- * @brief 회원 정보 출력
+ * @brief Display member information
**/
function dispMemberInfo() {
$oMemberModel = &getModel('member');
$logged_info = Context::get('logged_info');
-
- // 비회원일 경우 정보 열람 중지
+ // Don't display member info to non-logged user
if(!$logged_info->member_srl) return $this->stop('msg_not_permitted');
$member_srl = Context::get('member_srl');
@@ -65,38 +63,33 @@
}
/**
- * @brief 회원 가입 폼 출력
+ * @brief Display member join form
**/
function dispMemberSignUpForm() {
$oMemberModel = &getModel('member');
-
- // 로그인한 회원일 경우 해당 회원의 정보를 받음
+ // Get the member information if logged-in
if($oMemberModel->isLogged()) return $this->stop('msg_already_logged');
-
- // before 트리거 호출
+ // call a trigger (before)
$trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $this->member_config);
if(!$trigger_output->toBool()) return $trigger_output;
-
- // 회원가입을 중지시켰을 때는 에러 표시
+ // Error appears if the member is not allowed to join
if($this->member_config->enable_join != 'Y') return $this->stop('msg_signup_disabled');
Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info));
$member_config = $oMemberModel->getMemberConfig();
Context::set('member_config', $member_config);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('signup_form');
}
/**
- * @brief 회원 정보 수정
+ * @brief Modify member information
**/
function dispMemberModifyInfo() {
$oMemberModel = &getModel('member');
$oModuleModel = &getModel('module');
$memberModuleConfig = $oModuleModel->getModuleConfig('member');
-
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -105,13 +98,11 @@
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
$member_info->signature = $oMemberModel->getSignature($member_srl);
Context::set('member_info',$member_info);
-
- // 추가 가입폼 목록을 받음
+ // Get a list of extend join form
Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info));
Context::set('openids', $oMemberModel->getMemberOpenIDByMemberSrl($member_srl));
-
- // 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅
+ // Editor of the module set for signing by calling getEditor
if($member_info->member_srl) {
$oEditorModel = &getModel('editor');
$option->primary_key_name = 'member_srl';
@@ -128,19 +119,17 @@
$editor = $oEditorModel->getEditor($member_info->member_srl, $option);
Context::set('editor', $editor);
}
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('modify_info');
}
/**
- * @brief 회원 작성글 보기
+ * @brief Display documents written by the member
**/
function dispMemberOwnDocument() {
$oMemberModel = &getModel('member');
-
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -159,12 +148,11 @@
}
/**
- * @brief 회원 스크랩 게시물 보기
+ * @brief Display documents scrapped by the member
**/
function dispMemberScrappedDocument() {
$oMemberModel = &getModel('member');
-
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -182,15 +170,13 @@
}
/**
- * @brief 회원의 저장함 보기
+ * @brief Display documents saved by the member
**/
function dispMemberSavedDocument() {
$oMemberModel = &getModel('member');
-
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
-
- // 저장함에 보관된 글을 가져옴 (저장함은 module_srl이 member_srl로 세팅되어 있음)
+ // Get the saved document(module_srl is set to member_srl instead)
$logged_info = Context::get('logged_info');
$args->module_srl = $logged_info->member_srl;
$args->page = (int)Context::get('page');
@@ -207,7 +193,7 @@
}
/**
- * @brief 로그인 폼 출력
+ * @brief Display the login form
**/
function dispMemberLoginForm() {
if(Context::get('is_logged')) {
@@ -216,19 +202,17 @@
$this->setTemplateFile('redirect.html');
return;
}
-
- // 템플릿 파일 지정
+ // Set a template file
Context::set('referer_url', $_SERVER['HTTP_REFERER']);
$this->setTemplateFile('login_form');
}
/**
- * @brief 회원 비밀번호 수정
+ * @brief Change the user password
**/
function dispMemberModifyPassword() {
$oMemberModel = &getModel('member');
-
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -236,18 +220,16 @@
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
Context::set('member_info',$member_info);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('modify_password');
}
/**
- * @brief 탈퇴 화면
+ * @brief Member withdrawl
**/
function dispMemberLeave() {
$oMemberModel = &getModel('member');
-
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -255,18 +237,16 @@
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
Context::set('member_info',$member_info);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('leave_form');
}
/**
- * @brief 오픈 아이디 탈퇴 화면
+ * @brief OpenID member withdrawl
**/
function dispMemberOpenIDLeave() {
$oMemberModel = &getModel('member');
-
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
$logged_info = Context::get('logged_info');
@@ -274,13 +254,12 @@
$member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl);
Context::set('member_info',$member_info);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('openid_leave_form');
}
/**
- * @brief 로그아웃 출력
+ * @brief Member log-out
**/
function dispMemberLogout() {
$oMemberController = &getController('member');
@@ -292,17 +271,15 @@
}
/**
- * @brief 저장된 글 목록을 보여줌
+ * @brief Display a list of saved articles
**/
function dispSavedDocumentList() {
$this->setLayoutFile('popup_layout');
$oMemberModel = &getModel('member');
-
- // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력
+ // A message appears if the user is not logged-in
if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged');
-
- // 저장함에 보관된 글을 가져옴 (저장함은 module_srl이 member_srl로 세팅되어 있음)
+ // Get the saved document (module_srl is set to member_srl instead)
$logged_info = Context::get('logged_info');
$args->module_srl = $logged_info->member_srl;
$args->page = (int)Context::get('page');
@@ -320,7 +297,7 @@
}
/**
- * @brief 아이디/ 비밀번호 찾기 기능
+ * @brief Find user ID and password
**/
function dispMemberFindAccount() {
if(Context::get('is_logged')) return $this->stop('already_logged');
@@ -329,7 +306,7 @@
}
/**
- * @brief 임시 비밀번호 발급
+ * @brief Generate a temporary password
**/
function dispMemberGetTempPassword() {
if(Context::get('is_logged')) return $this->stop('already_logged');
@@ -346,7 +323,7 @@
}
/**
- * @brief 인증 메일 재발송 페이지
+ * @brief Page of re-sending an authentication mail
**/
function dispMemberResendAuthMail() {
if(Context::get('is_logged')) return $this->stop('already_logged');
diff --git a/modules/menu/menu.admin.controller.php b/modules/menu/menu.admin.controller.php
index 7645dfb51..b22dc059e 100644
--- a/modules/menu/menu.admin.controller.php
+++ b/modules/menu/menu.admin.controller.php
@@ -2,22 +2,22 @@
/**
* @class menuAdminController
* @author NHN (developers@xpressengine.com)
- * @brief menu 모듈의 admin controller class
+ * @brief admin controller class of the menu module
**/
class menuAdminController extends menu {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 메뉴 추가
+ * @brief Add a menu
**/
function procMenuAdminInsert() {
- // 입력할 변수 정리
+ // List variables
$site_module_info = Context::get('site_module_info');
$args->site_srl = (int)$site_module_info->site_srl;
$args->title = Context::get('title');
@@ -32,10 +32,10 @@
}
/**
- * @brief 메뉴 제목 변경
+ * @brief Change the menu title
**/
function procMenuAdminUpdate() {
- // 입력할 변수 정리
+ // List variables
$args->title = Context::get('title');
$args->menu_srl = Context::get('menu_srl');
@@ -46,8 +46,8 @@
}
/**
- * @brief 메뉴 삭제
- * menu_item과 xml 캐시 파일 모두 삭제
+ * @brief Delete menu
+ * Delete menu_item and xml cache files
**/
function procMenuAdminDelete() {
$menu_srl = Context::get('menu_srl');
@@ -55,7 +55,7 @@
}
function deleteMenu($menu_srl) {
- // 캐시 파일 삭제
+ // Delete cache files
$cache_list = FileHandler::readDir("./files/cache/menu","",false,true);
if(count($cache_list)) {
foreach($cache_list as $cache_file) {
@@ -63,18 +63,15 @@
if($pos>0)FileHandler::removeFile($cache_file);
}
}
-
- // 이미지 버튼 모두 삭제
+ // Delete images of menu buttons
$image_path = sprintf('./files/attach/menu_button/%s', $menu_srl);
FileHandler::removeDir($image_path);
$args->menu_srl = $menu_srl;
-
- // 메뉴 메뉴 삭제
+ // Delete menu items
$output = executeQuery("menu.deleteMenuItems", $args);
if(!$output->toBool()) return $output;
-
- // 메뉴 삭제
+ // Delete the menu
$output = executeQuery("menu.deleteMenu", $args);
if(!$output->toBool()) return $output;
@@ -82,10 +79,10 @@
}
/**
- * @brief 메뉴에 아이템 추가
+ * @brief Add an item to the menu
**/
function procMenuAdminInsertItem() {
- // 입력할 변수 정리
+ // List variables to insert
$source_args = Context::getRequestVars();
unset($source_args->module);
unset($source_args->act);
@@ -93,8 +90,7 @@
if($source_args->menu_expand !="Y") $source_args->menu_expand = "N";
$source_args->group_srls = str_replace('|@|',',',$source_args->group_srls);
$source_args->parent_srl = (int)$source_args->parent_srl;
-
- // 변수를 다시 정리 (form문의 column과 DB column이 달라서)
+ // Re-order variables (Column's order is different between form and DB)
$args->menu_srl = $source_args->menu_srl;
$args->menu_item_srl = $source_args->menu_item_srl;
$args->parent_srl = $source_args->parent_srl;
@@ -108,46 +104,37 @@
$args->hover_btn = $source_args->hover_btn;
$args->active_btn = $source_args->active_btn;
$args->group_srls = $source_args->group_srls;
-
- // 이미 존재하는지를 확인
+ // Check if already exists
$oMenuModel = &getAdminModel('menu');
$item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl);
-
- // 존재하게 되면 update를 해준다
+ // Update if exists
if($item_info->menu_item_srl == $args->menu_item_srl) {
$output = executeQuery('menu.updateMenuItem', $args);
if(!$output->toBool()) return $output;
-
- // 존재하지 않으면 insert를 해준다
+ // Insert if not exist
} else {
$args->listorder = -1*$args->menu_item_srl;
$output = executeQuery('menu.insertMenuItem', $args);
if(!$output->toBool()) return $output;
}
-
- // 해당 메뉴의 정보를 구함
+ // Get information of the menu
$menu_info = $oMenuModel->getMenu($args->menu_srl);
$menu_title = $menu_info->title;
-
- // XML 파일을 갱신하고 위치을 넘겨 받음
+ // Update the xml file and get its location
$xml_file = $this->makeXmlFile($args->menu_srl);
-
- // url이 mid일 경우 기록 남김
+ // If a new menu item that mid is URL is added, the current layout is applied
if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $args->url)) {
$mid = $args->url;
$mid_args->menu_srl = $args->menu_srl;
$mid_args->mid = $mid;
-
- // menu_srl에 해당하는 레이아웃 값을 구함
+ // Get layout value of menu_srl
$output = executeQuery('menu.getMenuLayout', $args);
-
- // 해당 모듈에 레이아웃 값이 정해져 있지 않으면 지정
+ // Set if layout value is not specified in the module
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByMid($mid);
if(!$module_info->layout_srl&&$output->data->layout_srl) $mid_args->layout_srl = $output->data->layout_srl;
-
- // 해당 mid의 메뉴값을 선택된 메뉴로 변경
+ // Change menu value of the mid to the menu
$oModuleController = &getController('module');
$oModuleController->updateModuleMenu($mid_args);
}
@@ -160,35 +147,29 @@
}
/**
- * @brief 메뉴 메뉴 삭제
+ * @brief Delete menu item(menu of the menu)
**/
function procMenuAdminDeleteItem() {
- // 변수 정리
+ // List variables
$args = Context::gets('menu_srl','menu_item_srl');
$oMenuAdminModel = &getAdminModel('menu');
-
- // 원정보를 가져옴
+ // Get original information
$item_info = $oMenuAdminModel->getMenuItemInfo($args->menu_item_srl);
if($item_info->parent_srl) $parent_srl = $item_info->parent_srl;
-
- // 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력
+ // Display an error that the category cannot be deleted if it has a child node
$output = executeQuery('menu.getChildMenuCount', $args);
if(!$output->toBool()) return $output;
if($output->data->count>0) return new Object(-1, 'msg_cannot_delete_for_child');
-
- // DB에서 삭제
+ // Remove from the DB
$output = executeQuery("menu.deleteMenuItem", $args);
if(!$output->toBool()) return $output;
-
- // 해당 메뉴의 정보를 구함
+ // Get information of the menu
$menu_info = $oMenuAdminModel->getMenu($args->menu_srl);
$menu_title = $menu_info->title;
-
- // XML 파일을 갱신하고 위치을 넘겨 받음
+ // Update the xml file and get its location
$xml_file = $this->makeXmlFile($args->menu_srl);
-
- // 이미지 버튼 모두 삭제
+ // Delete all of image buttons
if($item_info->normal_btn) FileHandler::removeFile($item_info->normal_btn);
if($item_info->hover_btn) FileHandler::removeFile($item_info->hover_btn);
if($item_info->active_btn) FileHandler::removeFile($item_info->active_btn);
@@ -200,7 +181,7 @@
}
/**
- * @brief 메뉴의 메뉴를 이동
+ * @brief Move menu items
**/
function procMenuAdminMoveItem() {
$menu_srl = Context::get('menu_srl');
@@ -214,13 +195,12 @@
}
function moveMenuItem($menu_srl,$parent_srl,$source_srl,$target_srl,$mode){
- // 원본 메뉴들을 구함
+ // Get the original menus
$oMenuAdminModel = &getAdminModel('menu');
$target_item = $oMenuAdminModel->getMenuItemInfo($target_srl);
if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request');
-
- // 위치 이동 (순서 조절)
+ // Move the menu location(change the order menu appears)
if($mode == 'move') {
$args->parent_srl = $parent_srl;
$args->menu_srl = $menu_srl;
@@ -243,7 +223,7 @@
$args->menu_item_srl = $target_srl;
$output = executeQuery('menu.updateMenuItemNode', $args);
if(!$output->toBool()) return $output;
- // 자식으로 추가
+ // Add a child
} elseif($mode == 'insert') {
$args->menu_item_srl = $target_srl;
$args->parent_srl = $parent_srl;
@@ -257,42 +237,37 @@
}
/**
- * @brief xml 파일을 갱신
- * 관리자페이지에서 메뉴 구성 후 간혹 xml파일이 재생성 안되는 경우가 있는데\n
- * 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n
- * 개발 중간의 문제인 것 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능
+ * @brief Update xml file
+ * XML file is not often generated after setting menus on the admin page\n
+ * For this occasional cases, manually update was implemented. \n
+ * It looks unnecessary at this moment however no need to eliminate the feature. Just leave it.
**/
function procMenuAdminMakeXmlFile() {
- // 입력값을 체크
+ // Check input value
$menu_srl = Context::get('menu_srl');
-
- // 해당 메뉴의 정보를 구함
+ // Get information of the menu
$oMenuAdminModel = &getAdminModel('menu');
$menu_info = $oMenuAdminModel->getMenu($menu_srl);
$menu_title = $menu_info->title;
-
- // xml파일 재생성
+ // Re-generate the xml file
$xml_file = $this->makeXmlFile($menu_srl);
-
- // return 값 설정
+ // Set return value
$this->add('menu_title',$menu_title);
$this->add('xml_file',$xml_file);
}
/**
- * @brief 메뉴 이미지 버튼을 등록
+ * @brief Register a menu image button
**/
function procMenuAdminUploadButton() {
$menu_srl = Context::get('menu_srl');
$menu_item_srl = Context::get('menu_item_srl');
$target = Context::get('target');
$target_file = Context::get($target);
-
- // 필수 요건이 없거나 업로드된 파일이 아니면 오류 발생
+ // Error occurs when the target is neither a uploaded file nor a valid file
if(!$menu_srl || !$menu_item_srl || !$target_file || !is_uploaded_file($target_file['tmp_name']) || !preg_match('/\.(gif|jpeg|jpg|png)/i',$target_file['name'])) {
Context::set('error_messge', Context::getLang('msg_invalid_request'));
-
- // 요건을 만족하고 업로드된 파일이면 지정된 위치로 이동
+ // Move the file to a specific director if the uploaded file meets requirement
} else {
$tmp_arr = explode('.',$target_file['name']);
$ext = $tmp_arr[count($tmp_arr)-1];
@@ -312,7 +287,7 @@
}
/**
- * @brief 등록된 메뉴 이미지 제거
+ * @brief Remove the menu image button
**/
function procMenuAdminDeleteButton() {
$menu_srl = Context::get('menu_srl');
@@ -325,13 +300,12 @@
}
/**
- * @brief 메뉴의 xml 파일을 만들고 위치를 return
+ * @brief Generate XML file for menu and return its location
**/
function makeXmlFile($menu_srl) {
- // xml파일 생성시 필요한 정보가 없으면 그냥 return
+ // Return if there is no information when creating the xml file
if(!$menu_srl) return;
-
- // 메뉴 정보를 구함
+ // Get menu informaton
$args->menu_srl = $menu_srl;
$output = executeQuery('menu.getMenu', $args);
if(!$output->toBool() || !$output->data) return $output;
@@ -342,18 +316,15 @@
$site_info = $oModuleModel->getSiteInfo($site_srl);
$domain = $site_info->domain;
}
-
- // DB에서 menu_srl에 해당하는 메뉴 아이템 목록을 listorder순으로 구해옴
+ // Get a list of menu items corresponding to menu_srl by listorder
$args->menu_srl = $menu_srl;
$args->sort_index = 'listorder';
$output = executeQuery('menu.getMenuItems', $args);
if(!$output->toBool()) return;
-
- // 캐시 파일의 이름을 지정
+ // Specify the name of the cache file
$xml_file = sprintf("./files/cache/menu/%s.xml.php", $menu_srl);
$php_file = sprintf("./files/cache/menu/%s.php", $menu_srl);
-
- // 구해온 데이터가 없다면 노드데이터가 없는 xml 파일만 생성
+ // If no data found, generate an XML file without node data
$list = $output->data;
if(!$list) {
$xml_buff = "";
@@ -361,11 +332,9 @@
FileHandler::writeFile($php_file, '');
return $xml_file;
}
-
- // 구해온 데이터가 하나라면 array로 바꾸어줌
+ // Change to an array if only a single data is obtained
if(!is_array($list)) $list = array($list);
-
- // 루프를 돌면서 tree 구성
+ // Create a tree for loop
$list_count = count($list);
for($i=0;$i<$list_count;$i++) {
$node = $list[$i];
@@ -374,8 +343,7 @@
$tree[$parent_srl][$menu_item_srl] = $node;
}
-
- // 캐시 파일의 권한과 그룹 설정을 위한 공통 헤더
+ // A common header to set permissions of the cache file and groups
$header_script =
'$lang_type = Context::getLangType(); '.
'$is_logged = Context::get(\'is_logged\'); '.
@@ -397,8 +365,7 @@
'$is_admin = false; '.
'$group_srsl = array(); '.
'} ';
-
- // xml 캐시 파일 생성 (xml캐시는 따로 동작하기에 session 지정을 해주어야 함)
+ // Create the xml cache file (a separate session is needed for xml cache)
$xml_buff = sprintf(
'getXmlTree($tree[0], $tree, $site_srl, $domain)
);
-
- // php 캐시 파일 생성
+ // Create php cache file
$php_output = $this->getPhpCacheCode($tree[0], $tree, $site_srl, $domain);
$php_buff = sprintf(
' $node) {
$child_buff = "";
-
- // 자식 노드의 데이터 가져옴
+ // Get data of the child nodes
if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain);
-
- // 변수 정리
+ // List variables
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
foreach($names as $key => $val) {
$name_arr_str .= sprintf('"%s"=>"%s",',$key, str_replace('\\','\\\\',htmlspecialchars($val)));
@@ -492,8 +455,7 @@
} else {
$link = '';
}
-
- // node->group_srls값이 있으면
+ // If the value of node->group_srls exists
if($group_srls) $group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s)))))',$group_srls);
else $group_check_code = "true";
$attribute = sprintf(
@@ -522,10 +484,10 @@
}
/**
- * @brief array로 정렬된 노드들을 php code로 변경하여 return
- * 메뉴에서 메뉴를 tpl에 사용시 xml데이터를 사용할 수도 있지만 별도의 javascript 사용이 필요하기에
- * php로 된 캐시파일을 만들어서 db이용없이 바로 메뉴 정보를 구할 수 있도록 한다
- * 이 캐시는 ModuleHandler::displayContent() 에서 include하여 Context::set() 한다
+ * @brief Return php code converted from nodes in an array
+ * Although xml data can be used for tpl, menu to menu, it needs to use javascript separately
+ * By creating cache file in php and then you can get menu information without DB
+ * This cache includes in ModuleHandler::displayContent() and then Context::set()
**/
function getPhpCacheCode($source_node, $tree, $site_srl, $domain) {
$output = array("buff"=>"", "url_list"=>array());
@@ -534,26 +496,22 @@
$oMenuAdminModel = &getAdminModel('menu');
foreach($source_node as $menu_item_srl => $node) {
- // 자식 노드가 있으면 자식 노드의 데이터를 먼저 얻어옴
+ // Get data from child nodes if exist.
if($menu_item_srl&&$tree[$menu_item_srl]) $child_output = $this->getPhpCacheCode($tree[$menu_item_srl], $tree, $site_srl, $domain);
else $child_output = array("buff"=>"", "url_list"=>array());
-
- // 변수 정리
+ // List variables
$names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl);
foreach($names as $key => $val) {
$name_arr_str .= sprintf('"%s"=>"%s",',$key, str_replace(array('\\','"'),array('\\\\','"'),$val));
}
$name_str = sprintf('$_menu_names[%d] = array(%s); %s', $node->menu_item_srl, $name_arr_str, $child_output['name']);
-
- // 현재 노드의 url값이 공란이 아니라면 url_list 배열값에 입력
+ // If url value is not empty in the current node, put the value into an array url_list
if($node->url) $child_output['url_list'][] = $node->url;
$output['url_list'] = array_merge($output['url_list'], $child_output['url_list']);
-
- // node->group_srls값이 있으면
+ // If node->group_srls value exists
if($node->group_srls) $group_check_code = sprintf('($is_admin==true||(is_array($group_srls)&&count(array_intersect($group_srls, array(%s)))))',$node->group_srls);
else $group_check_code = "true";
-
- // 변수 정리
+ // List variables
$href = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->href);
$url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url);
if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url)) {
@@ -594,8 +552,7 @@
} else {
$link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl);
}
-
- // 속성을 생성한다 ( url_list를 이용해서 선택된 메뉴의 노드에 속하는지를 검사한다. 꽁수지만 빠르고 강력하다고 생각;;)
+ // Create properties (check if it belongs to the menu node by url_list. It looks a trick but fast and powerful)
$attribute = sprintf(
'"node_srl"=>"%s","parent_srl"=>"%s","text"=>(%s?$_menu_names[%d][$lang_type]:""),"href"=>(%s?"%s":""),"url"=>(%s?"%s":""),"open_window"=>"%s","normal_btn"=>"%s","hover_btn"=>"%s","active_btn"=>"%s","selected"=>(array(%s)&&in_array(Context::get("mid"),array(%s))?1:0),"expand"=>"%s", "list"=>array(%s), "link"=>(%s? ( array(%s)&&in_array(Context::get("mid"),array(%s)) ?%s:%s):""),',
$node->menu_item_srl,
@@ -620,8 +577,7 @@
$link_active,
$link
);
-
- // buff 데이터를 생성한다
+ // Generate buff data
$output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute);
$output['name'] .= $name_str;
}
@@ -629,20 +585,18 @@
}
/**
- * @brief 메뉴와 레이아웃 매핑
- * 레이아웃에서 메뉴를 지정할때 지정된 메뉴의 기본 레이아웃을 매핑
+ * @brief Mapping menu and layout
+ * When setting menu on the layout, map the default layout
**/
function updateMenuLayout($layout_srl, $menu_srl_list) {
if(!count($menu_srl_list)) return;
-
- // 일단 menu_srls의 값을 지움
+ // Delete the value of menu_srls
$args->menu_srls = implode(',',$menu_srl_list);
$output = executeQuery('menu.deleteMenuLayout', $args);
if(!$output->toBool()) return $output;
$args->layout_srl = $layout_srl;
-
- // menu_srls, layout_srl 매핑
+ // Mapping menu_srls, layout_srl
for($i=0;$imenu_srl = $menu_srl_list[$i];
$output = executeQuery('menu.insertMenuLayout', $args);
diff --git a/modules/menu/menu.admin.model.php b/modules/menu/menu.admin.model.php
index c65dc3937..6f999cdfd 100644
--- a/modules/menu/menu.admin.model.php
+++ b/modules/menu/menu.admin.model.php
@@ -3,19 +3,19 @@
* @class menuAdminModel
* @author NHN (developers@xpressengine.com)
* @version 0.1
- * @brief menu 모듈의 admin model class
+ * @brief admin model class of the menu module
**/
class menuAdminModel extends menu {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 전체 메뉴 목록을 구해옴
+ * @brief Get a list of all menus
**/
function getMenuList($obj) {
if(!$obj->site_srl) {
@@ -27,25 +27,23 @@
$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;
-
- // document.getDocumentList 쿼리 실행
+ // document.getDocumentList query execution
$output = executeQuery('menu.getMenuList', $args);
-
- // 결과가 없거나 오류 발생시 그냥 return
+ // Return if no result or an error occurs
if(!$output->toBool()||!count($output->data)) return $output;
return $output;
}
/**
- * @brief 등록된 모든 메뉴를 return
+ * @brief Return all menus
**/
function getMenus($site_srl = null) {
if(!isset($site_srl)) {
$site_module_info = Context::get('site_module_info');
$site_srl = (int)$site_module_info->site_srl;
}
- // 일단 DB에서 정보를 가져옴
+ // Get information from the DB
$args->site_srl = $site_srl ;
$args->menu_srl = $menu_srl;
$output = executeQuery('menu.getMenus', $args);
@@ -56,11 +54,11 @@
}
/**
- * @brief DB 에 생성된 한개의 메뉴 정보를 구함
- * 생성된 메뉴의 DB정보+XML정보를 return
+ * @brief Get information of a new menu from the DB
+ * Return DB and XML information of the menu
**/
function getMenu($menu_srl) {
- // 일단 DB에서 정보를 가져옴
+ // Get information from the DB
$args->menu_srl = $menu_srl;
$output = executeQuery('menu.getMenu', $args);
if(!$output->data) return;
@@ -72,11 +70,11 @@
}
/**
- * @brief 특정 menu_srl의 아이템 정보를 return
- * 이 정보중에 group_srls의 경우는 , 로 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴
+ * @brief Return item information of the menu_srl
+ * group_srls uses a seperator with comma(,) and converts to an array by explode
**/
function getMenuItemInfo($menu_item_srl) {
- // menu_item_srl이 있으면 해당 메뉴의 정보를 가져온다
+ // Get the menu information if menu_item_srl exists
$args->menu_item_srl = $menu_item_srl;
$output = executeQuery('menu.getMenuItem', $args);
$node = $output->data;
@@ -94,56 +92,49 @@
}
/**
- * @brief 다국어 지원을 위해 menu의 name을 언어별로 나눠서 return
+ * @brief Return menu name in each language to support multi-language
*/
function getMenuItemNames($source_name, $site_srl = null) {
if(!$site_srl) {
$site_module_info = Context::get('site_module_info');
$site_srl = (int)$site_module_info->site_srl;
}
-
- // 언어코드 구함
+ // Get language code
$oModuleAdminModel = &getAdminModel('module');
return $oModuleAdminModel->getLangCode($site_srl, $source_name);
}
/**
- * @brief 특정 menu_srl의 정보를 이용하여 템플릿을 구한후 return
- * 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return
+ * @brief Get a template by using the menu_srl and retrun.
+ * Return html after compiling tpl on the server in order to add menu information on the admin page
**/
function getMenuAdminTplInfo() {
- // 해당 메뉴의 정보를 가져오기 위한 변수 설정
+ // Get information on the menu for the parameter settings
$menu_item_srl = Context::get('menu_item_srl');
$parent_srl = Context::get('parent_srl');
-
- // 회원 그룹의 목록을 가져옴
+ // Get a list of member groups
$oMemberModel = &getModel('member');
$group_list = $oMemberModel->getGroups();
Context::set('group_list', $group_list);
-
- // parent_srl이 있고 menu_item_srl이 없으면 하부 메뉴 추가임
+ // Add a sub-menu if there is parent_srl but not menu_item_srl
if(!$menu_item_srl && $parent_srl) {
- // 상위 메뉴의 정보를 가져옴
+ // Get information of the parent menu
$parent_info = $this->getMenuItemInfo($parent_srl);
-
- // 추가하려는 메뉴의 기본 변수 설정
+ // Default parameter settings for a new menu
$item_info->menu_item_srl = getNextSequence();
$item_info->parent_srl = $parent_srl;
$item_info->parent_menu_name = $parent_info->name;
-
- // root에 메뉴 추가하거나 기존 메뉴의 수정일 경우
+ // In case of modifying the existing menu or addting a new menu to the root
} else {
- // menu_item_srl 이 있으면 해당 메뉴의 정보를 가져온다
+ // Get information of the menu if menu_item_srl exists
if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl);
-
- // 찾아진 값이 없다면 신규 메뉴 추가로 보고 menu_item_srl값만 구해줌
+ // Get only menu_item_srl if no values found, considering it as adding a new menu
if(!$item_info->menu_item_srl) {
$item_info->menu_item_srl = getNextSequence();
}
}
Context::set('item_info', $item_info);
-
- // template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다.
+ // Compile the template file into tpl variable and then return it
$oTemplate = &TemplateHandler::getInstance();
$tpl = $oTemplate->compile($this->module_path.'tpl', 'menu_item_info');
diff --git a/modules/menu/menu.admin.view.php b/modules/menu/menu.admin.view.php
index 23435a494..11e7d3f7c 100644
--- a/modules/menu/menu.admin.view.php
+++ b/modules/menu/menu.admin.view.php
@@ -2,23 +2,23 @@
/**
* @class menuAdminView
* @author NHN (developers@xpressengine.com)
- * @brief menu 모듈의 admin view class
+ * @brief admin view class of the menu module
**/
class menuAdminView extends menu {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
$this->setTemplatePath($this->module_path.'tpl');
}
/**
- * @brief 메뉴 관리의 첫 페이지
+ * @brief The first page of the menu admin
**/
function dispMenuAdminContent() {
- // 등록된 메뉴 목록을 구해옴
+ // Get a list of registered menus
$obj->page = Context::get('page');
$obj->sort_index = 'listorder';
$obj->list_count = 20;
@@ -37,14 +37,14 @@
}
/**
- * @brief 메뉴 등록 페이지
+ * @brief Page to insert a menu
**/
function dispMenuAdminInsert() {
- // 선택된 메뉴의 정보르 구해서 세팅
+ // Set the menu with menu information
$menu_srl = Context::get('menu_srl');
if($menu_srl) {
- // 메뉴의 정보를 가져옴
+ // Get information of the menu
$oMenuModel = &getAdminModel('menu');
$menu_info = $oMenuModel->getMenu($menu_srl);
if($menu_info->menu_srl == $menu_srl) Context::set('menu_info', $menu_info);
@@ -54,50 +54,43 @@
}
/**
- * @brief 메뉴 관리 페이지
+ * @brief Menu admin page
**/
function dispMenuAdminManagement() {
- // 선택된 메뉴의 정보르 구해서 세팅
+ // Get information of the menu
$menu_srl = Context::get('menu_srl');
if(!$menu_srl) return $this->dispMenuAdminContent();
-
- // 메뉴의 정보를 가져옴
+ // Get information of the menu
$oMenuModel = &getAdminModel('menu');
$menu_info = $oMenuModel->getMenu($menu_srl);
if($menu_info->menu_srl != $menu_srl) return $this->dispMenuAdminContent();
Context::set('menu_info', $menu_info);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setTemplateFile('menu_management');
}
/**
- * @brief 메뉴에서 선택할 수 있는 mid목록을 보여줌
+ * @brief Display a mid list to be able to select on the menu
**/
function dispMenuAdminMidList() {
$oModuleModel = &getModel('module');
-
- // 모듈 카테고리 목록을 구함
+ // Get a list of module categories
$module_category = $oModuleModel->getModuleCategories();
Context::set('module_category', $module_category);
-
- // 모듈 목록을 구함
+ // Get a list of modules
$module_list = $oModuleModel->getModuleList();
Context::set('module_list', $module_list);
-
- // mid 목록을 구해옴
+ // Get a list of mid
$args->module_category_srl = Context::get('module_category_srl');
$args->module = Context::get('target_module');
$mid_list = $oModuleModel->getMidList($args);
Context::set('mid_list', $mid_list);
-
- // 메뉴을 팝업으로 지정
+ // Set the menu as a pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('mid_list');
}
}
diff --git a/modules/menu/menu.class.php b/modules/menu/menu.class.php
index f16fccce9..3e3bb6310 100644
--- a/modules/menu/menu.class.php
+++ b/modules/menu/menu.class.php
@@ -2,40 +2,38 @@
/**
* @class menu
* @author NHN (developers@xpressengine.com)
- * @brief menu 모듈의 high class
+ * @brief high class of the menu module
**/
class menu extends ModuleObject {
/**
- * @brief 설치시 추가 작업이 필요할시 구현
+ * @brief Implement if additional tasks are necessary when installing
**/
function moduleInstall() {
- // 메뉴 사용할 디렉토리 생성
+ // Create a directory to use menu
FileHandler::makeDir('./files/cache/menu');
return new Object();
}
/**
- * @brief 설치가 이상이 없는지 체크하는 method
+ * @brief a method to check if successfully installed
**/
function checkUpdate() {
$oDB = &DB::getInstance();
-
- // 2009. 02. 11 menu 테이블에 site_srl 추가
+ // 2009. 02. 11 menu added to the table site_srl
if(!$oDB->isColumnExists('menu', 'site_srl')) return true;
return false;
}
/**
- * @brief 업데이트 실행
+ * @brief Execute update
**/
function moduleUpdate() {
$oDB = &DB::getInstance();
-
- // 2009. 02. 11 menu 테이블에 site_srl 추가
+ // 2009. 02. 11 menu added to the table site_srl
if(!$oDB->isColumnExists('menu', 'site_srl')) {
$oDB->addColumn('menu','site_srl','number',11,0,true);
}
@@ -44,20 +42,18 @@
}
/**
- * @brief 캐시 파일 재생성
+ * @brief Re-generate the cache file
**/
function recompileCache() {
- // 메뉴 모듈의 캐시 파일 모두 삭제
+ // Delete all cache files in the menu module
FileHandler::removeFilesInDir("./files/cache/menu");
$oMenuAdminController = &getAdminController('menu');
-
- // 블로그 모듈 목록을 모두 구함
+ // Wanted list of all the blog module
$output = executeQueryArray("menu.getMenus");
$list = $output->data;
if(!count($list)) return;
-
- // 메뉴 모듈에서 사용되는 모든 메뉴 목록을 재 생성
+ // The menu module is used in the re-create all the menu list
foreach($list as $menu_item) {
$menu_srl = $menu_item->menu_srl;
$oMenuAdminController->makeXmlFile($menu_srl);
diff --git a/modules/message/message.admin.controller.php b/modules/message/message.admin.controller.php
index 2c28995c4..6d59b1706 100644
--- a/modules/message/message.admin.controller.php
+++ b/modules/message/message.admin.controller.php
@@ -2,25 +2,24 @@
/**
* @class messageAdminController
* @author NHN (developers@xpressengine.com)
- * @brief message module의 admin controller class
+ * @brief admin controller class of message module
**/
class messageAdminController extends message {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 설정
+ * @brief Configuration
**/
function procMessageAdminInsertConfig() {
- // 기본 정보를 받음
+ // Get information
$args->skin = Context::get('skin');
-
- // module Controller 객체 생성하여 입력
+ // Create a module Controller object
$oModuleController = &getController('module');
$output = $oModuleController->insertModuleConfig('message',$args);
if(!$output->toBool()) return $output;
diff --git a/modules/message/message.admin.view.php b/modules/message/message.admin.view.php
index a8f4855b9..4797e8699 100644
--- a/modules/message/message.admin.view.php
+++ b/modules/message/message.admin.view.php
@@ -2,31 +2,29 @@
/**
* @class messageAdminView
* @author NHN (developers@xpressengine.com)
- * @brief message모듈의 admin view class
+ * @brief admin view class of the message module
**/
class messageAdminView extends message {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 설정
+ * @brief Configuration
**/
function dispMessageAdminConfig() {
- // 스킨 목록을 구해옴
+ // Get a list of skins(themes)
$oModuleModel = &getModel('module');
$skin_list = $oModuleModel->getskins($this->module_path);
Context::set('skin_list', $skin_list);
-
- // 설정 정보를 받아옴 (module model 객체를 이용)
+ // Get configurations (using module model object)
$config = $oModuleModel->getModuleConfig('message');
Context::set('config',$config);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config');
}
diff --git a/modules/message/message.class.php b/modules/message/message.class.php
index a3dcbcb9c..748f61962 100644
--- a/modules/message/message.class.php
+++ b/modules/message/message.class.php
@@ -2,34 +2,34 @@
/**
* @class message
* @author NHN (developers@xpressengine.com)
- * @brief message모듈의 high class
+ * @brief high class of message module
**/
class message extends ModuleObject {
/**
- * @brief 설치시 추가 작업이 필요할시 구현
+ * @brief Implement if additional tasks are necessary when installing
**/
function moduleInstall() {
return new Object();
}
/**
- * @brief 설치가 이상이 없는지 체크하는 method
+ * @brief a method to check if successfully installed
**/
function checkUpdate() {
return false;
}
/**
- * @brief 업데이트 실행
+ * @brief Execute update
**/
function moduleUpdate() {
return new Object();
}
/**
- * @brief 캐시 파일 재생성
+ * @brief Re-generate the cache file
**/
function recompileCache() {
}
diff --git a/modules/message/message.mobile.php b/modules/message/message.mobile.php
index 458b091b2..08180b96d 100644
--- a/modules/message/message.mobile.php
+++ b/modules/message/message.mobile.php
@@ -4,29 +4,26 @@
class messageMobile extends messageView {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 메세지 출력
+ * @brief Message output
**/
function dispMessage() {
- // 설정 정보를 받아옴 (module model 객체를 이용)
+ // Get configurations (using module model object)
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('message');
if(!$config->skin) $config->skin = 'default';
-
- // 템플릿 경로를 지정
+ // Set the template path
$template_path = sprintf('%sm.skins/%s', $this->module_path, $config->skin);
-
- // 회원 관리 정보를 받음
+ // Get the member configuration
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
-
- // ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성
+ // Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if($member_config->enable_ssl == 'Y') {
if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true;
diff --git a/modules/message/message.view.php b/modules/message/message.view.php
index 0f5250923..9251c1fb7 100644
--- a/modules/message/message.view.php
+++ b/modules/message/message.view.php
@@ -2,35 +2,32 @@
/**
* @class messageView
* @author NHN (developers@xpressengine.com)
- * @brief message모듈의 view class
+ * @brief view class of the message module
**/
class messageView extends message {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 메세지 출력
+ * @brief Display messages
**/
function dispMessage() {
- // 설정 정보를 받아옴 (module model 객체를 이용)
+ // Get configurations (using module model object)
$oModuleModel = &getModel('module');
$config = $oModuleModel->getModuleConfig('message');
if(!$config->skin) $config->skin = 'default';
-
- // 템플릿 경로를 지정
+ // Template path
$template_path = sprintf('%sskins/%s', $this->module_path, $config->skin);
-
- // 회원 관리 정보를 받음
+ // Get the member configuration
$oModuleModel = &getModel('module');
$member_config = $oModuleModel->getModuleConfig('member');
Context::set('member_config', $member_config);
-
- // ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성
+ // Set a flag to check if the https connection is made when using SSL and create https url
$ssl_mode = false;
if($member_config->enable_ssl == 'Y') {
if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true;
diff --git a/modules/module/module.admin.controller.php b/modules/module/module.admin.controller.php
index a4eadaa7a..ab47fd954 100644
--- a/modules/module/module.admin.controller.php
+++ b/modules/module/module.admin.controller.php
@@ -2,19 +2,19 @@
/**
* @class moduleAdminController
* @author NHN (developers@xpressengine.com)
- * @brief module 모듈의 admin controller class
+ * @brief admin controller class of the module module
**/
class moduleAdminController extends module {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 모듈 카테고리 추가
+ * @brief Add the module category
**/
function procModuleAdminInsertCategory() {
$args->title = Context::get('title');
@@ -25,7 +25,7 @@
}
/**
- * @brief 카테고리의 내용 수정
+ * @brief Update category
**/
function procModuleAdminUpdateCategory() {
$mode = Context::get('mode');
@@ -46,7 +46,7 @@
}
/**
- * @brief 모듈 카테고리의 제목 변경
+ * @brief Change the title of the module category
**/
function doUpdateModuleCategory() {
$args->title = Context::get('title');
@@ -55,7 +55,7 @@
}
/**
- * @brief 모듈 카테고리 삭제
+ * @brief Delete the module category
**/
function doDeleteModuleCategory() {
$args->module_category_srl = Context::get('module_category_srl');
@@ -63,14 +63,13 @@
}
/**
- * @brief 모듈 복사
+ * @brief Copy Module
**/
function procModuleAdminCopyModule() {
- // 복사하려는 대상 모듈의 정보를 구함
+ // Get information of the target module to copy
$module_srl = Context::get('module_srl');
if(!$module_srl) return;
-
- // 새로 생성하려는 모듈들의 이름/브라우저 제목을 구함
+ // Get module name to create and browser title
$clones = array();
$args = Context::getAll();
for($i=1;$i<=10;$i++) {
@@ -86,11 +85,9 @@
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
-
- // 모듈 정보 가져옴
+ // Get module information
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
-
- // 권한 정보 가져옴
+ // Get permission information
$module_args->module_srl = $module_srl;
$output = executeQueryArray('module.getModuleGrants', $module_args);
$grant = array();
@@ -101,8 +98,7 @@
$oDB = &DB::getInstance();
$oDB->begin();
-
- // 모듈 복사
+ // Copy a module
foreach($clones as $mid => $browser_title) {
$clone_args = null;
$clone_args = clone($module_info);
@@ -111,12 +107,10 @@
$clone_args->mid = $mid;
$clone_args->browser_title = $browser_title;
$clone_args->is_default = 'N';
-
- // 모듈 생성
+ // Create a module
$output = $oModuleController->insertModule($clone_args);
$module_srl = $output->get('module_srl');
-
- // 권한 정보 등록
+ // Grant module permissions
if(count($grant)) $oModuleController->insertModuleGrants($module_srl, $grant);
}
@@ -125,20 +119,17 @@
}
/**
- * @brief 모듈 권한 저장
+ * @brief Save the module permissions
**/
function procModuleAdminInsertGrant() {
$oModuleController = &getController('module');
$oModuleModel = &getModel('module');
-
- // 모듈 번호 구함
+ // Get module_srl
$module_srl = Context::get('module_srl');
-
- // 해당 모듈의 정보를 구함
+ // Get information of the module
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
if(!$module_info) return new Object(-1,'msg_invalid_request');
-
- // 관리자 아이디 등록
+ // Register Admin ID
$oModuleController->deleteAdminId($module_srl);
$admin_member = Context::get('admin_member');
if($admin_member) {
@@ -150,8 +141,7 @@
}
}
-
- // 권한 정리
+ // List permissions
$xml_info = $oModuleModel->getModuleActionXML($module_info->module);
$grant_list = $xml_info->grant;
@@ -160,15 +150,13 @@
$grant_list->manager->default = 'manager';
foreach($grant_list as $grant_name => $grant_info) {
- // default값을 구함
+ // Get the default value
$default = Context::get($grant_name.'_default');
-
- // -1 = 로그인 사용자만, -2 = 사이트 가입자만, 0 = 모든 사용자
+ // -1 = Log-in user only, -2 = site members only, 0 = all users
if(strlen($default)){
$grant->{$grant_name}[] = $default;
continue;
-
- // 특정 그룹 사용자
+ // users in a particular group
} else {
$group_srls = Context::get($grant_name);
if($group_srls) {
@@ -182,12 +170,11 @@
$grant->{$group_srls} = array();
}
- // DB에 저장
+ // Stored in the DB
$args->module_srl = $module_srl;
$output = executeQuery('module.deleteModuleGrants', $args);
if(!$output->toBool()) return $output;
-
- // DB에 권한 저장
+ // Permissions stored in the DB
foreach($grant as $grant_name => $group_srls) {
foreach($group_srls as $key => $val) {
$args = null;
@@ -202,84 +189,74 @@
}
/**
- * @brief 스킨 정보 업데이트
+ * @brief Updating Skins
**/
function procModuleAdminUpdateSkinInfo() {
- // module_srl에 해당하는 정보들을 가져오기
+ // Get information of the module_srl
$module_srl = Context::get('module_srl');
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
if($module_info->module_srl) {
$skin = $module_info->skin;
-
- // 스킨의 정보를 구해옴 (extra_vars를 체크하기 위해서)
+ // Get skin information (to check extra_vars)
$module_path = './modules/'.$module_info->module;
$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
$skin_vars = $oModuleModel->getModuleSkinVars($module_srl);
- // 입력받은 변수들을 체크 (mo, act, module_srl, page등 기본적인 변수들 없앰)
+ // Check received variables (unset such variables as act, module_srl, page, mid, module)
$obj = Context::getRequestVars();
unset($obj->act);
unset($obj->module_srl);
unset($obj->page);
unset($obj->mid);
unset($obj->module);
-
- // 원 skin_info에서 extra_vars의 type이 image일 경우 별도 처리를 해줌
+ // Separately handle if a type of extra_vars is an image 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 to delete
$del_var = $obj->{"del_".$vars->name};
unset($obj->{"del_".$vars->name});
if($del_var == 'Y') {
FileHandler::removeFile($skin_vars[$vars->name]->value);
continue;
}
-
- // 업로드 되지 않았다면 이전 데이터를 그대로 사용
+ // Use the previous data if not uploaded
if(!$image_obj['tmp_name']) {
$obj->{$vars->name} = $skin_vars[$vars->name]->value;
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;
}
-
- // 정상 파일 업로드
+ // Upload the file
FileHandler::removeFile($skin_vars[$vars->name]->value);
- // 변수를 바꿈
+ // Change a variable
unset($obj->{$vars->name});
$obj->{$vars->name} = $filename;
}
}
- // 해당 모듈의 전체 스킨 불러와서 이미지는 제거
+ // Load the entire skin of the module and then remove the image
/*
if($skin_info->extra_vars) {
foreach($skin_info->extra_vars as $vars) {
@@ -291,8 +268,7 @@
*/
$oModuleController = &getController('module');
$oModuleController->deleteModuleSkinVars($module_srl);
-
- // 등록
+ // Register
$oModuleController->insertModuleSkinVars($module_srl, $obj);
}
@@ -303,7 +279,7 @@
}
/**
- * @brief 모듈 일괄 정리
+ * @brief List module information
**/
function procModuleAdminModuleSetup() {
$vars = Context::getRequestVars();
@@ -330,7 +306,7 @@
}
/**
- * @brief 모듈 권한 일괄 정리
+ * @brief List permissions of the module
**/
function procModuleAdminModuleGrantSetup() {
$module_srls = Context::get('module_srls');
@@ -350,15 +326,13 @@
$grant_list->manager->default = 'manager';
foreach($grant_list as $grant_name => $grant_info) {
- // default값을 구함
+ // Get the default value
$default = Context::get($grant_name.'_default');
-
- // -1 = 로그인 사용자만, 0 = 모든 사용자
+ // -1 = Sign only, 0 = all users
if(strlen($default)){
$grant->{$grant_name}[] = $default;
continue;
-
- // 특정 그룹 사용자
+ // Users in a particular group
} else {
$group_srls = Context::get($grant_name);
if($group_srls) {
@@ -373,14 +347,13 @@
}
- // DB에 저장
+ // Stored in the DB
foreach($modules as $module_srl) {
$args = null;
$args->module_srl = $module_srl;
$output = executeQuery('module.deleteModuleGrants', $args);
if(!$output->toBool()) continue;
-
- // DB에 권한 저장
+ // Permissions stored in the DB
foreach($grant as $grant_name => $group_srls) {
foreach($group_srls as $key => $val) {
$args = null;
@@ -396,24 +369,21 @@
}
/**
- * @brief 언어 추가/ 업데이트
+ * @brief Add/Update language
**/
function procModuleAdminInsertLang() {
- // 언어코드명 가져옴
+ // Get language code
$site_module_info = Context::get('site_module_info');
$args->site_srl = (int)$site_module_info->site_srl;
$args->name = str_replace(' ','_',Context::get('lang_code'));
if(!$args->name) return new Object(-1,'msg_invalid_request');
-
- // 언어코드가 있는지 조사
+ // Check whether a language code exists
$output = executeQueryArray('module.getLang', $args);
if(!$output->toBool()) return $output;
-
- // 있으면 업데이트를 위해 기존 값들을 지움
+ // If exists, clear the old values for updating
if($output->data) $output = executeQuery('module.deleteLang', $args);
if(!$output->toBool()) return $output;
-
- // 입력
+ // Enter
$lang_supported = Context::get('lang_supported');
foreach($lang_supported as $key => $val) {
$args->lang_code = $key;
@@ -431,10 +401,10 @@
}
/**
- * @brief 언어 제거
+ * @brief Remove language
**/
function procModuleAdminDeleteLang() {
- // 언어코드명 가져옴
+ // Get language code
$site_module_info = Context::get('site_module_info');
$args->site_srl = (int)$site_module_info->site_srl;
$args->name = str_replace(' ','_',Context::get('name'));
@@ -446,10 +416,10 @@
}
/**
- * @brief 사용자 정이 언어코드 파일 저장
+ * @brief Save the file of user-defined language code
**/
function makeCacheDefinedLangCode($site_srl = 0) {
- // 현재 사이트의 언어파일 가져오기
+ // Get the language file of the current site
if(!$site_srl) {
$site_module_info = Context::get('site_module_info');
$args->site_srl = (int)$site_module_info->site_srl;
@@ -458,8 +428,7 @@
}
$output = executeQueryArray('module.getLang', $args);
if(!$output->toBool() || !$output->data) return;
-
- // 캐시 디렉토리 설정
+ // Set the cache directory
$cache_path = _XE_PATH_.'files/cache/lang_defined/';
if(!is_dir($cache_path)) FileHandler::makeDir($cache_path);
diff --git a/modules/module/module.admin.model.php b/modules/module/module.admin.model.php
index 12faafa23..ff92fa690 100644
--- a/modules/module/module.admin.model.php
+++ b/modules/module/module.admin.model.php
@@ -3,20 +3,20 @@
* @class moduleAdminModel
* @author NHN (developers@xpressengine.com)
* @version 0.1
- * @brief module 모듈의 AdminModel class
+ * @brief AdminModel class of the "module" module
**/
class moduleAdminModel extends module {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief module_srl (,콤마로 연결된)로 대상 모듈들의 목록을 return)
- * 모듈 선택기(ModuleSelector)에서 사용됨
+ * @brief Return a list of target modules by using module_srls separated by comma(,)
+ * Used in the ModuleSelector
**/
function getModuleAdminModuleList() {
$args->module_srls = Context::get('module_srls');
@@ -47,15 +47,14 @@
}
/**
- * @brief 공통 :: 모듈의 모듈 권한 출력 페이지
- * 모듈의 모듈 권한 출력은 모든 모듈에서 module instance를 이용할때 사용할 수 있음
+ * @brief Common:: module's permission displaying page in the module
+ * Available when using module instance in all the modules
**/
function getModuleGrantHTML($module_srl, $source_grant_list) {
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
-
- // access, manager 권한은 가상 권한으로 설정
+ // Grant virtual permission for access and manager
$grant_list->access->title = Context::getLang('grant_access');
$grant_list->access->default = 'guest';
if(count($source_grant_list)) {
@@ -68,8 +67,7 @@
$grant_list->manager->title = Context::getLang('grant_manager');
$grant_list->manager->default = 'manager';
Context::set('grant_list', $grant_list);
-
- // 현재 모듈에 설정된 권한 그룹을 가져옴
+ // Get a permission group granted to the current module
$default_grant = array();
$args->module_srl = $module_srl;
$output = executeQueryArray('module.getModuleGrants', $args);
@@ -87,22 +85,20 @@
Context::set('selected_group', $selected_group);
Context::set('default_grant', $default_grant);
Context::set('module_srl', $module_srl);
- // 현재 모듈에 설정된 관리자 아이디를 추출
+ // Extract admin ID set in the current module
$admin_member = $oModuleModel->getAdminId($module_srl);
Context::set('admin_member', $admin_member);
-
- // 그룹을 가져옴
+ // Get a list of groups
$oMemberModel = &getModel('member');
$group_list = $oMemberModel->getGroups($module_info->site_srl);
Context::set('group_list', $group_list);
-
- // grant 정보를 추출
+ // Get information of module_grants
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($this->module_path.'tpl', 'module_grants');
}
/**
- * @brief 공통 :: 모듈의 스킨 설정 출력 페이지
+ * @brief Common:: skin setting page for the module
**/
function getModuleSkinHTML($module_srl) {
$oModuleModel = &getModel('module');
@@ -111,11 +107,9 @@
$skin = $module_info->skin;
$module_path = './modules/'.$module_info->module;
-
- // 스킨의 XML 정보를 구함
+ // Get XML information of the skin
$skin_info = $oModuleModel->loadSkinInfo($module_path, $skin);
-
- // DB에 설정된 스킨 정보를 구함
+ // Get skin information set in DB
$skin_vars = $oModuleModel->getModuleSkinVars($module_srl);
if(count($skin_info->extra_vars)) {
@@ -141,8 +135,8 @@
}
/**
- * @brief 특정 언어 코드에 대한 값들을 가져오기
- * lang_code를 직접 기입하면 해당 언어코드에 대해서만 가져오고 값이 없으면 $name을 그대로 return
+ * @brief Get values for a particular language code
+ * Return its corresponding value if lang_code is specified. Otherwise return $name.
**/
function getLangCode($site_srl, $name) {
$lang_supported = Context::get('lang_supported');
@@ -176,7 +170,7 @@
}
/**
- * @brief 모듈 언어를 ajax로 요청시 return
+ * @brief Return if the module language in ajax is requested
**/
function getModuleAdminLangCode() {
$name = Context::get('name');
diff --git a/modules/module/module.admin.view.php b/modules/module/module.admin.view.php
index c4445c659..9b58c582a 100644
--- a/modules/module/module.admin.view.php
+++ b/modules/module/module.admin.view.php
@@ -2,103 +2,93 @@
/**
* @class moduleAdminView
* @author NHN (developers@xpressengine.com)
- * @brief module 모듈의 admin view class
+ * @brief admin view class of the module module
**/
class moduleAdminView extends module {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
- // template path 지정
+ // Set the template path
$this->setTemplatePath($this->module_path.'tpl');
}
/**
- * @brief 모듈 관리자 페이지
+ * @brief Module admin page
**/
function dispModuleAdminContent() {
$this->dispModuleAdminList();
}
/**
- * @brief 모듈 목록 출력
+ * @brief Display a lost of modules
**/
function dispModuleAdminList() {
- // 모듈 목록을 구해서
+ // Obtain a list of modules
$oModuleModel = &getModel('module');
$module_list = $oModuleModel->getModuleList();
Context::set('module_list', $module_list);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('module_list');
}
/**
- * @brief 모듈의 상세 정보(conf/info.xml)를 팝업 출력
+ * @brief Pop-up details of the module (conf/info.xml)
**/
function dispModuleAdminInfo() {
- // 모듈 목록을 구해서
+ // Obtain a list of modules
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoXml(Context::get('selected_module'));
Context::set('module_info', $module_info);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('module_info');
}
/**
- * @brief 모듈 카테고리 목록
+ * @brief Module Categories
**/
function dispModuleAdminCategory() {
$module_category_srl = Context::get('module_category_srl');
- // 모듈 목록을 구해서
+ // Obtain a list of modules
$oModuleModel = &getModel('module');
-
- // 선택된 카테고리가 있으면 해당 카테고리의 정보 수정 페이지로
+ // Display the category page if a category is selected
if($module_category_srl) {
$selected_category = $oModuleModel->getModuleCategory($module_category_srl);
Context::set('selected_category', $selected_category);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('category_update_form');
-
- // 아니면 전체 목록
+ // If not selected, display a list of categories
} else {
$category_list = $oModuleModel->getModuleCategories();
Context::set('category_list', $category_list);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('category_list');
}
}
/**
- * @brief 모듈 복사 기능
+ * @brief Feature to copy module
**/
function dispModuleAdminCopyModule() {
- // 복사하려는 대상 모듈을 구함
+ // Get a target module to copy
$module_srl = Context::get('module_srl');
-
- // 해당 모듈의 정보를 구함
+ // Get information of the module
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
Context::set('module_info', $module_info);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('copy_module');
}
/**
- * @brief 모듈 기본 설정 일괄 적용
+ * @brief Applying the default settings to all modules
**/
function dispModuleAdminModuleSetup() {
$module_srls = Context::get('module_srls');
@@ -108,54 +98,45 @@
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]);
-
- // 모듈의 스킨 목록을 구함
+ // Get a skin list of the module
$skin_list = $oModuleModel->getSkins('./modules/'.$module_info->module);
Context::set('skin_list',$skin_list);
-
- // 레이아웃 목록을 구해옴
+ // Get a layout list
$oLayoutMode = &getModel('layout');
$layout_list = $oLayoutMode->getLayoutList();
Context::set('layout_list', $layout_list);
-
- // 모듈 카테고리 목록을 구함
+ // Get a list of module categories
$module_category = $oModuleModel->getModuleCategories();
Context::set('module_category', $module_category);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('module_setup');
}
/**
- * @brief 모듈 추가 설정 일괄 적용
+ * @brief Apply module addition settings to all modules
**/
function dispModuleAdminModuleAdditionSetup() {
$module_srls = Context::get('module_srls');
$modules = explode(',',$module_srls);
if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request');
-
- // content는 다른 모듈에서 call by reference로 받아오기에 미리 변수 선언만 해 놓음
+ // pre-define variables because you can get contents from other module (call by reference)
$content = '';
-
- // 추가 설정을 위한 트리거 호출
- // 게시판 모듈이지만 차후 다른 모듈에서의 사용도 고려하여 trigger 이름을 공용으로 사용할 수 있도록 하였음
+ // Call a trigger for additional settings
+ // Considering uses in the other modules, trigger name cen be publicly used
$output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'before', $content);
$output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'after', $content);
Context::set('setup_content', $content);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('module_addition_setup');
}
/**
- * @brief 모듈 권한 설정 일괄 적용
+ * @brief Applying module permission settings to all modules
**/
function dispModuleAdminModuleGrantSetup() {
$module_srls = Context::get('module_srls');
@@ -167,8 +148,7 @@
$module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]);
$xml_info = $oModuleModel->getModuleActionXml($module_info->module);
$source_grant_list = $xml_info->grant;
-
- // access, manager 권한은 가상 권한으로 설정
+ // Grant virtual permissions for access and manager
$grant_list->access->title = Context::getLang('grant_access');
$grant_list->access->default = 'guest';
if(count($source_grant_list)) {
@@ -181,42 +161,36 @@
$grant_list->manager->title = Context::getLang('grant_manager');
$grant_list->manager->default = 'manager';
Context::set('grant_list', $grant_list);
-
- // 그룹을 가져옴
+ // Get a list of groups
$oMemberModel = &getModel('member');
$group_list = $oMemberModel->getGroups($module_info->site_srl);
Context::set('group_list', $group_list);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('module_grant_setup');
}
/**
- * @brief 언어 코드
+ * @brief Language codes
**/
function dispModuleAdminLangcode() {
- // 현재 사이트의 언어파일 가져오기
+ // Get the language file of the current site
$site_module_info = Context::get('site_module_info');
$args->site_srl = (int)$site_module_info->site_srl;
$args->sort_index = 'name';
$args->order_type = 'asc';
$output = executeQueryArray('module.getLangList', $args);
Context::set('lang_list', $output->data);
-
- // 현재 선택된 언어 가져오기
+ // Get the currently selected language
$name = Context::get('name');
if($name) {
$oModuleAdminModel = &getAdminModel('module');
Context::set('selected_lang', $oModuleAdminModel->getLangCode($args->site_srl,'$user_lang->'.$name));
}
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('module_langcode');
}
diff --git a/modules/module/module.class.php b/modules/module/module.class.php
index 487e8c100..8c75264b0 100644
--- a/modules/module/module.class.php
+++ b/modules/module/module.class.php
@@ -2,27 +2,25 @@
/**
* @class module
* @author NHN (developers@xpressengine.com)
- * @brief module 모듈의 high class
+ * @brief high class of the module module
**/
class module extends ModuleObject {
/**
- * @brief 설치시 추가 작업이 필요할시 구현
+ * @brief Implement if additional tasks are necessary when installing
**/
function moduleInstall() {
- // action forward에 등록 (관리자 모드에서 사용하기 위함)
+ // Register action forward (to use in administrator mode)
$oModuleController = &getController('module');
$oDB = &DB::getInstance();
$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"), true);
$oDB->addIndex('sites','unique_domain',array('domain'),true);
-
- // module 모듈에서 사용할 디렉토리 생성
+ // Create a directory to use in the module module
FileHandler::makeDir('./files/cache/module_info');
FileHandler::makeDir('./files/cache/triggers');
-
- // sites 테이블에 기본 사이트 정보 입력
+ // Insert site information into the sites table
$args->site_srl = 0;
$output = $oDB->executeQuery('module.getSite', $args);
if(!$output->data || !$output->data->index_module_srl) {
@@ -43,34 +41,28 @@
}
/**
- * @brief 설치가 이상이 없는지 체크하는 method
+ * @brief a method to check if successfully installed
**/
function checkUpdate() {
$oDB = &DB::getInstance();
-
- // 2008. 10. 27 module_part_config 테이블의 결합 인덱스 추가
+ // 2008. 10. 27 Add multi-index in the table, the module_part_config
if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) return true;
-
- // 2008. 11. 13 modules 의 mid를 unique를 없애고 site_srl을 추가 후에 site_srl + mid unique index
+ // 2008. 11. 13 Delete unique constraint on mid in modules. Add site_srl and then create unique index on site_srl and mid
if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true;
-
- // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트
+ // Move permissions/skin information of all modules to the table, grants.
if($oDB->isColumnExists('modules', 'grants')) return true;
-
- // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트
+ // Move permissions/skin information of all modules to the table, grants.
if(!$oDB->isColumnExists('sites', 'default_language')) return true;
-
- // extra_vars* 컬럼 제거
+ // Delete extra_vars* column
for($i=1;$i<=20;$i++) {
if($oDB->isColumnExists("documents","extra_vars".$i)) return true;
}
-
- // sites 테이블에 기본 사이트 정보 입력
+ // Insert site information to the table, sites
$args->site_srl = 0;
$output = $oDB->executeQuery('module.getSite', $args);
if(!$output->data) return true;
- // sites 테이블에서 도메인이 인덱스로 걸린경우
+ // If domain index is defined on the table, sites
if($oDB->isIndexExists('sites', 'idx_domain')) return true;
if(!$oDB->isIndexExists('sites','unique_domain')) return true;
@@ -83,12 +75,11 @@
}
/**
- * @brief 업데이트 실행
+ * @brief Execute update
**/
function moduleUpdate() {
$oDB = &DB::getInstance();
-
- // 2008. 10. 27 module_part_config 테이블의 결합 인덱스 추가하고 기존에 module_config에 몰려 있던 모든 정보를 재점검
+ // 2008. 10. 27 module_part_config Add a multi-index to the table and check all information of module_configg
if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) {
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
@@ -140,43 +131,35 @@
}
$oDB->addIndex("module_part_config","idx_module_part_config", array("module","module_srl"));
}
-
- // 2008. 11. 13 modules 의 mid를 unique를 없애고 site_srl을 추가 후에 site_srl + mid unique index
+ // 2008. 11. 13 drop index(unique_mid). Add a column and index on site_srl and mid columns
if(!$oDB->isIndexExists('modules',"idx_site_mid")) {
$oDB->dropIndex("modules","unique_mid",true);
$oDB->addColumn('modules','site_srl','number',11,0,true);
$oDB->addIndex("modules","idx_site_mid", array("site_srl","mid"),true);
}
-
- // document 확장변수의 확장을 위한 처리
+ // document extra vars
if(!$oDB->isTableExists('document_extra_vars')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_vars.xml');
if(!$oDB->isTableExists('document_extra_keys')) $oDB->createTableByXmlFile('./modules/document/schemas/document_extra_keys.xml');
-
- // 모든 모듈의 권한, 스킨정보, 확장정보, 관리자 아이디를 grants 테이블로 이전시키는 업데이트
+ // Move permission, skin info, extection info, admin ID of all modules to the table, grants
if($oDB->isColumnExists('modules', 'grants')) {
$oModuleController = &getController('module');
$oDocumentController = &getController('document');
-
- // 현재 시스템 언어 코드값을 가져옴
+ // Get a value of the current system language code
$lang_code = Context::getLangType();
-
- // 모든 모듈의 module_info를 가져옴
+ // Get module_info of all modules
$output = executeQueryArray('module.getModuleInfos');
if(count($output->data)) {
foreach($output->data as $module_info) {
- // 모듈들의 권한/ 확장변수(게시글 확장 포함)/ 스킨 변수/ 최고관리권한 정보 분리
+ // Separate information about permission granted to the module, extra vars, skin vars, super-admin's authority
$module_srl = trim($module_info->module_srl);
-
- // 권한 등록
+ // grant an authority
$grants = unserialize($module_info->grants);
if($grants) $oModuleController->insertModuleGrants($module_srl, $grants);
-
- // 스킨 변수 등록
+ // Insert skin vars
$skin_vars = unserialize($module_info->skin_vars);
if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars);
-
- // 최고 관리자 아이디 등록
+ // Insert super admin's ID
$admin_id = trim($module_info->admin_id);
if($admin_id && $admin_id != 'Array') {
$admin_ids = explode(',',$admin_id);
@@ -186,8 +169,7 @@
}
}
}
-
- // 모듈별 추가 설정 저장 (기본 modules에 없던 컬럼 데이터)
+ // Save extra configurations for each module(column data which doesn't exist in the defaut modules)
$extra_vars = unserialize($module_info->extra_vars);
$document_extra_keys = null;
if($extra_vars->extra_vars && count($extra_vars->extra_vars)) {
@@ -197,9 +179,9 @@
if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars);
/**
- * 게시글 확장변수 이동 (documents모듈에서 해야 하지만 modules 테이블의 추가 변수들이 정리되기에 여기서 함)
+ * Move document extra vars(it should have conducted in the documents module however extra vars in modules table should be listed up in this module)
**/
- // 플래닛모듈의 경우 직접 추가 변수 입력
+ // Insert extra vars if planet module is
if($module_info->module == 'planet') {
if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array();
$planet_extra_keys->name = 'postscript';
@@ -210,22 +192,19 @@
$planet_extra_keys->desc = '';
$document_extra_keys[20] = $planet_extra_keys;
}
-
- // 게시글 확장변수 키 등록
+ // Register keys for document extra vars
if(count($document_extra_keys)) {
foreach($document_extra_keys as $var_idx => $val) {
$oDocumentController->insertDocumentExtraKey($module_srl, $var_idx, $val->name, $val->type, $val->is_required, $val->search, $val->default, $val->desc, 'extra_vars'.$var_idx);
}
-
- // 2009-04-14 #17923809 게시물 100개의 확장 변수만 이전되는 문제점 수정
+ // 2009-04-14 Fixed a bug that only 100 extra vars are moved
$oDocumentModel = &getModel('document');
$total_count = $oDocumentModel->getDocumentCount($module_srl);
if ($total_count > 0) {
$per_page = 100;
$total_pages = (int) (($total_count - 1) / $per_page) + 1;
-
- // 확장변수가 존재하면 확장변수 가져오기
+ // Get extra vars if exist
$doc_args = null;
$doc_args->module_srl = $module_srl;
$doc_args->list_count = $per_page;
@@ -248,8 +227,7 @@
} // for total_pages
} // if count
}
-
- // 해당 모듈들의 추가 변수들 제거
+ // Additional variables of the module, remove
$module_info->grant = null;
$module_info->extra_vars = null;
$module_info->skin_vars = null;
@@ -257,30 +235,26 @@
executeQuery('module.updateModule', $module_info);
}
}
-
- // 각종 column drop
+ // Various column drop
$oDB->dropColumn('modules','grants');
$oDB->dropColumn('modules','admin_id');
$oDB->dropColumn('modules','skin_vars');
$oDB->dropColumn('modules','extra_vars');
}
-
- // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트
+ // Rights of all modules/skins transferring the information into a table Update grants
if(!$oDB->isColumnExists('sites', 'default_language')) {
$oDB->addColumn('sites','default_language','varchar',255,0,false);
}
-
- // extra_vars* 컬럼 제거
+ // extra_vars * Remove Column
for($i=1;$i<=20;$i++) {
if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue;
$oDB->dropColumn('documents','extra_vars'.$i);
}
-
- // sites 테이블에 기본 사이트 정보 입력
+ // Enter the main site information sites on the table
$args->site_srl = 0;
$output = $oDB->executeQuery('module.getSite', $args);
if(!$output->data) {
- // 기본 mid, 언어 구함
+ // Basic mid, language Wanted
$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
$db_info = Context::getDBInfo();
$domain = Context::getDefaultUrl();
@@ -348,19 +322,16 @@
}
/**
- * @brief 캐시 파일 재생성
+ * @brief Re-generate the cache file
**/
function recompileCache() {
- // 모듈 정보 캐시 파일 모두 삭제
+ // Delete all cache files, the module information
FileHandler::removeFilesInDir("./files/cache/module_info");
-
- // 트리거 정보가 있는 파일 모두 삭제
+ // Delete all the files that trigger information
FileHandler::removeFilesInDir("./files/cache/triggers");
-
- // DB캐시 파일을 모두 삭제
+ // DB cache, delete all the files
FileHandler::removeFilesInDir("./files/cache/db");
-
- // 기타 캐시 삭제
+ // Other Cache
FileHandler::removeDir("./files/cache/tmp");
}
}
diff --git a/modules/module/module.controller.php b/modules/module/module.controller.php
index 298455ccf..c42dc4f1c 100644
--- a/modules/module/module.controller.php
+++ b/modules/module/module.controller.php
@@ -2,21 +2,21 @@
/**
* @class moduleController
* @author NHN (developers@xpressengine.com)
- * @brief module 모듈의 controller class
+ * @brief controller class of the module module
**/
class moduleController extends module {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief action forward 추가
- * action foward는 등록된 action이 요청된 모듈에 없을 경우 찾아서 포워딩을 하는 구조이다
- * 모듈의 설치시에 사용된다.
+ * @brief Add action forward
+ * Action forward finds and forwards if an action is not in the requested module
+ * This is used when installing a module
**/
function insertActionForward($module, $type, $act) {
$args->module = $module;
@@ -28,7 +28,7 @@
}
/**
- * @brief action forward 삭제
+ * @brief Delete action forward
**/
function deleteActionForward($module, $type, $act) {
$args->module = $module;
@@ -40,8 +40,8 @@
}
/**
- * @brief module trigger 추가
- * module trigger는 trigger 대상이 등록된 대상을 호출하는 방법이다.
+ * @brief Add module trigger
+ * module trigger is to call a trigger to a target module
*
**/
function insertTrigger($trigger_name, $module, $type, $called_method, $called_position) {
@@ -52,15 +52,14 @@
$args->called_position = $called_position;
$output = executeQuery('module.insertTrigger', $args);
-
- // 트리거 정보가 있는 파일 모두 삭제
+ // Delete all the files which contain trigger information
FileHandler::removeFilesInDir("./files/cache/triggers");
return $output;
}
/**
- * @brief module trigger 삭제
+ * @brief Delete module trigger
*
**/
function deleteTrigger($trigger_name, $module, $type, $called_method, $called_position) {
@@ -71,15 +70,14 @@
$args->called_position = $called_position;
$output = executeQuery('module.deleteTrigger', $args);
-
- // 트리거 캐시 삭제
+ // Remove the trigger cache
FileHandler::removeFilesInDir('./files/cache/triggers');
return $output;
}
/**
- * @brief module extend 추가
+ * @brief Add module extend
*
**/
function insertModuleExtend($parent_module, $extend_module, $type, $kind=''){
@@ -103,7 +101,7 @@
}
/**
- * @brief module extend 삭제
+ * @brief Delete module extend
*
**/
function deleteModuleExtend($parent_module, $extend_module, $type, $kind=''){
@@ -121,8 +119,8 @@
}
/**
- * @brief 특정 모듈의 설정 입력
- * board, member등 특정 모듈의 global config 관리용
+ * @brief Enter a specific set of modules
+ * In order to manage global configurations of modules such as board, member and so on
**/
function insertModuleConfig($module, $config) {
$args->module = $module;
@@ -136,8 +134,8 @@
}
/**
- * @brief 특정 mid의 모듈 설정 정보 저장
- * mid의 모듈 의존적인 설정을 관리
+ * @brief Save module configurations of the mid
+ * Manage mid configurations depending on module
**/
function insertModulePartConfig($module, $module_srl, $config) {
$args->module = $module;
@@ -152,7 +150,7 @@
}
/**
- * @brief virtual site 생성
+ * @brief create virtual site
**/
function insertSite($domain, $index_module_srl) {
if(isSiteID($domain)) {
@@ -177,7 +175,7 @@
}
/**
- * @brief virtual site 수정
+ * @brief modify virtual site
**/
function updateSite($args) {
$oModuleModel = &getModel('module');
@@ -197,18 +195,16 @@
}
/**
- * @brief 모듈 정보 정리
+ * @brief Arrange module information
**/
function arrangeModuleInfo(&$args, &$extra_vars) {
- // 불필요한 내용 제거
+ // Remove unnecessary information
unset($args->body);
unset($args->act);
unset($args->page);
-
- // mid값 검사
+ // Test mid value
if(!preg_match("/^[a-z][a-z0-9_]+$/i", $args->mid)) return new Object(-1, 'msg_limit_mid');
-
- // 변수를 검사 (modules의 기본 변수와 그렇지 않은 변수로 분리)
+ // Test variables (separate basic vars and other vars in modules)
$extra_vars = clone($args);
unset($extra_vars->module_srl);
unset($extra_vars->module);
@@ -235,13 +231,12 @@
}
/**
- * @brief 모듈 입력
+ * @brief Insert module
**/
function insertModule($args) {
$output = $this->arrangeModuleInfo($args, $extra_vars);
if(!$output->toBool()) return $output;
-
- // 이미 존재하는 모듈 이름인지 체크
+ // Check whether the module name already exists
if(!$args->site_srl) $args->site_srl = 0;
$oModuleModel = &getModel('module');
if($oModuleModel->isIDExists($args->mid, $args->site_srl)) return new Object(-1, 'msg_module_name_exists');
@@ -249,23 +244,19 @@
// begin transaction
$oDB = &DB::getInstance();
$oDB->begin();
-
- // 선택된 스킨정보에서 colorset을 구함
+ // Get colorset from the skin information
$module_path = ModuleHandler::getModulePath($args->module);
$skin_info = $oModuleModel->loadSkinInfo($module_path, $args->skin);
$skin_vars->colorset = $skin_info->colorset[0]->name;
-
- // 변수 정리후 query 실행
+ // Arrange variables and then execute a query
if(!$args->module_srl) $args->module_srl = getNextSequence();
-
- // 모듈 등록
+ // Insert a module
$output = executeQuery('module.insertModule', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
-
- // 모듈 추가 변수 등록
+ // Insert module extra vars
$this->insertModuleExtraVars($args->module_srl, $extra_vars);
// commit
@@ -276,7 +267,7 @@
}
/**
- * @brief 모듈의 정보를 수정
+ * @brief Modify module information
**/
function updateModule($args) {
$output = $this->arrangeModuleInfo($args, $extra_vars);
@@ -303,8 +294,7 @@
$oDB->rollback();
return $output;
}
-
- // 모듈 추가 변수 등록
+ // Insert module extra vars
$this->insertModuleExtraVars($args->module_srl, $extra_vars);
$oDB->commit();
@@ -314,7 +304,7 @@
}
/**
- * @brief 모듈의 가상사이트 변경
+ * @brief Change the module's virtual site
**/
function updateModuleSite($module_srl, $site_srl, $layout_srl = 0) {
$args->module_srl = $module_srl;
@@ -324,14 +314,13 @@
}
/**
- * @brief 모듈을 삭제
+ * @brief Delete module
*
- * 모듈 삭제시는 관련 정보들을 모두 삭제 시도한다.
+ * Attempt to delete all related information when deleting a module.
**/
function deleteModule($module_srl) {
if(!$module_srl) return new Object(-1,'msg_invalid_request');
-
- // trigger 호출 (before)
+ // Call a trigger (before)
$trigger_obj->module_srl = $module_srl;
$output = ModuleHandler::triggerCall('module.deleteModule', 'before', $trigger_obj);
if(!$output->toBool()) return $output;
@@ -341,27 +330,21 @@
$oDB->begin();
$args->module_srl = $module_srl;
-
- // module 정보를 DB에서 삭제
+ // Delete module information from the DB
$output = executeQuery('module.deleteModule', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
-
- // 권한 정보 삭제
+ // Delete permission information
$this->deleteModuleGrants($module_srl);
-
- // 스킨 정보 삭제
+ // Remove skin information
$this->deleteModuleSkinVars($module_srl);
-
- // 모듈 추가 변수 삭제
+ // Delete module extra vars
$this->deleteModuleExtraVars($module_srl);
-
- // 모듈 관리자 제거
+ // Remove the module manager
$this->deleteAdminId($module_srl);
-
- // trigger 호출 (after)
+ // Call a trigger (after)
if($output->toBool()) {
$trigger_output = ModuleHandler::triggerCall('module.deleteModule', 'after', $trigger_obj);
if(!$trigger_output->toBool()) {
@@ -377,10 +360,10 @@
}
/**
- * @brief 모듈의 기타 정보를 변경
+ * @brief Change other information of the module
**/
function updateModuleSkinVars($module_srl, $skin_vars) {
- // skin_vars 정보 세팅
+ // skin_vars setting
$args->module_srl = $module_srl;
$args->skin_vars = $skin_vars;
$output = executeQuery('module.updateModuleSkinVars', $args);
@@ -390,7 +373,7 @@
}
/**
- * @brief 모든 모듈의 is_default값을 N 으로 세팅 (기본 모듈 해제)
+ * @brief Set is_default as N in all modules(the default module is disabled)
**/
function clearDefaultModule() {
$output = executeQuery('module.clearDefaultModule');
@@ -400,14 +383,14 @@
}
/**
- * @brief 지정된 menu_srl에 속한 mid 의 menu_srl 을 변경
+ * @brief Update menu_srl of mid which belongs to menu_srl
**/
function updateModuleMenu($args) {
return executeQuery('module.updateModuleMenu', $args);
}
/**
- * @brief 지정된 menu_srl에 속한 mid 의 layout_srl을 변경
+ * @brief Update layout_srl of mid which belongs to menu_srl
**/
function updateModuleLayout($layout_srl, $menu_srl_list) {
if(!count($menu_srl_list)) return;
@@ -419,15 +402,14 @@
}
/**
- * @brief 사이트의 관리를 변경
+ * @brief Change the site administrator
**/
function insertSiteAdmin($site_srl, $arr_admins) {
- // 사이트 관리자 제거
+ // Remove the site administrator
$args->site_srl = $site_srl;
$output = executeQuery('module.deleteSiteAdmin', $args);
if(!$output->toBool()) return $output;
-
- // 관리자 대상 멤버 번호를 구함
+ // Get user id of an administrator
if(!is_array($arr_admins) || !count($arr_admins)) return new Object();
foreach($arr_admins as $key => $user_id) {
if(!trim($user_id)) continue;
@@ -450,7 +432,7 @@
}
/**
- * @brief 특정 모듈에 관리자 아이디 지정
+ * @brief Specify the admin ID to a module
**/
function insertAdminId($module_srl, $admin_id) {
$oMemberModel = &getModel('member');
@@ -462,7 +444,7 @@
}
/**
- * @brief 특정 모듈의 관리자 아이디 제거
+ * @brief Remove the admin ID from a module
**/
function deleteAdminId($module_srl, $admin_id = '') {
$args->module_srl = $module_srl;
@@ -476,7 +458,7 @@
}
/**
- * @brief 특정 모듈에 스킨 변수 등록
+ * @brief Insert skin vars to a module
**/
function insertModuleSkinVars($module_srl, $obj) {
$this->deleteModuleSkinVars($module_srl);
@@ -484,10 +466,10 @@
$args->module_srl = $module_srl;
foreach($obj as $key => $val) {
- // #17927989 예전 블로그 모듈을 사용하던 게시판의 경우
- // 스킨 정보 필드에 메뉴 항목(stdClass)을 저장해놓은 경우가 있어
- // 1.2.0 이상 버전으로 업그레이드한 후 모듈 업데이트할 때
- // 오류가 발생하는 문제 수정
+ // #17927989 For an old board which used the old blog module
+ // it often saved menu item(stdClass) on the skin info column
+ // When updating the module on XE core 1.2.0 later versions, it occurs an error
+ // fixed the error
if (is_object($val)) continue;
if (is_array($val)) $val = serialize($val);
@@ -499,7 +481,7 @@
}
/**
- * @brief 특정 모듈의 스킨 변수 제거
+ * @brief Remove skin vars of a module
**/
function deleteModuleSkinVars($module_srl) {
$args->module_srl = $module_srl;
@@ -507,7 +489,7 @@
}
/**
- * @brief 특정 모듈에 확장 변수 등록
+ * @brief Register extra vars to the module
**/
function insertModuleExtraVars($module_srl, $obj) {
$this->deleteModuleExtraVars($module_srl);
@@ -524,7 +506,7 @@
}
/**
- * @brief 특정 모듈의 확장 변수 제거
+ * @brief Remove extra vars from the module
**/
function deleteModuleExtraVars($module_srl) {
$args->module_srl = $module_srl;
@@ -532,7 +514,7 @@
}
/**
- * @brief 특정 모듈에 권한 등록
+ * @brief Grant permission to the module
**/
function insertModuleGrants($module_srl, $obj) {
$this->deleteModuleGrants($module_srl);
@@ -554,7 +536,7 @@
}
/**
- * @brief 특정 모듈의 권한 제거
+ * @brief Remove permission from the module
**/
function deleteModuleGrants($module_srl) {
$args->module_srl = $module_srl;
@@ -562,7 +544,7 @@
}
/**
- * @brief 사용자 정의 언어 변경
+ * @brief Change user-defined language
**/
function replaceDefinedLangCode(&$output) {
$output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', array($this,'_replaceLangCode'), $output);
@@ -586,7 +568,7 @@
/**
- * @brief 파일박스에 파일 추가 및 업데이트
+ * @brief Add and update a file into the file box
**/
function procModuleFileBoxAdd(){
@@ -627,7 +609,7 @@
/**
- * @brief 파일박스에 파일 업데이트
+ * @brief Update a file into the file box
**/
function updateModuleFileBox($vars){
@@ -661,7 +643,7 @@
/**
- * @brief 파일박스에 파일 추가
+ * @brief Add a file into the file box
**/
function insertModuleFileBox($vars){
// set module_filebox_srl
@@ -694,7 +676,7 @@
/**
- * @brief 파일박스에 파일 삭제
+ * @brief Delete a file from the file box
**/
function procModuleFileBoxDelete(){
diff --git a/modules/module/module.model.php b/modules/module/module.model.php
index 86f47fca0..e2251e4a2 100644
--- a/modules/module/module.model.php
+++ b/modules/module/module.model.php
@@ -2,37 +2,34 @@
/**
* @class moduleModel
* @author NHN (developers@xpressengine.com)
- * @brief module 모듈의 Model class
+ * @brief Model class of module module
**/
class moduleModel extends module {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief mid, vid 사용할 수 있는지 검사
+ * @brief Check if mid, vid are available
**/
function isIDExists($id, $site_srl = 0) {
if(!preg_match('/^[a-z]{1}([a-z0-9_]+)$/i',$id)) return true;
-
- // directory 및 rss/atom/api 등 예약어 검사
+ // directory and rss/atom/api reserved checking, etc.
$dirs = FileHandler::readDir(_XE_PATH_);
$dirs[] = 'rss';
$dirs[] = 'atom';
$dirs[] = 'api';
if(in_array($id, $dirs)) return true;
-
- // mid 검사
+ // mid test
$args->mid = $id;
$args->site_srl = $site_srl;
$output = executeQuery('module.isExistsModuleName', $args);
if($output->data->count) return true;
-
- // vid 검사 (site_srl이 0일때 즉 가상사이트가 아닌 경우 mid != vid임을 체크)
+ // vid test (check mid != vid if site_srl=0, which means it is not a virtual site)
if(!$site_srl) {
$site_args->domain = $id;
$output = executeQuery('module.isExistsSiteDomain', $site_args);
@@ -43,7 +40,7 @@
}
/**
- * @brief site 정보를 구함
+ * @brief Get site information
**/
function getSiteInfo($site_srl) {
$args->site_srl = $site_srl;
@@ -58,8 +55,8 @@
}
/**
- * @brief document_srl로 모듈의 정보르 구함
- * 이 경우는 캐시파일을 이용할 수가 없음
+ * @brief Get module information with document_srl
+ * In this case, it is unable to use the cache file
**/
function getModuleInfoByDocumentSrl($document_srl) {
$args->document_srl = $document_srl;
@@ -68,15 +65,14 @@
}
/**
- * @brief domain에 따른 기본 mid를 구함
+ * @brief Get the defaul mid according to the domain
**/
function getDefaultMid() {
$default_url = preg_replace('/\/$/','',Context::getDefaultUrl());
$request_url = preg_replace('/\/$/','',Context::getRequestUri());
$vid = Context::get('vid');
$mid = Context::get('mid');
-
- // 기본 URL이 설정되어 있고 이 기본 URL과 요청 URL이 다르면 가상 사이트 확인
+ // Check a virtual site if the default URL is already set and is is defferent from a requested URL
if($default_url && $default_url != $request_url) {
$url_info = parse_url($request_url);
$hostname = $url_info['host'];
@@ -96,20 +92,17 @@
}
}
}
-
- // 가상 사이트가 아닐 경우 기본 사이트 정보를 구함
+ // If it is not a virtual site, get a default site information
if(!$output->data) {
$args->site_srl = 0;
$output = executeQuery('module.getSiteInfo', $args);
-
- // 기본 사이트 정보가 없으면 관련된 정보를 갱신
+ // Update the related informaion if there is no default site info
if(!$output->data) {
- // sites 테이블이 없을 경우 생성
+ // Create a table if sites table doesn't exist
$oDB = &DB::getInstance();
if(!$oDB->isTableExists('sites')) $oDB->createTableByXmlFile(_XE_PATH_.'modules/module/schemas/sites.xml');
if(!$oDB->isTableExists('sites')) return;
-
- // 기본 mid, 언어 구함
+ // Get mid, language
$mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args);
$db_info = Context::getDBInfo();
$domain = Context::getDefaultUrl();
@@ -136,7 +129,7 @@
}
/**
- * @brief mid로 모듈의 정보를 구함
+ * @brief Get module information by mid
**/
function getModuleInfoByMid($mid, $site_srl = 0) {
$args->mid = $mid;
@@ -148,10 +141,10 @@
}
/**
- * @brief module_srl에 해당하는 모듈의 정보를 구함
+ * @brief Get module information corresponding to module_srl
**/
function getModuleInfoByModuleSrl($module_srl) {
- // 데이터를 가져옴
+ // Get data
$args->module_srl = $module_srl;
$output = executeQuery('module.getMidInfo', $args);
if(!$output->data) return;
@@ -160,10 +153,10 @@
}
/**
- * @brief layout_srl에 해당하는 모듈의 정보를 구함
+ * @brief Get module information corresponding to layout_srl
**/
function getModulesInfoByLayout($layout_srl) {
- // 데이터를 가져옴
+ // Imported data
$args->layout_srl = $layout_srl;
$output = executeQueryArray('module.getModulesByLayout', $args);
@@ -177,7 +170,7 @@
}
/**
- * @brief 여러개의 module_srl에 해당하는 모듈의 정보를 구함
+ * @brief Get module information corresponding to multiple module_srls
**/
function getModulesInfo($module_srls) {
if(is_array($module_srls)) $module_srls = implode(',',$module_srls);
@@ -188,22 +181,20 @@
}
/**
- * @brief 모듈의 기본 정보에 추가 변수 구함
+ * @brief Add extra vars to the module basic information
**/
function addModuleExtraVars($module_info) {
- // 1개 이상의 모듈정보를 요청받아도 처리 가능하도록
+ // Process although one or more module informaion is requested
if(!is_array($module_info)) $target_module_info = array($module_info);
else $target_module_info = $module_info;
-
- // 모듈 번호를 구함
+ // Get module_srl
$module_srls = array();
foreach($target_module_info as $key => $val) {
$module_srl = $val->module_srl;
if(!$module_srl) continue;
$module_srls[] = $val->module_srl;
}
-
- // 모듈의 추가정보/ 스킨 정보를 추출
+ // Extract extra information of the module and skin
$extra_vars = $this->getModuleExtraVars($module_srls);
if(!count($module_srls) || !count($extra_vars)) return $module_info;
@@ -219,7 +210,7 @@
}
/**
- * @brief DB에 생성된 mid 전체 목록을 구해옴
+ * @brief Get a complete list of mid, which is created in the DB
**/
function getMidList($args = null) {
$output = executeQuery('module.getMidList', $args);
@@ -237,7 +228,7 @@
}
/**
- * @brief mid 목록에 대응하는 module_srl을 배열로 return
+ * @brief Return an array of module_srl corresponding to a mid list
**/
function getModuleSrlByMid($mid) {
if($mid && !is_array($mid)) $mid = explode(',',$mid);
@@ -262,7 +253,7 @@
}
/**
- * @brief act 값에 의한 forward 값을 구함
+ * @brief Get forward value by the value of act
**/
function getActionForward($act, $module = "") {
$args->act = $act;
@@ -273,7 +264,7 @@
}
/**
- * @brief trigger_name에 등록된 모든 목록을 추출
+ * @brief Get a list of all triggers on the trigger_name
**/
function getTriggers($trigger_name, $called_position) {
$args->trigger_name = $trigger_name;
@@ -283,7 +274,7 @@
}
/**
- * @brief 특정 trigger_name의 특정 대상을 추출
+ * @brief Get specific triggers from the trigger_name
**/
function getTrigger($trigger_name, $module, $type, $called_method, $called_position) {
$args->trigger_name = $trigger_name;
@@ -296,7 +287,7 @@
}
/**
- * @brief 특정 module extend 가져옴
+ * @brief Get module extend
**/
function getModuleExtend($parent_module, $type, $kind='') {
$key = $parent_module.'.'.$kind.'.'.$type;
@@ -311,7 +302,7 @@
}
/**
- * @brief 모든 module extend 가져옴
+ * @brief Get all the module extend
**/
function loadModuleExtends() {
$cache_file = './files/config/module_extend.php';
@@ -347,14 +338,13 @@
}
/**
- * @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함
+ * @brief Get information from conf/info.xml
**/
function getModuleInfoXml($module) {
- // 요청된 모듈의 경로를 구한다. 없으면 return
+ // Get a path of the requested module. Return if not exists.
$module_path = ModuleHandler::getModulePath($module);
if(!$module_path) return;
-
- // 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음
+ // Read the xml file for module skin information
$xml_file = sprintf("%s/conf/info.xml", $module_path);
if(!file_exists($xml_file)) return;
@@ -363,8 +353,7 @@
$xml_obj = $tmp_xml_obj->module;
if(!$xml_obj) return;
-
- // 모듈 정보
+ // Module Information
if($xml_obj->version && $xml_obj->attrs->version == '0.2') {
// module format 0.2
$module_info->title = $xml_obj->title->body;
@@ -446,8 +435,7 @@
$author_obj->homepage = $xml_obj->author->attrs->link;
$module_info->author[] = $author_obj;
}
-
- // action 정보를 얻어서 admin_index를 추가
+ // Add admin_index by using action information
$action_info = $this->getModuleActionXml($module);
$module_info->admin_index_act = $action_info->admin_index_act;
$module_info->default_index_act = $action_info->default_index_act;
@@ -457,39 +445,35 @@
}
/**
- * @brief module의 conf/module.xml 을 통해 grant(권한) 및 action 데이터를 return
- * module.xml 파일의 경우 파싱하는데 시간이 걸리기에 캐싱을 한다...
- * 캐싱을 할때 바로 include 할 수 있도록 역시 코드까지 추가하여 캐싱을 한다.
- * 이게 퍼포먼스 상으로는 좋은데 어떤 부정적인 결과를 유도할지는 잘 모르겠...
+ * @brief Return permisson and action data by conf/module.xml in the module
+ * Cache it because it takes too long to parse module.xml file
+ * When caching, add codes so to include it directly
+ * This is apparently good for performance, but not sure about its side-effects
**/
function getModuleActionXml($module) {
- // 요청된 모듈의 경로를 구한다. 없으면 return
+ // Get a path of the requested module. Return if not exists.
$class_path = ModuleHandler::getModulePath($module);
if(!$class_path) return;
-
- // 해당 경로에 module.xml 파일이 있는지 체크한다. 없으면 return
+ // Check if module.xml exists in the path. Return if not exist
$xml_file = sprintf("%sconf/module.xml", $class_path);
if(!file_exists($xml_file)) return;
-
- // 캐시된 파일이 있는지 확인
+ // Check if cached file exists
$cache_file = sprintf("./files/cache/module_info/%s.%s.php", $module, Context::getLangType());
-
- // 캐시 파일이 없거나 캐시 파일이 xml 파일보다 오래되었으면 내용 다시 갱신
+ // Update if no cache file exists or it is older than xml file
if(!file_exists($cache_file) || filemtime($cache_file)module)) return; ///< xml 내용중에 module 태그가 없다면 오류;;
+ if(!count($xml_obj->module)) return; // /< Error occurs if module tag doesn't included in the xml
- $grants = $xml_obj->module->grants->grant; ///< 권한 정보 (없는 경우도 있음)
- $permissions = $xml_obj->module->permissions->permission; ///< 권한 대행 (없는 경우도 있음)
- $actions = $xml_obj->module->actions->action; ///< action list (필수)
+ $grants = $xml_obj->module->grants->grant; // /< Permission information
+ $permissions = $xml_obj->module->permissions->permission; // /< Acting permission
+ $actions = $xml_obj->module->actions->action; // /< Action list (required)
$default_index = $admin_index = '';
-
- // 권한 정보의 정리
+ // Arrange permission information
if($grants) {
if(is_array($grants)) $grant_list = $grants;
else $grant_list[] = $grants;
@@ -506,8 +490,7 @@
$buff .= sprintf('$info->grant->%s->default=\'%s\';', $name, $default);
}
}
-
- // 권한 허용 정리
+ // Permissions to grant
if($permissions) {
if(is_array($permissions)) $permission_list = $permissions;
else $permission_list[] = $permissions;
@@ -521,8 +504,7 @@
$buff .= sprintf('$info->permission->%s = \'%s\';', $action, $target);
}
}
-
- // actions 정리
+ // actions
if($actions) {
if(is_array($actions)) $action_list = $actions;
else $action_list[] = $actions;
@@ -578,8 +560,8 @@
/**
- * @brief 주어진 곳의 스킨 목록을 구함
- * 스킨과 skin.xml 파일을 분석 정리한 결과를 return
+ * @brief Get a list of skins for the module
+ * Return file analysis of skin and skin.xml
**/
function getSkins($path, $dir = 'skins') {
$skin_path = sprintf("%s/%s/", $path, $dir);
@@ -600,28 +582,22 @@
}
/**
- * @brief 특정 위치의 특정 스킨의 정보를 구해옴
+ * @brief Get skin information on a specific location
**/
function loadSkinInfo($path, $skin, $dir = 'skins') {
-
- // 모듈의 스킨의 정보 xml 파일을 읽음
+ // Read xml file having skin information
if(substr($path,-1)!='/') $path .= '/';
$skin_xml_file = sprintf("%s%s/%s/skin.xml", $path, $dir, $skin);
if(!file_exists($skin_xml_file)) return;
-
- // XmlParser 객체 생성
+ // Create XmlParser object
$oXmlParser = new XmlParser();
$_xml_obj = $oXmlParser->loadXmlFile($skin_xml_file);
-
- // 스킨 정보가 없으면 return
+ // Return if no skin information is
if(!$_xml_obj->skin) return;
$xml_obj = $_xml_obj->skin;
-
- // 스킨이름
+ // Skin Name
$skin_info->title = $xml_obj->title->body;
-
-
- // 작성자 정보
+ // Author information
if($xml_obj->version && $xml_obj->attrs->version == '0.2') {
// skin format v0.2
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
@@ -642,8 +618,7 @@
$author_obj->homepage = $author->attrs->link;
$skin_info->author[] = $author_obj;
}
-
- // 확장변수를 정리
+ // List extra vars
if($xml_obj->extra_vars) {
$extra_var_groups = $xml_obj->extra_vars->group;
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
@@ -666,8 +641,7 @@
$obj->default = $val->attrs->default;
if(strpos($obj->value, '|@|') != false) { $obj->value = explode('|@|', $obj->value); }
if($obj->type == 'mid_list' && !is_array($obj->value)) { $obj->value = array($obj->value); }
-
- // 'select'type에서 option목록을 구한다.
+ // Get an option list from 'select'type
if(is_array($val->options)) {
$option_count = count($val->options);
@@ -743,8 +717,7 @@
$skin_info->author[0]->name = $xml_obj->maker->name->body;
$skin_info->author[0]->email_address = $xml_obj->maker->attrs->email_address;
$skin_info->author[0]->homepage = $xml_obj->maker->attrs->link;
-
- // 스킨에서 사용되는 변수들
+ // Variables used in the skin
$extra_var_groups = $xml_obj->extra_vars->group;
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
@@ -765,8 +738,7 @@
$type = $var->attrs->type;
$title = $var->title->body;
$description = $var->description->body;
-
- // 'select'type에서 option목록을 구한다.
+ // Get an option list from 'select'type.
if(is_array($var->default)) {
$option_count = count($var->default);
@@ -820,8 +792,7 @@
$skin_info->colorset[] = $obj;
}
}
-
- // 메뉴 종류 (레이아웃을 위한 설정)
+ // Menu type (settings for layout)
if($xml_obj->menus->menu) {
$menus = $xml_obj->menus->menu;
if(!is_array($menus)) $menus = array($menus);
@@ -844,7 +815,7 @@
}
/**
- * @brief 특정 가상 사이트에 등록된 특정 모듈의 개수를 return
+ * @brief Return the number of modules which are registered on a virtual site
**/
function getModuleCount($site_srl, $module = null) {
$args->site_srl = $site_srl;
@@ -854,8 +825,8 @@
}
/**
- * @brief 특정 모듈의 설정 return
- * board, member등 특정 모듈의 global config 관리용
+ * @brief Return module configurations
+ * Global configuration is used to manage board, member and others
**/
function getModuleConfig($module) {
if(!$GLOBALS['__ModuleConfig__'][$module]) {
@@ -868,8 +839,8 @@
}
/**
- * @brief 특정 mid의 모듈 설정 정보 return
- * mid의 모듈 의존적인 설정을 관리
+ * @brief Return the module configuration of mid
+ * Manage mid configurations which depend on module
**/
function getModulePartConfig($module, $module_srl) {
if(!$GLOBALS['__ModulePartConfig__'][$module][$module_srl]) {
@@ -883,7 +854,7 @@
}
/**
- * @brief mid별 모듈 설정 정보 전체를 구함
+ * @brief Get all of module configurations for each mid
**/
function getModulePartConfigs($module, $site_srl = 0) {
$args->module = $module;
@@ -899,10 +870,10 @@
/**
- * @brief 모듈 카테고리의 목록을 구함
+ * @brief Get a list of module category
**/
function getModuleCategories() {
- // 데이터를 DB에서 가져옴
+ // Get data from the DB
$output = executeQuery('module.getModuleCategories');
if(!$output->toBool()) return $output;
$list = $output->data;
@@ -916,10 +887,10 @@
}
/**
- * @brief 특정 모듈 카테고리의 내용을 구함
+ * @brief Get content from the module category
**/
function getModuleCategory($module_category_srl) {
- // 데이터를 DB에서 가져옴
+ // Get data from the DB
$args->module_category_srl = $module_category_srl;
$output = executeQuery('module.getModuleCategory', $args);
if(!$output->toBool()) return $output;
@@ -927,22 +898,21 @@
}
/**
- * @brief 모듈의 xml 정보만 구함
+ * @brief Get xml information of the module
**/
function getModulesXmlInfo() {
- // 다운받은 모듈과 설치된 모듈의 목록을 구함
+ // Get a list of downloaded and installed modules
$searched_list = FileHandler::readDir('./modules');
$searched_count = count($searched_list);
if(!$searched_count) return;
sort($searched_list);
for($i=0;$i<$searched_count;$i++) {
- // 모듈의 이름
+ // Module name
$module_name = $searched_list[$i];
$path = ModuleHandler::getModulePath($module_name);
-
- // 해당 모듈의 정보를 구함
+ // Get information of the module
$info = $this->getModuleInfoXml($module_name);
unset($obj);
@@ -966,15 +936,13 @@
{
$tmp_files = FileHandler::readDir($moduledir."schemas", '/(\.xml)$/');
$table_count = count($tmp_files);
-
- // 테이블이 설치되어 있는지 체크
+ // Check if the table is created
$created_table_count = 0;
for($j=0;$jisTableExists($table_name)) $created_table_count ++;
}
-
- // 설치 유무 체크 (설치는 DB의 설치만 관리)
+ // Check if DB is installed
if($table_count > $created_table_count) return true;
else return false;
}
@@ -983,7 +951,7 @@
function checkNeedUpdate($module_name)
{
- // 각 모듈의 module.class.php로 upgrade 유무 체크
+ // Check if it is upgraded to module.class.php on each module
$oDummy = &getModule($module_name, 'class');
if($oDummy && method_exists($oDummy, "checkUpdate")) {
return $oDummy->checkUpdate();
@@ -992,13 +960,12 @@
}
/**
- * @brief 모듈의 종류와 정보를 구함
+ * @brief Get a type and information of the module
**/
function getModuleList() {
- // DB 객체 생성
+ // Create DB Object
$oDB = &DB::getInstance();
-
- // 다운받은 모듈과 설치된 모듈의 목록을 구함
+ // Get a list of downloaded and installed modules
$searched_list = FileHandler::readDir('./modules');
sort($searched_list);
@@ -1006,23 +973,20 @@
if(!$searched_count) return;
for($i=0;$i<$searched_count;$i++) {
- // 모듈의 이름
+ // module name
$module_name = $searched_list[$i];
$path = ModuleHandler::getModulePath($module_name);
-
- // schemas내의 테이블 생성 xml파일수를 구함
+ // Get the number of xml files to create a table in schemas
$tmp_files = FileHandler::readDir($path."schemas", '/(\.xml)$/');
$table_count = count($tmp_files);
-
- // 테이블이 설치되어 있는지 체크
+ // Check if the table is created
$created_table_count = 0;
for($j=0;$jisTableExists($table_name)) $created_table_count ++;
}
-
- // 해당 모듈의 정보를 구함
+ // Get information of the module
$info = $this->getModuleInfoXml($module_name);
unset($obj);
@@ -1032,12 +996,10 @@
$info->table_count = $table_count;
$info->path = $path;
$info->admin_index_act = $info->admin_index_act;
-
- // 설치 유무 체크 (설치는 DB의 설치만 관리)
+ // Check if DB is installed
if($table_count > $created_table_count) $info->need_install = true;
else $info->need_install = false;
-
- // 각 모듈의 module.class.php로 upgrade 유무 체크
+ // Check if it is upgraded to module.class.php on each module
$oDummy = null;
$oDummy = &getModule($module_name, 'class');
if($oDummy && method_exists($oDummy, "checkUpdate")) {
@@ -1054,9 +1016,9 @@
}
/**
- * @brief 특정 module srls를 sites의 domain과 결합
- * 아직 XE DBHandler에서 left outer join이 안되어서..
- * $output->data[]->module_srl 과 같은 구조여야 함
+ * @brief Combine module_srls with domain of sites
+ * Because XE DBHandler doesn't support left outer join,
+ * it should be as same as $Output->data[]->module_srl.
**/
function syncModuleToSite(&$data) {
if(!$data) return;
@@ -1087,7 +1049,7 @@
}
/**
- * @brief site_module_info의 관리자 인지 체크
+ * @brief Check if it is an administrator of site_module_info
**/
function isSiteAdmin($member_info, $site_srl = null) {
if(!$member_info->member_srl) return false;
@@ -1112,7 +1074,7 @@
}
/**
- * @brief site의 관리자 정보를 구함
+ * @brief Get admin information of the site
**/
function getSiteAdmin($site_srl) {
$args->site_srl = $site_srl;
@@ -1121,7 +1083,7 @@
}
/**
- * @brief 특정 모듈의 관리자 아이디 구함
+ * @brief Get admin ID of the module
**/
function getAdminId($module_srl) {
$obj->module_srl = $module_srl;
@@ -1132,8 +1094,8 @@
}
/**
- * @brief 특정 모듈의 추가 변수를 구함
- * modules 테이블의 기본 정보 이외의 것
+ * @brief Get extra vars of the module
+ * Extra information, not in the modules table
**/
function getModuleExtraVars($module_srl) {
if(is_array($module_srl)) $module_srl = implode(',',$module_srl);
@@ -1150,7 +1112,7 @@
}
/**
- * @brief 특정 모듈의 스킨 정보를 구함
+ * @brief Get skin information of the module
**/
function getModuleSkinVars($module_srl) {
$args->module_srl = $module_srl;
@@ -1163,7 +1125,7 @@
}
/**
- * @brief 특정 모듈의 스킨 정보를 모듈 정보와 결합
+ * @brief Combine skin information with module information
**/
function syncSkinInfoToModuleInfo(&$module_info) {
if(!$module_info->module_srl) return;
@@ -1179,14 +1141,14 @@
}
/**
- * @brief 특정 모듈정보와 XML, 그리고 회원 정보로 권한을 return
+ * @brief Return permission by using module info, xml info and member info
**/
function getGrant($module_info, $member_info, $xml_info = '') {
if(!$xml_info) {
$module = $module_info->module;
$xml_info = $this->getModuleActionXml($module);
}
- // 그룹 권한 설정에 필요한 변수를 세팅
+ // Set variables to grant group permission
$module_srl = $module_info->module_srl;
$grant_info = $xml_info->grant;
if($member_info->member_srl) {
@@ -1195,32 +1157,26 @@
} else {
$group_list = array();
}
-
- // module_srl이 없는 즉 별도의 권한 설정이 안되는 경우
+ // If module_srl doesn't exist(if unable to set permissions)
if(!$module_srl) {
$grant->access = true;
if($this->isSiteAdmin($member_info)) $grant->access = $grant->is_admin = $grant->manager = true;
else $grant->is_admin = $grant->manager = $member_info->is_admin=='Y'?true:false;
-
- // module_srl이 있는 경우
+ // If module_srl exists
} else {
-
- // grant 종류를 구함
+ // Get a type of granted permission
$grant->access = $grant->is_admin = $grant->manager = ($member_info->is_admin=='Y'||$this->isSiteAdmin($member_info))?true:false;
-
- // 관리자가 아니라 로그인 회원일 경우 이 모듈의 관리자인지 확인
+ // If a just logged-in member is, check if the member is a module administrator
if(!$grant->manager && $member_info->member_srl) {
$args->module_srl = $module_srl;
$args->member_srl = $member_info->member_srl;
$output = executeQuery('module.getModuleAdmin',$args);
if($output->data && $output->data->member_srl == $member_info->member_srl) $grant->manager = $grant->is_admin = true;
}
-
- // 관리자가 아니면 직접 DB에서 정보를 구해서 권한 설정
+ // If not an administrator, get information from the DB and grant manager privilege.
if(!$grant->manager) {
$args = null;
-
- // 플래닛인 경우 planet home의 권한 설정을 가져온다
+ // If planet, get permission settings from the planet home
if ($module_info->module == 'planet') {
$output = executeQueryArray('module.getPlanetGrants', $args);
}
@@ -1232,35 +1188,32 @@
$grant_exists = $granted = array();
if($output->data) {
- // 1차적으로 권한 대상 이름과 그룹을 정리
+ // Arrange names and groups who has privileges
foreach($output->data as $val) {
$grant_exists[$val->name] = true;
if($granted[$val->name]) continue;
-
- // 로그인 회원만
+ // Log-in member only
if($val->group_srl == -1) {
$granted[$val->name] = true;
if($member_info->member_srl) $grant->{$val->name} = true;
-
- // 사이트 가입한 회원만
+ // Site-joined member only
} elseif($val->group_srl == -2) {
$granted[$val->name] = true;
- // 비로그인 회원이면 권한 미부여
+ // Do not grant any permission for non-logged member
if(!$member_info->member_srl) $grant->{$val->name} = false;
- // 로그인 회원
+ // Log-in member
else {
$site_module_info = Context::get('site_module_info');
- // 현재 접속된 사이트 정보가 없으면 권한 부여
+ // Permission granted if no information of the currently connected site exists
if(!$site_module_info->site_srl) $grant->{$val->name} = true;
- // 현재 접속된 사이트의 그룹 정보가 있 으면 권한 미부여
+ // Permission is not granted if information of the currently connected site exists
elseif(count($group_list)) $grant->{$val->name} = true;
}
-
- // 비로그인 회원 모두
+ // All of non-logged members
} elseif($val->group_srl == 0) {
$granted[$val->name] = true;
$grant->{$val->name} = true;
- // 특정 그룹 대상일 경우
+ // If a target is a group
} else {
if($group_list && count($group_list) && in_array($val->group_srl, $group_list)) {
$grant->{$val->name} = true;
@@ -1269,8 +1222,7 @@
}
}
}
-
- // 가상 그룹인 access에 대해서 별도 처리
+ // Separate processing for the virtual group access
if(!$grant_exists['access']) $grant->access = true;
if(count($grant_info)) {
foreach($grant_info as $grant_name => $grant_item) {
@@ -1297,8 +1249,7 @@
}
}
}
-
- // 관리자일 경우 모든 권한에 대해 true 지정
+ // Set true to grant all privileges if an administrator is
if($grant->manager) {
$grant->access = true;
if(count($grant_info)) {
diff --git a/modules/module/module.view.php b/modules/module/module.view.php
index 16982fcc6..f111814e3 100644
--- a/modules/module/module.view.php
+++ b/modules/module/module.view.php
@@ -2,27 +2,26 @@
/**
* @class moduleView
* @author NHN (developers@xpressengine.com)
- * @brief module 모듈의 view class
+ * @brief view class of the module module
**/
class moduleView extends module {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
- // template path 지정
+ // Set the template path
$this->setTemplatePath($this->module_path.'tpl');
}
/**
- * @brief 스킨 정보 출력
+ * @brief Display skin information
**/
function dispModuleSkinInfo() {
$selected_module = Context::get('selected_module');
$skin = Context::get('skin');
-
- // 모듈/스킨 정보를 구함
+ // Get modules/skin information
$module_path = sprintf("./modules/%s/", $selected_module);
if(!is_dir($module_path)) $this->stop("msg_invalid_request");
@@ -38,22 +37,19 @@
}
/**
- * @brief 모듈 선택기
+ * @brief Select a module
**/
function dispModuleSelectList() {
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted');
$oModuleModel = &getModel('module');
-
- // virtual site의 개수를 추출
+ // Extract the number of virtual sites
$output = executeQuery('module.getSiteCount');
$site_count = $output->data->count;
Context::set('site_count', $site_count);
-
- // 사이트 검색어 변수 설정
+ // Variable setting for site keyword
$site_keyword = Context::get('site_keyword');
-
- // 사이트 검색어가 없으면 현재 가상 사이트의 정보를 설정
+ // If there is no site keyword, use as information of the current virtual site
$args = null;
$logged_info = Context::get('logged_info');
if($logged_info->is_admin == 'Y') {
@@ -70,7 +66,7 @@
$args->site_srl = 0;
$module_category_exists = true;
}
- // 사이트 검색어가 있으면 해당 사이트(들)의 정보를 추출
+ // If site keyword exists, extract information from the sites
} else {
$args->site_keyword = $site_keyword;
}
@@ -80,8 +76,7 @@
$args->site_srl = (int)$site_module_info->site_srl;
}
//if(is_null($args->site_srl)) $query_id = 'module.getDefaultModules';
-
- // 지정된 사이트(혹은 전체)의 module 목록을 구함
+ // Get a list of modules at the site
$output = executeQueryArray($query_id, $args);
$category_list = $mid_list = array();
if(count($output->data)) {
@@ -110,16 +105,12 @@
Context::set('selected_module', $selected_module);
Context::set('selected_mids', $mid_list[$selected_module]->list);
Context::set('module_category_exists', $module_category_exists);
-
- // 레이아웃을 팝업으로 지정
+ // Set the layout to be pop-up
$this->setLayoutFile('popup_layout');
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('module_selector');
}
-
-
- // 파일 박스 보기
+ // See the file box
function dispModuleFileBox(){
$logged_info = Context::get('logged_info');
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
@@ -145,8 +136,7 @@
$this->setLayoutFile('popup_layout');
$this->setTemplateFile('filebox_list');
}
-
- // 파일 박스 등록화면
+ // Screen to add a file box
function dispModuleFileBoxAdd(){
$logged_info = Context::get('logged_info');
if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted');
diff --git a/modules/opage/opage.admin.controller.php b/modules/opage/opage.admin.controller.php
index 532c6d032..88ffe1b5e 100644
--- a/modules/opage/opage.admin.controller.php
+++ b/modules/opage/opage.admin.controller.php
@@ -2,38 +2,35 @@
/**
* @class opageAdminController
* @author NHN (developers@xpressengine.com)
- * @brief opage 모듈의 admin controller class
+ * @brief admin controller class of the opage module
**/
class opageAdminController extends opage {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
}
/**
- * @brief 외부페이지 추가
+ * @brief Add an external page
**/
function procOpageAdminInsert() {
- // module 모듈의 model/controller 객체 생성
+ // Create model/controller object of the module module
$oModuleController = &getController('module');
$oModuleModel = &getModel('module');
-
- // 게시판 모듈의 정보 설정
+ // Set board module
$args = Context::getRequestVars();
$args->module = 'opage';
$args->mid = $args->opage_name;
unset($args->opage_name);
-
- // module_srl이 넘어오면 원 모듈이 있는지 확인
+ // Check if an original module exists by using module_srl
if($args->module_srl) {
$module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl);
if($module_info->module_srl != $args->module_srl) unset($args->module_srl);
}
-
- // module_srl의 값에 따라 insert/update
+ // Insert/update depending on module_srl
if(!$args->module_srl) {
$args->module_srl = getNextSequence();
$output = $oModuleController->insertModule($args);
@@ -41,27 +38,24 @@
} else {
$output = $oModuleController->updateModule($args);
$msg_code = 'success_updated';
-
- // 캐시 파일 삭제
+ // Delete cache files
$cache_file = sprintf("./files/cache/opage/%d.cache.php", $module_info->module_srl);
if(file_exists($cache_file)) FileHandler::removeFile($cache_file);
}
if(!$output->toBool()) return $output;
-
- // 등록 성공후 return될 메세지 정리
+ // Messages to output when successfully registered
$this->add("module_srl", $output->get('module_srl'));
$this->add("opage", Context::get('opage'));
$this->setMessage($msg_code);
}
/**
- * @brief 외부페이지 삭제
+ * @brief Delete an external page
**/
function procOpageAdminDelete() {
$module_srl = Context::get('module_srl');
-
- // 원본을 구해온다
+ // Get an original
$oModuleController = &getController('module');
$output = $oModuleController->deleteModule($module_srl);
if(!$output->toBool()) return $output;
@@ -72,10 +66,10 @@
}
/**
- * @brief 외부페이지 기본 정보의 추가
+ * @brief Add information of an external page
**/
function procOpageAdminInsertConfig() {
- // 기본 정보를 받음
+ // Get the basic info
$args = Context::gets('test');
}
diff --git a/modules/opage/opage.admin.view.php b/modules/opage/opage.admin.view.php
index b4e5bd8c3..d6d559017 100644
--- a/modules/opage/opage.admin.view.php
+++ b/modules/opage/opage.admin.view.php
@@ -2,7 +2,7 @@
/**
* @class opageAdminView
* @author NHN (developers@xpressengine.com)
- * @brief opage 모듈의 admin view 클래스
+ * @brief admin view clas of the opage module
**/
class opageAdminView extends opage {
@@ -12,25 +12,22 @@
var $page_count = 10;
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
- // module_srl이 있으면 미리 체크하여 존재하는 모듈이면 module_info 세팅
+ // Pre-check if module_srl exists. Set module_info if exists
$module_srl = Context::get('module_srl');
-
- // module model 객체 생성
+ // Create module model object
$oModuleModel = &getModel('module');
-
- // 모듈 카테고리 목록을 구함
+ // Get a list of module categories
$module_category = $oModuleModel->getModuleCategories();
Context::set('module_category', $module_category);
-
- // 템플릿 경로 구함 (opage의 경우 tpl에 관리자용 템플릿 모아놓음)
+ // Get a template path (admin templates are collected on the tpl for opage)
$this->setTemplatePath($this->module_path.'tpl');
}
/**
- * @brief 외부페이지 관리 목록 보여줌
+ * @brief Display a list of external pages
**/
function dispOpageAdminContent() {
$args->sort_index = "module_srl";
@@ -39,35 +36,30 @@
$args->page_count = 10;
$args->s_module_category_srl = Context::get('module_category_srl');
$output = executeQuery('opage.getOpageList', $args);
-
- // 템플릿에 쓰기 위해서 context::set
+ // context setting to use a template
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('opage_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('index');
}
/**
- * @brief 외부페이지 추가 폼 출력
+ * @brief Form to add an external page
**/
function dispOpageAdminInsert() {
- // 권한 그룹의 목록을 가져온다
+ // Get a list of groups
$oMemberModel = &getModel('member');
$group_list = $oMemberModel->getGroups();
Context::set('group_list', $group_list);
-
- // module.xml에서 권한 관련 목록을 구해옴
+ // Get a list of permissions from the module.xml
$grant_list = $this->xml_info->grant;
Context::set('grant_list', $grant_list);
-
- // GET parameter에서 module_srl을 가져옴
+ // Get module_srl
$module_srl = Context::get('module_srl');
-
- // module_srl이 있으면 해당 모듈의 정보를 구해서 세팅
+ // Get and set module information if module_srl exists
if($module_srl) {
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
@@ -77,22 +69,20 @@
unset($module_srl);
}
}
-
- // 레이아웃 목록을 구해옴
+ // Get a layout list
$oLayoutModel = &getModel('layout');
$layout_list = $oLayoutModel->getLayoutList();
Context::set('layout_list', $layout_list);
$mobile_layout_list = $oLayoutModel->getLayoutList(0,"M");
Context::set('mlayout_list', $mobile_layout_list);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('opage_insert');
}
/**
- * @brief 외부페이지 삭제 화면 출력
+ * @brief Screen to delete an external page
**/
function dispOpageAdminDelete() {
$module_srl = Context::get('module_srl');
@@ -101,21 +91,18 @@
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
Context::set('module_info',$module_info);
-
- // 템플릿 파일 지정
+ // Set a template file
$this->setTemplateFile('opage_delete');
}
/**
- * @brief 권한 목록 출력
+ * @brief Display a list of permissions
**/
function dispOpageAdminGrantInfo() {
-
- // GET parameter에서 module_srl을 가져옴
+ // Get module_srl
$module_srl = Context::get('module_srl');
-
- // module_srl이 있으면 해당 모듈의 정보를 구해서 세팅
+ // Get and set module information if module_srl exists
if($module_srl) {
$oModuleModel = &getModel('module');
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
@@ -127,8 +114,7 @@
}
$this->module_info = $module_info;
-
- // 공통 모듈 권한 설정 페이지 호출
+ // Call a page to set permission for common module
$oModuleAdminModel = &getAdminModel('module');
$grant_content = $oModuleAdminModel->getModuleGrantHTML($this->module_info->module_srl, $this->xml_info->grant);
Context::set('grant_content', $grant_content);
diff --git a/modules/opage/opage.class.php b/modules/opage/opage.class.php
index a83a81421..d78a4fdd0 100644
--- a/modules/opage/opage.class.php
+++ b/modules/opage/opage.class.php
@@ -2,43 +2,43 @@
/**
* @class opage
* @author NHN (developers@xpressengine.com)
- * @brief opage 모듈의 high class
+ * @brief high class of opage module
**/
class opage extends ModuleObject {
/**
- * @brief 설치시 추가 작업이 필요할시 구현
+ * @brief Implement if additional tasks are necessary when installing
**/
function moduleInstall() {
- // opage 에서 사용할 cache디렉토리 생성
+ // Create cache directory to use in the opage
FileHandler::makeDir('./files/cache/opage');
return new Object();
}
/**
- * @brief 설치가 이상이 없는지 체크하는 method
+ * @brief a method to check if successfully installed
**/
function checkUpdate() {
- // cache 디렉토리가 없으면 바로 디렉토리 생성
+ // Create a directory ditectly if no cache directory exists
if(!is_dir('./files/cache/opage')) FileHandler::makeDir('./files/cache/opage');
return false;
}
/**
- * @brief 업데이트 실행
+ * @brief Update
**/
function moduleUpdate() {
return new Object(0, 'success_updated');
}
/**
- * @brief 캐시 파일 재생성
+ * @brief Re-generate the cache file
**/
function recompileCache() {
- // 외부 페이지 캐시 파일 삭제
+ // Remove cache file for external pages
FileHandler::removeFilesInDir("./files/cache/opage");
}
}
diff --git a/modules/opage/opage.controller.php b/modules/opage/opage.controller.php
index eb86d8c7e..d514d80c5 100644
--- a/modules/opage/opage.controller.php
+++ b/modules/opage/opage.controller.php
@@ -2,7 +2,7 @@
/**
* @class documentController
* @author NHN (developers@xpressengine.com)
- * @brief document 모듈의 controller 클래스
+ * @brief controller class of the document module
**/
class opageController extends opage {
@@ -10,12 +10,12 @@
var $target_path = '';
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() { }
/**
- * @brief 타이틀 추출
+ * @brief Extract a title
**/
function getTitle($content) {
preg_match('!]*)>(.*?)<\/title>!is', $content, $buff);
@@ -23,16 +23,14 @@
}
/**
- * @brief header script 추출
+ * @brief Extract header script
**/
function getHeadScript($content) {
- // title 태그 제거
+ // remove the title tag
$content = preg_replace('!]*)>(.*?)<\/title>!is','', $content);
-
- // meta 태그 제거
+ // Remove meta tags
$content = preg_replace('!<(\/){0,1}meta([^>]*)>!is','', $content);
-
- // ]*)>!is', $content, $link_buff);
for($i=0;$i]*)>(.*?)<\/body>!is', $content, $body_buff);
$body_script = $body_buff[2];
-
- // link, style, script등 제거
+ // Remove link, style, script, etc.
$body_script = preg_replace('!]*)>!is', '', $body_script);
$body_script = preg_replace('!<(style|script)(.*?)<\/(style|script)>!is', '', $body_script);
return $body_script;
}
/**
- * @brief 내용에 포함된 src, href의 값을 변경
+ * @brief Change the value of src, href in the content
**/
function replaceSrc($content, $path) {
$url_info = parse_url($path);
diff --git a/modules/opage/opage.mobile.php b/modules/opage/opage.mobile.php
index c4b86ae80..01d76fb59 100644
--- a/modules/opage/opage.mobile.php
+++ b/modules/opage/opage.mobile.php
@@ -3,19 +3,17 @@ require_once(_XE_PATH_.'modules/opage/opage.view.php');
class opageMobile extends opageView {
function init() {
- // 템플릿 경로 구함 (opage의 경우 tpl에 관리자용 템플릿 모아놓음)
+ // Get a template path (admin templates are collected on the tpl for opage)
$this->setTemplatePath($this->module_path.'tpl');
$oOpageModel = &getModel('opage');
$module_info = $oOpageModel->getOpage($this->module_srl);
Context::set('module_info', $module_info);
-
- // 외부 페이지에서 명시된 외부 페이지 경로/ 캐싱 간격을 를 구함
+ // Get a path/caching interval on the external page
if($module_info->mpath) $this->path = $module_info->mpath;
else $this->path = $module_info->path;
$this->caching_interval = $module_info->caching_interval;
-
- // 캐시 파일 지정
+ // Specify the cache file
$this->cache_file = sprintf("./files/cache/opage/%d.m.cache.php", $module_info->module_srl);
}
diff --git a/modules/opage/opage.model.php b/modules/opage/opage.model.php
index b1856a62d..31921cb49 100644
--- a/modules/opage/opage.model.php
+++ b/modules/opage/opage.model.php
@@ -2,19 +2,19 @@
/**
* @class opageModel
* @author NHN (developers@xpressengine.com)
- * @brief opage 모듈의 model 클래스
+ * @brief model class of the opage module
**/
class opageModel extends opage {
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() { }
/**
- * @brief 특정 외부 페이지의 정보를 return
- * 외부 페이지의 경우 기본 모듈의 정보와 설정정보를 함께 다루기 때문에 별도의 model method를 이용하게 한다
+ * @brief Return information on the external page
+ * Use a separate model method because external page handles information and configurations of the defaul module either.
**/
function getOpage($module_srl) {
$oModuleModel = &getModel('module');
diff --git a/modules/opage/opage.view.php b/modules/opage/opage.view.php
index b86a7c156..061a1a53a 100644
--- a/modules/opage/opage.view.php
+++ b/modules/opage/opage.view.php
@@ -2,7 +2,7 @@
/**
* @class opageView
* @author NHN (developers@xpressengine.com)
- * @brief opage 모듈의 view 클래스
+ * @brief view class of the opage module
**/
class opageView extends opage {
@@ -12,48 +12,42 @@
var $caching_interval;
/**
- * @brief 초기화
+ * @brief Initialization
**/
function init() {
- // 템플릿 경로 구함 (opage의 경우 tpl에 관리자용 템플릿 모아놓음)
+ // Get a template path (admin templates are collected on the tpl for opage)
$this->setTemplatePath($this->module_path.'tpl');
-
- // 외부 페이지 모듈의 정보를 구함
+ // Get information of the external page module
$oOpageModel = &getModel('opage');
$module_info = $oOpageModel->getOpage($this->module_srl);
Context::set('module_info', $module_info);
-
- // 외부 페이지에서 명시된 외부 페이지 경로/ 캐싱 간격을 를 구함
+ // Get a path/caching interval on the external page
$this->path = $module_info->path;
$this->caching_interval = $module_info->caching_interval;
-
- // 캐시 파일 지정
+ // Specify the cache file
$this->cache_file = sprintf("./files/cache/opage/%d.cache.php", $module_info->module_srl);
}
/**
- * @brief 일반 요청시 출력
+ * @brief Display when receiving a request
**/
function dispOpageIndex() {
-
- // http 인지 내부 파일인지 점검
+ // check if it is http or internal file
if($this->path) {
if(preg_match("/^([a-z]+):\/\//i",$this->path)) $content = $this->getHtmlPage($this->path, $this->caching_interval, $this->cache_file);
else $content = $this->executeFile($this->path, $this->caching_interval, $this->cache_file);
}
Context::set('opage_content', $content);
-
- // 결과 출력 템플릿 지정
+ // Set a template for result output
$this->setTemplateFile('content');
}
/**
- * @brief 외부 http로 요청되는 파일일 경우 파일을 받아와서 저장 후 return
+ * @brief Save the file and return if a file is requested by http
**/
function getHtmlPage($path, $caching_interval, $cache_file) {
-
- // 캐시 검사
+ // Verify cache
if($caching_interval > 0 && file_exists($cache_file) && filemtime($cache_file) + $caching_interval*60 > time()) {
$content = FileHandler::readFile($cache_file);
@@ -64,27 +58,21 @@
$content = FileHandler::readFile($cache_file);
}
-
- // opage controller 생성
+ // Create opage controller
$oOpageController = &getController('opage');
-
- // 외부 서버의 페이지 일 경우 이미지, css, javascript등의 url을 변경
+ // change url of image, css, javascript and so on if the page is from external server
$content = $oOpageController->replaceSrc($content, $path);
-
- // 해당 문서를 utf-8로 변경
+ // Change the document to utf-8 format
$buff->content = $content;
$buff = Context::convertEncoding($buff);
$content = $buff->content;
-
- // title 추출
+ // Extract a title
$title = $oOpageController->getTitle($content);
if($title) Context::setBrowserTitle($title);
-
- // header script 추출
+ // Extract header script
$head_script = $oOpageController->getHeadScript($content);
if($head_script) Context::addHtmlHeader($head_script);
-
- // body 내용 추출
+ // Extract content from the body
$body_script = $oOpageController->getBodyScript($content);
if(!$body_script) $body_script = $content;
@@ -92,38 +80,32 @@
}
/**
- * @brief 내부 파일일 경우 include하도록 캐시파일을 만들고 처리
+ * @brief Create a cache file in order to include if it is an internal file
**/
function executeFile($path, $caching_interval, $cache_file) {
- // 파일이 없으면 취소
+ // Cancel if the file doesn't exist
if(!file_exists($path)) return;
-
- // 경로와 파일이름을 구함
+ // Get a path and filename
$tmp_path = explode('/',$cache_file);
$filename = $tmp_path[count($tmp_path)-1];
$filepath = preg_replace('/'.$filename."$/i","",$cache_file);
-
- // 캐시 검사
+ // Verify cache
if($caching_interval <1 || !file_exists($cache_file) || filemtime($cache_file) + $caching_interval*60 <= time() || filemtime($cache_file)path = str_replace('\\', '/', realpath($path_info['dirname'])).'/';
$content = preg_replace_callback('/(target=|src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content);
$content = preg_replace_callback('/(