diff --git a/addons/autolink/autolink.addon.php b/addons/autolink/autolink.addon.php index 0463eb57a..831254057 100644 --- a/addons/autolink/autolink.addon.php +++ b/addons/autolink/autolink.addon.php @@ -1,12 +1,12 @@ - + diff --git a/addons/autolink/autolink.js b/addons/autolink/autolink.js index 5b03d4bd7..ad2dcecf6 100644 --- a/addons/autolink/autolink.js +++ b/addons/autolink/autolink.js @@ -1,80 +1,80 @@ -/** - * @file autolink.js - * @brief javascript code for autolink addon - * @author NHN (developers@xpressengine.com) - */ -(function($){ - var protocol_re = '(https?|ftp|news|telnet|irc|mms)://'; - var domain_re = '(?:[\\w\\-]+\\.)+(?:[a-z]+)'; - var max_255_re = '(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])'; - var ip_re = '(?:'+max_255_re+'\\.){3}'+max_255_re; - var port_re = '(?::([0-9]+))?'; - var user_re = '(?:/~[\\w-]+)?'; - var path_re = '((?:/[\\w!"$-/:-@]+)*)'; - var hash_re = '(?:#([\\w!-@]+))?'; - - var url_regex = new RegExp('('+protocol_re+'('+domain_re+'|'+ip_re+'|localhost'+')'+port_re+user_re+path_re+hash_re+')', 'ig'); - - var AutoLink = xe.createPlugin("autolink", { - targets : [], - init : function() { - this.targets = []; - }, - API_ONREADY : function() { - var thisPlugin = this; - - // extract target text nodes - this.extractTargets($('.xe_content')); - - $(this.targets).each(function(){ - thisPlugin.cast('AUTOLINK', [this]); - }); - }, - API_AUTOLINK : function(oSender, params) { - var textNode = params[0]; - if(!$(textNode).parent().length || $(textNode).parent().get(0).nodeName.toLowerCase() == 'a') return; - var content = textNode.nodeValue; - var dummy = $(''); - - content = content.replace(//g, '>'); - content = content.replace(url_regex, '$1'); - - $(textNode).before(dummy); - $(textNode).replaceWith(content); - params[0] = dummy.next('a'); - dummy.remove(); - }, - extractTargets : function(obj) { - var thisPlugin = this; - var wrap = $('.xe_content', obj); - if(wrap.length) { - this.extractTargets(wrap); - return; - } - - $(obj) - .contents() - .each(function(){ - var node_name = this.nodeName.toLowerCase(); - if($.inArray(node_name, ['a', 'pre', 'xml', 'textarea', 'input', 'select', 'option', 'code', 'script', 'style', 'iframe', 'button', 'img', 'embed', 'object', 'ins']) != -1) return; - - // FIX ME : When this meanless code wasn't executed, url_regex do not run correctly. why? - url_regex.exec(''); - - if(this.nodeType == 3) { // text node - var content = this.nodeValue; - - if(content.length < 5) return; - - if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(content)) return; - - thisPlugin.targets.push(this); - } else { - thisPlugin.extractTargets(this); - } - }); - } - }); - - xe.registerPlugin(new AutoLink()); +/** + * @file autolink.js + * @brief javascript code for autolink addon + * @author NHN (developers@xpressengine.com) + */ +(function($){ + var protocol_re = '(https?|ftp|news|telnet|irc|mms)://'; + var domain_re = '(?:[\\w\\-]+\\.)+(?:[a-z]+)'; + var max_255_re = '(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])'; + var ip_re = '(?:'+max_255_re+'\\.){3}'+max_255_re; + var port_re = '(?::([0-9]+))?'; + var user_re = '(?:/~[\\w-]+)?'; + var path_re = '((?:/[\\w!"$-/:-@]+)*)'; + var hash_re = '(?:#([\\w!-@]+))?'; + + var url_regex = new RegExp('('+protocol_re+'('+domain_re+'|'+ip_re+'|localhost'+')'+port_re+user_re+path_re+hash_re+')', 'ig'); + + var AutoLink = xe.createPlugin("autolink", { + targets : [], + init : function() { + this.targets = []; + }, + API_ONREADY : function() { + var thisPlugin = this; + + // extract target text nodes + this.extractTargets($('.xe_content')); + + $(this.targets).each(function(){ + thisPlugin.cast('AUTOLINK', [this]); + }); + }, + API_AUTOLINK : function(oSender, params) { + var textNode = params[0]; + if(!$(textNode).parent().length || $(textNode).parent().get(0).nodeName.toLowerCase() == 'a') return; + var content = textNode.nodeValue; + var dummy = $(''); + + content = content.replace(//g, '>'); + content = content.replace(url_regex, '$1'); + + $(textNode).before(dummy); + $(textNode).replaceWith(content); + params[0] = dummy.next('a'); + dummy.remove(); + }, + extractTargets : function(obj) { + var thisPlugin = this; + var wrap = $('.xe_content', obj); + if(wrap.length) { + this.extractTargets(wrap); + return; + } + + $(obj) + .contents() + .each(function(){ + var node_name = this.nodeName.toLowerCase(); + if($.inArray(node_name, ['a', 'pre', 'xml', 'textarea', 'input', 'select', 'option', 'code', 'script', 'style', 'iframe', 'button', 'img', 'embed', 'object', 'ins']) != -1) return; + + // FIX ME : When this meanless code wasn't executed, url_regex do not run correctly. why? + url_regex.exec(''); + + if(this.nodeType == 3) { // text node + var content = this.nodeValue; + + if(content.length < 5) return; + + if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(content)) return; + + thisPlugin.targets.push(this); + } else { + thisPlugin.extractTargets(this); + } + }); + } + }); + + xe.registerPlugin(new AutoLink()); })(jQuery); \ No newline at end of file diff --git a/addons/autolink/conf/info.xml b/addons/autolink/conf/info.xml index 017183672..3bd566436 100644 --- a/addons/autolink/conf/info.xml +++ b/addons/autolink/conf/info.xml @@ -1,53 +1,53 @@ - - - 자동 링크 애드온 - 自動リンクアドオン - Auto Link - Auto Link - 自动链接插件 - auto vínculo addon - авто ссылка аддон - Auto-Link Addon - 自動連結 - - 글과 댓글의 내용 중 URL 문자열에 링크를 걸어주는 애드온입니다. - - - 書き込み本文とコメントに登録された内容の中、httpで始まる一般文字列に自動にリンクを貼り付け、そのリンクにマウスオーバすると、別ウィンドウ、または同一ウィンドウに開くメニュが現れるアドオンです。 - - - This addon makes a link to a string that starts with http. - - - Addon này sẽ tự động tạo ra một đường Link khi gặp chuỗi kí tự 'http' có trong bài viết. - - - 主题及评论中以http开始的字符串,自动转换为链接。并且鼠标移到链接上方时,将出现可选(新窗/本页面)提示框。 - - - Los comentarios que comienzan con http naeyongjung tema común de la cadena para vincular automáticamente a colgar el puntero del ratón sobre cada uno de los vínculos y saechang Ciudad y aparecen en el menú de add-on de decoración. - - - Комментарии, которые начинаются с http naeyongjung темой общей строки автоматически ссылку повесить мышь над каждой ссылке и saechang Сити и появляться на меню добавить-на украшения. - - - Kommentare beginnen mit http naeyongjung Thema der gemeinsamen String automatisch Link zu hängen Sie mit der Maus über die einzelnen Links und saechang Stadt und auf dem Menü des Add-On Dekoration. - - - 是種可將主題和評論內容中的URL網址字串自動轉換成連結的附加元件。 - - 0.1 - 2008-04-22 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 자동 링크 애드온 + 自動リンクアドオン + Auto Link + Auto Link + 自动链接插件 + auto vínculo addon + авто ссылка аддон + Auto-Link Addon + 自動連結 + + 글과 댓글의 내용 중 URL 문자열에 링크를 걸어주는 애드온입니다. + + + 書き込み本文とコメントに登録された内容の中、httpで始まる一般文字列に自動にリンクを貼り付け、そのリンクにマウスオーバすると、別ウィンドウ、または同一ウィンドウに開くメニュが現れるアドオンです。 + + + This addon makes a link to a string that starts with http. + + + Addon này sẽ tự động tạo ra một đường Link khi gặp chuỗi kí tự 'http' có trong bài viết. + + + 主题及评论中以http开始的字符串,自动转换为链接。并且鼠标移到链接上方时,将出现可选(新窗/本页面)提示框。 + + + Los comentarios que comienzan con http naeyongjung tema común de la cadena para vincular automáticamente a colgar el puntero del ratón sobre cada uno de los vínculos y saechang Ciudad y aparecen en el menú de add-on de decoración. + + + Комментарии, которые начинаются с http naeyongjung темой общей строки автоматически ссылку повесить мышь над каждой ссылке и saechang Сити и появляться на меню добавить-на украшения. + + + Kommentare beginnen mit http naeyongjung Thema der gemeinsamen String automatisch Link zu hängen Sie mit der Maus über die einzelnen Links und saechang Stadt und auf dem Menü des Add-On Dekoration. + + + 是種可將主題和評論內容中的URL網址字串自動轉換成連結的附加元件。 + + 0.1 + 2008-04-22 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/addons/blogapi/blogapi.addon.php b/addons/blogapi/blogapi.addon.php index 7b294e8e3..6fc86aadc 100644 --- a/addons/blogapi/blogapi.addon.php +++ b/addons/blogapi/blogapi.addon.php @@ -1,468 +1,468 @@ -domain, '', 'mid',$site_module_info->mid, 'act','api'); - - // 헤더에 rsd태그 삽입 - Context::addHtmlHeader(" ".''); - } - - // act가 api가 아니면 그냥 리턴~ - if($_REQUEST['act']!='api') return; - - // 관련 func 파일 읽음 - require_once('./addons/blogapi/blogapi.func.php'); - - // xmlprc 파싱 - // 요청된 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에 대한 호환 - if(in_array($method_name, array('metaWeblog.deletePost', 'metaWeblog.getUsersBlogs', 'metaWeblog.getUserInfo'))) { - $method_name = str_replace('metaWeblog.', 'blogger.', $method_name); - } - - // blogger.deletePost일 경우 첫번째 인자 값 삭제 - if($method_name == 'blogger.deletePost') array_shift($params); - - // user_id, password를 구해서 로그인 시도 - $user_id = trim($params[1]->value->string->body); - $password = trim($params[2]->value->string->body); - - // 모듈 실행전이라면 인증을 처리한다. - if($called_position == 'before_module_init') { - - // member controller을 이용해서 로그인 시도 - if($user_id && $password) { - $oMemberController = &getController('member'); - $output = $oMemberController->doLogin($user_id, $password); - // 로그인 실패시 에러 메시지 출력 - if(!$output->toBool()) { - $content = getXmlRpcFailure(1, $output->getMessage()); - printContent($content); - } - } else { - $content = getXmlRpcFailure(1, 'not logged'); - printContent($content); - } - } - - // 모듈에서 무언가 작업을 하기 전에 blogapi tool의 요청에 대한 처리를 하고 강제 종료한다. - if($called_position == 'before_module_proc') { - - // 글쓰기 권한 체크 (권한명의 경우 약속이 필요할듯..) - if(!$this->grant->write_document) { - printContent( getXmlRpcFailure(1, 'no permission') ); - } - - // 카테고리의 정보를 구해옴 - $oDocumentModel = &getModel('document'); - $category_list = $oDocumentModel->getCategoryList($this->module_srl); - - // 임시 파일 저장 장소 지정 - $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) { - // 블로그 정보 - case 'blogger.getUsersBlogs' : - $obj->url = getFullSiteUrl(''); - $obj->blogid = $this->mid; - $obj->blogName = $this->module_info->browser_title; - $blog_list = array($obj); - - $content = getXmlRpcResponse($blog_list); - printContent($content); - break; - - // 카테고리 목록 return - case 'metaWeblog.getCategories' : - $category_obj_list = array(); - if($category_list) { - foreach($category_list as $category_srl => $category_info) { - unset($obj); - $obj->description = $category_info->title; - //$obj->htmlUrl = Context::getRequestUri().$this->mid.'/1'; - //$obj->rssUrl= Context::getRequestUri().'rss/'.$this->mid.'/1'; - $obj->title = $category_info->title; - $obj->categoryid = $category_srl; - $category_obj_list[] = $obj; - } - } - - $content = getXmlRpcResponse($category_obj_list); - printContent($content); - break; - - // 파일 업로드 - case 'metaWeblog.newMediaObject' : - // 파일 업로드 권한 체크 - $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) { - $logged_info = Context::get('logged_info'); - if($logged_info->is_admin != 'Y') { - $is_permitted = false; - for($i=0;$idownload_grant);$i++) { - $group_srl = $file_module_config->download_grant[$i]; - if($logged_info->group_list[$group_srl]) { - $is_permitted = true; - break; - } - } - if(!$is_permitted) printContent( getXmlRpcFailure(1, 'no permission') ); - } - } - - $fileinfo = $params[3]->value->struct->member; - foreach($fileinfo as $key => $val) { - $nodename = $val->name->body; - if($nodename == 'bits') $filedata = base64_decode($val->value->base64->body); - elseif($nodename == 'name') $filename = $val->value->string->body; - } - - $tmp_arr = explode('/',$filename); - $filename = array_pop($tmp_arr); - - if(!is_dir($tmp_uploaded_path)) FileHandler::makeDir($tmp_uploaded_path); - - $target_filename = sprintf('%s%s', $tmp_uploaded_path, $filename); - FileHandler::writeFile($target_filename, $filedata); - $obj->url = Context::getRequestUri().$target_filename; - - $content = getXmlRpcResponse($obj); - printContent($content); - break; - - // 글 가져오기 - case 'metaWeblog.getPost' : - $document_srl = $params[0]->value->string->body; - if(!$document_srl) { - printContent( getXmlRpcFailure(1, 'no permission') ); - } else { - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists() || !$oDocument->isGranted()) { - printContent( getXmlRpcFailure(1, 'no permission') ); - } else { - // 카테고리를 사용하는지 확인후 사용시 카테고리 목록을 구해와서 Context에 세팅 - $category = ""; - if($oDocument->get('category_srl')) { - $oDocumentModel = &getModel('document'); - $category_list = $oDocumentModel->getCategoryList($oDocument->get('module_srl')); - if($category_list[$oDocument->get('category_srl')]) { - $category = $category_list[$oDocument->get('category_srl')]->title; - } - } - - $content = sprintf( - ''. - ''. - ''. - ''. - ''. - ''. - 'categories'. - 'dateCreated%s'. - 'description'. - 'link%s'. - 'postid%s'. - 'title'. - 'publish1'. - ''. - ''. - ''. - ''. - '', - $category, - date("Ymd", $oDocument->getRegdateTime()).'T'.date("H:i:s", $oDocument->getRegdateTime()), - $oDocument->getContent(false, false, true,false), - getFullUrl('','document_srl', $oDocument->document_srl), - $oDocument->document_srl, - $oDocument->getTitleText() - ); - printContent($content); - } - } - break; - - // 글작성 - case 'metaWeblog.newPost' : - unset($obj); - $info = $params[3]; - // 글, 제목, 카테고리 정보 구함 - for($i=0;$ivalue->struct->member);$i++) { - $val = $info->value->struct->member[$i]; - switch($val->name->body) { - case 'title' : - $obj->title = $val->value->string->body; - break; - case 'description' : - $obj->content = $val->value->string->body; - break; - case 'categories' : - $categories = $val->value->array->data->value; - if(!is_array($categories)) $categories = array($categories); - $category = $categories[0]->string->body; - if($category && $category_list) { - foreach($category_list as $category_srl => $category_info) { - if($category_info->title == $category) $obj->category_srl = $category_srl; - } - } - break; - case 'tagwords' : - $tags = $val->value->array->data->value; - if(!is_array($tags)) $tags = array($tags); - for($j=0;$jstring->body; - } - if(count($tag_list)) $obj->tags = implode(',',$tag_list); - break; - } - - } - - // 문서 번호 설정 - $document_srl = getNextSequence(); - $obj->document_srl = $document_srl; - $obj->module_srl = $this->module_srl; - - // 첨부파일 정리 - if(is_dir($tmp_uploaded_path)) { - $file_list = FileHandler::readDir($tmp_uploaded_path); - $file_count = count($file_list); - if($file_count) { - $oFileController = &getController('file'); - for($i=0;$i<$file_count;$i++) { - $file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]); - $file_info['name'] = $file_list[$i]; - $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true); - } - $obj->uploaded_count = $file_count; - } - } - - $obj->content = str_replace($uploaded_target_path,sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $filename), $obj->content); - - $oDocumentController = &getController('document'); - $obj->allow_comment = 'Y'; - $obj->allow_trackback = 'Y'; - $output = $oDocumentController->insertDocument($obj); - - if(!$output->toBool()) { - $content = getXmlRpcFailure(1, $output->getMessage()); - } else { - $content = getXmlRpcResponse(strval($document_srl)); - } - FileHandler::removeDir($tmp_uploaded_path); - - printContent($content); - break; - - // 글 수정 - case 'metaWeblog.editPost' : - $tmp_val = $params[0]->value->string->body; - if(!$tmp_val) $tmp_val = $params[0]->value->i4->body; - if(!$tmp_val) { - $content = getXmlRpcFailure(1, 'no permission'); - break; - } - $tmp_arr = explode('/', $tmp_val); - $document_srl = array_pop($tmp_arr); - if(!$document_srl) { - $content = getXmlRpcFailure(1, 'no permission'); - break; - } - - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - - // 글 수정 권한 체크 - if(!$oDocument->isGranted()) { - $content = getXmlRpcFailure(1, 'no permission'); - break; - } - - $obj = $oDocument->getObjectVars(); - - $info = $params[3]; - - // 글, 제목, 카테고리 정보 구함 - for($i=0;$ivalue->struct->member);$i++) { - $val = $info->value->struct->member[$i]; - switch($val->name->body) { - case 'title' : - $obj->title = $val->value->string->body; - break; - case 'description' : - $obj->content = $val->value->string->body; - break; - case 'categories' : - $categories = $val->value->array->data->value; - if(!is_array($categories)) $categories = array($categories); - $category = $categories[0]->string->body; - if($category && $category_list) { - foreach($category_list as $category_srl => $category_info) { - if($category_info->title == $category) $obj->category_srl = $category_srl; - } - } - break; - case 'tagwords' : - $tags = $val->value->array->data->value; - if(!is_array($tags)) $tags = array($tags); - for($j=0;$jstring->body; - } - if(count($tag_list)) $obj->tags = implode(',',$tag_list); - break; - } - - } - - // 문서 번호 설정 - $obj->document_srl = $document_srl; - $obj->module_srl = $this->module_srl; - - // 첨부파일 정리 - if(is_dir($tmp_uploaded_path)) { - $file_list = FileHandler::readDir($tmp_uploaded_path); - $file_count = count($file_list); - if($file_count) { - $oFileController = &getController('file'); - for($i=0;$i<$file_count;$i++) { - $file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]); - $file_info['name'] = $file_list[$i]; - - $moved_filename = sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $document_srl, $file_info['name']); - if(file_exists($moved_filename)) continue; - - $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true); - } - $obj->uploaded_count += $file_count; - } - } - - $obj->content = str_replace($uploaded_target_path,sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $filename), $obj->content); - - $oDocumentController = &getController('document'); - $output = $oDocumentController->updateDocument($oDocument,$obj); - - if(!$output->toBool()) { - $content = getXmlRpcFailure(1, $output->getMessage()); - } else { - $content = getXmlRpcResponse(true); - FileHandler::removeDir($tmp_uploaded_path); - } - - printContent($content); - break; - - // 글삭제 - case 'blogger.deletePost' : - $tmp_val = $params[0]->value->string->body; - $tmp_arr = explode('/', $tmp_val); - $document_srl = array_pop($tmp_arr); - - // 글 받아오기 - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - - // 글 존재 - if(!$oDocument->isExists()) { - $content = getXmlRpcFailure(1, 'not exists'); - - // 글 삭제 권한 체크 - } elseif(!$oDocument->isGranted()) { - $content = getXmlRpcFailure(1, 'no permission'); - break; - - // 삭제 - } else { - $oDocumentController = &getController('document'); - $output = $oDocumentController->deleteDocument($document_srl); - if(!$output->toBool()) $content = getXmlRpcFailure(1, $output->getMessage()); - else $content = getXmlRpcResponse(true); - } - - printContent($content); - break; - - // 최신글 받기 - case 'metaWeblog.getRecentPosts' : - // 목록을 구하기 위한 옵션 - $args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl - $args->page = 1; - $args->list_count = 20; - $args->sort_index = 'list_order'; ///< 소팅 값 - $logged_info = Context::get('logged_info'); - $args->search_target = 'member_srl'; - $args->search_keyword = $logged_info->member_srl; - $output = $oDocumentModel->getDocumentList($args); - if(!$output->toBool() || !$output->data) { - $content = getXmlRpcFailure(1, 'post not founded'); - printContent($content); - } else { - $oEditorController = &getController('editor'); - - $posts = array(); - foreach($output->data as $key => $oDocument) { - $post = null; - $post->categories = array(); - $post->dateCreated = date("Ymd", $oDocument->getRegdateTime()).'T'.date("H:i:s", $oDocument->getRegdateTime()); - $post->description = htmlspecialchars($oEditorController->transComponent($oDocument->getContent(false,false,true,false))); - $post->link = $post->permaLink = getFullUrl('','document_srl',$oDocument->document_srl); - $post->postid = $oDocument->document_srl; - $post->title = htmlspecialchars($oDocument->get('title')); - $post->publish = 1; - $post->userid = $oDocument->get('user_id'); - $post->mt_allow_pings = 0; - $post->mt_allow_comments = $oDocument->allowComment()=='Y'?1:0; - $posts[] = $post; - } - $content = getXmlRpcResponse($posts); - printContent($content); - } - break; - - // 아무런 요청이 없을 경우 RSD 출력 - default : - - $homepagelink = getUrl('','mid',$this->mid); - $site_module_info = Context::get('site_module_info'); - $api_url = getFullSiteUrl($site_module_info->domain, '', 'mid',$site_module_info->mid, 'act','api'); - $content = << - - - XpressEngine - http://www.xpressengine.com/ - {$homepagelink} - - - - - -RSDContent; - printContent($content); - break; - } - } -?> +domain, '', 'mid',$site_module_info->mid, 'act','api'); + + // 헤더에 rsd태그 삽입 + Context::addHtmlHeader(" ".''); + } + + // act가 api가 아니면 그냥 리턴~ + if($_REQUEST['act']!='api') return; + + // 관련 func 파일 읽음 + require_once('./addons/blogapi/blogapi.func.php'); + + // xmlprc 파싱 + // 요청된 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에 대한 호환 + if(in_array($method_name, array('metaWeblog.deletePost', 'metaWeblog.getUsersBlogs', 'metaWeblog.getUserInfo'))) { + $method_name = str_replace('metaWeblog.', 'blogger.', $method_name); + } + + // blogger.deletePost일 경우 첫번째 인자 값 삭제 + if($method_name == 'blogger.deletePost') array_shift($params); + + // user_id, password를 구해서 로그인 시도 + $user_id = trim($params[1]->value->string->body); + $password = trim($params[2]->value->string->body); + + // 모듈 실행전이라면 인증을 처리한다. + if($called_position == 'before_module_init') { + + // member controller을 이용해서 로그인 시도 + if($user_id && $password) { + $oMemberController = &getController('member'); + $output = $oMemberController->doLogin($user_id, $password); + // 로그인 실패시 에러 메시지 출력 + if(!$output->toBool()) { + $content = getXmlRpcFailure(1, $output->getMessage()); + printContent($content); + } + } else { + $content = getXmlRpcFailure(1, 'not logged'); + printContent($content); + } + } + + // 모듈에서 무언가 작업을 하기 전에 blogapi tool의 요청에 대한 처리를 하고 강제 종료한다. + if($called_position == 'before_module_proc') { + + // 글쓰기 권한 체크 (권한명의 경우 약속이 필요할듯..) + if(!$this->grant->write_document) { + printContent( getXmlRpcFailure(1, 'no permission') ); + } + + // 카테고리의 정보를 구해옴 + $oDocumentModel = &getModel('document'); + $category_list = $oDocumentModel->getCategoryList($this->module_srl); + + // 임시 파일 저장 장소 지정 + $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) { + // 블로그 정보 + case 'blogger.getUsersBlogs' : + $obj->url = getFullSiteUrl(''); + $obj->blogid = $this->mid; + $obj->blogName = $this->module_info->browser_title; + $blog_list = array($obj); + + $content = getXmlRpcResponse($blog_list); + printContent($content); + break; + + // 카테고리 목록 return + case 'metaWeblog.getCategories' : + $category_obj_list = array(); + if($category_list) { + foreach($category_list as $category_srl => $category_info) { + unset($obj); + $obj->description = $category_info->title; + //$obj->htmlUrl = Context::getRequestUri().$this->mid.'/1'; + //$obj->rssUrl= Context::getRequestUri().'rss/'.$this->mid.'/1'; + $obj->title = $category_info->title; + $obj->categoryid = $category_srl; + $category_obj_list[] = $obj; + } + } + + $content = getXmlRpcResponse($category_obj_list); + printContent($content); + break; + + // 파일 업로드 + case 'metaWeblog.newMediaObject' : + // 파일 업로드 권한 체크 + $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) { + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin != 'Y') { + $is_permitted = false; + for($i=0;$idownload_grant);$i++) { + $group_srl = $file_module_config->download_grant[$i]; + if($logged_info->group_list[$group_srl]) { + $is_permitted = true; + break; + } + } + if(!$is_permitted) printContent( getXmlRpcFailure(1, 'no permission') ); + } + } + + $fileinfo = $params[3]->value->struct->member; + foreach($fileinfo as $key => $val) { + $nodename = $val->name->body; + if($nodename == 'bits') $filedata = base64_decode($val->value->base64->body); + elseif($nodename == 'name') $filename = $val->value->string->body; + } + + $tmp_arr = explode('/',$filename); + $filename = array_pop($tmp_arr); + + if(!is_dir($tmp_uploaded_path)) FileHandler::makeDir($tmp_uploaded_path); + + $target_filename = sprintf('%s%s', $tmp_uploaded_path, $filename); + FileHandler::writeFile($target_filename, $filedata); + $obj->url = Context::getRequestUri().$target_filename; + + $content = getXmlRpcResponse($obj); + printContent($content); + break; + + // 글 가져오기 + case 'metaWeblog.getPost' : + $document_srl = $params[0]->value->string->body; + if(!$document_srl) { + printContent( getXmlRpcFailure(1, 'no permission') ); + } else { + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + if(!$oDocument->isExists() || !$oDocument->isGranted()) { + printContent( getXmlRpcFailure(1, 'no permission') ); + } else { + // 카테고리를 사용하는지 확인후 사용시 카테고리 목록을 구해와서 Context에 세팅 + $category = ""; + if($oDocument->get('category_srl')) { + $oDocumentModel = &getModel('document'); + $category_list = $oDocumentModel->getCategoryList($oDocument->get('module_srl')); + if($category_list[$oDocument->get('category_srl')]) { + $category = $category_list[$oDocument->get('category_srl')]->title; + } + } + + $content = sprintf( + ''. + ''. + ''. + ''. + ''. + ''. + 'categories'. + 'dateCreated%s'. + 'description'. + 'link%s'. + 'postid%s'. + 'title'. + 'publish1'. + ''. + ''. + ''. + ''. + '', + $category, + date("Ymd", $oDocument->getRegdateTime()).'T'.date("H:i:s", $oDocument->getRegdateTime()), + $oDocument->getContent(false, false, true,false), + getFullUrl('','document_srl', $oDocument->document_srl), + $oDocument->document_srl, + $oDocument->getTitleText() + ); + printContent($content); + } + } + break; + + // 글작성 + case 'metaWeblog.newPost' : + unset($obj); + $info = $params[3]; + // 글, 제목, 카테고리 정보 구함 + for($i=0;$ivalue->struct->member);$i++) { + $val = $info->value->struct->member[$i]; + switch($val->name->body) { + case 'title' : + $obj->title = $val->value->string->body; + break; + case 'description' : + $obj->content = $val->value->string->body; + break; + case 'categories' : + $categories = $val->value->array->data->value; + if(!is_array($categories)) $categories = array($categories); + $category = $categories[0]->string->body; + if($category && $category_list) { + foreach($category_list as $category_srl => $category_info) { + if($category_info->title == $category) $obj->category_srl = $category_srl; + } + } + break; + case 'tagwords' : + $tags = $val->value->array->data->value; + if(!is_array($tags)) $tags = array($tags); + for($j=0;$jstring->body; + } + if(count($tag_list)) $obj->tags = implode(',',$tag_list); + break; + } + + } + + // 문서 번호 설정 + $document_srl = getNextSequence(); + $obj->document_srl = $document_srl; + $obj->module_srl = $this->module_srl; + + // 첨부파일 정리 + if(is_dir($tmp_uploaded_path)) { + $file_list = FileHandler::readDir($tmp_uploaded_path); + $file_count = count($file_list); + if($file_count) { + $oFileController = &getController('file'); + for($i=0;$i<$file_count;$i++) { + $file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]); + $file_info['name'] = $file_list[$i]; + $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true); + } + $obj->uploaded_count = $file_count; + } + } + + $obj->content = str_replace($uploaded_target_path,sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $filename), $obj->content); + + $oDocumentController = &getController('document'); + $obj->allow_comment = 'Y'; + $obj->allow_trackback = 'Y'; + $output = $oDocumentController->insertDocument($obj); + + if(!$output->toBool()) { + $content = getXmlRpcFailure(1, $output->getMessage()); + } else { + $content = getXmlRpcResponse(strval($document_srl)); + } + FileHandler::removeDir($tmp_uploaded_path); + + printContent($content); + break; + + // 글 수정 + case 'metaWeblog.editPost' : + $tmp_val = $params[0]->value->string->body; + if(!$tmp_val) $tmp_val = $params[0]->value->i4->body; + if(!$tmp_val) { + $content = getXmlRpcFailure(1, 'no permission'); + break; + } + $tmp_arr = explode('/', $tmp_val); + $document_srl = array_pop($tmp_arr); + if(!$document_srl) { + $content = getXmlRpcFailure(1, 'no permission'); + break; + } + + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + + // 글 수정 권한 체크 + if(!$oDocument->isGranted()) { + $content = getXmlRpcFailure(1, 'no permission'); + break; + } + + $obj = $oDocument->getObjectVars(); + + $info = $params[3]; + + // 글, 제목, 카테고리 정보 구함 + for($i=0;$ivalue->struct->member);$i++) { + $val = $info->value->struct->member[$i]; + switch($val->name->body) { + case 'title' : + $obj->title = $val->value->string->body; + break; + case 'description' : + $obj->content = $val->value->string->body; + break; + case 'categories' : + $categories = $val->value->array->data->value; + if(!is_array($categories)) $categories = array($categories); + $category = $categories[0]->string->body; + if($category && $category_list) { + foreach($category_list as $category_srl => $category_info) { + if($category_info->title == $category) $obj->category_srl = $category_srl; + } + } + break; + case 'tagwords' : + $tags = $val->value->array->data->value; + if(!is_array($tags)) $tags = array($tags); + for($j=0;$jstring->body; + } + if(count($tag_list)) $obj->tags = implode(',',$tag_list); + break; + } + + } + + // 문서 번호 설정 + $obj->document_srl = $document_srl; + $obj->module_srl = $this->module_srl; + + // 첨부파일 정리 + if(is_dir($tmp_uploaded_path)) { + $file_list = FileHandler::readDir($tmp_uploaded_path); + $file_count = count($file_list); + if($file_count) { + $oFileController = &getController('file'); + for($i=0;$i<$file_count;$i++) { + $file_info['tmp_name'] = sprintf('%s%s', $tmp_uploaded_path, $file_list[$i]); + $file_info['name'] = $file_list[$i]; + + $moved_filename = sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $document_srl, $file_info['name']); + if(file_exists($moved_filename)) continue; + + $oFileController->insertFile($file_info, $this->module_srl, $document_srl, 0, true); + } + $obj->uploaded_count += $file_count; + } + } + + $obj->content = str_replace($uploaded_target_path,sprintf('/files/attach/images/%s/%s%s', $this->module_srl, getNumberingPath($document_srl,3), $filename), $obj->content); + + $oDocumentController = &getController('document'); + $output = $oDocumentController->updateDocument($oDocument,$obj); + + if(!$output->toBool()) { + $content = getXmlRpcFailure(1, $output->getMessage()); + } else { + $content = getXmlRpcResponse(true); + FileHandler::removeDir($tmp_uploaded_path); + } + + printContent($content); + break; + + // 글삭제 + case 'blogger.deletePost' : + $tmp_val = $params[0]->value->string->body; + $tmp_arr = explode('/', $tmp_val); + $document_srl = array_pop($tmp_arr); + + // 글 받아오기 + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + + // 글 존재 + if(!$oDocument->isExists()) { + $content = getXmlRpcFailure(1, 'not exists'); + + // 글 삭제 권한 체크 + } elseif(!$oDocument->isGranted()) { + $content = getXmlRpcFailure(1, 'no permission'); + break; + + // 삭제 + } else { + $oDocumentController = &getController('document'); + $output = $oDocumentController->deleteDocument($document_srl); + if(!$output->toBool()) $content = getXmlRpcFailure(1, $output->getMessage()); + else $content = getXmlRpcResponse(true); + } + + printContent($content); + break; + + // 최신글 받기 + case 'metaWeblog.getRecentPosts' : + // 목록을 구하기 위한 옵션 + $args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl + $args->page = 1; + $args->list_count = 20; + $args->sort_index = 'list_order'; ///< 소팅 값 + $logged_info = Context::get('logged_info'); + $args->search_target = 'member_srl'; + $args->search_keyword = $logged_info->member_srl; + $output = $oDocumentModel->getDocumentList($args); + if(!$output->toBool() || !$output->data) { + $content = getXmlRpcFailure(1, 'post not founded'); + printContent($content); + } else { + $oEditorController = &getController('editor'); + + $posts = array(); + foreach($output->data as $key => $oDocument) { + $post = null; + $post->categories = array(); + $post->dateCreated = date("Ymd", $oDocument->getRegdateTime()).'T'.date("H:i:s", $oDocument->getRegdateTime()); + $post->description = htmlspecialchars($oEditorController->transComponent($oDocument->getContent(false,false,true,false))); + $post->link = $post->permaLink = getFullUrl('','document_srl',$oDocument->document_srl); + $post->postid = $oDocument->document_srl; + $post->title = htmlspecialchars($oDocument->get('title')); + $post->publish = 1; + $post->userid = $oDocument->get('user_id'); + $post->mt_allow_pings = 0; + $post->mt_allow_comments = $oDocument->allowComment()=='Y'?1:0; + $posts[] = $post; + } + $content = getXmlRpcResponse($posts); + printContent($content); + } + break; + + // 아무런 요청이 없을 경우 RSD 출력 + default : + + $homepagelink = getUrl('','mid',$this->mid); + $site_module_info = Context::get('site_module_info'); + $api_url = getFullSiteUrl($site_module_info->domain, '', 'mid',$site_module_info->mid, 'act','api'); + $content = << + + + XpressEngine + http://www.xpressengine.com/ + {$homepagelink} + + + + + +RSDContent; + printContent($content); + break; + } + } +?> diff --git a/addons/blogapi/blogapi.func.php b/addons/blogapi/blogapi.func.php index 511ac44e3..f89fff237 100644 --- a/addons/blogapi/blogapi.func.php +++ b/addons/blogapi/blogapi.func.php @@ -1,69 +1,69 @@ -\n\n\nfaultCode\n%d\n\n\nfaultString\n%s\n\n\n\n", - $error, - htmlspecialchars($message) - ); - } - - // 결과 표시 - function getXmlRpcResponse($params) { - $buff = ''."\n"; - $buff .= _getEncodedVal($params); - $buff .= "\n\n"; - - return $buff; - } - - // 인코딩 처리 - 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); - elseif(is_double($val)) $buff = sprintf("%f", $val); - elseif(is_bool($val)) $buff = sprintf("%d", $val?1:0); - elseif(is_object($val)) { - $values = get_object_vars($val); - $val_count = count($values); - $buff = ""; - foreach($values as $k => $v) { - $buff .= sprintf("\n%s\n%s\n", htmlspecialchars($k), _getEncodedVal($v, true)); - } - $buff .= "\n"; - } elseif(is_array($val)) { - $val_count = count($val); - $buff = "\n"; - for($i=0;$i<$val_count;$i++) { - $buff .= _getEncodedVal($val[$i], true); - } - $buff .= "\n"; - } else { - $buff = sprintf("%s\n", $val); - } - if(!$is_sub_set) return sprintf("\n%s", $buff); - return $buff; - } - - // 결과 출력 - function printContent($content) { - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - print $content; - Context::close(); - exit(); - } -?> +\n\n\nfaultCode\n%d\n\n\nfaultString\n%s\n\n\n\n", + $error, + htmlspecialchars($message) + ); + } + + // 결과 표시 + function getXmlRpcResponse($params) { + $buff = ''."\n"; + $buff .= _getEncodedVal($params); + $buff .= "\n\n"; + + return $buff; + } + + // 인코딩 처리 + 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); + elseif(is_double($val)) $buff = sprintf("%f", $val); + elseif(is_bool($val)) $buff = sprintf("%d", $val?1:0); + elseif(is_object($val)) { + $values = get_object_vars($val); + $val_count = count($values); + $buff = ""; + foreach($values as $k => $v) { + $buff .= sprintf("\n%s\n%s\n", htmlspecialchars($k), _getEncodedVal($v, true)); + } + $buff .= "\n"; + } elseif(is_array($val)) { + $val_count = count($val); + $buff = "\n"; + for($i=0;$i<$val_count;$i++) { + $buff .= _getEncodedVal($val[$i], true); + } + $buff .= "\n"; + } else { + $buff = sprintf("%s\n", $val); + } + if(!$is_sub_set) return sprintf("\n%s", $buff); + return $buff; + } + + // 결과 출력 + function printContent($content) { + header("Content-Type: text/xml; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + print $content; + Context::close(); + exit(); + } +?> diff --git a/addons/blogapi/conf/info.xml b/addons/blogapi/conf/info.xml index f533cd4a6..2dcb3c9dd 100644 --- a/addons/blogapi/conf/info.xml +++ b/addons/blogapi/conf/info.xml @@ -1,80 +1,80 @@ - - - BlogAPI 애드온 - BlogAPIアドオン - BlogAPI - Addon for BlogAPI - BlogAPI Addon - Addon für BlogAPI - Addon para BlogAPI - Аддон для BlogAPI - 部落格 API - - metaWeblog를 지원하는 blogApi애드온입니다. - 사용으로 설정하시면 각 모듈마다 RSD 태그를 노출합니다. - api의 주소는 http://설치주소/모듈명/api 입니다. - 사용으로 하셔야 RSD태그 및 api가 동작을 합니다. - - - MetaWeblogをサポートするBlog APIアドオンです。 - 「使用する」にチェックすると各モジュールごとにRSDのアドレスを表示します。 - APIのアドレスは「http://インストールURL/モジュール名/api」です。 - 「使用する」に設定してから、RSDタグ、およびAPIが作動します。 - - - 支持metaWeblog的 blogApi插件。 - 设置为"启用"时,会使每个模块都会显示RSD标签。 - api地址为http://安装地址/模块名/api。 - 把状态设置为"使用"时,才会激活RSD标签及api。 - - - This blogApi addon supports metaWeblog. - By using this option, it lets the RSD tag to be exposed to each module. - URL to the api is http://setup_path/module_name/api. - RSD tag and the api will work only if u use this addon. - - - Addon BlogAPI này hỗ trợ metaWeblog.. - Bằng việc sử dụng tùy chọn này, Tag RSD sẽ được hiển thị đến mỗi Module. - URL cho API có dạng http://setup_path/module_name/api. - RSD Tag và API chỉ làm việc khi Addon này được kích hoạt. - - - Diese blogApi addon metaWeblog unterstützt. - Durch die Verwendung dieser Option, die es ermöglicht RSD Tag ausgesetzt werden jedes Modul. - URL der api ist http://setup_path/module_name/api. - RSD-Tag und dem API arbeiten und nur dann, wenn Sie über dieses Addon. - - - Este blogApi addon soporta el metaWeblog. - Si seleccionas la optión usar, cada módulo entregará la etiqueta RSD. - La dirección de api es http://dirección de la instalación/nombre de módulo/api. - Sólo si seleccionas la opción usar, funcionará la etiqueta RSD y api. - - - Этот blogApi аддон поддерживает metaWeblog. - Используя этот аддон, RSD тег становится доступным для каждого модуля. - URL для api - http://setup_path/module_name/api. - тег RSD и api работают только при включенном аддоне. - - - 支援 MetaWeblog 的部落格 API 附加元件。 - 設置成"啟用"時,會使每個模組都顯示 RSD 圖示。 - API網址是 http://安裝位置/模組名稱/api。 - 將狀態設置成"啟用"時,才可使用 RSD 和 API - - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + BlogAPI 애드온 + BlogAPIアドオン + BlogAPI + Addon for BlogAPI + BlogAPI Addon + Addon für BlogAPI + Addon para BlogAPI + Аддон для BlogAPI + 部落格 API + + metaWeblog를 지원하는 blogApi애드온입니다. + 사용으로 설정하시면 각 모듈마다 RSD 태그를 노출합니다. + api의 주소는 http://설치주소/모듈명/api 입니다. + 사용으로 하셔야 RSD태그 및 api가 동작을 합니다. + + + MetaWeblogをサポートするBlog APIアドオンです。 + 「使用する」にチェックすると各モジュールごとにRSDのアドレスを表示します。 + APIのアドレスは「http://インストールURL/モジュール名/api」です。 + 「使用する」に設定してから、RSDタグ、およびAPIが作動します。 + + + 支持metaWeblog的 blogApi插件。 + 设置为"启用"时,会使每个模块都会显示RSD标签。 + api地址为http://安装地址/模块名/api。 + 把状态设置为"使用"时,才会激活RSD标签及api。 + + + This blogApi addon supports metaWeblog. + By using this option, it lets the RSD tag to be exposed to each module. + URL to the api is http://setup_path/module_name/api. + RSD tag and the api will work only if u use this addon. + + + Addon BlogAPI này hỗ trợ metaWeblog.. + Bằng việc sử dụng tùy chọn này, Tag RSD sẽ được hiển thị đến mỗi Module. + URL cho API có dạng http://setup_path/module_name/api. + RSD Tag và API chỉ làm việc khi Addon này được kích hoạt. + + + Diese blogApi addon metaWeblog unterstützt. + Durch die Verwendung dieser Option, die es ermöglicht RSD Tag ausgesetzt werden jedes Modul. + URL der api ist http://setup_path/module_name/api. + RSD-Tag und dem API arbeiten und nur dann, wenn Sie über dieses Addon. + + + Este blogApi addon soporta el metaWeblog. + Si seleccionas la optión usar, cada módulo entregará la etiqueta RSD. + La dirección de api es http://dirección de la instalación/nombre de módulo/api. + Sólo si seleccionas la opción usar, funcionará la etiqueta RSD y api. + + + Этот blogApi аддон поддерживает metaWeblog. + Используя этот аддон, RSD тег становится доступным для каждого модуля. + URL для api - http://setup_path/module_name/api. + тег RSD и api работают только при включенном аддоне. + + + 支援 MetaWeblog 的部落格 API 附加元件。 + 設置成"啟用"時,會使每個模組都顯示 RSD 圖示。 + API網址是 http://安裝位置/模組名稱/api。 + 將狀態設置成"啟用"時,才可使用 RSD 和 API + + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php index 83dc587f1..4bc424d4e 100644 --- a/addons/captcha/captcha.addon.php +++ b/addons/captcha/captcha.addon.php @@ -1,263 +1,263 @@ -addon_info = $addon_info; - } - - function before_module_proc() - { - if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed']) { - unset($_SESSION['captcha_authed']); - } - } - - function before_module_init(&$ModuleHandler) - { - $logged_info = Context::get('logged_info'); - if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) return false; - if($this->addon_info->target != 'all' && Context::get('is_logged')) return false; - if($_SESSION['captcha_authed']) return false; - - $target_acts = array('procBoardInsertDocument','procBoardInsertComment','procIssuetrackerInsertIssue','procIssuetrackerInsertHistory','procTextyleInsertComment'); - if($this->addon_info->apply_find_account=='apply') $target_acts[] = 'procMemberFindAccount'; - if($this->addon_info->apply_resend_auth_mail=='apply') $target_acts[] = 'procMemberResendAuthMail'; - if($this->addon_info->apply_signup=='apply') $target_acts[] = 'procMemberInsert'; - - if(Context::getRequestMethod()!='XMLRPC' && Context::getRequestMethod()!=='JSON') - { - Context::addHtmlHeader(''); - Context::addJsFile('./addons/captcha/captcha.js',false, '', null, 'body'); - } - - // 게시판/ 이슈트래커의 글쓰기/댓글쓰기 액션 호출시 세션 비교 - if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts)) { - Context::loadLang('./addons/captcha/lang'); - $ModuleHandler->error = "captcha_denied"; - } - - return true; - } - - function before_module_init_setCaptchaSession() - { - if($_SESSION['captcha_authed']) return false; - - // 언어파일 로드 - Context::loadLang(_XE_PATH_.'addons/captcha/lang'); - - // 키워드 생성 - $arr = range('A','Y'); - shuffle($arr); - $arr = array_slice($arr,0,6); - $_SESSION['captcha_keyword'] = join('', $arr); - - $target = Context::getLang('target_captcha'); - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - printf("\r\n 0\r\n success\r\n \r\n \r\n \r\n \r\n \r\n " - ,Context::getLang('about_captcha') - ,Context::getLang('captcha_reload') - ,Context::getLang('captcha_play') - ,Context::getLang('cmd_input') - ,Context::getLang('cmd_cancel') - ); - Context::close(); - exit(); - } - - function before_module_init_captchaImage() - { - if($_SESSION['captcha_authed']) return false; - - $keyword = $_SESSION['captcha_keyword']; - $im = $this->createCaptchaImage($keyword); - - header("Cache-Control: "); - header("Pragma: "); - header("Content-Type: image/png"); - - imagepng($im); - imagedestroy($im); - - Context::close(); - exit(); - } - - function createCaptchaImage($string) - { - $arr = array(); - for($i=0,$c=strlen($string);$i<$c;$i++) $arr[] = $string{$i}; - - // 글자 하나 사이즈 - $w = 18; - $h = 25; - - // 글자 수 - $c = count($arr); - - // 글자 이미지 - $im = array(); - - // 총사이즈로 바탕 이미지 생성 - $im[] = imagecreate(($w+2)*count($arr), $h); - - $deg = range(-30,30); - shuffle($deg); - - // 글자별 이미지 생성 - 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); - - // 글자폰트(사이즈) 조절 - $ran = range(1,20); - shuffle($ran); - - if(function_exists('imagerotate')) - { - imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%8), $str, $text_color); - $im[$i+1] = imagerotate($im[$i+1], array_pop($deg), 0); - - $background_color = imagecolorallocate($im[$i+1], 255, 255, 255); - imagecolortransparent($im[$i+1], $background_color); - } - else - { - imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%4), $str, $text_color); - } - } - - // 각글자 이미지를 합침 - for($i=1;$icreateCaptchaAudio($keyword); - - header('Content-type: audio/mpeg'); - header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\""); - header('Cache-Control: no-store, no-cache, must-revalidate'); - header('Expires: Sun, 1 Jan 2000 12:00:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); - header('Content-Length: ' . strlen($data)); - - echo $data; - Context::close(); - exit(); - } - - function createCaptchaAudio($string) - { - $data = ''; - $_audio = './addons/captcha/audio/F_%s.mp3'; - for($i=0,$c=strlen($string);$i<$c;$i++) - { - $_data = FileHandler::readFile(sprintf($_audio, $string{$i})); - - $start = rand(5, 68); // 해더 4바이트, 데이터 영역 64바이트 정도 랜덤하게 시작 - $datalen = strlen($_data) - $start - 256; // 마지막 unchanged 256 바이트 - - for($j=$start;$j<$datalen;$j+=64) - { - $ch = ord($_data{$j}); - if($ch<9 || $ch>119) continue; - $_data{$j} = chr($ch+rand(-8,8)); - } - - $data .= $_data; - } - - return $data; - } - - function before_module_init_captchaCompare() - { - if($_SESSION['captcha_authed']) return false; - - if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) $_SESSION['captcha_authed'] = true; - else unset($_SESSION['captcha_authed']); - - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - print("\r\n0\r\nsuccess\r\n"); - - Context::close(); - exit(); - } - } - - $GLOBALS['__AddonCaptcha__'] = new AddonCaptcha; - $GLOBALS['__AddonCaptcha__']->setInfo($addon_info); - } - - $oAddonCaptcha = &$GLOBALS['__AddonCaptcha__']; - - if(method_exists(&$oAddonCaptcha, $called_position)) - { - if(!call_user_func(array(&$oAddonCaptcha, $called_position), &$this)) return false; - } - - $addon_act = Context::get('captcha_action'); - if($addon_act && method_exists(&$oAddonCaptcha, $called_position.'_'.$addon_act)) - { - if(!call_user_func(array(&$oAddonCaptcha, $called_position.'_'.$addon_act), &$this)) return false; - } - -?> +addon_info = $addon_info; + } + + function before_module_proc() + { + if($this->addon_info->act_type == 'everytime' && $_SESSION['captcha_authed']) { + unset($_SESSION['captcha_authed']); + } + } + + function before_module_init(&$ModuleHandler) + { + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin == 'Y' || $logged_info->is_site_admin) return false; + if($this->addon_info->target != 'all' && Context::get('is_logged')) return false; + if($_SESSION['captcha_authed']) return false; + + $target_acts = array('procBoardInsertDocument','procBoardInsertComment','procIssuetrackerInsertIssue','procIssuetrackerInsertHistory','procTextyleInsertComment'); + if($this->addon_info->apply_find_account=='apply') $target_acts[] = 'procMemberFindAccount'; + if($this->addon_info->apply_resend_auth_mail=='apply') $target_acts[] = 'procMemberResendAuthMail'; + if($this->addon_info->apply_signup=='apply') $target_acts[] = 'procMemberInsert'; + + if(Context::getRequestMethod()!='XMLRPC' && Context::getRequestMethod()!=='JSON') + { + Context::addHtmlHeader(''); + Context::addJsFile('./addons/captcha/captcha.js',false, '', null, 'body'); + } + + // 게시판/ 이슈트래커의 글쓰기/댓글쓰기 액션 호출시 세션 비교 + if(!$_SESSION['captcha_authed'] && in_array(Context::get('act'), $target_acts)) { + Context::loadLang('./addons/captcha/lang'); + $ModuleHandler->error = "captcha_denied"; + } + + return true; + } + + function before_module_init_setCaptchaSession() + { + if($_SESSION['captcha_authed']) return false; + + // 언어파일 로드 + Context::loadLang(_XE_PATH_.'addons/captcha/lang'); + + // 키워드 생성 + $arr = range('A','Y'); + shuffle($arr); + $arr = array_slice($arr,0,6); + $_SESSION['captcha_keyword'] = join('', $arr); + + $target = Context::getLang('target_captcha'); + header("Content-Type: text/xml; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + printf("\r\n 0\r\n success\r\n \r\n \r\n \r\n \r\n \r\n " + ,Context::getLang('about_captcha') + ,Context::getLang('captcha_reload') + ,Context::getLang('captcha_play') + ,Context::getLang('cmd_input') + ,Context::getLang('cmd_cancel') + ); + Context::close(); + exit(); + } + + function before_module_init_captchaImage() + { + if($_SESSION['captcha_authed']) return false; + + $keyword = $_SESSION['captcha_keyword']; + $im = $this->createCaptchaImage($keyword); + + header("Cache-Control: "); + header("Pragma: "); + header("Content-Type: image/png"); + + imagepng($im); + imagedestroy($im); + + Context::close(); + exit(); + } + + function createCaptchaImage($string) + { + $arr = array(); + for($i=0,$c=strlen($string);$i<$c;$i++) $arr[] = $string{$i}; + + // 글자 하나 사이즈 + $w = 18; + $h = 25; + + // 글자 수 + $c = count($arr); + + // 글자 이미지 + $im = array(); + + // 총사이즈로 바탕 이미지 생성 + $im[] = imagecreate(($w+2)*count($arr), $h); + + $deg = range(-30,30); + shuffle($deg); + + // 글자별 이미지 생성 + 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); + + // 글자폰트(사이즈) 조절 + $ran = range(1,20); + shuffle($ran); + + if(function_exists('imagerotate')) + { + imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%8), $str, $text_color); + $im[$i+1] = imagerotate($im[$i+1], array_pop($deg), 0); + + $background_color = imagecolorallocate($im[$i+1], 255, 255, 255); + imagecolortransparent($im[$i+1], $background_color); + } + else + { + imagestring($im[$i+1], (array_pop($ran)%3)+3, 2, (array_pop($ran)%4), $str, $text_color); + } + } + + // 각글자 이미지를 합침 + for($i=1;$icreateCaptchaAudio($keyword); + + header('Content-type: audio/mpeg'); + header("Content-Disposition: attachment; filename=\"captcha_audio.mp3\""); + header('Cache-Control: no-store, no-cache, must-revalidate'); + header('Expires: Sun, 1 Jan 2000 12:00:00 GMT'); + header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); + header('Content-Length: ' . strlen($data)); + + echo $data; + Context::close(); + exit(); + } + + function createCaptchaAudio($string) + { + $data = ''; + $_audio = './addons/captcha/audio/F_%s.mp3'; + for($i=0,$c=strlen($string);$i<$c;$i++) + { + $_data = FileHandler::readFile(sprintf($_audio, $string{$i})); + + $start = rand(5, 68); // 해더 4바이트, 데이터 영역 64바이트 정도 랜덤하게 시작 + $datalen = strlen($_data) - $start - 256; // 마지막 unchanged 256 바이트 + + for($j=$start;$j<$datalen;$j+=64) + { + $ch = ord($_data{$j}); + if($ch<9 || $ch>119) continue; + $_data{$j} = chr($ch+rand(-8,8)); + } + + $data .= $_data; + } + + return $data; + } + + function before_module_init_captchaCompare() + { + if($_SESSION['captcha_authed']) return false; + + if(strtoupper($_SESSION['captcha_keyword']) == strtoupper(Context::get('secret_text'))) $_SESSION['captcha_authed'] = true; + else unset($_SESSION['captcha_authed']); + + header("Content-Type: text/xml; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + print("\r\n0\r\nsuccess\r\n"); + + Context::close(); + exit(); + } + } + + $GLOBALS['__AddonCaptcha__'] = new AddonCaptcha; + $GLOBALS['__AddonCaptcha__']->setInfo($addon_info); + } + + $oAddonCaptcha = &$GLOBALS['__AddonCaptcha__']; + + if(method_exists(&$oAddonCaptcha, $called_position)) + { + if(!call_user_func(array(&$oAddonCaptcha, $called_position), &$this)) return false; + } + + $addon_act = Context::get('captcha_action'); + if($addon_act && method_exists(&$oAddonCaptcha, $called_position.'_'.$addon_act)) + { + if(!call_user_func(array(&$oAddonCaptcha, $called_position.'_'.$addon_act), &$this)) return false; + } + +?> diff --git a/addons/captcha/conf/info.xml b/addons/captcha/conf/info.xml index e2353c16b..32e31850e 100644 --- a/addons/captcha/conf/info.xml +++ b/addons/captcha/conf/info.xml @@ -1,222 +1,222 @@ - - - Captcha 애드온 - CAPTCHA - Captcha Addon - 验证码插件 - Captchaアドオン - Аддон Captcha - 圖形驗證 - - 프로그램 글 등록기를 막기 위해 게시판/ issueTracker에서 글/ 댓글을 입력하려 할 때 알파벳을 입력해야 글/댓글이 입력되는 애드온 입니다. - 로그인하지 않은 경우에만 해당됩니다. - - - To block spam written by programs, let users to choose a suitable image to text when writing a posting or comment. - This addon applies only to not-logged-in users. - - - Addon này tạo ra một hình ảnh xác nhận khi đăng kí, gửi bài, hay viết bình luận nếu thành viên không đăng nhập. - Addon này chỉ hoạt động khi được kích hoạt. - - - 为了解决互联网垃圾而开发的验证码机制。 - 非登录用户发布话题或评论时将会弹出验证图片选择框,选择正确的图片才可以正常发布(适用于版面/issueTracker)。 - - - ボット(bot)がプログラムによるスパム行為を防ぐために、掲示板/issueTrackerで書き込み・コメントを登録する際、ランダムな文字や数字の列を画面に表示し、表示されたものと一致した情報を入力した時、登録が出来るようにするアドオンです。 - ログインしてない時だけ、動作します。 - - - To block spam written by programs, let users to choose a suitable image to text when writing a posting or comment. - This addon applies only to not-logged-in users. - - - 可防止機器人程式的垃圾留言,非用戶要發表主題或回覆時,必須要輸入正確圖片中所顯示的文字才能發表。 - - 1.0 - 2010-08-19 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - - - - Captcha 표시 대상 - 应用对象 - Captchaを表示する対象 - 選擇目標 - Captcha Target - Captcha Target - Mục tiêu Captcha hiển thị - 글/댓글 등록시 captcha가 동작할 대상을 정할 수 있습니다. 관리자는 무조건 제외됩니다 - 可以指定验证码应用对象(管理员除外)。 - 管理者を除き、書き込み・コメントを入力する際にcaptchaイメージを見せる対象を設定します。 - 除了管理員,可以選擇圖形驗證應用的對象。 - You may specify targets CAPTCHA work. It's not applied when administrator writes. - You may specify targets CAPTCHA work. It's not applied when administrator writes. - Khi gửi bài, bình luận, Capcha sẽ hiển thị để xác nhận hành động của người sử dụng. Chức năng này không hoạt động với người quản lý. - - 로그인하지 않은 사용자 - 非登录用户 - ログインしてないユーザー - 非用戶 - Not logged-in users - Not logged-in users - Người dùng chưa đăng nhập - - - 모든 사용자 - 所有用户 - すべてのユーザー - 所有用戶 - All users - All users - Tất cả mọi người - - - - 동작 방식 - 验证方式 - 動作方式 - 驗證模式 - How it works - How it works - Sử dụng - "1번만 동작"을 선택하시면 1번만 동작후 상태를 저장해서 다음부터 물어보지 않고 그렇지 않으면 매번 물어보게 됩니다 - "一次"就是每个IP只出现一次验证。 - 「1回だけ表示」を選択すると、最初だけ動作した後、その情報を記憶して次回からはCaptchaを見せないようにします。また、もう一つのオプションは毎回Captchaを表示します。 - 選擇"單次",下次不會再顯示;選擇"每次"則會一直顯示。 - If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes. - If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes. - Nếu chọn "Chỉ một lần" thì sau lần hiển thị đó Capcha sẽ không hiển thị với người sử dụng đó nữa. - - 1번만 동작 - 一次 - 1回だけ表示 - 單次 - Chỉ một lần - once - 1 раз - - - 매번 동작 - 每次 - 毎回表示 - 每次 - every time - каждый раз - Luôn sử dụng - - - - 비밀번호 찾기 적용 - 应用到查找密码功能 - 비밀번호 찾기 적용 - 忘記密碼 - applying to an action finding account - applying to an action finding account - Khi lấy lại mật khẩu - 적용으로 하시면 비밀번호 찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다. - 启用此项功能可以有效地拦截以查找密码名义发送的垃圾邮件。 - 적용으로 하시면 비밀번호찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다. - 開啟功能後在忘記密碼時會顯示驗證碼。 - If you set this option as apply, CAPTCHA will work for finding account action, too. - If you set this option as apply, CAPTCHA will work for finding account action, too. - Nếu áp dụng, khi thành viên cần lấy lại mật khẩu khi lỡ quên, Capcha sẽ hiện thị để xác nhận việc này. - - 적용하지 않음 - 不启用 - 적용하지 않음 - 關閉 - Not apply - Not apply - Không áp dụng - - - 적용 - 启用 - 적용 - 開啟 - Apply - Apply - Áp dụng - - - - 인증 메일 재발송 적용 - 应用到认证邮件重新发送功能 - 인증 메일 재발송 적용 - 重寄認證信 - apply to an action resending authmail - apply to an action resending authmail - Khi lấy lại mã kích hoạt - 적용으로 하시면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다. - 启用此项功能可以有效地拦截以重新发送认证邮件名义发送的垃圾邮件。 - 적용으로 하시면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다. - 開啟功能後在重寄認證信時會顯示驗證碼。 - If you set this option as apply, CAPTCHA will work for resending authmail action, too. - If you set this option as apply, CAPTCHA will work for resending authmail action, too. - Nếu áp dụng, khi thành viên cần lấy lại mã kích hoạt thành viên, Capcha sẽ hiện thị để xác nhận việc này. - - 적용하지 않음 - 不启用 - 적용하지 않음 - 關閉 - Not apply - Not apply - Không áp dụng - - - 적용 - 启用 - 적용 - 開啟 - Apply - Apply - Áp dụng - - - - 회원 가입 적용 - 应用到用户注册表单 - 인증 메일 재발송 적용 - 會員註冊 - Apply to member signup - Apply to member signup - Apply to member signup - 적용으로 하시면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다. - 启用此项功能可以有效地拦截自动注册软件的施虐。 - 적용으로 하시면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다. - 開啟功能後在註冊時會顯示驗證碼。 - If you set this option as apply, CAPTCHA will work for signup action, too. - If you set this option as apply, CAPTCHA will work for signup action, too. - If you set this option as apply, CAPTCHA will work for signup action, too. - - 적용하지 않음 - 不启用 - 적용하지 않음 - 關閉 - Not apply - Not apply - Không áp dụng - - - 적용 - 启用 - 적용 - 開啟 - Apply - Apply - Áp dụng - - - - + + + Captcha 애드온 + CAPTCHA + Captcha Addon + 验证码插件 + Captchaアドオン + Аддон Captcha + 圖形驗證 + + 프로그램 글 등록기를 막기 위해 게시판/ issueTracker에서 글/ 댓글을 입력하려 할 때 알파벳을 입력해야 글/댓글이 입력되는 애드온 입니다. + 로그인하지 않은 경우에만 해당됩니다. + + + To block spam written by programs, let users to choose a suitable image to text when writing a posting or comment. + This addon applies only to not-logged-in users. + + + Addon này tạo ra một hình ảnh xác nhận khi đăng kí, gửi bài, hay viết bình luận nếu thành viên không đăng nhập. + Addon này chỉ hoạt động khi được kích hoạt. + + + 为了解决互联网垃圾而开发的验证码机制。 + 非登录用户发布话题或评论时将会弹出验证图片选择框,选择正确的图片才可以正常发布(适用于版面/issueTracker)。 + + + ボット(bot)がプログラムによるスパム行為を防ぐために、掲示板/issueTrackerで書き込み・コメントを登録する際、ランダムな文字や数字の列を画面に表示し、表示されたものと一致した情報を入力した時、登録が出来るようにするアドオンです。 + ログインしてない時だけ、動作します。 + + + To block spam written by programs, let users to choose a suitable image to text when writing a posting or comment. + This addon applies only to not-logged-in users. + + + 可防止機器人程式的垃圾留言,非用戶要發表主題或回覆時,必須要輸入正確圖片中所顯示的文字才能發表。 + + 1.0 + 2010-08-19 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + + + + Captcha 표시 대상 + 应用对象 + Captchaを表示する対象 + 選擇目標 + Captcha Target + Captcha Target + Mục tiêu Captcha hiển thị + 글/댓글 등록시 captcha가 동작할 대상을 정할 수 있습니다. 관리자는 무조건 제외됩니다 + 可以指定验证码应用对象(管理员除外)。 + 管理者を除き、書き込み・コメントを入力する際にcaptchaイメージを見せる対象を設定します。 + 除了管理員,可以選擇圖形驗證應用的對象。 + You may specify targets CAPTCHA work. It's not applied when administrator writes. + You may specify targets CAPTCHA work. It's not applied when administrator writes. + Khi gửi bài, bình luận, Capcha sẽ hiển thị để xác nhận hành động của người sử dụng. Chức năng này không hoạt động với người quản lý. + + 로그인하지 않은 사용자 + 非登录用户 + ログインしてないユーザー + 非用戶 + Not logged-in users + Not logged-in users + Người dùng chưa đăng nhập + + + 모든 사용자 + 所有用户 + すべてのユーザー + 所有用戶 + All users + All users + Tất cả mọi người + + + + 동작 방식 + 验证方式 + 動作方式 + 驗證模式 + How it works + How it works + Sử dụng + "1번만 동작"을 선택하시면 1번만 동작후 상태를 저장해서 다음부터 물어보지 않고 그렇지 않으면 매번 물어보게 됩니다 + "一次"就是每个IP只出现一次验证。 + 「1回だけ表示」を選択すると、最初だけ動作した後、その情報を記憶して次回からはCaptchaを見せないようにします。また、もう一つのオプションは毎回Captchaを表示します。 + 選擇"單次",下次不會再顯示;選擇"每次"則會一直顯示。 + If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes. + If you choose "Once", CAPTCHA works only once for the user by storing status. Otherwise, this addon would show an image every time the user writes. + Nếu chọn "Chỉ một lần" thì sau lần hiển thị đó Capcha sẽ không hiển thị với người sử dụng đó nữa. + + 1번만 동작 + 一次 + 1回だけ表示 + 單次 + Chỉ một lần + once + 1 раз + + + 매번 동작 + 每次 + 毎回表示 + 每次 + every time + каждый раз + Luôn sử dụng + + + + 비밀번호 찾기 적용 + 应用到查找密码功能 + 비밀번호 찾기 적용 + 忘記密碼 + applying to an action finding account + applying to an action finding account + Khi lấy lại mật khẩu + 적용으로 하시면 비밀번호 찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다. + 启用此项功能可以有效地拦截以查找密码名义发送的垃圾邮件。 + 적용으로 하시면 비밀번호찾기 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다. + 開啟功能後在忘記密碼時會顯示驗證碼。 + If you set this option as apply, CAPTCHA will work for finding account action, too. + If you set this option as apply, CAPTCHA will work for finding account action, too. + Nếu áp dụng, khi thành viên cần lấy lại mật khẩu khi lỡ quên, Capcha sẽ hiện thị để xác nhận việc này. + + 적용하지 않음 + 不启用 + 적용하지 않음 + 關閉 + Not apply + Not apply + Không áp dụng + + + 적용 + 启用 + 적용 + 開啟 + Apply + Apply + Áp dụng + + + + 인증 메일 재발송 적용 + 应用到认证邮件重新发送功能 + 인증 메일 재발송 적용 + 重寄認證信 + apply to an action resending authmail + apply to an action resending authmail + Khi lấy lại mã kích hoạt + 적용으로 하시면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다. + 启用此项功能可以有效地拦截以重新发送认证邮件名义发送的垃圾邮件。 + 적용으로 하시면 인증 메일 재발송 기능에도 적용되어 악의적인 봇(또는 프로그램)에 의한 메일 발송을 막을 수 있습니다. + 開啟功能後在重寄認證信時會顯示驗證碼。 + If you set this option as apply, CAPTCHA will work for resending authmail action, too. + If you set this option as apply, CAPTCHA will work for resending authmail action, too. + Nếu áp dụng, khi thành viên cần lấy lại mã kích hoạt thành viên, Capcha sẽ hiện thị để xác nhận việc này. + + 적용하지 않음 + 不启用 + 적용하지 않음 + 關閉 + Not apply + Not apply + Không áp dụng + + + 적용 + 启用 + 적용 + 開啟 + Apply + Apply + Áp dụng + + + + 회원 가입 적용 + 应用到用户注册表单 + 인증 메일 재발송 적용 + 會員註冊 + Apply to member signup + Apply to member signup + Apply to member signup + 적용으로 하시면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다. + 启用此项功能可以有效地拦截自动注册软件的施虐。 + 적용으로 하시면 회원가입 기능에도 적용되어 악의적인 봇(또는 프로그램)의 회원가입을 막을 수 있습니다. + 開啟功能後在註冊時會顯示驗證碼。 + If you set this option as apply, CAPTCHA will work for signup action, too. + If you set this option as apply, CAPTCHA will work for signup action, too. + If you set this option as apply, CAPTCHA will work for signup action, too. + + 적용하지 않음 + 不启用 + 적용하지 않음 + 關閉 + Not apply + Not apply + Không áp dụng + + + 적용 + 启用 + 적용 + 開啟 + Apply + Apply + Áp dụng + + + + diff --git a/addons/counter/conf/info.xml b/addons/counter/conf/info.xml index 7114c2380..cb60b24ba 100644 --- a/addons/counter/conf/info.xml +++ b/addons/counter/conf/info.xml @@ -1,62 +1,62 @@ - - - 기본 카운터 애드온 - アクセスカウンターアドオン - 网站访问统计 - Counter Addon - Counter Addon - Counter Addon - Addon contador básico - Аддон счетчика - 網站訪問統計 - - XE의 기본 카운터 모듈을 이용하여 접속 정보를 기록합니다. - 이 애드온을 켜셔야 접속 정보 수집이 됩니다. - - - XEのアクセスカウンターモジュールで接続(アクセス)情報を記録します。 - このアドオンを「使用」に設定してから、接続(アクセス)情報が記録されます。 - - - 利用XE的网站访问统计模块记录网站访问信息。 - 把状态设置为"使用"时,才会记录网站访问信息. - - - This addon logs access information based on the basic counter module within XE. - The access information will be collected only if you turn on this addon. - - - Addon này sẽ tổng hợp tất cả những lượt truy cập vào Website qua Module Counter có sẵn bên trong XE. - Thông tin truy nhập chỉ được tập hợp khi bạn bật Addon này.. - - - Dieses Addon-Logs Zugriff auf Informationen basiert auf den grundlegenden Zähler-Modul innerhalb XE. - Der Zugang zu Informationen wird nur erhoben, wenn Sie über dieses Addon. - - - Este addon contador básico de XE permite llevar la información de acceso a la página web de los visitantes. - Es necesario activar este addon para agregar la información de acceso. - - - Этот аддон пишет в лог информацию о доступе к сайту, основанную на базовом модуле счетчика в XE. - Для сбора информации необходимо включить этот аддон. - - - 使用XE的網站訪問統計模組記錄網站訪問資料。 - 將狀態設置成"使用"時,才會紀錄網站訪問資料。 - - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 기본 카운터 애드온 + アクセスカウンターアドオン + 网站访问统计 + Counter Addon + Counter Addon + Counter Addon + Addon contador básico + Аддон счетчика + 網站訪問統計 + + XE의 기본 카운터 모듈을 이용하여 접속 정보를 기록합니다. + 이 애드온을 켜셔야 접속 정보 수집이 됩니다. + + + XEのアクセスカウンターモジュールで接続(アクセス)情報を記録します。 + このアドオンを「使用」に設定してから、接続(アクセス)情報が記録されます。 + + + 利用XE的网站访问统计模块记录网站访问信息。 + 把状态设置为"使用"时,才会记录网站访问信息. + + + This addon logs access information based on the basic counter module within XE. + The access information will be collected only if you turn on this addon. + + + Addon này sẽ tổng hợp tất cả những lượt truy cập vào Website qua Module Counter có sẵn bên trong XE. + Thông tin truy nhập chỉ được tập hợp khi bạn bật Addon này.. + + + Dieses Addon-Logs Zugriff auf Informationen basiert auf den grundlegenden Zähler-Modul innerhalb XE. + Der Zugang zu Informationen wird nur erhoben, wenn Sie über dieses Addon. + + + Este addon contador básico de XE permite llevar la información de acceso a la página web de los visitantes. + Es necesario activar este addon para agregar la información de acceso. + + + Этот аддон пишет в лог информацию о доступе к сайту, основанную на базовом модуле счетчика в XE. + Для сбора информации необходимо включить этот аддон. + + + 使用XE的網站訪問統計模組記錄網站訪問資料。 + 將狀態設置成"使用"時,才會紀錄網站訪問資料。 + + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/addons/counter/counter.addon.php b/addons/counter/counter.addon.php index d46ad7b9e..c58bb8f98 100644 --- a/addons/counter/counter.addon.php +++ b/addons/counter/counter.addon.php @@ -1,14 +1,14 @@ -procCounterExecute(); - } -?> +procCounterExecute(); + } +?> diff --git a/addons/member_communication/conf/info.xml b/addons/member_communication/conf/info.xml index 25f3b7677..f58a13b1f 100644 --- a/addons/member_communication/conf/info.xml +++ b/addons/member_communication/conf/info.xml @@ -1,58 +1,58 @@ - - - 커뮤니케이션 - コミュニケーション - 会员交流 - Communication - Truyền thông - 커뮤니케이션 - 커뮤니케이션 - Общение - 交流 - - 커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. - 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다. - - - メッセージ・友達機能を使うにはこのアドオンを「使用」にして下さい。 - - - 此插件可激活短信箱及添加好友功能。 - - - This addon enables communication module in order to use message or friend function. - Please enable this addon in case you want to use those functions. - - - Addon này cho phép sử dụng Module truyền thông để sử dụng tin nhắn hay chức năng bạn bè. - Hãy kích hoạt nếu bạn muốn sử dụng chức năng này. - - - 커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. - 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다. - - - 커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. - 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다. - - - Активизирует модуль Общение, позволяет использование сообщений между друзьями. - - - 讓會員擁有短訊和新增好友功能。 - - 0.1 - 2008-05-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 커뮤니케이션 + コミュニケーション + 会员交流 + Communication + Truyền thông + 커뮤니케이션 + 커뮤니케이션 + Общение + 交流 + + 커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. + 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다. + + + メッセージ・友達機能を使うにはこのアドオンを「使用」にして下さい。 + + + 此插件可激活短信箱及添加好友功能。 + + + This addon enables communication module in order to use message or friend function. + Please enable this addon in case you want to use those functions. + + + Addon này cho phép sử dụng Module truyền thông để sử dụng tin nhắn hay chức năng bạn bè. + Hãy kích hoạt nếu bạn muốn sử dụng chức năng này. + + + 커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. + 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다. + + + 커뮤니케이션 모듈의 기능을 활성화 시켜 쪽지나 친구기능을 사용할 수 있도록 해줍니다. + 쪽지, 친구기능등을 사용하기 위해서는 이 애드온을 사용으로 해주시면 됩니다. + + + Активизирует модуль Общение, позволяет использование сообщений между друзьями. + + + 讓會員擁有短訊和新增好友功能。 + + 0.1 + 2008-05-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/addons/member_communication/lang/en.lang.php b/addons/member_communication/lang/en.lang.php index cc9cce249..9ad7af901 100644 --- a/addons/member_communication/lang/en.lang.php +++ b/addons/member_communication/lang/en.lang.php @@ -1,3 +1,3 @@ -alert_new_message_arrived = 'You have a new message. Do you want to check now?'; -?> +alert_new_message_arrived = 'You have a new message. Do you want to check now?'; +?> diff --git a/addons/member_communication/lang/es.lang.php b/addons/member_communication/lang/es.lang.php index 51933d3f8..904702d5b 100644 --- a/addons/member_communication/lang/es.lang.php +++ b/addons/member_communication/lang/es.lang.php @@ -1,3 +1,3 @@ -alert_new_message_arrived = 'Usted tiene un nuevo mensaje. Quiere comprobar ahora?'; -?> +alert_new_message_arrived = 'Usted tiene un nuevo mensaje. Quiere comprobar ahora?'; +?> diff --git a/addons/member_communication/lang/ge.lang.php b/addons/member_communication/lang/ge.lang.php index d9b9dcb81..73894f4d4 100644 --- a/addons/member_communication/lang/ge.lang.php +++ b/addons/member_communication/lang/ge.lang.php @@ -1,3 +1,3 @@ -alert_new_message_arrived = 'Sie haben eine neue Nachricht. Wollen Sie jetzt prüfen, ob?'; -?> +alert_new_message_arrived = 'Sie haben eine neue Nachricht. Wollen Sie jetzt prüfen, ob?'; +?> diff --git a/addons/member_communication/lang/ru.lang.php b/addons/member_communication/lang/ru.lang.php index 4e47c4c23..a12c72ade 100644 --- a/addons/member_communication/lang/ru.lang.php +++ b/addons/member_communication/lang/ru.lang.php @@ -1,9 +1,9 @@ -alert_new_message_arrived = 'У Вас новые сообщения. Проверите сейчас?'; -?> +alert_new_message_arrived = 'У Вас новые сообщения. Проверите сейчас?'; +?> diff --git a/addons/member_communication/lang/vi.lang.php b/addons/member_communication/lang/vi.lang.php index 4015a8be0..02a936361 100644 --- a/addons/member_communication/lang/vi.lang.php +++ b/addons/member_communication/lang/vi.lang.php @@ -1,11 +1,11 @@ -alert_new_message_arrived = 'Bạn có một tin nhắn mới. bạn có muốn kiểm tra ngay bây giờ không?'; -?> +alert_new_message_arrived = 'Bạn có một tin nhắn mới. bạn có muốn kiểm tra ngay bây giờ không?'; +?> diff --git a/addons/member_communication/member_communication.addon.php b/addons/member_communication/member_communication.addon.php index c34822a62..1222339e0 100644 --- a/addons/member_communication/member_communication.addon.php +++ b/addons/member_communication/member_communication.addon.php @@ -1,85 +1,85 @@ -module != 'member') { - - // 커뮤니케이션 모듈의 언어파일을 읽음 - Context::loadLang('./modules/communication/lang'); - - // 회원 로그인 정보중에서 쪽지등의 메뉴를 추가 - $oMemberController = &getController('member'); - $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend'); - $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box'); - - // 새로운 쪽지에 대한 플래그가 있으면 쪽지 보기 팝업 띄움 - $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); - - if(file_exists($flag_file)) { - $new_message_count = FileHandler::readFile($flag_file); - FileHandler::removeFile($flag_file); - Context::loadLang('./addons/member_communication/lang'); - - $script = sprintf('', sprintf(Context::getLang('alert_new_message_arrived'), $new_message_count), Context::getRequestUri().'?module=communication&act=dispCommunicationNewMessage'); - - Context::addHtmlHeader( $script ); - } - - /** - * 기능 수행 : 사용자 이름을 클릭시 요청되는 팝업메뉴의 메뉴에 쪽지 발송, 친구추가등의 링크 추가 - **/ - } elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') { - - $oMemberController = &getController('member'); - $member_srl = Context::get('target_srl'); - $mid = Context::get('cur_mid'); - - // communication 모델 객체 생성 - $oCommunicationModel = &getModel('communication'); - - // 자신이라면 쪽지함 보기 기능 추가 - if($logged_info->member_srl == $member_srl) { - - // 자신의 쪽지함 보기 기능 추가 - $oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationMessages'), 'cmd_view_message_box', './modules/communication/tpl/images/icon_message_box.gif', 'self'); - - // 친구 목록 보기 - $oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationFriend'), 'cmd_view_friend', './modules/communication/tpl/images/icon_friend_box.gif', 'self'); - - // 아니라면 쪽지 발송, 친구 등록 추가 - } else { - // 대상 회원의 정보를 가져옴 - $oMemberModel = &getModel('member'); - $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - if(!$target_member_info->member_srl) return; - - // 로그인된 사용자 정보를 구함 - $logged_info = Context::get('logged_info'); - - // 쪽지 발송 메뉴를 만듬 - 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'); - - // 친구 등록 메뉴를 만듬 (이미 등록된 친구가 아닐 경우) - 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'); - } - } -?> +module != 'member') { + + // 커뮤니케이션 모듈의 언어파일을 읽음 + Context::loadLang('./modules/communication/lang'); + + // 회원 로그인 정보중에서 쪽지등의 메뉴를 추가 + $oMemberController = &getController('member'); + $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend'); + $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box'); + + // 새로운 쪽지에 대한 플래그가 있으면 쪽지 보기 팝업 띄움 + $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); + + if(file_exists($flag_file)) { + $new_message_count = FileHandler::readFile($flag_file); + FileHandler::removeFile($flag_file); + Context::loadLang('./addons/member_communication/lang'); + + $script = sprintf('', sprintf(Context::getLang('alert_new_message_arrived'), $new_message_count), Context::getRequestUri().'?module=communication&act=dispCommunicationNewMessage'); + + Context::addHtmlHeader( $script ); + } + + /** + * 기능 수행 : 사용자 이름을 클릭시 요청되는 팝업메뉴의 메뉴에 쪽지 발송, 친구추가등의 링크 추가 + **/ + } elseif($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') { + + $oMemberController = &getController('member'); + $member_srl = Context::get('target_srl'); + $mid = Context::get('cur_mid'); + + // communication 모델 객체 생성 + $oCommunicationModel = &getModel('communication'); + + // 자신이라면 쪽지함 보기 기능 추가 + if($logged_info->member_srl == $member_srl) { + + // 자신의 쪽지함 보기 기능 추가 + $oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationMessages'), 'cmd_view_message_box', './modules/communication/tpl/images/icon_message_box.gif', 'self'); + + // 친구 목록 보기 + $oMemberController->addMemberPopupMenu(getUrl('','mid',$mid,'act','dispCommunicationFriend'), 'cmd_view_friend', './modules/communication/tpl/images/icon_friend_box.gif', 'self'); + + // 아니라면 쪽지 발송, 친구 등록 추가 + } else { + // 대상 회원의 정보를 가져옴 + $oMemberModel = &getModel('member'); + $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + if(!$target_member_info->member_srl) return; + + // 로그인된 사용자 정보를 구함 + $logged_info = Context::get('logged_info'); + + // 쪽지 발송 메뉴를 만듬 + 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'); + + // 친구 등록 메뉴를 만듬 (이미 등록된 친구가 아닐 경우) + 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/conf/info.xml b/addons/member_extra_info/conf/info.xml index 9a82ec315..f75c6d929 100644 --- a/addons/member_extra_info/conf/info.xml +++ b/addons/member_extra_info/conf/info.xml @@ -1,53 +1,53 @@ - - - 회원 확장 정보 출력 - 会員情報拡張表示 - 用户扩展信息 - Extra Member Info - Bổ xung thông tin thành viên - 회원 확장 정보 출력 - 회원 확장 정보 출력 - Экстраинформация о пользователях - 用戶延伸資料 - - 회원이 등록한 이미지이름, 이미지마크를 사용하기 위해서는 이 애드온을 활성화 시키세요. - - - 会員が登録したイメージニックネーム、イメージマークを使うためにはこのアドオンをオンにして下さい。 - - - 此插件将把用户信息中的昵称图片,用户图标,签名等信息显示到页面当中。 - - - This addon displays a member's image name, image mark. - - - Addon này sẽ hiển thị hình ảnh thay thế tên và hình đánh dấu của thành viên. - - - This addon displays a member's image name, image mark. - - - This addon displays a member's image name, image mark. - - - Аддон изображает имя, марку картинки пользователя. - - - 可將用戶資料中的暱稱圖片、用戶圖示、簽名檔等資料顯示到頁面當中。 - - 0.2 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 회원 확장 정보 출력 + 会員情報拡張表示 + 用户扩展信息 + Extra Member Info + Bổ xung thông tin thành viên + 회원 확장 정보 출력 + 회원 확장 정보 출력 + Экстраинформация о пользователях + 用戶延伸資料 + + 회원이 등록한 이미지이름, 이미지마크를 사용하기 위해서는 이 애드온을 활성화 시키세요. + + + 会員が登録したイメージニックネーム、イメージマークを使うためにはこのアドオンをオンにして下さい。 + + + 此插件将把用户信息中的昵称图片,用户图标,签名等信息显示到页面当中。 + + + This addon displays a member's image name, image mark. + + + Addon này sẽ hiển thị hình ảnh thay thế tên và hình đánh dấu của thành viên. + + + This addon displays a member's image name, image mark. + + + This addon displays a member's image name, image mark. + + + Аддон изображает имя, марку картинки пользователя. + + + 可將用戶資料中的暱稱圖片、用戶圖示、簽名檔等資料顯示到頁面當中。 + + 0.2 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/addons/member_extra_info/member_extra_info.addon.php b/addons/member_extra_info/member_extra_info.addon.php index 585cc3f86..9dfcb9b16 100644 --- a/addons/member_extra_info/member_extra_info.addon.php +++ b/addons/member_extra_info/member_extra_info.addon.php @@ -1,23 +1,23 @@ -.... 로 정의가 된 부분을 찾아 회원번호를 구해서 - * 이미지이름, 이미지마크가 있는지를 확인하여 있으면 내용을 변경해버립니다. - **/ - - /** - * 출력되기 바로 직전일 경우에 이미지이름/이미지마크등을 변경 - **/ - if($called_position != "before_display_content" || Context::get('act')=='dispPageAdminContentModify') return; - - // 회원 이미지이름/ 마크/ 찾아서 대체할 함수를 담고 있는 파일을 include - require_once('./addons/member_extra_info/member_extra_info.lib.php'); - - // 1. 출력문서중에서
content
를 찾아 MemberController::transImageName() 를 이용하여 이미지이름/마크로 변경 - $output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'memberTransImageName', $output); -?> +.... 로 정의가 된 부분을 찾아 회원번호를 구해서 + * 이미지이름, 이미지마크가 있는지를 확인하여 있으면 내용을 변경해버립니다. + **/ + + /** + * 출력되기 바로 직전일 경우에 이미지이름/이미지마크등을 변경 + **/ + if($called_position != "before_display_content" || Context::get('act')=='dispPageAdminContentModify') return; + + // 회원 이미지이름/ 마크/ 찾아서 대체할 함수를 담고 있는 파일을 include + require_once('./addons/member_extra_info/member_extra_info.lib.php'); + + // 1. 출력문서중에서
content
를 찾아 MemberController::transImageName() 를 이용하여 이미지이름/마크로 변경 + $output = preg_replace_callback('!<(div|span|a)([^\>]*)member_([0-9]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'memberTransImageName', $output); +?> diff --git a/addons/mobile/classes/hdml.class.php b/addons/mobile/classes/hdml.class.php index 1c3ee4262..bb20afef1 100644 --- a/addons/mobile/classes/hdml.class.php +++ b/addons/mobile/classes/hdml.class.php @@ -1,103 +1,103 @@ -charset); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - - print ''; - print "\n"; - print $this->hasChilds()?'':''; - print "\n"; - - if($this->upperUrl) { - $url = $this->upperUrl; - printf('%s', $url->url, $url->text, "\n"); - } - } - - /** - * @brief 제목을 출력 - **/ - function printTitle() { - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); - printf('<%s%s>%s', $this->title,$titlePageStr,"\n"); - } - - /** - * @brief 내용을 출력 - * hasChilds()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력 - **/ - function printContent() { - if($this->hasChilds()) { - foreach($this->getChilds() as $key => $val) { - if(!$val['link']) continue; - printf('%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n"); - } - } else { - printf('%s
%s', $this->getContent(),"\n"); - } - } - - /** - * @brief 버튼을 출력함 - **/ - function printBtn() { - // 메뉴 형식 - if($this->hasChilds()) { - if($this->nextUrl) { - $url = $this->nextUrl; - printf('%s%s', $url->text, $url->url, $url->text, "\n"); - } - if($this->prevUrl) { - $url = $this->prevUrl; - printf('%s%s', $url->text, $url->url, $url->text, "\n"); - } - if($this->homeUrl) { - $url = $this->homeUrl; - printf('%s%s', $url->text, $url->url, $url->text, "\n"); - } - // 컨텐츠 형식 - } else { - if($this->nextUrl) { - $url = $this->nextUrl; - printf('%s', $url->text, $url->url, $url->text); - } - if($this->prevUrl) { - $url = $this->prevUrl; - printf('%s', $url->text, $url->url, $url->text); - } - if($this->homeUrl) { - $url = $this->homeUrl; - printf('%s', $url->text, $url->url, $url->text); - } - } - } - - /** - * @brief 푸터 정보를 출력 - **/ - function printFooter() { - print $this->hasChilds()?'
':''; - print "\n"; - print("
"); - } - - } -?> +charset); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + + print ''; + print "\n"; + print $this->hasChilds()?'':''; + print "\n"; + + if($this->upperUrl) { + $url = $this->upperUrl; + printf('%s', $url->url, $url->text, "\n"); + } + } + + /** + * @brief 제목을 출력 + **/ + function printTitle() { + if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); + printf('<%s%s>%s', $this->title,$titlePageStr,"\n"); + } + + /** + * @brief 내용을 출력 + * hasChilds()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력 + **/ + function printContent() { + if($this->hasChilds()) { + foreach($this->getChilds() as $key => $val) { + if(!$val['link']) continue; + printf('%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n"); + } + } else { + printf('%s
%s', $this->getContent(),"\n"); + } + } + + /** + * @brief 버튼을 출력함 + **/ + function printBtn() { + // 메뉴 형식 + if($this->hasChilds()) { + if($this->nextUrl) { + $url = $this->nextUrl; + printf('%s%s', $url->text, $url->url, $url->text, "\n"); + } + if($this->prevUrl) { + $url = $this->prevUrl; + printf('%s%s', $url->text, $url->url, $url->text, "\n"); + } + if($this->homeUrl) { + $url = $this->homeUrl; + printf('%s%s', $url->text, $url->url, $url->text, "\n"); + } + // 컨텐츠 형식 + } else { + if($this->nextUrl) { + $url = $this->nextUrl; + printf('%s', $url->text, $url->url, $url->text); + } + if($this->prevUrl) { + $url = $this->prevUrl; + printf('%s', $url->text, $url->url, $url->text); + } + if($this->homeUrl) { + $url = $this->homeUrl; + printf('%s', $url->text, $url->url, $url->text); + } + } + } + + /** + * @brief 푸터 정보를 출력 + **/ + function printFooter() { + print $this->hasChilds()?'
':''; + print "\n"; + print("
"); + } + + } +?> diff --git a/addons/mobile/classes/mhtml.class.php b/addons/mobile/classes/mhtml.class.php index 5b1b55ce6..32626e155 100644 --- a/addons/mobile/classes/mhtml.class.php +++ b/addons/mobile/classes/mhtml.class.php @@ -1,82 +1,82 @@ -\n"); - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); - printf("%s%s\n", htmlspecialchars($this->title),htmlspecialchars($titlePageStr)); - } - - // 제목을 출력 - 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()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력 - **/ - function printContent() { - if($this->hasChilds()) { - foreach($this->getChilds() as $key => $val) { - if(!$val['link']) continue; - printf('%s
%s', $val['href'], $this->getNo(), $val['text'], "\n"); - if($val['extra']) printf("
%s\n",str_replace('
','
',$val['extra'])); - } - } else { - print(str_replace('
','
',$this->getContent())."\n"); - } - print "

"; - } - - /** - * @brief 버튼을 출력함 - **/ - function printBtn() { - if($this->nextUrl) { - $url = $this->nextUrl; - printf('%s
%s', $url->url, $url->text, "\n"); - } - if($this->prevUrl) { - $url = $this->prevUrl; - printf('%s
%s', $url->url, $url->text, "\n"); - } - // 언어선택 - 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"); - } - else { - printf('%s
%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n"); - } - if($this->upperUrl) { - $url = $this->upperUrl; - printf('%s', $url->url, $url->text, "\n"); - } - if($this->homeUrl) { - $url = $this->homeUrl; - printf('%s
%s', $url->text, $url->url, $url->text, "\n"); - } - } - - // 푸터 정보를 출력 - function printFooter() { - print("\n"); - } - } -?> +\n"); + if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); + printf("%s%s\n", htmlspecialchars($this->title),htmlspecialchars($titlePageStr)); + } + + // 제목을 출력 + 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()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력 + **/ + function printContent() { + if($this->hasChilds()) { + foreach($this->getChilds() as $key => $val) { + if(!$val['link']) continue; + printf('%s
%s', $val['href'], $this->getNo(), $val['text'], "\n"); + if($val['extra']) printf("
%s\n",str_replace('
','
',$val['extra'])); + } + } else { + print(str_replace('
','
',$this->getContent())."\n"); + } + print "

"; + } + + /** + * @brief 버튼을 출력함 + **/ + function printBtn() { + if($this->nextUrl) { + $url = $this->nextUrl; + printf('%s
%s', $url->url, $url->text, "\n"); + } + if($this->prevUrl) { + $url = $this->prevUrl; + printf('%s
%s', $url->url, $url->text, "\n"); + } + // 언어선택 + 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"); + } + else { + printf('%s
%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n"); + } + if($this->upperUrl) { + $url = $this->upperUrl; + printf('%s', $url->url, $url->text, "\n"); + } + if($this->homeUrl) { + $url = $this->homeUrl; + printf('%s
%s', $url->text, $url->url, $url->text, "\n"); + } + } + + // 푸터 정보를 출력 + function printFooter() { + print("\n"); + } + } +?> diff --git a/addons/mobile/classes/mobile.class.php b/addons/mobile/classes/mobile.class.php index e6f7f6435..5fb4a843a 100644 --- a/addons/mobile/classes/mobile.class.php +++ b/addons/mobile/classes/mobile.class.php @@ -1,598 +1,598 @@ -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'); - $this->lang = str_replace(array(''),array('',''),$this->lang); - if(isset($lang_supported[$this->lang])) Context::setLangType($this->lang); - } - Context::loadLang(_XE_PATH_.'addons/mobile/lang'); - - $instance = new wap(); - - $mobilePage = (int)Context::get('mpage'); - if(!$mobilePage) $mobilePage = 1; - - $instance->setMobilePage($mobilePage); - - } - - return $instance; - } - - /** - * @brief constructor - **/ - function mobileXE() { - // navigation mode 체크 - if(Context::get('nm')) { - $this->navigationMode = 1; - $this->cmid = (int)Context::get('cmid'); - } - - if(Context::get('lcm')) { - $this->languageMode = 1; - $this->lang = Context::get('sel_lang'); - } - } - - /** - * @brief navigation mode 체크 - * navigationMode 세팅과 모듈 정보의 menu_srl이 있어야 navigation mode = true로 return - **/ - function isNavigationMode() { - return ($this->navigationMode && $this->module_info->menu_srl)?true:false; - } - - /** - * @brief langchange mode 체크 - * languageMode 세팅 있어야 true return - **/ - function isLangChange() { - if($this->languageMode) return true; - else return false; - } - - /** - * @brief 언어 설정 - * 쿠키가 안되기 때문에 휴대전화마다 고유한 파일로 언어설정을 저장하는 파일 생성 - **/ - function setLangType() { - $lang_supported = Context::get('lang_supported'); - // 언어 변수가 있는지 확인하고 변수가 유효한지 확인 - 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'); - $langbuff = 'lang.'**/ ?>'; - FileHandler::writeFile('./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',$langbuff); - } - } - - /** - * @brief 현재 요청된 모듈 정보 세팅 - **/ - function setModuleInfo(&$module_info) { - if($this->module_info) return; - $this->module_info = $module_info; - } - - /** - * @brief 현재 실행중인 모듈 instance 세팅 - **/ - function setModuleInstance(&$oModule) { - if($this->oModule) return; - - // instance 저장 - $this->oModule = $oModule; - - // 현재 모듈의 메뉴가 설정되어 있으면 메뉴 정리 - $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차원으로 변경 - $this->getListedItems($menu->list, $listed_items, $node_list); - - $this->listed_items = $listed_items; - $this->node_list = $node_list; - $this->menu = $menu->list; - - $k = array_keys($node_list); - $v = array_values($node_list); - $this->index_mid = $k[0]; - - // 현재 메뉴의 depth가 1이상이면 상위 버튼을 지정 - $cur_menu_item = $listed_items[$node_list[$this->module_info->mid]]; - if($cur_menu_item['parent_srl']) { - $parent_srl = $cur_menu_item['parent_srl']; - if($parent_srl && $listed_items[$parent_srl]) { - $parent_item = $listed_items[$parent_srl]; - if($parent_item) $this->setUpperUrl(getUrl('','mid',$parent_item['mid']), Context::getLang('cmd_go_upper')); - } - } elseif (!$this->isNavigationMode()) { - $this->setUpperUrl(getUrl('','mid',$this->index_mid,'nm','1','cmid',0), Context::getLang('cmd_view_sitemap')); - } - } - - /** - * @brief 접속 브라우저의 헤더를 판단하여 브라우저 타입을 return - * 모바일 브라우저가 아닐 경우 null return - **/ - function getBrowserType() { - if(Context::get('smartphone')) return null; - // 브라우저 타입을 판별 - $browserAccept = $_SERVER['HTTP_ACCEPT']; - $userAgent = $_SERVER['HTTP_USER_AGENT']; - $wap_sid = $_SERVER['HTTP_X_UP_SUBNO']; - - if(eregi("SKT11", $userAgent) || eregi("skt", $browserAccept)) { - Context::set('mobile_skt',1); - return "wml"; - } - elseif(eregi("hdml", $browserAccept)) return "hdml"; - elseif(eregi("CellPhone", $userAgent)) return "mhtml"; - return null; - } - - /** - * @brief charset 지정 - **/ - function setCharSet($charset = 'UTF-8') { - if(!$charset) $charset = 'UTF-8'; - - //SKT는 euc-kr만 지원 - if(Context::get('mobile_skt')==1) $charset = 'euc-kr'; - - $this->charset = $charset; - } - - /** - * @brief 모바일 기기의 용량 제한에 다른 가상 페이지 지정 - **/ - function setMobilePage($page=1) { - if(!$page) $page = 1; - $this->mobilePage = $page; - } - - /** - * @brief 목록형 데이터 설정을 위한 child menu지정 - **/ - function setChilds($childs) { - // menu개수가 9개 이상일 경우 자체 페이징 처리 - $menu_count = count($childs); - if($menu_count>9) { - $startNum = ($this->mobilePage-1)*9; - $idx = 0; - $new_childs = array(); - foreach($childs as $k => $v) { - if($idx >= $startNum && $idx < $startNum+9) { - $new_childs[$k] = $v; - } - $idx ++; - } - $childs = $new_childs; - - $this->totalPage = (int)(($menu_count-1)/9)+1; - - // next/prevUrl 지정 - 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); - $this->setPrevUrl($url, $text); - } - - if($this->mobilePage<$this->totalPage) { - $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage+1); - $text = sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $this->mobilePage+1, $this->totalPage); - $this->setNextUrl($url, $text); - } - } - $this->childs = $childs; - } - - /** - * @brief menu 출력대상이 있는지 확인 - **/ - function hasChilds() { - return count($this->childs)?true:0; - } - - /** - * @brief child menu반환 - **/ - function getChilds() { - return $this->childs; - } - - /** - * @brief title 지정 - **/ - function setTitle($title) { - $oModuleController = &getController('module'); - $this->title = $title; - $oModuleController->replaceDefinedLangCode($this->title); - } - - /** - * @brief title 반환 - **/ - function getTitle() { - return $this->title; - } - - /** - * @brief 컨텐츠 정리 - * HTML 컨텐츠에서 텍스트와 링크만 추출하는 기능 - **/ - function setContent($content) { - $oModuleController = &getController('module'); - $allow_tag_array = array('','
','

','','','','','','','','','','
'); - - - // 링크/ 줄바꿈, 강조만 제외하고 모든 태그 제거 - $content = strip_tags($content, implode($allow_tag_array)); - - // 탭 여백 제거 - $content = str_replace("\t", "", $content); - - // 2번 이상 반복되는 공백과 줄나눔을 제거 - $content = preg_replace('/( ){2,}/s', '', $content); - $content = preg_replace("/([\r\n]+)/s", "\r\n", $content); - $content = preg_replace(array("/","
"), array("
","
"), $content); - - while(strpos($content, '

')) { - $content = str_replace('

','
',$content); - } - - // 모바일의 경우 한 덱에 필요한 사이즈가 적어서 내용을 모두 페이지로 나눔 - $contents = array(); - while($content) { - $tmp = $this->cutStr($content, $this->deckSize, ''); - $contents[] = $tmp; - $content = substr($content, strlen($tmp)); - - //$content = str_replace(array('&','<','>','"','&nbsp;'), array('&','<','>','"',' '), $content); - - foreach($allow_tag_array as $tag) { - if($tag == '
') continue; - $tag_open_pos = strpos($content, str_replace('>','',$tag)); - $tag_close_pos = strpos($content, str_replace('<','totalPage = count($contents); - - // next/prevUrl 지정 - 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); - $this->setPrevUrl($url, $text); - } - - if($this->mobilePage<$this->totalPage) { - $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage+1); - $text = sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $this->mobilePage+1, $this->totalPage); - $this->setNextUrl($url, $text); - } - - $this->content = $contents[$this->mobilePage-1]; - $oModuleController->replaceDefinedLangCode($this->content); - $content = str_replace(array('$','\''), array('$$','''), $content); - } - - /** - * @brief byte수로 자르는 함수 - **/ - function cutStr($string, $cut_size) { - return preg_match('/.{'.$cut_size.'}/su', $string, $arr) ? $arr[0] : $string; - } - - /** - * @brief 컨텐츠 반환 - **/ - function getContent() { - return $this->content; - } - - /** - * @brief home url 지정 - **/ - function setHomeUrl($url, $text) { - if(!$url) $url = '#'; - $this->homeUrl->url = $url; - $this->homeUrl->text = $text; - } - - /** - * @brief upper url 지정 - **/ - function setUpperUrl($url, $text) { - if(!$url) $url = '#'; - $this->upperUrl->url = $url; - $this->upperUrl->text = $text; - } - - /** - * @brief prev url 지정 - **/ - function setPrevUrl($url, $text) { - if(!$url) $url = '#'; - $this->prevUrl->url = $url; - $this->prevUrl->text = $text; - } - - /** - * @brief next url 지정 - **/ - function setNextUrl($url, $text) { - if(!$url) $url = '#'; - $this->nextUrl->url = $url; - $this->nextUrl->text = $text; - } - - /** - * @brief 다음, 이전, 상위 이외에 기타 버튼 지정 - **/ - function setEtcBtn($url, $text) { - if(!$url) $url = '#'; - $etc['url'] = $url; - $etc['text'] = htmlspecialchars($text); - $this->etcBtn[] = $etc; - } - - /** - * @brief display - **/ - function display() { - // 홈버튼 지정 - $this->setHomeUrl(getUrl(), Context::getLang('cmd_go_home')); - - // 제목 지정 - if(!$this->title) $this->setTitle(Context::getBrowserTitle()); - - ob_start(); - - // 헤더를 출력 - $this->printHeader(); - - // 제목을 출력 - $this->printTitle(); - - // 내용 출력 - $this->printContent(); - - // 버튼 출력 - $this->printBtn(); - - // 푸터를 출력 - $this->printFooter(); - - $content = ob_get_clean(); - - // 변환 후 출력 - if(strtolower($this->charset) == 'utf-8') print $content; - else print iconv('UTF-8',$this->charset."//TRANSLIT//IGNORE", $content); - - exit(); - } - - /** - * @brief 페이지 이동 - **/ - function movepage($url) { - header("location:$url"); - exit(); - } - - /** - * @brief 목록등에서 일련 번호를 리턴한다 - **/ - function getNo() { - $this->no++; - $str = $this->no; - return $str; - } - - /** - * @brief XE의 Menu 모듈이 값을 사용하기 쉽게 정리해주는 함수 - **/ - function getListedItems($menu, &$listed_items, &$node_list) { - if(!count($menu)) return; - foreach($menu as $node_srl => $item) { - if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $item['url'])) { - $mid = $item['mid'] = $item['url']; - $node_list[$mid] = $node_srl; - } else { - $mid = $item['mid'] = null; - } - - $listed_items[$node_srl] = $item; - $this->getListedItems($item['list'], $listed_items, $node_list); - } - } - - /** - * @brief XE 네비게이션 출력 - **/ - function displayNavigationContent() { - $childs = array(); - - if($this->cmid) { - $cur_item = $this->listed_items[$this->cmid]; - $upper_srl = $cur_item['parent_srl'];; - $list = $cur_item['list'];; - $this->setUpperUrl(getUrl('cmid',$upper_srl), Context::getLang('cmd_go_upper')); - if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $cur_item['url'])) { - $obj = null; - $obj['href'] = getUrl('','mid',$cur_item['url']); - $obj['link'] = $obj['text'] = '['.$cur_item['text'].']'; - $childs[] = $obj; - } - - } else { - $list = $this->menu; - $upper_srl = 0; - } - - - if(count($list)) { - foreach($list as $key => $val) { - if(!$val['text']) continue; - $obj = null; - if(!count($val['list'])) { - $obj['href'] = getUrl('','mid',$val['url']); - } else { - $obj['href'] = getUrl('cmid',$val['node_srl']); - } - $obj['link'] = $obj['text'] = $val['text']; - $childs[] = $obj; - } - $this->setChilds($childs); - } - - // 출력 - $this->display(); - } - - /** - * @brief 언어설정 메뉴 출력 - **/ - function displayLangSelect() { - $childs = array(); - - $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) { - $this->lang = str_replace(array(''),array('',''),$this->lang); - Context::setLangType($this->lang); - } - $lang_supported = Context::get('lang_supported'); - $lang_type = Context::getLangType(); - $obj = null; - $obj['link'] = $obj['text'] = Context::getLang('president_lang').' : '.$lang_supported[$lang_type]; - $obj['href'] = getUrl('sel_lang',$lang_type); - $childs[] = $obj; - - if(is_array($lang_supported)) { - foreach($lang_supported as $key => $val) { - $obj = null; - $obj['link'] = $obj['text'] = $val; - $obj['href'] = getUrl('sel_lang',$key); - $childs[] = $obj; - } - } - - $this->setChilds($childs); - - $this->display(); - } - - /** - * @brief 모듈의 WAP 클래스 객체 생성하여 WAP 준비 - **/ - function displayModuleContent() { - // 선택된 모듈의 WAP class 객체 생성 - $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; - - // 실행 - $oModule->procWAP($this); - - // 출력 - $this->display(); - } - - /** - * @brief WAP 컨텐츠를 별도로 구할 수 없으면 최종 결과물을 출력 - **/ - function displayContent() { - Context::set('layout','none'); - - // 템플릿 컴파일 - $oTemplate = new TemplateHandler(); - $oContext = &Context::getInstance(); - - $content = $oTemplate->compile($this->oModule->getTemplatePath(), $this->oModule->getTemplateFile()); - $this->setContent($content); - - // 출력 - $this->display(); - } - } -?> +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'); + $this->lang = str_replace(array(''),array('',''),$this->lang); + if(isset($lang_supported[$this->lang])) Context::setLangType($this->lang); + } + Context::loadLang(_XE_PATH_.'addons/mobile/lang'); + + $instance = new wap(); + + $mobilePage = (int)Context::get('mpage'); + if(!$mobilePage) $mobilePage = 1; + + $instance->setMobilePage($mobilePage); + + } + + return $instance; + } + + /** + * @brief constructor + **/ + function mobileXE() { + // navigation mode 체크 + if(Context::get('nm')) { + $this->navigationMode = 1; + $this->cmid = (int)Context::get('cmid'); + } + + if(Context::get('lcm')) { + $this->languageMode = 1; + $this->lang = Context::get('sel_lang'); + } + } + + /** + * @brief navigation mode 체크 + * navigationMode 세팅과 모듈 정보의 menu_srl이 있어야 navigation mode = true로 return + **/ + function isNavigationMode() { + return ($this->navigationMode && $this->module_info->menu_srl)?true:false; + } + + /** + * @brief langchange mode 체크 + * languageMode 세팅 있어야 true return + **/ + function isLangChange() { + if($this->languageMode) return true; + else return false; + } + + /** + * @brief 언어 설정 + * 쿠키가 안되기 때문에 휴대전화마다 고유한 파일로 언어설정을 저장하는 파일 생성 + **/ + function setLangType() { + $lang_supported = Context::get('lang_supported'); + // 언어 변수가 있는지 확인하고 변수가 유효한지 확인 + 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'); + $langbuff = 'lang.'**/ ?>'; + FileHandler::writeFile('./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',$langbuff); + } + } + + /** + * @brief 현재 요청된 모듈 정보 세팅 + **/ + function setModuleInfo(&$module_info) { + if($this->module_info) return; + $this->module_info = $module_info; + } + + /** + * @brief 현재 실행중인 모듈 instance 세팅 + **/ + function setModuleInstance(&$oModule) { + if($this->oModule) return; + + // instance 저장 + $this->oModule = $oModule; + + // 현재 모듈의 메뉴가 설정되어 있으면 메뉴 정리 + $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차원으로 변경 + $this->getListedItems($menu->list, $listed_items, $node_list); + + $this->listed_items = $listed_items; + $this->node_list = $node_list; + $this->menu = $menu->list; + + $k = array_keys($node_list); + $v = array_values($node_list); + $this->index_mid = $k[0]; + + // 현재 메뉴의 depth가 1이상이면 상위 버튼을 지정 + $cur_menu_item = $listed_items[$node_list[$this->module_info->mid]]; + if($cur_menu_item['parent_srl']) { + $parent_srl = $cur_menu_item['parent_srl']; + if($parent_srl && $listed_items[$parent_srl]) { + $parent_item = $listed_items[$parent_srl]; + if($parent_item) $this->setUpperUrl(getUrl('','mid',$parent_item['mid']), Context::getLang('cmd_go_upper')); + } + } elseif (!$this->isNavigationMode()) { + $this->setUpperUrl(getUrl('','mid',$this->index_mid,'nm','1','cmid',0), Context::getLang('cmd_view_sitemap')); + } + } + + /** + * @brief 접속 브라우저의 헤더를 판단하여 브라우저 타입을 return + * 모바일 브라우저가 아닐 경우 null return + **/ + function getBrowserType() { + if(Context::get('smartphone')) return null; + // 브라우저 타입을 판별 + $browserAccept = $_SERVER['HTTP_ACCEPT']; + $userAgent = $_SERVER['HTTP_USER_AGENT']; + $wap_sid = $_SERVER['HTTP_X_UP_SUBNO']; + + if(eregi("SKT11", $userAgent) || eregi("skt", $browserAccept)) { + Context::set('mobile_skt',1); + return "wml"; + } + elseif(eregi("hdml", $browserAccept)) return "hdml"; + elseif(eregi("CellPhone", $userAgent)) return "mhtml"; + return null; + } + + /** + * @brief charset 지정 + **/ + function setCharSet($charset = 'UTF-8') { + if(!$charset) $charset = 'UTF-8'; + + //SKT는 euc-kr만 지원 + if(Context::get('mobile_skt')==1) $charset = 'euc-kr'; + + $this->charset = $charset; + } + + /** + * @brief 모바일 기기의 용량 제한에 다른 가상 페이지 지정 + **/ + function setMobilePage($page=1) { + if(!$page) $page = 1; + $this->mobilePage = $page; + } + + /** + * @brief 목록형 데이터 설정을 위한 child menu지정 + **/ + function setChilds($childs) { + // menu개수가 9개 이상일 경우 자체 페이징 처리 + $menu_count = count($childs); + if($menu_count>9) { + $startNum = ($this->mobilePage-1)*9; + $idx = 0; + $new_childs = array(); + foreach($childs as $k => $v) { + if($idx >= $startNum && $idx < $startNum+9) { + $new_childs[$k] = $v; + } + $idx ++; + } + $childs = $new_childs; + + $this->totalPage = (int)(($menu_count-1)/9)+1; + + // next/prevUrl 지정 + 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); + $this->setPrevUrl($url, $text); + } + + if($this->mobilePage<$this->totalPage) { + $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage+1); + $text = sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $this->mobilePage+1, $this->totalPage); + $this->setNextUrl($url, $text); + } + } + $this->childs = $childs; + } + + /** + * @brief menu 출력대상이 있는지 확인 + **/ + function hasChilds() { + return count($this->childs)?true:0; + } + + /** + * @brief child menu반환 + **/ + function getChilds() { + return $this->childs; + } + + /** + * @brief title 지정 + **/ + function setTitle($title) { + $oModuleController = &getController('module'); + $this->title = $title; + $oModuleController->replaceDefinedLangCode($this->title); + } + + /** + * @brief title 반환 + **/ + function getTitle() { + return $this->title; + } + + /** + * @brief 컨텐츠 정리 + * HTML 컨텐츠에서 텍스트와 링크만 추출하는 기능 + **/ + function setContent($content) { + $oModuleController = &getController('module'); + $allow_tag_array = array('
','
','

','','','','','','','','','','"; - }else{ - if($.browser.firefox){ - sTD = ""; - }else{ - sTD = ""; - } - } - - var sTable = '
'); + + + // 링크/ 줄바꿈, 강조만 제외하고 모든 태그 제거 + $content = strip_tags($content, implode($allow_tag_array)); + + // 탭 여백 제거 + $content = str_replace("\t", "", $content); + + // 2번 이상 반복되는 공백과 줄나눔을 제거 + $content = preg_replace('/( ){2,}/s', '', $content); + $content = preg_replace("/([\r\n]+)/s", "\r\n", $content); + $content = preg_replace(array("/","
"), array("
","
"), $content); + + while(strpos($content, '

')) { + $content = str_replace('

','
',$content); + } + + // 모바일의 경우 한 덱에 필요한 사이즈가 적어서 내용을 모두 페이지로 나눔 + $contents = array(); + while($content) { + $tmp = $this->cutStr($content, $this->deckSize, ''); + $contents[] = $tmp; + $content = substr($content, strlen($tmp)); + + //$content = str_replace(array('&','<','>','"','&nbsp;'), array('&','<','>','"',' '), $content); + + foreach($allow_tag_array as $tag) { + if($tag == '
') continue; + $tag_open_pos = strpos($content, str_replace('>','',$tag)); + $tag_close_pos = strpos($content, str_replace('<','totalPage = count($contents); + + // next/prevUrl 지정 + 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); + $this->setPrevUrl($url, $text); + } + + if($this->mobilePage<$this->totalPage) { + $url = getUrl('mid',$_GET['mid'],'mpage',$this->mobilePage+1); + $text = sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $this->mobilePage+1, $this->totalPage); + $this->setNextUrl($url, $text); + } + + $this->content = $contents[$this->mobilePage-1]; + $oModuleController->replaceDefinedLangCode($this->content); + $content = str_replace(array('$','\''), array('$$','''), $content); + } + + /** + * @brief byte수로 자르는 함수 + **/ + function cutStr($string, $cut_size) { + return preg_match('/.{'.$cut_size.'}/su', $string, $arr) ? $arr[0] : $string; + } + + /** + * @brief 컨텐츠 반환 + **/ + function getContent() { + return $this->content; + } + + /** + * @brief home url 지정 + **/ + function setHomeUrl($url, $text) { + if(!$url) $url = '#'; + $this->homeUrl->url = $url; + $this->homeUrl->text = $text; + } + + /** + * @brief upper url 지정 + **/ + function setUpperUrl($url, $text) { + if(!$url) $url = '#'; + $this->upperUrl->url = $url; + $this->upperUrl->text = $text; + } + + /** + * @brief prev url 지정 + **/ + function setPrevUrl($url, $text) { + if(!$url) $url = '#'; + $this->prevUrl->url = $url; + $this->prevUrl->text = $text; + } + + /** + * @brief next url 지정 + **/ + function setNextUrl($url, $text) { + if(!$url) $url = '#'; + $this->nextUrl->url = $url; + $this->nextUrl->text = $text; + } + + /** + * @brief 다음, 이전, 상위 이외에 기타 버튼 지정 + **/ + function setEtcBtn($url, $text) { + if(!$url) $url = '#'; + $etc['url'] = $url; + $etc['text'] = htmlspecialchars($text); + $this->etcBtn[] = $etc; + } + + /** + * @brief display + **/ + function display() { + // 홈버튼 지정 + $this->setHomeUrl(getUrl(), Context::getLang('cmd_go_home')); + + // 제목 지정 + if(!$this->title) $this->setTitle(Context::getBrowserTitle()); + + ob_start(); + + // 헤더를 출력 + $this->printHeader(); + + // 제목을 출력 + $this->printTitle(); + + // 내용 출력 + $this->printContent(); + + // 버튼 출력 + $this->printBtn(); + + // 푸터를 출력 + $this->printFooter(); + + $content = ob_get_clean(); + + // 변환 후 출력 + if(strtolower($this->charset) == 'utf-8') print $content; + else print iconv('UTF-8',$this->charset."//TRANSLIT//IGNORE", $content); + + exit(); + } + + /** + * @brief 페이지 이동 + **/ + function movepage($url) { + header("location:$url"); + exit(); + } + + /** + * @brief 목록등에서 일련 번호를 리턴한다 + **/ + function getNo() { + $this->no++; + $str = $this->no; + return $str; + } + + /** + * @brief XE의 Menu 모듈이 값을 사용하기 쉽게 정리해주는 함수 + **/ + function getListedItems($menu, &$listed_items, &$node_list) { + if(!count($menu)) return; + foreach($menu as $node_srl => $item) { + if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $item['url'])) { + $mid = $item['mid'] = $item['url']; + $node_list[$mid] = $node_srl; + } else { + $mid = $item['mid'] = null; + } + + $listed_items[$node_srl] = $item; + $this->getListedItems($item['list'], $listed_items, $node_list); + } + } + + /** + * @brief XE 네비게이션 출력 + **/ + function displayNavigationContent() { + $childs = array(); + + if($this->cmid) { + $cur_item = $this->listed_items[$this->cmid]; + $upper_srl = $cur_item['parent_srl'];; + $list = $cur_item['list'];; + $this->setUpperUrl(getUrl('cmid',$upper_srl), Context::getLang('cmd_go_upper')); + if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $cur_item['url'])) { + $obj = null; + $obj['href'] = getUrl('','mid',$cur_item['url']); + $obj['link'] = $obj['text'] = '['.$cur_item['text'].']'; + $childs[] = $obj; + } + + } else { + $list = $this->menu; + $upper_srl = 0; + } + + + if(count($list)) { + foreach($list as $key => $val) { + if(!$val['text']) continue; + $obj = null; + if(!count($val['list'])) { + $obj['href'] = getUrl('','mid',$val['url']); + } else { + $obj['href'] = getUrl('cmid',$val['node_srl']); + } + $obj['link'] = $obj['text'] = $val['text']; + $childs[] = $obj; + } + $this->setChilds($childs); + } + + // 출력 + $this->display(); + } + + /** + * @brief 언어설정 메뉴 출력 + **/ + function displayLangSelect() { + $childs = array(); + + $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) { + $this->lang = str_replace(array(''),array('',''),$this->lang); + Context::setLangType($this->lang); + } + $lang_supported = Context::get('lang_supported'); + $lang_type = Context::getLangType(); + $obj = null; + $obj['link'] = $obj['text'] = Context::getLang('president_lang').' : '.$lang_supported[$lang_type]; + $obj['href'] = getUrl('sel_lang',$lang_type); + $childs[] = $obj; + + if(is_array($lang_supported)) { + foreach($lang_supported as $key => $val) { + $obj = null; + $obj['link'] = $obj['text'] = $val; + $obj['href'] = getUrl('sel_lang',$key); + $childs[] = $obj; + } + } + + $this->setChilds($childs); + + $this->display(); + } + + /** + * @brief 모듈의 WAP 클래스 객체 생성하여 WAP 준비 + **/ + function displayModuleContent() { + // 선택된 모듈의 WAP class 객체 생성 + $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; + + // 실행 + $oModule->procWAP($this); + + // 출력 + $this->display(); + } + + /** + * @brief WAP 컨텐츠를 별도로 구할 수 없으면 최종 결과물을 출력 + **/ + function displayContent() { + Context::set('layout','none'); + + // 템플릿 컴파일 + $oTemplate = new TemplateHandler(); + $oContext = &Context::getInstance(); + + $content = $oTemplate->compile($this->oModule->getTemplatePath(), $this->oModule->getTemplateFile()); + $this->setContent($content); + + // 출력 + $this->display(); + } + } +?> diff --git a/addons/mobile/classes/wml.class.php b/addons/mobile/classes/wml.class.php index 08103b37c..11e6ae35e 100644 --- a/addons/mobile/classes/wml.class.php +++ b/addons/mobile/classes/wml.class.php @@ -1,106 +1,106 @@ -charset); - if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); - print("charset."\"?>\n"); - // 카드제목 - printf("\n\n

\n",htmlspecialchars($this->title),htmlspecialchars($titlePageStr)); - } - - /** - * @brief 제목을 출력 - **/ - 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()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력 - **/ - function printContent() { - if($this->hasChilds()) { - foreach($this->getChilds() as $key => $val) { - if(!$val['link']) continue; - printf('%s', $this->getNo(), htmlspecialchars($val['text']), $val['href'], "\n"); - if($val['extra']) printf("%s\n",$val['extra']); - } - } else { - printf('%s
%s', str_replace("
","
",$this->getContent()),"\n"); - } - print('
'); - } - - /** - * @brief 버튼을 출력함 - **/ - function printBtn() { - if($this->nextUrl) { - $url = $this->nextUrl; - printf('%s', $url->text, $url->url, "\n"); - } - if($this->prevUrl) { - $url = $this->prevUrl; - printf('%s', $url->text, $url->url, "\n"); - } - // 기타 해당사항 없는 버튼 출력 담당 (array로 전달) type?? - if($this->etcBtn) { - if(is_array($this->etcBtn)) { - foreach($this->etcBtn as $key=>$val) { - printf('%s', $key, $val['text'], $val['url'], "\n"); - } - } - } - // 언어선택 - 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"); - } - else { - printf('%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n"); - } - if($this->homeUrl) { - $url = $this->homeUrl; - printf('%s', $url->text, $url->url, "\n"); - } - if($this->upperUrl) { - $url = $this->upperUrl; - printf('%s', $url->text, $url->url, "\n"); - } - } - - // 푸터 정보를 출력 - function printFooter() { - print("

\n
\n
"); - } - - // 목록등에서 일련 번호를 리턴한다 - function getNo() { - if(Context::get('mobile_skt')==1) { - return "vnd.skmn".parent::getNo(); - } - else { - return parent::getNo(); - } - return $str; - } - } -?> +charset); + if($this->totalPage > $this->mobilePage) $titlePageStr = sprintf("(%d/%d)",$this->mobilePage, $this->totalPage); + print("charset."\"?>\n"); + // 카드제목 + printf("\n\n

\n",htmlspecialchars($this->title),htmlspecialchars($titlePageStr)); + } + + /** + * @brief 제목을 출력 + **/ + 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()가 있으면 목록형을 그렇지 않으면 컨텐츠를 출력 + **/ + function printContent() { + if($this->hasChilds()) { + foreach($this->getChilds() as $key => $val) { + if(!$val['link']) continue; + printf('%s', $this->getNo(), htmlspecialchars($val['text']), $val['href'], "\n"); + if($val['extra']) printf("%s\n",$val['extra']); + } + } else { + printf('%s
%s', str_replace("
","
",$this->getContent()),"\n"); + } + print('
'); + } + + /** + * @brief 버튼을 출력함 + **/ + function printBtn() { + if($this->nextUrl) { + $url = $this->nextUrl; + printf('%s', $url->text, $url->url, "\n"); + } + if($this->prevUrl) { + $url = $this->prevUrl; + printf('%s', $url->text, $url->url, "\n"); + } + // 기타 해당사항 없는 버튼 출력 담당 (array로 전달) type?? + if($this->etcBtn) { + if(is_array($this->etcBtn)) { + foreach($this->etcBtn as $key=>$val) { + printf('%s', $key, $val['text'], $val['url'], "\n"); + } + } + } + // 언어선택 + 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"); + } + else { + printf('%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n"); + } + if($this->homeUrl) { + $url = $this->homeUrl; + printf('%s', $url->text, $url->url, "\n"); + } + if($this->upperUrl) { + $url = $this->upperUrl; + printf('%s', $url->text, $url->url, "\n"); + } + } + + // 푸터 정보를 출력 + function printFooter() { + print("

\n
\n
"); + } + + // 목록등에서 일련 번호를 리턴한다 + function getNo() { + if(Context::get('mobile_skt')==1) { + return "vnd.skmn".parent::getNo(); + } + else { + return parent::getNo(); + } + return $str; + } + } +?> diff --git a/addons/mobile/conf/info.xml b/addons/mobile/conf/info.xml index 3dcee3654..d9f43b2a5 100644 --- a/addons/mobile/conf/info.xml +++ b/addons/mobile/conf/info.xml @@ -1,112 +1,112 @@ - - - 모바일XE 애드온 - モバイルXEアドオン - 手机XE插件 - Mobile XE - Mobile XE - Mobile XE - XE行動上網 - - 모바일에서 접속시 헤더 정보를 분석하여 메뉴 - 모듈의 관계를 이용하여 WAP 태그로 출력하는 애드온입니다. - wml, hdml, mhtml를 지원하고 그 이외의 경우에는 동작하지 않습니다. - - - モバイル端末機からアクセス時、ヘッダー(header)情報を分析して「メニュー」と「モジュール」の関係を利用してWAPタグに変換表示するアドオンです。 - wml, hdml, mhtmlをサポートし、その以外は対応していません。 - - - 通过手机访问网站时将网页输出为WAP标签的插件。 - 支持语言:wml, hdml, mhtml - - - This addon displays WAP tag by analyzing header information on mobile connection. - Only wml, hdml, mhtml formats are provided. - - - Addon này hiển thị WAP Tag bởi việc phân tích thông tin khi kết nối bằng di động. - Chỉ hỗ trợ cho các định dạng wml, hdml, mhtml. - - - Данный аддон показывает WAP теги, анализирую информацию мобильного соединения. - Поддерживаются только wml, hdml, mhtml форматы. - - - 透過行動工具上網時,會將網頁轉換為WAP標籤顯示。 - 只限於 wml, hdml, mhtml格式。 - - 0.1.1 - 2009-05-23 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - - - - misol - misol - misol - misol - misol - misol - misol - - 언어선택 추가(WML, mHTML) - 인코딩 설정 개선 - 그 외 소소한 개선들 - - - - - 문자셋 - 文字コード - 编码 - Charset - Charset - Charset - 編碼 - - 모바일 기기의 경우 UTF-8 문자셋을 인식하지 못할 수 있습니다. - 문자셋에 원하시는 문자셋을 입력하면 자동으로 변환하여 출력하여 모바일에서 이상없이 출력하도록 합니다. - 기본값은 UTF-8입니다. - (*SK Telecom 휴대전화의 경우 euc-kr인코딩만 지원하므로, 강제로 euc-kr인코딩만 지원합니다.) - - - ある特定のモバイル機器ではutf-8文字コードの認識が出来ない場合があります。 - 文字コードを設定すると、(日本語だけの場合)該当文字コードに自動変換して正常に表示出来るようになります。 - 本アドオンのデフォルト値はUTF-8で、日本の携帯はshift-jisが一般的です。 - - - 手机有时无法识别utf-8编码,这时输入相应的编码值即可自动转换。 - 默认编码为UTF-8。 - - - utf-8 may be read with mobile tools. - Mobile tools will display correct charset when you input charset you want. - Default charset is UTF-8. - - - UTF-8 không thể đọc được cho các công cụ di động. - Những công cụ di động sẽ trình bày Charset đúng khi bạn nhập vào Charset bạn muốn. - Charset mặc định là UTF-8. - - - utf-8 may be read with mobile tools. - Mobile tools will display correct charset when you input charset you want. - Default charset is UTF-8. - - - 行動工具無法讀取utf-8編碼。 - 當您輸入所想要的編碼時,行動工具將會正確的顯示。 - 預設編碼是UTF-8. - - - - + + + 모바일XE 애드온 + モバイルXEアドオン + 手机XE插件 + Mobile XE + Mobile XE + Mobile XE + XE行動上網 + + 모바일에서 접속시 헤더 정보를 분석하여 메뉴 - 모듈의 관계를 이용하여 WAP 태그로 출력하는 애드온입니다. + wml, hdml, mhtml를 지원하고 그 이외의 경우에는 동작하지 않습니다. + + + モバイル端末機からアクセス時、ヘッダー(header)情報を分析して「メニュー」と「モジュール」の関係を利用してWAPタグに変換表示するアドオンです。 + wml, hdml, mhtmlをサポートし、その以外は対応していません。 + + + 通过手机访问网站时将网页输出为WAP标签的插件。 + 支持语言:wml, hdml, mhtml + + + This addon displays WAP tag by analyzing header information on mobile connection. + Only wml, hdml, mhtml formats are provided. + + + Addon này hiển thị WAP Tag bởi việc phân tích thông tin khi kết nối bằng di động. + Chỉ hỗ trợ cho các định dạng wml, hdml, mhtml. + + + Данный аддон показывает WAP теги, анализирую информацию мобильного соединения. + Поддерживаются только wml, hdml, mhtml форматы. + + + 透過行動工具上網時,會將網頁轉換為WAP標籤顯示。 + 只限於 wml, hdml, mhtml格式。 + + 0.1.1 + 2009-05-23 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + + + + misol + misol + misol + misol + misol + misol + misol + + 언어선택 추가(WML, mHTML) + 인코딩 설정 개선 + 그 외 소소한 개선들 + + + + + 문자셋 + 文字コード + 编码 + Charset + Charset + Charset + 編碼 + + 모바일 기기의 경우 UTF-8 문자셋을 인식하지 못할 수 있습니다. + 문자셋에 원하시는 문자셋을 입력하면 자동으로 변환하여 출력하여 모바일에서 이상없이 출력하도록 합니다. + 기본값은 UTF-8입니다. + (*SK Telecom 휴대전화의 경우 euc-kr인코딩만 지원하므로, 강제로 euc-kr인코딩만 지원합니다.) + + + ある特定のモバイル機器ではutf-8文字コードの認識が出来ない場合があります。 + 文字コードを設定すると、(日本語だけの場合)該当文字コードに自動変換して正常に表示出来るようになります。 + 本アドオンのデフォルト値はUTF-8で、日本の携帯はshift-jisが一般的です。 + + + 手机有时无法识别utf-8编码,这时输入相应的编码值即可自动转换。 + 默认编码为UTF-8。 + + + utf-8 may be read with mobile tools. + Mobile tools will display correct charset when you input charset you want. + Default charset is UTF-8. + + + UTF-8 không thể đọc được cho các công cụ di động. + Những công cụ di động sẽ trình bày Charset đúng khi bạn nhập vào Charset bạn muốn. + Charset mặc định là UTF-8. + + + utf-8 may be read with mobile tools. + Mobile tools will display correct charset when you input charset you want. + Default charset is UTF-8. + + + 行動工具無法讀取utf-8編碼。 + 當您輸入所想要的編碼時,行動工具將會正確的顯示。 + 預設編碼是UTF-8. + + + + diff --git a/addons/mobile/lang/en.lang.php b/addons/mobile/lang/en.lang.php index 806187185..75ad30db3 100644 --- a/addons/mobile/lang/en.lang.php +++ b/addons/mobile/lang/en.lang.php @@ -1,15 +1,15 @@ -president_lang = 'selected Language'; - $lang->select_lang = 'select Language'; - $lang->lang_return = 'Go Back'; - - $lang->cmd_go_upper = 'Upper'; - $lang->cmd_go_home = 'Go Home'; - $lang->cmd_view_sitemap = 'View site map'; -?> +president_lang = 'selected Language'; + $lang->select_lang = 'select Language'; + $lang->lang_return = 'Go Back'; + + $lang->cmd_go_upper = 'Upper'; + $lang->cmd_go_home = 'Go Home'; + $lang->cmd_view_sitemap = 'View site map'; +?> diff --git a/addons/mobile/lang/jp.lang.php b/addons/mobile/lang/jp.lang.php index d9300e7e6..fc891f187 100644 --- a/addons/mobile/lang/jp.lang.php +++ b/addons/mobile/lang/jp.lang.php @@ -1,17 +1,17 @@ -president_lang = '現在言語'; - $lang->select_lang = '言語選択'; - $lang->lang_return = '戻る'; - - $lang->cmd_go_upper = '上位メニュー'; - $lang->cmd_go_home = 'トップへ'; - $lang->cmd_view_sitemap = 'サイトマップ'; - -?> +president_lang = '現在言語'; + $lang->select_lang = '言語選択'; + $lang->lang_return = '戻る'; + + $lang->cmd_go_upper = '上位メニュー'; + $lang->cmd_go_home = 'トップへ'; + $lang->cmd_view_sitemap = 'サイトマップ'; + +?> diff --git a/addons/mobile/lang/ko.lang.php b/addons/mobile/lang/ko.lang.php index 48bf404a0..90b08f866 100644 --- a/addons/mobile/lang/ko.lang.php +++ b/addons/mobile/lang/ko.lang.php @@ -1,17 +1,17 @@ -president_lang = '현재 언어'; - $lang->select_lang = '언어 선택'; - $lang->lang_return = '돌아가기'; - - $lang->cmd_go_upper = '상위'; - $lang->cmd_go_home = '홈으로'; - $lang->cmd_view_sitemap = '사이트맵 보기'; - -?> +president_lang = '현재 언어'; + $lang->select_lang = '언어 선택'; + $lang->lang_return = '돌아가기'; + + $lang->cmd_go_upper = '상위'; + $lang->cmd_go_home = '홈으로'; + $lang->cmd_view_sitemap = '사이트맵 보기'; + +?> diff --git a/addons/mobile/lang/ru.lang.php b/addons/mobile/lang/ru.lang.php index 87cc015cf..929a5689c 100644 --- a/addons/mobile/lang/ru.lang.php +++ b/addons/mobile/lang/ru.lang.php @@ -1,17 +1,17 @@ -president_lang = 'Дейсвующй язык'; - $lang->select_lang = 'Выбор языка'; - $lang->lang_return = 'Вернуться'; - - $lang->cmd_go_upper = 'Вверх'; - $lang->cmd_go_home = 'На главную страницу'; - $lang->cmd_view_sitemap = 'Посмотреть карту сайта'; - -?> +president_lang = 'Дейсвующй язык'; + $lang->select_lang = 'Выбор языка'; + $lang->lang_return = 'Вернуться'; + + $lang->cmd_go_upper = 'Вверх'; + $lang->cmd_go_home = 'На главную страницу'; + $lang->cmd_view_sitemap = 'Посмотреть карту сайта'; + +?> diff --git a/addons/mobile/lang/vi.lang.php b/addons/mobile/lang/vi.lang.php index 1ed1fa8a5..4f5e77389 100644 --- a/addons/mobile/lang/vi.lang.php +++ b/addons/mobile/lang/vi.lang.php @@ -1,18 +1,18 @@ -president_lang = 'Chọn ngôn ngữ'; - $lang->select_lang = 'Chọn ngôn ngữ'; - $lang->lang_return = 'Trở lại'; - - $lang->cmd_go_upper = 'Lên trên'; - $lang->cmd_go_home = 'Về trang chủ'; - $lang->cmd_view_sitemap = 'Xem sơ đồ Web'; -?> +president_lang = 'Chọn ngôn ngữ'; + $lang->select_lang = 'Chọn ngôn ngữ'; + $lang->lang_return = 'Trở lại'; + + $lang->cmd_go_upper = 'Lên trên'; + $lang->cmd_go_home = 'Về trang chủ'; + $lang->cmd_view_sitemap = 'Xem sơ đồ Web'; +?> diff --git a/addons/mobile/lang/zh-CN.lang.php b/addons/mobile/lang/zh-CN.lang.php index 1610b859f..96dc8d5cb 100644 --- a/addons/mobile/lang/zh-CN.lang.php +++ b/addons/mobile/lang/zh-CN.lang.php @@ -1,11 +1,11 @@ -cmd_go_upper = '上一级'; - $lang->cmd_go_home = '首页'; - $lang->cmd_view_sitemap = '网站地图'; -?> +cmd_go_upper = '上一级'; + $lang->cmd_go_home = '首页'; + $lang->cmd_view_sitemap = '网站地图'; +?> diff --git a/addons/mobile/lang/zh-TW.lang.php b/addons/mobile/lang/zh-TW.lang.php index 6de5fd45e..0435b4be0 100644 --- a/addons/mobile/lang/zh-TW.lang.php +++ b/addons/mobile/lang/zh-TW.lang.php @@ -1,15 +1,15 @@ -president_lang = '已選擇語言'; - $lang->select_lang = '選擇語言'; - $lang->lang_return = '返回'; - - $lang->cmd_go_upper = '回上頁'; - $lang->cmd_go_home = '回首頁'; - $lang->cmd_view_sitemap = '網站地圖'; -?> +president_lang = '已選擇語言'; + $lang->select_lang = '選擇語言'; + $lang->lang_return = '返回'; + + $lang->cmd_go_upper = '回上頁'; + $lang->cmd_go_home = '回首頁'; + $lang->cmd_view_sitemap = '網站地圖'; +?> diff --git a/addons/mobile/mobile.addon.php b/addons/mobile/mobile.addon.php index fd55b714c..ce99e39ea 100644 --- a/addons/mobile/mobile.addon.php +++ b/addons/mobile/mobile.addon.php @@ -1,61 +1,61 @@ - 모바일 처리를 위해 모듈의 일반 설정을 변경해야 할 경우 호출 - * - * after_module_proc > 모바일 컨텐츠 출력 - * 동작 조건 - **/ - - // 관리자 페이지는 무시 - if(Context::get('module')=='admin') return; - - // 동작 시점 관리 - if($called_position != 'before_module_proc' && $called_position != 'after_module_proc' ) return; - - // 모바일 브라우저가 아니라면 무시 - require_once(_XE_PATH_.'addons/mobile/classes/mobile.class.php'); - if(!mobileXE::getBrowserType()) return; - - // mobile instance 생성 - $oMobile = &mobileXE::getInstance(); - if(!$oMobile) return; - - // 애드온 설정에서 지정된 charset으로 지정 - $oMobile->setCharSet($addon_info->charset); - - // 모듈의 정보를 세팅 - $oMobile->setModuleInfo($this->module_info); - - // 현재 모듈 객체 등록 - $oMobile->setModuleInstance($this); - - // 네비게이트 모드이거나 WAP class가 있을 경우 미리 컨텐츠를 추출하여 출력/ 종료 - if($called_position == 'before_module_proc') { - - if($oMobile->isLangChange()) { - $oMobile->setLangType(); - $oMobile->displayLangSelect(); - } - - // 네비게이트 모드이면 네비게이션 컨텐츠 출력 - if($oMobile->isNavigationMode()) $oMobile->displayNavigationContent(); - - // WAP class가 있으면 WAP class를 통해 컨텐츠 출력 - else $oMobile->displayModuleContent(); - - // 네비게이트 모드가 아니고 WAP 클래스가 아니면 모듈의 결과를 출력 - } else if($called_position == 'after_module_proc') { - // 내용 준비 - $oMobile->displayContent(); - } -?> + 모바일 처리를 위해 모듈의 일반 설정을 변경해야 할 경우 호출 + * + * after_module_proc > 모바일 컨텐츠 출력 + * 동작 조건 + **/ + + // 관리자 페이지는 무시 + if(Context::get('module')=='admin') return; + + // 동작 시점 관리 + if($called_position != 'before_module_proc' && $called_position != 'after_module_proc' ) return; + + // 모바일 브라우저가 아니라면 무시 + require_once(_XE_PATH_.'addons/mobile/classes/mobile.class.php'); + if(!mobileXE::getBrowserType()) return; + + // mobile instance 생성 + $oMobile = &mobileXE::getInstance(); + if(!$oMobile) return; + + // 애드온 설정에서 지정된 charset으로 지정 + $oMobile->setCharSet($addon_info->charset); + + // 모듈의 정보를 세팅 + $oMobile->setModuleInfo($this->module_info); + + // 현재 모듈 객체 등록 + $oMobile->setModuleInstance($this); + + // 네비게이트 모드이거나 WAP class가 있을 경우 미리 컨텐츠를 추출하여 출력/ 종료 + if($called_position == 'before_module_proc') { + + if($oMobile->isLangChange()) { + $oMobile->setLangType(); + $oMobile->displayLangSelect(); + } + + // 네비게이트 모드이면 네비게이션 컨텐츠 출력 + if($oMobile->isNavigationMode()) $oMobile->displayNavigationContent(); + + // WAP class가 있으면 WAP class를 통해 컨텐츠 출력 + else $oMobile->displayModuleContent(); + + // 네비게이트 모드가 아니고 WAP 클래스가 아니면 모듈의 결과를 출력 + } else if($called_position == 'after_module_proc') { + // 내용 준비 + $oMobile->displayContent(); + } +?> diff --git a/addons/openid_delegation_id/conf/info.xml b/addons/openid_delegation_id/conf/info.xml index 796abb29e..9adf737f8 100644 --- a/addons/openid_delegation_id/conf/info.xml +++ b/addons/openid_delegation_id/conf/info.xml @@ -1,125 +1,125 @@ - - - OpenID delegation ID - OpenID - OpenID Delegation ID - OpenID Delegation ID - OpenID Delegation ID - Delegación ID para OpenID - OpenIDアドオン - Открытый ID(OpenID) - OpenID - - 본인의 도메인을 사용하여 오픈아이디로 활용할 수 있도록 합니다. - 꼭 설정을 통해서 openid provider관련 값을 입력후 사용해주세요. - - - 可以把本人的域名当分散式身份验证系统(OpenID)来使用。 - 必须在设置中输入openid provider相关值后再使用。 - - - This addon enables you to use your own domain name as an OpenID. - Just be sure to set the values related with openid provider before using. - - - Addon này cho phép bạn sử dụng tên miền của mình như một OpenID. - Hãy kiểm tra để đặt giá trị liên quan với OpenID trước khi sử dụng. - - - Dieses Addon ermöglicht es Ihnen, mit Ihrem eigenen Domain-Namen als OpenID. - Einfach sicher sein, dass die Werte im Zusammenhang mit OpenID-Provider, bevor Sie. - - - Utlizando su propio dominio puede usar como OpenID. - Debe utilizar luego de ingresar los valores relacionado con openid provider a través de la configuracion. - - - 保有しているオリジナルドメインをオープンIDとして活用することが出来ます。 - 必ず設定にて、OpenIDプロバイダーの関連情報を入力してから使用して下さい。 - - - Этот аддон позволяет Вам использовать Ваше доменное имя как OpenID. - Прежде, чем использовать, установите значения, имеющие отношение к openid-провайдеру . - - - 可將原本的域名當做OpenID來使用。 - 必須在設置中輸入openid provider相關資料後再使用。 - - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - - - - server - server - server - Server - server - Servidor - server - server - server - openid.server 값을 입력해 주세요. - 请输入 openid.server 值。 - Hãy nhập OpenID Server của bạn. - Please input your openid.server value. - Bitte geben Sie Ihre openid.server Wert. - Ingrese el valor del openid.server. - openid.server値を入力して下さい。 - Пожалуйста, введите Ваше значение openid.server - 請輸入 openid.server 值。 - - - delegate - delegate - Delegate - delegate - delegate - delegado - delegate - delegate - delegate - openid.delegate값을 입력해주세요. - 请输入 openid.delegate 值。 - Hãy nhập OpenID Delegate của bạn. - Please input your openid.delegate value. - Bitte geben Sie Ihre openid.delegate Wert. - Ingresar el valor del openid.delegate - openid.delegate値を入力して下さい。 - Пожалуйста, введите Ваше значение openid.delegate - 請輸入 openid.delegate 值。 - - - xrds - xrds - xrds - xrds - xrds - xrds - xrds - xrds - xrds - X-XRDS-Location값을 입력해주세요. - 请输入 X-XRDS-Location 值。 - Please input your X-XRDS-Location value. - Hãy nhập X-XRDS-Location của bạn. - Bitte geben Sie Ihre X-XRDS-Standort Wert. - Ingresar el valor de X-XRDS-Location - X-XRDS-Location値を入力して下さい。 - Пожалуйста, введите Ваше значение X-XRDS-Локации. - 請輸入 X-XRDS-Location 值。 - - - + + + OpenID delegation ID + OpenID + OpenID Delegation ID + OpenID Delegation ID + OpenID Delegation ID + Delegación ID para OpenID + OpenIDアドオン + Открытый ID(OpenID) + OpenID + + 본인의 도메인을 사용하여 오픈아이디로 활용할 수 있도록 합니다. + 꼭 설정을 통해서 openid provider관련 값을 입력후 사용해주세요. + + + 可以把本人的域名当分散式身份验证系统(OpenID)来使用。 + 必须在设置中输入openid provider相关值后再使用。 + + + This addon enables you to use your own domain name as an OpenID. + Just be sure to set the values related with openid provider before using. + + + Addon này cho phép bạn sử dụng tên miền của mình như một OpenID. + Hãy kiểm tra để đặt giá trị liên quan với OpenID trước khi sử dụng. + + + Dieses Addon ermöglicht es Ihnen, mit Ihrem eigenen Domain-Namen als OpenID. + Einfach sicher sein, dass die Werte im Zusammenhang mit OpenID-Provider, bevor Sie. + + + Utlizando su propio dominio puede usar como OpenID. + Debe utilizar luego de ingresar los valores relacionado con openid provider a través de la configuracion. + + + 保有しているオリジナルドメインをオープンIDとして活用することが出来ます。 + 必ず設定にて、OpenIDプロバイダーの関連情報を入力してから使用して下さい。 + + + Этот аддон позволяет Вам использовать Ваше доменное имя как OpenID. + Прежде, чем использовать, установите значения, имеющие отношение к openid-провайдеру . + + + 可將原本的域名當做OpenID來使用。 + 必須在設置中輸入openid provider相關資料後再使用。 + + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + + + + server + server + server + Server + server + Servidor + server + server + server + openid.server 값을 입력해 주세요. + 请输入 openid.server 值。 + Hãy nhập OpenID Server của bạn. + Please input your openid.server value. + Bitte geben Sie Ihre openid.server Wert. + Ingrese el valor del openid.server. + openid.server値を入力して下さい。 + Пожалуйста, введите Ваше значение openid.server + 請輸入 openid.server 值。 + + + delegate + delegate + Delegate + delegate + delegate + delegado + delegate + delegate + delegate + openid.delegate값을 입력해주세요. + 请输入 openid.delegate 值。 + Hãy nhập OpenID Delegate của bạn. + Please input your openid.delegate value. + Bitte geben Sie Ihre openid.delegate Wert. + Ingresar el valor del openid.delegate + openid.delegate値を入力して下さい。 + Пожалуйста, введите Ваше значение openid.delegate + 請輸入 openid.delegate 值。 + + + xrds + xrds + xrds + xrds + xrds + xrds + xrds + xrds + xrds + X-XRDS-Location값을 입력해주세요. + 请输入 X-XRDS-Location 值。 + Please input your X-XRDS-Location value. + Hãy nhập X-XRDS-Location của bạn. + Bitte geben Sie Ihre X-XRDS-Standort Wert. + Ingresar el valor de X-XRDS-Location + X-XRDS-Location値を入力して下さい。 + Пожалуйста, введите Ваше значение X-XRDS-Локации. + 請輸入 X-XRDS-Location 值。 + + + diff --git a/addons/openid_delegation_id/openid_delegation_id.addon.php b/addons/openid_delegation_id/openid_delegation_id.addon.php index aa5a373dd..be01816ff 100644 --- a/addons/openid_delegation_id/openid_delegation_id.addon.php +++ b/addons/openid_delegation_id/openid_delegation_id.addon.php @@ -1,29 +1,29 @@ -server||!$addon_info->delegate||!$addon_info->xrds) return; - - $header_script = sprintf( - ''."\n". - ''."\n". - '', - $addon_info->server, - $addon_info->delegate, - $addon_info->xrds - ); - - Context::addHtmlHeader($header_script); -?> +server||!$addon_info->delegate||!$addon_info->xrds) return; + + $header_script = sprintf( + ''."\n". + ''."\n". + '', + $addon_info->server, + $addon_info->delegate, + $addon_info->xrds + ); + + Context::addHtmlHeader($header_script); +?> diff --git a/addons/point_level_icon/conf/info.xml b/addons/point_level_icon/conf/info.xml index adde6ae69..201cdfb7c 100644 --- a/addons/point_level_icon/conf/info.xml +++ b/addons/point_level_icon/conf/info.xml @@ -1,62 +1,62 @@ - - - 포인트 레벨 아이콘 표시 애드온 - 积分级别图标 - ポイントレベルアイコン表示アドオン - Point Level Icon - Icon cấp độ của điểm - Point-Level-Symbol - Addon para mostar el nivel del ícono - Иконка уровня поинтов - 點數等級圖案 - - 포인트 시스템을 사용중일 경우 사용자 이름 앞에 레벨 아이콘을 표시하도록 합니다. - 레벨 아이콘은 모듈 > 포인트시스템에서 선택 가능합니다. - - - 使用积分系统时,可以在用户名前显示级别图标。 - 级别图标可以在模块 > 积分系统中进行选择。 - - - ポイントシステムを使用する場合、ユーザ名の前にレベルアイコンの表示します。 - レベルアイコンは、「モジュール > ポイントシステム」で選択します。 - - - This addon displays level icon in front of the user name when you are using the point system. - You can choose the level icon in Module > Point System. - - - Addon này sẽ hiển thị Icon cấp độ trước tên người sử dụng khi bạn sử dụng hệ thống tính điểm. - Bạn có thể chọn Icon cấp độ tại Module > cỉa hệ thống điểm. - - - Dieses Addon zeigt Level Icon vor dem Benutzernamen, wenn Sie die Punkte-System. - Sie können wählen, der Level Icon in Modul> Point-System. - - - Este addon muestra el nivel del ícono delante del nombre del usuario cuando es usado el sistema de puntos. - Tu puedes elegir los icono de cada nivel en el módulo > Sistema de Puntos. - - - Этот аддон отображает иконку уровня поинтов напротив имени пользователя, когда используется система поинтов. - Вы можете выбрать иконку уровня в Модуле Системы Поинтов. - - - 使用點數系統時,可以在用戶名前顯示等級圖案。 - 等級圖案可以在模組 > 點數系統中進行選擇。 - - 0.1 - 2007-07-26 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 포인트 레벨 아이콘 표시 애드온 + 积分级别图标 + ポイントレベルアイコン表示アドオン + Point Level Icon + Icon cấp độ của điểm + Point-Level-Symbol + Addon para mostar el nivel del ícono + Иконка уровня поинтов + 點數等級圖案 + + 포인트 시스템을 사용중일 경우 사용자 이름 앞에 레벨 아이콘을 표시하도록 합니다. + 레벨 아이콘은 모듈 > 포인트시스템에서 선택 가능합니다. + + + 使用积分系统时,可以在用户名前显示级别图标。 + 级别图标可以在模块 > 积分系统中进行选择。 + + + ポイントシステムを使用する場合、ユーザ名の前にレベルアイコンの表示します。 + レベルアイコンは、「モジュール > ポイントシステム」で選択します。 + + + This addon displays level icon in front of the user name when you are using the point system. + You can choose the level icon in Module > Point System. + + + Addon này sẽ hiển thị Icon cấp độ trước tên người sử dụng khi bạn sử dụng hệ thống tính điểm. + Bạn có thể chọn Icon cấp độ tại Module > cỉa hệ thống điểm. + + + Dieses Addon zeigt Level Icon vor dem Benutzernamen, wenn Sie die Punkte-System. + Sie können wählen, der Level Icon in Modul> Point-System. + + + Este addon muestra el nivel del ícono delante del nombre del usuario cuando es usado el sistema de puntos. + Tu puedes elegir los icono de cada nivel en el módulo > Sistema de Puntos. + + + Этот аддон отображает иконку уровня поинтов напротив имени пользователя, когда используется система поинтов. + Вы можете выбрать иконку уровня в Модуле Системы Поинтов. + + + 使用點數系統時,可以在用戶名前顯示等級圖案。 + 等級圖案可以在模組 > 點數系統中進行選擇。 + + 0.1 + 2007-07-26 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/addons/point_level_icon/point_level_icon.addon.php b/addons/point_level_icon/point_level_icon.addon.php index bbf847334..6395590c3 100644 --- a/addons/point_level_icon/point_level_icon.addon.php +++ b/addons/point_level_icon/point_level_icon.addon.php @@ -1,19 +1,19 @@ -]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output); -?> +]*)member_([0-9\-]+)([^\>]*)>(.*?)\<\/(div|span|a)\>!is', 'pointLevelIconTrans', $output); +?> diff --git a/addons/resize_image/conf/info.xml b/addons/resize_image/conf/info.xml index b16c38058..7950c546d 100644 --- a/addons/resize_image/conf/info.xml +++ b/addons/resize_image/conf/info.xml @@ -1,53 +1,53 @@ - - - 본문내 이미지 조절 애드온 - 本文内イメージリーサイズアドオン - 内容区图片缩放插件 - Image Resizer - Thay đổi cỡ hình ảnh - Imagen de control add-on bonmunnae - Аддон редактирования размера картинки в тексте - Image-Add-on bonmunnae - 圖片縮放 - - 본문내에 삽입된 이미지의 크기를 본문크기에 맞게 하고 클릭시 원본을 보여주는 애드온입니다. - - - 本文内に挿入されたイメージのサイズを本文の幅サイズに合わせてリーサイズし、クリックした時、オリジナルサイズのイメージを表示します。 - - - 自动调整主题内容区内的图片大小,点击将显示原始大小的插件。 - - - Addon này sẽ lấy lại kích thước nguyên bản của hình ảnh trong bài viết hoặc bình luận khi bạn bấm vào hình. - - - This addon resizes images inserted in the article, and shows original image when you click on them. - - - La imagen corporal se inserta dentro del cuerpo para que se adapte al tamaño de la muestra original cuando hago clic en los add-ons. - - - Аддон, изменяющий размер картинки к размеру текста, при клике на картинку, появляется полное изображение. - - - Body Bild eingefügt im Inneren des Körpers zu passen die Größe des Originals zeigen, wenn ich darauf klicke auf das Add-ons. - - - 自動調整文章内的圖片大小,點擊圖片後會顯示原始大小。 - - 0.1 - 2008-04-22 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 본문내 이미지 조절 애드온 + 本文内イメージリーサイズアドオン + 内容区图片缩放插件 + Image Resizer + Thay đổi cỡ hình ảnh + Imagen de control add-on bonmunnae + Аддон редактирования размера картинки в тексте + Image-Add-on bonmunnae + 圖片縮放 + + 본문내에 삽입된 이미지의 크기를 본문크기에 맞게 하고 클릭시 원본을 보여주는 애드온입니다. + + + 本文内に挿入されたイメージのサイズを本文の幅サイズに合わせてリーサイズし、クリックした時、オリジナルサイズのイメージを表示します。 + + + 自动调整主题内容区内的图片大小,点击将显示原始大小的插件。 + + + Addon này sẽ lấy lại kích thước nguyên bản của hình ảnh trong bài viết hoặc bình luận khi bạn bấm vào hình. + + + This addon resizes images inserted in the article, and shows original image when you click on them. + + + La imagen corporal se inserta dentro del cuerpo para que se adapte al tamaño de la muestra original cuando hago clic en los add-ons. + + + Аддон, изменяющий размер картинки к размеру текста, при клике на картинку, появляется полное изображение. + + + Body Bild eingefügt im Inneren des Körpers zu passen die Größe des Originals zeigen, wenn ich darauf klicke auf das Add-ons. + + + 自動調整文章内的圖片大小,點擊圖片後會顯示原始大小。 + + 0.1 + 2008-04-22 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/addons/resize_image/resize_image.addon.php b/addons/resize_image/resize_image.addon.php index bcc74e01a..b6b3ecdfc 100644 --- a/addons/resize_image/resize_image.addon.php +++ b/addons/resize_image/resize_image.addon.php @@ -1,18 +1,18 @@ - + diff --git a/classes/cache/CacheApc.class.php b/classes/cache/CacheApc.class.php index 84b6c88fc..315dc41c5 100644 --- a/classes/cache/CacheApc.class.php +++ b/classes/cache/CacheApc.class.php @@ -1,72 +1,72 @@ -valid_time; - return apc_store(md5(_XE_PATH_.$key), array(time(), $buff), $valid_time); - } - - function isValid($key, $modified_time = 0) { - $_key = md5(_XE_PATH_.$key); - $obj = apc_fetch($_key, $success); - if(!$success || !is_array($obj)) return false; - unset($obj[1]); - - if($modified_time > 0 && $modified_time > $obj[0]) { - $this->_delete($_key); - return false; - } - - return true; - } - - function get($key, $modified_time = 0) { - $_key = md5(_XE_PATH_.$key); - $obj = apc_fetch($_key, $success); - if(!$success || !is_array($obj)) return false; - - if($modified_time > 0 && $modified_time > $obj[0]) { - $this->_delete($_key); - return false; - } - - return $obj[1]; - } - - function _delete($_key) { - $this->put($_key,null,1); - } - - function delete($key) { - $this->_delete(md5(_XE_PATH_.$key)); - } - - function truncate() { - return apc_clear_cache('user'); - } - } -?> +valid_time; + return apc_store(md5(_XE_PATH_.$key), array(time(), $buff), $valid_time); + } + + function isValid($key, $modified_time = 0) { + $_key = md5(_XE_PATH_.$key); + $obj = apc_fetch($_key, $success); + if(!$success || !is_array($obj)) return false; + unset($obj[1]); + + if($modified_time > 0 && $modified_time > $obj[0]) { + $this->_delete($_key); + return false; + } + + return true; + } + + function get($key, $modified_time = 0) { + $_key = md5(_XE_PATH_.$key); + $obj = apc_fetch($_key, $success); + if(!$success || !is_array($obj)) return false; + + if($modified_time > 0 && $modified_time > $obj[0]) { + $this->_delete($_key); + return false; + } + + return $obj[1]; + } + + function _delete($_key) { + $this->put($_key,null,1); + } + + function delete($key) { + $this->_delete(md5(_XE_PATH_.$key)); + } + + function truncate() { + return apc_clear_cache('user'); + } + } +?> diff --git a/classes/cache/CacheHandler.class.php b/classes/cache/CacheHandler.class.php index 4ca454a4e..81c3ad7be 100644 --- a/classes/cache/CacheHandler.class.php +++ b/classes/cache/CacheHandler.class.php @@ -1,95 +1,95 @@ -use_object_cache =='apc') $type = 'apc'; - else if(substr($info->use_object_cache,0,8)=='memcache'){ - $type = 'memcache'; - $url = $info->use_object_cache; - } - }else if($target == 'template'){ - if($info->use_template_cache =='apc') $type = 'apc'; - else if(substr($info->use_template_cache,0,8)=='memcache'){ - $type = 'memcache'; - $url = $info->use_template_cache; - } - } - - if($type){ - $class = 'Cache' . ucfirst($type); - include_once sprintf('%sclasses/cache/%s.class.php', _XE_PATH_, $class); - $this->handler = call_user_func(array($class,'getInstance'), $url); - } - } - } - - function isSupport(){ - if($this->handler && $this->handler->isSupport()) return true; - return false; - } - - function get($key, $modified_time = 0){ - if(!$this->handler) return false; - return $this->handler->get($key, $modified_time); - } - - function put($key, $obj, $valid_time = 0){ - if(!$this->handler) return false; - return $this->handler->put($key, $obj, $valid_time); - } - - function delete($key){ - if(!$this->handler) return false; - return $this->handler->delete($key); - } - - function isValid($key, $modified_time){ - if(!$this->handler) return false; - return $this->handler->isValid($key, $modified_time); - } - - function truncate(){ - if(!$this->handler) return false; - return $this->handler->truncate(); - } - } - - class CacheBase{ - function get($key, $modified_time = 0){ - return false; - } - - function put($key, $obj, $valid_time = 0){ - return false; - } - - function isValid($key, $modified_time = 0){ - return false; - } - - function isSupport(){ - return false; - } - - function truncate(){ - return false; - } - } -?> +use_object_cache =='apc') $type = 'apc'; + else if(substr($info->use_object_cache,0,8)=='memcache'){ + $type = 'memcache'; + $url = $info->use_object_cache; + } + }else if($target == 'template'){ + if($info->use_template_cache =='apc') $type = 'apc'; + else if(substr($info->use_template_cache,0,8)=='memcache'){ + $type = 'memcache'; + $url = $info->use_template_cache; + } + } + + if($type){ + $class = 'Cache' . ucfirst($type); + include_once sprintf('%sclasses/cache/%s.class.php', _XE_PATH_, $class); + $this->handler = call_user_func(array($class,'getInstance'), $url); + } + } + } + + function isSupport(){ + if($this->handler && $this->handler->isSupport()) return true; + return false; + } + + function get($key, $modified_time = 0){ + if(!$this->handler) return false; + return $this->handler->get($key, $modified_time); + } + + function put($key, $obj, $valid_time = 0){ + if(!$this->handler) return false; + return $this->handler->put($key, $obj, $valid_time); + } + + function delete($key){ + if(!$this->handler) return false; + return $this->handler->delete($key); + } + + function isValid($key, $modified_time){ + if(!$this->handler) return false; + return $this->handler->isValid($key, $modified_time); + } + + function truncate(){ + if(!$this->handler) return false; + return $this->handler->truncate(); + } + } + + class CacheBase{ + function get($key, $modified_time = 0){ + return false; + } + + function put($key, $obj, $valid_time = 0){ + return false; + } + + function isValid($key, $modified_time = 0){ + return false; + } + + function isSupport(){ + return false; + } + + function truncate(){ + return false; + } + } +?> diff --git a/classes/cache/CacheMemcache.class.php b/classes/cache/CacheMemcache.class.php index 6ce27624c..3a3bf555a 100644 --- a/classes/cache/CacheMemcache.class.php +++ b/classes/cache/CacheMemcache.class.php @@ -1,91 +1,91 @@ -Memcache = new Memcache; - - foreach($config['url'] as $url) { - $info = parse_url($url); - $this->Memcache->addServer($info['host'], $info['port']); - } - } - - function isSupport(){ - return $this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1); - } - - function getKey($key){ - return md5(_XE_PATH_.$key); - } - - function put($key, $buff, $valid_time = 0){ - if($valid_time == 0) $valid_time = $this->valid_time; - - return $this->Memcache->set($this->getKey($key), array(time(), $buff), MEMCACHE_COMPRESSED, $valid_time); - } - - function isValid($key, $modified_time = 0) { - $_key = $this->getKey($key); - - $obj = $this->Memcache->get($_key); - if(!$obj || !is_array($obj)) return false; - unset($obj[1]); - - if($modified_time > 0 && $modified_time > $obj[0]) { - $this->_delete($_key); - return false; - } - - return true; - } - - function get($key, $modified_time = 0) { - $_key = $this->getKey($key); - $obj = $this->Memcache->get($_key); - if(!$obj || !is_array($obj)) return false; - - if($modified_time > 0 && $modified_time > $obj[0]) { - $this->_delete($_key); - return false; - } - - unset($obj[0]); - - return $obj[1]; - } - - function delete($key) { - $_key = $this->getKey($key); - $this->_delete($_key); - } - - function _delete($_key) { - $this->Memcache->delete($_key); - } - - function truncate() { - // not support memcached - return false; - } - } -?> +Memcache = new Memcache; + + foreach($config['url'] as $url) { + $info = parse_url($url); + $this->Memcache->addServer($info['host'], $info['port']); + } + } + + function isSupport(){ + return $this->Memcache->set('xe', 'xe', MEMCACHE_COMPRESSED, 1); + } + + function getKey($key){ + return md5(_XE_PATH_.$key); + } + + function put($key, $buff, $valid_time = 0){ + if($valid_time == 0) $valid_time = $this->valid_time; + + return $this->Memcache->set($this->getKey($key), array(time(), $buff), MEMCACHE_COMPRESSED, $valid_time); + } + + function isValid($key, $modified_time = 0) { + $_key = $this->getKey($key); + + $obj = $this->Memcache->get($_key); + if(!$obj || !is_array($obj)) return false; + unset($obj[1]); + + if($modified_time > 0 && $modified_time > $obj[0]) { + $this->_delete($_key); + return false; + } + + return true; + } + + function get($key, $modified_time = 0) { + $_key = $this->getKey($key); + $obj = $this->Memcache->get($_key); + if(!$obj || !is_array($obj)) return false; + + if($modified_time > 0 && $modified_time > $obj[0]) { + $this->_delete($_key); + return false; + } + + unset($obj[0]); + + return $obj[1]; + } + + function delete($key) { + $_key = $this->getKey($key); + $this->_delete($_key); + } + + function _delete($_key) { + $this->Memcache->delete($_key); + } + + function truncate() { + // not support memcached + return false; + } + } +?> diff --git a/classes/db/DB.class.php b/classes/db/DB.class.php index 26937e7ad..9fe98db26 100644 --- a/classes/db/DB.class.php +++ b/classes/db/DB.class.php @@ -1,697 +1,697 @@ - '=', - 'more' => '>=', - 'excess' => '>', - 'less' => '<=', - 'below' => '<', - 'notequal' => '<>', - 'notnull' => 'is not null', - 'null' => 'is null', - ); - - var $fd = NULL; ///< connector resource or file description - - var $result = NULL; ///< result - - var $errno = 0; ///< error code (0 means no error) - var $errstr = ''; ///< error message - var $query = ''; ///< query string of latest executed query - var $elapsed_time = 0; ///< elapsed time of latest executed query - - var $transaction_started = false; ///< transaction flag - - var $is_connected = false; ///< is db connected - - var $supported_list = array(); ///< list of supported db, (will be written by classes/DB/DB***.class.php) - - var $cache_file = 'files/cache/queries/'; ///< location of query cache - - /** - * @brief returns instance of certain db type - * @param[in] $db_type type of db - * @return instance - **/ - function &getInstance($db_type = NULL) { - if(!$db_type) $db_type = Context::getDBType(); - if(!$db_type && Context::isInstalled()) return new Object(-1, 'msg_db_not_setted'); - - if(!$GLOBALS['__DB__']) { - $class_name = 'DB'.ucfirst($db_type); - $class_file = _XE_PATH_."classes/db/$class_name.class.php"; - if(!file_exists($class_file)) return new Object(-1, 'msg_db_not_setted'); - - // get a singletone instance of the database driver class - require_once($class_file); - $GLOBALS['__DB__'][$db_type] = call_user_func(array($class_name, 'create')); - } - - return $GLOBALS['__DB__'][$db_type]; - } - - function create() { - return new DB; - } - - /** - * @brief constructor - * @return none - **/ - function DB() { - $this->count_cache_path = _XE_PATH_.$this->count_cache_path; - $this->cache_file = _XE_PATH_.$this->cache_file; - } - - /** - * @brief returns list of supported db - * @return list of supported db - **/ - function getSupportedList() { - $oDB = new DB(); - return $oDB->_getSupportedList(); - } - - /** - * @brief returns list of supported db - * @return list of supported db - **/ - function _getSupportedList() { - $db_classes_path = _XE_PATH_."classes/db/"; - $filter = "/^DB([^\.]+)\.class\.php/i"; - $supported_list = FileHandler::readDir($db_classes_path, $filter, true); - sort($supported_list); - - // after creating instance of class, check is supported - for($i = 0; $i < count($supported_list); $i++) { - $db_type = $supported_list[$i]; - - if(version_compare(phpversion(), '5.0') < 0 && preg_match('/pdo/i',$db_type)) continue; - - $class_name = sprintf("DB%s%s", strtoupper(substr($db_type,0,1)), strtolower(substr($db_type,1))); - $class_file = sprintf(_XE_PATH_."classes/db/%s.class.php", $class_name); - if(!file_exists($class_file)) continue; - - unset($oDB); - require_once($class_file); - $tmp_fn = create_function('', "return new {$class_name}();"); - $oDB = $tmp_fn(); - - if(!$oDB) continue; - - $obj = null; - $obj->db_type = $db_type; - $obj->enable = $oDB->isSupported() ? true : false; - - $this->supported_list[] = $obj; - } - - return $this->supported_list; - } - - /** - * @brief check if the db_type is supported - * @param[in] $db_type type of db to check - * @return true: is supported, false: is not supported - **/ - function isSupported($db_type) { - $supported_list = DB::getSupportedList(); - return in_array($db_type, $supported_list); - } - - /** - * @brief check if is connected - * @return true: connected, false: not connected - **/ - function isConnected() { - return $this->is_connected ? true : false; - } - - /** - * @brief start recording log - * @return none - **/ - function actStart($query) { - $this->setError(0, 'success'); - $this->query = $query; - $this->act_start = getMicroTime(); - $this->elapsed_time = 0; - } - - /** - * @brief finish recording log - * @return none - **/ - function actFinish() { - if(!$this->query) return; - $this->act_finish = getMicroTime(); - $elapsed_time = $this->act_finish - $this->act_start; - $this->elapsed_time = $elapsed_time; - $GLOBALS['__db_elapsed_time__'] += $elapsed_time; - - $log['query'] = $this->query; - $log['elapsed_time'] = $elapsed_time; - - // leave error log if an error occured (if __DEBUG_DB_OUTPUT__ is defined) - if($this->isError()) { - $site_module_info = Context::get('site_module_info'); - $log['module'] = $site_module_info->module; - $log['act'] = Context::get('act'); - $log['query_id'] = $this->query_id; - $log['time'] = date('Y-m-d H:i:s'); - $log['result'] = 'Failed'; - $log['errno'] = $this->errno; - $log['errstr'] = $this->errstr; - - if(__DEBUG_DB_OUTPUT__ == 1) { - $debug_file = _XE_PATH_."files/_debug_db_query.php"; - $buff = array(); - if(!file_exists($debug_file)) $buff[] = ''; - $buff[] = print_r($log, true); - - if(@!$fp = fopen($debug_file, "a")) return; - fwrite($fp, implode("\n", $buff)."\n\n"); - fclose($fp); - } - } else { - $log['result'] = 'Success'; - } - $GLOBALS['__db_queries__'][] = $log; - - // if __LOG_SLOW_QUERY__ if defined, check elapsed time and leave query log - if(__LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__) { - $buff = ''; - $log_file = _XE_PATH_.'files/_db_slow_query.php'; - if(!file_exists($log_file)) { - $buff = ''."\n"; - } - - $buff .= sprintf("%s\t%s\n\t%0.6f sec\tquery_id:%s\n\n", date("Y-m-d H:i"), $this->query, $elapsed_time, $this->query_id); - - if($fp = fopen($log_file, 'a')) { - fwrite($fp, $buff); - fclose($fp); - } - } - } - - /** - * @brief set error - * @param[in] $errno error code - * @param[in] $errstr error message - * @return none - **/ - function setError($errno = 0, $errstr = 'success') { - $this->errno = $errno; - $this->errstr = $errstr; - } - - /** - * @brief check if an error occured - * @return true: error, false: no error - **/ - function isError() { - return $this->errno === 0 ? false : true; - } - - /** - * @brief returns object of error info - * @return object of error - **/ - function getError() { - $this->errstr = Context::convertEncodingStr($this->errstr); - return new Object($this->errno, $this->errstr); - } - - /** - * @brief query xml 파일을 실행하여 결과를 return - * @param[in] $query_id query id (module.queryname - * @param[in] $args arguments for query - * @return result of query - * @remarks this function finds xml file or cache file of $query_id, compiles it and then execute it - **/ - function executeQuery($query_id, $args = NULL, $arg_columns = NULL) { - if(!$query_id) return new Object(-1, 'msg_invalid_queryid'); - $this->query_id = $query_id; - - $id_args = explode('.', $query_id); - if(count($id_args) == 2) { - $target = 'modules'; - $module = $id_args[0]; - $id = $id_args[1]; - } elseif(count($id_args) == 3) { - $target = $id_args[0]; - if(!in_array($target, array('addons','widgets'))) return; - $module = $id_args[1]; - $id = $id_args[2]; - } - if(!$target || !$module || !$id) return new Object(-1, 'msg_invalid_queryid'); - - $xml_file = sprintf('%s%s/%s/queries/%s.xml', _XE_PATH_, $target, $module, $id); - if(!file_exists($xml_file)) return new Object(-1, 'msg_invalid_queryid'); - - // look for cache file - $cache_file = $this->checkQueryCacheFile($query_id, $xml_file); - - // execute query - return $this->_executeQuery($cache_file, $args, $query_id, $arg_columns); - } - - - /** - * @brief look for cache file - * @param[in] $query_id query id for finding - * @param[in] $xml_file original xml query file - * @return cache file - **/ - function checkQueryCacheFile($query_id,$xml_file){ - - // first try finding cache file - $cache_file = sprintf('%s%s%s.cache.php', _XE_PATH_, $this->cache_file, $query_id); - - if(file_exists($cache_file)) $cache_time = filemtime($cache_file); - else $cache_time = -1; - - // if there is no cache file or is not new, find original xml query file and parse it - if($cache_time < filemtime($xml_file) || $cache_time < filemtime(_XE_PATH_.'classes/db/DB.class.php') || $cache_time < filemtime(_XE_PATH_.'classes/xml/XmlQueryParser.class.php')) { - require_once(_XE_PATH_.'classes/xml/XmlQueryParser.class.php'); - $oParser = new XmlQueryParser(); - $oParser->parse($query_id, $xml_file, $cache_file); - } - - return $cache_file; - } - - - /** - * @brief execute query and return the result - * @param[in] $cache_file cache file of query - * @param[in] $source_args arguments for query - * @param[in] $query_id query id - * @return result of query - **/ - function _executeQuery($cache_file, $source_args, $query_id, $arg_columns) { - global $lang; - - if(!file_exists($cache_file)) return new Object(-1, 'msg_invalid_queryid'); - - if($source_args) $args = @clone($source_args); - - $output = @include($cache_file); - - if( (is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output; - $output->_tables = ($output->_tables && is_array($output->_tables)) ? $output->_tables : array(); - - // execute appropriate query - switch($output->action) { - case 'insert' : - $this->resetCountCache($output->tables); - $output = $this->_executeInsertAct($output); - break; - case 'update' : - $this->resetCountCache($output->tables); - $output = $this->_executeUpdateAct($output); - break; - case 'delete' : - $this->resetCountCache($output->tables); - $output = $this->_executeDeleteAct($output); - break; - case 'select' : - $output->arg_columns = is_array($arg_columns)?$arg_columns:array(); - $output = $this->_executeSelectAct($output); - break; - } - - if($this->isError()) $output = $this->getError(); - else if(!is_a($output, 'Object') && !is_subclass_of($output, 'Object')) $output = new Object(); - $output->add('_query', $this->query); - $output->add('_elapsed_time', sprintf("%0.5f", $this->elapsed_time)); - - return $output; - } - - /** - * @brief check $val with $filter_type - * @param[in] $key key value - * @param[in] $val value of $key - * @param[in] $filter_type type of filter to check $val - * @return object - * @remarks this function is to be used from XmlQueryParser - **/ - function checkFilter($key, $val, $filter_type) { - global $lang; - - switch($filter_type) { - case 'email' : - case 'email_address' : - if(!preg_match('/^[_0-9a-z-]+(\.[_0-9a-z-]+)*@[0-9a-z-]+(\.[0-9a-z-]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_email, $lang->{$key} ? $lang->{$key} : $key)); - break; - case 'homepage' : - if(!preg_match('/^(http|https)+(:\/\/)+[0-9a-z_-]+\.[^ ]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_homepage, $lang->{$key} ? $lang->{$key} : $key)); - break; - case 'userid' : - case 'user_id' : - if(!preg_match('/^[a-zA-Z]+([_0-9a-zA-Z]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_userid, $lang->{$key} ? $lang->{$key} : $key)); - break; - case 'number' : - case 'numbers' : - if(!preg_match('/^(-?)[0-9]+(,\-?[0-9]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_number, $lang->{$key} ? $lang->{$key} : $key)); - break; - case 'alpha' : - if(!preg_match('/^[a-z]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_alpha, $lang->{$key} ? $lang->{$key} : $key)); - break; - case 'alpha_number' : - if(!preg_match('/^[0-9a-z]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_alpha_number, $lang->{$key} ? $lang->{$key} : $key)); - break; - } - - return new Object(); - } - - /** - * @brief returns type of column - * @param[in] $column_type_list list of column type - * @param[in] $name name of column type - * @return column type of $name - * @remarks columns are usually like a.b, so it needs another function - **/ - function getColumnType($column_type_list, $name) { - if(strpos($name, '.') === false) return $column_type_list[$name]; - list($prefix, $name) = explode('.', $name); - return $column_type_list[$name]; - } - - /** - * @brief returns the value of condition - * @param[in] $name name of condition - * @param[in] $value value of condition - * @param[in] $operation operation this is used in condition - * @param[in] $type type of condition - * @param[in] $column_type type of column - * @return well modified $value - * @remarks if $operation is like or like_prefix, $value itself will be modified - * @remarks if $type is not 'number', call addQuotes() and wrap with ' ' - **/ - function getConditionValue($name, $value, $operation, $type, $column_type) { - - if(!in_array($operation,array('in','notin','between')) && $type == 'number') { - if(is_array($value)){ - $value = join(',',$value); - } - if(strpos($value, ',') === false && strpos($value, '(') === false) return (int)$value; - return $value; - } - - if(!is_array($value) && strpos($name, '.') !== false && strpos($value, '.') !== false) { - list($table_name, $column_name) = explode('.', $value); - if($column_type[$column_name]) return $value; - } - - switch($operation) { - case 'like_prefix' : - if(!is_array($value)) $value = preg_replace('/(^\'|\'$){1}/', '', $value); - $value = $value.'%'; - break; - case 'like_tail' : - if(!is_array($value)) $value = preg_replace('/(^\'|\'$){1}/', '', $value); - $value = '%'.$value; - break; - case 'like' : - if(!is_array($value)) $value = preg_replace('/(^\'|\'$){1}/', '', $value); - $value = '%'.$value.'%'; - break; - case 'notin' : - if(is_array($value)) - { - $value = $this->addQuotesArray($value); - if($type=='number') return join(',',$value); - else return "'". join("','",$value)."'"; - } - else - { - return $value; - } - break; - case 'in' : - if(is_array($value)) - { - $value = $this->addQuotesArray($value); - if($type=='number') return join(',',$value); - else return "'". join("','",$value)."'"; - } - else - { - return $value; - } - break; - case 'between' : - if(!is_array($value)) $value = array($value); - $value = $this->addQuotesArray($value); - if($type!='number') - { - foreach($value as $k=>$v) - { - $value[$k] = "'".$v."'"; - } - } - - return $value; - break; - default: - if(!is_array($value)) $value = preg_replace('/(^\'|\'$){1}/', '', $value); - } - - return "'".$this->addQuotes($value)."'"; - } - - /** - * @brief returns part of condition - * @param[in] $name name of condition - * @param[in] $value value of condition - * @param[in] $operation operation that is used in condition - * @return detail condition - **/ - function getConditionPart($name, $value, $operation) { - switch($operation) { - case 'equal' : - case 'more' : - case 'excess' : - case 'less' : - case 'below' : - case 'like_tail' : - case 'like_prefix' : - case 'like' : - case 'in' : - case 'notin' : - case 'notequal' : - // if variable is not set or is not string or number, return - if(!isset($value)) return; - if($value === '') return; - if(!in_array(gettype($value), array('string', 'integer'))) return; - break; - case 'between' : - if(!is_array($value)) return; - if(count($value)!=2) return; - - } - - switch($operation) { - case 'equal' : - return $name.' = '.$value; - break; - case 'more' : - return $name.' >= '.$value; - break; - case 'excess' : - return $name.' > '.$value; - break; - case 'less' : - return $name.' <= '.$value; - break; - case 'below' : - return $name.' < '.$value; - break; - case 'like_tail' : - case 'like_prefix' : - case 'like' : - return $name.' like '.$value; - break; - case 'in' : - return $name.' in ('.$value.')'; - break; - case 'notin' : - return $name.' not in ('.$value.')'; - break; - case 'notequal' : - return $name.' <> '.$value; - break; - case 'notnull' : - return $name.' is not null'; - break; - case 'null' : - return $name.' is null'; - break; - case 'between' : - return $name.' between ' . $value[0] . ' and ' . $value[1]; - break; - } - } - - /** - * @brief returns condition key - * @param[in] $output result of query - * @return array of conditions of $output - **/ - function getConditionList($output) { - $conditions = array(); - if(count($output->conditions)) { - foreach($output->conditions as $key => $val) { - if($val['condition']) { - foreach($val['condition'] as $k => $v) { - $conditions[] = $v['column']; - } - } - } - } - - return $conditions; - } - - /** - * @brief returns counter cache data - * @param[in] $tables tables to get data - * @param[in] $condition condition to get data - * @return count of cache data - **/ - function getCountCache($tables, $condition) { - return false; - if(!$tables) return false; - if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path); - - $condition = md5($condition); - - if(!is_array($tables)) $tables_str = $tables; - else $tables_str = implode('.',$tables); - - $cache_path = sprintf('%s/%s%s', $this->count_cache_path, $this->prefix, $tables_str); - if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); - - $cache_filename = sprintf('%s/%s.%s', $cache_path, $tables_str, $condition); - if(!file_exists($cache_filename)) return false; - - $cache_mtime = filemtime($cache_filename); - - if(!is_array($tables)) $tables = array($tables); - foreach($tables as $alias => $table) { - $table_filename = sprintf('%s/cache.%s%s', $this->count_cache_path, $this->prefix, $table) ; - if(!file_exists($table_filename) || filemtime($table_filename) > $cache_mtime) return false; - } - - $count = (int)FileHandler::readFile($cache_filename); - return $count; - } - - /** - * @brief save counter cache data - * @param[in] $tables tables to save data - * @param[in] $condition condition to save data - * @param[in] $count count of cache data to save - * @return none - **/ - function putCountCache($tables, $condition, $count = 0) { - return false; - if(!$tables) return false; - if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path); - - $condition = md5($condition); - - if(!is_array($tables)) $tables_str = $tables; - else $tables_str = implode('.',$tables); - - $cache_path = sprintf('%s/%s%s', $this->count_cache_path, $this->prefix, $tables_str); - if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); - - $cache_filename = sprintf('%s/%s.%s', $cache_path, $tables_str, $condition); - - FileHandler::writeFile($cache_filename, $count); - } - - /** - * @brief reset counter cache data - * @param[in] $tables tables to reset cache data - * @return true: success, false: failed - **/ - function resetCountCache($tables) { - return false; - if(!$tables) return false; - if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path); - - if(!is_array($tables)) $tables = array($tables); - foreach($tables as $alias => $table) { - $filename = sprintf('%s/cache.%s%s', $this->count_cache_path, $this->prefix, $table); - FileHandler::removeFile($filename); - FileHandler::writeFile($filename, ''); - } - - return true; - } - - /** - * @brief returns supported database list - * @return list of supported database - **/ - function getSupportedDatabase(){ - $result = array(); - - if(function_exists('mysql_connect')) $result[] = 'MySQL'; - if(function_exists('cubrid_connect')) $result[] = 'Cubrid'; - if(function_exists('ibase_connect')) $result[] = 'FireBird'; - if(function_exists('pg_connect')) $result[] = 'Postgre'; - if(function_exists('sqlite_open')) $result[] = 'sqlite2'; - if(function_exists('mssql_connect')) $result[] = 'MSSQL'; - if(function_exists('PDO')) $result[] = 'sqlite3(PDO)'; - - return $result; - } - - function dropTable($table_name){ - if(!$table_name) return; - $query = sprintf("drop table %s%s", $this->prefix, $table_name); - $this->_query($query); - } - - function addQuotesArray($arr) - { - if(is_array($arr)) - { - foreach($arr as $k => $v) - { - $arr[$k] = $this->addQuotes($v); - } - } - else - { - $arr = $this->addQuotes($arr); - } - - return $arr; - } - } -?> + '=', + 'more' => '>=', + 'excess' => '>', + 'less' => '<=', + 'below' => '<', + 'notequal' => '<>', + 'notnull' => 'is not null', + 'null' => 'is null', + ); + + var $fd = NULL; ///< connector resource or file description + + var $result = NULL; ///< result + + var $errno = 0; ///< error code (0 means no error) + var $errstr = ''; ///< error message + var $query = ''; ///< query string of latest executed query + var $elapsed_time = 0; ///< elapsed time of latest executed query + + var $transaction_started = false; ///< transaction flag + + var $is_connected = false; ///< is db connected + + var $supported_list = array(); ///< list of supported db, (will be written by classes/DB/DB***.class.php) + + var $cache_file = 'files/cache/queries/'; ///< location of query cache + + /** + * @brief returns instance of certain db type + * @param[in] $db_type type of db + * @return instance + **/ + function &getInstance($db_type = NULL) { + if(!$db_type) $db_type = Context::getDBType(); + if(!$db_type && Context::isInstalled()) return new Object(-1, 'msg_db_not_setted'); + + if(!$GLOBALS['__DB__']) { + $class_name = 'DB'.ucfirst($db_type); + $class_file = _XE_PATH_."classes/db/$class_name.class.php"; + if(!file_exists($class_file)) return new Object(-1, 'msg_db_not_setted'); + + // get a singletone instance of the database driver class + require_once($class_file); + $GLOBALS['__DB__'][$db_type] = call_user_func(array($class_name, 'create')); + } + + return $GLOBALS['__DB__'][$db_type]; + } + + function create() { + return new DB; + } + + /** + * @brief constructor + * @return none + **/ + function DB() { + $this->count_cache_path = _XE_PATH_.$this->count_cache_path; + $this->cache_file = _XE_PATH_.$this->cache_file; + } + + /** + * @brief returns list of supported db + * @return list of supported db + **/ + function getSupportedList() { + $oDB = new DB(); + return $oDB->_getSupportedList(); + } + + /** + * @brief returns list of supported db + * @return list of supported db + **/ + function _getSupportedList() { + $db_classes_path = _XE_PATH_."classes/db/"; + $filter = "/^DB([^\.]+)\.class\.php/i"; + $supported_list = FileHandler::readDir($db_classes_path, $filter, true); + sort($supported_list); + + // after creating instance of class, check is supported + for($i = 0; $i < count($supported_list); $i++) { + $db_type = $supported_list[$i]; + + if(version_compare(phpversion(), '5.0') < 0 && preg_match('/pdo/i',$db_type)) continue; + + $class_name = sprintf("DB%s%s", strtoupper(substr($db_type,0,1)), strtolower(substr($db_type,1))); + $class_file = sprintf(_XE_PATH_."classes/db/%s.class.php", $class_name); + if(!file_exists($class_file)) continue; + + unset($oDB); + require_once($class_file); + $tmp_fn = create_function('', "return new {$class_name}();"); + $oDB = $tmp_fn(); + + if(!$oDB) continue; + + $obj = null; + $obj->db_type = $db_type; + $obj->enable = $oDB->isSupported() ? true : false; + + $this->supported_list[] = $obj; + } + + return $this->supported_list; + } + + /** + * @brief check if the db_type is supported + * @param[in] $db_type type of db to check + * @return true: is supported, false: is not supported + **/ + function isSupported($db_type) { + $supported_list = DB::getSupportedList(); + return in_array($db_type, $supported_list); + } + + /** + * @brief check if is connected + * @return true: connected, false: not connected + **/ + function isConnected() { + return $this->is_connected ? true : false; + } + + /** + * @brief start recording log + * @return none + **/ + function actStart($query) { + $this->setError(0, 'success'); + $this->query = $query; + $this->act_start = getMicroTime(); + $this->elapsed_time = 0; + } + + /** + * @brief finish recording log + * @return none + **/ + function actFinish() { + if(!$this->query) return; + $this->act_finish = getMicroTime(); + $elapsed_time = $this->act_finish - $this->act_start; + $this->elapsed_time = $elapsed_time; + $GLOBALS['__db_elapsed_time__'] += $elapsed_time; + + $log['query'] = $this->query; + $log['elapsed_time'] = $elapsed_time; + + // leave error log if an error occured (if __DEBUG_DB_OUTPUT__ is defined) + if($this->isError()) { + $site_module_info = Context::get('site_module_info'); + $log['module'] = $site_module_info->module; + $log['act'] = Context::get('act'); + $log['query_id'] = $this->query_id; + $log['time'] = date('Y-m-d H:i:s'); + $log['result'] = 'Failed'; + $log['errno'] = $this->errno; + $log['errstr'] = $this->errstr; + + if(__DEBUG_DB_OUTPUT__ == 1) { + $debug_file = _XE_PATH_."files/_debug_db_query.php"; + $buff = array(); + if(!file_exists($debug_file)) $buff[] = ''; + $buff[] = print_r($log, true); + + if(@!$fp = fopen($debug_file, "a")) return; + fwrite($fp, implode("\n", $buff)."\n\n"); + fclose($fp); + } + } else { + $log['result'] = 'Success'; + } + $GLOBALS['__db_queries__'][] = $log; + + // if __LOG_SLOW_QUERY__ if defined, check elapsed time and leave query log + if(__LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__) { + $buff = ''; + $log_file = _XE_PATH_.'files/_db_slow_query.php'; + if(!file_exists($log_file)) { + $buff = ''."\n"; + } + + $buff .= sprintf("%s\t%s\n\t%0.6f sec\tquery_id:%s\n\n", date("Y-m-d H:i"), $this->query, $elapsed_time, $this->query_id); + + if($fp = fopen($log_file, 'a')) { + fwrite($fp, $buff); + fclose($fp); + } + } + } + + /** + * @brief set error + * @param[in] $errno error code + * @param[in] $errstr error message + * @return none + **/ + function setError($errno = 0, $errstr = 'success') { + $this->errno = $errno; + $this->errstr = $errstr; + } + + /** + * @brief check if an error occured + * @return true: error, false: no error + **/ + function isError() { + return $this->errno === 0 ? false : true; + } + + /** + * @brief returns object of error info + * @return object of error + **/ + function getError() { + $this->errstr = Context::convertEncodingStr($this->errstr); + return new Object($this->errno, $this->errstr); + } + + /** + * @brief query xml 파일을 실행하여 결과를 return + * @param[in] $query_id query id (module.queryname + * @param[in] $args arguments for query + * @return result of query + * @remarks this function finds xml file or cache file of $query_id, compiles it and then execute it + **/ + function executeQuery($query_id, $args = NULL, $arg_columns = NULL) { + if(!$query_id) return new Object(-1, 'msg_invalid_queryid'); + $this->query_id = $query_id; + + $id_args = explode('.', $query_id); + if(count($id_args) == 2) { + $target = 'modules'; + $module = $id_args[0]; + $id = $id_args[1]; + } elseif(count($id_args) == 3) { + $target = $id_args[0]; + if(!in_array($target, array('addons','widgets'))) return; + $module = $id_args[1]; + $id = $id_args[2]; + } + if(!$target || !$module || !$id) return new Object(-1, 'msg_invalid_queryid'); + + $xml_file = sprintf('%s%s/%s/queries/%s.xml', _XE_PATH_, $target, $module, $id); + if(!file_exists($xml_file)) return new Object(-1, 'msg_invalid_queryid'); + + // look for cache file + $cache_file = $this->checkQueryCacheFile($query_id, $xml_file); + + // execute query + return $this->_executeQuery($cache_file, $args, $query_id, $arg_columns); + } + + + /** + * @brief look for cache file + * @param[in] $query_id query id for finding + * @param[in] $xml_file original xml query file + * @return cache file + **/ + function checkQueryCacheFile($query_id,$xml_file){ + + // first try finding cache file + $cache_file = sprintf('%s%s%s.cache.php', _XE_PATH_, $this->cache_file, $query_id); + + if(file_exists($cache_file)) $cache_time = filemtime($cache_file); + else $cache_time = -1; + + // if there is no cache file or is not new, find original xml query file and parse it + if($cache_time < filemtime($xml_file) || $cache_time < filemtime(_XE_PATH_.'classes/db/DB.class.php') || $cache_time < filemtime(_XE_PATH_.'classes/xml/XmlQueryParser.class.php')) { + require_once(_XE_PATH_.'classes/xml/XmlQueryParser.class.php'); + $oParser = new XmlQueryParser(); + $oParser->parse($query_id, $xml_file, $cache_file); + } + + return $cache_file; + } + + + /** + * @brief execute query and return the result + * @param[in] $cache_file cache file of query + * @param[in] $source_args arguments for query + * @param[in] $query_id query id + * @return result of query + **/ + function _executeQuery($cache_file, $source_args, $query_id, $arg_columns) { + global $lang; + + if(!file_exists($cache_file)) return new Object(-1, 'msg_invalid_queryid'); + + if($source_args) $args = @clone($source_args); + + $output = @include($cache_file); + + if( (is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output; + $output->_tables = ($output->_tables && is_array($output->_tables)) ? $output->_tables : array(); + + // execute appropriate query + switch($output->action) { + case 'insert' : + $this->resetCountCache($output->tables); + $output = $this->_executeInsertAct($output); + break; + case 'update' : + $this->resetCountCache($output->tables); + $output = $this->_executeUpdateAct($output); + break; + case 'delete' : + $this->resetCountCache($output->tables); + $output = $this->_executeDeleteAct($output); + break; + case 'select' : + $output->arg_columns = is_array($arg_columns)?$arg_columns:array(); + $output = $this->_executeSelectAct($output); + break; + } + + if($this->isError()) $output = $this->getError(); + else if(!is_a($output, 'Object') && !is_subclass_of($output, 'Object')) $output = new Object(); + $output->add('_query', $this->query); + $output->add('_elapsed_time', sprintf("%0.5f", $this->elapsed_time)); + + return $output; + } + + /** + * @brief check $val with $filter_type + * @param[in] $key key value + * @param[in] $val value of $key + * @param[in] $filter_type type of filter to check $val + * @return object + * @remarks this function is to be used from XmlQueryParser + **/ + function checkFilter($key, $val, $filter_type) { + global $lang; + + switch($filter_type) { + case 'email' : + case 'email_address' : + if(!preg_match('/^[_0-9a-z-]+(\.[_0-9a-z-]+)*@[0-9a-z-]+(\.[0-9a-z-]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_email, $lang->{$key} ? $lang->{$key} : $key)); + break; + case 'homepage' : + if(!preg_match('/^(http|https)+(:\/\/)+[0-9a-z_-]+\.[^ ]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_homepage, $lang->{$key} ? $lang->{$key} : $key)); + break; + case 'userid' : + case 'user_id' : + if(!preg_match('/^[a-zA-Z]+([_0-9a-zA-Z]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_userid, $lang->{$key} ? $lang->{$key} : $key)); + break; + case 'number' : + case 'numbers' : + if(!preg_match('/^(-?)[0-9]+(,\-?[0-9]+)*$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_number, $lang->{$key} ? $lang->{$key} : $key)); + break; + case 'alpha' : + if(!preg_match('/^[a-z]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_alpha, $lang->{$key} ? $lang->{$key} : $key)); + break; + case 'alpha_number' : + if(!preg_match('/^[0-9a-z]+$/is', $val)) return new Object(-1, sprintf($lang->filter->invalid_alpha_number, $lang->{$key} ? $lang->{$key} : $key)); + break; + } + + return new Object(); + } + + /** + * @brief returns type of column + * @param[in] $column_type_list list of column type + * @param[in] $name name of column type + * @return column type of $name + * @remarks columns are usually like a.b, so it needs another function + **/ + function getColumnType($column_type_list, $name) { + if(strpos($name, '.') === false) return $column_type_list[$name]; + list($prefix, $name) = explode('.', $name); + return $column_type_list[$name]; + } + + /** + * @brief returns the value of condition + * @param[in] $name name of condition + * @param[in] $value value of condition + * @param[in] $operation operation this is used in condition + * @param[in] $type type of condition + * @param[in] $column_type type of column + * @return well modified $value + * @remarks if $operation is like or like_prefix, $value itself will be modified + * @remarks if $type is not 'number', call addQuotes() and wrap with ' ' + **/ + function getConditionValue($name, $value, $operation, $type, $column_type) { + + if(!in_array($operation,array('in','notin','between')) && $type == 'number') { + if(is_array($value)){ + $value = join(',',$value); + } + if(strpos($value, ',') === false && strpos($value, '(') === false) return (int)$value; + return $value; + } + + if(!is_array($value) && strpos($name, '.') !== false && strpos($value, '.') !== false) { + list($table_name, $column_name) = explode('.', $value); + if($column_type[$column_name]) return $value; + } + + switch($operation) { + case 'like_prefix' : + if(!is_array($value)) $value = preg_replace('/(^\'|\'$){1}/', '', $value); + $value = $value.'%'; + break; + case 'like_tail' : + if(!is_array($value)) $value = preg_replace('/(^\'|\'$){1}/', '', $value); + $value = '%'.$value; + break; + case 'like' : + if(!is_array($value)) $value = preg_replace('/(^\'|\'$){1}/', '', $value); + $value = '%'.$value.'%'; + break; + case 'notin' : + if(is_array($value)) + { + $value = $this->addQuotesArray($value); + if($type=='number') return join(',',$value); + else return "'". join("','",$value)."'"; + } + else + { + return $value; + } + break; + case 'in' : + if(is_array($value)) + { + $value = $this->addQuotesArray($value); + if($type=='number') return join(',',$value); + else return "'". join("','",$value)."'"; + } + else + { + return $value; + } + break; + case 'between' : + if(!is_array($value)) $value = array($value); + $value = $this->addQuotesArray($value); + if($type!='number') + { + foreach($value as $k=>$v) + { + $value[$k] = "'".$v."'"; + } + } + + return $value; + break; + default: + if(!is_array($value)) $value = preg_replace('/(^\'|\'$){1}/', '', $value); + } + + return "'".$this->addQuotes($value)."'"; + } + + /** + * @brief returns part of condition + * @param[in] $name name of condition + * @param[in] $value value of condition + * @param[in] $operation operation that is used in condition + * @return detail condition + **/ + function getConditionPart($name, $value, $operation) { + switch($operation) { + case 'equal' : + case 'more' : + case 'excess' : + case 'less' : + case 'below' : + case 'like_tail' : + case 'like_prefix' : + case 'like' : + case 'in' : + case 'notin' : + case 'notequal' : + // if variable is not set or is not string or number, return + if(!isset($value)) return; + if($value === '') return; + if(!in_array(gettype($value), array('string', 'integer'))) return; + break; + case 'between' : + if(!is_array($value)) return; + if(count($value)!=2) return; + + } + + switch($operation) { + case 'equal' : + return $name.' = '.$value; + break; + case 'more' : + return $name.' >= '.$value; + break; + case 'excess' : + return $name.' > '.$value; + break; + case 'less' : + return $name.' <= '.$value; + break; + case 'below' : + return $name.' < '.$value; + break; + case 'like_tail' : + case 'like_prefix' : + case 'like' : + return $name.' like '.$value; + break; + case 'in' : + return $name.' in ('.$value.')'; + break; + case 'notin' : + return $name.' not in ('.$value.')'; + break; + case 'notequal' : + return $name.' <> '.$value; + break; + case 'notnull' : + return $name.' is not null'; + break; + case 'null' : + return $name.' is null'; + break; + case 'between' : + return $name.' between ' . $value[0] . ' and ' . $value[1]; + break; + } + } + + /** + * @brief returns condition key + * @param[in] $output result of query + * @return array of conditions of $output + **/ + function getConditionList($output) { + $conditions = array(); + if(count($output->conditions)) { + foreach($output->conditions as $key => $val) { + if($val['condition']) { + foreach($val['condition'] as $k => $v) { + $conditions[] = $v['column']; + } + } + } + } + + return $conditions; + } + + /** + * @brief returns counter cache data + * @param[in] $tables tables to get data + * @param[in] $condition condition to get data + * @return count of cache data + **/ + function getCountCache($tables, $condition) { + return false; + if(!$tables) return false; + if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path); + + $condition = md5($condition); + + if(!is_array($tables)) $tables_str = $tables; + else $tables_str = implode('.',$tables); + + $cache_path = sprintf('%s/%s%s', $this->count_cache_path, $this->prefix, $tables_str); + if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); + + $cache_filename = sprintf('%s/%s.%s', $cache_path, $tables_str, $condition); + if(!file_exists($cache_filename)) return false; + + $cache_mtime = filemtime($cache_filename); + + if(!is_array($tables)) $tables = array($tables); + foreach($tables as $alias => $table) { + $table_filename = sprintf('%s/cache.%s%s', $this->count_cache_path, $this->prefix, $table) ; + if(!file_exists($table_filename) || filemtime($table_filename) > $cache_mtime) return false; + } + + $count = (int)FileHandler::readFile($cache_filename); + return $count; + } + + /** + * @brief save counter cache data + * @param[in] $tables tables to save data + * @param[in] $condition condition to save data + * @param[in] $count count of cache data to save + * @return none + **/ + function putCountCache($tables, $condition, $count = 0) { + return false; + if(!$tables) return false; + if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path); + + $condition = md5($condition); + + if(!is_array($tables)) $tables_str = $tables; + else $tables_str = implode('.',$tables); + + $cache_path = sprintf('%s/%s%s', $this->count_cache_path, $this->prefix, $tables_str); + if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); + + $cache_filename = sprintf('%s/%s.%s', $cache_path, $tables_str, $condition); + + FileHandler::writeFile($cache_filename, $count); + } + + /** + * @brief reset counter cache data + * @param[in] $tables tables to reset cache data + * @return true: success, false: failed + **/ + function resetCountCache($tables) { + return false; + if(!$tables) return false; + if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path); + + if(!is_array($tables)) $tables = array($tables); + foreach($tables as $alias => $table) { + $filename = sprintf('%s/cache.%s%s', $this->count_cache_path, $this->prefix, $table); + FileHandler::removeFile($filename); + FileHandler::writeFile($filename, ''); + } + + return true; + } + + /** + * @brief returns supported database list + * @return list of supported database + **/ + function getSupportedDatabase(){ + $result = array(); + + if(function_exists('mysql_connect')) $result[] = 'MySQL'; + if(function_exists('cubrid_connect')) $result[] = 'Cubrid'; + if(function_exists('ibase_connect')) $result[] = 'FireBird'; + if(function_exists('pg_connect')) $result[] = 'Postgre'; + if(function_exists('sqlite_open')) $result[] = 'sqlite2'; + if(function_exists('mssql_connect')) $result[] = 'MSSQL'; + if(function_exists('PDO')) $result[] = 'sqlite3(PDO)'; + + return $result; + } + + function dropTable($table_name){ + if(!$table_name) return; + $query = sprintf("drop table %s%s", $this->prefix, $table_name); + $this->_query($query); + } + + function addQuotesArray($arr) + { + if(is_array($arr)) + { + foreach($arr as $k => $v) + { + $arr[$k] = $this->addQuotes($v); + } + } + else + { + $arr = $this->addQuotes($arr); + } + + return $arr; + } + } +?> diff --git a/classes/db/DBCubrid.class.php b/classes/db/DBCubrid.class.php index 2de93e28e..493db32bb 100644 --- a/classes/db/DBCubrid.class.php +++ b/classes/db/DBCubrid.class.php @@ -1,1257 +1,1257 @@ - 'numeric(20)', - 'number' => 'integer', - 'varchar' => 'character varying', - 'char' => 'character', - 'tinytext' => 'character varying(256)', - 'text' => 'character varying(1073741823)', - 'bigtext' => 'character varying(1073741823)', - 'date' => 'character varying(14)', - 'float' => 'float', - ); - - /** - * @brief constructor - **/ - function DBCubrid() - { - $this->_setDBInfo(); - $this->_connect(); - } - - /** - * @brief create an instance of this class - */ - function create() - { - return new DBCubrid; - } - - /** - * @brief 설치 가능 여부를 return - **/ - function isSupported() - { - if (!function_exists('cubrid_connect')) return false; - return true; - } - - /** - * @brief DB정보 설정 및 connect/ close - **/ - function _setDBInfo() - { - $db_info = Context::getDBInfo(); - $this->hostname = $db_info->db_hostname; - $this->userid = $db_info->db_userid; - $this->password = $db_info->db_password; - $this->database = $db_info->db_database; - $this->port = $db_info->db_port; - $this->prefix = $db_info->db_table_prefix; - - if (!substr($this->prefix, -1) != '_') $this->prefix .= '_'; - } - - /** - * @brief DB 접속 - **/ - function _connect() - { - // db 정보가 없으면 무시 - if (!$this->hostname || !$this->userid || !$this->password || !$this->database || !$this->port) return; - - // 접속시도 - $this->fd = @cubrid_connect ($this->hostname, $this->port, $this->database, $this->userid, $this->password); - - // 접속체크 - if (!$this->fd) { - $this->setError (-1, 'database connect fail'); - return $this->is_connected = false; - } - - $this->is_connected = true; - $this->password = md5 ($this->password); - } - - /** - * @brief DB접속 해제 - **/ - function close() - { - if (!$this->isConnected ()) return; - - @cubrid_commit ($this->fd); - @cubrid_disconnect ($this->fd); - $this->transaction_started = false; - } - - /** - * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 - **/ - function addQuotes($string) - { - if (!$this->fd) return $string; - - if (version_compare (PHP_VERSION, "5.9.0", "<") && - get_magic_quotes_gpc ()) { - $string = stripslashes (str_replace ("\\","\\\\", $string)); - } - - if (!is_numeric ($string)) { - /* - if ($this->isConnected()) { - $string = cubrid_real_escape_string($string); - } - else { - $string = str_replace("'","\'",$string); - } - */ - - $string = str_replace("'","''",$string); - } - - return $string; - } - - /** - * @brief 트랜잭션 시작 - **/ - function begin() - { - if (!$this->isConnected () || $this->transaction_started) return; - $this->transaction_started = true; - } - - /** - * @brief 롤백 - **/ - function rollback() - { - if (!$this->isConnected () || !$this->transaction_started) return; - @cubrid_rollback ($this->fd); - $this->transaction_started = false; - } - - /** - * @brief 커밋 - **/ - function commit() - { - if (!$force && (!$this->isConnected () || - !$this->transaction_started)) return; - - @cubrid_commit($this->fd); - $this->transaction_started = false; - } - - /** - * @brief : 쿼리문의 실행 및 결과의 fetch 처리 - * - * query : query문 실행하고 result return\n - * fetch : reutrn 된 값이 없으면 NULL\n - * rows이면 array object\n - * row이면 object\n - * return\n - **/ - function _query($query) - { - if (!$query || !$this->isConnected ()) return; - - // 쿼리 시작을 알림 - $this->actStart ($query); - - // 쿼리 문 실행 - $result = @cubrid_execute ($this->fd, $query); - // 오류 체크 - if (cubrid_error_code ()) { - $code = cubrid_error_code (); - $msg = cubrid_error_msg (); - - $this->setError ($code, $msg); - } - - // 쿼리 실행 종료를 알림 - $this->actFinish (); - - // 결과 리턴 - return $result; - } - - /** - * @brief 결과를 fetch - **/ - function _fetch($result) - { - if (!$this->isConnected() || $this->isError() || !$result) return; - - $col_types = cubrid_column_types ($result); - $col_names = cubrid_column_names ($result); - $max = count ($col_types); - - for ($count = 0; $count < $max; $count++) { - if (preg_match ("/^char/", $col_types[$count]) > 0) { - $char_type_fields[] = $col_names[$count]; - } - } - - while ($tmp = cubrid_fetch ($result, CUBRID_OBJECT)) { - if (is_array ($char_type_fields)) { - foreach ($char_type_fields as $val) { - $tmp->{$val} = rtrim ($tmp->{$val}); - } - } - - $output[] = $tmp; - } - - unset ($char_type_fields); - - if ($result) cubrid_close_request($result); - - if (count ($output) == 1) return $output[0]; - return $output; - } - - /** - * @brief 1씩 증가되는 sequence 값을 return (cubrid의 auto_increment는 sequence테이블에서만 사용) - **/ - function getNextSequence() - { - $this->_makeSequence(); - - $query = sprintf ("select \"%ssequence\".\"nextval\" as \"seq\" from db_root", $this->prefix); - $result = $this->_query($query); - $output = $this->_fetch($result); - - return $output->seq; - } - - /** - * @brief 마이그레이션시 sequence 가 없을 경우 생성 - **/ - function _makeSequence() - { - if($_GLOBALS['XE_EXISTS_SEQUENCE']) return; - - // check cubrid serial - $query = sprintf('select count(*) as "count" from "db_serial" where name=\'%ssequence\'', $this->prefix); - $result = $this->_query($query); - $output = $this->_fetch($result); - - // if do not create serial - if ($output->count == 0) { - $query = sprintf('select max("a"."srl") as "srl" from '. - '( select max("document_srl") as "srl" from '. - '"%sdocuments" UNION '. - 'select max("comment_srl") as "srl" from '. - '"%scomments" UNION '. - 'select max("member_srl") as "srl" from '. - '"%smember"'. - ') as "a"', $this->prefix, $this->prefix, $this->prefix); - - $result = $this->_query($query); - $output = $this->_fetch($result); - $srl = $output->srl; - if ($srl < 1) { - $start = 1; - } - else { - $start = $srl + 1000000; - } - - // create sequence - $query = sprintf('create serial "%ssequence" start with %s increment by 1 minvalue 1 maxvalue 10000000000000000000000000000000000000 nocycle;', $this->prefix, $start); - $this->_query($query); - } - - $_GLOBALS['XE_EXISTS_SEQUENCE'] = true; - } - - - /** - * @brief 테이블 기생성 여부 return - **/ - function isTableExists ($target_name) - { - if($target_name == 'sequence') { - $query = sprintf ("select \"name\" from \"db_serial\" where \"name\" = '%s%s'", $this->prefix, $target_name); - } - else { - $query = sprintf ("select \"class_name\" from \"db_class\" where \"class_name\" = '%s%s'", $this->prefix, $target_name); - } - - $result = $this->_query ($query); - if (cubrid_num_rows($result) > 0) { - $output = true; - } - else { - $output = false; - } - - if ($result) cubrid_close_request ($result); - - return $output; - } - - /** - * @brief 특정 테이블에 특정 column 추가 - **/ - function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = '', $notnull = false) - { - $type = strtoupper($this->column_type[$type]); - if ($type == 'INTEGER') $size = ''; - - $query = sprintf ("alter class \"%s%s\" add \"%s\" ", $this->prefix, $table_name, $column_name); - - if ($type == 'char' || $type == 'varchar') { - if ($size) $size = $size * 3; - } - - if ($size) { - $query .= sprintf ("%s(%s) ", $type, $size); - } - else { - $query .= sprintf ("%s ", $type); - } - - if ($default) { - if ($type == 'INTEGER' || $type == 'BIGINT' || $type=='INT') { - $query .= sprintf ("default %d ", $default); - } - else { - $query .= sprintf ("default '%s' ", $default); - } - } - - if ($notnull) $query .= "not null "; - - $this->_query ($query); - } - - /** - * @brief 특정 테이블에 특정 column 제거 - **/ - function dropColumn ($table_name, $column_name) - { - $query = sprintf ("alter class \"%s%s\" drop \"%s\" ", $this->prefix, $table_name, $column_name); - - $this->_query ($query); - } - - /** - * @brief 특정 테이블의 column의 정보를 return - **/ - function isColumnExists ($table_name, $column_name) - { - $query = sprintf ("select \"attr_name\" from \"db_attribute\" where ". "\"attr_name\" ='%s' and \"class_name\" = '%s%s'", $column_name, $this->prefix, $table_name); - $result = $this->_query ($query); - - if (cubrid_num_rows ($result) > 0) $output = true; - else $output = false; - - if ($result) cubrid_close_request ($result); - - return $output; - } - - /** - * @brief 특정 테이블에 특정 인덱스 추가 - * $target_columns = array(col1, col2) - * $is_unique? unique : none - **/ - function addIndex ($table_name, $index_name, $target_columns, $is_unique = false) - { - if (!is_array ($target_columns)) { - $target_columns = array ($target_columns); - } - - $query = sprintf ("create %s index \"%s\" on \"%s%s\" (%s);", $is_unique?'unique':'', $this->prefix .$index_name, $this->prefix, $table_name, '"'.implode('","',$target_columns).'"'); - - $this->_query ($query); - } - - /** - * @brief 특정 테이블의 특정 인덱스 삭제 - **/ - function dropIndex ($table_name, $index_name, $is_unique = false) - { - $query = sprintf ("drop %s index \"%s\" on \"%s%s\"", $is_unique?'unique':'', $this->prefix .$index_name, $this->prefix, $table_name); - - $this->_query($query); - } - - /** - * @brief 특정 테이블의 index 정보를 return - **/ - function isIndexExists ($table_name, $index_name) - { - $query = sprintf ("select \"index_name\" from \"db_index\" where ". "\"class_name\" = '%s%s' and \"index_name\" = '%s' ", $this->prefix, $table_name, $this->prefix .$index_name); - $result = $this->_query ($query); - - if ($this->isError ()) return false; - - $output = $this->_fetch ($result); - - if (!$output) return false; - return true; - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXml ($xml_doc) - { - return $this->_createTable ($xml_doc); - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXmlFile ($file_name) - { - if (!file_exists ($file_name)) return; - // xml 파일을 읽음 - $buff = FileHandler::readFile ($file_name); - - return $this->_createTable ($buff); - } - - /** - * @brief schema xml을 이용하여 create class query생성 - * - * type : number, varchar, tinytext, text, bigtext, char, date, \n - * opt : notnull, default, size\n - * index : primary key, index, unique\n - **/ - function _createTable ($xml_doc) - { - // xml parsing - $oXml = new XmlParser(); - $xml_obj = $oXml->parse($xml_doc); - - // 테이블 생성 schema 작성 - $table_name = $xml_obj->table->attrs->name; - - // if the table already exists exit function - if ($this->isTableExists($table_name)) return; - - // 만약 테이블 이름이 sequence라면 serial 생성 - if ($table_name == 'sequence') { - $query = sprintf ('create serial "%s" start with 1 increment by 1'. - ' minvalue 1 '. - 'maxvalue 10000000000000000000000000000000000000'. ' nocycle;', $this->prefix.$table_name); - - return $this->_query($query); - } - - - $table_name = $this->prefix.$table_name; - - $query = sprintf ('create class "%s";', $table_name); - $this->_query ($query); - - if (!is_array ($xml_obj->table->column)) { - $columns[] = $xml_obj->table->column; - } - else { - $columns = $xml_obj->table->column; - } - - $query = sprintf ("alter class \"%s\" add attribute ", $table_name); - - foreach ($columns as $column) { - $name = $column->attrs->name; - $type = $column->attrs->type; - $size = $column->attrs->size; - $notnull = $column->attrs->notnull; - $primary_key = $column->attrs->primary_key; - $index = $column->attrs->index; - $unique = $column->attrs->unique; - $default = $column->attrs->default; - - switch ($this->column_type[$type]) { - case 'integer' : - $size = null; - break; - case 'text' : - $size = null; - break; - } - - if (isset ($default) && ($type == 'varchar' || $type == 'char' || - $type == 'text' || $type == 'tinytext' || $type == 'bigtext')) { - $default = sprintf ("'%s'", $default); - } - - if ($type == 'varchar' || $type == 'char') { - if($size) $size = $size * 3; - } - - - $column_schema[] = sprintf ('"%s" %s%s %s %s', - $name, - $this->column_type[$type], - $size?'('.$size.')':'', - isset($default)?"default ".$default:'', - $notnull?'not null':''); - - if ($primary_key) { - $primary_list[] = $name; - } - else if ($unique) { - $unique_list[$unique][] = $name; - } - else if ($index) { - $index_list[$index][] = $name; - } - } - - $query .= implode (',', $column_schema).';'; - $this->_query ($query); - - if (count ($primary_list)) { - $query = sprintf ("alter class \"%s\" add attribute constraint ". "\"pkey_%s\" PRIMARY KEY(%s);", $table_name, $table_name, '"'.implode('","',$primary_list).'"'); - $this->_query ($query); - } - - if (count ($unique_list)) { - foreach ($unique_list as $key => $val) { - $query = sprintf ("create unique index \"%s\" on \"%s\" ". "(%s);", $this->prefix .$key, $table_name, '"'.implode('","', $val).'"'); - $this->_query ($query); - } - } - - if (count ($index_list)) { - foreach ($index_list as $key => $val) { - $query = sprintf ("create index \"%s\" on \"%s\" (%s);", $this->prefix .$key, $table_name, '"'.implode('","',$val).'"'); - $this->_query ($query); - } - } - } - - /** - * @brief 조건문 작성하여 return - **/ - function getCondition ($output) - { - if (!$output->conditions) return; - $condition = $this->_getCondition ($output->conditions, $output->column_type, $output); - if ($condition) $condition = ' where '.$condition; - - return $condition; - } - - function _getCondition ($conditions, $column_type, &$output) - { - $condition = ''; - - foreach ($conditions as $val) { - $sub_condition = ''; - - foreach ($val['condition'] as $v) { - if (!isset ($v['value'])) continue; - if ($v['value'] === '') continue; - if(!in_array(gettype($v['value']), array('string', 'integer', 'double', 'array'))) continue; - - $name = $v['column']; - $operation = $v['operation']; - $value = $v['value']; - $type = $this->getColumnType ($column_type, $name); - $pipe = $v['pipe']; - $value = $this->getConditionValue ($name, $value, $operation, $type, $column_type); - - if (!$value) { - $value = $v['value']; - if (strpos ($value, '(')) { - $valuetmp = $value; - } - elseif (strpos ($value, ".") === false) { - $valuetmp = $value; - } - else { - $valuetmp = '"'.str_replace('.', '"."', $value).'"'; - } - } - else { - $tmp = explode('.',$value); - - if (count($tmp)==2) { - $table = $tmp[0]; - $column = $tmp[1]; - - if ($column_type[$column] && (in_array ($table, $output->tables) || - array_key_exists($table, $output->tables))) { - $valuetmp = sprintf('"%s"."%s"', $table, $column); - } - else { - $valuetmp = $value; - } - } - else { - $valuetmp = $value; - } - } - - if (strpos ($name, '(') > 0) { - $nametmp = $name; - } - elseif (strpos ($name, ".") === false) { - $nametmp = '"'.$name.'"'; - } - else { - $nametmp = '"'.str_replace('.', '"."', $name).'"'; - } - $str = $this->getConditionPart ($nametmp, $valuetmp, $operation); - if ($sub_condition) $sub_condition .= ' '.$pipe.' '; - $sub_condition .= $str; - } - - if ($sub_condition) { - if ($condition && $val['pipe']) { - $condition .= ' '.$val['pipe'].' '; - } - $condition .= '('.$sub_condition.')'; - } - } - - return $condition; - } - - /** - * @brief insertAct 처리 - **/ - function _executeInsertAct ($output) - { - // 테이블 정리 - foreach ($output->tables as $val) { - $table_list[] = '"'.$this->prefix.$val.'"'; - } - - // 컬럼 정리 - foreach ($output->columns as $key => $val) { - $name = $val['name']; - $value = $val['value']; - //if ($this->getColumnType ($output->column_type, $name) != 'number') - if ($output->column_type[$name] != 'number') { - if (!is_null($value)) { - $value = "'" . $this->addQuotes($value) ."'"; - } - else { - if ($val['notnull']=='notnull') { - $value = "''"; - } - else { - //$value = 'null'; - $value = "''"; - } - } - } - elseif (!$value || is_numeric ($value)) { - $value = (int) $value; - } - - $column_list[] = '"'.$name.'"'; - $value_list[] = $value; - } - - $query = sprintf ("insert into %s (%s) values (%s);", implode(',', $table_list), implode(',', $column_list), implode(',', $value_list)); - - $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):''; - $result = $this->_query ($query); - if ($result && !$this->transaction_started) { - @cubrid_commit ($this->fd); - } - - return $result; - } - - /** - * @brief updateAct 처리 - **/ - function _executeUpdateAct ($output) - { - // 테이블 정리 - foreach ($output->tables as $key => $val) { - $table_list[] = '"'.$this->prefix.$val.'" as "'.$key.'"'; - } - - $check_click_count = true; - - // 컬럼 정리 - foreach ($output->columns as $key => $val) { - if (!isset ($val['value'])) continue; - $name = $val['name']; - $value = $val['value']; - - if (substr ($value, -2) != '+1' || $output->column_type[$name] != 'number') { - $check_click_count = false; - } - - for ($i = 0; $i < $key; $i++) { - /* 한문장에 같은 속성에 대한 중복 설정은 큐브리드에서는 허용치 않음 */ - if ($output->columns[$i]['name'] == $name) break; - } - if ($i < $key) continue; // 중복이 발견되면 이후의 설정은 무시 - - if (strpos ($name, '.') !== false && strpos ($value, '.') !== false) { - $column_list[] = $name.' = '.$value; - } - else { - if ($output->column_type[$name] != 'number') { - $check_column = false; - $value = "'".$this->addQuotes ($value)."'"; - } - elseif (!$value || is_numeric ($value)) { - $value = (int) $value; - } - - $column_list[] = sprintf ("\"%s\" = %s", $name, $value); - } - } - - // 조건절 정리 - $condition = $this->getCondition ($output); - - $check_click_count_condition = false; - if ($check_click_count) { - foreach ($output->conditions as $val) { - if ($val['pipe'] == 'or') { - $check_click_count_condition = false; - break; - } - - foreach ($val['condition'] as $v) { - if ($v['operation'] == 'equal') { - $check_click_count_condition = true; - } - else { - if ($v['operation'] == 'in' && !strpos ($v['value'], ',')) { - $check_click_count_condition = true; - } - else { - $check_click_count_condition = false; - } - } - - if ($v['pipe'] == 'or') { - $check_click_count_condition = false; - break; - } - } - } - } - - if ($check_click_count&& $check_click_count_condition && count ($output->tables) == 1 && count ($output->conditions) > 0 && count ($output->groups) == 0 && count ($output->order) == 0) { - foreach ($output->columns as $v) { - $incr_columns[] = 'incr("'.$v['name'].'")'; - } - - $query = sprintf ('select %s from %s %s', join (',', $incr_columns), implode(',', $table_list), $condition); - } - else { - $query = sprintf ("update %s set %s %s", implode (',', $table_list), implode (',', $column_list), $condition); - } - - $result = $this->_query ($query); - if ($result && !$this->transaction_started) @cubrid_commit ($this->fd); - - return $result; - } - - /** - * @brief deleteAct 처리 - **/ - function _executeDeleteAct ($output) - { - // 테이블 정리 - foreach ($output->tables as $val) { - $table_list[] = '"'.$this->prefix.$val.'"'; - } - - // 조건절 정리 - $condition = $this->getCondition ($output); - - $query = sprintf ("delete from %s %s", implode (',',$table_list), $condition); - $result = $this->_query ($query); - if ($result && !$this->transaction_started) @cubrid_commit ($this->fd); - - return $result; - } - - /** - * @brief selectAct 처리 - * - * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n - * navigation이라는 method를 제공 - **/ - function _executeSelectAct ($output) - { - // 테이블 정리 - $table_list = array (); - foreach ($output->tables as $key => $val) { - $table_list[] = '"'.$this->prefix.$val.'" as "'.$key.'"'; - } - $left_join = array (); - // why??? - $left_tables = (array) $output->left_tables; - - foreach ($left_tables as $key => $val) { - $condition = $this->_getCondition ($output->left_conditions[$key], $output->column_type, $output); - if ($condition) { - $left_join[] = $val.' "'.$this->prefix.$output->_tables[$key]. '" "'.$key.'" on ('.$condition.')'; - } - } - - $click_count = array(); - if(!$output->columns){ - $output->columns = array(array('name'=>'*')); - } - - $column_list = array (); - foreach ($output->columns as $key => $val) { - $name = $val['name']; - - $click_count = '%s'; - if ($val['click_count'] && count ($output->conditions) > 0) { - $click_count = 'incr(%s)'; - } - - $alias = $val['alias'] ? sprintf ('"%s"', $val['alias']) : null; - $_alias = $val['alias']; - - if ($name == '*') { - $column_list[] = $name; - } - elseif (strpos ($name, '.') === false && strpos ($name, '(') === false) { - $name = sprintf ($click_count,$name); - if ($alias) { - $column_list[$alias] = sprintf('"%s" as %s', $name, $alias); - } - else { - $column_list[] = sprintf ('"%s"', $name); - } - } - else { - if (strpos ($name, '.') != false) { - list ($prefix, $name) = explode('.', $name); - if (($now_matchs = preg_match_all ("/\(/", $prefix, $xtmp)) > 0) { - if ($now_matchs == 1) { - $tmpval = explode ("(", $prefix); - $tmpval[1] = sprintf ('"%s"', $tmpval[1]); - $prefix = implode ("(", $tmpval); - $tmpval = explode (")", $name); - $tmpval[0] = sprintf ('"%s"', $tmpval[0]); - $name = implode (")", $tmpval); - } - } - else { - $prefix = sprintf ('"%s"', $prefix); - $name = ($name == '*') ? $name : sprintf('"%s"',$name); - } - $xtmp = null; - $now_matchs = null; - if($alias) $column_list[$_alias] = sprintf ($click_count, sprintf ('%s.%s', $prefix, $name)) . ($alias ? sprintf (' as %s',$alias) : ''); - else $column_list[] = sprintf ($click_count, sprintf ('%s.%s', $prefix, $name)); - } - elseif (($now_matchs = preg_match_all ("/\(/", $name, $xtmp)) > 0) { - if ($now_matchs == 1 && preg_match ("/[a-zA-Z0-9]*\(\*\)/", $name) < 1) { - $open_pos = strpos ($name, "("); - $close_pos = strpos ($name, ")"); - - if (preg_match ("/,/", $name)) { - $tmp_func_name = sprintf ('%s', substr ($name, 0, $open_pos)); - $tmp_params = sprintf ('%s', substr ($name, $open_pos + 1, $close_pos - $open_pos - 1)); - $tmpval = null; - $tmpval = explode (',', $tmp_params); - - foreach ($tmpval as $tmp_param) { - $tmp_param_list[] = (!is_numeric ($tmp_param)) ? sprintf ('"%s"', $tmp_param) : $tmp_param; - } - - $tmpval = implode (',', $tmp_param_list); - $name = sprintf ('%s(%s)', $tmp_func_name, $tmpval); - } - else { - $name = sprintf ('%s("%s")', substr ($name, 0, $open_pos), substr ($name, $open_pos + 1, $close_pos - $open_pos - 1)); - } - } - - if($alias) $column_list[$_alias] = sprintf ($click_count, $name). ($alias ? sprintf (' as %s', $alias) : ''); - else $column_list[] = sprintf ($click_count, $name); - } - else { - if($alias) $column_list[$_alias] = sprintf($click_count, $name). ($alias ? sprintf(' as %s',$alias) : ''); - else $column_list[] = sprintf($click_count, $name); - } - } - $columns = implode (',', $column_list); - } - - $condition = $this->getCondition ($output); - - $output->column_list = $column_list; - if ($output->list_count && $output->page) { - return ($this->_getNavigationData($table_list, $columns, $left_join, $condition, $output)); - } - - if ($output->order) { - $conditions = $this->getConditionList($output); - //if(in_array('list_order', $conditions) || in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if ($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - //} - } - - - if (count ($output->groups)) { - foreach ($output->groups as $key => $value) { - if (strpos ($value, '.')) { - $tmp = explode ('.', $value); - $tmp[0] = sprintf ('"%s"', $tmp[0]); - $tmp[1] = sprintf ('"%s"', $tmp[1]); - $value = implode ('.', $tmp); - } - elseif (strpos ($value, '(')) { - $value = $value; - } - else { - $value = sprintf ('"%s"', $value); - } - $output->groups[$key] = $value; - - - if(count($output->arg_columns)) - { - if($column_list[$value]) $output->arg_columns[] = $column_list[$value]; - } - } - $groupby_query = sprintf ('group by %s', implode(',', $output->groups)); - } - - - // list_count를 사용할 경우 적용 - if ($output->list_count['value']) { - $start_count = 0; - $list_count = $output->list_count['value']; - - if ($output->order) { - foreach ($output->order as $val) { - if (strpos ($val[0], '.')) { - $tmpval = explode ('.', $val[0]); - $tmpval[0] = sprintf ('"%s"', $tmpval[0]); - $tmpval[1] = sprintf ('"%s"', $tmpval[1]); - $val[0] = implode ('.', $tmpval); - } - elseif (strpos ($val[0], '(')) $val[0] = $val[0]; - elseif ($val[0] == 'count') $val[0] = 'count (*)'; - else $val[0] = sprintf ('"%s"', $val[0]); - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - } - if (count($index_list)) - $orderby_query = ' order by '.implode(',', $index_list); - $orderby_query = sprintf ('%s for orderby_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); - } - else { - if (count ($output->groups)) { - $orderby_query = sprintf ('%s having groupby_num() between %d'. ' and %d', $orderby_query, $start_count + 1, $list_count + $start_count); - } - else { - if ($condition) { - $orderby_query = sprintf ('%s and inst_num() between %d'. ' and %d', $orderby_query, $start_count + 1, $list_count + $start_count); - } - else { - $orderby_query = sprintf ('%s where inst_num() between %d'. ' and %d', $orderby_query, $start_count + 1, $list_count + $start_count); - } - } - } - } - else { - if ($output->order) { - foreach ($output->order as $val) { - if (strpos ($val[0], '.')) { - $tmpval = explode ('.', $val[0]); - $tmpval[0] = sprintf ('"%s"', $tmpval[0]); - $tmpval[1] = sprintf ('"%s"', $tmpval[1]); - $val[0] = implode ('.', $tmpval); - } - elseif (strpos ($val[0], '(')) $val[0] = $val[0]; - elseif ($val[0] == 'count') $val[0] = 'count (*)'; - else $val[0] = sprintf ('"%s"', $val[0]); - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - - if(count($output->arg_columns) && $column_list[$val]) $output->arg_columns[] = $column_list[$key]; - } - - if (count ($index_list)) { - $orderby_query = ' order by '.implode(',', $index_list); - } - } - } - - - if(count($output->arg_columns)) - { - $columns = array(); - foreach($output->arg_columns as $col){ - if(strpos($col,'"')===false && strpos($col,' ')===false) $columns[] = '"'.$col.'"'; - else $columns[] = $col; - } - - $columns = join(',',$columns); - } - - $query = sprintf ("select %s from %s %s %s %s", $columns, implode (',',$table_list), implode (' ',$left_join), $condition, $groupby_query.$orderby_query); - $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):''; - $result = $this->_query ($query); - if ($this->isError ()) return; - $data = $this->_fetch ($result); - - $buff = new Object (); - $buff->data = $data; - - return $buff; - } - - /** - * @brief 현재 시점의 Stack trace를 보여줌.결과를 fetch - **/ - function backtrace () - { - $output = "
\n"; - $output .= "Backtrace:
\n"; - $backtrace = debug_backtrace (); - - foreach ($backtrace as $bt) { - $args = ''; - foreach ($bt['args'] as $a) { - if (!empty ($args)) { - $args .= ', '; - } - switch (gettype ($a)) { - case 'integer': - case 'double': - $args .= $a; - break; - case 'string': - $a = htmlspecialchars (substr ($a, 0, 64)). - ((strlen ($a) > 64) ? '...' : ''); - $args .= "\"$a\""; - break; - case 'array': - $args .= 'Array ('. count ($a).')'; - break; - case 'object': - $args .= 'Object ('.get_class ($a).')'; - break; - case 'resource': - $args .= 'Resource ('.strstr ($a, '#').')'; - break; - case 'boolean': - $args .= $a ? 'True' : 'False'; - break; - case 'NULL': - $args .= 'Null'; - break; - default: - $args .= 'Unknown'; - } - } - $output .= "
\n"; - $output .= "file: ".$bt['line']." - ". $bt['file']."
\n"; - $output .= "call: ".$bt['class']. $bt['type'].$bt['function'].$args."
\n"; - } - $output .= "
\n"; - return $output; - } - - /** - * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 - * - * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; - **/ - function _getNavigationData ($table_list, $columns, $left_join, $condition, $output) { - require_once (_XE_PATH_.'classes/page/PageHandler.class.php'); - - $column_list = $output->column_list; - - $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); - } - - $count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):''; - $result = $this->_query($count_query); - $count_output = $this->_fetch($result); - $total_count = (int)$count_output->count; - - $list_count = $output->list_count['value']; - if (!$list_count) $list_count = 20; - $page_count = $output->page_count['value']; - if (!$page_count) $page_count = 10; - $page = $output->page['value']; - if (!$page) $page = 1; - - // 전체 페이지를 구함 - if ($total_count) { - $total_page = (int) (($total_count - 1) / $list_count) + 1; - } - else { - $total_page = 1; - } - - // 페이지 변수를 체크 - if ($page > $total_page) $page = $total_page; - $start_count = ($page - 1) * $list_count; - - if ($output->order) { - $conditions = $this->getConditionList($output); - //if(in_array('list_order', $conditions) || in_array('update_order', $conditions)) { - foreach ($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - //} - } - - - if (count ($output->groups)) { - foreach ($output->groups as $key => $value) { - if (strpos ($value, '.')) { - $tmp = explode ('.', $value); - $tmp[0] = sprintf ('"%s"', $tmp[0]); - $tmp[1] = sprintf ('"%s"', $tmp[1]); - $value = implode ('.', $tmp); - } - elseif (strpos ($value, '(')) $value = $value; - else $value = sprintf ('"%s"', $value); - $output->groups[$key] = $value; - } - - $groupby_query = sprintf (' group by %s', implode (',', $output->groups)); - } - - if ($output->order) { - foreach ($output->order as $val) { - if (strpos ($val[0], '.')) { - $tmpval = explode ('.', $val[0]); - $tmpval[0] = sprintf ('"%s"', $tmpval[0]); - $tmpval[1] = sprintf ('"%s"', $tmpval[1]); - $val[0] = implode ('.', $tmpval); - } - elseif (strpos ($val[0], '(')) $val[0] = $val[0]; - elseif ($val[0] == 'count') $val[0] = 'count (*)'; - else $val[0] = sprintf ('"%s"', $val[0]); - $index_list[] = sprintf ('%s %s', $val[0], $val[1]); - } - - if (count ($index_list)) { - $orderby_query = ' order by '.implode(',', $index_list); - } - - $orderby_query = sprintf ('%s for orderby_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); - } - else { - if (count($output->groups)) { - $orderby_query = sprintf ('%s having groupby_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); - } - else { - if ($condition) { - $orderby_query = sprintf ('%s and inst_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); - } - else { - $orderby_query = sprintf('%s where inst_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); - } - } - } - - if(count($output->arg_columns)) - { - $columns = array(); - foreach($output->arg_columns as $col){ - if(strpos($col,'"')===false) $columns[] = '"'.$col.'"'; - else $columns[] = $col; - } - - $columns = join(',',$columns); - } - - $query = sprintf ("select %s from %s %s %s %s", $columns, implode (',',$table_list), implode (' ',$left_join), $condition, $groupby_query.$orderby_query); - $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):''; - $result = $this->_query ($query); - - if ($this->isError ()) { - $buff = new Object (); - $buff->total_count = 0; - $buff->total_page = 0; - $buff->page = 1; - $buff->data = array (); - - $buff->page_navigation = new PageHandler ($total_count, $total_page, $page, $page_count); - - return $buff; - } - - $virtual_no = $total_count - ($page - 1) * $list_count; - while ($tmp = cubrid_fetch ($result, CUBRID_OBJECT)) { - if ($tmp) { - foreach ($tmp as $k => $v) { - $tmp->{$k} = rtrim($v); - } - } - $data[$virtual_no--] = $tmp; - } - - $buff = new Object (); - $buff->total_count = $total_count; - $buff->total_page = $total_page; - $buff->page = $page; - $buff->data = $data; - - $buff->page_navigation = new PageHandler ($total_count, $total_page, $page, $page_count); - - return $buff; - } - } - -return new DBCubrid; -?> + 'numeric(20)', + 'number' => 'integer', + 'varchar' => 'character varying', + 'char' => 'character', + 'tinytext' => 'character varying(256)', + 'text' => 'character varying(1073741823)', + 'bigtext' => 'character varying(1073741823)', + 'date' => 'character varying(14)', + 'float' => 'float', + ); + + /** + * @brief constructor + **/ + function DBCubrid() + { + $this->_setDBInfo(); + $this->_connect(); + } + + /** + * @brief create an instance of this class + */ + function create() + { + return new DBCubrid; + } + + /** + * @brief 설치 가능 여부를 return + **/ + function isSupported() + { + if (!function_exists('cubrid_connect')) return false; + return true; + } + + /** + * @brief DB정보 설정 및 connect/ close + **/ + function _setDBInfo() + { + $db_info = Context::getDBInfo(); + $this->hostname = $db_info->db_hostname; + $this->userid = $db_info->db_userid; + $this->password = $db_info->db_password; + $this->database = $db_info->db_database; + $this->port = $db_info->db_port; + $this->prefix = $db_info->db_table_prefix; + + if (!substr($this->prefix, -1) != '_') $this->prefix .= '_'; + } + + /** + * @brief DB 접속 + **/ + function _connect() + { + // db 정보가 없으면 무시 + if (!$this->hostname || !$this->userid || !$this->password || !$this->database || !$this->port) return; + + // 접속시도 + $this->fd = @cubrid_connect ($this->hostname, $this->port, $this->database, $this->userid, $this->password); + + // 접속체크 + if (!$this->fd) { + $this->setError (-1, 'database connect fail'); + return $this->is_connected = false; + } + + $this->is_connected = true; + $this->password = md5 ($this->password); + } + + /** + * @brief DB접속 해제 + **/ + function close() + { + if (!$this->isConnected ()) return; + + @cubrid_commit ($this->fd); + @cubrid_disconnect ($this->fd); + $this->transaction_started = false; + } + + /** + * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 + **/ + function addQuotes($string) + { + if (!$this->fd) return $string; + + if (version_compare (PHP_VERSION, "5.9.0", "<") && + get_magic_quotes_gpc ()) { + $string = stripslashes (str_replace ("\\","\\\\", $string)); + } + + if (!is_numeric ($string)) { + /* + if ($this->isConnected()) { + $string = cubrid_real_escape_string($string); + } + else { + $string = str_replace("'","\'",$string); + } + */ + + $string = str_replace("'","''",$string); + } + + return $string; + } + + /** + * @brief 트랜잭션 시작 + **/ + function begin() + { + if (!$this->isConnected () || $this->transaction_started) return; + $this->transaction_started = true; + } + + /** + * @brief 롤백 + **/ + function rollback() + { + if (!$this->isConnected () || !$this->transaction_started) return; + @cubrid_rollback ($this->fd); + $this->transaction_started = false; + } + + /** + * @brief 커밋 + **/ + function commit() + { + if (!$force && (!$this->isConnected () || + !$this->transaction_started)) return; + + @cubrid_commit($this->fd); + $this->transaction_started = false; + } + + /** + * @brief : 쿼리문의 실행 및 결과의 fetch 처리 + * + * query : query문 실행하고 result return\n + * fetch : reutrn 된 값이 없으면 NULL\n + * rows이면 array object\n + * row이면 object\n + * return\n + **/ + function _query($query) + { + if (!$query || !$this->isConnected ()) return; + + // 쿼리 시작을 알림 + $this->actStart ($query); + + // 쿼리 문 실행 + $result = @cubrid_execute ($this->fd, $query); + // 오류 체크 + if (cubrid_error_code ()) { + $code = cubrid_error_code (); + $msg = cubrid_error_msg (); + + $this->setError ($code, $msg); + } + + // 쿼리 실행 종료를 알림 + $this->actFinish (); + + // 결과 리턴 + return $result; + } + + /** + * @brief 결과를 fetch + **/ + function _fetch($result) + { + if (!$this->isConnected() || $this->isError() || !$result) return; + + $col_types = cubrid_column_types ($result); + $col_names = cubrid_column_names ($result); + $max = count ($col_types); + + for ($count = 0; $count < $max; $count++) { + if (preg_match ("/^char/", $col_types[$count]) > 0) { + $char_type_fields[] = $col_names[$count]; + } + } + + while ($tmp = cubrid_fetch ($result, CUBRID_OBJECT)) { + if (is_array ($char_type_fields)) { + foreach ($char_type_fields as $val) { + $tmp->{$val} = rtrim ($tmp->{$val}); + } + } + + $output[] = $tmp; + } + + unset ($char_type_fields); + + if ($result) cubrid_close_request($result); + + if (count ($output) == 1) return $output[0]; + return $output; + } + + /** + * @brief 1씩 증가되는 sequence 값을 return (cubrid의 auto_increment는 sequence테이블에서만 사용) + **/ + function getNextSequence() + { + $this->_makeSequence(); + + $query = sprintf ("select \"%ssequence\".\"nextval\" as \"seq\" from db_root", $this->prefix); + $result = $this->_query($query); + $output = $this->_fetch($result); + + return $output->seq; + } + + /** + * @brief 마이그레이션시 sequence 가 없을 경우 생성 + **/ + function _makeSequence() + { + if($_GLOBALS['XE_EXISTS_SEQUENCE']) return; + + // check cubrid serial + $query = sprintf('select count(*) as "count" from "db_serial" where name=\'%ssequence\'', $this->prefix); + $result = $this->_query($query); + $output = $this->_fetch($result); + + // if do not create serial + if ($output->count == 0) { + $query = sprintf('select max("a"."srl") as "srl" from '. + '( select max("document_srl") as "srl" from '. + '"%sdocuments" UNION '. + 'select max("comment_srl") as "srl" from '. + '"%scomments" UNION '. + 'select max("member_srl") as "srl" from '. + '"%smember"'. + ') as "a"', $this->prefix, $this->prefix, $this->prefix); + + $result = $this->_query($query); + $output = $this->_fetch($result); + $srl = $output->srl; + if ($srl < 1) { + $start = 1; + } + else { + $start = $srl + 1000000; + } + + // create sequence + $query = sprintf('create serial "%ssequence" start with %s increment by 1 minvalue 1 maxvalue 10000000000000000000000000000000000000 nocycle;', $this->prefix, $start); + $this->_query($query); + } + + $_GLOBALS['XE_EXISTS_SEQUENCE'] = true; + } + + + /** + * @brief 테이블 기생성 여부 return + **/ + function isTableExists ($target_name) + { + if($target_name == 'sequence') { + $query = sprintf ("select \"name\" from \"db_serial\" where \"name\" = '%s%s'", $this->prefix, $target_name); + } + else { + $query = sprintf ("select \"class_name\" from \"db_class\" where \"class_name\" = '%s%s'", $this->prefix, $target_name); + } + + $result = $this->_query ($query); + if (cubrid_num_rows($result) > 0) { + $output = true; + } + else { + $output = false; + } + + if ($result) cubrid_close_request ($result); + + return $output; + } + + /** + * @brief 특정 테이블에 특정 column 추가 + **/ + function addColumn($table_name, $column_name, $type = 'number', $size = '', $default = '', $notnull = false) + { + $type = strtoupper($this->column_type[$type]); + if ($type == 'INTEGER') $size = ''; + + $query = sprintf ("alter class \"%s%s\" add \"%s\" ", $this->prefix, $table_name, $column_name); + + if ($type == 'char' || $type == 'varchar') { + if ($size) $size = $size * 3; + } + + if ($size) { + $query .= sprintf ("%s(%s) ", $type, $size); + } + else { + $query .= sprintf ("%s ", $type); + } + + if ($default) { + if ($type == 'INTEGER' || $type == 'BIGINT' || $type=='INT') { + $query .= sprintf ("default %d ", $default); + } + else { + $query .= sprintf ("default '%s' ", $default); + } + } + + if ($notnull) $query .= "not null "; + + $this->_query ($query); + } + + /** + * @brief 특정 테이블에 특정 column 제거 + **/ + function dropColumn ($table_name, $column_name) + { + $query = sprintf ("alter class \"%s%s\" drop \"%s\" ", $this->prefix, $table_name, $column_name); + + $this->_query ($query); + } + + /** + * @brief 특정 테이블의 column의 정보를 return + **/ + function isColumnExists ($table_name, $column_name) + { + $query = sprintf ("select \"attr_name\" from \"db_attribute\" where ". "\"attr_name\" ='%s' and \"class_name\" = '%s%s'", $column_name, $this->prefix, $table_name); + $result = $this->_query ($query); + + if (cubrid_num_rows ($result) > 0) $output = true; + else $output = false; + + if ($result) cubrid_close_request ($result); + + return $output; + } + + /** + * @brief 특정 테이블에 특정 인덱스 추가 + * $target_columns = array(col1, col2) + * $is_unique? unique : none + **/ + function addIndex ($table_name, $index_name, $target_columns, $is_unique = false) + { + if (!is_array ($target_columns)) { + $target_columns = array ($target_columns); + } + + $query = sprintf ("create %s index \"%s\" on \"%s%s\" (%s);", $is_unique?'unique':'', $this->prefix .$index_name, $this->prefix, $table_name, '"'.implode('","',$target_columns).'"'); + + $this->_query ($query); + } + + /** + * @brief 특정 테이블의 특정 인덱스 삭제 + **/ + function dropIndex ($table_name, $index_name, $is_unique = false) + { + $query = sprintf ("drop %s index \"%s\" on \"%s%s\"", $is_unique?'unique':'', $this->prefix .$index_name, $this->prefix, $table_name); + + $this->_query($query); + } + + /** + * @brief 특정 테이블의 index 정보를 return + **/ + function isIndexExists ($table_name, $index_name) + { + $query = sprintf ("select \"index_name\" from \"db_index\" where ". "\"class_name\" = '%s%s' and \"index_name\" = '%s' ", $this->prefix, $table_name, $this->prefix .$index_name); + $result = $this->_query ($query); + + if ($this->isError ()) return false; + + $output = $this->_fetch ($result); + + if (!$output) return false; + return true; + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXml ($xml_doc) + { + return $this->_createTable ($xml_doc); + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXmlFile ($file_name) + { + if (!file_exists ($file_name)) return; + // xml 파일을 읽음 + $buff = FileHandler::readFile ($file_name); + + return $this->_createTable ($buff); + } + + /** + * @brief schema xml을 이용하여 create class query생성 + * + * type : number, varchar, tinytext, text, bigtext, char, date, \n + * opt : notnull, default, size\n + * index : primary key, index, unique\n + **/ + function _createTable ($xml_doc) + { + // xml parsing + $oXml = new XmlParser(); + $xml_obj = $oXml->parse($xml_doc); + + // 테이블 생성 schema 작성 + $table_name = $xml_obj->table->attrs->name; + + // if the table already exists exit function + if ($this->isTableExists($table_name)) return; + + // 만약 테이블 이름이 sequence라면 serial 생성 + if ($table_name == 'sequence') { + $query = sprintf ('create serial "%s" start with 1 increment by 1'. + ' minvalue 1 '. + 'maxvalue 10000000000000000000000000000000000000'. ' nocycle;', $this->prefix.$table_name); + + return $this->_query($query); + } + + + $table_name = $this->prefix.$table_name; + + $query = sprintf ('create class "%s";', $table_name); + $this->_query ($query); + + if (!is_array ($xml_obj->table->column)) { + $columns[] = $xml_obj->table->column; + } + else { + $columns = $xml_obj->table->column; + } + + $query = sprintf ("alter class \"%s\" add attribute ", $table_name); + + foreach ($columns as $column) { + $name = $column->attrs->name; + $type = $column->attrs->type; + $size = $column->attrs->size; + $notnull = $column->attrs->notnull; + $primary_key = $column->attrs->primary_key; + $index = $column->attrs->index; + $unique = $column->attrs->unique; + $default = $column->attrs->default; + + switch ($this->column_type[$type]) { + case 'integer' : + $size = null; + break; + case 'text' : + $size = null; + break; + } + + if (isset ($default) && ($type == 'varchar' || $type == 'char' || + $type == 'text' || $type == 'tinytext' || $type == 'bigtext')) { + $default = sprintf ("'%s'", $default); + } + + if ($type == 'varchar' || $type == 'char') { + if($size) $size = $size * 3; + } + + + $column_schema[] = sprintf ('"%s" %s%s %s %s', + $name, + $this->column_type[$type], + $size?'('.$size.')':'', + isset($default)?"default ".$default:'', + $notnull?'not null':''); + + if ($primary_key) { + $primary_list[] = $name; + } + else if ($unique) { + $unique_list[$unique][] = $name; + } + else if ($index) { + $index_list[$index][] = $name; + } + } + + $query .= implode (',', $column_schema).';'; + $this->_query ($query); + + if (count ($primary_list)) { + $query = sprintf ("alter class \"%s\" add attribute constraint ". "\"pkey_%s\" PRIMARY KEY(%s);", $table_name, $table_name, '"'.implode('","',$primary_list).'"'); + $this->_query ($query); + } + + if (count ($unique_list)) { + foreach ($unique_list as $key => $val) { + $query = sprintf ("create unique index \"%s\" on \"%s\" ". "(%s);", $this->prefix .$key, $table_name, '"'.implode('","', $val).'"'); + $this->_query ($query); + } + } + + if (count ($index_list)) { + foreach ($index_list as $key => $val) { + $query = sprintf ("create index \"%s\" on \"%s\" (%s);", $this->prefix .$key, $table_name, '"'.implode('","',$val).'"'); + $this->_query ($query); + } + } + } + + /** + * @brief 조건문 작성하여 return + **/ + function getCondition ($output) + { + if (!$output->conditions) return; + $condition = $this->_getCondition ($output->conditions, $output->column_type, $output); + if ($condition) $condition = ' where '.$condition; + + return $condition; + } + + function _getCondition ($conditions, $column_type, &$output) + { + $condition = ''; + + foreach ($conditions as $val) { + $sub_condition = ''; + + foreach ($val['condition'] as $v) { + if (!isset ($v['value'])) continue; + if ($v['value'] === '') continue; + if(!in_array(gettype($v['value']), array('string', 'integer', 'double', 'array'))) continue; + + $name = $v['column']; + $operation = $v['operation']; + $value = $v['value']; + $type = $this->getColumnType ($column_type, $name); + $pipe = $v['pipe']; + $value = $this->getConditionValue ($name, $value, $operation, $type, $column_type); + + if (!$value) { + $value = $v['value']; + if (strpos ($value, '(')) { + $valuetmp = $value; + } + elseif (strpos ($value, ".") === false) { + $valuetmp = $value; + } + else { + $valuetmp = '"'.str_replace('.', '"."', $value).'"'; + } + } + else { + $tmp = explode('.',$value); + + if (count($tmp)==2) { + $table = $tmp[0]; + $column = $tmp[1]; + + if ($column_type[$column] && (in_array ($table, $output->tables) || + array_key_exists($table, $output->tables))) { + $valuetmp = sprintf('"%s"."%s"', $table, $column); + } + else { + $valuetmp = $value; + } + } + else { + $valuetmp = $value; + } + } + + if (strpos ($name, '(') > 0) { + $nametmp = $name; + } + elseif (strpos ($name, ".") === false) { + $nametmp = '"'.$name.'"'; + } + else { + $nametmp = '"'.str_replace('.', '"."', $name).'"'; + } + $str = $this->getConditionPart ($nametmp, $valuetmp, $operation); + if ($sub_condition) $sub_condition .= ' '.$pipe.' '; + $sub_condition .= $str; + } + + if ($sub_condition) { + if ($condition && $val['pipe']) { + $condition .= ' '.$val['pipe'].' '; + } + $condition .= '('.$sub_condition.')'; + } + } + + return $condition; + } + + /** + * @brief insertAct 처리 + **/ + function _executeInsertAct ($output) + { + // 테이블 정리 + foreach ($output->tables as $val) { + $table_list[] = '"'.$this->prefix.$val.'"'; + } + + // 컬럼 정리 + foreach ($output->columns as $key => $val) { + $name = $val['name']; + $value = $val['value']; + //if ($this->getColumnType ($output->column_type, $name) != 'number') + if ($output->column_type[$name] != 'number') { + if (!is_null($value)) { + $value = "'" . $this->addQuotes($value) ."'"; + } + else { + if ($val['notnull']=='notnull') { + $value = "''"; + } + else { + //$value = 'null'; + $value = "''"; + } + } + } + elseif (!$value || is_numeric ($value)) { + $value = (int) $value; + } + + $column_list[] = '"'.$name.'"'; + $value_list[] = $value; + } + + $query = sprintf ("insert into %s (%s) values (%s);", implode(',', $table_list), implode(',', $column_list), implode(',', $value_list)); + + $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):''; + $result = $this->_query ($query); + if ($result && !$this->transaction_started) { + @cubrid_commit ($this->fd); + } + + return $result; + } + + /** + * @brief updateAct 처리 + **/ + function _executeUpdateAct ($output) + { + // 테이블 정리 + foreach ($output->tables as $key => $val) { + $table_list[] = '"'.$this->prefix.$val.'" as "'.$key.'"'; + } + + $check_click_count = true; + + // 컬럼 정리 + foreach ($output->columns as $key => $val) { + if (!isset ($val['value'])) continue; + $name = $val['name']; + $value = $val['value']; + + if (substr ($value, -2) != '+1' || $output->column_type[$name] != 'number') { + $check_click_count = false; + } + + for ($i = 0; $i < $key; $i++) { + /* 한문장에 같은 속성에 대한 중복 설정은 큐브리드에서는 허용치 않음 */ + if ($output->columns[$i]['name'] == $name) break; + } + if ($i < $key) continue; // 중복이 발견되면 이후의 설정은 무시 + + if (strpos ($name, '.') !== false && strpos ($value, '.') !== false) { + $column_list[] = $name.' = '.$value; + } + else { + if ($output->column_type[$name] != 'number') { + $check_column = false; + $value = "'".$this->addQuotes ($value)."'"; + } + elseif (!$value || is_numeric ($value)) { + $value = (int) $value; + } + + $column_list[] = sprintf ("\"%s\" = %s", $name, $value); + } + } + + // 조건절 정리 + $condition = $this->getCondition ($output); + + $check_click_count_condition = false; + if ($check_click_count) { + foreach ($output->conditions as $val) { + if ($val['pipe'] == 'or') { + $check_click_count_condition = false; + break; + } + + foreach ($val['condition'] as $v) { + if ($v['operation'] == 'equal') { + $check_click_count_condition = true; + } + else { + if ($v['operation'] == 'in' && !strpos ($v['value'], ',')) { + $check_click_count_condition = true; + } + else { + $check_click_count_condition = false; + } + } + + if ($v['pipe'] == 'or') { + $check_click_count_condition = false; + break; + } + } + } + } + + if ($check_click_count&& $check_click_count_condition && count ($output->tables) == 1 && count ($output->conditions) > 0 && count ($output->groups) == 0 && count ($output->order) == 0) { + foreach ($output->columns as $v) { + $incr_columns[] = 'incr("'.$v['name'].'")'; + } + + $query = sprintf ('select %s from %s %s', join (',', $incr_columns), implode(',', $table_list), $condition); + } + else { + $query = sprintf ("update %s set %s %s", implode (',', $table_list), implode (',', $column_list), $condition); + } + + $result = $this->_query ($query); + if ($result && !$this->transaction_started) @cubrid_commit ($this->fd); + + return $result; + } + + /** + * @brief deleteAct 처리 + **/ + function _executeDeleteAct ($output) + { + // 테이블 정리 + foreach ($output->tables as $val) { + $table_list[] = '"'.$this->prefix.$val.'"'; + } + + // 조건절 정리 + $condition = $this->getCondition ($output); + + $query = sprintf ("delete from %s %s", implode (',',$table_list), $condition); + $result = $this->_query ($query); + if ($result && !$this->transaction_started) @cubrid_commit ($this->fd); + + return $result; + } + + /** + * @brief selectAct 처리 + * + * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n + * navigation이라는 method를 제공 + **/ + function _executeSelectAct ($output) + { + // 테이블 정리 + $table_list = array (); + foreach ($output->tables as $key => $val) { + $table_list[] = '"'.$this->prefix.$val.'" as "'.$key.'"'; + } + $left_join = array (); + // why??? + $left_tables = (array) $output->left_tables; + + foreach ($left_tables as $key => $val) { + $condition = $this->_getCondition ($output->left_conditions[$key], $output->column_type, $output); + if ($condition) { + $left_join[] = $val.' "'.$this->prefix.$output->_tables[$key]. '" "'.$key.'" on ('.$condition.')'; + } + } + + $click_count = array(); + if(!$output->columns){ + $output->columns = array(array('name'=>'*')); + } + + $column_list = array (); + foreach ($output->columns as $key => $val) { + $name = $val['name']; + + $click_count = '%s'; + if ($val['click_count'] && count ($output->conditions) > 0) { + $click_count = 'incr(%s)'; + } + + $alias = $val['alias'] ? sprintf ('"%s"', $val['alias']) : null; + $_alias = $val['alias']; + + if ($name == '*') { + $column_list[] = $name; + } + elseif (strpos ($name, '.') === false && strpos ($name, '(') === false) { + $name = sprintf ($click_count,$name); + if ($alias) { + $column_list[$alias] = sprintf('"%s" as %s', $name, $alias); + } + else { + $column_list[] = sprintf ('"%s"', $name); + } + } + else { + if (strpos ($name, '.') != false) { + list ($prefix, $name) = explode('.', $name); + if (($now_matchs = preg_match_all ("/\(/", $prefix, $xtmp)) > 0) { + if ($now_matchs == 1) { + $tmpval = explode ("(", $prefix); + $tmpval[1] = sprintf ('"%s"', $tmpval[1]); + $prefix = implode ("(", $tmpval); + $tmpval = explode (")", $name); + $tmpval[0] = sprintf ('"%s"', $tmpval[0]); + $name = implode (")", $tmpval); + } + } + else { + $prefix = sprintf ('"%s"', $prefix); + $name = ($name == '*') ? $name : sprintf('"%s"',$name); + } + $xtmp = null; + $now_matchs = null; + if($alias) $column_list[$_alias] = sprintf ($click_count, sprintf ('%s.%s', $prefix, $name)) . ($alias ? sprintf (' as %s',$alias) : ''); + else $column_list[] = sprintf ($click_count, sprintf ('%s.%s', $prefix, $name)); + } + elseif (($now_matchs = preg_match_all ("/\(/", $name, $xtmp)) > 0) { + if ($now_matchs == 1 && preg_match ("/[a-zA-Z0-9]*\(\*\)/", $name) < 1) { + $open_pos = strpos ($name, "("); + $close_pos = strpos ($name, ")"); + + if (preg_match ("/,/", $name)) { + $tmp_func_name = sprintf ('%s', substr ($name, 0, $open_pos)); + $tmp_params = sprintf ('%s', substr ($name, $open_pos + 1, $close_pos - $open_pos - 1)); + $tmpval = null; + $tmpval = explode (',', $tmp_params); + + foreach ($tmpval as $tmp_param) { + $tmp_param_list[] = (!is_numeric ($tmp_param)) ? sprintf ('"%s"', $tmp_param) : $tmp_param; + } + + $tmpval = implode (',', $tmp_param_list); + $name = sprintf ('%s(%s)', $tmp_func_name, $tmpval); + } + else { + $name = sprintf ('%s("%s")', substr ($name, 0, $open_pos), substr ($name, $open_pos + 1, $close_pos - $open_pos - 1)); + } + } + + if($alias) $column_list[$_alias] = sprintf ($click_count, $name). ($alias ? sprintf (' as %s', $alias) : ''); + else $column_list[] = sprintf ($click_count, $name); + } + else { + if($alias) $column_list[$_alias] = sprintf($click_count, $name). ($alias ? sprintf(' as %s',$alias) : ''); + else $column_list[] = sprintf($click_count, $name); + } + } + $columns = implode (',', $column_list); + } + + $condition = $this->getCondition ($output); + + $output->column_list = $column_list; + if ($output->list_count && $output->page) { + return ($this->_getNavigationData($table_list, $columns, $left_join, $condition, $output)); + } + + if ($output->order) { + $conditions = $this->getConditionList($output); + //if(in_array('list_order', $conditions) || in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if ($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + //} + } + + + if (count ($output->groups)) { + foreach ($output->groups as $key => $value) { + if (strpos ($value, '.')) { + $tmp = explode ('.', $value); + $tmp[0] = sprintf ('"%s"', $tmp[0]); + $tmp[1] = sprintf ('"%s"', $tmp[1]); + $value = implode ('.', $tmp); + } + elseif (strpos ($value, '(')) { + $value = $value; + } + else { + $value = sprintf ('"%s"', $value); + } + $output->groups[$key] = $value; + + + if(count($output->arg_columns)) + { + if($column_list[$value]) $output->arg_columns[] = $column_list[$value]; + } + } + $groupby_query = sprintf ('group by %s', implode(',', $output->groups)); + } + + + // list_count를 사용할 경우 적용 + if ($output->list_count['value']) { + $start_count = 0; + $list_count = $output->list_count['value']; + + if ($output->order) { + foreach ($output->order as $val) { + if (strpos ($val[0], '.')) { + $tmpval = explode ('.', $val[0]); + $tmpval[0] = sprintf ('"%s"', $tmpval[0]); + $tmpval[1] = sprintf ('"%s"', $tmpval[1]); + $val[0] = implode ('.', $tmpval); + } + elseif (strpos ($val[0], '(')) $val[0] = $val[0]; + elseif ($val[0] == 'count') $val[0] = 'count (*)'; + else $val[0] = sprintf ('"%s"', $val[0]); + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + } + if (count($index_list)) + $orderby_query = ' order by '.implode(',', $index_list); + $orderby_query = sprintf ('%s for orderby_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); + } + else { + if (count ($output->groups)) { + $orderby_query = sprintf ('%s having groupby_num() between %d'. ' and %d', $orderby_query, $start_count + 1, $list_count + $start_count); + } + else { + if ($condition) { + $orderby_query = sprintf ('%s and inst_num() between %d'. ' and %d', $orderby_query, $start_count + 1, $list_count + $start_count); + } + else { + $orderby_query = sprintf ('%s where inst_num() between %d'. ' and %d', $orderby_query, $start_count + 1, $list_count + $start_count); + } + } + } + } + else { + if ($output->order) { + foreach ($output->order as $val) { + if (strpos ($val[0], '.')) { + $tmpval = explode ('.', $val[0]); + $tmpval[0] = sprintf ('"%s"', $tmpval[0]); + $tmpval[1] = sprintf ('"%s"', $tmpval[1]); + $val[0] = implode ('.', $tmpval); + } + elseif (strpos ($val[0], '(')) $val[0] = $val[0]; + elseif ($val[0] == 'count') $val[0] = 'count (*)'; + else $val[0] = sprintf ('"%s"', $val[0]); + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + + if(count($output->arg_columns) && $column_list[$val]) $output->arg_columns[] = $column_list[$key]; + } + + if (count ($index_list)) { + $orderby_query = ' order by '.implode(',', $index_list); + } + } + } + + + if(count($output->arg_columns)) + { + $columns = array(); + foreach($output->arg_columns as $col){ + if(strpos($col,'"')===false && strpos($col,' ')===false) $columns[] = '"'.$col.'"'; + else $columns[] = $col; + } + + $columns = join(',',$columns); + } + + $query = sprintf ("select %s from %s %s %s %s", $columns, implode (',',$table_list), implode (' ',$left_join), $condition, $groupby_query.$orderby_query); + $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):''; + $result = $this->_query ($query); + if ($this->isError ()) return; + $data = $this->_fetch ($result); + + $buff = new Object (); + $buff->data = $data; + + return $buff; + } + + /** + * @brief 현재 시점의 Stack trace를 보여줌.결과를 fetch + **/ + function backtrace () + { + $output = "
\n"; + $output .= "Backtrace:
\n"; + $backtrace = debug_backtrace (); + + foreach ($backtrace as $bt) { + $args = ''; + foreach ($bt['args'] as $a) { + if (!empty ($args)) { + $args .= ', '; + } + switch (gettype ($a)) { + case 'integer': + case 'double': + $args .= $a; + break; + case 'string': + $a = htmlspecialchars (substr ($a, 0, 64)). + ((strlen ($a) > 64) ? '...' : ''); + $args .= "\"$a\""; + break; + case 'array': + $args .= 'Array ('. count ($a).')'; + break; + case 'object': + $args .= 'Object ('.get_class ($a).')'; + break; + case 'resource': + $args .= 'Resource ('.strstr ($a, '#').')'; + break; + case 'boolean': + $args .= $a ? 'True' : 'False'; + break; + case 'NULL': + $args .= 'Null'; + break; + default: + $args .= 'Unknown'; + } + } + $output .= "
\n"; + $output .= "file: ".$bt['line']." - ". $bt['file']."
\n"; + $output .= "call: ".$bt['class']. $bt['type'].$bt['function'].$args."
\n"; + } + $output .= "
\n"; + return $output; + } + + /** + * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 + * + * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; + **/ + function _getNavigationData ($table_list, $columns, $left_join, $condition, $output) { + require_once (_XE_PATH_.'classes/page/PageHandler.class.php'); + + $column_list = $output->column_list; + + $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); + } + + $count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):''; + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + + $list_count = $output->list_count['value']; + if (!$list_count) $list_count = 20; + $page_count = $output->page_count['value']; + if (!$page_count) $page_count = 10; + $page = $output->page['value']; + if (!$page) $page = 1; + + // 전체 페이지를 구함 + if ($total_count) { + $total_page = (int) (($total_count - 1) / $list_count) + 1; + } + else { + $total_page = 1; + } + + // 페이지 변수를 체크 + if ($page > $total_page) $page = $total_page; + $start_count = ($page - 1) * $list_count; + + if ($output->order) { + $conditions = $this->getConditionList($output); + //if(in_array('list_order', $conditions) || in_array('update_order', $conditions)) { + foreach ($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + //} + } + + + if (count ($output->groups)) { + foreach ($output->groups as $key => $value) { + if (strpos ($value, '.')) { + $tmp = explode ('.', $value); + $tmp[0] = sprintf ('"%s"', $tmp[0]); + $tmp[1] = sprintf ('"%s"', $tmp[1]); + $value = implode ('.', $tmp); + } + elseif (strpos ($value, '(')) $value = $value; + else $value = sprintf ('"%s"', $value); + $output->groups[$key] = $value; + } + + $groupby_query = sprintf (' group by %s', implode (',', $output->groups)); + } + + if ($output->order) { + foreach ($output->order as $val) { + if (strpos ($val[0], '.')) { + $tmpval = explode ('.', $val[0]); + $tmpval[0] = sprintf ('"%s"', $tmpval[0]); + $tmpval[1] = sprintf ('"%s"', $tmpval[1]); + $val[0] = implode ('.', $tmpval); + } + elseif (strpos ($val[0], '(')) $val[0] = $val[0]; + elseif ($val[0] == 'count') $val[0] = 'count (*)'; + else $val[0] = sprintf ('"%s"', $val[0]); + $index_list[] = sprintf ('%s %s', $val[0], $val[1]); + } + + if (count ($index_list)) { + $orderby_query = ' order by '.implode(',', $index_list); + } + + $orderby_query = sprintf ('%s for orderby_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); + } + else { + if (count($output->groups)) { + $orderby_query = sprintf ('%s having groupby_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); + } + else { + if ($condition) { + $orderby_query = sprintf ('%s and inst_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); + } + else { + $orderby_query = sprintf('%s where inst_num() between %d and %d', $orderby_query, $start_count + 1, $list_count + $start_count); + } + } + } + + if(count($output->arg_columns)) + { + $columns = array(); + foreach($output->arg_columns as $col){ + if(strpos($col,'"')===false) $columns[] = '"'.$col.'"'; + else $columns[] = $col; + } + + $columns = join(',',$columns); + } + + $query = sprintf ("select %s from %s %s %s %s", $columns, implode (',',$table_list), implode (' ',$left_join), $condition, $groupby_query.$orderby_query); + $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf (' '.$this->comment_syntax, $this->query_id):''; + $result = $this->_query ($query); + + if ($this->isError ()) { + $buff = new Object (); + $buff->total_count = 0; + $buff->total_page = 0; + $buff->page = 1; + $buff->data = array (); + + $buff->page_navigation = new PageHandler ($total_count, $total_page, $page, $page_count); + + return $buff; + } + + $virtual_no = $total_count - ($page - 1) * $list_count; + while ($tmp = cubrid_fetch ($result, CUBRID_OBJECT)) { + if ($tmp) { + foreach ($tmp as $k => $v) { + $tmp->{$k} = rtrim($v); + } + } + $data[$virtual_no--] = $tmp; + } + + $buff = new Object (); + $buff->total_count = $total_count; + $buff->total_page = $total_page; + $buff->page = $page; + $buff->data = $data; + + $buff->page_navigation = new PageHandler ($total_count, $total_page, $page, $page_count); + + return $buff; + } + } + +return new DBCubrid; +?> diff --git a/classes/db/DBMssql.class.php b/classes/db/DBMssql.class.php index 13651a35a..3a0b75bb0 100644 --- a/classes/db/DBMssql.class.php +++ b/classes/db/DBMssql.class.php @@ -1,908 +1,908 @@ - 'bigint', - 'number' => 'int', - 'varchar' => 'varchar', - 'char' => 'char', - 'text' => 'text', - 'bigtext' => 'text', - 'date' => 'varchar(14)', - 'float' => 'float', - ); - - /** - * @brief constructor - **/ - function DBMssql() { - $this->_setDBInfo(); - $this->_connect(); - } - - /** - * @brief create an instance of this class - */ - function create() - { - return new DBMssql; - } - - /** - * @brief 설치 가능 여부를 return - **/ - function isSupported() { - if (!extension_loaded("sqlsrv")) return false; - return true; - } - - /** - * @brief DB정보 설정 및 connect/ close - **/ - function _setDBInfo() { - $db_info = Context::getDBInfo(); - $this->hostname = $db_info->db_hostname; - $this->port = $db_info->db_port; - $this->userid = $db_info->db_userid; - $this->password = $db_info->db_password; - $this->database = $db_info->db_database; - $this->prefix = $db_info->db_table_prefix; - - if(!substr($this->prefix,-1)!='_') $this->prefix .= '_'; - } - - /** - * @brief DB 접속 - **/ - function _connect() { - // db 정보가 없으면 무시 - if(!$this->hostname || !$this->database) return; - - //sqlsrv_configure( 'WarningsReturnAsErrors', 0 ); - //sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL ); - //sqlsrv_configure( 'LogSubsystems', SQLSRV_LOG_SYSTEM_ALL ); - - $this->conn = sqlsrv_connect( $this->hostname, - array( 'Database' => $this->database,'UID'=>$this->userid,'PWD'=>$this->password )); - - - // 접속체크 - if($this->conn){ - $this->is_connected = true; - $this->password = md5($this->password); - }else{ - $this->is_connected = false; - } - } - - /** - * @brief DB접속 해제 - **/ - function close() { - if($this->is_connected == false) return; - - $this->commit(); - sqlsrv_close($this->conn); - $this->conn = null; - } - - /** - * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 - **/ - function addQuotes($string) { - if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); - //if(!is_numeric($string)) $string = str_replace("'","''",$string); - - return $string; - } - - /** - * @brief 트랜잭션 시작 - **/ - function begin() { - if($this->is_connected == false || $this->transaction_started) return; - if(sqlsrv_begin_transaction( $this->conn ) === false) return; - - $this->transaction_started = true; - } - - /** - * @brief 롤백 - **/ - function rollback() { - if($this->is_connected == false || !$this->transaction_started) return; - - $this->transaction_started = false; - sqlsrv_rollback( $this->conn ); - } - - /** - * @brief 커밋 - **/ - function commit($force = false) { - if(!$force && ($this->is_connected == false || !$this->transaction_started)) return; - - $this->transaction_started = false; - sqlsrv_commit( $this->conn ); - } - - /** - * @brief : 쿼리문의 실행 및 결과의 fetch 처리 - * - * query : query문 실행하고 result return\n - * fetch : reutrn 된 값이 없으면 NULL\n - * rows이면 array object\n - * row이면 object\n - * return\n - **/ - function _query($query) { - if($this->is_connected == false || !$query) return; - - $_param = array(); - - if(count($this->param)){ - foreach($this->param as $k => $o){ - if($o['type'] == 'number'){ - $_param[] = &$o['value']; - }else{ - $_param[] = array(&$o['value'], SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STRING('utf-8')); - } - } - } - - // 쿼리 시작을 알림 - $this->actStart($query); - - // 쿼리 문 실행 - $result = false; - if(count($_param)){ - $result = @sqlsrv_query($this->conn, $query, $_param); - }else{ - $result = @sqlsrv_query($this->conn, $query); - } - - // 오류 체크 - if(!$result) $this->setError(print_r(sqlsrv_errors(),true)); - - // 쿼리 실행 종료를 알림 - $this->actFinish(); - $this->param = array(); - - return $result; - } - - /** - * @brief 결과를 fetch - **/ - function _fetch($result) { - if(!$this->isConnected() || $this->isError() || !$result) return; - - $c = sqlsrv_num_fields($result); - $m = null; - $output = array(); - - while(sqlsrv_fetch($result)){ - if(!$m) $m = sqlsrv_field_metadata($result); - unset($row); - for($i=0;$i<$c;$i++){ - $row->{$m[$i]['Name']} = sqlsrv_get_field( $result, $i, SQLSRV_PHPTYPE_STRING( 'utf-8' )); - } - $output[] = $row; - } - - if(count($output)==1) return $output[0]; - return $output; - - } - - /** - * @brief 1씩 증가되는 sequence값을 return (mssql의 auto_increment는 sequence테이블에서만 사용) - **/ - function getNextSequence() { - $query = sprintf("insert into %ssequence (seq) values (ident_incr('%ssequence'))", $this->prefix, $this->prefix); - $this->_query($query); - - $query = sprintf("select ident_current('%ssequence')+1 as sequence", $this->prefix); - $result = $this->_query($query); - $tmp = $this->_fetch($result); - - - return $tmp->sequence; - } - - /** - * @brief 테이블 기생성 여부 return - **/ - function isTableExists($target_name) { - $query = sprintf("select name from sysobjects where name = '%s%s' and xtype='U'", $this->prefix, $this->addQuotes($target_name)); - $result = $this->_query($query); - $tmp = $this->_fetch($result); - - if(!$tmp) return false; - return true; - } - - /** - * @brief 특정 테이블에 특정 column 추가 - **/ - function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) { - if($this->isColumnExists($table_name, $column_name)) return; - $type = $this->column_type[$type]; - if(strtoupper($type)=='INTEGER') $size = ''; - - $query = sprintf("alter table %s%s add %s ", $this->prefix, $table_name, $column_name); - if($size) $query .= sprintf(" %s(%s) ", $type, $size); - else $query .= sprintf(" %s ", $type); - if($default) $query .= sprintf(" default '%s' ", $default); - if($notnull) $query .= " not null "; - - $this->_query($query); - } - - /** - * @brief 특정 테이블에 특정 column 제거 - **/ - function dropColumn($table_name, $column_name) { - if(!$this->isColumnExists($table_name, $column_name)) return; - $query = sprintf("alter table %s%s drop %s ", $this->prefix, $table_name, $column_name); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 column의 정보를 return - **/ - 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); - $result = $this->_query($query); - if($this->isError()) return; - $tmp = $this->_fetch($result); - if(!$tmp->name) return false; - return true; - } - - /** - * @brief 특정 테이블에 특정 인덱스 추가 - * $target_columns = array(col1, col2) - * $is_unique? unique : none - **/ - function addIndex($table_name, $index_name, $target_columns, $is_unique = false) { - if($this->isIndexExists($table_name, $index_name)) return; - if(!is_array($target_columns)) $target_columns = array($target_columns); - - $query = sprintf("create %s index %s on %s%s (%s)", $is_unique?'unique':'', $index_name, $this->prefix, $table_name, implode(',',$target_columns)); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 특정 인덱스 삭제 - **/ - function dropIndex($table_name, $index_name, $is_unique = false) { - if(!$this->isIndexExists($table_name, $index_name)) return; - $query = sprintf("drop index %s%s.%s", $this->prefix, $table_name, $index_name); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 index 정보를 return - **/ - 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); - - $result = $this->_query($query); - if($this->isError()) return; - $tmp = $this->_fetch($result); - - if(!$tmp->name) return false; - return true; - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXml($xml_doc) { - return $this->_createTable($xml_doc); - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXmlFile($file_name) { - if(!file_exists($file_name)) return; - // xml 파일을 읽음 - $buff = FileHandler::readFile($file_name); - return $this->_createTable($buff); - } - - /** - * @brief schema xml을 이용하여 create table query생성 - * - * type : number, varchar, text, char, date, \n - * opt : notnull, default, size\n - * index : primary key, index, unique\n - **/ - function _createTable($xml_doc) { - // xml parsing - $oXml = new XmlParser(); - $xml_obj = $oXml->parse($xml_doc); - - // 테이블 생성 schema 작성 - $table_name = $xml_obj->table->attrs->name; - if($this->isTableExists($table_name)) return; - - if($table_name == 'sequence') { - $table_name = $this->prefix.$table_name; - $query = sprintf('create table %s ( sequence int identity(1,1), seq int )', $table_name); - return $this->_query($query); - } else { - $table_name = $this->prefix.$table_name; - - if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; - else $columns = $xml_obj->table->column; - - foreach($columns as $column) { - $name = $column->attrs->name; - $type = $column->attrs->type; - $size = $column->attrs->size; - $notnull = $column->attrs->notnull; - $primary_key = $column->attrs->primary_key; - $index = $column->attrs->index; - $unique = $column->attrs->unique; - $default = $column->attrs->default; - $auto_increment = $column->attrs->auto_increment; - - $column_schema[] = sprintf('[%s] %s%s %s %s %s %s', - $name, - $this->column_type[$type], - !in_array($type,array('number','text'))&&$size?'('.$size.')':'', - $primary_key?'primary key':'', - isset($default)?"default '".$default."'":'', - $notnull?'not null':'null', - $auto_increment?'identity(1,1)':'' - ); - - if($unique) $unique_list[$unique][] = $name; - else if($index) $index_list[$index][] = $name; - } - - $schema = sprintf('create table [%s] (xe_seq int identity(1,1),%s%s)', $this->addQuotes($table_name), "\n", implode($column_schema,",\n")); - $output = $this->_query($schema); - if(!$output) return false; - - if(count($unique_list)) { - foreach($unique_list as $key => $val) { - $query = sprintf("create unique index %s on %s (%s);", $key, $table_name, '['.implode('],[',$val).']'); - $this->_query($query); - } - } - - if(count($index_list)) { - foreach($index_list as $key => $val) { - $query = sprintf("create index %s on %s (%s);", $key, $table_name, '['.implode('],[',$val).']'); - $this->_query($query); - } - } - return true; - } - } - - /** - * @brief 조건문 작성하여 return - **/ - function getCondition($output) { - if(!$output->conditions) return; - $condition = $this->_getCondition($output->conditions,$output->column_type); - if($condition) $condition = ' where '.$condition; - return $condition; - } - - function getLeftCondition($conditions,$column_type){ - return $this->_getCondition($conditions,$column_type); - } - - - function _getCondition($conditions,$column_type) { - $condition = ''; - - foreach($conditions as $val) { - $sub_condition = ''; - foreach($val['condition'] as $v) { - if(!isset($v['value'])) continue; - if($v['value'] === '') continue; - if(!in_array(gettype($v['value']), array('string', 'integer', 'double'))) continue; - - $name = $v['column']; - if(preg_match('/^substr\(/i',$name)) $name = preg_replace('/^substr\(/i','substring(',$name); - $operation = $v['operation']; - $value = $v['value']; - - $type = $this->getColumnType($column_type,$name); - $pipe = $v['pipe']; - - $value = $this->getConditionValue($name, $value, $operation, $type, $column_type); - if(!$value) $value = $v['value']; - $str = $this->getConditionPart($name, $value, $operation); - if($sub_condition) $sub_condition .= ' '.$pipe.' '; - $sub_condition .= $str; - } - if($sub_condition) { - if($condition && $val['pipe']) $condition .= ' '.$val['pipe'].' '; - $condition .= '('.$sub_condition.')'; - } - } - return $condition; - } - - - function getConditionValue($name, $value, $operation, $type, $column_type) { - - if($type == 'number') { - if(strpos($value,',')===false && strpos($value,'(')===false){ - - if(is_integer($value)){ - $this->param[] = array('type'=>'number','value'=>(int)$value); - return '?'; - }else{ - return $value; - } - } - } - - if(strpos($name,'.')!==false&&strpos($value,'.')!==false) { - list($table_name, $column_name) = explode('.',$value); - if($column_type[$column_name]){ - return $value; - } - } - - switch($operation) { - case 'like_prefix' : - $value = preg_replace('/(^\'|\'$){1}/','',$value); - $this->param[] = array('type'=>$column_type[$name],'value'=>$value); - - $value = "? + '%'"; - break; - case 'like_tail' : - $value = preg_replace('/(^\'|\'$){1}/','',$value); - $this->param[] = array('type'=>$column_type[$name],'value'=>$value); - - $value = "'%' + ?"; - break; - case 'like' : - $value = preg_replace('/(^\'|\'$){1}/','',$value); - $this->param[] = array('type'=>$column_type[$name],'value'=>$value); - - $value = "'%' + ? + '%'"; - break; - case 'notin' : - preg_match_all('/,?\'([^\']*)\'/',$value,$match); - $val = array(); - foreach($match[1] as $k => $v){ - $this->param[] = array('type'=>$column_type[$name],'value'=>trim($v)); - $val[] ='?'; - } - $value = join(',',$val); - break; - case 'in' : - preg_match_all('/,?\'([^\']*)\'/',$value,$match); - $val = array(); - foreach($match[1] as $k => $v){ - $this->param[] = array('type'=>$column_type[$name],'value'=>trim($v)); - $val[] ='?'; - } - $value = join(',',$val); - break; - default: - $value = preg_replace('/(^\'|\'$){1}/','',$value); - $this->param[] = array('type'=>$column_type[$name],'value'=>$value); - $value = '?'; - break; - } - - return $value; - } - - /** - * @brief insertAct 처리 - **/ - function _executeInsertAct($output) { - - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = '['.$this->prefix.$val.']'; - } - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - $name = $val['name']; - $value = $val['value']; - - if($output->column_type[$name]!='number') { - $value = $this->addQuotes($value); - if(!$value) $value = ''; - } elseif(is_numeric($value)){ - if(!$value) $value = ''; - $value = (int)$value; - } elseif(!$value){ - $value = ''; - } - - $column_list[] = '['.$name.']'; - $value_list[] = '?'; - - $this->param[] = array('type'=>$output->column_type[$name], 'value'=>$value); - } - - $query = sprintf("insert into %s (%s) values (%s);", implode(',',$table_list), implode(',',$column_list), implode(',', $value_list)); - - return $this->_query($query); - } - - /** - * @brief updateAct 처리 - **/ - function _executeUpdateAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = '['.$this->prefix.$val.']'; - } - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - if(!isset($val['value'])) continue; - - $name = $val['name']; - $value = $val['value']; - if(strpos($name,'.')!==false&&strpos($value,'.')!==false){ - $column_list[] = $name.' = '.$value; - } else { - if($output->column_type[$name]!='number'){ - $value = $this->addQuotes($value); - if(!$value) $value = ''; - - $this->param[] = array('type'=>$output->column_type[$name], 'value'=>$value); - $column_list[] = sprintf("[%s] = ?", $name); - }elseif(!$value || is_numeric($value)){ - $value = (int)$value; - - $this->param[] = array('type'=>$output->column_type[$name], 'value'=>$value); - $column_list[] = sprintf("[%s] = ?", $name); - }else{ - if(!$value) $value = ''; - $column_list[] = sprintf("[%s] = %s", $name, $value); - } - - - } - } - - // 조건절 정리 - $condition = $this->getCondition($output); - - $query = sprintf("update %s set %s %s", implode(',',$table_list), implode(',',$column_list), $condition); - - return $this->_query($query); - } - - /** - * @brief deleteAct 처리 - **/ - function _executeDeleteAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = '['.$this->prefix.$val.']'; - } - - // 조건절 정리 - $condition = $this->getCondition($output); - - $query = sprintf("delete from %s %s", implode(',',$table_list), $condition); - - return $this->_query($query); - } - - /** - * @brief selectAct 처리 - * - * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n - * navigation이라는 method를 제공 - **/ - function _executeSelectAct($output) { - // 테이블 정리 - $table_list = array(); - foreach($output->tables as $key => $val) { - $table_list[] = '['.$this->prefix.$val.'] as '.$key; - } - - $left_join = array(); - // why??? - $left_tables= (array)$output->left_tables; - - foreach($left_tables as $key => $val) { - $condition = $this->_getCondition($output->left_conditions[$key],$output->column_type); - if($condition){ - $left_join[] = $val . ' ['.$this->prefix.$output->_tables[$key].'] as '.$key . ' on (' . $condition . ')'; - } - } - - $click_count = array(); - if(!$output->columns){ - $output->columns = array(array('name'=>'*')); - } - - $column_list = array(); - foreach($output->columns as $key => $val) { - $name = $val['name']; - if(preg_match('/^substr\(/i',$name)) $name = preg_replace('/^substr\(/i','substring(',$name); - $alias = $val['alias']; - if($val['click_count']) $click_count[] = $val['name']; - - if(substr($name,-1) == '*') { - $column_list[] = $name; - } elseif(strpos($name,'.')===false && strpos($name,'(')===false) { - if($alias) $column_list[$alias] = sprintf('[%s] as [%s]', $name, $alias); - else $column_list[] = sprintf('[%s]',$name); - } else { - if($alias) $column_list[$alias] = sprintf('%s as [%s]', $name, $alias); - else $column_list[] = sprintf('%s',$name); - } - } - $columns = implode(',',$column_list); - - $condition = $this->getCondition($output); - - $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에 쿼리 추가 - if($output->order) { - $conditions = $this->getConditionList($output); - if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - } - } - - 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); - if($column_list[$v]) $output->arg_columns[] = $column_list[$v]; - } - $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); - } - - if($output->order && !preg_match('/count\(\*\)/i',$columns) ) { - foreach($output->order as $key => $val) { - if(preg_match('/^substr\(/i',$val[0])) $name = preg_replace('/^substr\(/i','substring(',$val[0]); - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; - } - if(count($index_list)) $orderby_query = ' order by '.implode(',',$index_list); - } - - if(count($output->arg_columns)) - { - $columns = array(); - foreach($output->arg_columns as $col){ - if(strpos($col,'[')===false && strpos($col,' ')==false) $columns[] = '['.$col.']'; - else $columns[] = $col; - } - - $columns = join(',',$columns); - } - - $query = sprintf("%s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query); - // list_count를 사용할 경우 적용 - if($output->list_count['value']) $query = sprintf('select top %d %s', $output->list_count['value'], $query); - else $query = "select ".$query; - - $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):''; - $result = $this->_query($query); - if($this->isError()) return; - - if(count($click_count)>0 && count($output->conditions)>0){ - $_query = ''; - foreach($click_count as $k => $c) $_query .= sprintf(',%s=%s+1 ',$c,$c); - $_query = sprintf('update %s set %s %s',implode(',',$table_list), substr($_query,1), $condition); - $this->_query($_query); - } - - $data = $this->_fetch($result); - - $buff = new Object(); - $buff->data = $data; - return $buff; - } - - /** - * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 - * - * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; - **/ - function _getNavigationData($table_list, $columns, $left_join, $condition, $output) { - require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); - - $column_list = $output->column_list; - - // 전체 개수를 구함 - 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); - if($column_list[$v]) $output->arg_columns[] = $column_list[$v]; - } - $count_condition = sprintf('%s group by %s', $condition, implode(', ', $output->groups)); - }else{ - $count_condition = $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); - - $param = $this->param; - - $count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id . ' count(*)'):''; - $result = $this->_query($count_query); - - $this->param = $param; - $count_output = $this->_fetch($result); - - $total_count = (int)$count_output->count; - - $list_count = $output->list_count['value']; - if(!$list_count) $list_count = 20; - $page_count = $output->page_count['value']; - if(!$page_count) $page_count = 10; - $page = $output->page['value']; - if(!$page) $page = 1; - - // 전체 페이지를 구함 - if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1; - else $total_page = 1; - - // 페이지 변수를 체크 - if($page > $total_page) $page = $total_page; - $start_count = ($page-1)*$list_count; - - // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가 - $conditions = $this->getConditionList($output); - if($output->order) { - if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' %s < 2100000000 ', $col); - } - } - } - - // group by 절 추가 - 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); - if($column_list[$v]) $output->arg_columns[] = $column_list[$v]; - } - - $group = sprintf('group by %s', implode(',',$output->groups)); - } - - // order 절 추가 - $order_targets = array(); - if($output->order) { - foreach($output->order as $key => $val) { - if(preg_match('/^substr\(/i',$val[0])) $name = preg_replace('/^substr\(/i','substring(',$val[0]); - $order_targets[$val[0]] = $val[1]; - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; - } - if(count($index_list)) $order .= 'order by '.implode(',',$index_list); - } - if(!count($order_targets)) { - if(in_array('list_order',$conditions)) $order_targets['list_order'] = 'asc'; - else $order_targets['xe_seq'] = 'desc'; - } - - if(count($output->arg_columns)) - { - $columns = array(); - foreach($output->arg_columns as $col){ - if(strpos($col,'[')===false && strpos($col,' ')==false) $columns[] = '['.$col.']'; - else $columns[] = $col; - } - - $columns = join(',',$columns); - } - - if($start_count<1) { - $query = sprintf('select top %d %s from %s %s %s %s %s', $list_count, $columns, implode(',',$table_list), implode(' ',$left_join), $condition, $group, $order); - - } else { - foreach($order_targets as $k => $v) { - $first_columns[] = sprintf('%s(%s) as %s', $v=='asc'?'max':'min', $k, $k); - $first_sub_columns[] = $k; - } - - // 1차로 order 대상에 해당 하는 값을 가져옴 - $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); - $this->param = $param; - $tmp = $this->_fetch($result); - - - - // 1차에서 나온 값을 이용 다시 쿼리 실행 - $sub_cond = array(); - foreach($order_targets as $k => $v) { - $sub_cond[] = sprintf("%s %s '%s'", $k, $v=='asc'?'>':'<', $tmp->{$k}); - } - $sub_condition = ' and( '.implode(' and ',$sub_cond).' )'; - - if($condition) $condition .= $sub_condition; - else $condition = ' where '.$sub_condition; - $query = sprintf('select top %d %s from %s %s %s %s %s', $list_count, $columns, implode(',',$table_list), implode(' ',$left_join), $condition, $group, $order); - } - - $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):''; - $result = $this->_query($query); - - if($this->isError()) { - $buff = new Object(); - $buff->total_count = 0; - $buff->total_page = 0; - $buff->page = 1; - $buff->data = array(); - - $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); - return $buff; - } - - $virtual_no = $total_count - ($page-1)*$list_count; - - $output = $this->_fetch($result); - if(!is_array($output)) $output = array($output); - - foreach($output as $k => $v) { - $data[$virtual_no--] = $v; - } - - $buff = new Object(); - $buff->total_count = $total_count; - $buff->total_page = $total_page; - $buff->page = $page; - $buff->data = $data; - - $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); - return $buff; - } - - } - -return new DBMssql; -?> + 'bigint', + 'number' => 'int', + 'varchar' => 'varchar', + 'char' => 'char', + 'text' => 'text', + 'bigtext' => 'text', + 'date' => 'varchar(14)', + 'float' => 'float', + ); + + /** + * @brief constructor + **/ + function DBMssql() { + $this->_setDBInfo(); + $this->_connect(); + } + + /** + * @brief create an instance of this class + */ + function create() + { + return new DBMssql; + } + + /** + * @brief 설치 가능 여부를 return + **/ + function isSupported() { + if (!extension_loaded("sqlsrv")) return false; + return true; + } + + /** + * @brief DB정보 설정 및 connect/ close + **/ + function _setDBInfo() { + $db_info = Context::getDBInfo(); + $this->hostname = $db_info->db_hostname; + $this->port = $db_info->db_port; + $this->userid = $db_info->db_userid; + $this->password = $db_info->db_password; + $this->database = $db_info->db_database; + $this->prefix = $db_info->db_table_prefix; + + if(!substr($this->prefix,-1)!='_') $this->prefix .= '_'; + } + + /** + * @brief DB 접속 + **/ + function _connect() { + // db 정보가 없으면 무시 + if(!$this->hostname || !$this->database) return; + + //sqlsrv_configure( 'WarningsReturnAsErrors', 0 ); + //sqlsrv_configure( 'LogSeverity', SQLSRV_LOG_SEVERITY_ALL ); + //sqlsrv_configure( 'LogSubsystems', SQLSRV_LOG_SYSTEM_ALL ); + + $this->conn = sqlsrv_connect( $this->hostname, + array( 'Database' => $this->database,'UID'=>$this->userid,'PWD'=>$this->password )); + + + // 접속체크 + if($this->conn){ + $this->is_connected = true; + $this->password = md5($this->password); + }else{ + $this->is_connected = false; + } + } + + /** + * @brief DB접속 해제 + **/ + function close() { + if($this->is_connected == false) return; + + $this->commit(); + sqlsrv_close($this->conn); + $this->conn = null; + } + + /** + * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 + **/ + function addQuotes($string) { + if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); + //if(!is_numeric($string)) $string = str_replace("'","''",$string); + + return $string; + } + + /** + * @brief 트랜잭션 시작 + **/ + function begin() { + if($this->is_connected == false || $this->transaction_started) return; + if(sqlsrv_begin_transaction( $this->conn ) === false) return; + + $this->transaction_started = true; + } + + /** + * @brief 롤백 + **/ + function rollback() { + if($this->is_connected == false || !$this->transaction_started) return; + + $this->transaction_started = false; + sqlsrv_rollback( $this->conn ); + } + + /** + * @brief 커밋 + **/ + function commit($force = false) { + if(!$force && ($this->is_connected == false || !$this->transaction_started)) return; + + $this->transaction_started = false; + sqlsrv_commit( $this->conn ); + } + + /** + * @brief : 쿼리문의 실행 및 결과의 fetch 처리 + * + * query : query문 실행하고 result return\n + * fetch : reutrn 된 값이 없으면 NULL\n + * rows이면 array object\n + * row이면 object\n + * return\n + **/ + function _query($query) { + if($this->is_connected == false || !$query) return; + + $_param = array(); + + if(count($this->param)){ + foreach($this->param as $k => $o){ + if($o['type'] == 'number'){ + $_param[] = &$o['value']; + }else{ + $_param[] = array(&$o['value'], SQLSRV_PARAM_IN, SQLSRV_PHPTYPE_STRING('utf-8')); + } + } + } + + // 쿼리 시작을 알림 + $this->actStart($query); + + // 쿼리 문 실행 + $result = false; + if(count($_param)){ + $result = @sqlsrv_query($this->conn, $query, $_param); + }else{ + $result = @sqlsrv_query($this->conn, $query); + } + + // 오류 체크 + if(!$result) $this->setError(print_r(sqlsrv_errors(),true)); + + // 쿼리 실행 종료를 알림 + $this->actFinish(); + $this->param = array(); + + return $result; + } + + /** + * @brief 결과를 fetch + **/ + function _fetch($result) { + if(!$this->isConnected() || $this->isError() || !$result) return; + + $c = sqlsrv_num_fields($result); + $m = null; + $output = array(); + + while(sqlsrv_fetch($result)){ + if(!$m) $m = sqlsrv_field_metadata($result); + unset($row); + for($i=0;$i<$c;$i++){ + $row->{$m[$i]['Name']} = sqlsrv_get_field( $result, $i, SQLSRV_PHPTYPE_STRING( 'utf-8' )); + } + $output[] = $row; + } + + if(count($output)==1) return $output[0]; + return $output; + + } + + /** + * @brief 1씩 증가되는 sequence값을 return (mssql의 auto_increment는 sequence테이블에서만 사용) + **/ + function getNextSequence() { + $query = sprintf("insert into %ssequence (seq) values (ident_incr('%ssequence'))", $this->prefix, $this->prefix); + $this->_query($query); + + $query = sprintf("select ident_current('%ssequence')+1 as sequence", $this->prefix); + $result = $this->_query($query); + $tmp = $this->_fetch($result); + + + return $tmp->sequence; + } + + /** + * @brief 테이블 기생성 여부 return + **/ + function isTableExists($target_name) { + $query = sprintf("select name from sysobjects where name = '%s%s' and xtype='U'", $this->prefix, $this->addQuotes($target_name)); + $result = $this->_query($query); + $tmp = $this->_fetch($result); + + if(!$tmp) return false; + return true; + } + + /** + * @brief 특정 테이블에 특정 column 추가 + **/ + function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) { + if($this->isColumnExists($table_name, $column_name)) return; + $type = $this->column_type[$type]; + if(strtoupper($type)=='INTEGER') $size = ''; + + $query = sprintf("alter table %s%s add %s ", $this->prefix, $table_name, $column_name); + if($size) $query .= sprintf(" %s(%s) ", $type, $size); + else $query .= sprintf(" %s ", $type); + if($default) $query .= sprintf(" default '%s' ", $default); + if($notnull) $query .= " not null "; + + $this->_query($query); + } + + /** + * @brief 특정 테이블에 특정 column 제거 + **/ + function dropColumn($table_name, $column_name) { + if(!$this->isColumnExists($table_name, $column_name)) return; + $query = sprintf("alter table %s%s drop %s ", $this->prefix, $table_name, $column_name); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 column의 정보를 return + **/ + 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); + $result = $this->_query($query); + if($this->isError()) return; + $tmp = $this->_fetch($result); + if(!$tmp->name) return false; + return true; + } + + /** + * @brief 특정 테이블에 특정 인덱스 추가 + * $target_columns = array(col1, col2) + * $is_unique? unique : none + **/ + function addIndex($table_name, $index_name, $target_columns, $is_unique = false) { + if($this->isIndexExists($table_name, $index_name)) return; + if(!is_array($target_columns)) $target_columns = array($target_columns); + + $query = sprintf("create %s index %s on %s%s (%s)", $is_unique?'unique':'', $index_name, $this->prefix, $table_name, implode(',',$target_columns)); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 특정 인덱스 삭제 + **/ + function dropIndex($table_name, $index_name, $is_unique = false) { + if(!$this->isIndexExists($table_name, $index_name)) return; + $query = sprintf("drop index %s%s.%s", $this->prefix, $table_name, $index_name); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 index 정보를 return + **/ + 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); + + $result = $this->_query($query); + if($this->isError()) return; + $tmp = $this->_fetch($result); + + if(!$tmp->name) return false; + return true; + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXml($xml_doc) { + return $this->_createTable($xml_doc); + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXmlFile($file_name) { + if(!file_exists($file_name)) return; + // xml 파일을 읽음 + $buff = FileHandler::readFile($file_name); + return $this->_createTable($buff); + } + + /** + * @brief schema xml을 이용하여 create table query생성 + * + * type : number, varchar, text, char, date, \n + * opt : notnull, default, size\n + * index : primary key, index, unique\n + **/ + function _createTable($xml_doc) { + // xml parsing + $oXml = new XmlParser(); + $xml_obj = $oXml->parse($xml_doc); + + // 테이블 생성 schema 작성 + $table_name = $xml_obj->table->attrs->name; + if($this->isTableExists($table_name)) return; + + if($table_name == 'sequence') { + $table_name = $this->prefix.$table_name; + $query = sprintf('create table %s ( sequence int identity(1,1), seq int )', $table_name); + return $this->_query($query); + } else { + $table_name = $this->prefix.$table_name; + + if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; + else $columns = $xml_obj->table->column; + + foreach($columns as $column) { + $name = $column->attrs->name; + $type = $column->attrs->type; + $size = $column->attrs->size; + $notnull = $column->attrs->notnull; + $primary_key = $column->attrs->primary_key; + $index = $column->attrs->index; + $unique = $column->attrs->unique; + $default = $column->attrs->default; + $auto_increment = $column->attrs->auto_increment; + + $column_schema[] = sprintf('[%s] %s%s %s %s %s %s', + $name, + $this->column_type[$type], + !in_array($type,array('number','text'))&&$size?'('.$size.')':'', + $primary_key?'primary key':'', + isset($default)?"default '".$default."'":'', + $notnull?'not null':'null', + $auto_increment?'identity(1,1)':'' + ); + + if($unique) $unique_list[$unique][] = $name; + else if($index) $index_list[$index][] = $name; + } + + $schema = sprintf('create table [%s] (xe_seq int identity(1,1),%s%s)', $this->addQuotes($table_name), "\n", implode($column_schema,",\n")); + $output = $this->_query($schema); + if(!$output) return false; + + if(count($unique_list)) { + foreach($unique_list as $key => $val) { + $query = sprintf("create unique index %s on %s (%s);", $key, $table_name, '['.implode('],[',$val).']'); + $this->_query($query); + } + } + + if(count($index_list)) { + foreach($index_list as $key => $val) { + $query = sprintf("create index %s on %s (%s);", $key, $table_name, '['.implode('],[',$val).']'); + $this->_query($query); + } + } + return true; + } + } + + /** + * @brief 조건문 작성하여 return + **/ + function getCondition($output) { + if(!$output->conditions) return; + $condition = $this->_getCondition($output->conditions,$output->column_type); + if($condition) $condition = ' where '.$condition; + return $condition; + } + + function getLeftCondition($conditions,$column_type){ + return $this->_getCondition($conditions,$column_type); + } + + + function _getCondition($conditions,$column_type) { + $condition = ''; + + foreach($conditions as $val) { + $sub_condition = ''; + foreach($val['condition'] as $v) { + if(!isset($v['value'])) continue; + if($v['value'] === '') continue; + if(!in_array(gettype($v['value']), array('string', 'integer', 'double'))) continue; + + $name = $v['column']; + if(preg_match('/^substr\(/i',$name)) $name = preg_replace('/^substr\(/i','substring(',$name); + $operation = $v['operation']; + $value = $v['value']; + + $type = $this->getColumnType($column_type,$name); + $pipe = $v['pipe']; + + $value = $this->getConditionValue($name, $value, $operation, $type, $column_type); + if(!$value) $value = $v['value']; + $str = $this->getConditionPart($name, $value, $operation); + if($sub_condition) $sub_condition .= ' '.$pipe.' '; + $sub_condition .= $str; + } + if($sub_condition) { + if($condition && $val['pipe']) $condition .= ' '.$val['pipe'].' '; + $condition .= '('.$sub_condition.')'; + } + } + return $condition; + } + + + function getConditionValue($name, $value, $operation, $type, $column_type) { + + if($type == 'number') { + if(strpos($value,',')===false && strpos($value,'(')===false){ + + if(is_integer($value)){ + $this->param[] = array('type'=>'number','value'=>(int)$value); + return '?'; + }else{ + return $value; + } + } + } + + if(strpos($name,'.')!==false&&strpos($value,'.')!==false) { + list($table_name, $column_name) = explode('.',$value); + if($column_type[$column_name]){ + return $value; + } + } + + switch($operation) { + case 'like_prefix' : + $value = preg_replace('/(^\'|\'$){1}/','',$value); + $this->param[] = array('type'=>$column_type[$name],'value'=>$value); + + $value = "? + '%'"; + break; + case 'like_tail' : + $value = preg_replace('/(^\'|\'$){1}/','',$value); + $this->param[] = array('type'=>$column_type[$name],'value'=>$value); + + $value = "'%' + ?"; + break; + case 'like' : + $value = preg_replace('/(^\'|\'$){1}/','',$value); + $this->param[] = array('type'=>$column_type[$name],'value'=>$value); + + $value = "'%' + ? + '%'"; + break; + case 'notin' : + preg_match_all('/,?\'([^\']*)\'/',$value,$match); + $val = array(); + foreach($match[1] as $k => $v){ + $this->param[] = array('type'=>$column_type[$name],'value'=>trim($v)); + $val[] ='?'; + } + $value = join(',',$val); + break; + case 'in' : + preg_match_all('/,?\'([^\']*)\'/',$value,$match); + $val = array(); + foreach($match[1] as $k => $v){ + $this->param[] = array('type'=>$column_type[$name],'value'=>trim($v)); + $val[] ='?'; + } + $value = join(',',$val); + break; + default: + $value = preg_replace('/(^\'|\'$){1}/','',$value); + $this->param[] = array('type'=>$column_type[$name],'value'=>$value); + $value = '?'; + break; + } + + return $value; + } + + /** + * @brief insertAct 처리 + **/ + function _executeInsertAct($output) { + + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = '['.$this->prefix.$val.']'; + } + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + $name = $val['name']; + $value = $val['value']; + + if($output->column_type[$name]!='number') { + $value = $this->addQuotes($value); + if(!$value) $value = ''; + } elseif(is_numeric($value)){ + if(!$value) $value = ''; + $value = (int)$value; + } elseif(!$value){ + $value = ''; + } + + $column_list[] = '['.$name.']'; + $value_list[] = '?'; + + $this->param[] = array('type'=>$output->column_type[$name], 'value'=>$value); + } + + $query = sprintf("insert into %s (%s) values (%s);", implode(',',$table_list), implode(',',$column_list), implode(',', $value_list)); + + return $this->_query($query); + } + + /** + * @brief updateAct 처리 + **/ + function _executeUpdateAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = '['.$this->prefix.$val.']'; + } + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + if(!isset($val['value'])) continue; + + $name = $val['name']; + $value = $val['value']; + if(strpos($name,'.')!==false&&strpos($value,'.')!==false){ + $column_list[] = $name.' = '.$value; + } else { + if($output->column_type[$name]!='number'){ + $value = $this->addQuotes($value); + if(!$value) $value = ''; + + $this->param[] = array('type'=>$output->column_type[$name], 'value'=>$value); + $column_list[] = sprintf("[%s] = ?", $name); + }elseif(!$value || is_numeric($value)){ + $value = (int)$value; + + $this->param[] = array('type'=>$output->column_type[$name], 'value'=>$value); + $column_list[] = sprintf("[%s] = ?", $name); + }else{ + if(!$value) $value = ''; + $column_list[] = sprintf("[%s] = %s", $name, $value); + } + + + } + } + + // 조건절 정리 + $condition = $this->getCondition($output); + + $query = sprintf("update %s set %s %s", implode(',',$table_list), implode(',',$column_list), $condition); + + return $this->_query($query); + } + + /** + * @brief deleteAct 처리 + **/ + function _executeDeleteAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = '['.$this->prefix.$val.']'; + } + + // 조건절 정리 + $condition = $this->getCondition($output); + + $query = sprintf("delete from %s %s", implode(',',$table_list), $condition); + + return $this->_query($query); + } + + /** + * @brief selectAct 처리 + * + * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n + * navigation이라는 method를 제공 + **/ + function _executeSelectAct($output) { + // 테이블 정리 + $table_list = array(); + foreach($output->tables as $key => $val) { + $table_list[] = '['.$this->prefix.$val.'] as '.$key; + } + + $left_join = array(); + // why??? + $left_tables= (array)$output->left_tables; + + foreach($left_tables as $key => $val) { + $condition = $this->_getCondition($output->left_conditions[$key],$output->column_type); + if($condition){ + $left_join[] = $val . ' ['.$this->prefix.$output->_tables[$key].'] as '.$key . ' on (' . $condition . ')'; + } + } + + $click_count = array(); + if(!$output->columns){ + $output->columns = array(array('name'=>'*')); + } + + $column_list = array(); + foreach($output->columns as $key => $val) { + $name = $val['name']; + if(preg_match('/^substr\(/i',$name)) $name = preg_replace('/^substr\(/i','substring(',$name); + $alias = $val['alias']; + if($val['click_count']) $click_count[] = $val['name']; + + if(substr($name,-1) == '*') { + $column_list[] = $name; + } elseif(strpos($name,'.')===false && strpos($name,'(')===false) { + if($alias) $column_list[$alias] = sprintf('[%s] as [%s]', $name, $alias); + else $column_list[] = sprintf('[%s]',$name); + } else { + if($alias) $column_list[$alias] = sprintf('%s as [%s]', $name, $alias); + else $column_list[] = sprintf('%s',$name); + } + } + $columns = implode(',',$column_list); + + $condition = $this->getCondition($output); + + $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에 쿼리 추가 + if($output->order) { + $conditions = $this->getConditionList($output); + if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + } + } + + 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); + if($column_list[$v]) $output->arg_columns[] = $column_list[$v]; + } + $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); + } + + if($output->order && !preg_match('/count\(\*\)/i',$columns) ) { + foreach($output->order as $key => $val) { + if(preg_match('/^substr\(/i',$val[0])) $name = preg_replace('/^substr\(/i','substring(',$val[0]); + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; + } + if(count($index_list)) $orderby_query = ' order by '.implode(',',$index_list); + } + + if(count($output->arg_columns)) + { + $columns = array(); + foreach($output->arg_columns as $col){ + if(strpos($col,'[')===false && strpos($col,' ')==false) $columns[] = '['.$col.']'; + else $columns[] = $col; + } + + $columns = join(',',$columns); + } + + $query = sprintf("%s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query); + // list_count를 사용할 경우 적용 + if($output->list_count['value']) $query = sprintf('select top %d %s', $output->list_count['value'], $query); + else $query = "select ".$query; + + $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):''; + $result = $this->_query($query); + if($this->isError()) return; + + if(count($click_count)>0 && count($output->conditions)>0){ + $_query = ''; + foreach($click_count as $k => $c) $_query .= sprintf(',%s=%s+1 ',$c,$c); + $_query = sprintf('update %s set %s %s',implode(',',$table_list), substr($_query,1), $condition); + $this->_query($_query); + } + + $data = $this->_fetch($result); + + $buff = new Object(); + $buff->data = $data; + return $buff; + } + + /** + * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 + * + * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; + **/ + function _getNavigationData($table_list, $columns, $left_join, $condition, $output) { + require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); + + $column_list = $output->column_list; + + // 전체 개수를 구함 + 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); + if($column_list[$v]) $output->arg_columns[] = $column_list[$v]; + } + $count_condition = sprintf('%s group by %s', $condition, implode(', ', $output->groups)); + }else{ + $count_condition = $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); + + $param = $this->param; + + $count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id . ' count(*)'):''; + $result = $this->_query($count_query); + + $this->param = $param; + $count_output = $this->_fetch($result); + + $total_count = (int)$count_output->count; + + $list_count = $output->list_count['value']; + if(!$list_count) $list_count = 20; + $page_count = $output->page_count['value']; + if(!$page_count) $page_count = 10; + $page = $output->page['value']; + if(!$page) $page = 1; + + // 전체 페이지를 구함 + if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1; + else $total_page = 1; + + // 페이지 변수를 체크 + if($page > $total_page) $page = $total_page; + $start_count = ($page-1)*$list_count; + + // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가 + $conditions = $this->getConditionList($output); + if($output->order) { + if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' %s < 2100000000 ', $col); + } + } + } + + // group by 절 추가 + 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); + if($column_list[$v]) $output->arg_columns[] = $column_list[$v]; + } + + $group = sprintf('group by %s', implode(',',$output->groups)); + } + + // order 절 추가 + $order_targets = array(); + if($output->order) { + foreach($output->order as $key => $val) { + if(preg_match('/^substr\(/i',$val[0])) $name = preg_replace('/^substr\(/i','substring(',$val[0]); + $order_targets[$val[0]] = $val[1]; + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; + } + if(count($index_list)) $order .= 'order by '.implode(',',$index_list); + } + if(!count($order_targets)) { + if(in_array('list_order',$conditions)) $order_targets['list_order'] = 'asc'; + else $order_targets['xe_seq'] = 'desc'; + } + + if(count($output->arg_columns)) + { + $columns = array(); + foreach($output->arg_columns as $col){ + if(strpos($col,'[')===false && strpos($col,' ')==false) $columns[] = '['.$col.']'; + else $columns[] = $col; + } + + $columns = join(',',$columns); + } + + if($start_count<1) { + $query = sprintf('select top %d %s from %s %s %s %s %s', $list_count, $columns, implode(',',$table_list), implode(' ',$left_join), $condition, $group, $order); + + } else { + foreach($order_targets as $k => $v) { + $first_columns[] = sprintf('%s(%s) as %s', $v=='asc'?'max':'min', $k, $k); + $first_sub_columns[] = $k; + } + + // 1차로 order 대상에 해당 하는 값을 가져옴 + $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); + $this->param = $param; + $tmp = $this->_fetch($result); + + + + // 1차에서 나온 값을 이용 다시 쿼리 실행 + $sub_cond = array(); + foreach($order_targets as $k => $v) { + $sub_cond[] = sprintf("%s %s '%s'", $k, $v=='asc'?'>':'<', $tmp->{$k}); + } + $sub_condition = ' and( '.implode(' and ',$sub_cond).' )'; + + if($condition) $condition .= $sub_condition; + else $condition = ' where '.$sub_condition; + $query = sprintf('select top %d %s from %s %s %s %s %s', $list_count, $columns, implode(',',$table_list), implode(' ',$left_join), $condition, $group, $order); + } + + $query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id):''; + $result = $this->_query($query); + + if($this->isError()) { + $buff = new Object(); + $buff->total_count = 0; + $buff->total_page = 0; + $buff->page = 1; + $buff->data = array(); + + $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); + return $buff; + } + + $virtual_no = $total_count - ($page-1)*$list_count; + + $output = $this->_fetch($result); + if(!is_array($output)) $output = array($output); + + foreach($output as $k => $v) { + $data[$virtual_no--] = $v; + } + + $buff = new Object(); + $buff->total_count = $total_count; + $buff->total_page = $total_page; + $buff->page = $page; + $buff->data = $data; + + $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); + return $buff; + } + + } + +return new DBMssql; +?> diff --git a/classes/db/DBMysql.class.php b/classes/db/DBMysql.class.php index 8a5072850..1caab871c 100644 --- a/classes/db/DBMysql.class.php +++ b/classes/db/DBMysql.class.php @@ -1,780 +1,780 @@ - 'bigint', - 'number' => 'bigint', - 'varchar' => 'varchar', - 'char' => 'char', - 'text' => 'text', - 'bigtext' => 'longtext', - 'date' => 'varchar(14)', - 'float' => 'float', - ); - - /** - * @brief constructor - **/ - function DBMysql() { - $this->_setDBInfo(); - $this->_connect(); - } - - function create() { - return new DBMysql; - } - - /** - * @brief 설치 가능 여부를 return - **/ - function isSupported() { - if(!function_exists('mysql_connect')) return false; - return true; - } - - /** - * @brief DB정보 설정 및 connect/ close - **/ - function _setDBInfo() { - $db_info = Context::getDBInfo(); - $this->hostname = $db_info->db_hostname; - $this->port = $db_info->db_port; - $this->userid = $db_info->db_userid; - $this->password = $db_info->db_password; - $this->database = $db_info->db_database; - $this->prefix = $db_info->db_table_prefix; - if(!substr($this->prefix,-1)!='_') $this->prefix .= '_'; - } - - /** - * @brief DB 접속 - **/ - function _connect() { - // db 정보가 없으면 무시 - if(!$this->hostname || !$this->userid || !$this->password || !$this->database) return; - - if(strpos($this->hostname, ':')===false && $this->port) $this->hostname .= ':'.$this->port; - - // 접속시도 - $this->fd = @mysql_connect($this->hostname, $this->userid, $this->password); - if(mysql_error()) { - $this->setError(mysql_errno(), mysql_error()); - return; - } - - // 버전 확인후 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 선택 - @mysql_select_db($this->database, $this->fd); - if(mysql_error()) { - $this->setError(mysql_errno(), mysql_error()); - return; - } - - // 접속체크 - $this->is_connected = true; - $this->password = md5($this->password); - - // mysql의 경우 utf8임을 지정 - $this->_query("set names 'utf8'"); - } - - /** - * @brief DB접속 해제 - **/ - function close() { - if(!$this->isConnected()) return; - @mysql_close($this->fd); - } - - /** - * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 - **/ - function addQuotes($string) { - if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); - if(!is_numeric($string)) $string = @mysql_escape_string($string); - return $string; - } - - /** - * @brief 트랜잭션 시작 - **/ - function begin() { - } - - /** - * @brief 롤백 - **/ - function rollback() { - } - - /** - * @brief 커밋 - **/ - function commit() { - } - - /** - * @brief : 쿼리문의 실행 및 결과의 fetch 처리 - * - * query : query문 실행하고 result return\n - * fetch : reutrn 된 값이 없으면 NULL\n - * rows이면 array object\n - * row이면 object\n - * return\n - **/ - function _query($query) { - if(!$this->isConnected()) return; - - // 쿼리 시작을 알림 - $this->actStart($query); - - // 쿼리 문 실행 - $result = @mysql_query($query, $this->fd); - - // 오류 체크 - if(mysql_error($this->fd)) $this->setError(mysql_errno($this->fd), mysql_error($this->fd)); - - // 쿼리 실행 종료를 알림 - $this->actFinish(); - - // 결과 리턴 - return $result; - } - - /** - * @brief 결과를 fetch - **/ - function _fetch($result) { - if(!$this->isConnected() || $this->isError() || !$result) return; - while($tmp = $this->db_fetch_object($result)) { - $output[] = $tmp; - } - if(count($output)==1) return $output[0]; - return $output; - } - - /** - * @brief 1씩 증가되는 sequence값을 return (mysql의 auto_increment는 sequence테이블에서만 사용) - **/ - function getNextSequence() { - $query = sprintf("insert into `%ssequence` (seq) values ('0')", $this->prefix); - $this->_query($query); - $sequence = $this->db_insert_id(); - if($sequence % 10000 == 0) { - $query = sprintf("delete from `%ssequence` where seq < %d", $this->prefix, $sequence); - $this->_query($query); - } - - return $sequence; - } - - /** - * @brief mysql old password를 가져오는 함수 (mysql에서만 사용) - **/ - function isValidOldPassword($password, $saved_password) { - $query = sprintf("select password('%s') as password, old_password('%s') as old_password", $this->addQuotes($password), $this->addQuotes($password)); - $result = $this->_query($query); - $tmp = $this->_fetch($result); - if($tmp->password == $saved_password || $tmp->old_password == $saved_password) return true; - return false; - } - - /** - * @brief 테이블 기생성 여부 return - **/ - function isTableExists($target_name) { - $query = sprintf("show tables like '%s%s'", $this->prefix, $this->addQuotes($target_name)); - $result = $this->_query($query); - $tmp = $this->_fetch($result); - if(!$tmp) return false; - return true; - } - - /** - * @brief 특정 테이블에 특정 column 추가 - **/ - function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) { - $type = $this->column_type[$type]; - if(strtoupper($type)=='INTEGER') $size = ''; - - $query = sprintf("alter table `%s%s` add `%s` ", $this->prefix, $table_name, $column_name); - if($size) $query .= sprintf(" %s(%s) ", $type, $size); - else $query .= sprintf(" %s ", $type); - if($default) $query .= sprintf(" default '%s' ", $default); - if($notnull) $query .= " not null "; - - $this->_query($query); - } - - /** - * @brief 특정 테이블에 특정 column 제거 - **/ - function dropColumn($table_name, $column_name) { - $query = sprintf("alter table `%s%s` drop `%s` ", $this->prefix, $table_name, $column_name); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 column의 정보를 return - **/ - function isColumnExists($table_name, $column_name) { - $query = sprintf("show fields from `%s%s`", $this->prefix, $table_name); - $result = $this->_query($query); - if($this->isError()) return; - $output = $this->_fetch($result); - if($output) { - $column_name = strtolower($column_name); - foreach($output as $key => $val) { - $name = strtolower($val->Field); - if($column_name == $name) return true; - } - } - return false; - } - - /** - * @brief 특정 테이블에 특정 인덱스 추가 - * $target_columns = array(col1, col2) - * $is_unique? unique : none - **/ - function addIndex($table_name, $index_name, $target_columns, $is_unique = false) { - if(!is_array($target_columns)) $target_columns = array($target_columns); - - $query = sprintf("alter table `%s%s` add %s index `%s` (%s);", $this->prefix, $table_name, $is_unique?'unique':'', $index_name, implode(',',$target_columns)); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 특정 인덱스 삭제 - **/ - function dropIndex($table_name, $index_name, $is_unique = false) { - $query = sprintf("alter table `%s%s` drop index `%s`", $this->prefix, $table_name, $index_name); - $this->_query($query); - } - - - /** - * @brief 특정 테이블의 index 정보를 return - **/ - function isIndexExists($table_name, $index_name) { - //$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name); - $query = sprintf("show indexes from `%s%s`", $this->prefix, $table_name); - $result = $this->_query($query); - if($this->isError()) return; - $output = $this->_fetch($result); - if(!$output) return; - if(!is_array($output)) $output = array($output); - - for($i=0;$iKey_name == $index_name) return true; - } - return false; - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXml($xml_doc) { - return $this->_createTable($xml_doc); - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXmlFile($file_name) { - if(!file_exists($file_name)) return; - // xml 파일을 읽음 - $buff = FileHandler::readFile($file_name); - return $this->_createTable($buff); - } - - /** - * @brief schema xml을 이용하여 create table query생성 - * - * type : number, varchar, text, char, date, \n - * opt : notnull, default, size\n - * index : primary key, index, unique\n - **/ - function _createTable($xml_doc) { - // xml parsing - $oXml = new XmlParser(); - $xml_obj = $oXml->parse($xml_doc); - - // 테이블 생성 schema 작성 - $table_name = $xml_obj->table->attrs->name; - if($this->isTableExists($table_name)) return; - $table_name = $this->prefix.$table_name; - - if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; - else $columns = $xml_obj->table->column; - - foreach($columns as $column) { - $name = $column->attrs->name; - $type = $column->attrs->type; - $size = $column->attrs->size; - $notnull = $column->attrs->notnull; - $primary_key = $column->attrs->primary_key; - $index = $column->attrs->index; - $unique = $column->attrs->unique; - $default = $column->attrs->default; - $auto_increment = $column->attrs->auto_increment; - - $column_schema[] = sprintf('`%s` %s%s %s %s %s', - $name, - $this->column_type[$type], - $size?'('.$size.')':'', - isset($default)?"default '".$default."'":'', - $notnull?'not null':'', - $auto_increment?'auto_increment':'' - ); - - if($primary_key) $primary_list[] = $name; - else if($unique) $unique_list[$unique][] = $name; - else if($index) $index_list[$index][] = $name; - } - - if(count($primary_list)) { - $column_schema[] = sprintf("primary key (%s)", '`'.implode($primary_list,'`,`').'`'); - } - - if(count($unique_list)) { - foreach($unique_list as $key => $val) { - $column_schema[] = sprintf("unique %s (%s)", $key, '`'.implode($val,'`,`').'`'); - } - } - - if(count($index_list)) { - foreach($index_list as $key => $val) { - $column_schema[] = sprintf("index %s (%s)", $key, '`'.implode($val,'`,`').'`'); - } - } - - $schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema,",\n"), "ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci"); - - $output = $this->_query($schema); - if(!$output) return false; - } - - /** - * @brief 조건문 작성하여 return - **/ - function getCondition($output) { - if(!$output->conditions) return; - $condition = $this->_getCondition($output->conditions,$output->column_type); - if($condition) $condition = ' where '.$condition; - return $condition; - } - - function getLeftCondition($conditions,$column_type){ - return $this->_getCondition($conditions,$column_type); - } - - - function _getCondition($conditions,$column_type) { - $condition = ''; - foreach($conditions as $val) { - $sub_condition = ''; - foreach($val['condition'] as $v) { - if(!isset($v['value'])) continue; - if($v['value'] === '') continue; - if(!in_array(gettype($v['value']), array('string', 'integer', 'double', 'array'))) continue; - - $name = $v['column']; - $operation = $v['operation']; - $value = $v['value']; - $type = $this->getColumnType($column_type,$name); - $pipe = $v['pipe']; - $value = $this->getConditionValue($name, $value, $operation, $type, $column_type); - if(!$value) $value = $v['value']; - $str = $this->getConditionPart($name, $value, $operation); - if($sub_condition) $sub_condition .= ' '.$pipe.' '; - $sub_condition .= $str; - } - if($sub_condition) { - if($condition && $val['pipe']) $condition .= ' '.$val['pipe'].' '; - $condition .= '('.$sub_condition.')'; - } - } - return $condition; - } - - /** - * @brief insertAct 처리 - **/ - function _executeInsertAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = '`'.$this->prefix.$val.'`'; - } - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - $name = $val['name']; - $value = $val['value']; - - if($output->column_type[$name]!='number') { - - if(!is_null($value)){ - $value = "'" . $this->addQuotes($value) ."'"; - }else{ - if($val['notnull']=='notnull') { - $value = "''"; - } else { - //$value = 'null'; - $value = "''"; - } - } - - } elseif(!$value || is_numeric($value)) $value = (int)$value; - - $column_list[] = '`'.$name.'`'; - $value_list[] = $value; - } - - $query = sprintf("insert into %s (%s) values (%s);", implode(',',$table_list), implode(',',$column_list), implode(',', $value_list)); - return $this->_query($query); - } - - /** - * @brief updateAct 처리 - **/ - function _executeUpdateAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = '`'.$this->prefix.$val.'` as '.$key; - } - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - if(!isset($val['value'])) continue; - $name = $val['name']; - $value = $val['value']; - if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value; - else { - if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'"; - elseif(!$value || is_numeric($value)) $value = (int)$value; - - $column_list[] = sprintf("`%s` = %s", $name, $value); - } - } - - // 조건절 정리 - $condition = $this->getCondition($output); - - $query = sprintf("update %s set %s %s", implode(',',$table_list), implode(',',$column_list), $condition); - - return $this->_query($query); - } - - /** - * @brief deleteAct 처리 - **/ - function _executeDeleteAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = '`'.$this->prefix.$val.'`'; - } - - // 조건절 정리 - $condition = $this->getCondition($output); - - $query = sprintf("delete from %s %s", implode(',',$table_list), $condition); - - return $this->_query($query); - } - - /** - * @brief selectAct 처리 - * - * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n - * navigation이라는 method를 제공 - **/ - function _executeSelectAct($output) { - // 테이블 정리 - $table_list = array(); - foreach($output->tables as $key => $val) { - $table_list[] = '`'.$this->prefix.$val.'` as '.$key; - } - - $left_join = array(); - // why??? - $left_tables= (array)$output->left_tables; - - foreach($left_tables as $key => $val) { - $condition = $this->_getCondition($output->left_conditions[$key],$output->column_type); - if($condition){ - $left_join[] = $val . ' `'.$this->prefix.$output->_tables[$key].'` as '.$key . ' on (' . $condition . ')'; - } - } - - $click_count = array(); - if(!$output->columns){ - $output->columns = array(array('name'=>'*')); - } - - $column_list = array(); - foreach($output->columns as $key => $val) - { - $name = $val['name']; - $alias = $val['alias']; - if($val['click_count']) $click_count[] = $val['name']; - - if(substr($name,-1) == '*') - { - $column_list[] = $name; - } - else if(strpos($name,'.')===false && strpos($name,'(')===false) - { - if($alias) - { - $col = sprintf('`%s` as `%s`', $name, $alias); - $column_list[$alias] = $col; - } - else - { - $column_list[] = sprintf('`%s`',$name); - } - } - else - { - if($alias) - { - $col = sprintf('%s as `%s`', $name, $alias); - $column_list[$alias] = $col; - } - else - { - $column_list[] = sprintf('%s',$name); - } - } - } - - $columns = implode(',',$column_list); - $output->column_list = $column_list; - $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에 쿼리 추가 - if($output->order) { - $conditions = $this->getConditionList($output); - if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - } - } - - - if(count($output->groups)) - { - $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); - - if(count($output->arg_columns)) - { - foreach($output->groups as $group) - { - if($column_list[$group]) $output->arg_columns[] = $column_list[$group]; - } - } - } - - if($output->order) { - foreach($output->order as $key => $val) { - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; - } - if(count($index_list)) $orderby_query .= ' order by '.implode(',',$index_list); - } - - if(count($output->arg_columns)) - { - $columns = array(); - foreach($output->arg_columns as $col){ - if(strpos($col,'`')===false && strpos($col,' ')==false) $columns[] = '`'.$col.'`'; - else $columns[] = $col; - } - - $columns = join(',',$columns); - } - - $query = sprintf("select %s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query); - - // 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):''; - - $result = $this->_query($query); - if($this->isError()) return; - if(count($click_count) && count($output->conditions)){ - $_query = ''; - foreach($click_count as $k => $c) $_query .= sprintf(',%s=%s+1 ',$c,$c); - $_query = sprintf('update %s set %s %s',implode(',',$table_list), substr($_query,1), $condition); - $this->_query($_query); - } - - $data = $this->_fetch($result); - - $buff = new Object(); - $buff->data = $data; - - return $buff; - } - - /** - * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 - * - * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; - **/ - function _getNavigationData($table_list, $columns, $left_join, $condition, $output) { - require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); - - $column_list = $output->column_list; - - // 전체 개수를 구함 - $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); - - $count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id . ' count(*)'):''; - $result = $this->_query($count_query); - $count_output = $this->_fetch($result); - $total_count = (int)$count_output->count; - - $list_count = $output->list_count['value']; - if(!$list_count) $list_count = 20; - $page_count = $output->page_count['value']; - if(!$page_count) $page_count = 10; - $page = $output->page['value']; - if(!$page) $page = 1; - - // 전체 페이지를 구함 - if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1; - else $total_page = 1; - - // 페이지 변수를 체크 - if($page > $total_page) $page = $total_page; - $start_count = ($page-1)*$list_count; - - // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가 - if($output->order) { - $conditions = $this->getConditionList($output); - if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - } - } - - if(count($output->groups)){ - $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); - - if(count($output->arg_columns)) - { - foreach($output->groups as $group) - { - if($column_list[$group]) $output->arg_columns[] = $column_list[$group]; - } - } - } - - if(count($output->order)) { - foreach($output->order as $key => $val) { - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; - } - if(count($index_list)) $orderby_query = ' order by '.implode(',',$index_list); - } - - if(count($output->arg_columns)) - { - $columns = array(); - foreach($output->arg_columns as $col){ - if(strpos($col,'`')===false && strpos($col,' ')==false) $columns[] = '`'.$col.'`'; - else $columns[] = $col; - } - - $columns = join(',',$columns); - } - - $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):''; - - $result = $this->_query($query); - if($this->isError()) { - $buff = new Object(); - $buff->total_count = 0; - $buff->total_page = 0; - $buff->page = 1; - $buff->data = array(); - - $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); - return $buff; - } - - $virtual_no = $total_count - ($page-1)*$list_count; - $data = array(); - while($tmp = $this->db_fetch_object($result)) { - $data[$virtual_no--] = $tmp; - } - $buff = new Object(); - $buff->total_count = $total_count; - $buff->total_page = $total_page; - $buff->page = $page; - $buff->data = $data; - - $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); - return $buff; - } - - function db_insert_id() - { - return mysql_insert_id($this->fd); - } - - function db_fetch_object(&$result) - { - return mysql_fetch_object($result); - } - } - -return new DBMysql; -?> + 'bigint', + 'number' => 'bigint', + 'varchar' => 'varchar', + 'char' => 'char', + 'text' => 'text', + 'bigtext' => 'longtext', + 'date' => 'varchar(14)', + 'float' => 'float', + ); + + /** + * @brief constructor + **/ + function DBMysql() { + $this->_setDBInfo(); + $this->_connect(); + } + + function create() { + return new DBMysql; + } + + /** + * @brief 설치 가능 여부를 return + **/ + function isSupported() { + if(!function_exists('mysql_connect')) return false; + return true; + } + + /** + * @brief DB정보 설정 및 connect/ close + **/ + function _setDBInfo() { + $db_info = Context::getDBInfo(); + $this->hostname = $db_info->db_hostname; + $this->port = $db_info->db_port; + $this->userid = $db_info->db_userid; + $this->password = $db_info->db_password; + $this->database = $db_info->db_database; + $this->prefix = $db_info->db_table_prefix; + if(!substr($this->prefix,-1)!='_') $this->prefix .= '_'; + } + + /** + * @brief DB 접속 + **/ + function _connect() { + // db 정보가 없으면 무시 + if(!$this->hostname || !$this->userid || !$this->password || !$this->database) return; + + if(strpos($this->hostname, ':')===false && $this->port) $this->hostname .= ':'.$this->port; + + // 접속시도 + $this->fd = @mysql_connect($this->hostname, $this->userid, $this->password); + if(mysql_error()) { + $this->setError(mysql_errno(), mysql_error()); + return; + } + + // 버전 확인후 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 선택 + @mysql_select_db($this->database, $this->fd); + if(mysql_error()) { + $this->setError(mysql_errno(), mysql_error()); + return; + } + + // 접속체크 + $this->is_connected = true; + $this->password = md5($this->password); + + // mysql의 경우 utf8임을 지정 + $this->_query("set names 'utf8'"); + } + + /** + * @brief DB접속 해제 + **/ + function close() { + if(!$this->isConnected()) return; + @mysql_close($this->fd); + } + + /** + * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 + **/ + function addQuotes($string) { + if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); + if(!is_numeric($string)) $string = @mysql_escape_string($string); + return $string; + } + + /** + * @brief 트랜잭션 시작 + **/ + function begin() { + } + + /** + * @brief 롤백 + **/ + function rollback() { + } + + /** + * @brief 커밋 + **/ + function commit() { + } + + /** + * @brief : 쿼리문의 실행 및 결과의 fetch 처리 + * + * query : query문 실행하고 result return\n + * fetch : reutrn 된 값이 없으면 NULL\n + * rows이면 array object\n + * row이면 object\n + * return\n + **/ + function _query($query) { + if(!$this->isConnected()) return; + + // 쿼리 시작을 알림 + $this->actStart($query); + + // 쿼리 문 실행 + $result = @mysql_query($query, $this->fd); + + // 오류 체크 + if(mysql_error($this->fd)) $this->setError(mysql_errno($this->fd), mysql_error($this->fd)); + + // 쿼리 실행 종료를 알림 + $this->actFinish(); + + // 결과 리턴 + return $result; + } + + /** + * @brief 결과를 fetch + **/ + function _fetch($result) { + if(!$this->isConnected() || $this->isError() || !$result) return; + while($tmp = $this->db_fetch_object($result)) { + $output[] = $tmp; + } + if(count($output)==1) return $output[0]; + return $output; + } + + /** + * @brief 1씩 증가되는 sequence값을 return (mysql의 auto_increment는 sequence테이블에서만 사용) + **/ + function getNextSequence() { + $query = sprintf("insert into `%ssequence` (seq) values ('0')", $this->prefix); + $this->_query($query); + $sequence = $this->db_insert_id(); + if($sequence % 10000 == 0) { + $query = sprintf("delete from `%ssequence` where seq < %d", $this->prefix, $sequence); + $this->_query($query); + } + + return $sequence; + } + + /** + * @brief mysql old password를 가져오는 함수 (mysql에서만 사용) + **/ + function isValidOldPassword($password, $saved_password) { + $query = sprintf("select password('%s') as password, old_password('%s') as old_password", $this->addQuotes($password), $this->addQuotes($password)); + $result = $this->_query($query); + $tmp = $this->_fetch($result); + if($tmp->password == $saved_password || $tmp->old_password == $saved_password) return true; + return false; + } + + /** + * @brief 테이블 기생성 여부 return + **/ + function isTableExists($target_name) { + $query = sprintf("show tables like '%s%s'", $this->prefix, $this->addQuotes($target_name)); + $result = $this->_query($query); + $tmp = $this->_fetch($result); + if(!$tmp) return false; + return true; + } + + /** + * @brief 특정 테이블에 특정 column 추가 + **/ + function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) { + $type = $this->column_type[$type]; + if(strtoupper($type)=='INTEGER') $size = ''; + + $query = sprintf("alter table `%s%s` add `%s` ", $this->prefix, $table_name, $column_name); + if($size) $query .= sprintf(" %s(%s) ", $type, $size); + else $query .= sprintf(" %s ", $type); + if($default) $query .= sprintf(" default '%s' ", $default); + if($notnull) $query .= " not null "; + + $this->_query($query); + } + + /** + * @brief 특정 테이블에 특정 column 제거 + **/ + function dropColumn($table_name, $column_name) { + $query = sprintf("alter table `%s%s` drop `%s` ", $this->prefix, $table_name, $column_name); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 column의 정보를 return + **/ + function isColumnExists($table_name, $column_name) { + $query = sprintf("show fields from `%s%s`", $this->prefix, $table_name); + $result = $this->_query($query); + if($this->isError()) return; + $output = $this->_fetch($result); + if($output) { + $column_name = strtolower($column_name); + foreach($output as $key => $val) { + $name = strtolower($val->Field); + if($column_name == $name) return true; + } + } + return false; + } + + /** + * @brief 특정 테이블에 특정 인덱스 추가 + * $target_columns = array(col1, col2) + * $is_unique? unique : none + **/ + function addIndex($table_name, $index_name, $target_columns, $is_unique = false) { + if(!is_array($target_columns)) $target_columns = array($target_columns); + + $query = sprintf("alter table `%s%s` add %s index `%s` (%s);", $this->prefix, $table_name, $is_unique?'unique':'', $index_name, implode(',',$target_columns)); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 특정 인덱스 삭제 + **/ + function dropIndex($table_name, $index_name, $is_unique = false) { + $query = sprintf("alter table `%s%s` drop index `%s`", $this->prefix, $table_name, $index_name); + $this->_query($query); + } + + + /** + * @brief 특정 테이블의 index 정보를 return + **/ + function isIndexExists($table_name, $index_name) { + //$query = sprintf("show indexes from %s%s where key_name = '%s' ", $this->prefix, $table_name, $index_name); + $query = sprintf("show indexes from `%s%s`", $this->prefix, $table_name); + $result = $this->_query($query); + if($this->isError()) return; + $output = $this->_fetch($result); + if(!$output) return; + if(!is_array($output)) $output = array($output); + + for($i=0;$iKey_name == $index_name) return true; + } + return false; + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXml($xml_doc) { + return $this->_createTable($xml_doc); + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXmlFile($file_name) { + if(!file_exists($file_name)) return; + // xml 파일을 읽음 + $buff = FileHandler::readFile($file_name); + return $this->_createTable($buff); + } + + /** + * @brief schema xml을 이용하여 create table query생성 + * + * type : number, varchar, text, char, date, \n + * opt : notnull, default, size\n + * index : primary key, index, unique\n + **/ + function _createTable($xml_doc) { + // xml parsing + $oXml = new XmlParser(); + $xml_obj = $oXml->parse($xml_doc); + + // 테이블 생성 schema 작성 + $table_name = $xml_obj->table->attrs->name; + if($this->isTableExists($table_name)) return; + $table_name = $this->prefix.$table_name; + + if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; + else $columns = $xml_obj->table->column; + + foreach($columns as $column) { + $name = $column->attrs->name; + $type = $column->attrs->type; + $size = $column->attrs->size; + $notnull = $column->attrs->notnull; + $primary_key = $column->attrs->primary_key; + $index = $column->attrs->index; + $unique = $column->attrs->unique; + $default = $column->attrs->default; + $auto_increment = $column->attrs->auto_increment; + + $column_schema[] = sprintf('`%s` %s%s %s %s %s', + $name, + $this->column_type[$type], + $size?'('.$size.')':'', + isset($default)?"default '".$default."'":'', + $notnull?'not null':'', + $auto_increment?'auto_increment':'' + ); + + if($primary_key) $primary_list[] = $name; + else if($unique) $unique_list[$unique][] = $name; + else if($index) $index_list[$index][] = $name; + } + + if(count($primary_list)) { + $column_schema[] = sprintf("primary key (%s)", '`'.implode($primary_list,'`,`').'`'); + } + + if(count($unique_list)) { + foreach($unique_list as $key => $val) { + $column_schema[] = sprintf("unique %s (%s)", $key, '`'.implode($val,'`,`').'`'); + } + } + + if(count($index_list)) { + foreach($index_list as $key => $val) { + $column_schema[] = sprintf("index %s (%s)", $key, '`'.implode($val,'`,`').'`'); + } + } + + $schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema,",\n"), "ENGINE = MYISAM CHARACTER SET utf8 COLLATE utf8_general_ci"); + + $output = $this->_query($schema); + if(!$output) return false; + } + + /** + * @brief 조건문 작성하여 return + **/ + function getCondition($output) { + if(!$output->conditions) return; + $condition = $this->_getCondition($output->conditions,$output->column_type); + if($condition) $condition = ' where '.$condition; + return $condition; + } + + function getLeftCondition($conditions,$column_type){ + return $this->_getCondition($conditions,$column_type); + } + + + function _getCondition($conditions,$column_type) { + $condition = ''; + foreach($conditions as $val) { + $sub_condition = ''; + foreach($val['condition'] as $v) { + if(!isset($v['value'])) continue; + if($v['value'] === '') continue; + if(!in_array(gettype($v['value']), array('string', 'integer', 'double', 'array'))) continue; + + $name = $v['column']; + $operation = $v['operation']; + $value = $v['value']; + $type = $this->getColumnType($column_type,$name); + $pipe = $v['pipe']; + $value = $this->getConditionValue($name, $value, $operation, $type, $column_type); + if(!$value) $value = $v['value']; + $str = $this->getConditionPart($name, $value, $operation); + if($sub_condition) $sub_condition .= ' '.$pipe.' '; + $sub_condition .= $str; + } + if($sub_condition) { + if($condition && $val['pipe']) $condition .= ' '.$val['pipe'].' '; + $condition .= '('.$sub_condition.')'; + } + } + return $condition; + } + + /** + * @brief insertAct 처리 + **/ + function _executeInsertAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = '`'.$this->prefix.$val.'`'; + } + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + $name = $val['name']; + $value = $val['value']; + + if($output->column_type[$name]!='number') { + + if(!is_null($value)){ + $value = "'" . $this->addQuotes($value) ."'"; + }else{ + if($val['notnull']=='notnull') { + $value = "''"; + } else { + //$value = 'null'; + $value = "''"; + } + } + + } elseif(!$value || is_numeric($value)) $value = (int)$value; + + $column_list[] = '`'.$name.'`'; + $value_list[] = $value; + } + + $query = sprintf("insert into %s (%s) values (%s);", implode(',',$table_list), implode(',',$column_list), implode(',', $value_list)); + return $this->_query($query); + } + + /** + * @brief updateAct 처리 + **/ + function _executeUpdateAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = '`'.$this->prefix.$val.'` as '.$key; + } + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + if(!isset($val['value'])) continue; + $name = $val['name']; + $value = $val['value']; + if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value; + else { + if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'"; + elseif(!$value || is_numeric($value)) $value = (int)$value; + + $column_list[] = sprintf("`%s` = %s", $name, $value); + } + } + + // 조건절 정리 + $condition = $this->getCondition($output); + + $query = sprintf("update %s set %s %s", implode(',',$table_list), implode(',',$column_list), $condition); + + return $this->_query($query); + } + + /** + * @brief deleteAct 처리 + **/ + function _executeDeleteAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = '`'.$this->prefix.$val.'`'; + } + + // 조건절 정리 + $condition = $this->getCondition($output); + + $query = sprintf("delete from %s %s", implode(',',$table_list), $condition); + + return $this->_query($query); + } + + /** + * @brief selectAct 처리 + * + * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n + * navigation이라는 method를 제공 + **/ + function _executeSelectAct($output) { + // 테이블 정리 + $table_list = array(); + foreach($output->tables as $key => $val) { + $table_list[] = '`'.$this->prefix.$val.'` as '.$key; + } + + $left_join = array(); + // why??? + $left_tables= (array)$output->left_tables; + + foreach($left_tables as $key => $val) { + $condition = $this->_getCondition($output->left_conditions[$key],$output->column_type); + if($condition){ + $left_join[] = $val . ' `'.$this->prefix.$output->_tables[$key].'` as '.$key . ' on (' . $condition . ')'; + } + } + + $click_count = array(); + if(!$output->columns){ + $output->columns = array(array('name'=>'*')); + } + + $column_list = array(); + foreach($output->columns as $key => $val) + { + $name = $val['name']; + $alias = $val['alias']; + if($val['click_count']) $click_count[] = $val['name']; + + if(substr($name,-1) == '*') + { + $column_list[] = $name; + } + else if(strpos($name,'.')===false && strpos($name,'(')===false) + { + if($alias) + { + $col = sprintf('`%s` as `%s`', $name, $alias); + $column_list[$alias] = $col; + } + else + { + $column_list[] = sprintf('`%s`',$name); + } + } + else + { + if($alias) + { + $col = sprintf('%s as `%s`', $name, $alias); + $column_list[$alias] = $col; + } + else + { + $column_list[] = sprintf('%s',$name); + } + } + } + + $columns = implode(',',$column_list); + $output->column_list = $column_list; + $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에 쿼리 추가 + if($output->order) { + $conditions = $this->getConditionList($output); + if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + } + } + + + if(count($output->groups)) + { + $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); + + if(count($output->arg_columns)) + { + foreach($output->groups as $group) + { + if($column_list[$group]) $output->arg_columns[] = $column_list[$group]; + } + } + } + + if($output->order) { + foreach($output->order as $key => $val) { + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; + } + if(count($index_list)) $orderby_query .= ' order by '.implode(',',$index_list); + } + + if(count($output->arg_columns)) + { + $columns = array(); + foreach($output->arg_columns as $col){ + if(strpos($col,'`')===false && strpos($col,' ')==false) $columns[] = '`'.$col.'`'; + else $columns[] = $col; + } + + $columns = join(',',$columns); + } + + $query = sprintf("select %s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query); + + // 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):''; + + $result = $this->_query($query); + if($this->isError()) return; + if(count($click_count) && count($output->conditions)){ + $_query = ''; + foreach($click_count as $k => $c) $_query .= sprintf(',%s=%s+1 ',$c,$c); + $_query = sprintf('update %s set %s %s',implode(',',$table_list), substr($_query,1), $condition); + $this->_query($_query); + } + + $data = $this->_fetch($result); + + $buff = new Object(); + $buff->data = $data; + + return $buff; + } + + /** + * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 + * + * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; + **/ + function _getNavigationData($table_list, $columns, $left_join, $condition, $output) { + require_once(_XE_PATH_.'classes/page/PageHandler.class.php'); + + $column_list = $output->column_list; + + // 전체 개수를 구함 + $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); + + $count_query .= (__DEBUG_QUERY__&1 && $output->query_id)?sprintf(' '.$this->comment_syntax,$this->query_id . ' count(*)'):''; + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + + $list_count = $output->list_count['value']; + if(!$list_count) $list_count = 20; + $page_count = $output->page_count['value']; + if(!$page_count) $page_count = 10; + $page = $output->page['value']; + if(!$page) $page = 1; + + // 전체 페이지를 구함 + if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1; + else $total_page = 1; + + // 페이지 변수를 체크 + if($page > $total_page) $page = $total_page; + $start_count = ($page-1)*$list_count; + + // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가 + if($output->order) { + $conditions = $this->getConditionList($output); + if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + } + } + + if(count($output->groups)){ + $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); + + if(count($output->arg_columns)) + { + foreach($output->groups as $group) + { + if($column_list[$group]) $output->arg_columns[] = $column_list[$group]; + } + } + } + + if(count($output->order)) { + foreach($output->order as $key => $val) { + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; + } + if(count($index_list)) $orderby_query = ' order by '.implode(',',$index_list); + } + + if(count($output->arg_columns)) + { + $columns = array(); + foreach($output->arg_columns as $col){ + if(strpos($col,'`')===false && strpos($col,' ')==false) $columns[] = '`'.$col.'`'; + else $columns[] = $col; + } + + $columns = join(',',$columns); + } + + $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):''; + + $result = $this->_query($query); + if($this->isError()) { + $buff = new Object(); + $buff->total_count = 0; + $buff->total_page = 0; + $buff->page = 1; + $buff->data = array(); + + $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); + return $buff; + } + + $virtual_no = $total_count - ($page-1)*$list_count; + $data = array(); + while($tmp = $this->db_fetch_object($result)) { + $data[$virtual_no--] = $tmp; + } + $buff = new Object(); + $buff->total_count = $total_count; + $buff->total_page = $total_page; + $buff->page = $page; + $buff->data = $data; + + $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); + return $buff; + } + + function db_insert_id() + { + return mysql_insert_id($this->fd); + } + + function db_fetch_object(&$result) + { + return mysql_fetch_object($result); + } + } + +return new DBMysql; +?> diff --git a/classes/db/DBMysql_innodb.class.php b/classes/db/DBMysql_innodb.class.php index 7ba8f304a..2ada937b0 100644 --- a/classes/db/DBMysql_innodb.class.php +++ b/classes/db/DBMysql_innodb.class.php @@ -1,164 +1,164 @@ -_setDBInfo(); - $this->_connect(); - } - - /** - * @brief create an instance of this class - */ - function create() - { - return new DBMysql_innodb; - } - - /** - * @brief DB접속 해제 - **/ - function close() { - if(!$this->isConnected()) return; - $this->_query("commit"); - @mysql_close($this->fd); - } - - /** - * @brief 트랜잭션 시작 - **/ - function begin() { - if(!$this->isConnected() || $this->transaction_started) return; - $this->transaction_started = true; - $this->_query("begin"); - } - - /** - * @brief 롤백 - **/ - function rollback() { - if(!$this->isConnected() || !$this->transaction_started) return; - $this->_query("rollback"); - $this->transaction_started = false; - } - - /** - * @brief 커밋 - **/ - function commit($force = false) { - if(!$force && (!$this->isConnected() || !$this->transaction_started)) return; - $this->_query("commit"); - $this->transaction_started = false; - } - - /** - * @brief : 쿼리문의 실행 및 결과의 fetch 처리 - * - * query : query문 실행하고 result return\n - * fetch : reutrn 된 값이 없으면 NULL\n - * rows이면 array object\n - * row이면 object\n - * return\n - **/ - function _query($query) { - if(!$this->isConnected()) return; - - // 쿼리 시작을 알림 - $this->actStart($query); - - // 쿼리 문 실행 - $result = @mysql_query($query, $this->fd); - - // 오류 체크 - if(mysql_error($this->fd)) $this->setError(mysql_errno($this->fd), mysql_error($this->fd)); - - // 쿼리 실행 종료를 알림 - $this->actFinish(); - - // 결과 리턴 - return $result; - } - - /** - * @brief schema xml을 이용하여 create table query생성 - * - * type : number, varchar, text, char, date, \n - * opt : notnull, default, size\n - * index : primary key, index, unique\n - **/ - function _createTable($xml_doc) { - // xml parsing - $oXml = new XmlParser(); - $xml_obj = $oXml->parse($xml_doc); - - // 테이블 생성 schema 작성 - $table_name = $xml_obj->table->attrs->name; - if($this->isTableExists($table_name)) return; - $table_name = $this->prefix.$table_name; - - if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; - else $columns = $xml_obj->table->column; - - foreach($columns as $column) { - $name = $column->attrs->name; - $type = $column->attrs->type; - $size = $column->attrs->size; - $notnull = $column->attrs->notnull; - $primary_key = $column->attrs->primary_key; - $index = $column->attrs->index; - $unique = $column->attrs->unique; - $default = $column->attrs->default; - $auto_increment = $column->attrs->auto_increment; - - $column_schema[] = sprintf('`%s` %s%s %s %s %s', - $name, - $this->column_type[$type], - $size?'('.$size.')':'', - isset($default)?"default '".$default."'":'', - $notnull?'not null':'', - $auto_increment?'auto_increment':'' - ); - - if($primary_key) $primary_list[] = $name; - else if($unique) $unique_list[$unique][] = $name; - else if($index) $index_list[$index][] = $name; - } - - if(count($primary_list)) { - $column_schema[] = sprintf("primary key (%s)", '`'.implode($primary_list,'`,`').'`'); - } - - if(count($unique_list)) { - foreach($unique_list as $key => $val) { - $column_schema[] = sprintf("unique %s (%s)", $key, '`'.implode($val,'`,`').'`'); - } - } - - if(count($index_list)) { - foreach($index_list as $key => $val) { - $column_schema[] = sprintf("index %s (%s)", $key, '`'.implode($val,'`,`').'`'); - } - } - - $schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema,",\n"), "ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci"); - - $output = $this->_query($schema); - if(!$output) return false; - } - } - -return new DBMysql_innodb; -?> +_setDBInfo(); + $this->_connect(); + } + + /** + * @brief create an instance of this class + */ + function create() + { + return new DBMysql_innodb; + } + + /** + * @brief DB접속 해제 + **/ + function close() { + if(!$this->isConnected()) return; + $this->_query("commit"); + @mysql_close($this->fd); + } + + /** + * @brief 트랜잭션 시작 + **/ + function begin() { + if(!$this->isConnected() || $this->transaction_started) return; + $this->transaction_started = true; + $this->_query("begin"); + } + + /** + * @brief 롤백 + **/ + function rollback() { + if(!$this->isConnected() || !$this->transaction_started) return; + $this->_query("rollback"); + $this->transaction_started = false; + } + + /** + * @brief 커밋 + **/ + function commit($force = false) { + if(!$force && (!$this->isConnected() || !$this->transaction_started)) return; + $this->_query("commit"); + $this->transaction_started = false; + } + + /** + * @brief : 쿼리문의 실행 및 결과의 fetch 처리 + * + * query : query문 실행하고 result return\n + * fetch : reutrn 된 값이 없으면 NULL\n + * rows이면 array object\n + * row이면 object\n + * return\n + **/ + function _query($query) { + if(!$this->isConnected()) return; + + // 쿼리 시작을 알림 + $this->actStart($query); + + // 쿼리 문 실행 + $result = @mysql_query($query, $this->fd); + + // 오류 체크 + if(mysql_error($this->fd)) $this->setError(mysql_errno($this->fd), mysql_error($this->fd)); + + // 쿼리 실행 종료를 알림 + $this->actFinish(); + + // 결과 리턴 + return $result; + } + + /** + * @brief schema xml을 이용하여 create table query생성 + * + * type : number, varchar, text, char, date, \n + * opt : notnull, default, size\n + * index : primary key, index, unique\n + **/ + function _createTable($xml_doc) { + // xml parsing + $oXml = new XmlParser(); + $xml_obj = $oXml->parse($xml_doc); + + // 테이블 생성 schema 작성 + $table_name = $xml_obj->table->attrs->name; + if($this->isTableExists($table_name)) return; + $table_name = $this->prefix.$table_name; + + if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; + else $columns = $xml_obj->table->column; + + foreach($columns as $column) { + $name = $column->attrs->name; + $type = $column->attrs->type; + $size = $column->attrs->size; + $notnull = $column->attrs->notnull; + $primary_key = $column->attrs->primary_key; + $index = $column->attrs->index; + $unique = $column->attrs->unique; + $default = $column->attrs->default; + $auto_increment = $column->attrs->auto_increment; + + $column_schema[] = sprintf('`%s` %s%s %s %s %s', + $name, + $this->column_type[$type], + $size?'('.$size.')':'', + isset($default)?"default '".$default."'":'', + $notnull?'not null':'', + $auto_increment?'auto_increment':'' + ); + + if($primary_key) $primary_list[] = $name; + else if($unique) $unique_list[$unique][] = $name; + else if($index) $index_list[$index][] = $name; + } + + if(count($primary_list)) { + $column_schema[] = sprintf("primary key (%s)", '`'.implode($primary_list,'`,`').'`'); + } + + if(count($unique_list)) { + foreach($unique_list as $key => $val) { + $column_schema[] = sprintf("unique %s (%s)", $key, '`'.implode($val,'`,`').'`'); + } + } + + if(count($index_list)) { + foreach($index_list as $key => $val) { + $column_schema[] = sprintf("index %s (%s)", $key, '`'.implode($val,'`,`').'`'); + } + } + + $schema = sprintf('create table `%s` (%s%s) %s;', $this->addQuotes($table_name), "\n", implode($column_schema,",\n"), "ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci"); + + $output = $this->_query($schema); + if(!$output) return false; + } + } + +return new DBMysql_innodb; +?> diff --git a/classes/db/DBMysqli.class.php b/classes/db/DBMysqli.class.php index 4ccaf3c41..354571fd8 100644 --- a/classes/db/DBMysqli.class.php +++ b/classes/db/DBMysqli.class.php @@ -1,123 +1,123 @@ -_setDBInfo(); - $this->_connect(); - } - - /** - * @brief 설치 가능 여부를 return - **/ - function isSupported() { - if(!function_exists('mysqli_connect')) return false; - return true; - } - - /** - * @brief create an instance of this class - */ - function create() - { - return new DBMysqli; - } - - /** - * @brief DB 접속 - **/ - function _connect() { - // db 정보가 없으면 무시 - if(!$this->hostname || !$this->userid || !$this->password || !$this->database) return; - - // 접속시도 - if($this->port){ - $this->fd = @mysqli_connect($this->hostname, $this->userid, $this->password, $this->database, $this->port); - }else{ - $this->fd = @mysqli_connect($this->hostname, $this->userid, $this->password, $this->database); - } - $error = mysqli_connect_errno(); - if($error) { - $this->setError($error,mysqli_connect_error()); - return; - } - mysqli_set_charset($this->fd,'utf8'); - - // 접속체크 - $this->is_connected = true; - $this->password = md5($this->password); - } - - /** - * @brief DB접속 해제 - **/ - function close() { - if(!$this->isConnected()) return; - mysqli_close($this->fd); - } - - /** - * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 - **/ - function addQuotes($string) { - if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); - if(!is_numeric($string)) $string = mysqli_escape_string($this->fd,$string); - return $string; - } - - /** - * @brief : 쿼리문의 실행 및 결과의 fetch 처리 - * - * query : query문 실행하고 result return\n - * fetch : reutrn 된 값이 없으면 NULL\n - * rows이면 array object\n - * row이면 object\n - * return\n - **/ - function _query($query) { - if(!$this->isConnected()) return; - - // 쿼리 시작을 알림 - $this->actStart($query); - - // 쿼리 문 실행 - $result = mysqli_query($this->fd,$query); - // 오류 체크 - $error = mysqli_error($this->fd); - if($error){ - $this->setError(mysqli_errno($this->fd), $error); - } - - // 쿼리 실행 종료를 알림 - $this->actFinish(); - - // 결과 리턴 - return $result; - } - - function db_insert_id() - { - return mysqli_insert_id($this->fd); - } - - function db_fetch_object(&$result) - { - return mysqli_fetch_object($result); - } - } - -return new DBMysqli; -?> +_setDBInfo(); + $this->_connect(); + } + + /** + * @brief 설치 가능 여부를 return + **/ + function isSupported() { + if(!function_exists('mysqli_connect')) return false; + return true; + } + + /** + * @brief create an instance of this class + */ + function create() + { + return new DBMysqli; + } + + /** + * @brief DB 접속 + **/ + function _connect() { + // db 정보가 없으면 무시 + if(!$this->hostname || !$this->userid || !$this->password || !$this->database) return; + + // 접속시도 + if($this->port){ + $this->fd = @mysqli_connect($this->hostname, $this->userid, $this->password, $this->database, $this->port); + }else{ + $this->fd = @mysqli_connect($this->hostname, $this->userid, $this->password, $this->database); + } + $error = mysqli_connect_errno(); + if($error) { + $this->setError($error,mysqli_connect_error()); + return; + } + mysqli_set_charset($this->fd,'utf8'); + + // 접속체크 + $this->is_connected = true; + $this->password = md5($this->password); + } + + /** + * @brief DB접속 해제 + **/ + function close() { + if(!$this->isConnected()) return; + mysqli_close($this->fd); + } + + /** + * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 + **/ + function addQuotes($string) { + if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); + if(!is_numeric($string)) $string = mysqli_escape_string($this->fd,$string); + return $string; + } + + /** + * @brief : 쿼리문의 실행 및 결과의 fetch 처리 + * + * query : query문 실행하고 result return\n + * fetch : reutrn 된 값이 없으면 NULL\n + * rows이면 array object\n + * row이면 object\n + * return\n + **/ + function _query($query) { + if(!$this->isConnected()) return; + + // 쿼리 시작을 알림 + $this->actStart($query); + + // 쿼리 문 실행 + $result = mysqli_query($this->fd,$query); + // 오류 체크 + $error = mysqli_error($this->fd); + if($error){ + $this->setError(mysqli_errno($this->fd), $error); + } + + // 쿼리 실행 종료를 알림 + $this->actFinish(); + + // 결과 리턴 + return $result; + } + + function db_insert_id() + { + return mysqli_insert_id($this->fd); + } + + function db_fetch_object(&$result) + { + return mysqli_fetch_object($result); + } + } + +return new DBMysqli; +?> diff --git a/classes/db/DBSqlite2.class.php b/classes/db/DBSqlite2.class.php index 833628ad8..5d4c447b7 100644 --- a/classes/db/DBSqlite2.class.php +++ b/classes/db/DBSqlite2.class.php @@ -1,735 +1,735 @@ - 'INTEGER', - 'number' => 'INTEGER', - 'varchar' => 'VARHAR', - 'char' => 'CHAR', - 'text' => 'TEXT', - 'bigtext' => 'TEXT', - 'date' => 'VARCHAR(14)', - 'float' => 'FLOAT', - ); - - /** - * @brief constructor - **/ - function DBSqlite2() { - $this->_setDBInfo(); - $this->_connect(); - } - - /** - * @brief create an instance of this class - */ - function create() - { - return new DBSqlite2; - } - - /** - * @brief 설치 가능 여부를 return - **/ - function isSupported() { - if(!function_exists('sqlite_open')) return false; - return true; - } - - /** - * @brief DB정보 설정 및 connect/ close - **/ - function _setDBInfo() { - $db_info = Context::getDBInfo(); - $this->database = $db_info->db_database; - $this->prefix = $db_info->db_table_prefix; - if(!substr($this->prefix,-1)!='_') $this->prefix .= '_'; - } - - /** - * @brief DB 접속 - **/ - function _connect() { - // db 정보가 없으면 무시 - if(!$this->database) return; - - // 데이터 베이스 파일 접속 시도 - $this->fd = sqlite_open($this->database, 0666, $error); - if(!file_exists($this->database) || $error) { - $this->setError(-1,$error); - $this->is_connected = false; - return; - } - - // 접속체크 - $this->is_connected = true; - $this->password = md5($this->password); - } - - /** - * @brief DB접속 해제 - **/ - function close() { - if(!$this->isConnected()) return; - sqlite_close($this->fd); - } - - /** - * @brief 트랜잭션 시작 - **/ - function begin() { - if(!$this->is_connected || $this->transaction_started) return; - if($this->_query("BEGIN;")) $this->transaction_started = true; - } - - /** - * @brief 롤백 - **/ - function rollback() { - if(!$this->is_connected || !$this->transaction_started) return; - $this->_query("ROLLBACK;"); - $this->transaction_started = false; - } - - /** - * @brief 커밋 - **/ - function commit($force = false) { - if(!$force && (!$this->isConnected() || !$this->transaction_started)) return; - if(!$this->is_connected || !$this->transaction_started) return; - $this->_query("COMMIT;"); - $this->transaction_started = false; - } - - /** - * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 - **/ - function addQuotes($string) { - if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); - if(!is_numeric($string)) $string = str_replace("'","''", $string); - return $string; - } - - /** - * @brief : 쿼리문의 실행 및 결과의 fetch 처리 - * - * query : query문 실행하고 result return\n - * fetch : reutrn 된 값이 없으면 NULL\n - * rows이면 array object\n - * row이면 object\n - * return\n - **/ - function _query($query) { - if(!$this->isConnected()) return; - - // 쿼리 시작을 알림 - $this->actStart($query); - - // 쿼리 문 실행 - $result = @sqlite_query($query, $this->fd); - - // 오류 체크 - if(sqlite_last_error($this->fd)) $this->setError(sqlite_last_error($this->fd), sqlite_error_string(sqlite_last_error($this->fd))); - - // 쿼리 실행 알림 - $this->actFinish(); - - return $result; - } - - /** - * @brief 결과를 fetch - **/ - function _fetch($result) { - if($this->isError() || !$result) return; - - while($tmp = sqlite_fetch_array($result, SQLITE_ASSOC)) { - unset($obj); - foreach($tmp as $key => $val) { - $pos = strpos($key, '.'); - if($pos) $key = substr($key, $pos+1); - $obj->{$key} = $val; - } - $output[] = $obj; - } - - if(count($output)==1) return $output[0]; - return $output; - } - - /** - * @brief 1씩 증가되는 sequence값을 return - **/ - function getNextSequence() { - $query = sprintf("insert into %ssequence (seq) values ('')", $this->prefix); - $this->_query($query); - $sequence = sqlite_last_insert_rowid($this->fd); - if($sequence % 10000 == 0) { - $query = sprintf("delete from %ssequence where seq < %d", $this->prefix, $sequence); - $this->_query($query); - } - - return $sequence; - } - - /** - * @brief 테이블 기생성 여부 return - **/ - function isTableExists($target_name) { - $query = sprintf('pragma table_info(%s%s)', $this->prefix, $this->addQuotes($target_name)); - $result = $this->_query($query); - if(sqlite_num_rows($result)==0) return false; - return true; - } - - /** - * @brief 특정 테이블에 특정 column 추가 - **/ - function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) { - $type = $this->column_type[$type]; - if(strtoupper($type)=='INTEGER') $size = ''; - - $query = sprintf("alter table %s%s add %s ", $this->prefix, $table_name, $column_name); - if($size) $query .= sprintf(" %s(%s) ", $type, $size); - else $query .= sprintf(" %s ", $type); - if($default) $query .= sprintf(" default '%s' ", $default); - if($notnull) $query .= " not null "; - - return $this->_query($query); - } - - /** - * @brief 특정 테이블에 특정 column 제거 - **/ - function dropColumn($table_name, $column_name) { - $query = sprintf("alter table %s%s drop column %s ", $this->prefix, $table_name, $column_name); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 column의 정보를 return - **/ - function isColumnExists($table_name, $column_name) { - $query = sprintf("pragma table_info(%s%s)", $this->prefix, $table_name); - $result = $this->_query($query); - $output = $this->_fetch($result); - if($output) { - $column_name = strtolower($column_name); - foreach($output as $key => $val) { - $name = strtolower($val->name); - if($column_name == $name) return true; - } - } - return false; - } - - /** - * @brief 특정 테이블에 특정 인덱스 추가 - * $target_columns = array(col1, col2) - * $is_unique? unique : none - **/ - function addIndex($table_name, $index_name, $target_columns, $is_unique = false) { - if(!is_array($target_columns)) $target_columns = array($target_columns); - - $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); - $query = sprintf("pragma table_info(%s%s)", $this->prefix, $table_name); - - $query = sprintf('CREATE %s INDEX %s ON %s%s (%s)', $is_unique?'UNIQUE':'', $key_name, $this->prefix, $table_name, implode(',',$target_columns)); - return $this->_query($query); - } - - /** - * @brief 특정 테이블의 특정 인덱스 삭제 - **/ - function dropIndex($table_name, $index_name, $is_unique = false) { - $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); - $query = sprintf("DROP INDEX %s", $this->prefix, $table_name, $key_name); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 index 정보를 return - **/ - function isIndexExists($table_name, $index_name) { - $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); - $query = sprintf("pragma index_info(%s)", $key_name); - $result = $this->_query($query); - $output = $this->_fetch($result); - if(!$output) return false; - return true; - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXml($xml_doc) { - return $this->_createTable($xml_doc); - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXmlFile($file_name) { - if(!file_exists($file_name)) return; - // xml 파일을 읽음 - $buff = FileHandler::readFile($file_name); - return $this->_createTable($buff); - } - - /** - * @brief schema xml을 이용하여 create table query생성 - * - * type : number, varchar, text, char, date, \n - * opt : notnull, default, size\n - * index : primary key, index, unique\n - **/ - function _createTable($xml_doc) { - // xml parsing - $oXml = new XmlParser(); - $xml_obj = $oXml->parse($xml_doc); - - // 테이블 생성 schema 작성 - $table_name = $xml_obj->table->attrs->name; - if($this->isTableExists($table_name)) return; - $table_name = $this->prefix.$table_name; - - if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; - else $columns = $xml_obj->table->column; - - foreach($columns as $column) { - $name = $column->attrs->name; - $type = $column->attrs->type; - if(strtoupper($this->column_type[$type])=='INTEGER') $size = ''; - else $size = $column->attrs->size; - $notnull = $column->attrs->notnull; - $primary_key = $column->attrs->primary_key; - $index = $column->attrs->index; - $unique = $column->attrs->unique; - $default = $column->attrs->default; - $auto_increment = $column->attrs->auto_increment; - - if($auto_increment) { - $column_schema[] = sprintf('%s %s %s', - $name, - $this->column_type[$type], - $auto_increment?'AUTOINCREMENT':'' - ); - } else { - $column_schema[] = sprintf('%s %s%s %s %s %s %s', - $name, - $this->column_type[$type], - $size?'('.$size.')':'', - $notnull?'NOT NULL':'', - $primary_key?'PRIMARY KEY':'', - isset($default)?"DEFAULT '".$default."'":'', - $auto_increment?'AUTOINCREMENT':'' - ); - } - - if($unique) $unique_list[$unique][] = $name; - else if($index) $index_list[$index][] = $name; - } - - $schema = sprintf('CREATE TABLE %s (%s%s) ;', $this->addQuotes($table_name)," ", implode($column_schema,", ")); - $this->_query($schema); - - if(count($unique_list)) { - foreach($unique_list as $key => $val) { - $query = sprintf('CREATE UNIQUE INDEX %s_%s ON %s (%s)', $this->addQuotes($table_name), $key, $this->addQuotes($table_name), implode(',',$val)); - $this->_query($query); - } - } - - if(count($index_list)) { - foreach($index_list as $key => $val) { - $query = sprintf('CREATE INDEX %s_%s ON %s (%s)', $this->addQuotes($table_name), $key, $this->addQuotes($table_name), implode(',',$val)); - $this->_query($query); - } - } - } - - /** - * @brief 조건문 작성하여 return - **/ - function getCondition($output) { - if(!$output->conditions) return; - $condition = $this->_getCondition($output->conditions,$output->column_type); - if($condition) $condition = ' where '.$condition; - return $condition; - } - - function getLeftCondition($conditions,$column_type){ - return $this->_getCondition($conditions,$column_type); - } - - - function _getCondition($conditions,$column_type) { - $condition = ''; - foreach($conditions as $val) { - $sub_condition = ''; - foreach($val['condition'] as $v) { - if(!isset($v['value'])) continue; - if($v['value'] === '') continue; - if(!in_array(gettype($v['value']), array('string', 'integer', 'double'))) continue; - - $name = $v['column']; - $operation = $v['operation']; - $value = $v['value']; - $type = $this->getColumnType($column_type,$name); - $pipe = $v['pipe']; - - $value = $this->getConditionValue($name, $value, $operation, $type, $column_type); - if(!$value) $value = $v['value']; - $str = $this->getConditionPart($name, $value, $operation); - if($sub_condition) $sub_condition .= ' '.$pipe.' '; - $sub_condition .= $str; - } - if($sub_condition) { - if($condition && $val['pipe']) $condition .= ' '.$val['pipe'].' '; - $condition .= '('.$sub_condition.')'; - } - } - return $condition; - } - - /** - * @brief insertAct 처리 - **/ - function _executeInsertAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = $this->prefix.$val; - } - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - $name = $val['name']; - $value = $val['value']; - if($output->column_type[$name]!='number') { - $value = "'".$this->addQuotes($value)."'"; - if(!$value) $value = 'null'; - } elseif(!$value || is_numeric($value)) $value = (int)$value; - - $column_list[] = $name; - $value_list[] = $value; - } - - $query = sprintf("insert into %s (%s) values (%s);", implode(',',$table_list), implode(',',$column_list), implode(',', $value_list)); - return $this->_query($query); - } - - /** - * @brief updateAct 처리 - **/ - function _executeUpdateAct($output) { - $table_count = count(array_values($output->tables)); - - // 대상 테이블이 1개일 경우 - if($table_count == 1) { - // 테이블 정리 - list($target_table) = array_values($output->tables); - $target_table = $this->prefix.$target_table; - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - if(!isset($val['value'])) continue; - $name = $val['name']; - $value = $val['value']; - if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value; - else { - if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'"; - elseif(!$value || is_numeric($value)) $value = (int)$value; - - $column_list[] = sprintf("%s = %s", $name, $value); - } - } - - // 조건절 정리 - $condition = $this->getCondition($output); - - $query = sprintf("update %s set %s %s", $target_table, implode(',',$column_list), $condition); - - // 대상 테이블이 2개일 경우 (sqlite에서 update 테이블을 1개 이상 지정 못해서 이렇게 꽁수로... 다른 방법이 있으려나..) - } elseif($table_count == 2) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[$val] = $this->prefix.$key; - } - list($source_table, $target_table) = array_values($table_list); - - // 조건절 정리 - $condition = $this->getCondition($output); - foreach($table_list as $key => $val) { - $condition = eregi_replace($key.'\\.', $val.'.', $condition); - } - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - if(!isset($val['value'])) continue; - $name = $val['name']; - $value = $val['value']; - list($s_prefix, $s_column) = explode('.',$name); - list($t_prefix, $t_column) = explode('.',$value); - - $s_table = $table_list[$s_prefix]; - $t_table = $table_list[$t_prefix]; - $column_list[] = sprintf(' %s = (select %s from %s %s) ', $s_column, $t_column, $t_table, $condition); - } - - $query = sprintf('update %s set %s where exists(select * from %s %s)', $source_table, implode(',', $column_list), $target_table, $condition); - } else { - return; - } - - return $this->_query($query); - } - - /** - * @brief deleteAct 처리 - **/ - function _executeDeleteAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = $this->prefix.$val; - } - - // 조건절 정리 - $condition = $this->getCondition($output); - - $query = sprintf("delete from %s %s", implode(',',$table_list), $condition); - - return $this->_query($query); - } - - /** - * @brief selectAct 처리 - * - * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n - * navigation이라는 method를 제공 - **/ - function _executeSelectAct($output) { - // 테이블 정리 - $table_list = array(); - foreach($output->tables as $key => $val) { - $table_list[] = $this->prefix.$val.' as '.$key; - } - - $left_join = array(); - // why??? - $left_tables= (array)$output->left_tables; - - foreach($left_tables as $key => $val) { - $condition = $this->_getCondition($output->left_conditions[$key],$output->column_type); - if($condition){ - $left_join[] = $val . ' '.$this->prefix.$output->_tables[$key].' as '.$key . ' on ' . $condition . ''; - } - } - - if(!$output->columns) { - $columns = '*'; - } else { - $column_list = array(); - foreach($output->columns as $key => $val) { - $name = $val['name']; - $alias = $val['alias']; - if($val['click_count']) $click_count[] = $val['name']; - - if(substr($name,-1) == '*') { - $column_list[] = $name; - } elseif(strpos($name,'.')===false && strpos($name,'(')===false) { - if($alias) $column_list[] = sprintf('%s as %s', $name, $alias); - else $column_list[] = sprintf('%s',$name); - } else { - if($alias) $column_list[] = sprintf('%s as %s', $name, $alias); - else $column_list[] = sprintf('%s',$name); - } - } - $columns = implode(',',$column_list); - } - - $condition = $this->getCondition($output); - - $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에 쿼리 추가 - if($output->order) { - $conditions = $this->getConditionList($output); - if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - } - } - - $query = sprintf("select %s from %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition); - - if(count($output->groups)) $query .= sprintf(' group by %s', implode(',',$output->groups)); - - if($output->order) { - foreach($output->order as $key => $val) { - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - } - if(count($index_list)) $query .= ' order by '.implode(',',$index_list); - } - - // 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):''; - $result = $this->_query($query); - if($this->isError()) return; - - if(count($click_count)>0 && count($output->conditions)>0){ - $_query = ''; - foreach($click_count as $k => $c) $_query .= sprintf(',%s=%s+1 ',$c,$c); - $_query = sprintf('update %s set %s %s',implode(',',$table_list), substr($_query,1), $condition); - $this->_query($_query); - } - - $data = $this->_fetch($result); - - $buff = new Object(); - $buff->data = $data; - return $buff; - } - - /** - * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 - * - * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; - **/ - 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 쿼리의 전체 갯수를 구하기 위한 수정 - // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. - // - $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; - $total_count = $this->getCountCache($output->tables, $count_condition); - if($total_count === false) { - $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); - $result = $this->_query($count_query); - $count_output = $this->_fetch($result); - $total_count = (int)$count_output->count; - $this->putCountCache($output->tables, $count_condition, $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); - $count_output = $this->_fetch($result); - $total_count = (int)$count_output->count; - - $list_count = $output->list_count['value']; - if(!$list_count) $list_count = 20; - $page_count = $output->page_count['value']; - if(!$page_count) $page_count = 10; - $page = $output->page['value']; - if(!$page) $page = 1; - - // 전체 페이지를 구함 - if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1; - else $total_page = 1; - - // 페이지 변수를 체크 - if($page > $total_page) $page = $total_page; - $start_count = ($page-1)*$list_count; - - // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가 - if($output->order) { - $conditions = $this->getConditionList($output); - if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - } - } - - $query = sprintf("select %s from %s %s %s", $columns, implode(',',$table_list), implode(' ',$left_join), $condition); - - - if(count($output->groups)) $query .= sprintf(' group by %s', implode(',',$output->groups)); - - if($output->order) { - foreach($output->order as $key => $val) { - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - } - if(count($index_list)) $query .= ' order by '.implode(',',$index_list); - } - - $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):''; - - $result = $this->_query($query); - if($this->isError()) { - $buff = new Object(); - $buff->total_count = 0; - $buff->total_page = 0; - $buff->page = 1; - $buff->data = array(); - - $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); - return $buff; - } - - if($result) { - $virtual_no = $total_count - ($page-1)*$list_count; - while($tmp = sqlite_fetch_array($result, SQLITE_ASSOC)) { - unset($obj); - foreach($tmp as $key => $val) { - $pos = strpos($key, '.'); - if($pos) $key = substr($key, $pos+1); - $obj->{$key} = $val; - } - $data[$virtual_no--] = $obj; - } - } - - $buff = new Object(); - $buff->total_count = $total_count; - $buff->total_page = $total_page; - $buff->page = $page; - $buff->data = $data; - - $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); - return $buff; - } - } - -return new DBSqlite2; -?> + 'INTEGER', + 'number' => 'INTEGER', + 'varchar' => 'VARHAR', + 'char' => 'CHAR', + 'text' => 'TEXT', + 'bigtext' => 'TEXT', + 'date' => 'VARCHAR(14)', + 'float' => 'FLOAT', + ); + + /** + * @brief constructor + **/ + function DBSqlite2() { + $this->_setDBInfo(); + $this->_connect(); + } + + /** + * @brief create an instance of this class + */ + function create() + { + return new DBSqlite2; + } + + /** + * @brief 설치 가능 여부를 return + **/ + function isSupported() { + if(!function_exists('sqlite_open')) return false; + return true; + } + + /** + * @brief DB정보 설정 및 connect/ close + **/ + function _setDBInfo() { + $db_info = Context::getDBInfo(); + $this->database = $db_info->db_database; + $this->prefix = $db_info->db_table_prefix; + if(!substr($this->prefix,-1)!='_') $this->prefix .= '_'; + } + + /** + * @brief DB 접속 + **/ + function _connect() { + // db 정보가 없으면 무시 + if(!$this->database) return; + + // 데이터 베이스 파일 접속 시도 + $this->fd = sqlite_open($this->database, 0666, $error); + if(!file_exists($this->database) || $error) { + $this->setError(-1,$error); + $this->is_connected = false; + return; + } + + // 접속체크 + $this->is_connected = true; + $this->password = md5($this->password); + } + + /** + * @brief DB접속 해제 + **/ + function close() { + if(!$this->isConnected()) return; + sqlite_close($this->fd); + } + + /** + * @brief 트랜잭션 시작 + **/ + function begin() { + if(!$this->is_connected || $this->transaction_started) return; + if($this->_query("BEGIN;")) $this->transaction_started = true; + } + + /** + * @brief 롤백 + **/ + function rollback() { + if(!$this->is_connected || !$this->transaction_started) return; + $this->_query("ROLLBACK;"); + $this->transaction_started = false; + } + + /** + * @brief 커밋 + **/ + function commit($force = false) { + if(!$force && (!$this->isConnected() || !$this->transaction_started)) return; + if(!$this->is_connected || !$this->transaction_started) return; + $this->_query("COMMIT;"); + $this->transaction_started = false; + } + + /** + * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 + **/ + function addQuotes($string) { + if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); + if(!is_numeric($string)) $string = str_replace("'","''", $string); + return $string; + } + + /** + * @brief : 쿼리문의 실행 및 결과의 fetch 처리 + * + * query : query문 실행하고 result return\n + * fetch : reutrn 된 값이 없으면 NULL\n + * rows이면 array object\n + * row이면 object\n + * return\n + **/ + function _query($query) { + if(!$this->isConnected()) return; + + // 쿼리 시작을 알림 + $this->actStart($query); + + // 쿼리 문 실행 + $result = @sqlite_query($query, $this->fd); + + // 오류 체크 + if(sqlite_last_error($this->fd)) $this->setError(sqlite_last_error($this->fd), sqlite_error_string(sqlite_last_error($this->fd))); + + // 쿼리 실행 알림 + $this->actFinish(); + + return $result; + } + + /** + * @brief 결과를 fetch + **/ + function _fetch($result) { + if($this->isError() || !$result) return; + + while($tmp = sqlite_fetch_array($result, SQLITE_ASSOC)) { + unset($obj); + foreach($tmp as $key => $val) { + $pos = strpos($key, '.'); + if($pos) $key = substr($key, $pos+1); + $obj->{$key} = $val; + } + $output[] = $obj; + } + + if(count($output)==1) return $output[0]; + return $output; + } + + /** + * @brief 1씩 증가되는 sequence값을 return + **/ + function getNextSequence() { + $query = sprintf("insert into %ssequence (seq) values ('')", $this->prefix); + $this->_query($query); + $sequence = sqlite_last_insert_rowid($this->fd); + if($sequence % 10000 == 0) { + $query = sprintf("delete from %ssequence where seq < %d", $this->prefix, $sequence); + $this->_query($query); + } + + return $sequence; + } + + /** + * @brief 테이블 기생성 여부 return + **/ + function isTableExists($target_name) { + $query = sprintf('pragma table_info(%s%s)', $this->prefix, $this->addQuotes($target_name)); + $result = $this->_query($query); + if(sqlite_num_rows($result)==0) return false; + return true; + } + + /** + * @brief 특정 테이블에 특정 column 추가 + **/ + function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) { + $type = $this->column_type[$type]; + if(strtoupper($type)=='INTEGER') $size = ''; + + $query = sprintf("alter table %s%s add %s ", $this->prefix, $table_name, $column_name); + if($size) $query .= sprintf(" %s(%s) ", $type, $size); + else $query .= sprintf(" %s ", $type); + if($default) $query .= sprintf(" default '%s' ", $default); + if($notnull) $query .= " not null "; + + return $this->_query($query); + } + + /** + * @brief 특정 테이블에 특정 column 제거 + **/ + function dropColumn($table_name, $column_name) { + $query = sprintf("alter table %s%s drop column %s ", $this->prefix, $table_name, $column_name); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 column의 정보를 return + **/ + function isColumnExists($table_name, $column_name) { + $query = sprintf("pragma table_info(%s%s)", $this->prefix, $table_name); + $result = $this->_query($query); + $output = $this->_fetch($result); + if($output) { + $column_name = strtolower($column_name); + foreach($output as $key => $val) { + $name = strtolower($val->name); + if($column_name == $name) return true; + } + } + return false; + } + + /** + * @brief 특정 테이블에 특정 인덱스 추가 + * $target_columns = array(col1, col2) + * $is_unique? unique : none + **/ + function addIndex($table_name, $index_name, $target_columns, $is_unique = false) { + if(!is_array($target_columns)) $target_columns = array($target_columns); + + $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); + $query = sprintf("pragma table_info(%s%s)", $this->prefix, $table_name); + + $query = sprintf('CREATE %s INDEX %s ON %s%s (%s)', $is_unique?'UNIQUE':'', $key_name, $this->prefix, $table_name, implode(',',$target_columns)); + return $this->_query($query); + } + + /** + * @brief 특정 테이블의 특정 인덱스 삭제 + **/ + function dropIndex($table_name, $index_name, $is_unique = false) { + $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); + $query = sprintf("DROP INDEX %s", $this->prefix, $table_name, $key_name); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 index 정보를 return + **/ + function isIndexExists($table_name, $index_name) { + $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); + $query = sprintf("pragma index_info(%s)", $key_name); + $result = $this->_query($query); + $output = $this->_fetch($result); + if(!$output) return false; + return true; + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXml($xml_doc) { + return $this->_createTable($xml_doc); + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXmlFile($file_name) { + if(!file_exists($file_name)) return; + // xml 파일을 읽음 + $buff = FileHandler::readFile($file_name); + return $this->_createTable($buff); + } + + /** + * @brief schema xml을 이용하여 create table query생성 + * + * type : number, varchar, text, char, date, \n + * opt : notnull, default, size\n + * index : primary key, index, unique\n + **/ + function _createTable($xml_doc) { + // xml parsing + $oXml = new XmlParser(); + $xml_obj = $oXml->parse($xml_doc); + + // 테이블 생성 schema 작성 + $table_name = $xml_obj->table->attrs->name; + if($this->isTableExists($table_name)) return; + $table_name = $this->prefix.$table_name; + + if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; + else $columns = $xml_obj->table->column; + + foreach($columns as $column) { + $name = $column->attrs->name; + $type = $column->attrs->type; + if(strtoupper($this->column_type[$type])=='INTEGER') $size = ''; + else $size = $column->attrs->size; + $notnull = $column->attrs->notnull; + $primary_key = $column->attrs->primary_key; + $index = $column->attrs->index; + $unique = $column->attrs->unique; + $default = $column->attrs->default; + $auto_increment = $column->attrs->auto_increment; + + if($auto_increment) { + $column_schema[] = sprintf('%s %s %s', + $name, + $this->column_type[$type], + $auto_increment?'AUTOINCREMENT':'' + ); + } else { + $column_schema[] = sprintf('%s %s%s %s %s %s %s', + $name, + $this->column_type[$type], + $size?'('.$size.')':'', + $notnull?'NOT NULL':'', + $primary_key?'PRIMARY KEY':'', + isset($default)?"DEFAULT '".$default."'":'', + $auto_increment?'AUTOINCREMENT':'' + ); + } + + if($unique) $unique_list[$unique][] = $name; + else if($index) $index_list[$index][] = $name; + } + + $schema = sprintf('CREATE TABLE %s (%s%s) ;', $this->addQuotes($table_name)," ", implode($column_schema,", ")); + $this->_query($schema); + + if(count($unique_list)) { + foreach($unique_list as $key => $val) { + $query = sprintf('CREATE UNIQUE INDEX %s_%s ON %s (%s)', $this->addQuotes($table_name), $key, $this->addQuotes($table_name), implode(',',$val)); + $this->_query($query); + } + } + + if(count($index_list)) { + foreach($index_list as $key => $val) { + $query = sprintf('CREATE INDEX %s_%s ON %s (%s)', $this->addQuotes($table_name), $key, $this->addQuotes($table_name), implode(',',$val)); + $this->_query($query); + } + } + } + + /** + * @brief 조건문 작성하여 return + **/ + function getCondition($output) { + if(!$output->conditions) return; + $condition = $this->_getCondition($output->conditions,$output->column_type); + if($condition) $condition = ' where '.$condition; + return $condition; + } + + function getLeftCondition($conditions,$column_type){ + return $this->_getCondition($conditions,$column_type); + } + + + function _getCondition($conditions,$column_type) { + $condition = ''; + foreach($conditions as $val) { + $sub_condition = ''; + foreach($val['condition'] as $v) { + if(!isset($v['value'])) continue; + if($v['value'] === '') continue; + if(!in_array(gettype($v['value']), array('string', 'integer', 'double'))) continue; + + $name = $v['column']; + $operation = $v['operation']; + $value = $v['value']; + $type = $this->getColumnType($column_type,$name); + $pipe = $v['pipe']; + + $value = $this->getConditionValue($name, $value, $operation, $type, $column_type); + if(!$value) $value = $v['value']; + $str = $this->getConditionPart($name, $value, $operation); + if($sub_condition) $sub_condition .= ' '.$pipe.' '; + $sub_condition .= $str; + } + if($sub_condition) { + if($condition && $val['pipe']) $condition .= ' '.$val['pipe'].' '; + $condition .= '('.$sub_condition.')'; + } + } + return $condition; + } + + /** + * @brief insertAct 처리 + **/ + function _executeInsertAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = $this->prefix.$val; + } + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + $name = $val['name']; + $value = $val['value']; + if($output->column_type[$name]!='number') { + $value = "'".$this->addQuotes($value)."'"; + if(!$value) $value = 'null'; + } elseif(!$value || is_numeric($value)) $value = (int)$value; + + $column_list[] = $name; + $value_list[] = $value; + } + + $query = sprintf("insert into %s (%s) values (%s);", implode(',',$table_list), implode(',',$column_list), implode(',', $value_list)); + return $this->_query($query); + } + + /** + * @brief updateAct 처리 + **/ + function _executeUpdateAct($output) { + $table_count = count(array_values($output->tables)); + + // 대상 테이블이 1개일 경우 + if($table_count == 1) { + // 테이블 정리 + list($target_table) = array_values($output->tables); + $target_table = $this->prefix.$target_table; + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + if(!isset($val['value'])) continue; + $name = $val['name']; + $value = $val['value']; + if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value; + else { + if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'"; + elseif(!$value || is_numeric($value)) $value = (int)$value; + + $column_list[] = sprintf("%s = %s", $name, $value); + } + } + + // 조건절 정리 + $condition = $this->getCondition($output); + + $query = sprintf("update %s set %s %s", $target_table, implode(',',$column_list), $condition); + + // 대상 테이블이 2개일 경우 (sqlite에서 update 테이블을 1개 이상 지정 못해서 이렇게 꽁수로... 다른 방법이 있으려나..) + } elseif($table_count == 2) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[$val] = $this->prefix.$key; + } + list($source_table, $target_table) = array_values($table_list); + + // 조건절 정리 + $condition = $this->getCondition($output); + foreach($table_list as $key => $val) { + $condition = eregi_replace($key.'\\.', $val.'.', $condition); + } + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + if(!isset($val['value'])) continue; + $name = $val['name']; + $value = $val['value']; + list($s_prefix, $s_column) = explode('.',$name); + list($t_prefix, $t_column) = explode('.',$value); + + $s_table = $table_list[$s_prefix]; + $t_table = $table_list[$t_prefix]; + $column_list[] = sprintf(' %s = (select %s from %s %s) ', $s_column, $t_column, $t_table, $condition); + } + + $query = sprintf('update %s set %s where exists(select * from %s %s)', $source_table, implode(',', $column_list), $target_table, $condition); + } else { + return; + } + + return $this->_query($query); + } + + /** + * @brief deleteAct 처리 + **/ + function _executeDeleteAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = $this->prefix.$val; + } + + // 조건절 정리 + $condition = $this->getCondition($output); + + $query = sprintf("delete from %s %s", implode(',',$table_list), $condition); + + return $this->_query($query); + } + + /** + * @brief selectAct 처리 + * + * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n + * navigation이라는 method를 제공 + **/ + function _executeSelectAct($output) { + // 테이블 정리 + $table_list = array(); + foreach($output->tables as $key => $val) { + $table_list[] = $this->prefix.$val.' as '.$key; + } + + $left_join = array(); + // why??? + $left_tables= (array)$output->left_tables; + + foreach($left_tables as $key => $val) { + $condition = $this->_getCondition($output->left_conditions[$key],$output->column_type); + if($condition){ + $left_join[] = $val . ' '.$this->prefix.$output->_tables[$key].' as '.$key . ' on ' . $condition . ''; + } + } + + if(!$output->columns) { + $columns = '*'; + } else { + $column_list = array(); + foreach($output->columns as $key => $val) { + $name = $val['name']; + $alias = $val['alias']; + if($val['click_count']) $click_count[] = $val['name']; + + if(substr($name,-1) == '*') { + $column_list[] = $name; + } elseif(strpos($name,'.')===false && strpos($name,'(')===false) { + if($alias) $column_list[] = sprintf('%s as %s', $name, $alias); + else $column_list[] = sprintf('%s',$name); + } else { + if($alias) $column_list[] = sprintf('%s as %s', $name, $alias); + else $column_list[] = sprintf('%s',$name); + } + } + $columns = implode(',',$column_list); + } + + $condition = $this->getCondition($output); + + $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에 쿼리 추가 + if($output->order) { + $conditions = $this->getConditionList($output); + if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + } + } + + $query = sprintf("select %s from %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition); + + if(count($output->groups)) $query .= sprintf(' group by %s', implode(',',$output->groups)); + + if($output->order) { + foreach($output->order as $key => $val) { + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + } + if(count($index_list)) $query .= ' order by '.implode(',',$index_list); + } + + // 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):''; + $result = $this->_query($query); + if($this->isError()) return; + + if(count($click_count)>0 && count($output->conditions)>0){ + $_query = ''; + foreach($click_count as $k => $c) $_query .= sprintf(',%s=%s+1 ',$c,$c); + $_query = sprintf('update %s set %s %s',implode(',',$table_list), substr($_query,1), $condition); + $this->_query($_query); + } + + $data = $this->_fetch($result); + + $buff = new Object(); + $buff->data = $data; + return $buff; + } + + /** + * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 + * + * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; + **/ + 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 쿼리의 전체 갯수를 구하기 위한 수정 + // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. + // + $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); + if($total_count === false) { + $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); + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + $this->putCountCache($output->tables, $count_condition, $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); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + + $list_count = $output->list_count['value']; + if(!$list_count) $list_count = 20; + $page_count = $output->page_count['value']; + if(!$page_count) $page_count = 10; + $page = $output->page['value']; + if(!$page) $page = 1; + + // 전체 페이지를 구함 + if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1; + else $total_page = 1; + + // 페이지 변수를 체크 + if($page > $total_page) $page = $total_page; + $start_count = ($page-1)*$list_count; + + // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가 + if($output->order) { + $conditions = $this->getConditionList($output); + if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + } + } + + $query = sprintf("select %s from %s %s %s", $columns, implode(',',$table_list), implode(' ',$left_join), $condition); + + + if(count($output->groups)) $query .= sprintf(' group by %s', implode(',',$output->groups)); + + if($output->order) { + foreach($output->order as $key => $val) { + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + } + if(count($index_list)) $query .= ' order by '.implode(',',$index_list); + } + + $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):''; + + $result = $this->_query($query); + if($this->isError()) { + $buff = new Object(); + $buff->total_count = 0; + $buff->total_page = 0; + $buff->page = 1; + $buff->data = array(); + + $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); + return $buff; + } + + if($result) { + $virtual_no = $total_count - ($page-1)*$list_count; + while($tmp = sqlite_fetch_array($result, SQLITE_ASSOC)) { + unset($obj); + foreach($tmp as $key => $val) { + $pos = strpos($key, '.'); + if($pos) $key = substr($key, $pos+1); + $obj->{$key} = $val; + } + $data[$virtual_no--] = $obj; + } + } + + $buff = new Object(); + $buff->total_count = $total_count; + $buff->total_page = $total_page; + $buff->page = $page; + $buff->data = $data; + + $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); + return $buff; + } + } + +return new DBSqlite2; +?> diff --git a/classes/db/DBSqlite3_pdo.class.php b/classes/db/DBSqlite3_pdo.class.php index 83ebfcddc..e1ed6168a 100644 --- a/classes/db/DBSqlite3_pdo.class.php +++ b/classes/db/DBSqlite3_pdo.class.php @@ -1,819 +1,819 @@ - 'INTEGER', - 'number' => 'INTEGER', - 'varchar' => 'VARHAR', - 'char' => 'CHAR', - 'text' => 'TEXT', - 'bigtext' => 'TEXT', - 'date' => 'VARCHAR(14)', - 'float' => 'REAL', - ); - - /** - * @brief constructor - **/ - function DBSqlite3_pdo() { - $this->_setDBInfo(); - $this->_connect(); - } - - /** - * @brief create an instance of this class - */ - function create() - { - return new DBSqlite3_pdo; - } - - /** - * @brief 설치 가능 여부를 return - **/ - function isSupported() { - return class_exists('PDO'); - } - - /** - * @brief DB정보 설정 및 connect/ close - **/ - function _setDBInfo() { - $db_info = Context::getDBInfo(); - $this->database = $db_info->db_database; - $this->prefix = $db_info->db_table_prefix; - if(!substr($this->prefix,-1)!='_') $this->prefix .= '_'; - } - - /** - * @brief DB 접속 - **/ - function _connect() { - // db 정보가 없으면 무시 - if(!$this->database) return; - - // 데이터 베이스 파일 접속 시도 - try { - // PDO is only supported with PHP5, - // so it is allowed to use try~catch statment in this class. - $this->handler = new PDO('sqlite:'.$this->database); - } catch (PDOException $e) { - $this->setError(-1, 'Connection failed: '.$e->getMessage()); - $this->is_connected = false; - return; - } - - // 접속체크 - $this->is_connected = true; - $this->password = md5($this->password); - } - - /** - * @brief DB접속 해제 - **/ - function close() { - if(!$this->is_connected) return; - $this->commit(); - } - - /** - * @brief 트랜잭션 시작 - **/ - function begin() { - if(!$this->is_connected || $this->transaction_started) return; - if($this->handler->beginTransaction()) $this->transaction_started = true; - } - - /** - * @brief 롤백 - **/ - function rollback() { - if(!$this->is_connected || !$this->transaction_started) return; - $this->handler->rollBack(); - $this->transaction_started = false; - } - - /** - * @brief 커밋 - **/ - function commit($force = false) { - if(!$force && (!$this->is_connected || !$this->transaction_started)) return; - $this->handler->commit(); - $this->transaction_started = false; - } - - /** - * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 - **/ - function addQuotes($string) { - if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); - if(!is_numeric($string)) $string = str_replace("'","''",$string); - return $string; - } - - /** - * @brief : 쿼리문의 prepare - **/ - function _prepare($query) { - if(!$this->is_connected) return; - - // 쿼리 시작을 알림 - $this->actStart($query); - - $this->stmt = $this->handler->prepare($query); - - if($this->handler->errorCode() != '00000') { - $this->setError($this->handler->errorCode(), print_r($this->handler->errorInfo(),true)); - $this->actFinish(); - } - $this->bind_idx = 0; - $this->bind_vars = array(); - } - - /** - * @brief : stmt에 binding params - **/ - function _bind($val) { - if(!$this->is_connected || !$this->stmt) return; - - $this->bind_idx ++; - $this->bind_vars[] = $val; - $this->stmt->bindParam($this->bind_idx, $val); - } - - /** - * @brief : prepare된 쿼리의 execute - **/ - function _execute() { - if(!$this->is_connected || !$this->stmt) return; - - $this->stmt->execute(); - - if($this->stmt->errorCode() === '00000') { - $output = null; - while($tmp = $this->stmt->fetch(PDO::FETCH_ASSOC)) { - unset($obj); - foreach($tmp as $key => $val) { - $pos = strpos($key, '.'); - if($pos) $key = substr($key, $pos+1); - $obj->{$key} = str_replace("''","'",$val); - } - $output[] = $obj; - } - } else { - $this->setError($this->stmt->errorCode(),print_r($this->stmt->errorInfo(),true)); - } - - $this->stmt = null; - $this->actFinish(); - - if(is_array($output) && count($output)==1) return $output[0]; - return $output; - } - - /** - * @brief 1씩 증가되는 sequence값을 return - **/ - function getNextSequence() { - $query = sprintf("insert into %ssequence (seq) values (NULL)", $this->prefix); - $this->_prepare($query); - $result = $this->_execute(); - $sequence = $this->handler->lastInsertId(); - if($sequence % 10000 == 0) { - $query = sprintf("delete from %ssequence where seq < %d", $this->prefix, $sequence); - $this->_prepare($query); - $result = $this->_execute(); - } - - return $sequence; - } - - /** - * @brief 테이블 기생성 여부 return - **/ - function isTableExists($target_name) { - $query = sprintf('pragma table_info(%s%s)', $this->prefix, $target_name); - $this->_prepare($query); - if(!$this->_execute()) return false; - return true; - } - - /** - * @brief 특정 테이블에 특정 column 추가 - **/ - function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) { - $type = $this->column_type[$type]; - if(strtoupper($type)=='INTEGER') $size = ''; - - $query = sprintf("alter table %s%s add %s ", $this->prefix, $table_name, $column_name); - if($size) $query .= sprintf(" %s(%s) ", $type, $size); - else $query .= sprintf(" %s ", $type); - if($default) $query .= sprintf(" default '%s' ", $default); - if($notnull) $query .= " not null "; - - $this->_prepare($query); - return $this->_execute(); - } - - /** - * @brief 특정 테이블에 특정 column 제거 - **/ - function dropColumn($table_name, $column_name) { - $query = sprintf("alter table %s%s drop column %s ", $this->prefix, $table_name, $column_name); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 column의 정보를 return - **/ - function isColumnExists($table_name, $column_name) { - $query = sprintf("pragma table_info(%s%s)", $this->prefix, $table_name); - $this->_prepare($query); - $output = $this->_execute(); - - if($output) { - $column_name = strtolower($column_name); - foreach($output as $key => $val) { - $name = strtolower($val->name); - if($column_name == $name) return true; - } - } - return false; - } - - /** - * @brief 특정 테이블에 특정 인덱스 추가 - * $target_columns = array(col1, col2) - * $is_unique? unique : none - **/ - function addIndex($table_name, $index_name, $target_columns, $is_unique = false) { - if(!is_array($target_columns)) $target_columns = array($target_columns); - - $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); - - $query = sprintf('CREATE %s INDEX %s ON %s%s (%s)', $is_unique?'UNIQUE':'', $key_name, $this->prefix, $table_name, implode(',',$target_columns)); - $this->_prepare($query); - $this->_execute(); - } - - /** - * @brief 특정 테이블의 특정 인덱스 삭제 - **/ - function dropIndex($table_name, $index_name, $is_unique = false) { - $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); - $query = sprintf("DROP INDEX %s", $this->prefix, $table_name, $key_name); - $this->_query($query); - } - - /** - * @brief 특정 테이블의 index 정보를 return - **/ - function isIndexExists($table_name, $index_name) { - $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); - - $query = sprintf("pragma index_info(%s)", $key_name); - $this->_prepare($query); - $output = $this->_execute(); - if(!$output) return false; - return true; - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXml($xml_doc) { - return $this->_createTable($xml_doc); - } - - /** - * @brief xml 을 받아서 테이블을 생성 - **/ - function createTableByXmlFile($file_name) { - if(!file_exists($file_name)) return; - // xml 파일을 읽음 - $buff = FileHandler::readFile($file_name); - return $this->_createTable($buff); - } - - /** - * @brief schema xml을 이용하여 create table query생성 - * - * type : number, varchar, text, char, date, \n - * opt : notnull, default, size\n - * index : primary key, index, unique\n - **/ - function _createTable($xml_doc) { - // xml parsing - $oXml = new XmlParser(); - $xml_obj = $oXml->parse($xml_doc); - - // 테이블 생성 schema 작성 - $table_name = $xml_obj->table->attrs->name; - if($this->isTableExists($table_name)) return; - $table_name = $this->prefix.$table_name; - - if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; - else $columns = $xml_obj->table->column; - - foreach($columns as $column) { - $name = $column->attrs->name; - $type = $column->attrs->type; - if(strtoupper($this->column_type[$type])=='INTEGER') $size = ''; - else $size = $column->attrs->size; - $notnull = $column->attrs->notnull; - $primary_key = $column->attrs->primary_key; - $index = $column->attrs->index; - $unique = $column->attrs->unique; - $default = $column->attrs->default; - $auto_increment = $column->attrs->auto_increment; - - if($auto_increment) { - $column_schema[] = sprintf('%s %s PRIMARY KEY %s', - $name, - $this->column_type[$type], - $auto_increment?'AUTOINCREMENT':'' - ); - } else { - $column_schema[] = sprintf('%s %s%s %s %s %s', - $name, - $this->column_type[$type], - $size?'('.$size.')':'', - $notnull?'NOT NULL':'', - $primary_key?'PRIMARY KEY':'', - isset($default)?"DEFAULT '".$default."'":'' - ); - } - - if($unique) $unique_list[$unique][] = $name; - else if($index) $index_list[$index][] = $name; - } - - $schema = sprintf('CREATE TABLE %s (%s%s) ;', $table_name," ", implode($column_schema,", ")); - $this->_prepare($schema); - $this->_execute(); - if($this->isError()) return; - - if(count($unique_list)) { - foreach($unique_list as $key => $val) { - $query = sprintf('CREATE UNIQUE INDEX %s_%s ON %s (%s)', $this->addQuotes($table_name), $key, $this->addQuotes($table_name), implode(',',$val)); - $this->_prepare($query); - $this->_execute(); - if($this->isError()) $this->rollback(); - } - } - - if(count($index_list)) { - foreach($index_list as $key => $val) { - $query = sprintf('CREATE INDEX %s_%s ON %s (%s)', $this->addQuotes($table_name), $key, $this->addQuotes($table_name), implode(',',$val)); - $this->_prepare($query); - $this->_execute(); - if($this->isError()) $this->rollback(); - } - } - } - - /** - * @brief 조건문 작성하여 return - **/ - function getCondition($output) { - if(!$output->conditions) return; - $condition = $this->_getCondition($output->conditions,$output->column_type); - if($condition) $condition = ' where '.$condition; - return $condition; - } - - function getLeftCondition($conditions,$column_type){ - return $this->_getCondition($conditions,$column_type); - } - - - function _getCondition($conditions,$column_type) { - $condition = ''; - foreach($conditions as $val) { - $sub_condition = ''; - foreach($val['condition'] as $v) { - if(!isset($v['value'])) continue; - if($v['value'] === '') continue; - if(!in_array(gettype($v['value']), array('string', 'integer', 'double', 'array'))) continue; - - $name = $v['column']; - $operation = $v['operation']; - $value = $v['value']; - $type = $this->getColumnType($column_type,$name); - $pipe = $v['pipe']; - - $value = $this->getConditionValue($name, $value, $operation, $type, $column_type); - if(!$value) $value = $v['value']; - $str = $this->getConditionPart($name, $value, $operation); - if($sub_condition) $sub_condition .= ' '.$pipe.' '; - $sub_condition .= $str; - } - if($sub_condition) { - if($condition && $val['pipe']) $condition .= ' '.$val['pipe'].' '; - $condition .= '('.$sub_condition.')'; - } - } - return $condition; - } - - /** - * @brief insertAct 처리 - **/ - function _executeInsertAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = $this->prefix.$val; - } - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - $name = $val['name']; - $value = $val['value']; - - $key_list[] = $name; - - if($output->column_type[$name]!='number') $val_list[] = $this->addQuotes($value); - else { - if(!$value || is_numeric($value)) $value = (int)$value; - $val_list[] = $value; - } - - $prepare_list[] = '?'; - } - - $query = sprintf("INSERT INTO %s (%s) VALUES (%s);", implode(',',$table_list), implode(',',$key_list), implode(',',$prepare_list)); - - $this->_prepare($query); - - $val_count = count($val_list); - for($i=0;$i<$val_count;$i++) $this->_bind($val_list[$i]); - - return $this->_execute(); - } - - /** - * @brief updateAct 처리 - **/ - function _executeUpdateAct($output) { - $table_count = count(array_values($output->tables)); - - // 대상 테이블이 1개일 경우 - if($table_count == 1) { - // 테이블 정리 - list($target_table) = array_values($output->tables); - $target_table = $this->prefix.$target_table; - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - if(!isset($val['value'])) continue; - $name = $val['name']; - $value = $val['value']; - if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value; - else { - if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'"; - elseif(!$value || is_numeric($value)) $value = (int)$value; - - $column_list[] = sprintf("%s = %s", $name, $value); - } - } - - // 조건절 정리 - $condition = $this->getCondition($output); - - $query = sprintf("update %s set %s %s", $target_table, implode(',',$column_list), $condition); - - // 대상 테이블이 2개일 경우 (sqlite에서 update 테이블을 1개 이상 지정 못해서 이렇게 꽁수로... 다른 방법이 있으려나..) - } elseif($table_count == 2) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[$val] = $this->prefix.$key; - } - list($source_table, $target_table) = array_values($table_list); - - // 조건절 정리 - $condition = $this->getCondition($output); - foreach($table_list as $key => $val) { - $condition = eregi_replace($key.'\\.', $val.'.', $condition); - } - - // 컬럼 정리 - foreach($output->columns as $key => $val) { - if(!isset($val['value'])) continue; - $name = $val['name']; - $value = $val['value']; - list($s_prefix, $s_column) = explode('.',$name); - list($t_prefix, $t_column) = explode('.',$value); - - $s_table = $table_list[$s_prefix]; - $t_table = $table_list[$t_prefix]; - $column_list[] = sprintf(' %s = (select %s from %s %s) ', $s_column, $t_column, $t_table, $condition); - } - - $query = sprintf('update %s set %s where exists(select * from %s %s)', $source_table, implode(',', $column_list), $target_table, $condition); - } else { - return; - } - - $this->_prepare($query); - return $this->_execute(); - } - - /** - * @brief deleteAct 처리 - **/ - function _executeDeleteAct($output) { - // 테이블 정리 - foreach($output->tables as $key => $val) { - $table_list[] = $this->prefix.$val; - } - - // 조건절 정리 - $condition = $this->getCondition($output); - - $query = sprintf("delete from %s %s", implode(',',$table_list), $condition); - - $this->_prepare($query); - return $this->_execute(); - } - - /** - * @brief selectAct 처리 - * - * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n - * navigation이라는 method를 제공 - **/ - function _executeSelectAct($output) { - // 테이블 정리 - $table_list = array(); - foreach($output->tables as $key => $val) { - $table_list[] = $this->prefix.$val.' as '.$key; - } - - $left_join = array(); - // why??? - $left_tables= (array)$output->left_tables; - - foreach($left_tables as $key => $val) { - $condition = $this->_getCondition($output->left_conditions[$key],$output->column_type); - if($condition){ - $left_join[] = $val . ' '.$this->prefix.$output->_tables[$key].' as '.$key . ' on (' . $condition . ')'; - } - } - - - $click_count = array(); - if(!$output->columns){ - $output->columns = array(array('name'=>'*')); - } - - $column_list = array(); - foreach($output->columns as $key => $val) { - $name = $val['name']; - $alias = $val['alias']; - if($val['click_count']) $click_count[] = $val['name']; - - if(substr($name,-1) == '*') { - $column_list[] = $name; - } elseif(strpos($name,'.')===false && strpos($name,'(')===false) { - if($alias) $column_list[$alias] = sprintf('%s as %s', $name, $alias); - else $column_list[] = sprintf('%s',$name); - } else { - if($alias) $column_list[$alias] = sprintf('%s as %s', $name, $alias); - else $column_list[] = sprintf('%s',$name); - } - } - $columns = implode(',',$column_list); - - $condition = $this->getCondition($output); - - $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에 쿼리 추가 - if($output->order) { - $conditions = $this->getConditionList($output); - if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - } - } - - if(count($output->groups)){ - $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); - if(count($output->arg_columns)) - { - foreach($output->groups as $group) - { - if($column_list[$group]) $output->arg_columns[] = $column_list[$group]; - } - } - } - - if($output->order) { - foreach($output->order as $key => $val) { - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; - } - if(count($index_list)) $orderby_query = ' order by '.implode(',',$index_list); - } - - if(count($output->arg_columns)) - { - $columns = join(',',$output->arg_columns); - } - - $query = sprintf("select %s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query); - // 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):''; - $this->_prepare($query); - $data = $this->_execute(); - if($this->isError()) return; - - if(count($click_count)>0 && count($output->conditions)>0){ - $_query = ''; - foreach($click_count as $k => $c) $_query .= sprintf(',%s=%s+1 ',$c,$c); - $_query = sprintf('update %s set %s %s',implode(',',$table_list), substr($_query,1), $condition); - $this->_query($_query); - } - - $buff = new Object(); - $buff->data = $data; - return $buff; - } - - /** - * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 - * - * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; - **/ - 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 쿼리의 전체 갯수를 구하기 위한 수정 - // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. - // - $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; - $total_count = $this->getCountCache($output->tables, $count_condition); - if($total_count === false) { - $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); - $result = $this->_query($count_query); - $count_output = $this->_fetch($result); - $total_count = (int)$count_output->count; - $this->putCountCache($output->tables, $count_condition, $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); - $count_output = $this->_execute(); - $total_count = (int)$count_output->count; - - $list_count = $output->list_count['value']; - if(!$list_count) $list_count = 20; - $page_count = $output->page_count['value']; - if(!$page_count) $page_count = 10; - $page = $output->page['value']; - if(!$page) $page = 1; - - // 전체 페이지를 구함 - if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1; - else $total_page = 1; - - // 페이지 변수를 체크 - if($page > $total_page) $page = $total_page; - $start_count = ($page-1)*$list_count; - - // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가 - if($output->order) { - $conditions = $this->getConditionList($output); - if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { - foreach($output->order as $key => $val) { - $col = $val[0]; - if(!in_array($col, array('list_order','update_order'))) continue; - if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); - else $condition = sprintf(' where %s < 2100000000 ', $col); - } - } - } - - if(count($output->groups)){ - $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); - if(count($output->arg_columns)) - { - foreach($output->groups as $group) - { - if($column_list[$group]) $output->arg_columns[] = $column_list[$group]; - } - } - } - - if($output->order) { - foreach($output->order as $key => $val) { - $index_list[] = sprintf('%s %s', $val[0], $val[1]); - if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; - } - if(count($index_list)) $orderby_query = ' order by '.implode(',',$index_list); - } - - if(count($output->arg_columns)) - { - $columns = join(',',$output->arg_columns); - } - - // return 결과물 생성 - $buff = new Object(); - $buff->total_count = 0; - $buff->total_page = 0; - $buff->page = 1; - $buff->data = array(); - $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); - - // 쿼리 실행 - $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):''; - - $this->_prepare($query); - - if($this->isError()) { - $this->setError($this->handler->errorCode(), print_r($this->handler->errorInfo(),true)); - $this->actFinish(); - return $buff; - } - - $this->stmt->execute(); - - if($this->stmt->errorCode() != '00000') { - $this->setError($this->stmt->errorCode(), print_r($this->stmt->errorInfo(),true)); - $this->actFinish(); - return $buff; - } - - $output = null; - $virtual_no = $total_count - ($page-1)*$list_count; - while($tmp = $this->stmt->fetch(PDO::FETCH_ASSOC)) { - unset($obj); - foreach($tmp as $key => $val) { - $pos = strpos($key, '.'); - if($pos) $key = substr($key, $pos+1); - $obj->{$key} = $val; - } - $data[$virtual_no--] = $obj; - } - - $this->stmt = null; - $this->actFinish(); - - $buff = new Object(); - $buff->total_count = $total_count; - $buff->total_page = $total_page; - $buff->page = $page; - $buff->data = $data; - - $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); - return $buff; - } - } - -return new DBSqlite3_pdo; -?> + 'INTEGER', + 'number' => 'INTEGER', + 'varchar' => 'VARHAR', + 'char' => 'CHAR', + 'text' => 'TEXT', + 'bigtext' => 'TEXT', + 'date' => 'VARCHAR(14)', + 'float' => 'REAL', + ); + + /** + * @brief constructor + **/ + function DBSqlite3_pdo() { + $this->_setDBInfo(); + $this->_connect(); + } + + /** + * @brief create an instance of this class + */ + function create() + { + return new DBSqlite3_pdo; + } + + /** + * @brief 설치 가능 여부를 return + **/ + function isSupported() { + return class_exists('PDO'); + } + + /** + * @brief DB정보 설정 및 connect/ close + **/ + function _setDBInfo() { + $db_info = Context::getDBInfo(); + $this->database = $db_info->db_database; + $this->prefix = $db_info->db_table_prefix; + if(!substr($this->prefix,-1)!='_') $this->prefix .= '_'; + } + + /** + * @brief DB 접속 + **/ + function _connect() { + // db 정보가 없으면 무시 + if(!$this->database) return; + + // 데이터 베이스 파일 접속 시도 + try { + // PDO is only supported with PHP5, + // so it is allowed to use try~catch statment in this class. + $this->handler = new PDO('sqlite:'.$this->database); + } catch (PDOException $e) { + $this->setError(-1, 'Connection failed: '.$e->getMessage()); + $this->is_connected = false; + return; + } + + // 접속체크 + $this->is_connected = true; + $this->password = md5($this->password); + } + + /** + * @brief DB접속 해제 + **/ + function close() { + if(!$this->is_connected) return; + $this->commit(); + } + + /** + * @brief 트랜잭션 시작 + **/ + function begin() { + if(!$this->is_connected || $this->transaction_started) return; + if($this->handler->beginTransaction()) $this->transaction_started = true; + } + + /** + * @brief 롤백 + **/ + function rollback() { + if(!$this->is_connected || !$this->transaction_started) return; + $this->handler->rollBack(); + $this->transaction_started = false; + } + + /** + * @brief 커밋 + **/ + function commit($force = false) { + if(!$force && (!$this->is_connected || !$this->transaction_started)) return; + $this->handler->commit(); + $this->transaction_started = false; + } + + /** + * @brief 쿼리에서 입력되는 문자열 변수들의 quotation 조절 + **/ + function addQuotes($string) { + if(version_compare(PHP_VERSION, "5.9.0", "<") && get_magic_quotes_gpc()) $string = stripslashes(str_replace("\\","\\\\",$string)); + if(!is_numeric($string)) $string = str_replace("'","''",$string); + return $string; + } + + /** + * @brief : 쿼리문의 prepare + **/ + function _prepare($query) { + if(!$this->is_connected) return; + + // 쿼리 시작을 알림 + $this->actStart($query); + + $this->stmt = $this->handler->prepare($query); + + if($this->handler->errorCode() != '00000') { + $this->setError($this->handler->errorCode(), print_r($this->handler->errorInfo(),true)); + $this->actFinish(); + } + $this->bind_idx = 0; + $this->bind_vars = array(); + } + + /** + * @brief : stmt에 binding params + **/ + function _bind($val) { + if(!$this->is_connected || !$this->stmt) return; + + $this->bind_idx ++; + $this->bind_vars[] = $val; + $this->stmt->bindParam($this->bind_idx, $val); + } + + /** + * @brief : prepare된 쿼리의 execute + **/ + function _execute() { + if(!$this->is_connected || !$this->stmt) return; + + $this->stmt->execute(); + + if($this->stmt->errorCode() === '00000') { + $output = null; + while($tmp = $this->stmt->fetch(PDO::FETCH_ASSOC)) { + unset($obj); + foreach($tmp as $key => $val) { + $pos = strpos($key, '.'); + if($pos) $key = substr($key, $pos+1); + $obj->{$key} = str_replace("''","'",$val); + } + $output[] = $obj; + } + } else { + $this->setError($this->stmt->errorCode(),print_r($this->stmt->errorInfo(),true)); + } + + $this->stmt = null; + $this->actFinish(); + + if(is_array($output) && count($output)==1) return $output[0]; + return $output; + } + + /** + * @brief 1씩 증가되는 sequence값을 return + **/ + function getNextSequence() { + $query = sprintf("insert into %ssequence (seq) values (NULL)", $this->prefix); + $this->_prepare($query); + $result = $this->_execute(); + $sequence = $this->handler->lastInsertId(); + if($sequence % 10000 == 0) { + $query = sprintf("delete from %ssequence where seq < %d", $this->prefix, $sequence); + $this->_prepare($query); + $result = $this->_execute(); + } + + return $sequence; + } + + /** + * @brief 테이블 기생성 여부 return + **/ + function isTableExists($target_name) { + $query = sprintf('pragma table_info(%s%s)', $this->prefix, $target_name); + $this->_prepare($query); + if(!$this->_execute()) return false; + return true; + } + + /** + * @brief 특정 테이블에 특정 column 추가 + **/ + function addColumn($table_name, $column_name, $type='number', $size='', $default = '', $notnull=false) { + $type = $this->column_type[$type]; + if(strtoupper($type)=='INTEGER') $size = ''; + + $query = sprintf("alter table %s%s add %s ", $this->prefix, $table_name, $column_name); + if($size) $query .= sprintf(" %s(%s) ", $type, $size); + else $query .= sprintf(" %s ", $type); + if($default) $query .= sprintf(" default '%s' ", $default); + if($notnull) $query .= " not null "; + + $this->_prepare($query); + return $this->_execute(); + } + + /** + * @brief 특정 테이블에 특정 column 제거 + **/ + function dropColumn($table_name, $column_name) { + $query = sprintf("alter table %s%s drop column %s ", $this->prefix, $table_name, $column_name); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 column의 정보를 return + **/ + function isColumnExists($table_name, $column_name) { + $query = sprintf("pragma table_info(%s%s)", $this->prefix, $table_name); + $this->_prepare($query); + $output = $this->_execute(); + + if($output) { + $column_name = strtolower($column_name); + foreach($output as $key => $val) { + $name = strtolower($val->name); + if($column_name == $name) return true; + } + } + return false; + } + + /** + * @brief 특정 테이블에 특정 인덱스 추가 + * $target_columns = array(col1, col2) + * $is_unique? unique : none + **/ + function addIndex($table_name, $index_name, $target_columns, $is_unique = false) { + if(!is_array($target_columns)) $target_columns = array($target_columns); + + $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); + + $query = sprintf('CREATE %s INDEX %s ON %s%s (%s)', $is_unique?'UNIQUE':'', $key_name, $this->prefix, $table_name, implode(',',$target_columns)); + $this->_prepare($query); + $this->_execute(); + } + + /** + * @brief 특정 테이블의 특정 인덱스 삭제 + **/ + function dropIndex($table_name, $index_name, $is_unique = false) { + $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); + $query = sprintf("DROP INDEX %s", $this->prefix, $table_name, $key_name); + $this->_query($query); + } + + /** + * @brief 특정 테이블의 index 정보를 return + **/ + function isIndexExists($table_name, $index_name) { + $key_name = sprintf('%s%s_%s', $this->prefix, $table_name, $index_name); + + $query = sprintf("pragma index_info(%s)", $key_name); + $this->_prepare($query); + $output = $this->_execute(); + if(!$output) return false; + return true; + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXml($xml_doc) { + return $this->_createTable($xml_doc); + } + + /** + * @brief xml 을 받아서 테이블을 생성 + **/ + function createTableByXmlFile($file_name) { + if(!file_exists($file_name)) return; + // xml 파일을 읽음 + $buff = FileHandler::readFile($file_name); + return $this->_createTable($buff); + } + + /** + * @brief schema xml을 이용하여 create table query생성 + * + * type : number, varchar, text, char, date, \n + * opt : notnull, default, size\n + * index : primary key, index, unique\n + **/ + function _createTable($xml_doc) { + // xml parsing + $oXml = new XmlParser(); + $xml_obj = $oXml->parse($xml_doc); + + // 테이블 생성 schema 작성 + $table_name = $xml_obj->table->attrs->name; + if($this->isTableExists($table_name)) return; + $table_name = $this->prefix.$table_name; + + if(!is_array($xml_obj->table->column)) $columns[] = $xml_obj->table->column; + else $columns = $xml_obj->table->column; + + foreach($columns as $column) { + $name = $column->attrs->name; + $type = $column->attrs->type; + if(strtoupper($this->column_type[$type])=='INTEGER') $size = ''; + else $size = $column->attrs->size; + $notnull = $column->attrs->notnull; + $primary_key = $column->attrs->primary_key; + $index = $column->attrs->index; + $unique = $column->attrs->unique; + $default = $column->attrs->default; + $auto_increment = $column->attrs->auto_increment; + + if($auto_increment) { + $column_schema[] = sprintf('%s %s PRIMARY KEY %s', + $name, + $this->column_type[$type], + $auto_increment?'AUTOINCREMENT':'' + ); + } else { + $column_schema[] = sprintf('%s %s%s %s %s %s', + $name, + $this->column_type[$type], + $size?'('.$size.')':'', + $notnull?'NOT NULL':'', + $primary_key?'PRIMARY KEY':'', + isset($default)?"DEFAULT '".$default."'":'' + ); + } + + if($unique) $unique_list[$unique][] = $name; + else if($index) $index_list[$index][] = $name; + } + + $schema = sprintf('CREATE TABLE %s (%s%s) ;', $table_name," ", implode($column_schema,", ")); + $this->_prepare($schema); + $this->_execute(); + if($this->isError()) return; + + if(count($unique_list)) { + foreach($unique_list as $key => $val) { + $query = sprintf('CREATE UNIQUE INDEX %s_%s ON %s (%s)', $this->addQuotes($table_name), $key, $this->addQuotes($table_name), implode(',',$val)); + $this->_prepare($query); + $this->_execute(); + if($this->isError()) $this->rollback(); + } + } + + if(count($index_list)) { + foreach($index_list as $key => $val) { + $query = sprintf('CREATE INDEX %s_%s ON %s (%s)', $this->addQuotes($table_name), $key, $this->addQuotes($table_name), implode(',',$val)); + $this->_prepare($query); + $this->_execute(); + if($this->isError()) $this->rollback(); + } + } + } + + /** + * @brief 조건문 작성하여 return + **/ + function getCondition($output) { + if(!$output->conditions) return; + $condition = $this->_getCondition($output->conditions,$output->column_type); + if($condition) $condition = ' where '.$condition; + return $condition; + } + + function getLeftCondition($conditions,$column_type){ + return $this->_getCondition($conditions,$column_type); + } + + + function _getCondition($conditions,$column_type) { + $condition = ''; + foreach($conditions as $val) { + $sub_condition = ''; + foreach($val['condition'] as $v) { + if(!isset($v['value'])) continue; + if($v['value'] === '') continue; + if(!in_array(gettype($v['value']), array('string', 'integer', 'double', 'array'))) continue; + + $name = $v['column']; + $operation = $v['operation']; + $value = $v['value']; + $type = $this->getColumnType($column_type,$name); + $pipe = $v['pipe']; + + $value = $this->getConditionValue($name, $value, $operation, $type, $column_type); + if(!$value) $value = $v['value']; + $str = $this->getConditionPart($name, $value, $operation); + if($sub_condition) $sub_condition .= ' '.$pipe.' '; + $sub_condition .= $str; + } + if($sub_condition) { + if($condition && $val['pipe']) $condition .= ' '.$val['pipe'].' '; + $condition .= '('.$sub_condition.')'; + } + } + return $condition; + } + + /** + * @brief insertAct 처리 + **/ + function _executeInsertAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = $this->prefix.$val; + } + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + $name = $val['name']; + $value = $val['value']; + + $key_list[] = $name; + + if($output->column_type[$name]!='number') $val_list[] = $this->addQuotes($value); + else { + if(!$value || is_numeric($value)) $value = (int)$value; + $val_list[] = $value; + } + + $prepare_list[] = '?'; + } + + $query = sprintf("INSERT INTO %s (%s) VALUES (%s);", implode(',',$table_list), implode(',',$key_list), implode(',',$prepare_list)); + + $this->_prepare($query); + + $val_count = count($val_list); + for($i=0;$i<$val_count;$i++) $this->_bind($val_list[$i]); + + return $this->_execute(); + } + + /** + * @brief updateAct 처리 + **/ + function _executeUpdateAct($output) { + $table_count = count(array_values($output->tables)); + + // 대상 테이블이 1개일 경우 + if($table_count == 1) { + // 테이블 정리 + list($target_table) = array_values($output->tables); + $target_table = $this->prefix.$target_table; + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + if(!isset($val['value'])) continue; + $name = $val['name']; + $value = $val['value']; + if(strpos($name,'.')!==false&&strpos($value,'.')!==false) $column_list[] = $name.' = '.$value; + else { + if($output->column_type[$name]!='number') $value = "'".$this->addQuotes($value)."'"; + elseif(!$value || is_numeric($value)) $value = (int)$value; + + $column_list[] = sprintf("%s = %s", $name, $value); + } + } + + // 조건절 정리 + $condition = $this->getCondition($output); + + $query = sprintf("update %s set %s %s", $target_table, implode(',',$column_list), $condition); + + // 대상 테이블이 2개일 경우 (sqlite에서 update 테이블을 1개 이상 지정 못해서 이렇게 꽁수로... 다른 방법이 있으려나..) + } elseif($table_count == 2) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[$val] = $this->prefix.$key; + } + list($source_table, $target_table) = array_values($table_list); + + // 조건절 정리 + $condition = $this->getCondition($output); + foreach($table_list as $key => $val) { + $condition = eregi_replace($key.'\\.', $val.'.', $condition); + } + + // 컬럼 정리 + foreach($output->columns as $key => $val) { + if(!isset($val['value'])) continue; + $name = $val['name']; + $value = $val['value']; + list($s_prefix, $s_column) = explode('.',$name); + list($t_prefix, $t_column) = explode('.',$value); + + $s_table = $table_list[$s_prefix]; + $t_table = $table_list[$t_prefix]; + $column_list[] = sprintf(' %s = (select %s from %s %s) ', $s_column, $t_column, $t_table, $condition); + } + + $query = sprintf('update %s set %s where exists(select * from %s %s)', $source_table, implode(',', $column_list), $target_table, $condition); + } else { + return; + } + + $this->_prepare($query); + return $this->_execute(); + } + + /** + * @brief deleteAct 처리 + **/ + function _executeDeleteAct($output) { + // 테이블 정리 + foreach($output->tables as $key => $val) { + $table_list[] = $this->prefix.$val; + } + + // 조건절 정리 + $condition = $this->getCondition($output); + + $query = sprintf("delete from %s %s", implode(',',$table_list), $condition); + + $this->_prepare($query); + return $this->_execute(); + } + + /** + * @brief selectAct 처리 + * + * select의 경우 특정 페이지의 목록을 가져오는 것을 편하게 하기 위해\n + * navigation이라는 method를 제공 + **/ + function _executeSelectAct($output) { + // 테이블 정리 + $table_list = array(); + foreach($output->tables as $key => $val) { + $table_list[] = $this->prefix.$val.' as '.$key; + } + + $left_join = array(); + // why??? + $left_tables= (array)$output->left_tables; + + foreach($left_tables as $key => $val) { + $condition = $this->_getCondition($output->left_conditions[$key],$output->column_type); + if($condition){ + $left_join[] = $val . ' '.$this->prefix.$output->_tables[$key].' as '.$key . ' on (' . $condition . ')'; + } + } + + + $click_count = array(); + if(!$output->columns){ + $output->columns = array(array('name'=>'*')); + } + + $column_list = array(); + foreach($output->columns as $key => $val) { + $name = $val['name']; + $alias = $val['alias']; + if($val['click_count']) $click_count[] = $val['name']; + + if(substr($name,-1) == '*') { + $column_list[] = $name; + } elseif(strpos($name,'.')===false && strpos($name,'(')===false) { + if($alias) $column_list[$alias] = sprintf('%s as %s', $name, $alias); + else $column_list[] = sprintf('%s',$name); + } else { + if($alias) $column_list[$alias] = sprintf('%s as %s', $name, $alias); + else $column_list[] = sprintf('%s',$name); + } + } + $columns = implode(',',$column_list); + + $condition = $this->getCondition($output); + + $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에 쿼리 추가 + if($output->order) { + $conditions = $this->getConditionList($output); + if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + } + } + + if(count($output->groups)){ + $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); + if(count($output->arg_columns)) + { + foreach($output->groups as $group) + { + if($column_list[$group]) $output->arg_columns[] = $column_list[$group]; + } + } + } + + if($output->order) { + foreach($output->order as $key => $val) { + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; + } + if(count($index_list)) $orderby_query = ' order by '.implode(',',$index_list); + } + + if(count($output->arg_columns)) + { + $columns = join(',',$output->arg_columns); + } + + $query = sprintf("select %s from %s %s %s %s", $columns, implode(',',$table_list),implode(' ',$left_join), $condition, $groupby_query.$orderby_query); + // 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):''; + $this->_prepare($query); + $data = $this->_execute(); + if($this->isError()) return; + + if(count($click_count)>0 && count($output->conditions)>0){ + $_query = ''; + foreach($click_count as $k => $c) $_query .= sprintf(',%s=%s+1 ',$c,$c); + $_query = sprintf('update %s set %s %s',implode(',',$table_list), substr($_query,1), $condition); + $this->_query($_query); + } + + $buff = new Object(); + $buff->data = $data; + return $buff; + } + + /** + * @brief query xml에 navigation 정보가 있을 경우 페이징 관련 작업을 처리한다 + * + * 그닥 좋지는 않은 구조이지만 편리하다.. -_-; + **/ + 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 쿼리의 전체 갯수를 구하기 위한 수정 + // 정상적인 동작이 확인되면 주석으로 막아둔 부분으로 대체합니다. + // + $count_condition = count($output->groups) ? sprintf('%s group by %s', $condition, implode(', ', $output->groups)) : $condition; + $total_count = $this->getCountCache($output->tables, $count_condition); + if($total_count === false) { + $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); + $result = $this->_query($count_query); + $count_output = $this->_fetch($result); + $total_count = (int)$count_output->count; + $this->putCountCache($output->tables, $count_condition, $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); + $count_output = $this->_execute(); + $total_count = (int)$count_output->count; + + $list_count = $output->list_count['value']; + if(!$list_count) $list_count = 20; + $page_count = $output->page_count['value']; + if(!$page_count) $page_count = 10; + $page = $output->page['value']; + if(!$page) $page = 1; + + // 전체 페이지를 구함 + if($total_count) $total_page = (int)( ($total_count-1) / $list_count) + 1; + else $total_page = 1; + + // 페이지 변수를 체크 + if($page > $total_page) $page = $total_page; + $start_count = ($page-1)*$list_count; + + // list_order, update_order 로 정렬시에 인덱스 사용을 위해 condition에 쿼리 추가 + if($output->order) { + $conditions = $this->getConditionList($output); + if(!in_array('list_order', $conditions) && !in_array('update_order', $conditions)) { + foreach($output->order as $key => $val) { + $col = $val[0]; + if(!in_array($col, array('list_order','update_order'))) continue; + if($condition) $condition .= sprintf(' and %s < 2100000000 ', $col); + else $condition = sprintf(' where %s < 2100000000 ', $col); + } + } + } + + if(count($output->groups)){ + $groupby_query = sprintf(' group by %s', implode(',',$output->groups)); + if(count($output->arg_columns)) + { + foreach($output->groups as $group) + { + if($column_list[$group]) $output->arg_columns[] = $column_list[$group]; + } + } + } + + if($output->order) { + foreach($output->order as $key => $val) { + $index_list[] = sprintf('%s %s', $val[0], $val[1]); + if(count($output->arg_columns) && $column_list[$val[0]]) $output->arg_columns[] = $column_list[$val[0]]; + } + if(count($index_list)) $orderby_query = ' order by '.implode(',',$index_list); + } + + if(count($output->arg_columns)) + { + $columns = join(',',$output->arg_columns); + } + + // return 결과물 생성 + $buff = new Object(); + $buff->total_count = 0; + $buff->total_page = 0; + $buff->page = 1; + $buff->data = array(); + $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); + + // 쿼리 실행 + $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):''; + + $this->_prepare($query); + + if($this->isError()) { + $this->setError($this->handler->errorCode(), print_r($this->handler->errorInfo(),true)); + $this->actFinish(); + return $buff; + } + + $this->stmt->execute(); + + if($this->stmt->errorCode() != '00000') { + $this->setError($this->stmt->errorCode(), print_r($this->stmt->errorInfo(),true)); + $this->actFinish(); + return $buff; + } + + $output = null; + $virtual_no = $total_count - ($page-1)*$list_count; + while($tmp = $this->stmt->fetch(PDO::FETCH_ASSOC)) { + unset($obj); + foreach($tmp as $key => $val) { + $pos = strpos($key, '.'); + if($pos) $key = substr($key, $pos+1); + $obj->{$key} = $val; + } + $data[$virtual_no--] = $obj; + } + + $this->stmt = null; + $this->actFinish(); + + $buff = new Object(); + $buff->total_count = $total_count; + $buff->total_page = $total_page; + $buff->page = $page; + $buff->data = $data; + + $buff->page_navigation = new PageHandler($total_count, $total_page, $page, $page_count); + return $buff; + } + } + +return new DBSqlite3_pdo; +?> diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index 8ad991f7a..251605ac7 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -1,278 +1,278 @@ -gz_enabled = true; - - // request method에 따른 컨텐츠 결과물 추출 - if(Context::get('xeVirtualRequestMethod')=='xml') { - require_once("./classes/display/VirtualXMLDisplayHandler.php"); - $handler = new VirtualXMLDisplayHandler(); - } - else if(Context::getRequestMethod() == 'XMLRPC') { - require_once("./classes/display/XMLDisplayHandler.php"); - $handler = new XMLDisplayHandler(); - if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) $this->gz_enabled = false; - } - else if(Context::getRequestMethod() == 'JSON') { - require_once("./classes/display/JSONDisplayHandler.php"); - $handler = new JSONDisplayHandler(); - } - else { - require_once("./classes/display/HTMLDisplayHandler.php"); - $handler = new HTMLDisplayHandler(); - } - - $output = $handler->toDoc($oModule); - - // 출력하기 전에 trigger 호출 (before) - ModuleHandler::triggerCall('display', 'before', $output); - - // 애드온 실행 - $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 출력 - 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 출력 - $this->content_size = strlen($output); - $output .= $this->_debugOutput(); - - // 결과물 직접 출력 - if($this->gz_enabled) print ob_gzhandler($output, 5); - else print $output; - - // 출력 후 trigger 호출 (after) - ModuleHandler::triggerCall('display', 'after', $content); - } - - - /** - * @brief Print debugging message to designated output source depending on the value set to __DEBUG_OUTPUT_. \n - * This method only functions when __DEBUG__ variable is set to 1. - * __DEBUG_OUTPUT__ == 0, messages are written in ./files/_debug_message.php - **/ - function _debugOutput() { - if(!__DEBUG__) return; - - $end = getMicroTime(); - - // Firebug 콘솔 출력 - if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1) { - static $firephp; - if(!isset($firephp)) $firephp = FirePHP::getInstance(true); - - if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { - $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 출력 - if(__DEBUG__ & 2) { - $firephp->fb( - array('Request / Response info >>> '.$_SERVER['REQUEST_METHOD'].' / '.Context::getResponseMethod(), - array( - array('Request URI', 'Request method', 'Response method', 'Response contents size'), - array( - sprintf("%s:%s%s%s%s", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']?'?':'', $_SERVER['QUERY_STRING']), - $_SERVER['REQUEST_METHOD'], - Context::getResponseMethod(), - $this->content_size.' byte' - ) - ) - ), - 'TABLE' - ); - $firephp->fb( - array('Elapsed time >>> Total : '.sprintf('%0.5f sec', $end - __StartTime__), - array(array('DB queries', 'class file load', 'Template compile', 'XmlParse compile', 'PHP', 'Widgets', 'Trans Content'), - array( - sprintf('%0.5f sec', $GLOBALS['__db_elapsed_time__']), - sprintf('%0.5f sec', $GLOBALS['__elapsed_class_load__']), - sprintf('%0.5f sec (%d called)', $GLOBALS['__template_elapsed__'], $GLOBALS['__TemplateHandlerCalled__']), - sprintf('%0.5f sec', $GLOBALS['__xmlparse_elapsed__']), - sprintf('%0.5f sec', $end-__StartTime__-$GLOBALS['__template_elapsed__']-$GLOBALS['__xmlparse_elapsed__']-$GLOBALS['__db_elapsed_time__']-$GLOBALS['__elapsed_class_load__']), - sprintf('%0.5f sec', $GLOBALS['__widget_excute_elapsed__']), - sprintf('%0.5f sec', $GLOBALS['__trans_content_elapsed__']) - ) - ) - ), - 'TABLE' - ); - } - - // DB 쿼리 내역 출력 - if((__DEBUG__ & 4) && $GLOBALS['__db_queries__']) { - $queries_output = array(array('Query', 'Elapsed time', 'Result')); - foreach($GLOBALS['__db_queries__'] as $query) { - array_push($queries_output, array($query['query'], sprintf('%0.5f', $query['elapsed_time']), $query['result'])); - } - $firephp->fb( - array( - 'DB Queries >>> '.count($GLOBALS['__db_queries__']).' Queries, '.sprintf('%0.5f sec', $GLOBALS['__db_elapsed_time__']), - $queries_output - ), - 'TABLE' - ); - } - - - // 파일 및 HTML 주석으로 출력 - } else { - - // 전체 실행 시간 출력, Request/Response info 출력 - if(__DEBUG__ & 2) { - if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { - return; - } - - // Request/Response 정보 작성 - $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); - - // 전체 실행 시간 - $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__']); - - // 위젯 실행 시간 작성 - $buff .= sprintf("\n\tWidgets elapsed time \t\t: %0.5f sec", $GLOBALS['__widget_excute_elapsed__']); - - // 레이아웃 실행 시간 - $buff .= sprintf("\n\tLayout compile elapsed time \t: %0.5f sec", $GLOBALS['__layout_compile_elapsed__']); - - // 위젯, 에디터 컴포넌트 치환 시간 - $buff .= sprintf("\n\tTrans Content \t\t\t: %0.5f sec\n", $GLOBALS['__trans_content_elapsed__']); - } - - // DB 로그 작성 - if(__DEBUG__ & 4) { - if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { - return; - } - - if($GLOBALS['__db_queries__']) { - $buff .= sprintf("\n- DB Queries : %d Queries. %0.5f sec\n", count($GLOBALS['__db_queries__']), $GLOBALS['__db_elapsed_time__']); - $num = 0; - - foreach($GLOBALS['__db_queries__'] as $query) { - $buff .= sprintf("\t%02d. %s\n\t\t%0.6f sec. ", ++$num, $query['query'], $query['elapsed_time']); - if($query['result'] == 'Success') { - $buff .= "Query Success\n"; - } else { - $buff .= sprintf("Query $s : %d\n\t\t\t %s\n", $query['result'], $query['errno'], $query['errstr']); - } - } - } - } - - // HTML 주석으로 출력 - 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)); - - if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { - $buff = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php'; - } - - return ""; - } - - // 파일에 출력 - 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)); - - $buff = str_repeat('=', 40)."\n".$buff.str_repeat('-', 40); - $buff = "\n\n"; - - if(@!$fp = fopen($debug_file, 'a')) return; - fwrite($fp, $buff); - fclose($fp); - } - } - } - - /** - * @brief print a HTTP HEADER for XML, which is encoded in UTF-8 - **/ - function _printXMLHeader() { - header("Content-Type: text/xml; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - } - - - /** - * @brief print a HTTP HEADER for HTML, which is encoded in UTF-8 - **/ - function _printHTMLHeader() { - header("Content-Type: text/html; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - } - - - /** - * @brief print a HTTP HEADER for JSON, which is encoded in UTF-8 - **/ - function _printJSONHeader() { - header("Content-Type: text/html; charset=UTF-8"); - header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); - header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); - header("Cache-Control: no-store, no-cache, must-revalidate"); - header("Cache-Control: post-check=0, pre-check=0", false); - header("Pragma: no-cache"); - } - - - - - } -?> +gz_enabled = true; + + // request method에 따른 컨텐츠 결과물 추출 + if(Context::get('xeVirtualRequestMethod')=='xml') { + require_once("./classes/display/VirtualXMLDisplayHandler.php"); + $handler = new VirtualXMLDisplayHandler(); + } + else if(Context::getRequestMethod() == 'XMLRPC') { + require_once("./classes/display/XMLDisplayHandler.php"); + $handler = new XMLDisplayHandler(); + if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) $this->gz_enabled = false; + } + else if(Context::getRequestMethod() == 'JSON') { + require_once("./classes/display/JSONDisplayHandler.php"); + $handler = new JSONDisplayHandler(); + } + else { + require_once("./classes/display/HTMLDisplayHandler.php"); + $handler = new HTMLDisplayHandler(); + } + + $output = $handler->toDoc($oModule); + + // 출력하기 전에 trigger 호출 (before) + ModuleHandler::triggerCall('display', 'before', $output); + + // 애드온 실행 + $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 출력 + 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 출력 + $this->content_size = strlen($output); + $output .= $this->_debugOutput(); + + // 결과물 직접 출력 + if($this->gz_enabled) print ob_gzhandler($output, 5); + else print $output; + + // 출력 후 trigger 호출 (after) + ModuleHandler::triggerCall('display', 'after', $content); + } + + + /** + * @brief Print debugging message to designated output source depending on the value set to __DEBUG_OUTPUT_. \n + * This method only functions when __DEBUG__ variable is set to 1. + * __DEBUG_OUTPUT__ == 0, messages are written in ./files/_debug_message.php + **/ + function _debugOutput() { + if(!__DEBUG__) return; + + $end = getMicroTime(); + + // Firebug 콘솔 출력 + if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1) { + static $firephp; + if(!isset($firephp)) $firephp = FirePHP::getInstance(true); + + if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { + $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 출력 + if(__DEBUG__ & 2) { + $firephp->fb( + array('Request / Response info >>> '.$_SERVER['REQUEST_METHOD'].' / '.Context::getResponseMethod(), + array( + array('Request URI', 'Request method', 'Response method', 'Response contents size'), + array( + sprintf("%s:%s%s%s%s", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']?'?':'', $_SERVER['QUERY_STRING']), + $_SERVER['REQUEST_METHOD'], + Context::getResponseMethod(), + $this->content_size.' byte' + ) + ) + ), + 'TABLE' + ); + $firephp->fb( + array('Elapsed time >>> Total : '.sprintf('%0.5f sec', $end - __StartTime__), + array(array('DB queries', 'class file load', 'Template compile', 'XmlParse compile', 'PHP', 'Widgets', 'Trans Content'), + array( + sprintf('%0.5f sec', $GLOBALS['__db_elapsed_time__']), + sprintf('%0.5f sec', $GLOBALS['__elapsed_class_load__']), + sprintf('%0.5f sec (%d called)', $GLOBALS['__template_elapsed__'], $GLOBALS['__TemplateHandlerCalled__']), + sprintf('%0.5f sec', $GLOBALS['__xmlparse_elapsed__']), + sprintf('%0.5f sec', $end-__StartTime__-$GLOBALS['__template_elapsed__']-$GLOBALS['__xmlparse_elapsed__']-$GLOBALS['__db_elapsed_time__']-$GLOBALS['__elapsed_class_load__']), + sprintf('%0.5f sec', $GLOBALS['__widget_excute_elapsed__']), + sprintf('%0.5f sec', $GLOBALS['__trans_content_elapsed__']) + ) + ) + ), + 'TABLE' + ); + } + + // DB 쿼리 내역 출력 + if((__DEBUG__ & 4) && $GLOBALS['__db_queries__']) { + $queries_output = array(array('Query', 'Elapsed time', 'Result')); + foreach($GLOBALS['__db_queries__'] as $query) { + array_push($queries_output, array($query['query'], sprintf('%0.5f', $query['elapsed_time']), $query['result'])); + } + $firephp->fb( + array( + 'DB Queries >>> '.count($GLOBALS['__db_queries__']).' Queries, '.sprintf('%0.5f sec', $GLOBALS['__db_elapsed_time__']), + $queries_output + ), + 'TABLE' + ); + } + + + // 파일 및 HTML 주석으로 출력 + } else { + + // 전체 실행 시간 출력, Request/Response info 출력 + if(__DEBUG__ & 2) { + if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { + return; + } + + // Request/Response 정보 작성 + $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); + + // 전체 실행 시간 + $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__']); + + // 위젯 실행 시간 작성 + $buff .= sprintf("\n\tWidgets elapsed time \t\t: %0.5f sec", $GLOBALS['__widget_excute_elapsed__']); + + // 레이아웃 실행 시간 + $buff .= sprintf("\n\tLayout compile elapsed time \t: %0.5f sec", $GLOBALS['__layout_compile_elapsed__']); + + // 위젯, 에디터 컴포넌트 치환 시간 + $buff .= sprintf("\n\tTrans Content \t\t\t: %0.5f sec\n", $GLOBALS['__trans_content_elapsed__']); + } + + // DB 로그 작성 + if(__DEBUG__ & 4) { + if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { + return; + } + + if($GLOBALS['__db_queries__']) { + $buff .= sprintf("\n- DB Queries : %d Queries. %0.5f sec\n", count($GLOBALS['__db_queries__']), $GLOBALS['__db_elapsed_time__']); + $num = 0; + + foreach($GLOBALS['__db_queries__'] as $query) { + $buff .= sprintf("\t%02d. %s\n\t\t%0.6f sec. ", ++$num, $query['query'], $query['elapsed_time']); + if($query['result'] == 'Success') { + $buff .= "Query Success\n"; + } else { + $buff .= sprintf("Query $s : %d\n\t\t\t %s\n", $query['result'], $query['errno'], $query['errstr']); + } + } + } + } + + // HTML 주석으로 출력 + 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)); + + if(__DEBUG_PROTECT__ == 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { + $buff = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php'; + } + + return ""; + } + + // 파일에 출력 + 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)); + + $buff = str_repeat('=', 40)."\n".$buff.str_repeat('-', 40); + $buff = "\n\n"; + + if(@!$fp = fopen($debug_file, 'a')) return; + fwrite($fp, $buff); + fclose($fp); + } + } + } + + /** + * @brief print a HTTP HEADER for XML, which is encoded in UTF-8 + **/ + function _printXMLHeader() { + header("Content-Type: text/xml; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + } + + + /** + * @brief print a HTTP HEADER for HTML, which is encoded in UTF-8 + **/ + function _printHTMLHeader() { + header("Content-Type: text/html; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + } + + + /** + * @brief print a HTTP HEADER for JSON, which is encoded in UTF-8 + **/ + function _printJSONHeader() { + header("Content-Type: text/html; charset=UTF-8"); + header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); + header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); + header("Cache-Control: no-store, no-cache, must-revalidate"); + header("Cache-Control: post-check=0, pre-check=0", false); + header("Pragma: no-cache"); + } + + + + + } +?> diff --git a/classes/editor/EditorHandler.class.php b/classes/editor/EditorHandler.class.php index 930139792..806b30008 100644 --- a/classes/editor/EditorHandler.class.php +++ b/classes/editor/EditorHandler.class.php @@ -1,27 +1,27 @@ -extra_vars) return; - - foreach($info->extra_vars as $key => $val) { - $this->{$key} = trim($val->value); - } - } - - } - -?> +extra_vars) return; + + foreach($info->extra_vars as $key => $val) { + $this->{$key} = trim($val->value); + } + } + + } + +?> diff --git a/classes/extravar/Extravar.class.php b/classes/extravar/Extravar.class.php index bf3d83389..443b98fa1 100644 --- a/classes/extravar/Extravar.class.php +++ b/classes/extravar/Extravar.class.php @@ -1,311 +1,311 @@ -module_srl = $module_srl; - } - - /** - * @brief 확장변수 키를 등록 - * @param module_srl, idx, name, type, default, desc, is_required, search, value - **/ - function setExtraVarKeys($extra_keys) { - if(!is_array($extra_keys) || !count($extra_keys)) return; - foreach($extra_keys as $key => $val) { - $obj = null; - $obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid); - $this->keys[$val->idx] = $obj; - } - } - - /** - * @brief 확장변수 객체 배열 return - **/ - function getExtraVars() { - return $this->keys; - } - } - - /** - * @class ExtraItem - * @author NHN (developers@xpressengine.com) - * @brief 확장변수의 개별 값 - **/ - class ExtraItem { - var $module_srl = 0; - var $idx = 0; - var $name = 0; - var $type = 'text'; - var $default = null; - var $desc = ''; - var $is_required = 'N'; - var $search = 'N'; - var $value = null; - var $eid = ''; - - /** - * @brief constructor - **/ - function ExtraItem($module_srl, $idx, $name, $type = 'text', $default = null, $desc = '', $is_required = 'N', $search = 'N', $value = null, $eid = '') { - if(!$idx) return; - $this->module_srl = $module_srl; - $this->idx = $idx; - $this->name = $name; - $this->type = $type; - $this->default = $default; - $this->desc = $desc; - $this->is_required = $is_required; - $this->search = $search; - $this->value = $value; - $this->eid = $eid; - } - - /** - * @brief 값 지정 - **/ - function setValue($value) { - $this->value = $value; - } - - /** - * @brief type에 따라서 주어진 값을 변형하여 원형 값을 return - **/ - function _getTypeValue($type, $value) { - $value = trim($value); - if(!isset($value)) return; - switch($type) { - case 'homepage' : - if($value && !preg_match('/^([a-z]+):\/\//i',$value)) $value = 'http://'.$value; - return htmlspecialchars($value); - break; - case 'tel' : - if(is_array($value)) $values = $value; - elseif(strpos($value,'|@|')!==false) $values = explode('|@|', $value); - elseif(strpos($value,',')!==false) $values = explode(',', $value); - $values[0] = $values[0]; - $values[1] = $values[1]; - $values[2] = $values[2]; - return $values; - break; - break; - case 'checkbox' : - case 'radio' : - case 'select' : - if(is_array($value)) $values = $value; - elseif(strpos($value,'|@|')!==false) $values = explode('|@|', $value); - elseif(strpos($value,',')!==false) $values = explode(',', $value); - else $values = array($value); - for($i=0;$i_getTypeValue($this->type, $this->value); - switch($this->type) { - case 'homepage' : - return ($value)?(sprintf('
%s', $value, strlen($value)>60?substr($value,0,40).'...'.substr($value,-10):$value)):""; - case 'email_address' : - return ($value)?sprintf('%s', $value, $value):""; - break; - case 'tel' : - return sprintf('%s - %s - %s', $value[0],$value[1],$value[2]); - break; - case 'textarea' : - return nl2br($value); - break; - case 'checkbox' : - if(is_array($value)) return implode(', ',$value); - else return $value; - break; - case 'date' : - return zdate($value,"Y-m-d"); - break; - case 'select' : - case 'radio' : - if(is_array($value)) return implode(', ',$value); - else return $value; - break; - case 'kr_zip' : - if(is_array($value)) return implode(' ',$value); - else return $value; - break; - // case 'text' : - default : - return $value; - } - } - - /** - * @brief type에 따른 form을 리턴 - **/ - function getFormHTML() { - static $id_num = 1000; - - $type = $this->type; - $name = $this->name; - $value = $this->_getTypeValue($this->type, $this->value); - $default = $this->_getTypeValue($this->type, $this->default); - $column_name = 'extra_vars'.$this->idx; - $tmp_id = $column_name.'-'.$id_num++; - - $buff = ''; - switch($type) { - // 홈페이지 주소 - case 'homepage' : - $buff .= ''; - break; - - // Email 주소 - case 'email_address' : - $buff .= ''; - break; - - // 전화번호 - case 'tel' : - $buff .= - ''. - ''. - ''; - break; - - // textarea - case 'textarea' : - $buff .= ''; - break; - - // 다중 선택 - case 'checkbox' : - $buff .= '
    '; - foreach($default as $v) { - if($value && in_array($v, $value)) $checked = ' checked="checked"'; - else $checked = ''; - - // Temporary ID for labeling - $tmp_id = $column_name.'-'.$id_num++; - - $buff .='
  • '; - } - $buff .= '
'; - break; - - // 단일 선택 - case 'select' : - $buff .= ''; - break; - - // radio - case 'radio' : - $buff .= '
    '; - foreach($default as $v) { - if($value && in_array($v,$value)) $checked = ' checked="checked"'; - else $checked = ''; - - // Temporary ID for labeling - $tmp_id = $column_name.'-'.$id_num++; - - $buff .= '
  • '; - } - $buff .= '
'; - break; - - // 날짜 입력 - case 'date' : - // datepicker javascript plugin load - Context::loadJavascriptPlugin('ui.datepicker'); - - $buff .= - ''. - ''."\n". - ''; - break; - - // 주소 입력 - case "kr_zip" : - // krzip address javascript plugin load - Context::loadJavascriptPlugin('ui.krzip'); - - $buff .= - ''. - - ''. - - ''. - - ''. - ''; - break; - - // 일반 text - default : - $buff .=' '; - break; - } - if($this->desc) $buff .= '

'.$this->desc.'

'; - return $buff; - } - } -?> +module_srl = $module_srl; + } + + /** + * @brief 확장변수 키를 등록 + * @param module_srl, idx, name, type, default, desc, is_required, search, value + **/ + function setExtraVarKeys($extra_keys) { + if(!is_array($extra_keys) || !count($extra_keys)) return; + foreach($extra_keys as $key => $val) { + $obj = null; + $obj = new ExtraItem($val->module_srl, $val->idx, $val->name, $val->type, $val->default, $val->desc, $val->is_required, $val->search, $val->value, $val->eid); + $this->keys[$val->idx] = $obj; + } + } + + /** + * @brief 확장변수 객체 배열 return + **/ + function getExtraVars() { + return $this->keys; + } + } + + /** + * @class ExtraItem + * @author NHN (developers@xpressengine.com) + * @brief 확장변수의 개별 값 + **/ + class ExtraItem { + var $module_srl = 0; + var $idx = 0; + var $name = 0; + var $type = 'text'; + var $default = null; + var $desc = ''; + var $is_required = 'N'; + var $search = 'N'; + var $value = null; + var $eid = ''; + + /** + * @brief constructor + **/ + function ExtraItem($module_srl, $idx, $name, $type = 'text', $default = null, $desc = '', $is_required = 'N', $search = 'N', $value = null, $eid = '') { + if(!$idx) return; + $this->module_srl = $module_srl; + $this->idx = $idx; + $this->name = $name; + $this->type = $type; + $this->default = $default; + $this->desc = $desc; + $this->is_required = $is_required; + $this->search = $search; + $this->value = $value; + $this->eid = $eid; + } + + /** + * @brief 값 지정 + **/ + function setValue($value) { + $this->value = $value; + } + + /** + * @brief type에 따라서 주어진 값을 변형하여 원형 값을 return + **/ + function _getTypeValue($type, $value) { + $value = trim($value); + if(!isset($value)) return; + switch($type) { + case 'homepage' : + if($value && !preg_match('/^([a-z]+):\/\//i',$value)) $value = 'http://'.$value; + return htmlspecialchars($value); + break; + case 'tel' : + if(is_array($value)) $values = $value; + elseif(strpos($value,'|@|')!==false) $values = explode('|@|', $value); + elseif(strpos($value,',')!==false) $values = explode(',', $value); + $values[0] = $values[0]; + $values[1] = $values[1]; + $values[2] = $values[2]; + return $values; + break; + break; + case 'checkbox' : + case 'radio' : + case 'select' : + if(is_array($value)) $values = $value; + elseif(strpos($value,'|@|')!==false) $values = explode('|@|', $value); + elseif(strpos($value,',')!==false) $values = explode(',', $value); + else $values = array($value); + for($i=0;$i_getTypeValue($this->type, $this->value); + switch($this->type) { + case 'homepage' : + return ($value)?(sprintf('%s', $value, strlen($value)>60?substr($value,0,40).'...'.substr($value,-10):$value)):""; + case 'email_address' : + return ($value)?sprintf('%s', $value, $value):""; + break; + case 'tel' : + return sprintf('%s - %s - %s', $value[0],$value[1],$value[2]); + break; + case 'textarea' : + return nl2br($value); + break; + case 'checkbox' : + if(is_array($value)) return implode(', ',$value); + else return $value; + break; + case 'date' : + return zdate($value,"Y-m-d"); + break; + case 'select' : + case 'radio' : + if(is_array($value)) return implode(', ',$value); + else return $value; + break; + case 'kr_zip' : + if(is_array($value)) return implode(' ',$value); + else return $value; + break; + // case 'text' : + default : + return $value; + } + } + + /** + * @brief type에 따른 form을 리턴 + **/ + function getFormHTML() { + static $id_num = 1000; + + $type = $this->type; + $name = $this->name; + $value = $this->_getTypeValue($this->type, $this->value); + $default = $this->_getTypeValue($this->type, $this->default); + $column_name = 'extra_vars'.$this->idx; + $tmp_id = $column_name.'-'.$id_num++; + + $buff = ''; + switch($type) { + // 홈페이지 주소 + case 'homepage' : + $buff .= ''; + break; + + // Email 주소 + case 'email_address' : + $buff .= ''; + break; + + // 전화번호 + case 'tel' : + $buff .= + ''. + ''. + ''; + break; + + // textarea + case 'textarea' : + $buff .= ''; + break; + + // 다중 선택 + case 'checkbox' : + $buff .= '
    '; + foreach($default as $v) { + if($value && in_array($v, $value)) $checked = ' checked="checked"'; + else $checked = ''; + + // Temporary ID for labeling + $tmp_id = $column_name.'-'.$id_num++; + + $buff .='
  • '; + } + $buff .= '
'; + break; + + // 단일 선택 + case 'select' : + $buff .= ''; + break; + + // radio + case 'radio' : + $buff .= '
    '; + foreach($default as $v) { + if($value && in_array($v,$value)) $checked = ' checked="checked"'; + else $checked = ''; + + // Temporary ID for labeling + $tmp_id = $column_name.'-'.$id_num++; + + $buff .= '
  • '; + } + $buff .= '
'; + break; + + // 날짜 입력 + case 'date' : + // datepicker javascript plugin load + Context::loadJavascriptPlugin('ui.datepicker'); + + $buff .= + ''. + ''."\n". + ''; + break; + + // 주소 입력 + case "kr_zip" : + // krzip address javascript plugin load + Context::loadJavascriptPlugin('ui.krzip'); + + $buff .= + ''. + + ''. + + ''. + + ''. + ''; + break; + + // 일반 text + default : + $buff .=' '; + break; + } + if($this->desc) $buff .= '

'.$this->desc.'

'; + return $buff; + } + } +?> diff --git a/classes/file/FileObject.class.php b/classes/file/FileObject.class.php index cbe1ae2b0..6c1ef931a 100644 --- a/classes/file/FileObject.class.php +++ b/classes/file/FileObject.class.php @@ -1,128 +1,128 @@ -Open($path, $mode); - } - - /** - * @brief append target file's content to current file - * @param[in] $file_name path of target file - * @return none - **/ - function append($file_name) - { - $target = new FileObject($file_name, "r"); - while(!$target->feof()) - { - $readstr = $target->read(); - $this->write($readstr); - } - $target->close(); - } - - /** - * @brief check current file meets eof - * @return true: if eof. false: otherwise - **/ - function feof() - { - return feof($this->fp); - } - - /** - * @brief read from current file - * @param[in] $size size to read - * @return read bytes - **/ - function read($size = 1024) - { - return fread($this->fp, $size); - } - - - /** - * @brief write string to current file - * @param[in] $str string to write - * @return written bytes. if failed, it returns false - **/ - function write($str) - { - $len = strlen($str); - if(!$str || $len <= 0) return false; - if(!$this->fp) return false; - $written = fwrite($this->fp, $str); - return $written; - } - - /** - * @brief open a file - * @param[in] $path path of target file - * @param[in] $mode file open mode - * @remarks if file is opened, close it and open the new path - * @return true if succeed, false otherwise. - */ - function open($path, $mode) - { - if($this->fp != null) - { - $this->close(); - } - $this->fp = fopen($path, $mode); - if(! is_resource($this->fp) ) - { - $this->fp = null; - return false; - } - $this->path = $path; - return true; - } - - /** - * @brief return current file's path - * @return file path - **/ - function getPath() - { - if($this->fp != null) - { - return $this->path; - } - else - { - return null; - } - } - - /** - * @brief close file - * @return none - **/ - function close() - { - if($this->fp != null) - { - fclose($this->fp); - $this->fp = null; - } - } - - } -?> +Open($path, $mode); + } + + /** + * @brief append target file's content to current file + * @param[in] $file_name path of target file + * @return none + **/ + function append($file_name) + { + $target = new FileObject($file_name, "r"); + while(!$target->feof()) + { + $readstr = $target->read(); + $this->write($readstr); + } + $target->close(); + } + + /** + * @brief check current file meets eof + * @return true: if eof. false: otherwise + **/ + function feof() + { + return feof($this->fp); + } + + /** + * @brief read from current file + * @param[in] $size size to read + * @return read bytes + **/ + function read($size = 1024) + { + return fread($this->fp, $size); + } + + + /** + * @brief write string to current file + * @param[in] $str string to write + * @return written bytes. if failed, it returns false + **/ + function write($str) + { + $len = strlen($str); + if(!$str || $len <= 0) return false; + if(!$this->fp) return false; + $written = fwrite($this->fp, $str); + return $written; + } + + /** + * @brief open a file + * @param[in] $path path of target file + * @param[in] $mode file open mode + * @remarks if file is opened, close it and open the new path + * @return true if succeed, false otherwise. + */ + function open($path, $mode) + { + if($this->fp != null) + { + $this->close(); + } + $this->fp = fopen($path, $mode); + if(! is_resource($this->fp) ) + { + $this->fp = null; + return false; + } + $this->path = $path; + return true; + } + + /** + * @brief return current file's path + * @return file path + **/ + function getPath() + { + if($this->fp != null) + { + return $this->path; + } + else + { + return null; + } + } + + /** + * @brief close file + * @return none + **/ + function close() + { + if($this->fp != null) + { + fclose($this->fp); + $this->fp = null; + } + } + + } +?> diff --git a/classes/handler/Handler.class.php b/classes/handler/Handler.class.php index 375dfe281..1454f733e 100644 --- a/classes/handler/Handler.class.php +++ b/classes/handler/Handler.class.php @@ -1,11 +1,11 @@ - + diff --git a/classes/httprequest/XEHttpRequest.class.php b/classes/httprequest/XEHttpRequest.class.php index cf09444ff..c9c73f8de 100644 --- a/classes/httprequest/XEHttpRequest.class.php +++ b/classes/httprequest/XEHttpRequest.class.php @@ -1,85 +1,85 @@ -m_host = $host; - $this->m_port = $port; - $this->m_headers = array(); - } - - /** - * @brief mether to add key/value pair to the HTTP request header - * @param[in] key HTTP header element - * @param[in] value value string for HTTP header element - */ - function AddToHeader($key, $value) - { - $this->m_headers[$key] = $value; - } - - /** - * @brief send HTTP message to the host - * @param[in] target ip or url of the external server - * @param[in] method HTTP method such as GET and POST - * @param[in] timeout time out value for HTTP request expiration - * @return Returns an object containing HTTP Response body and HTTP response code - */ - function Send($target, $method="GET", $timeout = 3) - { - $socket = @fsockopen($this->m_host, $this->m_port, $errno, $errstr, $timeout); - if(!$socket) - { - return new Object(-1, "socket_connect_failed"); - } - - $this->AddToHeader('Host', $this->m_host); - $this->AddToHeader('Connection', "close"); - - $crlf = "\r\n"; - $request = "$method $target HTTP/1.1$crlf"; - - foreach($this->m_headers as $equiv => $content) - { - $request .= "$equiv: $content$crlf"; - } - $request .= $crlf; - fwrite($socket, $request); - - list($httpver, $code, $status) = split(' +', rtrim(fgets($socket))); - // read response header - while(strlen(trim($line = fgets($socket)))) - { - list($equiv, $content) = split(' *: *', rtrim($line)); - } - $body = ''; - while(!feof($socket)) - { - $body .= fgets($socket, 128); - } - fclose($socket); - - $ret->result_code = $code; - $ret->body = $body; - - return $ret; - } - } -?> +m_host = $host; + $this->m_port = $port; + $this->m_headers = array(); + } + + /** + * @brief mether to add key/value pair to the HTTP request header + * @param[in] key HTTP header element + * @param[in] value value string for HTTP header element + */ + function AddToHeader($key, $value) + { + $this->m_headers[$key] = $value; + } + + /** + * @brief send HTTP message to the host + * @param[in] target ip or url of the external server + * @param[in] method HTTP method such as GET and POST + * @param[in] timeout time out value for HTTP request expiration + * @return Returns an object containing HTTP Response body and HTTP response code + */ + function Send($target, $method="GET", $timeout = 3) + { + $socket = @fsockopen($this->m_host, $this->m_port, $errno, $errstr, $timeout); + if(!$socket) + { + return new Object(-1, "socket_connect_failed"); + } + + $this->AddToHeader('Host', $this->m_host); + $this->AddToHeader('Connection', "close"); + + $crlf = "\r\n"; + $request = "$method $target HTTP/1.1$crlf"; + + foreach($this->m_headers as $equiv => $content) + { + $request .= "$equiv: $content$crlf"; + } + $request .= $crlf; + fwrite($socket, $request); + + list($httpver, $code, $status) = split(' +', rtrim(fgets($socket))); + // read response header + while(strlen(trim($line = fgets($socket)))) + { + list($equiv, $content) = split(' *: *', rtrim($line)); + } + $body = ''; + while(!feof($socket)) + { + $body .= fgets($socket, 128); + } + fclose($socket); + + $ret->result_code = $code; + $ret->body = $body; + + return $ret; + } + } +?> diff --git a/classes/mail/Mail.class.php b/classes/mail/Mail.class.php index ad5b3d19a..3af574210 100644 --- a/classes/mail/Mail.class.php +++ b/classes/mail/Mail.class.php @@ -1,353 +1,353 @@ -additional_params = $additional_params; - } - - function addAttachment($filename, $orgfilename) - { - $this->attachments[$orgfilename] = $filename; - } - - function addCidAttachment($filename, $cid) - { - $this->cidAttachments[$cid] = $filename; - } - - function setSender($name, $email) { - $this->sender_name = $name; - $this->sender_email = $email; - } - - function getSender() { - if(!stristr(PHP_OS, 'win') && $this->sender_name) return sprintf("%s <%s>", '=?utf-8?b?'.base64_encode($this->sender_name).'?=', $this->sender_email); - return $this->sender_email; - } - - function setReceiptor($name, $email) { - $this->receiptor_name = $name; - $this->receiptor_email = $email; - } - - function getReceiptor() { - if(!stristr(PHP_OS, 'win') && $this->receiptor_name && $this->receiptor_name != $this->receiptor_email) return sprintf("%s <%s>", '=?utf-8?b?'.base64_encode($this->receiptor_name).'?=', $this->receiptor_email); - return $this->receiptor_email; - } - - function setTitle($title) { - $this->title = $title; - } - - function getTitle() { - return '=?utf-8?b?'.base64_encode($this->title).'?='; - } - - function setBCC($bcc) - { - $this->bcc = $bcc; - } - - function setMessageID($messageId) { - $this->messageId = $messageId; - } - - function setReferences($references) { - $this->references = $references; - } - - function setReplyTo($replyTo) - { - $this->replyTo = $replyTo; - } - - function setContent($content) { - $content = preg_replace_callback('/]+)>/i',array($this,'replaceResourceRealPath'), $content); - $this->content = $content; - } - - function replaceResourceRealPath($matches) { - return preg_replace('/src=(["\']?)files/i','src=$1'.Context::getRequestUri().'files', $matches[0]); - } - - function getPlainContent() { - return chunk_split(base64_encode(str_replace(array("<",">","&"), array("<",">","&"), $this->content))); - } - - function getHTMLContent() { - return chunk_split(base64_encode($this->content_type!='html'?nl2br($this->content):$this->content)); - } - - function setContentType($mode = 'html') { - $this->content_type = $mode=='html'?'html':''; - } - - function procAttachments() - { - if(count($this->attachments) > 0) - { - $this->body = $this->header.$this->body; - $boundary = '----=='.uniqid(rand(),true); - $this->header = "Content-Type: multipart/mixed;".$this->eol."\tboundary=\"".$boundary."\"".$this->eol.$this->eol; - $this->body = "--".$boundary.$this->eol.$this->body.$this->eol.$this->eol; - $res = array(); - $res[] = $this->body; - foreach($this->attachments as $filename => $attachment) - { - $type = $this->returnMIMEType($filename); - $file_str = FileHandler::readFile($attachment); - $chunks = chunk_split(base64_encode($file_str)); - $tempBody = sprintf( - "--".$boundary.$this->eol. - "Content-Type: %s;".$this->eol. - "\tname=\"%s\"".$this->eol. - "Content-Transfer-Encoding: base64".$this->eol. - "Content-Description: %s".$this->eol. - "Content-Disposition: attachment;".$this->eol. - "\tfilename=\"%s\"".$this->eol.$this->eol. - "%s".$this->eol.$this->eol, - $type, - $filename, - $filename, - $filename, - $chunks); - $res[] = $tempBody; - } - $this->body = implode("", $res); - $this->body .= "--".$boundary."--"; - } - } - - function procCidAttachments() - { - if(count($this->cidAttachments) > 0) - { - $this->body = $this->header.$this->body; - $boundary = '----=='.uniqid(rand(),true); - $this->header = "Content-Type: multipart/relative;".$this->eol."\ttype=\"multipart/alternative\";".$this->eol."\tboundary=\"".$boundary."\"".$this->eol.$this->eol; - $this->body = "--".$boundary.$this->eol.$this->body.$this->eol.$this->eol; - $res = array(); - $res[] = $this->body; - foreach($this->cidAttachments as $cid => $attachment) - { - $filename = basename($attachment); - $type = $this->returnMIMEType(FileHandler::getRealPath($attachment)); - $file_str = FileHandler::readFile($attachment); - $chunks = chunk_split(base64_encode($file_str)); - $tempBody = sprintf( - "--".$boundary.$this->eol. - "Content-Type: %s;".$this->eol. - "\tname=\"%s\"".$this->eol. - "Content-Transfer-Encoding: base64".$this->eol. - "Content-ID: <%s>".$this->eol. - "Content-Description: %s".$this->eol. - "Content-Location: %s".$this->eol.$this->eol. - "%s".$this->eol.$this->eol, - $type, - $filename, - $cid, - $filename, - $filename, - $chunks); - $res[] = $tempBody; - } - $this->body = implode("", $res); - $this->body .= "--".$boundary."--"; - } - } - - - function send() { - $boundary = '----=='.uniqid(rand(),true); - $this->eol = $GLOBALS['_qmail_compatibility'] == "Y" ? "\n" : "\r\n"; - - $this->header = "Content-Type: multipart/alternative;".$this->eol."\tboundary=\"".$boundary."\"".$this->eol.$this->eol; - $this->body = sprintf( - "--%s".$this->eol. - "Content-Type: text/plain; charset=utf-8; format=flowed".$this->eol. - "Content-Transfer-Encoding: base64".$this->eol. - "Content-Disposition: inline".$this->eol.$this->eol. - "%s". - "--%s".$this->eol. - "Content-Type: text/html; charset=utf-8".$this->eol. - "Content-Transfer-Encoding: base64".$this->eol. - "Content-Disposition: inline".$this->eol.$this->eol. - "%s". - "--%s--". - "", - $boundary, - $this->getPlainContent(), - $boundary, - $this->getHTMLContent(), - $boundary - ); - - $this->procCidAttachments(); - $this->procAttachments(); - - $headers = sprintf( - "From: %s".$this->eol. - "%s". - "%s". - "%s". - "%s". - "MIME-Version: 1.0".$this->eol."", - $this->getSender(), - $this->messageId?("Message-ID: <".$this->messageId.">".$this->eol):"", - $this->replyTo?("Reply-To: <".$this->replyTo.">".$this->eol):"", - $this->bcc?("Bcc: ".$this->bcc.$this->eol):"", - $this->references?("References: <".$this->references.">".$this->eol."In-Reply-To: <".$this->references.">".$this->eol):"" - ); - $headers .= $this->header; - if($this->additional_params) return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers, $this->additional_params); - return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers); - } - - function checkMailMX($email_address) { - if(!Mail::isVaildMailAddress($email_address)) return false; - list($user, $host) = explode("@", $email_address); - if(function_exists('checkdnsrr')) { - if (checkdnsrr($host, "MX") or checkdnsrr($host, "A")) return true; - else return false; - } - return true; - } - - function isVaildMailAddress($email_address) { - if( preg_match("/([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)/i", $email_address) ) return $email_address; - else return ''; - } - - function returnMIMEType($filename) - { - preg_match("|\.([a-z0-9]{2,4})$|i", $filename, $fileSuffix); - - switch(strtolower($fileSuffix[1])) - { - case "js" : - return "application/x-javascript"; - - case "json" : - return "application/json"; - - case "jpg" : - case "jpeg" : - case "jpe" : - return "image/jpg"; - - case "png" : - case "gif" : - case "bmp" : - case "tiff" : - return "image/".strtolower($fileSuffix[1]); - - case "css" : - return "text/css"; - - case "xml" : - return "application/xml"; - - case "doc" : - case "docx" : - return "application/msword"; - - case "xls" : - case "xlt" : - case "xlm" : - case "xld" : - case "xla" : - case "xlc" : - case "xlw" : - case "xll" : - return "application/vnd.ms-excel"; - - case "ppt" : - case "pps" : - return "application/vnd.ms-powerpoint"; - - case "rtf" : - return "application/rtf"; - - case "pdf" : - return "application/pdf"; - - case "html" : - case "htm" : - case "php" : - return "text/html"; - - case "txt" : - return "text/plain"; - - case "mpeg" : - case "mpg" : - case "mpe" : - return "video/mpeg"; - - case "mp3" : - return "audio/mpeg3"; - - case "wav" : - return "audio/wav"; - - case "aiff" : - case "aif" : - return "audio/aiff"; - - case "avi" : - return "video/msvideo"; - - case "wmv" : - return "video/x-ms-wmv"; - - case "mov" : - return "video/quicktime"; - - case "zip" : - return "application/zip"; - - case "tar" : - return "application/x-tar"; - - case "swf" : - return "application/x-shockwave-flash"; - - default : - if(function_exists("mime_content_type")) - { - $fileSuffix = mime_content_type($filename); - } - - return "unknown/" . trim($fileSuffix[0], "."); - } - } - } -?> +additional_params = $additional_params; + } + + function addAttachment($filename, $orgfilename) + { + $this->attachments[$orgfilename] = $filename; + } + + function addCidAttachment($filename, $cid) + { + $this->cidAttachments[$cid] = $filename; + } + + function setSender($name, $email) { + $this->sender_name = $name; + $this->sender_email = $email; + } + + function getSender() { + if(!stristr(PHP_OS, 'win') && $this->sender_name) return sprintf("%s <%s>", '=?utf-8?b?'.base64_encode($this->sender_name).'?=', $this->sender_email); + return $this->sender_email; + } + + function setReceiptor($name, $email) { + $this->receiptor_name = $name; + $this->receiptor_email = $email; + } + + function getReceiptor() { + if(!stristr(PHP_OS, 'win') && $this->receiptor_name && $this->receiptor_name != $this->receiptor_email) return sprintf("%s <%s>", '=?utf-8?b?'.base64_encode($this->receiptor_name).'?=', $this->receiptor_email); + return $this->receiptor_email; + } + + function setTitle($title) { + $this->title = $title; + } + + function getTitle() { + return '=?utf-8?b?'.base64_encode($this->title).'?='; + } + + function setBCC($bcc) + { + $this->bcc = $bcc; + } + + function setMessageID($messageId) { + $this->messageId = $messageId; + } + + function setReferences($references) { + $this->references = $references; + } + + function setReplyTo($replyTo) + { + $this->replyTo = $replyTo; + } + + function setContent($content) { + $content = preg_replace_callback('/]+)>/i',array($this,'replaceResourceRealPath'), $content); + $this->content = $content; + } + + function replaceResourceRealPath($matches) { + return preg_replace('/src=(["\']?)files/i','src=$1'.Context::getRequestUri().'files', $matches[0]); + } + + function getPlainContent() { + return chunk_split(base64_encode(str_replace(array("<",">","&"), array("<",">","&"), $this->content))); + } + + function getHTMLContent() { + return chunk_split(base64_encode($this->content_type!='html'?nl2br($this->content):$this->content)); + } + + function setContentType($mode = 'html') { + $this->content_type = $mode=='html'?'html':''; + } + + function procAttachments() + { + if(count($this->attachments) > 0) + { + $this->body = $this->header.$this->body; + $boundary = '----=='.uniqid(rand(),true); + $this->header = "Content-Type: multipart/mixed;".$this->eol."\tboundary=\"".$boundary."\"".$this->eol.$this->eol; + $this->body = "--".$boundary.$this->eol.$this->body.$this->eol.$this->eol; + $res = array(); + $res[] = $this->body; + foreach($this->attachments as $filename => $attachment) + { + $type = $this->returnMIMEType($filename); + $file_str = FileHandler::readFile($attachment); + $chunks = chunk_split(base64_encode($file_str)); + $tempBody = sprintf( + "--".$boundary.$this->eol. + "Content-Type: %s;".$this->eol. + "\tname=\"%s\"".$this->eol. + "Content-Transfer-Encoding: base64".$this->eol. + "Content-Description: %s".$this->eol. + "Content-Disposition: attachment;".$this->eol. + "\tfilename=\"%s\"".$this->eol.$this->eol. + "%s".$this->eol.$this->eol, + $type, + $filename, + $filename, + $filename, + $chunks); + $res[] = $tempBody; + } + $this->body = implode("", $res); + $this->body .= "--".$boundary."--"; + } + } + + function procCidAttachments() + { + if(count($this->cidAttachments) > 0) + { + $this->body = $this->header.$this->body; + $boundary = '----=='.uniqid(rand(),true); + $this->header = "Content-Type: multipart/relative;".$this->eol."\ttype=\"multipart/alternative\";".$this->eol."\tboundary=\"".$boundary."\"".$this->eol.$this->eol; + $this->body = "--".$boundary.$this->eol.$this->body.$this->eol.$this->eol; + $res = array(); + $res[] = $this->body; + foreach($this->cidAttachments as $cid => $attachment) + { + $filename = basename($attachment); + $type = $this->returnMIMEType(FileHandler::getRealPath($attachment)); + $file_str = FileHandler::readFile($attachment); + $chunks = chunk_split(base64_encode($file_str)); + $tempBody = sprintf( + "--".$boundary.$this->eol. + "Content-Type: %s;".$this->eol. + "\tname=\"%s\"".$this->eol. + "Content-Transfer-Encoding: base64".$this->eol. + "Content-ID: <%s>".$this->eol. + "Content-Description: %s".$this->eol. + "Content-Location: %s".$this->eol.$this->eol. + "%s".$this->eol.$this->eol, + $type, + $filename, + $cid, + $filename, + $filename, + $chunks); + $res[] = $tempBody; + } + $this->body = implode("", $res); + $this->body .= "--".$boundary."--"; + } + } + + + function send() { + $boundary = '----=='.uniqid(rand(),true); + $this->eol = $GLOBALS['_qmail_compatibility'] == "Y" ? "\n" : "\r\n"; + + $this->header = "Content-Type: multipart/alternative;".$this->eol."\tboundary=\"".$boundary."\"".$this->eol.$this->eol; + $this->body = sprintf( + "--%s".$this->eol. + "Content-Type: text/plain; charset=utf-8; format=flowed".$this->eol. + "Content-Transfer-Encoding: base64".$this->eol. + "Content-Disposition: inline".$this->eol.$this->eol. + "%s". + "--%s".$this->eol. + "Content-Type: text/html; charset=utf-8".$this->eol. + "Content-Transfer-Encoding: base64".$this->eol. + "Content-Disposition: inline".$this->eol.$this->eol. + "%s". + "--%s--". + "", + $boundary, + $this->getPlainContent(), + $boundary, + $this->getHTMLContent(), + $boundary + ); + + $this->procCidAttachments(); + $this->procAttachments(); + + $headers = sprintf( + "From: %s".$this->eol. + "%s". + "%s". + "%s". + "%s". + "MIME-Version: 1.0".$this->eol."", + $this->getSender(), + $this->messageId?("Message-ID: <".$this->messageId.">".$this->eol):"", + $this->replyTo?("Reply-To: <".$this->replyTo.">".$this->eol):"", + $this->bcc?("Bcc: ".$this->bcc.$this->eol):"", + $this->references?("References: <".$this->references.">".$this->eol."In-Reply-To: <".$this->references.">".$this->eol):"" + ); + $headers .= $this->header; + if($this->additional_params) return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers, $this->additional_params); + return mail($this->getReceiptor(), $this->getTitle(), $this->body, $headers); + } + + function checkMailMX($email_address) { + if(!Mail::isVaildMailAddress($email_address)) return false; + list($user, $host) = explode("@", $email_address); + if(function_exists('checkdnsrr')) { + if (checkdnsrr($host, "MX") or checkdnsrr($host, "A")) return true; + else return false; + } + return true; + } + + function isVaildMailAddress($email_address) { + if( preg_match("/([a-z0-9\_\-\.]+)@([a-z0-9\_\-\.]+)/i", $email_address) ) return $email_address; + else return ''; + } + + function returnMIMEType($filename) + { + preg_match("|\.([a-z0-9]{2,4})$|i", $filename, $fileSuffix); + + switch(strtolower($fileSuffix[1])) + { + case "js" : + return "application/x-javascript"; + + case "json" : + return "application/json"; + + case "jpg" : + case "jpeg" : + case "jpe" : + return "image/jpg"; + + case "png" : + case "gif" : + case "bmp" : + case "tiff" : + return "image/".strtolower($fileSuffix[1]); + + case "css" : + return "text/css"; + + case "xml" : + return "application/xml"; + + case "doc" : + case "docx" : + return "application/msword"; + + case "xls" : + case "xlt" : + case "xlm" : + case "xld" : + case "xla" : + case "xlc" : + case "xlw" : + case "xll" : + return "application/vnd.ms-excel"; + + case "ppt" : + case "pps" : + return "application/vnd.ms-powerpoint"; + + case "rtf" : + return "application/rtf"; + + case "pdf" : + return "application/pdf"; + + case "html" : + case "htm" : + case "php" : + return "text/html"; + + case "txt" : + return "text/plain"; + + case "mpeg" : + case "mpg" : + case "mpe" : + return "video/mpeg"; + + case "mp3" : + return "audio/mpeg3"; + + case "wav" : + return "audio/wav"; + + case "aiff" : + case "aif" : + return "audio/aiff"; + + case "avi" : + return "video/msvideo"; + + case "wmv" : + return "video/x-ms-wmv"; + + case "mov" : + return "video/quicktime"; + + case "zip" : + return "application/zip"; + + case "tar" : + return "application/x-tar"; + + case "swf" : + return "application/x-shockwave-flash"; + + default : + if(function_exists("mime_content_type")) + { + $fileSuffix = mime_content_type($filename); + } + + return "unknown/" . trim($fileSuffix[0], "."); + } + } + } +?> diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index b973eeb6e..9ff062dff 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -1,532 +1,532 @@ -module = 'install'; - $this->act = Context::get('act'); - return; - } - - // Set variables from request arguments - $this->module = $module?$module:Context::get('module'); - $this->act = $act?$act:Context::get('act'); - $this->mid = $mid?$mid:Context::get('mid'); - $this->document_srl = $document_srl?(int)$document_srl:(int)Context::get('document_srl'); - $this->module_srl = $module_srl?(int)$module_srl:(int)Context::get('module_srl'); - $this->entry = Context::convertEncodingStr(Context::get('entry')); - - // Validate variables to prevent XSS - if($this->module && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->module)) die(Context::getLang("msg_invalid_request")); - if($this->mid && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->mid)) die(Context::getLang("msg_invalid_request")); - if($this->act && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->act)) die(Context::getLang("msg_invalid_request")); - - // execute addon (before module initialization) - $called_position = 'before_module_init'; - $oAddonController = &getController('addon'); - $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone()?'mobile':'pc'); - @include($addon_file); - } - - /** - * @brief Initialization. It finds the target module based on module, mid, document_srl, and prepares to execute an action - * @return true: OK, false: redirected - **/ - function init() { - $oModuleModel = &getModel('module'); - $site_module_info = Context::get('site_module_info'); - - if(!$this->document_srl && $this->mid && $this->entry) { - $oDocumentModel = &getModel('document'); - $this->document_srl = $oDocumentModel->getDocumentSrlByAlias($this->mid, $this->entry); - if($this->document_srl) Context::set('document_srl', $this->document_srl); - } - - // Get module's information based on document_srl, if it's specified - if($this->document_srl && !$this->module) { - $module_info = $oModuleModel->getModuleInfoByDocumentSrl($this->document_srl); - - // If the document does not exist, remove document_srl - if(!$module_info) { - unset($this->document_srl); - } else { - // If it exists, compare mid based on the module information - // if mids are not matching, set it as the document's mid - if($this->mid != $module_info->mid) { - $this->mid = $module_info->mid; - Context::set('mid', $module_info->mid, true); - } - } - // if requested module is different from one of the document, remove the module information retrieved based on the document number - if($this->module && $module_info->module != $this->module) unset($module_info); - } - - // If module_info is not set yet, and there exists mid information, get module information based on the mid - if(!$module_info && $this->mid) { - $module_info = $oModuleModel->getModuleInfoByMid($this->mid, $site_module_info->site_srl); - //if($this->module && $module_info->module != $this->module) unset($module_info); - } - - // redirect, if module_site_srl and site_srl are different - if(!$this->module && !$module_info && $site_module_info->site_srl == 0 && $site_module_info->module_site_srl > 0) { - $site_info = $oModuleModel->getSiteInfo($site_module_info->module_site_srl); - header("location:".getNotEncodedSiteUrl($site_info->domain,'mid',$site_module_info->mid)); - return false; - } - - // If module_info is not set still, and $module does not exist, find the default module - if(!$module_info && !$this->module) $module_info = $site_module_info; - - if(!$module_info && !$this->module && $site_module_info->module_site_srl) $module_info = $site_module_info; - - // redirect, if site_srl of module_info is different from one of site's module_info - if($module_info && $module_info->site_srl != $site_module_info->site_srl && !isCrawler()) { - // If the module is of virtual site - if($module_info->site_srl) { - $site_info = $oModuleModel->getSiteInfo($module_info->site_srl); - $redirect_url = getNotEncodedSiteUrl($site_info->domain, 'mid',Context::get('mid'),'document_srl',Context::get('document_srl'),'module_srl',Context::get('module_srl'),'entry',Context::get('entry')); - // If it's called from a virtual site, though it's not a module of the virtual site - } else { - $db_info = Context::getDBInfo(); - if(!$db_info->default_url) return Context::getLang('msg_default_url_is_not_defined'); - else $redirect_url = getNotEncodedSiteUrl($db_info->default_url, 'mid',Context::get('mid'),'document_srl',Context::get('document_srl'),'module_srl',Context::get('module_srl'),'entry',Context::get('entry')); - } - header("location:".$redirect_url); - return false; - } - - // If module info was set, retrieve variables from the module information - if($module_info) { - $this->module = $module_info->module; - $this->mid = $module_info->mid; - $this->module_info = $module_info; - Context::setBrowserTitle($module_info->browser_title); - $part_config= $oModuleModel->getModulePartConfig('layout',$module_info->layout_srl); - Context::addHtmlHeader($part_config->header_script); - } - - // Set module and mid into module_info - $this->module_info->module = $this->module; - $this->module_info->mid = $this->mid; - - // Still no module? it's an error - if(!$this->module) $this->error = 'msg_module_does_not_exist'; - - // If mid exists, set mid into context - if($this->mid) Context::set('mid', $this->mid, true); - - // Call a trigger after moduleHandler init - $output = ModuleHandler::triggerCall('moduleHandler.init', 'after', $this->module_info); - if(!$output->toBool()) { - $this->error = $output->getMessage(); - return false; - } - - // Set current module info into context - Context::set('current_module_info', $this->module_info); - - return true; - } - - /** - * @brief get a module instance and execute an action - * @return executed module instance - **/ - function procModule() { - // If error occurred while preparation, return a message instance - if($this->error) { - $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; - $oMessageObject = &ModuleHandler::getModuleInstance('message',$type); - $oMessageObject->setError(-1); - $oMessageObject->setMessage($this->error); - $oMessageObject->dispMessage(); - return $oMessageObject; - } - - $oModuleModel = &getModel('module'); - - // Get action information with conf/action.xml - $xml_info = $oModuleModel->getModuleActionXml($this->module); - - // If not installed yet, modify act - if($this->module=="install") { - if(!$this->act || !$xml_info->action->{$this->act}) $this->act = $xml_info->default_index_act; - } - - // if act exists, find type of the action, if not use default index act - if(!$this->act) $this->act = $xml_info->default_index_act; - - // still no act means error - if(!$this->act) { - $this->error = 'msg_module_does_not_exist'; - return; - } - - // get type, kind - $type = $xml_info->action->{$this->act}->type; - $kind = strpos(strtolower($this->act),'admin')!==false?'admin':''; - if(!$kind && $this->module == 'admin') $kind = 'admin'; - if($this->module_info->use_mobile != "Y") Mobile::setMobile(false); - - // if(type == view, and case for using mobilephone) - if($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) - { - $orig_type = "view"; - $type = "mobile"; - // create a module instance - $oModule = &$this->getModuleInstance($this->module, $type, $kind); - if(!is_object($oModule) || !method_exists($oModule, $this->act)) { - $type = $orig_type; - Mobile::setMobile(false); - $oModule = &$this->getModuleInstance($this->module, $type, $kind); - } - } - else - { - // create a module instance - $oModule = &$this->getModuleInstance($this->module, $type, $kind); - } - - if(!is_object($oModule)) { - $this->error = 'msg_module_does_not_exist'; - return; - } - - // If there is no such action in the module object - if(!isset($xml_info->action->{$this->act}) || !method_exists($oModule, $this->act)) - { - if(!Context::isInstalled()) - { - $this->error = 'msg_invalid_request'; - return; - } - - $forward = null; - // 1. Look for the module with action name - if(preg_match('/^([a-z]+)([A-Z])([a-z0-9\_]+)(.*)$/', $this->act, $matches)) { - $module = strtolower($matches[2].$matches[3]); - $xml_info = $oModuleModel->getModuleActionXml($module); - if($xml_info->action->{$this->act}) { - $forward->module = $module; - $forward->type = $xml_info->action->{$this->act}->type; - $forward->act = $this->act; - } - } - - if(!$forward) - { - $forward = $oModuleModel->getActionForward($this->act); - } - - if($forward->module && $forward->type && $forward->act && $forward->act == $this->act) { - $kind = strpos(strtolower($forward->act),'admin')!==false?'admin':''; - $type = $forward->type; - $tpl_path = $oModule->getTemplatePath(); - $orig_module = $oModule; - - if($type == "view" && Mobile::isFromMobilePhone()) - { - $orig_type = "view"; - $type = "mobile"; - // create a module instance - $oModule = &$this->getModuleInstance($forward->module, $type, $kind); - if(!is_object($oModule) || !method_exists($oModule, $this->act)) { - $type = $orig_type; - Mobile::setMobile(false); - $oModule = &$this->getModuleInstance($forward->module, $type, $kind); - } - } - else - { - $oModule = &$this->getModuleInstance($forward->module, $type, $kind); - } - $xml_info = $oModuleModel->getModuleActionXml($forward->module); - if($this->module == "admin" && $type == "view") - { - $oMemberModel = &getModel('member'); - - $logged_info = $oMemberModel->getLoggedInfo(); - if($logged_info->is_admin=='Y') { - $orig_module->loadSideBar(); - $oModule->setLayoutPath("./modules/admin/tpl"); - $oModule->setLayoutFile("layout.html"); - } - } - } - else if($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) - { - $this->act = $xml_info->default_index_act; - } - else - { - $this->error = 'msg_invalid_request'; - return; - } - } - - $oModule->setAct($this->act); - - $this->module_info->module_type = $type; - $oModule->setModuleInfo($this->module_info, $xml_info); - - // execute the action, and if failed, set error - if(!$oModule->proc()) $this->error = $oModule->getMessage(); - - return $oModule; - } - - /** - * @brief display contents from executed module - * @param[in] $oModule module instance - * @return none - **/ - function displayContent($oModule = NULL) { - // If the module is not set or not an object, set error - if(!$oModule || !is_object($oModule)) { - $this->error = 'msg_module_does_not_exists'; - } - - // If connection to DB has a problem even though it's not install module, set error - if($this->module != 'install' && $GLOBALS['__DB__'][Context::getDBType()]->is_connected == false) { - $this->error = 'msg_dbconnect_failed'; - } - - // Call trigger after moduleHandler proc - $output = ModuleHandler::triggerCall('moduleHandler.proc', 'after', $oModule); - if(!$output->toBool()) $this->error = $output->getMessage(); - - // Use message view object, if HTML call - if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { - // If error occurred, handle it - if($this->error) { - // display content with message module instance - $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; - $oMessageObject = &ModuleHandler::getModuleInstance('message',$type); - $oMessageObject->setError(-1); - $oMessageObject->setMessage($this->error); - $oMessageObject->dispMessage(); - - // If module was called normally, change the templates of the module into ones of the message view module - if($oModule) { - $oModule->setTemplatePath($oMessageObject->getTemplatePath()); - $oModule->setTemplateFile($oMessageObject->getTemplateFile()); - - // Otherwise, set message instance as the target module - } else { - $oModule = $oMessageObject; - } - } - - // Check if layout_srl exists for the module - if(Mobile::isFromMobilePhone()) - { - $layout_srl = $oModule->module_info->mlayout_srl; - } - else - { - $layout_srl = $oModule->module_info->layout_srl; - } - - if($layout_srl && !$oModule->getLayoutFile()) { - - // If layout_srl exists, get information of the layout, and set the location of layout_path/ layout_file - $oLayoutModel = &getModel('layout'); - $layout_info = $oLayoutModel->getLayout($layout_srl); - if($layout_info) { - - // Input extra_vars into $layout_info - if($layout_info->extra_var_count) { - - foreach($layout_info->extra_var as $var_id => $val) { - if($val->type == 'image') { - if(preg_match('/^\.\/files\/attach\/images\/(.+)/i',$val->value)) $val->value = Context::getRequestUri().substr($val->value,2); - } - $layout_info->{$var_id} = $val->value; - } - } - // Set menus into context - if($layout_info->menu_count) { - foreach($layout_info->menu as $menu_id => $menu) { - if(file_exists($menu->php_file)) @include($menu->php_file); - Context::set($menu_id, $menu); - } - } - - // Set layout information into context - Context::set('layout_info', $layout_info); - - $oModule->setLayoutPath($layout_info->path); - $oModule->setLayoutFile('layout'); - - // If layout was modified, use the modified version - $edited_layout = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl); - if(file_exists($edited_layout)) $oModule->setEditedLayoutFile($edited_layout); - } - } - } - - // Display contents - $oDisplayHandler = new DisplayHandler(); - $oDisplayHandler->printContent($oModule); - } - - /** - * @brief returns module's path - * @param[in] $module module name - * @return path of the module - **/ - function getModulePath($module) { - return sprintf('./modules/%s/', $module); - } - - /** - * @brief It creates a module instance - * @param[in] $module module name - * @param[in] $type instance type, (e.g., view, controller, model) - * @param[in] $kind admin or svc - * @return module instance (if failed it returns null) - * @remarks if there exists a module instance created before, returns it. - **/ - function &getModuleInstance($module, $type = 'view', $kind = '') { - - if(__DEBUG__==3) $start_time = getMicroTime(); - - $kind = strtolower($kind); - $type = strtolower($type); - - $kinds = explode(' ', 'svc admin'); - if(!in_array($kind, $kinds)) $kind = $kinds[0]; - - $key = $module.'.'.($kind!='admin'?'':'admin').'.'.$type; - - if(is_array($GLOBALS['__MODULE_EXTEND__']) && array_key_exists($key, $GLOBALS['__MODULE_EXTEND__'])) { - $module = $extend_module = $GLOBALS['__MODULE_EXTEND__'][$key]; - }else{ - unset($parent_module); - } - - // if there is no instance of the module in global variable, create a new one - if(!$GLOBALS['_loaded_module'][$module][$type][$kind]) { - $parent_module = $module; - - $class_path = ModuleHandler::getModulePath($module); - if(!is_dir(FileHandler::getRealPath($class_path))) return NULL; - - // Get base class name and load the file contains it - if(!class_exists($module)) { - $high_class_file = sprintf('%s%s%s.class.php', _XE_PATH_,$class_path, $module); - if(!file_exists($high_class_file)) return NULL; - require_once($high_class_file); - } - - // Get the object's name - $types = explode(' ', 'view controller model api wap mobile class'); - if(!in_array($type, $types)) $type = $types[0]; - if($type == 'class') { - $instance_name = '%s'; - $class_file = '%s%s.%s.php'; - } elseif($kind == 'admin' && array_search($type, $types) < 3) { - $instance_name = '%sAdmin%s'; - $class_file = '%s%s.admin.%s.php'; - } else{ - $instance_name = '%s%s'; - $class_file = '%s%s.%s.php'; - } - $instance_name = sprintf($instance_name, $module, ucfirst($type)); - $class_file = sprintf($class_file, $class_path, $module, $type); - $class_file = FileHandler::getRealPath($class_file); - - // Get the name of the class file - if(!is_readable($class_file)) return NULL; - - // Create an instance with eval function - require_once($class_file); - if(!class_exists($instance_name)) return NULL; - $tmp_fn = create_function('', "return new {$instance_name}();"); - $oModule = $tmp_fn(); - if(!is_object($oModule)) return NULL; - - // Load language files for the class - Context::loadLang($class_path.'lang'); - if($extend_module) { - Context::loadLang(ModuleHandler::getModulePath($parent_module).'lang'); - } - - // Set variables to the instance - $oModule->setModule($module); - $oModule->setModulePath($class_path); - - // If the module has a constructor, run it. - if(!isset($GLOBALS['_called_constructor'][$instance_name])) { - $GLOBALS['_called_constructor'][$instance_name] = true; - if(@method_exists($oModule, $instance_name)) $oModule->{$instance_name}(); - } - - // Store the created instance into GLOBALS variable - $GLOBALS['_loaded_module'][$module][$type][$kind] = $oModule; - } - - if(__DEBUG__==3) $GLOBALS['__elapsed_class_load__'] += getMicroTime() - $start_time; - - // return the instance - return $GLOBALS['_loaded_module'][$module][$type][$kind]; - } - - /** - * @brief call a trigger - * @param[in] $trigger_name trigger's name to call - * @param[in] $called_position called position - * @param[in] $obj an object as a parameter to trigger - * @return Object - **/ - function triggerCall($trigger_name, $called_position, &$obj) { - // skip if not installed - if(!Context::isInstalled()) return new Object(); - - $oModuleModel = &getModel('module'); - $triggers = $oModuleModel->getTriggers($trigger_name, $called_position); - if(!$triggers || !count($triggers)) return new Object(); - - foreach($triggers as $item) { - $module = $item->module; - $type = $item->type; - $called_method = $item->called_method; - - $oModule = null; - $oModule = &getModule($module, $type); - if(!$oModule || !method_exists($oModule, $called_method)) continue; - - $output = $oModule->{$called_method}($obj); - if(is_object($output) && method_exists($output, 'toBool') && !$output->toBool()) return $output; - unset($oModule); - } - - return new Object(); - } - } -?> +module = 'install'; + $this->act = Context::get('act'); + return; + } + + // Set variables from request arguments + $this->module = $module?$module:Context::get('module'); + $this->act = $act?$act:Context::get('act'); + $this->mid = $mid?$mid:Context::get('mid'); + $this->document_srl = $document_srl?(int)$document_srl:(int)Context::get('document_srl'); + $this->module_srl = $module_srl?(int)$module_srl:(int)Context::get('module_srl'); + $this->entry = Context::convertEncodingStr(Context::get('entry')); + + // Validate variables to prevent XSS + if($this->module && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->module)) die(Context::getLang("msg_invalid_request")); + if($this->mid && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->mid)) die(Context::getLang("msg_invalid_request")); + if($this->act && !preg_match("/^([a-z0-9\_\-]+)$/i",$this->act)) die(Context::getLang("msg_invalid_request")); + + // execute addon (before module initialization) + $called_position = 'before_module_init'; + $oAddonController = &getController('addon'); + $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone()?'mobile':'pc'); + @include($addon_file); + } + + /** + * @brief Initialization. It finds the target module based on module, mid, document_srl, and prepares to execute an action + * @return true: OK, false: redirected + **/ + function init() { + $oModuleModel = &getModel('module'); + $site_module_info = Context::get('site_module_info'); + + if(!$this->document_srl && $this->mid && $this->entry) { + $oDocumentModel = &getModel('document'); + $this->document_srl = $oDocumentModel->getDocumentSrlByAlias($this->mid, $this->entry); + if($this->document_srl) Context::set('document_srl', $this->document_srl); + } + + // Get module's information based on document_srl, if it's specified + if($this->document_srl && !$this->module) { + $module_info = $oModuleModel->getModuleInfoByDocumentSrl($this->document_srl); + + // If the document does not exist, remove document_srl + if(!$module_info) { + unset($this->document_srl); + } else { + // If it exists, compare mid based on the module information + // if mids are not matching, set it as the document's mid + if($this->mid != $module_info->mid) { + $this->mid = $module_info->mid; + Context::set('mid', $module_info->mid, true); + } + } + // if requested module is different from one of the document, remove the module information retrieved based on the document number + if($this->module && $module_info->module != $this->module) unset($module_info); + } + + // If module_info is not set yet, and there exists mid information, get module information based on the mid + if(!$module_info && $this->mid) { + $module_info = $oModuleModel->getModuleInfoByMid($this->mid, $site_module_info->site_srl); + //if($this->module && $module_info->module != $this->module) unset($module_info); + } + + // redirect, if module_site_srl and site_srl are different + if(!$this->module && !$module_info && $site_module_info->site_srl == 0 && $site_module_info->module_site_srl > 0) { + $site_info = $oModuleModel->getSiteInfo($site_module_info->module_site_srl); + header("location:".getNotEncodedSiteUrl($site_info->domain,'mid',$site_module_info->mid)); + return false; + } + + // If module_info is not set still, and $module does not exist, find the default module + if(!$module_info && !$this->module) $module_info = $site_module_info; + + if(!$module_info && !$this->module && $site_module_info->module_site_srl) $module_info = $site_module_info; + + // redirect, if site_srl of module_info is different from one of site's module_info + if($module_info && $module_info->site_srl != $site_module_info->site_srl && !isCrawler()) { + // If the module is of virtual site + if($module_info->site_srl) { + $site_info = $oModuleModel->getSiteInfo($module_info->site_srl); + $redirect_url = getNotEncodedSiteUrl($site_info->domain, 'mid',Context::get('mid'),'document_srl',Context::get('document_srl'),'module_srl',Context::get('module_srl'),'entry',Context::get('entry')); + // If it's called from a virtual site, though it's not a module of the virtual site + } else { + $db_info = Context::getDBInfo(); + if(!$db_info->default_url) return Context::getLang('msg_default_url_is_not_defined'); + else $redirect_url = getNotEncodedSiteUrl($db_info->default_url, 'mid',Context::get('mid'),'document_srl',Context::get('document_srl'),'module_srl',Context::get('module_srl'),'entry',Context::get('entry')); + } + header("location:".$redirect_url); + return false; + } + + // If module info was set, retrieve variables from the module information + if($module_info) { + $this->module = $module_info->module; + $this->mid = $module_info->mid; + $this->module_info = $module_info; + Context::setBrowserTitle($module_info->browser_title); + $part_config= $oModuleModel->getModulePartConfig('layout',$module_info->layout_srl); + Context::addHtmlHeader($part_config->header_script); + } + + // Set module and mid into module_info + $this->module_info->module = $this->module; + $this->module_info->mid = $this->mid; + + // Still no module? it's an error + if(!$this->module) $this->error = 'msg_module_does_not_exist'; + + // If mid exists, set mid into context + if($this->mid) Context::set('mid', $this->mid, true); + + // Call a trigger after moduleHandler init + $output = ModuleHandler::triggerCall('moduleHandler.init', 'after', $this->module_info); + if(!$output->toBool()) { + $this->error = $output->getMessage(); + return false; + } + + // Set current module info into context + Context::set('current_module_info', $this->module_info); + + return true; + } + + /** + * @brief get a module instance and execute an action + * @return executed module instance + **/ + function procModule() { + // If error occurred while preparation, return a message instance + if($this->error) { + $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; + $oMessageObject = &ModuleHandler::getModuleInstance('message',$type); + $oMessageObject->setError(-1); + $oMessageObject->setMessage($this->error); + $oMessageObject->dispMessage(); + return $oMessageObject; + } + + $oModuleModel = &getModel('module'); + + // Get action information with conf/action.xml + $xml_info = $oModuleModel->getModuleActionXml($this->module); + + // If not installed yet, modify act + if($this->module=="install") { + if(!$this->act || !$xml_info->action->{$this->act}) $this->act = $xml_info->default_index_act; + } + + // if act exists, find type of the action, if not use default index act + if(!$this->act) $this->act = $xml_info->default_index_act; + + // still no act means error + if(!$this->act) { + $this->error = 'msg_module_does_not_exist'; + return; + } + + // get type, kind + $type = $xml_info->action->{$this->act}->type; + $kind = strpos(strtolower($this->act),'admin')!==false?'admin':''; + if(!$kind && $this->module == 'admin') $kind = 'admin'; + if($this->module_info->use_mobile != "Y") Mobile::setMobile(false); + + // if(type == view, and case for using mobilephone) + if($type == "view" && Mobile::isFromMobilePhone() && Context::isInstalled()) + { + $orig_type = "view"; + $type = "mobile"; + // create a module instance + $oModule = &$this->getModuleInstance($this->module, $type, $kind); + if(!is_object($oModule) || !method_exists($oModule, $this->act)) { + $type = $orig_type; + Mobile::setMobile(false); + $oModule = &$this->getModuleInstance($this->module, $type, $kind); + } + } + else + { + // create a module instance + $oModule = &$this->getModuleInstance($this->module, $type, $kind); + } + + if(!is_object($oModule)) { + $this->error = 'msg_module_does_not_exist'; + return; + } + + // If there is no such action in the module object + if(!isset($xml_info->action->{$this->act}) || !method_exists($oModule, $this->act)) + { + if(!Context::isInstalled()) + { + $this->error = 'msg_invalid_request'; + return; + } + + $forward = null; + // 1. Look for the module with action name + if(preg_match('/^([a-z]+)([A-Z])([a-z0-9\_]+)(.*)$/', $this->act, $matches)) { + $module = strtolower($matches[2].$matches[3]); + $xml_info = $oModuleModel->getModuleActionXml($module); + if($xml_info->action->{$this->act}) { + $forward->module = $module; + $forward->type = $xml_info->action->{$this->act}->type; + $forward->act = $this->act; + } + } + + if(!$forward) + { + $forward = $oModuleModel->getActionForward($this->act); + } + + if($forward->module && $forward->type && $forward->act && $forward->act == $this->act) { + $kind = strpos(strtolower($forward->act),'admin')!==false?'admin':''; + $type = $forward->type; + $tpl_path = $oModule->getTemplatePath(); + $orig_module = $oModule; + + if($type == "view" && Mobile::isFromMobilePhone()) + { + $orig_type = "view"; + $type = "mobile"; + // create a module instance + $oModule = &$this->getModuleInstance($forward->module, $type, $kind); + if(!is_object($oModule) || !method_exists($oModule, $this->act)) { + $type = $orig_type; + Mobile::setMobile(false); + $oModule = &$this->getModuleInstance($forward->module, $type, $kind); + } + } + else + { + $oModule = &$this->getModuleInstance($forward->module, $type, $kind); + } + $xml_info = $oModuleModel->getModuleActionXml($forward->module); + if($this->module == "admin" && $type == "view") + { + $oMemberModel = &getModel('member'); + + $logged_info = $oMemberModel->getLoggedInfo(); + if($logged_info->is_admin=='Y') { + $orig_module->loadSideBar(); + $oModule->setLayoutPath("./modules/admin/tpl"); + $oModule->setLayoutFile("layout.html"); + } + } + } + else if($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) + { + $this->act = $xml_info->default_index_act; + } + else + { + $this->error = 'msg_invalid_request'; + return; + } + } + + $oModule->setAct($this->act); + + $this->module_info->module_type = $type; + $oModule->setModuleInfo($this->module_info, $xml_info); + + // execute the action, and if failed, set error + if(!$oModule->proc()) $this->error = $oModule->getMessage(); + + return $oModule; + } + + /** + * @brief display contents from executed module + * @param[in] $oModule module instance + * @return none + **/ + function displayContent($oModule = NULL) { + // If the module is not set or not an object, set error + if(!$oModule || !is_object($oModule)) { + $this->error = 'msg_module_does_not_exists'; + } + + // If connection to DB has a problem even though it's not install module, set error + if($this->module != 'install' && $GLOBALS['__DB__'][Context::getDBType()]->is_connected == false) { + $this->error = 'msg_dbconnect_failed'; + } + + // Call trigger after moduleHandler proc + $output = ModuleHandler::triggerCall('moduleHandler.proc', 'after', $oModule); + if(!$output->toBool()) $this->error = $output->getMessage(); + + // Use message view object, if HTML call + if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { + // If error occurred, handle it + if($this->error) { + // display content with message module instance + $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; + $oMessageObject = &ModuleHandler::getModuleInstance('message',$type); + $oMessageObject->setError(-1); + $oMessageObject->setMessage($this->error); + $oMessageObject->dispMessage(); + + // If module was called normally, change the templates of the module into ones of the message view module + if($oModule) { + $oModule->setTemplatePath($oMessageObject->getTemplatePath()); + $oModule->setTemplateFile($oMessageObject->getTemplateFile()); + + // Otherwise, set message instance as the target module + } else { + $oModule = $oMessageObject; + } + } + + // Check if layout_srl exists for the module + if(Mobile::isFromMobilePhone()) + { + $layout_srl = $oModule->module_info->mlayout_srl; + } + else + { + $layout_srl = $oModule->module_info->layout_srl; + } + + if($layout_srl && !$oModule->getLayoutFile()) { + + // If layout_srl exists, get information of the layout, and set the location of layout_path/ layout_file + $oLayoutModel = &getModel('layout'); + $layout_info = $oLayoutModel->getLayout($layout_srl); + if($layout_info) { + + // Input extra_vars into $layout_info + if($layout_info->extra_var_count) { + + foreach($layout_info->extra_var as $var_id => $val) { + if($val->type == 'image') { + if(preg_match('/^\.\/files\/attach\/images\/(.+)/i',$val->value)) $val->value = Context::getRequestUri().substr($val->value,2); + } + $layout_info->{$var_id} = $val->value; + } + } + // Set menus into context + if($layout_info->menu_count) { + foreach($layout_info->menu as $menu_id => $menu) { + if(file_exists($menu->php_file)) @include($menu->php_file); + Context::set($menu_id, $menu); + } + } + + // Set layout information into context + Context::set('layout_info', $layout_info); + + $oModule->setLayoutPath($layout_info->path); + $oModule->setLayoutFile('layout'); + + // If layout was modified, use the modified version + $edited_layout = $oLayoutModel->getUserLayoutHtml($layout_info->layout_srl); + if(file_exists($edited_layout)) $oModule->setEditedLayoutFile($edited_layout); + } + } + } + + // Display contents + $oDisplayHandler = new DisplayHandler(); + $oDisplayHandler->printContent($oModule); + } + + /** + * @brief returns module's path + * @param[in] $module module name + * @return path of the module + **/ + function getModulePath($module) { + return sprintf('./modules/%s/', $module); + } + + /** + * @brief It creates a module instance + * @param[in] $module module name + * @param[in] $type instance type, (e.g., view, controller, model) + * @param[in] $kind admin or svc + * @return module instance (if failed it returns null) + * @remarks if there exists a module instance created before, returns it. + **/ + function &getModuleInstance($module, $type = 'view', $kind = '') { + + if(__DEBUG__==3) $start_time = getMicroTime(); + + $kind = strtolower($kind); + $type = strtolower($type); + + $kinds = explode(' ', 'svc admin'); + if(!in_array($kind, $kinds)) $kind = $kinds[0]; + + $key = $module.'.'.($kind!='admin'?'':'admin').'.'.$type; + + if(is_array($GLOBALS['__MODULE_EXTEND__']) && array_key_exists($key, $GLOBALS['__MODULE_EXTEND__'])) { + $module = $extend_module = $GLOBALS['__MODULE_EXTEND__'][$key]; + }else{ + unset($parent_module); + } + + // if there is no instance of the module in global variable, create a new one + if(!$GLOBALS['_loaded_module'][$module][$type][$kind]) { + $parent_module = $module; + + $class_path = ModuleHandler::getModulePath($module); + if(!is_dir(FileHandler::getRealPath($class_path))) return NULL; + + // Get base class name and load the file contains it + if(!class_exists($module)) { + $high_class_file = sprintf('%s%s%s.class.php', _XE_PATH_,$class_path, $module); + if(!file_exists($high_class_file)) return NULL; + require_once($high_class_file); + } + + // Get the object's name + $types = explode(' ', 'view controller model api wap mobile class'); + if(!in_array($type, $types)) $type = $types[0]; + if($type == 'class') { + $instance_name = '%s'; + $class_file = '%s%s.%s.php'; + } elseif($kind == 'admin' && array_search($type, $types) < 3) { + $instance_name = '%sAdmin%s'; + $class_file = '%s%s.admin.%s.php'; + } else{ + $instance_name = '%s%s'; + $class_file = '%s%s.%s.php'; + } + $instance_name = sprintf($instance_name, $module, ucfirst($type)); + $class_file = sprintf($class_file, $class_path, $module, $type); + $class_file = FileHandler::getRealPath($class_file); + + // Get the name of the class file + if(!is_readable($class_file)) return NULL; + + // Create an instance with eval function + require_once($class_file); + if(!class_exists($instance_name)) return NULL; + $tmp_fn = create_function('', "return new {$instance_name}();"); + $oModule = $tmp_fn(); + if(!is_object($oModule)) return NULL; + + // Load language files for the class + Context::loadLang($class_path.'lang'); + if($extend_module) { + Context::loadLang(ModuleHandler::getModulePath($parent_module).'lang'); + } + + // Set variables to the instance + $oModule->setModule($module); + $oModule->setModulePath($class_path); + + // If the module has a constructor, run it. + if(!isset($GLOBALS['_called_constructor'][$instance_name])) { + $GLOBALS['_called_constructor'][$instance_name] = true; + if(@method_exists($oModule, $instance_name)) $oModule->{$instance_name}(); + } + + // Store the created instance into GLOBALS variable + $GLOBALS['_loaded_module'][$module][$type][$kind] = $oModule; + } + + if(__DEBUG__==3) $GLOBALS['__elapsed_class_load__'] += getMicroTime() - $start_time; + + // return the instance + return $GLOBALS['_loaded_module'][$module][$type][$kind]; + } + + /** + * @brief call a trigger + * @param[in] $trigger_name trigger's name to call + * @param[in] $called_position called position + * @param[in] $obj an object as a parameter to trigger + * @return Object + **/ + function triggerCall($trigger_name, $called_position, &$obj) { + // skip if not installed + if(!Context::isInstalled()) return new Object(); + + $oModuleModel = &getModel('module'); + $triggers = $oModuleModel->getTriggers($trigger_name, $called_position); + if(!$triggers || !count($triggers)) return new Object(); + + foreach($triggers as $item) { + $module = $item->module; + $type = $item->type; + $called_method = $item->called_method; + + $oModule = null; + $oModule = &getModule($module, $type); + if(!$oModule || !method_exists($oModule, $called_method)) continue; + + $output = $oModule->{$called_method}($obj); + if(is_object($output) && method_exists($output, 'toBool') && !$output->toBool()) return $output; + unset($oModule); + } + + return new Object(); + } + } +?> diff --git a/classes/module/ModuleObject.class.php b/classes/module/ModuleObject.class.php index 35f0fba01..7019a23ae 100644 --- a/classes/module/ModuleObject.class.php +++ b/classes/module/ModuleObject.class.php @@ -1,311 +1,311 @@ -module = $module; - } - - /** - * @brief setter to set the name of module path - * @param the directory path to a module directory - **/ - function setModulePath($path) { - if(substr($path,-1)!='/') $path.='/'; - $this->module_path = $path; - } - - /** - * @brief setter to set an url for redirection - * @param $url url for redirection - * @remark redirect_url is used only for ajax requests - **/ - function setRedirectUrl($url='./') { - $this->add('redirect_url', $url); - } - - /** - * @brief sett to set the template path for refresh.html - * @remark refresh.html is executed as a result of method execution - * 공통 tpl중 refresh.html을 실행할 뿐.. - **/ - function setRefreshPage() { - $this->setTemplatePath('./common/tpl'); - $this->setTemplateFile('refresh'); - } - - - /** - * @brief sett to set the action name - **/ - function setAct($act) { - $this->act = $act; - } - - /** - * @brief sett to set module information - * @param[in] $module_info object containing module information - * @param[in] $xml_info object containing module description - **/ - function setModuleInfo($module_info, $xml_info) { - // 기본 변수 설정 - $this->mid = $module_info->mid; - $this->module_srl = $module_info->module_srl; - $this->module_info = $module_info; - $this->xml_info = $xml_info; - $this->skin_vars = $module_info->skin_vars; - - // 웹서비스에서 꼭 필요한 인증 정보와 권한 설정 체크 - $is_logged = Context::get('is_logged'); - $logged_info = Context::get('logged_info'); - - // module model 객체 생성 - $oModuleModel = &getModel('module'); - - // XE에서 access, manager (== is_admin) 는 고정된 권한명이며 이와 관련된 권한 설정 - $module_srl = Context::get('module_srl'); - if(!$module_info->mid && preg_match('/^([0-9]+)$/',$module_srl)) { - $request_module = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - if($request_module->module_srl == $module_srl) { - $grant = $oModuleModel->getGrant($request_module, $logged_info); - } - } else { - $grant = $oModuleModel->getGrant($module_info, $logged_info, $xml_info); - } - - // 현재 모듈의 access 권한이 없으면 권한 없음 표시 - //if(!$grant->access) return $this->stop("msg_not_permitted"); - - // 관리 권한이 없으면 permision, action 확인 - if(!$grant->manager) { - // 현재 요청된 action의 퍼미션 type(guest, member, manager, root)를 구함 - $permission_target = $xml_info->permission->{$this->act}; - - // module.xml에 명시된 퍼미션이 없을때 action명에 Admin이 있으면 manager로 체크 - if(!$permission_target && substr_count($this->act, 'Admin')) $permission_target = 'manager'; - - // 권한 체크 - switch($permission_target) { - case 'root' : - $this->stop('msg_not_permitted_act'); - break; - case 'manager' : - if(!$grant->manager) $this->stop('msg_not_permitted_act'); - break; - case 'member' : - if(!$is_logged) $this->stop('msg_not_permitted_act'); - break; - } - } - - // 권한변수 설정 - $this->grant = $grant; - Context::set('grant', $grant); - - if(method_exists($this, 'init')) $this->init(); - } - - /** - * @brief set the stop_proc and approprate message for msg_code - * @param $msg_code an error code - **/ - function stop($msg_code) { - // proc 수행을 중지 시키기 위한 플래그 세팅 - $this->stop_proc = true; - - // 에러 처리 - $this->setError(-1); - $this->setMessage($msg_code); - - // message 모듈의 에러 표시 - $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; - $oMessageObject = &ModuleHandler::getModuleInstance('message',$type); - $oMessageObject->setError(-1); - $oMessageObject->setMessage($msg_code); - $oMessageObject->dispMessage(); - - $this->setTemplatePath($oMessageObject->getTemplatePath()); - $this->setTemplateFile($oMessageObject->getTemplateFile()); - - return $this; - } - - /** - * @brief set the file name of the template file - **/ - function setTemplateFile($filename) { - if(substr($filename,-5)!='.html') $filename .= '.html'; - $this->template_file = $filename; - } - - /** - * @brief retrieve the directory path of the template directory - **/ - function getTemplateFile() { - return $this->template_file; - } - - /** - * @brief set the directory path of the template directory - **/ - function setTemplatePath($path) { - if(substr($path,0,1)!='/' && substr($path,0,2)!='./') $path = './'.$path; - if(substr($path,-1)!='/') $path .= '/'; - $this->template_path = $path; - } - - /** - - * @brief retrieve the directory path of the template directory - **/ - function getTemplatePath() { - return $this->template_path; - } - - /** - * @brief set the file name of the temporarily modified by admin - **/ - function setEditedLayoutFile($filename) { - if(substr($filename,-5)!='.html') $filename .= '.html'; - $this->edited_layout_file = $filename; - } - - /** - * @brief retreived the file name of edited_layout_file - **/ - function getEditedLayoutFile() { - return $this->edited_layout_file; - } - - /** - * @brief set the file name of the layout file - **/ - function setLayoutFile($filename) { - if(substr($filename,-5)!='.html') $filename .= '.html'; - $this->layout_file = $filename; - } - - /** - * @brief get the file name of the layout file - **/ - function getLayoutFile() { - return $this->layout_file; - } - - /** - * @brief set the directory path of the layout directory - **/ - function setLayoutPath($path) { - if(substr($path,0,1)!='/' && substr($path,0,2)!='./') $path = './'.$path; - if(substr($path,-1)!='/') $path .= '/'; - $this->layout_path = $path; - } - - /** - * @brief set the directory path of the layout directory - **/ - function getLayoutPath() { - return $this->layout_path; - } - - /** - * @brief excute the member method specified by $act variable - * - **/ - function proc() { - // stop_proc==true이면 그냥 패스 - if($this->stop_proc) return false; - - // trigger call - $triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'before', $this); - if(!$triggerOutput->toBool()) { - $this->setError($triggerOutput->getError()); - $this->setMessage($triggerOutput->getMessage()); - return false; - } - - // addon 실행(called_position 를 before_module_proc로 하여 호출) - $called_position = 'before_module_proc'; - $oAddonController = &getController('addon'); - $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone()?"mobile":"pc"); - @include($addon_file); - - if(isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act)) { - - // 권한 체크 - if(!$this->grant->access) return $this->stop("msg_not_permitted_act"); - - // 모듈의 스킨 정보를 연동 (스킨 정보의 테이블 분리로 동작대상 모듈에만 스킨 정보를 싱크시키도록 변경) - $oModuleModel = &getModel('module'); - $oModuleModel->syncSkinInfoToModuleInfo($this->module_info); - Context::set('module_info', $this->module_info); - - // 실행 - $output = $this->{$this->act}(); - } - else { - return false; - } - - // trigger call - $triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'after', $this); - if(!$triggerOutput->toBool()) { - $this->setError($triggerOutput->getError()); - $this->setMessage($triggerOutput->getMessage()); - return false; - } - - // addon 실행(called_position 를 after_module_proc로 하여 호출) - $called_position = 'after_module_proc'; - $oAddonController = &getController('addon'); - $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone()?"mobile":"pc"); - @include($addon_file); - - if(is_a($output, 'Object') || is_subclass_of($output, 'Object')) { - $this->setError($output->getError()); - $this->setMessage($output->getMessage()); - return false; - } - - // view action이고 결과 출력이 XMLRPC 또는 JSON일 경우 해당 모듈의 api method를 실행 - if($this->module_info->module_type == 'view'){ - if(Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON') { - $oAPI = getAPI($this->module_info->module, 'api'); - if(method_exists($oAPI, $this->act)) { - $oAPI->{$this->act}($this); - } - } - } - - return true; - } - } -?> +module = $module; + } + + /** + * @brief setter to set the name of module path + * @param the directory path to a module directory + **/ + function setModulePath($path) { + if(substr($path,-1)!='/') $path.='/'; + $this->module_path = $path; + } + + /** + * @brief setter to set an url for redirection + * @param $url url for redirection + * @remark redirect_url is used only for ajax requests + **/ + function setRedirectUrl($url='./') { + $this->add('redirect_url', $url); + } + + /** + * @brief sett to set the template path for refresh.html + * @remark refresh.html is executed as a result of method execution + * 공통 tpl중 refresh.html을 실행할 뿐.. + **/ + function setRefreshPage() { + $this->setTemplatePath('./common/tpl'); + $this->setTemplateFile('refresh'); + } + + + /** + * @brief sett to set the action name + **/ + function setAct($act) { + $this->act = $act; + } + + /** + * @brief sett to set module information + * @param[in] $module_info object containing module information + * @param[in] $xml_info object containing module description + **/ + function setModuleInfo($module_info, $xml_info) { + // 기본 변수 설정 + $this->mid = $module_info->mid; + $this->module_srl = $module_info->module_srl; + $this->module_info = $module_info; + $this->xml_info = $xml_info; + $this->skin_vars = $module_info->skin_vars; + + // 웹서비스에서 꼭 필요한 인증 정보와 권한 설정 체크 + $is_logged = Context::get('is_logged'); + $logged_info = Context::get('logged_info'); + + // module model 객체 생성 + $oModuleModel = &getModel('module'); + + // XE에서 access, manager (== is_admin) 는 고정된 권한명이며 이와 관련된 권한 설정 + $module_srl = Context::get('module_srl'); + if(!$module_info->mid && preg_match('/^([0-9]+)$/',$module_srl)) { + $request_module = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if($request_module->module_srl == $module_srl) { + $grant = $oModuleModel->getGrant($request_module, $logged_info); + } + } else { + $grant = $oModuleModel->getGrant($module_info, $logged_info, $xml_info); + } + + // 현재 모듈의 access 권한이 없으면 권한 없음 표시 + //if(!$grant->access) return $this->stop("msg_not_permitted"); + + // 관리 권한이 없으면 permision, action 확인 + if(!$grant->manager) { + // 현재 요청된 action의 퍼미션 type(guest, member, manager, root)를 구함 + $permission_target = $xml_info->permission->{$this->act}; + + // module.xml에 명시된 퍼미션이 없을때 action명에 Admin이 있으면 manager로 체크 + if(!$permission_target && substr_count($this->act, 'Admin')) $permission_target = 'manager'; + + // 권한 체크 + switch($permission_target) { + case 'root' : + $this->stop('msg_not_permitted_act'); + break; + case 'manager' : + if(!$grant->manager) $this->stop('msg_not_permitted_act'); + break; + case 'member' : + if(!$is_logged) $this->stop('msg_not_permitted_act'); + break; + } + } + + // 권한변수 설정 + $this->grant = $grant; + Context::set('grant', $grant); + + if(method_exists($this, 'init')) $this->init(); + } + + /** + * @brief set the stop_proc and approprate message for msg_code + * @param $msg_code an error code + **/ + function stop($msg_code) { + // proc 수행을 중지 시키기 위한 플래그 세팅 + $this->stop_proc = true; + + // 에러 처리 + $this->setError(-1); + $this->setMessage($msg_code); + + // message 모듈의 에러 표시 + $type = Mobile::isFromMobilePhone() ? 'mobile' : 'view'; + $oMessageObject = &ModuleHandler::getModuleInstance('message',$type); + $oMessageObject->setError(-1); + $oMessageObject->setMessage($msg_code); + $oMessageObject->dispMessage(); + + $this->setTemplatePath($oMessageObject->getTemplatePath()); + $this->setTemplateFile($oMessageObject->getTemplateFile()); + + return $this; + } + + /** + * @brief set the file name of the template file + **/ + function setTemplateFile($filename) { + if(substr($filename,-5)!='.html') $filename .= '.html'; + $this->template_file = $filename; + } + + /** + * @brief retrieve the directory path of the template directory + **/ + function getTemplateFile() { + return $this->template_file; + } + + /** + * @brief set the directory path of the template directory + **/ + function setTemplatePath($path) { + if(substr($path,0,1)!='/' && substr($path,0,2)!='./') $path = './'.$path; + if(substr($path,-1)!='/') $path .= '/'; + $this->template_path = $path; + } + + /** + + * @brief retrieve the directory path of the template directory + **/ + function getTemplatePath() { + return $this->template_path; + } + + /** + * @brief set the file name of the temporarily modified by admin + **/ + function setEditedLayoutFile($filename) { + if(substr($filename,-5)!='.html') $filename .= '.html'; + $this->edited_layout_file = $filename; + } + + /** + * @brief retreived the file name of edited_layout_file + **/ + function getEditedLayoutFile() { + return $this->edited_layout_file; + } + + /** + * @brief set the file name of the layout file + **/ + function setLayoutFile($filename) { + if(substr($filename,-5)!='.html') $filename .= '.html'; + $this->layout_file = $filename; + } + + /** + * @brief get the file name of the layout file + **/ + function getLayoutFile() { + return $this->layout_file; + } + + /** + * @brief set the directory path of the layout directory + **/ + function setLayoutPath($path) { + if(substr($path,0,1)!='/' && substr($path,0,2)!='./') $path = './'.$path; + if(substr($path,-1)!='/') $path .= '/'; + $this->layout_path = $path; + } + + /** + * @brief set the directory path of the layout directory + **/ + function getLayoutPath() { + return $this->layout_path; + } + + /** + * @brief excute the member method specified by $act variable + * + **/ + function proc() { + // stop_proc==true이면 그냥 패스 + if($this->stop_proc) return false; + + // trigger call + $triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'before', $this); + if(!$triggerOutput->toBool()) { + $this->setError($triggerOutput->getError()); + $this->setMessage($triggerOutput->getMessage()); + return false; + } + + // addon 실행(called_position 를 before_module_proc로 하여 호출) + $called_position = 'before_module_proc'; + $oAddonController = &getController('addon'); + $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone()?"mobile":"pc"); + @include($addon_file); + + if(isset($this->xml_info->action->{$this->act}) && method_exists($this, $this->act)) { + + // 권한 체크 + if(!$this->grant->access) return $this->stop("msg_not_permitted_act"); + + // 모듈의 스킨 정보를 연동 (스킨 정보의 테이블 분리로 동작대상 모듈에만 스킨 정보를 싱크시키도록 변경) + $oModuleModel = &getModel('module'); + $oModuleModel->syncSkinInfoToModuleInfo($this->module_info); + Context::set('module_info', $this->module_info); + + // 실행 + $output = $this->{$this->act}(); + } + else { + return false; + } + + // trigger call + $triggerOutput = ModuleHandler::triggerCall('moduleObject.proc', 'after', $this); + if(!$triggerOutput->toBool()) { + $this->setError($triggerOutput->getError()); + $this->setMessage($triggerOutput->getMessage()); + return false; + } + + // addon 실행(called_position 를 after_module_proc로 하여 호출) + $called_position = 'after_module_proc'; + $oAddonController = &getController('addon'); + $addon_file = $oAddonController->getCacheFilePath(Mobile::isFromMobilePhone()?"mobile":"pc"); + @include($addon_file); + + if(is_a($output, 'Object') || is_subclass_of($output, 'Object')) { + $this->setError($output->getError()); + $this->setMessage($output->getMessage()); + return false; + } + + // view action이고 결과 출력이 XMLRPC 또는 JSON일 경우 해당 모듈의 api method를 실행 + if($this->module_info->module_type == 'view'){ + if(Context::getResponseMethod() == 'XMLRPC' || Context::getResponseMethod() == 'JSON') { + $oAPI = getAPI($this->module_info->module, 'api'); + if(method_exists($oAPI, $this->act)) { + $oAPI->{$this->act}($this); + } + } + } + + return true; + } + } +?> diff --git a/classes/object/Object.class.php b/classes/object/Object.class.php index 4cf8bab11..fe4cab0ea 100644 --- a/classes/object/Object.class.php +++ b/classes/object/Object.class.php @@ -1,137 +1,137 @@ -setError($error); - $this->setMessage($message); - } - - /** - * @brief Setter to set error code - * @param[in] $error error code - **/ - function setError($error = 0) { - $this->error = $error; - } - - /** - * @brief Getter to retrieve error code - **/ - function getError() { - return $this->error; - } - - /** - * @brief Setter to set set the error message - * @param[in] $message a messge string - * @return return True - * @remark this method always returns True. We'd better remove it - **/ - function setMessage($message = 'success') { - if(Context::getLang($message)) $message = Context::getLang($message); - $this->message = $message; - return true; - } - - /** - * @brief getter to retrieve an error message - **/ - function getMessage() { - return $this->message; - } - - /** - * @brief setter to set a key/value pair as an additional variable - * @param[in] $key a variable name - * @param[in] $val a value for the variable - **/ - function add($key, $val) { - $this->variables[$key] = $val; - } - - /** - * @brief method to set multiple key/value pairs as an additional variables - * @param[in] $object either object or array containg key/value pairs to be added - **/ - function adds($object) { - if(is_object($object)) { - $vars = get_object_vars($object); - foreach($vars as $key => $val) $this->add($key, $val); - } elseif(is_array($object)) { - foreach($object as $key => $val) $this->add($key, $val); - } - } - - /** - * @brief method to retrieve a corresponding value to a given key - **/ - function get($key) { - return $this->variables[$key]; - } - - - /** - * @brief method to retrieve an object containing a key/value paris - * @return Returns an object containing key/value pairs - **/ - function gets() { - $num_args = func_num_args(); - $args_list = func_get_args(); - for($i=0;$i<$num_args;$i++) { - $key = $args_list[$i]; - $output->{$key} = $this->get($key); - } - return $output; - } - - /** - * @brief method to retrieve an array of key/value pairs - * @return Return a list of key/value pairs - **/ - function getVariables() { - return $this->variables; - } - - /** - * @brief method to retrieve an object of key/value pairs - * @return Return an object of key/value pairs - **/ - function getObjectVars() { - foreach($this->variables as $key => $val) $output->{$key} = $val; - return $output; - } - - /** - * @brief method to return either true or false depnding on the value in a 'error' variable - * @remark this method is misleading in that it returns true if error is 0, which should be true in - * boolean representation. - **/ - function toBool() { - return $this->error==0?true:false; - } - - - /** - * @brief method to return either true or false depnding on the value in a 'error' variable - **/ - function toBoolean() { - return $this->toBool(); - } - } -?> +setError($error); + $this->setMessage($message); + } + + /** + * @brief Setter to set error code + * @param[in] $error error code + **/ + function setError($error = 0) { + $this->error = $error; + } + + /** + * @brief Getter to retrieve error code + **/ + function getError() { + return $this->error; + } + + /** + * @brief Setter to set set the error message + * @param[in] $message a messge string + * @return return True + * @remark this method always returns True. We'd better remove it + **/ + function setMessage($message = 'success') { + if(Context::getLang($message)) $message = Context::getLang($message); + $this->message = $message; + return true; + } + + /** + * @brief getter to retrieve an error message + **/ + function getMessage() { + return $this->message; + } + + /** + * @brief setter to set a key/value pair as an additional variable + * @param[in] $key a variable name + * @param[in] $val a value for the variable + **/ + function add($key, $val) { + $this->variables[$key] = $val; + } + + /** + * @brief method to set multiple key/value pairs as an additional variables + * @param[in] $object either object or array containg key/value pairs to be added + **/ + function adds($object) { + if(is_object($object)) { + $vars = get_object_vars($object); + foreach($vars as $key => $val) $this->add($key, $val); + } elseif(is_array($object)) { + foreach($object as $key => $val) $this->add($key, $val); + } + } + + /** + * @brief method to retrieve a corresponding value to a given key + **/ + function get($key) { + return $this->variables[$key]; + } + + + /** + * @brief method to retrieve an object containing a key/value paris + * @return Returns an object containing key/value pairs + **/ + function gets() { + $num_args = func_num_args(); + $args_list = func_get_args(); + for($i=0;$i<$num_args;$i++) { + $key = $args_list[$i]; + $output->{$key} = $this->get($key); + } + return $output; + } + + /** + * @brief method to retrieve an array of key/value pairs + * @return Return a list of key/value pairs + **/ + function getVariables() { + return $this->variables; + } + + /** + * @brief method to retrieve an object of key/value pairs + * @return Return an object of key/value pairs + **/ + function getObjectVars() { + foreach($this->variables as $key => $val) $output->{$key} = $val; + return $output; + } + + /** + * @brief method to return either true or false depnding on the value in a 'error' variable + * @remark this method is misleading in that it returns true if error is 0, which should be true in + * boolean representation. + **/ + function toBool() { + return $this->error==0?true:false; + } + + + /** + * @brief method to return either true or false depnding on the value in a 'error' variable + **/ + function toBoolean() { + return $this->toBool(); + } + } +?> diff --git a/classes/page/PageHandler.class.php b/classes/page/PageHandler.class.php index 4f65e4bed..5ba96bfc5 100644 --- a/classes/page/PageHandler.class.php +++ b/classes/page/PageHandler.class.php @@ -1,62 +1,62 @@ -total_count = $total_count; - $this->total_page = $total_page; - $this->cur_page = $cur_page; - $this->page_count = $page_count; - $this->point = 0; - - $first_page = $cur_page - (int)($page_count/2); - if($first_page<1) $first_page = 1; - $last_page = $total_page; - if($last_page>$total_page) $last_page = $total_page; - - $this->first_page = $first_page; - $this->last_page = $last_page; - - if($total_page < $this->page_count) $this->page_count = $total_page; - } - - /** - * @brief request next page - * @return next page number - **/ - function getNextPage() { - $page = $this->first_page+$this->point++; - if($this->point > $this->page_count || $page > $this->last_page) $page = 0; - return $page; - } - - function getPage($offset) - { - return max(min($this->cur_page + $offset, $this->total_page), ''); - } - } -?> +total_count = $total_count; + $this->total_page = $total_page; + $this->cur_page = $cur_page; + $this->page_count = $page_count; + $this->point = 0; + + $first_page = $cur_page - (int)($page_count/2); + if($first_page<1) $first_page = 1; + $last_page = $total_page; + if($last_page>$total_page) $last_page = $total_page; + + $this->first_page = $first_page; + $this->last_page = $last_page; + + if($total_page < $this->page_count) $this->page_count = $total_page; + } + + /** + * @brief request next page + * @return next page number + **/ + function getNextPage() { + $page = $this->first_page+$this->point++; + if($this->point > $this->page_count || $page > $this->last_page) $page = 0; + return $page; + } + + function getPage($offset) + { + return max(min($this->cur_page + $offset, $this->total_page), ''); + } + } +?> diff --git a/classes/template/TemplateHandler.class.php b/classes/template/TemplateHandler.class.php index f8059c80b..3ba9db1ad 100644 --- a/classes/template/TemplateHandler.class.php +++ b/classes/template/TemplateHandler.class.php @@ -1,879 +1,879 @@ -path = preg_replace('/^\.\//','',$info['dirname']).'/'; - $this->path = $tpl_path; - $this->filename = $tpl_filename; - $this->file = $tpl_file; - - $this->xe_path = preg_replace('/([^\.^\/]+)\.php$/i','',$_SERVER['SCRIPT_NAME']); - $this->web_path = $this->xe_path.str_replace(_XE_PATH_,'',$this->path); - - // get compiled file name - $this->compiled_file = sprintf('%s%s.compiled.php',$this->compiled_path, md5($this->file)); - - // compare various file's modified time for check changed - $this->handler_mtime = filemtime(_XE_PATH_.'classes/template/TemplateHandler.class.php'); - - $this->buff = null; - } - - /** - * @brief compiles specified tpl file and execution result in Context into resultant content - * @param[in] $tpl_path path of the directory containing target template file - * @param[in] $tpl_filename target template file's name - * @param[in] $tpl_file if specified use it as template file's full path - * @return Returns compiled result in case of success, NULL otherwise - */ - function compile($tpl_path, $tpl_filename, $tpl_file = '') { - // store the starting time for debug information - if(__DEBUG__==3 ) $start = getMicroTime(); - - // initiation - $this->init($tpl_path, $tpl_filename, $tpl_file); - - // if target file does not exist exit - if(!$this->file || !file_exists($this->file)) return sprintf('Err : "%s" template file does not exists.', $this->file); - - $source_template_mtime = filemtime($this->file); - $latest_mtime = $source_template_mtime>$this->handler_mtime?$source_template_mtime:$this->handler_mtime; - - // cache controll - $oCacheHandler = &CacheHandler::getInstance('template'); - - // get cached buff - if($oCacheHandler->isSupport()){ - $cache_key = 'template:'.$this->file; - $this->buff = $oCacheHandler->get($cache_key, $latest_mtime); - } else { - if(file_exists($this->compiled_file) && filemtime($this->compiled_file)>$latest_mtime) { - $this->buff = FileHandler::readFile($this->compiled_file); - } - } - - if(!$this->buff) { - $this->parse(); - if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $this->buff); - else FileHandler::writeFile($this->compiled_file, $this->buff); - } - - $output = $this->_fetch(); - - // store the ending time for debug information - if(__DEBUG__==3 ) $GLOBALS['__template_elapsed__'] += getMicroTime() - $start; - - return $output; - } - - /** - * @brief compile specified file and immediately return - * @param[in] $tpl_path path of the directory containing target template file - * @param[in] $tpl_filename target template file's name - * @return Returns compiled content in case of success or NULL in case of failure - **/ - function compileDirect($tpl_path, $tpl_filename) { - $this->init($tpl_path, $tpl_filename, null); - - // if target file does not exist exit - if(!$this->file || !file_exists($this->file)) { - Context::close(); - printf('"%s" template file is not exists.', $this->file); - exit(); - } - - $this->parse(); - return $this->buff; - } - - /** - * @brief compile a template file specified in $tpl_file and - * @pre files specified by $tpl_file exists. - * @param[in] $tpl_file path of tpl file - * @param[in] $compiled_tpl_file if specified, write compiled result into the file - * @return compiled result in case of success or NULL in case of error - **/ - function parse() { - if(!file_exists($this->file)) return; - - // read tpl file - $buff = FileHandler::readFile($this->file); - - // replace value of src in img/input/script tag - $buff = preg_replace_callback('/<(img|input|script)([^>]*)src="([^"]*?)"/is', array($this, '_replacePath'), $buff); - - // loop 템플릿 문법을 변환 - $buff = $this->_replaceLoop($buff); - - // cond 템플릿 문법을 변환 - $buff = $this->_replaceCond($buff); - - // |cond 템플릿 문법을 변환 - $buff = preg_replace_callback("/<\/?(\w+)((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i", array($this, '_replacePipeCond'), $buff); - - // include 태그의 변환 - $buff = preg_replace_callback('!]+)>!is', array($this, '_replaceInclude'), $buff); - - // unload/ load 태그의 변환 - $buff = preg_replace_callback('!<(unload|load) ([^>]+)>!is', array($this, '_replaceLoad'), $buff); - - // 가상 태그인 block의 변환 - $buff = preg_replace('/|<\/block>/is','',$buff); - - // replace include - $buff = preg_replace_callback('!<\!--#include\(([^\)]*?)\)-->!is', array($this, '_compileIncludeToCode'), $buff); - - // replace - $buff = preg_replace_callback('!<\!--@(.*?)-->!is', array($this, '_compileFuncToCode'), $buff); - - // remove comments - $buff = preg_replace('!(\n?)( *?)<\!--//(.*?)-->!is', '', $buff); - - // import xml filter/ css/ js/ files (media is applied to only css) - $buff = preg_replace_callback('!<\!--%import\(\"([^\"]*?)\"(,optimized\=(true|false))?(,media\=\"([^\"]*)\")?(,targetie=\"([^\"]*)\")?(,index=\"([^\"]*)\")?(,type=\"([^\"]*)\")?\)-->!is', array($this, '_compileImportCode'), $buff); - - // unload css/ js (media is applied to only css) - $buff = preg_replace_callback('!<\!--%unload\(\"([^\"]*?)\"(,optimized\=(true|false))?(,media\=\"([^\"]*)\")?(,targetie=\"([^\"]*)\")?\)-->!is', array($this, '_compileUnloadCode'), $buff); - - // javascript plugin import - $buff = preg_replace_callback('!<\!--%load_js_plugin\(\"([^\"]*?)\"\)-->!is', array($this, '_compileLoadJavascriptPlugin'), $buff); - - // replace variables - $buff = preg_replace_callback('/\{[^@^ ]([^\{\}\n]+)\}/i', array($this, '_compileVarToContext'), $buff); - - // PHP 변수형의 변환 ($문자등을 공유 context로 변환) - $buff = $this->_replaceVarInPHP($buff); - - // replace parts not displaying results - $buff = preg_replace_callback('/\{\@([^\{\}]+)\}/i', array($this, '_compileVarToSilenceExecute'), $buff); - - // prevent from calling directly before writing into file - $this->buff = ''.$buff; - } - - /** - * @brief fetch using ob_* function - * @param[in] $compiled_tpl_file path of compiled template file - * @param[in] $buff if buff is not null, eval it instead of including compiled template file - * @param[in] $tpl_path set context's tpl path - * @return result string - **/ - function _fetch() { - if(!$this->buff) return; - - $__Context = &$GLOBALS['__Context__']; - $__Context->tpl_path = $this->path; - - if($_SESSION['is_logged']) $__Context->logged_info = $_SESSION['logged_info']; - - ob_start(); - $eval_str = "?>".$this->buff; - eval($eval_str); - return ob_get_clean(); - } - - /** - * @brief change image path - * @pre $matches is an array containg three elements - * @param[in] $matches match - * @return changed result - **/ - function _replacePath($matches) - { - preg_match_all('/src="([^"]*?)"/is', $matches[0], $m); - for($i=0,$c=count($m[0]);$i<$c;$i++) { - $path = trim($m[1][$i]); - if(substr($path,0,1)=='/' || substr($path,0,1)=='{' || strpos($path,'://')!==false) continue; - if(substr($path,0,2)=='./') $path = substr($path,2); - $target = $this->web_path.$path; - while(strpos($target,'/../')!==false) - { - $target = preg_replace('/\/([^\/]+)\/\.\.\//','/',$target); - } - $target = str_replace('/./','/',$target); - $matches[0] = str_replace($m[0][$i], 'src="'.$target.'"', $matches[0]); - } - return $matches[0]; - } - - /** - * @brief loop 문법의 변환 - **/ - function _replaceLoop($buff) - { - while(false !== $pos = strpos($buff, ' loop="')) - { - $pre = substr($buff,0,$pos); - $next = substr($buff,$pos); - - $pre_pos = strrpos($pre, '<'); - - preg_match('/^ loop="([^"]+)"/i',$next,$m); - $tag = substr($next,0,strlen($m[0])); - $next = substr($next,strlen($m[0])); - $next_pos = strpos($next, '<'); - - $tag = substr($pre, $pre_pos). $tag. substr($next, 0, $next_pos); - $pre = substr($pre, 0, $pre_pos); - $next = substr($next, $next_pos); - - $tag_name = trim(substr($tag,1,strpos($tag,' '))); - $tag_head = $tag_tail = ''; - - if(!preg_match('/ loop="([^"]+)"/is',$tag)) { - print "Invalid XpressEngine Template Syntax
"; - print "File : ".$this->file."
"; - print "Code : ".htmlspecialchars($tag); - exit(); - } - - preg_match_all('/ loop="([^"]+)"/is',$tag,$m); - $tag = preg_replace('/ loop="([^"]+)"/is','', $tag); - - for($i=0,$c=count($m[0]);$i<$c;$i++) - { - $loop = $m[1][$i]; - if(false!== $fpos = strpos($loop,'=>')) - { - $target = trim(substr($loop,0,$fpos)); - $vars = trim(substr($loop,$fpos+2)); - if(false===strpos($vars,',')) - { - $tag_head .= ''; - $tag_tail .= ''; - } - else - { - $t = explode(',',$vars); - $tag_head .= ' '.trim($t[1]).') { ?>'; - $tag_tail .= ''; - } - } - elseif(false!==strpos($loop,';')) - { - $tag_head .= ''; - $tag_tail .= ''; - } - else - { - $t = explode('=',$loop); - if(count($t)==2) - { - $tag_head .= ''; - $tag_tail .= ''; - } - } - } - - if(substr(trim($tag),-2)!='/>') - { - while(false !== $close_pos = strpos($next, '')); - $tag .= $tmp_buff; - $next = substr($next, strlen($tmp_buff)); - if(substr_count($tag, '<'.$tag_name) == substr_count($tag,' %s="%s"', $m[3], $m[1], $m[2]), $matches[0]); - } - } - - return $matches[0]; - } - - /** - * @brief cond 문법의 변환 - **/ - function _replaceCond($buff) - { - while(false !== ($pos = strpos($buff, ' cond="'))) - { - $pre = substr($buff,0,$pos); - $next = substr($buff,$pos); - - $pre_pos = strrpos($pre, '<'); - - preg_match('/<(\/|[a-z])/i',$next,$m); - if(!$m[0]) return $buff; - $next_pos = strpos($next, $m[0]); - - $tag = substr($pre, $pre_pos). substr($next, 0, $next_pos); - $pre = substr($pre, 0, $pre_pos); - $next = substr($next, $next_pos); - $tag_name = trim(substr($tag,1,strpos($tag,' '))); - $tag_head = $tag_tail = ''; - - if(preg_match_all('/ cond=\"([^\"]+)"/is',$tag,$m)) - { - for($i=0,$c=count($m[0]);$i<$c;$i++) - { - $tag_head .= ''; - $tag_tail .= ''; - } - } - - if(!preg_match('/ cond="([^"]+)"/is',$tag)) { - print "Invalid XpressEngine Template Syntax
"; - print "File : ".$this->file."
"; - print "Code : ".htmlspecialchars($tag); - exit(); - } - - $tag = preg_replace('/ cond="([^"]+)"/is','', $tag); - if(substr(trim($tag),-2)=='/>') - { - $buff = $pre.$tag_head.$tag.$tag_tail.$next; - } - else - { - while(false !== $close_pos = strpos($next, '')); - $tag .= $tmp_buff; - $next = substr($next, strlen($tmp_buff)); - - if(substr_count($tag, '<'.$tag_name) == substr_count($tag,'path.substr($target,0,$pos); - } - - return sprintf( - 'compile(\'%s\',\'%s\');%s'. - '?>%s', - "\n", - "\n", - $path, $filename, "\n", - "\n" - ); - } - - /** - * @brief load 태그의 변환 - **/ - function _replaceLoad($matches) { - $output = $matches[0]; - if(!preg_match_all('/ ([^=]+)=\"([^\"]+)\"/is',$matches[0], $m)) return $matches[0]; - - $type = $matches[1]; - for($i=0,$c=count($m[1]);$i<$c;$i++) - { - if(!trim($m[1][$i])) continue; - $attrs[trim($m[1][$i])] = trim($m[2][$i]); - } - - if(!$attrs['target']) return $matches[0]; - - $web_path = $this->web_path; - $base_path = $this->path; - - $target = $attrs['target']; - if(!preg_match('/^(http|https)/i',$target)) - { - if(substr($target,0,2)=='./') $target = substr($target,2); - if(substr($target,0,1)!='/') $target = $web_path.$target; - } - - if(!$attrs['index']) $attrs['index'] = 'null'; - if($attrs['type']!='body') $attrs['type'] = 'head'; - - // if target ends with lang, load language pack - if(substr($target, -4)=='lang') { - if(substr($target,0,2)=='./') $target = substr($target, 2); - $lang_dir = $base_path.$target; - if(is_dir($lang_dir)) $output = sprintf('', $lang_dir); - - // otherwise try to load xml, css, js file - } else { - if(substr($target,0,1)!='/') $source_filename = $base_path.$target; - else $source_filename = $target; - $source_filename = str_replace(array('/./','//'),'/',$source_filename); - - // get filename and path - $tmp_arr = explode("/",$source_filename); - $filename = array_pop($tmp_arr); - - //$base_path = implode("/",$tmp_arr)."/"; - - // get the ext - $tmp_arr = explode(".",$filename); - $ext = strtolower(array_pop($tmp_arr)); - - // according to ext., import the file - switch($ext) { - // xml js filter - case 'xml' : - if(preg_match('/^(http|https)/i',$source_filename)) return; - // create an instance of XmlJSFilter class, then create js and handle Context::addJsFile - $output = sprintf( - 'compile();%s'. - '?>%s', - "\n", - "\n", - dirname($base_path . $attrs['target']).'/', - $filename, - "\n", - "\n", - "\n" - ); - break; - // css file - case 'css' : - if($type == 'unload') { - $output = ''; - } else { - $output = ''; - } - break; - // js file - case 'js' : - if($type == 'unload') { - $output = ''; - } else { - $output = ''; - } - break; - } - } - - return $output; - } - - /** - * @brief $문자 의 PHP 변수 변환 - **/ - function _replaceVarInPHP($buff) { - $head = $tail = ''; - while(false !== $pos = strpos($buff, ''); - $body = substr($buff,0,$pos+2); - $head .= preg_replace_callback('/(.?)\$(\w+[a-z0-9\_\-\[\]\'\"]+)/is',array($this, '_replaceVarString'), $body); - - $buff = substr($buff,$pos+2); - } - return $head.$buff; - } - - - /** - * @brief php5의 class::$변수명의 경우 context를 사용하지 않아야 하기에 함수로 대체 - **/ - function _replaceVarString($matches) - { - if($matches[1]==':') return $matches[0]; - if(substr($matches[2],0,1)=='_') return $matches[0]; - return $matches[1].'$__Context->'.$matches[2]; - } - - /** - * @brief replace with php code - * @param[in] $matches match - * @return replaced result - **/ - function _compileIncludeToCode($matches) { - // if target string to include contains variables handle them - $arg = str_replace(array('"','\''), '', $matches[1]); - if(!$arg) return; - - $tmp_arr = explode("/", $arg); - for($i=0;$ifile), $arg); - $path = substr($this->path,-1)=='/'?substr($this->path,0,-1):$this->path; - $source_filename = sprintf("%s/%s", $path, $arg); - - // step2: check path from root - if(!file_exists($source_filename)) $source_filename = './'.$arg; - if(!file_exists($source_filename)) return; - - // split into path and filename - $tmp_arr = explode('/', $source_filename); - $filename = array_pop($tmp_arr); - $path = implode('/', $tmp_arr).'/'; - - // try to include - $output = sprintf( - 'compile(\'%s\',\'%s\');%s'. - '?>%s', - "\n", - "\n", - $path, $filename, "\n", - "\n" - ); - - return $output; - } - - /** - * @brief replace $... variables in { } with Context::get(...) - * @param[in] $matches match - * @return replaced result in case of success or NULL in case of error - **/ - function _compileVarToContext($matches) { - $str = trim(substr($matches[0],1,strlen($matches[0])-2)); - if(!$str) return $matches[0]; - if(!in_array(substr($str,0,1),array('(','$','\'','"'))) { - if(preg_match('/^([^\( \.]+)(\(| \.)/i',$str,$m)) { - $func = trim($m[1]); - if(strpos($func,'::')===false) { - if(!function_exists($func)) { - return $matches[0]; - } - } else { - list($class, $method) = explode('::',$func); - // FIXME regardless of whether class/func name is case-sensitive, it is safe - // to assume names are case sensitive. We don't have compare twice. - if(!class_exists($class) || !in_array($method, get_class_methods($class))) { - // In some environment, the name of classes and methods may be case-sensitive - list($class, $method) = explode('::',strtolower($func)); - if(!class_exists($class) || !in_array($method, get_class_methods($class))) { - return $matches[0]; - } - } - } - } else { - if(!defined($str)) return $matches[0]; - } - } - return ']+)/i','$__Context->\\1', $str).');?>'; - } - - /** - * @brief replace @... function in { } into print func(..) - * @param[in] $matches match - * @return replaced result - **/ - function _compileVarToSilenceExecute($matches) { - if(strtolower(trim(str_replace(array(';',' '),'', $matches[1])))=='return') return ''; - return ']+)/i','$__Context->\\1', trim($matches[1])).';?>'; - } - - /** - * @brief replace code in with php code - * @param[in] $matches match - * @return changed result - **/ - function _compileFuncToCode($matches) { - static $idx = 0; - $code = trim($matches[1]); - if(!$code) return; - - switch(strtolower($code)) { - case 'else' : - $output = '}else{'; - break; - case 'end' : - case 'endif' : - case 'endfor' : - case 'endforeach' : - case 'endswitch' : - $output = '}'; - break; - case 'break' : - $output = 'break;'; - break; - case 'default' : - $output = 'default :'; - break; - case 'break@default' : - $output = 'break; default :'; - break; - default : - $suffix = '{'; - - if(substr($code, 0, 4) == 'else') { - $code = '}'.$code; - } elseif(substr($code, 0, 7) == 'foreach') { - $tmp_str = substr($code, 8); - $tmp_arr = explode(' ', $tmp_str); - $var_name = $tmp_arr[0]; - $prefix = '$Context->__idx['.$idx.']=0;'; - if(substr($var_name, 0, 1) == '$') { - $prefix .= sprintf('if(count($__Context->%s)) ', substr($var_name, 1)); - } else { - $prefix .= sprintf('if(count(%s)) ', $var_name); - } - $idx++; - $suffix .= '$__idx['.$idx.']=($__idx['.$idx.']+1)%2; $cycle_idx = $__idx['.$idx.']+1;'; - } elseif(substr($code, 0, 4) == 'case') { - $suffix = ':'; - } elseif(substr($code, 0, 10) == 'break@case') { - $code = 'break; case'.substr($code, 10); - $suffix = ':'; - } - $output = preg_replace('/\$([a-zA-Z0-9\_\-]+)/i', '$__Context->\\1', $code.$suffix); - break; - } - - return sprintf('', $prefix, $output); - } - - - /** - * @brief replace xe specific code, "" with appropriate php code - * @param[in] $matches match - * @return Returns modified result or NULL in case of error - **/ - function _compileImportCode($matches) { - // find xml file - $base_path = $this->path; - $given_file = trim($matches[1]); - if(!$given_file) return; - if(isset($matches[3])) $optimized = strtolower(trim($matches[3])); - if(!$optimized) $optimized = 'true'; - if(isset($matches[5])) $media = trim($matches[5]); - if(!$media) $media = 'all'; - if(isset($matches[7])) $targetie = trim($matches[7]); - if(!$targetie) $targetie = ''; - else $optimized = 'false'; - - if(isset($matches[9])) $index = intval($matches[9]); - if(!$index) $index = 'null'; - if(isset($matches[11])) $type = strtolower(trim($matches[11])); - if($type!='body') $type = 'head'; - - // if given_file ends with lang, load language pack - if(substr($given_file, -4)=='lang') { - if(substr($given_file,0,2)=='./') $given_file = substr($given_file, 2); - $lang_dir = $base_path.$given_file; - if(is_dir($lang_dir)) $output = sprintf('', $lang_dir); - - // otherwise try to load xml, css, js file - } else { - if(preg_match('/^(http|https):/i',$given_file)) $source_filename = $given_file; - elseif(substr($given_file,0,1)!='/') $source_filename = sprintf("%s%s",$base_path, $given_file); - else $source_filename = $given_file; - - // get filename and path - $tmp_arr = explode("/",$source_filename); - $filename = array_pop($tmp_arr); - - $base_path = implode("/",$tmp_arr)."/"; - - // get the ext - $tmp_arr = explode(".",$filename); - $ext = strtolower(array_pop($tmp_arr)); - - // according to ext., import the file - switch($ext) { - // xml js filter - case 'xml' : - // create an instance of XmlJSFilter class, then create js and handle Context::addJsFile - $output = sprintf( - 'compile();%s'. - '?>%s', - "\n", - "\n", - $base_path, - $filename, - "\n", - "\n", - "\n" - ); - break; - // css file - case 'css' : - if(preg_match('/^(http|\/)/i',$source_filename)) { - $output = sprintf('', $source_filename, 'false', $media, $targetie, $index); - } else { - $output = sprintf('', $base_path, $filename, $optimized, $media, $targetie, $index); - } - break; - // js file - case 'js' : - if(preg_match('/^(http|\/)/i',$source_filename)) { - $output = sprintf('', $source_filename, 'false', $targetie, $index, $type); - } else { - $output = sprintf('', $base_path, $filename, $optimized, $targetie, $index, $type); - } - break; - } - } - - return $output; - } - - /** - * @brief import javascript plugin - * @param[in] $matches match - * @return result loading the plugin - * @remarks javascript plugin works as optimized = false - **/ - function _compileLoadJavascriptPlugin($matches) { - $base_path = $this->path; - $plugin = trim($matches[1]); - return sprintf('', $plugin); - } - - /** - * @brief remove loading part of css/ js file - * @param[in] $matches match - * @return removed result - **/ - function _compileUnloadCode($matches) { - // find xml file - $base_path = $this->path; - $given_file = trim($matches[1]); - if(!$given_file) return; - if(isset($matches[3])) $optimized = strtolower(trim($matches[3])); - if(!$optimized) $optimized = 'true'; - if(isset($matches[5])) $media = trim($matches[5]); - if(!$media) $media = 'all'; - if(isset($matches[7])) $targetie = trim($matches[7]); - if(!$targetie) $targetie = ''; - else $optimized = 'false'; - - if(substr($given_file,0,1)!='/') $source_filename = sprintf("%s%s",$base_path, $given_file); - else $source_filename = $given_file; - - // get path and file nam - $tmp_arr = explode("/",$source_filename); - $filename = array_pop($tmp_arr); - - $base_path = implode("/",$tmp_arr)."/"; - - // get an ext. - $tmp_arr = explode(".",$filename); - $ext = strtolower(array_pop($tmp_arr)); - - switch($ext) { - // css file - case 'css' : - if(preg_match('/^(http|https|\/)/i',$source_filename)) { - $output = sprintf('', $source_filename, 'false', $media, $targetie); - } else { - $output = sprintf('', $base_path, $filename, $optimized, $media, $targetie); - } - break; - // js file - case 'js' : - if(preg_match('/^(http|https|\/)/i',$source_filename)) { - $output = sprintf('', $source_filename, 'false', $targetie); - } else { - $output = sprintf('', $base_path, $filename, $optimized, $targetie); - } - break; - } - - return $output; - } - } -?> +path = preg_replace('/^\.\//','',$info['dirname']).'/'; + $this->path = $tpl_path; + $this->filename = $tpl_filename; + $this->file = $tpl_file; + + $this->xe_path = preg_replace('/([^\.^\/]+)\.php$/i','',$_SERVER['SCRIPT_NAME']); + $this->web_path = $this->xe_path.str_replace(_XE_PATH_,'',$this->path); + + // get compiled file name + $this->compiled_file = sprintf('%s%s.compiled.php',$this->compiled_path, md5($this->file)); + + // compare various file's modified time for check changed + $this->handler_mtime = filemtime(_XE_PATH_.'classes/template/TemplateHandler.class.php'); + + $this->buff = null; + } + + /** + * @brief compiles specified tpl file and execution result in Context into resultant content + * @param[in] $tpl_path path of the directory containing target template file + * @param[in] $tpl_filename target template file's name + * @param[in] $tpl_file if specified use it as template file's full path + * @return Returns compiled result in case of success, NULL otherwise + */ + function compile($tpl_path, $tpl_filename, $tpl_file = '') { + // store the starting time for debug information + if(__DEBUG__==3 ) $start = getMicroTime(); + + // initiation + $this->init($tpl_path, $tpl_filename, $tpl_file); + + // if target file does not exist exit + if(!$this->file || !file_exists($this->file)) return sprintf('Err : "%s" template file does not exists.', $this->file); + + $source_template_mtime = filemtime($this->file); + $latest_mtime = $source_template_mtime>$this->handler_mtime?$source_template_mtime:$this->handler_mtime; + + // cache controll + $oCacheHandler = &CacheHandler::getInstance('template'); + + // get cached buff + if($oCacheHandler->isSupport()){ + $cache_key = 'template:'.$this->file; + $this->buff = $oCacheHandler->get($cache_key, $latest_mtime); + } else { + if(file_exists($this->compiled_file) && filemtime($this->compiled_file)>$latest_mtime) { + $this->buff = FileHandler::readFile($this->compiled_file); + } + } + + if(!$this->buff) { + $this->parse(); + if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key, $this->buff); + else FileHandler::writeFile($this->compiled_file, $this->buff); + } + + $output = $this->_fetch(); + + // store the ending time for debug information + if(__DEBUG__==3 ) $GLOBALS['__template_elapsed__'] += getMicroTime() - $start; + + return $output; + } + + /** + * @brief compile specified file and immediately return + * @param[in] $tpl_path path of the directory containing target template file + * @param[in] $tpl_filename target template file's name + * @return Returns compiled content in case of success or NULL in case of failure + **/ + function compileDirect($tpl_path, $tpl_filename) { + $this->init($tpl_path, $tpl_filename, null); + + // if target file does not exist exit + if(!$this->file || !file_exists($this->file)) { + Context::close(); + printf('"%s" template file is not exists.', $this->file); + exit(); + } + + $this->parse(); + return $this->buff; + } + + /** + * @brief compile a template file specified in $tpl_file and + * @pre files specified by $tpl_file exists. + * @param[in] $tpl_file path of tpl file + * @param[in] $compiled_tpl_file if specified, write compiled result into the file + * @return compiled result in case of success or NULL in case of error + **/ + function parse() { + if(!file_exists($this->file)) return; + + // read tpl file + $buff = FileHandler::readFile($this->file); + + // replace value of src in img/input/script tag + $buff = preg_replace_callback('/<(img|input|script)([^>]*)src="([^"]*?)"/is', array($this, '_replacePath'), $buff); + + // loop 템플릿 문법을 변환 + $buff = $this->_replaceLoop($buff); + + // cond 템플릿 문법을 변환 + $buff = $this->_replaceCond($buff); + + // |cond 템플릿 문법을 변환 + $buff = preg_replace_callback("/<\/?(\w+)((\s+\w+(\s*=\s*(?:\".*?\"|'.*?'|[^'\">\s]+))?)+\s*|\s*)\/?>/i", array($this, '_replacePipeCond'), $buff); + + // include 태그의 변환 + $buff = preg_replace_callback('!]+)>!is', array($this, '_replaceInclude'), $buff); + + // unload/ load 태그의 변환 + $buff = preg_replace_callback('!<(unload|load) ([^>]+)>!is', array($this, '_replaceLoad'), $buff); + + // 가상 태그인 block의 변환 + $buff = preg_replace('/|<\/block>/is','',$buff); + + // replace include + $buff = preg_replace_callback('!<\!--#include\(([^\)]*?)\)-->!is', array($this, '_compileIncludeToCode'), $buff); + + // replace + $buff = preg_replace_callback('!<\!--@(.*?)-->!is', array($this, '_compileFuncToCode'), $buff); + + // remove comments + $buff = preg_replace('!(\n?)( *?)<\!--//(.*?)-->!is', '', $buff); + + // import xml filter/ css/ js/ files (media is applied to only css) + $buff = preg_replace_callback('!<\!--%import\(\"([^\"]*?)\"(,optimized\=(true|false))?(,media\=\"([^\"]*)\")?(,targetie=\"([^\"]*)\")?(,index=\"([^\"]*)\")?(,type=\"([^\"]*)\")?\)-->!is', array($this, '_compileImportCode'), $buff); + + // unload css/ js (media is applied to only css) + $buff = preg_replace_callback('!<\!--%unload\(\"([^\"]*?)\"(,optimized\=(true|false))?(,media\=\"([^\"]*)\")?(,targetie=\"([^\"]*)\")?\)-->!is', array($this, '_compileUnloadCode'), $buff); + + // javascript plugin import + $buff = preg_replace_callback('!<\!--%load_js_plugin\(\"([^\"]*?)\"\)-->!is', array($this, '_compileLoadJavascriptPlugin'), $buff); + + // replace variables + $buff = preg_replace_callback('/\{[^@^ ]([^\{\}\n]+)\}/i', array($this, '_compileVarToContext'), $buff); + + // PHP 변수형의 변환 ($문자등을 공유 context로 변환) + $buff = $this->_replaceVarInPHP($buff); + + // replace parts not displaying results + $buff = preg_replace_callback('/\{\@([^\{\}]+)\}/i', array($this, '_compileVarToSilenceExecute'), $buff); + + // prevent from calling directly before writing into file + $this->buff = ''.$buff; + } + + /** + * @brief fetch using ob_* function + * @param[in] $compiled_tpl_file path of compiled template file + * @param[in] $buff if buff is not null, eval it instead of including compiled template file + * @param[in] $tpl_path set context's tpl path + * @return result string + **/ + function _fetch() { + if(!$this->buff) return; + + $__Context = &$GLOBALS['__Context__']; + $__Context->tpl_path = $this->path; + + if($_SESSION['is_logged']) $__Context->logged_info = $_SESSION['logged_info']; + + ob_start(); + $eval_str = "?>".$this->buff; + eval($eval_str); + return ob_get_clean(); + } + + /** + * @brief change image path + * @pre $matches is an array containg three elements + * @param[in] $matches match + * @return changed result + **/ + function _replacePath($matches) + { + preg_match_all('/src="([^"]*?)"/is', $matches[0], $m); + for($i=0,$c=count($m[0]);$i<$c;$i++) { + $path = trim($m[1][$i]); + if(substr($path,0,1)=='/' || substr($path,0,1)=='{' || strpos($path,'://')!==false) continue; + if(substr($path,0,2)=='./') $path = substr($path,2); + $target = $this->web_path.$path; + while(strpos($target,'/../')!==false) + { + $target = preg_replace('/\/([^\/]+)\/\.\.\//','/',$target); + } + $target = str_replace('/./','/',$target); + $matches[0] = str_replace($m[0][$i], 'src="'.$target.'"', $matches[0]); + } + return $matches[0]; + } + + /** + * @brief loop 문법의 변환 + **/ + function _replaceLoop($buff) + { + while(false !== $pos = strpos($buff, ' loop="')) + { + $pre = substr($buff,0,$pos); + $next = substr($buff,$pos); + + $pre_pos = strrpos($pre, '<'); + + preg_match('/^ loop="([^"]+)"/i',$next,$m); + $tag = substr($next,0,strlen($m[0])); + $next = substr($next,strlen($m[0])); + $next_pos = strpos($next, '<'); + + $tag = substr($pre, $pre_pos). $tag. substr($next, 0, $next_pos); + $pre = substr($pre, 0, $pre_pos); + $next = substr($next, $next_pos); + + $tag_name = trim(substr($tag,1,strpos($tag,' '))); + $tag_head = $tag_tail = ''; + + if(!preg_match('/ loop="([^"]+)"/is',$tag)) { + print "Invalid XpressEngine Template Syntax
"; + print "File : ".$this->file."
"; + print "Code : ".htmlspecialchars($tag); + exit(); + } + + preg_match_all('/ loop="([^"]+)"/is',$tag,$m); + $tag = preg_replace('/ loop="([^"]+)"/is','', $tag); + + for($i=0,$c=count($m[0]);$i<$c;$i++) + { + $loop = $m[1][$i]; + if(false!== $fpos = strpos($loop,'=>')) + { + $target = trim(substr($loop,0,$fpos)); + $vars = trim(substr($loop,$fpos+2)); + if(false===strpos($vars,',')) + { + $tag_head .= ''; + $tag_tail .= ''; + } + else + { + $t = explode(',',$vars); + $tag_head .= ' '.trim($t[1]).') { ?>'; + $tag_tail .= ''; + } + } + elseif(false!==strpos($loop,';')) + { + $tag_head .= ''; + $tag_tail .= ''; + } + else + { + $t = explode('=',$loop); + if(count($t)==2) + { + $tag_head .= ''; + $tag_tail .= ''; + } + } + } + + if(substr(trim($tag),-2)!='/>') + { + while(false !== $close_pos = strpos($next, '')); + $tag .= $tmp_buff; + $next = substr($next, strlen($tmp_buff)); + if(substr_count($tag, '<'.$tag_name) == substr_count($tag,' %s="%s"', $m[3], $m[1], $m[2]), $matches[0]); + } + } + + return $matches[0]; + } + + /** + * @brief cond 문법의 변환 + **/ + function _replaceCond($buff) + { + while(false !== ($pos = strpos($buff, ' cond="'))) + { + $pre = substr($buff,0,$pos); + $next = substr($buff,$pos); + + $pre_pos = strrpos($pre, '<'); + + preg_match('/<(\/|[a-z])/i',$next,$m); + if(!$m[0]) return $buff; + $next_pos = strpos($next, $m[0]); + + $tag = substr($pre, $pre_pos). substr($next, 0, $next_pos); + $pre = substr($pre, 0, $pre_pos); + $next = substr($next, $next_pos); + $tag_name = trim(substr($tag,1,strpos($tag,' '))); + $tag_head = $tag_tail = ''; + + if(preg_match_all('/ cond=\"([^\"]+)"/is',$tag,$m)) + { + for($i=0,$c=count($m[0]);$i<$c;$i++) + { + $tag_head .= ''; + $tag_tail .= ''; + } + } + + if(!preg_match('/ cond="([^"]+)"/is',$tag)) { + print "Invalid XpressEngine Template Syntax
"; + print "File : ".$this->file."
"; + print "Code : ".htmlspecialchars($tag); + exit(); + } + + $tag = preg_replace('/ cond="([^"]+)"/is','', $tag); + if(substr(trim($tag),-2)=='/>') + { + $buff = $pre.$tag_head.$tag.$tag_tail.$next; + } + else + { + while(false !== $close_pos = strpos($next, '')); + $tag .= $tmp_buff; + $next = substr($next, strlen($tmp_buff)); + + if(substr_count($tag, '<'.$tag_name) == substr_count($tag,'path.substr($target,0,$pos); + } + + return sprintf( + 'compile(\'%s\',\'%s\');%s'. + '?>%s', + "\n", + "\n", + $path, $filename, "\n", + "\n" + ); + } + + /** + * @brief load 태그의 변환 + **/ + function _replaceLoad($matches) { + $output = $matches[0]; + if(!preg_match_all('/ ([^=]+)=\"([^\"]+)\"/is',$matches[0], $m)) return $matches[0]; + + $type = $matches[1]; + for($i=0,$c=count($m[1]);$i<$c;$i++) + { + if(!trim($m[1][$i])) continue; + $attrs[trim($m[1][$i])] = trim($m[2][$i]); + } + + if(!$attrs['target']) return $matches[0]; + + $web_path = $this->web_path; + $base_path = $this->path; + + $target = $attrs['target']; + if(!preg_match('/^(http|https)/i',$target)) + { + if(substr($target,0,2)=='./') $target = substr($target,2); + if(substr($target,0,1)!='/') $target = $web_path.$target; + } + + if(!$attrs['index']) $attrs['index'] = 'null'; + if($attrs['type']!='body') $attrs['type'] = 'head'; + + // if target ends with lang, load language pack + if(substr($target, -4)=='lang') { + if(substr($target,0,2)=='./') $target = substr($target, 2); + $lang_dir = $base_path.$target; + if(is_dir($lang_dir)) $output = sprintf('', $lang_dir); + + // otherwise try to load xml, css, js file + } else { + if(substr($target,0,1)!='/') $source_filename = $base_path.$target; + else $source_filename = $target; + $source_filename = str_replace(array('/./','//'),'/',$source_filename); + + // get filename and path + $tmp_arr = explode("/",$source_filename); + $filename = array_pop($tmp_arr); + + //$base_path = implode("/",$tmp_arr)."/"; + + // get the ext + $tmp_arr = explode(".",$filename); + $ext = strtolower(array_pop($tmp_arr)); + + // according to ext., import the file + switch($ext) { + // xml js filter + case 'xml' : + if(preg_match('/^(http|https)/i',$source_filename)) return; + // create an instance of XmlJSFilter class, then create js and handle Context::addJsFile + $output = sprintf( + 'compile();%s'. + '?>%s', + "\n", + "\n", + dirname($base_path . $attrs['target']).'/', + $filename, + "\n", + "\n", + "\n" + ); + break; + // css file + case 'css' : + if($type == 'unload') { + $output = ''; + } else { + $output = ''; + } + break; + // js file + case 'js' : + if($type == 'unload') { + $output = ''; + } else { + $output = ''; + } + break; + } + } + + return $output; + } + + /** + * @brief $문자 의 PHP 변수 변환 + **/ + function _replaceVarInPHP($buff) { + $head = $tail = ''; + while(false !== $pos = strpos($buff, ''); + $body = substr($buff,0,$pos+2); + $head .= preg_replace_callback('/(.?)\$(\w+[a-z0-9\_\-\[\]\'\"]+)/is',array($this, '_replaceVarString'), $body); + + $buff = substr($buff,$pos+2); + } + return $head.$buff; + } + + + /** + * @brief php5의 class::$변수명의 경우 context를 사용하지 않아야 하기에 함수로 대체 + **/ + function _replaceVarString($matches) + { + if($matches[1]==':') return $matches[0]; + if(substr($matches[2],0,1)=='_') return $matches[0]; + return $matches[1].'$__Context->'.$matches[2]; + } + + /** + * @brief replace with php code + * @param[in] $matches match + * @return replaced result + **/ + function _compileIncludeToCode($matches) { + // if target string to include contains variables handle them + $arg = str_replace(array('"','\''), '', $matches[1]); + if(!$arg) return; + + $tmp_arr = explode("/", $arg); + for($i=0;$ifile), $arg); + $path = substr($this->path,-1)=='/'?substr($this->path,0,-1):$this->path; + $source_filename = sprintf("%s/%s", $path, $arg); + + // step2: check path from root + if(!file_exists($source_filename)) $source_filename = './'.$arg; + if(!file_exists($source_filename)) return; + + // split into path and filename + $tmp_arr = explode('/', $source_filename); + $filename = array_pop($tmp_arr); + $path = implode('/', $tmp_arr).'/'; + + // try to include + $output = sprintf( + 'compile(\'%s\',\'%s\');%s'. + '?>%s', + "\n", + "\n", + $path, $filename, "\n", + "\n" + ); + + return $output; + } + + /** + * @brief replace $... variables in { } with Context::get(...) + * @param[in] $matches match + * @return replaced result in case of success or NULL in case of error + **/ + function _compileVarToContext($matches) { + $str = trim(substr($matches[0],1,strlen($matches[0])-2)); + if(!$str) return $matches[0]; + if(!in_array(substr($str,0,1),array('(','$','\'','"'))) { + if(preg_match('/^([^\( \.]+)(\(| \.)/i',$str,$m)) { + $func = trim($m[1]); + if(strpos($func,'::')===false) { + if(!function_exists($func)) { + return $matches[0]; + } + } else { + list($class, $method) = explode('::',$func); + // FIXME regardless of whether class/func name is case-sensitive, it is safe + // to assume names are case sensitive. We don't have compare twice. + if(!class_exists($class) || !in_array($method, get_class_methods($class))) { + // In some environment, the name of classes and methods may be case-sensitive + list($class, $method) = explode('::',strtolower($func)); + if(!class_exists($class) || !in_array($method, get_class_methods($class))) { + return $matches[0]; + } + } + } + } else { + if(!defined($str)) return $matches[0]; + } + } + return ']+)/i','$__Context->\\1', $str).');?>'; + } + + /** + * @brief replace @... function in { } into print func(..) + * @param[in] $matches match + * @return replaced result + **/ + function _compileVarToSilenceExecute($matches) { + if(strtolower(trim(str_replace(array(';',' '),'', $matches[1])))=='return') return ''; + return ']+)/i','$__Context->\\1', trim($matches[1])).';?>'; + } + + /** + * @brief replace code in with php code + * @param[in] $matches match + * @return changed result + **/ + function _compileFuncToCode($matches) { + static $idx = 0; + $code = trim($matches[1]); + if(!$code) return; + + switch(strtolower($code)) { + case 'else' : + $output = '}else{'; + break; + case 'end' : + case 'endif' : + case 'endfor' : + case 'endforeach' : + case 'endswitch' : + $output = '}'; + break; + case 'break' : + $output = 'break;'; + break; + case 'default' : + $output = 'default :'; + break; + case 'break@default' : + $output = 'break; default :'; + break; + default : + $suffix = '{'; + + if(substr($code, 0, 4) == 'else') { + $code = '}'.$code; + } elseif(substr($code, 0, 7) == 'foreach') { + $tmp_str = substr($code, 8); + $tmp_arr = explode(' ', $tmp_str); + $var_name = $tmp_arr[0]; + $prefix = '$Context->__idx['.$idx.']=0;'; + if(substr($var_name, 0, 1) == '$') { + $prefix .= sprintf('if(count($__Context->%s)) ', substr($var_name, 1)); + } else { + $prefix .= sprintf('if(count(%s)) ', $var_name); + } + $idx++; + $suffix .= '$__idx['.$idx.']=($__idx['.$idx.']+1)%2; $cycle_idx = $__idx['.$idx.']+1;'; + } elseif(substr($code, 0, 4) == 'case') { + $suffix = ':'; + } elseif(substr($code, 0, 10) == 'break@case') { + $code = 'break; case'.substr($code, 10); + $suffix = ':'; + } + $output = preg_replace('/\$([a-zA-Z0-9\_\-]+)/i', '$__Context->\\1', $code.$suffix); + break; + } + + return sprintf('', $prefix, $output); + } + + + /** + * @brief replace xe specific code, "" with appropriate php code + * @param[in] $matches match + * @return Returns modified result or NULL in case of error + **/ + function _compileImportCode($matches) { + // find xml file + $base_path = $this->path; + $given_file = trim($matches[1]); + if(!$given_file) return; + if(isset($matches[3])) $optimized = strtolower(trim($matches[3])); + if(!$optimized) $optimized = 'true'; + if(isset($matches[5])) $media = trim($matches[5]); + if(!$media) $media = 'all'; + if(isset($matches[7])) $targetie = trim($matches[7]); + if(!$targetie) $targetie = ''; + else $optimized = 'false'; + + if(isset($matches[9])) $index = intval($matches[9]); + if(!$index) $index = 'null'; + if(isset($matches[11])) $type = strtolower(trim($matches[11])); + if($type!='body') $type = 'head'; + + // if given_file ends with lang, load language pack + if(substr($given_file, -4)=='lang') { + if(substr($given_file,0,2)=='./') $given_file = substr($given_file, 2); + $lang_dir = $base_path.$given_file; + if(is_dir($lang_dir)) $output = sprintf('', $lang_dir); + + // otherwise try to load xml, css, js file + } else { + if(preg_match('/^(http|https):/i',$given_file)) $source_filename = $given_file; + elseif(substr($given_file,0,1)!='/') $source_filename = sprintf("%s%s",$base_path, $given_file); + else $source_filename = $given_file; + + // get filename and path + $tmp_arr = explode("/",$source_filename); + $filename = array_pop($tmp_arr); + + $base_path = implode("/",$tmp_arr)."/"; + + // get the ext + $tmp_arr = explode(".",$filename); + $ext = strtolower(array_pop($tmp_arr)); + + // according to ext., import the file + switch($ext) { + // xml js filter + case 'xml' : + // create an instance of XmlJSFilter class, then create js and handle Context::addJsFile + $output = sprintf( + 'compile();%s'. + '?>%s', + "\n", + "\n", + $base_path, + $filename, + "\n", + "\n", + "\n" + ); + break; + // css file + case 'css' : + if(preg_match('/^(http|\/)/i',$source_filename)) { + $output = sprintf('', $source_filename, 'false', $media, $targetie, $index); + } else { + $output = sprintf('', $base_path, $filename, $optimized, $media, $targetie, $index); + } + break; + // js file + case 'js' : + if(preg_match('/^(http|\/)/i',$source_filename)) { + $output = sprintf('', $source_filename, 'false', $targetie, $index, $type); + } else { + $output = sprintf('', $base_path, $filename, $optimized, $targetie, $index, $type); + } + break; + } + } + + return $output; + } + + /** + * @brief import javascript plugin + * @param[in] $matches match + * @return result loading the plugin + * @remarks javascript plugin works as optimized = false + **/ + function _compileLoadJavascriptPlugin($matches) { + $base_path = $this->path; + $plugin = trim($matches[1]); + return sprintf('', $plugin); + } + + /** + * @brief remove loading part of css/ js file + * @param[in] $matches match + * @return removed result + **/ + function _compileUnloadCode($matches) { + // find xml file + $base_path = $this->path; + $given_file = trim($matches[1]); + if(!$given_file) return; + if(isset($matches[3])) $optimized = strtolower(trim($matches[3])); + if(!$optimized) $optimized = 'true'; + if(isset($matches[5])) $media = trim($matches[5]); + if(!$media) $media = 'all'; + if(isset($matches[7])) $targetie = trim($matches[7]); + if(!$targetie) $targetie = ''; + else $optimized = 'false'; + + if(substr($given_file,0,1)!='/') $source_filename = sprintf("%s%s",$base_path, $given_file); + else $source_filename = $given_file; + + // get path and file nam + $tmp_arr = explode("/",$source_filename); + $filename = array_pop($tmp_arr); + + $base_path = implode("/",$tmp_arr)."/"; + + // get an ext. + $tmp_arr = explode(".",$filename); + $ext = strtolower(array_pop($tmp_arr)); + + switch($ext) { + // css file + case 'css' : + if(preg_match('/^(http|https|\/)/i',$source_filename)) { + $output = sprintf('', $source_filename, 'false', $media, $targetie); + } else { + $output = sprintf('', $base_path, $filename, $optimized, $media, $targetie); + } + break; + // js file + case 'js' : + if(preg_match('/^(http|https|\/)/i',$source_filename)) { + $output = sprintf('', $source_filename, 'false', $targetie); + } else { + $output = sprintf('', $base_path, $filename, $optimized, $targetie); + } + break; + } + + return $output; + } + } +?> diff --git a/classes/widget/WidgetHandler.class.php b/classes/widget/WidgetHandler.class.php index c35e4a188..8acf4abb4 100644 --- a/classes/widget/WidgetHandler.class.php +++ b/classes/widget/WidgetHandler.class.php @@ -1,14 +1,14 @@ - + diff --git a/classes/xml/GeneralXmlParser.class.php b/classes/xml/GeneralXmlParser.class.php index 18b938ab0..becf581d4 100644 --- a/classes/xml/GeneralXmlParser.class.php +++ b/classes/xml/GeneralXmlParser.class.php @@ -1,83 +1,83 @@ -output)) return; - $this->output = array_shift($this->output); - - return $this->output; - } - - /** - * @brief start element handler - * @param[in] $parse an instance of parser - * @param[in] $node_name a name of node - * @param[in] $attrs attributes to be set - */ - function _tagOpen($parser, $node_name, $attrs) { - $obj->node_name = strtolower($node_name); - $obj->attrs = $attrs; - $obj->childNodes = array(); - - array_push($this->output, $obj); - } - - /** - * @brief character data handler - * variable in the last element of this->output - * @param[in] $parse an instance of parser - * @param[in] $body a data to be added - */ - function _tagBody($parser, $body) { - //if(!trim($body)) return; - $this->output[count($this->output)-1]->body .= $body; - } - - - /** - * @brief end element handler - * @param[in] $parse an instance of parser - * @param[in] $node_name name of xml node - */ - function _tagClosed($parser, $node_name) { - $node_name = strtolower($node_name); - $cur_obj = array_pop($this->output); - $parent_obj = &$this->output[count($this->output)-1]; - - if($parent_obj->childNodes[$node_name]) - { - $tmp_obj = $parent_obj->childNodes[$node_name]; - if(is_array($tmp_obj)) { - array_push($parent_obj->childNodes[$node_name], $cur_obj); - } else { - $parent_obj->childNodes[$node_name] = array(); - array_push($parent_obj->childNodes[$node_name], $tmp_obj); - array_push($parent_obj->childNodes[$node_name], $cur_obj); - } - } else { - $parent_obj->childNodes[$node_name] = $cur_obj; - } - } - - } -?> +output)) return; + $this->output = array_shift($this->output); + + return $this->output; + } + + /** + * @brief start element handler + * @param[in] $parse an instance of parser + * @param[in] $node_name a name of node + * @param[in] $attrs attributes to be set + */ + function _tagOpen($parser, $node_name, $attrs) { + $obj->node_name = strtolower($node_name); + $obj->attrs = $attrs; + $obj->childNodes = array(); + + array_push($this->output, $obj); + } + + /** + * @brief character data handler + * variable in the last element of this->output + * @param[in] $parse an instance of parser + * @param[in] $body a data to be added + */ + function _tagBody($parser, $body) { + //if(!trim($body)) return; + $this->output[count($this->output)-1]->body .= $body; + } + + + /** + * @brief end element handler + * @param[in] $parse an instance of parser + * @param[in] $node_name name of xml node + */ + function _tagClosed($parser, $node_name) { + $node_name = strtolower($node_name); + $cur_obj = array_pop($this->output); + $parent_obj = &$this->output[count($this->output)-1]; + + if($parent_obj->childNodes[$node_name]) + { + $tmp_obj = $parent_obj->childNodes[$node_name]; + if(is_array($tmp_obj)) { + array_push($parent_obj->childNodes[$node_name], $cur_obj); + } else { + $parent_obj->childNodes[$node_name] = array(); + array_push($parent_obj->childNodes[$node_name], $tmp_obj); + array_push($parent_obj->childNodes[$node_name], $cur_obj); + } + } else { + $parent_obj->childNodes[$node_name] = $cur_obj; + } + } + + } +?> diff --git a/classes/xml/XmlJsFilter.class.php b/classes/xml/XmlJsFilter.class.php index a97a8eceb..10fb03246 100644 --- a/classes/xml/XmlJsFilter.class.php +++ b/classes/xml/XmlJsFilter.class.php @@ -1,290 +1,290 @@ - - *
<-- code to validate data in the form - * - * - * <-- 폼 항목을 조합하여 key=val 의 js array로 return, act는 필수 - * - * - * <-- 서버에 ajax로 전송하여 받을 결과값 - * <-- error이름의 결과값을 받겠다는 것 - * - * - * } - * - * @detail { - * - syntax description of
node - * target = name of for element - * required = flag indicating whether a field is mandatory or not - * minlength, maxlength = mininum, maxinum length of string allowed for the field - * filter = name of filter to be used for javascript validation. Following is the description of filter available - * 1) email : validate the confirmance of the value against an email format - * 2) userid : validate the confirmance of the value against the format of user id. (combination of number[0-9],alphabet(lower case) and '_', underscore starting with an alphatic character) - * 3) alpha : check if the value is consists of alphabatic characters. - * 4) number : check if the value is consists of numerical digits - * 5) equalto = target : indicate that values in the form should be equal to those in target - * 6) pattern_id/regex pattern/[i] : check the value using custom regular expression. - * - * - parameter - param - * name = key : indicate that a new array, 'key' will be created and a value will be assigned to it - * target = target_name : target form element의 값을 가져옴 - * - * - response - * tag = key : name of variable that will contain the result of the execution - * } - **/ - - class XmlJsFilter extends XmlParser { - var $version = '0.2.5'; - var $compiled_path = './files/cache/js_filter_compiled/'; ///< 컴파일된 캐시 파일이 놓일 위치 - var $xml_file = NULL; ///< 대상 xml 파일 - var $js_file = NULL; ///< 컴파일된 js 파일 - - /** - * @brief constructor - **/ - function XmlJsFilter($path, $xml_file) { - if(substr($path,-1)!=='/') $path .= '/'; - $this->xml_file = sprintf("%s%s",$path, $xml_file); - $this->js_file = $this->_getCompiledFileName($this->xml_file); - } - - /** - * @brief compile a xml_file only when a corresponding js file does not exists or is outdated - * @return Returns NULL regardless of the success of failure of the operation - **/ - function compile() { - if(!file_exists($this->xml_file)) return; - if(!file_exists($this->js_file)) $this->_compile(); - else if(filemtime($this->xml_file)>filemtime($this->js_file)) $this->_compile(); - Context::addJsFile($this->js_file, false, '',null,'body'); - } - - /** - * @brief compile a xml_file into js_file - **/ - function _compile() { - global $lang; - - // xml 파일을 읽음 - $buff = FileHandler::readFile($this->xml_file); - - // xml parsing - $xml_obj = parent::parse($buff); - - $attrs = $xml_obj->filter->attrs; - $rules = $xml_obj->filter->rules; - - // XmlJsFilter는 filter_name, field, parameter 3개의 데이터를 핸들링 - $filter_name = $attrs->name; - $confirm_msg_code = $attrs->confirm_msg_code; - $module = $attrs->module; - $act = $attrs->act; - $extend_filter = $attrs->extend_filter; - - - $field_node = $xml_obj->filter->form->node; - if($field_node && !is_array($field_node)) $field_node = array($field_node); - - $parameter_param = $xml_obj->filter->parameter->param; - if($parameter_param && !is_array($parameter_param)) $parameter_param = array($parameter_param); - - $response_tag = $xml_obj->filter->response->tag; - if($response_tag && !is_array($response_tag)) $response_tag = array($response_tag); - - // extend_filter가 있을 경우 해당 method를 호출하여 결과를 받음 - if($extend_filter) { - - // extend_filter가 있을 경우 캐시 사용을 못하도록 js 캐시 파일명을 변경 - $this->js_file .= '.nocache.js'; - - // extend_filter는 module.method 로 지칭되어 이를 분리 - list($module_name, $method) = explode('.',$extend_filter); - - // 모듈 이름과 method가 있을 경우 진행 - if($module_name&&$method) { - // 해당 module의 model 객체를 받음 - $oExtendFilter = &getModel($module_name); - - // method가 존재하면 실행 - if(method_exists($oExtendFilter, $method)) { - // 결과를 받음 - $extend_filter_list = $oExtendFilter->{$method}(true); - $extend_filter_count = count($extend_filter_list); - - // 결과에서 lang값을 이용 문서 변수에 적용 - for($i=0; $i < $extend_filter_count; $i++) { - $name = $extend_filter_list[$i]->name; - $lang_value = $extend_filter_list[$i]->lang; - if($lang_value) $lang->{$name} = $lang_value; - } - } - - } - } - - // 언어 입력을 위한 사용되는 필드 조사 - $target_list = array(); - $target_type_list = array(); - - // javascript contents - $js_rules = array(); - $js_messages = array(); - - $fields = array(); - - // create custom rule - if ($rules && $rules->rule) { - if (!is_array($rules->rule)) $rules->rule = array($rules->rule); - foreach($rules->rule as $r) { - if ($r->attrs->type == 'regex') { - $js_rules[] = "v.cast('ADD_RULE', ['{$r->attrs->name}', {$r->body}]);"; - } - } - } - - // field, 즉 체크항목의 script 생성 - $node_count = count($field_node); - if($node_count) { - foreach($field_node as $key =>$node) { - $attrs = $node->attrs; - $target = trim($attrs->target); - - if(!$target) continue; - - $rule = trim($attrs->rule?$attrs->rule:$attrs->filter); - $equalto = trim($attrs->equalto); - - $field = array(); - - if($attrs->required == 'true') $field[] = 'required:true'; - if($attrs->minlength > 0) $field[] = 'minlength:'.$attrs->minlength; - if($attrs->maxlength > 0) $field[] = 'maxlength:'.$attrs->maxlength; - if($equalto) $field[] = "equalto:'{$attrs->equalto}'"; - if($rule) $field[] = "rule:'{$rule}'"; - - $fields[] = "'{$target}': {".implode(',', $field)."}"; - - if(!in_array($target, $target_list)) $target_list[] = $target; - if(!$target_type_list[$target]) $target_type_list[$target] = $filter; - } - } - - // extend_filter_item 체크 - $rule_types = array('homepage'=>'homepage', 'email_address'=>'email'); - - for($i=0;$i<$extend_filter_count;$i++) { - $filter_item = $extend_filter_list[$i]; - $target = trim($filter_item->name); - - if(!$target) continue; - - // extend filter item의 type으로 rule을 구함 - $type = $filter_item->type; - $rule = $rule_types[$type]?$rule_types[$type]:''; - $required = ($filter_item->required == 'true'); - - $field = array(); - if($required) $field[] = 'required:true'; - if($rule) $field[] = "rule:'{$rule}'"; - $fields[] = "\t\t'{$target}' : {".implode(',', $field)."}"; - - if(!in_array($target, $target_list)) $target_list[] = $target; - if(!$target_type_list[$target]) $target_type_list[$target] = $type; - } - - // 데이터를 만들기 위한 parameter script 생성 - $rename_params = array(); - $parameter_count = count($parameter_param); - if($parameter_count) { - // 기본 필터 내용의 parameter로 구성 - foreach($parameter_param as $key =>$param) { - $attrs = $param->attrs; - $name = trim($attrs->name); - $target = trim($attrs->target); - - //if($name && $target && ($name != $target)) $js_doc[] = "\t\tparams['{$name}'] = params['{$target}']; delete params['{$target}'];"; - if($name && $target && ($name != $target)) $rename_params[] = "'{$target}':'{$name}'"; - if($name && !in_array($name, $target_list)) $target_list[] = $name; - } - - // extend_filter_item 체크 - for($i=0;$i<$extend_filter_count;$i++) { - $filter_item = $extend_filter_list[$i]; - $target = $name = trim($filter_item->name); - if(!$name || !$target) continue; - - if(!in_array($name, $target_list)) $target_list[] = $name; - } - } - - // response script 생성 - $response_count = count($response_tag); - $responses = array(); - for($i=0;$i<$response_count;$i++) { - $attrs = $response_tag[$i]->attrs; - $name = $attrs->name; - $responses[] = "'{$name}'"; - } - - // lang : form field description - $target_count = count($target_list); - for($i=0;$i<$target_count;$i++) { - $target = $target_list[$i]; - if(!$lang->{$target}) $lang->{$target} = $target; - $js_messages[] = sprintf("v.cast('ADD_MESSAGE',['%s','%s']);", $target, addslashes($lang->{$target})); - } - - // target type을 기록 - /* - $target_type_count = count($target_type_list); - if($target_type_count) { - foreach($target_type_list as $target => $type) { - //$js_doc .= sprintf("target_type_list[\"%s\"] = \"%s\";\n", $target, $type); - } - } - */ - - // lang : error message - foreach($lang->filter as $key => $val) { - if(!$val) $val = $key; - $js_messages[] = sprintf("v.cast('ADD_MESSAGE',['%s','%s']);", $key, $val); - } - - $callback_func = $xml_obj->filter->response->attrs->callback_func; - if(!$callback_func) $callback_func = "filterAlertMessage"; - - $confirm_msg = ''; - if ($confirm_msg_code) $confirm_msg = $lang->{$confirm_msg_code}; - - $jsdoc = array(); - $jsdoc[] = "function {$filter_name}(form){ return legacy_filter('{$filter_name}', form, '{$module}', '{$act}', {$callback_func}, [".implode(',', $responses)."], '".addslashes($confirm_msg)."', {".implode(',', $rename_params)."}) };"; - $jsdoc[] = '(function($){'; - $jsdoc[] = "\tvar v=xe.getApp('validator')[0];if(!v)return false;"; - $jsdoc[] = "\t".'v.cast("ADD_FILTER", ["'.$filter_name.'", {'.implode(',', $fields).'}]);'; - $jsdoc[] = "\t".implode("\n\t", $js_rules); - $jsdoc[] = "\t".implode("\n\t", $js_messages); - $jsdoc[] = '})(jQuery);'; - $jsdoc = implode("\n", $jsdoc); - - // js파일 생성 - FileHandler::writeFile($this->js_file, $jsdoc); - } - - /** - * @brief return a file name of js file corresponding to the xml file - **/ - function _getCompiledFileName($xml_file) { - return sprintf('%s%s.%s.compiled.js',$this->compiled_path, md5($this->version.$xml_file),Context::getLangType()); - } - } -?> + + * <-- code to validate data in the form + * + * + * <-- 폼 항목을 조합하여 key=val 의 js array로 return, act는 필수 + * + * + * <-- 서버에 ajax로 전송하여 받을 결과값 + * <-- error이름의 결과값을 받겠다는 것 + * + * + * } + * + * @detail { + * - syntax description of
node + * target = name of for element + * required = flag indicating whether a field is mandatory or not + * minlength, maxlength = mininum, maxinum length of string allowed for the field + * filter = name of filter to be used for javascript validation. Following is the description of filter available + * 1) email : validate the confirmance of the value against an email format + * 2) userid : validate the confirmance of the value against the format of user id. (combination of number[0-9],alphabet(lower case) and '_', underscore starting with an alphatic character) + * 3) alpha : check if the value is consists of alphabatic characters. + * 4) number : check if the value is consists of numerical digits + * 5) equalto = target : indicate that values in the form should be equal to those in target + * 6) pattern_id/regex pattern/[i] : check the value using custom regular expression. + * + * - parameter - param + * name = key : indicate that a new array, 'key' will be created and a value will be assigned to it + * target = target_name : target form element의 값을 가져옴 + * + * - response + * tag = key : name of variable that will contain the result of the execution + * } + **/ + + class XmlJsFilter extends XmlParser { + var $version = '0.2.5'; + var $compiled_path = './files/cache/js_filter_compiled/'; ///< 컴파일된 캐시 파일이 놓일 위치 + var $xml_file = NULL; ///< 대상 xml 파일 + var $js_file = NULL; ///< 컴파일된 js 파일 + + /** + * @brief constructor + **/ + function XmlJsFilter($path, $xml_file) { + if(substr($path,-1)!=='/') $path .= '/'; + $this->xml_file = sprintf("%s%s",$path, $xml_file); + $this->js_file = $this->_getCompiledFileName($this->xml_file); + } + + /** + * @brief compile a xml_file only when a corresponding js file does not exists or is outdated + * @return Returns NULL regardless of the success of failure of the operation + **/ + function compile() { + if(!file_exists($this->xml_file)) return; + if(!file_exists($this->js_file)) $this->_compile(); + else if(filemtime($this->xml_file)>filemtime($this->js_file)) $this->_compile(); + Context::addJsFile($this->js_file, false, '',null,'body'); + } + + /** + * @brief compile a xml_file into js_file + **/ + function _compile() { + global $lang; + + // xml 파일을 읽음 + $buff = FileHandler::readFile($this->xml_file); + + // xml parsing + $xml_obj = parent::parse($buff); + + $attrs = $xml_obj->filter->attrs; + $rules = $xml_obj->filter->rules; + + // XmlJsFilter는 filter_name, field, parameter 3개의 데이터를 핸들링 + $filter_name = $attrs->name; + $confirm_msg_code = $attrs->confirm_msg_code; + $module = $attrs->module; + $act = $attrs->act; + $extend_filter = $attrs->extend_filter; + + + $field_node = $xml_obj->filter->form->node; + if($field_node && !is_array($field_node)) $field_node = array($field_node); + + $parameter_param = $xml_obj->filter->parameter->param; + if($parameter_param && !is_array($parameter_param)) $parameter_param = array($parameter_param); + + $response_tag = $xml_obj->filter->response->tag; + if($response_tag && !is_array($response_tag)) $response_tag = array($response_tag); + + // extend_filter가 있을 경우 해당 method를 호출하여 결과를 받음 + if($extend_filter) { + + // extend_filter가 있을 경우 캐시 사용을 못하도록 js 캐시 파일명을 변경 + $this->js_file .= '.nocache.js'; + + // extend_filter는 module.method 로 지칭되어 이를 분리 + list($module_name, $method) = explode('.',$extend_filter); + + // 모듈 이름과 method가 있을 경우 진행 + if($module_name&&$method) { + // 해당 module의 model 객체를 받음 + $oExtendFilter = &getModel($module_name); + + // method가 존재하면 실행 + if(method_exists($oExtendFilter, $method)) { + // 결과를 받음 + $extend_filter_list = $oExtendFilter->{$method}(true); + $extend_filter_count = count($extend_filter_list); + + // 결과에서 lang값을 이용 문서 변수에 적용 + for($i=0; $i < $extend_filter_count; $i++) { + $name = $extend_filter_list[$i]->name; + $lang_value = $extend_filter_list[$i]->lang; + if($lang_value) $lang->{$name} = $lang_value; + } + } + + } + } + + // 언어 입력을 위한 사용되는 필드 조사 + $target_list = array(); + $target_type_list = array(); + + // javascript contents + $js_rules = array(); + $js_messages = array(); + + $fields = array(); + + // create custom rule + if ($rules && $rules->rule) { + if (!is_array($rules->rule)) $rules->rule = array($rules->rule); + foreach($rules->rule as $r) { + if ($r->attrs->type == 'regex') { + $js_rules[] = "v.cast('ADD_RULE', ['{$r->attrs->name}', {$r->body}]);"; + } + } + } + + // field, 즉 체크항목의 script 생성 + $node_count = count($field_node); + if($node_count) { + foreach($field_node as $key =>$node) { + $attrs = $node->attrs; + $target = trim($attrs->target); + + if(!$target) continue; + + $rule = trim($attrs->rule?$attrs->rule:$attrs->filter); + $equalto = trim($attrs->equalto); + + $field = array(); + + if($attrs->required == 'true') $field[] = 'required:true'; + if($attrs->minlength > 0) $field[] = 'minlength:'.$attrs->minlength; + if($attrs->maxlength > 0) $field[] = 'maxlength:'.$attrs->maxlength; + if($equalto) $field[] = "equalto:'{$attrs->equalto}'"; + if($rule) $field[] = "rule:'{$rule}'"; + + $fields[] = "'{$target}': {".implode(',', $field)."}"; + + if(!in_array($target, $target_list)) $target_list[] = $target; + if(!$target_type_list[$target]) $target_type_list[$target] = $filter; + } + } + + // extend_filter_item 체크 + $rule_types = array('homepage'=>'homepage', 'email_address'=>'email'); + + for($i=0;$i<$extend_filter_count;$i++) { + $filter_item = $extend_filter_list[$i]; + $target = trim($filter_item->name); + + if(!$target) continue; + + // extend filter item의 type으로 rule을 구함 + $type = $filter_item->type; + $rule = $rule_types[$type]?$rule_types[$type]:''; + $required = ($filter_item->required == 'true'); + + $field = array(); + if($required) $field[] = 'required:true'; + if($rule) $field[] = "rule:'{$rule}'"; + $fields[] = "\t\t'{$target}' : {".implode(',', $field)."}"; + + if(!in_array($target, $target_list)) $target_list[] = $target; + if(!$target_type_list[$target]) $target_type_list[$target] = $type; + } + + // 데이터를 만들기 위한 parameter script 생성 + $rename_params = array(); + $parameter_count = count($parameter_param); + if($parameter_count) { + // 기본 필터 내용의 parameter로 구성 + foreach($parameter_param as $key =>$param) { + $attrs = $param->attrs; + $name = trim($attrs->name); + $target = trim($attrs->target); + + //if($name && $target && ($name != $target)) $js_doc[] = "\t\tparams['{$name}'] = params['{$target}']; delete params['{$target}'];"; + if($name && $target && ($name != $target)) $rename_params[] = "'{$target}':'{$name}'"; + if($name && !in_array($name, $target_list)) $target_list[] = $name; + } + + // extend_filter_item 체크 + for($i=0;$i<$extend_filter_count;$i++) { + $filter_item = $extend_filter_list[$i]; + $target = $name = trim($filter_item->name); + if(!$name || !$target) continue; + + if(!in_array($name, $target_list)) $target_list[] = $name; + } + } + + // response script 생성 + $response_count = count($response_tag); + $responses = array(); + for($i=0;$i<$response_count;$i++) { + $attrs = $response_tag[$i]->attrs; + $name = $attrs->name; + $responses[] = "'{$name}'"; + } + + // lang : form field description + $target_count = count($target_list); + for($i=0;$i<$target_count;$i++) { + $target = $target_list[$i]; + if(!$lang->{$target}) $lang->{$target} = $target; + $js_messages[] = sprintf("v.cast('ADD_MESSAGE',['%s','%s']);", $target, addslashes($lang->{$target})); + } + + // target type을 기록 + /* + $target_type_count = count($target_type_list); + if($target_type_count) { + foreach($target_type_list as $target => $type) { + //$js_doc .= sprintf("target_type_list[\"%s\"] = \"%s\";\n", $target, $type); + } + } + */ + + // lang : error message + foreach($lang->filter as $key => $val) { + if(!$val) $val = $key; + $js_messages[] = sprintf("v.cast('ADD_MESSAGE',['%s','%s']);", $key, $val); + } + + $callback_func = $xml_obj->filter->response->attrs->callback_func; + if(!$callback_func) $callback_func = "filterAlertMessage"; + + $confirm_msg = ''; + if ($confirm_msg_code) $confirm_msg = $lang->{$confirm_msg_code}; + + $jsdoc = array(); + $jsdoc[] = "function {$filter_name}(form){ return legacy_filter('{$filter_name}', form, '{$module}', '{$act}', {$callback_func}, [".implode(',', $responses)."], '".addslashes($confirm_msg)."', {".implode(',', $rename_params)."}) };"; + $jsdoc[] = '(function($){'; + $jsdoc[] = "\tvar v=xe.getApp('validator')[0];if(!v)return false;"; + $jsdoc[] = "\t".'v.cast("ADD_FILTER", ["'.$filter_name.'", {'.implode(',', $fields).'}]);'; + $jsdoc[] = "\t".implode("\n\t", $js_rules); + $jsdoc[] = "\t".implode("\n\t", $js_messages); + $jsdoc[] = '})(jQuery);'; + $jsdoc = implode("\n", $jsdoc); + + // js파일 생성 + FileHandler::writeFile($this->js_file, $jsdoc); + } + + /** + * @brief return a file name of js file corresponding to the xml file + **/ + function _getCompiledFileName($xml_file) { + return sprintf('%s%s.%s.compiled.js',$this->compiled_path, md5($this->version.$xml_file),Context::getLangType()); + } + } +?> diff --git a/classes/xml/XmlParser.class.php b/classes/xml/XmlParser.class.php index 4e68a2abf..04469a3a1 100644 --- a/classes/xml/XmlParser.class.php +++ b/classes/xml/XmlParser.class.php @@ -1,154 +1,154 @@ -parse($buff); - } - - /** - * @brief parse xml data to extract values from it and construct data object - * @param[in] a data buffer containing xml data - * @return Returns a resultant data object or NULL in case of error - **/ - function parse($input = '') { - // 디버그를 위한 컴파일 시작 시간 저장 - if(__DEBUG__==3) $start = getMicroTime(); - - $this->lang = Context::getLangType(); - - $this->input = $input?$input:$GLOBALS['HTTP_RAW_POST_DATA']; - $this->input = str_replace(array('',''),array('',''),$this->input); - - // 지원언어 종류를 뽑음 - preg_match_all("/xml:lang=\"([^\"].+)\"/i", $this->input, $matches); - - // xml:lang이 쓰였을 경우 지원하는 언어종류를 뽑음 - if(count($matches[1]) && $supported_lang = array_unique($matches[1])) { - // supported_lang에 현재 접속자의 lang이 없으면 en이 있는지 확인하여 en이 있으면 en을 기본, 아니면 첫번째것을.. - if(!in_array($this->lang, $supported_lang)) { - if(in_array('en', $supported_lang)) { - $this->lang = 'en'; - } else { - $this->lang = array_shift($supported_lang); - } - } - // 특별한 언어가 지정되지 않았다면 언어체크를 하지 않음 - } else { - unset($this->lang); - } - - $this->oParser = xml_parser_create('UTF-8'); - - xml_set_object($this->oParser, $this); - xml_set_element_handler($this->oParser, "_tagOpen", "_tagClosed"); - xml_set_character_data_handler($this->oParser, "_tagBody"); - - xml_parse($this->oParser, $this->input); - xml_parser_free($this->oParser); - - if(!count($this->output)) return; - - $output = array_shift($this->output); - - // 디버그를 위한 컴파일 시작 시간 저장 - if(__DEBUG__==3) $GLOBALS['__xmlparse_elapsed__'] += getMicroTime() - $start; - - return $output; - } - - - /** - * @brief start element handler. - * @param[in] $parse an instance of parser - * @param[in] $node_name a name of node - * @param[in] $attrs attributes to be set - */ - function _tagOpen($parser, $node_name, $attrs) { - $obj->node_name = strtolower($node_name); - $obj->attrs = $this->_arrToObj($attrs); - - array_push($this->output, $obj); - } - - - /** - * @brief character data handler - * variable in the last element of this->output - * @param[in] $parse an instance of parser - * @param[in] $body a data to be added - * @remark the first parameter, $parser ought to be remove since it is not used. - */ - function _tagBody($parser, $body) { - //if(!trim($body)) return; - $this->output[count($this->output)-1]->body .= $body; - } - - /** - * @brief end element handler - * @param[in] $parse an instance of parser - * @param[in] $node_name name of xml node - */ - function _tagClosed($parser, $node_name) { - $node_name = strtolower($node_name); - $cur_obj = array_pop($this->output); - $parent_obj = &$this->output[count($this->output)-1]; - if($this->lang&&$cur_obj->attrs->{'xml:lang'}&&$cur_obj->attrs->{'xml:lang'}!=$this->lang) return; - if($this->lang&&$parent_obj->{$node_name}->attrs->{'xml:lang'}&&$parent_obj->{$node_name}->attrs->{'xml:lang'}!=$this->lang) return; - - if($parent_obj->{$node_name}) { - $tmp_obj = $parent_obj->{$node_name}; - if(is_array($tmp_obj)) { - array_push($parent_obj->{$node_name}, $cur_obj); - } else { - $parent_obj->{$node_name} = array(); - array_push($parent_obj->{$node_name}, $tmp_obj); - array_push($parent_obj->{$node_name}, $cur_obj); - } - } else { - $parent_obj->{$node_name} = $cur_obj; - } - } - - /** - * @brief method to transfer values in an array to a data object - * @param[in] $arr data array - **/ - function _arrToObj($arr) { - if(!count($arr)) return; - foreach($arr as $key => $val) { - $key = strtolower($key); - $output->{$key} = $val; - } - return $output; - } - } -?> +parse($buff); + } + + /** + * @brief parse xml data to extract values from it and construct data object + * @param[in] a data buffer containing xml data + * @return Returns a resultant data object or NULL in case of error + **/ + function parse($input = '') { + // 디버그를 위한 컴파일 시작 시간 저장 + if(__DEBUG__==3) $start = getMicroTime(); + + $this->lang = Context::getLangType(); + + $this->input = $input?$input:$GLOBALS['HTTP_RAW_POST_DATA']; + $this->input = str_replace(array('',''),array('',''),$this->input); + + // 지원언어 종류를 뽑음 + preg_match_all("/xml:lang=\"([^\"].+)\"/i", $this->input, $matches); + + // xml:lang이 쓰였을 경우 지원하는 언어종류를 뽑음 + if(count($matches[1]) && $supported_lang = array_unique($matches[1])) { + // supported_lang에 현재 접속자의 lang이 없으면 en이 있는지 확인하여 en이 있으면 en을 기본, 아니면 첫번째것을.. + if(!in_array($this->lang, $supported_lang)) { + if(in_array('en', $supported_lang)) { + $this->lang = 'en'; + } else { + $this->lang = array_shift($supported_lang); + } + } + // 특별한 언어가 지정되지 않았다면 언어체크를 하지 않음 + } else { + unset($this->lang); + } + + $this->oParser = xml_parser_create('UTF-8'); + + xml_set_object($this->oParser, $this); + xml_set_element_handler($this->oParser, "_tagOpen", "_tagClosed"); + xml_set_character_data_handler($this->oParser, "_tagBody"); + + xml_parse($this->oParser, $this->input); + xml_parser_free($this->oParser); + + if(!count($this->output)) return; + + $output = array_shift($this->output); + + // 디버그를 위한 컴파일 시작 시간 저장 + if(__DEBUG__==3) $GLOBALS['__xmlparse_elapsed__'] += getMicroTime() - $start; + + return $output; + } + + + /** + * @brief start element handler. + * @param[in] $parse an instance of parser + * @param[in] $node_name a name of node + * @param[in] $attrs attributes to be set + */ + function _tagOpen($parser, $node_name, $attrs) { + $obj->node_name = strtolower($node_name); + $obj->attrs = $this->_arrToObj($attrs); + + array_push($this->output, $obj); + } + + + /** + * @brief character data handler + * variable in the last element of this->output + * @param[in] $parse an instance of parser + * @param[in] $body a data to be added + * @remark the first parameter, $parser ought to be remove since it is not used. + */ + function _tagBody($parser, $body) { + //if(!trim($body)) return; + $this->output[count($this->output)-1]->body .= $body; + } + + /** + * @brief end element handler + * @param[in] $parse an instance of parser + * @param[in] $node_name name of xml node + */ + function _tagClosed($parser, $node_name) { + $node_name = strtolower($node_name); + $cur_obj = array_pop($this->output); + $parent_obj = &$this->output[count($this->output)-1]; + if($this->lang&&$cur_obj->attrs->{'xml:lang'}&&$cur_obj->attrs->{'xml:lang'}!=$this->lang) return; + if($this->lang&&$parent_obj->{$node_name}->attrs->{'xml:lang'}&&$parent_obj->{$node_name}->attrs->{'xml:lang'}!=$this->lang) return; + + if($parent_obj->{$node_name}) { + $tmp_obj = $parent_obj->{$node_name}; + if(is_array($tmp_obj)) { + array_push($parent_obj->{$node_name}, $cur_obj); + } else { + $parent_obj->{$node_name} = array(); + array_push($parent_obj->{$node_name}, $tmp_obj); + array_push($parent_obj->{$node_name}, $cur_obj); + } + } else { + $parent_obj->{$node_name} = $cur_obj; + } + } + + /** + * @brief method to transfer values in an array to a data object + * @param[in] $arr data array + **/ + function _arrToObj($arr) { + if(!count($arr)) return; + foreach($arr as $key => $val) { + $key = strtolower($key); + $output->{$key} = $val; + } + return $output; + } + } +?> diff --git a/classes/xml/XmlQueryParser.class.php b/classes/xml/XmlQueryParser.class.php index 15cccc026..cd474162e 100644 --- a/classes/xml/XmlQueryParser.class.php +++ b/classes/xml/XmlQueryParser.class.php @@ -1,542 +1,542 @@ -query->attrs->action); - if(!$action) return; - - // 테이블 정리 (배열코드로 변환) - $tables = $xml_obj->query->tables->table; - $output->left_tables = array(); - - $left_conditions = array(); - - if(!$tables) return; - if(!is_array($tables)) $tables = array($tables); - foreach($tables as $key => $val) { - - // 테이블과 alias의 이름을 구함 - $table_name = $val->attrs->name; - $alias = $val->attrs->alias; - if(!$alias) $alias = $table_name; - - $output->tables[$alias] = $table_name; - - if(in_array($val->attrs->type,array('left join','left outer join','right join','right outer join')) && count($val->conditions)){ - $output->left_tables[$alias] = $val->attrs->type; - $left_conditions[$alias] = $val->conditions; - } - - // 테이블을 찾아서 컬럼의 속성을 구함 - $table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $module, $table_name); - if(!file_exists($table_file)) { - $searched_list = FileHandler::readDir(_XE_PATH_.'modules'); - $searched_count = count($searched_list); - for($i=0;$i<$searched_count;$i++) { - $table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $searched_list[$i], $table_name); - if(file_exists($table_file)) break; - } - } - - if(file_exists($table_file)) { - $table_xml = FileHandler::readFile($table_file); - $table_obj = parent::parse($table_xml); - if($table_obj->table) { - if(isset($table_obj->table->column) && !is_array($table_obj->table->column)) - { - $table_obj->table->column = array($table_obj->table->column); - } - - foreach($table_obj->table->column as $k => $v) { - $buff .= sprintf('$output->column_type["%s"] = "%s";%s', $v->attrs->name, $v->attrs->type, "\n"); - } - } - } - } - - - // 컬럼 정리 - $columns = $xml_obj->query->columns->column; - $out = $this->_setColumn($columns); - $output->columns = $out->columns; - - $conditions = $xml_obj->query->conditions; - $out = $this->_setConditions($conditions); - $output->conditions = $out->conditions; - - foreach($output->left_tables as $key => $val){ - if($left_conditions[$key]){ - $out = $this->_setConditions($left_conditions[$key]); - $output->left_conditions[$key] = $out->conditions; - } - } - - $group_list = $xml_obj->query->groups->group; - $out = $this->_setGroup($group_list); - $output->groups = $out->groups; - - // 네비게이션 정리 - $out = $this->_setNavigation($xml_obj); - $output->order = $out->order; - $output->list_count = $out->list_count; - $output->page_count = $out->page_count; - $output->page = $out->page; - - $column_count = count($output->columns); - $condition_count = count($output->conditions); - - $buff .= '$output->tables = array( '; - foreach($output->tables as $key => $val) { - if(!array_key_exists($key,$output->left_tables)){ - $buff .= sprintf('"%s"=>"%s",', $key, $val); - } - } - $buff .= ' );'."\n"; - - // php script 생성 - $buff .= '$output->_tables = array( '; - foreach($output->tables as $key => $val) { - $buff .= sprintf('"%s"=>"%s",', $key, $val); - } - $buff .= ' );'."\n"; - - if(count($output->left_tables)){ - $buff .= '$output->left_tables = array( '; - foreach($output->left_tables as $key => $val) { - $buff .= sprintf('"%s"=>"%s",', $key, $val); - } - $buff .= ' );'."\n"; - } - - // column 정리 - if($column_count) { - $buff .= '$output->columns = array ( '; - $buff .= $this->_getColumn($output->columns); - $buff .= ' );'."\n"; - } - - // conditions 정리 - if($condition_count) { - $buff .= '$output->conditions = array ( '; - $buff .= $this->_getConditions($output->conditions); - $buff .= ' );'."\n"; - } - - // conditions 정리 - if(count($output->left_conditions)) { - $buff .= '$output->left_conditions = array ( '; - foreach($output->left_conditions as $key => $val){ - $buff .= "'{$key}' => array ( "; - $buff .= $this->_getConditions($val); - $buff .= "),\n"; - } - $buff .= ' );'."\n"; - } - - // args 변수 확인 - $arg_list = $this->getArguments(); - if($arg_list) - { - foreach($arg_list as $arg) - { - $pre_buff .= 'if(is_object($args->'.$arg.')){ $args->'.$arg.' = array_values(get_method_vars($args->'.$arg.')); }'. "\n"; - $pre_buff .= 'if(is_array($args->'.$arg.') && count($args->'.$arg.')==0){ unset($args->'.$arg.'); };'."\n"; - } - } - - // order 정리 - if($output->order) { - $buff .= '$output->order = array('; - foreach($output->order as $key => $val) { - $buff .= sprintf('array($args->%s?$args->%s:"%s",in_array($args->%s,array("asc","desc"))?$args->%s:("%s"?"%s":"asc")),', $val->var, $val->var, $val->default, $val->order, $val->order, $val->order, $val->order); - } - $buff .= ');'."\n"; - } - - // list_count 정리 - if($output->list_count) { - $buff .= sprintf('$output->list_count = array("var"=>"%s", "value"=>$args->%s?$args->%s:"%s");%s', $output->list_count->var, $output->list_count->var, $output->list_count->var, $output->list_count->default,"\n"); - } - - // page_count 정리 - if($output->page_count) { - $buff .= sprintf('$output->page_count = array("var"=>"%s", "value"=>$args->%s?$args->%s:"%s");%s', $output->page_count->var, $output->page_count->var, $output->page_count->var, $output->list_count->default,"\n"); - } - - // page 정리 - if($output->page) { - $buff .= sprintf('$output->page = array("var"=>"%s", "value"=>$args->%s?$args->%s:"%s");%s', $output->page->var, $output->page->var, $output->page->var, $output->list->default,"\n"); - } - - // group by 정리 - if($output->groups) { - $buff .= sprintf('$output->groups = array("%s");%s', implode('","',$output->groups),"\n"); - } - - // minlength check - if(count($minlength_list)) { - foreach($minlength_list as $key => $val) { - $pre_buff .= 'if($args->'.$key.'&&strlen($args->'.$key.')<'.$val.') return new Object(-1, sprintf($lang->filter->outofrange, $lang->'.$key.'?$lang->'.$key.':\''.$key.'\'));'."\n"; - } - } - - // maxlength check - if(count($maxlength_list)) { - foreach($maxlength_list as $key => $val) { - $pre_buff .= 'if($args->'.$key.'&&strlen($args->'.$key.')>'.$val.') return new Object(-1, sprintf($lang->filter->outofrange, $lang->'.$key.'?$lang->'.$key.':\''.$key.'\'));'."\n"; - } - } - - // filter check - if(count($this->filter_list)) { - foreach($this->filter_list as $key => $val) { - $pre_buff .= sprintf('if(isset($args->%s)) { unset($_output); $_output = $this->checkFilter("%s",$args->%s,"%s"); if(!$_output->toBool()) return $_output; } %s',$val->var, $val->var,$val->var,$val->filter,"\n"); - } - } - - // default check - if(count($this->default_list)) { - foreach($this->default_list as $key => $val) { - $pre_buff .= 'if(!isset($args->'.$key.')) $args->'.$key.' = '.$val.';'."\n"; - } - } - - // not null check - if(count($this->notnull_list)) { - foreach($this->notnull_list as $key => $val) { - $pre_buff .= 'if(!isset($args->'.$val.')) return new Object(-1, sprintf($lang->filter->isnull, $lang->'.$val.'?$lang->'.$val.':\''.$val.'\'));'."\n"; - } - } - - $buff = "query_id = "%s";%s', $query_id, "\n") - . sprintf('$output->action = "%s";%s', $action, "\n") - . $pre_buff - . $buff - . 'return $output; ?>'; - - // 저장 - FileHandler::writeFile($cache_file, $buff); - } - - /** - * @brief transfer given column information to object->columns - * @param[in] column information - * @result Returns $object - */ - - function _setColumn($columns){ - if(!$columns) { - $output->column[] = array("*" => "*"); - } else { - if(!is_array($columns)) $columns = array($columns); - foreach($columns as $key => $val) { - $name = $val->attrs->name; - /* - if(strpos('.',$name)===false && count($output->tables)==1) { - $tmp = array_values($output->tables); - $name = sprintf('%s.%s', $tmp[0], $val->attrs->name); - } - */ - - $output->columns[] = array( - "name" => $name, - "var" => $val->attrs->var, - "default" => $val->attrs->default, - "notnull" => $val->attrs->notnull, - "filter" => $val->attrs->filter, - "minlength" => $val->attrs->minlength, - "maxlength" => $val->attrs->maxlength, - "alias" => $val->attrs->alias, - "click_count" => $val->attrs->click_count, - ); - } - } - return $output; - } - - /** - * @brief transfer condition information to $object->conditions - * @param[in] SQL condition information - * @result Returns $output - */ - function _setConditions($conditions){ - // 조건절 정리 - - $condition = $conditions->condition; - if($condition) { - $obj->condition = $condition; - unset($condition); - $condition = array($obj); - } - $condition_group = $conditions->group; - if($condition_group && !is_array($condition_group)) $condition_group = array($condition_group); - - if($condition && $condition_group) $cond = array_merge($condition, $condition_group); - elseif($condition_group) $cond = $condition_group; - else $cond = $condition; - - if($cond) { - foreach($cond as $key => $val) { - unset($cond_output); - - if($val->attrs->pipe) $cond_output->pipe = $val->attrs->pipe; - else $cond_output->pipe = null; - - if(!$val->condition) continue; - if(!is_array($val->condition)) $val->condition = array($val->condition); - - foreach($val->condition as $k => $v) { - $obj = $v->attrs; - if(!$obj->alias) $obj->alias = $obj->column; - $cond_output->condition[] = $obj; - } - - $output->conditions[] = $cond_output; - } - } - return $output; - } - - /** - * @brief transfer condition information to $object->groups - * @param[in] SQL group information - * @result Returns $output - */ - function _setGroup($group_list){ - // group 정리 - - if($group_list) { - if(!is_array($group_list)) $group_list = array($group_list); - for($i=0;$iattrs->column); - if(!$column) continue; - $group_column_list[] = $column; - } - if(count($group_column_list)) $output->groups = $group_column_list; - } - return $output; - } - - - /** - * @brief transfer pagnation information to $output - * @param[in] $xml_obj xml object containing Navigation information - * @result Returns $output - */ - function _setNavigation($xml_obj){ - $navigation = $xml_obj->query->navigation; - if($navigation) { - $order = $navigation->index; - if($order) { - if(!is_array($order)) $order = array($order); - foreach($order as $order_info) { - $output->order[] = $order_info->attrs; - } - } - - $list_count = $navigation->list_count->attrs; - $output->list_count = $list_count; - - $page_count = $navigation->page_count->attrs; - $output->page_count = $page_count; - - $page = $navigation->page->attrs; - $output->page = $page ; - } - return $output; - } - - /** - * @brief retrieve column information from $output->colums to generate corresponding php code - * @param[in] $column - * @remarks the name of this method is misleading. - * @result Returns string buffer containing php code - */ - function _getColumn($columns){ - $buff = ''; - $str = ''; - $print_vars = array(); - - foreach($columns as $key => $val) { - $str = 'array("name"=>"%s","alias"=>"%s"'; - $print_vars = array(); - $print_vars[] = $val['name']; - $print_vars[] = $val['alias']; - - $val['default'] = $this->getDefault($val['name'], $val['default']); - if($val['var'] && strpos($val['var'],'.')===false) { - - if($val['default']){ - $str .= ',"value"=>$args->%s?$args->%s:%s'; - $print_vars[] = $val['var']; - $print_vars[] = $val['var']; - $print_vars[] = $val['default']; - }else{ - $str .= ',"value"=>$args->%s'; - $print_vars[] = $val['var']; - } - - } else { - if($val['default']){ - $str .= ',"value"=>%s'; - $print_vars[] = $val['default']; - } - } - - if($val['click_count']){ - $str .= ',"click_count"=>$args->%s'; - $print_vars[] = $val['click_count']; - } - - $str .= '),%s'; - $print_vars[] = "\n"; - - $buff .= vsprintf($str, $print_vars); - } - return $buff; - } - - /** - * @brief retrieve condition information from $output->condition to generate corresponding php code - * @param[in] $conditions array containing Query conditions - * @remarks the name of this method is misleading. - * @return Returns string buffer containing php code - */ - function _getConditions($conditions){ - $buff = ''; - foreach($conditions as $key => $val) { - $buff .= sprintf('array("pipe"=>"%s",%s"condition"=>array(', $val->pipe,"\n"); - foreach($val->condition as $k => $v) { - $v->default = $this->getDefault($v->column, $v->default); - if($v->var) { - if(strpos($v->var,".")===false) { - if($v->default) $this->default_list[$v->var] = $v->default; - if($v->filter) $this->filter_list[] = $v; - if($v->notnull) $this->notnull_list[] = $v->var; - if($v->default) $buff .= sprintf('array("column"=>"%s", "value"=>$args->%s?$args->%s:%s,"pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->var, $v->var, $v->default, $v->pipe, $v->operation, "\n"); - else $buff .= sprintf('array("column"=>"%s", "value"=>$args->%s,"pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->var, $v->pipe, $v->operation, "\n"); - - $this->addArguments($v->var); - } else { - $buff .= sprintf('array("column"=>"%s", "value"=>"%s","pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->var, $v->pipe, $v->operation, "\n"); - } - } else { - if($v->default) $buff .= sprintf('array("column"=>"%s", "value"=>%s,"pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->default ,$v->pipe, $v->operation,"\n"); - else $buff .= sprintf('array("column"=>"%s", "pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->pipe, $v->operation,"\n"); - } - } - $buff .= ')),'."\n"; - } - return $buff; - } - - function addArguments($args_name) - { - $this->args[] = $args_name; - } - - function getArguments() - { - return $this->args; - } - - /** - * @brief returns predefined default values correspoding to given parameters - * @param[in] $name - * @param[in] $value - * @return Returns a default value for specified field - */ - function getDefault($name, $value) { - $db_info = Context::getDBInfo (); - if(!isset($value)) return; - $str_pos = strpos($value, '('); - if($str_pos===false) return '"'.$value.'"'; - - $func_name = substr($value, 0, $str_pos); - $args = substr($value, $str_pos+1, strlen($value)-1); - - switch($func_name) { - case 'ipaddress' : - $val = '$_SERVER[\'REMOTE_ADDR\']'; - break; - case 'unixtime' : - $val = 'time()'; - break; - case 'curdate' : - $val = 'date("YmdHis")'; - break; - case 'sequence' : - $val = '$this->getNextSequence()'; - break; - case 'plus' : - $args = abs($args); - if ($db_info->db_type == 'cubrid') { - $val = sprintf ('"\\"%s\\"+%d"', $name, $args); - } else { - $val = sprintf('"%s+%d"', $name, $args); - } - break; - case 'minus' : - $args = abs($args); - if ($db_info->db_type == 'cubrid') { - $val = sprintf ('"\\"%s\\"-%d"', $name, $args); - } else { - $val = sprintf('"%s-%d"', $name, $args); - } - break; - case 'multiply' : - $args = intval($args); - if ($db_info->db_type == 'cubrid') { - $val = sprintf ('"\\"%s\\"*%d"', $name, $args); - } else { - $val = sprintf('"%s*%d"', $name, $args); - } - break; - } - - return $val; - } - } -?> +query->attrs->action); + if(!$action) return; + + // 테이블 정리 (배열코드로 변환) + $tables = $xml_obj->query->tables->table; + $output->left_tables = array(); + + $left_conditions = array(); + + if(!$tables) return; + if(!is_array($tables)) $tables = array($tables); + foreach($tables as $key => $val) { + + // 테이블과 alias의 이름을 구함 + $table_name = $val->attrs->name; + $alias = $val->attrs->alias; + if(!$alias) $alias = $table_name; + + $output->tables[$alias] = $table_name; + + if(in_array($val->attrs->type,array('left join','left outer join','right join','right outer join')) && count($val->conditions)){ + $output->left_tables[$alias] = $val->attrs->type; + $left_conditions[$alias] = $val->conditions; + } + + // 테이블을 찾아서 컬럼의 속성을 구함 + $table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $module, $table_name); + if(!file_exists($table_file)) { + $searched_list = FileHandler::readDir(_XE_PATH_.'modules'); + $searched_count = count($searched_list); + for($i=0;$i<$searched_count;$i++) { + $table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $searched_list[$i], $table_name); + if(file_exists($table_file)) break; + } + } + + if(file_exists($table_file)) { + $table_xml = FileHandler::readFile($table_file); + $table_obj = parent::parse($table_xml); + if($table_obj->table) { + if(isset($table_obj->table->column) && !is_array($table_obj->table->column)) + { + $table_obj->table->column = array($table_obj->table->column); + } + + foreach($table_obj->table->column as $k => $v) { + $buff .= sprintf('$output->column_type["%s"] = "%s";%s', $v->attrs->name, $v->attrs->type, "\n"); + } + } + } + } + + + // 컬럼 정리 + $columns = $xml_obj->query->columns->column; + $out = $this->_setColumn($columns); + $output->columns = $out->columns; + + $conditions = $xml_obj->query->conditions; + $out = $this->_setConditions($conditions); + $output->conditions = $out->conditions; + + foreach($output->left_tables as $key => $val){ + if($left_conditions[$key]){ + $out = $this->_setConditions($left_conditions[$key]); + $output->left_conditions[$key] = $out->conditions; + } + } + + $group_list = $xml_obj->query->groups->group; + $out = $this->_setGroup($group_list); + $output->groups = $out->groups; + + // 네비게이션 정리 + $out = $this->_setNavigation($xml_obj); + $output->order = $out->order; + $output->list_count = $out->list_count; + $output->page_count = $out->page_count; + $output->page = $out->page; + + $column_count = count($output->columns); + $condition_count = count($output->conditions); + + $buff .= '$output->tables = array( '; + foreach($output->tables as $key => $val) { + if(!array_key_exists($key,$output->left_tables)){ + $buff .= sprintf('"%s"=>"%s",', $key, $val); + } + } + $buff .= ' );'."\n"; + + // php script 생성 + $buff .= '$output->_tables = array( '; + foreach($output->tables as $key => $val) { + $buff .= sprintf('"%s"=>"%s",', $key, $val); + } + $buff .= ' );'."\n"; + + if(count($output->left_tables)){ + $buff .= '$output->left_tables = array( '; + foreach($output->left_tables as $key => $val) { + $buff .= sprintf('"%s"=>"%s",', $key, $val); + } + $buff .= ' );'."\n"; + } + + // column 정리 + if($column_count) { + $buff .= '$output->columns = array ( '; + $buff .= $this->_getColumn($output->columns); + $buff .= ' );'."\n"; + } + + // conditions 정리 + if($condition_count) { + $buff .= '$output->conditions = array ( '; + $buff .= $this->_getConditions($output->conditions); + $buff .= ' );'."\n"; + } + + // conditions 정리 + if(count($output->left_conditions)) { + $buff .= '$output->left_conditions = array ( '; + foreach($output->left_conditions as $key => $val){ + $buff .= "'{$key}' => array ( "; + $buff .= $this->_getConditions($val); + $buff .= "),\n"; + } + $buff .= ' );'."\n"; + } + + // args 변수 확인 + $arg_list = $this->getArguments(); + if($arg_list) + { + foreach($arg_list as $arg) + { + $pre_buff .= 'if(is_object($args->'.$arg.')){ $args->'.$arg.' = array_values(get_method_vars($args->'.$arg.')); }'. "\n"; + $pre_buff .= 'if(is_array($args->'.$arg.') && count($args->'.$arg.')==0){ unset($args->'.$arg.'); };'."\n"; + } + } + + // order 정리 + if($output->order) { + $buff .= '$output->order = array('; + foreach($output->order as $key => $val) { + $buff .= sprintf('array($args->%s?$args->%s:"%s",in_array($args->%s,array("asc","desc"))?$args->%s:("%s"?"%s":"asc")),', $val->var, $val->var, $val->default, $val->order, $val->order, $val->order, $val->order); + } + $buff .= ');'."\n"; + } + + // list_count 정리 + if($output->list_count) { + $buff .= sprintf('$output->list_count = array("var"=>"%s", "value"=>$args->%s?$args->%s:"%s");%s', $output->list_count->var, $output->list_count->var, $output->list_count->var, $output->list_count->default,"\n"); + } + + // page_count 정리 + if($output->page_count) { + $buff .= sprintf('$output->page_count = array("var"=>"%s", "value"=>$args->%s?$args->%s:"%s");%s', $output->page_count->var, $output->page_count->var, $output->page_count->var, $output->list_count->default,"\n"); + } + + // page 정리 + if($output->page) { + $buff .= sprintf('$output->page = array("var"=>"%s", "value"=>$args->%s?$args->%s:"%s");%s', $output->page->var, $output->page->var, $output->page->var, $output->list->default,"\n"); + } + + // group by 정리 + if($output->groups) { + $buff .= sprintf('$output->groups = array("%s");%s', implode('","',$output->groups),"\n"); + } + + // minlength check + if(count($minlength_list)) { + foreach($minlength_list as $key => $val) { + $pre_buff .= 'if($args->'.$key.'&&strlen($args->'.$key.')<'.$val.') return new Object(-1, sprintf($lang->filter->outofrange, $lang->'.$key.'?$lang->'.$key.':\''.$key.'\'));'."\n"; + } + } + + // maxlength check + if(count($maxlength_list)) { + foreach($maxlength_list as $key => $val) { + $pre_buff .= 'if($args->'.$key.'&&strlen($args->'.$key.')>'.$val.') return new Object(-1, sprintf($lang->filter->outofrange, $lang->'.$key.'?$lang->'.$key.':\''.$key.'\'));'."\n"; + } + } + + // filter check + if(count($this->filter_list)) { + foreach($this->filter_list as $key => $val) { + $pre_buff .= sprintf('if(isset($args->%s)) { unset($_output); $_output = $this->checkFilter("%s",$args->%s,"%s"); if(!$_output->toBool()) return $_output; } %s',$val->var, $val->var,$val->var,$val->filter,"\n"); + } + } + + // default check + if(count($this->default_list)) { + foreach($this->default_list as $key => $val) { + $pre_buff .= 'if(!isset($args->'.$key.')) $args->'.$key.' = '.$val.';'."\n"; + } + } + + // not null check + if(count($this->notnull_list)) { + foreach($this->notnull_list as $key => $val) { + $pre_buff .= 'if(!isset($args->'.$val.')) return new Object(-1, sprintf($lang->filter->isnull, $lang->'.$val.'?$lang->'.$val.':\''.$val.'\'));'."\n"; + } + } + + $buff = "query_id = "%s";%s', $query_id, "\n") + . sprintf('$output->action = "%s";%s', $action, "\n") + . $pre_buff + . $buff + . 'return $output; ?>'; + + // 저장 + FileHandler::writeFile($cache_file, $buff); + } + + /** + * @brief transfer given column information to object->columns + * @param[in] column information + * @result Returns $object + */ + + function _setColumn($columns){ + if(!$columns) { + $output->column[] = array("*" => "*"); + } else { + if(!is_array($columns)) $columns = array($columns); + foreach($columns as $key => $val) { + $name = $val->attrs->name; + /* + if(strpos('.',$name)===false && count($output->tables)==1) { + $tmp = array_values($output->tables); + $name = sprintf('%s.%s', $tmp[0], $val->attrs->name); + } + */ + + $output->columns[] = array( + "name" => $name, + "var" => $val->attrs->var, + "default" => $val->attrs->default, + "notnull" => $val->attrs->notnull, + "filter" => $val->attrs->filter, + "minlength" => $val->attrs->minlength, + "maxlength" => $val->attrs->maxlength, + "alias" => $val->attrs->alias, + "click_count" => $val->attrs->click_count, + ); + } + } + return $output; + } + + /** + * @brief transfer condition information to $object->conditions + * @param[in] SQL condition information + * @result Returns $output + */ + function _setConditions($conditions){ + // 조건절 정리 + + $condition = $conditions->condition; + if($condition) { + $obj->condition = $condition; + unset($condition); + $condition = array($obj); + } + $condition_group = $conditions->group; + if($condition_group && !is_array($condition_group)) $condition_group = array($condition_group); + + if($condition && $condition_group) $cond = array_merge($condition, $condition_group); + elseif($condition_group) $cond = $condition_group; + else $cond = $condition; + + if($cond) { + foreach($cond as $key => $val) { + unset($cond_output); + + if($val->attrs->pipe) $cond_output->pipe = $val->attrs->pipe; + else $cond_output->pipe = null; + + if(!$val->condition) continue; + if(!is_array($val->condition)) $val->condition = array($val->condition); + + foreach($val->condition as $k => $v) { + $obj = $v->attrs; + if(!$obj->alias) $obj->alias = $obj->column; + $cond_output->condition[] = $obj; + } + + $output->conditions[] = $cond_output; + } + } + return $output; + } + + /** + * @brief transfer condition information to $object->groups + * @param[in] SQL group information + * @result Returns $output + */ + function _setGroup($group_list){ + // group 정리 + + if($group_list) { + if(!is_array($group_list)) $group_list = array($group_list); + for($i=0;$iattrs->column); + if(!$column) continue; + $group_column_list[] = $column; + } + if(count($group_column_list)) $output->groups = $group_column_list; + } + return $output; + } + + + /** + * @brief transfer pagnation information to $output + * @param[in] $xml_obj xml object containing Navigation information + * @result Returns $output + */ + function _setNavigation($xml_obj){ + $navigation = $xml_obj->query->navigation; + if($navigation) { + $order = $navigation->index; + if($order) { + if(!is_array($order)) $order = array($order); + foreach($order as $order_info) { + $output->order[] = $order_info->attrs; + } + } + + $list_count = $navigation->list_count->attrs; + $output->list_count = $list_count; + + $page_count = $navigation->page_count->attrs; + $output->page_count = $page_count; + + $page = $navigation->page->attrs; + $output->page = $page ; + } + return $output; + } + + /** + * @brief retrieve column information from $output->colums to generate corresponding php code + * @param[in] $column + * @remarks the name of this method is misleading. + * @result Returns string buffer containing php code + */ + function _getColumn($columns){ + $buff = ''; + $str = ''; + $print_vars = array(); + + foreach($columns as $key => $val) { + $str = 'array("name"=>"%s","alias"=>"%s"'; + $print_vars = array(); + $print_vars[] = $val['name']; + $print_vars[] = $val['alias']; + + $val['default'] = $this->getDefault($val['name'], $val['default']); + if($val['var'] && strpos($val['var'],'.')===false) { + + if($val['default']){ + $str .= ',"value"=>$args->%s?$args->%s:%s'; + $print_vars[] = $val['var']; + $print_vars[] = $val['var']; + $print_vars[] = $val['default']; + }else{ + $str .= ',"value"=>$args->%s'; + $print_vars[] = $val['var']; + } + + } else { + if($val['default']){ + $str .= ',"value"=>%s'; + $print_vars[] = $val['default']; + } + } + + if($val['click_count']){ + $str .= ',"click_count"=>$args->%s'; + $print_vars[] = $val['click_count']; + } + + $str .= '),%s'; + $print_vars[] = "\n"; + + $buff .= vsprintf($str, $print_vars); + } + return $buff; + } + + /** + * @brief retrieve condition information from $output->condition to generate corresponding php code + * @param[in] $conditions array containing Query conditions + * @remarks the name of this method is misleading. + * @return Returns string buffer containing php code + */ + function _getConditions($conditions){ + $buff = ''; + foreach($conditions as $key => $val) { + $buff .= sprintf('array("pipe"=>"%s",%s"condition"=>array(', $val->pipe,"\n"); + foreach($val->condition as $k => $v) { + $v->default = $this->getDefault($v->column, $v->default); + if($v->var) { + if(strpos($v->var,".")===false) { + if($v->default) $this->default_list[$v->var] = $v->default; + if($v->filter) $this->filter_list[] = $v; + if($v->notnull) $this->notnull_list[] = $v->var; + if($v->default) $buff .= sprintf('array("column"=>"%s", "value"=>$args->%s?$args->%s:%s,"pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->var, $v->var, $v->default, $v->pipe, $v->operation, "\n"); + else $buff .= sprintf('array("column"=>"%s", "value"=>$args->%s,"pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->var, $v->pipe, $v->operation, "\n"); + + $this->addArguments($v->var); + } else { + $buff .= sprintf('array("column"=>"%s", "value"=>"%s","pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->var, $v->pipe, $v->operation, "\n"); + } + } else { + if($v->default) $buff .= sprintf('array("column"=>"%s", "value"=>%s,"pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->default ,$v->pipe, $v->operation,"\n"); + else $buff .= sprintf('array("column"=>"%s", "pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->pipe, $v->operation,"\n"); + } + } + $buff .= ')),'."\n"; + } + return $buff; + } + + function addArguments($args_name) + { + $this->args[] = $args_name; + } + + function getArguments() + { + return $this->args; + } + + /** + * @brief returns predefined default values correspoding to given parameters + * @param[in] $name + * @param[in] $value + * @return Returns a default value for specified field + */ + function getDefault($name, $value) { + $db_info = Context::getDBInfo (); + if(!isset($value)) return; + $str_pos = strpos($value, '('); + if($str_pos===false) return '"'.$value.'"'; + + $func_name = substr($value, 0, $str_pos); + $args = substr($value, $str_pos+1, strlen($value)-1); + + switch($func_name) { + case 'ipaddress' : + $val = '$_SERVER[\'REMOTE_ADDR\']'; + break; + case 'unixtime' : + $val = 'time()'; + break; + case 'curdate' : + $val = 'date("YmdHis")'; + break; + case 'sequence' : + $val = '$this->getNextSequence()'; + break; + case 'plus' : + $args = abs($args); + if ($db_info->db_type == 'cubrid') { + $val = sprintf ('"\\"%s\\"+%d"', $name, $args); + } else { + $val = sprintf('"%s+%d"', $name, $args); + } + break; + case 'minus' : + $args = abs($args); + if ($db_info->db_type == 'cubrid') { + $val = sprintf ('"\\"%s\\"-%d"', $name, $args); + } else { + $val = sprintf('"%s-%d"', $name, $args); + } + break; + case 'multiply' : + $args = intval($args); + if ($db_info->db_type == 'cubrid') { + $val = sprintf ('"\\"%s\\"*%d"', $name, $args); + } else { + $val = sprintf('"%s*%d"', $name, $args); + } + break; + } + + return $val; + } + } +?> diff --git a/common/css/button.css b/common/css/button.css index fb9661cd9..5177e1e4c 100644 --- a/common/css/button.css +++ b/common/css/button.css @@ -1,91 +1,91 @@ -/* NHN (developers@xpressengine.com) */ - -/* Anchor Button */ -a.button, -a.button span { position:relative; display:inline-block; text-decoration:none !important; background:url(../tpl/images/buttonWhite.gif) no-repeat; cursor:pointer; white-space:nowrap; vertical-align:middle;} -a.button { padding:0; background-position:left top; overflow:visible;} -a.button span { left:2px; padding:6px 10px 5px 8px; color:#000; font:12px/12px Sans-serif; background-position:right top; *vertical-align:top;} -/* Large Size */ -a.button.large { background-position:left -30px; } -a.button.large span { padding:7px 10px 6px 8px; font:16px/16px Sans-serif; background-position:right -30px;} -/* xLarge Size */ -a.button.xLarge { background-position:left -65px; } -a.button.xLarge span { padding:8px 10px 7px 8px; font:20px/20px Sans-serif; background-position:right -65px;} -/* Small Size */ -a.button.small { background-position:left -107px; } -a.button.small span { padding:4px 6px 3px 4px; font:11px/11px Sans-serif; background-position:right -107px;} - -/* Control Button + Submit Button */ -span.button, -span.button button, -span.button input { position:relative; margin:0; display:inline-block; border:0; font:12px Sans-serif; white-space:nowrap; background:url(../tpl/images/buttonWhite.gif) no-repeat; vertical-align:middle;} -span.button { padding:0; background-position:left top;} -span.button button, -span.button input { height:23px; left:2px; *vertical-align:top; padding:0 10px 0 8px; line-height:24px; background-position:right top; cursor:pointer; *overflow:visible;} -/* Large Size */ -span.button.large { background-position:left -30px;} -span.button.large button, -span.button.large input { height:30px; padding:0 10px 0 8px; font:16px/30px Sans-serif; background-position:right -30px;} -/* xLarge Size */ -span.button.xLarge { background-position:left -65px;} -span.button.xLarge button, -span.button.xLarge input { height:35px; padding:0 10px 0 8px; font:20px/36px Sans-serif; background-position:right -65px;} -/* Small Size */ -span.button.small { background-position:left -107px;} -span.button.small button, -span.button.small input { height:18px; padding:0 6px 0 4px; font:11px/18px Sans-serif; background-position:right -107px;} - -/* Strong Button */ -a.button.strong *, -span.button.strong * { font-weight:bold !important;} - -/* Icon Add */ -a.button .icon { position:relative; border:0; vertical-align:middle;} -span.button .icon { position:relative; left:10px; margin-right:8px; vertical-align:middle;} - -/* Color Preset */ -a.button.green, -a.button.green span, -span.button.green, -span.button.green button, -span.button.green input { background-image:url(../tpl/images/buttonGreen.gif); color:#fff;} -a.button.black, -a.button.black span, -span.button.black, -span.button.black button, -span.button.black input { background-image:url(../tpl/images/buttonBlack.gif); color:#fff;} -a.button.red, -a.button.red span, -span.button.red, -span.button.red button, -span.button.red input { background-image:url(../tpl/images/buttonRed.gif); color:#fff;} -a.button.blue, -a.button.blue span, -span.button.blue, -span.button.blue button, -span.button.blue input { background-image:url(../tpl/images/buttonBlue.gif); color:#fff;} - -/* Offset Debug */ -a.button, -span.button{ margin-right:2px;} - -/* Button Set */ -.buttonSet{ width:16px; height:16px; background-image:url(../tpl/images/buttonSet.gif); background-repeat:no-repeat; border:0; background-color:transparent; vertical-align:middle; display:inline-block; text-decoration:none;} -.buttonSet span{ z-index:-1; font-size:0; line-height:0; visibility:hidden;} -.buttonSet.buttonUp{ background-position:0 0;} -.buttonSet.buttonDown{ background-position:0 -16px;} -.buttonSet.buttonLeft{ background-position:0 -32px;} -.buttonSet.buttonRight{ background-position:0 -48px;} -.buttonSet.buttonInfo{ background-position:0 -64px;} -.buttonSet.buttonCopy{ background-position:0 -80px;} -.buttonSet.buttonSetting{ background-position:0 -96px;} -.buttonSet.buttonActive{ background-position:0 -112px;} -.buttonSet.buttonDisable{ background-position:0 -128px;} -.buttonSet.buttonDelete{ background-position:0 -144px;} -.buttonSet.buttonHomepage{ background-position:0 -160px;} -.buttonSet.buttonBlog{ background-position:0 -176px;} -.buttonSet.buttonCalendar{ background-position:0 -192px;} -.buttonSet.buttonLayoutEditor{ background-position:0 -208px;} -.buttonSet.buttonAddWidget{ background-position:0 -224px;} -.buttonSet.buttonAddContent{ background-position:0 -240px;} - +/* NHN (developers@xpressengine.com) */ + +/* Anchor Button */ +a.button, +a.button span { position:relative; display:inline-block; text-decoration:none !important; background:url(../tpl/images/buttonWhite.gif) no-repeat; cursor:pointer; white-space:nowrap; vertical-align:middle;} +a.button { padding:0; background-position:left top; overflow:visible;} +a.button span { left:2px; padding:6px 10px 5px 8px; color:#000; font:12px/12px Sans-serif; background-position:right top; *vertical-align:top;} +/* Large Size */ +a.button.large { background-position:left -30px; } +a.button.large span { padding:7px 10px 6px 8px; font:16px/16px Sans-serif; background-position:right -30px;} +/* xLarge Size */ +a.button.xLarge { background-position:left -65px; } +a.button.xLarge span { padding:8px 10px 7px 8px; font:20px/20px Sans-serif; background-position:right -65px;} +/* Small Size */ +a.button.small { background-position:left -107px; } +a.button.small span { padding:4px 6px 3px 4px; font:11px/11px Sans-serif; background-position:right -107px;} + +/* Control Button + Submit Button */ +span.button, +span.button button, +span.button input { position:relative; margin:0; display:inline-block; border:0; font:12px Sans-serif; white-space:nowrap; background:url(../tpl/images/buttonWhite.gif) no-repeat; vertical-align:middle;} +span.button { padding:0; background-position:left top;} +span.button button, +span.button input { height:23px; left:2px; *vertical-align:top; padding:0 10px 0 8px; line-height:24px; background-position:right top; cursor:pointer; *overflow:visible;} +/* Large Size */ +span.button.large { background-position:left -30px;} +span.button.large button, +span.button.large input { height:30px; padding:0 10px 0 8px; font:16px/30px Sans-serif; background-position:right -30px;} +/* xLarge Size */ +span.button.xLarge { background-position:left -65px;} +span.button.xLarge button, +span.button.xLarge input { height:35px; padding:0 10px 0 8px; font:20px/36px Sans-serif; background-position:right -65px;} +/* Small Size */ +span.button.small { background-position:left -107px;} +span.button.small button, +span.button.small input { height:18px; padding:0 6px 0 4px; font:11px/18px Sans-serif; background-position:right -107px;} + +/* Strong Button */ +a.button.strong *, +span.button.strong * { font-weight:bold !important;} + +/* Icon Add */ +a.button .icon { position:relative; border:0; vertical-align:middle;} +span.button .icon { position:relative; left:10px; margin-right:8px; vertical-align:middle;} + +/* Color Preset */ +a.button.green, +a.button.green span, +span.button.green, +span.button.green button, +span.button.green input { background-image:url(../tpl/images/buttonGreen.gif); color:#fff;} +a.button.black, +a.button.black span, +span.button.black, +span.button.black button, +span.button.black input { background-image:url(../tpl/images/buttonBlack.gif); color:#fff;} +a.button.red, +a.button.red span, +span.button.red, +span.button.red button, +span.button.red input { background-image:url(../tpl/images/buttonRed.gif); color:#fff;} +a.button.blue, +a.button.blue span, +span.button.blue, +span.button.blue button, +span.button.blue input { background-image:url(../tpl/images/buttonBlue.gif); color:#fff;} + +/* Offset Debug */ +a.button, +span.button{ margin-right:2px;} + +/* Button Set */ +.buttonSet{ width:16px; height:16px; background-image:url(../tpl/images/buttonSet.gif); background-repeat:no-repeat; border:0; background-color:transparent; vertical-align:middle; display:inline-block; text-decoration:none;} +.buttonSet span{ z-index:-1; font-size:0; line-height:0; visibility:hidden;} +.buttonSet.buttonUp{ background-position:0 0;} +.buttonSet.buttonDown{ background-position:0 -16px;} +.buttonSet.buttonLeft{ background-position:0 -32px;} +.buttonSet.buttonRight{ background-position:0 -48px;} +.buttonSet.buttonInfo{ background-position:0 -64px;} +.buttonSet.buttonCopy{ background-position:0 -80px;} +.buttonSet.buttonSetting{ background-position:0 -96px;} +.buttonSet.buttonActive{ background-position:0 -112px;} +.buttonSet.buttonDisable{ background-position:0 -128px;} +.buttonSet.buttonDelete{ background-position:0 -144px;} +.buttonSet.buttonHomepage{ background-position:0 -160px;} +.buttonSet.buttonBlog{ background-position:0 -176px;} +.buttonSet.buttonCalendar{ background-position:0 -192px;} +.buttonSet.buttonLayoutEditor{ background-position:0 -208px;} +.buttonSet.buttonAddWidget{ background-position:0 -224px;} +.buttonSet.buttonAddContent{ background-position:0 -240px;} + diff --git a/common/css/default.css b/common/css/default.css index dba8b421f..b9e81d058 100644 --- a/common/css/default.css +++ b/common/css/default.css @@ -1,91 +1,91 @@ -/* default.css - Type Selector Definition */ -body { margin:0;padding:0; font-size:.75em;} - -img { border:none; } -label { cursor:pointer; } -form { margin:0; padding:0; } - -/* Special Class Selector */ -.fr { float:right; } -.fl { float:left; } -.clear { clear:both; } -.fwB { font-weight:bold;} -.tCenter { text-align:center; } -.tRight { text-align:right; } -.tLeft { text-align:left; } -.gap1 { margin-top:.8em; } -.nowrap { white-space:nowrap; } - -.iePngFix { behavior:url(./common/js/iePngFix.htc); } -.zbxe_info { vertical-align:middle; behavior:url(./common/js/iePngFix.htc); } - -/* Input Style Definition */ -.inputTypeText { border:1px solid; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6; height:1.4em; padding:.2em 0 0 .3em; background:#ffffff; font-size:1em; _font-size:9pt; } -*:first-child+html .inputTypeText { font-size:9pt; } -.inputTypeText:hover, -.inputTypeText:focus { background:#f4f4f4; } -.inputTypeTextArea { border:1px solid !important; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6 !important; background:#ffffff; font-size:1em; _font-size:9pt; height:100px;} -*:first-child+html .inputTypeTextArea { font-size:9pt; } - -.w40 { width:40px; } -.w60 { width:60px; } -.w70 { width:70px; } -.w80 { width:80px; } -.w90 { width:90px; } -.w100 { width:100px; } -.w110 { width:110px; } -.w120 { width:120px; } -.w130 { width:130px; } -.w140 { width:140px; } -.w150 { width:150px; } -.w160 { width:160px; } -.w170 { width:170px; } -.w180 { width:180px; } -.w190 { width:190px; } -.w200 { width:200px; } -.w210 { width:210px; } -.w220 { width:220px; } -.w230 { width:230px; } -.w240 { width:240px; } -.w250 { width:250px; } -.w260 { width:260px; } -.w270 { width:270px; } -.w280 { width:280px; } -.w290 { width:290px; } -.w300 { width:300px; } -.w400 { width:400px; } - -/* editor style */ -a.bold { font-weight:bold; } - -.editor_blue_text { color: #145ff9 !important; text-decoration:underline !important; } -.editor_blue_text a { color: #145ff9 !important; text-decoration:underline !important; } -.editor_red_text { color: #f42126 !important; text-decoration:underline !important; } -.editor_red_text a { color: #f42126 !important; text-decoration:underline !important; } -.editor_yellow_text { color: #c9bd00 !important; text-decoration:underline !important; } -.editor_yellow_text a { color: #c9bd00 !important; text-decoration:underline !important; } -.editor_green_text { color: #08830B !important; text-decoration:underline !important; } -.editor_green_text a { color: #08830B !important; text-decoration:underline !important; } - -.folder_opener { display: block; } -.folder_closer { display: none; } -.folder_area { display: none; } - -.xe_content { line-height:1.6; overflow:hidden; } - -.zbxe_widget_output { background:url(../tpl/images/widget_text.gif) no-repeat center bottom; display:block;} - -/* xe layer */ -#waitingforserverresponse { border:2px solid #444444; font-weight:bold; color:#444444; padding: 7px 5px 5px 25px; background:#FFFFFF url("../tpl/images/loading.gif") no-repeat 5px 5px; top:40px; left:40px; position:absolute; z-index:100; visibility:hidden; } - -#popup_menu_area{ position:absolute; background:#fff; border:2px solid #eee; -moz-border-radius:5px; -webkit-border-radius:5px; margin:0; padding:0;} -#popup_menu_area *{ margin:0; padding:0; list-style:none; font-size:12px; line-height:normal;} -#popup_menu_area ul{ border:1px solid #ddd; -moz-border-radius:5px; -webkit-border-radius:5px; padding:10px 10px 5px 10px;} -#popup_menu_area li{ padding:2px 0 2px 20px; background-repeat:no-repeat; background-position:left center; margin-bottom:3px; white-space:nowrap;} -#popup_menu_area li a{ text-decoration:none; color:#000;} -#popup_menu_area li a:hover, -#popup_menu_area li a:active, -#popup_menu_area li a:focus{ font-weight:bold; letter-spacing:-1px;} - -/* xe faceoff */ -.faceOffManager { position:fixed; _position:absolute; right:3px; top:3px; height:23px; } +/* default.css - Type Selector Definition */ +body { margin:0;padding:0; font-size:.75em;} + +img { border:none; } +label { cursor:pointer; } +form { margin:0; padding:0; } + +/* Special Class Selector */ +.fr { float:right; } +.fl { float:left; } +.clear { clear:both; } +.fwB { font-weight:bold;} +.tCenter { text-align:center; } +.tRight { text-align:right; } +.tLeft { text-align:left; } +.gap1 { margin-top:.8em; } +.nowrap { white-space:nowrap; } + +.iePngFix { behavior:url(./common/js/iePngFix.htc); } +.zbxe_info { vertical-align:middle; behavior:url(./common/js/iePngFix.htc); } + +/* Input Style Definition */ +.inputTypeText { border:1px solid; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6; height:1.4em; padding:.2em 0 0 .3em; background:#ffffff; font-size:1em; _font-size:9pt; } +*:first-child+html .inputTypeText { font-size:9pt; } +.inputTypeText:hover, +.inputTypeText:focus { background:#f4f4f4; } +.inputTypeTextArea { border:1px solid !important; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6 !important; background:#ffffff; font-size:1em; _font-size:9pt; height:100px;} +*:first-child+html .inputTypeTextArea { font-size:9pt; } + +.w40 { width:40px; } +.w60 { width:60px; } +.w70 { width:70px; } +.w80 { width:80px; } +.w90 { width:90px; } +.w100 { width:100px; } +.w110 { width:110px; } +.w120 { width:120px; } +.w130 { width:130px; } +.w140 { width:140px; } +.w150 { width:150px; } +.w160 { width:160px; } +.w170 { width:170px; } +.w180 { width:180px; } +.w190 { width:190px; } +.w200 { width:200px; } +.w210 { width:210px; } +.w220 { width:220px; } +.w230 { width:230px; } +.w240 { width:240px; } +.w250 { width:250px; } +.w260 { width:260px; } +.w270 { width:270px; } +.w280 { width:280px; } +.w290 { width:290px; } +.w300 { width:300px; } +.w400 { width:400px; } + +/* editor style */ +a.bold { font-weight:bold; } + +.editor_blue_text { color: #145ff9 !important; text-decoration:underline !important; } +.editor_blue_text a { color: #145ff9 !important; text-decoration:underline !important; } +.editor_red_text { color: #f42126 !important; text-decoration:underline !important; } +.editor_red_text a { color: #f42126 !important; text-decoration:underline !important; } +.editor_yellow_text { color: #c9bd00 !important; text-decoration:underline !important; } +.editor_yellow_text a { color: #c9bd00 !important; text-decoration:underline !important; } +.editor_green_text { color: #08830B !important; text-decoration:underline !important; } +.editor_green_text a { color: #08830B !important; text-decoration:underline !important; } + +.folder_opener { display: block; } +.folder_closer { display: none; } +.folder_area { display: none; } + +.xe_content { line-height:1.6; overflow:hidden; } + +.zbxe_widget_output { background:url(../tpl/images/widget_text.gif) no-repeat center bottom; display:block;} + +/* xe layer */ +#waitingforserverresponse { border:2px solid #444444; font-weight:bold; color:#444444; padding: 7px 5px 5px 25px; background:#FFFFFF url("../tpl/images/loading.gif") no-repeat 5px 5px; top:40px; left:40px; position:absolute; z-index:100; visibility:hidden; } + +#popup_menu_area{ position:absolute; background:#fff; border:2px solid #eee; -moz-border-radius:5px; -webkit-border-radius:5px; margin:0; padding:0;} +#popup_menu_area *{ margin:0; padding:0; list-style:none; font-size:12px; line-height:normal;} +#popup_menu_area ul{ border:1px solid #ddd; -moz-border-radius:5px; -webkit-border-radius:5px; padding:10px 10px 5px 10px;} +#popup_menu_area li{ padding:2px 0 2px 20px; background-repeat:no-repeat; background-position:left center; margin-bottom:3px; white-space:nowrap;} +#popup_menu_area li a{ text-decoration:none; color:#000;} +#popup_menu_area li a:hover, +#popup_menu_area li a:active, +#popup_menu_area li a:focus{ font-weight:bold; letter-spacing:-1px;} + +/* xe faceoff */ +.faceOffManager { position:fixed; _position:absolute; right:3px; top:3px; height:23px; } diff --git a/common/js/common.js b/common/js/common.js index edb2957fd..21168c11a 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -1,113 +1,113 @@ -/** - * @file common.js - * @author NHN (developers@xpressengine.com) - * @brief 몇가지 유용한 & 기본적으로 자주 사용되는 자바스크립트 함수들 모음 - **/ -if(jQuery)jQuery.noConflict();(function($){var UA=navigator.userAgent.toLowerCase();$.os={Linux:/linux/.test(UA),Unix:/x11/.test(UA),Mac:/mac/.test(UA),Windows:/win/.test(UA)};$.os.name=($.os.Windows)?'Windows':($.os.Linux)?'Linux':($.os.Unix)?'Unix':($.os.Mac)?'Mac':'';window.XE={loaded_popup_menus:new Array(),addedDocument:new Array(),checkboxToggleAll:function(){var itemName='cart';var options={wrap:null,checked:'toggle',doClick:false};switch(arguments.length){case 1:if(typeof(arguments[0])=="string"){itemName=arguments[0];}else{$.extend(options,arguments[0]||{});} -break;case 2:itemName=arguments[0];$.extend(options,arguments[1]||{});} -if(options.doClick==true)options.checked=null;if(typeof(options.wrap)=="string")options.wrap='#'+options.wrap;if(options.wrap){var obj=$(options.wrap).find('input[name='+itemName+']:checkbox');}else{var obj=$('input[name='+itemName+']:checkbox');} -if(options.checked=='toggle'){obj.each(function(){$(this).attr('checked',($(this).attr('checked'))?false:true);});}else{(options.doClick==true)?obj.click():obj.attr('checked',options.checked);}},displayPopupMenu:function(ret_obj,response_tags,params){var target_srl=params["target_srl"];var menu_id=params["menu_id"];var menus=ret_obj['menus'];var html="";if(this.loaded_popup_menus[menu_id]){html=this.loaded_popup_menus[menu_id];}else{if(menus){var item=menus['item'];if(typeof(item.length)=='undefined'||item.length<1)item=new Array(item);if(item.length){for(var i=0;i'+str+' ';}}} -this.loaded_popup_menus[menu_id]=html;} -if(html){var area=$('#popup_menu_area').html('
    '+html+'
');var areaOffset={top:params['page_y'],left:params['page_x']};if(area.outerHeight()+areaOffset.top>$(window).height()+$(window).scrollTop()) -areaOffset.top=$(window).height()-area.outerHeight()+$(window).scrollTop();if(area.outerWidth()+areaOffset.left>$(window).width()+$(window).scrollLeft()) -areaOffset.left=$(window).width()-area.outerWidth()+$(window).scrollLeft();area.css({top:areaOffset.top,left:areaOffset.left}).show();}}}})(jQuery);jQuery(function($){if(!$('#popup_menu_area').length){var menuObj=$('
').attr('id','popup_menu_area').css({display:'none',zIndex:9999});$(document.body).append(menuObj);} -$(document).click(function(evt){var area=$('#popup_menu_area');if(!area.length)return;area.hide();var targetObj=$(evt.target);if(!targetObj.length)return;if(targetObj.length&&$.inArray(targetObj.attr('nodeName'),['DIV','SPAN','A'])==-1)targetObj=targetObj.parent();if(!targetObj.length||$.inArray(targetObj.attr('nodeName'),['DIV','SPAN','A'])==-1)return;var class_name=targetObj.attr('className');if(class_name.indexOf('_')<=0)return;var class_name_list=class_name.split(' ');var menu_id='';var menu_id_regx=/^([a-zA-Z]+)_([0-9]+)$/;for(var i=0,c=class_name_list.length;i-1)?first_enable[i]:j;}} -if(!disabled_exists)return;sels.oldonchange=sels.onchange;sels.onchange=function(){if(this.options[this.selectedIndex].disabled){this.selectedIndex=first_enable[i];}else{if(this.oldonchange)this.oldonchange();}};if(sels.selectedIndex>=0&&sels.options[sels.selectedIndex].disabled)sels.onchange();});} -var drEditorFold=$('.xe_content .fold_button');if(drEditorFold.size()){var fold_container=$('div.fold_container',drEditorFold);$('button.more',drEditorFold).click(function(){$(this).hide().next('button').show().parent().next(fold_container).show();});$('button.less',drEditorFold).click(function(){$(this).hide().prev('button').show().parent().next(fold_container).hide();});}});String.prototype.getQuery=function(key){var idx=this.indexOf('?');if(idx==-1)return null;var query_string=this.substr(idx+1,this.length);var args={};query_string.replace(/([^=]+)=([^&]*)(&|$)/g,function(){args[arguments[1]]=arguments[2];});var q=args[key];if(typeof(q)=="undefined")q="";return q;} -String.prototype.setQuery=function(key,val){var idx=this.indexOf('?');var uri=this.replace(/#$/,'');if(idx!=-1){var query_string=uri.substr(idx+1,this.length),args={},q_list=[];uri=this.substr(0,idx);query_string.replace(/([^=]+)=([^&]*)(&|$)/g,function(all,key,val){args[key]=val;});args[key]=val;jQuery.each(args,function(key,val){if(!jQuery.trim(val))return;q_list.push(key+'='+decodeURI(val));});query_string=q_list.join('&');uri=uri+(query_string?'?'+query_string:'');}else{if(val.toString().trim())uri=uri+"?"+key+"="+val;} -var re=/https:\/\/([^:\/]+)(:\d+|)/i;var check=re.exec(uri);if(check) -{var toReplace="http://"+check[1];if(typeof(http_port)!='undefined'&&http_port!=80) -{toReplace+=":"+http_port;} -uri=uri.replace(re,toReplace);} -var bUseSSL=false;if(typeof(enforce_ssl)!='undefined'&&enforce_ssl) -{bUseSSL=true;} -else if(typeof(ssl_actions)!='undefined'&&typeof(ssl_actions.length)!='undefined'&&uri.getQuery('act')){var act=uri.getQuery('act');for(i=0;i-1&&!url.getQuery('vid'))url=url.setQuery('vid',xeVid);try{if(target!="_blank"&&winopen_list[target]){winopen_list[target].close();winopen_list[target]=null;}}catch(e){} -if(typeof(target)=='undefined')target='_blank';if(typeof(attribute)=='undefined')attribute='';var win=window.open(url,target,attribute);win.focus();if(target!="_blank")winopen_list[target]=win;} -function popopen(url,target){if(typeof(target)=="undefined")target="_blank";if(typeof(xeVid)!='undefined'&&url.indexOf(request_uri)>-1&&!url.getQuery('vid'))url=url.setQuery('vid',xeVid);winopen(url,target,"left=10,top=10,width=10,height=10,scrollbars=no,resizable=yes,toolbars=no");} -function sendMailTo(to){location.href="mailto:"+to;} -function move_url(url,open_wnidow){if(!url)return false;if(typeof(open_wnidow)=='undefined')open_wnidow='N';if(open_wnidow=='N'){open_wnidow=false;}else{open_wnidow=true;} -if(/^\./.test(url))url=request_uri+url;if(open_wnidow){winopen(url);}else{location.href=url;} -return false;} -function displayMultimedia(src,width,height,options){var html=_displayMultimedia(src,width,height,options);if(html)document.writeln(html);} -function _displayMultimedia(src,width,height,options){if(src.indexOf('files')==0)src=request_uri+src;var defaults={wmode:'transparent',allowScriptAccess:'sameDomain',quality:'high',flashvars:'',autostart:false};var params=jQuery.extend(defaults,options||{});var autostart=(params.autostart&¶ms.autostart!='false')?'true':'false';delete(params.autostart);var clsid="";var codebase="";var html="";if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(src)){html='';}else if(/\.flv$/i.test(src)||/\.mov$/i.test(src)||/\.moov$/i.test(src)||/\.m4v$/i.test(src)){html='';}else if(/\.swf/i.test(src)){clsid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';if(typeof(enforce_ssl)!='undefined'&&enforce_ssl){codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0";} -else{codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0";} -html='';html+='';for(var name in params){if(params[name]!='undefined'&¶ms[name]!=''){html+='';}} -html+='' -+'' -+'';}else{if(jQuery.browser.mozilla||jQuery.browser.opera){autostart=(params.autostart&¶ms.autostart!='false')?'1':'0';} -html='400){$body.css({overflow:'auto',overflowX:'hidden',height:400+'px'});}} -var $win=$(window);var $pc=$('#popup_content');var w=Math.max($pc[0].offsetWidth,600);var h=$pc[0].offsetHeight;var dw=$win.width();var dh=$win.height();var _w=0,_h=0;if(w!=dw)_w=w-dw;if(h!=dh)_h=h-dh;if(_w||_h){window.resizeBy(_w,_h);} -if(!arguments.callee.executed){setTimeout(setFixedPopupSize,300);arguments.callee.executed=true;}} -function doCallModuleAction(module,action,target_srl){var params=new Array();params['target_srl']=target_srl;params['cur_mid']=current_mid;exec_xml(module,action,params,completeCallModuleAction);} -function completeCallModuleAction(ret_obj,response_tags){if(ret_obj['message']!='success')alert(ret_obj['message']);location.reload();} -function completeMessage(ret_obj){alert(ret_obj['message']);location.reload();} -function doChangeLangType(obj){if(typeof(obj)=="string"){setLangType(obj);}else{var val=obj.options[obj.selectedIndex].value;setLangType(val);} -location.href=location.href.setQuery('l','');} -function setLangType(lang_type){var expire=new Date();expire.setTime(expire.getTime()+(7000*24*3600000));setCookie('lang_type',lang_type,expire,'/');} -function doDocumentPreview(obj){var fo_obj=obj;while(fo_obj.nodeName!="FORM"){fo_obj=fo_obj.parentNode;} -if(fo_obj.nodeName!="FORM")return;var editor_sequence=fo_obj.getAttribute('editor_sequence');var content=editorGetContent(editor_sequence);var win=window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes");var dummy_obj=jQuery("#previewDocument");if(!dummy_obj.length){jQuery(''+''+''+''+'').appendTo(document.body);dummy_obj=jQuery("#previewDocument")[0];} -if(dummy_obj){dummy_obj.content.value=content;dummy_obj.submit();}} -function doDocumentSave(obj){var editor_sequence=obj.form.getAttribute('editor_sequence');var prev_content=editorRelKeys[editor_sequence]['content'].value;if(typeof(editor_sequence)!='undefined'&&editor_sequence&&typeof(editorRelKeys)!='undefined'&&typeof(editorGetContent)=='function'){var content=editorGetContent(editor_sequence);editorRelKeys[editor_sequence]['content'].value=content;} -var params={},responses=['error','message','document_srl'],elms=obj.form.elements,data=jQuery(obj.form).serializeArray();;jQuery.each(data,function(i,field){var val=jQuery.trim(field.value);if(!val)return true;if(/\[\]$/.test(field.name))field.name=field.name.replace(/\[\]$/,'');if(params[field.name])params[field.name]+='|@|'+val;else params[field.name]=field.value;});exec_xml('member','procMemberSaveDocument',params,completeDocumentSave,responses,params,obj.form);editorRelKeys[editor_sequence]['content'].value=prev_content;return false;} -function completeDocumentSave(ret_obj){jQuery('input[name=document_srl]').eq(0).val(ret_obj['document_srl']);alert(ret_obj['message']);} -var objForSavedDoc=null;function doDocumentLoad(obj){objForSavedDoc=obj.form;popopen(request_uri.setQuery('module','member').setQuery('act','dispSavedDocumentList'));} -function doDocumentSelect(document_srl){if(!opener||!opener.objForSavedDoc){window.close();return;} -opener.location.href=opener.current_url.setQuery('document_srl',document_srl).setQuery('act','dispBoardWrite');window.close();} -function viewSkinInfo(module,skin){popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+module+"&skin="+skin,'SkinInfo');} -var addedDocument=new Array();function doAddDocumentCart(obj){var srl=obj.value;addedDocument[addedDocument.length]=srl;setTimeout(function(){callAddDocumentCart(addedDocument.length);},100);} -function callAddDocumentCart(document_length){if(addedDocument.length<1||document_length!=addedDocument.length)return;var params=new Array();params["srls"]=addedDocument.join(",");exec_xml("document","procDocumentAddCart",params,null);addedDocument=new Array();} -function transRGB2Hex(value){if(!value)return value;if(value.indexOf('#')>-1)return value.replace(/^#/,'');if(value.toLowerCase().indexOf('rgb')<0)return value;value=value.replace(/^rgb\(/i,'').replace(/\)$/,'');value_list=value.split(',');var hex='';for(var i=0;i>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;} -output=output+ -this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+ -this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);} -return output;},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);} -if(enc4!=64){output=output+String.fromCharCode(chr3);}} -output=Base64._utf8_decode(output);return output;},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);} -else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}} -return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;} -else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}} -return string;}} -if(typeof(resizeImageContents)=='undefined'){function resizeImageContents(){}} -if(typeof(activateOptionDisabled)=='undefined'){function activateOptionDisabled(){}} -objectExtend=jQuery.extend;function toggleDisplay(objId){jQuery('#'+objId).toggle();} -function checkboxSelectAll(formObj,name,checked){var itemName=name;var option={};if(typeof(formObj)!="undefined")option.wrap=formObj;if(typeof(checked)!="undefined")option.checked=checked;XE.checkboxToggleAll(itemName,option);} -function clickCheckBoxAll(formObj,name){var itemName=name;var option={doClick:true};if(typeof(formObj)!="undefined")option.wrap=formObj;XE.checkboxToggleAll(itemName,option);} -function svc_folder_open(id){jQuery("#_folder_open_"+id).hide();jQuery("#_folder_close_"+id).show();jQuery("#_folder_"+id).show();} -function svc_folder_close(id){jQuery("#_folder_open_"+id).show();jQuery("#_folder_close_"+id).hide();jQuery("#_folder_"+id).hide();} -function open_calendar(fo_id,day_str,callback_func){if(typeof(day_str)=="undefined")day_str="";var url="./common/tpl/calendar.php?";if(fo_id)url+="fo_id="+fo_id;if(day_str)url+="&day_str="+day_str;if(callback_func)url+="&callback_func="+callback_func;popopen(url,'Calendar');} -var loaded_popup_menus=XE.loaded_popup_menus;function createPopupMenu(){} -function chkPopupMenu(){} -function displayPopupMenu(ret_obj,response_tags,params){XE.displayPopupMenu(ret_obj,response_tags,params);} -function GetObjLeft(obj){return jQuery(obj).offset().left;} -function GetObjTop(obj){return jQuery(obj).offset().top;} -function replaceOuterHTML(obj,html){jQuery(obj).replaceWith(html);} -function getOuterHTML(obj){return jQuery(obj).html().trim();} -function setCookie(name,value,expire,path){var s_cookie=name+"="+escape(value)+ -((!expire)?"":("; expires="+expire.toGMTString()))+"; path="+((!path)?"/":path);document.cookie=s_cookie;} -jQuery(function(){jQuery(".lang_code").each(function() +/** + * @file common.js + * @author NHN (developers@xpressengine.com) + * @brief 몇가지 유용한 & 기본적으로 자주 사용되는 자바스크립트 함수들 모음 + **/ +if(jQuery)jQuery.noConflict();(function($){var UA=navigator.userAgent.toLowerCase();$.os={Linux:/linux/.test(UA),Unix:/x11/.test(UA),Mac:/mac/.test(UA),Windows:/win/.test(UA)};$.os.name=($.os.Windows)?'Windows':($.os.Linux)?'Linux':($.os.Unix)?'Unix':($.os.Mac)?'Mac':'';window.XE={loaded_popup_menus:new Array(),addedDocument:new Array(),checkboxToggleAll:function(){var itemName='cart';var options={wrap:null,checked:'toggle',doClick:false};switch(arguments.length){case 1:if(typeof(arguments[0])=="string"){itemName=arguments[0];}else{$.extend(options,arguments[0]||{});} +break;case 2:itemName=arguments[0];$.extend(options,arguments[1]||{});} +if(options.doClick==true)options.checked=null;if(typeof(options.wrap)=="string")options.wrap='#'+options.wrap;if(options.wrap){var obj=$(options.wrap).find('input[name='+itemName+']:checkbox');}else{var obj=$('input[name='+itemName+']:checkbox');} +if(options.checked=='toggle'){obj.each(function(){$(this).attr('checked',($(this).attr('checked'))?false:true);});}else{(options.doClick==true)?obj.click():obj.attr('checked',options.checked);}},displayPopupMenu:function(ret_obj,response_tags,params){var target_srl=params["target_srl"];var menu_id=params["menu_id"];var menus=ret_obj['menus'];var html="";if(this.loaded_popup_menus[menu_id]){html=this.loaded_popup_menus[menu_id];}else{if(menus){var item=menus['item'];if(typeof(item.length)=='undefined'||item.length<1)item=new Array(item);if(item.length){for(var i=0;i'+str+' ';}}} +this.loaded_popup_menus[menu_id]=html;} +if(html){var area=$('#popup_menu_area').html('
    '+html+'
');var areaOffset={top:params['page_y'],left:params['page_x']};if(area.outerHeight()+areaOffset.top>$(window).height()+$(window).scrollTop()) +areaOffset.top=$(window).height()-area.outerHeight()+$(window).scrollTop();if(area.outerWidth()+areaOffset.left>$(window).width()+$(window).scrollLeft()) +areaOffset.left=$(window).width()-area.outerWidth()+$(window).scrollLeft();area.css({top:areaOffset.top,left:areaOffset.left}).show();}}}})(jQuery);jQuery(function($){if(!$('#popup_menu_area').length){var menuObj=$('
').attr('id','popup_menu_area').css({display:'none',zIndex:9999});$(document.body).append(menuObj);} +$(document).click(function(evt){var area=$('#popup_menu_area');if(!area.length)return;area.hide();var targetObj=$(evt.target);if(!targetObj.length)return;if(targetObj.length&&$.inArray(targetObj.attr('nodeName'),['DIV','SPAN','A'])==-1)targetObj=targetObj.parent();if(!targetObj.length||$.inArray(targetObj.attr('nodeName'),['DIV','SPAN','A'])==-1)return;var class_name=targetObj.attr('className');if(class_name.indexOf('_')<=0)return;var class_name_list=class_name.split(' ');var menu_id='';var menu_id_regx=/^([a-zA-Z]+)_([0-9]+)$/;for(var i=0,c=class_name_list.length;i-1)?first_enable[i]:j;}} +if(!disabled_exists)return;sels.oldonchange=sels.onchange;sels.onchange=function(){if(this.options[this.selectedIndex].disabled){this.selectedIndex=first_enable[i];}else{if(this.oldonchange)this.oldonchange();}};if(sels.selectedIndex>=0&&sels.options[sels.selectedIndex].disabled)sels.onchange();});} +var drEditorFold=$('.xe_content .fold_button');if(drEditorFold.size()){var fold_container=$('div.fold_container',drEditorFold);$('button.more',drEditorFold).click(function(){$(this).hide().next('button').show().parent().next(fold_container).show();});$('button.less',drEditorFold).click(function(){$(this).hide().prev('button').show().parent().next(fold_container).hide();});}});String.prototype.getQuery=function(key){var idx=this.indexOf('?');if(idx==-1)return null;var query_string=this.substr(idx+1,this.length);var args={};query_string.replace(/([^=]+)=([^&]*)(&|$)/g,function(){args[arguments[1]]=arguments[2];});var q=args[key];if(typeof(q)=="undefined")q="";return q;} +String.prototype.setQuery=function(key,val){var idx=this.indexOf('?');var uri=this.replace(/#$/,'');if(idx!=-1){var query_string=uri.substr(idx+1,this.length),args={},q_list=[];uri=this.substr(0,idx);query_string.replace(/([^=]+)=([^&]*)(&|$)/g,function(all,key,val){args[key]=val;});args[key]=val;jQuery.each(args,function(key,val){if(!jQuery.trim(val))return;q_list.push(key+'='+decodeURI(val));});query_string=q_list.join('&');uri=uri+(query_string?'?'+query_string:'');}else{if(val.toString().trim())uri=uri+"?"+key+"="+val;} +var re=/https:\/\/([^:\/]+)(:\d+|)/i;var check=re.exec(uri);if(check) +{var toReplace="http://"+check[1];if(typeof(http_port)!='undefined'&&http_port!=80) +{toReplace+=":"+http_port;} +uri=uri.replace(re,toReplace);} +var bUseSSL=false;if(typeof(enforce_ssl)!='undefined'&&enforce_ssl) +{bUseSSL=true;} +else if(typeof(ssl_actions)!='undefined'&&typeof(ssl_actions.length)!='undefined'&&uri.getQuery('act')){var act=uri.getQuery('act');for(i=0;i-1&&!url.getQuery('vid'))url=url.setQuery('vid',xeVid);try{if(target!="_blank"&&winopen_list[target]){winopen_list[target].close();winopen_list[target]=null;}}catch(e){} +if(typeof(target)=='undefined')target='_blank';if(typeof(attribute)=='undefined')attribute='';var win=window.open(url,target,attribute);win.focus();if(target!="_blank")winopen_list[target]=win;} +function popopen(url,target){if(typeof(target)=="undefined")target="_blank";if(typeof(xeVid)!='undefined'&&url.indexOf(request_uri)>-1&&!url.getQuery('vid'))url=url.setQuery('vid',xeVid);winopen(url,target,"left=10,top=10,width=10,height=10,scrollbars=no,resizable=yes,toolbars=no");} +function sendMailTo(to){location.href="mailto:"+to;} +function move_url(url,open_wnidow){if(!url)return false;if(typeof(open_wnidow)=='undefined')open_wnidow='N';if(open_wnidow=='N'){open_wnidow=false;}else{open_wnidow=true;} +if(/^\./.test(url))url=request_uri+url;if(open_wnidow){winopen(url);}else{location.href=url;} +return false;} +function displayMultimedia(src,width,height,options){var html=_displayMultimedia(src,width,height,options);if(html)document.writeln(html);} +function _displayMultimedia(src,width,height,options){if(src.indexOf('files')==0)src=request_uri+src;var defaults={wmode:'transparent',allowScriptAccess:'sameDomain',quality:'high',flashvars:'',autostart:false};var params=jQuery.extend(defaults,options||{});var autostart=(params.autostart&¶ms.autostart!='false')?'true':'false';delete(params.autostart);var clsid="";var codebase="";var html="";if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(src)){html='';}else if(/\.flv$/i.test(src)||/\.mov$/i.test(src)||/\.moov$/i.test(src)||/\.m4v$/i.test(src)){html='';}else if(/\.swf/i.test(src)){clsid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';if(typeof(enforce_ssl)!='undefined'&&enforce_ssl){codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0";} +else{codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0";} +html='';html+='';for(var name in params){if(params[name]!='undefined'&¶ms[name]!=''){html+='';}} +html+='' ++'' ++'';}else{if(jQuery.browser.mozilla||jQuery.browser.opera){autostart=(params.autostart&¶ms.autostart!='false')?'1':'0';} +html='400){$body.css({overflow:'auto',overflowX:'hidden',height:400+'px'});}} +var $win=$(window);var $pc=$('#popup_content');var w=Math.max($pc[0].offsetWidth,600);var h=$pc[0].offsetHeight;var dw=$win.width();var dh=$win.height();var _w=0,_h=0;if(w!=dw)_w=w-dw;if(h!=dh)_h=h-dh;if(_w||_h){window.resizeBy(_w,_h);} +if(!arguments.callee.executed){setTimeout(setFixedPopupSize,300);arguments.callee.executed=true;}} +function doCallModuleAction(module,action,target_srl){var params=new Array();params['target_srl']=target_srl;params['cur_mid']=current_mid;exec_xml(module,action,params,completeCallModuleAction);} +function completeCallModuleAction(ret_obj,response_tags){if(ret_obj['message']!='success')alert(ret_obj['message']);location.reload();} +function completeMessage(ret_obj){alert(ret_obj['message']);location.reload();} +function doChangeLangType(obj){if(typeof(obj)=="string"){setLangType(obj);}else{var val=obj.options[obj.selectedIndex].value;setLangType(val);} +location.href=location.href.setQuery('l','');} +function setLangType(lang_type){var expire=new Date();expire.setTime(expire.getTime()+(7000*24*3600000));setCookie('lang_type',lang_type,expire,'/');} +function doDocumentPreview(obj){var fo_obj=obj;while(fo_obj.nodeName!="FORM"){fo_obj=fo_obj.parentNode;} +if(fo_obj.nodeName!="FORM")return;var editor_sequence=fo_obj.getAttribute('editor_sequence');var content=editorGetContent(editor_sequence);var win=window.open("","previewDocument","toolbars=no,width=700px;height=800px,scrollbars=yes,resizable=yes");var dummy_obj=jQuery("#previewDocument");if(!dummy_obj.length){jQuery('
'+''+''+''+'
').appendTo(document.body);dummy_obj=jQuery("#previewDocument")[0];} +if(dummy_obj){dummy_obj.content.value=content;dummy_obj.submit();}} +function doDocumentSave(obj){var editor_sequence=obj.form.getAttribute('editor_sequence');var prev_content=editorRelKeys[editor_sequence]['content'].value;if(typeof(editor_sequence)!='undefined'&&editor_sequence&&typeof(editorRelKeys)!='undefined'&&typeof(editorGetContent)=='function'){var content=editorGetContent(editor_sequence);editorRelKeys[editor_sequence]['content'].value=content;} +var params={},responses=['error','message','document_srl'],elms=obj.form.elements,data=jQuery(obj.form).serializeArray();;jQuery.each(data,function(i,field){var val=jQuery.trim(field.value);if(!val)return true;if(/\[\]$/.test(field.name))field.name=field.name.replace(/\[\]$/,'');if(params[field.name])params[field.name]+='|@|'+val;else params[field.name]=field.value;});exec_xml('member','procMemberSaveDocument',params,completeDocumentSave,responses,params,obj.form);editorRelKeys[editor_sequence]['content'].value=prev_content;return false;} +function completeDocumentSave(ret_obj){jQuery('input[name=document_srl]').eq(0).val(ret_obj['document_srl']);alert(ret_obj['message']);} +var objForSavedDoc=null;function doDocumentLoad(obj){objForSavedDoc=obj.form;popopen(request_uri.setQuery('module','member').setQuery('act','dispSavedDocumentList'));} +function doDocumentSelect(document_srl){if(!opener||!opener.objForSavedDoc){window.close();return;} +opener.location.href=opener.current_url.setQuery('document_srl',document_srl).setQuery('act','dispBoardWrite');window.close();} +function viewSkinInfo(module,skin){popopen("./?module=module&act=dispModuleSkinInfo&selected_module="+module+"&skin="+skin,'SkinInfo');} +var addedDocument=new Array();function doAddDocumentCart(obj){var srl=obj.value;addedDocument[addedDocument.length]=srl;setTimeout(function(){callAddDocumentCart(addedDocument.length);},100);} +function callAddDocumentCart(document_length){if(addedDocument.length<1||document_length!=addedDocument.length)return;var params=new Array();params["srls"]=addedDocument.join(",");exec_xml("document","procDocumentAddCart",params,null);addedDocument=new Array();} +function transRGB2Hex(value){if(!value)return value;if(value.indexOf('#')>-1)return value.replace(/^#/,'');if(value.toLowerCase().indexOf('rgb')<0)return value;value=value.replace(/^rgb\(/i,'').replace(/\)$/,'');value_list=value.split(',');var hex='';for(var i=0;i>2;enc2=((chr1&3)<<4)|(chr2>>4);enc3=((chr2&15)<<2)|(chr3>>6);enc4=chr3&63;if(isNaN(chr2)){enc3=enc4=64;}else if(isNaN(chr3)){enc4=64;} +output=output+ +this._keyStr.charAt(enc1)+this._keyStr.charAt(enc2)+ +this._keyStr.charAt(enc3)+this._keyStr.charAt(enc4);} +return output;},decode:function(input){var output="";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(i>4);chr2=((enc2&15)<<4)|(enc3>>2);chr3=((enc3&3)<<6)|enc4;output=output+String.fromCharCode(chr1);if(enc3!=64){output=output+String.fromCharCode(chr2);} +if(enc4!=64){output=output+String.fromCharCode(chr3);}} +output=Base64._utf8_decode(output);return output;},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);} +else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}} +return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;} +else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}} +return string;}} +if(typeof(resizeImageContents)=='undefined'){function resizeImageContents(){}} +if(typeof(activateOptionDisabled)=='undefined'){function activateOptionDisabled(){}} +objectExtend=jQuery.extend;function toggleDisplay(objId){jQuery('#'+objId).toggle();} +function checkboxSelectAll(formObj,name,checked){var itemName=name;var option={};if(typeof(formObj)!="undefined")option.wrap=formObj;if(typeof(checked)!="undefined")option.checked=checked;XE.checkboxToggleAll(itemName,option);} +function clickCheckBoxAll(formObj,name){var itemName=name;var option={doClick:true};if(typeof(formObj)!="undefined")option.wrap=formObj;XE.checkboxToggleAll(itemName,option);} +function svc_folder_open(id){jQuery("#_folder_open_"+id).hide();jQuery("#_folder_close_"+id).show();jQuery("#_folder_"+id).show();} +function svc_folder_close(id){jQuery("#_folder_open_"+id).show();jQuery("#_folder_close_"+id).hide();jQuery("#_folder_"+id).hide();} +function open_calendar(fo_id,day_str,callback_func){if(typeof(day_str)=="undefined")day_str="";var url="./common/tpl/calendar.php?";if(fo_id)url+="fo_id="+fo_id;if(day_str)url+="&day_str="+day_str;if(callback_func)url+="&callback_func="+callback_func;popopen(url,'Calendar');} +var loaded_popup_menus=XE.loaded_popup_menus;function createPopupMenu(){} +function chkPopupMenu(){} +function displayPopupMenu(ret_obj,response_tags,params){XE.displayPopupMenu(ret_obj,response_tags,params);} +function GetObjLeft(obj){return jQuery(obj).offset().left;} +function GetObjTop(obj){return jQuery(obj).offset().top;} +function replaceOuterHTML(obj,html){jQuery(obj).replaceWith(html);} +function getOuterHTML(obj){return jQuery(obj).html().trim();} +function setCookie(name,value,expire,path){var s_cookie=name+"="+escape(value)+ +((!expire)?"":("; expires="+expire.toGMTString()))+"; path="+((!path)?"/":path);document.cookie=s_cookie;} +jQuery(function(){jQuery(".lang_code").each(function() {var objText=jQuery(this);var targetName=objText.attr("id");if(typeof(targetName)=="undefined")targetName=objText.attr("name");if(typeof(targetName)=="undefined")return;objText.after("find_langcode");});}); \ No newline at end of file diff --git a/common/js/iepngfix_tilebg.js b/common/js/iepngfix_tilebg.js index 72ba3f3e2..7f2f8dda4 100644 --- a/common/js/iepngfix_tilebg.js +++ b/common/js/iepngfix_tilebg.js @@ -1,22 +1,22 @@ -// IE5.5+ PNG Alpha Fix v2.0 Alpha: Background Tiling Support -// (c) 2008 Angus Turnbull http://www.twinhelix.com - -// This is licensed under the GNU LGPL, version 2.1 or later. -// For details, see: http://creativecommons.org/licenses/LGPL/2.1/ -var IEPNGFix=window.IEPNGFix||{};IEPNGFix.tileBG=function(elm,pngSrc,ready){var data=this.data[elm.uniqueID],elmW=Math.max(elm.clientWidth,elm.scrollWidth),elmH=Math.max(elm.clientHeight,elm.scrollHeight),bgX=elm.currentStyle.backgroundPositionX,bgY=elm.currentStyle.backgroundPositionY,bgR=elm.currentStyle.backgroundRepeat;if(!data.tiles){data.tiles={elm:elm,src:'',cache:[],img:new Image(),old:{}};} -var tiles=data.tiles,pngW=tiles.img.width,pngH=tiles.img.height;if(pngSrc){if(!ready&&pngSrc!=tiles.src){tiles.img.onload=function(){this.onload=null;IEPNGFix.tileBG(elm,pngSrc,1);};return tiles.img.src=pngSrc;}}else{if(tiles.src)ready=1;pngW=pngH=0;} -tiles.src=pngSrc;if(!ready&&elmW==tiles.old.w&&elmH==tiles.old.h&&bgX==tiles.old.x&&bgY==tiles.old.y&&bgR==tiles.old.r){return;} -var pos={top:'0%',left:'0%',center:'50%',bottom:'100%',right:'100%'},x,y,pc;x=pos[bgX]||bgX;y=pos[bgY]||bgY;if(pc=x.match(/(\d+)%/)){x=Math.round((elmW-pngW)*(parseInt(pc[1])/100));} -if(pc=y.match(/(\d+)%/)){y=Math.round((elmH-pngH)*(parseInt(pc[1])/100));} -x=parseInt(x);y=parseInt(y);var repeatX={'repeat':1,'repeat-x':1}[bgR],repeatY={'repeat':1,'repeat-y':1}[bgR];if(repeatX){x%=pngW;if(x>0)x-=pngW;} -if(repeatY){y%=pngH;if(y>0)y-=pngH;} -this.hook.enabled=0;if(!({relative:1,absolute:1}[elm.currentStyle.position])){elm.style.position='relative';} -var count=0,xPos,maxX=repeatX?elmW:x+0.1,yPos,maxY=repeatY?elmH:y+0.1,d,s,isNew;if(pngW&&pngH){for(xPos=x;xPoselmW?elmW-xPos:pngW),clipB=(yPos+pngH>elmH?elmH-yPos:pngH);d=tiles.cache[count];s=d.style;s.behavior='none';s.left=xPos+'px';s.top=yPos+'px';s.width=clipR+'px';s.height=clipB+'px';s.clip='rect('+ -(yPos<0?0-yPos:0)+'px,'+ -clipR+'px,'+ -clipB+'px,'+ -(xPos<0?0-xPos:0)+'px)';s.display='block';if(isNew){s.position='absolute';s.zIndex=-999;if(elm.firstChild){elm.insertBefore(d,elm.firstChild);}else{elm.appendChild(d);}} -this.fix(d,pngSrc,0);count++;}}} -while(count0)x-=pngW;} +if(repeatY){y%=pngH;if(y>0)y-=pngH;} +this.hook.enabled=0;if(!({relative:1,absolute:1}[elm.currentStyle.position])){elm.style.position='relative';} +var count=0,xPos,maxX=repeatX?elmW:x+0.1,yPos,maxY=repeatY?elmH:y+0.1,d,s,isNew;if(pngW&&pngH){for(xPos=x;xPoselmW?elmW-xPos:pngW),clipB=(yPos+pngH>elmH?elmH-yPos:pngH);d=tiles.cache[count];s=d.style;s.behavior='none';s.left=xPos+'px';s.top=yPos+'px';s.width=clipR+'px';s.height=clipB+'px';s.clip='rect('+ +(yPos<0?0-yPos:0)+'px,'+ +clipR+'px,'+ +clipB+'px,'+ +(xPos<0?0-xPos:0)+'px)';s.display='block';if(isNew){s.position='absolute';s.zIndex=-999;if(elm.firstChild){elm.insertBefore(d,elm.firstChild);}else{elm.appendChild(d);}} +this.fix(d,pngSrc,0);count++;}}} +while(count=0)_apps.splice(nIndex,1);if($.isArray(_apps[sName])){nIndex=$.inArray(oApp,_apps[sName]);if(nIndex>=0)_apps[sName].splice(nIndex,1);} -if($.isFunction(oApp.deactivate))oApp.deactivate();},broadcast:function(msg,params){this._broadcast(this,msg,params);},_broadcast:function(sender,msg,params){for(var i=0;i<_apps.length;i++){_apps[i]._cast(sender,msg,params);} -this._cast(sender,msg,params);}} -_app_base={_plugins:[],_messages:{},getPlugin:function(sPluginName){sPluginName=sPluginName.toLowerCase();if($.isArray(this._plugins[sPluginName])){return this._plugins[sPluginName];}else{return[];}},registerPlugin:function(oPlugin){var self=this;var sName=oPlugin.getName().toLowerCase();if($.inArray(oPlugin,this._plugins)>=0)return false;this._plugins.push(oPlugin);if(!$.isArray(this._plugins[sName]))this._plugins[sName]=[];this._plugins[sName].push(oPlugin);$.each(oPlugin._binded_fn,function(api,fn){self.registerHandler(api,fn);});oPlugin.oApp=this;if($.isFunction(oPlugin.activate))oPlugin.activate();return true;},registerHandler:function(api,func){var msgs=this._messages;api=api.toUpperCase();if(!$.isArray(msgs[api]))msgs[api]=[];msgs[api].push(func);},cast:function(msg,params){return this._cast(this,msg,params||[]);},broadcast:function(sender,msg,params){if(this.parent&&this.parent._broadcast){this.parent._broadcast(sender,msg,params);}},_cast:function(sender,msg,params){var i,len;var aMsg=this._messages;msg=msg.toUpperCase();if(aMsg['BEFORE_'+msg]||this['API_BEFORE_'+msg]){var bContinue=this._cast(sender,'BEFORE_'+msg,params);if(!bContinue)return;} -var vRet=[],sFn='API_'+msg;if($.isArray(aMsg[msg])){for(i=0;i=0)_apps.splice(nIndex,1);if($.isArray(_apps[sName])){nIndex=$.inArray(oApp,_apps[sName]);if(nIndex>=0)_apps[sName].splice(nIndex,1);} +if($.isFunction(oApp.deactivate))oApp.deactivate();},broadcast:function(msg,params){this._broadcast(this,msg,params);},_broadcast:function(sender,msg,params){for(var i=0;i<_apps.length;i++){_apps[i]._cast(sender,msg,params);} +this._cast(sender,msg,params);}} +_app_base={_plugins:[],_messages:{},getPlugin:function(sPluginName){sPluginName=sPluginName.toLowerCase();if($.isArray(this._plugins[sPluginName])){return this._plugins[sPluginName];}else{return[];}},registerPlugin:function(oPlugin){var self=this;var sName=oPlugin.getName().toLowerCase();if($.inArray(oPlugin,this._plugins)>=0)return false;this._plugins.push(oPlugin);if(!$.isArray(this._plugins[sName]))this._plugins[sName]=[];this._plugins[sName].push(oPlugin);$.each(oPlugin._binded_fn,function(api,fn){self.registerHandler(api,fn);});oPlugin.oApp=this;if($.isFunction(oPlugin.activate))oPlugin.activate();return true;},registerHandler:function(api,func){var msgs=this._messages;api=api.toUpperCase();if(!$.isArray(msgs[api]))msgs[api]=[];msgs[api].push(func);},cast:function(msg,params){return this._cast(this,msg,params||[]);},broadcast:function(sender,msg,params){if(this.parent&&this.parent._broadcast){this.parent._broadcast(sender,msg,params);}},_cast:function(sender,msg,params){var i,len;var aMsg=this._messages;msg=msg.toUpperCase();if(aMsg['BEFORE_'+msg]||this['API_BEFORE_'+msg]){var bContinue=this._cast(sender,'BEFORE_'+msg,params);if(!bContinue)return;} +var vRet=[],sFn='API_'+msg;if($.isArray(aMsg[msg])){for(i=0;i 9?v['m']:'0'+v['m']; - - // 연간 달력이 아니라면 이 달의 날짜를 구한다. - if (cal.options.type != 'month') { - // 날짜에 사용할 달력 - v['weeks'] = []; - - var d = new Date(cal.date.getTime()), w = []; - var last = (v.m!=2)? ((v.m+(v.m>7?1:0))%2?31:30) : ((new Date(v.yyyy,v.m-1,29)).getMonth()==v.m?29:28); // 마지막 날 - - d.setDate(1); // 1일로 설정 후 1일의 요일을 가져온다. - var start = d.getDay(), end = last+start; - - for(var i=0,len=end+(7-(end%7||7));i= end) w.push(' '); - else w.push(''); - } - } - - // 템플릿 처리 - tpl = this._processTemplate(tpl, v); - obj.html(tpl); - - // 선택한 날짜 - if (cal.options.type == 'month') { - - } else { - var t = new Date(); - obj.find('td>button.day'+t.getFullYear()+'-'+(t.getMonth()+1)+'-'+t.getDate()).addClass('today'); - - t = cal.activeDate; - obj.find('td>button.day'+t.getFullYear()+'-'+(t.getMonth()+1)+'-'+t.getDate()).addClass('active'); - } - - // 이벤트 핸들러 - obj.find('button.close').click(function(){ $.calendar._hide(obj); }); - obj.find('button.today').click(function(){ $.calendar._moveToday(obj); }); - if (cal.options.type == 'month') { - obj.find('button.prev').click(function(){ $.calendar._prevYear(obj) }); - obj.find('button.next').click(function(){ $.calendar._nextYear(obj) }); - } else { - obj.find('button.prev').click(function(){ $.calendar._prevMonth(obj) }); - obj.find('button.next').click(function(){ $.calendar._nextMonth(obj) }); - obj.find('button.prev_year').click(function(){ $.calendar._prevYear(obj) }); - obj.find('button.next_year').click(function(){ $.calendar._nextYear(obj) }); - } - obj.find('td>button').click(function(){ $.calendar._selectDate(obj, $(this)) }); - }, - _selectDate : function(obj, btn) { - var cal = calendars[ this._getuid(obj) ]; - var date = btn.attr('class').match(/day([\d\-]+)/); - if (!date) return; - - date = date[1].split('-'); - - var ad = cal.activeDate; - ad.setFullYear(date[0]-0); - ad.setMonth(date[1]-1); - ad.setDate(date[2]-0); - - this._setDate(obj, ad); - }, - _setDate : function(obj, newDate) { - var uid = this._getuid(obj); - if (uid < 0) return null; - if (!newDate || !(newDate instanceof Date)) newDate = new Date(); - - var cal = calendars[uid]; - cal.activeDate = new Date(newDate.getTime()); - cal.date = new Date(newDate.getTime()); - this._draw(obj); - - if ($.isFunction(cal.options.select) && obj.hasClass('ui-calendar')) { - cal.options.select(newDate.getFullYear(), newDate.getMonth()+1, newDate.getDate()); - } - }, - _getDate : function(obj, format) { - var uid = this._getuid(obj); - if (uid < 0) return null; - if (typeof format != 'string') return calendars[uid].activeDate; - - // format string - }, - _moveToday : function(obj) { - calendars[this._getuid(obj)].date = new Date(); - this._draw(obj); - }, - _prevMonth : function(obj) { - var cal = calendars[this._getuid(obj)]; - var m = cal.date.getMonth(); - - cal.date.setDate(1); - if (m == 0) { - cal.date.setFullYear(cal.date.getFullYear()-1); - cal.date.setMonth(11); - } else { - cal.date.setMonth(m-1); - } - - this._draw(obj); - }, - _nextMonth : function(obj) { - var cal = calendars[this._getuid(obj)]; - var m = cal.date.getMonth(); - - cal.date.setDate(1); - if (m == 11) { - cal.date.setFullYear(cal.date.getFullYear()+1); - cal.date.setMonth(0); - } else { - cal.date.setMonth(m+1); - } - - this._draw(obj); - }, - _prevYear : function(obj) { - var cal = calendars[this._getuid(obj)]; - - cal.date.setFullYear(cal.date.getFullYear()-1); - this._draw(obj); - }, - _nextYear : function(obj) { - var cal = calendars[this._getuid(obj)]; - - cal.date.setFullYear(cal.date.getFullYear()+1); - this._draw(obj); - } -}); - -/** - * Invoke the calednar functionallity - * @return jQuery object - */ -$.fn.calendar = function(options) { - var args = $.makeArray(arguments); - - if (!$.calendar.initialized) { - $(document).mousedown($.calendar._checkExternalClick); - $.calendar.initialized = true; - } - - if (typeof options == 'string' && $.inArray(options, ['getDate'])) { - args.shift(); - return $.calendar['_'+options].apply($.calendar, [$(this[0])].concat(args) ); - } - - return this.each(function(){ - if (typeof options == 'string') { - args.shift(); - $.calendar['_'+ options].apply($.calendar, [$(this)].concat(args)); - } else { - $.calendar._attachCalendar($(this), options); - } - }); -} - -$.calendar = new Calendar(); // singleton instance -$.calendar.initialized = false; -$.calendar.uuid = new Date().getTime(); -$.calendar.version = $.ui.calendar.version; - -// template -template.calendar = '\ -\ -\ -\ - \ - \ - \ - \ - \ - \ - \ - \ - \ -\ -\ - {@week in weeks}\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - {/}\ -\ -
\ - \ - {yyyy}.{mm}.\ - \ - \ - \ - \ - \ - \ -
{lang.weekdays[0]}{lang.weekdays[1]}{lang.weekdays[2]}{lang.weekdays[3]}{lang.weekdays[4]}{lang.weekdays[5]}{lang.weekdays[6]}
{week[0]}{week[1]}{week[2]}{week[3]}{week[4]}{week[5]}{week[6]}
\ -'; - -template.month = '\ -\ -\ -\ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ - \ -\ -
\ - \ - {yyyy}.{mm} \ - \ - \ - \ -
\ -'; - +/** + * @brief XE Calendar + * @author NHN (developers@xpressengine.com) + * + * 사용법 + * + **/ +(function($){ + +if (!$.ui) $.ui = {}; +$.extend($.ui, { calendar: { version:'0.3' } }); + +var PROP_NAME = 'calendar'; +var index = 0; +var calendars = {}; +var template = {calendar:'',month:''}; + +function Calendar() { +} + +$.extend(Calendar.prototype, { + _activeCalendar : null, + _getuid : function(obj) { + var uid = obj.attr('class').match(/ui-calendar-(\d+-\d+)/); + + if (!uid) return -1; + return uid[1]; + }, + _show : function(obj) { + if (this._activeCalendar) this._hide(this._activeCalendar); + + // disabled? + if (obj.hasClass('ui-calendar-disabled')) return; + + // Active Calendar + this._activeCalendar = obj.show(300); + }, + _hide : function(obj) { + if (this._activeCalendar && this._activeCalendar.get(0) == obj.get(0)) this._activeCalendar = null; + obj.hide(300); + }, + _toggle : function(obj) { + (obj.css('display' ) == 'none')?this._show(obj):this._hide(obj); + }, + _attachCalendar : function(obj, options) { + if ((obj=$(obj)).hasClass('ui-calendar')) return; + + var uid = $.calendar.uuid+'-'+(index++); + var c = calendars[uid] = {}; + + // uid 추가 + obj.addClass('ui-calendar-'+uid).mousedown(function(){return false}); + + // default options + c.options = $.extend({ + type : 'day', + activeDate : '' + }, options||{}); + c.lang = $.extend({ + weekdays : 'Sun,Mon,Tue,Wed,Thu,Fri,Sat', + today : 'Today', + prevmonth : 'Prev Month', + nextmonth : 'Next Month', + prevyear : 'Prev Year', + nextyear : 'Next Year', + close : 'Close' + }, options.lang||{}); + + c.lang.weekdays = c.lang.weekdays.split(','); + + // 날짜 설정 + var d; + if (typeof c.options.activeDate == 'string' && c.options.activeDate) { + var s = c.options.activeDate.split('/'); + d = new Date(s[0], s[1]-1, s[2]-0); + } else { + d = new Date(); + } + this._setDate(obj, d); + + // 토글 버튼 + if (c.options.button) { + (c.button=$(c.options.button)).click(function(){ obj.calendar('toggle') }); + } + + // 클래스 추가 + obj.addClass('ui-calendar'); + + // position 설정한 후, 좌표를 (0,0)으로 변경 + var pos = obj.css({position:'absolute',top:0,left:0}).show().offset(); + + // 버튼의 위치 구해서 좌표 조정 + var bpos = c.button.offset(); + var dx = bpos.left - pos.left; + var dy = bpos.top - pos.top; + + // 좌표 조정 후 레이어 숨김 + obj.css({top:(dy+c.button.height())+'px',left:dx+'px'}).hide(); + }, + _checkExternalClick : function(e) { + if ($.calendar._activeCalendar) $.calendar._hide($.calendar._activeCalendar); + }, + _processTemplate : function(tpl, vars) { + tpl = (' '+tpl+' ').split(/[\{\}]/g); + + for(var i=0; i < tpl.length; i++) { + if (i%2) { + if (/^[\w\.\[\]]+$/.test(tpl[i])) tpl[i] = 'try{v=vv.'+tpl[i]+'}catch(e){v=""};ret.push(v);'; + else if (/^@(\w+)\s+in\s+(\w+)$/.test(tpl[i])) tpl[i] = 'for(i=0,l=vv.'+RegExp.$2+'.length;i 9?v['m']:'0'+v['m']; + + // 연간 달력이 아니라면 이 달의 날짜를 구한다. + if (cal.options.type != 'month') { + // 날짜에 사용할 달력 + v['weeks'] = []; + + var d = new Date(cal.date.getTime()), w = []; + var last = (v.m!=2)? ((v.m+(v.m>7?1:0))%2?31:30) : ((new Date(v.yyyy,v.m-1,29)).getMonth()==v.m?29:28); // 마지막 날 + + d.setDate(1); // 1일로 설정 후 1일의 요일을 가져온다. + var start = d.getDay(), end = last+start; + + for(var i=0,len=end+(7-(end%7||7));i= end) w.push(' '); + else w.push(''); + } + } + + // 템플릿 처리 + tpl = this._processTemplate(tpl, v); + obj.html(tpl); + + // 선택한 날짜 + if (cal.options.type == 'month') { + + } else { + var t = new Date(); + obj.find('td>button.day'+t.getFullYear()+'-'+(t.getMonth()+1)+'-'+t.getDate()).addClass('today'); + + t = cal.activeDate; + obj.find('td>button.day'+t.getFullYear()+'-'+(t.getMonth()+1)+'-'+t.getDate()).addClass('active'); + } + + // 이벤트 핸들러 + obj.find('button.close').click(function(){ $.calendar._hide(obj); }); + obj.find('button.today').click(function(){ $.calendar._moveToday(obj); }); + if (cal.options.type == 'month') { + obj.find('button.prev').click(function(){ $.calendar._prevYear(obj) }); + obj.find('button.next').click(function(){ $.calendar._nextYear(obj) }); + } else { + obj.find('button.prev').click(function(){ $.calendar._prevMonth(obj) }); + obj.find('button.next').click(function(){ $.calendar._nextMonth(obj) }); + obj.find('button.prev_year').click(function(){ $.calendar._prevYear(obj) }); + obj.find('button.next_year').click(function(){ $.calendar._nextYear(obj) }); + } + obj.find('td>button').click(function(){ $.calendar._selectDate(obj, $(this)) }); + }, + _selectDate : function(obj, btn) { + var cal = calendars[ this._getuid(obj) ]; + var date = btn.attr('class').match(/day([\d\-]+)/); + if (!date) return; + + date = date[1].split('-'); + + var ad = cal.activeDate; + ad.setFullYear(date[0]-0); + ad.setMonth(date[1]-1); + ad.setDate(date[2]-0); + + this._setDate(obj, ad); + }, + _setDate : function(obj, newDate) { + var uid = this._getuid(obj); + if (uid < 0) return null; + if (!newDate || !(newDate instanceof Date)) newDate = new Date(); + + var cal = calendars[uid]; + cal.activeDate = new Date(newDate.getTime()); + cal.date = new Date(newDate.getTime()); + this._draw(obj); + + if ($.isFunction(cal.options.select) && obj.hasClass('ui-calendar')) { + cal.options.select(newDate.getFullYear(), newDate.getMonth()+1, newDate.getDate()); + } + }, + _getDate : function(obj, format) { + var uid = this._getuid(obj); + if (uid < 0) return null; + if (typeof format != 'string') return calendars[uid].activeDate; + + // format string + }, + _moveToday : function(obj) { + calendars[this._getuid(obj)].date = new Date(); + this._draw(obj); + }, + _prevMonth : function(obj) { + var cal = calendars[this._getuid(obj)]; + var m = cal.date.getMonth(); + + cal.date.setDate(1); + if (m == 0) { + cal.date.setFullYear(cal.date.getFullYear()-1); + cal.date.setMonth(11); + } else { + cal.date.setMonth(m-1); + } + + this._draw(obj); + }, + _nextMonth : function(obj) { + var cal = calendars[this._getuid(obj)]; + var m = cal.date.getMonth(); + + cal.date.setDate(1); + if (m == 11) { + cal.date.setFullYear(cal.date.getFullYear()+1); + cal.date.setMonth(0); + } else { + cal.date.setMonth(m+1); + } + + this._draw(obj); + }, + _prevYear : function(obj) { + var cal = calendars[this._getuid(obj)]; + + cal.date.setFullYear(cal.date.getFullYear()-1); + this._draw(obj); + }, + _nextYear : function(obj) { + var cal = calendars[this._getuid(obj)]; + + cal.date.setFullYear(cal.date.getFullYear()+1); + this._draw(obj); + } +}); + +/** + * Invoke the calednar functionallity + * @return jQuery object + */ +$.fn.calendar = function(options) { + var args = $.makeArray(arguments); + + if (!$.calendar.initialized) { + $(document).mousedown($.calendar._checkExternalClick); + $.calendar.initialized = true; + } + + if (typeof options == 'string' && $.inArray(options, ['getDate'])) { + args.shift(); + return $.calendar['_'+options].apply($.calendar, [$(this[0])].concat(args) ); + } + + return this.each(function(){ + if (typeof options == 'string') { + args.shift(); + $.calendar['_'+ options].apply($.calendar, [$(this)].concat(args)); + } else { + $.calendar._attachCalendar($(this), options); + } + }); +} + +$.calendar = new Calendar(); // singleton instance +$.calendar.initialized = false; +$.calendar.uuid = new Date().getTime(); +$.calendar.version = $.ui.calendar.version; + +// template +template.calendar = '\ +\ +\ +\ + \ + \ + \ + \ + \ + \ + \ + \ + \ +\ +\ + {@week in weeks}\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + {/}\ +\ +
\ + \ + {yyyy}.{mm}.\ + \ + \ + \ + \ + \ + \ +
{lang.weekdays[0]}{lang.weekdays[1]}{lang.weekdays[2]}{lang.weekdays[3]}{lang.weekdays[4]}{lang.weekdays[5]}{lang.weekdays[6]}
{week[0]}{week[1]}{week[2]}{week[3]}{week[4]}{week[5]}{week[6]}
\ +'; + +template.month = '\ +\ +\ +\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +\ +
\ + \ + {yyyy}.{mm} \ + \ + \ + \ +
\ +'; + })(jQuery); \ No newline at end of file diff --git a/common/js/plugins/ui.colorpicker/xe_colorpicker.js b/common/js/plugins/ui.colorpicker/xe_colorpicker.js index 8e592ce4d..1825ed917 100644 --- a/common/js/plugins/ui.colorpicker/xe_colorpicker.js +++ b/common/js/plugins/ui.colorpicker/xe_colorpicker.js @@ -1,366 +1,366 @@ -/** - * @brief XE Colorpicker - * @author NHN (developers@xpressengine.com) - **/ -jQuery(function($){ - var ready = false; - var tmp = $('').hide(); - // var panel = null; - - $.fn.xe_colorpicker = function(settings){ - var selection = this; - - if (!ready) { - ColorPicker.init(settings); - ready = true; - } - - this.each(function(){ - var col = color($(this).val()); - - $(this).val( col ).css('background-color', col ); - setTextColor( $(this) ); - }).focus(function(event){ - var t = this; - $(this).select(); - - // show color picker - ColorPicker.show(this); - }).keypress(function(event){ - if (!ColorPicker.is(':visible')) return; - - if (/^#?[0-9a-f]{6}$/i.test( event.target.value )) { - ColorPicker.color( event.target.value ); - } - }); - - $(document).mousedown(function(event){ - var target = event.target; - - if (selection.index(target) > -1) return; - if ($(target).parents().add(target).index(ColorPicker.element) > -1) return; - if ($(target).parents().add(target).index(ColorPicker.buttons) > -1) return; - - ColorPicker.hide(); - }); - - return this; - }; - - var ColorPicker = { - element : null, - picker : null, - colpane: null, - buttons : null, - _target : null, - _backup : null, - _hsv : null, - _mode : 'none', - - init : function() { - var cp = this; - - this.element = $('
'); - - this.picker = this.element.find('> div.colorpicker'); - this.colpane = this.picker.find('div.colortable > div.background'); - this.colpoint = this.colpane.find('> .indicator'); - this.buttons = this.element.find('> div.buttons'); - this.huepane = this.element.find('div.huebar > .background'); - this.huepoint = this.huepane.find('> .indicator'); - - this._mousedown = method(this.onmousedown, this); - this._mousemove = method(this.onmousemove, this); - this._mouseup = method(this.onmouseup, this); - - this.picker.find('.background').mousedown(this._mousedown); - - this.buttons.find('button.ok').click(method(this.ok,this)); - this.buttons.find('button.cancel').click(method(this.cancel,this)); - this.buttons.find('button.none').click(method(this.none,this)); - - // only for IE6 - if ($.browser.msie && parseInt($.browser.version) < 7) { - this.element.append( $(''.replace(/%id%/g, frame_id)).appendTo(document.body); - } - - $('#'+form_id).remove(); - var form = $('
'.replace(/%id%/g, form_id)).attr({ - 'id' : form_id, - 'method' : 'post', - 'action' : url, - 'target' : frame_id - }); - - params['xeVirtualRequestMethod'] = 'xml'; - params['xeRequestURI'] = location.href.replace(/#(.*)$/i,''); - params['xeVirtualRequestUrl'] = request_uri; - - $.each(params, function(key, value){ - $('').attr('name', key).attr('value', value).appendTo(form); - }); - - form.appendTo(document.body).submit(); -} -function arr2obj(arr) { - var ret = {}; - for(var key in arr) { - if(arr.hasOwnProperty(key)) ret[key] = arr[key]; - } - return ret; -} - -/** - * @brief exec_json (exec_xml와 같은 용도) - **/ -$.exec_json = function(action,data,func){ - if(typeof(data) == 'undefined') data = {}; - action = action.split("."); - if(action.length == 2){ - - if(show_waiting_message) { - $("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible'); - } - - $.extend(data,{module:action[0],act:action[1]}); - if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid}); - $.ajax({ - type:"POST" - ,dataType:"json" - ,url:request_uri - ,contentType:"application/json" - ,data:$.param(data) - ,success : function(data){ - $("#waitingforserverresponse").css('visibility','hidden'); - if(data.error > 0) alert(data.message); - if($.isFunction(func)) func(data); - } - }); - } -}; - -$.fn.exec_html = function(action,data,type,func,args){ - if(typeof(data) == 'undefined') data = {}; - if(!$.inArray(type, ['html','append','prepend'])) type = 'html'; - - var self = $(this); - action = action.split("."); - if(action.length == 2){ - if(show_waiting_message) { - $("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible'); - } - - $.extend(data,{module:action[0],act:action[1]}); - $.ajax({ - type:"POST" - ,dataType:"html" - ,url:request_uri - ,data:$.param(data) - ,success : function(html){ - $("#waitingforserverresponse").css('visibility','hidden'); - self[type](html); - if($.isFunction(func)) func(args); - } - }); - } -}; -})(jQuery); +/** + * @file common/js/xml_handler.js + * @brief XE에서 ajax기능을 이용함에 있어 module, act를 잘 사용하기 위한 자바스크립트 + **/ + +// xml handler을 이용하는 user function +var show_waiting_message = true; + +/* This work is licensed under Creative Commons GNU LGPL License. + + License: http://creativecommons.org/licenses/LGPL/2.1/ + Version: 0.9 + Author: Stefan Goessner/2006 + Web: http://goessner.net/ +*/ +function xml2json(xml, tab, ignoreAttrib) { + var X = { + toObj: function(xml) { + var o = {}; + if (xml.nodeType==1) { // element node .. + if (ignoreAttrib && xml.attributes.length) // element with attributes .. + for (var i=0; i 1) + o = X.escape(X.innerXml(xml)); + else + for (var n=xml.firstChild; n; n=n.nextSibling){ + //o["#cdata"] = X.escape(n.nodeValue); + o = X.escape(n.nodeValue); + } + } + } + if (!xml.attributes.length && !xml.firstChild) o = null; + } + else if (xml.nodeType==9) { // document.node + o = X.toObj(xml.documentElement); + } + else + alert("unhandled node type: " + xml.nodeType); + return o; + }, + toJson: function(o, name, ind) { + var json = name ? ("\""+name+"\"") : ""; + if (o instanceof Array) { + for (var i=0,n=o.length; i 1 ? ("\n"+ind+"\t"+o.join(",\n"+ind+"\t")+"\n"+ind) : o.join("")) + "]"; + } + else if (o == null) + json += (name&&":") + "null"; + else if (typeof(o) == "object") { + var arr = []; + for (var m in o) + arr[arr.length] = X.toJson(o[m], m, ind+"\t"); + json += (name?":{":"{") + (arr.length > 1 ? ("\n"+ind+"\t"+arr.join(",\n"+ind+"\t")+"\n"+ind) : arr.join("")) + "}"; + } + else if (typeof(o) == "string") + json += (name&&":") + "\"" + o.toString() + "\""; + else + json += (name&&":") + o.toString(); + return json; + }, + innerXml: function(node) { + var s = "" + if ("innerHTML" in node) + s = node.innerHTML; + else { + var asXml = function(n) { + var s = ""; + if (n.nodeType == 1) { + s += "<" + n.nodeName; + for (var i=0; i"; + } + else + s += "/>"; + } + else if (n.nodeType == 3) + s += n.nodeValue; + else if (n.nodeType == 4) + s += ""; + return s; + }; + for (var c=node.firstChild; c; c=c.nextSibling) + s += asXml(c); + } + return s; + }, + escape: function(txt) { + return txt.replace(/[\\]/g, "\\\\") + .replace(/[\"]/g, '\\"') + .replace(/[\n]/g, '\\n') + .replace(/[\r]/g, '\\r'); + }, + removeWhite: function(e) { + e.normalize(); + for (var n = e.firstChild; n; ) { + if (n.nodeType == 3) { // text node + if (!n.nodeValue.match(/[^ \f\n\r\t\v]/)) { // pure whitespace text node + var nxt = n.nextSibling; + e.removeChild(n); + n = nxt; + } + else + n = n.nextSibling; + } + else if (n.nodeType == 1) { // element node + X.removeWhite(n); + n = n.nextSibling; + } + else // any other node + n = n.nextSibling; + } + return e; + } + }; + if (xml.nodeType == 9) // document node + xml = xml.documentElement; + + var json_obj = X.toObj(X.removeWhite(xml)), json_str; + + if (typeof(JSON)=='object' && jQuery.isFunction(JSON.stringify) && false) { + var obj = {}; obj[xml.nodeName] = json_obj; + json_str = JSON.stringify(obj); + return json_str; + } else { + json_str = X.toJson(json_obj, xml.nodeName, ""); + return "{" + (tab ? json_str.replace(/\t/g, tab) : json_str.replace(/\t|\n/g, "")) + "}"; + } +} + +(function($){ +/** + * @brief exec_xml + * @author NHN (developers@xpressengine.com) + **/ +$.exec_xml = window.exec_xml = function(module, act, params, callback_func, response_tags, callback_func_arg, fo_obj) { + var xml_path = request_uri+"index.php" + if(!params) params = {}; + + // {{{ set parameters + if($.isArray(params)) params = arr2obj(params); + params['module'] = module; + params['act'] = act; + + if(typeof(xeVid)!='undefined') params['vid'] = xeVid; + if(typeof(response_tags)=="undefined" || response_tags.length<1) response_tags = ['error','message']; + else { + response_tags.push('error', 'message'); + } + // }}} set parameters + + // use ssl? + if ($.isArray(ssl_actions) && params['act'] && $.inArray(params['act'], ssl_actions) >= 0) + { + var url = default_url || request_uri; + var port = window.https_port || 443; + var _ul = $('').attr('href', url)[0]; + var target = 'https://' + _ul.hostname.replace(/:\d+$/, ''); + + if(port != 443) target += ':'+port; + if(_ul.pathname[0] != '/') target += '/'; + + target += _ul.pathname; + xml_path = target.replace(/\/$/, '')+'/index.php'; + } + + var _u1 = $('').attr('href', location.href)[0]; + var _u2 = $('').attr('href', xml_path)[0]; + + // 현 url과 ajax call 대상 url의 schema 또는 port가 다르면 직접 form 전송 + if(_u1.protocol != _u2.protocol || _u1.port != _u2.port) return send_by_form(xml_path, params); + + var xml = [], i = 0; + xml[i++] = ''; + xml[i++] = ''; + xml[i++] = ''; + + $.each(params, function(key, val) { + xml[i++] = '<'+key+'>'; + }); + + xml[i++] = ''; + xml[i++] = ''; + + var _xhr = null; + if (_xhr && _xhr.readyState != 0) _xhr.abort(); + + // 전송 성공시 + function onsuccess(data, textStatus, xhr) { + var resp_xml = $(data).find('response')[0], resp_obj, txt='', ret=[], tags={}, json_str=''; + + waiting_obj.css('visibility', 'hidden'); + + if(!resp_xml) { + alert(_xhr.responseText); + return null; + } + + json_str = xml2json(resp_xml, false, false); + resp_obj = (typeof(JSON)=='object' && $.isFunction(JSON.parse))?JSON.parse(json_str):eval('('+json_str+')'); + resp_obj = resp_obj.response; + + if (typeof(resp_obj)=='undefined') { + ret['error'] = -1; + ret['message'] = 'Unexpected error occured.'; + try { + if(typeof(txt=resp_xml.childNodes[0].firstChild.data)!='undefined') ret['message'] += '\r\n'+txt; + } catch(e){}; + return ret; + } + + $.each(response_tags, function(key, val){ tags[val] = true; }); + tags["redirect_url"] = true; + tags["act"] = true; + $.each(resp_obj, function(key, val){ if(tags[key]) ret[key] = val; }); + + if(ret['error'] != 0) { + if ($.isFunction($.exec_xml.onerror)) { + return $.exec_xml.onerror(module, act, ret, callback_func, response_tags, callback_func_arg, fo_obj); + } + + alert(ret['message'] || 'error!'); + return null; + } + + if(ret['redirect_url']) { + location.href = ret['redirect_url'].replace(/&/g, '&'); + return null; + } + + if($.isFunction(callback_func)) callback_func(ret, response_tags, callback_func_arg, fo_obj); + } + + // 모든 xml데이터는 POST방식으로 전송. try-catch문으로 오류 발생시 대처 + try { + $.ajax({ + url : xml_path, + type : 'POST', + dataType : 'xml', + data : xml.join('\n'), + contentType : 'text/plain', + beforeSend : function(xhr){ _xhr = xhr; }, + success : onsuccess, + error : function(xhr, textStatus) { + waiting_obj.css('visibility', 'hidden'); + + var msg = ''; + if (textStatus == 'parsererror') { + msg = 'The result is not valid XML :\n-------------------------------------\n'; + if(xhr.responseText == "") return; + msg += xhr.responseText.replace(/<[^>]+>/g, ''); + } else { + msg = textStatus; + } + + alert(msg); + } + }); + } catch(e) { + alert(e); + return; + } + + // ajax 통신중 대기 메세지 출력 (show_waiting_message값을 false로 세팅시 보이지 않음) + var waiting_obj = $('#waitingforserverresponse'); + if(show_waiting_message && waiting_obj.length) { + var d = $(document); + waiting_obj.html(waiting_message).css({ + 'top' : (d.scrollTop()+20)+'px', + 'left' : (d.scrollLeft()+20)+'px', + 'visibility' : 'visible' + }); + } +} +function send_by_form(url, params) { + var frame_id = 'xeTmpIframe'; + var form_id = 'xeVirtualForm'; + + if (!$('#'+frame_id).length) { + $(''.replace(/%id%/g, frame_id)).appendTo(document.body); + } + + $('#'+form_id).remove(); + var form = $('
'.replace(/%id%/g, form_id)).attr({ + 'id' : form_id, + 'method' : 'post', + 'action' : url, + 'target' : frame_id + }); + + params['xeVirtualRequestMethod'] = 'xml'; + params['xeRequestURI'] = location.href.replace(/#(.*)$/i,''); + params['xeVirtualRequestUrl'] = request_uri; + + $.each(params, function(key, value){ + $('').attr('name', key).attr('value', value).appendTo(form); + }); + + form.appendTo(document.body).submit(); +} +function arr2obj(arr) { + var ret = {}; + for(var key in arr) { + if(arr.hasOwnProperty(key)) ret[key] = arr[key]; + } + return ret; +} + +/** + * @brief exec_json (exec_xml와 같은 용도) + **/ +$.exec_json = function(action,data,func){ + if(typeof(data) == 'undefined') data = {}; + action = action.split("."); + if(action.length == 2){ + + if(show_waiting_message) { + $("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible'); + } + + $.extend(data,{module:action[0],act:action[1]}); + if(typeof(xeVid)!='undefined') $.extend(data,{vid:xeVid}); + $.ajax({ + type:"POST" + ,dataType:"json" + ,url:request_uri + ,contentType:"application/json" + ,data:$.param(data) + ,success : function(data){ + $("#waitingforserverresponse").css('visibility','hidden'); + if(data.error > 0) alert(data.message); + if($.isFunction(func)) func(data); + } + }); + } +}; + +$.fn.exec_html = function(action,data,type,func,args){ + if(typeof(data) == 'undefined') data = {}; + if(!$.inArray(type, ['html','append','prepend'])) type = 'html'; + + var self = $(this); + action = action.split("."); + if(action.length == 2){ + if(show_waiting_message) { + $("#waitingforserverresponse").html(waiting_message).css('top',$(document).scrollTop()+20).css('left',$(document).scrollLeft()+20).css('visibility','visible'); + } + + $.extend(data,{module:action[0],act:action[1]}); + $.ajax({ + type:"POST" + ,dataType:"html" + ,url:request_uri + ,data:$.param(data) + ,success : function(html){ + $("#waitingforserverresponse").css('visibility','hidden'); + self[type](html); + if($.isFunction(func)) func(args); + } + }); + } +}; +})(jQuery); diff --git a/common/js/src/xml_js_filter.js b/common/js/src/xml_js_filter.js index 993d748fb..f03278515 100644 --- a/common/js/src/xml_js_filter.js +++ b/common/js/src/xml_js_filter.js @@ -1,338 +1,338 @@ -/** - * @file common/js/xml_js_filter.js - * @author NHN (developers@xpressengine.com) - * @brief xml filter (validator) plugin - * - * A rule is a method validate one field. - * A filter is made up of one or more rules. - **/ -(function($){ - -var messages = []; -var rules = []; -var filters = []; -var callbacks = []; -var extras = {}; - -var Validator = xe.createApp('Validator', { - init : function() { - // {{{ add filters - // email - var regEmail = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/; - this.cast('ADD_RULE', ['email', regEmail]); - this.cast('ADD_RULE', ['email_address', regEmail]); - - // userid - var regUserid = /^[a-z]+[\w-]*[a-z0-9_]+$/i; - this.cast('ADD_RULE', ['userid', regUserid]); - this.cast('ADD_RULE', ['user_id', regUserid]); - - // url - var regUrl = /^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/; - this.cast('ADD_RULE', ['url', regUrl]); - this.cast('ADD_RULE', ['homepage', regUrl]); - - // korean - var regKor = /^[가-힣]*$/; - this.cast('ADD_RULE', ['korean', regKor]); - - // korean_number - var regKorNum = /^[가-힣0-9]*$/; - this.cast('ADD_RULE', ['korean_number', regKorNum]); - - // alpha - var regAlpha = /^[a-z]*$/i; - this.cast('ADD_RULE', ['alpha', regAlpha]); - - // alpha_number - var regAlphaNum = /^[a-z][a-z0-9_]*$/i; - this.cast('ADD_RULE', ['alpha_number', regAlphaNum]); - - // number - var regNum = /^[0-9]*$/; - this.cast('ADD_RULE', ['number', regNum]); - // }}} add filters - }, - // run validator - run : function(oForm) { - var filter = ''; - - if (oForm._filter) filter = oForm._filter.value; - - var params = [oForm, filter]; - var result = this.cast('VALIDATE', params); - if (typeof result == 'undefined') result = false; - - return result; - }, - API_ONREADY : function() { - var self = this; - - // hook form submit event - $('form') - .each(function(){ - if (this.onsubmit) { - this['xe:onsubmit'] = this.onsubmit; - this.onsubmit = null; - } - }) - .submit(function(){ - var legacyFn = this['xe:onsubmit']; - var hasLegacyFn = $.isFunction(legacyFn); - var bResult = hasLegacyFn?legacyFn.apply(this):self.run(this); - - return bResult; - }); - }, - API_VALIDATE : function(sender, params) { - var self = this, result = true, form = params[0], filter=null, callback=null; - - if (form.elements['_filter']) filter = form.elements['_filter'].value; - if (!filter) return true; - if ($.isFunction(callbacks[filter])) callback = callbacks[filter]; - filter = $.extend({}, filters[filter.toLowerCase()] || {}, extras); - - $.each(filter, function(name) { - var _el = form.elements[name]; - - if (!_el) return true; - - var el = $(_el), val = $.trim(get_value(el)); - var minlen = parseInt(this.minlength) || 0; - var maxlen = parseInt(this.maxlength) || 0; - var rule = (this.rule || '').split(','); - - if (this.required && !val) return (result = (!!self.cast('ALERT', [form, name, 'isnull']) && false)); - if (!this.required && !val) return (result = true); - if ((minlen && val.length < minlen) || (maxlen && val.length > maxlen)) return (result = (!!self.cast('ALERT', [form, name, 'outofrange', minlen, maxlen]) && false)); - - if (this.equalto) { - var eq_val = get_value($(form.elements[this.equalto])); - if (eq_val != val) return (result = (!!self.cast('ALERT', [form, name, 'equalto']) && false)); - } - - if (rule) { - $.each(rule, function(i,r) { - if (!r) return true; - - var ret = self.cast('APPLY_RULE', [r, val]); - if (!ret) { - self.cast('ALERT', [form, name, 'invalid_'+this]); - return (result = false); - } - }); - } - - if (!result) return false; - }); - - if (!result) return false; - if ($.isFunction(callback)) return callback(form); - - return true; - }, - API_ADD_RULE : function(sender, params) { - var name = params[0].toLowerCase(); - rules[name] = params[1]; - }, - API_DEL_RULE : function(sender, params) { - var name = params[0].toLowerCase(); - delete rules[name]; - }, - API_GET_RULE : function(sender, params) { - var name = params[0].toLowerCase(); - - if (rules[name]) { - return rules[name]; - } else { - return null; - } - }, - API_ADD_FILTER : function(sender, params) { - var name = params[0].toLowerCase(); - var filter = params[1]; - - filters[name] = filter; - }, - API_DEL_FILTER : function(sender, params) { - var name = params[0].toLowerCase(); - delete filters[name]; - }, - API_GET_FILTER : function(sender, params) { - var name = params[0].toLowerCase(); - - if (filters[name]) { - return filters[name]; - } else { - return null; - } - }, - API_ADD_EXTRA_FIELD : function(sender, params) { - var name = params[0].toLowerCase(); - var prop = params[1]; - - extras[name] = prop; - }, - API_GET_EXTRA_FIELD : function(sender, params) { - var name = params[0].toLowerCase(); - return extras[name]; - }, - API_DEL_EXTRA_FIELD : function(sender, params) { - var name = params[0].toLowerCase(); - delete extras[name]; - }, - API_APPLY_RULE : function(sender, params) { - var name = params[0]; - var value = params[1]; - - if (typeof(rules[name]) == 'undefined') return true; // no filter - if ($.isFunction(rules[name])) return rules[name](value); - if (rules[name] instanceof RegExp) return rules[name].test(value); - - return true; - }, - API_ALERT : function(sender, params) { - var form = params[0]; - var field_name = params[1]; - var msg_code = params[2]; - var minlen = params[3]; - var maxlen = params[4]; - - var field_msg = this.cast('GET_MESSAGE', [field_name]); - var msg = this.cast('GET_MESSAGE', [msg_code]); - - if (msg != msg_code) msg = (msg.indexOf('%s')<0)?(field_msg+msg):(msg.replace('%s',field_msg)); - if (minlen||maxlen) msg += '('+(minlen||'')+'~'+(maxlen||'')+')'; - - this.cast('SHOW_ALERT', [msg]); - - // set focus - $(form.elements[field_name]).focus(); - }, - API_SHOW_ALERT : function(sender, params) { - alert(params[0]); - }, - API_ADD_MESSAGE : function(sender, params) { - var msg_code = params[0]; - var msg_str = params[1]; - - messages[msg_code] = msg_str; - }, - API_GET_MESSAGE : function(sender, params) { - var msg_code = params[0]; - - return messages[msg_code] || msg_code; - }, - API_ADD_CALLBACK : function(sender, params) { - var name = params[0]; - var func = params[1]; - - callbacks[name] = func; - }, - API_REMOVE_CALLBACK : function(sender, params) { - var name = params[0]; - - delete callbacks[name]; - } -}); - -var oValidator = new Validator; - -// register validator -xe.registerApp(oValidator); - -// 호환성을 위해 추가한 플러그인 - 에디터에서 컨텐트를 가져와서 설정한다. -var EditorStub = xe.createPlugin('editor_stub', { - API_BEFORE_VALIDATE : function(sender, params) { - var form = params[0]; - var seq = form.getAttribute('editor_sequence'); - - // bug fix for IE6,7 - if (seq && typeof seq == 'object') seq = seq.value; - - if (seq) { - try { - editorRelKeys[seq].content.value = editorRelKeys[seq].func(seq) || ''; - } catch(e) { } - } - } -}); -oValidator.registerPlugin(new EditorStub); - -// functions -function get_value(elem) { - var vals = []; - if (elem.is(':radio')){ - return elem.filter(':checked').val(); - } else if (elem.is(':checkbox')) { - elem.filter(':checked').each(function(){ - vals.push(this.value); - }); - return vals.join('|@|'); - } else { - return elem.val(); - } -} - -})(jQuery); - -/** - * @function filterAlertMessage - * @brief ajax로 서버에 요청후 결과를 처리할 callback_function을 지정하지 않았을 시 호출되는 기본 함수 - **/ -function filterAlertMessage(ret_obj) { - var error = ret_obj["error"]; - var message = ret_obj["message"]; - var act = ret_obj["act"]; - var redirect_url = ret_obj["redirect_url"]; - var url = location.href; - - if(typeof(message)!="undefined"&&message&&message!="success") alert(message); - - if(typeof(act)!="undefined" && act) url = current_url.setQuery("act", act); - else if(typeof(redirect_url)!="undefined" && redirect_url) url = redirect_url; - - if(url == location.href) url = url.replace(/#(.*)$/,''); - - location.href = url; -} - -/** - * @brief Function to process filters - * @deprecated - */ -function procFilter(form, filter_func) { - filter_func(form); - return false; -} - -function legacy_filter(filter_name, form, module, act, callback, responses, confirm_msg, rename_params) { - var v = xe.getApp('Validator')[0], $ = jQuery, args = []; - - if (!v) return false; - - if (!form.elements['_filter']) $(form).prepend(''); - form.elements['_filter'].value = filter_name; - - args[0] = filter_name; - args[1] = function(f) { - var params = {}, res = [], elms = f.elements, data = $(f).serializeArray(); - $.each(data, function(i, field) { - var v = $.trim(field.value), n = field.name; - if(!v || !n) return true; - if(rename_params[n]) n = rename_params[n]; - - if(/\[\]$/.test(n)) n = n.replace(/\[\]$/, ''); - if(params[n]) params[n] += '|@|'+v; - else params[n] = field.value; - }); - - if (confirm_msg && !confirm(confirm_msg)) return false; - exec_xml(module, act, params, callback, responses, params, form); - }; - - v.cast('ADD_CALLBACK', args); - v.cast('VALIDATE', [form, filter_name]); - - return false; +/** + * @file common/js/xml_js_filter.js + * @author NHN (developers@xpressengine.com) + * @brief xml filter (validator) plugin + * + * A rule is a method validate one field. + * A filter is made up of one or more rules. + **/ +(function($){ + +var messages = []; +var rules = []; +var filters = []; +var callbacks = []; +var extras = {}; + +var Validator = xe.createApp('Validator', { + init : function() { + // {{{ add filters + // email + var regEmail = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/; + this.cast('ADD_RULE', ['email', regEmail]); + this.cast('ADD_RULE', ['email_address', regEmail]); + + // userid + var regUserid = /^[a-z]+[\w-]*[a-z0-9_]+$/i; + this.cast('ADD_RULE', ['userid', regUserid]); + this.cast('ADD_RULE', ['user_id', regUserid]); + + // url + var regUrl = /^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/; + this.cast('ADD_RULE', ['url', regUrl]); + this.cast('ADD_RULE', ['homepage', regUrl]); + + // korean + var regKor = /^[가-힣]*$/; + this.cast('ADD_RULE', ['korean', regKor]); + + // korean_number + var regKorNum = /^[가-힣0-9]*$/; + this.cast('ADD_RULE', ['korean_number', regKorNum]); + + // alpha + var regAlpha = /^[a-z]*$/i; + this.cast('ADD_RULE', ['alpha', regAlpha]); + + // alpha_number + var regAlphaNum = /^[a-z][a-z0-9_]*$/i; + this.cast('ADD_RULE', ['alpha_number', regAlphaNum]); + + // number + var regNum = /^[0-9]*$/; + this.cast('ADD_RULE', ['number', regNum]); + // }}} add filters + }, + // run validator + run : function(oForm) { + var filter = ''; + + if (oForm._filter) filter = oForm._filter.value; + + var params = [oForm, filter]; + var result = this.cast('VALIDATE', params); + if (typeof result == 'undefined') result = false; + + return result; + }, + API_ONREADY : function() { + var self = this; + + // hook form submit event + $('form') + .each(function(){ + if (this.onsubmit) { + this['xe:onsubmit'] = this.onsubmit; + this.onsubmit = null; + } + }) + .submit(function(){ + var legacyFn = this['xe:onsubmit']; + var hasLegacyFn = $.isFunction(legacyFn); + var bResult = hasLegacyFn?legacyFn.apply(this):self.run(this); + + return bResult; + }); + }, + API_VALIDATE : function(sender, params) { + var self = this, result = true, form = params[0], filter=null, callback=null; + + if (form.elements['_filter']) filter = form.elements['_filter'].value; + if (!filter) return true; + if ($.isFunction(callbacks[filter])) callback = callbacks[filter]; + filter = $.extend({}, filters[filter.toLowerCase()] || {}, extras); + + $.each(filter, function(name) { + var _el = form.elements[name]; + + if (!_el) return true; + + var el = $(_el), val = $.trim(get_value(el)); + var minlen = parseInt(this.minlength) || 0; + var maxlen = parseInt(this.maxlength) || 0; + var rule = (this.rule || '').split(','); + + if (this.required && !val) return (result = (!!self.cast('ALERT', [form, name, 'isnull']) && false)); + if (!this.required && !val) return (result = true); + if ((minlen && val.length < minlen) || (maxlen && val.length > maxlen)) return (result = (!!self.cast('ALERT', [form, name, 'outofrange', minlen, maxlen]) && false)); + + if (this.equalto) { + var eq_val = get_value($(form.elements[this.equalto])); + if (eq_val != val) return (result = (!!self.cast('ALERT', [form, name, 'equalto']) && false)); + } + + if (rule) { + $.each(rule, function(i,r) { + if (!r) return true; + + var ret = self.cast('APPLY_RULE', [r, val]); + if (!ret) { + self.cast('ALERT', [form, name, 'invalid_'+this]); + return (result = false); + } + }); + } + + if (!result) return false; + }); + + if (!result) return false; + if ($.isFunction(callback)) return callback(form); + + return true; + }, + API_ADD_RULE : function(sender, params) { + var name = params[0].toLowerCase(); + rules[name] = params[1]; + }, + API_DEL_RULE : function(sender, params) { + var name = params[0].toLowerCase(); + delete rules[name]; + }, + API_GET_RULE : function(sender, params) { + var name = params[0].toLowerCase(); + + if (rules[name]) { + return rules[name]; + } else { + return null; + } + }, + API_ADD_FILTER : function(sender, params) { + var name = params[0].toLowerCase(); + var filter = params[1]; + + filters[name] = filter; + }, + API_DEL_FILTER : function(sender, params) { + var name = params[0].toLowerCase(); + delete filters[name]; + }, + API_GET_FILTER : function(sender, params) { + var name = params[0].toLowerCase(); + + if (filters[name]) { + return filters[name]; + } else { + return null; + } + }, + API_ADD_EXTRA_FIELD : function(sender, params) { + var name = params[0].toLowerCase(); + var prop = params[1]; + + extras[name] = prop; + }, + API_GET_EXTRA_FIELD : function(sender, params) { + var name = params[0].toLowerCase(); + return extras[name]; + }, + API_DEL_EXTRA_FIELD : function(sender, params) { + var name = params[0].toLowerCase(); + delete extras[name]; + }, + API_APPLY_RULE : function(sender, params) { + var name = params[0]; + var value = params[1]; + + if (typeof(rules[name]) == 'undefined') return true; // no filter + if ($.isFunction(rules[name])) return rules[name](value); + if (rules[name] instanceof RegExp) return rules[name].test(value); + + return true; + }, + API_ALERT : function(sender, params) { + var form = params[0]; + var field_name = params[1]; + var msg_code = params[2]; + var minlen = params[3]; + var maxlen = params[4]; + + var field_msg = this.cast('GET_MESSAGE', [field_name]); + var msg = this.cast('GET_MESSAGE', [msg_code]); + + if (msg != msg_code) msg = (msg.indexOf('%s')<0)?(field_msg+msg):(msg.replace('%s',field_msg)); + if (minlen||maxlen) msg += '('+(minlen||'')+'~'+(maxlen||'')+')'; + + this.cast('SHOW_ALERT', [msg]); + + // set focus + $(form.elements[field_name]).focus(); + }, + API_SHOW_ALERT : function(sender, params) { + alert(params[0]); + }, + API_ADD_MESSAGE : function(sender, params) { + var msg_code = params[0]; + var msg_str = params[1]; + + messages[msg_code] = msg_str; + }, + API_GET_MESSAGE : function(sender, params) { + var msg_code = params[0]; + + return messages[msg_code] || msg_code; + }, + API_ADD_CALLBACK : function(sender, params) { + var name = params[0]; + var func = params[1]; + + callbacks[name] = func; + }, + API_REMOVE_CALLBACK : function(sender, params) { + var name = params[0]; + + delete callbacks[name]; + } +}); + +var oValidator = new Validator; + +// register validator +xe.registerApp(oValidator); + +// 호환성을 위해 추가한 플러그인 - 에디터에서 컨텐트를 가져와서 설정한다. +var EditorStub = xe.createPlugin('editor_stub', { + API_BEFORE_VALIDATE : function(sender, params) { + var form = params[0]; + var seq = form.getAttribute('editor_sequence'); + + // bug fix for IE6,7 + if (seq && typeof seq == 'object') seq = seq.value; + + if (seq) { + try { + editorRelKeys[seq].content.value = editorRelKeys[seq].func(seq) || ''; + } catch(e) { } + } + } +}); +oValidator.registerPlugin(new EditorStub); + +// functions +function get_value(elem) { + var vals = []; + if (elem.is(':radio')){ + return elem.filter(':checked').val(); + } else if (elem.is(':checkbox')) { + elem.filter(':checked').each(function(){ + vals.push(this.value); + }); + return vals.join('|@|'); + } else { + return elem.val(); + } +} + +})(jQuery); + +/** + * @function filterAlertMessage + * @brief ajax로 서버에 요청후 결과를 처리할 callback_function을 지정하지 않았을 시 호출되는 기본 함수 + **/ +function filterAlertMessage(ret_obj) { + var error = ret_obj["error"]; + var message = ret_obj["message"]; + var act = ret_obj["act"]; + var redirect_url = ret_obj["redirect_url"]; + var url = location.href; + + if(typeof(message)!="undefined"&&message&&message!="success") alert(message); + + if(typeof(act)!="undefined" && act) url = current_url.setQuery("act", act); + else if(typeof(redirect_url)!="undefined" && redirect_url) url = redirect_url; + + if(url == location.href) url = url.replace(/#(.*)$/,''); + + location.href = url; +} + +/** + * @brief Function to process filters + * @deprecated + */ +function procFilter(form, filter_func) { + filter_func(form); + return false; +} + +function legacy_filter(filter_name, form, module, act, callback, responses, confirm_msg, rename_params) { + var v = xe.getApp('Validator')[0], $ = jQuery, args = []; + + if (!v) return false; + + if (!form.elements['_filter']) $(form).prepend(''); + form.elements['_filter'].value = filter_name; + + args[0] = filter_name; + args[1] = function(f) { + var params = {}, res = [], elms = f.elements, data = $(f).serializeArray(); + $.each(data, function(i, field) { + var v = $.trim(field.value), n = field.name; + if(!v || !n) return true; + if(rename_params[n]) n = rename_params[n]; + + if(/\[\]$/.test(n)) n = n.replace(/\[\]$/, ''); + if(params[n]) params[n] += '|@|'+v; + else params[n] = field.value; + }); + + if (confirm_msg && !confirm(confirm_msg)) return false; + exec_xml(module, act, params, callback, responses, params, form); + }; + + v.cast('ADD_CALLBACK', args); + v.cast('VALIDATE', [form, filter_name]); + + return false; } \ No newline at end of file diff --git a/common/js/unittest/JSSpec/JSSpec.js b/common/js/unittest/JSSpec/JSSpec.js index 91cd142b3..1a337df41 100644 --- a/common/js/unittest/JSSpec/JSSpec.js +++ b/common/js/unittest/JSSpec/JSSpec.js @@ -1,1548 +1,1548 @@ -/** - * JSSpec - * - * Copyright 2007 Alan Kang - * - mailto:jania902@gmail.com - * - http://jania.pe.kr - * - * http://jania.pe.kr/aw/moin.cgi/JSSpec - * - * Dependencies: - * - diff_match_patch.js ( http://code.google.com/p/google-diff-match-patch ) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - -/** - * Namespace - */ - -var JSSpec = { - specs: [], - - EMPTY_FUNCTION: function() {}, - - Browser: { - // By Rendering Engines - Trident: navigator.appName === "Microsoft Internet Explorer", - Webkit: navigator.userAgent.indexOf('AppleWebKit/') > -1, - Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') === -1, - KHTML: navigator.userAgent.indexOf('KHTML') !== -1, - Presto: navigator.appName === "Opera", - - // By Platforms - Mac: navigator.userAgent.indexOf("Macintosh") !== -1, - Ubuntu: navigator.userAgent.indexOf('Ubuntu') !== -1, - Win: navigator.userAgent.indexOf('Windows') !== -1, - - // By Browsers - IE: navigator.appName === "Microsoft Internet Explorer", - IE6: navigator.userAgent.indexOf('MSIE 6') !== -1, - IE7: navigator.userAgent.indexOf('MSIE 7') !== -1, - IE8: navigator.userAgent.indexOf('MSIE 8') !== -1, - - FF: navigator.userAgent.indexOf('Firefox') !== -1, - FF2: navigator.userAgent.indexOf('Firefox/2') !== -1, - FF3: navigator.userAgent.indexOf('Firefox/3') !== -1, - Safari: navigator.userAgent.indexOf('Safari') !== -1 - } -}; - - - -/** - * Executor - */ -JSSpec.Executor = function(target, onSuccess, onException) { - this.target = target; - this.onSuccess = typeof onSuccess == 'function' ? onSuccess : JSSpec.EMPTY_FUNCTION; - this.onException = typeof onException == 'function' ? onException : JSSpec.EMPTY_FUNCTION; - - if(JSSpec.Browser.Trident) { - // Exception handler for Trident. It helps to collect exact line number where exception occured. - window.onerror = function(message, fileName, lineNumber) { - var self = window._curExecutor; - var ex = {message:message, fileName:fileName, lineNumber:lineNumber}; - - if(JSSpec._secondPass) { - ex = self.mergeExceptions(JSSpec._assertionFailure, ex); - delete JSSpec._secondPass; - delete JSSpec._assertionFailure; - - ex.type = "failure"; - self.onException(self, ex); - } else if(JSSpec._assertionFailure) { - JSSpec._secondPass = true; - self.run(); - } else { - self.onException(self, ex); - } - - return true; - }; - } -}; -JSSpec.Executor.prototype.mergeExceptions = function(assertionFailure, normalException) { - var merged = { - message:assertionFailure.message, - fileName:normalException.fileName, - lineNumber:normalException.lineNumber - }; - - return merged; -}; - -JSSpec.Executor.prototype.run = function() { - var self = this; - var target = this.target; - var onSuccess = this.onSuccess; - var onException = this.onException; - - window.setTimeout( - function() { - var result; - if(JSSpec.Browser.Trident) { - window._curExecutor = self; - - result = self.target(); - self.onSuccess(self, result); - } else { - try { - result = self.target(); - self.onSuccess(self, result); - } catch(ex) { - if(JSSpec.Browser.Webkit) ex = {message:ex.message, fileName:ex.sourceURL, lineNumber:ex.line}; - - if(JSSpec._secondPass) { - ex = self.mergeExceptions(JSSpec._assertionFailure, ex); - delete JSSpec._secondPass; - delete JSSpec._assertionFailure; - - ex.type = "failure"; - self.onException(self, ex); - } else if(JSSpec._assertionFailure) { - JSSpec._secondPass = true; - self.run(); - } else { - self.onException(self, ex); - } - } - } - }, - 0 - ); -}; - - - -/** - * CompositeExecutor composites one or more executors and execute them sequencially. - */ -JSSpec.CompositeExecutor = function(onSuccess, onException, continueOnException) { - this.queue = []; - this.onSuccess = typeof onSuccess == 'function' ? onSuccess : JSSpec.EMPTY_FUNCTION; - this.onException = typeof onException == 'function' ? onException : JSSpec.EMPTY_FUNCTION; - this.continueOnException = !!continueOnException; -}; - -JSSpec.CompositeExecutor.prototype.addFunction = function(func) { - this.addExecutor(new JSSpec.Executor(func)); -}; - -JSSpec.CompositeExecutor.prototype.addExecutor = function(executor) { - var last = this.queue.length == 0 ? null : this.queue[this.queue.length - 1]; - if(last) { - last.next = executor; - } - - executor.parent = this; - executor.onSuccessBackup = executor.onSuccess; - executor.onSuccess = function(result) { - this.onSuccessBackup(result); - if(this.next) { - this.next.run(); - } else { - this.parent.onSuccess(); - } - }; - executor.onExceptionBackup = executor.onException; - executor.onException = function(executor, ex) { - this.onExceptionBackup(executor, ex); - - if(this.parent.continueOnException) { - if(this.next) { - this.next.run(); - } else { - this.parent.onSuccess(); - } - } else { - this.parent.onException(executor, ex); - } - }; - - this.queue.push(executor); -}; - -JSSpec.CompositeExecutor.prototype.run = function() { - if(this.queue.length > 0) { - this.queue[0].run(); - } -}; - -/** - * Spec is a set of Examples in a specific context - */ -JSSpec.Spec = function(context, entries) { - this.id = JSSpec.Spec.id++; - this.context = context; - this.url = location.href; - - this.filterEntriesByEmbeddedExpressions(entries); - this.extractOutSpecialEntries(entries); - this.examples = this.makeExamplesFromEntries(entries); - this.examplesMap = this.makeMapFromExamples(this.examples); -}; - -JSSpec.Spec.id = 0; -JSSpec.Spec.prototype.getExamples = function() { - return this.examples; -}; - -JSSpec.Spec.prototype.hasException = function() { - return this.getTotalFailures() > 0 || this.getTotalErrors() > 0; -}; - -JSSpec.Spec.prototype.getTotalFailures = function() { - var examples = this.examples; - var failures = 0; - for(var i = 0; i < examples.length; i++) { - if(examples[i].isFailure()) failures++; - } - return failures; -}; - -JSSpec.Spec.prototype.getTotalErrors = function() { - var examples = this.examples; - var errors = 0; - for(var i = 0; i < examples.length; i++) { - if(examples[i].isError()) errors++; - } - return errors; -}; - -JSSpec.Spec.prototype.filterEntriesByEmbeddedExpressions = function(entries) { - var isTrue; - for(name in entries) if(entries.hasOwnProperty(name)) { - var m = name.match(/\[\[(.+)\]\]/); - if(m && m[1]) { - eval("isTrue = (" + m[1] + ")"); - if(!isTrue) delete entries[name]; - } - } -}; - -JSSpec.Spec.prototype.extractOutSpecialEntries = function(entries) { - this.beforeEach = JSSpec.EMPTY_FUNCTION; - this.beforeAll = JSSpec.EMPTY_FUNCTION; - this.afterEach = JSSpec.EMPTY_FUNCTION; - this.afterAll = JSSpec.EMPTY_FUNCTION; - - for(name in entries) if(entries.hasOwnProperty(name)) { - if(name == 'before' || name == 'before each' || name == 'before_each') { - this.beforeEach = entries[name]; - } else if(name == 'before all' || name == 'before_all') { - this.beforeAll = entries[name]; - } else if(name == 'after' || name == 'after each' || name == 'after_each') { - this.afterEach = entries[name]; - } else if(name == 'after all' || name == 'after_all') { - this.afterAll = entries[name]; - } - } - - delete entries['before']; - delete entries['before each']; - delete entries['before_each']; - delete entries['before all']; - delete entries['before_all']; - delete entries['after']; - delete entries['after each']; - delete entries['after_each']; - delete entries['after all']; - delete entries['after_all']; -}; - -JSSpec.Spec.prototype.makeExamplesFromEntries = function(entries) { - var examples = []; - for(name in entries) if(entries.hasOwnProperty(name)) { - examples.push(new JSSpec.Example(name, entries[name], this.beforeEach, this.afterEach)); - } - return examples; -}; - -JSSpec.Spec.prototype.makeMapFromExamples = function(examples) { - var map = {}; - for(var i = 0; i < examples.length; i++) { - var example = examples[i]; - map[example.id] = examples[i]; - } - return map; -}; - -JSSpec.Spec.prototype.getExampleById = function(id) { - return this.examplesMap[id]; -}; - -JSSpec.Spec.prototype.getExecutor = function() { - var self = this; - var onException = function(executor, ex) { - self.exception = ex; - }; - - var composite = new JSSpec.CompositeExecutor(); - composite.addFunction(function() {JSSpec.log.onSpecStart(self);}); - composite.addExecutor(new JSSpec.Executor(this.beforeAll, null, function(exec, ex) { - self.exception = ex; - JSSpec.log.onSpecEnd(self); - })); - - var exampleAndAfter = new JSSpec.CompositeExecutor(null,null,true); - for(var i = 0; i < this.examples.length; i++) { - exampleAndAfter.addExecutor(this.examples[i].getExecutor()); - } - exampleAndAfter.addExecutor(new JSSpec.Executor(this.afterAll, null, onException)); - exampleAndAfter.addFunction(function() {JSSpec.log.onSpecEnd(self);}); - composite.addExecutor(exampleAndAfter); - - return composite; -}; - -/** - * Example - */ -JSSpec.Example = function(name, target, before, after) { - this.id = JSSpec.Example.id++; - this.name = name; - this.target = target; - this.before = before; - this.after = after; -}; - -JSSpec.Example.id = 0; -JSSpec.Example.prototype.isFailure = function() { - return this.exception && this.exception.type == "failure"; -}; - -JSSpec.Example.prototype.isError = function() { - return this.exception && !this.exception.type; -}; - -JSSpec.Example.prototype.getExecutor = function() { - var self = this; - var onException = function(executor, ex) { - self.exception = ex; - }; - - var composite = new JSSpec.CompositeExecutor(); - composite.addFunction(function() {JSSpec.log.onExampleStart(self);}); - composite.addExecutor(new JSSpec.Executor(this.before, null, function(exec, ex) { - self.exception = ex; - JSSpec.log.onExampleEnd(self); - })); - - var targetAndAfter = new JSSpec.CompositeExecutor(null,null,true); - - targetAndAfter.addExecutor(new JSSpec.Executor(this.target, null, onException)); - targetAndAfter.addExecutor(new JSSpec.Executor(this.after, null, onException)); - targetAndAfter.addFunction(function() {JSSpec.log.onExampleEnd(self);}); - - composite.addExecutor(targetAndAfter); - - return composite; -}; - -/** - * Runner - */ -JSSpec.Runner = function(specs, logger) { - JSSpec.log = logger; - - this.totalExamples = 0; - this.specs = []; - this.specsMap = {}; - this.addAllSpecs(specs); -}; - -JSSpec.Runner.prototype.addAllSpecs = function(specs) { - for(var i = 0; i < specs.length; i++) { - this.addSpec(specs[i]); - } -}; - -JSSpec.Runner.prototype.addSpec = function(spec) { - this.specs.push(spec); - this.specsMap[spec.id] = spec; - this.totalExamples += spec.getExamples().length; -}; - -JSSpec.Runner.prototype.getSpecById = function(id) { - return this.specsMap[id]; -}; - -JSSpec.Runner.prototype.getSpecByContext = function(context) { - for(var i = 0; i < this.specs.length; i++) { - if(this.specs[i].context == context) return this.specs[i]; - } - return null; -}; - -JSSpec.Runner.prototype.getSpecs = function() { - return this.specs; -}; - -JSSpec.Runner.prototype.hasException = function() { - return this.getTotalFailures() > 0 || this.getTotalErrors() > 0; -}; - -JSSpec.Runner.prototype.getTotalFailures = function() { - var specs = this.specs; - var failures = 0; - for(var i = 0; i < specs.length; i++) { - failures += specs[i].getTotalFailures(); - } - return failures; -}; - -JSSpec.Runner.prototype.getTotalErrors = function() { - var specs = this.specs; - var errors = 0; - for(var i = 0; i < specs.length; i++) { - errors += specs[i].getTotalErrors(); - } - return errors; -}; - - -JSSpec.Runner.prototype.run = function() { - JSSpec.log.onRunnerStart(); - var executor = new JSSpec.CompositeExecutor(function() {JSSpec.log.onRunnerEnd()},null,true); - for(var i = 0; i < this.specs.length; i++) { - executor.addExecutor(this.specs[i].getExecutor()); - } - executor.run(); -}; - - -JSSpec.Runner.prototype.rerun = function(context) { - JSSpec.runner = new JSSpec.Runner([this.getSpecByContext(context)], JSSpec.log); - JSSpec.runner.run(); -}; - -/** - * Logger - */ -JSSpec.Logger = function() { - this.finishedExamples = 0; - this.startedAt = null; -}; - -JSSpec.Logger.prototype.onRunnerStart = function() { - this._title = document.title; - - this.startedAt = new Date(); - var container = document.getElementById('jsspec_container'); - if(container) { - container.innerHTML = ""; - } else { - container = document.createElement("DIV"); - container.id = "jsspec_container"; - document.body.appendChild(container); - } - - var title = document.createElement("DIV"); - title.id = "title"; - title.innerHTML = [ - '

JSSpec

', - '
    ', - JSSpec.options.rerun ? '
  • [X] ' + JSSpec.util.escapeTags(decodeURIComponent(JSSpec.options.rerun)) + '
  • ' : '', - '
  • ' + JSSpec.runner.totalExamples + ' examples
  • ', - '
  • 0 failures
  • ', - '
  • 0 errors
  • ', - '
  • 0% done
  • ', - '
  • 0 secs
  • ', - '
', - '

JSSpec homepage

', - ].join(""); - container.appendChild(title); - - var list = document.createElement("DIV"); - list.id = "list"; - list.innerHTML = [ - '

List

', - '' - ].join(""); - container.appendChild(list); - - var log = document.createElement("DIV"); - log.id = "log"; - log.innerHTML = [ - '

Log

', - '
    ', - function() { - var specs = JSSpec.runner.getSpecs(); - var sb = []; - for(var i = 0; i < specs.length; i++) { - var spec = specs[i]; - sb.push('
  • '); - sb.push('

    ' + JSSpec.util.escapeTags(specs[i].context) + ' [rerun]

    '); - sb.push('
      '); - for(var j = 0; j < spec.examples.length; j++) { - var example = spec.examples[j]; - sb.push('
    • '); - sb.push('

      ' + JSSpec.util.escapeTags(example.name) + '

      '); - sb.push('
      '+JSSpec.util.escapeTags(example.target.toString())+'
      '); - sb.push('
    • '); - } - sb.push('
    '); - sb.push('
  • '); - } - return sb.join(""); - }(), - '
' - ].join(""); - - container.appendChild(log); - - // add event handler for toggling - var specs = JSSpec.runner.getSpecs(); - var sb = []; - for(var i = 0; i < specs.length; i++) { - var spec = document.getElementById("spec_" + specs[i].id); - var title = spec.getElementsByTagName("H3")[0]; - title.onclick = function(e) { - var target = document.getElementById(this.parentNode.id + "_examples"); - target.style.display = target.style.display == "none" ? "block" : "none"; - return true; - } - } -}; - -JSSpec.Logger.prototype.onRunnerEnd = function() { - if(JSSpec.runner.hasException()) { - var times = 4; - var title1 = "*" + this._title; - var title2 = "*F" + JSSpec.runner.getTotalFailures() + " E" + JSSpec.runner.getTotalErrors() + "* " + this._title; - } else { - var times = 2; - var title1 = this._title; - var title2 = "Success"; - } - this.blinkTitle(times,title1,title2); -}; - -JSSpec.Logger.prototype.blinkTitle = function(times, title1, title2) { - var times = times * 2; - var mode = true; - - var f = function() { - if(times > 0) { - document.title = mode ? title1 : title2; - mode = !mode; - times--; - window.setTimeout(f, 500); - } else { - document.title = title1; - } - }; - - f(); -}; - -JSSpec.Logger.prototype.onSpecStart = function(spec) { - var spec_list = document.getElementById("spec_" + spec.id + "_list"); - var spec_log = document.getElementById("spec_" + spec.id); - - spec_list.className = "ongoing"; - spec_log.className = "ongoing"; -}; - -JSSpec.Logger.prototype.onSpecEnd = function(spec) { - var spec_list = document.getElementById("spec_" + spec.id + "_list"); - var spec_log = document.getElementById("spec_" + spec.id); - var examples = document.getElementById("spec_" + spec.id + "_examples"); - var className = spec.hasException() ? "exception" : "success"; - - spec_list.className = className; - spec_log.className = className; - - if(JSSpec.options.autocollapse && !spec.hasException()) examples.style.display = "none"; - - if(spec.exception) { - spec_log.appendChild(document.createTextNode(" - " + spec.exception.message)); - } -}; - -JSSpec.Logger.prototype.onExampleStart = function(example) { - var li = document.getElementById("example_" + example.id); - li.className = "ongoing"; -}; - -JSSpec.Logger.prototype.onExampleEnd = function(example) { - var li = document.getElementById("example_" + example.id); - li.className = example.exception ? "exception" : "success"; - - if(example.exception) { - var div = document.createElement("DIV"); - div.innerHTML = example.exception.message + "


" + " at " + example.exception.fileName + ", line " + example.exception.lineNumber + "

"; - li.appendChild(div); - } - - var title = document.getElementById("title"); - var runner = JSSpec.runner; - - title.className = runner.hasException() ? "exception" : "success"; - - this.finishedExamples++; - document.getElementById("total_failures").innerHTML = runner.getTotalFailures(); - document.getElementById("total_errors").innerHTML = runner.getTotalErrors(); - var progress = parseInt(this.finishedExamples / runner.totalExamples * 100); - document.getElementById("progress").innerHTML = progress; - document.getElementById("total_elapsed").innerHTML = (new Date().getTime() - this.startedAt.getTime()) / 1000; - - document.title = progress + "%: " + this._title; -}; - -/** - * IncludeMatcher - */ -JSSpec.IncludeMatcher = function(actual, expected, condition) { - this.actual = actual; - this.expected = expected; - this.condition = condition; - this.match = false; - this.explaination = this.makeExplain(); -}; - -JSSpec.IncludeMatcher.createInstance = function(actual, expected, condition) { - return new JSSpec.IncludeMatcher(actual, expected, condition); -}; - -JSSpec.IncludeMatcher.prototype.matches = function() { - return this.match; -}; - -JSSpec.IncludeMatcher.prototype.explain = function() { - return this.explaination; -}; - -JSSpec.IncludeMatcher.prototype.makeExplain = function() { - if(typeof this.actual.length == 'undefined') { - return this.makeExplainForNotArray(); - } else { - return this.makeExplainForArray(); - } -}; - -JSSpec.IncludeMatcher.prototype.makeExplainForNotArray = function() { - if(this.condition) { - this.match = !!this.actual[this.expected]; - } else { - this.match = !this.actual[this.expected]; - } - - var sb = []; - sb.push('

actual value:

'); - sb.push('

' + JSSpec.util.inspect(this.actual, false, this.expected) + '

'); - sb.push('

should ' + (this.condition ? '' : 'not') + ' include:

'); - sb.push('

' + JSSpec.util.inspect(this.expected) + '

'); - return sb.join(""); -}; - -JSSpec.IncludeMatcher.prototype.makeExplainForArray = function() { - var matches; - if(this.condition) { - for(var i = 0; i < this.actual.length; i++) { - matches = JSSpec.EqualityMatcher.createInstance(this.expected, this.actual[i]).matches(); - if(matches) { - this.match = true; - break; - } - } - } else { - for(var i = 0; i < this.actual.length; i++) { - matches = JSSpec.EqualityMatcher.createInstance(this.expected, this.actual[i]).matches(); - if(matches) { - this.match = false; - break; - } - } - } - - if(this.match) return ""; - - var sb = []; - sb.push('

actual value:

'); - sb.push('

' + JSSpec.util.inspect(this.actual, false, this.condition ? null : i) + '

'); - sb.push('

should ' + (this.condition ? '' : 'not') + ' include:

'); - sb.push('

' + JSSpec.util.inspect(this.expected) + '

'); - return sb.join(""); -}; - -/** - * PropertyLengthMatcher - */ -JSSpec.PropertyLengthMatcher = function(num, property, o, condition) { - this.num = num; - this.o = o; - this.property = property; - if((property == 'characters' || property == 'items') && typeof o.length != 'undefined') { - this.property = 'length'; - } - - this.condition = condition; - this.conditionMet = function(x) { - if(condition == 'exactly') return x.length == num; - if(condition == 'at least') return x.length >= num; - if(condition == 'at most') return x.length <= num; - - throw "Unknown condition '" + condition + "'"; - }; - this.match = false; - this.explaination = this.makeExplain(); -}; - -JSSpec.PropertyLengthMatcher.prototype.makeExplain = function() { - if(this.o._type == 'String' && this.property == 'length') { - this.match = this.conditionMet(this.o); - return this.match ? '' : this.makeExplainForString(); - } else if(typeof this.o.length != 'undefined' && this.property == "length") { - this.match = this.conditionMet(this.o); - return this.match ? '' : this.makeExplainForArray(); - } else if(typeof this.o[this.property] != 'undefined' && this.o[this.property] != null) { - this.match = this.conditionMet(this.o[this.property]); - return this.match ? '' : this.makeExplainForObject(); - } else if(typeof this.o[this.property] == 'undefined' || this.o[this.property] == null) { - this.match = false; - return this.makeExplainForNoProperty(); - } - - this.match = true; -}; - -JSSpec.PropertyLengthMatcher.prototype.makeExplainForString = function() { - var sb = []; - - var exp = this.num == 0 ? - 'be an empty string' : - 'have ' + this.condition + ' ' + this.num + ' characters'; - - sb.push('

actual value has ' + this.o.length + ' characters:

'); - sb.push('

' + JSSpec.util.inspect(this.o) + '

'); - sb.push('

but it should ' + exp + '.

'); - - return sb.join(""); -}; - -JSSpec.PropertyLengthMatcher.prototype.makeExplainForArray = function() { - var sb = []; - - var exp = this.num == 0 ? - 'be an empty array' : - 'have ' + this.condition + ' ' + this.num + ' items'; - - sb.push('

actual value has ' + this.o.length + ' items:

'); - sb.push('

' + JSSpec.util.inspect(this.o) + '

'); - sb.push('

but it should ' + exp + '.

'); - - return sb.join(""); -}; - -JSSpec.PropertyLengthMatcher.prototype.makeExplainForObject = function() { - var sb = []; - - var exp = this.num == 0 ? - 'be empty' : - 'have ' + this.condition + ' ' + this.num + ' ' + this.property + '.'; - - sb.push('

actual value has ' + this.o[this.property].length + ' ' + this.property + ':

'); - sb.push('

' + JSSpec.util.inspect(this.o, false, this.property) + '

'); - sb.push('

but it should ' + exp + '.

'); - - return sb.join(""); -}; - -JSSpec.PropertyLengthMatcher.prototype.makeExplainForNoProperty = function() { - var sb = []; - - sb.push('

actual value:

'); - sb.push('

' + JSSpec.util.inspect(this.o) + '

'); - sb.push('

should have ' + this.condition + ' ' + this.num + ' ' + this.property + ' but there\'s no such property.

'); - - return sb.join(""); -}; - -JSSpec.PropertyLengthMatcher.prototype.matches = function() { - return this.match; -}; - -JSSpec.PropertyLengthMatcher.prototype.explain = function() { - return this.explaination; -}; - -JSSpec.PropertyLengthMatcher.createInstance = function(num, property, o, condition) { - return new JSSpec.PropertyLengthMatcher(num, property, o, condition); -}; - -/** - * EqualityMatcher - */ -JSSpec.EqualityMatcher = {}; - -JSSpec.EqualityMatcher.createInstance = function(expected, actual) { - if(expected == null || actual == null) { - return new JSSpec.NullEqualityMatcher(expected, actual); - } else if(expected._type && expected._type == actual._type) { - if(expected._type == "String") { - return new JSSpec.StringEqualityMatcher(expected, actual); - } else if(expected._type == "Date") { - return new JSSpec.DateEqualityMatcher(expected, actual); - } else if(expected._type == "Number") { - return new JSSpec.NumberEqualityMatcher(expected, actual); - } else if(expected._type == "Array") { - return new JSSpec.ArrayEqualityMatcher(expected, actual); - } else if(expected._type == "Boolean") { - return new JSSpec.BooleanEqualityMatcher(expected, actual); - } - } - - return new JSSpec.ObjectEqualityMatcher(expected, actual); -}; - -JSSpec.EqualityMatcher.basicExplain = function(expected, actual, expectedDesc, actualDesc) { - var sb = []; - - sb.push(actualDesc || '

actual value:

'); - sb.push('

' + JSSpec.util.inspect(actual) + '

'); - sb.push(expectedDesc || '

should be:

'); - sb.push('

' + JSSpec.util.inspect(expected) + '

'); - - return sb.join(""); -}; - -JSSpec.EqualityMatcher.diffExplain = function(expected, actual) { - var sb = []; - - sb.push('

diff:

'); - sb.push('

'); - - var dmp = new diff_match_patch(); - var diff = dmp.diff_main(expected, actual); - dmp.diff_cleanupEfficiency(diff); - - sb.push(JSSpec.util.inspect(dmp.diff_prettyHtml(diff), true)); - - sb.push('

'); - - return sb.join(""); -}; - -/** - * BooleanEqualityMatcher - */ -JSSpec.BooleanEqualityMatcher = function(expected, actual) { - this.expected = expected; - this.actual = actual; -}; - -JSSpec.BooleanEqualityMatcher.prototype.explain = function() { - var sb = []; - - sb.push('

actual value:

'); - sb.push('

' + JSSpec.util.inspect(this.actual) + '

'); - sb.push('

should be:

'); - sb.push('

' + JSSpec.util.inspect(this.expected) + '

'); - - return sb.join(""); -}; - -JSSpec.BooleanEqualityMatcher.prototype.matches = function() { - return this.expected == this.actual; -}; - -/** - * NullEqualityMatcher - */ -JSSpec.NullEqualityMatcher = function(expected, actual) { - this.expected = expected; - this.actual = actual; -}; - -JSSpec.NullEqualityMatcher.prototype.matches = function() { - return this.expected == this.actual && typeof this.expected == typeof this.actual; -}; - -JSSpec.NullEqualityMatcher.prototype.explain = function() { - return JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual); -}; - -JSSpec.DateEqualityMatcher = function(expected, actual) { - this.expected = expected; - this.actual = actual; -}; - -JSSpec.DateEqualityMatcher.prototype.matches = function() { - return this.expected.getTime() == this.actual.getTime(); -}; - -JSSpec.DateEqualityMatcher.prototype.explain = function() { - var sb = []; - - sb.push(JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual)); - sb.push(JSSpec.EqualityMatcher.diffExplain(this.expected.toString(), this.actual.toString())); - - return sb.join(""); -}; - -/** - * ObjectEqualityMatcher - */ -JSSpec.ObjectEqualityMatcher = function(expected, actual) { - this.expected = expected; - this.actual = actual; - this.match = this.expected == this.actual; - this.explaination = this.makeExplain(); -}; - -JSSpec.ObjectEqualityMatcher.prototype.matches = function() {return this.match}; - -JSSpec.ObjectEqualityMatcher.prototype.explain = function() {return this.explaination}; - -JSSpec.ObjectEqualityMatcher.prototype.makeExplain = function() { - if(this.expected == this.actual) { - this.match = true; - return ""; - } - - if(JSSpec.util.isDomNode(this.expected)) { - return this.makeExplainForDomNode(); - } - - var key, expectedHasItem, actualHasItem; - - for(key in this.expected) { - expectedHasItem = this.expected[key] != null && typeof this.expected[key] != 'undefined'; - actualHasItem = this.actual[key] != null && typeof this.actual[key] != 'undefined'; - if(expectedHasItem && !actualHasItem) return this.makeExplainForMissingItem(key); - } - for(key in this.actual) { - expectedHasItem = this.expected[key] != null && typeof this.expected[key] != 'undefined'; - actualHasItem = this.actual[key] != null && typeof this.actual[key] != 'undefined'; - if(actualHasItem && !expectedHasItem) return this.makeExplainForUnknownItem(key); - } - - for(key in this.expected) { - var matcher = JSSpec.EqualityMatcher.createInstance(this.expected[key], this.actual[key]); - if(!matcher.matches()) return this.makeExplainForItemMismatch(key); - } - - this.match = true; -}; - -JSSpec.ObjectEqualityMatcher.prototype.makeExplainForDomNode = function(key) { - var sb = []; - - sb.push(JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual)); - - return sb.join(""); -}; - -JSSpec.ObjectEqualityMatcher.prototype.makeExplainForMissingItem = function(key) { - var sb = []; - - sb.push('

actual value has no item named ' + JSSpec.util.inspect(key) + '

'); - sb.push('

' + JSSpec.util.inspect(this.actual, false, key) + '

'); - sb.push('

but it should have the item whose value is ' + JSSpec.util.inspect(this.expected[key]) + '

'); - sb.push('

' + JSSpec.util.inspect(this.expected, false, key) + '

'); - - return sb.join(""); -}; - -JSSpec.ObjectEqualityMatcher.prototype.makeExplainForUnknownItem = function(key) { - var sb = []; - - sb.push('

actual value has item named ' + JSSpec.util.inspect(key) + '

'); - sb.push('

' + JSSpec.util.inspect(this.actual, false, key) + '

'); - sb.push('

but there should be no such item

'); - sb.push('

' + JSSpec.util.inspect(this.expected, false, key) + '

'); - - return sb.join(""); -}; - -JSSpec.ObjectEqualityMatcher.prototype.makeExplainForItemMismatch = function(key) { - var sb = []; - - sb.push('

actual value has an item named ' + JSSpec.util.inspect(key) + ' whose value is ' + JSSpec.util.inspect(this.actual[key]) + '

'); - sb.push('

' + JSSpec.util.inspect(this.actual, false, key) + '

'); - sb.push('

but it\'s value should be ' + JSSpec.util.inspect(this.expected[key]) + '

'); - sb.push('

' + JSSpec.util.inspect(this.expected, false, key) + '

'); - - return sb.join(""); -}; - - - - -/** - * ArrayEqualityMatcher - */ -JSSpec.ArrayEqualityMatcher = function(expected, actual) { - this.expected = expected; - this.actual = actual; - this.match = this.expected == this.actual; - this.explaination = this.makeExplain(); -}; - -JSSpec.ArrayEqualityMatcher.prototype.matches = function() {return this.match}; - -JSSpec.ArrayEqualityMatcher.prototype.explain = function() {return this.explaination}; - -JSSpec.ArrayEqualityMatcher.prototype.makeExplain = function() { - if(this.expected.length != this.actual.length) return this.makeExplainForLengthMismatch(); - - for(var i = 0; i < this.expected.length; i++) { - var matcher = JSSpec.EqualityMatcher.createInstance(this.expected[i], this.actual[i]); - if(!matcher.matches()) return this.makeExplainForItemMismatch(i); - } - - this.match = true; -}; - -JSSpec.ArrayEqualityMatcher.prototype.makeExplainForLengthMismatch = function() { - return JSSpec.EqualityMatcher.basicExplain( - this.expected, - this.actual, - '

but it should be ' + this.expected.length + '

', - '

actual value has ' + this.actual.length + ' items

' - ); -}; - -JSSpec.ArrayEqualityMatcher.prototype.makeExplainForItemMismatch = function(index) { - var postfix = ["th", "st", "nd", "rd", "th"][Math.min((index + 1) % 10,4)]; - - var sb = []; - - sb.push('

' + (index + 1) + postfix + ' item (index ' + index + ') of actual value is ' + JSSpec.util.inspect(this.actual[index]) + ':

'); - sb.push('

' + JSSpec.util.inspect(this.actual, false, index) + '

'); - sb.push('

but it should be ' + JSSpec.util.inspect(this.expected[index]) + ':

'); - sb.push('

' + JSSpec.util.inspect(this.expected, false, index) + '

'); - - return sb.join(""); -}; - -/** - * NumberEqualityMatcher - */ -JSSpec.NumberEqualityMatcher = function(expected, actual) { - this.expected = expected; - this.actual = actual; -}; - -JSSpec.NumberEqualityMatcher.prototype.matches = function() { - if(this.expected == this.actual) return true; -}; - -JSSpec.NumberEqualityMatcher.prototype.explain = function() { - return JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual); -}; - -/** - * StringEqualityMatcher - */ -JSSpec.StringEqualityMatcher = function(expected, actual) { - this.expected = expected; - this.actual = actual; -}; - -JSSpec.StringEqualityMatcher.prototype.matches = function() { - return this.expected == this.actual; -}; - -JSSpec.StringEqualityMatcher.prototype.explain = function() { - var sb = []; - - sb.push(JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual)); - sb.push(JSSpec.EqualityMatcher.diffExplain(this.expected, this.actual)); - return sb.join(""); -}; - -/** - * PatternMatcher - */ -JSSpec.PatternMatcher = function(actual, pattern, condition) { - this.actual = actual; - this.pattern = pattern; - this.condition = condition; - this.match = false; - this.explaination = this.makeExplain(); -}; - -JSSpec.PatternMatcher.createInstance = function(actual, pattern, condition) { - return new JSSpec.PatternMatcher(actual, pattern, condition); -}; - -JSSpec.PatternMatcher.prototype.makeExplain = function() { - var sb; - if(this.actual == null || this.actual._type != 'String') { - sb = []; - sb.push('

actual value:

'); - sb.push('

' + JSSpec.util.inspect(this.actual) + '

'); - sb.push('

should ' + (this.condition ? '' : 'not') + ' match with pattern:

'); - sb.push('

' + JSSpec.util.inspect(this.pattern) + '

'); - sb.push('

but pattern matching cannot be performed.

'); - return sb.join(""); - } else { - this.match = this.condition == !!this.actual.match(this.pattern); - if(this.match) return ""; - - sb = []; - sb.push('

actual value:

'); - sb.push('

' + JSSpec.util.inspect(this.actual) + '

'); - sb.push('

should ' + (this.condition ? '' : 'not') + ' match with pattern:

'); - sb.push('

' + JSSpec.util.inspect(this.pattern) + '

'); - return sb.join(""); - } -}; - -JSSpec.PatternMatcher.prototype.matches = function() { - return this.match; -}; - -JSSpec.PatternMatcher.prototype.explain = function() { - return this.explaination; -}; - -/** - * Domain Specific Languages - */ -JSSpec.DSL = {}; - -JSSpec.DSL.forString = { - normalizeHtml: function() { - var html = this; - - // Uniformize quotation, turn tag names and attribute names into lower case - html = html.replace(/<(\/?)(\w+)([^>]*?)>/img, function(str, closingMark, tagName, attrs) { - var sortedAttrs = JSSpec.util.sortHtmlAttrs(JSSpec.util.correctHtmlAttrQuotation(attrs).toLowerCase()) - return "<" + closingMark + tagName.toLowerCase() + sortedAttrs + ">" - }); - - // validation self-closing tags - html = html.replace(/<(br|hr|img)([^>]*?)>/mg, function(str, tag, attrs) { - return "<" + tag + attrs + " />"; - }); - - // append semi-colon at the end of style value - html = html.replace(/style="(.*?)"/mg, function(str, styleStr) { - styleStr = JSSpec.util.sortStyleEntries(styleStr.strip()); // for Safari - if(styleStr.charAt(styleStr.length - 1) != ';') styleStr += ";" - - return 'style="' + styleStr + '"' - }); - - // sort style entries - - // remove empty style attributes - html = html.replace(/ style=";"/mg, ""); - - // remove new-lines - html = html.replace(/\r/mg, ''); - html = html.replace(/\n/mg, ''); - - return html; - } -}; - - -JSSpec.DSL.describe = function(context, entries, base) { - if(base) { - for(var i = 0; i < JSSpec.specs.length; i++) { - if(JSSpec.specs[i].context === base) { - base = JSSpec.specs[i]; - break; - } - } - - for(var i = 0; i < base.examples.length; i++) { - var example = base.examples[i]; - - if(!entries[example.name]) entries[example.name] = example.target; - } - } - - JSSpec.specs.push(new JSSpec.Spec(context, entries)); -}; - -JSSpec.DSL.value_of = function(target) { - if(JSSpec._secondPass) return {}; - - var subject = new JSSpec.DSL.Subject(target); - return subject; -}; - -JSSpec.DSL.Subject = function(target) { - this.target = target; -}; - -JSSpec.DSL.Subject.prototype._type = 'Subject'; - -JSSpec.DSL.Subject.prototype.should_fail = function(message) { - JSSpec._assertionFailure = {message:message}; - throw JSSpec._assertionFailure; -}; - -JSSpec.DSL.Subject.prototype.should_be = function(expected) { - var matcher = JSSpec.EqualityMatcher.createInstance(expected, this.target); - if(!matcher.matches()) { - JSSpec._assertionFailure = {message:matcher.explain()}; - throw JSSpec._assertionFailure; - } -}; - -JSSpec.DSL.Subject.prototype.should_not_be = function(expected) { - // TODO JSSpec.EqualityMatcher should support 'condition' - var matcher = JSSpec.EqualityMatcher.createInstance(expected, this.target); - if(matcher.matches()) { - JSSpec._assertionFailure = {message:"'" + this.target + "' should not be '" + expected + "'"}; - throw JSSpec._assertionFailure; - } -}; - -JSSpec.DSL.Subject.prototype.should_be_empty = function() { - this.should_have(0, this.getType() == 'String' ? 'characters' : 'items'); -}; - -JSSpec.DSL.Subject.prototype.should_not_be_empty = function() { - this.should_have_at_least(1, this.getType() == 'String' ? 'characters' : 'items'); -}; - -JSSpec.DSL.Subject.prototype.should_be_true = function() { - this.should_be(true); -}; - -JSSpec.DSL.Subject.prototype.should_be_false = function() { - this.should_be(false); -}; - -JSSpec.DSL.Subject.prototype.should_be_null = function() { - this.should_be(null); -}; - -JSSpec.DSL.Subject.prototype.should_be_undefined = function() { - this.should_be(undefined); -}; - -JSSpec.DSL.Subject.prototype.should_not_be_null = function() { - this.should_not_be(null); -}; - -JSSpec.DSL.Subject.prototype.should_not_be_undefined = function() { - this.should_not_be(undefined); -}; - -JSSpec.DSL.Subject.prototype._should_have = function(num, property, condition) { - var matcher = JSSpec.PropertyLengthMatcher.createInstance(num, property, this.target, condition); - if(!matcher.matches()) { - JSSpec._assertionFailure = {message:matcher.explain()}; - throw JSSpec._assertionFailure; - } -}; - -JSSpec.DSL.Subject.prototype.should_have = function(num, property) { - this._should_have(num, property, "exactly"); -}; - -JSSpec.DSL.Subject.prototype.should_have_exactly = function(num, property) { - this._should_have(num, property, "exactly"); -}; - -JSSpec.DSL.Subject.prototype.should_have_at_least = function(num, property) { - this._should_have(num, property, "at least"); -}; - -JSSpec.DSL.Subject.prototype.should_have_at_most = function(num, property) { - this._should_have(num, property, "at most"); -}; - -JSSpec.DSL.Subject.prototype.should_include = function(expected) { - var matcher = JSSpec.IncludeMatcher.createInstance(this.target, expected, true); - if(!matcher.matches()) { - JSSpec._assertionFailure = {message:matcher.explain()}; - throw JSSpec._assertionFailure; - } -}; - -JSSpec.DSL.Subject.prototype.should_not_include = function(expected) { - var matcher = JSSpec.IncludeMatcher.createInstance(this.target, expected, false); - if(!matcher.matches()) { - JSSpec._assertionFailure = {message:matcher.explain()}; - throw JSSpec._assertionFailure; - } -}; - -JSSpec.DSL.Subject.prototype.should_match = function(pattern) { - var matcher = JSSpec.PatternMatcher.createInstance(this.target, pattern, true); - if(!matcher.matches()) { - JSSpec._assertionFailure = {message:matcher.explain()}; - throw JSSpec._assertionFailure; - } -} -JSSpec.DSL.Subject.prototype.should_not_match = function(pattern) { - var matcher = JSSpec.PatternMatcher.createInstance(this.target, pattern, false); - if(!matcher.matches()) { - JSSpec._assertionFailure = {message:matcher.explain()}; - throw JSSpec._assertionFailure; - } -}; - -JSSpec.DSL.Subject.prototype.getType = function() { - if(typeof this.target == 'undefined') { - return 'undefined'; - } else if(this.target == null) { - return 'null'; - } else if(this.target._type) { - return this.target._type; - } else if(JSSpec.util.isDomNode(this.target)) { - return 'DomNode'; - } else { - return 'object'; - } -}; - -/** - * Utilities - */ -JSSpec.util = { - escapeTags: function(string) { - return string.replace(//img, '>'); - }, - escapeMetastring: function(string) { - return string.replace(/\r/img, '\\r').replace(/\n/img, '\\n').replace(/\¶\;\/img, '\\n').replace(/\t/img, '\\t'); - }, - parseOptions: function(defaults) { - var options = defaults; - - var url = location.href; - var queryIndex = url.indexOf('?'); - if(queryIndex == -1) return options; - - var query = url.substring(queryIndex + 1).split('#')[0]; - var pairs = query.split('&'); - for(var i = 0; i < pairs.length; i++) { - var tokens = pairs[i].split('='); - options[tokens[0]] = tokens[1]; - } - - return options; - }, - correctHtmlAttrQuotation: function(html) { - html = html.replace(/(\w+)=['"]([^'"]+)['"]/mg,function (str, name, value) {return name + '=' + '"' + value + '"';}); - html = html.replace(/(\w+)=([^ '"]+)/mg,function (str, name, value) {return name + '=' + '"' + value + '"';}); - html = html.replace(/'/mg, '"'); - - return html; - }, - sortHtmlAttrs: function(html) { - var attrs = []; - html.replace(/((\w+)="[^"]+")/mg, function(str, matched) { - attrs.push(matched); - }); - return attrs.length == 0 ? "" : " " + attrs.sort().join(" "); - }, - sortStyleEntries: function(styleText) { - var entries = styleText.split(/; /); - return entries.sort().join("; "); - }, - escapeHtml: function(str) { - if(!this._div) { - this._div = document.createElement("DIV"); - this._text = document.createTextNode(''); - this._div.appendChild(this._text); - } - this._text.data = str; - return this._div.innerHTML; - }, - isDomNode: function(o) { - // TODO: make it more stricter - return (typeof o.nodeName == 'string') && (typeof o.nodeType == 'number'); - }, - inspectDomPath: function(o) { - var sb = []; - while(o && o.nodeName != '#document' && o.parent) { - var siblings = o.parentNode.childNodes; - for(var i = 0; i < siblings.length; i++) { - if(siblings[i] == o) { - sb.push(o.nodeName + (i == 0 ? '' : '[' + i + ']')); - break; - } - } - o = o.parentNode; - } - return sb.join(" > "); - }, - inspectDomNode: function(o) { - if(o.nodeType == 1) { - var nodeName = o.nodeName.toLowerCase(); - var sb = []; - sb.push(''); - sb.push("<"); - sb.push(nodeName); - - var attrs = o.attributes; - for(var i = 0; i < attrs.length; i++) { - if( - attrs[i].nodeValue && - attrs[i].nodeName != 'contentEditable' && - attrs[i].nodeName != 'style' && - typeof attrs[i].nodeValue != 'function' - ) sb.push(' ' + attrs[i].nodeName.toLowerCase() + '="' + attrs[i].nodeValue + '"'); - } - if(o.style && o.style.cssText) { - sb.push(' style="' + o.style.cssText + '"'); - } - sb.push('>'); - sb.push(JSSpec.util.escapeHtml(o.innerHTML)); - sb.push('</' + nodeName + '>'); - sb.push(' (' + JSSpec.util.inspectDomPath(o) + ')' ); - sb.push(''); - return sb.join(""); - } else if(o.nodeType == 3) { - return '#text ' + o.nodeValue + ''; - } else { - return 'UnknownDomNode'; - } - }, - inspect: function(o, dontEscape, emphasisKey) { - var sb, inspected; - - if(typeof o == 'undefined') return 'undefined'; - if(o == null) return 'null'; - if(o._type == 'String') return '"' + (dontEscape ? JSSpec.util.escapeMetastring(o) : JSSpec.util.escapeHtml(JSSpec.util.escapeMetastring(o))) + '"'; - - if(o._type == 'Date') { - return '"' + o.toString() + '"'; - } - - if(o._type == 'Number') return '' + (dontEscape ? o : JSSpec.util.escapeHtml(o)) + ''; - - if(o._type == 'Boolean') return '' + o + ''; - - if(o._type == 'RegExp') return '' + JSSpec.util.escapeHtml(o.toString()) + ''; - - if(JSSpec.util.isDomNode(o)) return JSSpec.util.inspectDomNode(o); - - if(o._type == 'Array' || typeof o.length != 'undefined') { - sb = []; - for(var i = 0; i < o.length; i++) { - inspected = JSSpec.util.inspect(o[i]); - sb.push(i == emphasisKey ? ('' + inspected + '') : inspected); - } - return '[' + sb.join(', ') + ']'; - } - - // object - sb = []; - for(var key in o) { - if(key == 'should') continue; - - inspected = JSSpec.util.inspect(key) + ":" + JSSpec.util.inspect(o[key]); - sb.push(key == emphasisKey ? ('' + inspected + '') : inspected); - } - return '{' + sb.join(', ') + '}'; - } -}; - -describe = JSSpec.DSL.describe; -behavior_of = JSSpec.DSL.describe; -value_of = JSSpec.DSL.value_of; -expect = JSSpec.DSL.value_of; // @deprecated - -String.prototype._type = "String"; -Number.prototype._type = "Number"; -Date.prototype._type = "Date"; -Array.prototype._type = "Array"; -Boolean.prototype._type = "Boolean"; -RegExp.prototype._type = "RegExp"; - -var targets = [Array.prototype, Date.prototype, Number.prototype, String.prototype, Boolean.prototype, RegExp.prototype]; - -String.prototype.normalizeHtml = JSSpec.DSL.forString.normalizeHtml; -String.prototype.asHtml = String.prototype.normalizeHtml; //@deprecated -String.prototype.strip = function() {return this.replace(/^\s+/, '').replace(/\s+$/, '');} - - -/** - * Main - */ -JSSpec.defaultOptions = { - autorun: 1, - specIdBeginsWith: 0, - exampleIdBeginsWith: 0, - autocollapse: 1 -}; -JSSpec.options = JSSpec.util.parseOptions(JSSpec.defaultOptions); - -JSSpec.Spec.id = JSSpec.options.specIdBeginsWith; -JSSpec.Example.id = JSSpec.options.exampleIdBeginsWith; - - - -window.onload = function() { - if(JSSpec.specs.length > 0) { - if(!JSSpec.options.inSuite) { - JSSpec.runner = new JSSpec.Runner(JSSpec.specs, new JSSpec.Logger()); - if(JSSpec.options.rerun) { - JSSpec.runner.rerun(decodeURIComponent(JSSpec.options.rerun)); - } else { - JSSpec.runner.run(); - } - } else { - // in suite, send all specs to parent - var parentWindow = window.frames.parent.window; - for(var i = 0; i < JSSpec.specs.length; i++) { - parentWindow.JSSpec.specs.push(JSSpec.specs[i]); - } - } - } else { - var links = document.getElementById('list').getElementsByTagName('A'); - var frameContainer = document.createElement('DIV'); - frameContainer.style.display = 'none'; - document.body.appendChild(frameContainer); - - for(var i = 0; i < links.length; i++) { - var frame = document.createElement('IFRAME'); - frame.src = links[i].href + '?inSuite=0&specIdBeginsWith=' + (i * 10000) + '&exampleIdBeginsWith=' + (i * 10000); - frameContainer.appendChild(frame); - } - } +/** + * JSSpec + * + * Copyright 2007 Alan Kang + * - mailto:jania902@gmail.com + * - http://jania.pe.kr + * + * http://jania.pe.kr/aw/moin.cgi/JSSpec + * + * Dependencies: + * - diff_match_patch.js ( http://code.google.com/p/google-diff-match-patch ) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * Namespace + */ + +var JSSpec = { + specs: [], + + EMPTY_FUNCTION: function() {}, + + Browser: { + // By Rendering Engines + Trident: navigator.appName === "Microsoft Internet Explorer", + Webkit: navigator.userAgent.indexOf('AppleWebKit/') > -1, + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') === -1, + KHTML: navigator.userAgent.indexOf('KHTML') !== -1, + Presto: navigator.appName === "Opera", + + // By Platforms + Mac: navigator.userAgent.indexOf("Macintosh") !== -1, + Ubuntu: navigator.userAgent.indexOf('Ubuntu') !== -1, + Win: navigator.userAgent.indexOf('Windows') !== -1, + + // By Browsers + IE: navigator.appName === "Microsoft Internet Explorer", + IE6: navigator.userAgent.indexOf('MSIE 6') !== -1, + IE7: navigator.userAgent.indexOf('MSIE 7') !== -1, + IE8: navigator.userAgent.indexOf('MSIE 8') !== -1, + + FF: navigator.userAgent.indexOf('Firefox') !== -1, + FF2: navigator.userAgent.indexOf('Firefox/2') !== -1, + FF3: navigator.userAgent.indexOf('Firefox/3') !== -1, + Safari: navigator.userAgent.indexOf('Safari') !== -1 + } +}; + + + +/** + * Executor + */ +JSSpec.Executor = function(target, onSuccess, onException) { + this.target = target; + this.onSuccess = typeof onSuccess == 'function' ? onSuccess : JSSpec.EMPTY_FUNCTION; + this.onException = typeof onException == 'function' ? onException : JSSpec.EMPTY_FUNCTION; + + if(JSSpec.Browser.Trident) { + // Exception handler for Trident. It helps to collect exact line number where exception occured. + window.onerror = function(message, fileName, lineNumber) { + var self = window._curExecutor; + var ex = {message:message, fileName:fileName, lineNumber:lineNumber}; + + if(JSSpec._secondPass) { + ex = self.mergeExceptions(JSSpec._assertionFailure, ex); + delete JSSpec._secondPass; + delete JSSpec._assertionFailure; + + ex.type = "failure"; + self.onException(self, ex); + } else if(JSSpec._assertionFailure) { + JSSpec._secondPass = true; + self.run(); + } else { + self.onException(self, ex); + } + + return true; + }; + } +}; +JSSpec.Executor.prototype.mergeExceptions = function(assertionFailure, normalException) { + var merged = { + message:assertionFailure.message, + fileName:normalException.fileName, + lineNumber:normalException.lineNumber + }; + + return merged; +}; + +JSSpec.Executor.prototype.run = function() { + var self = this; + var target = this.target; + var onSuccess = this.onSuccess; + var onException = this.onException; + + window.setTimeout( + function() { + var result; + if(JSSpec.Browser.Trident) { + window._curExecutor = self; + + result = self.target(); + self.onSuccess(self, result); + } else { + try { + result = self.target(); + self.onSuccess(self, result); + } catch(ex) { + if(JSSpec.Browser.Webkit) ex = {message:ex.message, fileName:ex.sourceURL, lineNumber:ex.line}; + + if(JSSpec._secondPass) { + ex = self.mergeExceptions(JSSpec._assertionFailure, ex); + delete JSSpec._secondPass; + delete JSSpec._assertionFailure; + + ex.type = "failure"; + self.onException(self, ex); + } else if(JSSpec._assertionFailure) { + JSSpec._secondPass = true; + self.run(); + } else { + self.onException(self, ex); + } + } + } + }, + 0 + ); +}; + + + +/** + * CompositeExecutor composites one or more executors and execute them sequencially. + */ +JSSpec.CompositeExecutor = function(onSuccess, onException, continueOnException) { + this.queue = []; + this.onSuccess = typeof onSuccess == 'function' ? onSuccess : JSSpec.EMPTY_FUNCTION; + this.onException = typeof onException == 'function' ? onException : JSSpec.EMPTY_FUNCTION; + this.continueOnException = !!continueOnException; +}; + +JSSpec.CompositeExecutor.prototype.addFunction = function(func) { + this.addExecutor(new JSSpec.Executor(func)); +}; + +JSSpec.CompositeExecutor.prototype.addExecutor = function(executor) { + var last = this.queue.length == 0 ? null : this.queue[this.queue.length - 1]; + if(last) { + last.next = executor; + } + + executor.parent = this; + executor.onSuccessBackup = executor.onSuccess; + executor.onSuccess = function(result) { + this.onSuccessBackup(result); + if(this.next) { + this.next.run(); + } else { + this.parent.onSuccess(); + } + }; + executor.onExceptionBackup = executor.onException; + executor.onException = function(executor, ex) { + this.onExceptionBackup(executor, ex); + + if(this.parent.continueOnException) { + if(this.next) { + this.next.run(); + } else { + this.parent.onSuccess(); + } + } else { + this.parent.onException(executor, ex); + } + }; + + this.queue.push(executor); +}; + +JSSpec.CompositeExecutor.prototype.run = function() { + if(this.queue.length > 0) { + this.queue[0].run(); + } +}; + +/** + * Spec is a set of Examples in a specific context + */ +JSSpec.Spec = function(context, entries) { + this.id = JSSpec.Spec.id++; + this.context = context; + this.url = location.href; + + this.filterEntriesByEmbeddedExpressions(entries); + this.extractOutSpecialEntries(entries); + this.examples = this.makeExamplesFromEntries(entries); + this.examplesMap = this.makeMapFromExamples(this.examples); +}; + +JSSpec.Spec.id = 0; +JSSpec.Spec.prototype.getExamples = function() { + return this.examples; +}; + +JSSpec.Spec.prototype.hasException = function() { + return this.getTotalFailures() > 0 || this.getTotalErrors() > 0; +}; + +JSSpec.Spec.prototype.getTotalFailures = function() { + var examples = this.examples; + var failures = 0; + for(var i = 0; i < examples.length; i++) { + if(examples[i].isFailure()) failures++; + } + return failures; +}; + +JSSpec.Spec.prototype.getTotalErrors = function() { + var examples = this.examples; + var errors = 0; + for(var i = 0; i < examples.length; i++) { + if(examples[i].isError()) errors++; + } + return errors; +}; + +JSSpec.Spec.prototype.filterEntriesByEmbeddedExpressions = function(entries) { + var isTrue; + for(name in entries) if(entries.hasOwnProperty(name)) { + var m = name.match(/\[\[(.+)\]\]/); + if(m && m[1]) { + eval("isTrue = (" + m[1] + ")"); + if(!isTrue) delete entries[name]; + } + } +}; + +JSSpec.Spec.prototype.extractOutSpecialEntries = function(entries) { + this.beforeEach = JSSpec.EMPTY_FUNCTION; + this.beforeAll = JSSpec.EMPTY_FUNCTION; + this.afterEach = JSSpec.EMPTY_FUNCTION; + this.afterAll = JSSpec.EMPTY_FUNCTION; + + for(name in entries) if(entries.hasOwnProperty(name)) { + if(name == 'before' || name == 'before each' || name == 'before_each') { + this.beforeEach = entries[name]; + } else if(name == 'before all' || name == 'before_all') { + this.beforeAll = entries[name]; + } else if(name == 'after' || name == 'after each' || name == 'after_each') { + this.afterEach = entries[name]; + } else if(name == 'after all' || name == 'after_all') { + this.afterAll = entries[name]; + } + } + + delete entries['before']; + delete entries['before each']; + delete entries['before_each']; + delete entries['before all']; + delete entries['before_all']; + delete entries['after']; + delete entries['after each']; + delete entries['after_each']; + delete entries['after all']; + delete entries['after_all']; +}; + +JSSpec.Spec.prototype.makeExamplesFromEntries = function(entries) { + var examples = []; + for(name in entries) if(entries.hasOwnProperty(name)) { + examples.push(new JSSpec.Example(name, entries[name], this.beforeEach, this.afterEach)); + } + return examples; +}; + +JSSpec.Spec.prototype.makeMapFromExamples = function(examples) { + var map = {}; + for(var i = 0; i < examples.length; i++) { + var example = examples[i]; + map[example.id] = examples[i]; + } + return map; +}; + +JSSpec.Spec.prototype.getExampleById = function(id) { + return this.examplesMap[id]; +}; + +JSSpec.Spec.prototype.getExecutor = function() { + var self = this; + var onException = function(executor, ex) { + self.exception = ex; + }; + + var composite = new JSSpec.CompositeExecutor(); + composite.addFunction(function() {JSSpec.log.onSpecStart(self);}); + composite.addExecutor(new JSSpec.Executor(this.beforeAll, null, function(exec, ex) { + self.exception = ex; + JSSpec.log.onSpecEnd(self); + })); + + var exampleAndAfter = new JSSpec.CompositeExecutor(null,null,true); + for(var i = 0; i < this.examples.length; i++) { + exampleAndAfter.addExecutor(this.examples[i].getExecutor()); + } + exampleAndAfter.addExecutor(new JSSpec.Executor(this.afterAll, null, onException)); + exampleAndAfter.addFunction(function() {JSSpec.log.onSpecEnd(self);}); + composite.addExecutor(exampleAndAfter); + + return composite; +}; + +/** + * Example + */ +JSSpec.Example = function(name, target, before, after) { + this.id = JSSpec.Example.id++; + this.name = name; + this.target = target; + this.before = before; + this.after = after; +}; + +JSSpec.Example.id = 0; +JSSpec.Example.prototype.isFailure = function() { + return this.exception && this.exception.type == "failure"; +}; + +JSSpec.Example.prototype.isError = function() { + return this.exception && !this.exception.type; +}; + +JSSpec.Example.prototype.getExecutor = function() { + var self = this; + var onException = function(executor, ex) { + self.exception = ex; + }; + + var composite = new JSSpec.CompositeExecutor(); + composite.addFunction(function() {JSSpec.log.onExampleStart(self);}); + composite.addExecutor(new JSSpec.Executor(this.before, null, function(exec, ex) { + self.exception = ex; + JSSpec.log.onExampleEnd(self); + })); + + var targetAndAfter = new JSSpec.CompositeExecutor(null,null,true); + + targetAndAfter.addExecutor(new JSSpec.Executor(this.target, null, onException)); + targetAndAfter.addExecutor(new JSSpec.Executor(this.after, null, onException)); + targetAndAfter.addFunction(function() {JSSpec.log.onExampleEnd(self);}); + + composite.addExecutor(targetAndAfter); + + return composite; +}; + +/** + * Runner + */ +JSSpec.Runner = function(specs, logger) { + JSSpec.log = logger; + + this.totalExamples = 0; + this.specs = []; + this.specsMap = {}; + this.addAllSpecs(specs); +}; + +JSSpec.Runner.prototype.addAllSpecs = function(specs) { + for(var i = 0; i < specs.length; i++) { + this.addSpec(specs[i]); + } +}; + +JSSpec.Runner.prototype.addSpec = function(spec) { + this.specs.push(spec); + this.specsMap[spec.id] = spec; + this.totalExamples += spec.getExamples().length; +}; + +JSSpec.Runner.prototype.getSpecById = function(id) { + return this.specsMap[id]; +}; + +JSSpec.Runner.prototype.getSpecByContext = function(context) { + for(var i = 0; i < this.specs.length; i++) { + if(this.specs[i].context == context) return this.specs[i]; + } + return null; +}; + +JSSpec.Runner.prototype.getSpecs = function() { + return this.specs; +}; + +JSSpec.Runner.prototype.hasException = function() { + return this.getTotalFailures() > 0 || this.getTotalErrors() > 0; +}; + +JSSpec.Runner.prototype.getTotalFailures = function() { + var specs = this.specs; + var failures = 0; + for(var i = 0; i < specs.length; i++) { + failures += specs[i].getTotalFailures(); + } + return failures; +}; + +JSSpec.Runner.prototype.getTotalErrors = function() { + var specs = this.specs; + var errors = 0; + for(var i = 0; i < specs.length; i++) { + errors += specs[i].getTotalErrors(); + } + return errors; +}; + + +JSSpec.Runner.prototype.run = function() { + JSSpec.log.onRunnerStart(); + var executor = new JSSpec.CompositeExecutor(function() {JSSpec.log.onRunnerEnd()},null,true); + for(var i = 0; i < this.specs.length; i++) { + executor.addExecutor(this.specs[i].getExecutor()); + } + executor.run(); +}; + + +JSSpec.Runner.prototype.rerun = function(context) { + JSSpec.runner = new JSSpec.Runner([this.getSpecByContext(context)], JSSpec.log); + JSSpec.runner.run(); +}; + +/** + * Logger + */ +JSSpec.Logger = function() { + this.finishedExamples = 0; + this.startedAt = null; +}; + +JSSpec.Logger.prototype.onRunnerStart = function() { + this._title = document.title; + + this.startedAt = new Date(); + var container = document.getElementById('jsspec_container'); + if(container) { + container.innerHTML = ""; + } else { + container = document.createElement("DIV"); + container.id = "jsspec_container"; + document.body.appendChild(container); + } + + var title = document.createElement("DIV"); + title.id = "title"; + title.innerHTML = [ + '

JSSpec

', + '
    ', + JSSpec.options.rerun ? '
  • [X] ' + JSSpec.util.escapeTags(decodeURIComponent(JSSpec.options.rerun)) + '
  • ' : '', + '
  • ' + JSSpec.runner.totalExamples + ' examples
  • ', + '
  • 0 failures
  • ', + '
  • 0 errors
  • ', + '
  • 0% done
  • ', + '
  • 0 secs
  • ', + '
', + '

JSSpec homepage

', + ].join(""); + container.appendChild(title); + + var list = document.createElement("DIV"); + list.id = "list"; + list.innerHTML = [ + '

List

', + '' + ].join(""); + container.appendChild(list); + + var log = document.createElement("DIV"); + log.id = "log"; + log.innerHTML = [ + '

Log

', + '
    ', + function() { + var specs = JSSpec.runner.getSpecs(); + var sb = []; + for(var i = 0; i < specs.length; i++) { + var spec = specs[i]; + sb.push('
  • '); + sb.push('

    ' + JSSpec.util.escapeTags(specs[i].context) + ' [rerun]

    '); + sb.push('
      '); + for(var j = 0; j < spec.examples.length; j++) { + var example = spec.examples[j]; + sb.push('
    • '); + sb.push('

      ' + JSSpec.util.escapeTags(example.name) + '

      '); + sb.push('
      '+JSSpec.util.escapeTags(example.target.toString())+'
      '); + sb.push('
    • '); + } + sb.push('
    '); + sb.push('
  • '); + } + return sb.join(""); + }(), + '
' + ].join(""); + + container.appendChild(log); + + // add event handler for toggling + var specs = JSSpec.runner.getSpecs(); + var sb = []; + for(var i = 0; i < specs.length; i++) { + var spec = document.getElementById("spec_" + specs[i].id); + var title = spec.getElementsByTagName("H3")[0]; + title.onclick = function(e) { + var target = document.getElementById(this.parentNode.id + "_examples"); + target.style.display = target.style.display == "none" ? "block" : "none"; + return true; + } + } +}; + +JSSpec.Logger.prototype.onRunnerEnd = function() { + if(JSSpec.runner.hasException()) { + var times = 4; + var title1 = "*" + this._title; + var title2 = "*F" + JSSpec.runner.getTotalFailures() + " E" + JSSpec.runner.getTotalErrors() + "* " + this._title; + } else { + var times = 2; + var title1 = this._title; + var title2 = "Success"; + } + this.blinkTitle(times,title1,title2); +}; + +JSSpec.Logger.prototype.blinkTitle = function(times, title1, title2) { + var times = times * 2; + var mode = true; + + var f = function() { + if(times > 0) { + document.title = mode ? title1 : title2; + mode = !mode; + times--; + window.setTimeout(f, 500); + } else { + document.title = title1; + } + }; + + f(); +}; + +JSSpec.Logger.prototype.onSpecStart = function(spec) { + var spec_list = document.getElementById("spec_" + spec.id + "_list"); + var spec_log = document.getElementById("spec_" + spec.id); + + spec_list.className = "ongoing"; + spec_log.className = "ongoing"; +}; + +JSSpec.Logger.prototype.onSpecEnd = function(spec) { + var spec_list = document.getElementById("spec_" + spec.id + "_list"); + var spec_log = document.getElementById("spec_" + spec.id); + var examples = document.getElementById("spec_" + spec.id + "_examples"); + var className = spec.hasException() ? "exception" : "success"; + + spec_list.className = className; + spec_log.className = className; + + if(JSSpec.options.autocollapse && !spec.hasException()) examples.style.display = "none"; + + if(spec.exception) { + spec_log.appendChild(document.createTextNode(" - " + spec.exception.message)); + } +}; + +JSSpec.Logger.prototype.onExampleStart = function(example) { + var li = document.getElementById("example_" + example.id); + li.className = "ongoing"; +}; + +JSSpec.Logger.prototype.onExampleEnd = function(example) { + var li = document.getElementById("example_" + example.id); + li.className = example.exception ? "exception" : "success"; + + if(example.exception) { + var div = document.createElement("DIV"); + div.innerHTML = example.exception.message + "


" + " at " + example.exception.fileName + ", line " + example.exception.lineNumber + "

"; + li.appendChild(div); + } + + var title = document.getElementById("title"); + var runner = JSSpec.runner; + + title.className = runner.hasException() ? "exception" : "success"; + + this.finishedExamples++; + document.getElementById("total_failures").innerHTML = runner.getTotalFailures(); + document.getElementById("total_errors").innerHTML = runner.getTotalErrors(); + var progress = parseInt(this.finishedExamples / runner.totalExamples * 100); + document.getElementById("progress").innerHTML = progress; + document.getElementById("total_elapsed").innerHTML = (new Date().getTime() - this.startedAt.getTime()) / 1000; + + document.title = progress + "%: " + this._title; +}; + +/** + * IncludeMatcher + */ +JSSpec.IncludeMatcher = function(actual, expected, condition) { + this.actual = actual; + this.expected = expected; + this.condition = condition; + this.match = false; + this.explaination = this.makeExplain(); +}; + +JSSpec.IncludeMatcher.createInstance = function(actual, expected, condition) { + return new JSSpec.IncludeMatcher(actual, expected, condition); +}; + +JSSpec.IncludeMatcher.prototype.matches = function() { + return this.match; +}; + +JSSpec.IncludeMatcher.prototype.explain = function() { + return this.explaination; +}; + +JSSpec.IncludeMatcher.prototype.makeExplain = function() { + if(typeof this.actual.length == 'undefined') { + return this.makeExplainForNotArray(); + } else { + return this.makeExplainForArray(); + } +}; + +JSSpec.IncludeMatcher.prototype.makeExplainForNotArray = function() { + if(this.condition) { + this.match = !!this.actual[this.expected]; + } else { + this.match = !this.actual[this.expected]; + } + + var sb = []; + sb.push('

actual value:

'); + sb.push('

' + JSSpec.util.inspect(this.actual, false, this.expected) + '

'); + sb.push('

should ' + (this.condition ? '' : 'not') + ' include:

'); + sb.push('

' + JSSpec.util.inspect(this.expected) + '

'); + return sb.join(""); +}; + +JSSpec.IncludeMatcher.prototype.makeExplainForArray = function() { + var matches; + if(this.condition) { + for(var i = 0; i < this.actual.length; i++) { + matches = JSSpec.EqualityMatcher.createInstance(this.expected, this.actual[i]).matches(); + if(matches) { + this.match = true; + break; + } + } + } else { + for(var i = 0; i < this.actual.length; i++) { + matches = JSSpec.EqualityMatcher.createInstance(this.expected, this.actual[i]).matches(); + if(matches) { + this.match = false; + break; + } + } + } + + if(this.match) return ""; + + var sb = []; + sb.push('

actual value:

'); + sb.push('

' + JSSpec.util.inspect(this.actual, false, this.condition ? null : i) + '

'); + sb.push('

should ' + (this.condition ? '' : 'not') + ' include:

'); + sb.push('

' + JSSpec.util.inspect(this.expected) + '

'); + return sb.join(""); +}; + +/** + * PropertyLengthMatcher + */ +JSSpec.PropertyLengthMatcher = function(num, property, o, condition) { + this.num = num; + this.o = o; + this.property = property; + if((property == 'characters' || property == 'items') && typeof o.length != 'undefined') { + this.property = 'length'; + } + + this.condition = condition; + this.conditionMet = function(x) { + if(condition == 'exactly') return x.length == num; + if(condition == 'at least') return x.length >= num; + if(condition == 'at most') return x.length <= num; + + throw "Unknown condition '" + condition + "'"; + }; + this.match = false; + this.explaination = this.makeExplain(); +}; + +JSSpec.PropertyLengthMatcher.prototype.makeExplain = function() { + if(this.o._type == 'String' && this.property == 'length') { + this.match = this.conditionMet(this.o); + return this.match ? '' : this.makeExplainForString(); + } else if(typeof this.o.length != 'undefined' && this.property == "length") { + this.match = this.conditionMet(this.o); + return this.match ? '' : this.makeExplainForArray(); + } else if(typeof this.o[this.property] != 'undefined' && this.o[this.property] != null) { + this.match = this.conditionMet(this.o[this.property]); + return this.match ? '' : this.makeExplainForObject(); + } else if(typeof this.o[this.property] == 'undefined' || this.o[this.property] == null) { + this.match = false; + return this.makeExplainForNoProperty(); + } + + this.match = true; +}; + +JSSpec.PropertyLengthMatcher.prototype.makeExplainForString = function() { + var sb = []; + + var exp = this.num == 0 ? + 'be an empty string' : + 'have ' + this.condition + ' ' + this.num + ' characters'; + + sb.push('

actual value has ' + this.o.length + ' characters:

'); + sb.push('

' + JSSpec.util.inspect(this.o) + '

'); + sb.push('

but it should ' + exp + '.

'); + + return sb.join(""); +}; + +JSSpec.PropertyLengthMatcher.prototype.makeExplainForArray = function() { + var sb = []; + + var exp = this.num == 0 ? + 'be an empty array' : + 'have ' + this.condition + ' ' + this.num + ' items'; + + sb.push('

actual value has ' + this.o.length + ' items:

'); + sb.push('

' + JSSpec.util.inspect(this.o) + '

'); + sb.push('

but it should ' + exp + '.

'); + + return sb.join(""); +}; + +JSSpec.PropertyLengthMatcher.prototype.makeExplainForObject = function() { + var sb = []; + + var exp = this.num == 0 ? + 'be empty' : + 'have ' + this.condition + ' ' + this.num + ' ' + this.property + '.'; + + sb.push('

actual value has ' + this.o[this.property].length + ' ' + this.property + ':

'); + sb.push('

' + JSSpec.util.inspect(this.o, false, this.property) + '

'); + sb.push('

but it should ' + exp + '.

'); + + return sb.join(""); +}; + +JSSpec.PropertyLengthMatcher.prototype.makeExplainForNoProperty = function() { + var sb = []; + + sb.push('

actual value:

'); + sb.push('

' + JSSpec.util.inspect(this.o) + '

'); + sb.push('

should have ' + this.condition + ' ' + this.num + ' ' + this.property + ' but there\'s no such property.

'); + + return sb.join(""); +}; + +JSSpec.PropertyLengthMatcher.prototype.matches = function() { + return this.match; +}; + +JSSpec.PropertyLengthMatcher.prototype.explain = function() { + return this.explaination; +}; + +JSSpec.PropertyLengthMatcher.createInstance = function(num, property, o, condition) { + return new JSSpec.PropertyLengthMatcher(num, property, o, condition); +}; + +/** + * EqualityMatcher + */ +JSSpec.EqualityMatcher = {}; + +JSSpec.EqualityMatcher.createInstance = function(expected, actual) { + if(expected == null || actual == null) { + return new JSSpec.NullEqualityMatcher(expected, actual); + } else if(expected._type && expected._type == actual._type) { + if(expected._type == "String") { + return new JSSpec.StringEqualityMatcher(expected, actual); + } else if(expected._type == "Date") { + return new JSSpec.DateEqualityMatcher(expected, actual); + } else if(expected._type == "Number") { + return new JSSpec.NumberEqualityMatcher(expected, actual); + } else if(expected._type == "Array") { + return new JSSpec.ArrayEqualityMatcher(expected, actual); + } else if(expected._type == "Boolean") { + return new JSSpec.BooleanEqualityMatcher(expected, actual); + } + } + + return new JSSpec.ObjectEqualityMatcher(expected, actual); +}; + +JSSpec.EqualityMatcher.basicExplain = function(expected, actual, expectedDesc, actualDesc) { + var sb = []; + + sb.push(actualDesc || '

actual value:

'); + sb.push('

' + JSSpec.util.inspect(actual) + '

'); + sb.push(expectedDesc || '

should be:

'); + sb.push('

' + JSSpec.util.inspect(expected) + '

'); + + return sb.join(""); +}; + +JSSpec.EqualityMatcher.diffExplain = function(expected, actual) { + var sb = []; + + sb.push('

diff:

'); + sb.push('

'); + + var dmp = new diff_match_patch(); + var diff = dmp.diff_main(expected, actual); + dmp.diff_cleanupEfficiency(diff); + + sb.push(JSSpec.util.inspect(dmp.diff_prettyHtml(diff), true)); + + sb.push('

'); + + return sb.join(""); +}; + +/** + * BooleanEqualityMatcher + */ +JSSpec.BooleanEqualityMatcher = function(expected, actual) { + this.expected = expected; + this.actual = actual; +}; + +JSSpec.BooleanEqualityMatcher.prototype.explain = function() { + var sb = []; + + sb.push('

actual value:

'); + sb.push('

' + JSSpec.util.inspect(this.actual) + '

'); + sb.push('

should be:

'); + sb.push('

' + JSSpec.util.inspect(this.expected) + '

'); + + return sb.join(""); +}; + +JSSpec.BooleanEqualityMatcher.prototype.matches = function() { + return this.expected == this.actual; +}; + +/** + * NullEqualityMatcher + */ +JSSpec.NullEqualityMatcher = function(expected, actual) { + this.expected = expected; + this.actual = actual; +}; + +JSSpec.NullEqualityMatcher.prototype.matches = function() { + return this.expected == this.actual && typeof this.expected == typeof this.actual; +}; + +JSSpec.NullEqualityMatcher.prototype.explain = function() { + return JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual); +}; + +JSSpec.DateEqualityMatcher = function(expected, actual) { + this.expected = expected; + this.actual = actual; +}; + +JSSpec.DateEqualityMatcher.prototype.matches = function() { + return this.expected.getTime() == this.actual.getTime(); +}; + +JSSpec.DateEqualityMatcher.prototype.explain = function() { + var sb = []; + + sb.push(JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual)); + sb.push(JSSpec.EqualityMatcher.diffExplain(this.expected.toString(), this.actual.toString())); + + return sb.join(""); +}; + +/** + * ObjectEqualityMatcher + */ +JSSpec.ObjectEqualityMatcher = function(expected, actual) { + this.expected = expected; + this.actual = actual; + this.match = this.expected == this.actual; + this.explaination = this.makeExplain(); +}; + +JSSpec.ObjectEqualityMatcher.prototype.matches = function() {return this.match}; + +JSSpec.ObjectEqualityMatcher.prototype.explain = function() {return this.explaination}; + +JSSpec.ObjectEqualityMatcher.prototype.makeExplain = function() { + if(this.expected == this.actual) { + this.match = true; + return ""; + } + + if(JSSpec.util.isDomNode(this.expected)) { + return this.makeExplainForDomNode(); + } + + var key, expectedHasItem, actualHasItem; + + for(key in this.expected) { + expectedHasItem = this.expected[key] != null && typeof this.expected[key] != 'undefined'; + actualHasItem = this.actual[key] != null && typeof this.actual[key] != 'undefined'; + if(expectedHasItem && !actualHasItem) return this.makeExplainForMissingItem(key); + } + for(key in this.actual) { + expectedHasItem = this.expected[key] != null && typeof this.expected[key] != 'undefined'; + actualHasItem = this.actual[key] != null && typeof this.actual[key] != 'undefined'; + if(actualHasItem && !expectedHasItem) return this.makeExplainForUnknownItem(key); + } + + for(key in this.expected) { + var matcher = JSSpec.EqualityMatcher.createInstance(this.expected[key], this.actual[key]); + if(!matcher.matches()) return this.makeExplainForItemMismatch(key); + } + + this.match = true; +}; + +JSSpec.ObjectEqualityMatcher.prototype.makeExplainForDomNode = function(key) { + var sb = []; + + sb.push(JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual)); + + return sb.join(""); +}; + +JSSpec.ObjectEqualityMatcher.prototype.makeExplainForMissingItem = function(key) { + var sb = []; + + sb.push('

actual value has no item named ' + JSSpec.util.inspect(key) + '

'); + sb.push('

' + JSSpec.util.inspect(this.actual, false, key) + '

'); + sb.push('

but it should have the item whose value is ' + JSSpec.util.inspect(this.expected[key]) + '

'); + sb.push('

' + JSSpec.util.inspect(this.expected, false, key) + '

'); + + return sb.join(""); +}; + +JSSpec.ObjectEqualityMatcher.prototype.makeExplainForUnknownItem = function(key) { + var sb = []; + + sb.push('

actual value has item named ' + JSSpec.util.inspect(key) + '

'); + sb.push('

' + JSSpec.util.inspect(this.actual, false, key) + '

'); + sb.push('

but there should be no such item

'); + sb.push('

' + JSSpec.util.inspect(this.expected, false, key) + '

'); + + return sb.join(""); +}; + +JSSpec.ObjectEqualityMatcher.prototype.makeExplainForItemMismatch = function(key) { + var sb = []; + + sb.push('

actual value has an item named ' + JSSpec.util.inspect(key) + ' whose value is ' + JSSpec.util.inspect(this.actual[key]) + '

'); + sb.push('

' + JSSpec.util.inspect(this.actual, false, key) + '

'); + sb.push('

but it\'s value should be ' + JSSpec.util.inspect(this.expected[key]) + '

'); + sb.push('

' + JSSpec.util.inspect(this.expected, false, key) + '

'); + + return sb.join(""); +}; + + + + +/** + * ArrayEqualityMatcher + */ +JSSpec.ArrayEqualityMatcher = function(expected, actual) { + this.expected = expected; + this.actual = actual; + this.match = this.expected == this.actual; + this.explaination = this.makeExplain(); +}; + +JSSpec.ArrayEqualityMatcher.prototype.matches = function() {return this.match}; + +JSSpec.ArrayEqualityMatcher.prototype.explain = function() {return this.explaination}; + +JSSpec.ArrayEqualityMatcher.prototype.makeExplain = function() { + if(this.expected.length != this.actual.length) return this.makeExplainForLengthMismatch(); + + for(var i = 0; i < this.expected.length; i++) { + var matcher = JSSpec.EqualityMatcher.createInstance(this.expected[i], this.actual[i]); + if(!matcher.matches()) return this.makeExplainForItemMismatch(i); + } + + this.match = true; +}; + +JSSpec.ArrayEqualityMatcher.prototype.makeExplainForLengthMismatch = function() { + return JSSpec.EqualityMatcher.basicExplain( + this.expected, + this.actual, + '

but it should be ' + this.expected.length + '

', + '

actual value has ' + this.actual.length + ' items

' + ); +}; + +JSSpec.ArrayEqualityMatcher.prototype.makeExplainForItemMismatch = function(index) { + var postfix = ["th", "st", "nd", "rd", "th"][Math.min((index + 1) % 10,4)]; + + var sb = []; + + sb.push('

' + (index + 1) + postfix + ' item (index ' + index + ') of actual value is ' + JSSpec.util.inspect(this.actual[index]) + ':

'); + sb.push('

' + JSSpec.util.inspect(this.actual, false, index) + '

'); + sb.push('

but it should be ' + JSSpec.util.inspect(this.expected[index]) + ':

'); + sb.push('

' + JSSpec.util.inspect(this.expected, false, index) + '

'); + + return sb.join(""); +}; + +/** + * NumberEqualityMatcher + */ +JSSpec.NumberEqualityMatcher = function(expected, actual) { + this.expected = expected; + this.actual = actual; +}; + +JSSpec.NumberEqualityMatcher.prototype.matches = function() { + if(this.expected == this.actual) return true; +}; + +JSSpec.NumberEqualityMatcher.prototype.explain = function() { + return JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual); +}; + +/** + * StringEqualityMatcher + */ +JSSpec.StringEqualityMatcher = function(expected, actual) { + this.expected = expected; + this.actual = actual; +}; + +JSSpec.StringEqualityMatcher.prototype.matches = function() { + return this.expected == this.actual; +}; + +JSSpec.StringEqualityMatcher.prototype.explain = function() { + var sb = []; + + sb.push(JSSpec.EqualityMatcher.basicExplain(this.expected, this.actual)); + sb.push(JSSpec.EqualityMatcher.diffExplain(this.expected, this.actual)); + return sb.join(""); +}; + +/** + * PatternMatcher + */ +JSSpec.PatternMatcher = function(actual, pattern, condition) { + this.actual = actual; + this.pattern = pattern; + this.condition = condition; + this.match = false; + this.explaination = this.makeExplain(); +}; + +JSSpec.PatternMatcher.createInstance = function(actual, pattern, condition) { + return new JSSpec.PatternMatcher(actual, pattern, condition); +}; + +JSSpec.PatternMatcher.prototype.makeExplain = function() { + var sb; + if(this.actual == null || this.actual._type != 'String') { + sb = []; + sb.push('

actual value:

'); + sb.push('

' + JSSpec.util.inspect(this.actual) + '

'); + sb.push('

should ' + (this.condition ? '' : 'not') + ' match with pattern:

'); + sb.push('

' + JSSpec.util.inspect(this.pattern) + '

'); + sb.push('

but pattern matching cannot be performed.

'); + return sb.join(""); + } else { + this.match = this.condition == !!this.actual.match(this.pattern); + if(this.match) return ""; + + sb = []; + sb.push('

actual value:

'); + sb.push('

' + JSSpec.util.inspect(this.actual) + '

'); + sb.push('

should ' + (this.condition ? '' : 'not') + ' match with pattern:

'); + sb.push('

' + JSSpec.util.inspect(this.pattern) + '

'); + return sb.join(""); + } +}; + +JSSpec.PatternMatcher.prototype.matches = function() { + return this.match; +}; + +JSSpec.PatternMatcher.prototype.explain = function() { + return this.explaination; +}; + +/** + * Domain Specific Languages + */ +JSSpec.DSL = {}; + +JSSpec.DSL.forString = { + normalizeHtml: function() { + var html = this; + + // Uniformize quotation, turn tag names and attribute names into lower case + html = html.replace(/<(\/?)(\w+)([^>]*?)>/img, function(str, closingMark, tagName, attrs) { + var sortedAttrs = JSSpec.util.sortHtmlAttrs(JSSpec.util.correctHtmlAttrQuotation(attrs).toLowerCase()) + return "<" + closingMark + tagName.toLowerCase() + sortedAttrs + ">" + }); + + // validation self-closing tags + html = html.replace(/<(br|hr|img)([^>]*?)>/mg, function(str, tag, attrs) { + return "<" + tag + attrs + " />"; + }); + + // append semi-colon at the end of style value + html = html.replace(/style="(.*?)"/mg, function(str, styleStr) { + styleStr = JSSpec.util.sortStyleEntries(styleStr.strip()); // for Safari + if(styleStr.charAt(styleStr.length - 1) != ';') styleStr += ";" + + return 'style="' + styleStr + '"' + }); + + // sort style entries + + // remove empty style attributes + html = html.replace(/ style=";"/mg, ""); + + // remove new-lines + html = html.replace(/\r/mg, ''); + html = html.replace(/\n/mg, ''); + + return html; + } +}; + + +JSSpec.DSL.describe = function(context, entries, base) { + if(base) { + for(var i = 0; i < JSSpec.specs.length; i++) { + if(JSSpec.specs[i].context === base) { + base = JSSpec.specs[i]; + break; + } + } + + for(var i = 0; i < base.examples.length; i++) { + var example = base.examples[i]; + + if(!entries[example.name]) entries[example.name] = example.target; + } + } + + JSSpec.specs.push(new JSSpec.Spec(context, entries)); +}; + +JSSpec.DSL.value_of = function(target) { + if(JSSpec._secondPass) return {}; + + var subject = new JSSpec.DSL.Subject(target); + return subject; +}; + +JSSpec.DSL.Subject = function(target) { + this.target = target; +}; + +JSSpec.DSL.Subject.prototype._type = 'Subject'; + +JSSpec.DSL.Subject.prototype.should_fail = function(message) { + JSSpec._assertionFailure = {message:message}; + throw JSSpec._assertionFailure; +}; + +JSSpec.DSL.Subject.prototype.should_be = function(expected) { + var matcher = JSSpec.EqualityMatcher.createInstance(expected, this.target); + if(!matcher.matches()) { + JSSpec._assertionFailure = {message:matcher.explain()}; + throw JSSpec._assertionFailure; + } +}; + +JSSpec.DSL.Subject.prototype.should_not_be = function(expected) { + // TODO JSSpec.EqualityMatcher should support 'condition' + var matcher = JSSpec.EqualityMatcher.createInstance(expected, this.target); + if(matcher.matches()) { + JSSpec._assertionFailure = {message:"'" + this.target + "' should not be '" + expected + "'"}; + throw JSSpec._assertionFailure; + } +}; + +JSSpec.DSL.Subject.prototype.should_be_empty = function() { + this.should_have(0, this.getType() == 'String' ? 'characters' : 'items'); +}; + +JSSpec.DSL.Subject.prototype.should_not_be_empty = function() { + this.should_have_at_least(1, this.getType() == 'String' ? 'characters' : 'items'); +}; + +JSSpec.DSL.Subject.prototype.should_be_true = function() { + this.should_be(true); +}; + +JSSpec.DSL.Subject.prototype.should_be_false = function() { + this.should_be(false); +}; + +JSSpec.DSL.Subject.prototype.should_be_null = function() { + this.should_be(null); +}; + +JSSpec.DSL.Subject.prototype.should_be_undefined = function() { + this.should_be(undefined); +}; + +JSSpec.DSL.Subject.prototype.should_not_be_null = function() { + this.should_not_be(null); +}; + +JSSpec.DSL.Subject.prototype.should_not_be_undefined = function() { + this.should_not_be(undefined); +}; + +JSSpec.DSL.Subject.prototype._should_have = function(num, property, condition) { + var matcher = JSSpec.PropertyLengthMatcher.createInstance(num, property, this.target, condition); + if(!matcher.matches()) { + JSSpec._assertionFailure = {message:matcher.explain()}; + throw JSSpec._assertionFailure; + } +}; + +JSSpec.DSL.Subject.prototype.should_have = function(num, property) { + this._should_have(num, property, "exactly"); +}; + +JSSpec.DSL.Subject.prototype.should_have_exactly = function(num, property) { + this._should_have(num, property, "exactly"); +}; + +JSSpec.DSL.Subject.prototype.should_have_at_least = function(num, property) { + this._should_have(num, property, "at least"); +}; + +JSSpec.DSL.Subject.prototype.should_have_at_most = function(num, property) { + this._should_have(num, property, "at most"); +}; + +JSSpec.DSL.Subject.prototype.should_include = function(expected) { + var matcher = JSSpec.IncludeMatcher.createInstance(this.target, expected, true); + if(!matcher.matches()) { + JSSpec._assertionFailure = {message:matcher.explain()}; + throw JSSpec._assertionFailure; + } +}; + +JSSpec.DSL.Subject.prototype.should_not_include = function(expected) { + var matcher = JSSpec.IncludeMatcher.createInstance(this.target, expected, false); + if(!matcher.matches()) { + JSSpec._assertionFailure = {message:matcher.explain()}; + throw JSSpec._assertionFailure; + } +}; + +JSSpec.DSL.Subject.prototype.should_match = function(pattern) { + var matcher = JSSpec.PatternMatcher.createInstance(this.target, pattern, true); + if(!matcher.matches()) { + JSSpec._assertionFailure = {message:matcher.explain()}; + throw JSSpec._assertionFailure; + } +} +JSSpec.DSL.Subject.prototype.should_not_match = function(pattern) { + var matcher = JSSpec.PatternMatcher.createInstance(this.target, pattern, false); + if(!matcher.matches()) { + JSSpec._assertionFailure = {message:matcher.explain()}; + throw JSSpec._assertionFailure; + } +}; + +JSSpec.DSL.Subject.prototype.getType = function() { + if(typeof this.target == 'undefined') { + return 'undefined'; + } else if(this.target == null) { + return 'null'; + } else if(this.target._type) { + return this.target._type; + } else if(JSSpec.util.isDomNode(this.target)) { + return 'DomNode'; + } else { + return 'object'; + } +}; + +/** + * Utilities + */ +JSSpec.util = { + escapeTags: function(string) { + return string.replace(//img, '>'); + }, + escapeMetastring: function(string) { + return string.replace(/\r/img, '\\r').replace(/\n/img, '\\n').replace(/\¶\;\/img, '\\n').replace(/\t/img, '\\t'); + }, + parseOptions: function(defaults) { + var options = defaults; + + var url = location.href; + var queryIndex = url.indexOf('?'); + if(queryIndex == -1) return options; + + var query = url.substring(queryIndex + 1).split('#')[0]; + var pairs = query.split('&'); + for(var i = 0; i < pairs.length; i++) { + var tokens = pairs[i].split('='); + options[tokens[0]] = tokens[1]; + } + + return options; + }, + correctHtmlAttrQuotation: function(html) { + html = html.replace(/(\w+)=['"]([^'"]+)['"]/mg,function (str, name, value) {return name + '=' + '"' + value + '"';}); + html = html.replace(/(\w+)=([^ '"]+)/mg,function (str, name, value) {return name + '=' + '"' + value + '"';}); + html = html.replace(/'/mg, '"'); + + return html; + }, + sortHtmlAttrs: function(html) { + var attrs = []; + html.replace(/((\w+)="[^"]+")/mg, function(str, matched) { + attrs.push(matched); + }); + return attrs.length == 0 ? "" : " " + attrs.sort().join(" "); + }, + sortStyleEntries: function(styleText) { + var entries = styleText.split(/; /); + return entries.sort().join("; "); + }, + escapeHtml: function(str) { + if(!this._div) { + this._div = document.createElement("DIV"); + this._text = document.createTextNode(''); + this._div.appendChild(this._text); + } + this._text.data = str; + return this._div.innerHTML; + }, + isDomNode: function(o) { + // TODO: make it more stricter + return (typeof o.nodeName == 'string') && (typeof o.nodeType == 'number'); + }, + inspectDomPath: function(o) { + var sb = []; + while(o && o.nodeName != '#document' && o.parent) { + var siblings = o.parentNode.childNodes; + for(var i = 0; i < siblings.length; i++) { + if(siblings[i] == o) { + sb.push(o.nodeName + (i == 0 ? '' : '[' + i + ']')); + break; + } + } + o = o.parentNode; + } + return sb.join(" > "); + }, + inspectDomNode: function(o) { + if(o.nodeType == 1) { + var nodeName = o.nodeName.toLowerCase(); + var sb = []; + sb.push(''); + sb.push("<"); + sb.push(nodeName); + + var attrs = o.attributes; + for(var i = 0; i < attrs.length; i++) { + if( + attrs[i].nodeValue && + attrs[i].nodeName != 'contentEditable' && + attrs[i].nodeName != 'style' && + typeof attrs[i].nodeValue != 'function' + ) sb.push(' ' + attrs[i].nodeName.toLowerCase() + '="' + attrs[i].nodeValue + '"'); + } + if(o.style && o.style.cssText) { + sb.push(' style="' + o.style.cssText + '"'); + } + sb.push('>'); + sb.push(JSSpec.util.escapeHtml(o.innerHTML)); + sb.push('</' + nodeName + '>'); + sb.push(' (' + JSSpec.util.inspectDomPath(o) + ')' ); + sb.push(''); + return sb.join(""); + } else if(o.nodeType == 3) { + return '#text ' + o.nodeValue + ''; + } else { + return 'UnknownDomNode'; + } + }, + inspect: function(o, dontEscape, emphasisKey) { + var sb, inspected; + + if(typeof o == 'undefined') return 'undefined'; + if(o == null) return 'null'; + if(o._type == 'String') return '"' + (dontEscape ? JSSpec.util.escapeMetastring(o) : JSSpec.util.escapeHtml(JSSpec.util.escapeMetastring(o))) + '"'; + + if(o._type == 'Date') { + return '"' + o.toString() + '"'; + } + + if(o._type == 'Number') return '' + (dontEscape ? o : JSSpec.util.escapeHtml(o)) + ''; + + if(o._type == 'Boolean') return '' + o + ''; + + if(o._type == 'RegExp') return '' + JSSpec.util.escapeHtml(o.toString()) + ''; + + if(JSSpec.util.isDomNode(o)) return JSSpec.util.inspectDomNode(o); + + if(o._type == 'Array' || typeof o.length != 'undefined') { + sb = []; + for(var i = 0; i < o.length; i++) { + inspected = JSSpec.util.inspect(o[i]); + sb.push(i == emphasisKey ? ('' + inspected + '') : inspected); + } + return '[' + sb.join(', ') + ']'; + } + + // object + sb = []; + for(var key in o) { + if(key == 'should') continue; + + inspected = JSSpec.util.inspect(key) + ":" + JSSpec.util.inspect(o[key]); + sb.push(key == emphasisKey ? ('' + inspected + '') : inspected); + } + return '{' + sb.join(', ') + '}'; + } +}; + +describe = JSSpec.DSL.describe; +behavior_of = JSSpec.DSL.describe; +value_of = JSSpec.DSL.value_of; +expect = JSSpec.DSL.value_of; // @deprecated + +String.prototype._type = "String"; +Number.prototype._type = "Number"; +Date.prototype._type = "Date"; +Array.prototype._type = "Array"; +Boolean.prototype._type = "Boolean"; +RegExp.prototype._type = "RegExp"; + +var targets = [Array.prototype, Date.prototype, Number.prototype, String.prototype, Boolean.prototype, RegExp.prototype]; + +String.prototype.normalizeHtml = JSSpec.DSL.forString.normalizeHtml; +String.prototype.asHtml = String.prototype.normalizeHtml; //@deprecated +String.prototype.strip = function() {return this.replace(/^\s+/, '').replace(/\s+$/, '');} + + +/** + * Main + */ +JSSpec.defaultOptions = { + autorun: 1, + specIdBeginsWith: 0, + exampleIdBeginsWith: 0, + autocollapse: 1 +}; +JSSpec.options = JSSpec.util.parseOptions(JSSpec.defaultOptions); + +JSSpec.Spec.id = JSSpec.options.specIdBeginsWith; +JSSpec.Example.id = JSSpec.options.exampleIdBeginsWith; + + + +window.onload = function() { + if(JSSpec.specs.length > 0) { + if(!JSSpec.options.inSuite) { + JSSpec.runner = new JSSpec.Runner(JSSpec.specs, new JSSpec.Logger()); + if(JSSpec.options.rerun) { + JSSpec.runner.rerun(decodeURIComponent(JSSpec.options.rerun)); + } else { + JSSpec.runner.run(); + } + } else { + // in suite, send all specs to parent + var parentWindow = window.frames.parent.window; + for(var i = 0; i < JSSpec.specs.length; i++) { + parentWindow.JSSpec.specs.push(JSSpec.specs[i]); + } + } + } else { + var links = document.getElementById('list').getElementsByTagName('A'); + var frameContainer = document.createElement('DIV'); + frameContainer.style.display = 'none'; + document.body.appendChild(frameContainer); + + for(var i = 0; i < links.length; i++) { + var frame = document.createElement('IFRAME'); + frame.src = links[i].href + '?inSuite=0&specIdBeginsWith=' + (i * 10000) + '&exampleIdBeginsWith=' + (i * 10000); + frameContainer.appendChild(frame); + } + } } \ No newline at end of file diff --git a/common/js/unittest/JSSpec/demo.html b/common/js/unittest/JSSpec/demo.html index 21a097111..e992e39bd 100644 --- a/common/js/unittest/JSSpec/demo.html +++ b/common/js/unittest/JSSpec/demo.html @@ -1,210 +1,210 @@ - - - - -JSSpec results - - - - - -

A

B

- + + + + +JSSpec results + + + + + +

A

B

+ diff --git a/common/js/unittest/css/JSSpec.css b/common/js/unittest/css/JSSpec.css index b03804ba9..0eac8183a 100644 --- a/common/js/unittest/css/JSSpec.css +++ b/common/js/unittest/css/JSSpec.css @@ -1,224 +1,224 @@ -@CHARSET "UTF-8"; - -/* -------------------- - * @Layout - */ - -html { - overflow: hidden; -} - -body, #jsspec_container { - overflow: hidden; - padding: 0; - margin: 0; - width: 100%; - height: 100%; - background-color: white; -} - -#title { - padding: 0; - margin: 0; - position: absolute; - top: 0px; - left: 0px; - width: 100%; - height: 40px; - overflow: hidden; -} - -#list { - padding: 0; - margin: 0; - position: absolute; - top: 40px; - left: 0px; - bottom: 0px; - overflow: auto; - width: 250px; - _height:expression(document.body.clientHeight-40); -} - -#log { - padding: 0; - margin: 0; - position: absolute; - top: 40px; - left: 250px; - right: 0px; - bottom: 0px; - overflow: auto; - _height:expression(document.body.clientHeight-40); - _width:expression(document.body.clientWidth-250); -} - - - -/* -------------------- - * @Decorations and colors - */ -* { - padding: 0; - margin: 0; - font-family: "Lucida Grande", Helvetica, sans-serif; -} - -li { - list-style: none; -} - -/* hiding subtitles */ -h2 { - display: none; -} - -/* title section */ -div#title { - padding: 0em 0.5em; -} - -div#title h1 { - font-size: 1.5em; - float: left; -} - -div#title ul li { - float: left; - padding: 0.5em 0em 0.5em 0.75em; -} - -div#title p { - float:right; - margin-right:1em; - font-size: 0.75em; -} - -/* spec container */ -ul.specs { - margin: 0.5em; -} -ul.specs li { - margin-bottom: 0.1em; -} - -/* spec title */ -ul.specs li h3 { - font-weight: bold; - font-size: 0.75em; - padding: 0.2em 1em; - cursor: pointer; - _cursor: hand; -} - -/* example container */ -ul.examples li { - border-style: solid; - border-width: 0px 0px 1px 5px; - margin: 0.2em 0em 0.2em 1em; -} - -/* example title */ -ul.examples li h4 { - font-weight: normal; - font-size: 0.75em; - margin-left: 1em; -} - -pre.examples-code { - margin: 0.5em 2em; - padding: 0.5em; - background: white; - border: solid 1px #CCC; -} - -/* example explaination */ -ul.examples li div { - padding: 1em 2em; - font-size: 0.75em; -} - -/* styles for ongoing, success, failure, error */ -div.success, div.success a { - color: #FFFFFF; - background-color: #65C400; -} - -ul.specs li.success h3, ul.specs li.success h3 a { - color: #FFFFFF; - background-color: #65C400; -} - -ul.examples li.success, ul.examples li.success a { - color: #3D7700; - background-color: #DBFFB4; - border-color: #65C400; -} - -div.exception, div.exception a { - color: #FFFFFF; - background-color: #C20000; -} - -ul.specs li.exception h3, ul.specs li.exception h3 a { - color: #FFFFFF; - background-color: #C20000; -} - -ul.examples li.exception, ul.examples li.exception a { - color: #C20000; - background-color: #FFFBD3; - border-color: #C20000; -} - -div.ongoing, div.ongoing a { - color: #000000; - background-color: #FFFF80; -} - -ul.specs li.ongoing h3, ul.specs li.ongoing h3 a { - color: #000000; - background-color: #FFFF80; -} - -ul.examples li.ongoing, ul.examples li.ongoing a { - color: #000000; - background-color: #FFFF80; - border-color: #DDDD00; -} - - - -/* -------------------- - * values - */ -.number_value, .string_value, .regexp_value, .boolean_value, .dom_value { - font-family: monospace; - color: blue; -} -.object_value, .array_value { - line-height: 2em; - padding: 0.1em 0.2em; - margin: 0.1em 0; -} -.date_value { - font-family: monospace; - color: olive; -} -.undefined_value, .null_value { - font-style: italic; - color: blue; -} -.dom_attr_name { -} -.dom_attr_value { - color: red; -} -.dom_path { - font-size: 0.75em; - color: gray; -} -strong { - font-weight: normal; - background-color: #FFC6C6; +@CHARSET "UTF-8"; + +/* -------------------- + * @Layout + */ + +html { + overflow: hidden; +} + +body, #jsspec_container { + overflow: hidden; + padding: 0; + margin: 0; + width: 100%; + height: 100%; + background-color: white; +} + +#title { + padding: 0; + margin: 0; + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height: 40px; + overflow: hidden; +} + +#list { + padding: 0; + margin: 0; + position: absolute; + top: 40px; + left: 0px; + bottom: 0px; + overflow: auto; + width: 250px; + _height:expression(document.body.clientHeight-40); +} + +#log { + padding: 0; + margin: 0; + position: absolute; + top: 40px; + left: 250px; + right: 0px; + bottom: 0px; + overflow: auto; + _height:expression(document.body.clientHeight-40); + _width:expression(document.body.clientWidth-250); +} + + + +/* -------------------- + * @Decorations and colors + */ +* { + padding: 0; + margin: 0; + font-family: "Lucida Grande", Helvetica, sans-serif; +} + +li { + list-style: none; +} + +/* hiding subtitles */ +h2 { + display: none; +} + +/* title section */ +div#title { + padding: 0em 0.5em; +} + +div#title h1 { + font-size: 1.5em; + float: left; +} + +div#title ul li { + float: left; + padding: 0.5em 0em 0.5em 0.75em; +} + +div#title p { + float:right; + margin-right:1em; + font-size: 0.75em; +} + +/* spec container */ +ul.specs { + margin: 0.5em; +} +ul.specs li { + margin-bottom: 0.1em; +} + +/* spec title */ +ul.specs li h3 { + font-weight: bold; + font-size: 0.75em; + padding: 0.2em 1em; + cursor: pointer; + _cursor: hand; +} + +/* example container */ +ul.examples li { + border-style: solid; + border-width: 0px 0px 1px 5px; + margin: 0.2em 0em 0.2em 1em; +} + +/* example title */ +ul.examples li h4 { + font-weight: normal; + font-size: 0.75em; + margin-left: 1em; +} + +pre.examples-code { + margin: 0.5em 2em; + padding: 0.5em; + background: white; + border: solid 1px #CCC; +} + +/* example explaination */ +ul.examples li div { + padding: 1em 2em; + font-size: 0.75em; +} + +/* styles for ongoing, success, failure, error */ +div.success, div.success a { + color: #FFFFFF; + background-color: #65C400; +} + +ul.specs li.success h3, ul.specs li.success h3 a { + color: #FFFFFF; + background-color: #65C400; +} + +ul.examples li.success, ul.examples li.success a { + color: #3D7700; + background-color: #DBFFB4; + border-color: #65C400; +} + +div.exception, div.exception a { + color: #FFFFFF; + background-color: #C20000; +} + +ul.specs li.exception h3, ul.specs li.exception h3 a { + color: #FFFFFF; + background-color: #C20000; +} + +ul.examples li.exception, ul.examples li.exception a { + color: #C20000; + background-color: #FFFBD3; + border-color: #C20000; +} + +div.ongoing, div.ongoing a { + color: #000000; + background-color: #FFFF80; +} + +ul.specs li.ongoing h3, ul.specs li.ongoing h3 a { + color: #000000; + background-color: #FFFF80; +} + +ul.examples li.ongoing, ul.examples li.ongoing a { + color: #000000; + background-color: #FFFF80; + border-color: #DDDD00; +} + + + +/* -------------------- + * values + */ +.number_value, .string_value, .regexp_value, .boolean_value, .dom_value { + font-family: monospace; + color: blue; +} +.object_value, .array_value { + line-height: 2em; + padding: 0.1em 0.2em; + margin: 0.1em 0; +} +.date_value { + font-family: monospace; + color: olive; +} +.undefined_value, .null_value { + font-style: italic; + color: blue; +} +.dom_attr_name { +} +.dom_attr_value { + color: red; +} +.dom_path { + font-size: 0.75em; + color: gray; +} +strong { + font-weight: normal; + background-color: #FFC6C6; } \ No newline at end of file diff --git a/common/js/unittest/unittest_common.html b/common/js/unittest/unittest_common.html index 7cfdf728a..d747815d4 100644 --- a/common/js/unittest/unittest_common.html +++ b/common/js/unittest/unittest_common.html @@ -1,74 +1,74 @@ - - - - -JSSpec results - - - - - - - -

A

B

- + + + + +JSSpec results + + + + + + + +

A

B

+ diff --git a/common/js/xml_js_filter.js b/common/js/xml_js_filter.js index 0f7dfd99e..f0a2ff581 100644 --- a/common/js/xml_js_filter.js +++ b/common/js/xml_js_filter.js @@ -1,14 +1,14 @@ -/** - * @file common/js/xml_js_filter.js - * @author NHN (developers@xpressengine.com) - * @brief xml filter (validator) plugin - * - * A rule is a method validate one field. - * A filter is made up of one or more rules. - **/ - -(function($){var messages=[];var rules=[];var filters=[];var callbacks=[];var extras={};var Validator=xe.createApp('Validator',{init:function(){var regEmail=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;this.cast('ADD_RULE',['email',regEmail]);this.cast('ADD_RULE',['email_address',regEmail]);var regUserid=/^[a-z]+[\w-]*[a-z0-9_]+$/i;this.cast('ADD_RULE',['userid',regUserid]);this.cast('ADD_RULE',['user_id',regUserid]);var regUrl=/^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;this.cast('ADD_RULE',['url',regUrl]);this.cast('ADD_RULE',['homepage',regUrl]);var regKor=/^[가-힣]*$/;this.cast('ADD_RULE',['korean',regKor]);var regKorNum=/^[가-힣0-9]*$/;this.cast('ADD_RULE',['korean_number',regKorNum]);var regAlpha=/^[a-z]*$/i;this.cast('ADD_RULE',['alpha',regAlpha]);var regAlphaNum=/^[a-z][a-z0-9_]*$/i;this.cast('ADD_RULE',['alpha_number',regAlphaNum]);var regNum=/^[0-9]*$/;this.cast('ADD_RULE',['number',regNum]);},run:function(oForm){var filter='';if(oForm._filter)filter=oForm._filter.value;var params=[oForm,filter];var result=this.cast('VALIDATE',params);if(typeof result=='undefined')result=false;return result;},API_ONREADY:function(){var self=this;$('form').each(function(){if(this.onsubmit){this['xe:onsubmit']=this.onsubmit;this.onsubmit=null;}}).submit(function(){var legacyFn=this['xe:onsubmit'];var hasLegacyFn=$.isFunction(legacyFn);var bResult=hasLegacyFn?legacyFn.apply(this):self.run(this);return bResult;});},API_VALIDATE:function(sender,params){var self=this,result=true,form=params[0],filter=null,callback=null;if(form.elements['_filter'])filter=form.elements['_filter'].value;if(!filter)return true;if($.isFunction(callbacks[filter]))callback=callbacks[filter];filter=$.extend({},filters[filter.toLowerCase()]||{},extras);$.each(filter,function(name){var _el=form.elements[name];if(!_el)return true;var el=$(_el),val=$.trim(get_value(el));var minlen=parseInt(this.minlength)||0;var maxlen=parseInt(this.maxlength)||0;var rule=(this.rule||'').split(',');if(this.required&&!val)return(result=(!!self.cast('ALERT',[form,name,'isnull'])&&false));if(!this.required&&!val)return(result=true);if((minlen&&val.lengthmaxlen))return(result=(!!self.cast('ALERT',[form,name,'outofrange',minlen,maxlen])&&false));if(this.equalto){var eq_val=get_value($(form.elements[this.equalto]));if(eq_val!=val)return(result=(!!self.cast('ALERT',[form,name,'equalto'])&&false));} -if(rule){$.each(rule,function(i,r){if(!r)return true;var ret=self.cast('APPLY_RULE',[r,val]);if(!ret){self.cast('ALERT',[form,name,'invalid_'+this]);return(result=false);}});} -if(!result)return false;});if(!result)return false;if($.isFunction(callback))return callback(form);return true;},API_ADD_RULE:function(sender,params){var name=params[0].toLowerCase();rules[name]=params[1];},API_DEL_RULE:function(sender,params){var name=params[0].toLowerCase();delete rules[name];},API_GET_RULE:function(sender,params){var name=params[0].toLowerCase();if(rules[name]){return rules[name];}else{return null;}},API_ADD_FILTER:function(sender,params){var name=params[0].toLowerCase();var filter=params[1];filters[name]=filter;},API_DEL_FILTER:function(sender,params){var name=params[0].toLowerCase();delete filters[name];},API_GET_FILTER:function(sender,params){var name=params[0].toLowerCase();if(filters[name]){return filters[name];}else{return null;}},API_ADD_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();var prop=params[1];extras[name]=prop;},API_GET_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();return extras[name];},API_DEL_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();delete extras[name];},API_APPLY_RULE:function(sender,params){var name=params[0];var value=params[1];if(typeof(rules[name])=='undefined')return true;if($.isFunction(rules[name]))return rules[name](value);if(rules[name]instanceof RegExp)return rules[name].test(value);return true;},API_ALERT:function(sender,params){var form=params[0];var field_name=params[1];var msg_code=params[2];var minlen=params[3];var maxlen=params[4];var field_msg=this.cast('GET_MESSAGE',[field_name]);var msg=this.cast('GET_MESSAGE',[msg_code]);if(msg!=msg_code)msg=(msg.indexOf('%s')<0)?(field_msg+msg):(msg.replace('%s',field_msg));if(minlen||maxlen)msg+='('+(minlen||'')+'~'+(maxlen||'')+')';this.cast('SHOW_ALERT',[msg]);$(form.elements[field_name]).focus();},API_SHOW_ALERT:function(sender,params){alert(params[0]);},API_ADD_MESSAGE:function(sender,params){var msg_code=params[0];var msg_str=params[1];messages[msg_code]=msg_str;},API_GET_MESSAGE:function(sender,params){var msg_code=params[0];return messages[msg_code]||msg_code;},API_ADD_CALLBACK:function(sender,params){var name=params[0];var func=params[1];callbacks[name]=func;},API_REMOVE_CALLBACK:function(sender,params){var name=params[0];delete callbacks[name];}});var oValidator=new Validator;xe.registerApp(oValidator);var EditorStub=xe.createPlugin('editor_stub',{API_BEFORE_VALIDATE:function(sender,params){var form=params[0];var seq=form.getAttribute('editor_sequence');if(seq && typeof seq=='object')seq=seq.value;if(seq){try{editorRelKeys[seq].content.value=editorRelKeys[seq].func(seq)||'';}catch(e){}}}});oValidator.registerPlugin(new EditorStub);function get_value(elem){var vals=[];if(elem.is(':radio')){return elem.filter(':checked').val();}else if(elem.is(':checkbox')){elem.filter(':checked').each(function(){vals.push(this.value);});return vals.join('|@|');}else{return elem.val();}}})(jQuery);function filterAlertMessage(ret_obj){var error=ret_obj["error"];var message=ret_obj["message"];var act=ret_obj["act"];var redirect_url=ret_obj["redirect_url"];var url=location.href;if(typeof(message)!="undefined"&&message&&message!="success")alert(message);if(typeof(act)!="undefined"&&act)url=current_url.setQuery("act",act);else if(typeof(redirect_url)!="undefined"&&redirect_url)url=redirect_url;if(url==location.href)url=url.replace(/#(.*)$/,'');location.href=url;} -function procFilter(form,filter_func){filter_func(form);return false;} +/** + * @file common/js/xml_js_filter.js + * @author NHN (developers@xpressengine.com) + * @brief xml filter (validator) plugin + * + * A rule is a method validate one field. + * A filter is made up of one or more rules. + **/ + +(function($){var messages=[];var rules=[];var filters=[];var callbacks=[];var extras={};var Validator=xe.createApp('Validator',{init:function(){var regEmail=/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/;this.cast('ADD_RULE',['email',regEmail]);this.cast('ADD_RULE',['email_address',regEmail]);var regUserid=/^[a-z]+[\w-]*[a-z0-9_]+$/i;this.cast('ADD_RULE',['userid',regUserid]);this.cast('ADD_RULE',['user_id',regUserid]);var regUrl=/^(https?|ftp|mms):\/\/[0-9a-z-]+(\.[_0-9a-z-\/\~]+)+(:[0-9]{2,4})*$/;this.cast('ADD_RULE',['url',regUrl]);this.cast('ADD_RULE',['homepage',regUrl]);var regKor=/^[가-힣]*$/;this.cast('ADD_RULE',['korean',regKor]);var regKorNum=/^[가-힣0-9]*$/;this.cast('ADD_RULE',['korean_number',regKorNum]);var regAlpha=/^[a-z]*$/i;this.cast('ADD_RULE',['alpha',regAlpha]);var regAlphaNum=/^[a-z][a-z0-9_]*$/i;this.cast('ADD_RULE',['alpha_number',regAlphaNum]);var regNum=/^[0-9]*$/;this.cast('ADD_RULE',['number',regNum]);},run:function(oForm){var filter='';if(oForm._filter)filter=oForm._filter.value;var params=[oForm,filter];var result=this.cast('VALIDATE',params);if(typeof result=='undefined')result=false;return result;},API_ONREADY:function(){var self=this;$('form').each(function(){if(this.onsubmit){this['xe:onsubmit']=this.onsubmit;this.onsubmit=null;}}).submit(function(){var legacyFn=this['xe:onsubmit'];var hasLegacyFn=$.isFunction(legacyFn);var bResult=hasLegacyFn?legacyFn.apply(this):self.run(this);return bResult;});},API_VALIDATE:function(sender,params){var self=this,result=true,form=params[0],filter=null,callback=null;if(form.elements['_filter'])filter=form.elements['_filter'].value;if(!filter)return true;if($.isFunction(callbacks[filter]))callback=callbacks[filter];filter=$.extend({},filters[filter.toLowerCase()]||{},extras);$.each(filter,function(name){var _el=form.elements[name];if(!_el)return true;var el=$(_el),val=$.trim(get_value(el));var minlen=parseInt(this.minlength)||0;var maxlen=parseInt(this.maxlength)||0;var rule=(this.rule||'').split(',');if(this.required&&!val)return(result=(!!self.cast('ALERT',[form,name,'isnull'])&&false));if(!this.required&&!val)return(result=true);if((minlen&&val.lengthmaxlen))return(result=(!!self.cast('ALERT',[form,name,'outofrange',minlen,maxlen])&&false));if(this.equalto){var eq_val=get_value($(form.elements[this.equalto]));if(eq_val!=val)return(result=(!!self.cast('ALERT',[form,name,'equalto'])&&false));} +if(rule){$.each(rule,function(i,r){if(!r)return true;var ret=self.cast('APPLY_RULE',[r,val]);if(!ret){self.cast('ALERT',[form,name,'invalid_'+this]);return(result=false);}});} +if(!result)return false;});if(!result)return false;if($.isFunction(callback))return callback(form);return true;},API_ADD_RULE:function(sender,params){var name=params[0].toLowerCase();rules[name]=params[1];},API_DEL_RULE:function(sender,params){var name=params[0].toLowerCase();delete rules[name];},API_GET_RULE:function(sender,params){var name=params[0].toLowerCase();if(rules[name]){return rules[name];}else{return null;}},API_ADD_FILTER:function(sender,params){var name=params[0].toLowerCase();var filter=params[1];filters[name]=filter;},API_DEL_FILTER:function(sender,params){var name=params[0].toLowerCase();delete filters[name];},API_GET_FILTER:function(sender,params){var name=params[0].toLowerCase();if(filters[name]){return filters[name];}else{return null;}},API_ADD_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();var prop=params[1];extras[name]=prop;},API_GET_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();return extras[name];},API_DEL_EXTRA_FIELD:function(sender,params){var name=params[0].toLowerCase();delete extras[name];},API_APPLY_RULE:function(sender,params){var name=params[0];var value=params[1];if(typeof(rules[name])=='undefined')return true;if($.isFunction(rules[name]))return rules[name](value);if(rules[name]instanceof RegExp)return rules[name].test(value);return true;},API_ALERT:function(sender,params){var form=params[0];var field_name=params[1];var msg_code=params[2];var minlen=params[3];var maxlen=params[4];var field_msg=this.cast('GET_MESSAGE',[field_name]);var msg=this.cast('GET_MESSAGE',[msg_code]);if(msg!=msg_code)msg=(msg.indexOf('%s')<0)?(field_msg+msg):(msg.replace('%s',field_msg));if(minlen||maxlen)msg+='('+(minlen||'')+'~'+(maxlen||'')+')';this.cast('SHOW_ALERT',[msg]);$(form.elements[field_name]).focus();},API_SHOW_ALERT:function(sender,params){alert(params[0]);},API_ADD_MESSAGE:function(sender,params){var msg_code=params[0];var msg_str=params[1];messages[msg_code]=msg_str;},API_GET_MESSAGE:function(sender,params){var msg_code=params[0];return messages[msg_code]||msg_code;},API_ADD_CALLBACK:function(sender,params){var name=params[0];var func=params[1];callbacks[name]=func;},API_REMOVE_CALLBACK:function(sender,params){var name=params[0];delete callbacks[name];}});var oValidator=new Validator;xe.registerApp(oValidator);var EditorStub=xe.createPlugin('editor_stub',{API_BEFORE_VALIDATE:function(sender,params){var form=params[0];var seq=form.getAttribute('editor_sequence');if(seq && typeof seq=='object')seq=seq.value;if(seq){try{editorRelKeys[seq].content.value=editorRelKeys[seq].func(seq)||'';}catch(e){}}}});oValidator.registerPlugin(new EditorStub);function get_value(elem){var vals=[];if(elem.is(':radio')){return elem.filter(':checked').val();}else if(elem.is(':checkbox')){elem.filter(':checked').each(function(){vals.push(this.value);});return vals.join('|@|');}else{return elem.val();}}})(jQuery);function filterAlertMessage(ret_obj){var error=ret_obj["error"];var message=ret_obj["message"];var act=ret_obj["act"];var redirect_url=ret_obj["redirect_url"];var url=location.href;if(typeof(message)!="undefined"&&message&&message!="success")alert(message);if(typeof(act)!="undefined"&&act)url=current_url.setQuery("act",act);else if(typeof(redirect_url)!="undefined"&&redirect_url)url=redirect_url;if(url==location.href)url=url.replace(/#(.*)$/,'');location.href=url;} +function procFilter(form,filter_func){filter_func(form);return false;} function legacy_filter(filter_name,form,module,act,callback,responses,confirm_msg,rename_params){var v=xe.getApp('Validator')[0],$=jQuery,args=[];if(!v)return false;if(!form.elements['_filter'])$(form).prepend('');form.elements['_filter'].value=filter_name;args[0]=filter_name;args[1]=function(f){var params={},res=[],elms=f.elements,data=$(f).serializeArray();$.each(data,function(i,field){var v=$.trim(field.value),n=field.name;if(!v||!n)return true;if(rename_params[n])n=rename_params[n];if(/\[\]$/.test(n))n=n.replace(/\[\]$/,'');if(params[n])params[n]+='|@|'+v;else params[n]=field.value;});if(confirm_msg&&!confirm(confirm_msg))return false;exec_xml(module,act,params,callback,responses,params,form);};v.cast('ADD_CALLBACK',args);v.cast('VALIDATE',[form,filter_name]);return false;} \ No newline at end of file diff --git a/config/config.inc.php b/config/config.inc.php index 898502c4f..32519e430 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -1,163 +1,163 @@ - - */ - if(file_exists(_XE_PATH_.'config/config.user.inc.php')) { - require _XE_PATH_.'config/config.user.inc.php'; - } - - /** - * @brief 디버깅 메시지 출력 (비트 값) - * 0 : 디버그 메시지를 생성/ 출력하지 않음 - * 1 : debugPrint() 함수를 통한 메시지 출력 - * 2 : 소요시간, Request/Response info 출력 - * 4 : DB 쿼리 내역 출력 - **/ - if(!defined('__DEBUG__')) define('__DEBUG__', 0); - - /** - * @brief 디버그 메세지의 출력 장소 - * 0 : files/_debug_message.php 에 연결하여 출력 - * 1 : HTML 최하단에 주석으로 출력 (Response Method가 HTML 일 때) - * 2 : Firebug 콘솔에 출력 (PHP 4 & 5. Firebug/FirePHP 플러그인 필요) - **/ - if(!defined('__DEBUG_OUTPUT__')) define('__DEBUG_OUTPUT__', 0); - - /** - * @brief FirePHP 콘솔 및 브라우저 주석 출력 보안 - * 0 : 제한 없음 (권장하지 않음) - * 1 : 지정한 IP 주소에만 허용 - **/ - if(!defined('__DEBUG_PROTECT__')) define('__DEBUG_PROTECT__', 1); - if(!defined('__DEBUG_PROTECT_IP__')) define('__DEBUG_PROTECT_IP__', '127.0.0.1'); - - /** - * @brief DB 오류 메세지 출력 정의 - * 0 : 출력하지 않음 - * 1 : files/_debug_db_query.php 에 연결하여 출력 - **/ - if(!defined('__DEBUG_DB_OUTPUT__')) define('__DEBUG_DB_OUTPUT__', 0); - - /** - * @brief DB 쿼리중 정해진 시간을 넘기는 쿼리의 로그 남김 - * 0 : 로그를 남기지 않음 - * 0 이상 : 단위를 초로 하여 지정된 초 이상의 실행시간이 걸린 쿼리를 로그로 남김 - * 로그파일은 ./files/_db_slow_query.php 파일로 저장됨 - **/ - if(!defined('__LOG_SLOW_QUERY__')) define('__LOG_SLOW_QUERY__', 0); - - /** - * @brief DB 쿼리 정보를 남김 - * 0 : 쿼리에 정보를 추가하지 않음 - * 1 : XML Query ID를 쿼리 주석으로 남김 - **/ - if(!defined('__DEBUG_QUERY__')) define('__DEBUG_QUERY__', 0); - - /** - * @brief ob_gzhandler를 이용한 압축 기능을 강제로 사용하거나 끄는 옵션 - * 0 : 사용하지 않음 - * 1 : 사용함 - * 대부분의 서버에서는 문제가 없는데 특정 서버군에서 압축전송시 IE에서 오동작을 일으키는경우가 있음 - **/ - if(!defined('__OB_GZHANDLER_ENABLE__')) define('__OB_GZHANDLER_ENABLE__', 1); - - /** - * @brief php unit test (경로/tests/index.php) 의 실행 유무 지정 - * 0 : 사용하지 않음 - * 1 : 사용함 - **/ - if(!defined('__ENABLE_PHPUNIT_TEST__')) define('__ENABLE_PHPUNIT_TEST__', 0); - - /** - * @brief __PROXY_SERVER__ 는 대상 서버를 거쳐서 외부 요청을 하도록 하는 서버의 정보를 가지고 있음 - * FileHandler::getRemoteResource 에서 이 상수를 사용함 - **/ - if(!defined('__PROXY_SERVER__')) define('__PROXY_SERVER__', null); - - /** - * @brief Firebug 콘솔 출력 사용시 관련 파일 require - **/ - if((__DEBUG_OUTPUT__ == 2) && version_compare(PHP_VERSION, '6.0.0') === -1) { - require _XE_PATH_.'libs/FirePHPCore/FirePHP.class.php'; - } - - /** - * @brief Set Timezone as server time - **/ - if(version_compare(PHP_VERSION, '5.3.0') >= 0) - { - date_default_timezone_set(@date_default_timezone_get()); - } - - if(!defined('__XE_LOADED_CLASS__')){ - /** - * @brief 간단하게 사용하기 위한 함수 정의한 파일 require - **/ - require(_XE_PATH_.'config/func.inc.php'); - - if(__DEBUG__) define('__StartTime__', getMicroTime()); - - /** - * @brief 기본적인 class 파일 include - * @TODO : PHP5 기반으로 바꾸게 되면 _autoload()를 이용할 수 있기에 제거 대상 - **/ - if(__DEBUG__) define('__ClassLoadStartTime__', getMicroTime()); - require(_XE_PATH_.'classes/object/Object.class.php'); - require(_XE_PATH_.'classes/extravar/Extravar.class.php'); - require(_XE_PATH_.'classes/handler/Handler.class.php'); - require(_XE_PATH_.'classes/xml/XmlParser.class.php'); - require(_XE_PATH_.'classes/xml/XmlJsFilter.class.php'); - require(_XE_PATH_.'classes/cache/CacheHandler.class.php'); - require(_XE_PATH_.'classes/context/Context.class.php'); - require(_XE_PATH_.'classes/db/DB.class.php'); - require(_XE_PATH_.'classes/file/FileHandler.class.php'); - require(_XE_PATH_.'classes/widget/WidgetHandler.class.php'); - require(_XE_PATH_.'classes/editor/EditorHandler.class.php'); - require(_XE_PATH_.'classes/module/ModuleObject.class.php'); - require(_XE_PATH_.'classes/module/ModuleHandler.class.php'); - require(_XE_PATH_.'classes/display/DisplayHandler.class.php'); - require(_XE_PATH_.'classes/template/TemplateHandler.class.php'); - require(_XE_PATH_.'classes/mail/Mail.class.php'); - require(_XE_PATH_.'classes/page/PageHandler.class.php'); - require(_XE_PATH_.'classes/mobile/Mobile.class.php'); - if(__DEBUG__) $GLOBALS['__elapsed_class_load__'] = getMicroTime() - __ClassLoadStartTime__; - } -?> + + */ + if(file_exists(_XE_PATH_.'config/config.user.inc.php')) { + require _XE_PATH_.'config/config.user.inc.php'; + } + + /** + * @brief 디버깅 메시지 출력 (비트 값) + * 0 : 디버그 메시지를 생성/ 출력하지 않음 + * 1 : debugPrint() 함수를 통한 메시지 출력 + * 2 : 소요시간, Request/Response info 출력 + * 4 : DB 쿼리 내역 출력 + **/ + if(!defined('__DEBUG__')) define('__DEBUG__', 0); + + /** + * @brief 디버그 메세지의 출력 장소 + * 0 : files/_debug_message.php 에 연결하여 출력 + * 1 : HTML 최하단에 주석으로 출력 (Response Method가 HTML 일 때) + * 2 : Firebug 콘솔에 출력 (PHP 4 & 5. Firebug/FirePHP 플러그인 필요) + **/ + if(!defined('__DEBUG_OUTPUT__')) define('__DEBUG_OUTPUT__', 0); + + /** + * @brief FirePHP 콘솔 및 브라우저 주석 출력 보안 + * 0 : 제한 없음 (권장하지 않음) + * 1 : 지정한 IP 주소에만 허용 + **/ + if(!defined('__DEBUG_PROTECT__')) define('__DEBUG_PROTECT__', 1); + if(!defined('__DEBUG_PROTECT_IP__')) define('__DEBUG_PROTECT_IP__', '127.0.0.1'); + + /** + * @brief DB 오류 메세지 출력 정의 + * 0 : 출력하지 않음 + * 1 : files/_debug_db_query.php 에 연결하여 출력 + **/ + if(!defined('__DEBUG_DB_OUTPUT__')) define('__DEBUG_DB_OUTPUT__', 0); + + /** + * @brief DB 쿼리중 정해진 시간을 넘기는 쿼리의 로그 남김 + * 0 : 로그를 남기지 않음 + * 0 이상 : 단위를 초로 하여 지정된 초 이상의 실행시간이 걸린 쿼리를 로그로 남김 + * 로그파일은 ./files/_db_slow_query.php 파일로 저장됨 + **/ + if(!defined('__LOG_SLOW_QUERY__')) define('__LOG_SLOW_QUERY__', 0); + + /** + * @brief DB 쿼리 정보를 남김 + * 0 : 쿼리에 정보를 추가하지 않음 + * 1 : XML Query ID를 쿼리 주석으로 남김 + **/ + if(!defined('__DEBUG_QUERY__')) define('__DEBUG_QUERY__', 0); + + /** + * @brief ob_gzhandler를 이용한 압축 기능을 강제로 사용하거나 끄는 옵션 + * 0 : 사용하지 않음 + * 1 : 사용함 + * 대부분의 서버에서는 문제가 없는데 특정 서버군에서 압축전송시 IE에서 오동작을 일으키는경우가 있음 + **/ + if(!defined('__OB_GZHANDLER_ENABLE__')) define('__OB_GZHANDLER_ENABLE__', 1); + + /** + * @brief php unit test (경로/tests/index.php) 의 실행 유무 지정 + * 0 : 사용하지 않음 + * 1 : 사용함 + **/ + if(!defined('__ENABLE_PHPUNIT_TEST__')) define('__ENABLE_PHPUNIT_TEST__', 0); + + /** + * @brief __PROXY_SERVER__ 는 대상 서버를 거쳐서 외부 요청을 하도록 하는 서버의 정보를 가지고 있음 + * FileHandler::getRemoteResource 에서 이 상수를 사용함 + **/ + if(!defined('__PROXY_SERVER__')) define('__PROXY_SERVER__', null); + + /** + * @brief Firebug 콘솔 출력 사용시 관련 파일 require + **/ + if((__DEBUG_OUTPUT__ == 2) && version_compare(PHP_VERSION, '6.0.0') === -1) { + require _XE_PATH_.'libs/FirePHPCore/FirePHP.class.php'; + } + + /** + * @brief Set Timezone as server time + **/ + if(version_compare(PHP_VERSION, '5.3.0') >= 0) + { + date_default_timezone_set(@date_default_timezone_get()); + } + + if(!defined('__XE_LOADED_CLASS__')){ + /** + * @brief 간단하게 사용하기 위한 함수 정의한 파일 require + **/ + require(_XE_PATH_.'config/func.inc.php'); + + if(__DEBUG__) define('__StartTime__', getMicroTime()); + + /** + * @brief 기본적인 class 파일 include + * @TODO : PHP5 기반으로 바꾸게 되면 _autoload()를 이용할 수 있기에 제거 대상 + **/ + if(__DEBUG__) define('__ClassLoadStartTime__', getMicroTime()); + require(_XE_PATH_.'classes/object/Object.class.php'); + require(_XE_PATH_.'classes/extravar/Extravar.class.php'); + require(_XE_PATH_.'classes/handler/Handler.class.php'); + require(_XE_PATH_.'classes/xml/XmlParser.class.php'); + require(_XE_PATH_.'classes/xml/XmlJsFilter.class.php'); + require(_XE_PATH_.'classes/cache/CacheHandler.class.php'); + require(_XE_PATH_.'classes/context/Context.class.php'); + require(_XE_PATH_.'classes/db/DB.class.php'); + require(_XE_PATH_.'classes/file/FileHandler.class.php'); + require(_XE_PATH_.'classes/widget/WidgetHandler.class.php'); + require(_XE_PATH_.'classes/editor/EditorHandler.class.php'); + require(_XE_PATH_.'classes/module/ModuleObject.class.php'); + require(_XE_PATH_.'classes/module/ModuleHandler.class.php'); + require(_XE_PATH_.'classes/display/DisplayHandler.class.php'); + require(_XE_PATH_.'classes/template/TemplateHandler.class.php'); + require(_XE_PATH_.'classes/mail/Mail.class.php'); + require(_XE_PATH_.'classes/page/PageHandler.class.php'); + require(_XE_PATH_.'classes/mobile/Mobile.class.php'); + if(__DEBUG__) $GLOBALS['__elapsed_class_load__'] = getMicroTime() - __ClassLoadStartTime__; + } +?> diff --git a/config/func.inc.php b/config/func.inc.php index e1cff33ce..d3c206396 100644 --- a/config/func.inc.php +++ b/config/func.inc.php @@ -1,979 +1,979 @@ - '[GMT -12:00] Baker Island Time', - '-1100' => '[GMT -11:00] Niue Time, Samoa Standard Time', - '-1000' => '[GMT -10:00] Hawaii-Aleutian Standard Time, Cook Island Time', - '-0930' => '[GMT -09:30] Marquesas Islands Time', - '-0900' => '[GMT -09:00] Alaska Standard Time, Gambier Island Time', - '-0800' => '[GMT -08:00] Pacific Standard Time', - '-0700' => '[GMT -07:00] Mountain Standard Time', - '-0600' => '[GMT -06:00] Central Standard Time', - '-0500' => '[GMT -05:00] Eastern Standard Time', - '-0400' => '[GMT -04:00] Atlantic Standard Time', - '-0330' => '[GMT -03:30] Newfoundland Standard Time', - '-0300' => '[GMT -03:00] Amazon Standard Time, Central Greenland Time', - '-0200' => '[GMT -02:00] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time', - '-0100' => '[GMT -01:00] Azores Standard Time, Cape Verde Time, Eastern Greenland Time', - '0000' => '[GMT 00:00] Western European Time, Greenwich Mean Time', - '+0100' => '[GMT +01:00] Central European Time, West African Time', - '+0200' => '[GMT +02:00] Eastern European Time, Central African Time', - '+0300' => '[GMT +03:00] Moscow Standard Time, Eastern African Time', - '+0330' => '[GMT +03:30] Iran Standard Time', - '+0400' => '[GMT +04:00] Gulf Standard Time, Samara Standard Time', - '+0430' => '[GMT +04:30] Afghanistan Time', - '+0500' => '[GMT +05:00] Pakistan Standard Time, Yekaterinburg Standard Time', - '+0530' => '[GMT +05:30] Indian Standard Time, Sri Lanka Time', - '+0545' => '[GMT +05:45] Nepal Time', - '+0600' => '[GMT +06:00] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time', - '+0630' => '[GMT +06:30] Cocos Islands Time, Myanmar Time', - '+0700' => '[GMT +07:00] Indochina Time, Krasnoyarsk Standard Time', - '+0800' => '[GMT +08:00] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time', - '+0845' => '[GMT +08:45] Southeastern Western Australia Standard Time', - '+0900' => '[GMT +09:00] Korea Standard Time, Japan Standard Time, China Standard Time', - '+0930' => '[GMT +09:30] Australian Central Standard Time', - '+1000' => '[GMT +10:00] Australian Eastern Standard Time, Vladivostok Standard Time', - '+1030' => '[GMT +10:30] Lord Howe Standard Time', - '+1100' => '[GMT +11:00] Solomon Island Time, Magadan Standard Time', - '+1130' => '[GMT +11:30] Norfolk Island Time', - '+1200' => '[GMT +12:00] New Zealand Time, Fiji Time, Kamchatka Standard Time', - '+1245' => '[GMT +12:45] Chatham Islands Time', - '+1300' => '[GMT +13:00] Tonga Time, Phoenix Islands Time', - '+1400' => '[GMT +14:00] Line Island Time' - ) ; - - /** - * @brief ModuleHandler::getModuleObject($module_name, $type)을 쓰기 쉽게 함수로 선언 - * @param module_name 모듈이름 - * @param type disp, proc, controller, class - * @param kind admin, null - * @return module instance - **/ - function &getModule($module_name, $type = 'view', $kind = '') { - return ModuleHandler::getModuleInstance($module_name, $type, $kind); - } - - /** - * @brief module의 controller 객체 생성용 - * @param module_name 모듈이름 - * @return module controller instance - **/ - function &getController($module_name) { - return getModule($module_name, 'controller'); - } - - /** - * @brief module의 admin controller 객체 생성용 - * @param module_name 모듈이름 - * @return module admin controller instance - **/ - function &getAdminController($module_name) { - return getModule($module_name, 'controller','admin'); - } - - /** - * @brief module의 view 객체 생성용 - * @param module_name 모듈이름 - * @return module view instance - **/ - function &getView($module_name) { - return getModule($module_name, 'view'); - } - - /** - * @brief module의 mobile 객체 생성용 - * @param module_name 모듈이름 - * @return module mobile instance - **/ - function &getMobile($module_name) { - return getModule($module_name, 'mobile'); - } - - /** - * @brief module의 admin view 객체 생성용 - * @param module_name 모듈이름 - * @return module admin view instance - **/ - function &getAdminView($module_name) { - return getModule($module_name, 'view','admin'); - } - - /** - * @brief module의 model 객체 생성용 - * @param module_name 모듈이름 - * @return module model instance - **/ - function &getModel($module_name) { - return getModule($module_name, 'model'); - } - - /** - * @brief module의 admin model 객체 생성용 - * @param module_name 모듈이름 - * @return module admin model instance - **/ - function &getAdminModel($module_name) { - return getModule($module_name, 'model','admin'); - } - - /** - * @brief module의 api 객체 생성용 - * @param module_name 모듈이름 - * @return module api class instance - **/ - function &getAPI($module_name) { - return getModule($module_name, 'api'); - } - - /** - * @brief module의 wap 객체 생성용 - * @param module_name 모듈이름 - * @return module wap class instance - **/ - function &getWAP($module_name) { - return getModule($module_name, 'wap'); - } - - /** - * @brief module의 상위 class 객체 생성용 - * @param module_name 모듈이름 - * @return module class instance - **/ - function &getClass($module_name) { - return getModule($module_name, 'class'); - } - - /** - * @brief DB::executeQuery() 의 alias - * @param query_id 쿼리 ID ( 모듈명.쿼리XML파일 ) - * @param args object 변수로 선언된 인자값 - * @return 처리결과 - **/ - function executeQuery($query_id, $args = null) { - $oDB = &DB::getInstance(); - return $oDB->executeQuery($query_id, $args); - } - - /** - * @brief DB::executeQuery() 의 결과값을 무조건 배열로 처리하도록 하는 함수 - * @param query_id 쿼리 ID ( 모듈명.쿼리XML파일 ) - * @param args object 변수로 선언된 인자값 - * @return 처리결과 - **/ - function executeQueryArray($query_id, $args = null) { - $oDB = &DB::getInstance(); - $output = $oDB->executeQuery($query_id, $args); - if(!is_array($output->data) && count($output->data) > 0){ - $output->data = array($output->data); - } - return $output; - } - - /** - * @brief DB::getNextSequence() 의 alias - * @return big int - **/ - function getNextSequence() { - $oDB = &DB::getInstance(); - return $oDB->getNextSequence(); - } - - /** - * @brief Context::getUrl()를 쓰기 쉽게 함수로 선언 - * @return string - * - * getUrl()은 현재 요청된 RequestURI에 주어진 인자의 값으로 변형하여 url을 리턴한다\n - * 1. 인자는 (key, value)... 의 형식으로 주어져야 한다.\n - * ex) getUrl('key1','val1', 'key2', '') : key1, key2를 val1과 '' 로 변형\n - * 2. 아무런 인자가 없으면 argument를 제외한 url을 리턴 - * 3. 첫 인자값이 '' 이면 RequestUri에다가 추가된 args_list로 url을 만듬 - **/ - function getUrl() { - $num_args = func_num_args(); - $args_list = func_get_args(); - - if(!$num_args) return Context::getRequestUri(); - - return Context::getUrl($num_args, $args_list); - } - - function getNotEncodedUrl() { - $num_args = func_num_args(); - $args_list = func_get_args(); - - if(!$num_args) return Context::getRequestUri(); - - return Context::getUrl($num_args, $args_list, null, false); - } - - /** - * @brief getUrl()의 값에 request uri를 추가하여 reutrn - * full url을 얻기 위함 - **/ - function getFullUrl() { - $num_args = func_num_args(); - $args_list = func_get_args(); - $request_uri = Context::getRequestUri(); - if(!$num_args) return $request_uri; - - $url = Context::getUrl($num_args, $args_list); - if(!preg_match('/^http/i',$url)){ - preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match); - return substr($match[0],0,-1).$url; - } - return $url; - } - - function getNotEncodedFullUrl() { - $num_args = func_num_args(); - $args_list = func_get_args(); - $request_uri = Context::getRequestUri(); - if(!$num_args) return $request_uri; - - $url = Context::getUrl($num_args, $args_list); - if(!preg_match('/^http/i',$url)){ - preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match); - $url = Context::getUrl($num_args, $args_list, null, false); - return substr($match[0],0,-1).$url; - } - return $url; - } - - /** - * @brief Context::getUrl()를 쓰기 쉽게 함수로 선언 - * @return string - * - * getSiteUrl()은 지정된 도메인에 대해 주어진 인자의 값으로 변형하여 url을 리턴한다\n - * 첫 인자는 도메인(http://등이 제외된)+path 여야 함. - **/ - function getSiteUrl() { - $num_args = func_num_args(); - $args_list = func_get_args(); - - if(!$num_args) return Context::getRequestUri(); - - $domain = array_shift($args_list); - $num_args = count($args_list); - - return Context::getUrl($num_args, $args_list, $domain); - } - - function getNotEncodedSiteUrl() { - $num_args = func_num_args(); - $args_list = func_get_args(); - - if(!$num_args) return Context::getRequestUri(); - - $domain = array_shift($args_list); - $num_args = count($args_list); - - return Context::getUrl($num_args, $args_list, $domain, false); - } - - /** - * @brief getSiteUrl()의 값에 request uri를 추가하여 reutrn - * full url을 얻기 위함 - **/ - function getFullSiteUrl() { - $num_args = func_num_args(); - $args_list = func_get_args(); - - $request_uri = Context::getRequestUri(); - if(!$num_args) return $request_uri; - - $domain = array_shift($args_list); - $num_args = count($args_list); - - $url = Context::getUrl($num_args, $args_list, $domain); - if(!preg_match('/^http/i',$url)){ - preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match); - return substr($match[0],0,-1).$url; - } - return $url; - } - - /** - * @brief 가상사이트의 Domain이 url형식인지 site id인지 return - **/ - function isSiteID($domain) { - return preg_match('/^([a-z0-9\_]+)$/i', $domain); - } - - /** - * @brief 주어진 문자를 주어진 크기로 자르고 잘라졌을 경우 주어진 꼬리를 담 - * @param string 자를 원 문자열 - * @param cut_size 주어진 원 문자열을 자를 크기 - * @param tail 잘라졌을 경우 문자열의 제일 뒤에 붙을 꼬리 - * @return string - **/ - function cut_str($string,$cut_size=0,$tail = '...') { - if($cut_size<1 || !$string) return $string; - - $chars = Array(12, 4, 3, 5, 7, 7, 11, 8, 4, 5, 5, 6, 6, 4, 6, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 4, 8, 6, 8, 6, 10, 8, 8, 9, 8, 8, 7, 9, 8, 3, 6, 7, 7, 11, 8, 9, 8, 9, 8, 8, 7, 8, 8, 10, 8, 8, 8, 6, 11, 6, 6, 6, 4, 7, 7, 7, 7, 7, 3, 7, 7, 3, 3, 6, 3, 9, 7, 7, 7, 7, 4, 7, 3, 7, 6, 10, 6, 6, 7, 6, 6, 6, 9); - $max_width = $cut_size*$chars[0]/2; - $char_width = 0; - - $string_length = strlen($string); - $char_count = 0; - - $idx = 0; - while($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width) { - $c = ord(substr($string, $idx,1)); - $char_count++; - if($c<128) { - $char_width += (int)$chars[$c-32]; - $idx++; - } - else if (191<$c && $c < 224) { - $char_width += $chars[4]; - $idx += 2; - } - else { - $char_width += $chars[0]; - $idx += 3; - } - } - $output = substr($string,0,$idx); - if(strlen($output)<$string_length) $output .= $tail; - return $output; - } - - function zgap() { - $time_zone = $GLOBALS['_time_zone']; - if($time_zone < 0) $to = -1; else $to = 1; - $t_hour = substr($time_zone, 1, 2) * $to; - $t_min = substr($time_zone, 3, 2) * $to; - - $server_time_zone = date("O"); - if($server_time_zone < 0) $so = -1; else $so = 1; - $c_hour = substr($server_time_zone, 1, 2) * $so; - $c_min = substr($server_time_zone, 3, 2) * $so; - - $g_min = $t_min - $c_min; - $g_hour = $t_hour - $c_hour; - - $gap = $g_min*60 + $g_hour*60*60; - return $gap; - } - - /** - * @brief YYYYMMDDHHIISS 형식의 시간값을 unix time으로 변경 - * @param str YYYYMMDDHHIISS 형식의 시간값 - * @return int - **/ - function ztime($str) { - if(!$str) return; - $hour = (int)substr($str,8,2); - $min = (int)substr($str,10,2); - $sec = (int)substr($str,12,2); - $year = (int)substr($str,0,4); - $month = (int)substr($str,4,2); - $day = (int)substr($str,6,2); - if(strlen($str) <= 8) { - $gap = 0; - } else { - $gap = zgap(); - } - - return mktime($hour, $min, $sec, $month?$month:1, $day?$day:1, $year)+$gap; - } - - /** - * @brief YmdHis의 시간 형식을 지금으로 부터 몇분/몇시간전, 1일 이상 차이나면 format string return - **/ - function getTimeGap($date, $format = 'Y.m.d') { - $gap = time() - ztime($date); - - $lang_time_gap = Context::getLang('time_gap'); - if($gap<60) $buff = sprintf($lang_time_gap['min'], (int)($gap / 60)+1); - elseif($gap<60*60) $buff = sprintf($lang_time_gap['mins'], (int)($gap / 60)+1); - elseif($gap<60*60*2) $buff = sprintf($lang_time_gap['hour'], (int)($gap / 60 /60)+1); - elseif($gap<60*60*24) $buff = sprintf($lang_time_gap['hours'], (int)($gap / 60 /60)+1); - else $buff = zdate($date, $format); - return $buff; - } - - /** - * @brief 월이름을 return - **/ - function getMonthName($month, $short = true) { - $short_month = array('','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); - $long_month = array('','January','February','March','April','May','June','July','August','September','October','November','December'); - return !$short?$long_month[$month]:$short_month[$month]; - } - - /** - * @brief YYYYMMDDHHIISS 형식의 시간값을 원하는 시간 포맷으로 변형 - * @param string|int str YYYYMMDDHHIISS 형식의 시간 값 - * @param string format php date()함수의 시간 포맷 - * @param bool conversion 언어에 따라 날짜 포맷의 자동변환 여부 - * @return string - **/ - function zdate($str, $format = 'Y-m-d H:i:s', $conversion=true) { - // 대상 시간이 없으면 null return - if(!$str) return; - - // 언어권에 따라서 지정된 날짜 포맷을 변경 - if($conversion == true) { - switch(Context::getLangType()) { - case 'en' : - case 'es' : - if($format == 'Y-m-d') $format = 'M d, Y'; - elseif($format == 'Y-m-d H:i:s') $format = 'M d, Y H:i:s'; - elseif($format == 'Y-m-d H:i') $format = 'M d, Y H:i'; - break; - case 'vi' : - if($format == 'Y-m-d') $format = 'd-m-Y'; - elseif($format == 'Y-m-d H:i:s') $format = 'H:i:s d-m-Y'; - elseif($format == 'Y-m-d H:i') $format = 'H:i d-m-Y'; - break; - - } - } - - // 년도가 1970년 이전이면 별도 처리 - if((int)substr($str,0,4) < 1970) { - $hour = (int)substr($str,8,2); - $min = (int)substr($str,10,2); - $sec = (int)substr($str,12,2); - $year = (int)substr($str,0,4); - $month = (int)substr($str,4,2); - $day = (int)substr($str,6,2); - - // leading zero? - $lz = create_function('$n', 'return ($n>9?"":"0").$n;'); - - $trans = array( - 'Y'=>$year, - 'y'=>$lz($year%100), - 'm'=>$lz($month), - 'n'=>$month, - 'd'=>$lz($day), - 'j'=>$day, - 'G'=>$hour, - 'H'=>$lz($hour), - 'g'=>$hour%12, - 'h'=>$lz($hour%12), - 'i'=>$lz($min), - 's'=>$lz($sec), - 'M'=>getMonthName($month), - 'F'=>getMonthName($month,false) - ); - - $string = strtr($format, $trans); - } else { - // 1970년 이후라면 ztime()함수로 unixtime을 구하고 date함수로 처리 - $string = date($format, ztime($str)); - } - - // 요일, am/pm을 각 언어에 맞게 변경 - $unit_week = Context::getLang('unit_week'); - $unit_meridiem = Context::getLang('unit_meridiem'); - $string = str_replace(array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'),$unit_week, $string); - $string = str_replace(array('am','pm','AM','PM'), $unit_meridiem, $string); - return $string; - } - - /** - * @brief prints debug messages - * @param debug_output target object to be printed - * @param display_line boolean flag whether to print seperator (default:true) - * @return none - * - * ./files/_debug_message.php 파일에 $buff 내용을 출력한다. - * tail -f ./files/_debug_message.php 하여 계속 살펴 볼 수 있다 - **/ - function debugPrint($debug_output = null, $display_option = true, $file = '_debug_message.php') { - if(!(__DEBUG__ & 1)) return; - - static $firephp; - $bt = debug_backtrace(); - if(is_array($bt)) $first = array_shift($bt); - $file_name = array_pop(explode(DIRECTORY_SEPARATOR, $first['file'])); - $line_num = $first['line']; - - if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1) { - if(!isset($firephp)) $firephp = FirePHP::getInstance(true); - if(function_exists("memory_get_usage")) - { - $label = sprintf('[%s:%d] (m:%s)', $file_name, $line_num, FileHandler::filesize(memory_get_usage())); - } - else - { - $label = sprintf('[%s:%d] ', $file_name, $line_num); - } - - // FirePHP 옵션 체크 - if($display_option === 'TABLE') $label = $display_option; - - // __DEBUG_PROTECT__ 옵션으로 지정된 IP와 접근 IP가 동일한지 체크 - if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { - $debug_output = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php'; - $label = null; - } - - $firephp->fb($debug_output, $label); - - } else { - if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { - return; - } - $debug_file = _XE_PATH_.'files/'.$file; - if(function_exists("memory_get_usage")) - { - $debug_output = sprintf("[%s %s:%d] - mem(%s)\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, FileHandler::filesize(memory_get_usage()), print_r($debug_output, true)); - } - else - { - $debug_output = sprintf("[%s %s:%d]\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, print_r($debug_output, true)); - } - - if($display_option === true) $debug_output = str_repeat('=', 40)."\n".$debug_output.str_repeat('-', 40); - $debug_output = "\n\n"; - - if(@!$fp = fopen($debug_file, 'a')) return; - fwrite($fp, $debug_output); - fclose($fp); - } - } - - - /** - * @brief microtime() return - * @return float - **/ - function getMicroTime() { - list($time1, $time2) = explode(' ', microtime()); - return (float)$time1 + (float)$time2; - } - - /** - * @brief 첫번째 인자로 오는 object var에서 2번째 object의 var들을 제거 - * @param target_obj 원 object - * @param del_obj 원 object의 vars에서 del_obj의 vars를 제거한다 - * @return object - **/ - function delObjectVars($target_obj, $del_obj) { - if(!is_object($target_obj)) return; - if(!is_object($del_obj)) return; - - $target_vars = get_object_vars($target_obj); - $del_vars = get_object_vars($del_obj); - - $target = array_keys($target_vars); - $del = array_keys($del_vars); - if(!count($target)||!count($del)) return $target_obj; - - $return_obj = NULL; - - $target_count = count($target); - for($i = 0; $i < $target_count; $i++) { - $target_key = $target[$i]; - if(!in_array($target_key, $del)) $return_obj->{$target_key} = $target_obj->{$target_key}; - } - - return $return_obj; - } - - /** - * @brief php5 이상에서 error_handing을 debugPrint로 변경 - * @param errno - * @param errstr - * @return file - * @return line - **/ - function handleError($errno, $errstr, $file, $line) { - if(!__DEBUG__) return; - $errors = array(E_USER_ERROR, E_ERROR, E_PARSE); - if(!in_array($errno, $errors)) return; - - $output = sprintf("Fatal error : %s - %d", $file, $line); - $output .= sprintf("%d - %s", $errno, $errstr); - - debugPrint($output); - } - - /** - * @brief 주어진 숫자를 주어진 크기로 recursive하게 잘라줌 - * @param no 주어진 숫자 - * @param size 잘라낼 크기 - **/ - function getNumberingPath($no, $size=3) { - $mod = pow(10, $size); - $output = sprintf('%0'.$size.'d/', $no%$mod); - if($no >= $mod) $output .= getNumberingPath((int)$no/$mod, $size); - return $output; - } - - /** - * @brief 한글이 들어간 url의 decode - **/ - function url_decode($str) { - return preg_replace('/%u([[:alnum:]]{4})/', '&#x\\1;',$str); - } - - /** - * @brief 해킹 시도로 의심되는 코드들을 미리 차단 - **/ - function removeHackTag($content) { - // 특정 태그들을 일반 문자로 변경 - $content = preg_replace('/<(\/?)(iframe|script|meta|style|applet|link|base|html|body)/is', '<$1$2', $content); - - /** - * 이미지나 동영상등의 태그에서 src에 관리자 세션을 악용하는 코드를 제거 - * - 취약점 제보 : 김상원님 - **/ - $content = preg_replace_callback("!<(/?)([a-z]+)(.*?)>!is", removeSrcHack, $content); - - // xmp tag 확인 및 추가 - $content = checkXmpTag($content); - - return $content; - } - - /** - * @brief xmp tag 확인 및 닫히지 않은 경우 추가 - **/ - function checkXmpTag($content) { - if(($start_xmp = strrpos($content, '')) !==false) { - if(($close_xmp = strrpos($content, '')) === false) $content .= ''; - else if($close_xmp < $start_xmp) $content .= ''; - } - - return $content; - } - - function removeSrcHack($matches) { - $tag = strtolower(trim($matches[2])); - - // xmp tag 정리 - if($tag=='xmp') return '<'.$matches[1].'xmp>'; - if($matches[1]=='/') return $matches[0]; - - //$buff = trim(preg_replace('/(\/>|>)/','/>',$matches[0])); - $buff = $matches[0]; - $buff = str_replace(array('&','&'),array('&','&'),$buff); - $buff = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', 'fixQuotation', $buff); - - $oXmlParser = new XmlParser(); - $xml_doc = $oXmlParser->parse($buff); - if(!$xml_doc) return sprintf("<%s>", $tag); - - // src값에 module=admin이라는 값이 입력되어 있으면 이 값을 무효화 시킴 - $src = $xml_doc->attrs->src; - $dynsrc = $xml_doc->attrs->dynsrc; - $lowsrc = $xml_doc->attrs->lowsrc; - $href = $xml_doc->attrs->href; - $data = $xml_doc->attrs->data; - $background = $xml_doc->attrs->background; - $style = $xml_doc->attrs->style; - if($style) { - $url = preg_match_all('/url\s*\(([^\)]+)\)/is', $style, $matches2); - if(count($matches2[0])) - { - foreach($matches2[1] as $target) - { - if(_isHackedSrc($target)) return sprintf("<%s>",$tag); - } - } - } - if(_isHackedSrc($src) || _isHackedSrc($dynsrc) || _isHackedSrc($lowsrc) || _isHackedSrc($href) || _isHackedSrc($data) || _isHackedSrc($background) || _isHackedSrcExp($style)) return sprintf("<%s>",$tag); - - if($tag=='param' && $xml_doc->attrs->value && preg_match('/^javascript:/i',$xml_doc->attrs->value)) return sprintf("<%s>",$tag); - if($tag=='object' && $xml_doc->attrs->data && preg_match('/^javascript:/i',$xml_doc->attrs->data)) return sprintf("<%s>",$tag); - - return $buff; - } - - function _isHackedSrcExp($style) { - if(!$style) return false; - if(preg_match('/((\/\*)|(\*\/)|(\\n)|(expression))/i', $style)) return true; - return false; - } - - function _isHackedSrc($src) { - if(!$src) return false; - if($src) { - $target = trim($src); - if(preg_match('/(\s|(\&\#)|(script:))/i', $target)) return true; - if(preg_match('/data:/i', $target)) return true; - - $url_info = parse_url($src); - $query = $url_info['query']; - if(!trim($query)) return false; - $query = str_replace("&","&",$query); - $queries = explode('&', $query); - $cnt = count($queries); - for($i=0;$i<$cnt;$i++) { - $tmp_str = strtolower(trim($queries[$i])); - $pos = strpos($tmp_str,'='); - if($pos === false) continue; - $key = strtolower(trim(substr($tmp_str, 0, $pos))); - $val = strtolower(trim(substr($tmp_str,$pos+1))); - if( ($key=='module'&&$val=='admin') || ($key=='act'&&preg_match('/admin/i',$val)) ) return true; - } - } - return false; - } - - /** - * @brief attribute의 value를 " 로 둘러싸도록 처리하는 함수 - **/ - function fixQuotation($matches) { - $key = $matches[1]; - $val = trim($matches[2]); - - $close_tag = false; - if(substr($val,-1)=='/') { - $close_tag = true; - $val = rtrim(substr($val,0,-1)); - } - - if($val{0}=="'" && substr($val,-1)=="'") - { - $val = sprintf('"%s"', substr($val,1,-1)); - } - - if($close_tag) $val .= ' /'; - - // attribute on* remove - if(preg_match('/^on([a-z]+)/i',preg_replace('/[^a-zA-Z_]/','',$key))) return ''; - - $output = sprintf('%s=%s', $key, $val); - - return $output; - } - - // hexa값을 RGB로 변환 - if(!function_exists('hexrgb')) { - function hexrgb($hexstr) { - $int = hexdec($hexstr); - - return array('red' => 0xFF & ($int >> 0x10), - 'green' => 0xFF & ($int >> 0x8), - 'blue' => 0xFF & $int); - } - - } - - /** - * @brief mysql old_password 의 php 구현 함수 - * 제로보드4나 기타 mysql4.1 이전의 old_password()함수를 쓴 데이터의 사용을 위해서 - * mysql의 password.c 소스 참조해서 구현함 - **/ - function mysql_pre4_hash_password($password) { - $nr = 1345345333; - $add = 7; - $nr2 = 0x12345671; - - settype($password, "string"); - - for ($i=0; $i>6)+192).chr(($num&63)+128); - if($num<65536)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128); - if($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128); - return ''; - } - - - function detectUTF8($string, $return_convert = false, $urldecode = true) { - if($urldecode) $string = urldecode($string); - - $sample = iconv('utf-8', 'utf-8', $string); - $is_utf8 = (md5($sample) == md5($string)); - - if(!$urldecode) $string = urldecode($string); - - if($return_convert) return ($is_utf8) ? $string : iconv('euc-kr', 'utf-8', $string); - - return $is_utf8; - } - - - function json_encode2($data) { - switch (gettype($data)) { - case 'boolean': - return $data?'true':'false'; - case 'integer': - case 'double': - return $data; - case 'string': - return '"'.strtr($data, array('\\'=>'\\\\','"'=>'\\"')).'"'; - case 'object': - $data = get_object_vars($data); - case 'array': - $rel = false; // relative array? - $key = array_keys($data); - foreach ($key as $v) { - if (!is_int($v)) { - $rel = true; - break; - } - } - - $arr = array(); - foreach ($data as $k=>$v) { - $arr[] = ($rel?'"'.strtr($k, array('\\'=>'\\\\','"'=>'\\"')).'":':'').json_encode2($v); - } - - return $rel?'{'.join(',', $arr).'}':'['.join(',', $arr).']'; - default: - return '""'; - } - } - - - function isCrawler($agent = null) { - if(!$agent) $agent = $_SERVER['HTTP_USER_AGENT']; - $check_agent = array('bot', 'spider', 'google', 'yahoo', 'daum', 'teoma', 'fish', 'hanrss', 'facebook'); - $check_ip = array( - '211.245.21.11*' /* mixsh */ - ); - - foreach($check_agent as $str) { - if(stristr($agent, $str) != FALSE) return true; - } - - $check_ip = '/^('.implode($check_ip, '|').')/'; - $check_ip = str_replace('.', '\.', $check_ip); - $check_ip = str_replace('*', '.+', $check_ip); - $check_ip = str_replace('?', '.?', $check_ip); - - if(preg_match($check_ip, $_SERVER['REMOTE_ADDR'], $matches)) return true; - - return false; - } - - function stripEmbedTagForAdmin(&$content, $writer_member_srl) - { - if(!Context::get('is_logged')) return; - $oModuleModel = &getModel('module'); - $logged_info = Context::get('logged_info'); - - if($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info)) ) - { - if($writer_member_srl) - { - $oMemberModel =& getModel('member'); - $member_info = $oMemberModel->getMemberInfoByMemberSrl($writer_member_srl); - if($member_info->is_admin == "Y") - { - return; - } - } - $security_msg = "

".Context::getLang('security_warning_embed')."

"; - $content = preg_replace('/]+>(.*?<\/object>)?/is', $security_msg, $content); - $content = preg_replace('/]+>(\s*<\/embed>)?/is', $security_msg, $content); - $content = preg_replace('/]+editor_component="multimedia_link"[^>]*>(\s*<\/img>)?/is', $security_msg, $content); - } - - return; - } - - function requirePear() - { - if(version_compare(PHP_VERSION, "5.3.0") < 0) - { - set_include_path(_XE_PATH_."libs/PEAR"); - } - else - { - set_include_path(_XE_PATH_."libs/PEAR.1.9"); - - } - } - -?> + '[GMT -12:00] Baker Island Time', + '-1100' => '[GMT -11:00] Niue Time, Samoa Standard Time', + '-1000' => '[GMT -10:00] Hawaii-Aleutian Standard Time, Cook Island Time', + '-0930' => '[GMT -09:30] Marquesas Islands Time', + '-0900' => '[GMT -09:00] Alaska Standard Time, Gambier Island Time', + '-0800' => '[GMT -08:00] Pacific Standard Time', + '-0700' => '[GMT -07:00] Mountain Standard Time', + '-0600' => '[GMT -06:00] Central Standard Time', + '-0500' => '[GMT -05:00] Eastern Standard Time', + '-0400' => '[GMT -04:00] Atlantic Standard Time', + '-0330' => '[GMT -03:30] Newfoundland Standard Time', + '-0300' => '[GMT -03:00] Amazon Standard Time, Central Greenland Time', + '-0200' => '[GMT -02:00] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time', + '-0100' => '[GMT -01:00] Azores Standard Time, Cape Verde Time, Eastern Greenland Time', + '0000' => '[GMT 00:00] Western European Time, Greenwich Mean Time', + '+0100' => '[GMT +01:00] Central European Time, West African Time', + '+0200' => '[GMT +02:00] Eastern European Time, Central African Time', + '+0300' => '[GMT +03:00] Moscow Standard Time, Eastern African Time', + '+0330' => '[GMT +03:30] Iran Standard Time', + '+0400' => '[GMT +04:00] Gulf Standard Time, Samara Standard Time', + '+0430' => '[GMT +04:30] Afghanistan Time', + '+0500' => '[GMT +05:00] Pakistan Standard Time, Yekaterinburg Standard Time', + '+0530' => '[GMT +05:30] Indian Standard Time, Sri Lanka Time', + '+0545' => '[GMT +05:45] Nepal Time', + '+0600' => '[GMT +06:00] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time', + '+0630' => '[GMT +06:30] Cocos Islands Time, Myanmar Time', + '+0700' => '[GMT +07:00] Indochina Time, Krasnoyarsk Standard Time', + '+0800' => '[GMT +08:00] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time', + '+0845' => '[GMT +08:45] Southeastern Western Australia Standard Time', + '+0900' => '[GMT +09:00] Korea Standard Time, Japan Standard Time, China Standard Time', + '+0930' => '[GMT +09:30] Australian Central Standard Time', + '+1000' => '[GMT +10:00] Australian Eastern Standard Time, Vladivostok Standard Time', + '+1030' => '[GMT +10:30] Lord Howe Standard Time', + '+1100' => '[GMT +11:00] Solomon Island Time, Magadan Standard Time', + '+1130' => '[GMT +11:30] Norfolk Island Time', + '+1200' => '[GMT +12:00] New Zealand Time, Fiji Time, Kamchatka Standard Time', + '+1245' => '[GMT +12:45] Chatham Islands Time', + '+1300' => '[GMT +13:00] Tonga Time, Phoenix Islands Time', + '+1400' => '[GMT +14:00] Line Island Time' + ) ; + + /** + * @brief ModuleHandler::getModuleObject($module_name, $type)을 쓰기 쉽게 함수로 선언 + * @param module_name 모듈이름 + * @param type disp, proc, controller, class + * @param kind admin, null + * @return module instance + **/ + function &getModule($module_name, $type = 'view', $kind = '') { + return ModuleHandler::getModuleInstance($module_name, $type, $kind); + } + + /** + * @brief module의 controller 객체 생성용 + * @param module_name 모듈이름 + * @return module controller instance + **/ + function &getController($module_name) { + return getModule($module_name, 'controller'); + } + + /** + * @brief module의 admin controller 객체 생성용 + * @param module_name 모듈이름 + * @return module admin controller instance + **/ + function &getAdminController($module_name) { + return getModule($module_name, 'controller','admin'); + } + + /** + * @brief module의 view 객체 생성용 + * @param module_name 모듈이름 + * @return module view instance + **/ + function &getView($module_name) { + return getModule($module_name, 'view'); + } + + /** + * @brief module의 mobile 객체 생성용 + * @param module_name 모듈이름 + * @return module mobile instance + **/ + function &getMobile($module_name) { + return getModule($module_name, 'mobile'); + } + + /** + * @brief module의 admin view 객체 생성용 + * @param module_name 모듈이름 + * @return module admin view instance + **/ + function &getAdminView($module_name) { + return getModule($module_name, 'view','admin'); + } + + /** + * @brief module의 model 객체 생성용 + * @param module_name 모듈이름 + * @return module model instance + **/ + function &getModel($module_name) { + return getModule($module_name, 'model'); + } + + /** + * @brief module의 admin model 객체 생성용 + * @param module_name 모듈이름 + * @return module admin model instance + **/ + function &getAdminModel($module_name) { + return getModule($module_name, 'model','admin'); + } + + /** + * @brief module의 api 객체 생성용 + * @param module_name 모듈이름 + * @return module api class instance + **/ + function &getAPI($module_name) { + return getModule($module_name, 'api'); + } + + /** + * @brief module의 wap 객체 생성용 + * @param module_name 모듈이름 + * @return module wap class instance + **/ + function &getWAP($module_name) { + return getModule($module_name, 'wap'); + } + + /** + * @brief module의 상위 class 객체 생성용 + * @param module_name 모듈이름 + * @return module class instance + **/ + function &getClass($module_name) { + return getModule($module_name, 'class'); + } + + /** + * @brief DB::executeQuery() 의 alias + * @param query_id 쿼리 ID ( 모듈명.쿼리XML파일 ) + * @param args object 변수로 선언된 인자값 + * @return 처리결과 + **/ + function executeQuery($query_id, $args = null) { + $oDB = &DB::getInstance(); + return $oDB->executeQuery($query_id, $args); + } + + /** + * @brief DB::executeQuery() 의 결과값을 무조건 배열로 처리하도록 하는 함수 + * @param query_id 쿼리 ID ( 모듈명.쿼리XML파일 ) + * @param args object 변수로 선언된 인자값 + * @return 처리결과 + **/ + function executeQueryArray($query_id, $args = null) { + $oDB = &DB::getInstance(); + $output = $oDB->executeQuery($query_id, $args); + if(!is_array($output->data) && count($output->data) > 0){ + $output->data = array($output->data); + } + return $output; + } + + /** + * @brief DB::getNextSequence() 의 alias + * @return big int + **/ + function getNextSequence() { + $oDB = &DB::getInstance(); + return $oDB->getNextSequence(); + } + + /** + * @brief Context::getUrl()를 쓰기 쉽게 함수로 선언 + * @return string + * + * getUrl()은 현재 요청된 RequestURI에 주어진 인자의 값으로 변형하여 url을 리턴한다\n + * 1. 인자는 (key, value)... 의 형식으로 주어져야 한다.\n + * ex) getUrl('key1','val1', 'key2', '') : key1, key2를 val1과 '' 로 변형\n + * 2. 아무런 인자가 없으면 argument를 제외한 url을 리턴 + * 3. 첫 인자값이 '' 이면 RequestUri에다가 추가된 args_list로 url을 만듬 + **/ + function getUrl() { + $num_args = func_num_args(); + $args_list = func_get_args(); + + if(!$num_args) return Context::getRequestUri(); + + return Context::getUrl($num_args, $args_list); + } + + function getNotEncodedUrl() { + $num_args = func_num_args(); + $args_list = func_get_args(); + + if(!$num_args) return Context::getRequestUri(); + + return Context::getUrl($num_args, $args_list, null, false); + } + + /** + * @brief getUrl()의 값에 request uri를 추가하여 reutrn + * full url을 얻기 위함 + **/ + function getFullUrl() { + $num_args = func_num_args(); + $args_list = func_get_args(); + $request_uri = Context::getRequestUri(); + if(!$num_args) return $request_uri; + + $url = Context::getUrl($num_args, $args_list); + if(!preg_match('/^http/i',$url)){ + preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match); + return substr($match[0],0,-1).$url; + } + return $url; + } + + function getNotEncodedFullUrl() { + $num_args = func_num_args(); + $args_list = func_get_args(); + $request_uri = Context::getRequestUri(); + if(!$num_args) return $request_uri; + + $url = Context::getUrl($num_args, $args_list); + if(!preg_match('/^http/i',$url)){ + preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match); + $url = Context::getUrl($num_args, $args_list, null, false); + return substr($match[0],0,-1).$url; + } + return $url; + } + + /** + * @brief Context::getUrl()를 쓰기 쉽게 함수로 선언 + * @return string + * + * getSiteUrl()은 지정된 도메인에 대해 주어진 인자의 값으로 변형하여 url을 리턴한다\n + * 첫 인자는 도메인(http://등이 제외된)+path 여야 함. + **/ + function getSiteUrl() { + $num_args = func_num_args(); + $args_list = func_get_args(); + + if(!$num_args) return Context::getRequestUri(); + + $domain = array_shift($args_list); + $num_args = count($args_list); + + return Context::getUrl($num_args, $args_list, $domain); + } + + function getNotEncodedSiteUrl() { + $num_args = func_num_args(); + $args_list = func_get_args(); + + if(!$num_args) return Context::getRequestUri(); + + $domain = array_shift($args_list); + $num_args = count($args_list); + + return Context::getUrl($num_args, $args_list, $domain, false); + } + + /** + * @brief getSiteUrl()의 값에 request uri를 추가하여 reutrn + * full url을 얻기 위함 + **/ + function getFullSiteUrl() { + $num_args = func_num_args(); + $args_list = func_get_args(); + + $request_uri = Context::getRequestUri(); + if(!$num_args) return $request_uri; + + $domain = array_shift($args_list); + $num_args = count($args_list); + + $url = Context::getUrl($num_args, $args_list, $domain); + if(!preg_match('/^http/i',$url)){ + preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match); + return substr($match[0],0,-1).$url; + } + return $url; + } + + /** + * @brief 가상사이트의 Domain이 url형식인지 site id인지 return + **/ + function isSiteID($domain) { + return preg_match('/^([a-z0-9\_]+)$/i', $domain); + } + + /** + * @brief 주어진 문자를 주어진 크기로 자르고 잘라졌을 경우 주어진 꼬리를 담 + * @param string 자를 원 문자열 + * @param cut_size 주어진 원 문자열을 자를 크기 + * @param tail 잘라졌을 경우 문자열의 제일 뒤에 붙을 꼬리 + * @return string + **/ + function cut_str($string,$cut_size=0,$tail = '...') { + if($cut_size<1 || !$string) return $string; + + $chars = Array(12, 4, 3, 5, 7, 7, 11, 8, 4, 5, 5, 6, 6, 4, 6, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 4, 4, 8, 6, 8, 6, 10, 8, 8, 9, 8, 8, 7, 9, 8, 3, 6, 7, 7, 11, 8, 9, 8, 9, 8, 8, 7, 8, 8, 10, 8, 8, 8, 6, 11, 6, 6, 6, 4, 7, 7, 7, 7, 7, 3, 7, 7, 3, 3, 6, 3, 9, 7, 7, 7, 7, 4, 7, 3, 7, 6, 10, 6, 6, 7, 6, 6, 6, 9); + $max_width = $cut_size*$chars[0]/2; + $char_width = 0; + + $string_length = strlen($string); + $char_count = 0; + + $idx = 0; + while($idx < $string_length && $char_count < $cut_size && $char_width <= $max_width) { + $c = ord(substr($string, $idx,1)); + $char_count++; + if($c<128) { + $char_width += (int)$chars[$c-32]; + $idx++; + } + else if (191<$c && $c < 224) { + $char_width += $chars[4]; + $idx += 2; + } + else { + $char_width += $chars[0]; + $idx += 3; + } + } + $output = substr($string,0,$idx); + if(strlen($output)<$string_length) $output .= $tail; + return $output; + } + + function zgap() { + $time_zone = $GLOBALS['_time_zone']; + if($time_zone < 0) $to = -1; else $to = 1; + $t_hour = substr($time_zone, 1, 2) * $to; + $t_min = substr($time_zone, 3, 2) * $to; + + $server_time_zone = date("O"); + if($server_time_zone < 0) $so = -1; else $so = 1; + $c_hour = substr($server_time_zone, 1, 2) * $so; + $c_min = substr($server_time_zone, 3, 2) * $so; + + $g_min = $t_min - $c_min; + $g_hour = $t_hour - $c_hour; + + $gap = $g_min*60 + $g_hour*60*60; + return $gap; + } + + /** + * @brief YYYYMMDDHHIISS 형식의 시간값을 unix time으로 변경 + * @param str YYYYMMDDHHIISS 형식의 시간값 + * @return int + **/ + function ztime($str) { + if(!$str) return; + $hour = (int)substr($str,8,2); + $min = (int)substr($str,10,2); + $sec = (int)substr($str,12,2); + $year = (int)substr($str,0,4); + $month = (int)substr($str,4,2); + $day = (int)substr($str,6,2); + if(strlen($str) <= 8) { + $gap = 0; + } else { + $gap = zgap(); + } + + return mktime($hour, $min, $sec, $month?$month:1, $day?$day:1, $year)+$gap; + } + + /** + * @brief YmdHis의 시간 형식을 지금으로 부터 몇분/몇시간전, 1일 이상 차이나면 format string return + **/ + function getTimeGap($date, $format = 'Y.m.d') { + $gap = time() - ztime($date); + + $lang_time_gap = Context::getLang('time_gap'); + if($gap<60) $buff = sprintf($lang_time_gap['min'], (int)($gap / 60)+1); + elseif($gap<60*60) $buff = sprintf($lang_time_gap['mins'], (int)($gap / 60)+1); + elseif($gap<60*60*2) $buff = sprintf($lang_time_gap['hour'], (int)($gap / 60 /60)+1); + elseif($gap<60*60*24) $buff = sprintf($lang_time_gap['hours'], (int)($gap / 60 /60)+1); + else $buff = zdate($date, $format); + return $buff; + } + + /** + * @brief 월이름을 return + **/ + function getMonthName($month, $short = true) { + $short_month = array('','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'); + $long_month = array('','January','February','March','April','May','June','July','August','September','October','November','December'); + return !$short?$long_month[$month]:$short_month[$month]; + } + + /** + * @brief YYYYMMDDHHIISS 형식의 시간값을 원하는 시간 포맷으로 변형 + * @param string|int str YYYYMMDDHHIISS 형식의 시간 값 + * @param string format php date()함수의 시간 포맷 + * @param bool conversion 언어에 따라 날짜 포맷의 자동변환 여부 + * @return string + **/ + function zdate($str, $format = 'Y-m-d H:i:s', $conversion=true) { + // 대상 시간이 없으면 null return + if(!$str) return; + + // 언어권에 따라서 지정된 날짜 포맷을 변경 + if($conversion == true) { + switch(Context::getLangType()) { + case 'en' : + case 'es' : + if($format == 'Y-m-d') $format = 'M d, Y'; + elseif($format == 'Y-m-d H:i:s') $format = 'M d, Y H:i:s'; + elseif($format == 'Y-m-d H:i') $format = 'M d, Y H:i'; + break; + case 'vi' : + if($format == 'Y-m-d') $format = 'd-m-Y'; + elseif($format == 'Y-m-d H:i:s') $format = 'H:i:s d-m-Y'; + elseif($format == 'Y-m-d H:i') $format = 'H:i d-m-Y'; + break; + + } + } + + // 년도가 1970년 이전이면 별도 처리 + if((int)substr($str,0,4) < 1970) { + $hour = (int)substr($str,8,2); + $min = (int)substr($str,10,2); + $sec = (int)substr($str,12,2); + $year = (int)substr($str,0,4); + $month = (int)substr($str,4,2); + $day = (int)substr($str,6,2); + + // leading zero? + $lz = create_function('$n', 'return ($n>9?"":"0").$n;'); + + $trans = array( + 'Y'=>$year, + 'y'=>$lz($year%100), + 'm'=>$lz($month), + 'n'=>$month, + 'd'=>$lz($day), + 'j'=>$day, + 'G'=>$hour, + 'H'=>$lz($hour), + 'g'=>$hour%12, + 'h'=>$lz($hour%12), + 'i'=>$lz($min), + 's'=>$lz($sec), + 'M'=>getMonthName($month), + 'F'=>getMonthName($month,false) + ); + + $string = strtr($format, $trans); + } else { + // 1970년 이후라면 ztime()함수로 unixtime을 구하고 date함수로 처리 + $string = date($format, ztime($str)); + } + + // 요일, am/pm을 각 언어에 맞게 변경 + $unit_week = Context::getLang('unit_week'); + $unit_meridiem = Context::getLang('unit_meridiem'); + $string = str_replace(array('Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'),$unit_week, $string); + $string = str_replace(array('am','pm','AM','PM'), $unit_meridiem, $string); + return $string; + } + + /** + * @brief prints debug messages + * @param debug_output target object to be printed + * @param display_line boolean flag whether to print seperator (default:true) + * @return none + * + * ./files/_debug_message.php 파일에 $buff 내용을 출력한다. + * tail -f ./files/_debug_message.php 하여 계속 살펴 볼 수 있다 + **/ + function debugPrint($debug_output = null, $display_option = true, $file = '_debug_message.php') { + if(!(__DEBUG__ & 1)) return; + + static $firephp; + $bt = debug_backtrace(); + if(is_array($bt)) $first = array_shift($bt); + $file_name = array_pop(explode(DIRECTORY_SEPARATOR, $first['file'])); + $line_num = $first['line']; + + if(__DEBUG_OUTPUT__ == 2 && version_compare(PHP_VERSION, '6.0.0') === -1) { + if(!isset($firephp)) $firephp = FirePHP::getInstance(true); + if(function_exists("memory_get_usage")) + { + $label = sprintf('[%s:%d] (m:%s)', $file_name, $line_num, FileHandler::filesize(memory_get_usage())); + } + else + { + $label = sprintf('[%s:%d] ', $file_name, $line_num); + } + + // FirePHP 옵션 체크 + if($display_option === 'TABLE') $label = $display_option; + + // __DEBUG_PROTECT__ 옵션으로 지정된 IP와 접근 IP가 동일한지 체크 + if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { + $debug_output = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php'; + $label = null; + } + + $firephp->fb($debug_output, $label); + + } else { + if(__DEBUG_PROTECT__ === 1 && __DEBUG_PROTECT_IP__ != $_SERVER['REMOTE_ADDR']) { + return; + } + $debug_file = _XE_PATH_.'files/'.$file; + if(function_exists("memory_get_usage")) + { + $debug_output = sprintf("[%s %s:%d] - mem(%s)\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, FileHandler::filesize(memory_get_usage()), print_r($debug_output, true)); + } + else + { + $debug_output = sprintf("[%s %s:%d]\n%s\n", date('Y-m-d H:i:s'), $file_name, $line_num, print_r($debug_output, true)); + } + + if($display_option === true) $debug_output = str_repeat('=', 40)."\n".$debug_output.str_repeat('-', 40); + $debug_output = "\n\n"; + + if(@!$fp = fopen($debug_file, 'a')) return; + fwrite($fp, $debug_output); + fclose($fp); + } + } + + + /** + * @brief microtime() return + * @return float + **/ + function getMicroTime() { + list($time1, $time2) = explode(' ', microtime()); + return (float)$time1 + (float)$time2; + } + + /** + * @brief 첫번째 인자로 오는 object var에서 2번째 object의 var들을 제거 + * @param target_obj 원 object + * @param del_obj 원 object의 vars에서 del_obj의 vars를 제거한다 + * @return object + **/ + function delObjectVars($target_obj, $del_obj) { + if(!is_object($target_obj)) return; + if(!is_object($del_obj)) return; + + $target_vars = get_object_vars($target_obj); + $del_vars = get_object_vars($del_obj); + + $target = array_keys($target_vars); + $del = array_keys($del_vars); + if(!count($target)||!count($del)) return $target_obj; + + $return_obj = NULL; + + $target_count = count($target); + for($i = 0; $i < $target_count; $i++) { + $target_key = $target[$i]; + if(!in_array($target_key, $del)) $return_obj->{$target_key} = $target_obj->{$target_key}; + } + + return $return_obj; + } + + /** + * @brief php5 이상에서 error_handing을 debugPrint로 변경 + * @param errno + * @param errstr + * @return file + * @return line + **/ + function handleError($errno, $errstr, $file, $line) { + if(!__DEBUG__) return; + $errors = array(E_USER_ERROR, E_ERROR, E_PARSE); + if(!in_array($errno, $errors)) return; + + $output = sprintf("Fatal error : %s - %d", $file, $line); + $output .= sprintf("%d - %s", $errno, $errstr); + + debugPrint($output); + } + + /** + * @brief 주어진 숫자를 주어진 크기로 recursive하게 잘라줌 + * @param no 주어진 숫자 + * @param size 잘라낼 크기 + **/ + function getNumberingPath($no, $size=3) { + $mod = pow(10, $size); + $output = sprintf('%0'.$size.'d/', $no%$mod); + if($no >= $mod) $output .= getNumberingPath((int)$no/$mod, $size); + return $output; + } + + /** + * @brief 한글이 들어간 url의 decode + **/ + function url_decode($str) { + return preg_replace('/%u([[:alnum:]]{4})/', '&#x\\1;',$str); + } + + /** + * @brief 해킹 시도로 의심되는 코드들을 미리 차단 + **/ + function removeHackTag($content) { + // 특정 태그들을 일반 문자로 변경 + $content = preg_replace('/<(\/?)(iframe|script|meta|style|applet|link|base|html|body)/is', '<$1$2', $content); + + /** + * 이미지나 동영상등의 태그에서 src에 관리자 세션을 악용하는 코드를 제거 + * - 취약점 제보 : 김상원님 + **/ + $content = preg_replace_callback("!<(/?)([a-z]+)(.*?)>!is", removeSrcHack, $content); + + // xmp tag 확인 및 추가 + $content = checkXmpTag($content); + + return $content; + } + + /** + * @brief xmp tag 확인 및 닫히지 않은 경우 추가 + **/ + function checkXmpTag($content) { + if(($start_xmp = strrpos($content, '')) !==false) { + if(($close_xmp = strrpos($content, '')) === false) $content .= ''; + else if($close_xmp < $start_xmp) $content .= ''; + } + + return $content; + } + + function removeSrcHack($matches) { + $tag = strtolower(trim($matches[2])); + + // xmp tag 정리 + if($tag=='xmp') return '<'.$matches[1].'xmp>'; + if($matches[1]=='/') return $matches[0]; + + //$buff = trim(preg_replace('/(\/>|>)/','/>',$matches[0])); + $buff = $matches[0]; + $buff = str_replace(array('&','&'),array('&','&'),$buff); + $buff = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', 'fixQuotation', $buff); + + $oXmlParser = new XmlParser(); + $xml_doc = $oXmlParser->parse($buff); + if(!$xml_doc) return sprintf("<%s>", $tag); + + // src값에 module=admin이라는 값이 입력되어 있으면 이 값을 무효화 시킴 + $src = $xml_doc->attrs->src; + $dynsrc = $xml_doc->attrs->dynsrc; + $lowsrc = $xml_doc->attrs->lowsrc; + $href = $xml_doc->attrs->href; + $data = $xml_doc->attrs->data; + $background = $xml_doc->attrs->background; + $style = $xml_doc->attrs->style; + if($style) { + $url = preg_match_all('/url\s*\(([^\)]+)\)/is', $style, $matches2); + if(count($matches2[0])) + { + foreach($matches2[1] as $target) + { + if(_isHackedSrc($target)) return sprintf("<%s>",$tag); + } + } + } + if(_isHackedSrc($src) || _isHackedSrc($dynsrc) || _isHackedSrc($lowsrc) || _isHackedSrc($href) || _isHackedSrc($data) || _isHackedSrc($background) || _isHackedSrcExp($style)) return sprintf("<%s>",$tag); + + if($tag=='param' && $xml_doc->attrs->value && preg_match('/^javascript:/i',$xml_doc->attrs->value)) return sprintf("<%s>",$tag); + if($tag=='object' && $xml_doc->attrs->data && preg_match('/^javascript:/i',$xml_doc->attrs->data)) return sprintf("<%s>",$tag); + + return $buff; + } + + function _isHackedSrcExp($style) { + if(!$style) return false; + if(preg_match('/((\/\*)|(\*\/)|(\\n)|(expression))/i', $style)) return true; + return false; + } + + function _isHackedSrc($src) { + if(!$src) return false; + if($src) { + $target = trim($src); + if(preg_match('/(\s|(\&\#)|(script:))/i', $target)) return true; + if(preg_match('/data:/i', $target)) return true; + + $url_info = parse_url($src); + $query = $url_info['query']; + if(!trim($query)) return false; + $query = str_replace("&","&",$query); + $queries = explode('&', $query); + $cnt = count($queries); + for($i=0;$i<$cnt;$i++) { + $tmp_str = strtolower(trim($queries[$i])); + $pos = strpos($tmp_str,'='); + if($pos === false) continue; + $key = strtolower(trim(substr($tmp_str, 0, $pos))); + $val = strtolower(trim(substr($tmp_str,$pos+1))); + if( ($key=='module'&&$val=='admin') || ($key=='act'&&preg_match('/admin/i',$val)) ) return true; + } + } + return false; + } + + /** + * @brief attribute의 value를 " 로 둘러싸도록 처리하는 함수 + **/ + function fixQuotation($matches) { + $key = $matches[1]; + $val = trim($matches[2]); + + $close_tag = false; + if(substr($val,-1)=='/') { + $close_tag = true; + $val = rtrim(substr($val,0,-1)); + } + + if($val{0}=="'" && substr($val,-1)=="'") + { + $val = sprintf('"%s"', substr($val,1,-1)); + } + + if($close_tag) $val .= ' /'; + + // attribute on* remove + if(preg_match('/^on([a-z]+)/i',preg_replace('/[^a-zA-Z_]/','',$key))) return ''; + + $output = sprintf('%s=%s', $key, $val); + + return $output; + } + + // hexa값을 RGB로 변환 + if(!function_exists('hexrgb')) { + function hexrgb($hexstr) { + $int = hexdec($hexstr); + + return array('red' => 0xFF & ($int >> 0x10), + 'green' => 0xFF & ($int >> 0x8), + 'blue' => 0xFF & $int); + } + + } + + /** + * @brief mysql old_password 의 php 구현 함수 + * 제로보드4나 기타 mysql4.1 이전의 old_password()함수를 쓴 데이터의 사용을 위해서 + * mysql의 password.c 소스 참조해서 구현함 + **/ + function mysql_pre4_hash_password($password) { + $nr = 1345345333; + $add = 7; + $nr2 = 0x12345671; + + settype($password, "string"); + + for ($i=0; $i>6)+192).chr(($num&63)+128); + if($num<65536)return chr(($num>>12)+224).chr((($num>>6)&63)+128).chr(($num&63)+128); + if($num<2097152)return chr(($num>>18)+240).chr((($num>>12)&63)+128).chr((($num>>6)&63)+128) .chr(($num&63)+128); + return ''; + } + + + function detectUTF8($string, $return_convert = false, $urldecode = true) { + if($urldecode) $string = urldecode($string); + + $sample = iconv('utf-8', 'utf-8', $string); + $is_utf8 = (md5($sample) == md5($string)); + + if(!$urldecode) $string = urldecode($string); + + if($return_convert) return ($is_utf8) ? $string : iconv('euc-kr', 'utf-8', $string); + + return $is_utf8; + } + + + function json_encode2($data) { + switch (gettype($data)) { + case 'boolean': + return $data?'true':'false'; + case 'integer': + case 'double': + return $data; + case 'string': + return '"'.strtr($data, array('\\'=>'\\\\','"'=>'\\"')).'"'; + case 'object': + $data = get_object_vars($data); + case 'array': + $rel = false; // relative array? + $key = array_keys($data); + foreach ($key as $v) { + if (!is_int($v)) { + $rel = true; + break; + } + } + + $arr = array(); + foreach ($data as $k=>$v) { + $arr[] = ($rel?'"'.strtr($k, array('\\'=>'\\\\','"'=>'\\"')).'":':'').json_encode2($v); + } + + return $rel?'{'.join(',', $arr).'}':'['.join(',', $arr).']'; + default: + return '""'; + } + } + + + function isCrawler($agent = null) { + if(!$agent) $agent = $_SERVER['HTTP_USER_AGENT']; + $check_agent = array('bot', 'spider', 'google', 'yahoo', 'daum', 'teoma', 'fish', 'hanrss', 'facebook'); + $check_ip = array( + '211.245.21.11*' /* mixsh */ + ); + + foreach($check_agent as $str) { + if(stristr($agent, $str) != FALSE) return true; + } + + $check_ip = '/^('.implode($check_ip, '|').')/'; + $check_ip = str_replace('.', '\.', $check_ip); + $check_ip = str_replace('*', '.+', $check_ip); + $check_ip = str_replace('?', '.?', $check_ip); + + if(preg_match($check_ip, $_SERVER['REMOTE_ADDR'], $matches)) return true; + + return false; + } + + function stripEmbedTagForAdmin(&$content, $writer_member_srl) + { + if(!Context::get('is_logged')) return; + $oModuleModel = &getModel('module'); + $logged_info = Context::get('logged_info'); + + if($writer_member_srl != $logged_info->member_srl && ($logged_info->is_admin == "Y" || $oModuleModel->isSiteAdmin($logged_info)) ) + { + if($writer_member_srl) + { + $oMemberModel =& getModel('member'); + $member_info = $oMemberModel->getMemberInfoByMemberSrl($writer_member_srl); + if($member_info->is_admin == "Y") + { + return; + } + } + $security_msg = "

".Context::getLang('security_warning_embed')."

"; + $content = preg_replace('/]+>(.*?<\/object>)?/is', $security_msg, $content); + $content = preg_replace('/]+>(\s*<\/embed>)?/is', $security_msg, $content); + $content = preg_replace('/]+editor_component="multimedia_link"[^>]*>(\s*<\/img>)?/is', $security_msg, $content); + } + + return; + } + + function requirePear() + { + if(version_compare(PHP_VERSION, "5.3.0") < 0) + { + set_include_path(_XE_PATH_."libs/PEAR"); + } + else + { + set_include_path(_XE_PATH_."libs/PEAR.1.9"); + + } + } + +?> diff --git a/libs/PEAR.1.9/HTTP/Request2.php b/libs/PEAR.1.9/HTTP/Request2.php index 980d2c343..1347d6ece 100644 --- a/libs/PEAR.1.9/HTTP/Request2.php +++ b/libs/PEAR.1.9/HTTP/Request2.php @@ -1,861 +1,861 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Request2.php 298246 2010-04-21 10:41:16Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * A class representing an URL as per RFC 3986. - */ -require_once 'Net/URL2.php'; - -/** - * Exception class for HTTP_Request2 package - */ -require_once 'HTTP/Request2/Exception.php'; - -/** - * Class representing a HTTP request message - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @version Release: 0.5.2 - * @link http://tools.ietf.org/html/rfc2616#section-5 - */ -class HTTP_Request2 implements SplSubject -{ - /**#@+ - * Constants for HTTP request methods - * - * @link http://tools.ietf.org/html/rfc2616#section-5.1.1 - */ - const METHOD_OPTIONS = 'OPTIONS'; - const METHOD_GET = 'GET'; - const METHOD_HEAD = 'HEAD'; - const METHOD_POST = 'POST'; - const METHOD_PUT = 'PUT'; - const METHOD_DELETE = 'DELETE'; - const METHOD_TRACE = 'TRACE'; - const METHOD_CONNECT = 'CONNECT'; - /**#@-*/ - - /**#@+ - * Constants for HTTP authentication schemes - * - * @link http://tools.ietf.org/html/rfc2617 - */ - const AUTH_BASIC = 'basic'; - const AUTH_DIGEST = 'digest'; - /**#@-*/ - - /** - * Regular expression used to check for invalid symbols in RFC 2616 tokens - * @link http://pear.php.net/bugs/bug.php?id=15630 - */ - const REGEXP_INVALID_TOKEN = '![\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]!'; - - /** - * Regular expression used to check for invalid symbols in cookie strings - * @link http://pear.php.net/bugs/bug.php?id=15630 - * @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html - */ - const REGEXP_INVALID_COOKIE = '/[\s,;]/'; - - /** - * Fileinfo magic database resource - * @var resource - * @see detectMimeType() - */ - private static $_fileinfoDb; - - /** - * Observers attached to the request (instances of SplObserver) - * @var array - */ - protected $observers = array(); - - /** - * Request URL - * @var Net_URL2 - */ - protected $url; - - /** - * Request method - * @var string - */ - protected $method = self::METHOD_GET; - - /** - * Authentication data - * @var array - * @see getAuth() - */ - protected $auth; - - /** - * Request headers - * @var array - */ - protected $headers = array(); - - /** - * Configuration parameters - * @var array - * @see setConfig() - */ - protected $config = array( - 'adapter' => 'HTTP_Request2_Adapter_Socket', - 'connect_timeout' => 10, - 'timeout' => 0, - 'use_brackets' => true, - 'protocol_version' => '1.1', - 'buffer_size' => 16384, - 'store_body' => true, - - 'proxy_host' => '', - 'proxy_port' => '', - 'proxy_user' => '', - 'proxy_password' => '', - 'proxy_auth_scheme' => self::AUTH_BASIC, - - 'ssl_verify_peer' => true, - 'ssl_verify_host' => true, - 'ssl_cafile' => null, - 'ssl_capath' => null, - 'ssl_local_cert' => null, - 'ssl_passphrase' => null, - - 'digest_compat_ie' => false, - - 'follow_redirects' => false, - 'max_redirects' => 5, - 'strict_redirects' => false - ); - - /** - * Last event in request / response handling, intended for observers - * @var array - * @see getLastEvent() - */ - protected $lastEvent = array( - 'name' => 'start', - 'data' => null - ); - - /** - * Request body - * @var string|resource - * @see setBody() - */ - protected $body = ''; - - /** - * Array of POST parameters - * @var array - */ - protected $postParams = array(); - - /** - * Array of file uploads (for multipart/form-data POST requests) - * @var array - */ - protected $uploads = array(); - - /** - * Adapter used to perform actual HTTP request - * @var HTTP_Request2_Adapter - */ - protected $adapter; - - - /** - * Constructor. Can set request URL, method and configuration array. - * - * Also sets a default value for User-Agent header. - * - * @param string|Net_Url2 Request URL - * @param string Request method - * @param array Configuration for this Request instance - */ - public function __construct($url = null, $method = self::METHOD_GET, array $config = array()) - { - $this->setConfig($config); - if (!empty($url)) { - $this->setUrl($url); - } - if (!empty($method)) { - $this->setMethod($method); - } - $this->setHeader('user-agent', 'HTTP_Request2/0.5.2 ' . - '(http://pear.php.net/package/http_request2) ' . - 'PHP/' . phpversion()); - } - - /** - * Sets the URL for this request - * - * If the URL has userinfo part (username & password) these will be removed - * and converted to auth data. If the URL does not have a path component, - * that will be set to '/'. - * - * @param string|Net_URL2 Request URL - * @return HTTP_Request2 - * @throws HTTP_Request2_Exception - */ - public function setUrl($url) - { - if (is_string($url)) { - $url = new Net_URL2( - $url, array(Net_URL2::OPTION_USE_BRACKETS => $this->config['use_brackets']) - ); - } - if (!$url instanceof Net_URL2) { - throw new HTTP_Request2_Exception('Parameter is not a valid HTTP URL'); - } - // URL contains username / password? - if ($url->getUserinfo()) { - $username = $url->getUser(); - $password = $url->getPassword(); - $this->setAuth(rawurldecode($username), $password? rawurldecode($password): ''); - $url->setUserinfo(''); - } - if ('' == $url->getPath()) { - $url->setPath('/'); - } - $this->url = $url; - - return $this; - } - - /** - * Returns the request URL - * - * @return Net_URL2 - */ - public function getUrl() - { - return $this->url; - } - - /** - * Sets the request method - * - * @param string - * @return HTTP_Request2 - * @throws HTTP_Request2_Exception if the method name is invalid - */ - public function setMethod($method) - { - // Method name should be a token: http://tools.ietf.org/html/rfc2616#section-5.1.1 - if (preg_match(self::REGEXP_INVALID_TOKEN, $method)) { - throw new HTTP_Request2_Exception("Invalid request method '{$method}'"); - } - $this->method = $method; - - return $this; - } - - /** - * Returns the request method - * - * @return string - */ - public function getMethod() - { - return $this->method; - } - - /** - * Sets the configuration parameter(s) - * - * The following parameters are available: - *
    - *
  • 'adapter' - adapter to use (string)
  • - *
  • 'connect_timeout' - Connection timeout in seconds (integer)
  • - *
  • 'timeout' - Total number of seconds a request can take. - * Use 0 for no limit, should be greater than - * 'connect_timeout' if set (integer)
  • - *
  • 'use_brackets' - Whether to append [] to array variable names (bool)
  • - *
  • 'protocol_version' - HTTP Version to use, '1.0' or '1.1' (string)
  • - *
  • 'buffer_size' - Buffer size to use for reading and writing (int)
  • - *
  • 'store_body' - Whether to store response body in response object. - * Set to false if receiving a huge response and - * using an Observer to save it (boolean)
  • - *
  • 'proxy_host' - Proxy server host (string)
  • - *
  • 'proxy_port' - Proxy server port (integer)
  • - *
  • 'proxy_user' - Proxy auth username (string)
  • - *
  • 'proxy_password' - Proxy auth password (string)
  • - *
  • 'proxy_auth_scheme' - Proxy auth scheme, one of HTTP_Request2::AUTH_* constants (string)
  • - *
  • 'ssl_verify_peer' - Whether to verify peer's SSL certificate (bool)
  • - *
  • 'ssl_verify_host' - Whether to check that Common Name in SSL - * certificate matches host name (bool)
  • - *
  • 'ssl_cafile' - Cerificate Authority file to verify the peer - * with (use with 'ssl_verify_peer') (string)
  • - *
  • 'ssl_capath' - Directory holding multiple Certificate - * Authority files (string)
  • - *
  • 'ssl_local_cert' - Name of a file containing local cerificate (string)
  • - *
  • 'ssl_passphrase' - Passphrase with which local certificate - * was encoded (string)
  • - *
  • 'digest_compat_ie' - Whether to imitate behaviour of MSIE 5 and 6 - * in using URL without query string in digest - * authentication (boolean)
  • - *
  • 'follow_redirects' - Whether to automatically follow HTTP Redirects (boolean)
  • - *
  • 'max_redirects' - Maximum number of redirects to follow (integer)
  • - *
  • 'strict_redirects' - Whether to keep request method on redirects via status 301 and - * 302 (true, needed for compatibility with RFC 2616) - * or switch to GET (false, needed for compatibility with most - * browsers) (boolean)
  • - *
- * - * @param string|array configuration parameter name or array - * ('parameter name' => 'parameter value') - * @param mixed parameter value if $nameOrConfig is not an array - * @return HTTP_Request2 - * @throws HTTP_Request2_Exception If the parameter is unknown - */ - public function setConfig($nameOrConfig, $value = null) - { - if (is_array($nameOrConfig)) { - foreach ($nameOrConfig as $name => $value) { - $this->setConfig($name, $value); - } - - } else { - if (!array_key_exists($nameOrConfig, $this->config)) { - throw new HTTP_Request2_Exception( - "Unknown configuration parameter '{$nameOrConfig}'" - ); - } - $this->config[$nameOrConfig] = $value; - } - - return $this; - } - - /** - * Returns the value(s) of the configuration parameter(s) - * - * @param string parameter name - * @return mixed value of $name parameter, array of all configuration - * parameters if $name is not given - * @throws HTTP_Request2_Exception If the parameter is unknown - */ - public function getConfig($name = null) - { - if (null === $name) { - return $this->config; - } elseif (!array_key_exists($name, $this->config)) { - throw new HTTP_Request2_Exception( - "Unknown configuration parameter '{$name}'" - ); - } - return $this->config[$name]; - } - - /** - * Sets the autentification data - * - * @param string user name - * @param string password - * @param string authentication scheme - * @return HTTP_Request2 - */ - public function setAuth($user, $password = '', $scheme = self::AUTH_BASIC) - { - if (empty($user)) { - $this->auth = null; - } else { - $this->auth = array( - 'user' => (string)$user, - 'password' => (string)$password, - 'scheme' => $scheme - ); - } - - return $this; - } - - /** - * Returns the authentication data - * - * The array has the keys 'user', 'password' and 'scheme', where 'scheme' - * is one of the HTTP_Request2::AUTH_* constants. - * - * @return array - */ - public function getAuth() - { - return $this->auth; - } - - /** - * Sets request header(s) - * - * The first parameter may be either a full header string 'header: value' or - * header name. In the former case $value parameter is ignored, in the latter - * the header's value will either be set to $value or the header will be - * removed if $value is null. The first parameter can also be an array of - * headers, in that case method will be called recursively. - * - * Note that headers are treated case insensitively as per RFC 2616. - * - * - * $req->setHeader('Foo: Bar'); // sets the value of 'Foo' header to 'Bar' - * $req->setHeader('FoO', 'Baz'); // sets the value of 'Foo' header to 'Baz' - * $req->setHeader(array('foo' => 'Quux')); // sets the value of 'Foo' header to 'Quux' - * $req->setHeader('FOO'); // removes 'Foo' header from request - * - * - * @param string|array header name, header string ('Header: value') - * or an array of headers - * @param string|null header value, header will be removed if null - * @return HTTP_Request2 - * @throws HTTP_Request2_Exception - */ - public function setHeader($name, $value = null) - { - if (is_array($name)) { - foreach ($name as $k => $v) { - if (is_string($k)) { - $this->setHeader($k, $v); - } else { - $this->setHeader($v); - } - } - } else { - if (null === $value && strpos($name, ':')) { - list($name, $value) = array_map('trim', explode(':', $name, 2)); - } - // Header name should be a token: http://tools.ietf.org/html/rfc2616#section-4.2 - if (preg_match(self::REGEXP_INVALID_TOKEN, $name)) { - throw new HTTP_Request2_Exception("Invalid header name '{$name}'"); - } - // Header names are case insensitive anyway - $name = strtolower($name); - if (null === $value) { - unset($this->headers[$name]); - } else { - $this->headers[$name] = $value; - } - } - - return $this; - } - - /** - * Returns the request headers - * - * The array is of the form ('header name' => 'header value'), header names - * are lowercased - * - * @return array - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Appends a cookie to "Cookie:" header - * - * @param string cookie name - * @param string cookie value - * @return HTTP_Request2 - * @throws HTTP_Request2_Exception - */ - public function addCookie($name, $value) - { - $cookie = $name . '=' . $value; - if (preg_match(self::REGEXP_INVALID_COOKIE, $cookie)) { - throw new HTTP_Request2_Exception("Invalid cookie: '{$cookie}'"); - } - $cookies = empty($this->headers['cookie'])? '': $this->headers['cookie'] . '; '; - $this->setHeader('cookie', $cookies . $cookie); - - return $this; - } - - /** - * Sets the request body - * - * @param string Either a string with the body or filename containing body - * @param bool Whether first parameter is a filename - * @return HTTP_Request2 - * @throws HTTP_Request2_Exception - */ - public function setBody($body, $isFilename = false) - { - if (!$isFilename) { - if (!$body instanceof HTTP_Request2_MultipartBody) { - $this->body = (string)$body; - } else { - $this->body = $body; - } - } else { - if (!($fp = @fopen($body, 'rb'))) { - throw new HTTP_Request2_Exception("Cannot open file {$body}"); - } - $this->body = $fp; - if (empty($this->headers['content-type'])) { - $this->setHeader('content-type', self::detectMimeType($body)); - } - } - $this->postParams = $this->uploads = array(); - - return $this; - } - - /** - * Returns the request body - * - * @return string|resource|HTTP_Request2_MultipartBody - */ - public function getBody() - { - if (self::METHOD_POST == $this->method && - (!empty($this->postParams) || !empty($this->uploads)) - ) { - if ('application/x-www-form-urlencoded' == $this->headers['content-type']) { - $body = http_build_query($this->postParams, '', '&'); - if (!$this->getConfig('use_brackets')) { - $body = preg_replace('/%5B\d+%5D=/', '=', $body); - } - // support RFC 3986 by not encoding '~' symbol (request #15368) - return str_replace('%7E', '~', $body); - - } elseif ('multipart/form-data' == $this->headers['content-type']) { - require_once 'HTTP/Request2/MultipartBody.php'; - return new HTTP_Request2_MultipartBody( - $this->postParams, $this->uploads, $this->getConfig('use_brackets') - ); - } - } - return $this->body; - } - - /** - * Adds a file to form-based file upload - * - * Used to emulate file upload via a HTML form. The method also sets - * Content-Type of HTTP request to 'multipart/form-data'. - * - * If you just want to send the contents of a file as the body of HTTP - * request you should use setBody() method. - * - * @param string name of file-upload field - * @param mixed full name of local file - * @param string filename to send in the request - * @param string content-type of file being uploaded - * @return HTTP_Request2 - * @throws HTTP_Request2_Exception - */ - public function addUpload($fieldName, $filename, $sendFilename = null, - $contentType = null) - { - if (!is_array($filename)) { - if (!($fp = @fopen($filename, 'rb'))) { - throw new HTTP_Request2_Exception("Cannot open file {$filename}"); - } - $this->uploads[$fieldName] = array( - 'fp' => $fp, - 'filename' => empty($sendFilename)? basename($filename): $sendFilename, - 'size' => filesize($filename), - 'type' => empty($contentType)? self::detectMimeType($filename): $contentType - ); - } else { - $fps = $names = $sizes = $types = array(); - foreach ($filename as $f) { - if (!is_array($f)) { - $f = array($f); - } - if (!($fp = @fopen($f[0], 'rb'))) { - throw new HTTP_Request2_Exception("Cannot open file {$f[0]}"); - } - $fps[] = $fp; - $names[] = empty($f[1])? basename($f[0]): $f[1]; - $sizes[] = filesize($f[0]); - $types[] = empty($f[2])? self::detectMimeType($f[0]): $f[2]; - } - $this->uploads[$fieldName] = array( - 'fp' => $fps, 'filename' => $names, 'size' => $sizes, 'type' => $types - ); - } - if (empty($this->headers['content-type']) || - 'application/x-www-form-urlencoded' == $this->headers['content-type'] - ) { - $this->setHeader('content-type', 'multipart/form-data'); - } - - return $this; - } - - /** - * Adds POST parameter(s) to the request. - * - * @param string|array parameter name or array ('name' => 'value') - * @param mixed parameter value (can be an array) - * @return HTTP_Request2 - */ - public function addPostParameter($name, $value = null) - { - if (!is_array($name)) { - $this->postParams[$name] = $value; - } else { - foreach ($name as $k => $v) { - $this->addPostParameter($k, $v); - } - } - if (empty($this->headers['content-type'])) { - $this->setHeader('content-type', 'application/x-www-form-urlencoded'); - } - - return $this; - } - - /** - * Attaches a new observer - * - * @param SplObserver - */ - public function attach(SplObserver $observer) - { - foreach ($this->observers as $attached) { - if ($attached === $observer) { - return; - } - } - $this->observers[] = $observer; - } - - /** - * Detaches an existing observer - * - * @param SplObserver - */ - public function detach(SplObserver $observer) - { - foreach ($this->observers as $key => $attached) { - if ($attached === $observer) { - unset($this->observers[$key]); - return; - } - } - } - - /** - * Notifies all observers - */ - public function notify() - { - foreach ($this->observers as $observer) { - $observer->update($this); - } - } - - /** - * Sets the last event - * - * Adapters should use this method to set the current state of the request - * and notify the observers. - * - * @param string event name - * @param mixed event data - */ - public function setLastEvent($name, $data = null) - { - $this->lastEvent = array( - 'name' => $name, - 'data' => $data - ); - $this->notify(); - } - - /** - * Returns the last event - * - * Observers should use this method to access the last change in request. - * The following event names are possible: - *
    - *
  • 'connect' - after connection to remote server, - * data is the destination (string)
  • - *
  • 'disconnect' - after disconnection from server
  • - *
  • 'sentHeaders' - after sending the request headers, - * data is the headers sent (string)
  • - *
  • 'sentBodyPart' - after sending a part of the request body, - * data is the length of that part (int)
  • - *
  • 'receivedHeaders' - after receiving the response headers, - * data is HTTP_Request2_Response object
  • - *
  • 'receivedBodyPart' - after receiving a part of the response - * body, data is that part (string)
  • - *
  • 'receivedEncodedBodyPart' - as 'receivedBodyPart', but data is still - * encoded by Content-Encoding
  • - *
  • 'receivedBody' - after receiving the complete response - * body, data is HTTP_Request2_Response object
  • - *
- * Different adapters may not send all the event types. Mock adapter does - * not send any events to the observers. - * - * @return array The array has two keys: 'name' and 'data' - */ - public function getLastEvent() - { - return $this->lastEvent; - } - - /** - * Sets the adapter used to actually perform the request - * - * You can pass either an instance of a class implementing HTTP_Request2_Adapter - * or a class name. The method will only try to include a file if the class - * name starts with HTTP_Request2_Adapter_, it will also try to prepend this - * prefix to the class name if it doesn't contain any underscores, so that - * - * $request->setAdapter('curl'); - * - * will work. - * - * @param string|HTTP_Request2_Adapter - * @return HTTP_Request2 - * @throws HTTP_Request2_Exception - */ - public function setAdapter($adapter) - { - if (is_string($adapter)) { - if (!class_exists($adapter, false)) { - if (false === strpos($adapter, '_')) { - $adapter = 'HTTP_Request2_Adapter_' . ucfirst($adapter); - } - if (preg_match('/^HTTP_Request2_Adapter_([a-zA-Z0-9]+)$/', $adapter)) { - include_once str_replace('_', DIRECTORY_SEPARATOR, $adapter) . '.php'; - } - if (!class_exists($adapter, false)) { - throw new HTTP_Request2_Exception("Class {$adapter} not found"); - } - } - $adapter = new $adapter; - } - if (!$adapter instanceof HTTP_Request2_Adapter) { - throw new HTTP_Request2_Exception('Parameter is not a HTTP request adapter'); - } - $this->adapter = $adapter; - - return $this; - } - - /** - * Sends the request and returns the response - * - * @throws HTTP_Request2_Exception - * @return HTTP_Request2_Response - */ - public function send() - { - // Sanity check for URL - if (!$this->url instanceof Net_URL2) { - throw new HTTP_Request2_Exception('No URL given'); - } elseif (!$this->url->isAbsolute()) { - throw new HTTP_Request2_Exception('Absolute URL required'); - } elseif (!in_array(strtolower($this->url->getScheme()), array('https', 'http'))) { - throw new HTTP_Request2_Exception('Not a HTTP URL'); - } - if (empty($this->adapter)) { - $this->setAdapter($this->getConfig('adapter')); - } - // magic_quotes_runtime may break file uploads and chunked response - // processing; see bug #4543. Don't use ini_get() here; see bug #16440. - if ($magicQuotes = get_magic_quotes_runtime()) { - set_magic_quotes_runtime(false); - } - // force using single byte encoding if mbstring extension overloads - // strlen() and substr(); see bug #1781, bug #10605 - if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) { - $oldEncoding = mb_internal_encoding(); - mb_internal_encoding('iso-8859-1'); - } - - try { - $response = $this->adapter->sendRequest($this); - } catch (Exception $e) { - } - // cleanup in either case (poor man's "finally" clause) - if ($magicQuotes) { - set_magic_quotes_runtime(true); - } - if (!empty($oldEncoding)) { - mb_internal_encoding($oldEncoding); - } - // rethrow the exception - if (!empty($e)) { - throw $e; - } - return $response; - } - - /** - * Tries to detect MIME type of a file - * - * The method will try to use fileinfo extension if it is available, - * deprecated mime_content_type() function in the other case. If neither - * works, default 'application/octet-stream' MIME type is returned - * - * @param string filename - * @return string file MIME type - */ - protected static function detectMimeType($filename) - { - // finfo extension from PECL available - if (function_exists('finfo_open')) { - if (!isset(self::$_fileinfoDb)) { - self::$_fileinfoDb = @finfo_open(FILEINFO_MIME); - } - if (self::$_fileinfoDb) { - $info = finfo_file(self::$_fileinfoDb, $filename); - } - } - // (deprecated) mime_content_type function available - if (empty($info) && function_exists('mime_content_type')) { - return mime_content_type($filename); - } - return empty($info)? 'application/octet-stream': $info; - } -} + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: Request2.php 298246 2010-04-21 10:41:16Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * A class representing an URL as per RFC 3986. + */ +require_once 'Net/URL2.php'; + +/** + * Exception class for HTTP_Request2 package + */ +require_once 'HTTP/Request2/Exception.php'; + +/** + * Class representing a HTTP request message + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @version Release: 0.5.2 + * @link http://tools.ietf.org/html/rfc2616#section-5 + */ +class HTTP_Request2 implements SplSubject +{ + /**#@+ + * Constants for HTTP request methods + * + * @link http://tools.ietf.org/html/rfc2616#section-5.1.1 + */ + const METHOD_OPTIONS = 'OPTIONS'; + const METHOD_GET = 'GET'; + const METHOD_HEAD = 'HEAD'; + const METHOD_POST = 'POST'; + const METHOD_PUT = 'PUT'; + const METHOD_DELETE = 'DELETE'; + const METHOD_TRACE = 'TRACE'; + const METHOD_CONNECT = 'CONNECT'; + /**#@-*/ + + /**#@+ + * Constants for HTTP authentication schemes + * + * @link http://tools.ietf.org/html/rfc2617 + */ + const AUTH_BASIC = 'basic'; + const AUTH_DIGEST = 'digest'; + /**#@-*/ + + /** + * Regular expression used to check for invalid symbols in RFC 2616 tokens + * @link http://pear.php.net/bugs/bug.php?id=15630 + */ + const REGEXP_INVALID_TOKEN = '![\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]!'; + + /** + * Regular expression used to check for invalid symbols in cookie strings + * @link http://pear.php.net/bugs/bug.php?id=15630 + * @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html + */ + const REGEXP_INVALID_COOKIE = '/[\s,;]/'; + + /** + * Fileinfo magic database resource + * @var resource + * @see detectMimeType() + */ + private static $_fileinfoDb; + + /** + * Observers attached to the request (instances of SplObserver) + * @var array + */ + protected $observers = array(); + + /** + * Request URL + * @var Net_URL2 + */ + protected $url; + + /** + * Request method + * @var string + */ + protected $method = self::METHOD_GET; + + /** + * Authentication data + * @var array + * @see getAuth() + */ + protected $auth; + + /** + * Request headers + * @var array + */ + protected $headers = array(); + + /** + * Configuration parameters + * @var array + * @see setConfig() + */ + protected $config = array( + 'adapter' => 'HTTP_Request2_Adapter_Socket', + 'connect_timeout' => 10, + 'timeout' => 0, + 'use_brackets' => true, + 'protocol_version' => '1.1', + 'buffer_size' => 16384, + 'store_body' => true, + + 'proxy_host' => '', + 'proxy_port' => '', + 'proxy_user' => '', + 'proxy_password' => '', + 'proxy_auth_scheme' => self::AUTH_BASIC, + + 'ssl_verify_peer' => true, + 'ssl_verify_host' => true, + 'ssl_cafile' => null, + 'ssl_capath' => null, + 'ssl_local_cert' => null, + 'ssl_passphrase' => null, + + 'digest_compat_ie' => false, + + 'follow_redirects' => false, + 'max_redirects' => 5, + 'strict_redirects' => false + ); + + /** + * Last event in request / response handling, intended for observers + * @var array + * @see getLastEvent() + */ + protected $lastEvent = array( + 'name' => 'start', + 'data' => null + ); + + /** + * Request body + * @var string|resource + * @see setBody() + */ + protected $body = ''; + + /** + * Array of POST parameters + * @var array + */ + protected $postParams = array(); + + /** + * Array of file uploads (for multipart/form-data POST requests) + * @var array + */ + protected $uploads = array(); + + /** + * Adapter used to perform actual HTTP request + * @var HTTP_Request2_Adapter + */ + protected $adapter; + + + /** + * Constructor. Can set request URL, method and configuration array. + * + * Also sets a default value for User-Agent header. + * + * @param string|Net_Url2 Request URL + * @param string Request method + * @param array Configuration for this Request instance + */ + public function __construct($url = null, $method = self::METHOD_GET, array $config = array()) + { + $this->setConfig($config); + if (!empty($url)) { + $this->setUrl($url); + } + if (!empty($method)) { + $this->setMethod($method); + } + $this->setHeader('user-agent', 'HTTP_Request2/0.5.2 ' . + '(http://pear.php.net/package/http_request2) ' . + 'PHP/' . phpversion()); + } + + /** + * Sets the URL for this request + * + * If the URL has userinfo part (username & password) these will be removed + * and converted to auth data. If the URL does not have a path component, + * that will be set to '/'. + * + * @param string|Net_URL2 Request URL + * @return HTTP_Request2 + * @throws HTTP_Request2_Exception + */ + public function setUrl($url) + { + if (is_string($url)) { + $url = new Net_URL2( + $url, array(Net_URL2::OPTION_USE_BRACKETS => $this->config['use_brackets']) + ); + } + if (!$url instanceof Net_URL2) { + throw new HTTP_Request2_Exception('Parameter is not a valid HTTP URL'); + } + // URL contains username / password? + if ($url->getUserinfo()) { + $username = $url->getUser(); + $password = $url->getPassword(); + $this->setAuth(rawurldecode($username), $password? rawurldecode($password): ''); + $url->setUserinfo(''); + } + if ('' == $url->getPath()) { + $url->setPath('/'); + } + $this->url = $url; + + return $this; + } + + /** + * Returns the request URL + * + * @return Net_URL2 + */ + public function getUrl() + { + return $this->url; + } + + /** + * Sets the request method + * + * @param string + * @return HTTP_Request2 + * @throws HTTP_Request2_Exception if the method name is invalid + */ + public function setMethod($method) + { + // Method name should be a token: http://tools.ietf.org/html/rfc2616#section-5.1.1 + if (preg_match(self::REGEXP_INVALID_TOKEN, $method)) { + throw new HTTP_Request2_Exception("Invalid request method '{$method}'"); + } + $this->method = $method; + + return $this; + } + + /** + * Returns the request method + * + * @return string + */ + public function getMethod() + { + return $this->method; + } + + /** + * Sets the configuration parameter(s) + * + * The following parameters are available: + *
    + *
  • 'adapter' - adapter to use (string)
  • + *
  • 'connect_timeout' - Connection timeout in seconds (integer)
  • + *
  • 'timeout' - Total number of seconds a request can take. + * Use 0 for no limit, should be greater than + * 'connect_timeout' if set (integer)
  • + *
  • 'use_brackets' - Whether to append [] to array variable names (bool)
  • + *
  • 'protocol_version' - HTTP Version to use, '1.0' or '1.1' (string)
  • + *
  • 'buffer_size' - Buffer size to use for reading and writing (int)
  • + *
  • 'store_body' - Whether to store response body in response object. + * Set to false if receiving a huge response and + * using an Observer to save it (boolean)
  • + *
  • 'proxy_host' - Proxy server host (string)
  • + *
  • 'proxy_port' - Proxy server port (integer)
  • + *
  • 'proxy_user' - Proxy auth username (string)
  • + *
  • 'proxy_password' - Proxy auth password (string)
  • + *
  • 'proxy_auth_scheme' - Proxy auth scheme, one of HTTP_Request2::AUTH_* constants (string)
  • + *
  • 'ssl_verify_peer' - Whether to verify peer's SSL certificate (bool)
  • + *
  • 'ssl_verify_host' - Whether to check that Common Name in SSL + * certificate matches host name (bool)
  • + *
  • 'ssl_cafile' - Cerificate Authority file to verify the peer + * with (use with 'ssl_verify_peer') (string)
  • + *
  • 'ssl_capath' - Directory holding multiple Certificate + * Authority files (string)
  • + *
  • 'ssl_local_cert' - Name of a file containing local cerificate (string)
  • + *
  • 'ssl_passphrase' - Passphrase with which local certificate + * was encoded (string)
  • + *
  • 'digest_compat_ie' - Whether to imitate behaviour of MSIE 5 and 6 + * in using URL without query string in digest + * authentication (boolean)
  • + *
  • 'follow_redirects' - Whether to automatically follow HTTP Redirects (boolean)
  • + *
  • 'max_redirects' - Maximum number of redirects to follow (integer)
  • + *
  • 'strict_redirects' - Whether to keep request method on redirects via status 301 and + * 302 (true, needed for compatibility with RFC 2616) + * or switch to GET (false, needed for compatibility with most + * browsers) (boolean)
  • + *
+ * + * @param string|array configuration parameter name or array + * ('parameter name' => 'parameter value') + * @param mixed parameter value if $nameOrConfig is not an array + * @return HTTP_Request2 + * @throws HTTP_Request2_Exception If the parameter is unknown + */ + public function setConfig($nameOrConfig, $value = null) + { + if (is_array($nameOrConfig)) { + foreach ($nameOrConfig as $name => $value) { + $this->setConfig($name, $value); + } + + } else { + if (!array_key_exists($nameOrConfig, $this->config)) { + throw new HTTP_Request2_Exception( + "Unknown configuration parameter '{$nameOrConfig}'" + ); + } + $this->config[$nameOrConfig] = $value; + } + + return $this; + } + + /** + * Returns the value(s) of the configuration parameter(s) + * + * @param string parameter name + * @return mixed value of $name parameter, array of all configuration + * parameters if $name is not given + * @throws HTTP_Request2_Exception If the parameter is unknown + */ + public function getConfig($name = null) + { + if (null === $name) { + return $this->config; + } elseif (!array_key_exists($name, $this->config)) { + throw new HTTP_Request2_Exception( + "Unknown configuration parameter '{$name}'" + ); + } + return $this->config[$name]; + } + + /** + * Sets the autentification data + * + * @param string user name + * @param string password + * @param string authentication scheme + * @return HTTP_Request2 + */ + public function setAuth($user, $password = '', $scheme = self::AUTH_BASIC) + { + if (empty($user)) { + $this->auth = null; + } else { + $this->auth = array( + 'user' => (string)$user, + 'password' => (string)$password, + 'scheme' => $scheme + ); + } + + return $this; + } + + /** + * Returns the authentication data + * + * The array has the keys 'user', 'password' and 'scheme', where 'scheme' + * is one of the HTTP_Request2::AUTH_* constants. + * + * @return array + */ + public function getAuth() + { + return $this->auth; + } + + /** + * Sets request header(s) + * + * The first parameter may be either a full header string 'header: value' or + * header name. In the former case $value parameter is ignored, in the latter + * the header's value will either be set to $value or the header will be + * removed if $value is null. The first parameter can also be an array of + * headers, in that case method will be called recursively. + * + * Note that headers are treated case insensitively as per RFC 2616. + * + * + * $req->setHeader('Foo: Bar'); // sets the value of 'Foo' header to 'Bar' + * $req->setHeader('FoO', 'Baz'); // sets the value of 'Foo' header to 'Baz' + * $req->setHeader(array('foo' => 'Quux')); // sets the value of 'Foo' header to 'Quux' + * $req->setHeader('FOO'); // removes 'Foo' header from request + * + * + * @param string|array header name, header string ('Header: value') + * or an array of headers + * @param string|null header value, header will be removed if null + * @return HTTP_Request2 + * @throws HTTP_Request2_Exception + */ + public function setHeader($name, $value = null) + { + if (is_array($name)) { + foreach ($name as $k => $v) { + if (is_string($k)) { + $this->setHeader($k, $v); + } else { + $this->setHeader($v); + } + } + } else { + if (null === $value && strpos($name, ':')) { + list($name, $value) = array_map('trim', explode(':', $name, 2)); + } + // Header name should be a token: http://tools.ietf.org/html/rfc2616#section-4.2 + if (preg_match(self::REGEXP_INVALID_TOKEN, $name)) { + throw new HTTP_Request2_Exception("Invalid header name '{$name}'"); + } + // Header names are case insensitive anyway + $name = strtolower($name); + if (null === $value) { + unset($this->headers[$name]); + } else { + $this->headers[$name] = $value; + } + } + + return $this; + } + + /** + * Returns the request headers + * + * The array is of the form ('header name' => 'header value'), header names + * are lowercased + * + * @return array + */ + public function getHeaders() + { + return $this->headers; + } + + /** + * Appends a cookie to "Cookie:" header + * + * @param string cookie name + * @param string cookie value + * @return HTTP_Request2 + * @throws HTTP_Request2_Exception + */ + public function addCookie($name, $value) + { + $cookie = $name . '=' . $value; + if (preg_match(self::REGEXP_INVALID_COOKIE, $cookie)) { + throw new HTTP_Request2_Exception("Invalid cookie: '{$cookie}'"); + } + $cookies = empty($this->headers['cookie'])? '': $this->headers['cookie'] . '; '; + $this->setHeader('cookie', $cookies . $cookie); + + return $this; + } + + /** + * Sets the request body + * + * @param string Either a string with the body or filename containing body + * @param bool Whether first parameter is a filename + * @return HTTP_Request2 + * @throws HTTP_Request2_Exception + */ + public function setBody($body, $isFilename = false) + { + if (!$isFilename) { + if (!$body instanceof HTTP_Request2_MultipartBody) { + $this->body = (string)$body; + } else { + $this->body = $body; + } + } else { + if (!($fp = @fopen($body, 'rb'))) { + throw new HTTP_Request2_Exception("Cannot open file {$body}"); + } + $this->body = $fp; + if (empty($this->headers['content-type'])) { + $this->setHeader('content-type', self::detectMimeType($body)); + } + } + $this->postParams = $this->uploads = array(); + + return $this; + } + + /** + * Returns the request body + * + * @return string|resource|HTTP_Request2_MultipartBody + */ + public function getBody() + { + if (self::METHOD_POST == $this->method && + (!empty($this->postParams) || !empty($this->uploads)) + ) { + if ('application/x-www-form-urlencoded' == $this->headers['content-type']) { + $body = http_build_query($this->postParams, '', '&'); + if (!$this->getConfig('use_brackets')) { + $body = preg_replace('/%5B\d+%5D=/', '=', $body); + } + // support RFC 3986 by not encoding '~' symbol (request #15368) + return str_replace('%7E', '~', $body); + + } elseif ('multipart/form-data' == $this->headers['content-type']) { + require_once 'HTTP/Request2/MultipartBody.php'; + return new HTTP_Request2_MultipartBody( + $this->postParams, $this->uploads, $this->getConfig('use_brackets') + ); + } + } + return $this->body; + } + + /** + * Adds a file to form-based file upload + * + * Used to emulate file upload via a HTML form. The method also sets + * Content-Type of HTTP request to 'multipart/form-data'. + * + * If you just want to send the contents of a file as the body of HTTP + * request you should use setBody() method. + * + * @param string name of file-upload field + * @param mixed full name of local file + * @param string filename to send in the request + * @param string content-type of file being uploaded + * @return HTTP_Request2 + * @throws HTTP_Request2_Exception + */ + public function addUpload($fieldName, $filename, $sendFilename = null, + $contentType = null) + { + if (!is_array($filename)) { + if (!($fp = @fopen($filename, 'rb'))) { + throw new HTTP_Request2_Exception("Cannot open file {$filename}"); + } + $this->uploads[$fieldName] = array( + 'fp' => $fp, + 'filename' => empty($sendFilename)? basename($filename): $sendFilename, + 'size' => filesize($filename), + 'type' => empty($contentType)? self::detectMimeType($filename): $contentType + ); + } else { + $fps = $names = $sizes = $types = array(); + foreach ($filename as $f) { + if (!is_array($f)) { + $f = array($f); + } + if (!($fp = @fopen($f[0], 'rb'))) { + throw new HTTP_Request2_Exception("Cannot open file {$f[0]}"); + } + $fps[] = $fp; + $names[] = empty($f[1])? basename($f[0]): $f[1]; + $sizes[] = filesize($f[0]); + $types[] = empty($f[2])? self::detectMimeType($f[0]): $f[2]; + } + $this->uploads[$fieldName] = array( + 'fp' => $fps, 'filename' => $names, 'size' => $sizes, 'type' => $types + ); + } + if (empty($this->headers['content-type']) || + 'application/x-www-form-urlencoded' == $this->headers['content-type'] + ) { + $this->setHeader('content-type', 'multipart/form-data'); + } + + return $this; + } + + /** + * Adds POST parameter(s) to the request. + * + * @param string|array parameter name or array ('name' => 'value') + * @param mixed parameter value (can be an array) + * @return HTTP_Request2 + */ + public function addPostParameter($name, $value = null) + { + if (!is_array($name)) { + $this->postParams[$name] = $value; + } else { + foreach ($name as $k => $v) { + $this->addPostParameter($k, $v); + } + } + if (empty($this->headers['content-type'])) { + $this->setHeader('content-type', 'application/x-www-form-urlencoded'); + } + + return $this; + } + + /** + * Attaches a new observer + * + * @param SplObserver + */ + public function attach(SplObserver $observer) + { + foreach ($this->observers as $attached) { + if ($attached === $observer) { + return; + } + } + $this->observers[] = $observer; + } + + /** + * Detaches an existing observer + * + * @param SplObserver + */ + public function detach(SplObserver $observer) + { + foreach ($this->observers as $key => $attached) { + if ($attached === $observer) { + unset($this->observers[$key]); + return; + } + } + } + + /** + * Notifies all observers + */ + public function notify() + { + foreach ($this->observers as $observer) { + $observer->update($this); + } + } + + /** + * Sets the last event + * + * Adapters should use this method to set the current state of the request + * and notify the observers. + * + * @param string event name + * @param mixed event data + */ + public function setLastEvent($name, $data = null) + { + $this->lastEvent = array( + 'name' => $name, + 'data' => $data + ); + $this->notify(); + } + + /** + * Returns the last event + * + * Observers should use this method to access the last change in request. + * The following event names are possible: + *
    + *
  • 'connect' - after connection to remote server, + * data is the destination (string)
  • + *
  • 'disconnect' - after disconnection from server
  • + *
  • 'sentHeaders' - after sending the request headers, + * data is the headers sent (string)
  • + *
  • 'sentBodyPart' - after sending a part of the request body, + * data is the length of that part (int)
  • + *
  • 'receivedHeaders' - after receiving the response headers, + * data is HTTP_Request2_Response object
  • + *
  • 'receivedBodyPart' - after receiving a part of the response + * body, data is that part (string)
  • + *
  • 'receivedEncodedBodyPart' - as 'receivedBodyPart', but data is still + * encoded by Content-Encoding
  • + *
  • 'receivedBody' - after receiving the complete response + * body, data is HTTP_Request2_Response object
  • + *
+ * Different adapters may not send all the event types. Mock adapter does + * not send any events to the observers. + * + * @return array The array has two keys: 'name' and 'data' + */ + public function getLastEvent() + { + return $this->lastEvent; + } + + /** + * Sets the adapter used to actually perform the request + * + * You can pass either an instance of a class implementing HTTP_Request2_Adapter + * or a class name. The method will only try to include a file if the class + * name starts with HTTP_Request2_Adapter_, it will also try to prepend this + * prefix to the class name if it doesn't contain any underscores, so that + * + * $request->setAdapter('curl'); + * + * will work. + * + * @param string|HTTP_Request2_Adapter + * @return HTTP_Request2 + * @throws HTTP_Request2_Exception + */ + public function setAdapter($adapter) + { + if (is_string($adapter)) { + if (!class_exists($adapter, false)) { + if (false === strpos($adapter, '_')) { + $adapter = 'HTTP_Request2_Adapter_' . ucfirst($adapter); + } + if (preg_match('/^HTTP_Request2_Adapter_([a-zA-Z0-9]+)$/', $adapter)) { + include_once str_replace('_', DIRECTORY_SEPARATOR, $adapter) . '.php'; + } + if (!class_exists($adapter, false)) { + throw new HTTP_Request2_Exception("Class {$adapter} not found"); + } + } + $adapter = new $adapter; + } + if (!$adapter instanceof HTTP_Request2_Adapter) { + throw new HTTP_Request2_Exception('Parameter is not a HTTP request adapter'); + } + $this->adapter = $adapter; + + return $this; + } + + /** + * Sends the request and returns the response + * + * @throws HTTP_Request2_Exception + * @return HTTP_Request2_Response + */ + public function send() + { + // Sanity check for URL + if (!$this->url instanceof Net_URL2) { + throw new HTTP_Request2_Exception('No URL given'); + } elseif (!$this->url->isAbsolute()) { + throw new HTTP_Request2_Exception('Absolute URL required'); + } elseif (!in_array(strtolower($this->url->getScheme()), array('https', 'http'))) { + throw new HTTP_Request2_Exception('Not a HTTP URL'); + } + if (empty($this->adapter)) { + $this->setAdapter($this->getConfig('adapter')); + } + // magic_quotes_runtime may break file uploads and chunked response + // processing; see bug #4543. Don't use ini_get() here; see bug #16440. + if ($magicQuotes = get_magic_quotes_runtime()) { + set_magic_quotes_runtime(false); + } + // force using single byte encoding if mbstring extension overloads + // strlen() and substr(); see bug #1781, bug #10605 + if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) { + $oldEncoding = mb_internal_encoding(); + mb_internal_encoding('iso-8859-1'); + } + + try { + $response = $this->adapter->sendRequest($this); + } catch (Exception $e) { + } + // cleanup in either case (poor man's "finally" clause) + if ($magicQuotes) { + set_magic_quotes_runtime(true); + } + if (!empty($oldEncoding)) { + mb_internal_encoding($oldEncoding); + } + // rethrow the exception + if (!empty($e)) { + throw $e; + } + return $response; + } + + /** + * Tries to detect MIME type of a file + * + * The method will try to use fileinfo extension if it is available, + * deprecated mime_content_type() function in the other case. If neither + * works, default 'application/octet-stream' MIME type is returned + * + * @param string filename + * @return string file MIME type + */ + protected static function detectMimeType($filename) + { + // finfo extension from PECL available + if (function_exists('finfo_open')) { + if (!isset(self::$_fileinfoDb)) { + self::$_fileinfoDb = @finfo_open(FILEINFO_MIME); + } + if (self::$_fileinfoDb) { + $info = finfo_file(self::$_fileinfoDb, $filename); + } + } + // (deprecated) mime_content_type function available + if (empty($info) && function_exists('mime_content_type')) { + return mime_content_type($filename); + } + return empty($info)? 'application/octet-stream': $info; + } +} ?> \ No newline at end of file diff --git a/libs/PEAR.1.9/HTTP/Request2/Adapter.php b/libs/PEAR.1.9/HTTP/Request2/Adapter.php index 8e3a7891f..8ebbf4607 100644 --- a/libs/PEAR.1.9/HTTP/Request2/Adapter.php +++ b/libs/PEAR.1.9/HTTP/Request2/Adapter.php @@ -1,154 +1,154 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Adapter.php 291118 2009-11-21 17:58:23Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Class representing a HTTP response - */ -require_once 'HTTP/Request2/Response.php'; - -/** - * Base class for HTTP_Request2 adapters - * - * HTTP_Request2 class itself only defines methods for aggregating the request - * data, all actual work of sending the request to the remote server and - * receiving its response is performed by adapters. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @version Release: 0.5.2 - */ -abstract class HTTP_Request2_Adapter -{ - /** - * A list of methods that MUST NOT have a request body, per RFC 2616 - * @var array - */ - protected static $bodyDisallowed = array('TRACE'); - - /** - * Methods having defined semantics for request body - * - * Content-Length header (indicating that the body follows, section 4.3 of - * RFC 2616) will be sent for these methods even if no body was added - * - * @var array - * @link http://pear.php.net/bugs/bug.php?id=12900 - * @link http://pear.php.net/bugs/bug.php?id=14740 - */ - protected static $bodyRequired = array('POST', 'PUT'); - - /** - * Request being sent - * @var HTTP_Request2 - */ - protected $request; - - /** - * Request body - * @var string|resource|HTTP_Request2_MultipartBody - * @see HTTP_Request2::getBody() - */ - protected $requestBody; - - /** - * Length of the request body - * @var integer - */ - protected $contentLength; - - /** - * Sends request to the remote server and returns its response - * - * @param HTTP_Request2 - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - abstract public function sendRequest(HTTP_Request2 $request); - - /** - * Calculates length of the request body, adds proper headers - * - * @param array associative array of request headers, this method will - * add proper 'Content-Length' and 'Content-Type' headers - * to this array (or remove them if not needed) - */ - protected function calculateRequestLength(&$headers) - { - $this->requestBody = $this->request->getBody(); - - if (is_string($this->requestBody)) { - $this->contentLength = strlen($this->requestBody); - } elseif (is_resource($this->requestBody)) { - $stat = fstat($this->requestBody); - $this->contentLength = $stat['size']; - rewind($this->requestBody); - } else { - $this->contentLength = $this->requestBody->getLength(); - $headers['content-type'] = 'multipart/form-data; boundary=' . - $this->requestBody->getBoundary(); - $this->requestBody->rewind(); - } - - if (in_array($this->request->getMethod(), self::$bodyDisallowed) || - 0 == $this->contentLength - ) { - // No body: send a Content-Length header nonetheless (request #12900), - // but do that only for methods that require a body (bug #14740) - if (in_array($this->request->getMethod(), self::$bodyRequired)) { - $headers['content-length'] = 0; - } else { - unset($headers['content-length']); - // if the method doesn't require a body and doesn't have a - // body, don't send a Content-Type header. (request #16799) - unset($headers['content-type']); - } - } else { - if (empty($headers['content-type'])) { - $headers['content-type'] = 'application/x-www-form-urlencoded'; - } - $headers['content-length'] = $this->contentLength; - } - } -} -?> + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: Adapter.php 291118 2009-11-21 17:58:23Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * Class representing a HTTP response + */ +require_once 'HTTP/Request2/Response.php'; + +/** + * Base class for HTTP_Request2 adapters + * + * HTTP_Request2 class itself only defines methods for aggregating the request + * data, all actual work of sending the request to the remote server and + * receiving its response is performed by adapters. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @version Release: 0.5.2 + */ +abstract class HTTP_Request2_Adapter +{ + /** + * A list of methods that MUST NOT have a request body, per RFC 2616 + * @var array + */ + protected static $bodyDisallowed = array('TRACE'); + + /** + * Methods having defined semantics for request body + * + * Content-Length header (indicating that the body follows, section 4.3 of + * RFC 2616) will be sent for these methods even if no body was added + * + * @var array + * @link http://pear.php.net/bugs/bug.php?id=12900 + * @link http://pear.php.net/bugs/bug.php?id=14740 + */ + protected static $bodyRequired = array('POST', 'PUT'); + + /** + * Request being sent + * @var HTTP_Request2 + */ + protected $request; + + /** + * Request body + * @var string|resource|HTTP_Request2_MultipartBody + * @see HTTP_Request2::getBody() + */ + protected $requestBody; + + /** + * Length of the request body + * @var integer + */ + protected $contentLength; + + /** + * Sends request to the remote server and returns its response + * + * @param HTTP_Request2 + * @return HTTP_Request2_Response + * @throws HTTP_Request2_Exception + */ + abstract public function sendRequest(HTTP_Request2 $request); + + /** + * Calculates length of the request body, adds proper headers + * + * @param array associative array of request headers, this method will + * add proper 'Content-Length' and 'Content-Type' headers + * to this array (or remove them if not needed) + */ + protected function calculateRequestLength(&$headers) + { + $this->requestBody = $this->request->getBody(); + + if (is_string($this->requestBody)) { + $this->contentLength = strlen($this->requestBody); + } elseif (is_resource($this->requestBody)) { + $stat = fstat($this->requestBody); + $this->contentLength = $stat['size']; + rewind($this->requestBody); + } else { + $this->contentLength = $this->requestBody->getLength(); + $headers['content-type'] = 'multipart/form-data; boundary=' . + $this->requestBody->getBoundary(); + $this->requestBody->rewind(); + } + + if (in_array($this->request->getMethod(), self::$bodyDisallowed) || + 0 == $this->contentLength + ) { + // No body: send a Content-Length header nonetheless (request #12900), + // but do that only for methods that require a body (bug #14740) + if (in_array($this->request->getMethod(), self::$bodyRequired)) { + $headers['content-length'] = 0; + } else { + unset($headers['content-length']); + // if the method doesn't require a body and doesn't have a + // body, don't send a Content-Type header. (request #16799) + unset($headers['content-type']); + } + } else { + if (empty($headers['content-type'])) { + $headers['content-type'] = 'application/x-www-form-urlencoded'; + } + $headers['content-length'] = $this->contentLength; + } + } +} +?> diff --git a/libs/PEAR.1.9/HTTP/Request2/Adapter/Curl.php b/libs/PEAR.1.9/HTTP/Request2/Adapter/Curl.php index 4c520d353..3d9833403 100644 --- a/libs/PEAR.1.9/HTTP/Request2/Adapter/Curl.php +++ b/libs/PEAR.1.9/HTTP/Request2/Adapter/Curl.php @@ -1,461 +1,461 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Curl.php 291118 2009-11-21 17:58:23Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Base class for HTTP_Request2 adapters - */ -require_once 'HTTP/Request2/Adapter.php'; - -/** - * Adapter for HTTP_Request2 wrapping around cURL extension - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @version Release: 0.5.2 - */ -class HTTP_Request2_Adapter_Curl extends HTTP_Request2_Adapter -{ - /** - * Mapping of header names to cURL options - * @var array - */ - protected static $headerMap = array( - 'accept-encoding' => CURLOPT_ENCODING, - 'cookie' => CURLOPT_COOKIE, - 'referer' => CURLOPT_REFERER, - 'user-agent' => CURLOPT_USERAGENT - ); - - /** - * Mapping of SSL context options to cURL options - * @var array - */ - protected static $sslContextMap = array( - 'ssl_verify_peer' => CURLOPT_SSL_VERIFYPEER, - 'ssl_cafile' => CURLOPT_CAINFO, - 'ssl_capath' => CURLOPT_CAPATH, - 'ssl_local_cert' => CURLOPT_SSLCERT, - 'ssl_passphrase' => CURLOPT_SSLCERTPASSWD - ); - - /** - * Response being received - * @var HTTP_Request2_Response - */ - protected $response; - - /** - * Whether 'sentHeaders' event was sent to observers - * @var boolean - */ - protected $eventSentHeaders = false; - - /** - * Whether 'receivedHeaders' event was sent to observers - * @var boolean - */ - protected $eventReceivedHeaders = false; - - /** - * Position within request body - * @var integer - * @see callbackReadBody() - */ - protected $position = 0; - - /** - * Information about last transfer, as returned by curl_getinfo() - * @var array - */ - protected $lastInfo; - - /** - * Sends request to the remote server and returns its response - * - * @param HTTP_Request2 - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - public function sendRequest(HTTP_Request2 $request) - { - if (!extension_loaded('curl')) { - throw new HTTP_Request2_Exception('cURL extension not available'); - } - - $this->request = $request; - $this->response = null; - $this->position = 0; - $this->eventSentHeaders = false; - $this->eventReceivedHeaders = false; - - try { - if (false === curl_exec($ch = $this->createCurlHandle())) { - $errorMessage = 'Error sending request: #' . curl_errno($ch) . - ' ' . curl_error($ch); - } - } catch (Exception $e) { - } - $this->lastInfo = curl_getinfo($ch); - curl_close($ch); - - $response = $this->response; - unset($this->request, $this->requestBody, $this->response); - - if (!empty($e)) { - throw $e; - } elseif (!empty($errorMessage)) { - throw new HTTP_Request2_Exception($errorMessage); - } - - if (0 < $this->lastInfo['size_download']) { - $request->setLastEvent('receivedBody', $response); - } - return $response; - } - - /** - * Returns information about last transfer - * - * @return array associative array as returned by curl_getinfo() - */ - public function getInfo() - { - return $this->lastInfo; - } - - /** - * Creates a new cURL handle and populates it with data from the request - * - * @return resource a cURL handle, as created by curl_init() - * @throws HTTP_Request2_Exception - */ - protected function createCurlHandle() - { - $ch = curl_init(); - - curl_setopt_array($ch, array( - // setup write callbacks - CURLOPT_HEADERFUNCTION => array($this, 'callbackWriteHeader'), - CURLOPT_WRITEFUNCTION => array($this, 'callbackWriteBody'), - // buffer size - CURLOPT_BUFFERSIZE => $this->request->getConfig('buffer_size'), - // connection timeout - CURLOPT_CONNECTTIMEOUT => $this->request->getConfig('connect_timeout'), - // save full outgoing headers, in case someone is interested - CURLINFO_HEADER_OUT => true, - // request url - CURLOPT_URL => $this->request->getUrl()->getUrl() - )); - - // set up redirects - if (!$this->request->getConfig('follow_redirects')) { - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); - } else { - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); - curl_setopt($ch, CURLOPT_MAXREDIRS, $this->request->getConfig('max_redirects')); - // limit redirects to http(s), works in 5.2.10+ - if (defined('CURLOPT_REDIR_PROTOCOLS')) { - curl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); - } - // works sometime after 5.3.0, http://bugs.php.net/bug.php?id=49571 - if ($this->request->getConfig('strict_redirects') && defined('CURLOPT_POSTREDIR ')) { - curl_setopt($ch, CURLOPT_POSTREDIR, 3); - } - } - - // request timeout - if ($timeout = $this->request->getConfig('timeout')) { - curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); - } - - // set HTTP version - switch ($this->request->getConfig('protocol_version')) { - case '1.0': - curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); - break; - case '1.1': - curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); - } - - // set request method - switch ($this->request->getMethod()) { - case HTTP_Request2::METHOD_GET: - curl_setopt($ch, CURLOPT_HTTPGET, true); - break; - case HTTP_Request2::METHOD_POST: - curl_setopt($ch, CURLOPT_POST, true); - break; - case HTTP_Request2::METHOD_HEAD: - curl_setopt($ch, CURLOPT_NOBODY, true); - break; - default: - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->request->getMethod()); - } - - // set proxy, if needed - if ($host = $this->request->getConfig('proxy_host')) { - if (!($port = $this->request->getConfig('proxy_port'))) { - throw new HTTP_Request2_Exception('Proxy port not provided'); - } - curl_setopt($ch, CURLOPT_PROXY, $host . ':' . $port); - if ($user = $this->request->getConfig('proxy_user')) { - curl_setopt($ch, CURLOPT_PROXYUSERPWD, $user . ':' . - $this->request->getConfig('proxy_password')); - switch ($this->request->getConfig('proxy_auth_scheme')) { - case HTTP_Request2::AUTH_BASIC: - curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); - break; - case HTTP_Request2::AUTH_DIGEST: - curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_DIGEST); - } - } - } - - // set authentication data - if ($auth = $this->request->getAuth()) { - curl_setopt($ch, CURLOPT_USERPWD, $auth['user'] . ':' . $auth['password']); - switch ($auth['scheme']) { - case HTTP_Request2::AUTH_BASIC: - curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); - break; - case HTTP_Request2::AUTH_DIGEST: - curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); - } - } - - // set SSL options - if (0 == strcasecmp($this->request->getUrl()->getScheme(), 'https')) { - foreach ($this->request->getConfig() as $name => $value) { - if ('ssl_verify_host' == $name && null !== $value) { - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $value? 2: 0); - } elseif (isset(self::$sslContextMap[$name]) && null !== $value) { - curl_setopt($ch, self::$sslContextMap[$name], $value); - } - } - } - - $headers = $this->request->getHeaders(); - // make cURL automagically send proper header - if (!isset($headers['accept-encoding'])) { - $headers['accept-encoding'] = ''; - } - - // set headers having special cURL keys - foreach (self::$headerMap as $name => $option) { - if (isset($headers[$name])) { - curl_setopt($ch, $option, $headers[$name]); - unset($headers[$name]); - } - } - - $this->calculateRequestLength($headers); - if (isset($headers['content-length'])) { - $this->workaroundPhpBug47204($ch, $headers); - } - - // set headers not having special keys - $headersFmt = array(); - foreach ($headers as $name => $value) { - $canonicalName = implode('-', array_map('ucfirst', explode('-', $name))); - $headersFmt[] = $canonicalName . ': ' . $value; - } - curl_setopt($ch, CURLOPT_HTTPHEADER, $headersFmt); - - return $ch; - } - - /** - * Workaround for PHP bug #47204 that prevents rewinding request body - * - * The workaround consists of reading the entire request body into memory - * and setting it as CURLOPT_POSTFIELDS, so it isn't recommended for large - * file uploads, use Socket adapter instead. - * - * @param resource cURL handle - * @param array Request headers - */ - protected function workaroundPhpBug47204($ch, &$headers) - { - // no redirects, no digest auth -> probably no rewind needed - if (!$this->request->getConfig('follow_redirects') - && (!($auth = $this->request->getAuth()) - || HTTP_Request2::AUTH_DIGEST != $auth['scheme']) - ) { - curl_setopt($ch, CURLOPT_READFUNCTION, array($this, 'callbackReadBody')); - - // rewind may be needed, read the whole body into memory - } else { - if ($this->requestBody instanceof HTTP_Request2_MultipartBody) { - $this->requestBody = $this->requestBody->__toString(); - - } elseif (is_resource($this->requestBody)) { - $fp = $this->requestBody; - $this->requestBody = ''; - while (!feof($fp)) { - $this->requestBody .= fread($fp, 16384); - } - } - // curl hangs up if content-length is present - unset($headers['content-length']); - curl_setopt($ch, CURLOPT_POSTFIELDS, $this->requestBody); - } - } - - /** - * Callback function called by cURL for reading the request body - * - * @param resource cURL handle - * @param resource file descriptor (not used) - * @param integer maximum length of data to return - * @return string part of the request body, up to $length bytes - */ - protected function callbackReadBody($ch, $fd, $length) - { - if (!$this->eventSentHeaders) { - $this->request->setLastEvent( - 'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT) - ); - $this->eventSentHeaders = true; - } - if (in_array($this->request->getMethod(), self::$bodyDisallowed) || - 0 == $this->contentLength || $this->position >= $this->contentLength - ) { - return ''; - } - if (is_string($this->requestBody)) { - $string = substr($this->requestBody, $this->position, $length); - } elseif (is_resource($this->requestBody)) { - $string = fread($this->requestBody, $length); - } else { - $string = $this->requestBody->read($length); - } - $this->request->setLastEvent('sentBodyPart', strlen($string)); - $this->position += strlen($string); - return $string; - } - - /** - * Callback function called by cURL for saving the response headers - * - * @param resource cURL handle - * @param string response header (with trailing CRLF) - * @return integer number of bytes saved - * @see HTTP_Request2_Response::parseHeaderLine() - */ - protected function callbackWriteHeader($ch, $string) - { - // we may receive a second set of headers if doing e.g. digest auth - if ($this->eventReceivedHeaders || !$this->eventSentHeaders) { - // don't bother with 100-Continue responses (bug #15785) - if (!$this->eventSentHeaders || - $this->response->getStatus() >= 200 - ) { - $this->request->setLastEvent( - 'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT) - ); - } - $upload = curl_getinfo($ch, CURLINFO_SIZE_UPLOAD); - // if body wasn't read by a callback, send event with total body size - if ($upload > $this->position) { - $this->request->setLastEvent( - 'sentBodyPart', $upload - $this->position - ); - $this->position = $upload; - } - $this->eventSentHeaders = true; - // we'll need a new response object - if ($this->eventReceivedHeaders) { - $this->eventReceivedHeaders = false; - $this->response = null; - } - } - if (empty($this->response)) { - $this->response = new HTTP_Request2_Response($string, false); - } else { - $this->response->parseHeaderLine($string); - if ('' == trim($string)) { - // don't bother with 100-Continue responses (bug #15785) - if (200 <= $this->response->getStatus()) { - $this->request->setLastEvent('receivedHeaders', $this->response); - } - // for versions lower than 5.2.10, check the redirection URL protocol - if ($this->request->getConfig('follow_redirects') && !defined('CURLOPT_REDIR_PROTOCOLS') - && $this->response->isRedirect() - ) { - $redirectUrl = new Net_URL2($this->response->getHeader('location')); - if ($redirectUrl->isAbsolute() - && !in_array($redirectUrl->getScheme(), array('http', 'https')) - ) { - return -1; - } - } - $this->eventReceivedHeaders = true; - } - } - return strlen($string); - } - - /** - * Callback function called by cURL for saving the response body - * - * @param resource cURL handle (not used) - * @param string part of the response body - * @return integer number of bytes saved - * @see HTTP_Request2_Response::appendBody() - */ - protected function callbackWriteBody($ch, $string) - { - // cURL calls WRITEFUNCTION callback without calling HEADERFUNCTION if - // response doesn't start with proper HTTP status line (see bug #15716) - if (empty($this->response)) { - throw new HTTP_Request2_Exception("Malformed response: {$string}"); - } - if ($this->request->getConfig('store_body')) { - $this->response->appendBody($string); - } - $this->request->setLastEvent('receivedBodyPart', $string); - return strlen($string); - } -} -?> + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: Curl.php 291118 2009-11-21 17:58:23Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * Base class for HTTP_Request2 adapters + */ +require_once 'HTTP/Request2/Adapter.php'; + +/** + * Adapter for HTTP_Request2 wrapping around cURL extension + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @version Release: 0.5.2 + */ +class HTTP_Request2_Adapter_Curl extends HTTP_Request2_Adapter +{ + /** + * Mapping of header names to cURL options + * @var array + */ + protected static $headerMap = array( + 'accept-encoding' => CURLOPT_ENCODING, + 'cookie' => CURLOPT_COOKIE, + 'referer' => CURLOPT_REFERER, + 'user-agent' => CURLOPT_USERAGENT + ); + + /** + * Mapping of SSL context options to cURL options + * @var array + */ + protected static $sslContextMap = array( + 'ssl_verify_peer' => CURLOPT_SSL_VERIFYPEER, + 'ssl_cafile' => CURLOPT_CAINFO, + 'ssl_capath' => CURLOPT_CAPATH, + 'ssl_local_cert' => CURLOPT_SSLCERT, + 'ssl_passphrase' => CURLOPT_SSLCERTPASSWD + ); + + /** + * Response being received + * @var HTTP_Request2_Response + */ + protected $response; + + /** + * Whether 'sentHeaders' event was sent to observers + * @var boolean + */ + protected $eventSentHeaders = false; + + /** + * Whether 'receivedHeaders' event was sent to observers + * @var boolean + */ + protected $eventReceivedHeaders = false; + + /** + * Position within request body + * @var integer + * @see callbackReadBody() + */ + protected $position = 0; + + /** + * Information about last transfer, as returned by curl_getinfo() + * @var array + */ + protected $lastInfo; + + /** + * Sends request to the remote server and returns its response + * + * @param HTTP_Request2 + * @return HTTP_Request2_Response + * @throws HTTP_Request2_Exception + */ + public function sendRequest(HTTP_Request2 $request) + { + if (!extension_loaded('curl')) { + throw new HTTP_Request2_Exception('cURL extension not available'); + } + + $this->request = $request; + $this->response = null; + $this->position = 0; + $this->eventSentHeaders = false; + $this->eventReceivedHeaders = false; + + try { + if (false === curl_exec($ch = $this->createCurlHandle())) { + $errorMessage = 'Error sending request: #' . curl_errno($ch) . + ' ' . curl_error($ch); + } + } catch (Exception $e) { + } + $this->lastInfo = curl_getinfo($ch); + curl_close($ch); + + $response = $this->response; + unset($this->request, $this->requestBody, $this->response); + + if (!empty($e)) { + throw $e; + } elseif (!empty($errorMessage)) { + throw new HTTP_Request2_Exception($errorMessage); + } + + if (0 < $this->lastInfo['size_download']) { + $request->setLastEvent('receivedBody', $response); + } + return $response; + } + + /** + * Returns information about last transfer + * + * @return array associative array as returned by curl_getinfo() + */ + public function getInfo() + { + return $this->lastInfo; + } + + /** + * Creates a new cURL handle and populates it with data from the request + * + * @return resource a cURL handle, as created by curl_init() + * @throws HTTP_Request2_Exception + */ + protected function createCurlHandle() + { + $ch = curl_init(); + + curl_setopt_array($ch, array( + // setup write callbacks + CURLOPT_HEADERFUNCTION => array($this, 'callbackWriteHeader'), + CURLOPT_WRITEFUNCTION => array($this, 'callbackWriteBody'), + // buffer size + CURLOPT_BUFFERSIZE => $this->request->getConfig('buffer_size'), + // connection timeout + CURLOPT_CONNECTTIMEOUT => $this->request->getConfig('connect_timeout'), + // save full outgoing headers, in case someone is interested + CURLINFO_HEADER_OUT => true, + // request url + CURLOPT_URL => $this->request->getUrl()->getUrl() + )); + + // set up redirects + if (!$this->request->getConfig('follow_redirects')) { + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); + } else { + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_MAXREDIRS, $this->request->getConfig('max_redirects')); + // limit redirects to http(s), works in 5.2.10+ + if (defined('CURLOPT_REDIR_PROTOCOLS')) { + curl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); + } + // works sometime after 5.3.0, http://bugs.php.net/bug.php?id=49571 + if ($this->request->getConfig('strict_redirects') && defined('CURLOPT_POSTREDIR ')) { + curl_setopt($ch, CURLOPT_POSTREDIR, 3); + } + } + + // request timeout + if ($timeout = $this->request->getConfig('timeout')) { + curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); + } + + // set HTTP version + switch ($this->request->getConfig('protocol_version')) { + case '1.0': + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); + break; + case '1.1': + curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); + } + + // set request method + switch ($this->request->getMethod()) { + case HTTP_Request2::METHOD_GET: + curl_setopt($ch, CURLOPT_HTTPGET, true); + break; + case HTTP_Request2::METHOD_POST: + curl_setopt($ch, CURLOPT_POST, true); + break; + case HTTP_Request2::METHOD_HEAD: + curl_setopt($ch, CURLOPT_NOBODY, true); + break; + default: + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->request->getMethod()); + } + + // set proxy, if needed + if ($host = $this->request->getConfig('proxy_host')) { + if (!($port = $this->request->getConfig('proxy_port'))) { + throw new HTTP_Request2_Exception('Proxy port not provided'); + } + curl_setopt($ch, CURLOPT_PROXY, $host . ':' . $port); + if ($user = $this->request->getConfig('proxy_user')) { + curl_setopt($ch, CURLOPT_PROXYUSERPWD, $user . ':' . + $this->request->getConfig('proxy_password')); + switch ($this->request->getConfig('proxy_auth_scheme')) { + case HTTP_Request2::AUTH_BASIC: + curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); + break; + case HTTP_Request2::AUTH_DIGEST: + curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_DIGEST); + } + } + } + + // set authentication data + if ($auth = $this->request->getAuth()) { + curl_setopt($ch, CURLOPT_USERPWD, $auth['user'] . ':' . $auth['password']); + switch ($auth['scheme']) { + case HTTP_Request2::AUTH_BASIC: + curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + break; + case HTTP_Request2::AUTH_DIGEST: + curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST); + } + } + + // set SSL options + if (0 == strcasecmp($this->request->getUrl()->getScheme(), 'https')) { + foreach ($this->request->getConfig() as $name => $value) { + if ('ssl_verify_host' == $name && null !== $value) { + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $value? 2: 0); + } elseif (isset(self::$sslContextMap[$name]) && null !== $value) { + curl_setopt($ch, self::$sslContextMap[$name], $value); + } + } + } + + $headers = $this->request->getHeaders(); + // make cURL automagically send proper header + if (!isset($headers['accept-encoding'])) { + $headers['accept-encoding'] = ''; + } + + // set headers having special cURL keys + foreach (self::$headerMap as $name => $option) { + if (isset($headers[$name])) { + curl_setopt($ch, $option, $headers[$name]); + unset($headers[$name]); + } + } + + $this->calculateRequestLength($headers); + if (isset($headers['content-length'])) { + $this->workaroundPhpBug47204($ch, $headers); + } + + // set headers not having special keys + $headersFmt = array(); + foreach ($headers as $name => $value) { + $canonicalName = implode('-', array_map('ucfirst', explode('-', $name))); + $headersFmt[] = $canonicalName . ': ' . $value; + } + curl_setopt($ch, CURLOPT_HTTPHEADER, $headersFmt); + + return $ch; + } + + /** + * Workaround for PHP bug #47204 that prevents rewinding request body + * + * The workaround consists of reading the entire request body into memory + * and setting it as CURLOPT_POSTFIELDS, so it isn't recommended for large + * file uploads, use Socket adapter instead. + * + * @param resource cURL handle + * @param array Request headers + */ + protected function workaroundPhpBug47204($ch, &$headers) + { + // no redirects, no digest auth -> probably no rewind needed + if (!$this->request->getConfig('follow_redirects') + && (!($auth = $this->request->getAuth()) + || HTTP_Request2::AUTH_DIGEST != $auth['scheme']) + ) { + curl_setopt($ch, CURLOPT_READFUNCTION, array($this, 'callbackReadBody')); + + // rewind may be needed, read the whole body into memory + } else { + if ($this->requestBody instanceof HTTP_Request2_MultipartBody) { + $this->requestBody = $this->requestBody->__toString(); + + } elseif (is_resource($this->requestBody)) { + $fp = $this->requestBody; + $this->requestBody = ''; + while (!feof($fp)) { + $this->requestBody .= fread($fp, 16384); + } + } + // curl hangs up if content-length is present + unset($headers['content-length']); + curl_setopt($ch, CURLOPT_POSTFIELDS, $this->requestBody); + } + } + + /** + * Callback function called by cURL for reading the request body + * + * @param resource cURL handle + * @param resource file descriptor (not used) + * @param integer maximum length of data to return + * @return string part of the request body, up to $length bytes + */ + protected function callbackReadBody($ch, $fd, $length) + { + if (!$this->eventSentHeaders) { + $this->request->setLastEvent( + 'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT) + ); + $this->eventSentHeaders = true; + } + if (in_array($this->request->getMethod(), self::$bodyDisallowed) || + 0 == $this->contentLength || $this->position >= $this->contentLength + ) { + return ''; + } + if (is_string($this->requestBody)) { + $string = substr($this->requestBody, $this->position, $length); + } elseif (is_resource($this->requestBody)) { + $string = fread($this->requestBody, $length); + } else { + $string = $this->requestBody->read($length); + } + $this->request->setLastEvent('sentBodyPart', strlen($string)); + $this->position += strlen($string); + return $string; + } + + /** + * Callback function called by cURL for saving the response headers + * + * @param resource cURL handle + * @param string response header (with trailing CRLF) + * @return integer number of bytes saved + * @see HTTP_Request2_Response::parseHeaderLine() + */ + protected function callbackWriteHeader($ch, $string) + { + // we may receive a second set of headers if doing e.g. digest auth + if ($this->eventReceivedHeaders || !$this->eventSentHeaders) { + // don't bother with 100-Continue responses (bug #15785) + if (!$this->eventSentHeaders || + $this->response->getStatus() >= 200 + ) { + $this->request->setLastEvent( + 'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT) + ); + } + $upload = curl_getinfo($ch, CURLINFO_SIZE_UPLOAD); + // if body wasn't read by a callback, send event with total body size + if ($upload > $this->position) { + $this->request->setLastEvent( + 'sentBodyPart', $upload - $this->position + ); + $this->position = $upload; + } + $this->eventSentHeaders = true; + // we'll need a new response object + if ($this->eventReceivedHeaders) { + $this->eventReceivedHeaders = false; + $this->response = null; + } + } + if (empty($this->response)) { + $this->response = new HTTP_Request2_Response($string, false); + } else { + $this->response->parseHeaderLine($string); + if ('' == trim($string)) { + // don't bother with 100-Continue responses (bug #15785) + if (200 <= $this->response->getStatus()) { + $this->request->setLastEvent('receivedHeaders', $this->response); + } + // for versions lower than 5.2.10, check the redirection URL protocol + if ($this->request->getConfig('follow_redirects') && !defined('CURLOPT_REDIR_PROTOCOLS') + && $this->response->isRedirect() + ) { + $redirectUrl = new Net_URL2($this->response->getHeader('location')); + if ($redirectUrl->isAbsolute() + && !in_array($redirectUrl->getScheme(), array('http', 'https')) + ) { + return -1; + } + } + $this->eventReceivedHeaders = true; + } + } + return strlen($string); + } + + /** + * Callback function called by cURL for saving the response body + * + * @param resource cURL handle (not used) + * @param string part of the response body + * @return integer number of bytes saved + * @see HTTP_Request2_Response::appendBody() + */ + protected function callbackWriteBody($ch, $string) + { + // cURL calls WRITEFUNCTION callback without calling HEADERFUNCTION if + // response doesn't start with proper HTTP status line (see bug #15716) + if (empty($this->response)) { + throw new HTTP_Request2_Exception("Malformed response: {$string}"); + } + if ($this->request->getConfig('store_body')) { + $this->response->appendBody($string); + } + $this->request->setLastEvent('receivedBodyPart', $string); + return strlen($string); + } +} +?> diff --git a/libs/PEAR.1.9/HTTP/Request2/Adapter/Mock.php b/libs/PEAR.1.9/HTTP/Request2/Adapter/Mock.php index 17e9e08d9..fdedccac0 100644 --- a/libs/PEAR.1.9/HTTP/Request2/Adapter/Mock.php +++ b/libs/PEAR.1.9/HTTP/Request2/Adapter/Mock.php @@ -1,171 +1,171 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Mock.php 290192 2009-11-03 21:29:32Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Base class for HTTP_Request2 adapters - */ -require_once 'HTTP/Request2/Adapter.php'; - -/** - * Mock adapter intended for testing - * - * Can be used to test applications depending on HTTP_Request2 package without - * actually performing any HTTP requests. This adapter will return responses - * previously added via addResponse() - * - * $mock = new HTTP_Request2_Adapter_Mock(); - * $mock->addResponse("HTTP/1.1 ... "); - * - * $request = new HTTP_Request2(); - * $request->setAdapter($mock); - * - * // This will return the response set above - * $response = $req->send(); - * - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @version Release: 0.5.2 - */ -class HTTP_Request2_Adapter_Mock extends HTTP_Request2_Adapter -{ - /** - * A queue of responses to be returned by sendRequest() - * @var array - */ - protected $responses = array(); - - /** - * Returns the next response from the queue built by addResponse() - * - * If the queue is empty it will return default empty response with status 400, - * if an Exception object was added to the queue it will be thrown. - * - * @param HTTP_Request2 - * @return HTTP_Request2_Response - * @throws Exception - */ - public function sendRequest(HTTP_Request2 $request) - { - if (count($this->responses) > 0) { - $response = array_shift($this->responses); - if ($response instanceof HTTP_Request2_Response) { - return $response; - } else { - // rethrow the exception - $class = get_class($response); - $message = $response->getMessage(); - $code = $response->getCode(); - throw new $class($message, $code); - } - } else { - return self::createResponseFromString("HTTP/1.1 400 Bad Request\r\n\r\n"); - } - } - - /** - * Adds response to the queue - * - * @param mixed either a string, a pointer to an open file, - * an instance of HTTP_Request2_Response or Exception - * @throws HTTP_Request2_Exception - */ - public function addResponse($response) - { - if (is_string($response)) { - $response = self::createResponseFromString($response); - } elseif (is_resource($response)) { - $response = self::createResponseFromFile($response); - } elseif (!$response instanceof HTTP_Request2_Response && - !$response instanceof Exception - ) { - throw new HTTP_Request2_Exception('Parameter is not a valid response'); - } - $this->responses[] = $response; - } - - /** - * Creates a new HTTP_Request2_Response object from a string - * - * @param string - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - public static function createResponseFromString($str) - { - $parts = preg_split('!(\r?\n){2}!m', $str, 2); - $headerLines = explode("\n", $parts[0]); - $response = new HTTP_Request2_Response(array_shift($headerLines)); - foreach ($headerLines as $headerLine) { - $response->parseHeaderLine($headerLine); - } - $response->parseHeaderLine(''); - if (isset($parts[1])) { - $response->appendBody($parts[1]); - } - return $response; - } - - /** - * Creates a new HTTP_Request2_Response object from a file - * - * @param resource file pointer returned by fopen() - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - public static function createResponseFromFile($fp) - { - $response = new HTTP_Request2_Response(fgets($fp)); - do { - $headerLine = fgets($fp); - $response->parseHeaderLine($headerLine); - } while ('' != trim($headerLine)); - - while (!feof($fp)) { - $response->appendBody(fread($fp, 8192)); - } - return $response; - } -} + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: Mock.php 290192 2009-11-03 21:29:32Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * Base class for HTTP_Request2 adapters + */ +require_once 'HTTP/Request2/Adapter.php'; + +/** + * Mock adapter intended for testing + * + * Can be used to test applications depending on HTTP_Request2 package without + * actually performing any HTTP requests. This adapter will return responses + * previously added via addResponse() + * + * $mock = new HTTP_Request2_Adapter_Mock(); + * $mock->addResponse("HTTP/1.1 ... "); + * + * $request = new HTTP_Request2(); + * $request->setAdapter($mock); + * + * // This will return the response set above + * $response = $req->send(); + * + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @version Release: 0.5.2 + */ +class HTTP_Request2_Adapter_Mock extends HTTP_Request2_Adapter +{ + /** + * A queue of responses to be returned by sendRequest() + * @var array + */ + protected $responses = array(); + + /** + * Returns the next response from the queue built by addResponse() + * + * If the queue is empty it will return default empty response with status 400, + * if an Exception object was added to the queue it will be thrown. + * + * @param HTTP_Request2 + * @return HTTP_Request2_Response + * @throws Exception + */ + public function sendRequest(HTTP_Request2 $request) + { + if (count($this->responses) > 0) { + $response = array_shift($this->responses); + if ($response instanceof HTTP_Request2_Response) { + return $response; + } else { + // rethrow the exception + $class = get_class($response); + $message = $response->getMessage(); + $code = $response->getCode(); + throw new $class($message, $code); + } + } else { + return self::createResponseFromString("HTTP/1.1 400 Bad Request\r\n\r\n"); + } + } + + /** + * Adds response to the queue + * + * @param mixed either a string, a pointer to an open file, + * an instance of HTTP_Request2_Response or Exception + * @throws HTTP_Request2_Exception + */ + public function addResponse($response) + { + if (is_string($response)) { + $response = self::createResponseFromString($response); + } elseif (is_resource($response)) { + $response = self::createResponseFromFile($response); + } elseif (!$response instanceof HTTP_Request2_Response && + !$response instanceof Exception + ) { + throw new HTTP_Request2_Exception('Parameter is not a valid response'); + } + $this->responses[] = $response; + } + + /** + * Creates a new HTTP_Request2_Response object from a string + * + * @param string + * @return HTTP_Request2_Response + * @throws HTTP_Request2_Exception + */ + public static function createResponseFromString($str) + { + $parts = preg_split('!(\r?\n){2}!m', $str, 2); + $headerLines = explode("\n", $parts[0]); + $response = new HTTP_Request2_Response(array_shift($headerLines)); + foreach ($headerLines as $headerLine) { + $response->parseHeaderLine($headerLine); + } + $response->parseHeaderLine(''); + if (isset($parts[1])) { + $response->appendBody($parts[1]); + } + return $response; + } + + /** + * Creates a new HTTP_Request2_Response object from a file + * + * @param resource file pointer returned by fopen() + * @return HTTP_Request2_Response + * @throws HTTP_Request2_Exception + */ + public static function createResponseFromFile($fp) + { + $response = new HTTP_Request2_Response(fgets($fp)); + do { + $headerLine = fgets($fp); + $response->parseHeaderLine($headerLine); + } while ('' != trim($headerLine)); + + while (!feof($fp)) { + $response->appendBody(fread($fp, 8192)); + } + return $response; + } +} ?> \ No newline at end of file diff --git a/libs/PEAR.1.9/HTTP/Request2/Adapter/Socket.php b/libs/PEAR.1.9/HTTP/Request2/Adapter/Socket.php index e7afdbd3f..a9c9ea361 100644 --- a/libs/PEAR.1.9/HTTP/Request2/Adapter/Socket.php +++ b/libs/PEAR.1.9/HTTP/Request2/Adapter/Socket.php @@ -1,1046 +1,1046 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Socket.php 290921 2009-11-18 17:31:58Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Base class for HTTP_Request2 adapters - */ -require_once 'HTTP/Request2/Adapter.php'; - -/** - * Socket-based adapter for HTTP_Request2 - * - * This adapter uses only PHP sockets and will work on almost any PHP - * environment. Code is based on original HTTP_Request PEAR package. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @version Release: 0.5.2 - */ -class HTTP_Request2_Adapter_Socket extends HTTP_Request2_Adapter -{ - /** - * Regular expression for 'token' rule from RFC 2616 - */ - const REGEXP_TOKEN = '[^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+'; - - /** - * Regular expression for 'quoted-string' rule from RFC 2616 - */ - const REGEXP_QUOTED_STRING = '"(?:\\\\.|[^\\\\"])*"'; - - /** - * Connected sockets, needed for Keep-Alive support - * @var array - * @see connect() - */ - protected static $sockets = array(); - - /** - * Data for digest authentication scheme - * - * The keys for the array are URL prefixes. - * - * The values are associative arrays with data (realm, nonce, nonce-count, - * opaque...) needed for digest authentication. Stored here to prevent making - * duplicate requests to digest-protected resources after we have already - * received the challenge. - * - * @var array - */ - protected static $challenges = array(); - - /** - * Connected socket - * @var resource - * @see connect() - */ - protected $socket; - - /** - * Challenge used for server digest authentication - * @var array - */ - protected $serverChallenge; - - /** - * Challenge used for proxy digest authentication - * @var array - */ - protected $proxyChallenge; - - /** - * Sum of start time and global timeout, exception will be thrown if request continues past this time - * @var integer - */ - protected $deadline = null; - - /** - * Remaining length of the current chunk, when reading chunked response - * @var integer - * @see readChunked() - */ - protected $chunkLength = 0; - - /** - * Remaining amount of redirections to follow - * - * Starts at 'max_redirects' configuration parameter and is reduced on each - * subsequent redirect. An Exception will be thrown once it reaches zero. - * - * @var integer - */ - protected $redirectCountdown = null; - - /** - * Sends request to the remote server and returns its response - * - * @param HTTP_Request2 - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - public function sendRequest(HTTP_Request2 $request) - { - $this->request = $request; - - // Use global request timeout if given, see feature requests #5735, #8964 - if ($timeout = $request->getConfig('timeout')) { - $this->deadline = time() + $timeout; - } else { - $this->deadline = null; - } - - try { - $keepAlive = $this->connect(); - $headers = $this->prepareHeaders(); - if (false === @fwrite($this->socket, $headers, strlen($headers))) { - throw new HTTP_Request2_Exception('Error writing request'); - } - // provide request headers to the observer, see request #7633 - $this->request->setLastEvent('sentHeaders', $headers); - $this->writeBody(); - - if ($this->deadline && time() > $this->deadline) { - throw new HTTP_Request2_Exception( - 'Request timed out after ' . - $request->getConfig('timeout') . ' second(s)' - ); - } - - $response = $this->readResponse(); - - if (!$this->canKeepAlive($keepAlive, $response)) { - $this->disconnect(); - } - - if ($this->shouldUseProxyDigestAuth($response)) { - return $this->sendRequest($request); - } - if ($this->shouldUseServerDigestAuth($response)) { - return $this->sendRequest($request); - } - if ($authInfo = $response->getHeader('authentication-info')) { - $this->updateChallenge($this->serverChallenge, $authInfo); - } - if ($proxyInfo = $response->getHeader('proxy-authentication-info')) { - $this->updateChallenge($this->proxyChallenge, $proxyInfo); - } - - } catch (Exception $e) { - $this->disconnect(); - } - - unset($this->request, $this->requestBody); - - if (!empty($e)) { - throw $e; - } - - if (!$request->getConfig('follow_redirects') || !$response->isRedirect()) { - return $response; - } else { - return $this->handleRedirect($request, $response); - } - } - - /** - * Connects to the remote server - * - * @return bool whether the connection can be persistent - * @throws HTTP_Request2_Exception - */ - protected function connect() - { - $secure = 0 == strcasecmp($this->request->getUrl()->getScheme(), 'https'); - $tunnel = HTTP_Request2::METHOD_CONNECT == $this->request->getMethod(); - $headers = $this->request->getHeaders(); - $reqHost = $this->request->getUrl()->getHost(); - if (!($reqPort = $this->request->getUrl()->getPort())) { - $reqPort = $secure? 443: 80; - } - - if ($host = $this->request->getConfig('proxy_host')) { - if (!($port = $this->request->getConfig('proxy_port'))) { - throw new HTTP_Request2_Exception('Proxy port not provided'); - } - $proxy = true; - } else { - $host = $reqHost; - $port = $reqPort; - $proxy = false; - } - - if ($tunnel && !$proxy) { - throw new HTTP_Request2_Exception( - "Trying to perform CONNECT request without proxy" - ); - } - if ($secure && !in_array('ssl', stream_get_transports())) { - throw new HTTP_Request2_Exception( - 'Need OpenSSL support for https:// requests' - ); - } - - // RFC 2068, section 19.7.1: A client MUST NOT send the Keep-Alive - // connection token to a proxy server... - if ($proxy && !$secure && - !empty($headers['connection']) && 'Keep-Alive' == $headers['connection'] - ) { - $this->request->setHeader('connection'); - } - - $keepAlive = ('1.1' == $this->request->getConfig('protocol_version') && - empty($headers['connection'])) || - (!empty($headers['connection']) && - 'Keep-Alive' == $headers['connection']); - $host = ((!$secure || $proxy)? 'tcp://': 'ssl://') . $host; - - $options = array(); - if ($secure || $tunnel) { - foreach ($this->request->getConfig() as $name => $value) { - if ('ssl_' == substr($name, 0, 4) && null !== $value) { - if ('ssl_verify_host' == $name) { - if ($value) { - $options['CN_match'] = $reqHost; - } - } else { - $options[substr($name, 4)] = $value; - } - } - } - ksort($options); - } - - // Changing SSL context options after connection is established does *not* - // work, we need a new connection if options change - $remote = $host . ':' . $port; - $socketKey = $remote . (($secure && $proxy)? "->{$reqHost}:{$reqPort}": '') . - (empty($options)? '': ':' . serialize($options)); - unset($this->socket); - - // We use persistent connections and have a connected socket? - // Ensure that the socket is still connected, see bug #16149 - if ($keepAlive && !empty(self::$sockets[$socketKey]) && - !feof(self::$sockets[$socketKey]) - ) { - $this->socket =& self::$sockets[$socketKey]; - - } elseif ($secure && $proxy && !$tunnel) { - $this->establishTunnel(); - $this->request->setLastEvent( - 'connect', "ssl://{$reqHost}:{$reqPort} via {$host}:{$port}" - ); - self::$sockets[$socketKey] =& $this->socket; - - } else { - // Set SSL context options if doing HTTPS request or creating a tunnel - $context = stream_context_create(); - foreach ($options as $name => $value) { - if (!stream_context_set_option($context, 'ssl', $name, $value)) { - throw new HTTP_Request2_Exception( - "Error setting SSL context option '{$name}'" - ); - } - } - $this->socket = @stream_socket_client( - $remote, $errno, $errstr, - $this->request->getConfig('connect_timeout'), - STREAM_CLIENT_CONNECT, $context - ); - if (!$this->socket) { - throw new HTTP_Request2_Exception( - "Unable to connect to {$remote}. Error #{$errno}: {$errstr}" - ); - } - $this->request->setLastEvent('connect', $remote); - self::$sockets[$socketKey] =& $this->socket; - } - return $keepAlive; - } - - /** - * Establishes a tunnel to a secure remote server via HTTP CONNECT request - * - * This method will fail if 'ssl_verify_peer' is enabled. Probably because PHP - * sees that we are connected to a proxy server (duh!) rather than the server - * that presents its certificate. - * - * @link http://tools.ietf.org/html/rfc2817#section-5.2 - * @throws HTTP_Request2_Exception - */ - protected function establishTunnel() - { - $donor = new self; - $connect = new HTTP_Request2( - $this->request->getUrl(), HTTP_Request2::METHOD_CONNECT, - array_merge($this->request->getConfig(), - array('adapter' => $donor)) - ); - $response = $connect->send(); - // Need any successful (2XX) response - if (200 > $response->getStatus() || 300 <= $response->getStatus()) { - throw new HTTP_Request2_Exception( - 'Failed to connect via HTTPS proxy. Proxy response: ' . - $response->getStatus() . ' ' . $response->getReasonPhrase() - ); - } - $this->socket = $donor->socket; - - $modes = array( - STREAM_CRYPTO_METHOD_TLS_CLIENT, - STREAM_CRYPTO_METHOD_SSLv3_CLIENT, - STREAM_CRYPTO_METHOD_SSLv23_CLIENT, - STREAM_CRYPTO_METHOD_SSLv2_CLIENT - ); - - foreach ($modes as $mode) { - if (stream_socket_enable_crypto($this->socket, true, $mode)) { - return; - } - } - throw new HTTP_Request2_Exception( - 'Failed to enable secure connection when connecting through proxy' - ); - } - - /** - * Checks whether current connection may be reused or should be closed - * - * @param boolean whether connection could be persistent - * in the first place - * @param HTTP_Request2_Response response object to check - * @return boolean - */ - protected function canKeepAlive($requestKeepAlive, HTTP_Request2_Response $response) - { - // Do not close socket on successful CONNECT request - if (HTTP_Request2::METHOD_CONNECT == $this->request->getMethod() && - 200 <= $response->getStatus() && 300 > $response->getStatus() - ) { - return true; - } - - $lengthKnown = 'chunked' == strtolower($response->getHeader('transfer-encoding')) || - null !== $response->getHeader('content-length'); - $persistent = 'keep-alive' == strtolower($response->getHeader('connection')) || - (null === $response->getHeader('connection') && - '1.1' == $response->getVersion()); - return $requestKeepAlive && $lengthKnown && $persistent; - } - - /** - * Disconnects from the remote server - */ - protected function disconnect() - { - if (is_resource($this->socket)) { - fclose($this->socket); - $this->socket = null; - $this->request->setLastEvent('disconnect'); - } - } - - /** - * Handles HTTP redirection - * - * This method will throw an Exception if redirect to a non-HTTP(S) location - * is attempted, also if number of redirects performed already is equal to - * 'max_redirects' configuration parameter. - * - * @param HTTP_Request2 Original request - * @param HTTP_Request2_Response Response containing redirect - * @return HTTP_Request2_Response Response from a new location - * @throws HTTP_Request2_Exception - */ - protected function handleRedirect(HTTP_Request2 $request, - HTTP_Request2_Response $response) - { - if (is_null($this->redirectCountdown)) { - $this->redirectCountdown = $request->getConfig('max_redirects'); - } - if (0 == $this->redirectCountdown) { - // Copying cURL behaviour - throw new HTTP_Request2_Exception( - 'Maximum (' . $request->getConfig('max_redirects') . ') redirects followed' - ); - } - $redirectUrl = new Net_URL2( - $response->getHeader('location'), - array(Net_URL2::OPTION_USE_BRACKETS => $request->getConfig('use_brackets')) - ); - // refuse non-HTTP redirect - if ($redirectUrl->isAbsolute() - && !in_array($redirectUrl->getScheme(), array('http', 'https')) - ) { - throw new HTTP_Request2_Exception( - 'Refusing to redirect to a non-HTTP URL ' . $redirectUrl->__toString() - ); - } - // Theoretically URL should be absolute (see http://tools.ietf.org/html/rfc2616#section-14.30), - // but in practice it is often not - if (!$redirectUrl->isAbsolute()) { - $redirectUrl = $request->getUrl()->resolve($redirectUrl); - } - $redirect = clone $request; - $redirect->setUrl($redirectUrl); - if (303 == $response->getStatus() || (!$request->getConfig('strict_redirects') - && in_array($response->getStatus(), array(301, 302))) - ) { - $redirect->setMethod(HTTP_Request2::METHOD_GET); - $redirect->setBody(''); - } - - if (0 < $this->redirectCountdown) { - $this->redirectCountdown--; - } - return $this->sendRequest($redirect); - } - - /** - * Checks whether another request should be performed with server digest auth - * - * Several conditions should be satisfied for it to return true: - * - response status should be 401 - * - auth credentials should be set in the request object - * - response should contain WWW-Authenticate header with digest challenge - * - there is either no challenge stored for this URL or new challenge - * contains stale=true parameter (in other case we probably just failed - * due to invalid username / password) - * - * The method stores challenge values in $challenges static property - * - * @param HTTP_Request2_Response response to check - * @return boolean whether another request should be performed - * @throws HTTP_Request2_Exception in case of unsupported challenge parameters - */ - protected function shouldUseServerDigestAuth(HTTP_Request2_Response $response) - { - // no sense repeating a request if we don't have credentials - if (401 != $response->getStatus() || !$this->request->getAuth()) { - return false; - } - if (!$challenge = $this->parseDigestChallenge($response->getHeader('www-authenticate'))) { - return false; - } - - $url = $this->request->getUrl(); - $scheme = $url->getScheme(); - $host = $scheme . '://' . $url->getHost(); - if ($port = $url->getPort()) { - if ((0 == strcasecmp($scheme, 'http') && 80 != $port) || - (0 == strcasecmp($scheme, 'https') && 443 != $port) - ) { - $host .= ':' . $port; - } - } - - if (!empty($challenge['domain'])) { - $prefixes = array(); - foreach (preg_split('/\\s+/', $challenge['domain']) as $prefix) { - // don't bother with different servers - if ('/' == substr($prefix, 0, 1)) { - $prefixes[] = $host . $prefix; - } - } - } - if (empty($prefixes)) { - $prefixes = array($host . '/'); - } - - $ret = true; - foreach ($prefixes as $prefix) { - if (!empty(self::$challenges[$prefix]) && - (empty($challenge['stale']) || strcasecmp('true', $challenge['stale'])) - ) { - // probably credentials are invalid - $ret = false; - } - self::$challenges[$prefix] =& $challenge; - } - return $ret; - } - - /** - * Checks whether another request should be performed with proxy digest auth - * - * Several conditions should be satisfied for it to return true: - * - response status should be 407 - * - proxy auth credentials should be set in the request object - * - response should contain Proxy-Authenticate header with digest challenge - * - there is either no challenge stored for this proxy or new challenge - * contains stale=true parameter (in other case we probably just failed - * due to invalid username / password) - * - * The method stores challenge values in $challenges static property - * - * @param HTTP_Request2_Response response to check - * @return boolean whether another request should be performed - * @throws HTTP_Request2_Exception in case of unsupported challenge parameters - */ - protected function shouldUseProxyDigestAuth(HTTP_Request2_Response $response) - { - if (407 != $response->getStatus() || !$this->request->getConfig('proxy_user')) { - return false; - } - if (!($challenge = $this->parseDigestChallenge($response->getHeader('proxy-authenticate')))) { - return false; - } - - $key = 'proxy://' . $this->request->getConfig('proxy_host') . - ':' . $this->request->getConfig('proxy_port'); - - if (!empty(self::$challenges[$key]) && - (empty($challenge['stale']) || strcasecmp('true', $challenge['stale'])) - ) { - $ret = false; - } else { - $ret = true; - } - self::$challenges[$key] = $challenge; - return $ret; - } - - /** - * Extracts digest method challenge from (WWW|Proxy)-Authenticate header value - * - * There is a problem with implementation of RFC 2617: several of the parameters - * are defined as quoted-string there and thus may contain backslash escaped - * double quotes (RFC 2616, section 2.2). However, RFC 2617 defines unq(X) as - * just value of quoted-string X without surrounding quotes, it doesn't speak - * about removing backslash escaping. - * - * Now realm parameter is user-defined and human-readable, strange things - * happen when it contains quotes: - * - Apache allows quotes in realm, but apparently uses realm value without - * backslashes for digest computation - * - Squid allows (manually escaped) quotes there, but it is impossible to - * authorize with either escaped or unescaped quotes used in digest, - * probably it can't parse the response (?) - * - Both IE and Firefox display realm value with backslashes in - * the password popup and apparently use the same value for digest - * - * HTTP_Request2 follows IE and Firefox (and hopefully RFC 2617) in - * quoted-string handling, unfortunately that means failure to authorize - * sometimes - * - * @param string value of WWW-Authenticate or Proxy-Authenticate header - * @return mixed associative array with challenge parameters, false if - * no challenge is present in header value - * @throws HTTP_Request2_Exception in case of unsupported challenge parameters - */ - protected function parseDigestChallenge($headerValue) - { - $authParam = '(' . self::REGEXP_TOKEN . ')\\s*=\\s*(' . - self::REGEXP_TOKEN . '|' . self::REGEXP_QUOTED_STRING . ')'; - $challenge = "!(?<=^|\\s|,)Digest ({$authParam}\\s*(,\\s*|$))+!"; - if (!preg_match($challenge, $headerValue, $matches)) { - return false; - } - - preg_match_all('!' . $authParam . '!', $matches[0], $params); - $paramsAry = array(); - $knownParams = array('realm', 'domain', 'nonce', 'opaque', 'stale', - 'algorithm', 'qop'); - for ($i = 0; $i < count($params[0]); $i++) { - // section 3.2.1: Any unrecognized directive MUST be ignored. - if (in_array($params[1][$i], $knownParams)) { - if ('"' == substr($params[2][$i], 0, 1)) { - $paramsAry[$params[1][$i]] = substr($params[2][$i], 1, -1); - } else { - $paramsAry[$params[1][$i]] = $params[2][$i]; - } - } - } - // we only support qop=auth - if (!empty($paramsAry['qop']) && - !in_array('auth', array_map('trim', explode(',', $paramsAry['qop']))) - ) { - throw new HTTP_Request2_Exception( - "Only 'auth' qop is currently supported in digest authentication, " . - "server requested '{$paramsAry['qop']}'" - ); - } - // we only support algorithm=MD5 - if (!empty($paramsAry['algorithm']) && 'MD5' != $paramsAry['algorithm']) { - throw new HTTP_Request2_Exception( - "Only 'MD5' algorithm is currently supported in digest authentication, " . - "server requested '{$paramsAry['algorithm']}'" - ); - } - - return $paramsAry; - } - - /** - * Parses [Proxy-]Authentication-Info header value and updates challenge - * - * @param array challenge to update - * @param string value of [Proxy-]Authentication-Info header - * @todo validate server rspauth response - */ - protected function updateChallenge(&$challenge, $headerValue) - { - $authParam = '!(' . self::REGEXP_TOKEN . ')\\s*=\\s*(' . - self::REGEXP_TOKEN . '|' . self::REGEXP_QUOTED_STRING . ')!'; - $paramsAry = array(); - - preg_match_all($authParam, $headerValue, $params); - for ($i = 0; $i < count($params[0]); $i++) { - if ('"' == substr($params[2][$i], 0, 1)) { - $paramsAry[$params[1][$i]] = substr($params[2][$i], 1, -1); - } else { - $paramsAry[$params[1][$i]] = $params[2][$i]; - } - } - // for now, just update the nonce value - if (!empty($paramsAry['nextnonce'])) { - $challenge['nonce'] = $paramsAry['nextnonce']; - $challenge['nc'] = 1; - } - } - - /** - * Creates a value for [Proxy-]Authorization header when using digest authentication - * - * @param string user name - * @param string password - * @param string request URL - * @param array digest challenge parameters - * @return string value of [Proxy-]Authorization request header - * @link http://tools.ietf.org/html/rfc2617#section-3.2.2 - */ - protected function createDigestResponse($user, $password, $url, &$challenge) - { - if (false !== ($q = strpos($url, '?')) && - $this->request->getConfig('digest_compat_ie') - ) { - $url = substr($url, 0, $q); - } - - $a1 = md5($user . ':' . $challenge['realm'] . ':' . $password); - $a2 = md5($this->request->getMethod() . ':' . $url); - - if (empty($challenge['qop'])) { - $digest = md5($a1 . ':' . $challenge['nonce'] . ':' . $a2); - } else { - $challenge['cnonce'] = 'Req2.' . rand(); - if (empty($challenge['nc'])) { - $challenge['nc'] = 1; - } - $nc = sprintf('%08x', $challenge['nc']++); - $digest = md5($a1 . ':' . $challenge['nonce'] . ':' . $nc . ':' . - $challenge['cnonce'] . ':auth:' . $a2); - } - return 'Digest username="' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $user) . '", ' . - 'realm="' . $challenge['realm'] . '", ' . - 'nonce="' . $challenge['nonce'] . '", ' . - 'uri="' . $url . '", ' . - 'response="' . $digest . '"' . - (!empty($challenge['opaque'])? - ', opaque="' . $challenge['opaque'] . '"': - '') . - (!empty($challenge['qop'])? - ', qop="auth", nc=' . $nc . ', cnonce="' . $challenge['cnonce'] . '"': - ''); - } - - /** - * Adds 'Authorization' header (if needed) to request headers array - * - * @param array request headers - * @param string request host (needed for digest authentication) - * @param string request URL (needed for digest authentication) - * @throws HTTP_Request2_Exception - */ - protected function addAuthorizationHeader(&$headers, $requestHost, $requestUrl) - { - if (!($auth = $this->request->getAuth())) { - return; - } - switch ($auth['scheme']) { - case HTTP_Request2::AUTH_BASIC: - $headers['authorization'] = - 'Basic ' . base64_encode($auth['user'] . ':' . $auth['password']); - break; - - case HTTP_Request2::AUTH_DIGEST: - unset($this->serverChallenge); - $fullUrl = ('/' == $requestUrl[0])? - $this->request->getUrl()->getScheme() . '://' . - $requestHost . $requestUrl: - $requestUrl; - foreach (array_keys(self::$challenges) as $key) { - if ($key == substr($fullUrl, 0, strlen($key))) { - $headers['authorization'] = $this->createDigestResponse( - $auth['user'], $auth['password'], - $requestUrl, self::$challenges[$key] - ); - $this->serverChallenge =& self::$challenges[$key]; - break; - } - } - break; - - default: - throw new HTTP_Request2_Exception( - "Unknown HTTP authentication scheme '{$auth['scheme']}'" - ); - } - } - - /** - * Adds 'Proxy-Authorization' header (if needed) to request headers array - * - * @param array request headers - * @param string request URL (needed for digest authentication) - * @throws HTTP_Request2_Exception - */ - protected function addProxyAuthorizationHeader(&$headers, $requestUrl) - { - if (!$this->request->getConfig('proxy_host') || - !($user = $this->request->getConfig('proxy_user')) || - (0 == strcasecmp('https', $this->request->getUrl()->getScheme()) && - HTTP_Request2::METHOD_CONNECT != $this->request->getMethod()) - ) { - return; - } - - $password = $this->request->getConfig('proxy_password'); - switch ($this->request->getConfig('proxy_auth_scheme')) { - case HTTP_Request2::AUTH_BASIC: - $headers['proxy-authorization'] = - 'Basic ' . base64_encode($user . ':' . $password); - break; - - case HTTP_Request2::AUTH_DIGEST: - unset($this->proxyChallenge); - $proxyUrl = 'proxy://' . $this->request->getConfig('proxy_host') . - ':' . $this->request->getConfig('proxy_port'); - if (!empty(self::$challenges[$proxyUrl])) { - $headers['proxy-authorization'] = $this->createDigestResponse( - $user, $password, - $requestUrl, self::$challenges[$proxyUrl] - ); - $this->proxyChallenge =& self::$challenges[$proxyUrl]; - } - break; - - default: - throw new HTTP_Request2_Exception( - "Unknown HTTP authentication scheme '" . - $this->request->getConfig('proxy_auth_scheme') . "'" - ); - } - } - - - /** - * Creates the string with the Request-Line and request headers - * - * @return string - * @throws HTTP_Request2_Exception - */ - protected function prepareHeaders() - { - $headers = $this->request->getHeaders(); - $url = $this->request->getUrl(); - $connect = HTTP_Request2::METHOD_CONNECT == $this->request->getMethod(); - $host = $url->getHost(); - - $defaultPort = 0 == strcasecmp($url->getScheme(), 'https')? 443: 80; - if (($port = $url->getPort()) && $port != $defaultPort || $connect) { - $host .= ':' . (empty($port)? $defaultPort: $port); - } - // Do not overwrite explicitly set 'Host' header, see bug #16146 - if (!isset($headers['host'])) { - $headers['host'] = $host; - } - - if ($connect) { - $requestUrl = $host; - - } else { - if (!$this->request->getConfig('proxy_host') || - 0 == strcasecmp($url->getScheme(), 'https') - ) { - $requestUrl = ''; - } else { - $requestUrl = $url->getScheme() . '://' . $host; - } - $path = $url->getPath(); - $query = $url->getQuery(); - $requestUrl .= (empty($path)? '/': $path) . (empty($query)? '': '?' . $query); - } - - if ('1.1' == $this->request->getConfig('protocol_version') && - extension_loaded('zlib') && !isset($headers['accept-encoding']) - ) { - $headers['accept-encoding'] = 'gzip, deflate'; - } - - $this->addAuthorizationHeader($headers, $host, $requestUrl); - $this->addProxyAuthorizationHeader($headers, $requestUrl); - $this->calculateRequestLength($headers); - - $headersStr = $this->request->getMethod() . ' ' . $requestUrl . ' HTTP/' . - $this->request->getConfig('protocol_version') . "\r\n"; - foreach ($headers as $name => $value) { - $canonicalName = implode('-', array_map('ucfirst', explode('-', $name))); - $headersStr .= $canonicalName . ': ' . $value . "\r\n"; - } - return $headersStr . "\r\n"; - } - - /** - * Sends the request body - * - * @throws HTTP_Request2_Exception - */ - protected function writeBody() - { - if (in_array($this->request->getMethod(), self::$bodyDisallowed) || - 0 == $this->contentLength - ) { - return; - } - - $position = 0; - $bufferSize = $this->request->getConfig('buffer_size'); - while ($position < $this->contentLength) { - if (is_string($this->requestBody)) { - $str = substr($this->requestBody, $position, $bufferSize); - } elseif (is_resource($this->requestBody)) { - $str = fread($this->requestBody, $bufferSize); - } else { - $str = $this->requestBody->read($bufferSize); - } - if (false === @fwrite($this->socket, $str, strlen($str))) { - throw new HTTP_Request2_Exception('Error writing request'); - } - // Provide the length of written string to the observer, request #7630 - $this->request->setLastEvent('sentBodyPart', strlen($str)); - $position += strlen($str); - } - } - - /** - * Reads the remote server's response - * - * @return HTTP_Request2_Response - * @throws HTTP_Request2_Exception - */ - protected function readResponse() - { - $bufferSize = $this->request->getConfig('buffer_size'); - - do { - $response = new HTTP_Request2_Response($this->readLine($bufferSize), true); - do { - $headerLine = $this->readLine($bufferSize); - $response->parseHeaderLine($headerLine); - } while ('' != $headerLine); - } while (in_array($response->getStatus(), array(100, 101))); - - $this->request->setLastEvent('receivedHeaders', $response); - - // No body possible in such responses - if (HTTP_Request2::METHOD_HEAD == $this->request->getMethod() || - (HTTP_Request2::METHOD_CONNECT == $this->request->getMethod() && - 200 <= $response->getStatus() && 300 > $response->getStatus()) || - in_array($response->getStatus(), array(204, 304)) - ) { - return $response; - } - - $chunked = 'chunked' == $response->getHeader('transfer-encoding'); - $length = $response->getHeader('content-length'); - $hasBody = false; - if ($chunked || null === $length || 0 < intval($length)) { - // RFC 2616, section 4.4: - // 3. ... If a message is received with both a - // Transfer-Encoding header field and a Content-Length header field, - // the latter MUST be ignored. - $toRead = ($chunked || null === $length)? null: $length; - $this->chunkLength = 0; - - while (!feof($this->socket) && (is_null($toRead) || 0 < $toRead)) { - if ($chunked) { - $data = $this->readChunked($bufferSize); - } elseif (is_null($toRead)) { - $data = $this->fread($bufferSize); - } else { - $data = $this->fread(min($toRead, $bufferSize)); - $toRead -= strlen($data); - } - if ('' == $data && (!$this->chunkLength || feof($this->socket))) { - break; - } - - $hasBody = true; - if ($this->request->getConfig('store_body')) { - $response->appendBody($data); - } - if (!in_array($response->getHeader('content-encoding'), array('identity', null))) { - $this->request->setLastEvent('receivedEncodedBodyPart', $data); - } else { - $this->request->setLastEvent('receivedBodyPart', $data); - } - } - } - - if ($hasBody) { - $this->request->setLastEvent('receivedBody', $response); - } - return $response; - } - - /** - * Reads until either the end of the socket or a newline, whichever comes first - * - * Strips the trailing newline from the returned data, handles global - * request timeout. Method idea borrowed from Net_Socket PEAR package. - * - * @param int buffer size to use for reading - * @return Available data up to the newline (not including newline) - * @throws HTTP_Request2_Exception In case of timeout - */ - protected function readLine($bufferSize) - { - $line = ''; - while (!feof($this->socket)) { - if ($this->deadline) { - stream_set_timeout($this->socket, max($this->deadline - time(), 1)); - } - $line .= @fgets($this->socket, $bufferSize); - $info = stream_get_meta_data($this->socket); - if ($info['timed_out'] || $this->deadline && time() > $this->deadline) { - $reason = $this->deadline - ? 'after ' . $this->request->getConfig('timeout') . ' second(s)' - : 'due to default_socket_timeout php.ini setting'; - throw new HTTP_Request2_Exception("Request timed out {$reason}"); - } - if (substr($line, -1) == "\n") { - return rtrim($line, "\r\n"); - } - } - return $line; - } - - /** - * Wrapper around fread(), handles global request timeout - * - * @param int Reads up to this number of bytes - * @return Data read from socket - * @throws HTTP_Request2_Exception In case of timeout - */ - protected function fread($length) - { - if ($this->deadline) { - stream_set_timeout($this->socket, max($this->deadline - time(), 1)); - } - $data = fread($this->socket, $length); - $info = stream_get_meta_data($this->socket); - if ($info['timed_out'] || $this->deadline && time() > $this->deadline) { - $reason = $this->deadline - ? 'after ' . $this->request->getConfig('timeout') . ' second(s)' - : 'due to default_socket_timeout php.ini setting'; - throw new HTTP_Request2_Exception("Request timed out {$reason}"); - } - return $data; - } - - /** - * Reads a part of response body encoded with chunked Transfer-Encoding - * - * @param int buffer size to use for reading - * @return string - * @throws HTTP_Request2_Exception - */ - protected function readChunked($bufferSize) - { - // at start of the next chunk? - if (0 == $this->chunkLength) { - $line = $this->readLine($bufferSize); - if (!preg_match('/^([0-9a-f]+)/i', $line, $matches)) { - throw new HTTP_Request2_Exception( - "Cannot decode chunked response, invalid chunk length '{$line}'" - ); - } else { - $this->chunkLength = hexdec($matches[1]); - // Chunk with zero length indicates the end - if (0 == $this->chunkLength) { - $this->readLine($bufferSize); - return ''; - } - } - } - $data = $this->fread(min($this->chunkLength, $bufferSize)); - $this->chunkLength -= strlen($data); - if (0 == $this->chunkLength) { - $this->readLine($bufferSize); // Trailing CRLF - } - return $data; - } -} - + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: Socket.php 290921 2009-11-18 17:31:58Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * Base class for HTTP_Request2 adapters + */ +require_once 'HTTP/Request2/Adapter.php'; + +/** + * Socket-based adapter for HTTP_Request2 + * + * This adapter uses only PHP sockets and will work on almost any PHP + * environment. Code is based on original HTTP_Request PEAR package. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @version Release: 0.5.2 + */ +class HTTP_Request2_Adapter_Socket extends HTTP_Request2_Adapter +{ + /** + * Regular expression for 'token' rule from RFC 2616 + */ + const REGEXP_TOKEN = '[^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+'; + + /** + * Regular expression for 'quoted-string' rule from RFC 2616 + */ + const REGEXP_QUOTED_STRING = '"(?:\\\\.|[^\\\\"])*"'; + + /** + * Connected sockets, needed for Keep-Alive support + * @var array + * @see connect() + */ + protected static $sockets = array(); + + /** + * Data for digest authentication scheme + * + * The keys for the array are URL prefixes. + * + * The values are associative arrays with data (realm, nonce, nonce-count, + * opaque...) needed for digest authentication. Stored here to prevent making + * duplicate requests to digest-protected resources after we have already + * received the challenge. + * + * @var array + */ + protected static $challenges = array(); + + /** + * Connected socket + * @var resource + * @see connect() + */ + protected $socket; + + /** + * Challenge used for server digest authentication + * @var array + */ + protected $serverChallenge; + + /** + * Challenge used for proxy digest authentication + * @var array + */ + protected $proxyChallenge; + + /** + * Sum of start time and global timeout, exception will be thrown if request continues past this time + * @var integer + */ + protected $deadline = null; + + /** + * Remaining length of the current chunk, when reading chunked response + * @var integer + * @see readChunked() + */ + protected $chunkLength = 0; + + /** + * Remaining amount of redirections to follow + * + * Starts at 'max_redirects' configuration parameter and is reduced on each + * subsequent redirect. An Exception will be thrown once it reaches zero. + * + * @var integer + */ + protected $redirectCountdown = null; + + /** + * Sends request to the remote server and returns its response + * + * @param HTTP_Request2 + * @return HTTP_Request2_Response + * @throws HTTP_Request2_Exception + */ + public function sendRequest(HTTP_Request2 $request) + { + $this->request = $request; + + // Use global request timeout if given, see feature requests #5735, #8964 + if ($timeout = $request->getConfig('timeout')) { + $this->deadline = time() + $timeout; + } else { + $this->deadline = null; + } + + try { + $keepAlive = $this->connect(); + $headers = $this->prepareHeaders(); + if (false === @fwrite($this->socket, $headers, strlen($headers))) { + throw new HTTP_Request2_Exception('Error writing request'); + } + // provide request headers to the observer, see request #7633 + $this->request->setLastEvent('sentHeaders', $headers); + $this->writeBody(); + + if ($this->deadline && time() > $this->deadline) { + throw new HTTP_Request2_Exception( + 'Request timed out after ' . + $request->getConfig('timeout') . ' second(s)' + ); + } + + $response = $this->readResponse(); + + if (!$this->canKeepAlive($keepAlive, $response)) { + $this->disconnect(); + } + + if ($this->shouldUseProxyDigestAuth($response)) { + return $this->sendRequest($request); + } + if ($this->shouldUseServerDigestAuth($response)) { + return $this->sendRequest($request); + } + if ($authInfo = $response->getHeader('authentication-info')) { + $this->updateChallenge($this->serverChallenge, $authInfo); + } + if ($proxyInfo = $response->getHeader('proxy-authentication-info')) { + $this->updateChallenge($this->proxyChallenge, $proxyInfo); + } + + } catch (Exception $e) { + $this->disconnect(); + } + + unset($this->request, $this->requestBody); + + if (!empty($e)) { + throw $e; + } + + if (!$request->getConfig('follow_redirects') || !$response->isRedirect()) { + return $response; + } else { + return $this->handleRedirect($request, $response); + } + } + + /** + * Connects to the remote server + * + * @return bool whether the connection can be persistent + * @throws HTTP_Request2_Exception + */ + protected function connect() + { + $secure = 0 == strcasecmp($this->request->getUrl()->getScheme(), 'https'); + $tunnel = HTTP_Request2::METHOD_CONNECT == $this->request->getMethod(); + $headers = $this->request->getHeaders(); + $reqHost = $this->request->getUrl()->getHost(); + if (!($reqPort = $this->request->getUrl()->getPort())) { + $reqPort = $secure? 443: 80; + } + + if ($host = $this->request->getConfig('proxy_host')) { + if (!($port = $this->request->getConfig('proxy_port'))) { + throw new HTTP_Request2_Exception('Proxy port not provided'); + } + $proxy = true; + } else { + $host = $reqHost; + $port = $reqPort; + $proxy = false; + } + + if ($tunnel && !$proxy) { + throw new HTTP_Request2_Exception( + "Trying to perform CONNECT request without proxy" + ); + } + if ($secure && !in_array('ssl', stream_get_transports())) { + throw new HTTP_Request2_Exception( + 'Need OpenSSL support for https:// requests' + ); + } + + // RFC 2068, section 19.7.1: A client MUST NOT send the Keep-Alive + // connection token to a proxy server... + if ($proxy && !$secure && + !empty($headers['connection']) && 'Keep-Alive' == $headers['connection'] + ) { + $this->request->setHeader('connection'); + } + + $keepAlive = ('1.1' == $this->request->getConfig('protocol_version') && + empty($headers['connection'])) || + (!empty($headers['connection']) && + 'Keep-Alive' == $headers['connection']); + $host = ((!$secure || $proxy)? 'tcp://': 'ssl://') . $host; + + $options = array(); + if ($secure || $tunnel) { + foreach ($this->request->getConfig() as $name => $value) { + if ('ssl_' == substr($name, 0, 4) && null !== $value) { + if ('ssl_verify_host' == $name) { + if ($value) { + $options['CN_match'] = $reqHost; + } + } else { + $options[substr($name, 4)] = $value; + } + } + } + ksort($options); + } + + // Changing SSL context options after connection is established does *not* + // work, we need a new connection if options change + $remote = $host . ':' . $port; + $socketKey = $remote . (($secure && $proxy)? "->{$reqHost}:{$reqPort}": '') . + (empty($options)? '': ':' . serialize($options)); + unset($this->socket); + + // We use persistent connections and have a connected socket? + // Ensure that the socket is still connected, see bug #16149 + if ($keepAlive && !empty(self::$sockets[$socketKey]) && + !feof(self::$sockets[$socketKey]) + ) { + $this->socket =& self::$sockets[$socketKey]; + + } elseif ($secure && $proxy && !$tunnel) { + $this->establishTunnel(); + $this->request->setLastEvent( + 'connect', "ssl://{$reqHost}:{$reqPort} via {$host}:{$port}" + ); + self::$sockets[$socketKey] =& $this->socket; + + } else { + // Set SSL context options if doing HTTPS request or creating a tunnel + $context = stream_context_create(); + foreach ($options as $name => $value) { + if (!stream_context_set_option($context, 'ssl', $name, $value)) { + throw new HTTP_Request2_Exception( + "Error setting SSL context option '{$name}'" + ); + } + } + $this->socket = @stream_socket_client( + $remote, $errno, $errstr, + $this->request->getConfig('connect_timeout'), + STREAM_CLIENT_CONNECT, $context + ); + if (!$this->socket) { + throw new HTTP_Request2_Exception( + "Unable to connect to {$remote}. Error #{$errno}: {$errstr}" + ); + } + $this->request->setLastEvent('connect', $remote); + self::$sockets[$socketKey] =& $this->socket; + } + return $keepAlive; + } + + /** + * Establishes a tunnel to a secure remote server via HTTP CONNECT request + * + * This method will fail if 'ssl_verify_peer' is enabled. Probably because PHP + * sees that we are connected to a proxy server (duh!) rather than the server + * that presents its certificate. + * + * @link http://tools.ietf.org/html/rfc2817#section-5.2 + * @throws HTTP_Request2_Exception + */ + protected function establishTunnel() + { + $donor = new self; + $connect = new HTTP_Request2( + $this->request->getUrl(), HTTP_Request2::METHOD_CONNECT, + array_merge($this->request->getConfig(), + array('adapter' => $donor)) + ); + $response = $connect->send(); + // Need any successful (2XX) response + if (200 > $response->getStatus() || 300 <= $response->getStatus()) { + throw new HTTP_Request2_Exception( + 'Failed to connect via HTTPS proxy. Proxy response: ' . + $response->getStatus() . ' ' . $response->getReasonPhrase() + ); + } + $this->socket = $donor->socket; + + $modes = array( + STREAM_CRYPTO_METHOD_TLS_CLIENT, + STREAM_CRYPTO_METHOD_SSLv3_CLIENT, + STREAM_CRYPTO_METHOD_SSLv23_CLIENT, + STREAM_CRYPTO_METHOD_SSLv2_CLIENT + ); + + foreach ($modes as $mode) { + if (stream_socket_enable_crypto($this->socket, true, $mode)) { + return; + } + } + throw new HTTP_Request2_Exception( + 'Failed to enable secure connection when connecting through proxy' + ); + } + + /** + * Checks whether current connection may be reused or should be closed + * + * @param boolean whether connection could be persistent + * in the first place + * @param HTTP_Request2_Response response object to check + * @return boolean + */ + protected function canKeepAlive($requestKeepAlive, HTTP_Request2_Response $response) + { + // Do not close socket on successful CONNECT request + if (HTTP_Request2::METHOD_CONNECT == $this->request->getMethod() && + 200 <= $response->getStatus() && 300 > $response->getStatus() + ) { + return true; + } + + $lengthKnown = 'chunked' == strtolower($response->getHeader('transfer-encoding')) || + null !== $response->getHeader('content-length'); + $persistent = 'keep-alive' == strtolower($response->getHeader('connection')) || + (null === $response->getHeader('connection') && + '1.1' == $response->getVersion()); + return $requestKeepAlive && $lengthKnown && $persistent; + } + + /** + * Disconnects from the remote server + */ + protected function disconnect() + { + if (is_resource($this->socket)) { + fclose($this->socket); + $this->socket = null; + $this->request->setLastEvent('disconnect'); + } + } + + /** + * Handles HTTP redirection + * + * This method will throw an Exception if redirect to a non-HTTP(S) location + * is attempted, also if number of redirects performed already is equal to + * 'max_redirects' configuration parameter. + * + * @param HTTP_Request2 Original request + * @param HTTP_Request2_Response Response containing redirect + * @return HTTP_Request2_Response Response from a new location + * @throws HTTP_Request2_Exception + */ + protected function handleRedirect(HTTP_Request2 $request, + HTTP_Request2_Response $response) + { + if (is_null($this->redirectCountdown)) { + $this->redirectCountdown = $request->getConfig('max_redirects'); + } + if (0 == $this->redirectCountdown) { + // Copying cURL behaviour + throw new HTTP_Request2_Exception( + 'Maximum (' . $request->getConfig('max_redirects') . ') redirects followed' + ); + } + $redirectUrl = new Net_URL2( + $response->getHeader('location'), + array(Net_URL2::OPTION_USE_BRACKETS => $request->getConfig('use_brackets')) + ); + // refuse non-HTTP redirect + if ($redirectUrl->isAbsolute() + && !in_array($redirectUrl->getScheme(), array('http', 'https')) + ) { + throw new HTTP_Request2_Exception( + 'Refusing to redirect to a non-HTTP URL ' . $redirectUrl->__toString() + ); + } + // Theoretically URL should be absolute (see http://tools.ietf.org/html/rfc2616#section-14.30), + // but in practice it is often not + if (!$redirectUrl->isAbsolute()) { + $redirectUrl = $request->getUrl()->resolve($redirectUrl); + } + $redirect = clone $request; + $redirect->setUrl($redirectUrl); + if (303 == $response->getStatus() || (!$request->getConfig('strict_redirects') + && in_array($response->getStatus(), array(301, 302))) + ) { + $redirect->setMethod(HTTP_Request2::METHOD_GET); + $redirect->setBody(''); + } + + if (0 < $this->redirectCountdown) { + $this->redirectCountdown--; + } + return $this->sendRequest($redirect); + } + + /** + * Checks whether another request should be performed with server digest auth + * + * Several conditions should be satisfied for it to return true: + * - response status should be 401 + * - auth credentials should be set in the request object + * - response should contain WWW-Authenticate header with digest challenge + * - there is either no challenge stored for this URL or new challenge + * contains stale=true parameter (in other case we probably just failed + * due to invalid username / password) + * + * The method stores challenge values in $challenges static property + * + * @param HTTP_Request2_Response response to check + * @return boolean whether another request should be performed + * @throws HTTP_Request2_Exception in case of unsupported challenge parameters + */ + protected function shouldUseServerDigestAuth(HTTP_Request2_Response $response) + { + // no sense repeating a request if we don't have credentials + if (401 != $response->getStatus() || !$this->request->getAuth()) { + return false; + } + if (!$challenge = $this->parseDigestChallenge($response->getHeader('www-authenticate'))) { + return false; + } + + $url = $this->request->getUrl(); + $scheme = $url->getScheme(); + $host = $scheme . '://' . $url->getHost(); + if ($port = $url->getPort()) { + if ((0 == strcasecmp($scheme, 'http') && 80 != $port) || + (0 == strcasecmp($scheme, 'https') && 443 != $port) + ) { + $host .= ':' . $port; + } + } + + if (!empty($challenge['domain'])) { + $prefixes = array(); + foreach (preg_split('/\\s+/', $challenge['domain']) as $prefix) { + // don't bother with different servers + if ('/' == substr($prefix, 0, 1)) { + $prefixes[] = $host . $prefix; + } + } + } + if (empty($prefixes)) { + $prefixes = array($host . '/'); + } + + $ret = true; + foreach ($prefixes as $prefix) { + if (!empty(self::$challenges[$prefix]) && + (empty($challenge['stale']) || strcasecmp('true', $challenge['stale'])) + ) { + // probably credentials are invalid + $ret = false; + } + self::$challenges[$prefix] =& $challenge; + } + return $ret; + } + + /** + * Checks whether another request should be performed with proxy digest auth + * + * Several conditions should be satisfied for it to return true: + * - response status should be 407 + * - proxy auth credentials should be set in the request object + * - response should contain Proxy-Authenticate header with digest challenge + * - there is either no challenge stored for this proxy or new challenge + * contains stale=true parameter (in other case we probably just failed + * due to invalid username / password) + * + * The method stores challenge values in $challenges static property + * + * @param HTTP_Request2_Response response to check + * @return boolean whether another request should be performed + * @throws HTTP_Request2_Exception in case of unsupported challenge parameters + */ + protected function shouldUseProxyDigestAuth(HTTP_Request2_Response $response) + { + if (407 != $response->getStatus() || !$this->request->getConfig('proxy_user')) { + return false; + } + if (!($challenge = $this->parseDigestChallenge($response->getHeader('proxy-authenticate')))) { + return false; + } + + $key = 'proxy://' . $this->request->getConfig('proxy_host') . + ':' . $this->request->getConfig('proxy_port'); + + if (!empty(self::$challenges[$key]) && + (empty($challenge['stale']) || strcasecmp('true', $challenge['stale'])) + ) { + $ret = false; + } else { + $ret = true; + } + self::$challenges[$key] = $challenge; + return $ret; + } + + /** + * Extracts digest method challenge from (WWW|Proxy)-Authenticate header value + * + * There is a problem with implementation of RFC 2617: several of the parameters + * are defined as quoted-string there and thus may contain backslash escaped + * double quotes (RFC 2616, section 2.2). However, RFC 2617 defines unq(X) as + * just value of quoted-string X without surrounding quotes, it doesn't speak + * about removing backslash escaping. + * + * Now realm parameter is user-defined and human-readable, strange things + * happen when it contains quotes: + * - Apache allows quotes in realm, but apparently uses realm value without + * backslashes for digest computation + * - Squid allows (manually escaped) quotes there, but it is impossible to + * authorize with either escaped or unescaped quotes used in digest, + * probably it can't parse the response (?) + * - Both IE and Firefox display realm value with backslashes in + * the password popup and apparently use the same value for digest + * + * HTTP_Request2 follows IE and Firefox (and hopefully RFC 2617) in + * quoted-string handling, unfortunately that means failure to authorize + * sometimes + * + * @param string value of WWW-Authenticate or Proxy-Authenticate header + * @return mixed associative array with challenge parameters, false if + * no challenge is present in header value + * @throws HTTP_Request2_Exception in case of unsupported challenge parameters + */ + protected function parseDigestChallenge($headerValue) + { + $authParam = '(' . self::REGEXP_TOKEN . ')\\s*=\\s*(' . + self::REGEXP_TOKEN . '|' . self::REGEXP_QUOTED_STRING . ')'; + $challenge = "!(?<=^|\\s|,)Digest ({$authParam}\\s*(,\\s*|$))+!"; + if (!preg_match($challenge, $headerValue, $matches)) { + return false; + } + + preg_match_all('!' . $authParam . '!', $matches[0], $params); + $paramsAry = array(); + $knownParams = array('realm', 'domain', 'nonce', 'opaque', 'stale', + 'algorithm', 'qop'); + for ($i = 0; $i < count($params[0]); $i++) { + // section 3.2.1: Any unrecognized directive MUST be ignored. + if (in_array($params[1][$i], $knownParams)) { + if ('"' == substr($params[2][$i], 0, 1)) { + $paramsAry[$params[1][$i]] = substr($params[2][$i], 1, -1); + } else { + $paramsAry[$params[1][$i]] = $params[2][$i]; + } + } + } + // we only support qop=auth + if (!empty($paramsAry['qop']) && + !in_array('auth', array_map('trim', explode(',', $paramsAry['qop']))) + ) { + throw new HTTP_Request2_Exception( + "Only 'auth' qop is currently supported in digest authentication, " . + "server requested '{$paramsAry['qop']}'" + ); + } + // we only support algorithm=MD5 + if (!empty($paramsAry['algorithm']) && 'MD5' != $paramsAry['algorithm']) { + throw new HTTP_Request2_Exception( + "Only 'MD5' algorithm is currently supported in digest authentication, " . + "server requested '{$paramsAry['algorithm']}'" + ); + } + + return $paramsAry; + } + + /** + * Parses [Proxy-]Authentication-Info header value and updates challenge + * + * @param array challenge to update + * @param string value of [Proxy-]Authentication-Info header + * @todo validate server rspauth response + */ + protected function updateChallenge(&$challenge, $headerValue) + { + $authParam = '!(' . self::REGEXP_TOKEN . ')\\s*=\\s*(' . + self::REGEXP_TOKEN . '|' . self::REGEXP_QUOTED_STRING . ')!'; + $paramsAry = array(); + + preg_match_all($authParam, $headerValue, $params); + for ($i = 0; $i < count($params[0]); $i++) { + if ('"' == substr($params[2][$i], 0, 1)) { + $paramsAry[$params[1][$i]] = substr($params[2][$i], 1, -1); + } else { + $paramsAry[$params[1][$i]] = $params[2][$i]; + } + } + // for now, just update the nonce value + if (!empty($paramsAry['nextnonce'])) { + $challenge['nonce'] = $paramsAry['nextnonce']; + $challenge['nc'] = 1; + } + } + + /** + * Creates a value for [Proxy-]Authorization header when using digest authentication + * + * @param string user name + * @param string password + * @param string request URL + * @param array digest challenge parameters + * @return string value of [Proxy-]Authorization request header + * @link http://tools.ietf.org/html/rfc2617#section-3.2.2 + */ + protected function createDigestResponse($user, $password, $url, &$challenge) + { + if (false !== ($q = strpos($url, '?')) && + $this->request->getConfig('digest_compat_ie') + ) { + $url = substr($url, 0, $q); + } + + $a1 = md5($user . ':' . $challenge['realm'] . ':' . $password); + $a2 = md5($this->request->getMethod() . ':' . $url); + + if (empty($challenge['qop'])) { + $digest = md5($a1 . ':' . $challenge['nonce'] . ':' . $a2); + } else { + $challenge['cnonce'] = 'Req2.' . rand(); + if (empty($challenge['nc'])) { + $challenge['nc'] = 1; + } + $nc = sprintf('%08x', $challenge['nc']++); + $digest = md5($a1 . ':' . $challenge['nonce'] . ':' . $nc . ':' . + $challenge['cnonce'] . ':auth:' . $a2); + } + return 'Digest username="' . str_replace(array('\\', '"'), array('\\\\', '\\"'), $user) . '", ' . + 'realm="' . $challenge['realm'] . '", ' . + 'nonce="' . $challenge['nonce'] . '", ' . + 'uri="' . $url . '", ' . + 'response="' . $digest . '"' . + (!empty($challenge['opaque'])? + ', opaque="' . $challenge['opaque'] . '"': + '') . + (!empty($challenge['qop'])? + ', qop="auth", nc=' . $nc . ', cnonce="' . $challenge['cnonce'] . '"': + ''); + } + + /** + * Adds 'Authorization' header (if needed) to request headers array + * + * @param array request headers + * @param string request host (needed for digest authentication) + * @param string request URL (needed for digest authentication) + * @throws HTTP_Request2_Exception + */ + protected function addAuthorizationHeader(&$headers, $requestHost, $requestUrl) + { + if (!($auth = $this->request->getAuth())) { + return; + } + switch ($auth['scheme']) { + case HTTP_Request2::AUTH_BASIC: + $headers['authorization'] = + 'Basic ' . base64_encode($auth['user'] . ':' . $auth['password']); + break; + + case HTTP_Request2::AUTH_DIGEST: + unset($this->serverChallenge); + $fullUrl = ('/' == $requestUrl[0])? + $this->request->getUrl()->getScheme() . '://' . + $requestHost . $requestUrl: + $requestUrl; + foreach (array_keys(self::$challenges) as $key) { + if ($key == substr($fullUrl, 0, strlen($key))) { + $headers['authorization'] = $this->createDigestResponse( + $auth['user'], $auth['password'], + $requestUrl, self::$challenges[$key] + ); + $this->serverChallenge =& self::$challenges[$key]; + break; + } + } + break; + + default: + throw new HTTP_Request2_Exception( + "Unknown HTTP authentication scheme '{$auth['scheme']}'" + ); + } + } + + /** + * Adds 'Proxy-Authorization' header (if needed) to request headers array + * + * @param array request headers + * @param string request URL (needed for digest authentication) + * @throws HTTP_Request2_Exception + */ + protected function addProxyAuthorizationHeader(&$headers, $requestUrl) + { + if (!$this->request->getConfig('proxy_host') || + !($user = $this->request->getConfig('proxy_user')) || + (0 == strcasecmp('https', $this->request->getUrl()->getScheme()) && + HTTP_Request2::METHOD_CONNECT != $this->request->getMethod()) + ) { + return; + } + + $password = $this->request->getConfig('proxy_password'); + switch ($this->request->getConfig('proxy_auth_scheme')) { + case HTTP_Request2::AUTH_BASIC: + $headers['proxy-authorization'] = + 'Basic ' . base64_encode($user . ':' . $password); + break; + + case HTTP_Request2::AUTH_DIGEST: + unset($this->proxyChallenge); + $proxyUrl = 'proxy://' . $this->request->getConfig('proxy_host') . + ':' . $this->request->getConfig('proxy_port'); + if (!empty(self::$challenges[$proxyUrl])) { + $headers['proxy-authorization'] = $this->createDigestResponse( + $user, $password, + $requestUrl, self::$challenges[$proxyUrl] + ); + $this->proxyChallenge =& self::$challenges[$proxyUrl]; + } + break; + + default: + throw new HTTP_Request2_Exception( + "Unknown HTTP authentication scheme '" . + $this->request->getConfig('proxy_auth_scheme') . "'" + ); + } + } + + + /** + * Creates the string with the Request-Line and request headers + * + * @return string + * @throws HTTP_Request2_Exception + */ + protected function prepareHeaders() + { + $headers = $this->request->getHeaders(); + $url = $this->request->getUrl(); + $connect = HTTP_Request2::METHOD_CONNECT == $this->request->getMethod(); + $host = $url->getHost(); + + $defaultPort = 0 == strcasecmp($url->getScheme(), 'https')? 443: 80; + if (($port = $url->getPort()) && $port != $defaultPort || $connect) { + $host .= ':' . (empty($port)? $defaultPort: $port); + } + // Do not overwrite explicitly set 'Host' header, see bug #16146 + if (!isset($headers['host'])) { + $headers['host'] = $host; + } + + if ($connect) { + $requestUrl = $host; + + } else { + if (!$this->request->getConfig('proxy_host') || + 0 == strcasecmp($url->getScheme(), 'https') + ) { + $requestUrl = ''; + } else { + $requestUrl = $url->getScheme() . '://' . $host; + } + $path = $url->getPath(); + $query = $url->getQuery(); + $requestUrl .= (empty($path)? '/': $path) . (empty($query)? '': '?' . $query); + } + + if ('1.1' == $this->request->getConfig('protocol_version') && + extension_loaded('zlib') && !isset($headers['accept-encoding']) + ) { + $headers['accept-encoding'] = 'gzip, deflate'; + } + + $this->addAuthorizationHeader($headers, $host, $requestUrl); + $this->addProxyAuthorizationHeader($headers, $requestUrl); + $this->calculateRequestLength($headers); + + $headersStr = $this->request->getMethod() . ' ' . $requestUrl . ' HTTP/' . + $this->request->getConfig('protocol_version') . "\r\n"; + foreach ($headers as $name => $value) { + $canonicalName = implode('-', array_map('ucfirst', explode('-', $name))); + $headersStr .= $canonicalName . ': ' . $value . "\r\n"; + } + return $headersStr . "\r\n"; + } + + /** + * Sends the request body + * + * @throws HTTP_Request2_Exception + */ + protected function writeBody() + { + if (in_array($this->request->getMethod(), self::$bodyDisallowed) || + 0 == $this->contentLength + ) { + return; + } + + $position = 0; + $bufferSize = $this->request->getConfig('buffer_size'); + while ($position < $this->contentLength) { + if (is_string($this->requestBody)) { + $str = substr($this->requestBody, $position, $bufferSize); + } elseif (is_resource($this->requestBody)) { + $str = fread($this->requestBody, $bufferSize); + } else { + $str = $this->requestBody->read($bufferSize); + } + if (false === @fwrite($this->socket, $str, strlen($str))) { + throw new HTTP_Request2_Exception('Error writing request'); + } + // Provide the length of written string to the observer, request #7630 + $this->request->setLastEvent('sentBodyPart', strlen($str)); + $position += strlen($str); + } + } + + /** + * Reads the remote server's response + * + * @return HTTP_Request2_Response + * @throws HTTP_Request2_Exception + */ + protected function readResponse() + { + $bufferSize = $this->request->getConfig('buffer_size'); + + do { + $response = new HTTP_Request2_Response($this->readLine($bufferSize), true); + do { + $headerLine = $this->readLine($bufferSize); + $response->parseHeaderLine($headerLine); + } while ('' != $headerLine); + } while (in_array($response->getStatus(), array(100, 101))); + + $this->request->setLastEvent('receivedHeaders', $response); + + // No body possible in such responses + if (HTTP_Request2::METHOD_HEAD == $this->request->getMethod() || + (HTTP_Request2::METHOD_CONNECT == $this->request->getMethod() && + 200 <= $response->getStatus() && 300 > $response->getStatus()) || + in_array($response->getStatus(), array(204, 304)) + ) { + return $response; + } + + $chunked = 'chunked' == $response->getHeader('transfer-encoding'); + $length = $response->getHeader('content-length'); + $hasBody = false; + if ($chunked || null === $length || 0 < intval($length)) { + // RFC 2616, section 4.4: + // 3. ... If a message is received with both a + // Transfer-Encoding header field and a Content-Length header field, + // the latter MUST be ignored. + $toRead = ($chunked || null === $length)? null: $length; + $this->chunkLength = 0; + + while (!feof($this->socket) && (is_null($toRead) || 0 < $toRead)) { + if ($chunked) { + $data = $this->readChunked($bufferSize); + } elseif (is_null($toRead)) { + $data = $this->fread($bufferSize); + } else { + $data = $this->fread(min($toRead, $bufferSize)); + $toRead -= strlen($data); + } + if ('' == $data && (!$this->chunkLength || feof($this->socket))) { + break; + } + + $hasBody = true; + if ($this->request->getConfig('store_body')) { + $response->appendBody($data); + } + if (!in_array($response->getHeader('content-encoding'), array('identity', null))) { + $this->request->setLastEvent('receivedEncodedBodyPart', $data); + } else { + $this->request->setLastEvent('receivedBodyPart', $data); + } + } + } + + if ($hasBody) { + $this->request->setLastEvent('receivedBody', $response); + } + return $response; + } + + /** + * Reads until either the end of the socket or a newline, whichever comes first + * + * Strips the trailing newline from the returned data, handles global + * request timeout. Method idea borrowed from Net_Socket PEAR package. + * + * @param int buffer size to use for reading + * @return Available data up to the newline (not including newline) + * @throws HTTP_Request2_Exception In case of timeout + */ + protected function readLine($bufferSize) + { + $line = ''; + while (!feof($this->socket)) { + if ($this->deadline) { + stream_set_timeout($this->socket, max($this->deadline - time(), 1)); + } + $line .= @fgets($this->socket, $bufferSize); + $info = stream_get_meta_data($this->socket); + if ($info['timed_out'] || $this->deadline && time() > $this->deadline) { + $reason = $this->deadline + ? 'after ' . $this->request->getConfig('timeout') . ' second(s)' + : 'due to default_socket_timeout php.ini setting'; + throw new HTTP_Request2_Exception("Request timed out {$reason}"); + } + if (substr($line, -1) == "\n") { + return rtrim($line, "\r\n"); + } + } + return $line; + } + + /** + * Wrapper around fread(), handles global request timeout + * + * @param int Reads up to this number of bytes + * @return Data read from socket + * @throws HTTP_Request2_Exception In case of timeout + */ + protected function fread($length) + { + if ($this->deadline) { + stream_set_timeout($this->socket, max($this->deadline - time(), 1)); + } + $data = fread($this->socket, $length); + $info = stream_get_meta_data($this->socket); + if ($info['timed_out'] || $this->deadline && time() > $this->deadline) { + $reason = $this->deadline + ? 'after ' . $this->request->getConfig('timeout') . ' second(s)' + : 'due to default_socket_timeout php.ini setting'; + throw new HTTP_Request2_Exception("Request timed out {$reason}"); + } + return $data; + } + + /** + * Reads a part of response body encoded with chunked Transfer-Encoding + * + * @param int buffer size to use for reading + * @return string + * @throws HTTP_Request2_Exception + */ + protected function readChunked($bufferSize) + { + // at start of the next chunk? + if (0 == $this->chunkLength) { + $line = $this->readLine($bufferSize); + if (!preg_match('/^([0-9a-f]+)/i', $line, $matches)) { + throw new HTTP_Request2_Exception( + "Cannot decode chunked response, invalid chunk length '{$line}'" + ); + } else { + $this->chunkLength = hexdec($matches[1]); + // Chunk with zero length indicates the end + if (0 == $this->chunkLength) { + $this->readLine($bufferSize); + return ''; + } + } + } + $data = $this->fread(min($this->chunkLength, $bufferSize)); + $this->chunkLength -= strlen($data); + if (0 == $this->chunkLength) { + $this->readLine($bufferSize); // Trailing CRLF + } + return $data; + } +} + ?> \ No newline at end of file diff --git a/libs/PEAR.1.9/HTTP/Request2/Exception.php b/libs/PEAR.1.9/HTTP/Request2/Exception.php index 4109f89d0..2b960fc20 100644 --- a/libs/PEAR.1.9/HTTP/Request2/Exception.php +++ b/libs/PEAR.1.9/HTTP/Request2/Exception.php @@ -1,62 +1,62 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Exception.php 290192 2009-11-03 21:29:32Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Base class for exceptions in PEAR - */ -require_once 'PEAR/Exception.php'; - -/** - * Exception class for HTTP_Request2 package - * - * Such a class is required by the Exception RFC: - * http://pear.php.net/pepr/pepr-proposal-show.php?id=132 - * - * @category HTTP - * @package HTTP_Request2 - * @version Release: 0.5.2 - */ -class HTTP_Request2_Exception extends PEAR_Exception -{ -} + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: Exception.php 290192 2009-11-03 21:29:32Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * Base class for exceptions in PEAR + */ +require_once 'PEAR/Exception.php'; + +/** + * Exception class for HTTP_Request2 package + * + * Such a class is required by the Exception RFC: + * http://pear.php.net/pepr/pepr-proposal-show.php?id=132 + * + * @category HTTP + * @package HTTP_Request2 + * @version Release: 0.5.2 + */ +class HTTP_Request2_Exception extends PEAR_Exception +{ +} ?> \ No newline at end of file diff --git a/libs/PEAR.1.9/HTTP/Request2/MultipartBody.php b/libs/PEAR.1.9/HTTP/Request2/MultipartBody.php index e2cc547d1..f640de3e7 100644 --- a/libs/PEAR.1.9/HTTP/Request2/MultipartBody.php +++ b/libs/PEAR.1.9/HTTP/Request2/MultipartBody.php @@ -1,274 +1,274 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: MultipartBody.php 290192 2009-11-03 21:29:32Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Class for building multipart/form-data request body - * - * The class helps to reduce memory consumption by streaming large file uploads - * from disk, it also allows monitoring of upload progress (see request #7630) - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @version Release: 0.5.2 - * @link http://tools.ietf.org/html/rfc1867 - */ -class HTTP_Request2_MultipartBody -{ - /** - * MIME boundary - * @var string - */ - private $_boundary; - - /** - * Form parameters added via {@link HTTP_Request2::addPostParameter()} - * @var array - */ - private $_params = array(); - - /** - * File uploads added via {@link HTTP_Request2::addUpload()} - * @var array - */ - private $_uploads = array(); - - /** - * Header for parts with parameters - * @var string - */ - private $_headerParam = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n"; - - /** - * Header for parts with uploads - * @var string - */ - private $_headerUpload = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n"; - - /** - * Current position in parameter and upload arrays - * - * First number is index of "current" part, second number is position within - * "current" part - * - * @var array - */ - private $_pos = array(0, 0); - - - /** - * Constructor. Sets the arrays with POST data. - * - * @param array values of form fields set via {@link HTTP_Request2::addPostParameter()} - * @param array file uploads set via {@link HTTP_Request2::addUpload()} - * @param bool whether to append brackets to array variable names - */ - public function __construct(array $params, array $uploads, $useBrackets = true) - { - $this->_params = self::_flattenArray('', $params, $useBrackets); - foreach ($uploads as $fieldName => $f) { - if (!is_array($f['fp'])) { - $this->_uploads[] = $f + array('name' => $fieldName); - } else { - for ($i = 0; $i < count($f['fp']); $i++) { - $upload = array( - 'name' => ($useBrackets? $fieldName . '[' . $i . ']': $fieldName) - ); - foreach (array('fp', 'filename', 'size', 'type') as $key) { - $upload[$key] = $f[$key][$i]; - } - $this->_uploads[] = $upload; - } - } - } - } - - /** - * Returns the length of the body to use in Content-Length header - * - * @return integer - */ - public function getLength() - { - $boundaryLength = strlen($this->getBoundary()); - $headerParamLength = strlen($this->_headerParam) - 4 + $boundaryLength; - $headerUploadLength = strlen($this->_headerUpload) - 8 + $boundaryLength; - $length = $boundaryLength + 6; - foreach ($this->_params as $p) { - $length += $headerParamLength + strlen($p[0]) + strlen($p[1]) + 2; - } - foreach ($this->_uploads as $u) { - $length += $headerUploadLength + strlen($u['name']) + strlen($u['type']) + - strlen($u['filename']) + $u['size'] + 2; - } - return $length; - } - - /** - * Returns the boundary to use in Content-Type header - * - * @return string - */ - public function getBoundary() - { - if (empty($this->_boundary)) { - $this->_boundary = '--' . md5('PEAR-HTTP_Request2-' . microtime()); - } - return $this->_boundary; - } - - /** - * Returns next chunk of request body - * - * @param integer Amount of bytes to read - * @return string Up to $length bytes of data, empty string if at end - */ - public function read($length) - { - $ret = ''; - $boundary = $this->getBoundary(); - $paramCount = count($this->_params); - $uploadCount = count($this->_uploads); - while ($length > 0 && $this->_pos[0] <= $paramCount + $uploadCount) { - $oldLength = $length; - if ($this->_pos[0] < $paramCount) { - $param = sprintf($this->_headerParam, $boundary, - $this->_params[$this->_pos[0]][0]) . - $this->_params[$this->_pos[0]][1] . "\r\n"; - $ret .= substr($param, $this->_pos[1], $length); - $length -= min(strlen($param) - $this->_pos[1], $length); - - } elseif ($this->_pos[0] < $paramCount + $uploadCount) { - $pos = $this->_pos[0] - $paramCount; - $header = sprintf($this->_headerUpload, $boundary, - $this->_uploads[$pos]['name'], - $this->_uploads[$pos]['filename'], - $this->_uploads[$pos]['type']); - if ($this->_pos[1] < strlen($header)) { - $ret .= substr($header, $this->_pos[1], $length); - $length -= min(strlen($header) - $this->_pos[1], $length); - } - $filePos = max(0, $this->_pos[1] - strlen($header)); - if ($length > 0 && $filePos < $this->_uploads[$pos]['size']) { - $ret .= fread($this->_uploads[$pos]['fp'], $length); - $length -= min($length, $this->_uploads[$pos]['size'] - $filePos); - } - if ($length > 0) { - $start = $this->_pos[1] + ($oldLength - $length) - - strlen($header) - $this->_uploads[$pos]['size']; - $ret .= substr("\r\n", $start, $length); - $length -= min(2 - $start, $length); - } - - } else { - $closing = '--' . $boundary . "--\r\n"; - $ret .= substr($closing, $this->_pos[1], $length); - $length -= min(strlen($closing) - $this->_pos[1], $length); - } - if ($length > 0) { - $this->_pos = array($this->_pos[0] + 1, 0); - } else { - $this->_pos[1] += $oldLength; - } - } - return $ret; - } - - /** - * Sets the current position to the start of the body - * - * This allows reusing the same body in another request - */ - public function rewind() - { - $this->_pos = array(0, 0); - foreach ($this->_uploads as $u) { - rewind($u['fp']); - } - } - - /** - * Returns the body as string - * - * Note that it reads all file uploads into memory so it is a good idea not - * to use this method with large file uploads and rely on read() instead. - * - * @return string - */ - public function __toString() - { - $this->rewind(); - return $this->read($this->getLength()); - } - - - /** - * Helper function to change the (probably multidimensional) associative array - * into the simple one. - * - * @param string name for item - * @param mixed item's values - * @param bool whether to append [] to array variables' names - * @return array array with the following items: array('item name', 'item value'); - */ - private static function _flattenArray($name, $values, $useBrackets) - { - if (!is_array($values)) { - return array(array($name, $values)); - } else { - $ret = array(); - foreach ($values as $k => $v) { - if (empty($name)) { - $newName = $k; - } elseif ($useBrackets) { - $newName = $name . '[' . $k . ']'; - } else { - $newName = $name; - } - $ret = array_merge($ret, self::_flattenArray($newName, $v, $useBrackets)); - } - return $ret; - } - } -} -?> + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: MultipartBody.php 290192 2009-11-03 21:29:32Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * Class for building multipart/form-data request body + * + * The class helps to reduce memory consumption by streaming large file uploads + * from disk, it also allows monitoring of upload progress (see request #7630) + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @version Release: 0.5.2 + * @link http://tools.ietf.org/html/rfc1867 + */ +class HTTP_Request2_MultipartBody +{ + /** + * MIME boundary + * @var string + */ + private $_boundary; + + /** + * Form parameters added via {@link HTTP_Request2::addPostParameter()} + * @var array + */ + private $_params = array(); + + /** + * File uploads added via {@link HTTP_Request2::addUpload()} + * @var array + */ + private $_uploads = array(); + + /** + * Header for parts with parameters + * @var string + */ + private $_headerParam = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n"; + + /** + * Header for parts with uploads + * @var string + */ + private $_headerUpload = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n"; + + /** + * Current position in parameter and upload arrays + * + * First number is index of "current" part, second number is position within + * "current" part + * + * @var array + */ + private $_pos = array(0, 0); + + + /** + * Constructor. Sets the arrays with POST data. + * + * @param array values of form fields set via {@link HTTP_Request2::addPostParameter()} + * @param array file uploads set via {@link HTTP_Request2::addUpload()} + * @param bool whether to append brackets to array variable names + */ + public function __construct(array $params, array $uploads, $useBrackets = true) + { + $this->_params = self::_flattenArray('', $params, $useBrackets); + foreach ($uploads as $fieldName => $f) { + if (!is_array($f['fp'])) { + $this->_uploads[] = $f + array('name' => $fieldName); + } else { + for ($i = 0; $i < count($f['fp']); $i++) { + $upload = array( + 'name' => ($useBrackets? $fieldName . '[' . $i . ']': $fieldName) + ); + foreach (array('fp', 'filename', 'size', 'type') as $key) { + $upload[$key] = $f[$key][$i]; + } + $this->_uploads[] = $upload; + } + } + } + } + + /** + * Returns the length of the body to use in Content-Length header + * + * @return integer + */ + public function getLength() + { + $boundaryLength = strlen($this->getBoundary()); + $headerParamLength = strlen($this->_headerParam) - 4 + $boundaryLength; + $headerUploadLength = strlen($this->_headerUpload) - 8 + $boundaryLength; + $length = $boundaryLength + 6; + foreach ($this->_params as $p) { + $length += $headerParamLength + strlen($p[0]) + strlen($p[1]) + 2; + } + foreach ($this->_uploads as $u) { + $length += $headerUploadLength + strlen($u['name']) + strlen($u['type']) + + strlen($u['filename']) + $u['size'] + 2; + } + return $length; + } + + /** + * Returns the boundary to use in Content-Type header + * + * @return string + */ + public function getBoundary() + { + if (empty($this->_boundary)) { + $this->_boundary = '--' . md5('PEAR-HTTP_Request2-' . microtime()); + } + return $this->_boundary; + } + + /** + * Returns next chunk of request body + * + * @param integer Amount of bytes to read + * @return string Up to $length bytes of data, empty string if at end + */ + public function read($length) + { + $ret = ''; + $boundary = $this->getBoundary(); + $paramCount = count($this->_params); + $uploadCount = count($this->_uploads); + while ($length > 0 && $this->_pos[0] <= $paramCount + $uploadCount) { + $oldLength = $length; + if ($this->_pos[0] < $paramCount) { + $param = sprintf($this->_headerParam, $boundary, + $this->_params[$this->_pos[0]][0]) . + $this->_params[$this->_pos[0]][1] . "\r\n"; + $ret .= substr($param, $this->_pos[1], $length); + $length -= min(strlen($param) - $this->_pos[1], $length); + + } elseif ($this->_pos[0] < $paramCount + $uploadCount) { + $pos = $this->_pos[0] - $paramCount; + $header = sprintf($this->_headerUpload, $boundary, + $this->_uploads[$pos]['name'], + $this->_uploads[$pos]['filename'], + $this->_uploads[$pos]['type']); + if ($this->_pos[1] < strlen($header)) { + $ret .= substr($header, $this->_pos[1], $length); + $length -= min(strlen($header) - $this->_pos[1], $length); + } + $filePos = max(0, $this->_pos[1] - strlen($header)); + if ($length > 0 && $filePos < $this->_uploads[$pos]['size']) { + $ret .= fread($this->_uploads[$pos]['fp'], $length); + $length -= min($length, $this->_uploads[$pos]['size'] - $filePos); + } + if ($length > 0) { + $start = $this->_pos[1] + ($oldLength - $length) - + strlen($header) - $this->_uploads[$pos]['size']; + $ret .= substr("\r\n", $start, $length); + $length -= min(2 - $start, $length); + } + + } else { + $closing = '--' . $boundary . "--\r\n"; + $ret .= substr($closing, $this->_pos[1], $length); + $length -= min(strlen($closing) - $this->_pos[1], $length); + } + if ($length > 0) { + $this->_pos = array($this->_pos[0] + 1, 0); + } else { + $this->_pos[1] += $oldLength; + } + } + return $ret; + } + + /** + * Sets the current position to the start of the body + * + * This allows reusing the same body in another request + */ + public function rewind() + { + $this->_pos = array(0, 0); + foreach ($this->_uploads as $u) { + rewind($u['fp']); + } + } + + /** + * Returns the body as string + * + * Note that it reads all file uploads into memory so it is a good idea not + * to use this method with large file uploads and rely on read() instead. + * + * @return string + */ + public function __toString() + { + $this->rewind(); + return $this->read($this->getLength()); + } + + + /** + * Helper function to change the (probably multidimensional) associative array + * into the simple one. + * + * @param string name for item + * @param mixed item's values + * @param bool whether to append [] to array variables' names + * @return array array with the following items: array('item name', 'item value'); + */ + private static function _flattenArray($name, $values, $useBrackets) + { + if (!is_array($values)) { + return array(array($name, $values)); + } else { + $ret = array(); + foreach ($values as $k => $v) { + if (empty($name)) { + $newName = $k; + } elseif ($useBrackets) { + $newName = $name . '[' . $k . ']'; + } else { + $newName = $name; + } + $ret = array_merge($ret, self::_flattenArray($newName, $v, $useBrackets)); + } + return $ret; + } + } +} +?> diff --git a/libs/PEAR.1.9/HTTP/Request2/Observer/Log.php b/libs/PEAR.1.9/HTTP/Request2/Observer/Log.php index add4a2ff0..7df821ef4 100644 --- a/libs/PEAR.1.9/HTTP/Request2/Observer/Log.php +++ b/libs/PEAR.1.9/HTTP/Request2/Observer/Log.php @@ -1,215 +1,215 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author David Jean Louis - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Log.php 293416 2010-01-11 18:06:15Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Exception class for HTTP_Request2 package - */ -require_once 'HTTP/Request2/Exception.php'; - -/** - * A debug observer useful for debugging / testing. - * - * This observer logs to a log target data corresponding to the various request - * and response events, it logs by default to php://output but can be configured - * to log to a file or via the PEAR Log package. - * - * A simple example: - * - * require_once 'HTTP/Request2.php'; - * require_once 'HTTP/Request2/Observer/Log.php'; - * - * $request = new HTTP_Request2('http://www.example.com'); - * $observer = new HTTP_Request2_Observer_Log(); - * $request->attach($observer); - * $request->send(); - * - * - * A more complex example with PEAR Log: - * - * require_once 'HTTP/Request2.php'; - * require_once 'HTTP/Request2/Observer/Log.php'; - * require_once 'Log.php'; - * - * $request = new HTTP_Request2('http://www.example.com'); - * // we want to log with PEAR log - * $observer = new HTTP_Request2_Observer_Log(Log::factory('console')); - * - * // we only want to log received headers - * $observer->events = array('receivedHeaders'); - * - * $request->attach($observer); - * $request->send(); - * - * - * @category HTTP - * @package HTTP_Request2 - * @author David Jean Louis - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version Release: 0.5.2 - * @link http://pear.php.net/package/HTTP_Request2 - */ -class HTTP_Request2_Observer_Log implements SplObserver -{ - // properties {{{ - - /** - * The log target, it can be a a resource or a PEAR Log instance. - * - * @var resource|Log $target - */ - protected $target = null; - - /** - * The events to log. - * - * @var array $events - */ - public $events = array( - 'connect', - 'sentHeaders', - 'sentBodyPart', - 'receivedHeaders', - 'receivedBody', - 'disconnect', - ); - - // }}} - // __construct() {{{ - - /** - * Constructor. - * - * @param mixed $target Can be a file path (default: php://output), a resource, - * or an instance of the PEAR Log class. - * @param array $events Array of events to listen to (default: all events) - * - * @return void - */ - public function __construct($target = 'php://output', array $events = array()) - { - if (!empty($events)) { - $this->events = $events; - } - if (is_resource($target) || $target instanceof Log) { - $this->target = $target; - } elseif (false === ($this->target = @fopen($target, 'ab'))) { - throw new HTTP_Request2_Exception("Unable to open '{$target}'"); - } - } - - // }}} - // update() {{{ - - /** - * Called when the request notifies us of an event. - * - * @param HTTP_Request2 $subject The HTTP_Request2 instance - * - * @return void - */ - public function update(SplSubject $subject) - { - $event = $subject->getLastEvent(); - if (!in_array($event['name'], $this->events)) { - return; - } - - switch ($event['name']) { - case 'connect': - $this->log('* Connected to ' . $event['data']); - break; - case 'sentHeaders': - $headers = explode("\r\n", $event['data']); - array_pop($headers); - foreach ($headers as $header) { - $this->log('> ' . $header); - } - break; - case 'sentBodyPart': - $this->log('> ' . $event['data'] . ' byte(s) sent'); - break; - case 'receivedHeaders': - $this->log(sprintf('< HTTP/%s %s %s', - $event['data']->getVersion(), - $event['data']->getStatus(), - $event['data']->getReasonPhrase())); - $headers = $event['data']->getHeader(); - foreach ($headers as $key => $val) { - $this->log('< ' . $key . ': ' . $val); - } - $this->log('< '); - break; - case 'receivedBody': - $this->log($event['data']->getBody()); - break; - case 'disconnect': - $this->log('* Disconnected'); - break; - } - } - - // }}} - // log() {{{ - - /** - * Logs the given message to the configured target. - * - * @param string $message Message to display - * - * @return void - */ - protected function log($message) - { - if ($this->target instanceof Log) { - $this->target->debug($message); - } elseif (is_resource($this->target)) { - fwrite($this->target, $message . "\r\n"); - } - } - - // }}} -} - + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author David Jean Louis + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: Log.php 293416 2010-01-11 18:06:15Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * Exception class for HTTP_Request2 package + */ +require_once 'HTTP/Request2/Exception.php'; + +/** + * A debug observer useful for debugging / testing. + * + * This observer logs to a log target data corresponding to the various request + * and response events, it logs by default to php://output but can be configured + * to log to a file or via the PEAR Log package. + * + * A simple example: + * + * require_once 'HTTP/Request2.php'; + * require_once 'HTTP/Request2/Observer/Log.php'; + * + * $request = new HTTP_Request2('http://www.example.com'); + * $observer = new HTTP_Request2_Observer_Log(); + * $request->attach($observer); + * $request->send(); + * + * + * A more complex example with PEAR Log: + * + * require_once 'HTTP/Request2.php'; + * require_once 'HTTP/Request2/Observer/Log.php'; + * require_once 'Log.php'; + * + * $request = new HTTP_Request2('http://www.example.com'); + * // we want to log with PEAR log + * $observer = new HTTP_Request2_Observer_Log(Log::factory('console')); + * + * // we only want to log received headers + * $observer->events = array('receivedHeaders'); + * + * $request->attach($observer); + * $request->send(); + * + * + * @category HTTP + * @package HTTP_Request2 + * @author David Jean Louis + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version Release: 0.5.2 + * @link http://pear.php.net/package/HTTP_Request2 + */ +class HTTP_Request2_Observer_Log implements SplObserver +{ + // properties {{{ + + /** + * The log target, it can be a a resource or a PEAR Log instance. + * + * @var resource|Log $target + */ + protected $target = null; + + /** + * The events to log. + * + * @var array $events + */ + public $events = array( + 'connect', + 'sentHeaders', + 'sentBodyPart', + 'receivedHeaders', + 'receivedBody', + 'disconnect', + ); + + // }}} + // __construct() {{{ + + /** + * Constructor. + * + * @param mixed $target Can be a file path (default: php://output), a resource, + * or an instance of the PEAR Log class. + * @param array $events Array of events to listen to (default: all events) + * + * @return void + */ + public function __construct($target = 'php://output', array $events = array()) + { + if (!empty($events)) { + $this->events = $events; + } + if (is_resource($target) || $target instanceof Log) { + $this->target = $target; + } elseif (false === ($this->target = @fopen($target, 'ab'))) { + throw new HTTP_Request2_Exception("Unable to open '{$target}'"); + } + } + + // }}} + // update() {{{ + + /** + * Called when the request notifies us of an event. + * + * @param HTTP_Request2 $subject The HTTP_Request2 instance + * + * @return void + */ + public function update(SplSubject $subject) + { + $event = $subject->getLastEvent(); + if (!in_array($event['name'], $this->events)) { + return; + } + + switch ($event['name']) { + case 'connect': + $this->log('* Connected to ' . $event['data']); + break; + case 'sentHeaders': + $headers = explode("\r\n", $event['data']); + array_pop($headers); + foreach ($headers as $header) { + $this->log('> ' . $header); + } + break; + case 'sentBodyPart': + $this->log('> ' . $event['data'] . ' byte(s) sent'); + break; + case 'receivedHeaders': + $this->log(sprintf('< HTTP/%s %s %s', + $event['data']->getVersion(), + $event['data']->getStatus(), + $event['data']->getReasonPhrase())); + $headers = $event['data']->getHeader(); + foreach ($headers as $key => $val) { + $this->log('< ' . $key . ': ' . $val); + } + $this->log('< '); + break; + case 'receivedBody': + $this->log($event['data']->getBody()); + break; + case 'disconnect': + $this->log('* Disconnected'); + break; + } + } + + // }}} + // log() {{{ + + /** + * Logs the given message to the configured target. + * + * @param string $message Message to display + * + * @return void + */ + protected function log($message) + { + if ($this->target instanceof Log) { + $this->target->debug($message); + } elseif (is_resource($this->target)) { + fwrite($this->target, $message . "\r\n"); + } + } + + // }}} +} + ?> \ No newline at end of file diff --git a/libs/PEAR.1.9/HTTP/Request2/Response.php b/libs/PEAR.1.9/HTTP/Request2/Response.php index 30679c880..f27ea51f4 100644 --- a/libs/PEAR.1.9/HTTP/Request2/Response.php +++ b/libs/PEAR.1.9/HTTP/Request2/Response.php @@ -1,559 +1,559 @@ - - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * The names of the authors may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version SVN: $Id: Response.php 290520 2009-11-11 20:09:42Z avb $ - * @link http://pear.php.net/package/HTTP_Request2 - */ - -/** - * Exception class for HTTP_Request2 package - */ -require_once 'HTTP/Request2/Exception.php'; - -/** - * Class representing a HTTP response - * - * The class is designed to be used in "streaming" scenario, building the - * response as it is being received: - * - * $statusLine = read_status_line(); - * $response = new HTTP_Request2_Response($statusLine); - * do { - * $headerLine = read_header_line(); - * $response->parseHeaderLine($headerLine); - * } while ($headerLine != ''); - * - * while ($chunk = read_body()) { - * $response->appendBody($chunk); - * } - * - * var_dump($response->getHeader(), $response->getCookies(), $response->getBody()); - * - * - * - * @category HTTP - * @package HTTP_Request2 - * @author Alexey Borzov - * @version Release: 0.5.2 - * @link http://tools.ietf.org/html/rfc2616#section-6 - */ -class HTTP_Request2_Response -{ - /** - * HTTP protocol version (e.g. 1.0, 1.1) - * @var string - */ - protected $version; - - /** - * Status code - * @var integer - * @link http://tools.ietf.org/html/rfc2616#section-6.1.1 - */ - protected $code; - - /** - * Reason phrase - * @var string - * @link http://tools.ietf.org/html/rfc2616#section-6.1.1 - */ - protected $reasonPhrase; - - /** - * Associative array of response headers - * @var array - */ - protected $headers = array(); - - /** - * Cookies set in the response - * @var array - */ - protected $cookies = array(); - - /** - * Name of last header processed by parseHederLine() - * - * Used to handle the headers that span multiple lines - * - * @var string - */ - protected $lastHeader = null; - - /** - * Response body - * @var string - */ - protected $body = ''; - - /** - * Whether the body is still encoded by Content-Encoding - * - * cURL provides the decoded body to the callback; if we are reading from - * socket the body is still gzipped / deflated - * - * @var bool - */ - protected $bodyEncoded; - - /** - * Associative array of HTTP status code / reason phrase. - * - * @var array - * @link http://tools.ietf.org/html/rfc2616#section-10 - */ - protected static $phrases = array( - - // 1xx: Informational - Request received, continuing process - 100 => 'Continue', - 101 => 'Switching Protocols', - - // 2xx: Success - The action was successfully received, understood and - // accepted - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - - // 3xx: Redirection - Further action must be taken in order to complete - // the request - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', // 1.1 - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 307 => 'Temporary Redirect', - - // 4xx: Client Error - The request contains bad syntax or cannot be - // fulfilled - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Long', - 415 => 'Unsupported Media Type', - 416 => 'Requested Range Not Satisfiable', - 417 => 'Expectation Failed', - - // 5xx: Server Error - The server failed to fulfill an apparently - // valid request - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Timeout', - 505 => 'HTTP Version Not Supported', - 509 => 'Bandwidth Limit Exceeded', - - ); - - /** - * Constructor, parses the response status line - * - * @param string Response status line (e.g. "HTTP/1.1 200 OK") - * @param bool Whether body is still encoded by Content-Encoding - * @throws HTTP_Request2_Exception if status line is invalid according to spec - */ - public function __construct($statusLine, $bodyEncoded = true) - { - if (!preg_match('!^HTTP/(\d\.\d) (\d{3})(?: (.+))?!', $statusLine, $m)) { - throw new HTTP_Request2_Exception("Malformed response: {$statusLine}"); - } - $this->version = $m[1]; - $this->code = intval($m[2]); - if (!empty($m[3])) { - $this->reasonPhrase = trim($m[3]); - } elseif (!empty(self::$phrases[$this->code])) { - $this->reasonPhrase = self::$phrases[$this->code]; - } - $this->bodyEncoded = (bool)$bodyEncoded; - } - - /** - * Parses the line from HTTP response filling $headers array - * - * The method should be called after reading the line from socket or receiving - * it into cURL callback. Passing an empty string here indicates the end of - * response headers and triggers additional processing, so be sure to pass an - * empty string in the end. - * - * @param string Line from HTTP response - */ - public function parseHeaderLine($headerLine) - { - $headerLine = trim($headerLine, "\r\n"); - - // empty string signals the end of headers, process the received ones - if ('' == $headerLine) { - if (!empty($this->headers['set-cookie'])) { - $cookies = is_array($this->headers['set-cookie'])? - $this->headers['set-cookie']: - array($this->headers['set-cookie']); - foreach ($cookies as $cookieString) { - $this->parseCookie($cookieString); - } - unset($this->headers['set-cookie']); - } - foreach (array_keys($this->headers) as $k) { - if (is_array($this->headers[$k])) { - $this->headers[$k] = implode(', ', $this->headers[$k]); - } - } - - // string of the form header-name: header value - } elseif (preg_match('!^([^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+):(.+)$!', $headerLine, $m)) { - $name = strtolower($m[1]); - $value = trim($m[2]); - if (empty($this->headers[$name])) { - $this->headers[$name] = $value; - } else { - if (!is_array($this->headers[$name])) { - $this->headers[$name] = array($this->headers[$name]); - } - $this->headers[$name][] = $value; - } - $this->lastHeader = $name; - - // continuation of a previous header - } elseif (preg_match('!^\s+(.+)$!', $headerLine, $m) && $this->lastHeader) { - if (!is_array($this->headers[$this->lastHeader])) { - $this->headers[$this->lastHeader] .= ' ' . trim($m[1]); - } else { - $key = count($this->headers[$this->lastHeader]) - 1; - $this->headers[$this->lastHeader][$key] .= ' ' . trim($m[1]); - } - } - } - - /** - * Parses a Set-Cookie header to fill $cookies array - * - * @param string value of Set-Cookie header - * @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html - */ - protected function parseCookie($cookieString) - { - $cookie = array( - 'expires' => null, - 'domain' => null, - 'path' => null, - 'secure' => false - ); - - // Only a name=value pair - if (!strpos($cookieString, ';')) { - $pos = strpos($cookieString, '='); - $cookie['name'] = trim(substr($cookieString, 0, $pos)); - $cookie['value'] = trim(substr($cookieString, $pos + 1)); - - // Some optional parameters are supplied - } else { - $elements = explode(';', $cookieString); - $pos = strpos($elements[0], '='); - $cookie['name'] = trim(substr($elements[0], 0, $pos)); - $cookie['value'] = trim(substr($elements[0], $pos + 1)); - - for ($i = 1; $i < count($elements); $i++) { - if (false === strpos($elements[$i], '=')) { - $elName = trim($elements[$i]); - $elValue = null; - } else { - list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i])); - } - $elName = strtolower($elName); - if ('secure' == $elName) { - $cookie['secure'] = true; - } elseif ('expires' == $elName) { - $cookie['expires'] = str_replace('"', '', $elValue); - } elseif ('path' == $elName || 'domain' == $elName) { - $cookie[$elName] = urldecode($elValue); - } else { - $cookie[$elName] = $elValue; - } - } - } - $this->cookies[] = $cookie; - } - - /** - * Appends a string to the response body - * @param string - */ - public function appendBody($bodyChunk) - { - $this->body .= $bodyChunk; - } - - /** - * Returns the status code - * @return integer - */ - public function getStatus() - { - return $this->code; - } - - /** - * Returns the reason phrase - * @return string - */ - public function getReasonPhrase() - { - return $this->reasonPhrase; - } - - /** - * Whether response is a redirect that can be automatically handled by HTTP_Request2 - * @return bool - */ - public function isRedirect() - { - return in_array($this->code, array(300, 301, 302, 303, 307)) - && isset($this->headers['location']); - } - - /** - * Returns either the named header or all response headers - * - * @param string Name of header to return - * @return string|array Value of $headerName header (null if header is - * not present), array of all response headers if - * $headerName is null - */ - public function getHeader($headerName = null) - { - if (null === $headerName) { - return $this->headers; - } else { - $headerName = strtolower($headerName); - return isset($this->headers[$headerName])? $this->headers[$headerName]: null; - } - } - - /** - * Returns cookies set in response - * - * @return array - */ - public function getCookies() - { - return $this->cookies; - } - - /** - * Returns the body of the response - * - * @return string - * @throws HTTP_Request2_Exception if body cannot be decoded - */ - public function getBody() - { - if (!$this->bodyEncoded || - !in_array(strtolower($this->getHeader('content-encoding')), array('gzip', 'deflate')) - ) { - return $this->body; - - } else { - if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) { - $oldEncoding = mb_internal_encoding(); - mb_internal_encoding('iso-8859-1'); - } - - try { - switch (strtolower($this->getHeader('content-encoding'))) { - case 'gzip': - $decoded = self::decodeGzip($this->body); - break; - case 'deflate': - $decoded = self::decodeDeflate($this->body); - } - } catch (Exception $e) { - } - - if (!empty($oldEncoding)) { - mb_internal_encoding($oldEncoding); - } - if (!empty($e)) { - throw $e; - } - return $decoded; - } - } - - /** - * Get the HTTP version of the response - * - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Decodes the message-body encoded by gzip - * - * The real decoding work is done by gzinflate() built-in function, this - * method only parses the header and checks data for compliance with - * RFC 1952 - * - * @param string gzip-encoded data - * @return string decoded data - * @throws HTTP_Request2_Exception - * @link http://tools.ietf.org/html/rfc1952 - */ - public static function decodeGzip($data) - { - $length = strlen($data); - // If it doesn't look like gzip-encoded data, don't bother - if (18 > $length || strcmp(substr($data, 0, 2), "\x1f\x8b")) { - return $data; - } - if (!function_exists('gzinflate')) { - throw new HTTP_Request2_Exception('Unable to decode body: gzip extension not available'); - } - $method = ord(substr($data, 2, 1)); - if (8 != $method) { - throw new HTTP_Request2_Exception('Error parsing gzip header: unknown compression method'); - } - $flags = ord(substr($data, 3, 1)); - if ($flags & 224) { - throw new HTTP_Request2_Exception('Error parsing gzip header: reserved bits are set'); - } - - // header is 10 bytes minimum. may be longer, though. - $headerLength = 10; - // extra fields, need to skip 'em - if ($flags & 4) { - if ($length - $headerLength - 2 < 8) { - throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); - } - $extraLength = unpack('v', substr($data, 10, 2)); - if ($length - $headerLength - 2 - $extraLength[1] < 8) { - throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); - } - $headerLength += $extraLength[1] + 2; - } - // file name, need to skip that - if ($flags & 8) { - if ($length - $headerLength - 1 < 8) { - throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); - } - $filenameLength = strpos(substr($data, $headerLength), chr(0)); - if (false === $filenameLength || $length - $headerLength - $filenameLength - 1 < 8) { - throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); - } - $headerLength += $filenameLength + 1; - } - // comment, need to skip that also - if ($flags & 16) { - if ($length - $headerLength - 1 < 8) { - throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); - } - $commentLength = strpos(substr($data, $headerLength), chr(0)); - if (false === $commentLength || $length - $headerLength - $commentLength - 1 < 8) { - throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); - } - $headerLength += $commentLength + 1; - } - // have a CRC for header. let's check - if ($flags & 2) { - if ($length - $headerLength - 2 < 8) { - throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); - } - $crcReal = 0xffff & crc32(substr($data, 0, $headerLength)); - $crcStored = unpack('v', substr($data, $headerLength, 2)); - if ($crcReal != $crcStored[1]) { - throw new HTTP_Request2_Exception('Header CRC check failed'); - } - $headerLength += 2; - } - // unpacked data CRC and size at the end of encoded data - $tmp = unpack('V2', substr($data, -8)); - $dataCrc = $tmp[1]; - $dataSize = $tmp[2]; - - // finally, call the gzinflate() function - // don't pass $dataSize to gzinflate, see bugs #13135, #14370 - $unpacked = gzinflate(substr($data, $headerLength, -8)); - if (false === $unpacked) { - throw new HTTP_Request2_Exception('gzinflate() call failed'); - } elseif ($dataSize != strlen($unpacked)) { - throw new HTTP_Request2_Exception('Data size check failed'); - } elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) { - throw new HTTP_Request2_Exception('Data CRC check failed'); - } - return $unpacked; - } - - /** - * Decodes the message-body encoded by deflate - * - * @param string deflate-encoded data - * @return string decoded data - * @throws HTTP_Request2_Exception - */ - public static function decodeDeflate($data) - { - if (!function_exists('gzuncompress')) { - throw new HTTP_Request2_Exception('Unable to decode body: gzip extension not available'); - } - // RFC 2616 defines 'deflate' encoding as zlib format from RFC 1950, - // while many applications send raw deflate stream from RFC 1951. - // We should check for presence of zlib header and use gzuncompress() or - // gzinflate() as needed. See bug #15305 - $header = unpack('n', substr($data, 0, 2)); - return (0 == $header[1] % 31)? gzuncompress($data): gzinflate($data); - } -} + + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * The names of the authors may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version SVN: $Id: Response.php 290520 2009-11-11 20:09:42Z avb $ + * @link http://pear.php.net/package/HTTP_Request2 + */ + +/** + * Exception class for HTTP_Request2 package + */ +require_once 'HTTP/Request2/Exception.php'; + +/** + * Class representing a HTTP response + * + * The class is designed to be used in "streaming" scenario, building the + * response as it is being received: + * + * $statusLine = read_status_line(); + * $response = new HTTP_Request2_Response($statusLine); + * do { + * $headerLine = read_header_line(); + * $response->parseHeaderLine($headerLine); + * } while ($headerLine != ''); + * + * while ($chunk = read_body()) { + * $response->appendBody($chunk); + * } + * + * var_dump($response->getHeader(), $response->getCookies(), $response->getBody()); + * + * + * + * @category HTTP + * @package HTTP_Request2 + * @author Alexey Borzov + * @version Release: 0.5.2 + * @link http://tools.ietf.org/html/rfc2616#section-6 + */ +class HTTP_Request2_Response +{ + /** + * HTTP protocol version (e.g. 1.0, 1.1) + * @var string + */ + protected $version; + + /** + * Status code + * @var integer + * @link http://tools.ietf.org/html/rfc2616#section-6.1.1 + */ + protected $code; + + /** + * Reason phrase + * @var string + * @link http://tools.ietf.org/html/rfc2616#section-6.1.1 + */ + protected $reasonPhrase; + + /** + * Associative array of response headers + * @var array + */ + protected $headers = array(); + + /** + * Cookies set in the response + * @var array + */ + protected $cookies = array(); + + /** + * Name of last header processed by parseHederLine() + * + * Used to handle the headers that span multiple lines + * + * @var string + */ + protected $lastHeader = null; + + /** + * Response body + * @var string + */ + protected $body = ''; + + /** + * Whether the body is still encoded by Content-Encoding + * + * cURL provides the decoded body to the callback; if we are reading from + * socket the body is still gzipped / deflated + * + * @var bool + */ + protected $bodyEncoded; + + /** + * Associative array of HTTP status code / reason phrase. + * + * @var array + * @link http://tools.ietf.org/html/rfc2616#section-10 + */ + protected static $phrases = array( + + // 1xx: Informational - Request received, continuing process + 100 => 'Continue', + 101 => 'Switching Protocols', + + // 2xx: Success - The action was successfully received, understood and + // accepted + 200 => 'OK', + 201 => 'Created', + 202 => 'Accepted', + 203 => 'Non-Authoritative Information', + 204 => 'No Content', + 205 => 'Reset Content', + 206 => 'Partial Content', + + // 3xx: Redirection - Further action must be taken in order to complete + // the request + 300 => 'Multiple Choices', + 301 => 'Moved Permanently', + 302 => 'Found', // 1.1 + 303 => 'See Other', + 304 => 'Not Modified', + 305 => 'Use Proxy', + 307 => 'Temporary Redirect', + + // 4xx: Client Error - The request contains bad syntax or cannot be + // fulfilled + 400 => 'Bad Request', + 401 => 'Unauthorized', + 402 => 'Payment Required', + 403 => 'Forbidden', + 404 => 'Not Found', + 405 => 'Method Not Allowed', + 406 => 'Not Acceptable', + 407 => 'Proxy Authentication Required', + 408 => 'Request Timeout', + 409 => 'Conflict', + 410 => 'Gone', + 411 => 'Length Required', + 412 => 'Precondition Failed', + 413 => 'Request Entity Too Large', + 414 => 'Request-URI Too Long', + 415 => 'Unsupported Media Type', + 416 => 'Requested Range Not Satisfiable', + 417 => 'Expectation Failed', + + // 5xx: Server Error - The server failed to fulfill an apparently + // valid request + 500 => 'Internal Server Error', + 501 => 'Not Implemented', + 502 => 'Bad Gateway', + 503 => 'Service Unavailable', + 504 => 'Gateway Timeout', + 505 => 'HTTP Version Not Supported', + 509 => 'Bandwidth Limit Exceeded', + + ); + + /** + * Constructor, parses the response status line + * + * @param string Response status line (e.g. "HTTP/1.1 200 OK") + * @param bool Whether body is still encoded by Content-Encoding + * @throws HTTP_Request2_Exception if status line is invalid according to spec + */ + public function __construct($statusLine, $bodyEncoded = true) + { + if (!preg_match('!^HTTP/(\d\.\d) (\d{3})(?: (.+))?!', $statusLine, $m)) { + throw new HTTP_Request2_Exception("Malformed response: {$statusLine}"); + } + $this->version = $m[1]; + $this->code = intval($m[2]); + if (!empty($m[3])) { + $this->reasonPhrase = trim($m[3]); + } elseif (!empty(self::$phrases[$this->code])) { + $this->reasonPhrase = self::$phrases[$this->code]; + } + $this->bodyEncoded = (bool)$bodyEncoded; + } + + /** + * Parses the line from HTTP response filling $headers array + * + * The method should be called after reading the line from socket or receiving + * it into cURL callback. Passing an empty string here indicates the end of + * response headers and triggers additional processing, so be sure to pass an + * empty string in the end. + * + * @param string Line from HTTP response + */ + public function parseHeaderLine($headerLine) + { + $headerLine = trim($headerLine, "\r\n"); + + // empty string signals the end of headers, process the received ones + if ('' == $headerLine) { + if (!empty($this->headers['set-cookie'])) { + $cookies = is_array($this->headers['set-cookie'])? + $this->headers['set-cookie']: + array($this->headers['set-cookie']); + foreach ($cookies as $cookieString) { + $this->parseCookie($cookieString); + } + unset($this->headers['set-cookie']); + } + foreach (array_keys($this->headers) as $k) { + if (is_array($this->headers[$k])) { + $this->headers[$k] = implode(', ', $this->headers[$k]); + } + } + + // string of the form header-name: header value + } elseif (preg_match('!^([^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+):(.+)$!', $headerLine, $m)) { + $name = strtolower($m[1]); + $value = trim($m[2]); + if (empty($this->headers[$name])) { + $this->headers[$name] = $value; + } else { + if (!is_array($this->headers[$name])) { + $this->headers[$name] = array($this->headers[$name]); + } + $this->headers[$name][] = $value; + } + $this->lastHeader = $name; + + // continuation of a previous header + } elseif (preg_match('!^\s+(.+)$!', $headerLine, $m) && $this->lastHeader) { + if (!is_array($this->headers[$this->lastHeader])) { + $this->headers[$this->lastHeader] .= ' ' . trim($m[1]); + } else { + $key = count($this->headers[$this->lastHeader]) - 1; + $this->headers[$this->lastHeader][$key] .= ' ' . trim($m[1]); + } + } + } + + /** + * Parses a Set-Cookie header to fill $cookies array + * + * @param string value of Set-Cookie header + * @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html + */ + protected function parseCookie($cookieString) + { + $cookie = array( + 'expires' => null, + 'domain' => null, + 'path' => null, + 'secure' => false + ); + + // Only a name=value pair + if (!strpos($cookieString, ';')) { + $pos = strpos($cookieString, '='); + $cookie['name'] = trim(substr($cookieString, 0, $pos)); + $cookie['value'] = trim(substr($cookieString, $pos + 1)); + + // Some optional parameters are supplied + } else { + $elements = explode(';', $cookieString); + $pos = strpos($elements[0], '='); + $cookie['name'] = trim(substr($elements[0], 0, $pos)); + $cookie['value'] = trim(substr($elements[0], $pos + 1)); + + for ($i = 1; $i < count($elements); $i++) { + if (false === strpos($elements[$i], '=')) { + $elName = trim($elements[$i]); + $elValue = null; + } else { + list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i])); + } + $elName = strtolower($elName); + if ('secure' == $elName) { + $cookie['secure'] = true; + } elseif ('expires' == $elName) { + $cookie['expires'] = str_replace('"', '', $elValue); + } elseif ('path' == $elName || 'domain' == $elName) { + $cookie[$elName] = urldecode($elValue); + } else { + $cookie[$elName] = $elValue; + } + } + } + $this->cookies[] = $cookie; + } + + /** + * Appends a string to the response body + * @param string + */ + public function appendBody($bodyChunk) + { + $this->body .= $bodyChunk; + } + + /** + * Returns the status code + * @return integer + */ + public function getStatus() + { + return $this->code; + } + + /** + * Returns the reason phrase + * @return string + */ + public function getReasonPhrase() + { + return $this->reasonPhrase; + } + + /** + * Whether response is a redirect that can be automatically handled by HTTP_Request2 + * @return bool + */ + public function isRedirect() + { + return in_array($this->code, array(300, 301, 302, 303, 307)) + && isset($this->headers['location']); + } + + /** + * Returns either the named header or all response headers + * + * @param string Name of header to return + * @return string|array Value of $headerName header (null if header is + * not present), array of all response headers if + * $headerName is null + */ + public function getHeader($headerName = null) + { + if (null === $headerName) { + return $this->headers; + } else { + $headerName = strtolower($headerName); + return isset($this->headers[$headerName])? $this->headers[$headerName]: null; + } + } + + /** + * Returns cookies set in response + * + * @return array + */ + public function getCookies() + { + return $this->cookies; + } + + /** + * Returns the body of the response + * + * @return string + * @throws HTTP_Request2_Exception if body cannot be decoded + */ + public function getBody() + { + if (!$this->bodyEncoded || + !in_array(strtolower($this->getHeader('content-encoding')), array('gzip', 'deflate')) + ) { + return $this->body; + + } else { + if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) { + $oldEncoding = mb_internal_encoding(); + mb_internal_encoding('iso-8859-1'); + } + + try { + switch (strtolower($this->getHeader('content-encoding'))) { + case 'gzip': + $decoded = self::decodeGzip($this->body); + break; + case 'deflate': + $decoded = self::decodeDeflate($this->body); + } + } catch (Exception $e) { + } + + if (!empty($oldEncoding)) { + mb_internal_encoding($oldEncoding); + } + if (!empty($e)) { + throw $e; + } + return $decoded; + } + } + + /** + * Get the HTTP version of the response + * + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Decodes the message-body encoded by gzip + * + * The real decoding work is done by gzinflate() built-in function, this + * method only parses the header and checks data for compliance with + * RFC 1952 + * + * @param string gzip-encoded data + * @return string decoded data + * @throws HTTP_Request2_Exception + * @link http://tools.ietf.org/html/rfc1952 + */ + public static function decodeGzip($data) + { + $length = strlen($data); + // If it doesn't look like gzip-encoded data, don't bother + if (18 > $length || strcmp(substr($data, 0, 2), "\x1f\x8b")) { + return $data; + } + if (!function_exists('gzinflate')) { + throw new HTTP_Request2_Exception('Unable to decode body: gzip extension not available'); + } + $method = ord(substr($data, 2, 1)); + if (8 != $method) { + throw new HTTP_Request2_Exception('Error parsing gzip header: unknown compression method'); + } + $flags = ord(substr($data, 3, 1)); + if ($flags & 224) { + throw new HTTP_Request2_Exception('Error parsing gzip header: reserved bits are set'); + } + + // header is 10 bytes minimum. may be longer, though. + $headerLength = 10; + // extra fields, need to skip 'em + if ($flags & 4) { + if ($length - $headerLength - 2 < 8) { + throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); + } + $extraLength = unpack('v', substr($data, 10, 2)); + if ($length - $headerLength - 2 - $extraLength[1] < 8) { + throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); + } + $headerLength += $extraLength[1] + 2; + } + // file name, need to skip that + if ($flags & 8) { + if ($length - $headerLength - 1 < 8) { + throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); + } + $filenameLength = strpos(substr($data, $headerLength), chr(0)); + if (false === $filenameLength || $length - $headerLength - $filenameLength - 1 < 8) { + throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); + } + $headerLength += $filenameLength + 1; + } + // comment, need to skip that also + if ($flags & 16) { + if ($length - $headerLength - 1 < 8) { + throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); + } + $commentLength = strpos(substr($data, $headerLength), chr(0)); + if (false === $commentLength || $length - $headerLength - $commentLength - 1 < 8) { + throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); + } + $headerLength += $commentLength + 1; + } + // have a CRC for header. let's check + if ($flags & 2) { + if ($length - $headerLength - 2 < 8) { + throw new HTTP_Request2_Exception('Error parsing gzip header: data too short'); + } + $crcReal = 0xffff & crc32(substr($data, 0, $headerLength)); + $crcStored = unpack('v', substr($data, $headerLength, 2)); + if ($crcReal != $crcStored[1]) { + throw new HTTP_Request2_Exception('Header CRC check failed'); + } + $headerLength += 2; + } + // unpacked data CRC and size at the end of encoded data + $tmp = unpack('V2', substr($data, -8)); + $dataCrc = $tmp[1]; + $dataSize = $tmp[2]; + + // finally, call the gzinflate() function + // don't pass $dataSize to gzinflate, see bugs #13135, #14370 + $unpacked = gzinflate(substr($data, $headerLength, -8)); + if (false === $unpacked) { + throw new HTTP_Request2_Exception('gzinflate() call failed'); + } elseif ($dataSize != strlen($unpacked)) { + throw new HTTP_Request2_Exception('Data size check failed'); + } elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) { + throw new HTTP_Request2_Exception('Data CRC check failed'); + } + return $unpacked; + } + + /** + * Decodes the message-body encoded by deflate + * + * @param string deflate-encoded data + * @return string decoded data + * @throws HTTP_Request2_Exception + */ + public static function decodeDeflate($data) + { + if (!function_exists('gzuncompress')) { + throw new HTTP_Request2_Exception('Unable to decode body: gzip extension not available'); + } + // RFC 2616 defines 'deflate' encoding as zlib format from RFC 1950, + // while many applications send raw deflate stream from RFC 1951. + // We should check for presence of zlib header and use gzuncompress() or + // gzinflate() as needed. See bug #15305 + $header = unpack('n', substr($data, 0, 2)); + return (0 == $header[1] % 31)? gzuncompress($data): gzinflate($data); + } +} ?> \ No newline at end of file diff --git a/libs/PEAR/HTTP/Request.php b/libs/PEAR/HTTP/Request.php index 67062ccd6..96fc2e5ba 100644 --- a/libs/PEAR/HTTP/Request.php +++ b/libs/PEAR/HTTP/Request.php @@ -1,1461 +1,1461 @@ - - * @author Alexey Borzov - * @copyright 2002-2007 Richard Heyes - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Request.php,v 1.55 2007/05/18 19:20:12 avb Exp $ - * @link http://pear.php.net/package/HTTP_Request/ - */ - -/** - * PEAR and PEAR_Error classes (for error handling) - */ -require_once 'PEAR.php'; -/** - * Socket class - */ -require_once 'Net/Socket.php'; -/** - * URL handling class - */ -require_once 'Net/URL.php'; - -/**#@+ - * Constants for HTTP request methods - */ -define('HTTP_REQUEST_METHOD_GET', 'GET', true); -define('HTTP_REQUEST_METHOD_HEAD', 'HEAD', true); -define('HTTP_REQUEST_METHOD_POST', 'POST', true); -define('HTTP_REQUEST_METHOD_PUT', 'PUT', true); -define('HTTP_REQUEST_METHOD_DELETE', 'DELETE', true); -define('HTTP_REQUEST_METHOD_OPTIONS', 'OPTIONS', true); -define('HTTP_REQUEST_METHOD_TRACE', 'TRACE', true); -/**#@-*/ - -/**#@+ - * Constants for HTTP protocol versions - */ -define('HTTP_REQUEST_HTTP_VER_1_0', '1.0', true); -define('HTTP_REQUEST_HTTP_VER_1_1', '1.1', true); -/**#@-*/ - -if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) { - /** - * Whether string functions are overloaded by their mbstring equivalents - */ - define('HTTP_REQUEST_MBSTRING', true); -} else { - /** - * @ignore - */ - define('HTTP_REQUEST_MBSTRING', false); -} - -/** - * Class for performing HTTP requests - * - * Simple example (fetches yahoo.com and displays it): - * - * $a = &new HTTP_Request('http://www.yahoo.com/'); - * $a->sendRequest(); - * echo $a->getResponseBody(); - * - * - * @category HTTP - * @package HTTP_Request - * @author Richard Heyes - * @author Alexey Borzov - * @version Release: 1.4.1 - */ -class HTTP_Request -{ - /**#@+ - * @access private - */ - /** - * Instance of Net_URL - * @var Net_URL - */ - var $_url; - - /** - * Type of request - * @var string - */ - var $_method; - - /** - * HTTP Version - * @var string - */ - var $_http; - - /** - * Request headers - * @var array - */ - var $_requestHeaders; - - /** - * Basic Auth Username - * @var string - */ - var $_user; - - /** - * Basic Auth Password - * @var string - */ - var $_pass; - - /** - * Socket object - * @var Net_Socket - */ - var $_sock; - - /** - * Proxy server - * @var string - */ - var $_proxy_host; - - /** - * Proxy port - * @var integer - */ - var $_proxy_port; - - /** - * Proxy username - * @var string - */ - var $_proxy_user; - - /** - * Proxy password - * @var string - */ - var $_proxy_pass; - - /** - * Post data - * @var array - */ - var $_postData; - - /** - * Request body - * @var string - */ - var $_body; - - /** - * A list of methods that MUST NOT have a request body, per RFC 2616 - * @var array - */ - var $_bodyDisallowed = array('TRACE'); - - /** - * Files to post - * @var array - */ - var $_postFiles = array(); - - /** - * Connection timeout. - * @var float - */ - var $_timeout; - - /** - * HTTP_Response object - * @var HTTP_Response - */ - var $_response; - - /** - * Whether to allow redirects - * @var boolean - */ - var $_allowRedirects; - - /** - * Maximum redirects allowed - * @var integer - */ - var $_maxRedirects; - - /** - * Current number of redirects - * @var integer - */ - var $_redirects; - - /** - * Whether to append brackets [] to array variables - * @var bool - */ - var $_useBrackets = true; - - /** - * Attached listeners - * @var array - */ - var $_listeners = array(); - - /** - * Whether to save response body in response object property - * @var bool - */ - var $_saveBody = true; - - /** - * Timeout for reading from socket (array(seconds, microseconds)) - * @var array - */ - var $_readTimeout = null; - - /** - * Options to pass to Net_Socket::connect. See stream_context_create - * @var array - */ - var $_socketOptions = null; - /**#@-*/ - - /** - * Constructor - * - * Sets up the object - * @param string The url to fetch/access - * @param array Associative array of parameters which can have the following keys: - *
    - *
  • method - Method to use, GET, POST etc (string)
  • - *
  • http - HTTP Version to use, 1.0 or 1.1 (string)
  • - *
  • user - Basic Auth username (string)
  • - *
  • pass - Basic Auth password (string)
  • - *
  • proxy_host - Proxy server host (string)
  • - *
  • proxy_port - Proxy server port (integer)
  • - *
  • proxy_user - Proxy auth username (string)
  • - *
  • proxy_pass - Proxy auth password (string)
  • - *
  • timeout - Connection timeout in seconds (float)
  • - *
  • allowRedirects - Whether to follow redirects or not (bool)
  • - *
  • maxRedirects - Max number of redirects to follow (integer)
  • - *
  • useBrackets - Whether to append [] to array variable names (bool)
  • - *
  • saveBody - Whether to save response body in response object property (bool)
  • - *
  • readTimeout - Timeout for reading / writing data over the socket (array (seconds, microseconds))
  • - *
  • socketOptions - Options to pass to Net_Socket object (array)
  • - *
- * @access public - */ - function HTTP_Request($url = '', $params = array()) - { - $this->_method = HTTP_REQUEST_METHOD_GET; - $this->_http = HTTP_REQUEST_HTTP_VER_1_1; - $this->_requestHeaders = array(); - $this->_postData = array(); - $this->_body = null; - - $this->_user = null; - $this->_pass = null; - - $this->_proxy_host = null; - $this->_proxy_port = null; - $this->_proxy_user = null; - $this->_proxy_pass = null; - - $this->_allowRedirects = false; - $this->_maxRedirects = 3; - $this->_redirects = 0; - - $this->_timeout = null; - $this->_response = null; - - foreach ($params as $key => $value) { - $this->{'_' . $key} = $value; - } - - if (!empty($url)) { - $this->setURL($url); - } - - // Default useragent - $this->addHeader('User-Agent', 'PEAR HTTP_Request class ( http://pear.php.net/ )'); - - // We don't do keep-alives by default - $this->addHeader('Connection', 'close'); - - // Basic authentication - if (!empty($this->_user)) { - $this->addHeader('Authorization', 'Basic ' . base64_encode($this->_user . ':' . $this->_pass)); - } - - // Proxy authentication (see bug #5913) - if (!empty($this->_proxy_user)) { - $this->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($this->_proxy_user . ':' . $this->_proxy_pass)); - } - - // Use gzip encoding if possible - if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && extension_loaded('zlib')) { - $this->addHeader('Accept-Encoding', 'gzip'); - } - } - - /** - * Generates a Host header for HTTP/1.1 requests - * - * @access private - * @return string - */ - function _generateHostHeader() - { - if ($this->_url->port != 80 AND strcasecmp($this->_url->protocol, 'http') == 0) { - $host = $this->_url->host . ':' . $this->_url->port; - - } elseif ($this->_url->port != 443 AND strcasecmp($this->_url->protocol, 'https') == 0) { - $host = $this->_url->host . ':' . $this->_url->port; - - } elseif ($this->_url->port == 443 AND strcasecmp($this->_url->protocol, 'https') == 0 AND strpos($this->_url->url, ':443') !== false) { - $host = $this->_url->host . ':' . $this->_url->port; - - } else { - $host = $this->_url->host; - } - - return $host; - } - - /** - * Resets the object to its initial state (DEPRECATED). - * Takes the same parameters as the constructor. - * - * @param string $url The url to be requested - * @param array $params Associative array of parameters - * (see constructor for details) - * @access public - * @deprecated deprecated since 1.2, call the constructor if this is necessary - */ - function reset($url, $params = array()) - { - $this->HTTP_Request($url, $params); - } - - /** - * Sets the URL to be requested - * - * @param string The url to be requested - * @access public - */ - function setURL($url) - { - $this->_url = &new Net_URL($url, $this->_useBrackets); - - if (!empty($this->_url->user) || !empty($this->_url->pass)) { - $this->setBasicAuth($this->_url->user, $this->_url->pass); - } - - if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http) { - $this->addHeader('Host', $this->_generateHostHeader()); - } - - // set '/' instead of empty path rather than check later (see bug #8662) - if (empty($this->_url->path)) { - $this->_url->path = '/'; - } - } - - /** - * Returns the current request URL - * - * @return string Current request URL - * @access public - */ - function getUrl() - { - return empty($this->_url)? '': $this->_url->getUrl(); - } - - /** - * Sets a proxy to be used - * - * @param string Proxy host - * @param int Proxy port - * @param string Proxy username - * @param string Proxy password - * @access public - */ - function setProxy($host, $port = 8080, $user = null, $pass = null) - { - $this->_proxy_host = $host; - $this->_proxy_port = $port; - $this->_proxy_user = $user; - $this->_proxy_pass = $pass; - - if (!empty($user)) { - $this->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($user . ':' . $pass)); - } - } - - /** - * Sets basic authentication parameters - * - * @param string Username - * @param string Password - */ - function setBasicAuth($user, $pass) - { - $this->_user = $user; - $this->_pass = $pass; - - $this->addHeader('Authorization', 'Basic ' . base64_encode($user . ':' . $pass)); - } - - /** - * Sets the method to be used, GET, POST etc. - * - * @param string Method to use. Use the defined constants for this - * @access public - */ - function setMethod($method) - { - $this->_method = $method; - } - - /** - * Sets the HTTP version to use, 1.0 or 1.1 - * - * @param string Version to use. Use the defined constants for this - * @access public - */ - function setHttpVer($http) - { - $this->_http = $http; - } - - /** - * Adds a request header - * - * @param string Header name - * @param string Header value - * @access public - */ - function addHeader($name, $value) - { - $this->_requestHeaders[strtolower($name)] = $value; - } - - /** - * Removes a request header - * - * @param string Header name to remove - * @access public - */ - function removeHeader($name) - { - if (isset($this->_requestHeaders[strtolower($name)])) { - unset($this->_requestHeaders[strtolower($name)]); - } - } - - /** - * Adds a querystring parameter - * - * @param string Querystring parameter name - * @param string Querystring parameter value - * @param bool Whether the value is already urlencoded or not, default = not - * @access public - */ - function addQueryString($name, $value, $preencoded = false) - { - $this->_url->addQueryString($name, $value, $preencoded); - } - - /** - * Sets the querystring to literally what you supply - * - * @param string The querystring data. Should be of the format foo=bar&x=y etc - * @param bool Whether data is already urlencoded or not, default = already encoded - * @access public - */ - function addRawQueryString($querystring, $preencoded = true) - { - $this->_url->addRawQueryString($querystring, $preencoded); - } - - /** - * Adds postdata items - * - * @param string Post data name - * @param string Post data value - * @param bool Whether data is already urlencoded or not, default = not - * @access public - */ - function addPostData($name, $value, $preencoded = false) - { - if ($preencoded) { - $this->_postData[$name] = $value; - } else { - $this->_postData[$name] = $this->_arrayMapRecursive('urlencode', $value); - } - } - - /** - * Recursively applies the callback function to the value - * - * @param mixed Callback function - * @param mixed Value to process - * @access private - * @return mixed Processed value - */ - function _arrayMapRecursive($callback, $value) - { - if (!is_array($value)) { - return call_user_func($callback, $value); - } else { - $map = array(); - foreach ($value as $k => $v) { - $map[$k] = $this->_arrayMapRecursive($callback, $v); - } - return $map; - } - } - - /** - * Adds a file to upload - * - * This also changes content-type to 'multipart/form-data' for proper upload - * - * @access public - * @param string name of file-upload field - * @param mixed file name(s) - * @param mixed content-type(s) of file(s) being uploaded - * @return bool true on success - * @throws PEAR_Error - */ - function addFile($inputName, $fileName, $contentType = 'application/octet-stream') - { - if (!is_array($fileName) && !is_readable($fileName)) { - return PEAR::raiseError("File '{$fileName}' is not readable"); - } elseif (is_array($fileName)) { - foreach ($fileName as $name) { - if (!is_readable($name)) { - return PEAR::raiseError("File '{$name}' is not readable"); - } - } - } - $this->addHeader('Content-Type', 'multipart/form-data'); - $this->_postFiles[$inputName] = array( - 'name' => $fileName, - 'type' => $contentType - ); - return true; - } - - /** - * Adds raw postdata (DEPRECATED) - * - * @param string The data - * @param bool Whether data is preencoded or not, default = already encoded - * @access public - * @deprecated deprecated since 1.3.0, method setBody() should be used instead - */ - function addRawPostData($postdata, $preencoded = true) - { - $this->_body = $preencoded ? $postdata : urlencode($postdata); - } - - /** - * Sets the request body (for POST, PUT and similar requests) - * - * @param string Request body - * @access public - */ - function setBody($body) - { - $this->_body = $body; - } - - /** - * Clears any postdata that has been added (DEPRECATED). - * - * Useful for multiple request scenarios. - * - * @access public - * @deprecated deprecated since 1.2 - */ - function clearPostData() - { - $this->_postData = null; - } - - /** - * Appends a cookie to "Cookie:" header - * - * @param string $name cookie name - * @param string $value cookie value - * @access public - */ - function addCookie($name, $value) - { - $cookies = isset($this->_requestHeaders['cookie']) ? $this->_requestHeaders['cookie']. '; ' : ''; - $this->addHeader('Cookie', $cookies . $name . '=' . $value); - } - - /** - * Clears any cookies that have been added (DEPRECATED). - * - * Useful for multiple request scenarios - * - * @access public - * @deprecated deprecated since 1.2 - */ - function clearCookies() - { - $this->removeHeader('Cookie'); - } - - /** - * Sends the request - * - * @access public - * @param bool Whether to store response body in Response object property, - * set this to false if downloading a LARGE file and using a Listener - * @return mixed PEAR error on error, true otherwise - */ - function sendRequest($saveBody = true) - { - if (!is_a($this->_url, 'Net_URL')) { - return PEAR::raiseError('No URL given.'); - } - - $host = isset($this->_proxy_host) ? $this->_proxy_host : $this->_url->host; - $port = isset($this->_proxy_port) ? $this->_proxy_port : $this->_url->port; - - // 4.3.0 supports SSL connections using OpenSSL. The function test determines - // we running on at least 4.3.0 - if (strcasecmp($this->_url->protocol, 'https') == 0 AND function_exists('file_get_contents') AND extension_loaded('openssl')) { - if (isset($this->_proxy_host)) { - return PEAR::raiseError('HTTPS proxies are not supported.'); - } - $host = 'ssl://' . $host; - } - - // magic quotes may fuck up file uploads and chunked response processing - $magicQuotes = ini_get('magic_quotes_runtime'); - ini_set('magic_quotes_runtime', false); - - // RFC 2068, section 19.7.1: A client MUST NOT send the Keep-Alive - // connection token to a proxy server... - if (isset($this->_proxy_host) && !empty($this->_requestHeaders['connection']) && - 'Keep-Alive' == $this->_requestHeaders['connection']) - { - $this->removeHeader('connection'); - } - - $keepAlive = (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && empty($this->_requestHeaders['connection'])) || - (!empty($this->_requestHeaders['connection']) && 'Keep-Alive' == $this->_requestHeaders['connection']); - $sockets = &PEAR::getStaticProperty('HTTP_Request', 'sockets'); - $sockKey = $host . ':' . $port; - unset($this->_sock); - - // There is a connected socket in the "static" property? - if ($keepAlive && !empty($sockets[$sockKey]) && - !empty($sockets[$sockKey]->fp)) - { - $this->_sock =& $sockets[$sockKey]; - $err = null; - } else { - $this->_notify('connect'); - $this->_sock =& new Net_Socket(); - $err = $this->_sock->connect($host, $port, null, $this->_timeout, $this->_socketOptions); - } - PEAR::isError($err) or $err = $this->_sock->write($this->_buildRequest()); - - if (!PEAR::isError($err)) { - if (!empty($this->_readTimeout)) { - $this->_sock->setTimeout($this->_readTimeout[0], $this->_readTimeout[1]); - } - - $this->_notify('sentRequest'); - - // Read the response - $this->_response = &new HTTP_Response($this->_sock, $this->_listeners); - $err = $this->_response->process( - $this->_saveBody && $saveBody, - HTTP_REQUEST_METHOD_HEAD != $this->_method - ); - - if ($keepAlive) { - $keepAlive = (isset($this->_response->_headers['content-length']) - || (isset($this->_response->_headers['transfer-encoding']) - && strtolower($this->_response->_headers['transfer-encoding']) == 'chunked')); - if ($keepAlive) { - if (isset($this->_response->_headers['connection'])) { - $keepAlive = strtolower($this->_response->_headers['connection']) == 'keep-alive'; - } else { - $keepAlive = 'HTTP/'.HTTP_REQUEST_HTTP_VER_1_1 == $this->_response->_protocol; - } - } - } - } - - ini_set('magic_quotes_runtime', $magicQuotes); - - if (PEAR::isError($err)) { - return $err; - } - - if (!$keepAlive) { - $this->disconnect(); - // Store the connected socket in "static" property - } elseif (empty($sockets[$sockKey]) || empty($sockets[$sockKey]->fp)) { - $sockets[$sockKey] =& $this->_sock; - } - - // Check for redirection - if ( $this->_allowRedirects - AND $this->_redirects <= $this->_maxRedirects - AND $this->getResponseCode() > 300 - AND $this->getResponseCode() < 399 - AND !empty($this->_response->_headers['location'])) { - - - $redirect = $this->_response->_headers['location']; - - // Absolute URL - if (preg_match('/^https?:\/\//i', $redirect)) { - $this->_url = &new Net_URL($redirect); - $this->addHeader('Host', $this->_generateHostHeader()); - // Absolute path - } elseif ($redirect{0} == '/') { - $this->_url->path = $redirect; - - // Relative path - } elseif (substr($redirect, 0, 3) == '../' OR substr($redirect, 0, 2) == './') { - if (substr($this->_url->path, -1) == '/') { - $redirect = $this->_url->path . $redirect; - } else { - $redirect = dirname($this->_url->path) . '/' . $redirect; - } - $redirect = Net_URL::resolvePath($redirect); - $this->_url->path = $redirect; - - // Filename, no path - } else { - if (substr($this->_url->path, -1) == '/') { - $redirect = $this->_url->path . $redirect; - } else { - $redirect = dirname($this->_url->path) . '/' . $redirect; - } - $this->_url->path = $redirect; - } - - $this->_redirects++; - return $this->sendRequest($saveBody); - - // Too many redirects - } elseif ($this->_allowRedirects AND $this->_redirects > $this->_maxRedirects) { - return PEAR::raiseError('Too many redirects'); - } - - return true; - } - - /** - * Disconnect the socket, if connected. Only useful if using Keep-Alive. - * - * @access public - */ - function disconnect() - { - if (!empty($this->_sock) && !empty($this->_sock->fp)) { - $this->_notify('disconnect'); - $this->_sock->disconnect(); - } - } - - /** - * Returns the response code - * - * @access public - * @return mixed Response code, false if not set - */ - function getResponseCode() - { - return isset($this->_response->_code) ? $this->_response->_code : false; - } - - /** - * Returns either the named header or all if no name given - * - * @access public - * @param string The header name to return, do not set to get all headers - * @return mixed either the value of $headername (false if header is not present) - * or an array of all headers - */ - function getResponseHeader($headername = null) - { - if (!isset($headername)) { - return isset($this->_response->_headers)? $this->_response->_headers: array(); - } else { - $headername = strtolower($headername); - return isset($this->_response->_headers[$headername]) ? $this->_response->_headers[$headername] : false; - } - } - - /** - * Returns the body of the response - * - * @access public - * @return mixed response body, false if not set - */ - function getResponseBody() - { - return isset($this->_response->_body) ? $this->_response->_body : false; - } - - /** - * Returns cookies set in response - * - * @access public - * @return mixed array of response cookies, false if none are present - */ - function getResponseCookies() - { - return isset($this->_response->_cookies) ? $this->_response->_cookies : false; - } - - /** - * Builds the request string - * - * @access private - * @return string The request string - */ - function _buildRequest() - { - $separator = ini_get('arg_separator.output'); - ini_set('arg_separator.output', '&'); - $querystring = ($querystring = $this->_url->getQueryString()) ? '?' . $querystring : ''; - ini_set('arg_separator.output', $separator); - - $host = isset($this->_proxy_host) ? $this->_url->protocol . '://' . $this->_url->host : ''; - $port = (isset($this->_proxy_host) AND $this->_url->port != 80) ? ':' . $this->_url->port : ''; - $path = $this->_url->path . $querystring; - $url = $host . $port . $path; - - $request = $this->_method . ' ' . $url . ' HTTP/' . $this->_http . "\r\n"; - - if (in_array($this->_method, $this->_bodyDisallowed) || - (empty($this->_body) && (HTTP_REQUEST_METHOD_POST != $this->_method || - (empty($this->_postData) && empty($this->_postFiles))))) - { - $this->removeHeader('Content-Type'); - } else { - if (empty($this->_requestHeaders['content-type'])) { - // Add default content-type - $this->addHeader('Content-Type', 'application/x-www-form-urlencoded'); - } elseif ('multipart/form-data' == $this->_requestHeaders['content-type']) { - $boundary = 'HTTP_Request_' . md5(uniqid('request') . microtime()); - $this->addHeader('Content-Type', 'multipart/form-data; boundary=' . $boundary); - } - } - - // Request Headers - if (!empty($this->_requestHeaders)) { - foreach ($this->_requestHeaders as $name => $value) { - $canonicalName = implode('-', array_map('ucfirst', explode('-', $name))); - $request .= $canonicalName . ': ' . $value . "\r\n"; - } - } - - // No post data or wrong method, so simply add a final CRLF - if (in_array($this->_method, $this->_bodyDisallowed) || - (HTTP_REQUEST_METHOD_POST != $this->_method && empty($this->_body))) { - - $request .= "\r\n"; - - // Post data if it's an array - } elseif (HTTP_REQUEST_METHOD_POST == $this->_method && - (!empty($this->_postData) || !empty($this->_postFiles))) { - - // "normal" POST request - if (!isset($boundary)) { - $postdata = implode('&', array_map( - create_function('$a', 'return $a[0] . \'=\' . $a[1];'), - $this->_flattenArray('', $this->_postData) - )); - - // multipart request, probably with file uploads - } else { - $postdata = ''; - if (!empty($this->_postData)) { - $flatData = $this->_flattenArray('', $this->_postData); - foreach ($flatData as $item) { - $postdata .= '--' . $boundary . "\r\n"; - $postdata .= 'Content-Disposition: form-data; name="' . $item[0] . '"'; - $postdata .= "\r\n\r\n" . urldecode($item[1]) . "\r\n"; - } - } - foreach ($this->_postFiles as $name => $value) { - if (is_array($value['name'])) { - $varname = $name . ($this->_useBrackets? '[]': ''); - } else { - $varname = $name; - $value['name'] = array($value['name']); - } - foreach ($value['name'] as $key => $filename) { - $fp = fopen($filename, 'r'); - $data = fread($fp, filesize($filename)); - fclose($fp); - $basename = basename($filename); - $type = is_array($value['type'])? @$value['type'][$key]: $value['type']; - - $postdata .= '--' . $boundary . "\r\n"; - $postdata .= 'Content-Disposition: form-data; name="' . $varname . '"; filename="' . $basename . '"'; - $postdata .= "\r\nContent-Type: " . $type; - $postdata .= "\r\n\r\n" . $data . "\r\n"; - } - } - $postdata .= '--' . $boundary . "--\r\n"; - } - $request .= 'Content-Length: ' . - (HTTP_REQUEST_MBSTRING? mb_strlen($postdata, 'iso-8859-1'): strlen($postdata)) . - "\r\n\r\n"; - $request .= $postdata; - - // Explicitly set request body - } elseif (!empty($this->_body)) { - - $request .= 'Content-Length: ' . - (HTTP_REQUEST_MBSTRING? mb_strlen($this->_body, 'iso-8859-1'): strlen($this->_body)) . - "\r\n\r\n"; - $request .= $this->_body; - } - - return $request; - } - - /** - * Helper function to change the (probably multidimensional) associative array - * into the simple one. - * - * @param string name for item - * @param mixed item's values - * @return array array with the following items: array('item name', 'item value'); - * @access private - */ - function _flattenArray($name, $values) - { - if (!is_array($values)) { - return array(array($name, $values)); - } else { - $ret = array(); - foreach ($values as $k => $v) { - if (empty($name)) { - $newName = $k; - } elseif ($this->_useBrackets) { - $newName = $name . '[' . $k . ']'; - } else { - $newName = $name; - } - $ret = array_merge($ret, $this->_flattenArray($newName, $v)); - } - return $ret; - } - } - - - /** - * Adds a Listener to the list of listeners that are notified of - * the object's events - * - * Events sent by HTTP_Request object - * - 'connect': on connection to server - * - 'sentRequest': after the request was sent - * - 'disconnect': on disconnection from server - * - * Events sent by HTTP_Response object - * - 'gotHeaders': after receiving response headers (headers are passed in $data) - * - 'tick': on receiving a part of response body (the part is passed in $data) - * - 'gzTick': on receiving a gzip-encoded part of response body (ditto) - * - 'gotBody': after receiving the response body (passes the decoded body in $data if it was gzipped) - * - * @param HTTP_Request_Listener listener to attach - * @return boolean whether the listener was successfully attached - * @access public - */ - function attach(&$listener) - { - if (!is_a($listener, 'HTTP_Request_Listener')) { - return false; - } - $this->_listeners[$listener->getId()] =& $listener; - return true; - } - - - /** - * Removes a Listener from the list of listeners - * - * @param HTTP_Request_Listener listener to detach - * @return boolean whether the listener was successfully detached - * @access public - */ - function detach(&$listener) - { - if (!is_a($listener, 'HTTP_Request_Listener') || - !isset($this->_listeners[$listener->getId()])) { - return false; - } - unset($this->_listeners[$listener->getId()]); - return true; - } - - - /** - * Notifies all registered listeners of an event. - * - * @param string Event name - * @param mixed Additional data - * @access private - * @see HTTP_Request::attach() - */ - function _notify($event, $data = null) - { - foreach (array_keys($this->_listeners) as $id) { - $this->_listeners[$id]->update($this, $event, $data); - } - } -} - - -/** - * Response class to complement the Request class - * - * @category HTTP - * @package HTTP_Request - * @author Richard Heyes - * @author Alexey Borzov - * @version Release: 1.4.1 - */ -class HTTP_Response -{ - /** - * Socket object - * @var Net_Socket - */ - var $_sock; - - /** - * Protocol - * @var string - */ - var $_protocol; - - /** - * Return code - * @var string - */ - var $_code; - - /** - * Response headers - * @var array - */ - var $_headers; - - /** - * Cookies set in response - * @var array - */ - var $_cookies; - - /** - * Response body - * @var string - */ - var $_body = ''; - - /** - * Used by _readChunked(): remaining length of the current chunk - * @var string - */ - var $_chunkLength = 0; - - /** - * Attached listeners - * @var array - */ - var $_listeners = array(); - - /** - * Bytes left to read from message-body - * @var null|int - */ - var $_toRead; - - /** - * Constructor - * - * @param Net_Socket socket to read the response from - * @param array listeners attached to request - */ - function HTTP_Response(&$sock, &$listeners) - { - $this->_sock =& $sock; - $this->_listeners =& $listeners; - } - - - /** - * Processes a HTTP response - * - * This extracts response code, headers, cookies and decodes body if it - * was encoded in some way - * - * @access public - * @param bool Whether to store response body in object property, set - * this to false if downloading a LARGE file and using a Listener. - * This is assumed to be true if body is gzip-encoded. - * @param bool Whether the response can actually have a message-body. - * Will be set to false for HEAD requests. - * @throws PEAR_Error - * @return mixed true on success, PEAR_Error in case of malformed response - */ - function process($saveBody = true, $canHaveBody = true) - { - do { - $line = $this->_sock->readLine(); - if (sscanf($line, 'HTTP/%s %s', $http_version, $returncode) != 2) { - return PEAR::raiseError('Malformed response.'); - } else { - $this->_protocol = 'HTTP/' . $http_version; - $this->_code = intval($returncode); - } - while ('' !== ($header = $this->_sock->readLine())) { - $this->_processHeader($header); - } - } while (100 == $this->_code); - - $this->_notify('gotHeaders', $this->_headers); - - // RFC 2616, section 4.4: - // 1. Any response message which "MUST NOT" include a message-body ... - // is always terminated by the first empty line after the header fields - // 3. ... If a message is received with both a - // Transfer-Encoding header field and a Content-Length header field, - // the latter MUST be ignored. - $canHaveBody = $canHaveBody && $this->_code >= 200 && - $this->_code != 204 && $this->_code != 304; - - // If response body is present, read it and decode - $chunked = isset($this->_headers['transfer-encoding']) && ('chunked' == $this->_headers['transfer-encoding']); - $gzipped = isset($this->_headers['content-encoding']) && ('gzip' == $this->_headers['content-encoding']); - $hasBody = false; - if ($canHaveBody && ($chunked || !isset($this->_headers['content-length']) || - 0 != $this->_headers['content-length'])) - { - if ($chunked || !isset($this->_headers['content-length'])) { - $this->_toRead = null; - } else { - $this->_toRead = $this->_headers['content-length']; - } - while (!$this->_sock->eof() && (is_null($this->_toRead) || 0 < $this->_toRead)) { - if ($chunked) { - $data = $this->_readChunked(); - } elseif (is_null($this->_toRead)) { - $data = $this->_sock->read(4096); - } else { - $data = $this->_sock->read(min(4096, $this->_toRead)); - $this->_toRead -= HTTP_REQUEST_MBSTRING? mb_strlen($data, 'iso-8859-1'): strlen($data); - } - if ('' == $data) { - break; - } else { - $hasBody = true; - if ($saveBody || $gzipped) { - $this->_body .= $data; - } - $this->_notify($gzipped? 'gzTick': 'tick', $data); - } - } - } - - if ($hasBody) { - // Uncompress the body if needed - if ($gzipped) { - $body = $this->_decodeGzip($this->_body); - if (PEAR::isError($body)) { - return $body; - } - $this->_body = $body; - $this->_notify('gotBody', $this->_body); - } else { - $this->_notify('gotBody'); - } - } - return true; - } - - - /** - * Processes the response header - * - * @access private - * @param string HTTP header - */ - function _processHeader($header) - { - if (false === strpos($header, ':')) { - return; - } - list($headername, $headervalue) = explode(':', $header, 2); - $headername = strtolower($headername); - $headervalue = ltrim($headervalue); - - if ('set-cookie' != $headername) { - if (isset($this->_headers[$headername])) { - $this->_headers[$headername] .= ',' . $headervalue; - } else { - $this->_headers[$headername] = $headervalue; - } - } else { - $this->_parseCookie($headervalue); - } - } - - - /** - * Parse a Set-Cookie header to fill $_cookies array - * - * @access private - * @param string value of Set-Cookie header - */ - function _parseCookie($headervalue) - { - $cookie = array( - 'expires' => null, - 'domain' => null, - 'path' => null, - 'secure' => false - ); - - // Only a name=value pair - if (!strpos($headervalue, ';')) { - $pos = strpos($headervalue, '='); - $cookie['name'] = trim(substr($headervalue, 0, $pos)); - $cookie['value'] = trim(substr($headervalue, $pos + 1)); - - // Some optional parameters are supplied - } else { - $elements = explode(';', $headervalue); - $pos = strpos($elements[0], '='); - $cookie['name'] = trim(substr($elements[0], 0, $pos)); - $cookie['value'] = trim(substr($elements[0], $pos + 1)); - - for ($i = 1; $i < count($elements); $i++) { - if (false === strpos($elements[$i], '=')) { - $elName = trim($elements[$i]); - $elValue = null; - } else { - list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i])); - } - $elName = strtolower($elName); - if ('secure' == $elName) { - $cookie['secure'] = true; - } elseif ('expires' == $elName) { - $cookie['expires'] = str_replace('"', '', $elValue); - } elseif ('path' == $elName || 'domain' == $elName) { - $cookie[$elName] = urldecode($elValue); - } else { - $cookie[$elName] = $elValue; - } - } - } - $this->_cookies[] = $cookie; - } - - - /** - * Read a part of response body encoded with chunked Transfer-Encoding - * - * @access private - * @return string - */ - function _readChunked() - { - // at start of the next chunk? - if (0 == $this->_chunkLength) { - $line = $this->_sock->readLine(); - if (preg_match('/^([0-9a-f]+)/i', $line, $matches)) { - $this->_chunkLength = hexdec($matches[1]); - // Chunk with zero length indicates the end - if (0 == $this->_chunkLength) { - $this->_sock->readLine(); // make this an eof() - return ''; - } - } else { - return ''; - } - } - $data = $this->_sock->read($this->_chunkLength); - $this->_chunkLength -= HTTP_REQUEST_MBSTRING? mb_strlen($data, 'iso-8859-1'): strlen($data); - if (0 == $this->_chunkLength) { - $this->_sock->readLine(); // Trailing CRLF - } - return $data; - } - - - /** - * Notifies all registered listeners of an event. - * - * @param string Event name - * @param mixed Additional data - * @access private - * @see HTTP_Request::_notify() - */ - function _notify($event, $data = null) - { - foreach (array_keys($this->_listeners) as $id) { - $this->_listeners[$id]->update($this, $event, $data); - } - } - - - /** - * Decodes the message-body encoded by gzip - * - * The real decoding work is done by gzinflate() built-in function, this - * method only parses the header and checks data for compliance with - * RFC 1952 - * - * @access private - * @param string gzip-encoded data - * @return string decoded data - */ - function _decodeGzip($data) - { - if (HTTP_REQUEST_MBSTRING) { - $oldEncoding = mb_internal_encoding(); - mb_internal_encoding('iso-8859-1'); - } - $length = strlen($data); - // If it doesn't look like gzip-encoded data, don't bother - if (18 > $length || strcmp(substr($data, 0, 2), "\x1f\x8b")) { - return $data; - } - $method = ord(substr($data, 2, 1)); - if (8 != $method) { - return PEAR::raiseError('_decodeGzip(): unknown compression method'); - } - $flags = ord(substr($data, 3, 1)); - if ($flags & 224) { - return PEAR::raiseError('_decodeGzip(): reserved bits are set'); - } - - // header is 10 bytes minimum. may be longer, though. - $headerLength = 10; - // extra fields, need to skip 'em - if ($flags & 4) { - if ($length - $headerLength - 2 < 8) { - return PEAR::raiseError('_decodeGzip(): data too short'); - } - $extraLength = unpack('v', substr($data, 10, 2)); - if ($length - $headerLength - 2 - $extraLength[1] < 8) { - return PEAR::raiseError('_decodeGzip(): data too short'); - } - $headerLength += $extraLength[1] + 2; - } - // file name, need to skip that - if ($flags & 8) { - if ($length - $headerLength - 1 < 8) { - return PEAR::raiseError('_decodeGzip(): data too short'); - } - $filenameLength = strpos(substr($data, $headerLength), chr(0)); - if (false === $filenameLength || $length - $headerLength - $filenameLength - 1 < 8) { - return PEAR::raiseError('_decodeGzip(): data too short'); - } - $headerLength += $filenameLength + 1; - } - // comment, need to skip that also - if ($flags & 16) { - if ($length - $headerLength - 1 < 8) { - return PEAR::raiseError('_decodeGzip(): data too short'); - } - $commentLength = strpos(substr($data, $headerLength), chr(0)); - if (false === $commentLength || $length - $headerLength - $commentLength - 1 < 8) { - return PEAR::raiseError('_decodeGzip(): data too short'); - } - $headerLength += $commentLength + 1; - } - // have a CRC for header. let's check - if ($flags & 1) { - if ($length - $headerLength - 2 < 8) { - return PEAR::raiseError('_decodeGzip(): data too short'); - } - $crcReal = 0xffff & crc32(substr($data, 0, $headerLength)); - $crcStored = unpack('v', substr($data, $headerLength, 2)); - if ($crcReal != $crcStored[1]) { - return PEAR::raiseError('_decodeGzip(): header CRC check failed'); - } - $headerLength += 2; - } - // unpacked data CRC and size at the end of encoded data - $tmp = unpack('V2', substr($data, -8)); - $dataCrc = $tmp[1]; - $dataSize = $tmp[2]; - - // finally, call the gzinflate() function - $unpacked = @gzinflate(substr($data, $headerLength, -8), $dataSize); - if (false === $unpacked) { - return PEAR::raiseError('_decodeGzip(): gzinflate() call failed'); - } elseif ($dataSize != strlen($unpacked)) { - return PEAR::raiseError('_decodeGzip(): data size check failed'); - } elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) { - return PEAR::raiseError('_decodeGzip(): data CRC check failed'); - } - if (HTTP_REQUEST_MBSTRING) { - mb_internal_encoding($oldEncoding); - } - return $unpacked; - } -} // End class HTTP_Response -?> + + * @author Alexey Borzov + * @copyright 2002-2007 Richard Heyes + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Request.php,v 1.55 2007/05/18 19:20:12 avb Exp $ + * @link http://pear.php.net/package/HTTP_Request/ + */ + +/** + * PEAR and PEAR_Error classes (for error handling) + */ +require_once 'PEAR.php'; +/** + * Socket class + */ +require_once 'Net/Socket.php'; +/** + * URL handling class + */ +require_once 'Net/URL.php'; + +/**#@+ + * Constants for HTTP request methods + */ +define('HTTP_REQUEST_METHOD_GET', 'GET', true); +define('HTTP_REQUEST_METHOD_HEAD', 'HEAD', true); +define('HTTP_REQUEST_METHOD_POST', 'POST', true); +define('HTTP_REQUEST_METHOD_PUT', 'PUT', true); +define('HTTP_REQUEST_METHOD_DELETE', 'DELETE', true); +define('HTTP_REQUEST_METHOD_OPTIONS', 'OPTIONS', true); +define('HTTP_REQUEST_METHOD_TRACE', 'TRACE', true); +/**#@-*/ + +/**#@+ + * Constants for HTTP protocol versions + */ +define('HTTP_REQUEST_HTTP_VER_1_0', '1.0', true); +define('HTTP_REQUEST_HTTP_VER_1_1', '1.1', true); +/**#@-*/ + +if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) { + /** + * Whether string functions are overloaded by their mbstring equivalents + */ + define('HTTP_REQUEST_MBSTRING', true); +} else { + /** + * @ignore + */ + define('HTTP_REQUEST_MBSTRING', false); +} + +/** + * Class for performing HTTP requests + * + * Simple example (fetches yahoo.com and displays it): + * + * $a = &new HTTP_Request('http://www.yahoo.com/'); + * $a->sendRequest(); + * echo $a->getResponseBody(); + * + * + * @category HTTP + * @package HTTP_Request + * @author Richard Heyes + * @author Alexey Borzov + * @version Release: 1.4.1 + */ +class HTTP_Request +{ + /**#@+ + * @access private + */ + /** + * Instance of Net_URL + * @var Net_URL + */ + var $_url; + + /** + * Type of request + * @var string + */ + var $_method; + + /** + * HTTP Version + * @var string + */ + var $_http; + + /** + * Request headers + * @var array + */ + var $_requestHeaders; + + /** + * Basic Auth Username + * @var string + */ + var $_user; + + /** + * Basic Auth Password + * @var string + */ + var $_pass; + + /** + * Socket object + * @var Net_Socket + */ + var $_sock; + + /** + * Proxy server + * @var string + */ + var $_proxy_host; + + /** + * Proxy port + * @var integer + */ + var $_proxy_port; + + /** + * Proxy username + * @var string + */ + var $_proxy_user; + + /** + * Proxy password + * @var string + */ + var $_proxy_pass; + + /** + * Post data + * @var array + */ + var $_postData; + + /** + * Request body + * @var string + */ + var $_body; + + /** + * A list of methods that MUST NOT have a request body, per RFC 2616 + * @var array + */ + var $_bodyDisallowed = array('TRACE'); + + /** + * Files to post + * @var array + */ + var $_postFiles = array(); + + /** + * Connection timeout. + * @var float + */ + var $_timeout; + + /** + * HTTP_Response object + * @var HTTP_Response + */ + var $_response; + + /** + * Whether to allow redirects + * @var boolean + */ + var $_allowRedirects; + + /** + * Maximum redirects allowed + * @var integer + */ + var $_maxRedirects; + + /** + * Current number of redirects + * @var integer + */ + var $_redirects; + + /** + * Whether to append brackets [] to array variables + * @var bool + */ + var $_useBrackets = true; + + /** + * Attached listeners + * @var array + */ + var $_listeners = array(); + + /** + * Whether to save response body in response object property + * @var bool + */ + var $_saveBody = true; + + /** + * Timeout for reading from socket (array(seconds, microseconds)) + * @var array + */ + var $_readTimeout = null; + + /** + * Options to pass to Net_Socket::connect. See stream_context_create + * @var array + */ + var $_socketOptions = null; + /**#@-*/ + + /** + * Constructor + * + * Sets up the object + * @param string The url to fetch/access + * @param array Associative array of parameters which can have the following keys: + *
    + *
  • method - Method to use, GET, POST etc (string)
  • + *
  • http - HTTP Version to use, 1.0 or 1.1 (string)
  • + *
  • user - Basic Auth username (string)
  • + *
  • pass - Basic Auth password (string)
  • + *
  • proxy_host - Proxy server host (string)
  • + *
  • proxy_port - Proxy server port (integer)
  • + *
  • proxy_user - Proxy auth username (string)
  • + *
  • proxy_pass - Proxy auth password (string)
  • + *
  • timeout - Connection timeout in seconds (float)
  • + *
  • allowRedirects - Whether to follow redirects or not (bool)
  • + *
  • maxRedirects - Max number of redirects to follow (integer)
  • + *
  • useBrackets - Whether to append [] to array variable names (bool)
  • + *
  • saveBody - Whether to save response body in response object property (bool)
  • + *
  • readTimeout - Timeout for reading / writing data over the socket (array (seconds, microseconds))
  • + *
  • socketOptions - Options to pass to Net_Socket object (array)
  • + *
+ * @access public + */ + function HTTP_Request($url = '', $params = array()) + { + $this->_method = HTTP_REQUEST_METHOD_GET; + $this->_http = HTTP_REQUEST_HTTP_VER_1_1; + $this->_requestHeaders = array(); + $this->_postData = array(); + $this->_body = null; + + $this->_user = null; + $this->_pass = null; + + $this->_proxy_host = null; + $this->_proxy_port = null; + $this->_proxy_user = null; + $this->_proxy_pass = null; + + $this->_allowRedirects = false; + $this->_maxRedirects = 3; + $this->_redirects = 0; + + $this->_timeout = null; + $this->_response = null; + + foreach ($params as $key => $value) { + $this->{'_' . $key} = $value; + } + + if (!empty($url)) { + $this->setURL($url); + } + + // Default useragent + $this->addHeader('User-Agent', 'PEAR HTTP_Request class ( http://pear.php.net/ )'); + + // We don't do keep-alives by default + $this->addHeader('Connection', 'close'); + + // Basic authentication + if (!empty($this->_user)) { + $this->addHeader('Authorization', 'Basic ' . base64_encode($this->_user . ':' . $this->_pass)); + } + + // Proxy authentication (see bug #5913) + if (!empty($this->_proxy_user)) { + $this->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($this->_proxy_user . ':' . $this->_proxy_pass)); + } + + // Use gzip encoding if possible + if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && extension_loaded('zlib')) { + $this->addHeader('Accept-Encoding', 'gzip'); + } + } + + /** + * Generates a Host header for HTTP/1.1 requests + * + * @access private + * @return string + */ + function _generateHostHeader() + { + if ($this->_url->port != 80 AND strcasecmp($this->_url->protocol, 'http') == 0) { + $host = $this->_url->host . ':' . $this->_url->port; + + } elseif ($this->_url->port != 443 AND strcasecmp($this->_url->protocol, 'https') == 0) { + $host = $this->_url->host . ':' . $this->_url->port; + + } elseif ($this->_url->port == 443 AND strcasecmp($this->_url->protocol, 'https') == 0 AND strpos($this->_url->url, ':443') !== false) { + $host = $this->_url->host . ':' . $this->_url->port; + + } else { + $host = $this->_url->host; + } + + return $host; + } + + /** + * Resets the object to its initial state (DEPRECATED). + * Takes the same parameters as the constructor. + * + * @param string $url The url to be requested + * @param array $params Associative array of parameters + * (see constructor for details) + * @access public + * @deprecated deprecated since 1.2, call the constructor if this is necessary + */ + function reset($url, $params = array()) + { + $this->HTTP_Request($url, $params); + } + + /** + * Sets the URL to be requested + * + * @param string The url to be requested + * @access public + */ + function setURL($url) + { + $this->_url = &new Net_URL($url, $this->_useBrackets); + + if (!empty($this->_url->user) || !empty($this->_url->pass)) { + $this->setBasicAuth($this->_url->user, $this->_url->pass); + } + + if (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http) { + $this->addHeader('Host', $this->_generateHostHeader()); + } + + // set '/' instead of empty path rather than check later (see bug #8662) + if (empty($this->_url->path)) { + $this->_url->path = '/'; + } + } + + /** + * Returns the current request URL + * + * @return string Current request URL + * @access public + */ + function getUrl() + { + return empty($this->_url)? '': $this->_url->getUrl(); + } + + /** + * Sets a proxy to be used + * + * @param string Proxy host + * @param int Proxy port + * @param string Proxy username + * @param string Proxy password + * @access public + */ + function setProxy($host, $port = 8080, $user = null, $pass = null) + { + $this->_proxy_host = $host; + $this->_proxy_port = $port; + $this->_proxy_user = $user; + $this->_proxy_pass = $pass; + + if (!empty($user)) { + $this->addHeader('Proxy-Authorization', 'Basic ' . base64_encode($user . ':' . $pass)); + } + } + + /** + * Sets basic authentication parameters + * + * @param string Username + * @param string Password + */ + function setBasicAuth($user, $pass) + { + $this->_user = $user; + $this->_pass = $pass; + + $this->addHeader('Authorization', 'Basic ' . base64_encode($user . ':' . $pass)); + } + + /** + * Sets the method to be used, GET, POST etc. + * + * @param string Method to use. Use the defined constants for this + * @access public + */ + function setMethod($method) + { + $this->_method = $method; + } + + /** + * Sets the HTTP version to use, 1.0 or 1.1 + * + * @param string Version to use. Use the defined constants for this + * @access public + */ + function setHttpVer($http) + { + $this->_http = $http; + } + + /** + * Adds a request header + * + * @param string Header name + * @param string Header value + * @access public + */ + function addHeader($name, $value) + { + $this->_requestHeaders[strtolower($name)] = $value; + } + + /** + * Removes a request header + * + * @param string Header name to remove + * @access public + */ + function removeHeader($name) + { + if (isset($this->_requestHeaders[strtolower($name)])) { + unset($this->_requestHeaders[strtolower($name)]); + } + } + + /** + * Adds a querystring parameter + * + * @param string Querystring parameter name + * @param string Querystring parameter value + * @param bool Whether the value is already urlencoded or not, default = not + * @access public + */ + function addQueryString($name, $value, $preencoded = false) + { + $this->_url->addQueryString($name, $value, $preencoded); + } + + /** + * Sets the querystring to literally what you supply + * + * @param string The querystring data. Should be of the format foo=bar&x=y etc + * @param bool Whether data is already urlencoded or not, default = already encoded + * @access public + */ + function addRawQueryString($querystring, $preencoded = true) + { + $this->_url->addRawQueryString($querystring, $preencoded); + } + + /** + * Adds postdata items + * + * @param string Post data name + * @param string Post data value + * @param bool Whether data is already urlencoded or not, default = not + * @access public + */ + function addPostData($name, $value, $preencoded = false) + { + if ($preencoded) { + $this->_postData[$name] = $value; + } else { + $this->_postData[$name] = $this->_arrayMapRecursive('urlencode', $value); + } + } + + /** + * Recursively applies the callback function to the value + * + * @param mixed Callback function + * @param mixed Value to process + * @access private + * @return mixed Processed value + */ + function _arrayMapRecursive($callback, $value) + { + if (!is_array($value)) { + return call_user_func($callback, $value); + } else { + $map = array(); + foreach ($value as $k => $v) { + $map[$k] = $this->_arrayMapRecursive($callback, $v); + } + return $map; + } + } + + /** + * Adds a file to upload + * + * This also changes content-type to 'multipart/form-data' for proper upload + * + * @access public + * @param string name of file-upload field + * @param mixed file name(s) + * @param mixed content-type(s) of file(s) being uploaded + * @return bool true on success + * @throws PEAR_Error + */ + function addFile($inputName, $fileName, $contentType = 'application/octet-stream') + { + if (!is_array($fileName) && !is_readable($fileName)) { + return PEAR::raiseError("File '{$fileName}' is not readable"); + } elseif (is_array($fileName)) { + foreach ($fileName as $name) { + if (!is_readable($name)) { + return PEAR::raiseError("File '{$name}' is not readable"); + } + } + } + $this->addHeader('Content-Type', 'multipart/form-data'); + $this->_postFiles[$inputName] = array( + 'name' => $fileName, + 'type' => $contentType + ); + return true; + } + + /** + * Adds raw postdata (DEPRECATED) + * + * @param string The data + * @param bool Whether data is preencoded or not, default = already encoded + * @access public + * @deprecated deprecated since 1.3.0, method setBody() should be used instead + */ + function addRawPostData($postdata, $preencoded = true) + { + $this->_body = $preencoded ? $postdata : urlencode($postdata); + } + + /** + * Sets the request body (for POST, PUT and similar requests) + * + * @param string Request body + * @access public + */ + function setBody($body) + { + $this->_body = $body; + } + + /** + * Clears any postdata that has been added (DEPRECATED). + * + * Useful for multiple request scenarios. + * + * @access public + * @deprecated deprecated since 1.2 + */ + function clearPostData() + { + $this->_postData = null; + } + + /** + * Appends a cookie to "Cookie:" header + * + * @param string $name cookie name + * @param string $value cookie value + * @access public + */ + function addCookie($name, $value) + { + $cookies = isset($this->_requestHeaders['cookie']) ? $this->_requestHeaders['cookie']. '; ' : ''; + $this->addHeader('Cookie', $cookies . $name . '=' . $value); + } + + /** + * Clears any cookies that have been added (DEPRECATED). + * + * Useful for multiple request scenarios + * + * @access public + * @deprecated deprecated since 1.2 + */ + function clearCookies() + { + $this->removeHeader('Cookie'); + } + + /** + * Sends the request + * + * @access public + * @param bool Whether to store response body in Response object property, + * set this to false if downloading a LARGE file and using a Listener + * @return mixed PEAR error on error, true otherwise + */ + function sendRequest($saveBody = true) + { + if (!is_a($this->_url, 'Net_URL')) { + return PEAR::raiseError('No URL given.'); + } + + $host = isset($this->_proxy_host) ? $this->_proxy_host : $this->_url->host; + $port = isset($this->_proxy_port) ? $this->_proxy_port : $this->_url->port; + + // 4.3.0 supports SSL connections using OpenSSL. The function test determines + // we running on at least 4.3.0 + if (strcasecmp($this->_url->protocol, 'https') == 0 AND function_exists('file_get_contents') AND extension_loaded('openssl')) { + if (isset($this->_proxy_host)) { + return PEAR::raiseError('HTTPS proxies are not supported.'); + } + $host = 'ssl://' . $host; + } + + // magic quotes may fuck up file uploads and chunked response processing + $magicQuotes = ini_get('magic_quotes_runtime'); + ini_set('magic_quotes_runtime', false); + + // RFC 2068, section 19.7.1: A client MUST NOT send the Keep-Alive + // connection token to a proxy server... + if (isset($this->_proxy_host) && !empty($this->_requestHeaders['connection']) && + 'Keep-Alive' == $this->_requestHeaders['connection']) + { + $this->removeHeader('connection'); + } + + $keepAlive = (HTTP_REQUEST_HTTP_VER_1_1 == $this->_http && empty($this->_requestHeaders['connection'])) || + (!empty($this->_requestHeaders['connection']) && 'Keep-Alive' == $this->_requestHeaders['connection']); + $sockets = &PEAR::getStaticProperty('HTTP_Request', 'sockets'); + $sockKey = $host . ':' . $port; + unset($this->_sock); + + // There is a connected socket in the "static" property? + if ($keepAlive && !empty($sockets[$sockKey]) && + !empty($sockets[$sockKey]->fp)) + { + $this->_sock =& $sockets[$sockKey]; + $err = null; + } else { + $this->_notify('connect'); + $this->_sock =& new Net_Socket(); + $err = $this->_sock->connect($host, $port, null, $this->_timeout, $this->_socketOptions); + } + PEAR::isError($err) or $err = $this->_sock->write($this->_buildRequest()); + + if (!PEAR::isError($err)) { + if (!empty($this->_readTimeout)) { + $this->_sock->setTimeout($this->_readTimeout[0], $this->_readTimeout[1]); + } + + $this->_notify('sentRequest'); + + // Read the response + $this->_response = &new HTTP_Response($this->_sock, $this->_listeners); + $err = $this->_response->process( + $this->_saveBody && $saveBody, + HTTP_REQUEST_METHOD_HEAD != $this->_method + ); + + if ($keepAlive) { + $keepAlive = (isset($this->_response->_headers['content-length']) + || (isset($this->_response->_headers['transfer-encoding']) + && strtolower($this->_response->_headers['transfer-encoding']) == 'chunked')); + if ($keepAlive) { + if (isset($this->_response->_headers['connection'])) { + $keepAlive = strtolower($this->_response->_headers['connection']) == 'keep-alive'; + } else { + $keepAlive = 'HTTP/'.HTTP_REQUEST_HTTP_VER_1_1 == $this->_response->_protocol; + } + } + } + } + + ini_set('magic_quotes_runtime', $magicQuotes); + + if (PEAR::isError($err)) { + return $err; + } + + if (!$keepAlive) { + $this->disconnect(); + // Store the connected socket in "static" property + } elseif (empty($sockets[$sockKey]) || empty($sockets[$sockKey]->fp)) { + $sockets[$sockKey] =& $this->_sock; + } + + // Check for redirection + if ( $this->_allowRedirects + AND $this->_redirects <= $this->_maxRedirects + AND $this->getResponseCode() > 300 + AND $this->getResponseCode() < 399 + AND !empty($this->_response->_headers['location'])) { + + + $redirect = $this->_response->_headers['location']; + + // Absolute URL + if (preg_match('/^https?:\/\//i', $redirect)) { + $this->_url = &new Net_URL($redirect); + $this->addHeader('Host', $this->_generateHostHeader()); + // Absolute path + } elseif ($redirect{0} == '/') { + $this->_url->path = $redirect; + + // Relative path + } elseif (substr($redirect, 0, 3) == '../' OR substr($redirect, 0, 2) == './') { + if (substr($this->_url->path, -1) == '/') { + $redirect = $this->_url->path . $redirect; + } else { + $redirect = dirname($this->_url->path) . '/' . $redirect; + } + $redirect = Net_URL::resolvePath($redirect); + $this->_url->path = $redirect; + + // Filename, no path + } else { + if (substr($this->_url->path, -1) == '/') { + $redirect = $this->_url->path . $redirect; + } else { + $redirect = dirname($this->_url->path) . '/' . $redirect; + } + $this->_url->path = $redirect; + } + + $this->_redirects++; + return $this->sendRequest($saveBody); + + // Too many redirects + } elseif ($this->_allowRedirects AND $this->_redirects > $this->_maxRedirects) { + return PEAR::raiseError('Too many redirects'); + } + + return true; + } + + /** + * Disconnect the socket, if connected. Only useful if using Keep-Alive. + * + * @access public + */ + function disconnect() + { + if (!empty($this->_sock) && !empty($this->_sock->fp)) { + $this->_notify('disconnect'); + $this->_sock->disconnect(); + } + } + + /** + * Returns the response code + * + * @access public + * @return mixed Response code, false if not set + */ + function getResponseCode() + { + return isset($this->_response->_code) ? $this->_response->_code : false; + } + + /** + * Returns either the named header or all if no name given + * + * @access public + * @param string The header name to return, do not set to get all headers + * @return mixed either the value of $headername (false if header is not present) + * or an array of all headers + */ + function getResponseHeader($headername = null) + { + if (!isset($headername)) { + return isset($this->_response->_headers)? $this->_response->_headers: array(); + } else { + $headername = strtolower($headername); + return isset($this->_response->_headers[$headername]) ? $this->_response->_headers[$headername] : false; + } + } + + /** + * Returns the body of the response + * + * @access public + * @return mixed response body, false if not set + */ + function getResponseBody() + { + return isset($this->_response->_body) ? $this->_response->_body : false; + } + + /** + * Returns cookies set in response + * + * @access public + * @return mixed array of response cookies, false if none are present + */ + function getResponseCookies() + { + return isset($this->_response->_cookies) ? $this->_response->_cookies : false; + } + + /** + * Builds the request string + * + * @access private + * @return string The request string + */ + function _buildRequest() + { + $separator = ini_get('arg_separator.output'); + ini_set('arg_separator.output', '&'); + $querystring = ($querystring = $this->_url->getQueryString()) ? '?' . $querystring : ''; + ini_set('arg_separator.output', $separator); + + $host = isset($this->_proxy_host) ? $this->_url->protocol . '://' . $this->_url->host : ''; + $port = (isset($this->_proxy_host) AND $this->_url->port != 80) ? ':' . $this->_url->port : ''; + $path = $this->_url->path . $querystring; + $url = $host . $port . $path; + + $request = $this->_method . ' ' . $url . ' HTTP/' . $this->_http . "\r\n"; + + if (in_array($this->_method, $this->_bodyDisallowed) || + (empty($this->_body) && (HTTP_REQUEST_METHOD_POST != $this->_method || + (empty($this->_postData) && empty($this->_postFiles))))) + { + $this->removeHeader('Content-Type'); + } else { + if (empty($this->_requestHeaders['content-type'])) { + // Add default content-type + $this->addHeader('Content-Type', 'application/x-www-form-urlencoded'); + } elseif ('multipart/form-data' == $this->_requestHeaders['content-type']) { + $boundary = 'HTTP_Request_' . md5(uniqid('request') . microtime()); + $this->addHeader('Content-Type', 'multipart/form-data; boundary=' . $boundary); + } + } + + // Request Headers + if (!empty($this->_requestHeaders)) { + foreach ($this->_requestHeaders as $name => $value) { + $canonicalName = implode('-', array_map('ucfirst', explode('-', $name))); + $request .= $canonicalName . ': ' . $value . "\r\n"; + } + } + + // No post data or wrong method, so simply add a final CRLF + if (in_array($this->_method, $this->_bodyDisallowed) || + (HTTP_REQUEST_METHOD_POST != $this->_method && empty($this->_body))) { + + $request .= "\r\n"; + + // Post data if it's an array + } elseif (HTTP_REQUEST_METHOD_POST == $this->_method && + (!empty($this->_postData) || !empty($this->_postFiles))) { + + // "normal" POST request + if (!isset($boundary)) { + $postdata = implode('&', array_map( + create_function('$a', 'return $a[0] . \'=\' . $a[1];'), + $this->_flattenArray('', $this->_postData) + )); + + // multipart request, probably with file uploads + } else { + $postdata = ''; + if (!empty($this->_postData)) { + $flatData = $this->_flattenArray('', $this->_postData); + foreach ($flatData as $item) { + $postdata .= '--' . $boundary . "\r\n"; + $postdata .= 'Content-Disposition: form-data; name="' . $item[0] . '"'; + $postdata .= "\r\n\r\n" . urldecode($item[1]) . "\r\n"; + } + } + foreach ($this->_postFiles as $name => $value) { + if (is_array($value['name'])) { + $varname = $name . ($this->_useBrackets? '[]': ''); + } else { + $varname = $name; + $value['name'] = array($value['name']); + } + foreach ($value['name'] as $key => $filename) { + $fp = fopen($filename, 'r'); + $data = fread($fp, filesize($filename)); + fclose($fp); + $basename = basename($filename); + $type = is_array($value['type'])? @$value['type'][$key]: $value['type']; + + $postdata .= '--' . $boundary . "\r\n"; + $postdata .= 'Content-Disposition: form-data; name="' . $varname . '"; filename="' . $basename . '"'; + $postdata .= "\r\nContent-Type: " . $type; + $postdata .= "\r\n\r\n" . $data . "\r\n"; + } + } + $postdata .= '--' . $boundary . "--\r\n"; + } + $request .= 'Content-Length: ' . + (HTTP_REQUEST_MBSTRING? mb_strlen($postdata, 'iso-8859-1'): strlen($postdata)) . + "\r\n\r\n"; + $request .= $postdata; + + // Explicitly set request body + } elseif (!empty($this->_body)) { + + $request .= 'Content-Length: ' . + (HTTP_REQUEST_MBSTRING? mb_strlen($this->_body, 'iso-8859-1'): strlen($this->_body)) . + "\r\n\r\n"; + $request .= $this->_body; + } + + return $request; + } + + /** + * Helper function to change the (probably multidimensional) associative array + * into the simple one. + * + * @param string name for item + * @param mixed item's values + * @return array array with the following items: array('item name', 'item value'); + * @access private + */ + function _flattenArray($name, $values) + { + if (!is_array($values)) { + return array(array($name, $values)); + } else { + $ret = array(); + foreach ($values as $k => $v) { + if (empty($name)) { + $newName = $k; + } elseif ($this->_useBrackets) { + $newName = $name . '[' . $k . ']'; + } else { + $newName = $name; + } + $ret = array_merge($ret, $this->_flattenArray($newName, $v)); + } + return $ret; + } + } + + + /** + * Adds a Listener to the list of listeners that are notified of + * the object's events + * + * Events sent by HTTP_Request object + * - 'connect': on connection to server + * - 'sentRequest': after the request was sent + * - 'disconnect': on disconnection from server + * + * Events sent by HTTP_Response object + * - 'gotHeaders': after receiving response headers (headers are passed in $data) + * - 'tick': on receiving a part of response body (the part is passed in $data) + * - 'gzTick': on receiving a gzip-encoded part of response body (ditto) + * - 'gotBody': after receiving the response body (passes the decoded body in $data if it was gzipped) + * + * @param HTTP_Request_Listener listener to attach + * @return boolean whether the listener was successfully attached + * @access public + */ + function attach(&$listener) + { + if (!is_a($listener, 'HTTP_Request_Listener')) { + return false; + } + $this->_listeners[$listener->getId()] =& $listener; + return true; + } + + + /** + * Removes a Listener from the list of listeners + * + * @param HTTP_Request_Listener listener to detach + * @return boolean whether the listener was successfully detached + * @access public + */ + function detach(&$listener) + { + if (!is_a($listener, 'HTTP_Request_Listener') || + !isset($this->_listeners[$listener->getId()])) { + return false; + } + unset($this->_listeners[$listener->getId()]); + return true; + } + + + /** + * Notifies all registered listeners of an event. + * + * @param string Event name + * @param mixed Additional data + * @access private + * @see HTTP_Request::attach() + */ + function _notify($event, $data = null) + { + foreach (array_keys($this->_listeners) as $id) { + $this->_listeners[$id]->update($this, $event, $data); + } + } +} + + +/** + * Response class to complement the Request class + * + * @category HTTP + * @package HTTP_Request + * @author Richard Heyes + * @author Alexey Borzov + * @version Release: 1.4.1 + */ +class HTTP_Response +{ + /** + * Socket object + * @var Net_Socket + */ + var $_sock; + + /** + * Protocol + * @var string + */ + var $_protocol; + + /** + * Return code + * @var string + */ + var $_code; + + /** + * Response headers + * @var array + */ + var $_headers; + + /** + * Cookies set in response + * @var array + */ + var $_cookies; + + /** + * Response body + * @var string + */ + var $_body = ''; + + /** + * Used by _readChunked(): remaining length of the current chunk + * @var string + */ + var $_chunkLength = 0; + + /** + * Attached listeners + * @var array + */ + var $_listeners = array(); + + /** + * Bytes left to read from message-body + * @var null|int + */ + var $_toRead; + + /** + * Constructor + * + * @param Net_Socket socket to read the response from + * @param array listeners attached to request + */ + function HTTP_Response(&$sock, &$listeners) + { + $this->_sock =& $sock; + $this->_listeners =& $listeners; + } + + + /** + * Processes a HTTP response + * + * This extracts response code, headers, cookies and decodes body if it + * was encoded in some way + * + * @access public + * @param bool Whether to store response body in object property, set + * this to false if downloading a LARGE file and using a Listener. + * This is assumed to be true if body is gzip-encoded. + * @param bool Whether the response can actually have a message-body. + * Will be set to false for HEAD requests. + * @throws PEAR_Error + * @return mixed true on success, PEAR_Error in case of malformed response + */ + function process($saveBody = true, $canHaveBody = true) + { + do { + $line = $this->_sock->readLine(); + if (sscanf($line, 'HTTP/%s %s', $http_version, $returncode) != 2) { + return PEAR::raiseError('Malformed response.'); + } else { + $this->_protocol = 'HTTP/' . $http_version; + $this->_code = intval($returncode); + } + while ('' !== ($header = $this->_sock->readLine())) { + $this->_processHeader($header); + } + } while (100 == $this->_code); + + $this->_notify('gotHeaders', $this->_headers); + + // RFC 2616, section 4.4: + // 1. Any response message which "MUST NOT" include a message-body ... + // is always terminated by the first empty line after the header fields + // 3. ... If a message is received with both a + // Transfer-Encoding header field and a Content-Length header field, + // the latter MUST be ignored. + $canHaveBody = $canHaveBody && $this->_code >= 200 && + $this->_code != 204 && $this->_code != 304; + + // If response body is present, read it and decode + $chunked = isset($this->_headers['transfer-encoding']) && ('chunked' == $this->_headers['transfer-encoding']); + $gzipped = isset($this->_headers['content-encoding']) && ('gzip' == $this->_headers['content-encoding']); + $hasBody = false; + if ($canHaveBody && ($chunked || !isset($this->_headers['content-length']) || + 0 != $this->_headers['content-length'])) + { + if ($chunked || !isset($this->_headers['content-length'])) { + $this->_toRead = null; + } else { + $this->_toRead = $this->_headers['content-length']; + } + while (!$this->_sock->eof() && (is_null($this->_toRead) || 0 < $this->_toRead)) { + if ($chunked) { + $data = $this->_readChunked(); + } elseif (is_null($this->_toRead)) { + $data = $this->_sock->read(4096); + } else { + $data = $this->_sock->read(min(4096, $this->_toRead)); + $this->_toRead -= HTTP_REQUEST_MBSTRING? mb_strlen($data, 'iso-8859-1'): strlen($data); + } + if ('' == $data) { + break; + } else { + $hasBody = true; + if ($saveBody || $gzipped) { + $this->_body .= $data; + } + $this->_notify($gzipped? 'gzTick': 'tick', $data); + } + } + } + + if ($hasBody) { + // Uncompress the body if needed + if ($gzipped) { + $body = $this->_decodeGzip($this->_body); + if (PEAR::isError($body)) { + return $body; + } + $this->_body = $body; + $this->_notify('gotBody', $this->_body); + } else { + $this->_notify('gotBody'); + } + } + return true; + } + + + /** + * Processes the response header + * + * @access private + * @param string HTTP header + */ + function _processHeader($header) + { + if (false === strpos($header, ':')) { + return; + } + list($headername, $headervalue) = explode(':', $header, 2); + $headername = strtolower($headername); + $headervalue = ltrim($headervalue); + + if ('set-cookie' != $headername) { + if (isset($this->_headers[$headername])) { + $this->_headers[$headername] .= ',' . $headervalue; + } else { + $this->_headers[$headername] = $headervalue; + } + } else { + $this->_parseCookie($headervalue); + } + } + + + /** + * Parse a Set-Cookie header to fill $_cookies array + * + * @access private + * @param string value of Set-Cookie header + */ + function _parseCookie($headervalue) + { + $cookie = array( + 'expires' => null, + 'domain' => null, + 'path' => null, + 'secure' => false + ); + + // Only a name=value pair + if (!strpos($headervalue, ';')) { + $pos = strpos($headervalue, '='); + $cookie['name'] = trim(substr($headervalue, 0, $pos)); + $cookie['value'] = trim(substr($headervalue, $pos + 1)); + + // Some optional parameters are supplied + } else { + $elements = explode(';', $headervalue); + $pos = strpos($elements[0], '='); + $cookie['name'] = trim(substr($elements[0], 0, $pos)); + $cookie['value'] = trim(substr($elements[0], $pos + 1)); + + for ($i = 1; $i < count($elements); $i++) { + if (false === strpos($elements[$i], '=')) { + $elName = trim($elements[$i]); + $elValue = null; + } else { + list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i])); + } + $elName = strtolower($elName); + if ('secure' == $elName) { + $cookie['secure'] = true; + } elseif ('expires' == $elName) { + $cookie['expires'] = str_replace('"', '', $elValue); + } elseif ('path' == $elName || 'domain' == $elName) { + $cookie[$elName] = urldecode($elValue); + } else { + $cookie[$elName] = $elValue; + } + } + } + $this->_cookies[] = $cookie; + } + + + /** + * Read a part of response body encoded with chunked Transfer-Encoding + * + * @access private + * @return string + */ + function _readChunked() + { + // at start of the next chunk? + if (0 == $this->_chunkLength) { + $line = $this->_sock->readLine(); + if (preg_match('/^([0-9a-f]+)/i', $line, $matches)) { + $this->_chunkLength = hexdec($matches[1]); + // Chunk with zero length indicates the end + if (0 == $this->_chunkLength) { + $this->_sock->readLine(); // make this an eof() + return ''; + } + } else { + return ''; + } + } + $data = $this->_sock->read($this->_chunkLength); + $this->_chunkLength -= HTTP_REQUEST_MBSTRING? mb_strlen($data, 'iso-8859-1'): strlen($data); + if (0 == $this->_chunkLength) { + $this->_sock->readLine(); // Trailing CRLF + } + return $data; + } + + + /** + * Notifies all registered listeners of an event. + * + * @param string Event name + * @param mixed Additional data + * @access private + * @see HTTP_Request::_notify() + */ + function _notify($event, $data = null) + { + foreach (array_keys($this->_listeners) as $id) { + $this->_listeners[$id]->update($this, $event, $data); + } + } + + + /** + * Decodes the message-body encoded by gzip + * + * The real decoding work is done by gzinflate() built-in function, this + * method only parses the header and checks data for compliance with + * RFC 1952 + * + * @access private + * @param string gzip-encoded data + * @return string decoded data + */ + function _decodeGzip($data) + { + if (HTTP_REQUEST_MBSTRING) { + $oldEncoding = mb_internal_encoding(); + mb_internal_encoding('iso-8859-1'); + } + $length = strlen($data); + // If it doesn't look like gzip-encoded data, don't bother + if (18 > $length || strcmp(substr($data, 0, 2), "\x1f\x8b")) { + return $data; + } + $method = ord(substr($data, 2, 1)); + if (8 != $method) { + return PEAR::raiseError('_decodeGzip(): unknown compression method'); + } + $flags = ord(substr($data, 3, 1)); + if ($flags & 224) { + return PEAR::raiseError('_decodeGzip(): reserved bits are set'); + } + + // header is 10 bytes minimum. may be longer, though. + $headerLength = 10; + // extra fields, need to skip 'em + if ($flags & 4) { + if ($length - $headerLength - 2 < 8) { + return PEAR::raiseError('_decodeGzip(): data too short'); + } + $extraLength = unpack('v', substr($data, 10, 2)); + if ($length - $headerLength - 2 - $extraLength[1] < 8) { + return PEAR::raiseError('_decodeGzip(): data too short'); + } + $headerLength += $extraLength[1] + 2; + } + // file name, need to skip that + if ($flags & 8) { + if ($length - $headerLength - 1 < 8) { + return PEAR::raiseError('_decodeGzip(): data too short'); + } + $filenameLength = strpos(substr($data, $headerLength), chr(0)); + if (false === $filenameLength || $length - $headerLength - $filenameLength - 1 < 8) { + return PEAR::raiseError('_decodeGzip(): data too short'); + } + $headerLength += $filenameLength + 1; + } + // comment, need to skip that also + if ($flags & 16) { + if ($length - $headerLength - 1 < 8) { + return PEAR::raiseError('_decodeGzip(): data too short'); + } + $commentLength = strpos(substr($data, $headerLength), chr(0)); + if (false === $commentLength || $length - $headerLength - $commentLength - 1 < 8) { + return PEAR::raiseError('_decodeGzip(): data too short'); + } + $headerLength += $commentLength + 1; + } + // have a CRC for header. let's check + if ($flags & 1) { + if ($length - $headerLength - 2 < 8) { + return PEAR::raiseError('_decodeGzip(): data too short'); + } + $crcReal = 0xffff & crc32(substr($data, 0, $headerLength)); + $crcStored = unpack('v', substr($data, $headerLength, 2)); + if ($crcReal != $crcStored[1]) { + return PEAR::raiseError('_decodeGzip(): header CRC check failed'); + } + $headerLength += 2; + } + // unpacked data CRC and size at the end of encoded data + $tmp = unpack('V2', substr($data, -8)); + $dataCrc = $tmp[1]; + $dataSize = $tmp[2]; + + // finally, call the gzinflate() function + $unpacked = @gzinflate(substr($data, $headerLength, -8), $dataSize); + if (false === $unpacked) { + return PEAR::raiseError('_decodeGzip(): gzinflate() call failed'); + } elseif ($dataSize != strlen($unpacked)) { + return PEAR::raiseError('_decodeGzip(): data size check failed'); + } elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) { + return PEAR::raiseError('_decodeGzip(): data CRC check failed'); + } + if (HTTP_REQUEST_MBSTRING) { + mb_internal_encoding($oldEncoding); + } + return $unpacked; + } +} // End class HTTP_Response +?> diff --git a/libs/PEAR/HTTP/Request/Listener.php b/libs/PEAR/HTTP/Request/Listener.php index f0408b004..928ac5e68 100644 --- a/libs/PEAR/HTTP/Request/Listener.php +++ b/libs/PEAR/HTTP/Request/Listener.php @@ -1,106 +1,106 @@ - - * @copyright 2002-2007 Richard Heyes - * @license http://opensource.org/licenses/bsd-license.php New BSD License - * @version CVS: $Id: Listener.php,v 1.3 2007/05/18 10:33:31 avb Exp $ - * @link http://pear.php.net/package/HTTP_Request/ - */ - -/** - * Listener for HTTP_Request and HTTP_Response objects - * - * This class implements the Observer part of a Subject-Observer - * design pattern. - * - * @category HTTP - * @package HTTP_Request - * @author Alexey Borzov - * @version Release: 1.4.1 - */ -class HTTP_Request_Listener -{ - /** - * A listener's identifier - * @var string - */ - var $_id; - - /** - * Constructor, sets the object's identifier - * - * @access public - */ - function HTTP_Request_Listener() - { - $this->_id = md5(uniqid('http_request_', 1)); - } - - - /** - * Returns the listener's identifier - * - * @access public - * @return string - */ - function getId() - { - return $this->_id; - } - - - /** - * This method is called when Listener is notified of an event - * - * @access public - * @param object an object the listener is attached to - * @param string Event name - * @param mixed Additional data - * @abstract - */ - function update(&$subject, $event, $data = null) - { - echo "Notified of event: '$event'\n"; - if (null !== $data) { - echo "Additional data: "; - var_dump($data); - } - } -} -?> + + * @copyright 2002-2007 Richard Heyes + * @license http://opensource.org/licenses/bsd-license.php New BSD License + * @version CVS: $Id: Listener.php,v 1.3 2007/05/18 10:33:31 avb Exp $ + * @link http://pear.php.net/package/HTTP_Request/ + */ + +/** + * Listener for HTTP_Request and HTTP_Response objects + * + * This class implements the Observer part of a Subject-Observer + * design pattern. + * + * @category HTTP + * @package HTTP_Request + * @author Alexey Borzov + * @version Release: 1.4.1 + */ +class HTTP_Request_Listener +{ + /** + * A listener's identifier + * @var string + */ + var $_id; + + /** + * Constructor, sets the object's identifier + * + * @access public + */ + function HTTP_Request_Listener() + { + $this->_id = md5(uniqid('http_request_', 1)); + } + + + /** + * Returns the listener's identifier + * + * @access public + * @return string + */ + function getId() + { + return $this->_id; + } + + + /** + * This method is called when Listener is notified of an event + * + * @access public + * @param object an object the listener is attached to + * @param string Event name + * @param mixed Additional data + * @abstract + */ + function update(&$subject, $event, $data = null) + { + echo "Notified of event: '$event'\n"; + if (null !== $data) { + echo "Additional data: "; + var_dump($data); + } + } +} +?> diff --git a/libs/PEAR/Net/URL.php b/libs/PEAR/Net/URL.php index da48c746b..6331fc0ac 100644 --- a/libs/PEAR/Net/URL.php +++ b/libs/PEAR/Net/URL.php @@ -1,410 +1,410 @@ - | -// +-----------------------------------------------------------------------+ -// -// $Id: URL.php,v 1.36 2004/06/19 18:58:50 richard Exp $ -// -// Net_URL Class - -class Net_URL -{ - /** - * Full url - * @var string - */ - var $url; - - /** - * Protocol - * @var string - */ - var $protocol; - - /** - * Username - * @var string - */ - var $username; - - /** - * Password - * @var string - */ - var $password; - - /** - * Host - * @var string - */ - var $host; - - /** - * Port - * @var integer - */ - var $port; - - /** - * Path - * @var string - */ - var $path; - - /** - * Query string - * @var array - */ - var $querystring; - - /** - * Anchor - * @var string - */ - var $anchor; - - /** - * Whether to use [] - * @var bool - */ - var $useBrackets; - - /** - * PHP4 Constructor - * - * @see __construct() - */ - function Net_URL($url = null, $useBrackets = true) - { - $this->__construct($url, $useBrackets); - } - - /** - * PHP5 Constructor - * - * Parses the given url and stores the various parts - * Defaults are used in certain cases - * - * @param string $url Optional URL - * @param bool $useBrackets Whether to use square brackets when - * multiple querystrings with the same name - * exist - */ - function __construct($url = null, $useBrackets = true) - { - $HTTP_SERVER_VARS = !empty($_SERVER) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; - - $this->useBrackets = $useBrackets; - $this->url = $url; - $this->user = ''; - $this->pass = ''; - $this->host = ''; - $this->port = 80; - $this->path = ''; - $this->querystring = array(); - $this->anchor = ''; - - // Only use defaults if not an absolute URL given - if (!preg_match('/^[a-z0-9]+:\/\//i', $url)) { - - $this->protocol = (@$HTTP_SERVER_VARS['HTTPS'] == 'on' ? 'https' : 'http'); - - /** - * Figure out host/port - */ - if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) AND preg_match('/^(.*)(:([0-9]+))?$/U', $HTTP_SERVER_VARS['HTTP_HOST'], $matches)) { - $host = $matches[1]; - if (!empty($matches[3])) { - $port = $matches[3]; - } else { - $port = $this->getStandardPort($this->protocol); - } - } - - $this->user = ''; - $this->pass = ''; - $this->host = !empty($host) ? $host : (isset($HTTP_SERVER_VARS['SERVER_NAME']) ? $HTTP_SERVER_VARS['SERVER_NAME'] : 'localhost'); - $this->port = !empty($port) ? $port : (isset($HTTP_SERVER_VARS['SERVER_PORT']) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $this->getStandardPort($this->protocol)); - $this->path = !empty($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : '/'; - $this->querystring = isset($HTTP_SERVER_VARS['QUERY_STRING']) ? $this->_parseRawQuerystring($HTTP_SERVER_VARS['QUERY_STRING']) : null; - $this->anchor = ''; - } - - // Parse the url and store the various parts - if (!empty($url)) { - $urlinfo = parse_url($url); - - // Default querystring - $this->querystring = array(); - - foreach ($urlinfo as $key => $value) { - switch ($key) { - case 'scheme': - $this->protocol = $value; - $this->port = $this->getStandardPort($value); - break; - - case 'user': - case 'pass': - case 'host': - case 'port': - $this->$key = $value; - break; - - case 'path': - if ($value{0} == '/') { - $this->path = $value; - } else { - $path = dirname($this->path) == DIRECTORY_SEPARATOR ? '' : dirname($this->path); - $this->path = sprintf('%s/%s', $path, $value); - } - break; - - case 'query': - $this->querystring = $this->_parseRawQueryString($value); - break; - - case 'fragment': - $this->anchor = $value; - break; - } - } - } - } - - /** - * Returns full url - * - * @return string Full url - * @access public - */ - function getURL() - { - $querystring = $this->getQueryString(); - - $this->url = $this->protocol . '://' - . $this->user . (!empty($this->pass) ? ':' : '') - . $this->pass . (!empty($this->user) ? '@' : '') - . $this->host . ($this->port == $this->getStandardPort($this->protocol) ? '' : ':' . $this->port) - . $this->path - . (!empty($querystring) ? '?' . $querystring : '') - . (!empty($this->anchor) ? '#' . $this->anchor : ''); - - return $this->url; - } - - /** - * Adds a querystring item - * - * @param string $name Name of item - * @param string $value Value of item - * @param bool $preencoded Whether value is urlencoded or not, default = not - * @access public - */ - function addQueryString($name, $value, $preencoded = false) - { - if ($preencoded) { - $this->querystring[$name] = $value; - } else { - $this->querystring[$name] = is_array($value) ? array_map('rawurlencode', $value): rawurlencode($value); - } - } - - /** - * Removes a querystring item - * - * @param string $name Name of item - * @access public - */ - function removeQueryString($name) - { - if (isset($this->querystring[$name])) { - unset($this->querystring[$name]); - } - } - - /** - * Sets the querystring to literally what you supply - * - * @param string $querystring The querystring data. Should be of the format foo=bar&x=y etc - * @access public - */ - function addRawQueryString($querystring) - { - $this->querystring = $this->_parseRawQueryString($querystring); - } - - /** - * Returns flat querystring - * - * @return string Querystring - * @access public - */ - function getQueryString() - { - if (!empty($this->querystring)) { - foreach ($this->querystring as $name => $value) { - if (is_array($value)) { - foreach ($value as $k => $v) { - $querystring[] = $this->useBrackets ? sprintf('%s[%s]=%s', $name, $k, $v) : ($name . '=' . $v); - } - } elseif (!is_null($value)) { - $querystring[] = $name . '=' . $value; - } else { - $querystring[] = $name; - } - } - $querystring = implode(ini_get('arg_separator.output'), $querystring); - } else { - $querystring = ''; - } - - return $querystring; - } - - /** - * Parses raw querystring and returns an array of it - * - * @param string $querystring The querystring to parse - * @return array An array of the querystring data - * @access private - */ - function _parseRawQuerystring($querystring) - { - $parts = preg_split('/[' . preg_quote(ini_get('arg_separator.input'), '/') . ']/', $querystring, -1, PREG_SPLIT_NO_EMPTY); - $return = array(); - - foreach ($parts as $part) { - if (strpos($part, '=') !== false) { - $value = substr($part, strpos($part, '=') + 1); - $key = substr($part, 0, strpos($part, '=')); - } else { - $value = null; - $key = $part; - } - if (substr($key, -2) == '[]') { - $key = substr($key, 0, -2); - if (@!is_array($return[$key])) { - $return[$key] = array(); - $return[$key][] = $value; - } else { - $return[$key][] = $value; - } - } elseif (!$this->useBrackets AND !empty($return[$key])) { - $return[$key] = (array)$return[$key]; - $return[$key][] = $value; - } else { - $return[$key] = $value; - } - } - - return $return; - } - - /** - * Resolves //, ../ and ./ from a path and returns - * the result. Eg: - * - * /foo/bar/../boo.php => /foo/boo.php - * /foo/bar/../../boo.php => /boo.php - * /foo/bar/.././/boo.php => /foo/boo.php - * - * This method can also be called statically. - * - * @param string $url URL path to resolve - * @return string The result - */ - function resolvePath($path) - { - $path = explode('/', str_replace('//', '/', $path)); - - for ($i=0; $i 1 OR ($i == 1 AND $path[0] != '') ) ) { - unset($path[$i]); - unset($path[$i-1]); - $path = array_values($path); - $i -= 2; - - } elseif ($path[$i] == '..' AND $i == 1 AND $path[0] == '') { - unset($path[$i]); - $path = array_values($path); - $i--; - - } else { - continue; - } - } - - return implode('/', $path); - } - - /** - * Returns the standard port number for a protocol - * - * @param string $scheme The protocol to lookup - * @return integer Port number or NULL if no scheme matches - * - * @author Philippe Jausions - */ - function getStandardPort($scheme) - { - switch (strtolower($scheme)) { - case 'http': return 80; - case 'https': return 443; - case 'ftp': return 21; - case 'imap': return 143; - case 'imaps': return 993; - case 'pop3': return 110; - case 'pop3s': return 995; - default: return null; - } - } - - /** - * Forces the URL to a particular protocol - * - * @param string $protocol Protocol to force the URL to - * @param integer $port Optional port (standard port is used by default) - */ - function setProtocol($protocol, $port = null) - { - $this->protocol = $protocol; - $this->port = is_null($port) ? $this->getStandardPort() : $port; - } - -} -?> + | +// +-----------------------------------------------------------------------+ +// +// $Id: URL.php,v 1.36 2004/06/19 18:58:50 richard Exp $ +// +// Net_URL Class + +class Net_URL +{ + /** + * Full url + * @var string + */ + var $url; + + /** + * Protocol + * @var string + */ + var $protocol; + + /** + * Username + * @var string + */ + var $username; + + /** + * Password + * @var string + */ + var $password; + + /** + * Host + * @var string + */ + var $host; + + /** + * Port + * @var integer + */ + var $port; + + /** + * Path + * @var string + */ + var $path; + + /** + * Query string + * @var array + */ + var $querystring; + + /** + * Anchor + * @var string + */ + var $anchor; + + /** + * Whether to use [] + * @var bool + */ + var $useBrackets; + + /** + * PHP4 Constructor + * + * @see __construct() + */ + function Net_URL($url = null, $useBrackets = true) + { + $this->__construct($url, $useBrackets); + } + + /** + * PHP5 Constructor + * + * Parses the given url and stores the various parts + * Defaults are used in certain cases + * + * @param string $url Optional URL + * @param bool $useBrackets Whether to use square brackets when + * multiple querystrings with the same name + * exist + */ + function __construct($url = null, $useBrackets = true) + { + $HTTP_SERVER_VARS = !empty($_SERVER) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; + + $this->useBrackets = $useBrackets; + $this->url = $url; + $this->user = ''; + $this->pass = ''; + $this->host = ''; + $this->port = 80; + $this->path = ''; + $this->querystring = array(); + $this->anchor = ''; + + // Only use defaults if not an absolute URL given + if (!preg_match('/^[a-z0-9]+:\/\//i', $url)) { + + $this->protocol = (@$HTTP_SERVER_VARS['HTTPS'] == 'on' ? 'https' : 'http'); + + /** + * Figure out host/port + */ + if (!empty($HTTP_SERVER_VARS['HTTP_HOST']) AND preg_match('/^(.*)(:([0-9]+))?$/U', $HTTP_SERVER_VARS['HTTP_HOST'], $matches)) { + $host = $matches[1]; + if (!empty($matches[3])) { + $port = $matches[3]; + } else { + $port = $this->getStandardPort($this->protocol); + } + } + + $this->user = ''; + $this->pass = ''; + $this->host = !empty($host) ? $host : (isset($HTTP_SERVER_VARS['SERVER_NAME']) ? $HTTP_SERVER_VARS['SERVER_NAME'] : 'localhost'); + $this->port = !empty($port) ? $port : (isset($HTTP_SERVER_VARS['SERVER_PORT']) ? $HTTP_SERVER_VARS['SERVER_PORT'] : $this->getStandardPort($this->protocol)); + $this->path = !empty($HTTP_SERVER_VARS['PHP_SELF']) ? $HTTP_SERVER_VARS['PHP_SELF'] : '/'; + $this->querystring = isset($HTTP_SERVER_VARS['QUERY_STRING']) ? $this->_parseRawQuerystring($HTTP_SERVER_VARS['QUERY_STRING']) : null; + $this->anchor = ''; + } + + // Parse the url and store the various parts + if (!empty($url)) { + $urlinfo = parse_url($url); + + // Default querystring + $this->querystring = array(); + + foreach ($urlinfo as $key => $value) { + switch ($key) { + case 'scheme': + $this->protocol = $value; + $this->port = $this->getStandardPort($value); + break; + + case 'user': + case 'pass': + case 'host': + case 'port': + $this->$key = $value; + break; + + case 'path': + if ($value{0} == '/') { + $this->path = $value; + } else { + $path = dirname($this->path) == DIRECTORY_SEPARATOR ? '' : dirname($this->path); + $this->path = sprintf('%s/%s', $path, $value); + } + break; + + case 'query': + $this->querystring = $this->_parseRawQueryString($value); + break; + + case 'fragment': + $this->anchor = $value; + break; + } + } + } + } + + /** + * Returns full url + * + * @return string Full url + * @access public + */ + function getURL() + { + $querystring = $this->getQueryString(); + + $this->url = $this->protocol . '://' + . $this->user . (!empty($this->pass) ? ':' : '') + . $this->pass . (!empty($this->user) ? '@' : '') + . $this->host . ($this->port == $this->getStandardPort($this->protocol) ? '' : ':' . $this->port) + . $this->path + . (!empty($querystring) ? '?' . $querystring : '') + . (!empty($this->anchor) ? '#' . $this->anchor : ''); + + return $this->url; + } + + /** + * Adds a querystring item + * + * @param string $name Name of item + * @param string $value Value of item + * @param bool $preencoded Whether value is urlencoded or not, default = not + * @access public + */ + function addQueryString($name, $value, $preencoded = false) + { + if ($preencoded) { + $this->querystring[$name] = $value; + } else { + $this->querystring[$name] = is_array($value) ? array_map('rawurlencode', $value): rawurlencode($value); + } + } + + /** + * Removes a querystring item + * + * @param string $name Name of item + * @access public + */ + function removeQueryString($name) + { + if (isset($this->querystring[$name])) { + unset($this->querystring[$name]); + } + } + + /** + * Sets the querystring to literally what you supply + * + * @param string $querystring The querystring data. Should be of the format foo=bar&x=y etc + * @access public + */ + function addRawQueryString($querystring) + { + $this->querystring = $this->_parseRawQueryString($querystring); + } + + /** + * Returns flat querystring + * + * @return string Querystring + * @access public + */ + function getQueryString() + { + if (!empty($this->querystring)) { + foreach ($this->querystring as $name => $value) { + if (is_array($value)) { + foreach ($value as $k => $v) { + $querystring[] = $this->useBrackets ? sprintf('%s[%s]=%s', $name, $k, $v) : ($name . '=' . $v); + } + } elseif (!is_null($value)) { + $querystring[] = $name . '=' . $value; + } else { + $querystring[] = $name; + } + } + $querystring = implode(ini_get('arg_separator.output'), $querystring); + } else { + $querystring = ''; + } + + return $querystring; + } + + /** + * Parses raw querystring and returns an array of it + * + * @param string $querystring The querystring to parse + * @return array An array of the querystring data + * @access private + */ + function _parseRawQuerystring($querystring) + { + $parts = preg_split('/[' . preg_quote(ini_get('arg_separator.input'), '/') . ']/', $querystring, -1, PREG_SPLIT_NO_EMPTY); + $return = array(); + + foreach ($parts as $part) { + if (strpos($part, '=') !== false) { + $value = substr($part, strpos($part, '=') + 1); + $key = substr($part, 0, strpos($part, '=')); + } else { + $value = null; + $key = $part; + } + if (substr($key, -2) == '[]') { + $key = substr($key, 0, -2); + if (@!is_array($return[$key])) { + $return[$key] = array(); + $return[$key][] = $value; + } else { + $return[$key][] = $value; + } + } elseif (!$this->useBrackets AND !empty($return[$key])) { + $return[$key] = (array)$return[$key]; + $return[$key][] = $value; + } else { + $return[$key] = $value; + } + } + + return $return; + } + + /** + * Resolves //, ../ and ./ from a path and returns + * the result. Eg: + * + * /foo/bar/../boo.php => /foo/boo.php + * /foo/bar/../../boo.php => /boo.php + * /foo/bar/.././/boo.php => /foo/boo.php + * + * This method can also be called statically. + * + * @param string $url URL path to resolve + * @return string The result + */ + function resolvePath($path) + { + $path = explode('/', str_replace('//', '/', $path)); + + for ($i=0; $i 1 OR ($i == 1 AND $path[0] != '') ) ) { + unset($path[$i]); + unset($path[$i-1]); + $path = array_values($path); + $i -= 2; + + } elseif ($path[$i] == '..' AND $i == 1 AND $path[0] == '') { + unset($path[$i]); + $path = array_values($path); + $i--; + + } else { + continue; + } + } + + return implode('/', $path); + } + + /** + * Returns the standard port number for a protocol + * + * @param string $scheme The protocol to lookup + * @return integer Port number or NULL if no scheme matches + * + * @author Philippe Jausions + */ + function getStandardPort($scheme) + { + switch (strtolower($scheme)) { + case 'http': return 80; + case 'https': return 443; + case 'ftp': return 21; + case 'imap': return 143; + case 'imaps': return 993; + case 'pop3': return 110; + case 'pop3s': return 995; + default: return null; + } + } + + /** + * Forces the URL to a particular protocol + * + * @param string $protocol Protocol to force the URL to + * @param integer $port Optional port (standard port is used by default) + */ + function setProtocol($protocol, $port = null) + { + $this->protocol = $protocol; + $this->port = is_null($port) ? $this->getStandardPort() : $port; + } + +} +?> diff --git a/libs/ftp.class.php b/libs/ftp.class.php index d49a2efbb..417a3a83b 100644 --- a/libs/ftp.class.php +++ b/libs/ftp.class.php @@ -1,530 +1,530 @@ -debug = false; - $this->umask = 0022; - $this->timeout = 30; - - if (!defined("FTP_BINARY")) { - define("FTP_BINARY", 1); - } - if (!defined("FTP_ASCII")) { - define("FTP_ASCII", 0); - } - - $this->ftp_resp = ""; - } - - /* Public functions */ - function ftp_connect($server, $port = 21) - { - $this->ftp_debug("Trying to ".$server.":".$port." ...\n"); - $this->ftp_sock = @fsockopen($server, $port, $errno, $errstr, $this->timeout); - - if (!$this->ftp_sock || !$this->ftp_ok()) { - $this->ftp_debug("Error : Cannot connect to remote host \"".$server.":".$port."\"\n"); - $this->ftp_debug("Error : fsockopen() ".$errstr." (".$errno.")\n"); - return FALSE; - } - $this->ftp_debug("Connected to remote host \"".$server.":".$port."\"\n"); - - return TRUE; - } - - function ftp_login($user, $pass) - { - $this->ftp_putcmd("USER", $user); - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : USER command failed\n"); - return FALSE; - } - - $this->ftp_putcmd("PASS", $pass); - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : PASS command failed\n"); - return FALSE; - } - $this->ftp_debug("Authentication succeeded\n"); - - return TRUE; - } - - function ftp_pwd() - { - $this->ftp_putcmd("PWD"); - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : PWD command failed\n"); - return FALSE; - } - - return preg_replace("@^[0-9]{3} \"(.+)\" .+\r\n@", "\\1", $this->ftp_resp); - } - - function ftp_size($pathname) - { - $this->ftp_putcmd("SIZE", $pathname); - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : SIZE command failed\n"); - return -1; - } - - return preg_replace("@^[0-9]{3} ([0-9]+)\r\n@", "\\1", $this->ftp_resp); - } - - function ftp_mdtm($pathname) - { - $this->ftp_putcmd("MDTM", $pathname); - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : MDTM command failed\n"); - return -1; - } - $mdtm = preg_replace("@^[0-9]{3} ([0-9]+)\r\n@", "\\1", $this->ftp_resp); - $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); - $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); - - return $timestamp; - } - - function ftp_systype() - { - $this->ftp_putcmd("SYST"); - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : SYST command failed\n"); - return FALSE; - } - $DATA = explode(" ", $this->ftp_resp); - - return $DATA[1]; - } - - function ftp_cdup() - { - $this->ftp_putcmd("CDUP"); - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : CDUP command failed\n"); - } - return $response; - } - - function ftp_chdir($pathname) - { - $this->ftp_putcmd("CWD", $pathname); - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : CWD command failed\n"); - } - return $response; - } - - function ftp_delete($pathname) - { - $this->ftp_putcmd("DELE", $pathname); - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : DELE command failed\n"); - } - return $response; - } - - function ftp_rmdir($pathname) - { - $this->ftp_putcmd("RMD", $pathname); - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : RMD command failed\n"); - } - return $response; - } - - function ftp_mkdir($pathname) - { - $this->ftp_putcmd("MKD", $pathname); - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : MKD command failed\n"); - } - return $response; - } - - function ftp_file_exists($pathname) - { - if (!($remote_list = $this->ftp_nlist("-a"))) { - $this->ftp_debug("Error : Cannot get remote file list\n"); - return -1; - } - - reset($remote_list); - while (list(,$value) = each($remote_list)) { - if ($value == $pathname) { - $this->ftp_debug("Remote file ".$pathname." exists\n"); - return 1; - } - } - $this->ftp_debug("Remote file ".$pathname." does not exist\n"); - - return 0; - } - - function ftp_rename($from, $to) - { - $this->ftp_putcmd("RNFR", $from); - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : RNFR command failed\n"); - return FALSE; - } - $this->ftp_putcmd("RNTO", $to); - - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : RNTO command failed\n"); - } - return $response; - } - - function ftp_nlist($arg = "", $pathname = "") - { - if (!($string = $this->ftp_pasv())) { - return FALSE; - } - - if ($arg == "") { - $nlst = "NLST"; - } else { - $nlst = "NLST ".$arg; - } - $this->ftp_putcmd($nlst, $pathname); - - $sock_data = $this->ftp_open_data_connection($string); - if (!$sock_data || !$this->ftp_ok()) { - $this->ftp_debug("Error : Cannot connect to remote host\n"); - $this->ftp_debug("Error : NLST command failed\n"); - return FALSE; - } - $this->ftp_debug("Connected to remote host\n"); - - $list = array(); - while (!feof($sock_data)) { - $list[] = preg_replace("@[\r\n]@", "", fgets($sock_data, 512)); - } - $this->ftp_close_data_connection($sock_data); - $this->ftp_debug(implode("\n", $list)); - - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : NLST command failed\n"); - return FALSE; - } - - return $list; - } - - function ftp_rawlist($pathname = "") - { - if (!($string = $this->ftp_pasv())) { - return FALSE; - } - - $this->ftp_putcmd("LIST", $pathname); - - $sock_data = $this->ftp_open_data_connection($string); - if (!$sock_data || !$this->ftp_ok()) { - $this->ftp_debug("Error : Cannot connect to remote host\n"); - $this->ftp_debug("Error : LIST command failed\n"); - return FALSE; - } - - $this->ftp_debug("Connected to remote host\n"); - - while (!feof($sock_data)) { - $list[] = preg_replace("@[\r\n]@", "", fgets($sock_data, 512)); - } - $this->ftp_debug(implode("\n", $list)); - $this->ftp_close_data_connection($sock_data); - - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : LIST command failed\n"); - return FALSE; - } - - return $list; - } - - function ftp_get($localfile, $remotefile, $mode = 1) - { - umask($this->umask); - - if (@file_exists($localfile)) { - $this->ftp_debug("Warning : local file will be overwritten\n"); - } - - $fp = @fopen($localfile, "w"); - if (!$fp) { - $this->ftp_debug("Error : Cannot create \"".$localfile."\""); - $this->ftp_debug("Error : GET command failed\n"); - return FALSE; - } - - if (!$this->ftp_type($mode)) { - $this->ftp_debug("Error : GET command failed\n"); - return FALSE; - } - - if (!($string = $this->ftp_pasv())) { - $this->ftp_debug("Error : GET command failed\n"); - return FALSE; - } - - $this->ftp_putcmd("RETR", $remotefile); - - $sock_data = $this->ftp_open_data_connection($string); - if (!$sock_data || !$this->ftp_ok()) { - $this->ftp_debug("Error : Cannot connect to remote host\n"); - $this->ftp_debug("Error : GET command failed\n"); - return FALSE; - } - $this->ftp_debug("Connected to remote host\n"); - $this->ftp_debug("Retrieving remote file \"".$remotefile."\" to local file \"".$localfile."\"\n"); - while (!feof($sock_data)) { - fputs($fp, fread($sock_data, 4096)); - } - fclose($fp); - - $this->ftp_close_data_connection($sock_data); - - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : GET command failed\n"); - } - return $response; - } - - function ftp_put($remotefile, $localfile, $mode = 1) - { - - if (!@file_exists($localfile)) { - $this->ftp_debug("Error : No such file or directory \"".$localfile."\"\n"); - $this->ftp_debug("Error : PUT command failed\n"); - return FALSE; - } - - $fp = @fopen($localfile, "r"); - if (!$fp) { - $this->ftp_debug("Error : Cannot read file \"".$localfile."\"\n"); - $this->ftp_debug("Error : PUT command failed\n"); - return FALSE; - } - - if (!$this->ftp_type($mode)) { - $this->ftp_debug("Error : PUT command failed\n"); - return FALSE; - } - - if (!($string = $this->ftp_pasv())) { - $this->ftp_debug("Error : PUT command failed\n"); - return FALSE; - } - - $this->ftp_putcmd("STOR", $remotefile); - - $sock_data = $this->ftp_open_data_connection($string); - if (!$sock_data || !$this->ftp_ok()) { - $this->ftp_debug("Error : Cannot connect to remote host\n"); - $this->ftp_debug("Error : PUT command failed\n"); - return FALSE; - } - $this->ftp_debug("Connected to remote host\n"); - $this->ftp_debug("Storing local file \"".$localfile."\" to remote file \"".$remotefile."\"\n"); - while (!feof($fp)) { - fputs($sock_data, fread($fp, 4096)); - } - fclose($fp); - - $this->ftp_close_data_connection($sock_data); - - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : PUT command failed\n"); - } - return $response; - } - - function ftp_site($command) - { - $this->ftp_putcmd("SITE", $command); - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : SITE command failed\n"); - } - return $response; - } - - function ftp_quit() - { - $this->ftp_putcmd("QUIT"); - if (!$this->ftp_ok() || !fclose($this->ftp_sock)) { - $this->ftp_debug("Error : QUIT command failed\n"); - return FALSE; - } - $this->ftp_debug("Disconnected from remote host\n"); - return TRUE; - } - - /* Private Functions */ - - function ftp_type($mode) - { - if ($mode) { - $type = "I"; //Binary mode - } else { - $type = "A"; //ASCII mode - } - $this->ftp_putcmd("TYPE", $type); - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : TYPE command failed\n"); - } - return $response; - } - - function ftp_port($ip_port) - { - $this->ftp_putcmd("PORT", $ip_port); - $response = $this->ftp_ok(); - if (!$response) { - $this->ftp_debug("Error : PORT command failed\n"); - } - return $response; - } - - function ftp_pasv() - { - $this->ftp_putcmd("PASV"); - if (!$this->ftp_ok()) { - $this->ftp_debug("Error : PASV command failed\n"); - return FALSE; - } - - $ip_port = preg_replace("@^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*\r\n$@", "\\1", $this->ftp_resp); - return $ip_port; - } - - function ftp_putcmd($cmd, $arg = "") - { - if ($arg != "") { - $cmd = $cmd." ".$arg; - } - - fputs($this->ftp_sock, $cmd."\r\n"); - $this->ftp_debug("> ".$cmd."\n"); - - return TRUE; - } - - function ftp_ok() - { - $this->ftp_resp = ""; - do { - $res = fgets($this->ftp_sock, 512); - $this->ftp_resp .= $res; - } while (substr($res, 3, 1) != " "); - - $this->ftp_debug(str_replace("\r\n", "\n", $this->ftp_resp)); - - if (!preg_match("@^[123]@", $this->ftp_resp)) { - return FALSE; - } - - return TRUE; - } - - function ftp_close_data_connection($sock) - { - $this->ftp_debug("Disconnected from remote host\n"); - return fclose($sock); - } - - function ftp_open_data_connection($ip_port) - { - if (!preg_match("@[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+@", $ip_port)) { - $this->ftp_debug("Error : Illegal ip-port format(".$ip_port.")\n"); - return FALSE; - } - - $DATA = explode(",", $ip_port); - $ipaddr = $DATA[0].".".$DATA[1].".".$DATA[2].".".$DATA[3]; - $port = $DATA[4]*256 + $DATA[5]; - $this->ftp_debug("Trying to ".$ipaddr.":".$port." ...\n"); - $data_connection = @fsockopen($ipaddr, $port, $errno, $errstr); - if (!$data_connection) { - $this->ftp_debug("Error : Cannot open data connection to ".$ipaddr.":".$port."\n"); - $this->ftp_debug("Error : ".$errstr." (".$errno.")\n"); - return FALSE; - } - - return $data_connection; - } - - function ftp_debug($message = "") - { - if ($this->debug) { - echo $message; - } - - return TRUE; - } - } -?> +debug = false; + $this->umask = 0022; + $this->timeout = 30; + + if (!defined("FTP_BINARY")) { + define("FTP_BINARY", 1); + } + if (!defined("FTP_ASCII")) { + define("FTP_ASCII", 0); + } + + $this->ftp_resp = ""; + } + + /* Public functions */ + function ftp_connect($server, $port = 21) + { + $this->ftp_debug("Trying to ".$server.":".$port." ...\n"); + $this->ftp_sock = @fsockopen($server, $port, $errno, $errstr, $this->timeout); + + if (!$this->ftp_sock || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host \"".$server.":".$port."\"\n"); + $this->ftp_debug("Error : fsockopen() ".$errstr." (".$errno.")\n"); + return FALSE; + } + $this->ftp_debug("Connected to remote host \"".$server.":".$port."\"\n"); + + return TRUE; + } + + function ftp_login($user, $pass) + { + $this->ftp_putcmd("USER", $user); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : USER command failed\n"); + return FALSE; + } + + $this->ftp_putcmd("PASS", $pass); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : PASS command failed\n"); + return FALSE; + } + $this->ftp_debug("Authentication succeeded\n"); + + return TRUE; + } + + function ftp_pwd() + { + $this->ftp_putcmd("PWD"); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : PWD command failed\n"); + return FALSE; + } + + return preg_replace("@^[0-9]{3} \"(.+)\" .+\r\n@", "\\1", $this->ftp_resp); + } + + function ftp_size($pathname) + { + $this->ftp_putcmd("SIZE", $pathname); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : SIZE command failed\n"); + return -1; + } + + return preg_replace("@^[0-9]{3} ([0-9]+)\r\n@", "\\1", $this->ftp_resp); + } + + function ftp_mdtm($pathname) + { + $this->ftp_putcmd("MDTM", $pathname); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : MDTM command failed\n"); + return -1; + } + $mdtm = preg_replace("@^[0-9]{3} ([0-9]+)\r\n@", "\\1", $this->ftp_resp); + $date = sscanf($mdtm, "%4d%2d%2d%2d%2d%2d"); + $timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]); + + return $timestamp; + } + + function ftp_systype() + { + $this->ftp_putcmd("SYST"); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : SYST command failed\n"); + return FALSE; + } + $DATA = explode(" ", $this->ftp_resp); + + return $DATA[1]; + } + + function ftp_cdup() + { + $this->ftp_putcmd("CDUP"); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : CDUP command failed\n"); + } + return $response; + } + + function ftp_chdir($pathname) + { + $this->ftp_putcmd("CWD", $pathname); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : CWD command failed\n"); + } + return $response; + } + + function ftp_delete($pathname) + { + $this->ftp_putcmd("DELE", $pathname); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : DELE command failed\n"); + } + return $response; + } + + function ftp_rmdir($pathname) + { + $this->ftp_putcmd("RMD", $pathname); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : RMD command failed\n"); + } + return $response; + } + + function ftp_mkdir($pathname) + { + $this->ftp_putcmd("MKD", $pathname); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : MKD command failed\n"); + } + return $response; + } + + function ftp_file_exists($pathname) + { + if (!($remote_list = $this->ftp_nlist("-a"))) { + $this->ftp_debug("Error : Cannot get remote file list\n"); + return -1; + } + + reset($remote_list); + while (list(,$value) = each($remote_list)) { + if ($value == $pathname) { + $this->ftp_debug("Remote file ".$pathname." exists\n"); + return 1; + } + } + $this->ftp_debug("Remote file ".$pathname." does not exist\n"); + + return 0; + } + + function ftp_rename($from, $to) + { + $this->ftp_putcmd("RNFR", $from); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : RNFR command failed\n"); + return FALSE; + } + $this->ftp_putcmd("RNTO", $to); + + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : RNTO command failed\n"); + } + return $response; + } + + function ftp_nlist($arg = "", $pathname = "") + { + if (!($string = $this->ftp_pasv())) { + return FALSE; + } + + if ($arg == "") { + $nlst = "NLST"; + } else { + $nlst = "NLST ".$arg; + } + $this->ftp_putcmd($nlst, $pathname); + + $sock_data = $this->ftp_open_data_connection($string); + if (!$sock_data || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host\n"); + $this->ftp_debug("Error : NLST command failed\n"); + return FALSE; + } + $this->ftp_debug("Connected to remote host\n"); + + $list = array(); + while (!feof($sock_data)) { + $list[] = preg_replace("@[\r\n]@", "", fgets($sock_data, 512)); + } + $this->ftp_close_data_connection($sock_data); + $this->ftp_debug(implode("\n", $list)); + + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : NLST command failed\n"); + return FALSE; + } + + return $list; + } + + function ftp_rawlist($pathname = "") + { + if (!($string = $this->ftp_pasv())) { + return FALSE; + } + + $this->ftp_putcmd("LIST", $pathname); + + $sock_data = $this->ftp_open_data_connection($string); + if (!$sock_data || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host\n"); + $this->ftp_debug("Error : LIST command failed\n"); + return FALSE; + } + + $this->ftp_debug("Connected to remote host\n"); + + while (!feof($sock_data)) { + $list[] = preg_replace("@[\r\n]@", "", fgets($sock_data, 512)); + } + $this->ftp_debug(implode("\n", $list)); + $this->ftp_close_data_connection($sock_data); + + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : LIST command failed\n"); + return FALSE; + } + + return $list; + } + + function ftp_get($localfile, $remotefile, $mode = 1) + { + umask($this->umask); + + if (@file_exists($localfile)) { + $this->ftp_debug("Warning : local file will be overwritten\n"); + } + + $fp = @fopen($localfile, "w"); + if (!$fp) { + $this->ftp_debug("Error : Cannot create \"".$localfile."\""); + $this->ftp_debug("Error : GET command failed\n"); + return FALSE; + } + + if (!$this->ftp_type($mode)) { + $this->ftp_debug("Error : GET command failed\n"); + return FALSE; + } + + if (!($string = $this->ftp_pasv())) { + $this->ftp_debug("Error : GET command failed\n"); + return FALSE; + } + + $this->ftp_putcmd("RETR", $remotefile); + + $sock_data = $this->ftp_open_data_connection($string); + if (!$sock_data || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host\n"); + $this->ftp_debug("Error : GET command failed\n"); + return FALSE; + } + $this->ftp_debug("Connected to remote host\n"); + $this->ftp_debug("Retrieving remote file \"".$remotefile."\" to local file \"".$localfile."\"\n"); + while (!feof($sock_data)) { + fputs($fp, fread($sock_data, 4096)); + } + fclose($fp); + + $this->ftp_close_data_connection($sock_data); + + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : GET command failed\n"); + } + return $response; + } + + function ftp_put($remotefile, $localfile, $mode = 1) + { + + if (!@file_exists($localfile)) { + $this->ftp_debug("Error : No such file or directory \"".$localfile."\"\n"); + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + + $fp = @fopen($localfile, "r"); + if (!$fp) { + $this->ftp_debug("Error : Cannot read file \"".$localfile."\"\n"); + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + + if (!$this->ftp_type($mode)) { + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + + if (!($string = $this->ftp_pasv())) { + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + + $this->ftp_putcmd("STOR", $remotefile); + + $sock_data = $this->ftp_open_data_connection($string); + if (!$sock_data || !$this->ftp_ok()) { + $this->ftp_debug("Error : Cannot connect to remote host\n"); + $this->ftp_debug("Error : PUT command failed\n"); + return FALSE; + } + $this->ftp_debug("Connected to remote host\n"); + $this->ftp_debug("Storing local file \"".$localfile."\" to remote file \"".$remotefile."\"\n"); + while (!feof($fp)) { + fputs($sock_data, fread($fp, 4096)); + } + fclose($fp); + + $this->ftp_close_data_connection($sock_data); + + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : PUT command failed\n"); + } + return $response; + } + + function ftp_site($command) + { + $this->ftp_putcmd("SITE", $command); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : SITE command failed\n"); + } + return $response; + } + + function ftp_quit() + { + $this->ftp_putcmd("QUIT"); + if (!$this->ftp_ok() || !fclose($this->ftp_sock)) { + $this->ftp_debug("Error : QUIT command failed\n"); + return FALSE; + } + $this->ftp_debug("Disconnected from remote host\n"); + return TRUE; + } + + /* Private Functions */ + + function ftp_type($mode) + { + if ($mode) { + $type = "I"; //Binary mode + } else { + $type = "A"; //ASCII mode + } + $this->ftp_putcmd("TYPE", $type); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : TYPE command failed\n"); + } + return $response; + } + + function ftp_port($ip_port) + { + $this->ftp_putcmd("PORT", $ip_port); + $response = $this->ftp_ok(); + if (!$response) { + $this->ftp_debug("Error : PORT command failed\n"); + } + return $response; + } + + function ftp_pasv() + { + $this->ftp_putcmd("PASV"); + if (!$this->ftp_ok()) { + $this->ftp_debug("Error : PASV command failed\n"); + return FALSE; + } + + $ip_port = preg_replace("@^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*\r\n$@", "\\1", $this->ftp_resp); + return $ip_port; + } + + function ftp_putcmd($cmd, $arg = "") + { + if ($arg != "") { + $cmd = $cmd." ".$arg; + } + + fputs($this->ftp_sock, $cmd."\r\n"); + $this->ftp_debug("> ".$cmd."\n"); + + return TRUE; + } + + function ftp_ok() + { + $this->ftp_resp = ""; + do { + $res = fgets($this->ftp_sock, 512); + $this->ftp_resp .= $res; + } while (substr($res, 3, 1) != " "); + + $this->ftp_debug(str_replace("\r\n", "\n", $this->ftp_resp)); + + if (!preg_match("@^[123]@", $this->ftp_resp)) { + return FALSE; + } + + return TRUE; + } + + function ftp_close_data_connection($sock) + { + $this->ftp_debug("Disconnected from remote host\n"); + return fclose($sock); + } + + function ftp_open_data_connection($ip_port) + { + if (!preg_match("@[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+@", $ip_port)) { + $this->ftp_debug("Error : Illegal ip-port format(".$ip_port.")\n"); + return FALSE; + } + + $DATA = explode(",", $ip_port); + $ipaddr = $DATA[0].".".$DATA[1].".".$DATA[2].".".$DATA[3]; + $port = $DATA[4]*256 + $DATA[5]; + $this->ftp_debug("Trying to ".$ipaddr.":".$port." ...\n"); + $data_connection = @fsockopen($ipaddr, $port, $errno, $errstr); + if (!$data_connection) { + $this->ftp_debug("Error : Cannot open data connection to ".$ipaddr.":".$port."\n"); + $this->ftp_debug("Error : ".$errstr." (".$errno.")\n"); + return FALSE; + } + + return $data_connection; + } + + function ftp_debug($message = "") + { + if ($this->debug) { + echo $message; + } + + return TRUE; + } + } +?> diff --git a/libs/tar.class.php b/libs/tar.class.php index d6d72f4e4..66294278d 100644 --- a/libs/tar.class.php +++ b/libs/tar.class.php @@ -1,558 +1,558 @@ - - -Description: - This class reads and writes Tape-Archive (TAR) Files and Gzip - compressed TAR files, which are mainly used on UNIX systems. - This class works on both windows AND unix systems, and does - NOT rely on external applications!! Woohoo! - -Usage: - Copyright (C) 2002 Josh Barger - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details at: - http://www.gnu.org/copyleft/lesser.html - - If you use this script in your application/website, please - send me an e-mail letting me know about it :) - -Bugs: - Please report any bugs you might find to my e-mail address - at joshb@npt.com. If you have already created a fix/patch - for the bug, please do send it to me so I can incorporate it into my release. - -Version History: - 1.0 04/10/2002 - InitialRelease - - 2.0 04/11/2002 - Merged both tarReader and tarWriter - classes into one - - Added support for gzipped tar files - Remember to name for .tar.gz or .tgz - if you use gzip compression! - :: THIS REQUIRES ZLIB EXTENSION :: - - Added additional comments to - functions to help users - - Added ability to remove files and - directories from archive - 2.1 04/12/2002 - Fixed serious bug in generating tar - - Created another example file - - Added check to make sure ZLIB is - installed before running GZIP - compression on TAR - 2.2 05/07/2002 - Added automatic detection of Gzipped - tar files (Thanks go to J?gen Falch - for the idea) - - Changed "private" functions to have - special function names beginning with - two underscores -======================================================================= -*/ - -class tar { - // Unprocessed Archive Information - var $filename; - var $isGzipped; - var $tar_file; - - // Processed Archive Information - var $files; - var $directories; - var $numFiles; - var $numDirectories; - - - // Class Constructor -- Does nothing... - function tar() { - return true; - } - - - // Computes the unsigned Checksum of a file's header - // to try to ensure valid file - // PRIVATE ACCESS FUNCTION - function __computeUnsignedChecksum($bytestring) { - for($i=0; $i<512; $i++) - $unsigned_chksum += ord($bytestring[$i]); - for($i=0; $i<8; $i++) - $unsigned_chksum -= ord($bytestring[148 + $i]); - $unsigned_chksum += ord(" ") * 8; - - return $unsigned_chksum; - } - - - // Converts a NULL padded string to a non-NULL padded string - // PRIVATE ACCESS FUNCTION - function __parseNullPaddedString($string) { - $position = strpos($string,chr(0)); - return substr($string,0,$position); - } - - - // This function parses the current TAR file - // PRIVATE ACCESS FUNCTION - function __parseTar() { - // Read Files from archive - $tar_length = strlen($this->tar_file); - $main_offset = 0; - while($main_offset < $tar_length) { - // If we read a block of 512 nulls, we are at the end of the archive - if(substr($this->tar_file,$main_offset,512) == str_repeat(chr(0),512)) - break; - - // Parse file name - $file_name = $this->__parseNullPaddedString(substr($this->tar_file,$main_offset,100)); - - // Parse the file mode - $file_mode = substr($this->tar_file,$main_offset + 100,8); - - // Parse the file user ID - $file_uid = octdec(substr($this->tar_file,$main_offset + 108,8)); - - // Parse the file group ID - $file_gid = octdec(substr($this->tar_file,$main_offset + 116,8)); - - // Parse the file size - $file_size = octdec(substr($this->tar_file,$main_offset + 124,12)); - - // Parse the file update time - unix timestamp format - $file_time = octdec(substr($this->tar_file,$main_offset + 136,12)); - - // Parse Checksum - $file_chksum = octdec(substr($this->tar_file,$main_offset + 148,6)); - - // Parse user name - $file_uname = $this->__parseNullPaddedString(substr($this->tar_file,$main_offset + 265,32)); - - // Parse Group name - $file_gname = $this->__parseNullPaddedString(substr($this->tar_file,$main_offset + 297,32)); - - // Make sure our file is valid - if($this->__computeUnsignedChecksum(substr($this->tar_file,$main_offset,512)) != $file_chksum) - return false; - - // Parse File Contents - $file_contents = substr($this->tar_file,$main_offset + 512,$file_size); - - /* ### Unused Header Information ### - $activeFile["typeflag"] = substr($this->tar_file,$main_offset + 156,1); - $activeFile["linkname"] = substr($this->tar_file,$main_offset + 157,100); - $activeFile["magic"] = substr($this->tar_file,$main_offset + 257,6); - $activeFile["version"] = substr($this->tar_file,$main_offset + 263,2); - $activeFile["devmajor"] = substr($this->tar_file,$main_offset + 329,8); - $activeFile["devminor"] = substr($this->tar_file,$main_offset + 337,8); - $activeFile["prefix"] = substr($this->tar_file,$main_offset + 345,155); - $activeFile["endheader"] = substr($this->tar_file,$main_offset + 500,12); - */ - - if($file_size > 0) { - // Increment number of files - $this->numFiles++; - - // Create us a new file in our array - $activeFile = &$this->files[]; - - // Asign Values - $activeFile["name"] = $file_name; - $activeFile["mode"] = $file_mode; - $activeFile["size"] = $file_size; - $activeFile["time"] = $file_time; - $activeFile["user_id"] = $file_uid; - $activeFile["group_id"] = $file_gid; - $activeFile["user_name"] = $file_uname; - $activeFile["group_name"] = $file_gname; - $activeFile["checksum"] = $file_chksum; - $activeFile["file"] = $file_contents; - - } else { - // Increment number of directories - $this->numDirectories++; - - // Create a new directory in our array - $activeDir = &$this->directories[]; - - // Assign values - $activeDir["name"] = $file_name; - $activeDir["mode"] = $file_mode; - $activeDir["time"] = $file_time; - $activeDir["user_id"] = $file_uid; - $activeDir["group_id"] = $file_gid; - $activeDir["user_name"] = $file_uname; - $activeDir["group_name"] = $file_gname; - $activeDir["checksum"] = $file_chksum; - } - - // Move our offset the number of blocks we have processed - $main_offset += 512 + (ceil($file_size / 512) * 512); - } - - return true; - } - - - // Read a non gzipped tar file in for processing - // PRIVATE ACCESS FUNCTION - function __readTar($filename='') { - // Set the filename to load - if(!$filename) - $filename = $this->filename; - - // Read in the TAR file - $fp = fopen($filename,"rb"); - $this->tar_file = fread($fp,filesize($filename)); - fclose($fp); - - if($this->tar_file[0] == chr(31) && $this->tar_file[1] == chr(139) && $this->tar_file[2] == chr(8)) { - if(!function_exists("gzinflate")) - return false; - - $this->isGzipped = TRUE; - - $this->tar_file = gzinflate(substr($this->tar_file,10,-4)); - } - - // Parse the TAR file - $this->__parseTar(); - - return true; - } - - - // Generates a TAR file from the processed data - // PRIVATE ACCESS FUNCTION - function __generateTAR() { - // Clear any data currently in $this->tar_file - unset($this->tar_file); - - // Generate Records for each directory, if we have directories - if($this->numDirectories > 0) { - foreach($this->directories as $key => $information) { - unset($header); - - // Generate tar header for this directory - // Filename, Permissions, UID, GID, size, Time, checksum, typeflag, linkname, magic, version, user name, group name, devmajor, devminor, prefix, end - $header .= str_pad($information["name"],100,chr(0)); - $header .= str_pad(decoct($information["mode"]),7,"0",STR_PAD_LEFT) . chr(0); - $header .= str_pad(decoct($information["user_id"]),7,"0",STR_PAD_LEFT) . chr(0); - $header .= str_pad(decoct($information["group_id"]),7,"0",STR_PAD_LEFT) . chr(0); - $header .= str_pad(decoct(0),11,"0",STR_PAD_LEFT) . chr(0); - $header .= str_pad(decoct($information["time"]),11,"0",STR_PAD_LEFT) . chr(0); - $header .= str_repeat(" ",8); - $header .= "5"; - $header .= str_repeat(chr(0),100); - $header .= str_pad("ustar",6,chr(32)); - $header .= chr(32) . chr(0); - $header .= str_pad("",32,chr(0)); - $header .= str_pad("",32,chr(0)); - $header .= str_repeat(chr(0),8); - $header .= str_repeat(chr(0),8); - $header .= str_repeat(chr(0),155); - $header .= str_repeat(chr(0),12); - - // Compute header checksum - $checksum = str_pad(decoct($this->__computeUnsignedChecksum($header)),6,"0",STR_PAD_LEFT); - for($i=0; $i<6; $i++) { - $header[(148 + $i)] = substr($checksum,$i,1); - } - $header[154] = chr(0); - $header[155] = chr(32); - - // Add new tar formatted data to tar file contents - $this->tar_file .= $header; - } - } - - // Generate Records for each file, if we have files (We should...) - if($this->numFiles > 0) { - foreach($this->files as $key => $information) { - unset($header); - - // Generate the TAR header for this file - // Filename, Permissions, UID, GID, size, Time, checksum, typeflag, linkname, magic, version, user name, group name, devmajor, devminor, prefix, end - $header .= str_pad($information["name"],100,chr(0)); - $header .= str_pad(decoct($information["mode"]),7,"0",STR_PAD_LEFT) . chr(0); - $header .= str_pad(decoct($information["user_id"]),7,"0",STR_PAD_LEFT) . chr(0); - $header .= str_pad(decoct($information["group_id"]),7,"0",STR_PAD_LEFT) . chr(0); - $header .= str_pad(decoct($information["size"]),11,"0",STR_PAD_LEFT) . chr(0); - $header .= str_pad(decoct($information["time"]),11,"0",STR_PAD_LEFT) . chr(0); - $header .= str_repeat(" ",8); - $header .= "0"; - $header .= str_repeat(chr(0),100); - $header .= str_pad("ustar",6,chr(32)); - $header .= chr(32) . chr(0); - $header .= str_pad($information["user_name"],32,chr(0)); // How do I get a file's user name from PHP? - $header .= str_pad($information["group_name"],32,chr(0)); // How do I get a file's group name from PHP? - $header .= str_repeat(chr(0),8); - $header .= str_repeat(chr(0),8); - $header .= str_repeat(chr(0),155); - $header .= str_repeat(chr(0),12); - - // Compute header checksum - $checksum = str_pad(decoct($this->__computeUnsignedChecksum($header)),6,"0",STR_PAD_LEFT); - for($i=0; $i<6; $i++) { - $header[(148 + $i)] = substr($checksum,$i,1); - } - $header[154] = chr(0); - $header[155] = chr(32); - - // Pad file contents to byte count divisible by 512 - $file_contents = str_pad($information["file"],(ceil($information["size"] / 512) * 512),chr(0)); - - // Add new tar formatted data to tar file contents - $this->tar_file .= $header . $file_contents; - } - } - - // Add 512 bytes of NULLs to designate EOF - $this->tar_file .= str_repeat(chr(0),512); - - return true; - } - - - // Open a TAR file - function openTAR($filename) { - // Clear any values from previous tar archives - unset($this->filename); - unset($this->isGzipped); - unset($this->tar_file); - unset($this->files); - unset($this->directories); - unset($this->numFiles); - unset($this->numDirectories); - - // If the tar file doesn't exist... - if(!file_exists($filename)) - return false; - - $this->filename = $filename; - - // Parse this file - $this->__readTar(); - - return true; - } - - - // Appends a tar file to the end of the currently opened tar file - function appendTar($filename) { - // If the tar file doesn't exist... - if(!file_exists($filename)) - return false; - - $this->__readTar($filename); - - return true; - } - - - // Retrieves information about a file in the current tar archive - function getFile($filename) { - if($this->numFiles > 0) { - foreach($this->files as $key => $information) { - if($information["name"] == $filename) - return $information; - } - } - - return false; - } - - - // Retrieves information about a directory in the current tar archive - function getDirectory($dirname) { - if($this->numDirectories > 0) { - foreach($this->directories as $key => $information) { - if($information["name"] == $dirname) - return $information; - } - } - - return false; - } - - - // Check if this tar archive contains a specific file - function containsFile($filename) { - if($this->numFiles > 0) { - foreach($this->files as $key => $information) { - if($information["name"] == $filename) - return true; - } - } - - return false; - } - - - // Check if this tar archive contains a specific directory - function containsDirectory($dirname) { - if($this->numDirectories > 0) { - foreach($this->directories as $key => $information) { - if($information["name"] == $dirname) - return true; - } - } - - return false; - } - - - // Add a directory to this tar archive - function addDirectory($dirname) { - if(!file_exists($dirname)) - return false; - - // Get directory information - $file_information = stat($dirname); - - // Add directory to processed data - $this->numDirectories++; - $activeDir = &$this->directories[]; - $activeDir["name"] = $dirname; - $activeDir["mode"] = $file_information["mode"]; - $activeDir["time"] = $file_information["time"]; - $activeDir["user_id"] = $file_information["uid"]; - $activeDir["group_id"] = $file_information["gid"]; - $activeDir["checksum"] = $checksum; - - return true; - } - - - // Add a file to the tar archive - function addFile($filename,$from=null,$to=null) { - // Make sure the file we are adding exists! - if(!file_exists($filename)) - return false; - - if(filesize($filename)==0) - return false; - - // Make sure there are no other files in the archive that have this same filename - if($this->containsFile($filename)) - return false; - - // Get file information - $file_information = stat($filename); - - // Read in the file's contents - $fp = fopen($filename,"rb"); - $file_contents = fread($fp,filesize($filename)); - fclose($fp); - - if($from && $to){ - $file_contents = str_replace($from,$to,$file_contents); - $file_information["size"] = strlen($file_contents); - } - - // Add file to processed data - $this->numFiles++; - $activeFile = &$this->files[]; - $activeFile["name"] = $filename; - $activeFile["mode"] = $file_information["mode"]; - $activeFile["user_id"] = $file_information["uid"]; - $activeFile["group_id"] = $file_information["gid"]; - $activeFile["size"] = $file_information["size"]; - $activeFile["time"] = $file_information["mtime"]; - $activeFile["checksum"] = $checksum; - $activeFile["user_name"] = ""; - $activeFile["group_name"] = ""; - $activeFile["file"] = $file_contents; - - return true; - } - - - // Remove a file from the tar archive - function removeFile($filename) { - if($this->numFiles > 0) { - foreach($this->files as $key => $information) { - if($information["name"] == $filename) { - $this->numFiles--; - unset($this->files[$key]); - return true; - } - } - } - - return false; - } - - - // Remove a directory from the tar archive - function removeDirectory($dirname) { - if($this->numDirectories > 0) { - foreach($this->directories as $key => $information) { - if($information["name"] == $dirname) { - $this->numDirectories--; - unset($this->directories[$key]); - return true; - } - } - } - - return false; - } - - - // Write the currently loaded tar archive to disk - function saveTar() { - if(!$this->filename) - return false; - - // Write tar to current file using specified gzip compression - $this->toTar($this->filename,$this->isGzipped); - - return true; - } - - - // Saves tar archive to a different file than the current file - function toTar($filename,$useGzip) { - if(!$filename) - return false; - - // Encode processed files into TAR file format - $this->__generateTar(); - - // GZ Compress the data if we need to - if($useGzip) { - // Make sure we have gzip support - if(!function_exists("gzencode")) - return false; - - $file = gzencode($this->tar_file); - } else { - $file = $this->tar_file; - } - - // Write the TAR file - $fp = fopen($filename,"wb"); - fwrite($fp,$file); - fclose($fp); - - return true; - } - - - function toTarStream() { - $this->__generateTar(); - return $this->tar_file; - } -} -?> + + +Description: + This class reads and writes Tape-Archive (TAR) Files and Gzip + compressed TAR files, which are mainly used on UNIX systems. + This class works on both windows AND unix systems, and does + NOT rely on external applications!! Woohoo! + +Usage: + Copyright (C) 2002 Josh Barger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details at: + http://www.gnu.org/copyleft/lesser.html + + If you use this script in your application/website, please + send me an e-mail letting me know about it :) + +Bugs: + Please report any bugs you might find to my e-mail address + at joshb@npt.com. If you have already created a fix/patch + for the bug, please do send it to me so I can incorporate it into my release. + +Version History: + 1.0 04/10/2002 - InitialRelease + + 2.0 04/11/2002 - Merged both tarReader and tarWriter + classes into one + - Added support for gzipped tar files + Remember to name for .tar.gz or .tgz + if you use gzip compression! + :: THIS REQUIRES ZLIB EXTENSION :: + - Added additional comments to + functions to help users + - Added ability to remove files and + directories from archive + 2.1 04/12/2002 - Fixed serious bug in generating tar + - Created another example file + - Added check to make sure ZLIB is + installed before running GZIP + compression on TAR + 2.2 05/07/2002 - Added automatic detection of Gzipped + tar files (Thanks go to J?gen Falch + for the idea) + - Changed "private" functions to have + special function names beginning with + two underscores +======================================================================= +*/ + +class tar { + // Unprocessed Archive Information + var $filename; + var $isGzipped; + var $tar_file; + + // Processed Archive Information + var $files; + var $directories; + var $numFiles; + var $numDirectories; + + + // Class Constructor -- Does nothing... + function tar() { + return true; + } + + + // Computes the unsigned Checksum of a file's header + // to try to ensure valid file + // PRIVATE ACCESS FUNCTION + function __computeUnsignedChecksum($bytestring) { + for($i=0; $i<512; $i++) + $unsigned_chksum += ord($bytestring[$i]); + for($i=0; $i<8; $i++) + $unsigned_chksum -= ord($bytestring[148 + $i]); + $unsigned_chksum += ord(" ") * 8; + + return $unsigned_chksum; + } + + + // Converts a NULL padded string to a non-NULL padded string + // PRIVATE ACCESS FUNCTION + function __parseNullPaddedString($string) { + $position = strpos($string,chr(0)); + return substr($string,0,$position); + } + + + // This function parses the current TAR file + // PRIVATE ACCESS FUNCTION + function __parseTar() { + // Read Files from archive + $tar_length = strlen($this->tar_file); + $main_offset = 0; + while($main_offset < $tar_length) { + // If we read a block of 512 nulls, we are at the end of the archive + if(substr($this->tar_file,$main_offset,512) == str_repeat(chr(0),512)) + break; + + // Parse file name + $file_name = $this->__parseNullPaddedString(substr($this->tar_file,$main_offset,100)); + + // Parse the file mode + $file_mode = substr($this->tar_file,$main_offset + 100,8); + + // Parse the file user ID + $file_uid = octdec(substr($this->tar_file,$main_offset + 108,8)); + + // Parse the file group ID + $file_gid = octdec(substr($this->tar_file,$main_offset + 116,8)); + + // Parse the file size + $file_size = octdec(substr($this->tar_file,$main_offset + 124,12)); + + // Parse the file update time - unix timestamp format + $file_time = octdec(substr($this->tar_file,$main_offset + 136,12)); + + // Parse Checksum + $file_chksum = octdec(substr($this->tar_file,$main_offset + 148,6)); + + // Parse user name + $file_uname = $this->__parseNullPaddedString(substr($this->tar_file,$main_offset + 265,32)); + + // Parse Group name + $file_gname = $this->__parseNullPaddedString(substr($this->tar_file,$main_offset + 297,32)); + + // Make sure our file is valid + if($this->__computeUnsignedChecksum(substr($this->tar_file,$main_offset,512)) != $file_chksum) + return false; + + // Parse File Contents + $file_contents = substr($this->tar_file,$main_offset + 512,$file_size); + + /* ### Unused Header Information ### + $activeFile["typeflag"] = substr($this->tar_file,$main_offset + 156,1); + $activeFile["linkname"] = substr($this->tar_file,$main_offset + 157,100); + $activeFile["magic"] = substr($this->tar_file,$main_offset + 257,6); + $activeFile["version"] = substr($this->tar_file,$main_offset + 263,2); + $activeFile["devmajor"] = substr($this->tar_file,$main_offset + 329,8); + $activeFile["devminor"] = substr($this->tar_file,$main_offset + 337,8); + $activeFile["prefix"] = substr($this->tar_file,$main_offset + 345,155); + $activeFile["endheader"] = substr($this->tar_file,$main_offset + 500,12); + */ + + if($file_size > 0) { + // Increment number of files + $this->numFiles++; + + // Create us a new file in our array + $activeFile = &$this->files[]; + + // Asign Values + $activeFile["name"] = $file_name; + $activeFile["mode"] = $file_mode; + $activeFile["size"] = $file_size; + $activeFile["time"] = $file_time; + $activeFile["user_id"] = $file_uid; + $activeFile["group_id"] = $file_gid; + $activeFile["user_name"] = $file_uname; + $activeFile["group_name"] = $file_gname; + $activeFile["checksum"] = $file_chksum; + $activeFile["file"] = $file_contents; + + } else { + // Increment number of directories + $this->numDirectories++; + + // Create a new directory in our array + $activeDir = &$this->directories[]; + + // Assign values + $activeDir["name"] = $file_name; + $activeDir["mode"] = $file_mode; + $activeDir["time"] = $file_time; + $activeDir["user_id"] = $file_uid; + $activeDir["group_id"] = $file_gid; + $activeDir["user_name"] = $file_uname; + $activeDir["group_name"] = $file_gname; + $activeDir["checksum"] = $file_chksum; + } + + // Move our offset the number of blocks we have processed + $main_offset += 512 + (ceil($file_size / 512) * 512); + } + + return true; + } + + + // Read a non gzipped tar file in for processing + // PRIVATE ACCESS FUNCTION + function __readTar($filename='') { + // Set the filename to load + if(!$filename) + $filename = $this->filename; + + // Read in the TAR file + $fp = fopen($filename,"rb"); + $this->tar_file = fread($fp,filesize($filename)); + fclose($fp); + + if($this->tar_file[0] == chr(31) && $this->tar_file[1] == chr(139) && $this->tar_file[2] == chr(8)) { + if(!function_exists("gzinflate")) + return false; + + $this->isGzipped = TRUE; + + $this->tar_file = gzinflate(substr($this->tar_file,10,-4)); + } + + // Parse the TAR file + $this->__parseTar(); + + return true; + } + + + // Generates a TAR file from the processed data + // PRIVATE ACCESS FUNCTION + function __generateTAR() { + // Clear any data currently in $this->tar_file + unset($this->tar_file); + + // Generate Records for each directory, if we have directories + if($this->numDirectories > 0) { + foreach($this->directories as $key => $information) { + unset($header); + + // Generate tar header for this directory + // Filename, Permissions, UID, GID, size, Time, checksum, typeflag, linkname, magic, version, user name, group name, devmajor, devminor, prefix, end + $header .= str_pad($information["name"],100,chr(0)); + $header .= str_pad(decoct($information["mode"]),7,"0",STR_PAD_LEFT) . chr(0); + $header .= str_pad(decoct($information["user_id"]),7,"0",STR_PAD_LEFT) . chr(0); + $header .= str_pad(decoct($information["group_id"]),7,"0",STR_PAD_LEFT) . chr(0); + $header .= str_pad(decoct(0),11,"0",STR_PAD_LEFT) . chr(0); + $header .= str_pad(decoct($information["time"]),11,"0",STR_PAD_LEFT) . chr(0); + $header .= str_repeat(" ",8); + $header .= "5"; + $header .= str_repeat(chr(0),100); + $header .= str_pad("ustar",6,chr(32)); + $header .= chr(32) . chr(0); + $header .= str_pad("",32,chr(0)); + $header .= str_pad("",32,chr(0)); + $header .= str_repeat(chr(0),8); + $header .= str_repeat(chr(0),8); + $header .= str_repeat(chr(0),155); + $header .= str_repeat(chr(0),12); + + // Compute header checksum + $checksum = str_pad(decoct($this->__computeUnsignedChecksum($header)),6,"0",STR_PAD_LEFT); + for($i=0; $i<6; $i++) { + $header[(148 + $i)] = substr($checksum,$i,1); + } + $header[154] = chr(0); + $header[155] = chr(32); + + // Add new tar formatted data to tar file contents + $this->tar_file .= $header; + } + } + + // Generate Records for each file, if we have files (We should...) + if($this->numFiles > 0) { + foreach($this->files as $key => $information) { + unset($header); + + // Generate the TAR header for this file + // Filename, Permissions, UID, GID, size, Time, checksum, typeflag, linkname, magic, version, user name, group name, devmajor, devminor, prefix, end + $header .= str_pad($information["name"],100,chr(0)); + $header .= str_pad(decoct($information["mode"]),7,"0",STR_PAD_LEFT) . chr(0); + $header .= str_pad(decoct($information["user_id"]),7,"0",STR_PAD_LEFT) . chr(0); + $header .= str_pad(decoct($information["group_id"]),7,"0",STR_PAD_LEFT) . chr(0); + $header .= str_pad(decoct($information["size"]),11,"0",STR_PAD_LEFT) . chr(0); + $header .= str_pad(decoct($information["time"]),11,"0",STR_PAD_LEFT) . chr(0); + $header .= str_repeat(" ",8); + $header .= "0"; + $header .= str_repeat(chr(0),100); + $header .= str_pad("ustar",6,chr(32)); + $header .= chr(32) . chr(0); + $header .= str_pad($information["user_name"],32,chr(0)); // How do I get a file's user name from PHP? + $header .= str_pad($information["group_name"],32,chr(0)); // How do I get a file's group name from PHP? + $header .= str_repeat(chr(0),8); + $header .= str_repeat(chr(0),8); + $header .= str_repeat(chr(0),155); + $header .= str_repeat(chr(0),12); + + // Compute header checksum + $checksum = str_pad(decoct($this->__computeUnsignedChecksum($header)),6,"0",STR_PAD_LEFT); + for($i=0; $i<6; $i++) { + $header[(148 + $i)] = substr($checksum,$i,1); + } + $header[154] = chr(0); + $header[155] = chr(32); + + // Pad file contents to byte count divisible by 512 + $file_contents = str_pad($information["file"],(ceil($information["size"] / 512) * 512),chr(0)); + + // Add new tar formatted data to tar file contents + $this->tar_file .= $header . $file_contents; + } + } + + // Add 512 bytes of NULLs to designate EOF + $this->tar_file .= str_repeat(chr(0),512); + + return true; + } + + + // Open a TAR file + function openTAR($filename) { + // Clear any values from previous tar archives + unset($this->filename); + unset($this->isGzipped); + unset($this->tar_file); + unset($this->files); + unset($this->directories); + unset($this->numFiles); + unset($this->numDirectories); + + // If the tar file doesn't exist... + if(!file_exists($filename)) + return false; + + $this->filename = $filename; + + // Parse this file + $this->__readTar(); + + return true; + } + + + // Appends a tar file to the end of the currently opened tar file + function appendTar($filename) { + // If the tar file doesn't exist... + if(!file_exists($filename)) + return false; + + $this->__readTar($filename); + + return true; + } + + + // Retrieves information about a file in the current tar archive + function getFile($filename) { + if($this->numFiles > 0) { + foreach($this->files as $key => $information) { + if($information["name"] == $filename) + return $information; + } + } + + return false; + } + + + // Retrieves information about a directory in the current tar archive + function getDirectory($dirname) { + if($this->numDirectories > 0) { + foreach($this->directories as $key => $information) { + if($information["name"] == $dirname) + return $information; + } + } + + return false; + } + + + // Check if this tar archive contains a specific file + function containsFile($filename) { + if($this->numFiles > 0) { + foreach($this->files as $key => $information) { + if($information["name"] == $filename) + return true; + } + } + + return false; + } + + + // Check if this tar archive contains a specific directory + function containsDirectory($dirname) { + if($this->numDirectories > 0) { + foreach($this->directories as $key => $information) { + if($information["name"] == $dirname) + return true; + } + } + + return false; + } + + + // Add a directory to this tar archive + function addDirectory($dirname) { + if(!file_exists($dirname)) + return false; + + // Get directory information + $file_information = stat($dirname); + + // Add directory to processed data + $this->numDirectories++; + $activeDir = &$this->directories[]; + $activeDir["name"] = $dirname; + $activeDir["mode"] = $file_information["mode"]; + $activeDir["time"] = $file_information["time"]; + $activeDir["user_id"] = $file_information["uid"]; + $activeDir["group_id"] = $file_information["gid"]; + $activeDir["checksum"] = $checksum; + + return true; + } + + + // Add a file to the tar archive + function addFile($filename,$from=null,$to=null) { + // Make sure the file we are adding exists! + if(!file_exists($filename)) + return false; + + if(filesize($filename)==0) + return false; + + // Make sure there are no other files in the archive that have this same filename + if($this->containsFile($filename)) + return false; + + // Get file information + $file_information = stat($filename); + + // Read in the file's contents + $fp = fopen($filename,"rb"); + $file_contents = fread($fp,filesize($filename)); + fclose($fp); + + if($from && $to){ + $file_contents = str_replace($from,$to,$file_contents); + $file_information["size"] = strlen($file_contents); + } + + // Add file to processed data + $this->numFiles++; + $activeFile = &$this->files[]; + $activeFile["name"] = $filename; + $activeFile["mode"] = $file_information["mode"]; + $activeFile["user_id"] = $file_information["uid"]; + $activeFile["group_id"] = $file_information["gid"]; + $activeFile["size"] = $file_information["size"]; + $activeFile["time"] = $file_information["mtime"]; + $activeFile["checksum"] = $checksum; + $activeFile["user_name"] = ""; + $activeFile["group_name"] = ""; + $activeFile["file"] = $file_contents; + + return true; + } + + + // Remove a file from the tar archive + function removeFile($filename) { + if($this->numFiles > 0) { + foreach($this->files as $key => $information) { + if($information["name"] == $filename) { + $this->numFiles--; + unset($this->files[$key]); + return true; + } + } + } + + return false; + } + + + // Remove a directory from the tar archive + function removeDirectory($dirname) { + if($this->numDirectories > 0) { + foreach($this->directories as $key => $information) { + if($information["name"] == $dirname) { + $this->numDirectories--; + unset($this->directories[$key]); + return true; + } + } + } + + return false; + } + + + // Write the currently loaded tar archive to disk + function saveTar() { + if(!$this->filename) + return false; + + // Write tar to current file using specified gzip compression + $this->toTar($this->filename,$this->isGzipped); + + return true; + } + + + // Saves tar archive to a different file than the current file + function toTar($filename,$useGzip) { + if(!$filename) + return false; + + // Encode processed files into TAR file format + $this->__generateTar(); + + // GZ Compress the data if we need to + if($useGzip) { + // Make sure we have gzip support + if(!function_exists("gzencode")) + return false; + + $file = gzencode($this->tar_file); + } else { + $file = $this->tar_file; + } + + // Write the TAR file + $fp = fopen($filename,"wb"); + fwrite($fp,$file); + fclose($fp); + + return true; + } + + + function toTarStream() { + $this->__generateTar(); + return $this->tar_file; + } +} +?> diff --git a/m.layouts/default/conf/info.xml b/m.layouts/default/conf/info.xml index 23307bdee..b74d94681 100644 --- a/m.layouts/default/conf/info.xml +++ b/m.layouts/default/conf/info.xml @@ -1,106 +1,106 @@ - - - XE 공식 사이트 모바일 레이아웃 - XE Official Mobile layout - 官方移动版布局 - XE Mobile 官方版面 - XE Resmi Hareketli Yerleşim Düzeni - - XE 공식 모바일 레이아웃입니다. - NHN (developers@xpressengine.com) - - - This layout is the XE Official website layout. - NHN (developers@xpressengine.com) - - - 官方移动版布局。 - NHN (developers@xpressengine.com) - - - XE Mobile 官方網站版面。 - NHN (developers@xpressengine.com) - - - Bu yerleşim düzeni, XE Resmi website yerleşim düzenidir. - NHN (developers@xpressengine.com) - - 0.1 - 2010-08-20 - http://xpressengine.com/ - - - NHN - NHN - NHN - NHN - NHN - - - - 홈페이지 Title - Homepage Title - 网站标题 - 首頁標題 - Anasayfa Başlığı - - - 로고이미지 - ロゴイメージ - LOGO图片 - Logo圖片 - Logo image - Logobildes - Изображения логотипа - Imagen del logotipo - Hình Logo - Logo resmi - 레이아웃의 상단에 표시될 로고이미지를 입력하세요. (세로길이가 28px인 투명 이미지가 가장 어울립니다) - レイアウトの上段に表示されるロゴイメージを入力して下さい。 (縦幅が28pxである透明イメージをお勧めします。。) - 请输入显示在布局顶部的LOGO图片(高度为28px的透明图片为适)。 - 請輸入要顯示在版面上端的 Logo 圖片。(適當高度為 28px 的透明圖片。) - Please input a logo image which will be displayed on the top of layout. (Transparent image with height of 28px is recommended.) - Bitte geben Sie ein Logo das Bild wird auf dem oberen Layout. (Transparent Bild mit einer Höhe von 28px wird empfohlen). - Введите логотип изображение, которое будет отображаться в верхней части формы. (Прозрачный изображение с высотой 28px рекомендуется.) - Ingresar una imagen para logotipo. ( Se recomienda una imagen de fondo transparente con una altura de 28px. - Hãy chọn Logo hiển thị phía trên cùng của giao diện. (Đề nghị: Hình ảnh có nền trong suốt và kích thước 28px.) - Lütfen yerleşim düzeninin üst kısmında gösterilecek bir logo resmi giriniz. (Önerilen resim 28px uzunluğunda, transparan ayarda bir resimdir.) - - - 홈 페이지 URL - ホームページURL - 主页地址 - 主頁網址 - Homepage URL - Homepage URL - Домашняя страница URL - URL de la página web - URL Trang chủ - Anasayfa URLsi - 로고를 클릭시에 이동할 홈 페이지 URL을 입력해 주세요. - ロゴをクリックした時に移動するホームページのURLを入力して下さい。 - 点击网站LOGO时要移动的页面URL。 - 請輸入當用戶按了網站 Logo 後,要前往的頁面網址。 - Please input the URL to redirect when user clicks the logo - Bitte geben Sie die URL umzuleiten, wenn Benutzer klickt das Logo - Пожалуйста, введите URL для перенаправления, когда пользователь нажимает логотип - Ingresar el URL de la página web para redireccionar al pulsar el logotipo - Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo - Lütfen kullanıcıların logoya tıkladıklarında yönlendirilecekleri bir URL giriniz - - - - - 상단 메뉴 - 上段用メニュー - 主菜单 - 主選單 - Top menu - Top Menü - Верхнее меню - Menú Principal - Ana Menü - Menu trên - - - + + + XE 공식 사이트 모바일 레이아웃 + XE Official Mobile layout + 官方移动版布局 + XE Mobile 官方版面 + XE Resmi Hareketli Yerleşim Düzeni + + XE 공식 모바일 레이아웃입니다. + NHN (developers@xpressengine.com) + + + This layout is the XE Official website layout. + NHN (developers@xpressengine.com) + + + 官方移动版布局。 + NHN (developers@xpressengine.com) + + + XE Mobile 官方網站版面。 + NHN (developers@xpressengine.com) + + + Bu yerleşim düzeni, XE Resmi website yerleşim düzenidir. + NHN (developers@xpressengine.com) + + 0.1 + 2010-08-20 + http://xpressengine.com/ + + + NHN + NHN + NHN + NHN + NHN + + + + 홈페이지 Title + Homepage Title + 网站标题 + 首頁標題 + Anasayfa Başlığı + + + 로고이미지 + ロゴイメージ + LOGO图片 + Logo圖片 + Logo image + Logobildes + Изображения логотипа + Imagen del logotipo + Hình Logo + Logo resmi + 레이아웃의 상단에 표시될 로고이미지를 입력하세요. (세로길이가 28px인 투명 이미지가 가장 어울립니다) + レイアウトの上段に表示されるロゴイメージを入力して下さい。 (縦幅が28pxである透明イメージをお勧めします。。) + 请输入显示在布局顶部的LOGO图片(高度为28px的透明图片为适)。 + 請輸入要顯示在版面上端的 Logo 圖片。(適當高度為 28px 的透明圖片。) + Please input a logo image which will be displayed on the top of layout. (Transparent image with height of 28px is recommended.) + Bitte geben Sie ein Logo das Bild wird auf dem oberen Layout. (Transparent Bild mit einer Höhe von 28px wird empfohlen). + Введите логотип изображение, которое будет отображаться в верхней части формы. (Прозрачный изображение с высотой 28px рекомендуется.) + Ingresar una imagen para logotipo. ( Se recomienda una imagen de fondo transparente con una altura de 28px. + Hãy chọn Logo hiển thị phía trên cùng của giao diện. (Đề nghị: Hình ảnh có nền trong suốt và kích thước 28px.) + Lütfen yerleşim düzeninin üst kısmında gösterilecek bir logo resmi giriniz. (Önerilen resim 28px uzunluğunda, transparan ayarda bir resimdir.) + + + 홈 페이지 URL + ホームページURL + 主页地址 + 主頁網址 + Homepage URL + Homepage URL + Домашняя страница URL + URL de la página web + URL Trang chủ + Anasayfa URLsi + 로고를 클릭시에 이동할 홈 페이지 URL을 입력해 주세요. + ロゴをクリックした時に移動するホームページのURLを入力して下さい。 + 点击网站LOGO时要移动的页面URL。 + 請輸入當用戶按了網站 Logo 後,要前往的頁面網址。 + Please input the URL to redirect when user clicks the logo + Bitte geben Sie die URL umzuleiten, wenn Benutzer klickt das Logo + Пожалуйста, введите URL для перенаправления, когда пользователь нажимает логотип + Ingresar el URL de la página web para redireccionar al pulsar el logotipo + Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo + Lütfen kullanıcıların logoya tıkladıklarında yönlendirilecekleri bir URL giriniz + + + + + 상단 메뉴 + 上段用メニュー + 主菜单 + 主選單 + Top menu + Top Menü + Верхнее меню + Menú Principal + Ana Menü + Menu trên + + + diff --git a/m.layouts/default/layout.html b/m.layouts/default/layout.html index 2aa191d97..799ec13f0 100644 --- a/m.layouts/default/layout.html +++ b/m.layouts/default/layout.html @@ -1,28 +1,28 @@ - -
- -

{$layout_info->index_title}

- -

{$layout_info->index_title}

- -

Mobile XE

- - - -
- - - - -
-{$content} - -

{$layout_info->index_title}

+ +
+ +

{$layout_info->index_title}

+ +

{$layout_info->index_title}

+ +

Mobile XE

+ + + +
+ + + + +
+{$content} + +

{$layout_info->index_title}

diff --git a/m.layouts/default/mx.css b/m.layouts/default/mx.css index 385b5d9b5..63f7692a9 100644 --- a/m.layouts/default/mx.css +++ b/m.layouts/default/mx.css @@ -1,24 +1,24 @@ -@charset "utf-8"; -/* Mobile XE (/m.layouts/default/) */ -body{margin:0;background:#fff;color:#000;word-wrap:break-word} -body,input,textarea,select,button,table{font-family:Tahoma,Geneva,sans-serif} -/* Common */ -.fl{float:left} -.fr{float:right} -/* Header */ -.hd{min-height:28px;line-height:28px;padding:6px;margin:0 0 1px 0;border-bottom:2px solid #8d7de1;background:#444 -webkit-gradient(linear,0% 0%,0% 100%,from(#434343),to(#0d0d0d));background:#444 -moz-linear-gradient(top,#434343,#0d0d0d);background-color:#444;*zoom:1} -.hd:after{content:"";margin:0 -6px;position:relative;top:9px;display:block;clear:both;height:1px;background:#6352d2} -.hd .h1{float:left;display:inline;color:#fff;font-size:24px;margin:0;font-weight:bold} -.hd .h1 a{color:#fff} -.hd .h1 img{border:0} -.hd .mu{display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;text-decoration:none;box-shadow:0 0 1px #000;-webkit-box-shadow:0 0 1px #000;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b} -.hd .mu:after{content:"›";margin:0 0 0 3px;font-size:24px;vertical-align:middle;position:relative;top:-2px} -.hd .muon{cursor:pointer;display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;text-decoration:none;box-shadow:0 0 1px #000;-webkit-box-shadow:0 0 1px #000;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b} -.hd .muon:before{content:"‹";font-weight:bold;font-size:16px;line-height:16px;margin:0 2px 0 0;font-family:Verdana, Geneva, sans-serif} -/* Footer */ -.ft{padding:0;margin:0;list-style:none;background:#868686;overflow:hidden;zoom:1} -.ft:after{content:"";display:block;clear:both} -.ft li{margin:0;padding:0;border:1px solid #9c9a99;border-top:0;border-bottom:0;margin:0 -1px;background:#868686} -.ft a{display:inline-block;padding:0 15px;color:#fff;text-shadow:0 0 2px #000;font-size:12px;font-weight:bold;line-height:32px;text-decoration:none} -/* Copyright */ +@charset "utf-8"; +/* Mobile XE (/m.layouts/default/) */ +body{margin:0;background:#fff;color:#000;word-wrap:break-word} +body,input,textarea,select,button,table{font-family:Tahoma,Geneva,sans-serif} +/* Common */ +.fl{float:left} +.fr{float:right} +/* Header */ +.hd{min-height:28px;line-height:28px;padding:6px;margin:0 0 1px 0;border-bottom:2px solid #8d7de1;background:#444 -webkit-gradient(linear,0% 0%,0% 100%,from(#434343),to(#0d0d0d));background:#444 -moz-linear-gradient(top,#434343,#0d0d0d);background-color:#444;*zoom:1} +.hd:after{content:"";margin:0 -6px;position:relative;top:9px;display:block;clear:both;height:1px;background:#6352d2} +.hd .h1{float:left;display:inline;color:#fff;font-size:24px;margin:0;font-weight:bold} +.hd .h1 a{color:#fff} +.hd .h1 img{border:0} +.hd .mu{display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;text-decoration:none;box-shadow:0 0 1px #000;-webkit-box-shadow:0 0 1px #000;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b} +.hd .mu:after{content:"›";margin:0 0 0 3px;font-size:24px;vertical-align:middle;position:relative;top:-2px} +.hd .muon{cursor:pointer;display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;text-decoration:none;box-shadow:0 0 1px #000;-webkit-box-shadow:0 0 1px #000;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b} +.hd .muon:before{content:"‹";font-weight:bold;font-size:16px;line-height:16px;margin:0 2px 0 0;font-family:Verdana, Geneva, sans-serif} +/* Footer */ +.ft{padding:0;margin:0;list-style:none;background:#868686;overflow:hidden;zoom:1} +.ft:after{content:"";display:block;clear:both} +.ft li{margin:0;padding:0;border:1px solid #9c9a99;border-top:0;border-bottom:0;margin:0 -1px;background:#868686} +.ft a{display:inline-block;padding:0 15px;color:#fff;text-shadow:0 0 2px #000;font-size:12px;font-weight:bold;line-height:32px;text-decoration:none} +/* Copyright */ .cr{margin:0;text-align:center;background:#f2f0ec;color:#494949;font-size:11px;line-height:26px} \ No newline at end of file diff --git a/m.layouts/simpleGray/conf/info.xml b/m.layouts/simpleGray/conf/info.xml index da471b91d..cb36d938f 100644 --- a/m.layouts/simpleGray/conf/info.xml +++ b/m.layouts/simpleGray/conf/info.xml @@ -1,89 +1,89 @@ - - - XE 심플 그레이 레이아웃 - XE simple gray layout - 官方移动版布局 - XE Mobile 官方版面 - XE basit gri yerleşim düzeni - - XE 심플 그레이 레이아웃입니다. - 디자인, 퍼블리싱 : 정찬명 - 레이아웃 제작 : haneul - - - This layout is the XE Official website layout. - Design, HTML/CSS : Chan-Myung Jeong - Layout producer : haneul - - - 官方移动版布局。 - Design, HTML/CSS : Chan-Myung Jeong - Layout producer : haneul - - - 官方移动版布局。 - Design, HTML/CSS : Chan-Myung Jeong - Layout producer : haneul - - - XE Mobile 官方網站版面。 - Design, HTML/CSS : Chan-Myung Jeong - Layout producer : haneul - - 0.1 - 2010-06-10 - http://xpressengine.com - - - NHN - NHN - NHN - NHN - NHN - - - - 홈페이지 Title - Homepage Title - 网站标题 - 首頁標題 - Anasayfa URLsi - - - 홈 페이지 URL - ホームページURL - 主页地址 - 主頁網址 - Homepage URL - Homepage URL - Домашняя страница URL - URL de la página web - URL Trang chủ - Anasayfa URLsi - 로고를 클릭시에 이동할 홈 페이지 URL을 입력해 주세요. - ロゴをクリックした時に移動するホームページのURLを入力して下さい。 - 点击网站LOGO时要移动的页面URL。 - 請輸入當用戶按了網站 Logo 後,要前往的頁面網址。 - Please input the URL to redirect when user clicks the logo - Bitte geben Sie die URL umzuleiten, wenn Benutzer klickt das Logo - Пожалуйста, введите URL для перенаправления, когда пользователь нажимает логотип - Ingresar el URL de la página web para redireccionar al pulsar el logotipo - Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo - Lütfen kullanıcıların logoya tıkladıklarında yönlendirilecekleri URL adresini giriniz - - - - - 상단 메뉴 - 上段用メニュー - 主菜单 - 主選單 - Top menu - Top Menü - Верхнее меню - Menú Principal - Ana Menü - Menu trên - - - + + + XE 심플 그레이 레이아웃 + XE simple gray layout + 官方移动版布局 + XE Mobile 官方版面 + XE basit gri yerleşim düzeni + + XE 심플 그레이 레이아웃입니다. + 디자인, 퍼블리싱 : 정찬명 + 레이아웃 제작 : haneul + + + This layout is the XE Official website layout. + Design, HTML/CSS : Chan-Myung Jeong + Layout producer : haneul + + + 官方移动版布局。 + Design, HTML/CSS : Chan-Myung Jeong + Layout producer : haneul + + + 官方移动版布局。 + Design, HTML/CSS : Chan-Myung Jeong + Layout producer : haneul + + + XE Mobile 官方網站版面。 + Design, HTML/CSS : Chan-Myung Jeong + Layout producer : haneul + + 0.1 + 2010-06-10 + http://xpressengine.com + + + NHN + NHN + NHN + NHN + NHN + + + + 홈페이지 Title + Homepage Title + 网站标题 + 首頁標題 + Anasayfa URLsi + + + 홈 페이지 URL + ホームページURL + 主页地址 + 主頁網址 + Homepage URL + Homepage URL + Домашняя страница URL + URL de la página web + URL Trang chủ + Anasayfa URLsi + 로고를 클릭시에 이동할 홈 페이지 URL을 입력해 주세요. + ロゴをクリックした時に移動するホームページのURLを入力して下さい。 + 点击网站LOGO时要移动的页面URL。 + 請輸入當用戶按了網站 Logo 後,要前往的頁面網址。 + Please input the URL to redirect when user clicks the logo + Bitte geben Sie die URL umzuleiten, wenn Benutzer klickt das Logo + Пожалуйста, введите URL для перенаправления, когда пользователь нажимает логотип + Ingresar el URL de la página web para redireccionar al pulsar el logotipo + Hãy nhập địa chỉ bạn muốn chuyển đến khi bấm vào Logo + Lütfen kullanıcıların logoya tıkladıklarında yönlendirilecekleri URL adresini giriniz + + + + + 상단 메뉴 + 上段用メニュー + 主菜单 + 主選單 + Top menu + Top Menü + Верхнее меню + Menú Principal + Ana Menü + Menu trên + + + diff --git a/m.layouts/simpleGray/layout.html b/m.layouts/simpleGray/layout.html index 33828c342..a375244a4 100644 --- a/m.layouts/simpleGray/layout.html +++ b/m.layouts/simpleGray/layout.html @@ -1,18 +1,18 @@ - - -{$content} - -

{$layout_info->index_title}

+ + +{$content} + +

{$layout_info->index_title}

diff --git a/m.layouts/simpleGray/mx.css b/m.layouts/simpleGray/mx.css index 188b12fe7..e4bd8fa4e 100644 --- a/m.layouts/simpleGray/mx.css +++ b/m.layouts/simpleGray/mx.css @@ -1,36 +1,36 @@ -@charset "utf-8"; -/* Mobile XE */ -body{margin:0;background:#fff;color:#000;word-wrap:break-word} -body,input,textarea,select,button,table{font-family:Tahoma, Geneva, sans-serif} -/* Common Class */ -.fl{float:left} -.fr{float:right} -.cb{clear:both} -/* Edge = Header/Footer */ -.eg{position:relative;background:#666;*zoom:1} -.eg:after{content:"";display:block;clear:both} -.eg a{text-decoration:none} -/* Header */ -.hd{padding:10px;border-top:3px solid #444} -.hd .h1{float:left;display:inline;color:#fff;font-size:24px;margin:0;font-weight:bold;text-shadow:0 0 3px #000} -.hd .h1 a{color:#fff} -.hd .bn{font-size:12px} -/* Footer */ -.ft{padding:0 5px;margin:0;list-style:none} -.ft a{display:inline-block;padding:10px;color:#fff;text-shadow:0 0 2px #000;font-size:14px;font-weight:bold} -/* Copyright */ -.cr{margin:0;padding:5px 15px;text-align:center;background:#444;color:#ccc;text-shadow:0 0 2px #000;font-size:12px;font-weight:bold} -/* Search */ -.sh{position:relative;text-align:center} -.sh .itx{width:80%;background:none;border:5px solid #333;margin:10px} -/* Definition */ -.dl{margin:10px} -.dl dt{margin:0;padding:0;font-weight:bold} -.dl dd{margin:0 0 10px 0;padding:0;color:#666} -/* Graph Horizontal */ -.gh{list-style:none;margin:10px;padding:0} -.gh li{position:relative;margin:5px 0} -.gh .bar{position:absolute;z-index:-1;height:100%;width:0;background:#ddd} -.gh em{color:#f60} -/* Button */ -.bn{display:inline-block;padding:5px 10px;font-weight:normal;font-size:14px;border:1px solid #333;background:#eee;color:#000;text-shadow:1px 1px 0 #fff;box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;-webkit-box-shadow:0 0 3px #333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;text-decoration:none} +@charset "utf-8"; +/* Mobile XE */ +body{margin:0;background:#fff;color:#000;word-wrap:break-word} +body,input,textarea,select,button,table{font-family:Tahoma, Geneva, sans-serif} +/* Common Class */ +.fl{float:left} +.fr{float:right} +.cb{clear:both} +/* Edge = Header/Footer */ +.eg{position:relative;background:#666;*zoom:1} +.eg:after{content:"";display:block;clear:both} +.eg a{text-decoration:none} +/* Header */ +.hd{padding:10px;border-top:3px solid #444} +.hd .h1{float:left;display:inline;color:#fff;font-size:24px;margin:0;font-weight:bold;text-shadow:0 0 3px #000} +.hd .h1 a{color:#fff} +.hd .bn{font-size:12px} +/* Footer */ +.ft{padding:0 5px;margin:0;list-style:none} +.ft a{display:inline-block;padding:10px;color:#fff;text-shadow:0 0 2px #000;font-size:14px;font-weight:bold} +/* Copyright */ +.cr{margin:0;padding:5px 15px;text-align:center;background:#444;color:#ccc;text-shadow:0 0 2px #000;font-size:12px;font-weight:bold} +/* Search */ +.sh{position:relative;text-align:center} +.sh .itx{width:80%;background:none;border:5px solid #333;margin:10px} +/* Definition */ +.dl{margin:10px} +.dl dt{margin:0;padding:0;font-weight:bold} +.dl dd{margin:0 0 10px 0;padding:0;color:#666} +/* Graph Horizontal */ +.gh{list-style:none;margin:10px;padding:0} +.gh li{position:relative;margin:5px 0} +.gh .bar{position:absolute;z-index:-1;height:100%;width:0;background:#ddd} +.gh em{color:#f60} +/* Button */ +.bn{display:inline-block;padding:5px 10px;font-weight:normal;font-size:14px;border:1px solid #333;background:#eee;color:#000;text-shadow:1px 1px 0 #fff;box-shadow:0 0 3px #333;-moz-box-shadow:0 0 3px #333;-webkit-box-shadow:0 0 3px #333;border-radius:3px;-moz-border-radius:3px;-webkit-border-radius:3px;text-decoration:none} diff --git a/modules/addon/addon.admin.controller.php b/modules/addon/addon.admin.controller.php index 49267b4dc..93934cc04 100644 --- a/modules/addon/addon.admin.controller.php +++ b/modules/addon/addon.admin.controller.php @@ -1,102 +1,102 @@ -isActivatedAddon($addon, $site_module_info->site_srl, $type)) $this->doDeactivate($addon, $site_module_info->site_srl, $type); - - // 비활성화 되어 있으면 활성화 시킴 - else $this->doActivate($addon, $site_module_info->site_srl, $type); - } - - $this->makeCacheFile($site_module_info->site_srl, $type); - } - - /** - * @brief 애드온 설정 정보 입력 - **/ - function procAddonAdminSetupAddon() { - $args = Context::getRequestVars(); - $addon_name = $args->addon_name; - unset($args->module); - unset($args->act); - unset($args->addon_name); - unset($args->body); - - $site_module_info = Context::get('site_module_info'); - - $this->doSetup($addon_name, $args, $site_module_info->site_srl); - - $this->makeCacheFile($site_module_info->site_srl, "pc"); - $this->makeCacheFile($site_module_info->site_srl, "mobile"); - } - - - - /** - * @brief 애드온 추가 - * DB에 애드온을 추가함 - **/ - function doInsert($addon, $site_srl = 0) { - $args->addon = $addon; - $args->is_used = 'N'; - if(!$site_srl) return executeQuery('addon.insertAddon', $args); - $args->site_srl = $site_srl; - return executeQuery('addon.insertSiteAddon', $args); - } - - /** - * @brief 애드온 활성화 - * addons라는 테이블에 애드온의 활성화 상태를 on 시켜줌 - **/ - function doActivate($addon, $site_srl = 0, $type = "pc") { - $args->addon = $addon; - if($type == "pc") $args->is_used = 'Y'; - else $args->is_used_m = "Y"; - if(!$site_srl) return executeQuery('addon.updateAddon', $args); - $args->site_srl = $site_srl; - return executeQuery('addon.updateSiteAddon', $args); - } - - /** - * @brief 애드온 비활성화 - * - * addons라는 테이블에 애드온의 이름을 제거하는 것으로 비활성화를 시키게 된다 - **/ - function doDeactivate($addon, $site_srl = 0, $type = "pc") { - $args->addon = $addon; - if($type == "pc") $args->is_used = 'N'; - else $args->is_used_m = 'N'; - if(!$site_srl) return executeQuery('addon.updateAddon', $args); - $args->site_srl = $site_srl; - return executeQuery('addon.updateSiteAddon', $args); - } - - - } -?> +isActivatedAddon($addon, $site_module_info->site_srl, $type)) $this->doDeactivate($addon, $site_module_info->site_srl, $type); + + // 비활성화 되어 있으면 활성화 시킴 + else $this->doActivate($addon, $site_module_info->site_srl, $type); + } + + $this->makeCacheFile($site_module_info->site_srl, $type); + } + + /** + * @brief 애드온 설정 정보 입력 + **/ + function procAddonAdminSetupAddon() { + $args = Context::getRequestVars(); + $addon_name = $args->addon_name; + unset($args->module); + unset($args->act); + unset($args->addon_name); + unset($args->body); + + $site_module_info = Context::get('site_module_info'); + + $this->doSetup($addon_name, $args, $site_module_info->site_srl); + + $this->makeCacheFile($site_module_info->site_srl, "pc"); + $this->makeCacheFile($site_module_info->site_srl, "mobile"); + } + + + + /** + * @brief 애드온 추가 + * DB에 애드온을 추가함 + **/ + function doInsert($addon, $site_srl = 0) { + $args->addon = $addon; + $args->is_used = 'N'; + if(!$site_srl) return executeQuery('addon.insertAddon', $args); + $args->site_srl = $site_srl; + return executeQuery('addon.insertSiteAddon', $args); + } + + /** + * @brief 애드온 활성화 + * addons라는 테이블에 애드온의 활성화 상태를 on 시켜줌 + **/ + function doActivate($addon, $site_srl = 0, $type = "pc") { + $args->addon = $addon; + if($type == "pc") $args->is_used = 'Y'; + else $args->is_used_m = "Y"; + if(!$site_srl) return executeQuery('addon.updateAddon', $args); + $args->site_srl = $site_srl; + return executeQuery('addon.updateSiteAddon', $args); + } + + /** + * @brief 애드온 비활성화 + * + * addons라는 테이블에 애드온의 이름을 제거하는 것으로 비활성화를 시키게 된다 + **/ + function doDeactivate($addon, $site_srl = 0, $type = "pc") { + $args->addon = $addon; + if($type == "pc") $args->is_used = 'N'; + else $args->is_used_m = 'N'; + if(!$site_srl) return executeQuery('addon.updateAddon', $args); + $args->site_srl = $site_srl; + return executeQuery('addon.updateSiteAddon', $args); + } + + + } +?> diff --git a/modules/addon/addon.admin.model.php b/modules/addon/addon.admin.model.php index b6efdaa01..23c9125ac 100644 --- a/modules/addon/addon.admin.model.php +++ b/modules/addon/addon.admin.model.php @@ -1,313 +1,313 @@ -getInsertedAddons($site_srl); - - // 다운받은 애드온과 설치된 애드온의 목록을 구함 - $searched_list = FileHandler::readDir('./addons'); - $searched_count = count($searched_list); - if(!$searched_count) return; - sort($searched_list); - - for($i=0;$i<$searched_count;$i++) { - // 애드온의 이름 - $addon_name = $searched_list[$i]; - if($addon_name == "smartphone") continue; - - // 애드온의 경로 (files/addons가 우선) - $path = $this->getAddonPath($addon_name); - - // 해당 애드온의 정보를 구함 - unset($info); - $info = $this->getAddonInfoXml($addon_name, $site_srl); - - $info->addon = $addon_name; - $info->path = $path; - $info->activated = false; - $info->mactivated = false; - - // DB에 입력되어 있는지 확인 - if(!in_array($addon_name, array_keys($inserted_addons))) { - // DB에 입력되어 있지 않으면 입력 (model에서 이런짓 하는거 싫지만 귀찮아서.. ㅡ.ㅜ) - $oAddonAdminController = &getAdminController('addon'); - $oAddonAdminController->doInsert($addon_name, $site_srl); - - // 활성화 되어 있는지 확인 - } else { - if($inserted_addons[$addon_name]->is_used=='Y') $info->activated = true; - if($inserted_addons[$addon_name]->is_used_m=='Y') $info->mactivated = true; - } - - $list[] = $info; - } - return $list; - } - - /** - * @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함 - **/ - function getAddonInfoXml($addon, $site_srl = 0) { - // 요청된 모듈의 경로를 구한다. 없으면 return - $addon_path = $this->getAddonPath($addon); - if(!$addon_path) return; - - // 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음 - $xml_file = sprintf("%sconf/info.xml", $addon_path); - if(!file_exists($xml_file)) return; - - $oXmlParser = new XmlParser(); - $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); - $xml_obj = $tmp_xml_obj->addon; - - if(!$xml_obj) return; - - - // DB에 설정된 내역을 가져온다 - $db_args->addon = $addon; - if(!$site_srl) $output = executeQuery('addon.getAddonInfo',$db_args); - else { - $db_args->site_srl = $site_srl; - $output = executeQuery('addon.getSiteAddonInfo',$db_args); - } - $extra_vals = unserialize($output->data->extra_vars); - - if($extra_vals->mid_list) { - $addon_info->mid_list = $extra_vals->mid_list; - } else { - $addon_info->mid_list = array(); - } - - - // 애드온 정보 - if($xml_obj->version && $xml_obj->attrs->version == '0.2') { - // addon format v0.2 - sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d); - $addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); - - $addon_info->addon_name = $addon; - $addon_info->title = $xml_obj->title->body; - $addon_info->description = trim($xml_obj->description->body); - $addon_info->version = $xml_obj->version->body; - $addon_info->homepage = $xml_obj->link->body; - $addon_info->license = $xml_obj->license->body; - $addon_info->license_link = $xml_obj->license->attrs->link; - - if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; - else $author_list = $xml_obj->author; - - foreach($author_list as $author) { - unset($author_obj); - $author_obj->name = $author->name->body; - $author_obj->email_address = $author->attrs->email_address; - $author_obj->homepage = $author->attrs->link; - $addon_info->author[] = $author_obj; - } - - // 확장변수를 정리 - if($xml_obj->extra_vars) { - $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); - - foreach($extra_var_groups as $group) { - $extra_vars = $group->var; - if(!is_array($group->var)) $extra_vars = array($group->var); - - foreach($extra_vars as $key => $val) { - unset($obj); - if(!$val->attrs->type) { $val->attrs->type = 'text'; } - - $obj->group = $group->title->body; - $obj->name = $val->attrs->name; - $obj->title = $val->title->body; - $obj->type = $val->attrs->type; - $obj->description = $val->description->body; - $obj->value = $extra_vals->{$obj->name}; - 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목록을 구한다. - if(is_array($val->options)) { - $option_count = count($val->options); - - for($i = 0; $i < $option_count; $i++) { - $obj->options[$i]->title = $val->options[$i]->title->body; - $obj->options[$i]->value = $val->options[$i]->attrs->value; - } - } else { - $obj->options[0]->title = $val->options[0]->title->body; - $obj->options[0]->value = $val->options[0]->attrs->value; - } - - $addon_info->extra_vars[] = $obj; - } - } - } - - // history - if($xml_obj->history) { - if(!is_array($xml_obj->history)) $history[] = $xml_obj->history; - else $history = $xml_obj->history; - - foreach($history as $item) { - unset($obj); - - if($item->author) { - (!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author; - - foreach($obj->author_list as $author) { - unset($author_obj); - $author_obj->name = $author->name->body; - $author_obj->email_address = $author->attrs->email_address; - $author_obj->homepage = $author->attrs->link; - $obj->author[] = $author_obj; - } - } - - $obj->name = $item->name->body; - $obj->email_address = $item->attrs->email_address; - $obj->homepage = $item->attrs->link; - $obj->version = $item->attrs->version; - $obj->date = $item->attrs->date; - $obj->description = $item->description->body; - - if($item->log) { - (!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log; - - foreach($obj->log as $log) { - unset($log_obj); - $log_obj->text = $log->body; - $log_obj->link = $log->attrs->link; - $obj->logs[] = $log_obj; - } - } - - $addon_info->history[] = $obj; - } - } - - - } else { - // addon format 0.1 - $addon_info->addon_name = $addon; - $addon_info->title = $xml_obj->title->body; - $addon_info->description = trim($xml_obj->author->description->body); - $addon_info->version = $xml_obj->attrs->version; - sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d); - $addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); - $author_obj->name = $xml_obj->author->name->body; - $author_obj->email_address = $xml_obj->author->attrs->email_address; - $author_obj->homepage = $xml_obj->author->attrs->link; - $addon_info->author[] = $author_obj; - - if($xml_obj->extra_vars) { - // 확장변수를 정리 - $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); - foreach($extra_var_groups as $group) { - $extra_vars = $group->var; - if(!is_array($group->var)) $extra_vars = array($group->var); - - foreach($extra_vars as $key => $val) { - unset($obj); - if(!$val->type->body) { $val->type->body = 'text'; } - - $obj->group = $group->title->body; - $obj->name = $val->attrs->name; - $obj->title = $val->title->body; - $obj->type = $val->type->body; - $obj->description = $val->description->body; - $obj->value = $extra_vals->{$obj->name}; - 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목록을 구한다. - if(is_array($val->options)) { - $option_count = count($val->options); - - for($i = 0; $i < $option_count; $i++) { - $obj->options[$i]->title = $val->options[$i]->title->body; - $obj->options[$i]->value = $val->options[$i]->value->body; - } - } - - $addon_info->extra_vars[] = $obj; - } - } - } - - } - - - - return $addon_info; - } - - /** - * @brief 활성화된 애드온 목록을 구해옴 - **/ - function getInsertedAddons($site_srl = 0) { - $args->list_order = 'addon'; - if(!$site_srl) $output = executeQuery('addon.getAddons', $args); - else { - $args->site_srl = $site_srl; - $output = executeQuery('addon.getSiteAddons', $args); - } - if(!$output->data) return array(); - if(!is_array($output->data)) $output->data = array($output->data); - - $activated_count = count($output->data); - for($i=0;$i<$activated_count;$i++) { - $addon = $output->data[$i]; - $addon_list[$addon->addon] = $addon; - } - return $addon_list; - } - - /** - * @brief 애드온이 활성화 되어 있는지 체크 - **/ - function isActivatedAddon($addon, $site_srl = 0, $type = "pc") { - $args->addon = $addon; - if(!$site_srl) { - if($type == "pc") $output = executeQuery('addon.getAddonIsActivated', $args); - else $output = executeQuery('addon.getMAddonIsActivated', $args); - } - else { - $args->site_srl = $site_srl; - if($type == "pc") $output = executeQuery('addon.getSiteAddonIsActivated', $args); - else $output = executeQuery('addon.getSiteMAddonIsActivated', $args); - } - if($output->data->count>0) return true; - return false; - } - - } -?> +getInsertedAddons($site_srl); + + // 다운받은 애드온과 설치된 애드온의 목록을 구함 + $searched_list = FileHandler::readDir('./addons'); + $searched_count = count($searched_list); + if(!$searched_count) return; + sort($searched_list); + + for($i=0;$i<$searched_count;$i++) { + // 애드온의 이름 + $addon_name = $searched_list[$i]; + if($addon_name == "smartphone") continue; + + // 애드온의 경로 (files/addons가 우선) + $path = $this->getAddonPath($addon_name); + + // 해당 애드온의 정보를 구함 + unset($info); + $info = $this->getAddonInfoXml($addon_name, $site_srl); + + $info->addon = $addon_name; + $info->path = $path; + $info->activated = false; + $info->mactivated = false; + + // DB에 입력되어 있는지 확인 + if(!in_array($addon_name, array_keys($inserted_addons))) { + // DB에 입력되어 있지 않으면 입력 (model에서 이런짓 하는거 싫지만 귀찮아서.. ㅡ.ㅜ) + $oAddonAdminController = &getAdminController('addon'); + $oAddonAdminController->doInsert($addon_name, $site_srl); + + // 활성화 되어 있는지 확인 + } else { + if($inserted_addons[$addon_name]->is_used=='Y') $info->activated = true; + if($inserted_addons[$addon_name]->is_used_m=='Y') $info->mactivated = true; + } + + $list[] = $info; + } + return $list; + } + + /** + * @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함 + **/ + function getAddonInfoXml($addon, $site_srl = 0) { + // 요청된 모듈의 경로를 구한다. 없으면 return + $addon_path = $this->getAddonPath($addon); + if(!$addon_path) return; + + // 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음 + $xml_file = sprintf("%sconf/info.xml", $addon_path); + if(!file_exists($xml_file)) return; + + $oXmlParser = new XmlParser(); + $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); + $xml_obj = $tmp_xml_obj->addon; + + if(!$xml_obj) return; + + + // DB에 설정된 내역을 가져온다 + $db_args->addon = $addon; + if(!$site_srl) $output = executeQuery('addon.getAddonInfo',$db_args); + else { + $db_args->site_srl = $site_srl; + $output = executeQuery('addon.getSiteAddonInfo',$db_args); + } + $extra_vals = unserialize($output->data->extra_vars); + + if($extra_vals->mid_list) { + $addon_info->mid_list = $extra_vals->mid_list; + } else { + $addon_info->mid_list = array(); + } + + + // 애드온 정보 + if($xml_obj->version && $xml_obj->attrs->version == '0.2') { + // addon format v0.2 + sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d); + $addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); + + $addon_info->addon_name = $addon; + $addon_info->title = $xml_obj->title->body; + $addon_info->description = trim($xml_obj->description->body); + $addon_info->version = $xml_obj->version->body; + $addon_info->homepage = $xml_obj->link->body; + $addon_info->license = $xml_obj->license->body; + $addon_info->license_link = $xml_obj->license->attrs->link; + + if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; + else $author_list = $xml_obj->author; + + foreach($author_list as $author) { + unset($author_obj); + $author_obj->name = $author->name->body; + $author_obj->email_address = $author->attrs->email_address; + $author_obj->homepage = $author->attrs->link; + $addon_info->author[] = $author_obj; + } + + // 확장변수를 정리 + if($xml_obj->extra_vars) { + $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); + + foreach($extra_var_groups as $group) { + $extra_vars = $group->var; + if(!is_array($group->var)) $extra_vars = array($group->var); + + foreach($extra_vars as $key => $val) { + unset($obj); + if(!$val->attrs->type) { $val->attrs->type = 'text'; } + + $obj->group = $group->title->body; + $obj->name = $val->attrs->name; + $obj->title = $val->title->body; + $obj->type = $val->attrs->type; + $obj->description = $val->description->body; + $obj->value = $extra_vals->{$obj->name}; + 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목록을 구한다. + if(is_array($val->options)) { + $option_count = count($val->options); + + for($i = 0; $i < $option_count; $i++) { + $obj->options[$i]->title = $val->options[$i]->title->body; + $obj->options[$i]->value = $val->options[$i]->attrs->value; + } + } else { + $obj->options[0]->title = $val->options[0]->title->body; + $obj->options[0]->value = $val->options[0]->attrs->value; + } + + $addon_info->extra_vars[] = $obj; + } + } + } + + // history + if($xml_obj->history) { + if(!is_array($xml_obj->history)) $history[] = $xml_obj->history; + else $history = $xml_obj->history; + + foreach($history as $item) { + unset($obj); + + if($item->author) { + (!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author; + + foreach($obj->author_list as $author) { + unset($author_obj); + $author_obj->name = $author->name->body; + $author_obj->email_address = $author->attrs->email_address; + $author_obj->homepage = $author->attrs->link; + $obj->author[] = $author_obj; + } + } + + $obj->name = $item->name->body; + $obj->email_address = $item->attrs->email_address; + $obj->homepage = $item->attrs->link; + $obj->version = $item->attrs->version; + $obj->date = $item->attrs->date; + $obj->description = $item->description->body; + + if($item->log) { + (!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log; + + foreach($obj->log as $log) { + unset($log_obj); + $log_obj->text = $log->body; + $log_obj->link = $log->attrs->link; + $obj->logs[] = $log_obj; + } + } + + $addon_info->history[] = $obj; + } + } + + + } else { + // addon format 0.1 + $addon_info->addon_name = $addon; + $addon_info->title = $xml_obj->title->body; + $addon_info->description = trim($xml_obj->author->description->body); + $addon_info->version = $xml_obj->attrs->version; + sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d); + $addon_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); + $author_obj->name = $xml_obj->author->name->body; + $author_obj->email_address = $xml_obj->author->attrs->email_address; + $author_obj->homepage = $xml_obj->author->attrs->link; + $addon_info->author[] = $author_obj; + + if($xml_obj->extra_vars) { + // 확장변수를 정리 + $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); + foreach($extra_var_groups as $group) { + $extra_vars = $group->var; + if(!is_array($group->var)) $extra_vars = array($group->var); + + foreach($extra_vars as $key => $val) { + unset($obj); + if(!$val->type->body) { $val->type->body = 'text'; } + + $obj->group = $group->title->body; + $obj->name = $val->attrs->name; + $obj->title = $val->title->body; + $obj->type = $val->type->body; + $obj->description = $val->description->body; + $obj->value = $extra_vals->{$obj->name}; + 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목록을 구한다. + if(is_array($val->options)) { + $option_count = count($val->options); + + for($i = 0; $i < $option_count; $i++) { + $obj->options[$i]->title = $val->options[$i]->title->body; + $obj->options[$i]->value = $val->options[$i]->value->body; + } + } + + $addon_info->extra_vars[] = $obj; + } + } + } + + } + + + + return $addon_info; + } + + /** + * @brief 활성화된 애드온 목록을 구해옴 + **/ + function getInsertedAddons($site_srl = 0) { + $args->list_order = 'addon'; + if(!$site_srl) $output = executeQuery('addon.getAddons', $args); + else { + $args->site_srl = $site_srl; + $output = executeQuery('addon.getSiteAddons', $args); + } + if(!$output->data) return array(); + if(!is_array($output->data)) $output->data = array($output->data); + + $activated_count = count($output->data); + for($i=0;$i<$activated_count;$i++) { + $addon = $output->data[$i]; + $addon_list[$addon->addon] = $addon; + } + return $addon_list; + } + + /** + * @brief 애드온이 활성화 되어 있는지 체크 + **/ + function isActivatedAddon($addon, $site_srl = 0, $type = "pc") { + $args->addon = $addon; + if(!$site_srl) { + if($type == "pc") $output = executeQuery('addon.getAddonIsActivated', $args); + else $output = executeQuery('addon.getMAddonIsActivated', $args); + } + else { + $args->site_srl = $site_srl; + if($type == "pc") $output = executeQuery('addon.getSiteAddonIsActivated', $args); + else $output = executeQuery('addon.getSiteMAddonIsActivated', $args); + } + if($output->data->count>0) return true; + return false; + } + + } +?> diff --git a/modules/addon/addon.admin.view.php b/modules/addon/addon.admin.view.php index ed6e3a177..bc4c6c04e 100644 --- a/modules/addon/addon.admin.view.php +++ b/modules/addon/addon.admin.view.php @@ -1,98 +1,98 @@ -setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 애드온 관리 메인 페이지 (목록 보여줌) - **/ - function dispAddonAdminIndex() { - $site_module_info = Context::get('site_module_info'); - - // 애드온 목록을 세팅 - $oAddonModel = &getAdminModel('addon'); - $addon_list = $oAddonModel->getAddonList($site_module_info->site_srl); - Context::set('addon_list', $addon_list); - - // 템플릿 패스 및 파일을 지정 - $this->setTemplateFile('addon_list'); - } - - /** - * @biref 애드온 세부 설정 팝업 출력 - **/ - function dispAddonAdminSetup() { - $site_module_info = Context::get('site_module_info'); - - // 요청된 애드온을 구함 - $selected_addon = Context::get('selected_addon'); - - // 요청된 애드온의 정보를 구함 - $oAddonModel = &getAdminModel('addon'); - $addon_info = $oAddonModel->getAddonInfoXml($selected_addon, $site_module_info->site_srl); - Context::set('addon_info', $addon_info); - - // mid 목록을 가져옴 - $oModuleModel = &getModel('module'); - $oModuleAdminModel = &getAdminModel('module'); - - if($site_module_info->site_srl) $args->site_srl = $site_module_info->site_srl; - $mid_list = $oModuleModel->getMidList($args); - - // module_category와 module의 조합 - if(!$site_module_info->site_srl) { - // 모듈 카테고리 목록을 구함 - $module_categories = $oModuleModel->getModuleCategories(); - - if($mid_list) { - foreach($mid_list as $module_srl => $module) { - $module_categories[$module->module_category_srl]->list[$module_srl] = $module; - } - } - } else { - $module_categories[0]->list = $mid_list; - } - - Context::set('mid_list',$module_categories); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 패스 및 파일을 지정 - $this->setTemplateFile('setup_addon'); - } - - /** - * @brief 애드온의 상세 정보(conf/info.xml)를 팝업 출력 - **/ - function dispAddonAdminInfo() { - $site_module_info = Context::get('site_module_info'); - - // 요청된 애드온을 구함 - $selected_addon = Context::get('selected_addon'); - - // 요청된 애드온의 정보를 구함 - $oAddonModel = &getAdminModel('addon'); - $addon_info = $oAddonModel->getAddonInfoXml($selected_addon, $site_module_info->site_srl); - Context::set('addon_info', $addon_info); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 패스 및 파일을 지정 - $this->setTemplateFile('addon_info'); - } - - } -?> +setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 애드온 관리 메인 페이지 (목록 보여줌) + **/ + function dispAddonAdminIndex() { + $site_module_info = Context::get('site_module_info'); + + // 애드온 목록을 세팅 + $oAddonModel = &getAdminModel('addon'); + $addon_list = $oAddonModel->getAddonList($site_module_info->site_srl); + Context::set('addon_list', $addon_list); + + // 템플릿 패스 및 파일을 지정 + $this->setTemplateFile('addon_list'); + } + + /** + * @biref 애드온 세부 설정 팝업 출력 + **/ + function dispAddonAdminSetup() { + $site_module_info = Context::get('site_module_info'); + + // 요청된 애드온을 구함 + $selected_addon = Context::get('selected_addon'); + + // 요청된 애드온의 정보를 구함 + $oAddonModel = &getAdminModel('addon'); + $addon_info = $oAddonModel->getAddonInfoXml($selected_addon, $site_module_info->site_srl); + Context::set('addon_info', $addon_info); + + // mid 목록을 가져옴 + $oModuleModel = &getModel('module'); + $oModuleAdminModel = &getAdminModel('module'); + + if($site_module_info->site_srl) $args->site_srl = $site_module_info->site_srl; + $mid_list = $oModuleModel->getMidList($args); + + // module_category와 module의 조합 + if(!$site_module_info->site_srl) { + // 모듈 카테고리 목록을 구함 + $module_categories = $oModuleModel->getModuleCategories(); + + if($mid_list) { + foreach($mid_list as $module_srl => $module) { + $module_categories[$module->module_category_srl]->list[$module_srl] = $module; + } + } + } else { + $module_categories[0]->list = $mid_list; + } + + Context::set('mid_list',$module_categories); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 패스 및 파일을 지정 + $this->setTemplateFile('setup_addon'); + } + + /** + * @brief 애드온의 상세 정보(conf/info.xml)를 팝업 출력 + **/ + function dispAddonAdminInfo() { + $site_module_info = Context::get('site_module_info'); + + // 요청된 애드온을 구함 + $selected_addon = Context::get('selected_addon'); + + // 요청된 애드온의 정보를 구함 + $oAddonModel = &getAdminModel('addon'); + $addon_info = $oAddonModel->getAddonInfoXml($selected_addon, $site_module_info->site_srl); + Context::set('addon_info', $addon_info); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 패스 및 파일을 지정 + $this->setTemplateFile('addon_info'); + } + + } +?> diff --git a/modules/addon/addon.class.php b/modules/addon/addon.class.php index 7472e19dd..f75dbc47e 100644 --- a/modules/addon/addon.class.php +++ b/modules/addon/addon.class.php @@ -1,71 +1,71 @@ -doInsert('autolink'); - $oAddonController->doInsert('blogapi'); - $oAddonController->doInsert('counter'); - $oAddonController->doInsert('member_communication'); - $oAddonController->doInsert('member_extra_info'); - $oAddonController->doInsert('mobile'); - $oAddonController->doInsert('referer'); - $oAddonController->doInsert('resize_image'); - $oAddonController->doInsert('openid_delegation_id'); - $oAddonController->doInsert('point_level_icon'); - - // 몇가지 애드온을 기본 활성화 상태로 변경 - $oAddonController->doActivate('autolink'); - $oAddonController->doActivate('counter'); - $oAddonController->doActivate('member_communication'); - $oAddonController->doActivate('member_extra_info'); - $oAddonController->doActivate('mobile'); - $oAddonController->doActivate('referer'); - $oAddonController->doActivate('resize_image'); - $oAddonController->makeCacheFile(0); - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oDB = &DB::getInstance(); - if(!$oDB->isColumnExists("addons", "is_used_m")) return true; - if(!$oDB->isColumnExists("addons_site", "is_used_m")) return true; - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB = &DB::getInstance(); - if(!$oDB->isColumnExists("addons", "is_used_m")) { - $oDB->addColumn("addons", "is_used_m", "char", 1, "N", true); - } - if(!$oDB->isColumnExists("addons_site", "is_used_m")) { - $oDB->addColumn("addons_site", "is_used_m", "char", 1, "N", true); - } - return new Object(); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - FileHandler::removeFilesInDir('./files/cache/addons'); - } - - } -?> +doInsert('autolink'); + $oAddonController->doInsert('blogapi'); + $oAddonController->doInsert('counter'); + $oAddonController->doInsert('member_communication'); + $oAddonController->doInsert('member_extra_info'); + $oAddonController->doInsert('mobile'); + $oAddonController->doInsert('referer'); + $oAddonController->doInsert('resize_image'); + $oAddonController->doInsert('openid_delegation_id'); + $oAddonController->doInsert('point_level_icon'); + + // 몇가지 애드온을 기본 활성화 상태로 변경 + $oAddonController->doActivate('autolink'); + $oAddonController->doActivate('counter'); + $oAddonController->doActivate('member_communication'); + $oAddonController->doActivate('member_extra_info'); + $oAddonController->doActivate('mobile'); + $oAddonController->doActivate('referer'); + $oAddonController->doActivate('resize_image'); + $oAddonController->makeCacheFile(0); + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oDB = &DB::getInstance(); + if(!$oDB->isColumnExists("addons", "is_used_m")) return true; + if(!$oDB->isColumnExists("addons_site", "is_used_m")) return true; + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB = &DB::getInstance(); + if(!$oDB->isColumnExists("addons", "is_used_m")) { + $oDB->addColumn("addons", "is_used_m", "char", 1, "N", true); + } + if(!$oDB->isColumnExists("addons_site", "is_used_m")) { + $oDB->addColumn("addons_site", "is_used_m", "char", 1, "N", true); + } + return new Object(); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + FileHandler::removeFilesInDir('./files/cache/addons'); + } + + } +?> diff --git a/modules/addon/addon.controller.php b/modules/addon/addon.controller.php index 7e29d2267..205f377fc 100644 --- a/modules/addon/addon.controller.php +++ b/modules/addon/addon.controller.php @@ -1,185 +1,185 @@ -site_srl; - - $addon_path = _XE_PATH_.'files/cache/addons/'; - - if($site_srl) $addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php'; - else $addon_file = $addon_path.$type.'acivated_addons.cache.php'; - - if($this->addon_file_called) return $addon_file; - $this->addon_file_called = true; - - if(!is_dir($addon_path)) FileHandler::makeDir($addon_path); - if(!file_exists($addon_file)) $this->makeCacheFile($site_srl, $type); - return $addon_file; - } - - - /** - * @brief 애드온 mid 추가 설정 - **/ - function _getMidList($selected_addon, $site_srl = 0) { - - $oAddonAdminModel = &getAdminModel('addon'); - $addon_info = $oAddonAdminModel->getAddonInfoXml($selected_addon, $site_srl); - return $addon_info->mid_list; - } - - - - /** - * @brief 애드온 mid 추가 설정 - **/ - function _setAddMid($selected_addon,$mid, $site_srl=0) { - - // 요청된 애드온의 정보를 구함 - $mid_list = $this->_getMidList($selected_addon, $site_srl); - - $mid_list[] = $mid; - $new_mid_list = array_unique($mid_list); - $this->_setMid($selected_addon,$new_mid_list, $site_srl); - } - - - /** - * @brief 애드온 mid 추가 설정 - **/ - function _setDelMid($selected_addon,$mid,$site_srl=0) { - - // 요청된 애드온의 정보를 구함 - $mid_list = $this->_getMidList($selected_addon,$site_srl); - - $new_mid_list = array(); - if(is_array($mid_list)){ - for($i=0,$c=count($mid_list);$i<$c;$i++){ - if($mid_list[$i] != $mid) $new_mid_list[] = $mid_list[$i]; - } - }else{ - $new_mid_list[] = $mid; - } - - - $this->_setMid($selected_addon,$new_mid_list,$site_srl); - } - - /** - * @brief 애드온 mid 추가 설정 - **/ - function _setMid($selected_addon,$mid_list,$site_srl=0) { - $args->mid_list = join('|@|',$mid_list); - $this->doSetup($selected_addon, $args,$site_srl); - $this->makeCacheFile($site_srl); - } - - - /** - * @brief 애드온 mid 추가 - **/ - function procAddonSetupAddonAddMid() { - $site_module_info = Context::get('site_module_info'); - - $args = Context::getRequestVars(); - $addon_name = $args->addon_name; - $mid = $args->mid; - $this->_setAddMid($addon_name,$mid,$site_module_info->site_srl); - } - - /** - * @brief 애드온 mid 삭제 - **/ - function procAddonSetupAddonDelMid() { - $site_module_info = Context::get('site_module_info'); - - $args = Context::getRequestVars(); - $addon_name = $args->addon_name; - $mid = $args->mid; - - $this->_setDelMid($addon_name,$mid,$site_module_info->site_srl); - } - - /** - * @brief 캐시 파일 생성 - **/ - function makeCacheFile($site_srl = 0, $type = "pc") { - // 모듈에서 애드온을 사용하기 위한 캐시 파일 생성 - $buff = ""; - $oAddonModel = &getAdminModel('addon'); - $addon_list = $oAddonModel->getInsertedAddons($site_srl, $type); - foreach($addon_list as $addon => $val) { - if($val->addon == "smartphone") continue; - if(!is_dir(_XE_PATH_.'addons/'.$addon)) continue; - if(($type == "pc" && $val->is_used != 'Y') || ($type == "mobile" && $val->is_used_m != 'Y')) continue; - - $extra_vars = unserialize($val->extra_vars); - $mid_list = $extra_vars->mid_list; - if(!is_array($mid_list)||!count($mid_list)) $mid_list = null; - $mid_list = base64_encode(serialize($mid_list)); - - if($val->extra_vars) { - unset($extra_vars); - $extra_vars = base64_encode($val->extra_vars); - } - - $buff .= sprintf(' $_ml = unserialize(base64_decode("%s")); if(file_exists("%saddons/%s/%s.addon.php") && (!is_array($_ml) || in_array($_m, $_ml))) { unset($addon_info); $addon_info = unserialize(base64_decode("%s")); $addon_path = "%saddons/%s/"; @include("%saddons/%s/%s.addon.php"); }', $mid_list, _XE_PATH_, $addon, $addon, $extra_vars, _XE_PATH_, $addon, _XE_PATH_, $addon, $addon); - } - - $buff = sprintf('', $buff); - - $addon_path = _XE_PATH_.'files/cache/addons/'; - if(!is_dir($addon_path)) FileHandler::makeDir($addon_path); - - if($site_srl) $addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php'; - else $addon_file = $addon_path.$type.'acivated_addons.cache.php'; - - FileHandler::writeFile($addon_file, $buff); - } - - /** - * @brief 애드온 설정 - **/ - function doSetup($addon, $extra_vars,$site_srl=0) { - if($extra_vars->mid_list) $extra_vars->mid_list = explode('|@|', $extra_vars->mid_list); - $args->addon = $addon; - $args->extra_vars = serialize($extra_vars); - if(!$site_srl) return executeQuery('addon.updateAddon', $args); - $args->site_srl = $site_srl; - return executeQuery('addon.updateSiteAddon', $args); - } - - /** - * @brief 가상 사이트에서의 애드온 정보 제거 - **/ - function removeAddonConfig($site_srl) { - $addon_path = _XE_PATH_.'files/cache/addons/'; - $addon_file = $addon_path.$site_srl.'.acivated_addons.cache.php'; - if(file_exists($addon_file)) FileHandler::removeFile($addon_file); - - $args->site_srl = $site_srl; - executeQuery('addon.deleteSiteAddons', $args); - - - } - - - } -?> +site_srl; + + $addon_path = _XE_PATH_.'files/cache/addons/'; + + if($site_srl) $addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php'; + else $addon_file = $addon_path.$type.'acivated_addons.cache.php'; + + if($this->addon_file_called) return $addon_file; + $this->addon_file_called = true; + + if(!is_dir($addon_path)) FileHandler::makeDir($addon_path); + if(!file_exists($addon_file)) $this->makeCacheFile($site_srl, $type); + return $addon_file; + } + + + /** + * @brief 애드온 mid 추가 설정 + **/ + function _getMidList($selected_addon, $site_srl = 0) { + + $oAddonAdminModel = &getAdminModel('addon'); + $addon_info = $oAddonAdminModel->getAddonInfoXml($selected_addon, $site_srl); + return $addon_info->mid_list; + } + + + + /** + * @brief 애드온 mid 추가 설정 + **/ + function _setAddMid($selected_addon,$mid, $site_srl=0) { + + // 요청된 애드온의 정보를 구함 + $mid_list = $this->_getMidList($selected_addon, $site_srl); + + $mid_list[] = $mid; + $new_mid_list = array_unique($mid_list); + $this->_setMid($selected_addon,$new_mid_list, $site_srl); + } + + + /** + * @brief 애드온 mid 추가 설정 + **/ + function _setDelMid($selected_addon,$mid,$site_srl=0) { + + // 요청된 애드온의 정보를 구함 + $mid_list = $this->_getMidList($selected_addon,$site_srl); + + $new_mid_list = array(); + if(is_array($mid_list)){ + for($i=0,$c=count($mid_list);$i<$c;$i++){ + if($mid_list[$i] != $mid) $new_mid_list[] = $mid_list[$i]; + } + }else{ + $new_mid_list[] = $mid; + } + + + $this->_setMid($selected_addon,$new_mid_list,$site_srl); + } + + /** + * @brief 애드온 mid 추가 설정 + **/ + function _setMid($selected_addon,$mid_list,$site_srl=0) { + $args->mid_list = join('|@|',$mid_list); + $this->doSetup($selected_addon, $args,$site_srl); + $this->makeCacheFile($site_srl); + } + + + /** + * @brief 애드온 mid 추가 + **/ + function procAddonSetupAddonAddMid() { + $site_module_info = Context::get('site_module_info'); + + $args = Context::getRequestVars(); + $addon_name = $args->addon_name; + $mid = $args->mid; + $this->_setAddMid($addon_name,$mid,$site_module_info->site_srl); + } + + /** + * @brief 애드온 mid 삭제 + **/ + function procAddonSetupAddonDelMid() { + $site_module_info = Context::get('site_module_info'); + + $args = Context::getRequestVars(); + $addon_name = $args->addon_name; + $mid = $args->mid; + + $this->_setDelMid($addon_name,$mid,$site_module_info->site_srl); + } + + /** + * @brief 캐시 파일 생성 + **/ + function makeCacheFile($site_srl = 0, $type = "pc") { + // 모듈에서 애드온을 사용하기 위한 캐시 파일 생성 + $buff = ""; + $oAddonModel = &getAdminModel('addon'); + $addon_list = $oAddonModel->getInsertedAddons($site_srl, $type); + foreach($addon_list as $addon => $val) { + if($val->addon == "smartphone") continue; + if(!is_dir(_XE_PATH_.'addons/'.$addon)) continue; + if(($type == "pc" && $val->is_used != 'Y') || ($type == "mobile" && $val->is_used_m != 'Y')) continue; + + $extra_vars = unserialize($val->extra_vars); + $mid_list = $extra_vars->mid_list; + if(!is_array($mid_list)||!count($mid_list)) $mid_list = null; + $mid_list = base64_encode(serialize($mid_list)); + + if($val->extra_vars) { + unset($extra_vars); + $extra_vars = base64_encode($val->extra_vars); + } + + $buff .= sprintf(' $_ml = unserialize(base64_decode("%s")); if(file_exists("%saddons/%s/%s.addon.php") && (!is_array($_ml) || in_array($_m, $_ml))) { unset($addon_info); $addon_info = unserialize(base64_decode("%s")); $addon_path = "%saddons/%s/"; @include("%saddons/%s/%s.addon.php"); }', $mid_list, _XE_PATH_, $addon, $addon, $extra_vars, _XE_PATH_, $addon, _XE_PATH_, $addon, $addon); + } + + $buff = sprintf('', $buff); + + $addon_path = _XE_PATH_.'files/cache/addons/'; + if(!is_dir($addon_path)) FileHandler::makeDir($addon_path); + + if($site_srl) $addon_file = $addon_path.$site_srl.$type.'.acivated_addons.cache.php'; + else $addon_file = $addon_path.$type.'acivated_addons.cache.php'; + + FileHandler::writeFile($addon_file, $buff); + } + + /** + * @brief 애드온 설정 + **/ + function doSetup($addon, $extra_vars,$site_srl=0) { + if($extra_vars->mid_list) $extra_vars->mid_list = explode('|@|', $extra_vars->mid_list); + $args->addon = $addon; + $args->extra_vars = serialize($extra_vars); + if(!$site_srl) return executeQuery('addon.updateAddon', $args); + $args->site_srl = $site_srl; + return executeQuery('addon.updateSiteAddon', $args); + } + + /** + * @brief 가상 사이트에서의 애드온 정보 제거 + **/ + function removeAddonConfig($site_srl) { + $addon_path = _XE_PATH_.'files/cache/addons/'; + $addon_file = $addon_path.$site_srl.'.acivated_addons.cache.php'; + if(file_exists($addon_file)) FileHandler::removeFile($addon_file); + + $args->site_srl = $site_srl; + executeQuery('addon.deleteSiteAddons', $args); + + + } + + + } +?> diff --git a/modules/addon/conf/info.xml b/modules/addon/conf/info.xml index 5deb7c53b..17f4abae8 100644 --- a/modules/addon/conf/info.xml +++ b/modules/addon/conf/info.xml @@ -1,39 +1,39 @@ - - - 애드온 - Addon - Addon - Addon - 插件管理 - アドオン - Additions - Аддон - 附加元件 - Eklenti - 애드온을 등록하거나 사용/미사용을 설정하는 애드온 관리 모듈입니다. - This module is for maintaining addons which can toggle use and disuse states. - Module này dành cho việc bảo trì những Addon đang sử dụng và không sử dụng. - Este Módulo es para agregar Addons, como también el manejo de ellos. - 登录插件或设置启用/禁用插件的管理模块。 - アドオンの「登録、使用・未使用」などを設定する管理モジュールです。 - Ce module est pour les Additions de maintien qui peuvent basculer des états d'utilisation et de désuétude. - Этот модуль служит для управления аддонами, использование которых Вы можете включать и выключать. - 設定附加元件「登錄、啟用、禁用」的管理模組。 - Bu modül, kullanımı değişebilecek veya kullanım dışı kalabilecek eklentileri korumak içindir. - 0.1 - 2007-02-28 - utility - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 애드온 + Addon + Addon + Addon + 插件管理 + アドオン + Additions + Аддон + 附加元件 + Eklenti + 애드온을 등록하거나 사용/미사용을 설정하는 애드온 관리 모듈입니다. + This module is for maintaining addons which can toggle use and disuse states. + Module này dành cho việc bảo trì những Addon đang sử dụng và không sử dụng. + Este Módulo es para agregar Addons, como también el manejo de ellos. + 登录插件或设置启用/禁用插件的管理模块。 + アドオンの「登録、使用・未使用」などを設定する管理モジュールです。 + Ce module est pour les Additions de maintien qui peuvent basculer des états d'utilisation et de désuétude. + Этот модуль служит для управления аддонами, использование которых Вы можете включать и выключать. + 設定附加元件「登錄、啟用、禁用」的管理模組。 + Bu modül, kullanımı değişebilecek veya kullanım dışı kalabilecek eklentileri korumak içindir. + 0.1 + 2007-02-28 + utility + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/addon/lang/en.lang.php b/modules/addon/lang/en.lang.php index 9055040d1..cc4f97f90 100644 --- a/modules/addon/lang/en.lang.php +++ b/modules/addon/lang/en.lang.php @@ -1,17 +1,17 @@ -addon = "Addon"; - - $lang->addon_info = 'Summary of this Addon'; - $lang->addon_maker = 'Author of this Addon'; - $lang->addon_license = 'License'; - $lang->addon_history = 'Addon History'; - - $lang->about_addon_mid = "Addons can select targets.
(All targets will be selected when nothing is selected)"; - $lang->about_addon = 'Addons control many actions performed in your site rather than display HTML results.
You can control useful functions simply by toggling ON/OFF switch'; -?> +addon = "Addon"; + + $lang->addon_info = 'Summary of this Addon'; + $lang->addon_maker = 'Author of this Addon'; + $lang->addon_license = 'License'; + $lang->addon_history = 'Addon History'; + + $lang->about_addon_mid = "Addons can select targets.
(All targets will be selected when nothing is selected)"; + $lang->about_addon = 'Addons control many actions performed in your site rather than display HTML results.
You can control useful functions simply by toggling ON/OFF switch'; +?> diff --git a/modules/addon/lang/es.lang.php b/modules/addon/lang/es.lang.php index 47b52c84f..53fe74d64 100644 --- a/modules/addon/lang/es.lang.php +++ b/modules/addon/lang/es.lang.php @@ -1,17 +1,17 @@ -addon = "Addon"; - - $lang->addon_info = 'Información de Addon'; - $lang->addon_maker = 'Autor de Addon'; - $lang->addon_license = 'License'; - $lang->addon_history = 'Historia de Addon '; - - $lang->about_addon_mid = "Add-ons se puede utilizar para especificar el destino.
(Todo gratis, están disponibles en todos los destinos)"; - $lang->about_addon = 'Addon is para controlar las acciones y no para mostrar el resultado en HTML.
Sólo con activar o desactivar el addon que desee, podrá obtener funciones útiles para la administración de tu sitio web.'; -?> +addon = "Addon"; + + $lang->addon_info = 'Información de Addon'; + $lang->addon_maker = 'Autor de Addon'; + $lang->addon_license = 'License'; + $lang->addon_history = 'Historia de Addon '; + + $lang->about_addon_mid = "Add-ons se puede utilizar para especificar el destino.
(Todo gratis, están disponibles en todos los destinos)"; + $lang->about_addon = 'Addon is para controlar las acciones y no para mostrar el resultado en HTML.
Sólo con activar o desactivar el addon que desee, podrá obtener funciones útiles para la administración de tu sitio web.'; +?> diff --git a/modules/addon/lang/fr.lang.php b/modules/addon/lang/fr.lang.php index adff0133d..0decf6c9b 100644 --- a/modules/addon/lang/fr.lang.php +++ b/modules/addon/lang/fr.lang.php @@ -1,17 +1,17 @@ -addon = "Compagnon"; - - $lang->addon_info = 'Le résumé de la Compagnon'; - $lang->addon_maker = 'L\'Auteur de la Compagnon'; - $lang->addon_license = 'Licence'; - $lang->addon_history = 'L\'Histoire de la Compagnon'; - - $lang->about_addon_mid = "On peut choisir des objets dans lesquels la Compagnon soit utilisé.
(Tout sera choisi quand rien n'est choisi.)"; - $lang->about_addon = 'La Compagnon, c\'est pour contrôler les actions plutôt d\'imprimer des résultats de HTML.
Par la Touche à Bascule des compagnons que vous voulez faire marcher ou arrêter, vous pouvez appliquer les fonctions très utiles à administrer votre site Web.'; +addon = "Compagnon"; + + $lang->addon_info = 'Le résumé de la Compagnon'; + $lang->addon_maker = 'L\'Auteur de la Compagnon'; + $lang->addon_license = 'Licence'; + $lang->addon_history = 'L\'Histoire de la Compagnon'; + + $lang->about_addon_mid = "On peut choisir des objets dans lesquels la Compagnon soit utilisé.
(Tout sera choisi quand rien n'est choisi.)"; + $lang->about_addon = 'La Compagnon, c\'est pour contrôler les actions plutôt d\'imprimer des résultats de HTML.
Par la Touche à Bascule des compagnons que vous voulez faire marcher ou arrêter, vous pouvez appliquer les fonctions très utiles à administrer votre site Web.'; ?> \ No newline at end of file diff --git a/modules/addon/lang/jp.lang.php b/modules/addon/lang/jp.lang.php index 724d4e9c0..e5a24a5b5 100644 --- a/modules/addon/lang/jp.lang.php +++ b/modules/addon/lang/jp.lang.php @@ -1,17 +1,17 @@ -addon = 'アドオン'; - - $lang->addon_info = 'アドオン情報'; - $lang->addon_maker = 'アドオン制作者'; - $lang->addon_license = 'ライセンス'; - $lang->addon_history = '変更履歴'; - - $lang->about_addon_mid = 'アドオンが使われる対象を指定します。
(選択なしの場合、全てのモジュールが利用可能対象)'; - $lang->about_addon = 'アドオンは、HTMLの出力をコントロールすると言うより、動作を制御する役割をします。お好みのアドオンを「使用/未使用」に設定するだけで、サイトの運営に有用な機能が利用出来ます。'; -?> +addon = 'アドオン'; + + $lang->addon_info = 'アドオン情報'; + $lang->addon_maker = 'アドオン制作者'; + $lang->addon_license = 'ライセンス'; + $lang->addon_history = '変更履歴'; + + $lang->about_addon_mid = 'アドオンが使われる対象を指定します。
(選択なしの場合、全てのモジュールが利用可能対象)'; + $lang->about_addon = 'アドオンは、HTMLの出力をコントロールすると言うより、動作を制御する役割をします。お好みのアドオンを「使用/未使用」に設定するだけで、サイトの運営に有用な機能が利用出来ます。'; +?> diff --git a/modules/addon/lang/ko.lang.php b/modules/addon/lang/ko.lang.php index 39798220b..78726d981 100644 --- a/modules/addon/lang/ko.lang.php +++ b/modules/addon/lang/ko.lang.php @@ -1,17 +1,17 @@ -addon = '애드온'; - - $lang->addon_info = '애드온 정보'; - $lang->addon_maker = '애드온 제작자'; - $lang->addon_license = '라이선스'; - $lang->addon_history = '변경 이력'; - - $lang->about_addon_mid = '애드온이 사용될 대상을 지정할 수 있습니다.
(모두 해제 시 모든 대상에서 사용 가능합니다.)'; - $lang->about_addon = '애드온은 HTML결과물을 출력하기보다는 동작을 제어하는 역할을 합니다.
원하시는 애드온을 ON/OFF 하시는 것만으로도 사이트 운영에 유용한 기능을 연동할 수 있습니다.'; -?> +addon = '애드온'; + + $lang->addon_info = '애드온 정보'; + $lang->addon_maker = '애드온 제작자'; + $lang->addon_license = '라이선스'; + $lang->addon_history = '변경 이력'; + + $lang->about_addon_mid = '애드온이 사용될 대상을 지정할 수 있습니다.
(모두 해제 시 모든 대상에서 사용 가능합니다.)'; + $lang->about_addon = '애드온은 HTML결과물을 출력하기보다는 동작을 제어하는 역할을 합니다.
원하시는 애드온을 ON/OFF 하시는 것만으로도 사이트 운영에 유용한 기능을 연동할 수 있습니다.'; +?> diff --git a/modules/addon/lang/ru.lang.php b/modules/addon/lang/ru.lang.php index 6e802f1dc..f2738a09b 100644 --- a/modules/addon/lang/ru.lang.php +++ b/modules/addon/lang/ru.lang.php @@ -1,17 +1,17 @@ -addon = "Аддон"; - - $lang->addon_info = 'Информация об аддоне'; - $lang->addon_maker = 'Автор аддона'; - $lang->addon_license = 'License'; - $lang->addon_history = 'История аддона'; - - $lang->about_addon_mid = "애드온이 사용될 대상을 지정할 수 있습니다.
(모두 해제시 모든 대상에서 사용 가능합니다)"; - $lang->about_addon = 'Аддон служит больше для контролирования действий, чем для отображения HTML-результатов.
Простым включением/выключением любых аддонов, Вы можете использовать очень полезные функции для администрирования Вашего веб-сайта'; -?> +addon = "Аддон"; + + $lang->addon_info = 'Информация об аддоне'; + $lang->addon_maker = 'Автор аддона'; + $lang->addon_license = 'License'; + $lang->addon_history = 'История аддона'; + + $lang->about_addon_mid = "애드온이 사용될 대상을 지정할 수 있습니다.
(모두 해제시 모든 대상에서 사용 가능합니다)"; + $lang->about_addon = 'Аддон служит больше для контролирования действий, чем для отображения HTML-результатов.
Простым включением/выключением любых аддонов, Вы можете использовать очень полезные функции для администрирования Вашего веб-сайта'; +?> diff --git a/modules/addon/lang/tr.lang.php b/modules/addon/lang/tr.lang.php index 508344c7f..2a566b476 100644 --- a/modules/addon/lang/tr.lang.php +++ b/modules/addon/lang/tr.lang.php @@ -1,17 +1,17 @@ -addon = "Eklentiler"; - - $lang->addon_info = 'Eklenti Özeti'; - $lang->addon_maker = 'Eklenti Tasarımcısı'; - $lang->addon_license = 'Lisans'; - $lang->addon_history = 'Eklenti Geçmişi'; - - $lang->about_addon_mid = "Eklentiler, hedef seçebilirler.
(Herhangi bir seçim yapılmadığında, tüm hedefler seçilecektir.)"; - $lang->about_addon = 'Eklentiler, HTML sonuçlarını göstermek yerine sitenizde gerçekleştirilen birçok eylemi kontrol ederler, .
Kullanışlı işlevleri, AÇIK/KAPALI anahtarını değiştirerek, kolayca kontrol edebilirsiniz.'; -?> +addon = "Eklentiler"; + + $lang->addon_info = 'Eklenti Özeti'; + $lang->addon_maker = 'Eklenti Tasarımcısı'; + $lang->addon_license = 'Lisans'; + $lang->addon_history = 'Eklenti Geçmişi'; + + $lang->about_addon_mid = "Eklentiler, hedef seçebilirler.
(Herhangi bir seçim yapılmadığında, tüm hedefler seçilecektir.)"; + $lang->about_addon = 'Eklentiler, HTML sonuçlarını göstermek yerine sitenizde gerçekleştirilen birçok eylemi kontrol ederler, .
Kullanışlı işlevleri, AÇIK/KAPALI anahtarını değiştirerek, kolayca kontrol edebilirsiniz.'; +?> diff --git a/modules/addon/lang/vi.lang.php b/modules/addon/lang/vi.lang.php index e9c717b4b..6d0333d2b 100644 --- a/modules/addon/lang/vi.lang.php +++ b/modules/addon/lang/vi.lang.php @@ -1,19 +1,19 @@ -addon = "Addon"; - - $lang->addon_info = 'Thông tin về Addon'; - $lang->addon_maker = 'Tác giả của Addon'; - $lang->addon_license = 'Giấy phép'; - $lang->addon_history = 'Lịch sử'; - - $lang->about_addon_mid = "Addon có thể chọn những vị trí.
(Tất cả những vị trí mà chưa Addon nào sử dụng.)"; - $lang->about_addon = 'Addon có nhiệm vụ hiển thị và kiểm soát kết quả HTML.
Bạn có thể mở hoặc tắt bất cứ Addon nào bạn muốn.'; -?> +addon = "Addon"; + + $lang->addon_info = 'Thông tin về Addon'; + $lang->addon_maker = 'Tác giả của Addon'; + $lang->addon_license = 'Giấy phép'; + $lang->addon_history = 'Lịch sử'; + + $lang->about_addon_mid = "Addon có thể chọn những vị trí.
(Tất cả những vị trí mà chưa Addon nào sử dụng.)"; + $lang->about_addon = 'Addon có nhiệm vụ hiển thị và kiểm soát kết quả HTML.
Bạn có thể mở hoặc tắt bất cứ Addon nào bạn muốn.'; +?> diff --git a/modules/addon/lang/zh-CN.lang.php b/modules/addon/lang/zh-CN.lang.php index 6b8d088bb..9e46ec955 100644 --- a/modules/addon/lang/zh-CN.lang.php +++ b/modules/addon/lang/zh-CN.lang.php @@ -1,17 +1,17 @@ -addon = "插件"; - - $lang->addon_info = '插件信息'; - $lang->addon_maker = '插件作者'; - $lang->addon_license = '版权'; - $lang->addon_history = '更新纪录 '; - - $lang->about_addon_mid = "可以指定使用插件的对象。
(全部解除表示可用在所有对象。)"; - $lang->about_addon = '插件就是对动作(Action)的有效控制来给核心程序提供扩展功能的一种组件。
只需启用/禁用操作,即可为网站提供强大的扩展功能。'; -?> +addon = "插件"; + + $lang->addon_info = '插件信息'; + $lang->addon_maker = '插件作者'; + $lang->addon_license = '版权'; + $lang->addon_history = '更新纪录 '; + + $lang->about_addon_mid = "可以指定使用插件的对象。
(全部解除表示可用在所有对象。)"; + $lang->about_addon = '插件就是对动作(Action)的有效控制来给核心程序提供扩展功能的一种组件。
只需启用/禁用操作,即可为网站提供强大的扩展功能。'; +?> diff --git a/modules/addon/lang/zh-TW.lang.php b/modules/addon/lang/zh-TW.lang.php index e93aea072..dfd4444d7 100644 --- a/modules/addon/lang/zh-TW.lang.php +++ b/modules/addon/lang/zh-TW.lang.php @@ -1,17 +1,17 @@ -addon = "附加元件"; - - $lang->addon_info = '資料'; - $lang->addon_maker = '作者'; - $lang->addon_license = '版權'; - $lang->addon_history = '更新紀錄'; - - $lang->about_addon_mid = "可以指定使用附加元件的目標。
(全部不選取表示可用在所有目標。)"; - $lang->about_addon = '附加元件可擴展程式功能,而不是顯示輸出HTML結果。
『啟用/禁用』附加元件,以增強網站的功能。'; -?> +addon = "附加元件"; + + $lang->addon_info = '資料'; + $lang->addon_maker = '作者'; + $lang->addon_license = '版權'; + $lang->addon_history = '更新紀錄'; + + $lang->about_addon_mid = "可以指定使用附加元件的目標。
(全部不選取表示可用在所有目標。)"; + $lang->about_addon = '附加元件可擴展程式功能,而不是顯示輸出HTML結果。
『啟用/禁用』附加元件,以增強網站的功能。'; +?> diff --git a/modules/admin/admin.admin.controller.php b/modules/admin/admin.admin.controller.php index f7fcb8bb5..bc97df6b0 100644 --- a/modules/admin/admin.admin.controller.php +++ b/modules/admin/admin.admin.controller.php @@ -1,83 +1,83 @@ -getLoggedInfo(); - if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator"); - } - - /** - * @brief Regenerate all cache files - * @return none - **/ - function procAdminRecompileCacheFile() { - // rename cache dir - $temp_cache_dir = './files/cache_'. time(); - FileHandler::rename('./files/cache', $temp_cache_dir); - FileHandler::makeDir('./files/cache'); - - // remove debug files - FileHandler::removeFile(_XE_PATH_.'files/_debug_message.php'); - FileHandler::removeFile(_XE_PATH_.'files/_debug_db_query.php'); - FileHandler::removeFile(_XE_PATH_.'files/_db_slow_query.php'); - - $oModuleModel = &getModel('module'); - $module_list = $oModuleModel->getModuleList(); - - // call recompileCache for each module - foreach($module_list as $module) { - $oModule = null; - $oModule = &getClass($module->module); - if(method_exists($oModule, 'recompileCache')) $oModule->recompileCache(); - } - - // remove cache dir - $tmp_cache_list = FileHandler::readDir('./files','/(^cache_[0-9]+)/'); - if($tmp_cache_list){ - foreach($tmp_cache_list as $tmp_dir){ - if($tmp_dir) FileHandler::removeDir('./files/'.$tmp_dir); - } - } - - $truncated = array(); - $oObjectCacheHandler = &CacheHandler::getInstance(); - $oTemplateCacheHandler = &CacheHandler::getInstance('template'); - - if($oObjectCacheHandler->isSupport()){ - $truncated[] = $oObjectCacheHandler->truncate(); - } - - if($oTemplateCacheHandler->isSupport()){ - $truncated[] = $oTemplateCacheHandler->truncate(); - } - - if(count($truncated) && in_array(false,$truncated)){ - return new Object(-1,'msg_self_restart_cache_engine'); - } - - $this->setMessage('success_updated'); - } - - /** - * @brief Logout - * @return none - **/ - function procAdminLogout() { - $oMemberController = &getController('member'); - $oMemberController->procMemberLogout(); - - header('Location: '.getNotEncodedUrl('', 'module','admin')); - } - } -?> +getLoggedInfo(); + if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator"); + } + + /** + * @brief Regenerate all cache files + * @return none + **/ + function procAdminRecompileCacheFile() { + // rename cache dir + $temp_cache_dir = './files/cache_'. time(); + FileHandler::rename('./files/cache', $temp_cache_dir); + FileHandler::makeDir('./files/cache'); + + // remove debug files + FileHandler::removeFile(_XE_PATH_.'files/_debug_message.php'); + FileHandler::removeFile(_XE_PATH_.'files/_debug_db_query.php'); + FileHandler::removeFile(_XE_PATH_.'files/_db_slow_query.php'); + + $oModuleModel = &getModel('module'); + $module_list = $oModuleModel->getModuleList(); + + // call recompileCache for each module + foreach($module_list as $module) { + $oModule = null; + $oModule = &getClass($module->module); + if(method_exists($oModule, 'recompileCache')) $oModule->recompileCache(); + } + + // remove cache dir + $tmp_cache_list = FileHandler::readDir('./files','/(^cache_[0-9]+)/'); + if($tmp_cache_list){ + foreach($tmp_cache_list as $tmp_dir){ + if($tmp_dir) FileHandler::removeDir('./files/'.$tmp_dir); + } + } + + $truncated = array(); + $oObjectCacheHandler = &CacheHandler::getInstance(); + $oTemplateCacheHandler = &CacheHandler::getInstance('template'); + + if($oObjectCacheHandler->isSupport()){ + $truncated[] = $oObjectCacheHandler->truncate(); + } + + if($oTemplateCacheHandler->isSupport()){ + $truncated[] = $oTemplateCacheHandler->truncate(); + } + + if(count($truncated) && in_array(false,$truncated)){ + return new Object(-1,'msg_self_restart_cache_engine'); + } + + $this->setMessage('success_updated'); + } + + /** + * @brief Logout + * @return none + **/ + function procAdminLogout() { + $oMemberController = &getController('member'); + $oMemberController->procMemberLogout(); + + header('Location: '.getNotEncodedUrl('', 'module','admin')); + } + } +?> diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index c9961939c..ff7d3e896 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -1,358 +1,358 @@ -getLoggedInfo(); - if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator"); - - // change into administration layout - $this->setTemplatePath($this->module_path.'tpl'); - $this->setLayoutPath($this->getTemplatePath()); - $this->setLayoutFile('layout.html'); - - $this->loadSideBar(); - - // Retrieve the list of installed modules - - $db_info = Context::getDBInfo(); - - Context::set('time_zone_list', $GLOBALS['time_zone']); - Context::set('time_zone', $GLOBALS['_time_zone']); - Context::set('use_rewrite', $db_info->use_rewrite=='Y'?'Y':'N'); - Context::set('use_sso', $db_info->use_sso=='Y'?'Y':'N'); - Context::set('use_spaceremover', $db_info->use_spaceremover?$db_info->use_spaceremover:'Y'); - Context::set('qmail_compatibility', $db_info->qmail_compatibility=='Y'?'Y':'N'); - Context::set('use_db_session', $db_info->use_db_session=='N'?'N':'Y'); - Context::set('use_mobile_view', $db_info->use_mobile_view =='Y'?'Y':'N'); - Context::set('use_ssl', $db_info->use_ssl?$db_info->use_ssl:"none"); - if($db_info->http_port) Context::set('http_port', $db_info->http_port); - if($db_info->https_port) Context::set('https_port', $db_info->https_port); - - } - - function loadSideBar() - { - $oModuleModel = &getModel('module'); - $installed_module_list = $oModuleModel->getModulesXmlInfo(); - - $installed_modules = $package_modules = array(); - $package_idx = 0; - foreach($installed_module_list as $key => $val) { - if($val->category == 'migration') $val->category = 'system'; - if($val->category == 'interlock') $val->category = 'accessory'; - if($val->category == 'statistics') $val->category = 'accessory'; - - if($val->module == 'admin' || !$val->admin_index_act) continue; - // get action information - $action_spec = $oModuleModel->getModuleActionXml($val->module); - $actions = array(); - if($action_spec->default_index_act) $actions[] = $action_spec->default_index_act; - if($action_spec->admin_index_act) $actions[] = $action_spec->admin_index_act; - if($action_spec->action) foreach($action_spec->action as $k => $v) $actions[] = $k; - - $obj = null; - $obj->category = $val->category; - $obj->title = $val->title; - $obj->description = $val->description; - $obj->index_act = $val->admin_index_act; - if(in_array(Context::get('act'), $actions)) $obj->selected = true; - - // Packages - if($val->category == 'package') { - if($package_idx == 0) $obj->position = "first"; - else $obj->position = "mid"; - $package_modules[] = $obj; - $package_idx ++; - if($obj->selected) Context::set('package_selected',true); - // Modules - } else { - $installed_modules[] = $obj; - } - if($obj->selected) { - Context::set('selected_module_category', $val->category); - Context::set('selected_module_info', $val); - } - } - if(count($package_modules)) $package_modules[count($package_modules)-1]->position = 'end'; - Context::set('package_modules', $package_modules); - Context::set('installed_modules', $installed_modules); - Context::setBrowserTitle("XE Admin Page"); - - // add javascript tooltip plugin - gony - Context::loadJavascriptPlugin('qtip'); - Context::loadJavascriptPlugin('watchinput'); - } - - /** - * @brief Display main administration page - * @return none - **/ - function dispAdminIndex() { - //Retrieve recent news and set them into context - $newest_news_url = sprintf("http://news.xpressengine.com/%s/news.php", Context::getLangType()); - $cache_file = sprintf("%sfiles/cache/newest_news.%s.cache.php", _XE_PATH_,Context::getLangType()); - if(!file_exists($cache_file) || filemtime($cache_file)+ 60*60 < time()) { - // Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing administration page - // Ensure to access the administration page even though news cannot be displayed - FileHandler::writeFile($cache_file,''); - FileHandler::getRemoteFile($newest_news_url, $cache_file, null, 1, 'GET', 'text/html', array('REQUESTURL'=>getFullUrl(''))); - } - - if(file_exists($cache_file)) { - $oXml = new XmlParser(); - $buff = $oXml->parse(FileHandler::readFile($cache_file)); - - $item = $buff->zbxe_news->item; - if($item) { - if(!is_array($item)) $item = array($item); - - foreach($item as $key => $val) { - $obj = null; - $obj->title = $val->body; - $obj->date = $val->attrs->date; - $obj->url = $val->attrs->url; - $news[] = $obj; - } - Context::set('news', $news); - } - - Context::set('released_version', $buff->zbxe_news->attrs->released_version); - Context::set('download_link', $buff->zbxe_news->attrs->download_link); - } - - // DB Information - $db_info = Context::getDBInfo(); - Context::set('selected_lang', $db_info->lang_type); - - // Current Version and Installed Path - Context::set('current_version', __ZBXE_VERSION__); - Context::set('installed_path', realpath('./')); - - // Get list of modules - $oModuleModel = &getModel('module'); - $module_list = $oModuleModel->getModuleList(); - Context::set('module_list', $module_list); - - // Get list of addons - $oAddonModel = &getAdminModel('addon'); - $addon_list = $oAddonModel->getAddonList(); - Context::set('addon_list', $addon_list); - - // 방문자수 - $time = time(); - $w = date("D"); - while(date("D",$time) != "Sat") { - $time += 60*60*24; - } - $end_time = $time; - $end_date = date("Ymd",$time); - $time -= 60*60*24; - while(date("D",$time)!="Sun") { - $thisWeek[] = date("Ymd",$time); - $time -= 60*60*24; - } - $start_time = $time; - $start_date = date("Ymd",$time-60*60*24*7); - - $args->start_date = $start_date; - $args->end_date = $end_date; - $output = executeQueryArray('admin.getVisitors', $args); - if(count($output->data)) { - foreach($output->data as $key => $val) { - $visitors[$val->regdate] = $val->unique_visitor; - } - } - $output = executeQueryArray('admin.getSiteVisitors', $args); - if(count($output->data)) { - foreach($output->data as $key => $val) { - $visitors[$val->regdate] += $val->unique_visitor; - } - } - $status->week_max = 0; - if(count($visitors)) { - foreach($visitors as $key => $val) { - if($val>$status->week_max) $status->week_max = $val; - } - } - - for($i=$start_time;$i<=$end_time;$i+=60*60*24) { - $status->thisWeekSum += $visitors[date("Ymd",$i)]; - $status->week[date("Y.m.d",$i)]->this = (int)$visitors[date("Ymd",$i)]; - $status->week[date("Y.m.d",$i)]->last = (int)$visitors[date("Ymd",$i-60*60*24*7)]; - } - - // 각종 통계 정보를 구함 - $output = executeQuery('admin.getTotalVisitors'); - $status->total_visitor = $output->data->count; - $output = executeQuery('admin.getTotalSiteVisitors'); - $status->total_visitor += $output->data->count; - $status->visitor = $visitors[date("Ymd")]; - - // 오늘의 댓글 수 - $args->regdate = date("Ymd"); - $output = executeQuery('admin.getTodayCommentCount', $args); - $status->comment_count = $output->data->count; - - // 오늘의 엮인글 수 - $args->regdate = date("Ymd"); - $output = executeQuery('admin.getTodayTrackbackCount', $args); - $status->trackback_count = $output->data->count; - - Context::set('status', $status); - - // Get statistics - $args->date = date("Ymd000000", time()-60*60*24); - $today = date("Ymd"); - - // Member Status - $output = executeQueryArray("admin.getMemberStatus", $args); - if($output->data) { - foreach($output->data as $var) { - if($var->date == $today) { - $status->member->today = $var->count; - } else { - $status->member->yesterday = $var->count; - } - } - } - $output = executeQuery("admin.getMemberCount", $args); - $status->member->total = $output->data->count; - - // Document Status - $output = executeQueryArray("admin.getDocumentStatus", $args); - if($output->data) { - foreach($output->data as $var) { - if($var->date == $today) { - $status->document->today = $var->count; - } else { - $status->document->yesterday = $var->count; - } - } - } - $output = executeQuery("admin.getDocumentCount", $args); - $status->document->total = $output->data->count; - - // Comment Status - $output = executeQueryArray("admin.getCommentStatus", $args); - if($output->data) { - foreach($output->data as $var) { - if($var->date == $today) { - $status->comment->today = $var->count; - } else { - $status->comment->yesterday = $var->count; - } - } - } - $output = executeQuery("admin.getCommentCount", $args); - $status->comment->total = $output->data->count; - - // Trackback Status - $output = executeQueryArray("admin.getTrackbackStatus", $args); - if($output->data) { - foreach($output->data as $var) { - if($var->date == $today) { - $status->trackback->today = $var->count; - } else { - $status->trackback->yesterday = $var->count; - } - } - } - $output = executeQuery("admin.getTrackbackCount", $args); - $status->trackback->total = $output->data->count; - - // Attached files Status - $output = executeQueryArray("admin.getFileStatus", $args); - if($output->data) { - foreach($output->data as $var) { - if($var->date == $today) { - $status->file->today = $var->count; - } else { - $status->file->yesterday = $var->count; - } - } - } - $output = executeQuery("admin.getFileCount", $args); - $status->file->total = $output->data->count; - - // Reported documents Status - $output = executeQueryArray("admin.getDocumentDeclaredStatus", $args); - if($output->data) { - foreach($output->data as $var) { - if($var->date == $today) { - $status->documentDeclared->today = $var->count; - } else { - $status->documentDeclared->yesterday = $var->count; - } - } - } - $output = executeQuery("admin.getDocumentDeclaredCount", $args); - $status->documentDeclared->total = $output->data->count; - - // Reported comments Status - $output = executeQueryArray("admin.getCommentDeclaredStatus", $args); - if($output->data) { - foreach($output->data as $var) { - if($var->date == $today) { - $status->commentDeclared->today = $var->count; - } else { - $status->commentDeclared->yesterday = $var->count; - } - } - } - $output = executeQuery("admin.getCommentDeclaredCount", $args); - $status->commentDeclared->total = $output->data->count; - - $site_args->site_srl = 0; - $output = executeQuery('module.getSiteInfo', $site_args); - Context::set('start_module', $output->data); - - Context::set('status', $status); - Context::set('layout','none'); - $this->setTemplateFile('index'); - } - - /** - * @brief Display Configuration(settings) page - * @return none - **/ - function dispAdminConfig() { - $db_info = Context::getDBInfo(); - - Context::set('sftp_support', function_exists(ssh2_sftp)); - - Context::set('selected_lang', $db_info->lang_type); - - Context::set('default_url', $db_info->default_url); - - Context::set('langs', Context::loadLangSupported()); - - Context::set('lang_selected', Context::loadLangSelected()); - - Context::set('use_mobile_view', $db_info->use_mobile_view=="Y"?'Y':'N'); - - $ftp_info = Context::getFTPInfo(); - Context::set('ftp_info', $ftp_info); - - $site_args->site_srl = 0; - $output = executeQuery('module.getSiteInfo', $site_args); - Context::set('start_module', $output->data); - - Context::set('pwd',$pwd); - Context::set('layout','none'); - $this->setTemplateFile('config'); - } - } -?> +getLoggedInfo(); + if($logged_info->is_admin!='Y') return $this->stop("msg_is_not_administrator"); + + // change into administration layout + $this->setTemplatePath($this->module_path.'tpl'); + $this->setLayoutPath($this->getTemplatePath()); + $this->setLayoutFile('layout.html'); + + $this->loadSideBar(); + + // Retrieve the list of installed modules + + $db_info = Context::getDBInfo(); + + Context::set('time_zone_list', $GLOBALS['time_zone']); + Context::set('time_zone', $GLOBALS['_time_zone']); + Context::set('use_rewrite', $db_info->use_rewrite=='Y'?'Y':'N'); + Context::set('use_sso', $db_info->use_sso=='Y'?'Y':'N'); + Context::set('use_spaceremover', $db_info->use_spaceremover?$db_info->use_spaceremover:'Y'); + Context::set('qmail_compatibility', $db_info->qmail_compatibility=='Y'?'Y':'N'); + Context::set('use_db_session', $db_info->use_db_session=='N'?'N':'Y'); + Context::set('use_mobile_view', $db_info->use_mobile_view =='Y'?'Y':'N'); + Context::set('use_ssl', $db_info->use_ssl?$db_info->use_ssl:"none"); + if($db_info->http_port) Context::set('http_port', $db_info->http_port); + if($db_info->https_port) Context::set('https_port', $db_info->https_port); + + } + + function loadSideBar() + { + $oModuleModel = &getModel('module'); + $installed_module_list = $oModuleModel->getModulesXmlInfo(); + + $installed_modules = $package_modules = array(); + $package_idx = 0; + foreach($installed_module_list as $key => $val) { + if($val->category == 'migration') $val->category = 'system'; + if($val->category == 'interlock') $val->category = 'accessory'; + if($val->category == 'statistics') $val->category = 'accessory'; + + if($val->module == 'admin' || !$val->admin_index_act) continue; + // get action information + $action_spec = $oModuleModel->getModuleActionXml($val->module); + $actions = array(); + if($action_spec->default_index_act) $actions[] = $action_spec->default_index_act; + if($action_spec->admin_index_act) $actions[] = $action_spec->admin_index_act; + if($action_spec->action) foreach($action_spec->action as $k => $v) $actions[] = $k; + + $obj = null; + $obj->category = $val->category; + $obj->title = $val->title; + $obj->description = $val->description; + $obj->index_act = $val->admin_index_act; + if(in_array(Context::get('act'), $actions)) $obj->selected = true; + + // Packages + if($val->category == 'package') { + if($package_idx == 0) $obj->position = "first"; + else $obj->position = "mid"; + $package_modules[] = $obj; + $package_idx ++; + if($obj->selected) Context::set('package_selected',true); + // Modules + } else { + $installed_modules[] = $obj; + } + if($obj->selected) { + Context::set('selected_module_category', $val->category); + Context::set('selected_module_info', $val); + } + } + if(count($package_modules)) $package_modules[count($package_modules)-1]->position = 'end'; + Context::set('package_modules', $package_modules); + Context::set('installed_modules', $installed_modules); + Context::setBrowserTitle("XE Admin Page"); + + // add javascript tooltip plugin - gony + Context::loadJavascriptPlugin('qtip'); + Context::loadJavascriptPlugin('watchinput'); + } + + /** + * @brief Display main administration page + * @return none + **/ + function dispAdminIndex() { + //Retrieve recent news and set them into context + $newest_news_url = sprintf("http://news.xpressengine.com/%s/news.php", Context::getLangType()); + $cache_file = sprintf("%sfiles/cache/newest_news.%s.cache.php", _XE_PATH_,Context::getLangType()); + if(!file_exists($cache_file) || filemtime($cache_file)+ 60*60 < time()) { + // Considering if data cannot be retrieved due to network problem, modify filemtime to prevent trying to reload again when refreshing administration page + // Ensure to access the administration page even though news cannot be displayed + FileHandler::writeFile($cache_file,''); + FileHandler::getRemoteFile($newest_news_url, $cache_file, null, 1, 'GET', 'text/html', array('REQUESTURL'=>getFullUrl(''))); + } + + if(file_exists($cache_file)) { + $oXml = new XmlParser(); + $buff = $oXml->parse(FileHandler::readFile($cache_file)); + + $item = $buff->zbxe_news->item; + if($item) { + if(!is_array($item)) $item = array($item); + + foreach($item as $key => $val) { + $obj = null; + $obj->title = $val->body; + $obj->date = $val->attrs->date; + $obj->url = $val->attrs->url; + $news[] = $obj; + } + Context::set('news', $news); + } + + Context::set('released_version', $buff->zbxe_news->attrs->released_version); + Context::set('download_link', $buff->zbxe_news->attrs->download_link); + } + + // DB Information + $db_info = Context::getDBInfo(); + Context::set('selected_lang', $db_info->lang_type); + + // Current Version and Installed Path + Context::set('current_version', __ZBXE_VERSION__); + Context::set('installed_path', realpath('./')); + + // Get list of modules + $oModuleModel = &getModel('module'); + $module_list = $oModuleModel->getModuleList(); + Context::set('module_list', $module_list); + + // Get list of addons + $oAddonModel = &getAdminModel('addon'); + $addon_list = $oAddonModel->getAddonList(); + Context::set('addon_list', $addon_list); + + // 방문자수 + $time = time(); + $w = date("D"); + while(date("D",$time) != "Sat") { + $time += 60*60*24; + } + $end_time = $time; + $end_date = date("Ymd",$time); + $time -= 60*60*24; + while(date("D",$time)!="Sun") { + $thisWeek[] = date("Ymd",$time); + $time -= 60*60*24; + } + $start_time = $time; + $start_date = date("Ymd",$time-60*60*24*7); + + $args->start_date = $start_date; + $args->end_date = $end_date; + $output = executeQueryArray('admin.getVisitors', $args); + if(count($output->data)) { + foreach($output->data as $key => $val) { + $visitors[$val->regdate] = $val->unique_visitor; + } + } + $output = executeQueryArray('admin.getSiteVisitors', $args); + if(count($output->data)) { + foreach($output->data as $key => $val) { + $visitors[$val->regdate] += $val->unique_visitor; + } + } + $status->week_max = 0; + if(count($visitors)) { + foreach($visitors as $key => $val) { + if($val>$status->week_max) $status->week_max = $val; + } + } + + for($i=$start_time;$i<=$end_time;$i+=60*60*24) { + $status->thisWeekSum += $visitors[date("Ymd",$i)]; + $status->week[date("Y.m.d",$i)]->this = (int)$visitors[date("Ymd",$i)]; + $status->week[date("Y.m.d",$i)]->last = (int)$visitors[date("Ymd",$i-60*60*24*7)]; + } + + // 각종 통계 정보를 구함 + $output = executeQuery('admin.getTotalVisitors'); + $status->total_visitor = $output->data->count; + $output = executeQuery('admin.getTotalSiteVisitors'); + $status->total_visitor += $output->data->count; + $status->visitor = $visitors[date("Ymd")]; + + // 오늘의 댓글 수 + $args->regdate = date("Ymd"); + $output = executeQuery('admin.getTodayCommentCount', $args); + $status->comment_count = $output->data->count; + + // 오늘의 엮인글 수 + $args->regdate = date("Ymd"); + $output = executeQuery('admin.getTodayTrackbackCount', $args); + $status->trackback_count = $output->data->count; + + Context::set('status', $status); + + // Get statistics + $args->date = date("Ymd000000", time()-60*60*24); + $today = date("Ymd"); + + // Member Status + $output = executeQueryArray("admin.getMemberStatus", $args); + if($output->data) { + foreach($output->data as $var) { + if($var->date == $today) { + $status->member->today = $var->count; + } else { + $status->member->yesterday = $var->count; + } + } + } + $output = executeQuery("admin.getMemberCount", $args); + $status->member->total = $output->data->count; + + // Document Status + $output = executeQueryArray("admin.getDocumentStatus", $args); + if($output->data) { + foreach($output->data as $var) { + if($var->date == $today) { + $status->document->today = $var->count; + } else { + $status->document->yesterday = $var->count; + } + } + } + $output = executeQuery("admin.getDocumentCount", $args); + $status->document->total = $output->data->count; + + // Comment Status + $output = executeQueryArray("admin.getCommentStatus", $args); + if($output->data) { + foreach($output->data as $var) { + if($var->date == $today) { + $status->comment->today = $var->count; + } else { + $status->comment->yesterday = $var->count; + } + } + } + $output = executeQuery("admin.getCommentCount", $args); + $status->comment->total = $output->data->count; + + // Trackback Status + $output = executeQueryArray("admin.getTrackbackStatus", $args); + if($output->data) { + foreach($output->data as $var) { + if($var->date == $today) { + $status->trackback->today = $var->count; + } else { + $status->trackback->yesterday = $var->count; + } + } + } + $output = executeQuery("admin.getTrackbackCount", $args); + $status->trackback->total = $output->data->count; + + // Attached files Status + $output = executeQueryArray("admin.getFileStatus", $args); + if($output->data) { + foreach($output->data as $var) { + if($var->date == $today) { + $status->file->today = $var->count; + } else { + $status->file->yesterday = $var->count; + } + } + } + $output = executeQuery("admin.getFileCount", $args); + $status->file->total = $output->data->count; + + // Reported documents Status + $output = executeQueryArray("admin.getDocumentDeclaredStatus", $args); + if($output->data) { + foreach($output->data as $var) { + if($var->date == $today) { + $status->documentDeclared->today = $var->count; + } else { + $status->documentDeclared->yesterday = $var->count; + } + } + } + $output = executeQuery("admin.getDocumentDeclaredCount", $args); + $status->documentDeclared->total = $output->data->count; + + // Reported comments Status + $output = executeQueryArray("admin.getCommentDeclaredStatus", $args); + if($output->data) { + foreach($output->data as $var) { + if($var->date == $today) { + $status->commentDeclared->today = $var->count; + } else { + $status->commentDeclared->yesterday = $var->count; + } + } + } + $output = executeQuery("admin.getCommentDeclaredCount", $args); + $status->commentDeclared->total = $output->data->count; + + $site_args->site_srl = 0; + $output = executeQuery('module.getSiteInfo', $site_args); + Context::set('start_module', $output->data); + + Context::set('status', $status); + Context::set('layout','none'); + $this->setTemplateFile('index'); + } + + /** + * @brief Display Configuration(settings) page + * @return none + **/ + function dispAdminConfig() { + $db_info = Context::getDBInfo(); + + Context::set('sftp_support', function_exists(ssh2_sftp)); + + Context::set('selected_lang', $db_info->lang_type); + + Context::set('default_url', $db_info->default_url); + + Context::set('langs', Context::loadLangSupported()); + + Context::set('lang_selected', Context::loadLangSelected()); + + Context::set('use_mobile_view', $db_info->use_mobile_view=="Y"?'Y':'N'); + + $ftp_info = Context::getFTPInfo(); + Context::set('ftp_info', $ftp_info); + + $site_args->site_srl = 0; + $output = executeQuery('module.getSiteInfo', $site_args); + Context::set('start_module', $output->data); + + Context::set('pwd',$pwd); + Context::set('layout','none'); + $this->setTemplateFile('config'); + } + } +?> diff --git a/modules/admin/admin.class.php b/modules/admin/admin.class.php index 24e43df67..a710474bb 100644 --- a/modules/admin/admin.class.php +++ b/modules/admin/admin.class.php @@ -1,59 +1,59 @@ -read()) { - if(substr($entry,0,11)=='newest_news') FileHandler::removeFile("./files/cache/".$entry); - } - $directory->close(); - } - } -?> +read()) { + if(substr($entry,0,11)=='newest_news') FileHandler::removeFile("./files/cache/".$entry); + } + $directory->close(); + } + } +?> diff --git a/modules/admin/conf/info.xml b/modules/admin/conf/info.xml index 2b55b624e..2faf48870 100644 --- a/modules/admin/conf/info.xml +++ b/modules/admin/conf/info.xml @@ -1,36 +1,36 @@ - - - 관리자 모듈 - Administrator Module - Administrator Module - Módulo del administrador - 管理员模块 - 管理者用モジュール - Модуль администратора - 管理員模組 - Yönetici Modülü - 각 모듈들의 기능을 나열하고 관리자용 레이아웃을 적용하여 관리 기능을 사용할 수 있도록 하는 모듈입니다. - This module shows a list of features of each module, and enables you to use a quite few of managers by applying layout for administrator. - Module này hiển thị thông tin của những Module đã được cài đặt, và cho phép bạn sử dụng quyền của Administrator để thiết lập giao diện. - Este módulo muestra una lista de características de cada módulo, en donde puede activar la función de la administracion aplicando el diseño del administrador. - 列出各模块的功能并使用管理员布局,可以让其使用管理功能的模块。 - 各モジュールの機能を表示し、かつ管理者用のレイアウトを適用させて、管理機能が使用出来るようにします。 - Этот модуль показывает список возможностей каждого модуля, и позволяет Вам использовать несколько менеджеров, применяя лейаут для администратора. - 列出各模組的功能及使用管理員版面,並可使用管理功能的模組。 - Bu modül size, her modülün özelliklerini barındıran bir liste gösterir ve yöneticiler için yerleşim düzeni uygulayarak, yöneticilerin birkaçını kullanma imkanı sunar. - 0.1 - 2007-02-28 - system - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 관리자 모듈 + Administrator Module + Administrator Module + Módulo del administrador + 管理员模块 + 管理者用モジュール + Модуль администратора + 管理員模組 + Yönetici Modülü + 각 모듈들의 기능을 나열하고 관리자용 레이아웃을 적용하여 관리 기능을 사용할 수 있도록 하는 모듈입니다. + This module shows a list of features of each module, and enables you to use a quite few of managers by applying layout for administrator. + Module này hiển thị thông tin của những Module đã được cài đặt, và cho phép bạn sử dụng quyền của Administrator để thiết lập giao diện. + Este módulo muestra una lista de características de cada módulo, en donde puede activar la función de la administracion aplicando el diseño del administrador. + 列出各模块的功能并使用管理员布局,可以让其使用管理功能的模块。 + 各モジュールの機能を表示し、かつ管理者用のレイアウトを適用させて、管理機能が使用出来るようにします。 + Этот модуль показывает список возможностей каждого модуля, и позволяет Вам использовать несколько менеджеров, применяя лейаут для администратора. + 列出各模組的功能及使用管理員版面,並可使用管理功能的模組。 + Bu modül size, her modülün özelliklerini barındıran bir liste gösterir ve yöneticiler için yerleşim düzeni uygulayarak, yöneticilerin birkaçını kullanma imkanı sunar. + 0.1 + 2007-02-28 + system + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/admin/lang/en.lang.php b/modules/admin/lang/en.lang.php index fb8b296bc..81b698d57 100644 --- a/modules/admin/lang/en.lang.php +++ b/modules/admin/lang/en.lang.php @@ -1,92 +1,92 @@ -admin_info = 'Administrator Info'; - $lang->admin_index = 'Index Admin Page'; - $lang->control_panel = 'Dashboard'; - $lang->start_module = 'Default Module'; - $lang->about_start_module = 'You can specify default module of the site.'; - - $lang->module_category_title = array( - 'service' => 'Services', - 'member' => 'Members', - 'content' => 'Contents', - 'statistics' => 'Statistics', - 'construction' => 'Construction', - 'utility' => 'Utilities', - 'interlock' => 'Embedded', - 'accessory' => 'Accessories', - 'migration' => 'Data Migration', - 'system' => 'System Setting', - ); - - $lang->newest_news = "Latest News"; - - $lang->env_setup = "Setting"; - $lang->default_url = "Default URL"; - $lang->about_default_url = "If you use a virtual site feature (e.g., cafeXE), input default URL (parent-site's address), then SSO would be enabled, thus connection to documents/modules works properly. "; - - $lang->env_information = "Environment Information"; - $lang->current_version = "Current Version"; - $lang->current_path = "Installed Path"; - $lang->released_version = "Latest Version"; - $lang->about_download_link = "New version of Zerboard XE is now available!\nPlease click the download link to get the latest version."; - - $lang->item_module = "Module List"; - $lang->item_addon = "Addon List"; - $lang->item_widget = "Widget List"; - $lang->item_layout = "Layout List"; - - $lang->module_name = "Module Name"; - $lang->addon_name = "Addon Name"; - $lang->version = "Version"; - $lang->author = "Developer"; - $lang->table_count = "Number of Table"; - $lang->installed_path = "Installed Path"; - - $lang->cmd_shortcut_management = "Edit Menu"; - - $lang->msg_is_not_administrator = 'Administrator Only'; - $lang->msg_manage_module_cannot_delete = 'Shortcuts of module, addon, layout, widget cannot be removed'; - $lang->msg_default_act_is_null = 'Shortcut could not be registered because default admin Action is not set'; - - $lang->welcome_to_xe = 'Welcome to the admin page of XE'; - $lang->about_admin_page = "Admin page is still under development,\nWe will add essential contents by accepting many good suggestions during Closebeta."; - $lang->about_lang_env = "To apply selected language as default language, click on the Save button."; - - $lang->xe_license = 'XE complies with the GPL'; - $lang->about_shortcut = 'You may remove shortcuts of modules which are registered on frequently using module list'; - - $lang->yesterday = "Yesterday"; - $lang->today = "Today"; - - $lang->cmd_lang_select = "Language"; - $lang->about_cmd_lang_select = "Only selected languages will be served."; - $lang->about_recompile_cache = "You can delete useless or invalid cache files."; - $lang->use_ssl = "Use SSL"; - $lang->ssl_options = array( - 'none' => "Never", - 'optional' => "Optional", - 'always' => "Always" - ); - $lang->about_use_ssl = "In case of 'Optional', SSL will be used for actions such as signing up / changing information. And for 'Always', your site will be served only via https."; - $lang->server_ports = "Server Port"; - $lang->about_server_ports = "If your web server does not use 80 for HTTP or 443 for HTTPS port, you should specify server ports"; - $lang->use_db_session = 'Use Session DB'; - $lang->about_db_session = 'It will use php session with DB when authenticating.
Websites with infrequent usage of web server may expect faster response when this function is disabled.
However session DB will make it unable to get current users, so you cannot use related functions.'; - $lang->sftp = "Use SFTP"; - $lang->ftp_get_list = "Get List"; - $lang->ftp_remove_info = 'Remove FTP Info.'; - $lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.'; - $lang->msg_self_restart_cache_engine = 'Please restart Memcached or cache daemon.'; - $lang->mobile_view = 'Mobile View'; - $lang->about_mobile_view = 'Mobile View will display the best layout when accessing with smartphones.'; - $lang->autoinstall = 'EasyInstall'; - - $lang->last_week = 'Last week'; - $lang->this_week = 'This week'; -?> +admin_info = 'Administrator Info'; + $lang->admin_index = 'Index Admin Page'; + $lang->control_panel = 'Dashboard'; + $lang->start_module = 'Default Module'; + $lang->about_start_module = 'You can specify default module of the site.'; + + $lang->module_category_title = array( + 'service' => 'Services', + 'member' => 'Members', + 'content' => 'Contents', + 'statistics' => 'Statistics', + 'construction' => 'Construction', + 'utility' => 'Utilities', + 'interlock' => 'Embedded', + 'accessory' => 'Accessories', + 'migration' => 'Data Migration', + 'system' => 'System Setting', + ); + + $lang->newest_news = "Latest News"; + + $lang->env_setup = "Setting"; + $lang->default_url = "Default URL"; + $lang->about_default_url = "If you use a virtual site feature (e.g., cafeXE), input default URL (parent-site's address), then SSO would be enabled, thus connection to documents/modules works properly. "; + + $lang->env_information = "Environment Information"; + $lang->current_version = "Current Version"; + $lang->current_path = "Installed Path"; + $lang->released_version = "Latest Version"; + $lang->about_download_link = "New version of Zerboard XE is now available!\nPlease click the download link to get the latest version."; + + $lang->item_module = "Module List"; + $lang->item_addon = "Addon List"; + $lang->item_widget = "Widget List"; + $lang->item_layout = "Layout List"; + + $lang->module_name = "Module Name"; + $lang->addon_name = "Addon Name"; + $lang->version = "Version"; + $lang->author = "Developer"; + $lang->table_count = "Number of Table"; + $lang->installed_path = "Installed Path"; + + $lang->cmd_shortcut_management = "Edit Menu"; + + $lang->msg_is_not_administrator = 'Administrator Only'; + $lang->msg_manage_module_cannot_delete = 'Shortcuts of module, addon, layout, widget cannot be removed'; + $lang->msg_default_act_is_null = 'Shortcut could not be registered because default admin Action is not set'; + + $lang->welcome_to_xe = 'Welcome to the admin page of XE'; + $lang->about_admin_page = "Admin page is still under development,\nWe will add essential contents by accepting many good suggestions during Closebeta."; + $lang->about_lang_env = "To apply selected language as default language, click on the Save button."; + + $lang->xe_license = 'XE complies with the GPL'; + $lang->about_shortcut = 'You may remove shortcuts of modules which are registered on frequently using module list'; + + $lang->yesterday = "Yesterday"; + $lang->today = "Today"; + + $lang->cmd_lang_select = "Language"; + $lang->about_cmd_lang_select = "Only selected languages will be served."; + $lang->about_recompile_cache = "You can delete useless or invalid cache files."; + $lang->use_ssl = "Use SSL"; + $lang->ssl_options = array( + 'none' => "Never", + 'optional' => "Optional", + 'always' => "Always" + ); + $lang->about_use_ssl = "In case of 'Optional', SSL will be used for actions such as signing up / changing information. And for 'Always', your site will be served only via https."; + $lang->server_ports = "Server Port"; + $lang->about_server_ports = "If your web server does not use 80 for HTTP or 443 for HTTPS port, you should specify server ports"; + $lang->use_db_session = 'Use Session DB'; + $lang->about_db_session = 'It will use php session with DB when authenticating.
Websites with infrequent usage of web server may expect faster response when this function is disabled.
However session DB will make it unable to get current users, so you cannot use related functions.'; + $lang->sftp = "Use SFTP"; + $lang->ftp_get_list = "Get List"; + $lang->ftp_remove_info = 'Remove FTP Info.'; + $lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.'; + $lang->msg_self_restart_cache_engine = 'Please restart Memcached or cache daemon.'; + $lang->mobile_view = 'Mobile View'; + $lang->about_mobile_view = 'Mobile View will display the best layout when accessing with smartphones.'; + $lang->autoinstall = 'EasyInstall'; + + $lang->last_week = 'Last week'; + $lang->this_week = 'This week'; +?> diff --git a/modules/admin/lang/es.lang.php b/modules/admin/lang/es.lang.php index 83ec529c3..1bc1f84b2 100644 --- a/modules/admin/lang/es.lang.php +++ b/modules/admin/lang/es.lang.php @@ -1,94 +1,94 @@ -admin_info = 'Administrador de Información'; - $lang->admin_index = 'Índice de la página admin'; - $lang->control_panel = 'Control panel'; - $lang->start_module = 'Módulo de inicio'; - $lang->about_start_module = 'Puede especificar el módulo de inicio por defecto.'; - - $lang->module_category_title = array( - 'service' => 'Service Setting', - 'member' => 'Member Setting', - 'content' => 'Content Setting', - 'statistics' => 'Statistics', - 'construction' => 'Construction', - 'utility' => 'Utility Setting', - 'interlock' => 'Interlock Setting', - 'accessory' => 'Accessories', - 'migration' => 'Data Migration', - 'system' => 'System Setting', - ); - - - $lang->newest_news = "Noticias recientes"; - - $lang->env_setup = "Configuración"; - $lang->default_url = "기본 URL"; - $lang->about_default_url = "XE sitio virtual (cafeXE, etc) tiene que introducir la URL base, al utilizar las capacidades de trabajo virtual y el tema de autenticación sayiteugan / módulos y las conexiones se realizan correctamente. (Ej: http:// dominio / ruta de instalación)"; - - $lang->env_information = "Información Ambiental"; - $lang->current_version = "Versión actual"; - $lang->current_path = "Instalado Sendero"; - $lang->released_version = "Versión más reciente"; - $lang->about_download_link = "La versión más reciente Zerboard XE está disponible.\nPara descargar la versión más reciente, haga clic en enlace de descarga."; - - $lang->item_module = "Lista de Módulos"; - $lang->item_addon = "Lista de Addons"; - $lang->item_widget = "Lista de Widgets"; - $lang->item_layout = "Liasta de Diseños"; - - $lang->module_name = "Nombre del Módulo"; - $lang->addon_name = "Nombre de Addon"; - $lang->version = "Versión"; - $lang->author = "Autor"; - $lang->table_count = "Número de los tableros"; - $lang->installed_path = "Ruta de instalación"; - - $lang->cmd_shortcut_management = "Editar el Menú"; - - $lang->msg_is_not_administrator = 'Sólo se permite el ingreso del administrador.'; - $lang->msg_manage_module_cannot_delete = 'No se puede eliminar acceso directo del Módulo, Addon, Diseño y Widget.'; - $lang->msg_default_act_is_null = 'No se puede registrar acceso directo por no estar determinada la acción del administrador predefinido.'; - - $lang->welcome_to_xe = 'Esta es la página del Administrador de XE'; - $lang->about_admin_page = "La página del Administrador aún está en desarrollo."; - $lang->about_lang_env = "Para aplicar idioma seleccionado conjunto de los usuarios, como por defecto, haga clic en el botón [Guardar] el cambio."; - - - $lang->xe_license = 'XE está bajo la Licencia de GPL'; - $lang->about_shortcut = 'Puede Eliminar los accesos directos de módulos, los cuales fueron registrados en la lista de módulos usados frecuentemente'; - - $lang->yesterday = "Yesterday"; - $lang->today = "Today"; - - $lang->cmd_lang_select = "Selección de Idioma"; - $lang->about_cmd_lang_select = "Seleccione el idioma es sólo el servicio"; - $lang->about_recompile_cache = "Inválido inútil archivo de caché puede organizar jyeotgeona"; - $lang->use_ssl = "Usar SSL"; - $lang->ssl_options = array( - 'none' => "Desactivar", - 'optional' => "Opcionalmente el", - 'always' => "Utilice siempre el" - ); - $lang->about_use_ssl = "Opcionalmente, la composición de suscripción / editar la información y el uso de SSL especificada en la acción es siempre el uso de SSL para todos los servicios que se utilizarán"; - $lang->server_ports = "Especifique el puerto del servidor"; - $lang->about_server_ports = "80 de HTTP, HTTPS al puerto 443 si se utiliza otro que se especifique lo contrario, el puerto va a necesitar."; - $lang->use_db_session = '인증 세션 DB 사용'; - $lang->about_db_session = '인증시 사용되는 PHP 세션을 DB로 사용하는 기능입니다.
웹서버의 사용율이 낮은 사이트에서는 비활성화시 사이트 응답 속도가 향상될 수 있습니다
단 현재 접속자를 구할 수 없어 관련된 기능을 사용할 수 없게 됩니다.'; - $lang->sftp = "Use SFTP"; - $lang->ftp_get_list = "Get List"; - $lang->ftp_remove_info = 'Remove FTP Info.'; - $lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.'; - $lang->msg_self_restart_cache_engine = 'Please restart Memcached or cache daemon.'; - $lang->mobile_view = 'Use Mobile View'; - $lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.'; - $lang->autoinstall = 'EasyInstall'; - - $lang->last_week = 'Last week'; - $lang->this_week = 'This week'; -?> +admin_info = 'Administrador de Información'; + $lang->admin_index = 'Índice de la página admin'; + $lang->control_panel = 'Control panel'; + $lang->start_module = 'Módulo de inicio'; + $lang->about_start_module = 'Puede especificar el módulo de inicio por defecto.'; + + $lang->module_category_title = array( + 'service' => 'Service Setting', + 'member' => 'Member Setting', + 'content' => 'Content Setting', + 'statistics' => 'Statistics', + 'construction' => 'Construction', + 'utility' => 'Utility Setting', + 'interlock' => 'Interlock Setting', + 'accessory' => 'Accessories', + 'migration' => 'Data Migration', + 'system' => 'System Setting', + ); + + + $lang->newest_news = "Noticias recientes"; + + $lang->env_setup = "Configuración"; + $lang->default_url = "기본 URL"; + $lang->about_default_url = "XE sitio virtual (cafeXE, etc) tiene que introducir la URL base, al utilizar las capacidades de trabajo virtual y el tema de autenticación sayiteugan / módulos y las conexiones se realizan correctamente. (Ej: http:// dominio / ruta de instalación)"; + + $lang->env_information = "Información Ambiental"; + $lang->current_version = "Versión actual"; + $lang->current_path = "Instalado Sendero"; + $lang->released_version = "Versión más reciente"; + $lang->about_download_link = "La versión más reciente Zerboard XE está disponible.\nPara descargar la versión más reciente, haga clic en enlace de descarga."; + + $lang->item_module = "Lista de Módulos"; + $lang->item_addon = "Lista de Addons"; + $lang->item_widget = "Lista de Widgets"; + $lang->item_layout = "Liasta de Diseños"; + + $lang->module_name = "Nombre del Módulo"; + $lang->addon_name = "Nombre de Addon"; + $lang->version = "Versión"; + $lang->author = "Autor"; + $lang->table_count = "Número de los tableros"; + $lang->installed_path = "Ruta de instalación"; + + $lang->cmd_shortcut_management = "Editar el Menú"; + + $lang->msg_is_not_administrator = 'Sólo se permite el ingreso del administrador.'; + $lang->msg_manage_module_cannot_delete = 'No se puede eliminar acceso directo del Módulo, Addon, Diseño y Widget.'; + $lang->msg_default_act_is_null = 'No se puede registrar acceso directo por no estar determinada la acción del administrador predefinido.'; + + $lang->welcome_to_xe = 'Esta es la página del Administrador de XE'; + $lang->about_admin_page = "La página del Administrador aún está en desarrollo."; + $lang->about_lang_env = "Para aplicar idioma seleccionado conjunto de los usuarios, como por defecto, haga clic en el botón [Guardar] el cambio."; + + + $lang->xe_license = 'XE está bajo la Licencia de GPL'; + $lang->about_shortcut = 'Puede Eliminar los accesos directos de módulos, los cuales fueron registrados en la lista de módulos usados frecuentemente'; + + $lang->yesterday = "Yesterday"; + $lang->today = "Today"; + + $lang->cmd_lang_select = "Selección de Idioma"; + $lang->about_cmd_lang_select = "Seleccione el idioma es sólo el servicio"; + $lang->about_recompile_cache = "Inválido inútil archivo de caché puede organizar jyeotgeona"; + $lang->use_ssl = "Usar SSL"; + $lang->ssl_options = array( + 'none' => "Desactivar", + 'optional' => "Opcionalmente el", + 'always' => "Utilice siempre el" + ); + $lang->about_use_ssl = "Opcionalmente, la composición de suscripción / editar la información y el uso de SSL especificada en la acción es siempre el uso de SSL para todos los servicios que se utilizarán"; + $lang->server_ports = "Especifique el puerto del servidor"; + $lang->about_server_ports = "80 de HTTP, HTTPS al puerto 443 si se utiliza otro que se especifique lo contrario, el puerto va a necesitar."; + $lang->use_db_session = '인증 세션 DB 사용'; + $lang->about_db_session = '인증시 사용되는 PHP 세션을 DB로 사용하는 기능입니다.
웹서버의 사용율이 낮은 사이트에서는 비활성화시 사이트 응답 속도가 향상될 수 있습니다
단 현재 접속자를 구할 수 없어 관련된 기능을 사용할 수 없게 됩니다.'; + $lang->sftp = "Use SFTP"; + $lang->ftp_get_list = "Get List"; + $lang->ftp_remove_info = 'Remove FTP Info.'; + $lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.'; + $lang->msg_self_restart_cache_engine = 'Please restart Memcached or cache daemon.'; + $lang->mobile_view = 'Use Mobile View'; + $lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.'; + $lang->autoinstall = 'EasyInstall'; + + $lang->last_week = 'Last week'; + $lang->this_week = 'This week'; +?> diff --git a/modules/admin/lang/fr.lang.php b/modules/admin/lang/fr.lang.php index ce6840000..b4e151662 100644 --- a/modules/admin/lang/fr.lang.php +++ b/modules/admin/lang/fr.lang.php @@ -1,93 +1,93 @@ -admin_info = 'Informations d\'Administrateur'; - $lang->admin_index = 'Page de l\'indice pour l\'Administrateur'; - $lang->control_panel = 'Control panel'; - $lang->start_module = 'Start Module'; - $lang->about_start_module = 'Vous pouvez spécifier début module par défaut.'; - - $lang->module_category_title = array( - 'service' => 'Service Setting', - 'member' => 'Member Setting', - 'content' => 'Content Setting', - 'statistics' => 'Statistics', - 'construction' => 'Construction', - 'utility' => 'Utility Setting', - 'interlock' => 'Interlock Setting', - 'accessory' => 'Accessories', - 'migration' => 'Data Migration', - 'system' => 'System Setting', - ); - - $lang->newest_news = "Dernières Nouvelles"; - - $lang->env_setup = "Configuration"; - $lang->default_url = "기본 URL"; - $lang->about_default_url = "XE 가상 사이트(cafeXE등)의 기능을 사용할때 기본 URL을 입력해 주셔야 가상 사이트간 인증 연동이 되고 게시글/모듈등의 연결이 정상적으로 이루어집니다. (ex: http://도메인/설치경로)"; - - - $lang->env_information = "Informations de l'Environnement"; - $lang->current_version = "Version Courante"; - $lang->current_path = "Chemin Installé"; - $lang->released_version = "Dernière Version"; - $lang->about_download_link = "Nouvelle version est disponible.\nPour télécharger la dernière version, cliquez le lien."; - - $lang->item_module = "Liste des Modules"; - $lang->item_addon = "Liste des Compagnons"; - $lang->item_widget = "Liste des Gadgets"; - $lang->item_layout = "Liste des Mises en Pages"; - - $lang->module_name = "Nom de Module"; - $lang->addon_name = "Nom de Compagnon"; - $lang->version = "Version"; - $lang->author = "Auteur"; - $lang->table_count = "Somme de Tables"; - $lang->installed_path = "Chemin Installé"; - - $lang->cmd_shortcut_management = "Editer le Menu"; - - $lang->msg_is_not_administrator = 'Administrateur seulement'; - $lang->msg_manage_module_cannot_delete = 'On ne peut pas supprimer les raccourcis pour les modules, les compagnons, les mises en page ou les gadgets'; - $lang->msg_default_act_is_null = 'on ne peut pas enrégistrer les raccourcis parce que les Actions Par Défaut de l\'Administrateur ne sont pas établies'; - - $lang->welcome_to_xe = 'Bienvenue sur la Page d\'Administration du XE'; - $lang->about_admin_page = "La Page d\'Administration est encore en train de développer,\nNous allons ajouter des contenus essentiels par accepter beauoup de bons suggestions pendant Béta Proche."; - $lang->about_lang_env = "Vous pouvez fixer la Langue Par Défaut par cliquer le boutton [Conserver] au-dessous. Les visiteurs vont voir tous les menus et les messages en langue que vous choisissez."; - - $lang->xe_license = 'XE s\'applique la GPL'; - $lang->about_shortcut = 'Vous pouvez supprimer les raccourcis pour les modules qui sont enrgistrés sur le liste des modules qui sont utilisés fréquemment'; - - $lang->yesterday = "Yesterday"; - $lang->today = "Today"; - - $lang->cmd_lang_select = "langue"; - $lang->about_cmd_lang_select = "La langue choisie seulement sera servie"; - $lang->about_recompile_cache = "Vous pouvez arranger les fichiers inutils ou les fichiers invalides d'antémémoire"; - $lang->use_ssl = "Utiliser SSL"; - $lang->ssl_options = array( - 'none' => "Ne Pas utiliser", - 'optional' => "Optionnel", - 'always' => "Toujours" - ); - $lang->about_use_ssl = "Si l'on choisit 'Optionnel' , on utilise protocole SSL seulement dans quelques services comme inscription ou modification. Si l'on choisit 'Toujours', on utilise protocole SSL dans tous les services."; - $lang->server_ports = "déclarer le port de serveur"; - $lang->about_server_ports = "Si l'on ne veut pas utiliser le port 80 pour HTTP mais un autre port, ou bien, si l'on ne veut pas utiliser le port 443 pour HTTPS mais un autre port, on doit déclarer les ports."; - $lang->use_db_session = '인증 세션 DB 사용'; - $lang->about_db_session = '인증시 사용되는 PHP 세션을 DB로 사용하는 기능입니다.
웹서버의 사용율이 낮은 사이트에서는 비활성화시 사이트 응답 속도가 향상될 수 있습니다
단 현재 접속자를 구할 수 없어 관련된 기능을 사용할 수 없게 됩니다.'; - $lang->sftp = "Use SFTP"; - $lang->ftp_get_list = "Get List"; - $lang->ftp_remove_info = 'Remove FTP Info.'; - $lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.'; - $lang->msg_self_restart_cache_engine = 'Please restart Memcached or cache daemon.'; - $lang->mobile_view = 'Use Mobile View'; - $lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.'; - $lang->autoinstall = 'EasyInstall'; - - $lang->last_week = 'Last week'; - $lang->this_week = 'This week'; -?> +admin_info = 'Informations d\'Administrateur'; + $lang->admin_index = 'Page de l\'indice pour l\'Administrateur'; + $lang->control_panel = 'Control panel'; + $lang->start_module = 'Start Module'; + $lang->about_start_module = 'Vous pouvez spécifier début module par défaut.'; + + $lang->module_category_title = array( + 'service' => 'Service Setting', + 'member' => 'Member Setting', + 'content' => 'Content Setting', + 'statistics' => 'Statistics', + 'construction' => 'Construction', + 'utility' => 'Utility Setting', + 'interlock' => 'Interlock Setting', + 'accessory' => 'Accessories', + 'migration' => 'Data Migration', + 'system' => 'System Setting', + ); + + $lang->newest_news = "Dernières Nouvelles"; + + $lang->env_setup = "Configuration"; + $lang->default_url = "기본 URL"; + $lang->about_default_url = "XE 가상 사이트(cafeXE등)의 기능을 사용할때 기본 URL을 입력해 주셔야 가상 사이트간 인증 연동이 되고 게시글/모듈등의 연결이 정상적으로 이루어집니다. (ex: http://도메인/설치경로)"; + + + $lang->env_information = "Informations de l'Environnement"; + $lang->current_version = "Version Courante"; + $lang->current_path = "Chemin Installé"; + $lang->released_version = "Dernière Version"; + $lang->about_download_link = "Nouvelle version est disponible.\nPour télécharger la dernière version, cliquez le lien."; + + $lang->item_module = "Liste des Modules"; + $lang->item_addon = "Liste des Compagnons"; + $lang->item_widget = "Liste des Gadgets"; + $lang->item_layout = "Liste des Mises en Pages"; + + $lang->module_name = "Nom de Module"; + $lang->addon_name = "Nom de Compagnon"; + $lang->version = "Version"; + $lang->author = "Auteur"; + $lang->table_count = "Somme de Tables"; + $lang->installed_path = "Chemin Installé"; + + $lang->cmd_shortcut_management = "Editer le Menu"; + + $lang->msg_is_not_administrator = 'Administrateur seulement'; + $lang->msg_manage_module_cannot_delete = 'On ne peut pas supprimer les raccourcis pour les modules, les compagnons, les mises en page ou les gadgets'; + $lang->msg_default_act_is_null = 'on ne peut pas enrégistrer les raccourcis parce que les Actions Par Défaut de l\'Administrateur ne sont pas établies'; + + $lang->welcome_to_xe = 'Bienvenue sur la Page d\'Administration du XE'; + $lang->about_admin_page = "La Page d\'Administration est encore en train de développer,\nNous allons ajouter des contenus essentiels par accepter beauoup de bons suggestions pendant Béta Proche."; + $lang->about_lang_env = "Vous pouvez fixer la Langue Par Défaut par cliquer le boutton [Conserver] au-dessous. Les visiteurs vont voir tous les menus et les messages en langue que vous choisissez."; + + $lang->xe_license = 'XE s\'applique la GPL'; + $lang->about_shortcut = 'Vous pouvez supprimer les raccourcis pour les modules qui sont enrgistrés sur le liste des modules qui sont utilisés fréquemment'; + + $lang->yesterday = "Yesterday"; + $lang->today = "Today"; + + $lang->cmd_lang_select = "langue"; + $lang->about_cmd_lang_select = "La langue choisie seulement sera servie"; + $lang->about_recompile_cache = "Vous pouvez arranger les fichiers inutils ou les fichiers invalides d'antémémoire"; + $lang->use_ssl = "Utiliser SSL"; + $lang->ssl_options = array( + 'none' => "Ne Pas utiliser", + 'optional' => "Optionnel", + 'always' => "Toujours" + ); + $lang->about_use_ssl = "Si l'on choisit 'Optionnel' , on utilise protocole SSL seulement dans quelques services comme inscription ou modification. Si l'on choisit 'Toujours', on utilise protocole SSL dans tous les services."; + $lang->server_ports = "déclarer le port de serveur"; + $lang->about_server_ports = "Si l'on ne veut pas utiliser le port 80 pour HTTP mais un autre port, ou bien, si l'on ne veut pas utiliser le port 443 pour HTTPS mais un autre port, on doit déclarer les ports."; + $lang->use_db_session = '인증 세션 DB 사용'; + $lang->about_db_session = '인증시 사용되는 PHP 세션을 DB로 사용하는 기능입니다.
웹서버의 사용율이 낮은 사이트에서는 비활성화시 사이트 응답 속도가 향상될 수 있습니다
단 현재 접속자를 구할 수 없어 관련된 기능을 사용할 수 없게 됩니다.'; + $lang->sftp = "Use SFTP"; + $lang->ftp_get_list = "Get List"; + $lang->ftp_remove_info = 'Remove FTP Info.'; + $lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.'; + $lang->msg_self_restart_cache_engine = 'Please restart Memcached or cache daemon.'; + $lang->mobile_view = 'Use Mobile View'; + $lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.'; + $lang->autoinstall = 'EasyInstall'; + + $lang->last_week = 'Last week'; + $lang->this_week = 'This week'; +?> diff --git a/modules/admin/lang/jp.lang.php b/modules/admin/lang/jp.lang.php index e8faa66fe..aa1c8a744 100644 --- a/modules/admin/lang/jp.lang.php +++ b/modules/admin/lang/jp.lang.php @@ -1,93 +1,93 @@ -admin_info = '管理者情報'; - $lang->admin_index = '管理者トップページ'; - $lang->control_panel = 'コントロールパネル'; - $lang->start_module = '初期起動モジュール'; - $lang->about_start_module = 'デフォルトで起動するモジュールを指定することができます。'; - - $lang->module_category_title = array( - 'service' => 'サービス管理', - 'member' => '会員管理', - 'content' => 'コンテンツ管理', - 'statistics' => '統計確認', - 'construction' => 'サイト設定', - 'utility' => '機能設定', - 'interlock' => '連動設定', - 'accessory' => '付加機能設定', - 'migration' => 'データ管理/復元', - 'system' => 'システム管理', - ); - - $lang->newest_news = '最新ニュース'; - - $lang->env_setup = '環境設定'; - $lang->default_url = '基本URL'; - $lang->about_default_url = '複数のバーチャル(Virtual)サイトを運営する場合、どちらからログインしてもバーチャル(Virtual)サイトの間でログイン情報を維持出来るようにするためには、基本になるサイトでのXEをインストールしたurlを登録して下さい。 (例: http://ドメイン/インストールパス)'; - - - $lang->env_information = '環境情報'; - $lang->current_version = 'インストール済みバージョン'; - $lang->current_path = 'インストールパス'; - $lang->released_version = '最新バージョン'; - $lang->about_download_link = "新しいバージョンが配布されています。\n「ダウンロード」リンクをクリックするとダウンロード出来ます。"; - - $lang->item_module = 'モジュールリスト'; - $lang->item_addon = 'アドオンリスト'; - $lang->item_widget = 'ウィジェットリスト'; - $lang->item_layout = 'レイアウトリスト'; - - $lang->module_name = 'モジュール名'; - $lang->addon_name = 'アドオン名'; - $lang->version = 'バージョン'; - $lang->author = '制作者'; - $lang->table_count = 'テーブル数'; - $lang->installed_path = 'インストールパス'; - - $lang->cmd_shortcut_management = 'メニューの編集'; - - $lang->msg_is_not_administrator = '管理者のみアクセス出来ます'; - $lang->msg_manage_module_cannot_delete = 'モジュール、アドオン、ウィジェットのショットカットは削除出来ません。'; - $lang->msg_default_act_is_null = 'デフォルトの管理者のアクションが指定されていないため、ショットカットを登録することが出来ません。'; - - $lang->welcome_to_xe = 'XEの管理者ページです。'; - $lang->about_lang_env = '初めてサイトに訪問したユーザーに対し、上記の選択した言語でサイトを表示させるためには、必ず下記の「保存」ボタンをクリックして適用して下さい。'; - - $lang->xe_license = 'XEのライセンスはGPLです。'; - $lang->about_shortcut = 'よく使用するモジュールに登録されたショートカットは削除出来ます。'; - - $lang->yesterday = '昨日'; - $lang->today = '今日'; - - $lang->cmd_lang_select = '言語選択'; - $lang->about_cmd_lang_select = '選択した言語だけでサービスを行います。'; - $lang->about_recompile_cache = '要らないかごみのキャッシューファイルを整理します。'; - $lang->use_ssl = 'SSL環境設定'; - $lang->ssl_options = array( - 'none' => '使わない', - 'optional' => '部分的に使う', - 'always' => '常に使う' - ); - $lang->about_use_ssl = '「部分的に使う場合」は「会員登録/会員情報変更」など特定のactionでSSLを利用する場合、「常に使う」は全てのサービスがSSLを使う場合に選択します。'; - $lang->server_ports = 'サーバーポート指定'; - $lang->about_server_ports = '一般的に使われているHTTPの80、HTTPSの443以外の他のポートを使うために、ポートを指定して下さい。'; - $lang->use_db_session = 'DBで認証セッション管理'; - $lang->about_db_session = '認証の時に使われるPHPセッションをDBで使う機能です。
ウェブサーバーの負荷が低いサイトではこの機能をオフにすることでむしろサイトのレスポンスが向上されることもあります。
また、この機能をオンにすると、「現在ログイン中の会員」の機能が不可になります。'; - $lang->sftp = "SFTP使用"; - $lang->ftp_get_list = "ディレクトリ目録要請"; - $lang->ftp_remove_info = 'FTP情報削除'; - $lang->msg_ftp_invalid_path = '指定されたFTPパスへのアクセスに失敗しました。'; - $lang->msg_self_restart_cache_engine = 'メムキャッシュドまたはキャッシュデーモンを再起動して下さい。'; - $lang->mobile_view = 'モバイルスキン使用'; - $lang->about_mobile_view = 'スマート携帯などを通じてサイトに接続した場合、モバイル画面に最適化されたレイアウトを使用するように設定します。'; - - $lang->autoinstall = 'イージーインストール'; - - $lang->last_week = '先週'; - $lang->this_week = '今週'; -?> +admin_info = '管理者情報'; + $lang->admin_index = '管理者トップページ'; + $lang->control_panel = 'コントロールパネル'; + $lang->start_module = '初期起動モジュール'; + $lang->about_start_module = 'デフォルトで起動するモジュールを指定することができます。'; + + $lang->module_category_title = array( + 'service' => 'サービス管理', + 'member' => '会員管理', + 'content' => 'コンテンツ管理', + 'statistics' => '統計確認', + 'construction' => 'サイト設定', + 'utility' => '機能設定', + 'interlock' => '連動設定', + 'accessory' => '付加機能設定', + 'migration' => 'データ管理/復元', + 'system' => 'システム管理', + ); + + $lang->newest_news = '最新ニュース'; + + $lang->env_setup = '環境設定'; + $lang->default_url = '基本URL'; + $lang->about_default_url = '複数のバーチャル(Virtual)サイトを運営する場合、どちらからログインしてもバーチャル(Virtual)サイトの間でログイン情報を維持出来るようにするためには、基本になるサイトでのXEをインストールしたurlを登録して下さい。 (例: http://ドメイン/インストールパス)'; + + + $lang->env_information = '環境情報'; + $lang->current_version = 'インストール済みバージョン'; + $lang->current_path = 'インストールパス'; + $lang->released_version = '最新バージョン'; + $lang->about_download_link = "新しいバージョンが配布されています。\n「ダウンロード」リンクをクリックするとダウンロード出来ます。"; + + $lang->item_module = 'モジュールリスト'; + $lang->item_addon = 'アドオンリスト'; + $lang->item_widget = 'ウィジェットリスト'; + $lang->item_layout = 'レイアウトリスト'; + + $lang->module_name = 'モジュール名'; + $lang->addon_name = 'アドオン名'; + $lang->version = 'バージョン'; + $lang->author = '制作者'; + $lang->table_count = 'テーブル数'; + $lang->installed_path = 'インストールパス'; + + $lang->cmd_shortcut_management = 'メニューの編集'; + + $lang->msg_is_not_administrator = '管理者のみアクセス出来ます'; + $lang->msg_manage_module_cannot_delete = 'モジュール、アドオン、ウィジェットのショットカットは削除出来ません。'; + $lang->msg_default_act_is_null = 'デフォルトの管理者のアクションが指定されていないため、ショットカットを登録することが出来ません。'; + + $lang->welcome_to_xe = 'XEの管理者ページです。'; + $lang->about_lang_env = '初めてサイトに訪問したユーザーに対し、上記の選択した言語でサイトを表示させるためには、必ず下記の「保存」ボタンをクリックして適用して下さい。'; + + $lang->xe_license = 'XEのライセンスはGPLです。'; + $lang->about_shortcut = 'よく使用するモジュールに登録されたショートカットは削除出来ます。'; + + $lang->yesterday = '昨日'; + $lang->today = '今日'; + + $lang->cmd_lang_select = '言語選択'; + $lang->about_cmd_lang_select = '選択した言語だけでサービスを行います。'; + $lang->about_recompile_cache = '要らないかごみのキャッシューファイルを整理します。'; + $lang->use_ssl = 'SSL環境設定'; + $lang->ssl_options = array( + 'none' => '使わない', + 'optional' => '部分的に使う', + 'always' => '常に使う' + ); + $lang->about_use_ssl = '「部分的に使う場合」は「会員登録/会員情報変更」など特定のactionでSSLを利用する場合、「常に使う」は全てのサービスがSSLを使う場合に選択します。'; + $lang->server_ports = 'サーバーポート指定'; + $lang->about_server_ports = '一般的に使われているHTTPの80、HTTPSの443以外の他のポートを使うために、ポートを指定して下さい。'; + $lang->use_db_session = 'DBで認証セッション管理'; + $lang->about_db_session = '認証の時に使われるPHPセッションをDBで使う機能です。
ウェブサーバーの負荷が低いサイトではこの機能をオフにすることでむしろサイトのレスポンスが向上されることもあります。
また、この機能をオンにすると、「現在ログイン中の会員」の機能が不可になります。'; + $lang->sftp = "SFTP使用"; + $lang->ftp_get_list = "ディレクトリ目録要請"; + $lang->ftp_remove_info = 'FTP情報削除'; + $lang->msg_ftp_invalid_path = '指定されたFTPパスへのアクセスに失敗しました。'; + $lang->msg_self_restart_cache_engine = 'メムキャッシュドまたはキャッシュデーモンを再起動して下さい。'; + $lang->mobile_view = 'モバイルスキン使用'; + $lang->about_mobile_view = 'スマート携帯などを通じてサイトに接続した場合、モバイル画面に最適化されたレイアウトを使用するように設定します。'; + + $lang->autoinstall = 'イージーインストール'; + + $lang->last_week = '先週'; + $lang->this_week = '今週'; +?> diff --git a/modules/admin/lang/ko.lang.php b/modules/admin/lang/ko.lang.php index 04109ef36..46a2532f2 100644 --- a/modules/admin/lang/ko.lang.php +++ b/modules/admin/lang/ko.lang.php @@ -1,93 +1,93 @@ -admin_info = '관리자 정보'; - $lang->admin_index = '관리자 초기 페이지'; - $lang->control_panel = '제어판'; - $lang->start_module = '시작 모듈'; - $lang->about_start_module = '사이트 접속 시 기본으로 호출될 모듈을 지정할 수 있습니다.'; - - $lang->module_category_title = array( - 'service' => '서비스 관리', - 'member' => '회원 관리', - 'content' => '정보 관리', - 'statistics' => '통계 열람', - 'construction' => '사이트 설정', - 'utility' => '기능 설정', - 'interlock' => '연동 설정', - 'accessory' => '부가 기능 설정', - 'migration' => '데이터 관리/복원', - 'system' => '시스템 관리', - ); - - $lang->newest_news = '최신 소식'; - - $lang->env_setup = '환경 설정'; - $lang->default_url = '기본 URL'; - $lang->about_default_url = 'XE 가상 사이트(cafeXE 등)의 기능을 사용할 때 기본 URL을 입력하셔야 가상 사이트간 인증 연동이 되고 게시글, 모듈 등의 연결이 정상적으로 이루어집니다. (예: http://도메인/설치경로)'; - - - $lang->env_information = '환경 정보'; - $lang->current_version = '설치된 버전'; - $lang->current_path = '설치된 경로'; - $lang->released_version = '최신 버전'; - $lang->about_download_link = "최신 버전이 배포되었습니다.\ndownload 링크를 클릭하시면 다운 받으실 수 있습니다."; - - $lang->item_module = '모듈 목록'; - $lang->item_addon = '애드온 목록'; - $lang->item_widget = '위젯 목록'; - $lang->item_layout = '레이아웃 목록'; - - $lang->module_name = '모듈 이름'; - $lang->addon_name = '애드온 이름'; - $lang->version = '버전'; - $lang->author = '제작자'; - $lang->table_count = '테이블 수'; - $lang->installed_path = '설치 경로'; - - $lang->cmd_shortcut_management = '메뉴 편집하기'; - - $lang->msg_is_not_administrator = '관리자만 접속이 가능합니다.'; - $lang->msg_manage_module_cannot_delete = '모듈, 애드온, 레이아웃, 위젯 모듈의 바로가기는 삭제 불가능합니다.'; - $lang->msg_default_act_is_null = '기본 관리자 Action이 지정되어 있지 않아 바로가기 등록을 할 수 없습니다.'; - - $lang->welcome_to_xe = 'XE 관리자'; - $lang->about_lang_env = '처음 방문하는 사용자들의 언어 설정을 동일하게 하려면, 원하는 언어로 변경 후 아래 [저장] 버튼을 클릭하시면 됩니다.'; - - $lang->xe_license = 'XE는 GPL을 따릅니다.'; - $lang->about_shortcut = '자주 사용하는 모듈에 등록된 모듈의 바로가기를 삭제할 수 있습니다.'; - - $lang->yesterday = '어제'; - $lang->today = '오늘'; - - $lang->cmd_lang_select = '언어선택'; - $lang->about_cmd_lang_select = '선택된 언어들만 서비스 됩니다.'; - $lang->about_recompile_cache = '쓸모 없어졌거나 잘못된 캐시파일들을 정리할 수 있습니다.'; - $lang->use_ssl = 'SSL 사용'; - $lang->ssl_options = array( - 'none' => '사용 안함', - 'optional' => '선택적으로', - 'always' => '항상 사용' - ); - $lang->about_use_ssl = '\'선택적으로\'는 회원가입, 정보수정 등의 지정된 action에서 SSL을 사용하고 \'항상 사용\'은 모든 서비스에 SSL을 사용 합니다.'; - $lang->server_ports = '서버포트지정'; - $lang->about_server_ports = 'HTTP는 80, HTTPS는 443 이 아닌, 다른 포트를 사용할 경우에 포트를 지정해 주어야 합니다.'; - $lang->use_db_session = '인증 세션 DB 사용'; - $lang->about_db_session = '인증 시 사용되는 PHP 세션을 DB로 사용하는 기능입니다.
웹서버의 사용률이 낮은 사이트에서는 비활성화시 사이트 응답 속도가 향상될 수 있습니다.
단 현재 접속자를 구할 수 없어 관련된 기능을 사용할 수 없게 됩니다.'; - $lang->sftp = 'SFTP 사용'; - $lang->ftp_get_list = '목록 가져오기'; - $lang->ftp_remove_info = 'FTP 정보 삭제'; - $lang->msg_ftp_invalid_path = 'FTP Path를 읽을 수 없습니다.'; - $lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.'; - $lang->mobile_view = '모바일 뷰 사용'; - $lang->about_mobile_view = '스마트폰 등을 이용하여 접속할 때 모바일 화면에 최적화된 레이아웃을 이용하도록 합니다.'; - - $lang->autoinstall = '쉬운 설치'; - - $lang->last_week = '지난 주'; - $lang->this_week = '이번 주'; -?> +admin_info = '관리자 정보'; + $lang->admin_index = '관리자 초기 페이지'; + $lang->control_panel = '제어판'; + $lang->start_module = '시작 모듈'; + $lang->about_start_module = '사이트 접속 시 기본으로 호출될 모듈을 지정할 수 있습니다.'; + + $lang->module_category_title = array( + 'service' => '서비스 관리', + 'member' => '회원 관리', + 'content' => '정보 관리', + 'statistics' => '통계 열람', + 'construction' => '사이트 설정', + 'utility' => '기능 설정', + 'interlock' => '연동 설정', + 'accessory' => '부가 기능 설정', + 'migration' => '데이터 관리/복원', + 'system' => '시스템 관리', + ); + + $lang->newest_news = '최신 소식'; + + $lang->env_setup = '환경 설정'; + $lang->default_url = '기본 URL'; + $lang->about_default_url = 'XE 가상 사이트(cafeXE 등)의 기능을 사용할 때 기본 URL을 입력하셔야 가상 사이트간 인증 연동이 되고 게시글, 모듈 등의 연결이 정상적으로 이루어집니다. (예: http://도메인/설치경로)'; + + + $lang->env_information = '환경 정보'; + $lang->current_version = '설치된 버전'; + $lang->current_path = '설치된 경로'; + $lang->released_version = '최신 버전'; + $lang->about_download_link = "최신 버전이 배포되었습니다.\ndownload 링크를 클릭하시면 다운 받으실 수 있습니다."; + + $lang->item_module = '모듈 목록'; + $lang->item_addon = '애드온 목록'; + $lang->item_widget = '위젯 목록'; + $lang->item_layout = '레이아웃 목록'; + + $lang->module_name = '모듈 이름'; + $lang->addon_name = '애드온 이름'; + $lang->version = '버전'; + $lang->author = '제작자'; + $lang->table_count = '테이블 수'; + $lang->installed_path = '설치 경로'; + + $lang->cmd_shortcut_management = '메뉴 편집하기'; + + $lang->msg_is_not_administrator = '관리자만 접속이 가능합니다.'; + $lang->msg_manage_module_cannot_delete = '모듈, 애드온, 레이아웃, 위젯 모듈의 바로가기는 삭제 불가능합니다.'; + $lang->msg_default_act_is_null = '기본 관리자 Action이 지정되어 있지 않아 바로가기 등록을 할 수 없습니다.'; + + $lang->welcome_to_xe = 'XE 관리자'; + $lang->about_lang_env = '처음 방문하는 사용자들의 언어 설정을 동일하게 하려면, 원하는 언어로 변경 후 아래 [저장] 버튼을 클릭하시면 됩니다.'; + + $lang->xe_license = 'XE는 GPL을 따릅니다.'; + $lang->about_shortcut = '자주 사용하는 모듈에 등록된 모듈의 바로가기를 삭제할 수 있습니다.'; + + $lang->yesterday = '어제'; + $lang->today = '오늘'; + + $lang->cmd_lang_select = '언어선택'; + $lang->about_cmd_lang_select = '선택된 언어들만 서비스 됩니다.'; + $lang->about_recompile_cache = '쓸모 없어졌거나 잘못된 캐시파일들을 정리할 수 있습니다.'; + $lang->use_ssl = 'SSL 사용'; + $lang->ssl_options = array( + 'none' => '사용 안함', + 'optional' => '선택적으로', + 'always' => '항상 사용' + ); + $lang->about_use_ssl = '\'선택적으로\'는 회원가입, 정보수정 등의 지정된 action에서 SSL을 사용하고 \'항상 사용\'은 모든 서비스에 SSL을 사용 합니다.'; + $lang->server_ports = '서버포트지정'; + $lang->about_server_ports = 'HTTP는 80, HTTPS는 443 이 아닌, 다른 포트를 사용할 경우에 포트를 지정해 주어야 합니다.'; + $lang->use_db_session = '인증 세션 DB 사용'; + $lang->about_db_session = '인증 시 사용되는 PHP 세션을 DB로 사용하는 기능입니다.
웹서버의 사용률이 낮은 사이트에서는 비활성화시 사이트 응답 속도가 향상될 수 있습니다.
단 현재 접속자를 구할 수 없어 관련된 기능을 사용할 수 없게 됩니다.'; + $lang->sftp = 'SFTP 사용'; + $lang->ftp_get_list = '목록 가져오기'; + $lang->ftp_remove_info = 'FTP 정보 삭제'; + $lang->msg_ftp_invalid_path = 'FTP Path를 읽을 수 없습니다.'; + $lang->msg_self_restart_cache_engine = 'Memcached 또는 캐쉬데몬을 재시작 해주세요.'; + $lang->mobile_view = '모바일 뷰 사용'; + $lang->about_mobile_view = '스마트폰 등을 이용하여 접속할 때 모바일 화면에 최적화된 레이아웃을 이용하도록 합니다.'; + + $lang->autoinstall = '쉬운 설치'; + + $lang->last_week = '지난 주'; + $lang->this_week = '이번 주'; +?> diff --git a/modules/admin/lang/ru.lang.php b/modules/admin/lang/ru.lang.php index 32d906621..bf250781e 100644 --- a/modules/admin/lang/ru.lang.php +++ b/modules/admin/lang/ru.lang.php @@ -1,91 +1,91 @@ -admin_info = 'Информация администратора'; - $lang->admin_index = 'Индексная страница администратора'; - $lang->control_panel = 'Контрольная панель'; - $lang->start_module = 'Стартовый модуль'; - $lang->about_start_module = 'Вы можете указать модуль запуска по умолчанию.'; - - $lang->module_category_title = array( - 'service' => 'Service Setting', - 'member' => 'Member Setting', - 'content' => 'Content Setting', - 'statistics' => 'Statistics', - 'construction' => 'Construction', - 'utility' => 'Utility Setting', - 'interlock' => 'Interlock Setting', - 'accessory' => 'Accessories', - 'migration' => 'Data Migration', - 'system' => 'System Setting', - ); - - $lang->newest_news = 'Последние новости'; - - $lang->env_setup = 'Настройка'; - $lang->default_url = 'Основной URL'; - $lang->about_default_url = 'If you use a virtual site feature (e.g., cafeXE), input default URL (parent-sites address), then SSO would be enabled, thus connection to documents/modules works properly'; - - $lang->env_information = 'Информация окружения'; - $lang->current_version = 'Текущая версия'; - $lang->current_path = 'Текущий путь'; - $lang->released_version = 'Последняя версия'; - $lang->about_download_link = 'Новая версия XE доступна.\nЧтобы скачать последнюю версию, нажмите ссылку закачки'; - - $lang->item_module = 'Список модулей'; - $lang->item_addon = 'Список аддонов'; - $lang->item_widget = 'Список виджетов'; - $lang->item_layout = 'Список лейаутов'; - - $lang->module_name = 'Имя модуля'; - $lang->addon_name = 'Имя аддона'; - $lang->version = 'Версия'; - $lang->author = 'Разработчик'; - $lang->table_count = 'Номер таблицы'; - $lang->installed_path = 'Путь установки'; - - $lang->cmd_shortcut_management = 'Редактировать меню'; - - $lang->msg_is_not_administrator = 'Только для администраторов!'; - $lang->msg_manage_module_cannot_delete = 'Ярлыки модулей, аддонов, лейаутов, виджетов не могут быть удалены'; - $lang->msg_default_act_is_null = 'Ярлык не может быть зарегистрирован, поскольку стандартное административное действие не установлено'; - - $lang->welcome_to_xe = 'Добро пожаловать на страницу администратора XE'; - $lang->about_lang_env = 'Чтобы применить выбранный язык для пользователей как страндартный, нажмите кнопку Сохранить [Save] после изменения'; - - $lang->xe_license = 'XE подчиняется Стандартной Общественной Лицензии GPL'; - $lang->about_shortcut = 'Вы можете удалить ярлыки модулей, зарегистрированных в списке часто используемых модулей'; - - $lang->yesterday = 'Вчера'; - $lang->today = 'Сегодня'; - - $lang->cmd_lang_select = 'Выбор языка'; - $lang->about_cmd_lang_select = 'Возможно использование только выбранных языков'; - $lang->about_recompile_cache = 'You can delete useless or invalid cache files'; - $lang->use_ssl = 'Использовать SSL'; - $lang->ssl_options = array( - 'none' => 'Никогда', - 'optional' => 'На выбор', - 'always' => 'Всегда' - ); - $lang->about_use_ssl = 'In case of "Optional", SSL will be used for actions such as signing up / changing information. And for "Always", your site will be served only via https'; - $lang->server_ports = 'Server Port'; - $lang->about_server_ports = 'If your web server does not use 80 for HTTP or 443 for HTTPS port, you should specify server ports'; - $lang->use_db_session = 'Use Session DB'; - $lang->about_db_session = 'It will use php session with DB when authenticating.
Websites with infrequent usage of web server may expect faster response when this function is disabled.
However session DB will make it unable to get current users, so you cannot use related functions'; - $lang->sftp = 'Use SFTP'; - $lang->ftp_get_list = 'Get List'; - $lang->ftp_remove_info = 'Remove FTP Info'; - $lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.'; - $lang->msg_self_restart_cache_engine = 'Please restart Memcached or cache daemon.'; - $lang->mobile_view = 'Use Mobile View'; - $lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.'; - $lang->autoinstall = 'EasyInstall'; - - $lang->last_week = 'Last week'; - $lang->this_week = 'This week'; -?> +admin_info = 'Информация администратора'; + $lang->admin_index = 'Индексная страница администратора'; + $lang->control_panel = 'Контрольная панель'; + $lang->start_module = 'Стартовый модуль'; + $lang->about_start_module = 'Вы можете указать модуль запуска по умолчанию.'; + + $lang->module_category_title = array( + 'service' => 'Service Setting', + 'member' => 'Member Setting', + 'content' => 'Content Setting', + 'statistics' => 'Statistics', + 'construction' => 'Construction', + 'utility' => 'Utility Setting', + 'interlock' => 'Interlock Setting', + 'accessory' => 'Accessories', + 'migration' => 'Data Migration', + 'system' => 'System Setting', + ); + + $lang->newest_news = 'Последние новости'; + + $lang->env_setup = 'Настройка'; + $lang->default_url = 'Основной URL'; + $lang->about_default_url = 'If you use a virtual site feature (e.g., cafeXE), input default URL (parent-sites address), then SSO would be enabled, thus connection to documents/modules works properly'; + + $lang->env_information = 'Информация окружения'; + $lang->current_version = 'Текущая версия'; + $lang->current_path = 'Текущий путь'; + $lang->released_version = 'Последняя версия'; + $lang->about_download_link = 'Новая версия XE доступна.\nЧтобы скачать последнюю версию, нажмите ссылку закачки'; + + $lang->item_module = 'Список модулей'; + $lang->item_addon = 'Список аддонов'; + $lang->item_widget = 'Список виджетов'; + $lang->item_layout = 'Список лейаутов'; + + $lang->module_name = 'Имя модуля'; + $lang->addon_name = 'Имя аддона'; + $lang->version = 'Версия'; + $lang->author = 'Разработчик'; + $lang->table_count = 'Номер таблицы'; + $lang->installed_path = 'Путь установки'; + + $lang->cmd_shortcut_management = 'Редактировать меню'; + + $lang->msg_is_not_administrator = 'Только для администраторов!'; + $lang->msg_manage_module_cannot_delete = 'Ярлыки модулей, аддонов, лейаутов, виджетов не могут быть удалены'; + $lang->msg_default_act_is_null = 'Ярлык не может быть зарегистрирован, поскольку стандартное административное действие не установлено'; + + $lang->welcome_to_xe = 'Добро пожаловать на страницу администратора XE'; + $lang->about_lang_env = 'Чтобы применить выбранный язык для пользователей как страндартный, нажмите кнопку Сохранить [Save] после изменения'; + + $lang->xe_license = 'XE подчиняется Стандартной Общественной Лицензии GPL'; + $lang->about_shortcut = 'Вы можете удалить ярлыки модулей, зарегистрированных в списке часто используемых модулей'; + + $lang->yesterday = 'Вчера'; + $lang->today = 'Сегодня'; + + $lang->cmd_lang_select = 'Выбор языка'; + $lang->about_cmd_lang_select = 'Возможно использование только выбранных языков'; + $lang->about_recompile_cache = 'You can delete useless or invalid cache files'; + $lang->use_ssl = 'Использовать SSL'; + $lang->ssl_options = array( + 'none' => 'Никогда', + 'optional' => 'На выбор', + 'always' => 'Всегда' + ); + $lang->about_use_ssl = 'In case of "Optional", SSL will be used for actions such as signing up / changing information. And for "Always", your site will be served only via https'; + $lang->server_ports = 'Server Port'; + $lang->about_server_ports = 'If your web server does not use 80 for HTTP or 443 for HTTPS port, you should specify server ports'; + $lang->use_db_session = 'Use Session DB'; + $lang->about_db_session = 'It will use php session with DB when authenticating.
Websites with infrequent usage of web server may expect faster response when this function is disabled.
However session DB will make it unable to get current users, so you cannot use related functions'; + $lang->sftp = 'Use SFTP'; + $lang->ftp_get_list = 'Get List'; + $lang->ftp_remove_info = 'Remove FTP Info'; + $lang->msg_ftp_invalid_path = 'Failed to read the specified FTP Path.'; + $lang->msg_self_restart_cache_engine = 'Please restart Memcached or cache daemon.'; + $lang->mobile_view = 'Use Mobile View'; + $lang->about_mobile_view = 'If accessing with a smartphone, display content with mobile layout.'; + $lang->autoinstall = 'EasyInstall'; + + $lang->last_week = 'Last week'; + $lang->this_week = 'This week'; +?> diff --git a/modules/admin/lang/tr.lang.php b/modules/admin/lang/tr.lang.php index 5a887d3b5..c7f5e81a3 100644 --- a/modules/admin/lang/tr.lang.php +++ b/modules/admin/lang/tr.lang.php @@ -1,92 +1,92 @@ -admin_info = 'Yönetici Bilgisi'; - $lang->admin_index = 'Indeks Yönetici Sayfası'; - $lang->control_panel = 'Dashboard'; - $lang->start_module = 'Varsayılan Modül'; - $lang->about_start_module = 'Sitenin varsayılan modülünü belirleyebilirsiniz.'; - - $lang->module_category_title = array( - 'service' => 'Hizmetler', - 'member' => 'Yöneticiler', - 'content' => 'İçerikler', - 'statistics' => 'İstatistikler', - 'construction' => 'Yapı', - 'utility' => 'Yardımcı Uygulamalar', - 'interlock' => 'Gömülü', - 'accessory' => 'Donatılar', - 'migration' => 'Veri Geçişi', - 'system' => 'Sistem Ayarları', - ); - - $lang->newest_news = "Son Gelişmeler"; - - $lang->env_setup = "Ayarlar"; - $lang->default_url = "Varsayılan URL"; - $lang->about_default_url = "Eğer sanal site özelliği kullanıyorsanız (örneğin, cafeXE), varsayılan URL girdisini yapınız (üst-sitenin adresi), SSO etkinleştirilecektir, böylece belgelere/modüllere sağlanan bağlantı uygun bir şekilde çalışacaktır. "; - - $lang->env_information = "Ortam Bilgisi"; - $lang->current_version = "Güncel Sürüm"; - $lang->current_path = "Yükleme Yolu"; - $lang->released_version = "Son Sürüm"; - $lang->about_download_link = "Zeroboard XE'nin yeni sürümü yayımlandı!\nLütfen son sürümü için indirme linkine tıklayınız."; - - $lang->item_module = "Modül Listesi"; - $lang->item_addon = "Eklenti Listesi"; - $lang->item_widget = "Widget Listesi"; - $lang->item_layout = "Yerleşim Düzeni Listesi"; - - $lang->module_name = "Modül İsmi"; - $lang->addon_name = "Eklenti İsmi"; - $lang->version = "Sürüm"; - $lang->author = "Geliştirici"; - $lang->table_count = "Tablo Numarası"; - $lang->installed_path = "Yükleme Yolu"; - - $lang->cmd_shortcut_management = "Menü Düzenle"; - - $lang->msg_is_not_administrator = 'Sadece Yöneticiler'; - $lang->msg_manage_module_cannot_delete = 'Modüllerin, eklentilerin, yerleşim düzenlerinin, widgetların kısayolları silinemez.'; - $lang->msg_default_act_is_null = 'Kısayol varsayılan yönetici eylemi ayarlanmadığından kayıt edilemiyor.'; - - $lang->welcome_to_xe = 'XE Yönetici Sayfasına Hoşgeldiniz'; - $lang->about_admin_page = "Yönetici sayfası hâla geliştirilmektedir,\nClosebeta sürecinde birçok iyi öneriyi kabul ederek gerekli içerikleri ekleyeceğiz."; - $lang->about_lang_env = "Seçilen dili varsayılan dil olarak uygulamak için, lütfen Kaydet tuşuna basınız."; - - $lang->xe_license = 'XE GPL ile uyumludur'; - $lang->about_shortcut = 'Sık kullanılan modüller listesine kaydedilmiş modüllerin kısayollarını silebilirsiniz.'; - - $lang->yesterday = "Dün"; - $lang->today = "Bugün"; - - $lang->cmd_lang_select = "Dil"; - $lang->about_cmd_lang_select = "Sadece seçili dillerde hizmet verecektir."; - $lang->about_recompile_cache = "Gereksiz veya geçersiz önbellek dosyalarını silebilirsiniz."; - $lang->use_ssl = "SSL Kullan"; - $lang->ssl_options = array( - 'none' => "Hiçbir zaman", - 'optional' => "İsteğe Bağlı", - 'always' => "Her zaman" - ); - $lang->about_use_ssl = "'İsteği Bağlı' seçiminde; SSL, kayıt olma/bilgi değiştirme gibi eylemler için kullanılacaktır. 'Her zaman' seçiminde, siteniz sadece http yoluyla hizmet verecektir."; - $lang->server_ports = "Sunucu Bağlantı Noktası (port)"; - $lang->about_server_ports = "Eğer web sunucunuz, HTTP bağlantı noktaları için 80 ya da HTTPS 443 portunu kullanmıyorsa, sunucu bağlantı noktalarını belirtmeniz gerekmektedir."; - $lang->use_db_session = 'Oturum Veritabanı Kullanımı'; - $lang->about_db_session = 'Yetersiz web sunucusu kullanımı olan websiteleri için, bu özellik devredışı bırakıldığı zaman daha hızlı bir tepki beklenebilir.
Ancak oturum veritabanı, mevcut kullanıcılar için veritabanını erişilemez hâle getirecektir ve ilgili işler kullanılamaz hale gelecektir.'; - $lang->sftp = "SFTP Kullan"; - $lang->ftp_get_list = "Listeyi Al"; - $lang->ftp_remove_info = 'FTP Bilgisini Sil.'; - $lang->msg_ftp_invalid_path = 'Belirtilen FTP Yolunu okuma işlemi başarız oldu.'; - $lang->msg_self_restart_cache_engine = 'Lütfen önbellek geri plan yordamını veya Memcached\' ı yeniden başlatınız.'; - $lang->mobile_view = 'Hareketli Görünümü'; - $lang->about_mobile_view = 'Hareketli görünümü, mobil cihazlarla giriş yapılırken, mobil cihazlara uygun en iyi yerleşim düzenini göstermek içindir.'; - $lang->autoinstall = 'KolayKurulum'; - - $lang->last_week = 'Geçen Hafta'; - $lang->this_week = 'Bu Hafta'; -?> +admin_info = 'Yönetici Bilgisi'; + $lang->admin_index = 'Indeks Yönetici Sayfası'; + $lang->control_panel = 'Dashboard'; + $lang->start_module = 'Varsayılan Modül'; + $lang->about_start_module = 'Sitenin varsayılan modülünü belirleyebilirsiniz.'; + + $lang->module_category_title = array( + 'service' => 'Hizmetler', + 'member' => 'Yöneticiler', + 'content' => 'İçerikler', + 'statistics' => 'İstatistikler', + 'construction' => 'Yapı', + 'utility' => 'Yardımcı Uygulamalar', + 'interlock' => 'Gömülü', + 'accessory' => 'Donatılar', + 'migration' => 'Veri Geçişi', + 'system' => 'Sistem Ayarları', + ); + + $lang->newest_news = "Son Gelişmeler"; + + $lang->env_setup = "Ayarlar"; + $lang->default_url = "Varsayılan URL"; + $lang->about_default_url = "Eğer sanal site özelliği kullanıyorsanız (örneğin, cafeXE), varsayılan URL girdisini yapınız (üst-sitenin adresi), SSO etkinleştirilecektir, böylece belgelere/modüllere sağlanan bağlantı uygun bir şekilde çalışacaktır. "; + + $lang->env_information = "Ortam Bilgisi"; + $lang->current_version = "Güncel Sürüm"; + $lang->current_path = "Yükleme Yolu"; + $lang->released_version = "Son Sürüm"; + $lang->about_download_link = "Zeroboard XE'nin yeni sürümü yayımlandı!\nLütfen son sürümü için indirme linkine tıklayınız."; + + $lang->item_module = "Modül Listesi"; + $lang->item_addon = "Eklenti Listesi"; + $lang->item_widget = "Widget Listesi"; + $lang->item_layout = "Yerleşim Düzeni Listesi"; + + $lang->module_name = "Modül İsmi"; + $lang->addon_name = "Eklenti İsmi"; + $lang->version = "Sürüm"; + $lang->author = "Geliştirici"; + $lang->table_count = "Tablo Numarası"; + $lang->installed_path = "Yükleme Yolu"; + + $lang->cmd_shortcut_management = "Menü Düzenle"; + + $lang->msg_is_not_administrator = 'Sadece Yöneticiler'; + $lang->msg_manage_module_cannot_delete = 'Modüllerin, eklentilerin, yerleşim düzenlerinin, widgetların kısayolları silinemez.'; + $lang->msg_default_act_is_null = 'Kısayol varsayılan yönetici eylemi ayarlanmadığından kayıt edilemiyor.'; + + $lang->welcome_to_xe = 'XE Yönetici Sayfasına Hoşgeldiniz'; + $lang->about_admin_page = "Yönetici sayfası hâla geliştirilmektedir,\nClosebeta sürecinde birçok iyi öneriyi kabul ederek gerekli içerikleri ekleyeceğiz."; + $lang->about_lang_env = "Seçilen dili varsayılan dil olarak uygulamak için, lütfen Kaydet tuşuna basınız."; + + $lang->xe_license = 'XE GPL ile uyumludur'; + $lang->about_shortcut = 'Sık kullanılan modüller listesine kaydedilmiş modüllerin kısayollarını silebilirsiniz.'; + + $lang->yesterday = "Dün"; + $lang->today = "Bugün"; + + $lang->cmd_lang_select = "Dil"; + $lang->about_cmd_lang_select = "Sadece seçili dillerde hizmet verecektir."; + $lang->about_recompile_cache = "Gereksiz veya geçersiz önbellek dosyalarını silebilirsiniz."; + $lang->use_ssl = "SSL Kullan"; + $lang->ssl_options = array( + 'none' => "Hiçbir zaman", + 'optional' => "İsteğe Bağlı", + 'always' => "Her zaman" + ); + $lang->about_use_ssl = "'İsteği Bağlı' seçiminde; SSL, kayıt olma/bilgi değiştirme gibi eylemler için kullanılacaktır. 'Her zaman' seçiminde, siteniz sadece http yoluyla hizmet verecektir."; + $lang->server_ports = "Sunucu Bağlantı Noktası (port)"; + $lang->about_server_ports = "Eğer web sunucunuz, HTTP bağlantı noktaları için 80 ya da HTTPS 443 portunu kullanmıyorsa, sunucu bağlantı noktalarını belirtmeniz gerekmektedir."; + $lang->use_db_session = 'Oturum Veritabanı Kullanımı'; + $lang->about_db_session = 'Yetersiz web sunucusu kullanımı olan websiteleri için, bu özellik devredışı bırakıldığı zaman daha hızlı bir tepki beklenebilir.
Ancak oturum veritabanı, mevcut kullanıcılar için veritabanını erişilemez hâle getirecektir ve ilgili işler kullanılamaz hale gelecektir.'; + $lang->sftp = "SFTP Kullan"; + $lang->ftp_get_list = "Listeyi Al"; + $lang->ftp_remove_info = 'FTP Bilgisini Sil.'; + $lang->msg_ftp_invalid_path = 'Belirtilen FTP Yolunu okuma işlemi başarız oldu.'; + $lang->msg_self_restart_cache_engine = 'Lütfen önbellek geri plan yordamını veya Memcached\' ı yeniden başlatınız.'; + $lang->mobile_view = 'Hareketli Görünümü'; + $lang->about_mobile_view = 'Hareketli görünümü, mobil cihazlarla giriş yapılırken, mobil cihazlara uygun en iyi yerleşim düzenini göstermek içindir.'; + $lang->autoinstall = 'KolayKurulum'; + + $lang->last_week = 'Geçen Hafta'; + $lang->this_week = 'Bu Hafta'; +?> diff --git a/modules/admin/lang/vi.lang.php b/modules/admin/lang/vi.lang.php index 22cba1de4..15ee2774c 100644 --- a/modules/admin/lang/vi.lang.php +++ b/modules/admin/lang/vi.lang.php @@ -1,95 +1,95 @@ -admin_info = 'Thông tin Administrator'; - $lang->admin_index = 'Trang chủ Admin'; - $lang->control_panel = 'Bảng điều khiển'; - $lang->start_module = 'Module trang chủ'; - $lang->about_start_module = 'Bạn có thể chọn một Module và đặt là trang chủ của Website.'; - - $lang->module_category_title = array( - 'service' => 'Thiết lập dịch vụ', - 'member' => 'Thiết lập thành viên', - 'content' => 'Thiết lập nội dung', - 'statistics' => 'Thống kê', - 'construction' => 'Xây dựng giao diện', - 'utility' => 'Thiết lập tiện ích', - 'interlock' => 'Tiện ích nâng cao', - 'accessory' => 'Dịch vụ phụ', - 'migration' => 'Chuyển đổi dữ liệu', - 'system' => 'Thiết lập hệ thống', - ); - - $lang->newest_news = "Tin mới nhất"; - - $lang->env_setup = "Thiết lập "; - $lang->default_url = "URL mặc định"; - $lang->about_default_url = "Nếu bạn sử dụng tính năng trang Web ảo (Ví dụ: PlanetXE, cafeXE), hãy chọn URL mặc định (địa chỉ trang chủ), khi khi kích hoạt SSO với thư mục hay Module làm việc."; - - $lang->env_information = "Thông tin"; - $lang->current_version = "Phiên bản"; - $lang->current_path = "Thư mục cài đặt"; - $lang->released_version = "Phiên bản mới nhất"; - $lang->about_download_link = "Đã có phiên bản mới nhất của XE.\n Hãy bấm vào Link để Download."; - - $lang->item_module = "Danh sách Module"; - $lang->item_addon = "Danh sách Addon"; - $lang->item_widget = "Danh sách Widget"; - $lang->item_layout = "Danh sách Layout"; - - $lang->module_name = "Tên Module"; - $lang->addon_name = "Tên Addon"; - $lang->version = "Phiên bản"; - $lang->author = "Thiết kế"; - $lang->table_count = "Table"; - $lang->installed_path = "Thư mục đã cài đặt"; - - $lang->cmd_shortcut_management = "Sửa Menu"; - - $lang->msg_is_not_administrator = 'Dành riêng Administrator'; - $lang->msg_manage_module_cannot_delete = 'Không thể xóa những phím tắt của Module, Addon, Layout, Widget.'; - $lang->msg_default_act_is_null = 'Phím tắt đã không được tạo, bởi vì bạn không được đặt quyền là quản lý toàn diện.'; - - $lang->welcome_to_xe = 'Chào mừng bạn đến với trang quản lý của XE!'; - $lang->about_admin_page = "Trang Admin này vẫn đang được phát triển,\n Chúng tôi sẽ thêm vào những nội dung chủ yếu từ những ý kiến của người sử dụng."; - $lang->about_lang_env = "Để hiển thị ngôn ngữ đã chọn là mặc định. Hãy bấm [Lưu] phía dưới để lưu lại."; - - $lang->xe_license = 'XE sử dụng giấy phép GPL'; - $lang->about_shortcut = 'Bạn có thể loại bỏ phím tắt của Module được sử dụng thường xuyên trên danh sách.'; - - $lang->yesterday = "Hôm qua"; - $lang->today = "Hôm nay"; - - $lang->cmd_lang_select = "Ngôn ngữ"; - $lang->about_cmd_lang_select = "Chỉ chọn được những ngôn ngữ có sẵn."; - $lang->about_recompile_cache = "Bạn có thể sắp xếp lại File Cache cho những việc đã làm hoặc bị lỗi."; - $lang->use_ssl = "Sử dụng SSL"; - $lang->ssl_options = array( - 'none' => "Không sử dụng", - 'optional' => "Tùy chỉnh", - 'always' => "Luôn luôn" - ); - $lang->about_use_ssl = "Nếu bạn chọn 'Tùy chỉnh', SSL sẽ sử dụng và những công việc như đăng kí, sửa thông tin thành viên, .
Chỉ chọn 'Luôn luôn' khi Website của bạn đang chạy trên Server có hỗ trợ https."; - $lang->server_ports = "Cổng kết nối"; - $lang->about_server_ports = "Nếu Host của bạn sử dụng cổng khác cổng mặc định 80 cho HTTP, 443 cho HTTPS, bạn nên xác định và nhập chính xác cổng kết nối."; - $lang->use_db_session = 'Xác nhận Database'; - $lang->about_db_session = 'PHP sẽ xác nhận với Database. Có thể cải thiện được tốc độ của Website.'; - $lang->sftp = "Sử dụng SFTP"; - $lang->ftp_get_list = "Nhận danh sách"; - $lang->ftp_remove_info = 'Xóa thông tin FTP.'; - $lang->msg_ftp_invalid_path = 'Không tìm thấy thông tin của thư mục bạn đã nhập trên FTP.'; - $lang->msg_self_restart_cache_engine = 'Hãy thiết lập lại bộ nhớ Cache hoặc Deamon Cache.'; - $lang->mobile_view = 'Xem bằng di động'; - $lang->about_mobile_view = 'Nếu truy cập bằng thiết bị di động, nội dung sẽ được bố trí theo từng loại thiết bị.'; - $lang->autoinstall = 'Cập nhật tự động'; - - $lang->last_week = 'Last week'; - $lang->this_week = 'This week'; -?> +admin_info = 'Thông tin Administrator'; + $lang->admin_index = 'Trang chủ Admin'; + $lang->control_panel = 'Bảng điều khiển'; + $lang->start_module = 'Module trang chủ'; + $lang->about_start_module = 'Bạn có thể chọn một Module và đặt là trang chủ của Website.'; + + $lang->module_category_title = array( + 'service' => 'Thiết lập dịch vụ', + 'member' => 'Thiết lập thành viên', + 'content' => 'Thiết lập nội dung', + 'statistics' => 'Thống kê', + 'construction' => 'Xây dựng giao diện', + 'utility' => 'Thiết lập tiện ích', + 'interlock' => 'Tiện ích nâng cao', + 'accessory' => 'Dịch vụ phụ', + 'migration' => 'Chuyển đổi dữ liệu', + 'system' => 'Thiết lập hệ thống', + ); + + $lang->newest_news = "Tin mới nhất"; + + $lang->env_setup = "Thiết lập "; + $lang->default_url = "URL mặc định"; + $lang->about_default_url = "Nếu bạn sử dụng tính năng trang Web ảo (Ví dụ: PlanetXE, cafeXE), hãy chọn URL mặc định (địa chỉ trang chủ), khi khi kích hoạt SSO với thư mục hay Module làm việc."; + + $lang->env_information = "Thông tin"; + $lang->current_version = "Phiên bản"; + $lang->current_path = "Thư mục cài đặt"; + $lang->released_version = "Phiên bản mới nhất"; + $lang->about_download_link = "Đã có phiên bản mới nhất của XE.\n Hãy bấm vào Link để Download."; + + $lang->item_module = "Danh sách Module"; + $lang->item_addon = "Danh sách Addon"; + $lang->item_widget = "Danh sách Widget"; + $lang->item_layout = "Danh sách Layout"; + + $lang->module_name = "Tên Module"; + $lang->addon_name = "Tên Addon"; + $lang->version = "Phiên bản"; + $lang->author = "Thiết kế"; + $lang->table_count = "Table"; + $lang->installed_path = "Thư mục đã cài đặt"; + + $lang->cmd_shortcut_management = "Sửa Menu"; + + $lang->msg_is_not_administrator = 'Dành riêng Administrator'; + $lang->msg_manage_module_cannot_delete = 'Không thể xóa những phím tắt của Module, Addon, Layout, Widget.'; + $lang->msg_default_act_is_null = 'Phím tắt đã không được tạo, bởi vì bạn không được đặt quyền là quản lý toàn diện.'; + + $lang->welcome_to_xe = 'Chào mừng bạn đến với trang quản lý của XE!'; + $lang->about_admin_page = "Trang Admin này vẫn đang được phát triển,\n Chúng tôi sẽ thêm vào những nội dung chủ yếu từ những ý kiến của người sử dụng."; + $lang->about_lang_env = "Để hiển thị ngôn ngữ đã chọn là mặc định. Hãy bấm [Lưu] phía dưới để lưu lại."; + + $lang->xe_license = 'XE sử dụng giấy phép GPL'; + $lang->about_shortcut = 'Bạn có thể loại bỏ phím tắt của Module được sử dụng thường xuyên trên danh sách.'; + + $lang->yesterday = "Hôm qua"; + $lang->today = "Hôm nay"; + + $lang->cmd_lang_select = "Ngôn ngữ"; + $lang->about_cmd_lang_select = "Chỉ chọn được những ngôn ngữ có sẵn."; + $lang->about_recompile_cache = "Bạn có thể sắp xếp lại File Cache cho những việc đã làm hoặc bị lỗi."; + $lang->use_ssl = "Sử dụng SSL"; + $lang->ssl_options = array( + 'none' => "Không sử dụng", + 'optional' => "Tùy chỉnh", + 'always' => "Luôn luôn" + ); + $lang->about_use_ssl = "Nếu bạn chọn 'Tùy chỉnh', SSL sẽ sử dụng và những công việc như đăng kí, sửa thông tin thành viên, .
Chỉ chọn 'Luôn luôn' khi Website của bạn đang chạy trên Server có hỗ trợ https."; + $lang->server_ports = "Cổng kết nối"; + $lang->about_server_ports = "Nếu Host của bạn sử dụng cổng khác cổng mặc định 80 cho HTTP, 443 cho HTTPS, bạn nên xác định và nhập chính xác cổng kết nối."; + $lang->use_db_session = 'Xác nhận Database'; + $lang->about_db_session = 'PHP sẽ xác nhận với Database. Có thể cải thiện được tốc độ của Website.'; + $lang->sftp = "Sử dụng SFTP"; + $lang->ftp_get_list = "Nhận danh sách"; + $lang->ftp_remove_info = 'Xóa thông tin FTP.'; + $lang->msg_ftp_invalid_path = 'Không tìm thấy thông tin của thư mục bạn đã nhập trên FTP.'; + $lang->msg_self_restart_cache_engine = 'Hãy thiết lập lại bộ nhớ Cache hoặc Deamon Cache.'; + $lang->mobile_view = 'Xem bằng di động'; + $lang->about_mobile_view = 'Nếu truy cập bằng thiết bị di động, nội dung sẽ được bố trí theo từng loại thiết bị.'; + $lang->autoinstall = 'Cập nhật tự động'; + + $lang->last_week = 'Last week'; + $lang->this_week = 'This week'; +?> diff --git a/modules/admin/lang/zh-CN.lang.php b/modules/admin/lang/zh-CN.lang.php index 4112797e7..c5afe80a8 100644 --- a/modules/admin/lang/zh-CN.lang.php +++ b/modules/admin/lang/zh-CN.lang.php @@ -1,92 +1,92 @@ -admin_info = '管理员信息'; - $lang->admin_index = '管理首页'; - $lang->control_panel = '控制面板'; - $lang->start_module = '首页模块'; - $lang->about_start_module = '可指定用户访问网站时的默认首页模块。'; - - $lang->module_category_title = array( - 'service' => '应用管理', - 'member' => '用户管理', - 'content' => '资源管理', - 'statistics' => '统计管理', - 'construction' => '界面管理', - 'utility' => '扩展管理', - 'interlock' => '辅助联动', - 'accessory' => '附加功能', - 'migration' => '数据导入', - 'system' => '系统管理', - ); - - $lang->newest_news = "最新消息"; - - $lang->env_setup = "系统设置"; - $lang->default_url = "XE通行证"; - $lang->about_default_url = "请输入默认站点的XE安装地址(ex: http://域名/xe)。
说明:简单的说,就是绑定帐号系统。只需要登录一次,就可以在用站点模块生成的多个子站点中随意漫游。"; - - - $lang->env_information = "系统信息"; - $lang->current_version = "安装版本"; - $lang->current_path = "安装路径"; - $lang->released_version = "最新版本"; - $lang->about_download_link = "官方网站已发布最新版本XE。\n请点击[下载]链接下载最新版本。"; - - $lang->item_module = "模块目录"; - $lang->item_addon = "插件目录"; - $lang->item_widget = "控件目录"; - $lang->item_layout = "布局目录"; - - $lang->module_name = "模块名称"; - $lang->addon_name = "插件名称"; - $lang->version = "版本"; - $lang->author = "作者"; - $lang->table_count = "表格数"; - $lang->installed_path = "安装路径"; - - $lang->cmd_shortcut_management = "编辑菜单"; - - $lang->msg_is_not_administrator = '只允许管理员访问'; - $lang->msg_manage_module_cannot_delete = '模块,插件,布局,控件模块的快捷菜单是不能删除的。'; - $lang->msg_default_act_is_null = '没有指定默认管理员的动作,是不能添加到快捷菜单的。'; - - $lang->welcome_to_xe = 'XE 管理页面'; - $lang->about_lang_env = "可以设置显示给首次访问者的同一语言环境。修改语言环境后请点击 [保存] 按钮进行保存。"; - - $lang->xe_license = 'XE遵循 GPL协议'; - $lang->about_shortcut = '可以删除添加到常用模块中的快捷菜单。'; - - $lang->yesterday = "Yesterday"; - $lang->today = "Today"; - - $lang->cmd_lang_select = "多国语言支持"; - $lang->about_cmd_lang_select = "请选择要使用的语言。"; - $lang->about_recompile_cache = "整理无用的或错误的缓冲文件。"; - $lang->use_ssl = "SSL使用"; - $lang->ssl_options = array( - 'none' => "不使用", - 'optional' => "选择性", - 'always' => "使用" - ); - $lang->about_use_ssl = "选择性使用选项应用于新用户注册/修改用户信息等已指定的action当中,使用选项应用于所有服务。"; - $lang->server_ports = "指定服务器端口"; - $lang->about_server_ports = "使用除HTTP(80), HTTPS(443)以外的端口时,必须得指定该服务器端口号。"; - $lang->use_db_session = 'DB储存认证会话'; - $lang->about_db_session = '用DB储存认证时的PHP会话。
服务器使用率较少的网站建议不要勾选此项(可提高网站访问速度)。
只是无法统计在线会员。'; - $lang->sftp = '使用sSFTP'; - $lang->ftp_get_list = '载入列表'; - $lang->ftp_remove_info = '删除FTP信息'; - $lang->msg_ftp_invalid_path = '无法读取FTP路径。'; - $lang->msg_self_restart_cache_engine = '请重新启动Memcached或CacheDaemon。'; - $lang->mobile_view = '开启移动版'; - $lang->about_mobile_view = '为智能手机访问网站,提供最佳视觉效果。'; - $lang->autoinstall = '安装·更新'; - - $lang->last_week = 'Last week'; - $lang->this_week = 'This week'; -?> +admin_info = '管理员信息'; + $lang->admin_index = '管理首页'; + $lang->control_panel = '控制面板'; + $lang->start_module = '首页模块'; + $lang->about_start_module = '可指定用户访问网站时的默认首页模块。'; + + $lang->module_category_title = array( + 'service' => '应用管理', + 'member' => '用户管理', + 'content' => '资源管理', + 'statistics' => '统计管理', + 'construction' => '界面管理', + 'utility' => '扩展管理', + 'interlock' => '辅助联动', + 'accessory' => '附加功能', + 'migration' => '数据导入', + 'system' => '系统管理', + ); + + $lang->newest_news = "最新消息"; + + $lang->env_setup = "系统设置"; + $lang->default_url = "XE通行证"; + $lang->about_default_url = "请输入默认站点的XE安装地址(ex: http://域名/xe)。
说明:简单的说,就是绑定帐号系统。只需要登录一次,就可以在用站点模块生成的多个子站点中随意漫游。"; + + + $lang->env_information = "系统信息"; + $lang->current_version = "安装版本"; + $lang->current_path = "安装路径"; + $lang->released_version = "最新版本"; + $lang->about_download_link = "官方网站已发布最新版本XE。\n请点击[下载]链接下载最新版本。"; + + $lang->item_module = "模块目录"; + $lang->item_addon = "插件目录"; + $lang->item_widget = "控件目录"; + $lang->item_layout = "布局目录"; + + $lang->module_name = "模块名称"; + $lang->addon_name = "插件名称"; + $lang->version = "版本"; + $lang->author = "作者"; + $lang->table_count = "表格数"; + $lang->installed_path = "安装路径"; + + $lang->cmd_shortcut_management = "编辑菜单"; + + $lang->msg_is_not_administrator = '只允许管理员访问'; + $lang->msg_manage_module_cannot_delete = '模块,插件,布局,控件模块的快捷菜单是不能删除的。'; + $lang->msg_default_act_is_null = '没有指定默认管理员的动作,是不能添加到快捷菜单的。'; + + $lang->welcome_to_xe = 'XE 管理页面'; + $lang->about_lang_env = "可以设置显示给首次访问者的同一语言环境。修改语言环境后请点击 [保存] 按钮进行保存。"; + + $lang->xe_license = 'XE遵循 GPL协议'; + $lang->about_shortcut = '可以删除添加到常用模块中的快捷菜单。'; + + $lang->yesterday = "Yesterday"; + $lang->today = "Today"; + + $lang->cmd_lang_select = "多国语言支持"; + $lang->about_cmd_lang_select = "请选择要使用的语言。"; + $lang->about_recompile_cache = "整理无用的或错误的缓冲文件。"; + $lang->use_ssl = "SSL使用"; + $lang->ssl_options = array( + 'none' => "不使用", + 'optional' => "选择性", + 'always' => "使用" + ); + $lang->about_use_ssl = "选择性使用选项应用于新用户注册/修改用户信息等已指定的action当中,使用选项应用于所有服务。"; + $lang->server_ports = "指定服务器端口"; + $lang->about_server_ports = "使用除HTTP(80), HTTPS(443)以外的端口时,必须得指定该服务器端口号。"; + $lang->use_db_session = 'DB储存认证会话'; + $lang->about_db_session = '用DB储存认证时的PHP会话。
服务器使用率较少的网站建议不要勾选此项(可提高网站访问速度)。
只是无法统计在线会员。'; + $lang->sftp = '使用sSFTP'; + $lang->ftp_get_list = '载入列表'; + $lang->ftp_remove_info = '删除FTP信息'; + $lang->msg_ftp_invalid_path = '无法读取FTP路径。'; + $lang->msg_self_restart_cache_engine = '请重新启动Memcached或CacheDaemon。'; + $lang->mobile_view = '开启移动版'; + $lang->about_mobile_view = '为智能手机访问网站,提供最佳视觉效果。'; + $lang->autoinstall = '安装·更新'; + + $lang->last_week = 'Last week'; + $lang->this_week = 'This week'; +?> diff --git a/modules/admin/lang/zh-TW.lang.php b/modules/admin/lang/zh-TW.lang.php index 7c3f39d46..80cae5742 100644 --- a/modules/admin/lang/zh-TW.lang.php +++ b/modules/admin/lang/zh-TW.lang.php @@ -1,92 +1,92 @@ -admin_info = '管理員資訊'; - $lang->admin_index = '管理頁面'; - $lang->control_panel = '控制介面'; - $lang->start_module = '預設首頁'; - $lang->about_start_module = '可將所選擇的模組作為預設首頁。'; - - $lang->module_category_title = array( - 'service' => '服務設定', - 'member' => '會員管理', - 'content' => '內容管理', - 'statistics' => '統計資料', - 'construction' => '界面設定', - 'utility' => '擴充功能', - 'interlock' => '連動設定', - 'accessory' => '附加功能管理', - 'migration' => '資料轉換', - 'system' => '系統管理', - ); - - $lang->newest_news = "最新消息"; - - $lang->env_setup = "系統設置"; - $lang->default_url = "預設網址"; - $lang->about_default_url = "XE虛擬網站必須要先輸入預設的網址確保虛擬網站的運作,請輸入預設程式安裝路徑。
(例: http://網域名稱/安裝路徑)"; - - - $lang->env_information = "系統資訊"; - $lang->current_version = "安裝版本"; - $lang->current_path = "安裝路徑"; - $lang->released_version = "最新版本"; - $lang->about_download_link = "官方網站已發佈最新版本。\n請按[下載]下載最新版本。"; - - $lang->item_module = "模組列表"; - $lang->item_addon = "元件列表"; - $lang->item_widget = "Widget列表"; - $lang->item_layout = "版面列表"; - - $lang->module_name = "模組名稱"; - $lang->addon_name = "元件名稱"; - $lang->version = "版本"; - $lang->author = "作者"; - $lang->table_count = "表格數"; - $lang->installed_path = "安裝路徑"; - - $lang->cmd_shortcut_management = "編輯選單"; - - $lang->msg_is_not_administrator = '只有管理員才可以檢視'; - $lang->msg_manage_module_cannot_delete = '模組,附加元件,版面設計,Widget的快速選單是無法刪除的。'; - $lang->msg_default_act_is_null = '沒有指定預設管理員的動作,是無法新增到快速選單的。'; - - $lang->welcome_to_xe = 'XE管理頁面'; - $lang->about_lang_env = "請選擇預設語言。選擇完畢後,請按[儲存]按鈕。"; - - $lang->xe_license = 'XE遵循 GPL 協議'; - $lang->about_shortcut = '可以刪除新增到常用模組中的快速選單。'; - - $lang->yesterday = "昨天"; - $lang->today = "今天"; - - $lang->cmd_lang_select = "選擇語言"; - $lang->about_cmd_lang_select = "只提供所選擇的語言服務"; - $lang->about_recompile_cache = "可有效的整理錯誤的暫存檔"; - $lang->use_ssl = "SSL功能"; - $lang->ssl_options = array( - 'none' => "關閉", - 'optional' => "手動", - 'always' => "開啟" - ); - $lang->about_use_ssl = "選擇手動時,在會員註冊或修改資料等動作時才會使用 SSL 功能。
選擇開啟時,所有的服務都會使用 SSL 功能。"; - $lang->server_ports = "主機埠口"; - $lang->about_server_ports = "HTTP、HTTPS預設埠口分別是『80』、『443』
如果想使用其他的埠口的話,請自行設定。"; - $lang->use_db_session = 'DB session認證'; - $lang->about_db_session = '使用 PHP session 進行 DB 認證。
關閉此功能對於負荷較低的網站可提高效率。
使用此功能會無法統計線上人數。'; - $lang->sftp = "使用 SFTP"; - $lang->ftp_get_list = "取得列表"; - $lang->ftp_remove_info = '移除 FTP 資料'; - $lang->msg_ftp_invalid_path = '指定的 FTP 路徑讀取失敗。'; - $lang->msg_self_restart_cache_engine = '請重新啟動 Memcached 快取程式。'; - $lang->mobile_view = '手機瀏覽'; - $lang->about_mobile_view = '使用手機瀏覽時將會顯示最適當的畫面。'; - $lang->autoinstall = '自動安裝'; - - $lang->last_week = '上週'; - $lang->this_week = '本週'; -?> +admin_info = '管理員資訊'; + $lang->admin_index = '管理頁面'; + $lang->control_panel = '控制介面'; + $lang->start_module = '預設首頁'; + $lang->about_start_module = '可將所選擇的模組作為預設首頁。'; + + $lang->module_category_title = array( + 'service' => '服務設定', + 'member' => '會員管理', + 'content' => '內容管理', + 'statistics' => '統計資料', + 'construction' => '界面設定', + 'utility' => '擴充功能', + 'interlock' => '連動設定', + 'accessory' => '附加功能管理', + 'migration' => '資料轉換', + 'system' => '系統管理', + ); + + $lang->newest_news = "最新消息"; + + $lang->env_setup = "系統設置"; + $lang->default_url = "預設網址"; + $lang->about_default_url = "XE虛擬網站必須要先輸入預設的網址確保虛擬網站的運作,請輸入預設程式安裝路徑。
(例: http://網域名稱/安裝路徑)"; + + + $lang->env_information = "系統資訊"; + $lang->current_version = "安裝版本"; + $lang->current_path = "安裝路徑"; + $lang->released_version = "最新版本"; + $lang->about_download_link = "官方網站已發佈最新版本。\n請按[下載]下載最新版本。"; + + $lang->item_module = "模組列表"; + $lang->item_addon = "元件列表"; + $lang->item_widget = "Widget列表"; + $lang->item_layout = "版面列表"; + + $lang->module_name = "模組名稱"; + $lang->addon_name = "元件名稱"; + $lang->version = "版本"; + $lang->author = "作者"; + $lang->table_count = "表格數"; + $lang->installed_path = "安裝路徑"; + + $lang->cmd_shortcut_management = "編輯選單"; + + $lang->msg_is_not_administrator = '只有管理員才可以檢視'; + $lang->msg_manage_module_cannot_delete = '模組,附加元件,版面設計,Widget的快速選單是無法刪除的。'; + $lang->msg_default_act_is_null = '沒有指定預設管理員的動作,是無法新增到快速選單的。'; + + $lang->welcome_to_xe = 'XE管理頁面'; + $lang->about_lang_env = "請選擇預設語言。選擇完畢後,請按[儲存]按鈕。"; + + $lang->xe_license = 'XE遵循 GPL 協議'; + $lang->about_shortcut = '可以刪除新增到常用模組中的快速選單。'; + + $lang->yesterday = "昨天"; + $lang->today = "今天"; + + $lang->cmd_lang_select = "選擇語言"; + $lang->about_cmd_lang_select = "只提供所選擇的語言服務"; + $lang->about_recompile_cache = "可有效的整理錯誤的暫存檔"; + $lang->use_ssl = "SSL功能"; + $lang->ssl_options = array( + 'none' => "關閉", + 'optional' => "手動", + 'always' => "開啟" + ); + $lang->about_use_ssl = "選擇手動時,在會員註冊或修改資料等動作時才會使用 SSL 功能。
選擇開啟時,所有的服務都會使用 SSL 功能。"; + $lang->server_ports = "主機埠口"; + $lang->about_server_ports = "HTTP、HTTPS預設埠口分別是『80』、『443』
如果想使用其他的埠口的話,請自行設定。"; + $lang->use_db_session = 'DB session認證'; + $lang->about_db_session = '使用 PHP session 進行 DB 認證。
關閉此功能對於負荷較低的網站可提高效率。
使用此功能會無法統計線上人數。'; + $lang->sftp = "使用 SFTP"; + $lang->ftp_get_list = "取得列表"; + $lang->ftp_remove_info = '移除 FTP 資料'; + $lang->msg_ftp_invalid_path = '指定的 FTP 路徑讀取失敗。'; + $lang->msg_self_restart_cache_engine = '請重新啟動 Memcached 快取程式。'; + $lang->mobile_view = '手機瀏覽'; + $lang->about_mobile_view = '使用手機瀏覽時將會顯示最適當的畫面。'; + $lang->autoinstall = '自動安裝'; + + $lang->last_week = '上週'; + $lang->this_week = '本週'; +?> diff --git a/modules/admin/tpl/_footer.html b/modules/admin/tpl/_footer.html index f6784b0b7..02eaa22f6 100644 --- a/modules/admin/tpl/_footer.html +++ b/modules/admin/tpl/_footer.html @@ -1,6 +1,6 @@ -
-
- -
+ +
+ + diff --git a/modules/admin/tpl/_header.html b/modules/admin/tpl/_header.html index 74cd6a50e..a5c75ef79 100644 --- a/modules/admin/tpl/_header.html +++ b/modules/admin/tpl/_header.html @@ -1,60 +1,60 @@ - - -
- -
-
-
-
- -
- - -
- - -
-
-
+ + +
+ +
+
+
+
+ +
+ + +
+ + +
+
+
diff --git a/modules/admin/tpl/css/font.css b/modules/admin/tpl/css/font.css index 4175d6a71..ba60a9aaa 100755 --- a/modules/admin/tpl/css/font.css +++ b/modules/admin/tpl/css/font.css @@ -1,60 +1,60 @@ -@charset "utf-8"; -/* NHN (developers@xpressengine.com) */ - -#xeAdmin{ font-family:Sans-serif;} - -#xeAdmin a{ text-decoration:none !important;} -#xeAdmin a:hover, -#xeAdmin a:active, -#xeAdmin a:focus{ text-decoration:underline !important;} - -#xeAdmin h1.xeAdmin a{ text-decoration:none !important; font-family:Arial; font-size:16px; color:#fff; margin:0; padding:0;} -#xeAdmin table th{ color:#666;} -#xeAdmin table th a { color:#666;} -#xeAdmin table td{ color:#767676;} -#xeAdmin table td a { color:#767676;} -#xeAdmin caption{ font-size:11px; font-family:Tahoma; color:#767676;} -#xeAdmin div.summary { font-size:11px; font-family:Tahoma; color:#767676;} -#xeAdmin div.summary strong { font-weight:normal; } -#xeAdmin button.text{ font-size:12px;} -#xeAdmin em, -#xeAdmin address{ font-style:normal;} -#xeAdmin select{ font-size:12px;} -#xeAdmin input{ font-size:12px;} -#xeAdmin .buttonTypeGo{ padding:0; cursor:pointer;} - -#xeAdmin .footer address{ font:10px Tahoma;} -#xeAdmin .footer address a{ color:#777e86; } -#xeAdmin .gnb li a { color:#777e86; font-size:11px; font-family:Tahoma;} -#adminLang li a{ font-size:12px;} -#xeAdmin .lnb li, -#xeAdmin .lnb li a{ color:#fff; font-size:14px; font-family:Dotum, Tahoma;} - -#xeAdmin .path{ color:#ccc; font-size:11px;} -#xeAdmin .path a{ color:#767676; font-size:11px; font-family:Dotum, Sans-serif;} - -.e1 .navigation li a{ color:#000; text-decoration:none;} -.e1 .navigation li ul li a{ color:#767676;} -.e1 .navigation li ul li.active a{ font-weight:bold; color:#666;} - -.e2 .section h2.xeAdmin { font-size:12px; margin:0; padding:0;} -.e2 .section h2.xeAdmin .date{ font:Tahoma; color:#999;} - -.e2 table tbody th{ font-weight:normal; font-family:Dotum;} - -.e2 .notice li a{ color:#666; } -.e2 .notice li .date{ color:#767676; font:10px Tahoma;} - -.localNavigation li a{ text-decoration:none !important; color:#666;} -.localNavigation li.active a{ font-weight:bold; color:#1e6aac;} - -#xeAdmin h2.xeAdmin { font-size:12px;} -#xeAdmin h3.xeAdmin { font-size:12px; color:#666; margin:0; padding:0;} -#xeAdmin p.summary{ color:#767676;} -#xeAdmin p.summary a { text-decoration:none; color:#767676; } -#xeAdmin p.summary.red { color:#A54D4D; } -#xeAdmin p.summary.red a { text-decoration:none; color:#A54D4D; } -#xeAdmin div.infoText { color:#767676;} -#xeAdmin div.infoText p.warning{ margin:0 0 10px 0; padding:0 0 0 25px; background:url(../img/iconWarning.gif) no-repeat left top;} -#xeAdmin div.infoText p.update{ margin:0 0 10px 0; padding:0 0 0 25px; background:url(../img/iconRefresh.gif) no-repeat left top;} -#xeAdmin .buttonAction{} +@charset "utf-8"; +/* NHN (developers@xpressengine.com) */ + +#xeAdmin{ font-family:Sans-serif;} + +#xeAdmin a{ text-decoration:none !important;} +#xeAdmin a:hover, +#xeAdmin a:active, +#xeAdmin a:focus{ text-decoration:underline !important;} + +#xeAdmin h1.xeAdmin a{ text-decoration:none !important; font-family:Arial; font-size:16px; color:#fff; margin:0; padding:0;} +#xeAdmin table th{ color:#666;} +#xeAdmin table th a { color:#666;} +#xeAdmin table td{ color:#767676;} +#xeAdmin table td a { color:#767676;} +#xeAdmin caption{ font-size:11px; font-family:Tahoma; color:#767676;} +#xeAdmin div.summary { font-size:11px; font-family:Tahoma; color:#767676;} +#xeAdmin div.summary strong { font-weight:normal; } +#xeAdmin button.text{ font-size:12px;} +#xeAdmin em, +#xeAdmin address{ font-style:normal;} +#xeAdmin select{ font-size:12px;} +#xeAdmin input{ font-size:12px;} +#xeAdmin .buttonTypeGo{ padding:0; cursor:pointer;} + +#xeAdmin .footer address{ font:10px Tahoma;} +#xeAdmin .footer address a{ color:#777e86; } +#xeAdmin .gnb li a { color:#777e86; font-size:11px; font-family:Tahoma;} +#adminLang li a{ font-size:12px;} +#xeAdmin .lnb li, +#xeAdmin .lnb li a{ color:#fff; font-size:14px; font-family:Dotum, Tahoma;} + +#xeAdmin .path{ color:#ccc; font-size:11px;} +#xeAdmin .path a{ color:#767676; font-size:11px; font-family:Dotum, Sans-serif;} + +.e1 .navigation li a{ color:#000; text-decoration:none;} +.e1 .navigation li ul li a{ color:#767676;} +.e1 .navigation li ul li.active a{ font-weight:bold; color:#666;} + +.e2 .section h2.xeAdmin { font-size:12px; margin:0; padding:0;} +.e2 .section h2.xeAdmin .date{ font:Tahoma; color:#999;} + +.e2 table tbody th{ font-weight:normal; font-family:Dotum;} + +.e2 .notice li a{ color:#666; } +.e2 .notice li .date{ color:#767676; font:10px Tahoma;} + +.localNavigation li a{ text-decoration:none !important; color:#666;} +.localNavigation li.active a{ font-weight:bold; color:#1e6aac;} + +#xeAdmin h2.xeAdmin { font-size:12px;} +#xeAdmin h3.xeAdmin { font-size:12px; color:#666; margin:0; padding:0;} +#xeAdmin p.summary{ color:#767676;} +#xeAdmin p.summary a { text-decoration:none; color:#767676; } +#xeAdmin p.summary.red { color:#A54D4D; } +#xeAdmin p.summary.red a { text-decoration:none; color:#A54D4D; } +#xeAdmin div.infoText { color:#767676;} +#xeAdmin div.infoText p.warning{ margin:0 0 10px 0; padding:0 0 0 25px; background:url(../img/iconWarning.gif) no-repeat left top;} +#xeAdmin div.infoText p.update{ margin:0 0 10px 0; padding:0 0 0 25px; background:url(../img/iconRefresh.gif) no-repeat left top;} +#xeAdmin .buttonAction{} diff --git a/modules/admin/tpl/css/layout.css b/modules/admin/tpl/css/layout.css index 3cd75b92a..18dd2d017 100755 --- a/modules/admin/tpl/css/layout.css +++ b/modules/admin/tpl/css/layout.css @@ -1,47 +1,47 @@ -@charset "utf-8"; - -/* NHN (developers@xpressengine.com) */ - -#xeAdmin .header{ position:relative; height:62px; padding:10px 15px 10px 30px; background:url(../img/bgHeader.gif) repeat-x; z-index:10;} -#xeAdmin .footer{ height:26px; padding-top:10px; background:url(../img/bgFooter.gif) repeat-x; text-align:center;} -#xeAdmin .gnb{ position:relative; float:right; white-space:nowrap; clear:right; margin:0; padding:0;} -#xeAdmin .gnb li{ position:relative; float:left; margin:0 15px 0 0; padding:0;list-style:none;} - -#xeAdmin .gnb #adminLang { position:absolute; top:18px; right:0; display:none; background:#fff; margin:0; padding:5px; border:1px solid #ddd; z-index:999;} -#xeAdmin .gnb #adminLang li{ float:none; margin:0;} - -.body{ position:relative; margin:0; padding:0 0 0 200px; background:url(../img/lineBody.gif) repeat-y 180px 0; *zoom:1;} -.body:after {content:""; display:block; clear:both;} -.c .body { padding:20px; background:none; } -.ece .body {padding-right:340px;} -.ec .body {padding-right:20px;} -.extension{ position:relative;} -.body .e1 { float:left; width:180px; margin-right:-180px; left:-200px;} -.content { position:relative; width:100%; margin-right:-100%; float:left; padding:0;} -.ec .content { padding-top:10px; } -.c .e1, .c .e2 { display:none; } -.ece .e2 { width:300px; float:right; right:-320px; border-left:1px solid #ddd; padding-bottom:20px;} -.ec .e2 { display:none;} - -#xeAdmin .lnb { position:relative; left:-3px; float:left; clear:left; margin:5px 0 0 0; padding:0;} -#xeAdmin .lnb li, -#xeAdmin .lnb li a{ position:relative; float:left; background:url(../img/buttonLNB.gif) no-repeat; white-space:nowrap;} -#xeAdmin .lnb li{ margin:0 1px 0 0; padding:0;list-style:none; background-position:0 0;} -#xeAdmin .lnb li a{ left:1px; height:30px; padding:10px 15px 0 15px; text-decoration:none !important; background-position:right 0;} -#xeAdmin .lnb li.core{ margin-right:6px; background-position:0 -50px;} -#xeAdmin .lnb li.core a{ padding-right:20px; left:5px; background-position:right -50px;} -#xeAdmin .lnb li.first{ background-position:0 -50px; margin-right:5px;} -#xeAdmin .lnb li.first a{ left:5px;} -#xeAdmin .lnb li.end{} -#xeAdmin .lnb li.end a{ padding-right:20px; background-position:right -50px;} - -#xeAdmin .lnb li.core.selected { background-position:0 -150px;} -#xeAdmin .lnb li.core.selected a{ background-position:right -150px;} -#xeAdmin .lnb li.first.selected { background-position:0 -150px;} -#xeAdmin .lnb li.first.selected a{ background-position:right -100px;} -#xeAdmin .lnb li.mid.selected { background-position:0 -100px;} -#xeAdmin .lnb li.mid.selected a{ background-position:right -100px;} -#xeAdmin .lnb li.end.selected { background-position:0 -100px;} -#xeAdmin .lnb li.end.selected a{ background-position:right -150px;} - -#xeAdmin .path{ padding:0 0 0 25px; margin:0 0 20px 0; background:url(../img/iconPath.gif) no-repeat left center;} +@charset "utf-8"; + +/* NHN (developers@xpressengine.com) */ + +#xeAdmin .header{ position:relative; height:62px; padding:10px 15px 10px 30px; background:url(../img/bgHeader.gif) repeat-x; z-index:10;} +#xeAdmin .footer{ height:26px; padding-top:10px; background:url(../img/bgFooter.gif) repeat-x; text-align:center;} +#xeAdmin .gnb{ position:relative; float:right; white-space:nowrap; clear:right; margin:0; padding:0;} +#xeAdmin .gnb li{ position:relative; float:left; margin:0 15px 0 0; padding:0;list-style:none;} + +#xeAdmin .gnb #adminLang { position:absolute; top:18px; right:0; display:none; background:#fff; margin:0; padding:5px; border:1px solid #ddd; z-index:999;} +#xeAdmin .gnb #adminLang li{ float:none; margin:0;} + +.body{ position:relative; margin:0; padding:0 0 0 200px; background:url(../img/lineBody.gif) repeat-y 180px 0; *zoom:1;} +.body:after {content:""; display:block; clear:both;} +.c .body { padding:20px; background:none; } +.ece .body {padding-right:340px;} +.ec .body {padding-right:20px;} +.extension{ position:relative;} +.body .e1 { float:left; width:180px; margin-right:-180px; left:-200px;} +.content { position:relative; width:100%; margin-right:-100%; float:left; padding:0;} +.ec .content { padding-top:10px; } +.c .e1, .c .e2 { display:none; } +.ece .e2 { width:300px; float:right; right:-320px; border-left:1px solid #ddd; padding-bottom:20px;} +.ec .e2 { display:none;} + +#xeAdmin .lnb { position:relative; left:-3px; float:left; clear:left; margin:5px 0 0 0; padding:0;} +#xeAdmin .lnb li, +#xeAdmin .lnb li a{ position:relative; float:left; background:url(../img/buttonLNB.gif) no-repeat; white-space:nowrap;} +#xeAdmin .lnb li{ margin:0 1px 0 0; padding:0;list-style:none; background-position:0 0;} +#xeAdmin .lnb li a{ left:1px; height:30px; padding:10px 15px 0 15px; text-decoration:none !important; background-position:right 0;} +#xeAdmin .lnb li.core{ margin-right:6px; background-position:0 -50px;} +#xeAdmin .lnb li.core a{ padding-right:20px; left:5px; background-position:right -50px;} +#xeAdmin .lnb li.first{ background-position:0 -50px; margin-right:5px;} +#xeAdmin .lnb li.first a{ left:5px;} +#xeAdmin .lnb li.end{} +#xeAdmin .lnb li.end a{ padding-right:20px; background-position:right -50px;} + +#xeAdmin .lnb li.core.selected { background-position:0 -150px;} +#xeAdmin .lnb li.core.selected a{ background-position:right -150px;} +#xeAdmin .lnb li.first.selected { background-position:0 -150px;} +#xeAdmin .lnb li.first.selected a{ background-position:right -100px;} +#xeAdmin .lnb li.mid.selected { background-position:0 -100px;} +#xeAdmin .lnb li.mid.selected a{ background-position:right -100px;} +#xeAdmin .lnb li.end.selected { background-position:0 -100px;} +#xeAdmin .lnb li.end.selected a{ background-position:right -150px;} + +#xeAdmin .path{ padding:0 0 0 25px; margin:0 0 20px 0; background:url(../img/iconPath.gif) no-repeat left center;} diff --git a/modules/admin/tpl/css/pagination.css b/modules/admin/tpl/css/pagination.css index 0ba0ff1b0..315223db3 100755 --- a/modules/admin/tpl/css/pagination.css +++ b/modules/admin/tpl/css/pagination.css @@ -1,85 +1,85 @@ -@charset "utf-8"; -/* NHN (developers@xpressengine.com) */ - -/* Pagination Reset */ -#xeAdmin .pagination{ padding:15px 0; margin:0; text-align:center; clear:both; } -#xeAdmin .pagination *{ margin:0; padding:0;} -#xeAdmin .pagination img{ border:0;} -#xeAdmin .pagination a, -#xeAdmin .pagination strong{ position:relative; display:inline-block; text-decoration:none; line-height:normal; color:#333; font-family:Tahoma, Sans-serif; vertical-align:middle;} -#xeAdmin .pagination a:hover, -#xeAdmin .pagination a:active, -#xeAdmin .pagination a:focus{ background-color:#f4f4f4 !important; } -#xeAdmin .pagination strong{ color:#ff6600 !important;} -#xeAdmin .pagination a.prev, -#xeAdmin .pagination a.prevEnd, -#xeAdmin .pagination a.next, -#xeAdmin .pagination a.nextEnd{ font-weight:normal !important; border:none !important; margin:0 !important; white-space:nowrap; } - -/* Pagination A1 */ -#xeAdmin .pagination.a1 a, -#xeAdmin .pagination.a1 strong{ margin:0 -4px; padding:1px 10px 1px 8px; border:none; border-left:1px solid #ccc; border-right:1px solid #ddd; font-weight:bold; font-size:12px; background:#fff;} -#xeAdmin .pagination.a1 a.prev{ padding-left:10px; background:#fff url(../img/arrowPrevA1.gif) no-repeat left center; } -#xeAdmin .pagination.a1 a.prevEnd{ padding-left:15px; background:#fff url(../img/arrowPrevEndA1.gif) no-repeat left center; } -#xeAdmin .pagination.a1 a.next{ padding-right:10px; background:#fff url(../img/arrowNextA1.gif) no-repeat right center; } -#xeAdmin .pagination.a1 a.nextEnd{ padding-right:15px; background:#fff url(../img/arrowNextEndA1.gif) no-repeat right center; } - -/* Pagination A2 */ -#xeAdmin .pagination.a2 a, -#xeAdmin .pagination.a2 strong{ margin:0 -4px; padding:0 10px 0 8px; font-weight:bold; font-size:11px; border:none; border-left:1px solid #ddd; border-right:1px solid #ccc; background:#fff; } -#xeAdmin .pagination.a2 a.prev{ padding-left:10px; background:#fff url(../img/arrowPrevA1.gif) no-repeat left center; } -#xeAdmin .pagination.a2 a.prevEnd{ padding-left:15px; background:#fff url(../img/arrowPrevEndA1.gif) no-repeat left center; } -#xeAdmin .pagination.a2 a.next{ padding-right:10px; background:#fff url(../img/arrowNextA1.gif) no-repeat right center; } -#xeAdmin .pagination.a2 a.nextEnd{ padding-right:15px; background:#fff url(../img/arrowNextEndA1.gif) no-repeat right center; } - -/* Pagination B1 */ -#xeAdmin .pagination.b1 a, -#xeAdmin .pagination.b1 strong{ margin:0 -2px; padding:2px 8px; font-weight:bold; font-size:12px;} -#xeAdmin .pagination.b1 a.prev, -#xeAdmin .pagination.b1 a.prevEnd{ padding-left:16px; background:url(../img/arrowPrevB1.gif) no-repeat left center; } -#xeAdmin .pagination.b1 a.next, -#xeAdmin .pagination.b1 a.nextEnd{ padding-right:16px; background:url(../img/arrowNextB1.gif) no-repeat right center; } - -/* Pagination B2 */ -#xeAdmin .pagination.b2 a, -#xeAdmin .pagination.b2 strong{ margin:0 -2px; padding:2px 6px; font-size:11px;} -#xeAdmin .pagination.b2 a.prev, -#xeAdmin .pagination.b2 a.prevEnd{ padding-left:12px; background:url(../img/arrowPrevB1.gif) no-repeat left center; } -#xeAdmin .pagination.b2 a.next, -#xeAdmin .pagination.b2 a.nextEnd{ padding-right:12px; background:url(../img/arrowNextB1.gif) no-repeat right center; } - -/* Pagination C1 */ -#xeAdmin .pagination.c1 a, -#xeAdmin .pagination.c1 strong{ margin:0 -2px; padding:2px 4px; font-size:12px;} -#xeAdmin .pagination.c1 a.prev, -#xeAdmin .pagination.c1 a.prevEnd, -#xeAdmin .pagination.c1 a.next, -#xeAdmin .pagination.c1 a.nextEnd{ display:inline-block; width:13px; height:14px; padding:3px 4px; margin:0;} -#xeAdmin .pagination.c1 a.prev, -#xeAdmin .pagination.c1 a.prevEnd{ background:url(../img/arrowPrevC1.gif) no-repeat center;} -#xeAdmin .pagination.c1 a.next, -#xeAdmin .pagination.c1 a.nextEnd{ background:url(../img/arrowNextC1.gif) no-repeat center;} -#xeAdmin .pagination.c1 a.prev span, -#xeAdmin .pagination.c1 a.prevEnd span, -#xeAdmin .pagination.c1 a.next span, -#xeAdmin .pagination.c1 a.nextEnd span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} - -/* Pagination C2 */ -#xeAdmin .pagination.c2 a, -#xeAdmin .pagination.c2 strong{ margin:0 -2px; padding:2px 4px; font-size:11px;} -#xeAdmin .pagination.c2 a.prev, -#xeAdmin .pagination.c2 a.prevEnd, -#xeAdmin .pagination.c2 a.next, -#xeAdmin .pagination.c2 a.nextEnd{ display:inline-block; width:13px; height:14px; padding:3px 4px; margin:0;} -#xeAdmin .pagination.c2 a.prev, -#xeAdmin .pagination.c2 a.prevEnd{ background:url(../img/arrowPrevC1.gif) no-repeat center;} -#xeAdmin .pagination.c2 a.next, -#xeAdmin .pagination.c2 a.nextEnd{ background:url(../img/arrowNextC1.gif) no-repeat center;} -#xeAdmin .pagination.c2 a.prev span, -#xeAdmin .pagination.c2 a.prevEnd span, -#xeAdmin .pagination.c2 a.next span, -#xeAdmin .pagination.c2 a.nextEnd span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} - - - - +@charset "utf-8"; +/* NHN (developers@xpressengine.com) */ + +/* Pagination Reset */ +#xeAdmin .pagination{ padding:15px 0; margin:0; text-align:center; clear:both; } +#xeAdmin .pagination *{ margin:0; padding:0;} +#xeAdmin .pagination img{ border:0;} +#xeAdmin .pagination a, +#xeAdmin .pagination strong{ position:relative; display:inline-block; text-decoration:none; line-height:normal; color:#333; font-family:Tahoma, Sans-serif; vertical-align:middle;} +#xeAdmin .pagination a:hover, +#xeAdmin .pagination a:active, +#xeAdmin .pagination a:focus{ background-color:#f4f4f4 !important; } +#xeAdmin .pagination strong{ color:#ff6600 !important;} +#xeAdmin .pagination a.prev, +#xeAdmin .pagination a.prevEnd, +#xeAdmin .pagination a.next, +#xeAdmin .pagination a.nextEnd{ font-weight:normal !important; border:none !important; margin:0 !important; white-space:nowrap; } + +/* Pagination A1 */ +#xeAdmin .pagination.a1 a, +#xeAdmin .pagination.a1 strong{ margin:0 -4px; padding:1px 10px 1px 8px; border:none; border-left:1px solid #ccc; border-right:1px solid #ddd; font-weight:bold; font-size:12px; background:#fff;} +#xeAdmin .pagination.a1 a.prev{ padding-left:10px; background:#fff url(../img/arrowPrevA1.gif) no-repeat left center; } +#xeAdmin .pagination.a1 a.prevEnd{ padding-left:15px; background:#fff url(../img/arrowPrevEndA1.gif) no-repeat left center; } +#xeAdmin .pagination.a1 a.next{ padding-right:10px; background:#fff url(../img/arrowNextA1.gif) no-repeat right center; } +#xeAdmin .pagination.a1 a.nextEnd{ padding-right:15px; background:#fff url(../img/arrowNextEndA1.gif) no-repeat right center; } + +/* Pagination A2 */ +#xeAdmin .pagination.a2 a, +#xeAdmin .pagination.a2 strong{ margin:0 -4px; padding:0 10px 0 8px; font-weight:bold; font-size:11px; border:none; border-left:1px solid #ddd; border-right:1px solid #ccc; background:#fff; } +#xeAdmin .pagination.a2 a.prev{ padding-left:10px; background:#fff url(../img/arrowPrevA1.gif) no-repeat left center; } +#xeAdmin .pagination.a2 a.prevEnd{ padding-left:15px; background:#fff url(../img/arrowPrevEndA1.gif) no-repeat left center; } +#xeAdmin .pagination.a2 a.next{ padding-right:10px; background:#fff url(../img/arrowNextA1.gif) no-repeat right center; } +#xeAdmin .pagination.a2 a.nextEnd{ padding-right:15px; background:#fff url(../img/arrowNextEndA1.gif) no-repeat right center; } + +/* Pagination B1 */ +#xeAdmin .pagination.b1 a, +#xeAdmin .pagination.b1 strong{ margin:0 -2px; padding:2px 8px; font-weight:bold; font-size:12px;} +#xeAdmin .pagination.b1 a.prev, +#xeAdmin .pagination.b1 a.prevEnd{ padding-left:16px; background:url(../img/arrowPrevB1.gif) no-repeat left center; } +#xeAdmin .pagination.b1 a.next, +#xeAdmin .pagination.b1 a.nextEnd{ padding-right:16px; background:url(../img/arrowNextB1.gif) no-repeat right center; } + +/* Pagination B2 */ +#xeAdmin .pagination.b2 a, +#xeAdmin .pagination.b2 strong{ margin:0 -2px; padding:2px 6px; font-size:11px;} +#xeAdmin .pagination.b2 a.prev, +#xeAdmin .pagination.b2 a.prevEnd{ padding-left:12px; background:url(../img/arrowPrevB1.gif) no-repeat left center; } +#xeAdmin .pagination.b2 a.next, +#xeAdmin .pagination.b2 a.nextEnd{ padding-right:12px; background:url(../img/arrowNextB1.gif) no-repeat right center; } + +/* Pagination C1 */ +#xeAdmin .pagination.c1 a, +#xeAdmin .pagination.c1 strong{ margin:0 -2px; padding:2px 4px; font-size:12px;} +#xeAdmin .pagination.c1 a.prev, +#xeAdmin .pagination.c1 a.prevEnd, +#xeAdmin .pagination.c1 a.next, +#xeAdmin .pagination.c1 a.nextEnd{ display:inline-block; width:13px; height:14px; padding:3px 4px; margin:0;} +#xeAdmin .pagination.c1 a.prev, +#xeAdmin .pagination.c1 a.prevEnd{ background:url(../img/arrowPrevC1.gif) no-repeat center;} +#xeAdmin .pagination.c1 a.next, +#xeAdmin .pagination.c1 a.nextEnd{ background:url(../img/arrowNextC1.gif) no-repeat center;} +#xeAdmin .pagination.c1 a.prev span, +#xeAdmin .pagination.c1 a.prevEnd span, +#xeAdmin .pagination.c1 a.next span, +#xeAdmin .pagination.c1 a.nextEnd span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} + +/* Pagination C2 */ +#xeAdmin .pagination.c2 a, +#xeAdmin .pagination.c2 strong{ margin:0 -2px; padding:2px 4px; font-size:11px;} +#xeAdmin .pagination.c2 a.prev, +#xeAdmin .pagination.c2 a.prevEnd, +#xeAdmin .pagination.c2 a.next, +#xeAdmin .pagination.c2 a.nextEnd{ display:inline-block; width:13px; height:14px; padding:3px 4px; margin:0;} +#xeAdmin .pagination.c2 a.prev, +#xeAdmin .pagination.c2 a.prevEnd{ background:url(../img/arrowPrevC1.gif) no-repeat center;} +#xeAdmin .pagination.c2 a.next, +#xeAdmin .pagination.c2 a.nextEnd{ background:url(../img/arrowNextC1.gif) no-repeat center;} +#xeAdmin .pagination.c2 a.prev span, +#xeAdmin .pagination.c2 a.prevEnd span, +#xeAdmin .pagination.c2 a.next span, +#xeAdmin .pagination.c2 a.nextEnd span{ position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} + + + + diff --git a/modules/admin/tpl/index.html b/modules/admin/tpl/index.html index 39108db6f..2cea55870 100644 --- a/modules/admin/tpl/index.html +++ b/modules/admin/tpl/index.html @@ -1,314 +1,314 @@ - - - - - - - - - -
- -
-

{$lang->admin_index}

-
- - - -
-
-

TODAY {date('Y.m.d')}

-
-
{$lang->today_visitor}
- -
- - - - - - - - - - - - - - {$status->visitor} - - - -
-
-
-
{$lang->today_comments}
-
- - - - - - - - - - - - - - {$status->comment->today} - - - -
-
-
-
{$lang->today_trackbacks}
-
- - - - - - - - - - - - - - {$status->trackback->today} - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - -
{$lang->member}{number_format($status->member->total)} (+{number_format($status->member->today)})
{$lang->document}{number_format($status->document->total)} (+{number_format($status->document->today)},-{number_format($status->documentDeclared->total)})
{$lang->comment}{number_format($status->comment->total)} (+{number_format($status->comment->today)},-{number_format($status->commentDeclared->total)})
{$lang->trackback}{number_format($status->trackback->total)} (+{number_format($status->trackback->today)})
{$lang->file}{number_format($status->file->total)} (+{number_format($status->file->today)})
-
-
- - - - - - - - - -
- - - -
- -

{$lang->counter} {date("Y.m.d")}

-
-
-
{$lang->yesterday}
-
{$lang->last_week}
-
{$lang->today}
-
{$lang->this_week}
- -
-
-
{$lang->today}
-
{number_format($status->visitor)}
-
{$lang->this_week}
-
{number_format($status->thisWeekSum)}
-
{$lang->total}
-
{number_format($status->total_visitor)}
-
-
- -
-
{$key}{$key}
-
{$lang->last_week}:{number_format($val->last)}
-
{$lang->this_week}:{number_format($val->this)}
- -
- -
-
-
- - -
-

{$lang->env_information} {$lang->cmd_setup}

- -

{nl2br($lang->about_download_link)} [{$lang->cmd_download}]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{$lang->current_version}
- {$current_version} [{$lang->cmd_view}] -
{$lang->current_path}
{$installed_path}/
{$lang->start_module}
{$start_module->browser_title}
{$lang->time_zone}
{substr($val,1,10)}
{$lang->use_rewrite}
{$lang->use}{$lang->notuse}
{$lang->use_sso}
{$lang->use}{$lang->notuse}
{$lang->mobile_view}
{$lang->use}{$lang->notuse}
Language
{$val}
{$lang->qmail_compatibility}
{$lang->use}{$lang->notuse}
{$lang->use_db_session}
{$lang->use}{$lang->notuse}
-
-
- -
-
-
- - -
-
- - {@$_show_modules = false; } - - - {@$_show_modules = true; } - - - -
- - - - - - - - - - - - - - -
{$lang->module}
{$val->title} ({$val->module}) - - {$lang->cmd_install} - - {$lang->cmd_update} - -   - -
-
- - - -
- - - - - - - - - - - - -
{$lang->newest_news}
{cut_str($val->title,36)}{zdate($val->date,"y-m-d")}
-
- - -
-
- -
- - - - - - - - - - - - - - - - - - - -
{$lang->addon}{$lang->cmd_setup}PCMobile
{cut_str($val->title,24)}{$lang->cmd_setup} - - {$lang->use} - - {$lang->notuse} - - - - {$lang->use} - - {$lang->notuse} - -
-
-
- - + + + + + + + + + +
+ +
+

{$lang->admin_index}

+
+ + + +
+
+

TODAY {date('Y.m.d')}

+
+
{$lang->today_visitor}
+ +
+ + + + + + + + + + + + + + {$status->visitor} + + + +
+
+
+
{$lang->today_comments}
+
+ + + + + + + + + + + + + + {$status->comment->today} + + + +
+
+
+
{$lang->today_trackbacks}
+
+ + + + + + + + + + + + + + {$status->trackback->today} + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + +
{$lang->member}{number_format($status->member->total)} (+{number_format($status->member->today)})
{$lang->document}{number_format($status->document->total)} (+{number_format($status->document->today)},-{number_format($status->documentDeclared->total)})
{$lang->comment}{number_format($status->comment->total)} (+{number_format($status->comment->today)},-{number_format($status->commentDeclared->total)})
{$lang->trackback}{number_format($status->trackback->total)} (+{number_format($status->trackback->today)})
{$lang->file}{number_format($status->file->total)} (+{number_format($status->file->today)})
+
+
+ + + + + + + + + +
+ + + +
+ +

{$lang->counter} {date("Y.m.d")}

+
+
+
{$lang->yesterday}
+
{$lang->last_week}
+
{$lang->today}
+
{$lang->this_week}
+ +
+
+
{$lang->today}
+
{number_format($status->visitor)}
+
{$lang->this_week}
+
{number_format($status->thisWeekSum)}
+
{$lang->total}
+
{number_format($status->total_visitor)}
+
+
+ +
+
{$key}{$key}
+
{$lang->last_week}:{number_format($val->last)}
+
{$lang->this_week}:{number_format($val->this)}
+ +
+ +
+
+
+ + +
+

{$lang->env_information} {$lang->cmd_setup}

+ +

{nl2br($lang->about_download_link)} [{$lang->cmd_download}]

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{$lang->current_version}
+ {$current_version} [{$lang->cmd_view}] +
{$lang->current_path}
{$installed_path}/
{$lang->start_module}
{$start_module->browser_title}
{$lang->time_zone}
{substr($val,1,10)}
{$lang->use_rewrite}
{$lang->use}{$lang->notuse}
{$lang->use_sso}
{$lang->use}{$lang->notuse}
{$lang->mobile_view}
{$lang->use}{$lang->notuse}
Language
{$val}
{$lang->qmail_compatibility}
{$lang->use}{$lang->notuse}
{$lang->use_db_session}
{$lang->use}{$lang->notuse}
+
+
+ +
+
+
+ + +
+
+ + {@$_show_modules = false; } + + + {@$_show_modules = true; } + + + +
+ + + + + + + + + + + + + + +
{$lang->module}
{$val->title} ({$val->module}) + + {$lang->cmd_install} + + {$lang->cmd_update} + +   + +
+
+ + + +
+ + + + + + + + + + + + +
{$lang->newest_news}
{cut_str($val->title,36)}{zdate($val->date,"y-m-d")}
+
+ + +
+
+ +
+ + + + + + + + + + + + + + + + + + + +
{$lang->addon}{$lang->cmd_setup}PCMobile
{cut_str($val->title,24)}{$lang->cmd_setup} + + {$lang->use} + + {$lang->notuse} + + + + {$lang->use} + + {$lang->notuse} + +
+
+
+ + diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 322232010..940112377 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -1,157 +1,157 @@ -/** - * @file admin.js - * @author NHN (developers@xpressengine.com) - * @brief admin 모듈의 javascript - **/ - -// 캐시파일 모두 재 생성 -function doRecompileCacheFile() { - exec_xml("admin","procAdminRecompileCacheFile", new Array(), completeMessage); -} - -// 모듈 목록 오픈 -function toggleModuleMenu(category) { - jQuery('#module_'+category).toggleClass('close'); - - var arr = new Array(); - jQuery('ul.navigation > li').each(function(){ - var o = jQuery(this); - if(!o.hasClass('close')) return; - var idx = o.attr('id').replace(/^module_/,''); - arr.push(idx); - }); - var expire= new Date(); - expire.setTime(expire.getTime()+(7000*24*3600000)); - xSetCookie('XEAM',arr.join(','),expire,'/'); -} - -// 메인 모듈/ 애드온 토글 -function toggleModuleAddon(target) { - var b = (target == 'module'); - - jQuery('#moduleOn').attr('class', b?'on':''); - jQuery('#addonOn').attr('class', b?'':'on'); - jQuery('#xeModules')[b?'show':'hide'](); - jQuery('#xeAddons')[b?'hide':'show'](); -} - -// toggle language list -function toggleAdminLang() { - jQuery('#adminLang').toggleClass('open'); -} - -// string to regex(초성검색용) -function str2regex(str) { - // control chars - str = str.replace(/([\[\]\{\}\(\)\*\-\+\!\?\^\|\\])/g, '\\$1'); - - // find consonants and replace it - str = str.replace(/[ㄱ-ㅎ]/g, function(c){ - var c_order = 'ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ'.indexOf(c); - var ch_first = String.fromCharCode(0xAC00 + c_order*21*28 + 0 + 0); - var ch_last = String.fromCharCode(0xAC00 + c_order*21*28 + 20*28 + 27); - - return '['+ch_first+'-'+ch_last+']'; - }); - - return new RegExp(str, 'ig'); -} - -jQuery(function($){ - // paint table rows - jQuery("table.rowTable tr").attr('class','').filter(":nth-child(even)").attr('class','bg1'); - - // set menu tooltip - taggon - $('ul.navigation:first > li').each(function(){ - var texts = []; - $(this).find('li').each(function(){ - texts.push($(this).text()); - }); - - if (!texts.length) return true; - - $(this).find('>a').qtip({ - content : texts.join(', '), - position : { - corner : { - target:'rightMiddle', - tooltip:'leftMiddle' - }, - adjust : { - x : -30 - } - }, - style : { - name : 'cream', - tip : true, - textAlign : 'center', - padding : 5, - border : { - radius : 2 - } - } - }); - }); - - // menu search - var nav = $('#search_nav + ul.navigation'); - var inp = $('#search_nav input[type=text]:first'); - var btn = $('#search_nav button:first'); - var result = $('
    '); - - if(inp.length == 0) return; - - nav.after( result.hide() ); - - inp.keydown(function(event){ - if (event.keyCode == 27) { // ESC - $(this).val(''); - if ($.browser.msie) $(this).keypress(); - } - }) - .watch_input({ - oninput : function() { - var str = $.trim( $(this).val() ); - - if (str.length == 0) { - nav.show(); - result.hide(); - btn.removeClass('close'); - return false; - } - - // remove all sub nodes - result.empty(); - - var regex = str2regex(str); - nav.find('li li > a').each(function(){ - var text = $(this).text(); - - if (regex.exec(text) != null) { - $(this).parent().clone().appendTo(result); - } - - // fix regular expression bug - regex.exec(''); - }); - - nav.hide(); - result.show(); - btn.addClass('close'); - } - }); - - // cancel search - btn.click(function(){ - if ($(this).hasClass('close')) { - $(this).removeClass('close'); - - inp.focus(); - inp.val(''); - inp.keydown(); - } - - return false; - }); - -}); +/** + * @file admin.js + * @author NHN (developers@xpressengine.com) + * @brief admin 모듈의 javascript + **/ + +// 캐시파일 모두 재 생성 +function doRecompileCacheFile() { + exec_xml("admin","procAdminRecompileCacheFile", new Array(), completeMessage); +} + +// 모듈 목록 오픈 +function toggleModuleMenu(category) { + jQuery('#module_'+category).toggleClass('close'); + + var arr = new Array(); + jQuery('ul.navigation > li').each(function(){ + var o = jQuery(this); + if(!o.hasClass('close')) return; + var idx = o.attr('id').replace(/^module_/,''); + arr.push(idx); + }); + var expire= new Date(); + expire.setTime(expire.getTime()+(7000*24*3600000)); + xSetCookie('XEAM',arr.join(','),expire,'/'); +} + +// 메인 모듈/ 애드온 토글 +function toggleModuleAddon(target) { + var b = (target == 'module'); + + jQuery('#moduleOn').attr('class', b?'on':''); + jQuery('#addonOn').attr('class', b?'':'on'); + jQuery('#xeModules')[b?'show':'hide'](); + jQuery('#xeAddons')[b?'hide':'show'](); +} + +// toggle language list +function toggleAdminLang() { + jQuery('#adminLang').toggleClass('open'); +} + +// string to regex(초성검색용) +function str2regex(str) { + // control chars + str = str.replace(/([\[\]\{\}\(\)\*\-\+\!\?\^\|\\])/g, '\\$1'); + + // find consonants and replace it + str = str.replace(/[ㄱ-ㅎ]/g, function(c){ + var c_order = 'ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ'.indexOf(c); + var ch_first = String.fromCharCode(0xAC00 + c_order*21*28 + 0 + 0); + var ch_last = String.fromCharCode(0xAC00 + c_order*21*28 + 20*28 + 27); + + return '['+ch_first+'-'+ch_last+']'; + }); + + return new RegExp(str, 'ig'); +} + +jQuery(function($){ + // paint table rows + jQuery("table.rowTable tr").attr('class','').filter(":nth-child(even)").attr('class','bg1'); + + // set menu tooltip - taggon + $('ul.navigation:first > li').each(function(){ + var texts = []; + $(this).find('li').each(function(){ + texts.push($(this).text()); + }); + + if (!texts.length) return true; + + $(this).find('>a').qtip({ + content : texts.join(', '), + position : { + corner : { + target:'rightMiddle', + tooltip:'leftMiddle' + }, + adjust : { + x : -30 + } + }, + style : { + name : 'cream', + tip : true, + textAlign : 'center', + padding : 5, + border : { + radius : 2 + } + } + }); + }); + + // menu search + var nav = $('#search_nav + ul.navigation'); + var inp = $('#search_nav input[type=text]:first'); + var btn = $('#search_nav button:first'); + var result = $('
      '); + + if(inp.length == 0) return; + + nav.after( result.hide() ); + + inp.keydown(function(event){ + if (event.keyCode == 27) { // ESC + $(this).val(''); + if ($.browser.msie) $(this).keypress(); + } + }) + .watch_input({ + oninput : function() { + var str = $.trim( $(this).val() ); + + if (str.length == 0) { + nav.show(); + result.hide(); + btn.removeClass('close'); + return false; + } + + // remove all sub nodes + result.empty(); + + var regex = str2regex(str); + nav.find('li li > a').each(function(){ + var text = $(this).text(); + + if (regex.exec(text) != null) { + $(this).parent().clone().appendTo(result); + } + + // fix regular expression bug + regex.exec(''); + }); + + nav.hide(); + result.show(); + btn.addClass('close'); + } + }); + + // cancel search + btn.click(function(){ + if ($(this).hasClass('close')) { + $(this).removeClass('close'); + + inp.focus(); + inp.val(''); + inp.keydown(); + } + + return false; + }); + +}); diff --git a/modules/admin/tpl/layout.html b/modules/admin/tpl/layout.html index 0873f9da2..91747e431 100644 --- a/modules/admin/tpl/layout.html +++ b/modules/admin/tpl/layout.html @@ -1,19 +1,19 @@ - - - - - + + + + + diff --git a/modules/autoinstall/autoinstall.admin.controller.php b/modules/autoinstall/autoinstall.admin.controller.php index 0a79006ff..7541ac768 100644 --- a/modules/autoinstall/autoinstall.admin.controller.php +++ b/modules/autoinstall/autoinstall.admin.controller.php @@ -1,243 +1,243 @@ -download_path); - } - - function procAutoinstallAdminUpdateinfo() - { - $oModel = &getModel('autoinstall'); - $item = $oModel->getLatestPackage(); - if($item) - { - $params["updatedate"] = $item->updatedate; - } - - $params["act"] = "getResourceapiUpdate"; - $body = XmlGenerater::generate($params); - $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); - $xml = new XmlParser(); - $xmlDoc = $xml->parse($buff); - $this->updateCategory($xmlDoc); - $this->updatePackages($xmlDoc); - $this->checkInstalled(); - - $this->setMessage("success_updated"); - } - - function checkInstalled() - { - executeQuery("autoinstall.deleteInstalledPackage"); - $oModel =& getModel('autoinstall'); - $packages = $oModel->getPackages(); - foreach($packages as $package) - { - $real_path = FileHandler::getRealPath($package->path); - if(!file_exists($real_path)) { - continue; - } - - $type = $oModel->getTypeFromPath($package->path); - if($type == "core") - { - $version = __ZBXE_VERSION__; - } - else - { - $config_file = null; - switch($type) - { - case "m.layout": - $type = "layout"; - case "module": - case "addon": - case "layout": - case "widget": - $config_file = "/conf/info.xml"; - break; - case "component": - $config_file = "/info.xml"; - break; - case "style": - case "m.skin": - $type = "skin"; - case "skin": - case "widgetstyle": - $config_file = "/skin.xml"; - break; - case "drcomponent": - $config_file = "/info.xml"; - $type = "component"; - break; - } - if(!$config_file) continue; - $xml = new XmlParser(); - $xmlDoc = $xml->loadXmlFile($real_path.$config_file); - if(!$xmlDoc) continue; - $version = $xmlDoc->{$type}->version->body; - } - - $args = null; - $args->package_srl = $package->package_srl; - $args->version = $package->version; - $args->current_version = $version; - if(version_compare($args->version, $args->current_version, ">")) - { - $args->need_update="Y"; - } - else - { - $args->need_update="N"; - } - - $output = executeQuery("autoinstall.insertInstalledPackage", $args); - } - } - - function procAutoinstallAdminPackageinstall() - { - @set_time_limit(0); - $package_srls = Context::get('package_srl'); - $oModel =& getModel('autoinstall'); - $packages = explode(',', $package_srls); - $ftp_info = Context::getFTPInfo(); - if(!$_SESSION['ftp_password']) - { - $ftp_password = Context::get('ftp_password'); - } - else - { - $ftp_password = $_SESSION['ftp_password']; - } - - foreach($packages as $package_srl) - { - $package = $oModel->getPackage($package_srl); - if($ftp_info->sftp && $ftp_info->sftp == 'Y') - { - $oModuleInstaller = new SFTPModuleInstaller($package); - } - else if(function_exists(ftp_connect)) - { - $oModuleInstaller = new PHPFTPModuleInstaller($package); - } - else - { - $oModuleInstaller = new FTPModuleInstaller($package); - } - - $oModuleInstaller->setPassword($ftp_password); - $output = $oModuleInstaller->install(); - if(!$output->toBool()) return $output; - } - $this->setMessage('success_installed'); - } - - function updatePackages(&$xmlDoc) - { - $oModel =& getModel('autoinstall'); - if(!$xmlDoc->response->packages->item) return; - if(!is_array($xmlDoc->response->packages->item)) - { - $xmlDoc->response->packages->item = array($xmlDoc->response->packages->item); - } - $targets = array('package_srl', 'updatedate', 'latest_item_srl', 'path', 'version', 'category_srl'); - foreach($xmlDoc->response->packages->item as $item) - { - $args = null; - foreach($targets as $target) - { - $args->{$target} = $item->{$target}->body; - } - if($oModel->getPackage($args->package_srl)) - { - $output = executeQuery("autoinstall.updatePackage", $args); - } - else - { - $output = executeQuery("autoinstall.insertPackage", $args); - if(!$output->toBool()) - { - $output = executeQuery("autoinstall.deletePackage", $args); - $output = executeQuery("autoinstall.insertPackage", $args); - } - } - } - } - - function updateCategory(&$xmlDoc) - { - executeQuery("autoinstall.deleteCategory", $args); - $oModel =& getModel('autoinstall'); - if(!is_array($xmlDoc->response->categorylist->item)) - { - $xmlDoc->response->categorylist->item = array($xmlDoc->response->categorylist->item); - } - foreach($xmlDoc->response->categorylist->item as $item) - { - $args = null; - $args->category_srl = $item->category_srl->body; - $args->parent_srl = $item->parent_srl->body; - $args->title = $item->title->body; - executeQuery("autoinstall.insertCategory", $args); - } - } - - function procAutoinstallAdminUninstallPackage() - { - $package_srl = Context::get('package_srl'); - $oModel =& getModel('autoinstall'); - $package = $oModel->getPackage($package_srl); - $path = $package->path; - - if(!$_SESSION['ftp_password']) - { - $ftp_password = Context::get('ftp_password'); - } - else - { - $ftp_password = $_SESSION['ftp_password']; - } - $ftp_info = Context::getFTPInfo(); - - if($ftp_info->sftp && $ftp_info->sftp == 'Y') - { - $oModuleInstaller = new SFTPModuleInstaller($package); - } - else if(function_exists(ftp_connect)) - { - $oModuleInstaller = new PHPFTPModuleInstaller($package); - } - else - { - $oModuleInstaller = new FTPModuleInstaller($package); - } - - $oModuleInstaller->setPassword($ftp_password); - $output = $oModuleInstaller->uninstall(); - if(!$output->toBool()) return $output; - - $this->setMessage('success_deleted'); - } - } -?> +download_path); + } + + function procAutoinstallAdminUpdateinfo() + { + $oModel = &getModel('autoinstall'); + $item = $oModel->getLatestPackage(); + if($item) + { + $params["updatedate"] = $item->updatedate; + } + + $params["act"] = "getResourceapiUpdate"; + $body = XmlGenerater::generate($params); + $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); + $xml = new XmlParser(); + $xmlDoc = $xml->parse($buff); + $this->updateCategory($xmlDoc); + $this->updatePackages($xmlDoc); + $this->checkInstalled(); + + $this->setMessage("success_updated"); + } + + function checkInstalled() + { + executeQuery("autoinstall.deleteInstalledPackage"); + $oModel =& getModel('autoinstall'); + $packages = $oModel->getPackages(); + foreach($packages as $package) + { + $real_path = FileHandler::getRealPath($package->path); + if(!file_exists($real_path)) { + continue; + } + + $type = $oModel->getTypeFromPath($package->path); + if($type == "core") + { + $version = __ZBXE_VERSION__; + } + else + { + $config_file = null; + switch($type) + { + case "m.layout": + $type = "layout"; + case "module": + case "addon": + case "layout": + case "widget": + $config_file = "/conf/info.xml"; + break; + case "component": + $config_file = "/info.xml"; + break; + case "style": + case "m.skin": + $type = "skin"; + case "skin": + case "widgetstyle": + $config_file = "/skin.xml"; + break; + case "drcomponent": + $config_file = "/info.xml"; + $type = "component"; + break; + } + if(!$config_file) continue; + $xml = new XmlParser(); + $xmlDoc = $xml->loadXmlFile($real_path.$config_file); + if(!$xmlDoc) continue; + $version = $xmlDoc->{$type}->version->body; + } + + $args = null; + $args->package_srl = $package->package_srl; + $args->version = $package->version; + $args->current_version = $version; + if(version_compare($args->version, $args->current_version, ">")) + { + $args->need_update="Y"; + } + else + { + $args->need_update="N"; + } + + $output = executeQuery("autoinstall.insertInstalledPackage", $args); + } + } + + function procAutoinstallAdminPackageinstall() + { + @set_time_limit(0); + $package_srls = Context::get('package_srl'); + $oModel =& getModel('autoinstall'); + $packages = explode(',', $package_srls); + $ftp_info = Context::getFTPInfo(); + if(!$_SESSION['ftp_password']) + { + $ftp_password = Context::get('ftp_password'); + } + else + { + $ftp_password = $_SESSION['ftp_password']; + } + + foreach($packages as $package_srl) + { + $package = $oModel->getPackage($package_srl); + if($ftp_info->sftp && $ftp_info->sftp == 'Y') + { + $oModuleInstaller = new SFTPModuleInstaller($package); + } + else if(function_exists(ftp_connect)) + { + $oModuleInstaller = new PHPFTPModuleInstaller($package); + } + else + { + $oModuleInstaller = new FTPModuleInstaller($package); + } + + $oModuleInstaller->setPassword($ftp_password); + $output = $oModuleInstaller->install(); + if(!$output->toBool()) return $output; + } + $this->setMessage('success_installed'); + } + + function updatePackages(&$xmlDoc) + { + $oModel =& getModel('autoinstall'); + if(!$xmlDoc->response->packages->item) return; + if(!is_array($xmlDoc->response->packages->item)) + { + $xmlDoc->response->packages->item = array($xmlDoc->response->packages->item); + } + $targets = array('package_srl', 'updatedate', 'latest_item_srl', 'path', 'version', 'category_srl'); + foreach($xmlDoc->response->packages->item as $item) + { + $args = null; + foreach($targets as $target) + { + $args->{$target} = $item->{$target}->body; + } + if($oModel->getPackage($args->package_srl)) + { + $output = executeQuery("autoinstall.updatePackage", $args); + } + else + { + $output = executeQuery("autoinstall.insertPackage", $args); + if(!$output->toBool()) + { + $output = executeQuery("autoinstall.deletePackage", $args); + $output = executeQuery("autoinstall.insertPackage", $args); + } + } + } + } + + function updateCategory(&$xmlDoc) + { + executeQuery("autoinstall.deleteCategory", $args); + $oModel =& getModel('autoinstall'); + if(!is_array($xmlDoc->response->categorylist->item)) + { + $xmlDoc->response->categorylist->item = array($xmlDoc->response->categorylist->item); + } + foreach($xmlDoc->response->categorylist->item as $item) + { + $args = null; + $args->category_srl = $item->category_srl->body; + $args->parent_srl = $item->parent_srl->body; + $args->title = $item->title->body; + executeQuery("autoinstall.insertCategory", $args); + } + } + + function procAutoinstallAdminUninstallPackage() + { + $package_srl = Context::get('package_srl'); + $oModel =& getModel('autoinstall'); + $package = $oModel->getPackage($package_srl); + $path = $package->path; + + if(!$_SESSION['ftp_password']) + { + $ftp_password = Context::get('ftp_password'); + } + else + { + $ftp_password = $_SESSION['ftp_password']; + } + $ftp_info = Context::getFTPInfo(); + + if($ftp_info->sftp && $ftp_info->sftp == 'Y') + { + $oModuleInstaller = new SFTPModuleInstaller($package); + } + else if(function_exists(ftp_connect)) + { + $oModuleInstaller = new PHPFTPModuleInstaller($package); + } + else + { + $oModuleInstaller = new FTPModuleInstaller($package); + } + + $oModuleInstaller->setPassword($ftp_password); + $output = $oModuleInstaller->uninstall(); + if(!$output->toBool()) return $output; + + $this->setMessage('success_deleted'); + } + } +?> diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index 9b594c560..2917987e7 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -1,319 +1,319 @@ -module_path); - Context::set('original_site', $this->original_site); - Context::set('uri', $this->uri); - $this->setTemplatePath($template_path); - - $ftp_info = Context::getFTPInfo(); - if(!$ftp_info->ftp_root_path) Context::set('show_ftp_note', true); - else $this->ftp_set = true; - - - $this->dispCategory(); - $oModel = &getModel('autoinstall'); - Context::set('tCount', $oModel->getPackageCount(null)); - Context::set('iCount', $oModel->getInstalledPackageCount()); - } - - function rearrange(&$item, &$targets) - { - $ret = null; - foreach($targets as $target) - { - $ret->{$target} = $item->{$target}->body; - } - return $ret; - } - - function rearranges($items, $packages = null) - { - if(!is_array($items)) $items = array($items); - $item_list = array(); - $targets = array('category_srl', 'package_srl', 'item_screenshot_url', 'package_voted', 'package_voter', 'package_description', 'package_downloaded', 'item_regdate', 'title', 'item_version', 'package_star', 'depfrom'); - $targetpackages = array(); - foreach($items as $item) - { - $targetpackages[$item->package_srl->body] = 0; - } - $oModel = &getModel('autoinstall'); - if($package == null) - $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); - $depto = array(); - foreach($items as $item) - { - $v = $this->rearrange($item, $targets); - if($packages[$v->package_srl]) - { - $v->current_version = $packages[$v->package_srl]->current_version; - $v->need_update = $packages[$v->package_srl]->need_update; - $v->type = $oModel->getTypeFromPath($packages[$v->package_srl]->path); - if($this->ftp_set && $v->depfrom) { - $depfrom = explode("," , $v->depfrom); - foreach($depfrom as $package_srl) - { - $depto[$package_srl][] = $v->package_srl; - } - } - if($v->type == "core") $v->avail_remove = false; - else if($v->type == "module") { - $v->avail_remove = $oModel->checkRemovable($packages[$v->package_srl]->path); - } - else $v->avail_remove = true; - } - $item_list[$v->package_srl] = $v; - } - - if(count($depto) > 0) - { - $installed = $oModel->getInstalledPackages(implode(",", array_keys($depto))); - foreach($installed as $key=>$val) - { - $path = $val->path; - $type = $oModel->getTypeFromPath($path); - if(!$type || $type == "core") continue; - $config_file = $oModel->getConfigFilePath($type); - if(!$config_file) continue; - - $xml = new XmlParser(); - $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path).$config_file); - if(!$xmlDoc) continue; - if($type == "drcomponent") $type = "component"; - if($type == "style" || $type == "m.skin") $type = "skin"; - if($type == "m.layout") $type = "layout"; - $title = $xmlDoc->{$type}->title->body; - $installed[$key]->title = $title; - } - Context::set('installed', $installed); - foreach($installed as $key=>$val) - { - foreach($depto[$key] as $package_srl) - { - $item_list[$package_srl]->avail_remove = false; - $item_list[$package_srl]->deps[] = $key; - } - } - } - - return $item_list; - } - - function dispAutoinstallAdminInstalledPackages() - { - $page = Context::get('page'); - if(!$page) $page = 1; - Context::set('page', $page); - $oModel = &getModel('autoinstall'); - $output = $oModel->getInstalledPackageList($page); - $package_list = $output->data; - - $params["act"] = "getResourceapiPackages"; - $params["package_srls"] = implode(",", array_keys($package_list)); - $body = XmlGenerater::generate($params); - $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); - $xml_lUpdate = new XmlParser(); - $xmlDoc = $xml_lUpdate->parse($buff); - if($xmlDoc && $xmlDoc->response->packagelist->item) - { - $item_list = $this->rearranges($xmlDoc->response->packagelist->item, $package_list); - $res = array(); - foreach($package_list as $package_srl => $package) - { - $res[] = $item_list[$package_srl]; - } - Context::set('item_list', $res); - } - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('index'); - } - - function dispAutoinstallAdminInstall() { - $package_srl = Context::get('package_srl'); - if(!$package_srl) return $this->dispAutoinstallAdminIndex(); - - $params["act"] = "getResourceapiInstallInfo"; - $params["package_srl"] = $package_srl; - $xmlDoc = XmlGenerater::getXmlDoc($params); - $oModel = &getModel('autoinstall'); - - $targetpackages = array(); - if($xmlDoc) - { - $xmlPackage =& $xmlDoc->response->package; - $package->package_srl = $xmlPackage->package_srl->body; - $package->title = $xmlPackage->title->body; - $package->package_description = $xmlPackage->package_description->body; - $package->version = $xmlPackage->version->body; - $package->path = $xmlPackage->path->body; - if($xmlPackage->depends) - { - if(!is_array($xmlPackage->depends->item)) $xmlPackage->depends->item = array($xmlPackage->depends->item); - $package->depends = array(); - foreach($xmlPackage->depends->item as $item) - { - $dep_item = null; - $dep_item->package_srl = $item->package_srl->body; - $dep_item->title = $item->title->body; - $dep_item->version = $item->version->body; - $dep_item->path = $item->path->body; - $package->depends[] = $dep_item; - $targetpackages[$dep_item->package_srl] = 1; - } - $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); - $package->deplist = ""; - foreach($package->depends as $key => $dep) - { - if(!$packages[$dep->package_srl]) { - $package->depends[$key]->installed = false; - $package->package_srl .= ",". $dep->package_srl; - } - else { - $package->depends[$key]->installed = true; - $package->depends[$key]->cur_version = $packages[$dep->package_srl]->current_version; - if(version_compare($dep->version, $packages[$dep->package_srl]->current_version, ">")) - { - $package->depends[$key]->need_update = true; - $package->package_srl .= ",". $dep->package_srl; - } - else - { - $package->need_update = false; - } - } - } - } - $installedPackage = $oModel->getInstalledPackage($package_srl); - if($installedPackage) { - $package->installed = true; - $package->cur_version = $installedPackage->current_version; - $package->need_update = version_compare($package->version, $installedPackage->current_version, ">"); - } - - Context::set("package", $package); - } - if(!$_SESSION['ftp_password']) - { - Context::set('need_password', true); - } - $this->setTemplateFile('install'); - } - - function dispAutoinstallAdminIndex() { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('autoinstall'); - $ftp_info = Context::getFTPInfo(); - if(!$ftp_info->ftp_root_path) Context::set('show_ftp_note', true); - - $this->setTemplateFile('index'); - - $params = array(); - $params["act"] = "getResourceapiLastupdate"; - $body = XmlGenerater::generate($params); - $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); - $xml_lUpdate = new XmlParser(); - $lUpdateDoc = $xml_lUpdate->parse($buff); - $updateDate = $lUpdateDoc->response->updatedate->body; - - $oModel = &getModel('autoinstall'); - $item = $oModel->getLatestPackage(); - if(!$item || $item->updatedate < $updateDate || count($this->categories) < 1) - { - Context::set('need_update', true); - return; - } - - - $page = Context::get('page'); - if(!$page) $page = 1; - Context::set('page', $page); - - $order_type = Context::get('order_type'); - if(!in_array($order_type, array('asc', 'desc'))) $order_type = 'desc'; - Context::set('order_type', $order_type); - - $order_target = Context::get('order_target'); - if(!in_array($order_target, array('newest', 'download', 'popular'))) $order_target = 'newest'; - Context::set('order_target', $order_target); - - $search_keyword = Context::get('search_keyword'); - - $childrenList = Context::get('childrenList'); - $category_srl = Context::get('category_srl'); - if($childrenList) $params["category_srl"] = $childrenList; - else if($category_srl) $params["category_srl"] = $category_srl; - - $params["act"] = "getResourceapiPackagelist"; - $params["order_target"] = $order_target; - $params["order_type"] = $order_type; - $params["page"] = $page; - if($search_keyword) - { - $params["search_keyword"] = $search_keyword; - } - $xmlDoc = XmlGenerater::getXmlDoc($params); - if($xmlDoc && $xmlDoc->response->packagelist->item) - { - $item_list = $this->rearranges($xmlDoc->response->packagelist->item); - Context::set('item_list', $item_list); - $array = array('total_count', 'total_page', 'cur_page', 'page_count', 'first_page', 'last_page'); - $page_nav = $this->rearrange($xmlDoc->response->page_navigation, $array); - $page_navigation = new PageHandler($page_nav->total_count, $page_nav->total_page, $page_nav->cur_page, $page_nav->page_count); - Context::set('page_navigation', $page_navigation); - } - - } - - function dispCategory() - { - $oModel = &getModel('autoinstall'); - $this->categories = &$oModel->getCategoryList(); - Context::set('categories', $this->categories); - } - - function dispAutoinstallAdminUninstall() - { - $package_srl = Context::get('package_srl'); - if(!$package_srl) return $this->dispAutoinstallAdminIndex(); - $oModel =& getModel('autoinstall'); - $installedPackage = $oModel->getInstalledPackage($package_srl); - if(!$installedPackage) return $this->dispAutoinstallAdminInstalledPackages(); - - if(!$_SESSION['ftp_password']) - { - Context::set('need_password', true); - } - $installedPackage = $oModel->getPackage($package_srl); - $path = $installedPackage->path; - $type = $oModel->getTypeFromPath($path); - if(!$type || $type == "core") $this->stop("msg_invalid_request"); - $config_file = $oModel->getConfigFilePath($type); - if(!$config_file) $this->stop("msg_invalid_request"); - - $xml = new XmlParser(); - $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path).$config_file); - if(!$xmlDoc) $this->stop("msg_invalid_request"); - if($type == "drcomponent") $type = "component"; - if($type == "style") $type = "skin"; - $title = $xmlDoc->{$type}->title->body; - $installedPackage->title = $title; - $installedPackage->type = $type; - Context::set('package', $installedPackage); - - $this->setTemplateFile('uninstall'); - Context::addJsFilter($this->module_path.'tpl/filter', 'uninstall_package.xml'); - } - } -?> +module_path); + Context::set('original_site', $this->original_site); + Context::set('uri', $this->uri); + $this->setTemplatePath($template_path); + + $ftp_info = Context::getFTPInfo(); + if(!$ftp_info->ftp_root_path) Context::set('show_ftp_note', true); + else $this->ftp_set = true; + + + $this->dispCategory(); + $oModel = &getModel('autoinstall'); + Context::set('tCount', $oModel->getPackageCount(null)); + Context::set('iCount', $oModel->getInstalledPackageCount()); + } + + function rearrange(&$item, &$targets) + { + $ret = null; + foreach($targets as $target) + { + $ret->{$target} = $item->{$target}->body; + } + return $ret; + } + + function rearranges($items, $packages = null) + { + if(!is_array($items)) $items = array($items); + $item_list = array(); + $targets = array('category_srl', 'package_srl', 'item_screenshot_url', 'package_voted', 'package_voter', 'package_description', 'package_downloaded', 'item_regdate', 'title', 'item_version', 'package_star', 'depfrom'); + $targetpackages = array(); + foreach($items as $item) + { + $targetpackages[$item->package_srl->body] = 0; + } + $oModel = &getModel('autoinstall'); + if($package == null) + $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); + $depto = array(); + foreach($items as $item) + { + $v = $this->rearrange($item, $targets); + if($packages[$v->package_srl]) + { + $v->current_version = $packages[$v->package_srl]->current_version; + $v->need_update = $packages[$v->package_srl]->need_update; + $v->type = $oModel->getTypeFromPath($packages[$v->package_srl]->path); + if($this->ftp_set && $v->depfrom) { + $depfrom = explode("," , $v->depfrom); + foreach($depfrom as $package_srl) + { + $depto[$package_srl][] = $v->package_srl; + } + } + if($v->type == "core") $v->avail_remove = false; + else if($v->type == "module") { + $v->avail_remove = $oModel->checkRemovable($packages[$v->package_srl]->path); + } + else $v->avail_remove = true; + } + $item_list[$v->package_srl] = $v; + } + + if(count($depto) > 0) + { + $installed = $oModel->getInstalledPackages(implode(",", array_keys($depto))); + foreach($installed as $key=>$val) + { + $path = $val->path; + $type = $oModel->getTypeFromPath($path); + if(!$type || $type == "core") continue; + $config_file = $oModel->getConfigFilePath($type); + if(!$config_file) continue; + + $xml = new XmlParser(); + $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path).$config_file); + if(!$xmlDoc) continue; + if($type == "drcomponent") $type = "component"; + if($type == "style" || $type == "m.skin") $type = "skin"; + if($type == "m.layout") $type = "layout"; + $title = $xmlDoc->{$type}->title->body; + $installed[$key]->title = $title; + } + Context::set('installed', $installed); + foreach($installed as $key=>$val) + { + foreach($depto[$key] as $package_srl) + { + $item_list[$package_srl]->avail_remove = false; + $item_list[$package_srl]->deps[] = $key; + } + } + } + + return $item_list; + } + + function dispAutoinstallAdminInstalledPackages() + { + $page = Context::get('page'); + if(!$page) $page = 1; + Context::set('page', $page); + $oModel = &getModel('autoinstall'); + $output = $oModel->getInstalledPackageList($page); + $package_list = $output->data; + + $params["act"] = "getResourceapiPackages"; + $params["package_srls"] = implode(",", array_keys($package_list)); + $body = XmlGenerater::generate($params); + $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); + $xml_lUpdate = new XmlParser(); + $xmlDoc = $xml_lUpdate->parse($buff); + if($xmlDoc && $xmlDoc->response->packagelist->item) + { + $item_list = $this->rearranges($xmlDoc->response->packagelist->item, $package_list); + $res = array(); + foreach($package_list as $package_srl => $package) + { + $res[] = $item_list[$package_srl]; + } + Context::set('item_list', $res); + } + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('index'); + } + + function dispAutoinstallAdminInstall() { + $package_srl = Context::get('package_srl'); + if(!$package_srl) return $this->dispAutoinstallAdminIndex(); + + $params["act"] = "getResourceapiInstallInfo"; + $params["package_srl"] = $package_srl; + $xmlDoc = XmlGenerater::getXmlDoc($params); + $oModel = &getModel('autoinstall'); + + $targetpackages = array(); + if($xmlDoc) + { + $xmlPackage =& $xmlDoc->response->package; + $package->package_srl = $xmlPackage->package_srl->body; + $package->title = $xmlPackage->title->body; + $package->package_description = $xmlPackage->package_description->body; + $package->version = $xmlPackage->version->body; + $package->path = $xmlPackage->path->body; + if($xmlPackage->depends) + { + if(!is_array($xmlPackage->depends->item)) $xmlPackage->depends->item = array($xmlPackage->depends->item); + $package->depends = array(); + foreach($xmlPackage->depends->item as $item) + { + $dep_item = null; + $dep_item->package_srl = $item->package_srl->body; + $dep_item->title = $item->title->body; + $dep_item->version = $item->version->body; + $dep_item->path = $item->path->body; + $package->depends[] = $dep_item; + $targetpackages[$dep_item->package_srl] = 1; + } + $packages = $oModel->getInstalledPackages(array_keys($targetpackages)); + $package->deplist = ""; + foreach($package->depends as $key => $dep) + { + if(!$packages[$dep->package_srl]) { + $package->depends[$key]->installed = false; + $package->package_srl .= ",". $dep->package_srl; + } + else { + $package->depends[$key]->installed = true; + $package->depends[$key]->cur_version = $packages[$dep->package_srl]->current_version; + if(version_compare($dep->version, $packages[$dep->package_srl]->current_version, ">")) + { + $package->depends[$key]->need_update = true; + $package->package_srl .= ",". $dep->package_srl; + } + else + { + $package->need_update = false; + } + } + } + } + $installedPackage = $oModel->getInstalledPackage($package_srl); + if($installedPackage) { + $package->installed = true; + $package->cur_version = $installedPackage->current_version; + $package->need_update = version_compare($package->version, $installedPackage->current_version, ">"); + } + + Context::set("package", $package); + } + if(!$_SESSION['ftp_password']) + { + Context::set('need_password', true); + } + $this->setTemplateFile('install'); + } + + function dispAutoinstallAdminIndex() { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('autoinstall'); + $ftp_info = Context::getFTPInfo(); + if(!$ftp_info->ftp_root_path) Context::set('show_ftp_note', true); + + $this->setTemplateFile('index'); + + $params = array(); + $params["act"] = "getResourceapiLastupdate"; + $body = XmlGenerater::generate($params); + $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); + $xml_lUpdate = new XmlParser(); + $lUpdateDoc = $xml_lUpdate->parse($buff); + $updateDate = $lUpdateDoc->response->updatedate->body; + + $oModel = &getModel('autoinstall'); + $item = $oModel->getLatestPackage(); + if(!$item || $item->updatedate < $updateDate || count($this->categories) < 1) + { + Context::set('need_update', true); + return; + } + + + $page = Context::get('page'); + if(!$page) $page = 1; + Context::set('page', $page); + + $order_type = Context::get('order_type'); + if(!in_array($order_type, array('asc', 'desc'))) $order_type = 'desc'; + Context::set('order_type', $order_type); + + $order_target = Context::get('order_target'); + if(!in_array($order_target, array('newest', 'download', 'popular'))) $order_target = 'newest'; + Context::set('order_target', $order_target); + + $search_keyword = Context::get('search_keyword'); + + $childrenList = Context::get('childrenList'); + $category_srl = Context::get('category_srl'); + if($childrenList) $params["category_srl"] = $childrenList; + else if($category_srl) $params["category_srl"] = $category_srl; + + $params["act"] = "getResourceapiPackagelist"; + $params["order_target"] = $order_target; + $params["order_type"] = $order_type; + $params["page"] = $page; + if($search_keyword) + { + $params["search_keyword"] = $search_keyword; + } + $xmlDoc = XmlGenerater::getXmlDoc($params); + if($xmlDoc && $xmlDoc->response->packagelist->item) + { + $item_list = $this->rearranges($xmlDoc->response->packagelist->item); + Context::set('item_list', $item_list); + $array = array('total_count', 'total_page', 'cur_page', 'page_count', 'first_page', 'last_page'); + $page_nav = $this->rearrange($xmlDoc->response->page_navigation, $array); + $page_navigation = new PageHandler($page_nav->total_count, $page_nav->total_page, $page_nav->cur_page, $page_nav->page_count); + Context::set('page_navigation', $page_navigation); + } + + } + + function dispCategory() + { + $oModel = &getModel('autoinstall'); + $this->categories = &$oModel->getCategoryList(); + Context::set('categories', $this->categories); + } + + function dispAutoinstallAdminUninstall() + { + $package_srl = Context::get('package_srl'); + if(!$package_srl) return $this->dispAutoinstallAdminIndex(); + $oModel =& getModel('autoinstall'); + $installedPackage = $oModel->getInstalledPackage($package_srl); + if(!$installedPackage) return $this->dispAutoinstallAdminInstalledPackages(); + + if(!$_SESSION['ftp_password']) + { + Context::set('need_password', true); + } + $installedPackage = $oModel->getPackage($package_srl); + $path = $installedPackage->path; + $type = $oModel->getTypeFromPath($path); + if(!$type || $type == "core") $this->stop("msg_invalid_request"); + $config_file = $oModel->getConfigFilePath($type); + if(!$config_file) $this->stop("msg_invalid_request"); + + $xml = new XmlParser(); + $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path).$config_file); + if(!$xmlDoc) $this->stop("msg_invalid_request"); + if($type == "drcomponent") $type = "component"; + if($type == "style") $type = "skin"; + $title = $xmlDoc->{$type}->title->body; + $installedPackage->title = $title; + $installedPackage->type = $type; + Context::set('package', $installedPackage); + + $this->setTemplateFile('uninstall'); + Context::addJsFilter($this->module_path.'tpl/filter', 'uninstall_package.xml'); + } + } +?> diff --git a/modules/autoinstall/autoinstall.class.php b/modules/autoinstall/autoinstall.class.php index a253e3719..5fc257d1c 100644 --- a/modules/autoinstall/autoinstall.class.php +++ b/modules/autoinstall/autoinstall.class.php @@ -1,87 +1,87 @@ -'; - if(!is_array($params)) return null; - $params["module"] = "resourceapi"; - foreach($params as $key => $val) - { - $xmlDoc .= sprintf("<%s>", $key, $val, $key); - } - $xmlDoc .= ""; - return $xmlDoc; - } - - function getXmlDoc(&$params) - { - $body = XmlGenerater::generate($params); - $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); - if(!$buff) return; - $xml = new XmlParser(); - $xmlDoc = $xml->parse($buff); - return $xmlDoc; - } - } - - class autoinstall extends ModuleObject { - var $uri = "http://download.xpressengine.com/"; - var $original_site = "http://www.xpressengine.com/"; - var $tmp_dir = './files/cache/autoinstall/'; - - /** - * @brief 설치시 추가 작업이 필요할시 구현 - **/ - function moduleInstall() { - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oDB =& DB::getInstance(); - if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_installed_packages.xml")) - && $oDB->isTableExists("autoinstall_installed_packages")) - { - return true; - } - if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_remote_categories.xml")) - && $oDB->isTableExists("autoinstall_remote_categories")) - { - return true; - } - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB =& DB::getInstance(); - if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_installed_packages.xml")) - && $oDB->isTableExists("autoinstall_installed_packages")) - { - $oDB->dropTable("autoinstall_installed_packages"); - } - if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_remote_categories.xml")) - && $oDB->isTableExists("autoinstall_remote_categories")) - { - $oDB->dropTable("autoinstall_remote_categories"); - } - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - } - } -?> +'; + if(!is_array($params)) return null; + $params["module"] = "resourceapi"; + foreach($params as $key => $val) + { + $xmlDoc .= sprintf("<%s>", $key, $val, $key); + } + $xmlDoc .= ""; + return $xmlDoc; + } + + function getXmlDoc(&$params) + { + $body = XmlGenerater::generate($params); + $buff = FileHandler::getRemoteResource($this->uri, $body, 3, "POST", "application/xml"); + if(!$buff) return; + $xml = new XmlParser(); + $xmlDoc = $xml->parse($buff); + return $xmlDoc; + } + } + + class autoinstall extends ModuleObject { + var $uri = "http://download.xpressengine.com/"; + var $original_site = "http://www.xpressengine.com/"; + var $tmp_dir = './files/cache/autoinstall/'; + + /** + * @brief 설치시 추가 작업이 필요할시 구현 + **/ + function moduleInstall() { + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oDB =& DB::getInstance(); + if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_installed_packages.xml")) + && $oDB->isTableExists("autoinstall_installed_packages")) + { + return true; + } + if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_remote_categories.xml")) + && $oDB->isTableExists("autoinstall_remote_categories")) + { + return true; + } + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB =& DB::getInstance(); + if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_installed_packages.xml")) + && $oDB->isTableExists("autoinstall_installed_packages")) + { + $oDB->dropTable("autoinstall_installed_packages"); + } + if(!file_exists(FileHandler::getRealPath("./modules/autoinstall/schemas/autoinstall_remote_categories.xml")) + && $oDB->isTableExists("autoinstall_remote_categories")) + { + $oDB->dropTable("autoinstall_remote_categories"); + } + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + } + } +?> diff --git a/modules/autoinstall/autoinstall.model.php b/modules/autoinstall/autoinstall.model.php index 3a001ca47..8813d98b3 100644 --- a/modules/autoinstall/autoinstall.model.php +++ b/modules/autoinstall/autoinstall.model.php @@ -1,185 +1,185 @@ -category_srl = $category_srl; - $output = executeQueryArray("autoinstall.getCategory", $args); - if(!$output->data) return null; - return array_shift($output->data); - } - - function getPackages() - { - $output = executeQueryArray("autoinstall.getPackages"); - if(!$output->data) return array(); - return $output->data; - } - - function getInstalledPackage($package_srl) - { - $args->package_srl = $package_srl; - $output = executeQueryArray("autoinstall.getInstalledPackage", $args); - if(!$output->data) return null; - return array_shift($output->data); - } - - function getPackage($package_srl) - { - $args->package_srl = $package_srl; - $output = executeQueryArray("autoinstall.getPackage", $args); - if(!$output->data) return null; - return array_shift($output->data); - } - - function getCategoryList() - { - $output = executeQueryArray("autoinstall.getCategories"); - if(!$output->toBool() || !$output->data) return array(); - - $categoryList = array(); - foreach($output->data as $category) - { - $category->children = array(); - $categoryList[$category->category_srl] = $category; - } - - $depth0 = array(); - foreach($categoryList as $key => $category) - { - if($category->parent_srl) - { - $categoryList[$category->parent_srl]->children[] =& $categoryList[$key]; - } - else - { - $depth0[] = $key; - } - } - $resultList = array(); - foreach($depth0 as $category_srl) - { - $this->setDepth($categoryList[$category_srl], 0, $categoryList, $resultList); - } - return $resultList; - } - - function getPackageCount($category_srl) - { - $args->category_srl = $category_srl; - $output = executeQuery("autoinstall.getPackageCount", $args); - if(!$output->data) return 0; - return $output->data->count; - } - - function getInstalledPackageCount() - { - $output = executeQuery("autoinstall.getInstalledPackageCount", $args); - if(!$output->data) return 0; - return $output->data->count; - } - - function setDepth(&$item, $depth, &$list, &$resultList) - { - $resultList[$item->category_srl] =& $item; - $item->depth = $depth; - $siblingList = $item->category_srl; - foreach($item->children as $child) - { - $siblingList .= ",".$this->setDepth($list[$child->category_srl], $depth+1, $list, $resultList); - } - if(count($item->children) < 1) - { - $item->nPackages = $this->getPackageCount($item->category_srl); - } - $item->childrenList = $siblingList; - return $siblingList; - } - - function getLatestPackage() { - $output = executeQueryArray("autoinstall.getLatestPackage"); - if(!$output->data) return null; - return array_shift($output->data); - } - - function getInstalledPackages($package_list) { - $args->package_list = $package_list; - $output = executeQueryArray("autoinstall.getInstalledPackages", $args); - $result = array(); - if(!$output->data) return $result; - foreach($output->data as $value) - { - $result[$value->package_srl] = $value; - } - return $result; - } - - function getInstalledPackageList($page) - { - $args->page = $page; - $output = executeQueryArray("autoinstall.getInstalledPackageList", $args); - $res = array(); - foreach($output->data as $val) - { - $res[$val->package_srl] = $val; - } - $output->data = $res; - return $output; - } - - function getTypeFromPath($path) - { - if(!$path) return null; - if($path == ".") return "core"; - $path_array = explode("/", $path); - $target_name = array_pop($path_array); - $type = substr(array_pop($path_array), 0, -1); - return $type; - } - - function getConfigFilePath($type) - { - $config_file = null; - switch($type) - { - case "m.layout": - case "module": - case "addon": - case "layout": - case "widget": - $config_file = "/conf/info.xml"; - break; - case "component": - $config_file = "/info.xml"; - break; - case "m.skin": - case "skin": - case "widgetstyle": - case "style": - $config_file = "/skin.xml"; - break; - case "drcomponent": - $config_file = "/info.xml"; - break; - } - return $config_file; - } - - function checkRemovable($path) - { - $path_array = explode("/", $path); - $target_name = array_pop($path_array); - $oModule =& getModule($target_name, "class"); - if(!$oModule) return false; - if(method_exists($oModule, "moduleUninstall")) return true; - else return false; - } - - } -?> +category_srl = $category_srl; + $output = executeQueryArray("autoinstall.getCategory", $args); + if(!$output->data) return null; + return array_shift($output->data); + } + + function getPackages() + { + $output = executeQueryArray("autoinstall.getPackages"); + if(!$output->data) return array(); + return $output->data; + } + + function getInstalledPackage($package_srl) + { + $args->package_srl = $package_srl; + $output = executeQueryArray("autoinstall.getInstalledPackage", $args); + if(!$output->data) return null; + return array_shift($output->data); + } + + function getPackage($package_srl) + { + $args->package_srl = $package_srl; + $output = executeQueryArray("autoinstall.getPackage", $args); + if(!$output->data) return null; + return array_shift($output->data); + } + + function getCategoryList() + { + $output = executeQueryArray("autoinstall.getCategories"); + if(!$output->toBool() || !$output->data) return array(); + + $categoryList = array(); + foreach($output->data as $category) + { + $category->children = array(); + $categoryList[$category->category_srl] = $category; + } + + $depth0 = array(); + foreach($categoryList as $key => $category) + { + if($category->parent_srl) + { + $categoryList[$category->parent_srl]->children[] =& $categoryList[$key]; + } + else + { + $depth0[] = $key; + } + } + $resultList = array(); + foreach($depth0 as $category_srl) + { + $this->setDepth($categoryList[$category_srl], 0, $categoryList, $resultList); + } + return $resultList; + } + + function getPackageCount($category_srl) + { + $args->category_srl = $category_srl; + $output = executeQuery("autoinstall.getPackageCount", $args); + if(!$output->data) return 0; + return $output->data->count; + } + + function getInstalledPackageCount() + { + $output = executeQuery("autoinstall.getInstalledPackageCount", $args); + if(!$output->data) return 0; + return $output->data->count; + } + + function setDepth(&$item, $depth, &$list, &$resultList) + { + $resultList[$item->category_srl] =& $item; + $item->depth = $depth; + $siblingList = $item->category_srl; + foreach($item->children as $child) + { + $siblingList .= ",".$this->setDepth($list[$child->category_srl], $depth+1, $list, $resultList); + } + if(count($item->children) < 1) + { + $item->nPackages = $this->getPackageCount($item->category_srl); + } + $item->childrenList = $siblingList; + return $siblingList; + } + + function getLatestPackage() { + $output = executeQueryArray("autoinstall.getLatestPackage"); + if(!$output->data) return null; + return array_shift($output->data); + } + + function getInstalledPackages($package_list) { + $args->package_list = $package_list; + $output = executeQueryArray("autoinstall.getInstalledPackages", $args); + $result = array(); + if(!$output->data) return $result; + foreach($output->data as $value) + { + $result[$value->package_srl] = $value; + } + return $result; + } + + function getInstalledPackageList($page) + { + $args->page = $page; + $output = executeQueryArray("autoinstall.getInstalledPackageList", $args); + $res = array(); + foreach($output->data as $val) + { + $res[$val->package_srl] = $val; + } + $output->data = $res; + return $output; + } + + function getTypeFromPath($path) + { + if(!$path) return null; + if($path == ".") return "core"; + $path_array = explode("/", $path); + $target_name = array_pop($path_array); + $type = substr(array_pop($path_array), 0, -1); + return $type; + } + + function getConfigFilePath($type) + { + $config_file = null; + switch($type) + { + case "m.layout": + case "module": + case "addon": + case "layout": + case "widget": + $config_file = "/conf/info.xml"; + break; + case "component": + $config_file = "/info.xml"; + break; + case "m.skin": + case "skin": + case "widgetstyle": + case "style": + $config_file = "/skin.xml"; + break; + case "drcomponent": + $config_file = "/info.xml"; + break; + } + return $config_file; + } + + function checkRemovable($path) + { + $path_array = explode("/", $path); + $target_name = array_pop($path_array); + $oModule =& getModule($target_name, "class"); + if(!$oModule) return false; + if(method_exists($oModule, "moduleUninstall")) return true; + else return false; + } + + } +?> diff --git a/modules/autoinstall/autoinstall.view.php b/modules/autoinstall/autoinstall.view.php index a925b30a8..6aa3830a7 100644 --- a/modules/autoinstall/autoinstall.view.php +++ b/modules/autoinstall/autoinstall.view.php @@ -1,26 +1,26 @@ -install($file, $checksum); - return $output; - } - } -?> +install($file, $checksum); + return $output; + } + } +?> diff --git a/modules/autoinstall/conf/info.xml b/modules/autoinstall/conf/info.xml index bdddf4b8f..25e8b6521 100644 --- a/modules/autoinstall/conf/info.xml +++ b/modules/autoinstall/conf/info.xml @@ -1,30 +1,30 @@ - - - 쉬운 설치 - EasyInstaller - Cài đặt tự động - 自動安裝 - 安装·更新 - イージーインストール - KolayKurulum - 관리자 모드에서 클릭으로 모듈/스킨/레이아웃/위젯/위젯스타일 등을 설치하는 모듈입니다. - With this module, you can install and upgrade your programs including modules, skins, layouts, etc., from www.xpressengine.com by one-click. - Với Module này, bạn có thể cập nhật và cài đặt các phiên bản một cách tự động. Bao gồm Module, Layout, Widget, Addon, ... từ trang chủ XE bằng một bấm chuột. - 可以藉由此模組安裝、更新程式包括模組、面板、版面等。 - Bu modül ile modüller, dış görünümler, yerleşim düzenleri.. gibi kendi programlarınızı, www.xpressengine.com adresinden tek bir tık ile kurup-düzenleyebilirsiniz. - 很方便的在线安装/更新XE相关模块(模块/皮肤/布局/控件/控件样式等)。 - 管理者モードにてクリックだけで、モジュール/スキン/レイアウト/ウィジェット/ウィジェットスタイルのインストールを可能にするモジュールです。 - Bu modülle; modüller, dış görünümler, yerleşim düzenleri vs. gibi programlarınızı www.xpressengine.com adresinden tek tıkla kurabilir ve sürümlerini yükseltebilirsiniz. - 0.3 - 2009-11-11 - system - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 쉬운 설치 + EasyInstaller + Cài đặt tự động + 自動安裝 + 安装·更新 + イージーインストール + KolayKurulum + 관리자 모드에서 클릭으로 모듈/스킨/레이아웃/위젯/위젯스타일 등을 설치하는 모듈입니다. + With this module, you can install and upgrade your programs including modules, skins, layouts, etc., from www.xpressengine.com by one-click. + Với Module này, bạn có thể cập nhật và cài đặt các phiên bản một cách tự động. Bao gồm Module, Layout, Widget, Addon, ... từ trang chủ XE bằng một bấm chuột. + 可以藉由此模組安裝、更新程式包括模組、面板、版面等。 + Bu modül ile modüller, dış görünümler, yerleşim düzenleri.. gibi kendi programlarınızı, www.xpressengine.com adresinden tek bir tık ile kurup-düzenleyebilirsiniz. + 很方便的在线安装/更新XE相关模块(模块/皮肤/布局/控件/控件样式等)。 + 管理者モードにてクリックだけで、モジュール/スキン/レイアウト/ウィジェット/ウィジェットスタイルのインストールを可能にするモジュールです。 + Bu modülle; modüller, dış görünümler, yerleşim düzenleri vs. gibi programlarınızı www.xpressengine.com adresinden tek tıkla kurabilir ve sürümlerini yükseltebilirsiniz. + 0.3 + 2009-11-11 + system + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/autoinstall/lang/en.lang.php b/modules/autoinstall/lang/en.lang.php index 128114de0..356e5e787 100644 --- a/modules/autoinstall/lang/en.lang.php +++ b/modules/autoinstall/lang/en.lang.php @@ -1,35 +1,35 @@ -autoinstall = 'EasyInstall'; - $lang->about_autoinstall = 'EasyInstall module will help you install/upgrade programs(skins) for XE.'; - $lang->package_update = 'Recent Update'; - $lang->package_downloaded_count = 'Download Count'; - $lang->need_update = "Please update package list first."; - - $lang->order_newest = "Newest"; - $lang->order_popular = "Popular"; - $lang->order_download = "Download"; - $lang->success_installed = "Successfully Installed"; - $lang->view_all_package = "View All"; - $lang->description_ftp_note = "If FTP configuration is not set, installation would not work. Please configure FTP information"; - $lang->description_update = "If you have upgraded or installed programs without EasyInstall module, please press update button to renew new information."; - $lang->install = "Install"; - $lang->update = "Update"; - $lang->current_version = "Version"; - $lang->depending_programs = "This program is depending on "; - $lang->require_update = "Update is required."; - $lang->require_installation = "Installation is required."; - $lang->description_install = "EasyInstall will also install/update all other programs which this program is depending on"; - $lang->description_download = "If FTP is unavailable, you should manually download it and extract it into target path. (if target path is ./modules/board, extract it at ./modules)"; - $lang->path = "Path"; - $lang->cmd_download = "Download"; - $lang->view_installed_packages = "Installed Packages"; - $lang->msg_ftp_password_input = "Please input FTP password."; - $lang->dependant_list = "Dependant package list of current package"; - $lang->description_uninstall = "Package will be uninstalled. For modules, all data will be deleted."; -?> +autoinstall = 'EasyInstall'; + $lang->about_autoinstall = 'EasyInstall module will help you install/upgrade programs(skins) for XE.'; + $lang->package_update = 'Recent Update'; + $lang->package_downloaded_count = 'Download Count'; + $lang->need_update = "Please update package list first."; + + $lang->order_newest = "Newest"; + $lang->order_popular = "Popular"; + $lang->order_download = "Download"; + $lang->success_installed = "Successfully Installed"; + $lang->view_all_package = "View All"; + $lang->description_ftp_note = "If FTP configuration is not set, installation would not work. Please configure FTP information"; + $lang->description_update = "If you have upgraded or installed programs without EasyInstall module, please press update button to renew new information."; + $lang->install = "Install"; + $lang->update = "Update"; + $lang->current_version = "Version"; + $lang->depending_programs = "This program is depending on "; + $lang->require_update = "Update is required."; + $lang->require_installation = "Installation is required."; + $lang->description_install = "EasyInstall will also install/update all other programs which this program is depending on"; + $lang->description_download = "If FTP is unavailable, you should manually download it and extract it into target path. (if target path is ./modules/board, extract it at ./modules)"; + $lang->path = "Path"; + $lang->cmd_download = "Download"; + $lang->view_installed_packages = "Installed Packages"; + $lang->msg_ftp_password_input = "Please input FTP password."; + $lang->dependant_list = "Dependant package list of current package"; + $lang->description_uninstall = "Package will be uninstalled. For modules, all data will be deleted."; +?> diff --git a/modules/autoinstall/lang/jp.lang.php b/modules/autoinstall/lang/jp.lang.php index 0dfc76b35..8abab4e3f 100644 --- a/modules/autoinstall/lang/jp.lang.php +++ b/modules/autoinstall/lang/jp.lang.php @@ -1,35 +1,35 @@ -autoinstall = 'イージーインストール'; - $lang->about_autoinstall = 'XpressEngineの様々なプログラムを管理者画面上で簡単にインストール・アップグレードするモジュールです。'; - $lang->package_update = '最新アップデート'; - $lang->package_downloaded_count = '全体ダウンロード'; - $lang->need_update = "アップデートが必要です。"; - - $lang->order_newest = "新規登録"; - $lang->order_popular = "人気"; - $lang->order_download = "ダウンロード"; - $lang->success_installed = "インストールが成功しました。"; - $lang->view_all_package = "全てをみる"; - $lang->description_ftp_note = "FTP設定が完了されないと、イージーインストールが動作しません。 FTP設定を確認して下さい。"; - $lang->description_update = "新しくインストールしたモジュールバージョン情報などは「アップデート」を押すと反映されます。"; - $lang->install = "インストール"; - $lang->update = "アップデート"; - $lang->current_version = "現インストールバージョン"; - $lang->depending_programs = "依存プログラム"; - $lang->require_update = "アップデートが必要です。"; - $lang->require_installation = "インストールが必要です。"; - $lang->description_install = "インストールに進みますと、本プログラムが依存している全てのプログラムをアップデート/インストールします。"; - $lang->description_download = "FTPの利用が出来ない場合は、直接ダウンロードし、サーバー上の該当パスにてインストールして下さい。 (一つ上階層にて解凍します。 ./modules/board の場合 ./modulesにて tarを解凍して下さい。)"; - $lang->path = "インストールパス"; - $lang->cmd_download = "ダウンロード"; - $lang->view_installed_packages = "インストールされたパッケージ"; - $lang->msg_ftp_password_input = "FTPパスワードを入力して下さい。"; - $lang->dependant_list = "このパッケージに依存するパッケージのリスト"; - $lang->description_uninstall = "パッケージを削除します。モジュールの場合、すべてのデータを失います。"; -?> +autoinstall = 'イージーインストール'; + $lang->about_autoinstall = 'XpressEngineの様々なプログラムを管理者画面上で簡単にインストール・アップグレードするモジュールです。'; + $lang->package_update = '最新アップデート'; + $lang->package_downloaded_count = '全体ダウンロード'; + $lang->need_update = "アップデートが必要です。"; + + $lang->order_newest = "新規登録"; + $lang->order_popular = "人気"; + $lang->order_download = "ダウンロード"; + $lang->success_installed = "インストールが成功しました。"; + $lang->view_all_package = "全てをみる"; + $lang->description_ftp_note = "FTP設定が完了されないと、イージーインストールが動作しません。 FTP設定を確認して下さい。"; + $lang->description_update = "新しくインストールしたモジュールバージョン情報などは「アップデート」を押すと反映されます。"; + $lang->install = "インストール"; + $lang->update = "アップデート"; + $lang->current_version = "現インストールバージョン"; + $lang->depending_programs = "依存プログラム"; + $lang->require_update = "アップデートが必要です。"; + $lang->require_installation = "インストールが必要です。"; + $lang->description_install = "インストールに進みますと、本プログラムが依存している全てのプログラムをアップデート/インストールします。"; + $lang->description_download = "FTPの利用が出来ない場合は、直接ダウンロードし、サーバー上の該当パスにてインストールして下さい。 (一つ上階層にて解凍します。 ./modules/board の場合 ./modulesにて tarを解凍して下さい。)"; + $lang->path = "インストールパス"; + $lang->cmd_download = "ダウンロード"; + $lang->view_installed_packages = "インストールされたパッケージ"; + $lang->msg_ftp_password_input = "FTPパスワードを入力して下さい。"; + $lang->dependant_list = "このパッケージに依存するパッケージのリスト"; + $lang->description_uninstall = "パッケージを削除します。モジュールの場合、すべてのデータを失います。"; +?> diff --git a/modules/autoinstall/lang/ko.lang.php b/modules/autoinstall/lang/ko.lang.php index 197eb0a66..ec59e7ca5 100644 --- a/modules/autoinstall/lang/ko.lang.php +++ b/modules/autoinstall/lang/ko.lang.php @@ -1,35 +1,35 @@ -autoinstall = '쉬운 설치'; - $lang->about_autoinstall = 'XpressEngine의 여러 프로그램을 쉽게 설치/업그레이드할 수 있도록 도와주는 모듈입니다.'; - $lang->package_update = '최근 업데이트'; - $lang->package_downloaded_count = '전체 다운로드'; - $lang->need_update = "업데이트가 필요합니다."; - - $lang->order_newest = "신규 등록"; - $lang->order_popular = "인기"; - $lang->order_download = "다운로드"; - $lang->success_installed = "설치가 성공하였습니다."; - $lang->view_all_package = "전체 보기"; - $lang->description_ftp_note = "FTP 설정이 안되어있으면 설치가 진행되지 않습니다. FTP설정을 해주세요"; - $lang->description_update = "새로 설치한 모듈의 버전 정보등은 업데이트를 눌러주시면 반영됩니다."; - $lang->install = "설치"; - $lang->update = "업데이트"; - $lang->current_version = "현재 설치 버전"; - $lang->depending_programs = "의존하고 있는 프로그램"; - $lang->require_update = "업데이트가 필요합니다."; - $lang->require_installation = "설치가 필요합니다."; - $lang->description_install = "설치를 진행하면, 이 프로그램이 의존하고 있는 모든 프로그램을 업데이트/설치 합니다."; - $lang->description_download = "FTP를 이용할 수 없는 경우, 직접 다운로드 하여 해당 path에 설치하셔야 합니다. (한칸 상위에서 압축을 푸시면 됩니다. ./modules/board의 경우 ./modules에서 tar를 푸세요)"; - $lang->path = "설치경로"; - $lang->cmd_download = "다운로드"; - $lang->view_installed_packages = "설치된 패키지"; - $lang->msg_ftp_password_input = "FTP 비밀번호를 입력해주세요"; - $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; - $lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다."; -?> +autoinstall = '쉬운 설치'; + $lang->about_autoinstall = 'XpressEngine의 여러 프로그램을 쉽게 설치/업그레이드할 수 있도록 도와주는 모듈입니다.'; + $lang->package_update = '최근 업데이트'; + $lang->package_downloaded_count = '전체 다운로드'; + $lang->need_update = "업데이트가 필요합니다."; + + $lang->order_newest = "신규 등록"; + $lang->order_popular = "인기"; + $lang->order_download = "다운로드"; + $lang->success_installed = "설치가 성공하였습니다."; + $lang->view_all_package = "전체 보기"; + $lang->description_ftp_note = "FTP 설정이 안되어있으면 설치가 진행되지 않습니다. FTP설정을 해주세요"; + $lang->description_update = "새로 설치한 모듈의 버전 정보등은 업데이트를 눌러주시면 반영됩니다."; + $lang->install = "설치"; + $lang->update = "업데이트"; + $lang->current_version = "현재 설치 버전"; + $lang->depending_programs = "의존하고 있는 프로그램"; + $lang->require_update = "업데이트가 필요합니다."; + $lang->require_installation = "설치가 필요합니다."; + $lang->description_install = "설치를 진행하면, 이 프로그램이 의존하고 있는 모든 프로그램을 업데이트/설치 합니다."; + $lang->description_download = "FTP를 이용할 수 없는 경우, 직접 다운로드 하여 해당 path에 설치하셔야 합니다. (한칸 상위에서 압축을 푸시면 됩니다. ./modules/board의 경우 ./modules에서 tar를 푸세요)"; + $lang->path = "설치경로"; + $lang->cmd_download = "다운로드"; + $lang->view_installed_packages = "설치된 패키지"; + $lang->msg_ftp_password_input = "FTP 비밀번호를 입력해주세요"; + $lang->dependant_list = "이 패키지에 의존하는 패키지 목록"; + $lang->description_uninstall = "패키지를 삭제합니다. 모듈의 경우 모든 데이터가 사라집니다."; +?> diff --git a/modules/autoinstall/lang/ru.lang.php b/modules/autoinstall/lang/ru.lang.php index 0a15c9cdb..c80d3900e 100644 --- a/modules/autoinstall/lang/ru.lang.php +++ b/modules/autoinstall/lang/ru.lang.php @@ -1,35 +1,35 @@ -autoinstall = 'EasyInstall'; - $lang->about_autoinstall = 'EasyInstall module will help you install/upgrade programs(skins) for XE.'; - $lang->package_update = 'Recent Update'; - $lang->package_downloaded_count = 'Download Count'; - $lang->need_update = 'Please update package list first.'; - - $lang->order_newest = 'Ӭ'; - $lang->order_popular = 'ݬ߬'; - $lang->order_download = 'ܬѬѬ'; - $lang->success_installed = 'Ѭ߬Ӭݬ֬߬ ֬߬'; - $lang->view_all_package = 'ܬѬ٬Ѭ Ӭ'; - $lang->description_ftp_note = 'If FTP configuration is not set, installation would not work. Please configure FTP information'; - $lang->description_update = 'If you have upgraded or installed programs without EasyInstall module, please press update button to renew new information'; - $lang->install = '߬ѬݬݬڬӬѬ'; - $lang->update = 'Ҭ߬Ӭڬ'; - $lang->current_version = 'Version'; - $lang->depending_programs = 'This program is depending on'; - $lang->require_update = 'Update is required'; - $lang->require_installation = 'Installation is required'; - $lang->description_install = 'EasyInstall will also install/update all other programs which this program is depending on'; - $lang->description_download = 'If FTP is unavailable, you should manually download it and extract it into target path. (if target path is ./modules/board, extract it at ./modules)'; - $lang->path = 'Path'; - $lang->cmd_download = 'Download'; - $lang->view_installed_packages = 'Installed Packages'; - $lang->msg_ftp_password_input = 'Please input FTP password'; - $lang->dependant_list = " Ű ϴ Ű "; - $lang->description_uninstall = "Ű մϴ. Ͱ ϴ."; -?> +autoinstall = 'EasyInstall'; + $lang->about_autoinstall = 'EasyInstall module will help you install/upgrade programs(skins) for XE.'; + $lang->package_update = 'Recent Update'; + $lang->package_downloaded_count = 'Download Count'; + $lang->need_update = 'Please update package list first.'; + + $lang->order_newest = 'Ӭ'; + $lang->order_popular = 'ݬ߬'; + $lang->order_download = 'ܬѬѬ'; + $lang->success_installed = 'Ѭ߬Ӭݬ֬߬ ֬߬'; + $lang->view_all_package = 'ܬѬ٬Ѭ Ӭ'; + $lang->description_ftp_note = 'If FTP configuration is not set, installation would not work. Please configure FTP information'; + $lang->description_update = 'If you have upgraded or installed programs without EasyInstall module, please press update button to renew new information'; + $lang->install = '߬ѬݬݬڬӬѬ'; + $lang->update = 'Ҭ߬Ӭڬ'; + $lang->current_version = 'Version'; + $lang->depending_programs = 'This program is depending on'; + $lang->require_update = 'Update is required'; + $lang->require_installation = 'Installation is required'; + $lang->description_install = 'EasyInstall will also install/update all other programs which this program is depending on'; + $lang->description_download = 'If FTP is unavailable, you should manually download it and extract it into target path. (if target path is ./modules/board, extract it at ./modules)'; + $lang->path = 'Path'; + $lang->cmd_download = 'Download'; + $lang->view_installed_packages = 'Installed Packages'; + $lang->msg_ftp_password_input = 'Please input FTP password'; + $lang->dependant_list = " Ű ϴ Ű "; + $lang->description_uninstall = "Ű մϴ. Ͱ ϴ."; +?> diff --git a/modules/autoinstall/lang/tr.lang.php b/modules/autoinstall/lang/tr.lang.php index ceaeb7009..b3590a1a2 100644 --- a/modules/autoinstall/lang/tr.lang.php +++ b/modules/autoinstall/lang/tr.lang.php @@ -1,35 +1,35 @@ -autoinstall = 'KolayKurulum'; - $lang->about_autoinstall = 'KolayKurulum modülü size programların(dış görünüm), XE\'ye kurulumunda ve sürüm yükseltmesinde yardımcı olacaktır.'; - $lang->package_update = 'Son Güncellemeler'; - $lang->package_downloaded_count = 'İndirme Sayısı'; - $lang->need_update = "Lütfen önce paket listesini güncelleyiniz."; - - $lang->order_newest = "En Yeniler"; - $lang->order_popular = "Popüler"; - $lang->order_download = "İndirme"; - $lang->success_installed = "Başarıyla Kuruldu"; - $lang->view_all_package = "Tümünü Göster"; - $lang->description_ftp_note = "Eğer FTP düzeni ayarlanmadıysa, kurulum çalışmayacaktır.Lütfen FTP bilgisini yapılandırınız."; - $lang->description_update = "Eğer KolayKurulum modülünü kullanmadan programları kurduysanız ya da güncelleştirdiyseniz, lütfen yeni bilgiyi uyarlamak için güncelleştir tuşuna basınız."; - $lang->install = "Kurulum"; - $lang->update = "Güncelle"; - $lang->current_version = "Sürüm"; - $lang->depending_programs = "Bu program için aşağıdaki program(lar) gereklidir : "; - $lang->require_update = "Güncelleme gerekmektedir."; - $lang->require_installation = "Kurulum gerekmektedir."; - $lang->description_install = "KolayKurulum, bu program için gerekli olan tüm diğer programları kurup/güncelleştirecektir."; - $lang->description_download = "Eğer FTP kullanılamaz durumduysa, indirmeyi kendiniz yapmanız ve dosyaları hedef dizine çıkartmanız gerekmektedir. (eğer hedef yol ./modules/board ise, çıkarma işlemini ./modules yoluna yapınız)"; - $lang->path = "Yol"; - $lang->cmd_download = "İndirme"; - $lang->view_installed_packages = "Kurulmuş Paketler"; - $lang->msg_ftp_password_input = "Lütfen FTP şifresini giriniz."; - $lang->dependant_list = "Mevcut pakete bağlı paket listesi"; - $lang->description_uninstall = "Paket kaldırılacaktır. Modüller için, tüm veriler silinecektir."; -?> +autoinstall = 'KolayKurulum'; + $lang->about_autoinstall = 'KolayKurulum modülü size programların(dış görünüm), XE\'ye kurulumunda ve sürüm yükseltmesinde yardımcı olacaktır.'; + $lang->package_update = 'Son Güncellemeler'; + $lang->package_downloaded_count = 'İndirme Sayısı'; + $lang->need_update = "Lütfen önce paket listesini güncelleyiniz."; + + $lang->order_newest = "En Yeniler"; + $lang->order_popular = "Popüler"; + $lang->order_download = "İndirme"; + $lang->success_installed = "Başarıyla Kuruldu"; + $lang->view_all_package = "Tümünü Göster"; + $lang->description_ftp_note = "Eğer FTP düzeni ayarlanmadıysa, kurulum çalışmayacaktır.Lütfen FTP bilgisini yapılandırınız."; + $lang->description_update = "Eğer KolayKurulum modülünü kullanmadan programları kurduysanız ya da güncelleştirdiyseniz, lütfen yeni bilgiyi uyarlamak için güncelleştir tuşuna basınız."; + $lang->install = "Kurulum"; + $lang->update = "Güncelle"; + $lang->current_version = "Sürüm"; + $lang->depending_programs = "Bu program için aşağıdaki program(lar) gereklidir : "; + $lang->require_update = "Güncelleme gerekmektedir."; + $lang->require_installation = "Kurulum gerekmektedir."; + $lang->description_install = "KolayKurulum, bu program için gerekli olan tüm diğer programları kurup/güncelleştirecektir."; + $lang->description_download = "Eğer FTP kullanılamaz durumduysa, indirmeyi kendiniz yapmanız ve dosyaları hedef dizine çıkartmanız gerekmektedir. (eğer hedef yol ./modules/board ise, çıkarma işlemini ./modules yoluna yapınız)"; + $lang->path = "Yol"; + $lang->cmd_download = "İndirme"; + $lang->view_installed_packages = "Kurulmuş Paketler"; + $lang->msg_ftp_password_input = "Lütfen FTP şifresini giriniz."; + $lang->dependant_list = "Mevcut pakete bağlı paket listesi"; + $lang->description_uninstall = "Paket kaldırılacaktır. Modüller için, tüm veriler silinecektir."; +?> diff --git a/modules/autoinstall/lang/vi.lang.php b/modules/autoinstall/lang/vi.lang.php index 643dac247..c7cad465a 100644 --- a/modules/autoinstall/lang/vi.lang.php +++ b/modules/autoinstall/lang/vi.lang.php @@ -1,35 +1,35 @@ -autoinstall = 'Cập nhật tự động'; - $lang->about_autoinstall = 'Nó sẽ giúp bạn Cài đặt / Nâng cấp phiên bản tự động từ trang chủ XE.'; - $lang->package_update = 'Cập nhật'; - $lang->package_downloaded_count = 'Lượt Download'; - $lang->need_update = "Danh sách phiên bản cần cập nhật."; - - $lang->order_newest = "Mới nhất"; - $lang->order_popular = "Phổ biến"; - $lang->order_download = "Download"; - $lang->success_installed = "Đã cài đặt thành công."; - $lang->view_all_package = "Xem tất cả"; - $lang->description_ftp_note = "Nếu bạn chưa thiết lập FTP, sẽ không thể cài đặt đặt hay cập nhật. Xin hãy thiết lập thông tin FTP."; - $lang->description_update = "Nếu bạn cập nhật hay cài đặt mà không sử dụng chương trình cập nhật tự động, xin hãy bấm 'Cập nhật' tại trang quản lý để giữ lại thông tin đã cập nhật của chương trình."; - $lang->install = "Cài đặt"; - $lang->update = "Cập nhật"; - $lang->current_version = "Phiên bản đang dùng"; - $lang->depending_programs = "Chương trình này phụ thuộc vào "; - $lang->require_update = "Yêu cầu cập nhật."; - $lang->require_installation = "Yêu cầu cài đặt."; - $lang->description_install = "Quá trình Cài đặt / Cập nhật này phụ thuộc vào "; - $lang->description_download = "Khi FTP không được mở, bạn nên tải về và giả nén, sau đó Upload theo đường dẫn. (Nếu đường dẫn là ./modules/board, thì giải nén vào ./modules)"; - $lang->path = "Đường dẫn"; - $lang->cmd_download = "Download"; - $lang->view_installed_packages = "Những gói đã cài đặt"; - $lang->msg_ftp_password_input = "Hãy nhập mật khẩu của FTP."; - $lang->dependant_list = "Gói cài đặt này phụ thuộc vào các gói khác trong danh sách"; - $lang->description_uninstall = "Loại bỏ gói cài đặt. Tất cả dữ liệu của các gói sẽ đồng thời bị xóa."; -?> +autoinstall = 'Cập nhật tự động'; + $lang->about_autoinstall = 'Nó sẽ giúp bạn Cài đặt / Nâng cấp phiên bản tự động từ trang chủ XE.'; + $lang->package_update = 'Cập nhật'; + $lang->package_downloaded_count = 'Lượt Download'; + $lang->need_update = "Danh sách phiên bản cần cập nhật."; + + $lang->order_newest = "Mới nhất"; + $lang->order_popular = "Phổ biến"; + $lang->order_download = "Download"; + $lang->success_installed = "Đã cài đặt thành công."; + $lang->view_all_package = "Xem tất cả"; + $lang->description_ftp_note = "Nếu bạn chưa thiết lập FTP, sẽ không thể cài đặt đặt hay cập nhật. Xin hãy thiết lập thông tin FTP."; + $lang->description_update = "Nếu bạn cập nhật hay cài đặt mà không sử dụng chương trình cập nhật tự động, xin hãy bấm 'Cập nhật' tại trang quản lý để giữ lại thông tin đã cập nhật của chương trình."; + $lang->install = "Cài đặt"; + $lang->update = "Cập nhật"; + $lang->current_version = "Phiên bản đang dùng"; + $lang->depending_programs = "Chương trình này phụ thuộc vào "; + $lang->require_update = "Yêu cầu cập nhật."; + $lang->require_installation = "Yêu cầu cài đặt."; + $lang->description_install = "Quá trình Cài đặt / Cập nhật này phụ thuộc vào "; + $lang->description_download = "Khi FTP không được mở, bạn nên tải về và giả nén, sau đó Upload theo đường dẫn. (Nếu đường dẫn là ./modules/board, thì giải nén vào ./modules)"; + $lang->path = "Đường dẫn"; + $lang->cmd_download = "Download"; + $lang->view_installed_packages = "Những gói đã cài đặt"; + $lang->msg_ftp_password_input = "Hãy nhập mật khẩu của FTP."; + $lang->dependant_list = "Gói cài đặt này phụ thuộc vào các gói khác trong danh sách"; + $lang->description_uninstall = "Loại bỏ gói cài đặt. Tất cả dữ liệu của các gói sẽ đồng thời bị xóa."; +?> diff --git a/modules/autoinstall/lang/zh-CN.lang.php b/modules/autoinstall/lang/zh-CN.lang.php index 87b3d94bd..3a7bde60f 100644 --- a/modules/autoinstall/lang/zh-CN.lang.php +++ b/modules/autoinstall/lang/zh-CN.lang.php @@ -1,35 +1,35 @@ -autoinstall = '安装·更新'; - $lang->about_autoinstall = 'Autoinstall是XpressEngine的在线安装/更新模块。'; - $lang->package_update = '最新更新'; - $lang->package_downloaded_count = '总下载'; - $lang->need_update = "有新的更新。"; - - $lang->order_newest = "最新发布"; - $lang->order_popular = "热门"; - $lang->order_download = "下载"; - $lang->success_installed = "安装成功!"; - $lang->view_all_package = "查看全部"; - $lang->description_ftp_note = "请务必完成FTP设置,否则将无法在线安装(更新)相关模块。"; - $lang->description_update = "新安装(更新)模块的版本信息,点击Update按钮后才能正常显示。"; - $lang->install = "安装"; - $lang->update = "更新"; - $lang->current_version = "现用版本"; - $lang->depending_programs = "联动插件/控件"; - $lang->require_update = "需要更新"; - $lang->require_installation = "需要安装"; - $lang->description_install = "安装时,与其联动的插件/控件也会同时被安装(更新)。"; - $lang->description_download = "无法使用FTP时,需得自行下载安装到指定路径。"; - $lang->path = "安装路径"; - $lang->cmd_download = "下载"; - $lang->view_installed_packages = "已安装的数据包"; - $lang->msg_ftp_password_input = "请输入FTP密码。"; - $lang->dependant_list = "联动数据包列表"; - $lang->description_uninstall = "确定要删除此数据包吗?如果此数据包为模块,模块中的数据将会全部消失。"; -?> +autoinstall = '安装·更新'; + $lang->about_autoinstall = 'Autoinstall是XpressEngine的在线安装/更新模块。'; + $lang->package_update = '最新更新'; + $lang->package_downloaded_count = '总下载'; + $lang->need_update = "有新的更新。"; + + $lang->order_newest = "最新发布"; + $lang->order_popular = "热门"; + $lang->order_download = "下载"; + $lang->success_installed = "安装成功!"; + $lang->view_all_package = "查看全部"; + $lang->description_ftp_note = "请务必完成FTP设置,否则将无法在线安装(更新)相关模块。"; + $lang->description_update = "新安装(更新)模块的版本信息,点击Update按钮后才能正常显示。"; + $lang->install = "安装"; + $lang->update = "更新"; + $lang->current_version = "现用版本"; + $lang->depending_programs = "联动插件/控件"; + $lang->require_update = "需要更新"; + $lang->require_installation = "需要安装"; + $lang->description_install = "安装时,与其联动的插件/控件也会同时被安装(更新)。"; + $lang->description_download = "无法使用FTP时,需得自行下载安装到指定路径。"; + $lang->path = "安装路径"; + $lang->cmd_download = "下载"; + $lang->view_installed_packages = "已安装的数据包"; + $lang->msg_ftp_password_input = "请输入FTP密码。"; + $lang->dependant_list = "联动数据包列表"; + $lang->description_uninstall = "确定要删除此数据包吗?如果此数据包为模块,模块中的数据将会全部消失。"; +?> diff --git a/modules/autoinstall/lang/zh-TW.lang.php b/modules/autoinstall/lang/zh-TW.lang.php index 00b23e5d0..208226a06 100644 --- a/modules/autoinstall/lang/zh-TW.lang.php +++ b/modules/autoinstall/lang/zh-TW.lang.php @@ -1,35 +1,35 @@ -autoinstall = '自動安裝'; - $lang->about_autoinstall = '可幫助您安裝及更新 XE 程式和面板。'; - $lang->package_update = '最近更新'; - $lang->package_downloaded_count = '下載次數'; - $lang->need_update = "需要更新。"; - - $lang->order_newest = "最新發表"; - $lang->order_popular = "熱門"; - $lang->order_download = "下載"; - $lang->success_installed = "安裝成功"; - $lang->view_all_package = "全部檢視"; - $lang->description_ftp_note = "請先將 FTP 設定好,否則無法執行自動安裝功能。"; - $lang->description_update = "如果您最近不是用自動安裝模組更新或安裝,請按更新按鈕更新。"; - $lang->install = "安裝"; - $lang->update = "更新"; - $lang->current_version = "版本"; - $lang->depending_programs = "此程式需要安裝"; - $lang->require_update = "需要更新"; - $lang->require_installation = "需要安裝"; - $lang->description_install = "自動安裝也能夠同時安裝與更新其他相關程式"; - $lang->description_download = "如果 FTP 無法使用的話,必須要手動下載並解壓縮到目標路徑。(假設目標路徑為 ./modules/board 的話,將檔案解壓縮到 ./modules就可以了)"; - $lang->path = "路徑"; - $lang->cmd_download = "下載"; - $lang->view_installed_packages = "已安裝程式"; - $lang->msg_ftp_password_input = "請輸入 FTP 密碼"; - $lang->dependant_list = "與此程式相關程式列表"; - $lang->description_uninstall = "移除模組,所有資料將會被刪除。"; -?> +autoinstall = '自動安裝'; + $lang->about_autoinstall = '可幫助您安裝及更新 XE 程式和面板。'; + $lang->package_update = '最近更新'; + $lang->package_downloaded_count = '下載次數'; + $lang->need_update = "需要更新。"; + + $lang->order_newest = "最新發表"; + $lang->order_popular = "熱門"; + $lang->order_download = "下載"; + $lang->success_installed = "安裝成功"; + $lang->view_all_package = "全部檢視"; + $lang->description_ftp_note = "請先將 FTP 設定好,否則無法執行自動安裝功能。"; + $lang->description_update = "如果您最近不是用自動安裝模組更新或安裝,請按更新按鈕更新。"; + $lang->install = "安裝"; + $lang->update = "更新"; + $lang->current_version = "版本"; + $lang->depending_programs = "此程式需要安裝"; + $lang->require_update = "需要更新"; + $lang->require_installation = "需要安裝"; + $lang->description_install = "自動安裝也能夠同時安裝與更新其他相關程式"; + $lang->description_download = "如果 FTP 無法使用的話,必須要手動下載並解壓縮到目標路徑。(假設目標路徑為 ./modules/board 的話,將檔案解壓縮到 ./modules就可以了)"; + $lang->path = "路徑"; + $lang->cmd_download = "下載"; + $lang->view_installed_packages = "已安裝程式"; + $lang->msg_ftp_password_input = "請輸入 FTP 密碼"; + $lang->dependant_list = "與此程式相關程式列表"; + $lang->description_uninstall = "移除模組,所有資料將會被刪除。"; +?> diff --git a/modules/autoinstall/tpl/css/autoinstall.css b/modules/autoinstall/tpl/css/autoinstall.css index 776413188..5ad21f400 100644 --- a/modules/autoinstall/tpl/css/autoinstall.css +++ b/modules/autoinstall/tpl/css/autoinstall.css @@ -1,59 +1,59 @@ -@charset "utf-8"; -/* NHN (developers@xpressengine.com) */ -.install{ border-top:1px solid #ddd; *zoom:1;} -.install:after{ content:""; display:block; clear:both;} - -.aside { width:180px; float:left; margin-right:30px; padding-bottom:30px; } - -.aside .categoryBox { background-color:#F8F8F8; padding:10px; width:160px; overflow:hidden; } -.aside .categoryBox h3 { padding:0 0 10px 0; margin:0 0 10px 0; white-space:nowrap; overflow:hidden; color:#48494E; font-size:11px; font-weight:normal;} -.aside .categoryBox .bottomLine {background:transparent url(../img/hrE1.gif) repeat-x scroll left bottom;} -.aside .categoryBox .topLine {background:transparent url(../img/hrE1.gif) repeat-x scroll left top;} -.aside .categoryBox h3 a { color:#48494E; font-size:12px; font-weight:bold; text-decoration:none; } -.aside .categoryBox ul.category { margin:10px 0 0 0; padding:0; list-style:none; } -.aside .categoryBox ul.category li { margin:0 0 10px 10px; } -.aside .categoryBox ul.category li a.selected { font-weight:bold; color:#2893BB; } -.aside .categoryBox ul.category li a { text-decoration:none; color:#7B7575; } -.aside .categoryBox ul.category li span { font-family:verdana; font-size:10px; color:#999; } - -.aside .categoryBox ul.resourceManage { margin:0; padding:10px 0 0 0; list-style:none; background:transparent url(../img/hrE1.gif) repeat-x scroll left top; } -.aside .categoryBox ul.resourceManage li { background:url(../img/btnManage.gif) no-repeat 2px 2px; padding-left:14px; white-space:nowrap; overflow:hidden; margin-bottom:10px; } -.aside .categoryBox ul.resourceManage li a { text-decoration:none; color:#747474; } -.aside .categoryBox ul.resourceManage li a.selected { font-weight:bold; } - -.aside .searchBox { padding:10px 0; text-align:center; } -.aside .searchBox input.input { border:1px solid #ddd; width:120px; height:16px;} -.aside .searchBox input.submit { vertical-align:middle; } - -.install .content { position:relative; *zoom:1; overflow:hidden; width:auto; float:none; margin:0;} - -.updateList, -.updateList th, -.updateList td{ border:0; vertical-align:top; text-align:left; padding:10px 0;} -.updateList {width:100%; height:100px; table-layout:fixed;} -.updateList th, -.updateList td{ border-bottom:1px dotted #ddd;} -.updateList th img { border:1px solid #ccc; padding:2px; overflow:hidden; *zoom:1; } -.updateList td { padding:10px 0 0 0;} -.updateList td .title{ position:relative;} -.updateList td .title h3 { padding:0; margin:0 0 5px 0; font-size:12px;} -.updateList td .title a {text-decoration:none; color:#333 !important; } -.updateList td .title .buttons{ position:absolute; top:0; right:0;} -.updateList td .info p{ margin:0 0 5px 0; line-height:1.5;} -.updateList td .info p.desc{ margin:0 100px 10px 0;} -.updateList td .info p.meta{ font-size:11px;} -.updateList td .info p.meta span{ display:inline-block; line-height:1; padding:0 5px 0 9px;} -.updateList td .info p.meta .reputation{ padding:0 5px 0 0;} -.updateList td .info p.meta .reputation img{ float:left; margin:-1px 0 0 0;} -.updateList td .info p.meta .reputation span{ padding:0 0 0 5px;} -.updateList td .info p.meta .lastUpdate{ border-left:1px solid #ddd;} -.updateList td .info p.meta .download{ border-left:1px solid #ddd;} - -ul.listOrder { position:relative; overflow:hidden; margin:0; padding:10px 0; text-align:left; background:transparent url(../img/hrE1.gif) repeat-x scroll left bottom;} -ul.listOrder.asc li.arrow { background:url(../img/arrUp.gif) no-repeat right 2px; padding-right:10px; } -ul.listOrder.desc li.arrow { background:url(../img/arrDown.gif) no-repeat right 2px; padding-right:10px; } -ul.listOrder li { position:relative; left:-1px; display:inline; margin:0; padding:0 5px 0 9px; border-left:1px solid #ddd;} -ul.listOrder li.arrow a { text-decoration:none; font-weight:bold; color:#2893BB; } -ul.listOrder li a { text-decoration:none; color:#7B7575; } - -p.caution strong { font-size: 1.2em; font-weight: bold; color: red; } +@charset "utf-8"; +/* NHN (developers@xpressengine.com) */ +.install{ border-top:1px solid #ddd; *zoom:1;} +.install:after{ content:""; display:block; clear:both;} + +.aside { width:180px; float:left; margin-right:30px; padding-bottom:30px; } + +.aside .categoryBox { background-color:#F8F8F8; padding:10px; width:160px; overflow:hidden; } +.aside .categoryBox h3 { padding:0 0 10px 0; margin:0 0 10px 0; white-space:nowrap; overflow:hidden; color:#48494E; font-size:11px; font-weight:normal;} +.aside .categoryBox .bottomLine {background:transparent url(../img/hrE1.gif) repeat-x scroll left bottom;} +.aside .categoryBox .topLine {background:transparent url(../img/hrE1.gif) repeat-x scroll left top;} +.aside .categoryBox h3 a { color:#48494E; font-size:12px; font-weight:bold; text-decoration:none; } +.aside .categoryBox ul.category { margin:10px 0 0 0; padding:0; list-style:none; } +.aside .categoryBox ul.category li { margin:0 0 10px 10px; } +.aside .categoryBox ul.category li a.selected { font-weight:bold; color:#2893BB; } +.aside .categoryBox ul.category li a { text-decoration:none; color:#7B7575; } +.aside .categoryBox ul.category li span { font-family:verdana; font-size:10px; color:#999; } + +.aside .categoryBox ul.resourceManage { margin:0; padding:10px 0 0 0; list-style:none; background:transparent url(../img/hrE1.gif) repeat-x scroll left top; } +.aside .categoryBox ul.resourceManage li { background:url(../img/btnManage.gif) no-repeat 2px 2px; padding-left:14px; white-space:nowrap; overflow:hidden; margin-bottom:10px; } +.aside .categoryBox ul.resourceManage li a { text-decoration:none; color:#747474; } +.aside .categoryBox ul.resourceManage li a.selected { font-weight:bold; } + +.aside .searchBox { padding:10px 0; text-align:center; } +.aside .searchBox input.input { border:1px solid #ddd; width:120px; height:16px;} +.aside .searchBox input.submit { vertical-align:middle; } + +.install .content { position:relative; *zoom:1; overflow:hidden; width:auto; float:none; margin:0;} + +.updateList, +.updateList th, +.updateList td{ border:0; vertical-align:top; text-align:left; padding:10px 0;} +.updateList {width:100%; height:100px; table-layout:fixed;} +.updateList th, +.updateList td{ border-bottom:1px dotted #ddd;} +.updateList th img { border:1px solid #ccc; padding:2px; overflow:hidden; *zoom:1; } +.updateList td { padding:10px 0 0 0;} +.updateList td .title{ position:relative;} +.updateList td .title h3 { padding:0; margin:0 0 5px 0; font-size:12px;} +.updateList td .title a {text-decoration:none; color:#333 !important; } +.updateList td .title .buttons{ position:absolute; top:0; right:0;} +.updateList td .info p{ margin:0 0 5px 0; line-height:1.5;} +.updateList td .info p.desc{ margin:0 100px 10px 0;} +.updateList td .info p.meta{ font-size:11px;} +.updateList td .info p.meta span{ display:inline-block; line-height:1; padding:0 5px 0 9px;} +.updateList td .info p.meta .reputation{ padding:0 5px 0 0;} +.updateList td .info p.meta .reputation img{ float:left; margin:-1px 0 0 0;} +.updateList td .info p.meta .reputation span{ padding:0 0 0 5px;} +.updateList td .info p.meta .lastUpdate{ border-left:1px solid #ddd;} +.updateList td .info p.meta .download{ border-left:1px solid #ddd;} + +ul.listOrder { position:relative; overflow:hidden; margin:0; padding:10px 0; text-align:left; background:transparent url(../img/hrE1.gif) repeat-x scroll left bottom;} +ul.listOrder.asc li.arrow { background:url(../img/arrUp.gif) no-repeat right 2px; padding-right:10px; } +ul.listOrder.desc li.arrow { background:url(../img/arrDown.gif) no-repeat right 2px; padding-right:10px; } +ul.listOrder li { position:relative; left:-1px; display:inline; margin:0; padding:0 5px 0 9px; border-left:1px solid #ddd;} +ul.listOrder li.arrow a { text-decoration:none; font-weight:bold; color:#2893BB; } +ul.listOrder li a { text-decoration:none; color:#7B7575; } + +p.caution strong { font-size: 1.2em; font-weight: bold; color: red; } diff --git a/modules/autoinstall/tpl/index.html b/modules/autoinstall/tpl/index.html index f4106888d..82bfb6d1e 100644 --- a/modules/autoinstall/tpl/index.html +++ b/modules/autoinstall/tpl/index.html @@ -1,21 +1,21 @@ - - - -
      - -

      {$lang->description_ftp_note} FTP Setup

      - - -

      {$lang->need_update}

      - -

      {$lang->description_update}

      - -

      -
      - -
      - - - - -
      + + + +
      + +

      {$lang->description_ftp_note} FTP Setup

      + + +

      {$lang->need_update}

      + +

      {$lang->description_update}

      + +

      +
      + +
      + + + + +
      diff --git a/modules/autoinstall/tpl/install.html b/modules/autoinstall/tpl/install.html index df1bac164..b218c6b65 100644 --- a/modules/autoinstall/tpl/install.html +++ b/modules/autoinstall/tpl/install.html @@ -1,30 +1,30 @@ - - - -
      -

      {$package->title} ver. {$package->version} ( {$lang->current_version}: {$package->cur_version} ({$lang->require_update}) {$lang->require_installation} )

      - -
      -
      {$lang->depending_programs} :
      -
      {$dep->title} ver. {$dep->version} - - {$lang->current_version}: {$dep->cur_version} ({$lang->require_update}) {$lang->require_installation} - {$lang->cmd_download} ({$lang->path} : {$dep->path}) -
      -
      - - - - -

      {$lang->description_download}. (FTP Setup)

      -

      {$lang->path} : {$package->path}

      -

      {$lang->cmd_download}

      - -

      {$lang->description_install}.

      - -

      - -

      {$package->installed?$lang->update:$lang->install}

      - - - -
      + + + +
      +

      {$package->title} ver. {$package->version} ( {$lang->current_version}: {$package->cur_version} ({$lang->require_update}) {$lang->require_installation} )

      + +
      +
      {$lang->depending_programs} :
      +
      {$dep->title} ver. {$dep->version} - + {$lang->current_version}: {$dep->cur_version} ({$lang->require_update}) {$lang->require_installation} + {$lang->cmd_download} ({$lang->path} : {$dep->path}) +
      +
      + + + + +

      {$lang->description_download}. (FTP Setup)

      +

      {$lang->path} : {$package->path}

      +

      {$lang->cmd_download}

      + +

      {$lang->description_install}.

      + +

      + +

      {$package->installed?$lang->update:$lang->install}

      + + + +
      diff --git a/modules/autoinstall/tpl/leftBox.html b/modules/autoinstall/tpl/leftBox.html index ca4964a71..19b315125 100644 --- a/modules/autoinstall/tpl/leftBox.html +++ b/modules/autoinstall/tpl/leftBox.html @@ -1,50 +1,50 @@ -
      -
      -

      {$lang->view_all_package} ({$tCount})

      - {@ $_pDepth = 0;} - -
        - - - -
      - - - {@ $_pDepth = $val->depth} - -
    • - - category_srl == $category_srl)--> class="selected">{$val->title} - - category_srl == $category_srl)--> class="selected">{$val->title} - - - ({$val->nPackages}) - - - {@$_pDepth++} -
        - - - - - -
      - -
    • -
    - -
    -

    {$lang->view_installed_packages} ({$iCount})

    - -
- -
+
+
+

{$lang->view_all_package} ({$tCount})

+ {@ $_pDepth = 0;} + +
    + + + +
+ + + {@ $_pDepth = $val->depth} + +
  • + + category_srl == $category_srl)--> class="selected">{$val->title} + + category_srl == $category_srl)--> class="selected">{$val->title} + + + ({$val->nPackages}) + + + {@$_pDepth++} +
      + + + + + +
    + +
  • + + +
    +

    {$lang->view_installed_packages} ({$iCount})

    + +
    + +
    diff --git a/modules/autoinstall/tpl/list.html b/modules/autoinstall/tpl/list.html index a7c2343b3..6199eb5fe 100644 --- a/modules/autoinstall/tpl/list.html +++ b/modules/autoinstall/tpl/list.html @@ -1,96 +1,96 @@ -
    - -
      - - {@$_order_type = 'asc'}{@$_order_type = 'desc'} - - {@$_order_type = 'desc'} - -
    • class="arrow">{$lang->order_newest}
    • - - {@$_order_type = 'asc'}{@$_order_type = 'desc'} - - {@$_order_type = 'desc'} - -
    • class="arrow">{$lang->order_download}
    • - - {@$_order_type = 'asc'}{@$_order_type = 'desc'} - - {@$_order_type = 'desc'} - -
    • class="arrow">{$lang->order_popular}
    • -
    - - - - - - - {@ $target_url = $original_site."?mid=download&package_srl=".$val->package_srl; } - - - - -
    -
    -

    - - [{$categories[$val->category_srl]->title}] - - {htmlspecialchars($val->title)} ver. {htmlspecialchars($val->item_version)} -

    - -

    {$lang->current_version} : {$val->current_version} - -
    - {$lang->dependant_list} : - - {$installed[$package_srl]->title}. - - -

    - - - - -
    -
    -

    {cut_str(htmlspecialchars($val->package_description),200)}

    -

    - - - - - - - - - {sprintf("%0.1f",$val->package_voted/$val->package_voter*2)}/{number_format($val->package_voter)} - - {$lang->package_update} {zdate($val->item_regdate, "Y-m-d H:i")} - {$lang->package_downloaded_count} : {number_format($val->package_downloaded)} -

    -
    -
    - - -
    +
    + +
      + + {@$_order_type = 'asc'}{@$_order_type = 'desc'} + + {@$_order_type = 'desc'} + +
    • class="arrow">{$lang->order_newest}
    • + + {@$_order_type = 'asc'}{@$_order_type = 'desc'} + + {@$_order_type = 'desc'} + +
    • class="arrow">{$lang->order_download}
    • + + {@$_order_type = 'asc'}{@$_order_type = 'desc'} + + {@$_order_type = 'desc'} + +
    • class="arrow">{$lang->order_popular}
    • +
    + + + + + + + {@ $target_url = $original_site."?mid=download&package_srl=".$val->package_srl; } + + + + +
    +
    +

    + + [{$categories[$val->category_srl]->title}] + + {htmlspecialchars($val->title)} ver. {htmlspecialchars($val->item_version)} +

    + +

    {$lang->current_version} : {$val->current_version} + +
    + {$lang->dependant_list} : + + {$installed[$package_srl]->title}. + + +

    + + + + +
    +
    +

    {cut_str(htmlspecialchars($val->package_description),200)}

    +

    + + + + + + + + + {sprintf("%0.1f",$val->package_voted/$val->package_voter*2)}/{number_format($val->package_voter)} + + {$lang->package_update} {zdate($val->item_regdate, "Y-m-d H:i")} + {$lang->package_downloaded_count} : {number_format($val->package_downloaded)} +

    +
    +
    + + +
    diff --git a/modules/comment/comment.admin.controller.php b/modules/comment/comment.admin.controller.php index 31081b7b5..c52dc2b6a 100644 --- a/modules/comment/comment.admin.controller.php +++ b/modules/comment/comment.admin.controller.php @@ -1,72 +1,72 @@ -stop('msg_cart_is_null'); - $comment_srl_list= explode('|@|', $cart); - $comment_count = count($comment_srl_list); - if(!$comment_count) return $this->stop('msg_cart_is_null'); - - $oCommentController = &getController('comment'); - - $deleted_count = 0; - - // 글삭제 - for($i=0;$i<$comment_count;$i++) { - $comment_srl = trim($comment_srl_list[$i]); - if(!$comment_srl) continue; - - $output = $oCommentController->deleteComment($comment_srl, true); - if(!$output->toBool()) continue; - - $deleted_count ++; - } - - $this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $deleted_count) ); - } - - /** - * @brief 신고대상을 취소 시킴 - **/ - function procCommentAdminCancelDeclare() { - $comment_srl = trim(Context::get('comment_srl')); - - if($comment_srl) { - $args->comment_srl = $comment_srl; - $output = executeQuery('comment.deleteDeclaredComments', $args); - if(!$output->toBool()) return $output; - } - } - - /** - * @brief 특정 모듈의 모든 댓글 삭제 - **/ - function deleteModuleComments($module_srl) { - $args->module_srl = $module_srl; - $output = executeQuery('comment.deleteModuleComments', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('comment.deleteModuleCommentsList', $args); - return $output; - } - - } -?> +stop('msg_cart_is_null'); + $comment_srl_list= explode('|@|', $cart); + $comment_count = count($comment_srl_list); + if(!$comment_count) return $this->stop('msg_cart_is_null'); + + $oCommentController = &getController('comment'); + + $deleted_count = 0; + + // 글삭제 + for($i=0;$i<$comment_count;$i++) { + $comment_srl = trim($comment_srl_list[$i]); + if(!$comment_srl) continue; + + $output = $oCommentController->deleteComment($comment_srl, true); + if(!$output->toBool()) continue; + + $deleted_count ++; + } + + $this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $deleted_count) ); + } + + /** + * @brief 신고대상을 취소 시킴 + **/ + function procCommentAdminCancelDeclare() { + $comment_srl = trim(Context::get('comment_srl')); + + if($comment_srl) { + $args->comment_srl = $comment_srl; + $output = executeQuery('comment.deleteDeclaredComments', $args); + if(!$output->toBool()) return $output; + } + } + + /** + * @brief 특정 모듈의 모든 댓글 삭제 + **/ + function deleteModuleComments($module_srl) { + $args->module_srl = $module_srl; + $output = executeQuery('comment.deleteModuleComments', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('comment.deleteModuleCommentsList', $args); + return $output; + } + + } +?> diff --git a/modules/comment/comment.admin.view.php b/modules/comment/comment.admin.view.php index 2cb520bea..0a5b10a74 100644 --- a/modules/comment/comment.admin.view.php +++ b/modules/comment/comment.admin.view.php @@ -1,83 +1,83 @@ -page = Context::get('page'); ///< 페이지 - $args->list_count = 30; ///< 한페이지에 보여줄 글 수 - $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 - - $args->sort_index = 'list_order'; ///< 소팅 값 - - $args->module_srl = Context::get('module_srl'); - - // 목록 구함, comment->getCommentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다) - $oCommentModel = &getModel('comment'); - $output = $oCommentModel->getTotalCommentList($args); - - // 템플릿에 쓰기 위해서 comment_model::getTotalCommentList() 의 return object에 있는 값들을 세팅 - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('comment_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('comment_list'); - } - - /** - * @brief 관리자 페이지의 신고 목록 보기 - **/ - function dispCommentAdminDeclared() { - // 목록을 구하기 위한 옵션 - $args->page = Context::get('page'); ///< 페이지 - $args->list_count = 30; ///< 한페이지에 보여줄 글 수 - $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 - - $args->sort_index = 'comment_declared.declared_count'; ///< 소팅 값 - $args->order_type = 'desc'; ///< 소팅 정렬 값 - - // 목록을 구함 - $declared_output = executeQuery('comment.getDeclaredList', $args); - - if($declared_output->data && count($declared_output->data)) { - $comment_list = array(); - - $oCommentModel = &getModel('comment'); - foreach($declared_output->data as $key => $comment) { - $comment_list[$key] = new commentItem(); - $comment_list[$key]->setAttribute($comment); - } - $declared_output->data = $comment_list; - } - - // 템플릿에 쓰기 위해서 comment_model::getCommentList() 의 return object에 있는 값들을 세팅 - Context::set('total_count', $declared_output->total_count); - Context::set('total_page', $declared_output->total_page); - Context::set('page', $declared_output->page); - Context::set('comment_list', $declared_output->data); - Context::set('page_navigation', $declared_output->page_navigation); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('declared_list'); - } - } -?> +page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'list_order'; ///< 소팅 값 + + $args->module_srl = Context::get('module_srl'); + + // 목록 구함, comment->getCommentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다) + $oCommentModel = &getModel('comment'); + $output = $oCommentModel->getTotalCommentList($args); + + // 템플릿에 쓰기 위해서 comment_model::getTotalCommentList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('comment_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('comment_list'); + } + + /** + * @brief 관리자 페이지의 신고 목록 보기 + **/ + function dispCommentAdminDeclared() { + // 목록을 구하기 위한 옵션 + $args->page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'comment_declared.declared_count'; ///< 소팅 값 + $args->order_type = 'desc'; ///< 소팅 정렬 값 + + // 목록을 구함 + $declared_output = executeQuery('comment.getDeclaredList', $args); + + if($declared_output->data && count($declared_output->data)) { + $comment_list = array(); + + $oCommentModel = &getModel('comment'); + foreach($declared_output->data as $key => $comment) { + $comment_list[$key] = new commentItem(); + $comment_list[$key]->setAttribute($comment); + } + $declared_output->data = $comment_list; + } + + // 템플릿에 쓰기 위해서 comment_model::getCommentList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $declared_output->total_count); + Context::set('total_page', $declared_output->total_page); + Context::set('page', $declared_output->page); + Context::set('comment_list', $declared_output->data); + Context::set('page_navigation', $declared_output->page_navigation); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('declared_list'); + } + } +?> diff --git a/modules/comment/comment.class.php b/modules/comment/comment.class.php index 260d3b1a1..b17b44d62 100644 --- a/modules/comment/comment.class.php +++ b/modules/comment/comment.class.php @@ -1,105 +1,105 @@ -insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'); - - // 2007. 10. 17 모듈이 삭제될때 등록된 댓글도 모두 삭제하는 트리거 추가 - $oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'); - - // 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가 - $oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oDB = &DB::getInstance(); - $oModuleModel = &getModel('module'); - - // 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록 - if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) return true; - - // 2007. 10. 17 모듈이 삭제될때 등록된 댓글도 모두 삭제하는 트리거 추가 - if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) return true; - - // 2007. 10. 23 댓글에도 추천/ 알림 기능을 위한 컬럼 추가 - if(!$oDB->isColumnExists("comments","voted_count")) return true; - if(!$oDB->isColumnExists("comments","notify_message")) return true; - - // 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가 - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) return true; - - // 2008. 05. 14 blamed count 컬럼 추가 - if(!$oDB->isColumnExists("comments", "blamed_count")) return true; - if(!$oDB->isColumnExists("comment_voted_log", "point")) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB = &DB::getInstance(); - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - // 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록 - if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) - $oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'); - - // 2007. 10. 17 모듈이 삭제될때 등록된 댓글도 모두 삭제하는 트리거 추가 - if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) - $oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'); - - // 2007. 10. 23 댓글에도 추천/ 알림 기능을 위한 컬럼 추가 - if(!$oDB->isColumnExists("comments","voted_count")) { - $oDB->addColumn("comments","voted_count", "number","11"); - $oDB->addIndex("comments","idx_voted_count", array("voted_count")); - } - - if(!$oDB->isColumnExists("comments","notify_message")) { - $oDB->addColumn("comments","notify_message", "char","1"); - } - - // 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가 - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) - $oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'); - - // 2008. 05. 14 blamed count 컬럼 추가 - if(!$oDB->isColumnExists("comments", "blamed_count")) { - $oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, true); - $oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count')); - } - if(!$oDB->isColumnExists("comment_voted_log", "point")) - $oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, true); - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - } - } -?> +insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'); + + // 2007. 10. 17 모듈이 삭제될때 등록된 댓글도 모두 삭제하는 트리거 추가 + $oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'); + + // 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가 + $oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oDB = &DB::getInstance(); + $oModuleModel = &getModel('module'); + + // 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록 + if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) return true; + + // 2007. 10. 17 모듈이 삭제될때 등록된 댓글도 모두 삭제하는 트리거 추가 + if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) return true; + + // 2007. 10. 23 댓글에도 추천/ 알림 기능을 위한 컬럼 추가 + if(!$oDB->isColumnExists("comments","voted_count")) return true; + if(!$oDB->isColumnExists("comments","notify_message")) return true; + + // 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가 + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) return true; + + // 2008. 05. 14 blamed count 컬럼 추가 + if(!$oDB->isColumnExists("comments", "blamed_count")) return true; + if(!$oDB->isColumnExists("comment_voted_log", "point")) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB = &DB::getInstance(); + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록 + if(!$oModuleModel->getTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after')) + $oModuleController->insertTrigger('document.deleteDocument', 'comment', 'controller', 'triggerDeleteDocumentComments', 'after'); + + // 2007. 10. 17 모듈이 삭제될때 등록된 댓글도 모두 삭제하는 트리거 추가 + if(!$oModuleModel->getTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after')) + $oModuleController->insertTrigger('module.deleteModule', 'comment', 'controller', 'triggerDeleteModuleComments', 'after'); + + // 2007. 10. 23 댓글에도 추천/ 알림 기능을 위한 컬럼 추가 + if(!$oDB->isColumnExists("comments","voted_count")) { + $oDB->addColumn("comments","voted_count", "number","11"); + $oDB->addIndex("comments","idx_voted_count", array("voted_count")); + } + + if(!$oDB->isColumnExists("comments","notify_message")) { + $oDB->addColumn("comments","notify_message", "char","1"); + } + + // 2008. 02. 22 모듈의 추가 설정에서 댓글 추가 설정 추가 + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before')) + $oModuleController->insertTrigger('module.dispAdditionSetup', 'comment', 'view', 'triggerDispCommentAdditionSetup', 'before'); + + // 2008. 05. 14 blamed count 컬럼 추가 + if(!$oDB->isColumnExists("comments", "blamed_count")) { + $oDB->addColumn('comments', 'blamed_count', 'number', 11, 0, true); + $oDB->addIndex('comments', 'idx_blamed_count', array('blamed_count')); + } + if(!$oDB->isColumnExists("comment_voted_log", "point")) + $oDB->addColumn('comment_voted_log', 'point', 'number', 11, 0, true); + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + } + } +?> diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 83a9cef65..9e84d6ac0 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -1,642 +1,642 @@ -getComment($comment_srl, false, false); - $module_srl = $oComment->get('module_srl'); - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); - - $oModuleModel = &getModel('module'); - $comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl); - if($comment_config->use_vote_up=='N') return new Object(-1, 'msg_invalid_request'); - - $point = 1; - return $this->updateVotedCount($comment_srl, $point); - } - - /** - * @brief 댓글의 추천을 처리하는 action (Down) - **/ - function procCommentVoteDown() { - if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request'); - - $comment_srl = Context::get('target_srl'); - if(!$comment_srl) return new Object(-1, 'msg_invalid_request'); - - $oCommentModel = &getModel('comment'); - $oComment = $oCommentModel->getComment($comment_srl, false, false); - $module_srl = $oComment->get('module_srl'); - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); - - $oModuleModel = &getModel('module'); - $comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl); - if($comment_config->use_vote_down=='N') return new Object(-1, 'msg_invalid_request'); - - $point = -1; - return $this->updateVotedCount($comment_srl, $point); - } - - /** - * @brief 댓글이 신고될 경우 호출되는 action - **/ - function procCommentDeclare() { - if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request'); - - $comment_srl = Context::get('target_srl'); - if(!$comment_srl) return new Object(-1, 'msg_invalid_request'); - - return $this->declaredComment($comment_srl); - } - - /** - * @brief document삭제시 해당 document의 댓글을 삭제하는 trigger - **/ - function triggerDeleteDocumentComments(&$obj) { - $document_srl = $obj->document_srl; - if(!$document_srl) return new Object(); - - return $this->deleteComments($document_srl, true); - } - - /** - * @brief module 삭제시 해당 댓글을 모두 삭제하는 trigger - **/ - function triggerDeleteModuleComments(&$obj) { - $module_srl = $obj->module_srl; - if(!$module_srl) return new Object(); - - $oCommentController = &getAdminController('comment'); - return $oCommentController->deleteModuleComments($module_srl); - } - - /** - * @brief 코멘트의 권한 부여 - * 세션값으로 현 접속상태에서만 사용 가능 - **/ - function addGrant($comment_srl) { - $_SESSION['own_comment'][$comment_srl] = true; - } - - /** - * @brief 댓글 입력 - **/ - function insertComment($obj, $manual_inserted = false) { - $obj->__isupdate = false; - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj); - if(!$output->toBool()) return $output; - - // document_srl에 해당하는 글이 있는지 확인 - $document_srl = $obj->document_srl; - if(!$document_srl) return new Object(-1,'msg_invalid_document'); - - // document model 객체 생성 - $oDocumentModel = &getModel('document'); - - // even for manual_inserted if password exists, md5 it. - if($obj->password) $obj->password = md5($obj->password); - // 원본글을 가져옴 - if(!$manual_inserted) { - $oDocument = $oDocumentModel->getDocument($document_srl); - - if($document_srl != $oDocument->document_srl) return new Object(-1,'msg_invalid_document'); - if($oDocument->isLocked()) return new Object(-1,'msg_invalid_request'); - - if($obj->homepage && !preg_match('/^[a-z]+:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage; - - // 로그인 된 회원일 경우 회원의 정보를 입력 - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $obj->member_srl = $logged_info->member_srl; - $obj->user_id = $logged_info->user_id; - $obj->user_name = $logged_info->user_name; - $obj->nick_name = $logged_info->nick_name; - $obj->email_address = $logged_info->email_address; - $obj->homepage = $logged_info->homepage; - } - } - - // 로그인정보가 없고 사용자 이름이 없으면 오류 표시 - if(!$logged_info->member_srl && !$obj->nick_name) return new Object(-1,'msg_invalid_request'); - - if(!$obj->comment_srl) $obj->comment_srl = getNextSequence(); - - // 순서를 정함 - $obj->list_order = getNextSequence() * -1; - - // 내용에서 XE만의 태그를 삭제 - $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); - if(Mobile::isFromMobilePhone()) - { - $obj->content = nl2br(htmlspecialchars($obj->content)); - } - if(!$obj->regdate) $obj->regdate = date("YmdHis"); - - // 세션에서 최고 관리자가 아니면 iframe, script 제거 - if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content); - - if(!$obj->notify_message) $obj->notify_message = 'N'; - if(!$obj->is_secret) $obj->is_secret = 'N'; - - // begin transaction - $oDB = &DB::getInstance(); - $oDB->begin(); - - // 댓글 목록 부분을 먼저 입력 - $list_args->comment_srl = $obj->comment_srl; - $list_args->document_srl = $obj->document_srl; - $list_args->module_srl = $obj->module_srl; - $list_args->regdate = $obj->regdate; - - // 부모댓글이 없으면 바로 데이터를 설정 - if(!$obj->parent_srl) { - $list_args->head = $list_args->arrange = $obj->comment_srl; - $list_args->depth = 0; - - // 부모댓글이 있으면 부모글의 정보를 구해옴 - } else { - // 부모댓글의 정보를 구함 - $parent_args->comment_srl = $obj->parent_srl; - $parent_output = executeQuery('comment.getCommentListItem', $parent_args); - - // 부모댓글이 존재하지 않으면 return - if(!$parent_output->toBool() || !$parent_output->data) return; - $parent = $parent_output->data; - - $list_args->head = $parent->head; - $list_args->depth = $parent->depth+1; - - // depth가 2단계 미만이면 별도의 update문 없이 insert만으로 쓰레드 정리 - if($list_args->depth<2) { - $list_args->arrange = $obj->comment_srl; - - // depth가 2단계 이상이면 반업데이트 실행 - } else { - // 부모 댓글과 같은 head를 가지고 depth가 같거나 작은 댓글중 제일 위 댓글을 구함 - $p_args->head = $parent->head; - $p_args->arrange = $parent->arrange; - $p_args->depth = $parent->depth; - $output = executeQuery('comment.getCommentParentNextSibling', $p_args); - - if($output->data->arrange) { - $list_args->arrange = $output->data->arrange; - $output = executeQuery('comment.updateCommentListArrange', $list_args); - } else { - $list_args->arrange = $obj->comment_srl; - } - - } - } - - $output = executeQuery('comment.insertCommentList', $list_args); - if(!$output->toBool()) return $output; - - // 댓글 본문을 입력 - $output = executeQuery('comment.insertComment', $obj); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // comment model객체 생성 - $oCommentModel = &getModel('comment'); - - // 해당 글의 전체 댓글 수를 구해옴 - $comment_count = $oCommentModel->getCommentCount($document_srl); - - // document의 controller 객체 생성 - $oDocumentController = &getController('document'); - - // 해당글의 댓글 수를 업데이트 - $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, true); - - // 댓글의 권한을 부여 - $this->addGrant($obj->comment_srl); - - - // trigger 호출 (after) - if($output->toBool()) { - $trigger_output = ModuleHandler::triggerCall('comment.insertComment', 'after', $obj); - if(!$trigger_output->toBool()) { - $oDB->rollback(); - return $trigger_output; - } - } - - // commit - $oDB->commit(); - - if(!$manual_inserted) { - // 원본글에 알림(notify_message)가 설정되어 있으면 메세지 보냄 - $oDocument->notify(Context::getLang('comment'), $obj->content); - - // 원본 댓글이 있고 원본 댓글에 알림(notify_message)가 있으면 메세지 보냄 - if($obj->parent_srl) { - $oParent = $oCommentModel->getComment($obj->parent_srl); - if ($oParent->get('member_srl') != $oDocument->get('member_srl')) { - $oParent->notify(Context::getLang('comment'), $obj->content); - } - } - } - - - $output->add('comment_srl', $obj->comment_srl); - return $output; - } - - /** - * @brief 댓글 수정 - **/ - function updateComment($obj, $is_admin = false) { - $obj->__isupdate = true; - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj); - if(!$output->toBool()) return $output; - - // comment model 객체 생성 - $oCommentModel = &getModel('comment'); - - // 원본 데이터를 가져옴 - $source_obj = $oCommentModel->getComment($obj->comment_srl); - if(!$source_obj->getMemberSrl()) { - $obj->member_srl = $source_obj->get('member_srl'); - $obj->user_name = $source_obj->get('user_name'); - $obj->nick_name = $source_obj->get('nick_name'); - $obj->email_address = $source_obj->get('email_address'); - $obj->homepage = $source_obj->get('homepage'); - } - - // 권한이 있는지 확인 - if(!$is_admin && !$source_obj->isGranted()) return new Object(-1, 'msg_not_permitted'); - - if($obj->password) $obj->password = md5($obj->password); - if($obj->homepage && !preg_match('/^[a-z]+:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage; - - // 로그인 되어 있고 작성자와 수정자가 동일하면 수정자의 정보를 세팅 - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - if($source_obj->member_srl == $logged_info->member_srl) { - $obj->member_srl = $logged_info->member_srl; - $obj->user_name = $logged_info->user_name; - $obj->nick_name = $logged_info->nick_name; - $obj->email_address = $logged_info->email_address; - $obj->homepage = $logged_info->homepage; - } - } - - // 로그인한 유저가 작성한 글인데 nick_name이 없을 경우 - if($source_obj->get('member_srl')&& !$obj->nick_name) { - $obj->member_srl = $source_obj->get('member_srl'); - $obj->user_name = $source_obj->get('user_name'); - $obj->nick_name = $source_obj->get('nick_name'); - $obj->email_address = $source_obj->get('email_address'); - $obj->homepage = $source_obj->get('homepage'); - } - - - if(!$obj->content) $obj->content = $source_obj->get('content'); - - // 내용에서 XE만의 태그를 삭제 - $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); - - // 세션에서 최고 관리자가 아니면 iframe, script 제거 - if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content); - - // begin transaction - $oDB = &DB::getInstance(); - $oDB->begin(); - - // 업데이트 - $output = executeQuery('comment.updateComment', $obj); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // trigger 호출 (after) - if($output->toBool()) { - $trigger_output = ModuleHandler::triggerCall('comment.updateComment', 'after', $obj); - if(!$trigger_output->toBool()) { - $oDB->rollback(); - return $trigger_output; - } - } - - // commit - $oDB->commit(); - - $output->add('comment_srl', $obj->comment_srl); - return $output; - } - - /** - * @brief 댓글 삭제 - **/ - function deleteComment($comment_srl, $is_admin = false) { - - // comment model 객체 생성 - $oCommentModel = &getModel('comment'); - - // 기존 댓글이 있는지 확인 - $comment = $oCommentModel->getComment($comment_srl); - if($comment->comment_srl != $comment_srl) return new Object(-1, 'msg_invalid_request'); - $document_srl = $comment->document_srl; - - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); - if(!$output->toBool()) return $output; - - // 해당 댓글에 child가 있는지 확인 - $child_count = $oCommentModel->getChildCommentCount($comment_srl); - if($child_count>0) return new Object(-1, 'fail_to_delete_have_children'); - - // 권한이 있는지 확인 - if(!$is_admin && !$comment->isGranted()) return new Object(-1, 'msg_not_permitted'); - - // begin transaction - $oDB = &DB::getInstance(); - $oDB->begin(); - - // 삭제 - $args->comment_srl = $comment_srl; - $output = executeQuery('comment.deleteComment', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - $output = executeQuery('comment.deleteCommentList', $args); - - // 댓글 수를 구해서 업데이트 - $comment_count = $oCommentModel->getCommentCount($document_srl); - - // document의 controller 객체 생성 - $oDocumentController = &getController('document'); - - // 해당글의 댓글 수를 업데이트 - $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, null, false); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // trigger 호출 (after) - if($output->toBool()) { - $trigger_output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); - if(!$trigger_output->toBool()) { - $oDB->rollback(); - return $trigger_output; - } - } - - // commit - $oDB->commit(); - - $output->add('document_srl', $document_srl); - return $output; - } - - /** - * @brief 특정 글의 모든 댓글 삭제 - **/ - function deleteComments($document_srl) { - // document model객체 생성 - $oDocumentModel = &getModel('document'); - $oCommentModel = &getModel('comment'); - - // 권한이 있는지 확인 - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists() || !$oDocument->isGranted()) return new Object(-1, 'msg_not_permitted'); - - // 댓글 목록을 가져와서 일단 trigger만 실행 (일괄 삭제를 해야 하기에 최대한 처리 비용을 줄이기 위한 방법) - $args->document_srl = $document_srl; - $comments = executeQueryArray('comment.getAllComments',$args); - if($comments->data) { - foreach($comments->data as $key => $comment) { - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); - if(!$output->toBool()) continue; - - // trigger 호출 (after) - $output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); - if(!$output->toBool()) continue; - } - } - - // 댓글 본문 삭제 - $args->document_srl = $document_srl; - $output = executeQuery('comment.deleteComments', $args); - if(!$output->toBool()) return $output; - - // 댓글 목록 삭제 - $output = executeQuery('comment.deleteCommentsList', $args); - - return $output; - } - - /** - * @brief 해당 comment의 추천수 증가 - **/ - function updateVotedCount($comment_srl, $point = 1) { - if($point > 0) { - $failed_voted = 'failed_voted'; - $success_message = 'success_voted'; - } else { - $failed_voted = 'failed_blamed'; - $success_message = 'success_blamed'; - } - - // 세션 정보에 추천 정보가 있으면 중단 - if($_SESSION['voted_comment'][$comment_srl]) return new Object(-1, $failed_voted); - - $oCommentModel = &getModel('comment'); - $oComment = $oCommentModel->getComment($comment_srl, false, false); - - // 글의 작성 ip와 현재 접속자의 ip가 동일하면 패스 - if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) { - $_SESSION['voted_comment'][$comment_srl] = true; - return new Object(-1, $failed_voted); - } - - // comment의 작성자가 회원일때 조사 - if($oComment->get('member_srl')) { - $oMemberModel = &getModel('member'); - $member_srl = $oMemberModel->getLoggedMemberSrl(); - - // 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 생각하고 세션 등록후 패스 - if($member_srl && $member_srl == $oComment->get('member_srl')) { - $_SESSION['voted_comment'][$comment_srl] = true; - return new Object(-1, $failed_voted); - } - } - - // 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단 - if($member_srl) { - $args->member_srl = $member_srl; - } else { - $args->ipaddress = $_SERVER['REMOTE_ADDR']; - } - $args->comment_srl = $comment_srl; - $output = executeQuery('comment.getCommentVotedLogInfo', $args); - - // 로그 정보에 추천 로그가 있으면 세션 등록후 패스 - if($output->data->count) { - $_SESSION['voted_comment'][$comment_srl] = true; - return new Object(-1, $failed_voted); - } - - // 추천수 업데이트 - if($point < 0) { - $args->blamed_count = $oComment->get('blamed_count') + $point; - $output = executeQuery('comment.updateBlamedCount', $args); - } else { - $args->voted_count = $oComment->get('voted_count') + $point; - $output = executeQuery('comment.updateVotedCount', $args); - } - - // 로그 남기기 - $args->point = $point; - $output = executeQuery('comment.insertCommentVotedLog', $args); - - // 세션 정보에 남김 - $_SESSION['voted_comment'][$comment_srl] = true; - - // 결과 리턴 - return new Object(0, $success_message); - } - - /** - * @brief 댓글 신고 - **/ - function declaredComment($comment_srl) { - // 세션 정보에 신고 정보가 있으면 중단 - if($_SESSION['declared_comment'][$comment_srl]) return new Object(-1, 'failed_declared'); - - // 이미 신고되었는지 검사 - $args->comment_srl = $comment_srl; - $output = executeQuery('comment.getDeclaredComment', $args); - if(!$output->toBool()) return $output; - - // 문서 원본을 가져옴 - $oCommentModel = &getModel('comment'); - $oComment = $oCommentModel->getComment($comment_srl, false, false); - - // 글의 작성 ip와 현재 접속자의 ip가 동일하면 패스 - if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) { - $_SESSION['declared_comment'][$comment_srl] = true; - return new Object(-1, 'failed_declared'); - } - - // comment의 작성자가 회원일때 조사 - if($oComment->get('member_srl')) { - // member model 객체 생성 - $oMemberModel = &getModel('member'); - $member_srl = $oMemberModel->getLoggedMemberSrl(); - - // 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 생각하고 세션 등록후 패스 - if($member_srl && $member_srl == $oComment->get('member_srl')) { - $_SESSION['declared_comment'][$comment_srl] = true; - return new Object(-1, 'failed_declared'); - } - } - - // 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단 - if($member_srl) { - $args->member_srl = $member_srl; - } else { - $args->ipaddress = $_SERVER['REMOTE_ADDR']; - } - $args->comment_srl = $comment_srl; - $output = executeQuery('comment.getCommentDeclaredLogInfo', $args); - - // 로그 정보에 신고 로그가 있으면 세션 등록후 패스 - if($output->data->count) { - $_SESSION['declared_comment'][$comment_srl] = true; - return new Object(-1, 'failed_declared'); - } - - // 신고글 추가 - if($output->data->declared_count > 0) $output = executeQuery('comment.updateDeclaredComment', $args); - else $output = executeQuery('comment.insertDeclaredComment', $args); - if(!$output->toBool()) return $output; - - // 로그 남기기 - $output = executeQuery('comment.insertCommentDeclaredLog', $args); - - // 세션 정보에 남김 - $_SESSION['declared_comment'][$comment_srl] = true; - - $this->setMessage('success_declared'); - } - - /** - * @brief 댓글의 이 댓글을.. 클릭시 나타나는 팝업 메뉴를 추가하는 method - **/ - function addCommentPopupMenu($url, $str, $icon = '', $target = 'self') { - $comment_popup_menu_list = Context::get('comment_popup_menu_list'); - if(!is_array($comment_popup_menu_list)) $comment_popup_menu_list = array(); - - $obj->url = $url; - $obj->str = $str; - $obj->icon = $icon; - $obj->target = $target; - $comment_popup_menu_list[] = $obj; - - Context::set('comment_popup_menu_list', $comment_popup_menu_list); - } - - /** - * @brief 댓글의 모듈별 추가 확장 폼을 저장 - **/ - function procCommentInsertModuleConfig() { - $module_srl = Context::get('target_module_srl'); - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); - else $module_srl = array($module_srl); - - $comment_config->comment_count = (int)Context::get('comment_count'); - if(!$comment_config->comment_count) $comment_config->comment_count = 50; - - $comment_config->use_vote_up = Context::get('use_vote_up'); - if(!$comment_config->use_vote_up) $comment_config->use_vote_up = 'Y'; - - $comment_config->use_vote_down = Context::get('use_vote_down'); - if(!$comment_config->use_vote_down) $comment_config->use_vote_down = 'Y'; - - for($i=0;$isetCommentModuleConfig($srl,$comment_config); - } - - $this->setError(-1); - $this->setMessage('success_updated'); - } - - function setCommentModuleConfig($srl, $comment_config){ - $oModuleController = &getController('module'); - $oModuleController->insertModulePartConfig('comment',$srl,$comment_config); - return new Object(); - } - } -?> +getComment($comment_srl, false, false); + $module_srl = $oComment->get('module_srl'); + if(!$module_srl) return new Object(-1, 'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl); + if($comment_config->use_vote_up=='N') return new Object(-1, 'msg_invalid_request'); + + $point = 1; + return $this->updateVotedCount($comment_srl, $point); + } + + /** + * @brief 댓글의 추천을 처리하는 action (Down) + **/ + function procCommentVoteDown() { + if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request'); + + $comment_srl = Context::get('target_srl'); + if(!$comment_srl) return new Object(-1, 'msg_invalid_request'); + + $oCommentModel = &getModel('comment'); + $oComment = $oCommentModel->getComment($comment_srl, false, false); + $module_srl = $oComment->get('module_srl'); + if(!$module_srl) return new Object(-1, 'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl); + if($comment_config->use_vote_down=='N') return new Object(-1, 'msg_invalid_request'); + + $point = -1; + return $this->updateVotedCount($comment_srl, $point); + } + + /** + * @brief 댓글이 신고될 경우 호출되는 action + **/ + function procCommentDeclare() { + if(!Context::get('is_logged')) return new Object(-1, 'msg_invalid_request'); + + $comment_srl = Context::get('target_srl'); + if(!$comment_srl) return new Object(-1, 'msg_invalid_request'); + + return $this->declaredComment($comment_srl); + } + + /** + * @brief document삭제시 해당 document의 댓글을 삭제하는 trigger + **/ + function triggerDeleteDocumentComments(&$obj) { + $document_srl = $obj->document_srl; + if(!$document_srl) return new Object(); + + return $this->deleteComments($document_srl, true); + } + + /** + * @brief module 삭제시 해당 댓글을 모두 삭제하는 trigger + **/ + function triggerDeleteModuleComments(&$obj) { + $module_srl = $obj->module_srl; + if(!$module_srl) return new Object(); + + $oCommentController = &getAdminController('comment'); + return $oCommentController->deleteModuleComments($module_srl); + } + + /** + * @brief 코멘트의 권한 부여 + * 세션값으로 현 접속상태에서만 사용 가능 + **/ + function addGrant($comment_srl) { + $_SESSION['own_comment'][$comment_srl] = true; + } + + /** + * @brief 댓글 입력 + **/ + function insertComment($obj, $manual_inserted = false) { + $obj->__isupdate = false; + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('comment.insertComment', 'before', $obj); + if(!$output->toBool()) return $output; + + // document_srl에 해당하는 글이 있는지 확인 + $document_srl = $obj->document_srl; + if(!$document_srl) return new Object(-1,'msg_invalid_document'); + + // document model 객체 생성 + $oDocumentModel = &getModel('document'); + + // even for manual_inserted if password exists, md5 it. + if($obj->password) $obj->password = md5($obj->password); + // 원본글을 가져옴 + if(!$manual_inserted) { + $oDocument = $oDocumentModel->getDocument($document_srl); + + if($document_srl != $oDocument->document_srl) return new Object(-1,'msg_invalid_document'); + if($oDocument->isLocked()) return new Object(-1,'msg_invalid_request'); + + if($obj->homepage && !preg_match('/^[a-z]+:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage; + + // 로그인 된 회원일 경우 회원의 정보를 입력 + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $obj->member_srl = $logged_info->member_srl; + $obj->user_id = $logged_info->user_id; + $obj->user_name = $logged_info->user_name; + $obj->nick_name = $logged_info->nick_name; + $obj->email_address = $logged_info->email_address; + $obj->homepage = $logged_info->homepage; + } + } + + // 로그인정보가 없고 사용자 이름이 없으면 오류 표시 + if(!$logged_info->member_srl && !$obj->nick_name) return new Object(-1,'msg_invalid_request'); + + if(!$obj->comment_srl) $obj->comment_srl = getNextSequence(); + + // 순서를 정함 + $obj->list_order = getNextSequence() * -1; + + // 내용에서 XE만의 태그를 삭제 + $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); + if(Mobile::isFromMobilePhone()) + { + $obj->content = nl2br(htmlspecialchars($obj->content)); + } + if(!$obj->regdate) $obj->regdate = date("YmdHis"); + + // 세션에서 최고 관리자가 아니면 iframe, script 제거 + if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content); + + if(!$obj->notify_message) $obj->notify_message = 'N'; + if(!$obj->is_secret) $obj->is_secret = 'N'; + + // begin transaction + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 댓글 목록 부분을 먼저 입력 + $list_args->comment_srl = $obj->comment_srl; + $list_args->document_srl = $obj->document_srl; + $list_args->module_srl = $obj->module_srl; + $list_args->regdate = $obj->regdate; + + // 부모댓글이 없으면 바로 데이터를 설정 + if(!$obj->parent_srl) { + $list_args->head = $list_args->arrange = $obj->comment_srl; + $list_args->depth = 0; + + // 부모댓글이 있으면 부모글의 정보를 구해옴 + } else { + // 부모댓글의 정보를 구함 + $parent_args->comment_srl = $obj->parent_srl; + $parent_output = executeQuery('comment.getCommentListItem', $parent_args); + + // 부모댓글이 존재하지 않으면 return + if(!$parent_output->toBool() || !$parent_output->data) return; + $parent = $parent_output->data; + + $list_args->head = $parent->head; + $list_args->depth = $parent->depth+1; + + // depth가 2단계 미만이면 별도의 update문 없이 insert만으로 쓰레드 정리 + if($list_args->depth<2) { + $list_args->arrange = $obj->comment_srl; + + // depth가 2단계 이상이면 반업데이트 실행 + } else { + // 부모 댓글과 같은 head를 가지고 depth가 같거나 작은 댓글중 제일 위 댓글을 구함 + $p_args->head = $parent->head; + $p_args->arrange = $parent->arrange; + $p_args->depth = $parent->depth; + $output = executeQuery('comment.getCommentParentNextSibling', $p_args); + + if($output->data->arrange) { + $list_args->arrange = $output->data->arrange; + $output = executeQuery('comment.updateCommentListArrange', $list_args); + } else { + $list_args->arrange = $obj->comment_srl; + } + + } + } + + $output = executeQuery('comment.insertCommentList', $list_args); + if(!$output->toBool()) return $output; + + // 댓글 본문을 입력 + $output = executeQuery('comment.insertComment', $obj); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // comment model객체 생성 + $oCommentModel = &getModel('comment'); + + // 해당 글의 전체 댓글 수를 구해옴 + $comment_count = $oCommentModel->getCommentCount($document_srl); + + // document의 controller 객체 생성 + $oDocumentController = &getController('document'); + + // 해당글의 댓글 수를 업데이트 + $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, $obj->nick_name, true); + + // 댓글의 권한을 부여 + $this->addGrant($obj->comment_srl); + + + // trigger 호출 (after) + if($output->toBool()) { + $trigger_output = ModuleHandler::triggerCall('comment.insertComment', 'after', $obj); + if(!$trigger_output->toBool()) { + $oDB->rollback(); + return $trigger_output; + } + } + + // commit + $oDB->commit(); + + if(!$manual_inserted) { + // 원본글에 알림(notify_message)가 설정되어 있으면 메세지 보냄 + $oDocument->notify(Context::getLang('comment'), $obj->content); + + // 원본 댓글이 있고 원본 댓글에 알림(notify_message)가 있으면 메세지 보냄 + if($obj->parent_srl) { + $oParent = $oCommentModel->getComment($obj->parent_srl); + if ($oParent->get('member_srl') != $oDocument->get('member_srl')) { + $oParent->notify(Context::getLang('comment'), $obj->content); + } + } + } + + + $output->add('comment_srl', $obj->comment_srl); + return $output; + } + + /** + * @brief 댓글 수정 + **/ + function updateComment($obj, $is_admin = false) { + $obj->__isupdate = true; + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('comment.updateComment', 'before', $obj); + if(!$output->toBool()) return $output; + + // comment model 객체 생성 + $oCommentModel = &getModel('comment'); + + // 원본 데이터를 가져옴 + $source_obj = $oCommentModel->getComment($obj->comment_srl); + if(!$source_obj->getMemberSrl()) { + $obj->member_srl = $source_obj->get('member_srl'); + $obj->user_name = $source_obj->get('user_name'); + $obj->nick_name = $source_obj->get('nick_name'); + $obj->email_address = $source_obj->get('email_address'); + $obj->homepage = $source_obj->get('homepage'); + } + + // 권한이 있는지 확인 + if(!$is_admin && !$source_obj->isGranted()) return new Object(-1, 'msg_not_permitted'); + + if($obj->password) $obj->password = md5($obj->password); + if($obj->homepage && !preg_match('/^[a-z]+:\/\//i',$obj->homepage)) $obj->homepage = 'http://'.$obj->homepage; + + // 로그인 되어 있고 작성자와 수정자가 동일하면 수정자의 정보를 세팅 + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + if($source_obj->member_srl == $logged_info->member_srl) { + $obj->member_srl = $logged_info->member_srl; + $obj->user_name = $logged_info->user_name; + $obj->nick_name = $logged_info->nick_name; + $obj->email_address = $logged_info->email_address; + $obj->homepage = $logged_info->homepage; + } + } + + // 로그인한 유저가 작성한 글인데 nick_name이 없을 경우 + if($source_obj->get('member_srl')&& !$obj->nick_name) { + $obj->member_srl = $source_obj->get('member_srl'); + $obj->user_name = $source_obj->get('user_name'); + $obj->nick_name = $source_obj->get('nick_name'); + $obj->email_address = $source_obj->get('email_address'); + $obj->homepage = $source_obj->get('homepage'); + } + + + if(!$obj->content) $obj->content = $source_obj->get('content'); + + // 내용에서 XE만의 태그를 삭제 + $obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content); + + // 세션에서 최고 관리자가 아니면 iframe, script 제거 + if($logged_info->is_admin != 'Y') $obj->content = removeHackTag($obj->content); + + // begin transaction + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 업데이트 + $output = executeQuery('comment.updateComment', $obj); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // trigger 호출 (after) + if($output->toBool()) { + $trigger_output = ModuleHandler::triggerCall('comment.updateComment', 'after', $obj); + if(!$trigger_output->toBool()) { + $oDB->rollback(); + return $trigger_output; + } + } + + // commit + $oDB->commit(); + + $output->add('comment_srl', $obj->comment_srl); + return $output; + } + + /** + * @brief 댓글 삭제 + **/ + function deleteComment($comment_srl, $is_admin = false) { + + // comment model 객체 생성 + $oCommentModel = &getModel('comment'); + + // 기존 댓글이 있는지 확인 + $comment = $oCommentModel->getComment($comment_srl); + if($comment->comment_srl != $comment_srl) return new Object(-1, 'msg_invalid_request'); + $document_srl = $comment->document_srl; + + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); + if(!$output->toBool()) return $output; + + // 해당 댓글에 child가 있는지 확인 + $child_count = $oCommentModel->getChildCommentCount($comment_srl); + if($child_count>0) return new Object(-1, 'fail_to_delete_have_children'); + + // 권한이 있는지 확인 + if(!$is_admin && !$comment->isGranted()) return new Object(-1, 'msg_not_permitted'); + + // begin transaction + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 삭제 + $args->comment_srl = $comment_srl; + $output = executeQuery('comment.deleteComment', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + $output = executeQuery('comment.deleteCommentList', $args); + + // 댓글 수를 구해서 업데이트 + $comment_count = $oCommentModel->getCommentCount($document_srl); + + // document의 controller 객체 생성 + $oDocumentController = &getController('document'); + + // 해당글의 댓글 수를 업데이트 + $output = $oDocumentController->updateCommentCount($document_srl, $comment_count, null, false); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // trigger 호출 (after) + if($output->toBool()) { + $trigger_output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); + if(!$trigger_output->toBool()) { + $oDB->rollback(); + return $trigger_output; + } + } + + // commit + $oDB->commit(); + + $output->add('document_srl', $document_srl); + return $output; + } + + /** + * @brief 특정 글의 모든 댓글 삭제 + **/ + function deleteComments($document_srl) { + // document model객체 생성 + $oDocumentModel = &getModel('document'); + $oCommentModel = &getModel('comment'); + + // 권한이 있는지 확인 + $oDocument = $oDocumentModel->getDocument($document_srl); + if(!$oDocument->isExists() || !$oDocument->isGranted()) return new Object(-1, 'msg_not_permitted'); + + // 댓글 목록을 가져와서 일단 trigger만 실행 (일괄 삭제를 해야 하기에 최대한 처리 비용을 줄이기 위한 방법) + $args->document_srl = $document_srl; + $comments = executeQueryArray('comment.getAllComments',$args); + if($comments->data) { + foreach($comments->data as $key => $comment) { + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('comment.deleteComment', 'before', $comment); + if(!$output->toBool()) continue; + + // trigger 호출 (after) + $output = ModuleHandler::triggerCall('comment.deleteComment', 'after', $comment); + if(!$output->toBool()) continue; + } + } + + // 댓글 본문 삭제 + $args->document_srl = $document_srl; + $output = executeQuery('comment.deleteComments', $args); + if(!$output->toBool()) return $output; + + // 댓글 목록 삭제 + $output = executeQuery('comment.deleteCommentsList', $args); + + return $output; + } + + /** + * @brief 해당 comment의 추천수 증가 + **/ + function updateVotedCount($comment_srl, $point = 1) { + if($point > 0) { + $failed_voted = 'failed_voted'; + $success_message = 'success_voted'; + } else { + $failed_voted = 'failed_blamed'; + $success_message = 'success_blamed'; + } + + // 세션 정보에 추천 정보가 있으면 중단 + if($_SESSION['voted_comment'][$comment_srl]) return new Object(-1, $failed_voted); + + $oCommentModel = &getModel('comment'); + $oComment = $oCommentModel->getComment($comment_srl, false, false); + + // 글의 작성 ip와 현재 접속자의 ip가 동일하면 패스 + if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) { + $_SESSION['voted_comment'][$comment_srl] = true; + return new Object(-1, $failed_voted); + } + + // comment의 작성자가 회원일때 조사 + if($oComment->get('member_srl')) { + $oMemberModel = &getModel('member'); + $member_srl = $oMemberModel->getLoggedMemberSrl(); + + // 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 생각하고 세션 등록후 패스 + if($member_srl && $member_srl == $oComment->get('member_srl')) { + $_SESSION['voted_comment'][$comment_srl] = true; + return new Object(-1, $failed_voted); + } + } + + // 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단 + if($member_srl) { + $args->member_srl = $member_srl; + } else { + $args->ipaddress = $_SERVER['REMOTE_ADDR']; + } + $args->comment_srl = $comment_srl; + $output = executeQuery('comment.getCommentVotedLogInfo', $args); + + // 로그 정보에 추천 로그가 있으면 세션 등록후 패스 + if($output->data->count) { + $_SESSION['voted_comment'][$comment_srl] = true; + return new Object(-1, $failed_voted); + } + + // 추천수 업데이트 + if($point < 0) { + $args->blamed_count = $oComment->get('blamed_count') + $point; + $output = executeQuery('comment.updateBlamedCount', $args); + } else { + $args->voted_count = $oComment->get('voted_count') + $point; + $output = executeQuery('comment.updateVotedCount', $args); + } + + // 로그 남기기 + $args->point = $point; + $output = executeQuery('comment.insertCommentVotedLog', $args); + + // 세션 정보에 남김 + $_SESSION['voted_comment'][$comment_srl] = true; + + // 결과 리턴 + return new Object(0, $success_message); + } + + /** + * @brief 댓글 신고 + **/ + function declaredComment($comment_srl) { + // 세션 정보에 신고 정보가 있으면 중단 + if($_SESSION['declared_comment'][$comment_srl]) return new Object(-1, 'failed_declared'); + + // 이미 신고되었는지 검사 + $args->comment_srl = $comment_srl; + $output = executeQuery('comment.getDeclaredComment', $args); + if(!$output->toBool()) return $output; + + // 문서 원본을 가져옴 + $oCommentModel = &getModel('comment'); + $oComment = $oCommentModel->getComment($comment_srl, false, false); + + // 글의 작성 ip와 현재 접속자의 ip가 동일하면 패스 + if($oComment->get('ipaddress') == $_SERVER['REMOTE_ADDR']) { + $_SESSION['declared_comment'][$comment_srl] = true; + return new Object(-1, 'failed_declared'); + } + + // comment의 작성자가 회원일때 조사 + if($oComment->get('member_srl')) { + // member model 객체 생성 + $oMemberModel = &getModel('member'); + $member_srl = $oMemberModel->getLoggedMemberSrl(); + + // 글쓴이와 현재 로그인 사용자의 정보가 일치하면 읽었다고 생각하고 세션 등록후 패스 + if($member_srl && $member_srl == $oComment->get('member_srl')) { + $_SESSION['declared_comment'][$comment_srl] = true; + return new Object(-1, 'failed_declared'); + } + } + + // 로그인 사용자이면 member_srl, 비회원이면 ipaddress로 판단 + if($member_srl) { + $args->member_srl = $member_srl; + } else { + $args->ipaddress = $_SERVER['REMOTE_ADDR']; + } + $args->comment_srl = $comment_srl; + $output = executeQuery('comment.getCommentDeclaredLogInfo', $args); + + // 로그 정보에 신고 로그가 있으면 세션 등록후 패스 + if($output->data->count) { + $_SESSION['declared_comment'][$comment_srl] = true; + return new Object(-1, 'failed_declared'); + } + + // 신고글 추가 + if($output->data->declared_count > 0) $output = executeQuery('comment.updateDeclaredComment', $args); + else $output = executeQuery('comment.insertDeclaredComment', $args); + if(!$output->toBool()) return $output; + + // 로그 남기기 + $output = executeQuery('comment.insertCommentDeclaredLog', $args); + + // 세션 정보에 남김 + $_SESSION['declared_comment'][$comment_srl] = true; + + $this->setMessage('success_declared'); + } + + /** + * @brief 댓글의 이 댓글을.. 클릭시 나타나는 팝업 메뉴를 추가하는 method + **/ + function addCommentPopupMenu($url, $str, $icon = '', $target = 'self') { + $comment_popup_menu_list = Context::get('comment_popup_menu_list'); + if(!is_array($comment_popup_menu_list)) $comment_popup_menu_list = array(); + + $obj->url = $url; + $obj->str = $str; + $obj->icon = $icon; + $obj->target = $target; + $comment_popup_menu_list[] = $obj; + + Context::set('comment_popup_menu_list', $comment_popup_menu_list); + } + + /** + * @brief 댓글의 모듈별 추가 확장 폼을 저장 + **/ + function procCommentInsertModuleConfig() { + $module_srl = Context::get('target_module_srl'); + if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); + else $module_srl = array($module_srl); + + $comment_config->comment_count = (int)Context::get('comment_count'); + if(!$comment_config->comment_count) $comment_config->comment_count = 50; + + $comment_config->use_vote_up = Context::get('use_vote_up'); + if(!$comment_config->use_vote_up) $comment_config->use_vote_up = 'Y'; + + $comment_config->use_vote_down = Context::get('use_vote_down'); + if(!$comment_config->use_vote_down) $comment_config->use_vote_down = 'Y'; + + for($i=0;$isetCommentModuleConfig($srl,$comment_config); + } + + $this->setError(-1); + $this->setMessage('success_updated'); + } + + function setCommentModuleConfig($srl, $comment_config){ + $oModuleController = &getController('module'); + $oModuleController->insertModulePartConfig('comment',$srl,$comment_config); + return new Object(); + } + } +?> diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php index fe5295b20..23655f76b 100644 --- a/modules/comment/comment.model.php +++ b/modules/comment/comment.model.php @@ -1,468 +1,468 @@ -member_srl) { - - $oCommentModel = &getModel('comment'); - $oComment = $oCommentModel->getComment($comment_srl, false, false); - $module_srl = $oComment->get('module_srl'); - $member_srl = $oComment->get('member_srl'); - - $oModuleModel = &getModel('module'); - $comment_config = $oModuleModel->getModulePartConfig('document',$module_srl); - if($comment_config->use_vote_up!='N' && $member_srl!=$logged_info->member_srl){ - // 추천 버튼 추가 - $url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl); - $oCommentController->addCommentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript'); - } - if($comment_config->use_vote_down!='N' && $member_srl!=$logged_info->member_srl){ - // 비추천 버튼 추가 - $url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl); - $oCommentController->addCommentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript'); - } - - // 신고 기능 추가 - $url = sprintf("doCallModuleAction('comment','procCommentDeclare','%s')", $comment_srl); - $oCommentController->addCommentPopupMenu($url,'cmd_declare','./modules/document/tpl/icons/declare.gif','javascript'); - } - - // trigger 호출 (after) - ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list); - - // 관리자일 경우 ip로 글 찾기 - if($logged_info->is_admin == 'Y') { - $oCommentModel = &getModel('comment'); - $oComment = $oCommentModel->getComment($comment_srl); - - if($oComment->isExists()) { - // ip주소에 해당하는 글 찾기 - $url = getUrl('','module','admin','act','dispCommentAdminList','search_target','ipaddress','search_keyword',$oComment->get('ipaddress')); - $icon_path = './modules/member/tpl/images/icon_management.gif'; - $oCommentController->addCommentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress'); - - $url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oComment-> getIpAddress()); - $oCommentController->addCommentPopupMenu($url,'cmd_add_ip_to_spamfilter','./modules/document/tpl/icons/declare.gif','javascript'); - } - } - - // 팝업메뉴의 언어 변경 - $menus = Context::get('comment_popup_menu_list'); - $menus_count = count($menus); - for($i=0;$i<$menus_count;$i++) { - $menus[$i]->str = Context::getLang($menus[$i]->str); - } - - // 최종적으로 정리된 팝업메뉴 목록을 구함 - $this->add('menus', $menus); - } - - - /** - * @brief comment_srl에 권한이 있는지 체크 - * - * 세션 정보만 이용 - **/ - function isGranted($comment_srl) { - return $_SESSION['own_comment'][$comment_srl]; - } - - /** - * @brief 자식 답글의 갯수 리턴 - **/ - function getChildCommentCount($comment_srl) { - $args->comment_srl = $comment_srl; - $output = executeQuery('comment.getChildCommentCount', $args); - return (int)$output->data->count; - } - - /** - * @brief 댓글 가져오기 - **/ - function getComment($comment_srl=0, $is_admin = false) { - $oComment = new commentItem($comment_srl); - if($is_admin) $oComment->setGrant(); - - return $oComment; - } - - /** - * @brief 여러개의 댓글들을 가져옴 (페이징 아님) - **/ - function getComments($comment_srl_list) { - if(is_array($comment_srl_list)) $comment_srls = implode(',',$comment_srl_list); - - // DB에서 가져옴 - $args->comment_srls = $comment_srls; - $output = executeQuery('comment.getComments', $args); - if(!$output->toBool()) return; - $comment_list = $output->data; - if(!$comment_list) return; - if(!is_array($comment_list)) $comment_list = array($comment_list); - - $comment_count = count($comment_list); - foreach($comment_list as $key => $attribute) { - if(!$attribute->comment_srl) continue; - $oComment = null; - $oComment = new commentItem(); - $oComment->setAttribute($attribute); - if($is_admin) $oComment->setGrant(); - - $result[$attribute->comment_srl] = $oComment; - } - return $result; - } - - /** - * @brief document_srl 에 해당하는 댓글의 전체 갯수를 가져옴 - **/ - function getCommentCount($document_srl) { - $args->document_srl = $document_srl; - $output = executeQuery('comment.getCommentCount', $args); - $total_count = $output->data->count; - return (int)$total_count; - } - - - /** - * @brief module_srl 에 해당하는 댓글의 전체 갯수를 가져옴 - **/ - function getCommentAllCount($module_srl) { - $args->module_srl = $module_srl; - $output = executeQuery('comment.getCommentCount', $args); - $total_count = $output->data->count; - - return (int)$total_count; - } - - - /** - * @brief mid 에 해당하는 댓글을 가져옴 - **/ - function getNewestCommentList($obj) { - if($obj->mid) { - $oModuleModel = &getModel('module'); - $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); - unset($obj->mid); - } - - // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - $args->list_count = $obj->list_count; - - $output = executeQuery('comment.getNewestCommentList', $args); - if(!$output->toBool()) return $output; - - $comment_list = $output->data; - if($comment_list) { - if(!is_array($comment_list)) $comment_list = array($comment_list); - $comment_count = count($comment_list); - foreach($comment_list as $key => $attribute) { - if(!$attribute->comment_srl) continue; - $oComment = null; - $oComment = new commentItem(); - $oComment->setAttribute($attribute); - - $result[$key] = $oComment; - } - $output->data = $result; - } - return $result; - } - - /** - * @brief document_srl에 해당하는 문서의 댓글 목록을 가져옴 - **/ - function getCommentList($document_srl, $page = 0, $is_admin = false, $count = 0) { - // 해당 문서의 모듈에 해당하는 댓글 수를 구함 - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - - // 문서가 존재하지 않으면 return~ - if(!$oDocument->isExists()) return; - - // 댓글수가 없으면 return~ - if($oDocument->getCommentCount()<1) return; - - // 정해진 댓글수에 따른 댓글 목록 구함 - $module_srl = $oDocument->get('module_srl'); - - if(!$count) { - $comment_config = $this->getCommentConfig($module_srl); - $comment_count = $comment_config->comment_count; - if(!$comment_count) $comment_count = 50; - } else { - $comment_count = $count; - } - - // 페이지가 없으면 제일 뒤 페이지를 구함 - if(!$page) $page = (int)( ($oDocument->getCommentCount()-1) / $comment_count) + 1; - - // 정해진 수에 따라 목록을 구해옴 - $args->document_srl = $document_srl; - $args->list_count = $comment_count; - $args->page = $page; - $args->page_count = 10; - $output = executeQueryArray('comment.getCommentPageList', $args); - - // 쿼리 결과에서 오류가 생기면 그냥 return - if(!$output->toBool()) return; - - // 만약 구해온 결과값이 저장된 댓글수와 다르다면 기존의 데이터로 판단하고 댓글 목록 테이블에 데이터 입력 - if(!$output->data) { - $this->fixCommentList($oDocument->get('module_srl'), $document_srl); - $output = executeQueryArray('comment.getCommentPageList', $args); - if(!$output->toBool()) return; - } - - return $output; - } - - /** - * @brief document_srl에 해당하는 댓글 목록을 갱신 - * 정식버전 이전에 사용되던 데이터를 위한 처리 - **/ - function fixCommentList($module_srl, $document_srl) { - // 일괄 작업이라서 lock 파일을 생성하여 중복 작업이 되지 않도록 한다 - $lock_file = "./files/cache/tmp/lock.".$document_srl; - if(file_exists($lock_file) && filemtime($lock_file)+60*60*10document_srl = $document_srl; - $args->list_order = 'list_order'; - $output = executeQuery('comment.getCommentList', $args); - if(!$output->toBool()) return $output; - - $source_list = $output->data; - if(!is_array($source_list)) $source_list = array($source_list); - - // 댓글를 계층형 구조로 정렬 - $comment_count = count($source_list); - - $root = NULL; - $list = NULL; - $comment_list = array(); - - // 로그인 사용자의 경우 로그인 정보를 일단 구해 놓음 - $logged_info = Context::get('logged_info'); - - - // loop를 돌면서 코멘트의 계층 구조 만듬 - for($i=$comment_count-1;$i>=0;$i--) { - $comment_srl = $source_list[$i]->comment_srl; - $parent_srl = $source_list[$i]->parent_srl; - if(!$comment_srl) continue; - - // 목록을 만듬 - $list[$comment_srl] = $source_list[$i]; - - if($parent_srl) { - $list[$parent_srl]->child[] = &$list[$comment_srl]; - } else { - $root->child[] = &$list[$comment_srl]; - } - } - $this->_arrangeComment($comment_list, $root->child, 0, null); - - // 구해진 값을 db에 입력함 - if(count($comment_list)) { - foreach($comment_list as $comment_srl => $item) { - $comment_args = null; - $comment_args->comment_srl = $comment_srl; - $comment_args->document_srl = $document_srl; - $comment_args->head = $item->head; - $comment_args->arrange = $item->arrange; - $comment_args->module_srl = $module_srl; - $comment_args->regdate = $item->regdate; - $comment_args->depth = $item->depth; - - executeQuery('comment.insertCommentList', $comment_args); - } - } - - // 성공시 lock파일 제거 - FileHandler::removeFile($lock_file); - } - - /** - * @brief 댓글을 계층형으로 재배치 - **/ - function _arrangeComment(&$comment_list, $list, $depth, $parent = null) { - if(!count($list)) return; - foreach($list as $key => $val) { - - if($parent) $val->head = $parent->head; - else $val->head = $val->comment_srl; - $val->arrange = count($comment_list)+1; - - if($val->child) { - $val->depth = $depth; - $comment_list[$val->comment_srl] = $val; - $this->_arrangeComment($comment_list,$val->child,$depth+1, $val); - unset($val->child); - } else { - $val->depth = $depth; - $comment_list[$val->comment_srl] = $val; - } - } - } - - /** - * @brief 모든 댓글를 시간 역순으로 가져옴 (관리자용) - **/ - function getTotalCommentList($obj) { - $query_id = 'comment.getTotalCommentList'; - - // 변수 설정 - $args->sort_index = 'list_order'; - $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; - $args->s_module_srl = $obj->module_srl; - $args->exclude_module_srl = $obj->exclude_module_srl; - - // 검색 옵션 정리 - $search_target = $obj->search_target?$obj->search_target:trim(Context::get('search_target')); - $search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword')); - if($search_target && $search_keyword) { - switch($search_target) { - case 'content' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_content = $search_keyword; - break; - case 'user_id' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_user_id = $search_keyword; - $query_id = 'comment.getTotalCommentListWithinMember'; - $args->sort_index = 'comments.list_order'; - break; - case 'user_name' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_user_name = $search_keyword; - break; - case 'nick_name' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_nick_name = $search_keyword; - break; - case 'email_address' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_email_address = $search_keyword; - break; - case 'homepage' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_homepage = $search_keyword; - break; - case 'regdate' : - $args->s_regdate = $search_keyword; - break; - case 'last_update' : - $args->s_last_upate = $search_keyword; - break; - case 'ipaddress' : - $args->s_ipaddress= $search_keyword; - break; - case 'member_srl' : - $args->{"s_".$search_target} = (int)$search_keyword; - break; - } - } - - // comment.getTotalCommentList 쿼리 실행 - $output = executeQueryArray($query_id, $args); - - // 결과가 없거나 오류 발생시 그냥 return - if(!$output->toBool()||!count($output->data)) return $output; - foreach($output->data as $key => $val) { - unset($_oComment); - $_oComment = new CommentItem(0); - $_oComment->setAttribute($val); - $output->data[$key] = $_oComment; - } - - return $output; - } - - /** - * @brief 모듈별 댓글 설정을 return - **/ - function getCommentConfig($module_srl) { - $oModuleModel = &getModel('module'); - $comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl); - if(!isset($comment_config->comment_count)) $comment_config->comment_count = 50; - return $comment_config; - } - - function getCommentVotedMemberList() - { - $comment_srl = Context::get('comment_srl'); - if(!$comment_srl) return new Object(-1,'msg_invalid_request'); - - $point = Context::get('point'); - if($point != -1) $point = 1; - - $oCommentModel = &getModel('comment'); - $oComment = $oCommentModel->getComment($comment_srl, false, false); - $module_srl = $oComment->get('module_srl'); - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); - - $oModuleModel = &getModel('module'); - $comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl); - if($point == -1){ - if($comment_config->use_vote_down!='S') return new Object(-1, 'msg_invalid_request'); - $args->below_point = 0; - }else{ - if($comment_config->use_vote_up!='S') return new Object(-1, 'msg_invalid_request'); - $args->more_point = 0; - } - - $args->comment_srl = $comment_srl; - $output = executeQueryArray('comment.getVotedMemberList',$args); - if(!$output->toBool()) return $output; - - $oMemberModel = &getModel('member'); - if($output->data){ - foreach($output->data as $k => $d){ - $profile_image = $oMemberModel->getProfileImage($d->member_srl); - $output->data[$k]->src = $profile_image->src; - } - } - - $this->add('voted_member_list',$output->data); - } - } -?> +member_srl) { + + $oCommentModel = &getModel('comment'); + $oComment = $oCommentModel->getComment($comment_srl, false, false); + $module_srl = $oComment->get('module_srl'); + $member_srl = $oComment->get('member_srl'); + + $oModuleModel = &getModel('module'); + $comment_config = $oModuleModel->getModulePartConfig('document',$module_srl); + if($comment_config->use_vote_up!='N' && $member_srl!=$logged_info->member_srl){ + // 추천 버튼 추가 + $url = sprintf("doCallModuleAction('comment','procCommentVoteUp','%s')", $comment_srl); + $oCommentController->addCommentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript'); + } + if($comment_config->use_vote_down!='N' && $member_srl!=$logged_info->member_srl){ + // 비추천 버튼 추가 + $url = sprintf("doCallModuleAction('comment','procCommentVoteDown','%s')", $comment_srl); + $oCommentController->addCommentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript'); + } + + // 신고 기능 추가 + $url = sprintf("doCallModuleAction('comment','procCommentDeclare','%s')", $comment_srl); + $oCommentController->addCommentPopupMenu($url,'cmd_declare','./modules/document/tpl/icons/declare.gif','javascript'); + } + + // trigger 호출 (after) + ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list); + + // 관리자일 경우 ip로 글 찾기 + if($logged_info->is_admin == 'Y') { + $oCommentModel = &getModel('comment'); + $oComment = $oCommentModel->getComment($comment_srl); + + if($oComment->isExists()) { + // ip주소에 해당하는 글 찾기 + $url = getUrl('','module','admin','act','dispCommentAdminList','search_target','ipaddress','search_keyword',$oComment->get('ipaddress')); + $icon_path = './modules/member/tpl/images/icon_management.gif'; + $oCommentController->addCommentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress'); + + $url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oComment-> getIpAddress()); + $oCommentController->addCommentPopupMenu($url,'cmd_add_ip_to_spamfilter','./modules/document/tpl/icons/declare.gif','javascript'); + } + } + + // 팝업메뉴의 언어 변경 + $menus = Context::get('comment_popup_menu_list'); + $menus_count = count($menus); + for($i=0;$i<$menus_count;$i++) { + $menus[$i]->str = Context::getLang($menus[$i]->str); + } + + // 최종적으로 정리된 팝업메뉴 목록을 구함 + $this->add('menus', $menus); + } + + + /** + * @brief comment_srl에 권한이 있는지 체크 + * + * 세션 정보만 이용 + **/ + function isGranted($comment_srl) { + return $_SESSION['own_comment'][$comment_srl]; + } + + /** + * @brief 자식 답글의 갯수 리턴 + **/ + function getChildCommentCount($comment_srl) { + $args->comment_srl = $comment_srl; + $output = executeQuery('comment.getChildCommentCount', $args); + return (int)$output->data->count; + } + + /** + * @brief 댓글 가져오기 + **/ + function getComment($comment_srl=0, $is_admin = false) { + $oComment = new commentItem($comment_srl); + if($is_admin) $oComment->setGrant(); + + return $oComment; + } + + /** + * @brief 여러개의 댓글들을 가져옴 (페이징 아님) + **/ + function getComments($comment_srl_list) { + if(is_array($comment_srl_list)) $comment_srls = implode(',',$comment_srl_list); + + // DB에서 가져옴 + $args->comment_srls = $comment_srls; + $output = executeQuery('comment.getComments', $args); + if(!$output->toBool()) return; + $comment_list = $output->data; + if(!$comment_list) return; + if(!is_array($comment_list)) $comment_list = array($comment_list); + + $comment_count = count($comment_list); + foreach($comment_list as $key => $attribute) { + if(!$attribute->comment_srl) continue; + $oComment = null; + $oComment = new commentItem(); + $oComment->setAttribute($attribute); + if($is_admin) $oComment->setGrant(); + + $result[$attribute->comment_srl] = $oComment; + } + return $result; + } + + /** + * @brief document_srl 에 해당하는 댓글의 전체 갯수를 가져옴 + **/ + function getCommentCount($document_srl) { + $args->document_srl = $document_srl; + $output = executeQuery('comment.getCommentCount', $args); + $total_count = $output->data->count; + return (int)$total_count; + } + + + /** + * @brief module_srl 에 해당하는 댓글의 전체 갯수를 가져옴 + **/ + function getCommentAllCount($module_srl) { + $args->module_srl = $module_srl; + $output = executeQuery('comment.getCommentCount', $args); + $total_count = $output->data->count; + + return (int)$total_count; + } + + + /** + * @brief mid 에 해당하는 댓글을 가져옴 + **/ + function getNewestCommentList($obj) { + if($obj->mid) { + $oModuleModel = &getModel('module'); + $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); + unset($obj->mid); + } + + // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 + if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + $args->list_count = $obj->list_count; + + $output = executeQuery('comment.getNewestCommentList', $args); + if(!$output->toBool()) return $output; + + $comment_list = $output->data; + if($comment_list) { + if(!is_array($comment_list)) $comment_list = array($comment_list); + $comment_count = count($comment_list); + foreach($comment_list as $key => $attribute) { + if(!$attribute->comment_srl) continue; + $oComment = null; + $oComment = new commentItem(); + $oComment->setAttribute($attribute); + + $result[$key] = $oComment; + } + $output->data = $result; + } + return $result; + } + + /** + * @brief document_srl에 해당하는 문서의 댓글 목록을 가져옴 + **/ + function getCommentList($document_srl, $page = 0, $is_admin = false, $count = 0) { + // 해당 문서의 모듈에 해당하는 댓글 수를 구함 + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + + // 문서가 존재하지 않으면 return~ + if(!$oDocument->isExists()) return; + + // 댓글수가 없으면 return~ + if($oDocument->getCommentCount()<1) return; + + // 정해진 댓글수에 따른 댓글 목록 구함 + $module_srl = $oDocument->get('module_srl'); + + if(!$count) { + $comment_config = $this->getCommentConfig($module_srl); + $comment_count = $comment_config->comment_count; + if(!$comment_count) $comment_count = 50; + } else { + $comment_count = $count; + } + + // 페이지가 없으면 제일 뒤 페이지를 구함 + if(!$page) $page = (int)( ($oDocument->getCommentCount()-1) / $comment_count) + 1; + + // 정해진 수에 따라 목록을 구해옴 + $args->document_srl = $document_srl; + $args->list_count = $comment_count; + $args->page = $page; + $args->page_count = 10; + $output = executeQueryArray('comment.getCommentPageList', $args); + + // 쿼리 결과에서 오류가 생기면 그냥 return + if(!$output->toBool()) return; + + // 만약 구해온 결과값이 저장된 댓글수와 다르다면 기존의 데이터로 판단하고 댓글 목록 테이블에 데이터 입력 + if(!$output->data) { + $this->fixCommentList($oDocument->get('module_srl'), $document_srl); + $output = executeQueryArray('comment.getCommentPageList', $args); + if(!$output->toBool()) return; + } + + return $output; + } + + /** + * @brief document_srl에 해당하는 댓글 목록을 갱신 + * 정식버전 이전에 사용되던 데이터를 위한 처리 + **/ + function fixCommentList($module_srl, $document_srl) { + // 일괄 작업이라서 lock 파일을 생성하여 중복 작업이 되지 않도록 한다 + $lock_file = "./files/cache/tmp/lock.".$document_srl; + if(file_exists($lock_file) && filemtime($lock_file)+60*60*10document_srl = $document_srl; + $args->list_order = 'list_order'; + $output = executeQuery('comment.getCommentList', $args); + if(!$output->toBool()) return $output; + + $source_list = $output->data; + if(!is_array($source_list)) $source_list = array($source_list); + + // 댓글를 계층형 구조로 정렬 + $comment_count = count($source_list); + + $root = NULL; + $list = NULL; + $comment_list = array(); + + // 로그인 사용자의 경우 로그인 정보를 일단 구해 놓음 + $logged_info = Context::get('logged_info'); + + + // loop를 돌면서 코멘트의 계층 구조 만듬 + for($i=$comment_count-1;$i>=0;$i--) { + $comment_srl = $source_list[$i]->comment_srl; + $parent_srl = $source_list[$i]->parent_srl; + if(!$comment_srl) continue; + + // 목록을 만듬 + $list[$comment_srl] = $source_list[$i]; + + if($parent_srl) { + $list[$parent_srl]->child[] = &$list[$comment_srl]; + } else { + $root->child[] = &$list[$comment_srl]; + } + } + $this->_arrangeComment($comment_list, $root->child, 0, null); + + // 구해진 값을 db에 입력함 + if(count($comment_list)) { + foreach($comment_list as $comment_srl => $item) { + $comment_args = null; + $comment_args->comment_srl = $comment_srl; + $comment_args->document_srl = $document_srl; + $comment_args->head = $item->head; + $comment_args->arrange = $item->arrange; + $comment_args->module_srl = $module_srl; + $comment_args->regdate = $item->regdate; + $comment_args->depth = $item->depth; + + executeQuery('comment.insertCommentList', $comment_args); + } + } + + // 성공시 lock파일 제거 + FileHandler::removeFile($lock_file); + } + + /** + * @brief 댓글을 계층형으로 재배치 + **/ + function _arrangeComment(&$comment_list, $list, $depth, $parent = null) { + if(!count($list)) return; + foreach($list as $key => $val) { + + if($parent) $val->head = $parent->head; + else $val->head = $val->comment_srl; + $val->arrange = count($comment_list)+1; + + if($val->child) { + $val->depth = $depth; + $comment_list[$val->comment_srl] = $val; + $this->_arrangeComment($comment_list,$val->child,$depth+1, $val); + unset($val->child); + } else { + $val->depth = $depth; + $comment_list[$val->comment_srl] = $val; + } + } + } + + /** + * @brief 모든 댓글를 시간 역순으로 가져옴 (관리자용) + **/ + function getTotalCommentList($obj) { + $query_id = 'comment.getTotalCommentList'; + + // 변수 설정 + $args->sort_index = 'list_order'; + $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; + $args->s_module_srl = $obj->module_srl; + $args->exclude_module_srl = $obj->exclude_module_srl; + + // 검색 옵션 정리 + $search_target = $obj->search_target?$obj->search_target:trim(Context::get('search_target')); + $search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword')); + if($search_target && $search_keyword) { + switch($search_target) { + case 'content' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_content = $search_keyword; + break; + case 'user_id' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_id = $search_keyword; + $query_id = 'comment.getTotalCommentListWithinMember'; + $args->sort_index = 'comments.list_order'; + break; + case 'user_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_name = $search_keyword; + break; + case 'nick_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_nick_name = $search_keyword; + break; + case 'email_address' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_email_address = $search_keyword; + break; + case 'homepage' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_homepage = $search_keyword; + break; + case 'regdate' : + $args->s_regdate = $search_keyword; + break; + case 'last_update' : + $args->s_last_upate = $search_keyword; + break; + case 'ipaddress' : + $args->s_ipaddress= $search_keyword; + break; + case 'member_srl' : + $args->{"s_".$search_target} = (int)$search_keyword; + break; + } + } + + // comment.getTotalCommentList 쿼리 실행 + $output = executeQueryArray($query_id, $args); + + // 결과가 없거나 오류 발생시 그냥 return + if(!$output->toBool()||!count($output->data)) return $output; + foreach($output->data as $key => $val) { + unset($_oComment); + $_oComment = new CommentItem(0); + $_oComment->setAttribute($val); + $output->data[$key] = $_oComment; + } + + return $output; + } + + /** + * @brief 모듈별 댓글 설정을 return + **/ + function getCommentConfig($module_srl) { + $oModuleModel = &getModel('module'); + $comment_config = $oModuleModel->getModulePartConfig('comment', $module_srl); + if(!isset($comment_config->comment_count)) $comment_config->comment_count = 50; + return $comment_config; + } + + function getCommentVotedMemberList() + { + $comment_srl = Context::get('comment_srl'); + if(!$comment_srl) return new Object(-1,'msg_invalid_request'); + + $point = Context::get('point'); + if($point != -1) $point = 1; + + $oCommentModel = &getModel('comment'); + $oComment = $oCommentModel->getComment($comment_srl, false, false); + $module_srl = $oComment->get('module_srl'); + if(!$module_srl) return new Object(-1, 'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $comment_config = $oModuleModel->getModulePartConfig('comment',$module_srl); + if($point == -1){ + if($comment_config->use_vote_down!='S') return new Object(-1, 'msg_invalid_request'); + $args->below_point = 0; + }else{ + if($comment_config->use_vote_up!='S') return new Object(-1, 'msg_invalid_request'); + $args->more_point = 0; + } + + $args->comment_srl = $comment_srl; + $output = executeQueryArray('comment.getVotedMemberList',$args); + if(!$output->toBool()) return $output; + + $oMemberModel = &getModel('member'); + if($output->data){ + foreach($output->data as $k => $d){ + $profile_image = $oMemberModel->getProfileImage($d->member_srl); + $output->data[$k]->src = $profile_image->src; + } + } + + $this->add('voted_member_list',$output->data); + } + } +?> diff --git a/modules/comment/comment.view.php b/modules/comment/comment.view.php index 9885cbe8f..9dd377efc 100644 --- a/modules/comment/comment.view.php +++ b/modules/comment/comment.view.php @@ -1,48 +1,48 @@ -module_srl; - if(!$current_module_srl) return new Object(); - } - - // 댓글 설정을 구함 - $oCommentModel = &getModel('comment'); - $comment_config = $oCommentModel->getCommentConfig($current_module_srl); - Context::set('comment_config', $comment_config); - - // 그룹 목록을 구함 - $oMemberModel = &getModel('member'); - $group_list = $oMemberModel->getGroups(); - Context::set('group_list', $group_list); - - // 템플릿 파일 지정 - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'comment_module_config'); - $obj .= $tpl; - - return new Object(); - } - } -?> +module_srl; + if(!$current_module_srl) return new Object(); + } + + // 댓글 설정을 구함 + $oCommentModel = &getModel('comment'); + $comment_config = $oCommentModel->getCommentConfig($current_module_srl); + Context::set('comment_config', $comment_config); + + // 그룹 목록을 구함 + $oMemberModel = &getModel('member'); + $group_list = $oMemberModel->getGroups(); + Context::set('group_list', $group_list); + + // 템플릿 파일 지정 + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'comment_module_config'); + $obj .= $tpl; + + return new Object(); + } + } +?> diff --git a/modules/comment/conf/info.xml b/modules/comment/conf/info.xml index 39d9b01b3..624c279fc 100644 --- a/modules/comment/conf/info.xml +++ b/modules/comment/conf/info.xml @@ -1,36 +1,36 @@ - - - 댓글 - コメント - 评论管理 - Comment - Bình luận - Commentarios - Комментарии - 評論 - Yorum - 게시판이나 블로그등의 댓글을 관리하는 모듈입니다. - 掲示板やブログなどのコメントを管理するモジュールです。 - 管理版面或博客评论的模块。 - Module for managing board/blog's comments - Module quản lý bình luận của bài viết và sổ lưu niệm - Es el módulo para manejar commentarios en blog o boletínes. - Модуль для управления комментариями форума/блога. - 管理討論板或部落格評論的模組。 - Pano ve blog yorumlarını yönetme modülü - 0.1 - 2007-02-28 - content - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 댓글 + コメント + 评论管理 + Comment + Bình luận + Commentarios + Комментарии + 評論 + Yorum + 게시판이나 블로그등의 댓글을 관리하는 모듈입니다. + 掲示板やブログなどのコメントを管理するモジュールです。 + 管理版面或博客评论的模块。 + Module for managing board/blog's comments + Module quản lý bình luận của bài viết và sổ lưu niệm + Es el módulo para manejar commentarios en blog o boletínes. + Модуль для управления комментариями форума/блога. + 管理討論板或部落格評論的模組。 + Pano ve blog yorumlarını yönetme modülü + 0.1 + 2007-02-28 + content + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/comment/lang/en.lang.php b/modules/comment/lang/en.lang.php index c201816e2..f86fc1d85 100644 --- a/modules/comment/lang/en.lang.php +++ b/modules/comment/lang/en.lang.php @@ -1,33 +1,33 @@ -cmd_comment_do = 'I want to'; - - $lang->comment_list = 'Comments List'; - $lang->cmd_delete_checked_comment = 'Delete selected item'; - - $lang->comment_count = 'Number of Comments'; - $lang->about_comment_count = 'Display the comments as much as user inputs the number and it will be moved to the List if the comments are over its number.'; - - $lang->msg_cart_is_null = 'Please select an article to delete'; - $lang->msg_checked_comment_is_deleted = '%d comment(s) is(are) successfully deleted.'; - - $lang->search_target_list = array( - 'content' => 'Content', - 'user_id' => 'ID', - 'user_name' => 'Name', - 'nick_name' => 'Nickname', - 'member_srl' => 'Member Serial', - 'email_address' => 'Email', - 'homepage' => 'Homepage', - 'regdate' => 'Date', - 'last_update' => 'Last update', - 'ipaddress' => 'IP Address', - ); - - $lang->no_text_comment = 'No text in this comment.'; -?> +cmd_comment_do = 'I want to'; + + $lang->comment_list = 'Comments List'; + $lang->cmd_delete_checked_comment = 'Delete selected item'; + + $lang->comment_count = 'Number of Comments'; + $lang->about_comment_count = 'Display the comments as much as user inputs the number and it will be moved to the List if the comments are over its number.'; + + $lang->msg_cart_is_null = 'Please select an article to delete'; + $lang->msg_checked_comment_is_deleted = '%d comment(s) is(are) successfully deleted.'; + + $lang->search_target_list = array( + 'content' => 'Content', + 'user_id' => 'ID', + 'user_name' => 'Name', + 'nick_name' => 'Nickname', + 'member_srl' => 'Member Serial', + 'email_address' => 'Email', + 'homepage' => 'Homepage', + 'regdate' => 'Date', + 'last_update' => 'Last update', + 'ipaddress' => 'IP Address', + ); + + $lang->no_text_comment = 'No text in this comment.'; +?> diff --git a/modules/comment/lang/es.lang.php b/modules/comment/lang/es.lang.php index 4240bb704..539ec1be8 100644 --- a/modules/comment/lang/es.lang.php +++ b/modules/comment/lang/es.lang.php @@ -1,33 +1,33 @@ -cmd_comment_do = 'Usted ...'; - - $lang->comment_list = 'Comentarios Lista'; - $lang->cmd_delete_checked_comment = 'Eliminar lo seleccionado' ; - - $lang->comment_count = '댓글 수'; - $lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.'; - - $lang->msg_cart_is_null = 'Selecciona el commentario que desea eliminar'; - $lang->msg_checked_comment_is_deleted = '%d comentario eliminado correctamente.'; - - $lang->search_target_list = array( - 'content' => 'Contenido', - 'user_id' => 'ID', - 'user_name' => 'Nombre', - 'nick_name' => 'Apodo', - 'member_srl' => 'Member Serial', - 'email_address' => 'Correo Electrónico', - 'homepage' => 'Página web', - 'regdate' => 'Fecha del registro', - 'last_update' => 'Ultima actualización', - 'ipaddress' => 'Dirección IP', - ); - - $lang->no_text_comment = 'No text in this comment.'; -?> +cmd_comment_do = 'Usted ...'; + + $lang->comment_list = 'Comentarios Lista'; + $lang->cmd_delete_checked_comment = 'Eliminar lo seleccionado' ; + + $lang->comment_count = '댓글 수'; + $lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.'; + + $lang->msg_cart_is_null = 'Selecciona el commentario que desea eliminar'; + $lang->msg_checked_comment_is_deleted = '%d comentario eliminado correctamente.'; + + $lang->search_target_list = array( + 'content' => 'Contenido', + 'user_id' => 'ID', + 'user_name' => 'Nombre', + 'nick_name' => 'Apodo', + 'member_srl' => 'Member Serial', + 'email_address' => 'Correo Electrónico', + 'homepage' => 'Página web', + 'regdate' => 'Fecha del registro', + 'last_update' => 'Ultima actualización', + 'ipaddress' => 'Dirección IP', + ); + + $lang->no_text_comment = 'No text in this comment.'; +?> diff --git a/modules/comment/lang/fr.lang.php b/modules/comment/lang/fr.lang.php index 39960e0be..b6b5a88be 100644 --- a/modules/comment/lang/fr.lang.php +++ b/modules/comment/lang/fr.lang.php @@ -1,34 +1,34 @@ - - * @brief Paquet du langage en français pour le module de Commentaire - **/ - - $lang->cmd_comment_do = 'Vous voudriez...'; - - $lang->comment_list = 'Liste des Commentaires'; - $lang->cmd_toggle_checked_comment = 'Renverser les choisis'; - $lang->cmd_delete_checked_comment = 'Supprimer les choisis'; - - $lang->comment_count = 'Limite de Commentaires'; - $lang->about_comment_count = 'Quand il y a plus de commentaires, ils seront bougés sur le liste.'; - - $lang->msg_cart_is_null = 'Choisissez un article à supprimer, S.V.P.'; - $lang->msg_checked_comment_is_deleted = '%d commentaire(s) est(sont) supprimé(s) avec succés.'; - - $lang->search_target_list = array( - 'content' => 'Contenu', - 'user_id' => 'Compte', - 'user_name' => 'Nom', - 'nick_name' => 'Surnom', - 'member_srl' => 'Numéro de Série du Membre', - 'email_address' => 'Mél', - 'homepage' => 'Page d\'Accueil', - 'regdate' => 'Jour', - 'last_update' => 'Mise à Jour', - 'ipaddress' => 'Adresse IP', - ); - - $lang->no_text_comment = 'No text in this comment.'; -?> + + * @brief Paquet du langage en français pour le module de Commentaire + **/ + + $lang->cmd_comment_do = 'Vous voudriez...'; + + $lang->comment_list = 'Liste des Commentaires'; + $lang->cmd_toggle_checked_comment = 'Renverser les choisis'; + $lang->cmd_delete_checked_comment = 'Supprimer les choisis'; + + $lang->comment_count = 'Limite de Commentaires'; + $lang->about_comment_count = 'Quand il y a plus de commentaires, ils seront bougés sur le liste.'; + + $lang->msg_cart_is_null = 'Choisissez un article à supprimer, S.V.P.'; + $lang->msg_checked_comment_is_deleted = '%d commentaire(s) est(sont) supprimé(s) avec succés.'; + + $lang->search_target_list = array( + 'content' => 'Contenu', + 'user_id' => 'Compte', + 'user_name' => 'Nom', + 'nick_name' => 'Surnom', + 'member_srl' => 'Numéro de Série du Membre', + 'email_address' => 'Mél', + 'homepage' => 'Page d\'Accueil', + 'regdate' => 'Jour', + 'last_update' => 'Mise à Jour', + 'ipaddress' => 'Adresse IP', + ); + + $lang->no_text_comment = 'No text in this comment.'; +?> diff --git a/modules/comment/lang/jp.lang.php b/modules/comment/lang/jp.lang.php index 05c55c038..925f6ab95 100644 --- a/modules/comment/lang/jp.lang.php +++ b/modules/comment/lang/jp.lang.php @@ -1,34 +1,34 @@ -cmd_comment_do = 'このコメントを…'; - - $lang->comment_list = 'コメントリスト'; - $lang->cmd_toggle_checked_comment = '選択項目の反転'; - $lang->cmd_delete_checked_comment = '選択項目削除'; - - $lang->comment_count = 'コメント数'; - $lang->about_comment_count = 'コメントを指定した数だけ表示し、それ以上はリスト化します。'; - - $lang->msg_cart_is_null = '削除するコメントを選択して下さい。'; - $lang->msg_checked_comment_is_deleted = '%d個のコメントを削除しました。'; - - $lang->search_target_list = array( - 'content' => '内容', - 'user_id' => 'ユーザID', - 'user_name' => '名前', - 'nick_name' => 'ニックネーム', - 'member_srl' => '会員番号', - 'email_address' => 'メールアドレス', - 'homepage' => 'ホームページURL', - 'regdate' => '登録日', - 'last_update' => '最終更新日 ', - 'ipaddress' => 'IPアドレス', - ); - - $lang->no_text_comment = 'No text in this comment.'; -?> +cmd_comment_do = 'このコメントを…'; + + $lang->comment_list = 'コメントリスト'; + $lang->cmd_toggle_checked_comment = '選択項目の反転'; + $lang->cmd_delete_checked_comment = '選択項目削除'; + + $lang->comment_count = 'コメント数'; + $lang->about_comment_count = 'コメントを指定した数だけ表示し、それ以上はリスト化します。'; + + $lang->msg_cart_is_null = '削除するコメントを選択して下さい。'; + $lang->msg_checked_comment_is_deleted = '%d個のコメントを削除しました。'; + + $lang->search_target_list = array( + 'content' => '内容', + 'user_id' => 'ユーザID', + 'user_name' => '名前', + 'nick_name' => 'ニックネーム', + 'member_srl' => '会員番号', + 'email_address' => 'メールアドレス', + 'homepage' => 'ホームページURL', + 'regdate' => '登録日', + 'last_update' => '最終更新日 ', + 'ipaddress' => 'IPアドレス', + ); + + $lang->no_text_comment = 'No text in this comment.'; +?> diff --git a/modules/comment/lang/ko.lang.php b/modules/comment/lang/ko.lang.php index 1c29e83c9..19d9240cf 100644 --- a/modules/comment/lang/ko.lang.php +++ b/modules/comment/lang/ko.lang.php @@ -1,34 +1,34 @@ -cmd_comment_do = '이 댓글을...'; - - $lang->comment_list = '댓글 목록'; - $lang->cmd_toggle_checked_comment = '선택항목 반전'; - $lang->cmd_delete_checked_comment = '선택항목 삭제'; - - $lang->comment_count = '댓글 수'; - $lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.'; - - $lang->msg_cart_is_null = '삭제할 글을 선택해주세요.'; - $lang->msg_checked_comment_is_deleted = '%d개의 댓글이 삭제되었습니다.'; - - $lang->search_target_list = array( - 'content' => '내용', - 'user_id' => '아이디', - 'user_name' => '이름', - 'nick_name' => '닉네임', - 'member_srl' => '회원 번호', - 'email_address' => '이메일 주소', - 'homepage' => '홈페이지', - 'regdate' => '등록일', - 'last_update' => '최근수정일 ', - 'ipaddress' => 'IP 주소', - ); - - $lang->no_text_comment = '텍스트가 없는 댓글입니다.'; -?> +cmd_comment_do = '이 댓글을...'; + + $lang->comment_list = '댓글 목록'; + $lang->cmd_toggle_checked_comment = '선택항목 반전'; + $lang->cmd_delete_checked_comment = '선택항목 삭제'; + + $lang->comment_count = '댓글 수'; + $lang->about_comment_count = '댓글을 정해진 수 만큼만 표시하고 그 이상일 경우 목록으로 이동할 수 있게 합니다.'; + + $lang->msg_cart_is_null = '삭제할 글을 선택해주세요.'; + $lang->msg_checked_comment_is_deleted = '%d개의 댓글이 삭제되었습니다.'; + + $lang->search_target_list = array( + 'content' => '내용', + 'user_id' => '아이디', + 'user_name' => '이름', + 'nick_name' => '닉네임', + 'member_srl' => '회원 번호', + 'email_address' => '이메일 주소', + 'homepage' => '홈페이지', + 'regdate' => '등록일', + 'last_update' => '최근수정일 ', + 'ipaddress' => 'IP 주소', + ); + + $lang->no_text_comment = '텍스트가 없는 댓글입니다.'; +?> diff --git a/modules/comment/lang/ru.lang.php b/modules/comment/lang/ru.lang.php index 331c41b70..cba37eb9c 100644 --- a/modules/comment/lang/ru.lang.php +++ b/modules/comment/lang/ru.lang.php @@ -1,34 +1,34 @@ -cmd_comment_do = 'Эту запись...'; - - $lang->comment_list = 'Список записей'; - $lang->cmd_toggle_checked_comment = 'Изменить выбранное'; - $lang->cmd_delete_checked_comment = 'Удалить выбранное'; - - $lang->comment_count = 'Количество ответов'; - $lang->about_comment_count = 'Отображается указанное количество ответов, после превышения этого количества производится переход к списку.'; - - $lang->msg_cart_is_null = 'Пожалуйста, выберите записи для удаления.'; - $lang->msg_checked_comment_is_deleted = '%d записьуспешно удалена'; - - $lang->search_target_list = array( - 'content' => 'Содержание', - 'user_id' => 'ID', - 'user_name' => 'Имя', - 'nick_name' => 'Ник', - 'member_srl' => 'Номер пользователя', - 'email_address' => 'Email адрес', - 'homepage' => 'Домашняя страница', - 'regdate' => 'Дата регистрации', - 'last_update' => 'Дата последнего обновления', - 'ipaddress' => 'IP-адрес', - ); - - $lang->no_text_comment = 'No text in this comment.'; -?> +cmd_comment_do = 'Эту запись...'; + + $lang->comment_list = 'Список записей'; + $lang->cmd_toggle_checked_comment = 'Изменить выбранное'; + $lang->cmd_delete_checked_comment = 'Удалить выбранное'; + + $lang->comment_count = 'Количество ответов'; + $lang->about_comment_count = 'Отображается указанное количество ответов, после превышения этого количества производится переход к списку.'; + + $lang->msg_cart_is_null = 'Пожалуйста, выберите записи для удаления.'; + $lang->msg_checked_comment_is_deleted = '%d записьуспешно удалена'; + + $lang->search_target_list = array( + 'content' => 'Содержание', + 'user_id' => 'ID', + 'user_name' => 'Имя', + 'nick_name' => 'Ник', + 'member_srl' => 'Номер пользователя', + 'email_address' => 'Email адрес', + 'homepage' => 'Домашняя страница', + 'regdate' => 'Дата регистрации', + 'last_update' => 'Дата последнего обновления', + 'ipaddress' => 'IP-адрес', + ); + + $lang->no_text_comment = 'No text in this comment.'; +?> diff --git a/modules/comment/lang/tr.lang.php b/modules/comment/lang/tr.lang.php index 56042e612..0db6a0b8e 100644 --- a/modules/comment/lang/tr.lang.php +++ b/modules/comment/lang/tr.lang.php @@ -1,33 +1,33 @@ -cmd_comment_do = 'Şunu yap'; - - $lang->comment_list = 'Yorum Listesi'; - $lang->cmd_delete_checked_comment = 'Seçili parçayı sil'; - - $lang->comment_count = 'Yorum Sayısı'; - $lang->about_comment_count = 'Yorumları, kullanıcının girdiği rakam kadar gösterin. Eğer yorum sayısı belirlenen sayıyı aşarsa, yorum Liste\'ye taşınır.'; - - $lang->msg_cart_is_null = 'Lütfen silinecek makaleyi seçiniz'; - $lang->msg_checked_comment_is_deleted = '%d yorum başarıyla silindi.'; - - $lang->search_target_list = array( - 'content' => 'İçerik', - 'user_id' => 'ID', - 'user_name' => 'İsim', - 'nick_name' => 'Takma Ad', - 'member_srl' => 'Üye Dizisi', - 'email_address' => 'E-posta', - 'homepage' => 'Anasayfa', - 'regdate' => 'Tarih', - 'last_update' => 'Son Güncelleştirme', - 'ipaddress' => 'IP Adresi', - ); - - $lang->no_text_comment = 'Bu yorumda herhangi bir metin yok.'; -?> +cmd_comment_do = 'Şunu yap'; + + $lang->comment_list = 'Yorum Listesi'; + $lang->cmd_delete_checked_comment = 'Seçili parçayı sil'; + + $lang->comment_count = 'Yorum Sayısı'; + $lang->about_comment_count = 'Yorumları, kullanıcının girdiği rakam kadar gösterin. Eğer yorum sayısı belirlenen sayıyı aşarsa, yorum Liste\'ye taşınır.'; + + $lang->msg_cart_is_null = 'Lütfen silinecek makaleyi seçiniz'; + $lang->msg_checked_comment_is_deleted = '%d yorum başarıyla silindi.'; + + $lang->search_target_list = array( + 'content' => 'İçerik', + 'user_id' => 'ID', + 'user_name' => 'İsim', + 'nick_name' => 'Takma Ad', + 'member_srl' => 'Üye Dizisi', + 'email_address' => 'E-posta', + 'homepage' => 'Anasayfa', + 'regdate' => 'Tarih', + 'last_update' => 'Son Güncelleştirme', + 'ipaddress' => 'IP Adresi', + ); + + $lang->no_text_comment = 'Bu yorumda herhangi bir metin yok.'; +?> diff --git a/modules/comment/lang/vi.lang.php b/modules/comment/lang/vi.lang.php index a8c2629b5..8e5055db0 100644 --- a/modules/comment/lang/vi.lang.php +++ b/modules/comment/lang/vi.lang.php @@ -1,35 +1,35 @@ -cmd_comment_do = 'Bình chọn / Phê bình'; - - $lang->comment_list = 'Danh sách bình luận'; - $lang->cmd_delete_checked_comment = 'Xóa những bình luận đã chọn'; - - $lang->comment_count = 'Số bình luận'; - $lang->about_comment_count = 'Hiển thị số bình luận được gửi, và nó sẽ tạo một danh sách nếu có nhiều bình luận.'; - - $lang->msg_cart_is_null = 'Xin hãy chọn một bài viết để xóa.'; - $lang->msg_checked_comment_is_deleted = '%d bình luận đã được xóa.'; - - $lang->search_target_list = array( - 'content' => 'Nội dung', - 'user_id' => 'ID người gửi', - 'user_name' => 'Tên', - 'nick_name' => 'Nickname', - 'member_srl' => 'Mã số người gửi', - 'email_address' => 'Email', - 'homepage' => 'Trang chủ', - 'regdate' => 'Ngày', - 'last_update' => 'Cập nhật lần cuối', - 'ipaddress' => 'IP', - ); - - $lang->no_text_comment = 'No text in this comment.'; -?> +cmd_comment_do = 'Bình chọn / Phê bình'; + + $lang->comment_list = 'Danh sách bình luận'; + $lang->cmd_delete_checked_comment = 'Xóa những bình luận đã chọn'; + + $lang->comment_count = 'Số bình luận'; + $lang->about_comment_count = 'Hiển thị số bình luận được gửi, và nó sẽ tạo một danh sách nếu có nhiều bình luận.'; + + $lang->msg_cart_is_null = 'Xin hãy chọn một bài viết để xóa.'; + $lang->msg_checked_comment_is_deleted = '%d bình luận đã được xóa.'; + + $lang->search_target_list = array( + 'content' => 'Nội dung', + 'user_id' => 'ID người gửi', + 'user_name' => 'Tên', + 'nick_name' => 'Nickname', + 'member_srl' => 'Mã số người gửi', + 'email_address' => 'Email', + 'homepage' => 'Trang chủ', + 'regdate' => 'Ngày', + 'last_update' => 'Cập nhật lần cuối', + 'ipaddress' => 'IP', + ); + + $lang->no_text_comment = 'No text in this comment.'; +?> diff --git a/modules/comment/lang/zh-CN.lang.php b/modules/comment/lang/zh-CN.lang.php index b2cdf02ac..ae00078ad 100644 --- a/modules/comment/lang/zh-CN.lang.php +++ b/modules/comment/lang/zh-CN.lang.php @@ -1,34 +1,34 @@ -cmd_comment_do = '将把此评论..'; - - $lang->comment_list = '评论列表'; - $lang->cmd_toggle_checked_comment = '反选'; - $lang->cmd_delete_checked_comment = '删除所选'; - - $lang->comment_count = '每页评论数'; - $lang->about_comment_count = '可以指定要显示的每页评论数。'; - - $lang->msg_cart_is_null = '请选择要删除的评论。'; - $lang->msg_checked_comment_is_deleted = '已删除%d个评论。'; - - $lang->search_target_list = array( - 'content' => '内容', - 'user_id' => 'I D', - 'user_name' => '姓名', - 'nick_name' => '昵称', - 'member_srl' => '会员编号', - 'email_address' => '电子信箱', - 'homepage' => '主页', - 'regdate' => '日期', - 'last_update' => '最后更新 ', - 'ipaddress' => 'IP 地址', - ); - - $lang->no_text_comment = 'No text in this comment.'; -?> +cmd_comment_do = '将把此评论..'; + + $lang->comment_list = '评论列表'; + $lang->cmd_toggle_checked_comment = '反选'; + $lang->cmd_delete_checked_comment = '删除所选'; + + $lang->comment_count = '每页评论数'; + $lang->about_comment_count = '可以指定要显示的每页评论数。'; + + $lang->msg_cart_is_null = '请选择要删除的评论。'; + $lang->msg_checked_comment_is_deleted = '已删除%d个评论。'; + + $lang->search_target_list = array( + 'content' => '内容', + 'user_id' => 'I D', + 'user_name' => '姓名', + 'nick_name' => '昵称', + 'member_srl' => '会员编号', + 'email_address' => '电子信箱', + 'homepage' => '主页', + 'regdate' => '日期', + 'last_update' => '最后更新 ', + 'ipaddress' => 'IP 地址', + ); + + $lang->no_text_comment = 'No text in this comment.'; +?> diff --git a/modules/comment/lang/zh-TW.lang.php b/modules/comment/lang/zh-TW.lang.php index 0048e4675..213b23fb6 100644 --- a/modules/comment/lang/zh-TW.lang.php +++ b/modules/comment/lang/zh-TW.lang.php @@ -1,34 +1,34 @@ -cmd_comment_do = '將此評論..'; - - $lang->comment_list = '評論列表'; - $lang->cmd_toggle_checked_comment = '反選'; - $lang->cmd_delete_checked_comment = '刪除所選'; - - $lang->comment_count = '每頁評論數'; - $lang->about_comment_count = '可以指定要顯示的每頁評論數。'; - - $lang->msg_cart_is_null = '請選擇要刪除的評論。'; - $lang->msg_checked_comment_is_deleted = '已刪除%d個評論。'; - - $lang->search_target_list = array( - 'content' => '內容', - 'user_id' => '帳號', - 'user_name' => '姓名', - 'nick_name' => '暱稱', - 'member_srl' => '會員編號', - 'email_address' => '電子信箱', - 'homepage' => '主頁', - 'regdate' => '日期', - 'last_update' => '最後更新', - 'ipaddress' => 'IP位址', - ); - - $lang->no_text_comment = 'No text in this comment.'; -?> +cmd_comment_do = '將此評論..'; + + $lang->comment_list = '評論列表'; + $lang->cmd_toggle_checked_comment = '反選'; + $lang->cmd_delete_checked_comment = '刪除所選'; + + $lang->comment_count = '每頁評論數'; + $lang->about_comment_count = '可以指定要顯示的每頁評論數。'; + + $lang->msg_cart_is_null = '請選擇要刪除的評論。'; + $lang->msg_checked_comment_is_deleted = '已刪除%d個評論。'; + + $lang->search_target_list = array( + 'content' => '內容', + 'user_id' => '帳號', + 'user_name' => '姓名', + 'nick_name' => '暱稱', + 'member_srl' => '會員編號', + 'email_address' => '電子信箱', + 'homepage' => '主頁', + 'regdate' => '日期', + 'last_update' => '最後更新', + 'ipaddress' => 'IP位址', + ); + + $lang->no_text_comment = 'No text in this comment.'; +?> diff --git a/modules/comment/tpl/comment_list.html b/modules/comment/tpl/comment_list.html index 5a27b14f6..bba19cf53 100644 --- a/modules/comment/tpl/comment_list.html +++ b/modules/comment/tpl/comment_list.html @@ -1,75 +1,75 @@ - - - - -
    -
    - - - -
    - - - - {$lang->cmd_cancel} -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - {@ $comment = cut_str(trim(htmlspecialchars(strip_tags($val->content))), 200, '...')} - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->comment}
    {$lang->nick_name}
    {$lang->date}
    {$lang->ipaddress}
    {$no}{$comment}{$lang->no_text_comment}{htmlspecialchars($val->nick_name)}{(zdate($val->regdate,"Y-m-d\nH:i:s"))}{$val->ipaddress}
    - -
    - - - - + + + + +
    +
    + + + +
    + + + + {$lang->cmd_cancel} +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + {@ $comment = cut_str(trim(htmlspecialchars(strip_tags($val->content))), 200, '...')} + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->comment}
    {$lang->nick_name}
    {$lang->date}
    {$lang->ipaddress}
    {$no}{$comment}{$lang->no_text_comment}{htmlspecialchars($val->nick_name)}{(zdate($val->regdate,"Y-m-d\nH:i:s"))}{$val->ipaddress}
    + +
    + + + + diff --git a/modules/comment/tpl/declared_list.html b/modules/comment/tpl/declared_list.html index aaa6990a5..9dbe1b7be 100644 --- a/modules/comment/tpl/declared_list.html +++ b/modules/comment/tpl/declared_list.html @@ -1,55 +1,55 @@ - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->comment}
    {$lang->user_name}
    {$lang->date}
    {$lang->cmd_declare}
    {$lang->ipaddress}
    {$no} {$oComment->getSummary(100)}{$oComment->getNickName()}{$oComment->getRegdate("Y-m-d")}{$oComment->get('declared_count')}{$oComment->get('ipaddress')}
    - {$lang->cmd_cancel_declare} - {$lang->cmd_select_all} - {$lang->cmd_reverse_all} - -
    -
    - - -
    - + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->comment}
    {$lang->user_name}
    {$lang->date}
    {$lang->cmd_declare}
    {$lang->ipaddress}
    {$no} {$oComment->getSummary(100)}{$oComment->getNickName()}{$oComment->getRegdate("Y-m-d")}{$oComment->get('declared_count')}{$oComment->get('ipaddress')}
    + {$lang->cmd_cancel_declare} + {$lang->cmd_select_all} + {$lang->cmd_reverse_all} + +
    +
    + + +
    + diff --git a/modules/communication/communication.admin.controller.php b/modules/communication/communication.admin.controller.php index 9dfdf0c11..45b514919 100644 --- a/modules/communication/communication.admin.controller.php +++ b/modules/communication/communication.admin.controller.php @@ -1,35 +1,35 @@ -skin) $args->skin = "default"; - if(!$args->colorset) $args->colorset = "white"; - if(!$args->editor_skin) $args->editor_skin = "default"; - - // module Controller 객체 생성하여 입력 - $oModuleController = &getController('module'); - $output = $oModuleController->insertModuleConfig('communication',$args); - - return $output; - } - - } -?> +skin) $args->skin = "default"; + if(!$args->colorset) $args->colorset = "white"; + if(!$args->editor_skin) $args->editor_skin = "default"; + + // module Controller 객체 생성하여 입력 + $oModuleController = &getController('module'); + $output = $oModuleController->insertModuleConfig('communication',$args); + + return $output; + } + + } +?> diff --git a/modules/communication/communication.admin.model.php b/modules/communication/communication.admin.model.php index 6fbc91ecf..594bc75e2 100644 --- a/modules/communication/communication.admin.model.php +++ b/modules/communication/communication.admin.model.php @@ -1,40 +1,40 @@ -loadSkinInfo($this->module_path, $skin); - Context::set('skin_info', $skin_info); - - $oModuleModel = &getModel('module'); - $communication_config = $oModuleModel->getModuleConfig('communication'); - if(!$communication_config->colorset) $communication_config->colorset = "white"; - Context::set('communication_config', $communication_config); - - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list'); - } - - $this->add('tpl', $tpl); - } - - } -?> +loadSkinInfo($this->module_path, $skin); + Context::set('skin_info', $skin_info); + + $oModuleModel = &getModel('module'); + $communication_config = $oModuleModel->getModuleConfig('communication'); + if(!$communication_config->colorset) $communication_config->colorset = "white"; + Context::set('communication_config', $communication_config); + + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list'); + } + + $this->add('tpl', $tpl); + } + + } +?> diff --git a/modules/communication/communication.admin.view.php b/modules/communication/communication.admin.view.php index 5b893a025..9dbc01a65 100644 --- a/modules/communication/communication.admin.view.php +++ b/modules/communication/communication.admin.view.php @@ -1,40 +1,40 @@ -getConfig() ); - - // 에디터 스킨 목록을 구함 - Context::set('editor_skin_list', $oEditorModel->getEditorSkinList() ); - - // 커뮤니케이션 스킨 목록을 구함 - Context::set('communication_skin_list', $oModuleModel->getSkins($this->module_path) ); - - // template 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('index'); - } - - } -?> +getConfig() ); + + // 에디터 스킨 목록을 구함 + Context::set('editor_skin_list', $oEditorModel->getEditorSkinList() ); + + // 커뮤니케이션 스킨 목록을 구함 + Context::set('communication_skin_list', $oModuleModel->getSkins($this->module_path) ); + + // template 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('index'); + } + + } +?> diff --git a/modules/communication/communication.class.php b/modules/communication/communication.class.php index caec94eb5..57c0fca58 100644 --- a/modules/communication/communication.class.php +++ b/modules/communication/communication.class.php @@ -1,42 +1,42 @@ - + diff --git a/modules/communication/communication.controller.php b/modules/communication/communication.controller.php index 15ebfa1af..1360d6cec 100644 --- a/modules/communication/communication.controller.php +++ b/modules/communication/communication.controller.php @@ -1,418 +1,418 @@ -allow_message = Context::get('allow_message'); - if(!in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; - - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - - $output = executeQuery('communication.updateAllowMessage', $args); - - return $output; - } - - /** - * @brief 쪽지 발송 - **/ - function procCommunicationSendMessage() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 변수 검사 - $receiver_srl = Context::get('receiver_srl'); - if(!$receiver_srl) return new Object(-1, 'msg_not_exists_member'); - - $title = trim(Context::get('title')); - if(!$title) return new Object(-1, 'msg_title_is_null'); - - $content = trim(Context::get('content')); - if(!$content) return new Object(-1, 'msg_content_is_null'); - - $send_mail = Context::get('send_mail'); - if($send_mail != 'Y') $send_mail = 'N'; - - // 받을 회원이 있는지에 대한 검사 - $oMemberModel = &getModel('member'); - $oCommunicationModel = &getModel('communication'); - $receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); - if($receiver_member_info->member_srl != $receiver_srl) return new Object(-1, 'msg_not_exists_member'); - - // 받을 회원의 쪽지 수신여부 검사 (최고관리자이면 패스) - if($logged_info->is_admin != 'Y') { - if($receiver_member_info->allow_message == 'F') { - if(!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) return new object(-1, 'msg_allow_message_to_friend'); - } elseif($receiver_member_info->allow_messge == 'N') { - return new object(-1, 'msg_disallow_message'); - } - } - - // 쪽지 발송 - $output = $this->sendMessage($logged_info->member_srl, $receiver_srl, $title, $content); - - // 메일로도 발송 - if($output->toBool() && $send_mail == 'Y') { - $view_url = Context::getRequestUri(); - $content = sprintf("%s

    From : %s",$content, $view_url, $view_url); - $oMail = new Mail(); - $oMail->setTitle($title); - $oMail->setContent($content); - $oMail->setSender($logged_info->user_name, $logged_info->email_address); - $oMail->setReceiptor($receiver_member_info->user_name, $receiver_member_info->email_address); - $oMail->send(); - } - - return $output; - } - - function sendMessage($sender_srl, $receiver_srl, $title, $content, $sender_log = true) { - $content = removeHackTag($content); - $title = htmlspecialchars($title); - - // 보내는 사용자의 쪽지함에 넣을 쪽지 - $sender_args->sender_srl = $sender_srl; - $sender_args->receiver_srl = $receiver_srl; - $sender_args->message_type = 'S'; - $sender_args->title = $title; - $sender_args->content = $content; - $sender_args->readed = 'N'; - $sender_args->regdate = date("YmdHis"); - $sender_args->related_srl = getNextSequence(); - $sender_args->message_srl = getNextSequence(); - $sender_args->list_order = getNextSequence()*-1; - - // 받는 회원의 쪽지함에 넣을 쪽지 - $receiver_args->message_srl = $sender_args->related_srl; - $receiver_args->related_srl = 0; - $receiver_args->list_order = $sender_args->related_srl*-1; - $receiver_args->sender_srl = $sender_srl; - if(!$receiver_args->sender_srl) $receiver_args->sender_srl = $receiver_srl; - $receiver_args->receiver_srl = $receiver_srl; - $receiver_args->message_type = 'R'; - $receiver_args->title = $title; - $receiver_args->content = $content; - $receiver_args->readed = 'N'; - $receiver_args->regdate = date("YmdHis"); - - $oDB = &DB::getInstance(); - $oDB->begin(); - - // 발송하는 회원의 쪽지함에 넣을 쪽지 - if($sender_srl && $sender_log) { - $output = executeQuery('communication.sendMessage', $sender_args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - } - - // 받을 회원의 쪽지함에 넣을 쪽지 - $output = executeQuery('communication.sendMessage', $receiver_args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 받는 회원의 쪽지 발송 플래그 생성 (파일로 생성) - $flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($receiver_srl); - FileHandler::makeDir($flag_path); - $flag_file = sprintf('%s%s', $flag_path, $receiver_srl); - $flag_count = FileHandler::readFile($flag_file); - FileHandler::writeFile($flag_file, ++$flag_count); - - $oDB->commit(); - - return new Object(0,'success_sended'); - } - - /** - * @brief 특정 쪽지를 보관함으로 보냄 - **/ - function procCommunicationStoreMessage() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 변수 체크 - $message_srl = Context::get('message_srl'); - if(!$message_srl) return new Object(-1,'msg_invalid_request'); - - // 쪽지를 가져옴 - $oCommunicationModel = &getModel('communication'); - $message = $oCommunicationModel->getSelectedMessage($message_srl); - if(!$message || $message->message_type != 'R') return new Object(-1,'msg_invalid_request'); - - $args->message_srl = $message_srl; - $args->receiver_srl = $logged_info->member_srl; - $output = executeQuery('communication.setMessageStored', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_registed'); - } - - /** - * @brief 쪽지 삭제 - **/ - function procCommunicationDeleteMessage() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - // 변수 체크 - $message_srl = Context::get('message_srl'); - if(!$message_srl) return new Object(-1,'msg_invalid_request'); - - // 쪽지를 가져옴 - $oCommunicationModel = &getModel('communication'); - $message = $oCommunicationModel->getSelectedMessage($message_srl); - if(!$message) return new Object(-1,'msg_invalid_request'); - - // 발송인+type=S or 수신인+type=R 검사 - if($message->sender_srl == $member_srl && $message->message_type == 'S') { - if(!$message_srl) return new Object(-1, 'msg_invalid_request'); - } elseif($message->receiver_srl == $member_srl && $message->message_type == 'R') { - if(!$message_srl) return new Object(-1, 'msg_invalid_request'); - } - - // 삭제 - $args->message_srl = $message_srl; - $output = executeQuery('communication.deleteMessage', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_deleted'); - } - - /** - * @brief 선택된 다수의 쪽지 삭제 - **/ - function procCommunicationDeleteMessages() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - // 변수 체크 - $message_srl_list = trim(Context::get('message_srl_list')); - if(!$message_srl_list) return new Object(-1, 'msg_cart_is_null'); - - $message_srl_list = explode('|@|', $message_srl_list); - if(!count($message_srl_list)) return new Object(-1, 'msg_cart_is_null'); - - $message_type = Context::get('message_type'); - if(!$message_type || !in_array($message_type, array('R','S','T'))) return new Object(-1, 'msg_invalid_request'); - - $message_count = count($message_srl_list); - $target = array(); - for($i=0;$i<$message_count;$i++) { - $message_srl = (int)trim($message_srl_list[$i]); - if(!$message_srl) continue; - $target[] = $message_srl; - } - if(!count($target)) return new Object(-1,'msg_cart_is_null'); - - // 삭제 - $args->message_srls = implode(',',$target); - $args->message_type = $message_type; - - if($message_type == 'S') $args->sender_srl = $member_srl; - else $args->receiver_srl = $member_srl; - - $output = executeQuery('communication.deleteMessages', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_deleted'); - } - - /** - * @brief 친구 추가 - **/ - function procCommunicationAddFriend() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - - $target_srl = (int)trim(Context::get('target_srl')); - if(!$target_srl) return new Object(-1,'msg_invalid_request'); - - // 변수 정리 - $args->friend_srl = getNextSequence(); - $args->list_order = $args->friend_srl * -1; - $args->friend_group_srl = Context::get('friend_group_srl'); - $args->member_srl = $logged_info->member_srl; - $args->target_srl = $target_srl; - $output = executeQuery('communication.addFriend', $args); - if(!$output->toBool()) return $output; - - $this->add('member_srl', $target_srl); - $this->setMessage('success_registed'); - } - - /** - * @brief 등록된 친구의 그룹 이동 - **/ - function procCommunicationMoveFriend() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 변수 체크 - $friend_srl_list = trim(Context::get('friend_srl_list')); - if(!$friend_srl_list) return new Object(-1, 'msg_cart_is_null'); - - $friend_srl_list = explode('|@|', $friend_srl_list); - if(!count($friend_srl_list)) return new Object(-1, 'msg_cart_is_null'); - - $friend_count = count($friend_srl_list); - $target = array(); - for($i=0;$i<$friend_count;$i++) { - $friend_srl = (int)trim($friend_srl_list[$i]); - if(!$friend_srl) continue; - $target[] = $friend_srl; - } - if(!count($target)) return new Object(-1,'msg_cart_is_null'); - - // 변수 정리 - $args->friend_srls = implode(',',$target); - $args->member_srl = $logged_info->member_srl; - $args->friend_group_srl = Context::get('target_friend_group_srl'); - - $output = executeQuery('communication.moveFriend', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_moved'); - } - - /** - * @brief 친구 삭제 - **/ - function procCommunicationDeleteFriend() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - // 변수 체크 - $friend_srl_list = trim(Context::get('friend_srl_list')); - if(!$friend_srl_list) return new Object(-1, 'msg_cart_is_null'); - - $friend_srl_list = explode('|@|', $friend_srl_list); - if(!count($friend_srl_list)) return new Object(-1, 'msg_cart_is_null'); - - $friend_count = count($friend_srl_list); - $target = array(); - for($i=0;$i<$friend_count;$i++) { - $friend_srl = (int)trim($friend_srl_list[$i]); - if(!$friend_srl) continue; - $target[] = $friend_srl; - } - if(!count($target)) return new Object(-1,'msg_cart_is_null'); - - // 삭제 - $args->friend_srls = implode(',',$target); - $args->member_srl = $logged_info->member_srl; - $output = executeQuery('communication.deleteFriend', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_deleted'); - } - - /** - * @brief 친구 그룹 추가 - **/ - function procCommunicationAddFriendGroup() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 변수 정리 - $args->friend_group_srl = trim(Context::get('friend_group_srl')); - $args->member_srl = $logged_info->member_srl; - $args->title = Context::get('title'); - $args->title = htmlspecialchars($args->title); - if(!$args->title) return new Object(-1, 'msg_invalid_request'); - - // friend_group_srl이 있으면 수정 - if($args->friend_group_srl) { - $output = executeQuery('communication.renameFriendGroup', $args); - $msg_code = 'success_updated'; - - // 아니면 입력 - } else { - $output = executeQuery('communication.addFriendGroup', $args); - $msg_code = 'success_registed'; - } - - if(!$output->toBool()) return $output; - - $this->setMessage($msg_code); - } - - /** - * @brief 친구 그룹 이름 변경 - **/ - function procCommunicationRenameFriendGroup() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 변수 정리 - $args->friend_group_srl= Context::get('friend_group_srl'); - $args->member_srl = $logged_info->member_srl; - $args->title = Context::get('title'); - $args->title = htmlspecialchars($args->title); - if(!$args->title) return new Object(-1, 'msg_invalid_request'); - - $output = executeQuery('communication.renameFriendGroup', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_updated'); - } - - /** - * @brief 친구 그룹 삭제 - **/ - function procCommunicationDeleteFriendGroup() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 변수 정리 - $args->friend_group_srl = Context::get('friend_group_srl'); - $args->member_srl = $logged_info->member_srl; - $output = executeQuery('communication.deleteFriendGroup', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_deleted'); - } - - /** - * @brief 특정 쪽지의 상태를 읽은 상태로 변경 - **/ - function setMessageReaded($message_srl) { - $args->message_srl = $message_srl; - $args->related_srl = $message_srl; - return executeQuery('communication.setMessageReaded', $args); - } - - } -?> +allow_message = Context::get('allow_message'); + if(!in_array($args->allow_message, array('Y','N','F'))) $args->allow_message = 'Y'; + + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + + $output = executeQuery('communication.updateAllowMessage', $args); + + return $output; + } + + /** + * @brief 쪽지 발송 + **/ + function procCommunicationSendMessage() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 변수 검사 + $receiver_srl = Context::get('receiver_srl'); + if(!$receiver_srl) return new Object(-1, 'msg_not_exists_member'); + + $title = trim(Context::get('title')); + if(!$title) return new Object(-1, 'msg_title_is_null'); + + $content = trim(Context::get('content')); + if(!$content) return new Object(-1, 'msg_content_is_null'); + + $send_mail = Context::get('send_mail'); + if($send_mail != 'Y') $send_mail = 'N'; + + // 받을 회원이 있는지에 대한 검사 + $oMemberModel = &getModel('member'); + $oCommunicationModel = &getModel('communication'); + $receiver_member_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); + if($receiver_member_info->member_srl != $receiver_srl) return new Object(-1, 'msg_not_exists_member'); + + // 받을 회원의 쪽지 수신여부 검사 (최고관리자이면 패스) + if($logged_info->is_admin != 'Y') { + if($receiver_member_info->allow_message == 'F') { + if(!$oCommunicationModel->isFriend($receiver_member_info->member_srl)) return new object(-1, 'msg_allow_message_to_friend'); + } elseif($receiver_member_info->allow_messge == 'N') { + return new object(-1, 'msg_disallow_message'); + } + } + + // 쪽지 발송 + $output = $this->sendMessage($logged_info->member_srl, $receiver_srl, $title, $content); + + // 메일로도 발송 + if($output->toBool() && $send_mail == 'Y') { + $view_url = Context::getRequestUri(); + $content = sprintf("%s

    From : %s",$content, $view_url, $view_url); + $oMail = new Mail(); + $oMail->setTitle($title); + $oMail->setContent($content); + $oMail->setSender($logged_info->user_name, $logged_info->email_address); + $oMail->setReceiptor($receiver_member_info->user_name, $receiver_member_info->email_address); + $oMail->send(); + } + + return $output; + } + + function sendMessage($sender_srl, $receiver_srl, $title, $content, $sender_log = true) { + $content = removeHackTag($content); + $title = htmlspecialchars($title); + + // 보내는 사용자의 쪽지함에 넣을 쪽지 + $sender_args->sender_srl = $sender_srl; + $sender_args->receiver_srl = $receiver_srl; + $sender_args->message_type = 'S'; + $sender_args->title = $title; + $sender_args->content = $content; + $sender_args->readed = 'N'; + $sender_args->regdate = date("YmdHis"); + $sender_args->related_srl = getNextSequence(); + $sender_args->message_srl = getNextSequence(); + $sender_args->list_order = getNextSequence()*-1; + + // 받는 회원의 쪽지함에 넣을 쪽지 + $receiver_args->message_srl = $sender_args->related_srl; + $receiver_args->related_srl = 0; + $receiver_args->list_order = $sender_args->related_srl*-1; + $receiver_args->sender_srl = $sender_srl; + if(!$receiver_args->sender_srl) $receiver_args->sender_srl = $receiver_srl; + $receiver_args->receiver_srl = $receiver_srl; + $receiver_args->message_type = 'R'; + $receiver_args->title = $title; + $receiver_args->content = $content; + $receiver_args->readed = 'N'; + $receiver_args->regdate = date("YmdHis"); + + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 발송하는 회원의 쪽지함에 넣을 쪽지 + if($sender_srl && $sender_log) { + $output = executeQuery('communication.sendMessage', $sender_args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + } + + // 받을 회원의 쪽지함에 넣을 쪽지 + $output = executeQuery('communication.sendMessage', $receiver_args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 받는 회원의 쪽지 발송 플래그 생성 (파일로 생성) + $flag_path = './files/member_extra_info/new_message_flags/'.getNumberingPath($receiver_srl); + FileHandler::makeDir($flag_path); + $flag_file = sprintf('%s%s', $flag_path, $receiver_srl); + $flag_count = FileHandler::readFile($flag_file); + FileHandler::writeFile($flag_file, ++$flag_count); + + $oDB->commit(); + + return new Object(0,'success_sended'); + } + + /** + * @brief 특정 쪽지를 보관함으로 보냄 + **/ + function procCommunicationStoreMessage() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 변수 체크 + $message_srl = Context::get('message_srl'); + if(!$message_srl) return new Object(-1,'msg_invalid_request'); + + // 쪽지를 가져옴 + $oCommunicationModel = &getModel('communication'); + $message = $oCommunicationModel->getSelectedMessage($message_srl); + if(!$message || $message->message_type != 'R') return new Object(-1,'msg_invalid_request'); + + $args->message_srl = $message_srl; + $args->receiver_srl = $logged_info->member_srl; + $output = executeQuery('communication.setMessageStored', $args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_registed'); + } + + /** + * @brief 쪽지 삭제 + **/ + function procCommunicationDeleteMessage() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + // 변수 체크 + $message_srl = Context::get('message_srl'); + if(!$message_srl) return new Object(-1,'msg_invalid_request'); + + // 쪽지를 가져옴 + $oCommunicationModel = &getModel('communication'); + $message = $oCommunicationModel->getSelectedMessage($message_srl); + if(!$message) return new Object(-1,'msg_invalid_request'); + + // 발송인+type=S or 수신인+type=R 검사 + if($message->sender_srl == $member_srl && $message->message_type == 'S') { + if(!$message_srl) return new Object(-1, 'msg_invalid_request'); + } elseif($message->receiver_srl == $member_srl && $message->message_type == 'R') { + if(!$message_srl) return new Object(-1, 'msg_invalid_request'); + } + + // 삭제 + $args->message_srl = $message_srl; + $output = executeQuery('communication.deleteMessage', $args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_deleted'); + } + + /** + * @brief 선택된 다수의 쪽지 삭제 + **/ + function procCommunicationDeleteMessages() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + // 변수 체크 + $message_srl_list = trim(Context::get('message_srl_list')); + if(!$message_srl_list) return new Object(-1, 'msg_cart_is_null'); + + $message_srl_list = explode('|@|', $message_srl_list); + if(!count($message_srl_list)) return new Object(-1, 'msg_cart_is_null'); + + $message_type = Context::get('message_type'); + if(!$message_type || !in_array($message_type, array('R','S','T'))) return new Object(-1, 'msg_invalid_request'); + + $message_count = count($message_srl_list); + $target = array(); + for($i=0;$i<$message_count;$i++) { + $message_srl = (int)trim($message_srl_list[$i]); + if(!$message_srl) continue; + $target[] = $message_srl; + } + if(!count($target)) return new Object(-1,'msg_cart_is_null'); + + // 삭제 + $args->message_srls = implode(',',$target); + $args->message_type = $message_type; + + if($message_type == 'S') $args->sender_srl = $member_srl; + else $args->receiver_srl = $member_srl; + + $output = executeQuery('communication.deleteMessages', $args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_deleted'); + } + + /** + * @brief 친구 추가 + **/ + function procCommunicationAddFriend() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + + $target_srl = (int)trim(Context::get('target_srl')); + if(!$target_srl) return new Object(-1,'msg_invalid_request'); + + // 변수 정리 + $args->friend_srl = getNextSequence(); + $args->list_order = $args->friend_srl * -1; + $args->friend_group_srl = Context::get('friend_group_srl'); + $args->member_srl = $logged_info->member_srl; + $args->target_srl = $target_srl; + $output = executeQuery('communication.addFriend', $args); + if(!$output->toBool()) return $output; + + $this->add('member_srl', $target_srl); + $this->setMessage('success_registed'); + } + + /** + * @brief 등록된 친구의 그룹 이동 + **/ + function procCommunicationMoveFriend() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 변수 체크 + $friend_srl_list = trim(Context::get('friend_srl_list')); + if(!$friend_srl_list) return new Object(-1, 'msg_cart_is_null'); + + $friend_srl_list = explode('|@|', $friend_srl_list); + if(!count($friend_srl_list)) return new Object(-1, 'msg_cart_is_null'); + + $friend_count = count($friend_srl_list); + $target = array(); + for($i=0;$i<$friend_count;$i++) { + $friend_srl = (int)trim($friend_srl_list[$i]); + if(!$friend_srl) continue; + $target[] = $friend_srl; + } + if(!count($target)) return new Object(-1,'msg_cart_is_null'); + + // 변수 정리 + $args->friend_srls = implode(',',$target); + $args->member_srl = $logged_info->member_srl; + $args->friend_group_srl = Context::get('target_friend_group_srl'); + + $output = executeQuery('communication.moveFriend', $args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_moved'); + } + + /** + * @brief 친구 삭제 + **/ + function procCommunicationDeleteFriend() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + // 변수 체크 + $friend_srl_list = trim(Context::get('friend_srl_list')); + if(!$friend_srl_list) return new Object(-1, 'msg_cart_is_null'); + + $friend_srl_list = explode('|@|', $friend_srl_list); + if(!count($friend_srl_list)) return new Object(-1, 'msg_cart_is_null'); + + $friend_count = count($friend_srl_list); + $target = array(); + for($i=0;$i<$friend_count;$i++) { + $friend_srl = (int)trim($friend_srl_list[$i]); + if(!$friend_srl) continue; + $target[] = $friend_srl; + } + if(!count($target)) return new Object(-1,'msg_cart_is_null'); + + // 삭제 + $args->friend_srls = implode(',',$target); + $args->member_srl = $logged_info->member_srl; + $output = executeQuery('communication.deleteFriend', $args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_deleted'); + } + + /** + * @brief 친구 그룹 추가 + **/ + function procCommunicationAddFriendGroup() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 변수 정리 + $args->friend_group_srl = trim(Context::get('friend_group_srl')); + $args->member_srl = $logged_info->member_srl; + $args->title = Context::get('title'); + $args->title = htmlspecialchars($args->title); + if(!$args->title) return new Object(-1, 'msg_invalid_request'); + + // friend_group_srl이 있으면 수정 + if($args->friend_group_srl) { + $output = executeQuery('communication.renameFriendGroup', $args); + $msg_code = 'success_updated'; + + // 아니면 입력 + } else { + $output = executeQuery('communication.addFriendGroup', $args); + $msg_code = 'success_registed'; + } + + if(!$output->toBool()) return $output; + + $this->setMessage($msg_code); + } + + /** + * @brief 친구 그룹 이름 변경 + **/ + function procCommunicationRenameFriendGroup() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 변수 정리 + $args->friend_group_srl= Context::get('friend_group_srl'); + $args->member_srl = $logged_info->member_srl; + $args->title = Context::get('title'); + $args->title = htmlspecialchars($args->title); + if(!$args->title) return new Object(-1, 'msg_invalid_request'); + + $output = executeQuery('communication.renameFriendGroup', $args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_updated'); + } + + /** + * @brief 친구 그룹 삭제 + **/ + function procCommunicationDeleteFriendGroup() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 변수 정리 + $args->friend_group_srl = Context::get('friend_group_srl'); + $args->member_srl = $logged_info->member_srl; + $output = executeQuery('communication.deleteFriendGroup', $args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_deleted'); + } + + /** + * @brief 특정 쪽지의 상태를 읽은 상태로 변경 + **/ + function setMessageReaded($message_srl) { + $args->message_srl = $message_srl; + $args->related_srl = $message_srl; + return executeQuery('communication.setMessageReaded', $args); + } + + } +?> diff --git a/modules/communication/communication.model.php b/modules/communication/communication.model.php index f24a6974b..bf93c4206 100644 --- a/modules/communication/communication.model.php +++ b/modules/communication/communication.model.php @@ -1,189 +1,189 @@ -getModuleConfig('communication'); - - if(!$communication_config->skin) $communication_config->skin = 'default'; - if(!$communication_config->colorset) $communication_config->colorset = 'white'; - if(!$communication_config->editor_skin) $communication_config->editor_skin = 'default'; - - return $communication_config; - } - - /** - * @brief 쪽지 내용을 가져옴 - **/ - function getSelectedMessage($message_srl) { - $logged_info = Context::get('logged_info'); - - $args->message_srl = $message_srl; - $output = executeQuery('communication.getMessage',$args); - $message = $output->data; - if(!$message) return ; - - // 보낸 쪽지일 경우 받는 사람 정보를 구함 - $oMemberModel = &getModel('member'); - if($message->sender_srl == $logged_info->member_srl && $message->message_type == 'S') $member_info = $oMemberModel->getMemberInfoByMemberSrl($message->receiver_srl); - - // 보관/받은 쪽지일 경우 보낸 사람 정보를 구함 - else $member_info = $oMemberModel->getMemberInfoByMemberSrl($message->sender_srl); - - if($member_info) { - foreach($member_info as $key => $val) { - if($key != 'regdate') $message->{$key} = $val; - } - } - - // 받은 쪽지이고 아직 읽지 않았을 경우 읽은 상태로 변경 - if($message->message_type == 'R' && $message->readed != 'Y') { - $oCommunicationController = &getController('communication'); - $oCommunicationController->setMessageReaded($message_srl); - } - - - return $message; - } - - /** - * @brief 새 쪽지를 가져옴 - **/ - function getNewMessage() { - $logged_info = Context::get('logged_info'); - $args->receiver_srl = $logged_info->member_srl; - $args->readed = 'N'; - - $output = executeQuery('communication.getNewMessage', $args); - if(!count($output->data)) return; - $message = array_pop($output->data); - - $oCommunicationController = &getController('communication'); - $oCommunicationController->setMessageReaded($message->message_srl); - - return $message; - } - - /** - * @brief 쪽지 목록 가져오기 - * type = R : 받은 쪽지 - * type = S : 보낸 쪽지 - * type = T : 보관함 - **/ - function getMessages($message_type = "R") { - $logged_info = Context::get('logged_info'); - - switch($message_type) { - case 'R' : - $args->member_srl = $logged_info->member_srl; - $args->message_type = 'R'; - $query_id = 'communication.getReceivedMessages'; - break; - case 'T' : - $args->member_srl = $logged_info->member_srl; - $args->message_type = 'T'; - $query_id = 'communication.getStoredMessages'; - break; - default : - $args->member_srl = $logged_info->member_srl; - $args->message_type = 'S'; - $query_id = 'communication.getSendedMessages'; - break; - - } - - // 기타 변수들 정리 - $args->sort_index = 'message.list_order'; - $args->page = Context::get('page'); - $args->list_count = 20; - $args->page_count = 10; - return executeQuery($query_id, $args); - } - - /** - * @brief 친구 목록 가져오기 - **/ - function getFriends($friend_group_srl = 0) { - $logged_info = Context::get('logged_info'); - - $args->friend_group_srl = $friend_group_srl; - $args->member_srl = $logged_info->member_srl; - - // 기타 변수들 정리 - $args->page = Context::get('page'); - $args->sort_index = 'friend.list_order'; - $args->list_count = 10; - $args->page_count = 10; - $output = executeQuery('communication.getFriends', $args); - return $output; - } - - /** - * @brief 이미 친구로 등록되었는지 검사 - **/ - function isAddedFriend($member_srl) { - $logged_info = Context::get('logged_info'); - - $args->member_srl = $logged_info->member_srl; - $args->target_srl = $member_srl; - $output = executeQuery('communication.isAddedFriend', $args); - return $output->data->count; - } - - /** - * @brief 특정 친구 그룹 가져오기 - **/ - function getFriendGroupInfo($friend_group_srl) { - $logged_info = Context::get('logged_info'); - - $args->member_srl = $logged_info->member_srl; - $args->friend_group_srl = $friend_group_srl; - - $output = executeQuery('communication.getFriendGroup', $args); - return $output->data; - } - - /** - * @brief 그룹 목록 가져오기 - **/ - function getFriendGroups() { - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - - $output = executeQuery('communication.getFriendGroups', $args); - $group_list = $output->data; - if(!$group_list) return; - - if(!is_array($group_list)) $group_list = array($group_list); - return $group_list; - } - - /** - * @brief 특정 회원의 친구 목록에 포함되어 있는지를 확인 - **/ - function isFriend($target_srl) { - $logged_info = Context::get('logged_info'); - - $args->member_srl = $target_srl; - $args->target_srl = $logged_info->member_srl; - $output = executeQuery('communication.isAddedFriend', $args); - if($output->data->count) return true; - return false; - } - } -?> +getModuleConfig('communication'); + + if(!$communication_config->skin) $communication_config->skin = 'default'; + if(!$communication_config->colorset) $communication_config->colorset = 'white'; + if(!$communication_config->editor_skin) $communication_config->editor_skin = 'default'; + + return $communication_config; + } + + /** + * @brief 쪽지 내용을 가져옴 + **/ + function getSelectedMessage($message_srl) { + $logged_info = Context::get('logged_info'); + + $args->message_srl = $message_srl; + $output = executeQuery('communication.getMessage',$args); + $message = $output->data; + if(!$message) return ; + + // 보낸 쪽지일 경우 받는 사람 정보를 구함 + $oMemberModel = &getModel('member'); + if($message->sender_srl == $logged_info->member_srl && $message->message_type == 'S') $member_info = $oMemberModel->getMemberInfoByMemberSrl($message->receiver_srl); + + // 보관/받은 쪽지일 경우 보낸 사람 정보를 구함 + else $member_info = $oMemberModel->getMemberInfoByMemberSrl($message->sender_srl); + + if($member_info) { + foreach($member_info as $key => $val) { + if($key != 'regdate') $message->{$key} = $val; + } + } + + // 받은 쪽지이고 아직 읽지 않았을 경우 읽은 상태로 변경 + if($message->message_type == 'R' && $message->readed != 'Y') { + $oCommunicationController = &getController('communication'); + $oCommunicationController->setMessageReaded($message_srl); + } + + + return $message; + } + + /** + * @brief 새 쪽지를 가져옴 + **/ + function getNewMessage() { + $logged_info = Context::get('logged_info'); + $args->receiver_srl = $logged_info->member_srl; + $args->readed = 'N'; + + $output = executeQuery('communication.getNewMessage', $args); + if(!count($output->data)) return; + $message = array_pop($output->data); + + $oCommunicationController = &getController('communication'); + $oCommunicationController->setMessageReaded($message->message_srl); + + return $message; + } + + /** + * @brief 쪽지 목록 가져오기 + * type = R : 받은 쪽지 + * type = S : 보낸 쪽지 + * type = T : 보관함 + **/ + function getMessages($message_type = "R") { + $logged_info = Context::get('logged_info'); + + switch($message_type) { + case 'R' : + $args->member_srl = $logged_info->member_srl; + $args->message_type = 'R'; + $query_id = 'communication.getReceivedMessages'; + break; + case 'T' : + $args->member_srl = $logged_info->member_srl; + $args->message_type = 'T'; + $query_id = 'communication.getStoredMessages'; + break; + default : + $args->member_srl = $logged_info->member_srl; + $args->message_type = 'S'; + $query_id = 'communication.getSendedMessages'; + break; + + } + + // 기타 변수들 정리 + $args->sort_index = 'message.list_order'; + $args->page = Context::get('page'); + $args->list_count = 20; + $args->page_count = 10; + return executeQuery($query_id, $args); + } + + /** + * @brief 친구 목록 가져오기 + **/ + function getFriends($friend_group_srl = 0) { + $logged_info = Context::get('logged_info'); + + $args->friend_group_srl = $friend_group_srl; + $args->member_srl = $logged_info->member_srl; + + // 기타 변수들 정리 + $args->page = Context::get('page'); + $args->sort_index = 'friend.list_order'; + $args->list_count = 10; + $args->page_count = 10; + $output = executeQuery('communication.getFriends', $args); + return $output; + } + + /** + * @brief 이미 친구로 등록되었는지 검사 + **/ + function isAddedFriend($member_srl) { + $logged_info = Context::get('logged_info'); + + $args->member_srl = $logged_info->member_srl; + $args->target_srl = $member_srl; + $output = executeQuery('communication.isAddedFriend', $args); + return $output->data->count; + } + + /** + * @brief 특정 친구 그룹 가져오기 + **/ + function getFriendGroupInfo($friend_group_srl) { + $logged_info = Context::get('logged_info'); + + $args->member_srl = $logged_info->member_srl; + $args->friend_group_srl = $friend_group_srl; + + $output = executeQuery('communication.getFriendGroup', $args); + return $output->data; + } + + /** + * @brief 그룹 목록 가져오기 + **/ + function getFriendGroups() { + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + + $output = executeQuery('communication.getFriendGroups', $args); + $group_list = $output->data; + if(!$group_list) return; + + if(!is_array($group_list)) $group_list = array($group_list); + return $group_list; + } + + /** + * @brief 특정 회원의 친구 목록에 포함되어 있는지를 확인 + **/ + function isFriend($target_srl) { + $logged_info = Context::get('logged_info'); + + $args->member_srl = $target_srl; + $args->target_srl = $logged_info->member_srl; + $output = executeQuery('communication.isAddedFriend', $args); + if($output->data->count) return true; + return false; + } + } +?> diff --git a/modules/communication/communication.view.php b/modules/communication/communication.view.php index 58c9f17ac..6213523e5 100644 --- a/modules/communication/communication.view.php +++ b/modules/communication/communication.view.php @@ -1,228 +1,228 @@ -communication_config = $oCommunicationModel->getConfig(); - $skin = $this->communication_config->skin; - - Context::set('communication_config', $this->communication_config); - - $tpl_path = sprintf('%sskins/%s', $this->module_path, $skin); - $this->setTemplatePath($tpl_path); - } - - /** - * @brief 쪽지함 출력 - **/ - function dispCommunicationMessages() { - // 로그인이 되어 있지 않으면 오류 표시 - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 변수 설정 - $message_srl = Context::get('message_srl'); - $message_type = Context::get('message_type'); - if(!in_array($message_type, array('R','S','T'))) { - $message_type = 'R'; - Context::set('message_type', $message_type); - } - - $oCommunicationModel = &getModel('communication'); - - // message_srl이 있으면 내용 추출 - if($message_srl) { - $message = $oCommunicationModel->getSelectedMessage($message_srl); - if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl) ) { - stripEmbedTagForAdmin($message->content, $message->sender_srl); - Context::set('message', $message); - } - } - - // 목록 추출 - $output = $oCommunicationModel->getMessages($message_type); - - // 템플릿에 쓰기 위해서 context::set - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('message_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('messages'); - } - - /** - * @brief 새 쪽지 보여줌 - **/ - function dispCommunicationNewMessage() { - $this->setLayoutFile('popup_layout'); - - // 로그인이 되어 있지 않으면 오류 표시 - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - $logged_info = Context::get('logged_info'); - - $oCommunicationModel = &getModel('communication'); - - // 새 쪽지를 가져옴 - $message = $oCommunicationModel->getNewMessage(); - if($message) { - stripEmbedTagForAdmin($message->content, $message->sender_srl); - Context::set('message', $message); - } - - // 플래그 삭제 - $flag_path = './files/communication_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl); - $flag_file = sprintf('%s%s', $flag_path, $logged_info->member_srl); - FileHandler::removeFile($flag_file); - - $this->setTemplateFile('new_message'); - } - - /** - * @brief 쪽지 발송 출력 - **/ - function dispCommunicationSendMessage() { - $this->setLayoutFile("popup_layout"); - $oCommunicationModel = &getModel('communication'); - $oMemberModel = &getModel('member'); - - // 로그인이 되어 있지 않으면 오류 표시 - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 쪽지 받을 사용자 정보 구함 - $receiver_srl = Context::get('receiver_srl'); - if(!$receiver_srl || $logged_info->member_srl == $receiver_srl) return $this->stop('msg_not_logged'); - - // 답글 쪽지일 경우 원본 메세지의 글번호를 구함 - $message_srl = Context::get('message_srl'); - if($message_srl) { - $source_message = $oCommunicationModel->getSelectedMessage($message_srl); - if($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl) { - $source_message->title = "[re] ".$source_message->title; - $source_message->content = "\r\n
    \r\n
    ".trim($source_message->content)."
    "; - Context::set('source_message', $source_message); - } - } - - $receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); - Context::set('receiver_info', $receiver_info); - - // 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅 - $oEditorModel = &getModel('editor'); - $option->primary_key_name = 'receiver_srl'; - $option->content_key_name = 'content'; - $option->allow_fileupload = false; - $option->enable_autosave = false; - $option->enable_default_component = true;// false; - $option->enable_component = false; - $option->resizable = false; - $option->disable_html = true; - $option->height = 300; - $option->skin = $this->communication_config->editor_skin; - $option->colorset = $this->communication_config->editor_colorset; - $editor = $oEditorModel->getEditor($logged_info->member_srl, $option); - Context::set('editor', $editor); - - $this->setTemplateFile('send_message'); - } - - /** - * @brief 친구 목록 보기 - **/ - function dispCommunicationFriend() { - // 로그인이 되어 있지 않으면 오류 표시 - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - - $oCommunicationModel = &getModel('communication'); - - // 그룹 목록을 가져옴 - $tmp_group_list = $oCommunicationModel->getFriendGroups(); - $group_count = count($tmp_group_list); - for($i=0;$i<$group_count;$i++) $friend_group_list[$tmp_group_list[$i]->friend_group_srl] = $tmp_group_list[$i]; - Context::set('friend_group_list', $friend_group_list); - - // 친구 목록을 가져옴 - $friend_group_srl = Context::get('friend_group_srl'); - $output = $oCommunicationModel->getFriends($friend_group_srl); - $friend_count = count($output->data); - if($friend_count) { - foreach($output->data as $key => $val) { - $group_srl = $val->friend_group_srl; - $group_title = $friend_group_list[$group_srl]->title; - if(!$group_title) $group_title = Context::get('default_friend_group'); - $output->data[$key]->group_title = $group_title; - } - } - - // 템플릿에 쓰기 위해서 context::set - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('friend_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('friends'); - } - - /** - * @brief 친구 추가 - **/ - function dispCommunicationAddFriend() { - $this->setLayoutFile("popup_layout"); - - // 로그인이 되어 있지 않으면 오류 표시 - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - $logged_info = Context::get('logged_info'); - - $target_srl = Context::get('target_srl'); - if(!$target_srl) return $this->stop('msg_invalid_request'); - - // 대상 회원의 정보를 구함 - $oMemberModel = &getModel('member'); - $oCommunicationModel = &getModel('communication'); - $communication_info = $oMemberModel->getMemberInfoByMemberSrl($target_srl); - if($communication_info->member_srl != $target_srl) return $this->stop('msg_invalid_request'); - Context::set('target_info', $communication_info); - - // 그룹의 목록을 구함 - $friend_group_list = $oCommunicationModel->getFriendGroups(); - Context::set('friend_group_list', $friend_group_list); - - $this->setTemplateFile('add_friend'); - } - - /** - * @brief 친구 그룹 추가 - **/ - function dispCommunicationAddFriendGroup() { - $this->setLayoutFile("popup_layout"); - - // 로그인이 되어 있지 않으면 오류 표시 - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - $logged_info = Context::get('logged_info'); - - // 그룹 번호가 넘어오면 수정모드로.. - $friend_group_srl = Context::get('friend_group_srl'); - if($friend_group_srl) { - $oCommunicationModel = &getModel('communication'); - $friend_group = $oCommunicationModel->getFriendGroupInfo($friend_group_srl); - if($friend_group->friend_group_srl == $friend_group_srl) Context::set('friend_group', $friend_group); - } - - $this->setTemplateFile('add_friend_group'); - } - - } -?> +communication_config = $oCommunicationModel->getConfig(); + $skin = $this->communication_config->skin; + + Context::set('communication_config', $this->communication_config); + + $tpl_path = sprintf('%sskins/%s', $this->module_path, $skin); + $this->setTemplatePath($tpl_path); + } + + /** + * @brief 쪽지함 출력 + **/ + function dispCommunicationMessages() { + // 로그인이 되어 있지 않으면 오류 표시 + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 변수 설정 + $message_srl = Context::get('message_srl'); + $message_type = Context::get('message_type'); + if(!in_array($message_type, array('R','S','T'))) { + $message_type = 'R'; + Context::set('message_type', $message_type); + } + + $oCommunicationModel = &getModel('communication'); + + // message_srl이 있으면 내용 추출 + if($message_srl) { + $message = $oCommunicationModel->getSelectedMessage($message_srl); + if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl) ) { + stripEmbedTagForAdmin($message->content, $message->sender_srl); + Context::set('message', $message); + } + } + + // 목록 추출 + $output = $oCommunicationModel->getMessages($message_type); + + // 템플릿에 쓰기 위해서 context::set + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('message_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('messages'); + } + + /** + * @brief 새 쪽지 보여줌 + **/ + function dispCommunicationNewMessage() { + $this->setLayoutFile('popup_layout'); + + // 로그인이 되어 있지 않으면 오류 표시 + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + $logged_info = Context::get('logged_info'); + + $oCommunicationModel = &getModel('communication'); + + // 새 쪽지를 가져옴 + $message = $oCommunicationModel->getNewMessage(); + if($message) { + stripEmbedTagForAdmin($message->content, $message->sender_srl); + Context::set('message', $message); + } + + // 플래그 삭제 + $flag_path = './files/communication_extra_info/new_message_flags/'.getNumberingPath($logged_info->member_srl); + $flag_file = sprintf('%s%s', $flag_path, $logged_info->member_srl); + FileHandler::removeFile($flag_file); + + $this->setTemplateFile('new_message'); + } + + /** + * @brief 쪽지 발송 출력 + **/ + function dispCommunicationSendMessage() { + $this->setLayoutFile("popup_layout"); + $oCommunicationModel = &getModel('communication'); + $oMemberModel = &getModel('member'); + + // 로그인이 되어 있지 않으면 오류 표시 + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 쪽지 받을 사용자 정보 구함 + $receiver_srl = Context::get('receiver_srl'); + if(!$receiver_srl || $logged_info->member_srl == $receiver_srl) return $this->stop('msg_not_logged'); + + // 답글 쪽지일 경우 원본 메세지의 글번호를 구함 + $message_srl = Context::get('message_srl'); + if($message_srl) { + $source_message = $oCommunicationModel->getSelectedMessage($message_srl); + if($source_message->message_srl == $message_srl && $source_message->sender_srl == $receiver_srl) { + $source_message->title = "[re] ".$source_message->title; + $source_message->content = "\r\n
    \r\n
    ".trim($source_message->content)."
    "; + Context::set('source_message', $source_message); + } + } + + $receiver_info = $oMemberModel->getMemberInfoByMemberSrl($receiver_srl); + Context::set('receiver_info', $receiver_info); + + // 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅 + $oEditorModel = &getModel('editor'); + $option->primary_key_name = 'receiver_srl'; + $option->content_key_name = 'content'; + $option->allow_fileupload = false; + $option->enable_autosave = false; + $option->enable_default_component = true;// false; + $option->enable_component = false; + $option->resizable = false; + $option->disable_html = true; + $option->height = 300; + $option->skin = $this->communication_config->editor_skin; + $option->colorset = $this->communication_config->editor_colorset; + $editor = $oEditorModel->getEditor($logged_info->member_srl, $option); + Context::set('editor', $editor); + + $this->setTemplateFile('send_message'); + } + + /** + * @brief 친구 목록 보기 + **/ + function dispCommunicationFriend() { + // 로그인이 되어 있지 않으면 오류 표시 + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + + $oCommunicationModel = &getModel('communication'); + + // 그룹 목록을 가져옴 + $tmp_group_list = $oCommunicationModel->getFriendGroups(); + $group_count = count($tmp_group_list); + for($i=0;$i<$group_count;$i++) $friend_group_list[$tmp_group_list[$i]->friend_group_srl] = $tmp_group_list[$i]; + Context::set('friend_group_list', $friend_group_list); + + // 친구 목록을 가져옴 + $friend_group_srl = Context::get('friend_group_srl'); + $output = $oCommunicationModel->getFriends($friend_group_srl); + $friend_count = count($output->data); + if($friend_count) { + foreach($output->data as $key => $val) { + $group_srl = $val->friend_group_srl; + $group_title = $friend_group_list[$group_srl]->title; + if(!$group_title) $group_title = Context::get('default_friend_group'); + $output->data[$key]->group_title = $group_title; + } + } + + // 템플릿에 쓰기 위해서 context::set + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('friend_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('friends'); + } + + /** + * @brief 친구 추가 + **/ + function dispCommunicationAddFriend() { + $this->setLayoutFile("popup_layout"); + + // 로그인이 되어 있지 않으면 오류 표시 + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + $logged_info = Context::get('logged_info'); + + $target_srl = Context::get('target_srl'); + if(!$target_srl) return $this->stop('msg_invalid_request'); + + // 대상 회원의 정보를 구함 + $oMemberModel = &getModel('member'); + $oCommunicationModel = &getModel('communication'); + $communication_info = $oMemberModel->getMemberInfoByMemberSrl($target_srl); + if($communication_info->member_srl != $target_srl) return $this->stop('msg_invalid_request'); + Context::set('target_info', $communication_info); + + // 그룹의 목록을 구함 + $friend_group_list = $oCommunicationModel->getFriendGroups(); + Context::set('friend_group_list', $friend_group_list); + + $this->setTemplateFile('add_friend'); + } + + /** + * @brief 친구 그룹 추가 + **/ + function dispCommunicationAddFriendGroup() { + $this->setLayoutFile("popup_layout"); + + // 로그인이 되어 있지 않으면 오류 표시 + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + $logged_info = Context::get('logged_info'); + + // 그룹 번호가 넘어오면 수정모드로.. + $friend_group_srl = Context::get('friend_group_srl'); + if($friend_group_srl) { + $oCommunicationModel = &getModel('communication'); + $friend_group = $oCommunicationModel->getFriendGroupInfo($friend_group_srl); + if($friend_group->friend_group_srl == $friend_group_srl) Context::set('friend_group', $friend_group); + } + + $this->setTemplateFile('add_friend_group'); + } + + } +?> diff --git a/modules/communication/conf/info.xml b/modules/communication/conf/info.xml index 58b560547..68819bc8b 100644 --- a/modules/communication/conf/info.xml +++ b/modules/communication/conf/info.xml @@ -1,33 +1,33 @@ - - - 커뮤니케이션 - コミュニケーション - 会员交流 - Communication - Communication - Liên lạc - 交流 - İletişim - 회원들간의 쪽지, 친구기능을 담당하는 모듈입니다. - 会員間にメッセージや友達管理などコミュニティ機能を提供します。 - 管理在线会员间短信息及好友功能的模块。 - This module is for managing message, friend functions. - Module quản lý tin nhắn và bạn bè. - This module is for managing message, friend functions. - 管理線上會員間短訊及好友功能的模組。 - Bu modül mesaj ve arkadaşlık özelliklerini yönetmek içindir. - 0.1 - 2008-05-30 - member - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 커뮤니케이션 + コミュニケーション + 会员交流 + Communication + Communication + Liên lạc + 交流 + İletişim + 회원들간의 쪽지, 친구기능을 담당하는 모듈입니다. + 会員間にメッセージや友達管理などコミュニティ機能を提供します。 + 管理在线会员间短信息及好友功能的模块。 + This module is for managing message, friend functions. + Module quản lý tin nhắn và bạn bè. + This module is for managing message, friend functions. + 管理線上會員間短訊及好友功能的模組。 + Bu modül mesaj ve arkadaşlık özelliklerini yönetmek içindir. + 0.1 + 2008-05-30 + member + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/communication/lang/en.lang.php b/modules/communication/lang/en.lang.php index 8ddeddf7c..0baaab31e 100644 --- a/modules/communication/lang/en.lang.php +++ b/modules/communication/lang/en.lang.php @@ -1,48 +1,48 @@ -communication = 'Communication'; - $lang->about_communication = 'Communication module is for communications between members with messages or friends.'; - - $lang->allow_message = 'Receive Messages'; - $lang->allow_message_type = array( - 'Y' => 'Receive All', - 'N' => 'Reject All', - 'F' => 'Only Friends', - ); - - $lang->message_box = array( - 'R' => 'Received', - 'S' => 'Sent', - 'T' => 'Mailbox', - ); - $lang->readed_date = "Read Date"; - - $lang->sender = 'Sender'; - $lang->receiver = 'Receiver'; - $lang->friend_group = 'Friend Group'; - $lang->default_friend_group = 'Unassigned Group'; - - $lang->cmd_send_message = 'Send Message'; - $lang->cmd_reply_message = 'Reply Message'; - $lang->cmd_view_friend = 'Friends'; - $lang->cmd_add_friend = 'Add Friend'; - $lang->cmd_view_message_box = 'Message Box'; - $lang->cmd_store = "Save"; - $lang->cmd_add_friend_group = 'Add Friend Group'; - $lang->cmd_rename_friend_group = 'Modify Friend Group Name'; - - $lang->msg_no_message = 'There is no message'; - $lang->message_received = 'You have a new message'; - - $lang->msg_title_is_null = 'Please input the title of message'; - $lang->msg_content_is_null = 'Please input the content'; - $lang->msg_allow_message_to_friend = "Failed to send because receiver only allows friends' messages"; - $lang->msg_disallow_message = 'Failed to send because receiver rejects message reception'; - - $lang->about_allow_message = 'You can decide message reception'; -?> +communication = 'Communication'; + $lang->about_communication = 'Communication module is for communications between members with messages or friends.'; + + $lang->allow_message = 'Receive Messages'; + $lang->allow_message_type = array( + 'Y' => 'Receive All', + 'N' => 'Reject All', + 'F' => 'Only Friends', + ); + + $lang->message_box = array( + 'R' => 'Received', + 'S' => 'Sent', + 'T' => 'Mailbox', + ); + $lang->readed_date = "Read Date"; + + $lang->sender = 'Sender'; + $lang->receiver = 'Receiver'; + $lang->friend_group = 'Friend Group'; + $lang->default_friend_group = 'Unassigned Group'; + + $lang->cmd_send_message = 'Send Message'; + $lang->cmd_reply_message = 'Reply Message'; + $lang->cmd_view_friend = 'Friends'; + $lang->cmd_add_friend = 'Add Friend'; + $lang->cmd_view_message_box = 'Message Box'; + $lang->cmd_store = "Save"; + $lang->cmd_add_friend_group = 'Add Friend Group'; + $lang->cmd_rename_friend_group = 'Modify Friend Group Name'; + + $lang->msg_no_message = 'There is no message'; + $lang->message_received = 'You have a new message'; + + $lang->msg_title_is_null = 'Please input the title of message'; + $lang->msg_content_is_null = 'Please input the content'; + $lang->msg_allow_message_to_friend = "Failed to send because receiver only allows friends' messages"; + $lang->msg_disallow_message = 'Failed to send because receiver rejects message reception'; + + $lang->about_allow_message = 'You can decide message reception'; +?> diff --git a/modules/communication/lang/es.lang.php b/modules/communication/lang/es.lang.php index d70c6d4f5..620fe1f15 100644 --- a/modules/communication/lang/es.lang.php +++ b/modules/communication/lang/es.lang.php @@ -1,49 +1,49 @@ -communication = 'Communication'; - $lang->about_communication = '회원간의 쪽지나 친구 관리등 커뮤니케이션 기능을 수행하는 모듈입니다'; - - $lang->allow_message = 'Permitir la recepción del mensaje'; - $lang->allow_message_type = array( - 'Y' => 'Recibir todo', - 'N' => 'Rechazar', - 'F' => 'Sólo amigos', - ); - - $lang->message_box = array( - 'R' => 'Recibido', - 'S' => 'Enviado', - 'T' => 'Buzon de Email', - ); - - $lang->readed_date = "Fecha Leído"; - - $lang->sender = 'Remitente'; - $lang->receiver = 'Receptor'; - $lang->friend_group = 'Grupo de amigos'; - $lang->default_friend_group = 'Grupo desasignado'; - - $lang->cmd_send_message = 'Enviar Mensaje'; - $lang->cmd_reply_message = 'Responder el mensaje'; - $lang->cmd_view_friend = 'Amigos'; - $lang->cmd_add_friend = 'Registrar como Amigo'; - $lang->cmd_view_message_box = 'Buzón de mensajes'; - $lang->cmd_store = "Guardar"; - $lang->cmd_add_friend_group = 'agregar grupo de amigos'; - $lang->cmd_rename_friend_group = 'Cambiar el nombre del grupo de amigos'; - - $lang->msg_no_message = 'No hay mensajes'; - $lang->message_received = 'Usted ha recibido un mensaje'; - - $lang->msg_title_is_null = 'Por favor ingresar el título de la nota'; - $lang->msg_content_is_null = 'Por favor ingresar el contenido'; - $lang->msg_allow_message_to_friend = "Falló el envío por permitir sólo mensajes de sus amigos"; - $lang->msg_disallow_message = 'Falló el envío por ser usuario rechazado para recibir mensajes'; - - $lang->about_allow_message = 'Usted puede decidir la recepción del mensaje'; -?> +communication = 'Communication'; + $lang->about_communication = '회원간의 쪽지나 친구 관리등 커뮤니케이션 기능을 수행하는 모듈입니다'; + + $lang->allow_message = 'Permitir la recepción del mensaje'; + $lang->allow_message_type = array( + 'Y' => 'Recibir todo', + 'N' => 'Rechazar', + 'F' => 'Sólo amigos', + ); + + $lang->message_box = array( + 'R' => 'Recibido', + 'S' => 'Enviado', + 'T' => 'Buzon de Email', + ); + + $lang->readed_date = "Fecha Leído"; + + $lang->sender = 'Remitente'; + $lang->receiver = 'Receptor'; + $lang->friend_group = 'Grupo de amigos'; + $lang->default_friend_group = 'Grupo desasignado'; + + $lang->cmd_send_message = 'Enviar Mensaje'; + $lang->cmd_reply_message = 'Responder el mensaje'; + $lang->cmd_view_friend = 'Amigos'; + $lang->cmd_add_friend = 'Registrar como Amigo'; + $lang->cmd_view_message_box = 'Buzón de mensajes'; + $lang->cmd_store = "Guardar"; + $lang->cmd_add_friend_group = 'agregar grupo de amigos'; + $lang->cmd_rename_friend_group = 'Cambiar el nombre del grupo de amigos'; + + $lang->msg_no_message = 'No hay mensajes'; + $lang->message_received = 'Usted ha recibido un mensaje'; + + $lang->msg_title_is_null = 'Por favor ingresar el título de la nota'; + $lang->msg_content_is_null = 'Por favor ingresar el contenido'; + $lang->msg_allow_message_to_friend = "Falló el envío por permitir sólo mensajes de sus amigos"; + $lang->msg_disallow_message = 'Falló el envío por ser usuario rechazado para recibir mensajes'; + + $lang->about_allow_message = 'Usted puede decidir la recepción del mensaje'; +?> diff --git a/modules/communication/lang/fr.lang.php b/modules/communication/lang/fr.lang.php index c1a3b88aa..9170d28b1 100644 --- a/modules/communication/lang/fr.lang.php +++ b/modules/communication/lang/fr.lang.php @@ -1,48 +1,48 @@ -communication = 'Communication'; - $lang->about_communication = 'Ce module exécute des fonctions communicatives comme Messages ou Amis'; - - $lang->allow_message = 'Recevoir les Messages'; - $lang->allow_message_type = array( - 'Y' => 'Recevoir tout', - 'N' => 'Refuser tout', - 'F' => 'Amis seulement', - ); - - $lang->message_box = array( - 'R' => 'Reçu', - 'S' => 'Envoyé', - 'T' => 'Boîte aux Lettres', - ); - $lang->readed_date = "Jour lu"; - - $lang->sender = 'Envoyeur'; - $lang->receiver = 'Receveur'; - $lang->friend_group = 'Groupe des Amis'; - $lang->default_friend_group = 'Groupe pas assigné '; - - $lang->cmd_send_message = 'Envoyer un Message'; - $lang->cmd_reply_message = 'Répondre à un Message'; - $lang->cmd_view_friend = 'Amis'; - $lang->cmd_add_friend = 'Inscrire des Amis'; - $lang->cmd_view_message_box = 'Lire des Messages'; - $lang->cmd_store = "Conserver"; - $lang->cmd_add_friend_group = 'Ajouter un Groupe des Amis'; - $lang->cmd_rename_friend_group = 'Modifier le Nom du Groupe des Amis'; - - $lang->msg_no_message = 'Nul Message'; - $lang->message_received = 'Nouveau message'; - - $lang->msg_title_is_null = 'Entrez le titre du message, S.V.P.'; - $lang->msg_content_is_null = 'Entrez le contenu, S.V.P.'; - $lang->msg_allow_message_to_friend = "Echoué à envoyer parce que le receveur permet seulement les messages des Amis."; - $lang->msg_disallow_message = 'Echoué à envoyer parce que le receveur refuse la réception des messages'; - - $lang->about_allow_message = 'Vous pouvez refuser la réception des messages'; -?> +communication = 'Communication'; + $lang->about_communication = 'Ce module exécute des fonctions communicatives comme Messages ou Amis'; + + $lang->allow_message = 'Recevoir les Messages'; + $lang->allow_message_type = array( + 'Y' => 'Recevoir tout', + 'N' => 'Refuser tout', + 'F' => 'Amis seulement', + ); + + $lang->message_box = array( + 'R' => 'Reçu', + 'S' => 'Envoyé', + 'T' => 'Boîte aux Lettres', + ); + $lang->readed_date = "Jour lu"; + + $lang->sender = 'Envoyeur'; + $lang->receiver = 'Receveur'; + $lang->friend_group = 'Groupe des Amis'; + $lang->default_friend_group = 'Groupe pas assigné '; + + $lang->cmd_send_message = 'Envoyer un Message'; + $lang->cmd_reply_message = 'Répondre à un Message'; + $lang->cmd_view_friend = 'Amis'; + $lang->cmd_add_friend = 'Inscrire des Amis'; + $lang->cmd_view_message_box = 'Lire des Messages'; + $lang->cmd_store = "Conserver"; + $lang->cmd_add_friend_group = 'Ajouter un Groupe des Amis'; + $lang->cmd_rename_friend_group = 'Modifier le Nom du Groupe des Amis'; + + $lang->msg_no_message = 'Nul Message'; + $lang->message_received = 'Nouveau message'; + + $lang->msg_title_is_null = 'Entrez le titre du message, S.V.P.'; + $lang->msg_content_is_null = 'Entrez le contenu, S.V.P.'; + $lang->msg_allow_message_to_friend = "Echoué à envoyer parce que le receveur permet seulement les messages des Amis."; + $lang->msg_disallow_message = 'Echoué à envoyer parce que le receveur refuse la réception des messages'; + + $lang->about_allow_message = 'Vous pouvez refuser la réception des messages'; +?> diff --git a/modules/communication/lang/jp.lang.php b/modules/communication/lang/jp.lang.php index be4a29728..06ba9f4f0 100644 --- a/modules/communication/lang/jp.lang.php +++ b/modules/communication/lang/jp.lang.php @@ -1,48 +1,48 @@ -communication = 'コミュニケーション'; - $lang->about_communication = '会員間にメッセージや友達管理などコミュニティ機能を提供するモジュールです。'; - - $lang->allow_message = 'メッセージの受信'; - $lang->allow_message_type = array( - 'Y' => '全て受信', - 'N' => '全て受信しない', - 'F' => '友達からのみ受信する', - ); - - $lang->message_box = array( - 'R' => 'メッセージ受信箱', - 'S' => 'メッセージ送信箱', - 'T' => '保存箱', - ); - - $lang->readed_date = '開封時間'; - - $lang->sender = '送信者'; - $lang->receiver = '受信者'; - $lang->friend_group = '友達グループ'; - $lang->default_friend_group = 'グループ未指定'; - - $lang->cmd_send_message = 'メッセージ送信'; - $lang->cmd_reply_message = 'メッセージ返信'; - $lang->cmd_view_friend = '友達リスト'; - $lang->cmd_add_friend = '友達登録'; - $lang->cmd_view_message_box = 'メッセージ'; - $lang->cmd_store = '保存'; - $lang->cmd_add_friend_group = '友達グループ追加'; - $lang->cmd_rename_friend_group = '友達グループ名変更'; - - $lang->msg_no_message = 'メッセージがありません。'; - $lang->message_received = 'メッセージが届きました。'; - - $lang->msg_title_is_null = 'メッセージのタイトルを入力して下さい。'; - $lang->msg_content_is_null = '内容を入力して下さい。'; - $lang->msg_allow_message_to_friend = '友達からのみメッセージを受信出来るように設定したユーザであるため、送信出来ませんでした。'; - $lang->msg_disallow_message = 'メッセージの受信を拒否している受信者であるため、送信出来ませんでした。'; - $lang->about_allow_message = 'メッセージを受信するかを設定します。'; -?> +communication = 'コミュニケーション'; + $lang->about_communication = '会員間にメッセージや友達管理などコミュニティ機能を提供するモジュールです。'; + + $lang->allow_message = 'メッセージの受信'; + $lang->allow_message_type = array( + 'Y' => '全て受信', + 'N' => '全て受信しない', + 'F' => '友達からのみ受信する', + ); + + $lang->message_box = array( + 'R' => 'メッセージ受信箱', + 'S' => 'メッセージ送信箱', + 'T' => '保存箱', + ); + + $lang->readed_date = '開封時間'; + + $lang->sender = '送信者'; + $lang->receiver = '受信者'; + $lang->friend_group = '友達グループ'; + $lang->default_friend_group = 'グループ未指定'; + + $lang->cmd_send_message = 'メッセージ送信'; + $lang->cmd_reply_message = 'メッセージ返信'; + $lang->cmd_view_friend = '友達リスト'; + $lang->cmd_add_friend = '友達登録'; + $lang->cmd_view_message_box = 'メッセージ'; + $lang->cmd_store = '保存'; + $lang->cmd_add_friend_group = '友達グループ追加'; + $lang->cmd_rename_friend_group = '友達グループ名変更'; + + $lang->msg_no_message = 'メッセージがありません。'; + $lang->message_received = 'メッセージが届きました。'; + + $lang->msg_title_is_null = 'メッセージのタイトルを入力して下さい。'; + $lang->msg_content_is_null = '内容を入力して下さい。'; + $lang->msg_allow_message_to_friend = '友達からのみメッセージを受信出来るように設定したユーザであるため、送信出来ませんでした。'; + $lang->msg_disallow_message = 'メッセージの受信を拒否している受信者であるため、送信出来ませんでした。'; + $lang->about_allow_message = 'メッセージを受信するかを設定します。'; +?> diff --git a/modules/communication/lang/ko.lang.php b/modules/communication/lang/ko.lang.php index 35186374e..1c0841fad 100644 --- a/modules/communication/lang/ko.lang.php +++ b/modules/communication/lang/ko.lang.php @@ -1,48 +1,48 @@ -communication = '커뮤니케이션'; - $lang->about_communication = '회원 간의 쪽지나 친구 관리 등 커뮤니케이션 기능을 수행하는 모듈입니다.'; - - $lang->allow_message = '쪽지 수신 허용'; - $lang->allow_message_type = array( - 'Y' => '전체 수신', - 'N' => '거부', - 'F' => '친구만 허용', - ); - - $lang->message_box = array( - 'R' => '받은 쪽지함', - 'S' => '보낸 쪽지함', - 'T' => '보관함', - ); - - $lang->readed_date = '읽은 시간'; - - $lang->sender = '보낸이'; - $lang->receiver = '받는이'; - $lang->friend_group = '친구 그룹'; - $lang->default_friend_group = '그룹 미지정'; - - $lang->cmd_send_message = '쪽지 보내기'; - $lang->cmd_reply_message = '쪽지 답장'; - $lang->cmd_view_friend = '친구 보기'; - $lang->cmd_add_friend = '친구 등록'; - $lang->cmd_view_message_box = '쪽지함 보기'; - $lang->cmd_store = '보관'; - $lang->cmd_add_friend_group = '친구 그룹 추가'; - $lang->cmd_rename_friend_group = '친구 그룹 이름 변경'; - - $lang->msg_no_message = '쪽지가 없습니다.'; - $lang->message_received = '쪽지가 왔습니다.'; - - $lang->msg_title_is_null = '쪽지 제목을 입력해주세요.'; - $lang->msg_content_is_null = '내용을 입력해주세요.'; - $lang->msg_allow_message_to_friend = '친구에게만 쪽지 발송을 허용한 사용자라서 쪽지 발송을 하지 못했습니다.'; - $lang->msg_disallow_message = '쪽지 수신을 거부한 사용자라서 쪽지 발송을 하지 못했습니다.'; - $lang->about_allow_message = '쪽지 수신 여부를 결정할 수 있습니다.'; -?> +communication = '커뮤니케이션'; + $lang->about_communication = '회원 간의 쪽지나 친구 관리 등 커뮤니케이션 기능을 수행하는 모듈입니다.'; + + $lang->allow_message = '쪽지 수신 허용'; + $lang->allow_message_type = array( + 'Y' => '전체 수신', + 'N' => '거부', + 'F' => '친구만 허용', + ); + + $lang->message_box = array( + 'R' => '받은 쪽지함', + 'S' => '보낸 쪽지함', + 'T' => '보관함', + ); + + $lang->readed_date = '읽은 시간'; + + $lang->sender = '보낸이'; + $lang->receiver = '받는이'; + $lang->friend_group = '친구 그룹'; + $lang->default_friend_group = '그룹 미지정'; + + $lang->cmd_send_message = '쪽지 보내기'; + $lang->cmd_reply_message = '쪽지 답장'; + $lang->cmd_view_friend = '친구 보기'; + $lang->cmd_add_friend = '친구 등록'; + $lang->cmd_view_message_box = '쪽지함 보기'; + $lang->cmd_store = '보관'; + $lang->cmd_add_friend_group = '친구 그룹 추가'; + $lang->cmd_rename_friend_group = '친구 그룹 이름 변경'; + + $lang->msg_no_message = '쪽지가 없습니다.'; + $lang->message_received = '쪽지가 왔습니다.'; + + $lang->msg_title_is_null = '쪽지 제목을 입력해주세요.'; + $lang->msg_content_is_null = '내용을 입력해주세요.'; + $lang->msg_allow_message_to_friend = '친구에게만 쪽지 발송을 허용한 사용자라서 쪽지 발송을 하지 못했습니다.'; + $lang->msg_disallow_message = '쪽지 수신을 거부한 사용자라서 쪽지 발송을 하지 못했습니다.'; + $lang->about_allow_message = '쪽지 수신 여부를 결정할 수 있습니다.'; +?> diff --git a/modules/communication/lang/ru.lang.php b/modules/communication/lang/ru.lang.php index e85546a84..a4709dcd4 100644 --- a/modules/communication/lang/ru.lang.php +++ b/modules/communication/lang/ru.lang.php @@ -1,49 +1,49 @@ -communication = 'Общение'; - $lang->about_communication = 'Модуль для общения между пользователями'; - - $lang->allow_message = 'Получать сообщения'; - $lang->allow_message_type = array( - 'Y' => 'Принимать все', - 'N' => 'Отклонять все', - 'F' => 'Принимать только от друзей', - ); - - - $lang->message_box = array( - 'R' => 'Полученные', - 'S' => 'Отправленные', - 'T' => 'Почтовый ящик', - ); - - $lang->readed_date = "Дата прочтения сообщения"; - - $lang->sender = 'Отправитель'; - $lang->receiver = 'Получатель'; - $lang->friend_group = 'Группа Друзья'; - $lang->default_friend_group = 'Незарегистрированная группа'; - - $lang->cmd_send_message = 'Отправить сообщение'; - $lang->cmd_reply_message = 'Ответить'; - $lang->cmd_view_friend = 'Друзья'; - $lang->cmd_add_friend = 'Добавить в друзья'; - $lang->cmd_view_message_box = 'Личные сообщений'; - $lang->cmd_store = "Сохранить"; - $lang->cmd_add_friend_group = 'Добавить в группу друзей'; - $lang->cmd_rename_friend_group = 'Изменить имя группы друзей'; - - $lang->msg_no_message = 'Сообщений нет'; - $lang->message_received = 'У Вас новое сообщение'; - - $lang->msg_title_is_null = 'Пожалуйста, введите тему сообщения'; - $lang->msg_content_is_null = 'Пожалуйста, введите содержание'; - $lang->msg_allow_message_to_friend = "Сообщение не отправлено, поскольку являетесь пользователем, имеющим право посылать сообщения только друзьям"; - $lang->msg_disallow_message = 'Сообщение не отправлено, поскольку получатель запретил прием сообщений'; - $lang->about_allow_message = 'Вы можете установить режим принятия сообщений'; -?> +communication = 'Общение'; + $lang->about_communication = 'Модуль для общения между пользователями'; + + $lang->allow_message = 'Получать сообщения'; + $lang->allow_message_type = array( + 'Y' => 'Принимать все', + 'N' => 'Отклонять все', + 'F' => 'Принимать только от друзей', + ); + + + $lang->message_box = array( + 'R' => 'Полученные', + 'S' => 'Отправленные', + 'T' => 'Почтовый ящик', + ); + + $lang->readed_date = "Дата прочтения сообщения"; + + $lang->sender = 'Отправитель'; + $lang->receiver = 'Получатель'; + $lang->friend_group = 'Группа Друзья'; + $lang->default_friend_group = 'Незарегистрированная группа'; + + $lang->cmd_send_message = 'Отправить сообщение'; + $lang->cmd_reply_message = 'Ответить'; + $lang->cmd_view_friend = 'Друзья'; + $lang->cmd_add_friend = 'Добавить в друзья'; + $lang->cmd_view_message_box = 'Личные сообщений'; + $lang->cmd_store = "Сохранить"; + $lang->cmd_add_friend_group = 'Добавить в группу друзей'; + $lang->cmd_rename_friend_group = 'Изменить имя группы друзей'; + + $lang->msg_no_message = 'Сообщений нет'; + $lang->message_received = 'У Вас новое сообщение'; + + $lang->msg_title_is_null = 'Пожалуйста, введите тему сообщения'; + $lang->msg_content_is_null = 'Пожалуйста, введите содержание'; + $lang->msg_allow_message_to_friend = "Сообщение не отправлено, поскольку являетесь пользователем, имеющим право посылать сообщения только друзьям"; + $lang->msg_disallow_message = 'Сообщение не отправлено, поскольку получатель запретил прием сообщений'; + $lang->about_allow_message = 'Вы можете установить режим принятия сообщений'; +?> diff --git a/modules/communication/lang/tr.lang.php b/modules/communication/lang/tr.lang.php index 62607e379..f8c326cbe 100644 --- a/modules/communication/lang/tr.lang.php +++ b/modules/communication/lang/tr.lang.php @@ -1,48 +1,48 @@ -communication = 'İletişim'; - $lang->about_communication = 'İletişim modülü; üyelerin, mesajlaşması ve arkadaşlarıyla iletişimleri için kullanılan modüldür.'; - - $lang->allow_message = 'Receive Messages'; - $lang->allow_message_type = array( - 'Y' => 'Hepsini Al', - 'N' => 'Hepsini Geri Çevir', - 'F' => 'Sadece Arkadaşlar', - ); - - $lang->message_box = array( - 'R' => 'Gelen', - 'S' => 'Gönderilmiş', - 'T' => 'PostaKutusu', - ); - $lang->readed_date = "Okuma Tarihi"; - - $lang->sender = 'Gönderen'; - $lang->receiver = 'Alıcı'; - $lang->friend_group = 'Arkadaş Grubu'; - $lang->default_friend_group = 'Atanmamış Grup'; - - $lang->cmd_send_message = 'Mesaj Gönder'; - $lang->cmd_reply_message = 'Mesajı Yanıtla'; - $lang->cmd_view_friend = 'Arkadaşlar'; - $lang->cmd_add_friend = 'Arkadaş Ekle'; - $lang->cmd_view_message_box = 'Mesaj Kutusu'; - $lang->cmd_store = "Kaydet"; - $lang->cmd_add_friend_group = 'Arkadaş Grubu Ekle'; - $lang->cmd_rename_friend_group = 'Arkadaş Grubu İsmini Düzenle'; - - $lang->msg_no_message = 'Mesaj yok'; - $lang->message_received = 'Yeni bir mesajınız var'; - - $lang->msg_title_is_null = 'Lütfen mesaj başlığı giriniz'; - $lang->msg_content_is_null = 'Lütfen içeriği giriniz'; - $lang->msg_allow_message_to_friend = "Alıcı yalnızca arkadaşlarından gelen mesajları kabul ettiği için mesaj gönderilemedi"; - $lang->msg_disallow_message = 'Alıcı mesaj alımını kapattığı için mesaj gönderilemedi'; - - $lang->about_allow_message = 'Mesaj alımını belirleyebilirsiniz'; -?> +communication = 'İletişim'; + $lang->about_communication = 'İletişim modülü; üyelerin, mesajlaşması ve arkadaşlarıyla iletişimleri için kullanılan modüldür.'; + + $lang->allow_message = 'Receive Messages'; + $lang->allow_message_type = array( + 'Y' => 'Hepsini Al', + 'N' => 'Hepsini Geri Çevir', + 'F' => 'Sadece Arkadaşlar', + ); + + $lang->message_box = array( + 'R' => 'Gelen', + 'S' => 'Gönderilmiş', + 'T' => 'PostaKutusu', + ); + $lang->readed_date = "Okuma Tarihi"; + + $lang->sender = 'Gönderen'; + $lang->receiver = 'Alıcı'; + $lang->friend_group = 'Arkadaş Grubu'; + $lang->default_friend_group = 'Atanmamış Grup'; + + $lang->cmd_send_message = 'Mesaj Gönder'; + $lang->cmd_reply_message = 'Mesajı Yanıtla'; + $lang->cmd_view_friend = 'Arkadaşlar'; + $lang->cmd_add_friend = 'Arkadaş Ekle'; + $lang->cmd_view_message_box = 'Mesaj Kutusu'; + $lang->cmd_store = "Kaydet"; + $lang->cmd_add_friend_group = 'Arkadaş Grubu Ekle'; + $lang->cmd_rename_friend_group = 'Arkadaş Grubu İsmini Düzenle'; + + $lang->msg_no_message = 'Mesaj yok'; + $lang->message_received = 'Yeni bir mesajınız var'; + + $lang->msg_title_is_null = 'Lütfen mesaj başlığı giriniz'; + $lang->msg_content_is_null = 'Lütfen içeriği giriniz'; + $lang->msg_allow_message_to_friend = "Alıcı yalnızca arkadaşlarından gelen mesajları kabul ettiği için mesaj gönderilemedi"; + $lang->msg_disallow_message = 'Alıcı mesaj alımını kapattığı için mesaj gönderilemedi'; + + $lang->about_allow_message = 'Mesaj alımını belirleyebilirsiniz'; +?> diff --git a/modules/communication/lang/vi.lang.php b/modules/communication/lang/vi.lang.php index ef9514c86..3365acc03 100644 --- a/modules/communication/lang/vi.lang.php +++ b/modules/communication/lang/vi.lang.php @@ -1,50 +1,50 @@ -communication = 'Thông báo'; - $lang->about_communication = 'Module này thực hiện chức năng giao tiếp, tin nhắn hay bạn bè.'; - - $lang->allow_message = 'Nhận tin nhắn'; - $lang->allow_message_type = array( - 'Y' => 'Nhận tất cả', - 'N' => 'Từ chối tất cả', - 'F' => 'Chỉ bạn bè', - ); - - $lang->message_box = array( - 'R' => 'Đã nhận', - 'S' => 'Gửi', - 'T' => 'Hòm thư', - ); - $lang->readed_date = "Ngày đọc"; - - $lang->sender = 'Người gửi'; - $lang->receiver = 'Người nhận'; - $lang->friend_group = 'Nhóm bạn'; - $lang->default_friend_group = 'Nhóm mặc định'; - - $lang->cmd_send_message = 'Gửi tin nhắn'; - $lang->cmd_reply_message = 'Trả lời tin nhắn'; - $lang->cmd_view_friend = 'Bạn bè'; - $lang->cmd_add_friend = 'Thêm bạn'; - $lang->cmd_view_message_box = 'Hộp tin nhắn'; - $lang->cmd_store = "Lưu"; - $lang->cmd_add_friend_group = 'Thêm nhóm bạn'; - $lang->cmd_rename_friend_group = 'Sử tên nhóm'; - - $lang->msg_no_message = 'Không có tin nhắn nào.'; - $lang->message_received = 'Bạn có tin nhắn mới.'; - - $lang->msg_title_is_null = 'Xin vui lòng nhập tiêu đề của tin nhắn.'; - $lang->msg_content_is_null = 'Xin vui lòng nhập nội dung.'; - $lang->msg_allow_message_to_friend = "Không thể gửi vì người nhận chỉ chấp nhận những tin nhắn từ bạn bè của họ."; - $lang->msg_disallow_message = 'Không thể gửi vì người nhận đã từ chối nhận tin nhắn.'; - - $lang->about_allow_message = 'Bạn có thể đồng ý nhận tin nhắn.'; -?> +communication = 'Thông báo'; + $lang->about_communication = 'Module này thực hiện chức năng giao tiếp, tin nhắn hay bạn bè.'; + + $lang->allow_message = 'Nhận tin nhắn'; + $lang->allow_message_type = array( + 'Y' => 'Nhận tất cả', + 'N' => 'Từ chối tất cả', + 'F' => 'Chỉ bạn bè', + ); + + $lang->message_box = array( + 'R' => 'Đã nhận', + 'S' => 'Gửi', + 'T' => 'Hòm thư', + ); + $lang->readed_date = "Ngày đọc"; + + $lang->sender = 'Người gửi'; + $lang->receiver = 'Người nhận'; + $lang->friend_group = 'Nhóm bạn'; + $lang->default_friend_group = 'Nhóm mặc định'; + + $lang->cmd_send_message = 'Gửi tin nhắn'; + $lang->cmd_reply_message = 'Trả lời tin nhắn'; + $lang->cmd_view_friend = 'Bạn bè'; + $lang->cmd_add_friend = 'Thêm bạn'; + $lang->cmd_view_message_box = 'Hộp tin nhắn'; + $lang->cmd_store = "Lưu"; + $lang->cmd_add_friend_group = 'Thêm nhóm bạn'; + $lang->cmd_rename_friend_group = 'Sử tên nhóm'; + + $lang->msg_no_message = 'Không có tin nhắn nào.'; + $lang->message_received = 'Bạn có tin nhắn mới.'; + + $lang->msg_title_is_null = 'Xin vui lòng nhập tiêu đề của tin nhắn.'; + $lang->msg_content_is_null = 'Xin vui lòng nhập nội dung.'; + $lang->msg_allow_message_to_friend = "Không thể gửi vì người nhận chỉ chấp nhận những tin nhắn từ bạn bè của họ."; + $lang->msg_disallow_message = 'Không thể gửi vì người nhận đã từ chối nhận tin nhắn.'; + + $lang->about_allow_message = 'Bạn có thể đồng ý nhận tin nhắn.'; +?> diff --git a/modules/communication/lang/zh-CN.lang.php b/modules/communication/lang/zh-CN.lang.php index e587513eb..dbe9476c0 100644 --- a/modules/communication/lang/zh-CN.lang.php +++ b/modules/communication/lang/zh-CN.lang.php @@ -1,49 +1,49 @@ -communication = '会员交流'; - $lang->about_communication = '管理在线会员间短信息及好友功能的模块。'; - - $lang->allow_message = '接收短消息'; - $lang->allow_message_type = array( - 'Y' => '全部接收', - 'N' => '拒收', - 'F' => '只允许好友', - ); - - $lang->message_box = array( - 'R' => '收件箱', - 'S' => '发件箱', - 'T' => '保管箱', - ); - - $lang->readed_date = "阅读日期"; - - $lang->sender = '寄件人'; - $lang->receiver = '收件人'; - $lang->friend_group = '好友组'; - $lang->default_friend_group = '组未指定'; - - $lang->cmd_send_message = '发送短消息'; - $lang->cmd_reply_message = '回复短消息'; - $lang->cmd_view_friend = '我的好友'; - $lang->cmd_add_friend = '加为好友'; - $lang->cmd_view_message_box = '短信箱'; - $lang->cmd_store = "保管"; - $lang->cmd_add_friend_group = '添加好友组'; - $lang->cmd_rename_friend_group = '修改好友组名称'; - - $lang->msg_no_message = '没有短消息。'; - $lang->message_received = '您有新消息。'; - - $lang->msg_title_is_null = '请输入短消息标题。'; - $lang->msg_content_is_null = '请输入内容。'; - $lang->msg_allow_message_to_friend = '因其为只允许接收好友短消息的用户,所以不能发送短消息。'; - $lang->msg_disallow_message = '因其为拒绝接收短消息的用户,所以不能发送短消息。'; - - $lang->about_allow_message = '可以选择短消息接收与否。'; -?> +communication = '会员交流'; + $lang->about_communication = '管理在线会员间短信息及好友功能的模块。'; + + $lang->allow_message = '接收短消息'; + $lang->allow_message_type = array( + 'Y' => '全部接收', + 'N' => '拒收', + 'F' => '只允许好友', + ); + + $lang->message_box = array( + 'R' => '收件箱', + 'S' => '发件箱', + 'T' => '保管箱', + ); + + $lang->readed_date = "阅读日期"; + + $lang->sender = '寄件人'; + $lang->receiver = '收件人'; + $lang->friend_group = '好友组'; + $lang->default_friend_group = '组未指定'; + + $lang->cmd_send_message = '发送短消息'; + $lang->cmd_reply_message = '回复短消息'; + $lang->cmd_view_friend = '我的好友'; + $lang->cmd_add_friend = '加为好友'; + $lang->cmd_view_message_box = '短信箱'; + $lang->cmd_store = "保管"; + $lang->cmd_add_friend_group = '添加好友组'; + $lang->cmd_rename_friend_group = '修改好友组名称'; + + $lang->msg_no_message = '没有短消息。'; + $lang->message_received = '您有新消息。'; + + $lang->msg_title_is_null = '请输入短消息标题。'; + $lang->msg_content_is_null = '请输入内容。'; + $lang->msg_allow_message_to_friend = '因其为只允许接收好友短消息的用户,所以不能发送短消息。'; + $lang->msg_disallow_message = '因其为拒绝接收短消息的用户,所以不能发送短消息。'; + + $lang->about_allow_message = '可以选择短消息接收与否。'; +?> diff --git a/modules/communication/lang/zh-TW.lang.php b/modules/communication/lang/zh-TW.lang.php index 2b62b46c9..c8fc99469 100644 --- a/modules/communication/lang/zh-TW.lang.php +++ b/modules/communication/lang/zh-TW.lang.php @@ -1,48 +1,48 @@ -communication = '交流'; - $lang->about_communication = '管理短訊息及好友功能的模組。'; - - $lang->allow_message = '接收短訊息'; - $lang->allow_message_type = array( - 'Y' => '全部接收', - 'N' => '全部拒收', - 'F' => '只允許好友', - ); - - $lang->message_box = array( - 'R' => '收信箱', - 'S' => '寄信箱', - 'T' => '儲存箱', - ); - - $lang->readed_date = "閱讀日期"; - - $lang->sender = '寄件人'; - $lang->receiver = '收件人'; - $lang->friend_group = '好友群組'; - $lang->default_friend_group = '群組未指定'; - - $lang->cmd_send_message = '發送短訊息'; - $lang->cmd_reply_message = '回覆短訊息'; - $lang->cmd_view_friend = '檢視好友'; - $lang->cmd_add_friend = '加為好友'; - $lang->cmd_view_message_box = '檢視短訊箱'; - $lang->cmd_store = "儲存"; - $lang->cmd_add_friend_group = '新增好友群組'; - $lang->cmd_rename_friend_group = '修改好友群組名稱'; - - $lang->msg_no_message = '沒有短訊息。'; - $lang->message_received = '您有新訊息。'; - - $lang->msg_title_is_null = '請輸入短訊息標題。'; - $lang->msg_content_is_null = '請輸入內容。'; - $lang->msg_allow_message_to_friend = '只允許接收好友短訊息的用戶,不能發送短訊息。'; - $lang->msg_disallow_message = '拒絕接收短訊息的用戶,不能發送短訊息。'; - $lang->about_allow_message = '可選擇是否接收短訊息。'; -?> +communication = '交流'; + $lang->about_communication = '管理短訊息及好友功能的模組。'; + + $lang->allow_message = '接收短訊息'; + $lang->allow_message_type = array( + 'Y' => '全部接收', + 'N' => '全部拒收', + 'F' => '只允許好友', + ); + + $lang->message_box = array( + 'R' => '收信箱', + 'S' => '寄信箱', + 'T' => '儲存箱', + ); + + $lang->readed_date = "閱讀日期"; + + $lang->sender = '寄件人'; + $lang->receiver = '收件人'; + $lang->friend_group = '好友群組'; + $lang->default_friend_group = '群組未指定'; + + $lang->cmd_send_message = '發送短訊息'; + $lang->cmd_reply_message = '回覆短訊息'; + $lang->cmd_view_friend = '檢視好友'; + $lang->cmd_add_friend = '加為好友'; + $lang->cmd_view_message_box = '檢視短訊箱'; + $lang->cmd_store = "儲存"; + $lang->cmd_add_friend_group = '新增好友群組'; + $lang->cmd_rename_friend_group = '修改好友群組名稱'; + + $lang->msg_no_message = '沒有短訊息。'; + $lang->message_received = '您有新訊息。'; + + $lang->msg_title_is_null = '請輸入短訊息標題。'; + $lang->msg_content_is_null = '請輸入內容。'; + $lang->msg_allow_message_to_friend = '只允許接收好友短訊息的用戶,不能發送短訊息。'; + $lang->msg_disallow_message = '拒絕接收短訊息的用戶,不能發送短訊息。'; + $lang->about_allow_message = '可選擇是否接收短訊息。'; +?> diff --git a/modules/communication/skins/default/friends.html b/modules/communication/skins/default/friends.html index d8931181e..e00b4e7a8 100644 --- a/modules/communication/skins/default/friends.html +++ b/modules/communication/skins/default/friends.html @@ -1,86 +1,86 @@ - - - - - - -
    - -

    {$member_title = $lang->cmd_view_friend } ({$total_count})

    - -
    - -
    - - {$lang->cmd_modify} - {$lang->cmd_delete} - {$lang->cmd_add_friend_group} -
    - -
    - {$lang->cmd_move} -
    - - - - - - - - - - - - - - - - - - - -
    {$lang->friend_group}
    {$lang->nick_name}
    {$lang->regdate}
    {$val->group_title?$val->group_title:" "}{$val->nick_name}{zdate($val->regdate,"Y-m-d")}
    - - {$lang->cmd_move} - - {$lang->cmd_back} -
    - - - - - -
    - - - -
    - -
    -
    - - - + + + + + + +
    + +

    {$member_title = $lang->cmd_view_friend } ({$total_count})

    + +
    + +
    + + {$lang->cmd_modify} + {$lang->cmd_delete} + {$lang->cmd_add_friend_group} +
    + +
    + {$lang->cmd_move} +
    + + + + + + + + + + + + + + + + + + + +
    {$lang->friend_group}
    {$lang->nick_name}
    {$lang->regdate}
    {$val->group_title?$val->group_title:" "}{$val->nick_name}{zdate($val->regdate,"Y-m-d")}
    + + {$lang->cmd_move} + + {$lang->cmd_back} +
    + + + + + +
    + + + +
    + +
    +
    + + + diff --git a/modules/communication/skins/default/messages.html b/modules/communication/skins/default/messages.html index fefb2d320..b30004286 100644 --- a/modules/communication/skins/default/messages.html +++ b/modules/communication/skins/default/messages.html @@ -1,123 +1,123 @@ - - - - -
    -
    - - -
    - - -
    -

    - - -

    -
    - - - - - - - - - - - - - - - - -
    {$message->title}
    - {$message->nick_name} - {zdate($message->regdate, "Y.m.d H:i:s")} -
    -
    {$message->content}
    -
    - - {$lang->cmd_reply_message} - - - {$lang->cmd_store} - - {$lang->cmd_delete} -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    - - {$lang->title} -
    - - {$lang->receiver} - - {$lang->sender} - -
    {$lang->regdate}
    - - - {$val->title} - - {$val->title} - - -
    {$val->nick_name}
    -
    {zdate($val->regdate,"Y-m-d")}
    -
    {zdate($val->readed_date,"Y-m-d H:i:s")}
    -
    - -
    - -
    - - - -
    - - + + + + +
    +
    + + +
    + + +
    +

    + + +

    +
    + + + + + + + + + + + + + + + + +
    {$message->title}
    + {$message->nick_name} + {zdate($message->regdate, "Y.m.d H:i:s")} +
    +
    {$message->content}
    +
    + + {$lang->cmd_reply_message} + + + {$lang->cmd_store} + + {$lang->cmd_delete} +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    + + {$lang->title} +
    + + {$lang->receiver} + + {$lang->sender} + +
    {$lang->regdate}
    + + + {$val->title} + + {$val->title} + + +
    {$val->nick_name}
    +
    {zdate($val->regdate,"Y-m-d")}
    +
    {zdate($val->readed_date,"Y-m-d H:i:s")}
    +
    + +
    + +
    + + + +
    + + diff --git a/modules/communication/skins/default/skin.xml b/modules/communication/skins/default/skin.xml index ed3560255..14c240e70 100644 --- a/modules/communication/skins/default/skin.xml +++ b/modules/communication/skins/default/skin.xml @@ -1,122 +1,122 @@ - - - 기본 스킨 - 默认皮肤 - 基本スキン - Default Skin - Skin Mặc định - Por defecto piel - 기본 스킨 - 預設面板 - Varsayılan Dış Görünüm - - NHN (developers@xpressengine.com) - - - NHN (developers@xpressengine.com) - - - NHN (developers@xpressengine.com) - - - NHN (developers@xpressengine.com) - - - NHN (developers@xpressengine.com) - - - NHN (developers@xpressengine.com) - - - NHN (developers@xpressengine.com) - - - NHN (developers@xpressengine.com) - - - NHN (developers@xpressengine.com) - - 0.1 - 2008-05-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - - - - 기본 - 默认 - デフォルト - default - Mặc định - Por defecto - умолчанию - 預設 - varsayılan - - - 청록색 - 青緑 - 青绿色 - cyan - Cyan - Cian - бирюзовый - 青綠色 - Deniz Mavisi - - - 초록색 - - 绿色 - green - Green - Verde - зеленый - 綠色 - Yeşil - - - 빨간색 - - 红色 - red - Red - Roja - красный - 紅色 - Kırmızı - - - 보라색 - - 紫色 - purple - Purple - Púrpura - Лиловый - 紫色 - Mor - - - 검은색 - - Black - Black - Черного - Negro - 黑色 - 黑色 - Siyah - - - + + + 기본 스킨 + 默认皮肤 + 基本スキン + Default Skin + Skin Mặc định + Por defecto piel + 기본 스킨 + 預設面板 + Varsayılan Dış Görünüm + + NHN (developers@xpressengine.com) + + + NHN (developers@xpressengine.com) + + + NHN (developers@xpressengine.com) + + + NHN (developers@xpressengine.com) + + + NHN (developers@xpressengine.com) + + + NHN (developers@xpressengine.com) + + + NHN (developers@xpressengine.com) + + + NHN (developers@xpressengine.com) + + + NHN (developers@xpressengine.com) + + 0.1 + 2008-05-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + + + + 기본 + 默认 + デフォルト + default + Mặc định + Por defecto + умолчанию + 預設 + varsayılan + + + 청록색 + 青緑 + 青绿色 + cyan + Cyan + Cian + бирюзовый + 青綠色 + Deniz Mavisi + + + 초록색 + + 绿色 + green + Green + Verde + зеленый + 綠色 + Yeşil + + + 빨간색 + + 红色 + red + Red + Roja + красный + 紅色 + Kırmızı + + + 보라색 + + 紫色 + purple + Purple + Púrpura + Лиловый + 紫色 + Mor + + + 검은색 + + Black + Black + Черного + Negro + 黑色 + 黑色 + Siyah + + + diff --git a/modules/counter/conf/info.xml b/modules/counter/conf/info.xml index c3c3c2529..2b610bf04 100644 --- a/modules/counter/conf/info.xml +++ b/modules/counter/conf/info.xml @@ -1,36 +1,36 @@ - - - 접속통계 - 访问统计 - Counter - Counter - Contador - アクセスカウンター - Базовый счетчик - 基本統計 - Sayaç - 기본 접속 통계 프로그램입니다. - 默认访问统计程序。 - Basic connection statistics program. - Chương trình thống kê kết nối cơ bản. - Programa básico para la estadística de la conección. - デフォルトアクセス統計のプログラムです。 - Базовая программа статистики подключений. - 預設的統計程式。 - Temel bağlantı istatistik programı. - 0.1 - 2007-02-28 - statistics - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 접속통계 + 访问统计 + Counter + Counter + Contador + アクセスカウンター + Базовый счетчик + 基本統計 + Sayaç + 기본 접속 통계 프로그램입니다. + 默认访问统计程序。 + Basic connection statistics program. + Chương trình thống kê kết nối cơ bản. + Programa básico para la estadística de la conección. + デフォルトアクセス統計のプログラムです。 + Базовая программа статистики подключений. + 預設的統計程式。 + Temel bağlantı istatistik programı. + 0.1 + 2007-02-28 + statistics + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/counter/counter.admin.view.php b/modules/counter/counter.admin.view.php index 8ef40d49e..92851917c 100644 --- a/modules/counter/counter.admin.view.php +++ b/modules/counter/counter.admin.view.php @@ -1,50 +1,50 @@ -setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 관리자 페이지 초기화면 - **/ - function dispCounterAdminIndex() { - // 정해진 일자가 없으면 오늘자로 설정 - $selected_date = Context::get('selected_date'); - if(!$selected_date) $selected_date = date("Ymd"); - Context::set('selected_date', $selected_date); - - // counter model 객체 생성 - $oCounterModel = &getModel('counter'); - - // 전체 카운터 및 지정된 일자의 현황 가져오기 - $site_module_info = Context::get('site_module_info'); - $status = $oCounterModel->getStatus(array(0,$selected_date),$site_module_info->site_srl); - Context::set('total_counter', $status[0]); - Context::set('selected_day_counter', $status[$selected_date]); - - // 시간, 일, 월, 년도별로 데이터 가져오기 - $type = Context::get('type'); - if(!$type) { - $type = 'day'; - Context::set('type',$type); - } - $detail_status = $oCounterModel->getHourlyStatus($type, $selected_date, $site_module_info->site_srl); - Context::set('detail_status', $detail_status); - - // 표시 - $this->setTemplateFile('index'); - } - - } -?> +setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 관리자 페이지 초기화면 + **/ + function dispCounterAdminIndex() { + // 정해진 일자가 없으면 오늘자로 설정 + $selected_date = Context::get('selected_date'); + if(!$selected_date) $selected_date = date("Ymd"); + Context::set('selected_date', $selected_date); + + // counter model 객체 생성 + $oCounterModel = &getModel('counter'); + + // 전체 카운터 및 지정된 일자의 현황 가져오기 + $site_module_info = Context::get('site_module_info'); + $status = $oCounterModel->getStatus(array(0,$selected_date),$site_module_info->site_srl); + Context::set('total_counter', $status[0]); + Context::set('selected_day_counter', $status[$selected_date]); + + // 시간, 일, 월, 년도별로 데이터 가져오기 + $type = Context::get('type'); + if(!$type) { + $type = 'day'; + Context::set('type',$type); + } + $detail_status = $oCounterModel->getHourlyStatus($type, $selected_date, $site_module_info->site_srl); + Context::set('detail_status', $detail_status); + + // 표시 + $this->setTemplateFile('index'); + } + + } +?> diff --git a/modules/counter/counter.class.php b/modules/counter/counter.class.php index a6f9a9b72..39bbe0c95 100644 --- a/modules/counter/counter.class.php +++ b/modules/counter/counter.class.php @@ -1,55 +1,55 @@ -insertTotalStatus(); - - // 오늘자 row입력 - //$oCounterController->insertTodayStatus(); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - // 카운터에 site_srl추가 - $oDB = &DB::getInstance(); - if(!$oDB->isColumnExists('counter_log', 'site_srl')) return true; - if(!$oDB->isIndexExists('counter_log','idx_site_counter_log')) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - // 카운터에 site_srl추가 - $oDB = &DB::getInstance(); - if(!$oDB->isColumnExists('counter_log', 'site_srl')) $oDB->addColumn('counter_log','site_srl','number',11,0,true); - if(!$oDB->isIndexExists('counter_log','idx_site_counter_log')) $oDB->addIndex('counter_log','idx_site_counter_log',array('site_srl','ipaddress'),false); - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - } - } -?> +insertTotalStatus(); + + // 오늘자 row입력 + //$oCounterController->insertTodayStatus(); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + // 카운터에 site_srl추가 + $oDB = &DB::getInstance(); + if(!$oDB->isColumnExists('counter_log', 'site_srl')) return true; + if(!$oDB->isIndexExists('counter_log','idx_site_counter_log')) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + // 카운터에 site_srl추가 + $oDB = &DB::getInstance(); + if(!$oDB->isColumnExists('counter_log', 'site_srl')) $oDB->addColumn('counter_log','site_srl','number',11,0,true); + if(!$oDB->isIndexExists('counter_log','idx_site_counter_log')) $oDB->addIndex('counter_log','idx_site_counter_log',array('site_srl','ipaddress'),false); + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + } + } +?> diff --git a/modules/counter/counter.controller.php b/modules/counter/counter.controller.php index 19708a8a6..cb013787e 100644 --- a/modules/counter/counter.controller.php +++ b/modules/counter/counter.controller.php @@ -1,145 +1,145 @@ -begin(); - - $site_module_info = Context::get('site_module_info'); - $site_srl = (int)$site_module_info->site_srl; - - // 로그를 검사 - $oCounterModel = &getModel('counter'); - - // 오늘자 row가 있는지 체크하여 없으면 등록 - if(!$oCounterModel->isInsertedTodayStatus($site_srl)) { - $this->insertTodayStatus(0,$site_srl); - - // 기존 row가 있으면 사용자 체크 - } else { - - // 등록되어 있지 않은 아이피일 경우 - if(!$oCounterModel->isLogged($site_srl)) { - // 로그 등록 - $this->insertLog($site_srl); - - // unique 및 pageview 등록 - $this->insertUniqueVisitor($site_srl); - } else { - // pageview 등록 - $this->insertPageView($site_srl); - } - } - - $oDB->commit(); - } - - /** - * @brief 로그 등록 - **/ - function insertLog($site_srl=0) { - $args->regdate = date("YmdHis"); - $args->user_agent = substr ($_SERVER['HTTP_USER_AGENT'], 0, 250); - $args->site_srl = $site_srl; - return executeQuery('counter.insertCounterLog', $args); - } - - /** - * @brief unique visitor 등록 - **/ - function insertUniqueVisitor($site_srl=0) { - if($site_srl) { - $args->regdate = '0'; - $args->site_srl = $site_srl; - $output = executeQuery('counter.updateSiteCounterUnique', $args); - $args->regdate = date('Ymd'); - $output = executeQuery('counter.updateSiteCounterUnique', $args); - } else { - $args->regdate = '0'; - $output = executeQuery('counter.updateCounterUnique', $args); - $args->regdate = date('Ymd'); - $output = executeQuery('counter.updateCounterUnique', $args); - } - } - - /** - * @brief pageview 등록 - **/ - function insertPageView($site_srl=0) { - if($site_srl) { - $args->regdate = '0'; - $args->site_srl = $site_srl; - executeQuery('counter.updateSiteCounterPageview', $args); - $args->regdate = date('Ymd'); - executeQuery('counter.updateSiteCounterPageview', $args); - } else { - $args->regdate = '0'; - executeQuery('counter.updateCounterPageview', $args); - $args->regdate = date('Ymd'); - executeQuery('counter.updateCounterPageview', $args); - } - } - - /** - * @brief 전체 카운터 status 추가 - **/ - function insertTotalStatus($site_srl=0) { - $args->regdate = 0; - if($site_srl) { - $args->site_srl = $site_srl; - executeQuery('counter.insertSiteTodayStatus', $args); - } else { - executeQuery('counter.insertTodayStatus', $args); - } - } - - /** - * @brief 오늘자 카운터 status 추가 - **/ - function insertTodayStatus($regdate = 0, $site_srl=0) { - if($regdate) $args->regdate = $regdate; - else $args->regdate = date("Ymd"); - if($site_srl) { - $args->site_srl = $site_srl; - $query_id = 'counter.insertSiteTodayStatus'; - - $u_args->site_srl = $site_srl; ///< 일별 row입력시 전체 row (regdate=0)도 같이 입력 시도 - executeQuery($query_id, $u_args); - } else { - $query_id = 'counter.insertTodayStatus'; - executeQuery($query_id); ///< 일별 row입력시 전체 row (regdate=0)도 같이 입력 시도 - } - $output = executeQuery($query_id, $args); - - // 로그 등록 - $this->insertLog($site_srl); - - // unique 및 pageview 등록 - $this->insertUniqueVisitor($site_srl); - } - - /** - * @brief 특정 가상 사이트의 카운터 로그 삭제 - **/ - function deleteSiteCounterLogs($site_srl) { - $args->site_srl = $site_srl; - executeQuery('counter.deleteSiteCounter',$args); - executeQuery('counter.deleteSiteCounterLog',$args); - } - } -?> +begin(); + + $site_module_info = Context::get('site_module_info'); + $site_srl = (int)$site_module_info->site_srl; + + // 로그를 검사 + $oCounterModel = &getModel('counter'); + + // 오늘자 row가 있는지 체크하여 없으면 등록 + if(!$oCounterModel->isInsertedTodayStatus($site_srl)) { + $this->insertTodayStatus(0,$site_srl); + + // 기존 row가 있으면 사용자 체크 + } else { + + // 등록되어 있지 않은 아이피일 경우 + if(!$oCounterModel->isLogged($site_srl)) { + // 로그 등록 + $this->insertLog($site_srl); + + // unique 및 pageview 등록 + $this->insertUniqueVisitor($site_srl); + } else { + // pageview 등록 + $this->insertPageView($site_srl); + } + } + + $oDB->commit(); + } + + /** + * @brief 로그 등록 + **/ + function insertLog($site_srl=0) { + $args->regdate = date("YmdHis"); + $args->user_agent = substr ($_SERVER['HTTP_USER_AGENT'], 0, 250); + $args->site_srl = $site_srl; + return executeQuery('counter.insertCounterLog', $args); + } + + /** + * @brief unique visitor 등록 + **/ + function insertUniqueVisitor($site_srl=0) { + if($site_srl) { + $args->regdate = '0'; + $args->site_srl = $site_srl; + $output = executeQuery('counter.updateSiteCounterUnique', $args); + $args->regdate = date('Ymd'); + $output = executeQuery('counter.updateSiteCounterUnique', $args); + } else { + $args->regdate = '0'; + $output = executeQuery('counter.updateCounterUnique', $args); + $args->regdate = date('Ymd'); + $output = executeQuery('counter.updateCounterUnique', $args); + } + } + + /** + * @brief pageview 등록 + **/ + function insertPageView($site_srl=0) { + if($site_srl) { + $args->regdate = '0'; + $args->site_srl = $site_srl; + executeQuery('counter.updateSiteCounterPageview', $args); + $args->regdate = date('Ymd'); + executeQuery('counter.updateSiteCounterPageview', $args); + } else { + $args->regdate = '0'; + executeQuery('counter.updateCounterPageview', $args); + $args->regdate = date('Ymd'); + executeQuery('counter.updateCounterPageview', $args); + } + } + + /** + * @brief 전체 카운터 status 추가 + **/ + function insertTotalStatus($site_srl=0) { + $args->regdate = 0; + if($site_srl) { + $args->site_srl = $site_srl; + executeQuery('counter.insertSiteTodayStatus', $args); + } else { + executeQuery('counter.insertTodayStatus', $args); + } + } + + /** + * @brief 오늘자 카운터 status 추가 + **/ + function insertTodayStatus($regdate = 0, $site_srl=0) { + if($regdate) $args->regdate = $regdate; + else $args->regdate = date("Ymd"); + if($site_srl) { + $args->site_srl = $site_srl; + $query_id = 'counter.insertSiteTodayStatus'; + + $u_args->site_srl = $site_srl; ///< 일별 row입력시 전체 row (regdate=0)도 같이 입력 시도 + executeQuery($query_id, $u_args); + } else { + $query_id = 'counter.insertTodayStatus'; + executeQuery($query_id); ///< 일별 row입력시 전체 row (regdate=0)도 같이 입력 시도 + } + $output = executeQuery($query_id, $args); + + // 로그 등록 + $this->insertLog($site_srl); + + // unique 및 pageview 등록 + $this->insertUniqueVisitor($site_srl); + } + + /** + * @brief 특정 가상 사이트의 카운터 로그 삭제 + **/ + function deleteSiteCounterLogs($site_srl) { + $args->site_srl = $site_srl; + executeQuery('counter.deleteSiteCounter',$args); + executeQuery('counter.deleteSiteCounterLog',$args); + } + } +?> diff --git a/modules/counter/counter.model.php b/modules/counter/counter.model.php index bcdc3a7ac..7d137c32c 100644 --- a/modules/counter/counter.model.php +++ b/modules/counter/counter.model.php @@ -1,201 +1,201 @@ -regdate = date("Ymd"); - $args->ipaddress = $_SERVER['REMOTE_ADDR']; - $args->site_srl = $site_srl; - $output = executeQuery('counter.getCounterLog', $args); - return $output->data->count?true:false; - } - - /** - * @brief 오늘자 카운터 현황 row 있는지 체크 - **/ - function isInsertedTodayStatus($site_srl=0) { - $args->regdate = date("Ymd"); - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('counter.getSiteTodayStatus', $args); - } else { - $output = executeQuery('counter.getTodayStatus', $args); - } - return $output->data->count?true:false; - } - - /** - * @brief 특정 일의 접속 통계를 가져옴 - **/ - function getStatus($selected_date, $site_srl=0) { - // 여러개의 날짜 로그를 가져올 경우 - if(is_array($selected_date)) { - $date_count = count($selected_date); - $args->regdate = implode(',',$selected_date); - - // 단일 날짜의 로그를 가져올 경우 - } else { - if(strlen($selected_date)==8) $selected_date = $selected_date; - $args->regdate = $selected_date; - } - - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('counter.getSiteCounterStatusDays', $args); - } else { - $output = executeQuery('counter.getCounterStatusDays', $args); - } - $status = $output->data; - - if(!is_array($selected_date)) return $status; - - if(!is_array($status)) $status = array($status); - unset($output); - - foreach($status as $key => $val) { - $output[substr($val->regdate,0,8)] = $val; - } - return $output; - } - - /** - * @brief 지정된 일자의 시간대별 로그 가져오기 - **/ - function getHourlyStatus($type='hour', $selected_date, $site_srl=0) { - $max = 0; - $sum = 0; - switch($type) { - case 'year' : - // 카운터 시작일 구함 - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('counter.getSiteStartLogDate', $args); - } else { - $output = executeQuery('counter.getStartLogDate'); - } - $start_year = substr($output->data->regdate,0,4); - if(!$start_year) $start_year = date("Y"); - for($i=$start_year;$i<=date("Y");$i++) { - unset($args); - $args->start_date = sprintf('%04d0000', $i); - $args->end_date = sprintf('%04d1231', $i); - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('counter.getSiteCounterStatus', $args); - } else { - $output = executeQuery('counter.getCounterStatus', $args); - } - $count = (int)$output->data->unique_visitor; - $status->list[$i] = $count; - if($count>$max) $max = $count; - $sum += $count; - } - break; - case 'week' : - $time = strtotime($selected_date); - $w = date("D"); - while(date("D",$time) != "Sun") { - $time += 60*60*24; - } - $time -= 60*60*24; - while(date("D",$time)!="Sun") { - $thisWeek[] = date("Ymd",$time); - $time -= 60*60*24; - } - $thisWeek[] = date("Ymd",$time); - asort($thisWeek); - foreach($thisWeek as $day) { - unset($args); - $args->start_date = $day; - $args->end_date = $day; - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('counter.getSiteCounterStatus', $args); - } else { - $output = executeQuery('counter.getCounterStatus', $args); - } - $count = (int)$output->data->unique_visitor; - $status->list[$day] = (int)$count; - if($count>$max) $max = $count; - $sum += $count; - } - break; - case 'month' : - $year = substr($selected_date, 0, 4); - for($i=1;$i<=12;$i++) { - unset($args); - $args->start_date = sprintf('%04d%02d00', $year, $i); - $args->end_date = sprintf('%04d%02d31', $year, $i); - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('counter.getSiteCounterStatus', $args); - } else { - $output = executeQuery('counter.getCounterStatus', $args); - } - $count = (int)$output->data->unique_visitor; - $status->list[$i] = (int)$count; - if($count>$max) $max = $count; - $sum += $count; - } - break; - case 'hour' : - for($i=0;$i<24;$i++) { - unset($args); - $args->start_date = sprintf('%08d%02d0000', $selected_date, $i); - $args->end_date = sprintf('%08d%02d5959', $selected_date, $i); - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('counter.getSiteCounterLogStatus', $args); - } else { - $args->site_srl = 0; - $output = executeQuery('counter.getCounterLogStatus', $args); - } - $count = (int)$output->data->count; - $status->list[$i] = $count; - if($count>$max) $max = $count; - $sum += $count; - } - break; - default : - $year = substr($selected_date, 0, 4); - $month = substr($selected_date, 4, 2); - $end_day = date('t', mktime(0,0,0,$month,1,$year)); - for($i=1;$i<=$end_day;$i++) { - unset($args); - $args->start_date = sprintf('%04d%02d%02d', $year, $month, $i); - $args->end_date = sprintf('%04d%02d%02d', $year, $month, $i); - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('counter.getSiteCounterStatus', $args); - } else { - $output = executeQuery('counter.getCounterStatus', $args); - } - $count = (int)$output->data->unique_visitor; - $status->list[$i] = $count; - if($count>$max) $max = $count; - $sum += $count; - } - break; - } - - $status->max = $max; - $status->sum = $sum; - return $status; - } - - } -?> +regdate = date("Ymd"); + $args->ipaddress = $_SERVER['REMOTE_ADDR']; + $args->site_srl = $site_srl; + $output = executeQuery('counter.getCounterLog', $args); + return $output->data->count?true:false; + } + + /** + * @brief 오늘자 카운터 현황 row 있는지 체크 + **/ + function isInsertedTodayStatus($site_srl=0) { + $args->regdate = date("Ymd"); + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteTodayStatus', $args); + } else { + $output = executeQuery('counter.getTodayStatus', $args); + } + return $output->data->count?true:false; + } + + /** + * @brief 특정 일의 접속 통계를 가져옴 + **/ + function getStatus($selected_date, $site_srl=0) { + // 여러개의 날짜 로그를 가져올 경우 + if(is_array($selected_date)) { + $date_count = count($selected_date); + $args->regdate = implode(',',$selected_date); + + // 단일 날짜의 로그를 가져올 경우 + } else { + if(strlen($selected_date)==8) $selected_date = $selected_date; + $args->regdate = $selected_date; + } + + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteCounterStatusDays', $args); + } else { + $output = executeQuery('counter.getCounterStatusDays', $args); + } + $status = $output->data; + + if(!is_array($selected_date)) return $status; + + if(!is_array($status)) $status = array($status); + unset($output); + + foreach($status as $key => $val) { + $output[substr($val->regdate,0,8)] = $val; + } + return $output; + } + + /** + * @brief 지정된 일자의 시간대별 로그 가져오기 + **/ + function getHourlyStatus($type='hour', $selected_date, $site_srl=0) { + $max = 0; + $sum = 0; + switch($type) { + case 'year' : + // 카운터 시작일 구함 + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteStartLogDate', $args); + } else { + $output = executeQuery('counter.getStartLogDate'); + } + $start_year = substr($output->data->regdate,0,4); + if(!$start_year) $start_year = date("Y"); + for($i=$start_year;$i<=date("Y");$i++) { + unset($args); + $args->start_date = sprintf('%04d0000', $i); + $args->end_date = sprintf('%04d1231', $i); + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteCounterStatus', $args); + } else { + $output = executeQuery('counter.getCounterStatus', $args); + } + $count = (int)$output->data->unique_visitor; + $status->list[$i] = $count; + if($count>$max) $max = $count; + $sum += $count; + } + break; + case 'week' : + $time = strtotime($selected_date); + $w = date("D"); + while(date("D",$time) != "Sun") { + $time += 60*60*24; + } + $time -= 60*60*24; + while(date("D",$time)!="Sun") { + $thisWeek[] = date("Ymd",$time); + $time -= 60*60*24; + } + $thisWeek[] = date("Ymd",$time); + asort($thisWeek); + foreach($thisWeek as $day) { + unset($args); + $args->start_date = $day; + $args->end_date = $day; + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteCounterStatus', $args); + } else { + $output = executeQuery('counter.getCounterStatus', $args); + } + $count = (int)$output->data->unique_visitor; + $status->list[$day] = (int)$count; + if($count>$max) $max = $count; + $sum += $count; + } + break; + case 'month' : + $year = substr($selected_date, 0, 4); + for($i=1;$i<=12;$i++) { + unset($args); + $args->start_date = sprintf('%04d%02d00', $year, $i); + $args->end_date = sprintf('%04d%02d31', $year, $i); + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteCounterStatus', $args); + } else { + $output = executeQuery('counter.getCounterStatus', $args); + } + $count = (int)$output->data->unique_visitor; + $status->list[$i] = (int)$count; + if($count>$max) $max = $count; + $sum += $count; + } + break; + case 'hour' : + for($i=0;$i<24;$i++) { + unset($args); + $args->start_date = sprintf('%08d%02d0000', $selected_date, $i); + $args->end_date = sprintf('%08d%02d5959', $selected_date, $i); + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteCounterLogStatus', $args); + } else { + $args->site_srl = 0; + $output = executeQuery('counter.getCounterLogStatus', $args); + } + $count = (int)$output->data->count; + $status->list[$i] = $count; + if($count>$max) $max = $count; + $sum += $count; + } + break; + default : + $year = substr($selected_date, 0, 4); + $month = substr($selected_date, 4, 2); + $end_day = date('t', mktime(0,0,0,$month,1,$year)); + for($i=1;$i<=$end_day;$i++) { + unset($args); + $args->start_date = sprintf('%04d%02d%02d', $year, $month, $i); + $args->end_date = sprintf('%04d%02d%02d', $year, $month, $i); + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('counter.getSiteCounterStatus', $args); + } else { + $output = executeQuery('counter.getCounterStatus', $args); + } + $count = (int)$output->data->unique_visitor; + $status->list[$i] = $count; + if($count>$max) $max = $count; + $sum += $count; + } + break; + } + + $status->max = $max; + $status->sum = $sum; + return $status; + } + + } +?> diff --git a/modules/counter/lang/en.lang.php b/modules/counter/lang/en.lang.php index be9fe5756..0b07aca29 100644 --- a/modules/counter/lang/en.lang.php +++ b/modules/counter/lang/en.lang.php @@ -1,25 +1,25 @@ -counter = "Counter"; - $lang->cmd_select_date = 'Select Date'; - $lang->cmd_select_counter_type = array( - 'hour' => 'By Hour', - 'day' => 'By Day', - 'month' => 'By Month', - 'year' => 'By Year', - ); - - $lang->total_counter = 'Total Status'; - $lang->selected_day_counter = 'Status of Selected Day'; - - $lang->unique_visitor = 'Visitors'; - $lang->pageview = 'Pageview'; - - $lang->today = 'today'; - $lang->yesterday = 'yesterday'; -?> +counter = "Counter"; + $lang->cmd_select_date = 'Select Date'; + $lang->cmd_select_counter_type = array( + 'hour' => 'By Hour', + 'day' => 'By Day', + 'month' => 'By Month', + 'year' => 'By Year', + ); + + $lang->total_counter = 'Total Status'; + $lang->selected_day_counter = 'Status of Selected Day'; + + $lang->unique_visitor = 'Visitors'; + $lang->pageview = 'Pageview'; + + $lang->today = 'today'; + $lang->yesterday = 'yesterday'; +?> diff --git a/modules/counter/lang/es.lang.php b/modules/counter/lang/es.lang.php index 9e5b3df5e..a66f2bbbb 100644 --- a/modules/counter/lang/es.lang.php +++ b/modules/counter/lang/es.lang.php @@ -1,25 +1,25 @@ -counter = "Contador"; - $lang->cmd_select_date = 'Selecciona la fecha'; - $lang->cmd_select_counter_type = array( - 'hour' => 'por hora', - 'day' => 'por día', - 'month' => 'por mes', - 'year' => 'por año', - ); - - $lang->total_counter = 'Estado actual Total'; - $lang->selected_day_counter = 'Estado actual del día seleccionado'; - - $lang->unique_visitor = 'visitante'; - $lang->pageview = 'Ver página'; - - $lang->today = 'today'; - $lang->yesterday = 'yesterday'; -?> +counter = "Contador"; + $lang->cmd_select_date = 'Selecciona la fecha'; + $lang->cmd_select_counter_type = array( + 'hour' => 'por hora', + 'day' => 'por día', + 'month' => 'por mes', + 'year' => 'por año', + ); + + $lang->total_counter = 'Estado actual Total'; + $lang->selected_day_counter = 'Estado actual del día seleccionado'; + + $lang->unique_visitor = 'visitante'; + $lang->pageview = 'Ver página'; + + $lang->today = 'today'; + $lang->yesterday = 'yesterday'; +?> diff --git a/modules/counter/lang/fr.lang.php b/modules/counter/lang/fr.lang.php index 5aad22fa2..a823bba59 100644 --- a/modules/counter/lang/fr.lang.php +++ b/modules/counter/lang/fr.lang.php @@ -1,25 +1,25 @@ - - * @brief Paquet du langage en français pour le module de Comppteur - **/ - - $lang->counter = "Coumpteur"; - $lang->cmd_select_date = 'Choisir un Jour'; - $lang->cmd_select_counter_type = array( - 'hour' => 'Par Heure', - 'day' => 'Par Jour', - 'month' => 'Par Mois', - 'year' => 'Par Année', - ); - - $lang->total_counter = 'Statut Total'; - $lang->selected_day_counter = 'Statut Journal'; - - $lang->unique_visitor = 'Visiteurs'; - $lang->pageview = 'Vues'; - - $lang->today = 'today'; - $lang->yesterday = 'yesterday'; -?> + + * @brief Paquet du langage en français pour le module de Comppteur + **/ + + $lang->counter = "Coumpteur"; + $lang->cmd_select_date = 'Choisir un Jour'; + $lang->cmd_select_counter_type = array( + 'hour' => 'Par Heure', + 'day' => 'Par Jour', + 'month' => 'Par Mois', + 'year' => 'Par Année', + ); + + $lang->total_counter = 'Statut Total'; + $lang->selected_day_counter = 'Statut Journal'; + + $lang->unique_visitor = 'Visiteurs'; + $lang->pageview = 'Vues'; + + $lang->today = 'today'; + $lang->yesterday = 'yesterday'; +?> diff --git a/modules/counter/lang/jp.lang.php b/modules/counter/lang/jp.lang.php index e0e4807b7..feb899ea7 100644 --- a/modules/counter/lang/jp.lang.php +++ b/modules/counter/lang/jp.lang.php @@ -1,25 +1,25 @@ -counter = 'カウンター'; - $lang->cmd_select_date = '日付選択'; - $lang->cmd_select_counter_type = array( - 'hour' => '時間帯別', - 'day' => '日別', - 'month' => '月別', - 'year' => '年度別', - ); - - $lang->total_counter = 'トータル'; - $lang->selected_day_counter = '選択日の情報'; - - $lang->unique_visitor = '訪問者'; - $lang->pageview = 'ページビュー'; - - $lang->today = '今日'; - $lang->yesterday = '昨日'; -?> +counter = 'カウンター'; + $lang->cmd_select_date = '日付選択'; + $lang->cmd_select_counter_type = array( + 'hour' => '時間帯別', + 'day' => '日別', + 'month' => '月別', + 'year' => '年度別', + ); + + $lang->total_counter = 'トータル'; + $lang->selected_day_counter = '選択日の情報'; + + $lang->unique_visitor = '訪問者'; + $lang->pageview = 'ページビュー'; + + $lang->today = '今日'; + $lang->yesterday = '昨日'; +?> diff --git a/modules/counter/lang/ko.lang.php b/modules/counter/lang/ko.lang.php index b8dca9adb..521900a6d 100644 --- a/modules/counter/lang/ko.lang.php +++ b/modules/counter/lang/ko.lang.php @@ -1,25 +1,25 @@ -counter = '접속 통계'; - $lang->cmd_select_date = '날짜 선택'; - $lang->cmd_select_counter_type = array( - 'hour' => '시간대별', - 'day' => '일별', - 'month' => '월별', - 'year' => '연도별', - ); - - $lang->total_counter = '전체현황'; - $lang->selected_day_counter = '선택일 현황'; - - $lang->unique_visitor = '방문자'; - $lang->pageview = '페이지뷰'; - - $lang->today = '오늘'; - $lang->yesterday = '어제'; -?> +counter = '접속 통계'; + $lang->cmd_select_date = '날짜 선택'; + $lang->cmd_select_counter_type = array( + 'hour' => '시간대별', + 'day' => '일별', + 'month' => '월별', + 'year' => '연도별', + ); + + $lang->total_counter = '전체현황'; + $lang->selected_day_counter = '선택일 현황'; + + $lang->unique_visitor = '방문자'; + $lang->pageview = '페이지뷰'; + + $lang->today = '오늘'; + $lang->yesterday = '어제'; +?> diff --git a/modules/counter/lang/ru.lang.php b/modules/counter/lang/ru.lang.php index 4bec4020b..107662ef3 100644 --- a/modules/counter/lang/ru.lang.php +++ b/modules/counter/lang/ru.lang.php @@ -1,25 +1,25 @@ -counter = "Счетчик посетителей"; - $lang->cmd_select_date = 'Выберите дату'; - $lang->cmd_select_counter_type = array( - 'hour' => 'По часам', - 'day' => 'По дням', - 'month' => 'По месяцам', - 'year' => 'По годам', - ); - - $lang->total_counter = 'Общее состояние'; - $lang->selected_day_counter = 'Состояние на выбранный день'; - - $lang->unique_visitor = 'Посетителей'; - $lang->pageview = 'Просмотров страниц'; - - $lang->today = 'Сегодня'; - $lang->yesterday = 'Вчера'; -?> +counter = "Счетчик посетителей"; + $lang->cmd_select_date = 'Выберите дату'; + $lang->cmd_select_counter_type = array( + 'hour' => 'По часам', + 'day' => 'По дням', + 'month' => 'По месяцам', + 'year' => 'По годам', + ); + + $lang->total_counter = 'Общее состояние'; + $lang->selected_day_counter = 'Состояние на выбранный день'; + + $lang->unique_visitor = 'Посетителей'; + $lang->pageview = 'Просмотров страниц'; + + $lang->today = 'Сегодня'; + $lang->yesterday = 'Вчера'; +?> diff --git a/modules/counter/lang/tr.lang.php b/modules/counter/lang/tr.lang.php index 69aa1c8aa..c22243171 100644 --- a/modules/counter/lang/tr.lang.php +++ b/modules/counter/lang/tr.lang.php @@ -1,25 +1,25 @@ -counter = "Sayaç"; - $lang->cmd_select_date = 'Tarih Seç'; - $lang->cmd_select_counter_type = array( - 'hour' => 'Saate Göre', - 'day' => 'Güne Göre', - 'month' => 'Aya Göre', - 'year' => 'Yıla Göre', - ); - - $lang->total_counter = 'Genel Durum'; - $lang->selected_day_counter = 'Seçilen Günün Durumu'; - - $lang->unique_visitor = 'Ziyaretçiler'; - $lang->pageview = 'Sayfa Gösterimi'; - - $lang->today = 'bugün'; - $lang->yesterday = 'dün'; -?> +counter = "Sayaç"; + $lang->cmd_select_date = 'Tarih Seç'; + $lang->cmd_select_counter_type = array( + 'hour' => 'Saate Göre', + 'day' => 'Güne Göre', + 'month' => 'Aya Göre', + 'year' => 'Yıla Göre', + ); + + $lang->total_counter = 'Genel Durum'; + $lang->selected_day_counter = 'Seçilen Günün Durumu'; + + $lang->unique_visitor = 'Ziyaretçiler'; + $lang->pageview = 'Sayfa Gösterimi'; + + $lang->today = 'bugün'; + $lang->yesterday = 'dün'; +?> diff --git a/modules/counter/lang/vi.lang.php b/modules/counter/lang/vi.lang.php index aa74830fa..56f52ba7d 100644 --- a/modules/counter/lang/vi.lang.php +++ b/modules/counter/lang/vi.lang.php @@ -1,27 +1,27 @@ -counter = "Lượt truy cập"; - $lang->cmd_select_date = 'Chọn ngày'; - $lang->cmd_select_counter_type = array( - 'hour' => 'Theo giờ', - 'day' => 'Theo ngày', - 'month' => 'Theo tháng', - 'year' => 'Theo năm', - ); - - $lang->total_counter = 'Tổng số lượt truy cập'; - $lang->selected_day_counter = 'Số truy cập trong ngày'; - - $lang->unique_visitor = 'Số lượt xem'; - $lang->pageview = 'Số trang'; - - $lang->today = 'Hôm nay'; - $lang->yesterday = 'Hôm qua'; -?> +counter = "Lượt truy cập"; + $lang->cmd_select_date = 'Chọn ngày'; + $lang->cmd_select_counter_type = array( + 'hour' => 'Theo giờ', + 'day' => 'Theo ngày', + 'month' => 'Theo tháng', + 'year' => 'Theo năm', + ); + + $lang->total_counter = 'Tổng số lượt truy cập'; + $lang->selected_day_counter = 'Số truy cập trong ngày'; + + $lang->unique_visitor = 'Số lượt xem'; + $lang->pageview = 'Số trang'; + + $lang->today = 'Hôm nay'; + $lang->yesterday = 'Hôm qua'; +?> diff --git a/modules/counter/lang/zh-CN.lang.php b/modules/counter/lang/zh-CN.lang.php index 79459993e..948db9047 100644 --- a/modules/counter/lang/zh-CN.lang.php +++ b/modules/counter/lang/zh-CN.lang.php @@ -1,25 +1,25 @@ -counter = "访问统计"; - $lang->cmd_select_date = '选择日期'; - $lang->cmd_select_counter_type = array( - 'hour' => '按时', - 'day' => '按天', - 'month' => '按月', - 'year' => '按年', - ); - - $lang->total_counter = '总揽'; - $lang->selected_day_counter = '指定日概况'; - - $lang->unique_visitor = '访问者'; - $lang->pageview = '页面浏览'; - - $lang->today = '今日'; - $lang->yesterday = '昨日'; -?> +counter = "访问统计"; + $lang->cmd_select_date = '选择日期'; + $lang->cmd_select_counter_type = array( + 'hour' => '按时', + 'day' => '按天', + 'month' => '按月', + 'year' => '按年', + ); + + $lang->total_counter = '总揽'; + $lang->selected_day_counter = '指定日概况'; + + $lang->unique_visitor = '访问者'; + $lang->pageview = '页面浏览'; + + $lang->today = '今日'; + $lang->yesterday = '昨日'; +?> diff --git a/modules/counter/lang/zh-TW.lang.php b/modules/counter/lang/zh-TW.lang.php index 7b516a7a3..1eee95142 100644 --- a/modules/counter/lang/zh-TW.lang.php +++ b/modules/counter/lang/zh-TW.lang.php @@ -1,25 +1,25 @@ -counter = "訪問統計"; - $lang->cmd_select_date = '選擇日期'; - $lang->cmd_select_counter_type = array( - 'hour' => '按時', - 'day' => '按天', - 'month' => '按月', - 'year' => '按年', - ); - - $lang->total_counter = '總共'; - $lang->selected_day_counter = '指定日概況'; - - $lang->unique_visitor = '訪問者'; - $lang->pageview = '頁面瀏覽'; - - $lang->today = '今天'; - $lang->yesterday = '昨天'; -?> +counter = "訪問統計"; + $lang->cmd_select_date = '選擇日期'; + $lang->cmd_select_counter_type = array( + 'hour' => '按時', + 'day' => '按天', + 'month' => '按月', + 'year' => '按年', + ); + + $lang->total_counter = '總共'; + $lang->selected_day_counter = '指定日概況'; + + $lang->unique_visitor = '訪問者'; + $lang->pageview = '頁面瀏覽'; + + $lang->today = '今天'; + $lang->yesterday = '昨天'; +?> diff --git a/modules/document/conf/info.xml b/modules/document/conf/info.xml index 904703404..051dd99a8 100644 --- a/modules/document/conf/info.xml +++ b/modules/document/conf/info.xml @@ -1,36 +1,36 @@ - - - 문서 - Document - Bài viết - Documento - 主题管理 - ドキュメント - Документы - 主題 - Belge - 게시판, 블로그등의 모듈에서 사용되는 문서를 관리하는 모듈입니다. - Module for managing documents used in board, blog, etc. - Module quản lý bài viết trên Board, Sổ lưu niệm và những mục khác. - Módulo para manejar los documentos en blog y en los tableros. - 管理版面,博客等处主题的模块。 - 掲示板、ブログなどのモジュールで使用されるドキュメント(書き込み)を管理します。 - Модуль для управления документами в форуме, блоге и прочее. - 管理討論板,部落格等主題的模組。 - Panoda, blogda, vb., kullanılan belgeleri yönetmek için olan modüldür. - 0.1 - 2007-02-28 - content - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 문서 + Document + Bài viết + Documento + 主题管理 + ドキュメント + Документы + 主題 + Belge + 게시판, 블로그등의 모듈에서 사용되는 문서를 관리하는 모듈입니다. + Module for managing documents used in board, blog, etc. + Module quản lý bài viết trên Board, Sổ lưu niệm và những mục khác. + Módulo para manejar los documentos en blog y en los tableros. + 管理版面,博客等处主题的模块。 + 掲示板、ブログなどのモジュールで使用されるドキュメント(書き込み)を管理します。 + Модуль для управления документами в форуме, блоге и прочее. + 管理討論板,部落格等主題的模組。 + Panoda, blogda, vb., kullanılan belgeleri yönetmek için olan modüldür. + 0.1 + 2007-02-28 + content + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/document/document.admin.model.php b/modules/document/document.admin.model.php index 9a86e5799..98d2ddfc1 100644 --- a/modules/document/document.admin.model.php +++ b/modules/document/document.admin.model.php @@ -1,87 +1,87 @@ -sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order'; - if (!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc'; - - // module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌 - if ($obj->mid) { - $oModuleModel = &getModel('module'); - $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); - unset($obj->mid); - } - - // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 - if (is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - - // 변수 체크 - $args->sort_index = $obj->sort_index; - $args->order_type = $obj->order_type; - $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; - $args->member_srl = $obj->member_srl; - - // query_id 지정 - $query_id = 'document.getTrashList'; - - // query 실행 - $output = executeQueryArray($query_id, $args); - - // 결과가 없거나 오류 발생시 그냥 return - if (!$output->toBool() || !count($output->data)) return $output; - - $idx = 0; - $data = $output->data; - unset($output->data); - - $keys = array_keys($data); - $virtual_number = $keys[0]; - - foreach($data as $key => $attribute) { - $oDocument = null; - $oDocument = new documentItem(); - $oDocument->setAttribute($attribute, false); - if ($is_admin) $oDocument->setGrant(); - - $output->data[$virtual_number] = $oDocument; - $virtual_number--; - } - - return $output; - } - - /** - * @brief trash_srl값을 가지는 휴지통 문서를 가져옴 - **/ - function getDocumentTrash($trash_srl) { - $args->trash_srl = $trash_srl; - $output = executeQuery('document.getTrash', $args); - - $node = $output->data; - if (!$node) return; - - return $node; - } - - } -?> +sort_index, array('list_order','delete_date','title'))) $obj->sort_index = 'list_order'; + if (!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc'; + + // module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌 + if ($obj->mid) { + $oModuleModel = &getModel('module'); + $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); + unset($obj->mid); + } + + // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 + if (is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + + // 변수 체크 + $args->sort_index = $obj->sort_index; + $args->order_type = $obj->order_type; + $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; + $args->member_srl = $obj->member_srl; + + // query_id 지정 + $query_id = 'document.getTrashList'; + + // query 실행 + $output = executeQueryArray($query_id, $args); + + // 결과가 없거나 오류 발생시 그냥 return + if (!$output->toBool() || !count($output->data)) return $output; + + $idx = 0; + $data = $output->data; + unset($output->data); + + $keys = array_keys($data); + $virtual_number = $keys[0]; + + foreach($data as $key => $attribute) { + $oDocument = null; + $oDocument = new documentItem(); + $oDocument->setAttribute($attribute, false); + if ($is_admin) $oDocument->setGrant(); + + $output->data[$virtual_number] = $oDocument; + $virtual_number--; + } + + return $output; + } + + /** + * @brief trash_srl값을 가지는 휴지통 문서를 가져옴 + **/ + function getDocumentTrash($trash_srl) { + $args->trash_srl = $trash_srl; + $output = executeQuery('document.getTrash', $args); + + $node = $output->data; + if (!$node) return; + + return $node; + } + + } +?> diff --git a/modules/document/document.admin.view.php b/modules/document/document.admin.view.php index 7852f4951..8448c406f 100644 --- a/modules/document/document.admin.view.php +++ b/modules/document/document.admin.view.php @@ -1,159 +1,159 @@ -page = Context::get('page'); ///< 페이지 - $args->list_count = 30; ///< 한페이지에 보여줄 글 수 - $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 - - $args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...) - $args->search_keyword = Context::get('search_keyword'); ///< 검색어 - - $args->sort_index = 'list_order'; ///< 소팅 값 - - $args->module_srl = Context::get('module_srl'); - - // 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다) - $oDocumentModel = &getModel('document'); - $output = $oDocumentModel->getDocumentList($args); - - // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('document_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - // 템플릿에서 사용할 검색옵션 세팅 - $count_search_option = count($this->search_option); - for($i=0;$i<$count_search_option;$i++) { - $search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]); - } - Context::set('search_option', $search_option); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('document_list'); - } - - /** - * @brief 문서 모듈 설정 - **/ - function dispDocumentAdminConfig() { - $oDocumentModel = &getModel('document'); - $config = $oDocumentModel->getDocumentConfig(); - Context::set('config',$config); - - // 템플릿 파일 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('document_config'); - } - - /** - * @brief 관리자 페이지의 신고 목록 보기 - **/ - function dispDocumentAdminDeclared() { - // 목록을 구하기 위한 옵션 - $args->page = Context::get('page'); ///< 페이지 - $args->list_count = 30; ///< 한페이지에 보여줄 글 수 - $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 - - $args->sort_index = 'document_declared.declared_count'; ///< 소팅 값 - $args->order_type = 'desc'; ///< 소팅 정렬 값 - - // 목록을 구함 - $declared_output = executeQuery('document.getDeclaredList', $args); - - if($declared_output->data && count($declared_output->data)) { - $document_list = array(); - - $oDocumentModel = &getModel('document'); - foreach($declared_output->data as $key => $document) { - $document_list[$key] = new documentItem(); - $document_list[$key]->setAttribute($document); - } - $declared_output->data = $document_list; - } - - // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 - Context::set('total_count', $declared_output->total_count); - Context::set('total_page', $declared_output->total_page); - Context::set('page', $declared_output->page); - Context::set('document_list', $declared_output->data); - Context::set('page_navigation', $declared_output->page_navigation); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('declared_list'); - } - - function dispDocumentAdminAlias() { - $args->document_srl = Context::get('document_srl'); - if(!$args->document_srl) return $this->dispDocumentAdminList(); - - $oModel = &getModel('document'); - $oDocument = $oModel->getDocument($args->document_srl); - if(!$oDocument->isExists()) return $this->dispDocumentAdminList(); - Context::set('oDocument', $oDocument); - - $output = executeQueryArray('document.getAliases', $args); - if(!$output->data) - { - $aliases = array(); - } - else - { - $aliases = $output->data; - } - - - Context::set('aliases', $aliases); - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('document_alias'); - } - - function dispDocumentAdminTrashList() { - // 목록을 구하기 위한 옵션 - $args->page = Context::get('page'); ///< 페이지 - $args->list_count = 30; ///< 한페이지에 보여줄 글 수 - $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 - - $args->sort_index = 'list_order'; ///< 소팅 값 - $args->order_type = 'desc'; ///< 소팅 정렬 값 - - $args->module_srl = Context::get('module_srl'); - - // 목록을 구함 - $oDocumentAdminModel = &getAdminModel('document'); - $output = $oDocumentAdminModel->getDocumentTrashList($args); - - // 템플릿에 쓰기 위해서 document_admin_model::getDocumentTrashList() 의 return object에 있는 값들을 세팅 - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('document_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('document_trash_list'); - } - } -?> +page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->search_target = Context::get('search_target'); ///< 검색 대상 (title, contents...) + $args->search_keyword = Context::get('search_keyword'); ///< 검색어 + + $args->sort_index = 'list_order'; ///< 소팅 값 + + $args->module_srl = Context::get('module_srl'); + + // 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다) + $oDocumentModel = &getModel('document'); + $output = $oDocumentModel->getDocumentList($args); + + // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('document_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + // 템플릿에서 사용할 검색옵션 세팅 + $count_search_option = count($this->search_option); + for($i=0;$i<$count_search_option;$i++) { + $search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]); + } + Context::set('search_option', $search_option); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('document_list'); + } + + /** + * @brief 문서 모듈 설정 + **/ + function dispDocumentAdminConfig() { + $oDocumentModel = &getModel('document'); + $config = $oDocumentModel->getDocumentConfig(); + Context::set('config',$config); + + // 템플릿 파일 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('document_config'); + } + + /** + * @brief 관리자 페이지의 신고 목록 보기 + **/ + function dispDocumentAdminDeclared() { + // 목록을 구하기 위한 옵션 + $args->page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'document_declared.declared_count'; ///< 소팅 값 + $args->order_type = 'desc'; ///< 소팅 정렬 값 + + // 목록을 구함 + $declared_output = executeQuery('document.getDeclaredList', $args); + + if($declared_output->data && count($declared_output->data)) { + $document_list = array(); + + $oDocumentModel = &getModel('document'); + foreach($declared_output->data as $key => $document) { + $document_list[$key] = new documentItem(); + $document_list[$key]->setAttribute($document); + } + $declared_output->data = $document_list; + } + + // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $declared_output->total_count); + Context::set('total_page', $declared_output->total_page); + Context::set('page', $declared_output->page); + Context::set('document_list', $declared_output->data); + Context::set('page_navigation', $declared_output->page_navigation); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('declared_list'); + } + + function dispDocumentAdminAlias() { + $args->document_srl = Context::get('document_srl'); + if(!$args->document_srl) return $this->dispDocumentAdminList(); + + $oModel = &getModel('document'); + $oDocument = $oModel->getDocument($args->document_srl); + if(!$oDocument->isExists()) return $this->dispDocumentAdminList(); + Context::set('oDocument', $oDocument); + + $output = executeQueryArray('document.getAliases', $args); + if(!$output->data) + { + $aliases = array(); + } + else + { + $aliases = $output->data; + } + + + Context::set('aliases', $aliases); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('document_alias'); + } + + function dispDocumentAdminTrashList() { + // 목록을 구하기 위한 옵션 + $args->page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'list_order'; ///< 소팅 값 + $args->order_type = 'desc'; ///< 소팅 정렬 값 + + $args->module_srl = Context::get('module_srl'); + + // 목록을 구함 + $oDocumentAdminModel = &getAdminModel('document'); + $output = $oDocumentAdminModel->getDocumentTrashList($args); + + // 템플릿에 쓰기 위해서 document_admin_model::getDocumentTrashList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('document_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('document_trash_list'); + } + } +?> diff --git a/modules/document/document.class.php b/modules/document/document.class.php index c3797d5ad..b51d0ed12 100644 --- a/modules/document/document.class.php +++ b/modules/document/document.class.php @@ -1,262 +1,262 @@ -addIndex("documents","idx_module_list_order", array("module_srl","list_order")); - $oDB->addIndex("documents","idx_module_update_order", array("module_srl","update_order")); - $oDB->addIndex("documents","idx_module_readed_count", array("module_srl","readed_count")); - $oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count")); - $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice")); - $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl")); - $oDB->addIndex("documents","idx_module_blamed_count", array("module_srl","blamed_count")); - $oDB->addIndex("document_aliases", "idx_module_title", array("module_srl","alias_title"), true); - $oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl","document_srl","var_idx","lang_code"), true); - - // 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가 - $oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'); - - // 2009. 01. 29 Added a trigger for additional setup - $oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oDB = &DB::getInstance(); - $oModuleModel = &getModel('module'); - - /** - * 2007. 7. 25 : 알림 필드(notify_message) 추가 - **/ - if(!$oDB->isColumnExists("documents","notify_message")) return true; - - /** - * 2007. 8. 23 : document테이블에 결합 인덱스 적용 - **/ - if(!$oDB->isIndexExists("documents","idx_module_list_order")) return true; - if(!$oDB->isIndexExists("documents","idx_module_update_order")) return true; - if(!$oDB->isIndexExists("documents","idx_module_readed_count")) return true; - if(!$oDB->isIndexExists("documents","idx_module_voted_count")) return true; - - // 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가 - if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) return true; - - // 2007. 10. 25 문서 분류에 parent_srl, expand를 추가 - if(!$oDB->isColumnExists("document_categories","parent_srl")) return true; - if(!$oDB->isColumnExists("document_categories","expand")) return true; - if(!$oDB->isColumnExists("document_categories","group_srls")) return true; - - // 2007. 11. 20 게시글에 module_srl + is_notice 복합인덱스 만들기 - if(!$oDB->isIndexExists("documents","idx_module_notice")) return true; - - // 2008. 02. 18 게시글에 module_srl + document_srl 복합인덱스 만들기 (manian님 확인) - if(!$oDB->isIndexExists("documents","idx_module_document_srl")) return true; - - /** - * 2007. 12. 03 : 확장변수(extra_vars) 컬럼이 없을 경우 추가 - **/ - if(!$oDB->isColumnExists("documents","extra_vars")) return true; - - // 2008. 04. 23 blamed count 컬럼 추가 - if(!$oDB->isColumnExists("documents", "blamed_count")) return true; - if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) return true; - if(!$oDB->isColumnExists("document_voted_log", "point")) return true; - - // 2008-12-15 문서 분류에 color를 추가 - if(!$oDB->isColumnExists("document_categories", "color")) return true; - - /** - * 2009. 01. 29 : 확장변수 값 테이블에 lang_code가 없을 경우 추가 - **/ - if(!$oDB->isColumnExists("document_extra_vars","lang_code")) return true; - - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true; - - // 2009. 03. 09 documents에 lang_code 컬럼 추가 - if(!$oDB->isColumnExists("documents","lang_code")) return true; - - // 2009. 03. 11 확장변수 값 테이블의 인덱스 점검 - if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true; - - /** - * 2009. 03. 19 : 확장변수 값 테이블에 eid가 없을 경우 추가 - **/ - if(!$oDB->isColumnExists("document_extra_keys","eid")) return true; - if(!$oDB->isColumnExists("document_extra_vars","eid")) return true; - - // 2011. 03. 30 Cubrid index 추가 요청 - if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB = &DB::getInstance(); - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - /** - * 2007. 7. 25 : 알림 필드(notify_message) 추가 - **/ - if(!$oDB->isColumnExists("documents","notify_message")) { - $oDB->addColumn('documents',"notify_message","char",1); - } - - /** - * 2007. 8. 23 : document테이블에 결합 인덱스 적용 - **/ - if(!$oDB->isIndexExists("documents","idx_module_list_order")) { - $oDB->addIndex("documents","idx_module_list_order", array("module_srl","list_order")); - } - - if(!$oDB->isIndexExists("documents","idx_module_update_order")) { - $oDB->addIndex("documents","idx_module_update_order", array("module_srl","update_order")); - } - - if(!$oDB->isIndexExists("documents","idx_module_readed_count")) { - $oDB->addIndex("documents","idx_module_readed_count", array("module_srl","readed_count")); - } - - if(!$oDB->isIndexExists("documents","idx_module_voted_count")) { - $oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count")); - } - - // 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가 - if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) - $oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'); - - // 2007. 10. 25 문서 분류에 parent_srl, expand를 추가 - if(!$oDB->isColumnExists("document_categories","parent_srl")) $oDB->addColumn('document_categories',"parent_srl","number",12,0); - if(!$oDB->isColumnExists("document_categories","expand")) $oDB->addColumn('document_categories',"expand","char",1,"N"); - if(!$oDB->isColumnExists("document_categories","group_srls")) $oDB->addColumn('document_categories',"group_srls","text"); - - // 2007. 11. 20 게시글에 module_srl + is_notice 복합인덱스 만들기 - if(!$oDB->isIndexExists("documents","idx_module_notice")) $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice")); - - /** - * 2007. 12. 03 : 확장변수(extra_vars) 컬럼이 없을 경우 추가 - **/ - if(!$oDB->isColumnExists("documents","extra_vars")) $oDB->addColumn('documents','extra_vars','text'); - - /** - * 2008. 02. 18 게시글에 module_srl + document_srl 복합인덱스 만들기 (manian님 확인) - **/ - if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl")); - - // 2008. 04. 23 blamed count 컬럼 추가 - if(!$oDB->isColumnExists("documents", "blamed_count")) { - $oDB->addColumn('documents', 'blamed_count', 'number', 11, 0, true); - $oDB->addIndex('documents', 'idx_blamed_count', array('blamed_count')); - } - - if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) { - $oDB->addIndex('documents', 'idx_module_blamed_count', array('module_srl', 'blamed_count')); - } - - if(!$oDB->isColumnExists("document_voted_log", "point")) - $oDB->addColumn('document_voted_log', 'point', 'number', 11, 0, true); - - - if(!$oDB->isColumnExists("document_categories","color")) $oDB->addColumn('document_categories',"color","char",7); - - /** - * 2009. 01. 29 : 확장변수 값 테이블에 lang_code가 없을 경우 추가 - **/ - if(!$oDB->isColumnExists("document_extra_vars","lang_code")) $oDB->addColumn('document_extra_vars',"lang_code","varchar",10); - - // 2009. 01. 29 Added a trigger for additional setup - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) - $oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'); - - // 2009. 03. 09 documents에 lang_code 컬럼 추가 - if(!$oDB->isColumnExists("documents","lang_code")) { - $db_info = Context::getDBInfo(); - $oDB->addColumn('documents',"lang_code","varchar",10, $db_info->lang_code); - $obj->lang_code = $db_info->lang_type; - executeQuery('document.updateDocumentsLangCode', $obj); - } - - // 2009. 03. 11 확장변수 값 테이블의 인덱스 점검 - if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) { - $oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl","document_srl","var_idx","lang_code"), true); - } - - if($oDB->isIndexExists("document_extra_vars", "unique_module_vars")) { - $oDB->dropIndex("document_extra_vars", "unique_module_vars", true); - } - - /** - * 2009. 03. 19 : 확장변수 값 테이블에 eid 없을 경우 추가 - * 2009. 04. 12 : eid를 등록할 때 다른 필드 값이 변경되는 문제 수정 #17922959 - **/ - if(!$oDB->isColumnExists("document_extra_keys","eid")) { - $oDB->addColumn("document_extra_keys","eid","varchar",40); - - $output = executeQuery('document.getGroupsExtraKeys', $obj); - if($output->toBool() && $output->data && count($output->data)) { - foreach($output->data as $extra_keys) { - $args->module_srl = $extra_keys->module_srl; - $args->var_idx = $extra_keys->idx; - $args->new_eid = "extra_vars".$extra_keys->idx; - $output = executeQuery('document.updateDocumentExtraKeyEid', $args); - } - } - } - - if(!$oDB->isColumnExists("document_extra_vars","eid")) { - $oDB->addColumn("document_extra_vars","eid","varchar",40); - $obj->var_idx = '-1,-2'; - $output = executeQuery('document.getGroupsExtraVars', $obj); - if($output->toBool() && $output->data && count($output->data)) { - foreach($output->data as $extra_vars) { - $args->module_srl = $extra_vars->module_srl; - $args->var_idx = $extra_vars->idx; - $args->new_eid = "extra_vars".$extra_vars->idx; - $output = executeQuery('document.updateDocumentExtraVarEid', $args); - } - } - } - - // 2011. 03. 30 Cubrid index 추가 요청 - if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) { - $oDB->addIndex("document_extra_vars", "idx_document_list_order", array("document_srl","module_srl","var_idx"), false); - } - - return new Object(0,'success_updated'); - - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - // 게시글 분류 캐시 파일 삭제 - FileHandler::removeFilesInDir(_XE_PATH_."files/cache/document_category"); - } - - } -?> +addIndex("documents","idx_module_list_order", array("module_srl","list_order")); + $oDB->addIndex("documents","idx_module_update_order", array("module_srl","update_order")); + $oDB->addIndex("documents","idx_module_readed_count", array("module_srl","readed_count")); + $oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count")); + $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice")); + $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl")); + $oDB->addIndex("documents","idx_module_blamed_count", array("module_srl","blamed_count")); + $oDB->addIndex("document_aliases", "idx_module_title", array("module_srl","alias_title"), true); + $oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl","document_srl","var_idx","lang_code"), true); + + // 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가 + $oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'); + + // 2009. 01. 29 Added a trigger for additional setup + $oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oDB = &DB::getInstance(); + $oModuleModel = &getModel('module'); + + /** + * 2007. 7. 25 : 알림 필드(notify_message) 추가 + **/ + if(!$oDB->isColumnExists("documents","notify_message")) return true; + + /** + * 2007. 8. 23 : document테이블에 결합 인덱스 적용 + **/ + if(!$oDB->isIndexExists("documents","idx_module_list_order")) return true; + if(!$oDB->isIndexExists("documents","idx_module_update_order")) return true; + if(!$oDB->isIndexExists("documents","idx_module_readed_count")) return true; + if(!$oDB->isIndexExists("documents","idx_module_voted_count")) return true; + + // 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가 + if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) return true; + + // 2007. 10. 25 문서 분류에 parent_srl, expand를 추가 + if(!$oDB->isColumnExists("document_categories","parent_srl")) return true; + if(!$oDB->isColumnExists("document_categories","expand")) return true; + if(!$oDB->isColumnExists("document_categories","group_srls")) return true; + + // 2007. 11. 20 게시글에 module_srl + is_notice 복합인덱스 만들기 + if(!$oDB->isIndexExists("documents","idx_module_notice")) return true; + + // 2008. 02. 18 게시글에 module_srl + document_srl 복합인덱스 만들기 (manian님 확인) + if(!$oDB->isIndexExists("documents","idx_module_document_srl")) return true; + + /** + * 2007. 12. 03 : 확장변수(extra_vars) 컬럼이 없을 경우 추가 + **/ + if(!$oDB->isColumnExists("documents","extra_vars")) return true; + + // 2008. 04. 23 blamed count 컬럼 추가 + if(!$oDB->isColumnExists("documents", "blamed_count")) return true; + if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) return true; + if(!$oDB->isColumnExists("document_voted_log", "point")) return true; + + // 2008-12-15 문서 분류에 color를 추가 + if(!$oDB->isColumnExists("document_categories", "color")) return true; + + /** + * 2009. 01. 29 : 확장변수 값 테이블에 lang_code가 없을 경우 추가 + **/ + if(!$oDB->isColumnExists("document_extra_vars","lang_code")) return true; + + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) return true; + + // 2009. 03. 09 documents에 lang_code 컬럼 추가 + if(!$oDB->isColumnExists("documents","lang_code")) return true; + + // 2009. 03. 11 확장변수 값 테이블의 인덱스 점검 + if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) return true; + + /** + * 2009. 03. 19 : 확장변수 값 테이블에 eid가 없을 경우 추가 + **/ + if(!$oDB->isColumnExists("document_extra_keys","eid")) return true; + if(!$oDB->isColumnExists("document_extra_vars","eid")) return true; + + // 2011. 03. 30 Cubrid index 추가 요청 + if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB = &DB::getInstance(); + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + /** + * 2007. 7. 25 : 알림 필드(notify_message) 추가 + **/ + if(!$oDB->isColumnExists("documents","notify_message")) { + $oDB->addColumn('documents',"notify_message","char",1); + } + + /** + * 2007. 8. 23 : document테이블에 결합 인덱스 적용 + **/ + if(!$oDB->isIndexExists("documents","idx_module_list_order")) { + $oDB->addIndex("documents","idx_module_list_order", array("module_srl","list_order")); + } + + if(!$oDB->isIndexExists("documents","idx_module_update_order")) { + $oDB->addIndex("documents","idx_module_update_order", array("module_srl","update_order")); + } + + if(!$oDB->isIndexExists("documents","idx_module_readed_count")) { + $oDB->addIndex("documents","idx_module_readed_count", array("module_srl","readed_count")); + } + + if(!$oDB->isIndexExists("documents","idx_module_voted_count")) { + $oDB->addIndex("documents","idx_module_voted_count", array("module_srl","voted_count")); + } + + // 2007. 10. 17 모듈이 삭제될때 등록된 글도 모두 삭제하는 트리거 추가 + if(!$oModuleModel->getTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after')) + $oModuleController->insertTrigger('module.deleteModule', 'document', 'controller', 'triggerDeleteModuleDocuments', 'after'); + + // 2007. 10. 25 문서 분류에 parent_srl, expand를 추가 + if(!$oDB->isColumnExists("document_categories","parent_srl")) $oDB->addColumn('document_categories',"parent_srl","number",12,0); + if(!$oDB->isColumnExists("document_categories","expand")) $oDB->addColumn('document_categories',"expand","char",1,"N"); + if(!$oDB->isColumnExists("document_categories","group_srls")) $oDB->addColumn('document_categories',"group_srls","text"); + + // 2007. 11. 20 게시글에 module_srl + is_notice 복합인덱스 만들기 + if(!$oDB->isIndexExists("documents","idx_module_notice")) $oDB->addIndex("documents","idx_module_notice", array("module_srl","is_notice")); + + /** + * 2007. 12. 03 : 확장변수(extra_vars) 컬럼이 없을 경우 추가 + **/ + if(!$oDB->isColumnExists("documents","extra_vars")) $oDB->addColumn('documents','extra_vars','text'); + + /** + * 2008. 02. 18 게시글에 module_srl + document_srl 복합인덱스 만들기 (manian님 확인) + **/ + if(!$oDB->isIndexExists("documents","idx_module_document_srl")) $oDB->addIndex("documents","idx_module_document_srl", array("module_srl","document_srl")); + + // 2008. 04. 23 blamed count 컬럼 추가 + if(!$oDB->isColumnExists("documents", "blamed_count")) { + $oDB->addColumn('documents', 'blamed_count', 'number', 11, 0, true); + $oDB->addIndex('documents', 'idx_blamed_count', array('blamed_count')); + } + + if(!$oDB->isIndexExists("documents","idx_module_blamed_count")) { + $oDB->addIndex('documents', 'idx_module_blamed_count', array('module_srl', 'blamed_count')); + } + + if(!$oDB->isColumnExists("document_voted_log", "point")) + $oDB->addColumn('document_voted_log', 'point', 'number', 11, 0, true); + + + if(!$oDB->isColumnExists("document_categories","color")) $oDB->addColumn('document_categories',"color","char",7); + + /** + * 2009. 01. 29 : 확장변수 값 테이블에 lang_code가 없을 경우 추가 + **/ + if(!$oDB->isColumnExists("document_extra_vars","lang_code")) $oDB->addColumn('document_extra_vars',"lang_code","varchar",10); + + // 2009. 01. 29 Added a trigger for additional setup + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before')) + $oModuleController->insertTrigger('module.dispAdditionSetup', 'document', 'view', 'triggerDispDocumentAdditionSetup', 'before'); + + // 2009. 03. 09 documents에 lang_code 컬럼 추가 + if(!$oDB->isColumnExists("documents","lang_code")) { + $db_info = Context::getDBInfo(); + $oDB->addColumn('documents',"lang_code","varchar",10, $db_info->lang_code); + $obj->lang_code = $db_info->lang_type; + executeQuery('document.updateDocumentsLangCode', $obj); + } + + // 2009. 03. 11 확장변수 값 테이블의 인덱스 점검 + if(!$oDB->isIndexExists("document_extra_vars", "unique_extra_vars")) { + $oDB->addIndex("document_extra_vars", "unique_extra_vars", array("module_srl","document_srl","var_idx","lang_code"), true); + } + + if($oDB->isIndexExists("document_extra_vars", "unique_module_vars")) { + $oDB->dropIndex("document_extra_vars", "unique_module_vars", true); + } + + /** + * 2009. 03. 19 : 확장변수 값 테이블에 eid 없을 경우 추가 + * 2009. 04. 12 : eid를 등록할 때 다른 필드 값이 변경되는 문제 수정 #17922959 + **/ + if(!$oDB->isColumnExists("document_extra_keys","eid")) { + $oDB->addColumn("document_extra_keys","eid","varchar",40); + + $output = executeQuery('document.getGroupsExtraKeys', $obj); + if($output->toBool() && $output->data && count($output->data)) { + foreach($output->data as $extra_keys) { + $args->module_srl = $extra_keys->module_srl; + $args->var_idx = $extra_keys->idx; + $args->new_eid = "extra_vars".$extra_keys->idx; + $output = executeQuery('document.updateDocumentExtraKeyEid', $args); + } + } + } + + if(!$oDB->isColumnExists("document_extra_vars","eid")) { + $oDB->addColumn("document_extra_vars","eid","varchar",40); + $obj->var_idx = '-1,-2'; + $output = executeQuery('document.getGroupsExtraVars', $obj); + if($output->toBool() && $output->data && count($output->data)) { + foreach($output->data as $extra_vars) { + $args->module_srl = $extra_vars->module_srl; + $args->var_idx = $extra_vars->idx; + $args->new_eid = "extra_vars".$extra_vars->idx; + $output = executeQuery('document.updateDocumentExtraVarEid', $args); + } + } + } + + // 2011. 03. 30 Cubrid index 추가 요청 + if(!$oDB->isIndexExists("document_extra_vars", "idx_document_list_order")) { + $oDB->addIndex("document_extra_vars", "idx_document_list_order", array("document_srl","module_srl","var_idx"), false); + } + + return new Object(0,'success_updated'); + + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + // 게시글 분류 캐시 파일 삭제 + FileHandler::removeFilesInDir(_XE_PATH_."files/cache/document_category"); + } + + } +?> diff --git a/modules/document/document.model.php b/modules/document/document.model.php index 4b4673e7a..a43c7c405 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -1,1101 +1,1101 @@ - $val) { - if(!$val->document_srl || $checked_documents[$val->document_srl]) continue; - $checked_documents[$val->document_srl] = true; - $document_srls[] = $val->document_srl; - } - - // 검출된 문서 번호가 없으면 return - if(!count($document_srls)) return; - - // 확장변수 미지정된 문서에 대해서 일단 현재 접속자의 언어코드로 확장변수를 검색 - $obj->document_srl = implode(',',$document_srls); - $output = executeQueryArray('document.getDocumentExtraVars', $obj); - if($output->toBool() && $output->data) { - foreach($output->data as $key => $val) { - if(!isset($val->value)) continue; - if(!$extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0]) $extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0] = trim($val->value); - $extra_vars[$val->document_srl][$val->var_idx][$val->lang_code] = trim($val->value); - } - } - - $user_lang_code = Context::getLangType(); - for($i=0,$c=count($document_srls);$i<$c;$i++) { - $document_srl = $document_srls[$i]; - unset($vars); - - if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] || !is_object($GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) || !$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->isExists()) continue; - - $module_srl = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->get('module_srl'); - $extra_keys = $this->getExtraKeys($module_srl); - $vars = $extra_vars[$document_srl]; - $document_lang_code = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->get('lang_code'); - - // 확장변수 처리 - if(count($extra_keys)) { - foreach($extra_keys as $idx => $key) { - $val = $vars[$idx]; - if(isset($val[$user_lang_code])) $v = $val[$user_lang_code]; - else if(isset($val[$document_lang_code])) $v = $val[$document_lang_code]; - else if(isset($val[0])) $v = $val[0]; - else $v = null; - $extra_keys[$idx]->value = $v; - } - } - - unset($evars); - $evars = new ExtraVar($module_srl); - $evars->setExtraVarKeys($extra_keys); - - // 제목 처리 - if($vars[-1][$user_lang_code]) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->add('title',$vars[-1][$user_lang_code]); - - // 내용 처리 - if($vars[-2][$user_lang_code]) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->add('content',$vars[-2][$user_lang_code]); - - if($vars[-1][$user_lang_code] || $vars[-2][$user_lang_code]){ - unset($checked_documents[$document_srl]); - } - - $GLOBALS['XE_EXTRA_VARS'][$document_srl] = $evars->getExtraVars(); - } - } - - /** - * @brief 문서 가져오기 - **/ - function getDocument($document_srl=0, $is_admin = false, $load_extra_vars=true) { - if(!$document_srl) return new documentItem(); - - if(!isset($GLOBALS['XE_DOCUMENT_LIST'][$document_srl])) { - $oDocument = new documentItem($document_srl, $load_extra_vars); - $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; - if($load_extra_vars) $this->setToAllDocumentExtraVars(); - } - if($is_admin) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant(); - - return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; - } - - /** - * @brief 여러개의 문서들을 가져옴 (페이징 아님) - **/ - function getDocuments($document_srls, $is_admin = false, $load_extra_vars=true) { - if(is_array($document_srls)) { - $list_count = count($document_srls); - $document_srls = implode(',',$document_srls); - } else { - $list_count = 1; - } - $args->document_srls = $document_srls; - $args->list_count = $list_count; - $args->order_type = 'asc'; - - $output = executeQuery('document.getDocuments', $args); - $document_list = $output->data; - if(!$document_list) return; - if(!is_array($document_list)) $document_list = array($document_list); - - $document_count = count($document_list); - foreach($document_list as $key => $attribute) { - $document_srl = $attribute->document_srl; - if(!$document_srl) continue; - - if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) { - $oDocument = null; - $oDocument = new documentItem(); - $oDocument->setAttribute($attribute, false); - if($is_admin) $oDocument->setGrant(); - $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; - } - - $result[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; - } - - if($load_extra_vars) $this->setToAllDocumentExtraVars(); - - $output = null; - if(count($result)) { - foreach($result as $document_srl => $val) { - $output[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; - } - } - - return $output; - } - - /** - * @brief module_srl값을 가지는 문서의 목록을 가져옴 - **/ - function getDocumentList($obj, $except_notice = false, $load_extra_vars=true) { - // 정렬 대상과 순서 체크 - if(!in_array($obj->sort_index, array('list_order','regdate','last_update','update_order','readed_count','voted_count','comment_count','trackback_count','uploaded_count','title','category_srl'))) $obj->sort_index = 'list_order'; - if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc'; - - // module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌 - if($obj->mid) { - $oModuleModel = &getModel('module'); - $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); - unset($obj->mid); - } - - // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - - // 제외 module_srl에 대한 검사 - if(is_array($obj->exclude_module_srl)) $args->exclude_module_srl = implode(',', $obj->exclude_module_srl); - else $args->exclude_module_srl = $obj->exclude_module_srl; - - // 변수 체크 - $args->category_srl = $obj->category_srl?$obj->category_srl:null; - $args->sort_index = $obj->sort_index; - $args->order_type = $obj->order_type; - $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; - $args->start_date = $obj->start_date?$obj->start_date:null; - $args->end_date = $obj->end_date?$obj->end_date:null; - $args->member_srl = $obj->member_srl; - - // 카테고리가 선택되어 있으면 하부 카테고리까지 모두 조건에 추가 - if($args->category_srl) { - $category_list = $this->getCategoryList($args->module_srl); - $category_info = $category_list[$args->category_srl]; - $category_info->childs[] = $args->category_srl; - $args->category_srl = implode(',',$category_info->childs); - } - - // 기본으로 사용할 query id 지정 (몇가지 검색 옵션에 따라 query id가 변경됨) - $query_id = 'document.getDocumentList'; - - // 내용검색일 경우 document division을 지정하여 검색하기 위한 처리 - $use_division = false; - - // 검색 옵션 정리 - $searchOpt->search_target = $obj->search_target; - $searchOpt->search_keyword = $obj->search_keyword; - $this->_setSearchOption($searchOpt, &$args, &$query_id, &$use_division); - - /** - * division은 list_order의 asc 정렬일때만 사용할 수 있음 - **/ - if($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false; - - /** - * 만약 use_division이 true일 경우 document division을 이용하도록 변경 - **/ - if($use_division) { - // 시작 division - $division = (int)Context::get('division'); - - // division값이 없다면 제일 상위 - if(!$division) { - $division_args->module_srl = $args->module_srl; - $division_args->exclude_module_srl = $args->exclude_module_srl; - $division_args->list_count = 1; - $division_args->sort_index = $args->sort_index; - $division_args->order_type = $args->order_type; - $output = executeQuery("document.getDocumentList", $division_args); - if($output->data) { - $item = array_pop($output->data); - $division = $item->list_order; - } - $division_args = null; - } - - // 마지막 division - $last_division = (int)Context::get('last_division'); - - // 지정된 division에서부터 5000개 후의 division값을 구함 - if(!$last_division) { - $last_division_args->module_srl = $args->module_srl; - $last_division_args->exclude_module_srl = $args->exclude_module_srl; - $last_division_args->list_count = 1; - $last_division_args->sort_index = $args->sort_index; - $last_division_args->order_type = $args->order_type; - $last_division_args->list_order = $division; - $last_division_args->page = 5001; - $output = executeQuery("document.getDocumentDivision", $last_division_args); - if($output->data) { - $item = array_pop($output->data); - $last_division = $item->list_order; - } - - } - - // last_division 이후로 글이 있는지 확인 - if($last_division) { - $last_division_args = null; - $last_division_args->module_srl = $args->module_srl; - $last_division_args->exclude_module_srl = $args->exclude_module_srl; - $last_division_args->list_order = $last_division; - $output = executeQuery("document.getDocumentDivisionCount", $last_division_args); - if($output->data->count<1) $last_division = null; - } - - $args->division = $division; - $args->last_division = $last_division; - Context::set('division', $division); - Context::set('last_division', $last_division); - } - - // document.getDocumentList 쿼리 실행 - // 만약 query_id가 getDocumentListWithinComment 또는 getDocumentListWithinTag일 경우 group by 절 사용 때문에 쿼리를 한번더 수행 - if(in_array($query_id, array('document.getDocumentListWithinComment', 'document.getDocumentListWithinTag'))) { - $group_args = clone($args); - $group_args->sort_index = 'documents.'.$args->sort_index; - $output = executeQueryArray($query_id, $group_args); - if(!$output->toBool()||!count($output->data)) return $output; - - foreach($output->data as $key => $val) { - if($val->document_srl) $target_srls[] = $val->document_srl; - } - - $page_navigation = $output->page_navigation; - $keys = array_keys($output->data); - $virtual_number = $keys[0]; - - $target_args->document_srls = implode(',',$target_srls); - $target_args->list_order = $args->sort_index; - $target_args->order_type = $args->order_type; - $target_args->list_count = $args->list_count; - $target_args->page = 1; - $output = executeQueryArray('document.getDocuments', $target_args); - $output->page_navigation = $page_navigation; - $output->total_count = $page_navigation->total_count; - $output->total_page = $page_navigation->total_page; - $output->page = $page_navigation->cur_page; - } else { - $output = executeQueryArray($query_id, $args); - } - - // 결과가 없거나 오류 발생시 그냥 return - if(!$output->toBool()||!count($output->data)) return $output; - - $idx = 0; - $data = $output->data; - unset($output->data); - - if(!isset($virtual_number)) - { - $keys = array_keys($data); - $virtual_number = $keys[0]; - } - - if($except_notice) { - foreach($data as $key => $attribute) { - if($attribute->is_notice == 'Y') $virtual_number --; - } - } - - foreach($data as $key => $attribute) { - if($except_notice && $attribute->is_notice == 'Y') continue; - $document_srl = $attribute->document_srl; - if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) { - $oDocument = null; - $oDocument = new documentItem(); - $oDocument->setAttribute($attribute, false); - if($is_admin) $oDocument->setGrant(); - $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; - } - - $output->data[$virtual_number] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; - $virtual_number --; - - } - - if($load_extra_vars) $this->setToAllDocumentExtraVars(); - - if(count($output->data)) { - foreach($output->data as $number => $document) { - $output->data[$number] = $GLOBALS['XE_DOCUMENT_LIST'][$document->document_srl]; - } - } - - return $output; - } - - /** - * @brief module_srl값을 가지는 문서의 공지사항만 가져옴 - **/ - function getNoticeList($obj) { - $args->module_srl = $obj->module_srl; - $output = executeQueryArray('document.getNoticeList', $args); - if(!$output->toBool()||!$output->data) return; - - foreach($output->data as $key => $val) { - $document_srl = $val->document_srl; - if(!$document_srl) continue; - - if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) { - $oDocument = null; - $oDocument = new documentItem(); - $oDocument->setAttribute($val, false); - $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; - } - $result->data[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; - } - $this->setToAllDocumentExtraVars(); - - foreach($result->data as $document_srl => $val) { - $result->data[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; - } - - return $result; - } - - /** - * @brief document의 확장 변수 키값을 가져오는 함수 - * $form_include : 글 작성시에 필요한 확장변수의 input form 추가 여부 - **/ - function getExtraKeys($module_srl) { - if(is_null($GLOBALS['XE_EXTRA_KEYS'][$module_srl])) { - $oExtraVar = &ExtraVar::getInstance($module_srl); - $obj->module_srl = $module_srl; - $obj->sort_index = 'var_idx'; - $obj->order = 'asc'; - $output = executeQueryArray('document.getDocumentExtraKeys', $obj); - $oExtraVar->setExtraVarKeys($output->data); - $keys = $oExtraVar->getExtraVars(); - if(!$keys) $keys = array(); - $GLOBALS['XE_EXTRA_KEYS'][$module_srl] = $keys; - } - - return $GLOBALS['XE_EXTRA_KEYS'][$module_srl]; - } - - /** - * @brief 특정 document의 확장 변수 값을 가져오는 함수 - **/ - function getExtraVars($module_srl, $document_srl) { - if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl])) { - // 확장변수 값을 추출하여 세팅 - $oDocument = $this->getDocument($document_srl, false); - $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; - $this->setToAllDocumentExtraVars(); - } - if(is_array($GLOBALS['XE_EXTRA_VARS'][$document_srl])) ksort($GLOBALS['XE_EXTRA_VARS'][$document_srl]); - return $GLOBALS['XE_EXTRA_VARS'][$document_srl]; - } - - /** - * @brief 선택된 게시물의 팝업메뉴 표시 - * - * 인쇄, 스크랩, 추천, 비추천, 신고 기능 추가 - **/ - function getDocumentMenu() { - - // 요청된 게시물 번호와 현재 로그인 정보 구함 - $document_srl = Context::get('target_srl'); - $mid = Context::get('cur_mid'); - $logged_info = Context::get('logged_info'); - $act = Context::get('cur_act'); - - // menu_list 에 "표시할글,target,url" 을 배열로 넣는다 - $menu_list = array(); - - // trigger 호출 - ModuleHandler::triggerCall('document.getDocumentMenu', 'before', $menu_list); - - $oDocumentController = &getController('document'); - - // 회원이어야만 가능한 기능 - if($logged_info->member_srl) { - - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl, false, false); - $module_srl = $oDocument->get('module_srl'); - $member_srl = $oDocument->get('member_srl'); - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); - - $oModuleModel = &getModel('module'); - $document_config = $oModuleModel->getModulePartConfig('document',$module_srl); - if($document_config->use_vote_up!='N' && $member_srl!=$logged_info->member_srl){ - // 추천 버튼 추가 - $url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl); - $oDocumentController->addDocumentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript'); - } - - if($document_config->use_vote_down!='N' && $member_srl!=$logged_info->member_srl){ - // 비추천 버튼 추가 - $url= sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl); - $oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript'); - } - - // 신고 기능 추가 - $url = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl); - $oDocumentController->addDocumentPopupMenu($url,'cmd_declare','./modules/document/tpl/icons/declare.gif','javascript'); - - // 스크랩 버튼 추가 - $url = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl); - $oDocumentController->addDocumentPopupMenu($url,'cmd_scrap','./modules/document/tpl/icons/scrap.gif','javascript'); - } - - // 인쇄 버튼 추가 - $url = getUrl('','module','document','act','dispDocumentPrint','document_srl',$document_srl); - $oDocumentController->addDocumentPopupMenu($url,'cmd_print','./modules/document/tpl/icons/print.gif','printDocument'); - - // trigger 호출 (after) - ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list); - - // 관리자일 경우 ip로 글 찾기 - if($logged_info->is_admin == 'Y') { - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - - if($oDocument->isExists()) { - // ip주소에 해당하는 글 찾기 - $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->get('ipaddress')); - $icon_path = './modules/member/tpl/images/icon_management.gif'; - $oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress'); - - $url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument-> getIpAddress()); - $oDocumentController->addDocumentPopupMenu($url,'cmd_add_ip_to_spamfilter','./modules/document/tpl/icons/declare.gif','javascript'); - } - } - - // 팝업메뉴의 언어 변경 - $menus = Context::get('document_popup_menu_list'); - $menus_count = count($menus); - for($i=0;$i<$menus_count;$i++) { - $menus[$i]->str = Context::getLang($menus[$i]->str); - } - - // 최종적으로 정리된 팝업메뉴 목록을 구함 - $this->add('menus', $menus); - } - - /** - * @brief module_srl에 해당하는 문서의 전체 갯수를 가져옴 - **/ - function getDocumentCount($module_srl, $search_obj = NULL) { - // 검색 옵션 추가 - $args->module_srl = $module_srl; - $args->s_title = $search_obj->s_title; - $args->s_content = $search_obj->s_content; - $args->s_user_name = $search_obj->s_user_name; - $args->s_member_srl = $search_obj->s_member_srl; - $args->s_ipaddress = $search_obj->s_ipaddress; - $args->s_regdate = $search_obj->s_regdate; - $args->category_srl = $search_obj->category_srl; - - $output = executeQuery('document.getDocumentCount', $args); - - // 전체 갯수를 return - $total_count = $output->data->count; - return (int)$total_count; - } - /** - * @brief 해당 document의 page 가져오기, module_srl이 없으면 전체에서.. - **/ - function getDocumentPage($oDocument, $opt) { - // 정렬 형식에 따라서 query args 변경 - switch($opt->sort_index) { - case 'update_order' : - if($opt->order_type == 'desc') $args->rev_update_order = $oDocument->get('update_order'); - else $args->update_order = $oDocument->get('update_order'); - break; - case 'regdate' : - if($opt->order_type == 'asc') $args->rev_regdate = $oDocument->get('regdate'); - else $args->regdate = $oDocument->get('regdate'); - break; - case 'voted_count' : - case 'readed_count' : - case 'comment_count' : - case 'title' : - return 1; - break; - default : - if($opt->order_type == 'desc') $args->rev_list_order = $oDocument->get('list_order'); - else $args->list_order = $oDocument->get('list_order'); - break; - } - $args->module_srl = $oDocument->get('module_srl'); - $args->sort_index = $opt->sort_index; - $args->order_type = $opt->order_type; - - // 검색 옵션 정리 - $searchOpt->search_target = $opt->search_target; - $searchOpt->search_keyword = $opt->search_keyword; - $this->_setSearchOption($searchOpt, &$args, &$query_id, &$use_division); - - // 전체 갯수를 구한후 해당 글의 페이지를 검색 - $output = executeQuery('document.getDocumentPage', $args); - $count = $output->data->count; - $page = (int)(($count-1)/$opt->list_count)+1; - return $page; - } - - /** - * @brief 카테고리의 정보를 가져옴 - **/ - function getCategory($category_srl) { - $args->category_srl = $category_srl; - $output = executeQuery('document.getCategory', $args); - - $node = $output->data; - if(!$node) return; - - if($node->group_srls) { - $group_srls = explode(',',$node->group_srls); - unset($node->group_srls); - $node->group_srls = $group_srls; - } else { - unset($node->group_srls); - $node->group_srls = array(); - } - return $node; - } - - /** - * @brief 특정 카테고리에 child가 있는지 체크 - **/ - function getCategoryChlidCount($category_srl) { - $args->category_srl = $category_srl; - $output = executeQuery('document.getChildCategoryCount',$args); - if($output->data->count > 0) return true; - return false; - } - - /** - * @brief 특정 모듈의 카테고리 목록을 가져옴 - * 속도나 여러가지 상황을 고려해서 카테고리 목록은 php로 생성된 script를 include하여 사용하는 것을 원칙으로 함 - **/ - function getCategoryList($module_srl) { - // 대상 모듈의 카테고리 파일을 불러옴 - $filename = sprintf("./files/cache/document_category/%s.php", $module_srl); - - // 대상 파일이 없으면 카테고리 캐시 파일을 재생성 - if(!file_exists($filename)) { - $oDocumentController = &getController('document'); - if(!$oDocumentController->makeCategoryFile($module_srl)) return array(); - } - - @include($filename); - - // 카테고리의 정리 - $document_category = array(); - $this->_arrangeCategory($document_category, $menu->list, 0); - return $document_category; - } - - /** - * @brief 카테고리를 1차 배열 형식으로 변경하는 내부 method - **/ - function _arrangeCategory(&$document_category, $list, $depth) { - if(!count($list)) return; - $idx = 0; - $list_order = array(); - foreach($list as $key => $val) { - $obj = null; - $obj->mid = $val['mid']; - $obj->module_srl = $val['module_srl']; - $obj->category_srl = $val['category_srl']; - $obj->parent_srl = $val['parent_srl']; - $obj->title = $obj->text = $val['text']; - $obj->expand = $val['expand']=='Y'?true:false; - $obj->color = $val['color']; - $obj->document_count = $val['document_count']; - $obj->depth = $depth; - $obj->child_count = 0; - $obj->childs = array(); - $obj->grant = $val['grant']; - - if(Context::get('mid') == $obj->mid && Context::get('category') == $obj->category_srl) $selected = true; - else $selected = false; - - $obj->selected = $selected; - - $list_order[$idx++] = $obj->category_srl; - - // 부모 카테고리가 있으면 자식노드들의 데이터를 적용 - if($obj->parent_srl) { - - $parent_srl = $obj->parent_srl; - $document_count = $obj->document_count; - $expand = $obj->expand; - if($selected) $expand = true; - - while($parent_srl) { - $document_category[$parent_srl]->document_count += $document_count; - $document_category[$parent_srl]->childs[] = $obj->category_srl; - $document_category[$parent_srl]->child_count = count($document_category[$parent_srl]->childs); - if($expand) $document_category[$parent_srl]->expand = $expand; - - $parent_srl = $document_category[$parent_srl]->parent_srl; - } - } - - $document_category[$key] = $obj; - - if(count($val['list'])) $this->_arrangeCategory($document_category, $val['list'], $depth+1); - } - $document_category[$list_order[0]]->first = true; - $document_category[$list_order[count($list_order)-1]]->last = true; - } - - /** - * @brief 카테고리에 속한 문서의 갯수를 구함 - **/ - function getCategoryDocumentCount($module_srl, $category_srl) { - $args->module_srl = $module_srl; - $args->category_srl = $category_srl; - $output = executeQuery('document.getCategoryDocumentCount', $args); - return (int)$output->data->count; - } - - /** - * @brief 문서 category정보의 xml 캐시 파일을 return - **/ - function getCategoryXmlFile($module_srl) { - $xml_file = sprintf('files/cache/document_category/%s.xml.php',$module_srl); - if(!file_exists($xml_file)) { - $oDocumentController = &getController('document'); - $oDocumentController->makeCategoryFile($module_srl); - } - return $xml_file; - } - - /** - * @brief 문서 category정보의 php 캐시 파일을 return - **/ - function getCategoryPhpFile($module_srl) { - $php_file = sprintf('files/cache/document_category/%s.php',$module_srl); - if(!file_exists($php_file)) { - $oDocumentController = &getController('document'); - $oDocumentController->makeCategoryFile($module_srl); - } - return $php_file; - } - - /** - * @brief 월별 글 보관현황을 가져옴 - **/ - function getMonthlyArchivedList($obj) { - if($obj->mid) { - $oModuleModel = &getModel('module'); - $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); - unset($obj->mid); - } - - // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - - $output = executeQuery('document.getMonthlyArchivedList', $args); - if(!$output->toBool()||!$output->data) return $output; - - if(!is_array($output->data)) $output->data = array($output->data); - - return $output; - } - - /** - * @brief 특정달의 일별 글 현황을 가져옴 - **/ - function getDailyArchivedList($obj) { - if($obj->mid) { - $oModuleModel = &getModel('module'); - $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); - unset($obj->mid); - } - - // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - $args->regdate = $obj->regdate; - - $output = executeQuery('document.getDailyArchivedList', $args); - if(!$output->toBool()) return $output; - - if(!is_array($output->data)) $output->data = array($output->data); - - return $output; - } - - /** - * @brief 특정 모듈의 분류를 구함 - **/ - function getDocumentCategories() { - if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); - $module_srl = Context::get('module_srl'); - $categories= $this->getCategoryList($module_srl); - $lang = Context::get('lang'); - - // 분류 없음 추가 - $output = "0,0,{$lang->none_category}\n"; - if($categories){ - foreach($categories as $category_srl => $category) { - $output .= sprintf("%d,%d,%s\n",$category_srl, $category->depth,$category->title); - } - } - $this->add('categories', $output); - } - - /** - * @brief 문서 설정 정보를 구함 - **/ - function getDocumentConfig() { - if(!$GLOBALS['__document_config__']) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('document'); - if(!$config->thumbnail_type) $config->thumbnail_type = 'crop'; - $GLOBALS['__document_config__'] = $config; - } - return $GLOBALS['__document_config__']; - } - - /** - * @brief 공통 :: 모듈의 확장 변수 관리 - * 모듈의 확장변수 관리는 모든 모듈에서 document module instance를 이용할때 사용할 수 있음 - **/ - function getExtraVarsHTML($module_srl) { - // 기존의 extra_keys 가져옴 - $extra_keys = $this->getExtraKeys($module_srl); - Context::set('extra_keys', $extra_keys); - - // grant 정보를 추출 - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($this->module_path.'tpl', 'extra_keys'); - } - - /** - * @brief 공통 :: 모듈의 카테고리 변수 관리 - **/ - function getCategoryHTML($module_srl) { - $category_xml_file = $this->getCategoryXmlFile($module_srl); - - Context::set('category_xml_file', $category_xml_file); - - Context::loadJavascriptPlugin('ui.tree'); - // grant 정보를 추출 - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($this->module_path.'tpl', 'category_list'); - } - - /** - * @brief 특정 카테고리의 정보를 이용하여 템플릿을 구한후 return - * 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return - **/ - function getDocumentCategoryTplInfo() { - $oModuleModel = &getModel('module'); - $oMemberModel = &getModel('member'); - - // 해당 메뉴의 정보를 가져오기 위한 변수 설정 - $module_srl = Context::get('module_srl'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - - // 권한 체크 - $grant = $oModuleModel->getGrant($module_info, Context::get('logged_info')); - if(!$grant->manager) return new Object(-1,'msg_not_permitted'); - - $category_srl = Context::get('category_srl'); - $parent_srl = Context::get('parent_srl'); - - // 회원 그룹의 목록을 가져옴 - $group_list = $oMemberModel->getGroups($module_info->site_srl); - Context::set('group_list', $group_list); - - // parent_srl이 있고 category_srl 이 없으면 하부 메뉴 추가임 - if(!$category_srl && $parent_srl) { - // 상위 메뉴의 정보를 가져옴 - $parent_info = $this->getCategory($parent_srl); - - // 추가하려는 메뉴의 기본 변수 설정 - $category_info->category_srl = getNextSequence(); - $category_info->parent_srl = $parent_srl; - $category_info->parent_category_title = $parent_info->title; - - // root에 메뉴 추가하거나 기존 메뉴의 수정일 경우 - } else { - // category_srl 이 있으면 해당 메뉴의 정보를 가져온다 - if($category_srl) $category_info = $this->getCategory($category_srl); - - // 찾아진 값이 없다면 신규 메뉴 추가로 보고 category_srl값만 구해줌 - if(!$category_info->category_srl) { - $category_info->category_srl = getNextSequence(); - } - } - - - $category_info->title = htmlspecialchars($category_info->title); - Context::set('category_info', $category_info); - - // template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다. - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile('./modules/document/tpl', 'category_info'); - $tpl = str_replace("\n",'',$tpl); - - // 사용자 정의 언어 변경 - $oModuleController = &getController('module'); - $oModuleController->replaceDefinedLangCode($tpl); - - // return 할 변수 설정 - $this->add('tpl', $tpl); - } - - - function getDocumentSrlByAlias($mid, $alias) - { - if(!$mid || !$alias) return null; - $site_module_info = Context::get('site_module_info'); - $args->mid = $mid; - $args->alias_title = $alias; - $args->site_srl = $site_module_info->site_srl; - $output = executeQuery('document.getDocumentSrlByAlias', $args); - if(!$output->data) return null; - else return $output->data->document_srl; - } - - function getAlias($document_srl){ - if(!$document_srl) return null; - $args->document_srl = $document_srl; - $output = executeQueryArray('document.getAliases', $args); - - if(!$output->data) return null; - else return $output->data[0]->alias_title; - } - - function getHistories($document_srl, $list_count, $page) - { - $args->list_count = $list_count; - $args->page = $page; - $args->document_srl = $document_srl; - $output = executeQueryArray('document.getHistories', $args); - return $output; - } - - function getHistory($history_srl) - { - $args->history_srl = $history_srl; - $output = executeQuery('document.getHistory', $args); - return $output->data; - } - - /** - * @brief module_srl값을 가지는 문서의 목록을 가져옴 - **/ - function getTrashList($obj) { - - // 변수 체크 - $args->category_srl = $obj->category_srl?$obj->category_srl:null; - $args->sort_index = $obj->sort_index; - $args->order_type = $obj->order_type?$obj->order_type:'desc'; - $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; - - - // 검색 옵션 정리 - $search_target = $obj->search_target; - $search_keyword = $obj->search_keyword; - if($search_target && $search_keyword) { - switch($search_target) { - case 'title' : - case 'content' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->{"s_".$search_target} = $search_keyword; - $use_division = true; - break; - case 'title_content' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_title = $search_keyword; - $args->s_content = $search_keyword; - break; - case 'user_id' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_user_id = $search_keyword; - $args->sort_index = 'documents.'.$args->sort_index; - break; - case 'user_name' : - case 'nick_name' : - case 'email_address' : - case 'homepage' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->{"s_".$search_target} = $search_keyword; - break; - case 'is_notice' : - case 'is_secret' : - if($search_keyword=='N') $args->{"s_".$search_target} = 'N'; - elseif($search_keyword=='Y') $args->{"s_".$search_target} = 'Y'; - else $args->{"s_".$search_target} = ''; - break; - case 'member_srl' : - case 'readed_count' : - case 'voted_count' : - case 'comment_count' : - case 'trackback_count' : - case 'uploaded_count' : - $args->{"s_".$search_target} = (int)$search_keyword; - break; - case 'regdate' : - case 'last_update' : - case 'ipaddress' : - case 'tag' : - $args->{"s_".$search_target} = $search_keyword; - break; - } - } - - - $output = executeQueryArray('document.getTrashList', $args); - if($output->data){ - foreach($output->data as $key => $attribute) { - $oDocument = null; - $oDocument = new documentItem(); - $oDocument->setAttribute($attribute, false); - $attribute = $oDocument; - } - } - return $output; - } - - function getDocumentVotedMemberList() - { - $document_srl = Context::get('document_srl'); - if(!$document_srl) return new Object(-1,'msg_invalid_request'); - - $point = Context::get('point'); - if($point != -1) $point = 1; - - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl, false, false); - $module_srl = $oDocument->get('module_srl'); - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); - - $oModuleModel = &getModel('module'); - $document_config = $oModuleModel->getModulePartConfig('document',$module_srl); - if($point == -1){ - if($document_config->use_vote_down!='S') return new Object(-1, 'msg_invalid_request'); - $args->below_point = 0; - }else{ - if($document_config->use_vote_up!='S') return new Object(-1, 'msg_invalid_request'); - $args->more_point = 0; - } - - $args->document_srl = $document_srl; - - $output = executeQueryArray('document.getVotedMemberList',$args); - if(!$output->toBool()) return $output; - - $oMemberModel = &getModel('member'); - if($output->data){ - foreach($output->data as $k => $d){ - $profile_image = $oMemberModel->getProfileImage($d->member_srl); - $output->data[$k]->src = $profile_image->src; - } - } - - $this->add('voted_member_list',$output->data); - } - - /** - * @brief 게시물 목록의 검색 옵션을 Setting함(2011.03.08 - cherryfilter) - * page변수가 없는 상태에서 page 값을 알아오는 method(getDocumentPage)는 검색하지 않은 값을 return해서 검색한 값을 가져오도록 검색옵션이 추가 됨. - * 검색옵션의 중복으로 인해 private method로 별도 분리 - **/ - function _setSearchOption($searchOpt, &$args, &$query_id, &$use_division) - { - $search_target = $searchOpt->search_target; - $search_keyword = $searchOpt->search_keyword; - - if($search_target && $search_keyword) { - switch($search_target) { - case 'title' : - case 'content' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->{"s_".$search_target} = $search_keyword; - $use_division = true; - break; - case 'title_content' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_title = $search_keyword; - $args->s_content = $search_keyword; - $use_division = true; - break; - case 'user_id' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_user_id = $search_keyword; - $args->sort_index = 'documents.'.$args->sort_index; - break; - case 'user_name' : - case 'nick_name' : - case 'email_address' : - case 'homepage' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->{"s_".$search_target} = $search_keyword; - break; - case 'is_notice' : - case 'is_secret' : - if($search_keyword=='N') $args->{"s_".$search_target} = 'N'; - elseif($search_keyword=='Y') $args->{"s_".$search_target} = 'Y'; - else $args->{"s_".$search_target} = ''; - break; - case 'member_srl' : - case 'readed_count' : - case 'voted_count' : - case 'comment_count' : - case 'trackback_count' : - case 'uploaded_count' : - $args->{"s_".$search_target} = (int)$search_keyword; - break; - case 'regdate' : - case 'last_update' : - case 'ipaddress' : - $args->{"s_".$search_target} = $search_keyword; - break; - case 'comment' : - $args->s_comment = $search_keyword; - $query_id = 'document.getDocumentListWithinComment'; - $use_division = true; - break; - case 'tag' : - $args->s_tags = str_replace(' ','%',$search_keyword); - $query_id = 'document.getDocumentListWithinTag'; - break; - default : - if(strpos($search_target,'extra_vars')!==false) { - $args->var_idx = substr($search_target, strlen('extra_vars')); - $args->var_value = str_replace(' ','%',$search_keyword); - $args->sort_index = 'documents.'.$args->sort_index; - $query_id = 'document.getDocumentListWithExtraVars'; - } - break; - } - } - } - } -?> + $val) { + if(!$val->document_srl || $checked_documents[$val->document_srl]) continue; + $checked_documents[$val->document_srl] = true; + $document_srls[] = $val->document_srl; + } + + // 검출된 문서 번호가 없으면 return + if(!count($document_srls)) return; + + // 확장변수 미지정된 문서에 대해서 일단 현재 접속자의 언어코드로 확장변수를 검색 + $obj->document_srl = implode(',',$document_srls); + $output = executeQueryArray('document.getDocumentExtraVars', $obj); + if($output->toBool() && $output->data) { + foreach($output->data as $key => $val) { + if(!isset($val->value)) continue; + if(!$extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0]) $extra_vars[$val->module_srl][$val->document_srl][$val->var_idx][0] = trim($val->value); + $extra_vars[$val->document_srl][$val->var_idx][$val->lang_code] = trim($val->value); + } + } + + $user_lang_code = Context::getLangType(); + for($i=0,$c=count($document_srls);$i<$c;$i++) { + $document_srl = $document_srls[$i]; + unset($vars); + + if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl] || !is_object($GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) || !$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->isExists()) continue; + + $module_srl = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->get('module_srl'); + $extra_keys = $this->getExtraKeys($module_srl); + $vars = $extra_vars[$document_srl]; + $document_lang_code = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->get('lang_code'); + + // 확장변수 처리 + if(count($extra_keys)) { + foreach($extra_keys as $idx => $key) { + $val = $vars[$idx]; + if(isset($val[$user_lang_code])) $v = $val[$user_lang_code]; + else if(isset($val[$document_lang_code])) $v = $val[$document_lang_code]; + else if(isset($val[0])) $v = $val[0]; + else $v = null; + $extra_keys[$idx]->value = $v; + } + } + + unset($evars); + $evars = new ExtraVar($module_srl); + $evars->setExtraVarKeys($extra_keys); + + // 제목 처리 + if($vars[-1][$user_lang_code]) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->add('title',$vars[-1][$user_lang_code]); + + // 내용 처리 + if($vars[-2][$user_lang_code]) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->add('content',$vars[-2][$user_lang_code]); + + if($vars[-1][$user_lang_code] || $vars[-2][$user_lang_code]){ + unset($checked_documents[$document_srl]); + } + + $GLOBALS['XE_EXTRA_VARS'][$document_srl] = $evars->getExtraVars(); + } + } + + /** + * @brief 문서 가져오기 + **/ + function getDocument($document_srl=0, $is_admin = false, $load_extra_vars=true) { + if(!$document_srl) return new documentItem(); + + if(!isset($GLOBALS['XE_DOCUMENT_LIST'][$document_srl])) { + $oDocument = new documentItem($document_srl, $load_extra_vars); + $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; + if($load_extra_vars) $this->setToAllDocumentExtraVars(); + } + if($is_admin) $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]->setGrant(); + + return $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; + } + + /** + * @brief 여러개의 문서들을 가져옴 (페이징 아님) + **/ + function getDocuments($document_srls, $is_admin = false, $load_extra_vars=true) { + if(is_array($document_srls)) { + $list_count = count($document_srls); + $document_srls = implode(',',$document_srls); + } else { + $list_count = 1; + } + $args->document_srls = $document_srls; + $args->list_count = $list_count; + $args->order_type = 'asc'; + + $output = executeQuery('document.getDocuments', $args); + $document_list = $output->data; + if(!$document_list) return; + if(!is_array($document_list)) $document_list = array($document_list); + + $document_count = count($document_list); + foreach($document_list as $key => $attribute) { + $document_srl = $attribute->document_srl; + if(!$document_srl) continue; + + if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) { + $oDocument = null; + $oDocument = new documentItem(); + $oDocument->setAttribute($attribute, false); + if($is_admin) $oDocument->setGrant(); + $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; + } + + $result[$attribute->document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; + } + + if($load_extra_vars) $this->setToAllDocumentExtraVars(); + + $output = null; + if(count($result)) { + foreach($result as $document_srl => $val) { + $output[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; + } + } + + return $output; + } + + /** + * @brief module_srl값을 가지는 문서의 목록을 가져옴 + **/ + function getDocumentList($obj, $except_notice = false, $load_extra_vars=true) { + // 정렬 대상과 순서 체크 + if(!in_array($obj->sort_index, array('list_order','regdate','last_update','update_order','readed_count','voted_count','comment_count','trackback_count','uploaded_count','title','category_srl'))) $obj->sort_index = 'list_order'; + if(!in_array($obj->order_type, array('desc','asc'))) $obj->order_type = 'asc'; + + // module_srl 대신 mid가 넘어왔을 경우는 직접 module_srl을 구해줌 + if($obj->mid) { + $oModuleModel = &getModel('module'); + $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); + unset($obj->mid); + } + + // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 + if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + + // 제외 module_srl에 대한 검사 + if(is_array($obj->exclude_module_srl)) $args->exclude_module_srl = implode(',', $obj->exclude_module_srl); + else $args->exclude_module_srl = $obj->exclude_module_srl; + + // 변수 체크 + $args->category_srl = $obj->category_srl?$obj->category_srl:null; + $args->sort_index = $obj->sort_index; + $args->order_type = $obj->order_type; + $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; + $args->start_date = $obj->start_date?$obj->start_date:null; + $args->end_date = $obj->end_date?$obj->end_date:null; + $args->member_srl = $obj->member_srl; + + // 카테고리가 선택되어 있으면 하부 카테고리까지 모두 조건에 추가 + if($args->category_srl) { + $category_list = $this->getCategoryList($args->module_srl); + $category_info = $category_list[$args->category_srl]; + $category_info->childs[] = $args->category_srl; + $args->category_srl = implode(',',$category_info->childs); + } + + // 기본으로 사용할 query id 지정 (몇가지 검색 옵션에 따라 query id가 변경됨) + $query_id = 'document.getDocumentList'; + + // 내용검색일 경우 document division을 지정하여 검색하기 위한 처리 + $use_division = false; + + // 검색 옵션 정리 + $searchOpt->search_target = $obj->search_target; + $searchOpt->search_keyword = $obj->search_keyword; + $this->_setSearchOption($searchOpt, &$args, &$query_id, &$use_division); + + /** + * division은 list_order의 asc 정렬일때만 사용할 수 있음 + **/ + if($args->sort_index != 'list_order' || $args->order_type != 'asc') $use_division = false; + + /** + * 만약 use_division이 true일 경우 document division을 이용하도록 변경 + **/ + if($use_division) { + // 시작 division + $division = (int)Context::get('division'); + + // division값이 없다면 제일 상위 + if(!$division) { + $division_args->module_srl = $args->module_srl; + $division_args->exclude_module_srl = $args->exclude_module_srl; + $division_args->list_count = 1; + $division_args->sort_index = $args->sort_index; + $division_args->order_type = $args->order_type; + $output = executeQuery("document.getDocumentList", $division_args); + if($output->data) { + $item = array_pop($output->data); + $division = $item->list_order; + } + $division_args = null; + } + + // 마지막 division + $last_division = (int)Context::get('last_division'); + + // 지정된 division에서부터 5000개 후의 division값을 구함 + if(!$last_division) { + $last_division_args->module_srl = $args->module_srl; + $last_division_args->exclude_module_srl = $args->exclude_module_srl; + $last_division_args->list_count = 1; + $last_division_args->sort_index = $args->sort_index; + $last_division_args->order_type = $args->order_type; + $last_division_args->list_order = $division; + $last_division_args->page = 5001; + $output = executeQuery("document.getDocumentDivision", $last_division_args); + if($output->data) { + $item = array_pop($output->data); + $last_division = $item->list_order; + } + + } + + // last_division 이후로 글이 있는지 확인 + if($last_division) { + $last_division_args = null; + $last_division_args->module_srl = $args->module_srl; + $last_division_args->exclude_module_srl = $args->exclude_module_srl; + $last_division_args->list_order = $last_division; + $output = executeQuery("document.getDocumentDivisionCount", $last_division_args); + if($output->data->count<1) $last_division = null; + } + + $args->division = $division; + $args->last_division = $last_division; + Context::set('division', $division); + Context::set('last_division', $last_division); + } + + // document.getDocumentList 쿼리 실행 + // 만약 query_id가 getDocumentListWithinComment 또는 getDocumentListWithinTag일 경우 group by 절 사용 때문에 쿼리를 한번더 수행 + if(in_array($query_id, array('document.getDocumentListWithinComment', 'document.getDocumentListWithinTag'))) { + $group_args = clone($args); + $group_args->sort_index = 'documents.'.$args->sort_index; + $output = executeQueryArray($query_id, $group_args); + if(!$output->toBool()||!count($output->data)) return $output; + + foreach($output->data as $key => $val) { + if($val->document_srl) $target_srls[] = $val->document_srl; + } + + $page_navigation = $output->page_navigation; + $keys = array_keys($output->data); + $virtual_number = $keys[0]; + + $target_args->document_srls = implode(',',$target_srls); + $target_args->list_order = $args->sort_index; + $target_args->order_type = $args->order_type; + $target_args->list_count = $args->list_count; + $target_args->page = 1; + $output = executeQueryArray('document.getDocuments', $target_args); + $output->page_navigation = $page_navigation; + $output->total_count = $page_navigation->total_count; + $output->total_page = $page_navigation->total_page; + $output->page = $page_navigation->cur_page; + } else { + $output = executeQueryArray($query_id, $args); + } + + // 결과가 없거나 오류 발생시 그냥 return + if(!$output->toBool()||!count($output->data)) return $output; + + $idx = 0; + $data = $output->data; + unset($output->data); + + if(!isset($virtual_number)) + { + $keys = array_keys($data); + $virtual_number = $keys[0]; + } + + if($except_notice) { + foreach($data as $key => $attribute) { + if($attribute->is_notice == 'Y') $virtual_number --; + } + } + + foreach($data as $key => $attribute) { + if($except_notice && $attribute->is_notice == 'Y') continue; + $document_srl = $attribute->document_srl; + if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) { + $oDocument = null; + $oDocument = new documentItem(); + $oDocument->setAttribute($attribute, false); + if($is_admin) $oDocument->setGrant(); + $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; + } + + $output->data[$virtual_number] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; + $virtual_number --; + + } + + if($load_extra_vars) $this->setToAllDocumentExtraVars(); + + if(count($output->data)) { + foreach($output->data as $number => $document) { + $output->data[$number] = $GLOBALS['XE_DOCUMENT_LIST'][$document->document_srl]; + } + } + + return $output; + } + + /** + * @brief module_srl값을 가지는 문서의 공지사항만 가져옴 + **/ + function getNoticeList($obj) { + $args->module_srl = $obj->module_srl; + $output = executeQueryArray('document.getNoticeList', $args); + if(!$output->toBool()||!$output->data) return; + + foreach($output->data as $key => $val) { + $document_srl = $val->document_srl; + if(!$document_srl) continue; + + if(!$GLOBALS['XE_DOCUMENT_LIST'][$document_srl]) { + $oDocument = null; + $oDocument = new documentItem(); + $oDocument->setAttribute($val, false); + $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; + } + $result->data[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; + } + $this->setToAllDocumentExtraVars(); + + foreach($result->data as $document_srl => $val) { + $result->data[$document_srl] = $GLOBALS['XE_DOCUMENT_LIST'][$document_srl]; + } + + return $result; + } + + /** + * @brief document의 확장 변수 키값을 가져오는 함수 + * $form_include : 글 작성시에 필요한 확장변수의 input form 추가 여부 + **/ + function getExtraKeys($module_srl) { + if(is_null($GLOBALS['XE_EXTRA_KEYS'][$module_srl])) { + $oExtraVar = &ExtraVar::getInstance($module_srl); + $obj->module_srl = $module_srl; + $obj->sort_index = 'var_idx'; + $obj->order = 'asc'; + $output = executeQueryArray('document.getDocumentExtraKeys', $obj); + $oExtraVar->setExtraVarKeys($output->data); + $keys = $oExtraVar->getExtraVars(); + if(!$keys) $keys = array(); + $GLOBALS['XE_EXTRA_KEYS'][$module_srl] = $keys; + } + + return $GLOBALS['XE_EXTRA_KEYS'][$module_srl]; + } + + /** + * @brief 특정 document의 확장 변수 값을 가져오는 함수 + **/ + function getExtraVars($module_srl, $document_srl) { + if(!isset($GLOBALS['XE_EXTRA_VARS'][$document_srl])) { + // 확장변수 값을 추출하여 세팅 + $oDocument = $this->getDocument($document_srl, false); + $GLOBALS['XE_DOCUMENT_LIST'][$document_srl] = $oDocument; + $this->setToAllDocumentExtraVars(); + } + if(is_array($GLOBALS['XE_EXTRA_VARS'][$document_srl])) ksort($GLOBALS['XE_EXTRA_VARS'][$document_srl]); + return $GLOBALS['XE_EXTRA_VARS'][$document_srl]; + } + + /** + * @brief 선택된 게시물의 팝업메뉴 표시 + * + * 인쇄, 스크랩, 추천, 비추천, 신고 기능 추가 + **/ + function getDocumentMenu() { + + // 요청된 게시물 번호와 현재 로그인 정보 구함 + $document_srl = Context::get('target_srl'); + $mid = Context::get('cur_mid'); + $logged_info = Context::get('logged_info'); + $act = Context::get('cur_act'); + + // menu_list 에 "표시할글,target,url" 을 배열로 넣는다 + $menu_list = array(); + + // trigger 호출 + ModuleHandler::triggerCall('document.getDocumentMenu', 'before', $menu_list); + + $oDocumentController = &getController('document'); + + // 회원이어야만 가능한 기능 + if($logged_info->member_srl) { + + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl, false, false); + $module_srl = $oDocument->get('module_srl'); + $member_srl = $oDocument->get('member_srl'); + if(!$module_srl) return new Object(-1, 'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $document_config = $oModuleModel->getModulePartConfig('document',$module_srl); + if($document_config->use_vote_up!='N' && $member_srl!=$logged_info->member_srl){ + // 추천 버튼 추가 + $url = sprintf("doCallModuleAction('document','procDocumentVoteUp','%s')", $document_srl); + $oDocumentController->addDocumentPopupMenu($url,'cmd_vote','./modules/document/tpl/icons/vote_up.gif','javascript'); + } + + if($document_config->use_vote_down!='N' && $member_srl!=$logged_info->member_srl){ + // 비추천 버튼 추가 + $url= sprintf("doCallModuleAction('document','procDocumentVoteDown','%s')", $document_srl); + $oDocumentController->addDocumentPopupMenu($url,'cmd_vote_down','./modules/document/tpl/icons/vote_down.gif','javascript'); + } + + // 신고 기능 추가 + $url = sprintf("doCallModuleAction('document','procDocumentDeclare','%s')", $document_srl); + $oDocumentController->addDocumentPopupMenu($url,'cmd_declare','./modules/document/tpl/icons/declare.gif','javascript'); + + // 스크랩 버튼 추가 + $url = sprintf("doCallModuleAction('member','procMemberScrapDocument','%s')", $document_srl); + $oDocumentController->addDocumentPopupMenu($url,'cmd_scrap','./modules/document/tpl/icons/scrap.gif','javascript'); + } + + // 인쇄 버튼 추가 + $url = getUrl('','module','document','act','dispDocumentPrint','document_srl',$document_srl); + $oDocumentController->addDocumentPopupMenu($url,'cmd_print','./modules/document/tpl/icons/print.gif','printDocument'); + + // trigger 호출 (after) + ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list); + + // 관리자일 경우 ip로 글 찾기 + if($logged_info->is_admin == 'Y') { + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + + if($oDocument->isExists()) { + // ip주소에 해당하는 글 찾기 + $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','ipaddress','search_keyword',$oDocument->get('ipaddress')); + $icon_path = './modules/member/tpl/images/icon_management.gif'; + $oDocumentController->addDocumentPopupMenu($url,'cmd_search_by_ipaddress',$icon_path,'TraceByIpaddress'); + + $url = sprintf("var params = new Array(); params['ipaddress']='%s'; exec_xml('spamfilter', 'procSpamfilterAdminInsertDeniedIP', params, completeCallModuleAction)", $oDocument-> getIpAddress()); + $oDocumentController->addDocumentPopupMenu($url,'cmd_add_ip_to_spamfilter','./modules/document/tpl/icons/declare.gif','javascript'); + } + } + + // 팝업메뉴의 언어 변경 + $menus = Context::get('document_popup_menu_list'); + $menus_count = count($menus); + for($i=0;$i<$menus_count;$i++) { + $menus[$i]->str = Context::getLang($menus[$i]->str); + } + + // 최종적으로 정리된 팝업메뉴 목록을 구함 + $this->add('menus', $menus); + } + + /** + * @brief module_srl에 해당하는 문서의 전체 갯수를 가져옴 + **/ + function getDocumentCount($module_srl, $search_obj = NULL) { + // 검색 옵션 추가 + $args->module_srl = $module_srl; + $args->s_title = $search_obj->s_title; + $args->s_content = $search_obj->s_content; + $args->s_user_name = $search_obj->s_user_name; + $args->s_member_srl = $search_obj->s_member_srl; + $args->s_ipaddress = $search_obj->s_ipaddress; + $args->s_regdate = $search_obj->s_regdate; + $args->category_srl = $search_obj->category_srl; + + $output = executeQuery('document.getDocumentCount', $args); + + // 전체 갯수를 return + $total_count = $output->data->count; + return (int)$total_count; + } + /** + * @brief 해당 document의 page 가져오기, module_srl이 없으면 전체에서.. + **/ + function getDocumentPage($oDocument, $opt) { + // 정렬 형식에 따라서 query args 변경 + switch($opt->sort_index) { + case 'update_order' : + if($opt->order_type == 'desc') $args->rev_update_order = $oDocument->get('update_order'); + else $args->update_order = $oDocument->get('update_order'); + break; + case 'regdate' : + if($opt->order_type == 'asc') $args->rev_regdate = $oDocument->get('regdate'); + else $args->regdate = $oDocument->get('regdate'); + break; + case 'voted_count' : + case 'readed_count' : + case 'comment_count' : + case 'title' : + return 1; + break; + default : + if($opt->order_type == 'desc') $args->rev_list_order = $oDocument->get('list_order'); + else $args->list_order = $oDocument->get('list_order'); + break; + } + $args->module_srl = $oDocument->get('module_srl'); + $args->sort_index = $opt->sort_index; + $args->order_type = $opt->order_type; + + // 검색 옵션 정리 + $searchOpt->search_target = $opt->search_target; + $searchOpt->search_keyword = $opt->search_keyword; + $this->_setSearchOption($searchOpt, &$args, &$query_id, &$use_division); + + // 전체 갯수를 구한후 해당 글의 페이지를 검색 + $output = executeQuery('document.getDocumentPage', $args); + $count = $output->data->count; + $page = (int)(($count-1)/$opt->list_count)+1; + return $page; + } + + /** + * @brief 카테고리의 정보를 가져옴 + **/ + function getCategory($category_srl) { + $args->category_srl = $category_srl; + $output = executeQuery('document.getCategory', $args); + + $node = $output->data; + if(!$node) return; + + if($node->group_srls) { + $group_srls = explode(',',$node->group_srls); + unset($node->group_srls); + $node->group_srls = $group_srls; + } else { + unset($node->group_srls); + $node->group_srls = array(); + } + return $node; + } + + /** + * @brief 특정 카테고리에 child가 있는지 체크 + **/ + function getCategoryChlidCount($category_srl) { + $args->category_srl = $category_srl; + $output = executeQuery('document.getChildCategoryCount',$args); + if($output->data->count > 0) return true; + return false; + } + + /** + * @brief 특정 모듈의 카테고리 목록을 가져옴 + * 속도나 여러가지 상황을 고려해서 카테고리 목록은 php로 생성된 script를 include하여 사용하는 것을 원칙으로 함 + **/ + function getCategoryList($module_srl) { + // 대상 모듈의 카테고리 파일을 불러옴 + $filename = sprintf("./files/cache/document_category/%s.php", $module_srl); + + // 대상 파일이 없으면 카테고리 캐시 파일을 재생성 + if(!file_exists($filename)) { + $oDocumentController = &getController('document'); + if(!$oDocumentController->makeCategoryFile($module_srl)) return array(); + } + + @include($filename); + + // 카테고리의 정리 + $document_category = array(); + $this->_arrangeCategory($document_category, $menu->list, 0); + return $document_category; + } + + /** + * @brief 카테고리를 1차 배열 형식으로 변경하는 내부 method + **/ + function _arrangeCategory(&$document_category, $list, $depth) { + if(!count($list)) return; + $idx = 0; + $list_order = array(); + foreach($list as $key => $val) { + $obj = null; + $obj->mid = $val['mid']; + $obj->module_srl = $val['module_srl']; + $obj->category_srl = $val['category_srl']; + $obj->parent_srl = $val['parent_srl']; + $obj->title = $obj->text = $val['text']; + $obj->expand = $val['expand']=='Y'?true:false; + $obj->color = $val['color']; + $obj->document_count = $val['document_count']; + $obj->depth = $depth; + $obj->child_count = 0; + $obj->childs = array(); + $obj->grant = $val['grant']; + + if(Context::get('mid') == $obj->mid && Context::get('category') == $obj->category_srl) $selected = true; + else $selected = false; + + $obj->selected = $selected; + + $list_order[$idx++] = $obj->category_srl; + + // 부모 카테고리가 있으면 자식노드들의 데이터를 적용 + if($obj->parent_srl) { + + $parent_srl = $obj->parent_srl; + $document_count = $obj->document_count; + $expand = $obj->expand; + if($selected) $expand = true; + + while($parent_srl) { + $document_category[$parent_srl]->document_count += $document_count; + $document_category[$parent_srl]->childs[] = $obj->category_srl; + $document_category[$parent_srl]->child_count = count($document_category[$parent_srl]->childs); + if($expand) $document_category[$parent_srl]->expand = $expand; + + $parent_srl = $document_category[$parent_srl]->parent_srl; + } + } + + $document_category[$key] = $obj; + + if(count($val['list'])) $this->_arrangeCategory($document_category, $val['list'], $depth+1); + } + $document_category[$list_order[0]]->first = true; + $document_category[$list_order[count($list_order)-1]]->last = true; + } + + /** + * @brief 카테고리에 속한 문서의 갯수를 구함 + **/ + function getCategoryDocumentCount($module_srl, $category_srl) { + $args->module_srl = $module_srl; + $args->category_srl = $category_srl; + $output = executeQuery('document.getCategoryDocumentCount', $args); + return (int)$output->data->count; + } + + /** + * @brief 문서 category정보의 xml 캐시 파일을 return + **/ + function getCategoryXmlFile($module_srl) { + $xml_file = sprintf('files/cache/document_category/%s.xml.php',$module_srl); + if(!file_exists($xml_file)) { + $oDocumentController = &getController('document'); + $oDocumentController->makeCategoryFile($module_srl); + } + return $xml_file; + } + + /** + * @brief 문서 category정보의 php 캐시 파일을 return + **/ + function getCategoryPhpFile($module_srl) { + $php_file = sprintf('files/cache/document_category/%s.php',$module_srl); + if(!file_exists($php_file)) { + $oDocumentController = &getController('document'); + $oDocumentController->makeCategoryFile($module_srl); + } + return $php_file; + } + + /** + * @brief 월별 글 보관현황을 가져옴 + **/ + function getMonthlyArchivedList($obj) { + if($obj->mid) { + $oModuleModel = &getModel('module'); + $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); + unset($obj->mid); + } + + // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 + if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + + $output = executeQuery('document.getMonthlyArchivedList', $args); + if(!$output->toBool()||!$output->data) return $output; + + if(!is_array($output->data)) $output->data = array($output->data); + + return $output; + } + + /** + * @brief 특정달의 일별 글 현황을 가져옴 + **/ + function getDailyArchivedList($obj) { + if($obj->mid) { + $oModuleModel = &getModel('module'); + $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); + unset($obj->mid); + } + + // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 + if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + $args->regdate = $obj->regdate; + + $output = executeQuery('document.getDailyArchivedList', $args); + if(!$output->toBool()) return $output; + + if(!is_array($output->data)) $output->data = array($output->data); + + return $output; + } + + /** + * @brief 특정 모듈의 분류를 구함 + **/ + function getDocumentCategories() { + if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); + $module_srl = Context::get('module_srl'); + $categories= $this->getCategoryList($module_srl); + $lang = Context::get('lang'); + + // 분류 없음 추가 + $output = "0,0,{$lang->none_category}\n"; + if($categories){ + foreach($categories as $category_srl => $category) { + $output .= sprintf("%d,%d,%s\n",$category_srl, $category->depth,$category->title); + } + } + $this->add('categories', $output); + } + + /** + * @brief 문서 설정 정보를 구함 + **/ + function getDocumentConfig() { + if(!$GLOBALS['__document_config__']) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('document'); + if(!$config->thumbnail_type) $config->thumbnail_type = 'crop'; + $GLOBALS['__document_config__'] = $config; + } + return $GLOBALS['__document_config__']; + } + + /** + * @brief 공통 :: 모듈의 확장 변수 관리 + * 모듈의 확장변수 관리는 모든 모듈에서 document module instance를 이용할때 사용할 수 있음 + **/ + function getExtraVarsHTML($module_srl) { + // 기존의 extra_keys 가져옴 + $extra_keys = $this->getExtraKeys($module_srl); + Context::set('extra_keys', $extra_keys); + + // grant 정보를 추출 + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($this->module_path.'tpl', 'extra_keys'); + } + + /** + * @brief 공통 :: 모듈의 카테고리 변수 관리 + **/ + function getCategoryHTML($module_srl) { + $category_xml_file = $this->getCategoryXmlFile($module_srl); + + Context::set('category_xml_file', $category_xml_file); + + Context::loadJavascriptPlugin('ui.tree'); + // grant 정보를 추출 + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($this->module_path.'tpl', 'category_list'); + } + + /** + * @brief 특정 카테고리의 정보를 이용하여 템플릿을 구한후 return + * 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return + **/ + function getDocumentCategoryTplInfo() { + $oModuleModel = &getModel('module'); + $oMemberModel = &getModel('member'); + + // 해당 메뉴의 정보를 가져오기 위한 변수 설정 + $module_srl = Context::get('module_srl'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + + // 권한 체크 + $grant = $oModuleModel->getGrant($module_info, Context::get('logged_info')); + if(!$grant->manager) return new Object(-1,'msg_not_permitted'); + + $category_srl = Context::get('category_srl'); + $parent_srl = Context::get('parent_srl'); + + // 회원 그룹의 목록을 가져옴 + $group_list = $oMemberModel->getGroups($module_info->site_srl); + Context::set('group_list', $group_list); + + // parent_srl이 있고 category_srl 이 없으면 하부 메뉴 추가임 + if(!$category_srl && $parent_srl) { + // 상위 메뉴의 정보를 가져옴 + $parent_info = $this->getCategory($parent_srl); + + // 추가하려는 메뉴의 기본 변수 설정 + $category_info->category_srl = getNextSequence(); + $category_info->parent_srl = $parent_srl; + $category_info->parent_category_title = $parent_info->title; + + // root에 메뉴 추가하거나 기존 메뉴의 수정일 경우 + } else { + // category_srl 이 있으면 해당 메뉴의 정보를 가져온다 + if($category_srl) $category_info = $this->getCategory($category_srl); + + // 찾아진 값이 없다면 신규 메뉴 추가로 보고 category_srl값만 구해줌 + if(!$category_info->category_srl) { + $category_info->category_srl = getNextSequence(); + } + } + + + $category_info->title = htmlspecialchars($category_info->title); + Context::set('category_info', $category_info); + + // template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다. + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile('./modules/document/tpl', 'category_info'); + $tpl = str_replace("\n",'',$tpl); + + // 사용자 정의 언어 변경 + $oModuleController = &getController('module'); + $oModuleController->replaceDefinedLangCode($tpl); + + // return 할 변수 설정 + $this->add('tpl', $tpl); + } + + + function getDocumentSrlByAlias($mid, $alias) + { + if(!$mid || !$alias) return null; + $site_module_info = Context::get('site_module_info'); + $args->mid = $mid; + $args->alias_title = $alias; + $args->site_srl = $site_module_info->site_srl; + $output = executeQuery('document.getDocumentSrlByAlias', $args); + if(!$output->data) return null; + else return $output->data->document_srl; + } + + function getAlias($document_srl){ + if(!$document_srl) return null; + $args->document_srl = $document_srl; + $output = executeQueryArray('document.getAliases', $args); + + if(!$output->data) return null; + else return $output->data[0]->alias_title; + } + + function getHistories($document_srl, $list_count, $page) + { + $args->list_count = $list_count; + $args->page = $page; + $args->document_srl = $document_srl; + $output = executeQueryArray('document.getHistories', $args); + return $output; + } + + function getHistory($history_srl) + { + $args->history_srl = $history_srl; + $output = executeQuery('document.getHistory', $args); + return $output->data; + } + + /** + * @brief module_srl값을 가지는 문서의 목록을 가져옴 + **/ + function getTrashList($obj) { + + // 변수 체크 + $args->category_srl = $obj->category_srl?$obj->category_srl:null; + $args->sort_index = $obj->sort_index; + $args->order_type = $obj->order_type?$obj->order_type:'desc'; + $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; + + + // 검색 옵션 정리 + $search_target = $obj->search_target; + $search_keyword = $obj->search_keyword; + if($search_target && $search_keyword) { + switch($search_target) { + case 'title' : + case 'content' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->{"s_".$search_target} = $search_keyword; + $use_division = true; + break; + case 'title_content' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_title = $search_keyword; + $args->s_content = $search_keyword; + break; + case 'user_id' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_id = $search_keyword; + $args->sort_index = 'documents.'.$args->sort_index; + break; + case 'user_name' : + case 'nick_name' : + case 'email_address' : + case 'homepage' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->{"s_".$search_target} = $search_keyword; + break; + case 'is_notice' : + case 'is_secret' : + if($search_keyword=='N') $args->{"s_".$search_target} = 'N'; + elseif($search_keyword=='Y') $args->{"s_".$search_target} = 'Y'; + else $args->{"s_".$search_target} = ''; + break; + case 'member_srl' : + case 'readed_count' : + case 'voted_count' : + case 'comment_count' : + case 'trackback_count' : + case 'uploaded_count' : + $args->{"s_".$search_target} = (int)$search_keyword; + break; + case 'regdate' : + case 'last_update' : + case 'ipaddress' : + case 'tag' : + $args->{"s_".$search_target} = $search_keyword; + break; + } + } + + + $output = executeQueryArray('document.getTrashList', $args); + if($output->data){ + foreach($output->data as $key => $attribute) { + $oDocument = null; + $oDocument = new documentItem(); + $oDocument->setAttribute($attribute, false); + $attribute = $oDocument; + } + } + return $output; + } + + function getDocumentVotedMemberList() + { + $document_srl = Context::get('document_srl'); + if(!$document_srl) return new Object(-1,'msg_invalid_request'); + + $point = Context::get('point'); + if($point != -1) $point = 1; + + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl, false, false); + $module_srl = $oDocument->get('module_srl'); + if(!$module_srl) return new Object(-1, 'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $document_config = $oModuleModel->getModulePartConfig('document',$module_srl); + if($point == -1){ + if($document_config->use_vote_down!='S') return new Object(-1, 'msg_invalid_request'); + $args->below_point = 0; + }else{ + if($document_config->use_vote_up!='S') return new Object(-1, 'msg_invalid_request'); + $args->more_point = 0; + } + + $args->document_srl = $document_srl; + + $output = executeQueryArray('document.getVotedMemberList',$args); + if(!$output->toBool()) return $output; + + $oMemberModel = &getModel('member'); + if($output->data){ + foreach($output->data as $k => $d){ + $profile_image = $oMemberModel->getProfileImage($d->member_srl); + $output->data[$k]->src = $profile_image->src; + } + } + + $this->add('voted_member_list',$output->data); + } + + /** + * @brief 게시물 목록의 검색 옵션을 Setting함(2011.03.08 - cherryfilter) + * page변수가 없는 상태에서 page 값을 알아오는 method(getDocumentPage)는 검색하지 않은 값을 return해서 검색한 값을 가져오도록 검색옵션이 추가 됨. + * 검색옵션의 중복으로 인해 private method로 별도 분리 + **/ + function _setSearchOption($searchOpt, &$args, &$query_id, &$use_division) + { + $search_target = $searchOpt->search_target; + $search_keyword = $searchOpt->search_keyword; + + if($search_target && $search_keyword) { + switch($search_target) { + case 'title' : + case 'content' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->{"s_".$search_target} = $search_keyword; + $use_division = true; + break; + case 'title_content' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_title = $search_keyword; + $args->s_content = $search_keyword; + $use_division = true; + break; + case 'user_id' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_id = $search_keyword; + $args->sort_index = 'documents.'.$args->sort_index; + break; + case 'user_name' : + case 'nick_name' : + case 'email_address' : + case 'homepage' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->{"s_".$search_target} = $search_keyword; + break; + case 'is_notice' : + case 'is_secret' : + if($search_keyword=='N') $args->{"s_".$search_target} = 'N'; + elseif($search_keyword=='Y') $args->{"s_".$search_target} = 'Y'; + else $args->{"s_".$search_target} = ''; + break; + case 'member_srl' : + case 'readed_count' : + case 'voted_count' : + case 'comment_count' : + case 'trackback_count' : + case 'uploaded_count' : + $args->{"s_".$search_target} = (int)$search_keyword; + break; + case 'regdate' : + case 'last_update' : + case 'ipaddress' : + $args->{"s_".$search_target} = $search_keyword; + break; + case 'comment' : + $args->s_comment = $search_keyword; + $query_id = 'document.getDocumentListWithinComment'; + $use_division = true; + break; + case 'tag' : + $args->s_tags = str_replace(' ','%',$search_keyword); + $query_id = 'document.getDocumentListWithinTag'; + break; + default : + if(strpos($search_target,'extra_vars')!==false) { + $args->var_idx = substr($search_target, strlen('extra_vars')); + $args->var_value = str_replace(' ','%',$search_keyword); + $args->sort_index = 'documents.'.$args->sort_index; + $query_id = 'document.getDocumentListWithExtraVars'; + } + break; + } + } + } + } +?> diff --git a/modules/document/document.view.php b/modules/document/document.view.php index 4e2e3fb81..a88b17986 100644 --- a/modules/document/document.view.php +++ b/modules/document/document.view.php @@ -1,121 +1,121 @@ -getModuleInfoByDocumentSrl($document_srl); - - // document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-; - $oDocumentModel = &getModel('document'); - - // 선택된 문서 표시를 위한 객체 생성 - $oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager); - if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request'); - - // 권한 체크 - if(!$oDocument->isAccessible()) return new Object(-1,'msg_not_permitted'); - - // 모듈 정보 세팅 - Context::set('module_info', $module_info); - - // 브라우저 타이틀 설정 - Context::setBrowserTitle($oDocument->getTitleText()); - Context::set('oDocument', $oDocument); - - Context::set('layout','none'); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('print_page'); - } - - /** - * @brief 미리 보기 - **/ - function dispDocumentPreview() { - Context::set('layout','none'); - - $content = Context::get('content'); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('preview_page'); - } - - /** - * @brief 관리자가 선택한 문서에 대한 관리 - **/ - function dispDocumentManageDocument() { - if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); - - // 선택한 목록을 세션에서 가져옴 - $flag_list = $_SESSION['document_management']; - if(count($flag_list)) { - foreach($flag_list as $key => $val) { - if(!is_bool($val)) continue; - $document_srl_list[] = $key; - } - } - - if(count($document_srl_list)) { - $oDocumentModel = &getModel('document'); - $document_list = $oDocumentModel->getDocuments($document_srl_list, $this->grant->is_admin); - Context::set('document_list', $document_list); - } - - $oModuleModel = &getModel('module'); - - // 모듈 카테고리 목록과 모듈 목록의 조합 - if(count($module_list)>1) Context::set('module_list', $module_categories); - - // 팝업 레이아웃 선택 - $this->setLayoutPath('./common/tpl'); - $this->setLayoutFile('popup_layout'); - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('checked_list'); - } - - function triggerDispDocumentAdditionSetup(&$obj) { - $current_module_srl = Context::get('module_srl'); - $current_module_srls = Context::get('module_srls'); - - if(!$current_module_srl && !$current_module_srls) { - // 선택된 모듈의 정보를 가져옴 - $current_module_info = Context::get('current_module_info'); - $current_module_srl = $current_module_info->module_srl; - if(!$current_module_srl) return new Object(); - } - - $oModuleModel = &getModel('module'); - if($current_module_srl) - { - $document_config = $oModuleModel->getModulePartConfig('document', $current_module_srl); - } - if(!isset($document_config->use_history)) $document_config->use_history = 'N'; - Context::set('document_config', $document_config); - - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'document_module_config'); - $obj .= $tpl; - - return new Object(); - } - - } -?> +getModuleInfoByDocumentSrl($document_srl); + + // document 객체를 생성. 기본 데이터 구조의 경우 document모듈만 쓰면 만사 해결.. -_-; + $oDocumentModel = &getModel('document'); + + // 선택된 문서 표시를 위한 객체 생성 + $oDocument = $oDocumentModel->getDocument($document_srl, $this->grant->manager); + if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request'); + + // 권한 체크 + if(!$oDocument->isAccessible()) return new Object(-1,'msg_not_permitted'); + + // 모듈 정보 세팅 + Context::set('module_info', $module_info); + + // 브라우저 타이틀 설정 + Context::setBrowserTitle($oDocument->getTitleText()); + Context::set('oDocument', $oDocument); + + Context::set('layout','none'); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('print_page'); + } + + /** + * @brief 미리 보기 + **/ + function dispDocumentPreview() { + Context::set('layout','none'); + + $content = Context::get('content'); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('preview_page'); + } + + /** + * @brief 관리자가 선택한 문서에 대한 관리 + **/ + function dispDocumentManageDocument() { + if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); + + // 선택한 목록을 세션에서 가져옴 + $flag_list = $_SESSION['document_management']; + if(count($flag_list)) { + foreach($flag_list as $key => $val) { + if(!is_bool($val)) continue; + $document_srl_list[] = $key; + } + } + + if(count($document_srl_list)) { + $oDocumentModel = &getModel('document'); + $document_list = $oDocumentModel->getDocuments($document_srl_list, $this->grant->is_admin); + Context::set('document_list', $document_list); + } + + $oModuleModel = &getModel('module'); + + // 모듈 카테고리 목록과 모듈 목록의 조합 + if(count($module_list)>1) Context::set('module_list', $module_categories); + + // 팝업 레이아웃 선택 + $this->setLayoutPath('./common/tpl'); + $this->setLayoutFile('popup_layout'); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('checked_list'); + } + + function triggerDispDocumentAdditionSetup(&$obj) { + $current_module_srl = Context::get('module_srl'); + $current_module_srls = Context::get('module_srls'); + + if(!$current_module_srl && !$current_module_srls) { + // 선택된 모듈의 정보를 가져옴 + $current_module_info = Context::get('current_module_info'); + $current_module_srl = $current_module_info->module_srl; + if(!$current_module_srl) return new Object(); + } + + $oModuleModel = &getModel('module'); + if($current_module_srl) + { + $document_config = $oModuleModel->getModulePartConfig('document', $current_module_srl); + } + if(!isset($document_config->use_history)) $document_config->use_history = 'N'; + Context::set('document_config', $document_config); + + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'document_module_config'); + $obj .= $tpl; + + return new Object(); + } + + } +?> diff --git a/modules/document/lang/en.lang.php b/modules/document/lang/en.lang.php index 4bc6b61de..6d0c9b455 100644 --- a/modules/document/lang/en.lang.php +++ b/modules/document/lang/en.lang.php @@ -1,99 +1,99 @@ -document_list = 'Documents List'; - $lang->thumbnail_type = 'Thumbnail Type'; - $lang->thumbnail_crop = 'Crop'; - $lang->thumbnail_ratio = 'Ratio'; - $lang->cmd_delete_all_thumbnail = 'Delete all thumbnails'; - $lang->move_target_module = "Target module "; - $lang->title_bold = 'Bold'; - $lang->title_color = 'Color'; - $lang->new_document_count = 'New documents'; - - $lang->parent_category_title = 'Parent Category'; - $lang->category_title = 'Category'; - $lang->category_color = 'Category Font Color'; - $lang->expand = 'Expand'; - $lang->category_group_srls = 'Accessable Group'; - - $lang->cmd_make_child = 'Add Child Category'; - $lang->cmd_enable_move_category = "Change Category Position (Drag the top menu after selection)"; - - $lang->about_category_title = 'Please input category name'; - $lang->about_expand = 'By selecting this option, it will be always expanded'; - $lang->about_category_group_srls = 'Only selected group will be able to use current category'; - $lang->about_category_color = 'You can set font color of category.'; - - $lang->cmd_search_next = 'Search Next'; - - $lang->cmd_temp_save = 'Temporary Save'; - - $lang->cmd_toggle_checked_document = 'Reverse selected items'; - $lang->cmd_delete_checked_document = 'Delete selected'; - $lang->cmd_document_do = 'I want to'; - - $lang->msg_cart_is_null = 'Please select the articles to delete'; - $lang->msg_category_not_moved = 'Could not be moved'; - $lang->msg_is_secret = 'This is a secret article'; - $lang->msg_checked_document_is_deleted = '%d article(s) was(were) deleted'; - - // Search targets in admin page - $lang->search_target_list = array( - 'title' => 'Subject', - 'content' => 'Content', - 'user_id' => 'User ID', - 'member_srl' => 'Member Serial Number', - 'user_name' => 'User Name', - 'nick_name' => 'Nickname', - 'email_address' => 'Email', - 'homepage' => 'Homepage', - 'is_notice' => 'Notice', - 'is_secret' => 'Secret', - 'tags' => 'Tag', - 'readed_count' => 'Number of Views (over)', - 'voted_count' => 'Number of Votes (over)', - 'comment_count ' => 'Number of Comments (over)', - 'trackback_count ' => 'Number of Trackbacks (over)', - 'uploaded_count ' => 'Number of Attachments (over)', - 'regdate' => 'Date', - 'last_update' => 'Last Modified Date', - 'ipaddress' => 'IP Address', - ); - - $lang->alias = "Alias"; - $lang->history = "History"; - $lang->about_use_history = "History can restore documents to previous revisions"; - $lang->trace_only = "Trace only"; - - $lang->cmd_trash = 'Trashcan'; - $lang->cmd_restore = 'Restore'; - $lang->cmd_restore_all = 'Restore All'; - - $lang->in_trash = 'Trashcan'; - $lang->trash_nick_name = 'Deleter'; - $lang->trash_date = 'Deleted date'; - $lang->trash_description = 'Description'; - - $lang->search_target_trash_list = array( - 'title' => 'Title', - 'content' => 'Content', - 'user_id' => 'User ID', - 'member_srl' => 'Member srl', - 'user_name' => 'User name', - 'nick_name' => 'Nickname', - 'trash_member_srl' => 'Deleter srl', - 'trash_user_name' => 'Deleter name', - 'trash_nick_name' => 'Deleter nickname', - 'trash_date' => 'Deleted date', - 'trash_ipaddress' => 'Deleter IP address', - ); - - $lang->success_trashed = "Successfully moved to trashcan"; - $lang->msg_not_selected_document = 'There is no selected article.'; - $lang->show_voted_member = 'Show Voters'; -?> +document_list = 'Documents List'; + $lang->thumbnail_type = 'Thumbnail Type'; + $lang->thumbnail_crop = 'Crop'; + $lang->thumbnail_ratio = 'Ratio'; + $lang->cmd_delete_all_thumbnail = 'Delete all thumbnails'; + $lang->move_target_module = "Target module "; + $lang->title_bold = 'Bold'; + $lang->title_color = 'Color'; + $lang->new_document_count = 'New documents'; + + $lang->parent_category_title = 'Parent Category'; + $lang->category_title = 'Category'; + $lang->category_color = 'Category Font Color'; + $lang->expand = 'Expand'; + $lang->category_group_srls = 'Accessable Group'; + + $lang->cmd_make_child = 'Add Child Category'; + $lang->cmd_enable_move_category = "Change Category Position (Drag the top menu after selection)"; + + $lang->about_category_title = 'Please input category name'; + $lang->about_expand = 'By selecting this option, it will be always expanded'; + $lang->about_category_group_srls = 'Only selected group will be able to use current category'; + $lang->about_category_color = 'You can set font color of category.'; + + $lang->cmd_search_next = 'Search Next'; + + $lang->cmd_temp_save = 'Temporary Save'; + + $lang->cmd_toggle_checked_document = 'Reverse selected items'; + $lang->cmd_delete_checked_document = 'Delete selected'; + $lang->cmd_document_do = 'I want to'; + + $lang->msg_cart_is_null = 'Please select the articles to delete'; + $lang->msg_category_not_moved = 'Could not be moved'; + $lang->msg_is_secret = 'This is a secret article'; + $lang->msg_checked_document_is_deleted = '%d article(s) was(were) deleted'; + + // Search targets in admin page + $lang->search_target_list = array( + 'title' => 'Subject', + 'content' => 'Content', + 'user_id' => 'User ID', + 'member_srl' => 'Member Serial Number', + 'user_name' => 'User Name', + 'nick_name' => 'Nickname', + 'email_address' => 'Email', + 'homepage' => 'Homepage', + 'is_notice' => 'Notice', + 'is_secret' => 'Secret', + 'tags' => 'Tag', + 'readed_count' => 'Number of Views (over)', + 'voted_count' => 'Number of Votes (over)', + 'comment_count ' => 'Number of Comments (over)', + 'trackback_count ' => 'Number of Trackbacks (over)', + 'uploaded_count ' => 'Number of Attachments (over)', + 'regdate' => 'Date', + 'last_update' => 'Last Modified Date', + 'ipaddress' => 'IP Address', + ); + + $lang->alias = "Alias"; + $lang->history = "History"; + $lang->about_use_history = "History can restore documents to previous revisions"; + $lang->trace_only = "Trace only"; + + $lang->cmd_trash = 'Trashcan'; + $lang->cmd_restore = 'Restore'; + $lang->cmd_restore_all = 'Restore All'; + + $lang->in_trash = 'Trashcan'; + $lang->trash_nick_name = 'Deleter'; + $lang->trash_date = 'Deleted date'; + $lang->trash_description = 'Description'; + + $lang->search_target_trash_list = array( + 'title' => 'Title', + 'content' => 'Content', + 'user_id' => 'User ID', + 'member_srl' => 'Member srl', + 'user_name' => 'User name', + 'nick_name' => 'Nickname', + 'trash_member_srl' => 'Deleter srl', + 'trash_user_name' => 'Deleter name', + 'trash_nick_name' => 'Deleter nickname', + 'trash_date' => 'Deleted date', + 'trash_ipaddress' => 'Deleter IP address', + ); + + $lang->success_trashed = "Successfully moved to trashcan"; + $lang->msg_not_selected_document = 'There is no selected article.'; + $lang->show_voted_member = 'Show Voters'; +?> diff --git a/modules/document/lang/es.lang.php b/modules/document/lang/es.lang.php index 70c9eeeb4..49fa642e6 100644 --- a/modules/document/lang/es.lang.php +++ b/modules/document/lang/es.lang.php @@ -1,82 +1,82 @@ -document_list = 'Document list'; - $lang->thumbnail_type = 'Thumbnail Type'; - $lang->thumbnail_crop = 'Crop'; - $lang->thumbnail_ratio = 'Ratio'; - $lang->cmd_delete_all_thumbnail = 'Delete all thumbnails'; - $lang->move_target_module = "Módulo para cambiar de posición"; - $lang->title_bold = 'Bold'; - $lang->title_color = 'Color'; - $lang->new_document_count = '새글'; - - $lang->parent_category_title = 'Categoría Superior'; - $lang->category_title = 'Nombre de la categoría'; - $lang->category_color = '분류 폰트색깔'; - $lang->expand = 'Expandir'; - $lang->category_group_srls = 'Limitar el grupo'; - $lang->cmd_make_child = 'Agregar sub categoría'; - $lang->cmd_enable_move_category = "Cambiar la posición de la categoría. (arrastrar y soltar luego de haber selecionado)"; - $lang->about_category_title = 'Ingresar el nombre de la categoría.'; - $lang->about_expand = 'Si seleccionas esta opción, siempre estará expandido.'; - $lang->about_category_group_srls = '선택하신 그룹만 현재 카테고리를 지정할 수 있도록 합니다'; - $lang->about_category_color = '분류 폰트색깔을 지정합니다.'; - - $lang->cmd_search_next = 'Buscar siguiente'; - - $lang->cmd_temp_save = 'Guardar Temporales'; - - $lang->cmd_toggle_checked_document = 'Invertir los elementos seleccionados'; - $lang->cmd_delete_checked_document = 'Eliminar lo seleccionado'; - $lang->cmd_document_do = 'Usted ..'; - - $lang->msg_cart_is_null = 'Selecciona el documento que desea eliminar'; - $lang->msg_category_not_moved = 'No puede se movido'; - $lang->msg_is_secret = 'Es un documento secreto'; - $lang->msg_checked_document_is_deleted = 'Total de %d documentos han sido eliminados'; - - // Objetivo de búsqueda en la página del administrador - $lang->search_target_list = array( - 'title' => 'Título', - 'content' => 'Contenido', - 'user_id' => 'ID', - 'member_srl' => 'Número del usuario', - 'user_name' => 'Nombre del usuario', - 'nick_name' => 'Apodo', - 'email_address' => 'Correo Electrónico', - 'homepage' => 'Página web', - 'is_notice' => 'Aviso', - 'is_secret' => 'Secreto', - 'tags' => 'Etiqueta', - 'readed_count' => 'Número de leídos (sobre)', - 'voted_count' => 'Número de recomnedados (sobre)', - 'comment_count ' => 'Número de comentarios (sobre)', - 'trackback_count ' => 'Número de Trackback (sobre)', - 'uploaded_count ' => 'Número de archivos adjuntos (sobre)', - 'regdate' => 'Día del registro', - 'last_update' => 'Día de la última actualización', - 'ipaddress' => 'Dirección IP', - ); - $lang->alias = "Alias"; - $lang->history = "히스토리"; - $lang->about_use_history = "히스토리 기능의 사용여부를 지정합니다. 히스토리 기능을 사용할 경우 문서 수정시 이전 리비전을 기록하고 복원할 수 있습니다."; - $lang->trace_only = "흔적만 남김"; - - $lang->cmd_trash = 'Trashcan'; - $lang->cmd_restore = 'Restore'; - $lang->cmd_restore_all = 'Restore All'; - - $lang->in_trash = 'Trashcan'; - $lang->trash_nick_name = 'Person who deleted'; - $lang->trash_date = 'Deleted date'; - $lang->trash_description = 'Description'; - - $lang->success_trashed = "Successfully moved to trashcan"; - $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; - $lang->show_voted_member = '사용자 노출'; -?> +document_list = 'Document list'; + $lang->thumbnail_type = 'Thumbnail Type'; + $lang->thumbnail_crop = 'Crop'; + $lang->thumbnail_ratio = 'Ratio'; + $lang->cmd_delete_all_thumbnail = 'Delete all thumbnails'; + $lang->move_target_module = "Módulo para cambiar de posición"; + $lang->title_bold = 'Bold'; + $lang->title_color = 'Color'; + $lang->new_document_count = '새글'; + + $lang->parent_category_title = 'Categoría Superior'; + $lang->category_title = 'Nombre de la categoría'; + $lang->category_color = '분류 폰트색깔'; + $lang->expand = 'Expandir'; + $lang->category_group_srls = 'Limitar el grupo'; + $lang->cmd_make_child = 'Agregar sub categoría'; + $lang->cmd_enable_move_category = "Cambiar la posición de la categoría. (arrastrar y soltar luego de haber selecionado)"; + $lang->about_category_title = 'Ingresar el nombre de la categoría.'; + $lang->about_expand = 'Si seleccionas esta opción, siempre estará expandido.'; + $lang->about_category_group_srls = '선택하신 그룹만 현재 카테고리를 지정할 수 있도록 합니다'; + $lang->about_category_color = '분류 폰트색깔을 지정합니다.'; + + $lang->cmd_search_next = 'Buscar siguiente'; + + $lang->cmd_temp_save = 'Guardar Temporales'; + + $lang->cmd_toggle_checked_document = 'Invertir los elementos seleccionados'; + $lang->cmd_delete_checked_document = 'Eliminar lo seleccionado'; + $lang->cmd_document_do = 'Usted ..'; + + $lang->msg_cart_is_null = 'Selecciona el documento que desea eliminar'; + $lang->msg_category_not_moved = 'No puede se movido'; + $lang->msg_is_secret = 'Es un documento secreto'; + $lang->msg_checked_document_is_deleted = 'Total de %d documentos han sido eliminados'; + + // Objetivo de búsqueda en la página del administrador + $lang->search_target_list = array( + 'title' => 'Título', + 'content' => 'Contenido', + 'user_id' => 'ID', + 'member_srl' => 'Número del usuario', + 'user_name' => 'Nombre del usuario', + 'nick_name' => 'Apodo', + 'email_address' => 'Correo Electrónico', + 'homepage' => 'Página web', + 'is_notice' => 'Aviso', + 'is_secret' => 'Secreto', + 'tags' => 'Etiqueta', + 'readed_count' => 'Número de leídos (sobre)', + 'voted_count' => 'Número de recomnedados (sobre)', + 'comment_count ' => 'Número de comentarios (sobre)', + 'trackback_count ' => 'Número de Trackback (sobre)', + 'uploaded_count ' => 'Número de archivos adjuntos (sobre)', + 'regdate' => 'Día del registro', + 'last_update' => 'Día de la última actualización', + 'ipaddress' => 'Dirección IP', + ); + $lang->alias = "Alias"; + $lang->history = "히스토리"; + $lang->about_use_history = "히스토리 기능의 사용여부를 지정합니다. 히스토리 기능을 사용할 경우 문서 수정시 이전 리비전을 기록하고 복원할 수 있습니다."; + $lang->trace_only = "흔적만 남김"; + + $lang->cmd_trash = 'Trashcan'; + $lang->cmd_restore = 'Restore'; + $lang->cmd_restore_all = 'Restore All'; + + $lang->in_trash = 'Trashcan'; + $lang->trash_nick_name = 'Person who deleted'; + $lang->trash_date = 'Deleted date'; + $lang->trash_description = 'Description'; + + $lang->success_trashed = "Successfully moved to trashcan"; + $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; + $lang->show_voted_member = '사용자 노출'; +?> diff --git a/modules/document/lang/fr.lang.php b/modules/document/lang/fr.lang.php index 402957433..68966b8f2 100644 --- a/modules/document/lang/fr.lang.php +++ b/modules/document/lang/fr.lang.php @@ -1,83 +1,83 @@ - - * @brief Paquet du langage en français pour le module de Document - **/ - - $lang->document_list = 'Liste des Documents'; - $lang->thumbnail_type = 'Type de la Vignette'; - $lang->thumbnail_crop = 'Rogner'; - $lang->thumbnail_ratio = 'Proportion'; - $lang->cmd_delete_all_thumbnail = 'Supprimer toutes les vignettes'; - $lang->title_bold = 'Gras'; - $lang->title_color = 'Couleur'; - $lang->new_document_count = '새글'; - - $lang->parent_category_title = 'catégorie supérieure'; - $lang->category_title = 'Catégorie'; - $lang->category_color = '분류 폰트색깔'; - $lang->expand = 'Etendre'; - $lang->category_group_srls = 'Groupe Accessible'; - $lang->cmd_make_child = 'Ajouter une catégorie inférieure'; - $lang->cmd_enable_move_category = "Bouger la position de la catégorie (Cochez la case et puis glisser la catégorie que vous voulez déplacer)"; - $lang->about_category_title = 'Entrez le nom de la catégorie, S.V.P.'; - $lang->about_expand = 'Si vous cochez la case à cocher, ce sera toujours tendu'; - $lang->about_category_group_srls = 'Le groupe choisi seulement pourra utiliser la catégorie courante'; - $lang->about_category_color = 'You can set font color of category.'; - - $lang->cmd_search_next = 'Recherche Suivante'; - - $lang->cmd_temp_save = 'Conserver temporairement'; - - $lang->cmd_toggle_checked_document = 'Renverser les choisis'; - $lang->cmd_delete_checked_document = 'Supprimer les choisis'; - $lang->cmd_document_do = 'Vous voudriez..'; - - $lang->msg_cart_is_null = 'Choisissez les articles à supprimer, S.V.P.'; - $lang->msg_category_not_moved = 'Ne peut(peuvent) pas être bougé(s)'; - $lang->msg_is_secret = 'Cet article est secret'; - $lang->msg_checked_document_is_deleted = '%d article(s) est(sont) supprimé(s)'; - - $lang->move_target_module = "Module à déménager"; - - // Search targets in admin page - $lang->search_target_list = array( - 'title' => 'Titre', - 'content' => 'Contenu', - 'user_id' => 'Compte', - 'member_srl' => 'Numéro de Série du Membre', - 'user_name' => 'Nom', - 'nick_name' => 'Surnom', - 'email_address' => 'Mél', - 'homepage' => 'Page d\'accueil', - 'is_notice' => 'Notice', - 'is_secret' => 'Secret', - 'tags' => 'Balises', - 'readed_count' => 'Vues (surplus)', - 'voted_count' => 'Recommandés (surplus)', - 'comment_count ' => 'Commentaires (surplus)', - 'trackback_count ' => 'Rétroliens (surplus)', - 'uploaded_count ' => 'Fichiers Attachés (surplus)', - 'regdate' => 'Enrégistré', - 'last_update' => 'La Dernière Mise à Jour', - 'ipaddress' => 'Adresse IP', - ); - $lang->alias = "Alias"; - $lang->history = "히스토리"; - $lang->about_use_history = "히스토리 기능의 사용여부를 지정합니다. 히스토리 기능을 사용할 경우 문서 수정시 이전 리비전을 기록하고 복원할 수 있습니다."; - $lang->trace_only = "흔적만 남김"; - - $lang->cmd_trash = 'Trashcan'; - $lang->cmd_restore = 'Restore'; - $lang->cmd_restore_all = 'Restore All'; - - $lang->in_trash = 'Trashcan'; - $lang->trash_nick_name = 'Person who deleted'; - $lang->trash_date = 'Deleted date'; - $lang->trash_description = 'Description'; - - $lang->success_trashed = "Successfully moved to trashcan"; - $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; - $lang->show_voted_member = '사용자 노출'; -?> + + * @brief Paquet du langage en français pour le module de Document + **/ + + $lang->document_list = 'Liste des Documents'; + $lang->thumbnail_type = 'Type de la Vignette'; + $lang->thumbnail_crop = 'Rogner'; + $lang->thumbnail_ratio = 'Proportion'; + $lang->cmd_delete_all_thumbnail = 'Supprimer toutes les vignettes'; + $lang->title_bold = 'Gras'; + $lang->title_color = 'Couleur'; + $lang->new_document_count = '새글'; + + $lang->parent_category_title = 'catégorie supérieure'; + $lang->category_title = 'Catégorie'; + $lang->category_color = '분류 폰트색깔'; + $lang->expand = 'Etendre'; + $lang->category_group_srls = 'Groupe Accessible'; + $lang->cmd_make_child = 'Ajouter une catégorie inférieure'; + $lang->cmd_enable_move_category = "Bouger la position de la catégorie (Cochez la case et puis glisser la catégorie que vous voulez déplacer)"; + $lang->about_category_title = 'Entrez le nom de la catégorie, S.V.P.'; + $lang->about_expand = 'Si vous cochez la case à cocher, ce sera toujours tendu'; + $lang->about_category_group_srls = 'Le groupe choisi seulement pourra utiliser la catégorie courante'; + $lang->about_category_color = 'You can set font color of category.'; + + $lang->cmd_search_next = 'Recherche Suivante'; + + $lang->cmd_temp_save = 'Conserver temporairement'; + + $lang->cmd_toggle_checked_document = 'Renverser les choisis'; + $lang->cmd_delete_checked_document = 'Supprimer les choisis'; + $lang->cmd_document_do = 'Vous voudriez..'; + + $lang->msg_cart_is_null = 'Choisissez les articles à supprimer, S.V.P.'; + $lang->msg_category_not_moved = 'Ne peut(peuvent) pas être bougé(s)'; + $lang->msg_is_secret = 'Cet article est secret'; + $lang->msg_checked_document_is_deleted = '%d article(s) est(sont) supprimé(s)'; + + $lang->move_target_module = "Module à déménager"; + + // Search targets in admin page + $lang->search_target_list = array( + 'title' => 'Titre', + 'content' => 'Contenu', + 'user_id' => 'Compte', + 'member_srl' => 'Numéro de Série du Membre', + 'user_name' => 'Nom', + 'nick_name' => 'Surnom', + 'email_address' => 'Mél', + 'homepage' => 'Page d\'accueil', + 'is_notice' => 'Notice', + 'is_secret' => 'Secret', + 'tags' => 'Balises', + 'readed_count' => 'Vues (surplus)', + 'voted_count' => 'Recommandés (surplus)', + 'comment_count ' => 'Commentaires (surplus)', + 'trackback_count ' => 'Rétroliens (surplus)', + 'uploaded_count ' => 'Fichiers Attachés (surplus)', + 'regdate' => 'Enrégistré', + 'last_update' => 'La Dernière Mise à Jour', + 'ipaddress' => 'Adresse IP', + ); + $lang->alias = "Alias"; + $lang->history = "히스토리"; + $lang->about_use_history = "히스토리 기능의 사용여부를 지정합니다. 히스토리 기능을 사용할 경우 문서 수정시 이전 리비전을 기록하고 복원할 수 있습니다."; + $lang->trace_only = "흔적만 남김"; + + $lang->cmd_trash = 'Trashcan'; + $lang->cmd_restore = 'Restore'; + $lang->cmd_restore_all = 'Restore All'; + + $lang->in_trash = 'Trashcan'; + $lang->trash_nick_name = 'Person who deleted'; + $lang->trash_date = 'Deleted date'; + $lang->trash_description = 'Description'; + + $lang->success_trashed = "Successfully moved to trashcan"; + $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; + $lang->show_voted_member = '사용자 노출'; +?> diff --git a/modules/document/lang/jp.lang.php b/modules/document/lang/jp.lang.php index 756a54e7c..3712e05bf 100644 --- a/modules/document/lang/jp.lang.php +++ b/modules/document/lang/jp.lang.php @@ -1,101 +1,101 @@ -document_list = 'ドキュメントリスト'; - $lang->thumbnail_type = 'サムネールタイプ'; - $lang->thumbnail_crop = 'トリミングする'; - $lang->thumbnail_ratio = '比率に合わせる'; - $lang->cmd_delete_all_thumbnail = 'すべてのサムネール削除'; - $lang->title_bold = 'タイトル太字'; - $lang->title_color = 'タイトルの色'; - $lang->new_document_count = '新規'; - - $lang->parent_category_title = '上位カテゴリ名'; - $lang->category_title = 'カテゴリ名'; - $lang->category_color = 'カテゴリフォント色'; - $lang->expand = '拡張表示'; - $lang->category_group_srls = 'グループ制限'; - - $lang->cmd_make_child = '下位カテゴリ追加'; - $lang->cmd_enable_move_category = 'カテゴリ位置変更(選択後上のメニューをドラッグして下さい)'; - - $lang->about_category_title = 'カテゴリ名を入力して下さい。'; - $lang->about_expand = 'チェックすると常に展開された状態になります。'; - $lang->about_category_group_srls = '選択したグループのみ、現在のカテゴリの指定が出来ます。'; - $lang->about_category_color = 'カテゴリのフォント色を設定します。'; - - $lang->cmd_search_next = '継続検索'; - - $lang->cmd_temp_save = '一時保存'; - - $lang->cmd_toggle_checked_document = '選択項目反転'; - $lang->cmd_delete_checked_document = '選択項目削除'; - $lang->cmd_document_do = 'この書き込みを..'; - - $lang->msg_cart_is_null = '削除する書き込みを選択して下さい。'; - $lang->msg_category_not_moved = '移動出来ません。'; - $lang->msg_is_secret = '非公開設定の書き込みです。'; - $lang->msg_checked_document_is_deleted = '%d個の書き込みが削除されました。'; - - $lang->move_target_module = '移動対象モジュール'; - - // 管理者ページで検索する内容 - $lang->search_target_list = array( - 'title' => 'タイトル', - 'content' => '内容', - 'user_id' => 'ユーザーID', - 'member_srl' => '会員番号', - 'user_name' => 'ユーザ名', - 'nick_name' => 'ニックネーム', - 'email_address' => 'メールアドレス', - 'homepage' => 'ホームページURL', - 'is_notice' => 'お知らせ', - 'is_secret' => '非公開書き込み', - 'tags' => 'タグ', - 'readed_count' => '閲覧数(以上)', - 'voted_count' => '推薦数(以上)', - 'comment_count ' => 'コメント数(以上)', - 'trackback_count ' => 'トラックバック数(以上)', - 'uploaded_count ' => '添付ファイル数(以上)', - 'regdate' => '登録日', - 'last_update' => '最近修正日', - 'ipaddress' => 'IPアドレス', - ); - - $lang->alias = 'アリアス(Alias)'; - $lang->history = '履歴'; - $lang->about_use_history = '履歴機能を使用するかを設定します。履歴機能を使用すると文書修正のバージョンを管理し、過去のバージョンから復元することも可能です。'; - $lang->trace_only = '記録だけ残す'; - - $lang->cmd_trash = "ごみ箱"; - $lang->cmd_restore = "差し戻し"; - $lang->cmd_restore_all = "すべて差し戻し"; - - $lang->in_trash = "ごみ箱"; - $lang->trash_nick_name = "削除者のニックネーム"; - $lang->trash_date = "削除日"; - $lang->trash_description = "理由"; - - // 管理者ページでのごみ箱の検索対象 - $lang->search_target_trash_list = array( - 'title' => 'タイトル', - 'content' => '内容', - 'user_id' => 'ユーザーID', - 'member_srl' => '会員番号', - 'user_name' => 'ユーザー名', - 'nick_name' => 'ニックネーム', - 'trash_member_srl' => '削除者会員番号', - 'trash_user_name' => '削除者ユーザー名', - 'trash_nick_name' => '削除者ニックネーム', - 'trash_date' => '削除日', - 'trash_ipaddress' => '削除者のIPアドレス', - ); - - $lang->success_trashed = "ごみ箱に移動させました。"; - $lang->msg_not_selected_document = '選択された書き込みがありません。'; - $lang->show_voted_member = '사용자 노출'; -?> +document_list = 'ドキュメントリスト'; + $lang->thumbnail_type = 'サムネールタイプ'; + $lang->thumbnail_crop = 'トリミングする'; + $lang->thumbnail_ratio = '比率に合わせる'; + $lang->cmd_delete_all_thumbnail = 'すべてのサムネール削除'; + $lang->title_bold = 'タイトル太字'; + $lang->title_color = 'タイトルの色'; + $lang->new_document_count = '新規'; + + $lang->parent_category_title = '上位カテゴリ名'; + $lang->category_title = 'カテゴリ名'; + $lang->category_color = 'カテゴリフォント色'; + $lang->expand = '拡張表示'; + $lang->category_group_srls = 'グループ制限'; + + $lang->cmd_make_child = '下位カテゴリ追加'; + $lang->cmd_enable_move_category = 'カテゴリ位置変更(選択後上のメニューをドラッグして下さい)'; + + $lang->about_category_title = 'カテゴリ名を入力して下さい。'; + $lang->about_expand = 'チェックすると常に展開された状態になります。'; + $lang->about_category_group_srls = '選択したグループのみ、現在のカテゴリの指定が出来ます。'; + $lang->about_category_color = 'カテゴリのフォント色を設定します。'; + + $lang->cmd_search_next = '継続検索'; + + $lang->cmd_temp_save = '一時保存'; + + $lang->cmd_toggle_checked_document = '選択項目反転'; + $lang->cmd_delete_checked_document = '選択項目削除'; + $lang->cmd_document_do = 'この書き込みを..'; + + $lang->msg_cart_is_null = '削除する書き込みを選択して下さい。'; + $lang->msg_category_not_moved = '移動出来ません。'; + $lang->msg_is_secret = '非公開設定の書き込みです。'; + $lang->msg_checked_document_is_deleted = '%d個の書き込みが削除されました。'; + + $lang->move_target_module = '移動対象モジュール'; + + // 管理者ページで検索する内容 + $lang->search_target_list = array( + 'title' => 'タイトル', + 'content' => '内容', + 'user_id' => 'ユーザーID', + 'member_srl' => '会員番号', + 'user_name' => 'ユーザ名', + 'nick_name' => 'ニックネーム', + 'email_address' => 'メールアドレス', + 'homepage' => 'ホームページURL', + 'is_notice' => 'お知らせ', + 'is_secret' => '非公開書き込み', + 'tags' => 'タグ', + 'readed_count' => '閲覧数(以上)', + 'voted_count' => '推薦数(以上)', + 'comment_count ' => 'コメント数(以上)', + 'trackback_count ' => 'トラックバック数(以上)', + 'uploaded_count ' => '添付ファイル数(以上)', + 'regdate' => '登録日', + 'last_update' => '最近修正日', + 'ipaddress' => 'IPアドレス', + ); + + $lang->alias = 'アリアス(Alias)'; + $lang->history = '履歴'; + $lang->about_use_history = '履歴機能を使用するかを設定します。履歴機能を使用すると文書修正のバージョンを管理し、過去のバージョンから復元することも可能です。'; + $lang->trace_only = '記録だけ残す'; + + $lang->cmd_trash = "ごみ箱"; + $lang->cmd_restore = "差し戻し"; + $lang->cmd_restore_all = "すべて差し戻し"; + + $lang->in_trash = "ごみ箱"; + $lang->trash_nick_name = "削除者のニックネーム"; + $lang->trash_date = "削除日"; + $lang->trash_description = "理由"; + + // 管理者ページでのごみ箱の検索対象 + $lang->search_target_trash_list = array( + 'title' => 'タイトル', + 'content' => '内容', + 'user_id' => 'ユーザーID', + 'member_srl' => '会員番号', + 'user_name' => 'ユーザー名', + 'nick_name' => 'ニックネーム', + 'trash_member_srl' => '削除者会員番号', + 'trash_user_name' => '削除者ユーザー名', + 'trash_nick_name' => '削除者ニックネーム', + 'trash_date' => '削除日', + 'trash_ipaddress' => '削除者のIPアドレス', + ); + + $lang->success_trashed = "ごみ箱に移動させました。"; + $lang->msg_not_selected_document = '選択された書き込みがありません。'; + $lang->show_voted_member = '사용자 노출'; +?> diff --git a/modules/document/lang/ru.lang.php b/modules/document/lang/ru.lang.php index c91135b9a..506b3d09f 100644 --- a/modules/document/lang/ru.lang.php +++ b/modules/document/lang/ru.lang.php @@ -1,105 +1,105 @@ -document_list = 'Список документов'; - $lang->thumbnail_type = 'Тип миниатюры'; - $lang->thumbnail_crop = 'Обрезать'; - $lang->thumbnail_ratio = 'Соотношение'; - $lang->cmd_delete_all_thumbnail = 'Удалить все миниарюры'; - $lang->move_target_module = "Переместить в"; - $lang->title_bold = 'Жирное название'; - $lang->title_color = 'Цвет названия'; - $lang->new_document_count = 'Новые документы'; - - $lang->parent_category_title = 'Название верхней категории'; - $lang->category_title = 'Категория'; - $lang->category_color = 'Цвет шрифта категории'; - $lang->expand = 'Развернуть'; - $lang->category_group_srls = 'Доступные группы'; - - $lang->about_category_title = 'Добавьте дочернюю категорию'; - $lang->cmd_enable_move_category = 'Изменить местоположение категории(после выделения перетащите верхнее меню)'; - - $lang->about_category_title = 'Введите название категории'; - $lang->about_expand = 'Если эта опция выбрана, расширение будут применено всегда'; - $lang->about_category_group_srls = 'Только выбранные группы можно отнести к этой категории'; - $lang->about_category_color = 'Установить цвет шрифта категории. ex) red или #ff0000'; - - $lang->cmd_search_next = 'Искать дальше'; - - $lang->about_category_color = '분류 폰트색깔을 지정합니다.'; - $lang->cmd_temp_save = 'Сохранить временно'; - - $lang->cmd_toggle_checked_document = 'Перевернуть выбранные объекты'; - $lang->cmd_delete_checked_document = 'Удалить выбранные'; - $lang->cmd_document_do = 'Эту запись...'; - - $lang->msg_cart_is_null = 'Выберите записи,которые Вы хотите удалить'; - $lang->msg_category_not_moved = 'Невозможно переместить'; - $lang->msg_is_secret = 'Секретная запись'; - $lang->msg_checked_document_is_deleted = '%d записей удалено'; - - $lang->move_target_module = 'Этот модуль'; - - // Search targets in admin page - $lang->search_target_list = array( - 'title' => 'Тема', - 'content' => 'Содержание', - 'user_id' => 'ID пользователя', - 'member_srl' => 'No. пользователя', - 'user_name' => 'Имя пользователя', - 'nick_name' => 'Ник', - 'email_address' => 'Email', - 'homepage' => 'Домашняя страница', - 'is_notice' => 'Объявления', - 'is_secret' => 'Секретная запись', - 'tags' => 'Тег', - 'readed_count' => 'Количество просмотров (свыше)', - 'voted_count' => 'Количество голосов (свыше)', - 'comment_count ' => 'Количество записей (свыше)', - 'trackback_count ' => 'Количество трекбеков (свыше)', - 'uploaded_count ' => 'Количество вложений (прикрепленных файлов) (свыше)', - 'regdate' => 'Дата регистрации', - 'last_update' => 'Дата последнего обновления', - 'ipaddress' => 'IP-Адрес', - ); - - $lang->alias = "Alias"; - $lang->history = "History"; - $lang->about_use_history = "Determine whether to enable history feature, if it is enabled, update history would be stored and possible to restore old revisions."; - $lang->trace_only = "Trace only"; - - $lang->cmd_trash = 'Корзина'; - $lang->cmd_restore = 'Восстановить'; - $lang->cmd_restore_all = 'Восстановить все'; - - $lang->in_trash = 'Корзина'; - $lang->trash_nick_name = 'Ник удалителя'; - $lang->trash_date = 'Дата удаления'; - $lang->trash_description = 'Описание'; - - // Возможен поиск на странице админа - $lang->search_target_trash_list = array( - 'title' => 'Тема', - 'content' => 'Содержание', - 'user_id' => 'ID', - 'member_srl' =>'No пользователя', - 'user_name' => 'Имя пользователя', - 'nick_name' => 'Ник', - 'trash_member_srl' => 'Номер удалителя', - 'trash_user_name' => 'Имя удалителя', - 'trash_nick_name' => 'Ник удалителя', - 'trash_date' => 'Дата удаления', - 'trash_ipaddress' => 'IP адрес удалителя', - ); - - $lang->success_trashed = 'Удалено в корзину'; - - $lang->success_trashed = "Successfully moved to trashcan"; - $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; - $lang->show_voted_member = '사용자 노출'; -?> +document_list = 'Список документов'; + $lang->thumbnail_type = 'Тип миниатюры'; + $lang->thumbnail_crop = 'Обрезать'; + $lang->thumbnail_ratio = 'Соотношение'; + $lang->cmd_delete_all_thumbnail = 'Удалить все миниарюры'; + $lang->move_target_module = "Переместить в"; + $lang->title_bold = 'Жирное название'; + $lang->title_color = 'Цвет названия'; + $lang->new_document_count = 'Новые документы'; + + $lang->parent_category_title = 'Название верхней категории'; + $lang->category_title = 'Категория'; + $lang->category_color = 'Цвет шрифта категории'; + $lang->expand = 'Развернуть'; + $lang->category_group_srls = 'Доступные группы'; + + $lang->about_category_title = 'Добавьте дочернюю категорию'; + $lang->cmd_enable_move_category = 'Изменить местоположение категории(после выделения перетащите верхнее меню)'; + + $lang->about_category_title = 'Введите название категории'; + $lang->about_expand = 'Если эта опция выбрана, расширение будут применено всегда'; + $lang->about_category_group_srls = 'Только выбранные группы можно отнести к этой категории'; + $lang->about_category_color = 'Установить цвет шрифта категории. ex) red или #ff0000'; + + $lang->cmd_search_next = 'Искать дальше'; + + $lang->about_category_color = '분류 폰트색깔을 지정합니다.'; + $lang->cmd_temp_save = 'Сохранить временно'; + + $lang->cmd_toggle_checked_document = 'Перевернуть выбранные объекты'; + $lang->cmd_delete_checked_document = 'Удалить выбранные'; + $lang->cmd_document_do = 'Эту запись...'; + + $lang->msg_cart_is_null = 'Выберите записи,которые Вы хотите удалить'; + $lang->msg_category_not_moved = 'Невозможно переместить'; + $lang->msg_is_secret = 'Секретная запись'; + $lang->msg_checked_document_is_deleted = '%d записей удалено'; + + $lang->move_target_module = 'Этот модуль'; + + // Search targets in admin page + $lang->search_target_list = array( + 'title' => 'Тема', + 'content' => 'Содержание', + 'user_id' => 'ID пользователя', + 'member_srl' => 'No. пользователя', + 'user_name' => 'Имя пользователя', + 'nick_name' => 'Ник', + 'email_address' => 'Email', + 'homepage' => 'Домашняя страница', + 'is_notice' => 'Объявления', + 'is_secret' => 'Секретная запись', + 'tags' => 'Тег', + 'readed_count' => 'Количество просмотров (свыше)', + 'voted_count' => 'Количество голосов (свыше)', + 'comment_count ' => 'Количество записей (свыше)', + 'trackback_count ' => 'Количество трекбеков (свыше)', + 'uploaded_count ' => 'Количество вложений (прикрепленных файлов) (свыше)', + 'regdate' => 'Дата регистрации', + 'last_update' => 'Дата последнего обновления', + 'ipaddress' => 'IP-Адрес', + ); + + $lang->alias = "Alias"; + $lang->history = "History"; + $lang->about_use_history = "Determine whether to enable history feature, if it is enabled, update history would be stored and possible to restore old revisions."; + $lang->trace_only = "Trace only"; + + $lang->cmd_trash = 'Корзина'; + $lang->cmd_restore = 'Восстановить'; + $lang->cmd_restore_all = 'Восстановить все'; + + $lang->in_trash = 'Корзина'; + $lang->trash_nick_name = 'Ник удалителя'; + $lang->trash_date = 'Дата удаления'; + $lang->trash_description = 'Описание'; + + // Возможен поиск на странице админа + $lang->search_target_trash_list = array( + 'title' => 'Тема', + 'content' => 'Содержание', + 'user_id' => 'ID', + 'member_srl' =>'No пользователя', + 'user_name' => 'Имя пользователя', + 'nick_name' => 'Ник', + 'trash_member_srl' => 'Номер удалителя', + 'trash_user_name' => 'Имя удалителя', + 'trash_nick_name' => 'Ник удалителя', + 'trash_date' => 'Дата удаления', + 'trash_ipaddress' => 'IP адрес удалителя', + ); + + $lang->success_trashed = 'Удалено в корзину'; + + $lang->success_trashed = "Successfully moved to trashcan"; + $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; + $lang->show_voted_member = '사용자 노출'; +?> diff --git a/modules/document/lang/tr.lang.php b/modules/document/lang/tr.lang.php index 7aeb53892..8267c0947 100644 --- a/modules/document/lang/tr.lang.php +++ b/modules/document/lang/tr.lang.php @@ -1,99 +1,99 @@ -document_list = 'Belge Listesi'; - $lang->thumbnail_type = 'Küçük Resim Türü'; - $lang->thumbnail_crop = 'Kırpılmış'; - $lang->thumbnail_ratio = 'Oran'; - $lang->cmd_delete_all_thumbnail = 'Tüm küçük resimleri sil'; - $lang->move_target_module = "Hedef modül "; - $lang->title_bold = 'Kalın'; - $lang->title_color = 'Renk'; - $lang->new_document_count = 'Yeni belgeler'; - - $lang->parent_category_title = 'Üst Kategori'; - $lang->category_title = 'Kategori'; - $lang->category_color = 'Kategori Yazı Rengi'; - $lang->expand = 'Genişlet'; - $lang->category_group_srls = 'Erişilebilir Grup'; - - $lang->cmd_make_child = 'Alt Kategori Ekle'; - $lang->cmd_enable_move_category = "Kategori konumunu değiştir (Seçtikten sonra anamenüyü taşıyınız)"; - - $lang->about_category_title = 'Lütfen kategori ismi giriniz'; - $lang->about_expand = 'Bu seçimle, her zaman genişletilmiş olacaktır'; - $lang->about_category_group_srls = 'Sadece seçilen grup geçerli kategoriyi kullanabilecektir'; - $lang->about_category_color = 'Kategorinin yazı rengini ayarlayabilirsiniz.'; - - $lang->cmd_search_next = 'Sonrakini Ara'; - - $lang->cmd_temp_save = 'Geçiçi olarak Kaydet'; - - $lang->cmd_toggle_checked_document = 'Seçili ögeleri ters çevir'; - $lang->cmd_delete_checked_document = 'Seçilenleri Sil'; - $lang->cmd_document_do = 'Şunu yap'; - - $lang->msg_cart_is_null = 'Lütfen silinecek makaleleri seçiniz'; - $lang->msg_category_not_moved = 'Taşınamıyor'; - $lang->msg_is_secret = 'Bu gizli bir makaledir'; - $lang->msg_checked_document_is_deleted = '%d makale silinmiştir'; - - // Search targets in admin page - $lang->search_target_list = array( - 'title' => 'Konu', - 'content' => 'İçerik', - 'user_id' => 'Kullanıcı Kimliği', - 'member_srl' => 'Üye Seri Numarası', - 'user_name' => 'Kullanıcı İsmi', - 'nick_name' => 'Rumuz', - 'email_address' => 'Email', - 'homepage' => 'Anasayfa', - 'is_notice' => 'Bildirim', - 'is_secret' => 'Gizli', - 'tags' => 'Etiket', - 'readed_count' => 'Gösterim Sayısı (over)', - 'voted_count' => 'Oylama Sayısı (over)', - 'comment_count ' => 'Yorum Sayısı (over)', - 'trackback_count ' => 'Geri İzleme Sayısı (over)', - 'uploaded_count ' => 'Eklerin Sayısı (over)', - 'regdate' => 'Tarih', - 'last_update' => 'Son Güncelleme Tarihi', - 'ipaddress' => 'IP Adresi', - ); - - $lang->alias = "Diğer Adıyla"; - $lang->history = "Geçmiş"; - $lang->about_use_history = "Geçmiş, belgeleri önceki değişikliklerine dönüştürmek içindir."; - $lang->trace_only = "Sadece izleme"; - - $lang->cmd_trash = 'Çöp Kutusu'; - $lang->cmd_restore = 'Geri Yükleme'; - $lang->cmd_restore_all = 'Hepsini Geri Yükle'; - - $lang->in_trash = 'Çöp Kutusu'; - $lang->trash_nick_name = 'Silici'; - $lang->trash_date = 'Silinme Tarihi'; - $lang->trash_description = 'Açıklama'; - - $lang->search_target_trash_list = array( - 'title' => 'Başlık', - 'content' => 'İçerik', - 'user_id' => 'Kullanıcı Kimliği', - 'member_srl' => 'Üye Diziseli', - 'user_name' => 'Kullanıcı İsmi', - 'nick_name' => 'Rumuz', - 'trash_member_srl' => 'Silici Diziseli', - 'trash_user_name' => 'Silici İsmi', - 'trash_nick_name' => 'Silici rumuzu', - 'trash_date' => 'Silinme Tarihi', - 'trash_ipaddress' => 'Silici IP adresi', - ); - - $lang->success_trashed = "Başarıyla silindi"; - $lang->msg_not_selected_document = 'Hiçbir makale seçilmedi.'; - $lang->show_voted_member = '사용자 노출'; -?> +document_list = 'Belge Listesi'; + $lang->thumbnail_type = 'Küçük Resim Türü'; + $lang->thumbnail_crop = 'Kırpılmış'; + $lang->thumbnail_ratio = 'Oran'; + $lang->cmd_delete_all_thumbnail = 'Tüm küçük resimleri sil'; + $lang->move_target_module = "Hedef modül "; + $lang->title_bold = 'Kalın'; + $lang->title_color = 'Renk'; + $lang->new_document_count = 'Yeni belgeler'; + + $lang->parent_category_title = 'Üst Kategori'; + $lang->category_title = 'Kategori'; + $lang->category_color = 'Kategori Yazı Rengi'; + $lang->expand = 'Genişlet'; + $lang->category_group_srls = 'Erişilebilir Grup'; + + $lang->cmd_make_child = 'Alt Kategori Ekle'; + $lang->cmd_enable_move_category = "Kategori konumunu değiştir (Seçtikten sonra anamenüyü taşıyınız)"; + + $lang->about_category_title = 'Lütfen kategori ismi giriniz'; + $lang->about_expand = 'Bu seçimle, her zaman genişletilmiş olacaktır'; + $lang->about_category_group_srls = 'Sadece seçilen grup geçerli kategoriyi kullanabilecektir'; + $lang->about_category_color = 'Kategorinin yazı rengini ayarlayabilirsiniz.'; + + $lang->cmd_search_next = 'Sonrakini Ara'; + + $lang->cmd_temp_save = 'Geçiçi olarak Kaydet'; + + $lang->cmd_toggle_checked_document = 'Seçili ögeleri ters çevir'; + $lang->cmd_delete_checked_document = 'Seçilenleri Sil'; + $lang->cmd_document_do = 'Şunu yap'; + + $lang->msg_cart_is_null = 'Lütfen silinecek makaleleri seçiniz'; + $lang->msg_category_not_moved = 'Taşınamıyor'; + $lang->msg_is_secret = 'Bu gizli bir makaledir'; + $lang->msg_checked_document_is_deleted = '%d makale silinmiştir'; + + // Search targets in admin page + $lang->search_target_list = array( + 'title' => 'Konu', + 'content' => 'İçerik', + 'user_id' => 'Kullanıcı Kimliği', + 'member_srl' => 'Üye Seri Numarası', + 'user_name' => 'Kullanıcı İsmi', + 'nick_name' => 'Rumuz', + 'email_address' => 'Email', + 'homepage' => 'Anasayfa', + 'is_notice' => 'Bildirim', + 'is_secret' => 'Gizli', + 'tags' => 'Etiket', + 'readed_count' => 'Gösterim Sayısı (over)', + 'voted_count' => 'Oylama Sayısı (over)', + 'comment_count ' => 'Yorum Sayısı (over)', + 'trackback_count ' => 'Geri İzleme Sayısı (over)', + 'uploaded_count ' => 'Eklerin Sayısı (over)', + 'regdate' => 'Tarih', + 'last_update' => 'Son Güncelleme Tarihi', + 'ipaddress' => 'IP Adresi', + ); + + $lang->alias = "Diğer Adıyla"; + $lang->history = "Geçmiş"; + $lang->about_use_history = "Geçmiş, belgeleri önceki değişikliklerine dönüştürmek içindir."; + $lang->trace_only = "Sadece izleme"; + + $lang->cmd_trash = 'Çöp Kutusu'; + $lang->cmd_restore = 'Geri Yükleme'; + $lang->cmd_restore_all = 'Hepsini Geri Yükle'; + + $lang->in_trash = 'Çöp Kutusu'; + $lang->trash_nick_name = 'Silici'; + $lang->trash_date = 'Silinme Tarihi'; + $lang->trash_description = 'Açıklama'; + + $lang->search_target_trash_list = array( + 'title' => 'Başlık', + 'content' => 'İçerik', + 'user_id' => 'Kullanıcı Kimliği', + 'member_srl' => 'Üye Diziseli', + 'user_name' => 'Kullanıcı İsmi', + 'nick_name' => 'Rumuz', + 'trash_member_srl' => 'Silici Diziseli', + 'trash_user_name' => 'Silici İsmi', + 'trash_nick_name' => 'Silici rumuzu', + 'trash_date' => 'Silinme Tarihi', + 'trash_ipaddress' => 'Silici IP adresi', + ); + + $lang->success_trashed = "Başarıyla silindi"; + $lang->msg_not_selected_document = 'Hiçbir makale seçilmedi.'; + $lang->show_voted_member = '사용자 노출'; +?> diff --git a/modules/document/lang/vi.lang.php b/modules/document/lang/vi.lang.php index 9e7fa67e4..92d36bf05 100644 --- a/modules/document/lang/vi.lang.php +++ b/modules/document/lang/vi.lang.php @@ -1,103 +1,103 @@ -document_list = 'Danh sách bài viết'; - $lang->thumbnail_type = 'Định dạng hình nhỏ'; - $lang->thumbnail_crop = 'Hình cắt'; - $lang->thumbnail_ratio = 'Tỉ lệ'; - $lang->cmd_delete_all_thumbnail = 'Xóa tất cả hình nhỏ'; - $lang->move_target_module = "Vị trí Module"; - $lang->title_bold = 'Chữ đậm'; - $lang->title_color = 'Màu'; - $lang->new_document_count = 'Bài viết mới'; - - $lang->parent_category_title = 'Tên thể loại chính'; - $lang->category_title = 'Tên thể loại nhỏ'; - $lang->category_color = 'Màu chữ'; - $lang->expand = 'Mở rộng'; - $lang->category_group_srls = 'Nhóm được cho phép'; - - $lang->cmd_make_child = 'Thêm thể loại nhỏ'; - $lang->cmd_enable_move_category = "Thay đổi vị trí thể loại (Kéo lên Menu trên sau khi lựa chọn)"; - - $lang->about_category_title = 'Hãy nhập tên thể loại'; - $lang->about_expand = 'Nếu sử dụng tùy chọn này, Thể loại sẽ luôn luôn được trải rộng.'; - $lang->about_category_group_srls = 'Chỉ những nhóm đã chọn mới được phép sử dụng thể loại này.'; - $lang->about_category_color = 'Bạn có thể đặt màu cho thể loại.'; - - $lang->cmd_search_next = 'Tìm tiếp'; - - $lang->cmd_temp_save = 'Lưu tạm thời'; - - $lang->cmd_toggle_checked_document = 'Khôi phục những bài đã chọn'; - $lang->cmd_delete_checked_document = 'Xóa những bài đã chọn'; - $lang->cmd_document_do = 'Bình chọn / Phê bình'; - - $lang->msg_cart_is_null = 'Xin hãy chọn bài viết để xóa.'; - $lang->msg_category_not_moved = 'Không thể di chuyển'; - $lang->msg_is_secret = 'Bài viết này đã đặt bí mật'; - $lang->msg_checked_document_is_deleted = '%d bài viết đã được xóa.'; - - // Search targets in admin page - $lang->search_target_list = array( - 'title' => 'Tiêu đề', - 'content' => 'Nội dung', - 'user_id' => 'ID sử dụng', - 'member_srl' => 'Mã thành viên', - 'user_name' => 'Tên', - 'nick_name' => 'Nickname', - 'email_address' => 'Email', - 'homepage' => 'Trang chủ', - 'is_notice' => 'Chú ý', - 'is_secret' => 'Bí mật', - 'tags' => 'Tag', - 'readed_count' => 'Lượt xem', - 'voted_count' => 'Lượt bình chọn', - 'comment_count ' => 'Số bình luận', - 'trackback_count ' => 'Số liên kết Web', - 'uploaded_count ' => 'Số đính kèm', - 'regdate' => 'Ngày gửi', - 'last_update' => 'Cập nhật lần cuối', - 'ipaddress' => 'IP', - ); - - $lang->alias = "Bí danh"; - $lang->history = "Lịch sử"; - $lang->about_use_history = "Chức năng này sẽ lưu lại những thay đổi trên bài viết. Nếu sử dụng chức năng này, bạn có thể khôi phục lại trạng thái ban đầu của bài viết."; - $lang->trace_only = "Chỉ theo dõi"; - - $lang->cmd_trash = "Thùng rác"; - $lang->cmd_restore = "Khôi phục"; - $lang->cmd_restore_all = "Khôi phục tất cả"; - - $lang->in_trash = "Thùng rác"; - $lang->trash_nick_name = "Người xóa"; - $lang->trash_date = "Ngày xóa"; - $lang->trash_description = "Mô tả"; - - // 관리자 페이지에서 휴지통의 검색할 대상 - $lang->search_target_trash_list = array( - 'title' => 'Tiêu đề', - 'content' => 'Nội dung', - 'user_id' => 'ID', - 'member_srl' => 'Mã số thành viên', - 'user_name' => 'Tên thật', - 'nick_name' => 'NickName', - 'trash_member_srl' => 'Mã số người xóa', - 'trash_user_name' => 'Tên người xóa', - 'trash_nick_name' => 'NickName người xóa', - 'trash_date' => 'Ngày xóa', - 'trash_ipaddress' => 'IP Người xóa', - ); - - $lang->success_trashed = "Đã chuyển tới thùng rác thành công."; - $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; - $lang->show_voted_member = '사용자 노출'; -?> +document_list = 'Danh sách bài viết'; + $lang->thumbnail_type = 'Định dạng hình nhỏ'; + $lang->thumbnail_crop = 'Hình cắt'; + $lang->thumbnail_ratio = 'Tỉ lệ'; + $lang->cmd_delete_all_thumbnail = 'Xóa tất cả hình nhỏ'; + $lang->move_target_module = "Vị trí Module"; + $lang->title_bold = 'Chữ đậm'; + $lang->title_color = 'Màu'; + $lang->new_document_count = 'Bài viết mới'; + + $lang->parent_category_title = 'Tên thể loại chính'; + $lang->category_title = 'Tên thể loại nhỏ'; + $lang->category_color = 'Màu chữ'; + $lang->expand = 'Mở rộng'; + $lang->category_group_srls = 'Nhóm được cho phép'; + + $lang->cmd_make_child = 'Thêm thể loại nhỏ'; + $lang->cmd_enable_move_category = "Thay đổi vị trí thể loại (Kéo lên Menu trên sau khi lựa chọn)"; + + $lang->about_category_title = 'Hãy nhập tên thể loại'; + $lang->about_expand = 'Nếu sử dụng tùy chọn này, Thể loại sẽ luôn luôn được trải rộng.'; + $lang->about_category_group_srls = 'Chỉ những nhóm đã chọn mới được phép sử dụng thể loại này.'; + $lang->about_category_color = 'Bạn có thể đặt màu cho thể loại.'; + + $lang->cmd_search_next = 'Tìm tiếp'; + + $lang->cmd_temp_save = 'Lưu tạm thời'; + + $lang->cmd_toggle_checked_document = 'Khôi phục những bài đã chọn'; + $lang->cmd_delete_checked_document = 'Xóa những bài đã chọn'; + $lang->cmd_document_do = 'Bình chọn / Phê bình'; + + $lang->msg_cart_is_null = 'Xin hãy chọn bài viết để xóa.'; + $lang->msg_category_not_moved = 'Không thể di chuyển'; + $lang->msg_is_secret = 'Bài viết này đã đặt bí mật'; + $lang->msg_checked_document_is_deleted = '%d bài viết đã được xóa.'; + + // Search targets in admin page + $lang->search_target_list = array( + 'title' => 'Tiêu đề', + 'content' => 'Nội dung', + 'user_id' => 'ID sử dụng', + 'member_srl' => 'Mã thành viên', + 'user_name' => 'Tên', + 'nick_name' => 'Nickname', + 'email_address' => 'Email', + 'homepage' => 'Trang chủ', + 'is_notice' => 'Chú ý', + 'is_secret' => 'Bí mật', + 'tags' => 'Tag', + 'readed_count' => 'Lượt xem', + 'voted_count' => 'Lượt bình chọn', + 'comment_count ' => 'Số bình luận', + 'trackback_count ' => 'Số liên kết Web', + 'uploaded_count ' => 'Số đính kèm', + 'regdate' => 'Ngày gửi', + 'last_update' => 'Cập nhật lần cuối', + 'ipaddress' => 'IP', + ); + + $lang->alias = "Bí danh"; + $lang->history = "Lịch sử"; + $lang->about_use_history = "Chức năng này sẽ lưu lại những thay đổi trên bài viết. Nếu sử dụng chức năng này, bạn có thể khôi phục lại trạng thái ban đầu của bài viết."; + $lang->trace_only = "Chỉ theo dõi"; + + $lang->cmd_trash = "Thùng rác"; + $lang->cmd_restore = "Khôi phục"; + $lang->cmd_restore_all = "Khôi phục tất cả"; + + $lang->in_trash = "Thùng rác"; + $lang->trash_nick_name = "Người xóa"; + $lang->trash_date = "Ngày xóa"; + $lang->trash_description = "Mô tả"; + + // 관리자 페이지에서 휴지통의 검색할 대상 + $lang->search_target_trash_list = array( + 'title' => 'Tiêu đề', + 'content' => 'Nội dung', + 'user_id' => 'ID', + 'member_srl' => 'Mã số thành viên', + 'user_name' => 'Tên thật', + 'nick_name' => 'NickName', + 'trash_member_srl' => 'Mã số người xóa', + 'trash_user_name' => 'Tên người xóa', + 'trash_nick_name' => 'NickName người xóa', + 'trash_date' => 'Ngày xóa', + 'trash_ipaddress' => 'IP Người xóa', + ); + + $lang->success_trashed = "Đã chuyển tới thùng rác thành công."; + $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; + $lang->show_voted_member = '사용자 노출'; +?> diff --git a/modules/document/lang/zh-CN.lang.php b/modules/document/lang/zh-CN.lang.php index 1ebf2a1cf..c595af7a2 100644 --- a/modules/document/lang/zh-CN.lang.php +++ b/modules/document/lang/zh-CN.lang.php @@ -1,101 +1,101 @@ -document_list = '主题列表'; - $lang->thumbnail_type = '缩略图生成方式'; - $lang->thumbnail_crop = '裁减(按指定大小裁剪图片)'; - $lang->thumbnail_ratio = '比例(按原图比例缩略处理)'; - $lang->cmd_delete_all_thumbnail = '删除全部缩略图'; - $lang->title_bold = '粗标题'; - $lang->title_color = '标题颜色'; - $lang->new_document_count = '新帖'; - - $lang->parent_category_title = '上级分类名'; - $lang->category_title = '分类名'; - $lang->category_color = '分类颜色'; - $lang->expand = '展开'; - $lang->category_group_srls = '用户组'; - - $lang->cmd_make_child = '添加下级分类'; - $lang->cmd_enable_move_category = "分类顺序(勾选后用鼠标拖动分类项)"; - - $lang->about_category_title = '请输入分类名。'; - $lang->about_expand = '选择此项将维持展开状态。'; - $lang->about_category_group_srls = '所选用户组才可以查看此分类。'; - $lang->about_category_color = '请指定分类颜色(必须带#符号)。ex)#ff0000'; - - $lang->cmd_search_next = '继续搜索'; - - $lang->cmd_temp_save = '临时保存'; - - $lang->cmd_toggle_checked_document = '反选'; - $lang->cmd_delete_checked_document = '删除所选'; - $lang->cmd_document_do = '将把此主题..'; - - $lang->msg_cart_is_null = '请选择要删除的文章。'; - $lang->msg_category_not_moved = '不能移动!'; - $lang->msg_is_secret = '这是密帖!'; - $lang->msg_checked_document_is_deleted = '删除了%d个文章。'; - - $lang->move_target_module = '目标模块'; - - // 管理页面查找的对象 - $lang->search_target_list = array( - 'title' => '标题', - 'content' => '内容', - 'user_id' => 'I D', - 'member_srl' => '会员编号', - 'user_name' => '姓名', - 'nick_name' => '昵称', - 'email_address' => '电子邮件', - 'homepage' => '主页', - 'is_notice' => '公告', - 'is_secret' => '密帖', - 'tags' => '标签', - 'readed_count' => '查看数(以上)', - 'voted_count' => '推荐数(以上)', - 'comment_count ' => '评论数(以上)', - 'trackback_count ' => '引用数(以上)', - 'uploaded_count ' => '上传附件数(以上)', - 'regdate' => '登录日期', - 'last_update' => '最近更新日期', - 'ipaddress' => 'IP 地址', - ); - - $lang->alias = "Alias"; - $lang->history = "历史版本功能"; - $lang->about_use_history = "启用历史版本功能它将记录主题修改版本,并还可以复原到之前版本。"; - $lang->trace_only = "只留痕迹"; - - $lang->cmd_trash = "回收箱"; - $lang->cmd_restore = "复原"; - $lang->cmd_restore_all = "全部复原"; - - $lang->in_trash = "回收箱"; - $lang->trash_nick_name = "操作人昵称"; - $lang->trash_date = "删除日期"; - $lang->trash_description = "说明"; - - // 管理页面回收箱搜索对象 - $lang->search_target_trash_list = array( - 'title' => '标题', - 'content' => '内容', - 'user_id' => '用户名', - 'member_srl' => '会员编号', - 'user_name' => '姓名', - 'nick_name' => '昵称', - 'trash_member_srl' => '操作人会员编号', - 'trash_user_name' => '操作人用户名', - 'trash_nick_name' => '操作人昵称', - 'trash_date' => '删除日期', - 'trash_ipaddress' => '操作人IP地址', - ); - - $lang->success_trashed = '已成功移除到回收箱。'; - $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; - $lang->show_voted_member = '사용자 노출'; -?> +document_list = '主题列表'; + $lang->thumbnail_type = '缩略图生成方式'; + $lang->thumbnail_crop = '裁减(按指定大小裁剪图片)'; + $lang->thumbnail_ratio = '比例(按原图比例缩略处理)'; + $lang->cmd_delete_all_thumbnail = '删除全部缩略图'; + $lang->title_bold = '粗标题'; + $lang->title_color = '标题颜色'; + $lang->new_document_count = '新帖'; + + $lang->parent_category_title = '上级分类名'; + $lang->category_title = '分类名'; + $lang->category_color = '分类颜色'; + $lang->expand = '展开'; + $lang->category_group_srls = '用户组'; + + $lang->cmd_make_child = '添加下级分类'; + $lang->cmd_enable_move_category = "分类顺序(勾选后用鼠标拖动分类项)"; + + $lang->about_category_title = '请输入分类名。'; + $lang->about_expand = '选择此项将维持展开状态。'; + $lang->about_category_group_srls = '所选用户组才可以查看此分类。'; + $lang->about_category_color = '请指定分类颜色(必须带#符号)。ex)#ff0000'; + + $lang->cmd_search_next = '继续搜索'; + + $lang->cmd_temp_save = '临时保存'; + + $lang->cmd_toggle_checked_document = '反选'; + $lang->cmd_delete_checked_document = '删除所选'; + $lang->cmd_document_do = '将把此主题..'; + + $lang->msg_cart_is_null = '请选择要删除的文章。'; + $lang->msg_category_not_moved = '不能移动!'; + $lang->msg_is_secret = '这是密帖!'; + $lang->msg_checked_document_is_deleted = '删除了%d个文章。'; + + $lang->move_target_module = '目标模块'; + + // 管理页面查找的对象 + $lang->search_target_list = array( + 'title' => '标题', + 'content' => '内容', + 'user_id' => 'I D', + 'member_srl' => '会员编号', + 'user_name' => '姓名', + 'nick_name' => '昵称', + 'email_address' => '电子邮件', + 'homepage' => '主页', + 'is_notice' => '公告', + 'is_secret' => '密帖', + 'tags' => '标签', + 'readed_count' => '查看数(以上)', + 'voted_count' => '推荐数(以上)', + 'comment_count ' => '评论数(以上)', + 'trackback_count ' => '引用数(以上)', + 'uploaded_count ' => '上传附件数(以上)', + 'regdate' => '登录日期', + 'last_update' => '最近更新日期', + 'ipaddress' => 'IP 地址', + ); + + $lang->alias = "Alias"; + $lang->history = "历史版本功能"; + $lang->about_use_history = "启用历史版本功能它将记录主题修改版本,并还可以复原到之前版本。"; + $lang->trace_only = "只留痕迹"; + + $lang->cmd_trash = "回收箱"; + $lang->cmd_restore = "复原"; + $lang->cmd_restore_all = "全部复原"; + + $lang->in_trash = "回收箱"; + $lang->trash_nick_name = "操作人昵称"; + $lang->trash_date = "删除日期"; + $lang->trash_description = "说明"; + + // 管理页面回收箱搜索对象 + $lang->search_target_trash_list = array( + 'title' => '标题', + 'content' => '内容', + 'user_id' => '用户名', + 'member_srl' => '会员编号', + 'user_name' => '姓名', + 'nick_name' => '昵称', + 'trash_member_srl' => '操作人会员编号', + 'trash_user_name' => '操作人用户名', + 'trash_nick_name' => '操作人昵称', + 'trash_date' => '删除日期', + 'trash_ipaddress' => '操作人IP地址', + ); + + $lang->success_trashed = '已成功移除到回收箱。'; + $lang->msg_not_selected_document = '선택된 문서가 없습니다.'; + $lang->show_voted_member = '사용자 노출'; +?> diff --git a/modules/document/lang/zh-TW.lang.php b/modules/document/lang/zh-TW.lang.php index 7529bd730..15a15c69a 100644 --- a/modules/document/lang/zh-TW.lang.php +++ b/modules/document/lang/zh-TW.lang.php @@ -1,101 +1,101 @@ -document_list = '主題列表'; - $lang->thumbnail_type = '縮圖建立方式'; - $lang->thumbnail_crop = '裁減'; - $lang->thumbnail_ratio = '比例'; - $lang->cmd_delete_all_thumbnail = '刪除全部縮圖'; - $lang->title_bold = '粗體'; - $lang->title_color = '標題顏色'; - $lang->new_document_count = 'N'; - - $lang->parent_category_title = '主分類'; - $lang->category_title = '分類名稱'; - $lang->category_color = '分類顏色'; - $lang->expand = '展開'; - $lang->category_group_srls = '群組'; - - $lang->cmd_make_child = '新增子分類'; - $lang->cmd_enable_move_category = '分類順序(勾選後用滑鼠拖曳分類項目)'; - - $lang->about_category_title = '請輸入分類名稱。'; - $lang->about_expand = '選擇此項將維持展開狀態。'; - $lang->about_category_group_srls = '被選擇的群組才可以檢視此分類。'; - $lang->about_category_color = '設定分類顏色。例)紅色為 #ff0000'; - - $lang->cmd_search_next = '繼續搜尋'; - - $lang->cmd_temp_save = '臨時儲存'; - - $lang->cmd_toggle_checked_document = '反選'; - $lang->cmd_delete_checked_document = '刪除所選'; - $lang->cmd_document_do = '將此主題..'; - - $lang->msg_cart_is_null = '請選擇要刪除的文章。'; - $lang->msg_category_not_moved = '無法移動!'; - $lang->msg_is_secret = '秘密!'; - $lang->msg_checked_document_is_deleted = '刪除%d個文章。'; - - $lang->move_target_module = '移到'; - - // 管理者頁面中搜尋的內容 - $lang->search_target_list = array( - 'title' => '標題', - 'content' => '內容', - 'user_id' => '帳號', - 'member_srl' => '會員編號', - 'user_name' => '姓名', - 'nick_name' => '暱稱', - 'email_address' => '電子郵件', - 'homepage' => '主頁', - 'is_notice' => '公告', - 'is_secret' => '秘密', - 'tags' => '標籤', - 'readed_count' => '點閱數(以上)', - 'voted_count' => '推薦數(以上)', - 'comment_count ' => '評論數(以上)', - 'trackback_count ' => '引用數(以上)', - 'uploaded_count ' => '上傳檔案數(以上)', - 'regdate' => '登錄日期', - 'last_update' => '最近更新', - 'ipaddress' => 'IP位址', - ); - - $lang->alias = "Alias"; - $lang->history = "歷史紀錄"; - $lang->about_use_history = "選擇是否使用歷史記錄功能。選擇使用,將能夠編輯歷史紀錄並還原。"; - $lang->trace_only = "追蹤"; - - $lang->cmd_trash = "垃圾桶"; - $lang->cmd_restore = "還原"; - $lang->cmd_restore_all = "全部還原"; - - $lang->in_trash = "垃圾桶"; - $lang->trash_nick_name = "暱稱"; - $lang->trash_date = "刪除日期"; - $lang->trash_description = "原因"; - - // 管理者頁面中垃圾桶的搜尋目標 - $lang->search_target_trash_list = array( - 'title' => '標題', - 'content' => '內容', - 'user_id' => '帳號', - 'member_srl' => '會員編號', - 'user_name' => '姓名', - 'nick_name' => '暱稱', - 'trash_member_srl' => '移除會員編號', - 'trash_user_name' => '移除姓名', - 'trash_nick_name' => '移除暱稱', - 'trash_date' => '刪除日期', - 'trash_ipaddress' => '移除 IP 位址', - ); - - $lang->success_trashed = "成功地移到垃圾桶"; - $lang->msg_not_selected_document = '尚未選擇主題'; - $lang->show_voted_member = '投票會員'; -?> +document_list = '主題列表'; + $lang->thumbnail_type = '縮圖建立方式'; + $lang->thumbnail_crop = '裁減'; + $lang->thumbnail_ratio = '比例'; + $lang->cmd_delete_all_thumbnail = '刪除全部縮圖'; + $lang->title_bold = '粗體'; + $lang->title_color = '標題顏色'; + $lang->new_document_count = 'N'; + + $lang->parent_category_title = '主分類'; + $lang->category_title = '分類名稱'; + $lang->category_color = '分類顏色'; + $lang->expand = '展開'; + $lang->category_group_srls = '群組'; + + $lang->cmd_make_child = '新增子分類'; + $lang->cmd_enable_move_category = '分類順序(勾選後用滑鼠拖曳分類項目)'; + + $lang->about_category_title = '請輸入分類名稱。'; + $lang->about_expand = '選擇此項將維持展開狀態。'; + $lang->about_category_group_srls = '被選擇的群組才可以檢視此分類。'; + $lang->about_category_color = '設定分類顏色。例)紅色為 #ff0000'; + + $lang->cmd_search_next = '繼續搜尋'; + + $lang->cmd_temp_save = '臨時儲存'; + + $lang->cmd_toggle_checked_document = '反選'; + $lang->cmd_delete_checked_document = '刪除所選'; + $lang->cmd_document_do = '將此主題..'; + + $lang->msg_cart_is_null = '請選擇要刪除的文章。'; + $lang->msg_category_not_moved = '無法移動!'; + $lang->msg_is_secret = '秘密!'; + $lang->msg_checked_document_is_deleted = '刪除%d個文章。'; + + $lang->move_target_module = '移到'; + + // 管理者頁面中搜尋的內容 + $lang->search_target_list = array( + 'title' => '標題', + 'content' => '內容', + 'user_id' => '帳號', + 'member_srl' => '會員編號', + 'user_name' => '姓名', + 'nick_name' => '暱稱', + 'email_address' => '電子郵件', + 'homepage' => '主頁', + 'is_notice' => '公告', + 'is_secret' => '秘密', + 'tags' => '標籤', + 'readed_count' => '點閱數(以上)', + 'voted_count' => '推薦數(以上)', + 'comment_count ' => '評論數(以上)', + 'trackback_count ' => '引用數(以上)', + 'uploaded_count ' => '上傳檔案數(以上)', + 'regdate' => '登錄日期', + 'last_update' => '最近更新', + 'ipaddress' => 'IP位址', + ); + + $lang->alias = "Alias"; + $lang->history = "歷史紀錄"; + $lang->about_use_history = "選擇是否使用歷史記錄功能。選擇使用,將能夠編輯歷史紀錄並還原。"; + $lang->trace_only = "追蹤"; + + $lang->cmd_trash = "垃圾桶"; + $lang->cmd_restore = "還原"; + $lang->cmd_restore_all = "全部還原"; + + $lang->in_trash = "垃圾桶"; + $lang->trash_nick_name = "暱稱"; + $lang->trash_date = "刪除日期"; + $lang->trash_description = "原因"; + + // 管理者頁面中垃圾桶的搜尋目標 + $lang->search_target_trash_list = array( + 'title' => '標題', + 'content' => '內容', + 'user_id' => '帳號', + 'member_srl' => '會員編號', + 'user_name' => '姓名', + 'nick_name' => '暱稱', + 'trash_member_srl' => '移除會員編號', + 'trash_user_name' => '移除姓名', + 'trash_nick_name' => '移除暱稱', + 'trash_date' => '刪除日期', + 'trash_ipaddress' => '移除 IP 位址', + ); + + $lang->success_trashed = "成功地移到垃圾桶"; + $lang->msg_not_selected_document = '尚未選擇主題'; + $lang->show_voted_member = '投票會員'; +?> diff --git a/modules/document/queries/getChildCategoryMinListOrder.xml b/modules/document/queries/getChildCategoryMinListOrder.xml index 0ae643680..5a3407ff5 100644 --- a/modules/document/queries/getChildCategoryMinListOrder.xml +++ b/modules/document/queries/getChildCategoryMinListOrder.xml @@ -1,12 +1,12 @@ - - - - - - - - - - - - + + +
    + + + + + + + + + diff --git a/modules/document/tpl/declared_list.html b/modules/document/tpl/declared_list.html index e49b4320b..f96216d2e 100644 --- a/modules/document/tpl/declared_list.html +++ b/modules/document/tpl/declared_list.html @@ -1,70 +1,70 @@ - - - - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->user_name}
    {$lang->cmd_declare}
    {$lang->readed_count}
    {$lang->voted_count}
    {$lang->date}
    {$no}isCarted())-->checked="checked"/> - {$oDocument->getTitleText()} - - - [{$oDocument->getCommentCount()}] - - - - [{$oDocument->getTrackbackCount()}] - - {$oDocument->getNickName()}{$oDocument->get('declared_count')}{$oDocument->get('readed_count')}{$oDocument->get('voted_count')}{$oDocument->getRegdate("Y-m-d")}
    - {$lang->cmd_manage_document} - {$lang->cmd_cancel_declare} -
    - - - - - -
    - + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->user_name}
    {$lang->cmd_declare}
    {$lang->readed_count}
    {$lang->voted_count}
    {$lang->date}
    {$no}isCarted())-->checked="checked"/> + {$oDocument->getTitleText()} + + + [{$oDocument->getCommentCount()}] + + + + [{$oDocument->getTrackbackCount()}] + + {$oDocument->getNickName()}{$oDocument->get('declared_count')}{$oDocument->get('readed_count')}{$oDocument->get('voted_count')}{$oDocument->getRegdate("Y-m-d")}
    + {$lang->cmd_manage_document} + {$lang->cmd_cancel_declare} +
    + + +
    + + +
    + diff --git a/modules/document/tpl/document_list.html b/modules/document/tpl/document_list.html index 6334736eb..4c0e52f0a 100644 --- a/modules/document/tpl/document_list.html +++ b/modules/document/tpl/document_list.html @@ -1,100 +1,100 @@ - - - - - - -
    -
    - - - - -
    - - - - {$lang->cmd_cancel} -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->document}
    {$lang->nick_name}
    {$lang->readed_count}
    {$lang->voted_count}
    {$lang->date}
    {$lang->ipaddress}
    {$lang->alias}
    {$no}isCarted())-->checked="checked"/> - - - {$lang->cmd_save} - - {$oDocument->getTitle()} - - - [{$lang->in_trash}] {$oDocument->getTitle()} - - - - [{$oDocument->getCommentCount()}] - - - - [{$oDocument->getTrackbackCount()}] - - {$oDocument->getNickName()}{$oDocument->get('readed_count')}{$oDocument->get('voted_count')} / {$oDocument->get('blamed_count')}{$oDocument->getRegdate("Y-m-d H:i:s")}{$oDocument->get('ipaddress')}{$lang->alias} -
    - -
    - - - + + + + + + +
    +
    + + + + +
    + + + + {$lang->cmd_cancel} +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->document}
    {$lang->nick_name}
    {$lang->readed_count}
    {$lang->voted_count}
    {$lang->date}
    {$lang->ipaddress}
    {$lang->alias}
    {$no}isCarted())-->checked="checked"/> + + + {$lang->cmd_save} + + {$oDocument->getTitle()} + + + [{$lang->in_trash}] {$oDocument->getTitle()} + + + + [{$oDocument->getCommentCount()}] + + + + [{$oDocument->getTrackbackCount()}] + + {$oDocument->getNickName()}{$oDocument->get('readed_count')}{$oDocument->get('voted_count')} / {$oDocument->get('blamed_count')}{$oDocument->getRegdate("Y-m-d H:i:s")}{$oDocument->get('ipaddress')}{$lang->alias} +
    + +
    + + + diff --git a/modules/document/tpl/document_trash_list.html b/modules/document/tpl/document_trash_list.html index 3e8d108b9..652a2a8cb 100644 --- a/modules/document/tpl/document_trash_list.html +++ b/modules/document/tpl/document_trash_list.html @@ -1,73 +1,73 @@ - - - - - -
    - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - checked="checked"/>--> - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->document}
    {$lang->trash_nick_name}
    {$lang->trash_date}
    {$lang->ipaddress}
    {$lang->trash_description}
    {$lang->cmd_restore}
    {$no} - {$oDocument->getTitle()} - - - [{$oDocument->getCommentCount()}] - - - - [{$oDocument->getTrackbackCount()}] - - {htmlspecialchars($oDocument->get('trash_nick_name'))}{zdate($oDocument->get('trash_date'), "Y-m-d H:i:s")}{$oDocument->get('ipaddress')}{$oDocument->get('trash_description')}{$lang->cmd_restore}
    - -
    - - - + + + + + +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + checked="checked"/>--> + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->document}
    {$lang->trash_nick_name}
    {$lang->trash_date}
    {$lang->ipaddress}
    {$lang->trash_description}
    {$lang->cmd_restore}
    {$no} + {$oDocument->getTitle()} + + + [{$oDocument->getCommentCount()}] + + + + [{$oDocument->getTrackbackCount()}] + + {htmlspecialchars($oDocument->get('trash_nick_name'))}{zdate($oDocument->get('trash_date'), "Y-m-d H:i:s")}{$oDocument->get('ipaddress')}{$oDocument->get('trash_description')}{$lang->cmd_restore}
    + +
    + + + diff --git a/modules/document/tpl/js/document_category.js b/modules/document/tpl/js/document_category.js index 5ec3fc492..6743f8795 100644 --- a/modules/document/tpl/js/document_category.js +++ b/modules/document/tpl/js/document_category.js @@ -1,189 +1,189 @@ -/** - * @file modules/document/tpl/js/document_category.js - * @author NHN (developers@xpressengine.com) - * @brief document 모듈의 category tree javascript - **/ - -function Tree(url){ - // clear tree; - jQuery('#menu > ul > li > ul').remove(); - if(jQuery("ul.simpleTree > li > a").size() ==0)jQuery('').bind("click",function(e){addNode(0,e);}).appendTo("ul.simpleTree > li"); - - //ajax get data and transeform ul il - jQuery.get(url,function(data){ - jQuery(data).find("node").each(function(i){ - var text = jQuery(this).attr("text"); - var node_srl = jQuery(this).attr("node_srl"); - var parent_srl = jQuery(this).attr("parent_srl"); - var color = jQuery(this).attr("color"); - var url = jQuery(this).attr("url"); - - // node - var node = ''; - if(color && color !='transparent'){ - node = jQuery('
  • '+text+'
  • '); - }else{ - node = jQuery('
  • '+text+'
  • '); - } - - // button - jQuery('').bind("click",function(e){ - jQuery("#tree_"+node_srl+" > span").click(); - addNode(node_srl,e); - return false; - }).appendTo(node); - - jQuery('').bind("click",function(e){ - jQuery("#tree_"+node_srl+" > span").click(); - modifyNode(node_srl,e); - return false; - }).appendTo(node); - - jQuery('').bind("click",function(e){ - deleteNode(node_srl); - return false; - }).appendTo(node); - - // insert parent child - if(parent_srl>0){ - if(jQuery('#tree_'+parent_srl+'>ul').length==0) jQuery('#tree_'+parent_srl).append(jQuery('
      ')); - jQuery('#tree_'+parent_srl+'> ul').append(node); - }else{ - if(jQuery('#menu ul.simpleTree > li > ul').length==0) jQuery("
        ").appendTo('#menu ul.simpleTree > li'); - jQuery('#menu ul.simpleTree > li > ul').append(node); - } - - }); - - //button show hide - jQuery("#menu li").each(function(){ - if(jQuery(this).parents('ul').size() > max_menu_depth) jQuery("a.add",this).hide(); - if(jQuery(">ul",this).size()>0) jQuery(">a.delete",this).hide(); - }); - - - // draw tree - simpleTreeCollection = jQuery('.simpleTree').simpleTree({ - autoclose: false, - afterClick:function(node){ - jQuery('#category_info').html(""); - //alert("text-"+jQuery('span:first',node).text()); - }, - afterDblClick:function(node){ - //alert("text-"+jQuery('span:first',node).text()); - }, - afterMove:function(destination, source, pos){ - if(destination.size() == 0){ - Tree(xml_url); - return; - } - var module_srl = jQuery("#fo_category input[name=module_srl]").val(); - var parent_srl = destination.attr('id').replace(/.*_/g,''); - var source_srl = source.attr('id').replace(/.*_/g,''); - - var target = source.prevAll("li:not([class^=line])"); - var target_srl = 0; - if(target.length >0){ - target_srl = source.prevAll("li:not([class^=line])").get(0).id.replace(/.*_/g,''); - parent_srl = 0; - } - - jQuery.exec_json("document.procDocumentMoveCategory",{ "module_srl":module_srl,"parent_srl":parent_srl,"target_srl":target_srl,"source_srl":source_srl}, - function(data){ - jQuery('#category_info').html(''); - if(data.error > 0) Tree(xml_url); - }); - - }, - - // i want you !! made by sol - beforeMovedToLine : function(destination, source, pos){ - return (jQuery(destination).parents('ul').size() + jQuery('ul',source).size() <= max_menu_depth); - }, - - // i want you !! made by sol - beforeMovedToFolder : function(destination, source, pos){ - return (jQuery(destination).parents('ul').size() + jQuery('ul',source).size() <= max_menu_depth-1); - }, - afterAjax:function() - { - //alert('Loaded'); - }, - animate:true - ,docToFolderConvert:true - }); - - - - // open all node - nodeToggleAll(); - },"xml"); -} -function addNode(node,e){ - var params ={ - "category_srl":0 - ,"parent_srl":node - ,"module_srl":jQuery("#fo_category [name=module_srl]").val() - }; - - jQuery.exec_json('document.getDocumentCategoryTplInfo', params, function(data){ - jQuery('#category_info').html(data.tpl).css('left',e.pageX).css('top',e.pageY); - }); -} - -function modifyNode(node,e){ - var params ={ - "category_srl":node - ,"parent_srl":0 - ,"module_srl":jQuery("#fo_category [name=module_srl]").val() - }; - - jQuery.exec_json('document.getDocumentCategoryTplInfo', params, function(data){ - jQuery('#category_info').html(data.tpl).css('left',e.pageX).css('top',e.pageY); - }); -} - - -function nodeToggleAll(){ - jQuery("[class*=close]", simpleTreeCollection[0]).each(function(){ - simpleTreeCollection[0].nodeToggle(this); - }); -} - -function deleteNode(node){ - if(confirm(lang_confirm_delete)){ - jQuery('#category_info').html(""); - var params ={ - "category_srl":node - ,"parent_srl":0 - ,"module_srl":jQuery("#fo_category [name=module_srl]").val() - }; - - jQuery.exec_json('document.procDocumentDeleteCategory', params, function(data){ - if(data.error==0) Tree(xml_url); - }); - } -} - -/* 카테고리 아이템 입력후 */ -function completeInsertCategory(ret_obj) { - jQuery('#category_info').html(""); - Tree(xml_url); -} - -function hideCategoryInfo() { - jQuery('#category_info').html(""); -} - -/* 카테고리 목록 갱신 */ -function doReloadTreeCategory(module_srl) { - var params = {'module_srl':module_srl}; - - // 서버에 요청하여 해당 노드의 정보를 수정할 수 있도록 한다. - var response_tags = new Array('error','message', 'xml_file'); - exec_xml('document', 'procDocumentMakeXmlFile', params, completeInsertCategory, response_tags, params); -} - -function doCategoryFormMove() { - jQuery(function($){ $('#fo_category').appendTo(document.body); $('#category_info').css('width', '550px'); }); -} +/** + * @file modules/document/tpl/js/document_category.js + * @author NHN (developers@xpressengine.com) + * @brief document 모듈의 category tree javascript + **/ + +function Tree(url){ + // clear tree; + jQuery('#menu > ul > li > ul').remove(); + if(jQuery("ul.simpleTree > li > a").size() ==0)jQuery('').bind("click",function(e){addNode(0,e);}).appendTo("ul.simpleTree > li"); + + //ajax get data and transeform ul il + jQuery.get(url,function(data){ + jQuery(data).find("node").each(function(i){ + var text = jQuery(this).attr("text"); + var node_srl = jQuery(this).attr("node_srl"); + var parent_srl = jQuery(this).attr("parent_srl"); + var color = jQuery(this).attr("color"); + var url = jQuery(this).attr("url"); + + // node + var node = ''; + if(color && color !='transparent'){ + node = jQuery('
      • '+text+'
      • '); + }else{ + node = jQuery('
      • '+text+'
      • '); + } + + // button + jQuery('').bind("click",function(e){ + jQuery("#tree_"+node_srl+" > span").click(); + addNode(node_srl,e); + return false; + }).appendTo(node); + + jQuery('').bind("click",function(e){ + jQuery("#tree_"+node_srl+" > span").click(); + modifyNode(node_srl,e); + return false; + }).appendTo(node); + + jQuery('').bind("click",function(e){ + deleteNode(node_srl); + return false; + }).appendTo(node); + + // insert parent child + if(parent_srl>0){ + if(jQuery('#tree_'+parent_srl+'>ul').length==0) jQuery('#tree_'+parent_srl).append(jQuery('
          ')); + jQuery('#tree_'+parent_srl+'> ul').append(node); + }else{ + if(jQuery('#menu ul.simpleTree > li > ul').length==0) jQuery("
            ").appendTo('#menu ul.simpleTree > li'); + jQuery('#menu ul.simpleTree > li > ul').append(node); + } + + }); + + //button show hide + jQuery("#menu li").each(function(){ + if(jQuery(this).parents('ul').size() > max_menu_depth) jQuery("a.add",this).hide(); + if(jQuery(">ul",this).size()>0) jQuery(">a.delete",this).hide(); + }); + + + // draw tree + simpleTreeCollection = jQuery('.simpleTree').simpleTree({ + autoclose: false, + afterClick:function(node){ + jQuery('#category_info').html(""); + //alert("text-"+jQuery('span:first',node).text()); + }, + afterDblClick:function(node){ + //alert("text-"+jQuery('span:first',node).text()); + }, + afterMove:function(destination, source, pos){ + if(destination.size() == 0){ + Tree(xml_url); + return; + } + var module_srl = jQuery("#fo_category input[name=module_srl]").val(); + var parent_srl = destination.attr('id').replace(/.*_/g,''); + var source_srl = source.attr('id').replace(/.*_/g,''); + + var target = source.prevAll("li:not([class^=line])"); + var target_srl = 0; + if(target.length >0){ + target_srl = source.prevAll("li:not([class^=line])").get(0).id.replace(/.*_/g,''); + parent_srl = 0; + } + + jQuery.exec_json("document.procDocumentMoveCategory",{ "module_srl":module_srl,"parent_srl":parent_srl,"target_srl":target_srl,"source_srl":source_srl}, + function(data){ + jQuery('#category_info').html(''); + if(data.error > 0) Tree(xml_url); + }); + + }, + + // i want you !! made by sol + beforeMovedToLine : function(destination, source, pos){ + return (jQuery(destination).parents('ul').size() + jQuery('ul',source).size() <= max_menu_depth); + }, + + // i want you !! made by sol + beforeMovedToFolder : function(destination, source, pos){ + return (jQuery(destination).parents('ul').size() + jQuery('ul',source).size() <= max_menu_depth-1); + }, + afterAjax:function() + { + //alert('Loaded'); + }, + animate:true + ,docToFolderConvert:true + }); + + + + // open all node + nodeToggleAll(); + },"xml"); +} +function addNode(node,e){ + var params ={ + "category_srl":0 + ,"parent_srl":node + ,"module_srl":jQuery("#fo_category [name=module_srl]").val() + }; + + jQuery.exec_json('document.getDocumentCategoryTplInfo', params, function(data){ + jQuery('#category_info').html(data.tpl).css('left',e.pageX).css('top',e.pageY); + }); +} + +function modifyNode(node,e){ + var params ={ + "category_srl":node + ,"parent_srl":0 + ,"module_srl":jQuery("#fo_category [name=module_srl]").val() + }; + + jQuery.exec_json('document.getDocumentCategoryTplInfo', params, function(data){ + jQuery('#category_info').html(data.tpl).css('left',e.pageX).css('top',e.pageY); + }); +} + + +function nodeToggleAll(){ + jQuery("[class*=close]", simpleTreeCollection[0]).each(function(){ + simpleTreeCollection[0].nodeToggle(this); + }); +} + +function deleteNode(node){ + if(confirm(lang_confirm_delete)){ + jQuery('#category_info').html(""); + var params ={ + "category_srl":node + ,"parent_srl":0 + ,"module_srl":jQuery("#fo_category [name=module_srl]").val() + }; + + jQuery.exec_json('document.procDocumentDeleteCategory', params, function(data){ + if(data.error==0) Tree(xml_url); + }); + } +} + +/* 카테고리 아이템 입력후 */ +function completeInsertCategory(ret_obj) { + jQuery('#category_info').html(""); + Tree(xml_url); +} + +function hideCategoryInfo() { + jQuery('#category_info').html(""); +} + +/* 카테고리 목록 갱신 */ +function doReloadTreeCategory(module_srl) { + var params = {'module_srl':module_srl}; + + // 서버에 요청하여 해당 노드의 정보를 수정할 수 있도록 한다. + var response_tags = new Array('error','message', 'xml_file'); + exec_xml('document', 'procDocumentMakeXmlFile', params, completeInsertCategory, response_tags, params); +} + +function doCategoryFormMove() { + jQuery(function($){ $('#fo_category').appendTo(document.body); $('#category_info').css('width', '550px'); }); +} diff --git a/modules/editor/components/emoticon/emoticon.class.php b/modules/editor/components/emoticon/emoticon.class.php index 0909ee578..2f7eacfc0 100644 --- a/modules/editor/components/emoticon/emoticon.class.php +++ b/modules/editor/components/emoticon/emoticon.class.php @@ -1,107 +1,107 @@ -editor_sequence = $editor_sequence; - $this->component_path = $component_path; - $this->emoticon_path = sprintf('%s%s/images',preg_replace('/^\.\//i','',$this->component_path),'tpl','images'); - } - - /** - * @brief 이모티콘 파일 목록을 리턴 - **/ - function getEmoticonList() { - $emoticon = Context::get('emoticon'); - if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new Object(-1,'msg_invalid_request'); - - $list = $this->getEmoticons($emoticon); - - $this->add('emoticons', implode("\n",$list)); - } - - /** - * @brief 재귀적으로 이모티콘이 될 법한 파일들을 하위 디렉토리까지 전부 검색한다. 8,000개까지는 테스트 해봤는데 스택오버프로우를 일으킬지 어떨지는 잘 모르겠음.(2007.9.6, 베니) - **/ - function getEmoticons($path) { - $emoticon_path = sprintf("%s/%s", $this->emoticon_path, $path); - $output = array(); - - $oDir = dir($emoticon_path); - while($file = $oDir->read()) { - if(substr($file,0,1)=='.') continue; - if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file)); - } - $oDir->close(); - if(count($output)) asort($output); - return $output; - } - - /** - * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 - **/ - function getPopupContent() { - // 이모티콘 디렉토리 목록을 가져옴 - $emoticon_dirs = FileHandler::readDir($this->emoticon_path); - $emoticon_list = array(); - if($emoticon_dirs) { - foreach($emoticon_dirs as $emoticon) { - if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon; - } - } - Context::set('emoticon_list', $emoticon_list); - - // 첫번째 이모티콘 디렉토리의 이미지 파일을 구함 - $emoticons = $this->getEmoticons($emoticon_list[0]); - Context::set('emoticons', $emoticons); - - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->component_path.'tpl'; - $tpl_file = 'popup.html'; - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - /** - * @brief 이모티콘의 경로 문제 해결을 하기 위해 추가하였다. (2007.9.6 베니) - **/ - function transHTML($xml_obj) { - $src = $xml_obj->attrs->src; - $alt = $xml_obj->attrs->alt; - - if(!$alt) { - $tmp_arr = explode('/',$src); - $alt = array_pop($tmp_arr); - } - - $src = str_replace(array('&','"'), array('&','&qout;'), $src); - if(!$alt) $alt = $src; - - $attr_output = array(); - $attr_output = array("src=\"".$src."\""); - - if($alt) { - $attr_output[] = "alt=\"".$alt."\""; - } - if(preg_match("/\.png$/i",$src)) $attr_output[] = "class=\"iePngFix\""; - - $code = sprintf("", implode(" ",$attr_output)); - - return $code; - } - } -?> +editor_sequence = $editor_sequence; + $this->component_path = $component_path; + $this->emoticon_path = sprintf('%s%s/images',preg_replace('/^\.\//i','',$this->component_path),'tpl','images'); + } + + /** + * @brief 이모티콘 파일 목록을 리턴 + **/ + function getEmoticonList() { + $emoticon = Context::get('emoticon'); + if(!$emoticon || !preg_match("/^([a-z0-9\_]+)$/i",$emoticon)) return new Object(-1,'msg_invalid_request'); + + $list = $this->getEmoticons($emoticon); + + $this->add('emoticons', implode("\n",$list)); + } + + /** + * @brief 재귀적으로 이모티콘이 될 법한 파일들을 하위 디렉토리까지 전부 검색한다. 8,000개까지는 테스트 해봤는데 스택오버프로우를 일으킬지 어떨지는 잘 모르겠음.(2007.9.6, 베니) + **/ + function getEmoticons($path) { + $emoticon_path = sprintf("%s/%s", $this->emoticon_path, $path); + $output = array(); + + $oDir = dir($emoticon_path); + while($file = $oDir->read()) { + if(substr($file,0,1)=='.') continue; + if(preg_match('/\.(jpg|jpeg|gif|png)$/i',$file)) $output[] = sprintf("%s/%s", $path, str_replace($this->emoticon_path,'',$file)); + } + $oDir->close(); + if(count($output)) asort($output); + return $output; + } + + /** + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 + **/ + function getPopupContent() { + // 이모티콘 디렉토리 목록을 가져옴 + $emoticon_dirs = FileHandler::readDir($this->emoticon_path); + $emoticon_list = array(); + if($emoticon_dirs) { + foreach($emoticon_dirs as $emoticon) { + if(preg_match("/^([a-z0-9\_]+)$/i", $emoticon)) $emoticon_list[] = $emoticon; + } + } + Context::set('emoticon_list', $emoticon_list); + + // 첫번째 이모티콘 디렉토리의 이미지 파일을 구함 + $emoticons = $this->getEmoticons($emoticon_list[0]); + Context::set('emoticons', $emoticons); + + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return + $tpl_path = $this->component_path.'tpl'; + $tpl_file = 'popup.html'; + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 이모티콘의 경로 문제 해결을 하기 위해 추가하였다. (2007.9.6 베니) + **/ + function transHTML($xml_obj) { + $src = $xml_obj->attrs->src; + $alt = $xml_obj->attrs->alt; + + if(!$alt) { + $tmp_arr = explode('/',$src); + $alt = array_pop($tmp_arr); + } + + $src = str_replace(array('&','"'), array('&','&qout;'), $src); + if(!$alt) $alt = $src; + + $attr_output = array(); + $attr_output = array("src=\"".$src."\""); + + if($alt) { + $attr_output[] = "alt=\"".$alt."\""; + } + if(preg_match("/\.png$/i",$src)) $attr_output[] = "class=\"iePngFix\""; + + $code = sprintf("", implode(" ",$attr_output)); + + return $code; + } + } +?> diff --git a/modules/editor/components/emoticon/info.xml b/modules/editor/components/emoticon/info.xml index a4c526549..7f89742e5 100644 --- a/modules/editor/components/emoticon/info.xml +++ b/modules/editor/components/emoticon/info.xml @@ -1,35 +1,35 @@ - - - 이모티콘 출력 - 顔文字(イモティコン) - 表情图标 - Display Emoticons - Diễn tả cảm xúc - Mostrar iconos gestuales - Отображение смайлов - 表情符號 - His Simgeleri Gösterimi - 이모티콘을 에디터에 삽입할 수 있습니다. - 顔文字(イモティコン)をエディターに追加することが出来ます。 - 可以插入表情图标到编辑器。 - You may insert emoticons to editor. - Bạn có thể chèn biểu tượng cảm xúc vào bài viết. - Usted puede insertar emoticonos para el editor. - Вы можете вставить смыйлы в редактор. - 可插入表情符號到編輯器。 - Editöre his simgeleri ekleyebilirsiniz. - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 이모티콘 출력 + 顔文字(イモティコン) + 表情图标 + Display Emoticons + Diễn tả cảm xúc + Mostrar iconos gestuales + Отображение смайлов + 表情符號 + His Simgeleri Gösterimi + 이모티콘을 에디터에 삽입할 수 있습니다. + 顔文字(イモティコン)をエディターに追加することが出来ます。 + 可以插入表情图标到编辑器。 + You may insert emoticons to editor. + Bạn có thể chèn biểu tượng cảm xúc vào bài viết. + Usted puede insertar emoticonos para el editor. + Вы можете вставить смыйлы в редактор. + 可插入表情符號到編輯器。 + Editöre his simgeleri ekleyebilirsiniz. + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/editor/components/image_gallery/image_gallery.class.php b/modules/editor/components/image_gallery/image_gallery.class.php index 05ecd286e..3aa0b2e86 100644 --- a/modules/editor/components/image_gallery/image_gallery.class.php +++ b/modules/editor/components/image_gallery/image_gallery.class.php @@ -1,81 +1,81 @@ -editor_sequence = $editor_sequence; - $this->component_path = $component_path; - } - - /** - * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 - **/ - function getPopupContent() { - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->component_path.'tpl'; - $tpl_file = 'popup.html'; - - Context::set("tpl_path", $tpl_path); - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - /** - * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method - * - * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 - * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 - **/ - function transHTML($xml_obj) { - $gallery_info->srl = rand(111111,999999); - $gallery_info->border_thickness = $xml_obj->attrs->border_thickness; - $gallery_info->gallery_style = $xml_obj->attrs->gallery_style; - $gallery_info->border_color = $xml_obj->attrs->border_color; - $gallery_info->bg_color = $xml_obj->attrs->bg_color; - $gallery_info->gallery_align = $xml_obj->attrs->gallery_align; - - $images_list = $xml_obj->attrs->images_list; - $images_list = preg_replace('/\.(gif|jpg|jpeg|png) /i',".\\1\n",$images_list); - $gallery_info->images_list = explode("\n",trim($images_list)); - - // 만약 출력설정이 XML일 경우 이미지 목록만 출력하도록 코드 생성 - if(Context::getResponseMethod() == 'XMLRPC') { - $output = ''; - for($i=0;$iimages_list);$i++) { - $output .= sprintf('
            ', $gallery_info->images_list[$i]); - } - return $output; - } - - // HTML 출력일 경우 템플릿 변환을 거쳐서 갤러리 출력 설정에 맞는 html코드를 생성하도록 함 - preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); - $gallery_info->width = trim($matches[3][0]); - if(!$gallery_info->width) $gallery_info->width = 400; - - Context::set('gallery_info', $gallery_info); - - $tpl_path = $this->component_path.'tpl'; - Context::set("tpl_path", $tpl_path); - - if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html'; - else $tpl_file = 'slide_gallery.html'; - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - } -?> +editor_sequence = $editor_sequence; + $this->component_path = $component_path; + } + + /** + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 + **/ + function getPopupContent() { + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return + $tpl_path = $this->component_path.'tpl'; + $tpl_file = 'popup.html'; + + Context::set("tpl_path", $tpl_path); + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method + * + * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 + * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 + **/ + function transHTML($xml_obj) { + $gallery_info->srl = rand(111111,999999); + $gallery_info->border_thickness = $xml_obj->attrs->border_thickness; + $gallery_info->gallery_style = $xml_obj->attrs->gallery_style; + $gallery_info->border_color = $xml_obj->attrs->border_color; + $gallery_info->bg_color = $xml_obj->attrs->bg_color; + $gallery_info->gallery_align = $xml_obj->attrs->gallery_align; + + $images_list = $xml_obj->attrs->images_list; + $images_list = preg_replace('/\.(gif|jpg|jpeg|png) /i',".\\1\n",$images_list); + $gallery_info->images_list = explode("\n",trim($images_list)); + + // 만약 출력설정이 XML일 경우 이미지 목록만 출력하도록 코드 생성 + if(Context::getResponseMethod() == 'XMLRPC') { + $output = ''; + for($i=0;$iimages_list);$i++) { + $output .= sprintf('
            ', $gallery_info->images_list[$i]); + } + return $output; + } + + // HTML 출력일 경우 템플릿 변환을 거쳐서 갤러리 출력 설정에 맞는 html코드를 생성하도록 함 + preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); + $gallery_info->width = trim($matches[3][0]); + if(!$gallery_info->width) $gallery_info->width = 400; + + Context::set('gallery_info', $gallery_info); + + $tpl_path = $this->component_path.'tpl'; + Context::set("tpl_path", $tpl_path); + + if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html'; + else $tpl_file = 'slide_gallery.html'; + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + } +?> diff --git a/modules/editor/components/image_gallery/info.xml b/modules/editor/components/image_gallery/info.xml index dd2c477e5..2d5a16ffd 100644 --- a/modules/editor/components/image_gallery/info.xml +++ b/modules/editor/components/image_gallery/info.xml @@ -1,35 +1,35 @@ - - - Slide Show - 기본 이미지 갤러리 - デフォルトイメージギャラリー - 图片相册 - Basic Image Gallery - Galería de imágenes básicos - Базовая галлерея изображений - 預設圖片相簿 - Temel Resim Galerisi - Bạn có thể tạo ra một Slide Show theo dạng danh sách hoặc Slide từ những hình ảnh đính kèm của mình. - 첨부된 이미지파일을 이용하여 슬라이드/목록형 이미지 갤러리를 만들 수 있습니다. - 添付されたイメージファイルを利用して、スライド型・リスト型のイメージギャラリーが作成できます。 - 利用上传的图片文件实现幻灯片式或目录型相册图片。 - It can create image gallery of slide/list style by using attached image file. - It can create image gallery of slide/list style by using attached image file. - Это может создать гллерею изображений в стиле слайдов/списка, используя вложенный файл изображения. - 將上傳的圖片以投影片或列表的形式實現。 - Ekteki resim dosyasını kullanarak, slayt/liste tarzı resim galerisi oluşturabilir. - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + Slide Show + 기본 이미지 갤러리 + デフォルトイメージギャラリー + 图片相册 + Basic Image Gallery + Galería de imágenes básicos + Базовая галлерея изображений + 預設圖片相簿 + Temel Resim Galerisi + Bạn có thể tạo ra một Slide Show theo dạng danh sách hoặc Slide từ những hình ảnh đính kèm của mình. + 첨부된 이미지파일을 이용하여 슬라이드/목록형 이미지 갤러리를 만들 수 있습니다. + 添付されたイメージファイルを利用して、スライド型・リスト型のイメージギャラリーが作成できます。 + 利用上传的图片文件实现幻灯片式或目录型相册图片。 + It can create image gallery of slide/list style by using attached image file. + It can create image gallery of slide/list style by using attached image file. + Это может создать гллерею изображений в стиле слайдов/списка, используя вложенный файл изображения. + 將上傳的圖片以投影片或列表的形式實現。 + Ekteki resim dosyasını kullanarak, slayt/liste tarzı resim galerisi oluşturabilir. + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/editor/components/image_gallery/lang/en.lang.php b/modules/editor/components/image_gallery/lang/en.lang.php index 23c267c36..5f0618f66 100644 --- a/modules/editor/components/image_gallery/lang/en.lang.php +++ b/modules/editor/components/image_gallery/lang/en.lang.php @@ -1,27 +1,27 @@ - language pack of image_gallery component. - **/ - - $lang->image_gallery = "Make Image Gallery"; - $lang->width = "Width"; - $lang->height = "Height"; - $lang->image_list = "Image List"; - $lang->gallery_style = "Gallery Style"; - $lang->gallery_slide_style = "Slide Style"; - $lang->gallery_slide_align = "Align Style"; - $lang->gallery_slide_center = "Center"; - $lang->gallery_slide_left = "Left"; - $lang->gallery_slide_right = "Right"; - $lang->gallery_list_style = "Expand All"; - $lang->gallery_border_color = "Border Color"; - $lang->gallery_border_thickness = "Border Thickness"; - $lang->gallery_bg_color = "Background Color"; - $lang->about_image_list = "Select file to add to the image gallery. You can drag it after selecting or shift+click(for selecting widely), ctrl+click(for selecting individually)"; - - $lang->cmd_gallery_prev = "Previous Picture"; - $lang->cmd_gallery_next = "Next Picture"; - $lang->cmd_gallery_thumbnail = "Thumbnail"; -?> + language pack of image_gallery component. + **/ + + $lang->image_gallery = "Make Image Gallery"; + $lang->width = "Width"; + $lang->height = "Height"; + $lang->image_list = "Image List"; + $lang->gallery_style = "Gallery Style"; + $lang->gallery_slide_style = "Slide Style"; + $lang->gallery_slide_align = "Align Style"; + $lang->gallery_slide_center = "Center"; + $lang->gallery_slide_left = "Left"; + $lang->gallery_slide_right = "Right"; + $lang->gallery_list_style = "Expand All"; + $lang->gallery_border_color = "Border Color"; + $lang->gallery_border_thickness = "Border Thickness"; + $lang->gallery_bg_color = "Background Color"; + $lang->about_image_list = "Select file to add to the image gallery. You can drag it after selecting or shift+click(for selecting widely), ctrl+click(for selecting individually)"; + + $lang->cmd_gallery_prev = "Previous Picture"; + $lang->cmd_gallery_next = "Next Picture"; + $lang->cmd_gallery_thumbnail = "Thumbnail"; +?> diff --git a/modules/editor/components/image_gallery/lang/es.lang.php b/modules/editor/components/image_gallery/lang/es.lang.php index b9355d4d7..c6372b1dc 100644 --- a/modules/editor/components/image_gallery/lang/es.lang.php +++ b/modules/editor/components/image_gallery/lang/es.lang.php @@ -1,27 +1,27 @@ - language pack of image_gallery component. - **/ - - $lang->image_gallery = "Haga Galeria de Imagenes"; - $lang->width = "Ancho"; - $lang->altura = "Altura"; - $lang->image_list = "Lista de imagenes"; - $lang->gallery_style = "Galeria de Estilo"; - $lang->gallery_slide_style = "Estilo de diapositivas"; - $lang->gallery_slide_align = "Alinear Estilo"; - $lang->gallery_slide_center = "Centro"; - $lang->gallery_slide_left = "Izquierda"; - $lang->gallery_slide_right = "Derecho"; - $lang->gallery_list_style = "Mostrar todos"; - $lang->gallery_border_color = "Color del borde"; - $lang->gallery_border_thickness = "Grosor de Fronteras"; - $lang->gallery_bg_color = "Color de fondo"; - $lang->about_image_list = "Seleccione archivo para anadir a la galeria de imagenes. Puede arrastrar despues de la seleccion o cambio + clic (para seleccionar ampliamente), ctrl + clic (para seleccionar individualmente)"; - - $lang->cmd_gallery_prev = "Imagen anterior"; - $lang->cmd_gallery_next = "Imagen siguiente"; - $lang->cmd_gallery_thumbnail = "Miniatura"; -?> + language pack of image_gallery component. + **/ + + $lang->image_gallery = "Haga Galeria de Imagenes"; + $lang->width = "Ancho"; + $lang->altura = "Altura"; + $lang->image_list = "Lista de imagenes"; + $lang->gallery_style = "Galeria de Estilo"; + $lang->gallery_slide_style = "Estilo de diapositivas"; + $lang->gallery_slide_align = "Alinear Estilo"; + $lang->gallery_slide_center = "Centro"; + $lang->gallery_slide_left = "Izquierda"; + $lang->gallery_slide_right = "Derecho"; + $lang->gallery_list_style = "Mostrar todos"; + $lang->gallery_border_color = "Color del borde"; + $lang->gallery_border_thickness = "Grosor de Fronteras"; + $lang->gallery_bg_color = "Color de fondo"; + $lang->about_image_list = "Seleccione archivo para anadir a la galeria de imagenes. Puede arrastrar despues de la seleccion o cambio + clic (para seleccionar ampliamente), ctrl + clic (para seleccionar individualmente)"; + + $lang->cmd_gallery_prev = "Imagen anterior"; + $lang->cmd_gallery_next = "Imagen siguiente"; + $lang->cmd_gallery_thumbnail = "Miniatura"; +?> diff --git a/modules/editor/components/image_gallery/lang/jp.lang.php b/modules/editor/components/image_gallery/lang/jp.lang.php index 8e2b37c0d..52ca29da2 100644 --- a/modules/editor/components/image_gallery/lang/jp.lang.php +++ b/modules/editor/components/image_gallery/lang/jp.lang.php @@ -1,27 +1,27 @@ - イメージギャラリー(image_gallery)コンポネント言語パッケージ - **/ - - $lang->image_gallery = "イメージギャラリー作成"; - $lang->width = "横幅サイズ"; - $lang->height = "縦幅サイズ"; - $lang->image_list = "イメージリスト"; - $lang->gallery_style = "ギャラリースタイル"; - $lang->gallery_slide_style = "スライドスタイル"; - $lang->gallery_slide_align = "アライン位置"; - $lang->gallery_slide_center = "中央揃え"; - $lang->gallery_slide_left = "左揃え"; - $lang->gallery_slide_right = "右揃え"; - $lang->gallery_list_style = "展開表示(リスト)"; - $lang->gallery_border_color = "ボーダーカラー"; - $lang->gallery_border_thickness = "ボーダー"; - $lang->gallery_bg_color = "背景色"; - $lang->about_image_list = "イメージギャラリーに追加するファイルを選択して下さい。選択した後、ドラッグまたは「Shift+クリック(範囲選択)、Ctrl+クリック(個別選択)」が出来ます。"; - - $lang->cmd_gallery_prev = "前のイメージ表示"; - $lang->cmd_gallery_next = "次のイメージ表示"; - $lang->cmd_gallery_thumbnail = "サムネール表示"; -?> + イメージギャラリー(image_gallery)コンポネント言語パッケージ + **/ + + $lang->image_gallery = "イメージギャラリー作成"; + $lang->width = "横幅サイズ"; + $lang->height = "縦幅サイズ"; + $lang->image_list = "イメージリスト"; + $lang->gallery_style = "ギャラリースタイル"; + $lang->gallery_slide_style = "スライドスタイル"; + $lang->gallery_slide_align = "アライン位置"; + $lang->gallery_slide_center = "中央揃え"; + $lang->gallery_slide_left = "左揃え"; + $lang->gallery_slide_right = "右揃え"; + $lang->gallery_list_style = "展開表示(リスト)"; + $lang->gallery_border_color = "ボーダーカラー"; + $lang->gallery_border_thickness = "ボーダー"; + $lang->gallery_bg_color = "背景色"; + $lang->about_image_list = "イメージギャラリーに追加するファイルを選択して下さい。選択した後、ドラッグまたは「Shift+クリック(範囲選択)、Ctrl+クリック(個別選択)」が出来ます。"; + + $lang->cmd_gallery_prev = "前のイメージ表示"; + $lang->cmd_gallery_next = "次のイメージ表示"; + $lang->cmd_gallery_thumbnail = "サムネール表示"; +?> diff --git a/modules/editor/components/image_gallery/lang/ru.lang.php b/modules/editor/components/image_gallery/lang/ru.lang.php index e9a585eab..47b680728 100644 --- a/modules/editor/components/image_gallery/lang/ru.lang.php +++ b/modules/editor/components/image_gallery/lang/ru.lang.php @@ -1,27 +1,27 @@ - language pack of image_gallery component. - **/ - - $lang->image_gallery = "Создать галлерею изображений"; - $lang->width = "Ширина"; - $lang->height = "Высота"; - $lang->image_list = "Список изображений"; - $lang->gallery_style = "Стиль галлереи"; - $lang->gallery_slide_style = "Стиль слайда"; - $lang->gallery_slide_align = "Стиль выравнивания"; - $lang->gallery_slide_center = "Центр"; - $lang->gallery_slide_left = "Лево"; - $lang->gallery_slide_right = "Право"; - $lang->gallery_list_style = "Раскрыть все"; - $lang->gallery_border_color = "Цыет рамки"; - $lang->gallery_border_thickness = "Толщина рамки"; - $lang->gallery_bg_color = "Цвет фона"; - $lang->about_image_list = "Выберите файл для добавления в галлерею изображений. Вы можете перетащить его после выбора или нажав shift+click(для широкого выделения), ctrl+click(для индивидуального выделения)"; - - $lang->cmd_gallery_prev = "Предыдущее изображение"; - $lang->cmd_gallery_next = "Следующее изображение"; - $lang->cmd_gallery_thumbnail = "Миниатюра"; -?> + language pack of image_gallery component. + **/ + + $lang->image_gallery = "Создать галлерею изображений"; + $lang->width = "Ширина"; + $lang->height = "Высота"; + $lang->image_list = "Список изображений"; + $lang->gallery_style = "Стиль галлереи"; + $lang->gallery_slide_style = "Стиль слайда"; + $lang->gallery_slide_align = "Стиль выравнивания"; + $lang->gallery_slide_center = "Центр"; + $lang->gallery_slide_left = "Лево"; + $lang->gallery_slide_right = "Право"; + $lang->gallery_list_style = "Раскрыть все"; + $lang->gallery_border_color = "Цыет рамки"; + $lang->gallery_border_thickness = "Толщина рамки"; + $lang->gallery_bg_color = "Цвет фона"; + $lang->about_image_list = "Выберите файл для добавления в галлерею изображений. Вы можете перетащить его после выбора или нажав shift+click(для широкого выделения), ctrl+click(для индивидуального выделения)"; + + $lang->cmd_gallery_prev = "Предыдущее изображение"; + $lang->cmd_gallery_next = "Следующее изображение"; + $lang->cmd_gallery_thumbnail = "Миниатюра"; +?> diff --git a/modules/editor/components/image_gallery/lang/tr.lang.php b/modules/editor/components/image_gallery/lang/tr.lang.php index 2a106e3af..8d4bd57f1 100644 --- a/modules/editor/components/image_gallery/lang/tr.lang.php +++ b/modules/editor/components/image_gallery/lang/tr.lang.php @@ -1,27 +1,27 @@ - language pack of image_gallery component. - **/ - - $lang->image_gallery = "Resim Galerisi Oluştur"; - $lang->width = "Genişlik"; - $lang->height = "Yükseklik"; - $lang->image_list = "Resim Listesi"; - $lang->gallery_style = "Galeri Tarzı"; - $lang->gallery_slide_style = "Slayt Tarzı"; - $lang->gallery_slide_align = "Hizalama Tarzı"; - $lang->gallery_slide_center = "Ortalı"; - $lang->gallery_slide_left = "Sol"; - $lang->gallery_slide_right = "Sağ"; - $lang->gallery_list_style = "Hepsini Genişlet"; - $lang->gallery_border_color = "Kenarlık Rengi"; - $lang->gallery_border_thickness = "Kenarlık Kalınlığı"; - $lang->gallery_bg_color = "Arkaplan Rengi"; - $lang->about_image_list = "Resim galerisine eklenecek dosyayı seçiniz. Seçtikten sonra dosyayı sürükleyebilirsiniz ya da shift+click(geniş ölçüde seçimler için), ctrl+click(bireysel seçimler için)komutlarını kullanabilirsiniz"; - - $lang->cmd_gallery_prev = "Önceki Resim"; - $lang->cmd_gallery_next = "Sonraki Resim"; - $lang->cmd_gallery_thumbnail = "Küçük Resim"; -?> + language pack of image_gallery component. + **/ + + $lang->image_gallery = "Resim Galerisi Oluştur"; + $lang->width = "Genişlik"; + $lang->height = "Yükseklik"; + $lang->image_list = "Resim Listesi"; + $lang->gallery_style = "Galeri Tarzı"; + $lang->gallery_slide_style = "Slayt Tarzı"; + $lang->gallery_slide_align = "Hizalama Tarzı"; + $lang->gallery_slide_center = "Ortalı"; + $lang->gallery_slide_left = "Sol"; + $lang->gallery_slide_right = "Sağ"; + $lang->gallery_list_style = "Hepsini Genişlet"; + $lang->gallery_border_color = "Kenarlık Rengi"; + $lang->gallery_border_thickness = "Kenarlık Kalınlığı"; + $lang->gallery_bg_color = "Arkaplan Rengi"; + $lang->about_image_list = "Resim galerisine eklenecek dosyayı seçiniz. Seçtikten sonra dosyayı sürükleyebilirsiniz ya da shift+click(geniş ölçüde seçimler için), ctrl+click(bireysel seçimler için)komutlarını kullanabilirsiniz"; + + $lang->cmd_gallery_prev = "Önceki Resim"; + $lang->cmd_gallery_next = "Sonraki Resim"; + $lang->cmd_gallery_thumbnail = "Küçük Resim"; +?> diff --git a/modules/editor/components/image_gallery/lang/vi.lang.php b/modules/editor/components/image_gallery/lang/vi.lang.php index 5934406c5..0fb2f5aba 100644 --- a/modules/editor/components/image_gallery/lang/vi.lang.php +++ b/modules/editor/components/image_gallery/lang/vi.lang.php @@ -1,29 +1,29 @@ -image_gallery = "Tạo Slide Show"; - $lang->width = "Chiều rộng"; - $lang->height = "Chiều cao"; - $lang->image_list = "Danh sách hình ảnh"; - $lang->gallery_style = "Kiểu dáng Show"; - $lang->gallery_slide_style = "Kiểu Slide"; - $lang->gallery_slide_align = "Kiểu căn chỉnh"; - $lang->gallery_slide_center = "Giữa"; - $lang->gallery_slide_left = "Trái"; - $lang->gallery_slide_right = "Phải"; - $lang->gallery_list_style = "Mở rộng tất cả"; - $lang->gallery_border_color = "Màu viền"; - $lang->gallery_border_thickness = "Độ dày viền"; - $lang->gallery_bg_color = "Màu nền"; - $lang->about_image_list = "Chọn hình ảnh để thêm vào Show. Bạn có thể di chuyển hình ảnh bằng cách bấm tổ hợp 'Shift+Click' để di chuyển nhiều hình ảnh, hoặc 'Ctrl+Click' để di chuyển từng hình ảnh."; - - $lang->cmd_gallery_prev = "Hình trước"; - $lang->cmd_gallery_next = "Hình sau"; - $lang->cmd_gallery_thumbnail = "Hình nhỏ"; -?> +image_gallery = "Tạo Slide Show"; + $lang->width = "Chiều rộng"; + $lang->height = "Chiều cao"; + $lang->image_list = "Danh sách hình ảnh"; + $lang->gallery_style = "Kiểu dáng Show"; + $lang->gallery_slide_style = "Kiểu Slide"; + $lang->gallery_slide_align = "Kiểu căn chỉnh"; + $lang->gallery_slide_center = "Giữa"; + $lang->gallery_slide_left = "Trái"; + $lang->gallery_slide_right = "Phải"; + $lang->gallery_list_style = "Mở rộng tất cả"; + $lang->gallery_border_color = "Màu viền"; + $lang->gallery_border_thickness = "Độ dày viền"; + $lang->gallery_bg_color = "Màu nền"; + $lang->about_image_list = "Chọn hình ảnh để thêm vào Show. Bạn có thể di chuyển hình ảnh bằng cách bấm tổ hợp 'Shift+Click' để di chuyển nhiều hình ảnh, hoặc 'Ctrl+Click' để di chuyển từng hình ảnh."; + + $lang->cmd_gallery_prev = "Hình trước"; + $lang->cmd_gallery_next = "Hình sau"; + $lang->cmd_gallery_thumbnail = "Hình nhỏ"; +?> diff --git a/modules/editor/components/image_gallery/lang/zh-CN.lang.php b/modules/editor/components/image_gallery/lang/zh-CN.lang.php index af5e01b93..f6552c3ee 100644 --- a/modules/editor/components/image_gallery/lang/zh-CN.lang.php +++ b/modules/editor/components/image_gallery/lang/zh-CN.lang.php @@ -1,27 +1,27 @@ - 图像(image_gallery) 组件的语言包 - **/ - - $lang->image_gallery = "图像编辑"; - $lang->width = "宽度"; - $lang->height = "高度"; - $lang->image_list = "图像目录"; - $lang->gallery_style = "风格"; - $lang->gallery_slide_style = "幻灯片风格"; - $lang->gallery_slide_align = "对齐方式"; - $lang->gallery_slide_center = "居中对齐"; - $lang->gallery_slide_left = "左对齐"; - $lang->gallery_slide_right = "右对齐"; - $lang->gallery_list_style = "全部展开"; - $lang->gallery_border_color = "边框颜色"; - $lang->gallery_border_thickness = "边框粗细"; - $lang->gallery_bg_color = "背景颜色"; - $lang->about_image_list = "请选择要添加的图像文件。 选择后可以拖动或按 shift+点击(范围选择), ctrl+点击(个别选择)"; - - $lang->cmd_gallery_prev = "上一个"; - $lang->cmd_gallery_next = "下一个"; - $lang->cmd_gallery_thumbnail = "查看缩略图il"; -?> + 图像(image_gallery) 组件的语言包 + **/ + + $lang->image_gallery = "图像编辑"; + $lang->width = "宽度"; + $lang->height = "高度"; + $lang->image_list = "图像目录"; + $lang->gallery_style = "风格"; + $lang->gallery_slide_style = "幻灯片风格"; + $lang->gallery_slide_align = "对齐方式"; + $lang->gallery_slide_center = "居中对齐"; + $lang->gallery_slide_left = "左对齐"; + $lang->gallery_slide_right = "右对齐"; + $lang->gallery_list_style = "全部展开"; + $lang->gallery_border_color = "边框颜色"; + $lang->gallery_border_thickness = "边框粗细"; + $lang->gallery_bg_color = "背景颜色"; + $lang->about_image_list = "请选择要添加的图像文件。 选择后可以拖动或按 shift+点击(范围选择), ctrl+点击(个别选择)"; + + $lang->cmd_gallery_prev = "上一个"; + $lang->cmd_gallery_next = "下一个"; + $lang->cmd_gallery_thumbnail = "查看缩略图il"; +?> diff --git a/modules/editor/components/image_gallery/lang/zh-TW.lang.php b/modules/editor/components/image_gallery/lang/zh-TW.lang.php index 430b4c80a..adbee32d8 100644 --- a/modules/editor/components/image_gallery/lang/zh-TW.lang.php +++ b/modules/editor/components/image_gallery/lang/zh-TW.lang.php @@ -1,27 +1,27 @@ - 圖片(image_gallery) 組件的語言 - **/ - - $lang->image_gallery = "圖片編輯"; - $lang->width = "寬度"; - $lang->height = "高度"; - $lang->image_list = "圖片列表"; - $lang->gallery_style = "風格"; - $lang->gallery_slide_style = "幻燈片"; - $lang->gallery_slide_align = "對齊方式"; - $lang->gallery_slide_center = "置中"; - $lang->gallery_slide_left = "靠左"; - $lang->gallery_slide_right = "靠右"; - $lang->gallery_list_style = "全部展開"; - $lang->gallery_border_color = "邊框顏色"; - $lang->gallery_border_thickness = "邊框粗細"; - $lang->gallery_bg_color = "背景顏色"; - $lang->about_image_list = "請選擇要新增的圖片檔案。可以框選或按住 shift+左鍵(範圍選擇), ctrl+左鍵(個別選擇)選擇檔案。"; - - $lang->cmd_gallery_prev = "上一個"; - $lang->cmd_gallery_next = "下一個"; - $lang->cmd_gallery_thumbnail = "檢視縮圖"; -?> + 圖片(image_gallery) 組件的語言 + **/ + + $lang->image_gallery = "圖片編輯"; + $lang->width = "寬度"; + $lang->height = "高度"; + $lang->image_list = "圖片列表"; + $lang->gallery_style = "風格"; + $lang->gallery_slide_style = "幻燈片"; + $lang->gallery_slide_align = "對齊方式"; + $lang->gallery_slide_center = "置中"; + $lang->gallery_slide_left = "靠左"; + $lang->gallery_slide_right = "靠右"; + $lang->gallery_list_style = "全部展開"; + $lang->gallery_border_color = "邊框顏色"; + $lang->gallery_border_thickness = "邊框粗細"; + $lang->gallery_bg_color = "背景顏色"; + $lang->about_image_list = "請選擇要新增的圖片檔案。可以框選或按住 shift+左鍵(範圍選擇), ctrl+左鍵(個別選擇)選擇檔案。"; + + $lang->cmd_gallery_prev = "上一個"; + $lang->cmd_gallery_next = "下一個"; + $lang->cmd_gallery_thumbnail = "檢視縮圖"; +?> diff --git a/modules/editor/components/image_link/image_link.class.php b/modules/editor/components/image_link/image_link.class.php index a6bda7807..ab771e421 100644 --- a/modules/editor/components/image_link/image_link.class.php +++ b/modules/editor/components/image_link/image_link.class.php @@ -1,108 +1,108 @@ -editor_sequence = $editor_sequence; - $this->component_path = $component_path; - } - - /** - * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 - **/ - function getPopupContent() { - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->component_path.'tpl'; - $tpl_file = 'popup.html'; - - Context::set("tpl_path", $tpl_path); - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - /** - * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method - * - * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 - * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 - **/ - function transHTML($xml_obj) { - $src = $xml_obj->attrs->src; - $width = $xml_obj->attrs->width; - $height = $xml_obj->attrs->height; - $align = $xml_obj->attrs->align; - $alt = $xml_obj->attrs->alt; - $border = (int)$xml_obj->attrs->border; - $link_url = $xml_obj->attrs->link_url; - $open_window = $xml_obj->attrs->open_window; - $style = $xml_obj->attrs->style; - $margin = (int)$xml_obj->attrs->margin; - - if(!$alt) { - $tmp_arr = explode('/',$src); - $alt = array_pop($tmp_arr); - } - - $src = str_replace(array('&','"'), array('&','&qout;'), $src); - $src = str_replace('&amp;', '&', $src); - - if(!$alt) $alt = $src; - // 이미지 주소를 request uri가 포함된 주소로 변환 (rss출력, 등등을 위함) - $temp_src = explode('/', $src); - if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2); - elseif(substr($src , 0, 1)=='/') { - if($_SERVER['HTTPS']=='on') $http_src = 'https://'; - else $http_src = 'http://'; - $src = $http_src.$_SERVER['HTTP_HOST'].$src; - } - elseif(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src; - - $attr_output = array(); - $attr_output = array("src=\"".$src."\""); - if($alt) { - $attr_output[] = "alt=\"".$alt."\""; - $attr_output[] = "title=\"".$alt."\""; - } - if($margin) { - $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; - $style = str_replace(';;',';',$style); - if($style == ';') $style = ''; - $style .= ' margin:'.$margin.'px;'; - } - if($align) $attr_output[] = "align=\"".$align."\""; - - if(preg_match("/\.png$/i",$src)) $attr_output[] = "class=\"iePngFix\""; - - if($width) $attr_output[] = 'width="'.$width.'"'; - if($height) $attr_output[] = 'height="'.$height.'"'; - if($border) { - $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; - $style = str_replace(';;',';',$style); - if($style == ';') $style = ''; - $style .= ' border-style: solid; border-width:'.$border.'px;'; - } - - $code = sprintf("", implode(' ',$attr_output), $style); - - if($link_url) { - if($open_window =='Y') $code = sprintf('%s', $link_url, $code); - else $code = sprintf('%s', $link_url, $code); - } - return $code; - } - - } -?> +editor_sequence = $editor_sequence; + $this->component_path = $component_path; + } + + /** + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 + **/ + function getPopupContent() { + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return + $tpl_path = $this->component_path.'tpl'; + $tpl_file = 'popup.html'; + + Context::set("tpl_path", $tpl_path); + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method + * + * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 + * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 + **/ + function transHTML($xml_obj) { + $src = $xml_obj->attrs->src; + $width = $xml_obj->attrs->width; + $height = $xml_obj->attrs->height; + $align = $xml_obj->attrs->align; + $alt = $xml_obj->attrs->alt; + $border = (int)$xml_obj->attrs->border; + $link_url = $xml_obj->attrs->link_url; + $open_window = $xml_obj->attrs->open_window; + $style = $xml_obj->attrs->style; + $margin = (int)$xml_obj->attrs->margin; + + if(!$alt) { + $tmp_arr = explode('/',$src); + $alt = array_pop($tmp_arr); + } + + $src = str_replace(array('&','"'), array('&','&qout;'), $src); + $src = str_replace('&amp;', '&', $src); + + if(!$alt) $alt = $src; + // 이미지 주소를 request uri가 포함된 주소로 변환 (rss출력, 등등을 위함) + $temp_src = explode('/', $src); + if(substr($src, 0,2)=='./') $src = Context::getRequestUri().substr($src, 2); + elseif(substr($src , 0, 1)=='/') { + if($_SERVER['HTTPS']=='on') $http_src = 'https://'; + else $http_src = 'http://'; + $src = $http_src.$_SERVER['HTTP_HOST'].$src; + } + elseif(!strpos($temp_src[0],':') && $src) $src = Context::getRequestUri().$src; + + $attr_output = array(); + $attr_output = array("src=\"".$src."\""); + if($alt) { + $attr_output[] = "alt=\"".$alt."\""; + $attr_output[] = "title=\"".$alt."\""; + } + if($margin) { + $style = trim(preg_replace('/margin[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; + $style = str_replace(';;',';',$style); + if($style == ';') $style = ''; + $style .= ' margin:'.$margin.'px;'; + } + if($align) $attr_output[] = "align=\"".$align."\""; + + if(preg_match("/\.png$/i",$src)) $attr_output[] = "class=\"iePngFix\""; + + if($width) $attr_output[] = 'width="'.$width.'"'; + if($height) $attr_output[] = 'height="'.$height.'"'; + if($border) { + $style = trim(preg_replace('/border[a-z\-]*[ ]*:[ ]*[0-9 a-z]+(;| )/i','', $style)).';'; + $style = str_replace(';;',';',$style); + if($style == ';') $style = ''; + $style .= ' border-style: solid; border-width:'.$border.'px;'; + } + + $code = sprintf("", implode(' ',$attr_output), $style); + + if($link_url) { + if($open_window =='Y') $code = sprintf('%s', $link_url, $code); + else $code = sprintf('%s', $link_url, $code); + } + return $code; + } + + } +?> diff --git a/modules/editor/components/image_link/info.xml b/modules/editor/components/image_link/info.xml index dd9afc9b0..c9469694f 100644 --- a/modules/editor/components/image_link/info.xml +++ b/modules/editor/components/image_link/info.xml @@ -1,35 +1,35 @@ - - - 이미지 추가 - イメージ追加 - 插入图像 - Add Images - Thêm hình ảnh - Añadir imágenes - Добавление изображений - 圖片連結 - Resim Ekle - 에디터에 이미지를 추가하거나 속성을 변경할 수 있습니다. - エディターでイメージの追加、属性の変更が出来ます。 - 可以插入图像或编辑其相应属性。 - It can add an image to editor or change the attribution of image. - Bạn có thể thêm hình ảnh để sửa hay chia sẻ. - Se puede añadir una imagen a editor o cambiar la atribución de la imagen. - Это может добавить изображение в редактор или изменить параметры изображения. - 可以新增或編輯其相關屬性。 - Editöre bir resim ekleyebilir veya resmin niteliğini değiştirebilir. - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 이미지 추가 + イメージ追加 + 插入图像 + Add Images + Thêm hình ảnh + Añadir imágenes + Добавление изображений + 圖片連結 + Resim Ekle + 에디터에 이미지를 추가하거나 속성을 변경할 수 있습니다. + エディターでイメージの追加、属性の変更が出来ます。 + 可以插入图像或编辑其相应属性。 + It can add an image to editor or change the attribution of image. + Bạn có thể thêm hình ảnh để sửa hay chia sẻ. + Se puede añadir una imagen a editor o cambiar la atribución de la imagen. + Это может добавить изображение в редактор или изменить параметры изображения. + 可以新增或編輯其相關屬性。 + Editöre bir resim ekleyebilir veya resmin niteliğini değiştirebilir. + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/editor/components/image_link/lang/en.lang.php b/modules/editor/components/image_link/lang/en.lang.php index 0f21f84d5..9f90c0420 100644 --- a/modules/editor/components/image_link/lang/en.lang.php +++ b/modules/editor/components/image_link/lang/en.lang.php @@ -1,22 +1,22 @@ - language pack of image_link component - **/ - - $lang->image_url = "Image Path"; - $lang->image_alt = "Input Description"; - $lang->image_scale = "Image Size"; - $lang->image_align = "Align Style"; - $lang->image_align_normal = "Occupy a Paragraph"; - $lang->image_align_left = "Left of Article"; - $lang->image_align_middle = "Center"; - $lang->image_align_right = "Right of Article"; - $lang->image_border = "Border Thickness"; - $lang->urllink_url = "URL"; - $lang->image_margin = 'Image Margin'; - - $lang->about_url_link_open_window = "Make the link to open as a new window"; - $lang->cmd_get_scale = "Get Image Size"; -?> + language pack of image_link component + **/ + + $lang->image_url = "Image Path"; + $lang->image_alt = "Input Description"; + $lang->image_scale = "Image Size"; + $lang->image_align = "Align Style"; + $lang->image_align_normal = "Occupy a Paragraph"; + $lang->image_align_left = "Left of Article"; + $lang->image_align_middle = "Center"; + $lang->image_align_right = "Right of Article"; + $lang->image_border = "Border Thickness"; + $lang->urllink_url = "URL"; + $lang->image_margin = 'Image Margin'; + + $lang->about_url_link_open_window = "Make the link to open as a new window"; + $lang->cmd_get_scale = "Get Image Size"; +?> diff --git a/modules/editor/components/image_link/lang/es.lang.php b/modules/editor/components/image_link/lang/es.lang.php index 46f63bacd..2c211bc61 100644 --- a/modules/editor/components/image_link/lang/es.lang.php +++ b/modules/editor/components/image_link/lang/es.lang.php @@ -1,22 +1,22 @@ - language pack of image_link component - **/ - - $lang->image_url = "Ruta de la imagen"; - $lang->image_alt = "Descripcion de Entrada"; - $lang->image_scale = "Tamano de la Imagen"; - $lang->image_align = "Alinear Estilo"; - $lang->image_align_normal = "Occupy un parrafo"; - $lang->image_align_left = "Izquierda del articulo"; - $lang->image_align_middle = "Centro"; - $lang->image_align_right = "Derecho de articulo"; - $lang->image_border = "Grosor de Fronteras"; - $lang->urllink_url = "URL"; - $lang->image_margin = 'Image Margin'; - - $lang->about_url_link_open_window = "Hacer el vinculo para abrir una nueva ventana"; - $lang->cmd_get_scale = "Obtener tamano de la imagen"; -?> + language pack of image_link component + **/ + + $lang->image_url = "Ruta de la imagen"; + $lang->image_alt = "Descripcion de Entrada"; + $lang->image_scale = "Tamano de la Imagen"; + $lang->image_align = "Alinear Estilo"; + $lang->image_align_normal = "Occupy un parrafo"; + $lang->image_align_left = "Izquierda del articulo"; + $lang->image_align_middle = "Centro"; + $lang->image_align_right = "Derecho de articulo"; + $lang->image_border = "Grosor de Fronteras"; + $lang->urllink_url = "URL"; + $lang->image_margin = 'Image Margin'; + + $lang->about_url_link_open_window = "Hacer el vinculo para abrir una nueva ventana"; + $lang->cmd_get_scale = "Obtener tamano de la imagen"; +?> diff --git a/modules/editor/components/image_link/lang/jp.lang.php b/modules/editor/components/image_link/lang/jp.lang.php index d53e4cd6b..97bf86c89 100644 --- a/modules/editor/components/image_link/lang/jp.lang.php +++ b/modules/editor/components/image_link/lang/jp.lang.php @@ -1,23 +1,23 @@ - イメージリンク(image_link)コンポネント言語パッケージ - **/ - - $lang->image_url = 'イメージパス'; - $lang->image_alt = '説明(Alt)入力'; - $lang->image_scale = 'イメージサイズ'; - $lang->image_align = 'アライン位置'; - $lang->image_align_normal = '一段落'; - $lang->image_align_left = '左揃え'; - $lang->image_align_middle = '中央揃え'; - $lang->image_align_right = '右揃え'; - $lang->image_border = 'ボーダー'; - $lang->image_margin = '外側の空白(Margin)'; - - $lang->urllink_open_window = '新しいウィンドウで開く'; - $lang->about_url_link_open_window = 'チェックすると、リンクをクリックする際、新しいウィンドウで開きます。'; - - $lang->cmd_get_scale = 'イメージサイズを計算'; -?> + イメージリンク(image_link)コンポネント言語パッケージ + **/ + + $lang->image_url = 'イメージパス'; + $lang->image_alt = '説明(Alt)入力'; + $lang->image_scale = 'イメージサイズ'; + $lang->image_align = 'アライン位置'; + $lang->image_align_normal = '一段落'; + $lang->image_align_left = '左揃え'; + $lang->image_align_middle = '中央揃え'; + $lang->image_align_right = '右揃え'; + $lang->image_border = 'ボーダー'; + $lang->image_margin = '外側の空白(Margin)'; + + $lang->urllink_open_window = '新しいウィンドウで開く'; + $lang->about_url_link_open_window = 'チェックすると、リンクをクリックする際、新しいウィンドウで開きます。'; + + $lang->cmd_get_scale = 'イメージサイズを計算'; +?> diff --git a/modules/editor/components/image_link/lang/ko.lang.php b/modules/editor/components/image_link/lang/ko.lang.php index 79b4bff96..6e6f0e1e2 100644 --- a/modules/editor/components/image_link/lang/ko.lang.php +++ b/modules/editor/components/image_link/lang/ko.lang.php @@ -1,23 +1,23 @@ - 이미지링크(image_link) 컴포넌트의 언어팩 - **/ - - $lang->image_url = '이미지 경로'; - $lang->image_alt = '설명 입력'; - $lang->image_scale = '이미지 크기'; - $lang->image_align = '정렬 방법'; - $lang->image_align_normal = '한 문단을 차지'; - $lang->image_align_left = '글의 왼쪽으로'; - $lang->image_align_middle = '가운데'; - $lang->image_align_right = '글의 우측으로'; - $lang->image_border = '경계선 두께'; - $lang->image_margin = '바깥 여백'; - - $lang->urllink_open_window = '새 창 열기'; - $lang->about_url_link_open_window = '선택하시면 링크 선택 시 새 창으로 열립니다.'; - - $lang->cmd_get_scale = '가로세로 구하기'; -?> + 이미지링크(image_link) 컴포넌트의 언어팩 + **/ + + $lang->image_url = '이미지 경로'; + $lang->image_alt = '설명 입력'; + $lang->image_scale = '이미지 크기'; + $lang->image_align = '정렬 방법'; + $lang->image_align_normal = '한 문단을 차지'; + $lang->image_align_left = '글의 왼쪽으로'; + $lang->image_align_middle = '가운데'; + $lang->image_align_right = '글의 우측으로'; + $lang->image_border = '경계선 두께'; + $lang->image_margin = '바깥 여백'; + + $lang->urllink_open_window = '새 창 열기'; + $lang->about_url_link_open_window = '선택하시면 링크 선택 시 새 창으로 열립니다.'; + + $lang->cmd_get_scale = '가로세로 구하기'; +?> diff --git a/modules/editor/components/image_link/lang/ru.lang.php b/modules/editor/components/image_link/lang/ru.lang.php index 27354e5ae..fef966903 100644 --- a/modules/editor/components/image_link/lang/ru.lang.php +++ b/modules/editor/components/image_link/lang/ru.lang.php @@ -1,22 +1,22 @@ - language pack of image_link component - **/ - - $lang->image_url = "Путь изображения"; - $lang->image_alt = "Введите описание"; - $lang->image_scale = "Размер изображения"; - $lang->image_align = "Стиль выравнивания"; - $lang->image_align_normal = "Занять параграф"; - $lang->image_align_left = "Лево"; - $lang->image_align_middle = "Центр"; - $lang->image_align_right = "Право"; - $lang->image_border = "Толщина рамки"; - $lang->urllink_url = "URL"; - $lang->image_margin = 'Image Margin'; - - $lang->about_url_link_open_window = "Создайте ссылку для открытия в новом окне"; - $lang->cmd_get_scale = "Получить размер изображения"; -?> + language pack of image_link component + **/ + + $lang->image_url = "Путь изображения"; + $lang->image_alt = "Введите описание"; + $lang->image_scale = "Размер изображения"; + $lang->image_align = "Стиль выравнивания"; + $lang->image_align_normal = "Занять параграф"; + $lang->image_align_left = "Лево"; + $lang->image_align_middle = "Центр"; + $lang->image_align_right = "Право"; + $lang->image_border = "Толщина рамки"; + $lang->urllink_url = "URL"; + $lang->image_margin = 'Image Margin'; + + $lang->about_url_link_open_window = "Создайте ссылку для открытия в новом окне"; + $lang->cmd_get_scale = "Получить размер изображения"; +?> diff --git a/modules/editor/components/image_link/lang/tr.lang.php b/modules/editor/components/image_link/lang/tr.lang.php index f4fb574f7..c384240b8 100644 --- a/modules/editor/components/image_link/lang/tr.lang.php +++ b/modules/editor/components/image_link/lang/tr.lang.php @@ -1,22 +1,22 @@ - language pack of image_link component - **/ - - $lang->image_url = "Resim Yolu"; - $lang->image_alt = "Açıklama Gir"; - $lang->image_scale = "Resim Boyutu"; - $lang->image_align = "Hizalama Tarzı"; - $lang->image_align_normal = "Paragraf Atla"; - $lang->image_align_left = "Makalenin Solunda"; - $lang->image_align_middle = "Ortalı"; - $lang->image_align_right = "Makalenin Sağında"; - $lang->image_border = "Kenarlık Kalınlığı"; - $lang->urllink_url = "URL"; - $lang->image_margin = 'Resim Kenar Boşluğu'; - - $lang->about_url_link_open_window = "Köprüyü yeni pencerede aç."; - $lang->cmd_get_scale = "Resim Boyutunu Al"; -?> + language pack of image_link component + **/ + + $lang->image_url = "Resim Yolu"; + $lang->image_alt = "Açıklama Gir"; + $lang->image_scale = "Resim Boyutu"; + $lang->image_align = "Hizalama Tarzı"; + $lang->image_align_normal = "Paragraf Atla"; + $lang->image_align_left = "Makalenin Solunda"; + $lang->image_align_middle = "Ortalı"; + $lang->image_align_right = "Makalenin Sağında"; + $lang->image_border = "Kenarlık Kalınlığı"; + $lang->urllink_url = "URL"; + $lang->image_margin = 'Resim Kenar Boşluğu'; + + $lang->about_url_link_open_window = "Köprüyü yeni pencerede aç."; + $lang->cmd_get_scale = "Resim Boyutunu Al"; +?> diff --git a/modules/editor/components/image_link/lang/vi.lang.php b/modules/editor/components/image_link/lang/vi.lang.php index df986db6e..976109eab 100644 --- a/modules/editor/components/image_link/lang/vi.lang.php +++ b/modules/editor/components/image_link/lang/vi.lang.php @@ -1,24 +1,24 @@ -image_url = "Đường dẫn"; - $lang->image_alt = "Mô tả"; - $lang->image_scale = "Kích thước"; - $lang->image_align = "Căn chỉnh"; - $lang->image_align_normal = "Một khoảng bài viết"; - $lang->image_align_left = "Bên trái bài viết"; - $lang->image_align_middle = "Giữa"; - $lang->image_align_right = "Bên phải bài viết"; - $lang->image_border = "Độ dày viền"; - $lang->urllink_url = "URL"; - $lang->image_margin = 'Lề của hình ảnh'; - - $lang->about_url_link_open_window = "Mở ra trang mới khi bấm vào hình"; - $lang->cmd_get_scale = "Lấy kích thước thật của hình"; +image_url = "Đường dẫn"; + $lang->image_alt = "Mô tả"; + $lang->image_scale = "Kích thước"; + $lang->image_align = "Căn chỉnh"; + $lang->image_align_normal = "Một khoảng bài viết"; + $lang->image_align_left = "Bên trái bài viết"; + $lang->image_align_middle = "Giữa"; + $lang->image_align_right = "Bên phải bài viết"; + $lang->image_border = "Độ dày viền"; + $lang->urllink_url = "URL"; + $lang->image_margin = 'Lề của hình ảnh'; + + $lang->about_url_link_open_window = "Mở ra trang mới khi bấm vào hình"; + $lang->cmd_get_scale = "Lấy kích thước thật của hình"; ?> \ No newline at end of file diff --git a/modules/editor/components/image_link/lang/zh-CN.lang.php b/modules/editor/components/image_link/lang/zh-CN.lang.php index 1bc6e7452..3058d987b 100644 --- a/modules/editor/components/image_link/lang/zh-CN.lang.php +++ b/modules/editor/components/image_link/lang/zh-CN.lang.php @@ -1,23 +1,23 @@ - 图像链接(image_link) 组件的语言包 - **/ - - $lang->image_url = "图像路径"; - $lang->image_alt = "图像说明"; - $lang->image_scale = "图像大小"; - $lang->image_align = "对齐方式"; - $lang->image_align_normal = "占一个段落"; - $lang->image_align_left = "内容左侧"; - $lang->image_align_middle = "居中"; - $lang->image_align_right = "内容右侧"; - $lang->image_border = "边框粗细"; - $lang->image_margin = '外边距'; - - $lang->urllink_open_window = '新窗口打开'; - $lang->about_url_link_open_window = "将在新窗口中打开链接。"; - - $lang->cmd_get_scale = "获得图片大小"; -?> + 图像链接(image_link) 组件的语言包 + **/ + + $lang->image_url = "图像路径"; + $lang->image_alt = "图像说明"; + $lang->image_scale = "图像大小"; + $lang->image_align = "对齐方式"; + $lang->image_align_normal = "占一个段落"; + $lang->image_align_left = "内容左侧"; + $lang->image_align_middle = "居中"; + $lang->image_align_right = "内容右侧"; + $lang->image_border = "边框粗细"; + $lang->image_margin = '外边距'; + + $lang->urllink_open_window = '新窗口打开'; + $lang->about_url_link_open_window = "将在新窗口中打开链接。"; + + $lang->cmd_get_scale = "获得图片大小"; +?> diff --git a/modules/editor/components/image_link/lang/zh-TW.lang.php b/modules/editor/components/image_link/lang/zh-TW.lang.php index 1c63b2e22..5a94e4fa6 100644 --- a/modules/editor/components/image_link/lang/zh-TW.lang.php +++ b/modules/editor/components/image_link/lang/zh-TW.lang.php @@ -1,22 +1,22 @@ - 圖片連結(image_link)組件語言 - **/ - - $lang->image_url = "圖片路徑"; - $lang->image_alt = "圖片說明"; - $lang->image_scale = "圖片大小"; - $lang->image_align = "對齊方式"; - $lang->image_align_normal = "段落"; - $lang->image_align_left = "靠左"; - $lang->image_align_middle = "置中"; - $lang->image_align_right = "靠右"; - $lang->image_border = "邊框粗細"; - $lang->urllink_url = "網址"; - $lang->image_margin = '圖片邊距'; - - $lang->about_url_link_open_window = "開啟連結於新視窗。"; - $lang->cmd_get_scale = "取得圖片大小"; -?> + 圖片連結(image_link)組件語言 + **/ + + $lang->image_url = "圖片路徑"; + $lang->image_alt = "圖片說明"; + $lang->image_scale = "圖片大小"; + $lang->image_align = "對齊方式"; + $lang->image_align_normal = "段落"; + $lang->image_align_left = "靠左"; + $lang->image_align_middle = "置中"; + $lang->image_align_right = "靠右"; + $lang->image_border = "邊框粗細"; + $lang->urllink_url = "網址"; + $lang->image_margin = '圖片邊距'; + + $lang->about_url_link_open_window = "開啟連結於新視窗。"; + $lang->cmd_get_scale = "取得圖片大小"; +?> diff --git a/modules/editor/components/multimedia_link/info.xml b/modules/editor/components/multimedia_link/info.xml index ccc962535..511899ca5 100644 --- a/modules/editor/components/multimedia_link/info.xml +++ b/modules/editor/components/multimedia_link/info.xml @@ -1,35 +1,35 @@ - - - 멀티미디어 자료 관리 - マルチメディア管理 - 多媒体 - Manage Multimedia Data - Administrar datos multimedia - Управление мультимедиа данными - 多媒體管理 - Chèn Media vào bài viết - Çoklu Ortam Verisi Yönetme - 에디터에 wmv,avi,flv등의 멀티미디어 자료를 추가하거나 속성을 수정할 수 있습니다. - エディターに拡張子が「wmv,avi,flv」などのマルチメディアコンテンツを追加、または属性の修正ができます。 - 插入wmv,avi,flv等多媒体文件或修改其相应属性 。 - It can add multimedia data like wmv,avi,flv to editor or change the attribution of multimedia data. - Se pueden agregar datos multimedia como wmv, avi, flv al editor o cambiar la atribución de datos multimedia. - Это может добавить мультимедиа данные как wmv,avi,flv в редактор или изменить параметры данных мультимедиа. - 可新增 wmv、avi、flv 等多媒體檔案或修改其相關屬性。 - Chèn Media dạng '.wmv,.avi,.flv,.mp3,.wma' vào bài viết. - wmv, avi, flv gibi çoklu ortam dosyalarını editöre ekleyebilir veya çoklu ortam dosyasının niteliğini değiştirebilir. - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 멀티미디어 자료 관리 + マルチメディア管理 + 多媒体 + Manage Multimedia Data + Administrar datos multimedia + Управление мультимедиа данными + 多媒體管理 + Chèn Media vào bài viết + Çoklu Ortam Verisi Yönetme + 에디터에 wmv,avi,flv등의 멀티미디어 자료를 추가하거나 속성을 수정할 수 있습니다. + エディターに拡張子が「wmv,avi,flv」などのマルチメディアコンテンツを追加、または属性の修正ができます。 + 插入wmv,avi,flv等多媒体文件或修改其相应属性 。 + It can add multimedia data like wmv,avi,flv to editor or change the attribution of multimedia data. + Se pueden agregar datos multimedia como wmv, avi, flv al editor o cambiar la atribución de datos multimedia. + Это может добавить мультимедиа данные как wmv,avi,flv в редактор или изменить параметры данных мультимедиа. + 可新增 wmv、avi、flv 等多媒體檔案或修改其相關屬性。 + Chèn Media dạng '.wmv,.avi,.flv,.mp3,.wma' vào bài viết. + wmv, avi, flv gibi çoklu ortam dosyalarını editöre ekleyebilir veya çoklu ortam dosyasının niteliğini değiştirebilir. + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/editor/components/multimedia_link/lang/en.lang.php b/modules/editor/components/multimedia_link/lang/en.lang.php index 7b33ccba7..8076498bf 100644 --- a/modules/editor/components/multimedia_link/lang/en.lang.php +++ b/modules/editor/components/multimedia_link/lang/en.lang.php @@ -1,13 +1,13 @@ - language pack of multimedia_link component - **/ - - $lang->multimedia_url = "Multimedia Path"; - $lang->multimedia_caption = "Input Description"; - $lang->multimedia_width = "Width"; - $lang->multimedia_height = "Height"; - $lang->multimedia_auto_start = "Auto Start"; -?> + language pack of multimedia_link component + **/ + + $lang->multimedia_url = "Multimedia Path"; + $lang->multimedia_caption = "Input Description"; + $lang->multimedia_width = "Width"; + $lang->multimedia_height = "Height"; + $lang->multimedia_auto_start = "Auto Start"; +?> diff --git a/modules/editor/components/multimedia_link/lang/es.lang.php b/modules/editor/components/multimedia_link/lang/es.lang.php index bf537550c..a2614d825 100644 --- a/modules/editor/components/multimedia_link/lang/es.lang.php +++ b/modules/editor/components/multimedia_link/lang/es.lang.php @@ -1,14 +1,14 @@ - language pack of multimedia_link component - **/ - - $lang->multimedia_url = "Sendero Multimedia"; - $lang->multimedia_caption = "Descripcion de Entrada"; - $lang->multimedia_width = "Ancho"; - $lang->multimedia_height = "Altura"; - $lang->multimedia_auto_start = "Auto Start"; - -?> + language pack of multimedia_link component + **/ + + $lang->multimedia_url = "Sendero Multimedia"; + $lang->multimedia_caption = "Descripcion de Entrada"; + $lang->multimedia_width = "Ancho"; + $lang->multimedia_height = "Altura"; + $lang->multimedia_auto_start = "Auto Start"; + +?> diff --git a/modules/editor/components/multimedia_link/lang/jp.lang.php b/modules/editor/components/multimedia_link/lang/jp.lang.php index 2e25f1659..bec35bbdc 100644 --- a/modules/editor/components/multimedia_link/lang/jp.lang.php +++ b/modules/editor/components/multimedia_link/lang/jp.lang.php @@ -1,18 +1,18 @@ - マルチメディアリンク((multimedia_link)コンポネント言語パッケージ - **/ - - $lang->multimedia_url = "マルチメディアのパス"; - $lang->multimedia_caption = "説明入力"; - $lang->multimedia_width = "横幅サイズ"; - $lang->multimedia_height = "縦幅サイズ"; - $lang->multimedia_auto_start = "自動再生"; - $lang->multimedia_wmode = '位置'; - - $lang->multimedia_wmode_window = '常に上へ'; - $lang->multimedia_wmode_opaque = '不透明背景'; - $lang->multimedia_wmode_transparent = '透明背景'; -?> + マルチメディアリンク((multimedia_link)コンポネント言語パッケージ + **/ + + $lang->multimedia_url = "マルチメディアのパス"; + $lang->multimedia_caption = "説明入力"; + $lang->multimedia_width = "横幅サイズ"; + $lang->multimedia_height = "縦幅サイズ"; + $lang->multimedia_auto_start = "自動再生"; + $lang->multimedia_wmode = '位置'; + + $lang->multimedia_wmode_window = '常に上へ'; + $lang->multimedia_wmode_opaque = '不透明背景'; + $lang->multimedia_wmode_transparent = '透明背景'; +?> diff --git a/modules/editor/components/multimedia_link/lang/ko.lang.php b/modules/editor/components/multimedia_link/lang/ko.lang.php index 8a5adc012..9ac9655bd 100644 --- a/modules/editor/components/multimedia_link/lang/ko.lang.php +++ b/modules/editor/components/multimedia_link/lang/ko.lang.php @@ -1,18 +1,18 @@ - 멀티미디어 링크 (multimedia_link) 컴포넌트의 언어팩 - **/ - - $lang->multimedia_url = '멀티미디어 경로'; - $lang->multimedia_caption = '설명 입력'; - $lang->multimedia_width = '가로'; - $lang->multimedia_height = '세로'; - $lang->multimedia_auto_start = '자동 시작'; - $lang->multimedia_wmode = '위치'; - - $lang->multimedia_wmode_window = '항상 위'; - $lang->multimedia_wmode_opaque = '배경 불투명'; - $lang->multimedia_wmode_transparent = '배경 투명'; -?> + 멀티미디어 링크 (multimedia_link) 컴포넌트의 언어팩 + **/ + + $lang->multimedia_url = '멀티미디어 경로'; + $lang->multimedia_caption = '설명 입력'; + $lang->multimedia_width = '가로'; + $lang->multimedia_height = '세로'; + $lang->multimedia_auto_start = '자동 시작'; + $lang->multimedia_wmode = '위치'; + + $lang->multimedia_wmode_window = '항상 위'; + $lang->multimedia_wmode_opaque = '배경 불투명'; + $lang->multimedia_wmode_transparent = '배경 투명'; +?> diff --git a/modules/editor/components/multimedia_link/lang/ru.lang.php b/modules/editor/components/multimedia_link/lang/ru.lang.php index 7672afa58..135e3ebee 100644 --- a/modules/editor/components/multimedia_link/lang/ru.lang.php +++ b/modules/editor/components/multimedia_link/lang/ru.lang.php @@ -1,13 +1,13 @@ - | translation by Maslennikov Evgeny aka X-[Vr]bL1s5 | e-mail: x-bliss[a]tut.by; ICQ: 225035467; - * @brief editor module > language pack of multimedia_link component - **/ - - $lang->multimedia_url = "Путь мультимедиа"; - $lang->multimedia_caption = "Введите описание"; - $lang->multimedia_width = "Ширина"; - $lang->multimedia_height = "Высота"; - $lang->multimedia_auto_start = "Автозапуск"; -?> + | translation by Maslennikov Evgeny aka X-[Vr]bL1s5 | e-mail: x-bliss[a]tut.by; ICQ: 225035467; + * @brief editor module > language pack of multimedia_link component + **/ + + $lang->multimedia_url = "Путь мультимедиа"; + $lang->multimedia_caption = "Введите описание"; + $lang->multimedia_width = "Ширина"; + $lang->multimedia_height = "Высота"; + $lang->multimedia_auto_start = "Автозапуск"; +?> diff --git a/modules/editor/components/multimedia_link/lang/tr.lang.php b/modules/editor/components/multimedia_link/lang/tr.lang.php index 4a2712f96..7519adacc 100644 --- a/modules/editor/components/multimedia_link/lang/tr.lang.php +++ b/modules/editor/components/multimedia_link/lang/tr.lang.php @@ -1,13 +1,13 @@ - language pack of multimedia_link component - **/ - - $lang->multimedia_url = "Çoklu Ortam Yolu"; - $lang->multimedia_caption = "Açıklama Girin"; - $lang->multimedia_width = "Genişlik"; - $lang->multimedia_height = "Yükseklik"; - $lang->multimedia_auto_start = "Otomatik Başlangıç"; -?> + language pack of multimedia_link component + **/ + + $lang->multimedia_url = "Çoklu Ortam Yolu"; + $lang->multimedia_caption = "Açıklama Girin"; + $lang->multimedia_width = "Genişlik"; + $lang->multimedia_height = "Yükseklik"; + $lang->multimedia_auto_start = "Otomatik Başlangıç"; +?> diff --git a/modules/editor/components/multimedia_link/lang/vi.lang.php b/modules/editor/components/multimedia_link/lang/vi.lang.php index c3afc5bce..89db4b2ba 100644 --- a/modules/editor/components/multimedia_link/lang/vi.lang.php +++ b/modules/editor/components/multimedia_link/lang/vi.lang.php @@ -1,15 +1,15 @@ -multimedia_url = "Đường dẫn Media"; - $lang->multimedia_caption = "Mô tả Media"; - $lang->multimedia_width = "Chiều rộng"; - $lang->multimedia_height = "Chiều cao"; - $lang->multimedia_auto_start = "Tự động Play"; -?> +multimedia_url = "Đường dẫn Media"; + $lang->multimedia_caption = "Mô tả Media"; + $lang->multimedia_width = "Chiều rộng"; + $lang->multimedia_height = "Chiều cao"; + $lang->multimedia_auto_start = "Tự động Play"; +?> diff --git a/modules/editor/components/multimedia_link/lang/zh-CN.lang.php b/modules/editor/components/multimedia_link/lang/zh-CN.lang.php index 0ce3e79ce..e45079c55 100644 --- a/modules/editor/components/multimedia_link/lang/zh-CN.lang.php +++ b/modules/editor/components/multimedia_link/lang/zh-CN.lang.php @@ -1,13 +1,13 @@ - 媒体链接 (multimedia_link) 组件的语言包 - **/ - - $lang->multimedia_url = "媒体路径"; - $lang->multimedia_caption = "输入说明"; - $lang->multimedia_width = "宽度"; - $lang->multimedia_height = "高度"; - $lang->multimedia_auto_start = "自动播放"; -?> + 媒体链接 (multimedia_link) 组件的语言包 + **/ + + $lang->multimedia_url = "媒体路径"; + $lang->multimedia_caption = "输入说明"; + $lang->multimedia_width = "宽度"; + $lang->multimedia_height = "高度"; + $lang->multimedia_auto_start = "自动播放"; +?> diff --git a/modules/editor/components/multimedia_link/lang/zh-TW.lang.php b/modules/editor/components/multimedia_link/lang/zh-TW.lang.php index ca4ed9823..444699359 100644 --- a/modules/editor/components/multimedia_link/lang/zh-TW.lang.php +++ b/modules/editor/components/multimedia_link/lang/zh-TW.lang.php @@ -1,17 +1,17 @@ - 多媒體連結 (multimedia_link) 組件的語言 - **/ - - $lang->multimedia_url = "多媒體路徑"; - $lang->multimedia_caption = "輸入說明"; - $lang->multimedia_width = "寬度"; - $lang->multimedia_height = "高度"; - $lang->multimedia_auto_start = "自動播放"; - - $lang->multimedia_wmode_window = '總是在上'; - $lang->multimedia_wmode_opaque = '背景不透明'; - $lang->multimedia_wmode_transparent = '透明背景'; -?> + 多媒體連結 (multimedia_link) 組件的語言 + **/ + + $lang->multimedia_url = "多媒體路徑"; + $lang->multimedia_caption = "輸入說明"; + $lang->multimedia_width = "寬度"; + $lang->multimedia_height = "高度"; + $lang->multimedia_auto_start = "自動播放"; + + $lang->multimedia_wmode_window = '總是在上'; + $lang->multimedia_wmode_opaque = '背景不透明'; + $lang->multimedia_wmode_transparent = '透明背景'; +?> diff --git a/modules/editor/components/multimedia_link/multimedia_link.class.php b/modules/editor/components/multimedia_link/multimedia_link.class.php index efce7a308..5a226f677 100644 --- a/modules/editor/components/multimedia_link/multimedia_link.class.php +++ b/modules/editor/components/multimedia_link/multimedia_link.class.php @@ -1,71 +1,71 @@ -editor_sequence = $editor_sequence; - $this->component_path = $component_path; - } - - /** - * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 - **/ - function getPopupContent() { - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->component_path.'tpl'; - $tpl_file = 'popup.html'; - - Context::set("tpl_path", $tpl_path); - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - /** - * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method - * - * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 - * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 - **/ - function transHTML($xml_obj) { - $src = $xml_obj->attrs->multimedia_src; - $style = $xml_obj->attrs->style; - - preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$style,$matches); - $width = trim($matches[3][0]); - $height = trim($matches[3][1]); - if(!$width) $width = 400; - if(!$height) $height = 400; - - $auto_start = $xml_obj->attrs->auto_start; - if($auto_start!="true") $auto_start = "false"; - else $auto_start = "true"; - - $wmode = $xml_obj->attrs->wmode; - if($wmode == 'window') $wmode = 'window'; - elseif($wmode == 'opaque') $wmode = 'opaque'; - else $wmode = 'transparent'; - - - $caption = $xml_obj->body; - - $src = str_replace(array('&','"'), array('&','&qout;'), $src); - $src = str_replace('&amp;', '&', $src); - - if(Context::getResponseMethod() != "XMLRPC") return sprintf("", $src, $width, $height, $auto_start, $wmode); - else return sprintf("

            Attached Multimedia
            ", $width, $height, ($height/2-16), ($width/2-31), Context::getRequestUri().'./modules/editor/components/multimedia_link/tpl/multimedia_link_component.gif'); - } - } -?> +editor_sequence = $editor_sequence; + $this->component_path = $component_path; + } + + /** + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 + **/ + function getPopupContent() { + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return + $tpl_path = $this->component_path.'tpl'; + $tpl_file = 'popup.html'; + + Context::set("tpl_path", $tpl_path); + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method + * + * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 + * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 + **/ + function transHTML($xml_obj) { + $src = $xml_obj->attrs->multimedia_src; + $style = $xml_obj->attrs->style; + + preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$style,$matches); + $width = trim($matches[3][0]); + $height = trim($matches[3][1]); + if(!$width) $width = 400; + if(!$height) $height = 400; + + $auto_start = $xml_obj->attrs->auto_start; + if($auto_start!="true") $auto_start = "false"; + else $auto_start = "true"; + + $wmode = $xml_obj->attrs->wmode; + if($wmode == 'window') $wmode = 'window'; + elseif($wmode == 'opaque') $wmode = 'opaque'; + else $wmode = 'transparent'; + + + $caption = $xml_obj->body; + + $src = str_replace(array('&','"'), array('&','&qout;'), $src); + $src = str_replace('&amp;', '&', $src); + + if(Context::getResponseMethod() != "XMLRPC") return sprintf("", $src, $width, $height, $auto_start, $wmode); + else return sprintf("

            Attached Multimedia
            ", $width, $height, ($height/2-16), ($width/2-31), Context::getRequestUri().'./modules/editor/components/multimedia_link/tpl/multimedia_link_component.gif'); + } + } +?> diff --git a/modules/editor/components/poll_maker/info.xml b/modules/editor/components/poll_maker/info.xml index b6f226866..c4c7654a0 100644 --- a/modules/editor/components/poll_maker/info.xml +++ b/modules/editor/components/poll_maker/info.xml @@ -1,35 +1,35 @@ - - - Thăm dò ý kiến - 설문조사 컴포넌트 - アンケート調査 - 投票调查 - Poll Component - Componente Poll - Компонент опросов - 投票調查 - Oylama Bileşenleri - Bạn có thể tạo một cuộc thăm dò cho chủ đề của mình. - 글 작성시에 설문조사를 첨부하실 수 있습니다. 설문조사 컴포넌트는 설문조사 모듈의 설정에 영향을 받습니다. - 書き込みの時、アンケート機能の追加ができます。アンケートモジュールの影響を受けます。 - 发表主题时可以附加投票调查。投票调查组件受投票调查模块设置的影响。 - You can attach a poll on writing articles. Poll component is affected by setting of poll module. - Puede adjuntar una encuesta sobre la redacción de artículos. Encuesta componente se ve afectada por la configuración de módulo de encuesta. - Вы можете присоединить опрос при написании статей. Компонент опросов зависит от настроек модуля отпросов. - 發表主題時可以附加投票調查。投票調查組件受投票調查模組設置的影響。 - Oylamaları yazı makalelerine ekleyebilirsiniz. Oylama bileşeni, oylama modülü ayarlarından ayarlanır. - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + Thăm dò ý kiến + 설문조사 컴포넌트 + アンケート調査 + 投票调查 + Poll Component + Componente Poll + Компонент опросов + 投票調查 + Oylama Bileşenleri + Bạn có thể tạo một cuộc thăm dò cho chủ đề của mình. + 글 작성시에 설문조사를 첨부하실 수 있습니다. 설문조사 컴포넌트는 설문조사 모듈의 설정에 영향을 받습니다. + 書き込みの時、アンケート機能の追加ができます。アンケートモジュールの影響を受けます。 + 发表主题时可以附加投票调查。投票调查组件受投票调查模块设置的影响。 + You can attach a poll on writing articles. Poll component is affected by setting of poll module. + Puede adjuntar una encuesta sobre la redacción de artículos. Encuesta componente se ve afectada por la configuración de módulo de encuesta. + Вы можете присоединить опрос при написании статей. Компонент опросов зависит от настроек модуля отпросов. + 發表主題時可以附加投票調查。投票調查組件受投票調查模組設置的影響。 + Oylamaları yazı makalelerine ekleyebilirsiniz. Oylama bileşeni, oylama modülü ayarlarından ayarlanır. + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/editor/components/poll_maker/lang/en.lang.php b/modules/editor/components/poll_maker/lang/en.lang.php index 1ebc2bc55..a641b3329 100644 --- a/modules/editor/components/poll_maker/lang/en.lang.php +++ b/modules/editor/components/poll_maker/lang/en.lang.php @@ -1,18 +1,18 @@ - language pack of poll_maker component - **/ - - $lang->poll_title = "Title"; - $lang->poll_item = "Items"; - $lang->poll_stop_date = "Expiration Date"; - $lang->poll_chk_count = "Number of Checking Item"; - - $lang->cmd_add_poll = "Add Poll"; - $lang->cmd_del_poll = "Delete Poll"; - $lang->cmd_add_item = "Add Item"; - - $lang->msg_poll_cannot_modify = "You cannot modify the poll. It should be deleted to create a new poll"; -?> + language pack of poll_maker component + **/ + + $lang->poll_title = "Title"; + $lang->poll_item = "Items"; + $lang->poll_stop_date = "Expiration Date"; + $lang->poll_chk_count = "Number of Checking Item"; + + $lang->cmd_add_poll = "Add Poll"; + $lang->cmd_del_poll = "Delete Poll"; + $lang->cmd_add_item = "Add Item"; + + $lang->msg_poll_cannot_modify = "You cannot modify the poll. It should be deleted to create a new poll"; +?> diff --git a/modules/editor/components/poll_maker/lang/es.lang.php b/modules/editor/components/poll_maker/lang/es.lang.php index d6bd3667a..ba7fba5a0 100644 --- a/modules/editor/components/poll_maker/lang/es.lang.php +++ b/modules/editor/components/poll_maker/lang/es.lang.php @@ -1,19 +1,19 @@ - language pack of poll_maker component - **/ - - $lang->poll_title = "Titulo"; - $lang->poll_item = "Temas"; - $lang->poll_stop_date = "Fecha de Expiracion"; - $lang->poll_chk_count = "Numero de Comprobacion de Partida"; - - $lang->cmd_add_poll = "Anadir Encuesta"; - $lang->cmd_del_poll = "Borrar encuesta"; - $lang->cmd_add_item = "Anadir Tema"; - - $lang->msg_poll_cannot_modify = "No se puede modificar la encuesta. Por lo que debe suprimirse para crear una nueva encuesta"; - -?> + language pack of poll_maker component + **/ + + $lang->poll_title = "Titulo"; + $lang->poll_item = "Temas"; + $lang->poll_stop_date = "Fecha de Expiracion"; + $lang->poll_chk_count = "Numero de Comprobacion de Partida"; + + $lang->cmd_add_poll = "Anadir Encuesta"; + $lang->cmd_del_poll = "Borrar encuesta"; + $lang->cmd_add_item = "Anadir Tema"; + + $lang->msg_poll_cannot_modify = "No se puede modificar la encuesta. Por lo que debe suprimirse para crear una nueva encuesta"; + +?> diff --git a/modules/editor/components/poll_maker/lang/jp.lang.php b/modules/editor/components/poll_maker/lang/jp.lang.php index c8f907f7a..1fd155c15 100644 --- a/modules/editor/components/poll_maker/lang/jp.lang.php +++ b/modules/editor/components/poll_maker/lang/jp.lang.php @@ -1,18 +1,18 @@ - アンケート調査言語パッケージ - **/ - - $lang->poll_title = "タイトル"; - $lang->poll_item = "項目"; - $lang->poll_stop_date = "終了日"; - $lang->poll_chk_count = "選択項目数"; - - $lang->cmd_add_poll = "アンケート追加"; - $lang->cmd_del_poll = "アンケート削除"; - $lang->cmd_add_item = "項目追加"; - - $lang->msg_poll_cannot_modify = 'アンケートは修正出来ません。削除後、改めて新しく作成して下さい。'; -?> + アンケート調査言語パッケージ + **/ + + $lang->poll_title = "タイトル"; + $lang->poll_item = "項目"; + $lang->poll_stop_date = "終了日"; + $lang->poll_chk_count = "選択項目数"; + + $lang->cmd_add_poll = "アンケート追加"; + $lang->cmd_del_poll = "アンケート削除"; + $lang->cmd_add_item = "項目追加"; + + $lang->msg_poll_cannot_modify = 'アンケートは修正出来ません。削除後、改めて新しく作成して下さい。'; +?> diff --git a/modules/editor/components/poll_maker/lang/ko.lang.php b/modules/editor/components/poll_maker/lang/ko.lang.php index f320afb37..6f67bf0be 100644 --- a/modules/editor/components/poll_maker/lang/ko.lang.php +++ b/modules/editor/components/poll_maker/lang/ko.lang.php @@ -1,18 +1,18 @@ - 설문조사 컴포넌트의 언어팩 - **/ - - $lang->poll_title = '제목'; - $lang->poll_item = '항목'; - $lang->poll_stop_date = '종료 일자'; - $lang->poll_chk_count = '선택항목 수'; - - $lang->cmd_add_poll = '설문 추가'; - $lang->cmd_del_poll = '설문 제거'; - $lang->cmd_add_item = '항목 추가'; - - $lang->msg_poll_cannot_modify = '설문조사는 수정하실 수 없습니다. 삭제 후 다시 생성하셔야 합니다.'; -?> + 설문조사 컴포넌트의 언어팩 + **/ + + $lang->poll_title = '제목'; + $lang->poll_item = '항목'; + $lang->poll_stop_date = '종료 일자'; + $lang->poll_chk_count = '선택항목 수'; + + $lang->cmd_add_poll = '설문 추가'; + $lang->cmd_del_poll = '설문 제거'; + $lang->cmd_add_item = '항목 추가'; + + $lang->msg_poll_cannot_modify = '설문조사는 수정하실 수 없습니다. 삭제 후 다시 생성하셔야 합니다.'; +?> diff --git a/modules/editor/components/poll_maker/lang/ru.lang.php b/modules/editor/components/poll_maker/lang/ru.lang.php index 4e1716d20..04e0e2a62 100644 --- a/modules/editor/components/poll_maker/lang/ru.lang.php +++ b/modules/editor/components/poll_maker/lang/ru.lang.php @@ -1,18 +1,18 @@ - language pack of poll_maker component - **/ - - $lang->poll_title = "Заголовок"; - $lang->poll_item = "Пункты"; - $lang->poll_stop_date = "Дата истечения"; - $lang->poll_chk_count = "Число пунктов выбора"; - - $lang->cmd_add_poll = "Добавить опрос"; - $lang->cmd_del_poll = "Удалить опрос"; - $lang->cmd_add_item = "Добавить пункт"; - - $lang->msg_poll_cannot_modify = "Вы не можете изменить этот опрос. Его следует удалить для того, чтобы создать новый."; -?> + language pack of poll_maker component + **/ + + $lang->poll_title = "Заголовок"; + $lang->poll_item = "Пункты"; + $lang->poll_stop_date = "Дата истечения"; + $lang->poll_chk_count = "Число пунктов выбора"; + + $lang->cmd_add_poll = "Добавить опрос"; + $lang->cmd_del_poll = "Удалить опрос"; + $lang->cmd_add_item = "Добавить пункт"; + + $lang->msg_poll_cannot_modify = "Вы не можете изменить этот опрос. Его следует удалить для того, чтобы создать новый."; +?> diff --git a/modules/editor/components/poll_maker/lang/tr.lang.php b/modules/editor/components/poll_maker/lang/tr.lang.php index 72b0750ae..6072b9e6e 100644 --- a/modules/editor/components/poll_maker/lang/tr.lang.php +++ b/modules/editor/components/poll_maker/lang/tr.lang.php @@ -1,18 +1,18 @@ - language pack of poll_maker component - **/ - - $lang->poll_title = "Başlık"; - $lang->poll_item = "Parça"; - $lang->poll_stop_date = "Sonlandırma Tarihi"; - $lang->poll_chk_count = "Denetlenen Parça Sayısı"; - - $lang->cmd_add_poll = "Oylama Ekle"; - $lang->cmd_del_poll = "Parçayı Sil"; - $lang->cmd_add_item = "Parça Ekle"; - - $lang->msg_poll_cannot_modify = "Oylamayı düzenleyemezsiniz. Yeni oylama oluşturmak için, oylamanın silinmesi gerekiyor."; -?> + language pack of poll_maker component + **/ + + $lang->poll_title = "Başlık"; + $lang->poll_item = "Parça"; + $lang->poll_stop_date = "Sonlandırma Tarihi"; + $lang->poll_chk_count = "Denetlenen Parça Sayısı"; + + $lang->cmd_add_poll = "Oylama Ekle"; + $lang->cmd_del_poll = "Parçayı Sil"; + $lang->cmd_add_item = "Parça Ekle"; + + $lang->msg_poll_cannot_modify = "Oylamayı düzenleyemezsiniz. Yeni oylama oluşturmak için, oylamanın silinmesi gerekiyor."; +?> diff --git a/modules/editor/components/poll_maker/lang/vi.lang.php b/modules/editor/components/poll_maker/lang/vi.lang.php index 0482e6c34..75f5c79e4 100644 --- a/modules/editor/components/poll_maker/lang/vi.lang.php +++ b/modules/editor/components/poll_maker/lang/vi.lang.php @@ -1,20 +1,20 @@ -poll_title = "Tiêu đề"; - $lang->poll_item = "Mục"; - $lang->poll_stop_date = "Ngày hết hạn"; - $lang->poll_chk_count = "Số phiếu"; - - $lang->cmd_add_poll = "Tạo thăm dò"; - $lang->cmd_del_poll = "Xóa thăm dò"; - $lang->cmd_add_item = "Thêm mục"; - - $lang->msg_poll_cannot_modify = "Bạn không thể sửa đổi được. Nó sẽ được xóa để tạo cuộc thăm dò mới."; -?> +poll_title = "Tiêu đề"; + $lang->poll_item = "Mục"; + $lang->poll_stop_date = "Ngày hết hạn"; + $lang->poll_chk_count = "Số phiếu"; + + $lang->cmd_add_poll = "Tạo thăm dò"; + $lang->cmd_del_poll = "Xóa thăm dò"; + $lang->cmd_add_item = "Thêm mục"; + + $lang->msg_poll_cannot_modify = "Bạn không thể sửa đổi được. Nó sẽ được xóa để tạo cuộc thăm dò mới."; +?> diff --git a/modules/editor/components/poll_maker/lang/zh-CN.lang.php b/modules/editor/components/poll_maker/lang/zh-CN.lang.php index ed811772a..6cafbb50d 100644 --- a/modules/editor/components/poll_maker/lang/zh-CN.lang.php +++ b/modules/editor/components/poll_maker/lang/zh-CN.lang.php @@ -1,18 +1,18 @@ - 投票调查组件语言包 - **/ - - $lang->poll_title = "标题"; - $lang->poll_item = "项目"; - $lang->poll_stop_date = "结束日期"; - $lang->poll_chk_count = "选择项目数"; - - $lang->cmd_add_poll = "添加投票"; - $lang->cmd_del_poll = "解除投票"; - $lang->cmd_add_item = "添加项目"; - - $lang->msg_poll_cannot_modify = '投票调查不提供修改功能。必须删除后再生成'; -?> + 投票调查组件语言包 + **/ + + $lang->poll_title = "标题"; + $lang->poll_item = "项目"; + $lang->poll_stop_date = "结束日期"; + $lang->poll_chk_count = "选择项目数"; + + $lang->cmd_add_poll = "添加投票"; + $lang->cmd_del_poll = "解除投票"; + $lang->cmd_add_item = "添加项目"; + + $lang->msg_poll_cannot_modify = '投票调查不提供修改功能。必须删除后再生成'; +?> diff --git a/modules/editor/components/poll_maker/lang/zh-TW.lang.php b/modules/editor/components/poll_maker/lang/zh-TW.lang.php index f691de9a2..78fe3c6f6 100644 --- a/modules/editor/components/poll_maker/lang/zh-TW.lang.php +++ b/modules/editor/components/poll_maker/lang/zh-TW.lang.php @@ -1,18 +1,18 @@ - 投票調查組件語言 - **/ - - $lang->poll_title = "標題"; - $lang->poll_item = "項目"; - $lang->poll_stop_date = "結束日期"; - $lang->poll_chk_count = "選擇項目數"; - - $lang->cmd_add_poll = "新增投票"; - $lang->cmd_del_poll = "刪除投票"; - $lang->cmd_add_item = "新增項目"; - - $lang->msg_poll_cannot_modify = '投票調查不提供修改功能。必須刪除後再新增'; -?> + 投票調查組件語言 + **/ + + $lang->poll_title = "標題"; + $lang->poll_item = "項目"; + $lang->poll_stop_date = "結束日期"; + $lang->poll_chk_count = "選擇項目數"; + + $lang->cmd_add_poll = "新增投票"; + $lang->cmd_del_poll = "刪除投票"; + $lang->cmd_add_item = "新增項目"; + + $lang->msg_poll_cannot_modify = '投票調查不提供修改功能。必須刪除後再新增'; +?> diff --git a/modules/editor/components/poll_maker/poll_maker.class.php b/modules/editor/components/poll_maker/poll_maker.class.php index 96eabf422..be43dcb95 100644 --- a/modules/editor/components/poll_maker/poll_maker.class.php +++ b/modules/editor/components/poll_maker/poll_maker.class.php @@ -1,60 +1,60 @@ -editor_sequence = $editor_sequence; - $this->component_path = $component_path; - } - - /** - * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 - **/ - function getPopupContent() { - // 설문조사 스킨을 구함 - $oModuleModel = &getModel('module'); - $skin_list = $oModuleModel->getSkins("./modules/poll/"); - Context::set('skin_list', $skin_list); - - // 템플릿을 미리 컴파일해서 컴파일된 소스를 return - $tpl_path = $this->component_path.'tpl'; - $tpl_file = 'popup.html'; - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - /** - * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method - * - * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 - * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 - **/ - function transHTML($xml_obj) { - $poll_srl = $xml_obj->attrs->poll_srl; - $skin = $xml_obj->attrs->skin; - if(!$skin) $skin = 'default'; - - preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); - $width = $matches[2]; - if(!$width) $width = 400; - $style = sprintf('width:%dpx', $width); - - // poll model 객체 생성해서 html 얻어와서 return - $oPollModel = &getModel('poll'); - return $oPollModel->getPollHtml($poll_srl, $style, $skin); - } - } -?> +editor_sequence = $editor_sequence; + $this->component_path = $component_path; + } + + /** + * @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다 + **/ + function getPopupContent() { + // 설문조사 스킨을 구함 + $oModuleModel = &getModel('module'); + $skin_list = $oModuleModel->getSkins("./modules/poll/"); + Context::set('skin_list', $skin_list); + + // 템플릿을 미리 컴파일해서 컴파일된 소스를 return + $tpl_path = $this->component_path.'tpl'; + $tpl_file = 'popup.html'; + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method + * + * 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서 + * DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경 + **/ + function transHTML($xml_obj) { + $poll_srl = $xml_obj->attrs->poll_srl; + $skin = $xml_obj->attrs->skin; + if(!$skin) $skin = 'default'; + + preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches); + $width = $matches[2]; + if(!$width) $width = 400; + $style = sprintf('width:%dpx', $width); + + // poll model 객체 생성해서 html 얻어와서 return + $oPollModel = &getModel('poll'); + return $oPollModel->getPollHtml($poll_srl, $style, $skin); + } + } +?> diff --git a/modules/editor/conf/info.xml b/modules/editor/conf/info.xml index 942689118..d16d0537c 100644 --- a/modules/editor/conf/info.xml +++ b/modules/editor/conf/info.xml @@ -1,36 +1,36 @@ - - - WYSIWYG Editor - 위지윅 에디터 - WYSIWYG Editor - Editor WYSIWYG - 网页编辑器 - ウイジウイグエディター - WYSIWYG-редактор - 網頁編輯器 - Editor WYSIWYG - Module hiển thị WYSIWYG Editor để quản lý những kiểu viết bài. - 위지윅 에디터를 출력하거나 에디터 컴포넌트들을 관리/중계하는 모듈입니다. - Module for displaying WYSIWYG editor and managing/relaying editor components. - Módulo para mostrar en la pantalla el editor de WYSIWYG y para el manejo/relato de los componentes del editor. - 显示网页编辑器或管理/传递编辑器组件的模块。 - ウイジウイグエディター を出力したり、エディターのコンポーネントを管理・中継するモジュールです。 - Модуль для отображения WYSIWYG-редактора и управления/смены записей редактора. - 顯示網頁編輯器或管理/傳遞編輯器組件的模組。 - WYSIWYG editörünü görüntüleme ve editör bileşenlerini düzenleme/aktarma için kullanılan modüldür. - 0.1 - 2007-02-28 - utility - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + WYSIWYG Editor + 위지윅 에디터 + WYSIWYG Editor + Editor WYSIWYG + 网页编辑器 + ウイジウイグエディター + WYSIWYG-редактор + 網頁編輯器 + Editor WYSIWYG + Module hiển thị WYSIWYG Editor để quản lý những kiểu viết bài. + 위지윅 에디터를 출력하거나 에디터 컴포넌트들을 관리/중계하는 모듈입니다. + Module for displaying WYSIWYG editor and managing/relaying editor components. + Módulo para mostrar en la pantalla el editor de WYSIWYG y para el manejo/relato de los componentes del editor. + 显示网页编辑器或管理/传递编辑器组件的模块。 + ウイジウイグエディター を出力したり、エディターのコンポーネントを管理・中継するモジュールです。 + Модуль для отображения WYSIWYG-редактора и управления/смены записей редактора. + 顯示網頁編輯器或管理/傳遞編輯器組件的模組。 + WYSIWYG editörünü görüntüleme ve editör bileşenlerini düzenleme/aktarma için kullanılan modüldür. + 0.1 + 2007-02-28 + utility + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/editor/conf/module.xml b/modules/editor/conf/module.xml index b2522a8d6..e1bb1140a 100644 --- a/modules/editor/conf/module.xml +++ b/modules/editor/conf/module.xml @@ -1,28 +1,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/editor/editor.admin.controller.php b/modules/editor/editor.admin.controller.php index f6d2bb629..016855db7 100644 --- a/modules/editor/editor.admin.controller.php +++ b/modules/editor/editor.admin.controller.php @@ -1,166 +1,166 @@ -component_name = Context::get('component_name'); - $args->enabled = 'Y'; - $args->site_srl = (int)$site_module_info->site_srl; - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); - else $output = executeQuery('editor.updateSiteComponent', $args); - if(!$output->toBool()) return $output; - - $oEditorController = &getController('editor'); - $oEditorController->removeCache($args->site_srl); - - $this->setMessage('success_updated'); - } - - /** - * @brief 컴포넌트의 비활성화 - **/ - function procEditorAdminDisableComponent() { - $site_module_info = Context::get('site_module_info'); - - $args->component_name = Context::get('component_name'); - $args->enabled = 'N'; - $args->site_srl = (int)$site_module_info->site_srl; - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); - else $output = executeQuery('editor.updateSiteComponent', $args); - if(!$output->toBool()) return $output; - - $oEditorController = &getController('editor'); - $oEditorController->removeCache($args->site_srl); - - $this->setMessage('success_updated'); - } - - /** - * @brief 컴포넌트의 위치 변경 - **/ - function procEditorAdminMoveListOrder() { - $site_module_info = Context::get('site_module_info'); - $args->site_srl = (int)$site_module_info->site_srl; - $args->component_name = Context::get('component_name'); - $mode = Context::get('mode'); - - // DB에서 전체 목록 가져옴 - if(!$args->site_srl) $output = executeQuery('editor.getComponentList', $args); - else $output = executeQuery('editor.getSiteComponentList', $args); - - $db_list = $output->data; - foreach($db_list as $key => $val) { - if($val->component_name == $args->component_name) break; - } - - if($mode=="up") { - if($key == 2) return new Object(-1,'msg_component_is_first_order'); - - $prev_args->component_name = $db_list[$key-1]->component_name; - $prev_args->list_order = $db_list[$key]->list_order; - $prev_args->site_srl = $args->site_srl; - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $prev_args); - else $output = executeQuery('editor.updateSiteComponent', $prev_args); - - $cur_args->component_name = $db_list[$key]->component_name; - $cur_args->list_order = $db_list[$key-1]->list_order; - if($prev_args->list_order == $cur_args->list_order) $cur_args->list_order--; - $cur_args->site_srl = $args->site_srl; - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args); - else $output = executeQuery('editor.updateSiteComponent', $cur_args); - } else { - if($key == count($db_list)-1) return new Object(-1,'msg_component_is_last_order'); - - $next_args->component_name = $db_list[$key+1]->component_name; - $next_args->list_order = $db_list[$key]->list_order; - $next_args->site_srl = $args->site_srl; - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $next_args); - else $output = executeQuery('editor.updateSiteComponent', $next_args); - - $cur_args->component_name = $db_list[$key]->component_name; - $cur_args->list_order = $db_list[$key+1]->list_order; - $cur_args->site_srl = $args->site_srl; - if($next_args->list_order == $cur_args->list_order) $cur_args->list_order++; - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args); - else $output = executeQuery('editor.updateSiteComponent', $cur_args); - } - - $oEditorController = &getController('editor'); - $oEditorController->removeCache($args->site_srl); - - $this->setMessage('success_updated'); - } - - /** - * @brief 컴포넌트 설정 - **/ - function procEditorAdminSetupComponent() { - $site_module_info = Context::get('site_module_info'); - - $component_name = Context::get('component_name'); - $extra_vars = Context::getRequestVars(); - unset($extra_vars->component_name); - unset($extra_vars->module); - unset($extra_vars->act); - unset($extra_vars->body); - - if($extra_vars->target_group) $extra_vars->target_group = explode('|@|', $extra_vars->target_group); - if($extra_vars->mid_list) $extra_vars->mid_list = explode('|@|', $extra_vars->mid_list); - - $args->component_name = $component_name; - $args->extra_vars = serialize($extra_vars); - $args->site_srl = (int)$site_module_info->site_srl; - - if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); - else $output = executeQuery('editor.updateSiteComponent', $args); - if(!$output->toBool()) return $output; - - $oEditorController = &getController('editor'); - $oEditorController->removeCache($args->site_srl); - - $this->setMessage('success_updated'); - } - - /** - * @brief 컴포넌트를 DB에 추가 - **/ - function insertComponent($component_name, $enabled = false, $site_srl = 0) { - if($enabled) $enabled = 'Y'; - else $enabled = 'N'; - - $args->component_name = $component_name; - $args->enabled = $enabled; - $args->site_srl = $site_srl; - - // 컴포넌트가 있는지 확인 - if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args); - else $output = executeQuery('editor.isSiteComponentInserted', $args); - if($output->data->count) return new Object(-1, 'msg_component_is_not_founded'); - - // 입력 - $args->list_order = getNextSequence(); - if(!$site_srl) $output = executeQuery('editor.insertComponent', $args); - else $output = executeQuery('editor.insertSiteComponent', $args); - - $oEditorController = &getController('editor'); - $oEditorController->removeCache($site_srl); - return $output; - } - } -?> +component_name = Context::get('component_name'); + $args->enabled = 'Y'; + $args->site_srl = (int)$site_module_info->site_srl; + if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); + else $output = executeQuery('editor.updateSiteComponent', $args); + if(!$output->toBool()) return $output; + + $oEditorController = &getController('editor'); + $oEditorController->removeCache($args->site_srl); + + $this->setMessage('success_updated'); + } + + /** + * @brief 컴포넌트의 비활성화 + **/ + function procEditorAdminDisableComponent() { + $site_module_info = Context::get('site_module_info'); + + $args->component_name = Context::get('component_name'); + $args->enabled = 'N'; + $args->site_srl = (int)$site_module_info->site_srl; + if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); + else $output = executeQuery('editor.updateSiteComponent', $args); + if(!$output->toBool()) return $output; + + $oEditorController = &getController('editor'); + $oEditorController->removeCache($args->site_srl); + + $this->setMessage('success_updated'); + } + + /** + * @brief 컴포넌트의 위치 변경 + **/ + function procEditorAdminMoveListOrder() { + $site_module_info = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + $args->component_name = Context::get('component_name'); + $mode = Context::get('mode'); + + // DB에서 전체 목록 가져옴 + if(!$args->site_srl) $output = executeQuery('editor.getComponentList', $args); + else $output = executeQuery('editor.getSiteComponentList', $args); + + $db_list = $output->data; + foreach($db_list as $key => $val) { + if($val->component_name == $args->component_name) break; + } + + if($mode=="up") { + if($key == 2) return new Object(-1,'msg_component_is_first_order'); + + $prev_args->component_name = $db_list[$key-1]->component_name; + $prev_args->list_order = $db_list[$key]->list_order; + $prev_args->site_srl = $args->site_srl; + if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $prev_args); + else $output = executeQuery('editor.updateSiteComponent', $prev_args); + + $cur_args->component_name = $db_list[$key]->component_name; + $cur_args->list_order = $db_list[$key-1]->list_order; + if($prev_args->list_order == $cur_args->list_order) $cur_args->list_order--; + $cur_args->site_srl = $args->site_srl; + if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args); + else $output = executeQuery('editor.updateSiteComponent', $cur_args); + } else { + if($key == count($db_list)-1) return new Object(-1,'msg_component_is_last_order'); + + $next_args->component_name = $db_list[$key+1]->component_name; + $next_args->list_order = $db_list[$key]->list_order; + $next_args->site_srl = $args->site_srl; + if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $next_args); + else $output = executeQuery('editor.updateSiteComponent', $next_args); + + $cur_args->component_name = $db_list[$key]->component_name; + $cur_args->list_order = $db_list[$key+1]->list_order; + $cur_args->site_srl = $args->site_srl; + if($next_args->list_order == $cur_args->list_order) $cur_args->list_order++; + if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $cur_args); + else $output = executeQuery('editor.updateSiteComponent', $cur_args); + } + + $oEditorController = &getController('editor'); + $oEditorController->removeCache($args->site_srl); + + $this->setMessage('success_updated'); + } + + /** + * @brief 컴포넌트 설정 + **/ + function procEditorAdminSetupComponent() { + $site_module_info = Context::get('site_module_info'); + + $component_name = Context::get('component_name'); + $extra_vars = Context::getRequestVars(); + unset($extra_vars->component_name); + unset($extra_vars->module); + unset($extra_vars->act); + unset($extra_vars->body); + + if($extra_vars->target_group) $extra_vars->target_group = explode('|@|', $extra_vars->target_group); + if($extra_vars->mid_list) $extra_vars->mid_list = explode('|@|', $extra_vars->mid_list); + + $args->component_name = $component_name; + $args->extra_vars = serialize($extra_vars); + $args->site_srl = (int)$site_module_info->site_srl; + + if(!$args->site_srl) $output = executeQuery('editor.updateComponent', $args); + else $output = executeQuery('editor.updateSiteComponent', $args); + if(!$output->toBool()) return $output; + + $oEditorController = &getController('editor'); + $oEditorController->removeCache($args->site_srl); + + $this->setMessage('success_updated'); + } + + /** + * @brief 컴포넌트를 DB에 추가 + **/ + function insertComponent($component_name, $enabled = false, $site_srl = 0) { + if($enabled) $enabled = 'Y'; + else $enabled = 'N'; + + $args->component_name = $component_name; + $args->enabled = $enabled; + $args->site_srl = $site_srl; + + // 컴포넌트가 있는지 확인 + if(!$site_srl) $output = executeQuery('editor.isComponentInserted', $args); + else $output = executeQuery('editor.isSiteComponentInserted', $args); + if($output->data->count) return new Object(-1, 'msg_component_is_not_founded'); + + // 입력 + $args->list_order = getNextSequence(); + if(!$site_srl) $output = executeQuery('editor.insertComponent', $args); + else $output = executeQuery('editor.insertSiteComponent', $args); + + $oEditorController = &getController('editor'); + $oEditorController->removeCache($site_srl); + return $output; + } + } +?> diff --git a/modules/editor/editor.admin.view.php b/modules/editor/editor.admin.view.php index 745758053..61f2e175f 100644 --- a/modules/editor/editor.admin.view.php +++ b/modules/editor/editor.admin.view.php @@ -1,80 +1,80 @@ -site_srl; - - // 컴포넌트의 종류를 구해옴 - $oEditorModel = &getModel('editor'); - $component_list = $oEditorModel->getComponentList(false, $site_srl, true); - - Context::set('component_list', $component_list); - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('admin_index'); - } - - /** - * @brief 컴퍼넌트 setup - **/ - function dispEditorAdminSetupComponent() { - $site_module_info = Context::get('site_module_info'); - $site_srl = (int)$site_module_info->site_srl; - - $component_name = Context::get('component_name'); - - // 에디터 컴포넌트의 정보를 구함 - $oEditorModel = &getModel('editor'); - $component = $oEditorModel->getComponent($component_name,$site_srl); - Context::set('component', $component); - - // 그룹 설정을 위한 그룹 목록을 구함 - $oMemberModel = &getModel('member'); - $group_list = $oMemberModel->getGroups($site_srl); - Context::set('group_list', $group_list); - - // mid 목록을 가져옴 - $oModuleModel = &getModel('module'); - - $args->site_srl = $site_srl; - $mid_list = $oModuleModel->getMidList($args); - - // module_category와 module의 조합 - if(!$args->site_srl) { - // 모듈 카테고리 목록을 구함 - $module_categories = $oModuleModel->getModuleCategories(); - - if(!is_array($mid_list)) $mid_list = array($mid_list); - foreach($mid_list as $module_srl => $module) { - if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; - } - } else { - $module_categories[0]->list = $mid_list; - } - - Context::set('mid_list',$module_categories); - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('setup_component'); - $this->setLayoutFile("popup_layout"); - } - - } -?> +site_srl; + + // 컴포넌트의 종류를 구해옴 + $oEditorModel = &getModel('editor'); + $component_list = $oEditorModel->getComponentList(false, $site_srl, true); + + Context::set('component_list', $component_list); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('admin_index'); + } + + /** + * @brief 컴퍼넌트 setup + **/ + function dispEditorAdminSetupComponent() { + $site_module_info = Context::get('site_module_info'); + $site_srl = (int)$site_module_info->site_srl; + + $component_name = Context::get('component_name'); + + // 에디터 컴포넌트의 정보를 구함 + $oEditorModel = &getModel('editor'); + $component = $oEditorModel->getComponent($component_name,$site_srl); + Context::set('component', $component); + + // 그룹 설정을 위한 그룹 목록을 구함 + $oMemberModel = &getModel('member'); + $group_list = $oMemberModel->getGroups($site_srl); + Context::set('group_list', $group_list); + + // mid 목록을 가져옴 + $oModuleModel = &getModel('module'); + + $args->site_srl = $site_srl; + $mid_list = $oModuleModel->getMidList($args); + + // module_category와 module의 조합 + if(!$args->site_srl) { + // 모듈 카테고리 목록을 구함 + $module_categories = $oModuleModel->getModuleCategories(); + + if(!is_array($mid_list)) $mid_list = array($mid_list); + foreach($mid_list as $module_srl => $module) { + if($module) $module_categories[$module->module_category_srl]->list[$module_srl] = $module; + } + } else { + $module_categories[0]->list = $mid_list; + } + + Context::set('mid_list',$module_categories); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('setup_component'); + $this->setLayoutFile("popup_layout"); + } + + } +?> diff --git a/modules/editor/editor.api.php b/modules/editor/editor.api.php index 3945c9adf..c8f48edca 100644 --- a/modules/editor/editor.api.php +++ b/modules/editor/editor.api.php @@ -1,13 +1,13 @@ -add('colorset', Context::get('colorset')); - } - } -?> +add('colorset', Context::get('colorset')); + } + } +?> diff --git a/modules/editor/editor.class.php b/modules/editor/editor.class.php index 43c4499ed..1e61f1b93 100644 --- a/modules/editor/editor.class.php +++ b/modules/editor/editor.class.php @@ -1,120 +1,120 @@ -insertComponent('colorpicker_text',true); - $oEditorController->insertComponent('colorpicker_bg',true); - $oEditorController->insertComponent('emoticon',true); - $oEditorController->insertComponent('url_link',true); - $oEditorController->insertComponent('image_link',true); - $oEditorController->insertComponent('multimedia_link',true); - $oEditorController->insertComponent('quotation',true); - $oEditorController->insertComponent('table_maker',true); - $oEditorController->insertComponent('poll_maker',true); - $oEditorController->insertComponent('image_gallery',true); - - // 에디터 모듈에서 사용할 디렉토리 생성 - FileHandler::makeDir('./files/cache/editor'); - - // 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가 - $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); - $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); - - // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가 - $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); - - // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 - $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oModuleModel = &getModel('module'); - - $oDB = &DB::getInstance(); - - // 2009. 06. 15 자동저장시 module_srl 을 저장 - if(!$oDB->isColumnExists("editor_autosave","module_srl")) return true; - if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) return true; - - - // 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가 - if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; - if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; - - // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가 - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true; - - // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 - if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true; - - // 2009. 06. 19 사용하지 않는 트리거 제거 - if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - $oDB = &DB::getInstance(); - - // 자동저장시 module_srl 을 저장 2009.6.15 - if(!$oDB->isColumnExists("editor_autosave","module_srl")) - $oDB->addColumn("editor_autosave","module_srl","number",11); - - // module_srl을 인덱스로 - if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) $oDB->addIndex("editor_autosave","idx_module_srl", "module_srl"); - - // 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가 - if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) - $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); - if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) - $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); - - // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가 - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) - $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); - - // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 - if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) - $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); - - // 2009. 06. 19 사용하지 않는 트리거 제거 - if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) - $oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'); - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - // 에디터 컴포넌트 캐시 파일 삭제 - FileHandler::removeFilesInDir("./files/cache/editor"); - } - } -?> +insertComponent('colorpicker_text',true); + $oEditorController->insertComponent('colorpicker_bg',true); + $oEditorController->insertComponent('emoticon',true); + $oEditorController->insertComponent('url_link',true); + $oEditorController->insertComponent('image_link',true); + $oEditorController->insertComponent('multimedia_link',true); + $oEditorController->insertComponent('quotation',true); + $oEditorController->insertComponent('table_maker',true); + $oEditorController->insertComponent('poll_maker',true); + $oEditorController->insertComponent('image_gallery',true); + + // 에디터 모듈에서 사용할 디렉토리 생성 + FileHandler::makeDir('./files/cache/editor'); + + // 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가 + $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); + $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); + + // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가 + $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); + + // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 + $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oModuleModel = &getModel('module'); + + $oDB = &DB::getInstance(); + + // 2009. 06. 15 자동저장시 module_srl 을 저장 + if(!$oDB->isColumnExists("editor_autosave","module_srl")) return true; + if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) return true; + + + // 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가 + if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; + if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) return true; + + // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가 + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) return true; + + // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 + if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) return true; + + // 2009. 06. 19 사용하지 않는 트리거 제거 + if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + $oDB = &DB::getInstance(); + + // 자동저장시 module_srl 을 저장 2009.6.15 + if(!$oDB->isColumnExists("editor_autosave","module_srl")) + $oDB->addColumn("editor_autosave","module_srl","number",11); + + // module_srl을 인덱스로 + if(!$oDB->isIndexExists("editor_autosave","idx_module_srl")) $oDB->addIndex("editor_autosave","idx_module_srl", "module_srl"); + + // 2007. 10. 17 글의 입력(신규 or 수정)이 일어날때마다 자동 저장된 문서를 삭제하는 trigger 추가 + if(!$oModuleModel->getTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) + $oModuleController->insertTrigger('document.insertDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); + if(!$oModuleModel->getTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after')) + $oModuleController->insertTrigger('document.updateDocument', 'editor', 'controller', 'triggerDeleteSavedDoc', 'after'); + + // 2007. 10. 23 모듈의 추가 설정에서 에디터 trigger 추가 + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before')) + $oModuleController->insertTrigger('module.dispAdditionSetup', 'editor', 'view', 'triggerDispEditorAdditionSetup', 'before'); + + // 2009. 04. 14 editor component 변환 코드를 trigger로 독립 + if(!$oModuleModel->getTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before')) + $oModuleController->insertTrigger('display', 'editor', 'controller', 'triggerEditorComponentCompile', 'before'); + + // 2009. 06. 19 사용하지 않는 트리거 제거 + if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) + $oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'); + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + // 에디터 컴포넌트 캐시 파일 삭제 + FileHandler::removeFilesInDir("./files/cache/editor"); + } + } +?> diff --git a/modules/editor/editor.controller.php b/modules/editor/editor.controller.php index 4ebad3731..2a481b6e6 100644 --- a/modules/editor/editor.controller.php +++ b/modules/editor/editor.controller.php @@ -1,457 +1,457 @@ -deleteSavedDoc(false); - - $args->document_srl = Context::get('document_srl'); - $args->content = Context::get('content'); - $args->title = Context::get('title'); - $output = $this->doSaveDoc($args); - - $this->setMessage('msg_auto_saved'); - } - - /** - * @brief 자동저장된 문서 삭제 - **/ - function procEditorRemoveSavedDoc() { - $oEditorController = &getController('editor'); - $oEditorController->deleteSavedDoc(true); - } - - /** - * @brief 컴포넌트에서 ajax요청시 해당 컴포넌트의 method를 실행 - **/ - function procEditorCall() { - $component = Context::get('component'); - $method = Context::get('method'); - if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); - - $oEditorModel = &getModel('editor'); - $oComponent = &$oEditorModel->getComponentObject($component); - if(!$oComponent->toBool()) return $oComponent; - - if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); - - //$output = call_user_method($method, $oComponent); - //$output = call_user_func(array($oComponent, $method)); - if(method_exists($oComponent, $method)) $output = $oComponent->{$method}(); - else return new Object(-1,sprintf('%s method is not exists', $method)); - - if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output; - - $this->setError($oComponent->getError()); - $this->setMessage($oComponent->getMessage()); - - $vars = $oComponent->getVariables(); - if(count($vars)) { - foreach($vars as $key=>$val) $this->add($key, $val); - } - } - - /** - * @brief 에디터의 모듈별 추가 확장 폼을 저장 - **/ - function procEditorInsertModuleConfig() { - $module_srl = Context::get('target_module_srl'); - - // 여러개의 모듈 일괄 설정일 경우 - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); - else $module_srl = array($module_srl); - - $editor_config = null; - - $editor_config->editor_skin = Context::get('editor_skin'); - $editor_config->comment_editor_skin = Context::get('comment_editor_skin'); - $editor_config->content_style = Context::get('content_style'); - $editor_config->comment_content_style = Context::get('comment_content_style'); - $editor_config->content_font = Context::get('content_font'); - if($editor_config->content_font) { - $font_list = array(); - $fonts = explode(',',$editor_config->content_font); - for($i=0,$c=count($fonts);$i<$c;$i++) { - $font = trim(str_replace(array('"','\''),'',$fonts[$i])); - if(!$font) continue; - $font_list[] = $font; - } - if(count($font_list)) $editor_config->content_font = '"'.implode('","',$font_list).'"'; - } - $editor_config->content_font_size = Context::get('content_font_size'); - $editor_config->sel_editor_colorset = Context::get('sel_editor_colorset'); - $editor_config->sel_comment_editor_colorset = Context::get('sel_comment_editor_colorset'); - - $enable_html_grant = trim(Context::get('enable_html_grant')); - if($enable_html_grant) $editor_config->enable_html_grant = explode('|@|', $enable_html_grant); - else $editor_config->enable_html_grant = array(); - - $enable_comment_html_grant = trim(Context::get('enable_comment_html_grant')); - if($enable_comment_html_grant) $editor_config->enable_comment_html_grant = explode('|@|', $enable_comment_html_grant); - else $editor_config->enable_comment_html_grant = array(); - - $upload_file_grant = trim(Context::get('upload_file_grant')); - if($upload_file_grant) $editor_config->upload_file_grant = explode('|@|', $upload_file_grant); - else $editor_config->upload_file_grant = array(); - - $comment_upload_file_grant = trim(Context::get('comment_upload_file_grant')); - if($comment_upload_file_grant) $editor_config->comment_upload_file_grant = explode('|@|', $comment_upload_file_grant); - else $editor_config->comment_upload_file_grant = array(); - - $enable_default_component_grant = trim(Context::get('enable_default_component_grant')); - if($enable_default_component_grant) $editor_config->enable_default_component_grant = explode('|@|', $enable_default_component_grant); - else $editor_config->enable_default_component_grant = array(); - - $enable_comment_default_component_grant = trim(Context::get('enable_comment_default_component_grant')); - if($enable_comment_default_component_grant) $editor_config->enable_comment_default_component_grant = explode('|@|', $enable_comment_default_component_grant); - else $editor_config->enable_comment_default_component_grant = array(); - - $enable_component_grant = trim(Context::get('enable_component_grant')); - if($enable_component_grant) $editor_config->enable_component_grant = explode('|@|', $enable_component_grant); - else $editor_config->enable_component_grant = array(); - - $enable_comment_component_grant = trim(Context::get('enable_comment_component_grant')); - if($enable_comment_component_grant) $editor_config->enable_comment_component_grant = explode('|@|', $enable_comment_component_grant); - else $editor_config->enable_comment_component_grant = array(); - - $editor_config->editor_height = (int)Context::get('editor_height'); - - $editor_config->comment_editor_height = (int)Context::get('comment_editor_height'); - - $editor_config->enable_autosave = Context::get('enable_autosave'); - - if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N'; - - $oModuleController = &getController('module'); - for($i=0;$iinsertModulePartConfig('editor',$srl,$editor_config); - } - - $this->setError(-1); - $this->setMessage('success_updated'); - } - - /** - * @brief 에디터컴포넌트의 코드를 결과물로 변환 + 문서서식 style 지정 - **/ - function triggerEditorComponentCompile(&$content) { - if(Context::getResponseMethod()!='HTML') return new Object(); - if(Mobile::isFromMobilePhone()) return new Object(); - - $module_info = Context::get('module_info'); - $module_srl = $module_info->module_srl; - if($module_srl) { - $oEditorModel = &getModel('editor'); - $editor_config = $oEditorModel->getEditorConfig($module_srl); - $content_style = $editor_config->content_style; - if($content_style) { - $path = _XE_PATH_.'modules/editor/styles/'.$content_style.'/'; - if(is_dir($path) && file_exists($path.'style.ini')) { - $ini = file($path.'style.ini'); - for($i=0,$c=count($ini);$i<$c;$i++) { - $file = trim($ini[$i]); - if(!$file) continue; - if(preg_match('/\.css$/i',$file)) Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false); - elseif(preg_match('/\.js/i',$file)) Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false); - } - } - } - $content_font = $editor_config->content_font; - $content_font_size = $editor_config->content_font_size; - if($content_font || $content_font_size) { - $buff = ''; - Context::addHtmlHeader($buff); - } - } - - $content = $this->transComponent($content); - return new Object(); - } - - /** - * @brief 에디터 컴포넌트코드를 결과물로 변환 - **/ - function transComponent($content) { - $content = preg_replace_callback('!]*)editor_component=([^\>]*)>(.*?)\<\/div\>!is', array($this,'transEditorComponent'), $content); - $content = preg_replace_callback('!]*)editor_component=([^\>]*?)\>!is', array($this,'transEditorComponent'), $content); - return $content; - } - - /** - * @brief 내용의 에디터 컴포넌트 코드를 변환 - **/ - function transEditorComponent($matches) { - $script = sprintf(' %s editor_component=%s', $matches[1], $matches[2]); - $script = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', fixQuotation, $script); - preg_match_all('/([a-z0-9\-\_]+)\=\"([^\"]+)\"/is', $script, $m); - for($i=0,$c=count($m[0]);$i<$c;$i++) { - $xml_obj->attrs->{$m[1][$i]} = $m[2][$i]; - } - $xml_obj->body = $matches[3]; - - if(!$xml_obj->attrs->editor_component) return $matches[0]; - - // component::transHTML() 을 이용하여 변환된 코드를 받음 - $oEditorModel = &getModel('editor'); - $oComponent = &$oEditorModel->getComponentObject($xml_obj->attrs->editor_component, 0); - if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $matches[0]; - - return $oComponent->transHTML($xml_obj); - } - - - /** - * @brief 자동 저장 - **/ - function doSaveDoc($args) { - - if(!$args->document_srl) $args->document_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - } else { - $args->ipaddress = $_SERVER['REMOTE_ADDR']; - } - // module_srl이 없으면 현재 모듈 - if(!$args->module_srl) { - $args->module_srl = Context::get('module_srl'); - } - if(!$args->module_srl) { - $current_module_info = Context::get('current_module_info'); - $args->module_srl = $current_module_info->module_srl; - } - - // 저장 - return executeQuery('editor.insertSavedDoc', $args); - } - - /** - * @brief 자동 저장글 Srl 로드 - XE 이전 버전 사용자를 위함. - **/ - function procEditorLoadSavedDocument() { - $editor_sequence = Context::get('editor_sequence'); - $primary_key = Context::get('primary_key'); - $oEditorModel = &getModel('editor'); - $oFileController = &getController('file'); - - $saved_doc = $oEditorModel->getSavedDoc(null); - - $oFileController->setUploadInfo($editor_sequence, $saved_doc->document_srl); - $vars = $this->getVariables(); - $this->add("editor_sequence", $editor_sequence); - $this->add("key", $primary_key); - $this->add("title", $saved_doc->title); - $this->add("content", $saved_doc->content); - $this->add("document_srl", $saved_doc->document_srl); - } - - - /** - * @brief 게시글의 입력/수정이 일어났을 경우 자동 저장문서를 제거하는 trigger - **/ - function triggerDeleteSavedDoc(&$obj) { - $this->deleteSavedDoc(false); - return new Object(); - } - - /** - * @brief 자동 저장된 글을 삭제 - * 현재 접속한 사용자를 기준 - **/ - function deleteSavedDoc($mode = false) { - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - } else { - $args->ipaddress = $_SERVER['REMOTE_ADDR']; - } - $args->module_srl = Context::get('module_srl'); - // module_srl이 없으면 현재 모듈 - if(!$args->module_srl) { - $current_module_info = Context::get('current_module_info'); - $args->module_srl = $current_module_info->module_srl; - } - - // 자동저장된 값이 혹시 이미 등록된 글인지 확인 - $output = executeQuery('editor.getSavedDocument', $args); - $saved_doc = $output->data; - if(!$saved_doc) return; - - $oDocumentModel = &getModel('document'); - $oSaved = $oDocumentModel->getDocument($saved_doc->document_srl); - if(!$oSaved->isExists()) { - if($mode) { - $output = executeQuery('editor.getSavedDocument', $args); - $output = ModuleHandler::triggerCall('editor.deleteSavedDoc', 'after', $saved_doc); - } - } - - // 일단 이전 저장본 삭제 - return executeQuery('editor.deleteSavedDoc', $args); - } - - /** - * @brief 가상 사이트에서 사용된 에디터 컴포넌트 정보를 제거 - **/ - function removeEditorConfig($site_srl) { - $args->site_srl = $site_srl; - executeQuery('editor.deleteSiteComponent', $args); - } - - /** - * @brief 에디터 컴포넌트 목록 캐싱 (editorModel::getComponentList) - * 에디터 컴포넌트 목록의 경우 DB query + Xml Parsing 때문에 캐싱 파일을 이용하도록 함 - **/ - function makeCache($filter_enabled = true, $site_srl) { - $oEditorModel = &getModel('editor'); - - if($filter_enabled) $args->enabled = "Y"; - - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('editor.getSiteComponentList', $args); - } else $output = executeQuery('editor.getComponentList', $args); - $db_list = $output->data; - - // 파일목록을 구함 - $downloaded_list = FileHandler::readDir(_XE_PATH_.'modules/editor/components'); - - // 로그인 여부 및 소속 그룹 구함 - $is_logged = Context::get('is_logged'); - if($is_logged) { - $logged_info = Context::get('logged_info'); - if($logged_info->group_list && is_array($logged_info->group_list)) { - $group_list = array_keys($logged_info->group_list); - } else $group_list = array(); - } - - // DB 목록을 loop돌면서 xml정보까지 구함 - if(!is_array($db_list)) $db_list = array($db_list); - foreach($db_list as $component) { - if(in_array($component->component_name, array('colorpicker_text','colorpicker_bg'))) continue; - - $component_name = $component->component_name; - if(!$component_name) continue; - - if(!in_array($component_name, $downloaded_list)) continue; - - unset($xml_info); - $xml_info = $oEditorModel->getComponentXmlInfo($component_name); - $xml_info->enabled = $component->enabled; - - if($component->extra_vars) { - $extra_vars = unserialize($component->extra_vars); - if($extra_vars->target_group) { - $xml_info->target_group = $extra_vars->target_group; - } - - if($extra_vars->mid_list && count($extra_vars->mid_list)) - { - $xml_info->mid_list = $extra_vars->mid_list; - } - /* - // 사용권한이 있으면 권한 체크 - if($extra_vars->target_group) { - // 사용권한이 체크되어 있는데 로그인이 되어 있지 않으면 무조건 사용 중지 - if(!$is_logged) continue; - - // 대상 그룹을 구해서 현재 로그인 사용자의 그룹과 비교 - $target_group = $extra_vars->target_group; - unset($extra_vars->target_group); - - $is_granted = false; - foreach($group_list as $group_srl) { - if(in_array($group_srl, $target_group)) { - $is_granted = true; - break; - } - } - if(!$is_granted) continue; - } - - // 대상 모듈이 있으면 체크 - if($extra_vars->mid_list && count($extra_vars->mid_list) && Context::get('mid')) { - if(!in_array(Context::get('mid'), $extra_vars->mid_list)) continue; - }*/ - - // 에디터 컴포넌트의 설정 정보를 체크 - if($xml_info->extra_vars) { - foreach($xml_info->extra_vars as $key => $val) { - $xml_info->extra_vars->{$key}->value = $extra_vars->{$key}; - } - } - } - - $component_list->{$component_name} = $xml_info; - - // 버튼, 아이콘 이미지 구함 - $icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/icon.gif'; - $component_icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/component_icon.gif'; - if(file_exists($icon_file)) $component_list->{$component_name}->icon = true; - if(file_exists($component_icon_file)) $component_list->{$component_name}->component_icon = true; - } - - // enabled만 체크하도록 하였으면 그냥 return - if($filter_enabled) { - $cache_file = $oEditorModel->getCacheFile($filter_enabled, $site_srl); - $buff = sprintf('', str_replace('"','\\"',serialize($component_list))); - FileHandler::writeFile($cache_file, $buff); - return $component_list; - } - - // 다운로드된 목록의 xml_info를 마저 구함 - foreach($downloaded_list as $component_name) { - if(in_array($component_name, array('colorpicker_text','colorpicker_bg'))) continue; - - // 설정된 것이라면 패스 - if($component_list->{$component_name}) continue; - - // DB에 입력 - $oEditorController = &getAdminController('editor'); - $oEditorController->insertComponent($component_name, false, $site_srl); - - // component_list에 추가 - unset($xml_info); - $xml_info = $oEditorModel->getComponentXmlInfo($component_name); - $xml_info->enabled = 'N'; - - $component_list->{$component_name} = $xml_info; - } - - $cache_file = $oEditorModel->getCacheFile($filter_enabled, $site_srl); - $buff = sprintf('', str_replace('"','\\"',serialize($component_list))); - FileHandler::writeFile($cache_file, $buff); - - return $component_list; - } - - /** - * @brief 캐시 파일 삭제 - **/ - function removeCache($site_srl = 0) { - $oEditorModel = &getModel('editor'); - FileHandler::removeFile($oEditorModel->getCacheFile(true, $site_srl)); - FileHandler::removeFile($oEditorModel->getCacheFile(false, $site_srl)); - } - } -?> +deleteSavedDoc(false); + + $args->document_srl = Context::get('document_srl'); + $args->content = Context::get('content'); + $args->title = Context::get('title'); + $output = $this->doSaveDoc($args); + + $this->setMessage('msg_auto_saved'); + } + + /** + * @brief 자동저장된 문서 삭제 + **/ + function procEditorRemoveSavedDoc() { + $oEditorController = &getController('editor'); + $oEditorController->deleteSavedDoc(true); + } + + /** + * @brief 컴포넌트에서 ajax요청시 해당 컴포넌트의 method를 실행 + **/ + function procEditorCall() { + $component = Context::get('component'); + $method = Context::get('method'); + if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + + $oEditorModel = &getModel('editor'); + $oComponent = &$oEditorModel->getComponentObject($component); + if(!$oComponent->toBool()) return $oComponent; + + if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + + //$output = call_user_method($method, $oComponent); + //$output = call_user_func(array($oComponent, $method)); + if(method_exists($oComponent, $method)) $output = $oComponent->{$method}(); + else return new Object(-1,sprintf('%s method is not exists', $method)); + + if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output; + + $this->setError($oComponent->getError()); + $this->setMessage($oComponent->getMessage()); + + $vars = $oComponent->getVariables(); + if(count($vars)) { + foreach($vars as $key=>$val) $this->add($key, $val); + } + } + + /** + * @brief 에디터의 모듈별 추가 확장 폼을 저장 + **/ + function procEditorInsertModuleConfig() { + $module_srl = Context::get('target_module_srl'); + + // 여러개의 모듈 일괄 설정일 경우 + if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); + else $module_srl = array($module_srl); + + $editor_config = null; + + $editor_config->editor_skin = Context::get('editor_skin'); + $editor_config->comment_editor_skin = Context::get('comment_editor_skin'); + $editor_config->content_style = Context::get('content_style'); + $editor_config->comment_content_style = Context::get('comment_content_style'); + $editor_config->content_font = Context::get('content_font'); + if($editor_config->content_font) { + $font_list = array(); + $fonts = explode(',',$editor_config->content_font); + for($i=0,$c=count($fonts);$i<$c;$i++) { + $font = trim(str_replace(array('"','\''),'',$fonts[$i])); + if(!$font) continue; + $font_list[] = $font; + } + if(count($font_list)) $editor_config->content_font = '"'.implode('","',$font_list).'"'; + } + $editor_config->content_font_size = Context::get('content_font_size'); + $editor_config->sel_editor_colorset = Context::get('sel_editor_colorset'); + $editor_config->sel_comment_editor_colorset = Context::get('sel_comment_editor_colorset'); + + $enable_html_grant = trim(Context::get('enable_html_grant')); + if($enable_html_grant) $editor_config->enable_html_grant = explode('|@|', $enable_html_grant); + else $editor_config->enable_html_grant = array(); + + $enable_comment_html_grant = trim(Context::get('enable_comment_html_grant')); + if($enable_comment_html_grant) $editor_config->enable_comment_html_grant = explode('|@|', $enable_comment_html_grant); + else $editor_config->enable_comment_html_grant = array(); + + $upload_file_grant = trim(Context::get('upload_file_grant')); + if($upload_file_grant) $editor_config->upload_file_grant = explode('|@|', $upload_file_grant); + else $editor_config->upload_file_grant = array(); + + $comment_upload_file_grant = trim(Context::get('comment_upload_file_grant')); + if($comment_upload_file_grant) $editor_config->comment_upload_file_grant = explode('|@|', $comment_upload_file_grant); + else $editor_config->comment_upload_file_grant = array(); + + $enable_default_component_grant = trim(Context::get('enable_default_component_grant')); + if($enable_default_component_grant) $editor_config->enable_default_component_grant = explode('|@|', $enable_default_component_grant); + else $editor_config->enable_default_component_grant = array(); + + $enable_comment_default_component_grant = trim(Context::get('enable_comment_default_component_grant')); + if($enable_comment_default_component_grant) $editor_config->enable_comment_default_component_grant = explode('|@|', $enable_comment_default_component_grant); + else $editor_config->enable_comment_default_component_grant = array(); + + $enable_component_grant = trim(Context::get('enable_component_grant')); + if($enable_component_grant) $editor_config->enable_component_grant = explode('|@|', $enable_component_grant); + else $editor_config->enable_component_grant = array(); + + $enable_comment_component_grant = trim(Context::get('enable_comment_component_grant')); + if($enable_comment_component_grant) $editor_config->enable_comment_component_grant = explode('|@|', $enable_comment_component_grant); + else $editor_config->enable_comment_component_grant = array(); + + $editor_config->editor_height = (int)Context::get('editor_height'); + + $editor_config->comment_editor_height = (int)Context::get('comment_editor_height'); + + $editor_config->enable_autosave = Context::get('enable_autosave'); + + if($editor_config->enable_autosave != 'Y') $editor_config->enable_autosave = 'N'; + + $oModuleController = &getController('module'); + for($i=0;$iinsertModulePartConfig('editor',$srl,$editor_config); + } + + $this->setError(-1); + $this->setMessage('success_updated'); + } + + /** + * @brief 에디터컴포넌트의 코드를 결과물로 변환 + 문서서식 style 지정 + **/ + function triggerEditorComponentCompile(&$content) { + if(Context::getResponseMethod()!='HTML') return new Object(); + if(Mobile::isFromMobilePhone()) return new Object(); + + $module_info = Context::get('module_info'); + $module_srl = $module_info->module_srl; + if($module_srl) { + $oEditorModel = &getModel('editor'); + $editor_config = $oEditorModel->getEditorConfig($module_srl); + $content_style = $editor_config->content_style; + if($content_style) { + $path = _XE_PATH_.'modules/editor/styles/'.$content_style.'/'; + if(is_dir($path) && file_exists($path.'style.ini')) { + $ini = file($path.'style.ini'); + for($i=0,$c=count($ini);$i<$c;$i++) { + $file = trim($ini[$i]); + if(!$file) continue; + if(preg_match('/\.css$/i',$file)) Context::addCSSFile('./modules/editor/styles/'.$content_style.'/'.$file, false); + elseif(preg_match('/\.js/i',$file)) Context::addJsFile('./modules/editor/styles/'.$content_style.'/'.$file, false); + } + } + } + $content_font = $editor_config->content_font; + $content_font_size = $editor_config->content_font_size; + if($content_font || $content_font_size) { + $buff = ''; + Context::addHtmlHeader($buff); + } + } + + $content = $this->transComponent($content); + return new Object(); + } + + /** + * @brief 에디터 컴포넌트코드를 결과물로 변환 + **/ + function transComponent($content) { + $content = preg_replace_callback('!]*)editor_component=([^\>]*)>(.*?)\<\/div\>!is', array($this,'transEditorComponent'), $content); + $content = preg_replace_callback('!]*)editor_component=([^\>]*?)\>!is', array($this,'transEditorComponent'), $content); + return $content; + } + + /** + * @brief 내용의 에디터 컴포넌트 코드를 변환 + **/ + function transEditorComponent($matches) { + $script = sprintf(' %s editor_component=%s', $matches[1], $matches[2]); + $script = preg_replace_callback('/([^=^"^ ]*)=([^ ^>]*)/i', fixQuotation, $script); + preg_match_all('/([a-z0-9\-\_]+)\=\"([^\"]+)\"/is', $script, $m); + for($i=0,$c=count($m[0]);$i<$c;$i++) { + $xml_obj->attrs->{$m[1][$i]} = $m[2][$i]; + } + $xml_obj->body = $matches[3]; + + if(!$xml_obj->attrs->editor_component) return $matches[0]; + + // component::transHTML() 을 이용하여 변환된 코드를 받음 + $oEditorModel = &getModel('editor'); + $oComponent = &$oEditorModel->getComponentObject($xml_obj->attrs->editor_component, 0); + if(!is_object($oComponent)||!method_exists($oComponent, 'transHTML')) return $matches[0]; + + return $oComponent->transHTML($xml_obj); + } + + + /** + * @brief 자동 저장 + **/ + function doSaveDoc($args) { + + if(!$args->document_srl) $args->document_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl; + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + } else { + $args->ipaddress = $_SERVER['REMOTE_ADDR']; + } + // module_srl이 없으면 현재 모듈 + if(!$args->module_srl) { + $args->module_srl = Context::get('module_srl'); + } + if(!$args->module_srl) { + $current_module_info = Context::get('current_module_info'); + $args->module_srl = $current_module_info->module_srl; + } + + // 저장 + return executeQuery('editor.insertSavedDoc', $args); + } + + /** + * @brief 자동 저장글 Srl 로드 - XE 이전 버전 사용자를 위함. + **/ + function procEditorLoadSavedDocument() { + $editor_sequence = Context::get('editor_sequence'); + $primary_key = Context::get('primary_key'); + $oEditorModel = &getModel('editor'); + $oFileController = &getController('file'); + + $saved_doc = $oEditorModel->getSavedDoc(null); + + $oFileController->setUploadInfo($editor_sequence, $saved_doc->document_srl); + $vars = $this->getVariables(); + $this->add("editor_sequence", $editor_sequence); + $this->add("key", $primary_key); + $this->add("title", $saved_doc->title); + $this->add("content", $saved_doc->content); + $this->add("document_srl", $saved_doc->document_srl); + } + + + /** + * @brief 게시글의 입력/수정이 일어났을 경우 자동 저장문서를 제거하는 trigger + **/ + function triggerDeleteSavedDoc(&$obj) { + $this->deleteSavedDoc(false); + return new Object(); + } + + /** + * @brief 자동 저장된 글을 삭제 + * 현재 접속한 사용자를 기준 + **/ + function deleteSavedDoc($mode = false) { + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + } else { + $args->ipaddress = $_SERVER['REMOTE_ADDR']; + } + $args->module_srl = Context::get('module_srl'); + // module_srl이 없으면 현재 모듈 + if(!$args->module_srl) { + $current_module_info = Context::get('current_module_info'); + $args->module_srl = $current_module_info->module_srl; + } + + // 자동저장된 값이 혹시 이미 등록된 글인지 확인 + $output = executeQuery('editor.getSavedDocument', $args); + $saved_doc = $output->data; + if(!$saved_doc) return; + + $oDocumentModel = &getModel('document'); + $oSaved = $oDocumentModel->getDocument($saved_doc->document_srl); + if(!$oSaved->isExists()) { + if($mode) { + $output = executeQuery('editor.getSavedDocument', $args); + $output = ModuleHandler::triggerCall('editor.deleteSavedDoc', 'after', $saved_doc); + } + } + + // 일단 이전 저장본 삭제 + return executeQuery('editor.deleteSavedDoc', $args); + } + + /** + * @brief 가상 사이트에서 사용된 에디터 컴포넌트 정보를 제거 + **/ + function removeEditorConfig($site_srl) { + $args->site_srl = $site_srl; + executeQuery('editor.deleteSiteComponent', $args); + } + + /** + * @brief 에디터 컴포넌트 목록 캐싱 (editorModel::getComponentList) + * 에디터 컴포넌트 목록의 경우 DB query + Xml Parsing 때문에 캐싱 파일을 이용하도록 함 + **/ + function makeCache($filter_enabled = true, $site_srl) { + $oEditorModel = &getModel('editor'); + + if($filter_enabled) $args->enabled = "Y"; + + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('editor.getSiteComponentList', $args); + } else $output = executeQuery('editor.getComponentList', $args); + $db_list = $output->data; + + // 파일목록을 구함 + $downloaded_list = FileHandler::readDir(_XE_PATH_.'modules/editor/components'); + + // 로그인 여부 및 소속 그룹 구함 + $is_logged = Context::get('is_logged'); + if($is_logged) { + $logged_info = Context::get('logged_info'); + if($logged_info->group_list && is_array($logged_info->group_list)) { + $group_list = array_keys($logged_info->group_list); + } else $group_list = array(); + } + + // DB 목록을 loop돌면서 xml정보까지 구함 + if(!is_array($db_list)) $db_list = array($db_list); + foreach($db_list as $component) { + if(in_array($component->component_name, array('colorpicker_text','colorpicker_bg'))) continue; + + $component_name = $component->component_name; + if(!$component_name) continue; + + if(!in_array($component_name, $downloaded_list)) continue; + + unset($xml_info); + $xml_info = $oEditorModel->getComponentXmlInfo($component_name); + $xml_info->enabled = $component->enabled; + + if($component->extra_vars) { + $extra_vars = unserialize($component->extra_vars); + if($extra_vars->target_group) { + $xml_info->target_group = $extra_vars->target_group; + } + + if($extra_vars->mid_list && count($extra_vars->mid_list)) + { + $xml_info->mid_list = $extra_vars->mid_list; + } + /* + // 사용권한이 있으면 권한 체크 + if($extra_vars->target_group) { + // 사용권한이 체크되어 있는데 로그인이 되어 있지 않으면 무조건 사용 중지 + if(!$is_logged) continue; + + // 대상 그룹을 구해서 현재 로그인 사용자의 그룹과 비교 + $target_group = $extra_vars->target_group; + unset($extra_vars->target_group); + + $is_granted = false; + foreach($group_list as $group_srl) { + if(in_array($group_srl, $target_group)) { + $is_granted = true; + break; + } + } + if(!$is_granted) continue; + } + + // 대상 모듈이 있으면 체크 + if($extra_vars->mid_list && count($extra_vars->mid_list) && Context::get('mid')) { + if(!in_array(Context::get('mid'), $extra_vars->mid_list)) continue; + }*/ + + // 에디터 컴포넌트의 설정 정보를 체크 + if($xml_info->extra_vars) { + foreach($xml_info->extra_vars as $key => $val) { + $xml_info->extra_vars->{$key}->value = $extra_vars->{$key}; + } + } + } + + $component_list->{$component_name} = $xml_info; + + // 버튼, 아이콘 이미지 구함 + $icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/icon.gif'; + $component_icon_file = _XE_PATH_.'modules/editor/components/'.$component_name.'/component_icon.gif'; + if(file_exists($icon_file)) $component_list->{$component_name}->icon = true; + if(file_exists($component_icon_file)) $component_list->{$component_name}->component_icon = true; + } + + // enabled만 체크하도록 하였으면 그냥 return + if($filter_enabled) { + $cache_file = $oEditorModel->getCacheFile($filter_enabled, $site_srl); + $buff = sprintf('', str_replace('"','\\"',serialize($component_list))); + FileHandler::writeFile($cache_file, $buff); + return $component_list; + } + + // 다운로드된 목록의 xml_info를 마저 구함 + foreach($downloaded_list as $component_name) { + if(in_array($component_name, array('colorpicker_text','colorpicker_bg'))) continue; + + // 설정된 것이라면 패스 + if($component_list->{$component_name}) continue; + + // DB에 입력 + $oEditorController = &getAdminController('editor'); + $oEditorController->insertComponent($component_name, false, $site_srl); + + // component_list에 추가 + unset($xml_info); + $xml_info = $oEditorModel->getComponentXmlInfo($component_name); + $xml_info->enabled = 'N'; + + $component_list->{$component_name} = $xml_info; + } + + $cache_file = $oEditorModel->getCacheFile($filter_enabled, $site_srl); + $buff = sprintf('', str_replace('"','\\"',serialize($component_list))); + FileHandler::writeFile($cache_file, $buff); + + return $component_list; + } + + /** + * @brief 캐시 파일 삭제 + **/ + function removeCache($site_srl = 0) { + $oEditorModel = &getModel('editor'); + FileHandler::removeFile($oEditorModel->getCacheFile(true, $site_srl)); + FileHandler::removeFile($oEditorModel->getCacheFile(false, $site_srl)); + } + } +?> diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php index d115c5ef1..0c090b664 100644 --- a/modules/editor/editor.model.php +++ b/modules/editor/editor.model.php @@ -1,806 +1,806 @@ -getModulePartConfig('editor', $module_srl); - } - - $editor_config = $GLOBALS['__editor_module_config__'][$module_srl]; - - if(!is_object($editor_config)) $editor_config = null; - - if(!is_array($editor_config->enable_html_grant)) $editor_config->enable_html_grant = array(); - if(!is_array($editor_config->enable_comment_html_grant)) $editor_config->enable_comment_html_grant = array(); - if(!is_array($editor_config->upload_file_grant)) $editor_config->upload_file_grant = array(); - if(!is_array($editor_config->comment_upload_file_grant)) $editor_config->comment_upload_file_grant = array(); - if(!is_array($editor_config->enable_default_component_grant)) $editor_config->enable_default_component_grant = array(); - if(!is_array($editor_config->enable_comment_default_component_grant)) $editor_config->enable_comment_default_component_grant = array(); - if(!is_array($editor_config->enable_component_grant)) $editor_config->enable_component_grant = array(); - if(!is_array($editor_config->enable_comment_component_grant)) $editor_config->enable_comment_component_grant= array(); - - if(!$editor_config->editor_height) $editor_config->editor_height = 500; - if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 120; - if($editor_config->enable_autosave!='N') $editor_config->enable_autosave = "Y"; - - if(!$editor_config->editor_skin) $editor_config->editor_skin = 'xpresseditor'; - if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'xpresseditor'; - if(!$editor_config->content_style) $editor_config->content_style = 'default'; - - return $editor_config; - } - - function loadDrComponents(){ - $drComponentPath = './modules/editor/skins/dreditor/drcomponents/'; - $drComponentList = FileHandler::readDir($drComponentPath); - - $oTemplate = &TemplateHandler::getInstance(); - - $drComponentInfo = array(); - if($drComponentList){ - foreach($drComponentList as $i => $drComponent){ - unset($obj); - $obj = $this->getDrComponentXmlInfo($drComponent); - Context::loadLang(sprintf('%s%s/lang/',$drComponentPath,$drComponent)); - $path = sprintf('%s%s/tpl/',$drComponentPath,$drComponent); - $obj->html = $oTemplate->compile($path,$drComponent); - $drComponentInfo[$drComponent] = $obj; - } - } - Context::set('drComponentList',$drComponentInfo); - } - - function getDrComponentXmlInfo($drComponentName){ - $lang_type = Context::getLangType(); - - // 요청된 컴포넌트의 xml파일 위치를 구함 - $component_path = sprintf('%s/skins/dreditor/drcomponents/%s/', $this->module_path, $drComponentName); - - $xml_file = sprintf('%sinfo.xml', $component_path); - $cache_file = sprintf('./files/cache/editor/dr_%s.%s.php', $drComponentName, $lang_type); - - // 캐시된 xml파일이 있으면 include 후 정보 return - if(file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file)) { - include($cache_file); - return $xml_info; - } - - // 캐시된 파일이 없으면 파싱후 캐싱 후 return - $oParser = new XmlParser(); - $xml_doc = $oParser->loadXmlFile($xml_file); - - $component_info->component_name = $drComponentName; - $component_info->title = $xml_doc->component->title->body; - $component_info->description = str_replace('\n', "\n", $xml_doc->component->description->body); - $component_info->version = $xml_doc->component->version->body; - $component_info->date = $xml_doc->component->date->body; - $component_info->homepage = $xml_doc->component->link->body; - $component_info->license = $xml_doc->component->license->body; - $component_info->license_link = $xml_doc->component->license->attrs->link; - - $buff = 'component_name = "%s";', $component_info->component_name); - $buff .= sprintf('$xml_info->title = "%s";', $component_info->title); - $buff .= sprintf('$xml_info->description = "%s";', $component_info->description); - $buff .= sprintf('$xml_info->version = "%s";', $component_info->version); - $buff .= sprintf('$xml_info->date = "%s";', $component_info->date); - $buff .= sprintf('$xml_info->homepage = "%s";', $component_info->homepage); - $buff .= sprintf('$xml_info->license = "%s";', $component_info->license); - $buff .= sprintf('$xml_info->license_link = "%s";', $component_info->license_link); - - // 작성자 정보 - if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author; - else $author_list = $xml_doc->component->author; - - for($i=0; $i < count($author_list); $i++) { - $buff .= sprintf('$xml_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body); - $buff .= sprintf('$xml_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address); - $buff .= sprintf('$xml_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link); - } - - // history - if($xml_doc->component->history) { - if(!is_array($xml_doc->component->history)) $history_list[] = $xml_doc->component->history; - else $history_list = $xml_doc->component->history; - - for($i=0; $i < count($history_list); $i++) { - unset($obj); - sscanf($history_list[$i]->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('$xml_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body); - $buff .= sprintf('$xml_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version); - $buff .= sprintf('$xml_info->history['.$i.']->date = "%s";', $date); - - if($history_list[$i]->author) { - (!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author; - - for($j=0; $j < count($obj->author_list); $j++) { - $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body); - $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address); - $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link); - } - } - - if($history_list[$i]->log) { - (!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log; - - for($j=0; $j < count($obj->log_list); $j++) { - $buff .= sprintf('$xml_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body); - $buff .= sprintf('$xml_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link); - } - } - } - } - - // 추가 변수 정리 (에디터 컴포넌트에서는 text형만 가능) - $extra_vars = $xml_doc->component->extra_vars->var; - if($extra_vars) { - if(!is_array($extra_vars)) $extra_vars = array($extra_vars); - foreach($extra_vars as $key => $val) { - unset($obj); - $key = $val->attrs->name; - $title = $val->title->body; - $description = $val->description->body; - $xml_info->extra_vars->{$key}->title = $title; - $xml_info->extra_vars->{$key}->description = $description; - - $buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'title', $title); - $buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'description', $description); - } - } - - $buff .= ' ?>'; - - FileHandler::writeFile($cache_file, $buff, "w"); - - unset($xml_info); - include($cache_file); - return $xml_info; - } - - /** - * @brief 에디터 template을 return - * upload_target_srl은 글의 수정시 호출하면 됨. - * 이 upload_target_srl은 첨부파일의 유무를 체크하기 위한 루틴을 구현하는데 사용됨. - **/ - function getEditor($upload_target_srl = 0, $option = null) { - /** - * 기본적인 에디터의 옵션을 정리 - **/ - // 파일 업로드 유무 옵션 설정 - if(!$option->allow_fileupload) $allow_fileupload = false; - else $allow_fileupload = true; - - // content_style 세팅 - if(!$option->content_style) $option->content_style = 'default'; - Context::set('content_style', $option->content_style); - - // 기본 글꼴 지정 - Context::set('content_font', $option->content_font); - Context::set('content_font_size', $option->content_font_size); - - // 자동 저장 유무 옵션 설정 글 수정시는 사용 안함 - if(!$option->enable_autosave) $enable_autosave = false; - elseif(Context::get($option->primary_key_name)) $enable_autosave = false; - else $enable_autosave = true; - - // 기본 에디터 컴포넌트 사용 설정 - if(!$option->enable_default_component) $enable_default_component = false; - else $enable_default_component = true; - - // 확장 컴포넌트 사용 설정 - if(!$option->enable_component) $enable_component = false; - else $enable_component = true; - - // html 모드 조절 - if($option->disable_html) $html_mode = false; - else $html_mode = true; - - // 높이 설정 - if(!$option->height) $editor_height = 400; - else $editor_height = $option->height; - - // 스킨 설정 - $skin = $option->skin; - if(!$skin) $skin = 'xpresseditor'; - - $colorset = $option->colorset; - Context::set('colorset', $colorset); - Context::set('skin', $skin); - - if($skin=='dreditor'){ - $this->loadDrComponents(); - } - - /** - * 자동백업 기능 체크 (글 수정일 경우는 사용하지 않음) - **/ - if($enable_autosave) { - // 자동 저장된 데이터를 추출 - $saved_doc = $this->getSavedDoc($upload_target_srl); - - // 자동 저장 데이터를 context setting - Context::set('saved_doc', $saved_doc); - } - Context::set('enable_autosave', $enable_autosave); - - /** - * 에디터의 고유 번호 추출 (한 페이지에 여러개의 에디터를 출력하는 경우를 대비) - **/ - if($option->editor_sequence) $editor_sequence = $option->editor_sequence; - else { - if(!$GLOBALS['_editor_sequence_']) $GLOBALS['_editor_sequence_'] = 1; - $editor_sequence = $GLOBALS['_editor_sequence_'] ++; - } - - /** - * 업로드 활성화시 내부적으로 file 모듈의 환경설정을 이용하여 설정 - **/ - $files_count = 0; - if($allow_fileupload) { - $oFileModel = &getModel('file'); - - // SWFUploader에 세팅할 업로드 설정 구함 - $file_config = $oFileModel->getUploadConfig(); - $file_config->allowed_attach_size = $file_config->allowed_attach_size*1024*1024; - $file_config->allowed_filesize = $file_config->allowed_filesize*1024*1024; - - Context::set('file_config',$file_config); - - // 업로드 가능 용량등에 대한 정보를 세팅 - $upload_status = $oFileModel->getUploadStatus(); - Context::set('upload_status', $upload_status); - - // upload가능하다고 설정 (내부적으로 캐싱하여 처리) - $oFileController = &getController('file'); - $oFileController->setUploadInfo($editor_sequence, $upload_target_srl); - - // 이미 등록된 파일이 있는지 검사 - if($upload_target_srl) $files_count = $oFileModel->getFilesCount($upload_target_srl); - } - Context::set('files_count', (int)$files_count); - - Context::set('allow_fileupload', $allow_fileupload); - - // 에디터 동작을 위한 editor_sequence값 설정 - Context::set('editor_sequence', $editor_sequence); - - // 파일 첨부 관련 행동을 하기 위해 문서 번호를 upload_target_srl로 설정 - // 신규문서일 경우 upload_target_srl=0 이고 첨부파일 관련 동작이 요청될때 이 값이 변경됨 - Context::set('upload_target_srl', $upload_target_srl); - - // 문서 혹은 댓글의 primary key값을 세팅한다. - Context::set('editor_primary_key_name', $option->primary_key_name); - - // 내용을 sync 맞추기 위한 content column name을 세팅한다 - Context::set('editor_content_key_name', $option->content_key_name); - - - /** - * 에디터 컴포넌트 체크 - **/ - $site_module_info = Context::get('site_module_info'); - $site_srl = (int)$site_module_info->site_srl; - if($enable_component) { - if(!Context::get('component_list')) { - $component_list = $this->getComponentList(true, $site_srl); - Context::set('component_list', $component_list); - } - } - Context::set('enable_component', $enable_component); - Context::set('enable_default_component', $enable_default_component); - - /** - * html_mode 가능한지 변수 설정 - **/ - Context::set('html_mode', $html_mode); - - /** - * 에디터 세로 크기 설정 - **/ - Context::set('editor_height', $editor_height); - - // 에디터의 초기화를 수동으로하는 것에 대한 값 체크 - Context::set('editor_manual_start', $option->manual_start); - - /** - * 템플릿을 미리 컴파일해서 컴파일된 소스를 하기 위해 스킨의 경로를 설정 - ?**/ - $tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin); - $tpl_file = 'editor.html'; - - if(!file_exists($tpl_path.$tpl_file)) { - $skin = 'xpresseditor'; - $tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin); - } - Context::set('editor_path', $tpl_path); - - // load editor skin lang - Context::loadLang($tpl_path.'lang'); - - // tpl 파일을 compile한 결과를 return - $oTemplate = new TemplateHandler(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - /** - * @brief 모듈별 설정이 반영된 에디터 template을 return - * getEditor() 와 동일한 결과물을 return하지만 getModuleEditor()는 각 모듈별 추가 설정을 통해 직접 제어되는 설정을 이용하여 에디터를 생성함 - * - * document/ comment 2가지 종류를 이용함. - * 굳이 나눈 이유는 하나의 모듈에서 2개 종류의 에디터 사용을 위해서인데 게시판이나 블로그등 원글과 그에 연관된 글(댓글)을 위한 용도임. - **/ - function getModuleEditor($type = 'document', $module_srl, $upload_target_srl, $primary_key_name, $content_key_name) { - // 지정된 모듈의 에디터 설정을 구해옴 - $editor_config = $this->getEditorConfig($module_srl); - - // type에 따른 설정 정리 - if($type == 'document') { - $config->editor_skin = $editor_config->editor_skin; - $config->content_style = $editor_config->content_style; - $config->content_font = $editor_config->content_font; - $config->content_font_size = $editor_config->content_font_size; - $config->sel_editor_colorset = $editor_config->sel_editor_colorset; - $config->upload_file_grant = $editor_config->upload_file_grant; - $config->enable_default_component_grant = $editor_config->enable_default_component_grant; - $config->enable_component_grant = $editor_config->enable_component_grant; - $config->enable_html_grant = $editor_config->enable_html_grant; - $config->editor_height = $editor_config->editor_height; - $config->enable_autosave = $editor_config->enable_autosave; - } else { - $config->editor_skin = $editor_config->comment_editor_skin; - $config->content_style = $editor_config->comment_content_style; - $config->content_font = $editor_config->content_font; - $config->content_font_size = $editor_config->content_font_size; - $config->sel_editor_colorset = $editor_config->sel_comment_editor_colorset; - $config->upload_file_grant = $editor_config->comment_upload_file_grant; - $config->enable_default_component_grant = $editor_config->enable_comment_default_component_grant; - $config->enable_component_grant = $editor_config->enable_comment_component_grant; - $config->enable_html_grant = $editor_config->enable_comment_html_grant; - $config->editor_height = $editor_config->comment_editor_height; - $config->enable_autosave = 'N'; - } - - // 권한 체크를 위한 현재 로그인 사용자의 그룹 설정 체크 - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $group_list = $logged_info->group_list; - } else { - $group_list = array(); - } - - // 에디터 옵션 변수를 미리 설정 - $option->skin = $config->editor_skin; - $option->content_style = $config->content_style; - $option->content_font = $config->content_font; - $option->content_font_size = $config->content_font_size; - $option->colorset = $config->sel_editor_colorset; - - // 파일 업로드 권한 체크 - $option->allow_fileupload = false; - if(count($config->upload_file_grant)) { - foreach($group_list as $group_srl => $group_info) { - if(in_array($group_srl, $config->upload_file_grant)) { - $option->allow_fileupload = true; - break; - } - } - } else $option->allow_fileupload = true; - - // 기본 컴포넌트 사용 권한 - $option->enable_default_component = false; - if(count($config->enable_default_component_grant)) { - foreach($group_list as $group_srl => $group_info) { - if(in_array($group_srl, $config->enable_default_component_grant)) { - $option->enable_default_component = true; - break; - } - } - } else $option->enable_default_component = true; - - // 확장 컴포넌트 사용 권한 - $option->enable_component = false; - if(count($config->enable_component_grant)) { - foreach($group_list as $group_srl => $group_info) { - if(in_array($group_srl, $config->enable_component_grant)) { - $option->enable_component = true; - break; - } - } - } else $option->enable_component = true; - - // HTML 편집 권한 - $enable_html = false; - if(count($config->enable_html_grant)) { - foreach($group_list as $group_srl => $group_info) { - if(in_array($group_srl, $config->enable_html_grant)) { - $enable_html = true; - break; - } - } - } else $enable_html = true; - - if($enable_html) $option->disable_html = false; - else $option->disable_html = true; - - // 높이 설정 - $option->height = $config->editor_height; - - // 자동 저장 유무 옵션 설정 - $option->enable_autosave = $config->enable_autosave=='Y'?true:false; - - // 기타 설정 - $option->primary_key_name = $primary_key_name; - $option->content_key_name = $content_key_name; - - return $this->getEditor($upload_target_srl, $option); - } - - /** - * @brief 자동저장되어 있는 정보를 가져옴 - **/ - function getSavedDoc($upload_target_srl) { - // 로그인 회원이면 member_srl, 아니면 ipaddress로 저장되어 있는 문서를 찾음 - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $auto_save_args->member_srl = $logged_info->member_srl; - } else { - $auto_save_args->ipaddress = $_SERVER['REMOTE_ADDR']; - } - $auto_save_args->module_srl = Context::get('module_srl'); - // module_srl이 없으면 현재 모듈 - if(!$auto_save_args->module_srl) { - $current_module_info = Context::get('current_module_info'); - $auto_save_args->module_srl = $current_module_info->module_srl; - } - - // DB에서 자동저장 데이터 추출 - $output = executeQuery('editor.getSavedDocument', $auto_save_args); - $saved_doc = $output->data; - - // 자동저장한 결과가 없으면 null값 return - if(!$saved_doc) return; - - // 자동저장된 값이 혹시 이미 등록된 글인지 확인 - $oDocumentModel = &getModel('document'); - $oSaved = $oDocumentModel->getDocument($saved_doc->document_srl); - if($oSaved->isExists()) return; - - // 자동저장 데이터에 문서번호가 있고 이 번호에 파일이 있다면 파일을 모두 이동하고 - // 해당 문서 번호를 editor_sequence로 세팅함 - if($saved_doc->document_srl && $upload_target_srl && !Context::get('document_srl')) { - $saved_doc->module_srl = $auto_save_args->module_srl; - $oFileController = &getController('file'); - $oFileController->moveFile($saved_doc->document_srl, $saved_doc->module_srl, $upload_target_srl); - } - else if($upload_target_srl) $saved_doc->document_srl = $upload_target_srl; - - // 자동 저장 데이터 변경 - $oEditorController = &getController('editor'); - $oEditorController->deleteSavedDoc(false); - $oEditorController->doSaveDoc($saved_doc); - - return $saved_doc; - } - - /** - * @brief component의 객체 생성 - **/ - function getComponentObject($component, $editor_sequence = 0, $site_srl = 0) { - if(!preg_match('/^[a-zA-Z0-9_-]+$/',$component) || !preg_match('/^[0-9]+$/', $editor_sequence . $site_srl)) return; - - if(!$this->loaded_component_list[$component][$editor_sequence]) { - // 해당 컴포넌트의 객체를 생성해서 실행 - $class_path = sprintf('%scomponents/%s/', $this->module_path, $component); - $class_file = sprintf('%s%s.class.php', $class_path, $component); - if(!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); - - // 클래스 파일을 읽은 후 객체 생성 - require_once($class_file); - $tmp_fn = create_function('$seq,$path', "return new {$component}(\$seq,\$path);"); - $oComponent = $tmp_fn($editor_sequence, $class_path); - if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); - - // 설정 정보를 추가 - $component_info = $this->getComponent($component, $site_srl); - $oComponent->setInfo($component_info); - $this->loaded_component_list[$component][$editor_sequence] = $oComponent; - } - - return $this->loaded_component_list[$component][$editor_sequence]; - } - - /** - * @brief editor skin 목록을 return - **/ - function getEditorSkinList() { - return FileHandler::readDir('./modules/editor/skins'); - } - - /** - * @brief 에디터 컴포넌트 목록 캐시 파일 이름 return - **/ - function getCacheFile($filter_enabled= true, $site_srl = 0) { - $lang = Context::getLangType(); - $cache_path = _XE_PATH_.'files/cache/editor/cache/'; - if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); - $cache_file = $cache_path.'component_list.' . $lang .'.'; - if($filter_enabled) $cache_file .= 'filter.'; - if($site_srl) $cache_file .= $site_srl.'.'; - $cache_file .= 'php'; - return $cache_file; - } - - /** - * @brief component 목록을 return (DB정보 보함) - **/ - function getComponentList($filter_enabled = true, $site_srl=0, $from_db=false) { - $cache_file = $this->getCacheFile(false, $site_srl); - if($from_db || !file_exists($cache_file)) { - $oEditorController = &getController('editor'); - $oEditorController->makeCache(false, $site_srl); - } - - if(!file_exists($cache_file)) return; - @include($cache_file); - $logged_info = Context::get('logged_info'); - if($logged_info && is_array($logged_info->group_list)) - { - $group_list = array_keys($logged_info->group_list); - } - else - { - $group_list = array(); - } - - if(count($component_list)) { - foreach($component_list as $key => $val) { - if(!trim($key)) continue; - if(!is_dir(_XE_PATH_.'modules/editor/components/'.$key)) { - FileHandler::removeFile($cache_file); - return $this->getComponentList($filter_enabled, $site_srl); - } - if(!$filter_enabled) continue; - if($val->enabled == "N") { - unset($component_list->{$key}); - continue; - } - if($logged_info->is_admin == "Y" || $logged_info->is_site_admin == "Y") continue; - if($val->target_group) - { - if(!$logged_info) { - $val->enabled = "N"; - } - else { - $is_granted = false; - foreach($group_list as $group_srl) - { - if(in_array($group_srl, $val->target_group)) $is_granted = true; - } - if(!$is_granted) $val->enabled = "N"; - } - } - if($val->enabled != "N" && $val->mid_list) - { - $mid = Context::get('mid'); - if(!in_array($mid, $val->mid_list)) $val->enabled = "N"; - } - if($val->enabled == "N") { - unset($component_list->{$key}); - continue; - } - } - - } - return $component_list; - } - - /** - * @brief compnent의 xml+db정보를 구함 - **/ - function getComponent($component_name, $site_srl = 0) { - $args->component_name = $component_name; - - if($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('editor.getSiteComponent', $args); - } else { - $output = executeQuery('editor.getComponent', $args); - } - $component = $output->data; - - $component_name = $component->component_name; - - unset($xml_info); - $xml_info = $this->getComponentXmlInfo($component_name); - $xml_info->enabled = $component->enabled; - - $xml_info->target_group = array(); - - $xml_info->mid_list = array(); - - if($component->extra_vars) { - $extra_vars = unserialize($component->extra_vars); - - if($extra_vars->target_group) { - $xml_info->target_group = $extra_vars->target_group; - unset($extra_vars->target_group); - } - - if($extra_vars->mid_list) { - $xml_info->mid_list = $extra_vars->mid_list; - unset($extra_vars->mid_list); - } - - - if($xml_info->extra_vars) { - foreach($xml_info->extra_vars as $key => $val) { - $xml_info->extra_vars->{$key}->value = $extra_vars->{$key}; - } - } - } - - return $xml_info; - } - - /** - * @brief component의 xml정보를 읽음 - **/ - function getComponentXmlInfo($component) { - $lang_type = Context::getLangType(); - - // 요청된 컴포넌트의 xml파일 위치를 구함 - $component_path = sprintf('%s/components/%s/', $this->module_path, $component); - - $xml_file = sprintf('%sinfo.xml', $component_path); - $cache_file = sprintf('./files/cache/editor/%s.%s.php', $component, $lang_type); - - // 캐시된 xml파일이 있으면 include 후 정보 return - if(file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file)) { - include($cache_file); - return $xml_info; - } - - // 캐시된 파일이 없으면 파싱후 캐싱 후 return - $oParser = new XmlParser(); - $xml_doc = $oParser->loadXmlFile($xml_file); - - // 정보 정리 - if($xml_doc->component->version && $xml_doc->component->attrs->version == '0.2') { - $component_info->component_name = $component; - $component_info->title = $xml_doc->component->title->body; - $component_info->description = str_replace('\n', "\n", $xml_doc->component->description->body); - $component_info->version = $xml_doc->component->version->body; - $component_info->date = $xml_doc->component->date->body; - $component_info->homepage = $xml_doc->component->link->body; - $component_info->license = $xml_doc->component->license->body; - $component_info->license_link = $xml_doc->component->license->attrs->link; - - $buff = 'component_name = "%s";', $component_info->component_name); - $buff .= sprintf('$xml_info->title = "%s";', $component_info->title); - $buff .= sprintf('$xml_info->description = "%s";', $component_info->description); - $buff .= sprintf('$xml_info->version = "%s";', $component_info->version); - $buff .= sprintf('$xml_info->date = "%s";', $component_info->date); - $buff .= sprintf('$xml_info->homepage = "%s";', $component_info->homepage); - $buff .= sprintf('$xml_info->license = "%s";', $component_info->license); - $buff .= sprintf('$xml_info->license_link = "%s";', $component_info->license_link); - - // 작성자 정보 - if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author; - else $author_list = $xml_doc->component->author; - - for($i=0; $i < count($author_list); $i++) { - $buff .= sprintf('$xml_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body); - $buff .= sprintf('$xml_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address); - $buff .= sprintf('$xml_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link); - } - - // history - if($xml_doc->component->history) { - if(!is_array($xml_doc->component->history)) $history_list[] = $xml_doc->component->history; - else $history_list = $xml_doc->component->history; - - for($i=0; $i < count($history_list); $i++) { - unset($obj); - sscanf($history_list[$i]->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('$xml_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body); - $buff .= sprintf('$xml_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version); - $buff .= sprintf('$xml_info->history['.$i.']->date = "%s";', $date); - - if($history_list[$i]->author) { - (!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author; - - for($j=0; $j < count($obj->author_list); $j++) { - $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body); - $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address); - $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link); - } - } - - if($history_list[$i]->log) { - (!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log; - - for($j=0; $j < count($obj->log_list); $j++) { - $buff .= sprintf('$xml_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body); - $buff .= sprintf('$xml_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link); - } - } - } - } - - - } else { - sscanf($xml_doc->component->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); - $xml_info->component_name = $component; - $xml_info->title = $xml_doc->component->title->body; - $xml_info->description = str_replace('\n', "\n", $xml_doc->component->author->description->body); - $xml_info->version = $xml_doc->component->attrs->version; - $xml_info->date = $date; - $xml_info->author->name = $xml_doc->component->author->name->body; - $xml_info->author->email_address = $xml_doc->component->author->attrs->email_address; - $xml_info->author->homepage = $xml_doc->component->author->attrs->link; - - $buff = 'component_name = "%s";', $xml_info->component_name); - $buff .= sprintf('$xml_info->title = "%s";', $xml_info->title); - $buff .= sprintf('$xml_info->description = "%s";', $xml_info->description); - $buff .= sprintf('$xml_info->version = "%s";', $xml_info->version); - $buff .= sprintf('$xml_info->date = "%s";', $xml_info->date); - $buff .= sprintf('$xml_info->author[0]->name = "%s";', $xml_info->author->name); - $buff .= sprintf('$xml_info->author[0]->email_address = "%s";', $xml_info->author->email_address); - $buff .= sprintf('$xml_info->author[0]->homepage = "%s";', $xml_info->author->homepage); - } - - // 추가 변수 정리 (에디터 컴포넌트에서는 text형만 가능) - $extra_vars = $xml_doc->component->extra_vars->var; - if($extra_vars) { - if(!is_array($extra_vars)) $extra_vars = array($extra_vars); - foreach($extra_vars as $key => $val) { - unset($obj); - $key = $val->attrs->name; - $title = $val->title->body; - $description = $val->description->body; - $xml_info->extra_vars->{$key}->title = $title; - $xml_info->extra_vars->{$key}->description = $description; - - $buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'title', $title); - $buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'description', $description); - } - } - - $buff .= ' ?>'; - - FileHandler::writeFile($cache_file, $buff, "w"); - - unset($xml_info); - include($cache_file); - return $xml_info; - } - } -?> +getModulePartConfig('editor', $module_srl); + } + + $editor_config = $GLOBALS['__editor_module_config__'][$module_srl]; + + if(!is_object($editor_config)) $editor_config = null; + + if(!is_array($editor_config->enable_html_grant)) $editor_config->enable_html_grant = array(); + if(!is_array($editor_config->enable_comment_html_grant)) $editor_config->enable_comment_html_grant = array(); + if(!is_array($editor_config->upload_file_grant)) $editor_config->upload_file_grant = array(); + if(!is_array($editor_config->comment_upload_file_grant)) $editor_config->comment_upload_file_grant = array(); + if(!is_array($editor_config->enable_default_component_grant)) $editor_config->enable_default_component_grant = array(); + if(!is_array($editor_config->enable_comment_default_component_grant)) $editor_config->enable_comment_default_component_grant = array(); + if(!is_array($editor_config->enable_component_grant)) $editor_config->enable_component_grant = array(); + if(!is_array($editor_config->enable_comment_component_grant)) $editor_config->enable_comment_component_grant= array(); + + if(!$editor_config->editor_height) $editor_config->editor_height = 500; + if(!$editor_config->comment_editor_height) $editor_config->comment_editor_height = 120; + if($editor_config->enable_autosave!='N') $editor_config->enable_autosave = "Y"; + + if(!$editor_config->editor_skin) $editor_config->editor_skin = 'xpresseditor'; + if(!$editor_config->comment_editor_skin) $editor_config->comment_editor_skin = 'xpresseditor'; + if(!$editor_config->content_style) $editor_config->content_style = 'default'; + + return $editor_config; + } + + function loadDrComponents(){ + $drComponentPath = './modules/editor/skins/dreditor/drcomponents/'; + $drComponentList = FileHandler::readDir($drComponentPath); + + $oTemplate = &TemplateHandler::getInstance(); + + $drComponentInfo = array(); + if($drComponentList){ + foreach($drComponentList as $i => $drComponent){ + unset($obj); + $obj = $this->getDrComponentXmlInfo($drComponent); + Context::loadLang(sprintf('%s%s/lang/',$drComponentPath,$drComponent)); + $path = sprintf('%s%s/tpl/',$drComponentPath,$drComponent); + $obj->html = $oTemplate->compile($path,$drComponent); + $drComponentInfo[$drComponent] = $obj; + } + } + Context::set('drComponentList',$drComponentInfo); + } + + function getDrComponentXmlInfo($drComponentName){ + $lang_type = Context::getLangType(); + + // 요청된 컴포넌트의 xml파일 위치를 구함 + $component_path = sprintf('%s/skins/dreditor/drcomponents/%s/', $this->module_path, $drComponentName); + + $xml_file = sprintf('%sinfo.xml', $component_path); + $cache_file = sprintf('./files/cache/editor/dr_%s.%s.php', $drComponentName, $lang_type); + + // 캐시된 xml파일이 있으면 include 후 정보 return + if(file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file)) { + include($cache_file); + return $xml_info; + } + + // 캐시된 파일이 없으면 파싱후 캐싱 후 return + $oParser = new XmlParser(); + $xml_doc = $oParser->loadXmlFile($xml_file); + + $component_info->component_name = $drComponentName; + $component_info->title = $xml_doc->component->title->body; + $component_info->description = str_replace('\n', "\n", $xml_doc->component->description->body); + $component_info->version = $xml_doc->component->version->body; + $component_info->date = $xml_doc->component->date->body; + $component_info->homepage = $xml_doc->component->link->body; + $component_info->license = $xml_doc->component->license->body; + $component_info->license_link = $xml_doc->component->license->attrs->link; + + $buff = 'component_name = "%s";', $component_info->component_name); + $buff .= sprintf('$xml_info->title = "%s";', $component_info->title); + $buff .= sprintf('$xml_info->description = "%s";', $component_info->description); + $buff .= sprintf('$xml_info->version = "%s";', $component_info->version); + $buff .= sprintf('$xml_info->date = "%s";', $component_info->date); + $buff .= sprintf('$xml_info->homepage = "%s";', $component_info->homepage); + $buff .= sprintf('$xml_info->license = "%s";', $component_info->license); + $buff .= sprintf('$xml_info->license_link = "%s";', $component_info->license_link); + + // 작성자 정보 + if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author; + else $author_list = $xml_doc->component->author; + + for($i=0; $i < count($author_list); $i++) { + $buff .= sprintf('$xml_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body); + $buff .= sprintf('$xml_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address); + $buff .= sprintf('$xml_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link); + } + + // history + if($xml_doc->component->history) { + if(!is_array($xml_doc->component->history)) $history_list[] = $xml_doc->component->history; + else $history_list = $xml_doc->component->history; + + for($i=0; $i < count($history_list); $i++) { + unset($obj); + sscanf($history_list[$i]->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('$xml_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body); + $buff .= sprintf('$xml_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version); + $buff .= sprintf('$xml_info->history['.$i.']->date = "%s";', $date); + + if($history_list[$i]->author) { + (!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author; + + for($j=0; $j < count($obj->author_list); $j++) { + $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body); + $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address); + $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link); + } + } + + if($history_list[$i]->log) { + (!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log; + + for($j=0; $j < count($obj->log_list); $j++) { + $buff .= sprintf('$xml_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body); + $buff .= sprintf('$xml_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link); + } + } + } + } + + // 추가 변수 정리 (에디터 컴포넌트에서는 text형만 가능) + $extra_vars = $xml_doc->component->extra_vars->var; + if($extra_vars) { + if(!is_array($extra_vars)) $extra_vars = array($extra_vars); + foreach($extra_vars as $key => $val) { + unset($obj); + $key = $val->attrs->name; + $title = $val->title->body; + $description = $val->description->body; + $xml_info->extra_vars->{$key}->title = $title; + $xml_info->extra_vars->{$key}->description = $description; + + $buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'title', $title); + $buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'description', $description); + } + } + + $buff .= ' ?>'; + + FileHandler::writeFile($cache_file, $buff, "w"); + + unset($xml_info); + include($cache_file); + return $xml_info; + } + + /** + * @brief 에디터 template을 return + * upload_target_srl은 글의 수정시 호출하면 됨. + * 이 upload_target_srl은 첨부파일의 유무를 체크하기 위한 루틴을 구현하는데 사용됨. + **/ + function getEditor($upload_target_srl = 0, $option = null) { + /** + * 기본적인 에디터의 옵션을 정리 + **/ + // 파일 업로드 유무 옵션 설정 + if(!$option->allow_fileupload) $allow_fileupload = false; + else $allow_fileupload = true; + + // content_style 세팅 + if(!$option->content_style) $option->content_style = 'default'; + Context::set('content_style', $option->content_style); + + // 기본 글꼴 지정 + Context::set('content_font', $option->content_font); + Context::set('content_font_size', $option->content_font_size); + + // 자동 저장 유무 옵션 설정 글 수정시는 사용 안함 + if(!$option->enable_autosave) $enable_autosave = false; + elseif(Context::get($option->primary_key_name)) $enable_autosave = false; + else $enable_autosave = true; + + // 기본 에디터 컴포넌트 사용 설정 + if(!$option->enable_default_component) $enable_default_component = false; + else $enable_default_component = true; + + // 확장 컴포넌트 사용 설정 + if(!$option->enable_component) $enable_component = false; + else $enable_component = true; + + // html 모드 조절 + if($option->disable_html) $html_mode = false; + else $html_mode = true; + + // 높이 설정 + if(!$option->height) $editor_height = 400; + else $editor_height = $option->height; + + // 스킨 설정 + $skin = $option->skin; + if(!$skin) $skin = 'xpresseditor'; + + $colorset = $option->colorset; + Context::set('colorset', $colorset); + Context::set('skin', $skin); + + if($skin=='dreditor'){ + $this->loadDrComponents(); + } + + /** + * 자동백업 기능 체크 (글 수정일 경우는 사용하지 않음) + **/ + if($enable_autosave) { + // 자동 저장된 데이터를 추출 + $saved_doc = $this->getSavedDoc($upload_target_srl); + + // 자동 저장 데이터를 context setting + Context::set('saved_doc', $saved_doc); + } + Context::set('enable_autosave', $enable_autosave); + + /** + * 에디터의 고유 번호 추출 (한 페이지에 여러개의 에디터를 출력하는 경우를 대비) + **/ + if($option->editor_sequence) $editor_sequence = $option->editor_sequence; + else { + if(!$GLOBALS['_editor_sequence_']) $GLOBALS['_editor_sequence_'] = 1; + $editor_sequence = $GLOBALS['_editor_sequence_'] ++; + } + + /** + * 업로드 활성화시 내부적으로 file 모듈의 환경설정을 이용하여 설정 + **/ + $files_count = 0; + if($allow_fileupload) { + $oFileModel = &getModel('file'); + + // SWFUploader에 세팅할 업로드 설정 구함 + $file_config = $oFileModel->getUploadConfig(); + $file_config->allowed_attach_size = $file_config->allowed_attach_size*1024*1024; + $file_config->allowed_filesize = $file_config->allowed_filesize*1024*1024; + + Context::set('file_config',$file_config); + + // 업로드 가능 용량등에 대한 정보를 세팅 + $upload_status = $oFileModel->getUploadStatus(); + Context::set('upload_status', $upload_status); + + // upload가능하다고 설정 (내부적으로 캐싱하여 처리) + $oFileController = &getController('file'); + $oFileController->setUploadInfo($editor_sequence, $upload_target_srl); + + // 이미 등록된 파일이 있는지 검사 + if($upload_target_srl) $files_count = $oFileModel->getFilesCount($upload_target_srl); + } + Context::set('files_count', (int)$files_count); + + Context::set('allow_fileupload', $allow_fileupload); + + // 에디터 동작을 위한 editor_sequence값 설정 + Context::set('editor_sequence', $editor_sequence); + + // 파일 첨부 관련 행동을 하기 위해 문서 번호를 upload_target_srl로 설정 + // 신규문서일 경우 upload_target_srl=0 이고 첨부파일 관련 동작이 요청될때 이 값이 변경됨 + Context::set('upload_target_srl', $upload_target_srl); + + // 문서 혹은 댓글의 primary key값을 세팅한다. + Context::set('editor_primary_key_name', $option->primary_key_name); + + // 내용을 sync 맞추기 위한 content column name을 세팅한다 + Context::set('editor_content_key_name', $option->content_key_name); + + + /** + * 에디터 컴포넌트 체크 + **/ + $site_module_info = Context::get('site_module_info'); + $site_srl = (int)$site_module_info->site_srl; + if($enable_component) { + if(!Context::get('component_list')) { + $component_list = $this->getComponentList(true, $site_srl); + Context::set('component_list', $component_list); + } + } + Context::set('enable_component', $enable_component); + Context::set('enable_default_component', $enable_default_component); + + /** + * html_mode 가능한지 변수 설정 + **/ + Context::set('html_mode', $html_mode); + + /** + * 에디터 세로 크기 설정 + **/ + Context::set('editor_height', $editor_height); + + // 에디터의 초기화를 수동으로하는 것에 대한 값 체크 + Context::set('editor_manual_start', $option->manual_start); + + /** + * 템플릿을 미리 컴파일해서 컴파일된 소스를 하기 위해 스킨의 경로를 설정 + ?**/ + $tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin); + $tpl_file = 'editor.html'; + + if(!file_exists($tpl_path.$tpl_file)) { + $skin = 'xpresseditor'; + $tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin); + } + Context::set('editor_path', $tpl_path); + + // load editor skin lang + Context::loadLang($tpl_path.'lang'); + + // tpl 파일을 compile한 결과를 return + $oTemplate = new TemplateHandler(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 모듈별 설정이 반영된 에디터 template을 return + * getEditor() 와 동일한 결과물을 return하지만 getModuleEditor()는 각 모듈별 추가 설정을 통해 직접 제어되는 설정을 이용하여 에디터를 생성함 + * + * document/ comment 2가지 종류를 이용함. + * 굳이 나눈 이유는 하나의 모듈에서 2개 종류의 에디터 사용을 위해서인데 게시판이나 블로그등 원글과 그에 연관된 글(댓글)을 위한 용도임. + **/ + function getModuleEditor($type = 'document', $module_srl, $upload_target_srl, $primary_key_name, $content_key_name) { + // 지정된 모듈의 에디터 설정을 구해옴 + $editor_config = $this->getEditorConfig($module_srl); + + // type에 따른 설정 정리 + if($type == 'document') { + $config->editor_skin = $editor_config->editor_skin; + $config->content_style = $editor_config->content_style; + $config->content_font = $editor_config->content_font; + $config->content_font_size = $editor_config->content_font_size; + $config->sel_editor_colorset = $editor_config->sel_editor_colorset; + $config->upload_file_grant = $editor_config->upload_file_grant; + $config->enable_default_component_grant = $editor_config->enable_default_component_grant; + $config->enable_component_grant = $editor_config->enable_component_grant; + $config->enable_html_grant = $editor_config->enable_html_grant; + $config->editor_height = $editor_config->editor_height; + $config->enable_autosave = $editor_config->enable_autosave; + } else { + $config->editor_skin = $editor_config->comment_editor_skin; + $config->content_style = $editor_config->comment_content_style; + $config->content_font = $editor_config->content_font; + $config->content_font_size = $editor_config->content_font_size; + $config->sel_editor_colorset = $editor_config->sel_comment_editor_colorset; + $config->upload_file_grant = $editor_config->comment_upload_file_grant; + $config->enable_default_component_grant = $editor_config->enable_comment_default_component_grant; + $config->enable_component_grant = $editor_config->enable_comment_component_grant; + $config->enable_html_grant = $editor_config->enable_comment_html_grant; + $config->editor_height = $editor_config->comment_editor_height; + $config->enable_autosave = 'N'; + } + + // 권한 체크를 위한 현재 로그인 사용자의 그룹 설정 체크 + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $group_list = $logged_info->group_list; + } else { + $group_list = array(); + } + + // 에디터 옵션 변수를 미리 설정 + $option->skin = $config->editor_skin; + $option->content_style = $config->content_style; + $option->content_font = $config->content_font; + $option->content_font_size = $config->content_font_size; + $option->colorset = $config->sel_editor_colorset; + + // 파일 업로드 권한 체크 + $option->allow_fileupload = false; + if(count($config->upload_file_grant)) { + foreach($group_list as $group_srl => $group_info) { + if(in_array($group_srl, $config->upload_file_grant)) { + $option->allow_fileupload = true; + break; + } + } + } else $option->allow_fileupload = true; + + // 기본 컴포넌트 사용 권한 + $option->enable_default_component = false; + if(count($config->enable_default_component_grant)) { + foreach($group_list as $group_srl => $group_info) { + if(in_array($group_srl, $config->enable_default_component_grant)) { + $option->enable_default_component = true; + break; + } + } + } else $option->enable_default_component = true; + + // 확장 컴포넌트 사용 권한 + $option->enable_component = false; + if(count($config->enable_component_grant)) { + foreach($group_list as $group_srl => $group_info) { + if(in_array($group_srl, $config->enable_component_grant)) { + $option->enable_component = true; + break; + } + } + } else $option->enable_component = true; + + // HTML 편집 권한 + $enable_html = false; + if(count($config->enable_html_grant)) { + foreach($group_list as $group_srl => $group_info) { + if(in_array($group_srl, $config->enable_html_grant)) { + $enable_html = true; + break; + } + } + } else $enable_html = true; + + if($enable_html) $option->disable_html = false; + else $option->disable_html = true; + + // 높이 설정 + $option->height = $config->editor_height; + + // 자동 저장 유무 옵션 설정 + $option->enable_autosave = $config->enable_autosave=='Y'?true:false; + + // 기타 설정 + $option->primary_key_name = $primary_key_name; + $option->content_key_name = $content_key_name; + + return $this->getEditor($upload_target_srl, $option); + } + + /** + * @brief 자동저장되어 있는 정보를 가져옴 + **/ + function getSavedDoc($upload_target_srl) { + // 로그인 회원이면 member_srl, 아니면 ipaddress로 저장되어 있는 문서를 찾음 + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $auto_save_args->member_srl = $logged_info->member_srl; + } else { + $auto_save_args->ipaddress = $_SERVER['REMOTE_ADDR']; + } + $auto_save_args->module_srl = Context::get('module_srl'); + // module_srl이 없으면 현재 모듈 + if(!$auto_save_args->module_srl) { + $current_module_info = Context::get('current_module_info'); + $auto_save_args->module_srl = $current_module_info->module_srl; + } + + // DB에서 자동저장 데이터 추출 + $output = executeQuery('editor.getSavedDocument', $auto_save_args); + $saved_doc = $output->data; + + // 자동저장한 결과가 없으면 null값 return + if(!$saved_doc) return; + + // 자동저장된 값이 혹시 이미 등록된 글인지 확인 + $oDocumentModel = &getModel('document'); + $oSaved = $oDocumentModel->getDocument($saved_doc->document_srl); + if($oSaved->isExists()) return; + + // 자동저장 데이터에 문서번호가 있고 이 번호에 파일이 있다면 파일을 모두 이동하고 + // 해당 문서 번호를 editor_sequence로 세팅함 + if($saved_doc->document_srl && $upload_target_srl && !Context::get('document_srl')) { + $saved_doc->module_srl = $auto_save_args->module_srl; + $oFileController = &getController('file'); + $oFileController->moveFile($saved_doc->document_srl, $saved_doc->module_srl, $upload_target_srl); + } + else if($upload_target_srl) $saved_doc->document_srl = $upload_target_srl; + + // 자동 저장 데이터 변경 + $oEditorController = &getController('editor'); + $oEditorController->deleteSavedDoc(false); + $oEditorController->doSaveDoc($saved_doc); + + return $saved_doc; + } + + /** + * @brief component의 객체 생성 + **/ + function getComponentObject($component, $editor_sequence = 0, $site_srl = 0) { + if(!preg_match('/^[a-zA-Z0-9_-]+$/',$component) || !preg_match('/^[0-9]+$/', $editor_sequence . $site_srl)) return; + + if(!$this->loaded_component_list[$component][$editor_sequence]) { + // 해당 컴포넌트의 객체를 생성해서 실행 + $class_path = sprintf('%scomponents/%s/', $this->module_path, $component); + $class_file = sprintf('%s%s.class.php', $class_path, $component); + if(!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + + // 클래스 파일을 읽은 후 객체 생성 + require_once($class_file); + $tmp_fn = create_function('$seq,$path', "return new {$component}(\$seq,\$path);"); + $oComponent = $tmp_fn($editor_sequence, $class_path); + if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + + // 설정 정보를 추가 + $component_info = $this->getComponent($component, $site_srl); + $oComponent->setInfo($component_info); + $this->loaded_component_list[$component][$editor_sequence] = $oComponent; + } + + return $this->loaded_component_list[$component][$editor_sequence]; + } + + /** + * @brief editor skin 목록을 return + **/ + function getEditorSkinList() { + return FileHandler::readDir('./modules/editor/skins'); + } + + /** + * @brief 에디터 컴포넌트 목록 캐시 파일 이름 return + **/ + function getCacheFile($filter_enabled= true, $site_srl = 0) { + $lang = Context::getLangType(); + $cache_path = _XE_PATH_.'files/cache/editor/cache/'; + if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); + $cache_file = $cache_path.'component_list.' . $lang .'.'; + if($filter_enabled) $cache_file .= 'filter.'; + if($site_srl) $cache_file .= $site_srl.'.'; + $cache_file .= 'php'; + return $cache_file; + } + + /** + * @brief component 목록을 return (DB정보 보함) + **/ + function getComponentList($filter_enabled = true, $site_srl=0, $from_db=false) { + $cache_file = $this->getCacheFile(false, $site_srl); + if($from_db || !file_exists($cache_file)) { + $oEditorController = &getController('editor'); + $oEditorController->makeCache(false, $site_srl); + } + + if(!file_exists($cache_file)) return; + @include($cache_file); + $logged_info = Context::get('logged_info'); + if($logged_info && is_array($logged_info->group_list)) + { + $group_list = array_keys($logged_info->group_list); + } + else + { + $group_list = array(); + } + + if(count($component_list)) { + foreach($component_list as $key => $val) { + if(!trim($key)) continue; + if(!is_dir(_XE_PATH_.'modules/editor/components/'.$key)) { + FileHandler::removeFile($cache_file); + return $this->getComponentList($filter_enabled, $site_srl); + } + if(!$filter_enabled) continue; + if($val->enabled == "N") { + unset($component_list->{$key}); + continue; + } + if($logged_info->is_admin == "Y" || $logged_info->is_site_admin == "Y") continue; + if($val->target_group) + { + if(!$logged_info) { + $val->enabled = "N"; + } + else { + $is_granted = false; + foreach($group_list as $group_srl) + { + if(in_array($group_srl, $val->target_group)) $is_granted = true; + } + if(!$is_granted) $val->enabled = "N"; + } + } + if($val->enabled != "N" && $val->mid_list) + { + $mid = Context::get('mid'); + if(!in_array($mid, $val->mid_list)) $val->enabled = "N"; + } + if($val->enabled == "N") { + unset($component_list->{$key}); + continue; + } + } + + } + return $component_list; + } + + /** + * @brief compnent의 xml+db정보를 구함 + **/ + function getComponent($component_name, $site_srl = 0) { + $args->component_name = $component_name; + + if($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('editor.getSiteComponent', $args); + } else { + $output = executeQuery('editor.getComponent', $args); + } + $component = $output->data; + + $component_name = $component->component_name; + + unset($xml_info); + $xml_info = $this->getComponentXmlInfo($component_name); + $xml_info->enabled = $component->enabled; + + $xml_info->target_group = array(); + + $xml_info->mid_list = array(); + + if($component->extra_vars) { + $extra_vars = unserialize($component->extra_vars); + + if($extra_vars->target_group) { + $xml_info->target_group = $extra_vars->target_group; + unset($extra_vars->target_group); + } + + if($extra_vars->mid_list) { + $xml_info->mid_list = $extra_vars->mid_list; + unset($extra_vars->mid_list); + } + + + if($xml_info->extra_vars) { + foreach($xml_info->extra_vars as $key => $val) { + $xml_info->extra_vars->{$key}->value = $extra_vars->{$key}; + } + } + } + + return $xml_info; + } + + /** + * @brief component의 xml정보를 읽음 + **/ + function getComponentXmlInfo($component) { + $lang_type = Context::getLangType(); + + // 요청된 컴포넌트의 xml파일 위치를 구함 + $component_path = sprintf('%s/components/%s/', $this->module_path, $component); + + $xml_file = sprintf('%sinfo.xml', $component_path); + $cache_file = sprintf('./files/cache/editor/%s.%s.php', $component, $lang_type); + + // 캐시된 xml파일이 있으면 include 후 정보 return + if(file_exists($cache_file) && file_exists($xml_file) && filemtime($cache_file) > filemtime($xml_file)) { + include($cache_file); + return $xml_info; + } + + // 캐시된 파일이 없으면 파싱후 캐싱 후 return + $oParser = new XmlParser(); + $xml_doc = $oParser->loadXmlFile($xml_file); + + // 정보 정리 + if($xml_doc->component->version && $xml_doc->component->attrs->version == '0.2') { + $component_info->component_name = $component; + $component_info->title = $xml_doc->component->title->body; + $component_info->description = str_replace('\n', "\n", $xml_doc->component->description->body); + $component_info->version = $xml_doc->component->version->body; + $component_info->date = $xml_doc->component->date->body; + $component_info->homepage = $xml_doc->component->link->body; + $component_info->license = $xml_doc->component->license->body; + $component_info->license_link = $xml_doc->component->license->attrs->link; + + $buff = 'component_name = "%s";', $component_info->component_name); + $buff .= sprintf('$xml_info->title = "%s";', $component_info->title); + $buff .= sprintf('$xml_info->description = "%s";', $component_info->description); + $buff .= sprintf('$xml_info->version = "%s";', $component_info->version); + $buff .= sprintf('$xml_info->date = "%s";', $component_info->date); + $buff .= sprintf('$xml_info->homepage = "%s";', $component_info->homepage); + $buff .= sprintf('$xml_info->license = "%s";', $component_info->license); + $buff .= sprintf('$xml_info->license_link = "%s";', $component_info->license_link); + + // 작성자 정보 + if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author; + else $author_list = $xml_doc->component->author; + + for($i=0; $i < count($author_list); $i++) { + $buff .= sprintf('$xml_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body); + $buff .= sprintf('$xml_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address); + $buff .= sprintf('$xml_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link); + } + + // history + if($xml_doc->component->history) { + if(!is_array($xml_doc->component->history)) $history_list[] = $xml_doc->component->history; + else $history_list = $xml_doc->component->history; + + for($i=0; $i < count($history_list); $i++) { + unset($obj); + sscanf($history_list[$i]->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('$xml_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body); + $buff .= sprintf('$xml_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version); + $buff .= sprintf('$xml_info->history['.$i.']->date = "%s";', $date); + + if($history_list[$i]->author) { + (!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author; + + for($j=0; $j < count($obj->author_list); $j++) { + $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body); + $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address); + $buff .= sprintf('$xml_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link); + } + } + + if($history_list[$i]->log) { + (!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log; + + for($j=0; $j < count($obj->log_list); $j++) { + $buff .= sprintf('$xml_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body); + $buff .= sprintf('$xml_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link); + } + } + } + } + + + } else { + sscanf($xml_doc->component->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); + $xml_info->component_name = $component; + $xml_info->title = $xml_doc->component->title->body; + $xml_info->description = str_replace('\n', "\n", $xml_doc->component->author->description->body); + $xml_info->version = $xml_doc->component->attrs->version; + $xml_info->date = $date; + $xml_info->author->name = $xml_doc->component->author->name->body; + $xml_info->author->email_address = $xml_doc->component->author->attrs->email_address; + $xml_info->author->homepage = $xml_doc->component->author->attrs->link; + + $buff = 'component_name = "%s";', $xml_info->component_name); + $buff .= sprintf('$xml_info->title = "%s";', $xml_info->title); + $buff .= sprintf('$xml_info->description = "%s";', $xml_info->description); + $buff .= sprintf('$xml_info->version = "%s";', $xml_info->version); + $buff .= sprintf('$xml_info->date = "%s";', $xml_info->date); + $buff .= sprintf('$xml_info->author[0]->name = "%s";', $xml_info->author->name); + $buff .= sprintf('$xml_info->author[0]->email_address = "%s";', $xml_info->author->email_address); + $buff .= sprintf('$xml_info->author[0]->homepage = "%s";', $xml_info->author->homepage); + } + + // 추가 변수 정리 (에디터 컴포넌트에서는 text형만 가능) + $extra_vars = $xml_doc->component->extra_vars->var; + if($extra_vars) { + if(!is_array($extra_vars)) $extra_vars = array($extra_vars); + foreach($extra_vars as $key => $val) { + unset($obj); + $key = $val->attrs->name; + $title = $val->title->body; + $description = $val->description->body; + $xml_info->extra_vars->{$key}->title = $title; + $xml_info->extra_vars->{$key}->description = $description; + + $buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'title', $title); + $buff .= sprintf('$xml_info->extra_vars->%s->%s = "%s";', $key, 'description', $description); + } + } + + $buff .= ' ?>'; + + FileHandler::writeFile($cache_file, $buff, "w"); + + unset($xml_info); + include($cache_file); + return $xml_info; + } + } +?> diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index 8bf3584b0..f0ddaa973 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -1,138 +1,138 @@ -module_path."tpl/css/editor.css"); - - // 변수 정리 - $editor_sequence = Context::get('editor_sequence'); - $component = Context::get('component'); - - $site_module_info = Context::get('site_module_info'); - $site_srl = (int)$site_module_info->site_srl; - - // component 객체를 받음 - $oEditorModel = &getModel('editor'); - $oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl); - if(!$oComponent->toBool()) { - Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component)); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('component_not_founded'); - } else { - - // 컴포넌트의 popup url을 출력하는 method실행후 결과를 받음 - $popup_content = $oComponent->getPopupContent(); - Context::set('popup_content', $popup_content); - - // 레이아웃을 popup_layout으로 설정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('popup'); - } - } - - /** - * @brief 컴퍼넌트 정보 보기 - **/ - function dispEditorComponentInfo() { - $component_name = Context::get('component_name'); - - $site_module_info = Context::get('site_module_info'); - $site_srl = (int)$site_module_info->site_srl; - - $oEditorModel = &getModel('editor'); - $component = $oEditorModel->getComponent($component_name, $site_srl); - Context::set('component', $component); - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('view_component'); - $this->setLayoutFile("popup_layout"); - } - - /** - * @brief 모듈의 추가 설정에서 에디터 설정을 하는 form 추가 - **/ - function triggerDispEditorAdditionSetup(&$obj) { - $current_module_srl = Context::get('module_srl'); - $current_module_srls = Context::get('module_srls'); - - if(!$current_module_srl && !$current_module_srls) { - // 선택된 모듈의 정보를 가져옴 - $current_module_info = Context::get('current_module_info'); - $current_module_srl = $current_module_info->module_srl; - if(!$current_module_srl) return new Object(); - } - - // 에디터 설정을 구함 - $oEditorModel = &getModel('editor'); - $editor_config = $oEditorModel->getEditorConfig($current_module_srl); - - Context::set('editor_config', $editor_config); - - $oModuleModel = &getModel('module'); - - // 에디터 스킨 목록을 구함 - $editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins'); - Context::set('editor_skin_list', $editor_skin_list); - - $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin); - Context::set('editor_colorset_list', $skin_info->colorset); - $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin); - Context::set('editor_comment_colorset_list', $skin_info->colorset); - - $contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles'); - for($i=0,$c=count($contents);$i<$c;$i++) { - $style = $contents[$i]; - $info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles'); - $content_style_list[$style]->title = $info->title; - } - Context::set('content_style_list', $content_style_list); - - - // 그룹 목록을 구함 - $oMemberModel = &getModel('member'); - $site_module_info = Context::get('site_module_info'); - $group_list = $oMemberModel->getGroups($site_module_info->site_srl); - Context::set('group_list', $group_list); - - // 템플릿 파일 지정 - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'editor_module_config'); - $obj .= $tpl; - - return new Object(); - } - - - function dispEditorPreview(){ - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('preview'); - } - - function dispEditorSkinColorset(){ - $skin = Context::get('skin'); - $oModuleModel = &getModel('module'); - $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$skin); - $colorset = $skin_info->colorset; - Context::set('colorset', $colorset); - } - } -?> +module_path."tpl/css/editor.css"); + + // 변수 정리 + $editor_sequence = Context::get('editor_sequence'); + $component = Context::get('component'); + + $site_module_info = Context::get('site_module_info'); + $site_srl = (int)$site_module_info->site_srl; + + // component 객체를 받음 + $oEditorModel = &getModel('editor'); + $oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl); + if(!$oComponent->toBool()) { + Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('component_not_founded'); + } else { + + // 컴포넌트의 popup url을 출력하는 method실행후 결과를 받음 + $popup_content = $oComponent->getPopupContent(); + Context::set('popup_content', $popup_content); + + // 레이아웃을 popup_layout으로 설정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('popup'); + } + } + + /** + * @brief 컴퍼넌트 정보 보기 + **/ + function dispEditorComponentInfo() { + $component_name = Context::get('component_name'); + + $site_module_info = Context::get('site_module_info'); + $site_srl = (int)$site_module_info->site_srl; + + $oEditorModel = &getModel('editor'); + $component = $oEditorModel->getComponent($component_name, $site_srl); + Context::set('component', $component); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('view_component'); + $this->setLayoutFile("popup_layout"); + } + + /** + * @brief 모듈의 추가 설정에서 에디터 설정을 하는 form 추가 + **/ + function triggerDispEditorAdditionSetup(&$obj) { + $current_module_srl = Context::get('module_srl'); + $current_module_srls = Context::get('module_srls'); + + if(!$current_module_srl && !$current_module_srls) { + // 선택된 모듈의 정보를 가져옴 + $current_module_info = Context::get('current_module_info'); + $current_module_srl = $current_module_info->module_srl; + if(!$current_module_srl) return new Object(); + } + + // 에디터 설정을 구함 + $oEditorModel = &getModel('editor'); + $editor_config = $oEditorModel->getEditorConfig($current_module_srl); + + Context::set('editor_config', $editor_config); + + $oModuleModel = &getModel('module'); + + // 에디터 스킨 목록을 구함 + $editor_skin_list = FileHandler::readDir(_XE_PATH_.'modules/editor/skins'); + Context::set('editor_skin_list', $editor_skin_list); + + $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->editor_skin); + Context::set('editor_colorset_list', $skin_info->colorset); + $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$editor_config->comment_editor_skin); + Context::set('editor_comment_colorset_list', $skin_info->colorset); + + $contents = FileHandler::readDir(_XE_PATH_.'modules/editor/styles'); + for($i=0,$c=count($contents);$i<$c;$i++) { + $style = $contents[$i]; + $info = $oModuleModel->loadSkinInfo($this->module_path,$style,'styles'); + $content_style_list[$style]->title = $info->title; + } + Context::set('content_style_list', $content_style_list); + + + // 그룹 목록을 구함 + $oMemberModel = &getModel('member'); + $site_module_info = Context::get('site_module_info'); + $group_list = $oMemberModel->getGroups($site_module_info->site_srl); + Context::set('group_list', $group_list); + + // 템플릿 파일 지정 + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'editor_module_config'); + $obj .= $tpl; + + return new Object(); + } + + + function dispEditorPreview(){ + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('preview'); + } + + function dispEditorSkinColorset(){ + $skin = Context::get('skin'); + $oModuleModel = &getModel('module'); + $skin_info = $oModuleModel->loadSkinInfo($this->module_path,$skin); + $colorset = $skin_info->colorset; + Context::set('colorset', $colorset); + } + } +?> diff --git a/modules/editor/skins/dreditor/css/button.css b/modules/editor/skins/dreditor/css/button.css index 50315c21c..76d674d3d 100644 --- a/modules/editor/skins/dreditor/css/button.css +++ b/modules/editor/skins/dreditor/css/button.css @@ -1,81 +1,81 @@ -@charset "utf-8"; -/* NHN (developers@xpressengine.com) */ - -/* -- Button Gray Style -- */ -.buttonGray, -.buttonGray button{ position:relative; border:0; margin:0; display:inline-block; color:#000; font-family:Tahoma, Sans-serif; cursor:pointer; text-decoration:none !important; white-space:nowrap; vertical-align:middle; background-color:transparent; background-image:url(../img/buttonGray.gif) !important; background-repeat:no-repeat;} -.buttonGray{ margin-right:2px;} -.buttonGray button{ left:2px; overflow:visible;} - -/* Medium Size */ -.buttonGray.medium { background-position:left -30px;} -.buttonGray.medium button{ height:24px; padding:0 10px 0 8px; *padding:0 5px 0 3px; font:12px/25px Sans-serif; background-position:right -30px; _top:-1px;} - -/* Strong Button */ -.buttonGray.strong * { font-weight:bold !important;} - -/* Icon Add */ -.buttonGray .icon { position:relative; margin-right:5px; vertical-align:middle;} - -/* Button Reset */ -.buttonDrEditor, -.buttonDrEditor a, -.buttonDrEditor button, -.buttonDrEditor input { position:relative; margin:0; display:inline-block; text-decoration:none !important; border:0; font-size:12px; font-family:Tahoma, Sans-serif; white-space:nowrap; background:url(../img/buttonWhite.gif) no-repeat; vertical-align:middle; overflow:visible; color:#333;} -.buttonDrEditor { height:23px; padding:0; margin-right:2px; background-position:left top;} -.buttonDrEditor a, -.buttonDrEditor button, -.buttonDrEditor input{ left:2px; *vertical-align:top; cursor:pointer;} - -/* Button Size */ -.buttonDrEditor.large { height:29px; background-position:left -30px; } -.buttonDrEditor.xLarge { height:35px; background-position:left -65px; } -.buttonDrEditor.small { height:18px; background-position:left -107px; } -.buttonDrEditor a, -.buttonDrEditor button, -.buttonDrEditor input { height:23px; padding:0 10px 0 8px; font-size:12px; line-height:23px; background-position:right top;} -.buttonDrEditor.large a, -.buttonDrEditor.large button, -.buttonDrEditor.large input { height:30px; padding:0 10px 0 8px; font-size:16px; line-height:29px; background-position:right -30px;} -.buttonDrEditor.xLarge a, -.buttonDrEditor.xLarge button, -.buttonDrEditor.xLarge input { height:35px; padding:0 10px 0 8px; font-size:20px; line-height:35px; background-position:right -65px;} -.buttonDrEditor.small a, -.buttonDrEditor.small button, -.buttonDrEditor.small input { height:18px; padding:0 6px 0 4px; font-size:11px; line-height:18px; background-position:right -107px;} - -/* Button Text Color */ -.buttonDrEditor *:hover, -.buttonDrEditor *:active, -.buttonDrEditor *:focus{ color:#690;} -.buttonDrEditor.green, -.buttonDrEditor.green a, -.buttonDrEditor.green button, -.buttonDrEditor.green input { background-image:url(../img/buttonGreen.gif); color:#fff;} -.buttonDrEditor.green *:hover, -.buttonDrEditor.green *:active, -.buttonDrEditor.green *:focus{ color:#ff0;} -.buttonDrEditor.black, -.buttonDrEditor.black a, -.buttonDrEditor.black button, -.buttonDrEditor.black input { background-image:url(../img/buttonBlack.gif); color:#fff;} -.buttonDrEditor.black *:hover, -.buttonDrEditor.black *:active, -.buttonDrEditor.black *:focus{ color:#ff0;} -.buttonDrEditor.red, -.buttonDrEditor.red a, -.buttonDrEditor.red button, -.buttonDrEditor.red input { background-image:url(../img/buttonRed.gif); color:#fff;} -.buttonDrEditor.red *:hover, -.buttonDrEditor.red *:active, -.buttonDrEditor.red *:focus{ color:#ff0;} -.buttonDrEditor.blue, -.buttonDrEditor.blue a, -.buttonDrEditor.blue button, -.buttonDrEditor.blue input { background-image:url(../img/buttonBlue.gif); color:#fff;} -.buttonDrEditor.blue *:hover, -.buttonDrEditor.blue *:active, -.buttonDrEditor.blue *:focus{ color:#ff0;} - -/* Button Text Strong */ -.buttonDrEditor.strong * { font-weight:bold !important;} +@charset "utf-8"; +/* NHN (developers@xpressengine.com) */ + +/* -- Button Gray Style -- */ +.buttonGray, +.buttonGray button{ position:relative; border:0; margin:0; display:inline-block; color:#000; font-family:Tahoma, Sans-serif; cursor:pointer; text-decoration:none !important; white-space:nowrap; vertical-align:middle; background-color:transparent; background-image:url(../img/buttonGray.gif) !important; background-repeat:no-repeat;} +.buttonGray{ margin-right:2px;} +.buttonGray button{ left:2px; overflow:visible;} + +/* Medium Size */ +.buttonGray.medium { background-position:left -30px;} +.buttonGray.medium button{ height:24px; padding:0 10px 0 8px; *padding:0 5px 0 3px; font:12px/25px Sans-serif; background-position:right -30px; _top:-1px;} + +/* Strong Button */ +.buttonGray.strong * { font-weight:bold !important;} + +/* Icon Add */ +.buttonGray .icon { position:relative; margin-right:5px; vertical-align:middle;} + +/* Button Reset */ +.buttonDrEditor, +.buttonDrEditor a, +.buttonDrEditor button, +.buttonDrEditor input { position:relative; margin:0; display:inline-block; text-decoration:none !important; border:0; font-size:12px; font-family:Tahoma, Sans-serif; white-space:nowrap; background:url(../img/buttonWhite.gif) no-repeat; vertical-align:middle; overflow:visible; color:#333;} +.buttonDrEditor { height:23px; padding:0; margin-right:2px; background-position:left top;} +.buttonDrEditor a, +.buttonDrEditor button, +.buttonDrEditor input{ left:2px; *vertical-align:top; cursor:pointer;} + +/* Button Size */ +.buttonDrEditor.large { height:29px; background-position:left -30px; } +.buttonDrEditor.xLarge { height:35px; background-position:left -65px; } +.buttonDrEditor.small { height:18px; background-position:left -107px; } +.buttonDrEditor a, +.buttonDrEditor button, +.buttonDrEditor input { height:23px; padding:0 10px 0 8px; font-size:12px; line-height:23px; background-position:right top;} +.buttonDrEditor.large a, +.buttonDrEditor.large button, +.buttonDrEditor.large input { height:30px; padding:0 10px 0 8px; font-size:16px; line-height:29px; background-position:right -30px;} +.buttonDrEditor.xLarge a, +.buttonDrEditor.xLarge button, +.buttonDrEditor.xLarge input { height:35px; padding:0 10px 0 8px; font-size:20px; line-height:35px; background-position:right -65px;} +.buttonDrEditor.small a, +.buttonDrEditor.small button, +.buttonDrEditor.small input { height:18px; padding:0 6px 0 4px; font-size:11px; line-height:18px; background-position:right -107px;} + +/* Button Text Color */ +.buttonDrEditor *:hover, +.buttonDrEditor *:active, +.buttonDrEditor *:focus{ color:#690;} +.buttonDrEditor.green, +.buttonDrEditor.green a, +.buttonDrEditor.green button, +.buttonDrEditor.green input { background-image:url(../img/buttonGreen.gif); color:#fff;} +.buttonDrEditor.green *:hover, +.buttonDrEditor.green *:active, +.buttonDrEditor.green *:focus{ color:#ff0;} +.buttonDrEditor.black, +.buttonDrEditor.black a, +.buttonDrEditor.black button, +.buttonDrEditor.black input { background-image:url(../img/buttonBlack.gif); color:#fff;} +.buttonDrEditor.black *:hover, +.buttonDrEditor.black *:active, +.buttonDrEditor.black *:focus{ color:#ff0;} +.buttonDrEditor.red, +.buttonDrEditor.red a, +.buttonDrEditor.red button, +.buttonDrEditor.red input { background-image:url(../img/buttonRed.gif); color:#fff;} +.buttonDrEditor.red *:hover, +.buttonDrEditor.red *:active, +.buttonDrEditor.red *:focus{ color:#ff0;} +.buttonDrEditor.blue, +.buttonDrEditor.blue a, +.buttonDrEditor.blue button, +.buttonDrEditor.blue input { background-image:url(../img/buttonBlue.gif); color:#fff;} +.buttonDrEditor.blue *:hover, +.buttonDrEditor.blue *:active, +.buttonDrEditor.blue *:focus{ color:#ff0;} + +/* Button Text Strong */ +.buttonDrEditor.strong * { font-weight:bold !important;} diff --git a/modules/editor/skins/dreditor/css/dreditor.css b/modules/editor/skins/dreditor/css/dreditor.css index 07aceca58..c600d0b30 100644 --- a/modules/editor/skins/dreditor/css/dreditor.css +++ b/modules/editor/skins/dreditor/css/dreditor.css @@ -1,348 +1,348 @@ -@charset "utf-8"; -/* NHN (developers@xpressengine.com) */ - -/* Textyle Editor */ -.textyleEditor{ position:relative; *zoom:1; margin:0 0 1em 0;} -.textyleEditor:after{ content:""; display:block; clear:both;} -.textyleEditor .editorContainer{ position:relative; width:100%; display:table; table-layout:fixed;} -.textyleEditor .editorContainer .editorArea{ opacity:1; filter:alpha(opacity=100);} -.textyleEditor .editorContainer .writeArea{ position:relative; *zoom:1;} - -/* Writing Toolbar */ -.wToolbarContainer{ position:relative; margin:20px 0 40px 0; height:62px; overflow:hidden; z-index:1000; _zoom:1;} -.wToolbarContainer.more{ height:auto;} -.wToolbar{ position:relative; height:62px; margin:0 10px; *zoom:1; background-image:url(../img/bgWritingToolbarCenter.gif); background-repeat:repeat-x; } -.wToolbarContainer.more .wToolbar{ height:auto; padding:0 0 5px 0; background-position:0 bottom; border-top:1px solid #bec2ca;} -.wToolbar .cap{ position:absolute; top:0; height:62px; background-repeat:no-repeat; font-size:0; line-height:0; background:url(../img/bgWritingToolbar.gif) no-repeat; z-index:1;} -.wToolbar .top{ display:none; position:absolute; top:-1px; width:10px; height:7px; background:url(../img/bgWritingToolbarMore.gif) no-repeat; z-index:2;} -.wToolbarContainer.more .cap{ height:100%; _top:auto; _bottom:0; _height:300px; background:url(../img/bgWritingToolbarMore.gif) no-repeat;} -.wToolbarContainer.more .top{ display:block;} -.wToolbar .capLeft{ width:10px; left:-10px; background-position:left top;} -.wToolbar .topLeft{ left:-10px; background-position:left top;} -.wToolbarContainer.more .cap.capLeft{ background-position:left bottom;} -.wToolbar .capRight{ width:10px; right:-10px; background-position:right top;} -.wToolbar .topRight{ right:-10px; background-position:right top;} -.wToolbarContainer.more .capRight{ background-position:right bottom;} - -.wToolbar ul{ position:relative; margin:0 70px 0 0; padding:0; *zoom:1; height:58px; z-index:2;} -.wToolbarContainer.more ul{ height:auto; _height:58px; background:url(../img/hrToolbarMore.gif);} -.wToolbar ul:after{ content:""; display:block; clear:both;} -.wToolbar li{ position:relative; float:left; list-style:none; margin-bottom:4px; width:11.1%; *width:11%; _margin-top:0; _margin-right:-1px;} -.wToolbar li button{ position:relative; padding:0; width:100%; height:57px; *height:59px; border:0; background:transparent; cursor:pointer; font-size:11px; color:#44506a; background-image:url(../img/iconWritingToolbar.gif); background-repeat:no-repeat;} -.wToolbar li button .tx{ display:inline-block; padding-top:37px; height:20px;} -.wToolbar li.more{ float:none; position:absolute; top:1px; right:-70px; width:60px; background:url(../img/vrToolbarMore.gif) repeat-y; _zoom:1;} -.wToolbar li.more button{ width:60px;} -.wToolbarContainer.more li{ margin-bottom:0;} -.wToolbarContainer.more li.more{ height:100%;} -.wToolbarContainer.more li.more button{ height:100%; _height:114px; background:url(../img/iconWritingToolbarFolder.gif) no-repeat center !important;} -.wToolbarContainer.more li.more button .nx{ top:0;} -.wToolbar li.hover button{ background-color:#bfc3cb;} - -.wToolbar li.hx button{ background-position:center top;} -.wToolbar li.txt button{ background-position:center -100px;} -.wToolbar li.link button{ background-position:center -200px;} -.wToolbar li.list button{ background-position:center -300px;} -.wToolbar li.quote button{ background-position:center -400px;} -.wToolbar li.img button{ background-position:center -500px;} -.wToolbar li.movie button{ background-position:center -600px;} -.wToolbar li.file button{ background-position:center -700px;} -.wToolbar li.hr button{ background-position:center -800px;} -.wToolbar li.index button{ background-position:center -900px;} -.wToolbar li.material button{ background-position:center -1000px;} -.wToolbar li.help button{ background-position:center -1100px;} -.wToolbar li.more button{ background-position:center -1187px;} - -.wToolbar li .dragable{ position:absolute; display:none; bottom:38px; right:0; padding:0; border:0; width:20px; height:20px; overflow:hidden; background:url(../img/iconMovable.gif) no-repeat center center !important; cursor:move; font-size:0; line-height:0; text-indent:-200%;} -.wToolbarContainer.more li.hover .dragable{ _display:block;} -.wToolbarContainer.more li:hover .dragable{ display:block;} -.wToolbar li .nx{ position:absolute; text-align:center; top:8px; left:50%; font:bold 10px Tahoma, Geneva, sans-serif; color:#fff; width:18px; height:18px; line-height:16px; opacity:.7; background:url(../img/bgShortcut.png) no-repeat center top; _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='./modules/editor/skins/dreditor/img/bgShortcut.png', sizingMethod='crop');} - -/* Writing Area + Material Area */ -.wArea, -.mArea{ display:none; position:relative; *zoom:1; padding:20px; margin:0;} -.wArea{ background:#f5f5f5; border:1px solid #e9e9e9;} -.mArea{ background:url(../img/bgChess76.gif); border:1px solid #666;} -.mArea{ margin:20px 0;} -.wArea.open, -.mArea.open{ display:block;} -.wArea .cap, -.mArea .cap{ position:absolute; width:10px; height:10px; background-repeat:no-repeat; font-size:0; line-height:0; overflow:hidden;} -.wArea .cap{ background-image:url(../img/bgRouningF5.gif);} -.mArea .cap{ background-image:url(../img/bgRouning76.gif);} -.wArea .cap.capTL, -.mArea .cap.capTL{ top:-1px; left:-1px; background-position:left top;} -.wArea .cap.capTR, -.mArea .cap.capTR{ top:-1px; right:-1px; background-position:right top;} -.wArea .cap.capBL, -.mArea .cap.capBL{ bottom:-1px; left:-1px; background-position:left bottom;} -.wArea .cap.capBR, -.mArea .cap.capBR{ bottom:-1px; right:-1px; background-position:right bottom;} -.wArea .h4, -.mArea .h4{ font-size:16px; margin:0 0 10px 0;} -.wArea .h4{ color:#555;} -.mArea .h4{ color:#fff;} -.mArea .controls{ position:absolute; top:20px; right:20px;} - -/* Writing Area */ -.wArea .buttonArea{ position:relative; text-align:left; *zoom:1;} -.wArea .buttonArea .buttonGray button{ _top:0;} -.wArea .buttonArea .info{ display:inline; padding:0 0 0 15px; color:#777;} -.wArea .inputTitle{ width:98%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:6px 0 0 10px; height:21px; font-size:14px; margin-bottom:10px;} -.wArea .inputLink{ width:98%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:6px 0 0 10px; height:21px; font-size:11px; margin-bottom:10px;} -.wArea .inputText{ width:98%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:6px 0 0 10px; height:21px; font-size:12px; margin-bottom:10px;} -.wArea .inputFile{ width:100%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:6px 0 0 10px; height:29px; font-size:12px; margin-bottom:10px;} -.wArea .inputTextarea{ width:98%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:10px 0 0 10px; height:150px; font-size:12px; line-height:1.5; margin-bottom:10px;} -.wArea .inputRadio{ width:13px; height:13px; vertical-align:middle;} -.wArea .hr{ border-top:1px solid #e6e6e6; border-bottom:1px solid #fff; font-size:0; line-height:0; overflow:hidden; height:0; margin:15px -20px;} - -/* Material Area */ -.mArea .reload{ position:absolute; top:24px; right:40px; width:15px; height:16px; padding:0; cursor:pointer; border:0; *margin:0 5px 0 0; background:transparent url(../img/buttonRefresh.gif) no-repeat; vertical-align:middle;} -.mArea .reload span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; z-index:-1; visibility:hidden;} -.mArea .close{ position:absolute; top:24px; right:20px; width:15px; height:16px; padding:0; cursor:pointer; border:0; *margin:0 5px 0 0; background:transparent url(../img/buttonClose.gif) no-repeat; vertical-align:middle;} -.mArea .close span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; z-index:-1; visibility:hidden;} -.mArea .noData{ position:relative; border-top:1px solid #ddd; border-bottom:1px solid #ddd; background:#fff; padding:10px 20px;} -.mArea dl{ position:relative; background:#fff;} -.mArea dt{ position:relative; padding:7px 15px; font-weight:bold; color:#fff; background:#555; border-top:1px solid #444;} -.mArea dd{ margin:0 15px; padding:5px 0;} -.mArea dd .buttonDrEditor{ position:absolute; top:8px; right:10px;} -.mArea .eArea{ border:0; padding:0;} - -.mArea .paginate{ position:relative; width:100px; margin:0 auto; text-align:center; padding:0; font-size:12px; color:#fff; *zoom:1;} -.mArea .paginate:after{ content:""; display:block; clear:both;} -.mArea .paginate button{ width:17px; height:17px; padding:0; background:transparent url(../img/buttonPaginate.gif) no-repeat 0 0; cursor:pointer; border:0; vertical-align:middle;} -.mArea .paginate button span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden; z-index:-1;} -.mArea .paginate .prev{ float:left; background-position:left top;} -.mArea .paginate .next{ float:right; background-position:right top;} - -/* Writing Area Blank */ -.editorArea .wArea { display:block;} -.wArea.blank{ padding:15px 30px; margin:0;} -.wArea.blank dt{ font-size:12px; font-weight:bold; color:#333;} -.wArea.blank dd{ margin:0 0 5px 0; color:#767676;} -.wArea.blank .drEditorBugReport{ position:absolute; margin:0 !important; top:20px; right:30px;} - -/* Writing Area Hx */ -.wArea.hx ul{ margin:0 0 5px 0; padding:0; list-style:none;} -.wArea.hx li{ display:inline !important; font-weight:bold !important; color:#333 !important;} -.wArea.hx li label{ margin-right:30px;} -.wArea.hx .inputTitle{ font-weight:bold !important;} -.wArea.hx li.h3, -.wArea.hx .inputTitle.h3{ font-size:18px !important; height:28px;} -.wArea.hx li.h4, -.wArea.hx .inputTitle.h4{ font-size:16px !important; height:26px;} -.wArea.hx li.h5, -.wArea.hx .inputTitle.h5{ font-size:13px !important; height:23px;} - -/* Writing Area List */ -.wArea.list .toolbar{ border:1px solid #ddd; list-style:none; margin:0 0 -1px 0; padding:0; background:#fafafa; padding:6px 20px;} -.wArea.list .toolbar li{ display:inline; margin-right:5px;} -.wArea.list .toolbar li button{ position:relative; width:23px; height:22px; padding:0; border:0; cursor:pointer; background-image:url(../img/buttonListToolbar.gif); background-repeat:no-repeat;} -.wArea.list .toolbar li button:hover, -.wArea.list .toolbar li button:active, -.wArea.list .toolbar li button:focus{ border:1px solid #ddd;} -.wArea.list .toolbar li button.type_disc{ background-position:center 0;} -.wArea.list .toolbar li button.type_circle{ background-position:center -30px;} -.wArea.list .toolbar li button.type_square{ background-position:center -60px;} -.wArea.list .toolbar li button.type_decimal{ background-position:center -90px;} -.wArea.list .toolbar li button.type_lower-alpha{ background-position:center -120px;} -.wArea.list .toolbar li button.type_upper-alpha{ background-position:center -150px;} -.wArea.list .toolbar li button.type_lower-roman{ background-position:center -180px;} -.wArea.list .toolbar li button.type_upper-roman{ background-position:center -210px;} -.wArea.list .toolbar li button span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden;} - -.wArea.list .listArea{ padding:1em 0; margin-bottom:1em; background:#fff url(../img/bgInputText.gif) no-repeat; border:1px solid #ddd;} -.wArea.list .listArea ul{ border:0;} -.wArea.list .listArea input{ border:0; border-bottom:1px solid #ddd; background:transparent; width:96%; padding:3px 4px;} - -/* Writing Area Image */ -.wArea.img .image{ position:relative; margin-bottom:10px; background:#fff; padding:0; _width:100%; overflow:hidden;} -.wArea.img .image img{ max-width:100%;} -.wArea.img .uploading{ display:none; padding:0 0 0 20px; background:url(../img/iconLoading.gif) no-repeat left center;} -.wArea.img .uploading button{ border:2px solid #ccc; background:#eee; cursor:pointer; font-size:11px; font-weight:bold; padding:0; overflow:visible; vertical-align:middle; margin:0 10px;} -.wArea.img .info{ font-size:11px; color:#737fa1; margin:0;} -.wArea.img .resize{ display:none;} -.wArea.img .resize.open{ display:block;} -.wArea.img .resize dl *{ vertical-align:middle;} -.wArea.img .resize dt{ display:inline; font-weight:bold;} -.wArea.img .resize dd{ display:inline; margin:0;} -.wArea.img .resize .width{ width:60px; text-align:right; padding:1px 4px; height:16px;} -.wArea.img .resize .width.original{ background:#d4d0c8;} -.wArea.img .resize .resizeInfo{ margin:0 0 0 1em;} -.wArea.img .resize .resizeError{ display:none; padding:.5em 3.5em; margin:1em 6px 1em 0; color:#ff6633; background:#fff url(../img/iconCheckSmall.gif) no-repeat 2em center;; border:1px solid #ddd;} -.wArea.img .resize .resizeError.open{ display:block;} -.wArea.img .align{ display:none;} -.wArea.img .align dt{ display:inline; font-weight:bold;} -.wArea.img .align dd{ display:inline; margin:0;} - -/* Writing Area File */ -.wArea.file .buttonFileUpload, -.wArea.file .buttonFileUpload button{ position:relative; display:inline-block; height:39px; background-color:transparent; background-image:url(../img/buttonUpload.gif); background-repeat:no-repeat; cursor:pointer;} -.wArea.file .buttonFileUpload{ background-position:left top;} -.wArea.file .buttonFileUpload button{ left:7px; border:0; padding:0 15px 0 25px; background-position:right top; font-size:12px; font-weight:bold; color:#fff; line-height:39px; overflow:visible;} -.wArea.file .buttonFileUpload .swfupload{ margin:0 !important; cursor:pointer;} -.wArea.file .info{ font-size:11px; color:#737fa1;} -.wArea.file .info .help{ position:relative; font-size:11px; border:0; background:none; padding:0; cursor:pointer; *zoom:1; color:#f66; overflow:visible;} -.wArea.file .inputFile{ display:none;} -.wArea.file .inputFile.open{ display:block;} -.wArea.file dl{ margin:0; padding:0;} -.wArea.file dd{ font-size:11px; margin-bottom:3px; margin:0;} -.wArea.file dd strong{ margin-right:15px; color:#555; font-weight:normal;} -.wArea.file dd em{ color:#767676; font-style:normal; margin-right:15px;} -.wArea.file dd .buttonDelete{ border:0; padding:0; width:17px; height:17px; vertical-align:middle; cursor:pointer; background:url(../img/buttonTableDataX.gif) no-repeat center center;} -.wArea.file dd .buttonDelete span{ position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} -.wArea.file .summary{ text-align:right; font-size:11px;} -.wArea.file .summary{ color:#555;} -.wArea.file .summary em{ color:#767676; font-style:normal; margin-left:10px;} - -/* Writing Area Hr */ -.wArea.hr ul{ margin:0 0 20px 0; padding:0; list-style:none; font-size:12px; color:#555; *zoom:1;} -.wArea.hr li{ position:relative; margin-bottom:10px; *zoom:1;} -.wArea.hr li label{ position:relative; background:#f5f5f5; padding:0 15px 0 30px; margin-left:-30px; z-index:1; display:none;} -.wArea.hr li .inputRadio{ position:relative; z-index:10; display:none;} -.wArea.hr .inputToggle, -.wArea.hr .inputContinue{ position:absolute; top:0; border:1px solid #ddd; font-size:12px; color:#767676; width:150px; padding:3px 4px; height:14px; text-align:right; background-image:url(../img/bgInputText.gif); background-repeat:no-repeat;} -.wArea.hr .inputShow{ right:170px;} -.wArea.hr .inputHide, -.wArea.hr .inputContinue{ right:0;} -.wArea.hr .hRule{ position:absolute; width:100%; top:50%; left:0; display:block; border-top:1px solid #e6e6e6; border-bottom:1px solid #fff; font-size:0; line-height:0; overflow:hidden; height:0;} - -/* Edit Area */ -.eArea{ position:relative; padding:0 20px; margin:0; font-size:12px; border:1px solid #fff; overflow:visible !important; _zoom:1;} -.eArea.xe_dr_hr{ padding-top:1em; padding-bottom:1em;} -.eArea a{ color:#648AB9;} -.eArea button.holder{ position:absolute; left:-2000px; top:0px; } -.eArea .eTool{ display:none;} -.eArea .eFocusTrigger{ position:absolute; top:0; left:0; font-size:0; line-height:0; border:0; background:transparent; width:1px; height:1px; overflow:hidden; opacity:0; filter:alpha(opacity=0);} -.eArea .eFocusTrigger:focus{ border:1px solid;} -.eArea .del{ display:none; position:absolute; top:0; right:20px; border:0; padding:0; width:20px; height:20px; cursor:pointer; background:transparent url(../img/buttonTableDataX.gif) no-repeat center;} -.eArea .del span{position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} - -.eArea.xe_dr_img p{ overflow:hidden; width:100%;} -.eArea.xe_dr_img p img{ *padding:1em 0;} - -.eFocus{ border:1px solid #d8d8de; z-index:999; background:#f9f9f9;} -.eArea .cap{ display:none;} -.eFocus .cap{ display:none; *display:block; position:absolute; width:10px; height:10px; background-repeat:no-repeat; font-size:0; line-height:0; overflow:hidden;} -.eFocus .cap.capTL{ top:-1px; left:-1px; background-position:left top;} -.eFocus .cap.capTR{ top:-1px; right:-1px; background-position:right top;} -.eFocus .cap.capBL{ bottom:-1px; left:-1px; background-position:left bottom;} -.eFocus .cap.capBR{ bottom:-1px; right:-1px; background-position:right bottom;} - -.eFocus .eTool{ display:block; height:24px; position:absolute !important; z-index:99; top:-24px !important; left:-1px !important; white-space:nowrap; margin:0 0 0 2px !important; padding:0 5px 0 0 !important; border:0 !important; background:url(../img/bgEtool.gif) no-repeat right top !important;} -.eFocus .eTool li{ position:relative; left:-2px; display:block; float:left; height:22px; padding:2px 3px 0 5px; background:url(../img/vrContentNavigation.gif) no-repeat left center;} -.eFocus .eTool li.edit{ background:url(../img/bgEtool.gif) no-repeat left top;} -.eFocus .eTool li button{ border:0; padding:0; overflow:visible; cursor:pointer; background-color:transparent; font-size:11px; vertical-align:middle;} -.eFocus .eTool li.move button, -.eFocus .eTool li.delete button{ overflow:hidden; width:17px; height:17px; background-position:center center; background-repeat:no-repeat;} -.eFocus .eTool li.move button{ background-image:url(../img/iconMovable.gif); cursor:move;} -.eFocus .eTool li.delete button{ background-image:url(../img/buttonWasteBox.gif);} -.eFocus .eTool li.move button span, -.eFocus .eTool li.delete button span{ position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} -.eFocus .del{ display:block;} - -/* txEditor */ -.txEditor{ position:relative; width:98%; padding-right:10px; margin-bottom:10px; border:1px solid #ddd; *zoom:1; background:#fff;} -.txEditor .toolbar{ position:relative; z-index:10; margin:0 -10px 0 0; padding:6px 10px; list-style:none; *zoom:1; background:#fafafa; border-bottom:1px solid #ddd;} -.txEditor .toolbar:after{ content:""; display:block; clear:both;} -.txEditor .toolbar li{ position:relative; float:left; margin-right:5px;} -.txEditor .toolbar li button{ border:0; padding:0; height:22px; background-color:transparent; background-image:url(../img/buttonEditorToolbar.gif); background-repeat:no-repeat; cursor:pointer; vertical-align:middle;} -.txEditor .toolbar li button:hover, -.txEditor .toolbar li button:active, -.txEditor .toolbar li button:focus, -.txEditor .toolbar li button.active{ border:1px solid #ddd;} -.txEditor .toolbar li button span{ position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} -.txEditor .toolbar li select{ font-size:12px; vertical-align:middle; height:21px;} -.txEditor .toolbar li.undo button{ width:23px; background-position:center -210px;} -.txEditor .toolbar li.redo button{ width:23px; background-position:center -240px;} -.txEditor .toolbar li.strong button{ width:23px; background-position:center 0;} -.txEditor .toolbar li.em button{ width:23px; background-position:center -30px;} -.txEditor .toolbar li.underline button{ width:23px; background-position:center -60px;} -.txEditor .toolbar li.del button{ width:23px; background-position:center -90px;} -.txEditor .toolbar li.vRule{ padding-left:10px; margin:0 5px; background:url(../img/vrEditorToolbar.gif) no-repeat left center;} -.txEditor .toolbar li.aHref button{ width:23px; background-position:center -120px;} -.txEditor .toolbar li.fSize{ margin-right:5px;} -.txEditor .toolbar li.fColor{ margin-right:5px; z-index:2;} -.txEditor .toolbar li.fColor button{ width:28px; background-position:center -150px;} -.txEditor .toolbar li.bgColor{ margin-right:5px; z-index:1;} -.txEditor .toolbar li.bgColor button{ width:28px; background-position:center -180px;} -.txEditor .toolbar li.left button{ width:23px; background-position:center -270px;} -.txEditor .toolbar li.center button{ width:23px; background-position:center -300px;} -.txEditor .toolbar li.right button{ width:23px; background-position:center -330px;} -.txEditor .toolbar li.justify button{ width:23px; background-position:center -360px;} -.txEditor .toolbar li.character button{ width:23px; background-position:center -390px;} -.txEditor .toolbar li.list button{ width:23px; background-image:url(../img/buttonListToolbar.gif); background-repeat:no-repeat;} -.txEditor .toolbar li.disc button{ background-position:center 0;} -.txEditor .toolbar li.circle button{ background-position:center -30px;} -.txEditor .toolbar li.square button{ background-position:center -60px;} -.txEditor .toolbar li.decimal button{ background-position:center -90px;} -.txEditor .toolbar li.alphaLower button{ background-position:center -120px;} -.txEditor .toolbar li.alphaUpper button{ background-position:center -150px;} -.txEditor .toolbar li.romanLower button{ background-position:center -180px;} -.txEditor .toolbar li.romanUpper button{ background-position:center -210px;} -.txEditor .toolbar li .uri{ display:none; position:absolute; left:10px; top:25px; padding:15px 20px; border:1px solid #ddd; background:#fff; *zoom:1; *white-space:nowrap;} -.txEditor .toolbar li .uri h3{ font-size:12px; margin:0 0 .5em 0;} -.txEditor .toolbar li .uri .link{ border:1px solid #ccc; padding:3px 4px; height:14px; font-size:12px; width:200px; font-size:11px; color:#666;} -.txEditor .toolbar li .uri p{ margin:.5em 0;} -.txEditor .toolbar li .uri p input{ width:13px; height:13px; margin:0 3px 0 0; vertical-align:middle;} -.txEditor .toolbar li .uri .btn_area{ text-align:center;} -.txEditor .toolbar li .uri .btn_area .buttonGray, -.txEditor .toolbar li .uri .btn_area .buttonGray button{ background-image:url(../img/buttonGray.gif);} -.txEditor .toolbar li .uri .btn_area .buttonGray{ background-position:left top;} -.txEditor .toolbar li .uri .btn_area .buttonGray button{ background-position:right top; line-height:18px; border:0 !important; width:auto; padding:0 6px 0 4px;} -.txEditor .toolbar li .palette{ display:none; width:211px; position:absolute; left:0; top:25px; padding:8px 0 7px 8px; margin:0; list-style:none; border:1px solid #ddd; background:#fff; *zoom:1;} -.txEditor .toolbar li .palette:after{ content:""; display:block; clear:both;} -.txEditor .toolbar li .palette.open{ display:block;} -.txEditor .toolbar li .palette li{ float:left; margin:0 1px 1px 0; font-size:0; line-height:0;} -.txEditor .toolbar li .palette button{ position:relative; overflow:hidden; width:11px; height:11px;} -.txEditor .toolbar li .palette button span{ position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} -.txEditor .inputRichText{ position:relative; margin-right:-10px; position:relative; *zoom:1; z-index:1; padding:3px 0 3px 3px; background-image:url(../img/bgInputText.gif); background-repeat:no-repeat; background-position:0 0;} -.txEditor .inputRichText iframe{ width:100%; height:136px; border:0; overflow-x:hidden;} -.txEditor .resizeVertical{ position:relative; margin-right:-10px; border-top:1px solid #ddd; height:10px; background:url(../img/buttonResizeVertical.gif) no-repeat center center; *zoom:1; font-size:0; line-height:0;} -.txEditor .resizeVertical button{ width:100%; height:10px; border:0; margin:0; padding:0; background:transparent; cursor:n-resize; vertical-align:middle;} -.txEditor .resizeVertical button span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden; z-index:-1;} - -.txEditor .toolbar li.character .layer{ width:433px; height:242px; overflow:hidden; padding:0;} -.txEditor .toolbar li.character .layer .close{ position:absolute; background:url(../img/buttonLayerClose.gif) no-repeat center; width:20px; height:21px; top:4px; right:3px; border:0 !important;} -.txEditor .toolbar li.character .layer ul{ margin:0; padding:0; list-style:none;} -.txEditor .toolbar li.character .layer h3{position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} -.txEditor .toolbar li.character .layer .nav{ position:absolute; top:8px; left:-1px; overflow:hidden; white-space:nowrap; line-height:normal;} -.txEditor .toolbar li.character .layer .nav li{ display:inline; margin:0 -4px 0 0; padding:0 8px; background:url(../img/vr_layer_character.gif) no-repeat 0 center;} -.txEditor .toolbar li.character .layer .nav li a{ color:#444; text-decoration:none; letter-spacing:-1px;} -.txEditor .toolbar li.character .layer .nav li a:hover, -.txEditor .toolbar li.character .layer .nav li a:active, -.txEditor .toolbar li.character .layer .nav li a:focus{ text-decoration:underline;} -.txEditor .toolbar li.character .layer .nav li a.on{ font-weight:bold; color:#004790; display:inline;} -.txEditor .toolbar li.character .layer .list{ position:absolute; left:7px; top:30px; width:421px; height:172px; background:url(../img/bx_character.gif) no-repeat;} -.txEditor .toolbar li.character .layer .list li{ position:relative; top:1px; left:1px; float:left; width:20px; height:18px; margin:0 1px 1px 0;} -.txEditor .toolbar li.character .layer .list li button{ width:20px; height:18px; background:none; padding:0; vertical-align:top;} -.txEditor .toolbar li.character .layer .list li button:hover, -.txEditor .toolbar li.character .layer .list li button:active, -.txEditor .toolbar li.character .layer .list li button:focus{ border:2px solid #27c11a;} -.txEditor .toolbar li.character .layer .list li button span{ overflow:visible; font-size:12px; width:auto; height:auto; position:relative; visibility:visible; line-height:normal; z-index:1;} -.txEditor .toolbar li.character .layer p{ position:absolute; top:212px; left:7px; margin:0 !important;} -.txEditor .toolbar li.character .layer p *{ vertical-align:top;} -.txEditor .toolbar li.character .layer p label{ position:relative; top:4px; margin:0 7px 0 0; color:#333; letter-spacing:-1px; line-height:normal;} -.txEditor .toolbar li.character .layer p input{ padding:3px 0 0 4px; margin:0 4px 0 0; width:300px; height:16px; border:1px solid #acacac; border-right:1px solid #dadada; border-bottom:1px solid #dadada; font-size:12px;} -.txEditor .toolbar li.character .layer p button{ position:relative; *top:1px; width:38px; height:21px; background:url(../img/buttonLayerConfirm.gif) no-repeat; border:0 !important;} - -.txEditor .toolbar .font9px { font-size:9px } -.txEditor .toolbar .font10px { font-size:10px } -.txEditor .toolbar .font11px { font-size:11px } -.txEditor .toolbar .font12px { font-size:12px } -.txEditor .toolbar .font14px { font-size:14px } -.txEditor .toolbar .font16px { font-size:16px } -.txEditor .toolbar .font18px { font-size:18px } -.txEditor .toolbar .font20px { font-size:20px } -.txEditor .toolbar .font24px { font-size:24px } -.txEditor .toolbar .font28px { font-size:28px } -.txEditor .toolbar .font32px { font-size:32px } -.txEditor .toolbar .font36px { font-size:36px } - -/* Drag and Drop */ -.xe_dr_placeholder { background-color:#F8F4CE; margin:5px 0; height:20px; padding:10px 0; z-index:0; -moz-border-radius:5px; -webkit-border-radius:5px; z-index:1; } -.drag_handle { position:absolute; height:100%; width:10px; top:0; opacity:.5; filter:alpha(opacity=50); background:#ddd url(../img/iconDragHandler.gif) no-repeat center; cursor:n-resize; margin:0 2px !important; padding:0 !important; border:0 !important; _zoom:1;} -.drag_handle.left { left:0; } -.drag_handle.right { right:0; } -.eArea .drag_handle {display:none} -.eFocus .drag_handle {display:block} +@charset "utf-8"; +/* NHN (developers@xpressengine.com) */ + +/* Textyle Editor */ +.textyleEditor{ position:relative; *zoom:1; margin:0 0 1em 0;} +.textyleEditor:after{ content:""; display:block; clear:both;} +.textyleEditor .editorContainer{ position:relative; width:100%; display:table; table-layout:fixed;} +.textyleEditor .editorContainer .editorArea{ opacity:1; filter:alpha(opacity=100);} +.textyleEditor .editorContainer .writeArea{ position:relative; *zoom:1;} + +/* Writing Toolbar */ +.wToolbarContainer{ position:relative; margin:20px 0 40px 0; height:62px; overflow:hidden; z-index:1000; _zoom:1;} +.wToolbarContainer.more{ height:auto;} +.wToolbar{ position:relative; height:62px; margin:0 10px; *zoom:1; background-image:url(../img/bgWritingToolbarCenter.gif); background-repeat:repeat-x; } +.wToolbarContainer.more .wToolbar{ height:auto; padding:0 0 5px 0; background-position:0 bottom; border-top:1px solid #bec2ca;} +.wToolbar .cap{ position:absolute; top:0; height:62px; background-repeat:no-repeat; font-size:0; line-height:0; background:url(../img/bgWritingToolbar.gif) no-repeat; z-index:1;} +.wToolbar .top{ display:none; position:absolute; top:-1px; width:10px; height:7px; background:url(../img/bgWritingToolbarMore.gif) no-repeat; z-index:2;} +.wToolbarContainer.more .cap{ height:100%; _top:auto; _bottom:0; _height:300px; background:url(../img/bgWritingToolbarMore.gif) no-repeat;} +.wToolbarContainer.more .top{ display:block;} +.wToolbar .capLeft{ width:10px; left:-10px; background-position:left top;} +.wToolbar .topLeft{ left:-10px; background-position:left top;} +.wToolbarContainer.more .cap.capLeft{ background-position:left bottom;} +.wToolbar .capRight{ width:10px; right:-10px; background-position:right top;} +.wToolbar .topRight{ right:-10px; background-position:right top;} +.wToolbarContainer.more .capRight{ background-position:right bottom;} + +.wToolbar ul{ position:relative; margin:0 70px 0 0; padding:0; *zoom:1; height:58px; z-index:2;} +.wToolbarContainer.more ul{ height:auto; _height:58px; background:url(../img/hrToolbarMore.gif);} +.wToolbar ul:after{ content:""; display:block; clear:both;} +.wToolbar li{ position:relative; float:left; list-style:none; margin-bottom:4px; width:11.1%; *width:11%; _margin-top:0; _margin-right:-1px;} +.wToolbar li button{ position:relative; padding:0; width:100%; height:57px; *height:59px; border:0; background:transparent; cursor:pointer; font-size:11px; color:#44506a; background-image:url(../img/iconWritingToolbar.gif); background-repeat:no-repeat;} +.wToolbar li button .tx{ display:inline-block; padding-top:37px; height:20px;} +.wToolbar li.more{ float:none; position:absolute; top:1px; right:-70px; width:60px; background:url(../img/vrToolbarMore.gif) repeat-y; _zoom:1;} +.wToolbar li.more button{ width:60px;} +.wToolbarContainer.more li{ margin-bottom:0;} +.wToolbarContainer.more li.more{ height:100%;} +.wToolbarContainer.more li.more button{ height:100%; _height:114px; background:url(../img/iconWritingToolbarFolder.gif) no-repeat center !important;} +.wToolbarContainer.more li.more button .nx{ top:0;} +.wToolbar li.hover button{ background-color:#bfc3cb;} + +.wToolbar li.hx button{ background-position:center top;} +.wToolbar li.txt button{ background-position:center -100px;} +.wToolbar li.link button{ background-position:center -200px;} +.wToolbar li.list button{ background-position:center -300px;} +.wToolbar li.quote button{ background-position:center -400px;} +.wToolbar li.img button{ background-position:center -500px;} +.wToolbar li.movie button{ background-position:center -600px;} +.wToolbar li.file button{ background-position:center -700px;} +.wToolbar li.hr button{ background-position:center -800px;} +.wToolbar li.index button{ background-position:center -900px;} +.wToolbar li.material button{ background-position:center -1000px;} +.wToolbar li.help button{ background-position:center -1100px;} +.wToolbar li.more button{ background-position:center -1187px;} + +.wToolbar li .dragable{ position:absolute; display:none; bottom:38px; right:0; padding:0; border:0; width:20px; height:20px; overflow:hidden; background:url(../img/iconMovable.gif) no-repeat center center !important; cursor:move; font-size:0; line-height:0; text-indent:-200%;} +.wToolbarContainer.more li.hover .dragable{ _display:block;} +.wToolbarContainer.more li:hover .dragable{ display:block;} +.wToolbar li .nx{ position:absolute; text-align:center; top:8px; left:50%; font:bold 10px Tahoma, Geneva, sans-serif; color:#fff; width:18px; height:18px; line-height:16px; opacity:.7; background:url(../img/bgShortcut.png) no-repeat center top; _background:none; _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='./modules/editor/skins/dreditor/img/bgShortcut.png', sizingMethod='crop');} + +/* Writing Area + Material Area */ +.wArea, +.mArea{ display:none; position:relative; *zoom:1; padding:20px; margin:0;} +.wArea{ background:#f5f5f5; border:1px solid #e9e9e9;} +.mArea{ background:url(../img/bgChess76.gif); border:1px solid #666;} +.mArea{ margin:20px 0;} +.wArea.open, +.mArea.open{ display:block;} +.wArea .cap, +.mArea .cap{ position:absolute; width:10px; height:10px; background-repeat:no-repeat; font-size:0; line-height:0; overflow:hidden;} +.wArea .cap{ background-image:url(../img/bgRouningF5.gif);} +.mArea .cap{ background-image:url(../img/bgRouning76.gif);} +.wArea .cap.capTL, +.mArea .cap.capTL{ top:-1px; left:-1px; background-position:left top;} +.wArea .cap.capTR, +.mArea .cap.capTR{ top:-1px; right:-1px; background-position:right top;} +.wArea .cap.capBL, +.mArea .cap.capBL{ bottom:-1px; left:-1px; background-position:left bottom;} +.wArea .cap.capBR, +.mArea .cap.capBR{ bottom:-1px; right:-1px; background-position:right bottom;} +.wArea .h4, +.mArea .h4{ font-size:16px; margin:0 0 10px 0;} +.wArea .h4{ color:#555;} +.mArea .h4{ color:#fff;} +.mArea .controls{ position:absolute; top:20px; right:20px;} + +/* Writing Area */ +.wArea .buttonArea{ position:relative; text-align:left; *zoom:1;} +.wArea .buttonArea .buttonGray button{ _top:0;} +.wArea .buttonArea .info{ display:inline; padding:0 0 0 15px; color:#777;} +.wArea .inputTitle{ width:98%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:6px 0 0 10px; height:21px; font-size:14px; margin-bottom:10px;} +.wArea .inputLink{ width:98%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:6px 0 0 10px; height:21px; font-size:11px; margin-bottom:10px;} +.wArea .inputText{ width:98%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:6px 0 0 10px; height:21px; font-size:12px; margin-bottom:10px;} +.wArea .inputFile{ width:100%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:6px 0 0 10px; height:29px; font-size:12px; margin-bottom:10px;} +.wArea .inputTextarea{ width:98%; border:1px solid #ddd; background:#fff url(../img/bgInputText.gif) no-repeat; color:#767676; padding:10px 0 0 10px; height:150px; font-size:12px; line-height:1.5; margin-bottom:10px;} +.wArea .inputRadio{ width:13px; height:13px; vertical-align:middle;} +.wArea .hr{ border-top:1px solid #e6e6e6; border-bottom:1px solid #fff; font-size:0; line-height:0; overflow:hidden; height:0; margin:15px -20px;} + +/* Material Area */ +.mArea .reload{ position:absolute; top:24px; right:40px; width:15px; height:16px; padding:0; cursor:pointer; border:0; *margin:0 5px 0 0; background:transparent url(../img/buttonRefresh.gif) no-repeat; vertical-align:middle;} +.mArea .reload span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; z-index:-1; visibility:hidden;} +.mArea .close{ position:absolute; top:24px; right:20px; width:15px; height:16px; padding:0; cursor:pointer; border:0; *margin:0 5px 0 0; background:transparent url(../img/buttonClose.gif) no-repeat; vertical-align:middle;} +.mArea .close span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; z-index:-1; visibility:hidden;} +.mArea .noData{ position:relative; border-top:1px solid #ddd; border-bottom:1px solid #ddd; background:#fff; padding:10px 20px;} +.mArea dl{ position:relative; background:#fff;} +.mArea dt{ position:relative; padding:7px 15px; font-weight:bold; color:#fff; background:#555; border-top:1px solid #444;} +.mArea dd{ margin:0 15px; padding:5px 0;} +.mArea dd .buttonDrEditor{ position:absolute; top:8px; right:10px;} +.mArea .eArea{ border:0; padding:0;} + +.mArea .paginate{ position:relative; width:100px; margin:0 auto; text-align:center; padding:0; font-size:12px; color:#fff; *zoom:1;} +.mArea .paginate:after{ content:""; display:block; clear:both;} +.mArea .paginate button{ width:17px; height:17px; padding:0; background:transparent url(../img/buttonPaginate.gif) no-repeat 0 0; cursor:pointer; border:0; vertical-align:middle;} +.mArea .paginate button span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden; z-index:-1;} +.mArea .paginate .prev{ float:left; background-position:left top;} +.mArea .paginate .next{ float:right; background-position:right top;} + +/* Writing Area Blank */ +.editorArea .wArea { display:block;} +.wArea.blank{ padding:15px 30px; margin:0;} +.wArea.blank dt{ font-size:12px; font-weight:bold; color:#333;} +.wArea.blank dd{ margin:0 0 5px 0; color:#767676;} +.wArea.blank .drEditorBugReport{ position:absolute; margin:0 !important; top:20px; right:30px;} + +/* Writing Area Hx */ +.wArea.hx ul{ margin:0 0 5px 0; padding:0; list-style:none;} +.wArea.hx li{ display:inline !important; font-weight:bold !important; color:#333 !important;} +.wArea.hx li label{ margin-right:30px;} +.wArea.hx .inputTitle{ font-weight:bold !important;} +.wArea.hx li.h3, +.wArea.hx .inputTitle.h3{ font-size:18px !important; height:28px;} +.wArea.hx li.h4, +.wArea.hx .inputTitle.h4{ font-size:16px !important; height:26px;} +.wArea.hx li.h5, +.wArea.hx .inputTitle.h5{ font-size:13px !important; height:23px;} + +/* Writing Area List */ +.wArea.list .toolbar{ border:1px solid #ddd; list-style:none; margin:0 0 -1px 0; padding:0; background:#fafafa; padding:6px 20px;} +.wArea.list .toolbar li{ display:inline; margin-right:5px;} +.wArea.list .toolbar li button{ position:relative; width:23px; height:22px; padding:0; border:0; cursor:pointer; background-image:url(../img/buttonListToolbar.gif); background-repeat:no-repeat;} +.wArea.list .toolbar li button:hover, +.wArea.list .toolbar li button:active, +.wArea.list .toolbar li button:focus{ border:1px solid #ddd;} +.wArea.list .toolbar li button.type_disc{ background-position:center 0;} +.wArea.list .toolbar li button.type_circle{ background-position:center -30px;} +.wArea.list .toolbar li button.type_square{ background-position:center -60px;} +.wArea.list .toolbar li button.type_decimal{ background-position:center -90px;} +.wArea.list .toolbar li button.type_lower-alpha{ background-position:center -120px;} +.wArea.list .toolbar li button.type_upper-alpha{ background-position:center -150px;} +.wArea.list .toolbar li button.type_lower-roman{ background-position:center -180px;} +.wArea.list .toolbar li button.type_upper-roman{ background-position:center -210px;} +.wArea.list .toolbar li button span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden;} + +.wArea.list .listArea{ padding:1em 0; margin-bottom:1em; background:#fff url(../img/bgInputText.gif) no-repeat; border:1px solid #ddd;} +.wArea.list .listArea ul{ border:0;} +.wArea.list .listArea input{ border:0; border-bottom:1px solid #ddd; background:transparent; width:96%; padding:3px 4px;} + +/* Writing Area Image */ +.wArea.img .image{ position:relative; margin-bottom:10px; background:#fff; padding:0; _width:100%; overflow:hidden;} +.wArea.img .image img{ max-width:100%;} +.wArea.img .uploading{ display:none; padding:0 0 0 20px; background:url(../img/iconLoading.gif) no-repeat left center;} +.wArea.img .uploading button{ border:2px solid #ccc; background:#eee; cursor:pointer; font-size:11px; font-weight:bold; padding:0; overflow:visible; vertical-align:middle; margin:0 10px;} +.wArea.img .info{ font-size:11px; color:#737fa1; margin:0;} +.wArea.img .resize{ display:none;} +.wArea.img .resize.open{ display:block;} +.wArea.img .resize dl *{ vertical-align:middle;} +.wArea.img .resize dt{ display:inline; font-weight:bold;} +.wArea.img .resize dd{ display:inline; margin:0;} +.wArea.img .resize .width{ width:60px; text-align:right; padding:1px 4px; height:16px;} +.wArea.img .resize .width.original{ background:#d4d0c8;} +.wArea.img .resize .resizeInfo{ margin:0 0 0 1em;} +.wArea.img .resize .resizeError{ display:none; padding:.5em 3.5em; margin:1em 6px 1em 0; color:#ff6633; background:#fff url(../img/iconCheckSmall.gif) no-repeat 2em center;; border:1px solid #ddd;} +.wArea.img .resize .resizeError.open{ display:block;} +.wArea.img .align{ display:none;} +.wArea.img .align dt{ display:inline; font-weight:bold;} +.wArea.img .align dd{ display:inline; margin:0;} + +/* Writing Area File */ +.wArea.file .buttonFileUpload, +.wArea.file .buttonFileUpload button{ position:relative; display:inline-block; height:39px; background-color:transparent; background-image:url(../img/buttonUpload.gif); background-repeat:no-repeat; cursor:pointer;} +.wArea.file .buttonFileUpload{ background-position:left top;} +.wArea.file .buttonFileUpload button{ left:7px; border:0; padding:0 15px 0 25px; background-position:right top; font-size:12px; font-weight:bold; color:#fff; line-height:39px; overflow:visible;} +.wArea.file .buttonFileUpload .swfupload{ margin:0 !important; cursor:pointer;} +.wArea.file .info{ font-size:11px; color:#737fa1;} +.wArea.file .info .help{ position:relative; font-size:11px; border:0; background:none; padding:0; cursor:pointer; *zoom:1; color:#f66; overflow:visible;} +.wArea.file .inputFile{ display:none;} +.wArea.file .inputFile.open{ display:block;} +.wArea.file dl{ margin:0; padding:0;} +.wArea.file dd{ font-size:11px; margin-bottom:3px; margin:0;} +.wArea.file dd strong{ margin-right:15px; color:#555; font-weight:normal;} +.wArea.file dd em{ color:#767676; font-style:normal; margin-right:15px;} +.wArea.file dd .buttonDelete{ border:0; padding:0; width:17px; height:17px; vertical-align:middle; cursor:pointer; background:url(../img/buttonTableDataX.gif) no-repeat center center;} +.wArea.file dd .buttonDelete span{ position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} +.wArea.file .summary{ text-align:right; font-size:11px;} +.wArea.file .summary{ color:#555;} +.wArea.file .summary em{ color:#767676; font-style:normal; margin-left:10px;} + +/* Writing Area Hr */ +.wArea.hr ul{ margin:0 0 20px 0; padding:0; list-style:none; font-size:12px; color:#555; *zoom:1;} +.wArea.hr li{ position:relative; margin-bottom:10px; *zoom:1;} +.wArea.hr li label{ position:relative; background:#f5f5f5; padding:0 15px 0 30px; margin-left:-30px; z-index:1; display:none;} +.wArea.hr li .inputRadio{ position:relative; z-index:10; display:none;} +.wArea.hr .inputToggle, +.wArea.hr .inputContinue{ position:absolute; top:0; border:1px solid #ddd; font-size:12px; color:#767676; width:150px; padding:3px 4px; height:14px; text-align:right; background-image:url(../img/bgInputText.gif); background-repeat:no-repeat;} +.wArea.hr .inputShow{ right:170px;} +.wArea.hr .inputHide, +.wArea.hr .inputContinue{ right:0;} +.wArea.hr .hRule{ position:absolute; width:100%; top:50%; left:0; display:block; border-top:1px solid #e6e6e6; border-bottom:1px solid #fff; font-size:0; line-height:0; overflow:hidden; height:0;} + +/* Edit Area */ +.eArea{ position:relative; padding:0 20px; margin:0; font-size:12px; border:1px solid #fff; overflow:visible !important; _zoom:1;} +.eArea.xe_dr_hr{ padding-top:1em; padding-bottom:1em;} +.eArea a{ color:#648AB9;} +.eArea button.holder{ position:absolute; left:-2000px; top:0px; } +.eArea .eTool{ display:none;} +.eArea .eFocusTrigger{ position:absolute; top:0; left:0; font-size:0; line-height:0; border:0; background:transparent; width:1px; height:1px; overflow:hidden; opacity:0; filter:alpha(opacity=0);} +.eArea .eFocusTrigger:focus{ border:1px solid;} +.eArea .del{ display:none; position:absolute; top:0; right:20px; border:0; padding:0; width:20px; height:20px; cursor:pointer; background:transparent url(../img/buttonTableDataX.gif) no-repeat center;} +.eArea .del span{position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} + +.eArea.xe_dr_img p{ overflow:hidden; width:100%;} +.eArea.xe_dr_img p img{ *padding:1em 0;} + +.eFocus{ border:1px solid #d8d8de; z-index:999; background:#f9f9f9;} +.eArea .cap{ display:none;} +.eFocus .cap{ display:none; *display:block; position:absolute; width:10px; height:10px; background-repeat:no-repeat; font-size:0; line-height:0; overflow:hidden;} +.eFocus .cap.capTL{ top:-1px; left:-1px; background-position:left top;} +.eFocus .cap.capTR{ top:-1px; right:-1px; background-position:right top;} +.eFocus .cap.capBL{ bottom:-1px; left:-1px; background-position:left bottom;} +.eFocus .cap.capBR{ bottom:-1px; right:-1px; background-position:right bottom;} + +.eFocus .eTool{ display:block; height:24px; position:absolute !important; z-index:99; top:-24px !important; left:-1px !important; white-space:nowrap; margin:0 0 0 2px !important; padding:0 5px 0 0 !important; border:0 !important; background:url(../img/bgEtool.gif) no-repeat right top !important;} +.eFocus .eTool li{ position:relative; left:-2px; display:block; float:left; height:22px; padding:2px 3px 0 5px; background:url(../img/vrContentNavigation.gif) no-repeat left center;} +.eFocus .eTool li.edit{ background:url(../img/bgEtool.gif) no-repeat left top;} +.eFocus .eTool li button{ border:0; padding:0; overflow:visible; cursor:pointer; background-color:transparent; font-size:11px; vertical-align:middle;} +.eFocus .eTool li.move button, +.eFocus .eTool li.delete button{ overflow:hidden; width:17px; height:17px; background-position:center center; background-repeat:no-repeat;} +.eFocus .eTool li.move button{ background-image:url(../img/iconMovable.gif); cursor:move;} +.eFocus .eTool li.delete button{ background-image:url(../img/buttonWasteBox.gif);} +.eFocus .eTool li.move button span, +.eFocus .eTool li.delete button span{ position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} +.eFocus .del{ display:block;} + +/* txEditor */ +.txEditor{ position:relative; width:98%; padding-right:10px; margin-bottom:10px; border:1px solid #ddd; *zoom:1; background:#fff;} +.txEditor .toolbar{ position:relative; z-index:10; margin:0 -10px 0 0; padding:6px 10px; list-style:none; *zoom:1; background:#fafafa; border-bottom:1px solid #ddd;} +.txEditor .toolbar:after{ content:""; display:block; clear:both;} +.txEditor .toolbar li{ position:relative; float:left; margin-right:5px;} +.txEditor .toolbar li button{ border:0; padding:0; height:22px; background-color:transparent; background-image:url(../img/buttonEditorToolbar.gif); background-repeat:no-repeat; cursor:pointer; vertical-align:middle;} +.txEditor .toolbar li button:hover, +.txEditor .toolbar li button:active, +.txEditor .toolbar li button:focus, +.txEditor .toolbar li button.active{ border:1px solid #ddd;} +.txEditor .toolbar li button span{ position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} +.txEditor .toolbar li select{ font-size:12px; vertical-align:middle; height:21px;} +.txEditor .toolbar li.undo button{ width:23px; background-position:center -210px;} +.txEditor .toolbar li.redo button{ width:23px; background-position:center -240px;} +.txEditor .toolbar li.strong button{ width:23px; background-position:center 0;} +.txEditor .toolbar li.em button{ width:23px; background-position:center -30px;} +.txEditor .toolbar li.underline button{ width:23px; background-position:center -60px;} +.txEditor .toolbar li.del button{ width:23px; background-position:center -90px;} +.txEditor .toolbar li.vRule{ padding-left:10px; margin:0 5px; background:url(../img/vrEditorToolbar.gif) no-repeat left center;} +.txEditor .toolbar li.aHref button{ width:23px; background-position:center -120px;} +.txEditor .toolbar li.fSize{ margin-right:5px;} +.txEditor .toolbar li.fColor{ margin-right:5px; z-index:2;} +.txEditor .toolbar li.fColor button{ width:28px; background-position:center -150px;} +.txEditor .toolbar li.bgColor{ margin-right:5px; z-index:1;} +.txEditor .toolbar li.bgColor button{ width:28px; background-position:center -180px;} +.txEditor .toolbar li.left button{ width:23px; background-position:center -270px;} +.txEditor .toolbar li.center button{ width:23px; background-position:center -300px;} +.txEditor .toolbar li.right button{ width:23px; background-position:center -330px;} +.txEditor .toolbar li.justify button{ width:23px; background-position:center -360px;} +.txEditor .toolbar li.character button{ width:23px; background-position:center -390px;} +.txEditor .toolbar li.list button{ width:23px; background-image:url(../img/buttonListToolbar.gif); background-repeat:no-repeat;} +.txEditor .toolbar li.disc button{ background-position:center 0;} +.txEditor .toolbar li.circle button{ background-position:center -30px;} +.txEditor .toolbar li.square button{ background-position:center -60px;} +.txEditor .toolbar li.decimal button{ background-position:center -90px;} +.txEditor .toolbar li.alphaLower button{ background-position:center -120px;} +.txEditor .toolbar li.alphaUpper button{ background-position:center -150px;} +.txEditor .toolbar li.romanLower button{ background-position:center -180px;} +.txEditor .toolbar li.romanUpper button{ background-position:center -210px;} +.txEditor .toolbar li .uri{ display:none; position:absolute; left:10px; top:25px; padding:15px 20px; border:1px solid #ddd; background:#fff; *zoom:1; *white-space:nowrap;} +.txEditor .toolbar li .uri h3{ font-size:12px; margin:0 0 .5em 0;} +.txEditor .toolbar li .uri .link{ border:1px solid #ccc; padding:3px 4px; height:14px; font-size:12px; width:200px; font-size:11px; color:#666;} +.txEditor .toolbar li .uri p{ margin:.5em 0;} +.txEditor .toolbar li .uri p input{ width:13px; height:13px; margin:0 3px 0 0; vertical-align:middle;} +.txEditor .toolbar li .uri .btn_area{ text-align:center;} +.txEditor .toolbar li .uri .btn_area .buttonGray, +.txEditor .toolbar li .uri .btn_area .buttonGray button{ background-image:url(../img/buttonGray.gif);} +.txEditor .toolbar li .uri .btn_area .buttonGray{ background-position:left top;} +.txEditor .toolbar li .uri .btn_area .buttonGray button{ background-position:right top; line-height:18px; border:0 !important; width:auto; padding:0 6px 0 4px;} +.txEditor .toolbar li .palette{ display:none; width:211px; position:absolute; left:0; top:25px; padding:8px 0 7px 8px; margin:0; list-style:none; border:1px solid #ddd; background:#fff; *zoom:1;} +.txEditor .toolbar li .palette:after{ content:""; display:block; clear:both;} +.txEditor .toolbar li .palette.open{ display:block;} +.txEditor .toolbar li .palette li{ float:left; margin:0 1px 1px 0; font-size:0; line-height:0;} +.txEditor .toolbar li .palette button{ position:relative; overflow:hidden; width:11px; height:11px;} +.txEditor .toolbar li .palette button span{ position:absolute; width:0; height:0; overflow:hidden; font-size:0; line-height:0; z-index:-1; visibility:hidden;} +.txEditor .inputRichText{ position:relative; margin-right:-10px; position:relative; *zoom:1; z-index:1; padding:3px 0 3px 3px; background-image:url(../img/bgInputText.gif); background-repeat:no-repeat; background-position:0 0;} +.txEditor .inputRichText iframe{ width:100%; height:136px; border:0; overflow-x:hidden;} +.txEditor .resizeVertical{ position:relative; margin-right:-10px; border-top:1px solid #ddd; height:10px; background:url(../img/buttonResizeVertical.gif) no-repeat center center; *zoom:1; font-size:0; line-height:0;} +.txEditor .resizeVertical button{ width:100%; height:10px; border:0; margin:0; padding:0; background:transparent; cursor:n-resize; vertical-align:middle;} +.txEditor .resizeVertical button span{ position:absolute; width:0; height:0; font-size:0; line-height:0; overflow:hidden; visibility:hidden; z-index:-1;} + +.txEditor .toolbar li.character .layer{ width:433px; height:242px; overflow:hidden; padding:0;} +.txEditor .toolbar li.character .layer .close{ position:absolute; background:url(../img/buttonLayerClose.gif) no-repeat center; width:20px; height:21px; top:4px; right:3px; border:0 !important;} +.txEditor .toolbar li.character .layer ul{ margin:0; padding:0; list-style:none;} +.txEditor .toolbar li.character .layer h3{position:absolute; width:0; height:0; overflow:hidden; visibility:hidden;} +.txEditor .toolbar li.character .layer .nav{ position:absolute; top:8px; left:-1px; overflow:hidden; white-space:nowrap; line-height:normal;} +.txEditor .toolbar li.character .layer .nav li{ display:inline; margin:0 -4px 0 0; padding:0 8px; background:url(../img/vr_layer_character.gif) no-repeat 0 center;} +.txEditor .toolbar li.character .layer .nav li a{ color:#444; text-decoration:none; letter-spacing:-1px;} +.txEditor .toolbar li.character .layer .nav li a:hover, +.txEditor .toolbar li.character .layer .nav li a:active, +.txEditor .toolbar li.character .layer .nav li a:focus{ text-decoration:underline;} +.txEditor .toolbar li.character .layer .nav li a.on{ font-weight:bold; color:#004790; display:inline;} +.txEditor .toolbar li.character .layer .list{ position:absolute; left:7px; top:30px; width:421px; height:172px; background:url(../img/bx_character.gif) no-repeat;} +.txEditor .toolbar li.character .layer .list li{ position:relative; top:1px; left:1px; float:left; width:20px; height:18px; margin:0 1px 1px 0;} +.txEditor .toolbar li.character .layer .list li button{ width:20px; height:18px; background:none; padding:0; vertical-align:top;} +.txEditor .toolbar li.character .layer .list li button:hover, +.txEditor .toolbar li.character .layer .list li button:active, +.txEditor .toolbar li.character .layer .list li button:focus{ border:2px solid #27c11a;} +.txEditor .toolbar li.character .layer .list li button span{ overflow:visible; font-size:12px; width:auto; height:auto; position:relative; visibility:visible; line-height:normal; z-index:1;} +.txEditor .toolbar li.character .layer p{ position:absolute; top:212px; left:7px; margin:0 !important;} +.txEditor .toolbar li.character .layer p *{ vertical-align:top;} +.txEditor .toolbar li.character .layer p label{ position:relative; top:4px; margin:0 7px 0 0; color:#333; letter-spacing:-1px; line-height:normal;} +.txEditor .toolbar li.character .layer p input{ padding:3px 0 0 4px; margin:0 4px 0 0; width:300px; height:16px; border:1px solid #acacac; border-right:1px solid #dadada; border-bottom:1px solid #dadada; font-size:12px;} +.txEditor .toolbar li.character .layer p button{ position:relative; *top:1px; width:38px; height:21px; background:url(../img/buttonLayerConfirm.gif) no-repeat; border:0 !important;} + +.txEditor .toolbar .font9px { font-size:9px } +.txEditor .toolbar .font10px { font-size:10px } +.txEditor .toolbar .font11px { font-size:11px } +.txEditor .toolbar .font12px { font-size:12px } +.txEditor .toolbar .font14px { font-size:14px } +.txEditor .toolbar .font16px { font-size:16px } +.txEditor .toolbar .font18px { font-size:18px } +.txEditor .toolbar .font20px { font-size:20px } +.txEditor .toolbar .font24px { font-size:24px } +.txEditor .toolbar .font28px { font-size:28px } +.txEditor .toolbar .font32px { font-size:32px } +.txEditor .toolbar .font36px { font-size:36px } + +/* Drag and Drop */ +.xe_dr_placeholder { background-color:#F8F4CE; margin:5px 0; height:20px; padding:10px 0; z-index:0; -moz-border-radius:5px; -webkit-border-radius:5px; z-index:1; } +.drag_handle { position:absolute; height:100%; width:10px; top:0; opacity:.5; filter:alpha(opacity=50); background:#ddd url(../img/iconDragHandler.gif) no-repeat center; cursor:n-resize; margin:0 2px !important; padding:0 !important; border:0 !important; _zoom:1;} +.drag_handle.left { left:0; } +.drag_handle.right { right:0; } +.eArea .drag_handle {display:none} +.eFocus .drag_handle {display:block} .editorContainer .ui-draggable{ margin:0 0 3em 0 !important;} \ No newline at end of file diff --git a/modules/editor/skins/dreditor/css/editor.css b/modules/editor/skins/dreditor/css/editor.css index c02b4ad4b..a44bc1bfe 100644 --- a/modules/editor/skins/dreditor/css/editor.css +++ b/modules/editor/skins/dreditor/css/editor.css @@ -1,6 +1,6 @@ -@charset "utf-8"; -/* NHN (developers@xpressengine.com) */ - -html, body { height:100%; background-color:transparent; padding:0; margin:0;} -body{ margin:1em;} -.xe_content{ color:#000; font-size:12px; line-height:1.5;} +@charset "utf-8"; +/* NHN (developers@xpressengine.com) */ + +html, body { height:100%; background-color:transparent; padding:0; margin:0;} +body{ margin:1em;} +.xe_content{ color:#000; font-size:12px; line-height:1.5;} diff --git a/modules/editor/skins/dreditor/css/style@content.css b/modules/editor/skins/dreditor/css/style@content.css index 16a486ed2..01c649ce1 100644 --- a/modules/editor/skins/dreditor/css/style@content.css +++ b/modules/editor/skins/dreditor/css/style@content.css @@ -1,52 +1,52 @@ -@charset "utf-8"; -/* NHN (developers@xpressengine.com) */ - -/* textyleContent */ -.textyleContent{ font-size:12px; line-height:1.6; clear:both;} -.textyleContent h1{ font-size:24px;} -.textyleContent h2{ font-size:20px;} -.textyleContent h3{ font-size:18px;} -.textyleContent h4{ font-size:16px;} -.textyleContent h5{ font-size:14px;} -.textyleContent h6{ font-size:12px;} - -/* Attached File */ -.textyleContent dl.attachedFile { margin:1em 0; padding:1em 0; background:#f9f9f9; border:1px solid #eee; } -.textyleContent dl.attachedFile dt { padding:0 2em .5em 2em; margin:0 0 1em 0; font-weight:bold; text-indent:1em; border-bottom:1px solid #eee; background:#f9f9f9 url(../img/iconClip.gif) no-repeat 2em .3em; font-size:12px;} -.textyleContent dl.attachedFile em{ font-size:11px; font-weight:normal; font-style:normal; margin:0 5px;} -.textyleContent dl.attachedFile dd{ margin:0; padding:0 2em; color:#8b8b8b; font-size:11px;} -.textyleContent dl.attachedFile dd a{ text-decoration:none; color:#0092cf; margin-right:10px;} -.textyleContent dl.attachedFile dd a:hover, -.textyleContent dl.attachedFile dd a:active, -.textyleContent dl.attachedFile dd a:focus{ text-decoration:underline;} - -/* Table Of Content */ -.textyleContent .toc{ background:#fff; border:1px solid #ddd; font-size:14px; line-height:1.6; margin:1em 0; padding:15px;} -.textyleContent .toc li{ font-weight:bold; color:#555; margin-left:35px;} -.textyleContent .toc li.toc3{} -.textyleContent .toc li.toc4{ margin-left:55px;} -.textyleContent .toc li.toc5{ margin-left:75px;} -.textyleContent .toc li a{ color:#648ab9; text-decoration:none; font-weight:normal;} -.textyleContent .toc li a:hover, -.textyleContent .toc li a:active, -.textyleContent .toc li a:focus{ text-decoration:underline;} - -/* Object */ -.textyleContent object, -.textyleContent embed{ margin:1em 0;} - -/* Horizontal Rule */ -.textyleContent hr{ display:block; position:static; border-bottom:0; height:1px; overflow:hidden; color:#e2e2e2; clear:both;} - -/* Blockquote */ -.textyleContent blockquote{ margin-left:0; margin-right:0; padding:1em 40px; background:#f6f6f6 url(../img/bgBlockquote.gif) no-repeat 20px 1.5em; -moz-border-radius:5px; -webkit-border-radius:5px; } - -/* Cite */ -.textyleContent cite{ display:block; margin:1em 0;} - -/* Link */ -.textyleContent .xe_dr_link p strong{ display:block;} - -/* P */ -.xe_content p, -.textyleContent p{ margin:1em 0 !important;} +@charset "utf-8"; +/* NHN (developers@xpressengine.com) */ + +/* textyleContent */ +.textyleContent{ font-size:12px; line-height:1.6; clear:both;} +.textyleContent h1{ font-size:24px;} +.textyleContent h2{ font-size:20px;} +.textyleContent h3{ font-size:18px;} +.textyleContent h4{ font-size:16px;} +.textyleContent h5{ font-size:14px;} +.textyleContent h6{ font-size:12px;} + +/* Attached File */ +.textyleContent dl.attachedFile { margin:1em 0; padding:1em 0; background:#f9f9f9; border:1px solid #eee; } +.textyleContent dl.attachedFile dt { padding:0 2em .5em 2em; margin:0 0 1em 0; font-weight:bold; text-indent:1em; border-bottom:1px solid #eee; background:#f9f9f9 url(../img/iconClip.gif) no-repeat 2em .3em; font-size:12px;} +.textyleContent dl.attachedFile em{ font-size:11px; font-weight:normal; font-style:normal; margin:0 5px;} +.textyleContent dl.attachedFile dd{ margin:0; padding:0 2em; color:#8b8b8b; font-size:11px;} +.textyleContent dl.attachedFile dd a{ text-decoration:none; color:#0092cf; margin-right:10px;} +.textyleContent dl.attachedFile dd a:hover, +.textyleContent dl.attachedFile dd a:active, +.textyleContent dl.attachedFile dd a:focus{ text-decoration:underline;} + +/* Table Of Content */ +.textyleContent .toc{ background:#fff; border:1px solid #ddd; font-size:14px; line-height:1.6; margin:1em 0; padding:15px;} +.textyleContent .toc li{ font-weight:bold; color:#555; margin-left:35px;} +.textyleContent .toc li.toc3{} +.textyleContent .toc li.toc4{ margin-left:55px;} +.textyleContent .toc li.toc5{ margin-left:75px;} +.textyleContent .toc li a{ color:#648ab9; text-decoration:none; font-weight:normal;} +.textyleContent .toc li a:hover, +.textyleContent .toc li a:active, +.textyleContent .toc li a:focus{ text-decoration:underline;} + +/* Object */ +.textyleContent object, +.textyleContent embed{ margin:1em 0;} + +/* Horizontal Rule */ +.textyleContent hr{ display:block; position:static; border-bottom:0; height:1px; overflow:hidden; color:#e2e2e2; clear:both;} + +/* Blockquote */ +.textyleContent blockquote{ margin-left:0; margin-right:0; padding:1em 40px; background:#f6f6f6 url(../img/bgBlockquote.gif) no-repeat 20px 1.5em; -moz-border-radius:5px; -webkit-border-radius:5px; } + +/* Cite */ +.textyleContent cite{ display:block; margin:1em 0;} + +/* Link */ +.textyleContent .xe_dr_link p strong{ display:block;} + +/* P */ +.xe_content p, +.textyleContent p{ margin:1em 0 !important;} diff --git a/modules/editor/skins/dreditor/drcomponents/fold/info.xml b/modules/editor/skins/dreditor/drcomponents/fold/info.xml index 452ce7f3a..2b6fc3938 100644 --- a/modules/editor/skins/dreditor/drcomponents/fold/info.xml +++ b/modules/editor/skins/dreditor/drcomponents/fold/info.xml @@ -1,23 +1,23 @@ - - - 접기 - Fold - Co giãn - 摺疊 - Katla - 접고 펼치는 블럭을 추가할 수 있습니다. - create a new foldable paragraph - Chức năng này sẽ giúp bạn tạo một đoạn văn bản tự động co giãn khi đưa chuột tới. - 新增一個可展開與摺疊的段落。 - Yeni bir katlanabilir paragraf oluştur - 2010-01-22 - 0.2 - - - NHN - NHN - NHN - NHN - NHN - - + + + 접기 + Fold + Co giãn + 摺疊 + Katla + 접고 펼치는 블럭을 추가할 수 있습니다. + create a new foldable paragraph + Chức năng này sẽ giúp bạn tạo một đoạn văn bản tự động co giãn khi đưa chuột tới. + 新增一個可展開與摺疊的段落。 + Yeni bir katlanabilir paragraf oluştur + 2010-01-22 + 0.2 + + + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/editor/skins/dreditor/drcomponents/fold/lang/tr.lang.php b/modules/editor/skins/dreditor/drcomponents/fold/lang/tr.lang.php index 503bce9e9..2255325dc 100644 --- a/modules/editor/skins/dreditor/drcomponents/fold/lang/tr.lang.php +++ b/modules/editor/skins/dreditor/drcomponents/fold/lang/tr.lang.php @@ -1,5 +1,5 @@ -edit->fold = 'Katla'; - $lang->edit->fold_default = 'Aç..|Kapat..'; - $lang->edit->fold_description = '\'Aç|Kapat\'Yukarıdaki örnekteki gibi gir'; +edit->fold = 'Katla'; + $lang->edit->fold_default = 'Aç..|Kapat..'; + $lang->edit->fold_description = '\'Aç|Kapat\'Yukarıdaki örnekteki gibi gir'; ?> \ No newline at end of file diff --git a/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.css b/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.css index 920642409..d55883339 100644 --- a/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.css +++ b/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.css @@ -1,12 +1,12 @@ -.wToolbar li.fold button{ background:url(fold.gif) no-repeat center 12px; } - -.editorArea ._fold{ padding:0;} -.editorArea ._fold ._fold_cap{ border:3px solid #f90; padding:5px 20px; margin:2px;} -.editorArea ._fold_first ._fold_cap{ border-bottom:0;} -.editorArea ._fold_last ._fold_cap{ border-top:0;} -.editorArea ._fold span { cursor:pointer; font-weight:bold; } -.editorArea ._fold_last span { display:none; } -.editorArea ._fold span.more { display:none; } -.editorArea ._fold_more span.less { display:none; } -.editorArea ._fold_more span.more { display:inline; } +.wToolbar li.fold button{ background:url(fold.gif) no-repeat center 12px; } + +.editorArea ._fold{ padding:0;} +.editorArea ._fold ._fold_cap{ border:3px solid #f90; padding:5px 20px; margin:2px;} +.editorArea ._fold_first ._fold_cap{ border-bottom:0;} +.editorArea ._fold_last ._fold_cap{ border-top:0;} +.editorArea ._fold span { cursor:pointer; font-weight:bold; } +.editorArea ._fold_last span { display:none; } +.editorArea ._fold span.more { display:none; } +.editorArea ._fold_more span.less { display:none; } +.editorArea ._fold_more span.more { display:inline; } .editorArea ._fold_hide { display:none; } \ No newline at end of file diff --git a/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.html b/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.html index c729c12d4..a6739ecf8 100644 --- a/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.html +++ b/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.html @@ -1,17 +1,17 @@ - - -
            -
            - {$lang->edit->fold} - -
            - - -

            {$lang->edit->fold_description}

            -
            - - - - -
            + + +
            +
            + {$lang->edit->fold} + +
            + + +

            {$lang->edit->fold_description}

            +
            + + + + +
            \ No newline at end of file diff --git a/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.js b/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.js index 6877d155b..cd1182e21 100644 --- a/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.js +++ b/modules/editor/skins/dreditor/drcomponents/fold/tpl/fold.js @@ -1,205 +1,205 @@ -/** - * Fold component - * @author NHN (developers@xpressengine.com) - */ -jQuery(function($){ - -var editor = xe.getApp('DrEditor')[0]; -var Fold = xe.createPlugin('Fold', { - configs : {}, - init : function() { - this.configs = {}; - }, - create : function(seq) { - var config = editor.getConfig(seq); - var _editor = config.writeArea.find('>div.fold'); - var _text = _editor.find('input[type=text]'); - var next = _text.next(); - - _text.remove(); - this.cast('ADD_DEFAULT_EDITOR_ACTION', [seq, _editor, 'FOLD']); - next.before(_text); - - _text - .blur(function(){ if(!$.trim(this.value)) this.value = this.title }) - .val(_text.attr('title')); - - this.configs[seq] = { - editor : _editor, - text : _text, - marker : [], - before : null - }; - - return this.configs[seq]; - }, - assign_class : function(seq) { - if (this.configs[seq].marker.length) { - this.configs[seq].marker.eq(0).removeClass('_fold_last').addClass('_fold_first'); - this.configs[seq].marker.eq(1).removeClass('_fold_first').addClass('_fold_last'); - } - }, - toggle : function(seq, button) { - var parent = button.parent().parent(); - var target = parent.nextAll('div.eArea'); - var n_fold = target.index(target.filter('div._fold')); - - if (button.is('.more')) { - target.slice(0, n_fold).removeClass('_fold_hide'); - parent.removeClass('_fold_more'); - } else { - target.slice(0, n_fold).addClass('_fold_hide'); - parent.addClass('_fold_more'); - } - }, - API_BEFORE_SETTING_CONTENT : function(sender, params) { - var self = this; - var seq = params[0]; - var obj = params[1]; - var button = obj.children('div.fold_button:first'); - var container = obj.children('div.fold_container'); - - if (button.length && container.length) { - var more = button.find('button.more').text(); // copy only text - var less = button.find('button.less').text(); - var fold = $('
            »
            ').attr('type', 'fold'); - - fold.find('span.more').click(function(){ self.toggle(seq,$(this)) }).text(more); - fold.find('span.less').click(function(){ self.toggle(seq,$(this)) }).text(less); - - container.before(fold).before(container.children()).before(fold.clone(true)).remove(); - - if (!this.configs[seq]) this.create(seq); - this.configs[seq].marker = obj.children('div._fold'); - this.assign_class(seq); - } else { - container.before(container.children()).remove(); - } - button.remove(); - }, - API_AFTER_GETTING_CONTENT : function(sender, params) { - var seq = params[0]; - var obj = params[1]; - var chd = obj.children(); - var fold = chd.filter('div._fold'); - - if (!fold.length) return true; - - var n_start = chd.index(fold.eq(0)); - var n_end = chd.index(fold.eq(1)); - - if (n_start+1 >= n_end) return true; - - var div = $('


     

    '; - var sRow = ''; - var iColumns = this.oColumnInput.value; - for(var i=0; i/ig, - regex_meanless_css2 = /(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig, - regex_class = /<(.*?)\s+class\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))(.*?)>/ig, - regex_class2 = /xe_selected_cell/g; - regex_handler = /<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig, - //regex_id = /<(.*?)\s+id\s*=(?:[^\s>]+|\s*".*?"|\s*'.*?')(.*?)>/ig, - //regex_script = //ig, - regex_font_color = /color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_face = /face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_size = /size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i, - regex_style = /style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, - regex_font_weight = /font-weight\s*:\s*([a-z]+);?/i, - regex_font_style = /font-style\s*:\s*italic;?/i, - regex_font_decoration = /text-decoration\s*:\s*([a-z -]+);?/i, - regex_jquery = /jQuery\d+\s*=(\s*"\d+"|\d+)/ig, - regex_quote_attr = /([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g; //" - -var - allow_tags = 'a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var,iframe,object,param,style'.split(','), - lonely_tags = 'area,br,col,embed,hr,img,input,param'.split(','); - -var - replace_tags = { - 'b' : 'strong', - 'i' : 'em', - 's' : 'del', - 'strike' : 'del' - }; - -xe.XE_XHTMLFormatter = $.Class({ - name : "XE_XHTMLFormatter", - - $ON_MSG_APP_READY : function() { - this.oApp.addConverter("WYSIWYG_TO_IR", this.TO_IR); - this.oApp.addConverter("HTMLSrc_TO_IR", this.TO_IR); - this.oApp.addConverter("IR_TO_HTMLSrc", this.IR_TO); - this.oApp.addConverter("IR_TO_WYSIWYG", this.IR_TO); - }, - - TO_IR : function(sContent) { - var stack = []; - - // remove xeHandled attrs - /* - sContent = sContent.replace(/xeHandled="YES"/ig,''); - */ - - - // remove all useless styles - /* - sContent = sContent.replace(regex_meanless_css1, function(m0,m1,m2,m3){ - m2 = m2.replace(regex_meanless_css2, ''); - - return '<'+m1+(m2?' style="'+m2+'"':'')+m3+'>'; - }); - */ - - // remove all useless classes - /* - sContent = sContent.replace(regex_class, function(m0,m1,m2,m3,m4,m5){ - var cls = $.trim((m2 || m3 || m4 || "").replace(regex_class2, '')); - - return '<'+(m1||"")+(cls?' class="'+cls+'"':'')+(m5||"")+'>'; - }); - */ - - // remove all event handler - //sContent = sContent.replace(regex_handler, '<$1$2>'); - - // remove all id - //sContent = sContent.replace(regex_id, '<$1$2>'); - - // remove all scripts - //sContent = sContent.replace(regex_script, ''); - - if ($.browser.msie) { - // remove $ attributes - sContent = sContent.replace(regex_jquery, ''); - - // quote all attrs - sContent = sContent.replace(/<(\w+) ([^>]+)>/g, function(m0,m1,m2){ - return '<'+m1+' '+ - m2.replace(regex_quote_attr, function(s0,s1,s2,s3){ - if (s1) return s1; - if(/^"/.test(s3)||/"$/.test(s3)) return s2+'='+s3; - return s2+'="'+s3+'"'; - }) + '>'; - }); - } - - // remove all useless tag and enclose tags - regex = /<(\/)?([:\w\/-]+)(.*?)>/ig; - sContent = sContent.replace(regex, function(m0,closing,tag,attrs){ - var m3s = []; - var state = ''; - - closing = closing || ''; - tag = tag.toLowerCase(); - attrs = $.trim(attrs || ''); - - if (!closing) { - if ($.inArray(tag,lonely_tags) >= 0) { - var len = attrs.length; - if (tag == 'br') attrs = ''; - if (!attrs || attrs.substring(len-1,len) != '/') attrs += '/'; - - return '<'+tag+' '+$.trim(attrs)+'>'; - } else { - stack[stack.length] = {tag:tag, state:state}; - } - } else { - var tags = [], t = ''; - - // remove unnecessary closing tag - if (!stack.length) return ''; - - do { - t = stack.pop(); - if (t.tag != tag) continue; - if (t.state != 'deleted') tags.push(''); - } while(stack.length && t.tag != tag); - - return tags.join(''); - } - - return '<'+closing+tag+(attrs?' '+attrs:'')+'>'; - }); - /* - if (stack.length) { - var t = ''; - - do { - t = stack.pop(); - if (t.state != 'deleted') sContent += ''; - } while(stack.length); - } - */ - - return sContent; - }, - - IR_TO : function(sContent) { - return sContent; - } -}); -// center, font, b, i, s, strike - -/** - * Support XE extensions - * @author NHN (developer@xpressengine.com) - */ -xe.XE_Extension = $.Class({ - name : "XE_Extension", - seq : '', - last_doc : '', - - $init : function(elAppContainer, editor_sequence) { - this.seq = editor_sequence; - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer) { - this.elDropdownLayer = $('DIV.xpress_xeditor_extension_layer', elAppContainer).get(0); - }, - - _removeAttrs : function(sContent) { - return sContent; - }, - - _addEvent : function() { - if (this.oApp.getEditingMode() != 'WYSIWYG') return; - - var doc = this.oApp.getWYSIWYGDocument(); - var seq = this.seq; - var fn = function(){ - var obj = $(this); - var comp = obj.attr('editor_component'); - if (comp && $.isFunction(openComponent)) { - editorPrevNode = obj.get(0); - openComponent(comp, seq); - } - }; - - $('img,div[editor_component]', doc).each(function(){ - var obj = $(this); - if(this.nodeName == 'IMG' && !obj.attr('editor_component')) { - obj.attr('editor_component','image_link'); - } - if(this.last_doc != doc) { - obj.dblclick(fn); - this.last_doc = doc; - } - }); - }, - - $ON_MSG_APP_READY : function() { - var oApp = this.oApp; - oApp.exec('REGISTER_UI_EVENT', ['extension', 'click', 'TOGGLE_EXTENSION_LAYER']); - var functn = function(){ - oApp.exec("HIDE_ACTIVE_LAYER", []); - }; - $('a', this.elDropdownLayer).each(function(){ - var obj = $(this); - if(!obj.attr('component_onclick_event_added')) { - obj.click(functn); - obj.attr('component_onclick_event_added','Y'); - } - }); - }, - - $ON_TOGGLE_EXTENSION_LAYER : function() { - this.oApp.exec('TOGGLE_TOOLBAR_ACTIVE_LAYER', [this.elDropdownLayer]); - }, - - $ON_CHANGE_EDITING_MODE : function(mode) { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_PASTE_HTML : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_LOAD_IR_FIELD : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - }, - - $ON_SET_IR : function() { - var self = this; - setTimeout(function(){ self._addEvent(); }, 100); - } -}); -/** - * Auto saving - * @author NHN (developer@xpressengine.com) - */ -xe.XE_AutoSave = $.Class({ - name : "XE_AutoSave", - form : null, - textarea : null, - - $init : function(oIRTextarea, elAppContainer) { - this.form = oIRTextarea.form; - this.textarea = oIRTextarea; - - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer) { - this.welMessageBox = $('autosave_message'); - }, - - $ON_MSG_APP_READY : function() { - var elTitle = $(this.form._saved_doc_title); - var elContent = $(this.form._saved_doc_content); - - var title = $.trim(elTitle.val()); - var content = $.trim(elContent.val()); - - if (title || content) { - if (confirm(this.form._saved_doc_message.value)) { - $(this.form.title).val(title); - this.oApp.setIR(content); - if(typeof(editorGetAutoSavedDoc) == 'function') editorGetAutoSavedDoc(this.form); - } else { - editorRemoveSavedDoc(); - } - } - - editorEnableAutoSave(this.form, $(this.form).attr("editor_sequence")); - - // register hotkey - this.oApp.exec('REGISTER_HOTKEY', ['ctrl+shift+s','AUTO_SAVE']); - }, - - $ON_AUTO_SAVE : function() { - _editorAutoSave(); - } -}); -/** - * Format Block plugin - * @author NHN (developer@xpressengine.com) - */ -xe.XE_FormatWithSelectUI = $.Class({ - name : "XE_FormatWithSelectUI", - - $init : function(elAppContainer){ - this._assignHTMLObjects(elAppContainer); - }, - - _assignHTMLObjects : function(elAppContainer){ - this.elFormatSelect = $("SELECT.xpress_xeditor_ui_format_select", elAppContainer).get(0); - }, - - $ON_MSG_APP_READY : function(){ - this.oApp.registerBrowserEvent(this.elFormatSelect, "change", "SET_FORMAT_FROM_SELECT_UI"); - this.elFormatSelect.selectedIndex = 0; - }, - - $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ - var blockName = this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock"); - - if (!blockName) return (this.elFormatSelect.selectedIndex = 0); - if ($.browser.msie && /([0-9])/.test(blockName)) blockName = 'h'+(RegExp.$1); - - this.elFormatSelect.value = blockName.toLowerCase(); - if(this.elFormatSelect.selectedIndex < 0) this.elFormatSelect.selectedIndex = 0; - if(this.elFormatSelect.value != blockName.toLowerCase()) this.elFormatSelect.selectedIndex = 0; - }, - - $ON_SET_FORMAT_FROM_SELECT_UI : function(){ - var sFormat = this.elFormatSelect.value; - if(!sFormat) return; - if($.browser.msie) sFormat = '<'+sFormat+'>'; - - this.oApp.exec("EXECCOMMAND", ["FormatBlock", false, sFormat]); - this.oApp.exec("CHECK_STYLE_CHANGE", []); - } -}); -/** - * Enhanced Table Fetures - * @author NHN (developer@xpressengine.com) - */ - -// 표 편집 확장 기능 -xe.XE_Table = $.Class({ - _startSel : null, - _endSel : null, - - $ON_MSG_APP_READY : function() { - this._doc = $(this.oApp.getWYSIWYGDocument()); - - this.$FnMouseDown = $.fnBind(this._mousedown, this); - this.$FnMouseUp = $.fnBind(this._mouseup, this); - this.$FnMouseMove = $.fnBind(this._mousemove, this); - - this._doc.mousedown(this.$FnMouseDown); - - // initialize - this._startSel = null; - this._endSel = null; - - // register buttons - this.oApp.exec('REGISTER_UI_EVENT', ['merge_cells', 'click', 'MERGE_CELLS']); - this.oApp.exec('REGISTER_UI_EVENT', ['split_col', 'click', 'CELL_SPLIT_BY_COL']); - this.oApp.exec('REGISTER_UI_EVENT', ['split_row', 'click', 'CELL_SPLIT_BY_ROW']); - - // register hotkeys - this.oApp.exec('REGISTER_HOTKEY', ['ctrl+alt+m', 'MERGE_CELLS']); - - // perform default ready action - this.$super.$ON_MSG_APP_READY(); - }, - - $ON_MERGE_CELLS : function() { - var html = ""; - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var self = this; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Merge"]); - - // 선택한 모든 셀의 데이터를 첫번째 셀로 복사 - cell.each(function(){ html += $(this).html() }).eq(0).html(html); - - // 첫번째 셀 가로 확장 - var colspan = 0; - cell.eq(0).nextAll('td,th').andSelf().filter('.xe_selected_cell').each(function(idx){ - colspan += self._getSpan(this, 'col'); - }); - - // 마지막 셀까지 줄의 갯수 계산 - var rect = this._getRect(cell.eq(0)); - var start_tr = cell.eq(0).parent('tr'); - var end_tr = cell.eq(cell.length-1).parent('tr'); - var all_rows = cell.parents('table').eq(0).find('tr'); - var rowspan = all_rows.index(end_tr.get(0)) - all_rows.index(start_tr.get(0)) + this._getSpan(cell.eq(cell.length-1), 'row'); - - // 첫번째 셀 colspan, rowspan 속성 지정 - cell.eq(0).attr('colSpan', colspan).attr('rowSpan', rowspan); - - // 첫번째 셀을 제외한 다른 모든 셀 제거 - cell.slice(1).remove(); - }, - - $ON_CELL_SPLIT_BY_ROW : function(many) { - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var table = cell.parents('table').eq(0); - var self = this; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Row"]); - - // 선택 영역의 상하 좌표 구함 - var _top = this._getRect(cell.eq(0)).top; - var _bottom = this._getRect(cell.eq(cell.length-1)).bottom; - - // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(상하 기준). - (cell = table.find('td,th').filter(function(){ - var rect = self._getRect($(this)); - - return !(rect.bottom <= _top || rect.top >= _bottom); - })).filter('.xe_selected_cell').each(function(){ - var t = $(this); - var row = t.parent('tr'); - var rowspan = self._getSpan(t, 'row'); - var rect = self._getRect(t); - var queue = []; - var clone = t.clone().html('
    '); - var topspan = 1, botspan = 1; - - // rowspan > 1이면 현재 셀의 rowspan을 절반으로 분할한다. - if (rowspan > 1) { - - topspan = Math.ceil(rowspan/2); - botspan = rowspan - topspan; - - queue.push(function(){ - t.attr('rowSpan', topspan); - }); - - clone.attr('rowSpan', botspan); - } else { - // rowspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 rowspan을 추가 - cell.filter(function(){ - if (t.get(0) == this) return false; - - var tt = $(this); - var rc = self._getRect(tt); - - // 범위를 넘은 부분은 제외 - if (rc.bottom <= rect.top || rc.top >= rect.bottom) return false; - - return true; - }).each(function(){ - var tt = $(this); - var sp = self._getSpan(tt, 'row')+1; - - // rowspan 1 추가 - queue.push(function(){ - tt.attr('rowSpan', sp); - }); - }); - - // 새 줄을 추가한다. - if ($.browser.msie) { - // Fix bug for IE - row.after(row.clone().empty().get(0).outerHTML); - } else { - row.after(row.clone().empty()); - } - } - - var rows = row.nextAll('tr'); - - // 현재 셀이 마지막 줄에 있다면 한 줄 추가 후 새로운 셀 추가 - if (!rows.length) { - row.after(row.clone().empty().append(clone)); - } else { - var next_sib = rows.eq(topspan - 1).children('td,th').filter(function(){ - return ( self._getRect($(this)).left > rect.left ); - }); - - if ($.browser.msie) { - next_sib.length? - next_sib.eq(0).before(clone.get(0).outerHTML): - rows.eq(topspan-1).append(clone.get(0).outerHTML); - } else { - next_sib.length? - next_sib.slice(0,1).before(clone): - rows.slice(topspan-1,1).append(clone); - } - } - - // 함수를 바로 실행하면 좌표가 틀어지므로, 큐에 넣은 후 실행 - $.each(queue, function(){ this(); }); - - }); - }, - - $ON_CELL_SPLIT_BY_COL : function(many) { - var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); - var table = cell.parents('table').slice(0,1); - var self = this; - var ie_bug = [], tmpId = (new Date).getTime(), tmpStr = ''; - - // 선택된 셀이 없으면 종료 - if (!cell.length) return; - - // UNDO 지점 기록 - this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Column"]); - - // 선택 영역의 좌우 좌표 구함 - var first_row = cell.eq(0).parent('tr'); - var _left = this._getRect(first_row.find('.xe_selected_cell:first')).left; - var _right = this._getRect(first_row.find('.xe_selected_cell:last')).right; - - // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(좌우 기준). - (cell = table.find('td,th').filter(function(){ - var rect = self._getRect($(this)); - - return !(rect.right <= _left || rect.left >= _right); - })).filter('.xe_selected_cell').each(function(idx){ - var t = $(this); - var colspan = self._getSpan(t, 'col'); - var clone = t.clone().html('
    '); - - // colspan > 1 이면 colspan을 절반으로 분할한다. - if (colspan > 1) { - var leftspan = Math.ceil(colspan/2); - var rightspan = colspan - leftspan; - - t.attr('colSpan', leftspan); - clone.attr('colSpan', rightspan); - } else { - // colspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 colspan을 추가 - var rect = self._getRect(t); - - cell.filter(function(){ - if (t.get(0) == this) return false; - - var tt = $(this); - var rc = self._getRect(tt); - - // 범위를 넘은 부분은 제외 - if (rc.right <= rect.left || rc.left >= rect.right) return false; - - return true; - }).each(function(){ - var tt = $(this); - - // colspan 1 추가 - tt.attr('colSpan', self._getSpan(tt, 'col')+1); - }); - - clone.attr('colSpan', 1); - } - - if ($.browser.msie) { - // Fix for IE bug - t.after(clone.get(0).outerHTML); - } else { - t.after(clone); - } - }); - }, - - $ON_CHECK_STYLE_CHANGE : function(){ - var ui = ['merge_cells', 'split_col', 'split_row']; - var app = this.oApp; - var command = (this._startSel && this._startSel.is('.xe_selected_cell'))?'ENABLE_UI':'DISABLE_UI'; - - $.each(ui, function(){ app.exec(command, [this]); }); - }, - - _mousedown : function(event) { - var cur = $(event.target); - var sel = cur.parents().andSelf().filter('td,th,table'); - var app = this.oApp; - var self = this; - - // 모든 선택영역 해제 - $('td.xe_selected_cell', this.oApp.getWYSIWYGDocument()).removeClass('xe_selected_cell'); - - this._startSel = null; - this._endSel = null; - - if (!sel.length || !this._isLeftClicked(event.button)) return; - - function delayed(){ - sel = app.getSelection().cloneRange(); - sel.collapseToStart(); - sel = $(sel.startContainer).parents().andSelf().filter('td,th').eq(0); - - if (!sel.length) return self._removeAllListener()||true; - - // 좌표를 구한다 - self._getRect(self._startSel = sel); - - // 이벤트 바인딩 - self._doc.bind('mousemove', self.$FnMouseMove); - self._doc.bind('mouseup', self.$FnMouseUp); - } - - // mousedown이 일어난 후에 선택 영역이 설정되므로 실행을 지연시킨다. - setTimeout(delayed, 0); - }, - - _mouseup : function(event) { - // 선택된 셀 확인 - this._removeAllListener(); - - // 시작셀과 종료셀 제거 - this._startSel = this._endSel = null; - }, - - _mousemove : function(event) { - var cur = $(event.target); - var cell = cur.parents().andSelf().filter('td,th').eq(0); - var self = this; - - // 마우스 왼쪽 버튼이 눌리지 않았으면 종료 - if (!cell.length || !this._isLeftClicked(event.button)) return; - if (!this._endSel && cell.get(0) == this._startSel.get(0)) return; - if (this._endSel && cell.get(0) == this._endSel.get(0)) return; - - // 종료셀 && 종료셀의 좌표 - this._getRect(this._endSel = cell); - - // 선택 범위를 구한다 - var _top = Math.min(this._startSel.rect.top, this._endSel.rect.top); - var _left = Math.min(this._startSel.rect.left, this._endSel.rect.left); - var _bottom = Math.max(this._startSel.rect.bottom, this._endSel.rect.bottom); - var _right = Math.max(this._startSel.rect.right, this._endSel.rect.right); - - var table = cell.parents('table'); - var cells = table.find('td,th').removeClass('xe_selected_cell'); - var i = 0; - - // 복잡한 모양의 테이블을 위한 반복 처리 - var selected = $(); - do { - // 선택한 셀로 최대 영역 재계산 - selected.each(function(){ - var rect = self._getRect($(this)); - - // 영역 재계산 - if (rect.right > _right) _right = rect.right; - if (rect.left < _left) _left = rect.left; - if (rect.top < _top) _top = rect.top; - if (rect.bottom > _bottom) _bottom = rect.bottom; - }); - - // 좌표 범위 안에 있는 선택할 셀을 추린다. - cells = cells.filter(':not(.xe_selected_cell)'); - selected = cells.filter(function(){ - var rect = self._getRect($(this)); - - if (rect.right <= _left || rect.left >= _right || rect.bottom <= _top || rect.top >= _bottom) return false; - - return true; - }).addClass('xe_selected_cell'); - } while(selected.length); - - // 브라우저의 기본 선택영역 해제 : FF 제외 - 기본 기능이 충분히 좋아서 + 이 부분을 실행하면 오류가 발생해서 - if (!$.browser.mozilla) { - function delayed() { - var sel = self.oApp.getSelection(); - - if (!self._startSel) return; - if (!self._startSel.get(0).firstChild) self._startSel.text(" "); - - sel.selectNode(self._startSel.get(0).firstChild); - sel.collapseToStart(); - sel.select(); - } - - setTimeout(delayed, 0); - } - - return false; - }, - - _removeAllListener : function() { - // 이벤트 해제 - this._doc.unbind("mousemove", this.$FnMouseMove); - this._doc.unbind("mouseup", this.$FnMouseUp); - }, - - _isLeftClicked : function(value) { - return $.browser.msie?!!(value & 1):(value == 0); - }, - - _getRect : function(obj) { - var el = obj.get(0); - - obj.rect = {}; - obj.rect.top = el.offsetTop; - obj.rect.left = el.offsetLeft; - obj.rect.bottom = obj.rect.top + el.offsetHeight; - obj.rect.right = obj.rect.left + el.offsetWidth; - - return obj.rect; - }, - - _getSpan : function(obj, type) { - var span = parseInt($(obj).attr(type+'span')); - - return isNaN(span)?1:span; - } -}).extend(xe.XE_Table); - -})(jQuery); +(function($){ + +// extends jQuery object +$.extend({ + Class : function(def) { + function c(){ + if (typeof this.$super != 'undefined') this.$super.$this = this; + if ($.isFunction(this.$init)) this.$init.apply(this, arguments); + } + c.prototype = def; + c.constructor = c; + c.extend = Class_extend; + + return c; + }, + $ : function(id) { + if(typeof id == 'string') { + if (id.substring(0,1) == '<') return $(id).get(0); + return $('#'+id).get(0); + } else { + return id; + } + }, + fnBind : function(fn, th/* , args... */) { + var args = $.makeArray(arguments); + args.shift(); args.shift(); + + return function() { + var a = args.concat($.makeArray(arguments)); + + return fn.apply(th, a); + }; + } +}); + +$.browser.nVersion = parseFloat($.browser.version); + +function Class_extend(superDef) { + var Super = superDef.prototype; + + this.prototype.$super = {}; + + function bind(fn) { + return function() { + return fn.apply(this.$this, arguments); + }; + } + + for(var x in Super) { + if (!Super.propertyIsEnumerable(x)) continue; + + if (typeof this.prototype[x] == 'undefined') this.prototype[x] = Super[x]; + this.prototype.$super[x] = $.isFunction(Super[x])?bind(Super[x]):Super[x]; + } + + return this; +} + +if (typeof window.xe == 'undefined') window.xe = {}; + +//{ + /** + * @fileOverview This file contains Xpress framework core + * @name XpressCore.js + */ +xe.XpressCore = $.Class({ + name : "XpressCore", + + $init : function(htOptions){ + htOptions = !htOptions?{}:$.Class({}).extend({ + oDebugger : null + }).extend(htOptions); + if(htOptions.oDebugger){ + this.oDebugger = htOptions.oDebugger; + this.oDebugger.oApp = this; + } + + // To prevent processing a Xpress command before all the plugins are registered and ready, + // Queue up all the commands here until the application's status is changed to READY + this.commandQueue = []; + + this.oCommandMap = {}; + this.oDisabledCommand = {}; + this.aPlugins = []; + + this.appStatus = xe.APP_STATUS["NOT_READY"]; + + // Register the core as a plugin so it can receive messages + this.registerPlugin(this); + }, + + exec : function(msg, args, oEvent){ + // If the application is not yet ready just queue the command + if(this.appStatus == xe.APP_STATUS["NOT_READY"]){ + this.commandQueue[this.commandQueue.length] = {'msg':msg, 'args':args, 'event':oEvent}; + return true; + } + + this.exec = this._exec; + this.exec(msg, args, oEvent); + }, + + delayedExec : function(msg, args, nDelay, oEvent){ + var fExec = $.fnBind(this.exec, this, msg, args, oEvent); + setTimeout(fExec, nDelay); + }, + + _exec : function(msg, args, oEvent){return (this._exec = this.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this, msg, args, oEvent);}, + _execWithDebugger : function(msg, args, oEvent){this.oDebugger.log_MessageStart(msg, args);var bResult = this._doExec(msg, args, oEvent);this.oDebugger.log_MessageEnd(msg, args);return bResult; }, + _execWithoutDebugger : function(msg, args, oEvent){return this._doExec(msg, args, oEvent);}, + _doExec : function(msg, args, oEvent){ + var bContinue = false; + + if(!this.oDisabledCommand[msg]){ + var allArgs = []; + if(args && args.length){ + var iLen = args.length; + for(var i=0; i= 0 && xe.DOMFix.parentNode(aAllNodes[iChildIdx]) == aAllNodes[iCurIdx]){ + iChildIdx = this._recurConstructClonedTree(aAllNodes, iChildIdx, aAllNodes[iCurIdx], oCurNodeCloneWithChildren, oClonedStartContainer, oClonedEndContainer); + } + + // this may trigger an error message in IE when an erroneous script is inserted + oClonedParentNode.insertBefore(oCurNodeCloneWithChildren, oClonedParentNode.firstChild); + + return iChildIdx; + }; + + aNodes[aNodes.length] = xe.DOMFix.parentNode(aNodes[aNodes.length-1]); + _recurConstructClonedTree(aNodes, aNodes.length-1, aNodes[aNodes.length-1], oClonedParentNode); + + return {oStartContainer: oClonedStartContainer, oEndContainer: oClonedEndContainer}; + }, + + cloneRange : function(){ + return this._copyRange(new xe.W3CDOMRange(this._document)); + }, + + _copyRange : function(oClonedRange){ + oClonedRange.collapsed = this.collapsed; + oClonedRange.commonAncestorContainer = this.commonAncestorContainer; + oClonedRange.endContainer = this.endContainer; + oClonedRange.endOffset = this.endOffset; + oClonedRange.startContainer = this.startContainer; + oClonedRange.startOffset = this.startOffset; + oClonedRange._document = this._document; + + return oClonedRange; + }, + + collapse : function(toStart){ + if(toStart){ + this.endContainer = this.startContainer; + this.endOffset = this.startOffset; + }else{ + this.startContainer = this.endContainer; + this.startOffset = this.endOffset; + } + + this._updateRangeInfo(); + }, + + compareBoundaryPoints : function(how, sourceRange){ + switch(how){ + case xe.W3CDOMRange.START_TO_START: + return this._compareEndPoint(this.startContainer, this.startOffset, sourceRange.startContainer, sourceRange.startOffset); + case xe.W3CDOMRange.START_TO_END: + return this._compareEndPoint(this.endContainer, this.endOffset, sourceRange.startContainer, sourceRange.startOffset); + case xe.W3CDOMRange.END_TO_END: + return this._compareEndPoint(this.endContainer, this.endOffset, sourceRange.endContainer, sourceRange.endOffset); + case xe.W3CDOMRange.END_TO_START: + return this._compareEndPoint(this.startContainer, this.startOffset, sourceRange.endContainer, sourceRange.endOffset); + } + }, + + _findBody : function(oNode){ + if(!oNode) return null; + while(oNode){ + if(oNode.tagName == "BODY") return oNode; + oNode = xe.DOMFix.parentNode(oNode); + } + return null; + }, + + _compareEndPoint : function(oContainerA, iOffsetA, oContainerB, iOffsetB){ + var iIdxA, iIdxB; + + if(!oContainerA || this._findBody(oContainerA) != this._document.body){ + oContainerA = this._document.body; + iOffsetA = 0; + } + + if(!oContainerB || this._findBody(oContainerB) != this._document.body){ + oContainerB = this._document.body; + iOffsetB = 0; + } + + var compareIdx = function(iIdxA, iIdxB){ + // iIdxX == -1 when the node is the commonAncestorNode + // if iIdxA == -1 + // -> [[...]]... + // if iIdxB == -1 + // -> ...[[...]] + if(iIdxB == -1) iIdxB = iIdxA+1; + if(iIdxA < iIdxB) return -1; + if(iIdxA == iIdxB) return 0; + return 1; + }; + + var oCommonAncestor = this._getCommonAncestorContainer(oContainerA, oContainerB); + + // ================================================================================================================================================ + // Move up both containers so that both containers are direct child nodes of the common ancestor node. From there, just compare the offset + // Add 0.5 for each contaienrs that has "moved up" since the actual node is wrapped by 1 or more parent nodes and therefore its position is somewhere between idx & idx+1 + // NODE1

    NODE2

    NODE3
    + // The position of NODE2 in COMMON_ANCESTOR is somewhere between after NODE1(idx1) and before NODE3(idx2), so we let that be 1.5 + + // container node A in common ancestor container + var oNodeA = oContainerA; + if(oNodeA != oCommonAncestor){ + while((oTmpNode = xe.DOMFix.parentNode(oNodeA)) != oCommonAncestor){oNodeA = oTmpNode;} + + iIdxA = this._getPosIdx(oNodeA)+0.5; + }else iIdxA = iOffsetA; + + // container node B in common ancestor container + var oNodeB = oContainerB; + if(oNodeB != oCommonAncestor){ + while((oTmpNode = xe.DOMFix.parentNode(oNodeB)) != oCommonAncestor){oNodeB = oTmpNode;} + + iIdxB = this._getPosIdx(oNodeB)+0.5; + }else iIdxB = iOffsetB; + + return compareIdx(iIdxA, iIdxB); + }, + + _getCommonAncestorContainer : function(oNode1, oNode2){ + var oComparingNode = oNode2; + + while(oNode1){ + while(oComparingNode){ + if(oNode1 == oComparingNode) return oNode1; + oComparingNode = xe.DOMFix.parentNode(oComparingNode); + } + oComparingNode = oNode2; + oNode1 = xe.DOMFix.parentNode(oNode1); + } + + return this._document.body; + }, + + deleteContents : function(){ + if(this.collapsed) return; + + this._splitTextEndNodesOfTheRange(); + + var aNodes = this._getNodesInRange(); + + if(aNodes.length < 1) return; + + var oPrevNode = aNodes[0].previousSibling; + while(oPrevNode && this._isBlankTextNode(oPrevNode)) oPrevNode = oPrevNode.previousSibling; + + var oNewStartContainer, iNewOffset; + if(!oPrevNode){ + oNewStartContainer = xe.DOMFix.parentNode(aNodes[0]); + iNewOffset = 0; + } + + for(var i=0; i oNode.nodeValue.length) iOffset = oNode.nodeValue.length; + }else{ + if(iOffset > xe.DOMFix.childNodes(oNode).length) iOffset = xe.DOMFix.childNodes(oNode).length; + } + + return iOffset; + }, + + + setEnd : function(refNode, offset){ + offset = this._endsNodeValidation(refNode, offset); + + this.endContainer = refNode; + this.endOffset = offset; + if(!this.startContainer || this._compareEndPoint(this.startContainer, this.startOffset, this.endContainer, this.endOffset) != -1) this.collapse(false); + + this._updateRangeInfo(); + }, + + setEndAfter : function(refNode){ + if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter"); + + if(refNode.tagName == "BODY"){ + this.setEnd(refNode, xe.DOMFix.childNodes(refNode).length); + return; + } + this.setEnd(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)+1); + }, + + setEndBefore : function(refNode){ + if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore"); + + if(refNode.tagName == "BODY"){ + this.setEnd(refNode, 0); + return; + } + + this.setEnd(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)); + }, + + setStart : function(refNode, offset){ + offset = this._endsNodeValidation(refNode, offset); + + this.startContainer = refNode; + this.startOffset = offset; + + if(!this.endContainer || this._compareEndPoint(this.startContainer, this.startOffset, this.endContainer, this.endOffset) != -1) this.collapse(true); + this._updateRangeInfo(); + }, + + setStartAfter : function(refNode){ + if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter"); + + if(refNode.tagName == "BODY"){ + this.setStart(refNode, xe.DOMFix.childNodes(refNode).length); + return; + } + + this.setStart(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)+1); + }, + + setStartBefore : function(refNode){ + if(!refNode) throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore"); + + if(refNode.tagName == "BODY"){ + this.setStart(refNode, 0); + return; + } + this.setStart(xe.DOMFix.parentNode(refNode), this._getPosIdx(refNode)); + }, + + surroundContents : function(newParent){ + newParent.appendChild(this.extractContents()); + this.insertNode(newParent); + this.selectNode(newParent); + }, + + toString : function(){ + var oTmpContainer = this._document.createElement("DIV"); + oTmpContainer.appendChild(this.cloneContents()); + + return oTmpContainer.textContent || oTmpContainer.innerText || ""; + }, + + _isBlankTextNode : function(oNode){ + if(oNode.nodeType == 3 && oNode.nodeValue == "") return true; + return false; + }, + + _getPosIdx : function(refNode){ + var idx = 0; + for(var node = refNode.previousSibling; node; node = node.previousSibling) idx++; + + return idx; + }, + + _updateRangeInfo : function(){ + if(!this.startContainer){ + this.init(this._document); + return; + } + + this.collapsed = this._isCollapsed(this.startContainer, this.startOffset, this.endContainer, this.endOffset); + + this.commonAncestorContainer = this._getCommonAncestorContainer(this.startContainer, this.endContainer); + }, + + _isCollapsed : function(oStartContainer, iStartOffset, oEndContainer, iEndOffset){ + var bCollapsed = false; + + if(oStartContainer == oEndContainer && iStartOffset == iEndOffset){ + bCollapsed = true; + }else{ + var oActualStartNode = this._getActualStartNode(oStartContainer, iStartOffset); + var oActualEndNode = this._getActualEndNode(oEndContainer, iEndOffset); + + // Take the parent nodes on the same level for easier comparison when they're next to each other + // eg) From + // + // + // + // + // + // + // + // + // + // + // + // + // , it's easier to compare the position of B and D rather than C and F because they are siblings + // + // If the range were collapsed, oActualEndNode will precede oActualStartNode by doing this + oActualStartNode = this._getNextNode(this._getPrevNode(oActualStartNode)); + oActualEndNode = this._getPrevNode(this._getNextNode(oActualEndNode)); + + if(oActualStartNode && oActualEndNode && oActualEndNode.tagName != "BODY" && + (this._getNextNode(oActualEndNode) == oActualStartNode || (oActualEndNode == oActualStartNode && this._isBlankTextNode(oActualEndNode))) + ) + bCollapsed = true; + } + + return bCollapsed; + }, + + _splitTextEndNodesOfTheRange : function(){ + var oEndPoints = this._splitTextEndNodes({oStartContainer: this.startContainer, iStartOffset: this.startOffset, + oEndContainer: this.endContainer, iEndOffset: this.endOffset}); + + this.startContainer = oEndPoints.oStartContainer; + this.startOffset = oEndPoints.iStartOffset; + + this.endContainer = oEndPoints.oEndContainer; + this.endOffset = oEndPoints.iEndOffset; + }, + + _splitTextEndNodes : function(oEndPoints){ + oEndPoints = this._splitStartTextNode(oEndPoints); + oEndPoints = this._splitEndTextNode(oEndPoints); + + return oEndPoints; + }, + + _splitStartTextNode : function(oEndPoints){ + var oStartContainer = oEndPoints.oStartContainer; + var iStartOffset = oEndPoints.iStartOffset; + + var oEndContainer = oEndPoints.oEndContainer; + var iEndOffset = oEndPoints.iEndOffset; + + if(!oStartContainer) return oEndPoints; + if(oStartContainer.nodeType != 3) return oEndPoints; + if(iStartOffset == 0) return oEndPoints; + + if(oStartContainer.nodeValue.length <= iStartOffset) return oEndPoints; + + var oLastPart = oStartContainer.splitText(iStartOffset); + + if(oStartContainer == oEndContainer){ + iEndOffset -= iStartOffset; + oEndContainer = oLastPart; + } + oStartContainer = oLastPart; + iStartOffset = 0; + + return {oStartContainer: oStartContainer, iStartOffset: iStartOffset, oEndContainer: oEndContainer, iEndOffset: iEndOffset}; + }, + + _splitEndTextNode : function(oEndPoints){ + var oStartContainer = oEndPoints.oStartContainer; + var iStartOffset = oEndPoints.iStartOffset; + + var oEndContainer = oEndPoints.oEndContainer; + var iEndOffset = oEndPoints.iEndOffset; + + if(!oEndContainer) return oEndPoints; + if(oEndContainer.nodeType != 3) return oEndPoints; + + if(iEndOffset >= oEndContainer.nodeValue.length) return oEndPoints; + if(iEndOffset == 0) return oEndPoints; + + oEndContainer.splitText(iEndOffset); + + return {oStartContainer: oStartContainer, iStartOffset: iStartOffset, oEndContainer: oEndContainer, iEndOffset: iEndOffset}; + }, + + _getNodesInRange : function(){ + if(this.collapsed) return []; + + var oStartNode = this._getActualStartNode(this.startContainer, this.startOffset); + var oEndNode = this._getActualEndNode(this.endContainer, this.endOffset); + + return this._getNodesBetween(oStartNode, oEndNode); + }, + + _getActualStartNode : function(oStartContainer, iStartOffset){ + var oStartNode = oStartContainer;; + + if(oStartContainer.nodeType == 3){ + if(iStartOffset >= oStartContainer.nodeValue.length){ + oStartNode = this._getNextNode(oStartContainer); + if(oStartNode.tagName == "BODY") oStartNode = null; + }else{ + oStartNode = oStartContainer; + } + }else{ + if(iStartOffset < xe.DOMFix.childNodes(oStartContainer).length){ + oStartNode = xe.DOMFix.childNodes(oStartContainer)[iStartOffset]; + }else{ + oStartNode = this._getNextNode(oStartContainer); + if(oStartNode.tagName == "BODY") oStartNode = null; + } + } + + return oStartNode; + }, + + _getActualEndNode : function(oEndContainer, iEndOffset){ + var oEndNode = oEndContainer; + + if(iEndOffset == 0){ + oEndNode = this._getPrevNode(oEndContainer); + if(oEndNode.tagName == "BODY") oEndNode = null; + }else if(oEndContainer.nodeType == 3){ + oEndNode = oEndContainer; + }else{ + oEndNode = xe.DOMFix.childNodes(oEndContainer)[iEndOffset-1]; + } + + return oEndNode; + }, + + _getNextNode : function(oNode){ + if(!oNode || oNode.tagName == "BODY") return this._document.body; + + if(oNode.nextSibling) return oNode.nextSibling; + + return this._getNextNode(xe.DOMFix.parentNode(oNode)); + }, + + _getPrevNode : function(oNode){ + if(!oNode || oNode.tagName == "BODY") return this._document.body; + + if(oNode.previousSibling) return oNode.previousSibling; + + return this._getPrevNode(xe.DOMFix.parentNode(oNode)); + }, + + // includes partially selected + // for
    , _getNodesBetween(b, c) will yield to b, "a" and c + _getNodesBetween : function(oStartNode, oEndNode){ + var aNodesBetween = []; + this._nNodesBetweenLen = 0; + + if(!oStartNode || !oEndNode) return aNodesBetween; + + this._recurGetNextNodesUntil(oStartNode, oEndNode, aNodesBetween); + return aNodesBetween; + }, + + _recurGetNextNodesUntil : function(oNode, oEndNode, aNodesBetween){ + if(!oNode) return false; + + if(!this._recurGetChildNodesUntil(oNode, oEndNode, aNodesBetween)) return false; + + var oNextToChk = oNode.nextSibling; + + while(!oNextToChk){ + if(!(oNode = xe.DOMFix.parentNode(oNode))) return false; + + aNodesBetween[this._nNodesBetweenLen++] = oNode; + + if(oNode == oEndNode) return false; + + oNextToChk = oNode.nextSibling; + } + + return this._recurGetNextNodesUntil(oNextToChk, oEndNode, aNodesBetween); + }, + + _recurGetChildNodesUntil : function(oNode, oEndNode, aNodesBetween){ + if(!oNode) return false; + + var bEndFound = false; + var oCurNode = oNode; + if(oCurNode.firstChild){ + oCurNode = oCurNode.firstChild; + while(oCurNode){ + if(!this._recurGetChildNodesUntil(oCurNode, oEndNode, aNodesBetween)){ + bEndFound = true; + break; + } + oCurNode = oCurNode.nextSibling; + } + } + + aNodesBetween[this._nNodesBetweenLen++] = oNode; + + if(bEndFound) return false; + if(oNode == oEndNode) return false; + + return true; + } +}); + +xe.W3CDOMRange.START_TO_START = 0; +xe.W3CDOMRange.START_TO_END = 1; +xe.W3CDOMRange.END_TO_END = 2; +xe.W3CDOMRange.END_TO_START = 3; + + +/** + * @fileOverview This file contains a cross-browser function that implements all of the W3C's DOM Range specification and some more + * @name XpressRange.js + */ +xe.XpressRange = $.Class({ + setWindow : function(win){ + this._window = win; + this._document = win.document; + }, + + $init : function(win){ + this.HUSKY_BOOMARK_START_ID_PREFIX = "xpress_bookmark_start_"; + this.HUSKY_BOOMARK_END_ID_PREFIX = "xpress_bookmark_end_"; + + this.sBlockElement = "P|DIV|LI|H[1-6]|PRE"; + this.sBlockContainer = "BODY|TABLE|TH|TR|TD|UL|OL|BLOCKQUOTE|FORM"; + + this.rxBlockElement = new RegExp("^("+this.sBlockElement+")$"); + this.rxBlockContainer = new RegExp("^("+this.sBlockContainer+")$") + this.rxLineBreaker = new RegExp("^("+this.sBlockElement+"|"+this.sBlockContainer+")$") + + this.setWindow(win); + + this.oSimpleSelection = new xe.SimpleSelection(this._window); + this.selectionLoaded = this.oSimpleSelection.selectionLoaded; + + this.$super.$init(this._document); + }, + + select : function(){ + this.oSimpleSelection.selectRange(this); + }, + + setFromSelection : function(iNum){ + this.setRange(this.oSimpleSelection.getRangeAt(iNum)); + }, + + setRange : function(oW3CRange){ + this.setStart(oW3CRange.startContainer, oW3CRange.startOffset); + this.setEnd(oW3CRange.endContainer, oW3CRange.endOffset); + }, + + setEndNodes : function(oSNode, oENode){ + this.setEndAfter(oENode); + this.setStartBefore(oSNode); + }, + + splitTextAtBothEnds : function(){ + this._splitTextEndNodesOfTheRange(); + }, + + getStartNode : function(){ + if(this.collapsed){ + if(this.startContainer.nodeType == 3){ + if(this.startOffset == 0) return null; + if(this.startContainer.nodeValue.length <= this.startOffset) return null; + return this.startContainer; + } + return null; + } + + if(this.startContainer.nodeType == 3){ + if(this.startOffset >= this.startContainer.nodeValue.length) return this._getNextNode(this.startContainer); + return this.startContainer; + }else{ + if(this.startOffset >= xe.DOMFix.childNodes(this.startContainer).length) return this._getNextNode(this.startContainer); + return xe.DOMFix.childNodes(this.startContainer)[this.startOffset]; + } + }, + + getEndNode : function(){ + if(this.collapsed) return this.getStartNode(); + + if(this.endContainer.nodeType == 3){ + if(this.endOffset == 0) return this._getPrevNode(this.endContainer); + return this.endContainer; + }else{ + if(this.endOffset == 0) return this._getPrevNode(this.endContainer); + return xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]; + } + }, + + getNodeAroundRange : function(bBefore, bStrict){ + if(this.collapsed && this.startContainer && this.startContainer.nodeType == 3) return this.startContainer; + if(!this.collapsed || (this.startContainer && this.startContainer.nodeType == 3)) return this.getStartNode(); + + var oBeforeRange, oAfterRange, oResult; + + if(this.startOffset >= xe.DOMFix.childNodes(this.startContainer).length) + oAfterRange = this._getNextNode(this.startContainer); + else + oAfterRange = xe.DOMFix.childNodes(this.startContainer)[this.startOffset]; + + if(this.endOffset == 0) + oBeforeRange = this._getPrevNode(this.endContainer); + else + oBeforeRange = xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]; + + if(bBefore){ + oResult = oBeforeRange; + if(!oResult && !bStrict) oResult = oAfterRange; + }else{ + oResult = oAfterRange; + if(!oResult && !bStrict) oResult = oBeforeRange; + } + + return oResult; + }, + + _getXPath : function(elNode){ + var sXPath = ""; + + while(elNode && elNode.nodeType == 1){ + sXPath = "/" + elNode.tagName+"["+this._getPosIdx4XPath(elNode)+"]" + sXPath; + elNode = xe.DOMFix.parentNode(elNode); + } + + return sXPath; + }, + + _getPosIdx4XPath : function(refNode){ + var idx = 0; + for(var node = refNode.previousSibling; node; node = node.previousSibling) + if(node.tagName == refNode.tagName) idx++; + + return idx; + }, + + // this was written specifically for XPath Bookmark and it may not perform correctly for general purposes + _evaluateXPath : function(sXPath, oDoc){ + sXPath = sXPath.substring(1, sXPath.length-1); + var aXPath = sXPath.split(/\//); + var elNode = oDoc.body; + + for(var i=2; i -1 && elContainer){ + var aChildNodes = xe.DOMFix.childNodes(elContainer); + var elNode = null; + + var nIdx = nTextNodeIdx; + var nOffsetLeft = nOffset; + + while((elNode = aChildNodes[nIdx]) && elNode.nodeType == 3 && elNode.nodeValue.length < nOffsetLeft){ + nOffsetLeft -= elNode.nodeValue.length; + nIdx++; + } + + elContainer = xe.DOMFix.childNodes(elContainer)[nIdx]; + nOffset = nOffsetLeft; + } + + if(!elContainer){ + elContainer = this._document.body; + nOffset = 0; + } + return {elContainer: elContainer, nOffset: nOffset}; + }, + + // this was written specifically for XPath Bookmark and it may not perform correctly for general purposes + getXPathBookmark : function(){ + var nTextNodeIdx1 = -1; + var htEndPt1 = {elContainer: this.startContainer, nOffset: this.startOffset}; + var elNode1 = this.startContainer; + if(elNode1.nodeType == 3){ + htEndPt1 = this._getFixedStartTextNode(); + nTextNodeIdx1 = this._getPosIdx(htEndPt1.elContainer); + elNode1 = xe.DOMFix.parentNode(elNode1); + } + var sXPathNode1 = this._getXPath(elNode1); + var oBookmark1 = {sXPath:sXPathNode1, nTextNodeIdx:nTextNodeIdx1, nOffset: htEndPt1.nOffset}; + + var nTextNodeIdx2 = -1; + var htEndPt2 = {elContainer: this.endContainer, nOffset: this.endOffset}; + var elNode2 = this.endContainer; + if(elNode2.nodeType == 3){ + htEndPt2 = this._getFixedEndTextNode(); + nTextNodeIdx2 = this._getPosIdx(htEndPt2.elContainer); + elNode2 = xe.DOMFix.parentNode(elNode2); + } + var sXPathNode2 = this._getXPath(elNode2); + var oBookmark2 = {sXPath:sXPathNode2, nTextNodeIdx:nTextNodeIdx2, nOffset: htEndPt2.nOffset}; + + return [oBookmark1, oBookmark2]; + }, + + moveToXPathBookmark : function(aBookmark){ + if(!aBookmark) return; + + var oBookmarkInfo1 = this._evaluateXPathBookmark(aBookmark[0]); + var oBookmarkInfo2 = this._evaluateXPathBookmark(aBookmark[1]); + + if(!oBookmarkInfo1["elContainer"] || !oBookmarkInfo2["elContainer"]) return; + + this.startContainer = oBookmarkInfo1["elContainer"]; + this.startOffset = oBookmarkInfo1["nOffset"]; + + this.endContainer = oBookmarkInfo2["elContainer"]; + this.endOffset = oBookmarkInfo2["nOffset"]; + }, + + _getFixedTextContainer : function(elNode, nOffset){ + while(elNode && elNode.nodeType == 3 && elNode.previousSibling && elNode.previousSibling.nodeType == 3){ + nOffset += elNode.previousSibling.nodeValue.length; + elNode = elNode.previousSibling; + } + + return {elContainer:elNode, nOffset:nOffset}; + }, + + _getFixedStartTextNode : function(){ + return this._getFixedTextContainer(this.startContainer, this.startOffset); + }, + + _getFixedEndTextNode : function(){ + return this._getFixedTextContainer(this.endContainer, this.endOffset); + }, + + placeStringBookmark : function(){ + var sTmpId = (new Date()).getTime(); + + var oInsertionPoint = this.cloneRange(); + oInsertionPoint.collapseToEnd(); + var oEndMarker = this._document.createElement("A"); + oEndMarker.id = this.HUSKY_BOOMARK_END_ID_PREFIX+sTmpId; + oInsertionPoint.insertNode(oEndMarker); + + var oInsertionPoint = this.cloneRange(); + oInsertionPoint.collapseToStart(); + var oStartMarker = this._document.createElement("A"); + oStartMarker.id = this.HUSKY_BOOMARK_START_ID_PREFIX+sTmpId; + oInsertionPoint.insertNode(oStartMarker); + + this.moveToBookmark(sTmpId); + + return sTmpId; + }, + + cloneRange : function(){ + return this._copyRange(new xe.XpressRange(this._window)); + }, + + moveToBookmark : function(vBookmark){ + if(typeof(vBookmark) != "object") + this.moveToStringBookmark(vBookmark); + else + this.moveToXPathBookmark(vBookmark); + }, + + moveToStringBookmark : function(sBookmarkID){ + var oStartMarker = this._document.getElementById(this.HUSKY_BOOMARK_START_ID_PREFIX+sBookmarkID); + var oEndMarker = this._document.getElementById(this.HUSKY_BOOMARK_END_ID_PREFIX+sBookmarkID); + + if(!oStartMarker || !oEndMarker) return; + + this.setEndBefore(oEndMarker); + this.setStartAfter(oStartMarker); + }, + + removeStringBookmark : function(sBookmarkID){ + var oStartMarker = this._document.getElementById(this.HUSKY_BOOMARK_START_ID_PREFIX+sBookmarkID); + var oEndMarker = this._document.getElementById(this.HUSKY_BOOMARK_END_ID_PREFIX+sBookmarkID); + + if(oStartMarker) xe.DOMFix.parentNode(oStartMarker).removeChild(oStartMarker); + if(oEndMarker) xe.DOMFix.parentNode(oEndMarker).removeChild(oEndMarker); + }, + + collapseToStart : function(){ + this.collapse(true); + }, + + collapseToEnd : function(){ + this.collapse(false); + }, + + createAndInsertNode : function(sTagName){ + tmpNode = this._document.createElement(tagName); + this.insertNode(tmpNode) + return tmpNode + }, + + getNodes : function(bSplitTextEndNodes, fnFilter){ + if(bSplitTextEndNodes) this._splitTextEndNodesOfTheRange(); + + var aAllNodes = this._getNodesInRange(); + var aFilteredNodes = []; + + if(!fnFilter) return aAllNodes; + + for(var i=0; i= 0) return true; + + if(bIncludePartlyIncluded){ + if(startToEnd == 1) return false; + if(endToStart == -1) return false; + return true; + } + + return false; + }, + + isNodeInRange : function(oNode, bIncludePartlySelected, bContentOnly){ + var oTmpRange = new xe.XpressRange(this._window); + + if(bContentOnly && oNode.firstChild){ + oTmpRange.setStartBefore(oNode.firstChild); + oTmpRange.setEndAfter(oNode.lastChild); + }else{ + oTmpRange.selectNode(oNode); + } + + return isRangeInRange(oTmpRange, bIncludePartlySelected); + }, + + pasteHTML : function(sHTML){ + if(sHTML == ""){ + this.deleteContents(); + return; + } + + var oTmpDiv = this._document.createElement("DIV"); + oTmpDiv.innerHTML = sHTML; + + var oFirstNode = oTmpDiv.firstChild; + var oLastNode = oTmpDiv.lastChild; + + var clone = this.cloneRange(); + var sBM = clone.placeStringBookmark(); + + while(oTmpDiv.lastChild) this.insertNode(oTmpDiv.lastChild); + + this.setEndNodes(oFirstNode, oLastNode); + + // delete the content later as deleting it first may mass up the insertion point + // eg)

    [A]BCD

    ---paste O---> O

    BCD

    + clone.moveToBookmark(sBM); + clone.deleteContents(); + clone.removeStringBookmark(sBM); + }, + + toString : function(){ + this.toString = xe.W3CDOMRange.prototype.toString; + return this.toString(); + }, + + toHTMLString : function(){ + var oTmpContainer = this._document.createElement("DIV"); + oTmpContainer.appendChild(this.cloneContents()); + + return oTmpContainer.innerHTML; + }, + + findAncestorByTagName : function(sTagName){ + var oNode = this.commonAncestorContainer; + while(oNode && oNode.tagName != sTagName) oNode = xe.DOMFix.parentNode(oNode); + + return oNode; + }, + + selectNodeContents : function(oNode){ + if(!oNode) return; + + var oFirstNode = oNode.firstChild?oNode.firstChild:oNode; + var oLastNode = oNode.lastChild?oNode.lastChild:oNode; + + if(oFirstNode.nodeType == 3) + this.setStart(oFirstNode, 0); + else + this.setStartBefore(oFirstNode); + + if(oLastNode.nodeType == 3) + this.setEnd(oLastNode, oLastNode.nodeValue.length); + else + this.setEndAfter(oLastNode); + }, + + styleRange : function(oStyle, oAttribute, sNewSpanMarker){ + var aStyleParents = this._getStyleParentNodes(sNewSpanMarker); + if(aStyleParents.length < 1) return; + + var sName, sValue; + + for(var i=0; i= 0)){ + oSNode = this.getNodeAroundRange(false, true); + oENode = this.getNodeAroundRange(false, true); + oStart = this._getLineStartInfo(oSNode); + oEnd = this._getLineEndInfo(oENode); + } + + return {oStart: oStart, oEnd: oEnd}; + } +}).extend(xe.W3CDOMRange); + +/** + * @fileOverview This file contains cross-browser selection function + * @name SimpleSelection.js + */ +xe.SimpleSelection = function(win){ + this.init = function(win){ + this._window = win || window; + this._document = this._window.document; + }; + + this.init(win); + + if($.browser.msie) + xe.SimpleSelectionImpl_IE.apply(this); + else + xe.SimpleSelectionImpl_FF.apply(this); + + this.selectRange = function(oRng){ + this.selectNone(); + this.addRange(oRng); + }; + + this.selectionLoaded = true; + if(!this._oSelection) this.selectionLoaded = false; +}; + +xe.SimpleSelectionImpl_FF = function(){ + this._oSelection = this._window.getSelection(); + + this.getRangeAt = function(iNum){ + iNum = iNum || 0; + + try{ + var oFFRange = this._oSelection.getRangeAt(iNum); + }catch(e){return new xe.W3CDOMRange(this._document);} + + return this._FFRange2W3CRange(oFFRange); + }; + + this.addRange = function(oW3CRange){ + var oFFRange = this._W3CRange2FFRange(oW3CRange); + this._oSelection.addRange(oFFRange); + }; + + this.selectNone = function(){ + this._oSelection.removeAllRanges(); + }; + + this._FFRange2W3CRange = function(oFFRange){ + var oW3CRange = new xe.W3CDOMRange(this._document); + oW3CRange.setStart(oFFRange.startContainer, oFFRange.startOffset); + oW3CRange.setEnd(oFFRange.endContainer, oFFRange.endOffset); + return oW3CRange; + }; + + this._W3CRange2FFRange = function(oW3CRange){ + var oFFRange = this._document.createRange(); + oFFRange.setStart(oW3CRange.startContainer, oW3CRange.startOffset); + oFFRange.setEnd(oW3CRange.endContainer, oW3CRange.endOffset); + + return oFFRange; + }; +}; + +xe.SimpleSelectionImpl_IE = function(){ + this._oSelection = this._document.selection; + + this.getRangeAt = function(iNum){ + iNum = iNum || 0; + + if(this._oSelection.type == "Control"){ + var oW3CRange = new xe.W3CDOMRange(this._document); + + var oSelectedNode = this._oSelection.createRange().item(iNum); + + // if the selction occurs in a different document, ignore + if(!oSelectedNode || oSelectedNode.ownerDocument != this._document) return oW3CRange; + + oW3CRange.selectNode(oSelectedNode); + + return oW3CRange; + }else{ + var oSelectedNode = this._oSelection.createRangeCollection().item(iNum).parentElement(); + + // if the selction occurs in a different document, ignore + if(!oSelectedNode || oSelectedNode.ownerDocument != this._document){ + var oW3CRange = new xe.W3CDOMRange(this._document); + return oW3CRange; + } + return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(iNum)); + } + }; + + this.addRange = function(oW3CRange){ + var oIERange = this._W3CRange2IERange(oW3CRange); + oIERange.select(); + }; + + this.selectNone = function(){ + this._oSelection.empty(); + }; + + this._W3CRange2IERange = function(oW3CRange){ + var oStartIERange = this._getIERangeAt(oW3CRange.startContainer, oW3CRange.startOffset); + var oEndIERange = this._getIERangeAt(oW3CRange.endContainer, oW3CRange.endOffset); + oStartIERange.setEndPoint("EndToEnd", oEndIERange); + + return oStartIERange; + }; + + this._getIERangeAt = function(oW3CContainer, iW3COffset){ + var oIERange = this._document.body.createTextRange(); + + var oEndPointInfoForIERange = this._getSelectableNodeAndOffsetForIE(oW3CContainer, iW3COffset); + + var oSelectableNode = oEndPointInfoForIERange.oSelectableNodeForIE; + var iIEOffset = oEndPointInfoForIERange.iOffsetForIE; + + oIERange.moveToElementText(oSelectableNode); + oIERange.collapse(oEndPointInfoForIERange.bCollapseToStart); + oIERange.moveStart("character", iIEOffset); + + return oIERange; + }; + + this._getSelectableNodeAndOffsetForIE = function(oW3CContainer, iW3COffset){ + var oIERange = this._document.body.createTextRange(); + + var oNonTextNode = null; + var aChildNodes = null; + var iNumOfLeftNodesToCount = 0; + + if(oW3CContainer.nodeType == 3){ + oNonTextNode = xe.DOMFix.parentNode(oW3CContainer); + aChildNodes = xe.DOMFix.childNodes(oNonTextNode); + iNumOfLeftNodesToCount = aChildNodes.length; + }else{ + oNonTextNode = oW3CContainer; + aChildNodes = xe.DOMFix.childNodes(oNonTextNode); + iNumOfLeftNodesToCount = iW3COffset; + } + + var oNodeTester = null; + + var iResultOffset = 0; + + var bCollapseToStart = true; + + for(var i=0; i=0) break; + + oPrevNonTextNode = aChildNodes[i]; + } + + var pointRangeIdx = i; + + if(pointRangeIdx != 0 && aChildNodes[pointRangeIdx-1].nodeType == 3){ + var oRgTextStart = this._document.body.createTextRange(); + var oCurTextNode = null; + if(oPrevNonTextNode){ + oRgTextStart.moveToElementText(oPrevNonTextNode); + oRgTextStart.collapse(false); + oCurTextNode = oPrevNonTextNode.nextSibling; + }else{ + oRgTextStart.moveToElementText(oContainer); + oRgTextStart.collapse(true); + oCurTextNode = oContainer.firstChild; + } + + var oRgTextsUpToThePoint = oRgOrigPoint.duplicate(); + oRgTextsUpToThePoint.setEndPoint("StartToStart", oRgTextStart); + + var textCount = oRgTextsUpToThePoint.text.length + + while(textCount > oCurTextNode.nodeValue.length && oCurTextNode.nextSibling){ + textCount -= oCurTextNode.nodeValue.length; + oCurTextNode = oCurTextNode.nextSibling; + } + + // this will enforce IE to re-reference oCurTextNode + var oTmp = oCurTextNode.nodeValue; + + if(bStartPt && oCurTextNode.nextSibling && oCurTextNode.nextSibling.nodeType == 3 && textCount == oCurTextNode.nodeValue.length){ + textCount -= oCurTextNode.nodeValue.length; + oCurTextNode = oCurTextNode.nextSibling; + } + + oContainer = oCurTextNode; + offset = textCount; + }else{ + oContainer = oRgOrigPoint.parentElement(); + offset = pointRangeIdx; + } + + return {"oContainer" : oContainer, "iOffset" : offset}; + }; +} + +xe.DOMFix = new ($.Class({ + $init : function(){ + if($.browser.msie || $.browser.opera){ + this.childNodes = this._childNodes_Fix; + this.parentNode = this._parentNode_Fix; + }else{ + this.childNodes = this._childNodes_Native; + this.parentNode = this._parentNode_Native; + } + }, + + _parentNode_Native : function(elNode){ + return elNode.parentNode; + }, + + _parentNode_Fix : function(elNode){ + if(!elNode) return elNode; + + while(elNode.previousSibling){elNode = elNode.previousSibling;} + + return elNode.parentNode; + }, + + _childNodes_Native : function(elNode){ + return elNode.childNodes; + }, + + _childNodes_Fix : function(elNode){ + var aResult = null; + var nCount = 0; + + if(elNode){ + var aResult = []; + elNode = elNode.firstChild; + while(elNode){ + aResult[nCount++] = elNode; + elNode=elNode.nextSibling; + } + } + + return aResult; + } +}))(); + +/** + * @fileOverview This file contains a function that takes care of the draggable layers + * @name N_DraggableLayer.js + */ +xe.DraggableLayer = $.Class({ + $init : function(oLayer, oOptions){ + this.oOptions = $.extend({ + bModal : "false", + oHandle : oLayer, + iMinX : -999999, + iMinY : -999999, + iMaxX : 999999, + iMaxY : 999999 + }, oOptions); + + this.oHandle = this.oOptions.oHandle; + + oLayer.style.display = "block"; + oLayer.style.position = "absolute"; + oLayer.style.zIndex = "9999"; + + this.aBasePosition = this.getBaseOffset(oLayer); + + // "number-ize" the position and set it as inline style. (the position could've been set as "auto" or set by css, not inline style) + oLayer.style.top = (this.toInt($(oLayer).offset().top) - this.aBasePosition.top)+"px"; + oLayer.style.left = (this.toInt($(oLayer).offset().left) - this.aBasePosition.left)+"px"; + + this.$FnMouseDown = $.fnBind(this._mousedown, this, oLayer); + this.$FnMouseMove = $.fnBind(this._mousemove, this, oLayer); + this.$FnMouseUp = $.fnBind(this._mouseup, this, oLayer); + + $(this.oHandle).bind("mousedown", this.$FnMouseDown); + }, + + _mousedown : function(oLayer, oEvent){ + if(oEvent.target.tagName == "INPUT") return; + + this.MouseOffsetY = (oEvent.pageY-this.toInt(oLayer.style.top)-this.aBasePosition['top']); + this.MouseOffsetX = (oEvent.pageX-this.toInt(oLayer.style.left)-this.aBasePosition['left']); + + $(oLayer).bind("mousemove", this.$FnMouseMove); + $(oLayer).bind("mouseup", this.$FnMouseUp); + }, + + _mousemove : function(oLayer, oEvent){ + var iTop = (oEvent.pageY-this.MouseOffsetY-this.aBasePosition['top']); + var iLeft = (oEvent.pageX-this.MouseOffsetX-this.aBasePosition['left']); + + if(iTopthis.oOptions.iMaxY) iTop = this.oOptions.iMaxY; + + if(iLeftthis.oOptions.iMaxX) iLeft = this.oOptions.iMaxX; + + oLayer.style.top = iTop + "px"; + oLayer.style.left = iLeft + "px"; + }, + + _mouseup : function(oLayer, oEvent){ + $(oLayer).unbind("mousemove", this.$FnMouseMove); + $(oLayer).unbind("mouseup", this.$FnMouseUp); + }, + + toInt : function(num){ + var result = parseInt(num); + return result || 0; + }, + + findNonStatic : function(oEl){ + if(!oEl) return null; + if(oEl.tagName == "BODY") return oEl; + + if($(oEl).css("position").match(/absolute|relative/i)) return oEl; + + return this.findNonStatic(oEl.offsetParent); + }, + + getBaseOffset : function(oEl){ + var oBase = this.findNonStatic(oEl.offsetParent); + var tmp = $(oBase).offset(); + + return {top: tmp.top, left: tmp.left}; + } +}); +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the messages related to core operations + * @name hp_CorePlugin.js + */ +xe.CorePlugin = $.Class({ + name : "CorePlugin", + + $init : function(funcOnReady){ + this.funcOnReady = funcOnReady; + }, + + $AFTER_MSG_APP_READY : function(){ + this.oApp.exec("EXEC_ON_READY_FUNCTION", []); + }, + + $ON_ADD_APP_PROPERTY : function(sPropertyName, oProperty){ + this.oApp[sPropertyName] = oProperty; + }, + + $ON_REGISTER_BROWSER_EVENT : function(obj, sEvent, sCMD, aParams, nDelay){ + this.oApp.registerBrowserEvent(obj, sEvent, sCMD, aParams, nDelay); + }, + + $ON_DISABLE_COMMAND : function(sCommand){ + this.oApp.disableCommand(sCommand, true); + }, + + $ON_ENABLE_COMMAND : function(sCommand){ + this.oApp.disableCommand(sCommand, false); + }, + + $ON_EXEC_ON_READY_FUNCTION : function(){ + if(typeof this.funcOnReady == "function") this.funcOnReady(); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that helps various operations. + * @name hp_Utils.js + */ + xe.Utils = $.Class({ + name : "Utils", + + $init : function(){ + if($.browser.msie && $.browser.nVersion == 6){ + try{ + document.execCommand('BackgroundImageCache', false, true); + }catch(e){} + } + }, + + $ON_ATTACH_HOVER_EVENTS : function(aElms, sHoverClass){ + sHoverClass = sHoverClass || "hover"; + + if(!aElms) return; + + $(aElms).hover( + function(){$(this).addClass(sHoverClass)}, + function(){$(this).removeClass(sHoverClass)} + ); + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that bridges the XpressRange function + * @name hp_XpressRangeManager.js + */ +xe.XpressRangeManager = $.Class({ + name : "XpressRangeManager", + + oWindow : null, + + $init : function(win){ + this.oWindow = win || window; + }, + + $BEFORE_MSG_APP_READY : function(){ + if(this.oWindow && this.oWindow.tagName == "IFRAME") + this.oWindow = this.oWindow.contentWindow; + + this.oApp.exec("ADD_APP_PROPERTY", ["getSelection", $.fnBind(this.getSelection, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["getEmptySelection", $.fnBind(this.getEmptySelection, this)]); + }, + + $ON_SET_EDITING_WINDOW : function(oWindow){ + this.oWindow = oWindow; + }, + + getEmptySelection : function(){ + var oXpressRange = new xe.XpressRange(this.oWindow); + return oXpressRange; + }, + + getSelection : function(){ + this.oApp.exec("RESTORE_IE_SELECTION", []); + + var oXpressRange = this.getEmptySelection(); + + // this may throw an exception if the selected is area is not yet shown + try{ + oXpressRange.setFromSelection(); + }catch(e){} + + return oXpressRange; + } +}); +//} +xe.Hotkey = $.Class({ + name : "Hotkey", + + storage : {}, + keyhash : {}, + + $init : function(){ + this.storage = {}; + + this.keyhash = { + backspace : 8, + tab : 9, + enter : 13, + shift : 16, + ctrl : 17, + alt : 18, + meta : 224, + esc : 27, + space : 32, + pageup : 33, + pagedown : 34, + end : 35, + home : 36, + left : 37, + up : 38, + right : 39, + down : 40, + del : 46, + comma : 188,//(,) + period : 190,//(.) + slash : 191,//(/) + hyphen : 109, + equal : 61 + }; + + if ($.browser.msie || $.browser.safari) { + this.keyhash.hyphen = 189; // (-) + this.keyhash.equal = 187; // (=) + this.keyhash.meta = 91; // meta + } + + + }, + + $ON_MSG_APP_READY : function(){ + $(this.oApp.getWYSIWYGDocument() || document).keydown($.fnBind(this.keydown, this)); + }, + + $ON_REGISTER_HOTKEY : function(sHotkey, sCMD, sArgs){ + if(!sArgs) sArgs = []; + var func = $.fnBind(this.oApp.exec, this.oApp, sCMD, sArgs); + + sHotkey = this.normalize(sHotkey); + if (!sHotkey) return false; + + this.add(sHotkey, func); + }, + + add : function(sHotkey, func) { + if (typeof this.storage[sHotkey] == 'undefined') { + this.storage[sHotkey] = [func]; + } else { + this.storage[sHotkey].push(func); + } + }, + + keydown : function(event) { + var key = [], kh = this.keyhash; + + if ($.inArray(event.keyCode, [kh.shift, kh.ctrl, kh.alt, kh.meta]) >= 0) return; + + if (event.shiftKey) key.push('shift'); + if (event.altKey) key.push('alt'); + if (event.ctrlKey) key.push('ctrl'); + if (event.metaKey) key.push('meta'); + if (!key.length) return; + if (key.length == 1 && event.metaKey) key = ['ctrl', 'meta']; + + key.push(event.keyCode); + + key = key.join('+'); + + if (!this.storage[key]) return; + + $.each(this.storage[key], function(){ this(); }); + + return false; + }, + + normalize : function(sHotkey) { + var shift, ctrl, alt, meta, key, keys = (sHotkey||"").toLowerCase().split('+'); + + shift = ctrl = alt = meta = key = false; + + $.each(keys, function(){ + var s = ""+this; + switch(s) { + case 'shift': shift = true; + case 'alt' : alt = true; + case 'ctrl' : ctrl = true; + case 'meta' : meta = true; + default: + key = s; + } + }); + + if (!key) return ''; + + keys = []; + if (shift) keys.push('shift'); + if (alt) keys.push('alt'); + if (ctrl) keys.push('ctrl'); + if (meta || (ctrl && !shift && !alt)) keys.push('meta'); + + keys.push(this.keyhash[key] || key.toUpperCase().charCodeAt(0)); + + return keys.join('+'); + } +}); + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the draggable layers + * @name hp_DialogLayerManager.js + */ +xe.DialogLayerManager = $.Class({ + name : "DialogLayerManager", + aMadeDraggable : null, + aOpenedLayers : null, + + $init : function(){ + this.aMadeDraggable = []; + this.aOpenedLayers = []; + }, + + $ON_SHOW_DIALOG_LAYER : function(oLayer, bModal){ + oLayer = $.$(oLayer); + bModal = $.$(bModal) || false; + if(!oLayer) return; + + if($.inArray(oLayer, this.aOpenedLayers) != -1) return; + + this.oApp.exec("POSITION_DIALOG_LAYER", [oLayer]); + + this.aOpenedLayers[this.aOpenedLayers.length] = oLayer; + + if($.inArray(oLayer, this.aMadeDraggable) == -1){ + new xe.DraggableLayer(oLayer, {bModal: bModal, iMinY: 0}); + this.aMadeDraggable[this.aMadeDraggable.length] = oLayer; + }else{ + oLayer.style.display = "block"; + } + }, + + $ON_HIDE_LAST_DIALOG_LAYER : function(){ + this.oApp.exec("HIDE_DIALOG_LAYER", [this.aOpenedLayers[this.aOpenedLayers.length-1]]); + }, + + $ON_HIDE_ALL_DIALOG_LAYER : function(){ + for(var i=this.aOpenedLayers.length-1; i>=0; i--) + this.oApp.exec("HIDE_DIALOG_LAYER", [this.aOpenedLayers[i]]); + }, + + $ON_HIDE_DIALOG_LAYER : function(oLayer){ + oLayer = $.$(oLayer); + + if(oLayer) oLayer.style.display = "none"; + this.aOpenedLayers = $.grep(this.aOpenedLayers, function(a){return a!=oLayer}); + }, + + $ON_SET_DIALOG_LAYER_POSITION : function(oLayer, iTop, iLeft){ + oLayer.style.top = iTop; + oLayer.style.left = iLeft; + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the layers that should disappear when the focus is lost + * @name hp_ActiveLayerManager.js + */ +xe.ActiveLayerManager = $.Class({ + name : "ActiveLayerManager", + oCurrentLayer : null, + + $ON_TOGGLE_ACTIVE_LAYER : function(oLayer, sOnOpenCmd, aOnOpenParam, sOnCloseCmd, aOnCloseParam){ + if(oLayer == this.oCurrentLayer){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + }else{ + this.oApp.exec("SHOW_ACTIVE_LAYER", [oLayer, sOnCloseCmd, aOnCloseParam]); + if(sOnOpenCmd) this.oApp.exec(sOnOpenCmd, aOnOpenParam); + } + }, + + $ON_SHOW_ACTIVE_LAYER : function(oLayer, sOnCloseCmd, aOnCloseParam){ + oLayer = $.$(oLayer); + this.sOnCloseCmd = sOnCloseCmd; + this.aOnCloseParam = aOnCloseParam; + + var oPrevLayer = this.oCurrentLayer; + + if(oLayer == oPrevLayer) return; + + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + + oLayer.style.display = "block"; + this.oCurrentLayer = oLayer; + }, + + $ON_HIDE_ACTIVE_LAYER : function(){ + var oLayer = this.oCurrentLayer; + if(!oLayer) return; + oLayer.style.display = "none"; + this.oCurrentLayer = null; + + if(this.sOnCloseCmd) + this.oApp.exec(this.sOnCloseCmd, this.aOnCloseParam); + }, + + // for backward compatibility only. + // use HIDE_ACTIVE_LAYER instead! + $ON_HIDE_CURRENT_ACTIVE_LAYER : function(){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + }, + + $ON_EVENT_EDITING_AREA_KEYDOWN : function(){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + }, + + $ON_EVENT_EDITING_AREA_MOUSEDOWN : function(){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to string conversion. Ususally used to convert the IR value. + * @name hp_StringConverterManager.js + */ +xe.StringConverterManager = $.Class({ + name : "StringConverterManager", + + oConverters : null, + + $init : function(){ + this.oConverters = {}; + }, + + $BEFORE_MSG_APP_READY : function(){ + this.oApp.exec("ADD_APP_PROPERTY", ["applyConverter", $.fnBind(this.applyConverter, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["addConverter", $.fnBind(this.addConverter, this)]); + }, + + applyConverter : function(sRuleName, sContent){ + var aConverters = this.oConverters[sRuleName]; + if(!aConverters) return sContent; + + for(var i=0; i*:first-child", aAllLi[i]).get(0); + } + } + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.toolbarArea, "mouseover", "EVENT_TOOLBAR_MOUSEOVER", []); + this.oApp.registerBrowserEvent(this.toolbarArea, "mouseout", "EVENT_TOOLBAR_MOUSEOUT", []); + + this.oApp.exec("ADD_APP_PROPERTY", ["getToolbarButtonByUIName", $.fnBind(this.getToolbarButtonByUIName, this)]); + }, + + $ON_EVENT_TOOLBAR_MOUSEOVER : function(weEvent){ + if(weEvent.target.tagName == "BUTTON") $(weEvent.target).addClass("hover").parent("span").addClass("hover"); + }, + + $ON_EVENT_TOOLBAR_MOUSEOUT : function(weEvent){ + if(weEvent.target.tagName == "BUTTON") $(weEvent.target).removeClass("hover").parent("span").removeClass("hover"); + }, + + $ON_TOGGLE_TOOLBAR_ACTIVE_LAYER : function(oLayer, oBtn, sOpenCmd, aOpenArgs, sCloseCmd, aCloseArgs){ + this.oApp.exec("TOGGLE_ACTIVE_LAYER", [oLayer, "MSG_TOOLBAR_LAYER_SHOWN", [oLayer, oBtn, sOpenCmd, aOpenArgs], sCloseCmd, aCloseArgs]); + }, + + $ON_MSG_TOOLBAR_LAYER_SHOWN : function(oLayer, oBtn, aOpenCmd, aOpenArgs){ + this.oApp.exec("POSITION_TOOLBAR_LAYER", [oLayer, oBtn]); + if(aOpenCmd) this.oApp.exec(aOpenCmd, aOpenArgs); + }, + + $ON_SHOW_TOOLBAR_ACTIVE_LAYER : function(oLayer, sCmd, aArgs, oBtn){ + this.oApp.exec("SHOW_ACTIVE_LAYER", [oLayer, sCmd, aArgs]); + this.oApp.exec("POSITION_TOOLBAR_LAYER", [oLayer, oBtn]); + }, + + $ON_ENABLE_UI : function(sUIName){ + var elUI = this.htUIList[sUIName]; + if(!elUI) return; + $(elUI).removeClass("off"); + elUI.disabled = false; + + // enable related commands + var sCmd = ""; + if(this.aUICmdMap[sUIName]){ + for(var i=0; i nToolbarLeft) oLayer.style.left = (nToolbarLeft-nLayerLeft-5)+"px"; + }, + + getToolbarButtonByUIName : function(sUIName){ + return this.htUIList[sUIName]; + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that manages multiple number editing area plugins and the IR value + * @name hp_XE_EditingAreaManager.js + */ +xe.XE_EditingAreaManager = $.Class({ + name : "XE_EditingAreaManager", + + // Currently active plugin instance(XE_EditingArea_???) + oActivePlugin : null, + + // Intermediate Representation of the content being edited. + // This should be a textarea element. + oIRField : null, + + bIsDirty : false, + + $init : function(sInitialMode, oIRField, oDimension, fOnBeforeUnload, oAppContainer){ + this.sInitialMode = sInitialMode; + this.oIRField = $.$(oIRField); + this._assignHTMLObjects(oAppContainer); + this.fOnBeforeUnload = fOnBeforeUnload; + + this.oEditingMode = {}; + + this.elEditingAreaContainer.style.height = parseInt(oDimension.nHeight || this.elEditingAreaContainer.offsetHeight)+"px"; + + this.nMinHeight = oDimension.nMinHeight || 10; + this.niMinWidth = oDimension.nMinWidth || 10; + }, + + _assignHTMLObjects : function(oAppContainer){ + oAppContainer = $.$(oAppContainer) || document; + this.elEditingAreaContainer = $("DIV.xpress_xeditor_editing_area_container", oAppContainer).get(0); + this.elEditingAreaSkipUI = $("A.skip", oAppContainer).get(0); + }, + + $BEFORE_MSG_APP_READY : function(msg){ + this.oApp.exec("ADD_APP_PROPERTY", ["elEditingAreaContainer", this.elEditingAreaContainer]); + this.oApp.exec("ADD_APP_PROPERTY", ["getIR", $.fnBind(this.getIR, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["setIR", this.setIR]); + this.oApp.exec("ADD_APP_PROPERTY", ["getEditingMode", $.fnBind(this.getEditingMode, this)]); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.exec("CHANGE_EDITING_MODE", [this.sInitialMode, true]); + this.oApp.exec("LOAD_IR_FIELD", [false]); + + this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI, "focus", "MSG_EDITING_AREA_SIZE_CHANGED", [], 50); + this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI, "blur", "MSG_EDITING_AREA_SIZE_CHANGED", [], 50); + +// var fOnBeforeUnload = this.fOnBeforeUnload||function(){if(this.getIR() != this.oIRField.value || this.bIsDirty) return this.oApp.$MSG("XE_EditingAreaManager.onExit")}; +// $(window).bind("beforeunload", $.fnBind(fOnBeforeUnload, this)); + }, + + $AFTER_MSG_APP_READY : function(){ + this.oApp.exec("UPDATE_IR_FIELD", []); + }, + + $ON_LOAD_IR_FIELD : function(bDontAddUndo){ + this.oApp.setIR(this.oIRField.value, bDontAddUndo); + }, + + $ON_UPDATE_IR_FIELD : function(){ + this.oIRField.value = this.oApp.getIR(); + }, + + $BEFORE_CHANGE_EDITING_MODE : function(sMode){ + this._oPrevActivePlugin = this.oActivePlugin; + this.oActivePlugin = this.oEditingMode[sMode]; + }, + + $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ + if(this._oPrevActivePlugin){ + var sIR = this._oPrevActivePlugin.getIR(); + this.oApp.exec("SET_IR", [sIR]); + + this.oApp.exec("ENABLE_UI", [this._oPrevActivePlugin.sMode]); + + this._setEditingAreaDimension(); + } + this.oApp.exec("DISABLE_UI", [this.oActivePlugin.sMode]); + + if(!bNoFocus){ + this.oApp.exec("FOCUS", []); + } + }, + + $ON_SET_IS_DIRTY : function(bIsDirty){ + this.bIsDirty = bIsDirty; + }, + + $ON_FOCUS : function(){ + if(!this.oActivePlugin || typeof this.oActivePlugin.setIR != "function") return + + this.oActivePlugin.focus(); + }, + + $BEFORE_SET_IR : function(sIR, bDontAddUndoHistory){ + bDontAddUndoHistory = bDontAddUndoHistory || false; + if(!bDontAddUndoHistory) this.oApp.exec("RECORD_UNDO_ACTION", ["SET CONTENTS"]); + }, + + $ON_SET_IR : function(sIR){ + if(!this.oActivePlugin || typeof this.oActivePlugin.setIR != "function") return + + this.oActivePlugin.setIR(sIR); + }, + + $AFTER_SET_IR : function(sIR, bDontAddUndoHistory){ + bDontAddUndoHistory = bDontAddUndoHistory || false; + if(!bDontAddUndoHistory) this.oApp.exec("RECORD_UNDO_ACTION", ["SET CONTENTS"]); + }, + + $ON_REGISTER_EDITING_AREA : function(oEditingAreaPlugin){ + this.oEditingMode[oEditingAreaPlugin.sMode] = oEditingAreaPlugin; + this.attachDocumentEvents(oEditingAreaPlugin.oEditingArea); + }, + + $ON_MSG_EDITING_AREA_RESIZE_STARTED : function(){ + this.oActivePlugin.elEditingArea.style.display = "none"; + + this.iStartingHeight = parseInt(this.elEditingAreaContainer.style.height); + }, + + $ON_RESIZE_EDITING_AREA: function(ipNewWidth, ipNewHeight){ + var iNewWidth = parseInt(ipNewWidth); + var iNewHeight = parseInt(ipNewHeight); + + if(iNewWidth < this.niMinWidth) iNewWidth = this.niMinWidth; + if(iNewHeight < this.nMinHeight) iNewHeight = this.nMinHeight; + + if(ipNewWidth) this.elEditingAreaContainer.style.width = iNewWidth + "px"; + if(ipNewHeight) this.elEditingAreaContainer.style.height = iNewHeight + "px"; + }, + + $ON_RESIZE_EDITING_AREA_BY : function(ipWidthChange, ipHeightChange){ + var iWidthChange = parseInt(ipWidthChange); + var iHeightChange = parseInt(ipHeightChange); + + var iWidth = this.elEditingAreaContainer.style.width?parseInt(this.elEditingAreaContainer.style.width)+iWidthChange:null; + var iHeight = this.elEditingAreaContainer.style.height?this.iStartingHeight+iHeightChange:null; + + this.oApp.exec("RESIZE_EDITING_AREA", [iWidth, iHeight]); + }, + + $ON_MSG_EDITING_AREA_RESIZE_ENDED : function(FnMouseDown, FnMouseMove, FnMouseUp){ + this.oActivePlugin.elEditingArea.style.display = "block"; + this._setEditingAreaDimension(); + }, + + _setEditingAreaDimension : function(){ + this.oActivePlugin.elEditingArea.style.height = this.elEditingAreaContainer.style.height; + this.oActivePlugin.elEditingArea.style.width = this.elEditingAreaContainer.style.width; + }, + + attachDocumentEvents : function(doc){ + this.oApp.registerBrowserEvent(doc, "click", "EVENT_EDITING_AREA_CLICK"); + this.oApp.registerBrowserEvent(doc, "mousedown", "EVENT_EDITING_AREA_MOUSEDOWN"); + this.oApp.registerBrowserEvent(doc, "mousemove", "EVENT_EDITING_AREA_MOUSEMOVE"); + this.oApp.registerBrowserEvent(doc, "mouseup", "EVENT_EDITING_AREA_MOUSEUP"); + this.oApp.registerBrowserEvent(doc, "keydown", "EVENT_EDITING_AREA_KEYDOWN"); + this.oApp.registerBrowserEvent(doc, "keypress", "EVENT_EDITING_AREA_KEYPRESS"); + this.oApp.registerBrowserEvent(doc, "keyup", "EVENT_EDITING_AREA_KEYUP"); + }, + + getIR : function(){ + return this.oActivePlugin.getIR(); + }, + + setIR : function(sIR, bDontAddUndo){ + this.oApp.exec("SET_IR", [sIR, bDontAddUndo]); + }, + + getEditingMode : function(){ + return this.oActivePlugin.sMode; + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations directly related to editing the HTML source code using Textarea element + * @name hp_XE_EditingArea_HTMLSrc.js + * @required XE_EditingAreaManager + */ +xe.XE_EditingArea_HTMLSrc = $.Class({ + name : "XE_EditingArea_HTMLSrc", + + sMode : "HTMLSrc", + textarea : null, + + $init : function(textarea){ + this.textarea = $.$(textarea); + this.elEditingArea = this.textarea; + }, + + $BEFORE_MSG_APP_READY : function(){ + this.oEditingArea = this.textarea; + this.oApp.exec("REGISTER_EDITING_AREA", [this]); + }, + + $ON_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ + if(sMode == this.sMode){ + this.textarea.style.display = "block"; + }else{ + this.textarea.style.display = "none"; + } + }, + + $ON_PASTE_HTML : function(sHTML, oPSelection){ + if(this.oApp.getEditingMode() != this.sMode) return; + + var o = new TextRange(this.textarea); + o.paste(sHTML); + this.textarea.focus(); + }, + + getIR : function(){ + var sIR; + var sContent = this.textarea.value; + + if(this.oApp.applyConverter) + sIR = this.oApp.applyConverter(this.sMode+"_TO_IR", sContent); + else + sIR = sContent; + + return sIR; + }, + + setIR : function(sIR){ + var sContent; + + if(this.oApp.applyConverter) + sContent = this.oApp.applyConverter("IR_TO_"+this.sMode, sIR); + else + sContent = sIR; + + this.textarea.value = sContent; + }, + + focus : function(){ + this.textarea.focus(); + } +}); + +var TextRange = function(oEl) { + this._o = oEl; +}; + +/** + * Selection for textfield + * @author NHN (developer@xpressengine.com) + */ +TextRange.prototype.getSelection = function() { + var obj = this._o; + var ret = [ -1, -1 ]; + + if (isNaN(this._o.selectionStart)) { + obj.focus(); + + // textarea support added by nagoon97 + var range = document.body.createTextRange(); + var rangeField = null; + + rangeField = document.selection.createRange().duplicate(); + range.moveToElementText(obj); + rangeField.collapse(true); + range.setEndPoint("EndToEnd", rangeField); + ret[0] = range.text.length; + + rangeField = document.selection.createRange().duplicate(); + range.moveToElementText(obj); + rangeField.collapse(false); + range.setEndPoint("EndToEnd", rangeField); + ret[1] = range.text.length; + + obj.blur(); + } else { + ret[0] = obj.selectionStart; + ret[1] = obj.selectionEnd; + } + + return ret; +}; + +TextRange.prototype.setSelection = function(start, end) { + + var obj = this._o; + if (typeof end == 'undefined') end = start; + + if (obj.setSelectionRange) { + + obj.setSelectionRange(start, end); + + } else if (obj.createTextRange) { + + var range = obj.createTextRange(); + + range.collapse(true); + range.moveStart("character", start); + range.moveEnd("character", end - start); + range.select(); + + obj.blur(); + } + +}; + +TextRange.prototype.copy = function() { + + var r = this.getSelection(); + return this._o.value.substring(r[0], r[1]); + +}; + +TextRange.prototype.paste = function(sStr) { + + var obj = this._o; + var sel = this.getSelection(); + + var value = obj.value; + + var pre = value.substr(0, sel[0]); + var post = value.substr(sel[1]); + + value = pre + sStr + post; + obj.value = value; + + var n = 0; + if ( typeof document.body.style.maxHeight == "undefined" ) { + var a = pre.match( /\n/gi ); + n = ( a != null ? a.length : 0 ); + } + this.setSelection(sel[0] + sStr.length - n ); + +}; + +TextRange.prototype.cut = function() { + var r = this.copy(); + this.paste(''); + + return r; +}; +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations directly related to WYSIWYG iframe + * @name hp_XE_EditingArea_WYSIWYG.js + */ +xe.XE_EditingArea_WYSIWYG = $.Class({ + name : "XE_EditingArea_WYSIWYG", + status : xe.PLUGIN_STATUS["NOT_READY"], + + sMode : "WYSIWYG", + iframe : null, + doc : null, + + iLastUndoRecorded : 0, + iMinUndoInterval : 3000, + + _nIFrameReadyCount : 50, + + $init : function(iframe){ + this.iframe = $.$(iframe); + + this.initIframe(); + + this.elEditingArea = iframe; + }, + + $BEFORE_MSG_APP_READY : function(){ + this.oEditingArea = this.doc; + this.oApp.exec("REGISTER_EDITING_AREA", [this]); + this.oApp.exec("ADD_APP_PROPERTY", ["getWYSIWYGWindow", $.fnBind(this.getWindow, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["getWYSIWYGDocument", $.fnBind(this.getDocument, this)]); + }, + + $ON_MSG_APP_READY : function(){ + // uncomment this line if you wish to use the IE-style cursor in FF + // this.getDocument().body.style.cursor = "text"; + + if($.browser.msie){ + $(this.doc).bind('keydown', $.fnBind( + function(weEvent){ + if(this.doc.selection.type.toLowerCase() == 'control' && weEvent.keyCode == 8) { + this.oApp.exec("EXECCOMMAND", ['delete', false, false]); + weEvent.preventDefault(); weEvent.stopPropagation(); + } + } + , this)); + $(this.doc.body).bind('mousedown', $.fnBind( + function(weEvent){ + this._oIERange = null; + this._bIERangeReset = true; + } + , this)); + $(this.doc.body).bind('beforedeactivate', $.fnBind( + function(weEvent){ + // without this, cursor won't make it inside a table. + // mousedown(_oIERange gets reset) -> beforedeactivate(gets fired for table) -> RESTORE_IE_SELECTION + if(this._bIERangeReset) return; + + var tmpRange = this.getDocument().selection.createRange(0); + // Control range does not have parentElement + if(tmpRange.parentElement && tmpRange.parentElement() && tmpRange.parentElement().tagName == "INPUT"){ + this._oIERange = this._oPrevIERange; + }else{ + this._oIERange = tmpRange; + } + } + , this)); + $(this.doc.body).bind('mouseup', $.fnBind( + function(weEvent){ + this._bIERangeReset = false; + } + , this)); + } + }, + + $ON_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ + if(sMode == this.sMode){ + this.iframe.style.display = "block"; + + this.oApp.exec("REFRESH_WYSIWYG", []); + this.oApp.exec("SET_EDITING_WINDOW", [this.getWindow()]); + }else{ + this.iframe.style.display = "none"; + } + }, + + $AFTER_CHANGE_EDITING_MODE : function(sMode, bNoFocus){ + this._oIERange = null; + }, + + $ON_REFRESH_WYSIWYG : function(){ + if(!$.browser.mozilla) return; + + this._disableWYSIWYG(); + this._enableWYSIWYG(); + }, + + $ON_ENABLE_WYSIWYG : function(){ + this._enableWYSIWYG(); + }, + + $ON_DISABLE_WYSIWYG : function(){ + this._disableWYSIWYG(); + }, + + $ON_EVENT_EDITING_AREA_KEYDOWN : function(oEvent) { + // ctrl-left/right add/remove indent + if(!oEvent.ctrlKey) return; + + switch(oEvent.keyCode) { + // outdent + case 37 : + this.oApp.exec("EXECCOMMAND", ["outdent", false, false]); + break; + // indent + case 39 : + this.oApp.exec("EXECCOMMAND", ["indent", false, false]); + break; + // h1 ~ h6, normal + case 49 : + case 50 : + case 51 : + case 52 : + case 53 : + case 54 : + this.oApp.exec("EXECCOMMAND", ["FormatBlock", false, '']); + break; + default : + return; + } + oEvent.preventDefault(); oEvent.stopPropagation(); + + }, + + $ON_EVENT_EDITING_AREA_KEYUP : function(oEvent){ + // 33, 34: page up/down, 35,36: end/home, 37,38,39,40: left, up, right, down + if(oEvent.keyCode == 229 || oEvent.keyCode == 13 || oEvent.altKey || oEvent.ctrlKey || (oEvent.keyCode >= 33 && oEvent.keyCode <= 40) || oEvent.keyCode == 16) return; + this._recordUndo(oEvent); + }, + + $ON_PASTE_HTML : function(sHTML, oPSelection){ + if(this.oApp.getEditingMode() != this.sMode) return; + + var oSelection = oPSelection || this.oApp.getSelection(); + oSelection.pasteHTML(sHTML); + + // every browser except for IE may modify the innerHTML when it is inserted + if(!$.browser.msie){ + var sTmpBookmark = oSelection.placeStringBookmark(); + this.oApp.getWYSIWYGDocument().body.innerHTML = this.oApp.getWYSIWYGDocument().body.innerHTML; + oSelection.moveToBookmark(sTmpBookmark); + oSelection.collapseToEnd(); + oSelection.select(); + oSelection.removeStringBookmark(sTmpBookmark); + } + + this.oApp.exec("RECORD_UNDO_ACTION", ["INSERT HTML"]); + }, + + $AFTER_MSG_EDITING_AREA_RESIZE_ENDED : function(FnMouseDown, FnMouseMove, FnMouseUp){ + this.oApp.exec("REFRESH_WYSIWYG", []); + }, + + $ON_RESTORE_IE_SELECTION : function(){ + if(this._oIERange){ + this._oIERange.select(); + this._oPrevIERange = this._oIERange; + this._oIERange = null; + } + }, + + initIframe : function(){ + try { + this.doc = this.iframe.contentWindow.document; + if (this.doc == null || this.doc.location.href == 'about:blank') { + throw new Error('Access denied'); + } + + this._enableWYSIWYG(); + + this.status = xe.PLUGIN_STATUS["READY"]; + } catch(e) { + if(this._nIFrameReadyCount-- > 0){ + setTimeout($.fnBind(this.initIframe, this), 100); + }else{ + throw("iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). "); + } + } + }, + + getIR : function(){ + var sContent = this.doc.body.innerHTML; + var sIR; + + if(this.oApp.applyConverter) + sIR = this.oApp.applyConverter(this.sMode+"_TO_IR", sContent); + else + sIR = sContent; + + return sIR; + }, + + setIR : function(sIR){ + var sContent; + if(this.oApp.applyConverter) + sContent = this.oApp.applyConverter("IR_TO_"+this.sMode, sIR); + else + sContent = sIR; + + this.doc.body.innerHTML = sContent; + + if($.browser.mozilla){ + if(this.doc.body.innerHTML == "") this.doc.body.innerHTML = "
    "; + } + }, + + getWindow : function(){ + return this.iframe.contentWindow; + }, + + getDocument : function(){ + return this.iframe.contentWindow.document; + }, + + focus : function(){ + //this.getWindow().focus(); + //this.oApp.exec("RESTORE_IE_SELECTION", []); + }, + + _recordUndo : function(oKeyInfo){ + var curTime = new Date(); + if(curTime-this.iLastUndoRecorded < this.iMinUndoInterval) return; + this.oApp.exec("RECORD_UNDO_ACTION", ["KEYPRESS"]); + + this.iLastUndoRecorded = new Date(); + + this.prevKeyCode = oKeyInfo.keyCode; + }, + + _enableWYSIWYG : function(){ + if ($.browser.msie){ + this.doc.body.disabled = true; + this.doc.body.contentEditable = true; + this.doc.body.removeAttribute('disabled'); + } else { + this.doc.designMode = "on"; + } + }, + + _disableWYSIWYG : function(){ + if ($.browser.msie){ + this.doc.body.contentEditable = false; + } else { + this.doc.designMode = "off"; + } + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to resizing the editing area vertically + * @name hp_XE_EditingAreaVerticalResizer.js + */ +xe.XE_EditingAreaVerticalResizer = $.Class({ + name : "XE_EditingAreaVerticalResizer", + oResizeGrip : null, + + $init : function(oAppContainer){ + this._assignHTMLObjects(oAppContainer); + + this.$FnMouseDown = $.fnBind(this._mousedown, this); + this.$FnMouseMove = $.fnBind(this._mousemove, this); + this.$FnMouseUp = $.fnBind(this._mouseup, this); + + $(this.oResizeGrip).bind("mousedown", this.$FnMouseDown); + }, + + _assignHTMLObjects : function(oAppContainer){ + oAppContainer = $.$(oAppContainer) || document; + + this.oResizeGrip = $(".xpress_xeditor_editingArea_verticalResizer", oAppContainer).get(0); + }, + + _mousedown : function(oEvent){ + this.iStartHeight = oEvent.clientY; + + $(document).bind("mousemove", this.$FnMouseMove); + $(document).bind("mouseup", this.$FnMouseUp); + + this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]); + }, + + _mousemove : function(oEvent){ + var iHeightChange = oEvent.clientY - this.iStartHeight; + + this.oApp.exec("RESIZE_EDITING_AREA_BY", [0, iHeightChange]); + }, + + _mouseup : function(oEvent){ + $(document).unbind("mousemove", this.$FnMouseMove); + $(document).unbind("mouseup", this.$FnMouseUp); + + this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED", [this.$FnMouseDown, this.$FnMouseMove, this.$FnMouseUp]); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the basic editor commands + * @name hp_XE_ExecCommand.js + */ +xe.XE_ExecCommand = $.Class({ + name : "XE_ExecCommand", + oEditingArea : null, + + $init : function(oEditingArea){ + this.oEditingArea = oEditingArea; + }, + + $BEFORE_MSG_APP_READY : function(){ + // the right document will be available only when the src is completely loaded + if(this.oEditingArea && this.oEditingArea.tagName == "IFRAME") + this.oEditingArea = this.oEditingArea.contentWindow.document; + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+b", "EXECCOMMAND", ["bold", false, false]]); + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+u", "EXECCOMMAND", ["underline", false, false]]); + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+i", "EXECCOMMAND", ["italic", false, false]]); + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+d", "EXECCOMMAND", ["strikethrough", false, false]]); + + this.oApp.exec("REGISTER_UI_EVENT", ["bold", "click", "EXECCOMMAND", ["bold", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["underline", "click", "EXECCOMMAND", ["underline", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["italic", "click", "EXECCOMMAND", ["italic", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["lineThrough", "click", "EXECCOMMAND", ["strikethrough", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["superscript", "click", "EXECCOMMAND", ["superscript", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["subscript", "click", "EXECCOMMAND", ["subscript", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["justifyleft", "click", "EXECCOMMAND", ["justifyleft", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["justifycenter", "click", "EXECCOMMAND", ["justifycenter", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["justifyright", "click", "EXECCOMMAND", ["justifyright", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["justifyfull", "click", "EXECCOMMAND", ["justifyfull", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["orderedlist", "click", "EXECCOMMAND", ["insertorderedlist", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["unorderedlist", "click", "EXECCOMMAND", ["insertunorderedlist", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["outdent", "click", "EXECCOMMAND", ["outdent", false, false]]); + this.oApp.exec("REGISTER_UI_EVENT", ["indent", "click", "EXECCOMMAND", ["indent", false, false]]); + }, + + $BEFORE_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ + this._bOnlyCursorChanged = false; + + this.oApp.exec("FOCUS", []); + + if(sCommand.match(/^bold|underline|italic|strikethrough|superscript|subscript$/i)){ + var oSelection = this.oApp.getSelection(); + if(oSelection.collapsed) this._bOnlyCursorChanged = true; + } + + if(!this._bOnlyCursorChanged){ + this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", [sCommand]); + } + }, + + $ON_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ + bUserInterface = (bUserInterface == "" || bUserInterface)?bUserInterface:false; + vValue = (vValue == "" || vValue)?vValue:false; + + this.oEditingArea.execCommand(sCommand, bUserInterface, vValue); + }, + + $AFTER_EXECCOMMAND : function(sCommand, bUserInterface, vValue){ + if(!this._bOnlyCursorChanged){ + this.oApp.exec("RECORD_UNDO_AFTER_ACTION", [sCommand]); + } + + this.oApp.exec("CHECK_STYLE_CHANGE", []); + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to wrapping the sentence around with a

    tag when enter key is pressed + * @name hp_XE_WYSIWYGEnterKey.js + */ +xe.XE_WYSIWYGEnterKey = $.Class({ + name : "XE_WYSIWYGEnterKey", + // IE/Opera do not need this + unsupportedBrowser : ['ie', 'opera'], + oEditingArea : null, + + $init : function(oEditingArea){ + this.oEditingArea = oEditingArea; + }, + + $BEFORE_MSG_APP_READY : function(){ + // the right document will be available only when the src is completely loaded + if(this.oEditingArea && this.oEditingArea.tagName == "IFRAME") + this.oEditingArea = this.oEditingArea.contentWindow.document; + }, + + $ON_EVENT_EDITING_AREA_KEYDOWN : function(oEvent){ + if(this.oApp.getEditingMode() != "WYSIWYG") return; + + if(oEvent.shiftKey) return; + + if(oEvent.keyCode == 13){ + var oSelection = this.oApp.getSelection(); + var sBM = oSelection.placeStringBookmark(); + var oLineInfo = oSelection.getLineInfo(); + var oStart = oLineInfo.oStart; + var oEnd = oLineInfo.oEnd; + + //top.document.title = oStart.oNode.tagName+":"+oStart.oNode.nodeValue+", "+oEnd.oNode.tagName+":"+oEnd.oNode.nodeValue+"::"+oStart.bParentBreak+", "+oStart.oLineBreaker.tagName; + + // line broke by sibling + // or + // the parent line breaker is just a block container + if(!oStart.bParentBreak || oSelection.rxBlockContainer.test(oStart.oLineBreaker.tagName)){ + oEvent.stopPropagation(); + oEvent.preventDefault(); + + var oSWrapper = this.oEditingArea.createElement("P"); + oSelection.moveToBookmark(sBM); + oSelection.setStartBefore(oStart.oNode); + oSelection.surroundContents(oSWrapper); + + oSelection.collapseToEnd(); + + var oEWrapper = this.oEditingArea.createElement("P"); + oSelection.setEndAfter(oEnd.oNode); + oSelection.surroundContents(oEWrapper); + + oSelection.removeStringBookmark(sBM); + + if(oSWrapper.innerHTML == "") oSWrapper.innerHTML = "
    "; + if(oEWrapper.innerHTML == "") oEWrapper.innerHTML = "
    "; + + if(oEWrapper.nextSibling && oEWrapper.nextSibling.tagName == "BR") oEWrapper.parentNode.removeChild(oEWrapper.nextSibling); + + oSelection.selectNodeContents(oEWrapper); + oSelection.collapseToStart(); + oSelection.select(); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }else{ + oSelection.removeStringBookmark(sBM); + } + } + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to styling the font + * @name hp_XE_WYSIWYGStyler.js + * @required XE_EditingArea_WYSIWYG, XpressRangeManager + */ +xe.XE_WYSIWYGStyler = $.Class({ + name : "XE_WYSIWYGStyler", + + $PRECONDITION : function(sFullCommand, aArgs){ + return (this.oApp.getEditingMode() == "WYSIWYG"); + }, + + $ON_SET_WYSIWYG_STYLE : function(oStyles){ + var oSelection = this.oApp.getSelection(); + + // style cursor + if(oSelection.collapsed){ + var oSpan = this.oApp.getWYSIWYGDocument().createElement("SPAN"); + oSelection.insertNode(oSpan); + oSpan.innerHTML = unescape("%uFEFF"); + + var sValue; + for(var sName in oStyles){ + sValue = oStyles[sName]; + + if(typeof sValue != "string") continue; + + oSpan.style[sName] = sValue; + } + + oSelection.selectNodeContents(oSpan); + oSelection.collapseToEnd(); + oSelection._window.focus(); + oSelection._window.document.body.focus(); + oSelection.select(); + + // FF3 will actually display %uFEFF when it is followed by a number AND certain font-family is used(like Gulim), so remove the chcaracter for FF3 + if($.browser.mozilla && $.browser.nVersion == 3) + oSpan.innerHTML = ""; + + return; + } + + this.oApp.exec("RECORD_UNDO_BEFORE_ACTION", ["FONT STYLE"]); + + oSelection.styleRange(oStyles); + oSelection._window.focus(); + oSelection.select(); + + this.oApp.exec("RECORD_UNDO_AFTER_ACTION", ["FONT STYLE"]); + } +}); +//} + +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to detecting the style change + * @name hp_XE_WYSIWYGStyleGetter.js + */ +xe.XE_WYSIWYGStyleGetter = $.Class({ + name : "XE_WYSIWYGStyleGetter", + + hKeyUp : null, + + getStyleInterval : 200, + + oStyleMap : { + fontFamily : { + type : "Value", + css : "fontFamily" + }, + fontSize : { + type : "Value", + css : "fontSize" + }, + lineHeight : { + type : "Value", + css : "lineHeight", + converter : function(sValue, oStyle){ + if(!sValue.match(/px$/)) return sValue; + + return Math.ceil((parseInt(sValue)/parseInt(oStyle.fontSize))*10)/10; + } + }, + bold : { + command : "bold" + }, + underline : { + command : "underline" + }, + italic : { + command : "italic" + }, + lineThrough : { + command : "strikethrough" + }, + superscript : { + command : "superscript" + }, + subscript : { + command : "subscript" + }, + justifyleft : { + command : "justifyleft" + }, + justifycenter : { + command : "justifycenter" + }, + justifyright : { + command : "justifyright" + }, + justifyfull : { + command : "justifyfull" + }, + orderedlist : { + command : "insertorderedlist" + }, + unorderedlist : { + command : "insertunorderedlist" + } + }, + + $init : function(){ + this.oStyle = this._getBlankStyle(); + }, + + $PRECONDITION : function(){ + if(this.oApp.getEditingMode() != "WYSIWYG") return false; + + return true; + }, + + $ON_MSG_APP_READY : function(){ + this.oDocument = this.oApp.getWYSIWYGDocument(); + this.oApp.exec("ADD_APP_PROPERTY", ["getCurrentStyle", $.fnBind(this.getCurrentStyle, this)]); + }, + + $ON_EVENT_EDITING_AREA_MOUSEUP : function(oEvnet){ + if(this.hKeyUp) clearTimeout(this.hKeyUp); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }, + + $ON_EVENT_EDITING_AREA_KEYUP : function(oEvent){ + /* + backspace 8 + page up 33 + page down 34 + end 35 + home 36 + left arrow 37 + up arrow 38 + right arrow 39 + down arrow 40 + insert 45 + delete 46 + */ + if(!(oEvent.keyCode == 8 || (oEvent.keyCode >= 33 && oEvent.keyCode <= 40) || oEvent.keyCode == 45 || oEvent.keyCode == 46)) return; + + if(this.hKeyUp) clearTimeout(this.hKeyUp); + + this.hKeyUp = setTimeout($.fnBind(this.oApp.exec, this.oApp, "CHECK_STYLE_CHANGE", []), this.getStyleInterval); + }, + + $ON_CHECK_STYLE_CHANGE : function(){ + this._getStyle(); + }, + + $ON_RESET_STYLE_STATUS : function(){ + var oBlankStyle = this._getBlankStyle(); + for(var sAttributeName in oBlankStyle) + this.oApp.exec("SET_STYLE_STATUS", [sAttributeName, oBlankStyle[sAttributeName]]); + }, + + getCurrentStyle : function(){ + return this.oStyle; + }, + + _check_style_change : function(){ + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }, + + _getBlankStyle : function(){ + var oBlankStyle = {}; + for(var attributeName in this.oStyleMap){ + if(this.oStyleMap[attributeName].type == "Value") + oBlankStyle[attributeName] = ""; + else + oBlankStyle[attributeName] = 0; + } + + return oBlankStyle; + }, + + _getStyle : function(){ + var oSelection = this.oApp.getSelection(); + + var funcFilter = function(oNode){ + if (!oNode.childNodes || oNode.childNodes.length == 0) + return true; + else + return false; + } + + var aBottomNodes = oSelection.getNodes(false, funcFilter); + + var oStyle, oBaseStyle, oTmpStyle, attributeName; + if(aBottomNodes.length == 0){ + oStyle = this._getStyleOf(oSelection.commonAncestorContainer); + }else{ + oStyle = this._getStyleOf(aBottomNodes[0]); + } + + for(attributeName in oStyle){ + if(this.oStyleMap[attributeName].converter){ + oStyle[attributeName] = this.oStyleMap[attributeName].converter(oStyle[attributeName], oStyle); + } + + if(this.oStyle[attributeName] != oStyle[attributeName]) + this.oApp.exec("MSG_STYLE_CHANGED", [attributeName, oStyle[attributeName]]); + } + + this.oStyle = oStyle; + }, + + _getStyleOf : function(oNode){ + var oStyle = this._getBlankStyle(); + + // this must not happen + if(!oNode) return oStyle; + + if(oNode.nodeType == 3) oNode = oNode.parentNode; + + var welNode = $(oNode); + var attribute, cssName; + for(var styleName in this.oStyle){ + attribute = this.oStyleMap[styleName]; + + if(attribute.type && attribute.type == "Value"){ + if(attribute.css){ + var sValue = welNode.css(attribute.css); + + if(styleName == "fontFamily"){ + sValue = sValue.split(/,/)[0]; + } + + oStyle[styleName] = sValue; + }else{ + if(attribute.command){ + try{ + oStyle[styleName] = this.oDocument.queryCommandState(attribute.command); + }catch(e){} + }else{ + // todo + } + } + }else{ + if(attribute.command){ + try{ + if(this.oDocument.queryCommandState(attribute.command)){ + oStyle[styleName] = 1; + }else{ + oStyle[styleName] = 0; + } + }catch(e){} + }else{ + // todo + } + } + } + return oStyle; + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to changing the font size using Select element + * @name hp_XE_FontSizeWithSelectUI.js + */ +xe.XE_FontSizeWithSelectUI = $.Class({ + name : "XE_FontSizeWithSelectUI", + + $init : function(elAppContainer){ + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer){ + this.elFontSizeSelect = $("SELECT.xpress_xeditor_ui_fontSize_select", elAppContainer).get(0); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.elFontSizeSelect, "change", "SET_FONTSIZE_FROM_SELECT_UI"); + this.elFontSizeSelect.selectedIndex = 0; + }, + + $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ + if(sAttributeName == "fontSize"){ + this.elFontSizeSelect.value = sAttributeValue; + if(this.elFontSizeSelect.selectedIndex < 0) this.elFontSizeSelect.selectedIndex = 0; + } + }, + + $ON_SET_FONTSIZE_FROM_SELECT_UI : function(){ + var sFontSize = this.elFontSizeSelect.value; + if(!sFontSize) return; + + this.oApp.exec("SET_WYSIWYG_STYLE", [{"fontSize":sFontSize}]); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to changing the font name using Select element + * @name hp_XE_FontNameWithSelectUI.js + */ +xe.XE_FontNameWithSelectUI = $.Class({ + name : "XE_FontNameWithSelectUI", + + $init : function(elAppContainer){ + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer){ + this.elFontNameSelect = $("SELECT.xpress_xeditor_ui_fontName_select", elAppContainer).get(0); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.elFontNameSelect, "change", "SET_FONTNAME_FROM_SELECT_UI"); + this.elFontNameSelect.selectedIndex = 0; + }, + + $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ + if(sAttributeName == "fontFamily"){ + this.elFontNameSelect.value = sAttributeValue.toLowerCase(); + if(this.elFontNameSelect.selectedIndex < 0) this.elFontNameSelect.selectedIndex = 0; + } + }, + + $ON_SET_FONTNAME_FROM_SELECT_UI : function(){ + var sFontName = this.elFontNameSelect.value; + if(!sFontName) return; + + this.oApp.exec("SET_WYSIWYG_STYLE", [{"fontFamily":sFontName}]); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to setting/changing the lineheight + * @name hp_XE_LineHeight.js + */ +xe.XE_LineHeight = $.Class({ + name : "XE_LineHeight", + + $init : function(oAppContainer){ + this._assignHTMLObjects(oAppContainer); + }, + + _assignHTMLObjects : function(oAppContainer){ + }, + + $ON_SET_LINEHEIGHT : function(nLineHeight){ + this.setLineHeight(nLineHeight); + }, + + getLineHeight : function(){ + var nodes = this._getSelectedNodes(false); + + var curWrapper, prevWrapper; + var iCurHeight, iHeight; + + if(nodes.length == 0) return -1; + + var iLength = nodes.length; + + if(iLength == 0){ + iHeight = -1; + }else{ + prevWrapper = this._getLineWrapper(nodes[0]); + iHeight = this._getWrapperLineheight(prevWrapper); + } + + var firstNode = this.oSelection.getStartNode(); + + if(iHeight > 0){ + for(var i=1; i=0; i--){ + if(aNodes[i].nodeType == 3 || aNodes[i].tagName == "BR"){ + var oP = oSelection._document.createElement("P"); + oInsertionPoint = aNodes[i].nextSibling; + while(i>=0 && aNodes[i] && (aNodes[i].nodeType == 3 || aNodes[i].tagName == "BR")){ + oP.insertBefore(aNodes[i--], oP.firstChild); + } + oFormattingNode.insertBefore(oP, oInsertionPoint); + i++; + } + } + + if(oFormattingNode && oFormattingNode.parentNode){ + var oP = oSelection._document.createElement("P"); + oP.innerHTML = unescape("
    "); + oFormattingNode.parentNode.insertBefore(oP, oFormattingNode.nextSibling); + } + + this.oApp.exec("RECORD_UNDO_ACTION", ["Block Quote"]); + + return oFormattingNode; + }, + + _expandToTableStart : function(oSelection, oNode){ + var oC = oSelection.commonAncestorContainer; + var oResultNode = null; + + var bLastIteration = false; + while(oNode && !bLastIteration){ + if(oNode == oC) bLastIteration = true; + + if(/TBODY|TFOOT|THEAD|TR/i.test(oNode.tagName)){ + oResultNode = this._getTableRoot(oNode); + break; + } + oNode = oNode.parentNode; + } + + return oResultNode; + }, + + _getTableRoot : function(oNode){ + while(oNode && oNode.tagName != "TABLE") oNode = oNode.parentNode; + + return oNode; + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to inserting special characters + * @name hp_XE_SCharacter.js + * @required XpressRangeManager + */ +xe.XE_SCharacter = $.Class({ + name : "XE_SCharacter", + + $init : function(oAppContainer){ + this.bIE = $.browser.msie; + + this._assignHTMLObjects(oAppContainer); + + this.charSet = []; + this.charSet[0] = unescape('FF5B FF5D 3014 3015 3008 3009 300A 300B 300C 300D 300E 300F 3010 3011 2018 2019 201C 201D 3001 3002 %B7 2025 2026 %A7 203B 2606 2605 25CB 25CF 25CE 25C7 25C6 25A1 25A0 25B3 25B2 25BD 25BC 25C1 25C0 25B7 25B6 2664 2660 2661 2665 2667 2663 2299 25C8 25A3 25D0 25D1 2592 25A4 25A5 25A8 25A7 25A6 25A9 %B1 %D7 %F7 2260 2264 2265 221E 2234 %B0 2032 2033 2220 22A5 2312 2202 2261 2252 226A 226B 221A 223D 221D 2235 222B 222C 2208 220B 2286 2287 2282 2283 222A 2229 2227 2228 FFE2 21D2 21D4 2200 2203 %B4 FF5E 02C7 02D8 02DD 02DA 02D9 %B8 02DB %A1 %BF 02D0 222E 2211 220F 266D 2669 266A 266C 327F 2192 2190 2191 2193 2194 2195 2197 2199 2196 2198 321C 2116 33C7 2122 33C2 33D8 2121 2668 260F 260E 261C 261E %B6 2020 2021 %AE %AA %BA 2642 2640').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[1] = unescape('%BD 2153 2154 %BC %BE 215B 215C 215D 215E %B9 %B2 %B3 2074 207F 2081 2082 2083 2084 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 FFE6 %24 FFE5 FFE1 20AC 2103 212B 2109 FFE0 %A4 2030 3395 3396 3397 2113 3398 33C4 33A3 33A4 33A5 33A6 3399 339A 339B 339C 339D 339E 339F 33A0 33A1 33A2 33CA 338D 338E 338F 33CF 3388 3389 33C8 33A7 33A8 33B0 33B1 33B2 33B3 33B4 33B5 33B6 33B7 33B8 33B9 3380 3381 3382 3383 3384 33BA 33BB 33BC 33BD 33BE 33BF 3390 3391 3392 3393 3394 2126 33C0 33C1 338A 338B 338C 33D6 33C5 33AD 33AE 33AF 33DB 33A9 33AA 33AB 33AC 33DD 33D0 33D3 33C3 33C9 33DC 33C6').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[2] = unescape('3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[3] = unescape('3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[4] = unescape('0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F 03A0 03A1 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF 03C0 03C1 03C3 03C4 03C5 03C6 03C7 03C8 03C9 %C6 %D0 0126 0132 013F 0141 %D8 0152 %DE 0166 014A %E6 0111 %F0 0127 I 0133 0138 0140 0142 0142 0153 %DF %FE 0167 014B 0149 0411 0413 0414 0401 0416 0417 0418 0419 041B 041F 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F 0431 0432 0433 0434 0451 0436 0437 0438 0439 043B 043F 0444 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + this.charSet[5] = unescape('3041 3042 3043 3044 3045 3046 3047 3048 3049 304A 304B 304C 304D 304E 304F 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 305A 305B 305C 305D 305E 305F 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 306A 306B 306C 306D 306E 306F 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 307A 307B 307C 307D 307E 307F 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 308A 308B 308C 308D 308E 308F 3090 3091 3092 3093 30A1 30A2 30A3 30A4 30A5 30A6 30A7 30A8 30A9 30AA 30AB 30AC 30AD 30AE 30AF 30B0 30B1 30B2 30B3 30B4 30B5 30B6 30B7 30B8 30B9 30BA 30BB 30BC 30BD 30BE 30BF 30C0 30C1 30C2 30C3 30C4 30C5 30C6 30C7 30C8 30C9 30CA 30CB 30CC 30CD 30CE 30CF 30D0 30D1 30D2 30D3 30D4 30D5 30D6 30D7 30D8 30D9 30DA 30DB 30DC 30DD 30DE 30DF 30E0 30E1 30E2 30E3 30E4 30E5 30E6 30E7 30E8 30E9 30EA 30EB 30EC 30ED 30EE 30EF 30F0 30F1 30F2 30F3 30F4 30F5 30F6').replace(/(\S{4})/g, function(a){return "%u"+a}).split(' '); + }, + + _assignHTMLObjects : function(oAppContainer){ + oAppContainer = $.$(oAppContainer) || document; + + this.elDropdownLayer = $("DIV.xpress_xeditor_sCharacter_layer", oAppContainer).get(0); + + this.oTextField = $("INPUT", this.elDropdownLayer).get(0); + this.oInsertButton = $("+ BUTTON", this.oTextField).get(0); + this.aCloseButton = $("BUTTON.close", this.elDropdownLayer).get(); + this.aSCharList = $(".list", this.elDropdownLayer).get(); + var oLabelUL = $(">UL", this.elDropdownLayer).get(0); + this.aLabelA = $("A", oLabelUL).get(); + }, + + $ON_MSG_APP_READY : function(){ + var funcInsert = $.fnBind(this.oApp.exec, this.oApp, "INSERT_SCHARACTERS", [this.oTextField.value]); + $(this.oInsertButton).click(funcInsert, this); + + this.oApp.exec("SET_SCHARACTER_LIST", [this.charSet]); + + for(var i=0; i'; + this.aSCharList[i].appendChild(aLI[ii]); + } + + // enable this after Jindo framework is updated +// this.oApp.exec("ATTACH_HOVER_EVENTS", [$(">LI>BUTTON", this.aSCharList[i])]).get(); + }, + + _stopBrowserEvent : function(obj, sEvent){ + $(obj).bind(sEvent, function(e){e.stopPropagation();e.preventDefault();} ) + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to Undo/Redo + * @name hp_XE_UndoRedo.js + * @required XE_EditingAreaManager, XpressRangeManager + */ +xe.XE_UndoRedo = $.Class({ + name : "XE_UndoRedo", + actionHistory : null, + // this may also be called, lastAdded/lastRestored + oCurStateIdx : null, + iMinimumSizeChange : 10, + sBlankContentsForFF : "
    ", + + $init : function(){ + this.aUndoHistory = []; + this.oCurStateIdx = {nIdx: 0, nStep: 0}; + }, + + $PRECONDITION : function(sCmd){ + if(sCmd.match(/_DO_RECORD_UNDO_HISTORY_AT$/)) return true; + + try{ + if(this.oApp.getEditingMode() != "WYSIWYG") return false; + }catch(e){ + return false; + } + + return true; + }, + + $BEFORE_MSG_APP_READY : function(){ + this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT", [this.oCurStateIdx, "", "", null]); + }, + + $ON_MSG_APP_READY : function(){ + this.bFF = $.browser.mozilla; + + this.oApp.exec("ADD_APP_PROPERTY", ["getUndoHistory", $.fnBind(this.getUndoHistory, this)]); + this.oApp.exec("ADD_APP_PROPERTY", ["getUndoStateIdx", $.fnBind(this.getUndoStateIdx, this)]); + + this.oApp.exec("REGISTER_UI_EVENT", ["undo", "click", "UNDO"]); + this.oApp.exec("REGISTER_UI_EVENT", ["redo", "click", "REDO"]); + + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+z", "UNDO"]); + this.oApp.exec("REGISTER_HOTKEY", ["ctrl+y", "REDO"]); + }, + + $ON_UNDO : function(){ + var oTmpStateIdx = {}; + this.oApp.exec("DO_RECORD_UNDO_HISTORY", ["KEYPRESS", false, false, 1]); + if(this.oCurStateIdx.nIdx == 0) return; + + if(this.oCurStateIdx.nStep > 0){ + this.oCurStateIdx.nStep--; + }else{ + var oTmpHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + + this.oCurStateIdx.nIdx--; + + if(oTmpHistory.nTotalSteps>1){ + this.oCurStateIdx.nStep = 0; + }else{ + oTmpHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + this.oCurStateIdx.nStep = oTmpHistory.nTotalSteps-1; + } + } + + this.oApp.exec("RESTORE_UNDO_HISTORY", [this.oCurStateIdx.nIdx, this.oCurStateIdx.nStep]); + + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }, + + + $ON_REDO : function(){ + if(this.oCurStateIdx.nIdx >= this.aUndoHistory.length) return; + + var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + if(this.oCurStateIdx.nIdx == this.aUndoHistory.length-1 && this.oCurStateIdx.nStep >= oCurHistory.nTotalSteps-1) return; + + if(this.oCurStateIdx.nStep < oCurHistory.nTotalSteps-1){ + this.oCurStateIdx.nStep++; + }else{ + this.oCurStateIdx.nIdx++; + oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + this.oCurStateIdx.nStep = oCurHistory.nTotalSteps-1; + } + + this.oApp.exec("RESTORE_UNDO_HISTORY", [this.oCurStateIdx.nIdx, this.oCurStateIdx.nStep]); + + this.oApp.exec("CHECK_STYLE_CHANGE", []); + }, + + $ON_RECORD_UNDO_ACTION : function(sAction){ + this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction]); + }, + + $ON_RECORD_UNDO_BEFORE_ACTION : function(sAction){ + this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction, true, true]); + }, + + $ON_RECORD_UNDO_AFTER_ACTION : function(sAction){ + this.oApp.exec("DO_RECORD_UNDO_HISTORY", [sAction, true, false]); + }, + + $ON_RESTORE_UNDO_HISTORY : function(nUndoIdx, nUndoStateStep){ + this.oCurStateIdx.nIdx = nUndoIdx; + this.oCurStateIdx.nStep = nUndoStateStep; + + var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + var sContent = oCurHistory.sContent[this.oCurStateIdx.nStep]; + var oBookmark = oCurHistory.oBookmark[this.oCurStateIdx.nStep]; + + this.oApp.setIR(sContent, true); + + // setting the innerHTML may change the internal DOM structure, so save the value again. + var sCurContent = this.oApp.getIR(); + if(this.bFF && sCurContent == this.sBlankContentsForFF){ + sCurContent = ""; + } + oCurHistory.sContent[this.oCurStateIdx.nStep] = sCurContent; + + var oSelection = this.oApp.getEmptySelection(); + if(oSelection.selectionLoaded){ + if(oBookmark){ + oSelection.moveToXPathBookmark(oBookmark); + }else{ + oSelection = this.oApp.getEmptySelection(); + } + + oSelection.select(); + } + }, + + $ON_DO_RECORD_UNDO_HISTORY : function(sAction, bTwoStepAction, bBeforeAction, nForceAddUnlessEqual){ + bTwoStepAction = bTwoStepAction || false; + bBeforeAction = bBeforeAction || false; + nForceAddUnlessEqual = nForceAddUnlessEqual || 0; + + // if we're in the middle of some action history, remove everything after current idx if any "little" change is made + if(!(this.oCurStateIdx.nIdx == this.aUndoHistory.length-1)) nForceAddUnlessEqual = 1; + + var oCurHistory = this.aUndoHistory[this.oCurStateIdx.nIdx]; + + var sCurContent = this.oApp.getIR(); + var sHistoryContent = oCurHistory.sContent[this.oCurStateIdx.nStep]; + + if(this.bFF && sCurContent == this.sBlankContentsForFF){ + sCurContent = ""; + } + + // every TwoStepAction needs to be recorded + if(!bTwoStepAction){ + switch(nForceAddUnlessEqual){ + case 0: + if(Math.abs(sHistoryContent.length - sCurContent.length)" + sURL + ""; + this.oSelection.pasteHTML(str); + }else{ + var nSession = Math.ceil(Math.random()*10000); + var sMarker = this.sATagMarker+nSession; + var arg = ( sURL == "" ? ["unlink"] : ["createLink", false, sMarker+sURL] ); + this.oApp.exec("EXECCOMMAND", arg); + + try { this.oSelection.setFromSelection() }catch(e){}; + var oDoc = this.oApp.getWYSIWYGDocument(); + $(oDoc.body.getElementsByTagName("A")) + .filter('[href^="'+sMarker+'"]') + .attr('href', function(){ + var rx = new RegExp('^'+sMarker.replace(/([\.\\])/g, '\\$1'), 'i'); + + if (sTarget) $(this).attr('target', sTarget); + else $(this).removeAttr('target'); + + return this.href.replace(rx, ''); + }); + } + this.oApp.exec("HIDE_ACTIVE_LAYER"); + + setTimeout($.fnBind(function(){try{this.oSelection.select()}catch(e){}}, this), 0); + }, + + _validateURL : function(sURL){ + return /^(http|https|ftp|mailto):(?:\/\/)?((\w|-)+(?:[\.:@](\w|-))+)(?:\/|@)?([^"\?]*?)(?:\?([^\?"]*?))?$/.test(sURL); + }, + + $ON_EVENT_XE_HYPERLINK_KEYDOWN : function(oEvent){ + if (oEvent.keyCode == 13){ + this.oApp.exec("XE_APPLY_HYPERLINK"); + oEvent.preventDefault(); oEvent.stopPropagation(); + } + } +}); +//} +//{ +/** + * @fileOverview This file contains Xpress plugin that takes care of the operations related to table creation + * @name hp_XE_Table.js + */ +xe.XE_Table = $.Class({ + name : "XE_Table", + iMinRows : 1, + iMaxRows : 20, + + iMinColumns : 1, + iMaxColumns : 10, + + iMinBorderWidth : 1, + iMaxBorderWidth : 10, + + oSelection : null, + + $init : function(oAppContainer){ + this._assignHTMLObjects(oAppContainer); + }, + + _assignHTMLObjects : function(oAppContainer){ + var tmp = null; + + this.elDropdownLayer = $("DIV.xpress_xeditor_table_layer", oAppContainer).get(0); + this.welDropdownLayer = $(this.elDropdownLayer); + + tmp = $("INPUT", this.elDropdownLayer).get(); + this.oRowInput = tmp[0]; + this.oColumnInput = tmp[1]; + this.oBorderWidthInput = tmp[2]; + this.oBorderColorInput = tmp[3]; + this.oBGColorInput = tmp[4]; + + tmp = $("BUTTON", this.elDropdownLayer).get(); + this.oButton_AddRow = tmp[0]; + this.oButton_RemoveRow = tmp[1]; + this.oButton_AddColumn = tmp[2]; + this.oButton_RemoveColumn = tmp[3]; + this.oButton_IncBorderWidth = tmp[4]; + this.oButton_DecBorderWidth = tmp[5]; + this.oButton_BorderColorPreview = tmp[6]; + this.oButton_BorderColor = tmp[7]; + this.oButton_BGColorPreview = tmp[8]; + this.oButton_BGColor = tmp[9]; + this.oButton_Insert = tmp[10]; + this.oButton_Cancel = tmp[11]; + + this.oSampleTable = $("TABLE", this.elDropdownLayer).get(0); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.exec("REGISTER_UI_EVENT", ["table", "click", "ST_TOGGLE_TOOLBAR_LAYER"]); + + this.oApp.registerBrowserEvent(this.oRowInput, "change", "ST_SET_ROW_NUM", [null, 0]); + this.oApp.registerBrowserEvent(this.oColumnInput, "change", "ST_SET_COLUMN_NUM", [null, 0]); + this.oApp.registerBrowserEvent(this.oBorderWidthInput, "change", "ST_SET_BORDER_WIDTH", [null, 0]); + + this.oApp.registerBrowserEvent(this.oButton_AddRow, "click", "ST_ADD_ROW"); + this.oApp.registerBrowserEvent(this.oButton_RemoveRow, "click", "ST_REMOVE_ROW"); + this.oApp.registerBrowserEvent(this.oButton_AddColumn, "click", "ST_ADD_COLUMN"); + this.oApp.registerBrowserEvent(this.oButton_RemoveColumn, "click", "ST_REMOVE_COLUMN"); + + this.oApp.registerBrowserEvent(this.oButton_IncBorderWidth, "click", "ST_INC_BORDER_WIDTH"); + this.oApp.registerBrowserEvent(this.oButton_DecBorderWidth, "click", "ST_DEC_BORDER_WIDTH"); + + this.oApp.registerBrowserEvent(this.oButton_BorderColorPreview, "click", "ST_TOGGLE_BORDER_COLOR_LAYER"); + this.oApp.registerBrowserEvent(this.oButton_BGColorPreview, "click", "ST_TOGGLE_BGCOLOR_LAYER"); + + this.oApp.registerBrowserEvent(this.oButton_BorderColor, "click", "ST_TOGGLE_BORDER_COLOR_LAYER"); + this.oApp.registerBrowserEvent(this.oButton_BGColor, "click", "ST_TOGGLE_BGCOLOR_LAYER"); + + this.oApp.registerBrowserEvent(this.oButton_Insert, "click", "ST_INSERT_TABLE"); + this.oApp.registerBrowserEvent(this.oButton_Cancel, "click", "ST_CLOSE"); + + this.oApp.exec("ST_SET_BORDER_COLOR", ["#CCCCCC"]); + this.oApp.exec("ST_SET_BGCOLOR", ["#FFFFFF"]); + }, + + $ON_ST_TOGGLE_TOOLBAR_LAYER : function(){ + this.oApp.exec("RECORD_UNDO_ACTION_FORCED", ["KEYPRESS"]); + + this._showNewTable(); + this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER", [this.elDropdownLayer]); + }, + + $ON_ST_ADD_ROW : function(){ + this.oApp.exec("ST_SET_ROW_NUM", [null, 1]); + }, + + $ON_ST_REMOVE_ROW : function(){ + this.oApp.exec("ST_SET_ROW_NUM", [null, -1]); + }, + + $ON_ST_ADD_COLUMN : function(){ + this.oApp.exec("ST_SET_COLUMN_NUM", [null, 1]); + }, + + $ON_ST_REMOVE_COLUMN : function(){ + this.oApp.exec("ST_SET_COLUMN_NUM", [null, -1]); + }, + + $ON_ST_SET_ROW_NUM : function(iRows, iRowDiff){ + iRows = iRows || parseInt(this.oRowInput.value); + iRowDiff = iRowDiff || 0; + + iRows += iRowDiff; + + if(iRows < this.iMinRows) iRows = this.iMinRows; + if(iRows > this.iMaxRows) iRows = this.iMaxRows; + + this.oRowInput.value = iRows; + this._showNewTable(); + }, + + $ON_ST_SET_COLUMN_NUM : function(iColumns, iColumnDiff){ + iColumns = iColumns || parseInt(this.oColumnInput.value); + iColumnDiff = iColumnDiff || 0; + + iColumns += iColumnDiff; + + if(iColumns < this.iMinColumns) iColumns = this.iMinColumns; + if(iColumns > this.iMaxColumns) iColumns = this.iMaxColumns; + + this.oColumnInput.value = iColumns; + this._showNewTable(); + }, + + $ON_ST_INSERT_TABLE : function(){ + var sTable = this._getTableString(); + + this.oApp.exec("PASTE_HTML", [sTable]); + + this.oApp.exec("ST_CLOSE", []); + }, + + $ON_ST_CLOSE : function(){ + this.oApp.exec("HIDE_ACTIVE_LAYER", []); + }, + + $ON_ST_SET_BORDER_WIDTH : function(iBorderWidth, iBorderWidthDiff){ + iBorderWidth = iBorderWidth || parseInt(this.oBorderWidthInput.value); + iBorderWidthDiff = iBorderWidthDiff || 0; + + iBorderWidth += iBorderWidthDiff; + + if(iBorderWidth < this.iMinBorderWidth) iBorderWidth = this.iMinBorderWidth; + if(iBorderWidth > this.iMaxBorderWidth) iBorderWidth = this.iMaxBorderWidth; + + this.oBorderWidthInput.value = iBorderWidth; + this._showNewTable(); + }, + + $ON_ST_INC_BORDER_WIDTH : function(){ + this.oApp.exec("ST_SET_BORDER_WIDTH", [null, 1]); + }, + + $ON_ST_DEC_BORDER_WIDTH : function(){ + this.oApp.exec("ST_SET_BORDER_WIDTH", [null, -1]); + }, + + $ON_ST_TOGGLE_BORDER_COLOR_LAYER : function(){ + if(this.welDropdownLayer.hasClass("p1")) + this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER", []); + else + this.oApp.exec("ST_SHOW_BORDER_COLOR_LAYER", []); + }, + + $ON_ST_SHOW_BORDER_COLOR_LAYER : function(){ + this.welDropdownLayer.addClass("p1"); + this.welDropdownLayer.removeClass("p2"); + + this.oApp.exec("SHOW_COLOR_PALETTE", ["ST_SET_BORDER_COLOR_FROM_PALETTE", this.elDropdownLayer]); + }, + + $ON_ST_HIDE_BORDER_COLOR_LAYER : function(){ + this.welDropdownLayer.removeClass("p1"); + + this.oApp.exec("HIDE_COLOR_PALETTE", []); + }, + + $ON_ST_TOGGLE_BGCOLOR_LAYER : function(){ + if(this.welDropdownLayer.hasClass("p2")) + this.oApp.exec("ST_HIDE_BGCOLOR_LAYER", []); + else + this.oApp.exec("ST_SHOW_BGCOLOR_LAYER", []); + }, + + $ON_ST_SHOW_BGCOLOR_LAYER : function(){ + this.welDropdownLayer.removeClass("p1"); + this.welDropdownLayer.addClass("p2"); + + this.oApp.exec("SHOW_COLOR_PALETTE", ["ST_SET_BGCOLOR_FROM_PALETTE", this.elDropdownLayer]); + }, + + $ON_ST_HIDE_BGCOLOR_LAYER : function(){ + this.welDropdownLayer.removeClass("p2"); + + this.oApp.exec("HIDE_COLOR_PALETTE", []); + }, + + $ON_ST_SET_BORDER_COLOR_FROM_PALETTE : function(sColorCode){ + this.oApp.exec("ST_SET_BORDER_COLOR", [sColorCode]); + this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER", []); + }, + + $ON_ST_SET_BORDER_COLOR : function(sColorCode){ + this.oBorderColorInput.value = sColorCode; + this.oButton_BorderColorPreview.style.backgroundColor = sColorCode; + + this._showNewTable(); + }, + + $ON_ST_SET_BGCOLOR_FROM_PALETTE : function(sColorCode){ + this.oApp.exec("ST_SET_BGCOLOR", [sColorCode]); + this.oApp.exec("ST_HIDE_BGCOLOR_LAYER", []); + }, + + $ON_ST_SET_BGCOLOR : function(sColorCode){ + this.oBGColorInput.value = sColorCode; + this.oButton_BGColorPreview.style.backgroundColor = sColorCode; + + this._showNewTable(); + }, + + _showNewTable : function(){ + var oTmp = document.createElement("DIV"); + oTmp.innerHTML = this._getTableString(); + var oNewTable = oTmp.firstChild; + this.oSampleTable.parentNode.insertBefore(oNewTable, this.oSampleTable); + this.oSampleTable.parentNode.removeChild(this.oSampleTable); + this.oSampleTable = oNewTable; + }, + + // need to do something about the table width as the same HTML code is being used to the actual table and the preview table + _getTableString : function(){ + var sBorderColorCode = this.oBorderColorInput.value; + var sBGColorCode = this.oBGColorInput.value; + var iBorderWidth = this.oBorderWidthInput.value; + var sTD = ""; + if($.browser.msie){ + sTD = "

    "; + }else{ + if($.browser.firefox){ + sTD = ""; + }else{ + sTD = ""; + } + } + + var sTable = '


     

    '; + var sRow = ''; + var iColumns = this.oColumnInput.value; + for(var i=0; i/ig, + regex_meanless_css2 = /(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig, + regex_class = /<(.*?)\s+class\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))(.*?)>/ig, + regex_class2 = /xe_selected_cell/g; + regex_handler = /<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig, + //regex_id = /<(.*?)\s+id\s*=(?:[^\s>]+|\s*".*?"|\s*'.*?')(.*?)>/ig, + //regex_script = //ig, + regex_font_color = /color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, + regex_font_face = /face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, + regex_font_size = /size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i, + regex_style = /style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i, + regex_font_weight = /font-weight\s*:\s*([a-z]+);?/i, + regex_font_style = /font-style\s*:\s*italic;?/i, + regex_font_decoration = /text-decoration\s*:\s*([a-z -]+);?/i, + regex_jquery = /jQuery\d+\s*=(\s*"\d+"|\d+)/ig, + regex_quote_attr = /([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g; //" + +var + allow_tags = 'a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var,iframe,object,param,style'.split(','), + lonely_tags = 'area,br,col,embed,hr,img,input,param'.split(','); + +var + replace_tags = { + 'b' : 'strong', + 'i' : 'em', + 's' : 'del', + 'strike' : 'del' + }; + +xe.XE_XHTMLFormatter = $.Class({ + name : "XE_XHTMLFormatter", + + $ON_MSG_APP_READY : function() { + this.oApp.addConverter("WYSIWYG_TO_IR", this.TO_IR); + this.oApp.addConverter("HTMLSrc_TO_IR", this.TO_IR); + this.oApp.addConverter("IR_TO_HTMLSrc", this.IR_TO); + this.oApp.addConverter("IR_TO_WYSIWYG", this.IR_TO); + }, + + TO_IR : function(sContent) { + var stack = []; + + // remove xeHandled attrs + /* + sContent = sContent.replace(/xeHandled="YES"/ig,''); + */ + + + // remove all useless styles + /* + sContent = sContent.replace(regex_meanless_css1, function(m0,m1,m2,m3){ + m2 = m2.replace(regex_meanless_css2, ''); + + return '<'+m1+(m2?' style="'+m2+'"':'')+m3+'>'; + }); + */ + + // remove all useless classes + /* + sContent = sContent.replace(regex_class, function(m0,m1,m2,m3,m4,m5){ + var cls = $.trim((m2 || m3 || m4 || "").replace(regex_class2, '')); + + return '<'+(m1||"")+(cls?' class="'+cls+'"':'')+(m5||"")+'>'; + }); + */ + + // remove all event handler + //sContent = sContent.replace(regex_handler, '<$1$2>'); + + // remove all id + //sContent = sContent.replace(regex_id, '<$1$2>'); + + // remove all scripts + //sContent = sContent.replace(regex_script, ''); + + if ($.browser.msie) { + // remove $ attributes + sContent = sContent.replace(regex_jquery, ''); + + // quote all attrs + sContent = sContent.replace(/<(\w+) ([^>]+)>/g, function(m0,m1,m2){ + return '<'+m1+' '+ + m2.replace(regex_quote_attr, function(s0,s1,s2,s3){ + if (s1) return s1; + if(/^"/.test(s3)||/"$/.test(s3)) return s2+'='+s3; + return s2+'="'+s3+'"'; + }) + '>'; + }); + } + + // remove all useless tag and enclose tags + regex = /<(\/)?([:\w\/-]+)(.*?)>/ig; + sContent = sContent.replace(regex, function(m0,closing,tag,attrs){ + var m3s = []; + var state = ''; + + closing = closing || ''; + tag = tag.toLowerCase(); + attrs = $.trim(attrs || ''); + + if (!closing) { + if ($.inArray(tag,lonely_tags) >= 0) { + var len = attrs.length; + if (tag == 'br') attrs = ''; + if (!attrs || attrs.substring(len-1,len) != '/') attrs += '/'; + + return '<'+tag+' '+$.trim(attrs)+'>'; + } else { + stack[stack.length] = {tag:tag, state:state}; + } + } else { + var tags = [], t = ''; + + // remove unnecessary closing tag + if (!stack.length) return ''; + + do { + t = stack.pop(); + if (t.tag != tag) continue; + if (t.state != 'deleted') tags.push(''); + } while(stack.length && t.tag != tag); + + return tags.join(''); + } + + return '<'+closing+tag+(attrs?' '+attrs:'')+'>'; + }); + /* + if (stack.length) { + var t = ''; + + do { + t = stack.pop(); + if (t.state != 'deleted') sContent += ''; + } while(stack.length); + } + */ + + return sContent; + }, + + IR_TO : function(sContent) { + return sContent; + } +}); +// center, font, b, i, s, strike + +/** + * Support XE extensions + * @author NHN (developer@xpressengine.com) + */ +xe.XE_Extension = $.Class({ + name : "XE_Extension", + seq : '', + last_doc : '', + + $init : function(elAppContainer, editor_sequence) { + this.seq = editor_sequence; + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer) { + this.elDropdownLayer = $('DIV.xpress_xeditor_extension_layer', elAppContainer).get(0); + }, + + _removeAttrs : function(sContent) { + return sContent; + }, + + _addEvent : function() { + if (this.oApp.getEditingMode() != 'WYSIWYG') return; + + var doc = this.oApp.getWYSIWYGDocument(); + var seq = this.seq; + var fn = function(){ + var obj = $(this); + var comp = obj.attr('editor_component'); + if (comp && $.isFunction(openComponent)) { + editorPrevNode = obj.get(0); + openComponent(comp, seq); + } + }; + + $('img,div[editor_component]', doc).each(function(){ + var obj = $(this); + if(this.nodeName == 'IMG' && !obj.attr('editor_component')) { + obj.attr('editor_component','image_link'); + } + if(this.last_doc != doc) { + obj.dblclick(fn); + this.last_doc = doc; + } + }); + }, + + $ON_MSG_APP_READY : function() { + var oApp = this.oApp; + oApp.exec('REGISTER_UI_EVENT', ['extension', 'click', 'TOGGLE_EXTENSION_LAYER']); + var functn = function(){ + oApp.exec("HIDE_ACTIVE_LAYER", []); + }; + $('a', this.elDropdownLayer).each(function(){ + var obj = $(this); + if(!obj.attr('component_onclick_event_added')) { + obj.click(functn); + obj.attr('component_onclick_event_added','Y'); + } + }); + }, + + $ON_TOGGLE_EXTENSION_LAYER : function() { + this.oApp.exec('TOGGLE_TOOLBAR_ACTIVE_LAYER', [this.elDropdownLayer]); + }, + + $ON_CHANGE_EDITING_MODE : function(mode) { + var self = this; + setTimeout(function(){ self._addEvent(); }, 100); + }, + + $ON_PASTE_HTML : function() { + var self = this; + setTimeout(function(){ self._addEvent(); }, 100); + }, + + $ON_LOAD_IR_FIELD : function() { + var self = this; + setTimeout(function(){ self._addEvent(); }, 100); + }, + + $ON_SET_IR : function() { + var self = this; + setTimeout(function(){ self._addEvent(); }, 100); + } +}); +/** + * Auto saving + * @author NHN (developer@xpressengine.com) + */ +xe.XE_AutoSave = $.Class({ + name : "XE_AutoSave", + form : null, + textarea : null, + + $init : function(oIRTextarea, elAppContainer) { + this.form = oIRTextarea.form; + this.textarea = oIRTextarea; + + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer) { + this.welMessageBox = $('autosave_message'); + }, + + $ON_MSG_APP_READY : function() { + var elTitle = $(this.form._saved_doc_title); + var elContent = $(this.form._saved_doc_content); + + var title = $.trim(elTitle.val()); + var content = $.trim(elContent.val()); + + if (title || content) { + if (confirm(this.form._saved_doc_message.value)) { + $(this.form.title).val(title); + this.oApp.setIR(content); + if(typeof(editorGetAutoSavedDoc) == 'function') editorGetAutoSavedDoc(this.form); + } else { + editorRemoveSavedDoc(); + } + } + + editorEnableAutoSave(this.form, $(this.form).attr("editor_sequence")); + + // register hotkey + this.oApp.exec('REGISTER_HOTKEY', ['ctrl+shift+s','AUTO_SAVE']); + }, + + $ON_AUTO_SAVE : function() { + _editorAutoSave(); + } +}); +/** + * Format Block plugin + * @author NHN (developer@xpressengine.com) + */ +xe.XE_FormatWithSelectUI = $.Class({ + name : "XE_FormatWithSelectUI", + + $init : function(elAppContainer){ + this._assignHTMLObjects(elAppContainer); + }, + + _assignHTMLObjects : function(elAppContainer){ + this.elFormatSelect = $("SELECT.xpress_xeditor_ui_format_select", elAppContainer).get(0); + }, + + $ON_MSG_APP_READY : function(){ + this.oApp.registerBrowserEvent(this.elFormatSelect, "change", "SET_FORMAT_FROM_SELECT_UI"); + this.elFormatSelect.selectedIndex = 0; + }, + + $ON_MSG_STYLE_CHANGED : function(sAttributeName, sAttributeValue){ + var blockName = this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock"); + + if (!blockName) return (this.elFormatSelect.selectedIndex = 0); + if ($.browser.msie && /([0-9])/.test(blockName)) blockName = 'h'+(RegExp.$1); + + this.elFormatSelect.value = blockName.toLowerCase(); + if(this.elFormatSelect.selectedIndex < 0) this.elFormatSelect.selectedIndex = 0; + if(this.elFormatSelect.value != blockName.toLowerCase()) this.elFormatSelect.selectedIndex = 0; + }, + + $ON_SET_FORMAT_FROM_SELECT_UI : function(){ + var sFormat = this.elFormatSelect.value; + if(!sFormat) return; + if($.browser.msie) sFormat = '<'+sFormat+'>'; + + this.oApp.exec("EXECCOMMAND", ["FormatBlock", false, sFormat]); + this.oApp.exec("CHECK_STYLE_CHANGE", []); + } +}); +/** + * Enhanced Table Fetures + * @author NHN (developer@xpressengine.com) + */ + +// 표 편집 확장 기능 +xe.XE_Table = $.Class({ + _startSel : null, + _endSel : null, + + $ON_MSG_APP_READY : function() { + this._doc = $(this.oApp.getWYSIWYGDocument()); + + this.$FnMouseDown = $.fnBind(this._mousedown, this); + this.$FnMouseUp = $.fnBind(this._mouseup, this); + this.$FnMouseMove = $.fnBind(this._mousemove, this); + + this._doc.mousedown(this.$FnMouseDown); + + // initialize + this._startSel = null; + this._endSel = null; + + // register buttons + this.oApp.exec('REGISTER_UI_EVENT', ['merge_cells', 'click', 'MERGE_CELLS']); + this.oApp.exec('REGISTER_UI_EVENT', ['split_col', 'click', 'CELL_SPLIT_BY_COL']); + this.oApp.exec('REGISTER_UI_EVENT', ['split_row', 'click', 'CELL_SPLIT_BY_ROW']); + + // register hotkeys + this.oApp.exec('REGISTER_HOTKEY', ['ctrl+alt+m', 'MERGE_CELLS']); + + // perform default ready action + this.$super.$ON_MSG_APP_READY(); + }, + + $ON_MERGE_CELLS : function() { + var html = ""; + var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); + var self = this; + + // 선택된 셀이 없으면 종료 + if (!cell.length) return; + + // UNDO 지점 기록 + this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Merge"]); + + // 선택한 모든 셀의 데이터를 첫번째 셀로 복사 + cell.each(function(){ html += $(this).html() }).eq(0).html(html); + + // 첫번째 셀 가로 확장 + var colspan = 0; + cell.eq(0).nextAll('td,th').andSelf().filter('.xe_selected_cell').each(function(idx){ + colspan += self._getSpan(this, 'col'); + }); + + // 마지막 셀까지 줄의 갯수 계산 + var rect = this._getRect(cell.eq(0)); + var start_tr = cell.eq(0).parent('tr'); + var end_tr = cell.eq(cell.length-1).parent('tr'); + var all_rows = cell.parents('table').eq(0).find('tr'); + var rowspan = all_rows.index(end_tr.get(0)) - all_rows.index(start_tr.get(0)) + this._getSpan(cell.eq(cell.length-1), 'row'); + + // 첫번째 셀 colspan, rowspan 속성 지정 + cell.eq(0).attr('colSpan', colspan).attr('rowSpan', rowspan); + + // 첫번째 셀을 제외한 다른 모든 셀 제거 + cell.slice(1).remove(); + }, + + $ON_CELL_SPLIT_BY_ROW : function(many) { + var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); + var table = cell.parents('table').eq(0); + var self = this; + + // 선택된 셀이 없으면 종료 + if (!cell.length) return; + + // UNDO 지점 기록 + this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Row"]); + + // 선택 영역의 상하 좌표 구함 + var _top = this._getRect(cell.eq(0)).top; + var _bottom = this._getRect(cell.eq(cell.length-1)).bottom; + + // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(상하 기준). + (cell = table.find('td,th').filter(function(){ + var rect = self._getRect($(this)); + + return !(rect.bottom <= _top || rect.top >= _bottom); + })).filter('.xe_selected_cell').each(function(){ + var t = $(this); + var row = t.parent('tr'); + var rowspan = self._getSpan(t, 'row'); + var rect = self._getRect(t); + var queue = []; + var clone = t.clone().html('
    '); + var topspan = 1, botspan = 1; + + // rowspan > 1이면 현재 셀의 rowspan을 절반으로 분할한다. + if (rowspan > 1) { + + topspan = Math.ceil(rowspan/2); + botspan = rowspan - topspan; + + queue.push(function(){ + t.attr('rowSpan', topspan); + }); + + clone.attr('rowSpan', botspan); + } else { + // rowspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 rowspan을 추가 + cell.filter(function(){ + if (t.get(0) == this) return false; + + var tt = $(this); + var rc = self._getRect(tt); + + // 범위를 넘은 부분은 제외 + if (rc.bottom <= rect.top || rc.top >= rect.bottom) return false; + + return true; + }).each(function(){ + var tt = $(this); + var sp = self._getSpan(tt, 'row')+1; + + // rowspan 1 추가 + queue.push(function(){ + tt.attr('rowSpan', sp); + }); + }); + + // 새 줄을 추가한다. + if ($.browser.msie) { + // Fix bug for IE + row.after(row.clone().empty().get(0).outerHTML); + } else { + row.after(row.clone().empty()); + } + } + + var rows = row.nextAll('tr'); + + // 현재 셀이 마지막 줄에 있다면 한 줄 추가 후 새로운 셀 추가 + if (!rows.length) { + row.after(row.clone().empty().append(clone)); + } else { + var next_sib = rows.eq(topspan - 1).children('td,th').filter(function(){ + return ( self._getRect($(this)).left > rect.left ); + }); + + if ($.browser.msie) { + next_sib.length? + next_sib.eq(0).before(clone.get(0).outerHTML): + rows.eq(topspan-1).append(clone.get(0).outerHTML); + } else { + next_sib.length? + next_sib.slice(0,1).before(clone): + rows.slice(topspan-1,1).append(clone); + } + } + + // 함수를 바로 실행하면 좌표가 틀어지므로, 큐에 넣은 후 실행 + $.each(queue, function(){ this(); }); + + }); + }, + + $ON_CELL_SPLIT_BY_COL : function(many) { + var cell = $('.xe_selected_cell', this.oApp.getWYSIWYGDocument()).filter('td,th'); + var table = cell.parents('table').slice(0,1); + var self = this; + var ie_bug = [], tmpId = (new Date).getTime(), tmpStr = ''; + + // 선택된 셀이 없으면 종료 + if (!cell.length) return; + + // UNDO 지점 기록 + this.oApp.exec("RECORD_UNDO_ACTION", ["Cell:Split By Column"]); + + // 선택 영역의 좌우 좌표 구함 + var first_row = cell.eq(0).parent('tr'); + var _left = this._getRect(first_row.find('.xe_selected_cell:first')).left; + var _right = this._getRect(first_row.find('.xe_selected_cell:last')).right; + + // 테이블의 모든 셀에서 선택영역에 해당하는 셀을 구한다(좌우 기준). + (cell = table.find('td,th').filter(function(){ + var rect = self._getRect($(this)); + + return !(rect.right <= _left || rect.left >= _right); + })).filter('.xe_selected_cell').each(function(idx){ + var t = $(this); + var colspan = self._getSpan(t, 'col'); + var clone = t.clone().html('
    '); + + // colspan > 1 이면 colspan을 절반으로 분할한다. + if (colspan > 1) { + var leftspan = Math.ceil(colspan/2); + var rightspan = colspan - leftspan; + + t.attr('colSpan', leftspan); + clone.attr('colSpan', rightspan); + } else { + // colspan이 없으면 현재 셀과 영역이 겹치는 모든 셀에 colspan을 추가 + var rect = self._getRect(t); + + cell.filter(function(){ + if (t.get(0) == this) return false; + + var tt = $(this); + var rc = self._getRect(tt); + + // 범위를 넘은 부분은 제외 + if (rc.right <= rect.left || rc.left >= rect.right) return false; + + return true; + }).each(function(){ + var tt = $(this); + + // colspan 1 추가 + tt.attr('colSpan', self._getSpan(tt, 'col')+1); + }); + + clone.attr('colSpan', 1); + } + + if ($.browser.msie) { + // Fix for IE bug + t.after(clone.get(0).outerHTML); + } else { + t.after(clone); + } + }); + }, + + $ON_CHECK_STYLE_CHANGE : function(){ + var ui = ['merge_cells', 'split_col', 'split_row']; + var app = this.oApp; + var command = (this._startSel && this._startSel.is('.xe_selected_cell'))?'ENABLE_UI':'DISABLE_UI'; + + $.each(ui, function(){ app.exec(command, [this]); }); + }, + + _mousedown : function(event) { + var cur = $(event.target); + var sel = cur.parents().andSelf().filter('td,th,table'); + var app = this.oApp; + var self = this; + + // 모든 선택영역 해제 + $('td.xe_selected_cell', this.oApp.getWYSIWYGDocument()).removeClass('xe_selected_cell'); + + this._startSel = null; + this._endSel = null; + + if (!sel.length || !this._isLeftClicked(event.button)) return; + + function delayed(){ + sel = app.getSelection().cloneRange(); + sel.collapseToStart(); + sel = $(sel.startContainer).parents().andSelf().filter('td,th').eq(0); + + if (!sel.length) return self._removeAllListener()||true; + + // 좌표를 구한다 + self._getRect(self._startSel = sel); + + // 이벤트 바인딩 + self._doc.bind('mousemove', self.$FnMouseMove); + self._doc.bind('mouseup', self.$FnMouseUp); + } + + // mousedown이 일어난 후에 선택 영역이 설정되므로 실행을 지연시킨다. + setTimeout(delayed, 0); + }, + + _mouseup : function(event) { + // 선택된 셀 확인 + this._removeAllListener(); + + // 시작셀과 종료셀 제거 + this._startSel = this._endSel = null; + }, + + _mousemove : function(event) { + var cur = $(event.target); + var cell = cur.parents().andSelf().filter('td,th').eq(0); + var self = this; + + // 마우스 왼쪽 버튼이 눌리지 않았으면 종료 + if (!cell.length || !this._isLeftClicked(event.button)) return; + if (!this._endSel && cell.get(0) == this._startSel.get(0)) return; + if (this._endSel && cell.get(0) == this._endSel.get(0)) return; + + // 종료셀 && 종료셀의 좌표 + this._getRect(this._endSel = cell); + + // 선택 범위를 구한다 + var _top = Math.min(this._startSel.rect.top, this._endSel.rect.top); + var _left = Math.min(this._startSel.rect.left, this._endSel.rect.left); + var _bottom = Math.max(this._startSel.rect.bottom, this._endSel.rect.bottom); + var _right = Math.max(this._startSel.rect.right, this._endSel.rect.right); + + var table = cell.parents('table'); + var cells = table.find('td,th').removeClass('xe_selected_cell'); + var i = 0; + + // 복잡한 모양의 테이블을 위한 반복 처리 + var selected = $(); + do { + // 선택한 셀로 최대 영역 재계산 + selected.each(function(){ + var rect = self._getRect($(this)); + + // 영역 재계산 + if (rect.right > _right) _right = rect.right; + if (rect.left < _left) _left = rect.left; + if (rect.top < _top) _top = rect.top; + if (rect.bottom > _bottom) _bottom = rect.bottom; + }); + + // 좌표 범위 안에 있는 선택할 셀을 추린다. + cells = cells.filter(':not(.xe_selected_cell)'); + selected = cells.filter(function(){ + var rect = self._getRect($(this)); + + if (rect.right <= _left || rect.left >= _right || rect.bottom <= _top || rect.top >= _bottom) return false; + + return true; + }).addClass('xe_selected_cell'); + } while(selected.length); + + // 브라우저의 기본 선택영역 해제 : FF 제외 - 기본 기능이 충분히 좋아서 + 이 부분을 실행하면 오류가 발생해서 + if (!$.browser.mozilla) { + function delayed() { + var sel = self.oApp.getSelection(); + + if (!self._startSel) return; + if (!self._startSel.get(0).firstChild) self._startSel.text(" "); + + sel.selectNode(self._startSel.get(0).firstChild); + sel.collapseToStart(); + sel.select(); + } + + setTimeout(delayed, 0); + } + + return false; + }, + + _removeAllListener : function() { + // 이벤트 해제 + this._doc.unbind("mousemove", this.$FnMouseMove); + this._doc.unbind("mouseup", this.$FnMouseUp); + }, + + _isLeftClicked : function(value) { + return $.browser.msie?!!(value & 1):(value == 0); + }, + + _getRect : function(obj) { + var el = obj.get(0); + + obj.rect = {}; + obj.rect.top = el.offsetTop; + obj.rect.left = el.offsetLeft; + obj.rect.bottom = obj.rect.top + el.offsetHeight; + obj.rect.right = obj.rect.left + el.offsetWidth; + + return obj.rect; + }, + + _getSpan : function(obj, type) { + var span = parseInt($(obj).attr(type+'span')); + + return isNaN(span)?1:span; + } +}).extend(xe.XE_Table); + +})(jQuery); diff --git a/modules/editor/skins/xpresseditor/js/xe_interface.js b/modules/editor/skins/xpresseditor/js/xe_interface.js index 269a02c8d..ef9a2348d 100644 --- a/modules/editor/skins/xpresseditor/js/xe_interface.js +++ b/modules/editor/skins/xpresseditor/js/xe_interface.js @@ -1,308 +1,308 @@ -if (!window.xe) xe = {}; - -xe.Editors = []; - -function editorStart_xe(editor_sequence, primary_key, content_key, editor_height, colorset, content_style, content_font, content_font_size) { - if(typeof(colorset)=='undefined') colorset = 'white'; - if(typeof(content_style)=='undefined') content_style = 'xeStyle'; - if(typeof(content_font)=='undefined') content_font= ''; - if(typeof(content_font_size)=='undefined') content_font_size= ''; - - var target_src = request_uri+'modules/editor/styles/'+content_style+'/editor.html'; - - var textarea = jQuery("#xpress-editor-"+editor_sequence); - var iframe = jQuery(' + + + + +
    +

    레이아웃 이미지 목록

    +
    + +
    + + {@$ext=substr(strrchr($file,'.'),1)} +
    + + + + + + +
    + + +
    +
    +
    + + + + + + +
    + diff --git a/modules/member/conf/info.xml b/modules/member/conf/info.xml index d53217ddb..47f6cb7df 100644 --- a/modules/member/conf/info.xml +++ b/modules/member/conf/info.xml @@ -1,36 +1,36 @@ - - - 회원 관리 - 会员管理 - 会員 管理 - Member Management - Quản lý thành viên - Usuario Gestión - Управление пользователями - 會員 管理 - Üye Yönetimi - 회원 관리 및 회원 관련 설정등을 하는 모듈입니다. - 对会员进行管理及相关设置的模块。 - 会員管理及び会員関連設定などを行うモジュールです。 - This module is for managing or configuring members. - Module này dành cho việc quản lý và tạo thành viên. - Este módulo es para el manejo y la configuración de los usuarios. - Этот модуль служит для управления и конфигурирования пользователей. - 對會員進行管理與相關設置的模組。 - Bu modül üyeleri yönetmek/yapılandırmak için kullanılır - 0.1 - 2007-02-28 - member - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 회원 관리 + 会员管理 + 会員 管理 + Member Management + Quản lý thành viên + Usuario Gestión + Управление пользователями + 會員 管理 + Üye Yönetimi + 회원 관리 및 회원 관련 설정등을 하는 모듈입니다. + 对会员进行管理及相关设置的模块。 + 会員管理及び会員関連設定などを行うモジュールです。 + This module is for managing or configuring members. + Module này dành cho việc quản lý và tạo thành viên. + Este módulo es para el manejo y la configuración de los usuarios. + Этот модуль служит для управления и конфигурирования пользователей. + 對會員進行管理與相關設置的模組。 + Bu modül üyeleri yönetmek/yapılandırmak için kullanılır + 0.1 + 2007-02-28 + member + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/member/lang/en.lang.php b/modules/member/lang/en.lang.php index 7f1a9a4fc..416f075c3 100644 --- a/modules/member/lang/en.lang.php +++ b/modules/member/lang/en.lang.php @@ -1,236 +1,236 @@ -member = 'Member'; - $lang->member_default_info = 'Basic Info'; - $lang->member_extend_info = 'Additional Info'; - $lang->default_group_1 = "Associate Member"; - $lang->default_group_2 = "Regular Member"; - $lang->admin_group = "Managing Group"; - $lang->keep_signed = 'Keep me signed in'; - $lang->remember_user_id = 'Remember ID'; - $lang->already_logged = "You are already signed in"; - $lang->denied_user_id = 'You have entered a prohibited ID.'; - $lang->null_user_id = 'Please input ID'; - $lang->null_password = 'Please input password'; - $lang->invalid_authorization = 'The account is not activated.'; - $lang->invalid_user_id= "You have entered an invalid ID"; - $lang->invalid_password = 'You have entered an invalid password'; - $lang->invalid_new_password = 'New password must not be the same as old one.'; - $lang->allow_mailing = 'Join Mailing'; - $lang->denied = 'Prohibited'; - $lang->is_admin = 'Superadmin Permission'; - $lang->group = 'Group'; - $lang->group_title = 'Group Name'; - $lang->group_srl = 'Group Number'; - $lang->signature = 'Signature'; - $lang->profile_image = 'Profile Image'; - $lang->profile_image_max_width = 'Max Width'; - $lang->profile_image_max_height = 'Max Height'; - $lang->image_name = 'Image Name'; - $lang->image_name_max_width = 'Max Width'; - $lang->image_name_max_height = 'Max Height'; - $lang->image_mark = 'Image Mark'; - $lang->image_mark_max_width = 'Max Width'; - $lang->image_mark_max_height = 'Max Height'; - $lang->group_image_mark = 'Group Image Mark'; - $lang->group_image_mark_max_width = 'Max Width'; - $lang->group_image_mark_max_height = 'Max Height'; - $lang->group_image_mark_order = 'Group Image Mark Order'; - $lang->signature_max_height = 'Max Signature Height'; - $lang->enable_openid = 'Enable OpenID'; - $lang->enable_join = 'Accept New Members'; - $lang->enable_confirm = 'Email Activation'; - $lang->enable_ssl = 'Enable SSL'; - $lang->security_sign_in = 'Sign in using enhanced security'; - $lang->limit_day = 'Temporary Limit Date'; - $lang->limit_date = 'Limit Date'; - $lang->after_login_url = 'URL after Sign in'; - $lang->after_logout_url = 'URL after Sign out'; - $lang->redirect_url = 'URL after Sign up'; - $lang->agreement = 'Sign up Agreement'; - $lang->accept_agreement = 'Agree'; - $lang->member_info = 'Member Info'; - $lang->current_password = 'Current Password'; - $lang->openid = 'OpenID'; - $lang->allow_message = 'Allow Messages'; - $lang->allow_message_type = array( - 'Y' => 'Allow All', - 'F' => 'Allow for Friends', - 'N' => 'Reject All', - ); - $lang->about_allow_message = 'You may allow or reject messages.'; - $lang->logged_users = 'Logged on Users'; - - $lang->webmaster_name = "Webmaster Name"; - $lang->webmaster_email = "Webmaster Email"; - - $lang->about_keep_signed = 'You will be still signed in even when the browser is closed.\n\nIt is not recommended to use this if you are using a public computer for your personal information could be violated'; - $lang->about_keep_warning = 'You will be still signed in even when the browser is closed. It is not recommended to use this if you are using a public computer for your personal information could be violated'; - $lang->about_webmaster_name = "Please input webmaster's name which will be used for verification mails or other site administration. (default : webmaster)"; - $lang->about_webmaster_email = "Please input webmaster's email address."; - - $lang->search_target_list = array( - 'user_id' => 'ID', - 'user_name' => 'Name', - 'nick_name' => 'Nickname', - 'email_address' => 'Email Address', - 'regdate' => 'Sign up Date', - 'regdate_more' => 'Sign up Date (more)', - 'regdate_less' => 'Sign up Date (less)', - 'last_login' => 'Last Sign in Date', - 'last_login_more' => 'Last Sign in Date (more)', - 'last_login_less' => 'Last Sign in Date (less)', - 'extra_vars' => 'Extra Vars', - ); - - $lang->cmd_login = 'Sign In'; - $lang->cmd_logout = 'Sign Out'; - $lang->cmd_signup = 'Sign Up'; - $lang->cmd_site_signup = 'Sign Up'; - $lang->cmd_modify_member_info = 'Modify Member Info'; - $lang->cmd_modify_member_password = 'Modify Password'; - $lang->cmd_view_member_info = 'Member Info'; - $lang->cmd_leave = 'Leave'; - $lang->cmd_find_member_account = 'Find Account Info'; - $lang->cmd_resend_auth_mail = 'Request for Activation Mail'; - - $lang->cmd_member_list = 'Member List'; - $lang->cmd_module_config = 'Default Setting'; - $lang->cmd_member_group = 'Member Groups'; - $lang->cmd_send_mail = 'Send Mail'; - $lang->cmd_manage_id = 'Prohibited IDs'; - $lang->cmd_manage_form = 'Sign up Form'; - $lang->cmd_view_own_document = 'Written Articles'; - $lang->cmd_manage_member_info = 'Manage Member Info'; - $lang->cmd_trace_document = 'Trace Written Articles'; - $lang->cmd_trace_comment = 'Trace Written Comments'; - $lang->cmd_view_scrapped_document = 'Scraps'; - $lang->cmd_view_saved_document = 'Saved Articles'; - $lang->cmd_send_email = 'Send Mail'; - - $lang->msg_email_not_exists = "You have entered an invalid email address"; - - $lang->msg_alreay_scrapped = 'This article is already scrapped'; - - $lang->msg_cart_is_null = 'Please select the target'; - $lang->msg_checked_file_is_deleted = '%d attached file(s) is(are) deleted'; - - $lang->msg_find_account_title = 'Account Info'; - $lang->msg_find_account_info = 'This is requested account info.'; - $lang->msg_find_account_comment = 'The password will be modified as above one as you click below link.
    Please modify the password after login.'; - $lang->msg_confirm_account_title = 'Zeroboard XE Account Activation'; - $lang->msg_confirm_account_info = 'This is your account information:'; - $lang->msg_confirm_account_comment = 'Click on the followed link to complete your account activation.'; - $lang->msg_auth_mail_sent = 'The activation mail has been sent to %s. Please check your mail.'; - $lang->msg_confirm_mail_sent = 'We just sent the activation email to %s. Please check your mail.'; - $lang->msg_invalid_auth_key = 'This is an invalid request of verification.
    Please retry finding account info or contact to administrator.'; - $lang->msg_success_authed = 'Your account has been successfully activated and logged on.\n Please modify the password to your own one with the password in the mail.'; - $lang->msg_success_confirmed = 'Your account has been activated successfully.'; - - $lang->msg_new_member = 'Add Member'; - $lang->msg_update_member = 'Modify Member Info'; - $lang->msg_leave_member = 'Leave'; - $lang->msg_group_is_null = 'There is no group'; - $lang->msg_not_delete_default = 'Default items cannot be deleted'; - $lang->msg_not_exists_member = "Invalid member"; - $lang->msg_cannot_delete_admin = 'Admin ID cannot be deleted. Please remove the ID from administration and try again.'; - $lang->msg_exists_user_id = 'This ID already exists. Please try with another one.'; - $lang->msg_exists_email_address = 'This email address already exists. Please try with another one.'; - $lang->msg_exists_nick_name = 'This nickname already exists. Please try with another one.'; - $lang->msg_signup_disabled = 'You are not able to sign up'; - $lang->msg_already_logged = 'You have already signed up'; - $lang->msg_not_logged = 'Please sign in first'; - $lang->msg_insert_group_name = 'Please input the name of group'; - $lang->msg_check_group = 'Please select the group'; - - $lang->msg_not_uploaded_profile_image = 'Profile image could not be registered'; - $lang->msg_not_uploaded_image_name = 'Image name could not be registered'; - $lang->msg_not_uploaded_image_mark = 'Image mark could not be registered'; - $lang->msg_not_uploaded_group_image_mark = 'Group image mark could not be registered'; - - $lang->msg_accept_agreement = 'You have to agree with the agreement'; - - $lang->msg_user_denied = 'You have entered a prohibited ID'; - $lang->msg_user_not_confirmed = 'Your account is not activated yet. Please check your email.'; - $lang->msg_user_limited = 'You have entered an ID that can be used after %s'; - - $lang->about_user_id = 'User ID should be 3~20 letters long and consist of alphabet+number with alphabet as first letter.'; - $lang->about_password = 'Password should be 6~20 letters long'; - $lang->about_user_name = 'Name should be 2~20 letters long'; - $lang->about_nick_name = 'Nickname should be 2~20 letters long'; - $lang->about_email_address = 'Email address will be used to modify/find password after email verification'; - $lang->about_homepage = 'Please input if you have your websites'; - $lang->about_blog_url = 'Please input if you have your blogs'; - $lang->about_birthday = 'Please input your birth date'; - $lang->about_allow_mailing = "If you don't join mailing, you will not able to receive group mail"; - $lang->about_denied = 'Check to prohibit the ID'; - $lang->about_is_admin = 'Check to give Superadmin permission'; - $lang->about_member_description = "Administrator's memo about members"; - $lang->about_group = 'An ID can belong to many groups'; - - $lang->about_column_type = 'Please set the format of additional sign up form'; - $lang->about_column_name = 'Please input English name that can be used in template (name as variable)'; - $lang->about_column_title = 'This will be displayed on sign up or modifying/viewing member info form'; - $lang->about_default_value = 'You can set default values'; - $lang->about_active = 'You have to check on active items to show on sign up form'; - $lang->about_form_description = 'If you input in description form, it will be displayed on join form'; - $lang->about_required = 'If you check, it will be essential item for sign up'; - - $lang->about_enable_openid = 'Please check if you want to provide OpenID service'; - $lang->about_enable_join = 'Please check if you want to allow new members to sign up your site'; - $lang->about_enable_confirm = 'Please check if you want new members to activate their accounts via their emails.'; - $lang->about_enable_ssl = 'Personal information from Sign up/Modify Member Info/Sign in can be sent as SSL(https) mode if server provides SSL service.'; - $lang->about_limit_day = 'You can limit activation date after sign up'; - $lang->about_limit_date = 'Users cannot sign in until assigned date'; - $lang->about_after_login_url = 'You can set URL after login. Blank means current page.'; - $lang->about_after_logout_url = 'You can set URL after logout. Blank means current page.'; - $lang->about_redirect_url = 'Please input URL where users will go after sign up. When this is empty, it will be set as the previous page of sign up page.'; - $lang->about_agreement = "Sign up Agreement will be displayed if it's not empty"; - - $lang->about_image_name = "Members will be able to use image name instead of text"; - $lang->about_image_mark = "Members will be able to use image mark in front of their names"; - $lang->about_group_image_mark = "You may use group marks shown before their names"; - $lang->about_profile_image = 'Members will be able to use profile images'; - $lang->about_accept_agreement = "I have read the agreement and agree with it"; - - $lang->about_member_default = 'It will be set as default group on sign up'; - - $lang->about_openid = 'When you join as OpenID, basic info like ID or email address will be saved on this site, process for password and verification management will be done on current OpenID offering service'; - $lang->about_openid_leave = 'The secession of OpenID means deletion of your member info from this site.
    If you login after secession, it will be recognized as a new member, so you will no longer have the permission for your ex-written articles.'; - - $lang->about_member = "Member module will help you create, modify and remove members and manage groups or sign up form.\nYou can add a custom group to manage members, and also get additional information by modifying sign up form."; - $lang->about_find_member_account = 'Your account info will be noticed by registered email address.
    Please input email address which you have input on registration, and press "Find Account Info" button.
    '; - $lang->about_ssl_port = 'Please input if you are using non-default SSL port'; - $lang->add_openid = 'Add OpenID'; - - $lang->about_resend_auth_mail = 'You can request for activation mail if you have not activated before'; - $lang->no_article = 'There exists no article'; - - $lang->find_account_question = 'Question for a temporary password.'; - $lang->find_account_answer = 'Answer for a temporary password.'; - $lang->about_find_account_question = 'You can get a temporary password by your ID, email address, and the answer for the question you set.'; - $lang->find_account_question_items = array('' - ,'What is your alternate email address?' - ,'What is your favorite thing?' - ,'What elementary school did you graduate?' - ,'Where is your hometown?' - ,'What is your ideal match?' - ,"What is your mother's name?" - ,"What is your father's name?" - ,'What is your favorite color?' - ,'What is your favorite food?' - ); - $lang->temp_password = 'Temporary password'; - $lang->cmd_get_temp_password = 'Get a temporary password'; - $lang->about_get_temp_password = 'Change your password after you logged in.'; - $lang->msg_question_not_exists = 'You haven`t set your question for a temporary password.'; - $lang->msg_answer_not_matches = 'Your answer for the question is not correct.'; - - $lang->change_password_date = 'Password renewal cycle'; - $lang->about_change_password_date = 'If you set a value to this, you will be notified to change your password periodically. (if set to 0, disabled)'; -?> +member = 'Member'; + $lang->member_default_info = 'Basic Info'; + $lang->member_extend_info = 'Additional Info'; + $lang->default_group_1 = "Associate Member"; + $lang->default_group_2 = "Regular Member"; + $lang->admin_group = "Managing Group"; + $lang->keep_signed = 'Keep me signed in'; + $lang->remember_user_id = 'Remember ID'; + $lang->already_logged = "You are already signed in"; + $lang->denied_user_id = 'You have entered a prohibited ID.'; + $lang->null_user_id = 'Please input ID'; + $lang->null_password = 'Please input password'; + $lang->invalid_authorization = 'The account is not activated.'; + $lang->invalid_user_id= "You have entered an invalid ID"; + $lang->invalid_password = 'You have entered an invalid password'; + $lang->invalid_new_password = 'New password must not be the same as old one.'; + $lang->allow_mailing = 'Join Mailing'; + $lang->denied = 'Prohibited'; + $lang->is_admin = 'Superadmin Permission'; + $lang->group = 'Group'; + $lang->group_title = 'Group Name'; + $lang->group_srl = 'Group Number'; + $lang->signature = 'Signature'; + $lang->profile_image = 'Profile Image'; + $lang->profile_image_max_width = 'Max Width'; + $lang->profile_image_max_height = 'Max Height'; + $lang->image_name = 'Image Name'; + $lang->image_name_max_width = 'Max Width'; + $lang->image_name_max_height = 'Max Height'; + $lang->image_mark = 'Image Mark'; + $lang->image_mark_max_width = 'Max Width'; + $lang->image_mark_max_height = 'Max Height'; + $lang->group_image_mark = 'Group Image Mark'; + $lang->group_image_mark_max_width = 'Max Width'; + $lang->group_image_mark_max_height = 'Max Height'; + $lang->group_image_mark_order = 'Group Image Mark Order'; + $lang->signature_max_height = 'Max Signature Height'; + $lang->enable_openid = 'Enable OpenID'; + $lang->enable_join = 'Accept New Members'; + $lang->enable_confirm = 'Email Activation'; + $lang->enable_ssl = 'Enable SSL'; + $lang->security_sign_in = 'Sign in using enhanced security'; + $lang->limit_day = 'Temporary Limit Date'; + $lang->limit_date = 'Limit Date'; + $lang->after_login_url = 'URL after Sign in'; + $lang->after_logout_url = 'URL after Sign out'; + $lang->redirect_url = 'URL after Sign up'; + $lang->agreement = 'Sign up Agreement'; + $lang->accept_agreement = 'Agree'; + $lang->member_info = 'Member Info'; + $lang->current_password = 'Current Password'; + $lang->openid = 'OpenID'; + $lang->allow_message = 'Allow Messages'; + $lang->allow_message_type = array( + 'Y' => 'Allow All', + 'F' => 'Allow for Friends', + 'N' => 'Reject All', + ); + $lang->about_allow_message = 'You may allow or reject messages.'; + $lang->logged_users = 'Logged on Users'; + + $lang->webmaster_name = "Webmaster Name"; + $lang->webmaster_email = "Webmaster Email"; + + $lang->about_keep_signed = 'You will be still signed in even when the browser is closed.\n\nIt is not recommended to use this if you are using a public computer for your personal information could be violated'; + $lang->about_keep_warning = 'You will be still signed in even when the browser is closed. It is not recommended to use this if you are using a public computer for your personal information could be violated'; + $lang->about_webmaster_name = "Please input webmaster's name which will be used for verification mails or other site administration. (default : webmaster)"; + $lang->about_webmaster_email = "Please input webmaster's email address."; + + $lang->search_target_list = array( + 'user_id' => 'ID', + 'user_name' => 'Name', + 'nick_name' => 'Nickname', + 'email_address' => 'Email Address', + 'regdate' => 'Sign up Date', + 'regdate_more' => 'Sign up Date (more)', + 'regdate_less' => 'Sign up Date (less)', + 'last_login' => 'Last Sign in Date', + 'last_login_more' => 'Last Sign in Date (more)', + 'last_login_less' => 'Last Sign in Date (less)', + 'extra_vars' => 'Extra Vars', + ); + + $lang->cmd_login = 'Sign In'; + $lang->cmd_logout = 'Sign Out'; + $lang->cmd_signup = 'Sign Up'; + $lang->cmd_site_signup = 'Sign Up'; + $lang->cmd_modify_member_info = 'Modify Member Info'; + $lang->cmd_modify_member_password = 'Modify Password'; + $lang->cmd_view_member_info = 'Member Info'; + $lang->cmd_leave = 'Leave'; + $lang->cmd_find_member_account = 'Find Account Info'; + $lang->cmd_resend_auth_mail = 'Request for Activation Mail'; + + $lang->cmd_member_list = 'Member List'; + $lang->cmd_module_config = 'Default Setting'; + $lang->cmd_member_group = 'Member Groups'; + $lang->cmd_send_mail = 'Send Mail'; + $lang->cmd_manage_id = 'Prohibited IDs'; + $lang->cmd_manage_form = 'Sign up Form'; + $lang->cmd_view_own_document = 'Written Articles'; + $lang->cmd_manage_member_info = 'Manage Member Info'; + $lang->cmd_trace_document = 'Trace Written Articles'; + $lang->cmd_trace_comment = 'Trace Written Comments'; + $lang->cmd_view_scrapped_document = 'Scraps'; + $lang->cmd_view_saved_document = 'Saved Articles'; + $lang->cmd_send_email = 'Send Mail'; + + $lang->msg_email_not_exists = "You have entered an invalid email address"; + + $lang->msg_alreay_scrapped = 'This article is already scrapped'; + + $lang->msg_cart_is_null = 'Please select the target'; + $lang->msg_checked_file_is_deleted = '%d attached file(s) is(are) deleted'; + + $lang->msg_find_account_title = 'Account Info'; + $lang->msg_find_account_info = 'This is requested account info.'; + $lang->msg_find_account_comment = 'The password will be modified as above one as you click below link.
    Please modify the password after login.'; + $lang->msg_confirm_account_title = 'Zeroboard XE Account Activation'; + $lang->msg_confirm_account_info = 'This is your account information:'; + $lang->msg_confirm_account_comment = 'Click on the followed link to complete your account activation.'; + $lang->msg_auth_mail_sent = 'The activation mail has been sent to %s. Please check your mail.'; + $lang->msg_confirm_mail_sent = 'We just sent the activation email to %s. Please check your mail.'; + $lang->msg_invalid_auth_key = 'This is an invalid request of verification.
    Please retry finding account info or contact to administrator.'; + $lang->msg_success_authed = 'Your account has been successfully activated and logged on.\n Please modify the password to your own one with the password in the mail.'; + $lang->msg_success_confirmed = 'Your account has been activated successfully.'; + + $lang->msg_new_member = 'Add Member'; + $lang->msg_update_member = 'Modify Member Info'; + $lang->msg_leave_member = 'Leave'; + $lang->msg_group_is_null = 'There is no group'; + $lang->msg_not_delete_default = 'Default items cannot be deleted'; + $lang->msg_not_exists_member = "Invalid member"; + $lang->msg_cannot_delete_admin = 'Admin ID cannot be deleted. Please remove the ID from administration and try again.'; + $lang->msg_exists_user_id = 'This ID already exists. Please try with another one.'; + $lang->msg_exists_email_address = 'This email address already exists. Please try with another one.'; + $lang->msg_exists_nick_name = 'This nickname already exists. Please try with another one.'; + $lang->msg_signup_disabled = 'You are not able to sign up'; + $lang->msg_already_logged = 'You have already signed up'; + $lang->msg_not_logged = 'Please sign in first'; + $lang->msg_insert_group_name = 'Please input the name of group'; + $lang->msg_check_group = 'Please select the group'; + + $lang->msg_not_uploaded_profile_image = 'Profile image could not be registered'; + $lang->msg_not_uploaded_image_name = 'Image name could not be registered'; + $lang->msg_not_uploaded_image_mark = 'Image mark could not be registered'; + $lang->msg_not_uploaded_group_image_mark = 'Group image mark could not be registered'; + + $lang->msg_accept_agreement = 'You have to agree with the agreement'; + + $lang->msg_user_denied = 'You have entered a prohibited ID'; + $lang->msg_user_not_confirmed = 'Your account is not activated yet. Please check your email.'; + $lang->msg_user_limited = 'You have entered an ID that can be used after %s'; + + $lang->about_user_id = 'User ID should be 3~20 letters long and consist of alphabet+number with alphabet as first letter.'; + $lang->about_password = 'Password should be 6~20 letters long'; + $lang->about_user_name = 'Name should be 2~20 letters long'; + $lang->about_nick_name = 'Nickname should be 2~20 letters long'; + $lang->about_email_address = 'Email address will be used to modify/find password after email verification'; + $lang->about_homepage = 'Please input if you have your websites'; + $lang->about_blog_url = 'Please input if you have your blogs'; + $lang->about_birthday = 'Please input your birth date'; + $lang->about_allow_mailing = "If you don't join mailing, you will not able to receive group mail"; + $lang->about_denied = 'Check to prohibit the ID'; + $lang->about_is_admin = 'Check to give Superadmin permission'; + $lang->about_member_description = "Administrator's memo about members"; + $lang->about_group = 'An ID can belong to many groups'; + + $lang->about_column_type = 'Please set the format of additional sign up form'; + $lang->about_column_name = 'Please input English name that can be used in template (name as variable)'; + $lang->about_column_title = 'This will be displayed on sign up or modifying/viewing member info form'; + $lang->about_default_value = 'You can set default values'; + $lang->about_active = 'You have to check on active items to show on sign up form'; + $lang->about_form_description = 'If you input in description form, it will be displayed on join form'; + $lang->about_required = 'If you check, it will be essential item for sign up'; + + $lang->about_enable_openid = 'Please check if you want to provide OpenID service'; + $lang->about_enable_join = 'Please check if you want to allow new members to sign up your site'; + $lang->about_enable_confirm = 'Please check if you want new members to activate their accounts via their emails.'; + $lang->about_enable_ssl = 'Personal information from Sign up/Modify Member Info/Sign in can be sent as SSL(https) mode if server provides SSL service.'; + $lang->about_limit_day = 'You can limit activation date after sign up'; + $lang->about_limit_date = 'Users cannot sign in until assigned date'; + $lang->about_after_login_url = 'You can set URL after login. Blank means current page.'; + $lang->about_after_logout_url = 'You can set URL after logout. Blank means current page.'; + $lang->about_redirect_url = 'Please input URL where users will go after sign up. When this is empty, it will be set as the previous page of sign up page.'; + $lang->about_agreement = "Sign up Agreement will be displayed if it's not empty"; + + $lang->about_image_name = "Members will be able to use image name instead of text"; + $lang->about_image_mark = "Members will be able to use image mark in front of their names"; + $lang->about_group_image_mark = "You may use group marks shown before their names"; + $lang->about_profile_image = 'Members will be able to use profile images'; + $lang->about_accept_agreement = "I have read the agreement and agree with it"; + + $lang->about_member_default = 'It will be set as default group on sign up'; + + $lang->about_openid = 'When you join as OpenID, basic info like ID or email address will be saved on this site, process for password and verification management will be done on current OpenID offering service'; + $lang->about_openid_leave = 'The secession of OpenID means deletion of your member info from this site.
    If you login after secession, it will be recognized as a new member, so you will no longer have the permission for your ex-written articles.'; + + $lang->about_member = "Member module will help you create, modify and remove members and manage groups or sign up form.\nYou can add a custom group to manage members, and also get additional information by modifying sign up form."; + $lang->about_find_member_account = 'Your account info will be noticed by registered email address.
    Please input email address which you have input on registration, and press "Find Account Info" button.
    '; + $lang->about_ssl_port = 'Please input if you are using non-default SSL port'; + $lang->add_openid = 'Add OpenID'; + + $lang->about_resend_auth_mail = 'You can request for activation mail if you have not activated before'; + $lang->no_article = 'There exists no article'; + + $lang->find_account_question = 'Question for a temporary password.'; + $lang->find_account_answer = 'Answer for a temporary password.'; + $lang->about_find_account_question = 'You can get a temporary password by your ID, email address, and the answer for the question you set.'; + $lang->find_account_question_items = array('' + ,'What is your alternate email address?' + ,'What is your favorite thing?' + ,'What elementary school did you graduate?' + ,'Where is your hometown?' + ,'What is your ideal match?' + ,"What is your mother's name?" + ,"What is your father's name?" + ,'What is your favorite color?' + ,'What is your favorite food?' + ); + $lang->temp_password = 'Temporary password'; + $lang->cmd_get_temp_password = 'Get a temporary password'; + $lang->about_get_temp_password = 'Change your password after you logged in.'; + $lang->msg_question_not_exists = 'You haven`t set your question for a temporary password.'; + $lang->msg_answer_not_matches = 'Your answer for the question is not correct.'; + + $lang->change_password_date = 'Password renewal cycle'; + $lang->about_change_password_date = 'If you set a value to this, you will be notified to change your password periodically. (if set to 0, disabled)'; +?> diff --git a/modules/member/lang/es.lang.php b/modules/member/lang/es.lang.php index 81c2e7b77..d9a685d30 100644 --- a/modules/member/lang/es.lang.php +++ b/modules/member/lang/es.lang.php @@ -1,237 +1,237 @@ -member = 'Usuario'; - $lang->member_default_info = 'Información Basica'; - $lang->member_extend_info = 'Información adicional'; - $lang->default_group_1 = "Usuario registrado"; - $lang->default_group_2 = "Usuario regular"; - $lang->admin_group = "Manejo del grupo"; - $lang->keep_signed = 'Keep me signed in'; - $lang->remember_user_id = 'Guardar ID'; - $lang->already_logged = "Ya está conectado"; - $lang->denied_user_id = 'Este ID está prohibido.'; - $lang->null_user_id = 'IngresarID'; - $lang->null_password = 'Ingresar la contraseña'; - $lang->invalid_authorization = 'No está certificado'; - $lang->invalid_user_id= "Este ID no existe"; - $lang->invalid_password = 'Contraseña incorrecta'; - $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; - $lang->allow_mailing = 'Registro del envío de mail'; - $lang->denied = 'Prohibido'; - $lang->is_admin = 'Atribución del administrador superior'; - $lang->group = 'Grupo asignado'; - $lang->group_title = 'Nombre del grupo'; - $lang->group_srl = 'Número del grupo'; - $lang->signature = 'Firma'; - $lang->profile_image = 'Perfil de Imagen'; - $lang->profile_image_max_width = 'Max Anchura'; - $lang->profile_image_max_height = 'Max Altura'; - $lang->image_name = 'Nombre de la imagen'; - $lang->image_name_max_width = 'Ancho Máximo'; - $lang->image_name_max_height = 'Altura Máxima'; - $lang->image_mark = 'Marca de la imagen'; - $lang->image_mark_max_width = 'Ancho Máximo'; - $lang->image_mark_max_height = 'Altura Máxima'; - $lang->group_image_mark = 'Group Image Mark'; - $lang->group_image_mark_max_width = 'Ancho Máximo'; - $lang->group_image_mark_max_height = 'Altura Máxima'; - $lang->group_image_mark_order = '그룹 이미지 마크 순서'; - $lang->enable_openid = 'Activar OpenID'; - $lang->enable_join = 'Permitir el registro del usuario'; - $lang->enable_confirm = '메일 인증 사용'; - $lang->enable_ssl = 'Activar SSL'; - $lang->security_sign_in = 'Sign in using enhanced security'; - $lang->limit_day = 'Límite de la fecha temporal'; - $lang->limit_date = 'Límite de fecha'; - $lang->after_login_url = 'URL después del inicio de sesión'; - $lang->after_logout_url = 'URL después de cerrar sesión'; - $lang->redirect_url = 'URL luego del registro'; - $lang->agreement = 'Acuerdo del registro del usuario'; - $lang->accept_agreement = 'Acepto'; - $lang->member_info = 'Información del Usuario'; - $lang->current_password = 'Contraseña actual'; - $lang->openid = 'OpenID'; - $lang->allow_message = '쪽지 허용'; - $lang->allow_message_type = array( - 'Y' => '모두 허용', - 'F' => '등록된 친구들만 허용', - 'N' => '모두 금지', - ); - $lang->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다'; - $lang->logged_users = 'Logged Users'; - - $lang->webmaster_name = 'Nombre del Webmaster'; - $lang->webmaster_email = 'Correo electrónico Webmaster'; - - $lang->about_keep_signed = '브라우저를 닫더라도 로그인이 계속 유지될 수 있습니다.\n\n로그인 유지 기능을 사용할 경우 다음 접속부터는 로그인을 하실 필요가 없습니다.\n\n단, 게임방, 학교 등 공공장소에서 이용시 개인정보가 유출될 수 있으니 꼭 로그아웃을 해주세요'; - $lang->about_keep_warning = '브라우저를 닫더라도 로그인이 계속 유지될 수 있습니다. 로그인 유지 기능을 사용할 경우 다음 접속부터는 로그인을 하실 필요가 없습니다. 단, 게임방, 학교 등 공공장소에서 이용 시 개인정보가 유출될 수 있으니 꼭 로그아웃을 해주세요.'; - $lang->about_webmaster_name = 'Por favor, webmaster de entrada el nombre que se utilizará para la autenticación de los correos u otros sitio de la administración. (Por defecto: webmaster)'; - $lang->about_webmaster_email = 'Introduzca la dirección de correo electrónico webmaster.'; - - $lang->search_target_list = array( - 'user_id' => 'ID', - 'user_name' => 'Nombre', - 'nick_name' => 'Apodo', - 'email_address' => 'Dirección de Email', - 'regdate' => 'Fecha del registro', - 'regdate_more' => '가입일시(이상)', - 'regdate_less' => '가입일시(이하)', - 'last_login' => 'Fecha de su última conección', - 'last_login_more' => '최근로그인일시(이상)', - 'last_login_less' => '최근로그인일시(이하)', - 'extra_vars' => 'Variables Extra', - ); - - - $lang->cmd_login = 'Conectar'; - $lang->cmd_logout = 'Desconectar'; - $lang->cmd_signup = 'Registrar'; - $lang->cmd_site_signup = 'Join'; - $lang->cmd_modify_member_info = 'Modificar nombre del usuario'; - $lang->cmd_modify_member_password = 'Cambiar la contraseña'; - $lang->cmd_view_member_info = 'Información del usuario'; - $lang->cmd_leave = 'Dejar de ser usuario'; - $lang->cmd_find_member_account = 'Find Account Info'; - - $lang->cmd_member_list = 'Lista de los Usuarios'; - $lang->cmd_module_config = 'Configuración predefinidos'; - $lang->cmd_member_group = 'Manejo del grupo'; - $lang->cmd_send_mail = 'Enviar Email'; - $lang->cmd_manage_id = 'Manejo de ID prohibidos'; - $lang->cmd_manage_form = 'Manejo de forma del registro'; - $lang->cmd_view_own_document = 'Ver documentos escritos'; - $lang->cmd_manage_member_info = 'Manage Member Info'; - $lang->cmd_trace_document = 'Trace Written Articles'; - $lang->cmd_trace_comment = 'Trace Written Comments'; - $lang->cmd_view_scrapped_document = 'Ver Scraps'; - $lang->cmd_view_saved_document = 'Ver artículos guardados'; - $lang->cmd_send_email = 'Enviar Email'; - - $lang->msg_email_not_exists = "Email address doesn't exists"; - - $lang->msg_alreay_scrapped = 'Este documento ya esta hecho scrap'; - - $lang->msg_cart_is_null = 'Seleciona el objetivo'; - $lang->msg_checked_file_is_deleted = '%d archivos adjuntos son eliminados'; - - $lang->msg_find_account_title = 'Account Info'; - $lang->msg_find_account_info = 'Esto se solicita la información de la cuenta'; - $lang->msg_find_account_comment = 'La contraseña se modificará para arriba al hacer clic en un enlace a continuación.
    Por favor, después de modificar la contraseña de acceso.'; - $lang->msg_confirm_account_title = '가입 인증 메일 입니다'; - $lang->msg_confirm_account_info = '가입하신 계정 정보는 아래와 같습니다'; - $lang->msg_confirm_account_comment = '아래 링크를 클릭하시면 가입 인증이 이루어집니다.'; - $lang->msg_auth_mail_sent = 'La autenticación de correo ha sido enviado a% s. Por favor, compruebe su correo.'; - $lang->msg_confirm_mail_sent = '%s 메일로 가입 인증 메일이 발송되었습니다. 메일을 확인하세요.'; - $lang->msg_invalid_auth_key = '잘못된 계정 인증 요청입니다.
    아이디/비밀번호 찾기를 다시 하시거나 사이트 관리자에게 계정 정보를 문의해주세요'; - $lang->msg_success_authed = 'Esto no es válido solicitud de autenticación.
    Por favor, inténtelo encontrar información de la cuenta o póngase en contacto con el administrador.'; - $lang->msg_success_confirmed = '가입 인증이 정상적으로 처리 되었습니다.'; - - $lang->msg_new_member = 'Agregar usuario'; - $lang->msg_update_member = 'Modificar información del usuario'; - $lang->msg_leave_member = 'Dejar de ser usuario'; - $lang->msg_group_is_null = 'No es un grupo registrado'; - $lang->msg_not_delete_default = 'Los artículos predefinidos no pueden ser eliminados'; - $lang->msg_not_exists_member = "Este usuario no existe"; - $lang->msg_cannot_delete_admin = 'ID del Administrador no puede ser eliminado. Remover el ID desde la Administración y trate nuevamente.'; - $lang->msg_exists_user_id = 'Este ID ya existe. Por favor trate con otro ID'; - $lang->msg_exists_email_address = 'Esta dirección del email ya existe. Por favor trate con otra dirección del email.'; - $lang->msg_exists_nick_name = 'Este apodo ya existe. Por favor trate con otro apodo.'; - $lang->msg_signup_disabled = 'Usted no puede ser registrado'; - $lang->msg_already_logged = 'Usted ya ha sido registrado'; - $lang->msg_not_logged = 'Por favor conectese primero'; - $lang->msg_insert_group_name = 'Por favor ingresar el nombre del grupo'; - $lang->msg_check_group = 'Introduce nombre de grupo'; - - $lang->msg_not_uploaded_image_name = 'Imagen del nombre no puede ser registrado'; - $lang->msg_not_uploaded_image_mark = 'Imagen de marca no puede ser resistrado'; - $lang->msg_not_uploaded_group_image_mark = '그룹 이미지 마크를 등록할 수가 없습니다'; - - $lang->msg_accept_agreement = 'Usted primero debe aceptar el acuerdo'; - - $lang->msg_user_denied = 'ID ingresado ha sido prohibido para su uso'; - $lang->msg_user_not_confirmed = '아직 메일 인증이 이루어지지 않았습니다. 메일을 확인해 주세요'; - $lang->msg_user_limited = 'ID ingresado puede ser usado luego de %s'; - - $lang->about_user_id = 'ID del usuario debe ser entre 3-20 letras que consiste en alfabetos+número con alfabeto como primera letra.'; - $lang->about_password = 'Contraseña debe ser entre 6-20 letras'; - $lang->about_user_name = 'Nombre debe ser entre 2-20 letras'; - $lang->about_nick_name = 'Apodo debe ser entre 2-20 letras'; - $lang->about_email_address = 'Dirección de email es usado para modificar/encontrar contraseña luego de la certificación de email'; - $lang->about_homepage = 'Ingresar su sitio web, si es que lo tiene'; - $lang->about_blog_url = 'Ingresar su blog, si es que lo tiene'; - $lang->about_birthday = 'Ingresar su fecha de nacimiento'; - $lang->about_allow_mailing = "Si usted no se ha registrado el envío de email, usted no podrá recibir el email del grupo"; - $lang->about_denied = 'Si selecciona esta opción prohibirá el uso del ID'; - $lang->about_is_admin = 'Si selecciona esta opción para obtener la atribución del administrador superior'; - $lang->about_member_description = "Nota del administrador acerca de los usuarios"; - $lang->about_group = 'Un ID puede pertenecer a muchos grupos'; - - $lang->about_column_type = 'Definir el estilo de la forma de registro que desea agregar'; - $lang->about_column_name = 'Ingresar el nombre en español para poder usar en plantilla (nombre como variable)'; - $lang->about_column_title = 'Esto sera mostrado cuando el usuario registra o modifica/visualiza la información del usuario'; - $lang->about_default_value = 'Usted puede predefinir los valores'; - $lang->about_active = 'Si selecciona "Activar" los artículos seran mostrados en el momento de registrar'; - $lang->about_form_description = 'Si Usted ingresa la forma de la descripción, será mostrado en el momento de registrar'; - $lang->about_required = 'Si selecciona esta opción, será artículo esencial para el registro'; - - $lang->about_enable_openid = 'Selecciona esta opción si activado OpenID'; - $lang->about_enable_join = 'Debe seleccionar esta opción para permitir el registro de los usuarios'; - $lang->about_enable_confirm = '입력된 메일 주소로 인증 메일을 보내 회원 가입을 확인 합니다'; - $lang->about_enable_ssl = '서버에서 SSL지원이 될 경우 회원가입/정보수정/로그인등의 개인정보가 서버로 보내질때 SSL(https)를 이용하도록 할 수 있습니다'; - $lang->about_limit_day = 'Usted puede limitar la fecha de la certificación luego de registrar'; - $lang->about_limit_date = 'Usuario no podra conectarse hasta la fecha indicada'; - $lang->about_after_login_url = '로그인 후 이동할 URL을 정하실 수 있습니다. 비어 있으면 해당 페이지가 유지됩니다.'; - $lang->about_after_logout_url = '로그아웃 후 이동할 URL을 정하실 수 있습니다. 비어 있으면 해당 페이지가 유지됩니다.'; - $lang->about_redirect_url = 'Ingresar la URL que va a abrir luego de registrar los usuarios. Cuando esto esta vacío, se habrirá la página anterior a la del registro.'; - $lang->about_agreement = "Acuerdo del registro no será mostrado si esta vacío"; - - $lang->about_image_name = "Permitir a los usuarios el uso de imagen del nombre en ves del nombre del usuario"; - $lang->about_image_mark = "Permitir a los usuarios el uso de imagen de marca delante de sus nombres"; - $lang->about_group_image_mark = '사용자의 이름앞에 그룹 마크를 달 수 있습니다'; - $lang->about_profile_image = 'Permitir a los usuarios a utilizar nombre de la imagen en lugar de texto nombre'; - $lang->about_accept_agreement = "Yo he leído todo el acuerdo y acepto"; - - $lang->about_member_default = 'Al registrar se configura como grupo predefinido'; - - $lang->about_openid = 'Cuando tu registra como OpenID, la información básica como ID o la dirección del email sera guardado en este sitio, pero la contraseña y la resolución de la certificación se hará en el servicio ofrecido por openID'; - $lang->about_openid_leave = 'La secesión de OpenID medios eliminación de su información de miembros de este sitio.
    Si se registra después de la secesión, se le reconocerá como un nuevo miembro, de modo que ya no tienen el permiso para que su ex-escrito artículos.'; - - $lang->about_member = "Esto es un módulo para crear/modificar/eliminar usuarios y manejar grupos o el formato del registro.\n Usted puede manejar usuarios creando nuevos grupos, y obtener información adicional manejando el formato del registro"; - $lang->about_find_member_account = 'Su información de la cuenta será observado por dirección de correo electrónico registrada.
    Introduce la dirección de correo electrónico que usted tiene de entrada en el registro, y pulse "Buscar" Información de la cuenta ".
    '; - $lang->about_ssl_port = 'Please input if you are using different SSL port with default one'; - $lang->add_openid = 'Add OpenID'; - - $lang->about_resend_auth_mail = 'You can request for authentication mail if you have failed before.'; - $lang->no_article = 'There exists no article'; - - $lang->find_account_question = '비밀번호 찾기 질문/답변'; - $lang->find_account_answer = '비밀번호 찾기 답변'; - $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; - /* - $lang->find_account_question_items = array('' - ,'다른 이메일 주소는?' - ,'나의 보물 1호는?' - ,'나의 출신 초등학교는?' - ,'나의 출신 고향은?' - ,'나의 이상형은?' - ,'어머니 성함은?' - ,'아버지 성함은?' - ,'가장 좋아하는 색깔은?' - ,'가장 좋아하는 음식은?' - ); -*/ - $lang->temp_password = '임시 비밀번호'; - $lang->cmd_get_temp_password = '임시 비밀번호 발급'; - $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; - $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; - $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; - - $lang->change_password_date = '비밀번호 갱신주기'; - $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; - -?> +member = 'Usuario'; + $lang->member_default_info = 'Información Basica'; + $lang->member_extend_info = 'Información adicional'; + $lang->default_group_1 = "Usuario registrado"; + $lang->default_group_2 = "Usuario regular"; + $lang->admin_group = "Manejo del grupo"; + $lang->keep_signed = 'Keep me signed in'; + $lang->remember_user_id = 'Guardar ID'; + $lang->already_logged = "Ya está conectado"; + $lang->denied_user_id = 'Este ID está prohibido.'; + $lang->null_user_id = 'IngresarID'; + $lang->null_password = 'Ingresar la contraseña'; + $lang->invalid_authorization = 'No está certificado'; + $lang->invalid_user_id= "Este ID no existe"; + $lang->invalid_password = 'Contraseña incorrecta'; + $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; + $lang->allow_mailing = 'Registro del envío de mail'; + $lang->denied = 'Prohibido'; + $lang->is_admin = 'Atribución del administrador superior'; + $lang->group = 'Grupo asignado'; + $lang->group_title = 'Nombre del grupo'; + $lang->group_srl = 'Número del grupo'; + $lang->signature = 'Firma'; + $lang->profile_image = 'Perfil de Imagen'; + $lang->profile_image_max_width = 'Max Anchura'; + $lang->profile_image_max_height = 'Max Altura'; + $lang->image_name = 'Nombre de la imagen'; + $lang->image_name_max_width = 'Ancho Máximo'; + $lang->image_name_max_height = 'Altura Máxima'; + $lang->image_mark = 'Marca de la imagen'; + $lang->image_mark_max_width = 'Ancho Máximo'; + $lang->image_mark_max_height = 'Altura Máxima'; + $lang->group_image_mark = 'Group Image Mark'; + $lang->group_image_mark_max_width = 'Ancho Máximo'; + $lang->group_image_mark_max_height = 'Altura Máxima'; + $lang->group_image_mark_order = '그룹 이미지 마크 순서'; + $lang->enable_openid = 'Activar OpenID'; + $lang->enable_join = 'Permitir el registro del usuario'; + $lang->enable_confirm = '메일 인증 사용'; + $lang->enable_ssl = 'Activar SSL'; + $lang->security_sign_in = 'Sign in using enhanced security'; + $lang->limit_day = 'Límite de la fecha temporal'; + $lang->limit_date = 'Límite de fecha'; + $lang->after_login_url = 'URL después del inicio de sesión'; + $lang->after_logout_url = 'URL después de cerrar sesión'; + $lang->redirect_url = 'URL luego del registro'; + $lang->agreement = 'Acuerdo del registro del usuario'; + $lang->accept_agreement = 'Acepto'; + $lang->member_info = 'Información del Usuario'; + $lang->current_password = 'Contraseña actual'; + $lang->openid = 'OpenID'; + $lang->allow_message = '쪽지 허용'; + $lang->allow_message_type = array( + 'Y' => '모두 허용', + 'F' => '등록된 친구들만 허용', + 'N' => '모두 금지', + ); + $lang->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다'; + $lang->logged_users = 'Logged Users'; + + $lang->webmaster_name = 'Nombre del Webmaster'; + $lang->webmaster_email = 'Correo electrónico Webmaster'; + + $lang->about_keep_signed = '브라우저를 닫더라도 로그인이 계속 유지될 수 있습니다.\n\n로그인 유지 기능을 사용할 경우 다음 접속부터는 로그인을 하실 필요가 없습니다.\n\n단, 게임방, 학교 등 공공장소에서 이용시 개인정보가 유출될 수 있으니 꼭 로그아웃을 해주세요'; + $lang->about_keep_warning = '브라우저를 닫더라도 로그인이 계속 유지될 수 있습니다. 로그인 유지 기능을 사용할 경우 다음 접속부터는 로그인을 하실 필요가 없습니다. 단, 게임방, 학교 등 공공장소에서 이용 시 개인정보가 유출될 수 있으니 꼭 로그아웃을 해주세요.'; + $lang->about_webmaster_name = 'Por favor, webmaster de entrada el nombre que se utilizará para la autenticación de los correos u otros sitio de la administración. (Por defecto: webmaster)'; + $lang->about_webmaster_email = 'Introduzca la dirección de correo electrónico webmaster.'; + + $lang->search_target_list = array( + 'user_id' => 'ID', + 'user_name' => 'Nombre', + 'nick_name' => 'Apodo', + 'email_address' => 'Dirección de Email', + 'regdate' => 'Fecha del registro', + 'regdate_more' => '가입일시(이상)', + 'regdate_less' => '가입일시(이하)', + 'last_login' => 'Fecha de su última conección', + 'last_login_more' => '최근로그인일시(이상)', + 'last_login_less' => '최근로그인일시(이하)', + 'extra_vars' => 'Variables Extra', + ); + + + $lang->cmd_login = 'Conectar'; + $lang->cmd_logout = 'Desconectar'; + $lang->cmd_signup = 'Registrar'; + $lang->cmd_site_signup = 'Join'; + $lang->cmd_modify_member_info = 'Modificar nombre del usuario'; + $lang->cmd_modify_member_password = 'Cambiar la contraseña'; + $lang->cmd_view_member_info = 'Información del usuario'; + $lang->cmd_leave = 'Dejar de ser usuario'; + $lang->cmd_find_member_account = 'Find Account Info'; + + $lang->cmd_member_list = 'Lista de los Usuarios'; + $lang->cmd_module_config = 'Configuración predefinidos'; + $lang->cmd_member_group = 'Manejo del grupo'; + $lang->cmd_send_mail = 'Enviar Email'; + $lang->cmd_manage_id = 'Manejo de ID prohibidos'; + $lang->cmd_manage_form = 'Manejo de forma del registro'; + $lang->cmd_view_own_document = 'Ver documentos escritos'; + $lang->cmd_manage_member_info = 'Manage Member Info'; + $lang->cmd_trace_document = 'Trace Written Articles'; + $lang->cmd_trace_comment = 'Trace Written Comments'; + $lang->cmd_view_scrapped_document = 'Ver Scraps'; + $lang->cmd_view_saved_document = 'Ver artículos guardados'; + $lang->cmd_send_email = 'Enviar Email'; + + $lang->msg_email_not_exists = "Email address doesn't exists"; + + $lang->msg_alreay_scrapped = 'Este documento ya esta hecho scrap'; + + $lang->msg_cart_is_null = 'Seleciona el objetivo'; + $lang->msg_checked_file_is_deleted = '%d archivos adjuntos son eliminados'; + + $lang->msg_find_account_title = 'Account Info'; + $lang->msg_find_account_info = 'Esto se solicita la información de la cuenta'; + $lang->msg_find_account_comment = 'La contraseña se modificará para arriba al hacer clic en un enlace a continuación.
    Por favor, después de modificar la contraseña de acceso.'; + $lang->msg_confirm_account_title = '가입 인증 메일 입니다'; + $lang->msg_confirm_account_info = '가입하신 계정 정보는 아래와 같습니다'; + $lang->msg_confirm_account_comment = '아래 링크를 클릭하시면 가입 인증이 이루어집니다.'; + $lang->msg_auth_mail_sent = 'La autenticación de correo ha sido enviado a% s. Por favor, compruebe su correo.'; + $lang->msg_confirm_mail_sent = '%s 메일로 가입 인증 메일이 발송되었습니다. 메일을 확인하세요.'; + $lang->msg_invalid_auth_key = '잘못된 계정 인증 요청입니다.
    아이디/비밀번호 찾기를 다시 하시거나 사이트 관리자에게 계정 정보를 문의해주세요'; + $lang->msg_success_authed = 'Esto no es válido solicitud de autenticación.
    Por favor, inténtelo encontrar información de la cuenta o póngase en contacto con el administrador.'; + $lang->msg_success_confirmed = '가입 인증이 정상적으로 처리 되었습니다.'; + + $lang->msg_new_member = 'Agregar usuario'; + $lang->msg_update_member = 'Modificar información del usuario'; + $lang->msg_leave_member = 'Dejar de ser usuario'; + $lang->msg_group_is_null = 'No es un grupo registrado'; + $lang->msg_not_delete_default = 'Los artículos predefinidos no pueden ser eliminados'; + $lang->msg_not_exists_member = "Este usuario no existe"; + $lang->msg_cannot_delete_admin = 'ID del Administrador no puede ser eliminado. Remover el ID desde la Administración y trate nuevamente.'; + $lang->msg_exists_user_id = 'Este ID ya existe. Por favor trate con otro ID'; + $lang->msg_exists_email_address = 'Esta dirección del email ya existe. Por favor trate con otra dirección del email.'; + $lang->msg_exists_nick_name = 'Este apodo ya existe. Por favor trate con otro apodo.'; + $lang->msg_signup_disabled = 'Usted no puede ser registrado'; + $lang->msg_already_logged = 'Usted ya ha sido registrado'; + $lang->msg_not_logged = 'Por favor conectese primero'; + $lang->msg_insert_group_name = 'Por favor ingresar el nombre del grupo'; + $lang->msg_check_group = 'Introduce nombre de grupo'; + + $lang->msg_not_uploaded_image_name = 'Imagen del nombre no puede ser registrado'; + $lang->msg_not_uploaded_image_mark = 'Imagen de marca no puede ser resistrado'; + $lang->msg_not_uploaded_group_image_mark = '그룹 이미지 마크를 등록할 수가 없습니다'; + + $lang->msg_accept_agreement = 'Usted primero debe aceptar el acuerdo'; + + $lang->msg_user_denied = 'ID ingresado ha sido prohibido para su uso'; + $lang->msg_user_not_confirmed = '아직 메일 인증이 이루어지지 않았습니다. 메일을 확인해 주세요'; + $lang->msg_user_limited = 'ID ingresado puede ser usado luego de %s'; + + $lang->about_user_id = 'ID del usuario debe ser entre 3-20 letras que consiste en alfabetos+número con alfabeto como primera letra.'; + $lang->about_password = 'Contraseña debe ser entre 6-20 letras'; + $lang->about_user_name = 'Nombre debe ser entre 2-20 letras'; + $lang->about_nick_name = 'Apodo debe ser entre 2-20 letras'; + $lang->about_email_address = 'Dirección de email es usado para modificar/encontrar contraseña luego de la certificación de email'; + $lang->about_homepage = 'Ingresar su sitio web, si es que lo tiene'; + $lang->about_blog_url = 'Ingresar su blog, si es que lo tiene'; + $lang->about_birthday = 'Ingresar su fecha de nacimiento'; + $lang->about_allow_mailing = "Si usted no se ha registrado el envío de email, usted no podrá recibir el email del grupo"; + $lang->about_denied = 'Si selecciona esta opción prohibirá el uso del ID'; + $lang->about_is_admin = 'Si selecciona esta opción para obtener la atribución del administrador superior'; + $lang->about_member_description = "Nota del administrador acerca de los usuarios"; + $lang->about_group = 'Un ID puede pertenecer a muchos grupos'; + + $lang->about_column_type = 'Definir el estilo de la forma de registro que desea agregar'; + $lang->about_column_name = 'Ingresar el nombre en español para poder usar en plantilla (nombre como variable)'; + $lang->about_column_title = 'Esto sera mostrado cuando el usuario registra o modifica/visualiza la información del usuario'; + $lang->about_default_value = 'Usted puede predefinir los valores'; + $lang->about_active = 'Si selecciona "Activar" los artículos seran mostrados en el momento de registrar'; + $lang->about_form_description = 'Si Usted ingresa la forma de la descripción, será mostrado en el momento de registrar'; + $lang->about_required = 'Si selecciona esta opción, será artículo esencial para el registro'; + + $lang->about_enable_openid = 'Selecciona esta opción si activado OpenID'; + $lang->about_enable_join = 'Debe seleccionar esta opción para permitir el registro de los usuarios'; + $lang->about_enable_confirm = '입력된 메일 주소로 인증 메일을 보내 회원 가입을 확인 합니다'; + $lang->about_enable_ssl = '서버에서 SSL지원이 될 경우 회원가입/정보수정/로그인등의 개인정보가 서버로 보내질때 SSL(https)를 이용하도록 할 수 있습니다'; + $lang->about_limit_day = 'Usted puede limitar la fecha de la certificación luego de registrar'; + $lang->about_limit_date = 'Usuario no podra conectarse hasta la fecha indicada'; + $lang->about_after_login_url = '로그인 후 이동할 URL을 정하실 수 있습니다. 비어 있으면 해당 페이지가 유지됩니다.'; + $lang->about_after_logout_url = '로그아웃 후 이동할 URL을 정하실 수 있습니다. 비어 있으면 해당 페이지가 유지됩니다.'; + $lang->about_redirect_url = 'Ingresar la URL que va a abrir luego de registrar los usuarios. Cuando esto esta vacío, se habrirá la página anterior a la del registro.'; + $lang->about_agreement = "Acuerdo del registro no será mostrado si esta vacío"; + + $lang->about_image_name = "Permitir a los usuarios el uso de imagen del nombre en ves del nombre del usuario"; + $lang->about_image_mark = "Permitir a los usuarios el uso de imagen de marca delante de sus nombres"; + $lang->about_group_image_mark = '사용자의 이름앞에 그룹 마크를 달 수 있습니다'; + $lang->about_profile_image = 'Permitir a los usuarios a utilizar nombre de la imagen en lugar de texto nombre'; + $lang->about_accept_agreement = "Yo he leído todo el acuerdo y acepto"; + + $lang->about_member_default = 'Al registrar se configura como grupo predefinido'; + + $lang->about_openid = 'Cuando tu registra como OpenID, la información básica como ID o la dirección del email sera guardado en este sitio, pero la contraseña y la resolución de la certificación se hará en el servicio ofrecido por openID'; + $lang->about_openid_leave = 'La secesión de OpenID medios eliminación de su información de miembros de este sitio.
    Si se registra después de la secesión, se le reconocerá como un nuevo miembro, de modo que ya no tienen el permiso para que su ex-escrito artículos.'; + + $lang->about_member = "Esto es un módulo para crear/modificar/eliminar usuarios y manejar grupos o el formato del registro.\n Usted puede manejar usuarios creando nuevos grupos, y obtener información adicional manejando el formato del registro"; + $lang->about_find_member_account = 'Su información de la cuenta será observado por dirección de correo electrónico registrada.
    Introduce la dirección de correo electrónico que usted tiene de entrada en el registro, y pulse "Buscar" Información de la cuenta ".
    '; + $lang->about_ssl_port = 'Please input if you are using different SSL port with default one'; + $lang->add_openid = 'Add OpenID'; + + $lang->about_resend_auth_mail = 'You can request for authentication mail if you have failed before.'; + $lang->no_article = 'There exists no article'; + + $lang->find_account_question = '비밀번호 찾기 질문/답변'; + $lang->find_account_answer = '비밀번호 찾기 답변'; + $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; + /* + $lang->find_account_question_items = array('' + ,'다른 이메일 주소는?' + ,'나의 보물 1호는?' + ,'나의 출신 초등학교는?' + ,'나의 출신 고향은?' + ,'나의 이상형은?' + ,'어머니 성함은?' + ,'아버지 성함은?' + ,'가장 좋아하는 색깔은?' + ,'가장 좋아하는 음식은?' + ); +*/ + $lang->temp_password = '임시 비밀번호'; + $lang->cmd_get_temp_password = '임시 비밀번호 발급'; + $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; + $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; + $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; + + $lang->change_password_date = '비밀번호 갱신주기'; + $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; + +?> diff --git a/modules/member/lang/fr.lang.php b/modules/member/lang/fr.lang.php index 80f38c991..4060590e2 100644 --- a/modules/member/lang/fr.lang.php +++ b/modules/member/lang/fr.lang.php @@ -1,241 +1,241 @@ -member = 'Membre'; - $lang->member_default_info = 'Information fondamentale'; - $lang->member_extend_info = 'Information additionnelle'; - $lang->default_group_1 = "Membre Associé"; - $lang->default_group_2 = "Membre Régulier"; - $lang->admin_group = "Groupe des administrateurs"; - $lang->keep_signed = 'Garder la session ouverte'; - $lang->remember_user_id = 'Mémorisez mon Compte'; - $lang->already_logged = "La session est déjà ouverte"; - $lang->denied_user_id = 'C\'est un comte interdit.'; - $lang->null_user_id = 'Entrez le compte, S.V.P.'; - $lang->null_password = 'Entrez le mot de passe, S.V.P.'; - $lang->invalid_authorization = 'Le compte n\'est pas encore certifié.'; - $lang->invalid_user_id= "C'est un compte qui n'existe pas."; - $lang->invalid_password = 'C\'est un mot de passe invalide'; - $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; - $lang->allow_mailing = 'Inscrire au Mailing'; - $lang->denied = 'Arrêté à utiliser'; - $lang->is_admin = 'Permission Superadministrative'; - $lang->group = 'Groupe assigné'; - $lang->group_title = 'Nom du Groupe'; - $lang->group_srl = 'Numéro du Groupe'; - $lang->signature = 'Signature'; - $lang->profile_image = 'Image du profil'; - $lang->profile_image_max_width = 'Largeur Maximum'; - $lang->profile_image_max_height = 'Hauteur Maximum'; - $lang->image_name = 'Nom en Image'; - $lang->image_name_max_width = 'Largeur Maximum'; - $lang->image_name_max_height = 'Hauteur Maximum'; - $lang->image_mark = 'Marque en Image'; - $lang->image_mark_max_width = 'Largeur Maximum'; - $lang->image_mark_max_height = 'Hauteur Maximum'; - $lang->group_image_mark = 'Group Image Mark'; - $lang->group_image_mark_max_width = 'Largeur Maximum'; - $lang->group_image_mark_max_height = 'Hauteur Maximum'; - $lang->group_image_mark_order = '그룹 이미지 마크 순서'; - $lang->signature_max_height = 'Hauteur Maximum de la Signature'; - $lang->enable_openid = 'Permettre OpenID'; - $lang->enable_join = 'Permettre l\'inscription'; - $lang->enable_confirm = 'Utiliser Authentification par mél'; - $lang->enable_ssl = 'Utiliser SSL'; - $lang->security_sign_in = 'Ouvrir une Session en utilisant sécurité rehaussé'; - $lang->limit_day = 'Jour de Limite Temporaire'; - $lang->limit_date = 'Jour de Limite'; - $lang->after_login_url = 'URL après la connexion'; - $lang->after_logout_url = 'URL après la déconnexion '; - $lang->redirect_url = 'URL après l\'Inscription'; - $lang->agreement = 'Accord de l\'Inscription comme Membre'; - $lang->accept_agreement = 'D\'accord'; - $lang->member_info = 'Information de Membre'; - $lang->current_password = 'Mot de Passe courant'; - $lang->openid = 'OpenID'; - $lang->allow_message = '쪽지 허용'; - $lang->allow_message_type = array( - 'Y' => '모두 허용', - 'F' => '등록된 친구들만 허용', - 'N' => '모두 금지', - ); - $lang->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다'; - $lang->logged_users = 'Logged Users'; - - $lang->webmaster_name = "Nom de Webmestre"; - $lang->webmaster_email = "Mél de Webmestre"; - - $lang->about_keep_signed = 'Malgré que le navigateur est fermé, votre session peut rester ouverte. \n\nSi vous utilisez cette fonction sur l\'ordinateur publique, vos informations privé peut être exposé. Nous vous recommandons de ne pas utiliser cette fonctions sur l\'ordinateur publique.'; - $lang->about_keep_warning = 'Malgré que le navigateur est fermé, votre session peut rester ouverte. Si vous utilisez cette fonction sur l\'ordinateur publique, vos informations privé peut être exposé. Nous vous recommandons de ne pas utiliser cette fonctions sur l\'ordinateur publique.'; - $lang->about_webmaster_name = "Entrez le nom de webmestre qui va être utilisé pour le mél de certification ou l\'autre administration du site. (défaut : webmestre)"; - $lang->about_webmaster_email = "Entrez l\'adresse du mél de webmestre, S.V.P."; - - $lang->search_target_list = array( - 'user_id' => 'Compte', - 'user_name' => 'Nom', - 'nick_name' => 'Surnom', - 'email_address' => 'Mél', - 'regdate' => 'Jour d\'Inscription', - 'regdate_more' => '가입일시(이상)', - 'regdate_less' => '가입일시(이하)', - 'last_login' => 'Jour de la connexion dernière', - 'last_login_more' => '최근로그인일시(이상)', - 'last_login_less' => '최근로그인일시(이하)', - 'extra_vars' => 'Variables additionnels ', - ); - - $lang->cmd_login = 'Connexion'; - $lang->cmd_logout = 'Déconnexion'; - $lang->cmd_signup = 'Inscription'; - $lang->cmd_site_signup = 'Join'; - $lang->cmd_modify_member_info = 'Modifier Mon Information'; - $lang->cmd_modify_member_password = 'Modifier le Mot de Passe'; - $lang->cmd_view_member_info = 'Voir Mon Information'; - $lang->cmd_leave = 'Quitter'; - $lang->cmd_find_member_account = 'J\'ai perdu le compte / le mot de passe'; - $lang->cmd_resend_auth_mail = '인증 메일 재발송'; - - $lang->cmd_member_list = 'Liste de Membres'; - $lang->cmd_module_config = 'Configuration par Défaut'; - $lang->cmd_member_group = 'Administrer des Groupes'; - $lang->cmd_send_mail = 'Envoyer des Méls'; - $lang->cmd_manage_id = 'Administrer les Comptes Interdits'; - $lang->cmd_manage_form = 'Administrer la Forme d\'Inscription'; - $lang->cmd_view_own_document = 'Voir les Articles écrits'; - $lang->cmd_manage_member_info = 'Manage Member Info'; - $lang->cmd_trace_document = 'Tracer les Articles écrits'; - $lang->cmd_trace_comment = 'Tracer les Commentaires écrits'; - $lang->cmd_view_scrapped_document = 'Voir les Coupures'; - $lang->cmd_view_saved_document = 'Voir les Articles conservés'; - $lang->cmd_send_email = 'Envoyer des Méls'; - - $lang->msg_email_not_exists = "L'adresse mél n'existe pas."; - - $lang->msg_alreay_scrapped = 'Cet article est déjà coupé.'; - - $lang->msg_cart_is_null = 'Choisissez l\'Objet, S.V.P.'; - $lang->msg_checked_file_is_deleted = '%d fichier(s) attaché(s) est(sont) supprimé(s)'; - - $lang->msg_find_account_title = 'Information de compte'; - $lang->msg_find_account_info = 'Voilà votre information de compte.'; - $lang->msg_find_account_comment = 'Le Mot de Passe sera modifié comme celui ci-dessus si vous cliquez le lien ci-dessous.
    Modifiez le Mot de Passe après ouvrir la connexion, S.V.P.'; - $lang->msg_confirm_account_title = 'Mél à confirmer l\'Authentification'; - $lang->msg_confirm_account_info = 'Voilà votre Information de l\'inscription du Compte:'; - $lang->msg_confirm_account_comment = 'Cliquez le lien de confirmation suivant pour compléter votre inscription.'; - $lang->msg_auth_mail_sent = 'Le mél de certification a été envoyé à %s. Vérifiez votre mél.'; - $lang->msg_confirm_mail_sent = 'On a justement envoyé un mél de confirmation à %s. Cliquez sur le lien de confirmation dans le mél pour compléter l\'inscription.'; - $lang->msg_invalid_auth_key = 'Cette Requête à Certifier est invalide.
    Essayez encore une fois à retrouver votre information de compte ou contactez l\'administrateur.'; - $lang->msg_success_authed = 'Votre compte a été certifié avec succès et ouvert une session. \n Modifiez le Mot de Passe après vous ouvrez une session en utilisant le Mot de Passe dans le mél.'; - $lang->msg_success_confirmed = 'L\'authentification est complétée avec succèss.'; - - $lang->msg_new_member = 'Ajouter un membre'; - $lang->msg_update_member = 'Modifier l\'Information de Membre'; - $lang->msg_leave_member = 'Sécession'; - $lang->msg_group_is_null = 'Il n\'y a pas de groupe enrégistré'; - $lang->msg_not_delete_default = 'Elément fondamental ne pourra pas être supprimé'; - $lang->msg_not_exists_member = "Membre Invalide"; - $lang->msg_cannot_delete_admin = 'Le Compte de l\'Administrateur ne pourra pas être supprimé. Annulez l\'administration du compte et essayez encore une fois.'; - $lang->msg_exists_user_id = 'Le compte existe déjà. Essayez un autre.'; - $lang->msg_exists_email_address = 'L\'adresse mél existe déjà. Essayez une autre.'; - $lang->msg_exists_nick_name = 'Le surnom existe déjà. Essayez un autre.'; - $lang->msg_signup_disabled = 'Vous ne pouvez pas vous inscrire.'; - $lang->msg_already_logged = 'Vous vous êtes déjà inscrit(e).'; - $lang->msg_not_logged = 'Ouvrez une session d\'abord'; - $lang->msg_insert_group_name = 'Entrez le nom de groupe, S.V.P.'; - $lang->msg_check_group = 'Choisissez le groupe'; - - $lang->msg_not_uploaded_profile_image = 'L\'image de Profil n\'a pas pu être enrégistré'; - $lang->msg_not_uploaded_image_name = 'Le nom d\'image n\'a pas pu être enrégistré'; - $lang->msg_not_uploaded_image_mark = 'La marque en image n\'a pas pu être enrégistrée'; - $lang->msg_not_uploaded_group_image_mark = '그룹 이미지 마크를 등록할 수가 없습니다'; - - $lang->msg_accept_agreement = 'Vous devez agréer l\'accord'; - - $lang->msg_user_denied = 'Le compte que vous avez entré est suspendu'; - $lang->msg_user_not_confirmed = 'Vous n\'avez pas encore authentifié. Verifiez votre mél, S.V.P.'; - $lang->msg_user_limited = 'Vous avez entré un compte qui peut être utilisé depuis %s'; - - $lang->about_user_id = 'Le compte d\'utilisateur doit être long de 3~20 lettres et se composer des alphabets et des chiffres avec un alphabet au premier.'; - $lang->about_password = 'Le Mot de Passe doit être long de 6~20 lettres.'; - $lang->about_user_name = 'Le Nom doit être long de 2~20 lettres.'; - $lang->about_nick_name = 'Le Surnom doit être long de 2~20 lettres.'; - $lang->about_email_address = 'L\'Adresse mél sera utilisé à modifier/trouver le Mot de Passe après la certification en mél.'; - $lang->about_homepage = 'Entrez si vous avez un site Web.'; - $lang->about_blog_url = 'Entrez si vous avez un blogue.'; - $lang->about_birthday = 'Entrez votre anniversaire.'; - $lang->about_allow_mailing = "Si vous ne vous inscrivez pas sur mailing, vous ne pouvez pas recevoir le mél du groupe."; - $lang->about_denied = 'Cocher pour interdire le compte'; - $lang->about_is_admin = 'Cocher pour autoriser la permission de Superadministrateur'; - $lang->about_member_description = "La description de l\'Administrateur sur le membre"; - $lang->about_group = 'Un compte peut appartenir aux plusieurs groupes.'; - - $lang->about_column_type = 'Choisissez la format que vous voulez ajouter'; - $lang->about_column_name = 'Entrez le nom composé en alphabet qui peut être utilisé dans le modèle (nom comme variable)'; - $lang->about_column_title = 'Ce titre sera exposé sur la formule d\'inscription ou sur l\'écran pour modifier/voir les informations de membre'; - $lang->about_default_value = 'Vous pouvez mettre les valeurs par défaut'; - $lang->about_active = 'Cochez si vous voulez l\'exposer sur la formule d\'inscription'; - $lang->about_form_description = 'Si vous entrez la description, elle sera exposé sur la formule d\'incription'; - $lang->about_required = 'Si vous cochez, ce sera obligatoire'; - - $lang->about_enable_openid = 'Cochez si vous voulez permettre OpenID'; - $lang->about_enable_join = 'Cochez si vous voulez permettre l\'inscription'; - $lang->about_enable_confirm = 'Envoyer mél de confirmation pour compléter l\'inscription.'; - $lang->about_enable_ssl = 'Les informations personnelles (Inscription / Modification des informations du membre / Connexion) peuvent être envoyées comme mode SSL(https) si le serveur offre le service SSL.'; - $lang->about_limit_day = 'Vous pouvez limiter le jour de certification après l\'inscription'; - $lang->about_limit_date = 'Utilisateur ne peut pas ouverir la connexion jusqu\'au jour assigné'; - $lang->about_after_login_url = 'Vous pouvez indiquer URL où l\'on va après la connexion. Le vide signifie la page courante.'; - $lang->about_after_logout_url = 'Vous pouvez indiquer URL où l\'on va après la déconnexion. Le vide signifie la page courrante.'; - $lang->about_redirect_url = 'Entrez URL où l\'utilisateur irra après l\'inscription, S.V.P. Si c\'est vide, ce sera la page précédente de la page d\'inscription.'; - $lang->about_agreement = "L'Accord d'Inscription comme Membre sera exposé seulement quand il n'est pas vide."; - - $lang->about_image_name = "Permettre aux utilisateurs d'utiliser une image pour présenter leurs noms au lieu des lettres"; - $lang->about_image_mark = "Permettre aux utilisateurs d'utiliser une marque devent leurs noms"; - $lang->about_group_image_mark = '사용자의 이름앞에 그룹 마크를 달 수 있습니다'; - $lang->about_profile_image = 'Permettre aux utilisateurs d\'utiliser une image de profil'; - $lang->about_accept_agreement = "J'ai lu l'Accord et je suis d'accord."; - - $lang->about_member_default = 'On sera par défaut dans ce groupe après l\'inscription'; - - $lang->about_openid = 'Si vous vous inscrivez avec OpenID, vos informations primaires comme le Compte(ID) ou l\'adresse mél sera gardés sur ce site. Mais le procès pour le Mot de Passe et la certification sera fait sur le service courant qui offre OpenID'; - $lang->about_openid_leave = 'La sécession de OpenID nous fait supprimer vos informations du membre dans notre site.
    Si vous ouvrez la connexion après la sécession, nous vous reconnaîtrons comme un nouveau membre, c\'est-à-dire, vous n\'aurez plus la permission sur les articles que vous avez écrits avant.'; - - $lang->about_find_member_account = 'L\information de votre compte sera annoncé par le mél sur l\'inscription.
    Entrez l\'adresse mél que vous avez entré sur l\'inscription et appuyez le bouton "Recherce l\'Information du Compte".
    '; - - $lang->about_member = "C'est le module pour administrer des membres avec lequel vous pouvez créer/modifier/supprimer des membres ou administrer les groupes et la formule d'inscription.\nVous pouvez administrer membres par création un nouveau groupe, ou gagner les informations additionnelles par l'administration la formule d'inscrioption."; - $lang->about_find_member_account = 'Your account info will be noticed by registered email address.
    Please input email address which you have input on registration, and press "Find Account Info" button.
    '; - $lang->about_ssl_port = 'Please input if you are using different SSL port with default one'; - $lang->add_openid = 'Add OpenID'; - - $lang->about_resend_auth_mail = 'You can request for authentication mail if you have failed before.'; - $lang->no_article = 'There exists no article'; - - $lang->find_account_question = '비밀번호 찾기 질문/답변'; - $lang->find_account_answer = '비밀번호 찾기 답변'; - $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; - /* - $lang->find_account_question_items = array('' - ,'다른 이메일 주소는?' - ,'나의 보물 1호는?' - ,'나의 출신 초등학교는?' - ,'나의 출신 고향은?' - ,'나의 이상형은?' - ,'어머니 성함은?' - ,'아버지 성함은?' - ,'가장 좋아하는 색깔은?' - ,'가장 좋아하는 음식은?' - ); -*/ - $lang->temp_password = '임시 비밀번호'; - $lang->cmd_get_temp_password = '임시 비밀번호 발급'; - $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; - $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; - $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; - - $lang->change_password_date = '비밀번호 갱신주기'; - $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; - -?> +member = 'Membre'; + $lang->member_default_info = 'Information fondamentale'; + $lang->member_extend_info = 'Information additionnelle'; + $lang->default_group_1 = "Membre Associé"; + $lang->default_group_2 = "Membre Régulier"; + $lang->admin_group = "Groupe des administrateurs"; + $lang->keep_signed = 'Garder la session ouverte'; + $lang->remember_user_id = 'Mémorisez mon Compte'; + $lang->already_logged = "La session est déjà ouverte"; + $lang->denied_user_id = 'C\'est un comte interdit.'; + $lang->null_user_id = 'Entrez le compte, S.V.P.'; + $lang->null_password = 'Entrez le mot de passe, S.V.P.'; + $lang->invalid_authorization = 'Le compte n\'est pas encore certifié.'; + $lang->invalid_user_id= "C'est un compte qui n'existe pas."; + $lang->invalid_password = 'C\'est un mot de passe invalide'; + $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; + $lang->allow_mailing = 'Inscrire au Mailing'; + $lang->denied = 'Arrêté à utiliser'; + $lang->is_admin = 'Permission Superadministrative'; + $lang->group = 'Groupe assigné'; + $lang->group_title = 'Nom du Groupe'; + $lang->group_srl = 'Numéro du Groupe'; + $lang->signature = 'Signature'; + $lang->profile_image = 'Image du profil'; + $lang->profile_image_max_width = 'Largeur Maximum'; + $lang->profile_image_max_height = 'Hauteur Maximum'; + $lang->image_name = 'Nom en Image'; + $lang->image_name_max_width = 'Largeur Maximum'; + $lang->image_name_max_height = 'Hauteur Maximum'; + $lang->image_mark = 'Marque en Image'; + $lang->image_mark_max_width = 'Largeur Maximum'; + $lang->image_mark_max_height = 'Hauteur Maximum'; + $lang->group_image_mark = 'Group Image Mark'; + $lang->group_image_mark_max_width = 'Largeur Maximum'; + $lang->group_image_mark_max_height = 'Hauteur Maximum'; + $lang->group_image_mark_order = '그룹 이미지 마크 순서'; + $lang->signature_max_height = 'Hauteur Maximum de la Signature'; + $lang->enable_openid = 'Permettre OpenID'; + $lang->enable_join = 'Permettre l\'inscription'; + $lang->enable_confirm = 'Utiliser Authentification par mél'; + $lang->enable_ssl = 'Utiliser SSL'; + $lang->security_sign_in = 'Ouvrir une Session en utilisant sécurité rehaussé'; + $lang->limit_day = 'Jour de Limite Temporaire'; + $lang->limit_date = 'Jour de Limite'; + $lang->after_login_url = 'URL après la connexion'; + $lang->after_logout_url = 'URL après la déconnexion '; + $lang->redirect_url = 'URL après l\'Inscription'; + $lang->agreement = 'Accord de l\'Inscription comme Membre'; + $lang->accept_agreement = 'D\'accord'; + $lang->member_info = 'Information de Membre'; + $lang->current_password = 'Mot de Passe courant'; + $lang->openid = 'OpenID'; + $lang->allow_message = '쪽지 허용'; + $lang->allow_message_type = array( + 'Y' => '모두 허용', + 'F' => '등록된 친구들만 허용', + 'N' => '모두 금지', + ); + $lang->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다'; + $lang->logged_users = 'Logged Users'; + + $lang->webmaster_name = "Nom de Webmestre"; + $lang->webmaster_email = "Mél de Webmestre"; + + $lang->about_keep_signed = 'Malgré que le navigateur est fermé, votre session peut rester ouverte. \n\nSi vous utilisez cette fonction sur l\'ordinateur publique, vos informations privé peut être exposé. Nous vous recommandons de ne pas utiliser cette fonctions sur l\'ordinateur publique.'; + $lang->about_keep_warning = 'Malgré que le navigateur est fermé, votre session peut rester ouverte. Si vous utilisez cette fonction sur l\'ordinateur publique, vos informations privé peut être exposé. Nous vous recommandons de ne pas utiliser cette fonctions sur l\'ordinateur publique.'; + $lang->about_webmaster_name = "Entrez le nom de webmestre qui va être utilisé pour le mél de certification ou l\'autre administration du site. (défaut : webmestre)"; + $lang->about_webmaster_email = "Entrez l\'adresse du mél de webmestre, S.V.P."; + + $lang->search_target_list = array( + 'user_id' => 'Compte', + 'user_name' => 'Nom', + 'nick_name' => 'Surnom', + 'email_address' => 'Mél', + 'regdate' => 'Jour d\'Inscription', + 'regdate_more' => '가입일시(이상)', + 'regdate_less' => '가입일시(이하)', + 'last_login' => 'Jour de la connexion dernière', + 'last_login_more' => '최근로그인일시(이상)', + 'last_login_less' => '최근로그인일시(이하)', + 'extra_vars' => 'Variables additionnels ', + ); + + $lang->cmd_login = 'Connexion'; + $lang->cmd_logout = 'Déconnexion'; + $lang->cmd_signup = 'Inscription'; + $lang->cmd_site_signup = 'Join'; + $lang->cmd_modify_member_info = 'Modifier Mon Information'; + $lang->cmd_modify_member_password = 'Modifier le Mot de Passe'; + $lang->cmd_view_member_info = 'Voir Mon Information'; + $lang->cmd_leave = 'Quitter'; + $lang->cmd_find_member_account = 'J\'ai perdu le compte / le mot de passe'; + $lang->cmd_resend_auth_mail = '인증 메일 재발송'; + + $lang->cmd_member_list = 'Liste de Membres'; + $lang->cmd_module_config = 'Configuration par Défaut'; + $lang->cmd_member_group = 'Administrer des Groupes'; + $lang->cmd_send_mail = 'Envoyer des Méls'; + $lang->cmd_manage_id = 'Administrer les Comptes Interdits'; + $lang->cmd_manage_form = 'Administrer la Forme d\'Inscription'; + $lang->cmd_view_own_document = 'Voir les Articles écrits'; + $lang->cmd_manage_member_info = 'Manage Member Info'; + $lang->cmd_trace_document = 'Tracer les Articles écrits'; + $lang->cmd_trace_comment = 'Tracer les Commentaires écrits'; + $lang->cmd_view_scrapped_document = 'Voir les Coupures'; + $lang->cmd_view_saved_document = 'Voir les Articles conservés'; + $lang->cmd_send_email = 'Envoyer des Méls'; + + $lang->msg_email_not_exists = "L'adresse mél n'existe pas."; + + $lang->msg_alreay_scrapped = 'Cet article est déjà coupé.'; + + $lang->msg_cart_is_null = 'Choisissez l\'Objet, S.V.P.'; + $lang->msg_checked_file_is_deleted = '%d fichier(s) attaché(s) est(sont) supprimé(s)'; + + $lang->msg_find_account_title = 'Information de compte'; + $lang->msg_find_account_info = 'Voilà votre information de compte.'; + $lang->msg_find_account_comment = 'Le Mot de Passe sera modifié comme celui ci-dessus si vous cliquez le lien ci-dessous.
    Modifiez le Mot de Passe après ouvrir la connexion, S.V.P.'; + $lang->msg_confirm_account_title = 'Mél à confirmer l\'Authentification'; + $lang->msg_confirm_account_info = 'Voilà votre Information de l\'inscription du Compte:'; + $lang->msg_confirm_account_comment = 'Cliquez le lien de confirmation suivant pour compléter votre inscription.'; + $lang->msg_auth_mail_sent = 'Le mél de certification a été envoyé à %s. Vérifiez votre mél.'; + $lang->msg_confirm_mail_sent = 'On a justement envoyé un mél de confirmation à %s. Cliquez sur le lien de confirmation dans le mél pour compléter l\'inscription.'; + $lang->msg_invalid_auth_key = 'Cette Requête à Certifier est invalide.
    Essayez encore une fois à retrouver votre information de compte ou contactez l\'administrateur.'; + $lang->msg_success_authed = 'Votre compte a été certifié avec succès et ouvert une session. \n Modifiez le Mot de Passe après vous ouvrez une session en utilisant le Mot de Passe dans le mél.'; + $lang->msg_success_confirmed = 'L\'authentification est complétée avec succèss.'; + + $lang->msg_new_member = 'Ajouter un membre'; + $lang->msg_update_member = 'Modifier l\'Information de Membre'; + $lang->msg_leave_member = 'Sécession'; + $lang->msg_group_is_null = 'Il n\'y a pas de groupe enrégistré'; + $lang->msg_not_delete_default = 'Elément fondamental ne pourra pas être supprimé'; + $lang->msg_not_exists_member = "Membre Invalide"; + $lang->msg_cannot_delete_admin = 'Le Compte de l\'Administrateur ne pourra pas être supprimé. Annulez l\'administration du compte et essayez encore une fois.'; + $lang->msg_exists_user_id = 'Le compte existe déjà. Essayez un autre.'; + $lang->msg_exists_email_address = 'L\'adresse mél existe déjà. Essayez une autre.'; + $lang->msg_exists_nick_name = 'Le surnom existe déjà. Essayez un autre.'; + $lang->msg_signup_disabled = 'Vous ne pouvez pas vous inscrire.'; + $lang->msg_already_logged = 'Vous vous êtes déjà inscrit(e).'; + $lang->msg_not_logged = 'Ouvrez une session d\'abord'; + $lang->msg_insert_group_name = 'Entrez le nom de groupe, S.V.P.'; + $lang->msg_check_group = 'Choisissez le groupe'; + + $lang->msg_not_uploaded_profile_image = 'L\'image de Profil n\'a pas pu être enrégistré'; + $lang->msg_not_uploaded_image_name = 'Le nom d\'image n\'a pas pu être enrégistré'; + $lang->msg_not_uploaded_image_mark = 'La marque en image n\'a pas pu être enrégistrée'; + $lang->msg_not_uploaded_group_image_mark = '그룹 이미지 마크를 등록할 수가 없습니다'; + + $lang->msg_accept_agreement = 'Vous devez agréer l\'accord'; + + $lang->msg_user_denied = 'Le compte que vous avez entré est suspendu'; + $lang->msg_user_not_confirmed = 'Vous n\'avez pas encore authentifié. Verifiez votre mél, S.V.P.'; + $lang->msg_user_limited = 'Vous avez entré un compte qui peut être utilisé depuis %s'; + + $lang->about_user_id = 'Le compte d\'utilisateur doit être long de 3~20 lettres et se composer des alphabets et des chiffres avec un alphabet au premier.'; + $lang->about_password = 'Le Mot de Passe doit être long de 6~20 lettres.'; + $lang->about_user_name = 'Le Nom doit être long de 2~20 lettres.'; + $lang->about_nick_name = 'Le Surnom doit être long de 2~20 lettres.'; + $lang->about_email_address = 'L\'Adresse mél sera utilisé à modifier/trouver le Mot de Passe après la certification en mél.'; + $lang->about_homepage = 'Entrez si vous avez un site Web.'; + $lang->about_blog_url = 'Entrez si vous avez un blogue.'; + $lang->about_birthday = 'Entrez votre anniversaire.'; + $lang->about_allow_mailing = "Si vous ne vous inscrivez pas sur mailing, vous ne pouvez pas recevoir le mél du groupe."; + $lang->about_denied = 'Cocher pour interdire le compte'; + $lang->about_is_admin = 'Cocher pour autoriser la permission de Superadministrateur'; + $lang->about_member_description = "La description de l\'Administrateur sur le membre"; + $lang->about_group = 'Un compte peut appartenir aux plusieurs groupes.'; + + $lang->about_column_type = 'Choisissez la format que vous voulez ajouter'; + $lang->about_column_name = 'Entrez le nom composé en alphabet qui peut être utilisé dans le modèle (nom comme variable)'; + $lang->about_column_title = 'Ce titre sera exposé sur la formule d\'inscription ou sur l\'écran pour modifier/voir les informations de membre'; + $lang->about_default_value = 'Vous pouvez mettre les valeurs par défaut'; + $lang->about_active = 'Cochez si vous voulez l\'exposer sur la formule d\'inscription'; + $lang->about_form_description = 'Si vous entrez la description, elle sera exposé sur la formule d\'incription'; + $lang->about_required = 'Si vous cochez, ce sera obligatoire'; + + $lang->about_enable_openid = 'Cochez si vous voulez permettre OpenID'; + $lang->about_enable_join = 'Cochez si vous voulez permettre l\'inscription'; + $lang->about_enable_confirm = 'Envoyer mél de confirmation pour compléter l\'inscription.'; + $lang->about_enable_ssl = 'Les informations personnelles (Inscription / Modification des informations du membre / Connexion) peuvent être envoyées comme mode SSL(https) si le serveur offre le service SSL.'; + $lang->about_limit_day = 'Vous pouvez limiter le jour de certification après l\'inscription'; + $lang->about_limit_date = 'Utilisateur ne peut pas ouverir la connexion jusqu\'au jour assigné'; + $lang->about_after_login_url = 'Vous pouvez indiquer URL où l\'on va après la connexion. Le vide signifie la page courante.'; + $lang->about_after_logout_url = 'Vous pouvez indiquer URL où l\'on va après la déconnexion. Le vide signifie la page courrante.'; + $lang->about_redirect_url = 'Entrez URL où l\'utilisateur irra après l\'inscription, S.V.P. Si c\'est vide, ce sera la page précédente de la page d\'inscription.'; + $lang->about_agreement = "L'Accord d'Inscription comme Membre sera exposé seulement quand il n'est pas vide."; + + $lang->about_image_name = "Permettre aux utilisateurs d'utiliser une image pour présenter leurs noms au lieu des lettres"; + $lang->about_image_mark = "Permettre aux utilisateurs d'utiliser une marque devent leurs noms"; + $lang->about_group_image_mark = '사용자의 이름앞에 그룹 마크를 달 수 있습니다'; + $lang->about_profile_image = 'Permettre aux utilisateurs d\'utiliser une image de profil'; + $lang->about_accept_agreement = "J'ai lu l'Accord et je suis d'accord."; + + $lang->about_member_default = 'On sera par défaut dans ce groupe après l\'inscription'; + + $lang->about_openid = 'Si vous vous inscrivez avec OpenID, vos informations primaires comme le Compte(ID) ou l\'adresse mél sera gardés sur ce site. Mais le procès pour le Mot de Passe et la certification sera fait sur le service courant qui offre OpenID'; + $lang->about_openid_leave = 'La sécession de OpenID nous fait supprimer vos informations du membre dans notre site.
    Si vous ouvrez la connexion après la sécession, nous vous reconnaîtrons comme un nouveau membre, c\'est-à-dire, vous n\'aurez plus la permission sur les articles que vous avez écrits avant.'; + + $lang->about_find_member_account = 'L\information de votre compte sera annoncé par le mél sur l\'inscription.
    Entrez l\'adresse mél que vous avez entré sur l\'inscription et appuyez le bouton "Recherce l\'Information du Compte".
    '; + + $lang->about_member = "C'est le module pour administrer des membres avec lequel vous pouvez créer/modifier/supprimer des membres ou administrer les groupes et la formule d'inscription.\nVous pouvez administrer membres par création un nouveau groupe, ou gagner les informations additionnelles par l'administration la formule d'inscrioption."; + $lang->about_find_member_account = 'Your account info will be noticed by registered email address.
    Please input email address which you have input on registration, and press "Find Account Info" button.
    '; + $lang->about_ssl_port = 'Please input if you are using different SSL port with default one'; + $lang->add_openid = 'Add OpenID'; + + $lang->about_resend_auth_mail = 'You can request for authentication mail if you have failed before.'; + $lang->no_article = 'There exists no article'; + + $lang->find_account_question = '비밀번호 찾기 질문/답변'; + $lang->find_account_answer = '비밀번호 찾기 답변'; + $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; + /* + $lang->find_account_question_items = array('' + ,'다른 이메일 주소는?' + ,'나의 보물 1호는?' + ,'나의 출신 초등학교는?' + ,'나의 출신 고향은?' + ,'나의 이상형은?' + ,'어머니 성함은?' + ,'아버지 성함은?' + ,'가장 좋아하는 색깔은?' + ,'가장 좋아하는 음식은?' + ); +*/ + $lang->temp_password = '임시 비밀번호'; + $lang->cmd_get_temp_password = '임시 비밀번호 발급'; + $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; + $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; + $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; + + $lang->change_password_date = '비밀번호 갱신주기'; + $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; + +?> diff --git a/modules/member/lang/jp.lang.php b/modules/member/lang/jp.lang.php index cd4c51f9c..b78d183fc 100644 --- a/modules/member/lang/jp.lang.php +++ b/modules/member/lang/jp.lang.php @@ -1,241 +1,241 @@ -member = '会員'; - $lang->member_default_info = '基本情報'; - $lang->member_extend_info = '追加情報'; - $lang->default_group_1 = '準会員'; - $lang->default_group_2 = '正会員'; - $lang->admin_group = '管理グループ'; - $lang->keep_signed = '次回からID入力を省略'; - $lang->remember_user_id = 'ID保存'; - $lang->already_logged = '既にログインされています。'; - $lang->denied_user_id = '使用が禁じられているIDです。'; - $lang->null_user_id = 'ユーザーIDをもう一度入力して下さい。'; - $lang->null_password = 'パスワードを入力して下さい。'; - $lang->invalid_authorization = '認証出来ませんでした。'; - $lang->invalid_user_id= '存在しないユーザIDです。'; - $lang->invalid_password = '無効なパスワードです。'; - $lang->invalid_new_password = '以前のパスワードと同じパスワードを使う事はできません。'; - $lang->allow_mailing = 'メーリングリストに登録'; - $lang->denied = '使用中止'; - $lang->is_admin = '最高管理権限'; - $lang->group = '所属グループ'; - $lang->group_title = 'グループ名'; - $lang->group_srl = 'グループ番号'; - $lang->signature = '署名'; - $lang->profile_image = 'プロフィール写真'; - $lang->profile_image_max_width = '制限横幅サイズ'; - $lang->profile_image_max_height = '制限縦幅サイズ'; - $lang->image_name = 'イメージ名'; - $lang->image_name_max_width = '制限横幅サイズ'; - $lang->image_name_max_height = '制限縦幅サイズ'; - $lang->image_mark = 'イメージマーク'; - $lang->image_mark_max_width = '制限横幅サイズ'; - $lang->image_mark_max_height = '制限縦幅サイズ'; - $lang->group_image_mark = 'グループ用イメージマーク'; - $lang->group_image_mark_max_width = '制限横幅サイズ'; - $lang->group_image_mark_max_height = '制限縦幅サイズ'; - $lang->group_image_mark_order = 'グループ用イメージマークの順番'; - $lang->signature_max_height = '制限署名欄の高さ'; - $lang->enable_openid = 'OpenIDサポート'; - $lang->enable_join = '会員登録を許可する'; - $lang->enable_confirm = 'メール認証機能を使用'; - $lang->enable_ssl = 'SSL使用'; - $lang->security_sign_in = 'セキュア(SSL)'; - $lang->limit_day = '臨時制限期間(日)'; - $lang->limit_date = '制限日'; - $lang->after_login_url = 'ログイン後、表示するページのURL'; - $lang->after_logout_url = 'ログアウト後、表示するページのURL'; - $lang->redirect_url = '会員登録後、表示するページ'; - $lang->agreement = '会員登録規約'; - $lang->accept_agreement = '規約に同意する'; - $lang->member_info = '会員情報'; - $lang->current_password = '現在のパスワード'; - $lang->openid = 'OpenID'; - $lang->allow_message = 'メッセージ許可'; - $lang->allow_message_type = array( - 'Y' => '全て許可', - 'F' => '登録した友達のみ許可', - 'N' => '全て禁止', - ); - $lang->about_allow_message = 'メッセージの許可タイプ及び対象を設定します。'; - $lang->logged_users = '現在ログイン中の会員'; - - $lang->webmaster_name = 'ウェブマスターのお名前'; - $lang->webmaster_email = 'ウェブマスターのメールアドレス'; - - $lang->about_keep_signed = 'ブラウザを閉じてもログイン状態が維持されます。\n\nログイン維持機能を利用すると、次回からログインする必要がなくなります。\n\nただ、インターネットカフェ、学校など公共場所で利用する場合、個人情報が流出する恐れがありますので、必ずログアウトして下さい。'; - $lang->about_keep_warning = 'ブラウザを閉じてもログイン状態が維持されます。\n\nログイン維持機能を利用すると、次回からログインする必要がなくなります。 ただ、インターネットカフェ、学校など公共場所で利用する場合、個人情報が流出する恐れがありますので、必ずログアウトして下さい。'; - $lang->about_webmaster_name = '確認メール、またはサイト管理時に使用されるウェブマスターのお名前を入力して下さい(デフォルト : webmaster)。'; - $lang->about_webmaster_email = 'ウェブマスターのメールアドレスを入力して下さい。'; - - $lang->search_target_list = array( - 'user_id' => 'ユーザーID', - 'user_name' => 'お名前', - 'nick_name' => 'ニックネーム', - 'email_address' => 'メールアドレス', - 'regdate' => '登録日', - 'regdate_more' => '登録日(以上)', - 'regdate_less' => '登録日(以下)', - 'last_login' => '最近のログイン', - 'last_login_more' => '最近ログイン日(以上)', - 'last_login_less' => '最近ログイン日(以下)', - 'extra_vars' => '拡張変数', - ); - - $lang->cmd_login = 'ログイン'; - $lang->cmd_logout = 'ログアウト'; - $lang->cmd_signup = '会員登録'; - $lang->cmd_site_signup = '登録'; - $lang->cmd_modify_member_info = '会員情報修正'; - $lang->cmd_modify_member_password = 'パスワード変更'; - $lang->cmd_view_member_info = '会員情報確認'; - $lang->cmd_leave = '退会'; - $lang->cmd_find_member_account = 'IDとパスワードのリマインダー'; - $lang->cmd_resend_auth_mail = '認証メール再申請'; - - $lang->cmd_member_list = '会員リスト'; - $lang->cmd_module_config = '基本設定'; - $lang->cmd_member_group = 'グループ管理'; - $lang->cmd_send_mail = 'メール送信'; - $lang->cmd_manage_id = '禁止ID管理'; - $lang->cmd_manage_form = '会員登録フォーム管理'; - $lang->cmd_view_own_document = '書き込み履歴'; - $lang->cmd_manage_member_info = '会員情報管理'; - $lang->cmd_trace_document = '書き込みの追跡'; - $lang->cmd_trace_comment = 'コメント追跡'; - $lang->cmd_view_scrapped_document = 'スクラップ'; - $lang->cmd_view_saved_document = '保存ドキュメント'; - $lang->cmd_send_email = 'メール送信'; - - $lang->msg_email_not_exists = '登録されたメールアドレスがありません。'; - - $lang->msg_alreay_scrapped = '既にスクラップされたコンテンツです。'; - - $lang->msg_cart_is_null = '対象を選択して下さい。'; - $lang->msg_checked_file_is_deleted = "%d個の添付ファイルが削除されました。"; - - $lang->msg_find_account_title = '会員IDどパスワードの情報'; - $lang->msg_find_account_info = '登録された会員情報は下記の通りです。'; - $lang->msg_find_account_comment = '下のリンクをクリックすると上のパスワードに変更されます。
    ログインしてからパスワードを変更して下さい。'; - $lang->msg_confirm_account_title = '確認メールです。'; - $lang->msg_confirm_account_info = '作成した会員の情報'; - $lang->msg_confirm_account_comment = '下記のURLをクリックして会員登録手続きを完了して下さい。'; - $lang->msg_auth_mail_sent = "%s 宛に認証情報内容が送信されました。メールを確認して下さい。"; - $lang->msg_confirm_mail_sent = "%s 宛に確認メールを送信しました。メールをご確認下さい。"; - $lang->msg_invalid_auth_key = '正しくないアカウントの認証要求です。
    IDとパスワードの検索を行うか、サイト管理者にアカウント情報をお問い合わせ下さい。'; - $lang->msg_success_authed = '認証が正常に行われ、ログイン出来ました。\n必ず確認メールに記載されたパスワードを利用してお好みのパスワードに変更して下さい。'; - $lang->msg_success_confirmed = '会員登録、有難うございます。'; - - $lang->msg_new_member = '会員追加'; - $lang->msg_update_member = '会員情報修正'; - $lang->msg_leave_member = '会員退会'; - $lang->msg_group_is_null = '登録されたグループがありません。'; - $lang->msg_not_delete_default = '基本項目は削除出来ません。'; - $lang->msg_not_exists_member = '存在しないユーザIDです。'; - $lang->msg_cannot_delete_admin = '管理者IDは削除出来ません。管理者権限を解除した上で削除してみて下さい。'; - $lang->msg_exists_user_id = '既に存在するユーザIDです。他のIDを入力して下さい。'; - $lang->msg_exists_email_address = '既に存在するメールアドレスです。他のメールアドレスを入力して下さい。'; - $lang->msg_exists_nick_name = '既に存在するニックネームです。他のニックネームを入力して下さい。'; - $lang->msg_signup_disabled = '会員登録が制限されています。
    サイト管理者にお問合せ下さい。'; - $lang->msg_already_logged = '既に会員に登録されています。'; - $lang->msg_not_logged = 'ログインしていません。'; - $lang->msg_insert_group_name = 'グループ名を入力して下さい。'; - $lang->msg_check_group = 'グループを選択して下さい。'; - - $lang->msg_not_uploaded_profile_image = 'プロフィールイメージを登録することが出来ません。'; - $lang->msg_not_uploaded_image_name = 'イメージ名を登録することが出来ません。'; - $lang->msg_not_uploaded_image_mark = 'イメージマークを登録することが出来ません。'; - $lang->msg_not_uploaded_group_image_mark = 'グループ用イメージマークの登録が出来ません。'; - - $lang->msg_accept_agreement = '規約に同意しなければなりません。'; - - $lang->msg_user_denied = '入力されたユーザIDは使用が中止されました。'; - $lang->msg_user_not_confirmed = 'まだメールの確認が出来ませんでした。届いたメールをご確認下さい。'; - $lang->msg_user_limited = '入力されたユーザIDは%s以降から使用出来ます。'; - - $lang->about_user_id = 'ユーザIDは3~20の英数文字で構成され、最先頭の文字は英字でなければなりません。'; - $lang->about_password = 'パスワードは6~20文字です。'; - $lang->about_user_name = '名前は2~20文字です。'; - $lang->about_nick_name = 'ニックネームは2~20文字です。'; - $lang->about_email_address = 'メールアドレスはメール認証後、パスワード変更または検索などに使用されます。'; - $lang->about_homepage = 'ホームページがある場合は入力して下さい。'; - $lang->about_blog_url = '運用しているブログがあれば入力して下さい。'; - $lang->about_birthday = '生年月日を入力して下さい。'; - $lang->about_allow_mailing = 'メーリングリストにチェックされていない場合は、全体メールの送信時にメールを受け取りません。'; - $lang->about_denied = 'チェックするとユーザIDを使用出来ないようにします。'; - $lang->about_is_admin = 'チェックすると最高管理者権限が取得出来ます。'; - $lang->about_member_description = '会員に対する管理者のメモ帳です。'; - $lang->about_group = '一つのユーザIDは多数のグループに属することが出来ます。'; - - $lang->about_column_type = '追加する登録フォームのタイプを指定して下さい。'; - $lang->about_column_name = 'テンプレートで使用出来る英文字の名前を入力して下さい(変数名)。'; - $lang->about_column_title = '登録または情報修正・閲覧時に表示されるタイトルです。'; - $lang->about_default_value = 'デフォルトで入力される値を指定することが出来ます。'; - $lang->about_active = '活性化(有効化)にチェックを入れないと正常に表示されません。'; - $lang->about_form_description = '説明欄に入力すると登録時に表示されます。'; - $lang->about_required = 'チェックを入れると会員登録時に必須入力項目として設定されます。'; - - $lang->about_enable_openid = 'OpenIDをサポートする際にチェックを入れます。'; - $lang->about_enable_join = 'チェックを入れないとユーザが会員に登録出来ません。'; - $lang->about_enable_confirm = '登録されたメールアドレスに確認メールを送信し、会員登録を確認します。'; - $lang->about_enable_ssl = 'サーバーでSSLが可能な場合、会員登録/情報変更/ログイン等の個人情報はSSL(https)経由でサーバーにより安全に送信されます。'; - $lang->about_limit_day = '会員登録後一定の期間中、認証制限を行うことが出来ます。'; - $lang->about_limit_date = '指定された期間まで該当ユーザはログインできなくします。'; - $lang->about_after_login_url = 'ログイン後表示されるページのURLを指定出来ます。指定のない場合、現在のページが維持されます。'; - $lang->about_after_logout_url = 'ログアウト後表示されるページのURLを指定出来ます。指定のない場合、現在のページが維持されます。'; - $lang->about_redirect_url = '会員登録後、表示されるページのURLを指定出来ます。指定のない場合は会員登録する前のページに戻ります。'; - $lang->about_agreement = '会員登録規約がない場合は表示されません。'; - - $lang->about_image_name = 'ユーザの名前を文字の代わりにイメージで表示させることが出来ます。'; - $lang->about_image_mark = '使用者の名前の前にマークを付けることが出来ます。'; - $lang->about_group_image_mark = 'ユーザー名の前にグループマークを表示します。'; - $lang->about_profile_image = 'ユーザのプロフィールイメージが使用出来るようにします。'; - $lang->about_signature_max_height = '署名欄の高さのサイズを制限します。 (0 もしくは空の場合は制限なし。)'; - $lang->about_accept_agreement = '登録規約をすべて読んだ上で同意します。'; - - $lang->about_member_default = '会員登録時に基本グループとして設定されます。'; - - $lang->about_openid = 'OpenIDで登録する際、IDとメールなどの基本情報は、このサイトに保存されますが、パスワードと認証のための処理用の情報は該当するOpenID提供サービス側で行われます。'; - $lang->about_openid_leave = 'OpenIDの退会は現在のサイトから会員情報を削除することを意味します。
    退会後ログインすると新しく登録することになり、書き込んだコンテンツに対する権限を維持することが出来ません。'; - $lang->about_find_member_account = 'ID/パスワードは登録時に登録されたメールにてお知らせします。
    登録時に登録したメールアドレスを入力して「IDとパスワードのリマインダー」ボタンをクリックして下さい。
    '; - - $lang->about_member = "会員の作成・修正・削除することが出来、グループの管理、登録フォームの管理などが行える会員管理モジュールです。\nデフォルトで作成されたグループにグループを追加作成して会員管理が出来るようにし、会員登録フォーム管理では基本情報の他、フォームの入力情報を追加することが出来ます。"; - $lang->about_ssl_port = '基本ポート以外のSSLポートを利用する場合、入力して下さい。'; - $lang->add_openid = 'OpenIDの追加'; - - $lang->about_resend_auth_mail = '認証メールが届いてなかった場合、再送信の申請が可能です。
    ※申請の前に、当サイトからメールの受信が出来るように設定して下さい。'; - $lang->no_article = '書き込みがありません。'; - - $lang->find_account_question = '秘密質問'; - $lang->find_account_answer = '비밀번호 찾기 답변'; - $lang->about_find_account_question = '登録した時、入力したIDとメールアドレス、秘密質問の答えで仮のパスワードをもらえる事ができます。'; - - - $lang->find_account_question_items = array('' - ,'他のメールアドレスは?' - ,'私の一番大事なものは?' - ,'私の卒業した小学校は?' - ,'私の生まれた街は?' - ,'私の理想型は?' - ,'お母さんのお名前は?' - ,'お父さんのお名前は?' - ,'大好きな色は?' - ,'大好きな食べ物は?' - ); - - $lang->temp_password = '仮のパスワード'; - $lang->cmd_get_temp_password = '仮のパスワードをもらう'; - $lang->about_get_temp_password = 'ログインして直ちにパスワードを変更して下さい。'; - $lang->msg_question_not_exists = '秘密質問を決めていません。'; - $lang->msg_answer_not_matches = '秘密質問の答えが正しくありません。'; - - $lang->change_password_date = 'パスワード更新周期'; - $lang->about_change_password_date = '設定した更新周期によってパスワード変更のお知らせがもらえます。(0に設定すると非活性化) '; - -?> +member = '会員'; + $lang->member_default_info = '基本情報'; + $lang->member_extend_info = '追加情報'; + $lang->default_group_1 = '準会員'; + $lang->default_group_2 = '正会員'; + $lang->admin_group = '管理グループ'; + $lang->keep_signed = '次回からID入力を省略'; + $lang->remember_user_id = 'ID保存'; + $lang->already_logged = '既にログインされています。'; + $lang->denied_user_id = '使用が禁じられているIDです。'; + $lang->null_user_id = 'ユーザーIDをもう一度入力して下さい。'; + $lang->null_password = 'パスワードを入力して下さい。'; + $lang->invalid_authorization = '認証出来ませんでした。'; + $lang->invalid_user_id= '存在しないユーザIDです。'; + $lang->invalid_password = '無効なパスワードです。'; + $lang->invalid_new_password = '以前のパスワードと同じパスワードを使う事はできません。'; + $lang->allow_mailing = 'メーリングリストに登録'; + $lang->denied = '使用中止'; + $lang->is_admin = '最高管理権限'; + $lang->group = '所属グループ'; + $lang->group_title = 'グループ名'; + $lang->group_srl = 'グループ番号'; + $lang->signature = '署名'; + $lang->profile_image = 'プロフィール写真'; + $lang->profile_image_max_width = '制限横幅サイズ'; + $lang->profile_image_max_height = '制限縦幅サイズ'; + $lang->image_name = 'イメージ名'; + $lang->image_name_max_width = '制限横幅サイズ'; + $lang->image_name_max_height = '制限縦幅サイズ'; + $lang->image_mark = 'イメージマーク'; + $lang->image_mark_max_width = '制限横幅サイズ'; + $lang->image_mark_max_height = '制限縦幅サイズ'; + $lang->group_image_mark = 'グループ用イメージマーク'; + $lang->group_image_mark_max_width = '制限横幅サイズ'; + $lang->group_image_mark_max_height = '制限縦幅サイズ'; + $lang->group_image_mark_order = 'グループ用イメージマークの順番'; + $lang->signature_max_height = '制限署名欄の高さ'; + $lang->enable_openid = 'OpenIDサポート'; + $lang->enable_join = '会員登録を許可する'; + $lang->enable_confirm = 'メール認証機能を使用'; + $lang->enable_ssl = 'SSL使用'; + $lang->security_sign_in = 'セキュア(SSL)'; + $lang->limit_day = '臨時制限期間(日)'; + $lang->limit_date = '制限日'; + $lang->after_login_url = 'ログイン後、表示するページのURL'; + $lang->after_logout_url = 'ログアウト後、表示するページのURL'; + $lang->redirect_url = '会員登録後、表示するページ'; + $lang->agreement = '会員登録規約'; + $lang->accept_agreement = '規約に同意する'; + $lang->member_info = '会員情報'; + $lang->current_password = '現在のパスワード'; + $lang->openid = 'OpenID'; + $lang->allow_message = 'メッセージ許可'; + $lang->allow_message_type = array( + 'Y' => '全て許可', + 'F' => '登録した友達のみ許可', + 'N' => '全て禁止', + ); + $lang->about_allow_message = 'メッセージの許可タイプ及び対象を設定します。'; + $lang->logged_users = '現在ログイン中の会員'; + + $lang->webmaster_name = 'ウェブマスターのお名前'; + $lang->webmaster_email = 'ウェブマスターのメールアドレス'; + + $lang->about_keep_signed = 'ブラウザを閉じてもログイン状態が維持されます。\n\nログイン維持機能を利用すると、次回からログインする必要がなくなります。\n\nただ、インターネットカフェ、学校など公共場所で利用する場合、個人情報が流出する恐れがありますので、必ずログアウトして下さい。'; + $lang->about_keep_warning = 'ブラウザを閉じてもログイン状態が維持されます。\n\nログイン維持機能を利用すると、次回からログインする必要がなくなります。 ただ、インターネットカフェ、学校など公共場所で利用する場合、個人情報が流出する恐れがありますので、必ずログアウトして下さい。'; + $lang->about_webmaster_name = '確認メール、またはサイト管理時に使用されるウェブマスターのお名前を入力して下さい(デフォルト : webmaster)。'; + $lang->about_webmaster_email = 'ウェブマスターのメールアドレスを入力して下さい。'; + + $lang->search_target_list = array( + 'user_id' => 'ユーザーID', + 'user_name' => 'お名前', + 'nick_name' => 'ニックネーム', + 'email_address' => 'メールアドレス', + 'regdate' => '登録日', + 'regdate_more' => '登録日(以上)', + 'regdate_less' => '登録日(以下)', + 'last_login' => '最近のログイン', + 'last_login_more' => '最近ログイン日(以上)', + 'last_login_less' => '最近ログイン日(以下)', + 'extra_vars' => '拡張変数', + ); + + $lang->cmd_login = 'ログイン'; + $lang->cmd_logout = 'ログアウト'; + $lang->cmd_signup = '会員登録'; + $lang->cmd_site_signup = '登録'; + $lang->cmd_modify_member_info = '会員情報修正'; + $lang->cmd_modify_member_password = 'パスワード変更'; + $lang->cmd_view_member_info = '会員情報確認'; + $lang->cmd_leave = '退会'; + $lang->cmd_find_member_account = 'IDとパスワードのリマインダー'; + $lang->cmd_resend_auth_mail = '認証メール再申請'; + + $lang->cmd_member_list = '会員リスト'; + $lang->cmd_module_config = '基本設定'; + $lang->cmd_member_group = 'グループ管理'; + $lang->cmd_send_mail = 'メール送信'; + $lang->cmd_manage_id = '禁止ID管理'; + $lang->cmd_manage_form = '会員登録フォーム管理'; + $lang->cmd_view_own_document = '書き込み履歴'; + $lang->cmd_manage_member_info = '会員情報管理'; + $lang->cmd_trace_document = '書き込みの追跡'; + $lang->cmd_trace_comment = 'コメント追跡'; + $lang->cmd_view_scrapped_document = 'スクラップ'; + $lang->cmd_view_saved_document = '保存ドキュメント'; + $lang->cmd_send_email = 'メール送信'; + + $lang->msg_email_not_exists = '登録されたメールアドレスがありません。'; + + $lang->msg_alreay_scrapped = '既にスクラップされたコンテンツです。'; + + $lang->msg_cart_is_null = '対象を選択して下さい。'; + $lang->msg_checked_file_is_deleted = "%d個の添付ファイルが削除されました。"; + + $lang->msg_find_account_title = '会員IDどパスワードの情報'; + $lang->msg_find_account_info = '登録された会員情報は下記の通りです。'; + $lang->msg_find_account_comment = '下のリンクをクリックすると上のパスワードに変更されます。
    ログインしてからパスワードを変更して下さい。'; + $lang->msg_confirm_account_title = '確認メールです。'; + $lang->msg_confirm_account_info = '作成した会員の情報'; + $lang->msg_confirm_account_comment = '下記のURLをクリックして会員登録手続きを完了して下さい。'; + $lang->msg_auth_mail_sent = "%s 宛に認証情報内容が送信されました。メールを確認して下さい。"; + $lang->msg_confirm_mail_sent = "%s 宛に確認メールを送信しました。メールをご確認下さい。"; + $lang->msg_invalid_auth_key = '正しくないアカウントの認証要求です。
    IDとパスワードの検索を行うか、サイト管理者にアカウント情報をお問い合わせ下さい。'; + $lang->msg_success_authed = '認証が正常に行われ、ログイン出来ました。\n必ず確認メールに記載されたパスワードを利用してお好みのパスワードに変更して下さい。'; + $lang->msg_success_confirmed = '会員登録、有難うございます。'; + + $lang->msg_new_member = '会員追加'; + $lang->msg_update_member = '会員情報修正'; + $lang->msg_leave_member = '会員退会'; + $lang->msg_group_is_null = '登録されたグループがありません。'; + $lang->msg_not_delete_default = '基本項目は削除出来ません。'; + $lang->msg_not_exists_member = '存在しないユーザIDです。'; + $lang->msg_cannot_delete_admin = '管理者IDは削除出来ません。管理者権限を解除した上で削除してみて下さい。'; + $lang->msg_exists_user_id = '既に存在するユーザIDです。他のIDを入力して下さい。'; + $lang->msg_exists_email_address = '既に存在するメールアドレスです。他のメールアドレスを入力して下さい。'; + $lang->msg_exists_nick_name = '既に存在するニックネームです。他のニックネームを入力して下さい。'; + $lang->msg_signup_disabled = '会員登録が制限されています。
    サイト管理者にお問合せ下さい。'; + $lang->msg_already_logged = '既に会員に登録されています。'; + $lang->msg_not_logged = 'ログインしていません。'; + $lang->msg_insert_group_name = 'グループ名を入力して下さい。'; + $lang->msg_check_group = 'グループを選択して下さい。'; + + $lang->msg_not_uploaded_profile_image = 'プロフィールイメージを登録することが出来ません。'; + $lang->msg_not_uploaded_image_name = 'イメージ名を登録することが出来ません。'; + $lang->msg_not_uploaded_image_mark = 'イメージマークを登録することが出来ません。'; + $lang->msg_not_uploaded_group_image_mark = 'グループ用イメージマークの登録が出来ません。'; + + $lang->msg_accept_agreement = '規約に同意しなければなりません。'; + + $lang->msg_user_denied = '入力されたユーザIDは使用が中止されました。'; + $lang->msg_user_not_confirmed = 'まだメールの確認が出来ませんでした。届いたメールをご確認下さい。'; + $lang->msg_user_limited = '入力されたユーザIDは%s以降から使用出来ます。'; + + $lang->about_user_id = 'ユーザIDは3~20の英数文字で構成され、最先頭の文字は英字でなければなりません。'; + $lang->about_password = 'パスワードは6~20文字です。'; + $lang->about_user_name = '名前は2~20文字です。'; + $lang->about_nick_name = 'ニックネームは2~20文字です。'; + $lang->about_email_address = 'メールアドレスはメール認証後、パスワード変更または検索などに使用されます。'; + $lang->about_homepage = 'ホームページがある場合は入力して下さい。'; + $lang->about_blog_url = '運用しているブログがあれば入力して下さい。'; + $lang->about_birthday = '生年月日を入力して下さい。'; + $lang->about_allow_mailing = 'メーリングリストにチェックされていない場合は、全体メールの送信時にメールを受け取りません。'; + $lang->about_denied = 'チェックするとユーザIDを使用出来ないようにします。'; + $lang->about_is_admin = 'チェックすると最高管理者権限が取得出来ます。'; + $lang->about_member_description = '会員に対する管理者のメモ帳です。'; + $lang->about_group = '一つのユーザIDは多数のグループに属することが出来ます。'; + + $lang->about_column_type = '追加する登録フォームのタイプを指定して下さい。'; + $lang->about_column_name = 'テンプレートで使用出来る英文字の名前を入力して下さい(変数名)。'; + $lang->about_column_title = '登録または情報修正・閲覧時に表示されるタイトルです。'; + $lang->about_default_value = 'デフォルトで入力される値を指定することが出来ます。'; + $lang->about_active = '活性化(有効化)にチェックを入れないと正常に表示されません。'; + $lang->about_form_description = '説明欄に入力すると登録時に表示されます。'; + $lang->about_required = 'チェックを入れると会員登録時に必須入力項目として設定されます。'; + + $lang->about_enable_openid = 'OpenIDをサポートする際にチェックを入れます。'; + $lang->about_enable_join = 'チェックを入れないとユーザが会員に登録出来ません。'; + $lang->about_enable_confirm = '登録されたメールアドレスに確認メールを送信し、会員登録を確認します。'; + $lang->about_enable_ssl = 'サーバーでSSLが可能な場合、会員登録/情報変更/ログイン等の個人情報はSSL(https)経由でサーバーにより安全に送信されます。'; + $lang->about_limit_day = '会員登録後一定の期間中、認証制限を行うことが出来ます。'; + $lang->about_limit_date = '指定された期間まで該当ユーザはログインできなくします。'; + $lang->about_after_login_url = 'ログイン後表示されるページのURLを指定出来ます。指定のない場合、現在のページが維持されます。'; + $lang->about_after_logout_url = 'ログアウト後表示されるページのURLを指定出来ます。指定のない場合、現在のページが維持されます。'; + $lang->about_redirect_url = '会員登録後、表示されるページのURLを指定出来ます。指定のない場合は会員登録する前のページに戻ります。'; + $lang->about_agreement = '会員登録規約がない場合は表示されません。'; + + $lang->about_image_name = 'ユーザの名前を文字の代わりにイメージで表示させることが出来ます。'; + $lang->about_image_mark = '使用者の名前の前にマークを付けることが出来ます。'; + $lang->about_group_image_mark = 'ユーザー名の前にグループマークを表示します。'; + $lang->about_profile_image = 'ユーザのプロフィールイメージが使用出来るようにします。'; + $lang->about_signature_max_height = '署名欄の高さのサイズを制限します。 (0 もしくは空の場合は制限なし。)'; + $lang->about_accept_agreement = '登録規約をすべて読んだ上で同意します。'; + + $lang->about_member_default = '会員登録時に基本グループとして設定されます。'; + + $lang->about_openid = 'OpenIDで登録する際、IDとメールなどの基本情報は、このサイトに保存されますが、パスワードと認証のための処理用の情報は該当するOpenID提供サービス側で行われます。'; + $lang->about_openid_leave = 'OpenIDの退会は現在のサイトから会員情報を削除することを意味します。
    退会後ログインすると新しく登録することになり、書き込んだコンテンツに対する権限を維持することが出来ません。'; + $lang->about_find_member_account = 'ID/パスワードは登録時に登録されたメールにてお知らせします。
    登録時に登録したメールアドレスを入力して「IDとパスワードのリマインダー」ボタンをクリックして下さい。
    '; + + $lang->about_member = "会員の作成・修正・削除することが出来、グループの管理、登録フォームの管理などが行える会員管理モジュールです。\nデフォルトで作成されたグループにグループを追加作成して会員管理が出来るようにし、会員登録フォーム管理では基本情報の他、フォームの入力情報を追加することが出来ます。"; + $lang->about_ssl_port = '基本ポート以外のSSLポートを利用する場合、入力して下さい。'; + $lang->add_openid = 'OpenIDの追加'; + + $lang->about_resend_auth_mail = '認証メールが届いてなかった場合、再送信の申請が可能です。
    ※申請の前に、当サイトからメールの受信が出来るように設定して下さい。'; + $lang->no_article = '書き込みがありません。'; + + $lang->find_account_question = '秘密質問'; + $lang->find_account_answer = '비밀번호 찾기 답변'; + $lang->about_find_account_question = '登録した時、入力したIDとメールアドレス、秘密質問の答えで仮のパスワードをもらえる事ができます。'; + + + $lang->find_account_question_items = array('' + ,'他のメールアドレスは?' + ,'私の一番大事なものは?' + ,'私の卒業した小学校は?' + ,'私の生まれた街は?' + ,'私の理想型は?' + ,'お母さんのお名前は?' + ,'お父さんのお名前は?' + ,'大好きな色は?' + ,'大好きな食べ物は?' + ); + + $lang->temp_password = '仮のパスワード'; + $lang->cmd_get_temp_password = '仮のパスワードをもらう'; + $lang->about_get_temp_password = 'ログインして直ちにパスワードを変更して下さい。'; + $lang->msg_question_not_exists = '秘密質問を決めていません。'; + $lang->msg_answer_not_matches = '秘密質問の答えが正しくありません。'; + + $lang->change_password_date = 'パスワード更新周期'; + $lang->about_change_password_date = '設定した更新周期によってパスワード変更のお知らせがもらえます。(0に設定すると非活性化) '; + +?> diff --git a/modules/member/lang/ru.lang.php b/modules/member/lang/ru.lang.php index 6c07e0d87..97518c94e 100644 --- a/modules/member/lang/ru.lang.php +++ b/modules/member/lang/ru.lang.php @@ -1,240 +1,240 @@ -member = 'Пользователь'; - $lang->member_default_info = 'Основная информация'; - $lang->member_extend_info = 'Дополнительная информация'; - $lang->default_group_1 = "Новичок"; - $lang->default_group_2 = "Постоянный участник"; - $lang->admin_group = "Администратор"; - $lang->keep_signed = 'Сохранить логин'; - $lang->remember_user_id = 'Сохранить ID'; - $lang->already_logged = "Вы уже вошли"; - $lang->denied_user_id = 'Извините. Этот ID запрещен'; - $lang->null_user_id = 'Пожалуйста, введите ID'; - $lang->null_password = 'Пожалуйста, введите пароль'; - $lang->invalid_authorization = 'Вы не авторизированы'; - $lang->invalid_user_id= "Указанный ID не существует"; - $lang->invalid_password = 'Неверный пароль'; - $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; - $lang->allow_mailing = 'Получать рассылки'; - $lang->denied = 'Отменить пользование'; - $lang->is_admin = 'Суперадминистративные права'; - $lang->group = 'Группа'; - $lang->group_title = 'Имя группы'; - $lang->group_srl = 'Номер группы'; - $lang->signature = 'Подпись'; - $lang->profile_image = 'Фотография участника'; - $lang->profile_image_max_width = 'Макс. ширина'; - $lang->profile_image_max_height = 'Макс. высота'; - $lang->image_name = 'Имя изображения'; - $lang->image_name_max_width = 'Макс. ширина'; - $lang->image_name_max_height = 'Макс. высота'; - $lang->image_mark = 'Image Mark'; - $lang->image_mark_max_width = 'Макс. ширина'; - $lang->image_mark_max_height = 'Макс. высота'; - $lang->group_image_mark = 'Group Image Mark'; - $lang->group_image_mark_max_width = 'Макс. ширина'; - $lang->group_image_mark_max_height = 'Макс. высота'; - $lang->group_image_mark_order = 'Group Image Mark Order'; - $lang->signature_max_height = 'Max Signature Height'; - $lang->enable_openid = 'Включить открытый ID (OpenID)'; - $lang->enable_join = 'Разрешение на регистрацию'; - $lang->enable_confirm = 'Активация по email'; - $lang->enable_ssl = 'использоватьSSL'; - $lang->security_sign_in = 'Sign in using enhanced security'; - $lang->limit_day = 'Дата временного лимит'; - $lang->limit_date = 'Дата лимита'; - $lang->after_login_url = 'URL после логин'; - $lang->after_logout_url = 'URL после логаут'; - $lang->redirect_url = 'URL после регистрации'; - $lang->agreement = 'Пользовательское соглашение о регистрации'; - $lang->accept_agreement = 'Согласен'; - $lang->member_info = 'Пользовательская информация'; - $lang->current_password = 'Текущий пароль'; - $lang->openid = 'OpenID'; - $lang->allow_message = 'Сообщения разрешены'; - $lang->allow_message_type = array( - 'Y' => 'Разрешено всем', - 'F' => 'Разрешено только зарегистрированным друзьям', - 'N' => 'Запрещено всем', - ); - $lang->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다'; - $lang->logged_users = 'Logged Users'; - - $lang->webmaster_name = "Имя веб-мастера"; - $lang->webmaster_email = "Email веб-мастера"; - - $lang->about_keep_signed = 'Вы будете в состоянии логин, даже при закрытии окна браузера.\n\nЕсли вы пользуетесь общественным компьютером, сделайте выход в целях сохранения персональных данных'; - $lang->about_keep_warning = 'Вы будете в состоянии логин, даже при закрытии окна браузера.Если вы пользуетесь общественным компьютером, сделайте выход в целях сохранения персональных данных'; - $lang->about_webmaster_name = "Пожалуйста, введите имя вебмастера, которое будет использоваться для авторизационных писем или другого адиминистрирования сайта. (по умолчанию : webmaster)"; - $lang->about_webmaster_email = "Пожалуйста, введите email адрес вебмастера."; - - $lang->search_target_list = array( - 'user_id' => 'ID', - 'user_name' => 'Имя', - 'nick_name' => 'Ник', - 'email_address' => 'Email', - 'regdate' => 'Дата регистрации', - 'regdate_more' => 'Дата регистрации(more)', - 'regdate_less' => 'Дата регистрации(less)', - 'last_login' => 'Дата последнего входа', - 'last_login_more' => 'Last Sign in Date (more)', - 'last_login_less' => 'Last Sign in Date (less)', - 'extra_vars' => 'Экстра перем.', - ); - - $lang->cmd_login = 'Вход на сайт'; - $lang->cmd_logout = 'Выход'; - $lang->cmd_signup = 'Регистрация'; - $lang->cmd_site_signup = 'Регистрация'; - $lang->cmd_modify_member_info = 'Изменить информацию пользователя'; - $lang->cmd_modify_member_password = 'Изменить пароль'; - $lang->cmd_view_member_info = 'Личная информация'; - $lang->cmd_leave = 'Удалить аккаунт'; - $lang->cmd_find_member_account = 'Найти ID/пароль'; - $lang->cmd_resend_auth_mail = 'Послать email для авторизации'; - - $lang->cmd_member_list = 'Список пользователей'; - $lang->cmd_module_config = 'Стандартные настройки'; - $lang->cmd_member_group = 'Управление группами'; - $lang->cmd_send_mail = 'Отправить письмо'; - $lang->cmd_manage_id = 'Управление запрещенными ID'; - $lang->cmd_manage_form = 'Управление формой регистрации'; - $lang->cmd_view_own_document = 'Просмотреть написанные записи'; - $lang->cmd_manage_member_info = 'Изменить информацию пользователя'; - $lang->cmd_trace_document = 'Trace Written Articles'; - $lang->cmd_trace_comment = 'Trace Written Comments'; - $lang->cmd_view_scrapped_document = 'Просмотреть Scraps'; - $lang->cmd_view_saved_document = 'Просмотреть сохраненные записи'; - $lang->cmd_send_email = 'Отправить письмо'; - - $lang->msg_email_not_exists = "Email адрес не существует"; - - $lang->msg_alreay_scrapped = 'Эта статья уже в Scraps'; - - $lang->msg_cart_is_null = 'Пожалуйста, выберите назначение'; - $lang->msg_checked_file_is_deleted = '%d вложенные файлы удалены'; - - $lang->msg_find_account_title = 'Информация аккаунта'; - $lang->msg_find_account_info = 'Запрашиваемая информация аккаунта.'; - $lang->msg_find_account_comment = 'Кликните на ссылку ниже и пароль будет изменен на указанный вами.
    Пожалуйста, измените пароль после входа на сайт'; - $lang->msg_confirm_account_title = 'Письмо, подтверждающее регистрацию'; - $lang->msg_confirm_account_info = 'Информация аккаунта при регистрации'; - $lang->msg_confirm_account_comment = 'Подтвердите авторизацию, кликнув на ссылку ниже'; - $lang->msg_auth_mail_sent = 'Письмо с регистрационной информацией отправлено для %s. Пожалуйста, проверьте Вашу почту'; - $lang->msg_confirm_mail_sent = 'Письмо для авторизации отправлено для %s. Пожалуйста, проверьте Вашу почту'; - $lang->msg_invalid_auth_key = 'Неверный запрос на авторизацию.
    Пожалуйста, попытайтеть найти информацию аккаунта или свяжитесь с администратором.'; - $lang->msg_success_authed = 'Ваш аккаунт был успешно авторизован.\nВход произведен. Пожалуйста, измените пароль на Ваш собственный.'; - $lang->msg_success_confirmed = 'Авторизация Вашего аккаунта прошла успешно'; - - $lang->msg_new_member = 'Добавить пользователя'; - $lang->msg_update_member = 'Изменить информацию пользователя'; - $lang->msg_leave_member = 'Удалить аккаунт'; - $lang->msg_group_is_null = 'Зарегистрированной группы нет'; - $lang->msg_not_delete_default = 'Стандартные объекты не могут быть удалены'; - $lang->msg_not_exists_member = "Пользователь не существует"; - $lang->msg_cannot_delete_admin = 'Административный ID не может быть удален. Пожалуйста, удалить ID из администрации и попробуйте снова.'; - $lang->msg_exists_user_id = 'Этот ID уже существует. Пожалуйста, попробуйте другой.'; - $lang->msg_exists_email_address = 'Этот email адрес уже зарегистрирован. Пожалуйста, попробуйте другой.'; - $lang->msg_exists_nick_name = 'Этот ник уже существует. Пожалуйста, попробуйте другой.'; - $lang->msg_signup_disabled = 'Вы не можете зарегистрироваться'; - $lang->msg_already_logged = 'Вы уже зарегистрированы'; - $lang->msg_not_logged = 'Пожалуйста, сначала сделайте вход на сайт'; - $lang->msg_insert_group_name = 'Пожалуйста, введите имя группы'; - $lang->msg_check_group = 'Выберите группу'; - - $lang->msg_not_uploaded_image_name = 'Невозможно зарегистрировать фотографию профиля'; - $lang->msg_not_uploaded_image_name = 'Невозможно зарегистрировать имя фотографии'; - $lang->msg_not_uploaded_image_mark = 'Невозможно зарегистрировать марку фотографии'; - $lang->msg_not_uploaded_group_image_mark = 'Невозможно зарегистрировать марку изображения группы'; - - $lang->msg_accept_agreement = 'Вы должны принять Соглашение'; - - $lang->msg_user_denied = 'Введенный ID запрещен'; - $lang->msg_user_not_confirmed = 'Вы еще не прошли авторизацию, проверьте свою почту'; - $lang->msg_user_limited = 'Введенный ID возможно использовать после %s'; - - $lang->about_user_id = 'Юзер ID должен состоять из 3~20 знаков и содержать алфавит или цифры, начинаясь с алфавитного знака.'; - $lang->about_password = 'Пароль должен состоять из 6~20 знаков'; - $lang->about_user_name = 'Имя должно состоять из 2~20 знаков'; - $lang->about_nick_name = 'Ник должен состоять из 2~20 знаков'; - $lang->about_email_address = 'Email адрес используется для изменения/получения пароля после его авторизации.'; - $lang->about_homepage = 'Пожалуйста, введите, если у Вас есть вебсайт'; - $lang->about_blog_url = 'Пожалуйста, введите, если у Вас есть блог'; - $lang->about_birthday = 'Пожалуйста, введите Вашу дату рождения'; - $lang->about_allow_mailing = "Если Вы не присоединитесь к списку рассылки, Вы не сможете получать почтовые сообщения, направленные Вашей группе"; - $lang->about_denied = 'Запретить ID'; - $lang->about_is_admin = 'Наделить Суперадминистративными правами'; - $lang->about_member_description = "Заметки администратора о пользователях"; - $lang->about_group = 'ID может принадлежать нескольким группам'; - - $lang->about_column_type = 'Пожалуйста, установите формат дополнительной формы регистрации'; - $lang->about_column_name = 'Пожалуйста, введите английское название, которое будет использоваться в шаблоне как переменная'; - $lang->about_column_title = 'Это будет отображено, когда пользователь регистрируется или изменяет/просматривает информацию пользователя'; - $lang->about_default_value = 'Вы можете установить значения по умолчанию'; - $lang->about_active = 'Вам следует выбрать активные объекты для отображения в форме регистрации'; - $lang->about_form_description = 'Если Вы введете описание, оно будет отображено в форме регистрации'; - $lang->about_required = 'Сделать элемент обязательным в форме регистрации'; - - $lang->about_enable_openid = 'Позволить пользователям регистрироваться как OpenID'; - $lang->about_enable_join = 'Позволить пользователям регистрироваться'; - $lang->about_enable_confirm = 'Please check if you want new members to activate their accounts via their emails.'; - $lang->about_enable_ssl = 'Personal information from Sign up/Modify Member Info/Sign in can be sent as SSL(https) mode if server provides SSL service'; - $lang->about_limit_day = 'Вы можете ограничить дату авторизации после регистрации'; - $lang->about_limit_date = 'Пользователь не может войти до указанной даты'; - $lang->about_after_login_url = 'Возможен переход на указанный URL после логин. Если не укажете, то данная страница отобразиться.'; - $lang->about_after_logout_url = 'Возможен переход на указанный URL после выхода. Если не укажете, то данная страница отобразиться.'; - $lang->about_redirect_url = 'Пожалуйста, введите URL, куда пользователи попадут после регистрации. Когда поле пустое, будет установлена страница предшествующая странице регистрации.'; - $lang->about_agreement = 'Регистрационное соглашение будет показано, если оно содержит текст'; - - $lang->about_image_name = 'Возможно использование изображение вместо текста'; - $lang->about_image_mark = 'Возможно использование марки перед именем'; - $lang->about_group_image_mark = 'Возможно использование групповой марки перед именем'; - $lang->about_profile_image = 'Позволить пользователям использовать изображения профиля'; - $lang->about_signature_max_height = 'Возможно установить лимит подписи. (0 Если оставите пустым, то лимита не будет.)'; - $lang->about_accept_agreement = 'Я прочитал соглашение полностью и согласен'; - - $lang->about_member_default = 'При регистрации устанавливается стандартная группа'; - - $lang->about_openid = 'При регистраци как OpenID, основнаая информация (ID или email адрес) будет сохранена на сайте, но операции с паролем и авторизацией будут произведены над текущим OpenID в представленном сервисе'; - $lang->about_openid_leave = 'Удаление аккаунта с OpenID производит удаление Вашей информации пользователя на сайте.
    Если Вы войдете после удаления аккаунта, Вы будете разпознаны как новый пользователь и доступ к написанным Вами ранее записям будет закрыт.'; - $lang->about_find_member_account = 'ID и пароль при регистрации будут посланы Вам по имейл адресу.
    Введите имейл адрес, указанный при регистрации и кликните на кнопку "Поиск ID/пароль".
    '; - - $lang->about_member = "Этот модуль служит для создания/изменения/удаления пользователей, управления их группами и формой регистрации.\nВы можете управлять пользователями посредством создания новых групп, и получить дополнительную информацию, управляя формой регистрации"; - $lang->about_ssl_port = 'Please input if you are using different SSL port with default one'; - $lang->add_openid = 'Добавить OpenID'; - - $lang->about_resend_auth_mail = 'Вы можете получить снова письмо для авторизации, если еще не получили.'; - $lang->no_article = 'Записей нет'; - - $lang->find_account_question = '비밀번호 찾기 질문/답변'; - $lang->find_account_answer = '비밀번호 찾기 답변'; - $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; - /* - $lang->find_account_question_items = array('' - ,'다른 이메일 주소는?' - ,'나의 보물 1호는?' - ,'나의 출신 초등학교는?' - ,'나의 출신 고향은?' - ,'나의 이상형은?' - ,'어머니 성함은?' - ,'아버지 성함은?' - ,'가장 좋아하는 색깔은?' - ,'가장 좋아하는 음식은?' - ); -*/ - $lang->temp_password = '임시 비밀번호'; - $lang->cmd_get_temp_password = '임시 비밀번호 발급'; - $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; - $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; - $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; - - $lang->change_password_date = '비밀번호 갱신주기'; - $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; - -?> +member = 'Пользователь'; + $lang->member_default_info = 'Основная информация'; + $lang->member_extend_info = 'Дополнительная информация'; + $lang->default_group_1 = "Новичок"; + $lang->default_group_2 = "Постоянный участник"; + $lang->admin_group = "Администратор"; + $lang->keep_signed = 'Сохранить логин'; + $lang->remember_user_id = 'Сохранить ID'; + $lang->already_logged = "Вы уже вошли"; + $lang->denied_user_id = 'Извините. Этот ID запрещен'; + $lang->null_user_id = 'Пожалуйста, введите ID'; + $lang->null_password = 'Пожалуйста, введите пароль'; + $lang->invalid_authorization = 'Вы не авторизированы'; + $lang->invalid_user_id= "Указанный ID не существует"; + $lang->invalid_password = 'Неверный пароль'; + $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; + $lang->allow_mailing = 'Получать рассылки'; + $lang->denied = 'Отменить пользование'; + $lang->is_admin = 'Суперадминистративные права'; + $lang->group = 'Группа'; + $lang->group_title = 'Имя группы'; + $lang->group_srl = 'Номер группы'; + $lang->signature = 'Подпись'; + $lang->profile_image = 'Фотография участника'; + $lang->profile_image_max_width = 'Макс. ширина'; + $lang->profile_image_max_height = 'Макс. высота'; + $lang->image_name = 'Имя изображения'; + $lang->image_name_max_width = 'Макс. ширина'; + $lang->image_name_max_height = 'Макс. высота'; + $lang->image_mark = 'Image Mark'; + $lang->image_mark_max_width = 'Макс. ширина'; + $lang->image_mark_max_height = 'Макс. высота'; + $lang->group_image_mark = 'Group Image Mark'; + $lang->group_image_mark_max_width = 'Макс. ширина'; + $lang->group_image_mark_max_height = 'Макс. высота'; + $lang->group_image_mark_order = 'Group Image Mark Order'; + $lang->signature_max_height = 'Max Signature Height'; + $lang->enable_openid = 'Включить открытый ID (OpenID)'; + $lang->enable_join = 'Разрешение на регистрацию'; + $lang->enable_confirm = 'Активация по email'; + $lang->enable_ssl = 'использоватьSSL'; + $lang->security_sign_in = 'Sign in using enhanced security'; + $lang->limit_day = 'Дата временного лимит'; + $lang->limit_date = 'Дата лимита'; + $lang->after_login_url = 'URL после логин'; + $lang->after_logout_url = 'URL после логаут'; + $lang->redirect_url = 'URL после регистрации'; + $lang->agreement = 'Пользовательское соглашение о регистрации'; + $lang->accept_agreement = 'Согласен'; + $lang->member_info = 'Пользовательская информация'; + $lang->current_password = 'Текущий пароль'; + $lang->openid = 'OpenID'; + $lang->allow_message = 'Сообщения разрешены'; + $lang->allow_message_type = array( + 'Y' => 'Разрешено всем', + 'F' => 'Разрешено только зарегистрированным друзьям', + 'N' => 'Запрещено всем', + ); + $lang->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다'; + $lang->logged_users = 'Logged Users'; + + $lang->webmaster_name = "Имя веб-мастера"; + $lang->webmaster_email = "Email веб-мастера"; + + $lang->about_keep_signed = 'Вы будете в состоянии логин, даже при закрытии окна браузера.\n\nЕсли вы пользуетесь общественным компьютером, сделайте выход в целях сохранения персональных данных'; + $lang->about_keep_warning = 'Вы будете в состоянии логин, даже при закрытии окна браузера.Если вы пользуетесь общественным компьютером, сделайте выход в целях сохранения персональных данных'; + $lang->about_webmaster_name = "Пожалуйста, введите имя вебмастера, которое будет использоваться для авторизационных писем или другого адиминистрирования сайта. (по умолчанию : webmaster)"; + $lang->about_webmaster_email = "Пожалуйста, введите email адрес вебмастера."; + + $lang->search_target_list = array( + 'user_id' => 'ID', + 'user_name' => 'Имя', + 'nick_name' => 'Ник', + 'email_address' => 'Email', + 'regdate' => 'Дата регистрации', + 'regdate_more' => 'Дата регистрации(more)', + 'regdate_less' => 'Дата регистрации(less)', + 'last_login' => 'Дата последнего входа', + 'last_login_more' => 'Last Sign in Date (more)', + 'last_login_less' => 'Last Sign in Date (less)', + 'extra_vars' => 'Экстра перем.', + ); + + $lang->cmd_login = 'Вход на сайт'; + $lang->cmd_logout = 'Выход'; + $lang->cmd_signup = 'Регистрация'; + $lang->cmd_site_signup = 'Регистрация'; + $lang->cmd_modify_member_info = 'Изменить информацию пользователя'; + $lang->cmd_modify_member_password = 'Изменить пароль'; + $lang->cmd_view_member_info = 'Личная информация'; + $lang->cmd_leave = 'Удалить аккаунт'; + $lang->cmd_find_member_account = 'Найти ID/пароль'; + $lang->cmd_resend_auth_mail = 'Послать email для авторизации'; + + $lang->cmd_member_list = 'Список пользователей'; + $lang->cmd_module_config = 'Стандартные настройки'; + $lang->cmd_member_group = 'Управление группами'; + $lang->cmd_send_mail = 'Отправить письмо'; + $lang->cmd_manage_id = 'Управление запрещенными ID'; + $lang->cmd_manage_form = 'Управление формой регистрации'; + $lang->cmd_view_own_document = 'Просмотреть написанные записи'; + $lang->cmd_manage_member_info = 'Изменить информацию пользователя'; + $lang->cmd_trace_document = 'Trace Written Articles'; + $lang->cmd_trace_comment = 'Trace Written Comments'; + $lang->cmd_view_scrapped_document = 'Просмотреть Scraps'; + $lang->cmd_view_saved_document = 'Просмотреть сохраненные записи'; + $lang->cmd_send_email = 'Отправить письмо'; + + $lang->msg_email_not_exists = "Email адрес не существует"; + + $lang->msg_alreay_scrapped = 'Эта статья уже в Scraps'; + + $lang->msg_cart_is_null = 'Пожалуйста, выберите назначение'; + $lang->msg_checked_file_is_deleted = '%d вложенные файлы удалены'; + + $lang->msg_find_account_title = 'Информация аккаунта'; + $lang->msg_find_account_info = 'Запрашиваемая информация аккаунта.'; + $lang->msg_find_account_comment = 'Кликните на ссылку ниже и пароль будет изменен на указанный вами.
    Пожалуйста, измените пароль после входа на сайт'; + $lang->msg_confirm_account_title = 'Письмо, подтверждающее регистрацию'; + $lang->msg_confirm_account_info = 'Информация аккаунта при регистрации'; + $lang->msg_confirm_account_comment = 'Подтвердите авторизацию, кликнув на ссылку ниже'; + $lang->msg_auth_mail_sent = 'Письмо с регистрационной информацией отправлено для %s. Пожалуйста, проверьте Вашу почту'; + $lang->msg_confirm_mail_sent = 'Письмо для авторизации отправлено для %s. Пожалуйста, проверьте Вашу почту'; + $lang->msg_invalid_auth_key = 'Неверный запрос на авторизацию.
    Пожалуйста, попытайтеть найти информацию аккаунта или свяжитесь с администратором.'; + $lang->msg_success_authed = 'Ваш аккаунт был успешно авторизован.\nВход произведен. Пожалуйста, измените пароль на Ваш собственный.'; + $lang->msg_success_confirmed = 'Авторизация Вашего аккаунта прошла успешно'; + + $lang->msg_new_member = 'Добавить пользователя'; + $lang->msg_update_member = 'Изменить информацию пользователя'; + $lang->msg_leave_member = 'Удалить аккаунт'; + $lang->msg_group_is_null = 'Зарегистрированной группы нет'; + $lang->msg_not_delete_default = 'Стандартные объекты не могут быть удалены'; + $lang->msg_not_exists_member = "Пользователь не существует"; + $lang->msg_cannot_delete_admin = 'Административный ID не может быть удален. Пожалуйста, удалить ID из администрации и попробуйте снова.'; + $lang->msg_exists_user_id = 'Этот ID уже существует. Пожалуйста, попробуйте другой.'; + $lang->msg_exists_email_address = 'Этот email адрес уже зарегистрирован. Пожалуйста, попробуйте другой.'; + $lang->msg_exists_nick_name = 'Этот ник уже существует. Пожалуйста, попробуйте другой.'; + $lang->msg_signup_disabled = 'Вы не можете зарегистрироваться'; + $lang->msg_already_logged = 'Вы уже зарегистрированы'; + $lang->msg_not_logged = 'Пожалуйста, сначала сделайте вход на сайт'; + $lang->msg_insert_group_name = 'Пожалуйста, введите имя группы'; + $lang->msg_check_group = 'Выберите группу'; + + $lang->msg_not_uploaded_image_name = 'Невозможно зарегистрировать фотографию профиля'; + $lang->msg_not_uploaded_image_name = 'Невозможно зарегистрировать имя фотографии'; + $lang->msg_not_uploaded_image_mark = 'Невозможно зарегистрировать марку фотографии'; + $lang->msg_not_uploaded_group_image_mark = 'Невозможно зарегистрировать марку изображения группы'; + + $lang->msg_accept_agreement = 'Вы должны принять Соглашение'; + + $lang->msg_user_denied = 'Введенный ID запрещен'; + $lang->msg_user_not_confirmed = 'Вы еще не прошли авторизацию, проверьте свою почту'; + $lang->msg_user_limited = 'Введенный ID возможно использовать после %s'; + + $lang->about_user_id = 'Юзер ID должен состоять из 3~20 знаков и содержать алфавит или цифры, начинаясь с алфавитного знака.'; + $lang->about_password = 'Пароль должен состоять из 6~20 знаков'; + $lang->about_user_name = 'Имя должно состоять из 2~20 знаков'; + $lang->about_nick_name = 'Ник должен состоять из 2~20 знаков'; + $lang->about_email_address = 'Email адрес используется для изменения/получения пароля после его авторизации.'; + $lang->about_homepage = 'Пожалуйста, введите, если у Вас есть вебсайт'; + $lang->about_blog_url = 'Пожалуйста, введите, если у Вас есть блог'; + $lang->about_birthday = 'Пожалуйста, введите Вашу дату рождения'; + $lang->about_allow_mailing = "Если Вы не присоединитесь к списку рассылки, Вы не сможете получать почтовые сообщения, направленные Вашей группе"; + $lang->about_denied = 'Запретить ID'; + $lang->about_is_admin = 'Наделить Суперадминистративными правами'; + $lang->about_member_description = "Заметки администратора о пользователях"; + $lang->about_group = 'ID может принадлежать нескольким группам'; + + $lang->about_column_type = 'Пожалуйста, установите формат дополнительной формы регистрации'; + $lang->about_column_name = 'Пожалуйста, введите английское название, которое будет использоваться в шаблоне как переменная'; + $lang->about_column_title = 'Это будет отображено, когда пользователь регистрируется или изменяет/просматривает информацию пользователя'; + $lang->about_default_value = 'Вы можете установить значения по умолчанию'; + $lang->about_active = 'Вам следует выбрать активные объекты для отображения в форме регистрации'; + $lang->about_form_description = 'Если Вы введете описание, оно будет отображено в форме регистрации'; + $lang->about_required = 'Сделать элемент обязательным в форме регистрации'; + + $lang->about_enable_openid = 'Позволить пользователям регистрироваться как OpenID'; + $lang->about_enable_join = 'Позволить пользователям регистрироваться'; + $lang->about_enable_confirm = 'Please check if you want new members to activate their accounts via their emails.'; + $lang->about_enable_ssl = 'Personal information from Sign up/Modify Member Info/Sign in can be sent as SSL(https) mode if server provides SSL service'; + $lang->about_limit_day = 'Вы можете ограничить дату авторизации после регистрации'; + $lang->about_limit_date = 'Пользователь не может войти до указанной даты'; + $lang->about_after_login_url = 'Возможен переход на указанный URL после логин. Если не укажете, то данная страница отобразиться.'; + $lang->about_after_logout_url = 'Возможен переход на указанный URL после выхода. Если не укажете, то данная страница отобразиться.'; + $lang->about_redirect_url = 'Пожалуйста, введите URL, куда пользователи попадут после регистрации. Когда поле пустое, будет установлена страница предшествующая странице регистрации.'; + $lang->about_agreement = 'Регистрационное соглашение будет показано, если оно содержит текст'; + + $lang->about_image_name = 'Возможно использование изображение вместо текста'; + $lang->about_image_mark = 'Возможно использование марки перед именем'; + $lang->about_group_image_mark = 'Возможно использование групповой марки перед именем'; + $lang->about_profile_image = 'Позволить пользователям использовать изображения профиля'; + $lang->about_signature_max_height = 'Возможно установить лимит подписи. (0 Если оставите пустым, то лимита не будет.)'; + $lang->about_accept_agreement = 'Я прочитал соглашение полностью и согласен'; + + $lang->about_member_default = 'При регистрации устанавливается стандартная группа'; + + $lang->about_openid = 'При регистраци как OpenID, основнаая информация (ID или email адрес) будет сохранена на сайте, но операции с паролем и авторизацией будут произведены над текущим OpenID в представленном сервисе'; + $lang->about_openid_leave = 'Удаление аккаунта с OpenID производит удаление Вашей информации пользователя на сайте.
    Если Вы войдете после удаления аккаунта, Вы будете разпознаны как новый пользователь и доступ к написанным Вами ранее записям будет закрыт.'; + $lang->about_find_member_account = 'ID и пароль при регистрации будут посланы Вам по имейл адресу.
    Введите имейл адрес, указанный при регистрации и кликните на кнопку "Поиск ID/пароль".
    '; + + $lang->about_member = "Этот модуль служит для создания/изменения/удаления пользователей, управления их группами и формой регистрации.\nВы можете управлять пользователями посредством создания новых групп, и получить дополнительную информацию, управляя формой регистрации"; + $lang->about_ssl_port = 'Please input if you are using different SSL port with default one'; + $lang->add_openid = 'Добавить OpenID'; + + $lang->about_resend_auth_mail = 'Вы можете получить снова письмо для авторизации, если еще не получили.'; + $lang->no_article = 'Записей нет'; + + $lang->find_account_question = '비밀번호 찾기 질문/답변'; + $lang->find_account_answer = '비밀번호 찾기 답변'; + $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; + /* + $lang->find_account_question_items = array('' + ,'다른 이메일 주소는?' + ,'나의 보물 1호는?' + ,'나의 출신 초등학교는?' + ,'나의 출신 고향은?' + ,'나의 이상형은?' + ,'어머니 성함은?' + ,'아버지 성함은?' + ,'가장 좋아하는 색깔은?' + ,'가장 좋아하는 음식은?' + ); +*/ + $lang->temp_password = '임시 비밀번호'; + $lang->cmd_get_temp_password = '임시 비밀번호 발급'; + $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; + $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; + $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; + + $lang->change_password_date = '비밀번호 갱신주기'; + $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; + +?> diff --git a/modules/member/lang/tr.lang.php b/modules/member/lang/tr.lang.php index f66e139ee..4998916eb 100644 --- a/modules/member/lang/tr.lang.php +++ b/modules/member/lang/tr.lang.php @@ -1,235 +1,235 @@ -member = 'Üye'; - $lang->member_default_info = 'Temel Bilgi'; - $lang->member_extend_info = 'Detaylı Bilgi'; - $lang->default_group_1 = "Asil Üye"; - $lang->default_group_2 = "Sıradan Üye"; - $lang->admin_group = "Grup Yönetimi"; - $lang->keep_signed = 'Beni bağlı tut'; - $lang->remember_user_id = 'Kimliği Hatırla'; - $lang->already_logged = "Zaten giriş yaptınız"; - $lang->denied_user_id = 'Yasaklanmış bir kimlik girdiniz.'; - $lang->null_user_id = 'Lütfen kimliğinizi giriniz'; - $lang->null_password = 'Lütfen şifrenizi giriniz'; - $lang->invalid_authorization = 'Hesap etkinleştirilmemiş.'; - $lang->invalid_user_id= "Geçerli olmayan bir kimlik girdiniz"; - $lang->invalid_password = 'Hatalı bir şifre girdiniz'; - $lang->invalid_new_password = 'Yeni şifre, eski şifreyle aynı olmamalı.'; - $lang->allow_mailing = 'Mailleşmeyi Aç'; - $lang->denied = 'Yasaklanmış'; - $lang->is_admin = 'Süperadmin Yetkisi'; - $lang->group = 'Grup'; - $lang->group_title = 'Grup Adı'; - $lang->group_srl = 'Grup Numarası'; - $lang->signature = 'İmza'; - $lang->profile_image = 'Profil Resmi'; - $lang->profile_image_max_width = 'En Yük. Genişlik'; - $lang->profile_image_max_height = 'En Yük. Uzunluk'; - $lang->image_name = 'Resim İsmi'; - $lang->image_name_max_width = 'En Yük. Genişlik'; - $lang->image_name_max_height = 'En Yük. Uzunluk'; - $lang->image_mark = 'Resim İmi'; - $lang->image_mark_max_width = 'En Yük. Genişlik'; - $lang->image_mark_max_height = 'En Yük. Uzunluk'; - $lang->group_image_mark = 'Grup Simgesi'; - $lang->group_image_mark_max_width = 'En Yük. Genişlik'; - $lang->group_image_mark_max_height = 'En Yük. Uzunluk'; - $lang->group_image_mark_order = 'Grup Simge Sıralaması'; - $lang->signature_max_height = 'En Yük. İmza Uzunluğu'; - $lang->enable_openid = 'OpenID Aç'; - $lang->enable_join = 'Yeni Üye Kabul Et'; - $lang->enable_confirm = 'E-posta Doğrulaması'; - $lang->enable_ssl = 'SSL Etkinleştir'; - $lang->security_sign_in = 'Gelişmiş güvenliği kullanarak giriş yap'; - $lang->limit_day = 'Geçici Zaman Sınırı'; - $lang->limit_date = 'Zaman Sınırı'; - $lang->after_login_url = 'Giriş yaptıktan sonraki URL'; - $lang->after_logout_url = 'Çıkış yaptıktan sonraki URL'; - $lang->redirect_url = 'Giriş yaptıktan sonraki URL'; - $lang->agreement = 'Üyelik Sözleşmesi'; - $lang->accept_agreement = 'Kabul Et'; - $lang->member_info = 'Üye Bilgisi'; - $lang->current_password = 'Geçerli Şifre'; - $lang->openid = 'OpenID'; - $lang->allow_message = 'Mesajlaşmaya İzin Ver'; - $lang->allow_message_type = array( - 'Y' => 'Tümüne İzin Ver', - 'F' => 'Arkadaşlara İzin Ver', - 'N' => 'Tümünü Geri Çevir', - ); - $lang->about_allow_message = 'Mesajlaşmaya izin verebilir/reddedebilirsiniz.'; - $lang->logged_users = 'Giriş yapmış Kullanıcılar'; - - $lang->webmaster_name = "Webmaster İsmi"; - $lang->webmaster_email = "Webmaster E-postası"; - - $lang->about_keep_signed = 'Tarayıcıyı kapatsanız da sisteme bağlı kalacaksınız.\n\nEğer ortak bir bilgisayar kullanıyorsanız, kişisel bilgilerinizin gizliliği için bunu önermiyoruz'; - $lang->about_keep_warning = 'Tarayıcıyı kapatsanız da sisteme bağlı kalacaksınız. Eğer ortak bir bilgisayar kullanıyorsanız, kişisel bilgilerinizin gizliliği için bunu önermiyoruz'; - $lang->about_webmaster_name = "Lütfen onay maillerinde veya site yönetiminde kullanılacak webmaster ismini giriniz. (varsayılan : webmaster)"; - $lang->about_webmaster_email = "Lütfen webmaster e-posta adresini giriniz."; - - $lang->search_target_list = array( - 'user_id' => 'Kimlik', - 'user_name' => 'İsim', - 'nick_name' => 'Takma Ad', - 'email_address' => 'E-posta Adresi', - 'regdate' => 'Kayıt Tarihi', - 'regdate_more' => 'Kayıt Tarihi (detaylı)', - 'regdate_less' => 'Kayıt Tarihi (basit)', - 'last_login' => 'Son Giriş Tarihi', - 'last_login_more' => 'Son Giriş Tarihi (detaylı)', - 'last_login_less' => 'Son Giriş Tarihi (basit)', - 'extra_vars' => 'Fazladan Çeş.', - ); - - $lang->cmd_login = 'Giriş Yap'; - $lang->cmd_logout = 'Çıkış Yap'; - $lang->cmd_signup = 'Kaydol'; - $lang->cmd_site_signup = 'Kaydol'; - $lang->cmd_modify_member_info = 'Üye Bilgilerini Düzenle'; - $lang->cmd_modify_member_password = 'Şifreyi Düzenle'; - $lang->cmd_view_member_info = 'Üye Bilgisi'; - $lang->cmd_leave = 'Ayrıl'; - $lang->cmd_find_member_account = 'Hesap Bilgisi Bul'; - $lang->cmd_resend_auth_mail = 'Etkinleştirme Maili Talebinde Bulun'; - - $lang->cmd_member_list = 'Üye Listesi'; - $lang->cmd_module_config = 'Varsayılan Ayar'; - $lang->cmd_member_group = 'Üye Grupları'; - $lang->cmd_send_mail = 'Mail Gönder'; - $lang->cmd_manage_id = 'Yasaklanmış Kimlikler'; - $lang->cmd_manage_form = 'Kayıt Formu'; - $lang->cmd_view_own_document = 'Yazılmış Makaleler'; - $lang->cmd_manage_member_info = 'Üye Bilgisini Yönet'; - $lang->cmd_trace_document = 'Yazılmış Makalelerini Gör'; - $lang->cmd_trace_comment = 'Yazılmış Yorumlarını Gör'; - $lang->cmd_view_scrapped_document = 'Hasarlılar'; - $lang->cmd_view_saved_document = 'Kayıtlı Makaleler'; - $lang->cmd_send_email = 'Mail Gönder'; - - $lang->msg_email_not_exists = "Geçerli olmayan bir e-posta adresi girdiniz"; - - $lang->msg_alreay_scrapped = 'Bu makale zaten hasarlı'; - - $lang->msg_cart_is_null = 'Lütfen hedefi seçiniz'; - $lang->msg_checked_file_is_deleted = '%d isimli ek dosya silindi'; - - $lang->msg_find_account_title = 'Hesap Bilgisi'; - $lang->msg_find_account_info = 'Talep edilen hesap bilgisi.'; - $lang->msg_find_account_comment = 'Şifreniz aşağıdaki linke tıkladığınızda, yukardaki gibi değiştirilecektir.
    Lütfen giriş yaptıktan sonra şifrenizi değiştiriniz.'; - $lang->msg_confirm_account_title = 'Zeroboard XE Hesap Etkinleştirmesi'; - $lang->msg_confirm_account_info = 'Hesap Bilginiz:'; - $lang->msg_confirm_account_comment = 'Hesabınızı etkinleştirmek için takip eden linke tıklayınız.'; - $lang->msg_auth_mail_sent = 'Etknileştirme maili %s adresine gönderildi. Lütfen mailinizi kontrol ediniz.'; - $lang->msg_confirm_mail_sent = '%s adresine etkinleştirme maili gönderdik. Lütfen mailinizi kontrol ediniz.'; - $lang->msg_invalid_auth_key = 'Geçersiz doğrulama talebi.
    Lütfen hesap bilgisini tekrar bulmayı deneyin ya da yöneticilerle iletişime geçin.'; - $lang->msg_success_authed = 'Hesabınız başarıyla etkinleştirildi ve giriş yapıldı.\n Lütfen mailinize gelen şifreyi kullanarak yeni şifreinizi oluşturunuz.'; - $lang->msg_success_confirmed = 'Hesabınız başarıyla etkinleştirildi.'; - - $lang->msg_new_member = 'Üye Ekle'; - $lang->msg_update_member = 'Üye Bilgisini Düzenle'; - $lang->msg_leave_member = 'Ayrıl'; - $lang->msg_group_is_null = 'Grup yok'; - $lang->msg_not_delete_default = 'Varsayılan ögeler silinemez'; - $lang->msg_not_exists_member = "Geçersiz üye"; - $lang->msg_cannot_delete_admin = 'Admin Kimliği silinemez. Kimliği yönetimden çıkartıp tekrar deneyiniz.'; - $lang->msg_exists_user_id = 'Bu kimlik önceden alınmış. Lütfen başka bir kimlik deneyiniz.'; - $lang->msg_exists_email_address = 'Bu mail adresi zaten kullanımda. Lütfen başka bir mail adresi deneyiniz.'; - $lang->msg_exists_nick_name = 'Bu rumuz önceden alınmış. Lütfen başka bir rumuz deneyiniz.'; - $lang->msg_signup_disabled = 'Kayıt olma yetkiniz bulunmamaktadır'; - $lang->msg_already_logged = 'Zaten giriş yapmış bulunmaktasınız'; - $lang->msg_not_logged = 'Lütfen önce giriş yapınız'; - $lang->msg_insert_group_name = 'Lütfen grup ismini giriniz'; - $lang->msg_check_group = 'Lütfen grubu seçiniz'; - - $lang->msg_not_uploaded_profile_image = 'Profil resmi kaydedilemedi'; - $lang->msg_not_uploaded_image_name = 'Resim İsmi kaydedilemedi'; - $lang->msg_not_uploaded_image_mark = 'Resim İmi kaydedilemedi'; - $lang->msg_not_uploaded_group_image_mark = 'Grup resim imi kaydedilemedi'; - - $lang->msg_accept_agreement = 'Sözleşmeyi kabul etmeniz gerekmektedir'; - - $lang->msg_user_denied = 'Yasaklanmış bir Kimlik girdiniz'; - $lang->msg_user_not_confirmed = 'Hesabınız henüz etkinleştirilmemiş. Lütfen mailinizi kontrol ediniz.'; - $lang->msg_user_limited = 'Bu kimlik, %s Tarihinden sonra kullanılabilir'; - - $lang->about_user_id = 'Kullanıcı kimliği 3~20 karakter uzunluğunda ve hem harf hem rakam içermeli ve ilk bir harfle başlamalıdır.'; - $lang->about_password = 'Şifre 6~20 karakter uzunluğunda olmalıdır'; - $lang->about_user_name = 'İsim 2~20 karakter uzunluğunda olmalıdır'; - $lang->about_nick_name = 'Rumuz 2~20 karakter uzunluğunda olmalıdır'; - $lang->about_email_address = 'E-posta adresiniz, e-posta onaylamasından sonra şifre düzenlemesi için kullanılacaktır'; - $lang->about_homepage = 'Lütfen varsa website adresinizi giriniz'; - $lang->about_blog_url = 'Lütfen varsa blog adresinizi giriniz'; - $lang->about_birthday = 'Lütfen doğum tarihinizi giriniz'; - $lang->about_allow_mailing = "Eğer mailleşmeyi etkinleştirmezseniz, grup maillerini alamayacaksınız"; - $lang->about_denied = 'Kimliği yasaklanmak için işaretleyiniz'; - $lang->about_is_admin = 'Superadmin yetkisi vermek için işaretleyiniz'; - $lang->about_member_description = "Yöneticinin kullanıcılar hakkındaki kısa notu"; - $lang->about_group = 'Bir kimlik, birçok grubun üyesi olabilir'; - - $lang->about_column_type = 'Lütfen detaylı kayıt formunun biçimini ayarlayınız'; - $lang->about_column_name = 'Lütfen şablonda kullanılabilecek İngilizce bir isim giriniz. (isim değişkendir)'; - $lang->about_column_title = 'Bu girdi, kayıt veya üye bilgisi düzenleme/görüntüleme formunda gösterilecektir'; - $lang->about_default_value = 'Varsayılan değerleri ayarlayabilirsiniz'; - $lang->about_active = 'Kayıt formunu gösterebilmeniz için, öğeleri etkinleştirdiğinizden emin olun'; - $lang->about_form_description = 'Eğer tanım formuna giriş yaparsanız, bu girdiler giriş formunda görünecektir'; - $lang->about_required = 'Eğer işaretlerseniz, kayıt için gerekli bir öğe olacaktır'; - - $lang->about_enable_openid = 'Eğer OpenID hizmeti sunmak istiyorsanız, lütfen işaretleyiniz'; - $lang->about_enable_join = 'Yeni üyelerin sitenize kayıt yapmalarına izin vermek istiyorsanız lütfen işaretleyiniz'; - $lang->about_enable_confirm = 'Yeni üyelerin hesaplarını e-posta yoluyla etkinleştirmelerini istiyorsanız lütfen işaretleyiniz.'; - $lang->about_enable_ssl = 'Kayıt Ol/Üye Bilgisini Değiştir/Giriş Yap \'daki kişisel bilgiler, eğer sunucunuz da SSL servisi veriyorsa, SSL (https) olarak ayarlanabilir.'; - $lang->about_limit_day = 'Kayıttan sonraki hesap etkinleştirme süresini kısıtlayabilirsiniz'; - $lang->about_limit_date = 'Üyeler, belirlenen tarihe kadar kayıt yapamazlar'; - $lang->about_after_login_url = 'Giriş yaptıktan sonraki gidilecek URL\'yi ayarlayabilirsiniz. Boş bırakmak, geçerli sayfayı bırakır.'; - $lang->about_after_logout_url = 'Çıkış yaptıktan sonraki gidilecek URL\'yi ayarlayabilirsiniz. Boş bırakmak, geçerli sayfa manasına gelir.'; - $lang->about_redirect_url = 'Lütfen üyelerin kayıt olduktan sonraki yönlendirilecekleri URL\'yi giriniz. Bır url girilmediğinde, kayıt sayfasından bir önceki sayfaya yönlendirileceklerdir.'; - $lang->about_agreement = "Eğer boş bırakılmadıysa, Kayıt Sözleşmesi görüntülenecektir"; - - $lang->about_image_name = "Üyeler, metin yerine resim adı kullanabileceklerdir"; - $lang->about_image_mark = "Üyeler, isimlerinin önünde işaret resmi kullanabilirler"; - $lang->about_group_image_mark = "Kullanıcıların isimlerinin önlerinde görüntülenecek grup işaretleri kullanabilirsiniz"; - $lang->about_profile_image = 'Üyeler, profil resmi kullanabilirler'; - $lang->about_accept_agreement = "Anlaşmayı okudum ve kabul ediyorum"; - - $lang->about_member_default = 'Varsayılan grup, kullanıcı kayıt olduktan sonra yönlendirileceği grup olacaktır'; - - $lang->about_openid = 'OpenID olarak giriş yaptığınızda, e-posta adresi ya da kimliğiniz gibi temel bilgi sitede kaydedilecektir, şifre ve onaylama yönetimi işlemi, hizmet veren geçerli OpenID tarafından yapılacaktır'; - $lang->about_openid_leave = 'OpenID\'nin bu bölünmesi, üyelik bilginizin bu siteden silinmesi demektir.
    Bölünmeden sonra giriş yaparsanız, yeni bir üye gibi kabul edilecekseniz, bu yüzden eski makalelerinize ulaşma yetkiniz olmayacaktır.'; - - $lang->about_member = "Üye modülü size; üyeleri oluşturmada, düzenlemede, silmede ve kayıt formunu ya da grupları düzenlemede yardımcı olur.\nÜyeleri yönetmek için özel gruplar ekleyebilir ve aynı zamanda kayıt formunu değiştirerek üyeler hakkında ek bilgi alabilirsiniz."; - $lang->about_find_member_account = 'Hesap bilginiz, kayıt olduğunuz e-posta adresine gönderilecektir.
    Kayıt esnasında kullandığınız e-posta adresini giriniz ve "Hesap Bilgisini Bul" tuşuna basınız.
    '; - $lang->about_ssl_port = 'Eğer varsayılan SSL portundan farklı bir port kullanıyorsanız, lütfen giriniz'; - $lang->add_openid = 'OpenID Ekle'; - - $lang->about_resend_auth_mail = 'Eğer daha önce etkinleştirmediyseniz, etkinleştirme maili talebinde bulunabilirsiniz'; - $lang->no_article = 'Hiçbir makale bulunmuyor'; - - $lang->find_account_question = 'Geçici şifre sorusu'; - $lang->about_find_account_question = 'Kimliğinize, mail adresinize ya da cevapladığınız soruya göre geçici şifre edinebilirsiniz.'; - $lang->find_account_question_items = array('' - ,'Diğer e-posta adresiniz nedir?' - ,'En sevdiğiniz şey?' - ,'Mezun olduğunuz ilkokul?' - ,'Memleketiniz neresi?' - ,'İdeal eşiniz nasıl olmalı?' - ,"Annenizin adı?" - ,"Babanızın adı?" - ,'En sevdiğiniz renk?' - ,'En sevdiğiniz yemek?' - ); - $lang->temp_password = 'Geçici şifre'; - $lang->cmd_get_temp_password = 'Geçici bir şifre edin'; - $lang->about_get_temp_password = 'Giriş yaptıktan sonra şifrenizi değiştirin.'; - $lang->msg_question_not_exists = 'Geçici şifre için güvenlik sorusunu belirlemediniz.'; - $lang->msg_answer_not_matches = 'Soru için verdiğiniz cevap doğru değil.'; - - $lang->change_password_date = 'Şifre yenileme döngüsü'; - $lang->about_change_password_date = 'Eğer buna bir değer biçerseniz, şifrenizi belirli aralıklarla değiştirmeniz konusunda bildirim alacaksanız (eğer 0 olarak ayarlandıysa, devredışıdır)'; -?> +member = 'Üye'; + $lang->member_default_info = 'Temel Bilgi'; + $lang->member_extend_info = 'Detaylı Bilgi'; + $lang->default_group_1 = "Asil Üye"; + $lang->default_group_2 = "Sıradan Üye"; + $lang->admin_group = "Grup Yönetimi"; + $lang->keep_signed = 'Beni bağlı tut'; + $lang->remember_user_id = 'Kimliği Hatırla'; + $lang->already_logged = "Zaten giriş yaptınız"; + $lang->denied_user_id = 'Yasaklanmış bir kimlik girdiniz.'; + $lang->null_user_id = 'Lütfen kimliğinizi giriniz'; + $lang->null_password = 'Lütfen şifrenizi giriniz'; + $lang->invalid_authorization = 'Hesap etkinleştirilmemiş.'; + $lang->invalid_user_id= "Geçerli olmayan bir kimlik girdiniz"; + $lang->invalid_password = 'Hatalı bir şifre girdiniz'; + $lang->invalid_new_password = 'Yeni şifre, eski şifreyle aynı olmamalı.'; + $lang->allow_mailing = 'Mailleşmeyi Aç'; + $lang->denied = 'Yasaklanmış'; + $lang->is_admin = 'Süperadmin Yetkisi'; + $lang->group = 'Grup'; + $lang->group_title = 'Grup Adı'; + $lang->group_srl = 'Grup Numarası'; + $lang->signature = 'İmza'; + $lang->profile_image = 'Profil Resmi'; + $lang->profile_image_max_width = 'En Yük. Genişlik'; + $lang->profile_image_max_height = 'En Yük. Uzunluk'; + $lang->image_name = 'Resim İsmi'; + $lang->image_name_max_width = 'En Yük. Genişlik'; + $lang->image_name_max_height = 'En Yük. Uzunluk'; + $lang->image_mark = 'Resim İmi'; + $lang->image_mark_max_width = 'En Yük. Genişlik'; + $lang->image_mark_max_height = 'En Yük. Uzunluk'; + $lang->group_image_mark = 'Grup Simgesi'; + $lang->group_image_mark_max_width = 'En Yük. Genişlik'; + $lang->group_image_mark_max_height = 'En Yük. Uzunluk'; + $lang->group_image_mark_order = 'Grup Simge Sıralaması'; + $lang->signature_max_height = 'En Yük. İmza Uzunluğu'; + $lang->enable_openid = 'OpenID Aç'; + $lang->enable_join = 'Yeni Üye Kabul Et'; + $lang->enable_confirm = 'E-posta Doğrulaması'; + $lang->enable_ssl = 'SSL Etkinleştir'; + $lang->security_sign_in = 'Gelişmiş güvenliği kullanarak giriş yap'; + $lang->limit_day = 'Geçici Zaman Sınırı'; + $lang->limit_date = 'Zaman Sınırı'; + $lang->after_login_url = 'Giriş yaptıktan sonraki URL'; + $lang->after_logout_url = 'Çıkış yaptıktan sonraki URL'; + $lang->redirect_url = 'Giriş yaptıktan sonraki URL'; + $lang->agreement = 'Üyelik Sözleşmesi'; + $lang->accept_agreement = 'Kabul Et'; + $lang->member_info = 'Üye Bilgisi'; + $lang->current_password = 'Geçerli Şifre'; + $lang->openid = 'OpenID'; + $lang->allow_message = 'Mesajlaşmaya İzin Ver'; + $lang->allow_message_type = array( + 'Y' => 'Tümüne İzin Ver', + 'F' => 'Arkadaşlara İzin Ver', + 'N' => 'Tümünü Geri Çevir', + ); + $lang->about_allow_message = 'Mesajlaşmaya izin verebilir/reddedebilirsiniz.'; + $lang->logged_users = 'Giriş yapmış Kullanıcılar'; + + $lang->webmaster_name = "Webmaster İsmi"; + $lang->webmaster_email = "Webmaster E-postası"; + + $lang->about_keep_signed = 'Tarayıcıyı kapatsanız da sisteme bağlı kalacaksınız.\n\nEğer ortak bir bilgisayar kullanıyorsanız, kişisel bilgilerinizin gizliliği için bunu önermiyoruz'; + $lang->about_keep_warning = 'Tarayıcıyı kapatsanız da sisteme bağlı kalacaksınız. Eğer ortak bir bilgisayar kullanıyorsanız, kişisel bilgilerinizin gizliliği için bunu önermiyoruz'; + $lang->about_webmaster_name = "Lütfen onay maillerinde veya site yönetiminde kullanılacak webmaster ismini giriniz. (varsayılan : webmaster)"; + $lang->about_webmaster_email = "Lütfen webmaster e-posta adresini giriniz."; + + $lang->search_target_list = array( + 'user_id' => 'Kimlik', + 'user_name' => 'İsim', + 'nick_name' => 'Takma Ad', + 'email_address' => 'E-posta Adresi', + 'regdate' => 'Kayıt Tarihi', + 'regdate_more' => 'Kayıt Tarihi (detaylı)', + 'regdate_less' => 'Kayıt Tarihi (basit)', + 'last_login' => 'Son Giriş Tarihi', + 'last_login_more' => 'Son Giriş Tarihi (detaylı)', + 'last_login_less' => 'Son Giriş Tarihi (basit)', + 'extra_vars' => 'Fazladan Çeş.', + ); + + $lang->cmd_login = 'Giriş Yap'; + $lang->cmd_logout = 'Çıkış Yap'; + $lang->cmd_signup = 'Kaydol'; + $lang->cmd_site_signup = 'Kaydol'; + $lang->cmd_modify_member_info = 'Üye Bilgilerini Düzenle'; + $lang->cmd_modify_member_password = 'Şifreyi Düzenle'; + $lang->cmd_view_member_info = 'Üye Bilgisi'; + $lang->cmd_leave = 'Ayrıl'; + $lang->cmd_find_member_account = 'Hesap Bilgisi Bul'; + $lang->cmd_resend_auth_mail = 'Etkinleştirme Maili Talebinde Bulun'; + + $lang->cmd_member_list = 'Üye Listesi'; + $lang->cmd_module_config = 'Varsayılan Ayar'; + $lang->cmd_member_group = 'Üye Grupları'; + $lang->cmd_send_mail = 'Mail Gönder'; + $lang->cmd_manage_id = 'Yasaklanmış Kimlikler'; + $lang->cmd_manage_form = 'Kayıt Formu'; + $lang->cmd_view_own_document = 'Yazılmış Makaleler'; + $lang->cmd_manage_member_info = 'Üye Bilgisini Yönet'; + $lang->cmd_trace_document = 'Yazılmış Makalelerini Gör'; + $lang->cmd_trace_comment = 'Yazılmış Yorumlarını Gör'; + $lang->cmd_view_scrapped_document = 'Hasarlılar'; + $lang->cmd_view_saved_document = 'Kayıtlı Makaleler'; + $lang->cmd_send_email = 'Mail Gönder'; + + $lang->msg_email_not_exists = "Geçerli olmayan bir e-posta adresi girdiniz"; + + $lang->msg_alreay_scrapped = 'Bu makale zaten hasarlı'; + + $lang->msg_cart_is_null = 'Lütfen hedefi seçiniz'; + $lang->msg_checked_file_is_deleted = '%d isimli ek dosya silindi'; + + $lang->msg_find_account_title = 'Hesap Bilgisi'; + $lang->msg_find_account_info = 'Talep edilen hesap bilgisi.'; + $lang->msg_find_account_comment = 'Şifreniz aşağıdaki linke tıkladığınızda, yukardaki gibi değiştirilecektir.
    Lütfen giriş yaptıktan sonra şifrenizi değiştiriniz.'; + $lang->msg_confirm_account_title = 'Zeroboard XE Hesap Etkinleştirmesi'; + $lang->msg_confirm_account_info = 'Hesap Bilginiz:'; + $lang->msg_confirm_account_comment = 'Hesabınızı etkinleştirmek için takip eden linke tıklayınız.'; + $lang->msg_auth_mail_sent = 'Etknileştirme maili %s adresine gönderildi. Lütfen mailinizi kontrol ediniz.'; + $lang->msg_confirm_mail_sent = '%s adresine etkinleştirme maili gönderdik. Lütfen mailinizi kontrol ediniz.'; + $lang->msg_invalid_auth_key = 'Geçersiz doğrulama talebi.
    Lütfen hesap bilgisini tekrar bulmayı deneyin ya da yöneticilerle iletişime geçin.'; + $lang->msg_success_authed = 'Hesabınız başarıyla etkinleştirildi ve giriş yapıldı.\n Lütfen mailinize gelen şifreyi kullanarak yeni şifreinizi oluşturunuz.'; + $lang->msg_success_confirmed = 'Hesabınız başarıyla etkinleştirildi.'; + + $lang->msg_new_member = 'Üye Ekle'; + $lang->msg_update_member = 'Üye Bilgisini Düzenle'; + $lang->msg_leave_member = 'Ayrıl'; + $lang->msg_group_is_null = 'Grup yok'; + $lang->msg_not_delete_default = 'Varsayılan ögeler silinemez'; + $lang->msg_not_exists_member = "Geçersiz üye"; + $lang->msg_cannot_delete_admin = 'Admin Kimliği silinemez. Kimliği yönetimden çıkartıp tekrar deneyiniz.'; + $lang->msg_exists_user_id = 'Bu kimlik önceden alınmış. Lütfen başka bir kimlik deneyiniz.'; + $lang->msg_exists_email_address = 'Bu mail adresi zaten kullanımda. Lütfen başka bir mail adresi deneyiniz.'; + $lang->msg_exists_nick_name = 'Bu rumuz önceden alınmış. Lütfen başka bir rumuz deneyiniz.'; + $lang->msg_signup_disabled = 'Kayıt olma yetkiniz bulunmamaktadır'; + $lang->msg_already_logged = 'Zaten giriş yapmış bulunmaktasınız'; + $lang->msg_not_logged = 'Lütfen önce giriş yapınız'; + $lang->msg_insert_group_name = 'Lütfen grup ismini giriniz'; + $lang->msg_check_group = 'Lütfen grubu seçiniz'; + + $lang->msg_not_uploaded_profile_image = 'Profil resmi kaydedilemedi'; + $lang->msg_not_uploaded_image_name = 'Resim İsmi kaydedilemedi'; + $lang->msg_not_uploaded_image_mark = 'Resim İmi kaydedilemedi'; + $lang->msg_not_uploaded_group_image_mark = 'Grup resim imi kaydedilemedi'; + + $lang->msg_accept_agreement = 'Sözleşmeyi kabul etmeniz gerekmektedir'; + + $lang->msg_user_denied = 'Yasaklanmış bir Kimlik girdiniz'; + $lang->msg_user_not_confirmed = 'Hesabınız henüz etkinleştirilmemiş. Lütfen mailinizi kontrol ediniz.'; + $lang->msg_user_limited = 'Bu kimlik, %s Tarihinden sonra kullanılabilir'; + + $lang->about_user_id = 'Kullanıcı kimliği 3~20 karakter uzunluğunda ve hem harf hem rakam içermeli ve ilk bir harfle başlamalıdır.'; + $lang->about_password = 'Şifre 6~20 karakter uzunluğunda olmalıdır'; + $lang->about_user_name = 'İsim 2~20 karakter uzunluğunda olmalıdır'; + $lang->about_nick_name = 'Rumuz 2~20 karakter uzunluğunda olmalıdır'; + $lang->about_email_address = 'E-posta adresiniz, e-posta onaylamasından sonra şifre düzenlemesi için kullanılacaktır'; + $lang->about_homepage = 'Lütfen varsa website adresinizi giriniz'; + $lang->about_blog_url = 'Lütfen varsa blog adresinizi giriniz'; + $lang->about_birthday = 'Lütfen doğum tarihinizi giriniz'; + $lang->about_allow_mailing = "Eğer mailleşmeyi etkinleştirmezseniz, grup maillerini alamayacaksınız"; + $lang->about_denied = 'Kimliği yasaklanmak için işaretleyiniz'; + $lang->about_is_admin = 'Superadmin yetkisi vermek için işaretleyiniz'; + $lang->about_member_description = "Yöneticinin kullanıcılar hakkındaki kısa notu"; + $lang->about_group = 'Bir kimlik, birçok grubun üyesi olabilir'; + + $lang->about_column_type = 'Lütfen detaylı kayıt formunun biçimini ayarlayınız'; + $lang->about_column_name = 'Lütfen şablonda kullanılabilecek İngilizce bir isim giriniz. (isim değişkendir)'; + $lang->about_column_title = 'Bu girdi, kayıt veya üye bilgisi düzenleme/görüntüleme formunda gösterilecektir'; + $lang->about_default_value = 'Varsayılan değerleri ayarlayabilirsiniz'; + $lang->about_active = 'Kayıt formunu gösterebilmeniz için, öğeleri etkinleştirdiğinizden emin olun'; + $lang->about_form_description = 'Eğer tanım formuna giriş yaparsanız, bu girdiler giriş formunda görünecektir'; + $lang->about_required = 'Eğer işaretlerseniz, kayıt için gerekli bir öğe olacaktır'; + + $lang->about_enable_openid = 'Eğer OpenID hizmeti sunmak istiyorsanız, lütfen işaretleyiniz'; + $lang->about_enable_join = 'Yeni üyelerin sitenize kayıt yapmalarına izin vermek istiyorsanız lütfen işaretleyiniz'; + $lang->about_enable_confirm = 'Yeni üyelerin hesaplarını e-posta yoluyla etkinleştirmelerini istiyorsanız lütfen işaretleyiniz.'; + $lang->about_enable_ssl = 'Kayıt Ol/Üye Bilgisini Değiştir/Giriş Yap \'daki kişisel bilgiler, eğer sunucunuz da SSL servisi veriyorsa, SSL (https) olarak ayarlanabilir.'; + $lang->about_limit_day = 'Kayıttan sonraki hesap etkinleştirme süresini kısıtlayabilirsiniz'; + $lang->about_limit_date = 'Üyeler, belirlenen tarihe kadar kayıt yapamazlar'; + $lang->about_after_login_url = 'Giriş yaptıktan sonraki gidilecek URL\'yi ayarlayabilirsiniz. Boş bırakmak, geçerli sayfayı bırakır.'; + $lang->about_after_logout_url = 'Çıkış yaptıktan sonraki gidilecek URL\'yi ayarlayabilirsiniz. Boş bırakmak, geçerli sayfa manasına gelir.'; + $lang->about_redirect_url = 'Lütfen üyelerin kayıt olduktan sonraki yönlendirilecekleri URL\'yi giriniz. Bır url girilmediğinde, kayıt sayfasından bir önceki sayfaya yönlendirileceklerdir.'; + $lang->about_agreement = "Eğer boş bırakılmadıysa, Kayıt Sözleşmesi görüntülenecektir"; + + $lang->about_image_name = "Üyeler, metin yerine resim adı kullanabileceklerdir"; + $lang->about_image_mark = "Üyeler, isimlerinin önünde işaret resmi kullanabilirler"; + $lang->about_group_image_mark = "Kullanıcıların isimlerinin önlerinde görüntülenecek grup işaretleri kullanabilirsiniz"; + $lang->about_profile_image = 'Üyeler, profil resmi kullanabilirler'; + $lang->about_accept_agreement = "Anlaşmayı okudum ve kabul ediyorum"; + + $lang->about_member_default = 'Varsayılan grup, kullanıcı kayıt olduktan sonra yönlendirileceği grup olacaktır'; + + $lang->about_openid = 'OpenID olarak giriş yaptığınızda, e-posta adresi ya da kimliğiniz gibi temel bilgi sitede kaydedilecektir, şifre ve onaylama yönetimi işlemi, hizmet veren geçerli OpenID tarafından yapılacaktır'; + $lang->about_openid_leave = 'OpenID\'nin bu bölünmesi, üyelik bilginizin bu siteden silinmesi demektir.
    Bölünmeden sonra giriş yaparsanız, yeni bir üye gibi kabul edilecekseniz, bu yüzden eski makalelerinize ulaşma yetkiniz olmayacaktır.'; + + $lang->about_member = "Üye modülü size; üyeleri oluşturmada, düzenlemede, silmede ve kayıt formunu ya da grupları düzenlemede yardımcı olur.\nÜyeleri yönetmek için özel gruplar ekleyebilir ve aynı zamanda kayıt formunu değiştirerek üyeler hakkında ek bilgi alabilirsiniz."; + $lang->about_find_member_account = 'Hesap bilginiz, kayıt olduğunuz e-posta adresine gönderilecektir.
    Kayıt esnasında kullandığınız e-posta adresini giriniz ve "Hesap Bilgisini Bul" tuşuna basınız.
    '; + $lang->about_ssl_port = 'Eğer varsayılan SSL portundan farklı bir port kullanıyorsanız, lütfen giriniz'; + $lang->add_openid = 'OpenID Ekle'; + + $lang->about_resend_auth_mail = 'Eğer daha önce etkinleştirmediyseniz, etkinleştirme maili talebinde bulunabilirsiniz'; + $lang->no_article = 'Hiçbir makale bulunmuyor'; + + $lang->find_account_question = 'Geçici şifre sorusu'; + $lang->about_find_account_question = 'Kimliğinize, mail adresinize ya da cevapladığınız soruya göre geçici şifre edinebilirsiniz.'; + $lang->find_account_question_items = array('' + ,'Diğer e-posta adresiniz nedir?' + ,'En sevdiğiniz şey?' + ,'Mezun olduğunuz ilkokul?' + ,'Memleketiniz neresi?' + ,'İdeal eşiniz nasıl olmalı?' + ,"Annenizin adı?" + ,"Babanızın adı?" + ,'En sevdiğiniz renk?' + ,'En sevdiğiniz yemek?' + ); + $lang->temp_password = 'Geçici şifre'; + $lang->cmd_get_temp_password = 'Geçici bir şifre edin'; + $lang->about_get_temp_password = 'Giriş yaptıktan sonra şifrenizi değiştirin.'; + $lang->msg_question_not_exists = 'Geçici şifre için güvenlik sorusunu belirlemediniz.'; + $lang->msg_answer_not_matches = 'Soru için verdiğiniz cevap doğru değil.'; + + $lang->change_password_date = 'Şifre yenileme döngüsü'; + $lang->about_change_password_date = 'Eğer buna bir değer biçerseniz, şifrenizi belirli aralıklarla değiştirmeniz konusunda bildirim alacaksanız (eğer 0 olarak ayarlandıysa, devredışıdır)'; +?> diff --git a/modules/member/lang/vi.lang.php b/modules/member/lang/vi.lang.php index ba26ee270..edadad6d6 100644 --- a/modules/member/lang/vi.lang.php +++ b/modules/member/lang/vi.lang.php @@ -1,240 +1,240 @@ -member = 'Thành viên'; - $lang->member_default_info = 'Thông tin cá nhân'; - $lang->member_extend_info = 'Thông tin bổ xung'; - $lang->default_group_1 = "Member"; - $lang->default_group_2 = "Moderator"; - $lang->admin_group = "Administrator"; - $lang->keep_signed = 'Nhớ thông tin đăng nhập'; - $lang->remember_user_id = 'Lưu tên sử dụng'; - $lang->already_logged = "Bạn đã đăng nhập"; - $lang->denied_user_id = 'ID đăng nhập của bạn đã bị cấm sử dụng.'; - $lang->null_user_id = 'Xin vui lòng nhập ID đăng nhập'; - $lang->null_password = 'Xin vui lòng nhập mật khẩu'; - $lang->invalid_authorization = 'Tài khoản đăng nhập không đúng.'; - $lang->invalid_user_id= "Bạn đã nhập sai tên sử dụng"; - $lang->allow_mailing = 'Đồng ý nhận Email'; - $lang->invalid_password = 'Mật khẩu không đúng'; - $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; - $lang->denied = 'Bị từ chối'; - $lang->is_admin = 'Toàn quyền Administrator'; - $lang->group = 'Phân nhóm'; - $lang->group_title = 'Tên nhóm'; - $lang->group_srl = 'Nhóm số'; - $lang->signature = 'Chữ kí'; - $lang->profile_image = 'Hình đại diện'; - $lang->profile_image_max_width = 'Chiểu rộng tối đa'; - $lang->profile_image_max_height = 'Chiều cao tối đa  '; - $lang->image_name = 'Hình thay thế tên hiển thị'; - $lang->image_name_max_width = 'Chiểu rộng tối đa'; - $lang->image_name_max_height = 'Chiều cao tối đa  '; - $lang->image_mark = 'Hình đánh dấu'; - $lang->image_mark_max_width = 'Chiểu rộng tối đa'; - $lang->image_mark_max_height = 'Chiều cao tối đa  '; - $lang->group_image_mark = 'Hình đại diện nhóm'; - $lang->group_image_mark_max_width = 'Chiểu rộng tối đa'; - $lang->group_image_mark_max_height = 'Chiều cao tối đa  '; - $lang->group_image_mark_order = 'Thứ tự hình đại diện nhóm'; - $lang->signature_max_height = 'Chiều cao lớn nhất của chữ kí'; - $lang->enable_openid = 'Kích hoạt OpenID'; - $lang->enable_join = 'Đồng ý đăng kí thành viên'; - $lang->enable_confirm = 'Xác nhận qua Email'; - $lang->enable_ssl = 'Mở SSL'; - $lang->security_sign_in = 'Bảo mật đăng nhập'; - $lang->limit_day = 'Hạn sử dụng'; - $lang->limit_date = 'Ngày giới hạn'; - $lang->after_login_url = 'URL sau khi đăng nhập'; - $lang->after_logout_url = 'URL sau khi thoát'; - $lang->redirect_url = 'URL sau khi đăng kí'; - $lang->agreement = 'Quy định sử dụng'; - $lang->accept_agreement = 'Đồng ý'; - $lang->member_info = 'Thông tin cá nhân'; - $lang->current_password = 'Mật khẩu hiện tại'; - $lang->openid = 'OpenID'; - $lang->allow_message = 'Nhận tin nhắn'; - $lang->allow_message_type = array( - 'Y' => 'Tất cả', - 'F' => 'Chỉ của bạn bè', - 'N' => 'Từ chối tất cả', - ); - $lang->about_allow_message = 'Bạn có thể chấp nhận hoặc từ chối những tin nhắn.'; - $lang->logged_users = 'Thành viên đăng nhập'; - - $lang->webmaster_name = "Tên Webmaster"; - $lang->webmaster_email = " Email Webmaster"; - - $lang->about_keep_signed = 'Mặc dù tắt trình duyệt nhưng thông tin đăng nhập của bạn vẫn được lưu lại trên máy tính này.\n\nNếu bạn sử dụng máy tính dùng chung, người khác cũng có thể đăng nhập dưới tên truy cập của bạn. Vì vậy chức năng này không nên sử dụng nếu máy tính này không phải của riêng bạn!'; - $lang->about_keep_warning = 'Mặc dù tắt trình duyệt nhưng thông tin đăng nhập của bạn vẫn được lưu lại trên máy tính này. Nếu bạn sử dụng máy tính dùng chung, người khác cũng có thể đăng nhập dưới tên truy cập của bạn. Vì vậy chức năng này không nên sử dụng nếu máy tính này không phải của riêng bạn!'; - $lang->about_webmaster_name = "Xin hãy nhập tên của Webmaster để nhận Email và quản lý. (Mặc định: webmaster)"; - $lang->about_webmaster_email = "Xin hãy nhập Email của Webmaster."; - - $lang->search_target_list = array( - 'user_id' => 'ID đăng nhập', - 'user_name' => 'Tên thật', - 'nick_name' => 'Nickname', - 'email_address' => 'Địa chỉ Email', - 'regdate' => 'Ngày đăng kí', - 'regdate_more' => 'Ngày đăng kí nhiều nhất', - 'regdate_less' => 'Ngày đăng kí ít nhất', - 'last_login' => 'Lần cuối đăng nhập', - 'last_login_more' => 'Đăng nhập nhiều nhất', - 'last_login_less' => 'Đăng nhập ít nhất', - 'extra_vars' => 'Thông tin bổ xung', - ); - - $lang->cmd_login = 'Đăng nhập'; - $lang->cmd_logout = 'Thoát'; - $lang->cmd_signup = 'Đăng kí'; - $lang->cmd_site_signup = 'Đăng kí'; - $lang->cmd_modify_member_info = 'Sửa đổi thông tin cá nhân'; - $lang->cmd_modify_member_password = 'Sửa đổi mật khẩu'; - $lang->cmd_view_member_info = 'Xem thông tin cá nhân'; - $lang->cmd_leave = 'Từ bỏ'; - $lang->cmd_find_member_account = 'Lấy lại thông tin'; - $lang->cmd_resend_auth_mail = 'Xác nhận lại Email'; - - $lang->cmd_member_list = 'Danh sách thành viên'; - $lang->cmd_module_config = 'Thiết lập mặc định'; - $lang->cmd_member_group = 'Quản lý nhóm'; - $lang->cmd_send_mail = 'Gửi Email'; - $lang->cmd_manage_id = 'Tên sử dụng cấm đăng kí'; - $lang->cmd_manage_form = 'Quản lý mẫu đăng kí'; - $lang->cmd_view_own_document = 'Bài gửi'; - $lang->cmd_manage_member_info = 'Quản lý thông tin thành viên'; - $lang->cmd_trace_document = 'Theo dõi chủ đề'; - $lang->cmd_trace_comment = 'Theo dõi thảo luận'; - $lang->cmd_view_scrapped_document = 'Phân loại'; - $lang->cmd_view_saved_document = 'Bài viết đã lưu'; - $lang->cmd_send_email = 'Gửi eMail'; - - $lang->msg_email_not_exists = "Bạn đã nhập sai Email"; - - $lang->msg_alreay_scrapped = 'Bài viết đã được phân loại.'; - - $lang->msg_cart_is_null = 'Xin vui lòng lựa chọn vị trí'; - $lang->msg_checked_file_is_deleted = '%d đính kèm đã được xóa.'; - - $lang->msg_find_account_title = 'Thông tin đăng kí tại Website http;//4all.kr'; - $lang->msg_find_account_info = 'Thông tin tài khoản.'; - $lang->msg_find_account_comment = 'Mật khẩu sẽ thay đổi khi bạn bấm vào đường Link này.
    Xin vui lòng thay đổi mật khẩu sau khi đăng nhập!'; - $lang->msg_confirm_account_title = 'Thông tin đăng kí thành viên tại Website http://4all.kr'; - $lang->msg_confirm_account_info = 'Đây là thông tin bạn đã đăng kí tại Website http://4all.kr:'; - $lang->msg_confirm_account_comment = 'Bấm vào đường Link này để hoàn tất việc đăng kí.'; - $lang->msg_auth_mail_sent = 'Email xác nhận đã được gửi đến %s. Xin vui lòng kiểm tra Inbox hoặc Bulk mail của bạn!'; - $lang->msg_confirm_mail_sent = 'Chúng tôi đã gửi Email xác nhận đến %s. Xin vui lòng bấm vào Link đi kèm trong Email để hoàn tất việc đăng kí!'; - $lang->msg_invalid_auth_key = 'Xác nhận không hợp lệ.
    Xin vui lòng kiểm tra lại hoặc liên hệ với Webmaster để được hỗ trợ!'; - $lang->msg_success_authed = 'Tài khoản của bạn đã được xác nhận.\n Xin vui lòng thay đổi mật khẩu khác với mật khẩu trong Email và dễ nhớ hơn!'; - $lang->msg_success_confirmed = 'Đã xác nhận thành công.
    Xin cảm ơn đã tham gia cùng chúng tôi!'; - - $lang->msg_new_member = 'Thêm thành viên'; - $lang->msg_update_member = 'Sửa đổi thông tin thành viên'; - $lang->msg_leave_member = 'Loại bỏ'; - $lang->msg_group_is_null = 'Không đăng kí vào nhóm nào'; - $lang->msg_not_delete_default = 'Mặc định không thể xóa'; - $lang->msg_not_exists_member = "Thành viên không hợp lệ"; - $lang->msg_cannot_delete_admin = 'Admin ID không thể xóa!'; - $lang->msg_exists_user_id = 'Tên sử dụng này đã có người dùng. Xin vui lòng thử lại với tên truy cập khác!'; - $lang->msg_exists_email_address = 'Email này đã có người sử dụng. Xin vui lòng thử lại với Email khác!'; - $lang->msg_exists_nick_name = 'Nickname này đã có người sử dụng. Xin vui lòng thử lại với Nickname khác!'; - $lang->msg_signup_disabled = 'Bạn không thể đăng kí.'; - $lang->msg_already_logged = 'Bạn đã đăng kí rồi.'; - $lang->msg_not_logged = 'Xin vui lòng đăng nhập trước!'; - $lang->msg_insert_group_name = 'Xin vui lòng nhập tên của nhóm!'; - $lang->msg_check_group = 'Xin vui lòng chọn nhóm!'; - - $lang->msg_not_uploaded_profile_image = 'Không thể đăng kí được hình đại diện.'; - $lang->msg_not_uploaded_image_name = 'Không thể gửi được hình ảnh thay Nickname.'; - $lang->msg_not_uploaded_image_mark = 'Hình đánh dấu đã không được gửi.'; - $lang->msg_not_uploaded_group_image_mark = 'Hình thay thế nhóm đã không được gửi'; - - $lang->msg_accept_agreement = 'Bạn phải đồng ý với điều khoản sử dụng của chúng tôi.'; - - $lang->msg_user_denied = 'Tên sử dụng này đã bị cấm đăng kí.'; - $lang->msg_user_not_confirmed = 'Bạn chưa xác nhận việc đăng kí. Xin vui lòng kiểm tra Email!'; - $lang->msg_user_limited = 'Bạn được phép sử dụng đến ngày %s'; - - $lang->about_user_id = 'Độ dài của tên truy cập được giới hạn từ 3 đến 20 kí tự gồm a-z và các số.'; - $lang->about_password = 'Độ dài mật khẩu giới hạn từ 6 đến 20 kí tự.'; - $lang->about_user_name = 'Giới hạn của tên từ 2 đến 20 kí tự.'; - $lang->about_nick_name = 'Độ dài của Nickname từ 2 đến 20 kí tự.'; - $lang->about_email_address = 'Email được sử dụng để lên lạc, xác nhận và lấy lại mật khẩu nếu lỡ quên.'; - $lang->about_homepage = 'Nếu bạn có Website hãy nhập vào đây.'; - $lang->about_blog_url = 'Nếu bạn có Blog hãy nhập vào đây.'; - $lang->about_birthday = 'Hãy chọn ngày sinh nhật của bạn.'; - $lang->about_allow_mailing = "Nếu không đồng ý nhận Email, bạn sẽ không thể nhận được những liên lạc của bạn bè hoặc của nhóm."; - $lang->about_denied = 'Kiểm tra tên sử dụng bị cấm.'; - $lang->about_is_admin = 'Kiểm tra toàn quyền Administrator'; - $lang->about_member_description = "Ghi nhớ của Admin về những thành viên"; - $lang->about_group = 'Một tên sử dụng có thể tham gia nhiều nhóm'; - - $lang->about_column_type = 'Hãy chọn một định dạng để sử dụng.'; - $lang->about_column_name = 'Nhập tên theo Tiếng Anh.'; - $lang->about_column_title = 'Sẽ được hiển thị khi đăng kí, sửa đổi hay xem thông tin thành viên.'; - $lang->about_default_value = 'Bạn có thể đặt giá trị mặc định.'; - $lang->about_active = 'Nếu chọn, thông tin này sẽ được hiển thị trong bảng đăng kí.'; - $lang->about_form_description = 'Nếu bạn nhập mô tả, nó sẽ được hiển thị trong bảng đăng kí.'; - $lang->about_required = 'Nếu chọn, thông tin này sẽ được hiển thị trong bảng đăng kí.'; - - $lang->about_enable_openid = 'Kích hoạt đăng nhập bằng OpenID.'; - $lang->about_enable_join = 'Cho phép thành viên đăng kí.'; - $lang->about_enable_confirm = 'Gửi Email xác nhận sau khi đăng kí.'; - $lang->about_enable_ssl = 'Thông tin cá nhân khi thành viên Đăng kí, Đăng nhập và Sủa đổi sẽ được gửi dưới dạng SSL(https). Hãy chọn nếu Server cho phép sử dụng chức năng này.'; - $lang->about_limit_day = 'Bạn có thể giới hạn ngày xác nhận sau khi đăng kí.'; - $lang->about_limit_date = 'Thành viên không thể đăng nhập nếu quá hạn xác nhận đăng kí.'; - $lang->about_after_login_url = 'Bạn có thể thiết đặt địa chỉ nào đó sẽ hiển thị sau khi đăng nhập. Để trống nếu không sử dụng.'; - $lang->about_after_logout_url = 'Bạn có thể thiết đặt địa chỉ nào đó sẽ hiển thị sau khi thoát. Để trống nếu không sử dụng.'; - $lang->about_redirect_url = 'Hãy nhập địa chỉ trang sẽ chuyển đến sau khi thành viên đăng kí. Để trống nếu không sử dụng.'; - $lang->about_agreement = "Điều khoản sử dụng sẽ hiển thị trong Form đăng kí nếu có nội dung."; - - $lang->about_image_name = "Cho phép thành viên sử dụng hình ảnh thay cho tên."; - $lang->about_image_mark = "Cho phép sử dụng hình ảnh nhỏ truóc tên của họ."; - $lang->about_group_image_mark = "Bạn có thể sử dụng biểu tượng nhóm sẽ hiển thị trước tên thành viên."; - $lang->about_profile_image = 'Cho phép thành viên sử dụng thông tin cá nhân bằng hình ảnh.'; - $lang->about_accept_agreement = "Tôi đã đọc và đồng ý với điều khoản sử dụng của Website."; - - $lang->about_member_default = 'Sẽ là nhóm mặc định khi thành viên đăng kí.'; - - $lang->about_openid = 'Khi bạn đăng nhập bằng OpenID, những thông tin cơ bản và Email của bạn sẽ lưu lại tại Website này. Việc này sẽ giúp bạn lấy lại thông tin nếu như bạn lỡ quên hoặc nhận những thông báo từ Ban Quản trị Website.'; - $lang->about_openid_leave = 'Thông tin OpenID của bạn sẽ được cập nhật tại Website này.
    Nếu bạn đăng nhập, Thông tin OpenID của bạn sẽ được lưu lại như một thành viên đã đăng kí, và bạn có thể gửi bài viết hay bình luận.'; - - $lang->about_member = "Chức năng của Module này sẽ cho phép bạn tạo, sửa, xóa thành viên và quản lý nhóm hay Form đăng kí.\nBạn có thể quản lý thành viên bằng cách tạo những nhóm mới, và thêm những thông tin trong Form đăng kí."; - $lang->about_find_member_account = 'Thông tin tài khoản của bạn sẽ được tìm thấy với Email bạn đã đăng kí.
    Xin vui lòng nhập Email mà bạn đã đăng kí và bấm "Lấy lại thông tin" để nhận được thông tin đăng nhập!.
    '; - $lang->about_ssl_port = 'Xin hãy nhập cổng kết nối mặc định cho SSL.'; - $lang->add_openid = 'Thêm OpenID'; - - $lang->about_resend_auth_mail = 'Nhận lại mã kích hoạt nếu bạn đã không nhận được Email kích hoạt khi đăng kí.'; - - $lang->find_account_question = '비밀번호 찾기 질문/답변'; - $lang->find_account_answer = '비밀번호 찾기 답변'; - $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; -/* - $lang->find_account_question_items = array('' - ,'다른 이메일 주소는?' - ,'나의 보물 1호는?' - ,'나의 출신 초등학교는?' - ,'나의 출신 고향은?' - ,'나의 이상형은?' - ,'어머니 성함은?' - ,'아버지 성함은?' - ,'가장 좋아하는 색깔은?' - ,'가장 좋아하는 음식은?' - ); -*/ - $lang->temp_password = '임시 비밀번호'; - $lang->cmd_get_temp_password = '임시 비밀번호 발급'; - $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; - $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; - $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; - - $lang->change_password_date = '비밀번호 갱신주기'; - $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; - -?> +member = 'Thành viên'; + $lang->member_default_info = 'Thông tin cá nhân'; + $lang->member_extend_info = 'Thông tin bổ xung'; + $lang->default_group_1 = "Member"; + $lang->default_group_2 = "Moderator"; + $lang->admin_group = "Administrator"; + $lang->keep_signed = 'Nhớ thông tin đăng nhập'; + $lang->remember_user_id = 'Lưu tên sử dụng'; + $lang->already_logged = "Bạn đã đăng nhập"; + $lang->denied_user_id = 'ID đăng nhập của bạn đã bị cấm sử dụng.'; + $lang->null_user_id = 'Xin vui lòng nhập ID đăng nhập'; + $lang->null_password = 'Xin vui lòng nhập mật khẩu'; + $lang->invalid_authorization = 'Tài khoản đăng nhập không đúng.'; + $lang->invalid_user_id= "Bạn đã nhập sai tên sử dụng"; + $lang->allow_mailing = 'Đồng ý nhận Email'; + $lang->invalid_password = 'Mật khẩu không đúng'; + $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; + $lang->denied = 'Bị từ chối'; + $lang->is_admin = 'Toàn quyền Administrator'; + $lang->group = 'Phân nhóm'; + $lang->group_title = 'Tên nhóm'; + $lang->group_srl = 'Nhóm số'; + $lang->signature = 'Chữ kí'; + $lang->profile_image = 'Hình đại diện'; + $lang->profile_image_max_width = 'Chiểu rộng tối đa'; + $lang->profile_image_max_height = 'Chiều cao tối đa  '; + $lang->image_name = 'Hình thay thế tên hiển thị'; + $lang->image_name_max_width = 'Chiểu rộng tối đa'; + $lang->image_name_max_height = 'Chiều cao tối đa  '; + $lang->image_mark = 'Hình đánh dấu'; + $lang->image_mark_max_width = 'Chiểu rộng tối đa'; + $lang->image_mark_max_height = 'Chiều cao tối đa  '; + $lang->group_image_mark = 'Hình đại diện nhóm'; + $lang->group_image_mark_max_width = 'Chiểu rộng tối đa'; + $lang->group_image_mark_max_height = 'Chiều cao tối đa  '; + $lang->group_image_mark_order = 'Thứ tự hình đại diện nhóm'; + $lang->signature_max_height = 'Chiều cao lớn nhất của chữ kí'; + $lang->enable_openid = 'Kích hoạt OpenID'; + $lang->enable_join = 'Đồng ý đăng kí thành viên'; + $lang->enable_confirm = 'Xác nhận qua Email'; + $lang->enable_ssl = 'Mở SSL'; + $lang->security_sign_in = 'Bảo mật đăng nhập'; + $lang->limit_day = 'Hạn sử dụng'; + $lang->limit_date = 'Ngày giới hạn'; + $lang->after_login_url = 'URL sau khi đăng nhập'; + $lang->after_logout_url = 'URL sau khi thoát'; + $lang->redirect_url = 'URL sau khi đăng kí'; + $lang->agreement = 'Quy định sử dụng'; + $lang->accept_agreement = 'Đồng ý'; + $lang->member_info = 'Thông tin cá nhân'; + $lang->current_password = 'Mật khẩu hiện tại'; + $lang->openid = 'OpenID'; + $lang->allow_message = 'Nhận tin nhắn'; + $lang->allow_message_type = array( + 'Y' => 'Tất cả', + 'F' => 'Chỉ của bạn bè', + 'N' => 'Từ chối tất cả', + ); + $lang->about_allow_message = 'Bạn có thể chấp nhận hoặc từ chối những tin nhắn.'; + $lang->logged_users = 'Thành viên đăng nhập'; + + $lang->webmaster_name = "Tên Webmaster"; + $lang->webmaster_email = " Email Webmaster"; + + $lang->about_keep_signed = 'Mặc dù tắt trình duyệt nhưng thông tin đăng nhập của bạn vẫn được lưu lại trên máy tính này.\n\nNếu bạn sử dụng máy tính dùng chung, người khác cũng có thể đăng nhập dưới tên truy cập của bạn. Vì vậy chức năng này không nên sử dụng nếu máy tính này không phải của riêng bạn!'; + $lang->about_keep_warning = 'Mặc dù tắt trình duyệt nhưng thông tin đăng nhập của bạn vẫn được lưu lại trên máy tính này. Nếu bạn sử dụng máy tính dùng chung, người khác cũng có thể đăng nhập dưới tên truy cập của bạn. Vì vậy chức năng này không nên sử dụng nếu máy tính này không phải của riêng bạn!'; + $lang->about_webmaster_name = "Xin hãy nhập tên của Webmaster để nhận Email và quản lý. (Mặc định: webmaster)"; + $lang->about_webmaster_email = "Xin hãy nhập Email của Webmaster."; + + $lang->search_target_list = array( + 'user_id' => 'ID đăng nhập', + 'user_name' => 'Tên thật', + 'nick_name' => 'Nickname', + 'email_address' => 'Địa chỉ Email', + 'regdate' => 'Ngày đăng kí', + 'regdate_more' => 'Ngày đăng kí nhiều nhất', + 'regdate_less' => 'Ngày đăng kí ít nhất', + 'last_login' => 'Lần cuối đăng nhập', + 'last_login_more' => 'Đăng nhập nhiều nhất', + 'last_login_less' => 'Đăng nhập ít nhất', + 'extra_vars' => 'Thông tin bổ xung', + ); + + $lang->cmd_login = 'Đăng nhập'; + $lang->cmd_logout = 'Thoát'; + $lang->cmd_signup = 'Đăng kí'; + $lang->cmd_site_signup = 'Đăng kí'; + $lang->cmd_modify_member_info = 'Sửa đổi thông tin cá nhân'; + $lang->cmd_modify_member_password = 'Sửa đổi mật khẩu'; + $lang->cmd_view_member_info = 'Xem thông tin cá nhân'; + $lang->cmd_leave = 'Từ bỏ'; + $lang->cmd_find_member_account = 'Lấy lại thông tin'; + $lang->cmd_resend_auth_mail = 'Xác nhận lại Email'; + + $lang->cmd_member_list = 'Danh sách thành viên'; + $lang->cmd_module_config = 'Thiết lập mặc định'; + $lang->cmd_member_group = 'Quản lý nhóm'; + $lang->cmd_send_mail = 'Gửi Email'; + $lang->cmd_manage_id = 'Tên sử dụng cấm đăng kí'; + $lang->cmd_manage_form = 'Quản lý mẫu đăng kí'; + $lang->cmd_view_own_document = 'Bài gửi'; + $lang->cmd_manage_member_info = 'Quản lý thông tin thành viên'; + $lang->cmd_trace_document = 'Theo dõi chủ đề'; + $lang->cmd_trace_comment = 'Theo dõi thảo luận'; + $lang->cmd_view_scrapped_document = 'Phân loại'; + $lang->cmd_view_saved_document = 'Bài viết đã lưu'; + $lang->cmd_send_email = 'Gửi eMail'; + + $lang->msg_email_not_exists = "Bạn đã nhập sai Email"; + + $lang->msg_alreay_scrapped = 'Bài viết đã được phân loại.'; + + $lang->msg_cart_is_null = 'Xin vui lòng lựa chọn vị trí'; + $lang->msg_checked_file_is_deleted = '%d đính kèm đã được xóa.'; + + $lang->msg_find_account_title = 'Thông tin đăng kí tại Website http;//4all.kr'; + $lang->msg_find_account_info = 'Thông tin tài khoản.'; + $lang->msg_find_account_comment = 'Mật khẩu sẽ thay đổi khi bạn bấm vào đường Link này.
    Xin vui lòng thay đổi mật khẩu sau khi đăng nhập!'; + $lang->msg_confirm_account_title = 'Thông tin đăng kí thành viên tại Website http://4all.kr'; + $lang->msg_confirm_account_info = 'Đây là thông tin bạn đã đăng kí tại Website http://4all.kr:'; + $lang->msg_confirm_account_comment = 'Bấm vào đường Link này để hoàn tất việc đăng kí.'; + $lang->msg_auth_mail_sent = 'Email xác nhận đã được gửi đến %s. Xin vui lòng kiểm tra Inbox hoặc Bulk mail của bạn!'; + $lang->msg_confirm_mail_sent = 'Chúng tôi đã gửi Email xác nhận đến %s. Xin vui lòng bấm vào Link đi kèm trong Email để hoàn tất việc đăng kí!'; + $lang->msg_invalid_auth_key = 'Xác nhận không hợp lệ.
    Xin vui lòng kiểm tra lại hoặc liên hệ với Webmaster để được hỗ trợ!'; + $lang->msg_success_authed = 'Tài khoản của bạn đã được xác nhận.\n Xin vui lòng thay đổi mật khẩu khác với mật khẩu trong Email và dễ nhớ hơn!'; + $lang->msg_success_confirmed = 'Đã xác nhận thành công.
    Xin cảm ơn đã tham gia cùng chúng tôi!'; + + $lang->msg_new_member = 'Thêm thành viên'; + $lang->msg_update_member = 'Sửa đổi thông tin thành viên'; + $lang->msg_leave_member = 'Loại bỏ'; + $lang->msg_group_is_null = 'Không đăng kí vào nhóm nào'; + $lang->msg_not_delete_default = 'Mặc định không thể xóa'; + $lang->msg_not_exists_member = "Thành viên không hợp lệ"; + $lang->msg_cannot_delete_admin = 'Admin ID không thể xóa!'; + $lang->msg_exists_user_id = 'Tên sử dụng này đã có người dùng. Xin vui lòng thử lại với tên truy cập khác!'; + $lang->msg_exists_email_address = 'Email này đã có người sử dụng. Xin vui lòng thử lại với Email khác!'; + $lang->msg_exists_nick_name = 'Nickname này đã có người sử dụng. Xin vui lòng thử lại với Nickname khác!'; + $lang->msg_signup_disabled = 'Bạn không thể đăng kí.'; + $lang->msg_already_logged = 'Bạn đã đăng kí rồi.'; + $lang->msg_not_logged = 'Xin vui lòng đăng nhập trước!'; + $lang->msg_insert_group_name = 'Xin vui lòng nhập tên của nhóm!'; + $lang->msg_check_group = 'Xin vui lòng chọn nhóm!'; + + $lang->msg_not_uploaded_profile_image = 'Không thể đăng kí được hình đại diện.'; + $lang->msg_not_uploaded_image_name = 'Không thể gửi được hình ảnh thay Nickname.'; + $lang->msg_not_uploaded_image_mark = 'Hình đánh dấu đã không được gửi.'; + $lang->msg_not_uploaded_group_image_mark = 'Hình thay thế nhóm đã không được gửi'; + + $lang->msg_accept_agreement = 'Bạn phải đồng ý với điều khoản sử dụng của chúng tôi.'; + + $lang->msg_user_denied = 'Tên sử dụng này đã bị cấm đăng kí.'; + $lang->msg_user_not_confirmed = 'Bạn chưa xác nhận việc đăng kí. Xin vui lòng kiểm tra Email!'; + $lang->msg_user_limited = 'Bạn được phép sử dụng đến ngày %s'; + + $lang->about_user_id = 'Độ dài của tên truy cập được giới hạn từ 3 đến 20 kí tự gồm a-z và các số.'; + $lang->about_password = 'Độ dài mật khẩu giới hạn từ 6 đến 20 kí tự.'; + $lang->about_user_name = 'Giới hạn của tên từ 2 đến 20 kí tự.'; + $lang->about_nick_name = 'Độ dài của Nickname từ 2 đến 20 kí tự.'; + $lang->about_email_address = 'Email được sử dụng để lên lạc, xác nhận và lấy lại mật khẩu nếu lỡ quên.'; + $lang->about_homepage = 'Nếu bạn có Website hãy nhập vào đây.'; + $lang->about_blog_url = 'Nếu bạn có Blog hãy nhập vào đây.'; + $lang->about_birthday = 'Hãy chọn ngày sinh nhật của bạn.'; + $lang->about_allow_mailing = "Nếu không đồng ý nhận Email, bạn sẽ không thể nhận được những liên lạc của bạn bè hoặc của nhóm."; + $lang->about_denied = 'Kiểm tra tên sử dụng bị cấm.'; + $lang->about_is_admin = 'Kiểm tra toàn quyền Administrator'; + $lang->about_member_description = "Ghi nhớ của Admin về những thành viên"; + $lang->about_group = 'Một tên sử dụng có thể tham gia nhiều nhóm'; + + $lang->about_column_type = 'Hãy chọn một định dạng để sử dụng.'; + $lang->about_column_name = 'Nhập tên theo Tiếng Anh.'; + $lang->about_column_title = 'Sẽ được hiển thị khi đăng kí, sửa đổi hay xem thông tin thành viên.'; + $lang->about_default_value = 'Bạn có thể đặt giá trị mặc định.'; + $lang->about_active = 'Nếu chọn, thông tin này sẽ được hiển thị trong bảng đăng kí.'; + $lang->about_form_description = 'Nếu bạn nhập mô tả, nó sẽ được hiển thị trong bảng đăng kí.'; + $lang->about_required = 'Nếu chọn, thông tin này sẽ được hiển thị trong bảng đăng kí.'; + + $lang->about_enable_openid = 'Kích hoạt đăng nhập bằng OpenID.'; + $lang->about_enable_join = 'Cho phép thành viên đăng kí.'; + $lang->about_enable_confirm = 'Gửi Email xác nhận sau khi đăng kí.'; + $lang->about_enable_ssl = 'Thông tin cá nhân khi thành viên Đăng kí, Đăng nhập và Sủa đổi sẽ được gửi dưới dạng SSL(https). Hãy chọn nếu Server cho phép sử dụng chức năng này.'; + $lang->about_limit_day = 'Bạn có thể giới hạn ngày xác nhận sau khi đăng kí.'; + $lang->about_limit_date = 'Thành viên không thể đăng nhập nếu quá hạn xác nhận đăng kí.'; + $lang->about_after_login_url = 'Bạn có thể thiết đặt địa chỉ nào đó sẽ hiển thị sau khi đăng nhập. Để trống nếu không sử dụng.'; + $lang->about_after_logout_url = 'Bạn có thể thiết đặt địa chỉ nào đó sẽ hiển thị sau khi thoát. Để trống nếu không sử dụng.'; + $lang->about_redirect_url = 'Hãy nhập địa chỉ trang sẽ chuyển đến sau khi thành viên đăng kí. Để trống nếu không sử dụng.'; + $lang->about_agreement = "Điều khoản sử dụng sẽ hiển thị trong Form đăng kí nếu có nội dung."; + + $lang->about_image_name = "Cho phép thành viên sử dụng hình ảnh thay cho tên."; + $lang->about_image_mark = "Cho phép sử dụng hình ảnh nhỏ truóc tên của họ."; + $lang->about_group_image_mark = "Bạn có thể sử dụng biểu tượng nhóm sẽ hiển thị trước tên thành viên."; + $lang->about_profile_image = 'Cho phép thành viên sử dụng thông tin cá nhân bằng hình ảnh.'; + $lang->about_accept_agreement = "Tôi đã đọc và đồng ý với điều khoản sử dụng của Website."; + + $lang->about_member_default = 'Sẽ là nhóm mặc định khi thành viên đăng kí.'; + + $lang->about_openid = 'Khi bạn đăng nhập bằng OpenID, những thông tin cơ bản và Email của bạn sẽ lưu lại tại Website này. Việc này sẽ giúp bạn lấy lại thông tin nếu như bạn lỡ quên hoặc nhận những thông báo từ Ban Quản trị Website.'; + $lang->about_openid_leave = 'Thông tin OpenID của bạn sẽ được cập nhật tại Website này.
    Nếu bạn đăng nhập, Thông tin OpenID của bạn sẽ được lưu lại như một thành viên đã đăng kí, và bạn có thể gửi bài viết hay bình luận.'; + + $lang->about_member = "Chức năng của Module này sẽ cho phép bạn tạo, sửa, xóa thành viên và quản lý nhóm hay Form đăng kí.\nBạn có thể quản lý thành viên bằng cách tạo những nhóm mới, và thêm những thông tin trong Form đăng kí."; + $lang->about_find_member_account = 'Thông tin tài khoản của bạn sẽ được tìm thấy với Email bạn đã đăng kí.
    Xin vui lòng nhập Email mà bạn đã đăng kí và bấm "Lấy lại thông tin" để nhận được thông tin đăng nhập!.
    '; + $lang->about_ssl_port = 'Xin hãy nhập cổng kết nối mặc định cho SSL.'; + $lang->add_openid = 'Thêm OpenID'; + + $lang->about_resend_auth_mail = 'Nhận lại mã kích hoạt nếu bạn đã không nhận được Email kích hoạt khi đăng kí.'; + + $lang->find_account_question = '비밀번호 찾기 질문/답변'; + $lang->find_account_answer = '비밀번호 찾기 답변'; + $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; +/* + $lang->find_account_question_items = array('' + ,'다른 이메일 주소는?' + ,'나의 보물 1호는?' + ,'나의 출신 초등학교는?' + ,'나의 출신 고향은?' + ,'나의 이상형은?' + ,'어머니 성함은?' + ,'아버지 성함은?' + ,'가장 좋아하는 색깔은?' + ,'가장 좋아하는 음식은?' + ); +*/ + $lang->temp_password = '임시 비밀번호'; + $lang->cmd_get_temp_password = '임시 비밀번호 발급'; + $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; + $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; + $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; + + $lang->change_password_date = '비밀번호 갱신주기'; + $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; + +?> diff --git a/modules/member/lang/zh-CN.lang.php b/modules/member/lang/zh-CN.lang.php index 81e47761e..7ee2d5849 100644 --- a/modules/member/lang/zh-CN.lang.php +++ b/modules/member/lang/zh-CN.lang.php @@ -1,238 +1,238 @@ -member = '会员'; - $lang->member_default_info = '基本资料'; - $lang->member_extend_info = '扩展信息'; - $lang->default_group_1 = "准会员"; - $lang->default_group_2 = "正会员"; - $lang->admin_group = "管理组"; - $lang->keep_signed = '自动登录'; - $lang->remember_user_id = '保存ID'; - $lang->already_logged = '您已经登录!'; - $lang->denied_user_id = '被禁止的用户名。'; - $lang->null_user_id = '请输入用户名。'; - $lang->null_password = '请输入密码。'; - $lang->invalid_authorization = '还没有认证!'; - $lang->invalid_user_id= '该用户名不存在,请检查您的输入是否有误!'; - $lang->invalid_password = '您的密码不正确!'; - $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; - $lang->allow_mailing = '接收邮件'; - $lang->denied = '禁止使用'; - $lang->is_admin = '最高管理权限'; - $lang->group = '用户组'; - $lang->group_title = '用户组标题'; - $lang->group_srl = '用户组编号'; - $lang->signature = '签名'; - $lang->profile_image = '个性头像'; - $lang->profile_image_max_width = '宽度限制'; - $lang->profile_image_max_height = '高度限制'; - $lang->image_name = '昵称图片'; - $lang->image_name_max_width = '宽度限制'; - $lang->image_name_max_height = '高度限制'; - $lang->image_mark = '用户图标'; - $lang->image_mark_max_width = '宽度限制'; - $lang->image_mark_max_height = '高度限制'; - $lang->group_image_mark = '用户组图标'; - $lang->group_image_mark_max_width = '宽度限制'; - $lang->group_image_mark_max_height = '高度限制'; - $lang->group_image_mark_order = '用户组图标顺序'; - $lang->signature_max_height = '签名高度限制'; - $lang->enable_openid = '支持OpenID'; - $lang->enable_join = '允许会员注册'; - $lang->enable_confirm = '使用邮件认证'; - $lang->enable_ssl = '使用SSL功能'; - $lang->security_sign_in = '使用安全登录'; - $lang->limit_day = '认证限制'; - $lang->limit_date = '限制日期'; - $lang->after_login_url = '登录后页面转向'; - $lang->after_logout_url = '退出后页面转向'; - $lang->redirect_url = '注册会员后页面转向'; - $lang->agreement = '会员注册条款'; - $lang->accept_agreement = '同意条款'; - $lang->member_info = '会员信息'; - $lang->current_password = '当前密码'; - $lang->openid = 'OpenID'; - $lang->allow_message = '接收短消息'; - $lang->allow_message_type = array( - 'Y' => '全部接收', - 'F' => '拒收', - 'N' => '只允许好友', - ); - $lang->about_allow_message = '可以指定接收短消息方法及对象。'; - $lang->logged_users = '在线用户'; - - $lang->webmaster_name = '管理员名'; - $lang->webmaster_email = '管理员电子邮件'; - - $lang->about_keep_signed = '关闭浏览器后也将维持登录状态。\n\n使用自动登录功能,可解决每次访问都要输入用户名及密码的麻烦。\n\n为防止个人信息泄露,在网吧,学校等公共场所请务必要确认解除登录状态。'; - $lang->about_keep_warning = '关闭浏览器后也将维持登录状态。\n\n使用自动登录功能,可解决每次访问都要输入用户名及密码的麻烦。 为防止个人信息泄露,在网吧,学校等公共场所请务必要确认解除登录状态。'; - $lang->about_webmaster_name = '请输入认证所需的电子邮件地址或管理其他网站时要使用的网站管理员名称。(默认 : webmaster)'; - $lang->about_webmaster_email = '请输入网站管理员的电子邮件地址。'; - - $lang->search_target_list = array( - 'user_id' => '用户名', - 'user_name' => '姓名', - 'nick_name' => '昵称', - 'email_address' => '邮箱地址', - 'regdate' => '注册日期', - 'regdate_more' => '注册日期(以上)', - 'regdate_less' => '注册日期(以下)', - 'last_login' => '最后登录', - 'last_login_more' => '最后登录(以上)', - 'last_login_less' => '最后登录시(以下)', - 'extra_vars' => '扩展信息', - ); - - - $lang->cmd_login = '登录'; - $lang->cmd_logout = '退出'; - $lang->cmd_signup = '新会员注册'; - $lang->cmd_site_signup = '注册'; - $lang->cmd_modify_member_info = '编辑个人资料'; - $lang->cmd_modify_member_password = '修改密码'; - $lang->cmd_view_member_info = '个人资料'; - $lang->cmd_leave = '注销'; - $lang->cmd_find_member_account = '查找用户名/密码'; - $lang->cmd_resend_auth_mail = '重新发送认证邮件'; - - $lang->cmd_member_list = '会员目录'; - $lang->cmd_module_config = '常规选项'; - $lang->cmd_member_group = '用户组'; - $lang->cmd_send_mail = '发送邮件'; - $lang->cmd_manage_id = '禁止用户名'; - $lang->cmd_manage_form = '扩展注册表单'; - $lang->cmd_view_own_document = '会员话题'; - $lang->cmd_manage_member_info = '管理会员信息'; - $lang->cmd_trace_document = '主题追踪'; - $lang->cmd_trace_comment = '评论追踪'; - $lang->cmd_view_scrapped_document = '我的收藏'; - $lang->cmd_view_saved_document = '临时保存箱'; - $lang->cmd_send_email = '发送邮件'; - - $lang->msg_email_not_exists = "没有找到您输入的Email地址。"; - - $lang->msg_alreay_scrapped = '已收藏的主题!'; - - $lang->msg_cart_is_null = '请选择对象。'; - $lang->msg_checked_file_is_deleted = '已删除%d个附件。'; - - $lang->msg_find_account_title = '注册信息。'; - $lang->msg_find_account_info = '您要查找的注册信息如下。'; - $lang->msg_find_account_comment = '点击下面的链接您的注册密码将更新为上述的系统自动生成密码。
    请重新登录后把密码改为您所熟悉的密码。'; - $lang->msg_confirm_account_title = '会员注册'; - $lang->msg_confirm_account_info = '您的注册信息如下:'; - $lang->msg_confirm_account_comment = '请点击下面链接完成会员认证。'; - $lang->msg_auth_mail_sent = '已向%s发送了认证邮件。请确认!!'; - $lang->msg_confirm_mail_sent = '已向%s发送了认证邮件。请确认!!'; - $lang->msg_invalid_auth_key = '错误的注册信息请求。
    请重新查找用户名及密码, 或联系管理员。'; - $lang->msg_success_authed = '新的注册信息已得到认证。请用邮件中的新密码修改您要想使用的密码。'; - $lang->msg_success_confirmed = '注册信息已成功激活!'; - - $lang->msg_new_member = '会员注册'; - $lang->msg_update_member = '修改会员信息'; - $lang->msg_leave_member = '注销会员'; - $lang->msg_group_is_null = '没有用户组。'; - $lang->msg_not_delete_default = '不能删除基本项目'; - $lang->msg_not_exists_member = '不存在的用户'; - $lang->msg_cannot_delete_admin = '不能删除管理员 ID .解除管理后再删除'; - $lang->msg_exists_user_id = '重复的用户名 ,请重新输入用户名。'; - $lang->msg_exists_email_address = '重复的电子邮件地址,请重新输入电子邮件地址。'; - $lang->msg_exists_nick_name = '重复的昵称,请重新输入昵称。'; - $lang->msg_signup_disabled = '不能注册会员'; - $lang->msg_already_logged = '您是注册会员。'; - $lang->msg_not_logged = '您还没有登录。'; - $lang->msg_insert_group_name = '请输入组名称'; - $lang->msg_check_group = '请选择组'; - - $lang->msg_not_uploaded_profile_image = '不能登录签名图像!'; - $lang->msg_not_uploaded_image_name = '不能登录昵称图像!'; - $lang->msg_not_uploaded_image_mark = '不能登录用户图标!'; - $lang->msg_not_uploaded_group_image_mark = '可以指定用户组图标。'; - - $lang->msg_accept_agreement = '您必须同意条款。'; - - $lang->msg_user_denied = '您输入的用户名已禁止使用!'; - $lang->msg_user_not_confirmed = '您的注册信息还没有被激活,请确认您的电子邮箱。'; - $lang->msg_user_limited = '您输入的用户名%s以后才可以开始使用。'; - - $lang->about_user_id = '用户名长度必须由 3 ~20 字以内的英文+数字组成,且首个字母必须是英文字母。'; - $lang->about_password = '密码长度必须在6~20字以内。'; - $lang->about_user_name = '姓名必须是2~20字以内。'; - $lang->about_nick_name = '昵称必须是2~20字以内。'; - $lang->about_email_address = '电子邮件地址除邮件认证外,在修改密码或找回密码时使用。'; - $lang->about_homepage = '请输入您的主页地址。'; - $lang->about_blog_url = '请输入博客地址。'; - $lang->about_birthday = '请输入您的出生年月日。'; - $lang->about_allow_mailing = '如不选择此项,以后不能接收站内发送的重要信息。'; - $lang->about_denied = '选择时不能使用此用户名。'; - $lang->about_is_admin = '选择时将具有最高管理权限。'; - $lang->about_member_description = '管理员对会员的备忘录。'; - $lang->about_group = '一个用户名可属多个用户组。'; - - $lang->about_column_type = '请选择要添加的注册表单格式。'; - $lang->about_column_name = '请输入在模板中可以使用的英文名称。(变数名)'; - $lang->about_column_title = '注册或修改/查看信息时要显示的标题。'; - $lang->about_default_value = '可以设置缺省值。'; - $lang->about_active = '必须选择此项后才可以正常启用。'; - $lang->about_form_description = '说明栏里输入的内容,注册时将会显示。'; - $lang->about_required = '注册时成为必填项目。'; - - $lang->about_enable_openid = '要想网站支持OpenID时请勾选此项。'; - $lang->about_enable_join = '选择此项后用户才可以注册。'; - $lang->about_enable_confirm = '为激活会员注册信息,将向会员输入的邮件地址发送注册认证邮件。'; - $lang->about_enable_ssl = '如服务器提供SSL协议服务,新会员注册/修改会员信息/登录等信息的传送将使用SSL(https)协议。'; - $lang->about_limit_day = '注册会员后的认证有效期限。'; - $lang->about_limit_date = '直到指定日期该用户不能登录。'; - $lang->about_after_login_url = '可以指定登录后的页面转向url(留空为当前页面)。'; - $lang->about_after_logout_url = '可以指定退出登录后的页面转向url(留空为当前页面)。'; - $lang->about_redirect_url = '请输入注册会员后的页面转向 url。(留空为返回前页)'; - $lang->about_agreement = '没有会员条款时不显示。'; - - $lang->about_image_name = '用户昵称可以用小图片来替代显示。'; - $lang->about_image_mark = '显示在用户昵称前的小图标。'; - $lang->about_group_image_mark = '用户名前显示用户组图标。'; - $lang->about_profile_image = '可以使用签名图片。'; - $lang->about_signature_max_height = '可以限制签名栏高度(0或留空为不限制)。'; - $lang->about_accept_agreement = '已阅读全部条款并同意。'; - - $lang->about_member_default = '将成为注册会员时的默认用户组。'; - - $lang->about_openid = '用OpenID注册时该网站只保存用户名和 邮件等基本信息,密码和认证处理是在提供OpenID服务的站点中得到解决。'; - $lang->about_openid_leave = '删除OpenID就等于永久删除站内用户的信息。
    被删除后的重新登录就等于新会员注册,因此对以前自己写的主题将失去相应权限。'; - $lang->about_find_member_account = '用户名/密码将发送到您注册时所输入的电子邮件当中。
    输入注册时的电子邮件地址后,请点击“查找用户名/密码”按钮。
    '; - - $lang->about_member = "可以添加/修改/删除会员及管理用户组或注册表单的会员管理模块。\n此模块不仅可以生成缺省用户组以外的其他用户组来管理会员,并且通过注册表单的管理获得除会员基本信息以外的扩展信息。"; - - $lang->about_resend_auth_mail = '没有收到认证邮件时,可以在此重新发送认证邮件。'; - - $lang->find_account_question = '비밀번호 찾기 질문/답변'; - $lang->find_account_answer = '비밀번호 찾기 답변'; - $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; - /* - $lang->find_account_question_items = array('' - ,'다른 이메일 주소는?' - ,'나의 보물 1호는?' - ,'나의 출신 초등학교는?' - ,'나의 출신 고향은?' - ,'나의 이상형은?' - ,'어머니 성함은?' - ,'아버지 성함은?' - ,'가장 좋아하는 색깔은?' - ,'가장 좋아하는 음식은?' - ); -*/ - $lang->temp_password = '임시 비밀번호'; - $lang->cmd_get_temp_password = '임시 비밀번호 발급'; - $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; - $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; - $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; - - $lang->change_password_date = '비밀번호 갱신주기'; - $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; - -?> +member = '会员'; + $lang->member_default_info = '基本资料'; + $lang->member_extend_info = '扩展信息'; + $lang->default_group_1 = "准会员"; + $lang->default_group_2 = "正会员"; + $lang->admin_group = "管理组"; + $lang->keep_signed = '自动登录'; + $lang->remember_user_id = '保存ID'; + $lang->already_logged = '您已经登录!'; + $lang->denied_user_id = '被禁止的用户名。'; + $lang->null_user_id = '请输入用户名。'; + $lang->null_password = '请输入密码。'; + $lang->invalid_authorization = '还没有认证!'; + $lang->invalid_user_id= '该用户名不存在,请检查您的输入是否有误!'; + $lang->invalid_password = '您的密码不正确!'; + $lang->invalid_new_password = '이전 비밀번호와 같습니다.'; + $lang->allow_mailing = '接收邮件'; + $lang->denied = '禁止使用'; + $lang->is_admin = '最高管理权限'; + $lang->group = '用户组'; + $lang->group_title = '用户组标题'; + $lang->group_srl = '用户组编号'; + $lang->signature = '签名'; + $lang->profile_image = '个性头像'; + $lang->profile_image_max_width = '宽度限制'; + $lang->profile_image_max_height = '高度限制'; + $lang->image_name = '昵称图片'; + $lang->image_name_max_width = '宽度限制'; + $lang->image_name_max_height = '高度限制'; + $lang->image_mark = '用户图标'; + $lang->image_mark_max_width = '宽度限制'; + $lang->image_mark_max_height = '高度限制'; + $lang->group_image_mark = '用户组图标'; + $lang->group_image_mark_max_width = '宽度限制'; + $lang->group_image_mark_max_height = '高度限制'; + $lang->group_image_mark_order = '用户组图标顺序'; + $lang->signature_max_height = '签名高度限制'; + $lang->enable_openid = '支持OpenID'; + $lang->enable_join = '允许会员注册'; + $lang->enable_confirm = '使用邮件认证'; + $lang->enable_ssl = '使用SSL功能'; + $lang->security_sign_in = '使用安全登录'; + $lang->limit_day = '认证限制'; + $lang->limit_date = '限制日期'; + $lang->after_login_url = '登录后页面转向'; + $lang->after_logout_url = '退出后页面转向'; + $lang->redirect_url = '注册会员后页面转向'; + $lang->agreement = '会员注册条款'; + $lang->accept_agreement = '同意条款'; + $lang->member_info = '会员信息'; + $lang->current_password = '当前密码'; + $lang->openid = 'OpenID'; + $lang->allow_message = '接收短消息'; + $lang->allow_message_type = array( + 'Y' => '全部接收', + 'F' => '拒收', + 'N' => '只允许好友', + ); + $lang->about_allow_message = '可以指定接收短消息方法及对象。'; + $lang->logged_users = '在线用户'; + + $lang->webmaster_name = '管理员名'; + $lang->webmaster_email = '管理员电子邮件'; + + $lang->about_keep_signed = '关闭浏览器后也将维持登录状态。\n\n使用自动登录功能,可解决每次访问都要输入用户名及密码的麻烦。\n\n为防止个人信息泄露,在网吧,学校等公共场所请务必要确认解除登录状态。'; + $lang->about_keep_warning = '关闭浏览器后也将维持登录状态。\n\n使用自动登录功能,可解决每次访问都要输入用户名及密码的麻烦。 为防止个人信息泄露,在网吧,学校等公共场所请务必要确认解除登录状态。'; + $lang->about_webmaster_name = '请输入认证所需的电子邮件地址或管理其他网站时要使用的网站管理员名称。(默认 : webmaster)'; + $lang->about_webmaster_email = '请输入网站管理员的电子邮件地址。'; + + $lang->search_target_list = array( + 'user_id' => '用户名', + 'user_name' => '姓名', + 'nick_name' => '昵称', + 'email_address' => '邮箱地址', + 'regdate' => '注册日期', + 'regdate_more' => '注册日期(以上)', + 'regdate_less' => '注册日期(以下)', + 'last_login' => '最后登录', + 'last_login_more' => '最后登录(以上)', + 'last_login_less' => '最后登录시(以下)', + 'extra_vars' => '扩展信息', + ); + + + $lang->cmd_login = '登录'; + $lang->cmd_logout = '退出'; + $lang->cmd_signup = '新会员注册'; + $lang->cmd_site_signup = '注册'; + $lang->cmd_modify_member_info = '编辑个人资料'; + $lang->cmd_modify_member_password = '修改密码'; + $lang->cmd_view_member_info = '个人资料'; + $lang->cmd_leave = '注销'; + $lang->cmd_find_member_account = '查找用户名/密码'; + $lang->cmd_resend_auth_mail = '重新发送认证邮件'; + + $lang->cmd_member_list = '会员目录'; + $lang->cmd_module_config = '常规选项'; + $lang->cmd_member_group = '用户组'; + $lang->cmd_send_mail = '发送邮件'; + $lang->cmd_manage_id = '禁止用户名'; + $lang->cmd_manage_form = '扩展注册表单'; + $lang->cmd_view_own_document = '会员话题'; + $lang->cmd_manage_member_info = '管理会员信息'; + $lang->cmd_trace_document = '主题追踪'; + $lang->cmd_trace_comment = '评论追踪'; + $lang->cmd_view_scrapped_document = '我的收藏'; + $lang->cmd_view_saved_document = '临时保存箱'; + $lang->cmd_send_email = '发送邮件'; + + $lang->msg_email_not_exists = "没有找到您输入的Email地址。"; + + $lang->msg_alreay_scrapped = '已收藏的主题!'; + + $lang->msg_cart_is_null = '请选择对象。'; + $lang->msg_checked_file_is_deleted = '已删除%d个附件。'; + + $lang->msg_find_account_title = '注册信息。'; + $lang->msg_find_account_info = '您要查找的注册信息如下。'; + $lang->msg_find_account_comment = '点击下面的链接您的注册密码将更新为上述的系统自动生成密码。
    请重新登录后把密码改为您所熟悉的密码。'; + $lang->msg_confirm_account_title = '会员注册'; + $lang->msg_confirm_account_info = '您的注册信息如下:'; + $lang->msg_confirm_account_comment = '请点击下面链接完成会员认证。'; + $lang->msg_auth_mail_sent = '已向%s发送了认证邮件。请确认!!'; + $lang->msg_confirm_mail_sent = '已向%s发送了认证邮件。请确认!!'; + $lang->msg_invalid_auth_key = '错误的注册信息请求。
    请重新查找用户名及密码, 或联系管理员。'; + $lang->msg_success_authed = '新的注册信息已得到认证。请用邮件中的新密码修改您要想使用的密码。'; + $lang->msg_success_confirmed = '注册信息已成功激活!'; + + $lang->msg_new_member = '会员注册'; + $lang->msg_update_member = '修改会员信息'; + $lang->msg_leave_member = '注销会员'; + $lang->msg_group_is_null = '没有用户组。'; + $lang->msg_not_delete_default = '不能删除基本项目'; + $lang->msg_not_exists_member = '不存在的用户'; + $lang->msg_cannot_delete_admin = '不能删除管理员 ID .解除管理后再删除'; + $lang->msg_exists_user_id = '重复的用户名 ,请重新输入用户名。'; + $lang->msg_exists_email_address = '重复的电子邮件地址,请重新输入电子邮件地址。'; + $lang->msg_exists_nick_name = '重复的昵称,请重新输入昵称。'; + $lang->msg_signup_disabled = '不能注册会员'; + $lang->msg_already_logged = '您是注册会员。'; + $lang->msg_not_logged = '您还没有登录。'; + $lang->msg_insert_group_name = '请输入组名称'; + $lang->msg_check_group = '请选择组'; + + $lang->msg_not_uploaded_profile_image = '不能登录签名图像!'; + $lang->msg_not_uploaded_image_name = '不能登录昵称图像!'; + $lang->msg_not_uploaded_image_mark = '不能登录用户图标!'; + $lang->msg_not_uploaded_group_image_mark = '可以指定用户组图标。'; + + $lang->msg_accept_agreement = '您必须同意条款。'; + + $lang->msg_user_denied = '您输入的用户名已禁止使用!'; + $lang->msg_user_not_confirmed = '您的注册信息还没有被激活,请确认您的电子邮箱。'; + $lang->msg_user_limited = '您输入的用户名%s以后才可以开始使用。'; + + $lang->about_user_id = '用户名长度必须由 3 ~20 字以内的英文+数字组成,且首个字母必须是英文字母。'; + $lang->about_password = '密码长度必须在6~20字以内。'; + $lang->about_user_name = '姓名必须是2~20字以内。'; + $lang->about_nick_name = '昵称必须是2~20字以内。'; + $lang->about_email_address = '电子邮件地址除邮件认证外,在修改密码或找回密码时使用。'; + $lang->about_homepage = '请输入您的主页地址。'; + $lang->about_blog_url = '请输入博客地址。'; + $lang->about_birthday = '请输入您的出生年月日。'; + $lang->about_allow_mailing = '如不选择此项,以后不能接收站内发送的重要信息。'; + $lang->about_denied = '选择时不能使用此用户名。'; + $lang->about_is_admin = '选择时将具有最高管理权限。'; + $lang->about_member_description = '管理员对会员的备忘录。'; + $lang->about_group = '一个用户名可属多个用户组。'; + + $lang->about_column_type = '请选择要添加的注册表单格式。'; + $lang->about_column_name = '请输入在模板中可以使用的英文名称。(变数名)'; + $lang->about_column_title = '注册或修改/查看信息时要显示的标题。'; + $lang->about_default_value = '可以设置缺省值。'; + $lang->about_active = '必须选择此项后才可以正常启用。'; + $lang->about_form_description = '说明栏里输入的内容,注册时将会显示。'; + $lang->about_required = '注册时成为必填项目。'; + + $lang->about_enable_openid = '要想网站支持OpenID时请勾选此项。'; + $lang->about_enable_join = '选择此项后用户才可以注册。'; + $lang->about_enable_confirm = '为激活会员注册信息,将向会员输入的邮件地址发送注册认证邮件。'; + $lang->about_enable_ssl = '如服务器提供SSL协议服务,新会员注册/修改会员信息/登录等信息的传送将使用SSL(https)协议。'; + $lang->about_limit_day = '注册会员后的认证有效期限。'; + $lang->about_limit_date = '直到指定日期该用户不能登录。'; + $lang->about_after_login_url = '可以指定登录后的页面转向url(留空为当前页面)。'; + $lang->about_after_logout_url = '可以指定退出登录后的页面转向url(留空为当前页面)。'; + $lang->about_redirect_url = '请输入注册会员后的页面转向 url。(留空为返回前页)'; + $lang->about_agreement = '没有会员条款时不显示。'; + + $lang->about_image_name = '用户昵称可以用小图片来替代显示。'; + $lang->about_image_mark = '显示在用户昵称前的小图标。'; + $lang->about_group_image_mark = '用户名前显示用户组图标。'; + $lang->about_profile_image = '可以使用签名图片。'; + $lang->about_signature_max_height = '可以限制签名栏高度(0或留空为不限制)。'; + $lang->about_accept_agreement = '已阅读全部条款并同意。'; + + $lang->about_member_default = '将成为注册会员时的默认用户组。'; + + $lang->about_openid = '用OpenID注册时该网站只保存用户名和 邮件等基本信息,密码和认证处理是在提供OpenID服务的站点中得到解决。'; + $lang->about_openid_leave = '删除OpenID就等于永久删除站内用户的信息。
    被删除后的重新登录就等于新会员注册,因此对以前自己写的主题将失去相应权限。'; + $lang->about_find_member_account = '用户名/密码将发送到您注册时所输入的电子邮件当中。
    输入注册时的电子邮件地址后,请点击“查找用户名/密码”按钮。
    '; + + $lang->about_member = "可以添加/修改/删除会员及管理用户组或注册表单的会员管理模块。\n此模块不仅可以生成缺省用户组以外的其他用户组来管理会员,并且通过注册表单的管理获得除会员基本信息以外的扩展信息。"; + + $lang->about_resend_auth_mail = '没有收到认证邮件时,可以在此重新发送认证邮件。'; + + $lang->find_account_question = '비밀번호 찾기 질문/답변'; + $lang->find_account_answer = '비밀번호 찾기 답변'; + $lang->about_find_account_question = '가입시 아이디와 이메일, 질문/답변으로 임시 비밀번호를 발급 받을 수 있습니다.'; + /* + $lang->find_account_question_items = array('' + ,'다른 이메일 주소는?' + ,'나의 보물 1호는?' + ,'나의 출신 초등학교는?' + ,'나의 출신 고향은?' + ,'나의 이상형은?' + ,'어머니 성함은?' + ,'아버지 성함은?' + ,'가장 좋아하는 색깔은?' + ,'가장 좋아하는 음식은?' + ); +*/ + $lang->temp_password = '임시 비밀번호'; + $lang->cmd_get_temp_password = '임시 비밀번호 발급'; + $lang->about_get_temp_password = '로그인 후 비밀번호 변경해 주세요.'; + $lang->msg_question_not_exists = '등록한 비밀번호 찾기 질문/답변이 없습니다.'; + $lang->msg_answer_not_matches = '비밀번호 찾기 질문/답변 또는 정보가 올바르지 않습니다.'; + + $lang->change_password_date = '비밀번호 갱신주기'; + $lang->about_change_password_date = '일정기간이 지나면 비밀번호 변경을 하도록 유도하는 기능입니다. (사용하지 않음 : 0 입력) '; + +?> diff --git a/modules/member/lang/zh-TW.lang.php b/modules/member/lang/zh-TW.lang.php index 93a8c4d0b..ea12845ba 100644 --- a/modules/member/lang/zh-TW.lang.php +++ b/modules/member/lang/zh-TW.lang.php @@ -1,240 +1,240 @@ -member = '會員'; - $lang->member_default_info = '基本資料'; - $lang->member_extend_info = '延伸資料'; - $lang->default_group_1 = "準會員"; - $lang->default_group_2 = "正會員"; - $lang->admin_group = "管理組"; - $lang->keep_signed = '自動登入'; - $lang->remember_user_id = '儲存 ID'; - $lang->already_logged = '您已經登入!'; - $lang->denied_user_id = '被禁止的帳號。'; - $lang->null_user_id = '請輸入帳號。'; - $lang->null_password = '請輸入密碼。'; - $lang->invalid_authorization = '還沒有認證!'; - $lang->invalid_user_id= '該帳號不存在,請檢查您的輸入是否有誤!'; - $lang->invalid_password = '您的密碼不正確!'; - $lang->invalid_new_password = '新密碼不能與舊密碼相同'; - $lang->allow_mailing = '接收郵件'; - $lang->denied = '禁止使用'; - $lang->is_admin = '最高管理權限'; - $lang->group = '群組'; - $lang->group_title = '群組標題'; - $lang->group_srl = '群組編號'; - $lang->signature = '簽名檔'; - $lang->profile_image = '個人圖片'; - $lang->profile_image_max_width = '寬度限制'; - $lang->profile_image_max_height = '高度限制'; - $lang->image_name = '暱稱圖片'; - $lang->image_name_max_width = '寬度限制'; - $lang->image_name_max_height = '高度限制'; - $lang->image_mark = '用戶圖示'; - $lang->image_mark_max_width = '寬度限制'; - $lang->image_mark_max_height = '高度限制'; - $lang->group_image_mark = '群組圖示'; - $lang->group_image_mark_max_width = '寬度限制'; - $lang->group_image_mark_max_height = '高度限制'; - $lang->group_image_mark_order = '群組圖示順序'; - $lang->signature_max_height = '簽名檔高度限制'; - $lang->enable_openid = '支援 OpenID'; - $lang->enable_join = '允許會員註冊'; - $lang->enable_confirm = '使用郵件認證'; - $lang->enable_ssl = '使用 SSL 功能'; - $lang->security_sign_in = '使用安全登入'; - $lang->limit_day = '認證限制'; - $lang->limit_date = '限制日期'; - $lang->after_login_url = '登入後頁面轉向'; - $lang->after_logout_url = '登出後頁面轉向'; - $lang->redirect_url = '會員註冊後頁面轉向'; - $lang->agreement = '會員使用條款'; - $lang->accept_agreement = '同意條款'; - $lang->member_info = '會員資料'; - $lang->current_password = '舊密碼'; - $lang->openid = 'OpenID'; - $lang->allow_message = '接收短訊息'; - $lang->allow_message_type = array( - 'Y' => '全部允許', - 'F' => '允許好友', - 'N' => '全部禁止', - ); - $lang->about_allow_message = '可選擇是否接收短訊息。'; - $lang->logged_users = '線上會員'; - - $lang->webmaster_name = '管理員名稱'; - $lang->webmaster_email = '管理員電子郵件'; - - $lang->about_keep_signed = '關閉瀏覽器後也將維持登入狀態。
    使用此功能,可解決每次訪問都要輸入帳號及密碼的麻煩。
    為防止個人資料洩露,在網咖,學校等公共場所,請務必要確認解除登入狀態。'; - $lang->about_keep_warning = '關閉瀏覽器後也將維持登入狀態。
    使用此功能,可解決每次訪問都要輸入帳號及密碼的麻煩。
    為防止個人資料洩露,在網咖,學校等公共場所,請務必要確認解除登入狀態。'; - $lang->about_webmaster_name = '請輸入認證所需的電子郵件地址或管理其他網站時要使用的網站管理員名稱。(預設 : webmaster)'; - $lang->about_webmaster_email = '請輸入網站管理員的電子郵件地址。'; - - $lang->search_target_list = array( - 'user_id' => '帳號', - 'user_name' => '姓名', - 'nick_name' => '暱稱', - 'email_address' => '電子郵件', - 'regdate' => '註冊日期', - 'regdate_more' => '註冊日期(以上)', - 'regdate_less' => '註冊日期(以下)', - 'last_login' => '最近登入', - 'last_login_more' => '最近登入(以上)', - 'last_login_less' => '最近登入(以下)', - 'extra_vars' => '延伸變數', - ); - - $lang->cmd_login = '登入'; - $lang->cmd_logout = '登出'; - $lang->cmd_signup = '會員註冊'; - $lang->cmd_site_signup = '加入'; - $lang->cmd_modify_member_info = '修改會員資料'; - $lang->cmd_modify_member_password = '修改密碼'; - $lang->cmd_view_member_info = '檢視會員資料'; - $lang->cmd_leave = '退出'; - $lang->cmd_find_member_account = '查詢帳號/密碼'; - $lang->cmd_resend_auth_mail = '重寄認證郵件'; - - $lang->cmd_member_list = '會員列表'; - $lang->cmd_module_config = '基本設置'; - $lang->cmd_member_group = '群組管理'; - $lang->cmd_send_mail = '發送郵件'; - $lang->cmd_manage_id = '禁止帳號管理'; - $lang->cmd_manage_form = '註冊表單管理'; - $lang->cmd_view_own_document = '檢視發表主題'; - $lang->cmd_manage_member_info = '管理會員資料'; - $lang->cmd_trace_document = '主題追蹤'; - $lang->cmd_trace_comment = '評論追蹤'; - $lang->cmd_view_scrapped_document = '檢視收藏'; - $lang->cmd_view_saved_document = '檢視臨時儲存箱'; - $lang->cmd_send_email = '發送郵件'; - - $lang->msg_email_not_exists = '找不到您輸入的郵件地址。'; - - $lang->msg_alreay_scrapped = '已收藏的主題!'; - - $lang->msg_cart_is_null = '請選擇對象。'; - $lang->msg_checked_file_is_deleted = '已刪除%d個附檔。'; - - $lang->msg_find_account_title = '註冊資料。'; - $lang->msg_find_account_info = '您要尋找的註冊資料如下。'; - $lang->msg_find_account_comment = '按底下的連結,您的註冊密碼將更新為上述系統自動建立的密碼。
    請重新登入,將密碼更改為您想要的密碼。'; - $lang->msg_confirm_account_title = '會員註冊'; - $lang->msg_confirm_account_info = '您的註冊資料如下:'; - $lang->msg_confirm_account_comment = '請按下面連結完成會員認證。'; - $lang->msg_auth_mail_sent = '已向%s發送了認證郵件。請確認!!'; - $lang->msg_confirm_mail_sent = '已向%s發送了認證郵件。請確認!!'; - $lang->msg_invalid_auth_key = '錯誤的註冊資料請求。
    請重新尋找帳號及密碼,或聯繫管理員。'; - $lang->msg_success_authed = '新註冊的資料已得到認證。請用郵件中的新密碼修改成您要想使用的密碼。'; - $lang->msg_success_confirmed = '註冊資料已成功確認!'; - - $lang->msg_new_member = '會員註冊'; - $lang->msg_update_member = '修改會員資料'; - $lang->msg_leave_member = '會員退出'; - $lang->msg_group_is_null = '無群組。'; - $lang->msg_not_delete_default = '無法刪除基本項目'; - $lang->msg_not_exists_member = '不存在的帳號'; - $lang->msg_cannot_delete_admin = '無法解除管理員帳號,請解除管理後再刪除'; - $lang->msg_exists_user_id = '重複的帳號,請重新輸入。'; - $lang->msg_exists_email_address = '重複的電子郵件地址,請重新輸入電子郵件地址。'; - $lang->msg_exists_nick_name = '重複的暱稱,請重新輸入。'; - $lang->msg_signup_disabled = '無法註冊會員'; - $lang->msg_already_logged = '您是註冊會員。'; - $lang->msg_not_logged = '您還沒登入。'; - $lang->msg_insert_group_name = '請輸入群組名稱'; - $lang->msg_check_group = '請選擇群組'; - - $lang->msg_not_uploaded_profile_image = '無法登錄個人圖片!'; - $lang->msg_not_uploaded_image_name = '無法登錄暱稱圖片!'; - $lang->msg_not_uploaded_image_mark = '無法登錄用戶圖示!'; - $lang->msg_not_uploaded_group_image_mark = '無法登錄群組圖示!'; - - $lang->msg_accept_agreement = '您必須同意條款。'; - - $lang->msg_user_denied = '您輸入的帳號已禁止使用!'; - $lang->msg_user_not_confirmed = '您的註冊資料還沒有被確認,請確認您的電子郵箱。'; - $lang->msg_user_limited = '您輸入的帳號%s以後才可以開始使用。'; - - $lang->about_user_id = '帳號必須由 3~20 字以內的英文+數字組成,開頭必須是英文。'; - $lang->about_password = '密碼必須在 6~20 字以內。'; - $lang->about_user_name = '姓名必須是 2~20 字以內。'; - $lang->about_nick_name = '暱稱必須是 2~20 字以內。'; - $lang->about_email_address = '電子郵件地址除郵件認證外,當修改密碼或忘記密碼時也可以使用。'; - $lang->about_homepage = '請輸入您的網址。'; - $lang->about_blog_url = '請輸入部落格網址。'; - $lang->about_birthday = '請輸入您的出生年月日。'; - $lang->about_allow_mailing = '不選擇此項,以後無法接收站內發送的重要資料。'; - $lang->about_denied = '選擇時不能使用此帳號。'; - $lang->about_is_admin = '選擇時將具有最高管理權限。'; - $lang->about_member_description = '管理員對會員的註記。'; - $lang->about_group = '一個帳號可擁有多個群組。'; - - $lang->about_column_type = '請選擇要新增的註冊表單格式。'; - $lang->about_column_name = '請輸入在樣板中可以使用的英文名稱。(變數名稱)'; - $lang->about_column_title = '註冊或修改/檢視資料時要顯示的標題。'; - $lang->about_default_value = '可以設置預設值。'; - $lang->about_active = '必須選擇此項後才可以正常啟用。'; - $lang->about_form_description = '說明欄裡輸入的內容,在註冊時會顯示。'; - $lang->about_required = '註冊時成為必填項目。'; - - $lang->about_enable_openid = '想要網站支援 OpenID 時,請勾選此項。'; - $lang->about_enable_join = '選擇此項後,用戶才可以註冊。'; - $lang->about_enable_confirm = '為確認會員註冊資料,會向會員輸入的郵件地址發送註冊認證郵件。'; - $lang->about_enable_ssl = '如主機提供 SSL 認證服務,新會員註冊/修改會員資料/登入等資料的傳送將使用 SSL(https) 認證。'; - $lang->about_limit_day = '註冊會員後的認證有效期限。'; - $lang->about_limit_date = '直到指定日期,否則該帳號都無法登入。'; - $lang->about_after_login_url = '可以指定登入後的頁面轉向網址(留空為目前頁面)。'; - $lang->about_after_logout_url = '可以指定登出後的頁面轉向網址(留空為目前頁面)。'; - $lang->about_redirect_url = '請輸入會員註冊後的頁面轉向網址。(留空為返回前頁)'; - $lang->about_agreement = '沒有會員條款時不會顯示。'; - - $lang->about_image_name = '用戶暱稱可以用圖片替代。'; - $lang->about_image_mark = '顯示在用戶暱稱前的圖示。'; - $lang->about_group_image_mark = '顯示在用戶群組前的圖示。'; - $lang->about_profile_image = '可以使用個人圖片。'; - $lang->about_signature_max_height = '可以限制簽名檔高度(零或留空為不限制)。'; - $lang->about_accept_agreement = '已閱讀全部條款並同意。'; - - $lang->about_member_default = '將成為註冊會員時的預設群組。'; - - $lang->about_openid = '用 OpenID 註冊時,該網站只儲存帳號和郵件等基本資料,密碼和認證處理是在提供 OpenID 服務的網站中得到解決。'; - $lang->about_openid_leave = '刪除 OpenID 就等於永久刪除站內會員的資料。
    被刪除後,再重新登錄就等於新會員註冊,因此對以前自己寫的主題將失去其權限。'; - $lang->about_find_member_account = '帳號/密碼將發送到您註冊時,所輸入的電子郵件當中。
    輸入註冊時的電子郵件地址後,請按「查詢帳號/密碼」按鈕。
    '; - - $lang->about_member = "可以新增/修改/刪除會員及管理群組或註冊表單的會員管理模組。\n此模組不僅可以建立預設群組以外的其他群組來管理會員,並且通過註冊表單的管理獲得會員基本資料以外的延伸資料。"; - $lang->about_ssl_port = '請輸入想要使用 SSL 預設埠口以外的埠口。'; - $lang->add_openid = '新增 OpenID'; - - $lang->about_resend_auth_mail = '如果沒有收到認證郵件可以再重寄一次。'; - $lang->no_article = '主題不存在'; - - $lang->find_account_question = '密碼提示問答'; - $lang->find_account_answer = '비밀번호 찾기 답변'; - - $lang->about_find_account_question = '可透過帳號、電子郵件和設定提示問答來獲得臨時密碼。'; - $lang->find_account_question_items = array('' - ,'其他電子郵件?' - ,'我最愛的是?' - ,'我讀的國小是?' - ,'我的出生地?' - ,'我的理想?' - ,'母親的姓名?' - ,'父親的姓名?' - ,'最喜歡的顏色?' - ,'最愛的食物是?' - ); - - $lang->temp_password = '臨時密碼'; - $lang->cmd_get_temp_password = '取得臨時密碼'; - $lang->about_get_temp_password = '請再登入後變更密碼。'; - $lang->msg_question_not_exists = '尚未輸入提示問答'; - $lang->msg_answer_not_matches = '答案不正確'; - - $lang->change_password_date = '密碼更新'; - $lang->about_change_password_date = '可設定密碼更新週期,將會定期通知更換密碼。 (設為零則不使用)'; - -?> +member = '會員'; + $lang->member_default_info = '基本資料'; + $lang->member_extend_info = '延伸資料'; + $lang->default_group_1 = "準會員"; + $lang->default_group_2 = "正會員"; + $lang->admin_group = "管理組"; + $lang->keep_signed = '自動登入'; + $lang->remember_user_id = '儲存 ID'; + $lang->already_logged = '您已經登入!'; + $lang->denied_user_id = '被禁止的帳號。'; + $lang->null_user_id = '請輸入帳號。'; + $lang->null_password = '請輸入密碼。'; + $lang->invalid_authorization = '還沒有認證!'; + $lang->invalid_user_id= '該帳號不存在,請檢查您的輸入是否有誤!'; + $lang->invalid_password = '您的密碼不正確!'; + $lang->invalid_new_password = '新密碼不能與舊密碼相同'; + $lang->allow_mailing = '接收郵件'; + $lang->denied = '禁止使用'; + $lang->is_admin = '最高管理權限'; + $lang->group = '群組'; + $lang->group_title = '群組標題'; + $lang->group_srl = '群組編號'; + $lang->signature = '簽名檔'; + $lang->profile_image = '個人圖片'; + $lang->profile_image_max_width = '寬度限制'; + $lang->profile_image_max_height = '高度限制'; + $lang->image_name = '暱稱圖片'; + $lang->image_name_max_width = '寬度限制'; + $lang->image_name_max_height = '高度限制'; + $lang->image_mark = '用戶圖示'; + $lang->image_mark_max_width = '寬度限制'; + $lang->image_mark_max_height = '高度限制'; + $lang->group_image_mark = '群組圖示'; + $lang->group_image_mark_max_width = '寬度限制'; + $lang->group_image_mark_max_height = '高度限制'; + $lang->group_image_mark_order = '群組圖示順序'; + $lang->signature_max_height = '簽名檔高度限制'; + $lang->enable_openid = '支援 OpenID'; + $lang->enable_join = '允許會員註冊'; + $lang->enable_confirm = '使用郵件認證'; + $lang->enable_ssl = '使用 SSL 功能'; + $lang->security_sign_in = '使用安全登入'; + $lang->limit_day = '認證限制'; + $lang->limit_date = '限制日期'; + $lang->after_login_url = '登入後頁面轉向'; + $lang->after_logout_url = '登出後頁面轉向'; + $lang->redirect_url = '會員註冊後頁面轉向'; + $lang->agreement = '會員使用條款'; + $lang->accept_agreement = '同意條款'; + $lang->member_info = '會員資料'; + $lang->current_password = '舊密碼'; + $lang->openid = 'OpenID'; + $lang->allow_message = '接收短訊息'; + $lang->allow_message_type = array( + 'Y' => '全部允許', + 'F' => '允許好友', + 'N' => '全部禁止', + ); + $lang->about_allow_message = '可選擇是否接收短訊息。'; + $lang->logged_users = '線上會員'; + + $lang->webmaster_name = '管理員名稱'; + $lang->webmaster_email = '管理員電子郵件'; + + $lang->about_keep_signed = '關閉瀏覽器後也將維持登入狀態。
    使用此功能,可解決每次訪問都要輸入帳號及密碼的麻煩。
    為防止個人資料洩露,在網咖,學校等公共場所,請務必要確認解除登入狀態。'; + $lang->about_keep_warning = '關閉瀏覽器後也將維持登入狀態。
    使用此功能,可解決每次訪問都要輸入帳號及密碼的麻煩。
    為防止個人資料洩露,在網咖,學校等公共場所,請務必要確認解除登入狀態。'; + $lang->about_webmaster_name = '請輸入認證所需的電子郵件地址或管理其他網站時要使用的網站管理員名稱。(預設 : webmaster)'; + $lang->about_webmaster_email = '請輸入網站管理員的電子郵件地址。'; + + $lang->search_target_list = array( + 'user_id' => '帳號', + 'user_name' => '姓名', + 'nick_name' => '暱稱', + 'email_address' => '電子郵件', + 'regdate' => '註冊日期', + 'regdate_more' => '註冊日期(以上)', + 'regdate_less' => '註冊日期(以下)', + 'last_login' => '最近登入', + 'last_login_more' => '最近登入(以上)', + 'last_login_less' => '最近登入(以下)', + 'extra_vars' => '延伸變數', + ); + + $lang->cmd_login = '登入'; + $lang->cmd_logout = '登出'; + $lang->cmd_signup = '會員註冊'; + $lang->cmd_site_signup = '加入'; + $lang->cmd_modify_member_info = '修改會員資料'; + $lang->cmd_modify_member_password = '修改密碼'; + $lang->cmd_view_member_info = '檢視會員資料'; + $lang->cmd_leave = '退出'; + $lang->cmd_find_member_account = '查詢帳號/密碼'; + $lang->cmd_resend_auth_mail = '重寄認證郵件'; + + $lang->cmd_member_list = '會員列表'; + $lang->cmd_module_config = '基本設置'; + $lang->cmd_member_group = '群組管理'; + $lang->cmd_send_mail = '發送郵件'; + $lang->cmd_manage_id = '禁止帳號管理'; + $lang->cmd_manage_form = '註冊表單管理'; + $lang->cmd_view_own_document = '檢視發表主題'; + $lang->cmd_manage_member_info = '管理會員資料'; + $lang->cmd_trace_document = '主題追蹤'; + $lang->cmd_trace_comment = '評論追蹤'; + $lang->cmd_view_scrapped_document = '檢視收藏'; + $lang->cmd_view_saved_document = '檢視臨時儲存箱'; + $lang->cmd_send_email = '發送郵件'; + + $lang->msg_email_not_exists = '找不到您輸入的郵件地址。'; + + $lang->msg_alreay_scrapped = '已收藏的主題!'; + + $lang->msg_cart_is_null = '請選擇對象。'; + $lang->msg_checked_file_is_deleted = '已刪除%d個附檔。'; + + $lang->msg_find_account_title = '註冊資料。'; + $lang->msg_find_account_info = '您要尋找的註冊資料如下。'; + $lang->msg_find_account_comment = '按底下的連結,您的註冊密碼將更新為上述系統自動建立的密碼。
    請重新登入,將密碼更改為您想要的密碼。'; + $lang->msg_confirm_account_title = '會員註冊'; + $lang->msg_confirm_account_info = '您的註冊資料如下:'; + $lang->msg_confirm_account_comment = '請按下面連結完成會員認證。'; + $lang->msg_auth_mail_sent = '已向%s發送了認證郵件。請確認!!'; + $lang->msg_confirm_mail_sent = '已向%s發送了認證郵件。請確認!!'; + $lang->msg_invalid_auth_key = '錯誤的註冊資料請求。
    請重新尋找帳號及密碼,或聯繫管理員。'; + $lang->msg_success_authed = '新註冊的資料已得到認證。請用郵件中的新密碼修改成您要想使用的密碼。'; + $lang->msg_success_confirmed = '註冊資料已成功確認!'; + + $lang->msg_new_member = '會員註冊'; + $lang->msg_update_member = '修改會員資料'; + $lang->msg_leave_member = '會員退出'; + $lang->msg_group_is_null = '無群組。'; + $lang->msg_not_delete_default = '無法刪除基本項目'; + $lang->msg_not_exists_member = '不存在的帳號'; + $lang->msg_cannot_delete_admin = '無法解除管理員帳號,請解除管理後再刪除'; + $lang->msg_exists_user_id = '重複的帳號,請重新輸入。'; + $lang->msg_exists_email_address = '重複的電子郵件地址,請重新輸入電子郵件地址。'; + $lang->msg_exists_nick_name = '重複的暱稱,請重新輸入。'; + $lang->msg_signup_disabled = '無法註冊會員'; + $lang->msg_already_logged = '您是註冊會員。'; + $lang->msg_not_logged = '您還沒登入。'; + $lang->msg_insert_group_name = '請輸入群組名稱'; + $lang->msg_check_group = '請選擇群組'; + + $lang->msg_not_uploaded_profile_image = '無法登錄個人圖片!'; + $lang->msg_not_uploaded_image_name = '無法登錄暱稱圖片!'; + $lang->msg_not_uploaded_image_mark = '無法登錄用戶圖示!'; + $lang->msg_not_uploaded_group_image_mark = '無法登錄群組圖示!'; + + $lang->msg_accept_agreement = '您必須同意條款。'; + + $lang->msg_user_denied = '您輸入的帳號已禁止使用!'; + $lang->msg_user_not_confirmed = '您的註冊資料還沒有被確認,請確認您的電子郵箱。'; + $lang->msg_user_limited = '您輸入的帳號%s以後才可以開始使用。'; + + $lang->about_user_id = '帳號必須由 3~20 字以內的英文+數字組成,開頭必須是英文。'; + $lang->about_password = '密碼必須在 6~20 字以內。'; + $lang->about_user_name = '姓名必須是 2~20 字以內。'; + $lang->about_nick_name = '暱稱必須是 2~20 字以內。'; + $lang->about_email_address = '電子郵件地址除郵件認證外,當修改密碼或忘記密碼時也可以使用。'; + $lang->about_homepage = '請輸入您的網址。'; + $lang->about_blog_url = '請輸入部落格網址。'; + $lang->about_birthday = '請輸入您的出生年月日。'; + $lang->about_allow_mailing = '不選擇此項,以後無法接收站內發送的重要資料。'; + $lang->about_denied = '選擇時不能使用此帳號。'; + $lang->about_is_admin = '選擇時將具有最高管理權限。'; + $lang->about_member_description = '管理員對會員的註記。'; + $lang->about_group = '一個帳號可擁有多個群組。'; + + $lang->about_column_type = '請選擇要新增的註冊表單格式。'; + $lang->about_column_name = '請輸入在樣板中可以使用的英文名稱。(變數名稱)'; + $lang->about_column_title = '註冊或修改/檢視資料時要顯示的標題。'; + $lang->about_default_value = '可以設置預設值。'; + $lang->about_active = '必須選擇此項後才可以正常啟用。'; + $lang->about_form_description = '說明欄裡輸入的內容,在註冊時會顯示。'; + $lang->about_required = '註冊時成為必填項目。'; + + $lang->about_enable_openid = '想要網站支援 OpenID 時,請勾選此項。'; + $lang->about_enable_join = '選擇此項後,用戶才可以註冊。'; + $lang->about_enable_confirm = '為確認會員註冊資料,會向會員輸入的郵件地址發送註冊認證郵件。'; + $lang->about_enable_ssl = '如主機提供 SSL 認證服務,新會員註冊/修改會員資料/登入等資料的傳送將使用 SSL(https) 認證。'; + $lang->about_limit_day = '註冊會員後的認證有效期限。'; + $lang->about_limit_date = '直到指定日期,否則該帳號都無法登入。'; + $lang->about_after_login_url = '可以指定登入後的頁面轉向網址(留空為目前頁面)。'; + $lang->about_after_logout_url = '可以指定登出後的頁面轉向網址(留空為目前頁面)。'; + $lang->about_redirect_url = '請輸入會員註冊後的頁面轉向網址。(留空為返回前頁)'; + $lang->about_agreement = '沒有會員條款時不會顯示。'; + + $lang->about_image_name = '用戶暱稱可以用圖片替代。'; + $lang->about_image_mark = '顯示在用戶暱稱前的圖示。'; + $lang->about_group_image_mark = '顯示在用戶群組前的圖示。'; + $lang->about_profile_image = '可以使用個人圖片。'; + $lang->about_signature_max_height = '可以限制簽名檔高度(零或留空為不限制)。'; + $lang->about_accept_agreement = '已閱讀全部條款並同意。'; + + $lang->about_member_default = '將成為註冊會員時的預設群組。'; + + $lang->about_openid = '用 OpenID 註冊時,該網站只儲存帳號和郵件等基本資料,密碼和認證處理是在提供 OpenID 服務的網站中得到解決。'; + $lang->about_openid_leave = '刪除 OpenID 就等於永久刪除站內會員的資料。
    被刪除後,再重新登錄就等於新會員註冊,因此對以前自己寫的主題將失去其權限。'; + $lang->about_find_member_account = '帳號/密碼將發送到您註冊時,所輸入的電子郵件當中。
    輸入註冊時的電子郵件地址後,請按「查詢帳號/密碼」按鈕。
    '; + + $lang->about_member = "可以新增/修改/刪除會員及管理群組或註冊表單的會員管理模組。\n此模組不僅可以建立預設群組以外的其他群組來管理會員,並且通過註冊表單的管理獲得會員基本資料以外的延伸資料。"; + $lang->about_ssl_port = '請輸入想要使用 SSL 預設埠口以外的埠口。'; + $lang->add_openid = '新增 OpenID'; + + $lang->about_resend_auth_mail = '如果沒有收到認證郵件可以再重寄一次。'; + $lang->no_article = '主題不存在'; + + $lang->find_account_question = '密碼提示問答'; + $lang->find_account_answer = '비밀번호 찾기 답변'; + + $lang->about_find_account_question = '可透過帳號、電子郵件和設定提示問答來獲得臨時密碼。'; + $lang->find_account_question_items = array('' + ,'其他電子郵件?' + ,'我最愛的是?' + ,'我讀的國小是?' + ,'我的出生地?' + ,'我的理想?' + ,'母親的姓名?' + ,'父親的姓名?' + ,'最喜歡的顏色?' + ,'最愛的食物是?' + ); + + $lang->temp_password = '臨時密碼'; + $lang->cmd_get_temp_password = '取得臨時密碼'; + $lang->about_get_temp_password = '請再登入後變更密碼。'; + $lang->msg_question_not_exists = '尚未輸入提示問答'; + $lang->msg_answer_not_matches = '答案不正確'; + + $lang->change_password_date = '密碼更新'; + $lang->about_change_password_date = '可設定密碼更新週期,將會定期通知更換密碼。 (設為零則不使用)'; + +?> diff --git a/modules/member/member.admin.controller.php b/modules/member/member.admin.controller.php index 69b1773a7..caab036e7 100644 --- a/modules/member/member.admin.controller.php +++ b/modules/member/member.admin.controller.php @@ -1,539 +1,539 @@ -module); - unset($all_args->act); - if(!isset($args->limit_date)) $args->limit_date = ""; - - // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력 - $extra_vars = delObjectVars($all_args, $args); - $args->extra_vars = serialize($extra_vars); - - // member_srl이 넘어오면 원 회원이 있는지 확인 - if($args->member_srl) { - // 멤버 모델 객체 생성 - $oMemberModel = &getModel('member'); - - // 회원 정보 구하기 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); - - // 만약 원래 회원이 없으면 새로 입력하기 위한 처리 - if($member_info->member_srl != $args->member_srl) unset($args->member_srl); - } - - $oMemberController = &getController('member'); - - // member_srl의 값에 따라 insert/update - if(!$args->member_srl) { - $output = $oMemberController->insertMember($args); - $msg_code = 'success_registed'; - } else { - $output = $oMemberController->updateMember($args); - $msg_code = 'success_updated'; - } - - if(!$output->toBool()) return $output; - - // 서명 저장 - $signature = Context::get('signature'); - $oMemberController->putSignature($args->member_srl, $signature); - - // 결과 리턴 - $this->add('member_srl', $args->member_srl); - $this->setMessage($msg_code); - } - - /** - * @brief 사용자 삭제 (관리자용) - **/ - function procMemberAdminDelete() { - // 일단 입력된 값들을 모두 받아서 db 입력항목과 그외 것으로 분리 - $member_srl = Context::get('member_srl'); - - $oMemberController = &getController('member'); - $output = $oMemberController->deleteMember($member_srl); - if(!$output->toBool()) return $output; - - $this->add('page',Context::get('page')); - $this->setMessage("success_deleted"); - } - - /** - * @brief 회원 관리용 기본 정보의 추가 - **/ - function procMemberAdminInsertConfig() { - // 기본 정보를 받음 - $args = Context::gets( - 'webmaster_name', 'webmaster_email', - 'skin', 'colorset', - 'editor_skin', 'editor_colorset', - 'enable_openid', 'enable_join', 'enable_confirm', 'limit_day', - 'after_login_url', 'after_logout_url', 'redirect_url', 'agreement', - 'profile_image', 'profile_image_max_width', 'profile_image_max_height', - 'image_name', 'image_name_max_width', 'image_name_max_height', - 'image_mark', 'image_mark_max_width', 'image_mark_max_height', - 'group_image_mark', 'group_image_mark_max_width', 'group_image_mark_max_height', - 'signature','signature_max_height','change_password_date' - ); - - if(!$args->skin) $args->skin = "default"; - if(!$args->colorset) $args->colorset = "white"; - if(!$args->editor_skin) $args->editor_skin= "xpresseditor"; - if(!$args->editor_colorset) $args->editor_colorset = "white"; - if($args->enable_join!='Y') $args->enable_join = 'N'; - if($args->enable_openid!='Y') $args->enable_openid= 'N'; - if($args->profile_image !='Y') $args->profile_image = 'N'; - if($args->image_name!='Y') $args->image_name = 'N'; - if($args->image_mark!='Y') $args->image_mark = 'N'; - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; - if($args->signature!='Y') $args->signature = 'N'; - if(!trim(strip_tags($args->agreement))) $args->agreement = null; - $args->limit_day = (int)$args->limit_day; - if(!$args->change_password_date) $args->change_password_date = 0; - - $oMemberController = &getController('member'); - $output = $oMemberController->setMemberConfig($args); - return $output; - } - - /** - * @brief 사용자 그룹 추가 - **/ - function procMemberAdminInsertGroup() { - $args = Context::gets('title','description','is_default','image_mark'); - $output = $this->insertGroup($args); - if(!$output->toBool()) return $output; - - $this->add('group_srl',''); - $this->add('page',Context::get('page')); - $this->setMessage('success_registed'); - } - - /** - * @brief 사용자 그룹 정보 수정 - **/ - function procMemberAdminUpdateGroup() { - $group_srl = Context::get('group_srl'); - $mode = Context::get('mode'); - - switch($mode) { - case 'delete' : - $output = $this->deleteGroup($group_srl); - if(!$output->toBool()) return $output; - $msg_code = 'success_deleted'; - break; - case 'update' : - $args = Context::gets('group_srl','title','description','is_default','image_mark'); - $args->site_srl = 0; - $output = $this->updateGroup($args); - if(!$output->toBool()) return $output; - $msg_code = 'success_updated'; - break; - } - - $this->add('group_srl',''); - $this->add('page',Context::get('page')); - $this->setMessage($msg_code); - } - - /** - * @brief 가입 항목 추가 - **/ - function procMemberAdminInsertJoinForm() { - $args->member_join_form_srl = Context::get('member_join_form_srl'); - - $args->column_type = Context::get('column_type'); - $args->column_name = strtolower(Context::get('column_name')); - $args->column_title = Context::get('column_title'); - $args->default_value = explode('|@|', Context::get('default_value')); - $args->is_active = Context::get('is_active'); - if(!in_array(strtoupper($args->is_active), array('Y','N'))) $args->is_active = 'N'; - $args->required = Context::get('required'); - if(!in_array(strtoupper($args->required), array('Y','N'))) $args->required = 'N'; - $args->description = Context::get('description'); - - // 기본값의 정리 - 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이 있으면 수정, 없으면 추가 - if(!$args->member_join_form_srl){ - $args->list_order = getNextSequence(); - $output = executeQuery('member.insertJoinForm', $args); - }else{ - $output = executeQuery('member.updateJoinForm', $args); - } - - if(!$output->toBool()) return $output; - - $this->add('act','dispJoinForm'); - $this->setMessage('success_registed'); - } - - /** - * @brief 가입 항목의 상/하 이동 및 내용 수정 - **/ - function procMemberAdminUpdateJoinForm() { - $member_join_form_srl = Context::get('member_join_form_srl'); - $mode = Context::get('mode'); - - switch($mode) { - case 'up' : - $output = $this->moveJoinFormUp($member_join_form_srl); - $msg_code = 'success_moved'; - break; - case 'down' : - $output = $this->moveJoinFormDown($member_join_form_srl); - $msg_code = 'success_moved'; - break; - case 'delete' : - $output = $this->deleteJoinForm($member_join_form_srl); - $msg_code = 'success_deleted'; - break; - case 'update' : - break; - } - if(!$output->toBool()) return $output; - - $this->setMessage($msg_code); - } - - /** - * @brief 선택된 회원들을 일괄 삭제 - */ - function procMemberAdminDeleteMembers() { - $target_member_srls = Context::get('target_member_srls'); - if(!$target_member_srls) return new Object(-1, 'msg_invalid_request'); - $member_srls = explode(',', $target_member_srls); - $oMemberController = &getController('member'); - - foreach($member_srls as $member) { - $output = $oMemberController->deleteMember($member); - if(!$output->toBool()) { - $this->setMessage('failed_deleted'); - return $output; - } - } - - $this->setMessage('success_deleted'); - } - - /** - * @brief 선택된 회원들의 그룹을 일괄 변경 - **/ - function procMemberAdminUpdateMembersGroup() { - $member_srl = Context::get('member_srl'); - if(!$member_srl) return new Object(-1,'msg_invalid_request'); - $member_srls = explode(',',$member_srl); - - $group_srl = Context::get('group_srls'); - $group_srls = explode('|@|', $group_srl); - if(!$group_srl) return new Object(-1,'msg_check_group'); - - $oDB = &DB::getInstance(); - $oDB->begin(); - - // 선택된 회원들의 그룹을 삭제 - $args->member_srl = $member_srl; - $output = executeQuery('member.deleteMembersGroup', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 선택된 그룹으로 추가 - $group_count = count($group_srls); - $member_count = count($member_srls); - for($j=0;$j<$group_count;$j++) { - $group_srl = (int)trim($group_srls[$j]); - if(!$group_srl) continue; - for($i=0;$i<$member_count;$i++) { - $member_srl = (int)trim($member_srls[$i]); - if(!$member_srl) continue; - - $args = null; - $args->member_srl = $member_srl; - $args->group_srl = $group_srl; - - $output = executeQuery('member.addMemberToGroup', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - } - } - $oDB->commit(); - - $this->setMessage('success_updated'); - } - - /** - * @brief 금지 아이디 추가 - **/ - function procMemberAdminInsertDeniedID() { - $user_id = Context::get('user_id'); - $description = Context::get('description'); - - $output = $this->insertDeniedID($user_id, $description); - if(!$output->toBool()) return $output; - - $this->add('group_srl',''); - $this->add('page',Context::get('page')); - $this->setMessage('success_registed'); - } - - /** - * @brief 금지 아이디 업데이트 - **/ - function procMemberAdminUpdateDeniedID() { - $user_id = Context::get('user_id'); - $mode = Context::get('mode'); - - switch($mode) { - case 'delete' : - $output = $this->deleteDeniedID($user_id); - if(!$output->toBool()) return $output; - $msg_code = 'success_deleted'; - break; - } - - $this->add('page',Context::get('page')); - $this->setMessage($msg_code); - } - - /** - * @brief 관리자를 추가한다 - **/ - function insertAdmin($args) { - // 관리자임을 설정 - $args->is_admin = 'Y'; - - // 관리자 그룹을 구해와서 설정 - $oMemberModel = &getModel('member'); - $admin_group = $oMemberModel->getAdminGroup(); - $args->group_srl_list = $admin_group->group_srl; - - $oMemberController = &getController('member'); - return $oMemberController->insertMember($args); - } - - /** - * @brief 회원의 그룹값을 변경 - **/ - function changeGroup($source_group_srl, $target_group_srl) { - $args->source_group_srl = $source_group_srl; - $args->target_group_srl = $target_group_srl; - - return executeQuery('member.changeGroup', $args); - } - - /** - * @brief 그룹 등록 - **/ - function insertGroup($args) { - if(!$args->site_srl) $args->site_srl = 0; - // is_default값을 체크, Y일 경우 일단 모든 is_default에 대해서 N 처리 - if($args->is_default!='Y') { - $args->is_default = 'N'; - } else { - $output = executeQuery('member.updateGroupDefaultClear', $args); - if(!$output->toBool()) return $output; - } - - return executeQuery('member.insertGroup', $args); - } - - /** - * @brief 그룹 정보 수정 - **/ - function updateGroup($args) { - // is_default값을 체크, Y일 경우 일단 모든 is_default에 대해서 N 처리 - if($args->is_default!='Y') $args->is_default = 'N'; - else { - $output = executeQuery('member.updateGroupDefaultClear', $args); - if(!$output->toBool()) return $output; - } - - return executeQuery('member.updateGroup', $args); - } - - /** - * 그룹 삭제 - **/ - function deleteGroup($group_srl, $site_srl = null) { - // 멤버모델 객체 생성 - $oMemberModel = &getModel('member'); - - // 삭제 대상 그룹을 가져와서 체크 (is_default == 'Y'일 경우 삭제 불가) - $group_info = $oMemberModel->getGroup($group_srl); - - if(!$group_info) return new Object(-1, 'lang->msg_not_founded'); - if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default'); - - // is_default == 'Y'인 그룹을 가져옴 - $default_group = $oMemberModel->getDefaultGroup($site_srl); - $default_group_srl = $default_group->group_srl; - - // default_group_srl로 변경 - $this->changeGroup($group_srl, $default_group_srl); - - $args->group_srl = $group_srl; - return executeQuery('member.deleteGroup', $args); - } - - - function procMemberAdminGroupImageMarkUpdateOrder() { - $oModuleModel = &getModel('module'); - $oModuleControll = getController('module'); - - $config = $oModuleModel->getModuleConfig('member'); - // $config->group_image_mark_order = Context::get('group_image_mark_order'); - - $oModuleControll->insertModuleConfig('member', $config); - } - - /** - * @brief 금지아이디 등록 - **/ - function insertDeniedID($user_id, $description = '') { - $args->user_id = $user_id; - $args->description = $description; - $args->list_order = -1*getNextSequence(); - - return executeQuery('member.insertDeniedID', $args); - } - - /** - * @brief 금지아이디 삭제 - **/ - function deleteDeniedID($user_id) { - $args->user_id = $user_id; - return executeQuery('member.deleteDeniedID', $args); - } - - /** - * @brief 가입폼 항목을 삭제 - **/ - function deleteJoinForm($member_join_form_srl) { - $args->member_join_form_srl = $member_join_form_srl; - $output = executeQuery('member.deleteJoinForm', $args); - return $output; - } - - /** - * @brief 가입항목을 상단으로 이동 - **/ - function moveJoinFormUp($member_join_form_srl) { - $oMemberModel = &getModel('member'); - - // 선택된 가입항목의 정보를 구한다 - $args->member_join_form_srl = $member_join_form_srl; - $output = executeQuery('member.getJoinForm', $args); - - $join_form = $output->data; - $list_order = $join_form->list_order; - - // 전체 가입항목 목록을 구한다 - $join_form_list = $oMemberModel->getJoinFormList(); - $join_form_srl_list = array_keys($join_form_list); - if(count($join_form_srl_list)<2) return new Object(); - - $prev_member_join_form = NULL; - foreach($join_form_list as $key => $val) { - if($val->member_join_form_srl == $member_join_form_srl) break; - $prev_member_join_form = $val; - } - - // 이전 가입항목가 없으면 그냥 return - if(!$prev_member_join_form) return new Object(); - - // 선택한 가입항목의 정보 - $cur_args->member_join_form_srl = $member_join_form_srl; - $cur_args->list_order = $prev_member_join_form->list_order; - - // 대상 가입항목의 정보 - $prev_args->member_join_form_srl = $prev_member_join_form->member_join_form_srl; - $prev_args->list_order = $list_order; - - // DB 처리 - $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); - if(!$output->toBool()) return $output; - - executeQuery('member.updateMemberJoinFormListorder', $prev_args); - if(!$output->toBool()) return $output; - - return new Object(); - } - - /** - * @brief 가입항목을 하단으로 이동 - **/ - function moveJoinFormDown($member_join_form_srl) { - $oMemberModel = &getModel('member'); - - // 선택된 가입항목의 정보를 구한다 - $args->member_join_form_srl = $member_join_form_srl; - $output = executeQuery('member.getJoinForm', $args); - - $join_form = $output->data; - $list_order = $join_form->list_order; - - // 전체 가입항목 목록을 구한다 - $join_form_list = $oMemberModel->getJoinFormList(); - $join_form_srl_list = array_keys($join_form_list); - if(count($join_form_srl_list)<2) return new Object(); - - for($i=0;$imember_join_form_srl = $member_join_form_srl; - $cur_args->list_order = $next_member_join_form->list_order; - - // 대상 가입항목의 정보 - $next_args->member_join_form_srl = $next_member_join_form->member_join_form_srl; - $next_args->list_order = $list_order; - - // DB 처리 - $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); - if(!$output->toBool()) return $output; - - $output = executeQuery('member.updateMemberJoinFormListorder', $next_args); - if(!$output->toBool()) return $output; - - return new Object(); - } - } -?> +module); + unset($all_args->act); + if(!isset($args->limit_date)) $args->limit_date = ""; + + // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력 + $extra_vars = delObjectVars($all_args, $args); + $args->extra_vars = serialize($extra_vars); + + // member_srl이 넘어오면 원 회원이 있는지 확인 + if($args->member_srl) { + // 멤버 모델 객체 생성 + $oMemberModel = &getModel('member'); + + // 회원 정보 구하기 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); + + // 만약 원래 회원이 없으면 새로 입력하기 위한 처리 + if($member_info->member_srl != $args->member_srl) unset($args->member_srl); + } + + $oMemberController = &getController('member'); + + // member_srl의 값에 따라 insert/update + if(!$args->member_srl) { + $output = $oMemberController->insertMember($args); + $msg_code = 'success_registed'; + } else { + $output = $oMemberController->updateMember($args); + $msg_code = 'success_updated'; + } + + if(!$output->toBool()) return $output; + + // 서명 저장 + $signature = Context::get('signature'); + $oMemberController->putSignature($args->member_srl, $signature); + + // 결과 리턴 + $this->add('member_srl', $args->member_srl); + $this->setMessage($msg_code); + } + + /** + * @brief 사용자 삭제 (관리자용) + **/ + function procMemberAdminDelete() { + // 일단 입력된 값들을 모두 받아서 db 입력항목과 그외 것으로 분리 + $member_srl = Context::get('member_srl'); + + $oMemberController = &getController('member'); + $output = $oMemberController->deleteMember($member_srl); + if(!$output->toBool()) return $output; + + $this->add('page',Context::get('page')); + $this->setMessage("success_deleted"); + } + + /** + * @brief 회원 관리용 기본 정보의 추가 + **/ + function procMemberAdminInsertConfig() { + // 기본 정보를 받음 + $args = Context::gets( + 'webmaster_name', 'webmaster_email', + 'skin', 'colorset', + 'editor_skin', 'editor_colorset', + 'enable_openid', 'enable_join', 'enable_confirm', 'limit_day', + 'after_login_url', 'after_logout_url', 'redirect_url', 'agreement', + 'profile_image', 'profile_image_max_width', 'profile_image_max_height', + 'image_name', 'image_name_max_width', 'image_name_max_height', + 'image_mark', 'image_mark_max_width', 'image_mark_max_height', + 'group_image_mark', 'group_image_mark_max_width', 'group_image_mark_max_height', + 'signature','signature_max_height','change_password_date' + ); + + if(!$args->skin) $args->skin = "default"; + if(!$args->colorset) $args->colorset = "white"; + if(!$args->editor_skin) $args->editor_skin= "xpresseditor"; + if(!$args->editor_colorset) $args->editor_colorset = "white"; + if($args->enable_join!='Y') $args->enable_join = 'N'; + if($args->enable_openid!='Y') $args->enable_openid= 'N'; + if($args->profile_image !='Y') $args->profile_image = 'N'; + if($args->image_name!='Y') $args->image_name = 'N'; + if($args->image_mark!='Y') $args->image_mark = 'N'; + if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; + if($args->signature!='Y') $args->signature = 'N'; + if(!trim(strip_tags($args->agreement))) $args->agreement = null; + $args->limit_day = (int)$args->limit_day; + if(!$args->change_password_date) $args->change_password_date = 0; + + $oMemberController = &getController('member'); + $output = $oMemberController->setMemberConfig($args); + return $output; + } + + /** + * @brief 사용자 그룹 추가 + **/ + function procMemberAdminInsertGroup() { + $args = Context::gets('title','description','is_default','image_mark'); + $output = $this->insertGroup($args); + if(!$output->toBool()) return $output; + + $this->add('group_srl',''); + $this->add('page',Context::get('page')); + $this->setMessage('success_registed'); + } + + /** + * @brief 사용자 그룹 정보 수정 + **/ + function procMemberAdminUpdateGroup() { + $group_srl = Context::get('group_srl'); + $mode = Context::get('mode'); + + switch($mode) { + case 'delete' : + $output = $this->deleteGroup($group_srl); + if(!$output->toBool()) return $output; + $msg_code = 'success_deleted'; + break; + case 'update' : + $args = Context::gets('group_srl','title','description','is_default','image_mark'); + $args->site_srl = 0; + $output = $this->updateGroup($args); + if(!$output->toBool()) return $output; + $msg_code = 'success_updated'; + break; + } + + $this->add('group_srl',''); + $this->add('page',Context::get('page')); + $this->setMessage($msg_code); + } + + /** + * @brief 가입 항목 추가 + **/ + function procMemberAdminInsertJoinForm() { + $args->member_join_form_srl = Context::get('member_join_form_srl'); + + $args->column_type = Context::get('column_type'); + $args->column_name = strtolower(Context::get('column_name')); + $args->column_title = Context::get('column_title'); + $args->default_value = explode('|@|', Context::get('default_value')); + $args->is_active = Context::get('is_active'); + if(!in_array(strtoupper($args->is_active), array('Y','N'))) $args->is_active = 'N'; + $args->required = Context::get('required'); + if(!in_array(strtoupper($args->required), array('Y','N'))) $args->required = 'N'; + $args->description = Context::get('description'); + + // 기본값의 정리 + 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이 있으면 수정, 없으면 추가 + if(!$args->member_join_form_srl){ + $args->list_order = getNextSequence(); + $output = executeQuery('member.insertJoinForm', $args); + }else{ + $output = executeQuery('member.updateJoinForm', $args); + } + + if(!$output->toBool()) return $output; + + $this->add('act','dispJoinForm'); + $this->setMessage('success_registed'); + } + + /** + * @brief 가입 항목의 상/하 이동 및 내용 수정 + **/ + function procMemberAdminUpdateJoinForm() { + $member_join_form_srl = Context::get('member_join_form_srl'); + $mode = Context::get('mode'); + + switch($mode) { + case 'up' : + $output = $this->moveJoinFormUp($member_join_form_srl); + $msg_code = 'success_moved'; + break; + case 'down' : + $output = $this->moveJoinFormDown($member_join_form_srl); + $msg_code = 'success_moved'; + break; + case 'delete' : + $output = $this->deleteJoinForm($member_join_form_srl); + $msg_code = 'success_deleted'; + break; + case 'update' : + break; + } + if(!$output->toBool()) return $output; + + $this->setMessage($msg_code); + } + + /** + * @brief 선택된 회원들을 일괄 삭제 + */ + function procMemberAdminDeleteMembers() { + $target_member_srls = Context::get('target_member_srls'); + if(!$target_member_srls) return new Object(-1, 'msg_invalid_request'); + $member_srls = explode(',', $target_member_srls); + $oMemberController = &getController('member'); + + foreach($member_srls as $member) { + $output = $oMemberController->deleteMember($member); + if(!$output->toBool()) { + $this->setMessage('failed_deleted'); + return $output; + } + } + + $this->setMessage('success_deleted'); + } + + /** + * @brief 선택된 회원들의 그룹을 일괄 변경 + **/ + function procMemberAdminUpdateMembersGroup() { + $member_srl = Context::get('member_srl'); + if(!$member_srl) return new Object(-1,'msg_invalid_request'); + $member_srls = explode(',',$member_srl); + + $group_srl = Context::get('group_srls'); + $group_srls = explode('|@|', $group_srl); + if(!$group_srl) return new Object(-1,'msg_check_group'); + + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 선택된 회원들의 그룹을 삭제 + $args->member_srl = $member_srl; + $output = executeQuery('member.deleteMembersGroup', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 선택된 그룹으로 추가 + $group_count = count($group_srls); + $member_count = count($member_srls); + for($j=0;$j<$group_count;$j++) { + $group_srl = (int)trim($group_srls[$j]); + if(!$group_srl) continue; + for($i=0;$i<$member_count;$i++) { + $member_srl = (int)trim($member_srls[$i]); + if(!$member_srl) continue; + + $args = null; + $args->member_srl = $member_srl; + $args->group_srl = $group_srl; + + $output = executeQuery('member.addMemberToGroup', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + } + } + $oDB->commit(); + + $this->setMessage('success_updated'); + } + + /** + * @brief 금지 아이디 추가 + **/ + function procMemberAdminInsertDeniedID() { + $user_id = Context::get('user_id'); + $description = Context::get('description'); + + $output = $this->insertDeniedID($user_id, $description); + if(!$output->toBool()) return $output; + + $this->add('group_srl',''); + $this->add('page',Context::get('page')); + $this->setMessage('success_registed'); + } + + /** + * @brief 금지 아이디 업데이트 + **/ + function procMemberAdminUpdateDeniedID() { + $user_id = Context::get('user_id'); + $mode = Context::get('mode'); + + switch($mode) { + case 'delete' : + $output = $this->deleteDeniedID($user_id); + if(!$output->toBool()) return $output; + $msg_code = 'success_deleted'; + break; + } + + $this->add('page',Context::get('page')); + $this->setMessage($msg_code); + } + + /** + * @brief 관리자를 추가한다 + **/ + function insertAdmin($args) { + // 관리자임을 설정 + $args->is_admin = 'Y'; + + // 관리자 그룹을 구해와서 설정 + $oMemberModel = &getModel('member'); + $admin_group = $oMemberModel->getAdminGroup(); + $args->group_srl_list = $admin_group->group_srl; + + $oMemberController = &getController('member'); + return $oMemberController->insertMember($args); + } + + /** + * @brief 회원의 그룹값을 변경 + **/ + function changeGroup($source_group_srl, $target_group_srl) { + $args->source_group_srl = $source_group_srl; + $args->target_group_srl = $target_group_srl; + + return executeQuery('member.changeGroup', $args); + } + + /** + * @brief 그룹 등록 + **/ + function insertGroup($args) { + if(!$args->site_srl) $args->site_srl = 0; + // is_default값을 체크, Y일 경우 일단 모든 is_default에 대해서 N 처리 + if($args->is_default!='Y') { + $args->is_default = 'N'; + } else { + $output = executeQuery('member.updateGroupDefaultClear', $args); + if(!$output->toBool()) return $output; + } + + return executeQuery('member.insertGroup', $args); + } + + /** + * @brief 그룹 정보 수정 + **/ + function updateGroup($args) { + // is_default값을 체크, Y일 경우 일단 모든 is_default에 대해서 N 처리 + if($args->is_default!='Y') $args->is_default = 'N'; + else { + $output = executeQuery('member.updateGroupDefaultClear', $args); + if(!$output->toBool()) return $output; + } + + return executeQuery('member.updateGroup', $args); + } + + /** + * 그룹 삭제 + **/ + function deleteGroup($group_srl, $site_srl = null) { + // 멤버모델 객체 생성 + $oMemberModel = &getModel('member'); + + // 삭제 대상 그룹을 가져와서 체크 (is_default == 'Y'일 경우 삭제 불가) + $group_info = $oMemberModel->getGroup($group_srl); + + if(!$group_info) return new Object(-1, 'lang->msg_not_founded'); + if($group_info->is_default == 'Y') return new Object(-1, 'msg_not_delete_default'); + + // is_default == 'Y'인 그룹을 가져옴 + $default_group = $oMemberModel->getDefaultGroup($site_srl); + $default_group_srl = $default_group->group_srl; + + // default_group_srl로 변경 + $this->changeGroup($group_srl, $default_group_srl); + + $args->group_srl = $group_srl; + return executeQuery('member.deleteGroup', $args); + } + + + function procMemberAdminGroupImageMarkUpdateOrder() { + $oModuleModel = &getModel('module'); + $oModuleControll = getController('module'); + + $config = $oModuleModel->getModuleConfig('member'); + // $config->group_image_mark_order = Context::get('group_image_mark_order'); + + $oModuleControll->insertModuleConfig('member', $config); + } + + /** + * @brief 금지아이디 등록 + **/ + function insertDeniedID($user_id, $description = '') { + $args->user_id = $user_id; + $args->description = $description; + $args->list_order = -1*getNextSequence(); + + return executeQuery('member.insertDeniedID', $args); + } + + /** + * @brief 금지아이디 삭제 + **/ + function deleteDeniedID($user_id) { + $args->user_id = $user_id; + return executeQuery('member.deleteDeniedID', $args); + } + + /** + * @brief 가입폼 항목을 삭제 + **/ + function deleteJoinForm($member_join_form_srl) { + $args->member_join_form_srl = $member_join_form_srl; + $output = executeQuery('member.deleteJoinForm', $args); + return $output; + } + + /** + * @brief 가입항목을 상단으로 이동 + **/ + function moveJoinFormUp($member_join_form_srl) { + $oMemberModel = &getModel('member'); + + // 선택된 가입항목의 정보를 구한다 + $args->member_join_form_srl = $member_join_form_srl; + $output = executeQuery('member.getJoinForm', $args); + + $join_form = $output->data; + $list_order = $join_form->list_order; + + // 전체 가입항목 목록을 구한다 + $join_form_list = $oMemberModel->getJoinFormList(); + $join_form_srl_list = array_keys($join_form_list); + if(count($join_form_srl_list)<2) return new Object(); + + $prev_member_join_form = NULL; + foreach($join_form_list as $key => $val) { + if($val->member_join_form_srl == $member_join_form_srl) break; + $prev_member_join_form = $val; + } + + // 이전 가입항목가 없으면 그냥 return + if(!$prev_member_join_form) return new Object(); + + // 선택한 가입항목의 정보 + $cur_args->member_join_form_srl = $member_join_form_srl; + $cur_args->list_order = $prev_member_join_form->list_order; + + // 대상 가입항목의 정보 + $prev_args->member_join_form_srl = $prev_member_join_form->member_join_form_srl; + $prev_args->list_order = $list_order; + + // DB 처리 + $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); + if(!$output->toBool()) return $output; + + executeQuery('member.updateMemberJoinFormListorder', $prev_args); + if(!$output->toBool()) return $output; + + return new Object(); + } + + /** + * @brief 가입항목을 하단으로 이동 + **/ + function moveJoinFormDown($member_join_form_srl) { + $oMemberModel = &getModel('member'); + + // 선택된 가입항목의 정보를 구한다 + $args->member_join_form_srl = $member_join_form_srl; + $output = executeQuery('member.getJoinForm', $args); + + $join_form = $output->data; + $list_order = $join_form->list_order; + + // 전체 가입항목 목록을 구한다 + $join_form_list = $oMemberModel->getJoinFormList(); + $join_form_srl_list = array_keys($join_form_list); + if(count($join_form_srl_list)<2) return new Object(); + + for($i=0;$imember_join_form_srl = $member_join_form_srl; + $cur_args->list_order = $next_member_join_form->list_order; + + // 대상 가입항목의 정보 + $next_args->member_join_form_srl = $next_member_join_form->member_join_form_srl; + $next_args->list_order = $list_order; + + // DB 처리 + $output = executeQuery('member.updateMemberJoinFormListorder', $cur_args); + if(!$output->toBool()) return $output; + + $output = executeQuery('member.updateMemberJoinFormListorder', $next_args); + if(!$output->toBool()) return $output; + + return new Object(); + } + } +?> diff --git a/modules/member/member.admin.model.php b/modules/member/member.admin.model.php index ff195d33c..efc5cc72d 100644 --- a/modules/member/member.admin.model.php +++ b/modules/member/member.admin.model.php @@ -1,141 +1,141 @@ -is_admin = Context::get('is_admin')=='Y'?'Y':''; - $args->is_denied = Context::get('is_denied')=='Y'?'Y':''; - $args->selected_group_srl = Context::get('selected_group_srl'); - - $search_target = trim(Context::get('search_target')); - $search_keyword = trim(Context::get('search_keyword')); - - if($search_target && $search_keyword) { - switch($search_target) { - case 'user_id' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_user_id = $search_keyword; - break; - case 'user_name' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_user_name = $search_keyword; - break; - case 'nick_name' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_nick_name = $search_keyword; - break; - case 'email_address' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_email_address = $search_keyword; - break; - case 'regdate' : - $args->s_regdate = preg_replace("/[^0-9]/","",$search_keyword); - break; - case 'regdate_more' : - $args->s_regdate_more = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14); - break; - case 'regdate_less' : - $args->s_regdate_less = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14); - break; - case 'last_login' : - $args->s_last_login = $search_keyword; - break; - case 'last_login_more' : - $args->s_last_login_more = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14); - break; - case 'last_login_less' : - $args->s_last_login_less = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14); - break; - case 'extra_vars' : - $args->s_extra_vars = ereg_replace("[^0-9]","",$search_keyword); - break; - } - } - - // selected_group_srl이 있으면 query id를 변경 (table join때문에) - $sort_order = Context::get('sort_order'); - $sort_index = Context::get('sort_index'); - if($sort_index != 'last_login') { - $sort_index = "list_order"; - }else{ - $sort_order = 'desc'; - } - if($args->selected_group_srl) { - $query_id = 'member.getMemberListWithinGroup'; - $args->sort_index = "member.".$sort_index; - } else { - $query_id = 'member.getMemberList'; - $args->sort_index = $sort_index; - } - if($sort_order != "desc") $sort_order = "asc"; - $args->sort_order = $sort_order; - Context::set('sort_order', $sort_order); - - // 기타 변수들 정리 - $args->page = Context::get('page'); - $args->list_count = 40; - $args->page_count = 10; - $output = executeQuery($query_id, $args); - return $output; - } - - /** - * @brief 사이트별 회원 목록을 구함 - **/ - function getSiteMemberList($site_srl, $page = 1) { - $args->site_srl = $site_srl; - $args->page = $page; - $args->list_count = 40; - $args->page_count = 10; - $query_id = 'member.getSiteMemberList'; - $output = executeQueryArray($query_id, $args); - return $output; - } - - /** - * @brief 회원 모듈의 특정 스킨에 속한 컬러셋 목록을 return - **/ - function getMemberAdminColorset() { - $skin = Context::get('skin'); - if(!$skin) $tpl = ""; - else { - $oModuleModel = &getModel('module'); - $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin); - Context::set('skin_info', $skin_info); - - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - if(!$config->colorset) $config->colorset = "white"; - Context::set('config', $config); - - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list'); - } - - $this->add('tpl', $tpl); - } - - } -?> +is_admin = Context::get('is_admin')=='Y'?'Y':''; + $args->is_denied = Context::get('is_denied')=='Y'?'Y':''; + $args->selected_group_srl = Context::get('selected_group_srl'); + + $search_target = trim(Context::get('search_target')); + $search_keyword = trim(Context::get('search_keyword')); + + if($search_target && $search_keyword) { + switch($search_target) { + case 'user_id' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_id = $search_keyword; + break; + case 'user_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_name = $search_keyword; + break; + case 'nick_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_nick_name = $search_keyword; + break; + case 'email_address' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_email_address = $search_keyword; + break; + case 'regdate' : + $args->s_regdate = preg_replace("/[^0-9]/","",$search_keyword); + break; + case 'regdate_more' : + $args->s_regdate_more = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14); + break; + case 'regdate_less' : + $args->s_regdate_less = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14); + break; + case 'last_login' : + $args->s_last_login = $search_keyword; + break; + case 'last_login_more' : + $args->s_last_login_more = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14); + break; + case 'last_login_less' : + $args->s_last_login_less = substr(preg_replace("/[^0-9]/","",$search_keyword) . '00000000000000',0,14); + break; + case 'extra_vars' : + $args->s_extra_vars = ereg_replace("[^0-9]","",$search_keyword); + break; + } + } + + // selected_group_srl이 있으면 query id를 변경 (table join때문에) + $sort_order = Context::get('sort_order'); + $sort_index = Context::get('sort_index'); + if($sort_index != 'last_login') { + $sort_index = "list_order"; + }else{ + $sort_order = 'desc'; + } + if($args->selected_group_srl) { + $query_id = 'member.getMemberListWithinGroup'; + $args->sort_index = "member.".$sort_index; + } else { + $query_id = 'member.getMemberList'; + $args->sort_index = $sort_index; + } + if($sort_order != "desc") $sort_order = "asc"; + $args->sort_order = $sort_order; + Context::set('sort_order', $sort_order); + + // 기타 변수들 정리 + $args->page = Context::get('page'); + $args->list_count = 40; + $args->page_count = 10; + $output = executeQuery($query_id, $args); + return $output; + } + + /** + * @brief 사이트별 회원 목록을 구함 + **/ + function getSiteMemberList($site_srl, $page = 1) { + $args->site_srl = $site_srl; + $args->page = $page; + $args->list_count = 40; + $args->page_count = 10; + $query_id = 'member.getSiteMemberList'; + $output = executeQueryArray($query_id, $args); + return $output; + } + + /** + * @brief 회원 모듈의 특정 스킨에 속한 컬러셋 목록을 return + **/ + function getMemberAdminColorset() { + $skin = Context::get('skin'); + if(!$skin) $tpl = ""; + else { + $oModuleModel = &getModel('module'); + $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin); + Context::set('skin_info', $skin_info); + + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + if(!$config->colorset) $config->colorset = "white"; + Context::set('config', $config); + + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'colorset_list'); + } + + $this->add('tpl', $tpl); + } + + } +?> diff --git a/modules/member/member.admin.view.php b/modules/member/member.admin.view.php index acf485f20..6da3e2e9a 100644 --- a/modules/member/member.admin.view.php +++ b/modules/member/member.admin.view.php @@ -1,241 +1,241 @@ -member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - if(!$this->member_info) Context::set('member_srl',''); - else Context::set('member_info',$this->member_info); - } - - // retrieve group list - $this->group_list = $oMemberModel->getGroups(); - Context::set('group_list', $this->group_list); - - $this->setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief display member list - **/ - function dispMemberAdminList() { - - $oMemberAdminModel = &getAdminModel('member'); - $oMemberModel = &getModel('member'); - $output = $oMemberAdminModel->getMemberList(); - - // retrieve list of groups for each member - if($output->data) { - foreach($output->data as $key => $member) { - $output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0); - } - } - - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('member_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('member_list'); - } - - /** - * @brief default configuration for member management - **/ - function dispMemberAdminConfig() { - // retrieve configuration via module model instance - $oModuleModel = &getModel('module'); - $oMemberModel = &getModel('member'); - $config = $oMemberModel->getMemberConfig(); - Context::set('config',$config); - - // list of skins for member module - $skin_list = $oModuleModel->getSkins($this->module_path); - Context::set('skin_list', $skin_list); - - // retrieve skins of editor - $oEditorModel = &getModel('editor'); - Context::set('editor_skin_list', $oEditorModel->getEditorSkinList()); - - // get an editor - $option->primary_key_name = 'temp_srl'; - $option->content_key_name = 'agreement'; - $option->allow_fileupload = false; - $option->enable_autosave = false; - $option->enable_default_component = true; - $option->enable_component = true; - $option->resizable = true; - $option->height = 300; - $editor = $oEditorModel->getEditor(0, $option); - Context::set('editor', $editor); - - $this->setTemplateFile('member_config'); - } - - /** - * @brief display member information - **/ - function dispMemberAdminInfo() { - $oMemberModel = &getModel('member'); - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - Context::set('member_config', $member_config); - Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($this->member_info)); - $this->setTemplateFile('member_info'); - } - - /** - * @brief display member insert form - **/ - function dispMemberAdminInsert() { - // retrieve extend form - $oMemberModel = &getModel('member'); - Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($this->member_info)); - - $member_info = Context::get('member_info'); - $member_info->signature = $oMemberModel->getSignature($this->member_info->member_srl); - Context::set('member_info', $member_info); - - // get an editor for the signature - if($this->member_info->member_srl) { - $oEditorModel = &getModel('editor'); - $option->primary_key_name = 'member_srl'; - $option->content_key_name = 'signature'; - $option->allow_fileupload = false; - $option->enable_autosave = false; - $option->enable_default_component = true; - $option->enable_component = false; - $option->resizable = false; - $option->height = 200; - $editor = $oEditorModel->getEditor($this->member_info->member_srl, $option); - Context::set('editor', $editor); - } - - $this->setTemplateFile('insert_member'); - } - - /** - * @brief display member delete form - **/ - function dispMemberAdminDeleteForm() { - if(!Context::get('member_srl')) return $this->dispMemberAdminList(); - $this->setTemplateFile('delete_form'); - } - - /** - * @brief display group list - **/ - function dispMemberAdminGroupList() { - $oModuleModel = &getModel('module'); - - $config = $oModuleModel->getModuleConfig('member'); - if($config->group_image_mark_order) $config->group_image_mark_order = explode(',', $config->group_image_mark_order); - Context::set('config', $config); - - $group_srl = Context::get('group_srl'); - - if($group_srl && $this->group_list[$group_srl]) { - Context::set('selected_group', $this->group_list[$group_srl]); - $this->setTemplateFile('group_update_form'); - } else { - $this->setTemplateFile('group_list'); - } - } - - /** - * @brief 회원 가입 폼 목록 출력 - **/ - function dispMemberAdminJoinFormList() { - // 멤버모델 객체 생성 - $oMemberModel = &getModel('member'); - - // 추가로 설정한 가입 항목 가져오기 - $form_list = $oMemberModel->getJoinFormList(); - Context::set('form_list', $form_list); - - $this->setTemplateFile('join_form_list'); - } - - /** - * @brief 회원 가입 폼 관리 화면 출력 - **/ - function dispMemberAdminInsertJoinForm() { - // 수정일 경우 대상 join_form의 값을 구함 - $member_join_form_srl = Context::get('member_join_form_srl'); - if($member_join_form_srl) { - $oMemberModel = &getModel('member'); - $join_form = $oMemberModel->getJoinForm($member_join_form_srl); - - if(!$join_form) Context::set('member_join_form_srl','',true); - else Context::set('join_form', $join_form); - } - $this->setTemplateFile('insert_join_form'); - } - - /** - * @brief 금지 목록 아이디 출력 - **/ - function dispMemberAdminDeniedIDList() { - // 멤버모델 객체 생성 - $oMemberModel = &getModel('member'); - - // 사용금지 목록 가져오기 - $output = $oMemberModel->getDeniedIDList(); - - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('member_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('denied_id_list'); - } - - /** - * @brief 회원 그룹 일괄 변경 - **/ - function dispMemberAdminManageGroup() { - // 선택된 회원 목록을 구함 - $args->member_srl = trim(Context::get('member_srls')); - $output = executeQueryArray('member.getMembers', $args); - Context::set('member_list', $output->data); - - // 회원 그룹 목록을 구함 - $oMemberModel = &getModel('member'); - Context::set('member_groups', $oMemberModel->getGroups()); - - $this->setLayoutFile('popup_layout'); - $this->setTemplateFile('manage_member_group'); - } - - /** - * @brief 회원 일괄 삭제 - **/ - function dispMemberAdminDeleteMembers() { - // 선택된 회원 목록을 구함 - $args->member_srl = trim(Context::get('member_srls')); - $output = executeQueryArray('member.getMembers', $args); - Context::set('member_list', $output->data); - - $this->setLayoutFile('popup_layout'); - $this->setTemplateFile('delete_members'); - } - } -?> +member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + if(!$this->member_info) Context::set('member_srl',''); + else Context::set('member_info',$this->member_info); + } + + // retrieve group list + $this->group_list = $oMemberModel->getGroups(); + Context::set('group_list', $this->group_list); + + $this->setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief display member list + **/ + function dispMemberAdminList() { + + $oMemberAdminModel = &getAdminModel('member'); + $oMemberModel = &getModel('member'); + $output = $oMemberAdminModel->getMemberList(); + + // retrieve list of groups for each member + if($output->data) { + foreach($output->data as $key => $member) { + $output->data[$key]->group_list = $oMemberModel->getMemberGroups($member->member_srl,0); + } + } + + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('member_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('member_list'); + } + + /** + * @brief default configuration for member management + **/ + function dispMemberAdminConfig() { + // retrieve configuration via module model instance + $oModuleModel = &getModel('module'); + $oMemberModel = &getModel('member'); + $config = $oMemberModel->getMemberConfig(); + Context::set('config',$config); + + // list of skins for member module + $skin_list = $oModuleModel->getSkins($this->module_path); + Context::set('skin_list', $skin_list); + + // retrieve skins of editor + $oEditorModel = &getModel('editor'); + Context::set('editor_skin_list', $oEditorModel->getEditorSkinList()); + + // get an editor + $option->primary_key_name = 'temp_srl'; + $option->content_key_name = 'agreement'; + $option->allow_fileupload = false; + $option->enable_autosave = false; + $option->enable_default_component = true; + $option->enable_component = true; + $option->resizable = true; + $option->height = 300; + $editor = $oEditorModel->getEditor(0, $option); + Context::set('editor', $editor); + + $this->setTemplateFile('member_config'); + } + + /** + * @brief display member information + **/ + function dispMemberAdminInfo() { + $oMemberModel = &getModel('member'); + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + Context::set('member_config', $member_config); + Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($this->member_info)); + $this->setTemplateFile('member_info'); + } + + /** + * @brief display member insert form + **/ + function dispMemberAdminInsert() { + // retrieve extend form + $oMemberModel = &getModel('member'); + Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($this->member_info)); + + $member_info = Context::get('member_info'); + $member_info->signature = $oMemberModel->getSignature($this->member_info->member_srl); + Context::set('member_info', $member_info); + + // get an editor for the signature + if($this->member_info->member_srl) { + $oEditorModel = &getModel('editor'); + $option->primary_key_name = 'member_srl'; + $option->content_key_name = 'signature'; + $option->allow_fileupload = false; + $option->enable_autosave = false; + $option->enable_default_component = true; + $option->enable_component = false; + $option->resizable = false; + $option->height = 200; + $editor = $oEditorModel->getEditor($this->member_info->member_srl, $option); + Context::set('editor', $editor); + } + + $this->setTemplateFile('insert_member'); + } + + /** + * @brief display member delete form + **/ + function dispMemberAdminDeleteForm() { + if(!Context::get('member_srl')) return $this->dispMemberAdminList(); + $this->setTemplateFile('delete_form'); + } + + /** + * @brief display group list + **/ + function dispMemberAdminGroupList() { + $oModuleModel = &getModel('module'); + + $config = $oModuleModel->getModuleConfig('member'); + if($config->group_image_mark_order) $config->group_image_mark_order = explode(',', $config->group_image_mark_order); + Context::set('config', $config); + + $group_srl = Context::get('group_srl'); + + if($group_srl && $this->group_list[$group_srl]) { + Context::set('selected_group', $this->group_list[$group_srl]); + $this->setTemplateFile('group_update_form'); + } else { + $this->setTemplateFile('group_list'); + } + } + + /** + * @brief 회원 가입 폼 목록 출력 + **/ + function dispMemberAdminJoinFormList() { + // 멤버모델 객체 생성 + $oMemberModel = &getModel('member'); + + // 추가로 설정한 가입 항목 가져오기 + $form_list = $oMemberModel->getJoinFormList(); + Context::set('form_list', $form_list); + + $this->setTemplateFile('join_form_list'); + } + + /** + * @brief 회원 가입 폼 관리 화면 출력 + **/ + function dispMemberAdminInsertJoinForm() { + // 수정일 경우 대상 join_form의 값을 구함 + $member_join_form_srl = Context::get('member_join_form_srl'); + if($member_join_form_srl) { + $oMemberModel = &getModel('member'); + $join_form = $oMemberModel->getJoinForm($member_join_form_srl); + + if(!$join_form) Context::set('member_join_form_srl','',true); + else Context::set('join_form', $join_form); + } + $this->setTemplateFile('insert_join_form'); + } + + /** + * @brief 금지 목록 아이디 출력 + **/ + function dispMemberAdminDeniedIDList() { + // 멤버모델 객체 생성 + $oMemberModel = &getModel('member'); + + // 사용금지 목록 가져오기 + $output = $oMemberModel->getDeniedIDList(); + + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('member_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('denied_id_list'); + } + + /** + * @brief 회원 그룹 일괄 변경 + **/ + function dispMemberAdminManageGroup() { + // 선택된 회원 목록을 구함 + $args->member_srl = trim(Context::get('member_srls')); + $output = executeQueryArray('member.getMembers', $args); + Context::set('member_list', $output->data); + + // 회원 그룹 목록을 구함 + $oMemberModel = &getModel('member'); + Context::set('member_groups', $oMemberModel->getGroups()); + + $this->setLayoutFile('popup_layout'); + $this->setTemplateFile('manage_member_group'); + } + + /** + * @brief 회원 일괄 삭제 + **/ + function dispMemberAdminDeleteMembers() { + // 선택된 회원 목록을 구함 + $args->member_srl = trim(Context::get('member_srls')); + $output = executeQueryArray('member.getMembers', $args); + Context::set('member_list', $output->data); + + $this->setLayoutFile('popup_layout'); + $this->setTemplateFile('delete_members'); + } + } +?> diff --git a/modules/member/member.api.php b/modules/member/member.api.php index 3aca073e7..619ae2308 100644 --- a/modules/member/member.api.php +++ b/modules/member/member.api.php @@ -1,40 +1,40 @@ -arrangeContentList(Context::get('document_list')); - $oModule->add('document_list',$document_list); - $oModule->add('page_navigation',Context::get('page_navigation')); - } - - - - function arrangeContentList($content_list) { - $output = array(); - if(count($content_list)) { - foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val); - } - return $output; - } - - - function arrangeContent($content) { - $output = null; - if($content){ - $output= $content->gets('document_srl','category_srl','is_secret','nick_name','user_id','user_name','title','content','tags','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars'); - } - return $output; - } - - } -?> +arrangeContentList(Context::get('document_list')); + $oModule->add('document_list',$document_list); + $oModule->add('page_navigation',Context::get('page_navigation')); + } + + + + function arrangeContentList($content_list) { + $output = array(); + if(count($content_list)) { + foreach($content_list as $key => $val) $output[] = $this->arrangeContent($val); + } + return $output; + } + + + function arrangeContent($content) { + $output = null; + if($content){ + $output= $content->gets('document_srl','category_srl','is_secret','nick_name','user_id','user_name','title','content','tags','voted_count','blamed_count','comment_count','regdate','last_update','extra_vars'); + } + return $output; + } + + } +?> diff --git a/modules/member/member.class.php b/modules/member/member.class.php index 0eb83ad9c..88a9fd88b 100644 --- a/modules/member/member.class.php +++ b/modules/member/member.class.php @@ -1,237 +1,237 @@ -getModuleConfig('member'); - - // SSL 사용시 회원가입/정보/비밀번호등과 관련된 action에 대해 SSL 전송하도록 지정 - if(Context::get('_use_ssl') == 'optional') { - Context::addSSLAction('dispMemberModifyPassword'); - Context::addSSLAction('dispMemberSignUpForm'); - Context::addSSLAction('dispMemberModifyInfo'); - Context::addSSLAction('procMemberLogin'); - Context::addSSLAction('procMemberModifyPassword'); - Context::addSSLAction('procMemberInsert'); - Context::addSSLAction('procMemberModifyInfo'); - Context::addSSLAction('procMemberFindAccount'); - } - } - - /** - * @brief 설치시 추가 작업이 필요할시 구현 - **/ - function moduleInstall() { - // action forward에 등록 (관리자 모드에서 사용하기 위함) - $oModuleController = &getController('module'); - - $oDB = &DB::getInstance(); - $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); - - $oModuleModel = &getModel('module'); - $args = $oModuleModel->getModuleConfig('member'); - - // 기본 정보를 세팅 - $args->enable_join = 'Y'; - if(!$args->enable_openid) $args->enable_openid = 'N'; - if(!$args->enable_auth_mail) $args->enable_auth_mail = 'N'; - if(!$args->image_name) $args->image_name = 'Y'; - if(!$args->image_mark) $args->image_mark = 'Y'; - if(!$args->profile_image) $args->profile_image = 'Y'; - if(!$args->image_name_max_width) $args->image_name_max_width = '90'; - if(!$args->image_name_max_height) $args->image_name_max_height = '20'; - if(!$args->image_mark_max_width) $args->image_mark_max_width = '20'; - if(!$args->image_mark_max_height) $args->image_mark_max_height = '20'; - if(!$args->profile_image_max_width) $args->profile_image_max_width = '80'; - if(!$args->profile_image_max_height) $args->profile_image_max_height = '80'; - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; - - $oModuleController->insertModuleConfig('member',$args); - - // 멤버 컨트롤러 객체 생성 - $oMemberModel = &getModel('member'); - $oMemberController = &getController('member'); - $oMemberAdminController = &getAdminController('member'); - - $groups = $oMemberModel->getGroups(); - if(!count($groups)) { - // 관리자, 정회원, 준회원 그룹을 입력 - $group_args->title = Context::getLang('admin_group'); - $group_args->is_default = 'N'; - $group_args->is_admin = 'Y'; - $output = $oMemberAdminController->insertGroup($group_args); - - unset($group_args); - $group_args->title = Context::getLang('default_group_1'); - $group_args->is_default = 'Y'; - $group_args->is_admin = 'N'; - $output = $oMemberAdminController->insertGroup($group_args); - - unset($group_args); - $group_args->title = Context::getLang('default_group_2'); - $group_args->is_default = 'N'; - $group_args->is_admin = 'N'; - $oMemberAdminController->insertGroup($group_args); - } - - // 관리자 정보 세팅 - $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) { - // 관리자 정보 입력 - $oMemberAdminController->insertAdmin($admin_info); - - // 로그인 처리시킴 - $output = $oMemberController->doLogin($admin_info->user_id); - } - } - - // 금지 아이디 등록 (기본 + 모듈명) - $oModuleModel = &getModel('module'); - $module_list = $oModuleModel->getModuleList(); - foreach($module_list as $key => $val) { - $oMemberAdminController->insertDeniedID($val->module,''); - } - $oMemberAdminController->insertDeniedID('www',''); - $oMemberAdminController->insertDeniedID('root',''); - $oMemberAdminController->insertDeniedID('administrator',''); - $oMemberAdminController->insertDeniedID('telnet',''); - $oMemberAdminController->insertDeniedID('ftp',''); - $oMemberAdminController->insertDeniedID('http',''); - - // member 에서 사용할 cache디렉토리 생성 - FileHandler::makeDir('./files/member_extra_info/image_name'); - FileHandler::makeDir('./files/member_extra_info/image_mark'); - FileHandler::makeDir('./files/member_extra_info/profile_image'); - FileHandler::makeDir('./files/member_extra_info/signature'); - - $oDB->addIndex("member_openid_association","idx_assoc", array("server_url(255)","handle"), false); - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oDB = &DB::getInstance(); - $oModuleModel = &getModel('module'); - - // member 디렉토리 체크 (2007. 8. 11 추가) - if(!is_dir("./files/member_extra_info")) return true; - - // member 디렉토리 체크 (2007. 10. 22 추가) - if(!is_dir("./files/member_extra_info/profile_image")) return true; - - // member_auth_mail 테이블에 is_register 필드 추가 (2008. 04. 22) - $act = $oDB->isColumnExists("member_auth_mail", "is_register"); - if(!$act) return true; - - // member_group_member 테이블에 site_srl 추가 (2008. 11. 15) - 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) - if(!$oDB->isColumnExists("member_group", "image_mark")) return true; - - // password 유효기간을 위한 추가 - if(!$oDB->isColumnExists("member", "change_password_date")) return true; - - // 비밀번호 찾기 질문/답변을 위한 추가 - if(!$oDB->isColumnExists("member", "find_account_question")) return true; - if(!$oDB->isColumnExists("member", "find_account_answer")) return true; - - if(!$oDB->isColumnExists("member", "list_order")) return true; - if(!$oDB->isIndexExists("member","idx_list_order")) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB = &DB::getInstance(); - $oModuleController = &getController('module'); - - // member 디렉토리 체크 - 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 필드 추가 - 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) - 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); - } - if (!$oDB->isColumnExists("member_group", "site_srl")) { - $oDB->addColumn("member_group", "site_srl", "number", 11, 0, true); - $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); - } - if($oDB->isIndexExists("member_group","uni_member_group_title")) { - $oDB->dropIndex("member_group","uni_member_group_title",true); - } - - // image_mark 추가 (2009. 02. 14) - if(!$oDB->isColumnExists("member_group", "image_mark")) { - $oDB->addColumn("member_group", "image_mark", "text"); - } - - // password 유효기간을 위한 추가 - if(!$oDB->isColumnExists("member", "change_password_date")) { - $oDB->addColumn("member", "change_password_date", "date"); - executeQuery('member.updateAllChangePasswordDate'); - } - - // 비밀번호 찾기 질문/답변을 위한 추가 - if(!$oDB->isColumnExists("member", "find_account_question")) { - $oDB->addColumn("member", "find_account_question", "number", 11); - } - if(!$oDB->isColumnExists("member", "find_account_answer")) { - $oDB->addColumn("member", "find_account_answer", "varchar", 250); - } - - if(!$oDB->isColumnExists("member", "list_order")) { - $oDB->addColumn("member", "list_order", "number", 11); - set_time_limit(0); - $args->list_order = 'member_srl'; - executeQuery('member.updateMemberListOrderAll',$args); - executeQuery('member.updateMemberListOrderAll'); - } - - if(!$oDB->isIndexExists("member","idx_list_order")) { - $oDB->addIndex("member","idx_list_order", array("list_order")); - } - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3"); - require_once('Auth/OpenID/XEStore.php'); - $store = new Auth_OpenID_XEStore(); - $store->reset(); - } - } -?> +getModuleConfig('member'); + + // SSL 사용시 회원가입/정보/비밀번호등과 관련된 action에 대해 SSL 전송하도록 지정 + if(Context::get('_use_ssl') == 'optional') { + Context::addSSLAction('dispMemberModifyPassword'); + Context::addSSLAction('dispMemberSignUpForm'); + Context::addSSLAction('dispMemberModifyInfo'); + Context::addSSLAction('procMemberLogin'); + Context::addSSLAction('procMemberModifyPassword'); + Context::addSSLAction('procMemberInsert'); + Context::addSSLAction('procMemberModifyInfo'); + Context::addSSLAction('procMemberFindAccount'); + } + } + + /** + * @brief 설치시 추가 작업이 필요할시 구현 + **/ + function moduleInstall() { + // action forward에 등록 (관리자 모드에서 사용하기 위함) + $oModuleController = &getController('module'); + + $oDB = &DB::getInstance(); + $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); + + $oModuleModel = &getModel('module'); + $args = $oModuleModel->getModuleConfig('member'); + + // 기본 정보를 세팅 + $args->enable_join = 'Y'; + if(!$args->enable_openid) $args->enable_openid = 'N'; + if(!$args->enable_auth_mail) $args->enable_auth_mail = 'N'; + if(!$args->image_name) $args->image_name = 'Y'; + if(!$args->image_mark) $args->image_mark = 'Y'; + if(!$args->profile_image) $args->profile_image = 'Y'; + if(!$args->image_name_max_width) $args->image_name_max_width = '90'; + if(!$args->image_name_max_height) $args->image_name_max_height = '20'; + if(!$args->image_mark_max_width) $args->image_mark_max_width = '20'; + if(!$args->image_mark_max_height) $args->image_mark_max_height = '20'; + if(!$args->profile_image_max_width) $args->profile_image_max_width = '80'; + if(!$args->profile_image_max_height) $args->profile_image_max_height = '80'; + if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; + + $oModuleController->insertModuleConfig('member',$args); + + // 멤버 컨트롤러 객체 생성 + $oMemberModel = &getModel('member'); + $oMemberController = &getController('member'); + $oMemberAdminController = &getAdminController('member'); + + $groups = $oMemberModel->getGroups(); + if(!count($groups)) { + // 관리자, 정회원, 준회원 그룹을 입력 + $group_args->title = Context::getLang('admin_group'); + $group_args->is_default = 'N'; + $group_args->is_admin = 'Y'; + $output = $oMemberAdminController->insertGroup($group_args); + + unset($group_args); + $group_args->title = Context::getLang('default_group_1'); + $group_args->is_default = 'Y'; + $group_args->is_admin = 'N'; + $output = $oMemberAdminController->insertGroup($group_args); + + unset($group_args); + $group_args->title = Context::getLang('default_group_2'); + $group_args->is_default = 'N'; + $group_args->is_admin = 'N'; + $oMemberAdminController->insertGroup($group_args); + } + + // 관리자 정보 세팅 + $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) { + // 관리자 정보 입력 + $oMemberAdminController->insertAdmin($admin_info); + + // 로그인 처리시킴 + $output = $oMemberController->doLogin($admin_info->user_id); + } + } + + // 금지 아이디 등록 (기본 + 모듈명) + $oModuleModel = &getModel('module'); + $module_list = $oModuleModel->getModuleList(); + foreach($module_list as $key => $val) { + $oMemberAdminController->insertDeniedID($val->module,''); + } + $oMemberAdminController->insertDeniedID('www',''); + $oMemberAdminController->insertDeniedID('root',''); + $oMemberAdminController->insertDeniedID('administrator',''); + $oMemberAdminController->insertDeniedID('telnet',''); + $oMemberAdminController->insertDeniedID('ftp',''); + $oMemberAdminController->insertDeniedID('http',''); + + // member 에서 사용할 cache디렉토리 생성 + FileHandler::makeDir('./files/member_extra_info/image_name'); + FileHandler::makeDir('./files/member_extra_info/image_mark'); + FileHandler::makeDir('./files/member_extra_info/profile_image'); + FileHandler::makeDir('./files/member_extra_info/signature'); + + $oDB->addIndex("member_openid_association","idx_assoc", array("server_url(255)","handle"), false); + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oDB = &DB::getInstance(); + $oModuleModel = &getModel('module'); + + // member 디렉토리 체크 (2007. 8. 11 추가) + if(!is_dir("./files/member_extra_info")) return true; + + // member 디렉토리 체크 (2007. 10. 22 추가) + if(!is_dir("./files/member_extra_info/profile_image")) return true; + + // member_auth_mail 테이블에 is_register 필드 추가 (2008. 04. 22) + $act = $oDB->isColumnExists("member_auth_mail", "is_register"); + if(!$act) return true; + + // member_group_member 테이블에 site_srl 추가 (2008. 11. 15) + 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) + if(!$oDB->isColumnExists("member_group", "image_mark")) return true; + + // password 유효기간을 위한 추가 + if(!$oDB->isColumnExists("member", "change_password_date")) return true; + + // 비밀번호 찾기 질문/답변을 위한 추가 + if(!$oDB->isColumnExists("member", "find_account_question")) return true; + if(!$oDB->isColumnExists("member", "find_account_answer")) return true; + + if(!$oDB->isColumnExists("member", "list_order")) return true; + if(!$oDB->isIndexExists("member","idx_list_order")) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB = &DB::getInstance(); + $oModuleController = &getController('module'); + + // member 디렉토리 체크 + 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 필드 추가 + 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) + 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); + } + if (!$oDB->isColumnExists("member_group", "site_srl")) { + $oDB->addColumn("member_group", "site_srl", "number", 11, 0, true); + $oDB->addIndex("member_group","idx_site_title", array("site_srl","title"),true); + } + if($oDB->isIndexExists("member_group","uni_member_group_title")) { + $oDB->dropIndex("member_group","uni_member_group_title",true); + } + + // image_mark 추가 (2009. 02. 14) + if(!$oDB->isColumnExists("member_group", "image_mark")) { + $oDB->addColumn("member_group", "image_mark", "text"); + } + + // password 유효기간을 위한 추가 + if(!$oDB->isColumnExists("member", "change_password_date")) { + $oDB->addColumn("member", "change_password_date", "date"); + executeQuery('member.updateAllChangePasswordDate'); + } + + // 비밀번호 찾기 질문/답변을 위한 추가 + if(!$oDB->isColumnExists("member", "find_account_question")) { + $oDB->addColumn("member", "find_account_question", "number", 11); + } + if(!$oDB->isColumnExists("member", "find_account_answer")) { + $oDB->addColumn("member", "find_account_answer", "varchar", 250); + } + + if(!$oDB->isColumnExists("member", "list_order")) { + $oDB->addColumn("member", "list_order", "number", 11); + set_time_limit(0); + $args->list_order = 'member_srl'; + executeQuery('member.updateMemberListOrderAll',$args); + executeQuery('member.updateMemberListOrderAll'); + } + + if(!$oDB->isIndexExists("member","idx_list_order")) { + $oDB->addIndex("member","idx_list_order", array("list_order")); + } + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3"); + require_once('Auth/OpenID/XEStore.php'); + $store = new Auth_OpenID_XEStore(); + $store->reset(); + } + } +?> diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php index ec40f852b..26dd1560d 100644 --- a/modules/member/member.controller.php +++ b/modules/member/member.controller.php @@ -1,1937 +1,1937 @@ -doLogin($user_id, $password, $keep_signed=='Y'?true:false); - - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - if($config->after_login_url) $this->setRedirectUrl($config->after_login_url); - - // 설정된 change_password_date 확인 - $limit_date = $config->change_password_date; - - // change_password_date가 설정되어 있으면 확인 - if ($limit_date > 0) { - $oMemberModel = &getModel('member'); - $member_info = $oMemberModel->getMemberInfoByUserID($user_id); - if ($member_info->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day'))) { - $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword')); - } - } - - $redirect_url = Context::get('redirect_url'); - if ($output->toBool () && Context::getRequestMethod () == "POST" && $redirect_url) { - header ("location:" . $redirect_url); - } - - return $output; - } - - /** - * @brief openid로그인 - **/ - function procMemberOpenIDLogin($validator = "procMemberOpenIDValidate") { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - if($config->enable_openid != 'Y') $this->stop('msg_invalid_request'); - - if(!defined('Auth_OpenID_RAND_SOURCE') && !file_exists("/dev/urandom")) - { - define('Auth_OpenID_RAND_SOURCE', null); - } - - set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3"); - require_once('Auth/OpenID.php'); - require_once('Auth/OpenID/Consumer.php'); - require_once('Auth/OpenID/XEStore.php'); - $store = new Auth_OpenID_XEStore(); - $consumer = new Auth_OpenID_Consumer($store); - - $user_id = Context::get('user_id'); - if (!$user_id) $user_id = Context::get('openid'); - $auth_request = $consumer->begin($user_id); - $auth_request->addExtensionArg('sreg', 'required', 'email'); - $auth_request->addExtensionArg('sreg', 'optional', 'dob'); - if(!$auth_request) - { - return new Object(-1, "association failed"); - } - - $trust_root = 'http://'.$_SERVER["HTTP_HOST"]; - $referer_url = Context::get('referer_url'); - if (!$referer_url) $referer_url = $_SERVER['HTTP_REFERER']; - if (!$referer_url) - $referer_url = htmlspecialchars_decode(getRequestUri(RELEASE_SSL)); - $goto = urlencode($referer_url); - $ApprovedURL = Context::getRequestUri(RELEASE_SSL) . "?module=member&act=" . $validator. "&goto=" . $goto; - $redirect_url = $auth_request->redirectURL($trust_root, $ApprovedURL); - $this->add("redirect_url", $redirect_url); - if (Context::getRequestMethod() == 'POST') - header("location:" . $redirect_url); - } - - function getLegacyUserIDsFromOpenID($openid_identity) { - // Issue 17515512: workaround - $result = array(); - $uri_matches = array(); - preg_match(Auth_OpenID_getURIPattern(), $openid_identity, $uri_matches); - - if (count($uri_matches) < 9) { - for ($i = count($uri_matches); $i <= 9; $i++) { - $uri_matches[] = ''; - } - } - - $scheme = $uri_matches[2]; - $authority = $uri_matches[4]; - $path = $uri_matches[5]; - $query = $uri_matches[6]; - $fragment = $uri_matches[8]; - - if ($scheme === null) $scheme = ''; - if ($authority === null) $authority = ''; - if ($path === null) $path = ''; - if ($query === null) $query = ''; - if ($fragment === null) $fragment = ''; - - if ($scheme == 'http' or $scheme == '') - $scheme_part = ''; - else - $scheme_part = $scheme."://"; - - - if ($path == '' || $path == '/') { - $result[] = $scheme_part.$authority.''.$query.$fragment; - $result[] = $scheme_part.$authority.'/'.$query.$fragment; - } - else { - $result[] = $scheme_part.$authority.$path.$query.$fragment; - } - - return $result; - } - - /** - * @brief openid 인증 체크 - **/ - function procMemberOpenIDValidate() { - set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3"); - require_once('Auth/OpenID.php'); - require_once('Auth/OpenID/Consumer.php'); - require_once('Auth/OpenID/XEStore.php'); - require_once('Auth/OpenID/URINorm.php'); - - $store = new Auth_OpenID_XEStore(); - $consumer = new Auth_OpenID_Consumer($store); - $response = $consumer->complete($_GET); - switch($response->status) { - case Auth_OpenID_CANCEL : - // 사용자가 인증을 취소했을 때의 처리 - return $this->stop('authorization_canceled'); - case Auth_OpenID_FAILURE : - // 무언가의 문제로 인해 인증이 실패했을 때의 처리(인증을 요구한 openid가 없다든가..) - return $this->stop('invalid_authorization'); - case Auth_OpenID_SUCCESS : - // 인증성공!! - break; - default: - return $this->stop('invalid_authorization'); - } - - // 인증 성공 - $oMemberModel = &getModel('member'); - - // 이 오픈아이디와 연결된 (또는 연결되어 있을 가능성이 있는) 제로보드 아이디들을 받아온다. - $login_success = false; - $assoc_member_info = null; - $openid_identity = $response->signed_args["openid.identity"]; - $args->openid = $openid_identity; - $output = executeQuery('member.getMemberSrlByOpenID', $args); - - if ($output->toBool() && $output->data && !is_array($output->data)) { - $member_srl = $output->data->member_srl; - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - if ($member_info) { - $assoc_member_info = $member_info; - } - } - - $user_id_candidates = $this->getLegacyUserIDsFromOpenID($openid_identity); - $default_user_id = $user_id_candidates[0]; - - if ($assoc_member_info != null) { - $user_id_candidates = array_merge(array($assoc_member_info->user_id), $user_id_candidates); - } - $sreg = $response->extensionResponse('sreg'); - - foreach($user_id_candidates as $user_id) { - $args->user_id = $args->nick_name = $user_id; - // 기본 정보들을 받음 - $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']); - - // 자체 인증 시도 - $output = $this->doLogin($args->user_id); - - if ($output->toBool()) { - if ($assoc_member_info == null) { - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - $args->openid = $openid_identity; - executeQuery('member.addOpenIDToMember', $args); - } - $login_success = true; - break; - } - } - - // 자체 인증 실패시 회원 가입시킴 - if(!$login_success) { - $args->user_id = $args->nick_name = $default_user_id; - $args->password = md5(getmicrotime()); - - $output = $this->insertMember($args); - if(!$output->toBool()) return $this->stop($output->getMessage()); - $output = $this->doLogin($args->user_id); - if(!$output->toBool()) return $this->stop($output->getMessage()); - - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - $args->openid = $openid_identity; - executeQuery('member.addOpenIDToMember', $args); - } - - Context::close(); - - // 페이지 이동 - if(Context::get('goto')) { - $goto = Context::get('goto'); - header("location:" . $goto); - } else { - header("location:./"); - } - - exit(); - } - - /** - * @brief 오픈아이디 연결 요청 - **/ - function procMemberAddOpenIDToMember() { - return $this->procMemberOpenIDLogin("procMemberValidateAddOpenIDToMember"); - } - - /** - * @brief 오픈아이디 연결 요청 마무리 - **/ - function procMemberValidateAddOpenIDToMember() { - set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3"); - require_once('Auth/OpenID.php'); - require_once('Auth/OpenID/Consumer.php'); - require_once('Auth/OpenID/XEStore.php'); - require_once('Auth/OpenID/URINorm.php'); - - $store = new Auth_OpenID_XEStore(); - $consumer = new Auth_OpenID_Consumer($store); - $response = $consumer->complete($_GET); - - switch($response->status) { - case Auth_OpenID_CANCEL : - // 사용자가 인증을 취소했을 때의 처리 - return $this->stop('authorization_canceled'); - case Auth_OpenID_FAILURE : - // 무언가의 문제로 인해 인증이 실패했을 때의 처리(인증을 요구한 openid가 없다든가..) - return $this->stop('invalid_authorization'); - case Auth_OpenID_SUCCESS : - { - $logged_info = Context::get('logged_info'); - if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); - - $member_srl = $logged_info->member_srl; - - $args->member_srl = $member_srl; - $openid_identity = $response->signed_args["openid.identity"]; - $args->openid = $openid_identity; - - $output = executeQuery('member.addOpenIDToMember', $args); - if (!$output->toBool()) return $output; - - Context::close(); - - if(Context::get('goto')){ - $goto = Context::get('goto'); - header("location:" . $goto); - }else{ - header("location:./"); - } - exit(); - } - // 인증성공!! - break; - default: - return $this->stop('invalid_authorization'); - } - } - - /** - * @brief 오픈아이디 연결 해제 - **/ - function procMemberDeleteOpenIDFromMember() { - $logged_info = Context::get('logged_info'); - $openid_identity = Context::get('openid_to_delete'); - $arg->openid = $openid_identity; - $result = executeQuery('member.getMemberSrlByOpenID', $arg); - - if (!Context::get('is_logged')) { - $this->setError(-1); - $this->setMessage('msg_not_logged'); - return; - } else if (!$result->data || is_array($result->data)) { - $this->setError(-1); - $this->setMessage('msg_not_founded'); - return; - } else if ($result->data->member_srl != $logged_info->member_srl) { - $this->setError(-1); - $this->setMessage('msg_not_permitted'); - return; - } - - $arg->openid = $openid_identity; - - $output = executeQuery('member.deleteMemberOpenID', $arg); - if(!$output->toBool()) return $output; - - $this->setMessage('success_updated'); - } - - - /** - * @brief 로그아웃 - **/ - function procMemberLogout() { - // 로그아웃 이전에 trigger 호출 (before) - $logged_info = Context::get('logged_info'); - $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info); - if(!$trigger_output->toBool()) return $trigger_output; - - // 세션 정보 파기 - $this->destroySessionInfo(); - - // 로그아웃 이후 trigger 호출 (after) - $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info); - if(!$trigger_output->toBool()) return $trigger_output; - - $output = new Object(); - - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - if($config->after_logout_url) Context::set('redirect_url', $config->after_logout_url); - - return $output; - } - - /** - * @brief 스크랩 기능 - **/ - function procMemberScrapDocument() { - // 로그인 정보 체크 - 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'); - - // 문서 가져오기 - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - - // 변수 정리 - $args->document_srl = $document_srl; - $args->member_srl = $logged_info->member_srl; - $args->user_id = $oDocument->get('user_id'); - $args->user_name = $oDocument->get('user_name'); - $args->nick_name = $oDocument->get('nick_name'); - $args->target_member_srl = $oDocument->get('member_srl'); - $args->title = $oDocument->get('title'); - - // 있는지 조사 - $output = executeQuery('member.getScrapDocument', $args); - if($output->data->count) return new Object(-1, 'msg_alreay_scrapped'); - - // 입력 - $output = executeQuery('member.addScrapDocument', $args); - if(!$output->toBool()) return $output; - - $this->setError(-1); - $this->setMessage('success_registed'); - } - - /** - * @brief 스크랩 삭제 - **/ - function procMemberDeleteScrap() { - // 로그인 정보 체크 - 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'); - - // 변수 정리 - $args->member_srl = $logged_info->member_srl; - $args->document_srl = $document_srl; - return executeQuery('member.deleteScrapDocument', $args); - } - - /** - * @brief 게시글 저장 - **/ - function procMemberSaveDocument() { - // 로그인 정보 체크 - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); - - $logged_info = Context::get('logged_info'); - - // form 정보를 모두 받음 - $obj = Context::getRequestVars(); - - // 글의 대상 모듈을 회원 정보로 변경 - $obj->module_srl = $logged_info->member_srl; - unset($obj->is_notice); - - // 제목을 사용하지 않는 방명록 등에서 내용 앞 부분을 제목 가져오기 - if(!$obj->title) { - $obj->title = cut_str(strip_tags($obj->content), 20, '...'); - } - - $oDocumentModel = &getModel('document'); - $oDocumentController = &getController('document'); - - // 이미 존재하는 글인지 체크 - $oDocument = $oDocumentModel->getDocument($obj->document_srl, $this->grant->manager); - - // 이미 존재하는 경우 수정 - if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) { - $output = $oDocumentController->updateDocument($oDocument, $obj); - $msg_code = 'success_updated'; - - // 그렇지 않으면 신규 등록 - } 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); - } - - // 등록된 첨부파일의 상태를 무효로 지정 - if($oDocument->hasUploadedFiles()) { - $args->upload_target_srl = $oDocument->document_srl; - $args->isvalid = 'N'; - executeQuery('file.updateFileValid', $args); - } - - $this->setMessage('success_saved'); - $this->add('document_srl', $obj->document_srl); - } - - /** - * @brief 저장된 글 삭제 - **/ - function procMemberDeleteSavedDocument() { - // 로그인 정보 체크 - 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'); - - // 변수 정리 - $oDocumentController = &getController('document'); - $oDocumentController->deleteDocument($document_srl, true); - } - - /** - * @brief 회원 가입시 특정 항목들에 대한 값 체크 - **/ - function procMemberCheckValue() { - $name = Context::get('name'); - $value = Context::get('value'); - if(!$value) return; - - $oMemberModel = &getModel('member'); - - // 로그인 여부 체크 - $logged_info = Context::get('logged_info'); - - - switch($name) { - case 'user_id' : - // 금지 아이디 검사 - if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id'); - - // 중복 검사 - $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' : - // 중복 검사 - $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' : - // 중복 검사 - $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value); - if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address'); - break; - } - } - - /** - * @brief 회원 가입 - **/ - function procMemberInsert() { - if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request"); - $oMemberModel = &getModel ('member'); - $config = $oMemberModel->getMemberConfig (); - - // before 트리거 호출 - $trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config); - if (!$trigger_output->toBool ()) return $trigger_output; - - // 관리자가 회원가입을 허락하였는지 검사 - if ($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled'); - - // 약관에 동의하였는지 검사 (약관이 있을 경우만) - if ($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement'); - - // 필수 정보들을 미리 추출 - $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; - - // 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제 - $all_args = Context::getRequestVars(); - unset($all_args->module); - unset($all_args->act); - unset($all_args->is_admin); - unset($all_args->description); - unset($all_args->group_srl_list); - unset($all_args->body); - unset($all_args->accept_agreement); - unset($all_args->signature); - unset($all_args->password2); - - // 메일 인증 기능 사용시 회원 상태를 denied로 설정 - if ($config->enable_confirm == 'Y') $args->denied = 'Y'; - - // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력 - $extra_vars = delObjectVars($all_args, $args); - $args->extra_vars = serialize($extra_vars); - - // member_srl의 값에 따라 insert/update - $output = $this->insertMember($args); - if(!$output->toBool()) return $output; - - // 가상사이트일 경우 사이트 가입 - $site_module_info = Context::get('site_module_info'); - if($site_module_info->site_srl > 0) { - $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl); - if($default_group->group_srl) { - $this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl); - } - - } - - // 로그인 시킴 - if ($config->enable_confirm != 'Y') $this->doLogin($args->user_id); - - // 결과 정리 - $this->add('member_srl', $args->member_srl); - if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); - if ($config->enable_confirm == 'Y') { - $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); - $this->setMessage($msg); - } - else $this->setMessage('success_registed'); - - // after 트리거 호출 - $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); - if(!$trigger_output->toBool()) return $trigger_output; - } - - /** - * @brief 회원 정보 수정 - **/ - function procMemberModifyInfo() { - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - - // 필수 정보들을 미리 추출 - $args = Context::gets('user_name','nick_name','homepage','blog','birthday','email_address','allow_mailing','find_account_question','find_account_answer'); - - // 로그인 정보 - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - - // 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제 - $all_args = Context::getRequestVars(); - unset($all_args->module); - unset($all_args->act); - unset($all_args->is_admin); - unset($all_args->description); - unset($all_args->group_srl_list); - unset($all_args->body); - unset($all_args->accept_agreement); - unset($all_args->signature); - unset($all_args->_filter); - - // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력 - $extra_vars = delObjectVars($all_args, $args); - $args->extra_vars = serialize($extra_vars); - - // 멤버 모델 객체 생성 - $oMemberModel = &getModel('member'); - - // member_srl의 값에 따라 insert/update - $output = $this->updateMember($args); - if(!$output->toBool()) return $output; - - // 서명 저장 - $signature = Context::get('signature'); - $this->putSignature($args->member_srl, $signature); - - // user_id 에 따른 정보 가져옴 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); - - // 로그인 성공후 trigger 호출 (after) - $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $member_info); - if(!$trigger_output->toBool()) return $trigger_output; - - $this->setSessionInfo($member_info); - - // 결과 리턴 - $this->add('member_srl', $args->member_srl); - $this->setMessage('success_updated'); - } - - /** - * @brief 회원 비밀번호 수정 - **/ - function procMemberModifyPassword() { - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - - // 필수 정보들을 미리 추출 - $current_password = trim(Context::get('current_password')); - $password = trim(Context::get('password')); - - // 로그인한 유저의 정보를 가져옴 - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - // member model 객체 생성 - $oMemberModel = &getModel('member'); - - // member_srl 에 따른 정보 가져옴 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - - // 현재 비밀번호가 맞는지 확인 - if(!$oMemberModel->isValidPassword($member_info->password, $current_password)) return new Object(-1, 'invalid_password'); - - // 이전 비밀번호와 같은지 확인 - if ($current_password == $password) return new Object(-1, 'invalid_new_password'); - - // member_srl의 값에 따라 insert/update - $args->member_srl = $member_srl; - $args->password = $password; - $output = $this->updateMemberPassword($args); - if(!$output->toBool()) return $output; - - $this->add('member_srl', $args->member_srl); - $this->setMessage('success_updated'); - } - - /** - * @brief 탈퇴 - **/ - function procMemberLeave() { - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - - // 필수 정보들을 미리 추출 - $password = trim(Context::get('password')); - - // 로그인한 유저의 정보를 가져옴 - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - // member model 객체 생성 - $oMemberModel = &getModel('member'); - - // member_srl 에 따른 정보 가져옴 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - - // 현재 비밀번호가 맞는지 확인 - if(!$oMemberModel->isValidPassword($member_info->password, $password)) return new Object(-1, 'invalid_password'); - - $output = $this->deleteMember($member_srl); - if(!$output->toBool()) return $output; - - // 모든 세션 정보 파기 - $this->destroySessionInfo(); - - // 성공 메세지 리턴 - $this->setMessage('success_leaved'); - } - - /** - * @brief 오픈아이디 탈퇴 - **/ - function procMemberOpenIDLeave() { - // 비로그인 상태이면 에러 - if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); - - // 현재 ip와 세션 아이피 비교 - if($_SESSION['ipaddress']!=$_SERVER['REMOTE_ADDR']) return $this->stop('msg_not_permitted'); - - // 로그인한 유저의 정보를 가져옴 - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - $output = $this->deleteMember($member_srl); - if(!$output->toBool()) return $output; - - // 모든 세션 정보 파기 - $this->destroySessionInfo(); - - // 성공 메세지 리턴 - $this->setMessage('success_leaved'); - } - - /** - * @brief 프로필 이미지 추가 - **/ - function procMemberInsertProfileImage() { - // 정상적으로 업로드 된 파일인지 검사 - $file = $_FILES['profile_image']; - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); - - // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시 - $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; - $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']); - - // 페이지 리프레쉬 - $this->setRefreshPage(); - } - - function insertProfileImage($member_srl, $target_file) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - - // 정해진 사이즈를 구함 - $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"; - - // 저장할 위치 구함 - $target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl)); - FileHandler::makeDir($target_path); - - // 파일 정보 구함 - 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가 아니면 변환 - 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 이미지 이름을 추가 - **/ - function procMemberInsertImageName() { - // 정상적으로 업로드 된 파일인지 검사 - $file = $_FILES['image_name']; - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); - - // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시 - $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; - $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']); - - // 페이지 리프레쉬 - $this->setRefreshPage(); - } - - function insertImageName($member_srl, $target_file) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - - // 정해진 사이즈를 구함 - $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"; - - // 저장할 위치 구함 - $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); - - // 파일 정보 구함 - list($width, $height, $type, $attrs) = @getimagesize($target_file); - - // 지정된 사이즈보다 크거나 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 프로필 이미지를 삭제 - **/ - function procMemberDeleteProfileImage() { - $member_srl = Context::get('member_srl'); - if(!$member_srl) return new Object(0,'success'); - - $logged_info = Context::get('logged_info'); - - if($logged_info->is_admin != 'Y') { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - if($config->profile_image == 'N') return new Object(0,'success'); - } - - if($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl) { - $oMemberModel = &getModel('member'); - $profile_image = $oMemberModel->getProfileImage($member_srl); - FileHandler::removeFile($profile_image->file); - } - return new Object(0,'success'); - } - - /** - * @brief 이미지 이름을 삭제 - **/ - function procMemberDeleteImageName() { - $member_srl = Context::get('member_srl'); - if(!$member_srl) return new Object(0,'success'); - - $logged_info = Context::get('logged_info'); - - if($logged_info->is_admin != 'Y') { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - if($config->image_name == 'N') return new Object(0,'success'); - } - - if($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl) { - $oMemberModel = &getModel('member'); - $image_name = $oMemberModel->getImageName($member_srl); - FileHandler::removeFile($image_name->file); - } - return new Object(0,'success'); - } - - /** - * @brief 이미지 마크를 추가 - **/ - function procMemberInsertImageMark() { - // 정상적으로 업로드 된 파일인지 검사 - $file = $_FILES['image_mark']; - if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); - - // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시 - $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; - $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']); - - // 페이지 리프레쉬 - $this->setRefreshPage(); - } - - function insertImageMark($member_srl, $target_file) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - - // 정해진 사이즈를 구함 - $max_width = $config->image_mark_max_width; - if(!$max_width) $max_width = "20"; - $max_height = $config->image_mark_max_height; - if(!$max_height) $max_height = "20"; - - $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); - FileHandler::makeDir($target_path); - - $target_filename = sprintf('%s%d.gif', $target_path, $member_srl); - - // 파일 정보 구함 - 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'); - else @copy($target_file, $target_filename); - - } - - /** - * @brief 이미지 마크를 삭제 - **/ - function procMemberDeleteImageMark() { - $member_srl = Context::get('member_srl'); - if(!$member_srl) return new Object(0,'success'); - - $logged_info = Context::get('logged_info'); - if($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl) { - $oMemberModel = &getModel('member'); - $image_mark = $oMemberModel->getImageMark($member_srl); - FileHandler::removeFile($image_mark->file); - } - return new Object(0,'success'); - } - - /** - * @brief 아이디/ 비밀번호 찾기 - **/ - function procMemberFindAccount() { - $email_address = Context::get('email_address'); - if(!$email_address) return new Object(-1, 'msg_invalid_request'); - - $oMemberModel = &getModel('member'); - $oModuleModel = &getModel('module'); - - // 메일 주소에 해당하는 회원이 있는지 검사 - $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); - if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); - - // 회원의 정보를 가져옴 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - - // 아이디/비밀번호 찾기가 가능한 상태의 회원인지 검사 - 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에 데이터를 넣음 - $args->user_id = $member_info->user_id; - $args->member_srl = $member_info->member_srl; - $args->new_password = rand(111111,999999); - $args->auth_key = md5( rand(0,999999 ) ); - $args->is_register = 'N'; - - $output = executeQuery('member.insertAuthMail', $args); - if(!$output->toBool()) return $output; - - // 메일 내용을 구함 - Context::set('auth_args', $args); - Context::set('member_info', $member_info); - - $member_config = $oModuleModel->getModuleConfig('member'); - if(!$member_config->skin) $member_config->skin = "default"; - if(!$member_config->colorset) $member_config->colorset = "white"; - - Context::set('member_config', $member_config); - - $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); - - $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); - Context::set('find_url', $find_url); - - $oTemplate = &TemplateHandler::getInstance(); - $content = $oTemplate->compile($tpl_path, 'find_member_account_mail'); - - // 사이트 웹마스터 정보를 구함 - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - - // 메일 발송 - $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 - $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); - return new Object(0,$msg); - } - - - /** - * @brief 질문/답변을 통한 임시 비밀번호 생성 - **/ - function procMemberFindAccountByQuestion() { - $email_address = Context::get('email_address'); - $user_id = Context::get('user_id'); - $find_account_question = trim(Context::get('find_account_question')); - $find_account_answer = trim(Context::get('find_account_answer')); - - if(!$user_id || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request'); - - $oMemberModel = &getModel('member'); - $oModuleModel = &getModel('module'); - - // 메일 주소에 해당하는 회원이 있는지 검사 - $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); - if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); - - // 회원의 정보를 가져옴 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - - // 질문 응답이 없으면 - 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로 설정 - $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); - - $args->password = $temp_password; - $args->change_password_date = '1'; - $output = $this->updateMemberPassword($args); - if(!$output->toBool()) return $output; - - $_SESSION['xe_temp_password_'.$user_id] = $temp_password; - - $this->add('user_id',$user_id); - } - - /** - * @brief 아이디/비밀번호 찾기 기능 실행 - * 메일에 등록된 링크를 선택시 호출되는 method로 비밀번호를 바꾸고 인증을 시켜버림 - **/ - function procMemberAuthAccount() { - // user_id, 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로 비밀번호 찾기 로그 검사 - $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 ($output->data->is_register == 'Y') { - $args->password = $output->data->new_password; - $args->denied = 'N'; - } else { - $args->password = md5($output->data->new_password); - unset($args->denied); - } - - // $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에 해당하는 모든 값을 지움 - executeQuery('member.deleteAuthMail',$args); - - // 결과를 통보 - Context::set('is_register', $is_register); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('msg_success_authed'); - } - - /** - * @brief 아이디/비밀번호 찾기 기능 실행 - * 메일에 등록된 링크를 선택시 호출되는 method로 비밀번호를 바꾸고 인증을 시켜버림 - **/ - function procMemberUpdateAuthMail() { - $member_srl = Context::get('member_srl'); - if(!$member_srl) return new Object(-1, 'msg_invalid_request'); - - $oMemberModel = &getModel('member'); - - // 회원의 정보를 가져옴 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - - // 인증메일 재발송 요청이 가능한 상태의 회원인지 검사 - 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에 데이터를 넣음 - $auth_args->member_srl = $member_srl; - $auth_args->auth_key = md5(rand(0, 999999)); - - $output = executeQuery('member.updateAuthMail', $auth_args); - if (!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 메일 내용을 구함 - Context::set('auth_args', $auth_args); - Context::set('member_info', $member_info); - - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - if(!$member_config->skin) $member_config->skin = "default"; - if(!$member_config->colorset) $member_config->colorset = "white"; - - Context::set('member_config', $member_config); - - $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); - - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); - Context::set('auth_url', $auth_url); - - $oTemplate = &TemplateHandler::getInstance(); - $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); - - // 사이트 웹마스터 정보를 구함 - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - - // 메일 발송 - $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 - $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); - return new Object(-1, $msg); - } - - /** - * @brief 인증 메일 재발송 - **/ - function procMemberResendAuthMail() { - // email_address 검사 - $email_address = Context::get('email_address'); - if(!$email_address) return $this->stop('msg_invalid_request'); - - // email_address로 비밀번호 찾기 로그 검사 - $oMemberModel = &getModel('member'); - - $args->email_address = $email_address; - $member_info = $oMemberModel->getMemberSrlByEmailAddress($email_address); - if(!$member_info) return $this->stop('msg_not_exists_member'); - - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_info); - - // 이전에 인증 메일을 보냈는지 확인 - $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'); - - $auth_args->member_srl = $member_info->member_srl; - $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]; - - // 메일 내용을 구함 - Context::set('member_info', $member_info); - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - if(!$member_config->skin) $member_config->skin = "default"; - if(!$member_config->colorset) $member_config->colorset = "white"; - - Context::set('member_config', $member_config); - - $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); - - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); - Context::set('auth_url', $auth_url); - - $oTemplate = &TemplateHandler::getInstance(); - $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); - - // 사이트 웹마스터 정보를 구함 - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - - // 메일 발송 - $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( $args->user_name, $args->email_address ); - $oMail->send(); - - $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); - $this->setMessage($msg); - } - - /** - * @brief 가상 사이트 가입 - **/ - function procModuleSiteSignUp() { - $site_module_info = Context::get('site_module_info'); - $logged_info = Context::get('logged_info'); - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); - - $oMemberModel = &getModel('member'); - $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl); - $this->addMemberToGroup($logged_info->member_srl, $default_group->group_srl, $site_module_info->site_srl); - $groups[$default_group->group_srl] = $default_group->title; - $logged_info->group_list = $groups; - } - - /** - * @brief 가상 사이트 탈퇴 - **/ - function procModuleSiteLeave() { - $site_module_info = Context::get('site_module_info'); - $logged_info = Context::get('logged_info'); - if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); - - $args->site_srl= $site_module_info->site_srl; - $args->member_srl = $logged_info->member_srl; - $output = executeQuery('member.deleteMembersGroup', $args); - if(!$output->toBool()) return $output; - $this->setMessage('success_deleted'); - } - - /** - * @brief 회원 설정 정보를 저장 - **/ - function setMemberConfig($args) { - if(!$args->skin) $args->skin = "default"; - if(!$args->colorset) $args->colorset = "white"; - if(!$args->editor_skin) $args->editor_skin= "xpresseditor"; - if(!$args->editor_colorset) $args->editor_colorset = "white"; - if($args->enable_join!='Y') $args->enable_join = 'N'; - if($args->enable_openid!='Y') $args->enable_openid= 'N'; - if($args->profile_image !='Y') $args->profile_image = 'N'; - if($args->image_name!='Y') $args->image_name = 'N'; - if($args->image_mark!='Y') $args->image_mark = 'N'; - if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; - if(!trim(strip_tags($args->agreement))) $args->agreement = null; - $args->limit_day = (int)$args->limit_day; - - $agreement = trim($args->agreement); - unset($args->agreement); - - $oModuleController = &getController('module'); - $output = $oModuleController->insertModuleConfig('member',$args); - if(!$output->toBool()) return $output; - - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; - FileHandler::writeFile($agreement_file, $agreement); - - return new Object(); - } - - /** - * @brief 서명을 파일로 저장 - **/ - function putSignature($member_srl, $signature) { - $signature = trim(removeHackTag($signature)); - $signature = preg_replace('/<(\/?)(embed|object|param)/is', '<$1$2', $signature); - - $check_signature = trim(str_replace(array(' ',"\n","\r"),'',strip_tags($signature,''))); - $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); - $filename = sprintf('%s%d.signature.php', $path, $member_srl); - - if(!$check_signature) return FileHandler::removeFile($filename); - - $buff = sprintf('%s', $signature); - FileHandler::makeDir($path); - FileHandler::writeFile($filename, $buff); - } - - /** - * @brief 서명 파일 삭제 - **/ - function delSignature($member_srl) { - $filename = sprintf('files/member_extra_info/signature/%s%d.gif', getNumberingPath($member_srl), $member_srl); - FileHandler::removeFile($filename); - } - - /** - * @brief member_srl에 group_srl을 추가 - **/ - function addMemberToGroup($member_srl,$group_srl,$site_srl=0) { - $args->member_srl = $member_srl; - $args->group_srl = $group_srl; - if($site_srl) $args->site_srl = $site_srl; - - $oModel =& getModel('member'); - $groups = $oModel->getMemberGroups($member_srl, $site_srl, true); - if($groups[$group_srl]) return new Object(); - - // 추가 - $output = executeQuery('member.addMemberToGroup',$args); - $output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args); - - return $output; - } - - /** - * @brief 특정 회원들의 그룹을 일괄 변경 - * 가상 사이트와 같이 한 회원이 하나의 그룹만 가질 경우 사용할 수 있음 - **/ - function replaceMemberGroup($args) { - $obj->site_srl = $args->site_srl; - $obj->member_srl = implode(',',$args->member_srl); - - $output = executeQueryArray('member.getMembersGroup', $obj); - if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; - - $output = executeQuery('member.deleteMembersGroup', $obj); - if(!$output->toBool()) return $output; - - $inserted_members = array(); - foreach($args->member_srl as $key => $val) { - if($inserted_members[$val]) continue; - $inserted_members[$val] = true; - - unset($obj); - $obj->member_srl = $val; - $obj->group_srl = $args->group_srl; - $obj->site_srl = $args->site_srl; - $obj->regdate = $date[$obj->member_srl]; - $output = executeQuery('member.addMemberToGroup', $obj); - if(!$output->toBool()) return $output; - } - return new Object(); - } - - - /** - * @brief 자동 로그인 시킴 - **/ - function doAutologin() { - // 자동 로그인 키 값을 구함 - $args->autologin_key = $_COOKIE['xeak']; - - // 키값에 해당하는 정보 구함 - $output = executeQuery('member.getAutologin', $args); - - // 정보가 없으면 쿠키 삭제 - if(!$output->toBool() || !$output->data) { - setCookie('xeak',null,time()+60*60*24*365, '/'); - return; - } - - $user_id = $output->data->user_id; - $password = $output->data->password; - if(!$user_id || !$password) { - setCookie('xeak',null,time()+60*60*24*365, '/'); - return; - } - - $do_auto_login = false; - - // 정보를 바탕으로 키값 비교 - $key = md5($user_id.$password.$_SERVER['REMOTE_ADDR']); - - if($key == $args->autologin_key) { - - // 설정된 change_password_date 확인 - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - $limit_date = $member_config->change_password_date; - - // change_password_date가 설정되어 있으면 확인 - if($limit_date > 0) { - $oMemberModel = &getModel('member'); - $member_info = $oMemberModel->getMemberInfoByUserID($user_id); - - if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){ - $do_auto_login = true; - } - - } else { - $do_auto_login = true; - } - } - - - if($do_auto_login) { - $output = $this->doLogin($user_id); - } else { - executeQuery('member.deleteAutologin', $args); - setCookie('xeak',null,time()+60*60*24*365, '/'); - } - } - - /** - * @brief 로그인 시킴 - **/ - function doLogin($user_id, $password = '', $keep_signed = false) { - $user_id = strtolower($user_id); - - // 로그인 이전에 trigger 호출 (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 객체 생성 - $oMemberModel = &getModel('member'); - - // user_id 에 따른 정보 가져옴 - $member_info = $oMemberModel->getMemberInfoByUserID($user_id); - - // return 값이 없으면 존재하지 않는 사용자로 지정 - if(!$user_id || strtolower($member_info->user_id) != strtolower($user_id)) return new Object(-1, 'invalid_user_id'); - - // 비밀번호 검사 - if($password && !$oMemberModel->isValidPassword($member_info->password, $password)) return new Object(-1, 'invalid_password'); - - // denied == 'Y' 이면 알림 - 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가 현 시간보다 적으면 알림 - 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"))); - - // 사용자 정보의 최근 로그인 시간을 기록 - $args->member_srl = $member_info->member_srl; - $output = executeQuery('member.updateLastLogin', $args); - - // 로그인 성공후 trigger 호출 (after) - $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $member_info); - if(!$trigger_output->toBool()) return $trigger_output; - - // 자동 로그인 사용시 정보 처리 - if($keep_signed) { - // 자동 로그인 키 생성 - $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); - $autologin_output = executeQuery('member.insertAutologin', $autologin_args); - if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, time()+60*60*24*365, '/'); - } - - $this->setSessionInfo($member_info); - - return $output; - } - - /** - * @brief 세션 정보 갱싱 또는 생성 - **/ - function setSessionInfo($member_info = null) { - $oMemberModel = &getModel('member'); - - // 사용자 정보가 넘어오지 않았다면 현재 세션 정보에서 사용자 정보를 추출 - if(!$member_info && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) { - $member_info = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']); - - // 회원정보가 없다면 세션 파기 - if($member_info->member_srl != $_SESSION['member_srl']) { - $this->destroySessionInfo(); - return; - } - } - - // 사용중지 아이디이면 세션 파기 - if($member_info->denied=='Y') { - $this->destroySessionInfo(); - return; - } - - // 오픈아이디인지 체크 (일단 아이디 형식으로만 결정) - if(preg_match("/^([_0-9a-zA-Z]+)$/is", $member_info->user_id)) $member_info->is_openid = false; - else $member_info->is_openid = true; - - // 로그인 처리를 위한 세션 설정 - $_SESSION['is_logged'] = true; - $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; - $_SESSION['member_srl'] = $member_info->member_srl; - $_SESSION['is_admin'] = ''; - - // 비밀번호는 세션에 저장되지 않도록 지워줌;; - //unset($member_info->password); - - // 사용자 그룹 설정 - /* - if($member_info->group_list) { - $group_srl_list = array_keys($member_info->group_list); - $_SESSION['group_srls'] = $group_srl_list; - - // 관리자 그룹일 경우 관리자로 지정 - $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'; - } - */ - - // 세션에 로그인 사용자 정보 저장 - $_SESSION['logged_info'] = $member_info; - Context::set('is_logged', true); - Context::set('logged_info', $member_info); - - // 사용자의 전용 메뉴 구성 (이 메뉴는 애드온등으로 변경될 수 있음) - $this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info'); - $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); - $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); - $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); - } - - /** - * @brief 로그인한 사용자의 개인화된 메뉴 제공을 위한 method - * 로그인 정보 출력 위젯 또는 개인화 페이지에서 사용됨 - **/ - function addMemberMenu($act, $str) { - $logged_info = Context::get('logged_info'); - - $logged_info->menu_list[$act] = Context::getLang($str); - - Context::set('logged_info', $logged_info); - $_SESSION['logged_info'] = $logged_info; - } - - /** - * @brief 로그인 회원의 닉네임등을 클릭할때 나타나는 팝업 메뉴를 추가하는 method - **/ - function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') { - $member_popup_menu_list = Context::get('member_popup_menu_list'); - if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); - - $obj->url = $url; - $obj->str = $str; - $obj->icon = $icon; - $obj->target = $target; - $member_popup_menu_list[] = $obj; - - Context::set('member_popup_menu_list', $member_popup_menu_list); - } - - /** - * @brief member 테이블에 사용자 추가 - **/ - function insertMember(&$args, $password_is_hashed = false) { - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); - if(!$output->toBool()) return $output; - - // 멤버 설정 정보에서 가입약관 부분을 재확인 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - - $logged_info = Context::get('logged_info'); - - // 임시 제한 일자가 있을 경우 제한 일자에 내용 추가 - if($config->limit_day) $args->limit_date = date("YmdHis", time()+$config->limit_day*60*60*24); - - // 입력할 사용자의 아이디를 소문자로 변경 - $args->user_id = strtolower($args->user_id); - - // 필수 변수들의 조절 - if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; - if($args->denied!='Y') $args->denied = 'N'; - $args->allow_message= 'Y'; - - if($logged_info->is_admin == 'Y') { - if($args->is_admin!='Y') $args->is_admin = 'N'; - } else { - unset($args->is_admin); - } - - list($args->email_id, $args->email_host) = explode('@', $args->email_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; - - // 모델 객체 생성 - $oMemberModel = &getModel('member'); - // 금지 아이디인지 체크 - if($oMemberModel->isDeniedID($args->user_id)) return new Object(-1,'denied_user_id'); - - // 아이디, 닉네임, email address 의 중복 체크 - $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); - if($member_srl) return new Object(-1,'msg_exists_user_id'); - - $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); - if($member_srl) return new Object(-1,'msg_exists_nick_name'); - - $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); - if($member_srl) return new Object(-1,'msg_exists_email_address'); - - $oDB = &DB::getInstance(); - $oDB->begin(); - - // DB에 입력 - $args->member_srl = getNextSequence(); - $args->list_order = -1 * $args->member_srl; - if($args->password && !$password_is_hashed) $args->password = md5($args->password); - elseif(!$args->password) unset($args->password); - - $output = executeQuery('member.insertMember', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 입력된 그룹 값이 없으면 기본 그룹의 값을 등록 - if(!$args->group_srl_list) { - $default_group = $oMemberModel->getDefaultGroup(0); - - // 기본 그룹에 추가 - $output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 입력된 그룹 값이 있으면 해당 그룹의 값을 등록 - } else { - $group_srl_list = explode('|@|', $args->group_srl_list); - for($i=0;$iaddMemberToGroup($args->member_srl,$group_srl_list[$i]); - - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - } - } - - // 메일 인증 모드 사용시(가입된 회원이 denied일 때) 인증 메일 발송 - if ($args->denied == 'Y') { - // 인증 DB에 데이터를 넣음 - $auth_args->user_id = $args->user_id; - $auth_args->member_srl = $args->member_srl; - $auth_args->new_password = $args->password; - $auth_args->auth_key = md5(rand(0, 999999)); - $auth_args->is_register = 'Y'; - - $output = executeQuery('member.insertAuthMail', $auth_args); - if (!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 메일 내용을 구함 - Context::set('auth_args', $auth_args); - Context::set('member_info', $args); - - $member_config = $oModuleModel->getModuleConfig('member'); - if(!$member_config->skin) $member_config->skin = "default"; - if(!$member_config->colorset) $member_config->colorset = "white"; - - Context::set('member_config', $member_config); - - $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); - if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); - - $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$args->member_srl, 'auth_key',$auth_args->auth_key); - Context::set('auth_url', $auth_url); - - $oTemplate = &TemplateHandler::getInstance(); - $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); - - // 사이트 웹마스터 정보를 구함 - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - - // 메일 발송 - $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( $args->user_name, $args->email_address ); - $oMail->send(); - } - - // trigger 호출 (after) - if($output->toBool()) { - $trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args); - if(!$trigger_output->toBool()) { - $oDB->rollback(); - return $trigger_output; - } - } - - $oDB->commit(true); - - $output->add('member_srl', $args->member_srl); - return $output; - } - - /** - * @brief member 정보 수정 - **/ - function updateMember($args) { - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); - if(!$output->toBool()) return $output; - - // 모델 객체 생성 - $oMemberModel = &getModel('member'); - - $logged_info = Context::get('logged_info'); - - // 수정하려는 대상의 원래 정보 가져오기 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); - if(!$args->user_id) $args->user_id = $member_info->user_id; - - // 필수 변수들의 조절 - 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'; - - if($logged_info->is_admin == 'Y') { - if($args->denied!='Y') $args->denied = 'N'; - if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; - } else { - unset($args->is_admin); - unset($args->denied); - } - - list($args->email_id, $args->email_host) = explode('@', $args->email_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 의 중복 체크 - $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); - if($member_srl&&$args->member_srl!=$member_srl) return new Object(-1,'msg_exists_user_id'); - - $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); - if($member_srl&&$args->member_srl!=$member_srl) return new Object(-1,'msg_exists_nick_name'); - - $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); - if($member_srl&&$args->member_srl!=$member_srl) return new Object(-1,'msg_exists_email_address'); - - $oDB = &DB::getInstance(); - $oDB->begin(); - - // DB에 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; - - if(!$args->description) $args->description = ''; - $output = executeQuery('member.updateMember', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 그룹 정보가 있으면 그룹 정보를 변경 - if($args->group_srl_list) { - $group_srl_list = explode('|@|', $args->group_srl_list); - $args->site_srl = 0; - - // 일단 해당 회원의 모든 그룹 정보를 삭제 - $output = executeQuery('member.deleteMemberGroupMember', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 하나 하나 루프를 돌면서 입력 - for($i=0;$iaddMemberToGroup($args->member_srl,$group_srl_list[$i]); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - } - } - - // trigger 호출 (after) - if($output->toBool()) { - $trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args); - if(!$trigger_output->toBool()) { - $oDB->rollback(); - return $trigger_output; - } - } - - $oDB->commit(); - - // 세션에 저장 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); - - $logged_info = Context::get('logged_info'); - if($logged_info->member_srl == $member_srl) { - $_SESSION['logged_info'] = $member_info; - } - - $output->add('member_srl', $args->member_srl); - return $output; - } - - /** - * @brief member 비밀번호 수정 - **/ - function updateMemberPassword($args) { - $output = executeQuery('member.updateChangePasswordDate', $args); - $args->password = md5($args->password); - return executeQuery('member.updateMemberPassword', $args); - } - - /** - * @brief 사용자 삭제 - **/ - function deleteMember($member_srl) { - // trigger 호출 (before) - $trigger_obj->member_srl = $member_srl; - $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); - if(!$output->toBool()) return $output; - - // 모델 객체 생성 - $oMemberModel = &getModel('member'); - - // 해당 사용자의 정보를 가져옴 - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - if(!$member_info) return new Object(-1, 'msg_not_exists_member'); - - // 관리자의 경우 삭제 불가능 - 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에서 해당 항목들 삭제 - $output = executeQuery('member.deleteAuthMail', $args); - if (!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // member_openid에서 해당 항목들 삭제 - $output = executeQuery('member.deleteMemberOpenIDByMemberSrl', $ags); - - // TODO: 테이블 업그레이드를 하지 않은 경우에 실패할 수 있다. - /* - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - */ - - // member_group_member에서 해당 항목들 삭제 - $output = executeQuery('member.deleteMemberGroupMember', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // member 테이블에서 삭제 - $output = executeQuery('member.deleteMember', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // trigger 호출 (after) - if($output->toBool()) { - $trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj); - if(!$trigger_output->toBool()) { - $oDB->rollback(); - return $trigger_output; - } - } - - $oDB->commit(); - - // 이름이미지, 이미지마크, 서명 삭제 - $this->procMemberDeleteImageName(); - $this->procMemberDeleteImageMark(); - $this->delSignature($member_srl); - - return $output; - } - - /** - * @brief 모든 세션 정보 파기 - **/ - function destroySessionInfo() { - if(!$_SESSION || !is_array($_SESSION)) return; - foreach($_SESSION as $key => $val) { - $_SESSION[$key] = ''; - } - session_destroy(); - setcookie(session_name(), '', time()-42000, '/'); - setcookie('sso','',time()-42000, '/'); - - if($_COOKIE['xeak']) { - $args->autologin_key = $_COOKIE['xeak']; - executeQuery('member.deleteAutologin', $args); - } - } - } -?> +doLogin($user_id, $password, $keep_signed=='Y'?true:false); + + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + if($config->after_login_url) $this->setRedirectUrl($config->after_login_url); + + // 설정된 change_password_date 확인 + $limit_date = $config->change_password_date; + + // change_password_date가 설정되어 있으면 확인 + if ($limit_date > 0) { + $oMemberModel = &getModel('member'); + $member_info = $oMemberModel->getMemberInfoByUserID($user_id); + if ($member_info->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day'))) { + $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword')); + } + } + + $redirect_url = Context::get('redirect_url'); + if ($output->toBool () && Context::getRequestMethod () == "POST" && $redirect_url) { + header ("location:" . $redirect_url); + } + + return $output; + } + + /** + * @brief openid로그인 + **/ + function procMemberOpenIDLogin($validator = "procMemberOpenIDValidate") { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + if($config->enable_openid != 'Y') $this->stop('msg_invalid_request'); + + if(!defined('Auth_OpenID_RAND_SOURCE') && !file_exists("/dev/urandom")) + { + define('Auth_OpenID_RAND_SOURCE', null); + } + + set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3"); + require_once('Auth/OpenID.php'); + require_once('Auth/OpenID/Consumer.php'); + require_once('Auth/OpenID/XEStore.php'); + $store = new Auth_OpenID_XEStore(); + $consumer = new Auth_OpenID_Consumer($store); + + $user_id = Context::get('user_id'); + if (!$user_id) $user_id = Context::get('openid'); + $auth_request = $consumer->begin($user_id); + $auth_request->addExtensionArg('sreg', 'required', 'email'); + $auth_request->addExtensionArg('sreg', 'optional', 'dob'); + if(!$auth_request) + { + return new Object(-1, "association failed"); + } + + $trust_root = 'http://'.$_SERVER["HTTP_HOST"]; + $referer_url = Context::get('referer_url'); + if (!$referer_url) $referer_url = $_SERVER['HTTP_REFERER']; + if (!$referer_url) + $referer_url = htmlspecialchars_decode(getRequestUri(RELEASE_SSL)); + $goto = urlencode($referer_url); + $ApprovedURL = Context::getRequestUri(RELEASE_SSL) . "?module=member&act=" . $validator. "&goto=" . $goto; + $redirect_url = $auth_request->redirectURL($trust_root, $ApprovedURL); + $this->add("redirect_url", $redirect_url); + if (Context::getRequestMethod() == 'POST') + header("location:" . $redirect_url); + } + + function getLegacyUserIDsFromOpenID($openid_identity) { + // Issue 17515512: workaround + $result = array(); + $uri_matches = array(); + preg_match(Auth_OpenID_getURIPattern(), $openid_identity, $uri_matches); + + if (count($uri_matches) < 9) { + for ($i = count($uri_matches); $i <= 9; $i++) { + $uri_matches[] = ''; + } + } + + $scheme = $uri_matches[2]; + $authority = $uri_matches[4]; + $path = $uri_matches[5]; + $query = $uri_matches[6]; + $fragment = $uri_matches[8]; + + if ($scheme === null) $scheme = ''; + if ($authority === null) $authority = ''; + if ($path === null) $path = ''; + if ($query === null) $query = ''; + if ($fragment === null) $fragment = ''; + + if ($scheme == 'http' or $scheme == '') + $scheme_part = ''; + else + $scheme_part = $scheme."://"; + + + if ($path == '' || $path == '/') { + $result[] = $scheme_part.$authority.''.$query.$fragment; + $result[] = $scheme_part.$authority.'/'.$query.$fragment; + } + else { + $result[] = $scheme_part.$authority.$path.$query.$fragment; + } + + return $result; + } + + /** + * @brief openid 인증 체크 + **/ + function procMemberOpenIDValidate() { + set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3"); + require_once('Auth/OpenID.php'); + require_once('Auth/OpenID/Consumer.php'); + require_once('Auth/OpenID/XEStore.php'); + require_once('Auth/OpenID/URINorm.php'); + + $store = new Auth_OpenID_XEStore(); + $consumer = new Auth_OpenID_Consumer($store); + $response = $consumer->complete($_GET); + switch($response->status) { + case Auth_OpenID_CANCEL : + // 사용자가 인증을 취소했을 때의 처리 + return $this->stop('authorization_canceled'); + case Auth_OpenID_FAILURE : + // 무언가의 문제로 인해 인증이 실패했을 때의 처리(인증을 요구한 openid가 없다든가..) + return $this->stop('invalid_authorization'); + case Auth_OpenID_SUCCESS : + // 인증성공!! + break; + default: + return $this->stop('invalid_authorization'); + } + + // 인증 성공 + $oMemberModel = &getModel('member'); + + // 이 오픈아이디와 연결된 (또는 연결되어 있을 가능성이 있는) 제로보드 아이디들을 받아온다. + $login_success = false; + $assoc_member_info = null; + $openid_identity = $response->signed_args["openid.identity"]; + $args->openid = $openid_identity; + $output = executeQuery('member.getMemberSrlByOpenID', $args); + + if ($output->toBool() && $output->data && !is_array($output->data)) { + $member_srl = $output->data->member_srl; + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + if ($member_info) { + $assoc_member_info = $member_info; + } + } + + $user_id_candidates = $this->getLegacyUserIDsFromOpenID($openid_identity); + $default_user_id = $user_id_candidates[0]; + + if ($assoc_member_info != null) { + $user_id_candidates = array_merge(array($assoc_member_info->user_id), $user_id_candidates); + } + $sreg = $response->extensionResponse('sreg'); + + foreach($user_id_candidates as $user_id) { + $args->user_id = $args->nick_name = $user_id; + // 기본 정보들을 받음 + $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']); + + // 자체 인증 시도 + $output = $this->doLogin($args->user_id); + + if ($output->toBool()) { + if ($assoc_member_info == null) { + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + $args->openid = $openid_identity; + executeQuery('member.addOpenIDToMember', $args); + } + $login_success = true; + break; + } + } + + // 자체 인증 실패시 회원 가입시킴 + if(!$login_success) { + $args->user_id = $args->nick_name = $default_user_id; + $args->password = md5(getmicrotime()); + + $output = $this->insertMember($args); + if(!$output->toBool()) return $this->stop($output->getMessage()); + $output = $this->doLogin($args->user_id); + if(!$output->toBool()) return $this->stop($output->getMessage()); + + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + $args->openid = $openid_identity; + executeQuery('member.addOpenIDToMember', $args); + } + + Context::close(); + + // 페이지 이동 + if(Context::get('goto')) { + $goto = Context::get('goto'); + header("location:" . $goto); + } else { + header("location:./"); + } + + exit(); + } + + /** + * @brief 오픈아이디 연결 요청 + **/ + function procMemberAddOpenIDToMember() { + return $this->procMemberOpenIDLogin("procMemberValidateAddOpenIDToMember"); + } + + /** + * @brief 오픈아이디 연결 요청 마무리 + **/ + function procMemberValidateAddOpenIDToMember() { + set_include_path(_XE_PATH_."modules/member/php-openid-1.2.3"); + require_once('Auth/OpenID.php'); + require_once('Auth/OpenID/Consumer.php'); + require_once('Auth/OpenID/XEStore.php'); + require_once('Auth/OpenID/URINorm.php'); + + $store = new Auth_OpenID_XEStore(); + $consumer = new Auth_OpenID_Consumer($store); + $response = $consumer->complete($_GET); + + switch($response->status) { + case Auth_OpenID_CANCEL : + // 사용자가 인증을 취소했을 때의 처리 + return $this->stop('authorization_canceled'); + case Auth_OpenID_FAILURE : + // 무언가의 문제로 인해 인증이 실패했을 때의 처리(인증을 요구한 openid가 없다든가..) + return $this->stop('invalid_authorization'); + case Auth_OpenID_SUCCESS : + { + $logged_info = Context::get('logged_info'); + if (!Context::get('is_logged')) return $this->stop('msg_not_logged'); + + $member_srl = $logged_info->member_srl; + + $args->member_srl = $member_srl; + $openid_identity = $response->signed_args["openid.identity"]; + $args->openid = $openid_identity; + + $output = executeQuery('member.addOpenIDToMember', $args); + if (!$output->toBool()) return $output; + + Context::close(); + + if(Context::get('goto')){ + $goto = Context::get('goto'); + header("location:" . $goto); + }else{ + header("location:./"); + } + exit(); + } + // 인증성공!! + break; + default: + return $this->stop('invalid_authorization'); + } + } + + /** + * @brief 오픈아이디 연결 해제 + **/ + function procMemberDeleteOpenIDFromMember() { + $logged_info = Context::get('logged_info'); + $openid_identity = Context::get('openid_to_delete'); + $arg->openid = $openid_identity; + $result = executeQuery('member.getMemberSrlByOpenID', $arg); + + if (!Context::get('is_logged')) { + $this->setError(-1); + $this->setMessage('msg_not_logged'); + return; + } else if (!$result->data || is_array($result->data)) { + $this->setError(-1); + $this->setMessage('msg_not_founded'); + return; + } else if ($result->data->member_srl != $logged_info->member_srl) { + $this->setError(-1); + $this->setMessage('msg_not_permitted'); + return; + } + + $arg->openid = $openid_identity; + + $output = executeQuery('member.deleteMemberOpenID', $arg); + if(!$output->toBool()) return $output; + + $this->setMessage('success_updated'); + } + + + /** + * @brief 로그아웃 + **/ + function procMemberLogout() { + // 로그아웃 이전에 trigger 호출 (before) + $logged_info = Context::get('logged_info'); + $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'before', $logged_info); + if(!$trigger_output->toBool()) return $trigger_output; + + // 세션 정보 파기 + $this->destroySessionInfo(); + + // 로그아웃 이후 trigger 호출 (after) + $trigger_output = ModuleHandler::triggerCall('member.doLogout', 'after', $logged_info); + if(!$trigger_output->toBool()) return $trigger_output; + + $output = new Object(); + + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + if($config->after_logout_url) Context::set('redirect_url', $config->after_logout_url); + + return $output; + } + + /** + * @brief 스크랩 기능 + **/ + function procMemberScrapDocument() { + // 로그인 정보 체크 + 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'); + + // 문서 가져오기 + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + + // 변수 정리 + $args->document_srl = $document_srl; + $args->member_srl = $logged_info->member_srl; + $args->user_id = $oDocument->get('user_id'); + $args->user_name = $oDocument->get('user_name'); + $args->nick_name = $oDocument->get('nick_name'); + $args->target_member_srl = $oDocument->get('member_srl'); + $args->title = $oDocument->get('title'); + + // 있는지 조사 + $output = executeQuery('member.getScrapDocument', $args); + if($output->data->count) return new Object(-1, 'msg_alreay_scrapped'); + + // 입력 + $output = executeQuery('member.addScrapDocument', $args); + if(!$output->toBool()) return $output; + + $this->setError(-1); + $this->setMessage('success_registed'); + } + + /** + * @brief 스크랩 삭제 + **/ + function procMemberDeleteScrap() { + // 로그인 정보 체크 + 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'); + + // 변수 정리 + $args->member_srl = $logged_info->member_srl; + $args->document_srl = $document_srl; + return executeQuery('member.deleteScrapDocument', $args); + } + + /** + * @brief 게시글 저장 + **/ + function procMemberSaveDocument() { + // 로그인 정보 체크 + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged'); + + $logged_info = Context::get('logged_info'); + + // form 정보를 모두 받음 + $obj = Context::getRequestVars(); + + // 글의 대상 모듈을 회원 정보로 변경 + $obj->module_srl = $logged_info->member_srl; + unset($obj->is_notice); + + // 제목을 사용하지 않는 방명록 등에서 내용 앞 부분을 제목 가져오기 + if(!$obj->title) { + $obj->title = cut_str(strip_tags($obj->content), 20, '...'); + } + + $oDocumentModel = &getModel('document'); + $oDocumentController = &getController('document'); + + // 이미 존재하는 글인지 체크 + $oDocument = $oDocumentModel->getDocument($obj->document_srl, $this->grant->manager); + + // 이미 존재하는 경우 수정 + if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) { + $output = $oDocumentController->updateDocument($oDocument, $obj); + $msg_code = 'success_updated'; + + // 그렇지 않으면 신규 등록 + } 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); + } + + // 등록된 첨부파일의 상태를 무효로 지정 + if($oDocument->hasUploadedFiles()) { + $args->upload_target_srl = $oDocument->document_srl; + $args->isvalid = 'N'; + executeQuery('file.updateFileValid', $args); + } + + $this->setMessage('success_saved'); + $this->add('document_srl', $obj->document_srl); + } + + /** + * @brief 저장된 글 삭제 + **/ + function procMemberDeleteSavedDocument() { + // 로그인 정보 체크 + 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'); + + // 변수 정리 + $oDocumentController = &getController('document'); + $oDocumentController->deleteDocument($document_srl, true); + } + + /** + * @brief 회원 가입시 특정 항목들에 대한 값 체크 + **/ + function procMemberCheckValue() { + $name = Context::get('name'); + $value = Context::get('value'); + if(!$value) return; + + $oMemberModel = &getModel('member'); + + // 로그인 여부 체크 + $logged_info = Context::get('logged_info'); + + + switch($name) { + case 'user_id' : + // 금지 아이디 검사 + if($oMemberModel->isDeniedID($value)) return new Object(0,'denied_user_id'); + + // 중복 검사 + $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' : + // 중복 검사 + $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' : + // 중복 검사 + $member_srl = $oMemberModel->getMemberSrlByEmailAddress($value); + if($member_srl && $logged_info->member_srl != $member_srl ) return new Object(0,'msg_exists_email_address'); + break; + } + } + + /** + * @brief 회원 가입 + **/ + function procMemberInsert() { + if (Context::getRequestMethod () == "GET") return new Object (-1, "msg_invalid_request"); + $oMemberModel = &getModel ('member'); + $config = $oMemberModel->getMemberConfig (); + + // before 트리거 호출 + $trigger_output = ModuleHandler::triggerCall ('member.procMemberInsert', 'before', $config); + if (!$trigger_output->toBool ()) return $trigger_output; + + // 관리자가 회원가입을 허락하였는지 검사 + if ($config->enable_join != 'Y') return $this->stop ('msg_signup_disabled'); + + // 약관에 동의하였는지 검사 (약관이 있을 경우만) + if ($config->agreement && Context::get('accept_agreement')!='Y') return $this->stop('msg_accept_agreement'); + + // 필수 정보들을 미리 추출 + $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; + + // 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제 + $all_args = Context::getRequestVars(); + unset($all_args->module); + unset($all_args->act); + unset($all_args->is_admin); + unset($all_args->description); + unset($all_args->group_srl_list); + unset($all_args->body); + unset($all_args->accept_agreement); + unset($all_args->signature); + unset($all_args->password2); + + // 메일 인증 기능 사용시 회원 상태를 denied로 설정 + if ($config->enable_confirm == 'Y') $args->denied = 'Y'; + + // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력 + $extra_vars = delObjectVars($all_args, $args); + $args->extra_vars = serialize($extra_vars); + + // member_srl의 값에 따라 insert/update + $output = $this->insertMember($args); + if(!$output->toBool()) return $output; + + // 가상사이트일 경우 사이트 가입 + $site_module_info = Context::get('site_module_info'); + if($site_module_info->site_srl > 0) { + $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl); + if($default_group->group_srl) { + $this->addMemberToGroup($args->member_srl, $default_group->group_srl, $site_module_info->site_srl); + } + + } + + // 로그인 시킴 + if ($config->enable_confirm != 'Y') $this->doLogin($args->user_id); + + // 결과 정리 + $this->add('member_srl', $args->member_srl); + if($config->redirect_url) $this->add('redirect_url', $config->redirect_url); + if ($config->enable_confirm == 'Y') { + $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); + $this->setMessage($msg); + } + else $this->setMessage('success_registed'); + + // after 트리거 호출 + $trigger_output = ModuleHandler::triggerCall('member.procMemberInsert', 'after', $config); + if(!$trigger_output->toBool()) return $trigger_output; + } + + /** + * @brief 회원 정보 수정 + **/ + function procMemberModifyInfo() { + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + + // 필수 정보들을 미리 추출 + $args = Context::gets('user_name','nick_name','homepage','blog','birthday','email_address','allow_mailing','find_account_question','find_account_answer'); + + // 로그인 정보 + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + + // 넘어온 모든 변수중에서 몇가지 불필요한 것들 삭제 + $all_args = Context::getRequestVars(); + unset($all_args->module); + unset($all_args->act); + unset($all_args->is_admin); + unset($all_args->description); + unset($all_args->group_srl_list); + unset($all_args->body); + unset($all_args->accept_agreement); + unset($all_args->signature); + unset($all_args->_filter); + + // 모든 request argument에서 필수 정보만 제외 한 후 추가 데이터로 입력 + $extra_vars = delObjectVars($all_args, $args); + $args->extra_vars = serialize($extra_vars); + + // 멤버 모델 객체 생성 + $oMemberModel = &getModel('member'); + + // member_srl의 값에 따라 insert/update + $output = $this->updateMember($args); + if(!$output->toBool()) return $output; + + // 서명 저장 + $signature = Context::get('signature'); + $this->putSignature($args->member_srl, $signature); + + // user_id 에 따른 정보 가져옴 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); + + // 로그인 성공후 trigger 호출 (after) + $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $member_info); + if(!$trigger_output->toBool()) return $trigger_output; + + $this->setSessionInfo($member_info); + + // 결과 리턴 + $this->add('member_srl', $args->member_srl); + $this->setMessage('success_updated'); + } + + /** + * @brief 회원 비밀번호 수정 + **/ + function procMemberModifyPassword() { + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + + // 필수 정보들을 미리 추출 + $current_password = trim(Context::get('current_password')); + $password = trim(Context::get('password')); + + // 로그인한 유저의 정보를 가져옴 + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + // member model 객체 생성 + $oMemberModel = &getModel('member'); + + // member_srl 에 따른 정보 가져옴 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + + // 현재 비밀번호가 맞는지 확인 + if(!$oMemberModel->isValidPassword($member_info->password, $current_password)) return new Object(-1, 'invalid_password'); + + // 이전 비밀번호와 같은지 확인 + if ($current_password == $password) return new Object(-1, 'invalid_new_password'); + + // member_srl의 값에 따라 insert/update + $args->member_srl = $member_srl; + $args->password = $password; + $output = $this->updateMemberPassword($args); + if(!$output->toBool()) return $output; + + $this->add('member_srl', $args->member_srl); + $this->setMessage('success_updated'); + } + + /** + * @brief 탈퇴 + **/ + function procMemberLeave() { + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + + // 필수 정보들을 미리 추출 + $password = trim(Context::get('password')); + + // 로그인한 유저의 정보를 가져옴 + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + // member model 객체 생성 + $oMemberModel = &getModel('member'); + + // member_srl 에 따른 정보 가져옴 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + + // 현재 비밀번호가 맞는지 확인 + if(!$oMemberModel->isValidPassword($member_info->password, $password)) return new Object(-1, 'invalid_password'); + + $output = $this->deleteMember($member_srl); + if(!$output->toBool()) return $output; + + // 모든 세션 정보 파기 + $this->destroySessionInfo(); + + // 성공 메세지 리턴 + $this->setMessage('success_leaved'); + } + + /** + * @brief 오픈아이디 탈퇴 + **/ + function procMemberOpenIDLeave() { + // 비로그인 상태이면 에러 + if(!Context::get('is_logged')) return $this->stop('msg_not_logged'); + + // 현재 ip와 세션 아이피 비교 + if($_SESSION['ipaddress']!=$_SERVER['REMOTE_ADDR']) return $this->stop('msg_not_permitted'); + + // 로그인한 유저의 정보를 가져옴 + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + $output = $this->deleteMember($member_srl); + if(!$output->toBool()) return $output; + + // 모든 세션 정보 파기 + $this->destroySessionInfo(); + + // 성공 메세지 리턴 + $this->setMessage('success_leaved'); + } + + /** + * @brief 프로필 이미지 추가 + **/ + function procMemberInsertProfileImage() { + // 정상적으로 업로드 된 파일인지 검사 + $file = $_FILES['profile_image']; + if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_profile_image'); + + // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시 + $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; + $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']); + + // 페이지 리프레쉬 + $this->setRefreshPage(); + } + + function insertProfileImage($member_srl, $target_file) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + + // 정해진 사이즈를 구함 + $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"; + + // 저장할 위치 구함 + $target_path = sprintf('files/member_extra_info/profile_image/%s', getNumberingPath($member_srl)); + FileHandler::makeDir($target_path); + + // 파일 정보 구함 + 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가 아니면 변환 + 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 이미지 이름을 추가 + **/ + function procMemberInsertImageName() { + // 정상적으로 업로드 된 파일인지 검사 + $file = $_FILES['image_name']; + if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_name'); + + // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시 + $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; + $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']); + + // 페이지 리프레쉬 + $this->setRefreshPage(); + } + + function insertImageName($member_srl, $target_file) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + + // 정해진 사이즈를 구함 + $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"; + + // 저장할 위치 구함 + $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); + + // 파일 정보 구함 + list($width, $height, $type, $attrs) = @getimagesize($target_file); + + // 지정된 사이즈보다 크거나 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 프로필 이미지를 삭제 + **/ + function procMemberDeleteProfileImage() { + $member_srl = Context::get('member_srl'); + if(!$member_srl) return new Object(0,'success'); + + $logged_info = Context::get('logged_info'); + + if($logged_info->is_admin != 'Y') { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + if($config->profile_image == 'N') return new Object(0,'success'); + } + + if($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl) { + $oMemberModel = &getModel('member'); + $profile_image = $oMemberModel->getProfileImage($member_srl); + FileHandler::removeFile($profile_image->file); + } + return new Object(0,'success'); + } + + /** + * @brief 이미지 이름을 삭제 + **/ + function procMemberDeleteImageName() { + $member_srl = Context::get('member_srl'); + if(!$member_srl) return new Object(0,'success'); + + $logged_info = Context::get('logged_info'); + + if($logged_info->is_admin != 'Y') { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + if($config->image_name == 'N') return new Object(0,'success'); + } + + if($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl) { + $oMemberModel = &getModel('member'); + $image_name = $oMemberModel->getImageName($member_srl); + FileHandler::removeFile($image_name->file); + } + return new Object(0,'success'); + } + + /** + * @brief 이미지 마크를 추가 + **/ + function procMemberInsertImageMark() { + // 정상적으로 업로드 된 파일인지 검사 + $file = $_FILES['image_mark']; + if(!is_uploaded_file($file['tmp_name'])) return $this->stop('msg_not_uploaded_image_mark'); + + // 회원 정보를 검사해서 회원번호가 없거나 관리자가 아니고 회원번호가 틀리면 무시 + $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; + $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']); + + // 페이지 리프레쉬 + $this->setRefreshPage(); + } + + function insertImageMark($member_srl, $target_file) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + + // 정해진 사이즈를 구함 + $max_width = $config->image_mark_max_width; + if(!$max_width) $max_width = "20"; + $max_height = $config->image_mark_max_height; + if(!$max_height) $max_height = "20"; + + $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($member_srl)); + FileHandler::makeDir($target_path); + + $target_filename = sprintf('%s%d.gif', $target_path, $member_srl); + + // 파일 정보 구함 + 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'); + else @copy($target_file, $target_filename); + + } + + /** + * @brief 이미지 마크를 삭제 + **/ + function procMemberDeleteImageMark() { + $member_srl = Context::get('member_srl'); + if(!$member_srl) return new Object(0,'success'); + + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin == 'Y' || $logged_info->member_srl == $member_srl) { + $oMemberModel = &getModel('member'); + $image_mark = $oMemberModel->getImageMark($member_srl); + FileHandler::removeFile($image_mark->file); + } + return new Object(0,'success'); + } + + /** + * @brief 아이디/ 비밀번호 찾기 + **/ + function procMemberFindAccount() { + $email_address = Context::get('email_address'); + if(!$email_address) return new Object(-1, 'msg_invalid_request'); + + $oMemberModel = &getModel('member'); + $oModuleModel = &getModel('module'); + + // 메일 주소에 해당하는 회원이 있는지 검사 + $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); + if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); + + // 회원의 정보를 가져옴 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + + // 아이디/비밀번호 찾기가 가능한 상태의 회원인지 검사 + 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에 데이터를 넣음 + $args->user_id = $member_info->user_id; + $args->member_srl = $member_info->member_srl; + $args->new_password = rand(111111,999999); + $args->auth_key = md5( rand(0,999999 ) ); + $args->is_register = 'N'; + + $output = executeQuery('member.insertAuthMail', $args); + if(!$output->toBool()) return $output; + + // 메일 내용을 구함 + Context::set('auth_args', $args); + Context::set('member_info', $member_info); + + $member_config = $oModuleModel->getModuleConfig('member'); + if(!$member_config->skin) $member_config->skin = "default"; + if(!$member_config->colorset) $member_config->colorset = "white"; + + Context::set('member_config', $member_config); + + $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); + if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); + + $find_url = getFullUrl ('', 'module', 'member', 'act', 'procMemberAuthAccount', 'member_srl', $member_info->member_srl, 'auth_key', $args->auth_key); + Context::set('find_url', $find_url); + + $oTemplate = &TemplateHandler::getInstance(); + $content = $oTemplate->compile($tpl_path, 'find_member_account_mail'); + + // 사이트 웹마스터 정보를 구함 + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + + // 메일 발송 + $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 + $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); + return new Object(0,$msg); + } + + + /** + * @brief 질문/답변을 통한 임시 비밀번호 생성 + **/ + function procMemberFindAccountByQuestion() { + $email_address = Context::get('email_address'); + $user_id = Context::get('user_id'); + $find_account_question = trim(Context::get('find_account_question')); + $find_account_answer = trim(Context::get('find_account_answer')); + + if(!$user_id || !$email_address || !$find_account_question || !$find_account_answer) return new Object(-1, 'msg_invalid_request'); + + $oMemberModel = &getModel('member'); + $oModuleModel = &getModel('module'); + + // 메일 주소에 해당하는 회원이 있는지 검사 + $member_srl = $oMemberModel->getMemberSrlByEmailAddress($email_address); + if(!$member_srl) return new Object(-1, 'msg_email_not_exists'); + + // 회원의 정보를 가져옴 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + + // 질문 응답이 없으면 + 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로 설정 + $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); + + $args->password = $temp_password; + $args->change_password_date = '1'; + $output = $this->updateMemberPassword($args); + if(!$output->toBool()) return $output; + + $_SESSION['xe_temp_password_'.$user_id] = $temp_password; + + $this->add('user_id',$user_id); + } + + /** + * @brief 아이디/비밀번호 찾기 기능 실행 + * 메일에 등록된 링크를 선택시 호출되는 method로 비밀번호를 바꾸고 인증을 시켜버림 + **/ + function procMemberAuthAccount() { + // user_id, 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로 비밀번호 찾기 로그 검사 + $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 ($output->data->is_register == 'Y') { + $args->password = $output->data->new_password; + $args->denied = 'N'; + } else { + $args->password = md5($output->data->new_password); + unset($args->denied); + } + + // $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에 해당하는 모든 값을 지움 + executeQuery('member.deleteAuthMail',$args); + + // 결과를 통보 + Context::set('is_register', $is_register); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('msg_success_authed'); + } + + /** + * @brief 아이디/비밀번호 찾기 기능 실행 + * 메일에 등록된 링크를 선택시 호출되는 method로 비밀번호를 바꾸고 인증을 시켜버림 + **/ + function procMemberUpdateAuthMail() { + $member_srl = Context::get('member_srl'); + if(!$member_srl) return new Object(-1, 'msg_invalid_request'); + + $oMemberModel = &getModel('member'); + + // 회원의 정보를 가져옴 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + + // 인증메일 재발송 요청이 가능한 상태의 회원인지 검사 + 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에 데이터를 넣음 + $auth_args->member_srl = $member_srl; + $auth_args->auth_key = md5(rand(0, 999999)); + + $output = executeQuery('member.updateAuthMail', $auth_args); + if (!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 메일 내용을 구함 + Context::set('auth_args', $auth_args); + Context::set('member_info', $member_info); + + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + if(!$member_config->skin) $member_config->skin = "default"; + if(!$member_config->colorset) $member_config->colorset = "white"; + + Context::set('member_config', $member_config); + + $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); + if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); + + $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_args->auth_key); + Context::set('auth_url', $auth_url); + + $oTemplate = &TemplateHandler::getInstance(); + $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); + + // 사이트 웹마스터 정보를 구함 + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + + // 메일 발송 + $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 + $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); + return new Object(-1, $msg); + } + + /** + * @brief 인증 메일 재발송 + **/ + function procMemberResendAuthMail() { + // email_address 검사 + $email_address = Context::get('email_address'); + if(!$email_address) return $this->stop('msg_invalid_request'); + + // email_address로 비밀번호 찾기 로그 검사 + $oMemberModel = &getModel('member'); + + $args->email_address = $email_address; + $member_info = $oMemberModel->getMemberSrlByEmailAddress($email_address); + if(!$member_info) return $this->stop('msg_not_exists_member'); + + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_info); + + // 이전에 인증 메일을 보냈는지 확인 + $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'); + + $auth_args->member_srl = $member_info->member_srl; + $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]; + + // 메일 내용을 구함 + Context::set('member_info', $member_info); + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + if(!$member_config->skin) $member_config->skin = "default"; + if(!$member_config->colorset) $member_config->colorset = "white"; + + Context::set('member_config', $member_config); + + $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); + if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); + + $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$member_info->member_srl, 'auth_key',$auth_info->auth_key); + Context::set('auth_url', $auth_url); + + $oTemplate = &TemplateHandler::getInstance(); + $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); + + // 사이트 웹마스터 정보를 구함 + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + + // 메일 발송 + $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( $args->user_name, $args->email_address ); + $oMail->send(); + + $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); + $this->setMessage($msg); + } + + /** + * @brief 가상 사이트 가입 + **/ + function procModuleSiteSignUp() { + $site_module_info = Context::get('site_module_info'); + $logged_info = Context::get('logged_info'); + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); + + $oMemberModel = &getModel('member'); + $default_group = $oMemberModel->getDefaultGroup($site_module_info->site_srl); + $this->addMemberToGroup($logged_info->member_srl, $default_group->group_srl, $site_module_info->site_srl); + $groups[$default_group->group_srl] = $default_group->title; + $logged_info->group_list = $groups; + } + + /** + * @brief 가상 사이트 탈퇴 + **/ + function procModuleSiteLeave() { + $site_module_info = Context::get('site_module_info'); + $logged_info = Context::get('logged_info'); + if(!$site_module_info->site_srl || !Context::get('is_logged') || count($logged_info->group_srl_list) ) return new Object(-1,'msg_invalid_request'); + + $args->site_srl= $site_module_info->site_srl; + $args->member_srl = $logged_info->member_srl; + $output = executeQuery('member.deleteMembersGroup', $args); + if(!$output->toBool()) return $output; + $this->setMessage('success_deleted'); + } + + /** + * @brief 회원 설정 정보를 저장 + **/ + function setMemberConfig($args) { + if(!$args->skin) $args->skin = "default"; + if(!$args->colorset) $args->colorset = "white"; + if(!$args->editor_skin) $args->editor_skin= "xpresseditor"; + if(!$args->editor_colorset) $args->editor_colorset = "white"; + if($args->enable_join!='Y') $args->enable_join = 'N'; + if($args->enable_openid!='Y') $args->enable_openid= 'N'; + if($args->profile_image !='Y') $args->profile_image = 'N'; + if($args->image_name!='Y') $args->image_name = 'N'; + if($args->image_mark!='Y') $args->image_mark = 'N'; + if($args->group_image_mark!='Y') $args->group_image_mark = 'N'; + if(!trim(strip_tags($args->agreement))) $args->agreement = null; + $args->limit_day = (int)$args->limit_day; + + $agreement = trim($args->agreement); + unset($args->agreement); + + $oModuleController = &getController('module'); + $output = $oModuleController->insertModuleConfig('member',$args); + if(!$output->toBool()) return $output; + + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; + FileHandler::writeFile($agreement_file, $agreement); + + return new Object(); + } + + /** + * @brief 서명을 파일로 저장 + **/ + function putSignature($member_srl, $signature) { + $signature = trim(removeHackTag($signature)); + $signature = preg_replace('/<(\/?)(embed|object|param)/is', '<$1$2', $signature); + + $check_signature = trim(str_replace(array(' ',"\n","\r"),'',strip_tags($signature,''))); + $path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($member_srl)); + $filename = sprintf('%s%d.signature.php', $path, $member_srl); + + if(!$check_signature) return FileHandler::removeFile($filename); + + $buff = sprintf('%s', $signature); + FileHandler::makeDir($path); + FileHandler::writeFile($filename, $buff); + } + + /** + * @brief 서명 파일 삭제 + **/ + function delSignature($member_srl) { + $filename = sprintf('files/member_extra_info/signature/%s%d.gif', getNumberingPath($member_srl), $member_srl); + FileHandler::removeFile($filename); + } + + /** + * @brief member_srl에 group_srl을 추가 + **/ + function addMemberToGroup($member_srl,$group_srl,$site_srl=0) { + $args->member_srl = $member_srl; + $args->group_srl = $group_srl; + if($site_srl) $args->site_srl = $site_srl; + + $oModel =& getModel('member'); + $groups = $oModel->getMemberGroups($member_srl, $site_srl, true); + if($groups[$group_srl]) return new Object(); + + // 추가 + $output = executeQuery('member.addMemberToGroup',$args); + $output2 = ModuleHandler::triggerCall('member.addMemberToGroup', 'after', $args); + + return $output; + } + + /** + * @brief 특정 회원들의 그룹을 일괄 변경 + * 가상 사이트와 같이 한 회원이 하나의 그룹만 가질 경우 사용할 수 있음 + **/ + function replaceMemberGroup($args) { + $obj->site_srl = $args->site_srl; + $obj->member_srl = implode(',',$args->member_srl); + + $output = executeQueryArray('member.getMembersGroup', $obj); + if($output->data) foreach($output->data as $key => $val) $date[$val->member_srl] = $val->regdate; + + $output = executeQuery('member.deleteMembersGroup', $obj); + if(!$output->toBool()) return $output; + + $inserted_members = array(); + foreach($args->member_srl as $key => $val) { + if($inserted_members[$val]) continue; + $inserted_members[$val] = true; + + unset($obj); + $obj->member_srl = $val; + $obj->group_srl = $args->group_srl; + $obj->site_srl = $args->site_srl; + $obj->regdate = $date[$obj->member_srl]; + $output = executeQuery('member.addMemberToGroup', $obj); + if(!$output->toBool()) return $output; + } + return new Object(); + } + + + /** + * @brief 자동 로그인 시킴 + **/ + function doAutologin() { + // 자동 로그인 키 값을 구함 + $args->autologin_key = $_COOKIE['xeak']; + + // 키값에 해당하는 정보 구함 + $output = executeQuery('member.getAutologin', $args); + + // 정보가 없으면 쿠키 삭제 + if(!$output->toBool() || !$output->data) { + setCookie('xeak',null,time()+60*60*24*365, '/'); + return; + } + + $user_id = $output->data->user_id; + $password = $output->data->password; + if(!$user_id || !$password) { + setCookie('xeak',null,time()+60*60*24*365, '/'); + return; + } + + $do_auto_login = false; + + // 정보를 바탕으로 키값 비교 + $key = md5($user_id.$password.$_SERVER['REMOTE_ADDR']); + + if($key == $args->autologin_key) { + + // 설정된 change_password_date 확인 + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + $limit_date = $member_config->change_password_date; + + // change_password_date가 설정되어 있으면 확인 + if($limit_date > 0) { + $oMemberModel = &getModel('member'); + $member_info = $oMemberModel->getMemberInfoByUserID($user_id); + + if($member_info->change_password_date >= date('YmdHis', strtotime('-'.$limit_date.' day')) ){ + $do_auto_login = true; + } + + } else { + $do_auto_login = true; + } + } + + + if($do_auto_login) { + $output = $this->doLogin($user_id); + } else { + executeQuery('member.deleteAutologin', $args); + setCookie('xeak',null,time()+60*60*24*365, '/'); + } + } + + /** + * @brief 로그인 시킴 + **/ + function doLogin($user_id, $password = '', $keep_signed = false) { + $user_id = strtolower($user_id); + + // 로그인 이전에 trigger 호출 (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 객체 생성 + $oMemberModel = &getModel('member'); + + // user_id 에 따른 정보 가져옴 + $member_info = $oMemberModel->getMemberInfoByUserID($user_id); + + // return 값이 없으면 존재하지 않는 사용자로 지정 + if(!$user_id || strtolower($member_info->user_id) != strtolower($user_id)) return new Object(-1, 'invalid_user_id'); + + // 비밀번호 검사 + if($password && !$oMemberModel->isValidPassword($member_info->password, $password)) return new Object(-1, 'invalid_password'); + + // denied == 'Y' 이면 알림 + 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가 현 시간보다 적으면 알림 + 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"))); + + // 사용자 정보의 최근 로그인 시간을 기록 + $args->member_srl = $member_info->member_srl; + $output = executeQuery('member.updateLastLogin', $args); + + // 로그인 성공후 trigger 호출 (after) + $trigger_output = ModuleHandler::triggerCall('member.doLogin', 'after', $member_info); + if(!$trigger_output->toBool()) return $trigger_output; + + // 자동 로그인 사용시 정보 처리 + if($keep_signed) { + // 자동 로그인 키 생성 + $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); + $autologin_output = executeQuery('member.insertAutologin', $autologin_args); + if($autologin_output->toBool()) setCookie('xeak',$autologin_args->autologin_key, time()+60*60*24*365, '/'); + } + + $this->setSessionInfo($member_info); + + return $output; + } + + /** + * @brief 세션 정보 갱싱 또는 생성 + **/ + function setSessionInfo($member_info = null) { + $oMemberModel = &getModel('member'); + + // 사용자 정보가 넘어오지 않았다면 현재 세션 정보에서 사용자 정보를 추출 + if(!$member_info && $_SESSION['member_srl'] && $oMemberModel->isLogged() ) { + $member_info = $oMemberModel->getMemberInfoByMemberSrl($_SESSION['member_srl']); + + // 회원정보가 없다면 세션 파기 + if($member_info->member_srl != $_SESSION['member_srl']) { + $this->destroySessionInfo(); + return; + } + } + + // 사용중지 아이디이면 세션 파기 + if($member_info->denied=='Y') { + $this->destroySessionInfo(); + return; + } + + // 오픈아이디인지 체크 (일단 아이디 형식으로만 결정) + if(preg_match("/^([_0-9a-zA-Z]+)$/is", $member_info->user_id)) $member_info->is_openid = false; + else $member_info->is_openid = true; + + // 로그인 처리를 위한 세션 설정 + $_SESSION['is_logged'] = true; + $_SESSION['ipaddress'] = $_SERVER['REMOTE_ADDR']; + $_SESSION['member_srl'] = $member_info->member_srl; + $_SESSION['is_admin'] = ''; + + // 비밀번호는 세션에 저장되지 않도록 지워줌;; + //unset($member_info->password); + + // 사용자 그룹 설정 + /* + if($member_info->group_list) { + $group_srl_list = array_keys($member_info->group_list); + $_SESSION['group_srls'] = $group_srl_list; + + // 관리자 그룹일 경우 관리자로 지정 + $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'; + } + */ + + // 세션에 로그인 사용자 정보 저장 + $_SESSION['logged_info'] = $member_info; + Context::set('is_logged', true); + Context::set('logged_info', $member_info); + + // 사용자의 전용 메뉴 구성 (이 메뉴는 애드온등으로 변경될 수 있음) + $this->addMemberMenu( 'dispMemberInfo', 'cmd_view_member_info'); + $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); + $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); + $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); + } + + /** + * @brief 로그인한 사용자의 개인화된 메뉴 제공을 위한 method + * 로그인 정보 출력 위젯 또는 개인화 페이지에서 사용됨 + **/ + function addMemberMenu($act, $str) { + $logged_info = Context::get('logged_info'); + + $logged_info->menu_list[$act] = Context::getLang($str); + + Context::set('logged_info', $logged_info); + $_SESSION['logged_info'] = $logged_info; + } + + /** + * @brief 로그인 회원의 닉네임등을 클릭할때 나타나는 팝업 메뉴를 추가하는 method + **/ + function addMemberPopupMenu($url, $str, $icon = '', $target = 'self') { + $member_popup_menu_list = Context::get('member_popup_menu_list'); + if(!is_array($member_popup_menu_list)) $member_popup_menu_list = array(); + + $obj->url = $url; + $obj->str = $str; + $obj->icon = $icon; + $obj->target = $target; + $member_popup_menu_list[] = $obj; + + Context::set('member_popup_menu_list', $member_popup_menu_list); + } + + /** + * @brief member 테이블에 사용자 추가 + **/ + function insertMember(&$args, $password_is_hashed = false) { + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); + if(!$output->toBool()) return $output; + + // 멤버 설정 정보에서 가입약관 부분을 재확인 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + + $logged_info = Context::get('logged_info'); + + // 임시 제한 일자가 있을 경우 제한 일자에 내용 추가 + if($config->limit_day) $args->limit_date = date("YmdHis", time()+$config->limit_day*60*60*24); + + // 입력할 사용자의 아이디를 소문자로 변경 + $args->user_id = strtolower($args->user_id); + + // 필수 변수들의 조절 + if($args->allow_mailing!='Y') $args->allow_mailing = 'N'; + if($args->denied!='Y') $args->denied = 'N'; + $args->allow_message= 'Y'; + + if($logged_info->is_admin == 'Y') { + if($args->is_admin!='Y') $args->is_admin = 'N'; + } else { + unset($args->is_admin); + } + + list($args->email_id, $args->email_host) = explode('@', $args->email_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; + + // 모델 객체 생성 + $oMemberModel = &getModel('member'); + // 금지 아이디인지 체크 + if($oMemberModel->isDeniedID($args->user_id)) return new Object(-1,'denied_user_id'); + + // 아이디, 닉네임, email address 의 중복 체크 + $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); + if($member_srl) return new Object(-1,'msg_exists_user_id'); + + $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); + if($member_srl) return new Object(-1,'msg_exists_nick_name'); + + $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); + if($member_srl) return new Object(-1,'msg_exists_email_address'); + + $oDB = &DB::getInstance(); + $oDB->begin(); + + // DB에 입력 + $args->member_srl = getNextSequence(); + $args->list_order = -1 * $args->member_srl; + if($args->password && !$password_is_hashed) $args->password = md5($args->password); + elseif(!$args->password) unset($args->password); + + $output = executeQuery('member.insertMember', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 입력된 그룹 값이 없으면 기본 그룹의 값을 등록 + if(!$args->group_srl_list) { + $default_group = $oMemberModel->getDefaultGroup(0); + + // 기본 그룹에 추가 + $output = $this->addMemberToGroup($args->member_srl,$default_group->group_srl); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 입력된 그룹 값이 있으면 해당 그룹의 값을 등록 + } else { + $group_srl_list = explode('|@|', $args->group_srl_list); + for($i=0;$iaddMemberToGroup($args->member_srl,$group_srl_list[$i]); + + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + } + } + + // 메일 인증 모드 사용시(가입된 회원이 denied일 때) 인증 메일 발송 + if ($args->denied == 'Y') { + // 인증 DB에 데이터를 넣음 + $auth_args->user_id = $args->user_id; + $auth_args->member_srl = $args->member_srl; + $auth_args->new_password = $args->password; + $auth_args->auth_key = md5(rand(0, 999999)); + $auth_args->is_register = 'Y'; + + $output = executeQuery('member.insertAuthMail', $auth_args); + if (!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 메일 내용을 구함 + Context::set('auth_args', $auth_args); + Context::set('member_info', $args); + + $member_config = $oModuleModel->getModuleConfig('member'); + if(!$member_config->skin) $member_config->skin = "default"; + if(!$member_config->colorset) $member_config->colorset = "white"; + + Context::set('member_config', $member_config); + + $tpl_path = sprintf('%sskins/%s', $this->module_path, $member_config->skin); + if(!is_dir($tpl_path)) $tpl_path = sprintf('%sskins/%s', $this->module_path, 'default'); + + $auth_url = getFullUrl('','module','member','act','procMemberAuthAccount','member_srl',$args->member_srl, 'auth_key',$auth_args->auth_key); + Context::set('auth_url', $auth_url); + + $oTemplate = &TemplateHandler::getInstance(); + $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); + + // 사이트 웹마스터 정보를 구함 + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + + // 메일 발송 + $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( $args->user_name, $args->email_address ); + $oMail->send(); + } + + // trigger 호출 (after) + if($output->toBool()) { + $trigger_output = ModuleHandler::triggerCall('member.insertMember', 'after', $args); + if(!$trigger_output->toBool()) { + $oDB->rollback(); + return $trigger_output; + } + } + + $oDB->commit(true); + + $output->add('member_srl', $args->member_srl); + return $output; + } + + /** + * @brief member 정보 수정 + **/ + function updateMember($args) { + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('member.updateMember', 'before', $args); + if(!$output->toBool()) return $output; + + // 모델 객체 생성 + $oMemberModel = &getModel('member'); + + $logged_info = Context::get('logged_info'); + + // 수정하려는 대상의 원래 정보 가져오기 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); + if(!$args->user_id) $args->user_id = $member_info->user_id; + + // 필수 변수들의 조절 + 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'; + + if($logged_info->is_admin == 'Y') { + if($args->denied!='Y') $args->denied = 'N'; + if($args->is_admin!='Y' && $logged_info->member_srl != $args->member_srl) $args->is_admin = 'N'; + } else { + unset($args->is_admin); + unset($args->denied); + } + + list($args->email_id, $args->email_host) = explode('@', $args->email_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 의 중복 체크 + $member_srl = $oMemberModel->getMemberSrlByUserID($args->user_id); + if($member_srl&&$args->member_srl!=$member_srl) return new Object(-1,'msg_exists_user_id'); + + $member_srl = $oMemberModel->getMemberSrlByNickName($args->nick_name); + if($member_srl&&$args->member_srl!=$member_srl) return new Object(-1,'msg_exists_nick_name'); + + $member_srl = $oMemberModel->getMemberSrlByEmailAddress($args->email_address); + if($member_srl&&$args->member_srl!=$member_srl) return new Object(-1,'msg_exists_email_address'); + + $oDB = &DB::getInstance(); + $oDB->begin(); + + // DB에 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; + + if(!$args->description) $args->description = ''; + $output = executeQuery('member.updateMember', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 그룹 정보가 있으면 그룹 정보를 변경 + if($args->group_srl_list) { + $group_srl_list = explode('|@|', $args->group_srl_list); + $args->site_srl = 0; + + // 일단 해당 회원의 모든 그룹 정보를 삭제 + $output = executeQuery('member.deleteMemberGroupMember', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 하나 하나 루프를 돌면서 입력 + for($i=0;$iaddMemberToGroup($args->member_srl,$group_srl_list[$i]); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + } + } + + // trigger 호출 (after) + if($output->toBool()) { + $trigger_output = ModuleHandler::triggerCall('member.updateMember', 'after', $args); + if(!$trigger_output->toBool()) { + $oDB->rollback(); + return $trigger_output; + } + } + + $oDB->commit(); + + // 세션에 저장 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->member_srl); + + $logged_info = Context::get('logged_info'); + if($logged_info->member_srl == $member_srl) { + $_SESSION['logged_info'] = $member_info; + } + + $output->add('member_srl', $args->member_srl); + return $output; + } + + /** + * @brief member 비밀번호 수정 + **/ + function updateMemberPassword($args) { + $output = executeQuery('member.updateChangePasswordDate', $args); + $args->password = md5($args->password); + return executeQuery('member.updateMemberPassword', $args); + } + + /** + * @brief 사용자 삭제 + **/ + function deleteMember($member_srl) { + // trigger 호출 (before) + $trigger_obj->member_srl = $member_srl; + $output = ModuleHandler::triggerCall('member.deleteMember', 'before', $trigger_obj); + if(!$output->toBool()) return $output; + + // 모델 객체 생성 + $oMemberModel = &getModel('member'); + + // 해당 사용자의 정보를 가져옴 + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + if(!$member_info) return new Object(-1, 'msg_not_exists_member'); + + // 관리자의 경우 삭제 불가능 + 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에서 해당 항목들 삭제 + $output = executeQuery('member.deleteAuthMail', $args); + if (!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // member_openid에서 해당 항목들 삭제 + $output = executeQuery('member.deleteMemberOpenIDByMemberSrl', $ags); + + // TODO: 테이블 업그레이드를 하지 않은 경우에 실패할 수 있다. + /* + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + */ + + // member_group_member에서 해당 항목들 삭제 + $output = executeQuery('member.deleteMemberGroupMember', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // member 테이블에서 삭제 + $output = executeQuery('member.deleteMember', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // trigger 호출 (after) + if($output->toBool()) { + $trigger_output = ModuleHandler::triggerCall('member.deleteMember', 'after', $trigger_obj); + if(!$trigger_output->toBool()) { + $oDB->rollback(); + return $trigger_output; + } + } + + $oDB->commit(); + + // 이름이미지, 이미지마크, 서명 삭제 + $this->procMemberDeleteImageName(); + $this->procMemberDeleteImageMark(); + $this->delSignature($member_srl); + + return $output; + } + + /** + * @brief 모든 세션 정보 파기 + **/ + function destroySessionInfo() { + if(!$_SESSION || !is_array($_SESSION)) return; + foreach($_SESSION as $key => $val) { + $_SESSION[$key] = ''; + } + session_destroy(); + setcookie(session_name(), '', time()-42000, '/'); + setcookie('sso','',time()-42000, '/'); + + if($_COOKIE['xeak']) { + $args->autologin_key = $_COOKIE['xeak']; + executeQuery('member.deleteAutologin', $args); + } + } + } +?> diff --git a/modules/member/member.model.php b/modules/member/member.model.php index c5670636c..e495cd87d 100644 --- a/modules/member/member.model.php +++ b/modules/member/member.model.php @@ -1,716 +1,716 @@ -getModuleConfig('member'); - - // 회원가입 약관 구함 - $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; - if(file_exists($agreement_file)) $config->agreement = FileHandler::readFile($agreement_file); - - if(!$config->webmaster_name) $config->webmaster_name = 'webmaster'; - if(!$config->image_name_max_width) $config->image_name_max_width = 90; - if(!$config->image_name_max_height) $config->image_name_max_height = 20; - if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; - if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; - if(!$config->profile_image_max_width) $config->profile_image_max_width = 80; - if(!$config->profile_image_max_height) $config->profile_image_max_height = 80; - if(!$config->skin) $config->skin = "default"; - if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = "xpresseditor"; - if(!$config->group_image_mark) $config->group_image_mark = "N"; - - return $config; - } - - /** - * @brief 선택된 회원의 간단한 메뉴를 표시 - **/ - function getMemberMenu() { - // 요청된 회원 번호와 현재 사용자의 로그인 정보 구함 - $member_srl = Context::get('target_srl'); - $mid = Context::get('cur_mid'); - $logged_info = Context::get('logged_info'); - $act = Context::get('cur_act'); - - // 자신의 아이디를 클릭한 경우 - if($member_srl == $logged_info->member_srl) $member_info = $logged_info; - - // 다른 사람의 아이디를 클릭한 경우 - else $member_info = $this->getMemberInfoByMemberSrl($member_srl); - - $member_srl = $member_info->member_srl; - if(!$member_srl) return; - - // 변수 정리 - $user_id = $member_info->user_id; - $user_name = $member_info->user_name; - - ModuleHandler::triggerCall('member.getMemberMenu', 'before', $null); - - $oMemberController = &getController('member'); - - // 회원 정보 보기 (비회원일 경우 볼 수 없도록 수정) - 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'); - } - - // 다른 사람의 아이디를 클릭한 경우 - if($member_srl != $logged_info->member_srl) { - - // 메일 보내기 - 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); - } - } - - // 홈페이지 보기 - if($member_info->homepage) - $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage), 'homepage', './modules/member/tpl/images/icon_homepage.gif','blank'); - - // 블로그 보기 - if($member_info->blog) - $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog), 'blog', './modules/member/tpl/images/icon_blog.gif','blank'); - - // trigger 호출 (after) - ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); - - // 최고 관리자라면 회원정보 수정 메뉴 만듬 - 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'; - $oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo'); - - $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl); - $icon_path = './modules/member/tpl/images/icon_trace_document.gif'; - $oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument'); - - $url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl); - $icon_path = './modules/member/tpl/images/icon_trace_comment.gif'; - $oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment'); - } - - // 팝업메뉴의 언어 변경 - $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); - } - - // 최종적으로 정리된 팝업메뉴 목록을 구함 - $this->add('menus', $menus); - } - - /** - * @brief 로그인 되어 있는지에 대한 체크 - **/ - function isLogged() { - if($_SESSION['is_logged']&&$_SESSION['ipaddress']==$_SERVER['REMOTE_ADDR']) return true; - - $_SESSION['is_logged'] = false; - $_SESSION['logged_info'] = ''; - return false; - } - - /** - * @brief 인증된 사용자의 정보 return - **/ - function getLoggedInfo() { - // 로그인 되어 있고 세션 정보를 요청하면 세션 정보를 return - if($this->isLogged()) { - $logged_info = $_SESSION['logged_info']; - - // 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변수를 추가 - $oModuleModel = &getModel('module'); - if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; - else $logged_info->is_site_admin = false; - } else { - // 만약 기본 사이트인데 회원 그룹이 존재하지 않으면 등록 - if(!count($logged_info->group_list)) { - $default_group = $this->getDefaultGroup(0); - $oMemberController = &getController('member'); - $oMemberController->addMemberToGroup($logged_info->member_srl, $default_group->group_srl, 0); - $groups[$default_group->group_srl] = $default_group->title; - $logged_info->group_list = $groups; - } - - $logged_info->is_site_admin = false; - } - - $_SESSION['logged_info'] = $logged_info; - - return $logged_info; - } - return NULL; - } - - /** - * @brief user_id에 해당하는 사용자 정보 return - **/ - function getMemberInfoByUserID($user_id) { - if(!$user_id) return; - - $args->user_id = $user_id; - $output = executeQuery('member.getMemberInfo', $args); - if(!$output->toBool()) return $output; - if(!$output->data) return; - - $member_info = $this->arrangeMemberInfo($output->data); - - return $member_info; - } - - /** - * @brief member_srl로 사용자 정보 return - **/ - function getMemberInfoByMemberSrl($member_srl, $site_srl = 0) { - if(!$member_srl) return; - - if(!$GLOBALS['__member_info__'][$member_srl]) { - $args->member_srl = $member_srl; - $output = executeQuery('member.getMemberInfoByMemberSrl', $args); - if(!$output->data) return; - - $this->arrangeMemberInfo($output->data, $site_srl); - } - - return $GLOBALS['__member_info__'][$member_srl]; - } - - /** - * @brief 사용자 정보 중 extra_vars와 기타 정보를 알맞게 편집 - **/ - function arrangeMemberInfo($info, $site_srl = 0) { - if(!$GLOBALS['__member_info__'][$info->member_srl]) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - - - $info->profile_image = $this->getProfileImage($info->member_srl); - $info->image_name = $this->getImageName($info->member_srl); - $info->image_mark = $this->getImageMark($info->member_srl); - if($config->group_image_mark=='Y'){ - $info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl); - } - $info->signature = $this->getSignature($info->member_srl); - $info->group_list = $this->getMemberGroups($info->member_srl, $site_srl); - - $extra_vars = unserialize($info->extra_vars); - unset($info->extra_vars); - if($extra_vars) { - foreach($extra_vars as $key => $val) { - if(preg_match('/\|\@\|/i', $val)) $val = explode('|@|', $val); - if(!$info->{$key}) $info->{$key} = $val; - } - } - - $GLOBALS['__member_info__'][$info->member_srl] = $info; - } - - return $GLOBALS['__member_info__'][$info->member_srl]; - } - - /** - * @brief userid에 해당하는 member_srl을 구함 - **/ - function getMemberSrlByUserID($user_id) { - $args->user_id = $user_id; - $output = executeQuery('member.getMemberSrl', $args); - return $output->data->member_srl; - } - - /** - * @brief EmailAddress에 해당하는 member_srl을 구함 - **/ - function getMemberSrlByEmailAddress($email_address) { - $args->email_address = $email_address; - $output = executeQuery('member.getMemberSrl', $args); - return $output->data->member_srl; - } - - /** - * @brief NickName에 해당하는 member_srl을 구함 - **/ - function getMemberSrlByNickName($nick_name) { - $args->nick_name = $nick_name; - $output = executeQuery('member.getMemberSrl', $args); - return $output->data->member_srl; - } - - /** - * @brief 현재 접속자의 member_srl을 return - **/ - function getLoggedMemberSrl() { - if(!$this->isLogged()) return; - return $_SESSION['member_srl']; - } - - /** - * @brief 현재 접속자의 user_id을 return - **/ - function getLoggedUserID() { - if(!$this->isLogged()) return; - $logged_info = $_SESSION['logged_info']; - return $logged_info->user_id; - } - - /** - * @brief member_srl이 속한 group 목록을 가져옴 - **/ - function getMemberGroups($member_srl, $site_srl = 0, $force_reload = false) { - static $member_groups = array(); - if(!$member_groups[$member_srl][$site_srl] || $force_reload) { - $args->member_srl = $member_srl; - $args->site_srl = $site_srl; - $output = executeQuery('member.getMemberGroups', $args); - if(!$output->data) return array(); - - $group_list = $output->data; - if(!is_array($group_list)) $group_list = array($group_list); - - foreach($group_list as $group) { - $result[$group->group_srl] = $group->title; - } - $member_groups[$member_srl][$site_srl] = $result; - } - return $member_groups[$member_srl][$site_srl]; - } - - /** - * @brief member_srl들이 속한 group 목록을 가져옴 - **/ - function getMembersGroups($member_srls, $site_srl = 0) { - $args->member_srls = implode(',',$member_srls); - $args->site_srl = $site_srl; - $output = executeQueryArray('member.getMembersGroups', $args); - if(!$output->data) return array(); - - $result = array(); - foreach($output->data as $key=>$val) { - $result[$val->member_srl][] = $val->title; - } - return $result; - } - - /** - * @brief 기본 그룹을 가져옴 - **/ - function getDefaultGroup($site_srl = 0) { - $args->site_srl = $site_srl; - $output = executeQuery('member.getDefaultGroup', $args); - return $output->data; - } - - /** - * @brief 관리자 그룹을 가져옴 - **/ - function getAdminGroup() { - $output = executeQuery('member.getAdminGroup'); - return $output->data; - } - - /** - * @brief group_srl에 해당하는 그룹 정보 가져옴 - **/ - function getGroup($group_srl) { - $args->group_srl = $group_srl; - $output = executeQuery('member.getGroup', $args); - return $output->data; - } - - /** - * @brief 그룹 목록을 가져옴 - **/ - function getGroups($site_srl = 0) { - if(!$GLOBALS['__group_info__'][$site_srl]) { - $args->site_srl = $site_srl; - $output = executeQuery('member.getGroups', $args); - if(!$output->data) return; - - $group_list = $output->data; - if(!is_array($group_list)) $group_list = array($group_list); - - foreach($group_list as $val) { - $result[$val->group_srl] = $val; - } - - $GLOBALS['__group_info__'][$site_srl] = $result; - } - return $GLOBALS['__group_info__'][$site_srl]; - } - - /** - * @brief 회원 가입폼 추가 확장 목록 가져오기 - * - * 이 메소드는 modules/member/tpl/filter/insert.xml 의 extend_filter로 동작을 한다. - * extend_filter로 사용을 하기 위해서는 인자값으로 boolean값을 받도록 규정한다. - * 이 인자값이 true일 경우 filter 타입에 맞는 형태의 object로 결과를 return하여야 한다. - **/ - function getJoinFormList($filter_response = false) { - global $lang; - - // 최고관리자는 무시하도록 설정 - $logged_info = Context::get('logged_info'); - - if(!$this->join_form_list) { - // list_order 컬럼의 정렬을 위한 인자 세팅 - $args->sort_index = "list_order"; - $output = executeQuery('member.getJoinFormList', $args); - - // 결과 데이터가 없으면 NULL return - $join_form_list = $output->data; - if(!$join_form_list) return NULL; - - // default_value의 경우 DB에 array가 serialize되어 입력되므로 unserialize가 필요 - 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++) { - $join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name); - - $member_join_form_srl = $join_form_list[$i]->member_join_form_srl; - $column_type = $join_form_list[$i]->column_type; - $column_name = $join_form_list[$i]->column_name; - $column_title = $join_form_list[$i]->column_title; - $default_value = $join_form_list[$i]->default_value; - - // 언어변수에 추가 - $lang->extend_vars[$column_name] = $column_title; - - // checkbox, select등 다수 데이터 형식일 경우 unserialize해줌 - 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 = ''; - } else { - $join_form_list[$i]->default_value = ''; - } - - $list[$member_join_form_srl] = $join_form_list[$i]; - } - $this->join_form_list = $list; - } - - // filter_response가 true일 경우 object 스타일을 구함 - if($filter_response && count($this->join_form_list)) { - - foreach($this->join_form_list as $key => $val) { - if($val->is_active != 'Y') continue; - unset($obj); - $obj->type = $val->column_type; - $obj->name = $val->column_name; - $obj->lang = $val->column_title; - if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; - else $obj->required = false; - $filter_output[] = $obj; - - unset($open_obj); - $open_obj->name = 'open_'.$val->column_name; - $open_obj->required = false; - $filter_output[] = $open_obj; - - } - return $filter_output; - - } - - // 결과 리턴 - return $this->join_form_list; - } - - /** - * @brief 추가 회원가입폼과 특정 회원의 정보를 조합 (회원정보 수정등에 사용) - **/ - function getCombineJoinForm($member_info) { - $extend_form_list = $this->getJoinFormlist(); - if(!$extend_form_list) return; - - // 관리자이거나 자기 자신이 아니면 비공개의 경우 무조건 패스해버림 - $logged_info = Context::get('logged_info'); - - foreach($extend_form_list as $srl => $item) { - $column_name = $item->column_name; - $value = $member_info->{$column_name}; - - if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_info->member_srl && $member_info->{'open_'.$column_name}!='Y') { - $extend_form_list[$srl]->is_private = true; - continue; - } - - // 추가 확장폼의 종류에 따라 값을 변경 - switch($item->column_type) { - case 'checkbox' : - if($value && !is_array($value)) $value = array($value); - break; - case 'text' : - case 'homepage' : - case 'email_address' : - case 'tel' : - case 'textarea' : - case 'select' : - case 'kr_zip' : - break; - } - - $extend_form_list[$srl]->value = $value; - - if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; - else $extend_form_list[$srl]->is_opened = false; - } - return $extend_form_list; - } - - /** - * @brief 한개의 가입항목을 가져옴 - **/ - function getJoinForm($member_join_form_srl) { - $args->member_join_form_srl = $member_join_form_srl; - $output = executeQuery('member.getJoinForm', $args); - $join_form = $output->data; - if(!$join_form) return NULL; - - $column_type = $join_form->column_type; - $default_value = $join_form->default_value; - - if(in_array($column_type, array('checkbox','select','radio'))) { - $join_form->default_value = unserialize($default_value); - } else { - $join_form->default_value = ''; - } - - return $join_form; - } - - /** - * @brief 금지 아이디 목록 가져오기 - **/ - function getDeniedIDList() { - if(!$this->denied_id_list) { - $args->sort_index = "list_order"; - $args->page = Context::get('page'); - $args->list_count = 40; - $args->page_count = 10; - - $output = executeQuery('member.getDeniedIDList', $args); - $this->denied_id_list = $output; - } - return $this->denied_id_list; - } - - /** - * @brief 금지 아이디인지 확인 - **/ - function isDeniedID($user_id) { - $args->user_id = $user_id; - $output = executeQuery('member.chkDeniedID', $args); - if($output->data->count) return true; - return false; - } - - /** - * @brief 프로필 이미지의 정보를 구함 - **/ - function getProfileImage($member_srl) { - if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) { - $GLOBALS['__member_info__']['profile_image'][$member_srl] = null; - $exts = array('gif','jpg','png'); - for($i=0;$i<3;$i++) { - $image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]); - if(file_exists($image_name_file)) { - list($width, $height, $type, $attrs) = getimagesize($image_name_file); - $info = null; - $info->width = $width; - $info->height = $height; - $info->src = Context::getRequestUri().$image_name_file; - $info->file = './'.$image_name_file; - $GLOBALS['__member_info__']['profile_image'][$member_srl] = $info; - break; - } - } - } - - return $GLOBALS['__member_info__']['profile_image'][$member_srl]; - } - - /** - * @brief 이미지이름의 정보를 구함 - **/ - function getImageName($member_srl) { - if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) { - $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); - if(file_exists($image_name_file)) { - list($width, $height, $type, $attrs) = getimagesize($image_name_file); - $info->width = $width; - $info->height = $height; - $info->src = Context::getRequestUri().$image_name_file; - $info->file = './'.$image_name_file; - $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; - } else $GLOBALS['__member_info__']['image_name'][$member_srl] = null; - } - return $GLOBALS['__member_info__']['image_name'][$member_srl]; - } - - /** - * @brief 이미지마크의 정보를 구함 - **/ - function getImageMark($member_srl) { - if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) { - $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); - if(file_exists($image_mark_file)) { - list($width, $height, $type, $attrs) = getimagesize($image_mark_file); - $info->width = $width; - $info->height = $height; - $info->src = Context::getRequestUri().$image_mark_file; - $info->file = './'.$image_mark_file; - $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; - } else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null; - } - - return $GLOBALS['__member_info__']['image_mark'][$member_srl]; - } - - - /** - * @brief group의 이미지마크 정보를 구함 - **/ - function getGroupImageMark($member_srl,$site_srl=0) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - if($config->group_image_mark!='Y'){ - return null; - } - $member_group = $this->getMemberGroups($member_srl,$site_srl); - - $groups_info = $this->getGroups($site_srl); - $image_mark = null; - if(count($member_group) > 0 && is_array($member_group)){ - $group_srl = array_keys($member_group); - $image_mark = $groups_info[$group_srl[0]]->image_mark; - } - if($image_mark){ -// list($width, $height, $type, $attrs) = getimagesize($image_mark); -// $info->width = $width; -// $info->height = $height; - $info->src = $image_mark; - return $info; - - }else return false; - } - - /** - * @brief 사용자의 signature를 구함 - **/ - function getSignature($member_srl) { - if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) { - $filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl); - if(file_exists($filename)) { - $buff = FileHandler::readFile($filename); - $signature = trim(substr($buff, 40)); - $GLOBALS['__member_info__']['signature'][$member_srl] = $signature; - } else $GLOBALS['__member_info__']['signature'][$member_srl] = null; - } - return $GLOBALS['__member_info__']['signature'][$member_srl]; - } - - /** - * @brief 입력된 plain text 비밀번호와 DB에 저장된 비밀번호와의 비교 - **/ - function isValidPassword($hashed_password, $password_text) { - // 입력된 비밀번호가 없으면 무조건 falase - if(!$password_text) return false; - - // md5 해쉬된값가 맞으면 return true - if($hashed_password == md5($password_text)) return true; - - // mysql_pre4_hash_password함수의 값과 동일하면 return true - if(mysql_pre4_hash_password($password_text) == $hashed_password) return true; - - // 현재 DB에서 mysql DB를 이용시 직접 old_password를 이용하여 검사하고 맞으면 비밀번호를 변경 - if(substr(Context::getDBType(),0,5)=='mysql') { - $oDB = &DB::getInstance(); - if($oDB->isValidOldPassword($password_text, $hashed_password)) return true; - } - - return false; - } - - /** - * @brief 멤버와 연결된 오픈아이디들을 모두 리턴한다. - **/ - function getMemberOpenIDByMemberSrl($member_srl) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - - $result = array(); - if ($config->enable_openid != 'Y') return $result; - - $args->member_srl = $member_srl; - $output = executeQuery('member.getMemberOpenIDByMemberSrl', $args); - - if (!$output->data) { - } - else if (is_array($output->data)) { - foreach($output->data as $row) { - $result[] = $row; - } - } - else { - $result[] = $output->data; - } - - foreach($result as $row) { - $openid = $row->openid; - $bookmarklet_header = "javascript:var%20U='"; - $bookmarklet_footer = "';function%20Z(W){var%20X=/(openid|ident)/i;try{var%20F=W.frames;var%20E=W.document.getElementsByTagName('input');for(var%20i=0;ibookmarklet = $bookmarklet_header . $openid . $bookmarklet_footer; - } - - return $result; - } - - /** - * @brief 오픈아이디에 연결된 멤버를 리턴한다. - **/ - function getMemberSrlByOpenID($openid) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); - - if ($config->enable_openid != 'Y') return $result; - - $args->member_srl = $member_srl; - $output = executeQuery('member.getMemberSrlByOpenID', $args); - - if (!$output->data) return null; - return $output->data->member_srl; - } - - } -?> +getModuleConfig('member'); + + // 회원가입 약관 구함 + $agreement_file = _XE_PATH_.'files/member_extra_info/agreement.txt'; + if(file_exists($agreement_file)) $config->agreement = FileHandler::readFile($agreement_file); + + if(!$config->webmaster_name) $config->webmaster_name = 'webmaster'; + if(!$config->image_name_max_width) $config->image_name_max_width = 90; + if(!$config->image_name_max_height) $config->image_name_max_height = 20; + if(!$config->image_mark_max_width) $config->image_mark_max_width = 20; + if(!$config->image_mark_max_height) $config->image_mark_max_height = 20; + if(!$config->profile_image_max_width) $config->profile_image_max_width = 80; + if(!$config->profile_image_max_height) $config->profile_image_max_height = 80; + if(!$config->skin) $config->skin = "default"; + if(!$config->editor_skin || $config->editor_skin == 'default') $config->editor_skin = "xpresseditor"; + if(!$config->group_image_mark) $config->group_image_mark = "N"; + + return $config; + } + + /** + * @brief 선택된 회원의 간단한 메뉴를 표시 + **/ + function getMemberMenu() { + // 요청된 회원 번호와 현재 사용자의 로그인 정보 구함 + $member_srl = Context::get('target_srl'); + $mid = Context::get('cur_mid'); + $logged_info = Context::get('logged_info'); + $act = Context::get('cur_act'); + + // 자신의 아이디를 클릭한 경우 + if($member_srl == $logged_info->member_srl) $member_info = $logged_info; + + // 다른 사람의 아이디를 클릭한 경우 + else $member_info = $this->getMemberInfoByMemberSrl($member_srl); + + $member_srl = $member_info->member_srl; + if(!$member_srl) return; + + // 변수 정리 + $user_id = $member_info->user_id; + $user_name = $member_info->user_name; + + ModuleHandler::triggerCall('member.getMemberMenu', 'before', $null); + + $oMemberController = &getController('member'); + + // 회원 정보 보기 (비회원일 경우 볼 수 없도록 수정) + 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'); + } + + // 다른 사람의 아이디를 클릭한 경우 + if($member_srl != $logged_info->member_srl) { + + // 메일 보내기 + 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); + } + } + + // 홈페이지 보기 + if($member_info->homepage) + $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->homepage), 'homepage', './modules/member/tpl/images/icon_homepage.gif','blank'); + + // 블로그 보기 + if($member_info->blog) + $oMemberController->addMemberPopupMenu(htmlspecialchars($member_info->blog), 'blog', './modules/member/tpl/images/icon_blog.gif','blank'); + + // trigger 호출 (after) + ModuleHandler::triggerCall('member.getMemberMenu', 'after', $null); + + // 최고 관리자라면 회원정보 수정 메뉴 만듬 + 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'; + $oMemberController->addMemberPopupMenu($url,'cmd_manage_member_info',$icon_path,'MemberModifyInfo'); + + $url = getUrl('','module','admin','act','dispDocumentAdminList','search_target','member_srl','search_keyword',$member_srl); + $icon_path = './modules/member/tpl/images/icon_trace_document.gif'; + $oMemberController->addMemberPopupMenu($url,'cmd_trace_document',$icon_path,'TraceMemberDocument'); + + $url = getUrl('','module','admin','act','dispCommentAdminList','search_target','member_srl','search_keyword',$member_srl); + $icon_path = './modules/member/tpl/images/icon_trace_comment.gif'; + $oMemberController->addMemberPopupMenu($url,'cmd_trace_comment',$icon_path,'TraceMemberComment'); + } + + // 팝업메뉴의 언어 변경 + $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); + } + + // 최종적으로 정리된 팝업메뉴 목록을 구함 + $this->add('menus', $menus); + } + + /** + * @brief 로그인 되어 있는지에 대한 체크 + **/ + function isLogged() { + if($_SESSION['is_logged']&&$_SESSION['ipaddress']==$_SERVER['REMOTE_ADDR']) return true; + + $_SESSION['is_logged'] = false; + $_SESSION['logged_info'] = ''; + return false; + } + + /** + * @brief 인증된 사용자의 정보 return + **/ + function getLoggedInfo() { + // 로그인 되어 있고 세션 정보를 요청하면 세션 정보를 return + if($this->isLogged()) { + $logged_info = $_SESSION['logged_info']; + + // 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변수를 추가 + $oModuleModel = &getModel('module'); + if($oModuleModel->isSiteAdmin($logged_info)) $logged_info->is_site_admin = true; + else $logged_info->is_site_admin = false; + } else { + // 만약 기본 사이트인데 회원 그룹이 존재하지 않으면 등록 + if(!count($logged_info->group_list)) { + $default_group = $this->getDefaultGroup(0); + $oMemberController = &getController('member'); + $oMemberController->addMemberToGroup($logged_info->member_srl, $default_group->group_srl, 0); + $groups[$default_group->group_srl] = $default_group->title; + $logged_info->group_list = $groups; + } + + $logged_info->is_site_admin = false; + } + + $_SESSION['logged_info'] = $logged_info; + + return $logged_info; + } + return NULL; + } + + /** + * @brief user_id에 해당하는 사용자 정보 return + **/ + function getMemberInfoByUserID($user_id) { + if(!$user_id) return; + + $args->user_id = $user_id; + $output = executeQuery('member.getMemberInfo', $args); + if(!$output->toBool()) return $output; + if(!$output->data) return; + + $member_info = $this->arrangeMemberInfo($output->data); + + return $member_info; + } + + /** + * @brief member_srl로 사용자 정보 return + **/ + function getMemberInfoByMemberSrl($member_srl, $site_srl = 0) { + if(!$member_srl) return; + + if(!$GLOBALS['__member_info__'][$member_srl]) { + $args->member_srl = $member_srl; + $output = executeQuery('member.getMemberInfoByMemberSrl', $args); + if(!$output->data) return; + + $this->arrangeMemberInfo($output->data, $site_srl); + } + + return $GLOBALS['__member_info__'][$member_srl]; + } + + /** + * @brief 사용자 정보 중 extra_vars와 기타 정보를 알맞게 편집 + **/ + function arrangeMemberInfo($info, $site_srl = 0) { + if(!$GLOBALS['__member_info__'][$info->member_srl]) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + + + $info->profile_image = $this->getProfileImage($info->member_srl); + $info->image_name = $this->getImageName($info->member_srl); + $info->image_mark = $this->getImageMark($info->member_srl); + if($config->group_image_mark=='Y'){ + $info->group_mark = $this->getGroupImageMark($info->member_srl,$site_srl); + } + $info->signature = $this->getSignature($info->member_srl); + $info->group_list = $this->getMemberGroups($info->member_srl, $site_srl); + + $extra_vars = unserialize($info->extra_vars); + unset($info->extra_vars); + if($extra_vars) { + foreach($extra_vars as $key => $val) { + if(preg_match('/\|\@\|/i', $val)) $val = explode('|@|', $val); + if(!$info->{$key}) $info->{$key} = $val; + } + } + + $GLOBALS['__member_info__'][$info->member_srl] = $info; + } + + return $GLOBALS['__member_info__'][$info->member_srl]; + } + + /** + * @brief userid에 해당하는 member_srl을 구함 + **/ + function getMemberSrlByUserID($user_id) { + $args->user_id = $user_id; + $output = executeQuery('member.getMemberSrl', $args); + return $output->data->member_srl; + } + + /** + * @brief EmailAddress에 해당하는 member_srl을 구함 + **/ + function getMemberSrlByEmailAddress($email_address) { + $args->email_address = $email_address; + $output = executeQuery('member.getMemberSrl', $args); + return $output->data->member_srl; + } + + /** + * @brief NickName에 해당하는 member_srl을 구함 + **/ + function getMemberSrlByNickName($nick_name) { + $args->nick_name = $nick_name; + $output = executeQuery('member.getMemberSrl', $args); + return $output->data->member_srl; + } + + /** + * @brief 현재 접속자의 member_srl을 return + **/ + function getLoggedMemberSrl() { + if(!$this->isLogged()) return; + return $_SESSION['member_srl']; + } + + /** + * @brief 현재 접속자의 user_id을 return + **/ + function getLoggedUserID() { + if(!$this->isLogged()) return; + $logged_info = $_SESSION['logged_info']; + return $logged_info->user_id; + } + + /** + * @brief member_srl이 속한 group 목록을 가져옴 + **/ + function getMemberGroups($member_srl, $site_srl = 0, $force_reload = false) { + static $member_groups = array(); + if(!$member_groups[$member_srl][$site_srl] || $force_reload) { + $args->member_srl = $member_srl; + $args->site_srl = $site_srl; + $output = executeQuery('member.getMemberGroups', $args); + if(!$output->data) return array(); + + $group_list = $output->data; + if(!is_array($group_list)) $group_list = array($group_list); + + foreach($group_list as $group) { + $result[$group->group_srl] = $group->title; + } + $member_groups[$member_srl][$site_srl] = $result; + } + return $member_groups[$member_srl][$site_srl]; + } + + /** + * @brief member_srl들이 속한 group 목록을 가져옴 + **/ + function getMembersGroups($member_srls, $site_srl = 0) { + $args->member_srls = implode(',',$member_srls); + $args->site_srl = $site_srl; + $output = executeQueryArray('member.getMembersGroups', $args); + if(!$output->data) return array(); + + $result = array(); + foreach($output->data as $key=>$val) { + $result[$val->member_srl][] = $val->title; + } + return $result; + } + + /** + * @brief 기본 그룹을 가져옴 + **/ + function getDefaultGroup($site_srl = 0) { + $args->site_srl = $site_srl; + $output = executeQuery('member.getDefaultGroup', $args); + return $output->data; + } + + /** + * @brief 관리자 그룹을 가져옴 + **/ + function getAdminGroup() { + $output = executeQuery('member.getAdminGroup'); + return $output->data; + } + + /** + * @brief group_srl에 해당하는 그룹 정보 가져옴 + **/ + function getGroup($group_srl) { + $args->group_srl = $group_srl; + $output = executeQuery('member.getGroup', $args); + return $output->data; + } + + /** + * @brief 그룹 목록을 가져옴 + **/ + function getGroups($site_srl = 0) { + if(!$GLOBALS['__group_info__'][$site_srl]) { + $args->site_srl = $site_srl; + $output = executeQuery('member.getGroups', $args); + if(!$output->data) return; + + $group_list = $output->data; + if(!is_array($group_list)) $group_list = array($group_list); + + foreach($group_list as $val) { + $result[$val->group_srl] = $val; + } + + $GLOBALS['__group_info__'][$site_srl] = $result; + } + return $GLOBALS['__group_info__'][$site_srl]; + } + + /** + * @brief 회원 가입폼 추가 확장 목록 가져오기 + * + * 이 메소드는 modules/member/tpl/filter/insert.xml 의 extend_filter로 동작을 한다. + * extend_filter로 사용을 하기 위해서는 인자값으로 boolean값을 받도록 규정한다. + * 이 인자값이 true일 경우 filter 타입에 맞는 형태의 object로 결과를 return하여야 한다. + **/ + function getJoinFormList($filter_response = false) { + global $lang; + + // 최고관리자는 무시하도록 설정 + $logged_info = Context::get('logged_info'); + + if(!$this->join_form_list) { + // list_order 컬럼의 정렬을 위한 인자 세팅 + $args->sort_index = "list_order"; + $output = executeQuery('member.getJoinFormList', $args); + + // 결과 데이터가 없으면 NULL return + $join_form_list = $output->data; + if(!$join_form_list) return NULL; + + // default_value의 경우 DB에 array가 serialize되어 입력되므로 unserialize가 필요 + 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++) { + $join_form_list[$i]->column_name = strtolower($join_form_list[$i]->column_name); + + $member_join_form_srl = $join_form_list[$i]->member_join_form_srl; + $column_type = $join_form_list[$i]->column_type; + $column_name = $join_form_list[$i]->column_name; + $column_title = $join_form_list[$i]->column_title; + $default_value = $join_form_list[$i]->default_value; + + // 언어변수에 추가 + $lang->extend_vars[$column_name] = $column_title; + + // checkbox, select등 다수 데이터 형식일 경우 unserialize해줌 + 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 = ''; + } else { + $join_form_list[$i]->default_value = ''; + } + + $list[$member_join_form_srl] = $join_form_list[$i]; + } + $this->join_form_list = $list; + } + + // filter_response가 true일 경우 object 스타일을 구함 + if($filter_response && count($this->join_form_list)) { + + foreach($this->join_form_list as $key => $val) { + if($val->is_active != 'Y') continue; + unset($obj); + $obj->type = $val->column_type; + $obj->name = $val->column_name; + $obj->lang = $val->column_title; + if($logged_info->is_admin != 'Y') $obj->required = $val->required=='Y'?true:false; + else $obj->required = false; + $filter_output[] = $obj; + + unset($open_obj); + $open_obj->name = 'open_'.$val->column_name; + $open_obj->required = false; + $filter_output[] = $open_obj; + + } + return $filter_output; + + } + + // 결과 리턴 + return $this->join_form_list; + } + + /** + * @brief 추가 회원가입폼과 특정 회원의 정보를 조합 (회원정보 수정등에 사용) + **/ + function getCombineJoinForm($member_info) { + $extend_form_list = $this->getJoinFormlist(); + if(!$extend_form_list) return; + + // 관리자이거나 자기 자신이 아니면 비공개의 경우 무조건 패스해버림 + $logged_info = Context::get('logged_info'); + + foreach($extend_form_list as $srl => $item) { + $column_name = $item->column_name; + $value = $member_info->{$column_name}; + + if($logged_info->is_admin != 'Y' && $logged_info->member_srl != $member_info->member_srl && $member_info->{'open_'.$column_name}!='Y') { + $extend_form_list[$srl]->is_private = true; + continue; + } + + // 추가 확장폼의 종류에 따라 값을 변경 + switch($item->column_type) { + case 'checkbox' : + if($value && !is_array($value)) $value = array($value); + break; + case 'text' : + case 'homepage' : + case 'email_address' : + case 'tel' : + case 'textarea' : + case 'select' : + case 'kr_zip' : + break; + } + + $extend_form_list[$srl]->value = $value; + + if($member_info->{'open_'.$column_name}=='Y') $extend_form_list[$srl]->is_opened = true; + else $extend_form_list[$srl]->is_opened = false; + } + return $extend_form_list; + } + + /** + * @brief 한개의 가입항목을 가져옴 + **/ + function getJoinForm($member_join_form_srl) { + $args->member_join_form_srl = $member_join_form_srl; + $output = executeQuery('member.getJoinForm', $args); + $join_form = $output->data; + if(!$join_form) return NULL; + + $column_type = $join_form->column_type; + $default_value = $join_form->default_value; + + if(in_array($column_type, array('checkbox','select','radio'))) { + $join_form->default_value = unserialize($default_value); + } else { + $join_form->default_value = ''; + } + + return $join_form; + } + + /** + * @brief 금지 아이디 목록 가져오기 + **/ + function getDeniedIDList() { + if(!$this->denied_id_list) { + $args->sort_index = "list_order"; + $args->page = Context::get('page'); + $args->list_count = 40; + $args->page_count = 10; + + $output = executeQuery('member.getDeniedIDList', $args); + $this->denied_id_list = $output; + } + return $this->denied_id_list; + } + + /** + * @brief 금지 아이디인지 확인 + **/ + function isDeniedID($user_id) { + $args->user_id = $user_id; + $output = executeQuery('member.chkDeniedID', $args); + if($output->data->count) return true; + return false; + } + + /** + * @brief 프로필 이미지의 정보를 구함 + **/ + function getProfileImage($member_srl) { + if(!isset($GLOBALS['__member_info__']['profile_image'][$member_srl])) { + $GLOBALS['__member_info__']['profile_image'][$member_srl] = null; + $exts = array('gif','jpg','png'); + for($i=0;$i<3;$i++) { + $image_name_file = sprintf('files/member_extra_info/profile_image/%s%d.%s', getNumberingPath($member_srl), $member_srl, $exts[$i]); + if(file_exists($image_name_file)) { + list($width, $height, $type, $attrs) = getimagesize($image_name_file); + $info = null; + $info->width = $width; + $info->height = $height; + $info->src = Context::getRequestUri().$image_name_file; + $info->file = './'.$image_name_file; + $GLOBALS['__member_info__']['profile_image'][$member_srl] = $info; + break; + } + } + } + + return $GLOBALS['__member_info__']['profile_image'][$member_srl]; + } + + /** + * @brief 이미지이름의 정보를 구함 + **/ + function getImageName($member_srl) { + if(!isset($GLOBALS['__member_info__']['image_name'][$member_srl])) { + $image_name_file = sprintf('files/member_extra_info/image_name/%s%d.gif', getNumberingPath($member_srl), $member_srl); + if(file_exists($image_name_file)) { + list($width, $height, $type, $attrs) = getimagesize($image_name_file); + $info->width = $width; + $info->height = $height; + $info->src = Context::getRequestUri().$image_name_file; + $info->file = './'.$image_name_file; + $GLOBALS['__member_info__']['image_name'][$member_srl] = $info; + } else $GLOBALS['__member_info__']['image_name'][$member_srl] = null; + } + return $GLOBALS['__member_info__']['image_name'][$member_srl]; + } + + /** + * @brief 이미지마크의 정보를 구함 + **/ + function getImageMark($member_srl) { + if(!isset($GLOBALS['__member_info__']['image_mark'][$member_srl])) { + $image_mark_file = sprintf('files/member_extra_info/image_mark/%s%d.gif', getNumberingPath($member_srl), $member_srl); + if(file_exists($image_mark_file)) { + list($width, $height, $type, $attrs) = getimagesize($image_mark_file); + $info->width = $width; + $info->height = $height; + $info->src = Context::getRequestUri().$image_mark_file; + $info->file = './'.$image_mark_file; + $GLOBALS['__member_info__']['image_mark'][$member_srl] = $info; + } else $GLOBALS['__member_info__']['image_mark'][$member_srl] = null; + } + + return $GLOBALS['__member_info__']['image_mark'][$member_srl]; + } + + + /** + * @brief group의 이미지마크 정보를 구함 + **/ + function getGroupImageMark($member_srl,$site_srl=0) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + if($config->group_image_mark!='Y'){ + return null; + } + $member_group = $this->getMemberGroups($member_srl,$site_srl); + + $groups_info = $this->getGroups($site_srl); + $image_mark = null; + if(count($member_group) > 0 && is_array($member_group)){ + $group_srl = array_keys($member_group); + $image_mark = $groups_info[$group_srl[0]]->image_mark; + } + if($image_mark){ +// list($width, $height, $type, $attrs) = getimagesize($image_mark); +// $info->width = $width; +// $info->height = $height; + $info->src = $image_mark; + return $info; + + }else return false; + } + + /** + * @brief 사용자의 signature를 구함 + **/ + function getSignature($member_srl) { + if(!isset($GLOBALS['__member_info__']['signature'][$member_srl])) { + $filename = sprintf('files/member_extra_info/signature/%s%d.signature.php', getNumberingPath($member_srl), $member_srl); + if(file_exists($filename)) { + $buff = FileHandler::readFile($filename); + $signature = trim(substr($buff, 40)); + $GLOBALS['__member_info__']['signature'][$member_srl] = $signature; + } else $GLOBALS['__member_info__']['signature'][$member_srl] = null; + } + return $GLOBALS['__member_info__']['signature'][$member_srl]; + } + + /** + * @brief 입력된 plain text 비밀번호와 DB에 저장된 비밀번호와의 비교 + **/ + function isValidPassword($hashed_password, $password_text) { + // 입력된 비밀번호가 없으면 무조건 falase + if(!$password_text) return false; + + // md5 해쉬된값가 맞으면 return true + if($hashed_password == md5($password_text)) return true; + + // mysql_pre4_hash_password함수의 값과 동일하면 return true + if(mysql_pre4_hash_password($password_text) == $hashed_password) return true; + + // 현재 DB에서 mysql DB를 이용시 직접 old_password를 이용하여 검사하고 맞으면 비밀번호를 변경 + if(substr(Context::getDBType(),0,5)=='mysql') { + $oDB = &DB::getInstance(); + if($oDB->isValidOldPassword($password_text, $hashed_password)) return true; + } + + return false; + } + + /** + * @brief 멤버와 연결된 오픈아이디들을 모두 리턴한다. + **/ + function getMemberOpenIDByMemberSrl($member_srl) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + + $result = array(); + if ($config->enable_openid != 'Y') return $result; + + $args->member_srl = $member_srl; + $output = executeQuery('member.getMemberOpenIDByMemberSrl', $args); + + if (!$output->data) { + } + else if (is_array($output->data)) { + foreach($output->data as $row) { + $result[] = $row; + } + } + else { + $result[] = $output->data; + } + + foreach($result as $row) { + $openid = $row->openid; + $bookmarklet_header = "javascript:var%20U='"; + $bookmarklet_footer = "';function%20Z(W){var%20X=/(openid|ident)/i;try{var%20F=W.frames;var%20E=W.document.getElementsByTagName('input');for(var%20i=0;ibookmarklet = $bookmarklet_header . $openid . $bookmarklet_footer; + } + + return $result; + } + + /** + * @brief 오픈아이디에 연결된 멤버를 리턴한다. + **/ + function getMemberSrlByOpenID($openid) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('member'); + + if ($config->enable_openid != 'Y') return $result; + + $args->member_srl = $member_srl; + $output = executeQuery('member.getMemberSrlByOpenID', $args); + + if (!$output->data) return null; + return $output->data->member_srl; + } + + } +?> diff --git a/modules/member/member.view.php b/modules/member/member.view.php index 04d835635..4b9cf74f3 100644 --- a/modules/member/member.view.php +++ b/modules/member/member.view.php @@ -1,357 +1,357 @@ -member_config = $oModuleModel->getModuleConfig('member'); - if(!$this->member_config->skin) $this->member_config->skin = "default"; - if(!$this->member_config->colorset) $this->member_config->colorset = "white"; - - Context::set('member_config', $this->member_config); - $skin = $this->member_config->skin; - - // 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 회원 정보 출력 - **/ - function dispMemberInfo() { - $oMemberModel = &getModel('member'); - $logged_info = Context::get('logged_info'); - - // 비회원일 경우 정보 열람 중지 - if(!$logged_info->member_srl) return $this->stop('msg_not_permitted'); - - $member_srl = Context::get('member_srl'); - if(!$member_srl && Context::get('is_logged')) { - $member_srl = $logged_info->member_srl; - } elseif(!$member_srl) { - return $this->dispMemberSignUpForm(); - } - - $site_module_info = Context::get('site_module_info'); - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, $site_module_info->site_srl); - unset($member_info->password); - unset($member_info->email_id); - unset($member_info->email_host); - unset($member_info->email_address); - - if(!$member_info->member_srl) return $this->dispMemberSignUpForm(); - - Context::set('member_info', $member_info); - Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info)); - if ($member_info->member_srl == $logged_info->member_srl) - Context::set('openids', $oMemberModel->getMemberOpenIDByMemberSrl($member_srl)); - - $this->setTemplateFile('member_info'); - } - - /** - * @brief 회원 가입 폼 출력 - **/ - function dispMemberSignUpForm() { - $oMemberModel = &getModel('member'); - - // 로그인한 회원일 경우 해당 회원의 정보를 받음 - if($oMemberModel->isLogged()) return $this->stop('msg_already_logged'); - - // before 트리거 호출 - $trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $this->member_config); - if(!$trigger_output->toBool()) return $trigger_output; - - // 회원가입을 중지시켰을 때는 에러 표시 - 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); - - // 템플릿 파일 지정 - $this->setTemplateFile('signup_form'); - } - - /** - * @brief 회원 정보 수정 - **/ - function dispMemberModifyInfo() { - $oMemberModel = &getModel('member'); - $oModuleModel = &getModel('module'); - $memberModuleConfig = $oModuleModel->getModuleConfig('member'); - - // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); - - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - $member_info->signature = $oMemberModel->getSignature($member_srl); - Context::set('member_info',$member_info); - - // 추가 가입폼 목록을 받음 - Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info)); - - Context::set('openids', $oMemberModel->getMemberOpenIDByMemberSrl($member_srl)); - - // 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅 - if($member_info->member_srl) { - $oEditorModel = &getModel('editor'); - $option->primary_key_name = 'member_srl'; - $option->content_key_name = 'signature'; - $option->allow_fileupload = false; - $option->enable_autosave = false; - $option->enable_default_component = true; - $option->enable_component = false; - $option->resizable = false; - $option->disable_html = true; - $option->height = 200; - $option->skin = $this->member_config->editor_skin; - $option->colorset = $this->member_config->editor_colorset; - $editor = $oEditorModel->getEditor($member_info->member_srl, $option); - Context::set('editor', $editor); - } - - // 템플릿 파일 지정 - $this->setTemplateFile('modify_info'); - } - - - /** - * @brief 회원 작성글 보기 - **/ - function dispMemberOwnDocument() { - $oMemberModel = &getModel('member'); - - // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); - - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - $module_srl = Context::get('module_srl'); - Context::set('module_srl',Context::get('selected_module_srl')); - Context::set('search_target','member_srl'); - Context::set('search_keyword',$member_srl); - - $oDocumentAdminView = &getAdminView('document'); - $oDocumentAdminView->dispDocumentAdminList(); - - Context::set('module_srl', $module_srl); - $this->setTemplateFile('document_list'); - } - - /** - * @brief 회원 스크랩 게시물 보기 - **/ - function dispMemberScrappedDocument() { - $oMemberModel = &getModel('member'); - - // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); - - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - $args->page = (int)Context::get('page'); - - $output = executeQuery('member.getScrapDocumentList', $args); - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('document_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('scrapped_list'); - } - - /** - * @brief 회원의 저장함 보기 - **/ - function dispMemberSavedDocument() { - $oMemberModel = &getModel('member'); - - // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); - - // 저장함에 보관된 글을 가져옴 (저장함은 module_srl이 member_srl로 세팅되어 있음) - $logged_info = Context::get('logged_info'); - $args->module_srl = $logged_info->member_srl; - $args->page = (int)Context::get('page'); - - $oDocumentModel = &getModel('document'); - $output = $oDocumentModel->getDocumentList($args, true); - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('document_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('saved_list'); - } - - /** - * @brief 로그인 폼 출력 - **/ - function dispMemberLoginForm() { - if(Context::get('is_logged')) { - Context::set('redirect_url', getUrl('act','')); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('redirect.html'); - return; - } - - // 템플릿 파일 지정 - Context::set('referer_url', $_SERVER['HTTP_REFERER']); - $this->setTemplateFile('login_form'); - } - - /** - * @brief 회원 비밀번호 수정 - **/ - function dispMemberModifyPassword() { - $oMemberModel = &getModel('member'); - - // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); - - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - Context::set('member_info',$member_info); - - // 템플릿 파일 지정 - $this->setTemplateFile('modify_password'); - } - - /** - * @brief 탈퇴 화면 - **/ - function dispMemberLeave() { - $oMemberModel = &getModel('member'); - - // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); - - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - Context::set('member_info',$member_info); - - // 템플릿 파일 지정 - $this->setTemplateFile('leave_form'); - } - - /** - * @brief 오픈 아이디 탈퇴 화면 - **/ - function dispMemberOpenIDLeave() { - $oMemberModel = &getModel('member'); - - // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); - - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - Context::set('member_info',$member_info); - - // 템플릿 파일 지정 - $this->setTemplateFile('openid_leave_form'); - } - - /** - * @brief 로그아웃 출력 - **/ - function dispMemberLogout() { - $oMemberController = &getController('member'); - $oMemberController->procMemberLogout(); - - Context::set('layout','none'); - $this->setTemplatePath($this->module_path.'/tpl'); - $this->setTemplateFile('logout'); - } - - /** - * @brief 저장된 글 목록을 보여줌 - **/ - function dispSavedDocumentList() { - $this->setLayoutFile('popup_layout'); - - $oMemberModel = &getModel('member'); - - // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 - if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); - - // 저장함에 보관된 글을 가져옴 (저장함은 module_srl이 member_srl로 세팅되어 있음) - $logged_info = Context::get('logged_info'); - $args->module_srl = $logged_info->member_srl; - $args->page = (int)Context::get('page'); - $args->list_count = 10; - - $oDocumentModel = &getModel('document'); - $output = $oDocumentModel->getDocumentList($args, true); - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('document_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('saved_list_popup'); - } - - /** - * @brief 아이디/ 비밀번호 찾기 기능 - **/ - function dispMemberFindAccount() { - if(Context::get('is_logged')) return $this->stop('already_logged'); - - $this->setTemplateFile('find_member_account'); - } - - /** - * @brief 임시 비밀번호 발급 - **/ - function dispMemberGetTempPassword() { - if(Context::get('is_logged')) return $this->stop('already_logged'); - - $user_id = Context::get('user_id'); - $temp_password = $_SESSION['xe_temp_password_'.$user_id]; - unset($_SESSION['xe_temp_password_'.$user_id]); - - if(!$user_id||!$temp_password) return new Object(-1,'msg_invaild_request'); - - Context::set('temp_password', $temp_password); - - $this->setTemplateFile('find_temp_password'); - } - - /** - * @brief 인증 메일 재발송 페이지 - **/ - function dispMemberResendAuthMail() { - if(Context::get('is_logged')) return $this->stop('already_logged'); - - $this->setTemplateFile('resend_auth_mail'); - } - } -?> +member_config = $oModuleModel->getModuleConfig('member'); + if(!$this->member_config->skin) $this->member_config->skin = "default"; + if(!$this->member_config->colorset) $this->member_config->colorset = "white"; + + Context::set('member_config', $this->member_config); + $skin = $this->member_config->skin; + + // 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 회원 정보 출력 + **/ + function dispMemberInfo() { + $oMemberModel = &getModel('member'); + $logged_info = Context::get('logged_info'); + + // 비회원일 경우 정보 열람 중지 + if(!$logged_info->member_srl) return $this->stop('msg_not_permitted'); + + $member_srl = Context::get('member_srl'); + if(!$member_srl && Context::get('is_logged')) { + $member_srl = $logged_info->member_srl; + } elseif(!$member_srl) { + return $this->dispMemberSignUpForm(); + } + + $site_module_info = Context::get('site_module_info'); + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl, $site_module_info->site_srl); + unset($member_info->password); + unset($member_info->email_id); + unset($member_info->email_host); + unset($member_info->email_address); + + if(!$member_info->member_srl) return $this->dispMemberSignUpForm(); + + Context::set('member_info', $member_info); + Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info)); + if ($member_info->member_srl == $logged_info->member_srl) + Context::set('openids', $oMemberModel->getMemberOpenIDByMemberSrl($member_srl)); + + $this->setTemplateFile('member_info'); + } + + /** + * @brief 회원 가입 폼 출력 + **/ + function dispMemberSignUpForm() { + $oMemberModel = &getModel('member'); + + // 로그인한 회원일 경우 해당 회원의 정보를 받음 + if($oMemberModel->isLogged()) return $this->stop('msg_already_logged'); + + // before 트리거 호출 + $trigger_output = ModuleHandler::triggerCall('member.dispMemberSignUpForm', 'before', $this->member_config); + if(!$trigger_output->toBool()) return $trigger_output; + + // 회원가입을 중지시켰을 때는 에러 표시 + 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); + + // 템플릿 파일 지정 + $this->setTemplateFile('signup_form'); + } + + /** + * @brief 회원 정보 수정 + **/ + function dispMemberModifyInfo() { + $oMemberModel = &getModel('member'); + $oModuleModel = &getModel('module'); + $memberModuleConfig = $oModuleModel->getModuleConfig('member'); + + // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 + if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); + + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + $member_info->signature = $oMemberModel->getSignature($member_srl); + Context::set('member_info',$member_info); + + // 추가 가입폼 목록을 받음 + Context::set('extend_form_list', $oMemberModel->getCombineJoinForm($member_info)); + + Context::set('openids', $oMemberModel->getMemberOpenIDByMemberSrl($member_srl)); + + // 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅 + if($member_info->member_srl) { + $oEditorModel = &getModel('editor'); + $option->primary_key_name = 'member_srl'; + $option->content_key_name = 'signature'; + $option->allow_fileupload = false; + $option->enable_autosave = false; + $option->enable_default_component = true; + $option->enable_component = false; + $option->resizable = false; + $option->disable_html = true; + $option->height = 200; + $option->skin = $this->member_config->editor_skin; + $option->colorset = $this->member_config->editor_colorset; + $editor = $oEditorModel->getEditor($member_info->member_srl, $option); + Context::set('editor', $editor); + } + + // 템플릿 파일 지정 + $this->setTemplateFile('modify_info'); + } + + + /** + * @brief 회원 작성글 보기 + **/ + function dispMemberOwnDocument() { + $oMemberModel = &getModel('member'); + + // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 + if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); + + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + $module_srl = Context::get('module_srl'); + Context::set('module_srl',Context::get('selected_module_srl')); + Context::set('search_target','member_srl'); + Context::set('search_keyword',$member_srl); + + $oDocumentAdminView = &getAdminView('document'); + $oDocumentAdminView->dispDocumentAdminList(); + + Context::set('module_srl', $module_srl); + $this->setTemplateFile('document_list'); + } + + /** + * @brief 회원 스크랩 게시물 보기 + **/ + function dispMemberScrappedDocument() { + $oMemberModel = &getModel('member'); + + // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 + if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); + + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + $args->page = (int)Context::get('page'); + + $output = executeQuery('member.getScrapDocumentList', $args); + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('document_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('scrapped_list'); + } + + /** + * @brief 회원의 저장함 보기 + **/ + function dispMemberSavedDocument() { + $oMemberModel = &getModel('member'); + + // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 + if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); + + // 저장함에 보관된 글을 가져옴 (저장함은 module_srl이 member_srl로 세팅되어 있음) + $logged_info = Context::get('logged_info'); + $args->module_srl = $logged_info->member_srl; + $args->page = (int)Context::get('page'); + + $oDocumentModel = &getModel('document'); + $output = $oDocumentModel->getDocumentList($args, true); + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('document_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('saved_list'); + } + + /** + * @brief 로그인 폼 출력 + **/ + function dispMemberLoginForm() { + if(Context::get('is_logged')) { + Context::set('redirect_url', getUrl('act','')); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('redirect.html'); + return; + } + + // 템플릿 파일 지정 + Context::set('referer_url', $_SERVER['HTTP_REFERER']); + $this->setTemplateFile('login_form'); + } + + /** + * @brief 회원 비밀번호 수정 + **/ + function dispMemberModifyPassword() { + $oMemberModel = &getModel('member'); + + // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 + if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); + + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + Context::set('member_info',$member_info); + + // 템플릿 파일 지정 + $this->setTemplateFile('modify_password'); + } + + /** + * @brief 탈퇴 화면 + **/ + function dispMemberLeave() { + $oMemberModel = &getModel('member'); + + // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 + if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); + + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + Context::set('member_info',$member_info); + + // 템플릿 파일 지정 + $this->setTemplateFile('leave_form'); + } + + /** + * @brief 오픈 아이디 탈퇴 화면 + **/ + function dispMemberOpenIDLeave() { + $oMemberModel = &getModel('member'); + + // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 + if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); + + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + Context::set('member_info',$member_info); + + // 템플릿 파일 지정 + $this->setTemplateFile('openid_leave_form'); + } + + /** + * @brief 로그아웃 출력 + **/ + function dispMemberLogout() { + $oMemberController = &getController('member'); + $oMemberController->procMemberLogout(); + + Context::set('layout','none'); + $this->setTemplatePath($this->module_path.'/tpl'); + $this->setTemplateFile('logout'); + } + + /** + * @brief 저장된 글 목록을 보여줌 + **/ + function dispSavedDocumentList() { + $this->setLayoutFile('popup_layout'); + + $oMemberModel = &getModel('member'); + + // 로그인 되어 있지 않을 경우 로그인 되어 있지 않다는 메세지 출력 + if(!$oMemberModel->isLogged()) return $this->stop('msg_not_logged'); + + // 저장함에 보관된 글을 가져옴 (저장함은 module_srl이 member_srl로 세팅되어 있음) + $logged_info = Context::get('logged_info'); + $args->module_srl = $logged_info->member_srl; + $args->page = (int)Context::get('page'); + $args->list_count = 10; + + $oDocumentModel = &getModel('document'); + $output = $oDocumentModel->getDocumentList($args, true); + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('document_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('saved_list_popup'); + } + + /** + * @brief 아이디/ 비밀번호 찾기 기능 + **/ + function dispMemberFindAccount() { + if(Context::get('is_logged')) return $this->stop('already_logged'); + + $this->setTemplateFile('find_member_account'); + } + + /** + * @brief 임시 비밀번호 발급 + **/ + function dispMemberGetTempPassword() { + if(Context::get('is_logged')) return $this->stop('already_logged'); + + $user_id = Context::get('user_id'); + $temp_password = $_SESSION['xe_temp_password_'.$user_id]; + unset($_SESSION['xe_temp_password_'.$user_id]); + + if(!$user_id||!$temp_password) return new Object(-1,'msg_invaild_request'); + + Context::set('temp_password', $temp_password); + + $this->setTemplateFile('find_temp_password'); + } + + /** + * @brief 인증 메일 재발송 페이지 + **/ + function dispMemberResendAuthMail() { + if(Context::get('is_logged')) return $this->stop('already_logged'); + + $this->setTemplateFile('resend_auth_mail'); + } + } +?> diff --git a/modules/member/skins/default/document_list.html b/modules/member/skins/default/document_list.html index 29f6639aa..e82bdebd1 100644 --- a/modules/member/skins/default/document_list.html +++ b/modules/member/skins/default/document_list.html @@ -1,63 +1,63 @@ - - -

    {$member_title = $lang->cmd_view_own_document }

    - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - -
    Total : {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->readed_count}
    {$lang->voted_count}
    {$lang->date}
    {$no} - {$oDocument->getTitleText()} - - [{$oDocument->getCommentCount()}] - - - - [{$oDocument->getTrackbackCount()}] - - {$oDocument->get('readed_count')}{$oDocument->get('voted_count')}{$oDocument->getRegdate("Y-m-d")}
    - {$lang->cmd_back} -
    - - -

    - - + + +

    {$member_title = $lang->cmd_view_own_document }

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total : {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->readed_count}
    {$lang->voted_count}
    {$lang->date}
    {$no} + {$oDocument->getTitleText()} + + [{$oDocument->getCommentCount()}] + + + + [{$oDocument->getTrackbackCount()}] + + {$oDocument->get('readed_count')}{$oDocument->get('voted_count')}{$oDocument->getRegdate("Y-m-d")}
    + {$lang->cmd_back} +
    + + + + + diff --git a/modules/member/skins/default/saved_list.html b/modules/member/skins/default/saved_list.html index 1f1dc08ce..6943c2adf 100644 --- a/modules/member/skins/default/saved_list.html +++ b/modules/member/skins/default/saved_list.html @@ -1,46 +1,46 @@ - - -

    {$member_title = $lang->cmd_view_saved_document}

    - - - - - - - - - - - - - - - - - - - - - - -
    Total : {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->date}
    {$lang->title}
    {$lang->cmd_delete}
    {$val->getRegdate("Y-m-d H:i:s")} - - - {$lang->cmd_delete}
    - {$lang->cmd_back} -
    - - - - - + + +

    {$member_title = $lang->cmd_view_saved_document}

    + + + + + + + + + + + + + + + + + + + + + + +
    Total : {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->date}
    {$lang->title}
    {$lang->cmd_delete}
    {$val->getRegdate("Y-m-d H:i:s")} + + + {$lang->cmd_delete}
    + {$lang->cmd_back} +
    + + + + + diff --git a/modules/member/skins/default/saved_list_popup.html b/modules/member/skins/default/saved_list_popup.html index 7743f6cd3..e791907ed 100644 --- a/modules/member/skins/default/saved_list_popup.html +++ b/modules/member/skins/default/saved_list_popup.html @@ -1,49 +1,49 @@ - - -
    - -
    -

    {$lang->cmd_view_saved_document}

    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - -
    Total : {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->date}
    {$lang->title}
    {$lang->cmd_select}
    {$val->getRegdate("Y-m-d H:i:s")} - - - {$lang->cmd_select}
    - - - -
    -
    -
    + + +
    + +
    +

    {$lang->cmd_view_saved_document}

    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + +
    Total : {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->date}
    {$lang->title}
    {$lang->cmd_select}
    {$val->getRegdate("Y-m-d H:i:s")} + + + {$lang->cmd_select}
    + + + +
    +
    +
    diff --git a/modules/member/skins/default/scrapped_list.html b/modules/member/skins/default/scrapped_list.html index b20740f10..447067581 100644 --- a/modules/member/skins/default/scrapped_list.html +++ b/modules/member/skins/default/scrapped_list.html @@ -1,48 +1,48 @@ - - -

    {$member_title = $lang->cmd_view_scrapped_document}

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total : {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->writer}
    {$lang->date}
    {$lang->cmd_delete}
    {$no}{htmlspecialchars($val->title)}
    {$val->nick_name}
    {zdate($val->regdate, "Y-m-d H:i")}{$lang->cmd_delete}
    - {$lang->cmd_back} -
    - - - - - + + +

    {$member_title = $lang->cmd_view_scrapped_document}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total : {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->writer}
    {$lang->date}
    {$lang->cmd_delete}
    {$no}{htmlspecialchars($val->title)}
    {$val->nick_name}
    {zdate($val->regdate, "Y-m-d H:i")}{$lang->cmd_delete}
    + {$lang->cmd_back} +
    + + + + + diff --git a/modules/member/skins/default/skin.xml b/modules/member/skins/default/skin.xml index 6142202c1..a3cf54203 100644 --- a/modules/member/skins/default/skin.xml +++ b/modules/member/skins/default/skin.xml @@ -1,76 +1,76 @@ - - - 회원 기본 스킨 - 会员模块默认皮肤 - 会員デフォルトスキン - Default Member Skin - Giao diện thành viên mặc định - Por defecto miembro piel - По умолчанию членом кожи - 會員模組預設面板 - Varsayılan Kullanıcı Dış Görünümü - - 회원모듈의 default스킨 - NHN (developers@xpressengine.com) - - - 会员模块的默认皮肤。 - NHN (developers@xpressengine.com) - - - 会員モジュールのデフォルトスキン - NHN (developers@xpressengine.com) - - - default skin of member module - NHN (developers@xpressengine.com) - - - Giao diện mặc định của Module Thành viên - NHN (developers@xpressengine.com) - - - Por defecto de la piel miembro módulo - NHN (developers@xpressengine.com) - - - умолчанию кожу члена модуль - NHN (developers@xpressengine.com) - - - 會員模組預設面板。 - NHN (developers@xpressengine.com) - - - Üye modülünün varsayılan dış görünümü - NHN (developers@xpressengine.com) - - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - - - - 기본 - 默认 - デフォルト - default - Mặc định - Por defecto - умолчанию - 預設 - varsayılan - - - + + + 회원 기본 스킨 + 会员模块默认皮肤 + 会員デフォルトスキン + Default Member Skin + Giao diện thành viên mặc định + Por defecto miembro piel + По умолчанию членом кожи + 會員模組預設面板 + Varsayılan Kullanıcı Dış Görünümü + + 회원모듈의 default스킨 + NHN (developers@xpressengine.com) + + + 会员模块的默认皮肤。 + NHN (developers@xpressengine.com) + + + 会員モジュールのデフォルトスキン + NHN (developers@xpressengine.com) + + + default skin of member module + NHN (developers@xpressengine.com) + + + Giao diện mặc định của Module Thành viên + NHN (developers@xpressengine.com) + + + Por defecto de la piel miembro módulo + NHN (developers@xpressengine.com) + + + умолчанию кожу члена модуль + NHN (developers@xpressengine.com) + + + 會員模組預設面板。 + NHN (developers@xpressengine.com) + + + Üye modülünün varsayılan dış görünümü + NHN (developers@xpressengine.com) + + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + + + + 기본 + 默认 + デフォルト + default + Mặc định + Por defecto + умолчанию + 預設 + varsayılan + + + diff --git a/modules/member/tpl/denied_id_list.html b/modules/member/tpl/denied_id_list.html index 2f91e3c6b..ceea725dd 100644 --- a/modules/member/tpl/denied_id_list.html +++ b/modules/member/tpl/denied_id_list.html @@ -1,70 +1,70 @@ - - - - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    {$lang->no}
    {$lang->user_id}
    {$lang->description}
    {$lang->regdate}
     
    {$no}{$val->user_id}{$val->description} {zdate($val->regdate,"Y-m-d")}{$lang->cmd_delete}
    - - - - - -
    - - -
    - - - - - - - - - - - - -
    {$lang->user_id}
    {$lang->description}
    - -
    -
    - -
    + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang->no}
    {$lang->user_id}
    {$lang->description}
    {$lang->regdate}
     
    {$no}{$val->user_id}{$val->description} {zdate($val->regdate,"Y-m-d")}{$lang->cmd_delete}
    + + + + + +
    + + +
    + + + + + + + + + + + + +
    {$lang->user_id}
    {$lang->description}
    + +
    +
    + +
    diff --git a/modules/member/tpl/js/signup_check.js b/modules/member/tpl/js/signup_check.js index 78dac67f7..77116ddb4 100644 --- a/modules/member/tpl/js/signup_check.js +++ b/modules/member/tpl/js/signup_check.js @@ -1,52 +1,52 @@ -/** - * @brief 회원 가입시나 정보 수정시 각 항목의 중복 검사등을 하는 기능을 구현 - * @author NHN (developer@xpressengine.com) - **/ - -// 입력이 시작된 것과 입력후 정해진 시간동안 내용이 변하였을 경우 서버에 ajax로 체크를 하기 위한 변수 설정 -var memberCheckObj = { target:null, value:null } - -// domready시에 특정 필드들에 대해 이벤트를 걸어 놓음 -jQuery(document).ready(memberSetEvent); - -function memberSetEvent() { - jQuery('#fo_insert_member :input') - .filter('[name=user_id],[name=nick_name],[name=email_address]') - .blur(memberCheckValue); -} - - -// 실제 서버에 특정 필드의 value check를 요청하고 이상이 있으면 메세지를 뿌려주는 함수 -function memberCheckValue(event) { - var field = event.target; - var _name = field.name; - var _value = field.value; - if(!_name || !_value) return; - - var params = {name:_name, value:_value}; - var response_tags = ['error','message']; - - exec_xml('member','procMemberCheckValue', params, completeMemberCheckValue, response_tags, field); -} - -// 서버에서 응답이 올 경우 이상이 있으면 메세지를 출력 -function completeMemberCheckValue(ret_obj, response_tags, field) { - var _id = 'dummy_check'+field.name; - var dummy = jQuery('#'+_id); - - if(ret_obj['message']=='success') { - dummy.html('').hide(); - return; - } - - if (!dummy.length) { - dummy = jQuery('
    ').attr('id', _id).appendTo(field.parentNode); - } - - dummy.html(ret_obj['message']).show(); -} - -// 결과 메세지를 정리하는 함수 -function removeMemberCheckValueOutput(dummy, obj) { - dummy.style.display = "none"; -} +/** + * @brief 회원 가입시나 정보 수정시 각 항목의 중복 검사등을 하는 기능을 구현 + * @author NHN (developer@xpressengine.com) + **/ + +// 입력이 시작된 것과 입력후 정해진 시간동안 내용이 변하였을 경우 서버에 ajax로 체크를 하기 위한 변수 설정 +var memberCheckObj = { target:null, value:null } + +// domready시에 특정 필드들에 대해 이벤트를 걸어 놓음 +jQuery(document).ready(memberSetEvent); + +function memberSetEvent() { + jQuery('#fo_insert_member :input') + .filter('[name=user_id],[name=nick_name],[name=email_address]') + .blur(memberCheckValue); +} + + +// 실제 서버에 특정 필드의 value check를 요청하고 이상이 있으면 메세지를 뿌려주는 함수 +function memberCheckValue(event) { + var field = event.target; + var _name = field.name; + var _value = field.value; + if(!_name || !_value) return; + + var params = {name:_name, value:_value}; + var response_tags = ['error','message']; + + exec_xml('member','procMemberCheckValue', params, completeMemberCheckValue, response_tags, field); +} + +// 서버에서 응답이 올 경우 이상이 있으면 메세지를 출력 +function completeMemberCheckValue(ret_obj, response_tags, field) { + var _id = 'dummy_check'+field.name; + var dummy = jQuery('#'+_id); + + if(ret_obj['message']=='success') { + dummy.html('').hide(); + return; + } + + if (!dummy.length) { + dummy = jQuery('
    ').attr('id', _id).appendTo(field.parentNode); + } + + dummy.html(ret_obj['message']).show(); +} + +// 결과 메세지를 정리하는 함수 +function removeMemberCheckValueOutput(dummy, obj) { + dummy.style.display = "none"; +} diff --git a/modules/member/tpl/login_form.html b/modules/member/tpl/login_form.html index 6289ce853..87568ef1f 100644 --- a/modules/member/tpl/login_form.html +++ b/modules/member/tpl/login_form.html @@ -1,19 +1,19 @@ - -
    -
    -

    {$lang->cmd_login}

    -
    -
    - - - -
      -
    • -
    • -
    -
    -
    -
    -
    -
    -
    + +
    +
    +

    {$lang->cmd_login}

    +
    +
    + + + +
      +
    • +
    • +
    +
    +
    +
    +
    +
    +
    diff --git a/modules/member/tpl/member_list.html b/modules/member/tpl/member_list.html index 1556aa84f..3fa4d0f77 100644 --- a/modules/member/tpl/member_list.html +++ b/modules/member/tpl/member_list.html @@ -1,132 +1,132 @@ - - - - -
    - - - -
    - - - - - - - - {$lang->cmd_cancel} -
    -
    - - -
    - - - - - - - - - - - - - - - - - {@ $val->group_list = implode(', ', $val->group_list)} - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->user_id}
    {$lang->user_name}
    {$lang->nick_name}
     
    {$no}{htmlspecialchars($val->user_id)}{htmlspecialchars($val->user_name)}{htmlspecialchars($val->nick_name)}{zdate($val->regdate,"Y-m-d H:i:s")}{zdate($val->last_login,"Y-m-d H:i:s")} - {$lang->homepage} - {$lang->blog}   - {$lang->cmd_delete}{$lang->is_admin}

    {$val->group_list} 

    - - - - - - -
    - -
    - - - -
    - - - - - - - - {$lang->cmd_cancel} -
    -
    + + + + +
    + + + +
    + + + + + + + + {$lang->cmd_cancel} +
    +
    + + +
    + + + + + + + + + + + + + + + + + {@ $val->group_list = implode(', ', $val->group_list)} + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->user_id}
    {$lang->user_name}
    {$lang->nick_name}
     
    {$no}{htmlspecialchars($val->user_id)}{htmlspecialchars($val->user_name)}{htmlspecialchars($val->nick_name)}{zdate($val->regdate,"Y-m-d H:i:s")}{zdate($val->last_login,"Y-m-d H:i:s")} + {$lang->homepage} + {$lang->blog}   + {$lang->cmd_delete}{$lang->is_admin}

    {$val->group_list} 

    + + + + + + +
    + +
    + + + +
    + + + + + + + + {$lang->cmd_cancel} +
    +
    diff --git a/modules/menu/conf/info.xml b/modules/menu/conf/info.xml index 2405dd08e..03ff4fa10 100644 --- a/modules/menu/conf/info.xml +++ b/modules/menu/conf/info.xml @@ -1,36 +1,36 @@ - - - 메뉴 - 菜单管理 - メニュー - Menu - Menu - Menú - Меню - 選單 - Menü - 레이아웃, 모듈을 연결하는 메뉴를 생성/관리하는 모듈입니다. - 此模块将生成并管理连接布局,模块的菜单。 - レイアウト、モジュールを連動させるメニューを作成・管理するモジュールです。 - This module is for creating/managering menues that linking layouts or modules. - Module này dành cho việc tạo và quản lý Menu sẽ liên kết với giao diện hoặc Mudule. - Este módulo es para crear/manejar los menús que que son conectados con los diseños o módulos. - Этот модуль служит для создания/управления меню, соединяюще лейауты и модули. - 可建立並管理連結版面和模組的選單。 - Bu modül, yerleşim düzenlerine ya da modüllere bağlı menüleri oluşturmak/yönetmek içindir. - 0.1 - 2007-02-28 - construction - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 메뉴 + 菜单管理 + メニュー + Menu + Menu + Menú + Меню + 選單 + Menü + 레이아웃, 모듈을 연결하는 메뉴를 생성/관리하는 모듈입니다. + 此模块将生成并管理连接布局,模块的菜单。 + レイアウト、モジュールを連動させるメニューを作成・管理するモジュールです。 + This module is for creating/managering menues that linking layouts or modules. + Module này dành cho việc tạo và quản lý Menu sẽ liên kết với giao diện hoặc Mudule. + Este módulo es para crear/manejar los menús que que son conectados con los diseños o módulos. + Этот модуль служит для создания/управления меню, соединяюще лейауты и модули. + 可建立並管理連結版面和模組的選單。 + Bu modül, yerleşim düzenlerine ya da modüllere bağlı menüleri oluşturmak/yönetmek içindir. + 0.1 + 2007-02-28 + construction + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/menu/lang/en.lang.php b/modules/menu/lang/en.lang.php index bf6bdb815..7e595b08b 100644 --- a/modules/menu/lang/en.lang.php +++ b/modules/menu/lang/en.lang.php @@ -1,53 +1,53 @@ -cmd_menu_insert = 'Create Menu'; - $lang->cmd_menu_management = 'Menu Management'; - - $lang->menu = 'Menu'; - $lang->menu_count = 'No. of menu'; - $lang->menu_management = 'Menu Management'; - $lang->depth = 'Step'; - $lang->parent_menu_name = 'Parent Menu Name'; - $lang->menu_name = 'Menu Name'; - $lang->menu_srl = 'Menu Serial Number'; - $lang->menu_id = 'Menu ID'; - $lang->menu_url = 'Menu URL'; - $lang->menu_open_window = 'Open a new window'; - $lang->menu_expand = 'Expand'; - $lang->menu_img_btn = 'Image button'; - $lang->menu_normal_btn = 'Normal'; - $lang->menu_hover_btn = 'Mouse over'; - $lang->menu_active_btn = 'When selected'; - $lang->menu_group_srls = 'Accessable Groups'; - $lang->layout_maker = "Layout Maker"; - $lang->layout_history = "Update History "; - $lang->layout_info = "Layout Info"; - $lang->layout_list = 'Layouts List'; - $lang->downloaded_list = 'Downloads List'; - $lang->limit_menu_depth = 'Display Enabled'; - - $lang->cmd_make_child = 'Add a Child Menu'; - $lang->cmd_move_to_installed_list = "View Created List"; - $lang->cmd_enable_move_menu = "Move Menu (Drag the top menu after selecting)"; - $lang->cmd_search_mid = "Search mid"; - - $lang->msg_cannot_delete_for_child = 'A menu with child menus cannot be deleted.'; - - $lang->about_title = 'Please input the title that is easy to verify when connecting to module.'; - $lang->about_menu_management = "Menu management enables you to consist menu in the selected layout.\nYou can create menu upto setted depth and can enter information in details by clicking the menu.\nMenu will be expanded by cliking the folder image.\nIf menu is not shown normally, refresh the information by clicking the button \"Re-create cache file\".\n* Menu created over the depth limit may not be shown properly."; - $lang->about_menu_name = 'The name will be shown as a menu name if it is not an admin or image button.'; - $lang->about_menu_url = "It is the menu URL when select the menu.
    You may enter only id value to link to other module.
    If no contents exist, nothing will happen even though you click the menu."; - $lang->about_menu_open_window = 'You can assign it to open a page in a new window when the menu clicked.'; - $lang->about_menu_expand = 'It enables the menu to remain expanded when the tree menu(tree_menu.js) is used.'; - $lang->about_menu_img_btn = 'If you register an image button, the image button will automatically replace the text button, and it will be shown in the layout.'; - $lang->about_menu_group_srls = 'If you select a group, only the group members can see the menu. (if xml file is directly opened, it will be shown.)'; - - $lang->about_menu = "Menu module will help you to create a complete site through the convenient menu management which arranges created modules and links to layouts without any manual works..\nMenu is not a site manager, but it just has information which can link to modules and layouts so you can express different types of menu."; - - $lang->alert_image_only = "Only image files can be registered."; -?> +cmd_menu_insert = 'Create Menu'; + $lang->cmd_menu_management = 'Menu Management'; + + $lang->menu = 'Menu'; + $lang->menu_count = 'No. of menu'; + $lang->menu_management = 'Menu Management'; + $lang->depth = 'Step'; + $lang->parent_menu_name = 'Parent Menu Name'; + $lang->menu_name = 'Menu Name'; + $lang->menu_srl = 'Menu Serial Number'; + $lang->menu_id = 'Menu ID'; + $lang->menu_url = 'Menu URL'; + $lang->menu_open_window = 'Open a new window'; + $lang->menu_expand = 'Expand'; + $lang->menu_img_btn = 'Image button'; + $lang->menu_normal_btn = 'Normal'; + $lang->menu_hover_btn = 'Mouse over'; + $lang->menu_active_btn = 'When selected'; + $lang->menu_group_srls = 'Accessable Groups'; + $lang->layout_maker = "Layout Maker"; + $lang->layout_history = "Update History "; + $lang->layout_info = "Layout Info"; + $lang->layout_list = 'Layouts List'; + $lang->downloaded_list = 'Downloads List'; + $lang->limit_menu_depth = 'Display Enabled'; + + $lang->cmd_make_child = 'Add a Child Menu'; + $lang->cmd_move_to_installed_list = "View Created List"; + $lang->cmd_enable_move_menu = "Move Menu (Drag the top menu after selecting)"; + $lang->cmd_search_mid = "Search mid"; + + $lang->msg_cannot_delete_for_child = 'A menu with child menus cannot be deleted.'; + + $lang->about_title = 'Please input the title that is easy to verify when connecting to module.'; + $lang->about_menu_management = "Menu management enables you to consist menu in the selected layout.\nYou can create menu upto setted depth and can enter information in details by clicking the menu.\nMenu will be expanded by cliking the folder image.\nIf menu is not shown normally, refresh the information by clicking the button \"Re-create cache file\".\n* Menu created over the depth limit may not be shown properly."; + $lang->about_menu_name = 'The name will be shown as a menu name if it is not an admin or image button.'; + $lang->about_menu_url = "It is the menu URL when select the menu.
    You may enter only id value to link to other module.
    If no contents exist, nothing will happen even though you click the menu."; + $lang->about_menu_open_window = 'You can assign it to open a page in a new window when the menu clicked.'; + $lang->about_menu_expand = 'It enables the menu to remain expanded when the tree menu(tree_menu.js) is used.'; + $lang->about_menu_img_btn = 'If you register an image button, the image button will automatically replace the text button, and it will be shown in the layout.'; + $lang->about_menu_group_srls = 'If you select a group, only the group members can see the menu. (if xml file is directly opened, it will be shown.)'; + + $lang->about_menu = "Menu module will help you to create a complete site through the convenient menu management which arranges created modules and links to layouts without any manual works..\nMenu is not a site manager, but it just has information which can link to modules and layouts so you can express different types of menu."; + + $lang->alert_image_only = "Only image files can be registered."; +?> diff --git a/modules/menu/lang/es.lang.php b/modules/menu/lang/es.lang.php index bfe5cb5dc..033da95e1 100644 --- a/modules/menu/lang/es.lang.php +++ b/modules/menu/lang/es.lang.php @@ -1,53 +1,53 @@ -cmd_menu_insert = 'Crear Menú'; - $lang->cmd_menu_management = 'Comfiguración del Menú'; - - $lang->menu = 'Menú'; - $lang->menu_count = 'Número del menú'; - $lang->menu_management = 'Configuración del Menú'; - $lang->depth = 'Nivel'; - $lang->parent_menu_name = 'Nombre del Menú principal'; - $lang->menu_name = 'Nombre del menú'; - $lang->menu_srl = 'Número característico del menú'; - $lang->menu_id = 'ID del menú'; - $lang->menu_url = 'URL del Menú'; - $lang->menu_open_window = 'Abrir en una nueva ventana'; - $lang->menu_expand = 'Expandir'; - $lang->menu_img_btn = 'Botón de imagen'; - $lang->menu_normal_btn = 'Normal'; - $lang->menu_hover_btn = 'Mouse arriba'; - $lang->menu_active_btn = 'Al momento de seleccionar'; - $lang->menu_group_srls = 'Grupos accesibles'; - $lang->layout_maker = "Marcar el diseño"; - $lang->layout_history = "Actualizar la historia"; - $lang->layout_info = "Información del diseño"; - $lang->layout_list = 'Lista del diseño'; - $lang->downloaded_list = 'Lista de descarga'; - $lang->limit_menu_depth = 'Exhibicion permitido'; - - $lang->cmd_make_child = 'Agregar un submenú'; - $lang->cmd_move_to_installed_list = "Ver la lista de los creadores"; - $lang->cmd_enable_move_menu = "Mover el menú (Mover el menú luego de seleccionar)"; - $lang->cmd_search_mid = "Buscar mid"; - - $lang->msg_cannot_delete_for_child = 'No se puede eliminar un menú si posee un submenú.'; - - $lang->about_title = 'Ingresar el título que sea fácil de identificar al momento de conectar al módulo.'; - $lang->about_menu_management = "Configuración del menú permite construir el menú del diseño seleccionado.\nUsted puede crear el menú hasta el nivel seleccionado y para la información más detallada debe seleccionar el menú ingresado.\nEl menú será expandido al presionar la imagen del directorio.\nSi el menú no se ve correctamente, renueva la informacion presionado el botón\"Rehacer archivo caché\".\n El menú creado sobre el nivel límite podría no verse apropiadamente."; - $lang->about_menu_name = 'El nombre se verá como un nombre de menú si no es un botón del administrador o botón de imagen.'; - $lang->about_menu_url = "Este es el URL al momento de seleccionar el menú.
    Si desea conectar a otro módulo sólo debe colocar el valor de id.
    Si no hay contenido, no pasara nada aun cuando haya presinado el menú."; - $lang->about_menu_open_window = 'Usted puede asignar si desea abrir la página en una nueva ventana al momento de presionar el menú.'; - $lang->about_menu_expand = 'Al usar el menú arbol(tree_menu.js) puede mantener el menú expandido.'; - $lang->about_menu_img_btn = 'Si Usted registra un botón de imagen, ese botón automáticamente reemplazará el botón de texto, y se mostrará en el diseño.'; - $lang->about_menu_group_srls = 'Si tu selecciona el grupo, sólo los usuarios del grupo pueden ver el menú. (Si el archivo xml es abierto directamente, lo mostrará.)'; - - $lang->about_menu = "Módulo del menú te ayudara a crear un sitio completo a través de un conveniente manejo del menú que ordena los módulos creados y conecta con el diseño sin ningún otro trabajo.\nEl menú no es un manejador del sitio, sino que permite conectar los módulos con el diseño y a través del diseño puede expresar variados estilos del menú."; - - $lang->alert_image_only = "Sólo los archivos de imagen pueden ser registradas."; -?> +cmd_menu_insert = 'Crear Menú'; + $lang->cmd_menu_management = 'Comfiguración del Menú'; + + $lang->menu = 'Menú'; + $lang->menu_count = 'Número del menú'; + $lang->menu_management = 'Configuración del Menú'; + $lang->depth = 'Nivel'; + $lang->parent_menu_name = 'Nombre del Menú principal'; + $lang->menu_name = 'Nombre del menú'; + $lang->menu_srl = 'Número característico del menú'; + $lang->menu_id = 'ID del menú'; + $lang->menu_url = 'URL del Menú'; + $lang->menu_open_window = 'Abrir en una nueva ventana'; + $lang->menu_expand = 'Expandir'; + $lang->menu_img_btn = 'Botón de imagen'; + $lang->menu_normal_btn = 'Normal'; + $lang->menu_hover_btn = 'Mouse arriba'; + $lang->menu_active_btn = 'Al momento de seleccionar'; + $lang->menu_group_srls = 'Grupos accesibles'; + $lang->layout_maker = "Marcar el diseño"; + $lang->layout_history = "Actualizar la historia"; + $lang->layout_info = "Información del diseño"; + $lang->layout_list = 'Lista del diseño'; + $lang->downloaded_list = 'Lista de descarga'; + $lang->limit_menu_depth = 'Exhibicion permitido'; + + $lang->cmd_make_child = 'Agregar un submenú'; + $lang->cmd_move_to_installed_list = "Ver la lista de los creadores"; + $lang->cmd_enable_move_menu = "Mover el menú (Mover el menú luego de seleccionar)"; + $lang->cmd_search_mid = "Buscar mid"; + + $lang->msg_cannot_delete_for_child = 'No se puede eliminar un menú si posee un submenú.'; + + $lang->about_title = 'Ingresar el título que sea fácil de identificar al momento de conectar al módulo.'; + $lang->about_menu_management = "Configuración del menú permite construir el menú del diseño seleccionado.\nUsted puede crear el menú hasta el nivel seleccionado y para la información más detallada debe seleccionar el menú ingresado.\nEl menú será expandido al presionar la imagen del directorio.\nSi el menú no se ve correctamente, renueva la informacion presionado el botón\"Rehacer archivo caché\".\n El menú creado sobre el nivel límite podría no verse apropiadamente."; + $lang->about_menu_name = 'El nombre se verá como un nombre de menú si no es un botón del administrador o botón de imagen.'; + $lang->about_menu_url = "Este es el URL al momento de seleccionar el menú.
    Si desea conectar a otro módulo sólo debe colocar el valor de id.
    Si no hay contenido, no pasara nada aun cuando haya presinado el menú."; + $lang->about_menu_open_window = 'Usted puede asignar si desea abrir la página en una nueva ventana al momento de presionar el menú.'; + $lang->about_menu_expand = 'Al usar el menú arbol(tree_menu.js) puede mantener el menú expandido.'; + $lang->about_menu_img_btn = 'Si Usted registra un botón de imagen, ese botón automáticamente reemplazará el botón de texto, y se mostrará en el diseño.'; + $lang->about_menu_group_srls = 'Si tu selecciona el grupo, sólo los usuarios del grupo pueden ver el menú. (Si el archivo xml es abierto directamente, lo mostrará.)'; + + $lang->about_menu = "Módulo del menú te ayudara a crear un sitio completo a través de un conveniente manejo del menú que ordena los módulos creados y conecta con el diseño sin ningún otro trabajo.\nEl menú no es un manejador del sitio, sino que permite conectar los módulos con el diseño y a través del diseño puede expresar variados estilos del menú."; + + $lang->alert_image_only = "Sólo los archivos de imagen pueden ser registradas."; +?> diff --git a/modules/menu/lang/fr.lang.php b/modules/menu/lang/fr.lang.php index e7bbdc8d4..a2ec4022f 100644 --- a/modules/menu/lang/fr.lang.php +++ b/modules/menu/lang/fr.lang.php @@ -1,53 +1,53 @@ - - * @brief Paque du langage en français pour le module de Menu - **/ - - $lang->cmd_menu_insert = 'Créer un Menu'; - $lang->cmd_menu_management = 'Administer des Menus'; - - $lang->menu = 'Menu'; - $lang->menu_count = 'Somme de menu'; - $lang->menu_management = 'Administration de Menu'; - $lang->depth = 'Niveau'; - $lang->parent_menu_name = 'Nom de Menu supérieur'; - $lang->menu_name = 'Nom de Menu'; - $lang->menu_srl = 'Numéro de série de Menu'; - $lang->menu_id = 'Nom d\'Identité de Menu'; - $lang->menu_url = 'URL de Menu'; - $lang->menu_open_window = 'Ouvrire une nouvelle fenêtre'; - $lang->menu_expand = 'Étendre'; - $lang->menu_img_btn = 'Bouton en Image'; - $lang->menu_normal_btn = 'Normal'; - $lang->menu_hover_btn = 'Survolé'; - $lang->menu_active_btn = 'Choisi'; - $lang->menu_group_srls = 'Groupes qui peuvent accéder'; - $lang->layout_maker = "Auteur de la Mise en Page"; - $lang->layout_history = "Histoire des Mises à Jour"; - $lang->layout_info = "Information de la Mise en Page"; - $lang->layout_list = 'Liste des Mises en Page'; - $lang->downloaded_list = 'Liste de Téléchargement'; - $lang->limit_menu_depth = 'Niveau permis d\'exposer'; - - $lang->cmd_make_child = 'Ajouter un menu inférieur'; - $lang->cmd_move_to_installed_list = "Voir la liste créé"; - $lang->cmd_enable_move_menu = "Bouger le Menu (glisser-déposer un menu après cocher)"; - $lang->cmd_search_mid = "Rechercher mid"; - - $lang->msg_cannot_delete_for_child = 'Un menu qui a des menus inférieurs ne peut pas être supprimé.'; - - $lang->about_title = 'Entrez un titre facile à vérifier quand on le connecte à un module.'; - $lang->about_menu_management = "Administration de Menu vous permet de composer le menu dans la Mise en Page que vous choisissez.\nVous pouvez créer le menu jusqu'au niveau permis et entrer des informations détaillées si vou cliquez le menu.\nMenu sera étendu si vous cliquez l'image de dossier.\nSi le menu n'est pas représenté normalement, rafraîchir les informations en cliquant le bouton \"Recréer \'antémémoire de fichier\".\n* Menu cré qui passe plus que le niveau permis pourra être représenté incorrectement."; - $lang->about_menu_name = 'Ce nom sera représenté comme le nom de menu si ce n\'est pas le bouton en image ou le bouton pour administrer.'; - $lang->about_menu_url = "C'est le URL où l'on bouge quand on choisit le menu.
    Vous pouvez entrer la valeur d'identité(nom d'idendité) seulement pour lier à un autre module.
    Si nul contenu n'existe, rien n'aura lieu même si l'on clique le menu."; - $lang->about_menu_open_window = 'Vous pouvez faire ouvrir une page dans une nouvelle fenêtre quand le menu est cliqué.'; - $lang->about_menu_expand = 'L\'Arbre de Menu(tree_menu.js) peut faire resté le menu étendu toujours.'; - $lang->about_menu_img_btn = 'Si vous enrégistez un bouton en image, l\'image remplacera automatiquement le bouton en texte, et ce sera représenté dans la Mise en Page.'; - $lang->about_menu_group_srls = 'Si vous choisissez un groupe, les membres de ce groupe seulement peuvent voir le menu. (Si l\'on ouvre un fichier xml, le fichier sera exposé.)'; - - $lang->about_menu = "Le Module de Menu vous aidrera à établir un site complet par l'administration confortable qui arrange les modules créés et liens à la mise en page sans aucun travaux manuels.\nMenu n'est pas un administrateur du Site, mais il a seulement l'information qui peut lier les modules à la mise en page, et on peut représenter les menu en formes diverses par la mise en page."; - - $lang->alert_image_only = "Fichiers d'image seulement peuvent être enrégistrés."; -?> + + * @brief Paque du langage en français pour le module de Menu + **/ + + $lang->cmd_menu_insert = 'Créer un Menu'; + $lang->cmd_menu_management = 'Administer des Menus'; + + $lang->menu = 'Menu'; + $lang->menu_count = 'Somme de menu'; + $lang->menu_management = 'Administration de Menu'; + $lang->depth = 'Niveau'; + $lang->parent_menu_name = 'Nom de Menu supérieur'; + $lang->menu_name = 'Nom de Menu'; + $lang->menu_srl = 'Numéro de série de Menu'; + $lang->menu_id = 'Nom d\'Identité de Menu'; + $lang->menu_url = 'URL de Menu'; + $lang->menu_open_window = 'Ouvrire une nouvelle fenêtre'; + $lang->menu_expand = 'Étendre'; + $lang->menu_img_btn = 'Bouton en Image'; + $lang->menu_normal_btn = 'Normal'; + $lang->menu_hover_btn = 'Survolé'; + $lang->menu_active_btn = 'Choisi'; + $lang->menu_group_srls = 'Groupes qui peuvent accéder'; + $lang->layout_maker = "Auteur de la Mise en Page"; + $lang->layout_history = "Histoire des Mises à Jour"; + $lang->layout_info = "Information de la Mise en Page"; + $lang->layout_list = 'Liste des Mises en Page'; + $lang->downloaded_list = 'Liste de Téléchargement'; + $lang->limit_menu_depth = 'Niveau permis d\'exposer'; + + $lang->cmd_make_child = 'Ajouter un menu inférieur'; + $lang->cmd_move_to_installed_list = "Voir la liste créé"; + $lang->cmd_enable_move_menu = "Bouger le Menu (glisser-déposer un menu après cocher)"; + $lang->cmd_search_mid = "Rechercher mid"; + + $lang->msg_cannot_delete_for_child = 'Un menu qui a des menus inférieurs ne peut pas être supprimé.'; + + $lang->about_title = 'Entrez un titre facile à vérifier quand on le connecte à un module.'; + $lang->about_menu_management = "Administration de Menu vous permet de composer le menu dans la Mise en Page que vous choisissez.\nVous pouvez créer le menu jusqu'au niveau permis et entrer des informations détaillées si vou cliquez le menu.\nMenu sera étendu si vous cliquez l'image de dossier.\nSi le menu n'est pas représenté normalement, rafraîchir les informations en cliquant le bouton \"Recréer \'antémémoire de fichier\".\n* Menu cré qui passe plus que le niveau permis pourra être représenté incorrectement."; + $lang->about_menu_name = 'Ce nom sera représenté comme le nom de menu si ce n\'est pas le bouton en image ou le bouton pour administrer.'; + $lang->about_menu_url = "C'est le URL où l'on bouge quand on choisit le menu.
    Vous pouvez entrer la valeur d'identité(nom d'idendité) seulement pour lier à un autre module.
    Si nul contenu n'existe, rien n'aura lieu même si l'on clique le menu."; + $lang->about_menu_open_window = 'Vous pouvez faire ouvrir une page dans une nouvelle fenêtre quand le menu est cliqué.'; + $lang->about_menu_expand = 'L\'Arbre de Menu(tree_menu.js) peut faire resté le menu étendu toujours.'; + $lang->about_menu_img_btn = 'Si vous enrégistez un bouton en image, l\'image remplacera automatiquement le bouton en texte, et ce sera représenté dans la Mise en Page.'; + $lang->about_menu_group_srls = 'Si vous choisissez un groupe, les membres de ce groupe seulement peuvent voir le menu. (Si l\'on ouvre un fichier xml, le fichier sera exposé.)'; + + $lang->about_menu = "Le Module de Menu vous aidrera à établir un site complet par l'administration confortable qui arrange les modules créés et liens à la mise en page sans aucun travaux manuels.\nMenu n'est pas un administrateur du Site, mais il a seulement l'information qui peut lier les modules à la mise en page, et on peut représenter les menu en formes diverses par la mise en page."; + + $lang->alert_image_only = "Fichiers d'image seulement peuvent être enrégistrés."; +?> diff --git a/modules/menu/lang/jp.lang.php b/modules/menu/lang/jp.lang.php index 53f64f9b8..f7bb2326f 100644 --- a/modules/menu/lang/jp.lang.php +++ b/modules/menu/lang/jp.lang.php @@ -1,53 +1,53 @@ -cmd_menu_insert = 'メニュー生成'; - $lang->cmd_menu_management = 'メニュー設定'; - - $lang->menu = 'メニュー'; - $lang->menu_count = 'メニュー数'; - $lang->menu_management = 'メニュー管理'; - $lang->depth = 'スレッド'; - $lang->parent_menu_name = '上位メニュー名'; - $lang->menu_name = 'メニュー名'; - $lang->menu_srl = 'メニュー固有番号'; - $lang->menu_id = 'メニュー名'; - $lang->menu_url = 'リンクURL'; - $lang->menu_open_window = '新しいウィンドウズで開く'; - $lang->menu_expand = '拡張表示'; - $lang->menu_img_btn = 'イメージボタン'; - $lang->menu_normal_btn = '一般ボタン'; - $lang->menu_hover_btn = 'マウスオーバー'; - $lang->menu_active_btn = '選択時のボタン'; - $lang->menu_group_srls = 'グループ制限'; - $lang->layout_maker = 'レイアウト作者'; - $lang->layout_history = '変更内容'; - $lang->layout_info = 'レイアウト情報'; - $lang->layout_list = 'レイアウトリスト'; - $lang->downloaded_list = 'ダウンロードリスト'; - $lang->limit_menu_depth = '表示スレッド'; - - $lang->cmd_make_child = '下位メニュー追加'; - $lang->cmd_move_to_installed_list = '生成されたリスト表示'; - $lang->cmd_enable_move_menu = 'メニュー移動(選択後メニューをドラッグして下さい)'; - $lang->cmd_search_mid = 'mid 検索'; - - $lang->msg_cannot_delete_for_child = '下位メニューが存在するメニューは削除出来ません。'; - - $lang->about_title = 'モジュールをリンクする際に分かりやすいタイトルを入力して下さい。'; - $lang->about_menu_management = "メニュー管理は、選択されたレイアウトで使用するメニューを構成出来るようにします。
    一定レベルまでメニューの構成が出来、入力したメニューをクリックすると詳細情報が入力出来ます。
    フォルダーのイメージをクリックするとメニューを拡張することが出来ます。
    もしメニューが正常に表示されない場合は、 「キャッシュファイル再生成」ボタンをクリックして情報を更新して下さい。
    * 一定レベル以上のメニューは正しく表示されない場合があります。"; - $lang->about_menu_name = '管理及びイメージボタンではない場合、メニュー名として表示されるタイトルです。'; - $lang->about_menu_url = 'メニュー選択時、移動するURLです。
    他のモジュールとリンクを張る場合はIDの値のみ入力して下さい。
    内容がない場合は、メニューを選択しても何の動作もありません。'; - $lang->about_menu_open_window = 'メニュー選択時、新しいウィンドウで開くかを指定することが出来ます。'; - $lang->about_menu_expand = 'ツリーメニュー(tree_menu.js)を利用すると常に拡張表示(すべて表示)の状態にすることが出来ます。'; - $lang->about_menu_img_btn = 'イメージボタンを登録するとレイアウトで自動的にイメージボタンに入れ替わって表示されます。'; - $lang->about_menu_group_srls = 'グループを選択すると該当するグループのユーザにのみメニューが表示されます(XMLファイルを直接開くと情報が表示されます)。'; - - $lang->about_menu = "メニューモジュールは、メニュー管理機能にて生成モジュールの整理やレイアウトとのリンクを設定し、簡単に管理者画面上でサイトを構築出来るようにします。\nメニューはサイトを管理するというより、モジュールとレイアウトをリンクし、様々なメニューを表示させる情報だけ持っています。"; - - $lang->alert_image_only = 'イメージ(画像)ファイルのみ登録出来ます。'; -?> +cmd_menu_insert = 'メニュー生成'; + $lang->cmd_menu_management = 'メニュー設定'; + + $lang->menu = 'メニュー'; + $lang->menu_count = 'メニュー数'; + $lang->menu_management = 'メニュー管理'; + $lang->depth = 'スレッド'; + $lang->parent_menu_name = '上位メニュー名'; + $lang->menu_name = 'メニュー名'; + $lang->menu_srl = 'メニュー固有番号'; + $lang->menu_id = 'メニュー名'; + $lang->menu_url = 'リンクURL'; + $lang->menu_open_window = '新しいウィンドウズで開く'; + $lang->menu_expand = '拡張表示'; + $lang->menu_img_btn = 'イメージボタン'; + $lang->menu_normal_btn = '一般ボタン'; + $lang->menu_hover_btn = 'マウスオーバー'; + $lang->menu_active_btn = '選択時のボタン'; + $lang->menu_group_srls = 'グループ制限'; + $lang->layout_maker = 'レイアウト作者'; + $lang->layout_history = '変更内容'; + $lang->layout_info = 'レイアウト情報'; + $lang->layout_list = 'レイアウトリスト'; + $lang->downloaded_list = 'ダウンロードリスト'; + $lang->limit_menu_depth = '表示スレッド'; + + $lang->cmd_make_child = '下位メニュー追加'; + $lang->cmd_move_to_installed_list = '生成されたリスト表示'; + $lang->cmd_enable_move_menu = 'メニュー移動(選択後メニューをドラッグして下さい)'; + $lang->cmd_search_mid = 'mid 検索'; + + $lang->msg_cannot_delete_for_child = '下位メニューが存在するメニューは削除出来ません。'; + + $lang->about_title = 'モジュールをリンクする際に分かりやすいタイトルを入力して下さい。'; + $lang->about_menu_management = "メニュー管理は、選択されたレイアウトで使用するメニューを構成出来るようにします。
    一定レベルまでメニューの構成が出来、入力したメニューをクリックすると詳細情報が入力出来ます。
    フォルダーのイメージをクリックするとメニューを拡張することが出来ます。
    もしメニューが正常に表示されない場合は、 「キャッシュファイル再生成」ボタンをクリックして情報を更新して下さい。
    * 一定レベル以上のメニューは正しく表示されない場合があります。"; + $lang->about_menu_name = '管理及びイメージボタンではない場合、メニュー名として表示されるタイトルです。'; + $lang->about_menu_url = 'メニュー選択時、移動するURLです。
    他のモジュールとリンクを張る場合はIDの値のみ入力して下さい。
    内容がない場合は、メニューを選択しても何の動作もありません。'; + $lang->about_menu_open_window = 'メニュー選択時、新しいウィンドウで開くかを指定することが出来ます。'; + $lang->about_menu_expand = 'ツリーメニュー(tree_menu.js)を利用すると常に拡張表示(すべて表示)の状態にすることが出来ます。'; + $lang->about_menu_img_btn = 'イメージボタンを登録するとレイアウトで自動的にイメージボタンに入れ替わって表示されます。'; + $lang->about_menu_group_srls = 'グループを選択すると該当するグループのユーザにのみメニューが表示されます(XMLファイルを直接開くと情報が表示されます)。'; + + $lang->about_menu = "メニューモジュールは、メニュー管理機能にて生成モジュールの整理やレイアウトとのリンクを設定し、簡単に管理者画面上でサイトを構築出来るようにします。\nメニューはサイトを管理するというより、モジュールとレイアウトをリンクし、様々なメニューを表示させる情報だけ持っています。"; + + $lang->alert_image_only = 'イメージ(画像)ファイルのみ登録出来ます。'; +?> diff --git a/modules/menu/lang/ko.lang.php b/modules/menu/lang/ko.lang.php index c2580e269..a1d72b7c0 100644 --- a/modules/menu/lang/ko.lang.php +++ b/modules/menu/lang/ko.lang.php @@ -1,53 +1,53 @@ -cmd_menu_insert = '메뉴 생성'; - $lang->cmd_menu_management = '메뉴 설정'; - - $lang->menu = '메뉴'; - $lang->menu_count = '메뉴 수'; - $lang->menu_management = '메뉴 관리'; - $lang->depth = '단계'; - $lang->parent_menu_name = '상위 메뉴명'; - $lang->menu_name = '메뉴명'; - $lang->menu_srl = '메뉴 고유 번호'; - $lang->menu_id = '메뉴 이름'; - $lang->menu_url = '연결 url'; - $lang->menu_open_window = '새 창 열기'; - $lang->menu_expand = '펼침'; - $lang->menu_img_btn = '이미지 버튼'; - $lang->menu_normal_btn = '일반'; - $lang->menu_hover_btn = '마우스 오버'; - $lang->menu_active_btn = '선택 시'; - $lang->menu_group_srls = '그룹 제한'; - $lang->layout_maker = '레이아웃 제작자'; - $lang->layout_history = '변경 사항 '; - $lang->layout_info = '레이아웃 정보'; - $lang->layout_list = '레이아웃 목록'; - $lang->downloaded_list = '다운로드 목록'; - $lang->limit_menu_depth = '표시 가능'; - - $lang->cmd_make_child = '하부 메뉴 추가'; - $lang->cmd_move_to_installed_list = '생성된 목록 보기'; - $lang->cmd_enable_move_menu = '메뉴 옮기기 (선택 후, 위 메뉴를 드래그하세요.)'; - $lang->cmd_search_mid = 'mid 찾기'; - - $lang->msg_cannot_delete_for_child = '하부 메뉴가 있는 메뉴는 삭제하실 수 없습니다.'; - - $lang->about_title = '모듈에 연결할 때, 쉽게 구분할 수 있는 제목을 입력해주세요.'; - $lang->about_menu_management = "메뉴관리는 선택하신 레이아웃에서 사용하는 메뉴를 구성할 수 있도록 합니다.\n정해진 단계까지 메뉴를 구성 가능하며 입력하신 메뉴를 클릭하시면 상세 정보를 입력할 수 있습니다.\n폴더 그림을 클릭하시면 메뉴를 확장하실 수 있습니다.\n간혹 메뉴가 정상적으로 나타나지 않으면 \"캐시파일 재생성\" 버튼을 눌러서 정보를 갱신하세요.\n* 정해진 단계 이상의 메뉴는 제대로 표시되지 않을 수 있습니다."; - $lang->about_menu_name = '관리 및 이미지 버튼이 아닐 경우 메뉴 명으로 나타날 제목입니다.'; - $lang->about_menu_url = '메뉴 선택 시 이동할 URL입니다.
    다른 모듈을 연결하고자 할 때는 mid값만 입력해주시면 됩니다.
    내용이 없으면 이 메뉴를 선택해도 아무런 동작이 없습니다.'; - $lang->about_menu_open_window = '메뉴를 선택 했을 때, 새 창을 띄울 것인지 정할 수 있습니다.'; - $lang->about_menu_expand = '트리메뉴(tree_menu.js)를 사용 하면, 메뉴가 늘 펼쳐진 상태로 있게 합니다.'; - $lang->about_menu_img_btn = '이미지 버튼을 등록하면 레이아웃에서 이 메뉴가 이미지 버튼으로 교체되어 표시 됩니다.'; - $lang->about_menu_group_srls = '그룹을 선택하시면 해당 그룹의 사용자만 메뉴가 보이게 됩니다. (xml파일을 직접 열람하면 노출이 됩니다.)'; - - $lang->about_menu = "메뉴모듈은 생성된 모듈을 편리한 메뉴관리기를 통해 정리하고 레이아웃과 연결하여 별도의 수작업 없이 완성된 사이트를 구축하도록 도와줍니다. \n메뉴는 사이트를 관리하기 보다는 모듈과 레이아웃을 연결해 주며 레이아웃을 통해 여러 가지 형태의 메뉴를 표시할 수 있도록 하는 정보만 가지고 있습니다."; - - $lang->alert_image_only = '이미지 파일만 등록 가능합니다.'; -?> +cmd_menu_insert = '메뉴 생성'; + $lang->cmd_menu_management = '메뉴 설정'; + + $lang->menu = '메뉴'; + $lang->menu_count = '메뉴 수'; + $lang->menu_management = '메뉴 관리'; + $lang->depth = '단계'; + $lang->parent_menu_name = '상위 메뉴명'; + $lang->menu_name = '메뉴명'; + $lang->menu_srl = '메뉴 고유 번호'; + $lang->menu_id = '메뉴 이름'; + $lang->menu_url = '연결 url'; + $lang->menu_open_window = '새 창 열기'; + $lang->menu_expand = '펼침'; + $lang->menu_img_btn = '이미지 버튼'; + $lang->menu_normal_btn = '일반'; + $lang->menu_hover_btn = '마우스 오버'; + $lang->menu_active_btn = '선택 시'; + $lang->menu_group_srls = '그룹 제한'; + $lang->layout_maker = '레이아웃 제작자'; + $lang->layout_history = '변경 사항 '; + $lang->layout_info = '레이아웃 정보'; + $lang->layout_list = '레이아웃 목록'; + $lang->downloaded_list = '다운로드 목록'; + $lang->limit_menu_depth = '표시 가능'; + + $lang->cmd_make_child = '하부 메뉴 추가'; + $lang->cmd_move_to_installed_list = '생성된 목록 보기'; + $lang->cmd_enable_move_menu = '메뉴 옮기기 (선택 후, 위 메뉴를 드래그하세요.)'; + $lang->cmd_search_mid = 'mid 찾기'; + + $lang->msg_cannot_delete_for_child = '하부 메뉴가 있는 메뉴는 삭제하실 수 없습니다.'; + + $lang->about_title = '모듈에 연결할 때, 쉽게 구분할 수 있는 제목을 입력해주세요.'; + $lang->about_menu_management = "메뉴관리는 선택하신 레이아웃에서 사용하는 메뉴를 구성할 수 있도록 합니다.\n정해진 단계까지 메뉴를 구성 가능하며 입력하신 메뉴를 클릭하시면 상세 정보를 입력할 수 있습니다.\n폴더 그림을 클릭하시면 메뉴를 확장하실 수 있습니다.\n간혹 메뉴가 정상적으로 나타나지 않으면 \"캐시파일 재생성\" 버튼을 눌러서 정보를 갱신하세요.\n* 정해진 단계 이상의 메뉴는 제대로 표시되지 않을 수 있습니다."; + $lang->about_menu_name = '관리 및 이미지 버튼이 아닐 경우 메뉴 명으로 나타날 제목입니다.'; + $lang->about_menu_url = '메뉴 선택 시 이동할 URL입니다.
    다른 모듈을 연결하고자 할 때는 mid값만 입력해주시면 됩니다.
    내용이 없으면 이 메뉴를 선택해도 아무런 동작이 없습니다.'; + $lang->about_menu_open_window = '메뉴를 선택 했을 때, 새 창을 띄울 것인지 정할 수 있습니다.'; + $lang->about_menu_expand = '트리메뉴(tree_menu.js)를 사용 하면, 메뉴가 늘 펼쳐진 상태로 있게 합니다.'; + $lang->about_menu_img_btn = '이미지 버튼을 등록하면 레이아웃에서 이 메뉴가 이미지 버튼으로 교체되어 표시 됩니다.'; + $lang->about_menu_group_srls = '그룹을 선택하시면 해당 그룹의 사용자만 메뉴가 보이게 됩니다. (xml파일을 직접 열람하면 노출이 됩니다.)'; + + $lang->about_menu = "메뉴모듈은 생성된 모듈을 편리한 메뉴관리기를 통해 정리하고 레이아웃과 연결하여 별도의 수작업 없이 완성된 사이트를 구축하도록 도와줍니다. \n메뉴는 사이트를 관리하기 보다는 모듈과 레이아웃을 연결해 주며 레이아웃을 통해 여러 가지 형태의 메뉴를 표시할 수 있도록 하는 정보만 가지고 있습니다."; + + $lang->alert_image_only = '이미지 파일만 등록 가능합니다.'; +?> diff --git a/modules/menu/lang/ru.lang.php b/modules/menu/lang/ru.lang.php index 6bc903385..b86dc879e 100644 --- a/modules/menu/lang/ru.lang.php +++ b/modules/menu/lang/ru.lang.php @@ -1,53 +1,53 @@ -cmd_menu_insert = 'Создать меню'; - $lang->cmd_menu_management = 'Управление меню'; - - $lang->menu = 'Меню'; - $lang->menu_count = 'Меню No.'; - $lang->menu_management = 'Управление меню'; - $lang->depth = 'Ступень'; - $lang->parent_menu_name = 'Имя верхнего меню'; - $lang->menu_name = 'Имя меню'; - $lang->menu_srl = 'SRL меню'; - $lang->menu_id = 'ID меню'; - $lang->menu_url = 'URL меню'; - $lang->menu_open_window = 'Открыть новое окно'; - $lang->menu_expand = 'Раскрыть'; - $lang->menu_img_btn = 'Изображение кнопки'; - $lang->menu_normal_btn = 'Обычное'; - $lang->menu_hover_btn = 'Мышь над'; - $lang->menu_active_btn = 'При выборе'; - $lang->menu_group_srls = 'Группы с доступом'; - $lang->layout_maker = "Маркет лейаута"; - $lang->layout_history = "История обновлений"; - $lang->layout_info = "Информация лейаутов"; - $lang->layout_list = 'Список лейаутов'; - $lang->downloaded_list = 'Список закачек'; - $lang->limit_menu_depth = 'Лимит глубины'; - - $lang->cmd_make_child = 'Добавть дочернее меню'; - $lang->cmd_move_to_installed_list = "Просмотреть созданные меню"; - $lang->cmd_enable_move_menu = "Переместить меню (Перетащите верхнее меню после выделения)"; - $lang->cmd_search_mid = "Поиск mid"; - - $lang->msg_cannot_delete_for_child = 'Невозможно удалить меню с дочерними меню'; - - $lang->about_title = 'Пожалуйста, введите название меню, которое легко проверить при подключению к модулю'; - $lang->about_menu_management = "Управление меню позволяет Вам заключить меню в вабранный лейаут.\nВы можете создать меню до установленной грубины и ввести информацию детально посредством целчка по нему\nМеню будет разкрыто щелчком по изображению папки.\nЕсли меню не отображается нормально, обновите информацию щелчком по кнопке \"Пересоздать файл кеша\".\n* Меню, созданное за пределами лимита глубины может отображаться неверно."; - $lang->about_menu_name = 'Это имя будет показано, если это не административная книпка или кнопка с изображением.'; - $lang->about_menu_url = "Это URL, связанный с меню.
    Вы можете ввести только ID значение к ссылке на другой модуль.
    Если содержания нет, ничего не произойдет при щелчке по меню."; - $lang->about_menu_open_window = 'Вы можете присвоить это для открытия ссылки в новом окне при щелчке по меню.'; - $lang->about_menu_expand = 'Это позволяет меню оставаться раскрытым, когда древовидное меню (tree_menu.js) используется.'; - $lang->about_menu_img_btn = 'Если Вы регистрируете кнопку с изображением, изображение автоматически заменит текстовую кнопку, и будет показано в лейауте.'; - $lang->about_menu_group_srls = 'Если Вы выберите группу, то только ее члены могут видеть это меню. (если XML файл открыт напрямую, оно будет показано.)'; - - $lang->about_menu = "Модуль меню поможет Вам создать полноценный сайт посредством удобного менеджмента меню, которое расставляет созданные модули и ссылки в лейауты без всякой ручной работы.\nМеню не является менеджером сайта, но оно содержит информацию, которая может связываться с модулями и лейаутами так, что Вы можете выразить различные виды меню."; - - $lang->alert_image_only = "Возможна регистрация только картинок"; -?> +cmd_menu_insert = 'Создать меню'; + $lang->cmd_menu_management = 'Управление меню'; + + $lang->menu = 'Меню'; + $lang->menu_count = 'Меню No.'; + $lang->menu_management = 'Управление меню'; + $lang->depth = 'Ступень'; + $lang->parent_menu_name = 'Имя верхнего меню'; + $lang->menu_name = 'Имя меню'; + $lang->menu_srl = 'SRL меню'; + $lang->menu_id = 'ID меню'; + $lang->menu_url = 'URL меню'; + $lang->menu_open_window = 'Открыть новое окно'; + $lang->menu_expand = 'Раскрыть'; + $lang->menu_img_btn = 'Изображение кнопки'; + $lang->menu_normal_btn = 'Обычное'; + $lang->menu_hover_btn = 'Мышь над'; + $lang->menu_active_btn = 'При выборе'; + $lang->menu_group_srls = 'Группы с доступом'; + $lang->layout_maker = "Маркет лейаута"; + $lang->layout_history = "История обновлений"; + $lang->layout_info = "Информация лейаутов"; + $lang->layout_list = 'Список лейаутов'; + $lang->downloaded_list = 'Список закачек'; + $lang->limit_menu_depth = 'Лимит глубины'; + + $lang->cmd_make_child = 'Добавть дочернее меню'; + $lang->cmd_move_to_installed_list = "Просмотреть созданные меню"; + $lang->cmd_enable_move_menu = "Переместить меню (Перетащите верхнее меню после выделения)"; + $lang->cmd_search_mid = "Поиск mid"; + + $lang->msg_cannot_delete_for_child = 'Невозможно удалить меню с дочерними меню'; + + $lang->about_title = 'Пожалуйста, введите название меню, которое легко проверить при подключению к модулю'; + $lang->about_menu_management = "Управление меню позволяет Вам заключить меню в вабранный лейаут.\nВы можете создать меню до установленной грубины и ввести информацию детально посредством целчка по нему\nМеню будет разкрыто щелчком по изображению папки.\nЕсли меню не отображается нормально, обновите информацию щелчком по кнопке \"Пересоздать файл кеша\".\n* Меню, созданное за пределами лимита глубины может отображаться неверно."; + $lang->about_menu_name = 'Это имя будет показано, если это не административная книпка или кнопка с изображением.'; + $lang->about_menu_url = "Это URL, связанный с меню.
    Вы можете ввести только ID значение к ссылке на другой модуль.
    Если содержания нет, ничего не произойдет при щелчке по меню."; + $lang->about_menu_open_window = 'Вы можете присвоить это для открытия ссылки в новом окне при щелчке по меню.'; + $lang->about_menu_expand = 'Это позволяет меню оставаться раскрытым, когда древовидное меню (tree_menu.js) используется.'; + $lang->about_menu_img_btn = 'Если Вы регистрируете кнопку с изображением, изображение автоматически заменит текстовую кнопку, и будет показано в лейауте.'; + $lang->about_menu_group_srls = 'Если Вы выберите группу, то только ее члены могут видеть это меню. (если XML файл открыт напрямую, оно будет показано.)'; + + $lang->about_menu = "Модуль меню поможет Вам создать полноценный сайт посредством удобного менеджмента меню, которое расставляет созданные модули и ссылки в лейауты без всякой ручной работы.\nМеню не является менеджером сайта, но оно содержит информацию, которая может связываться с модулями и лейаутами так, что Вы можете выразить различные виды меню."; + + $lang->alert_image_only = "Возможна регистрация только картинок"; +?> diff --git a/modules/menu/lang/tr.lang.php b/modules/menu/lang/tr.lang.php index 8d77f222b..10345866e 100644 --- a/modules/menu/lang/tr.lang.php +++ b/modules/menu/lang/tr.lang.php @@ -1,53 +1,53 @@ -cmd_menu_insert = 'Menü Oluştur'; - $lang->cmd_menu_management = 'Menü Yönetimi'; - - $lang->menu = 'Menü'; - $lang->menu_count = 'Menü numarası'; - $lang->menu_management = 'Menü Yönetimi'; - $lang->depth = 'Adım'; - $lang->parent_menu_name = 'Üst Menü İsmi'; - $lang->menu_name = 'Menü İsmi'; - $lang->menu_srl = 'Menü Seri Numarası'; - $lang->menu_id = 'Menü Kimliği'; - $lang->menu_url = 'Menü URLsi'; - $lang->menu_open_window = 'Yeni pencere aç'; - $lang->menu_expand = 'Genişlet'; - $lang->menu_img_btn = 'Resim Tuşu'; - $lang->menu_normal_btn = 'Normal'; - $lang->menu_hover_btn = 'Fare üzerine geldiğinde'; - $lang->menu_active_btn = 'Seçildiğinde'; - $lang->menu_group_srls = 'Erişilebilir Gruplar'; - $lang->layout_maker = "Yerleşim Düzeni Yapıcısı"; - $lang->layout_history = "Güncelleştirme Geçmişi "; - $lang->layout_info = "Yer. Düzeni Bilgisi"; - $lang->layout_list = 'Yer. Düzeni Listesi'; - $lang->downloaded_list = 'İndirilenler Listesi'; - $lang->limit_menu_depth = 'Görüntü Etkinleştirildi'; - - $lang->cmd_make_child = 'Alt Menü Ekle'; - $lang->cmd_move_to_installed_list = "Oluşturulanlar Listesini Görüntüle"; - $lang->cmd_enable_move_menu = "Menüyü Taşı (seçtikten sonra üst menüyü sürükleyin)"; - $lang->cmd_search_mid = "mid Ara"; - - $lang->msg_cannot_delete_for_child = 'Altmenüleri olan bir menü silinemez.'; - - $lang->about_title = 'Modüle bağlanacakken, kolayca onaylanacak başlık giriniz.'; - $lang->about_menu_management = "Menü yönetimi size, seçili yerleşim düzeninde menü oluşturma imkani sunar.\nAyarlanmış derinlikte menü oluşturabilir ve menüye tıklayarak detaylı menü bilgisi girebilirsiniz.\nDosya resmine tıklayınca menü genişletilecektir.\nEğer menü normal görüntülenmiyorsa, \"önbellek dosyasını tekrar oluştur\" tuşuna basarak bilgiyi tazeleyiniz.\n* Menü, derinlik limitini geçecek şekilde oluşturulduysa, düzgün gösterilmeyebilir."; - $lang->about_menu_name = 'İsim, eğer yönetici tuşu veya resimli tuş değilse, menü ismi olarak görünecektir.'; - $lang->about_menu_url = "Menü seçildiğindeki menü URLsidir.
    Sadece diğer menüye köprü olacak id değerini girebilirsiniz.
    Eğer hiçbir içerik yoksa, menüye tıklasanız da hiçbir eylem gerçekleşmeyecektir."; - $lang->about_menu_open_window = 'Menüye tıkladığında, sayfanın yeni pencerede açılmasını belirleyebilirsiniz.'; - $lang->about_menu_expand = 'Bu, menünün agaç-menü(tree_menu.js) haline geldiği zaman geniş kalmasını sağlar.'; - $lang->about_menu_img_btn = 'Eğer bir resimli tuş kaydederseniz, resimli tuş otomatik olarak yazı düğmeciğinin yerini alacaktır ve bu yerleşim düzeninde görüntülenecektir.'; - $lang->about_menu_group_srls = 'Eğer bir grup seçerseniz, sadece grup üyeleri menüyü göreceklerdir. (eğer xml dosyası doğrudan açılırsa, menü görüntülenecektir.)'; - - $lang->about_menu = "Menü modülü size, oluşturulmuş menüleri ve linkleri otomatik yolla yerleşim düzenine uyduran uygun menü yönetim yoluyla bütün bir site oluşturmanıza yardımcı olur.\nMenü site yöneticisi değildir fakat; yerleşim düzenlerine ve modüllere köprüleme bilgisi vardır bu şekilde kendinizi farklı şekillerde ifade edebilirsiniz."; - - $lang->alert_image_only = "Sadece resim dosyaları kaydedilebilir."; -?> +cmd_menu_insert = 'Menü Oluştur'; + $lang->cmd_menu_management = 'Menü Yönetimi'; + + $lang->menu = 'Menü'; + $lang->menu_count = 'Menü numarası'; + $lang->menu_management = 'Menü Yönetimi'; + $lang->depth = 'Adım'; + $lang->parent_menu_name = 'Üst Menü İsmi'; + $lang->menu_name = 'Menü İsmi'; + $lang->menu_srl = 'Menü Seri Numarası'; + $lang->menu_id = 'Menü Kimliği'; + $lang->menu_url = 'Menü URLsi'; + $lang->menu_open_window = 'Yeni pencere aç'; + $lang->menu_expand = 'Genişlet'; + $lang->menu_img_btn = 'Resim Tuşu'; + $lang->menu_normal_btn = 'Normal'; + $lang->menu_hover_btn = 'Fare üzerine geldiğinde'; + $lang->menu_active_btn = 'Seçildiğinde'; + $lang->menu_group_srls = 'Erişilebilir Gruplar'; + $lang->layout_maker = "Yerleşim Düzeni Yapıcısı"; + $lang->layout_history = "Güncelleştirme Geçmişi "; + $lang->layout_info = "Yer. Düzeni Bilgisi"; + $lang->layout_list = 'Yer. Düzeni Listesi'; + $lang->downloaded_list = 'İndirilenler Listesi'; + $lang->limit_menu_depth = 'Görüntü Etkinleştirildi'; + + $lang->cmd_make_child = 'Alt Menü Ekle'; + $lang->cmd_move_to_installed_list = "Oluşturulanlar Listesini Görüntüle"; + $lang->cmd_enable_move_menu = "Menüyü Taşı (seçtikten sonra üst menüyü sürükleyin)"; + $lang->cmd_search_mid = "mid Ara"; + + $lang->msg_cannot_delete_for_child = 'Altmenüleri olan bir menü silinemez.'; + + $lang->about_title = 'Modüle bağlanacakken, kolayca onaylanacak başlık giriniz.'; + $lang->about_menu_management = "Menü yönetimi size, seçili yerleşim düzeninde menü oluşturma imkani sunar.\nAyarlanmış derinlikte menü oluşturabilir ve menüye tıklayarak detaylı menü bilgisi girebilirsiniz.\nDosya resmine tıklayınca menü genişletilecektir.\nEğer menü normal görüntülenmiyorsa, \"önbellek dosyasını tekrar oluştur\" tuşuna basarak bilgiyi tazeleyiniz.\n* Menü, derinlik limitini geçecek şekilde oluşturulduysa, düzgün gösterilmeyebilir."; + $lang->about_menu_name = 'İsim, eğer yönetici tuşu veya resimli tuş değilse, menü ismi olarak görünecektir.'; + $lang->about_menu_url = "Menü seçildiğindeki menü URLsidir.
    Sadece diğer menüye köprü olacak id değerini girebilirsiniz.
    Eğer hiçbir içerik yoksa, menüye tıklasanız da hiçbir eylem gerçekleşmeyecektir."; + $lang->about_menu_open_window = 'Menüye tıkladığında, sayfanın yeni pencerede açılmasını belirleyebilirsiniz.'; + $lang->about_menu_expand = 'Bu, menünün agaç-menü(tree_menu.js) haline geldiği zaman geniş kalmasını sağlar.'; + $lang->about_menu_img_btn = 'Eğer bir resimli tuş kaydederseniz, resimli tuş otomatik olarak yazı düğmeciğinin yerini alacaktır ve bu yerleşim düzeninde görüntülenecektir.'; + $lang->about_menu_group_srls = 'Eğer bir grup seçerseniz, sadece grup üyeleri menüyü göreceklerdir. (eğer xml dosyası doğrudan açılırsa, menü görüntülenecektir.)'; + + $lang->about_menu = "Menü modülü size, oluşturulmuş menüleri ve linkleri otomatik yolla yerleşim düzenine uyduran uygun menü yönetim yoluyla bütün bir site oluşturmanıza yardımcı olur.\nMenü site yöneticisi değildir fakat; yerleşim düzenlerine ve modüllere köprüleme bilgisi vardır bu şekilde kendinizi farklı şekillerde ifade edebilirsiniz."; + + $lang->alert_image_only = "Sadece resim dosyaları kaydedilebilir."; +?> diff --git a/modules/menu/lang/vi.lang.php b/modules/menu/lang/vi.lang.php index a9ed11e80..b9443c25c 100644 --- a/modules/menu/lang/vi.lang.php +++ b/modules/menu/lang/vi.lang.php @@ -1,55 +1,55 @@ -cmd_menu_insert = 'Tạo Menu'; - $lang->cmd_menu_management = 'Quản lý Menu'; - - $lang->menu = 'Menu'; - $lang->menu_count = 'Số Menu'; - $lang->menu_management = 'Quản lý Menu'; - $lang->depth = 'Bước'; - $lang->parent_menu_name = 'Tên Menu chính'; - $lang->menu_name = 'Tên Menu'; - $lang->menu_srl = 'Số Serial của Menu'; - $lang->menu_id = 'Menu ID'; - $lang->menu_url = 'Menu URL'; - $lang->menu_open_window = 'Mở ra trang mới'; - $lang->menu_expand = 'Trải rộng'; - $lang->menu_img_btn = 'Hình nút bấm'; - $lang->menu_normal_btn = 'Bình thường'; - $lang->menu_hover_btn = 'Khi trỏ chuột'; - $lang->menu_active_btn = 'Khi chọn'; - $lang->menu_group_srls = 'Nhóm được phép'; - $lang->layout_maker = "Người tạo giao diện"; - $lang->layout_history = "Lịch sử cập nhật"; - $lang->layout_info = "Thông tin giao diện"; - $lang->layout_list = 'Danh sách giao diện'; - $lang->downloaded_list = 'Danh sách Download'; - $lang->limit_menu_depth = 'Được phép hiển thị'; - - $lang->cmd_make_child = 'Thêm Menu con'; - $lang->cmd_move_to_installed_list = "Xem danh sách đã tạo"; - $lang->cmd_enable_move_menu = "Di chuyển Menu (Kéo lên Menu trên sau khi lựa chọn)"; - $lang->cmd_search_mid = "Tìm kiếm Module"; - - $lang->msg_cannot_delete_for_child = 'Không thể xóa Menu khi có những Menu con.'; - - $lang->about_title = 'Xin hãy nhập tiêu đề để dễ dàng xác minh khi kết nối tới Module.'; - $lang->about_menu_management = "Quản lý Menu cho phép bạn bố trí, chọn cách trình bày của Menu.\nBạn có thể tạo những menu và nhập những thông tin khi menu được lựa chọn.\nMenu sẽ đuwọc trải rộng khi bấm và hình thư mục trên Menu.\nNếu Menu không hiển thị một cách bình thường, hãy làm mới thông tin bằng cách bấm \"Tạo File Cache mới\".\n* Menu được tạo quá giới hạn có thể sẽ không hiển thị được như mong muốn."; - $lang->about_menu_name = 'Tên sẽ hiển thị là Tên Menu nếu không phải là Admin hay nút hình ảnh.'; - $lang->about_menu_url = "Nó sẽ là đường dẫn khi bấm vào Menu.
    Bạn có thể chỉ nhập ID cho đường dẫn của Module.
    Nếu để trống, sẽ không thấy tác dụng gì khi bấm vào Menu."; - $lang->about_menu_open_window = 'Hãy chọn nếu bạn muốn mở ra một trang mới khi bấm vào Menu.'; - $lang->about_menu_expand = 'Cho phép Menu luôn trải ra khi (tree_menu.js) được sử dụng.'; - $lang->about_menu_img_btn = 'Nếu đăng kí nút hình ảnh, hình ảnh sẽ tự động chèn lên tên của Menu, và sẽ hiển thị trong giao diện.'; - $lang->about_menu_group_srls = 'Nếu lựa chọn nhóm, thì chỉ những nhóm được chọn mới thấy được Menu. (nếu File XML trực tiếp mở ra, nó sẽ được hiển thị).'; - - $lang->about_menu = "Menu Module sẽ giúp bạn hoàn thiện một trang Web thông qua việc quản lý và sắp xếp thuận tiện, nó sẽ liên kết tới những Module trong Website.\nMenu không phải là người quản lý, nhiệm vụ của nó chỉ là liên kết và tạo sự phong phú trong Website của bạn."; - - $lang->alert_image_only = "Chỉ được phép sử dụng File hình ảnh."; -?> +cmd_menu_insert = 'Tạo Menu'; + $lang->cmd_menu_management = 'Quản lý Menu'; + + $lang->menu = 'Menu'; + $lang->menu_count = 'Số Menu'; + $lang->menu_management = 'Quản lý Menu'; + $lang->depth = 'Bước'; + $lang->parent_menu_name = 'Tên Menu chính'; + $lang->menu_name = 'Tên Menu'; + $lang->menu_srl = 'Số Serial của Menu'; + $lang->menu_id = 'Menu ID'; + $lang->menu_url = 'Menu URL'; + $lang->menu_open_window = 'Mở ra trang mới'; + $lang->menu_expand = 'Trải rộng'; + $lang->menu_img_btn = 'Hình nút bấm'; + $lang->menu_normal_btn = 'Bình thường'; + $lang->menu_hover_btn = 'Khi trỏ chuột'; + $lang->menu_active_btn = 'Khi chọn'; + $lang->menu_group_srls = 'Nhóm được phép'; + $lang->layout_maker = "Người tạo giao diện"; + $lang->layout_history = "Lịch sử cập nhật"; + $lang->layout_info = "Thông tin giao diện"; + $lang->layout_list = 'Danh sách giao diện'; + $lang->downloaded_list = 'Danh sách Download'; + $lang->limit_menu_depth = 'Được phép hiển thị'; + + $lang->cmd_make_child = 'Thêm Menu con'; + $lang->cmd_move_to_installed_list = "Xem danh sách đã tạo"; + $lang->cmd_enable_move_menu = "Di chuyển Menu (Kéo lên Menu trên sau khi lựa chọn)"; + $lang->cmd_search_mid = "Tìm kiếm Module"; + + $lang->msg_cannot_delete_for_child = 'Không thể xóa Menu khi có những Menu con.'; + + $lang->about_title = 'Xin hãy nhập tiêu đề để dễ dàng xác minh khi kết nối tới Module.'; + $lang->about_menu_management = "Quản lý Menu cho phép bạn bố trí, chọn cách trình bày của Menu.\nBạn có thể tạo những menu và nhập những thông tin khi menu được lựa chọn.\nMenu sẽ đuwọc trải rộng khi bấm và hình thư mục trên Menu.\nNếu Menu không hiển thị một cách bình thường, hãy làm mới thông tin bằng cách bấm \"Tạo File Cache mới\".\n* Menu được tạo quá giới hạn có thể sẽ không hiển thị được như mong muốn."; + $lang->about_menu_name = 'Tên sẽ hiển thị là Tên Menu nếu không phải là Admin hay nút hình ảnh.'; + $lang->about_menu_url = "Nó sẽ là đường dẫn khi bấm vào Menu.
    Bạn có thể chỉ nhập ID cho đường dẫn của Module.
    Nếu để trống, sẽ không thấy tác dụng gì khi bấm vào Menu."; + $lang->about_menu_open_window = 'Hãy chọn nếu bạn muốn mở ra một trang mới khi bấm vào Menu.'; + $lang->about_menu_expand = 'Cho phép Menu luôn trải ra khi (tree_menu.js) được sử dụng.'; + $lang->about_menu_img_btn = 'Nếu đăng kí nút hình ảnh, hình ảnh sẽ tự động chèn lên tên của Menu, và sẽ hiển thị trong giao diện.'; + $lang->about_menu_group_srls = 'Nếu lựa chọn nhóm, thì chỉ những nhóm được chọn mới thấy được Menu. (nếu File XML trực tiếp mở ra, nó sẽ được hiển thị).'; + + $lang->about_menu = "Menu Module sẽ giúp bạn hoàn thiện một trang Web thông qua việc quản lý và sắp xếp thuận tiện, nó sẽ liên kết tới những Module trong Website.\nMenu không phải là người quản lý, nhiệm vụ của nó chỉ là liên kết và tạo sự phong phú trong Website của bạn."; + + $lang->alert_image_only = "Chỉ được phép sử dụng File hình ảnh."; +?> diff --git a/modules/menu/lang/zh-CN.lang.php b/modules/menu/lang/zh-CN.lang.php index 34108b4fe..66c614744 100644 --- a/modules/menu/lang/zh-CN.lang.php +++ b/modules/menu/lang/zh-CN.lang.php @@ -1,53 +1,53 @@ -cmd_menu_insert = '生成菜单'; - $lang->cmd_menu_management = '菜单设置'; - - $lang->menu = '菜单'; - $lang->menu_count = '菜单数'; - $lang->menu_management = '菜单管理'; - $lang->depth = '层级'; - $lang->parent_menu_name = '上级菜单名'; - $lang->menu_name = '菜单名'; - $lang->menu_srl = '菜单固有编号'; - $lang->menu_id = '菜单名称'; - $lang->menu_url = '链接'; - $lang->menu_open_window = '新窗口'; - $lang->menu_expand = '展开'; - $lang->menu_img_btn = '图片按钮'; - $lang->menu_normal_btn = '普通'; - $lang->menu_hover_btn = '鼠标滑过'; - $lang->menu_active_btn = '激活链接'; - $lang->menu_group_srls = '用户组'; - $lang->layout_maker = "布局作者"; - $lang->layout_history = "更新列表 "; - $lang->layout_info = "布局信息"; - $lang->layout_list = '布局目录'; - $lang->downloaded_list = '下载目录'; - $lang->limit_menu_depth = '可显示'; - - $lang->cmd_make_child = '添加下级菜单'; - $lang->cmd_move_to_installed_list = "查看生成目录"; - $lang->cmd_enable_move_menu = "菜单顺序(勾选后用鼠标拖动)"; - $lang->cmd_search_mid = "查找 mid"; - - $lang->msg_cannot_delete_for_child = '有下级菜单的菜单不能删除。'; - - $lang->about_title = '请输入连接模块时容易区分的标题。'; - $lang->about_menu_management = "在此创建要在布局中使用的菜单。\n点击菜单前的文件夹图标可以展开收缩菜单。\n偶尔不能正常显示菜单时,请按\"更新缓冲\"按钮更新信息。\n* 不能正常显示指定级(层级)以上的菜单,创建菜单项的时候,请确认你要使用的布局究竟支持多少级别的菜单。"; - $lang->about_menu_name = '输入不是图片按钮时显示为菜单名标题。'; - $lang->about_menu_url = "点击菜单时要移动的URL。
    连接其他模块时只输入id值即可。
    没有内容时点击菜单也不会有什么动作。"; - $lang->about_menu_open_window = '可以设置点击菜单时是否要在新窗口中打开。'; - $lang->about_menu_expand = '使用树型(tree_menu.js)菜单时总是呈展开状态。'; - $lang->about_menu_img_btn = '如登录图片按钮,在布局中自动替换显示为图片按钮。'; - $lang->about_menu_group_srls = '如选择用户组,只有所属组用户才能看到此菜单。 —(xml文件中不能隐藏)'; - - $lang->about_menu = "菜单模块可以通过菜单管理器整理已生成的模块并同布局相连接来轻松建设一个完整的网站。\n菜单模块虽然具有连接模块和布局并通过布局来显示多种形态菜单的信息,但它不具备管理网站的功能。"; - - $lang->alert_image_only = "只允许图形文件。"; -?> +cmd_menu_insert = '生成菜单'; + $lang->cmd_menu_management = '菜单设置'; + + $lang->menu = '菜单'; + $lang->menu_count = '菜单数'; + $lang->menu_management = '菜单管理'; + $lang->depth = '层级'; + $lang->parent_menu_name = '上级菜单名'; + $lang->menu_name = '菜单名'; + $lang->menu_srl = '菜单固有编号'; + $lang->menu_id = '菜单名称'; + $lang->menu_url = '链接'; + $lang->menu_open_window = '新窗口'; + $lang->menu_expand = '展开'; + $lang->menu_img_btn = '图片按钮'; + $lang->menu_normal_btn = '普通'; + $lang->menu_hover_btn = '鼠标滑过'; + $lang->menu_active_btn = '激活链接'; + $lang->menu_group_srls = '用户组'; + $lang->layout_maker = "布局作者"; + $lang->layout_history = "更新列表 "; + $lang->layout_info = "布局信息"; + $lang->layout_list = '布局目录'; + $lang->downloaded_list = '下载目录'; + $lang->limit_menu_depth = '可显示'; + + $lang->cmd_make_child = '添加下级菜单'; + $lang->cmd_move_to_installed_list = "查看生成目录"; + $lang->cmd_enable_move_menu = "菜单顺序(勾选后用鼠标拖动)"; + $lang->cmd_search_mid = "查找 mid"; + + $lang->msg_cannot_delete_for_child = '有下级菜单的菜单不能删除。'; + + $lang->about_title = '请输入连接模块时容易区分的标题。'; + $lang->about_menu_management = "在此创建要在布局中使用的菜单。\n点击菜单前的文件夹图标可以展开收缩菜单。\n偶尔不能正常显示菜单时,请按\"更新缓冲\"按钮更新信息。\n* 不能正常显示指定级(层级)以上的菜单,创建菜单项的时候,请确认你要使用的布局究竟支持多少级别的菜单。"; + $lang->about_menu_name = '输入不是图片按钮时显示为菜单名标题。'; + $lang->about_menu_url = "点击菜单时要移动的URL。
    连接其他模块时只输入id值即可。
    没有内容时点击菜单也不会有什么动作。"; + $lang->about_menu_open_window = '可以设置点击菜单时是否要在新窗口中打开。'; + $lang->about_menu_expand = '使用树型(tree_menu.js)菜单时总是呈展开状态。'; + $lang->about_menu_img_btn = '如登录图片按钮,在布局中自动替换显示为图片按钮。'; + $lang->about_menu_group_srls = '如选择用户组,只有所属组用户才能看到此菜单。 —(xml文件中不能隐藏)'; + + $lang->about_menu = "菜单模块可以通过菜单管理器整理已生成的模块并同布局相连接来轻松建设一个完整的网站。\n菜单模块虽然具有连接模块和布局并通过布局来显示多种形态菜单的信息,但它不具备管理网站的功能。"; + + $lang->alert_image_only = "只允许图形文件。"; +?> diff --git a/modules/menu/lang/zh-TW.lang.php b/modules/menu/lang/zh-TW.lang.php index af91649ed..23ba5bb6b 100644 --- a/modules/menu/lang/zh-TW.lang.php +++ b/modules/menu/lang/zh-TW.lang.php @@ -1,53 +1,53 @@ -cmd_menu_insert = '建立選單'; - $lang->cmd_menu_management = '選單設置'; - - $lang->menu = '選單'; - $lang->menu_count = '選單數'; - $lang->menu_management = '選單管理'; - $lang->depth = '層級'; - $lang->parent_menu_name = '主選單名稱'; - $lang->menu_name = '選單名稱'; - $lang->menu_srl = '選單編號'; - $lang->menu_id = '選單名稱'; - $lang->menu_url = '連結'; - $lang->menu_open_window = '新視窗'; - $lang->menu_expand = '展開'; - $lang->menu_img_btn = '圖片按鈕'; - $lang->menu_normal_btn = '普通'; - $lang->menu_hover_btn = '滑鼠移過'; - $lang->menu_active_btn = '啟動連結'; - $lang->menu_group_srls = '群組'; - $lang->layout_maker = "版面作者"; - $lang->layout_history = "更新列表"; - $lang->layout_info = "版面資料"; - $lang->layout_list = '版面列表'; - $lang->downloaded_list = '版面選擇'; - $lang->limit_menu_depth = '可顯示'; - - $lang->cmd_make_child = '新增子選單'; - $lang->cmd_move_to_installed_list = "檢視建立列表"; - $lang->cmd_enable_move_menu = "選單順序(勾選後可用滑鼠拖曳)"; - $lang->cmd_search_mid = "尋找 mid"; - - $lang->msg_cannot_delete_for_child = '有子選單的選單不能刪除。'; - - $lang->about_title = '請輸入連接模組時,容易區分的標題。'; - $lang->about_menu_management = "選單管理可以建構所選擇版面中使用的選單。\n不僅可以建構指定級(層級)選單,點擊輸入的選單名稱即可對其進行詳細設置。\n點擊選單前圖標可以展開選單。\n偶爾無法正常顯示選單時,請按\"重新建立暫存檔\"按鈕更新資料。\n* 可能無法正常顯示指定級(層級)以上的選單。"; - $lang->about_menu_name = '輸入不是圖片按鈕時,顯示為選單名標題。'; - $lang->about_menu_url = "按選單名稱後,要移往的網址。
    連結其他模組時,只要輸入模組mid即可。
    沒有內容時,點擊選單不會產生任何事情。"; - $lang->about_menu_open_window = '按選單後,是否要以新視窗開啟。'; - $lang->about_menu_expand = '使用樹型選單(tree_menu.js)時,總是呈現展開狀態。'; - $lang->about_menu_img_btn = '如果登錄圖片按鈕,在版面中會自動替換顯示為圖片按鈕。'; - $lang->about_menu_group_srls = '如果選擇群組,只有所屬群組才能看到此選單。(如果可直接連結xml檔案,內容將無法隱藏)'; - - $lang->about_menu = "選單模組可以透過選單管理器,管理已建立的模組並可和版面相互連結,輕鬆架設一個完整的網站。\n選單模組雖然可連結模組和版面,並透過版面來顯示多種類型的選單,但它不具備管理網站的功能。"; - - $lang->alert_image_only = "只允許圖形檔案。"; -?> +cmd_menu_insert = '建立選單'; + $lang->cmd_menu_management = '選單設置'; + + $lang->menu = '選單'; + $lang->menu_count = '選單數'; + $lang->menu_management = '選單管理'; + $lang->depth = '層級'; + $lang->parent_menu_name = '主選單名稱'; + $lang->menu_name = '選單名稱'; + $lang->menu_srl = '選單編號'; + $lang->menu_id = '選單名稱'; + $lang->menu_url = '連結'; + $lang->menu_open_window = '新視窗'; + $lang->menu_expand = '展開'; + $lang->menu_img_btn = '圖片按鈕'; + $lang->menu_normal_btn = '普通'; + $lang->menu_hover_btn = '滑鼠移過'; + $lang->menu_active_btn = '啟動連結'; + $lang->menu_group_srls = '群組'; + $lang->layout_maker = "版面作者"; + $lang->layout_history = "更新列表"; + $lang->layout_info = "版面資料"; + $lang->layout_list = '版面列表'; + $lang->downloaded_list = '版面選擇'; + $lang->limit_menu_depth = '可顯示'; + + $lang->cmd_make_child = '新增子選單'; + $lang->cmd_move_to_installed_list = "檢視建立列表"; + $lang->cmd_enable_move_menu = "選單順序(勾選後可用滑鼠拖曳)"; + $lang->cmd_search_mid = "尋找 mid"; + + $lang->msg_cannot_delete_for_child = '有子選單的選單不能刪除。'; + + $lang->about_title = '請輸入連接模組時,容易區分的標題。'; + $lang->about_menu_management = "選單管理可以建構所選擇版面中使用的選單。\n不僅可以建構指定級(層級)選單,點擊輸入的選單名稱即可對其進行詳細設置。\n點擊選單前圖標可以展開選單。\n偶爾無法正常顯示選單時,請按\"重新建立暫存檔\"按鈕更新資料。\n* 可能無法正常顯示指定級(層級)以上的選單。"; + $lang->about_menu_name = '輸入不是圖片按鈕時,顯示為選單名標題。'; + $lang->about_menu_url = "按選單名稱後,要移往的網址。
    連結其他模組時,只要輸入模組mid即可。
    沒有內容時,點擊選單不會產生任何事情。"; + $lang->about_menu_open_window = '按選單後,是否要以新視窗開啟。'; + $lang->about_menu_expand = '使用樹型選單(tree_menu.js)時,總是呈現展開狀態。'; + $lang->about_menu_img_btn = '如果登錄圖片按鈕,在版面中會自動替換顯示為圖片按鈕。'; + $lang->about_menu_group_srls = '如果選擇群組,只有所屬群組才能看到此選單。(如果可直接連結xml檔案,內容將無法隱藏)'; + + $lang->about_menu = "選單模組可以透過選單管理器,管理已建立的模組並可和版面相互連結,輕鬆架設一個完整的網站。\n選單模組雖然可連結模組和版面,並透過版面來顯示多種類型的選單,但它不具備管理網站的功能。"; + + $lang->alert_image_only = "只允許圖形檔案。"; +?> diff --git a/modules/menu/menu.admin.controller.php b/modules/menu/menu.admin.controller.php index 1084dc426..7645dfb51 100644 --- a/modules/menu/menu.admin.controller.php +++ b/modules/menu/menu.admin.controller.php @@ -1,654 +1,654 @@ -site_srl = (int)$site_module_info->site_srl; - $args->title = Context::get('title'); - $args->menu_srl = getNextSequence(); - $args->listorder = $args->menu_srl * -1; - - $output = executeQuery('menu.insertMenu', $args); - if(!$output->toBool()) return $output; - - $this->add('menu_srl', $args->menu_srl); - $this->setMessage('success_registed'); - } - - /** - * @brief 메뉴 제목 변경 - **/ - function procMenuAdminUpdate() { - // 입력할 변수 정리 - $args->title = Context::get('title'); - $args->menu_srl = Context::get('menu_srl'); - - $output = executeQuery('menu.updateMenu', $args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_registed'); - } - - /** - * @brief 메뉴 삭제 - * menu_item과 xml 캐시 파일 모두 삭제 - **/ - function procMenuAdminDelete() { - $menu_srl = Context::get('menu_srl'); - return $this->deleteMenu($menu_srl); - } - - function deleteMenu($menu_srl) { - // 캐시 파일 삭제 - $cache_list = FileHandler::readDir("./files/cache/menu","",false,true); - if(count($cache_list)) { - foreach($cache_list as $cache_file) { - $pos = strpos($cache_file, $menu_srl.'_'); - if($pos>0)FileHandler::removeFile($cache_file); - } - } - - // 이미지 버튼 모두 삭제 - $image_path = sprintf('./files/attach/menu_button/%s', $menu_srl); - FileHandler::removeDir($image_path); - - $args->menu_srl = $menu_srl; - - // 메뉴 메뉴 삭제 - $output = executeQuery("menu.deleteMenuItems", $args); - if(!$output->toBool()) return $output; - - // 메뉴 삭제 - $output = executeQuery("menu.deleteMenu", $args); - if(!$output->toBool()) return $output; - - return new Object(0,'success_deleted'); - } - - /** - * @brief 메뉴에 아이템 추가 - **/ - function procMenuAdminInsertItem() { - // 입력할 변수 정리 - $source_args = Context::getRequestVars(); - unset($source_args->module); - unset($source_args->act); - if($source_args->menu_open_window!="Y") $source_args->menu_open_window = "N"; - 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이 달라서) - $args->menu_srl = $source_args->menu_srl; - $args->menu_item_srl = $source_args->menu_item_srl; - $args->parent_srl = $source_args->parent_srl; - $args->menu_srl = $source_args->menu_srl; - $args->menu_id = $source_args->menu_id; - $args->name = $source_args->menu_name; - $args->url = trim($source_args->menu_url); - $args->open_window = $source_args->menu_open_window; - $args->expand = $source_args->menu_expand; - $args->normal_btn = $source_args->normal_btn; - $args->hover_btn = $source_args->hover_btn; - $args->active_btn = $source_args->active_btn; - $args->group_srls = $source_args->group_srls; - - // 이미 존재하는지를 확인 - $oMenuModel = &getAdminModel('menu'); - $item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl); - - // 존재하게 되면 update를 해준다 - if($item_info->menu_item_srl == $args->menu_item_srl) { - $output = executeQuery('menu.updateMenuItem', $args); - if(!$output->toBool()) return $output; - - // 존재하지 않으면 insert를 해준다 - } else { - $args->listorder = -1*$args->menu_item_srl; - $output = executeQuery('menu.insertMenuItem', $args); - if(!$output->toBool()) return $output; - } - - // 해당 메뉴의 정보를 구함 - $menu_info = $oMenuModel->getMenu($args->menu_srl); - $menu_title = $menu_info->title; - - // XML 파일을 갱신하고 위치을 넘겨 받음 - $xml_file = $this->makeXmlFile($args->menu_srl); - - // url이 mid일 경우 기록 남김 - 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에 해당하는 레이아웃 값을 구함 - $output = executeQuery('menu.getMenuLayout', $args); - - // 해당 모듈에 레이아웃 값이 정해져 있지 않으면 지정 - $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의 메뉴값을 선택된 메뉴로 변경 - $oModuleController = &getController('module'); - $oModuleController->updateModuleMenu($mid_args); - } - - $this->add('xml_file', $xml_file); - $this->add('menu_srl', $args->menu_srl); - $this->add('menu_item_srl', $args->menu_item_srl); - $this->add('menu_title', $menu_title); - $this->add('parent_srl', $args->parent_srl); - } - - /** - * @brief 메뉴 메뉴 삭제 - **/ - function procMenuAdminDeleteItem() { - // 변수 정리 - $args = Context::gets('menu_srl','menu_item_srl'); - - $oMenuAdminModel = &getAdminModel('menu'); - - // 원정보를 가져옴 - $item_info = $oMenuAdminModel->getMenuItemInfo($args->menu_item_srl); - if($item_info->parent_srl) $parent_srl = $item_info->parent_srl; - - // 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력 - $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에서 삭제 - $output = executeQuery("menu.deleteMenuItem", $args); - if(!$output->toBool()) return $output; - - // 해당 메뉴의 정보를 구함 - $menu_info = $oMenuAdminModel->getMenu($args->menu_srl); - $menu_title = $menu_info->title; - - // XML 파일을 갱신하고 위치을 넘겨 받음 - $xml_file = $this->makeXmlFile($args->menu_srl); - - // 이미지 버튼 모두 삭제 - 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); - - $this->add('xml_file', $xml_file); - $this->add('menu_title', $menu_title); - $this->add('menu_item_srl', $parent_srl); - $this->setMessage('success_deleted'); - } - - /** - * @brief 메뉴의 메뉴를 이동 - **/ - function procMenuAdminMoveItem() { - $menu_srl = Context::get('menu_srl'); - $mode = Context::get('mode'); - $parent_srl = Context::get('parent_srl'); - $source_srl = Context::get('source_srl'); - $target_srl = Context::get('target_srl'); - - if(!$menu_srl || !$mode || !$target_srl) return new Object(-1,'msg_invalid_request'); - $this->moveMenuItem($menu_srl,$parent_srl,$source_srl,$target_srl,$mode); - } - - function moveMenuItem($menu_srl,$parent_srl,$source_srl,$target_srl,$mode){ - // 원본 메뉴들을 구함 - $oMenuAdminModel = &getAdminModel('menu'); - - $target_item = $oMenuAdminModel->getMenuItemInfo($target_srl); - if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request'); - - // 위치 이동 (순서 조절) - if($mode == 'move') { - $args->parent_srl = $parent_srl; - $args->menu_srl = $menu_srl; - - if($source_srl) { - $source_item = $oMenuAdminModel->getMenuItemInfo($source_srl); - if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request'); - $args->listorder = $source_item->listorder-1; - } else { - $output = executeQuery('menu.getMaxListorder', $args); - if(!$output->toBool()) return $output; - $args->listorder = (int)$output->data->listorder; - if(!$args->listorder) $args->listorder= 0; - } - $args->parent_srl = $parent_srl; - $output = executeQuery('menu.updateMenuItemListorder', $args); - if(!$output->toBool()) return $output; - - $args->parent_srl = $parent_srl; - $args->menu_item_srl = $target_srl; - $output = executeQuery('menu.updateMenuItemNode', $args); - if(!$output->toBool()) return $output; - // 자식으로 추가 - } elseif($mode == 'insert') { - $args->menu_item_srl = $target_srl; - $args->parent_srl = $parent_srl; - $args->listorder = -1*getNextSequence(); - $output = executeQuery('menu.updateMenuItemNode', $args); - if(!$output->toBool()) return $output; - } - - $xml_file = $this->makeXmlFile($menu_srl); - return $xml_file; - } - - /** - * @brief xml 파일을 갱신 - * 관리자페이지에서 메뉴 구성 후 간혹 xml파일이 재생성 안되는 경우가 있는데\n - * 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n - * 개발 중간의 문제인 것 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능 - **/ - function procMenuAdminMakeXmlFile() { - // 입력값을 체크 - $menu_srl = Context::get('menu_srl'); - - // 해당 메뉴의 정보를 구함 - $oMenuAdminModel = &getAdminModel('menu'); - $menu_info = $oMenuAdminModel->getMenu($menu_srl); - $menu_title = $menu_info->title; - - // xml파일 재생성 - $xml_file = $this->makeXmlFile($menu_srl); - - // return 값 설정 - $this->add('menu_title',$menu_title); - $this->add('xml_file',$xml_file); - } - - /** - * @brief 메뉴 이미지 버튼을 등록 - **/ - 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); - - // 필수 요건이 없거나 업로드된 파일이 아니면 오류 발생 - 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')); - - // 요건을 만족하고 업로드된 파일이면 지정된 위치로 이동 - } else { - $tmp_arr = explode('.',$target_file['name']); - $ext = $tmp_arr[count($tmp_arr)-1]; - - $path = sprintf('./files/attach/menu_button/%d/', $menu_srl); - $filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext); - - if(!is_dir($path)) FileHandler::makeDir($path); - - move_uploaded_file($target_file['tmp_name'], $filename); - Context::set('filename', $filename); - } - - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('menu_file_uploaded'); - } - - /** - * @brief 등록된 메뉴 이미지 제거 - **/ - function procMenuAdminDeleteButton() { - $menu_srl = Context::get('menu_srl'); - $menu_item_srl = Context::get('menu_item_srl'); - $target = Context::get('target'); - $filename = Context::get('filename'); - FileHandler::removeFile($filename); - - $this->add('target', $target); - } - - /** - * @brief 메뉴의 xml 파일을 만들고 위치를 return - **/ - function makeXmlFile($menu_srl) { - // xml파일 생성시 필요한 정보가 없으면 그냥 return - if(!$menu_srl) return; - - // 메뉴 정보를 구함 - $args->menu_srl = $menu_srl; - $output = executeQuery('menu.getMenu', $args); - if(!$output->toBool() || !$output->data) return $output; - $site_srl = (int)$output->data->site_srl; - - if($site_srl) { - $oModuleModel = &getModel('module'); - $site_info = $oModuleModel->getSiteInfo($site_srl); - $domain = $site_info->domain; - } - - // DB에서 menu_srl에 해당하는 메뉴 아이템 목록을 listorder순으로 구해옴 - $args->menu_srl = $menu_srl; - $args->sort_index = 'listorder'; - $output = executeQuery('menu.getMenuItems', $args); - if(!$output->toBool()) return; - - // 캐시 파일의 이름을 지정 - $xml_file = sprintf("./files/cache/menu/%s.xml.php", $menu_srl); - $php_file = sprintf("./files/cache/menu/%s.php", $menu_srl); - - // 구해온 데이터가 없다면 노드데이터가 없는 xml 파일만 생성 - $list = $output->data; - if(!$list) { - $xml_buff = ""; - FileHandler::writeFile($xml_file, $xml_buff); - FileHandler::writeFile($php_file, ''); - return $xml_file; - } - - // 구해온 데이터가 하나라면 array로 바꾸어줌 - if(!is_array($list)) $list = array($list); - - // 루프를 돌면서 tree 구성 - $list_count = count($list); - for($i=0;$i<$list_count;$i++) { - $node = $list[$i]; - $menu_item_srl = $node->menu_item_srl; - $parent_srl = $node->parent_srl; - - $tree[$parent_srl][$menu_item_srl] = $node; - } - - // 캐시 파일의 권한과 그룹 설정을 위한 공통 헤더 - $header_script = - '$lang_type = Context::getLangType(); '. - '$is_logged = Context::get(\'is_logged\'); '. - '$logged_info = Context::get(\'logged_info\'); '. - '$site_srl = '.$site_srl.';'. - '$site_admin = false;'. - 'if($site_srl) { '. - '$oModuleModel = &getModel(\'module\');'. - '$site_module_info = $oModuleModel->getSiteInfo($site_srl); '. - 'Context::set(\'site_module_info\',$site_module_info);'. - '$grant = $oModuleModel->getGrant($site_module_info, $logged_info); '. - 'if($grant->manager ==1) $site_admin = true;'. - '}'. - 'if($is_logged) {'. - 'if($logged_info->is_admin=="Y" || $site_admin) $is_admin = true; '. - 'else $is_admin = false; '. - '$group_srls = array_keys($logged_info->group_list); '. - '} else { '. - '$is_admin = false; '. - '$group_srsl = array(); '. - '} '; - - // xml 캐시 파일 생성 (xml캐시는 따로 동작하기에 session 지정을 해주어야 함) - $xml_buff = sprintf( - 'init(); '. - 'header("Content-Type: text/xml; charset=UTF-8"); '. - 'header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); '. - 'header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); '. - 'header("Cache-Control: no-store, no-cache, must-revalidate"); '. - 'header("Cache-Control: post-check=0, pre-check=0", false); '. - 'header("Pragma: no-cache"); '. - '%s '. - '$oContext->close(); '. - '?>'. - '%s', - $header_script, - $this->getXmlTree($tree[0], $tree, $site_srl, $domain) - ); - - // php 캐시 파일 생성 - $php_output = $this->getPhpCacheCode($tree[0], $tree, $site_srl, $domain); - $php_buff = sprintf( - 'list = array(%s); '. - '?>', - $header_script, - $php_output['name'], - $php_output['buff'] - ); - - // 파일 저장 - FileHandler::writeFile($xml_file, $xml_buff); - FileHandler::writeFile($php_file, $php_buff); - return $xml_file; - } - - /** - * @brief array로 정렬된 노드들을 parent_srl을 참조하면서 recursive하게 돌면서 xml 데이터 생성 - * 메뉴 xml파일은 node라는 tag가 중첩으로 사용되며 이 xml doc으로 관리자 페이지에서 메뉴를 구성해줌\n - * (tree_menu.js 에서 xml파일을 바로 읽고 tree menu를 구현) - **/ - function getXmlTree($source_node, $tree, $site_srl, $domain) { - if(!$source_node) return; - - $oMenuAdminModel = &getAdminModel('menu'); - - foreach($source_node as $menu_item_srl => $node) { - $child_buff = ""; - - // 자식 노드의 데이터 가져옴 - if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain); - - // 변수 정리 - $names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl); - foreach($names as $key => $val) { - $name_arr_str .= sprintf('"%s"=>"%s",',$key, str_replace('\\','\\\\',htmlspecialchars($val))); - } - $name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str); - - $url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url); - if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url)) { - $href = getSiteUrl($domain, '','mid',$node->url); - $pos = strpos($href, $_SERVER['HTTP_HOST']); - if($pos !== false) $href = substr($href, $pos+strlen($_SERVER['HTTP_HOST'])); - } else $href = $url; - $open_window = $node->open_window; - $expand = $node->expand; - - $normal_btn = $node->normal_btn; - if($normal_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$normal_btn)) $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$normal_btn); - else $normal_btn = ''; - $hover_btn = $node->hover_btn; - if($hover_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$hover_btn)) $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$hover_btn); - else $hover_btn = ''; - $active_btn = $node->active_btn; - if($active_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$active_btn)) $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$active_btn); - else $active_btn = ''; - - $group_srls = $node->group_srls; - - if($normal_btn) { - if(preg_match('/\.png$/',$normal_btn)) $classname = 'class="iePngFix"'; - else $classname = ''; - if($hover_btn) $hover_str = sprintf('onmouseover="this.src=\'%s\'"', $hover_btn); else $hover_str = ''; - if($active_btn) $active_str = sprintf('onmousedown="this.src=\'%s\'"', $active_btn); else $active_str = ''; - $link = sprintf('<img src="%s" onmouseout="this.src=\'%s\'" alt="" %s %s %s />', $normal_btn, $normal_btn, $hover_str, $active_str, $classname); - } else { - $link = ''; - } - - // node->group_srls값이 있으면 - 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( - 'node_srl="%s" parent_srl="%s" text="" url="" href="" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="%s"', - $menu_item_srl, - $node->parent_srl, - $group_check_code, - $name_str, - $group_check_code, - $url, - $group_check_code, - $href, - $open_window, - $expand, - $normal_btn, - $hover_btn, - $active_btn, - $group_check_code, - $link - ); - - if($child_buff) $buff .= sprintf('%s', $attribute, $child_buff); - else $buff .= sprintf('', $attribute); - } - return $buff; - } - - /** - * @brief array로 정렬된 노드들을 php code로 변경하여 return - * 메뉴에서 메뉴를 tpl에 사용시 xml데이터를 사용할 수도 있지만 별도의 javascript 사용이 필요하기에 - * php로 된 캐시파일을 만들어서 db이용없이 바로 메뉴 정보를 구할 수 있도록 한다 - * 이 캐시는 ModuleHandler::displayContent() 에서 include하여 Context::set() 한다 - **/ - function getPhpCacheCode($source_node, $tree, $site_srl, $domain) { - $output = array("buff"=>"", "url_list"=>array()); - if(!$source_node) return $output; - - $oMenuAdminModel = &getAdminModel('menu'); - - foreach($source_node as $menu_item_srl => $node) { - // 자식 노드가 있으면 자식 노드의 데이터를 먼저 얻어옴 - 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()); - - // 변수 정리 - $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($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) $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"; - - // 변수 정리 - $href = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->href); - $url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url); - if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url)) { - $href = getSiteUrl($domain, '','mid',$node->url); - $pos = strpos($href, $_SERVER['HTTP_HOST']); - if($pos !== false) $href = substr($href, $pos+strlen($_SERVER['HTTP_HOST'])); - } else $href = $url; - $open_window = $node->open_window; - $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->normal_btn); - $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->hover_btn); - $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->active_btn); - $selected = '"'.implode('","',$child_output['url_list']).'"'; - $child_buff = $child_output['buff']; - $expand = $node->expand; - - $normal_btn = $node->normal_btn; - if($normal_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$normal_btn)) $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$normal_btn); - else $normal_btn = ''; - - $hover_btn = $node->hover_btn; - if($hover_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$hover_btn)) $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$hover_btn); - else $hover_btn = ''; - - $active_btn = $node->active_btn; - if($active_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$active_btn)) $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$active_btn); - else $active_btn = ''; - - $group_srls = $node->group_srls; - - if($normal_btn) { - if(preg_match('/\.png$/',$normal_btn)) $classname = 'class=\"iePngFix\"'; - else $classname = ''; - if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = ''; - if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = ''; - $link = sprintf('"\"".$_menu_names[%d][$lang_type]."\""', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str, $classname); - if($active_btn) $link_active = sprintf('"\"".$_menu_names[%d][$lang_type]."\""', $active_btn, $node->menu_item_srl, $classname); - else $link_active = $link; - } else { - $link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl); - } - - // 속성을 생성한다 ( url_list를 이용해서 선택된 메뉴의 노드에 속하는지를 검사한다. 꽁수지만 빠르고 강력하다고 생각;;) - $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, - $node->parent_srl, - $group_check_code, - $node->menu_item_srl, - $group_check_code, - $href, - $group_check_code, - $url, - $open_window, - $normal_btn, - $hover_btn, - $active_btn, - $selected, - $selected, - $expand, - $child_buff, - $group_check_code, - $selected, - $selected, - $link_active, - $link - ); - - // buff 데이터를 생성한다 - $output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute); - $output['name'] .= $name_str; - } - return $output; - } - - /** - * @brief 메뉴와 레이아웃 매핑 - * 레이아웃에서 메뉴를 지정할때 지정된 메뉴의 기본 레이아웃을 매핑 - **/ - function updateMenuLayout($layout_srl, $menu_srl_list) { - if(!count($menu_srl_list)) return; - - // 일단 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 매핑 - for($i=0;$imenu_srl = $menu_srl_list[$i]; - $output = executeQuery('menu.insertMenuLayout', $args); - if(!$output->toBool()) return $output; - } - } - - } -?> +site_srl = (int)$site_module_info->site_srl; + $args->title = Context::get('title'); + $args->menu_srl = getNextSequence(); + $args->listorder = $args->menu_srl * -1; + + $output = executeQuery('menu.insertMenu', $args); + if(!$output->toBool()) return $output; + + $this->add('menu_srl', $args->menu_srl); + $this->setMessage('success_registed'); + } + + /** + * @brief 메뉴 제목 변경 + **/ + function procMenuAdminUpdate() { + // 입력할 변수 정리 + $args->title = Context::get('title'); + $args->menu_srl = Context::get('menu_srl'); + + $output = executeQuery('menu.updateMenu', $args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_registed'); + } + + /** + * @brief 메뉴 삭제 + * menu_item과 xml 캐시 파일 모두 삭제 + **/ + function procMenuAdminDelete() { + $menu_srl = Context::get('menu_srl'); + return $this->deleteMenu($menu_srl); + } + + function deleteMenu($menu_srl) { + // 캐시 파일 삭제 + $cache_list = FileHandler::readDir("./files/cache/menu","",false,true); + if(count($cache_list)) { + foreach($cache_list as $cache_file) { + $pos = strpos($cache_file, $menu_srl.'_'); + if($pos>0)FileHandler::removeFile($cache_file); + } + } + + // 이미지 버튼 모두 삭제 + $image_path = sprintf('./files/attach/menu_button/%s', $menu_srl); + FileHandler::removeDir($image_path); + + $args->menu_srl = $menu_srl; + + // 메뉴 메뉴 삭제 + $output = executeQuery("menu.deleteMenuItems", $args); + if(!$output->toBool()) return $output; + + // 메뉴 삭제 + $output = executeQuery("menu.deleteMenu", $args); + if(!$output->toBool()) return $output; + + return new Object(0,'success_deleted'); + } + + /** + * @brief 메뉴에 아이템 추가 + **/ + function procMenuAdminInsertItem() { + // 입력할 변수 정리 + $source_args = Context::getRequestVars(); + unset($source_args->module); + unset($source_args->act); + if($source_args->menu_open_window!="Y") $source_args->menu_open_window = "N"; + 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이 달라서) + $args->menu_srl = $source_args->menu_srl; + $args->menu_item_srl = $source_args->menu_item_srl; + $args->parent_srl = $source_args->parent_srl; + $args->menu_srl = $source_args->menu_srl; + $args->menu_id = $source_args->menu_id; + $args->name = $source_args->menu_name; + $args->url = trim($source_args->menu_url); + $args->open_window = $source_args->menu_open_window; + $args->expand = $source_args->menu_expand; + $args->normal_btn = $source_args->normal_btn; + $args->hover_btn = $source_args->hover_btn; + $args->active_btn = $source_args->active_btn; + $args->group_srls = $source_args->group_srls; + + // 이미 존재하는지를 확인 + $oMenuModel = &getAdminModel('menu'); + $item_info = $oMenuModel->getMenuItemInfo($args->menu_item_srl); + + // 존재하게 되면 update를 해준다 + if($item_info->menu_item_srl == $args->menu_item_srl) { + $output = executeQuery('menu.updateMenuItem', $args); + if(!$output->toBool()) return $output; + + // 존재하지 않으면 insert를 해준다 + } else { + $args->listorder = -1*$args->menu_item_srl; + $output = executeQuery('menu.insertMenuItem', $args); + if(!$output->toBool()) return $output; + } + + // 해당 메뉴의 정보를 구함 + $menu_info = $oMenuModel->getMenu($args->menu_srl); + $menu_title = $menu_info->title; + + // XML 파일을 갱신하고 위치을 넘겨 받음 + $xml_file = $this->makeXmlFile($args->menu_srl); + + // url이 mid일 경우 기록 남김 + 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에 해당하는 레이아웃 값을 구함 + $output = executeQuery('menu.getMenuLayout', $args); + + // 해당 모듈에 레이아웃 값이 정해져 있지 않으면 지정 + $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의 메뉴값을 선택된 메뉴로 변경 + $oModuleController = &getController('module'); + $oModuleController->updateModuleMenu($mid_args); + } + + $this->add('xml_file', $xml_file); + $this->add('menu_srl', $args->menu_srl); + $this->add('menu_item_srl', $args->menu_item_srl); + $this->add('menu_title', $menu_title); + $this->add('parent_srl', $args->parent_srl); + } + + /** + * @brief 메뉴 메뉴 삭제 + **/ + function procMenuAdminDeleteItem() { + // 변수 정리 + $args = Context::gets('menu_srl','menu_item_srl'); + + $oMenuAdminModel = &getAdminModel('menu'); + + // 원정보를 가져옴 + $item_info = $oMenuAdminModel->getMenuItemInfo($args->menu_item_srl); + if($item_info->parent_srl) $parent_srl = $item_info->parent_srl; + + // 자식 노드가 있는지 체크하여 있으면 삭제 못한다는 에러 출력 + $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에서 삭제 + $output = executeQuery("menu.deleteMenuItem", $args); + if(!$output->toBool()) return $output; + + // 해당 메뉴의 정보를 구함 + $menu_info = $oMenuAdminModel->getMenu($args->menu_srl); + $menu_title = $menu_info->title; + + // XML 파일을 갱신하고 위치을 넘겨 받음 + $xml_file = $this->makeXmlFile($args->menu_srl); + + // 이미지 버튼 모두 삭제 + 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); + + $this->add('xml_file', $xml_file); + $this->add('menu_title', $menu_title); + $this->add('menu_item_srl', $parent_srl); + $this->setMessage('success_deleted'); + } + + /** + * @brief 메뉴의 메뉴를 이동 + **/ + function procMenuAdminMoveItem() { + $menu_srl = Context::get('menu_srl'); + $mode = Context::get('mode'); + $parent_srl = Context::get('parent_srl'); + $source_srl = Context::get('source_srl'); + $target_srl = Context::get('target_srl'); + + if(!$menu_srl || !$mode || !$target_srl) return new Object(-1,'msg_invalid_request'); + $this->moveMenuItem($menu_srl,$parent_srl,$source_srl,$target_srl,$mode); + } + + function moveMenuItem($menu_srl,$parent_srl,$source_srl,$target_srl,$mode){ + // 원본 메뉴들을 구함 + $oMenuAdminModel = &getAdminModel('menu'); + + $target_item = $oMenuAdminModel->getMenuItemInfo($target_srl); + if($target_item->menu_item_srl != $target_srl) return new Object(-1,'msg_invalid_request'); + + // 위치 이동 (순서 조절) + if($mode == 'move') { + $args->parent_srl = $parent_srl; + $args->menu_srl = $menu_srl; + + if($source_srl) { + $source_item = $oMenuAdminModel->getMenuItemInfo($source_srl); + if($source_item->menu_item_srl != $source_srl) return new Object(-1,'msg_invalid_request'); + $args->listorder = $source_item->listorder-1; + } else { + $output = executeQuery('menu.getMaxListorder', $args); + if(!$output->toBool()) return $output; + $args->listorder = (int)$output->data->listorder; + if(!$args->listorder) $args->listorder= 0; + } + $args->parent_srl = $parent_srl; + $output = executeQuery('menu.updateMenuItemListorder', $args); + if(!$output->toBool()) return $output; + + $args->parent_srl = $parent_srl; + $args->menu_item_srl = $target_srl; + $output = executeQuery('menu.updateMenuItemNode', $args); + if(!$output->toBool()) return $output; + // 자식으로 추가 + } elseif($mode == 'insert') { + $args->menu_item_srl = $target_srl; + $args->parent_srl = $parent_srl; + $args->listorder = -1*getNextSequence(); + $output = executeQuery('menu.updateMenuItemNode', $args); + if(!$output->toBool()) return $output; + } + + $xml_file = $this->makeXmlFile($menu_srl); + return $xml_file; + } + + /** + * @brief xml 파일을 갱신 + * 관리자페이지에서 메뉴 구성 후 간혹 xml파일이 재생성 안되는 경우가 있는데\n + * 이럴 경우 관리자의 수동 갱신 기능을 구현해줌\n + * 개발 중간의 문제인 것 같고 현재는 문제가 생기지 않으나 굳이 없앨 필요 없는 기능 + **/ + function procMenuAdminMakeXmlFile() { + // 입력값을 체크 + $menu_srl = Context::get('menu_srl'); + + // 해당 메뉴의 정보를 구함 + $oMenuAdminModel = &getAdminModel('menu'); + $menu_info = $oMenuAdminModel->getMenu($menu_srl); + $menu_title = $menu_info->title; + + // xml파일 재생성 + $xml_file = $this->makeXmlFile($menu_srl); + + // return 값 설정 + $this->add('menu_title',$menu_title); + $this->add('xml_file',$xml_file); + } + + /** + * @brief 메뉴 이미지 버튼을 등록 + **/ + 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); + + // 필수 요건이 없거나 업로드된 파일이 아니면 오류 발생 + 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')); + + // 요건을 만족하고 업로드된 파일이면 지정된 위치로 이동 + } else { + $tmp_arr = explode('.',$target_file['name']); + $ext = $tmp_arr[count($tmp_arr)-1]; + + $path = sprintf('./files/attach/menu_button/%d/', $menu_srl); + $filename = sprintf('%s%d.%s.%s', $path, $menu_item_srl, $target, $ext); + + if(!is_dir($path)) FileHandler::makeDir($path); + + move_uploaded_file($target_file['tmp_name'], $filename); + Context::set('filename', $filename); + } + + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('menu_file_uploaded'); + } + + /** + * @brief 등록된 메뉴 이미지 제거 + **/ + function procMenuAdminDeleteButton() { + $menu_srl = Context::get('menu_srl'); + $menu_item_srl = Context::get('menu_item_srl'); + $target = Context::get('target'); + $filename = Context::get('filename'); + FileHandler::removeFile($filename); + + $this->add('target', $target); + } + + /** + * @brief 메뉴의 xml 파일을 만들고 위치를 return + **/ + function makeXmlFile($menu_srl) { + // xml파일 생성시 필요한 정보가 없으면 그냥 return + if(!$menu_srl) return; + + // 메뉴 정보를 구함 + $args->menu_srl = $menu_srl; + $output = executeQuery('menu.getMenu', $args); + if(!$output->toBool() || !$output->data) return $output; + $site_srl = (int)$output->data->site_srl; + + if($site_srl) { + $oModuleModel = &getModel('module'); + $site_info = $oModuleModel->getSiteInfo($site_srl); + $domain = $site_info->domain; + } + + // DB에서 menu_srl에 해당하는 메뉴 아이템 목록을 listorder순으로 구해옴 + $args->menu_srl = $menu_srl; + $args->sort_index = 'listorder'; + $output = executeQuery('menu.getMenuItems', $args); + if(!$output->toBool()) return; + + // 캐시 파일의 이름을 지정 + $xml_file = sprintf("./files/cache/menu/%s.xml.php", $menu_srl); + $php_file = sprintf("./files/cache/menu/%s.php", $menu_srl); + + // 구해온 데이터가 없다면 노드데이터가 없는 xml 파일만 생성 + $list = $output->data; + if(!$list) { + $xml_buff = ""; + FileHandler::writeFile($xml_file, $xml_buff); + FileHandler::writeFile($php_file, ''); + return $xml_file; + } + + // 구해온 데이터가 하나라면 array로 바꾸어줌 + if(!is_array($list)) $list = array($list); + + // 루프를 돌면서 tree 구성 + $list_count = count($list); + for($i=0;$i<$list_count;$i++) { + $node = $list[$i]; + $menu_item_srl = $node->menu_item_srl; + $parent_srl = $node->parent_srl; + + $tree[$parent_srl][$menu_item_srl] = $node; + } + + // 캐시 파일의 권한과 그룹 설정을 위한 공통 헤더 + $header_script = + '$lang_type = Context::getLangType(); '. + '$is_logged = Context::get(\'is_logged\'); '. + '$logged_info = Context::get(\'logged_info\'); '. + '$site_srl = '.$site_srl.';'. + '$site_admin = false;'. + 'if($site_srl) { '. + '$oModuleModel = &getModel(\'module\');'. + '$site_module_info = $oModuleModel->getSiteInfo($site_srl); '. + 'Context::set(\'site_module_info\',$site_module_info);'. + '$grant = $oModuleModel->getGrant($site_module_info, $logged_info); '. + 'if($grant->manager ==1) $site_admin = true;'. + '}'. + 'if($is_logged) {'. + 'if($logged_info->is_admin=="Y" || $site_admin) $is_admin = true; '. + 'else $is_admin = false; '. + '$group_srls = array_keys($logged_info->group_list); '. + '} else { '. + '$is_admin = false; '. + '$group_srsl = array(); '. + '} '; + + // xml 캐시 파일 생성 (xml캐시는 따로 동작하기에 session 지정을 해주어야 함) + $xml_buff = sprintf( + 'init(); '. + 'header("Content-Type: text/xml; charset=UTF-8"); '. + 'header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); '. + 'header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); '. + 'header("Cache-Control: no-store, no-cache, must-revalidate"); '. + 'header("Cache-Control: post-check=0, pre-check=0", false); '. + 'header("Pragma: no-cache"); '. + '%s '. + '$oContext->close(); '. + '?>'. + '%s', + $header_script, + $this->getXmlTree($tree[0], $tree, $site_srl, $domain) + ); + + // php 캐시 파일 생성 + $php_output = $this->getPhpCacheCode($tree[0], $tree, $site_srl, $domain); + $php_buff = sprintf( + 'list = array(%s); '. + '?>', + $header_script, + $php_output['name'], + $php_output['buff'] + ); + + // 파일 저장 + FileHandler::writeFile($xml_file, $xml_buff); + FileHandler::writeFile($php_file, $php_buff); + return $xml_file; + } + + /** + * @brief array로 정렬된 노드들을 parent_srl을 참조하면서 recursive하게 돌면서 xml 데이터 생성 + * 메뉴 xml파일은 node라는 tag가 중첩으로 사용되며 이 xml doc으로 관리자 페이지에서 메뉴를 구성해줌\n + * (tree_menu.js 에서 xml파일을 바로 읽고 tree menu를 구현) + **/ + function getXmlTree($source_node, $tree, $site_srl, $domain) { + if(!$source_node) return; + + $oMenuAdminModel = &getAdminModel('menu'); + + foreach($source_node as $menu_item_srl => $node) { + $child_buff = ""; + + // 자식 노드의 데이터 가져옴 + if($menu_item_srl&&$tree[$menu_item_srl]) $child_buff = $this->getXmlTree($tree[$menu_item_srl], $tree, $site_srl, $domain); + + // 변수 정리 + $names = $oMenuAdminModel->getMenuItemNames($node->name, $site_srl); + foreach($names as $key => $val) { + $name_arr_str .= sprintf('"%s"=>"%s",',$key, str_replace('\\','\\\\',htmlspecialchars($val))); + } + $name_str = sprintf('$_names = array(%s); print $_names[$lang_type];', $name_arr_str); + + $url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url); + if(preg_match('/^([0-9a-zA-Z\_\-]+)$/', $node->url)) { + $href = getSiteUrl($domain, '','mid',$node->url); + $pos = strpos($href, $_SERVER['HTTP_HOST']); + if($pos !== false) $href = substr($href, $pos+strlen($_SERVER['HTTP_HOST'])); + } else $href = $url; + $open_window = $node->open_window; + $expand = $node->expand; + + $normal_btn = $node->normal_btn; + if($normal_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$normal_btn)) $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$normal_btn); + else $normal_btn = ''; + $hover_btn = $node->hover_btn; + if($hover_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$hover_btn)) $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$hover_btn); + else $hover_btn = ''; + $active_btn = $node->active_btn; + if($active_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$active_btn)) $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$active_btn); + else $active_btn = ''; + + $group_srls = $node->group_srls; + + if($normal_btn) { + if(preg_match('/\.png$/',$normal_btn)) $classname = 'class="iePngFix"'; + else $classname = ''; + if($hover_btn) $hover_str = sprintf('onmouseover="this.src=\'%s\'"', $hover_btn); else $hover_str = ''; + if($active_btn) $active_str = sprintf('onmousedown="this.src=\'%s\'"', $active_btn); else $active_str = ''; + $link = sprintf('<img src="%s" onmouseout="this.src=\'%s\'" alt="" %s %s %s />', $normal_btn, $normal_btn, $hover_str, $active_str, $classname); + } else { + $link = ''; + } + + // node->group_srls값이 있으면 + 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( + 'node_srl="%s" parent_srl="%s" text="" url="" href="" open_window="%s" expand="%s" normal_btn="%s" hover_btn="%s" active_btn="%s" link="%s"', + $menu_item_srl, + $node->parent_srl, + $group_check_code, + $name_str, + $group_check_code, + $url, + $group_check_code, + $href, + $open_window, + $expand, + $normal_btn, + $hover_btn, + $active_btn, + $group_check_code, + $link + ); + + if($child_buff) $buff .= sprintf('%s', $attribute, $child_buff); + else $buff .= sprintf('', $attribute); + } + return $buff; + } + + /** + * @brief array로 정렬된 노드들을 php code로 변경하여 return + * 메뉴에서 메뉴를 tpl에 사용시 xml데이터를 사용할 수도 있지만 별도의 javascript 사용이 필요하기에 + * php로 된 캐시파일을 만들어서 db이용없이 바로 메뉴 정보를 구할 수 있도록 한다 + * 이 캐시는 ModuleHandler::displayContent() 에서 include하여 Context::set() 한다 + **/ + function getPhpCacheCode($source_node, $tree, $site_srl, $domain) { + $output = array("buff"=>"", "url_list"=>array()); + if(!$source_node) return $output; + + $oMenuAdminModel = &getAdminModel('menu'); + + foreach($source_node as $menu_item_srl => $node) { + // 자식 노드가 있으면 자식 노드의 데이터를 먼저 얻어옴 + 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()); + + // 변수 정리 + $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($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) $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"; + + // 변수 정리 + $href = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->href); + $url = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->url); + if(preg_match('/^([0-9a-zA-Z\_\-]+)$/i', $node->url)) { + $href = getSiteUrl($domain, '','mid',$node->url); + $pos = strpos($href, $_SERVER['HTTP_HOST']); + if($pos !== false) $href = substr($href, $pos+strlen($_SERVER['HTTP_HOST'])); + } else $href = $url; + $open_window = $node->open_window; + $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->normal_btn); + $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->hover_btn); + $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$node->active_btn); + $selected = '"'.implode('","',$child_output['url_list']).'"'; + $child_buff = $child_output['buff']; + $expand = $node->expand; + + $normal_btn = $node->normal_btn; + if($normal_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$normal_btn)) $normal_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$normal_btn); + else $normal_btn = ''; + + $hover_btn = $node->hover_btn; + if($hover_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$hover_btn)) $hover_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$hover_btn); + else $hover_btn = ''; + + $active_btn = $node->active_btn; + if($active_btn && preg_match('/^\.\/files\/attach\/menu_button/i',$active_btn)) $active_btn = str_replace(array('&','"','<','>'),array('&','"','<','>'),$active_btn); + else $active_btn = ''; + + $group_srls = $node->group_srls; + + if($normal_btn) { + if(preg_match('/\.png$/',$normal_btn)) $classname = 'class=\"iePngFix\"'; + else $classname = ''; + if($hover_btn) $hover_str = sprintf('onmouseover=\"this.src=\'%s\'\"', $hover_btn); else $hover_str = ''; + if($active_btn) $active_str = sprintf('onmousedown=\"this.src=\'%s\'\"', $active_btn); else $active_str = ''; + $link = sprintf('"\"".$_menu_names[%d][$lang_type]."\""', $normal_btn, $normal_btn, $node->menu_item_srl, $hover_str, $active_str, $classname); + if($active_btn) $link_active = sprintf('"\"".$_menu_names[%d][$lang_type]."\""', $active_btn, $node->menu_item_srl, $classname); + else $link_active = $link; + } else { + $link_active = $link = sprintf('$_menu_names[%d][$lang_type]', $node->menu_item_srl); + } + + // 속성을 생성한다 ( url_list를 이용해서 선택된 메뉴의 노드에 속하는지를 검사한다. 꽁수지만 빠르고 강력하다고 생각;;) + $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, + $node->parent_srl, + $group_check_code, + $node->menu_item_srl, + $group_check_code, + $href, + $group_check_code, + $url, + $open_window, + $normal_btn, + $hover_btn, + $active_btn, + $selected, + $selected, + $expand, + $child_buff, + $group_check_code, + $selected, + $selected, + $link_active, + $link + ); + + // buff 데이터를 생성한다 + $output['buff'] .= sprintf('%s=>array(%s),', $node->menu_item_srl, $attribute); + $output['name'] .= $name_str; + } + return $output; + } + + /** + * @brief 메뉴와 레이아웃 매핑 + * 레이아웃에서 메뉴를 지정할때 지정된 메뉴의 기본 레이아웃을 매핑 + **/ + function updateMenuLayout($layout_srl, $menu_srl_list) { + if(!count($menu_srl_list)) return; + + // 일단 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 매핑 + for($i=0;$imenu_srl = $menu_srl_list[$i]; + $output = executeQuery('menu.insertMenuLayout', $args); + if(!$output->toBool()) return $output; + } + } + + } +?> diff --git a/modules/menu/menu.admin.model.php b/modules/menu/menu.admin.model.php index a1714ef4c..c65dc3937 100644 --- a/modules/menu/menu.admin.model.php +++ b/modules/menu/menu.admin.model.php @@ -1,154 +1,154 @@ -site_srl) { - $site_module_info = Context::get('site_module_info'); - $obj->site_srl = (int)$site_module_info->site_srl; - } - $args->site_srl = $obj->site_srl; - $args->sort_index = $obj->sort_index; - $args->page = $obj->page?$obj->page:1; - $args->list_count = $obj->list_count?$obj->list_count:20; - $args->page_count = $obj->page_count?$obj->page_count:10; - - // document.getDocumentList 쿼리 실행 - $output = executeQuery('menu.getMenuList', $args); - - // 결과가 없거나 오류 발생시 그냥 return - if(!$output->toBool()||!count($output->data)) return $output; - - return $output; - } - - /** - * @brief 등록된 모든 메뉴를 return - **/ - 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에서 정보를 가져옴 - $args->site_srl = $site_srl ; - $args->menu_srl = $menu_srl; - $output = executeQuery('menu.getMenus', $args); - if(!$output->data) return; - $menus = $output->data; - if(!is_array($menus)) $menus = array($menus); - return $menus; - } - - /** - * @brief DB 에 생성된 한개의 메뉴 정보를 구함 - * 생성된 메뉴의 DB정보+XML정보를 return - **/ - function getMenu($menu_srl) { - // 일단 DB에서 정보를 가져옴 - $args->menu_srl = $menu_srl; - $output = executeQuery('menu.getMenu', $args); - if(!$output->data) return; - - $menu_info = $output->data; - $menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_srl); - $menu_info->php_file = sprintf('./files/cache/menu/%s.php',$menu_srl); - return $menu_info; - } - - /** - * @brief 특정 menu_srl의 아이템 정보를 return - * 이 정보중에 group_srls의 경우는 , 로 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴 - **/ - function getMenuItemInfo($menu_item_srl) { - // menu_item_srl이 있으면 해당 메뉴의 정보를 가져온다 - $args->menu_item_srl = $menu_item_srl; - $output = executeQuery('menu.getMenuItem', $args); - $node = $output->data; - if($node->group_srls) $node->group_srls = explode(',',$node->group_srls); - else $node->group_srls = array(); - - $tmp_name = unserialize($node->name); - if($tmp_name && count($tmp_name) ) { - $selected_lang = array(); - $rand_name = $tmp_name[Context::getLangType()]; - if(!$rand_name) $rand_name = array_shift($tmp_name); - $node->name = $rand_name; - } - return $node; - } - - /** - * @brief 다국어 지원을 위해 menu의 name을 언어별로 나눠서 return - */ - 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; - } - - // 언어코드 구함 - $oModuleAdminModel = &getAdminModel('module'); - return $oModuleAdminModel->getLangCode($site_srl, $source_name); - } - - /** - * @brief 특정 menu_srl의 정보를 이용하여 템플릿을 구한후 return - * 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return - **/ - function getMenuAdminTplInfo() { - // 해당 메뉴의 정보를 가져오기 위한 변수 설정 - $menu_item_srl = Context::get('menu_item_srl'); - $parent_srl = Context::get('parent_srl'); - - // 회원 그룹의 목록을 가져옴 - $oMemberModel = &getModel('member'); - $group_list = $oMemberModel->getGroups(); - Context::set('group_list', $group_list); - - // parent_srl이 있고 menu_item_srl이 없으면 하부 메뉴 추가임 - if(!$menu_item_srl && $parent_srl) { - // 상위 메뉴의 정보를 가져옴 - $parent_info = $this->getMenuItemInfo($parent_srl); - - // 추가하려는 메뉴의 기본 변수 설정 - $item_info->menu_item_srl = getNextSequence(); - $item_info->parent_srl = $parent_srl; - $item_info->parent_menu_name = $parent_info->name; - - // root에 메뉴 추가하거나 기존 메뉴의 수정일 경우 - } else { - // menu_item_srl 이 있으면 해당 메뉴의 정보를 가져온다 - if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl); - - // 찾아진 값이 없다면 신규 메뉴 추가로 보고 menu_item_srl값만 구해줌 - if(!$item_info->menu_item_srl) { - $item_info->menu_item_srl = getNextSequence(); - } - } - Context::set('item_info', $item_info); - - // template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다. - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'menu_item_info'); - - $this->add('tpl', str_replace("\n"," ",$tpl)); - } - - } -?> +site_srl) { + $site_module_info = Context::get('site_module_info'); + $obj->site_srl = (int)$site_module_info->site_srl; + } + $args->site_srl = $obj->site_srl; + $args->sort_index = $obj->sort_index; + $args->page = $obj->page?$obj->page:1; + $args->list_count = $obj->list_count?$obj->list_count:20; + $args->page_count = $obj->page_count?$obj->page_count:10; + + // document.getDocumentList 쿼리 실행 + $output = executeQuery('menu.getMenuList', $args); + + // 결과가 없거나 오류 발생시 그냥 return + if(!$output->toBool()||!count($output->data)) return $output; + + return $output; + } + + /** + * @brief 등록된 모든 메뉴를 return + **/ + 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에서 정보를 가져옴 + $args->site_srl = $site_srl ; + $args->menu_srl = $menu_srl; + $output = executeQuery('menu.getMenus', $args); + if(!$output->data) return; + $menus = $output->data; + if(!is_array($menus)) $menus = array($menus); + return $menus; + } + + /** + * @brief DB 에 생성된 한개의 메뉴 정보를 구함 + * 생성된 메뉴의 DB정보+XML정보를 return + **/ + function getMenu($menu_srl) { + // 일단 DB에서 정보를 가져옴 + $args->menu_srl = $menu_srl; + $output = executeQuery('menu.getMenu', $args); + if(!$output->data) return; + + $menu_info = $output->data; + $menu_info->xml_file = sprintf('./files/cache/menu/%s.xml.php',$menu_srl); + $menu_info->php_file = sprintf('./files/cache/menu/%s.php',$menu_srl); + return $menu_info; + } + + /** + * @brief 특정 menu_srl의 아이템 정보를 return + * 이 정보중에 group_srls의 경우는 , 로 연결되어 들어가며 사용시에는 explode를 통해 array로 변환 시킴 + **/ + function getMenuItemInfo($menu_item_srl) { + // menu_item_srl이 있으면 해당 메뉴의 정보를 가져온다 + $args->menu_item_srl = $menu_item_srl; + $output = executeQuery('menu.getMenuItem', $args); + $node = $output->data; + if($node->group_srls) $node->group_srls = explode(',',$node->group_srls); + else $node->group_srls = array(); + + $tmp_name = unserialize($node->name); + if($tmp_name && count($tmp_name) ) { + $selected_lang = array(); + $rand_name = $tmp_name[Context::getLangType()]; + if(!$rand_name) $rand_name = array_shift($tmp_name); + $node->name = $rand_name; + } + return $node; + } + + /** + * @brief 다국어 지원을 위해 menu의 name을 언어별로 나눠서 return + */ + 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; + } + + // 언어코드 구함 + $oModuleAdminModel = &getAdminModel('module'); + return $oModuleAdminModel->getLangCode($site_srl, $source_name); + } + + /** + * @brief 특정 menu_srl의 정보를 이용하여 템플릿을 구한후 return + * 관리자 페이지에서 특정 메뉴의 정보를 추가하기 위해 서버에서 tpl을 컴파일 한후 컴파일 된 html을 직접 return + **/ + function getMenuAdminTplInfo() { + // 해당 메뉴의 정보를 가져오기 위한 변수 설정 + $menu_item_srl = Context::get('menu_item_srl'); + $parent_srl = Context::get('parent_srl'); + + // 회원 그룹의 목록을 가져옴 + $oMemberModel = &getModel('member'); + $group_list = $oMemberModel->getGroups(); + Context::set('group_list', $group_list); + + // parent_srl이 있고 menu_item_srl이 없으면 하부 메뉴 추가임 + if(!$menu_item_srl && $parent_srl) { + // 상위 메뉴의 정보를 가져옴 + $parent_info = $this->getMenuItemInfo($parent_srl); + + // 추가하려는 메뉴의 기본 변수 설정 + $item_info->menu_item_srl = getNextSequence(); + $item_info->parent_srl = $parent_srl; + $item_info->parent_menu_name = $parent_info->name; + + // root에 메뉴 추가하거나 기존 메뉴의 수정일 경우 + } else { + // menu_item_srl 이 있으면 해당 메뉴의 정보를 가져온다 + if($menu_item_srl) $item_info = $this->getMenuItemInfo($menu_item_srl); + + // 찾아진 값이 없다면 신규 메뉴 추가로 보고 menu_item_srl값만 구해줌 + if(!$item_info->menu_item_srl) { + $item_info->menu_item_srl = getNextSequence(); + } + } + Context::set('item_info', $item_info); + + // template 파일을 직접 컴파일한후 tpl변수에 담아서 return한다. + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'menu_item_info'); + + $this->add('tpl', str_replace("\n"," ",$tpl)); + } + + } +?> diff --git a/modules/menu/menu.admin.view.php b/modules/menu/menu.admin.view.php index 54c546b59..23435a494 100644 --- a/modules/menu/menu.admin.view.php +++ b/modules/menu/menu.admin.view.php @@ -1,104 +1,104 @@ -setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 메뉴 관리의 첫 페이지 - **/ - function dispMenuAdminContent() { - // 등록된 메뉴 목록을 구해옴 - $obj->page = Context::get('page'); - $obj->sort_index = 'listorder'; - $obj->list_count = 20; - $obj->page_count = 20; - - $oMenuModel = &getAdminModel('menu'); - $output = $oMenuModel->getMenuList($obj); - - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('menu_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - $this->setTemplateFile('index'); - } - - /** - * @brief 메뉴 등록 페이지 - **/ - function dispMenuAdminInsert() { - // 선택된 메뉴의 정보르 구해서 세팅 - $menu_srl = Context::get('menu_srl'); - - if($menu_srl) { - // 메뉴의 정보를 가져옴 - $oMenuModel = &getAdminModel('menu'); - $menu_info = $oMenuModel->getMenu($menu_srl); - if($menu_info->menu_srl == $menu_srl) Context::set('menu_info', $menu_info); - } - - $this->setTemplateFile('menu_insert'); - } - - /** - * @brief 메뉴 관리 페이지 - **/ - function dispMenuAdminManagement() { - // 선택된 메뉴의 정보르 구해서 세팅 - $menu_srl = Context::get('menu_srl'); - - if(!$menu_srl) return $this->dispMenuAdminContent(); - - // 메뉴의 정보를 가져옴 - $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); - - // 레이아웃을 팝업으로 지정 - $this->setTemplateFile('menu_management'); - } - - - /** - * @brief 메뉴에서 선택할 수 있는 mid목록을 보여줌 - **/ - function dispMenuAdminMidList() { - $oModuleModel = &getModel('module'); - - // 모듈 카테고리 목록을 구함 - $module_category = $oModuleModel->getModuleCategories(); - Context::set('module_category', $module_category); - - // 모듈 목록을 구함 - $module_list = $oModuleModel->getModuleList(); - Context::set('module_list', $module_list); - - // 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); - - // 메뉴을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('mid_list'); - } - } -?> +setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 메뉴 관리의 첫 페이지 + **/ + function dispMenuAdminContent() { + // 등록된 메뉴 목록을 구해옴 + $obj->page = Context::get('page'); + $obj->sort_index = 'listorder'; + $obj->list_count = 20; + $obj->page_count = 20; + + $oMenuModel = &getAdminModel('menu'); + $output = $oMenuModel->getMenuList($obj); + + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('menu_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('index'); + } + + /** + * @brief 메뉴 등록 페이지 + **/ + function dispMenuAdminInsert() { + // 선택된 메뉴의 정보르 구해서 세팅 + $menu_srl = Context::get('menu_srl'); + + if($menu_srl) { + // 메뉴의 정보를 가져옴 + $oMenuModel = &getAdminModel('menu'); + $menu_info = $oMenuModel->getMenu($menu_srl); + if($menu_info->menu_srl == $menu_srl) Context::set('menu_info', $menu_info); + } + + $this->setTemplateFile('menu_insert'); + } + + /** + * @brief 메뉴 관리 페이지 + **/ + function dispMenuAdminManagement() { + // 선택된 메뉴의 정보르 구해서 세팅 + $menu_srl = Context::get('menu_srl'); + + if(!$menu_srl) return $this->dispMenuAdminContent(); + + // 메뉴의 정보를 가져옴 + $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); + + // 레이아웃을 팝업으로 지정 + $this->setTemplateFile('menu_management'); + } + + + /** + * @brief 메뉴에서 선택할 수 있는 mid목록을 보여줌 + **/ + function dispMenuAdminMidList() { + $oModuleModel = &getModel('module'); + + // 모듈 카테고리 목록을 구함 + $module_category = $oModuleModel->getModuleCategories(); + Context::set('module_category', $module_category); + + // 모듈 목록을 구함 + $module_list = $oModuleModel->getModuleList(); + Context::set('module_list', $module_list); + + // 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); + + // 메뉴을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 파일 지정 + $this->setTemplateFile('mid_list'); + } + } +?> diff --git a/modules/menu/menu.class.php b/modules/menu/menu.class.php index 4a2ba9f5c..f16fccce9 100644 --- a/modules/menu/menu.class.php +++ b/modules/menu/menu.class.php @@ -1,67 +1,67 @@ -isColumnExists('menu', 'site_srl')) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB = &DB::getInstance(); - - // 2009. 02. 11 menu 테이블에 site_srl 추가 - if(!$oDB->isColumnExists('menu', 'site_srl')) { - $oDB->addColumn('menu','site_srl','number',11,0,true); - } - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - // 메뉴 모듈의 캐시 파일 모두 삭제 - FileHandler::removeFilesInDir("./files/cache/menu"); - - $oMenuAdminController = &getAdminController('menu'); - - // 블로그 모듈 목록을 모두 구함 - $output = executeQueryArray("menu.getMenus"); - $list = $output->data; - if(!count($list)) return; - - // 메뉴 모듈에서 사용되는 모든 메뉴 목록을 재 생성 - foreach($list as $menu_item) { - $menu_srl = $menu_item->menu_srl; - $oMenuAdminController->makeXmlFile($menu_srl); - } - } - } -?> +isColumnExists('menu', 'site_srl')) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB = &DB::getInstance(); + + // 2009. 02. 11 menu 테이블에 site_srl 추가 + if(!$oDB->isColumnExists('menu', 'site_srl')) { + $oDB->addColumn('menu','site_srl','number',11,0,true); + } + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + // 메뉴 모듈의 캐시 파일 모두 삭제 + FileHandler::removeFilesInDir("./files/cache/menu"); + + $oMenuAdminController = &getAdminController('menu'); + + // 블로그 모듈 목록을 모두 구함 + $output = executeQueryArray("menu.getMenus"); + $list = $output->data; + if(!count($list)) return; + + // 메뉴 모듈에서 사용되는 모든 메뉴 목록을 재 생성 + foreach($list as $menu_item) { + $menu_srl = $menu_item->menu_srl; + $oMenuAdminController->makeXmlFile($menu_srl); + } + } + } +?> diff --git a/modules/menu/tpl/css/mmenu.css b/modules/menu/tpl/css/mmenu.css index ca44f408e..9c497dfde 100644 --- a/modules/menu/tpl/css/mmenu.css +++ b/modules/menu/tpl/css/mmenu.css @@ -1,19 +1,19 @@ -@charset "utf-8"; -/* Mobile XE (/modules/menu/tpl/menu.html) */ -.bd{background:#f8f8f8;padding:1px 0} -/* Global Navigation */ -.gn{margin:0;padding:0;list-style:none;background:#d3d1cc;text-shadow:1px 1px 0 #fff;font-size:14px} -.gn li{background:#c3c3c3;border:1px solid #a3a09a;border-left:0;border-right:0;margin:0 0 -1px 0} -.gn li li{background:#f8f8f8;border:1px solid #c9c9c9;border-left:0;border-right:0} -.gn li li li{background:#e8e8e8} -.gn ul{margin:0 0 -1px 0;padding:0;list-style:none} -.gn a{position:relative;text-decoration:none;display:block;padding:10px} -.gn li a{color:#333} -.gn li a:after{position:absolute;top:7px;right:10px;content:"›";color:#888;font-size:18px;font-weight:bold;font-family:Verdana, Geneva, sans-serif} -.gn li li a:before{content:"";display:inline-block;width:6px;height:6px;border:1px dotted #666;border-top:0;border-right:0;margin:0 4px 0 0;vertical-align:top} -.gn li li a{padding-left:15px} -.gn li li li a{padding-left:30px} -.gn li li li li a{padding-left:45px} -.gn li li li li li a{padding-left:60px} -.gn em{color:#f63;font-size:12px} - +@charset "utf-8"; +/* Mobile XE (/modules/menu/tpl/menu.html) */ +.bd{background:#f8f8f8;padding:1px 0} +/* Global Navigation */ +.gn{margin:0;padding:0;list-style:none;background:#d3d1cc;text-shadow:1px 1px 0 #fff;font-size:14px} +.gn li{background:#c3c3c3;border:1px solid #a3a09a;border-left:0;border-right:0;margin:0 0 -1px 0} +.gn li li{background:#f8f8f8;border:1px solid #c9c9c9;border-left:0;border-right:0} +.gn li li li{background:#e8e8e8} +.gn ul{margin:0 0 -1px 0;padding:0;list-style:none} +.gn a{position:relative;text-decoration:none;display:block;padding:10px} +.gn li a{color:#333} +.gn li a:after{position:absolute;top:7px;right:10px;content:"›";color:#888;font-size:18px;font-weight:bold;font-family:Verdana, Geneva, sans-serif} +.gn li li a:before{content:"";display:inline-block;width:6px;height:6px;border:1px dotted #666;border-top:0;border-right:0;margin:0 4px 0 0;vertical-align:top} +.gn li li a{padding-left:15px} +.gn li li li a{padding-left:30px} +.gn li li li li a{padding-left:45px} +.gn li li li li li a{padding-left:60px} +.gn em{color:#f63;font-size:12px} + diff --git a/modules/menu/tpl/index.html b/modules/menu/tpl/index.html index 8b2823057..3dd1fff47 100644 --- a/modules/menu/tpl/index.html +++ b/modules/menu/tpl/index.html @@ -1,51 +1,51 @@ - - - - - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->regdate}
     
    {$no}{htmlspecialchars($val->title)}{zdate($val->regdate,"Y-m-d")}{$lang->cmd_setup}{$lang->cmd_delete}
    - {$lang->cmd_make} -
    - - - + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->regdate}
     
    {$no}{htmlspecialchars($val->title)}{zdate($val->regdate,"Y-m-d")}{$lang->cmd_setup}{$lang->cmd_delete}
    + {$lang->cmd_make} +
    + + + diff --git a/modules/menu/tpl/js/menu_tree.js b/modules/menu/tpl/js/menu_tree.js index adb56f8d1..ef9028a82 100644 --- a/modules/menu/tpl/js/menu_tree.js +++ b/modules/menu/tpl/js/menu_tree.js @@ -1,174 +1,174 @@ -function Tree(url){ - // clear tree; - jQuery('#menu > ul > li > ul').remove(); - - if(jQuery("ul.simpleTree > li > a").size() ==0)jQuery(''+lang_cmd_insert+'').bind("click",function(e){addNode(0,e);}).appendTo("ul.simpleTree > li"); - - //ajax get data and transeform ul il - jQuery.get(url,function(data){ - jQuery(data).find("node").each(function(i){ - var text = jQuery(this).attr("text"); - var node_srl = jQuery(this).attr("node_srl"); - var parent_srl = jQuery(this).attr("parent_srl"); - var url = jQuery(this).attr("url"); - - // node - var node = jQuery('
  • '+text+'
  • '); - - // button - jQuery(''+lang_cmd_insert+'').bind("click",function(e){ - addNode(node_srl,e); - return false; - }).appendTo(node); - - jQuery(''+lang_cmd_modify+'').bind("click",function(e){ - modifyNode(node_srl,e); - return false; - }).appendTo(node); - - jQuery(''+lang_cmd_delete+'').bind("click",function(e){ - deleteNode(node_srl); - return false; - }).appendTo(node); - - // insert parent child - if(parent_srl>0){ - if(jQuery('#tree_'+parent_srl+'>ul').length==0) jQuery('#tree_'+parent_srl).append(jQuery('
      ')); - jQuery('#tree_'+parent_srl+'> ul').append(node); - }else{ - if(jQuery('#menu ul.simpleTree > li > ul').length==0) jQuery("
        ").appendTo('#menu ul.simpleTree > li'); - jQuery('#menu ul.simpleTree > li > ul').append(node); - } - - }); - - //button show hide - jQuery("#menu li").each(function(){ - if(jQuery(this).parents('ul').size() > max_menu_depth) jQuery("a.add",this).hide(); - if(jQuery(">ul",this).size()>0) jQuery(">a.delete",this).hide(); - }); - - - // draw tree - simpleTreeCollection = jQuery('.simpleTree').simpleTree({ - autoclose: false, - afterClick:function(node){ - //alert("text-"+jQuery('span:first',node).text()); - }, - afterDblClick:function(node){ - //alert("text-"+jQuery('span:first',node).text()); - }, - afterMove:function(destination, source, pos){ - - jQuery("#menu_zone_info").html(""); - - if(destination.size() == 0){ - Tree(xml_url); - return; - } - var menu_srl = jQuery("#fo_menu input[name=menu_srl]").val(); - var parent_srl = destination.attr('id').replace(/.*_/g,''); - var target_srl = source.attr('id').replace(/.*_/g,''); - var brothers = jQuery('#'+destination.attr('id')+' > ul > li:not([class^=line])').length; - var mode = brothers >1 ? 'move':'insert'; - var source_srl = pos == 0 ? 0: source.prevAll("li:not(.line)").get(0).id.replace(/.*_/g,''); - - jQuery.exec_json("menu.procMenuAdminMoveItem",{"menu_srl":menu_srl,"parent_srl":parent_srl,"target_srl":target_srl,"source_srl":source_srl,"mode":mode}, - function(data){ - if(data.error>0) Tree(xml_url); - }); - - }, - - // i want you !! made by sol - beforeMovedToLine : function(destination, source, pos){ -// if(typeof(destination.id) == 'undefined') return false; - return (jQuery(destination).parents('ul').size() + jQuery('ul',source).size() <= max_menu_depth); - }, - - // i want you !! made by sol - beforeMovedToFolder : function(destination, source, pos){ -// if(typeof(destination.id) == 'undefined') return false; - return (jQuery(destination).parents('ul').size() + jQuery('ul',source).size() <= max_menu_depth-1); - }, - afterAjax:function() - { - //alert('Loaded'); - }, - animate:true - ,docToFolderConvert:true - }); - - - // image url replace -// jQuery("#menu ul.simpleTree img").attr("src",function(){ return jQuery(this).attr("src").replace("images/","./common/js/plugins/ui.tree/images/");}); - - - - - // open all node - nodeToggleAll(); - },"xml"); -} - -function nodeToggleAll(){ - jQuery("[class*=close]", simpleTreeCollection[0]).each(function(){ - simpleTreeCollection[0].nodeToggle(this); - }); -} - - - -function modifyNode(node_srl,e){ - jQuery('#menu_zone_info').html(''); - jQuery("#tree_"+node_srl+" > span").click(); - var params ={ - "parent_srl":0 - ,"menu_item_srl":node_srl - }; - - jQuery.exec_json('menu.getMenuAdminTplInfo', params, function(data){ - jQuery('#menu_zone_info').html(data.tpl).css('position','absolute').css("left",e.pageX).css("top",e.pageY).css('display','block'); - }); -} - -function addNode(node_srl,e){ - - jQuery('#menu_zone_info').html(''); - jQuery("#tree_"+node_srl+" > span").click(); - - var params ={ - "menu_item_srl":0 - ,"parent_srl":node_srl - }; - - jQuery.exec_json('menu.getMenuAdminTplInfo', params, function(data){ - jQuery('#menu_zone_info').html(data.tpl).css('position','absolute').css("left",e.pageX).css("top",e.pageY).css('display','block'); - }); -} - - -function deleteNode(node_srl){ - - if(confirm(lang_confirm_delete)){ - jQuery('#menu_zone_info').html(''); - var params ={ - "menu_item_srl":node_srl - ,"menu_srl":jQuery("form input[name=menu_srl]").val() - }; - jQuery.exec_json('menu.procMenuAdminDeleteItem', params, function(data){ - Tree(xml_url); - }); - } -} - - -function completeInsertMenuItem(ret_obj) { - jQuery('#menu_zone_info').html(''); - Tree(xml_url); -} - -function doMoveMenuInfo() { - var $ = jQuery; - $(function(){ $('#fo_menu').appendTo(document.body); $('#menu_zone_info').css('width', '550px'); }); -} +function Tree(url){ + // clear tree; + jQuery('#menu > ul > li > ul').remove(); + + if(jQuery("ul.simpleTree > li > a").size() ==0)jQuery(''+lang_cmd_insert+'').bind("click",function(e){addNode(0,e);}).appendTo("ul.simpleTree > li"); + + //ajax get data and transeform ul il + jQuery.get(url,function(data){ + jQuery(data).find("node").each(function(i){ + var text = jQuery(this).attr("text"); + var node_srl = jQuery(this).attr("node_srl"); + var parent_srl = jQuery(this).attr("parent_srl"); + var url = jQuery(this).attr("url"); + + // node + var node = jQuery('
      • '+text+'
      • '); + + // button + jQuery(''+lang_cmd_insert+'').bind("click",function(e){ + addNode(node_srl,e); + return false; + }).appendTo(node); + + jQuery(''+lang_cmd_modify+'').bind("click",function(e){ + modifyNode(node_srl,e); + return false; + }).appendTo(node); + + jQuery(''+lang_cmd_delete+'').bind("click",function(e){ + deleteNode(node_srl); + return false; + }).appendTo(node); + + // insert parent child + if(parent_srl>0){ + if(jQuery('#tree_'+parent_srl+'>ul').length==0) jQuery('#tree_'+parent_srl).append(jQuery('
          ')); + jQuery('#tree_'+parent_srl+'> ul').append(node); + }else{ + if(jQuery('#menu ul.simpleTree > li > ul').length==0) jQuery("
            ").appendTo('#menu ul.simpleTree > li'); + jQuery('#menu ul.simpleTree > li > ul').append(node); + } + + }); + + //button show hide + jQuery("#menu li").each(function(){ + if(jQuery(this).parents('ul').size() > max_menu_depth) jQuery("a.add",this).hide(); + if(jQuery(">ul",this).size()>0) jQuery(">a.delete",this).hide(); + }); + + + // draw tree + simpleTreeCollection = jQuery('.simpleTree').simpleTree({ + autoclose: false, + afterClick:function(node){ + //alert("text-"+jQuery('span:first',node).text()); + }, + afterDblClick:function(node){ + //alert("text-"+jQuery('span:first',node).text()); + }, + afterMove:function(destination, source, pos){ + + jQuery("#menu_zone_info").html(""); + + if(destination.size() == 0){ + Tree(xml_url); + return; + } + var menu_srl = jQuery("#fo_menu input[name=menu_srl]").val(); + var parent_srl = destination.attr('id').replace(/.*_/g,''); + var target_srl = source.attr('id').replace(/.*_/g,''); + var brothers = jQuery('#'+destination.attr('id')+' > ul > li:not([class^=line])').length; + var mode = brothers >1 ? 'move':'insert'; + var source_srl = pos == 0 ? 0: source.prevAll("li:not(.line)").get(0).id.replace(/.*_/g,''); + + jQuery.exec_json("menu.procMenuAdminMoveItem",{"menu_srl":menu_srl,"parent_srl":parent_srl,"target_srl":target_srl,"source_srl":source_srl,"mode":mode}, + function(data){ + if(data.error>0) Tree(xml_url); + }); + + }, + + // i want you !! made by sol + beforeMovedToLine : function(destination, source, pos){ +// if(typeof(destination.id) == 'undefined') return false; + return (jQuery(destination).parents('ul').size() + jQuery('ul',source).size() <= max_menu_depth); + }, + + // i want you !! made by sol + beforeMovedToFolder : function(destination, source, pos){ +// if(typeof(destination.id) == 'undefined') return false; + return (jQuery(destination).parents('ul').size() + jQuery('ul',source).size() <= max_menu_depth-1); + }, + afterAjax:function() + { + //alert('Loaded'); + }, + animate:true + ,docToFolderConvert:true + }); + + + // image url replace +// jQuery("#menu ul.simpleTree img").attr("src",function(){ return jQuery(this).attr("src").replace("images/","./common/js/plugins/ui.tree/images/");}); + + + + + // open all node + nodeToggleAll(); + },"xml"); +} + +function nodeToggleAll(){ + jQuery("[class*=close]", simpleTreeCollection[0]).each(function(){ + simpleTreeCollection[0].nodeToggle(this); + }); +} + + + +function modifyNode(node_srl,e){ + jQuery('#menu_zone_info').html(''); + jQuery("#tree_"+node_srl+" > span").click(); + var params ={ + "parent_srl":0 + ,"menu_item_srl":node_srl + }; + + jQuery.exec_json('menu.getMenuAdminTplInfo', params, function(data){ + jQuery('#menu_zone_info').html(data.tpl).css('position','absolute').css("left",e.pageX).css("top",e.pageY).css('display','block'); + }); +} + +function addNode(node_srl,e){ + + jQuery('#menu_zone_info').html(''); + jQuery("#tree_"+node_srl+" > span").click(); + + var params ={ + "menu_item_srl":0 + ,"parent_srl":node_srl + }; + + jQuery.exec_json('menu.getMenuAdminTplInfo', params, function(data){ + jQuery('#menu_zone_info').html(data.tpl).css('position','absolute').css("left",e.pageX).css("top",e.pageY).css('display','block'); + }); +} + + +function deleteNode(node_srl){ + + if(confirm(lang_confirm_delete)){ + jQuery('#menu_zone_info').html(''); + var params ={ + "menu_item_srl":node_srl + ,"menu_srl":jQuery("form input[name=menu_srl]").val() + }; + jQuery.exec_json('menu.procMenuAdminDeleteItem', params, function(data){ + Tree(xml_url); + }); + } +} + + +function completeInsertMenuItem(ret_obj) { + jQuery('#menu_zone_info').html(''); + Tree(xml_url); +} + +function doMoveMenuInfo() { + var $ = jQuery; + $(function(){ $('#fo_menu').appendTo(document.body); $('#menu_zone_info').css('width', '550px'); }); +} diff --git a/modules/menu/tpl/menu.html b/modules/menu/tpl/menu.html index 4aaf5a6b6..05198fa7d 100644 --- a/modules/menu/tpl/menu.html +++ b/modules/menu/tpl/menu.html @@ -1,30 +1,30 @@ - -
            -
              - {@ $start = true } - {@ $depth = 0 } - - - - - -
                - - - -
              - {@ $depth -= 1} - - -
            • {$val->text} - {@ $start = false } - {@ $depth = $val->depth } - - -
            • -
            - {@ $depth -= 1} - - -
          -
    + +
    +
      + {@ $start = true } + {@ $depth = 0 } + + + + + +
        + + + +
      + {@ $depth -= 1} + + +
    • {$val->text} + {@ $start = false } + {@ $depth = $val->depth } + + +
    • +
    + {@ $depth -= 1} + + + +
    diff --git a/modules/message/conf/info.xml b/modules/message/conf/info.xml index 28fdcc214..02e6186a0 100644 --- a/modules/message/conf/info.xml +++ b/modules/message/conf/info.xml @@ -1,36 +1,36 @@ - - - 오류 표시 - エラー表示 - 错误信息 - Display Errors - Hiển thị lỗi - Mostrar el error - Отображение ошибок - 錯誤訊息 - Hata Görüntüleme - 오류 및 각종 시스템 메세지 관리 모듈 - エラー及びシステムメッセージ管理モジュール - 管理错误信息及各种系统信息的模块。 - This module managers erros and system messages. - Module này quản lý những thông báo lỗi của hệ thống. - Este módulo es para manejar los errores y mensajes del sistema. - Этот модуль управляет ошибками и системными сообщениями. - 管理錯誤訊息及各種系統訊息的模組。 - Bu modül, hataları ve sistem mesajlarını yönetir. - 0.1 - 2007-02-28 - system - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 오류 표시 + エラー表示 + 错误信息 + Display Errors + Hiển thị lỗi + Mostrar el error + Отображение ошибок + 錯誤訊息 + Hata Görüntüleme + 오류 및 각종 시스템 메세지 관리 모듈 + エラー及びシステムメッセージ管理モジュール + 管理错误信息及各种系统信息的模块。 + This module managers erros and system messages. + Module này quản lý những thông báo lỗi của hệ thống. + Este módulo es para manejar los errores y mensajes del sistema. + Этот модуль управляет ошибками и системными сообщениями. + 管理錯誤訊息及各種系統訊息的模組。 + Bu modül, hataları ve sistem mesajlarını yönetir. + 0.1 + 2007-02-28 + system + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/message/lang/en.lang.php b/modules/message/lang/en.lang.php index 147edfa1d..b24d26fd8 100644 --- a/modules/message/lang/en.lang.php +++ b/modules/message/lang/en.lang.php @@ -1,10 +1,10 @@ -message = 'Display Errors'; - $lang->about_skin = "You may select skins of error messages"; -?> +message = 'Display Errors'; + $lang->about_skin = "You may select skins of error messages"; +?> diff --git a/modules/message/lang/es.lang.php b/modules/message/lang/es.lang.php index 5182af3c0..75216e4df 100644 --- a/modules/message/lang/es.lang.php +++ b/modules/message/lang/es.lang.php @@ -1,10 +1,10 @@ -message = 'Mostrar el error'; - $lang->about_skin = "Usted puede seleccionar los temas de los mensajes del error."; -?> +message = 'Mostrar el error'; + $lang->about_skin = "Usted puede seleccionar los temas de los mensajes del error."; +?> diff --git a/modules/message/lang/fr.lang.php b/modules/message/lang/fr.lang.php index 0fb7d1446..9ac06970f 100644 --- a/modules/message/lang/fr.lang.php +++ b/modules/message/lang/fr.lang.php @@ -1,10 +1,10 @@ - - * @brief Paque du langage en français pour le module de Message - **/ - - $lang->message = 'Montrer Erreurs'; - $lang->about_skin = "Vous pouvez choisir un habillage pour le message des erreurs"; -?> + + * @brief Paque du langage en français pour le module de Message + **/ + + $lang->message = 'Montrer Erreurs'; + $lang->about_skin = "Vous pouvez choisir un habillage pour le message des erreurs"; +?> diff --git a/modules/message/lang/jp.lang.php b/modules/message/lang/jp.lang.php index 75b7a511c..ef799c25a 100644 --- a/modules/message/lang/jp.lang.php +++ b/modules/message/lang/jp.lang.php @@ -1,10 +1,10 @@ -message = 'エラー表示'; - $lang->about_skin = 'メッセージを表示する際のスキンが指定出来ます。'; -?> +message = 'エラー表示'; + $lang->about_skin = 'メッセージを表示する際のスキンが指定出来ます。'; +?> diff --git a/modules/message/lang/ko.lang.php b/modules/message/lang/ko.lang.php index a97922d3e..558dcb460 100644 --- a/modules/message/lang/ko.lang.php +++ b/modules/message/lang/ko.lang.php @@ -1,10 +1,10 @@ -message = '오류 표시'; - $lang->about_skin = '오류 메시지용 스킨을 지정하실 수 있습니다.'; -?> +message = '오류 표시'; + $lang->about_skin = '오류 메시지용 스킨을 지정하실 수 있습니다.'; +?> diff --git a/modules/message/lang/ru.lang.php b/modules/message/lang/ru.lang.php index 58da27fcc..3439797e8 100644 --- a/modules/message/lang/ru.lang.php +++ b/modules/message/lang/ru.lang.php @@ -1,10 +1,10 @@ -message = 'Отображать ошибки'; - $lang->about_skin = "Вы можете выбрать скин сообщений об ошибках"; -?> +message = 'Отображать ошибки'; + $lang->about_skin = "Вы можете выбрать скин сообщений об ошибках"; +?> diff --git a/modules/message/lang/tr.lang.php b/modules/message/lang/tr.lang.php index 231e7ab97..e8f0d0887 100644 --- a/modules/message/lang/tr.lang.php +++ b/modules/message/lang/tr.lang.php @@ -1,10 +1,10 @@ -message = 'Hata Görüntüleme'; - $lang->about_skin = "Hata mesajlarının dış görünümlerini seçebilirsiniz"; -?> +message = 'Hata Görüntüleme'; + $lang->about_skin = "Hata mesajlarının dış görünümlerini seçebilirsiniz"; +?> diff --git a/modules/message/lang/vi.lang.php b/modules/message/lang/vi.lang.php index 7b19009d9..e344fc7f9 100644 --- a/modules/message/lang/vi.lang.php +++ b/modules/message/lang/vi.lang.php @@ -1,12 +1,12 @@ -message = 'Hiển thị lỗi'; - $lang->about_skin = "Bạn có thể chọn giao diện khi hiển thị lỗi."; -?> +message = 'Hiển thị lỗi'; + $lang->about_skin = "Bạn có thể chọn giao diện khi hiển thị lỗi."; +?> diff --git a/modules/message/lang/zh-CN.lang.php b/modules/message/lang/zh-CN.lang.php index 3bcdc5760..b771cad3d 100644 --- a/modules/message/lang/zh-CN.lang.php +++ b/modules/message/lang/zh-CN.lang.php @@ -1,10 +1,10 @@ -message = '错误信息'; - $lang->about_skin = "提示信息可以指定皮肤。"; +message = '错误信息'; + $lang->about_skin = "提示信息可以指定皮肤。"; ?> \ No newline at end of file diff --git a/modules/message/lang/zh-TW.lang.php b/modules/message/lang/zh-TW.lang.php index 1cedd9fec..35ecc4836 100644 --- a/modules/message/lang/zh-TW.lang.php +++ b/modules/message/lang/zh-TW.lang.php @@ -1,10 +1,10 @@ -message = '錯誤提示'; - $lang->about_skin = "提示訊息時,可以指定面板。"; +message = '錯誤提示'; + $lang->about_skin = "提示訊息時,可以指定面板。"; ?> \ No newline at end of file diff --git a/modules/message/m.skins/default/system_message.html b/modules/message/m.skins/default/system_message.html index 483f96c8e..f732b89b8 100644 --- a/modules/message/m.skins/default/system_message.html +++ b/modules/message/m.skins/default/system_message.html @@ -1,63 +1,63 @@ - -
    -
    -

    {$system_message}

    -
    -
    - - {@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) } - {@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) } - {@ Context::addJsFile("./common/js/x.js", true, '', -100000) } - {@ Context::addJsFile("./common/js/common.js", true, '', -100000) } - {@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) } - {@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) } - - -
    -
    -
    -
      -
    • -
    • -
    -

    - - -

    - - -
    -
    -
    - - -
    -
    -
    -
      -
    • -
    -
    - -
    - -
    -
    -
    - - - - - -
    -
    + +
    +
    +

    {$system_message}

    +
    +
    + + {@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) } + {@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) } + {@ Context::addJsFile("./common/js/x.js", true, '', -100000) } + {@ Context::addJsFile("./common/js/common.js", true, '', -100000) } + {@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) } + {@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) } + + +
    +
    +
    +
      +
    • +
    • +
    +

    + + +

    + + +
    +
    +
    + + +
    +
    +
    +
      +
    • +
    +
    + +
    + +
    +
    +
    + + + + + +
    +
    diff --git a/modules/message/message.admin.controller.php b/modules/message/message.admin.controller.php index b9f22ac55..2c28995c4 100644 --- a/modules/message/message.admin.controller.php +++ b/modules/message/message.admin.controller.php @@ -1,31 +1,31 @@ -skin = Context::get('skin'); - - // module Controller 객체 생성하여 입력 - $oModuleController = &getController('module'); - $output = $oModuleController->insertModuleConfig('message',$args); - if(!$output->toBool()) return $output; - - $this->setMessage('success_updated'); - } - } -?> +skin = Context::get('skin'); + + // module Controller 객체 생성하여 입력 + $oModuleController = &getController('module'); + $output = $oModuleController->insertModuleConfig('message',$args); + if(!$output->toBool()) return $output; + + $this->setMessage('success_updated'); + } + } +?> diff --git a/modules/message/message.admin.view.php b/modules/message/message.admin.view.php index 288b91f76..a8f4855b9 100644 --- a/modules/message/message.admin.view.php +++ b/modules/message/message.admin.view.php @@ -1,35 +1,35 @@ -getskins($this->module_path); - Context::set('skin_list', $skin_list); - - // 설정 정보를 받아옴 (module model 객체를 이용) - $config = $oModuleModel->getModuleConfig('message'); - Context::set('config',$config); - - // 템플릿 파일 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('config'); - } - - } -?> +getskins($this->module_path); + Context::set('skin_list', $skin_list); + + // 설정 정보를 받아옴 (module model 객체를 이용) + $config = $oModuleModel->getModuleConfig('message'); + Context::set('config',$config); + + // 템플릿 파일 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('config'); + } + + } +?> diff --git a/modules/message/message.class.php b/modules/message/message.class.php index 1ef02f550..a3dcbcb9c 100644 --- a/modules/message/message.class.php +++ b/modules/message/message.class.php @@ -1,37 +1,37 @@ - + diff --git a/modules/message/message.view.php b/modules/message/message.view.php index e8806c152..0f5250923 100644 --- a/modules/message/message.view.php +++ b/modules/message/message.view.php @@ -1,47 +1,47 @@ -getModuleConfig('message'); - if(!$config->skin) $config->skin = 'default'; - - // 템플릿 경로를 지정 - $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin); - - // 회원 관리 정보를 받음 - $oModuleModel = &getModel('module'); - $member_config = $oModuleModel->getModuleConfig('member'); - Context::set('member_config', $member_config); - - // ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성 - $ssl_mode = false; - if($member_config->enable_ssl == 'Y') { - if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true; - } - Context::set('ssl_mode',$ssl_mode); - - Context::set('system_message', nl2br($this->getMessage())); - - $this->setTemplatePath($template_path); - $this->setTemplateFile('system_message'); - } - - } -?> +getModuleConfig('message'); + if(!$config->skin) $config->skin = 'default'; + + // 템플릿 경로를 지정 + $template_path = sprintf('%sskins/%s', $this->module_path, $config->skin); + + // 회원 관리 정보를 받음 + $oModuleModel = &getModel('module'); + $member_config = $oModuleModel->getModuleConfig('member'); + Context::set('member_config', $member_config); + + // ssl 사용시 현재 https접속상태인지에 대한 flag및 https url 생성 + $ssl_mode = false; + if($member_config->enable_ssl == 'Y') { + if(preg_match('/^https:\/\//i',Context::getRequestUri())) $ssl_mode = true; + } + Context::set('ssl_mode',$ssl_mode); + + Context::set('system_message', nl2br($this->getMessage())); + + $this->setTemplatePath($template_path); + $this->setTemplateFile('system_message'); + } + + } +?> diff --git a/modules/message/skins/default/message.css b/modules/message/skins/default/message.css index 42cb64378..31f23693c 100644 --- a/modules/message/skins/default/message.css +++ b/modules/message/skins/default/message.css @@ -1,39 +1,39 @@ -@charset "utf-8"; -/* NHN | dece24@nhncorp.com */ -#loginAccess{ position:relative; width:384px; border:2px solid #757575; margin:30px auto; padding:20px 0 0 0; background:#fff; font-size:12px; font-family:Tahoma; line-height:normal;} -#loginAccess form{ margin:0; padding:0;} -#loginAccess fieldset{ border:0; margin:0; padding:0;} -#loginAccess h1{ margin:0 28px 20px 28px; font-size:12px; color:#e77161;} -#loginAccess ul{ margin:0; padding:0; list-style:none;} -#loginAccess .mLogin{ display:none;} -#loginAccess .idpw{ margin:0 28px 20px 28px;} -#loginAccess .oid{ margin:0 28px 20px 28px;} -#loginAccess .idpw li{ margin:0 0 5px 0;} -#loginAccess .inputText{ font-size:12px; height:22px; color:#767676; font-weight:bold; border:1px solid #b7b7b7; border-right-color:#e1e1e1; border-bottom-color:#e1e1e1;} -#loginAccess .idpw .inputText{ width:316px; padding:8px 0 0 10px;} -#loginAccess .oid .inputText{ width:291px; padding:8px 0 0 35px; background:url(./images/openid_login_bg.gif) no-repeat 10px center;} -#loginAccess .inputCheck{ width:13px; height:13px; margin:0; padding:0; vertical-align:middle;} -#loginAccess label{ vertical-align:middle;} -#loginAccess #warning{ display:none; margin:0 0 20px 0;} -#loginAccess #warning.open{ display:block;} -#loginAccess #warning p{ margin:0;} -#loginAccess .buttonArea{ position:relative; margin:0 28px; padding:0; color:#767676; *zoom:1;} -#loginAccess .buttonArea .keeping{ position:relative; margin:0 0 20px 0; height:32px; line-height:32px;} -#loginAccess #gLogin .buttonArea .buttonAccount{ position:absolute; top:0; right:0;} -#loginAccess #oLogin .buttonArea{ text-align:center; margin-bottom:20px;} -#loginAccess .buttonAccount, -#loginAccess .buttonAccount a, -#loginAccess .buttonAccount input{ position:relative; display:inline-block; margin:0; padding:0; overflow:visible; height:32px; line-height:32px; font-size:12px; font-weight:bold; color:#fff; vertical-align:middle; cursor:pointer; border:0; text-decoration:none !important; background:transparent url(./images/buttonAction.gif) no-repeat;} -#loginAccess .buttonAccount{ margin:0 4px 0 0; background-position:left top;} -#loginAccess .buttonAccount a, -#loginAccess .buttonAccount input{ left:4px; background-position:right top; *vertical-align:top; padding:0 24px 0 36px;} -#loginAccess .help{ position:relative; padding:15px 0; background:#fafafa; border-top:1px solid #d9d9d9; text-align:center;} -#loginAccess .help li{ display:inline; border-left:1px solid #c3c3c3; padding:0 0 0 10px; margin:0 6px 0 0; line-height:1;} -#loginAccess .help li.first{ border:0; padding:0;} -#loginAccess .help a{ text-decoration:none; color:#333;} -#loginAccess .help a:hover, -#loginAccess .help a:active, -#loginAccess .help a:focus{ text-decoration:underline;} -#loginAccess .logOut{ text-align:left; margin:0 28px; padding:0 0 20px 0;} -.gLogin #gLogin, +@charset "utf-8"; +/* NHN | dece24@nhncorp.com */ +#loginAccess{ position:relative; width:384px; border:2px solid #757575; margin:30px auto; padding:20px 0 0 0; background:#fff; font-size:12px; font-family:Tahoma; line-height:normal;} +#loginAccess form{ margin:0; padding:0;} +#loginAccess fieldset{ border:0; margin:0; padding:0;} +#loginAccess h1{ margin:0 28px 20px 28px; font-size:12px; color:#e77161;} +#loginAccess ul{ margin:0; padding:0; list-style:none;} +#loginAccess .mLogin{ display:none;} +#loginAccess .idpw{ margin:0 28px 20px 28px;} +#loginAccess .oid{ margin:0 28px 20px 28px;} +#loginAccess .idpw li{ margin:0 0 5px 0;} +#loginAccess .inputText{ font-size:12px; height:22px; color:#767676; font-weight:bold; border:1px solid #b7b7b7; border-right-color:#e1e1e1; border-bottom-color:#e1e1e1;} +#loginAccess .idpw .inputText{ width:316px; padding:8px 0 0 10px;} +#loginAccess .oid .inputText{ width:291px; padding:8px 0 0 35px; background:url(./images/openid_login_bg.gif) no-repeat 10px center;} +#loginAccess .inputCheck{ width:13px; height:13px; margin:0; padding:0; vertical-align:middle;} +#loginAccess label{ vertical-align:middle;} +#loginAccess #warning{ display:none; margin:0 0 20px 0;} +#loginAccess #warning.open{ display:block;} +#loginAccess #warning p{ margin:0;} +#loginAccess .buttonArea{ position:relative; margin:0 28px; padding:0; color:#767676; *zoom:1;} +#loginAccess .buttonArea .keeping{ position:relative; margin:0 0 20px 0; height:32px; line-height:32px;} +#loginAccess #gLogin .buttonArea .buttonAccount{ position:absolute; top:0; right:0;} +#loginAccess #oLogin .buttonArea{ text-align:center; margin-bottom:20px;} +#loginAccess .buttonAccount, +#loginAccess .buttonAccount a, +#loginAccess .buttonAccount input{ position:relative; display:inline-block; margin:0; padding:0; overflow:visible; height:32px; line-height:32px; font-size:12px; font-weight:bold; color:#fff; vertical-align:middle; cursor:pointer; border:0; text-decoration:none !important; background:transparent url(./images/buttonAction.gif) no-repeat;} +#loginAccess .buttonAccount{ margin:0 4px 0 0; background-position:left top;} +#loginAccess .buttonAccount a, +#loginAccess .buttonAccount input{ left:4px; background-position:right top; *vertical-align:top; padding:0 24px 0 36px;} +#loginAccess .help{ position:relative; padding:15px 0; background:#fafafa; border-top:1px solid #d9d9d9; text-align:center;} +#loginAccess .help li{ display:inline; border-left:1px solid #c3c3c3; padding:0 0 0 10px; margin:0 6px 0 0; line-height:1;} +#loginAccess .help li.first{ border:0; padding:0;} +#loginAccess .help a{ text-decoration:none; color:#333;} +#loginAccess .help a:hover, +#loginAccess .help a:active, +#loginAccess .help a:focus{ text-decoration:underline;} +#loginAccess .logOut{ text-align:left; margin:0 28px; padding:0 0 20px 0;} +.gLogin #gLogin, .oLogin #oLogin{ display:block;} \ No newline at end of file diff --git a/modules/message/skins/default/message.js b/modules/message/skins/default/message.js index 815cb0cec..8523b8ec3 100644 --- a/modules/message/skins/default/message.js +++ b/modules/message/skins/default/message.js @@ -1,38 +1,38 @@ -/* 로그인 후 */ -function completeMessageLogin(ret_obj, response_tags, params, fo_obj) { - var url = current_url.setQuery('act',''); - location.href = url; -} - -/* 오픈아이디 로그인 후 */ -function completeMessageOpenIDLogin(ret_obj, response_tags) { - var redirect_url = ret_obj['redirect_url']; - location.href = redirect_url; -} - -function doLogin(o,filter){ - jQuery('input.inputText',o).each(function(){ - var t = jQuery(this); - if(t.attr('title').length>0 && t.attr('title') == t.val()) t.val(''); - }); - procFilter(o,filter); - initLoginTitleMsg(); - return false; -} - - -function initLoginTitleMsg(){ - jQuery('.gLogin, .mLogin').find('input.inputText').focus(function(){ - var t = jQuery(this); - if(t.attr('title').length>0 && t.attr('title')==t.val()) t.val(''); - }).blur(function(){ - var t = jQuery(this); - if(t.attr('title').length>0 && t.val()=='') t.val(t.attr('title')); - }).focus().blur(); -} - -jQuery(function(){ - initLoginTitleMsg(); -}); - - +/* 로그인 후 */ +function completeMessageLogin(ret_obj, response_tags, params, fo_obj) { + var url = current_url.setQuery('act',''); + location.href = url; +} + +/* 오픈아이디 로그인 후 */ +function completeMessageOpenIDLogin(ret_obj, response_tags) { + var redirect_url = ret_obj['redirect_url']; + location.href = redirect_url; +} + +function doLogin(o,filter){ + jQuery('input.inputText',o).each(function(){ + var t = jQuery(this); + if(t.attr('title').length>0 && t.attr('title') == t.val()) t.val(''); + }); + procFilter(o,filter); + initLoginTitleMsg(); + return false; +} + + +function initLoginTitleMsg(){ + jQuery('.gLogin, .mLogin').find('input.inputText').focus(function(){ + var t = jQuery(this); + if(t.attr('title').length>0 && t.attr('title')==t.val()) t.val(''); + }).blur(function(){ + var t = jQuery(this); + if(t.attr('title').length>0 && t.val()=='') t.val(t.attr('title')); + }).focus().blur(); +} + +jQuery(function(){ + initLoginTitleMsg(); +}); + + diff --git a/modules/message/skins/default/system_message.html b/modules/message/skins/default/system_message.html index 71f7dc475..a18c2923c 100644 --- a/modules/message/skins/default/system_message.html +++ b/modules/message/skins/default/system_message.html @@ -1,60 +1,60 @@ - - -
    -

    {$system_message}

    - - - - - -
    -
    -
    -
      -
    • -
    • -
    -
    -

    - - -

    -
    -

    {$lang->about_keep_warning}

    -
    - -
    -
    -
    - -
    - - - -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - -
    - - - - - -
    + + +
    +

    {$system_message}

    + + + + + +
    +
    +
    +
      +
    • +
    • +
    +
    +

    + + +

    +
    +

    {$lang->about_keep_warning}

    +
    + +
    +
    +
    + +
    + + + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    + + + + + +
    diff --git a/modules/module/conf/info.xml b/modules/module/conf/info.xml index c78197ec7..eee5c1e21 100644 --- a/modules/module/conf/info.xml +++ b/modules/module/conf/info.xml @@ -1,36 +1,36 @@ - - - 모듈 - 模块列表 - モジュール - Module - Module - Módulo - Модули - 模組 - Modül - 모듈 생성 및 관리하는 모듈입니다. - 生成及管理模块的模块。 - モジュールの生成、管理するモジュールです。 - This module is for creating/managering the other modules. - Module cho phép tạo và quản lý những Module khác. - Este módulo is para crear y manejar los otros módulos. - Этот модуль служит для создания/управления другими модулями. - 用於建立與管理其他模組。 - Bu modül, başka modüller oluşturmak ve yönetmek içindir. - 0.1 - 2007-02-28 - system - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 모듈 + 模块列表 + モジュール + Module + Module + Módulo + Модули + 模組 + Modül + 모듈 생성 및 관리하는 모듈입니다. + 生成及管理模块的模块。 + モジュールの生成、管理するモジュールです。 + This module is for creating/managering the other modules. + Module cho phép tạo và quản lý những Module khác. + Este módulo is para crear y manejar los otros módulos. + Этот модуль служит для создания/управления другими модулями. + 用於建立與管理其他模組。 + Bu modül, başka modüller oluşturmak ve yönetmek içindir. + 0.1 + 2007-02-28 + system + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/module/lang/en.lang.php b/modules/module/lang/en.lang.php index dfda4e598..727de5ac4 100644 --- a/modules/module/lang/en.lang.php +++ b/modules/module/lang/en.lang.php @@ -1,99 +1,99 @@ -virtual_site = "Virtual Site"; - $lang->module_list = "Modules List"; - $lang->module_index = "Modules List"; - $lang->module_category = "Module Category"; - $lang->module_info = "Module Info"; - $lang->add_shortcut = "Add Shortcuts"; - $lang->module_action = "Actions"; - $lang->module_maker = "Module Developer"; - $lang->module_license = 'License'; - $lang->module_history = "Update history"; - $lang->category_title = "Category Title"; - $lang->header_text = 'Header Text'; - $lang->footer_text = 'Footer Text'; - $lang->use_category = 'Enable Category'; - $lang->category_title = 'Category Title'; - $lang->checked_count = 'Number of Checked Articles'; - $lang->skin_default_info = 'Default Skin Info'; - $lang->skin_author = 'Skin Developer'; - $lang->skin_license = 'License'; - $lang->skin_history = 'Update history'; - $lang->module_copy = "Duplicate Module"; - $lang->module_selector = "Module Selector"; - $lang->do_selected = "I want to"; - $lang->bundle_setup = "Bundle Setup"; - $lang->bundle_addition_setup = "Bundle Additional Setup"; - $lang->bundle_grant_setup = "Bundle Permission Setup"; - $lang->lang_code = "Language Code"; - $lang->filebox = "FileBox"; - - $lang->access_type = 'Access Type'; - $lang->access_domain = 'With Domain Name'; - $lang->access_vid = 'With Site ID'; - $lang->about_domain = "In order to create more than one virtual site, every club needs to have its own domain name.
    Sub-domain (e.g., aaa.bbb.com of bbb.com) also can be used. Input the address including the path where XE is installed.
    ex) www.xpressengine.com/xe"; - $lang->about_vid = 'Users can access via http://XEaddress/ID. You cannot use same site id as the existing module name(mid).
    Site id should start with an alphabet character . Alphabet characters, numbers and _ can be used for the site id.'; - $lang->msg_already_registed_vid = 'Already registered site id. Please input another ID.'; - $lang->msg_already_registed_domain = "Domain name has already been used. Please input another domain name."; - - $lang->header_script = "Header Script"; - $lang->about_header_script = "You can input the html script between <header> and </header> by yourself.
    You can use <script, <style or <meta tag"; - - $lang->grant_access = "Access"; - $lang->grant_manager = "Management"; - - $lang->grant_to_all = "All users"; - $lang->grant_to_login_user = "Logged users"; - $lang->grant_to_site_user = "Registered users"; - $lang->grant_to_group = "Specification group users"; - - $lang->cmd_add_shortcut = "Add Shortcut"; - $lang->cmd_install = "Install"; - $lang->cmd_update = "Update"; - $lang->cmd_manage_category = 'Manage Categories'; - $lang->cmd_manage_grant = 'Manage Permission'; - $lang->cmd_manage_skin = 'Manage Skins'; - $lang->cmd_manage_document = 'Manage Articles'; - $lang->cmd_find_module = 'Find Module'; - $lang->cmd_find_langcode = 'Find lang code'; - - $lang->msg_new_module = "Create new module"; - $lang->msg_update_module = "Modify module"; - $lang->msg_module_name_exists = "The name already exists. Please try another name."; - $lang->msg_category_is_null = 'There is no registered category.'; - $lang->msg_grant_is_null = 'There is no permission list.'; - $lang->msg_no_checked_document = 'No checked articles exist.'; - $lang->msg_move_failed = 'Failed to move'; - $lang->msg_cannot_delete_for_child = 'Cannot delete a category having child categories.'; - $lang->msg_limit_mid ="Only alphabets+[alphabets+numbers+_] can be used as module name."; - $lang->msg_extra_name_exists = 'Already registered extra variable name. Please input another name.'; - - $lang->about_browser_title = "It will be shown in the browser title. It will be also used in a RSS/Trackback."; - $lang->about_mid = "The module name will be used like http://address/?mid=ModuleName.\n(Only english alphabet + [english alphabet, numbers, and underscore(_)] are allowed. The maximum length is 40.)"; - $lang->about_default = "If checked, the default will be shown when access to the site without no mid value(mid=NoValue)."; - $lang->about_module_category = "It enables you to manage it through module category.\n The URL for the module manager is Manage module > Module category ."; - $lang->about_description= 'It is the description only for a manager.'; - $lang->about_default = 'If checked, this module will be shown when users access to the site without mid value (mid=NoValue).'; - $lang->about_header_text = 'The contents will be shown on the top of the module.(html tags available)'; - $lang->about_footer_text = 'The contents will be shown on the bottom of the module.(html tags available)'; - $lang->about_skin = 'You may choose a module skin.'; - $lang->about_use_category = 'If checked, category function will be enabled.'; - $lang->about_list_count = 'You can set the number of limit to show article in a page.(default is 20)'; - $lang->about_search_list_count = 'You may set the number of articles to be exposed when you use search or category function. (default is 20)'; - $lang->about_page_count = 'You can set the number of page link to move pages in a bottom of page.(default is 10)'; - $lang->about_admin_id = 'You can grant a manager to have all permissions to the module.'; - $lang->about_grant = 'If you disable all permissions for a specific object, members who has not logged in would get permission.'; - $lang->about_grant_deatil = 'Registered users mean users who signed-up to the virtual sites (e.g., cafeXE).'; - $lang->about_module = "XE consists of modules except basic library.\n [Module Manage] module will show all installed modules and help you to manage them."; - - $lang->about_extra_vars_default_value = 'If multiple default values are needed, you can link them with comma(,).'; - $lang->about_search_virtual_site = "Input domain of virtual sites.
    To search modules of non-virtual site, search with blank"; - $lang->about_langcode = "If you want to configure seperately, use 'find language code'"; - $lang->about_file_extension= "Only %s extension(s) is available."; -?> +virtual_site = "Virtual Site"; + $lang->module_list = "Modules List"; + $lang->module_index = "Modules List"; + $lang->module_category = "Module Category"; + $lang->module_info = "Module Info"; + $lang->add_shortcut = "Add Shortcuts"; + $lang->module_action = "Actions"; + $lang->module_maker = "Module Developer"; + $lang->module_license = 'License'; + $lang->module_history = "Update history"; + $lang->category_title = "Category Title"; + $lang->header_text = 'Header Text'; + $lang->footer_text = 'Footer Text'; + $lang->use_category = 'Enable Category'; + $lang->category_title = 'Category Title'; + $lang->checked_count = 'Number of Checked Articles'; + $lang->skin_default_info = 'Default Skin Info'; + $lang->skin_author = 'Skin Developer'; + $lang->skin_license = 'License'; + $lang->skin_history = 'Update history'; + $lang->module_copy = "Duplicate Module"; + $lang->module_selector = "Module Selector"; + $lang->do_selected = "I want to"; + $lang->bundle_setup = "Bundle Setup"; + $lang->bundle_addition_setup = "Bundle Additional Setup"; + $lang->bundle_grant_setup = "Bundle Permission Setup"; + $lang->lang_code = "Language Code"; + $lang->filebox = "FileBox"; + + $lang->access_type = 'Access Type'; + $lang->access_domain = 'With Domain Name'; + $lang->access_vid = 'With Site ID'; + $lang->about_domain = "In order to create more than one virtual site, every club needs to have its own domain name.
    Sub-domain (e.g., aaa.bbb.com of bbb.com) also can be used. Input the address including the path where XE is installed.
    ex) www.xpressengine.com/xe"; + $lang->about_vid = 'Users can access via http://XEaddress/ID. You cannot use same site id as the existing module name(mid).
    Site id should start with an alphabet character . Alphabet characters, numbers and _ can be used for the site id.'; + $lang->msg_already_registed_vid = 'Already registered site id. Please input another ID.'; + $lang->msg_already_registed_domain = "Domain name has already been used. Please input another domain name."; + + $lang->header_script = "Header Script"; + $lang->about_header_script = "You can input the html script between <header> and </header> by yourself.
    You can use <script, <style or <meta tag"; + + $lang->grant_access = "Access"; + $lang->grant_manager = "Management"; + + $lang->grant_to_all = "All users"; + $lang->grant_to_login_user = "Logged users"; + $lang->grant_to_site_user = "Registered users"; + $lang->grant_to_group = "Specification group users"; + + $lang->cmd_add_shortcut = "Add Shortcut"; + $lang->cmd_install = "Install"; + $lang->cmd_update = "Update"; + $lang->cmd_manage_category = 'Manage Categories'; + $lang->cmd_manage_grant = 'Manage Permission'; + $lang->cmd_manage_skin = 'Manage Skins'; + $lang->cmd_manage_document = 'Manage Articles'; + $lang->cmd_find_module = 'Find Module'; + $lang->cmd_find_langcode = 'Find lang code'; + + $lang->msg_new_module = "Create new module"; + $lang->msg_update_module = "Modify module"; + $lang->msg_module_name_exists = "The name already exists. Please try another name."; + $lang->msg_category_is_null = 'There is no registered category.'; + $lang->msg_grant_is_null = 'There is no permission list.'; + $lang->msg_no_checked_document = 'No checked articles exist.'; + $lang->msg_move_failed = 'Failed to move'; + $lang->msg_cannot_delete_for_child = 'Cannot delete a category having child categories.'; + $lang->msg_limit_mid ="Only alphabets+[alphabets+numbers+_] can be used as module name."; + $lang->msg_extra_name_exists = 'Already registered extra variable name. Please input another name.'; + + $lang->about_browser_title = "It will be shown in the browser title. It will be also used in a RSS/Trackback."; + $lang->about_mid = "The module name will be used like http://address/?mid=ModuleName.\n(Only english alphabet + [english alphabet, numbers, and underscore(_)] are allowed. The maximum length is 40.)"; + $lang->about_default = "If checked, the default will be shown when access to the site without no mid value(mid=NoValue)."; + $lang->about_module_category = "It enables you to manage it through module category.\n The URL for the module manager is Manage module > Module category ."; + $lang->about_description= 'It is the description only for a manager.'; + $lang->about_default = 'If checked, this module will be shown when users access to the site without mid value (mid=NoValue).'; + $lang->about_header_text = 'The contents will be shown on the top of the module.(html tags available)'; + $lang->about_footer_text = 'The contents will be shown on the bottom of the module.(html tags available)'; + $lang->about_skin = 'You may choose a module skin.'; + $lang->about_use_category = 'If checked, category function will be enabled.'; + $lang->about_list_count = 'You can set the number of limit to show article in a page.(default is 20)'; + $lang->about_search_list_count = 'You may set the number of articles to be exposed when you use search or category function. (default is 20)'; + $lang->about_page_count = 'You can set the number of page link to move pages in a bottom of page.(default is 10)'; + $lang->about_admin_id = 'You can grant a manager to have all permissions to the module.'; + $lang->about_grant = 'If you disable all permissions for a specific object, members who has not logged in would get permission.'; + $lang->about_grant_deatil = 'Registered users mean users who signed-up to the virtual sites (e.g., cafeXE).'; + $lang->about_module = "XE consists of modules except basic library.\n [Module Manage] module will show all installed modules and help you to manage them."; + + $lang->about_extra_vars_default_value = 'If multiple default values are needed, you can link them with comma(,).'; + $lang->about_search_virtual_site = "Input domain of virtual sites.
    To search modules of non-virtual site, search with blank"; + $lang->about_langcode = "If you want to configure seperately, use 'find language code'"; + $lang->about_file_extension= "Only %s extension(s) is available."; +?> diff --git a/modules/module/lang/es.lang.php b/modules/module/lang/es.lang.php index ad699a9a0..36d6fbc95 100644 --- a/modules/module/lang/es.lang.php +++ b/modules/module/lang/es.lang.php @@ -1,99 +1,99 @@ -virtual_site = "Virtual Site"; - $lang->module_list = "Lista de Módulos"; - $lang->module_index = "Lista de Módulos"; - $lang->module_category = "Categoría de Módulos "; - $lang->module_info = "Información"; - $lang->add_shortcut = "Añadir en el menú del administrador"; - $lang->module_action = "Acción"; - $lang->module_maker = "Módulo del desarrollador"; - $lang->module_license = 'License'; - $lang->module_history = "Historia de actualización"; - $lang->category_title = "Título de categoría"; - $lang->header_text = 'Encabezado'; - $lang->footer_text = 'Pie de página'; - $lang->use_category = 'Usar categoría'; - $lang->category_title = 'Título de categoría'; - $lang->checked_count = 'Múmero de los documentos selecionados'; - $lang->skin_default_info = 'información del tema predefinido'; - $lang->skin_author = 'Desarrollador de tema'; - $lang->skin_license = 'License'; - $lang->skin_history = 'Historia de actualización'; - $lang->module_copy = "Copy Module"; - $lang->module_selector = "Module Selector"; - $lang->do_selected = "선택된 것들을..."; - $lang->bundle_setup = "일괄 기본 설정"; - $lang->bundle_addition_setup = "일괄 추가 설정"; - $lang->bundle_grant_setup = "일괄 권한 설정"; - $lang->lang_code = "언어 코드"; - $lang->filebox = "파일박스"; - - $lang->access_type = '접속 방법'; - $lang->access_domain = 'Domain 접속'; - $lang->access_vid = 'Site ID 접속'; - $lang->about_domain = 'Para crear un dominio privado de la site requiere.
    Independiente de dominio o subdominio, y XE está instalado, el camino que en su conjunto.
    Ej.) www.xpressengine.com / zbxe'; - $lang->about_vid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.
    첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다'; - $lang->msg_already_registed_vid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.'; - $lang->msg_already_registed_domain = 'Ya es de dominio registrado. Por favor, use un dominio diferente'; - - $lang->header_script = "헤더 스크립트"; - $lang->about_header_script = "html의 <header>와 </header> 사이에 들어가는 코드를 직접 입력할 수 있습니다.
    <script, <style 또는 <meta 태그등을 이용하실 수 있습니다"; - - $lang->grant_access = "Access"; - $lang->grant_manager = "Management"; - - $lang->grant_to_all = "All users"; - $lang->grant_to_login_user = "Logged users"; - $lang->grant_to_site_user = "Joined users"; - $lang->grant_to_group = "Specification group users"; - - $lang->cmd_add_shortcut = "añadir acceso directo"; - $lang->cmd_install = "Instalar"; - $lang->cmd_update = "Actualizar"; - $lang->cmd_manage_category = 'Manejo de categorías'; - $lang->cmd_manage_grant = 'Manejo de atribuciones'; - $lang->cmd_manage_skin = 'Manejo de temas'; - $lang->cmd_manage_document = 'Manejo de documentos'; - $lang->cmd_find_module = '모듈 찾기'; - $lang->cmd_find_langcode = 'Find lang code'; - - $lang->msg_new_module = "Crear un nuevo módulo"; - $lang->msg_update_module = "Modificar el módulo"; - $lang->msg_module_name_exists = "El nombre ya existe. Por favor tratar con otro nombre."; - $lang->msg_category_is_null = 'No existe categoría registrada.'; - $lang->msg_grant_is_null = 'No existe el objetivo de atribución registrado.'; - $lang->msg_no_checked_document = 'No existe documento seleccionado.'; - $lang->msg_move_failed = 'No pudo moverse'; - $lang->msg_cannot_delete_for_child = 'No puede eliminar la categoría si posee subcategoría.'; - $lang->msg_limit_mid ='모듈이름은 영문+[영문+숫자+_] 만 가능합니다.'; - $lang->msg_extra_name_exists = '이미 존재하는 확장변수 이름입니다. 다른 이름을 입력해주세요.'; - - $lang->about_browser_title = "Esto es el valor que se mostrará en el título del navegador. También es usado en RSS/Trackback."; - $lang->about_mid = "El nombre del módulo será usado como http://direccion/?mid=NombreMódulo.\n(sólo alfabeto español+[alfabeto español, números y el gión abajo(_)] son permitidos. The maximum length is 40.)"; - $lang->about_default = "Si selecciona esta opción, se mostrara de manera predefinida sin el valor de mid."; - $lang->about_module_category = "Es posible manejar a traves de categoría.\n EL URL para en manejo del módulo de categoría es Manejo de módulo > Módulo de categoría ."; - $lang->about_description= 'Descripción usada para la administración.'; - $lang->about_default = 'Si selecciona esta opción, se mostrará de manera predefinida sin el valor de mid.'; - $lang->about_header_text = 'El contenido se mostrará en la parte superior del módulo.(tags de html permitido)'; - $lang->about_footer_text = 'El contenido se mostrará en la parte inferior del módulo.(tags de html permitido)'; - $lang->about_skin = 'Usted puede elegir un tema del módulo.'; - $lang->about_use_category = 'Si selecciona esta opción, la función de categoría sera activada.'; - $lang->about_list_count = 'Usted puede definir el número límite de los documentos a mostrar en una página.(Predefinido es 20)'; - $lang->about_search_list_count = 'Usted puede configurar el número de artículos que se exponen cuando se utiliza la función de búsqueda o categoría. (Por defecto es 20)'; - $lang->about_page_count = 'Usted puede definir el número de página enlazada para mover páginas en un botón de la página.(Predefinido es 10)'; - $lang->about_admin_id = 'Usted puede definir el administrador de atribuciones superiores al módulo.\n Usted puede asignar múltiples IDs.'; - $lang->about_grant = 'Si usted desea desactivar a todos los objetos teniendo atribuciones especificas, incluso el usuario no conectado pueden tener atribuciones.'; - $lang->about_grant_deatil = '가입한 사용자는 cafeXE등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다'; - $lang->about_module = "XE consiste de módulos excepto la librería básica.\n Módulo del Manejo del Módulo muestra todos los módulos instalados y ayuda el manejo de ellos."; - - $lang->about_extra_vars_default_value = 'Si múltiples valores predefinidos son requeridos, usted puede enlazar con la coma(,).'; - $lang->about_search_virtual_site = "가상 사이트(카페XE등)의 도메인을 입력하신 후 검색하세요.
    가상 사이트이외의 모듈은 내용을 비우고 검색하시면 됩니다. (http:// 는 제외)"; - $lang->about_langcode = "언어별로 다르게 설정하고 싶으시면 언어코드 찾기를 이용해주세요"; - $lang->about_file_extension= "%s 파일만 가능합니다."; -?> +virtual_site = "Virtual Site"; + $lang->module_list = "Lista de Módulos"; + $lang->module_index = "Lista de Módulos"; + $lang->module_category = "Categoría de Módulos "; + $lang->module_info = "Información"; + $lang->add_shortcut = "Añadir en el menú del administrador"; + $lang->module_action = "Acción"; + $lang->module_maker = "Módulo del desarrollador"; + $lang->module_license = 'License'; + $lang->module_history = "Historia de actualización"; + $lang->category_title = "Título de categoría"; + $lang->header_text = 'Encabezado'; + $lang->footer_text = 'Pie de página'; + $lang->use_category = 'Usar categoría'; + $lang->category_title = 'Título de categoría'; + $lang->checked_count = 'Múmero de los documentos selecionados'; + $lang->skin_default_info = 'información del tema predefinido'; + $lang->skin_author = 'Desarrollador de tema'; + $lang->skin_license = 'License'; + $lang->skin_history = 'Historia de actualización'; + $lang->module_copy = "Copy Module"; + $lang->module_selector = "Module Selector"; + $lang->do_selected = "선택된 것들을..."; + $lang->bundle_setup = "일괄 기본 설정"; + $lang->bundle_addition_setup = "일괄 추가 설정"; + $lang->bundle_grant_setup = "일괄 권한 설정"; + $lang->lang_code = "언어 코드"; + $lang->filebox = "파일박스"; + + $lang->access_type = '접속 방법'; + $lang->access_domain = 'Domain 접속'; + $lang->access_vid = 'Site ID 접속'; + $lang->about_domain = 'Para crear un dominio privado de la site requiere.
    Independiente de dominio o subdominio, y XE está instalado, el camino que en su conjunto.
    Ej.) www.xpressengine.com / zbxe'; + $lang->about_vid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.
    첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다'; + $lang->msg_already_registed_vid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.'; + $lang->msg_already_registed_domain = 'Ya es de dominio registrado. Por favor, use un dominio diferente'; + + $lang->header_script = "헤더 스크립트"; + $lang->about_header_script = "html의 <header>와 </header> 사이에 들어가는 코드를 직접 입력할 수 있습니다.
    <script, <style 또는 <meta 태그등을 이용하실 수 있습니다"; + + $lang->grant_access = "Access"; + $lang->grant_manager = "Management"; + + $lang->grant_to_all = "All users"; + $lang->grant_to_login_user = "Logged users"; + $lang->grant_to_site_user = "Joined users"; + $lang->grant_to_group = "Specification group users"; + + $lang->cmd_add_shortcut = "añadir acceso directo"; + $lang->cmd_install = "Instalar"; + $lang->cmd_update = "Actualizar"; + $lang->cmd_manage_category = 'Manejo de categorías'; + $lang->cmd_manage_grant = 'Manejo de atribuciones'; + $lang->cmd_manage_skin = 'Manejo de temas'; + $lang->cmd_manage_document = 'Manejo de documentos'; + $lang->cmd_find_module = '모듈 찾기'; + $lang->cmd_find_langcode = 'Find lang code'; + + $lang->msg_new_module = "Crear un nuevo módulo"; + $lang->msg_update_module = "Modificar el módulo"; + $lang->msg_module_name_exists = "El nombre ya existe. Por favor tratar con otro nombre."; + $lang->msg_category_is_null = 'No existe categoría registrada.'; + $lang->msg_grant_is_null = 'No existe el objetivo de atribución registrado.'; + $lang->msg_no_checked_document = 'No existe documento seleccionado.'; + $lang->msg_move_failed = 'No pudo moverse'; + $lang->msg_cannot_delete_for_child = 'No puede eliminar la categoría si posee subcategoría.'; + $lang->msg_limit_mid ='모듈이름은 영문+[영문+숫자+_] 만 가능합니다.'; + $lang->msg_extra_name_exists = '이미 존재하는 확장변수 이름입니다. 다른 이름을 입력해주세요.'; + + $lang->about_browser_title = "Esto es el valor que se mostrará en el título del navegador. También es usado en RSS/Trackback."; + $lang->about_mid = "El nombre del módulo será usado como http://direccion/?mid=NombreMódulo.\n(sólo alfabeto español+[alfabeto español, números y el gión abajo(_)] son permitidos. The maximum length is 40.)"; + $lang->about_default = "Si selecciona esta opción, se mostrara de manera predefinida sin el valor de mid."; + $lang->about_module_category = "Es posible manejar a traves de categoría.\n EL URL para en manejo del módulo de categoría es Manejo de módulo > Módulo de categoría ."; + $lang->about_description= 'Descripción usada para la administración.'; + $lang->about_default = 'Si selecciona esta opción, se mostrará de manera predefinida sin el valor de mid.'; + $lang->about_header_text = 'El contenido se mostrará en la parte superior del módulo.(tags de html permitido)'; + $lang->about_footer_text = 'El contenido se mostrará en la parte inferior del módulo.(tags de html permitido)'; + $lang->about_skin = 'Usted puede elegir un tema del módulo.'; + $lang->about_use_category = 'Si selecciona esta opción, la función de categoría sera activada.'; + $lang->about_list_count = 'Usted puede definir el número límite de los documentos a mostrar en una página.(Predefinido es 20)'; + $lang->about_search_list_count = 'Usted puede configurar el número de artículos que se exponen cuando se utiliza la función de búsqueda o categoría. (Por defecto es 20)'; + $lang->about_page_count = 'Usted puede definir el número de página enlazada para mover páginas en un botón de la página.(Predefinido es 10)'; + $lang->about_admin_id = 'Usted puede definir el administrador de atribuciones superiores al módulo.\n Usted puede asignar múltiples IDs.'; + $lang->about_grant = 'Si usted desea desactivar a todos los objetos teniendo atribuciones especificas, incluso el usuario no conectado pueden tener atribuciones.'; + $lang->about_grant_deatil = '가입한 사용자는 cafeXE등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다'; + $lang->about_module = "XE consiste de módulos excepto la librería básica.\n Módulo del Manejo del Módulo muestra todos los módulos instalados y ayuda el manejo de ellos."; + + $lang->about_extra_vars_default_value = 'Si múltiples valores predefinidos son requeridos, usted puede enlazar con la coma(,).'; + $lang->about_search_virtual_site = "가상 사이트(카페XE등)의 도메인을 입력하신 후 검색하세요.
    가상 사이트이외의 모듈은 내용을 비우고 검색하시면 됩니다. (http:// 는 제외)"; + $lang->about_langcode = "언어별로 다르게 설정하고 싶으시면 언어코드 찾기를 이용해주세요"; + $lang->about_file_extension= "%s 파일만 가능합니다."; +?> diff --git a/modules/module/lang/fr.lang.php b/modules/module/lang/fr.lang.php index ce43eb534..1ceb83453 100644 --- a/modules/module/lang/fr.lang.php +++ b/modules/module/lang/fr.lang.php @@ -1,98 +1,98 @@ - - * @brief Paque du langage en français pour le module de Module - **/ - - $lang->virtual_site = "Virtual Site"; - $lang->module_list = "Liste des Modules"; - $lang->module_index = "Liste des Modules"; - $lang->module_category = "Catégorie des Modules"; - $lang->module_info = "Information de Module"; - $lang->add_shortcut = "Ajouter un raccourci dans le menu pour l'administrateur"; - $lang->module_action = "Actions"; - $lang->module_maker = "Développeur du Module"; - $lang->module_license = 'Licence'; - $lang->module_history = "Histoire de Mise à Jour"; - $lang->category_title = "Titre de la Catégorie"; - $lang->header_text = 'Texte en-tête'; - $lang->footer_text = 'Text au bas de page'; - $lang->use_category = 'Utiliser catégorie'; - $lang->category_title = 'Titre de la Catégorie'; - $lang->checked_count = 'somme des Articles choisis'; - $lang->skin_default_info = 'Information fondamental de l\'habillage'; - $lang->skin_author = 'Developpeur de l\'habillage'; - $lang->skin_license = 'Licence'; - $lang->skin_history = 'Histoire des Mises à jour'; - $lang->module_copy = "Copier un Module"; - $lang->module_selector = "Module Selector"; - $lang->do_selected = "선택된 것들을..."; - $lang->bundle_setup = "일괄 기본 설정"; - $lang->bundle_addition_setup = "일괄 추가 설정"; - $lang->bundle_grant_setup = "일괄 권한 설정"; - $lang->lang_code = "언어 코드"; - $lang->filebox = "파일박스"; - - $lang->access_type = '접속 방법'; - $lang->access_domain = 'Domain 접속'; - $lang->access_vid = 'Site ID 접속'; - $lang->about_vid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.
    첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다'; - $lang->msg_already_registed_vid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.'; - $lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요'; - - $lang->header_script = "Script en-tête"; - $lang->about_header_script = "Vous pouvez entrer un script en html par vous-même entre <header> et </header>.
    Vous pouvez utiliser <script, <style ou <meta tag"; - - $lang->grant_access = "Access"; - $lang->grant_manager = "Management"; - - $lang->grant_to_all = "All users"; - $lang->grant_to_login_user = "Logged users"; - $lang->grant_to_site_user = "Joined users"; - $lang->grant_to_group = "Specification group users"; - - $lang->cmd_add_shortcut = "Ajouter un raccourci"; - $lang->cmd_install = "Installer"; - $lang->cmd_update = "Mettre à Jour"; - $lang->cmd_manage_category = 'Administrer des Catégories'; - $lang->cmd_manage_grant = 'Administrer des Permissions'; - $lang->cmd_manage_skin = 'Administrer des Habillages'; - $lang->cmd_manage_document = 'Administrer des Articles'; - $lang->cmd_find_module = '모듈 찾기'; - $lang->cmd_find_langcode = 'Find lang code'; - - $lang->msg_new_module = "Créer un module"; - $lang->msg_update_module = "Modifier un module"; - $lang->msg_module_name_exists = "Le nom existe déjà. Essayez un autre nom, S.V.P."; - $lang->msg_category_is_null = 'Il n\'y a pas de catégorie enrégistrée.'; - $lang->msg_grant_is_null = 'Il n\'y a pas de liste de permission.'; - $lang->msg_no_checked_document = 'Pas un article est choisi.'; - $lang->msg_move_failed = 'Echoué de bouger'; - $lang->msg_cannot_delete_for_child = 'On ne peut pas supprimer une catégorie qui a des catégories inférieures.'; - $lang->msg_limit_mid ='모듈이름은 영문+[영문+숫자+_] 만 가능합니다.'; - $lang->msg_extra_name_exists = '이미 존재하는 확장변수 이름입니다. 다른 이름을 입력해주세요.'; - - $lang->about_browser_title = "C'est la valeur qui se représentera dans le titre de navigateur Web. Ce sera encore utilisé dans RSS/Rétrolien."; - $lang->about_mid = "Le nom de module sera utilisé comme http://adresse/?mid=ModuleName.\n(alphabet anglais + [alphabet anglais, nombres, et soulignement(_)] sont seulement permis. The maximum length is 40.)"; - $lang->about_default = "Si c'est coché, on verra ce module quand on connecte ce site sans aucune valeur de mid(mid=Nulle Valeur)."; - $lang->about_module_category = "Ça vous permet d'administrer le module par la catégorie.\nOn peut administrer la classification des modules à Administration des modules > Catégorie des Modules ."; - $lang->about_description= 'C\'est la description pour la facilité à administrer.'; - $lang->about_default = 'Si c\'est coché, on verra ce module quand on connecte ce site sans aucune valeur de mid(mid=Nulle Valeur).'; - $lang->about_header_text = 'Ce contenu sera exposé en tête du module.(balise en html est disponible)'; - $lang->about_footer_text = 'Ce contenu sera exposé en bas du module.(balise en html est disponible)'; - $lang->about_skin = 'Vous pouvez choisir un habillage pour le module.'; - $lang->about_use_category = 'Cochez pour utiliser la fonction de catégorie, .'; - $lang->about_list_count = 'Vous pouvez configurer combien d\'articles soient exposés dans une page.(20 par défaut)'; - $lang->about_search_list_count = 'Vous pouvez configurer combien d\'articles soient exposés quand vous utilisez la fonction de recherche ou de catégorie. (20 par défaut)'; - $lang->about_page_count = 'Vous pouvez configurer combien de liens pour les Pages à Bouger en bas de chaque page.(10 par défaut)'; - $lang->about_admin_id = 'Vous pouvez désigner un directeur qui aura tous les permissions sur le module.\nVous pouvez entrer plusieurs compte en utilisant.'; - $lang->about_grant = 'Si vous ne donnez pas la permission à aucune personne, même les membres qui n\'a pas ouvert la connexion auront la permission. '; - $lang->about_grant_deatil = '가입한 사용자는 cafeXE등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다'; - $lang->about_module = "XE se compose des modules sauf la bibliothèque fondamental.\nLe module [Administration des Modules] montera tous les modules installés et vous aidera les administrer."; - - $lang->about_extra_vars_default_value = 'Si plusieurs valeurs sont nécessaires, vous pouvez les connecter avec la virgule(,).'; - $lang->about_search_virtual_site = "가상 사이트(카페XE등)의 도메인을 입력하신 후 검색하세요.
    가상 사이트이외의 모듈은 내용을 비우고 검색하시면 됩니다. (http:// 는 제외)"; - $lang->about_langcode = "언어별로 다르게 설정하고 싶으시면 언어코드 찾기를 이용해주세요"; - $lang->about_file_extension= "%s 파일만 가능합니다."; -?> + + * @brief Paque du langage en français pour le module de Module + **/ + + $lang->virtual_site = "Virtual Site"; + $lang->module_list = "Liste des Modules"; + $lang->module_index = "Liste des Modules"; + $lang->module_category = "Catégorie des Modules"; + $lang->module_info = "Information de Module"; + $lang->add_shortcut = "Ajouter un raccourci dans le menu pour l'administrateur"; + $lang->module_action = "Actions"; + $lang->module_maker = "Développeur du Module"; + $lang->module_license = 'Licence'; + $lang->module_history = "Histoire de Mise à Jour"; + $lang->category_title = "Titre de la Catégorie"; + $lang->header_text = 'Texte en-tête'; + $lang->footer_text = 'Text au bas de page'; + $lang->use_category = 'Utiliser catégorie'; + $lang->category_title = 'Titre de la Catégorie'; + $lang->checked_count = 'somme des Articles choisis'; + $lang->skin_default_info = 'Information fondamental de l\'habillage'; + $lang->skin_author = 'Developpeur de l\'habillage'; + $lang->skin_license = 'Licence'; + $lang->skin_history = 'Histoire des Mises à jour'; + $lang->module_copy = "Copier un Module"; + $lang->module_selector = "Module Selector"; + $lang->do_selected = "선택된 것들을..."; + $lang->bundle_setup = "일괄 기본 설정"; + $lang->bundle_addition_setup = "일괄 추가 설정"; + $lang->bundle_grant_setup = "일괄 권한 설정"; + $lang->lang_code = "언어 코드"; + $lang->filebox = "파일박스"; + + $lang->access_type = '접속 방법'; + $lang->access_domain = 'Domain 접속'; + $lang->access_vid = 'Site ID 접속'; + $lang->about_vid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.
    첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다'; + $lang->msg_already_registed_vid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.'; + $lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요'; + + $lang->header_script = "Script en-tête"; + $lang->about_header_script = "Vous pouvez entrer un script en html par vous-même entre <header> et </header>.
    Vous pouvez utiliser <script, <style ou <meta tag"; + + $lang->grant_access = "Access"; + $lang->grant_manager = "Management"; + + $lang->grant_to_all = "All users"; + $lang->grant_to_login_user = "Logged users"; + $lang->grant_to_site_user = "Joined users"; + $lang->grant_to_group = "Specification group users"; + + $lang->cmd_add_shortcut = "Ajouter un raccourci"; + $lang->cmd_install = "Installer"; + $lang->cmd_update = "Mettre à Jour"; + $lang->cmd_manage_category = 'Administrer des Catégories'; + $lang->cmd_manage_grant = 'Administrer des Permissions'; + $lang->cmd_manage_skin = 'Administrer des Habillages'; + $lang->cmd_manage_document = 'Administrer des Articles'; + $lang->cmd_find_module = '모듈 찾기'; + $lang->cmd_find_langcode = 'Find lang code'; + + $lang->msg_new_module = "Créer un module"; + $lang->msg_update_module = "Modifier un module"; + $lang->msg_module_name_exists = "Le nom existe déjà. Essayez un autre nom, S.V.P."; + $lang->msg_category_is_null = 'Il n\'y a pas de catégorie enrégistrée.'; + $lang->msg_grant_is_null = 'Il n\'y a pas de liste de permission.'; + $lang->msg_no_checked_document = 'Pas un article est choisi.'; + $lang->msg_move_failed = 'Echoué de bouger'; + $lang->msg_cannot_delete_for_child = 'On ne peut pas supprimer une catégorie qui a des catégories inférieures.'; + $lang->msg_limit_mid ='모듈이름은 영문+[영문+숫자+_] 만 가능합니다.'; + $lang->msg_extra_name_exists = '이미 존재하는 확장변수 이름입니다. 다른 이름을 입력해주세요.'; + + $lang->about_browser_title = "C'est la valeur qui se représentera dans le titre de navigateur Web. Ce sera encore utilisé dans RSS/Rétrolien."; + $lang->about_mid = "Le nom de module sera utilisé comme http://adresse/?mid=ModuleName.\n(alphabet anglais + [alphabet anglais, nombres, et soulignement(_)] sont seulement permis. The maximum length is 40.)"; + $lang->about_default = "Si c'est coché, on verra ce module quand on connecte ce site sans aucune valeur de mid(mid=Nulle Valeur)."; + $lang->about_module_category = "Ça vous permet d'administrer le module par la catégorie.\nOn peut administrer la classification des modules à Administration des modules > Catégorie des Modules ."; + $lang->about_description= 'C\'est la description pour la facilité à administrer.'; + $lang->about_default = 'Si c\'est coché, on verra ce module quand on connecte ce site sans aucune valeur de mid(mid=Nulle Valeur).'; + $lang->about_header_text = 'Ce contenu sera exposé en tête du module.(balise en html est disponible)'; + $lang->about_footer_text = 'Ce contenu sera exposé en bas du module.(balise en html est disponible)'; + $lang->about_skin = 'Vous pouvez choisir un habillage pour le module.'; + $lang->about_use_category = 'Cochez pour utiliser la fonction de catégorie, .'; + $lang->about_list_count = 'Vous pouvez configurer combien d\'articles soient exposés dans une page.(20 par défaut)'; + $lang->about_search_list_count = 'Vous pouvez configurer combien d\'articles soient exposés quand vous utilisez la fonction de recherche ou de catégorie. (20 par défaut)'; + $lang->about_page_count = 'Vous pouvez configurer combien de liens pour les Pages à Bouger en bas de chaque page.(10 par défaut)'; + $lang->about_admin_id = 'Vous pouvez désigner un directeur qui aura tous les permissions sur le module.\nVous pouvez entrer plusieurs compte en utilisant.'; + $lang->about_grant = 'Si vous ne donnez pas la permission à aucune personne, même les membres qui n\'a pas ouvert la connexion auront la permission. '; + $lang->about_grant_deatil = '가입한 사용자는 cafeXE등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다'; + $lang->about_module = "XE se compose des modules sauf la bibliothèque fondamental.\nLe module [Administration des Modules] montera tous les modules installés et vous aidera les administrer."; + + $lang->about_extra_vars_default_value = 'Si plusieurs valeurs sont nécessaires, vous pouvez les connecter avec la virgule(,).'; + $lang->about_search_virtual_site = "가상 사이트(카페XE등)의 도메인을 입력하신 후 검색하세요.
    가상 사이트이외의 모듈은 내용을 비우고 검색하시면 됩니다. (http:// 는 제외)"; + $lang->about_langcode = "언어별로 다르게 설정하고 싶으시면 언어코드 찾기를 이용해주세요"; + $lang->about_file_extension= "%s 파일만 가능합니다."; +?> diff --git a/modules/module/lang/jp.lang.php b/modules/module/lang/jp.lang.php index 0f35eb2f8..fa2b79d07 100644 --- a/modules/module/lang/jp.lang.php +++ b/modules/module/lang/jp.lang.php @@ -1,98 +1,98 @@ -virtual_site = 'バーチャル(Virtual)サイト'; - $lang->module_list = 'モジュールリスト'; - $lang->module_index = 'モジュールインデックス'; - $lang->module_category = 'モジュールカテゴリ'; - $lang->module_info = '詳細'; - $lang->add_shortcut = '管理者メニューに追加する'; - $lang->module_action = '動作'; - $lang->module_maker = 'モジュール作者'; - $lang->module_license = 'ライセンス'; - $lang->module_history = '変更履歴 '; - $lang->category_title = 'カテゴリ名'; - $lang->header_text = 'ヘッダー内容'; - $lang->footer_text = 'フッター内容'; - $lang->use_category = 'カテゴリ使用'; - $lang->category_title = 'カテゴリ名'; - $lang->checked_count = '選択された書き込み数'; - $lang->skin_default_info = 'スキン基本情報'; - $lang->skin_author = 'スキン作者'; - $lang->skin_license = 'ライセンス'; - $lang->skin_history = '変更内容'; - $lang->module_copy = 'モジュールコピー'; - $lang->module_selector = 'モジュールセレクター'; - $lang->do_selected = '選択したものを...'; - $lang->bundle_setup = '一括基本設定'; - $lang->bundle_addition_setup = '一括追加設定'; - $lang->bundle_grant_setup = '一括権限設定'; - $lang->lang_code = '言語コード'; - $lang->filebox = 'ファイルボックス'; - - $lang->access_type = 'アクセスタイプ'; - $lang->access_domain = 'Doaminアクセス'; - $lang->access_vid = 'Site IDアクセス'; - $lang->about_domain = '複数のホームページを作成するためには、「オリジナルドメイン」や「サブ ドメイン」のような専用のドメインが必要です。
    また、 XEのインストールパスも一緒に記入して下さい。
    ex) www.xpressengine.com/xe'; - $lang->about_vid = '別の違うドメインではなく、「http://XEアドレス/ID」へのアクセスが可能です。この際、モジュール名(mid)と重複しないように登録して下さい。
    必ず、頭文字は半角英文字にし、「(すべて半角の)英数字・_ 」 だけの組み合わせで入力して下さい。'; - $lang->msg_already_registed_vid = '既に登録されたサイトIDです。掲示板などのmidと重複は不可です。異なるIDを入力して下さい。'; - $lang->msg_already_registed_domain = '既に登録されているドメインです。異なるドメインを利用して下さい。'; - - $lang->header_script = 'ヘッダースクリプト'; - $lang->about_header_script = 'HTMLの<header>と</header>の間に入れるコードを直接入力出来ます。
    <script、<styleまたは<metaタグなどが利用出来ます。'; - - $lang->grant_access = 'アクセス権限'; - $lang->grant_manager = '管理権限'; - - $lang->grant_to_all = 'すべてのユーザー'; - $lang->grant_to_login_user = 'ログインユーザー'; - $lang->grant_to_site_user = '登録ユーザー'; - $lang->grant_to_group = '特定グループのユーザー'; - - $lang->cmd_add_shortcut = 'ショットカット追加'; - $lang->cmd_install = 'インストール'; - $lang->cmd_update = 'アップデート'; - $lang->cmd_manage_category = 'カテゴリ管理'; - $lang->cmd_manage_grant = '権限管理'; - $lang->cmd_manage_skin = 'スキン管理'; - $lang->cmd_manage_document = '書き込み管理'; - $lang->cmd_find_module = 'モジュール検索'; - $lang->cmd_find_langcode = '言語コード検索'; - - $lang->msg_new_module = 'モジュール作成'; - $lang->msg_update_module = 'モジュール修正'; - $lang->msg_module_name_exists = '既に存在するモジュール名です。他の名前を入力して下さい。'; - $lang->msg_category_is_null = '登録されているカテゴリがありません。'; - $lang->msg_grant_is_null = '登録された権限がありません。'; - $lang->msg_no_checked_document = '選択された書き込みがありません。'; - $lang->msg_move_failed = '移動することが出来ませんでした。'; - $lang->msg_cannot_delete_for_child = '下位カテゴリのカテゴリは削除することが出来ません。'; - $lang->msg_limit_mid ='モジュール名は「 半角英小文字+[半角英小文字+半角数字+_] 」のみ出来ます。'; - $lang->msg_extra_name_exists = '既に存在する拡張変数名です。他の拡張変数名を入力して下さい。'; - - $lang->about_browser_title = 'ブラウザのタイトルバーに表示される内容です。RSS/Trackbackでも使用します。'; - $lang->about_mid = 'モジュール名は「http://アドレス/?mid=モジュール名」のように直接呼び出せるパラメーター値です。
    ※英数の頭文字と[英数と_のみ]の組み合わせ (すべて半角、最大40文字) '; - $lang->about_default = 'チェックすると、サイトに「mid値」なしでアクセスした場合、デフォルトで表示します。'; - $lang->about_module_category = "カテゴリで管理出来るようにします。モジュールのカテゴリの管理は、「モジュール管理 > モジュールカテゴリ」にて行います。"; - $lang->about_description= '管理用として用いられる説明です。'; - $lang->about_header_text = 'モジュールのヘッダーに表示される内容です。(HTMLタグの使用可能)'; - $lang->about_footer_text = 'モジュールのフッターに表示される内容です。(HTMLタグの使用可能)'; - $lang->about_skin = 'モジュールのスキンを選択します。'; - $lang->about_use_category = 'チェックするとカテゴリ機能が使用出来ます。'; - $lang->about_list_count = '1ページ当たりに表示される書き込みの数が指定出来ます(デフォルト20個)。'; - $lang->about_search_list_count = 'お勧めの記事数を設定するにさらされるかのカテゴリ検索機能を使用する場合です。 (デフォルトは20 )'; - $lang->about_page_count = 'リストの下段に移動出来るページのリンク数が指定出来ます(デフォルト10個)。'; - $lang->about_admin_id = '該当するモジュールに対して最高権限を持つ管理者を指定することが出来ます。'; - $lang->about_grant = '特定権限の対象をすべて解除するとログインしていない会員ユーザまで権限が与えられます。'; - $lang->about_grant_deatil = '登録ユーザーとはcafeXEなど分譲型バーチャル(Virtual)サイトに登録した、ログインユーザーを意味します。'; - $lang->about_module = "XEは、基本ライブラリの他は、すべてモジュールで構成されています。モジュール管理用のモジュールはインストールされたすべてを表示し、管理出来るようにします。"; - $lang->about_extra_vars_default_value = '多重・単一選択などのデフォルト値が、複数必要な場合は、「, (コンマ)」で区切って追加することが出来ます。'; - $lang->about_search_virtual_site = 'バーチャル(Virtual)サイト(:cafeXEなど)のドメインを入力して検索して下さい。
    バーチャル(Virtual)サイト以外のモジュールは内容を空にしてから検索します。(http://は省く)'; - $lang->about_extra_vars_eid_value = '拡張変数名を入力して下さい。 (英字+[英字+数字+_]のみ可能(全て半角))'; - $lang->about_langcode = '言語ごとに異なる設定をする場合、言語コード検索を利用して下さい。'; - $lang->about_file_extension= "%s ファイルのみ可能です。"; -?> +virtual_site = 'バーチャル(Virtual)サイト'; + $lang->module_list = 'モジュールリスト'; + $lang->module_index = 'モジュールインデックス'; + $lang->module_category = 'モジュールカテゴリ'; + $lang->module_info = '詳細'; + $lang->add_shortcut = '管理者メニューに追加する'; + $lang->module_action = '動作'; + $lang->module_maker = 'モジュール作者'; + $lang->module_license = 'ライセンス'; + $lang->module_history = '変更履歴 '; + $lang->category_title = 'カテゴリ名'; + $lang->header_text = 'ヘッダー内容'; + $lang->footer_text = 'フッター内容'; + $lang->use_category = 'カテゴリ使用'; + $lang->category_title = 'カテゴリ名'; + $lang->checked_count = '選択された書き込み数'; + $lang->skin_default_info = 'スキン基本情報'; + $lang->skin_author = 'スキン作者'; + $lang->skin_license = 'ライセンス'; + $lang->skin_history = '変更内容'; + $lang->module_copy = 'モジュールコピー'; + $lang->module_selector = 'モジュールセレクター'; + $lang->do_selected = '選択したものを...'; + $lang->bundle_setup = '一括基本設定'; + $lang->bundle_addition_setup = '一括追加設定'; + $lang->bundle_grant_setup = '一括権限設定'; + $lang->lang_code = '言語コード'; + $lang->filebox = 'ファイルボックス'; + + $lang->access_type = 'アクセスタイプ'; + $lang->access_domain = 'Doaminアクセス'; + $lang->access_vid = 'Site IDアクセス'; + $lang->about_domain = '複数のホームページを作成するためには、「オリジナルドメイン」や「サブ ドメイン」のような専用のドメインが必要です。
    また、 XEのインストールパスも一緒に記入して下さい。
    ex) www.xpressengine.com/xe'; + $lang->about_vid = '別の違うドメインではなく、「http://XEアドレス/ID」へのアクセスが可能です。この際、モジュール名(mid)と重複しないように登録して下さい。
    必ず、頭文字は半角英文字にし、「(すべて半角の)英数字・_ 」 だけの組み合わせで入力して下さい。'; + $lang->msg_already_registed_vid = '既に登録されたサイトIDです。掲示板などのmidと重複は不可です。異なるIDを入力して下さい。'; + $lang->msg_already_registed_domain = '既に登録されているドメインです。異なるドメインを利用して下さい。'; + + $lang->header_script = 'ヘッダースクリプト'; + $lang->about_header_script = 'HTMLの<header>と</header>の間に入れるコードを直接入力出来ます。
    <script、<styleまたは<metaタグなどが利用出来ます。'; + + $lang->grant_access = 'アクセス権限'; + $lang->grant_manager = '管理権限'; + + $lang->grant_to_all = 'すべてのユーザー'; + $lang->grant_to_login_user = 'ログインユーザー'; + $lang->grant_to_site_user = '登録ユーザー'; + $lang->grant_to_group = '特定グループのユーザー'; + + $lang->cmd_add_shortcut = 'ショットカット追加'; + $lang->cmd_install = 'インストール'; + $lang->cmd_update = 'アップデート'; + $lang->cmd_manage_category = 'カテゴリ管理'; + $lang->cmd_manage_grant = '権限管理'; + $lang->cmd_manage_skin = 'スキン管理'; + $lang->cmd_manage_document = '書き込み管理'; + $lang->cmd_find_module = 'モジュール検索'; + $lang->cmd_find_langcode = '言語コード検索'; + + $lang->msg_new_module = 'モジュール作成'; + $lang->msg_update_module = 'モジュール修正'; + $lang->msg_module_name_exists = '既に存在するモジュール名です。他の名前を入力して下さい。'; + $lang->msg_category_is_null = '登録されているカテゴリがありません。'; + $lang->msg_grant_is_null = '登録された権限がありません。'; + $lang->msg_no_checked_document = '選択された書き込みがありません。'; + $lang->msg_move_failed = '移動することが出来ませんでした。'; + $lang->msg_cannot_delete_for_child = '下位カテゴリのカテゴリは削除することが出来ません。'; + $lang->msg_limit_mid ='モジュール名は「 半角英小文字+[半角英小文字+半角数字+_] 」のみ出来ます。'; + $lang->msg_extra_name_exists = '既に存在する拡張変数名です。他の拡張変数名を入力して下さい。'; + + $lang->about_browser_title = 'ブラウザのタイトルバーに表示される内容です。RSS/Trackbackでも使用します。'; + $lang->about_mid = 'モジュール名は「http://アドレス/?mid=モジュール名」のように直接呼び出せるパラメーター値です。
    ※英数の頭文字と[英数と_のみ]の組み合わせ (すべて半角、最大40文字) '; + $lang->about_default = 'チェックすると、サイトに「mid値」なしでアクセスした場合、デフォルトで表示します。'; + $lang->about_module_category = "カテゴリで管理出来るようにします。モジュールのカテゴリの管理は、「モジュール管理 > モジュールカテゴリ」にて行います。"; + $lang->about_description= '管理用として用いられる説明です。'; + $lang->about_header_text = 'モジュールのヘッダーに表示される内容です。(HTMLタグの使用可能)'; + $lang->about_footer_text = 'モジュールのフッターに表示される内容です。(HTMLタグの使用可能)'; + $lang->about_skin = 'モジュールのスキンを選択します。'; + $lang->about_use_category = 'チェックするとカテゴリ機能が使用出来ます。'; + $lang->about_list_count = '1ページ当たりに表示される書き込みの数が指定出来ます(デフォルト20個)。'; + $lang->about_search_list_count = 'お勧めの記事数を設定するにさらされるかのカテゴリ検索機能を使用する場合です。 (デフォルトは20 )'; + $lang->about_page_count = 'リストの下段に移動出来るページのリンク数が指定出来ます(デフォルト10個)。'; + $lang->about_admin_id = '該当するモジュールに対して最高権限を持つ管理者を指定することが出来ます。'; + $lang->about_grant = '特定権限の対象をすべて解除するとログインしていない会員ユーザまで権限が与えられます。'; + $lang->about_grant_deatil = '登録ユーザーとはcafeXEなど分譲型バーチャル(Virtual)サイトに登録した、ログインユーザーを意味します。'; + $lang->about_module = "XEは、基本ライブラリの他は、すべてモジュールで構成されています。モジュール管理用のモジュールはインストールされたすべてを表示し、管理出来るようにします。"; + $lang->about_extra_vars_default_value = '多重・単一選択などのデフォルト値が、複数必要な場合は、「, (コンマ)」で区切って追加することが出来ます。'; + $lang->about_search_virtual_site = 'バーチャル(Virtual)サイト(:cafeXEなど)のドメインを入力して検索して下さい。
    バーチャル(Virtual)サイト以外のモジュールは内容を空にしてから検索します。(http://は省く)'; + $lang->about_extra_vars_eid_value = '拡張変数名を入力して下さい。 (英字+[英字+数字+_]のみ可能(全て半角))'; + $lang->about_langcode = '言語ごとに異なる設定をする場合、言語コード検索を利用して下さい。'; + $lang->about_file_extension= "%s ファイルのみ可能です。"; +?> diff --git a/modules/module/lang/ko.lang.php b/modules/module/lang/ko.lang.php index 831f8a742..9f1f62f58 100644 --- a/modules/module/lang/ko.lang.php +++ b/modules/module/lang/ko.lang.php @@ -1,98 +1,98 @@ -virtual_site = '가상 사이트'; - $lang->module_list = '모듈 목록'; - $lang->module_index = '모듈 목록'; - $lang->module_category = '모듈 분류'; - $lang->module_info = '모듈 정보'; - $lang->add_shortcut = '관리자 메뉴에 추가'; - $lang->module_action = '동작'; - $lang->module_maker = '모듈 제작자'; - $lang->module_license = '라이선스'; - $lang->module_history = '변경 이력 '; - $lang->category_title = '분류 이름'; - $lang->header_text = '상단 내용'; - $lang->footer_text = '하단 내용'; - $lang->use_category = '분류 사용'; - $lang->category_title = '분류명'; - $lang->checked_count = '선택된 글 수'; - $lang->skin_default_info = '스킨 기본정보'; - $lang->skin_author = '스킨 제작자'; - $lang->skin_license = '라이선스'; - $lang->skin_history = '변경 이력'; - $lang->module_copy = '모듈 복사'; - $lang->module_selector = '모듈 선택기'; - $lang->do_selected = '선택된 것들을...'; - $lang->bundle_setup = '일괄 기본 설정'; - $lang->bundle_addition_setup = '일괄 추가 설정'; - $lang->bundle_grant_setup = '일괄 권한 설정'; - $lang->lang_code = '언어 코드'; - $lang->filebox = '파일박스'; - - $lang->access_type = '접속 방법'; - $lang->access_domain = 'Domain 접속'; - $lang->access_vid = 'Site ID 접속'; - $lang->about_domain = '1개 이상의 사이트를 만들기 위해서는 전용 도메인이 있어야 합니다.
    독립 도메인이나 서브 도메인이 있으면 되고 XE가 설치된 경로까지 같이 넣어주세요.
    예) www.xpressengine.com/xe'; - $lang->about_vid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)과 중복될 수 없습니다.
    첫 글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다'; - $lang->msg_already_registed_vid = '이미 등록된 사이트 ID 입니다. 게시판 등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.'; - $lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요'; - - $lang->header_script = '헤더 스크립트'; - $lang->about_header_script = 'HTML의 <head>와 </head> 사이에 들어가는 코드를 직접 입력할 수 있습니다.
    <script, <style 또는 <meta 태그 등을 이용하실 수 있습니다'; - - $lang->grant_access = '접근 권한'; - $lang->grant_manager = '관리 권한'; - - $lang->grant_to_all = '모든 사용자'; - $lang->grant_to_login_user = '로그인 사용자'; - $lang->grant_to_site_user = '가입한 사용자'; - $lang->grant_to_group = '특정 그룹 사용자'; - - $lang->cmd_add_shortcut = '바로가기 추가'; - $lang->cmd_install = '설치'; - $lang->cmd_update = '업데이트'; - $lang->cmd_manage_category = '분류 관리'; - $lang->cmd_manage_grant = '권한 관리'; - $lang->cmd_manage_skin = '스킨 관리'; - $lang->cmd_manage_document = '게시글 관리'; - $lang->cmd_find_module = '모듈 찾기'; - $lang->cmd_find_langcode = '언어 코드 찾기'; - - $lang->msg_new_module = '모듈 생성'; - $lang->msg_update_module = '모듈 수정'; - $lang->msg_module_name_exists = '이미 존재하는 모듈 이름입니다. 다른 이름을 입력해주세요.'; - $lang->msg_category_is_null = '등록된 분류가 없습니다.'; - $lang->msg_grant_is_null = '등록된 권한 대상이 없습니다.'; - $lang->msg_no_checked_document = '선택된 게시물이 없습니다.'; - $lang->msg_move_failed = '이동 실패하였습니다.'; - $lang->msg_cannot_delete_for_child = '하부 분류가 있는 분류는 삭제하실 수 없습니다.'; - $lang->msg_limit_mid ='모듈 이름은 영문+[영문+숫자+_] 만 가능합니다.'; - $lang->msg_extra_name_exists = '이미 존재하는 확장 변수 이름입니다. 다른 이름을 입력해주세요.'; - - $lang->about_browser_title = '브라우저 제목에 나타나는 값입니다. RSS/Trackback에서도 사용됩니다.'; - $lang->about_mid = '모듈 이름은 http://주소/?mid=모듈이름 처럼 직접 호출할 수 있는 값입니다. (영문+[영문+숫자+_] 만 가능. 최대 40 글자)'; - $lang->about_default = '선택하시면 사이트에 mid값 없이 접속하였을 경우 기본으로 보여줍니다.'; - $lang->about_module_category = "분류를 통한 관리를 할 수 있도록 합니다. 모듈 분류 관리는 모듈관리 > 모듈분류에서 하실 수 있습니다."; - $lang->about_description= '관리용으로 사용되는 설명입니다.'; - $lang->about_header_text = '모듈 상단에 표시되는 내용입니다. (HTML 태그 사용 가능)'; - $lang->about_footer_text = '모듈 하단에 표시되는 내용입니다. (HTML 태그 사용 가능)'; - $lang->about_skin = '모듈 스킨을 선택하실 수 있습니다.'; - $lang->about_use_category = '선택하시면 분류 기능을 사용할 수 있습니다.'; - $lang->about_list_count = '한 페이지에 표시될 글 수를 지정하실 수 있습니다. (기본 20개)'; - $lang->about_search_list_count = '검색, 카테고리 선택 등을 할 경우 표시될 글 수를 지정하실 수 있습니다. (기본 20개)'; - $lang->about_page_count = '목록 하단, 페이지를 이동하는 링크 수를 지정하실 수 있습니다. (기본 10개)'; - $lang->about_admin_id = '해당 모듈에 대해 최고 권한을 가지는 관리자를 지정할 수 있습니다.'; - $lang->about_grant = '특정 권한의 대상을 모두 해제하면 로그인하지 않은 회원까지 권한을 가질 수 있습니다.'; - $lang->about_grant_deatil = '가입한 사용자는 cafeXE 등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다.'; - $lang->about_module = "XE는 기본 라이브러리를 제외한 나머지는 모두 모듈로 구성되어 있습니다.\n모듈 관리 모듈은 설치된 모든 모듈을 보여주고 관리를 돕습니다."; - $lang->about_extra_vars_default_value = '다중/단일 선택 등 기본 값이 여러 개가 필요한 경우 , (콤마)로 연결하시면 됩니다.'; - $lang->about_search_virtual_site = '가상 사이트(예:cafeXE) 도메인을 입력하신 후 검색하세요.
    가상 사이트 이외의 모듈은 내용을 비우고 검색하시면 됩니다. (http:// 는 제외)'; - $lang->about_extra_vars_eid_value = '확장 변수의 이름을 적어주세요. (영문+[영문+숫자+_] 만 가능)'; - $lang->about_langcode = '언어별로 다르게 설정하고 싶으시면 언어 코드 찾기를 이용해주세요.'; - $lang->about_file_extension= "%s 파일만 가능합니다."; -?> +virtual_site = '가상 사이트'; + $lang->module_list = '모듈 목록'; + $lang->module_index = '모듈 목록'; + $lang->module_category = '모듈 분류'; + $lang->module_info = '모듈 정보'; + $lang->add_shortcut = '관리자 메뉴에 추가'; + $lang->module_action = '동작'; + $lang->module_maker = '모듈 제작자'; + $lang->module_license = '라이선스'; + $lang->module_history = '변경 이력 '; + $lang->category_title = '분류 이름'; + $lang->header_text = '상단 내용'; + $lang->footer_text = '하단 내용'; + $lang->use_category = '분류 사용'; + $lang->category_title = '분류명'; + $lang->checked_count = '선택된 글 수'; + $lang->skin_default_info = '스킨 기본정보'; + $lang->skin_author = '스킨 제작자'; + $lang->skin_license = '라이선스'; + $lang->skin_history = '변경 이력'; + $lang->module_copy = '모듈 복사'; + $lang->module_selector = '모듈 선택기'; + $lang->do_selected = '선택된 것들을...'; + $lang->bundle_setup = '일괄 기본 설정'; + $lang->bundle_addition_setup = '일괄 추가 설정'; + $lang->bundle_grant_setup = '일괄 권한 설정'; + $lang->lang_code = '언어 코드'; + $lang->filebox = '파일박스'; + + $lang->access_type = '접속 방법'; + $lang->access_domain = 'Domain 접속'; + $lang->access_vid = 'Site ID 접속'; + $lang->about_domain = '1개 이상의 사이트를 만들기 위해서는 전용 도메인이 있어야 합니다.
    독립 도메인이나 서브 도메인이 있으면 되고 XE가 설치된 경로까지 같이 넣어주세요.
    예) www.xpressengine.com/xe'; + $lang->about_vid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)과 중복될 수 없습니다.
    첫 글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다'; + $lang->msg_already_registed_vid = '이미 등록된 사이트 ID 입니다. 게시판 등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.'; + $lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요'; + + $lang->header_script = '헤더 스크립트'; + $lang->about_header_script = 'HTML의 <head>와 </head> 사이에 들어가는 코드를 직접 입력할 수 있습니다.
    <script, <style 또는 <meta 태그 등을 이용하실 수 있습니다'; + + $lang->grant_access = '접근 권한'; + $lang->grant_manager = '관리 권한'; + + $lang->grant_to_all = '모든 사용자'; + $lang->grant_to_login_user = '로그인 사용자'; + $lang->grant_to_site_user = '가입한 사용자'; + $lang->grant_to_group = '특정 그룹 사용자'; + + $lang->cmd_add_shortcut = '바로가기 추가'; + $lang->cmd_install = '설치'; + $lang->cmd_update = '업데이트'; + $lang->cmd_manage_category = '분류 관리'; + $lang->cmd_manage_grant = '권한 관리'; + $lang->cmd_manage_skin = '스킨 관리'; + $lang->cmd_manage_document = '게시글 관리'; + $lang->cmd_find_module = '모듈 찾기'; + $lang->cmd_find_langcode = '언어 코드 찾기'; + + $lang->msg_new_module = '모듈 생성'; + $lang->msg_update_module = '모듈 수정'; + $lang->msg_module_name_exists = '이미 존재하는 모듈 이름입니다. 다른 이름을 입력해주세요.'; + $lang->msg_category_is_null = '등록된 분류가 없습니다.'; + $lang->msg_grant_is_null = '등록된 권한 대상이 없습니다.'; + $lang->msg_no_checked_document = '선택된 게시물이 없습니다.'; + $lang->msg_move_failed = '이동 실패하였습니다.'; + $lang->msg_cannot_delete_for_child = '하부 분류가 있는 분류는 삭제하실 수 없습니다.'; + $lang->msg_limit_mid ='모듈 이름은 영문+[영문+숫자+_] 만 가능합니다.'; + $lang->msg_extra_name_exists = '이미 존재하는 확장 변수 이름입니다. 다른 이름을 입력해주세요.'; + + $lang->about_browser_title = '브라우저 제목에 나타나는 값입니다. RSS/Trackback에서도 사용됩니다.'; + $lang->about_mid = '모듈 이름은 http://주소/?mid=모듈이름 처럼 직접 호출할 수 있는 값입니다. (영문+[영문+숫자+_] 만 가능. 최대 40 글자)'; + $lang->about_default = '선택하시면 사이트에 mid값 없이 접속하였을 경우 기본으로 보여줍니다.'; + $lang->about_module_category = "분류를 통한 관리를 할 수 있도록 합니다. 모듈 분류 관리는 모듈관리 > 모듈분류에서 하실 수 있습니다."; + $lang->about_description= '관리용으로 사용되는 설명입니다.'; + $lang->about_header_text = '모듈 상단에 표시되는 내용입니다. (HTML 태그 사용 가능)'; + $lang->about_footer_text = '모듈 하단에 표시되는 내용입니다. (HTML 태그 사용 가능)'; + $lang->about_skin = '모듈 스킨을 선택하실 수 있습니다.'; + $lang->about_use_category = '선택하시면 분류 기능을 사용할 수 있습니다.'; + $lang->about_list_count = '한 페이지에 표시될 글 수를 지정하실 수 있습니다. (기본 20개)'; + $lang->about_search_list_count = '검색, 카테고리 선택 등을 할 경우 표시될 글 수를 지정하실 수 있습니다. (기본 20개)'; + $lang->about_page_count = '목록 하단, 페이지를 이동하는 링크 수를 지정하실 수 있습니다. (기본 10개)'; + $lang->about_admin_id = '해당 모듈에 대해 최고 권한을 가지는 관리자를 지정할 수 있습니다.'; + $lang->about_grant = '특정 권한의 대상을 모두 해제하면 로그인하지 않은 회원까지 권한을 가질 수 있습니다.'; + $lang->about_grant_deatil = '가입한 사용자는 cafeXE 등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다.'; + $lang->about_module = "XE는 기본 라이브러리를 제외한 나머지는 모두 모듈로 구성되어 있습니다.\n모듈 관리 모듈은 설치된 모든 모듈을 보여주고 관리를 돕습니다."; + $lang->about_extra_vars_default_value = '다중/단일 선택 등 기본 값이 여러 개가 필요한 경우 , (콤마)로 연결하시면 됩니다.'; + $lang->about_search_virtual_site = '가상 사이트(예:cafeXE) 도메인을 입력하신 후 검색하세요.
    가상 사이트 이외의 모듈은 내용을 비우고 검색하시면 됩니다. (http:// 는 제외)'; + $lang->about_extra_vars_eid_value = '확장 변수의 이름을 적어주세요. (영문+[영문+숫자+_] 만 가능)'; + $lang->about_langcode = '언어별로 다르게 설정하고 싶으시면 언어 코드 찾기를 이용해주세요.'; + $lang->about_file_extension= "%s 파일만 가능합니다."; +?> diff --git a/modules/module/lang/ru.lang.php b/modules/module/lang/ru.lang.php index a0c12a934..121149c4e 100644 --- a/modules/module/lang/ru.lang.php +++ b/modules/module/lang/ru.lang.php @@ -1,99 +1,99 @@ -virtual_site = "Virtual Site"; - $lang->module_list = "Список модулей"; - $lang->module_index = "Список модулей"; - $lang->module_category = "Категория модуля"; - $lang->module_info = "Информация"; - $lang->add_shortcut = "Добавить ярлыки"; - $lang->module_action = "Действия"; - $lang->module_maker = "Разработчик модуля"; - $lang->module_license = 'Лицензия'; - $lang->module_history = "История обновлений"; - $lang->category_title = "Название категории"; - $lang->header_text = 'Верхний колонтитул'; - $lang->footer_text = 'Нижний колонтитул'; - $lang->use_category = 'Включить категорию'; - $lang->category_title = 'Название категории'; - $lang->checked_count = 'Число выбранных статей'; // translator's note: возможно "checked" следует перевести как "проверенных" - $lang->skin_default_info = 'Информация стандартного скина'; - $lang->skin_author = 'Разработчик скина'; - $lang->skin_license = 'License'; - $lang->skin_history = 'История обновлений'; - $lang->module_selector = "Module Selector"; - $lang->do_selected = "Выбранные..."; - $lang->bundle_setup = "일괄 기본 설정"; - $lang->bundle_addition_setup = "일괄 추가 설정"; - $lang->bundle_grant_setup = "일괄 권한 설정"; - $lang->lang_code = "Код языка"; - $lang->filebox = "Файлбокс"; - - $lang->access_type = 'Способ соединения'; - $lang->access_domain = 'Domain соединения'; - $lang->access_vid = 'Site ID соединение'; - $lang->about_vid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.
    첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다'; - $lang->msg_already_registed_vid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.'; - $lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요'; - - $lang->module_copy = "Копировать модуль"; - - $lang->header_script = "Скрипт Header"; - $lang->about_header_script = "html의 <header>와 </header> 사이에 들어가는 코드를 직접 입력할 수 있습니다.
    <script, <style 또는 <meta 태그등을 이용하실 수 있습니다"; - - $lang->grant_access = "Access"; - $lang->grant_manager = "Management"; - - $lang->grant_to_all = "All users"; - $lang->grant_to_login_user = "Logged users"; - $lang->grant_to_site_user = "Joined users"; - $lang->grant_to_group = "Specification group users"; - - $lang->cmd_add_shortcut = "Добавить ярлык"; - $lang->cmd_install = "Установить"; - $lang->cmd_update = "Обновить"; - $lang->cmd_manage_category = 'Управление категориями'; - $lang->cmd_manage_grant = 'Управление правами доступа'; - $lang->cmd_manage_skin = 'Управление скинами'; - $lang->cmd_manage_document = 'Управление статьями'; - $lang->cmd_find_module = 'Искать модуль'; - $lang->cmd_find_langcode = 'Find lang code'; - - $lang->msg_new_module = "Создать новый модуль"; - $lang->msg_update_module = "Изменить модуль"; - $lang->msg_module_name_exists = "Имя уже существует. Пожалуйста, попробуйте другое"; - $lang->msg_category_is_null = 'Зарегистрированной категории не существует.'; - $lang->msg_grant_is_null = 'Списка для управления правами доступа не существует.'; - $lang->msg_no_checked_document = 'Нет выбранных статей.'; // translator's note: выше... - $lang->msg_move_failed = 'Невозможно переместить'; - $lang->msg_cannot_delete_for_child = 'Невозможно удалить категорию, имеющую дочерние категории.'; - $lang->msg_limit_mid ='모듈이름은 영문+[영문+숫자+_] 만 가능합니다.'; - $lang->msg_extra_name_exists = '이미 존재하는 확장변수 이름입니다. 다른 이름을 입력해주세요.'; - - $lang->about_browser_title = "Это будет показано в заголовке браузера. Также, это будет использоваться в RSS/Трекбеке."; - $lang->about_mid = "Имя модуля будет использовано как http://address/?mid=Имя_модуля.\n(только латиница, цифры и символ подчеркивания(_) разрешены. The maximum length is 40.)"; - $lang->about_default = "Если выбрано, модуль будет главным на сайте. Для доступа не нужен будет идентификатор модуля."; - $lang->about_module_category = "Это позволяет Вам управлять посредством категорий модулей.\nURL для менеджера модулей Manage module > Категория Модуля ."; - $lang->about_description= 'Это описание только для менеджера.'; - $lang->about_default = 'Если выбрано, этот модуль будет показан, когда пользователи входят на сайт без идентификатора модуля (mid=NoValue).'; - $lang->about_header_text = 'Это содержимое будет показано сверху модуля. (HTML разрешен)'; - $lang->about_footer_text = 'Это содержимое будет показано снизу модуля. (HTML разрешен)'; - $lang->about_skin = 'Вы можете выбрать скин модуля.'; - $lang->about_use_category = 'Если выбрано, функция категорий будет включена.'; - $lang->about_list_count = 'Вы можете установить лимит показа статей на страницу. (по умолчанию: 20)'; - $lang->about_search_list_count = '검색 또는 카테고리 선택등을 할 경우 표시될 글의 수를 지정하실 수 있습니다. 기본(20개)'; - $lang->about_page_count = 'Вы можете установить число страниц внизу. (по умолчанию: 10)'; - $lang->about_admin_id = 'Вы можете разрешить менеджеру иметь полные права доступа к этому модулю.\nВы можете ввести несколько ID, используя '; - $lang->about_grant = 'Если Вы отключите все права доступа для отдельного объекта, не прошедшие процедуру входа на сайт пользователи получат доступ.'; - $lang->about_grant_deatil = '가입한 사용자는 cafeXE등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다'; - $lang->about_module = "XE состоит из модулей, за исключением базовой библиотеки.\n Управление модулем покажет все установленные модули и поможет управлять ими."; - - $lang->about_extra_vars_default_value = 'Если нужно несколько значений по умолчанию, разделите их запятыми(,).'; - $lang->about_search_virtual_site = "가상 사이트(카페XE등)의 도메인을 입력하신 후 검색하세요.
    가상 사이트이외의 모듈은 내용을 비우고 검색하시면 됩니다. (http:// 는 제외)"; - $lang->about_langcode = "언어별로 다르게 설정하고 싶으시면 언어코드 찾기를 이용해주세요"; - $lang->about_file_extension= "%s 파일만 가능합니다."; -?> +virtual_site = "Virtual Site"; + $lang->module_list = "Список модулей"; + $lang->module_index = "Список модулей"; + $lang->module_category = "Категория модуля"; + $lang->module_info = "Информация"; + $lang->add_shortcut = "Добавить ярлыки"; + $lang->module_action = "Действия"; + $lang->module_maker = "Разработчик модуля"; + $lang->module_license = 'Лицензия'; + $lang->module_history = "История обновлений"; + $lang->category_title = "Название категории"; + $lang->header_text = 'Верхний колонтитул'; + $lang->footer_text = 'Нижний колонтитул'; + $lang->use_category = 'Включить категорию'; + $lang->category_title = 'Название категории'; + $lang->checked_count = 'Число выбранных статей'; // translator's note: возможно "checked" следует перевести как "проверенных" + $lang->skin_default_info = 'Информация стандартного скина'; + $lang->skin_author = 'Разработчик скина'; + $lang->skin_license = 'License'; + $lang->skin_history = 'История обновлений'; + $lang->module_selector = "Module Selector"; + $lang->do_selected = "Выбранные..."; + $lang->bundle_setup = "일괄 기본 설정"; + $lang->bundle_addition_setup = "일괄 추가 설정"; + $lang->bundle_grant_setup = "일괄 권한 설정"; + $lang->lang_code = "Код языка"; + $lang->filebox = "Файлбокс"; + + $lang->access_type = 'Способ соединения'; + $lang->access_domain = 'Domain соединения'; + $lang->access_vid = 'Site ID соединение'; + $lang->about_vid = '별도의 도메인이 아닌 http://XE주소/ID 로 접속할 수 있습니다. 모듈명(mid)와 중복될 수 없습니다.
    첫글자는 영문으로 시작해야 하고 영문과 숫자 그리고 _ 만 사용할 수 있습니다'; + $lang->msg_already_registed_vid = '이미 등록된 사이트 ID 입니다. 게시판등의 mid와도 중복이 되지 않습니다. 다른 ID를 입력해주세요.'; + $lang->msg_already_registed_domain = '이미 등록된 도메인입니다. 다른 도메인을 사용해주세요'; + + $lang->module_copy = "Копировать модуль"; + + $lang->header_script = "Скрипт Header"; + $lang->about_header_script = "html의 <header>와 </header> 사이에 들어가는 코드를 직접 입력할 수 있습니다.
    <script, <style 또는 <meta 태그등을 이용하실 수 있습니다"; + + $lang->grant_access = "Access"; + $lang->grant_manager = "Management"; + + $lang->grant_to_all = "All users"; + $lang->grant_to_login_user = "Logged users"; + $lang->grant_to_site_user = "Joined users"; + $lang->grant_to_group = "Specification group users"; + + $lang->cmd_add_shortcut = "Добавить ярлык"; + $lang->cmd_install = "Установить"; + $lang->cmd_update = "Обновить"; + $lang->cmd_manage_category = 'Управление категориями'; + $lang->cmd_manage_grant = 'Управление правами доступа'; + $lang->cmd_manage_skin = 'Управление скинами'; + $lang->cmd_manage_document = 'Управление статьями'; + $lang->cmd_find_module = 'Искать модуль'; + $lang->cmd_find_langcode = 'Find lang code'; + + $lang->msg_new_module = "Создать новый модуль"; + $lang->msg_update_module = "Изменить модуль"; + $lang->msg_module_name_exists = "Имя уже существует. Пожалуйста, попробуйте другое"; + $lang->msg_category_is_null = 'Зарегистрированной категории не существует.'; + $lang->msg_grant_is_null = 'Списка для управления правами доступа не существует.'; + $lang->msg_no_checked_document = 'Нет выбранных статей.'; // translator's note: выше... + $lang->msg_move_failed = 'Невозможно переместить'; + $lang->msg_cannot_delete_for_child = 'Невозможно удалить категорию, имеющую дочерние категории.'; + $lang->msg_limit_mid ='모듈이름은 영문+[영문+숫자+_] 만 가능합니다.'; + $lang->msg_extra_name_exists = '이미 존재하는 확장변수 이름입니다. 다른 이름을 입력해주세요.'; + + $lang->about_browser_title = "Это будет показано в заголовке браузера. Также, это будет использоваться в RSS/Трекбеке."; + $lang->about_mid = "Имя модуля будет использовано как http://address/?mid=Имя_модуля.\n(только латиница, цифры и символ подчеркивания(_) разрешены. The maximum length is 40.)"; + $lang->about_default = "Если выбрано, модуль будет главным на сайте. Для доступа не нужен будет идентификатор модуля."; + $lang->about_module_category = "Это позволяет Вам управлять посредством категорий модулей.\nURL для менеджера модулей Manage module > Категория Модуля ."; + $lang->about_description= 'Это описание только для менеджера.'; + $lang->about_default = 'Если выбрано, этот модуль будет показан, когда пользователи входят на сайт без идентификатора модуля (mid=NoValue).'; + $lang->about_header_text = 'Это содержимое будет показано сверху модуля. (HTML разрешен)'; + $lang->about_footer_text = 'Это содержимое будет показано снизу модуля. (HTML разрешен)'; + $lang->about_skin = 'Вы можете выбрать скин модуля.'; + $lang->about_use_category = 'Если выбрано, функция категорий будет включена.'; + $lang->about_list_count = 'Вы можете установить лимит показа статей на страницу. (по умолчанию: 20)'; + $lang->about_search_list_count = '검색 또는 카테고리 선택등을 할 경우 표시될 글의 수를 지정하실 수 있습니다. 기본(20개)'; + $lang->about_page_count = 'Вы можете установить число страниц внизу. (по умолчанию: 10)'; + $lang->about_admin_id = 'Вы можете разрешить менеджеру иметь полные права доступа к этому модулю.\nВы можете ввести несколько ID, используя '; + $lang->about_grant = 'Если Вы отключите все права доступа для отдельного объекта, не прошедшие процедуру входа на сайт пользователи получат доступ.'; + $lang->about_grant_deatil = '가입한 사용자는 cafeXE등 분양형 가상 사이트에 가입을 한 로그인 사용자를 의미합니다'; + $lang->about_module = "XE состоит из модулей, за исключением базовой библиотеки.\n Управление модулем покажет все установленные модули и поможет управлять ими."; + + $lang->about_extra_vars_default_value = 'Если нужно несколько значений по умолчанию, разделите их запятыми(,).'; + $lang->about_search_virtual_site = "가상 사이트(카페XE등)의 도메인을 입력하신 후 검색하세요.
    가상 사이트이외의 모듈은 내용을 비우고 검색하시면 됩니다. (http:// 는 제외)"; + $lang->about_langcode = "언어별로 다르게 설정하고 싶으시면 언어코드 찾기를 이용해주세요"; + $lang->about_file_extension= "%s 파일만 가능합니다."; +?> diff --git a/modules/module/lang/tr.lang.php b/modules/module/lang/tr.lang.php index fb8feb763..fea76234b 100644 --- a/modules/module/lang/tr.lang.php +++ b/modules/module/lang/tr.lang.php @@ -1,99 +1,99 @@ -virtual_site = "Sanal Siteler"; - $lang->module_list = "Modül Listesi"; - $lang->module_index = "Modül Listesi"; - $lang->module_category = "Modül Kategorisi"; - $lang->module_info = "Modül Bilgisi"; - $lang->add_shortcut = "Kısayol Ekle"; - $lang->module_action = "Eylemler"; - $lang->module_maker = "Modül Geliştirici"; - $lang->module_license = 'Lisans'; - $lang->module_history = "Güncelleştirme Geçmişi"; - $lang->category_title = "Kategori Başlığı"; - $lang->header_text = 'Başlık Metni'; - $lang->footer_text = 'Sayfa Altlığı Metni'; - $lang->use_category = 'Kategoriyi Etkinleştir'; - $lang->category_title = 'Kategori Başlığı'; - $lang->checked_count = 'Denetlenen Makale Sayısı'; - $lang->skin_default_info = 'Varsayılan Dış Görünüm Bilgisi'; - $lang->skin_author = 'Dış Görünüm Geliştiricisi'; - $lang->skin_license = 'Lisans'; - $lang->skin_history = 'Güncelleştirme Geçmişi'; - $lang->module_copy = "Çoğaltma Modülü"; - $lang->module_selector = "Modül Seçini"; - $lang->do_selected = "Şunu yap"; - $lang->bundle_setup = "Toplu Ayar"; - $lang->bundle_addition_setup = "Toplu Ek Ayar"; - $lang->bundle_grant_setup = "Toplu Yetki Ayarı"; - $lang->lang_code = "Dil Kodu"; - $lang->filebox = "Dosya Kutusu"; - - $lang->access_type = 'Erişim Türü'; - $lang->access_domain = 'Alan adıyla'; - $lang->access_vid = 'Site kimliğiyle'; - $lang->about_domain = "Birden fazla sanal website oluşturabilmek için, her birinin kendi alanadına ihtiyacı vardır.
    Alt-alanadı (örn., aaa.bbb.com of bbb.com) da kullanılabilir. XE'nin de içinde kurulu olduğu yolun adresini giriniz.
    örn.) www.xpressengine.com/xe"; - $lang->about_vid = 'Kullanıcılar, http://XEaddress/ID adresiyle ulaşabilirler. Varolan bir modül adıyla(mid) aynı olan site kimliği kullanamazsınız .
    Site kimliği bir harfle başlamaladır . Alfabetik karakterler, sayılar ve _ işareti site kimliği için kullanılabilir.'; - $lang->msg_already_registed_vid = 'Önceden kaydedilmiş site kimliği. Lütfen başka bir kimlik giriniz.'; - $lang->msg_already_registed_domain = "Bu alanadı önceden kullanıldı. Lütfen farklı bir alanadı giriniz."; - - $lang->header_script = "Başlık Betiği(script)"; - $lang->about_header_script = "Html betiğini(script) <header> ile </header> arasına kendiniz ekleyebilirsiniz.
    <script, <style or <meta tag kullanabilirsiniz"; - - $lang->grant_access = "Yetki"; - $lang->grant_manager = "Yönetim"; - - $lang->grant_to_all = "Tüm kullanıcılar"; - $lang->grant_to_login_user = "Oturum açmış kullanıcılar"; - $lang->grant_to_site_user = "Kayıtlı kullanıcılar"; - $lang->grant_to_group = "Belirli grup kullanıcıları"; - - $lang->cmd_add_shortcut = "Kısayol Ekle"; - $lang->cmd_install = "Kur"; - $lang->cmd_update = "Güncelleştir"; - $lang->cmd_manage_category = 'Kategorileri Yönet'; - $lang->cmd_manage_grant = 'Yetkileri Yönet'; - $lang->cmd_manage_skin = 'Dış Görünümleri Yönet'; - $lang->cmd_manage_document = 'Makaleleri Yönet'; - $lang->cmd_find_module = 'Modül Bul'; - $lang->cmd_find_langcode = 'Dil kodu bul'; - - $lang->msg_new_module = "Yeni modül oluştur"; - $lang->msg_update_module = "Modül Düzelt"; - $lang->msg_module_name_exists = "Bu isim önceden zaten alınmış. Lütfen başka bir tane deneyiniz."; - $lang->msg_category_is_null = 'Kayıtlı kategori yok.'; - $lang->msg_grant_is_null = 'Yetki listesi yok.'; - $lang->msg_no_checked_document = 'Denetlenmiş makaleler bulunmamakta.'; - $lang->msg_move_failed = 'Taşıma hatası'; - $lang->msg_cannot_delete_for_child = 'Alt kategorileri olan kategoriler silinemez.'; - $lang->msg_limit_mid ="Sadece harfler+[harfler+sayılar+_] modül ismi olarak kullanılabilir."; - $lang->msg_extra_name_exists = 'Önceden kayıtlı değişken isim. Lütfen başka bir tane giriniz.'; - - $lang->about_browser_title = "Bu girdi tarayıcı başlığında gösterilecektir. Aynı zamanda RSS/Geri İzleme(trackback)\'de de kullanılacaktır."; - $lang->about_mid = "Modül ismi, http://adres/?mid=Modulismi şeklinde kullanılacaktır.\n(Sadece ingilizce harflere + [ingilizce harflere, sayılara, ve altçizgiye (_)] izin verilmiştir. Azami uzunluk 40 karakterdir.)"; - $lang->about_default = "İşaretlenmişse, modül kimlik değeri(mid=Değer Yok) olmadan siteye erişirken varsayılan kullanılacaktır."; - $lang->about_module_category = "Size, modül kategorisi yoluyla yönetme imkanı sunar.\n Modül Yöneticisi için URL: Manage module > Modül Kategorisidir."; - $lang->about_description= 'Sadece yöneticilerin görebileceği açıklamadır.'; - $lang->about_default = 'Eğer işaretlenmişse, kullanıcılar siteye modül kimlik değeri (mid=değer yok) olmadan erişirken bu modül görüntülenecektir .'; - $lang->about_header_text = 'Modülün üst kısmında gösterilecek içeriklerdir.(html etiketleri etkin)'; - $lang->about_footer_text = 'Modülün alt kısmında gösterilecek içeriklerdir.(html etiketleri etkin)'; - $lang->about_skin = 'Modül dış görünümünü seçebilirsiniz.'; - $lang->about_use_category = 'İşaretlediğiniz taktirde, kategori özelliği etkinleştirilecektir.'; - $lang->about_list_count = 'Sayfada gösterilecek makalelerin sayı üstsınırını ayarlayabilirsiniz.(varsayılan : 20)'; - $lang->about_search_list_count = 'Kategori veya arama özelliğini kullanırken gösterilecek makalelerin sayısını ayarlayabilirsiniz. (varsayılan : 20)'; - $lang->about_page_count = 'Sayfanın alt kısmında sayfa geçiş linklerinin sayısını ayarlayabilirsiniz.(varsayılan : 10)'; - $lang->about_admin_id = 'Modüle tam yetkisi olan bir yönetici atayabilirsiniz.'; - $lang->about_grant = 'Belirli bir nesne için tüm yetkileri kapatırsanız, siteye üye girişi yapmamış üyeler yetki sahibi olacaklardır.'; - $lang->about_grant_deatil = 'Kayıtlı kullanıcı, sanal sitelere (örn., cafeXE) kayıt olmuş kullanıcı demektir .'; - $lang->about_module = "XE, temel kitaplık dışında, modüllerden oluşmaktadır.\n [Modül Yönetimi] modülü, size kurulu tüm modülleri gösterecek ve onları yönetmenize yardımcı olacaktır."; - - $lang->about_extra_vars_default_value = 'Eğer çoklu varsayılan değerler gerekiyorsa, onları virgülle(,) köprüleyebilirsiniz.'; - $lang->about_search_virtual_site = "Sanal sitelerin alanadlarını giriniz.
    Sanal olmayan sitelerin modüllerini aramak için, boş arama yapınız"; - $lang->about_langcode = "Eğer tek tek yapılandırma yapmak istiyorsanız, 'dil kodu bul'\' u kullanınız."; - $lang->about_file_extension= "Yalnızca %s uzantı(ları) mevucut."; -?> +virtual_site = "Sanal Siteler"; + $lang->module_list = "Modül Listesi"; + $lang->module_index = "Modül Listesi"; + $lang->module_category = "Modül Kategorisi"; + $lang->module_info = "Modül Bilgisi"; + $lang->add_shortcut = "Kısayol Ekle"; + $lang->module_action = "Eylemler"; + $lang->module_maker = "Modül Geliştirici"; + $lang->module_license = 'Lisans'; + $lang->module_history = "Güncelleştirme Geçmişi"; + $lang->category_title = "Kategori Başlığı"; + $lang->header_text = 'Başlık Metni'; + $lang->footer_text = 'Sayfa Altlığı Metni'; + $lang->use_category = 'Kategoriyi Etkinleştir'; + $lang->category_title = 'Kategori Başlığı'; + $lang->checked_count = 'Denetlenen Makale Sayısı'; + $lang->skin_default_info = 'Varsayılan Dış Görünüm Bilgisi'; + $lang->skin_author = 'Dış Görünüm Geliştiricisi'; + $lang->skin_license = 'Lisans'; + $lang->skin_history = 'Güncelleştirme Geçmişi'; + $lang->module_copy = "Çoğaltma Modülü"; + $lang->module_selector = "Modül Seçini"; + $lang->do_selected = "Şunu yap"; + $lang->bundle_setup = "Toplu Ayar"; + $lang->bundle_addition_setup = "Toplu Ek Ayar"; + $lang->bundle_grant_setup = "Toplu Yetki Ayarı"; + $lang->lang_code = "Dil Kodu"; + $lang->filebox = "Dosya Kutusu"; + + $lang->access_type = 'Erişim Türü'; + $lang->access_domain = 'Alan adıyla'; + $lang->access_vid = 'Site kimliğiyle'; + $lang->about_domain = "Birden fazla sanal website oluşturabilmek için, her birinin kendi alanadına ihtiyacı vardır.
    Alt-alanadı (örn., aaa.bbb.com of bbb.com) da kullanılabilir. XE'nin de içinde kurulu olduğu yolun adresini giriniz.
    örn.) www.xpressengine.com/xe"; + $lang->about_vid = 'Kullanıcılar, http://XEaddress/ID adresiyle ulaşabilirler. Varolan bir modül adıyla(mid) aynı olan site kimliği kullanamazsınız .
    Site kimliği bir harfle başlamaladır . Alfabetik karakterler, sayılar ve _ işareti site kimliği için kullanılabilir.'; + $lang->msg_already_registed_vid = 'Önceden kaydedilmiş site kimliği. Lütfen başka bir kimlik giriniz.'; + $lang->msg_already_registed_domain = "Bu alanadı önceden kullanıldı. Lütfen farklı bir alanadı giriniz."; + + $lang->header_script = "Başlık Betiği(script)"; + $lang->about_header_script = "Html betiğini(script) <header> ile </header> arasına kendiniz ekleyebilirsiniz.
    <script, <style or <meta tag kullanabilirsiniz"; + + $lang->grant_access = "Yetki"; + $lang->grant_manager = "Yönetim"; + + $lang->grant_to_all = "Tüm kullanıcılar"; + $lang->grant_to_login_user = "Oturum açmış kullanıcılar"; + $lang->grant_to_site_user = "Kayıtlı kullanıcılar"; + $lang->grant_to_group = "Belirli grup kullanıcıları"; + + $lang->cmd_add_shortcut = "Kısayol Ekle"; + $lang->cmd_install = "Kur"; + $lang->cmd_update = "Güncelleştir"; + $lang->cmd_manage_category = 'Kategorileri Yönet'; + $lang->cmd_manage_grant = 'Yetkileri Yönet'; + $lang->cmd_manage_skin = 'Dış Görünümleri Yönet'; + $lang->cmd_manage_document = 'Makaleleri Yönet'; + $lang->cmd_find_module = 'Modül Bul'; + $lang->cmd_find_langcode = 'Dil kodu bul'; + + $lang->msg_new_module = "Yeni modül oluştur"; + $lang->msg_update_module = "Modül Düzelt"; + $lang->msg_module_name_exists = "Bu isim önceden zaten alınmış. Lütfen başka bir tane deneyiniz."; + $lang->msg_category_is_null = 'Kayıtlı kategori yok.'; + $lang->msg_grant_is_null = 'Yetki listesi yok.'; + $lang->msg_no_checked_document = 'Denetlenmiş makaleler bulunmamakta.'; + $lang->msg_move_failed = 'Taşıma hatası'; + $lang->msg_cannot_delete_for_child = 'Alt kategorileri olan kategoriler silinemez.'; + $lang->msg_limit_mid ="Sadece harfler+[harfler+sayılar+_] modül ismi olarak kullanılabilir."; + $lang->msg_extra_name_exists = 'Önceden kayıtlı değişken isim. Lütfen başka bir tane giriniz.'; + + $lang->about_browser_title = "Bu girdi tarayıcı başlığında gösterilecektir. Aynı zamanda RSS/Geri İzleme(trackback)\'de de kullanılacaktır."; + $lang->about_mid = "Modül ismi, http://adres/?mid=Modulismi şeklinde kullanılacaktır.\n(Sadece ingilizce harflere + [ingilizce harflere, sayılara, ve altçizgiye (_)] izin verilmiştir. Azami uzunluk 40 karakterdir.)"; + $lang->about_default = "İşaretlenmişse, modül kimlik değeri(mid=Değer Yok) olmadan siteye erişirken varsayılan kullanılacaktır."; + $lang->about_module_category = "Size, modül kategorisi yoluyla yönetme imkanı sunar.\n Modül Yöneticisi için URL: Manage module > Modül Kategorisidir."; + $lang->about_description= 'Sadece yöneticilerin görebileceği açıklamadır.'; + $lang->about_default = 'Eğer işaretlenmişse, kullanıcılar siteye modül kimlik değeri (mid=değer yok) olmadan erişirken bu modül görüntülenecektir .'; + $lang->about_header_text = 'Modülün üst kısmında gösterilecek içeriklerdir.(html etiketleri etkin)'; + $lang->about_footer_text = 'Modülün alt kısmında gösterilecek içeriklerdir.(html etiketleri etkin)'; + $lang->about_skin = 'Modül dış görünümünü seçebilirsiniz.'; + $lang->about_use_category = 'İşaretlediğiniz taktirde, kategori özelliği etkinleştirilecektir.'; + $lang->about_list_count = 'Sayfada gösterilecek makalelerin sayı üstsınırını ayarlayabilirsiniz.(varsayılan : 20)'; + $lang->about_search_list_count = 'Kategori veya arama özelliğini kullanırken gösterilecek makalelerin sayısını ayarlayabilirsiniz. (varsayılan : 20)'; + $lang->about_page_count = 'Sayfanın alt kısmında sayfa geçiş linklerinin sayısını ayarlayabilirsiniz.(varsayılan : 10)'; + $lang->about_admin_id = 'Modüle tam yetkisi olan bir yönetici atayabilirsiniz.'; + $lang->about_grant = 'Belirli bir nesne için tüm yetkileri kapatırsanız, siteye üye girişi yapmamış üyeler yetki sahibi olacaklardır.'; + $lang->about_grant_deatil = 'Kayıtlı kullanıcı, sanal sitelere (örn., cafeXE) kayıt olmuş kullanıcı demektir .'; + $lang->about_module = "XE, temel kitaplık dışında, modüllerden oluşmaktadır.\n [Modül Yönetimi] modülü, size kurulu tüm modülleri gösterecek ve onları yönetmenize yardımcı olacaktır."; + + $lang->about_extra_vars_default_value = 'Eğer çoklu varsayılan değerler gerekiyorsa, onları virgülle(,) köprüleyebilirsiniz.'; + $lang->about_search_virtual_site = "Sanal sitelerin alanadlarını giriniz.
    Sanal olmayan sitelerin modüllerini aramak için, boş arama yapınız"; + $lang->about_langcode = "Eğer tek tek yapılandırma yapmak istiyorsanız, 'dil kodu bul'\' u kullanınız."; + $lang->about_file_extension= "Yalnızca %s uzantı(ları) mevucut."; +?> diff --git a/modules/module/lang/vi.lang.php b/modules/module/lang/vi.lang.php index f002f6473..bb25fd178 100644 --- a/modules/module/lang/vi.lang.php +++ b/modules/module/lang/vi.lang.php @@ -1,101 +1,101 @@ -virtual_site = "Site thực"; - $lang->module_list = "Danh sách Module"; - $lang->module_index = "Danh sách Module"; - $lang->module_category = "Thể loại"; - $lang->module_info = "Thông tin Module"; - $lang->add_shortcut = "Thêm phím tắt"; - $lang->module_action = "Hoạt động"; - $lang->module_maker = "Người thiết kế"; - $lang->module_license = 'Giấy phép'; - $lang->module_history = "Lịch sử cập nhật"; - $lang->category_title = "Tiêu đề phân loại"; - $lang->header_text = 'Nội dung Header'; - $lang->footer_text = 'Nội dung Footer'; - $lang->use_category = 'Mở phân loại'; - $lang->category_title = 'Tiêu đề phân loại'; - $lang->checked_count = 'Số bài viết đã chọn'; - $lang->skin_default_info = 'Thông tin Skin mặc định'; - $lang->skin_author = 'Thiết kế'; - $lang->skin_license = 'Giấy phép'; - $lang->skin_history = 'Lịch sử cập nhật'; - $lang->module_copy = "Nhân bản Module"; - $lang->module_selector = "Chọn lọc Module"; - $lang->do_selected = "Bình chọn / Phê bình."; - $lang->bundle_setup = "Gói cài đặt"; - $lang->bundle_addition_setup = "Gói cài đặt bổ xung"; - $lang->bundle_grant_setup = "Gói cài đặt cho phép"; - $lang->lang_code = "Mã ngôn ngữ"; - $lang->filebox = "FileBox"; - - $lang->access_type = 'Kiểu truy cập'; - $lang->access_domain = 'Với tên miền'; - $lang->access_vid = 'Với ID Website'; - $lang->about_domain = "Để tạo nhiều Website nhỏ, các Website nhỏ này cần những tên miền riêng của mình.
    Có thể sử dụng những Subdomain dạng aaa.bbb.com của bbb.com. Hãy nhập địa chỉ bao gồm cả Domain cài đặt XE.
    Ví dụ: www.vietxe.net/xe"; - $lang->about_vid = 'Người sử dụng có thể truy cập qua http://XEaddress/ID. Bạn không thể sử dụng ID giống nhau và giống tên Module đã có.
    Teen ID có dạng là các chữ cái, số và dấu gạch dưới (_).'; - $lang->msg_already_registed_vid = 'Tên ID này đã được đăng kí. Xin hãy chọn tên khác.'; - $lang->msg_already_registed_domain = "Tên miền đã được sử dụng. Xin hãy chọn tên khác."; - - $lang->header_script = "Header Script"; - $lang->about_header_script = "Bạn co thể nhập mã dang HTML vào giữa <header> và </header>.
    Bạn có thể sử dụng <script, <style hay <meta tag"; - - $lang->grant_access = "Truy cập"; - $lang->grant_manager = "Quản lý"; - - $lang->grant_to_all = "Tất cả"; - $lang->grant_to_login_user = "Đã đăng nhập"; - $lang->grant_to_site_user = "Đã đăng kí"; - $lang->grant_to_group = "Nhóm chỉ định"; - - $lang->cmd_add_shortcut = "Thêm phím tắt"; - $lang->cmd_install = "Cài đặt"; - $lang->cmd_update = "Cập nhật"; - $lang->cmd_manage_category = 'Quản lý thể loại'; - $lang->cmd_manage_grant = 'Quản lý quyền'; - $lang->cmd_manage_skin = 'Quản lý Skin'; - $lang->cmd_manage_document = 'Quản lý bài viết'; - $lang->cmd_find_module = 'Tìm Module'; - $lang->cmd_find_langcode = 'Tìm mã ngôn ngữ'; - - $lang->msg_new_module = "Tạo Module mới"; - $lang->msg_update_module = "Sửa Module"; - $lang->msg_module_name_exists = "Tên này đã được sử dụng. Hãy thử lại với tên khác."; - $lang->msg_category_is_null = 'Không có phân loại nào được tạo.'; - $lang->msg_grant_is_null = 'Không có danh sách quyền nào.'; - $lang->msg_no_checked_document = 'Không có bài viết nào được kiểm tra.'; - $lang->msg_move_failed = 'Không thể di chuyển'; - $lang->msg_cannot_delete_for_child = 'Không thể xóa được phân loại khi có những phân loại con.'; - $lang->msg_limit_mid ="Tên Module chỉ hỗ trợ định dạng [Kí tự], [Kí tự+Số], [Kí tự+Số+_]."; - $lang->msg_extra_name_exists = 'Tên biến đã được sử dụng. Xin hãy chọn tên khác.'; - - $lang->about_browser_title = "Nó sẽ hiển thị trên tiêu đề của trình duyệt và trong RSS/Trackback."; - $lang->about_mid = "Tên Module được sử dụng dạng http://address/?mid=ModuleName.\n(Chỉ cho phép chữ cái tiếng Anh + [chữ cái tiếng Anh, số, và dấu gạch dưới (_)] và tối đa 40 kí tự.)"; - $lang->about_default = "Nếu chọn, Sẽ hiển thị mặc định là (mid=NoValue) khi truy cập tên Module không đúng."; - $lang->about_module_category = "Nó cho phép bạn quản lý thông qua Module thể loại.\n URL quản lý có dạng Quản lý Module > Module thể loại ."; - $lang->about_description= 'Mô tả cho một quản lý.'; - $lang->about_default = 'Nếu chọn, Sẽ hiển thị mặc định là (mid=NoValue) khi truy cập tên Module không đúng.'; - $lang->about_header_text = 'Nội dung sẽ hiển thị trên đầu Module.(sau http tag có sẵn)'; - $lang->about_footer_text = 'Nội dung sẽ hiển thị phía dưới Module.(trước http tag có sẵn)'; - $lang->about_skin = 'Banj có thể chọn Skin cho Module.'; - $lang->about_use_category = 'Nếu chon, chức năng thể loại sẽ hoạt động.'; - $lang->about_list_count = 'Bạn có thể giới hạn bài viết hiển thị trên một trang.(Mặc định là 20)'; - $lang->about_search_list_count = 'Bạn có thể đặt giới hạn số bài viết sẽ hiển thị khi tìm kiếm hay chọn thể loại. (Mặc định là 20)'; - $lang->about_page_count = 'bạn có thể giới hạn số trang liên kết hiển thị phía dưới.(Mặc định là 10)'; - $lang->about_admin_id = 'Bạn có thể đặt quyền hạn cho người sử dụng khi truy cập tới Module.'; - $lang->about_grant = 'Nếu bạn khóa tất cả quyền hạn cho một thành viên đặc biệt nào đó, những thành viên đó sẽ không được phép đăng nhập.'; - $lang->about_grant_deatil = 'Khi thành viên dăng kí tại trang chủ, nghĩa là họ cũng là thành viên của những trang khác (Ví dụ: cafeXE,...).'; - $lang->about_module = "Khu vực Module trong XE ngoại trừ Library là tại [Module Manage]. Tất cả những Module đang có sẽ hiển thị, giúp bạn quản lý một cách dễ dàng."; - - $lang->about_extra_vars_default_value = 'Nếu cần nhiều giá trị mặc định, bạn có thể thêm dấu (,) và giữa các kết nối.'; - $lang->about_search_virtual_site = "Hãy nhập tên miền thực tế của Website.
    Để tìm kiếm những Module không thực tế của Website hãy để trống."; - $lang->about_langcode = "Nếu bạn muốn sử dụng định hình riêng, hãy sử dụng 'Tìm kiếm mã ngôn ngữ'"; - $lang->about_file_extension= "Chỉ cho phép những phần mở rộng là: %s."; -?> +virtual_site = "Site thực"; + $lang->module_list = "Danh sách Module"; + $lang->module_index = "Danh sách Module"; + $lang->module_category = "Thể loại"; + $lang->module_info = "Thông tin Module"; + $lang->add_shortcut = "Thêm phím tắt"; + $lang->module_action = "Hoạt động"; + $lang->module_maker = "Người thiết kế"; + $lang->module_license = 'Giấy phép'; + $lang->module_history = "Lịch sử cập nhật"; + $lang->category_title = "Tiêu đề phân loại"; + $lang->header_text = 'Nội dung Header'; + $lang->footer_text = 'Nội dung Footer'; + $lang->use_category = 'Mở phân loại'; + $lang->category_title = 'Tiêu đề phân loại'; + $lang->checked_count = 'Số bài viết đã chọn'; + $lang->skin_default_info = 'Thông tin Skin mặc định'; + $lang->skin_author = 'Thiết kế'; + $lang->skin_license = 'Giấy phép'; + $lang->skin_history = 'Lịch sử cập nhật'; + $lang->module_copy = "Nhân bản Module"; + $lang->module_selector = "Chọn lọc Module"; + $lang->do_selected = "Bình chọn / Phê bình."; + $lang->bundle_setup = "Gói cài đặt"; + $lang->bundle_addition_setup = "Gói cài đặt bổ xung"; + $lang->bundle_grant_setup = "Gói cài đặt cho phép"; + $lang->lang_code = "Mã ngôn ngữ"; + $lang->filebox = "FileBox"; + + $lang->access_type = 'Kiểu truy cập'; + $lang->access_domain = 'Với tên miền'; + $lang->access_vid = 'Với ID Website'; + $lang->about_domain = "Để tạo nhiều Website nhỏ, các Website nhỏ này cần những tên miền riêng của mình.
    Có thể sử dụng những Subdomain dạng aaa.bbb.com của bbb.com. Hãy nhập địa chỉ bao gồm cả Domain cài đặt XE.
    Ví dụ: www.vietxe.net/xe"; + $lang->about_vid = 'Người sử dụng có thể truy cập qua http://XEaddress/ID. Bạn không thể sử dụng ID giống nhau và giống tên Module đã có.
    Teen ID có dạng là các chữ cái, số và dấu gạch dưới (_).'; + $lang->msg_already_registed_vid = 'Tên ID này đã được đăng kí. Xin hãy chọn tên khác.'; + $lang->msg_already_registed_domain = "Tên miền đã được sử dụng. Xin hãy chọn tên khác."; + + $lang->header_script = "Header Script"; + $lang->about_header_script = "Bạn co thể nhập mã dang HTML vào giữa <header> và </header>.
    Bạn có thể sử dụng <script, <style hay <meta tag"; + + $lang->grant_access = "Truy cập"; + $lang->grant_manager = "Quản lý"; + + $lang->grant_to_all = "Tất cả"; + $lang->grant_to_login_user = "Đã đăng nhập"; + $lang->grant_to_site_user = "Đã đăng kí"; + $lang->grant_to_group = "Nhóm chỉ định"; + + $lang->cmd_add_shortcut = "Thêm phím tắt"; + $lang->cmd_install = "Cài đặt"; + $lang->cmd_update = "Cập nhật"; + $lang->cmd_manage_category = 'Quản lý thể loại'; + $lang->cmd_manage_grant = 'Quản lý quyền'; + $lang->cmd_manage_skin = 'Quản lý Skin'; + $lang->cmd_manage_document = 'Quản lý bài viết'; + $lang->cmd_find_module = 'Tìm Module'; + $lang->cmd_find_langcode = 'Tìm mã ngôn ngữ'; + + $lang->msg_new_module = "Tạo Module mới"; + $lang->msg_update_module = "Sửa Module"; + $lang->msg_module_name_exists = "Tên này đã được sử dụng. Hãy thử lại với tên khác."; + $lang->msg_category_is_null = 'Không có phân loại nào được tạo.'; + $lang->msg_grant_is_null = 'Không có danh sách quyền nào.'; + $lang->msg_no_checked_document = 'Không có bài viết nào được kiểm tra.'; + $lang->msg_move_failed = 'Không thể di chuyển'; + $lang->msg_cannot_delete_for_child = 'Không thể xóa được phân loại khi có những phân loại con.'; + $lang->msg_limit_mid ="Tên Module chỉ hỗ trợ định dạng [Kí tự], [Kí tự+Số], [Kí tự+Số+_]."; + $lang->msg_extra_name_exists = 'Tên biến đã được sử dụng. Xin hãy chọn tên khác.'; + + $lang->about_browser_title = "Nó sẽ hiển thị trên tiêu đề của trình duyệt và trong RSS/Trackback."; + $lang->about_mid = "Tên Module được sử dụng dạng http://address/?mid=ModuleName.\n(Chỉ cho phép chữ cái tiếng Anh + [chữ cái tiếng Anh, số, và dấu gạch dưới (_)] và tối đa 40 kí tự.)"; + $lang->about_default = "Nếu chọn, Sẽ hiển thị mặc định là (mid=NoValue) khi truy cập tên Module không đúng."; + $lang->about_module_category = "Nó cho phép bạn quản lý thông qua Module thể loại.\n URL quản lý có dạng Quản lý Module > Module thể loại ."; + $lang->about_description= 'Mô tả cho một quản lý.'; + $lang->about_default = 'Nếu chọn, Sẽ hiển thị mặc định là (mid=NoValue) khi truy cập tên Module không đúng.'; + $lang->about_header_text = 'Nội dung sẽ hiển thị trên đầu Module.(sau http tag có sẵn)'; + $lang->about_footer_text = 'Nội dung sẽ hiển thị phía dưới Module.(trước http tag có sẵn)'; + $lang->about_skin = 'Banj có thể chọn Skin cho Module.'; + $lang->about_use_category = 'Nếu chon, chức năng thể loại sẽ hoạt động.'; + $lang->about_list_count = 'Bạn có thể giới hạn bài viết hiển thị trên một trang.(Mặc định là 20)'; + $lang->about_search_list_count = 'Bạn có thể đặt giới hạn số bài viết sẽ hiển thị khi tìm kiếm hay chọn thể loại. (Mặc định là 20)'; + $lang->about_page_count = 'bạn có thể giới hạn số trang liên kết hiển thị phía dưới.(Mặc định là 10)'; + $lang->about_admin_id = 'Bạn có thể đặt quyền hạn cho người sử dụng khi truy cập tới Module.'; + $lang->about_grant = 'Nếu bạn khóa tất cả quyền hạn cho một thành viên đặc biệt nào đó, những thành viên đó sẽ không được phép đăng nhập.'; + $lang->about_grant_deatil = 'Khi thành viên dăng kí tại trang chủ, nghĩa là họ cũng là thành viên của những trang khác (Ví dụ: cafeXE,...).'; + $lang->about_module = "Khu vực Module trong XE ngoại trừ Library là tại [Module Manage]. Tất cả những Module đang có sẽ hiển thị, giúp bạn quản lý một cách dễ dàng."; + + $lang->about_extra_vars_default_value = 'Nếu cần nhiều giá trị mặc định, bạn có thể thêm dấu (,) và giữa các kết nối.'; + $lang->about_search_virtual_site = "Hãy nhập tên miền thực tế của Website.
    Để tìm kiếm những Module không thực tế của Website hãy để trống."; + $lang->about_langcode = "Nếu bạn muốn sử dụng định hình riêng, hãy sử dụng 'Tìm kiếm mã ngôn ngữ'"; + $lang->about_file_extension= "Chỉ cho phép những phần mở rộng là: %s."; +?> diff --git a/modules/module/lang/zh-CN.lang.php b/modules/module/lang/zh-CN.lang.php index 0a47be86e..afb84b650 100644 --- a/modules/module/lang/zh-CN.lang.php +++ b/modules/module/lang/zh-CN.lang.php @@ -1,99 +1,99 @@ -virtual_site = "站点"; - $lang->module_list = "模块目录"; - $lang->module_index = "模块列表"; - $lang->module_category = "模块分类"; - $lang->module_info = "模块信息"; - $lang->add_shortcut = "添加到快捷菜单"; - $lang->module_action = "动作"; - $lang->module_maker = "模块作者"; - $lang->module_license = '版权'; - $lang->module_history = "更新事项 "; - $lang->category_title = "分类名称"; - $lang->header_text = '头部修饰'; - $lang->footer_text = '尾部修饰'; - $lang->use_category = '使用分类'; - $lang->category_title = '分类名'; - $lang->checked_count = '所选主题数'; - $lang->skin_default_info = '皮肤默认信息'; - $lang->skin_author = '皮肤作者'; - $lang->skin_license = '版权'; - $lang->skin_history = '更新日志'; - $lang->module_copy = "模块复制"; - $lang->module_selector = "模块选择器"; - $lang->do_selected = "把所选模块..."; - $lang->bundle_setup = "批量设置-常规选项"; - $lang->bundle_addition_setup = "批量设置-高级选项"; - $lang->bundle_grant_setup = "批量设置-权限"; - $lang->lang_code = "语言变量"; - $lang->filebox = "文件管理"; - - $lang->access_type = '访问方式'; - $lang->access_domain = '域名'; - $lang->access_vid = '站点ID'; - $lang->about_domain = "要创建一个站点必须有一个专用域名。
    一级域名或二级域名皆可。输入的时候请把XE安装路径也一起输入。
    ex) www.xpressengine.com/xe"; - $lang->about_vid = '直接以http://XE安装地址/ID的方式访问。
    模块名(mid)不能重复。
    模块名要以英文字母开头,且只允许使用英文字母,数字及"_"。'; - $lang->msg_already_registed_vid = '重复的站点ID,请重新输入(注:站点ID不能重复,而且也不能与版面mid重复)。'; - $lang->msg_already_registed_domain = "对不起!已有相同的域名。请重新输入。"; - - $lang->header_script = "文件头部脚本"; - $lang->about_header_script = "可以直接输入插入到html中<head>区的代码。
    可使用<script, <style 或 <meta 等标签。"; - - $lang->grant_access = "访问权限"; - $lang->grant_manager = "管理权限"; - - $lang->grant_to_all = "不限制"; - $lang->grant_to_login_user = "已登录用户"; - $lang->grant_to_site_user = "子站会员"; - $lang->grant_to_group = "特定用户组"; - - $lang->cmd_add_shortcut = "添加到快捷菜单"; - $lang->cmd_install = "安装"; - $lang->cmd_update = "升级"; - $lang->cmd_manage_category = '分类管理'; - $lang->cmd_manage_grant = '权限管理'; - $lang->cmd_manage_skin = '皮肤管理'; - $lang->cmd_manage_document = '主题管理'; - $lang->cmd_find_module = '查找模块'; - $lang->cmd_find_langcode = '选择语言变量'; - - $lang->msg_new_module = "模块生成"; - $lang->msg_update_module = "模块修改"; - $lang->msg_module_name_exists = "已存在的模块名称。请输入其他名称。"; - $lang->msg_category_is_null = '没有登录的分类'; - $lang->msg_grant_is_null = '没有登录的权限对象'; - $lang->msg_no_checked_document = '没有被选择的主题'; - $lang->msg_move_failed = '移动失败!'; - $lang->msg_cannot_delete_for_child = '不能删除有下级分类的分类!'; - $lang->msg_limit_mid ="模块名称只允许英文字母+[英文字母+数字]。"; - $lang->msg_extra_name_exists = '已有的扩展变量名称,请重新输入!'; - - $lang->about_browser_title = "显示在浏览器窗口的标题值。 在RSS/Trackback也可以使用。"; - $lang->about_mid = "模块名称只允许使用英文,数字和下划线(最多不能超过40字节)。"; - $lang->about_default = "用没有mid值的网址访问网站时,将会显示默认。"; - $lang->about_module_category = "可以分类管理模块。 模块分类可以在 模块管理 > 模块分类 中进行管理。"; - $lang->about_description= '管理用使用说明。'; - $lang->about_default = '用没有mid值的网址访问网站时,将会显示默认。'; - $lang->about_header_text = '模块头部修饰内容。(可以使用HTML)'; - $lang->about_footer_text = '模块尾部修饰内容。(可以使用HTML)'; - $lang->about_skin = '可以选择模块皮肤。'; - $lang->about_use_category = '选择此项可以使用分类功能。'; - $lang->about_list_count = '可以指定每页显示的主题数。(默认为20个)'; - $lang->about_search_list_count = '可以指定搜索或选择分类时每页要显示的帖子数(默认为20个)。'; - $lang->about_page_count = '可以指定显示在目录下方的页面数(默认为10个)。 '; - $lang->about_admin_id = '可以对该模块指定拥有最高管理权限的管理员。'; - $lang->about_grant = '全部解除特定权限的对象时,没有登录的会员也将具有相关权限。'; - $lang->about_grant_deatil = '子站会员是指注册到子站点已在线的用户.'; - $lang->about_module = "除基本library以外XE全部由模块组成。\n模块管理中列出所有已安装的模块,因此易于管理。"; - $lang->about_extra_vars_default_value = '复选/单选缺省值需要多个时,用,(逗号)来分隔。'; - $lang->about_search_virtual_site = "请输入子站点域名后再进行搜索。
    子站点以外的模块可以留空搜索。(输入时http://除外)。"; - $lang->about_extra_vars_eid_value = '请输入扩展变量名称(只允许英文字母+[英文字母+数字+_])。'; - $lang->about_langcode = "要想实现多国语言切换请点击[选择语言变量]按钮。"; - $lang->about_file_extension= "只允许%s文件。"; -?> +virtual_site = "站点"; + $lang->module_list = "模块目录"; + $lang->module_index = "模块列表"; + $lang->module_category = "模块分类"; + $lang->module_info = "模块信息"; + $lang->add_shortcut = "添加到快捷菜单"; + $lang->module_action = "动作"; + $lang->module_maker = "模块作者"; + $lang->module_license = '版权'; + $lang->module_history = "更新事项 "; + $lang->category_title = "分类名称"; + $lang->header_text = '头部修饰'; + $lang->footer_text = '尾部修饰'; + $lang->use_category = '使用分类'; + $lang->category_title = '分类名'; + $lang->checked_count = '所选主题数'; + $lang->skin_default_info = '皮肤默认信息'; + $lang->skin_author = '皮肤作者'; + $lang->skin_license = '版权'; + $lang->skin_history = '更新日志'; + $lang->module_copy = "模块复制"; + $lang->module_selector = "模块选择器"; + $lang->do_selected = "把所选模块..."; + $lang->bundle_setup = "批量设置-常规选项"; + $lang->bundle_addition_setup = "批量设置-高级选项"; + $lang->bundle_grant_setup = "批量设置-权限"; + $lang->lang_code = "语言变量"; + $lang->filebox = "文件管理"; + + $lang->access_type = '访问方式'; + $lang->access_domain = '域名'; + $lang->access_vid = '站点ID'; + $lang->about_domain = "要创建一个站点必须有一个专用域名。
    一级域名或二级域名皆可。输入的时候请把XE安装路径也一起输入。
    ex) www.xpressengine.com/xe"; + $lang->about_vid = '直接以http://XE安装地址/ID的方式访问。
    模块名(mid)不能重复。
    模块名要以英文字母开头,且只允许使用英文字母,数字及"_"。'; + $lang->msg_already_registed_vid = '重复的站点ID,请重新输入(注:站点ID不能重复,而且也不能与版面mid重复)。'; + $lang->msg_already_registed_domain = "对不起!已有相同的域名。请重新输入。"; + + $lang->header_script = "文件头部脚本"; + $lang->about_header_script = "可以直接输入插入到html中<head>区的代码。
    可使用<script, <style 或 <meta 等标签。"; + + $lang->grant_access = "访问权限"; + $lang->grant_manager = "管理权限"; + + $lang->grant_to_all = "不限制"; + $lang->grant_to_login_user = "已登录用户"; + $lang->grant_to_site_user = "子站会员"; + $lang->grant_to_group = "特定用户组"; + + $lang->cmd_add_shortcut = "添加到快捷菜单"; + $lang->cmd_install = "安装"; + $lang->cmd_update = "升级"; + $lang->cmd_manage_category = '分类管理'; + $lang->cmd_manage_grant = '权限管理'; + $lang->cmd_manage_skin = '皮肤管理'; + $lang->cmd_manage_document = '主题管理'; + $lang->cmd_find_module = '查找模块'; + $lang->cmd_find_langcode = '选择语言变量'; + + $lang->msg_new_module = "模块生成"; + $lang->msg_update_module = "模块修改"; + $lang->msg_module_name_exists = "已存在的模块名称。请输入其他名称。"; + $lang->msg_category_is_null = '没有登录的分类'; + $lang->msg_grant_is_null = '没有登录的权限对象'; + $lang->msg_no_checked_document = '没有被选择的主题'; + $lang->msg_move_failed = '移动失败!'; + $lang->msg_cannot_delete_for_child = '不能删除有下级分类的分类!'; + $lang->msg_limit_mid ="模块名称只允许英文字母+[英文字母+数字]。"; + $lang->msg_extra_name_exists = '已有的扩展变量名称,请重新输入!'; + + $lang->about_browser_title = "显示在浏览器窗口的标题值。 在RSS/Trackback也可以使用。"; + $lang->about_mid = "模块名称只允许使用英文,数字和下划线(最多不能超过40字节)。"; + $lang->about_default = "用没有mid值的网址访问网站时,将会显示默认。"; + $lang->about_module_category = "可以分类管理模块。 模块分类可以在 模块管理 > 模块分类 中进行管理。"; + $lang->about_description= '管理用使用说明。'; + $lang->about_default = '用没有mid值的网址访问网站时,将会显示默认。'; + $lang->about_header_text = '模块头部修饰内容。(可以使用HTML)'; + $lang->about_footer_text = '模块尾部修饰内容。(可以使用HTML)'; + $lang->about_skin = '可以选择模块皮肤。'; + $lang->about_use_category = '选择此项可以使用分类功能。'; + $lang->about_list_count = '可以指定每页显示的主题数。(默认为20个)'; + $lang->about_search_list_count = '可以指定搜索或选择分类时每页要显示的帖子数(默认为20个)。'; + $lang->about_page_count = '可以指定显示在目录下方的页面数(默认为10个)。 '; + $lang->about_admin_id = '可以对该模块指定拥有最高管理权限的管理员。'; + $lang->about_grant = '全部解除特定权限的对象时,没有登录的会员也将具有相关权限。'; + $lang->about_grant_deatil = '子站会员是指注册到子站点已在线的用户.'; + $lang->about_module = "除基本library以外XE全部由模块组成。\n模块管理中列出所有已安装的模块,因此易于管理。"; + $lang->about_extra_vars_default_value = '复选/单选缺省值需要多个时,用,(逗号)来分隔。'; + $lang->about_search_virtual_site = "请输入子站点域名后再进行搜索。
    子站点以外的模块可以留空搜索。(输入时http://除外)。"; + $lang->about_extra_vars_eid_value = '请输入扩展变量名称(只允许英文字母+[英文字母+数字+_])。'; + $lang->about_langcode = "要想实现多国语言切换请点击[选择语言变量]按钮。"; + $lang->about_file_extension= "只允许%s文件。"; +?> diff --git a/modules/module/lang/zh-TW.lang.php b/modules/module/lang/zh-TW.lang.php index f968c6ab1..70ca82317 100644 --- a/modules/module/lang/zh-TW.lang.php +++ b/modules/module/lang/zh-TW.lang.php @@ -1,98 +1,98 @@ -virtual_site = "虛擬網站"; - $lang->module_list = "模組列表"; - $lang->module_index = "模組列表"; - $lang->module_category = "模組分類"; - $lang->module_info = "模組資料"; - $lang->add_shortcut = "新增到快捷選單"; - $lang->module_action = "動作"; - $lang->module_maker = "模組作者"; - $lang->module_license = '版權'; - $lang->module_history = "更新紀錄"; - $lang->category_title = "分類名稱"; - $lang->header_text = '頂端內容'; - $lang->footer_text = '底端內容'; - $lang->use_category = '使用分類'; - $lang->category_title = '分類名稱'; - $lang->checked_count = '所選擇的主題數'; - $lang->skin_default_info = '預設面板資料'; - $lang->skin_author = '面板作者'; - $lang->skin_license = '版權'; - $lang->skin_history = '更新事項'; - $lang->module_copy = '複製模組'; - $lang->module_selector = '模組選擇器'; - $lang->do_selected = '選擇項目...'; - $lang->bundle_setup = '批次設定-設置'; - $lang->bundle_addition_setup = '批次設定-延伸設置'; - $lang->bundle_grant_setup = '批次設定-權限管理'; - $lang->lang_code = '語言代碼'; - $lang->filebox = '檔案管理'; - $lang->access_type = '訪問類型'; - $lang->access_domain = 'Domain'; - $lang->access_vid = 'Site ID'; - $lang->about_domain = "要建立網站必須要有個專屬域名。
    頂級域名或次級域名都可以。輸入時,請將 XE 安裝路徑也一起輸入。
    例) www.xpressengine.com/xe"; - $lang->about_vid = '直接以 http://程式安裝位址/ID 的方式訪問。模組名稱(mid)不能重複。
    必須要以英文字母開頭,只允許使用底線、英文及數字。'; - $lang->msg_already_registed_vid = '已註冊的 Site ID。不可與討論板的 mid 相同。請輸入其他 ID 名稱。'; - $lang->msg_already_registed_domain = "已註冊的域名。請使用其他的網域。"; - - $lang->header_script = "Header Script"; - $lang->about_header_script = "可以直接輸入,並插入到 HTML 的<head>之間。
    可使用<script>,<style>或<meta>等標籤。"; - - $lang->grant_access = "訪問"; - $lang->grant_manager = "管理"; - - $lang->grant_to_all = "所有用戶"; - $lang->grant_to_login_user = "已登入用戶"; - $lang->grant_to_site_user = "網站用戶"; - $lang->grant_to_group = "特定群組"; - - $lang->cmd_add_shortcut = "新增到快捷選單"; - $lang->cmd_install = "安裝"; - $lang->cmd_update = "升級"; - $lang->cmd_manage_category = '分類管理'; - $lang->cmd_manage_grant = '權限管理'; - $lang->cmd_manage_skin = '面板管理'; - $lang->cmd_manage_document = '主題管理'; - $lang->cmd_find_module = '搜尋模組'; - $lang->cmd_find_langcode = '搜尋語言代碼'; - - $lang->msg_new_module = "建立模組"; - $lang->msg_update_module = "修改模組"; - $lang->msg_module_name_exists = "已存在的模組名稱。請輸入其他名稱。"; - $lang->msg_category_is_null = '沒有登錄的分類'; - $lang->msg_grant_is_null = '沒有權限'; - $lang->msg_no_checked_document = '沒有被選擇的主題'; - $lang->msg_move_failed = '移動失敗!'; - $lang->msg_cannot_delete_for_child = '無法刪除有子分類的分類!'; - $lang->msg_limit_mid ="模組名稱可由英文 + [ 英文,數字及底線 ]等非常多種組合。"; - $lang->msg_extra_name_exists = '已存在的延伸變數名稱。請輸入其他名稱。'; - - $lang->about_browser_title = "顯示在瀏覽器視窗的標題。在 RSS/Trackback 也可以使用。"; - $lang->about_mid = "模組名稱只允許使用英文,數字和底線。最大長度 40 個字元。"; - $lang->about_default = "用沒有 mid 值的網址訪問網站時,將會顯示預設。"; - $lang->about_module_category = "可以分類管理模組。模組分類可以在模組管理 > 模組分類 中進行管理。"; - $lang->about_description= '管理使用說明。'; - $lang->about_default = '用沒有 mid 值的網址訪問網站時,將會顯示預設。'; - $lang->about_header_text = '顯示在模組頂部的內容。(可使用 HTML)'; - $lang->about_footer_text = '顯示在模組底部的內容。(可使用 HTML)'; - $lang->about_skin = '可以選擇模組面板。'; - $lang->about_use_category = '選擇此項可以使用分類功能。'; - $lang->about_list_count = '可以指定每頁顯示的主題數。(預設為 20 個)'; - $lang->about_search_list_count = '可以指定搜尋或選擇分類時,每頁要顯示的文章數(預設為 20 個)。'; - $lang->about_page_count = '可以指定顯示在清單下方的頁面數(預設為 10 個)。 '; - $lang->about_admin_id = '可以對該模組指定最高管理權限。'; - $lang->about_grant = '全部解除特定權限的對象時,沒有登錄的會員也將具有相關權限。'; - $lang->about_grant_deatil = '已註冊的用戶是指在虛擬網站註冊的用戶'; - $lang->about_module = "除基本函式庫以外 XE 全部由模組組成。\n模組管理中列出所有已安裝的模組,因此易於管理。"; - $lang->about_extra_vars_default_value = '當復選或單選的預設值需要很多個時,用逗號(,)區隔。'; - $lang->about_search_virtual_site = "請輸入網站域名後再搜尋。
    網站以外的模組可直接進行搜尋。(http://不用輸入)。"; - $lang->about_extra_vars_eid_value = '請輸入延伸變數名稱。( 只允許使用英文 + [ 英文,數字及底線 ] )'; - $lang->about_langcode = "想要實現多國語言功能,請按[語言代碼]按鈕。"; - $lang->about_file_extension= "只允許 %s 檔案。"; -?> +virtual_site = "虛擬網站"; + $lang->module_list = "模組列表"; + $lang->module_index = "模組列表"; + $lang->module_category = "模組分類"; + $lang->module_info = "模組資料"; + $lang->add_shortcut = "新增到快捷選單"; + $lang->module_action = "動作"; + $lang->module_maker = "模組作者"; + $lang->module_license = '版權'; + $lang->module_history = "更新紀錄"; + $lang->category_title = "分類名稱"; + $lang->header_text = '頂端內容'; + $lang->footer_text = '底端內容'; + $lang->use_category = '使用分類'; + $lang->category_title = '分類名稱'; + $lang->checked_count = '所選擇的主題數'; + $lang->skin_default_info = '預設面板資料'; + $lang->skin_author = '面板作者'; + $lang->skin_license = '版權'; + $lang->skin_history = '更新事項'; + $lang->module_copy = '複製模組'; + $lang->module_selector = '模組選擇器'; + $lang->do_selected = '選擇項目...'; + $lang->bundle_setup = '批次設定-設置'; + $lang->bundle_addition_setup = '批次設定-延伸設置'; + $lang->bundle_grant_setup = '批次設定-權限管理'; + $lang->lang_code = '語言代碼'; + $lang->filebox = '檔案管理'; + $lang->access_type = '訪問類型'; + $lang->access_domain = 'Domain'; + $lang->access_vid = 'Site ID'; + $lang->about_domain = "要建立網站必須要有個專屬域名。
    頂級域名或次級域名都可以。輸入時,請將 XE 安裝路徑也一起輸入。
    例) www.xpressengine.com/xe"; + $lang->about_vid = '直接以 http://程式安裝位址/ID 的方式訪問。模組名稱(mid)不能重複。
    必須要以英文字母開頭,只允許使用底線、英文及數字。'; + $lang->msg_already_registed_vid = '已註冊的 Site ID。不可與討論板的 mid 相同。請輸入其他 ID 名稱。'; + $lang->msg_already_registed_domain = "已註冊的域名。請使用其他的網域。"; + + $lang->header_script = "Header Script"; + $lang->about_header_script = "可以直接輸入,並插入到 HTML 的<head>之間。
    可使用<script>,<style>或<meta>等標籤。"; + + $lang->grant_access = "訪問"; + $lang->grant_manager = "管理"; + + $lang->grant_to_all = "所有用戶"; + $lang->grant_to_login_user = "已登入用戶"; + $lang->grant_to_site_user = "網站用戶"; + $lang->grant_to_group = "特定群組"; + + $lang->cmd_add_shortcut = "新增到快捷選單"; + $lang->cmd_install = "安裝"; + $lang->cmd_update = "升級"; + $lang->cmd_manage_category = '分類管理'; + $lang->cmd_manage_grant = '權限管理'; + $lang->cmd_manage_skin = '面板管理'; + $lang->cmd_manage_document = '主題管理'; + $lang->cmd_find_module = '搜尋模組'; + $lang->cmd_find_langcode = '搜尋語言代碼'; + + $lang->msg_new_module = "建立模組"; + $lang->msg_update_module = "修改模組"; + $lang->msg_module_name_exists = "已存在的模組名稱。請輸入其他名稱。"; + $lang->msg_category_is_null = '沒有登錄的分類'; + $lang->msg_grant_is_null = '沒有權限'; + $lang->msg_no_checked_document = '沒有被選擇的主題'; + $lang->msg_move_failed = '移動失敗!'; + $lang->msg_cannot_delete_for_child = '無法刪除有子分類的分類!'; + $lang->msg_limit_mid ="模組名稱可由英文 + [ 英文,數字及底線 ]等非常多種組合。"; + $lang->msg_extra_name_exists = '已存在的延伸變數名稱。請輸入其他名稱。'; + + $lang->about_browser_title = "顯示在瀏覽器視窗的標題。在 RSS/Trackback 也可以使用。"; + $lang->about_mid = "模組名稱只允許使用英文,數字和底線。最大長度 40 個字元。"; + $lang->about_default = "用沒有 mid 值的網址訪問網站時,將會顯示預設。"; + $lang->about_module_category = "可以分類管理模組。模組分類可以在模組管理 > 模組分類 中進行管理。"; + $lang->about_description= '管理使用說明。'; + $lang->about_default = '用沒有 mid 值的網址訪問網站時,將會顯示預設。'; + $lang->about_header_text = '顯示在模組頂部的內容。(可使用 HTML)'; + $lang->about_footer_text = '顯示在模組底部的內容。(可使用 HTML)'; + $lang->about_skin = '可以選擇模組面板。'; + $lang->about_use_category = '選擇此項可以使用分類功能。'; + $lang->about_list_count = '可以指定每頁顯示的主題數。(預設為 20 個)'; + $lang->about_search_list_count = '可以指定搜尋或選擇分類時,每頁要顯示的文章數(預設為 20 個)。'; + $lang->about_page_count = '可以指定顯示在清單下方的頁面數(預設為 10 個)。 '; + $lang->about_admin_id = '可以對該模組指定最高管理權限。'; + $lang->about_grant = '全部解除特定權限的對象時,沒有登錄的會員也將具有相關權限。'; + $lang->about_grant_deatil = '已註冊的用戶是指在虛擬網站註冊的用戶'; + $lang->about_module = "除基本函式庫以外 XE 全部由模組組成。\n模組管理中列出所有已安裝的模組,因此易於管理。"; + $lang->about_extra_vars_default_value = '當復選或單選的預設值需要很多個時,用逗號(,)區隔。'; + $lang->about_search_virtual_site = "請輸入網站域名後再搜尋。
    網站以外的模組可直接進行搜尋。(http://不用輸入)。"; + $lang->about_extra_vars_eid_value = '請輸入延伸變數名稱。( 只允許使用英文 + [ 英文,數字及底線 ] )'; + $lang->about_langcode = "想要實現多國語言功能,請按[語言代碼]按鈕。"; + $lang->about_file_extension= "只允許 %s 檔案。"; +?> diff --git a/modules/module/module.admin.controller.php b/modules/module/module.admin.controller.php index 076291a32..a4eadaa7a 100644 --- a/modules/module/module.admin.controller.php +++ b/modules/module/module.admin.controller.php @@ -1,485 +1,485 @@ -title = Context::get('title'); - $output = executeQuery('module.insertModuleCategory', $args); - if(!$output->toBool()) return $output; - - $this->setMessage("success_registed"); - } - - /** - * @brief 카테고리의 내용 수정 - **/ - function procModuleAdminUpdateCategory() { - $mode = Context::get('mode'); - - switch($mode) { - case 'delete' : - $output = $this->doDeleteModuleCategory(); - $msg_code = 'success_deleted'; - break; - case 'update' : - $output = $this->doUpdateModuleCategory(); - $msg_code = 'success_updated'; - break; - } - if(!$output->toBool()) return $output; - - $this->setMessage($msg_code); - } - - /** - * @brief 모듈 카테고리의 제목 변경 - **/ - function doUpdateModuleCategory() { - $args->title = Context::get('title'); - $args->module_category_srl = Context::get('module_category_srl'); - return executeQuery('module.updateModuleCategory', $args); - } - - /** - * @brief 모듈 카테고리 삭제 - **/ - function doDeleteModuleCategory() { - $args->module_category_srl = Context::get('module_category_srl'); - return executeQuery('module.deleteModuleCategory', $args); - } - - /** - * @brief 모듈 복사 - **/ - function procModuleAdminCopyModule() { - // 복사하려는 대상 모듈의 정보를 구함 - $module_srl = Context::get('module_srl'); - if(!$module_srl) return; - - // 새로 생성하려는 모듈들의 이름/브라우저 제목을 구함 - $clones = array(); - $args = Context::getAll(); - for($i=1;$i<=10;$i++) { - $mid = trim($args->{"mid_".$i}); - if(!$mid) continue; - if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid'); - $browser_title = $args->{"browser_title_".$i}; - if(!$mid) continue; - if($mid && !$browser_title) $browser_title = $mid; - $clones[$mid] = $browser_title; - } - if(!count($clones)) return; - - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - // 모듈 정보 가져옴 - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - - // 권한 정보 가져옴 - $module_args->module_srl = $module_srl; - $output = executeQueryArray('module.getModuleGrants', $module_args); - $grant = array(); - if($output->data) { - foreach($output->data as $key => $val) $grant[$val->name][] = $val->group_srl; - } - - - $oDB = &DB::getInstance(); - $oDB->begin(); - - // 모듈 복사 - foreach($clones as $mid => $browser_title) { - $clone_args = null; - $clone_args = clone($module_info); - $clone_args->module_srl = null; - $clone_args->content = null; - $clone_args->mid = $mid; - $clone_args->browser_title = $browser_title; - $clone_args->is_default = 'N'; - - // 모듈 생성 - $output = $oModuleController->insertModule($clone_args); - $module_srl = $output->get('module_srl'); - - // 권한 정보 등록 - if(count($grant)) $oModuleController->insertModuleGrants($module_srl, $grant); - } - - $oDB->commit(); - $this->setMessage('success_registed'); - } - - /** - * @brief 모듈 권한 저장 - **/ - function procModuleAdminInsertGrant() { - $oModuleController = &getController('module'); - $oModuleModel = &getModel('module'); - - // 모듈 번호 구함 - $module_srl = Context::get('module_srl'); - - // 해당 모듈의 정보를 구함 - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - if(!$module_info) return new Object(-1,'msg_invalid_request'); - - // 관리자 아이디 등록 - $oModuleController->deleteAdminId($module_srl); - $admin_member = Context::get('admin_member'); - if($admin_member) { - $admin_members = explode(',',$admin_member); - for($i=0;$iinsertAdminId($module_srl, $admin_id); - - } - } - - // 권한 정리 - $xml_info = $oModuleModel->getModuleActionXML($module_info->module); - - $grant_list = $xml_info->grant; - - $grant_list->access->default = 'guest'; - $grant_list->manager->default = 'manager'; - - foreach($grant_list as $grant_name => $grant_info) { - // default값을 구함 - $default = Context::get($grant_name.'_default'); - - // -1 = 로그인 사용자만, -2 = 사이트 가입자만, 0 = 모든 사용자 - if(strlen($default)){ - $grant->{$grant_name}[] = $default; - continue; - - // 특정 그룹 사용자 - } else { - $group_srls = Context::get($grant_name); - if($group_srls) { - if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls); - elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls); - else $group_srls = array($group_srls); - $grant->{$grant_name} = $group_srls; - } - continue; - } - $grant->{$group_srls} = array(); - } - - // DB에 저장 - $args->module_srl = $module_srl; - $output = executeQuery('module.deleteModuleGrants', $args); - if(!$output->toBool()) return $output; - - // DB에 권한 저장 - foreach($grant as $grant_name => $group_srls) { - foreach($group_srls as $key => $val) { - $args = null; - $args->module_srl = $module_srl; - $args->name = $grant_name; - $args->group_srl = $val; - $output = executeQuery('module.insertModuleGrant', $args); - if(!$output->toBool()) return $output; - } - } - $this->setMessage('success_registed'); - } - - /** - * @brief 스킨 정보 업데이트 - **/ - function procModuleAdminUpdateSkinInfo() { - // 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를 체크하기 위해서) - $module_path = './modules/'.$module_info->module; - $skin_info = $oModuleModel->loadSkinInfo($module_path, $skin); - $skin_vars = $oModuleModel->getModuleSkinVars($module_srl); - // 입력받은 변수들을 체크 (mo, act, module_srl, page등 기본적인 변수들 없앰) - $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일 경우 별도 처리를 해줌 - if($skin_info->extra_vars) { - foreach($skin_info->extra_vars as $vars) { - if($vars->type!='image') continue; - - $image_obj = $obj->{$vars->name}; - - // 삭제 요청에 대한 변수를 구함 - $del_var = $obj->{"del_".$vars->name}; - unset($obj->{"del_".$vars->name}); - if($del_var == 'Y') { - FileHandler::removeFile($skin_vars[$vars->name]->value); - continue; - } - - // 업로드 되지 않았다면 이전 데이터를 그대로 사용 - if(!$image_obj['tmp_name']) { - $obj->{$vars->name} = $skin_vars[$vars->name]->value; - continue; - } - - // 정상적으로 업로드된 파일이 아니면 무시 - if(!is_uploaded_file($image_obj['tmp_name'])) { - unset($obj->{$vars->name}); - continue; - } - - // 이미지 파일이 아니어도 무시 - if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) { - unset($obj->{$vars->name}); - continue; - } - - // 경로를 정해서 업로드 - $path = sprintf("./files/attach/images/%s/", $module_srl); - - // 디렉토리 생성 - if(!FileHandler::makeDir($path)) return false; - - $filename = $path.$image_obj['name']; - - // 파일 이동 - if(!move_uploaded_file($image_obj['tmp_name'], $filename)) { - unset($obj->{$vars->name}); - continue; - } - - // 정상 파일 업로드 - FileHandler::removeFile($skin_vars[$vars->name]->value); - // 변수를 바꿈 - unset($obj->{$vars->name}); - $obj->{$vars->name} = $filename; - } - } - // 해당 모듈의 전체 스킨 불러와서 이미지는 제거 - /* - if($skin_info->extra_vars) { - foreach($skin_info->extra_vars as $vars) { - if($vars->type!='image') continue; - $value = $skin_vars[$vars->name]; - if(file_exists($value)) @unlink($value); - } - } - */ - $oModuleController = &getController('module'); - $oModuleController->deleteModuleSkinVars($module_srl); - - // 등록 - $oModuleController->insertModuleSkinVars($module_srl, $obj); - } - - $this->setLayoutPath('./common/tpl'); - $this->setLayoutFile('default_layout.html'); - $this->setTemplatePath('./modules/module/tpl'); - $this->setTemplateFile("top_refresh.html"); - } - - /** - * @brief 모듈 일괄 정리 - **/ - function procModuleAdminModuleSetup() { - $vars = Context::getRequestVars(); - - if(!$vars->module_srls) return new Object(-1,'msg_invalid_request'); - - $module_srls = explode(',',$vars->module_srls); - if(!count($module_srls)) return new Object(-1,'msg_invalid_request'); - - $oModuleModel = &getModel('module'); - $oModuleController= &getController('module'); - foreach($module_srls as $module_srl) { - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - $module_info->module_category_srl = $vars->module_category_srl; - $module_info->layout_srl = $vars->layout_srl; - $module_info->skin = $vars->skin; - $module_info->description = $vars->description; - $module_info->header_text = $vars->header_text; - $module_info->footer_text = $vars->footer_text; - $oModuleController->updateModule($module_info); - } - - $this->setMessage('success_registed'); - } - - /** - * @brief 모듈 권한 일괄 정리 - **/ - function procModuleAdminModuleGrantSetup() { - $module_srls = Context::get('module_srls'); - if(!$module_srls) return new Object(-1,'msg_invalid_request'); - - $modules = explode(',',$module_srls); - if(!count($modules)) return new Object(-1,'msg_invalid_request'); - - $oModuleController = &getController('module'); - $oModuleModel = &getModel('module'); - - $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]); - $xml_info = $oModuleModel->getModuleActionXml($module_info->module); - $grant_list = $xml_info->grant; - - $grant_list->access->default = 'guest'; - $grant_list->manager->default = 'manager'; - - foreach($grant_list as $grant_name => $grant_info) { - // default값을 구함 - $default = Context::get($grant_name.'_default'); - - // -1 = 로그인 사용자만, 0 = 모든 사용자 - if(strlen($default)){ - $grant->{$grant_name}[] = $default; - continue; - - // 특정 그룹 사용자 - } else { - $group_srls = Context::get($grant_name); - if($group_srls) { - if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls); - elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls); - else $group_srls = array($group_srls); - $grant->{$grant_name} = $group_srls; - } - continue; - } - $grant->{$group_srls} = array(); - } - - - // DB에 저장 - foreach($modules as $module_srl) { - $args = null; - $args->module_srl = $module_srl; - $output = executeQuery('module.deleteModuleGrants', $args); - if(!$output->toBool()) continue; - - // DB에 권한 저장 - foreach($grant as $grant_name => $group_srls) { - foreach($group_srls as $key => $val) { - $args = null; - $args->module_srl = $module_srl; - $args->name = $grant_name; - $args->group_srl = $val; - $output = executeQuery('module.insertModuleGrant', $args); - if(!$output->toBool()) return $output; - } - } - } - $this->setMessage('success_registed'); - } - - /** - * @brief 언어 추가/ 업데이트 - **/ - function procModuleAdminInsertLang() { - // 언어코드명 가져옴 - $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'); - - // 언어코드가 있는지 조사 - $output = executeQueryArray('module.getLang', $args); - if(!$output->toBool()) return $output; - - // 있으면 업데이트를 위해 기존 값들을 지움 - if($output->data) $output = executeQuery('module.deleteLang', $args); - if(!$output->toBool()) return $output; - - // 입력 - $lang_supported = Context::get('lang_supported'); - foreach($lang_supported as $key => $val) { - $args->lang_code = $key; - $args->value = trim(Context::get($key)); - if(!$args->value) { - $args->value = Context::get(strtolower($key)); - if(!$args->value) $args->value = $args->name; - } - $output = executeQuery('module.insertLang', $args); - if(!$output->toBool()) return $output; - } - $this->makeCacheDefinedLangCode($args->site_srl); - - $this->add('name', $args->name); - } - - /** - * @brief 언어 제거 - **/ - function procModuleAdminDeleteLang() { - // 언어코드명 가져옴 - $site_module_info = Context::get('site_module_info'); - $args->site_srl = (int)$site_module_info->site_srl; - $args->name = str_replace(' ','_',Context::get('name')); - if(!$args->name) return new Object(-1,'msg_invalid_request'); - - $output = executeQuery('module.deleteLang', $args); - if(!$output->toBool()) return $output; - $this->makeCacheDefinedLangCode($args->site_srl); - } - - /** - * @brief 사용자 정이 언어코드 파일 저장 - **/ - function makeCacheDefinedLangCode($site_srl = 0) { - // 현재 사이트의 언어파일 가져오기 - if(!$site_srl) { - $site_module_info = Context::get('site_module_info'); - $args->site_srl = (int)$site_module_info->site_srl; - } else { - $args->site_srl = $site_srl; - } - $output = executeQueryArray('module.getLang', $args); - if(!$output->toBool() || !$output->data) return; - - // 캐시 디렉토리 설정 - $cache_path = _XE_PATH_.'files/cache/lang_defined/'; - if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); - - $lang_supported = Context::get('lang_supported'); - foreach($lang_supported as $key => $val) { - $fp[$key] = fopen( sprintf('%s/%d.%s.php', $cache_path, $args->site_srl, $key), 'w' ); - if(!$fp[$key]) return; - fwrite($fp[$key],"data as $key => $val) { - if($fp[$val->lang_code]) fwrite($fp[$val->lang_code], sprintf('$lang["%s"] = "%s";'."\r\n", $val->name, str_replace('"','\\"',$val->value))); - } - - foreach($lang_supported as $key => $val) { - if(!$fp[$key]) continue; - fwrite($fp[$key],"?>"); - fclose($fp[$key]); - } - } - - } -?> +title = Context::get('title'); + $output = executeQuery('module.insertModuleCategory', $args); + if(!$output->toBool()) return $output; + + $this->setMessage("success_registed"); + } + + /** + * @brief 카테고리의 내용 수정 + **/ + function procModuleAdminUpdateCategory() { + $mode = Context::get('mode'); + + switch($mode) { + case 'delete' : + $output = $this->doDeleteModuleCategory(); + $msg_code = 'success_deleted'; + break; + case 'update' : + $output = $this->doUpdateModuleCategory(); + $msg_code = 'success_updated'; + break; + } + if(!$output->toBool()) return $output; + + $this->setMessage($msg_code); + } + + /** + * @brief 모듈 카테고리의 제목 변경 + **/ + function doUpdateModuleCategory() { + $args->title = Context::get('title'); + $args->module_category_srl = Context::get('module_category_srl'); + return executeQuery('module.updateModuleCategory', $args); + } + + /** + * @brief 모듈 카테고리 삭제 + **/ + function doDeleteModuleCategory() { + $args->module_category_srl = Context::get('module_category_srl'); + return executeQuery('module.deleteModuleCategory', $args); + } + + /** + * @brief 모듈 복사 + **/ + function procModuleAdminCopyModule() { + // 복사하려는 대상 모듈의 정보를 구함 + $module_srl = Context::get('module_srl'); + if(!$module_srl) return; + + // 새로 생성하려는 모듈들의 이름/브라우저 제목을 구함 + $clones = array(); + $args = Context::getAll(); + for($i=1;$i<=10;$i++) { + $mid = trim($args->{"mid_".$i}); + if(!$mid) continue; + if(!preg_match("/^[a-zA-Z]([a-zA-Z0-9_]*)$/i", $mid)) return new Object(-1, 'msg_limit_mid'); + $browser_title = $args->{"browser_title_".$i}; + if(!$mid) continue; + if($mid && !$browser_title) $browser_title = $mid; + $clones[$mid] = $browser_title; + } + if(!count($clones)) return; + + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // 모듈 정보 가져옴 + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + + // 권한 정보 가져옴 + $module_args->module_srl = $module_srl; + $output = executeQueryArray('module.getModuleGrants', $module_args); + $grant = array(); + if($output->data) { + foreach($output->data as $key => $val) $grant[$val->name][] = $val->group_srl; + } + + + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 모듈 복사 + foreach($clones as $mid => $browser_title) { + $clone_args = null; + $clone_args = clone($module_info); + $clone_args->module_srl = null; + $clone_args->content = null; + $clone_args->mid = $mid; + $clone_args->browser_title = $browser_title; + $clone_args->is_default = 'N'; + + // 모듈 생성 + $output = $oModuleController->insertModule($clone_args); + $module_srl = $output->get('module_srl'); + + // 권한 정보 등록 + if(count($grant)) $oModuleController->insertModuleGrants($module_srl, $grant); + } + + $oDB->commit(); + $this->setMessage('success_registed'); + } + + /** + * @brief 모듈 권한 저장 + **/ + function procModuleAdminInsertGrant() { + $oModuleController = &getController('module'); + $oModuleModel = &getModel('module'); + + // 모듈 번호 구함 + $module_srl = Context::get('module_srl'); + + // 해당 모듈의 정보를 구함 + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if(!$module_info) return new Object(-1,'msg_invalid_request'); + + // 관리자 아이디 등록 + $oModuleController->deleteAdminId($module_srl); + $admin_member = Context::get('admin_member'); + if($admin_member) { + $admin_members = explode(',',$admin_member); + for($i=0;$iinsertAdminId($module_srl, $admin_id); + + } + } + + // 권한 정리 + $xml_info = $oModuleModel->getModuleActionXML($module_info->module); + + $grant_list = $xml_info->grant; + + $grant_list->access->default = 'guest'; + $grant_list->manager->default = 'manager'; + + foreach($grant_list as $grant_name => $grant_info) { + // default값을 구함 + $default = Context::get($grant_name.'_default'); + + // -1 = 로그인 사용자만, -2 = 사이트 가입자만, 0 = 모든 사용자 + if(strlen($default)){ + $grant->{$grant_name}[] = $default; + continue; + + // 특정 그룹 사용자 + } else { + $group_srls = Context::get($grant_name); + if($group_srls) { + if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls); + elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls); + else $group_srls = array($group_srls); + $grant->{$grant_name} = $group_srls; + } + continue; + } + $grant->{$group_srls} = array(); + } + + // DB에 저장 + $args->module_srl = $module_srl; + $output = executeQuery('module.deleteModuleGrants', $args); + if(!$output->toBool()) return $output; + + // DB에 권한 저장 + foreach($grant as $grant_name => $group_srls) { + foreach($group_srls as $key => $val) { + $args = null; + $args->module_srl = $module_srl; + $args->name = $grant_name; + $args->group_srl = $val; + $output = executeQuery('module.insertModuleGrant', $args); + if(!$output->toBool()) return $output; + } + } + $this->setMessage('success_registed'); + } + + /** + * @brief 스킨 정보 업데이트 + **/ + function procModuleAdminUpdateSkinInfo() { + // 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를 체크하기 위해서) + $module_path = './modules/'.$module_info->module; + $skin_info = $oModuleModel->loadSkinInfo($module_path, $skin); + $skin_vars = $oModuleModel->getModuleSkinVars($module_srl); + // 입력받은 변수들을 체크 (mo, act, module_srl, page등 기본적인 변수들 없앰) + $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일 경우 별도 처리를 해줌 + if($skin_info->extra_vars) { + foreach($skin_info->extra_vars as $vars) { + if($vars->type!='image') continue; + + $image_obj = $obj->{$vars->name}; + + // 삭제 요청에 대한 변수를 구함 + $del_var = $obj->{"del_".$vars->name}; + unset($obj->{"del_".$vars->name}); + if($del_var == 'Y') { + FileHandler::removeFile($skin_vars[$vars->name]->value); + continue; + } + + // 업로드 되지 않았다면 이전 데이터를 그대로 사용 + if(!$image_obj['tmp_name']) { + $obj->{$vars->name} = $skin_vars[$vars->name]->value; + continue; + } + + // 정상적으로 업로드된 파일이 아니면 무시 + if(!is_uploaded_file($image_obj['tmp_name'])) { + unset($obj->{$vars->name}); + continue; + } + + // 이미지 파일이 아니어도 무시 + if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) { + unset($obj->{$vars->name}); + continue; + } + + // 경로를 정해서 업로드 + $path = sprintf("./files/attach/images/%s/", $module_srl); + + // 디렉토리 생성 + if(!FileHandler::makeDir($path)) return false; + + $filename = $path.$image_obj['name']; + + // 파일 이동 + if(!move_uploaded_file($image_obj['tmp_name'], $filename)) { + unset($obj->{$vars->name}); + continue; + } + + // 정상 파일 업로드 + FileHandler::removeFile($skin_vars[$vars->name]->value); + // 변수를 바꿈 + unset($obj->{$vars->name}); + $obj->{$vars->name} = $filename; + } + } + // 해당 모듈의 전체 스킨 불러와서 이미지는 제거 + /* + if($skin_info->extra_vars) { + foreach($skin_info->extra_vars as $vars) { + if($vars->type!='image') continue; + $value = $skin_vars[$vars->name]; + if(file_exists($value)) @unlink($value); + } + } + */ + $oModuleController = &getController('module'); + $oModuleController->deleteModuleSkinVars($module_srl); + + // 등록 + $oModuleController->insertModuleSkinVars($module_srl, $obj); + } + + $this->setLayoutPath('./common/tpl'); + $this->setLayoutFile('default_layout.html'); + $this->setTemplatePath('./modules/module/tpl'); + $this->setTemplateFile("top_refresh.html"); + } + + /** + * @brief 모듈 일괄 정리 + **/ + function procModuleAdminModuleSetup() { + $vars = Context::getRequestVars(); + + if(!$vars->module_srls) return new Object(-1,'msg_invalid_request'); + + $module_srls = explode(',',$vars->module_srls); + if(!count($module_srls)) return new Object(-1,'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $oModuleController= &getController('module'); + foreach($module_srls as $module_srl) { + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + $module_info->module_category_srl = $vars->module_category_srl; + $module_info->layout_srl = $vars->layout_srl; + $module_info->skin = $vars->skin; + $module_info->description = $vars->description; + $module_info->header_text = $vars->header_text; + $module_info->footer_text = $vars->footer_text; + $oModuleController->updateModule($module_info); + } + + $this->setMessage('success_registed'); + } + + /** + * @brief 모듈 권한 일괄 정리 + **/ + function procModuleAdminModuleGrantSetup() { + $module_srls = Context::get('module_srls'); + if(!$module_srls) return new Object(-1,'msg_invalid_request'); + + $modules = explode(',',$module_srls); + if(!count($modules)) return new Object(-1,'msg_invalid_request'); + + $oModuleController = &getController('module'); + $oModuleModel = &getModel('module'); + + $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]); + $xml_info = $oModuleModel->getModuleActionXml($module_info->module); + $grant_list = $xml_info->grant; + + $grant_list->access->default = 'guest'; + $grant_list->manager->default = 'manager'; + + foreach($grant_list as $grant_name => $grant_info) { + // default값을 구함 + $default = Context::get($grant_name.'_default'); + + // -1 = 로그인 사용자만, 0 = 모든 사용자 + if(strlen($default)){ + $grant->{$grant_name}[] = $default; + continue; + + // 특정 그룹 사용자 + } else { + $group_srls = Context::get($grant_name); + if($group_srls) { + if(strpos($group_srls,'|@|')!==false) $group_srls = explode('|@|',$group_srls); + elseif(strpos($group_srls,',')!==false) $group_srls = explode(',',$group_srls); + else $group_srls = array($group_srls); + $grant->{$grant_name} = $group_srls; + } + continue; + } + $grant->{$group_srls} = array(); + } + + + // DB에 저장 + foreach($modules as $module_srl) { + $args = null; + $args->module_srl = $module_srl; + $output = executeQuery('module.deleteModuleGrants', $args); + if(!$output->toBool()) continue; + + // DB에 권한 저장 + foreach($grant as $grant_name => $group_srls) { + foreach($group_srls as $key => $val) { + $args = null; + $args->module_srl = $module_srl; + $args->name = $grant_name; + $args->group_srl = $val; + $output = executeQuery('module.insertModuleGrant', $args); + if(!$output->toBool()) return $output; + } + } + } + $this->setMessage('success_registed'); + } + + /** + * @brief 언어 추가/ 업데이트 + **/ + function procModuleAdminInsertLang() { + // 언어코드명 가져옴 + $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'); + + // 언어코드가 있는지 조사 + $output = executeQueryArray('module.getLang', $args); + if(!$output->toBool()) return $output; + + // 있으면 업데이트를 위해 기존 값들을 지움 + if($output->data) $output = executeQuery('module.deleteLang', $args); + if(!$output->toBool()) return $output; + + // 입력 + $lang_supported = Context::get('lang_supported'); + foreach($lang_supported as $key => $val) { + $args->lang_code = $key; + $args->value = trim(Context::get($key)); + if(!$args->value) { + $args->value = Context::get(strtolower($key)); + if(!$args->value) $args->value = $args->name; + } + $output = executeQuery('module.insertLang', $args); + if(!$output->toBool()) return $output; + } + $this->makeCacheDefinedLangCode($args->site_srl); + + $this->add('name', $args->name); + } + + /** + * @brief 언어 제거 + **/ + function procModuleAdminDeleteLang() { + // 언어코드명 가져옴 + $site_module_info = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + $args->name = str_replace(' ','_',Context::get('name')); + if(!$args->name) return new Object(-1,'msg_invalid_request'); + + $output = executeQuery('module.deleteLang', $args); + if(!$output->toBool()) return $output; + $this->makeCacheDefinedLangCode($args->site_srl); + } + + /** + * @brief 사용자 정이 언어코드 파일 저장 + **/ + function makeCacheDefinedLangCode($site_srl = 0) { + // 현재 사이트의 언어파일 가져오기 + if(!$site_srl) { + $site_module_info = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + } else { + $args->site_srl = $site_srl; + } + $output = executeQueryArray('module.getLang', $args); + if(!$output->toBool() || !$output->data) return; + + // 캐시 디렉토리 설정 + $cache_path = _XE_PATH_.'files/cache/lang_defined/'; + if(!is_dir($cache_path)) FileHandler::makeDir($cache_path); + + $lang_supported = Context::get('lang_supported'); + foreach($lang_supported as $key => $val) { + $fp[$key] = fopen( sprintf('%s/%d.%s.php', $cache_path, $args->site_srl, $key), 'w' ); + if(!$fp[$key]) return; + fwrite($fp[$key],"data as $key => $val) { + if($fp[$val->lang_code]) fwrite($fp[$val->lang_code], sprintf('$lang["%s"] = "%s";'."\r\n", $val->name, str_replace('"','\\"',$val->value))); + } + + foreach($lang_supported as $key => $val) { + if(!$fp[$key]) continue; + fwrite($fp[$key],"?>"); + fclose($fp[$key]); + } + } + + } +?> diff --git a/modules/module/module.admin.model.php b/modules/module/module.admin.model.php index a4b640b43..12faafa23 100644 --- a/modules/module/module.admin.model.php +++ b/modules/module/module.admin.model.php @@ -1,190 +1,190 @@ -module_srls = Context::get('module_srls'); - $output = executeQueryArray('module.getModulesInfo', $args); - if(!$output->toBool() || !$output->data) return new Object(); - - foreach($output->data as $key => $val) { - $list[$val->module_srl] = array('module_srl'=>$val->module_srl,'mid'=>$val->mid,'browser_title'=>$val->browser_title); - } - $modules = explode(',',$args->module_srls); - for($i=0;$iadd('id', Context::get('id')); - $this->add('module_list', $module_list); - } - - function getModuleMidList($args){ - $args->list_count = 20; - $args->page_count = 10; - $output = executeQueryArray('module.getModuleMidList', $args); - if(!$output->toBool()) return $output; - - ModuleModel::syncModuleToSite($output->data); - - return $output; - } - - /** - * @brief 공통 :: 모듈의 모듈 권한 출력 페이지 - * 모듈의 모듈 권한 출력은 모든 모듈에서 module instance를 이용할때 사용할 수 있음 - **/ - function getModuleGrantHTML($module_srl, $source_grant_list) { - - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - - // access, manager 권한은 가상 권한으로 설정 - $grant_list->access->title = Context::getLang('grant_access'); - $grant_list->access->default = 'guest'; - if(count($source_grant_list)) { - foreach($source_grant_list as $key => $val) { - if(!$val->default) $val->default = 'guest'; - if($val->default == 'root') $val->default = 'manager'; - $grant_list->{$key} = $val; - } - } - $grant_list->manager->title = Context::getLang('grant_manager'); - $grant_list->manager->default = 'manager'; - Context::set('grant_list', $grant_list); - - // 현재 모듈에 설정된 권한 그룹을 가져옴 - $default_grant = array(); - $args->module_srl = $module_srl; - $output = executeQueryArray('module.getModuleGrants', $args); - if($output->data) { - foreach($output->data as $val) { - if($val->group_srl == 0) $default_grant[$val->name] = 'all'; - else if($val->group_srl == -1) $default_grant[$val->name] = 'member'; - else if($val->group_srl == -2) $default_grant[$val->name] = 'site'; - else { - $selected_group[$val->name][] = $val->group_srl; - $default_grant[$val->name] = 'group'; - } - } - } - Context::set('selected_group', $selected_group); - Context::set('default_grant', $default_grant); - Context::set('module_srl', $module_srl); - // 현재 모듈에 설정된 관리자 아이디를 추출 - $admin_member = $oModuleModel->getAdminId($module_srl); - Context::set('admin_member', $admin_member); - - // 그룹을 가져옴 - $oMemberModel = &getModel('member'); - $group_list = $oMemberModel->getGroups($module_info->site_srl); - Context::set('group_list', $group_list); - - // grant 정보를 추출 - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($this->module_path.'tpl', 'module_grants'); - } - - /** - * @brief 공통 :: 모듈의 스킨 설정 출력 페이지 - **/ - function getModuleSkinHTML($module_srl) { - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - if(!$module_info) return; - - $skin = $module_info->skin; - $module_path = './modules/'.$module_info->module; - - // 스킨의 XML 정보를 구함 - $skin_info = $oModuleModel->loadSkinInfo($module_path, $skin); - - // DB에 설정된 스킨 정보를 구함 - $skin_vars = $oModuleModel->getModuleSkinVars($module_srl); - - if(count($skin_info->extra_vars)) { - foreach($skin_info->extra_vars as $key => $val) { - $group = $val->group; - $name = $val->name; - $type = $val->type; - if($skin_vars[$name]) $value = $skin_vars[$name]->value; - else $value = ''; - if($type=="checkbox") $value = $value?unserialize($value):array(); - - $skin_info->extra_vars[$key]->value= $value; - } - } - - Context::set('module_info', $module_info); - Context::set('mid', $module_info->mid); - Context::set('skin_info', $skin_info); - Context::set('skin_vars', $skin_vars); - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($this->module_path.'tpl', 'skin_config'); - } - - /** - * @brief 특정 언어 코드에 대한 값들을 가져오기 - * lang_code를 직접 기입하면 해당 언어코드에 대해서만 가져오고 값이 없으면 $name을 그대로 return - **/ - function getLangCode($site_srl, $name) { - $lang_supported = Context::get('lang_supported'); - - if(substr($name,0,12)=='$user_lang->') { - $args->site_srl = (int)$site_srl; - $args->name = substr($name,12); - $output = executeQueryArray('module.getLang', $args); - if($output->data) { - foreach($output->data as $key => $val) { - $selected_lang[$val->lang_code] = $val->value; - } - } - } else { - $tmp = unserialize($name); - if($tmp) { - $selected_lang = array(); - $rand_name = $tmp[Context::getLangType()]; - if(!$rand_name) $rand_name = array_shift($tmp); - foreach($lang_supported as $key => $val) { - $selected_lang[$key] = $tmp[$key]?$tmp[$key]:$rand_name; - } - } - } - - $output = array(); - foreach($lang_supported as $key => $val) { - $output[$key] = $selected_lang[$key]?$selected_lang[$key]:$name; - } - return $output; - } - - /** - * @brief 모듈 언어를 ajax로 요청시 return - **/ - function getModuleAdminLangCode() { - $name = Context::get('name'); - if(!$name) return new Object(-1,'msg_invalid_request'); - $site_module_info = Context::get('site_module_info'); - $this->add('name', $name); - $output = $this->getLangCode($site_module_info->site_srl, '$user_lang->'.$name); - $this->add('langs', $output); - } - } -?> +module_srls = Context::get('module_srls'); + $output = executeQueryArray('module.getModulesInfo', $args); + if(!$output->toBool() || !$output->data) return new Object(); + + foreach($output->data as $key => $val) { + $list[$val->module_srl] = array('module_srl'=>$val->module_srl,'mid'=>$val->mid,'browser_title'=>$val->browser_title); + } + $modules = explode(',',$args->module_srls); + for($i=0;$iadd('id', Context::get('id')); + $this->add('module_list', $module_list); + } + + function getModuleMidList($args){ + $args->list_count = 20; + $args->page_count = 10; + $output = executeQueryArray('module.getModuleMidList', $args); + if(!$output->toBool()) return $output; + + ModuleModel::syncModuleToSite($output->data); + + return $output; + } + + /** + * @brief 공통 :: 모듈의 모듈 권한 출력 페이지 + * 모듈의 모듈 권한 출력은 모든 모듈에서 module instance를 이용할때 사용할 수 있음 + **/ + function getModuleGrantHTML($module_srl, $source_grant_list) { + + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + + // access, manager 권한은 가상 권한으로 설정 + $grant_list->access->title = Context::getLang('grant_access'); + $grant_list->access->default = 'guest'; + if(count($source_grant_list)) { + foreach($source_grant_list as $key => $val) { + if(!$val->default) $val->default = 'guest'; + if($val->default == 'root') $val->default = 'manager'; + $grant_list->{$key} = $val; + } + } + $grant_list->manager->title = Context::getLang('grant_manager'); + $grant_list->manager->default = 'manager'; + Context::set('grant_list', $grant_list); + + // 현재 모듈에 설정된 권한 그룹을 가져옴 + $default_grant = array(); + $args->module_srl = $module_srl; + $output = executeQueryArray('module.getModuleGrants', $args); + if($output->data) { + foreach($output->data as $val) { + if($val->group_srl == 0) $default_grant[$val->name] = 'all'; + else if($val->group_srl == -1) $default_grant[$val->name] = 'member'; + else if($val->group_srl == -2) $default_grant[$val->name] = 'site'; + else { + $selected_group[$val->name][] = $val->group_srl; + $default_grant[$val->name] = 'group'; + } + } + } + Context::set('selected_group', $selected_group); + Context::set('default_grant', $default_grant); + Context::set('module_srl', $module_srl); + // 현재 모듈에 설정된 관리자 아이디를 추출 + $admin_member = $oModuleModel->getAdminId($module_srl); + Context::set('admin_member', $admin_member); + + // 그룹을 가져옴 + $oMemberModel = &getModel('member'); + $group_list = $oMemberModel->getGroups($module_info->site_srl); + Context::set('group_list', $group_list); + + // grant 정보를 추출 + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($this->module_path.'tpl', 'module_grants'); + } + + /** + * @brief 공통 :: 모듈의 스킨 설정 출력 페이지 + **/ + function getModuleSkinHTML($module_srl) { + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if(!$module_info) return; + + $skin = $module_info->skin; + $module_path = './modules/'.$module_info->module; + + // 스킨의 XML 정보를 구함 + $skin_info = $oModuleModel->loadSkinInfo($module_path, $skin); + + // DB에 설정된 스킨 정보를 구함 + $skin_vars = $oModuleModel->getModuleSkinVars($module_srl); + + if(count($skin_info->extra_vars)) { + foreach($skin_info->extra_vars as $key => $val) { + $group = $val->group; + $name = $val->name; + $type = $val->type; + if($skin_vars[$name]) $value = $skin_vars[$name]->value; + else $value = ''; + if($type=="checkbox") $value = $value?unserialize($value):array(); + + $skin_info->extra_vars[$key]->value= $value; + } + } + + Context::set('module_info', $module_info); + Context::set('mid', $module_info->mid); + Context::set('skin_info', $skin_info); + Context::set('skin_vars', $skin_vars); + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($this->module_path.'tpl', 'skin_config'); + } + + /** + * @brief 특정 언어 코드에 대한 값들을 가져오기 + * lang_code를 직접 기입하면 해당 언어코드에 대해서만 가져오고 값이 없으면 $name을 그대로 return + **/ + function getLangCode($site_srl, $name) { + $lang_supported = Context::get('lang_supported'); + + if(substr($name,0,12)=='$user_lang->') { + $args->site_srl = (int)$site_srl; + $args->name = substr($name,12); + $output = executeQueryArray('module.getLang', $args); + if($output->data) { + foreach($output->data as $key => $val) { + $selected_lang[$val->lang_code] = $val->value; + } + } + } else { + $tmp = unserialize($name); + if($tmp) { + $selected_lang = array(); + $rand_name = $tmp[Context::getLangType()]; + if(!$rand_name) $rand_name = array_shift($tmp); + foreach($lang_supported as $key => $val) { + $selected_lang[$key] = $tmp[$key]?$tmp[$key]:$rand_name; + } + } + } + + $output = array(); + foreach($lang_supported as $key => $val) { + $output[$key] = $selected_lang[$key]?$selected_lang[$key]:$name; + } + return $output; + } + + /** + * @brief 모듈 언어를 ajax로 요청시 return + **/ + function getModuleAdminLangCode() { + $name = Context::get('name'); + if(!$name) return new Object(-1,'msg_invalid_request'); + $site_module_info = Context::get('site_module_info'); + $this->add('name', $name); + $output = $this->getLangCode($site_module_info->site_srl, '$user_lang->'.$name); + $this->add('langs', $output); + } + } +?> diff --git a/modules/module/module.admin.view.php b/modules/module/module.admin.view.php index ae7615173..c4445c659 100644 --- a/modules/module/module.admin.view.php +++ b/modules/module/module.admin.view.php @@ -1,224 +1,224 @@ -setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 모듈 관리자 페이지 - **/ - function dispModuleAdminContent() { - $this->dispModuleAdminList(); - } - - /** - * @brief 모듈 목록 출력 - **/ - function dispModuleAdminList() { - // 모듈 목록을 구해서 - $oModuleModel = &getModel('module'); - $module_list = $oModuleModel->getModuleList(); - Context::set('module_list', $module_list); - - // 템플릿 파일 지정 - $this->setTemplateFile('module_list'); - } - - /** - * @brief 모듈의 상세 정보(conf/info.xml)를 팝업 출력 - **/ - function dispModuleAdminInfo() { - // 모듈 목록을 구해서 - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoXml(Context::get('selected_module')); - Context::set('module_info', $module_info); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('module_info'); - } - - /** - * @brief 모듈 카테고리 목록 - **/ - function dispModuleAdminCategory() { - $module_category_srl = Context::get('module_category_srl'); - - // 모듈 목록을 구해서 - $oModuleModel = &getModel('module'); - - // 선택된 카테고리가 있으면 해당 카테고리의 정보 수정 페이지로 - if($module_category_srl) { - $selected_category = $oModuleModel->getModuleCategory($module_category_srl); - Context::set('selected_category', $selected_category); - - // 템플릿 파일 지정 - $this->setTemplateFile('category_update_form'); - - // 아니면 전체 목록 - } else { - $category_list = $oModuleModel->getModuleCategories(); - Context::set('category_list', $category_list); - - // 템플릿 파일 지정 - $this->setTemplateFile('category_list'); - } - } - - /** - * @brief 모듈 복사 기능 - **/ - function dispModuleAdminCopyModule() { - // 복사하려는 대상 모듈을 구함 - $module_srl = Context::get('module_srl'); - - // 해당 모듈의 정보를 구함 - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - Context::set('module_info', $module_info); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('copy_module'); - } - - /** - * @brief 모듈 기본 설정 일괄 적용 - **/ - function dispModuleAdminModuleSetup() { - $module_srls = Context::get('module_srls'); - - $modules = explode(',',$module_srls); - if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request'); - - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]); - - // 모듈의 스킨 목록을 구함 - $skin_list = $oModuleModel->getSkins('./modules/'.$module_info->module); - Context::set('skin_list',$skin_list); - - // 레이아웃 목록을 구해옴 - $oLayoutMode = &getModel('layout'); - $layout_list = $oLayoutMode->getLayoutList(); - Context::set('layout_list', $layout_list); - - // 모듈 카테고리 목록을 구함 - $module_category = $oModuleModel->getModuleCategories(); - Context::set('module_category', $module_category); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('module_setup'); - } - - /** - * @brief 모듈 추가 설정 일괄 적용 - **/ - 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로 받아오기에 미리 변수 선언만 해 놓음 - $content = ''; - - // 추가 설정을 위한 트리거 호출 - // 게시판 모듈이지만 차후 다른 모듈에서의 사용도 고려하여 trigger 이름을 공용으로 사용할 수 있도록 하였음 - $output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'before', $content); - $output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'after', $content); - Context::set('setup_content', $content); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('module_addition_setup'); - } - - /** - * @brief 모듈 권한 설정 일괄 적용 - **/ - function dispModuleAdminModuleGrantSetup() { - $module_srls = Context::get('module_srls'); - - $modules = explode(',',$module_srls); - if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request'); - - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]); - $xml_info = $oModuleModel->getModuleActionXml($module_info->module); - $source_grant_list = $xml_info->grant; - - // access, manager 권한은 가상 권한으로 설정 - $grant_list->access->title = Context::getLang('grant_access'); - $grant_list->access->default = 'guest'; - if(count($source_grant_list)) { - foreach($source_grant_list as $key => $val) { - if(!$val->default) $val->default = 'guest'; - if($val->default == 'root') $val->default = 'manager'; - $grant_list->{$key} = $val; - } - } - $grant_list->manager->title = Context::getLang('grant_manager'); - $grant_list->manager->default = 'manager'; - Context::set('grant_list', $grant_list); - - // 그룹을 가져옴 - $oMemberModel = &getModel('member'); - $group_list = $oMemberModel->getGroups($module_info->site_srl); - Context::set('group_list', $group_list); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('module_grant_setup'); - } - - /** - * @brief 언어 코드 - **/ - function dispModuleAdminLangcode() { - // 현재 사이트의 언어파일 가져오기 - $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); - - // 현재 선택된 언어 가져오기 - $name = Context::get('name'); - if($name) { - $oModuleAdminModel = &getAdminModel('module'); - Context::set('selected_lang', $oModuleAdminModel->getLangCode($args->site_srl,'$user_lang->'.$name)); - } - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('module_langcode'); - } - - } -?> +setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 모듈 관리자 페이지 + **/ + function dispModuleAdminContent() { + $this->dispModuleAdminList(); + } + + /** + * @brief 모듈 목록 출력 + **/ + function dispModuleAdminList() { + // 모듈 목록을 구해서 + $oModuleModel = &getModel('module'); + $module_list = $oModuleModel->getModuleList(); + Context::set('module_list', $module_list); + + // 템플릿 파일 지정 + $this->setTemplateFile('module_list'); + } + + /** + * @brief 모듈의 상세 정보(conf/info.xml)를 팝업 출력 + **/ + function dispModuleAdminInfo() { + // 모듈 목록을 구해서 + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoXml(Context::get('selected_module')); + Context::set('module_info', $module_info); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 파일 지정 + $this->setTemplateFile('module_info'); + } + + /** + * @brief 모듈 카테고리 목록 + **/ + function dispModuleAdminCategory() { + $module_category_srl = Context::get('module_category_srl'); + + // 모듈 목록을 구해서 + $oModuleModel = &getModel('module'); + + // 선택된 카테고리가 있으면 해당 카테고리의 정보 수정 페이지로 + if($module_category_srl) { + $selected_category = $oModuleModel->getModuleCategory($module_category_srl); + Context::set('selected_category', $selected_category); + + // 템플릿 파일 지정 + $this->setTemplateFile('category_update_form'); + + // 아니면 전체 목록 + } else { + $category_list = $oModuleModel->getModuleCategories(); + Context::set('category_list', $category_list); + + // 템플릿 파일 지정 + $this->setTemplateFile('category_list'); + } + } + + /** + * @brief 모듈 복사 기능 + **/ + function dispModuleAdminCopyModule() { + // 복사하려는 대상 모듈을 구함 + $module_srl = Context::get('module_srl'); + + // 해당 모듈의 정보를 구함 + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + Context::set('module_info', $module_info); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 파일 지정 + $this->setTemplateFile('copy_module'); + } + + /** + * @brief 모듈 기본 설정 일괄 적용 + **/ + function dispModuleAdminModuleSetup() { + $module_srls = Context::get('module_srls'); + + $modules = explode(',',$module_srls); + if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]); + + // 모듈의 스킨 목록을 구함 + $skin_list = $oModuleModel->getSkins('./modules/'.$module_info->module); + Context::set('skin_list',$skin_list); + + // 레이아웃 목록을 구해옴 + $oLayoutMode = &getModel('layout'); + $layout_list = $oLayoutMode->getLayoutList(); + Context::set('layout_list', $layout_list); + + // 모듈 카테고리 목록을 구함 + $module_category = $oModuleModel->getModuleCategories(); + Context::set('module_category', $module_category); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 파일 지정 + $this->setTemplateFile('module_setup'); + } + + /** + * @brief 모듈 추가 설정 일괄 적용 + **/ + 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로 받아오기에 미리 변수 선언만 해 놓음 + $content = ''; + + // 추가 설정을 위한 트리거 호출 + // 게시판 모듈이지만 차후 다른 모듈에서의 사용도 고려하여 trigger 이름을 공용으로 사용할 수 있도록 하였음 + $output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'before', $content); + $output = ModuleHandler::triggerCall('module.dispAdditionSetup', 'after', $content); + Context::set('setup_content', $content); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 파일 지정 + $this->setTemplateFile('module_addition_setup'); + } + + /** + * @brief 모듈 권한 설정 일괄 적용 + **/ + function dispModuleAdminModuleGrantSetup() { + $module_srls = Context::get('module_srls'); + + $modules = explode(',',$module_srls); + if(!count($modules)) if(!$module_srls) return new Object(-1,'msg_invalid_request'); + + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($modules[0]); + $xml_info = $oModuleModel->getModuleActionXml($module_info->module); + $source_grant_list = $xml_info->grant; + + // access, manager 권한은 가상 권한으로 설정 + $grant_list->access->title = Context::getLang('grant_access'); + $grant_list->access->default = 'guest'; + if(count($source_grant_list)) { + foreach($source_grant_list as $key => $val) { + if(!$val->default) $val->default = 'guest'; + if($val->default == 'root') $val->default = 'manager'; + $grant_list->{$key} = $val; + } + } + $grant_list->manager->title = Context::getLang('grant_manager'); + $grant_list->manager->default = 'manager'; + Context::set('grant_list', $grant_list); + + // 그룹을 가져옴 + $oMemberModel = &getModel('member'); + $group_list = $oMemberModel->getGroups($module_info->site_srl); + Context::set('group_list', $group_list); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 파일 지정 + $this->setTemplateFile('module_grant_setup'); + } + + /** + * @brief 언어 코드 + **/ + function dispModuleAdminLangcode() { + // 현재 사이트의 언어파일 가져오기 + $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); + + // 현재 선택된 언어 가져오기 + $name = Context::get('name'); + if($name) { + $oModuleAdminModel = &getAdminModel('module'); + Context::set('selected_lang', $oModuleAdminModel->getLangCode($args->site_srl,'$user_lang->'.$name)); + } + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 파일 지정 + $this->setTemplateFile('module_langcode'); + } + + } +?> diff --git a/modules/module/module.class.php b/modules/module/module.class.php index c8809298f..487e8c100 100644 --- a/modules/module/module.class.php +++ b/modules/module/module.class.php @@ -1,367 +1,367 @@ -addIndex("modules","idx_site_mid", array("site_srl","mid"), true); - $oDB->addIndex('sites','unique_domain',array('domain'),true); - - // module 모듈에서 사용할 디렉토리 생성 - FileHandler::makeDir('./files/cache/module_info'); - FileHandler::makeDir('./files/cache/triggers'); - - // sites 테이블에 기본 사이트 정보 입력 - $args->site_srl = 0; - $output = $oDB->executeQuery('module.getSite', $args); - if(!$output->data || !$output->data->index_module_srl) { - $db_info = Context::getDBInfo(); - $domain = Context::getDefaultUrl(); - $url_info = parse_url($domain); - $domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path']; - $site_args->site_srl = 0; - $site_args->index_module_srl = 0; - $site_args->domain = $domain; - $site_args->default_language = $db_info->lang_type; - - $output = executeQuery('module.insertSite', $site_args); - if(!$output->toBool()) return $output; - } - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oDB = &DB::getInstance(); - - // 2008. 10. 27 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 - if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true; - - // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트 - if($oDB->isColumnExists('modules', 'grants')) return true; - - // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트 - if(!$oDB->isColumnExists('sites', 'default_language')) return true; - - // extra_vars* 컬럼 제거 - for($i=1;$i<=20;$i++) { - if($oDB->isColumnExists("documents","extra_vars".$i)) return true; - } - - // sites 테이블에 기본 사이트 정보 입력 - $args->site_srl = 0; - $output = $oDB->executeQuery('module.getSite', $args); - if(!$output->data) return true; - - // sites 테이블에서 도메인이 인덱스로 걸린경우 - if($oDB->isIndexExists('sites', 'idx_domain')) return true; - if(!$oDB->isIndexExists('sites','unique_domain')) return true; - - if(!$oDB->isColumnExists("modules", "use_mobile")) return true; - if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true; - if(!$oDB->isColumnExists("modules", "mcontent")) return true; - if(!$oDB->isColumnExists("modules", "mskin")) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB = &DB::getInstance(); - - // 2008. 10. 27 module_part_config 테이블의 결합 인덱스 추가하고 기존에 module_config에 몰려 있던 모든 정보를 재점검 - if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) { - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - $modules = $oModuleModel->getModuleList(); - foreach($modules as $key => $module_info) { - $module = $module_info->module; - if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue; - $config = $oModuleModel->getModuleConfig($module); - - $module_config = null; - switch($module) { - case 'point' : - $module_config = $config->module_point; - unset($config->module_point); - break; - case 'trackback' : - case 'rss' : - case 'file' : - case 'comment' : - case 'editor' : - $module_config = $config->module_config; - unset($config->module_config); - if(is_array($module_config) && count($module_config)) { - foreach($module_config as $key => $val) { - if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl); - } - } - break; - case 'layout' : - $tmp = $config->header_script; - if(is_array($tmp) && count($tmp)) { - foreach($tmp as $k => $v) { - if(!$v && !trim($v)) continue; - $module_config[$k]->header_script = $v; - } - } - $config = null; - break; - - } - - $oModuleController->insertModuleConfig($module, $config); - - if(is_array($module_config) && count($module_config)) { - foreach($module_config as $module_srl => $module_part_config) { - $oModuleController->insertModulePartConfig($module,$module_srl,$module_part_config); - } - } - } - $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 - 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 확장변수의 확장을 위한 처리 - 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 테이블로 이전시키는 업데이트 - if($oDB->isColumnExists('modules', 'grants')) { - $oModuleController = &getController('module'); - $oDocumentController = &getController('document'); - - // 현재 시스템 언어 코드값을 가져옴 - $lang_code = Context::getLangType(); - - // 모든 모듈의 module_info를 가져옴 - $output = executeQueryArray('module.getModuleInfos'); - if(count($output->data)) { - foreach($output->data as $module_info) { - // 모듈들의 권한/ 확장변수(게시글 확장 포함)/ 스킨 변수/ 최고관리권한 정보 분리 - $module_srl = trim($module_info->module_srl); - - // 권한 등록 - $grants = unserialize($module_info->grants); - if($grants) $oModuleController->insertModuleGrants($module_srl, $grants); - - // 스킨 변수 등록 - $skin_vars = unserialize($module_info->skin_vars); - if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars); - - // 최고 관리자 아이디 등록 - $admin_id = trim($module_info->admin_id); - if($admin_id && $admin_id != 'Array') { - $admin_ids = explode(',',$admin_id); - if(count($admin_id)) { - foreach($admin_ids as $admin_id) { - $oModuleController->insertAdminId($module_srl, $admin_id); - } - } - } - - // 모듈별 추가 설정 저장 (기본 modules에 없던 컬럼 데이터) - $extra_vars = unserialize($module_info->extra_vars); - $document_extra_keys = null; - if($extra_vars->extra_vars && count($extra_vars->extra_vars)) { - $document_extra_keys = $extra_vars->extra_vars; - unset($extra_vars->extra_vars); - } - if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars); - - /** - * 게시글 확장변수 이동 (documents모듈에서 해야 하지만 modules 테이블의 추가 변수들이 정리되기에 여기서 함) - **/ - // 플래닛모듈의 경우 직접 추가 변수 입력 - if($module_info->module == 'planet') { - if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array(); - $planet_extra_keys->name = 'postscript'; - $planet_extra_keys->type = 'text'; - $planet_extra_keys->is_required = 'N'; - $planet_extra_keys->search = 'N'; - $planet_extra_keys->default = ''; - $planet_extra_keys->desc = ''; - $document_extra_keys[20] = $planet_extra_keys; - } - - // 게시글 확장변수 키 등록 - 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개의 확장 변수만 이전되는 문제점 수정 - $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; - - // 확장변수가 존재하면 확장변수 가져오기 - $doc_args = null; - $doc_args->module_srl = $module_srl; - $doc_args->list_count = $per_page; - $doc_args->sort_index = 'list_order'; - $doc_args->order_type = 'asc'; - - for ($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++) { - $output = executeQueryArray('document.getDocumentList', $doc_args); - - if ($output->toBool() && $output->data && count($output->data)) { - foreach ($output->data as $document) { - if (!$document) continue; - foreach ($document as $key => $var) { - if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue; - $var_idx = str_replace('extra_vars','',$key); - $oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code); - } - } - } - } // for total_pages - } // if count - } - - // 해당 모듈들의 추가 변수들 제거 - $module_info->grant = null; - $module_info->extra_vars = null; - $module_info->skin_vars = null; - $module_info->admin_id = null; - executeQuery('module.updateModule', $module_info); - } - } - - // 각종 column drop - $oDB->dropColumn('modules','grants'); - $oDB->dropColumn('modules','admin_id'); - $oDB->dropColumn('modules','skin_vars'); - $oDB->dropColumn('modules','extra_vars'); - } - - // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트 - if(!$oDB->isColumnExists('sites', 'default_language')) { - $oDB->addColumn('sites','default_language','varchar',255,0,false); - } - - // extra_vars* 컬럼 제거 - for($i=1;$i<=20;$i++) { - if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue; - $oDB->dropColumn('documents','extra_vars'.$i); - } - - // sites 테이블에 기본 사이트 정보 입력 - $args->site_srl = 0; - $output = $oDB->executeQuery('module.getSite', $args); - if(!$output->data) { - // 기본 mid, 언어 구함 - $mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args); - $db_info = Context::getDBInfo(); - $domain = Context::getDefaultUrl(); - $url_info = parse_url($domain); - $domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path']; - $site_args->site_srl = 0; - $site_args->index_module_srl = $mid_output->data->module_srl; - $site_args->domain = $domain; - $site_args->default_language = $db_info->lang_type; - - $output = executeQuery('module.insertSite', $site_args); - if(!$output->toBool()) return $output; - } - - if($oDB->isIndexExists('sites','idx_domain')){ - $oDB->dropIndex('sites','idx_domain'); - } - if(!$oDB->isIndexExists('sites','unique_domain')){ - $this->updateForUniqueSiteDomain(); - $oDB->addIndex('sites','unique_domain',array('domain'),true); - } - - if(!$oDB->isColumnExists("modules", "use_mobile")) { - $oDB->addColumn('modules','use_mobile','char',1,'N'); - } - if(!$oDB->isColumnExists("modules", "mlayout_srl")) { - $oDB->addColumn('modules','mlayout_srl','number',11, 0); - } - if(!$oDB->isColumnExists("modules", "mcontent")) { - $oDB->addColumn('modules','mcontent','bigtext'); - } - if(!$oDB->isColumnExists("modules", "mskin")) { - $oDB->addColumn('modules','mskin','varchar',250); - } - - return new Object(0, 'success_updated'); - } - - function updateForUniqueSiteDomain() - { - $output = executeQueryArray("module.getNonuniqueDomains"); - if(!$output->data) return; - foreach($output->data as $data) - { - if($data->count == 1) continue; - $domain = $data->domain; - $args = null; - $args->domain = $domain; - $output2 = executeQueryArray("module.getSiteByDomain", $args); - $bFirst = true; - foreach($output2->data as $site) - { - if($bFirst) - { - $bFirst = false; - continue; - } - $domain .= "_"; - $args = null; - $args->domain = $domain; - $args->site_srl = $site->site_srl; - $output3 = executeQuery("module.updateSite", $args); - } - } - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - // 모듈 정보 캐시 파일 모두 삭제 - FileHandler::removeFilesInDir("./files/cache/module_info"); - - // 트리거 정보가 있는 파일 모두 삭제 - FileHandler::removeFilesInDir("./files/cache/triggers"); - - // DB캐시 파일을 모두 삭제 - FileHandler::removeFilesInDir("./files/cache/db"); - - // 기타 캐시 삭제 - FileHandler::removeDir("./files/cache/tmp"); - } - } -?> +addIndex("modules","idx_site_mid", array("site_srl","mid"), true); + $oDB->addIndex('sites','unique_domain',array('domain'),true); + + // module 모듈에서 사용할 디렉토리 생성 + FileHandler::makeDir('./files/cache/module_info'); + FileHandler::makeDir('./files/cache/triggers'); + + // sites 테이블에 기본 사이트 정보 입력 + $args->site_srl = 0; + $output = $oDB->executeQuery('module.getSite', $args); + if(!$output->data || !$output->data->index_module_srl) { + $db_info = Context::getDBInfo(); + $domain = Context::getDefaultUrl(); + $url_info = parse_url($domain); + $domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path']; + $site_args->site_srl = 0; + $site_args->index_module_srl = 0; + $site_args->domain = $domain; + $site_args->default_language = $db_info->lang_type; + + $output = executeQuery('module.insertSite', $site_args); + if(!$output->toBool()) return $output; + } + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oDB = &DB::getInstance(); + + // 2008. 10. 27 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 + if(!$oDB->isIndexExists('modules',"idx_site_mid")) return true; + + // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트 + if($oDB->isColumnExists('modules', 'grants')) return true; + + // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트 + if(!$oDB->isColumnExists('sites', 'default_language')) return true; + + // extra_vars* 컬럼 제거 + for($i=1;$i<=20;$i++) { + if($oDB->isColumnExists("documents","extra_vars".$i)) return true; + } + + // sites 테이블에 기본 사이트 정보 입력 + $args->site_srl = 0; + $output = $oDB->executeQuery('module.getSite', $args); + if(!$output->data) return true; + + // sites 테이블에서 도메인이 인덱스로 걸린경우 + if($oDB->isIndexExists('sites', 'idx_domain')) return true; + if(!$oDB->isIndexExists('sites','unique_domain')) return true; + + if(!$oDB->isColumnExists("modules", "use_mobile")) return true; + if(!$oDB->isColumnExists("modules", "mlayout_srl")) return true; + if(!$oDB->isColumnExists("modules", "mcontent")) return true; + if(!$oDB->isColumnExists("modules", "mskin")) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB = &DB::getInstance(); + + // 2008. 10. 27 module_part_config 테이블의 결합 인덱스 추가하고 기존에 module_config에 몰려 있던 모든 정보를 재점검 + if(!$oDB->isIndexExists("module_part_config","idx_module_part_config")) { + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + $modules = $oModuleModel->getModuleList(); + foreach($modules as $key => $module_info) { + $module = $module_info->module; + if(!in_array($module, array('point','trackback','layout','rss','file','comment','editor'))) continue; + $config = $oModuleModel->getModuleConfig($module); + + $module_config = null; + switch($module) { + case 'point' : + $module_config = $config->module_point; + unset($config->module_point); + break; + case 'trackback' : + case 'rss' : + case 'file' : + case 'comment' : + case 'editor' : + $module_config = $config->module_config; + unset($config->module_config); + if(is_array($module_config) && count($module_config)) { + foreach($module_config as $key => $val) { + if(isset($module_config[$key]->module_srl)) unset($module_config[$key]->module_srl); + } + } + break; + case 'layout' : + $tmp = $config->header_script; + if(is_array($tmp) && count($tmp)) { + foreach($tmp as $k => $v) { + if(!$v && !trim($v)) continue; + $module_config[$k]->header_script = $v; + } + } + $config = null; + break; + + } + + $oModuleController->insertModuleConfig($module, $config); + + if(is_array($module_config) && count($module_config)) { + foreach($module_config as $module_srl => $module_part_config) { + $oModuleController->insertModulePartConfig($module,$module_srl,$module_part_config); + } + } + } + $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 + 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 확장변수의 확장을 위한 처리 + 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 테이블로 이전시키는 업데이트 + if($oDB->isColumnExists('modules', 'grants')) { + $oModuleController = &getController('module'); + $oDocumentController = &getController('document'); + + // 현재 시스템 언어 코드값을 가져옴 + $lang_code = Context::getLangType(); + + // 모든 모듈의 module_info를 가져옴 + $output = executeQueryArray('module.getModuleInfos'); + if(count($output->data)) { + foreach($output->data as $module_info) { + // 모듈들의 권한/ 확장변수(게시글 확장 포함)/ 스킨 변수/ 최고관리권한 정보 분리 + $module_srl = trim($module_info->module_srl); + + // 권한 등록 + $grants = unserialize($module_info->grants); + if($grants) $oModuleController->insertModuleGrants($module_srl, $grants); + + // 스킨 변수 등록 + $skin_vars = unserialize($module_info->skin_vars); + if($skin_vars) $oModuleController->insertModuleSkinVars($module_srl, $skin_vars); + + // 최고 관리자 아이디 등록 + $admin_id = trim($module_info->admin_id); + if($admin_id && $admin_id != 'Array') { + $admin_ids = explode(',',$admin_id); + if(count($admin_id)) { + foreach($admin_ids as $admin_id) { + $oModuleController->insertAdminId($module_srl, $admin_id); + } + } + } + + // 모듈별 추가 설정 저장 (기본 modules에 없던 컬럼 데이터) + $extra_vars = unserialize($module_info->extra_vars); + $document_extra_keys = null; + if($extra_vars->extra_vars && count($extra_vars->extra_vars)) { + $document_extra_keys = $extra_vars->extra_vars; + unset($extra_vars->extra_vars); + } + if($extra_vars) $oModuleController->insertModuleExtraVars($module_srl, $extra_vars); + + /** + * 게시글 확장변수 이동 (documents모듈에서 해야 하지만 modules 테이블의 추가 변수들이 정리되기에 여기서 함) + **/ + // 플래닛모듈의 경우 직접 추가 변수 입력 + if($module_info->module == 'planet') { + if(!$document_extra_keys || !is_array($document_extra_keys)) $document_extra_keys = array(); + $planet_extra_keys->name = 'postscript'; + $planet_extra_keys->type = 'text'; + $planet_extra_keys->is_required = 'N'; + $planet_extra_keys->search = 'N'; + $planet_extra_keys->default = ''; + $planet_extra_keys->desc = ''; + $document_extra_keys[20] = $planet_extra_keys; + } + + // 게시글 확장변수 키 등록 + 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개의 확장 변수만 이전되는 문제점 수정 + $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; + + // 확장변수가 존재하면 확장변수 가져오기 + $doc_args = null; + $doc_args->module_srl = $module_srl; + $doc_args->list_count = $per_page; + $doc_args->sort_index = 'list_order'; + $doc_args->order_type = 'asc'; + + for ($doc_args->page = 1; $doc_args->page <= $total_pages; $doc_args->page++) { + $output = executeQueryArray('document.getDocumentList', $doc_args); + + if ($output->toBool() && $output->data && count($output->data)) { + foreach ($output->data as $document) { + if (!$document) continue; + foreach ($document as $key => $var) { + if (strpos($key, 'extra_vars') !== 0 || !trim($var) || $var == 'N;') continue; + $var_idx = str_replace('extra_vars','',$key); + $oDocumentController->insertDocumentExtraVar($module_srl, $document->document_srl, $var_idx, $var, 'extra_vars'.$var_idx, $lang_code); + } + } + } + } // for total_pages + } // if count + } + + // 해당 모듈들의 추가 변수들 제거 + $module_info->grant = null; + $module_info->extra_vars = null; + $module_info->skin_vars = null; + $module_info->admin_id = null; + executeQuery('module.updateModule', $module_info); + } + } + + // 각종 column drop + $oDB->dropColumn('modules','grants'); + $oDB->dropColumn('modules','admin_id'); + $oDB->dropColumn('modules','skin_vars'); + $oDB->dropColumn('modules','extra_vars'); + } + + // 모든 모듈의 권한/스킨정보를 grants 테이블로 이전시키는 업데이트 + if(!$oDB->isColumnExists('sites', 'default_language')) { + $oDB->addColumn('sites','default_language','varchar',255,0,false); + } + + // extra_vars* 컬럼 제거 + for($i=1;$i<=20;$i++) { + if(!$oDB->isColumnExists("documents","extra_vars".$i)) continue; + $oDB->dropColumn('documents','extra_vars'.$i); + } + + // sites 테이블에 기본 사이트 정보 입력 + $args->site_srl = 0; + $output = $oDB->executeQuery('module.getSite', $args); + if(!$output->data) { + // 기본 mid, 언어 구함 + $mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args); + $db_info = Context::getDBInfo(); + $domain = Context::getDefaultUrl(); + $url_info = parse_url($domain); + $domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path']; + $site_args->site_srl = 0; + $site_args->index_module_srl = $mid_output->data->module_srl; + $site_args->domain = $domain; + $site_args->default_language = $db_info->lang_type; + + $output = executeQuery('module.insertSite', $site_args); + if(!$output->toBool()) return $output; + } + + if($oDB->isIndexExists('sites','idx_domain')){ + $oDB->dropIndex('sites','idx_domain'); + } + if(!$oDB->isIndexExists('sites','unique_domain')){ + $this->updateForUniqueSiteDomain(); + $oDB->addIndex('sites','unique_domain',array('domain'),true); + } + + if(!$oDB->isColumnExists("modules", "use_mobile")) { + $oDB->addColumn('modules','use_mobile','char',1,'N'); + } + if(!$oDB->isColumnExists("modules", "mlayout_srl")) { + $oDB->addColumn('modules','mlayout_srl','number',11, 0); + } + if(!$oDB->isColumnExists("modules", "mcontent")) { + $oDB->addColumn('modules','mcontent','bigtext'); + } + if(!$oDB->isColumnExists("modules", "mskin")) { + $oDB->addColumn('modules','mskin','varchar',250); + } + + return new Object(0, 'success_updated'); + } + + function updateForUniqueSiteDomain() + { + $output = executeQueryArray("module.getNonuniqueDomains"); + if(!$output->data) return; + foreach($output->data as $data) + { + if($data->count == 1) continue; + $domain = $data->domain; + $args = null; + $args->domain = $domain; + $output2 = executeQueryArray("module.getSiteByDomain", $args); + $bFirst = true; + foreach($output2->data as $site) + { + if($bFirst) + { + $bFirst = false; + continue; + } + $domain .= "_"; + $args = null; + $args->domain = $domain; + $args->site_srl = $site->site_srl; + $output3 = executeQuery("module.updateSite", $args); + } + } + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + // 모듈 정보 캐시 파일 모두 삭제 + FileHandler::removeFilesInDir("./files/cache/module_info"); + + // 트리거 정보가 있는 파일 모두 삭제 + FileHandler::removeFilesInDir("./files/cache/triggers"); + + // DB캐시 파일을 모두 삭제 + FileHandler::removeFilesInDir("./files/cache/db"); + + // 기타 캐시 삭제 + FileHandler::removeDir("./files/cache/tmp"); + } + } +?> diff --git a/modules/module/module.controller.php b/modules/module/module.controller.php index 5c367b229..298455ccf 100644 --- a/modules/module/module.controller.php +++ b/modules/module/module.controller.php @@ -1,757 +1,757 @@ -module = $module; - $args->type = $type; - $args->act = $act; - - $output = executeQuery('module.insertActionForward', $args); - return $output; - } - - /** - * @brief action forward 삭제 - **/ - function deleteActionForward($module, $type, $act) { - $args->module = $module; - $args->type = $type; - $args->act = $act; - - $output = executeQuery('module.deleteActionForward', $args); - return $output; - } - - /** - * @brief module trigger 추가 - * module trigger는 trigger 대상이 등록된 대상을 호출하는 방법이다. - * - **/ - function insertTrigger($trigger_name, $module, $type, $called_method, $called_position) { - $args->trigger_name = $trigger_name; - $args->module = $module; - $args->type = $type; - $args->called_method = $called_method; - $args->called_position = $called_position; - - $output = executeQuery('module.insertTrigger', $args); - - // 트리거 정보가 있는 파일 모두 삭제 - FileHandler::removeFilesInDir("./files/cache/triggers"); - - return $output; - } - - /** - * @brief module trigger 삭제 - * - **/ - function deleteTrigger($trigger_name, $module, $type, $called_method, $called_position) { - $args->trigger_name = $trigger_name; - $args->module = $module; - $args->type = $type; - $args->called_method = $called_method; - $args->called_position = $called_position; - - $output = executeQuery('module.deleteTrigger', $args); - - // 트리거 캐시 삭제 - FileHandler::removeFilesInDir('./files/cache/triggers'); - - return $output; - } - - /** - * @brief module extend 추가 - * - **/ - function insertModuleExtend($parent_module, $extend_module, $type, $kind=''){ - if($kind != 'admin') $kind = ''; - if(!in_array($type,array('model','controller','view','api','mobile'))) return false; - if(in_array($parent_module, array('module','addon','widget','layout'))) return false; - - $cache_file = './files/config/module_extend.php'; - FileHandler::removeFile($cache_file); - - $args->parent_module = $parent_module; - $args->extend_module = $extend_module; - $args->type = $type; - $args->kind = $kind; - - $output = executeQuery('module.getModuleExtendCount', $args); - if($output->data->count>0) return false; - - $output = executeQuery('module.insertModuleExtend', $args); - return $output; - } - - /** - * @brief module extend 삭제 - * - **/ - function deleteModuleExtend($parent_module, $extend_module, $type, $kind=''){ - $cache_file = './files/config/module_extend.php'; - FileHandler::removeFile($cache_file); - - $args->parent_module = $parent_module; - $args->extend_module = $extend_module; - $args->type = $type; - $args->kind = $kind; - - $output = executeQuery('module.deleteModuleExtend', $args); - - return $output; - } - - /** - * @brief 특정 모듈의 설정 입력 - * board, member등 특정 모듈의 global config 관리용 - **/ - function insertModuleConfig($module, $config) { - $args->module = $module; - $args->config = serialize($config); - - $output = executeQuery('module.deleteModuleConfig', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('module.insertModuleConfig', $args); - return $output; - } - - /** - * @brief 특정 mid의 모듈 설정 정보 저장 - * mid의 모듈 의존적인 설정을 관리 - **/ - function insertModulePartConfig($module, $module_srl, $config) { - $args->module = $module; - $args->module_srl = $module_srl; - $args->config = serialize($config); - - $output = executeQuery('module.deleteModulePartConfig', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('module.insertModulePartConfig', $args); - return $output; - } - - /** - * @brief virtual site 생성 - **/ - function insertSite($domain, $index_module_srl) { - if(isSiteID($domain)) { - $oModuleModel = &getModel('module'); - if($oModuleModel->isIDExists($domain, 0)) return new Object(-1,'msg_already_registed_vid'); - }else{ - $domain = strtolower($domain); - } - - $args->site_srl = getNextSequence(); - $args->domain = preg_replace('/\/$/','',$domain); - $args->index_module_srl = $index_module_srl; - $args->default_language = Context::getLangType(); - $output = executeQuery('module.getSiteInfoByDomain', $args); - if($output->data) return new Object(-1,'msg_already_registed_vid'); - - $output = executeQuery('module.insertSite', $args); - if(!$output->toBool()) return $output; - - $output->add('site_srl', $args->site_srl); - return $output; - } - - /** - * @brief virtual site 수정 - **/ - function updateSite($args) { - $oModuleModel = &getModel('module'); - $site_info = $oModuleModel->getSiteInfo($args->site_srl); - if($site_info->domain != $args->domain) { - $info = $oModuleModel->getSiteInfoByDomain($args->domain); - if($info->site_srl && $info->site_srl != $args->site_srl) return new Object(-1,'msg_already_registed_domain'); - if(isSiteID($args->domain) && $oModuleModel->isIDExists($args->domain)) return new Object(-1,'msg_already_registed_vid'); - - if($args->domain && !isSiteID($args->domain)) { - $args->domain = strtolower($args->domain); - } - - } - $output = executeQuery('module.updateSite', $args); - return $output; - } - - /** - * @brief 모듈 정보 정리 - **/ - function arrangeModuleInfo(&$args, &$extra_vars) { - // 불필요한 내용 제거 - unset($args->body); - unset($args->act); - unset($args->page); - - // mid값 검사 - if(!preg_match("/^[a-z][a-z0-9_]+$/i", $args->mid)) return new Object(-1, 'msg_limit_mid'); - - // 변수를 검사 (modules의 기본 변수와 그렇지 않은 변수로 분리) - $extra_vars = clone($args); - unset($extra_vars->module_srl); - unset($extra_vars->module); - unset($extra_vars->module_category_srl); - unset($extra_vars->layout_srl); - unset($extra_vars->mlayout_srl); - unset($extra_vars->use_mobile); - unset($extra_vars->menu_srl); - unset($extra_vars->site_srl); - unset($extra_vars->mid); - unset($extra_vars->skin); - unset($extra_vars->mskin); - unset($extra_vars->browser_title); - unset($extra_vars->description); - unset($extra_vars->is_default); - unset($extra_vars->content); - unset($extra_vars->mcontent); - unset($extra_vars->open_rss); - unset($extra_vars->header_text); - unset($extra_vars->footer_text); - $args = delObjectVars($args, $extra_vars); - - return new Object(); - } - - /** - * @brief 모듈 입력 - **/ - function insertModule($args) { - $output = $this->arrangeModuleInfo($args, $extra_vars); - if(!$output->toBool()) return $output; - - // 이미 존재하는 모듈 이름인지 체크 - 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'); - - // begin transaction - $oDB = &DB::getInstance(); - $oDB->begin(); - - // 선택된 스킨정보에서 colorset을 구함 - $module_path = ModuleHandler::getModulePath($args->module); - $skin_info = $oModuleModel->loadSkinInfo($module_path, $args->skin); - $skin_vars->colorset = $skin_info->colorset[0]->name; - - // 변수 정리후 query 실행 - if(!$args->module_srl) $args->module_srl = getNextSequence(); - - // 모듈 등록 - $output = executeQuery('module.insertModule', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 모듈 추가 변수 등록 - $this->insertModuleExtraVars($args->module_srl, $extra_vars); - - // commit - $oDB->commit(); - - $output->add('module_srl',$args->module_srl); - return $output; - } - - /** - * @brief 모듈의 정보를 수정 - **/ - function updateModule($args) { - $output = $this->arrangeModuleInfo($args, $extra_vars); - if(!$output->toBool()) return $output; - - // begin transaction - $oDB = &DB::getInstance(); - $oDB->begin(); - - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl); - - $args->site_srl = (int)$module_info->site_srl; - if(!$args->browser_title) $args->browser_title = $module_info->browser_title; - - $output = executeQuery('module.isExistsModuleName', $args); - if(!$output->toBool() || $output->data->count) { - $oDB->rollback(); - return new Object(-1, 'msg_module_name_exists'); - } - - $output = executeQuery('module.updateModule', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 모듈 추가 변수 등록 - $this->insertModuleExtraVars($args->module_srl, $extra_vars); - - $oDB->commit(); - - $output->add('module_srl',$args->module_srl); - return $output; - } - - /** - * @brief 모듈의 가상사이트 변경 - **/ - function updateModuleSite($module_srl, $site_srl, $layout_srl = 0) { - $args->module_srl = $module_srl; - $args->site_srl = $site_srl; - $args->layout_srl = $layout_srl; - return executeQuery('module.updateModuleSite', $args); - } - - /** - * @brief 모듈을 삭제 - * - * 모듈 삭제시는 관련 정보들을 모두 삭제 시도한다. - **/ - function deleteModule($module_srl) { - if(!$module_srl) return new Object(-1,'msg_invalid_request'); - - // trigger 호출 (before) - $trigger_obj->module_srl = $module_srl; - $output = ModuleHandler::triggerCall('module.deleteModule', 'before', $trigger_obj); - if(!$output->toBool()) return $output; - - // begin transaction - $oDB = &DB::getInstance(); - $oDB->begin(); - - $args->module_srl = $module_srl; - - // module 정보를 DB에서 삭제 - $output = executeQuery('module.deleteModule', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 권한 정보 삭제 - $this->deleteModuleGrants($module_srl); - - // 스킨 정보 삭제 - $this->deleteModuleSkinVars($module_srl); - - // 모듈 추가 변수 삭제 - $this->deleteModuleExtraVars($module_srl); - - // 모듈 관리자 제거 - $this->deleteAdminId($module_srl); - - // trigger 호출 (after) - if($output->toBool()) { - $trigger_output = ModuleHandler::triggerCall('module.deleteModule', 'after', $trigger_obj); - if(!$trigger_output->toBool()) { - $oDB->rollback(); - return $trigger_output; - } - } - - // commit - $oDB->commit(); - - return $output; - } - - /** - * @brief 모듈의 기타 정보를 변경 - **/ - function updateModuleSkinVars($module_srl, $skin_vars) { - // skin_vars 정보 세팅 - $args->module_srl = $module_srl; - $args->skin_vars = $skin_vars; - $output = executeQuery('module.updateModuleSkinVars', $args); - if(!$output->toBool()) return $output; - - return $output; - } - - /** - * @brief 모든 모듈의 is_default값을 N 으로 세팅 (기본 모듈 해제) - **/ - function clearDefaultModule() { - $output = executeQuery('module.clearDefaultModule'); - if(!$output->toBool()) return $output; - - return $output; - } - - /** - * @brief 지정된 menu_srl에 속한 mid 의 menu_srl 을 변경 - **/ - function updateModuleMenu($args) { - return executeQuery('module.updateModuleMenu', $args); - } - - /** - * @brief 지정된 menu_srl에 속한 mid 의 layout_srl을 변경 - **/ - function updateModuleLayout($layout_srl, $menu_srl_list) { - if(!count($menu_srl_list)) return; - - $args->layout_srl = $layout_srl; - $args->menu_srls = implode(',',$menu_srl_list); - $output = executeQuery('module.updateModuleLayout', $args); - return $output; - } - - /** - * @brief 사이트의 관리를 변경 - **/ - function insertSiteAdmin($site_srl, $arr_admins) { - // 사이트 관리자 제거 - $args->site_srl = $site_srl; - $output = executeQuery('module.deleteSiteAdmin', $args); - if(!$output->toBool()) return $output; - - // 관리자 대상 멤버 번호를 구함 - if(!is_array($arr_admins) || !count($arr_admins)) return new Object(); - foreach($arr_admins as $key => $user_id) { - if(!trim($user_id)) continue; - $admins[] = trim($user_id); - } - if(!count($admins)) return new Object(); - - $args->user_ids = '\''.implode('\',\'',$admins).'\''; - $output = executeQueryArray('module.getAdminSrls', $args); - if(!$output->toBool()||!$output->data) return $output; - - foreach($output->data as $key => $val) { - unset($args); - $args->site_srl = $site_srl; - $args->member_srl = $val->member_srl; - $output = executeQueryArray('module.insertSiteAdmin', $args); - if(!$output->toBool()) return $output; - } - return new Object(); - } - - /** - * @brief 특정 모듈에 관리자 아이디 지정 - **/ - function insertAdminId($module_srl, $admin_id) { - $oMemberModel = &getModel('member'); - $member_info = $oMemberModel->getMemberInfoByUserID($admin_id); - if(!$member_info->member_srl) return; - $args->module_srl = $module_srl; - $args->member_srl = $member_info->member_srl; - return executeQuery('module.insertAdminId', $args); - } - - /** - * @brief 특정 모듈의 관리자 아이디 제거 - **/ - function deleteAdminId($module_srl, $admin_id = '') { - $args->module_srl = $module_srl; - - if($admin_id) { - $oMemberModel = &getModel('member'); - $member_info = $oMemberModel->getMemberInfoByUserID($admin_id); - if($member_info->member_srl) $args->member_srl = $member_info->member_srl; - } - return executeQuery('module.deleteAdminId', $args); - } - - /** - * @brief 특정 모듈에 스킨 변수 등록 - **/ - function insertModuleSkinVars($module_srl, $obj) { - $this->deleteModuleSkinVars($module_srl); - if(!$obj || !count($obj)) return; - - $args->module_srl = $module_srl; - foreach($obj as $key => $val) { - // #17927989 예전 블로그 모듈을 사용하던 게시판의 경우 - // 스킨 정보 필드에 메뉴 항목(stdClass)을 저장해놓은 경우가 있어 - // 1.2.0 이상 버전으로 업그레이드한 후 모듈 업데이트할 때 - // 오류가 발생하는 문제 수정 - if (is_object($val)) continue; - if (is_array($val)) $val = serialize($val); - - $args->name = trim($key); - $args->value = trim($val); - if(!$args->name || !$args->value) continue; - executeQuery('module.insertModuleSkinVars', $args); - } - } - - /** - * @brief 특정 모듈의 스킨 변수 제거 - **/ - function deleteModuleSkinVars($module_srl) { - $args->module_srl = $module_srl; - return executeQuery('module.deleteModuleSkinVars', $args); - } - - /** - * @brief 특정 모듈에 확장 변수 등록 - **/ - function insertModuleExtraVars($module_srl, $obj) { - $this->deleteModuleExtraVars($module_srl); - if(!$obj || !count($obj)) return; - - foreach($obj as $key => $val) { - $args = null; - $args->module_srl = $module_srl; - $args->name = trim($key); - $args->value = trim($val); - if(!$args->name || !$args->value) continue; - executeQuery('module.insertModuleExtraVars', $args); - } - } - - /** - * @brief 특정 모듈의 확장 변수 제거 - **/ - function deleteModuleExtraVars($module_srl) { - $args->module_srl = $module_srl; - return executeQuery('module.deleteModuleExtraVars', $args); - } - - /** - * @brief 특정 모듈에 권한 등록 - **/ - function insertModuleGrants($module_srl, $obj) { - $this->deleteModuleGrants($module_srl); - if(!$obj || !count($obj)) return; - - foreach($obj as $name => $val) { - if(!$val || !count($val)) continue; - - foreach($val as $group_srl) { - $args = null; - $args->module_srl = $module_srl; - $args->name = $name; - $args->group_srl = trim($group_srl); - if(!$args->name || !$args->group_srl) continue; - executeQuery('module.insertModuleGrant', $args); - - } - } - } - - /** - * @brief 특정 모듈의 권한 제거 - **/ - function deleteModuleGrants($module_srl) { - $args->module_srl = $module_srl; - return executeQuery('module.deleteModuleGrants', $args); - } - - /** - * @brief 사용자 정의 언어 변경 - **/ - function replaceDefinedLangCode(&$output) { - $output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', array($this,'_replaceLangCode'), $output); - } - function _replaceLangCode($matches) { - static $lang = null; - if(is_null($lang)) { - $site_module_info = Context::get('site_module_info'); - $cache_file = sprintf('%sfiles/cache/lang_defined/%d.%s.php', _XE_PATH_, $site_module_info->site_srl, Context::getLangType()); - if(!file_exists($cache_file)) { - $oModuleAdminController = &getAdminController('module'); - $oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl); - } - - if(file_exists($cache_file)) require_once($cache_file); - } - if(!Context::get($matches[1]) && $lang[$matches[1]]) return $lang[$matches[1]]; - - return str_replace('$user_lang->','',$matches[0]); - } - - - /** - * @brief 파일박스에 파일 추가 및 업데이트 - **/ - function procModuleFileBoxAdd(){ - - $logged_info = Context::get('logged_info'); - if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted'); - - $vars = Context::gets('comment','addfile','filter'); - $module_filebox_srl = Context::get('module_filebox_srl'); - - $ext = strtolower(substr(strrchr($vars->addfile['name'],'.'),1)); - $vars->ext = $ext; - if($vars->filter) $filter = explode(',',$vars->filter); - else $filter = array('jpg','jpeg','gif','png'); - if(!in_array($ext,$filter)) return new Object(-1, 'msg_error_occured'); - - $vars->member_srl = $logged_info->member_srl; - - // update - if($module_filebox_srl > 0){ - $vars->module_filebox_srl = $module_filebox_srl; - $output = $this->updateModuleFileBox($vars); - - // insert - }else{ - if(!Context::isUploaded()) return new Object(-1, 'msg_error_occured'); - $addfile = Context::get('addfile'); - if(!is_uploaded_file($addfile['tmp_name'])) return new Object(-1, 'msg_error_occured'); - if($vars->addfile['error'] != 0) return new Object(-1, 'msg_error_occured'); - $output = $this->insertModuleFileBox($vars); - } - - $url = getUrl('','module','module','act','dispModuleFileBox','input',Context::get('input'),'filter',$vars->filter); - $url = html_entity_decode($url); - $vars = Context::set('url',$url); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('move_filebox_list'); - } - - - /** - * @brief 파일박스에 파일 업데이트 - **/ - function updateModuleFileBox($vars){ - - // have file - if($vars->addfile['tmp_name'] && is_uploaded_file($vars->addfile['tmp_name'])){ - $oModuleModel = &getModel('module'); - $output = $oModuleModel->getModuleFileBox($vars->module_filebox_srl); - FileHandler::removeFile($output->data->filename); - - $path = $oModuleModel->getModuleFileBoxPath($vars->module_filebox_srl); - FileHandler::makeDir($path); - - $save_filename = sprintf('%s%s.%s',$path, $vars->module_filebox_srl, $ext); - $tmp = $vars->addfile['tmp_name']; - - if(!@move_uploaded_file($tmp, $save_filename)) { - return false; - } - - $args->fileextension = strtolower(substr(strrchr($vars->addfile['name'],'.'),1)); - $args->filename = $save_filename; - $args->filesize = $vars->addfile['size']; - - } - - $args->module_filebox_srl = $vars->module_filebox_srl; - $args->comment = $vars->comment; - - return executeQuery('module.updateModuleFileBox', $vars); - } - - - /** - * @brief 파일박스에 파일 추가 - **/ - function insertModuleFileBox($vars){ - // set module_filebox_srl - $vars->module_filebox_srl = getNextSequence(); - - // get file path - $oModuleModel = &getModel('module'); - $path = $oModuleModel->getModuleFileBoxPath($vars->module_filebox_srl); - FileHandler::makeDir($path); - $save_filename = sprintf('%s%s.%s',$path, $vars->module_filebox_srl, $vars->ext); - $tmp = $vars->addfile['tmp_name']; - - // upload - if(!@move_uploaded_file($tmp, $save_filename)) { - return false; - } - - - // insert - $args->module_filebox_srl = $vars->module_filebox_srl; - $args->member_srl = $vars->member_srl; - $args->comment = $vars->comment; - $args->filename = $save_filename; - $args->fileextension = strtolower(substr(strrchr($vars->addfile['name'],'.'),1)); - $args->filesize = $vars->addfile['size']; - - $output = executeQuery('module.insertModuleFileBox', $args); - return $output; - } - - - /** - * @brief 파일박스에 파일 삭제 - **/ - - function procModuleFileBoxDelete(){ - $logged_info = Context::get('logged_info'); - if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted'); - - $module_filebox_srl = Context::get('module_filebox_srl'); - if(!$module_filebox_srl) return new Object(-1, 'msg_invalid_request'); - $vars->module_filebox_srl = $module_filebox_srl; - $output = $this->deleteModuleFileBox($vars); - if(!$output->toBool()) return $output; - } - - function deleteModuleFileBox($vars){ - - // delete real file - $oModuleModel = &getModel('module'); - $output = $oModuleModel->getModuleFileBox($vars->module_filebox_srl); - FileHandler::removeFile($output->data->filename); - - $args->module_filebox_srl = $vars->module_filebox_srl; - return executeQuery('module.deleteModuleFileBox', $args); - } - - /** - * @brief function of locking (timeout is in seconds) - */ - function lock($lock_name, $timeout, $member_srl = null) { - $this->unlockTimeoutPassed(); - $args->lock_name = $lock_name; - if(!$timeout) $timeout = 60; - $args->deadline = date("YmdHis", time() + $timeout); - if($member_srl) $args->member_srl = $member_srl; - $output = executeQuery('module.insertLock', $args); - if($output->toBool()) { - $output->add('lock_name', $lock_name); - $output->add('deadline', $args->deadline); - } - return $output; - } - - function unlockTimeoutPassed() { - executeQuery('module.deleteLocksTimeoutPassed'); - } - - function unlock($lock_name, $deadline) { - $args->lock_name = $lock_name; - $args->deadline = $deadline; - $output = executeQuery('module.deleteLock', $args); - return $output; - } - - function updateModuleInSites($site_srls, $args) - { - $args->site_srls = $site_srls; - $output = executeQuery('module.updateModuleInSites', $args); - return $output; - } - } -?> +module = $module; + $args->type = $type; + $args->act = $act; + + $output = executeQuery('module.insertActionForward', $args); + return $output; + } + + /** + * @brief action forward 삭제 + **/ + function deleteActionForward($module, $type, $act) { + $args->module = $module; + $args->type = $type; + $args->act = $act; + + $output = executeQuery('module.deleteActionForward', $args); + return $output; + } + + /** + * @brief module trigger 추가 + * module trigger는 trigger 대상이 등록된 대상을 호출하는 방법이다. + * + **/ + function insertTrigger($trigger_name, $module, $type, $called_method, $called_position) { + $args->trigger_name = $trigger_name; + $args->module = $module; + $args->type = $type; + $args->called_method = $called_method; + $args->called_position = $called_position; + + $output = executeQuery('module.insertTrigger', $args); + + // 트리거 정보가 있는 파일 모두 삭제 + FileHandler::removeFilesInDir("./files/cache/triggers"); + + return $output; + } + + /** + * @brief module trigger 삭제 + * + **/ + function deleteTrigger($trigger_name, $module, $type, $called_method, $called_position) { + $args->trigger_name = $trigger_name; + $args->module = $module; + $args->type = $type; + $args->called_method = $called_method; + $args->called_position = $called_position; + + $output = executeQuery('module.deleteTrigger', $args); + + // 트리거 캐시 삭제 + FileHandler::removeFilesInDir('./files/cache/triggers'); + + return $output; + } + + /** + * @brief module extend 추가 + * + **/ + function insertModuleExtend($parent_module, $extend_module, $type, $kind=''){ + if($kind != 'admin') $kind = ''; + if(!in_array($type,array('model','controller','view','api','mobile'))) return false; + if(in_array($parent_module, array('module','addon','widget','layout'))) return false; + + $cache_file = './files/config/module_extend.php'; + FileHandler::removeFile($cache_file); + + $args->parent_module = $parent_module; + $args->extend_module = $extend_module; + $args->type = $type; + $args->kind = $kind; + + $output = executeQuery('module.getModuleExtendCount', $args); + if($output->data->count>0) return false; + + $output = executeQuery('module.insertModuleExtend', $args); + return $output; + } + + /** + * @brief module extend 삭제 + * + **/ + function deleteModuleExtend($parent_module, $extend_module, $type, $kind=''){ + $cache_file = './files/config/module_extend.php'; + FileHandler::removeFile($cache_file); + + $args->parent_module = $parent_module; + $args->extend_module = $extend_module; + $args->type = $type; + $args->kind = $kind; + + $output = executeQuery('module.deleteModuleExtend', $args); + + return $output; + } + + /** + * @brief 특정 모듈의 설정 입력 + * board, member등 특정 모듈의 global config 관리용 + **/ + function insertModuleConfig($module, $config) { + $args->module = $module; + $args->config = serialize($config); + + $output = executeQuery('module.deleteModuleConfig', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('module.insertModuleConfig', $args); + return $output; + } + + /** + * @brief 특정 mid의 모듈 설정 정보 저장 + * mid의 모듈 의존적인 설정을 관리 + **/ + function insertModulePartConfig($module, $module_srl, $config) { + $args->module = $module; + $args->module_srl = $module_srl; + $args->config = serialize($config); + + $output = executeQuery('module.deleteModulePartConfig', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('module.insertModulePartConfig', $args); + return $output; + } + + /** + * @brief virtual site 생성 + **/ + function insertSite($domain, $index_module_srl) { + if(isSiteID($domain)) { + $oModuleModel = &getModel('module'); + if($oModuleModel->isIDExists($domain, 0)) return new Object(-1,'msg_already_registed_vid'); + }else{ + $domain = strtolower($domain); + } + + $args->site_srl = getNextSequence(); + $args->domain = preg_replace('/\/$/','',$domain); + $args->index_module_srl = $index_module_srl; + $args->default_language = Context::getLangType(); + $output = executeQuery('module.getSiteInfoByDomain', $args); + if($output->data) return new Object(-1,'msg_already_registed_vid'); + + $output = executeQuery('module.insertSite', $args); + if(!$output->toBool()) return $output; + + $output->add('site_srl', $args->site_srl); + return $output; + } + + /** + * @brief virtual site 수정 + **/ + function updateSite($args) { + $oModuleModel = &getModel('module'); + $site_info = $oModuleModel->getSiteInfo($args->site_srl); + if($site_info->domain != $args->domain) { + $info = $oModuleModel->getSiteInfoByDomain($args->domain); + if($info->site_srl && $info->site_srl != $args->site_srl) return new Object(-1,'msg_already_registed_domain'); + if(isSiteID($args->domain) && $oModuleModel->isIDExists($args->domain)) return new Object(-1,'msg_already_registed_vid'); + + if($args->domain && !isSiteID($args->domain)) { + $args->domain = strtolower($args->domain); + } + + } + $output = executeQuery('module.updateSite', $args); + return $output; + } + + /** + * @brief 모듈 정보 정리 + **/ + function arrangeModuleInfo(&$args, &$extra_vars) { + // 불필요한 내용 제거 + unset($args->body); + unset($args->act); + unset($args->page); + + // mid값 검사 + if(!preg_match("/^[a-z][a-z0-9_]+$/i", $args->mid)) return new Object(-1, 'msg_limit_mid'); + + // 변수를 검사 (modules의 기본 변수와 그렇지 않은 변수로 분리) + $extra_vars = clone($args); + unset($extra_vars->module_srl); + unset($extra_vars->module); + unset($extra_vars->module_category_srl); + unset($extra_vars->layout_srl); + unset($extra_vars->mlayout_srl); + unset($extra_vars->use_mobile); + unset($extra_vars->menu_srl); + unset($extra_vars->site_srl); + unset($extra_vars->mid); + unset($extra_vars->skin); + unset($extra_vars->mskin); + unset($extra_vars->browser_title); + unset($extra_vars->description); + unset($extra_vars->is_default); + unset($extra_vars->content); + unset($extra_vars->mcontent); + unset($extra_vars->open_rss); + unset($extra_vars->header_text); + unset($extra_vars->footer_text); + $args = delObjectVars($args, $extra_vars); + + return new Object(); + } + + /** + * @brief 모듈 입력 + **/ + function insertModule($args) { + $output = $this->arrangeModuleInfo($args, $extra_vars); + if(!$output->toBool()) return $output; + + // 이미 존재하는 모듈 이름인지 체크 + 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'); + + // begin transaction + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 선택된 스킨정보에서 colorset을 구함 + $module_path = ModuleHandler::getModulePath($args->module); + $skin_info = $oModuleModel->loadSkinInfo($module_path, $args->skin); + $skin_vars->colorset = $skin_info->colorset[0]->name; + + // 변수 정리후 query 실행 + if(!$args->module_srl) $args->module_srl = getNextSequence(); + + // 모듈 등록 + $output = executeQuery('module.insertModule', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 모듈 추가 변수 등록 + $this->insertModuleExtraVars($args->module_srl, $extra_vars); + + // commit + $oDB->commit(); + + $output->add('module_srl',$args->module_srl); + return $output; + } + + /** + * @brief 모듈의 정보를 수정 + **/ + function updateModule($args) { + $output = $this->arrangeModuleInfo($args, $extra_vars); + if(!$output->toBool()) return $output; + + // begin transaction + $oDB = &DB::getInstance(); + $oDB->begin(); + + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($args->module_srl); + + $args->site_srl = (int)$module_info->site_srl; + if(!$args->browser_title) $args->browser_title = $module_info->browser_title; + + $output = executeQuery('module.isExistsModuleName', $args); + if(!$output->toBool() || $output->data->count) { + $oDB->rollback(); + return new Object(-1, 'msg_module_name_exists'); + } + + $output = executeQuery('module.updateModule', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 모듈 추가 변수 등록 + $this->insertModuleExtraVars($args->module_srl, $extra_vars); + + $oDB->commit(); + + $output->add('module_srl',$args->module_srl); + return $output; + } + + /** + * @brief 모듈의 가상사이트 변경 + **/ + function updateModuleSite($module_srl, $site_srl, $layout_srl = 0) { + $args->module_srl = $module_srl; + $args->site_srl = $site_srl; + $args->layout_srl = $layout_srl; + return executeQuery('module.updateModuleSite', $args); + } + + /** + * @brief 모듈을 삭제 + * + * 모듈 삭제시는 관련 정보들을 모두 삭제 시도한다. + **/ + function deleteModule($module_srl) { + if(!$module_srl) return new Object(-1,'msg_invalid_request'); + + // trigger 호출 (before) + $trigger_obj->module_srl = $module_srl; + $output = ModuleHandler::triggerCall('module.deleteModule', 'before', $trigger_obj); + if(!$output->toBool()) return $output; + + // begin transaction + $oDB = &DB::getInstance(); + $oDB->begin(); + + $args->module_srl = $module_srl; + + // module 정보를 DB에서 삭제 + $output = executeQuery('module.deleteModule', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 권한 정보 삭제 + $this->deleteModuleGrants($module_srl); + + // 스킨 정보 삭제 + $this->deleteModuleSkinVars($module_srl); + + // 모듈 추가 변수 삭제 + $this->deleteModuleExtraVars($module_srl); + + // 모듈 관리자 제거 + $this->deleteAdminId($module_srl); + + // trigger 호출 (after) + if($output->toBool()) { + $trigger_output = ModuleHandler::triggerCall('module.deleteModule', 'after', $trigger_obj); + if(!$trigger_output->toBool()) { + $oDB->rollback(); + return $trigger_output; + } + } + + // commit + $oDB->commit(); + + return $output; + } + + /** + * @brief 모듈의 기타 정보를 변경 + **/ + function updateModuleSkinVars($module_srl, $skin_vars) { + // skin_vars 정보 세팅 + $args->module_srl = $module_srl; + $args->skin_vars = $skin_vars; + $output = executeQuery('module.updateModuleSkinVars', $args); + if(!$output->toBool()) return $output; + + return $output; + } + + /** + * @brief 모든 모듈의 is_default값을 N 으로 세팅 (기본 모듈 해제) + **/ + function clearDefaultModule() { + $output = executeQuery('module.clearDefaultModule'); + if(!$output->toBool()) return $output; + + return $output; + } + + /** + * @brief 지정된 menu_srl에 속한 mid 의 menu_srl 을 변경 + **/ + function updateModuleMenu($args) { + return executeQuery('module.updateModuleMenu', $args); + } + + /** + * @brief 지정된 menu_srl에 속한 mid 의 layout_srl을 변경 + **/ + function updateModuleLayout($layout_srl, $menu_srl_list) { + if(!count($menu_srl_list)) return; + + $args->layout_srl = $layout_srl; + $args->menu_srls = implode(',',$menu_srl_list); + $output = executeQuery('module.updateModuleLayout', $args); + return $output; + } + + /** + * @brief 사이트의 관리를 변경 + **/ + function insertSiteAdmin($site_srl, $arr_admins) { + // 사이트 관리자 제거 + $args->site_srl = $site_srl; + $output = executeQuery('module.deleteSiteAdmin', $args); + if(!$output->toBool()) return $output; + + // 관리자 대상 멤버 번호를 구함 + if(!is_array($arr_admins) || !count($arr_admins)) return new Object(); + foreach($arr_admins as $key => $user_id) { + if(!trim($user_id)) continue; + $admins[] = trim($user_id); + } + if(!count($admins)) return new Object(); + + $args->user_ids = '\''.implode('\',\'',$admins).'\''; + $output = executeQueryArray('module.getAdminSrls', $args); + if(!$output->toBool()||!$output->data) return $output; + + foreach($output->data as $key => $val) { + unset($args); + $args->site_srl = $site_srl; + $args->member_srl = $val->member_srl; + $output = executeQueryArray('module.insertSiteAdmin', $args); + if(!$output->toBool()) return $output; + } + return new Object(); + } + + /** + * @brief 특정 모듈에 관리자 아이디 지정 + **/ + function insertAdminId($module_srl, $admin_id) { + $oMemberModel = &getModel('member'); + $member_info = $oMemberModel->getMemberInfoByUserID($admin_id); + if(!$member_info->member_srl) return; + $args->module_srl = $module_srl; + $args->member_srl = $member_info->member_srl; + return executeQuery('module.insertAdminId', $args); + } + + /** + * @brief 특정 모듈의 관리자 아이디 제거 + **/ + function deleteAdminId($module_srl, $admin_id = '') { + $args->module_srl = $module_srl; + + if($admin_id) { + $oMemberModel = &getModel('member'); + $member_info = $oMemberModel->getMemberInfoByUserID($admin_id); + if($member_info->member_srl) $args->member_srl = $member_info->member_srl; + } + return executeQuery('module.deleteAdminId', $args); + } + + /** + * @brief 특정 모듈에 스킨 변수 등록 + **/ + function insertModuleSkinVars($module_srl, $obj) { + $this->deleteModuleSkinVars($module_srl); + if(!$obj || !count($obj)) return; + + $args->module_srl = $module_srl; + foreach($obj as $key => $val) { + // #17927989 예전 블로그 모듈을 사용하던 게시판의 경우 + // 스킨 정보 필드에 메뉴 항목(stdClass)을 저장해놓은 경우가 있어 + // 1.2.0 이상 버전으로 업그레이드한 후 모듈 업데이트할 때 + // 오류가 발생하는 문제 수정 + if (is_object($val)) continue; + if (is_array($val)) $val = serialize($val); + + $args->name = trim($key); + $args->value = trim($val); + if(!$args->name || !$args->value) continue; + executeQuery('module.insertModuleSkinVars', $args); + } + } + + /** + * @brief 특정 모듈의 스킨 변수 제거 + **/ + function deleteModuleSkinVars($module_srl) { + $args->module_srl = $module_srl; + return executeQuery('module.deleteModuleSkinVars', $args); + } + + /** + * @brief 특정 모듈에 확장 변수 등록 + **/ + function insertModuleExtraVars($module_srl, $obj) { + $this->deleteModuleExtraVars($module_srl); + if(!$obj || !count($obj)) return; + + foreach($obj as $key => $val) { + $args = null; + $args->module_srl = $module_srl; + $args->name = trim($key); + $args->value = trim($val); + if(!$args->name || !$args->value) continue; + executeQuery('module.insertModuleExtraVars', $args); + } + } + + /** + * @brief 특정 모듈의 확장 변수 제거 + **/ + function deleteModuleExtraVars($module_srl) { + $args->module_srl = $module_srl; + return executeQuery('module.deleteModuleExtraVars', $args); + } + + /** + * @brief 특정 모듈에 권한 등록 + **/ + function insertModuleGrants($module_srl, $obj) { + $this->deleteModuleGrants($module_srl); + if(!$obj || !count($obj)) return; + + foreach($obj as $name => $val) { + if(!$val || !count($val)) continue; + + foreach($val as $group_srl) { + $args = null; + $args->module_srl = $module_srl; + $args->name = $name; + $args->group_srl = trim($group_srl); + if(!$args->name || !$args->group_srl) continue; + executeQuery('module.insertModuleGrant', $args); + + } + } + } + + /** + * @brief 특정 모듈의 권한 제거 + **/ + function deleteModuleGrants($module_srl) { + $args->module_srl = $module_srl; + return executeQuery('module.deleteModuleGrants', $args); + } + + /** + * @brief 사용자 정의 언어 변경 + **/ + function replaceDefinedLangCode(&$output) { + $output = preg_replace_callback('!\$user_lang->([a-z0-9\_]+)!is', array($this,'_replaceLangCode'), $output); + } + function _replaceLangCode($matches) { + static $lang = null; + if(is_null($lang)) { + $site_module_info = Context::get('site_module_info'); + $cache_file = sprintf('%sfiles/cache/lang_defined/%d.%s.php', _XE_PATH_, $site_module_info->site_srl, Context::getLangType()); + if(!file_exists($cache_file)) { + $oModuleAdminController = &getAdminController('module'); + $oModuleAdminController->makeCacheDefinedLangCode($site_module_info->site_srl); + } + + if(file_exists($cache_file)) require_once($cache_file); + } + if(!Context::get($matches[1]) && $lang[$matches[1]]) return $lang[$matches[1]]; + + return str_replace('$user_lang->','',$matches[0]); + } + + + /** + * @brief 파일박스에 파일 추가 및 업데이트 + **/ + function procModuleFileBoxAdd(){ + + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted'); + + $vars = Context::gets('comment','addfile','filter'); + $module_filebox_srl = Context::get('module_filebox_srl'); + + $ext = strtolower(substr(strrchr($vars->addfile['name'],'.'),1)); + $vars->ext = $ext; + if($vars->filter) $filter = explode(',',$vars->filter); + else $filter = array('jpg','jpeg','gif','png'); + if(!in_array($ext,$filter)) return new Object(-1, 'msg_error_occured'); + + $vars->member_srl = $logged_info->member_srl; + + // update + if($module_filebox_srl > 0){ + $vars->module_filebox_srl = $module_filebox_srl; + $output = $this->updateModuleFileBox($vars); + + // insert + }else{ + if(!Context::isUploaded()) return new Object(-1, 'msg_error_occured'); + $addfile = Context::get('addfile'); + if(!is_uploaded_file($addfile['tmp_name'])) return new Object(-1, 'msg_error_occured'); + if($vars->addfile['error'] != 0) return new Object(-1, 'msg_error_occured'); + $output = $this->insertModuleFileBox($vars); + } + + $url = getUrl('','module','module','act','dispModuleFileBox','input',Context::get('input'),'filter',$vars->filter); + $url = html_entity_decode($url); + $vars = Context::set('url',$url); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('move_filebox_list'); + } + + + /** + * @brief 파일박스에 파일 업데이트 + **/ + function updateModuleFileBox($vars){ + + // have file + if($vars->addfile['tmp_name'] && is_uploaded_file($vars->addfile['tmp_name'])){ + $oModuleModel = &getModel('module'); + $output = $oModuleModel->getModuleFileBox($vars->module_filebox_srl); + FileHandler::removeFile($output->data->filename); + + $path = $oModuleModel->getModuleFileBoxPath($vars->module_filebox_srl); + FileHandler::makeDir($path); + + $save_filename = sprintf('%s%s.%s',$path, $vars->module_filebox_srl, $ext); + $tmp = $vars->addfile['tmp_name']; + + if(!@move_uploaded_file($tmp, $save_filename)) { + return false; + } + + $args->fileextension = strtolower(substr(strrchr($vars->addfile['name'],'.'),1)); + $args->filename = $save_filename; + $args->filesize = $vars->addfile['size']; + + } + + $args->module_filebox_srl = $vars->module_filebox_srl; + $args->comment = $vars->comment; + + return executeQuery('module.updateModuleFileBox', $vars); + } + + + /** + * @brief 파일박스에 파일 추가 + **/ + function insertModuleFileBox($vars){ + // set module_filebox_srl + $vars->module_filebox_srl = getNextSequence(); + + // get file path + $oModuleModel = &getModel('module'); + $path = $oModuleModel->getModuleFileBoxPath($vars->module_filebox_srl); + FileHandler::makeDir($path); + $save_filename = sprintf('%s%s.%s',$path, $vars->module_filebox_srl, $vars->ext); + $tmp = $vars->addfile['tmp_name']; + + // upload + if(!@move_uploaded_file($tmp, $save_filename)) { + return false; + } + + + // insert + $args->module_filebox_srl = $vars->module_filebox_srl; + $args->member_srl = $vars->member_srl; + $args->comment = $vars->comment; + $args->filename = $save_filename; + $args->fileextension = strtolower(substr(strrchr($vars->addfile['name'],'.'),1)); + $args->filesize = $vars->addfile['size']; + + $output = executeQuery('module.insertModuleFileBox', $args); + return $output; + } + + + /** + * @brief 파일박스에 파일 삭제 + **/ + + function procModuleFileBoxDelete(){ + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin !='Y' && !$logged_info->is_site_admin) return new Object(-1, 'msg_not_permitted'); + + $module_filebox_srl = Context::get('module_filebox_srl'); + if(!$module_filebox_srl) return new Object(-1, 'msg_invalid_request'); + $vars->module_filebox_srl = $module_filebox_srl; + $output = $this->deleteModuleFileBox($vars); + if(!$output->toBool()) return $output; + } + + function deleteModuleFileBox($vars){ + + // delete real file + $oModuleModel = &getModel('module'); + $output = $oModuleModel->getModuleFileBox($vars->module_filebox_srl); + FileHandler::removeFile($output->data->filename); + + $args->module_filebox_srl = $vars->module_filebox_srl; + return executeQuery('module.deleteModuleFileBox', $args); + } + + /** + * @brief function of locking (timeout is in seconds) + */ + function lock($lock_name, $timeout, $member_srl = null) { + $this->unlockTimeoutPassed(); + $args->lock_name = $lock_name; + if(!$timeout) $timeout = 60; + $args->deadline = date("YmdHis", time() + $timeout); + if($member_srl) $args->member_srl = $member_srl; + $output = executeQuery('module.insertLock', $args); + if($output->toBool()) { + $output->add('lock_name', $lock_name); + $output->add('deadline', $args->deadline); + } + return $output; + } + + function unlockTimeoutPassed() { + executeQuery('module.deleteLocksTimeoutPassed'); + } + + function unlock($lock_name, $deadline) { + $args->lock_name = $lock_name; + $args->deadline = $deadline; + $output = executeQuery('module.deleteLock', $args); + return $output; + } + + function updateModuleInSites($site_srls, $args) + { + $args->site_srls = $site_srls; + $output = executeQuery('module.updateModuleInSites', $args); + return $output; + } + } +?> diff --git a/modules/module/module.model.php b/modules/module/module.model.php index 88874af95..86f47fca0 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -1,1333 +1,1333 @@ -mid = $id; - $args->site_srl = $site_srl; - $output = executeQuery('module.isExistsModuleName', $args); - if($output->data->count) return true; - - // vid 검사 (site_srl이 0일때 즉 가상사이트가 아닌 경우 mid != vid임을 체크) - if(!$site_srl) { - $site_args->domain = $id; - $output = executeQuery('module.isExistsSiteDomain', $site_args); - if($output->data->count) return true; - } - - return false; - } - - /** - * @brief site 정보를 구함 - **/ - function getSiteInfo($site_srl) { - $args->site_srl = $site_srl; - $output = executeQuery('module.getSiteInfo', $args); - return $output->data; - } - - function getSiteInfoByDomain($domain) { - $args->domain= $domain; - $output = executeQuery('module.getSiteInfoByDomain', $args); - return $output->data; - } - - /** - * @brief document_srl로 모듈의 정보르 구함 - * 이 경우는 캐시파일을 이용할 수가 없음 - **/ - function getModuleInfoByDocumentSrl($document_srl) { - $args->document_srl = $document_srl; - $output = executeQuery('module.getModuleInfoByDocument', $args); - return $this->addModuleExtraVars($output->data); - } - - /** - * @brief domain에 따른 기본 mid를 구함 - **/ - 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이 다르면 가상 사이트 확인 - if($default_url && $default_url != $request_url) { - $url_info = parse_url($request_url); - $hostname = $url_info['host']; - $path = preg_replace('/\/$/','',$url_info['path']); - $sites_args->domain = sprintf('%s%s%s', $hostname, $url_info['port']&&$url_info['port']!=80?':'.$url_info['port']:'',$path); - $output = executeQuery('module.getSiteInfoByDomain', $sites_args); - } - if(!$output || !$output->data) - { - if(!$vid) $vid = $mid; - if($vid) { - $vid_args->domain = $vid; - $output = executeQuery('module.getSiteInfoByDomain', $vid_args); - if($output->toBool() && $output->data) { - Context::set('vid', $output->data->domain, true); - if($mid==$output->data->domain) Context::set('mid',$output->data->mid,true); - } - } - } - - // 가상 사이트가 아닐 경우 기본 사이트 정보를 구함 - if(!$output->data) { - $args->site_srl = 0; - $output = executeQuery('module.getSiteInfo', $args); - - // 기본 사이트 정보가 없으면 관련된 정보를 갱신 - if(!$output->data) { - // sites 테이블이 없을 경우 생성 - $oDB = &DB::getInstance(); - if(!$oDB->isTableExists('sites')) $oDB->createTableByXmlFile(_XE_PATH_.'modules/module/schemas/sites.xml'); - if(!$oDB->isTableExists('sites')) return; - - // 기본 mid, 언어 구함 - $mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args); - $db_info = Context::getDBInfo(); - $domain = Context::getDefaultUrl(); - $url_info = parse_url($domain); - $domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path']; - $site_args->site_srl = 0; - $site_args->index_module_srl = $mid_output->data->module_srl; - $site_args->domain = $domain; - $site_args->default_language = $db_info->lang_type; - - if($output->data && !$output->data->index_module_srl) { - $output = executeQuery('module.updateSite', $site_args); - } else { - $output = executeQuery('module.insertSite', $site_args); - if(!$output->toBool()) return $output; - } - $output = executeQuery('module.getSiteInfo', $args); - } - } - $module_info = $output->data; - if(!$module_info->module_srl) return $module_info; - if(is_array($module_info) && $module_info->data[0]) $module_info = $module_info[0]; - return $this->addModuleExtraVars($module_info); - } - - /** - * @brief mid로 모듈의 정보를 구함 - **/ - function getModuleInfoByMid($mid, $site_srl = 0) { - $args->mid = $mid; - $args->site_srl = (int)$site_srl; - $output = executeQuery('module.getMidInfo', $args); - $module_info = $output->data; - if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0]; - return $this->addModuleExtraVars($module_info); - } - - /** - * @brief module_srl에 해당하는 모듈의 정보를 구함 - **/ - function getModuleInfoByModuleSrl($module_srl) { - // 데이터를 가져옴 - $args->module_srl = $module_srl; - $output = executeQuery('module.getMidInfo', $args); - if(!$output->data) return; - $module_info = $this->addModuleExtraVars($output->data); - return $module_info; - } - - /** - * @brief layout_srl에 해당하는 모듈의 정보를 구함 - **/ - function getModulesInfoByLayout($layout_srl) { - // 데이터를 가져옴 - $args->layout_srl = $layout_srl; - $output = executeQueryArray('module.getModulesByLayout', $args); - - $count = count($output->data); - - $modules = array(); - for($i=0;$i<$count;$i++) { - $modules[] = $output->data[$i]; - } - return $this->addModuleExtraVars($modules); - } - - /** - * @brief 여러개의 module_srl에 해당하는 모듈의 정보를 구함 - **/ - function getModulesInfo($module_srls) { - if(is_array($module_srls)) $module_srls = implode(',',$module_srls); - $args->module_srls = $module_srls; - $output = executeQueryArray('module.getModulesInfo', $args); - if(!$output->toBool()) return; - return $this->addModuleExtraVars($output->data); - } - - /** - * @brief 모듈의 기본 정보에 추가 변수 구함 - **/ - function addModuleExtraVars($module_info) { - // 1개 이상의 모듈정보를 요청받아도 처리 가능하도록 - if(!is_array($module_info)) $target_module_info = array($module_info); - else $target_module_info = $module_info; - - // 모듈 번호를 구함 - $module_srls = array(); - foreach($target_module_info as $key => $val) { - $module_srl = $val->module_srl; - if(!$module_srl) continue; - $module_srls[] = $val->module_srl; - } - - // 모듈의 추가정보/ 스킨 정보를 추출 - $extra_vars = $this->getModuleExtraVars($module_srls); - if(!count($module_srls) || !count($extra_vars)) return $module_info; - - foreach($target_module_info as $key => $val) { - if(!$extra_vars[$val->module_srl] || !count($extra_vars[$val->module_srl])) continue; - foreach($extra_vars[$val->module_srl] as $k => $v) { - if($target_module_info[$key]->{$k}) continue; - $target_module_info[$key]->{$k} = $v; - } - } - if(is_array($module_info)) return $target_module_info; - return $target_module_info[0]; - } - - /** - * @brief DB에 생성된 mid 전체 목록을 구해옴 - **/ - function getMidList($args = null) { - $output = executeQuery('module.getMidList', $args); - if(!$output->toBool()) return $output; - - $list = $output->data; - if(!$list) return; - - if(!is_array($list)) $list = array($list); - - foreach($list as $val) { - $mid_list[$val->mid] = $val; - } - return $mid_list; - } - - /** - * @brief mid 목록에 대응하는 module_srl을 배열로 return - **/ - function getModuleSrlByMid($mid) { - if($mid && !is_array($mid)) $mid = explode(',',$mid); - if(is_array($mid)) $mid = "'".implode("','",$mid)."'"; - - $site_module_info = Context::get('site_module_info'); - - $args->mid = $mid; - if($site_module_info) $args->site_srl = $site_module_info->site_srl; - $output = executeQuery('module.getModuleSrlByMid', $args); - if(!$output->toBool()) return $output; - - $list = $output->data; - if(!$list) return; - if(!is_array($list)) $list = array($list); - - foreach($list as $key => $val) { - $module_srl_list[] = $val->module_srl; - } - - return $module_srl_list; - } - - /** - * @brief act 값에 의한 forward 값을 구함 - **/ - function getActionForward($act, $module = "") { - $args->act = $act; - $args->module = ($module)?$module:null; - if (strlen ($args->module) > 0) $output = executeQuery ('module.getActionForwardWithModule', $args); - else $output = executeQuery('module.getActionForward',$args); - return $output->data; - } - - /** - * @brief trigger_name에 등록된 모든 목록을 추출 - **/ - function getTriggers($trigger_name, $called_position) { - $args->trigger_name = $trigger_name; - $args->called_position = $called_position; - $output = executeQueryArray('module.getTriggers',$args); - return $output->data; - } - - /** - * @brief 특정 trigger_name의 특정 대상을 추출 - **/ - function getTrigger($trigger_name, $module, $type, $called_method, $called_position) { - $args->trigger_name = $trigger_name; - $args->module = $module; - $args->type = $type; - $args->called_method = $called_method; - $args->called_position = $called_position; - $output = executeQuery('module.getTrigger',$args); - return $output->data; - } - - /** - * @brief 특정 module extend 가져옴 - **/ - function getModuleExtend($parent_module, $type, $kind='') { - $key = $parent_module.'.'.$kind.'.'.$type; - - $module_extend_info = $this->loadModuleExtends(); - if(array_key_exists($key, $module_extend_info)) - { - return $module_extend_info[$key]; - } - - return false; - } - - /** - * @brief 모든 module extend 가져옴 - **/ - function loadModuleExtends() { - $cache_file = './files/config/module_extend.php'; - $cache_file = FileHandler::getRealPath($cache_file); - - if(!isset($GLOBALS['__MODULE_EXTEND__'])){ - - // check pre install - if(file_exists(FileHandler::getRealPath('./files')) && !file_exists($cache_file)) { - $arr = array(); - $output = executeQueryArray('module.getModuleExtend'); - if($output->data){ - foreach($output->data as $v){ - $arr[] = sprintf("'%s.%s.%s' => '%s'", $v->parent_module, $v->kind, $v->type, $v->extend_module); - } - } - - $str = ''; - $str = sprintf($str, join(',',$arr)); - - FileHandler::writeFile($cache_file, $str); - } - - - if(file_exists($cache_file)) { - $GLOBALS['__MODULE_EXTEND__'] = include($cache_file); - } else { - $GLOBALS['__MODULE_EXTEND__'] = array(); - } - } - - return $GLOBALS['__MODULE_EXTEND__']; - } - - /** - * @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함 - **/ - function getModuleInfoXml($module) { - // 요청된 모듈의 경로를 구한다. 없으면 return - $module_path = ModuleHandler::getModulePath($module); - if(!$module_path) return; - - // 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음 - $xml_file = sprintf("%s/conf/info.xml", $module_path); - if(!file_exists($xml_file)) return; - - $oXmlParser = new XmlParser(); - $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); - $xml_obj = $tmp_xml_obj->module; - - if(!$xml_obj) return; - - // 모듈 정보 - if($xml_obj->version && $xml_obj->attrs->version == '0.2') { - // module format 0.2 - $module_info->title = $xml_obj->title->body; - $module_info->description = $xml_obj->description->body; - $module_info->version = $xml_obj->version->body; - $module_info->homepage = $xml_obj->link->body; - $module_info->category = $xml_obj->category->body; - if(!$module_info->category) $module_info->category = 'service'; - sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d); - $module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); - $module_info->license = $xml_obj->license->body; - $module_info->license_link = $xml_obj->license->attrs->link; - - if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; - else $author_list = $xml_obj->author; - - foreach($author_list as $author) { - unset($author_obj); - $author_obj->name = $author->name->body; - $author_obj->email_address = $author->attrs->email_address; - $author_obj->homepage = $author->attrs->link; - $module_info->author[] = $author_obj; - } - - // history - if($xml_obj->history) { - if(!is_array($xml_obj->history)) $history[] = $xml_obj->history; - else $history = $xml_obj->history; - - foreach($history as $item) { - unset($obj); - - if($item->author) { - (!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author; - - foreach($obj->author_list as $author) { - unset($author_obj); - $author_obj->name = $author->name->body; - $author_obj->email_address = $author->attrs->email_address; - $author_obj->homepage = $author->attrs->link; - $obj->author[] = $author_obj; - } - } - - $obj->name = $item->name->body; - $obj->email_address = $item->attrs->email_address; - $obj->homepage = $item->attrs->link; - $obj->version = $item->attrs->version; - $obj->date = $item->attrs->date; - $obj->description = $item->description->body; - - if($item->log) { - (!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log; - - foreach($obj->log as $log) { - unset($logs_obj); - $logs_obj->text = $log->body; - $logs_obj->link = $log->attrs->link; - $obj->logs[] = $logs_obj; - } - } - - $module_info->history[] = $obj; - } - } - - - } else { - // module format 0.1 - $module_info->title = $xml_obj->title->body; - $module_info->description = $xml_obj->author->description->body; - $module_info->version = $xml_obj->attrs->version; - $module_info->category = $xml_obj->attrs->category; - if(!$module_info->category) $module_info->category = 'service'; - sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d); - $module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); - $author_obj->name = $xml_obj->author->name->body; - $author_obj->email_address = $xml_obj->author->attrs->email_address; - $author_obj->homepage = $xml_obj->author->attrs->link; - $module_info->author[] = $author_obj; - } - - // action 정보를 얻어서 admin_index를 추가 - $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; - $module_info->setup_index_act = $action_info->setup_index_act; - - return $module_info; - } - - /** - * @brief module의 conf/module.xml 을 통해 grant(권한) 및 action 데이터를 return - * module.xml 파일의 경우 파싱하는데 시간이 걸리기에 캐싱을 한다... - * 캐싱을 할때 바로 include 할 수 있도록 역시 코드까지 추가하여 캐싱을 한다. - * 이게 퍼포먼스 상으로는 좋은데 어떤 부정적인 결과를 유도할지는 잘 모르겠... - **/ - function getModuleActionXml($module) { - // 요청된 모듈의 경로를 구한다. 없으면 return - $class_path = ModuleHandler::getModulePath($module); - if(!$class_path) return; - - // 해당 경로에 module.xml 파일이 있는지 체크한다. 없으면 return - $xml_file = sprintf("%sconf/module.xml", $class_path); - if(!file_exists($xml_file)) return; - - // 캐시된 파일이 있는지 확인 - $cache_file = sprintf("./files/cache/module_info/%s.%s.php", $module, Context::getLangType()); - - // 캐시 파일이 없거나 캐시 파일이 xml 파일보다 오래되었으면 내용 다시 갱신 - if(!file_exists($cache_file) || filemtime($cache_file)module)) return; ///< xml 내용중에 module 태그가 없다면 오류;; - - $grants = $xml_obj->module->grants->grant; ///< 권한 정보 (없는 경우도 있음) - $permissions = $xml_obj->module->permissions->permission; ///< 권한 대행 (없는 경우도 있음) - $actions = $xml_obj->module->actions->action; ///< action list (필수) - - $default_index = $admin_index = ''; - - // 권한 정보의 정리 - if($grants) { - if(is_array($grants)) $grant_list = $grants; - else $grant_list[] = $grants; - - foreach($grant_list as $grant) { - $name = $grant->attrs->name; - $default = $grant->attrs->default?$grant->attrs->default:'guest'; - $title = $grant->title->body; - - $info->grant->{$name}->title = $title; - $info->grant->{$name}->default = $default; - - $buff .= sprintf('$info->grant->%s->title=\'%s\';', $name, $title); - $buff .= sprintf('$info->grant->%s->default=\'%s\';', $name, $default); - } - } - - // 권한 허용 정리 - if($permissions) { - if(is_array($permissions)) $permission_list = $permissions; - else $permission_list[] = $permissions; - - foreach($permission_list as $permission) { - $action = $permission->attrs->action; - $target = $permission->attrs->target; - - $info->permission->{$action} = $target; - - $buff .= sprintf('$info->permission->%s = \'%s\';', $action, $target); - } - } - - // actions 정리 - if($actions) { - if(is_array($actions)) $action_list = $actions; - else $action_list[] = $actions; - - foreach($action_list as $action) { - $name = $action->attrs->name; - - $type = $action->attrs->type; - $grant = $action->attrs->grant?$action->attrs->grant:'guest'; - $standalone = $action->attrs->standalone=='true'?'true':'false'; - - $index = $action->attrs->index; - $admin_index = $action->attrs->admin_index; - $setup_index = $action->attrs->setup_index; - - $output->action->{$name}->type = $type; - $output->action->{$name}->grant = $grant; - $output->action->{$name}->standalone= $standalone; - - $info->action->{$name}->type = $type; - $info->action->{$name}->grant = $grant; - $info->action->{$name}->standalone = $standalone=='true'?true:false; - - $buff .= sprintf('$info->action->%s->type=\'%s\';', $name, $type); - $buff .= sprintf('$info->action->%s->grant=\'%s\';', $name, $grant); - $buff .= sprintf('$info->action->%s->standalone=%s;', $name, $standalone); - - if($index=='true') { - $default_index_act = $name; - $info->default_index_act = $name; - } - if($admin_index=='true') { - $admin_index_act = $name; - $info->admin_index_act = $name; - } - if($setup_index=='true') { - $setup_index_act = $name; - $info->setup_index_act = $name; - } - } - } - $buff = sprintf('default_index_act = \'%s\';$info->setup_index_act=\'%s\';$info->admin_index_act = \'%s\';%s?>', $default_index_act, $setup_index_act, $admin_index_act, $buff); - - FileHandler::writeFile($cache_file, $buff); - - return $info; - } - - @include($cache_file); - - return $info; - } - - - /** - * @brief 주어진 곳의 스킨 목록을 구함 - * 스킨과 skin.xml 파일을 분석 정리한 결과를 return - **/ - function getSkins($path, $dir = 'skins') { - $skin_path = sprintf("%s/%s/", $path, $dir); - $list = FileHandler::readDir($skin_path); - if(!count($list)) return; - - natcasesort($list); - - foreach($list as $skin_name) { - unset($skin_info); - $skin_info = $this->loadSkinInfo($path, $skin_name, $dir); - if(!$skin_info) $skin_info->title = $skin_name; - - $skin_list[$skin_name] = $skin_info; - } - - return $skin_list; - } - - /** - * @brief 특정 위치의 특정 스킨의 정보를 구해옴 - **/ - function loadSkinInfo($path, $skin, $dir = 'skins') { - - // 모듈의 스킨의 정보 xml 파일을 읽음 - 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 객체 생성 - $oXmlParser = new XmlParser(); - $_xml_obj = $oXmlParser->loadXmlFile($skin_xml_file); - - // 스킨 정보가 없으면 return - if(!$_xml_obj->skin) return; - $xml_obj = $_xml_obj->skin; - - // 스킨이름 - $skin_info->title = $xml_obj->title->body; - - - // 작성자 정보 - 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); - $skin_info->version = $xml_obj->version->body; - $skin_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); - $skin_info->homepage = $xml_obj->link->body; - $skin_info->license = $xml_obj->license->body; - $skin_info->license_link = $xml_obj->license->attrs->link; - $skin_info->description = $xml_obj->description->body; - - if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; - else $author_list = $xml_obj->author; - - foreach($author_list as $author) { - unset($author_obj); - $author_obj->name = $author->name->body; - $author_obj->email_address = $author->attrs->email_address; - $author_obj->homepage = $author->attrs->link; - $skin_info->author[] = $author_obj; - } - - // 확장변수를 정리 - if($xml_obj->extra_vars) { - $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); - - foreach($extra_var_groups as $group) { - $extra_vars = $group->var; - if(!is_array($group->var)) $extra_vars = array($group->var); - - foreach($extra_vars as $key => $val) { - unset($obj); - if(!$val->attrs->type) { $val->attrs->type = 'text'; } - - $obj->group = $group->title->body; - $obj->name = $val->attrs->name; - $obj->title = $val->title->body; - $obj->type = $val->attrs->type; - $obj->description = $val->description->body; - $obj->value = $extra_vals->{$obj->name}; - $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목록을 구한다. - if(is_array($val->options)) { - $option_count = count($val->options); - - for($i = 0; $i < $option_count; $i++) { - $obj->options[$i]->title = $val->options[$i]->title->body; - $obj->options[$i]->value = $val->options[$i]->attrs->value; - } - } else { - $obj->options[0]->title = $val->options->title->body; - $obj->options[0]->value = $val->options->attrs->value; - } - - $skin_info->extra_vars[] = $obj; - } - } - } - - // history - if($xml_obj->history) { - if(!is_array($xml_obj->history)) $history[] = $xml_obj->history; - else $history = $xml_obj->history; - - foreach($history as $item) { - unset($obj); - - if($item->author) { - (!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author; - - foreach($obj->author_list as $author) { - unset($author_obj); - $author_obj->name = $author->name->body; - $author_obj->email_address = $author->attrs->email_address; - $author_obj->homepage = $author->attrs->link; - $obj->author[] = $author_obj; - } - } - - $obj->name = $item->name->body; - $obj->email_address = $item->attrs->email_address; - $obj->homepage = $item->attrs->link; - $obj->version = $item->attrs->version; - $obj->date = $item->attrs->date; - $obj->description = $item->description->body; - - if($item->log) { - (!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log; - - foreach($obj->log as $log) { - unset($log_obj); - $log_obj->text = $log->body; - $log_obj->link = $log->attrs->link; - $obj->logs[] = $log_obj; - } - } - - $skin_info->history[] = $obj; - } - } - - - } else { - - // skin format v0.1 - sscanf($xml_obj->maker->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d); - - $skin_info->version = $xml_obj->version->body; - $skin_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); - $skin_info->homepage = $xml_obj->link->body; - $skin_info->license = $xml_obj->license->body; - $skin_info->license_link = $xml_obj->license->attrs->link; - $skin_info->description = $xml_obj->maker->description->body; - - $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; - - // 스킨에서 사용되는 변수들 - $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); - - foreach($extra_var_groups as $group){ - $extra_vars = $group->var; - - if($extra_vars) { - - if(!is_array($extra_vars)) $extra_vars = array($extra_vars); - - foreach($extra_vars as $var) { - unset($obj); - unset($options); - - $group = $group->title->body; - $name = $var->attrs->name; - $type = $var->attrs->type; - $title = $var->title->body; - $description = $var->description->body; - - // 'select'type에서 option목록을 구한다. - if(is_array($var->default)) { - $option_count = count($var->default); - - for($i = 0; $i < $option_count; $i++) { - $options[$i]->title = $var->default[$i]->body; - $options[$i]->value = $var->default[$i]->body; - } - } else { - $options[0]->title = $var->default->body; - $options[0]->value = $var->default->body; - } - - $width = $var->attrs->width; - $height = $var->attrs->height; - - unset($obj); - $obj->group = $group; - $obj->title = $title; - $obj->description = $description; - $obj->name = $name; - $obj->type = $type; - $obj->options = $options; - $obj->width = $width; - $obj->height = $height; - $obj->default = $options[0]->value; - - $skin_info->extra_vars[] = $obj; - } - } - } - } - - // colorset - $colorset = $xml_obj->colorset->color; - if($colorset) { - if(!is_array($colorset)) $colorset = array($colorset); - - foreach($colorset as $color) { - $name = $color->attrs->name; - $title = $color->title->body; - $screenshot = $color->attrs->src; - if($screenshot) { - $screenshot = sprintf("%sskins/%s/%s", $path, $skin, $screenshot); - if(!file_exists($screenshot)) $screenshot = ""; - } else $screenshot = ""; - - unset($obj); - $obj->name = $name; - $obj->title = $title; - $obj->screenshot = $screenshot; - $skin_info->colorset[] = $obj; - } - } - - // 메뉴 종류 (레이아웃을 위한 설정) - if($xml_obj->menus->menu) { - $menus = $xml_obj->menus->menu; - if(!is_array($menus)) $menus = array($menus); - - $menu_count = count($menus); - $skin_info->menu_count = $menu_count; - for($i=0;$i<$menu_count;$i++) { - unset($obj); - - $obj->name = $menus[$i]->attrs->name; - if($menus[$i]->attrs->default == "true") $obj->default = true; - $obj->title = $menus[$i]->title->body; - $obj->maxdepth = $menus[$i]->maxdepth->body; - - $skin_info->menu->{$obj->name} = $obj; - } - } - - return $skin_info; - } - - /** - * @brief 특정 가상 사이트에 등록된 특정 모듈의 개수를 return - **/ - function getModuleCount($site_srl, $module = null) { - $args->site_srl = $site_srl; - if(!is_null($module)) $args->module = $module; - $output = executeQuery('module.getModuleCount', $args); - return $output->data->count; - } - - /** - * @brief 특정 모듈의 설정 return - * board, member등 특정 모듈의 global config 관리용 - **/ - function getModuleConfig($module) { - if(!$GLOBALS['__ModuleConfig__'][$module]) { - $args->module = $module; - $output = executeQuery('module.getModuleConfig', $args); - $config = unserialize($output->data->config); - $GLOBALS['__ModuleConfig__'][$module] = $config; - } - return $GLOBALS['__ModuleConfig__'][$module]; - } - - /** - * @brief 특정 mid의 모듈 설정 정보 return - * mid의 모듈 의존적인 설정을 관리 - **/ - function getModulePartConfig($module, $module_srl) { - if(!$GLOBALS['__ModulePartConfig__'][$module][$module_srl]) { - $args->module = $module; - $args->module_srl = $module_srl; - $output = executeQuery('module.getModulePartConfig', $args); - $config = unserialize($output->data->config); - $GLOBALS['__ModulePartConfig__'][$module][$module_srl] = $config; - } - return $GLOBALS['__ModulePartConfig__'][$module][$module_srl]; - } - - /** - * @brief mid별 모듈 설정 정보 전체를 구함 - **/ - function getModulePartConfigs($module, $site_srl = 0) { - $args->module = $module; - if($site_srl) $args->site_srl = $site_srl; - $output = executeQueryArray('module.getModulePartConfigs', $args); - if(!$output->toBool() || !$output->data) return array(); - - foreach($output->data as $key => $val) { - $result[$val->module_srl] = unserialize($val->config); - } - return $result; - } - - - /** - * @brief 모듈 카테고리의 목록을 구함 - **/ - function getModuleCategories() { - // 데이터를 DB에서 가져옴 - $output = executeQuery('module.getModuleCategories'); - if(!$output->toBool()) return $output; - $list = $output->data; - if(!$list) return; - if(!is_array($list)) $list = array($list); - - foreach($list as $val) { - $category_list[$val->module_category_srl] = $val; - } - return $category_list; - } - - /** - * @brief 특정 모듈 카테고리의 내용을 구함 - **/ - function getModuleCategory($module_category_srl) { - // 데이터를 DB에서 가져옴 - $args->module_category_srl = $module_category_srl; - $output = executeQuery('module.getModuleCategory', $args); - if(!$output->toBool()) return $output; - return $output->data; - } - - /** - * @brief 모듈의 xml 정보만 구함 - **/ - function getModulesXmlInfo() { - // 다운받은 모듈과 설치된 모듈의 목록을 구함 - $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 = $searched_list[$i]; - - $path = ModuleHandler::getModulePath($module_name); - - // 해당 모듈의 정보를 구함 - $info = $this->getModuleInfoXml($module_name); - unset($obj); - - $info->module = $module_name; - $info->created_table_count = $created_table_count; - $info->table_count = $table_count; - $info->path = $path; - $info->admin_index_act = $info->admin_index_act; - $list[] = $info; - } - return $list; - } - - function checkNeedInstall($module_name) - { - $oDB = &DB::getInstance(); - $info = null; - - $moduledir = ModuleHandler::getModulePath($module_name); - if(file_exists(FileHandler::getRealPath($moduledir."schemas"))) - { - $tmp_files = FileHandler::readDir($moduledir."schemas", '/(\.xml)$/'); - $table_count = count($tmp_files); - - // 테이블이 설치되어 있는지 체크 - $created_table_count = 0; - for($j=0;$jisTableExists($table_name)) $created_table_count ++; - } - - // 설치 유무 체크 (설치는 DB의 설치만 관리) - if($table_count > $created_table_count) return true; - else return false; - } - return false; - } - - function checkNeedUpdate($module_name) - { - // 각 모듈의 module.class.php로 upgrade 유무 체크 - $oDummy = &getModule($module_name, 'class'); - if($oDummy && method_exists($oDummy, "checkUpdate")) { - return $oDummy->checkUpdate(); - } - return false; - } - - /** - * @brief 모듈의 종류와 정보를 구함 - **/ - function getModuleList() { - // DB 객체 생성 - $oDB = &DB::getInstance(); - - // 다운받은 모듈과 설치된 모듈의 목록을 구함 - $searched_list = FileHandler::readDir('./modules'); - sort($searched_list); - - $searched_count = count($searched_list); - if(!$searched_count) return; - - for($i=0;$i<$searched_count;$i++) { - // 모듈의 이름 - $module_name = $searched_list[$i]; - - $path = ModuleHandler::getModulePath($module_name); - - // schemas내의 테이블 생성 xml파일수를 구함 - $tmp_files = FileHandler::readDir($path."schemas", '/(\.xml)$/'); - $table_count = count($tmp_files); - - // 테이블이 설치되어 있는지 체크 - $created_table_count = 0; - for($j=0;$jisTableExists($table_name)) $created_table_count ++; - } - - // 해당 모듈의 정보를 구함 - $info = $this->getModuleInfoXml($module_name); - unset($obj); - - $info->module = $module_name; - $info->category = $info->category; - $info->created_table_count = $created_table_count; - $info->table_count = $table_count; - $info->path = $path; - $info->admin_index_act = $info->admin_index_act; - - // 설치 유무 체크 (설치는 DB의 설치만 관리) - if($table_count > $created_table_count) $info->need_install = true; - else $info->need_install = false; - - // 각 모듈의 module.class.php로 upgrade 유무 체크 - $oDummy = null; - $oDummy = &getModule($module_name, 'class'); - if($oDummy && method_exists($oDummy, "checkUpdate")) { - $info->need_update = $oDummy->checkUpdate(); - } - else - { - continue; - } - - $list[] = $info; - } - return $list; - } - - /** - * @brief 특정 module srls를 sites의 domain과 결합 - * 아직 XE DBHandler에서 left outer join이 안되어서.. - * $output->data[]->module_srl 과 같은 구조여야 함 - **/ - function syncModuleToSite(&$data) { - if(!$data) return; - - if(is_array($data)) { - foreach($data as $key => $val) { - $module_srls[] = $val->module_srl; - } - if(!count($module_srls)) return; - } else { - $module_srls[] = $data->module_srl; - } - - $args->module_srls = implode(',',$module_srls); - $output = executeQueryArray('module.getModuleSites', $args); - if(!$output->data) return array(); - foreach($output->data as $key => $val) { - $modules[$val->module_srl] = $val; - } - - if(is_array($data)) { - foreach($data as $key => $val) { - $data[$key]->domain = $modules[$val->module_srl]->domain; - } - } else { - $data->domain = $modules[$data->module_srl]->domain; - } - } - - /** - * @brief site_module_info의 관리자 인지 체크 - **/ - function isSiteAdmin($member_info, $site_srl = null) { - if(!$member_info->member_srl) return false; - if($member_info->is_admin == 'Y') return true; - - if(!isset($site_srl)) - { - $site_module_info = Context::get('site_module_info'); - if(!$site_module_info) return; - $args->site_srl = $site_module_info->site_srl; - } - else - { - $args->site_srl = $site_srl; - } - - $args->member_srl = $member_info->member_srl; - $output = executeQuery('module.isSiteAdmin', $args); - if($output->data->member_srl == $args->member_srl) return true; - return false; - - } - - /** - * @brief site의 관리자 정보를 구함 - **/ - function getSiteAdmin($site_srl) { - $args->site_srl = $site_srl; - $output = executeQueryArray('module.getSiteAdmin', $args); - return $output->data; - } - - /** - * @brief 특정 모듈의 관리자 아이디 구함 - **/ - function getAdminId($module_srl) { - $obj->module_srl = $module_srl; - $output = executeQueryArray('module.getAdminID', $obj); - if(!$output->toBool() || !$output->data) return; - - return $output->data; - } - - /** - * @brief 특정 모듈의 추가 변수를 구함 - * modules 테이블의 기본 정보 이외의 것 - **/ - function getModuleExtraVars($module_srl) { - if(is_array($module_srl)) $module_srl = implode(',',$module_srl); - $args->module_srl = $module_srl; - $output = executeQueryArray('module.getModuleExtraVars',$args); - if(!$output->toBool() || !$output->data) return; - - $vars = array(); - foreach($output->data as $key => $val) { - if(in_array($val->name, array('mid','module')) || $val->value == 'Array') continue; - $vars[$val->module_srl]->{$val->name} = $val->value; - } - return $vars; - } - - /** - * @brief 특정 모듈의 스킨 정보를 구함 - **/ - function getModuleSkinVars($module_srl) { - $args->module_srl = $module_srl; - $output = executeQueryArray('module.getModuleSkinVars',$args); - if(!$output->toBool() || !$output->data) return; - - $skin_vars = array(); - foreach($output->data as $val) $skin_vars[$val->name] = $val; - return $skin_vars; - } - - /** - * @brief 특정 모듈의 스킨 정보를 모듈 정보와 결합 - **/ - function syncSkinInfoToModuleInfo(&$module_info) { - if(!$module_info->module_srl) return; - - $args->module_srl = $module_info->module_srl; - $output = executeQueryArray('module.getModuleSkinVars',$args); - if(!$output->toBool() || !$output->data) return; - - foreach($output->data as $val) { - if(isset($module_info->{$val->name})) continue; - $module_info->{$val->name} = $val->value; - } - } - - /** - * @brief 특정 모듈정보와 XML, 그리고 회원 정보로 권한을 return - **/ - function getGrant($module_info, $member_info, $xml_info = '') { - if(!$xml_info) { - $module = $module_info->module; - $xml_info = $this->getModuleActionXml($module); - } - // 그룹 권한 설정에 필요한 변수를 세팅 - $module_srl = $module_info->module_srl; - $grant_info = $xml_info->grant; - if($member_info->member_srl) { - if(is_array($member_info->group_list)) $group_list = array_keys($member_info->group_list); - else $group_list = array(); - } else { - $group_list = array(); - } - - // module_srl이 없는 즉 별도의 권한 설정이 안되는 경우 - 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이 있는 경우 - } else { - - // grant 종류를 구함 - $grant->access = $grant->is_admin = $grant->manager = ($member_info->is_admin=='Y'||$this->isSiteAdmin($member_info))?true:false; - - // 관리자가 아니라 로그인 회원일 경우 이 모듈의 관리자인지 확인 - 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(!$grant->manager) { - $args = null; - - // 플래닛인 경우 planet home의 권한 설정을 가져온다 - if ($module_info->module == 'planet') { - $output = executeQueryArray('module.getPlanetGrants', $args); - } - else { - $args->module_srl = $module_srl; - $output = executeQueryArray('module.getModuleGrants', $args); - } - - $grant_exists = $granted = array(); - - if($output->data) { - // 1차적으로 권한 대상 이름과 그룹을 정리 - foreach($output->data as $val) { - $grant_exists[$val->name] = true; - if($granted[$val->name]) continue; - - // 로그인 회원만 - if($val->group_srl == -1) { - $granted[$val->name] = true; - if($member_info->member_srl) $grant->{$val->name} = true; - - // 사이트 가입한 회원만 - } elseif($val->group_srl == -2) { - $granted[$val->name] = true; - // 비로그인 회원이면 권한 미부여 - if(!$member_info->member_srl) $grant->{$val->name} = false; - // 로그인 회원 - else { - $site_module_info = Context::get('site_module_info'); - // 현재 접속된 사이트 정보가 없으면 권한 부여 - if(!$site_module_info->site_srl) $grant->{$val->name} = true; - // 현재 접속된 사이트의 그룹 정보가 있 으면 권한 미부여 - elseif(count($group_list)) $grant->{$val->name} = true; - } - - // 비로그인 회원 모두 - } elseif($val->group_srl == 0) { - $granted[$val->name] = true; - $grant->{$val->name} = true; - // 특정 그룹 대상일 경우 - } else { - if($group_list && count($group_list) && in_array($val->group_srl, $group_list)) { - $grant->{$val->name} = true; - $granted[$val->name] = true; - } - } - } - } - - // 가상 그룹인 access에 대해서 별도 처리 - if(!$grant_exists['access']) $grant->access = true; - if(count($grant_info)) { - foreach($grant_info as $grant_name => $grant_item) { - if($grant_exists[$grant_name]) continue; - switch($grant_item->default) { - case 'guest' : - $grant->{$grant_name} = true; - break; - case 'member' : - if($member_info->member_srl) $grant->{$grant_name} = true; - else $grant->{$grant_name} = false; - break; - case 'site' : - $site_module_info = Context::get('site_module_info'); - if($member_info->member_srl && (($site_module_info->site_srl && count($group_list)) || !$site_module_info->site_srl)) $grant->{$grant_name} = true; - else $grant->{$grant_name} = false; - break; - case 'manager' : - case 'root' : - if($member_info->is_admin == 'Y') $grant->{$grant_name} = true; - else $grant->{$grant_name} = false; - break; - } - } - } - } - - // 관리자일 경우 모든 권한에 대해 true 지정 - if($grant->manager) { - $grant->access = true; - if(count($grant_info)) { - foreach($grant_info as $key => $val) { - $grant->{$key} = true; - } - } - } - - } - return $grant; - } - - - - function getModuleFileBox($module_filebox_srl){ - $args->module_filebox_srl = $module_filebox_srl; - return executeQuery('module.getModuleFileBox', $args); - } - - function getModuleFileBoxList(){ - $args->page = Context::get('page'); - $args->list_count = 10; - $args->page_count = 10; - return executeQuery('module.getModuleFileBoxList', $args); - } - - function getModuleFileBoxPath($module_filebox_srl){ - return sprintf("./files/attach/filebox/%s",getNumberingPath($module_filebox_srl,3)); - } - } -?> +mid = $id; + $args->site_srl = $site_srl; + $output = executeQuery('module.isExistsModuleName', $args); + if($output->data->count) return true; + + // vid 검사 (site_srl이 0일때 즉 가상사이트가 아닌 경우 mid != vid임을 체크) + if(!$site_srl) { + $site_args->domain = $id; + $output = executeQuery('module.isExistsSiteDomain', $site_args); + if($output->data->count) return true; + } + + return false; + } + + /** + * @brief site 정보를 구함 + **/ + function getSiteInfo($site_srl) { + $args->site_srl = $site_srl; + $output = executeQuery('module.getSiteInfo', $args); + return $output->data; + } + + function getSiteInfoByDomain($domain) { + $args->domain= $domain; + $output = executeQuery('module.getSiteInfoByDomain', $args); + return $output->data; + } + + /** + * @brief document_srl로 모듈의 정보르 구함 + * 이 경우는 캐시파일을 이용할 수가 없음 + **/ + function getModuleInfoByDocumentSrl($document_srl) { + $args->document_srl = $document_srl; + $output = executeQuery('module.getModuleInfoByDocument', $args); + return $this->addModuleExtraVars($output->data); + } + + /** + * @brief domain에 따른 기본 mid를 구함 + **/ + 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이 다르면 가상 사이트 확인 + if($default_url && $default_url != $request_url) { + $url_info = parse_url($request_url); + $hostname = $url_info['host']; + $path = preg_replace('/\/$/','',$url_info['path']); + $sites_args->domain = sprintf('%s%s%s', $hostname, $url_info['port']&&$url_info['port']!=80?':'.$url_info['port']:'',$path); + $output = executeQuery('module.getSiteInfoByDomain', $sites_args); + } + if(!$output || !$output->data) + { + if(!$vid) $vid = $mid; + if($vid) { + $vid_args->domain = $vid; + $output = executeQuery('module.getSiteInfoByDomain', $vid_args); + if($output->toBool() && $output->data) { + Context::set('vid', $output->data->domain, true); + if($mid==$output->data->domain) Context::set('mid',$output->data->mid,true); + } + } + } + + // 가상 사이트가 아닐 경우 기본 사이트 정보를 구함 + if(!$output->data) { + $args->site_srl = 0; + $output = executeQuery('module.getSiteInfo', $args); + + // 기본 사이트 정보가 없으면 관련된 정보를 갱신 + if(!$output->data) { + // sites 테이블이 없을 경우 생성 + $oDB = &DB::getInstance(); + if(!$oDB->isTableExists('sites')) $oDB->createTableByXmlFile(_XE_PATH_.'modules/module/schemas/sites.xml'); + if(!$oDB->isTableExists('sites')) return; + + // 기본 mid, 언어 구함 + $mid_output = $oDB->executeQuery('module.getDefaultMidInfo', $args); + $db_info = Context::getDBInfo(); + $domain = Context::getDefaultUrl(); + $url_info = parse_url($domain); + $domain = $url_info['host'].( (!empty($url_info['port'])&&$url_info['port']!=80)?':'.$url_info['port']:'').$url_info['path']; + $site_args->site_srl = 0; + $site_args->index_module_srl = $mid_output->data->module_srl; + $site_args->domain = $domain; + $site_args->default_language = $db_info->lang_type; + + if($output->data && !$output->data->index_module_srl) { + $output = executeQuery('module.updateSite', $site_args); + } else { + $output = executeQuery('module.insertSite', $site_args); + if(!$output->toBool()) return $output; + } + $output = executeQuery('module.getSiteInfo', $args); + } + } + $module_info = $output->data; + if(!$module_info->module_srl) return $module_info; + if(is_array($module_info) && $module_info->data[0]) $module_info = $module_info[0]; + return $this->addModuleExtraVars($module_info); + } + + /** + * @brief mid로 모듈의 정보를 구함 + **/ + function getModuleInfoByMid($mid, $site_srl = 0) { + $args->mid = $mid; + $args->site_srl = (int)$site_srl; + $output = executeQuery('module.getMidInfo', $args); + $module_info = $output->data; + if(!$module_info->module_srl && $module_info->data[0]) $module_info = $module_info->data[0]; + return $this->addModuleExtraVars($module_info); + } + + /** + * @brief module_srl에 해당하는 모듈의 정보를 구함 + **/ + function getModuleInfoByModuleSrl($module_srl) { + // 데이터를 가져옴 + $args->module_srl = $module_srl; + $output = executeQuery('module.getMidInfo', $args); + if(!$output->data) return; + $module_info = $this->addModuleExtraVars($output->data); + return $module_info; + } + + /** + * @brief layout_srl에 해당하는 모듈의 정보를 구함 + **/ + function getModulesInfoByLayout($layout_srl) { + // 데이터를 가져옴 + $args->layout_srl = $layout_srl; + $output = executeQueryArray('module.getModulesByLayout', $args); + + $count = count($output->data); + + $modules = array(); + for($i=0;$i<$count;$i++) { + $modules[] = $output->data[$i]; + } + return $this->addModuleExtraVars($modules); + } + + /** + * @brief 여러개의 module_srl에 해당하는 모듈의 정보를 구함 + **/ + function getModulesInfo($module_srls) { + if(is_array($module_srls)) $module_srls = implode(',',$module_srls); + $args->module_srls = $module_srls; + $output = executeQueryArray('module.getModulesInfo', $args); + if(!$output->toBool()) return; + return $this->addModuleExtraVars($output->data); + } + + /** + * @brief 모듈의 기본 정보에 추가 변수 구함 + **/ + function addModuleExtraVars($module_info) { + // 1개 이상의 모듈정보를 요청받아도 처리 가능하도록 + if(!is_array($module_info)) $target_module_info = array($module_info); + else $target_module_info = $module_info; + + // 모듈 번호를 구함 + $module_srls = array(); + foreach($target_module_info as $key => $val) { + $module_srl = $val->module_srl; + if(!$module_srl) continue; + $module_srls[] = $val->module_srl; + } + + // 모듈의 추가정보/ 스킨 정보를 추출 + $extra_vars = $this->getModuleExtraVars($module_srls); + if(!count($module_srls) || !count($extra_vars)) return $module_info; + + foreach($target_module_info as $key => $val) { + if(!$extra_vars[$val->module_srl] || !count($extra_vars[$val->module_srl])) continue; + foreach($extra_vars[$val->module_srl] as $k => $v) { + if($target_module_info[$key]->{$k}) continue; + $target_module_info[$key]->{$k} = $v; + } + } + if(is_array($module_info)) return $target_module_info; + return $target_module_info[0]; + } + + /** + * @brief DB에 생성된 mid 전체 목록을 구해옴 + **/ + function getMidList($args = null) { + $output = executeQuery('module.getMidList', $args); + if(!$output->toBool()) return $output; + + $list = $output->data; + if(!$list) return; + + if(!is_array($list)) $list = array($list); + + foreach($list as $val) { + $mid_list[$val->mid] = $val; + } + return $mid_list; + } + + /** + * @brief mid 목록에 대응하는 module_srl을 배열로 return + **/ + function getModuleSrlByMid($mid) { + if($mid && !is_array($mid)) $mid = explode(',',$mid); + if(is_array($mid)) $mid = "'".implode("','",$mid)."'"; + + $site_module_info = Context::get('site_module_info'); + + $args->mid = $mid; + if($site_module_info) $args->site_srl = $site_module_info->site_srl; + $output = executeQuery('module.getModuleSrlByMid', $args); + if(!$output->toBool()) return $output; + + $list = $output->data; + if(!$list) return; + if(!is_array($list)) $list = array($list); + + foreach($list as $key => $val) { + $module_srl_list[] = $val->module_srl; + } + + return $module_srl_list; + } + + /** + * @brief act 값에 의한 forward 값을 구함 + **/ + function getActionForward($act, $module = "") { + $args->act = $act; + $args->module = ($module)?$module:null; + if (strlen ($args->module) > 0) $output = executeQuery ('module.getActionForwardWithModule', $args); + else $output = executeQuery('module.getActionForward',$args); + return $output->data; + } + + /** + * @brief trigger_name에 등록된 모든 목록을 추출 + **/ + function getTriggers($trigger_name, $called_position) { + $args->trigger_name = $trigger_name; + $args->called_position = $called_position; + $output = executeQueryArray('module.getTriggers',$args); + return $output->data; + } + + /** + * @brief 특정 trigger_name의 특정 대상을 추출 + **/ + function getTrigger($trigger_name, $module, $type, $called_method, $called_position) { + $args->trigger_name = $trigger_name; + $args->module = $module; + $args->type = $type; + $args->called_method = $called_method; + $args->called_position = $called_position; + $output = executeQuery('module.getTrigger',$args); + return $output->data; + } + + /** + * @brief 특정 module extend 가져옴 + **/ + function getModuleExtend($parent_module, $type, $kind='') { + $key = $parent_module.'.'.$kind.'.'.$type; + + $module_extend_info = $this->loadModuleExtends(); + if(array_key_exists($key, $module_extend_info)) + { + return $module_extend_info[$key]; + } + + return false; + } + + /** + * @brief 모든 module extend 가져옴 + **/ + function loadModuleExtends() { + $cache_file = './files/config/module_extend.php'; + $cache_file = FileHandler::getRealPath($cache_file); + + if(!isset($GLOBALS['__MODULE_EXTEND__'])){ + + // check pre install + if(file_exists(FileHandler::getRealPath('./files')) && !file_exists($cache_file)) { + $arr = array(); + $output = executeQueryArray('module.getModuleExtend'); + if($output->data){ + foreach($output->data as $v){ + $arr[] = sprintf("'%s.%s.%s' => '%s'", $v->parent_module, $v->kind, $v->type, $v->extend_module); + } + } + + $str = ''; + $str = sprintf($str, join(',',$arr)); + + FileHandler::writeFile($cache_file, $str); + } + + + if(file_exists($cache_file)) { + $GLOBALS['__MODULE_EXTEND__'] = include($cache_file); + } else { + $GLOBALS['__MODULE_EXTEND__'] = array(); + } + } + + return $GLOBALS['__MODULE_EXTEND__']; + } + + /** + * @brief 모듈의 conf/info.xml 을 읽어서 정보를 구함 + **/ + function getModuleInfoXml($module) { + // 요청된 모듈의 경로를 구한다. 없으면 return + $module_path = ModuleHandler::getModulePath($module); + if(!$module_path) return; + + // 현재 선택된 모듈의 스킨의 정보 xml 파일을 읽음 + $xml_file = sprintf("%s/conf/info.xml", $module_path); + if(!file_exists($xml_file)) return; + + $oXmlParser = new XmlParser(); + $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); + $xml_obj = $tmp_xml_obj->module; + + if(!$xml_obj) return; + + // 모듈 정보 + if($xml_obj->version && $xml_obj->attrs->version == '0.2') { + // module format 0.2 + $module_info->title = $xml_obj->title->body; + $module_info->description = $xml_obj->description->body; + $module_info->version = $xml_obj->version->body; + $module_info->homepage = $xml_obj->link->body; + $module_info->category = $xml_obj->category->body; + if(!$module_info->category) $module_info->category = 'service'; + sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d); + $module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); + $module_info->license = $xml_obj->license->body; + $module_info->license_link = $xml_obj->license->attrs->link; + + if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; + else $author_list = $xml_obj->author; + + foreach($author_list as $author) { + unset($author_obj); + $author_obj->name = $author->name->body; + $author_obj->email_address = $author->attrs->email_address; + $author_obj->homepage = $author->attrs->link; + $module_info->author[] = $author_obj; + } + + // history + if($xml_obj->history) { + if(!is_array($xml_obj->history)) $history[] = $xml_obj->history; + else $history = $xml_obj->history; + + foreach($history as $item) { + unset($obj); + + if($item->author) { + (!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author; + + foreach($obj->author_list as $author) { + unset($author_obj); + $author_obj->name = $author->name->body; + $author_obj->email_address = $author->attrs->email_address; + $author_obj->homepage = $author->attrs->link; + $obj->author[] = $author_obj; + } + } + + $obj->name = $item->name->body; + $obj->email_address = $item->attrs->email_address; + $obj->homepage = $item->attrs->link; + $obj->version = $item->attrs->version; + $obj->date = $item->attrs->date; + $obj->description = $item->description->body; + + if($item->log) { + (!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log; + + foreach($obj->log as $log) { + unset($logs_obj); + $logs_obj->text = $log->body; + $logs_obj->link = $log->attrs->link; + $obj->logs[] = $logs_obj; + } + } + + $module_info->history[] = $obj; + } + } + + + } else { + // module format 0.1 + $module_info->title = $xml_obj->title->body; + $module_info->description = $xml_obj->author->description->body; + $module_info->version = $xml_obj->attrs->version; + $module_info->category = $xml_obj->attrs->category; + if(!$module_info->category) $module_info->category = 'service'; + sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d); + $module_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); + $author_obj->name = $xml_obj->author->name->body; + $author_obj->email_address = $xml_obj->author->attrs->email_address; + $author_obj->homepage = $xml_obj->author->attrs->link; + $module_info->author[] = $author_obj; + } + + // action 정보를 얻어서 admin_index를 추가 + $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; + $module_info->setup_index_act = $action_info->setup_index_act; + + return $module_info; + } + + /** + * @brief module의 conf/module.xml 을 통해 grant(권한) 및 action 데이터를 return + * module.xml 파일의 경우 파싱하는데 시간이 걸리기에 캐싱을 한다... + * 캐싱을 할때 바로 include 할 수 있도록 역시 코드까지 추가하여 캐싱을 한다. + * 이게 퍼포먼스 상으로는 좋은데 어떤 부정적인 결과를 유도할지는 잘 모르겠... + **/ + function getModuleActionXml($module) { + // 요청된 모듈의 경로를 구한다. 없으면 return + $class_path = ModuleHandler::getModulePath($module); + if(!$class_path) return; + + // 해당 경로에 module.xml 파일이 있는지 체크한다. 없으면 return + $xml_file = sprintf("%sconf/module.xml", $class_path); + if(!file_exists($xml_file)) return; + + // 캐시된 파일이 있는지 확인 + $cache_file = sprintf("./files/cache/module_info/%s.%s.php", $module, Context::getLangType()); + + // 캐시 파일이 없거나 캐시 파일이 xml 파일보다 오래되었으면 내용 다시 갱신 + if(!file_exists($cache_file) || filemtime($cache_file)module)) return; ///< xml 내용중에 module 태그가 없다면 오류;; + + $grants = $xml_obj->module->grants->grant; ///< 권한 정보 (없는 경우도 있음) + $permissions = $xml_obj->module->permissions->permission; ///< 권한 대행 (없는 경우도 있음) + $actions = $xml_obj->module->actions->action; ///< action list (필수) + + $default_index = $admin_index = ''; + + // 권한 정보의 정리 + if($grants) { + if(is_array($grants)) $grant_list = $grants; + else $grant_list[] = $grants; + + foreach($grant_list as $grant) { + $name = $grant->attrs->name; + $default = $grant->attrs->default?$grant->attrs->default:'guest'; + $title = $grant->title->body; + + $info->grant->{$name}->title = $title; + $info->grant->{$name}->default = $default; + + $buff .= sprintf('$info->grant->%s->title=\'%s\';', $name, $title); + $buff .= sprintf('$info->grant->%s->default=\'%s\';', $name, $default); + } + } + + // 권한 허용 정리 + if($permissions) { + if(is_array($permissions)) $permission_list = $permissions; + else $permission_list[] = $permissions; + + foreach($permission_list as $permission) { + $action = $permission->attrs->action; + $target = $permission->attrs->target; + + $info->permission->{$action} = $target; + + $buff .= sprintf('$info->permission->%s = \'%s\';', $action, $target); + } + } + + // actions 정리 + if($actions) { + if(is_array($actions)) $action_list = $actions; + else $action_list[] = $actions; + + foreach($action_list as $action) { + $name = $action->attrs->name; + + $type = $action->attrs->type; + $grant = $action->attrs->grant?$action->attrs->grant:'guest'; + $standalone = $action->attrs->standalone=='true'?'true':'false'; + + $index = $action->attrs->index; + $admin_index = $action->attrs->admin_index; + $setup_index = $action->attrs->setup_index; + + $output->action->{$name}->type = $type; + $output->action->{$name}->grant = $grant; + $output->action->{$name}->standalone= $standalone; + + $info->action->{$name}->type = $type; + $info->action->{$name}->grant = $grant; + $info->action->{$name}->standalone = $standalone=='true'?true:false; + + $buff .= sprintf('$info->action->%s->type=\'%s\';', $name, $type); + $buff .= sprintf('$info->action->%s->grant=\'%s\';', $name, $grant); + $buff .= sprintf('$info->action->%s->standalone=%s;', $name, $standalone); + + if($index=='true') { + $default_index_act = $name; + $info->default_index_act = $name; + } + if($admin_index=='true') { + $admin_index_act = $name; + $info->admin_index_act = $name; + } + if($setup_index=='true') { + $setup_index_act = $name; + $info->setup_index_act = $name; + } + } + } + $buff = sprintf('default_index_act = \'%s\';$info->setup_index_act=\'%s\';$info->admin_index_act = \'%s\';%s?>', $default_index_act, $setup_index_act, $admin_index_act, $buff); + + FileHandler::writeFile($cache_file, $buff); + + return $info; + } + + @include($cache_file); + + return $info; + } + + + /** + * @brief 주어진 곳의 스킨 목록을 구함 + * 스킨과 skin.xml 파일을 분석 정리한 결과를 return + **/ + function getSkins($path, $dir = 'skins') { + $skin_path = sprintf("%s/%s/", $path, $dir); + $list = FileHandler::readDir($skin_path); + if(!count($list)) return; + + natcasesort($list); + + foreach($list as $skin_name) { + unset($skin_info); + $skin_info = $this->loadSkinInfo($path, $skin_name, $dir); + if(!$skin_info) $skin_info->title = $skin_name; + + $skin_list[$skin_name] = $skin_info; + } + + return $skin_list; + } + + /** + * @brief 특정 위치의 특정 스킨의 정보를 구해옴 + **/ + function loadSkinInfo($path, $skin, $dir = 'skins') { + + // 모듈의 스킨의 정보 xml 파일을 읽음 + 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 객체 생성 + $oXmlParser = new XmlParser(); + $_xml_obj = $oXmlParser->loadXmlFile($skin_xml_file); + + // 스킨 정보가 없으면 return + if(!$_xml_obj->skin) return; + $xml_obj = $_xml_obj->skin; + + // 스킨이름 + $skin_info->title = $xml_obj->title->body; + + + // 작성자 정보 + 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); + $skin_info->version = $xml_obj->version->body; + $skin_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); + $skin_info->homepage = $xml_obj->link->body; + $skin_info->license = $xml_obj->license->body; + $skin_info->license_link = $xml_obj->license->attrs->link; + $skin_info->description = $xml_obj->description->body; + + if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author; + else $author_list = $xml_obj->author; + + foreach($author_list as $author) { + unset($author_obj); + $author_obj->name = $author->name->body; + $author_obj->email_address = $author->attrs->email_address; + $author_obj->homepage = $author->attrs->link; + $skin_info->author[] = $author_obj; + } + + // 확장변수를 정리 + if($xml_obj->extra_vars) { + $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); + + foreach($extra_var_groups as $group) { + $extra_vars = $group->var; + if(!is_array($group->var)) $extra_vars = array($group->var); + + foreach($extra_vars as $key => $val) { + unset($obj); + if(!$val->attrs->type) { $val->attrs->type = 'text'; } + + $obj->group = $group->title->body; + $obj->name = $val->attrs->name; + $obj->title = $val->title->body; + $obj->type = $val->attrs->type; + $obj->description = $val->description->body; + $obj->value = $extra_vals->{$obj->name}; + $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목록을 구한다. + if(is_array($val->options)) { + $option_count = count($val->options); + + for($i = 0; $i < $option_count; $i++) { + $obj->options[$i]->title = $val->options[$i]->title->body; + $obj->options[$i]->value = $val->options[$i]->attrs->value; + } + } else { + $obj->options[0]->title = $val->options->title->body; + $obj->options[0]->value = $val->options->attrs->value; + } + + $skin_info->extra_vars[] = $obj; + } + } + } + + // history + if($xml_obj->history) { + if(!is_array($xml_obj->history)) $history[] = $xml_obj->history; + else $history = $xml_obj->history; + + foreach($history as $item) { + unset($obj); + + if($item->author) { + (!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author; + + foreach($obj->author_list as $author) { + unset($author_obj); + $author_obj->name = $author->name->body; + $author_obj->email_address = $author->attrs->email_address; + $author_obj->homepage = $author->attrs->link; + $obj->author[] = $author_obj; + } + } + + $obj->name = $item->name->body; + $obj->email_address = $item->attrs->email_address; + $obj->homepage = $item->attrs->link; + $obj->version = $item->attrs->version; + $obj->date = $item->attrs->date; + $obj->description = $item->description->body; + + if($item->log) { + (!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log; + + foreach($obj->log as $log) { + unset($log_obj); + $log_obj->text = $log->body; + $log_obj->link = $log->attrs->link; + $obj->logs[] = $log_obj; + } + } + + $skin_info->history[] = $obj; + } + } + + + } else { + + // skin format v0.1 + sscanf($xml_obj->maker->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d); + + $skin_info->version = $xml_obj->version->body; + $skin_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d); + $skin_info->homepage = $xml_obj->link->body; + $skin_info->license = $xml_obj->license->body; + $skin_info->license_link = $xml_obj->license->attrs->link; + $skin_info->description = $xml_obj->maker->description->body; + + $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; + + // 스킨에서 사용되는 변수들 + $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); + + foreach($extra_var_groups as $group){ + $extra_vars = $group->var; + + if($extra_vars) { + + if(!is_array($extra_vars)) $extra_vars = array($extra_vars); + + foreach($extra_vars as $var) { + unset($obj); + unset($options); + + $group = $group->title->body; + $name = $var->attrs->name; + $type = $var->attrs->type; + $title = $var->title->body; + $description = $var->description->body; + + // 'select'type에서 option목록을 구한다. + if(is_array($var->default)) { + $option_count = count($var->default); + + for($i = 0; $i < $option_count; $i++) { + $options[$i]->title = $var->default[$i]->body; + $options[$i]->value = $var->default[$i]->body; + } + } else { + $options[0]->title = $var->default->body; + $options[0]->value = $var->default->body; + } + + $width = $var->attrs->width; + $height = $var->attrs->height; + + unset($obj); + $obj->group = $group; + $obj->title = $title; + $obj->description = $description; + $obj->name = $name; + $obj->type = $type; + $obj->options = $options; + $obj->width = $width; + $obj->height = $height; + $obj->default = $options[0]->value; + + $skin_info->extra_vars[] = $obj; + } + } + } + } + + // colorset + $colorset = $xml_obj->colorset->color; + if($colorset) { + if(!is_array($colorset)) $colorset = array($colorset); + + foreach($colorset as $color) { + $name = $color->attrs->name; + $title = $color->title->body; + $screenshot = $color->attrs->src; + if($screenshot) { + $screenshot = sprintf("%sskins/%s/%s", $path, $skin, $screenshot); + if(!file_exists($screenshot)) $screenshot = ""; + } else $screenshot = ""; + + unset($obj); + $obj->name = $name; + $obj->title = $title; + $obj->screenshot = $screenshot; + $skin_info->colorset[] = $obj; + } + } + + // 메뉴 종류 (레이아웃을 위한 설정) + if($xml_obj->menus->menu) { + $menus = $xml_obj->menus->menu; + if(!is_array($menus)) $menus = array($menus); + + $menu_count = count($menus); + $skin_info->menu_count = $menu_count; + for($i=0;$i<$menu_count;$i++) { + unset($obj); + + $obj->name = $menus[$i]->attrs->name; + if($menus[$i]->attrs->default == "true") $obj->default = true; + $obj->title = $menus[$i]->title->body; + $obj->maxdepth = $menus[$i]->maxdepth->body; + + $skin_info->menu->{$obj->name} = $obj; + } + } + + return $skin_info; + } + + /** + * @brief 특정 가상 사이트에 등록된 특정 모듈의 개수를 return + **/ + function getModuleCount($site_srl, $module = null) { + $args->site_srl = $site_srl; + if(!is_null($module)) $args->module = $module; + $output = executeQuery('module.getModuleCount', $args); + return $output->data->count; + } + + /** + * @brief 특정 모듈의 설정 return + * board, member등 특정 모듈의 global config 관리용 + **/ + function getModuleConfig($module) { + if(!$GLOBALS['__ModuleConfig__'][$module]) { + $args->module = $module; + $output = executeQuery('module.getModuleConfig', $args); + $config = unserialize($output->data->config); + $GLOBALS['__ModuleConfig__'][$module] = $config; + } + return $GLOBALS['__ModuleConfig__'][$module]; + } + + /** + * @brief 특정 mid의 모듈 설정 정보 return + * mid의 모듈 의존적인 설정을 관리 + **/ + function getModulePartConfig($module, $module_srl) { + if(!$GLOBALS['__ModulePartConfig__'][$module][$module_srl]) { + $args->module = $module; + $args->module_srl = $module_srl; + $output = executeQuery('module.getModulePartConfig', $args); + $config = unserialize($output->data->config); + $GLOBALS['__ModulePartConfig__'][$module][$module_srl] = $config; + } + return $GLOBALS['__ModulePartConfig__'][$module][$module_srl]; + } + + /** + * @brief mid별 모듈 설정 정보 전체를 구함 + **/ + function getModulePartConfigs($module, $site_srl = 0) { + $args->module = $module; + if($site_srl) $args->site_srl = $site_srl; + $output = executeQueryArray('module.getModulePartConfigs', $args); + if(!$output->toBool() || !$output->data) return array(); + + foreach($output->data as $key => $val) { + $result[$val->module_srl] = unserialize($val->config); + } + return $result; + } + + + /** + * @brief 모듈 카테고리의 목록을 구함 + **/ + function getModuleCategories() { + // 데이터를 DB에서 가져옴 + $output = executeQuery('module.getModuleCategories'); + if(!$output->toBool()) return $output; + $list = $output->data; + if(!$list) return; + if(!is_array($list)) $list = array($list); + + foreach($list as $val) { + $category_list[$val->module_category_srl] = $val; + } + return $category_list; + } + + /** + * @brief 특정 모듈 카테고리의 내용을 구함 + **/ + function getModuleCategory($module_category_srl) { + // 데이터를 DB에서 가져옴 + $args->module_category_srl = $module_category_srl; + $output = executeQuery('module.getModuleCategory', $args); + if(!$output->toBool()) return $output; + return $output->data; + } + + /** + * @brief 모듈의 xml 정보만 구함 + **/ + function getModulesXmlInfo() { + // 다운받은 모듈과 설치된 모듈의 목록을 구함 + $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 = $searched_list[$i]; + + $path = ModuleHandler::getModulePath($module_name); + + // 해당 모듈의 정보를 구함 + $info = $this->getModuleInfoXml($module_name); + unset($obj); + + $info->module = $module_name; + $info->created_table_count = $created_table_count; + $info->table_count = $table_count; + $info->path = $path; + $info->admin_index_act = $info->admin_index_act; + $list[] = $info; + } + return $list; + } + + function checkNeedInstall($module_name) + { + $oDB = &DB::getInstance(); + $info = null; + + $moduledir = ModuleHandler::getModulePath($module_name); + if(file_exists(FileHandler::getRealPath($moduledir."schemas"))) + { + $tmp_files = FileHandler::readDir($moduledir."schemas", '/(\.xml)$/'); + $table_count = count($tmp_files); + + // 테이블이 설치되어 있는지 체크 + $created_table_count = 0; + for($j=0;$jisTableExists($table_name)) $created_table_count ++; + } + + // 설치 유무 체크 (설치는 DB의 설치만 관리) + if($table_count > $created_table_count) return true; + else return false; + } + return false; + } + + function checkNeedUpdate($module_name) + { + // 각 모듈의 module.class.php로 upgrade 유무 체크 + $oDummy = &getModule($module_name, 'class'); + if($oDummy && method_exists($oDummy, "checkUpdate")) { + return $oDummy->checkUpdate(); + } + return false; + } + + /** + * @brief 모듈의 종류와 정보를 구함 + **/ + function getModuleList() { + // DB 객체 생성 + $oDB = &DB::getInstance(); + + // 다운받은 모듈과 설치된 모듈의 목록을 구함 + $searched_list = FileHandler::readDir('./modules'); + sort($searched_list); + + $searched_count = count($searched_list); + if(!$searched_count) return; + + for($i=0;$i<$searched_count;$i++) { + // 모듈의 이름 + $module_name = $searched_list[$i]; + + $path = ModuleHandler::getModulePath($module_name); + + // schemas내의 테이블 생성 xml파일수를 구함 + $tmp_files = FileHandler::readDir($path."schemas", '/(\.xml)$/'); + $table_count = count($tmp_files); + + // 테이블이 설치되어 있는지 체크 + $created_table_count = 0; + for($j=0;$jisTableExists($table_name)) $created_table_count ++; + } + + // 해당 모듈의 정보를 구함 + $info = $this->getModuleInfoXml($module_name); + unset($obj); + + $info->module = $module_name; + $info->category = $info->category; + $info->created_table_count = $created_table_count; + $info->table_count = $table_count; + $info->path = $path; + $info->admin_index_act = $info->admin_index_act; + + // 설치 유무 체크 (설치는 DB의 설치만 관리) + if($table_count > $created_table_count) $info->need_install = true; + else $info->need_install = false; + + // 각 모듈의 module.class.php로 upgrade 유무 체크 + $oDummy = null; + $oDummy = &getModule($module_name, 'class'); + if($oDummy && method_exists($oDummy, "checkUpdate")) { + $info->need_update = $oDummy->checkUpdate(); + } + else + { + continue; + } + + $list[] = $info; + } + return $list; + } + + /** + * @brief 특정 module srls를 sites의 domain과 결합 + * 아직 XE DBHandler에서 left outer join이 안되어서.. + * $output->data[]->module_srl 과 같은 구조여야 함 + **/ + function syncModuleToSite(&$data) { + if(!$data) return; + + if(is_array($data)) { + foreach($data as $key => $val) { + $module_srls[] = $val->module_srl; + } + if(!count($module_srls)) return; + } else { + $module_srls[] = $data->module_srl; + } + + $args->module_srls = implode(',',$module_srls); + $output = executeQueryArray('module.getModuleSites', $args); + if(!$output->data) return array(); + foreach($output->data as $key => $val) { + $modules[$val->module_srl] = $val; + } + + if(is_array($data)) { + foreach($data as $key => $val) { + $data[$key]->domain = $modules[$val->module_srl]->domain; + } + } else { + $data->domain = $modules[$data->module_srl]->domain; + } + } + + /** + * @brief site_module_info의 관리자 인지 체크 + **/ + function isSiteAdmin($member_info, $site_srl = null) { + if(!$member_info->member_srl) return false; + if($member_info->is_admin == 'Y') return true; + + if(!isset($site_srl)) + { + $site_module_info = Context::get('site_module_info'); + if(!$site_module_info) return; + $args->site_srl = $site_module_info->site_srl; + } + else + { + $args->site_srl = $site_srl; + } + + $args->member_srl = $member_info->member_srl; + $output = executeQuery('module.isSiteAdmin', $args); + if($output->data->member_srl == $args->member_srl) return true; + return false; + + } + + /** + * @brief site의 관리자 정보를 구함 + **/ + function getSiteAdmin($site_srl) { + $args->site_srl = $site_srl; + $output = executeQueryArray('module.getSiteAdmin', $args); + return $output->data; + } + + /** + * @brief 특정 모듈의 관리자 아이디 구함 + **/ + function getAdminId($module_srl) { + $obj->module_srl = $module_srl; + $output = executeQueryArray('module.getAdminID', $obj); + if(!$output->toBool() || !$output->data) return; + + return $output->data; + } + + /** + * @brief 특정 모듈의 추가 변수를 구함 + * modules 테이블의 기본 정보 이외의 것 + **/ + function getModuleExtraVars($module_srl) { + if(is_array($module_srl)) $module_srl = implode(',',$module_srl); + $args->module_srl = $module_srl; + $output = executeQueryArray('module.getModuleExtraVars',$args); + if(!$output->toBool() || !$output->data) return; + + $vars = array(); + foreach($output->data as $key => $val) { + if(in_array($val->name, array('mid','module')) || $val->value == 'Array') continue; + $vars[$val->module_srl]->{$val->name} = $val->value; + } + return $vars; + } + + /** + * @brief 특정 모듈의 스킨 정보를 구함 + **/ + function getModuleSkinVars($module_srl) { + $args->module_srl = $module_srl; + $output = executeQueryArray('module.getModuleSkinVars',$args); + if(!$output->toBool() || !$output->data) return; + + $skin_vars = array(); + foreach($output->data as $val) $skin_vars[$val->name] = $val; + return $skin_vars; + } + + /** + * @brief 특정 모듈의 스킨 정보를 모듈 정보와 결합 + **/ + function syncSkinInfoToModuleInfo(&$module_info) { + if(!$module_info->module_srl) return; + + $args->module_srl = $module_info->module_srl; + $output = executeQueryArray('module.getModuleSkinVars',$args); + if(!$output->toBool() || !$output->data) return; + + foreach($output->data as $val) { + if(isset($module_info->{$val->name})) continue; + $module_info->{$val->name} = $val->value; + } + } + + /** + * @brief 특정 모듈정보와 XML, 그리고 회원 정보로 권한을 return + **/ + function getGrant($module_info, $member_info, $xml_info = '') { + if(!$xml_info) { + $module = $module_info->module; + $xml_info = $this->getModuleActionXml($module); + } + // 그룹 권한 설정에 필요한 변수를 세팅 + $module_srl = $module_info->module_srl; + $grant_info = $xml_info->grant; + if($member_info->member_srl) { + if(is_array($member_info->group_list)) $group_list = array_keys($member_info->group_list); + else $group_list = array(); + } else { + $group_list = array(); + } + + // module_srl이 없는 즉 별도의 권한 설정이 안되는 경우 + 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이 있는 경우 + } else { + + // grant 종류를 구함 + $grant->access = $grant->is_admin = $grant->manager = ($member_info->is_admin=='Y'||$this->isSiteAdmin($member_info))?true:false; + + // 관리자가 아니라 로그인 회원일 경우 이 모듈의 관리자인지 확인 + 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(!$grant->manager) { + $args = null; + + // 플래닛인 경우 planet home의 권한 설정을 가져온다 + if ($module_info->module == 'planet') { + $output = executeQueryArray('module.getPlanetGrants', $args); + } + else { + $args->module_srl = $module_srl; + $output = executeQueryArray('module.getModuleGrants', $args); + } + + $grant_exists = $granted = array(); + + if($output->data) { + // 1차적으로 권한 대상 이름과 그룹을 정리 + foreach($output->data as $val) { + $grant_exists[$val->name] = true; + if($granted[$val->name]) continue; + + // 로그인 회원만 + if($val->group_srl == -1) { + $granted[$val->name] = true; + if($member_info->member_srl) $grant->{$val->name} = true; + + // 사이트 가입한 회원만 + } elseif($val->group_srl == -2) { + $granted[$val->name] = true; + // 비로그인 회원이면 권한 미부여 + if(!$member_info->member_srl) $grant->{$val->name} = false; + // 로그인 회원 + else { + $site_module_info = Context::get('site_module_info'); + // 현재 접속된 사이트 정보가 없으면 권한 부여 + if(!$site_module_info->site_srl) $grant->{$val->name} = true; + // 현재 접속된 사이트의 그룹 정보가 있 으면 권한 미부여 + elseif(count($group_list)) $grant->{$val->name} = true; + } + + // 비로그인 회원 모두 + } elseif($val->group_srl == 0) { + $granted[$val->name] = true; + $grant->{$val->name} = true; + // 특정 그룹 대상일 경우 + } else { + if($group_list && count($group_list) && in_array($val->group_srl, $group_list)) { + $grant->{$val->name} = true; + $granted[$val->name] = true; + } + } + } + } + + // 가상 그룹인 access에 대해서 별도 처리 + if(!$grant_exists['access']) $grant->access = true; + if(count($grant_info)) { + foreach($grant_info as $grant_name => $grant_item) { + if($grant_exists[$grant_name]) continue; + switch($grant_item->default) { + case 'guest' : + $grant->{$grant_name} = true; + break; + case 'member' : + if($member_info->member_srl) $grant->{$grant_name} = true; + else $grant->{$grant_name} = false; + break; + case 'site' : + $site_module_info = Context::get('site_module_info'); + if($member_info->member_srl && (($site_module_info->site_srl && count($group_list)) || !$site_module_info->site_srl)) $grant->{$grant_name} = true; + else $grant->{$grant_name} = false; + break; + case 'manager' : + case 'root' : + if($member_info->is_admin == 'Y') $grant->{$grant_name} = true; + else $grant->{$grant_name} = false; + break; + } + } + } + } + + // 관리자일 경우 모든 권한에 대해 true 지정 + if($grant->manager) { + $grant->access = true; + if(count($grant_info)) { + foreach($grant_info as $key => $val) { + $grant->{$key} = true; + } + } + } + + } + return $grant; + } + + + + function getModuleFileBox($module_filebox_srl){ + $args->module_filebox_srl = $module_filebox_srl; + return executeQuery('module.getModuleFileBox', $args); + } + + function getModuleFileBoxList(){ + $args->page = Context::get('page'); + $args->list_count = 10; + $args->page_count = 10; + return executeQuery('module.getModuleFileBoxList', $args); + } + + function getModuleFileBoxPath($module_filebox_srl){ + return sprintf("./files/attach/filebox/%s",getNumberingPath($module_filebox_srl,3)); + } + } +?> diff --git a/modules/module/module.view.php b/modules/module/module.view.php index 65ec532ab..16982fcc6 100644 --- a/modules/module/module.view.php +++ b/modules/module/module.view.php @@ -1,161 +1,161 @@ -setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 스킨 정보 출력 - **/ - function dispModuleSkinInfo() { - $selected_module = Context::get('selected_module'); - $skin = Context::get('skin'); - - // 모듈/스킨 정보를 구함 - $module_path = sprintf("./modules/%s/", $selected_module); - if(!is_dir($module_path)) $this->stop("msg_invalid_request"); - - $skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin); - if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request"); - - $oModuleModel = &getModel('module'); - $skin_info = $oModuleModel->loadSkinInfo($module_path, $skin); - Context::set('skin_info',$skin_info); - - $this->setLayoutFile("popup_layout"); - $this->setTemplateFile("skin_info"); - } - - /** - * @brief 모듈 선택기 - **/ - function dispModuleSelectList() { - if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted'); - - $oModuleModel = &getModel('module'); - - // virtual site의 개수를 추출 - $output = executeQuery('module.getSiteCount'); - $site_count = $output->data->count; - Context::set('site_count', $site_count); - - // 사이트 검색어 변수 설정 - $site_keyword = Context::get('site_keyword'); - - // 사이트 검색어가 없으면 현재 가상 사이트의 정보를 설정 - $args = null; - $logged_info = Context::get('logged_info'); - if($logged_info->is_admin == 'Y') { - $query_id = 'module.getSiteModules'; - $module_category_exists = false; - if(!$site_keyword) { - $site_module_info = Context::get('site_module_info'); - if($site_module_info && $logged_info->is_admin != 'Y') { - $site_keyword = $site_module_info->domain; - $args->site_srl = (int)$site_module_info->site_srl; - Context::set('site_keyword', $site_keyword); - } else { - $query_id = 'module.getDefaultModules'; - $args->site_srl = 0; - $module_category_exists = true; - } - // 사이트 검색어가 있으면 해당 사이트(들)의 정보를 추출 - } else { - $args->site_keyword = $site_keyword; - } - } else { - $query_id = 'module.getSiteModules'; - $site_module_info = Context::get('site_module_info'); - $args->site_srl = (int)$site_module_info->site_srl; - } - //if(is_null($args->site_srl)) $query_id = 'module.getDefaultModules'; - - // 지정된 사이트(혹은 전체)의 module 목록을 구함 - $output = executeQueryArray($query_id, $args); - $category_list = $mid_list = array(); - if(count($output->data)) { - foreach($output->data as $key => $val) { - $module = trim($val->module); - if(!$module) continue; - - $category = $val->category; - $obj = null; - $obj->module_srl = $val->module_srl; - $obj->browser_title = $val->browser_title; - $mid_list[$module]->list[$category][$val->mid] = $obj; - } - } - - $selected_module = Context::get('selected_module'); - if(count($mid_list)) { - foreach($mid_list as $module => $val) { - if(!$selected_module) $selected_module = $module; - $xml_info = $oModuleModel->getModuleInfoXml($module); - $mid_list[$module]->title = $xml_info->title; - } - } - - Context::set('mid_list', $mid_list); - Context::set('selected_module', $selected_module); - Context::set('selected_mids', $mid_list[$selected_module]->list); - Context::set('module_category_exists', $module_category_exists); - - // 레이아웃을 팝업으로 지정 - $this->setLayoutFile('popup_layout'); - - // 템플릿 파일 지정 - $this->setTemplateFile('module_selector'); - } - - - // 파일 박스 보기 - 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'); - - $input_name = Context::get('input'); - - if(!$input_name) return new Object(-1, 'msg_not_permitted'); - - - $addscript = sprintf('',$input_name); - Context::addHtmlHeader($addscript); - - $oModuleModel = &getModel('module'); - $output = $oModuleModel->getModuleFileBoxList(); - Context::set('filebox_list', $output->data); - - $filter = Context::get('filter'); - if($filter) Context::set('arrfilter',explode(',',$filter)); - - Context::set('page_navigation', $output->page_navigation); - $this->setLayoutFile('popup_layout'); - $this->setTemplateFile('filebox_list'); - } - - // 파일 박스 등록화면 - 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'); - - $filter = Context::get('filter'); - if($filter) Context::set('arrfilter',explode(',',$filter)); - - $this->setLayoutFile('popup_layout'); - $this->setTemplateFile('filebox_add'); - } - } -?> +setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 스킨 정보 출력 + **/ + function dispModuleSkinInfo() { + $selected_module = Context::get('selected_module'); + $skin = Context::get('skin'); + + // 모듈/스킨 정보를 구함 + $module_path = sprintf("./modules/%s/", $selected_module); + if(!is_dir($module_path)) $this->stop("msg_invalid_request"); + + $skin_info_xml = sprintf("%sskins/%s/skin.xml", $module_path, $skin); + if(!file_exists($skin_info_xml)) $this->stop("msg_invalid_request"); + + $oModuleModel = &getModel('module'); + $skin_info = $oModuleModel->loadSkinInfo($module_path, $skin); + Context::set('skin_info',$skin_info); + + $this->setLayoutFile("popup_layout"); + $this->setTemplateFile("skin_info"); + } + + /** + * @brief 모듈 선택기 + **/ + function dispModuleSelectList() { + if(!Context::get('is_logged')) return new Object(-1, 'msg_not_permitted'); + + $oModuleModel = &getModel('module'); + + // virtual site의 개수를 추출 + $output = executeQuery('module.getSiteCount'); + $site_count = $output->data->count; + Context::set('site_count', $site_count); + + // 사이트 검색어 변수 설정 + $site_keyword = Context::get('site_keyword'); + + // 사이트 검색어가 없으면 현재 가상 사이트의 정보를 설정 + $args = null; + $logged_info = Context::get('logged_info'); + if($logged_info->is_admin == 'Y') { + $query_id = 'module.getSiteModules'; + $module_category_exists = false; + if(!$site_keyword) { + $site_module_info = Context::get('site_module_info'); + if($site_module_info && $logged_info->is_admin != 'Y') { + $site_keyword = $site_module_info->domain; + $args->site_srl = (int)$site_module_info->site_srl; + Context::set('site_keyword', $site_keyword); + } else { + $query_id = 'module.getDefaultModules'; + $args->site_srl = 0; + $module_category_exists = true; + } + // 사이트 검색어가 있으면 해당 사이트(들)의 정보를 추출 + } else { + $args->site_keyword = $site_keyword; + } + } else { + $query_id = 'module.getSiteModules'; + $site_module_info = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + } + //if(is_null($args->site_srl)) $query_id = 'module.getDefaultModules'; + + // 지정된 사이트(혹은 전체)의 module 목록을 구함 + $output = executeQueryArray($query_id, $args); + $category_list = $mid_list = array(); + if(count($output->data)) { + foreach($output->data as $key => $val) { + $module = trim($val->module); + if(!$module) continue; + + $category = $val->category; + $obj = null; + $obj->module_srl = $val->module_srl; + $obj->browser_title = $val->browser_title; + $mid_list[$module]->list[$category][$val->mid] = $obj; + } + } + + $selected_module = Context::get('selected_module'); + if(count($mid_list)) { + foreach($mid_list as $module => $val) { + if(!$selected_module) $selected_module = $module; + $xml_info = $oModuleModel->getModuleInfoXml($module); + $mid_list[$module]->title = $xml_info->title; + } + } + + Context::set('mid_list', $mid_list); + Context::set('selected_module', $selected_module); + Context::set('selected_mids', $mid_list[$selected_module]->list); + Context::set('module_category_exists', $module_category_exists); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 파일 지정 + $this->setTemplateFile('module_selector'); + } + + + // 파일 박스 보기 + 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'); + + $input_name = Context::get('input'); + + if(!$input_name) return new Object(-1, 'msg_not_permitted'); + + + $addscript = sprintf('',$input_name); + Context::addHtmlHeader($addscript); + + $oModuleModel = &getModel('module'); + $output = $oModuleModel->getModuleFileBoxList(); + Context::set('filebox_list', $output->data); + + $filter = Context::get('filter'); + if($filter) Context::set('arrfilter',explode(',',$filter)); + + Context::set('page_navigation', $output->page_navigation); + $this->setLayoutFile('popup_layout'); + $this->setTemplateFile('filebox_list'); + } + + // 파일 박스 등록화면 + 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'); + + $filter = Context::get('filter'); + if($filter) Context::set('arrfilter',explode(',',$filter)); + + $this->setLayoutFile('popup_layout'); + $this->setTemplateFile('filebox_add'); + } + } +?> diff --git a/modules/module/queries/deleteModuleExtend.xml b/modules/module/queries/deleteModuleExtend.xml index e0b1d1f3a..8a4b45e81 100644 --- a/modules/module/queries/deleteModuleExtend.xml +++ b/modules/module/queries/deleteModuleExtend.xml @@ -1,11 +1,11 @@ - - - - - - - - - - - + + +
    + + + + + + + + diff --git a/modules/module/queries/deleteModuleFileBox.xml b/modules/module/queries/deleteModuleFileBox.xml index 5c9473ce5..d8c416f9c 100644 --- a/modules/module/queries/deleteModuleFileBox.xml +++ b/modules/module/queries/deleteModuleFileBox.xml @@ -1,8 +1,8 @@ - - -
    - - - - + + +
    + + + + \ No newline at end of file diff --git a/modules/module/queries/deleteTrigger.xml b/modules/module/queries/deleteTrigger.xml index 9327799b7..8760bdeac 100644 --- a/modules/module/queries/deleteTrigger.xml +++ b/modules/module/queries/deleteTrigger.xml @@ -1,12 +1,12 @@ - - -
    - - - - - - - - + + +
    + + + + + + + + \ No newline at end of file diff --git a/modules/module/queries/getModuleFileBox.xml b/modules/module/queries/getModuleFileBox.xml index b8faa2112..c2818239b 100644 --- a/modules/module/queries/getModuleFileBox.xml +++ b/modules/module/queries/getModuleFileBox.xml @@ -1,9 +1,9 @@ - - -
    - - - - - + + +
    + + + + + \ No newline at end of file diff --git a/modules/module/queries/getModuleFileBoxList.xml b/modules/module/queries/getModuleFileBoxList.xml index 76aa291c0..68ff42b85 100644 --- a/modules/module/queries/getModuleFileBoxList.xml +++ b/modules/module/queries/getModuleFileBoxList.xml @@ -1,15 +1,15 @@ - - -
    - - - - - - - - - - - + + +
    + + + + + + + + + + + \ No newline at end of file diff --git a/modules/module/queries/insertModuleFileBox.xml b/modules/module/queries/insertModuleFileBox.xml index e9fc56203..59b0410d8 100644 --- a/modules/module/queries/insertModuleFileBox.xml +++ b/modules/module/queries/insertModuleFileBox.xml @@ -1,14 +1,14 @@ - - -
    - - - - - - - - - - - + + +
    + + + + + + + + + + + diff --git a/modules/module/schemas/module_filebox.xml b/modules/module/schemas/module_filebox.xml index d2b4dfc29..939dcb0ab 100644 --- a/modules/module/schemas/module_filebox.xml +++ b/modules/module/schemas/module_filebox.xml @@ -1,9 +1,9 @@ -
    - - - - - - - +
    + + + + + + +
    \ No newline at end of file diff --git a/modules/module/tpl/css/mlang.css b/modules/module/tpl/css/mlang.css index e222155d8..add8b113c 100644 --- a/modules/module/tpl/css/mlang.css +++ b/modules/module/tpl/css/mlang.css @@ -1,24 +1,24 @@ -@charset "utf-8"; -/* Mobile XE Language (/modules/module/tpl/lang.html) */ -body{margin:0} -.bd{background:#f8f8f8;padding:1px 0} -/* Hx */ -.hx{position:relative;border-bottom:1px solid #ccc8be;padding:8px 10px;margin:0} -.hx:after{content:"";margin:0 -10px;position:relative;top:10px;display:block;clear:both;height:1px;background:#fff} -.hx.h2{background:#e5e5e5;text-shadow:1px 1px 0 #fff} -.hx h2{margin:0 10px 0 0;display:inline;font-size:16px;line-height:1.4} -/* Global Navigation */ -.gn{margin:0;padding:0;list-style:none;background:#d3d1cc;text-shadow:1px 1px 0 #fff} -.gn li{background:#c3c3c3;border:1px solid #a3a09a;border-left:0;border-right:0;margin:0 0 -1px 0} -.gn li li{background:#f8f8f8;border:1px solid #c9c9c9;border-left:0;border-right:0} -.gn li li li{background:#e8e8e8} -.gn ul{margin:0 0 -1px 0;padding:0;list-style:none} -.gn a,.gn strong{position:relative;text-decoration:none;display:block;padding:10px;font-size:16px} -.gn li a{color:#333} -.gn li a:after{position:absolute;top:7px;right:10px;content:"›";color:#888;font-size:18px;font-weight:bold;font-family:Verdana, Geneva, sans-serif} -.gn li li a:before{content:"";display:inline-block;width:6px;height:6px;border:1px dotted #666;border-top:0;border-right:0;margin:0 4px 0 0;vertical-align:top} -.gn li li a{padding-left:15px} -.gn li li li a{padding-left:30px} -.gn li li li li a{padding-left:45px} -.gn li li li li li a{padding-left:60px} -.gn em{color:#f63;font-size:12px} +@charset "utf-8"; +/* Mobile XE Language (/modules/module/tpl/lang.html) */ +body{margin:0} +.bd{background:#f8f8f8;padding:1px 0} +/* Hx */ +.hx{position:relative;border-bottom:1px solid #ccc8be;padding:8px 10px;margin:0} +.hx:after{content:"";margin:0 -10px;position:relative;top:10px;display:block;clear:both;height:1px;background:#fff} +.hx.h2{background:#e5e5e5;text-shadow:1px 1px 0 #fff} +.hx h2{margin:0 10px 0 0;display:inline;font-size:16px;line-height:1.4} +/* Global Navigation */ +.gn{margin:0;padding:0;list-style:none;background:#d3d1cc;text-shadow:1px 1px 0 #fff} +.gn li{background:#c3c3c3;border:1px solid #a3a09a;border-left:0;border-right:0;margin:0 0 -1px 0} +.gn li li{background:#f8f8f8;border:1px solid #c9c9c9;border-left:0;border-right:0} +.gn li li li{background:#e8e8e8} +.gn ul{margin:0 0 -1px 0;padding:0;list-style:none} +.gn a,.gn strong{position:relative;text-decoration:none;display:block;padding:10px;font-size:16px} +.gn li a{color:#333} +.gn li a:after{position:absolute;top:7px;right:10px;content:"›";color:#888;font-size:18px;font-weight:bold;font-family:Verdana, Geneva, sans-serif} +.gn li li a:before{content:"";display:inline-block;width:6px;height:6px;border:1px dotted #666;border-top:0;border-right:0;margin:0 4px 0 0;vertical-align:top} +.gn li li a{padding-left:15px} +.gn li li li a{padding-left:30px} +.gn li li li li a{padding-left:45px} +.gn li li li li li a{padding-left:60px} +.gn em{color:#f63;font-size:12px} diff --git a/modules/module/tpl/filebox_add.html b/modules/module/tpl/filebox_add.html index b95dcc392..6e91496c7 100644 --- a/modules/module/tpl/filebox_add.html +++ b/modules/module/tpl/filebox_add.html @@ -1,37 +1,37 @@ - - -
    -

    {$lang->filebox}

    -
    - -
    - - - - - - -
    - - - - - - - - - - - -
    {$lang->description}
    {$lang->file} -

    - - {@sprintf($lang->about_file_extension,join(", ",$arrfilter ))} - -

    -
    -
    -
    - -
    -
    + + +
    +

    {$lang->filebox}

    +
    + +
    + + + + + + +
    + + + + + + + + + + + +
    {$lang->description}
    {$lang->file} +

    + + {@sprintf($lang->about_file_extension,join(", ",$arrfilter ))} + +

    +
    +
    +
    + +
    +
    diff --git a/modules/module/tpl/filebox_list.html b/modules/module/tpl/filebox_list.html index 8c3fd4380..124f68ce1 100644 --- a/modules/module/tpl/filebox_list.html +++ b/modules/module/tpl/filebox_list.html @@ -1,65 +1,65 @@ - - -
    -

    {$lang->filebox}

    -
    - -
    - - - - - - - - - - - - - - - - - - - -
    {$lang->file}
    {$lang->description}
    {$lang->regdate}
     
    -
    - - - - - - - - - - - - - -
    -
    {$val->comment} {zdate($val->regdate,'Y-m-d H:i')} - - - - -
    - - -
    - - + + +
    +

    {$lang->filebox}

    +
    + +
    + + + + + + + + + + + + + + + + + + + +
    {$lang->file}
    {$lang->description}
    {$lang->regdate}
     
    +
    + + + + + + + + + + + + + +
    +
    {$val->comment} {zdate($val->regdate,'Y-m-d H:i')} + + + + +
    + + +
    + + diff --git a/modules/module/tpl/js/filebox.js b/modules/module/tpl/js/filebox.js index 1bf65d1d2..70717734f 100644 --- a/modules/module/tpl/js/filebox.js +++ b/modules/module/tpl/js/filebox.js @@ -1,44 +1,44 @@ -var selected_filebox = {}; - -// popup -function openFileBox(file_obj, filter){ - selected_filebox[file_obj.name] = file_obj; - var url = request_uri.setQuery('module','module').setQuery('act','dispModuleFileBox').setQuery('input',file_obj.name).setQuery('filter',filter); - popopen(url, "filebox"); -} - -function selectFileBoxFile(file_url, module_filebox_srl){ - if(!selected_filebox_input_name) return; - opener.selected_filebox[selected_filebox_input_name].value = file_url; - opener.document.getElementById('filebox_preview_'+selected_filebox_input_name).innerHTML = document.getElementById('filebox_preview_' + module_filebox_srl).innerHTML; - opener.document.getElementById('filebox_preview_'+selected_filebox_input_name).style.display=''; - opener.document.getElementById('filebox_unselect_'+selected_filebox_input_name).style.display=''; - window.close(); -} - -function deleteFileBoxFile(module_filebox_srl){ - var params ={ - "module_filebox_srl":module_filebox_srl - }; - - jQuery.exec_json('module.procModuleFileBoxDelete', params, function(data){ - document.location.reload(); - }); -} - -function unselectFileBox(id){ - jQuery("[name="+id+"]").val(''); - jQuery('#filebox_preview_'+id).html('').hide(); - jQuery('#filebox_unselect_'+id).hide(); -} - -function initFileBox(id){ - if(opener && opener.selectedWidget && opener.selectedWidget.getAttribute("widget")){ - var file = opener.selectedWidget.getAttribute(id); - if(file){ - var html = _displayMultimedia(file,"100%","100%"); - jQuery('#filebox_preview_'+id).html(html).show(); - jQuery('#filebox_unselect_'+id).show(); - } - } +var selected_filebox = {}; + +// popup +function openFileBox(file_obj, filter){ + selected_filebox[file_obj.name] = file_obj; + var url = request_uri.setQuery('module','module').setQuery('act','dispModuleFileBox').setQuery('input',file_obj.name).setQuery('filter',filter); + popopen(url, "filebox"); +} + +function selectFileBoxFile(file_url, module_filebox_srl){ + if(!selected_filebox_input_name) return; + opener.selected_filebox[selected_filebox_input_name].value = file_url; + opener.document.getElementById('filebox_preview_'+selected_filebox_input_name).innerHTML = document.getElementById('filebox_preview_' + module_filebox_srl).innerHTML; + opener.document.getElementById('filebox_preview_'+selected_filebox_input_name).style.display=''; + opener.document.getElementById('filebox_unselect_'+selected_filebox_input_name).style.display=''; + window.close(); +} + +function deleteFileBoxFile(module_filebox_srl){ + var params ={ + "module_filebox_srl":module_filebox_srl + }; + + jQuery.exec_json('module.procModuleFileBoxDelete', params, function(data){ + document.location.reload(); + }); +} + +function unselectFileBox(id){ + jQuery("[name="+id+"]").val(''); + jQuery('#filebox_preview_'+id).html('').hide(); + jQuery('#filebox_unselect_'+id).hide(); +} + +function initFileBox(id){ + if(opener && opener.selectedWidget && opener.selectedWidget.getAttribute("widget")){ + var file = opener.selectedWidget.getAttribute(id); + if(file){ + var html = _displayMultimedia(file,"100%","100%"); + jQuery('#filebox_preview_'+id).html(html).show(); + jQuery('#filebox_unselect_'+id).show(); + } + } } \ No newline at end of file diff --git a/modules/module/tpl/js/module_admin.js b/modules/module/tpl/js/module_admin.js index 944082d76..ec069f5fc 100644 --- a/modules/module/tpl/js/module_admin.js +++ b/modules/module/tpl/js/module_admin.js @@ -1,190 +1,190 @@ -/** - * @file modules/module/js/module_admin.js - * @author NHN (developers@xpressengine.com) - * @brief module 모듈의 관리자용 javascript - **/ - -/* 카테고리 관련 작업들 */ -function doUpdateCategory(module_category_srl, mode, message) { - if(typeof(message)!='undefined'&&!confirm(message)) return; - - var fo_obj = xGetElementById('fo_category_info'); - fo_obj.module_category_srl.value = module_category_srl; - fo_obj.mode.value = mode; - - procFilter(fo_obj, update_category); -} - -/* 카테고리 정보 수정 후 */ -function completeUpdateCategory(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; - - alert(message); - - location.href = current_url.setQuery('module_category_srl',''); -} - -/* 선택된 모듈을 관리자 메뉴의 바로가기에 등록 */ -function doAddShortCut(module) { - var fo_obj = xGetElementById("fo_shortcut"); - fo_obj.selected_module.value = module; - procFilter(fo_obj, insert_shortcut); -} - -/* 모듈 설치 */ -function doInstallModule(module) { - var params = new Array(); - params['module_name'] = module; - exec_xml('install','procInstallAdminInstall',params, completeInstallModule); -} - -function completeInstallModule(ret_obj) { - alert(ret_obj['message']); - location.reload(); -} - -/* 모듈 업그레이드 */ -function doUpdateModule(module) { - var params = new Array(); - params['module_name'] = module; - exec_xml('install','procInstallAdminUpdate',params, completeInstallModule); -} - -/* 모듈 복사후 */ -function completeCopyModule() { - if(typeof(opener)!='undefined') opener.location.href = opener.location.href; - window.close(); -} - -/* 모듈 선택기에서 선택된 모듈의 입력 */ -function insertModule(id, module_srl, mid, browser_title, multi_select) { - if(typeof(multi_select)=='undefined') multi_select = true; - if(!window.opener) window.close(); - - if(multi_select) { - if(typeof(opener.insertSelectedModules)=='undefined') return; - opener.insertSelectedModules(id, module_srl, mid, browser_title); - } else { - if(typeof(opener.insertSelectedModule)=='undefined') return; - opener.insertSelectedModule(id, module_srl, mid, browser_title); - window.close(); - } -} - -/* 권한 선택용 */ -function doShowGrantZone() { - jQuery(".grant_default").each( function() { - var id = "#zone_"+this.name.replace(/_default$/,''); - if(!jQuery(this).val()) jQuery(id).css("display","block"); - else jQuery(id).css("display","none"); - } ); -} - -/* 권한 등록 후 알림 메세지 */ -function completeInsertGrant(ret_obj) { - alert(ret_obj['message']); - location.reload(); -} - -/* 관리자 아이디 등록/ 제거 */ -function doInsertAdmin() { - var fo_obj = xGetElementById("fo_obj"); - var sel_obj = fo_obj._admin_member; - var admin_id = fo_obj.admin_id.value; - if(!admin_id) return; - - var opt = new Option(admin_id,admin_id,true,true); - sel_obj.options[sel_obj.options.length] = opt; - - fo_obj.admin_id.value = ''; - sel_obj.size = sel_obj.options.length; - sel_obj.selectedIndex = -1; - - var members = new Array(); - for(var i=0;i/.test(value)) { - var param = new Array(); - param['name'] = value.replace(/^\$user_lang->/,''); - var response_tags = new Array('error','message','name','langs'); - exec_xml('module','getModuleAdminLangCode',param,completeFillLangName, response_tags); - } - } -} - -function completeFillLangName(ret_obj, response_tags) { - var name = ret_obj['name']; - var langs = ret_obj['langs']; - if(typeof(langs)=='undefined') return; - var $form = jQuery("#menu_fo"); - $form[0].lang_code.value = name; - for(var i in langs) { - $form[0][i].value = langs[i]; - } - -} +/** + * @file modules/module/js/module_admin.js + * @author NHN (developers@xpressengine.com) + * @brief module 모듈의 관리자용 javascript + **/ + +/* 카테고리 관련 작업들 */ +function doUpdateCategory(module_category_srl, mode, message) { + if(typeof(message)!='undefined'&&!confirm(message)) return; + + var fo_obj = xGetElementById('fo_category_info'); + fo_obj.module_category_srl.value = module_category_srl; + fo_obj.mode.value = mode; + + procFilter(fo_obj, update_category); +} + +/* 카테고리 정보 수정 후 */ +function completeUpdateCategory(ret_obj) { + var error = ret_obj['error']; + var message = ret_obj['message']; + + alert(message); + + location.href = current_url.setQuery('module_category_srl',''); +} + +/* 선택된 모듈을 관리자 메뉴의 바로가기에 등록 */ +function doAddShortCut(module) { + var fo_obj = xGetElementById("fo_shortcut"); + fo_obj.selected_module.value = module; + procFilter(fo_obj, insert_shortcut); +} + +/* 모듈 설치 */ +function doInstallModule(module) { + var params = new Array(); + params['module_name'] = module; + exec_xml('install','procInstallAdminInstall',params, completeInstallModule); +} + +function completeInstallModule(ret_obj) { + alert(ret_obj['message']); + location.reload(); +} + +/* 모듈 업그레이드 */ +function doUpdateModule(module) { + var params = new Array(); + params['module_name'] = module; + exec_xml('install','procInstallAdminUpdate',params, completeInstallModule); +} + +/* 모듈 복사후 */ +function completeCopyModule() { + if(typeof(opener)!='undefined') opener.location.href = opener.location.href; + window.close(); +} + +/* 모듈 선택기에서 선택된 모듈의 입력 */ +function insertModule(id, module_srl, mid, browser_title, multi_select) { + if(typeof(multi_select)=='undefined') multi_select = true; + if(!window.opener) window.close(); + + if(multi_select) { + if(typeof(opener.insertSelectedModules)=='undefined') return; + opener.insertSelectedModules(id, module_srl, mid, browser_title); + } else { + if(typeof(opener.insertSelectedModule)=='undefined') return; + opener.insertSelectedModule(id, module_srl, mid, browser_title); + window.close(); + } +} + +/* 권한 선택용 */ +function doShowGrantZone() { + jQuery(".grant_default").each( function() { + var id = "#zone_"+this.name.replace(/_default$/,''); + if(!jQuery(this).val()) jQuery(id).css("display","block"); + else jQuery(id).css("display","none"); + } ); +} + +/* 권한 등록 후 알림 메세지 */ +function completeInsertGrant(ret_obj) { + alert(ret_obj['message']); + location.reload(); +} + +/* 관리자 아이디 등록/ 제거 */ +function doInsertAdmin() { + var fo_obj = xGetElementById("fo_obj"); + var sel_obj = fo_obj._admin_member; + var admin_id = fo_obj.admin_id.value; + if(!admin_id) return; + + var opt = new Option(admin_id,admin_id,true,true); + sel_obj.options[sel_obj.options.length] = opt; + + fo_obj.admin_id.value = ''; + sel_obj.size = sel_obj.options.length; + sel_obj.selectedIndex = -1; + + var members = new Array(); + for(var i=0;i/.test(value)) { + var param = new Array(); + param['name'] = value.replace(/^\$user_lang->/,''); + var response_tags = new Array('error','message','name','langs'); + exec_xml('module','getModuleAdminLangCode',param,completeFillLangName, response_tags); + } + } +} + +function completeFillLangName(ret_obj, response_tags) { + var name = ret_obj['name']; + var langs = ret_obj['langs']; + if(typeof(langs)=='undefined') return; + var $form = jQuery("#menu_fo"); + $form[0].lang_code.value = name; + for(var i in langs) { + $form[0][i].value = langs[i]; + } + +} diff --git a/modules/module/tpl/lang.html b/modules/module/tpl/lang.html index 35c350663..2f02ea854 100644 --- a/modules/module/tpl/lang.html +++ b/modules/module/tpl/lang.html @@ -1,15 +1,15 @@ - -
    -
    -

    Select Your Language

    -
    -
      - - -
    • {$val}
    • - -
    • {$val}
    • - - -
    -
    + +
    +
    +

    Select Your Language

    +
    +
      + + +
    • {$val}
    • + +
    • {$val}
    • + + +
    +
    diff --git a/modules/module/tpl/move_filebox_list.html b/modules/module/tpl/move_filebox_list.html index fe25e5d99..97f9a7392 100644 --- a/modules/module/tpl/move_filebox_list.html +++ b/modules/module/tpl/move_filebox_list.html @@ -1,3 +1,3 @@ - \ No newline at end of file diff --git a/modules/opage/conf/info.xml b/modules/opage/conf/info.xml index 3f662b7f2..f5e40817e 100644 --- a/modules/opage/conf/info.xml +++ b/modules/opage/conf/info.xml @@ -1,37 +1,37 @@ - - - 외부 페이지 - 外部页面 - 外部ページ - External Page - Trang ngoài - Afuera Página - Внешние страницы - 外部頁面 - Harici Sayfa - 외부페이지를 XE내부로 삽입시키는 모듈 - 可以把外部页面插入到 Zeroboard XE内部的模块。 - 外部ページをXE内部に挿入させるモジュール - Module for inserting external pages into inside of Zeroboard XE. - Module cho phépchèn một trang từ bên ngoài vào bên trong Zeroboard XE. - 외부페이지를 XE내부로 삽입시키는 모듈 - Модуль для вставки внешних страниц внутрь Zeroboard XE. - 可將外部頁面插入至XE裡面的模組。 - Harici sayfaları, Zeroboard XE\'nin içine yerleştirmek için kullanılan modüldür. - 0.1 - 2007-09-17 - service - http://xpressengine.com/ - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 외부 페이지 + 外部页面 + 外部ページ + External Page + Trang ngoài + Afuera Página + Внешние страницы + 外部頁面 + Harici Sayfa + 외부페이지를 XE내부로 삽입시키는 모듈 + 可以把外部页面插入到 Zeroboard XE内部的模块。 + 外部ページをXE内部に挿入させるモジュール + Module for inserting external pages into inside of Zeroboard XE. + Module cho phépchèn một trang từ bên ngoài vào bên trong Zeroboard XE. + 외부페이지를 XE내부로 삽입시키는 모듈 + Модуль для вставки внешних страниц внутрь Zeroboard XE. + 可將外部頁面插入至XE裡面的模組。 + Harici sayfaları, Zeroboard XE\'nin içine yerleştirmek için kullanılan modüldür. + 0.1 + 2007-09-17 + service + http://xpressengine.com/ + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/opage/lang/en.lang.php b/modules/opage/lang/en.lang.php index 27141ef49..4e0ee1792 100644 --- a/modules/opage/lang/en.lang.php +++ b/modules/opage/lang/en.lang.php @@ -1,18 +1,18 @@ -opage = "External Page"; - $lang->opage_path = "Location of External Document"; - $lang->opage_caching_interval = "Caching Time"; - - $lang->about_opage = "This module enables usage of external html or php files in XE.
    It allows absolute or relative path, and if the url starts with 'http://' , it can display the external page of the server."; - $lang->about_opage_path= "Please input the location of external document.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; - $lang->about_opage_caching_interval = "The unit is minute, and it displays temporary saved data for assigned time.
    It is recommended to cache for proper time if a lot of resources are needed when displaying other servers' data or information.
    A value of 0 will not cache."; - - $lang->opage_mobile_path = 'Location of External Document for Mobile View'; - $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; -?> +opage = "External Page"; + $lang->opage_path = "Location of External Document"; + $lang->opage_caching_interval = "Caching Time"; + + $lang->about_opage = "This module enables usage of external html or php files in XE.
    It allows absolute or relative path, and if the url starts with 'http://' , it can display the external page of the server."; + $lang->about_opage_path= "Please input the location of external document.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; + $lang->about_opage_caching_interval = "The unit is minute, and it displays temporary saved data for assigned time.
    It is recommended to cache for proper time if a lot of resources are needed when displaying other servers' data or information.
    A value of 0 will not cache."; + + $lang->opage_mobile_path = 'Location of External Document for Mobile View'; + $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; +?> diff --git a/modules/opage/lang/es.lang.php b/modules/opage/lang/es.lang.php index 27cb800f9..6ca78ebd7 100644 --- a/modules/opage/lang/es.lang.php +++ b/modules/opage/lang/es.lang.php @@ -1,17 +1,17 @@ -opage = "Page Exteriores"; - $lang->opage_path = "Ubicacion del documento externo"; - $lang->opage_caching_interval = "Establezca el tiempo de cache"; - - $lang->about_opage = 'Este modulo permite el uso externo de archivos html o php en XE.
    Permite ruta absoluta o relativa, y si la URL comienza con "http://", se puede mostrar la pagina externa del servidor.'; - $lang->about_opage_path= "Por favor ingrese la ubicacion del documento externos.
    Ambos ruta absoluta como '/ path1/path2/sample.php' o ruta relativa como \"../path2/sample.php\" puede ser utilizado.
    Si la via de entrada, como \"http://url/sample.php\", el resultado sera recibido y, a continuacion se muestran.
    Esta es la actual XE ruta absoluta.
    "; - $lang->about_opage_caching_interval = "La unidad es minuto, y se muestra temporal de los datos guardados por el tiempo asignado.
    Se recomienda a la cache para una buena vez si una gran cantidad de recursos se necesitan otros servidores cuando se muestran los datos o la informacion.
    Un valor de 0 no cache."; - $lang->opage_mobile_path = 'Location of External Document for Mobile View'; - $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; -?> +opage = "Page Exteriores"; + $lang->opage_path = "Ubicacion del documento externo"; + $lang->opage_caching_interval = "Establezca el tiempo de cache"; + + $lang->about_opage = 'Este modulo permite el uso externo de archivos html o php en XE.
    Permite ruta absoluta o relativa, y si la URL comienza con "http://", se puede mostrar la pagina externa del servidor.'; + $lang->about_opage_path= "Por favor ingrese la ubicacion del documento externos.
    Ambos ruta absoluta como '/ path1/path2/sample.php' o ruta relativa como \"../path2/sample.php\" puede ser utilizado.
    Si la via de entrada, como \"http://url/sample.php\", el resultado sera recibido y, a continuacion se muestran.
    Esta es la actual XE ruta absoluta.
    "; + $lang->about_opage_caching_interval = "La unidad es minuto, y se muestra temporal de los datos guardados por el tiempo asignado.
    Se recomienda a la cache para una buena vez si una gran cantidad de recursos se necesitan otros servidores cuando se muestran los datos o la informacion.
    Un valor de 0 no cache."; + $lang->opage_mobile_path = 'Location of External Document for Mobile View'; + $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; +?> diff --git a/modules/opage/lang/fr.lang.php b/modules/opage/lang/fr.lang.php index 8ee06ec29..8a6a4b080 100644 --- a/modules/opage/lang/fr.lang.php +++ b/modules/opage/lang/fr.lang.php @@ -1,17 +1,17 @@ -opage = "Page Extérieure"; - $lang->opage_path = "Localisation du Document Extérieur"; - $lang->opage_caching_interval = "Temps de antémémoire"; - - $lang->about_opage = "Ce module vous fait pouvoir utiliser des documents extérieurs en html ou en php dans XE.
    Il est possible d'utiliser le chemin absolu ou relatif, et si l'URL commence avec 'http://' , il est possible de représenter des pages extérieurs du serveur."; - $lang->about_opage_path= "Entrez la localisation du document extérieur.
    Non seulement le chemin absolu comme '/path1/path2/sample.php' mais aussi le chemin relatif comme '../path2/sample.php' peuvent être utilisés.
    Si vous entrez le chemin comme 'http://url/sample.php', le résultat sera reçu et puis exposé
    Le chemin suivant, c'est le chemin absolu de XE.
    "; - $lang->about_opage_caching_interval = "L'unité est minute, et ça exposera des données conservées temporairement pendant le temps assigné.
    Il est recommandé d'utiliser l'antémémoire pendant le temps convenable si beaucoup de ressource est nécessaire pour représenter les données ou l'information d'autre serveur.
    La valeur 0 signifie de ne pas utiliser antémémoire."; - $lang->opage_mobile_path = 'Location of External Document for Mobile View'; - $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; -?> +opage = "Page Extérieure"; + $lang->opage_path = "Localisation du Document Extérieur"; + $lang->opage_caching_interval = "Temps de antémémoire"; + + $lang->about_opage = "Ce module vous fait pouvoir utiliser des documents extérieurs en html ou en php dans XE.
    Il est possible d'utiliser le chemin absolu ou relatif, et si l'URL commence avec 'http://' , il est possible de représenter des pages extérieurs du serveur."; + $lang->about_opage_path= "Entrez la localisation du document extérieur.
    Non seulement le chemin absolu comme '/path1/path2/sample.php' mais aussi le chemin relatif comme '../path2/sample.php' peuvent être utilisés.
    Si vous entrez le chemin comme 'http://url/sample.php', le résultat sera reçu et puis exposé
    Le chemin suivant, c'est le chemin absolu de XE.
    "; + $lang->about_opage_caching_interval = "L'unité est minute, et ça exposera des données conservées temporairement pendant le temps assigné.
    Il est recommandé d'utiliser l'antémémoire pendant le temps convenable si beaucoup de ressource est nécessaire pour représenter les données ou l'information d'autre serveur.
    La valeur 0 signifie de ne pas utiliser antémémoire."; + $lang->opage_mobile_path = 'Location of External Document for Mobile View'; + $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; +?> diff --git a/modules/opage/lang/jp.lang.php b/modules/opage/lang/jp.lang.php index b29544fd4..306506826 100644 --- a/modules/opage/lang/jp.lang.php +++ b/modules/opage/lang/jp.lang.php @@ -1,17 +1,17 @@ -opage = '外部ページ'; - $lang->opage_path = '外部ドキュメントの場所'; - $lang->opage_caching_interval = 'キャッシング時間設定'; - - $lang->about_opage = '外部のHTMLまたはPHPファイルをXE内部で使用出来るようにするモジュールです。
    絶対パス、相対パスで指定出来、「http://」で始まるサーバの外部ページも表示出来ます。'; - $lang->about_opage_path= '外部ドキュメントの場所を入力して下さい。
    「/path1/path2/sample.php」のような絶対パス、「../path2/sample.php」のような相対パスが使用出来ます。
    「http://URL/sample.php」のように使用すると結果を読み込んで表示します。
    現在XEがインストールされている絶対パスは次のようになっています。
    '; - $lang->about_opage_caching_interval = '分単位で指定出来、設定された時間の間は、臨時保存されたデータを出力します。
    他のサーバの情報を出力したり、データを出力する際、リソースが多く使われるため、数分単位でキャッシングすることをお勧めします。
    「0」に指定するとキャッシングされません。'; - $lang->opage_mobile_path = 'モバイルバージョン文書へのパス'; - $lang->about_opage_mobile_path= "モバイルバージョンドキュメントへのパスを指定して下さい。 指定してないと一般ドキュメントのパスに指定されます。
    /path1/path2/sample.php のような絶対パスや ../path2/sample.phpのような相対パス両方とも指定できます。
    指定すると対応するドキュメントをウェブからダウンロードして表示します。
    現在、XEの設置されている絶対パスは次のようになります。"; -?> +opage = '外部ページ'; + $lang->opage_path = '外部ドキュメントの場所'; + $lang->opage_caching_interval = 'キャッシング時間設定'; + + $lang->about_opage = '外部のHTMLまたはPHPファイルをXE内部で使用出来るようにするモジュールです。
    絶対パス、相対パスで指定出来、「http://」で始まるサーバの外部ページも表示出来ます。'; + $lang->about_opage_path= '外部ドキュメントの場所を入力して下さい。
    「/path1/path2/sample.php」のような絶対パス、「../path2/sample.php」のような相対パスが使用出来ます。
    「http://URL/sample.php」のように使用すると結果を読み込んで表示します。
    現在XEがインストールされている絶対パスは次のようになっています。
    '; + $lang->about_opage_caching_interval = '分単位で指定出来、設定された時間の間は、臨時保存されたデータを出力します。
    他のサーバの情報を出力したり、データを出力する際、リソースが多く使われるため、数分単位でキャッシングすることをお勧めします。
    「0」に指定するとキャッシングされません。'; + $lang->opage_mobile_path = 'モバイルバージョン文書へのパス'; + $lang->about_opage_mobile_path= "モバイルバージョンドキュメントへのパスを指定して下さい。 指定してないと一般ドキュメントのパスに指定されます。
    /path1/path2/sample.php のような絶対パスや ../path2/sample.phpのような相対パス両方とも指定できます。
    指定すると対応するドキュメントをウェブからダウンロードして表示します。
    現在、XEの設置されている絶対パスは次のようになります。"; +?> diff --git a/modules/opage/lang/ko.lang.php b/modules/opage/lang/ko.lang.php index 72e5b2ebc..448ce2f45 100644 --- a/modules/opage/lang/ko.lang.php +++ b/modules/opage/lang/ko.lang.php @@ -1,18 +1,18 @@ -opage = '외부 페이지'; - $lang->opage_path = '외부 문서 위치'; - $lang->opage_caching_interval = '캐싱 시간 설정'; - - $lang->about_opage = 'XE가 아닌 외부 HTML 또는 PHP파일을 XE에서 사용할 수 있도록 하는 모듈입니다.
    절대경로, 상대경로를 이용할 수 있으며 http:// 로 시작할 경우 서버 외부의 페이지도 표시할 수 있습니다'; - $lang->about_opage_path= '외부문서의 위치를 입력해주세요.
    /path1/path2/sample.php 와 같이 절대경로나 ../path2/sample.php와 같은 상대경로 모두 사용가능합니다.
    http://url/sample.php 와 같이 사용하면 해당 페이지를 웹으로 전송 받아 출력 하게 됩니다.
    현재 XE가 설치된 절대경로는 다음과 같습니다.
    '; - $lang->about_opage_caching_interval = '분 단위이며 정해진 시간동안은 임시 저장한 데이터를 출력합니다.
    다른 서버의 정보를 출력하거나, 데이터 출력하는데 많은 자원이 필요한 경우, 원하시는 분 단위 시간 간격으로 캐싱하는 것을 추천합니다.
    0 으로 하시면 캐싱을 하지 않습니다.'; - - $lang->opage_mobile_path = '모바일용 외부 문서 위치'; - $lang->about_opage_mobile_path= '모바일용 외부문서의 위치를 입력해주세요. 입력하지 않으면 위에서 지정한 외부문서 위치의 페이지를 이용합니다.
    /path1/path2/sample.php 와 같이 절대경로나 ../path2/sample.php와 같은 상대경로 모두 사용가능합니다.
    http://url/sample.php 와 같이 사용하면 해당 페이지를 웹으로 전송 받아 출력 하게 됩니다.
    현재 XE가 설치된 절대경로는 다음과 같습니다.
    '; -?> +opage = '외부 페이지'; + $lang->opage_path = '외부 문서 위치'; + $lang->opage_caching_interval = '캐싱 시간 설정'; + + $lang->about_opage = 'XE가 아닌 외부 HTML 또는 PHP파일을 XE에서 사용할 수 있도록 하는 모듈입니다.
    절대경로, 상대경로를 이용할 수 있으며 http:// 로 시작할 경우 서버 외부의 페이지도 표시할 수 있습니다'; + $lang->about_opage_path= '외부문서의 위치를 입력해주세요.
    /path1/path2/sample.php 와 같이 절대경로나 ../path2/sample.php와 같은 상대경로 모두 사용가능합니다.
    http://url/sample.php 와 같이 사용하면 해당 페이지를 웹으로 전송 받아 출력 하게 됩니다.
    현재 XE가 설치된 절대경로는 다음과 같습니다.
    '; + $lang->about_opage_caching_interval = '분 단위이며 정해진 시간동안은 임시 저장한 데이터를 출력합니다.
    다른 서버의 정보를 출력하거나, 데이터 출력하는데 많은 자원이 필요한 경우, 원하시는 분 단위 시간 간격으로 캐싱하는 것을 추천합니다.
    0 으로 하시면 캐싱을 하지 않습니다.'; + + $lang->opage_mobile_path = '모바일용 외부 문서 위치'; + $lang->about_opage_mobile_path= '모바일용 외부문서의 위치를 입력해주세요. 입력하지 않으면 위에서 지정한 외부문서 위치의 페이지를 이용합니다.
    /path1/path2/sample.php 와 같이 절대경로나 ../path2/sample.php와 같은 상대경로 모두 사용가능합니다.
    http://url/sample.php 와 같이 사용하면 해당 페이지를 웹으로 전송 받아 출력 하게 됩니다.
    현재 XE가 설치된 절대경로는 다음과 같습니다.
    '; +?> diff --git a/modules/opage/lang/ru.lang.php b/modules/opage/lang/ru.lang.php index a9d3600c1..91d8766d7 100644 --- a/modules/opage/lang/ru.lang.php +++ b/modules/opage/lang/ru.lang.php @@ -1,17 +1,17 @@ -opage = "Внешняя страница"; - $lang->opage_path = "Расположение внешнего документа"; - $lang->opage_caching_interval = "Установить время кеширования"; - - $lang->about_opage = "Этот модуль позволяет использовать внешние HTML или PHP файлы в XE.
    Требует ввода абсолютного или относительного пути. Если URL начинается с 'http://', внешняя страница с другого сервера будет показана."; - $lang->about_opage_path= "Пожалуйста, введите размещение внешнего документа.
    Абсолютный путь как '/path1/path2/sample.php', так и относительный как '../path2/sample.php' могут быть использованы.
    Если Вы введете путь как 'http://url/sample.php', результат будет сначала получен и затем показан.
    Это текущий абсолютный путь к XE.
    "; - $lang->about_opage_caching_interval = "Единица измерения равна одной минуте. Это отображает временно сохраненные данные для присвоенного времени.
    Рекомендуется устанавливать разумное время кеширования, если множество ресурсов нуждаются в показе данных с других серверов.
    Значение 0 отключает кеширование."; - $lang->opage_mobile_path = 'Location of External Document for Mobile View'; - $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; -?> +opage = "Внешняя страница"; + $lang->opage_path = "Расположение внешнего документа"; + $lang->opage_caching_interval = "Установить время кеширования"; + + $lang->about_opage = "Этот модуль позволяет использовать внешние HTML или PHP файлы в XE.
    Требует ввода абсолютного или относительного пути. Если URL начинается с 'http://', внешняя страница с другого сервера будет показана."; + $lang->about_opage_path= "Пожалуйста, введите размещение внешнего документа.
    Абсолютный путь как '/path1/path2/sample.php', так и относительный как '../path2/sample.php' могут быть использованы.
    Если Вы введете путь как 'http://url/sample.php', результат будет сначала получен и затем показан.
    Это текущий абсолютный путь к XE.
    "; + $lang->about_opage_caching_interval = "Единица измерения равна одной минуте. Это отображает временно сохраненные данные для присвоенного времени.
    Рекомендуется устанавливать разумное время кеширования, если множество ресурсов нуждаются в показе данных с других серверов.
    Значение 0 отключает кеширование."; + $lang->opage_mobile_path = 'Location of External Document for Mobile View'; + $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; +?> diff --git a/modules/opage/lang/tr.lang.php b/modules/opage/lang/tr.lang.php index 657a0accf..9a96354be 100644 --- a/modules/opage/lang/tr.lang.php +++ b/modules/opage/lang/tr.lang.php @@ -1,18 +1,18 @@ -opage = "Harici Sayfa"; - $lang->opage_path = "Harici Belgenin Konumu"; - $lang->opage_caching_interval = "Önbelleğe Alma Zamanı"; - - $lang->about_opage = "Bu modül, harici html veya php dosyalarının XE\'nin içinde kullanılmasına olanak tanır.
    Kesin ya da ilgili yola izin verir ve eğer url 'http://' ile başlıyorsa , modül sunucunun harici sayfasını gösterebilir."; - $lang->about_opage_path= "Lütfen harici dosyaların konumunu giriniz.
    '/path1/path2/sample.php' gibi kesin yollar ve '../path2/sample.php' gibi ilgili yollar kullanılabilir.
    Eğer 'http://url/sample.php' gibi bir yol giriyorsanız, sonuç önce alınacak sonra gösterilecektir.
    Bu XE\'nin kesin yoludur.
    "; - $lang->about_opage_caching_interval = "Birim dakikadır ve belirlenen zaman için kaydedilmiş geçici dosyayı gösterir.
    Diğer sunucuların veri veya bilgileri gösterilirken, eğer fazla sayıda kaynağın gösterilmesi gerekiyorsa, uygun zamanın önbelleğe alınması önerilmiştir.
    0 değeri verilirse, önbelleğe alınma işlemi gerçekleşmeyecektir."; - - $lang->opage_mobile_path = 'Harici Dosyanın Hareketli Görünüm için Konumu'; - $lang->about_opage_mobile_path= "Lütfen hareketli görünüm için harici dosyanın konumunu giriniz. Eğer konum girilmediyse, harici belgenin belirlenmişini kullanır.
    '/path1/path2/sample.php' gibi kesin yol veya '../path2/sample.php' gibi ilgili yol kullanılabilir.
    Eğer 'http://url/sample.php' gibi bir adres girdiyseniz , sonuç önce alınacak sonra görüntülenecektir.
    Bu XE\'nin kesin yoludur.
    "; -?> +opage = "Harici Sayfa"; + $lang->opage_path = "Harici Belgenin Konumu"; + $lang->opage_caching_interval = "Önbelleğe Alma Zamanı"; + + $lang->about_opage = "Bu modül, harici html veya php dosyalarının XE\'nin içinde kullanılmasına olanak tanır.
    Kesin ya da ilgili yola izin verir ve eğer url 'http://' ile başlıyorsa , modül sunucunun harici sayfasını gösterebilir."; + $lang->about_opage_path= "Lütfen harici dosyaların konumunu giriniz.
    '/path1/path2/sample.php' gibi kesin yollar ve '../path2/sample.php' gibi ilgili yollar kullanılabilir.
    Eğer 'http://url/sample.php' gibi bir yol giriyorsanız, sonuç önce alınacak sonra gösterilecektir.
    Bu XE\'nin kesin yoludur.
    "; + $lang->about_opage_caching_interval = "Birim dakikadır ve belirlenen zaman için kaydedilmiş geçici dosyayı gösterir.
    Diğer sunucuların veri veya bilgileri gösterilirken, eğer fazla sayıda kaynağın gösterilmesi gerekiyorsa, uygun zamanın önbelleğe alınması önerilmiştir.
    0 değeri verilirse, önbelleğe alınma işlemi gerçekleşmeyecektir."; + + $lang->opage_mobile_path = 'Harici Dosyanın Hareketli Görünüm için Konumu'; + $lang->about_opage_mobile_path= "Lütfen hareketli görünüm için harici dosyanın konumunu giriniz. Eğer konum girilmediyse, harici belgenin belirlenmişini kullanır.
    '/path1/path2/sample.php' gibi kesin yol veya '../path2/sample.php' gibi ilgili yol kullanılabilir.
    Eğer 'http://url/sample.php' gibi bir adres girdiyseniz , sonuç önce alınacak sonra görüntülenecektir.
    Bu XE\'nin kesin yoludur.
    "; +?> diff --git a/modules/opage/lang/vi.lang.php b/modules/opage/lang/vi.lang.php index cc4d772c4..72e41e978 100644 --- a/modules/opage/lang/vi.lang.php +++ b/modules/opage/lang/vi.lang.php @@ -1,19 +1,19 @@ -opage = "Trang ngoài"; - $lang->opage_path = "Đường dẫn thư mục"; - $lang->opage_caching_interval = "Thời gian lưu trữ"; - - $lang->about_opage = "Module này tạo ra một trang từ bên ngoài tại XE thông qua File HTML hoặc PHP.
    Nó cho phép đường dẫn tuyệt đối hay tương đối, nếu bắt đầu bằng 'http://' , nó sẽ hiển thị một trang từ bên ngoài Server."; - $lang->about_opage_path= "Xin hãy nhập đường dẫn của thư mục.
    Có thể sử dụng đường dẫn tuyệt đối dạng '/path1/path2/sample.php' hay tương đối dạng '../path2/sample.php'.
    Nếu nhập đường dẫn dạng 'http://url/sample.php', nó sẽ nhận và hiển thị nội dung của File đó.
    Đây là đường dẫn tuyệt đối thư mục cài đặt XE.
    "; - $lang->about_opage_caching_interval = "Đơn vị được tính bằng phút, nó sẽ là thời gian lưu trữ tạm thời.
    Đó là khuyến cáo thời gian lưu trữ tạm thời thích hợp khi cần để hiển thị.
    Nhập 0 nếu không sử dụng tính năng này."; - $lang->opage_mobile_path = 'Location of External Document for Mobile View'; - $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; -?> +opage = "Trang ngoài"; + $lang->opage_path = "Đường dẫn thư mục"; + $lang->opage_caching_interval = "Thời gian lưu trữ"; + + $lang->about_opage = "Module này tạo ra một trang từ bên ngoài tại XE thông qua File HTML hoặc PHP.
    Nó cho phép đường dẫn tuyệt đối hay tương đối, nếu bắt đầu bằng 'http://' , nó sẽ hiển thị một trang từ bên ngoài Server."; + $lang->about_opage_path= "Xin hãy nhập đường dẫn của thư mục.
    Có thể sử dụng đường dẫn tuyệt đối dạng '/path1/path2/sample.php' hay tương đối dạng '../path2/sample.php'.
    Nếu nhập đường dẫn dạng 'http://url/sample.php', nó sẽ nhận và hiển thị nội dung của File đó.
    Đây là đường dẫn tuyệt đối thư mục cài đặt XE.
    "; + $lang->about_opage_caching_interval = "Đơn vị được tính bằng phút, nó sẽ là thời gian lưu trữ tạm thời.
    Đó là khuyến cáo thời gian lưu trữ tạm thời thích hợp khi cần để hiển thị.
    Nhập 0 nếu không sử dụng tính năng này."; + $lang->opage_mobile_path = 'Location of External Document for Mobile View'; + $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; +?> diff --git a/modules/opage/lang/zh-CN.lang.php b/modules/opage/lang/zh-CN.lang.php index e15e8bb3f..8c97eff54 100644 --- a/modules/opage/lang/zh-CN.lang.php +++ b/modules/opage/lang/zh-CN.lang.php @@ -1,18 +1,18 @@ -opage = "外部页面"; - $lang->opage_path = "外部页面路径"; - $lang->opage_caching_interval = "缓冲时间设置"; - - $lang->about_opage = "此模块是一种可以把外部html或php文件插入到XE内部的模块。
    可以使用绝对路径及相对路径。而且使用以http:// 开头的地址时,可以把外部服务器中的页面插入到XE当中。"; - $lang->about_opage_path= "请输入外部文件路径。
    可以使用如同 /path1/path2/sample.php的绝对路径或如 ../path2/sample.php的相对路径。
    如使用http://url/sample.php之类的地址,可以把此页面的输出结果显示到XE内部的指定位置。
    现安装的XE绝对路径如下:
    "; - $lang->about_opage_caching_interval = "单位为分。缓冲时间内页面将输出临时储存的数据。
    输出外部服务器信息或数据时,如消耗资源很大,尽量把缓冲时间设置为大一点的相应值。
    0 表示无缓冲。"; - - $lang->opage_mobile_path = '移动版外部页面路径'; - $lang->about_opage_mobile_path= '请输入移动版外部文件路径。留空默认使用上面指定的的普通外部页面。
    可以使用如同 /path1/path2/sample.php的绝对路径或如 ../path2/sample.php的相对路径。
    如使用http://url/sample.php之类的地址,可以把此页面的输出结果显示到XE内部的指定位置。
    现安装的XE绝对路径如下:
    '; -?> +opage = "外部页面"; + $lang->opage_path = "外部页面路径"; + $lang->opage_caching_interval = "缓冲时间设置"; + + $lang->about_opage = "此模块是一种可以把外部html或php文件插入到XE内部的模块。
    可以使用绝对路径及相对路径。而且使用以http:// 开头的地址时,可以把外部服务器中的页面插入到XE当中。"; + $lang->about_opage_path= "请输入外部文件路径。
    可以使用如同 /path1/path2/sample.php的绝对路径或如 ../path2/sample.php的相对路径。
    如使用http://url/sample.php之类的地址,可以把此页面的输出结果显示到XE内部的指定位置。
    现安装的XE绝对路径如下:
    "; + $lang->about_opage_caching_interval = "单位为分。缓冲时间内页面将输出临时储存的数据。
    输出外部服务器信息或数据时,如消耗资源很大,尽量把缓冲时间设置为大一点的相应值。
    0 表示无缓冲。"; + + $lang->opage_mobile_path = '移动版外部页面路径'; + $lang->about_opage_mobile_path= '请输入移动版外部文件路径。留空默认使用上面指定的的普通外部页面。
    可以使用如同 /path1/path2/sample.php的绝对路径或如 ../path2/sample.php的相对路径。
    如使用http://url/sample.php之类的地址,可以把此页面的输出结果显示到XE内部的指定位置。
    现安装的XE绝对路径如下:
    '; +?> diff --git a/modules/opage/lang/zh-TW.lang.php b/modules/opage/lang/zh-TW.lang.php index 5e3145b8e..91b9938b3 100644 --- a/modules/opage/lang/zh-TW.lang.php +++ b/modules/opage/lang/zh-TW.lang.php @@ -1,17 +1,17 @@ -opage = "外部頁面"; - $lang->opage_path = "外部頁面路徑"; - $lang->opage_caching_interval = "暫存時間設置"; - - $lang->about_opage = "此模組可把外部HTML或PHP檔案插入到XE中的模組。
    可以使用絕對路徑及相對路徑。而且使用以『http://』開頭的網址時,可以把外部主機中的頁面插入到XE當中。"; - $lang->about_opage_path= "請輸入外部檔案路徑。
    可以使用像『/path1/path2/sample.php』的絕對路徑或是『../path2/sample.php』的相對路徑。
    如果是用『http://url/sample.php』之類的網址,會將此頁面的結果顯示到XE內部的指定位置。
    目前安裝的XE絕對路徑如下:
    "; - $lang->about_opage_caching_interval = "單位為分。暫存時間內頁面將輸出臨時儲存的資料。
    輸出外部主機訊息或資料時,如消耗資源很大,盡量把暫存時間設大一點。
    『0』表示不暫存。"; - $lang->opage_mobile_path = 'Location of External Document for Mobile View'; - $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; -?> +opage = "外部頁面"; + $lang->opage_path = "外部頁面路徑"; + $lang->opage_caching_interval = "暫存時間設置"; + + $lang->about_opage = "此模組可把外部HTML或PHP檔案插入到XE中的模組。
    可以使用絕對路徑及相對路徑。而且使用以『http://』開頭的網址時,可以把外部主機中的頁面插入到XE當中。"; + $lang->about_opage_path= "請輸入外部檔案路徑。
    可以使用像『/path1/path2/sample.php』的絕對路徑或是『../path2/sample.php』的相對路徑。
    如果是用『http://url/sample.php』之類的網址,會將此頁面的結果顯示到XE內部的指定位置。
    目前安裝的XE絕對路徑如下:
    "; + $lang->about_opage_caching_interval = "單位為分。暫存時間內頁面將輸出臨時儲存的資料。
    輸出外部主機訊息或資料時,如消耗資源很大,盡量把暫存時間設大一點。
    『0』表示不暫存。"; + $lang->opage_mobile_path = 'Location of External Document for Mobile View'; + $lang->about_opage_mobile_path= "Please input the location of external document for mobile view. If not inputted, it uses the the external document specified above.
    Both absolute path such as '/path1/path2/sample.php' or relative path such as '../path2/sample.php' can be used.
    If you input the path like 'http://url/sample.php' , the result will be received and then displayed.
    This is current XE's absolute path.
    "; +?> diff --git a/modules/opage/opage.admin.controller.php b/modules/opage/opage.admin.controller.php index d603c0fef..532c6d032 100644 --- a/modules/opage/opage.admin.controller.php +++ b/modules/opage/opage.admin.controller.php @@ -1,84 +1,84 @@ -module = 'opage'; - $args->mid = $args->opage_name; - unset($args->opage_name); - - // 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 - if(!$args->module_srl) { - $args->module_srl = getNextSequence(); - $output = $oModuleController->insertModule($args); - $msg_code = 'success_registed'; - } else { - $output = $oModuleController->updateModule($args); - $msg_code = 'success_updated'; - - // 캐시 파일 삭제 - $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될 메세지 정리 - $this->add("module_srl", $output->get('module_srl')); - $this->add("opage", Context::get('opage')); - $this->setMessage($msg_code); - } - - /** - * @brief 외부페이지 삭제 - **/ - function procOpageAdminDelete() { - $module_srl = Context::get('module_srl'); - - // 원본을 구해온다 - $oModuleController = &getController('module'); - $output = $oModuleController->deleteModule($module_srl); - if(!$output->toBool()) return $output; - - $this->add('module','opage'); - $this->add('opage',Context::get('opage')); - $this->setMessage('success_deleted'); - } - - /** - * @brief 외부페이지 기본 정보의 추가 - **/ - function procOpageAdminInsertConfig() { - // 기본 정보를 받음 - $args = Context::gets('test'); - - } - - } -?> +module = 'opage'; + $args->mid = $args->opage_name; + unset($args->opage_name); + + // 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 + if(!$args->module_srl) { + $args->module_srl = getNextSequence(); + $output = $oModuleController->insertModule($args); + $msg_code = 'success_registed'; + } else { + $output = $oModuleController->updateModule($args); + $msg_code = 'success_updated'; + + // 캐시 파일 삭제 + $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될 메세지 정리 + $this->add("module_srl", $output->get('module_srl')); + $this->add("opage", Context::get('opage')); + $this->setMessage($msg_code); + } + + /** + * @brief 외부페이지 삭제 + **/ + function procOpageAdminDelete() { + $module_srl = Context::get('module_srl'); + + // 원본을 구해온다 + $oModuleController = &getController('module'); + $output = $oModuleController->deleteModule($module_srl); + if(!$output->toBool()) return $output; + + $this->add('module','opage'); + $this->add('opage',Context::get('opage')); + $this->setMessage('success_deleted'); + } + + /** + * @brief 외부페이지 기본 정보의 추가 + **/ + function procOpageAdminInsertConfig() { + // 기본 정보를 받음 + $args = Context::gets('test'); + + } + + } +?> diff --git a/modules/opage/opage.admin.view.php b/modules/opage/opage.admin.view.php index 8f982248e..b4e5bd8c3 100644 --- a/modules/opage/opage.admin.view.php +++ b/modules/opage/opage.admin.view.php @@ -1,139 +1,139 @@ -getModuleCategories(); - Context::set('module_category', $module_category); - - // 템플릿 경로 구함 (opage의 경우 tpl에 관리자용 템플릿 모아놓음) - $this->setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 외부페이지 관리 목록 보여줌 - **/ - function dispOpageAdminContent() { - $args->sort_index = "module_srl"; - $args->page = Context::get('page'); - $args->list_count = 40; - $args->page_count = 10; - $args->s_module_category_srl = Context::get('module_category_srl'); - $output = executeQuery('opage.getOpageList', $args); - - // 템플릿에 쓰기 위해서 context::set - 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); - - // 템플릿 파일 지정 - $this->setTemplateFile('index'); - } - - /** - * @brief 외부페이지 추가 폼 출력 - **/ - function dispOpageAdminInsert() { - // 권한 그룹의 목록을 가져온다 - $oMemberModel = &getModel('member'); - $group_list = $oMemberModel->getGroups(); - Context::set('group_list', $group_list); - - // module.xml에서 권한 관련 목록을 구해옴 - $grant_list = $this->xml_info->grant; - Context::set('grant_list', $grant_list); - - // GET parameter에서 module_srl을 가져옴 - $module_srl = Context::get('module_srl'); - - // module_srl이 있으면 해당 모듈의 정보를 구해서 세팅 - if($module_srl) { - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - if($module_info->module_srl == $module_srl) Context::set('module_info',$module_info); - else { - unset($module_info); - unset($module_srl); - } - } - - // 레이아웃 목록을 구해옴 - $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); - - // 템플릿 파일 지정 - $this->setTemplateFile('opage_insert'); - } - - - /** - * @brief 외부페이지 삭제 화면 출력 - **/ - function dispOpageAdminDelete() { - $module_srl = Context::get('module_srl'); - if(!$module_srl) return $this->dispContent(); - - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - Context::set('module_info',$module_info); - - // 템플릿 파일 지정 - $this->setTemplateFile('opage_delete'); - } - - /** - * @brief 권한 목록 출력 - **/ - function dispOpageAdminGrantInfo() { - - - // GET parameter에서 module_srl을 가져옴 - $module_srl = Context::get('module_srl'); - - // module_srl이 있으면 해당 모듈의 정보를 구해서 세팅 - if($module_srl) { - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - if($module_info->module_srl == $module_srl) Context::set('module_info',$module_info); - else { - unset($module_info); - unset($module_srl); - } - } - - $this->module_info = $module_info; - - // 공통 모듈 권한 설정 페이지 호출 - $oModuleAdminModel = &getAdminModel('module'); - $grant_content = $oModuleAdminModel->getModuleGrantHTML($this->module_info->module_srl, $this->xml_info->grant); - Context::set('grant_content', $grant_content); - - $this->setTemplateFile('grant_list'); - } - } -?> +getModuleCategories(); + Context::set('module_category', $module_category); + + // 템플릿 경로 구함 (opage의 경우 tpl에 관리자용 템플릿 모아놓음) + $this->setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 외부페이지 관리 목록 보여줌 + **/ + function dispOpageAdminContent() { + $args->sort_index = "module_srl"; + $args->page = Context::get('page'); + $args->list_count = 40; + $args->page_count = 10; + $args->s_module_category_srl = Context::get('module_category_srl'); + $output = executeQuery('opage.getOpageList', $args); + + // 템플릿에 쓰기 위해서 context::set + 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); + + // 템플릿 파일 지정 + $this->setTemplateFile('index'); + } + + /** + * @brief 외부페이지 추가 폼 출력 + **/ + function dispOpageAdminInsert() { + // 권한 그룹의 목록을 가져온다 + $oMemberModel = &getModel('member'); + $group_list = $oMemberModel->getGroups(); + Context::set('group_list', $group_list); + + // module.xml에서 권한 관련 목록을 구해옴 + $grant_list = $this->xml_info->grant; + Context::set('grant_list', $grant_list); + + // GET parameter에서 module_srl을 가져옴 + $module_srl = Context::get('module_srl'); + + // module_srl이 있으면 해당 모듈의 정보를 구해서 세팅 + if($module_srl) { + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if($module_info->module_srl == $module_srl) Context::set('module_info',$module_info); + else { + unset($module_info); + unset($module_srl); + } + } + + // 레이아웃 목록을 구해옴 + $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); + + // 템플릿 파일 지정 + $this->setTemplateFile('opage_insert'); + } + + + /** + * @brief 외부페이지 삭제 화면 출력 + **/ + function dispOpageAdminDelete() { + $module_srl = Context::get('module_srl'); + if(!$module_srl) return $this->dispContent(); + + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + Context::set('module_info',$module_info); + + // 템플릿 파일 지정 + $this->setTemplateFile('opage_delete'); + } + + /** + * @brief 권한 목록 출력 + **/ + function dispOpageAdminGrantInfo() { + + + // GET parameter에서 module_srl을 가져옴 + $module_srl = Context::get('module_srl'); + + // module_srl이 있으면 해당 모듈의 정보를 구해서 세팅 + if($module_srl) { + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if($module_info->module_srl == $module_srl) Context::set('module_info',$module_info); + else { + unset($module_info); + unset($module_srl); + } + } + + $this->module_info = $module_info; + + // 공통 모듈 권한 설정 페이지 호출 + $oModuleAdminModel = &getAdminModel('module'); + $grant_content = $oModuleAdminModel->getModuleGrantHTML($this->module_info->module_srl, $this->xml_info->grant); + Context::set('grant_content', $grant_content); + + $this->setTemplateFile('grant_list'); + } + } +?> diff --git a/modules/opage/opage.class.php b/modules/opage/opage.class.php index 43eac3954..a83a81421 100644 --- a/modules/opage/opage.class.php +++ b/modules/opage/opage.class.php @@ -1,45 +1,45 @@ - + diff --git a/modules/opage/opage.controller.php b/modules/opage/opage.controller.php index 9d2a179a5..eb86d8c7e 100644 --- a/modules/opage/opage.controller.php +++ b/modules/opage/opage.controller.php @@ -1,105 +1,105 @@ -]*)>(.*?)<\/title>!is', $content, $buff); - return trim($buff[2]); - } - - /** - * @brief header script 추출 - **/ - function getHeadScript($content) { - // title 태그 제거 - $content = preg_replace('!]*)>(.*?)<\/title>!is','', $content); - - // meta 태그 제거 - $content = preg_replace('!<(\/){0,1}meta([^>]*)>!is','', $content); - - // ]*)>!is', $content, $link_buff); - for($i=0;$i!is', $content, $script_buff); - for($i=0;$i]*)>(.*?)<\/body>!is', $content, $body_buff); - $body_script = $body_buff[2]; - - // link, style, script등 제거 - $body_script = preg_replace('!]*)>!is', '', $body_script); - $body_script = preg_replace('!<(style|script)(.*?)<\/(style|script)>!is', '', $body_script); - return $body_script; - } - - /** - * @brief 내용에 포함된 src, href의 값을 변경 - **/ - function replaceSrc($content, $path) { - $url_info = parse_url($path); - $host = sprintf("%s://%s%s",$url_info['scheme'],$url_info['host'],$url_info['port']?':'.$url_info['port']:''); - $this->host = $host.'/'; - $path = $url_info['path']; - if(substr($path,-1)=='/') $path = substr($path,-1); - $t = explode('/',$path); - $_t = array(); - for($i=0,$c=count($t)-1;$i<$c;$i++) { - $v = trim($t[$i]); - if(!$v) continue; - $_t[] = $v; - } - $path = $host.'/'.implode('/',$_t); - if(substr($path,-1)!='/') $path .= '/'; - $this->path = $path; - $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content); - - return $content; - } - - function _replacePath($matches) { - $val = trim($matches[3]); - if(preg_match('/^(http|https|ftp|telnet|mms|mailto)/i',$val)) return $matches[0]; - if(substr($val,0,2)=='./') { - $path = $this->path.substr($val,2); - } elseif(substr($val,0,1)=='/') { - $path = $this->host.substr($val,1); - } else { - $path = $this->path.$val; - } - return sprintf("%s%s%s%s", $matches[1], $matches[2], $path, $matches[4]); - } - - } -?> +]*)>(.*?)<\/title>!is', $content, $buff); + return trim($buff[2]); + } + + /** + * @brief header script 추출 + **/ + function getHeadScript($content) { + // title 태그 제거 + $content = preg_replace('!]*)>(.*?)<\/title>!is','', $content); + + // meta 태그 제거 + $content = preg_replace('!<(\/){0,1}meta([^>]*)>!is','', $content); + + // ]*)>!is', $content, $link_buff); + for($i=0;$i!is', $content, $script_buff); + for($i=0;$i]*)>(.*?)<\/body>!is', $content, $body_buff); + $body_script = $body_buff[2]; + + // link, style, script등 제거 + $body_script = preg_replace('!]*)>!is', '', $body_script); + $body_script = preg_replace('!<(style|script)(.*?)<\/(style|script)>!is', '', $body_script); + return $body_script; + } + + /** + * @brief 내용에 포함된 src, href의 값을 변경 + **/ + function replaceSrc($content, $path) { + $url_info = parse_url($path); + $host = sprintf("%s://%s%s",$url_info['scheme'],$url_info['host'],$url_info['port']?':'.$url_info['port']:''); + $this->host = $host.'/'; + $path = $url_info['path']; + if(substr($path,-1)=='/') $path = substr($path,-1); + $t = explode('/',$path); + $_t = array(); + for($i=0,$c=count($t)-1;$i<$c;$i++) { + $v = trim($t[$i]); + if(!$v) continue; + $_t[] = $v; + } + $path = $host.'/'.implode('/',$_t); + if(substr($path,-1)!='/') $path .= '/'; + $this->path = $path; + $content = preg_replace_callback('/(src=|href=|url\()("|\')?([^"\'\)]+)("|\'\))?/is',array($this,'_replacePath'),$content); + + return $content; + } + + function _replacePath($matches) { + $val = trim($matches[3]); + if(preg_match('/^(http|https|ftp|telnet|mms|mailto)/i',$val)) return $matches[0]; + if(substr($val,0,2)=='./') { + $path = $this->path.substr($val,2); + } elseif(substr($val,0,1)=='/') { + $path = $this->host.substr($val,1); + } else { + $path = $this->path.$val; + } + return sprintf("%s%s%s%s", $matches[1], $matches[2], $path, $matches[4]); + } + + } +?> diff --git a/modules/opage/opage.model.php b/modules/opage/opage.model.php index 99a2254f6..b1856a62d 100644 --- a/modules/opage/opage.model.php +++ b/modules/opage/opage.model.php @@ -1,33 +1,33 @@ -getModuleInfoByModuleSrl($module_srl); - if($module_info->module_srl != $module_srl) return; - - $extra_vars = unserialize($module_info->extra_vars); - if($extra_vars) { - foreach($extra_vars as $key => $val) $module_info->{$key} = $val; - unset($module_info->extra_vars); - } - return $module_info; - } - - } -?> +getModuleInfoByModuleSrl($module_srl); + if($module_info->module_srl != $module_srl) return; + + $extra_vars = unserialize($module_info->extra_vars); + if($extra_vars) { + foreach($extra_vars as $key => $val) $module_info->{$key} = $val; + unset($module_info->extra_vars); + } + return $module_info; + } + + } +?> diff --git a/modules/opage/opage.view.php b/modules/opage/opage.view.php index b09b7fb62..b86a7c156 100644 --- a/modules/opage/opage.view.php +++ b/modules/opage/opage.view.php @@ -1,166 +1,166 @@ -setTemplatePath($this->module_path.'tpl'); - - // 외부 페이지 모듈의 정보를 구함 - $oOpageModel = &getModel('opage'); - $module_info = $oOpageModel->getOpage($this->module_srl); - Context::set('module_info', $module_info); - - // 외부 페이지에서 명시된 외부 페이지 경로/ 캐싱 간격을 를 구함 - $this->path = $module_info->path; - $this->caching_interval = $module_info->caching_interval; - - // 캐시 파일 지정 - $this->cache_file = sprintf("./files/cache/opage/%d.cache.php", $module_info->module_srl); - } - - /** - * @brief 일반 요청시 출력 - **/ - function dispOpageIndex() { - - // http 인지 내부 파일인지 점검 - 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); - - // 결과 출력 템플릿 지정 - $this->setTemplateFile('content'); - } - - /** - * @brief 외부 http로 요청되는 파일일 경우 파일을 받아와서 저장 후 return - **/ - function getHtmlPage($path, $caching_interval, $cache_file) { - - // 캐시 검사 - if($caching_interval > 0 && file_exists($cache_file) && filemtime($cache_file) + $caching_interval*60 > time()) { - - $content = FileHandler::readFile($cache_file); - - } else { - - FileHandler::getRemoteFile($path, $cache_file); - $content = FileHandler::readFile($cache_file); - - } - - // opage controller 생성 - $oOpageController = &getController('opage'); - - // 외부 서버의 페이지 일 경우 이미지, css, javascript등의 url을 변경 - $content = $oOpageController->replaceSrc($content, $path); - - // 해당 문서를 utf-8로 변경 - $buff->content = $content; - $buff = Context::convertEncoding($buff); - $content = $buff->content; - - // title 추출 - $title = $oOpageController->getTitle($content); - if($title) Context::setBrowserTitle($title); - - // header script 추출 - $head_script = $oOpageController->getHeadScript($content); - if($head_script) Context::addHtmlHeader($head_script); - - // body 내용 추출 - $body_script = $oOpageController->getBodyScript($content); - if(!$body_script) $body_script = $content; - - return $content; - } - - /** - * @brief 내부 파일일 경우 include하도록 캐시파일을 만들고 처리 - **/ - function executeFile($path, $caching_interval, $cache_file) { - // 파일이 없으면 취소 - if(!file_exists($path)) return; - - // 경로와 파일이름을 구함 - $tmp_path = explode('/',$cache_file); - $filename = $tmp_path[count($tmp_path)-1]; - $filepath = preg_replace('/'.$filename."$/i","",$cache_file); - - // 캐시 검사 - 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('/( -

    {$lang->opage} {$lang->cmd_management}

    - -
    {nl2br($lang->about_opage)}
    - - -
    - -

    {$module_info->mid} ({$lang->is_default}) | View

    - - - -
    - + +

    {$lang->opage} {$lang->cmd_management}

    + +
    {nl2br($lang->about_opage)}
    + + +
    + +

    {$module_info->mid} ({$lang->is_default}) | View

    + + + +
    + diff --git a/modules/opage/tpl/index.html b/modules/opage/tpl/index.html index 892d630d4..d1099314b 100644 --- a/modules/opage/tpl/index.html +++ b/modules/opage/tpl/index.html @@ -1,85 +1,85 @@ - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    -
    - - - - -
    -
    {$lang->mid}
    {$lang->browser_title}
    {$lang->regdate}
     
    {$no} - - {$lang->not_exists} - - {$module_category[$val->module_category_srl]->title} - - {htmlspecialchars($val->mid)}{$val->browser_title}{zdate($val->regdate,"Y-m-d")}{$lang->cmd_setup}{$lang->cmd_copy}{$lang->cmd_delete}
    - - - - -
    - - - + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    +
    + + + + +
    +
    {$lang->mid}
    {$lang->browser_title}
    {$lang->regdate}
     
    {$no} + + {$lang->not_exists} + + {$module_category[$val->module_category_srl]->title} + + {htmlspecialchars($val->mid)}{$val->browser_title}{zdate($val->regdate,"Y-m-d")}{$lang->cmd_setup}{$lang->cmd_copy}{$lang->cmd_delete}
    + + + + +
    + + + diff --git a/modules/opage/tpl/js/opage_admin.js b/modules/opage/tpl/js/opage_admin.js index 737d7372f..27a8d2d28 100644 --- a/modules/opage/tpl/js/opage_admin.js +++ b/modules/opage/tpl/js/opage_admin.js @@ -1,62 +1,62 @@ -/** - * @file modules/opage/js/opage_admin.js - * @author NHN (developers@xpressengine.com) - * @brief opage모듈의 관리자용 javascript - **/ - -/* 모듈 생성 후 */ -function completeInsertOpage(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; - - var opage = ret_obj['opage']; - var module_srl = ret_obj['module_srl']; - - alert(message); - - var url = ''; - if(location.href.getQuery('module')=='admin') { - url = current_url.setQuery('module_srl',module_srl).setQuery('act','dispOpageAdminInsert'); - if(opage) url = url.setQuery('opage',opage); - } else { - url = current_url.setQuery('act','').setQuery('module_srl',''); - } - - location.href = url; -} - -/* 모듈 삭제 후 */ -function completeDeleteOpage(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; - var opage = ret_obj['opage']; - alert(message); - - var url = current_url.setQuery('act','dispOpageAdminContent'); - if(opage) url = url.setQuery('opage',opage); - - location.href = url; -} - -/* 카테고리 이동 */ -function doChangeCategory(fo_obj) { - var module_category_srl = fo_obj.module_category_srl.options[fo_obj.module_category_srl.selectedIndex].value; - if(module_category_srl==-1) { - location.href = current_url.setQuery('act','dispModuleAdminCategory'); - return false; - } - return true; -} - -/* 일괄 설정 */ -function doCartSetup(url) { - var module_srl = new Array(); - jQuery('#fo_list input[name=cart]:checked').each(function() { - module_srl[module_srl.length] = jQuery(this).val(); - }); - - if(module_srl.length<1) return; - - url += "&module_srls="+module_srl.join(','); - popopen(url,'modulesSetup'); -} +/** + * @file modules/opage/js/opage_admin.js + * @author NHN (developers@xpressengine.com) + * @brief opage모듈의 관리자용 javascript + **/ + +/* 모듈 생성 후 */ +function completeInsertOpage(ret_obj) { + var error = ret_obj['error']; + var message = ret_obj['message']; + + var opage = ret_obj['opage']; + var module_srl = ret_obj['module_srl']; + + alert(message); + + var url = ''; + if(location.href.getQuery('module')=='admin') { + url = current_url.setQuery('module_srl',module_srl).setQuery('act','dispOpageAdminInsert'); + if(opage) url = url.setQuery('opage',opage); + } else { + url = current_url.setQuery('act','').setQuery('module_srl',''); + } + + location.href = url; +} + +/* 모듈 삭제 후 */ +function completeDeleteOpage(ret_obj) { + var error = ret_obj['error']; + var message = ret_obj['message']; + var opage = ret_obj['opage']; + alert(message); + + var url = current_url.setQuery('act','dispOpageAdminContent'); + if(opage) url = url.setQuery('opage',opage); + + location.href = url; +} + +/* 카테고리 이동 */ +function doChangeCategory(fo_obj) { + var module_category_srl = fo_obj.module_category_srl.options[fo_obj.module_category_srl.selectedIndex].value; + if(module_category_srl==-1) { + location.href = current_url.setQuery('act','dispModuleAdminCategory'); + return false; + } + return true; +} + +/* 일괄 설정 */ +function doCartSetup(url) { + var module_srl = new Array(); + jQuery('#fo_list input[name=cart]:checked').each(function() { + module_srl[module_srl.length] = jQuery(this).val(); + }); + + if(module_srl.length<1) return; + + url += "&module_srls="+module_srl.join(','); + popopen(url,'modulesSetup'); +} diff --git a/modules/page/conf/info.xml b/modules/page/conf/info.xml index 72465184d..1adb4feab 100644 --- a/modules/page/conf/info.xml +++ b/modules/page/conf/info.xml @@ -1,36 +1,36 @@ - - - 페이지 - 页面管理 - ページ - Page - Trang - Página - Страницы - 頁面 - Sayfa - 페이지를 제작하여 컨텐츠로 연결할 수 있는 모듈 - 制作页面并能连接到内容区的模块。 - ページを作成してコンテンツとしてリンク出来るようにするモジュールです。 - This module is for creating pages to link with contents. - Module này dành cho việc tạo trang cho liên kết với nội dung. - Este módulo is para crear página para enlazar con contenidos. - Этот модуль служит для создания страниц, чтобы связать их с содержимым. - 製作頁面並連結內容的模組。 - Bu modül içeriklere bağlanacak sayfaları oluşturmak içindir. - 0.1 - 2007-02-28 - service - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 페이지 + 页面管理 + ページ + Page + Trang + Página + Страницы + 頁面 + Sayfa + 페이지를 제작하여 컨텐츠로 연결할 수 있는 모듈 + 制作页面并能连接到内容区的模块。 + ページを作成してコンテンツとしてリンク出来るようにするモジュールです。 + This module is for creating pages to link with contents. + Module này dành cho việc tạo trang cho liên kết với nội dung. + Este módulo is para crear página para enlazar con contenidos. + Этот модуль служит для создания страниц, чтобы связать их с содержимым. + 製作頁面並連結內容的模組。 + Bu modül içeriklere bağlanacak sayfaları oluşturmak içindir. + 0.1 + 2007-02-28 + service + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/page/lang/en.lang.php b/modules/page/lang/en.lang.php index ff56151e2..a4526b825 100644 --- a/modules/page/lang/en.lang.php +++ b/modules/page/lang/en.lang.php @@ -1,16 +1,16 @@ -page = "Page"; - $lang->about_page = "It is a blog module which you can create a complete page.\nUsing latest or other widgets, you can create a dynamic page. Through the editor component, you can also create a great variety of pages.\nIts URL is same as other module's such as mid=module name.\n If it is selected as a default, it will be the main page of the site."; - $lang->cmd_page_modify = "Modify"; - $lang->cmd_page_create = 'Create a Page'; - $lang->page_caching_interval = "Caching Time"; - $lang->about_page_caching_interval = "The unit is minute, and it displays temporary saved data for assigned time.
    It is recommended to cache for proper time if a lot of resources are needed when displaying other servers' data or information.
    A value of 0 will not cache."; - $lang->about_mcontent = 'This is the page you will see from mobile devices. If you have not set this page, rearranged default page will be displayed.'; - $lang->page_management = 'Page Management'; -?> +page = "Page"; + $lang->about_page = "It is a blog module which you can create a complete page.\nUsing latest or other widgets, you can create a dynamic page. Through the editor component, you can also create a great variety of pages.\nIts URL is same as other module's such as mid=module name.\n If it is selected as a default, it will be the main page of the site."; + $lang->cmd_page_modify = "Modify"; + $lang->cmd_page_create = 'Create a Page'; + $lang->page_caching_interval = "Caching Time"; + $lang->about_page_caching_interval = "The unit is minute, and it displays temporary saved data for assigned time.
    It is recommended to cache for proper time if a lot of resources are needed when displaying other servers' data or information.
    A value of 0 will not cache."; + $lang->about_mcontent = 'This is the page you will see from mobile devices. If you have not set this page, rearranged default page will be displayed.'; + $lang->page_management = 'Page Management'; +?> diff --git a/modules/page/lang/es.lang.php b/modules/page/lang/es.lang.php index 7161fb256..73d59727c 100644 --- a/modules/page/lang/es.lang.php +++ b/modules/page/lang/es.lang.php @@ -1,16 +1,16 @@ -page = "Página"; - $lang->about_page = "Esto es un módulo de blog, lo cual usted puede crear una página completa.\nUsando los últimos u otros widgets, Usted puede crear una página dinámica. A través del componente del editor, también puede crear páginas de gran variedad.\nURL de conección es el mismo que de los otros módulos como mid=Nombre del módulo.\n Si selcciona como predefinido esta página será la página principal del sitio."; - $lang->page_caching_interval = "Establezca el tiempo de cache"; - $lang->about_page_caching_interval = "La unidad es minuto, y se muestra temporal de los datos guardados por el tiempo asignado.
    Se recomienda a la cache para una buena vez si una gran cantidad de recursos se necesitan otros servidores cuando se muestran los datos o la informacion.
    Un valor de 0 no cache."; - $lang->cmd_page_modify = "Modificar"; - $lang->cmd_page_create = '페이지 생성'; - $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.'; - $lang->page_management = '페이지 관리'; -?> +page = "Página"; + $lang->about_page = "Esto es un módulo de blog, lo cual usted puede crear una página completa.\nUsando los últimos u otros widgets, Usted puede crear una página dinámica. A través del componente del editor, también puede crear páginas de gran variedad.\nURL de conección es el mismo que de los otros módulos como mid=Nombre del módulo.\n Si selcciona como predefinido esta página será la página principal del sitio."; + $lang->page_caching_interval = "Establezca el tiempo de cache"; + $lang->about_page_caching_interval = "La unidad es minuto, y se muestra temporal de los datos guardados por el tiempo asignado.
    Se recomienda a la cache para una buena vez si una gran cantidad de recursos se necesitan otros servidores cuando se muestran los datos o la informacion.
    Un valor de 0 no cache."; + $lang->cmd_page_modify = "Modificar"; + $lang->cmd_page_create = '페이지 생성'; + $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.'; + $lang->page_management = '페이지 관리'; +?> diff --git a/modules/page/lang/fr.lang.php b/modules/page/lang/fr.lang.php index 7f43fd38d..cbd0c62ec 100644 --- a/modules/page/lang/fr.lang.php +++ b/modules/page/lang/fr.lang.php @@ -1,16 +1,16 @@ -page = "Page"; - $lang->about_page = "C'est un module qui peut créer une page complet.\nVous pouvez créer une page dynamique en utilisant des gadgets des Documents derniers ou d'autres. Vous pouvez aussi créer une page avec variété par le composant d'editeur.\nL'URL d'accès est égal celui d'autre module comme mid=module.\nSi c'est choisi par défaut, ce sera la première page du site."; - $lang->cmd_page_modify = "Modifier"; - $lang->cmd_page_create = '페이지 생성'; - $lang->page_caching_interval = "Temps de antémémoire"; - $lang->about_page_caching_interval = "L'unité est minute, et ça exposera des données conservées temporairement pendant le temps assigné.
    Il est recommandé d'utiliser l'antémémoire pendant le temps convenable si beaucoup de ressource est nécessaire pour représenter les données ou l'information d'autre serveur.
    La valeur 0 signifie de ne pas utiliser antémémoire."; - $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.'; - $lang->page_management = '페이지 관리'; -?> +page = "Page"; + $lang->about_page = "C'est un module qui peut créer une page complet.\nVous pouvez créer une page dynamique en utilisant des gadgets des Documents derniers ou d'autres. Vous pouvez aussi créer une page avec variété par le composant d'editeur.\nL'URL d'accès est égal celui d'autre module comme mid=module.\nSi c'est choisi par défaut, ce sera la première page du site."; + $lang->cmd_page_modify = "Modifier"; + $lang->cmd_page_create = '페이지 생성'; + $lang->page_caching_interval = "Temps de antémémoire"; + $lang->about_page_caching_interval = "L'unité est minute, et ça exposera des données conservées temporairement pendant le temps assigné.
    Il est recommandé d'utiliser l'antémémoire pendant le temps convenable si beaucoup de ressource est nécessaire pour représenter les données ou l'information d'autre serveur.
    La valeur 0 signifie de ne pas utiliser antémémoire."; + $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.'; + $lang->page_management = '페이지 관리'; +?> diff --git a/modules/page/lang/jp.lang.php b/modules/page/lang/jp.lang.php index c104431ca..81bcf57a7 100644 --- a/modules/page/lang/jp.lang.php +++ b/modules/page/lang/jp.lang.php @@ -1,16 +1,16 @@ -page = 'ページ'; - $lang->about_page = "一枚のページを作成出来るモジュールです。\n最新書き込みウィジェットや他のウィジェットを用いて動的なページが作成が出来、さらにエディターのコンポネントで様々なデザインも出来ます。\n接続URLは、他のモジュールと同様に、「mid=モジュール名」でアクセスし、デフォルトとして指定するとサイトにアクセスする際、メインページとして使われます。"; - $lang->cmd_page_modify = 'ページ修正'; - $lang->cmd_page_create = 'ページ作成'; - $lang->page_caching_interval = 'キャッシング時間設定'; - $lang->about_page_caching_interval = '分単位で指定出来、設定された時間の間は、臨時保存されたデータを出力します。
    他のサーバの情報を出力したり、データを出力する際、リソースが多く使われるため、数分単位でキャッシングすることをお勧めします。
    「0」に指定するとキャッシングされません。'; - $lang->about_mcontent = 'モバイルスキン用のページです。作成しないとPC向けのページを再構成して表示します。'; - $lang->page_management = 'ページ管理'; -?> +page = 'ページ'; + $lang->about_page = "一枚のページを作成出来るモジュールです。\n最新書き込みウィジェットや他のウィジェットを用いて動的なページが作成が出来、さらにエディターのコンポネントで様々なデザインも出来ます。\n接続URLは、他のモジュールと同様に、「mid=モジュール名」でアクセスし、デフォルトとして指定するとサイトにアクセスする際、メインページとして使われます。"; + $lang->cmd_page_modify = 'ページ修正'; + $lang->cmd_page_create = 'ページ作成'; + $lang->page_caching_interval = 'キャッシング時間設定'; + $lang->about_page_caching_interval = '分単位で指定出来、設定された時間の間は、臨時保存されたデータを出力します。
    他のサーバの情報を出力したり、データを出力する際、リソースが多く使われるため、数分単位でキャッシングすることをお勧めします。
    「0」に指定するとキャッシングされません。'; + $lang->about_mcontent = 'モバイルスキン用のページです。作成しないとPC向けのページを再構成して表示します。'; + $lang->page_management = 'ページ管理'; +?> diff --git a/modules/page/lang/ko.lang.php b/modules/page/lang/ko.lang.php index 2474f4322..f1e1a259a 100644 --- a/modules/page/lang/ko.lang.php +++ b/modules/page/lang/ko.lang.php @@ -1,16 +1,16 @@ -page = '페이지'; - $lang->about_page = "하나의 완성된 페이지를 제작할 수 있는 페이지 모듈입니다.\n최근게시물이나 기타 위젯을 이용해서 동적인 페이지 생성이 가능하고 에디터 컴포넌트를 통해서 다양한 모습으로 꾸밀 수 있습니다.\n접속 URL은 다른 모듈과 같이 mid=모듈이름 으로 접속 가능하며 기본으로 선택하면 접속 시 메인 페이지가 됩니다."; - $lang->cmd_page_modify = '페이지 수정'; - $lang->cmd_page_create = '페이지 생성'; - $lang->page_caching_interval = '캐싱 시간 설정'; - $lang->about_page_caching_interval = '분 단위이며 정해진 시간동안은 임시 저장한 데이터를 출력합니다.
    다른 서버의 정보를 출력하거나, 데이터 출력하는데 많은 자원이 필요한 경우, 원하시는 분 단위 시간 간격으로 캐싱하는 것을 추천합니다.
    0 으로 하시면 캐싱을 하지 않습니다.'; - $lang->about_mcontent = '모바일에서 보여질 페이지입니다. 만약 작성하지 않으면 기본 페이지 데이터를 재정렬해서 보여줍니다.'; - $lang->page_management = '페이지 관리'; -?> +page = '페이지'; + $lang->about_page = "하나의 완성된 페이지를 제작할 수 있는 페이지 모듈입니다.\n최근게시물이나 기타 위젯을 이용해서 동적인 페이지 생성이 가능하고 에디터 컴포넌트를 통해서 다양한 모습으로 꾸밀 수 있습니다.\n접속 URL은 다른 모듈과 같이 mid=모듈이름 으로 접속 가능하며 기본으로 선택하면 접속 시 메인 페이지가 됩니다."; + $lang->cmd_page_modify = '페이지 수정'; + $lang->cmd_page_create = '페이지 생성'; + $lang->page_caching_interval = '캐싱 시간 설정'; + $lang->about_page_caching_interval = '분 단위이며 정해진 시간동안은 임시 저장한 데이터를 출력합니다.
    다른 서버의 정보를 출력하거나, 데이터 출력하는데 많은 자원이 필요한 경우, 원하시는 분 단위 시간 간격으로 캐싱하는 것을 추천합니다.
    0 으로 하시면 캐싱을 하지 않습니다.'; + $lang->about_mcontent = '모바일에서 보여질 페이지입니다. 만약 작성하지 않으면 기본 페이지 데이터를 재정렬해서 보여줍니다.'; + $lang->page_management = '페이지 관리'; +?> diff --git a/modules/page/lang/ru.lang.php b/modules/page/lang/ru.lang.php index 4538b1dd6..69ebbdadb 100644 --- a/modules/page/lang/ru.lang.php +++ b/modules/page/lang/ru.lang.php @@ -1,16 +1,16 @@ -page = "Страница"; - $lang->about_page = "Это модуль блога, который создает полную страницу.\nИспользуя последние и другие виджеты, Вы можете создавать динамические страницы. Посредством компонента редактора, Вы можете также создать различные вариации страницы.\nURL модуля следует тем же правилам, что и другие модули: mid=имя_модуля.\n Если он выбран как модуль по умолчанию, то он будет главной страницей сайта."; - $lang->page_caching_interval = "Установить время кеширования"; - $lang->about_page_caching_interval = "Единица измерения равна одной минуте. Это отображает временно сохраненные данные для присвоенного времени.
    Рекомендуется устанавливать разумное время кеширования, если множество ресурсов нуждаются в показе данных с других серверов.
    Значение 0 отключает кеширование."; - $lang->cmd_page_modify = "Изменить"; - $lang->cmd_page_create = '페이지 생성'; - $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.'; - $lang->page_management = '페이지 관리'; -?> +page = "Страница"; + $lang->about_page = "Это модуль блога, который создает полную страницу.\nИспользуя последние и другие виджеты, Вы можете создавать динамические страницы. Посредством компонента редактора, Вы можете также создать различные вариации страницы.\nURL модуля следует тем же правилам, что и другие модули: mid=имя_модуля.\n Если он выбран как модуль по умолчанию, то он будет главной страницей сайта."; + $lang->page_caching_interval = "Установить время кеширования"; + $lang->about_page_caching_interval = "Единица измерения равна одной минуте. Это отображает временно сохраненные данные для присвоенного времени.
    Рекомендуется устанавливать разумное время кеширования, если множество ресурсов нуждаются в показе данных с других серверов.
    Значение 0 отключает кеширование."; + $lang->cmd_page_modify = "Изменить"; + $lang->cmd_page_create = '페이지 생성'; + $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.'; + $lang->page_management = '페이지 관리'; +?> diff --git a/modules/page/lang/tr.lang.php b/modules/page/lang/tr.lang.php index 7945917ba..b9c319b0d 100644 --- a/modules/page/lang/tr.lang.php +++ b/modules/page/lang/tr.lang.php @@ -1,16 +1,16 @@ -page = "Sayfa"; - $lang->about_page = "Eksiksiz sayfa oluşturabileceğiniz bir blog modülüdür.\nEnson veya diğer widgetları kullanarak, dinamik sayfa oluşturabilirsiniz. Editör bileşeni yoluyla, çok farklı sayıda sayfalar oluşturabilirsiniz.\nURL\'si diğer modülleriyle aynıdır(mid=module name).\n Varsayılan olarak seçilirse, sitenin anasayfası olacaktır."; - $lang->cmd_page_modify = "Değiştir"; - $lang->cmd_page_create = 'Sayfa Oluştur'; - $lang->page_caching_interval = "Önbelleğe Alma Zamanı"; - $lang->about_page_caching_interval = "Birim dakikadır ve belirlenen zaman için geçici olarak kaydedilmiş veriyi gösterir.
    Diğer sunucuların veri veya bilgileri gösterilirken, eğer fazla sayıda kaynağın gösterilmesi gerekiyorsa, uygun zamanın önbelleğe alınması önerilmiştir.
    0 değeri verilirse, önbelleğe alınmayacaktır."; - $lang->about_mcontent = 'Bu sayfa, sizin hareketli cihazlardan göreceğiniz sayfadır. Eğer bu sayfayı ayarlamadıysanız, düzenlenmiş varsayılan sayfa gösterilecektir.'; - $lang->page_management = 'Sayfa Yönetimi'; -?> +page = "Sayfa"; + $lang->about_page = "Eksiksiz sayfa oluşturabileceğiniz bir blog modülüdür.\nEnson veya diğer widgetları kullanarak, dinamik sayfa oluşturabilirsiniz. Editör bileşeni yoluyla, çok farklı sayıda sayfalar oluşturabilirsiniz.\nURL\'si diğer modülleriyle aynıdır(mid=module name).\n Varsayılan olarak seçilirse, sitenin anasayfası olacaktır."; + $lang->cmd_page_modify = "Değiştir"; + $lang->cmd_page_create = 'Sayfa Oluştur'; + $lang->page_caching_interval = "Önbelleğe Alma Zamanı"; + $lang->about_page_caching_interval = "Birim dakikadır ve belirlenen zaman için geçici olarak kaydedilmiş veriyi gösterir.
    Diğer sunucuların veri veya bilgileri gösterilirken, eğer fazla sayıda kaynağın gösterilmesi gerekiyorsa, uygun zamanın önbelleğe alınması önerilmiştir.
    0 değeri verilirse, önbelleğe alınmayacaktır."; + $lang->about_mcontent = 'Bu sayfa, sizin hareketli cihazlardan göreceğiniz sayfadır. Eğer bu sayfayı ayarlamadıysanız, düzenlenmiş varsayılan sayfa gösterilecektir.'; + $lang->page_management = 'Sayfa Yönetimi'; +?> diff --git a/modules/page/lang/vi.lang.php b/modules/page/lang/vi.lang.php index 3cbd72864..182a2475b 100644 --- a/modules/page/lang/vi.lang.php +++ b/modules/page/lang/vi.lang.php @@ -1,18 +1,18 @@ -page = "Trang"; - $lang->about_page = "Là Module tạo ra một trang đầy đủ.\nSử dụng Widget mới nhất hoặc những Widget khác giúp bạn có thể tạo một trang động. Thông qua trình bên tập Component, bạn có thể tạo ra sự phong phú cho những trang khác nhau.\nĐịa chỉ của nó như một Module dạng 'mid=module name'.\nNếu chọn là mặc định, nó sẽ là trang chủ của Website."; - $lang->cmd_page_modify = "Sửa đổi"; - $lang->cmd_page_create = '페이지 생성'; - $lang->page_caching_interval = "Thời gian lưu trữ"; - $lang->about_page_caching_interval = "Đơn vị được tính bằng phút, nó sẽ là thời gian lưu trữ tạm thời.
    Đó là khuyến cáo thời gian lưu trữ tạm thời thích hợp khi cần để hiển thị.
    Nhập 0 nếu không sử dụng tính năng này."; - $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.'; - $lang->page_management = '페이지 관리'; -?> +page = "Trang"; + $lang->about_page = "Là Module tạo ra một trang đầy đủ.\nSử dụng Widget mới nhất hoặc những Widget khác giúp bạn có thể tạo một trang động. Thông qua trình bên tập Component, bạn có thể tạo ra sự phong phú cho những trang khác nhau.\nĐịa chỉ của nó như một Module dạng 'mid=module name'.\nNếu chọn là mặc định, nó sẽ là trang chủ của Website."; + $lang->cmd_page_modify = "Sửa đổi"; + $lang->cmd_page_create = '페이지 생성'; + $lang->page_caching_interval = "Thời gian lưu trữ"; + $lang->about_page_caching_interval = "Đơn vị được tính bằng phút, nó sẽ là thời gian lưu trữ tạm thời.
    Đó là khuyến cáo thời gian lưu trữ tạm thời thích hợp khi cần để hiển thị.
    Nhập 0 nếu không sử dụng tính năng này."; + $lang->about_mcontent = 'This is the page for the mobile view. If you do not write this page, the mobile view display reoragnized PC view\'s page.'; + $lang->page_management = '페이지 관리'; +?> diff --git a/modules/page/lang/zh-CN.lang.php b/modules/page/lang/zh-CN.lang.php index f6a4eae7d..bb66c91bd 100644 --- a/modules/page/lang/zh-CN.lang.php +++ b/modules/page/lang/zh-CN.lang.php @@ -1,16 +1,16 @@ -page = "页面"; - $lang->about_page = "可制作完整页面的模块。\n利用最新主题列表或其他控件可以生成动态的页面,且通过网页编辑器做出形式多样的页面。\n连接页面URL同其他模块链接相同。即:mid=模块名称。选择默认选项此页面将变为首页。"; - $lang->cmd_page_modify = "页面编辑"; - $lang->cmd_page_create = '페이지 생성'; - $lang->page_caching_interval = "缓冲时间设置"; - $lang->about_page_caching_interval = "单位为分。缓冲时间间隔内页面将输出临时储存的数据。
    显示外链服务器信息或数据时,如消耗资源很大,尽量把缓冲时间设置为大一点的相应值。
    0 表示无缓冲。"; - $lang->about_mcontent = '此页为移动版页面,如您没有对此页面进行布局,它会自动将PC版页面数据重排序显示。'; - $lang->page_management = '페이지 관리'; -?> +page = "页面"; + $lang->about_page = "可制作完整页面的模块。\n利用最新主题列表或其他控件可以生成动态的页面,且通过网页编辑器做出形式多样的页面。\n连接页面URL同其他模块链接相同。即:mid=模块名称。选择默认选项此页面将变为首页。"; + $lang->cmd_page_modify = "页面编辑"; + $lang->cmd_page_create = '페이지 생성'; + $lang->page_caching_interval = "缓冲时间设置"; + $lang->about_page_caching_interval = "单位为分。缓冲时间间隔内页面将输出临时储存的数据。
    显示外链服务器信息或数据时,如消耗资源很大,尽量把缓冲时间设置为大一点的相应值。
    0 表示无缓冲。"; + $lang->about_mcontent = '此页为移动版页面,如您没有对此页面进行布局,它会自动将PC版页面数据重排序显示。'; + $lang->page_management = '페이지 관리'; +?> diff --git a/modules/page/lang/zh-TW.lang.php b/modules/page/lang/zh-TW.lang.php index ab493c136..ea4ba7b97 100644 --- a/modules/page/lang/zh-TW.lang.php +++ b/modules/page/lang/zh-TW.lang.php @@ -1,16 +1,16 @@ -page = "頁面"; - $lang->about_page = "可製作完整頁面的模組。\n利用最新主題列表或其他 Widgets 可以建立動態的頁面,且通過網頁編輯器做出多樣化的頁面。\n連結頁面網址和其他模組連結的方式相同。即:mid=模組名稱。選擇預設選項時,此頁面將變為首頁。"; - $lang->cmd_page_modify = "頁面編輯"; - $lang->cmd_page_create = '建立頁面'; - $lang->page_caching_interval = "暫存時間設置"; - $lang->about_page_caching_interval = "單位為分。暫存時間內頁面將輸出臨時儲存的資料。
    輸出外部主機訊息或資料時,如消耗資源很大,盡量把暫存時間設大一點。
    『0』表示不暫存。"; - $lang->about_mcontent = '此頁面為手機瀏覽頁面。如果沒有編輯此頁面,則會將預設頁面改編重新顯示。'; - $lang->page_management = '頁面管理'; -?> +page = "頁面"; + $lang->about_page = "可製作完整頁面的模組。\n利用最新主題列表或其他 Widgets 可以建立動態的頁面,且通過網頁編輯器做出多樣化的頁面。\n連結頁面網址和其他模組連結的方式相同。即:mid=模組名稱。選擇預設選項時,此頁面將變為首頁。"; + $lang->cmd_page_modify = "頁面編輯"; + $lang->cmd_page_create = '建立頁面'; + $lang->page_caching_interval = "暫存時間設置"; + $lang->about_page_caching_interval = "單位為分。暫存時間內頁面將輸出臨時儲存的資料。
    輸出外部主機訊息或資料時,如消耗資源很大,盡量把暫存時間設大一點。
    『0』表示不暫存。"; + $lang->about_mcontent = '此頁面為手機瀏覽頁面。如果沒有編輯此頁面,則會將預設頁面改編重新顯示。'; + $lang->page_management = '頁面管理'; +?> diff --git a/modules/page/page.admin.controller.php b/modules/page/page.admin.controller.php index 0e6739c87..309302686 100644 --- a/modules/page/page.admin.controller.php +++ b/modules/page/page.admin.controller.php @@ -1,221 +1,221 @@ -module = 'page'; - $args->mid = $args->page_name; - unset($args->page_name); - - if($args->use_mobile != 'Y') $args->use_mobile = ''; - - // 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); - } - else - { - foreach($args as $key=>$val) - { - $module_info->{$key} = $val; - } - $args = $module_info; - } - } - - // module_srl의 값에 따라 insert/update - if(!$args->module_srl) { - $output = $oModuleController->insertModule($args); - $msg_code = 'success_registed'; - } else { - $output = $oModuleController->updateModule($args); - $msg_code = 'success_updated'; - } - - if(!$output->toBool()) return $output; - - $this->add("page", Context::get('page')); - $this->add('module_srl',$output->get('module_srl')); - $this->setMessage($msg_code); - } - - function putDocumentsInPageToArray($target, &$array) - { - if(!$target) return; - preg_match_all('!]+)!is', $target, $matches); - $pattern = '!document_srl="(\d+)"!'; - foreach($matches[1] as $match) - { - $match2 = null; - preg_match($pattern, $match, $match2); - if(count($match2)) - { - $array[(int)$match2[1]] = 1; - } - } - } - - /** - * @brief 페이지 수정 내용 저장 - **/ - function procPageAdminInsertContent() { - $module_srl = Context::get('module_srl'); - $content = Context::get('content'); - if(!$module_srl) return new Object(-1,'msg_invalid_request'); - $mcontent = Context::get('mcontent'); - $type = Context::get('type'); - - // 페이지의 원 정보를 구해옴 - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - if($type == "mobile") { - if(!$mcontent) $mcontent = ''; - $module_info->mcontent = $mcontent; - } - else { - if(!isset($content)) $content =''; - $module_info->content = $content; - } - - $document_srls = array(); - $this->putDocumentsInPageToArray($module_info->content, $document_srls); - $this->putDocumentsInPageToArray($module_info->mcontent, $document_srls); - - $oDocumentModel = &getModel('document'); - $oDocumentController = &getController('document'); - $obj->module_srl = $module_srl; - $obj->list_count = 99999999; - $output = $oDocumentModel->getDocumentList($obj); - if(count($output->data)) { - foreach($output->data as $document) - { - if($document_srls[$document->document_srl]) continue; - $oDocumentController->deleteDocument($document->document_srl, true); - } - } - // module 모듈의 controller 객체 생성 - $oModuleController = &getController('module'); - - // 저장 - $output = $oModuleController->updateModule($module_info); - if(!$output->toBool()) return $output; - - // 해당 페이지에 첨부된 파일의 상태를 유효로 변경 - $oFileController = &getController('file'); - $oFileController->setFilesValid($module_info->module_srl); - - // 캐시파일 재생성 - //$this->procPageAdminRemoveWidgetCache(); - - $this->add("module_srl", $module_info->module_srl); - $this->add("page", Context::get('page')); - $this->add("mid", $module_info->mid); - $this->setMessage($msg_code); - } - - /** - * @brief 페이지 삭제 - **/ - function procPageAdminDelete() { - $module_srl = Context::get('module_srl'); - - // 원본을 구해온다 - $oModuleController = &getController('module'); - $output = $oModuleController->deleteModule($module_srl); - if(!$output->toBool()) return $output; - - $this->add('module','page'); - $this->add('page',Context::get('page')); - $this->setMessage('success_deleted'); - } - - /** - * @brief 페이지 기본 정보의 추가 - **/ - function procPageAdminInsertConfig() { - // 기본 정보를 받음 - $args = Context::getRequestVars(); - - // module Controller 객체 생성하여 입력 - $oModuleController = &getController('module'); - $output = $oModuleController->insertModuleConfig('page',$args); - return $output; - } - - /** - * @brief 첨부파일 업로드 - **/ - function procUploadFile() { - // 기본적으로 필요한 변수 설정 - $upload_target_srl = Context::get('upload_target_srl'); - $module_srl = Context::get('module_srl'); - - // file class의 controller 객체 생성 - $oFileController = &getController('file'); - $output = $oFileController->insertFile($module_srl, $upload_target_srl); - - // 첨부파일의 목록을 java script로 출력 - $oFileController->printUploadedFileList($upload_target_srl); - } - - /** - * @brief 첨부파일 삭제 - * 에디터에서 개별 파일 삭제시 사용 - **/ - function procDeleteFile() { - // 기본적으로 필요한 변수인 upload_target_srl, module_srl을 설정 - $upload_target_srl = Context::get('upload_target_srl'); - $module_srl = Context::get('module_srl'); - $file_srl = Context::get('file_srl'); - - // file class의 controller 객체 생성 - $oFileController = &getController('file'); - if($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager); - - // 첨부파일의 목록을 java script로 출력 - $oFileController->printUploadedFileList($upload_target_srl); - } - - /** - * @brief 지정된 페이지의 위젯 캐시 파일 지우기 - **/ - function procPageAdminRemoveWidgetCache() { - $module_srl = Context::get('module_srl'); - - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - - $content = $module_info->content; - - $cache_file = sprintf("%sfiles/cache/page/%d.%s.cache.php", _XE_PATH_, $module_info->module_srl, Context::getLangType()); - if(file_exists($cache_file)) FileHandler::removeFile($cache_file); - - // widget controller 의 캐시파일 재생성 실행 - $oWidgetController = &getController('widget'); - $oWidgetController->recompileWidget($content); - } - - } -?> +module = 'page'; + $args->mid = $args->page_name; + unset($args->page_name); + + if($args->use_mobile != 'Y') $args->use_mobile = ''; + + // 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); + } + else + { + foreach($args as $key=>$val) + { + $module_info->{$key} = $val; + } + $args = $module_info; + } + } + + // module_srl의 값에 따라 insert/update + if(!$args->module_srl) { + $output = $oModuleController->insertModule($args); + $msg_code = 'success_registed'; + } else { + $output = $oModuleController->updateModule($args); + $msg_code = 'success_updated'; + } + + if(!$output->toBool()) return $output; + + $this->add("page", Context::get('page')); + $this->add('module_srl',$output->get('module_srl')); + $this->setMessage($msg_code); + } + + function putDocumentsInPageToArray($target, &$array) + { + if(!$target) return; + preg_match_all('!]+)!is', $target, $matches); + $pattern = '!document_srl="(\d+)"!'; + foreach($matches[1] as $match) + { + $match2 = null; + preg_match($pattern, $match, $match2); + if(count($match2)) + { + $array[(int)$match2[1]] = 1; + } + } + } + + /** + * @brief 페이지 수정 내용 저장 + **/ + function procPageAdminInsertContent() { + $module_srl = Context::get('module_srl'); + $content = Context::get('content'); + if(!$module_srl) return new Object(-1,'msg_invalid_request'); + $mcontent = Context::get('mcontent'); + $type = Context::get('type'); + + // 페이지의 원 정보를 구해옴 + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if($type == "mobile") { + if(!$mcontent) $mcontent = ''; + $module_info->mcontent = $mcontent; + } + else { + if(!isset($content)) $content =''; + $module_info->content = $content; + } + + $document_srls = array(); + $this->putDocumentsInPageToArray($module_info->content, $document_srls); + $this->putDocumentsInPageToArray($module_info->mcontent, $document_srls); + + $oDocumentModel = &getModel('document'); + $oDocumentController = &getController('document'); + $obj->module_srl = $module_srl; + $obj->list_count = 99999999; + $output = $oDocumentModel->getDocumentList($obj); + if(count($output->data)) { + foreach($output->data as $document) + { + if($document_srls[$document->document_srl]) continue; + $oDocumentController->deleteDocument($document->document_srl, true); + } + } + // module 모듈의 controller 객체 생성 + $oModuleController = &getController('module'); + + // 저장 + $output = $oModuleController->updateModule($module_info); + if(!$output->toBool()) return $output; + + // 해당 페이지에 첨부된 파일의 상태를 유효로 변경 + $oFileController = &getController('file'); + $oFileController->setFilesValid($module_info->module_srl); + + // 캐시파일 재생성 + //$this->procPageAdminRemoveWidgetCache(); + + $this->add("module_srl", $module_info->module_srl); + $this->add("page", Context::get('page')); + $this->add("mid", $module_info->mid); + $this->setMessage($msg_code); + } + + /** + * @brief 페이지 삭제 + **/ + function procPageAdminDelete() { + $module_srl = Context::get('module_srl'); + + // 원본을 구해온다 + $oModuleController = &getController('module'); + $output = $oModuleController->deleteModule($module_srl); + if(!$output->toBool()) return $output; + + $this->add('module','page'); + $this->add('page',Context::get('page')); + $this->setMessage('success_deleted'); + } + + /** + * @brief 페이지 기본 정보의 추가 + **/ + function procPageAdminInsertConfig() { + // 기본 정보를 받음 + $args = Context::getRequestVars(); + + // module Controller 객체 생성하여 입력 + $oModuleController = &getController('module'); + $output = $oModuleController->insertModuleConfig('page',$args); + return $output; + } + + /** + * @brief 첨부파일 업로드 + **/ + function procUploadFile() { + // 기본적으로 필요한 변수 설정 + $upload_target_srl = Context::get('upload_target_srl'); + $module_srl = Context::get('module_srl'); + + // file class의 controller 객체 생성 + $oFileController = &getController('file'); + $output = $oFileController->insertFile($module_srl, $upload_target_srl); + + // 첨부파일의 목록을 java script로 출력 + $oFileController->printUploadedFileList($upload_target_srl); + } + + /** + * @brief 첨부파일 삭제 + * 에디터에서 개별 파일 삭제시 사용 + **/ + function procDeleteFile() { + // 기본적으로 필요한 변수인 upload_target_srl, module_srl을 설정 + $upload_target_srl = Context::get('upload_target_srl'); + $module_srl = Context::get('module_srl'); + $file_srl = Context::get('file_srl'); + + // file class의 controller 객체 생성 + $oFileController = &getController('file'); + if($file_srl) $output = $oFileController->deleteFile($file_srl, $this->grant->manager); + + // 첨부파일의 목록을 java script로 출력 + $oFileController->printUploadedFileList($upload_target_srl); + } + + /** + * @brief 지정된 페이지의 위젯 캐시 파일 지우기 + **/ + function procPageAdminRemoveWidgetCache() { + $module_srl = Context::get('module_srl'); + + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + + $content = $module_info->content; + + $cache_file = sprintf("%sfiles/cache/page/%d.%s.cache.php", _XE_PATH_, $module_info->module_srl, Context::getLangType()); + if(file_exists($cache_file)) FileHandler::removeFile($cache_file); + + // widget controller 의 캐시파일 재생성 실행 + $oWidgetController = &getController('widget'); + $oWidgetController->recompileWidget($content); + } + + } +?> diff --git a/modules/page/page.admin.view.php b/modules/page/page.admin.view.php index 60183644e..4beac6f08 100644 --- a/modules/page/page.admin.view.php +++ b/modules/page/page.admin.view.php @@ -1,258 +1,258 @@ -getModuleInfoByModuleSrl($module_srl); - if(!$module_info) { - Context::set('module_srl',''); - $this->act = 'list'; - } else { - ModuleModel::syncModuleToSite($module_info); - $this->module_info = $module_info; - Context::set('module_info',$module_info); - } - } - - // 모듈 카테고리 목록을 구함 - $module_category = $oModuleModel->getModuleCategories(); - Context::set('module_category', $module_category); - - // 템플릿 경로 구함 (page의 경우 tpl에 관리자용 템플릿 모아놓음) - $this->setTemplatePath($this->module_path.'tpl'); - - } - - /** - * @brief 페이지 관리 목록 보여줌 - **/ - function dispPageAdminContent() { - $args->sort_index = "module_srl"; - $args->page = Context::get('page'); - $args->list_count = 40; - $args->page_count = 10; - $args->s_module_category_srl = Context::get('module_category_srl'); - - $s_mid = Context::get('s_mid'); - if($s_mid) $args->s_mid = $s_mid; - - $s_browser_title = Context::get('s_browser_title'); - if($s_browser_title) $args->s_browser_title = $s_browser_title; - - $output = executeQuery('page.getPageList', $args); - moduleModel::syncModuleToSite($output->data); - - // 템플릿에 쓰기 위해서 context::set - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('page_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - // 템플릿 파일 지정 - $this->setTemplateFile('index'); - } - - /** - * @brief 선택된 페이지의 정보 출력 - **/ - function dispPageAdminInfo() { - // GET parameter에서 module_srl을 가져옴 - $module_srl = Context::get('module_srl'); - - $module_info = Context::get('module_info'); - - // module_srl 값이 없다면 그냥 index 페이지를 보여줌 - if(!$module_srl) return $this->dispPageAdminContent(); - - // 레이아웃이 정해져 있다면 레이아웃 정보를 추가해줌(layout_title, layout) - if($module_info->layout_srl) { - $oLayoutModel = &getModel('layout'); - $layout_info = $oLayoutModel->getLayout($module_info->layout_srl); - $module_info->layout = $layout_info->layout; - $module_info->layout_title = $layout_info->layout_title; - } - - // 레이아웃 목록을 구해옴 - $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); - - // 템플릿 파일 지정 - $this->setTemplateFile('page_info'); - } - - /** - * @brief 페이지 추가 설정 보여줌 - * 추가설정은 서비스형 모듈들에서 다른 모듈과의 연계를 위해서 설정하는 페이지임 - **/ - function dispPageAdminPageAdditionSetup() { - // content는 다른 모듈에서 call by reference로 받아오기에 미리 변수 선언만 해 놓음 - $content = ''; - - $oEditorView = &getView('editor'); - $oEditorView->triggerDispEditorAdditionSetup($content); - Context::set('setup_content', $content); - - // 템플릿 파일 지정 - $this->setTemplateFile('addition_setup'); - } - - /** - * @brief 페이지 추가 폼 출력 - **/ - function dispPageAdminInsert() { - - // GET parameter에서 module_srl을 가져옴 - $module_srl = Context::get('module_srl'); - - // module_srl이 있으면 해당 모듈의 정보를 구해서 세팅 - if($module_srl) { - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - if($module_info->module_srl == $module_srl) Context::set('module_info',$module_info); - else { - unset($module_info); - unset($module_srl); - } - } - - // 레이아웃 목록을 구해옴 - $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); - - // 템플릿 파일 지정 - $this->setTemplateFile('page_insert'); - } - - function dispPageAdminMobileContent() { - if($this->module_srl) Context::set('module_srl',$this->module_srl); - - // 캐시 파일 지정 - $cache_file = sprintf("%sfiles/cache/page/%d.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType()); - $interval = (int)($this->module_info->page_caching_interval); - if($interval>0) { - if(!file_exists($cache_file)) $mtime = 0; - else $mtime = filemtime($cache_file); - - if($mtime + $interval*60 > time()) { - $page_content = FileHandler::readFile($cache_file); - } else { - $oWidgetController = &getController('widget'); - $page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent); - FileHandler::writeFile($cache_file, $page_content); - } - } else { - if(file_exists($cache_file)) FileHandler::removeFile($cache_file); - $page_content = $this->module_info->mcontent; - } - - Context::set('module_info', $this->module_info); - Context::set('page_content', $page_content); - - $this->setTemplateFile('mcontent'); - } - - function dispPageAdminMobileContentModify() { - Context::set('module_info', $this->module_info); - - // 내용을 세팅 - $content = Context::get('mcontent'); - if(!$content) $content = $this->module_info->mcontent; - Context::set('content', $content); - - // 내용중 위젯들을 변환 - $oWidgetController = &getController('widget'); - $content = $oWidgetController->transWidgetCode($content, true); - Context::set('page_content', $content); - - // 위젯 목록을 세팅 - $oWidgetModel = &getModel('widget'); - $widget_list = $oWidgetModel->getDownloadedWidgetList(); - Context::set('widget_list', $widget_list); - - // 템플릿 파일 지정 - $this->setTemplateFile('page_mobile_content_modify'); - } - - /** - * @brief 페이지 내용 수정 - **/ - function dispPageAdminContentModify() { - // 모듈 정보를 세팅 - Context::set('module_info', $this->module_info); - - // 내용을 세팅 - $content = Context::get('content'); - if(!$content) $content = $this->module_info->content; - Context::set('content', $content); - - // 내용중 위젯들을 변환 - $oWidgetController = &getController('widget'); - $content = $oWidgetController->transWidgetCode($content, true); - Context::set('page_content', $content); - - // 위젯 목록을 세팅 - $oWidgetModel = &getModel('widget'); - $widget_list = $oWidgetModel->getDownloadedWidgetList(); - Context::set('widget_list', $widget_list); - - // 템플릿 파일 지정 - $this->setTemplateFile('page_content_modify'); - } - - /** - * @brief 페이지 삭제 화면 출력 - **/ - function dispPageAdminDelete() { - $module_srl = Context::get('module_srl'); - if(!$module_srl) return $this->dispContent(); - - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - Context::set('module_info',$module_info); - - // 템플릿 파일 지정 - $this->setTemplateFile('page_delete'); - } - - /** - * @brief 권한 목록 출력 - **/ - function dispPageAdminGrantInfo() { - // 공통 모듈 권한 설정 페이지 호출 - $oModuleAdminModel = &getAdminModel('module'); - $grant_content = $oModuleAdminModel->getModuleGrantHTML($this->module_info->module_srl, $this->xml_info->grant); - Context::set('grant_content', $grant_content); - - $this->setTemplateFile('grant_list'); - } - } -?> +getModuleInfoByModuleSrl($module_srl); + if(!$module_info) { + Context::set('module_srl',''); + $this->act = 'list'; + } else { + ModuleModel::syncModuleToSite($module_info); + $this->module_info = $module_info; + Context::set('module_info',$module_info); + } + } + + // 모듈 카테고리 목록을 구함 + $module_category = $oModuleModel->getModuleCategories(); + Context::set('module_category', $module_category); + + // 템플릿 경로 구함 (page의 경우 tpl에 관리자용 템플릿 모아놓음) + $this->setTemplatePath($this->module_path.'tpl'); + + } + + /** + * @brief 페이지 관리 목록 보여줌 + **/ + function dispPageAdminContent() { + $args->sort_index = "module_srl"; + $args->page = Context::get('page'); + $args->list_count = 40; + $args->page_count = 10; + $args->s_module_category_srl = Context::get('module_category_srl'); + + $s_mid = Context::get('s_mid'); + if($s_mid) $args->s_mid = $s_mid; + + $s_browser_title = Context::get('s_browser_title'); + if($s_browser_title) $args->s_browser_title = $s_browser_title; + + $output = executeQuery('page.getPageList', $args); + moduleModel::syncModuleToSite($output->data); + + // 템플릿에 쓰기 위해서 context::set + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('page_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + // 템플릿 파일 지정 + $this->setTemplateFile('index'); + } + + /** + * @brief 선택된 페이지의 정보 출력 + **/ + function dispPageAdminInfo() { + // GET parameter에서 module_srl을 가져옴 + $module_srl = Context::get('module_srl'); + + $module_info = Context::get('module_info'); + + // module_srl 값이 없다면 그냥 index 페이지를 보여줌 + if(!$module_srl) return $this->dispPageAdminContent(); + + // 레이아웃이 정해져 있다면 레이아웃 정보를 추가해줌(layout_title, layout) + if($module_info->layout_srl) { + $oLayoutModel = &getModel('layout'); + $layout_info = $oLayoutModel->getLayout($module_info->layout_srl); + $module_info->layout = $layout_info->layout; + $module_info->layout_title = $layout_info->layout_title; + } + + // 레이아웃 목록을 구해옴 + $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); + + // 템플릿 파일 지정 + $this->setTemplateFile('page_info'); + } + + /** + * @brief 페이지 추가 설정 보여줌 + * 추가설정은 서비스형 모듈들에서 다른 모듈과의 연계를 위해서 설정하는 페이지임 + **/ + function dispPageAdminPageAdditionSetup() { + // content는 다른 모듈에서 call by reference로 받아오기에 미리 변수 선언만 해 놓음 + $content = ''; + + $oEditorView = &getView('editor'); + $oEditorView->triggerDispEditorAdditionSetup($content); + Context::set('setup_content', $content); + + // 템플릿 파일 지정 + $this->setTemplateFile('addition_setup'); + } + + /** + * @brief 페이지 추가 폼 출력 + **/ + function dispPageAdminInsert() { + + // GET parameter에서 module_srl을 가져옴 + $module_srl = Context::get('module_srl'); + + // module_srl이 있으면 해당 모듈의 정보를 구해서 세팅 + if($module_srl) { + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + if($module_info->module_srl == $module_srl) Context::set('module_info',$module_info); + else { + unset($module_info); + unset($module_srl); + } + } + + // 레이아웃 목록을 구해옴 + $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); + + // 템플릿 파일 지정 + $this->setTemplateFile('page_insert'); + } + + function dispPageAdminMobileContent() { + if($this->module_srl) Context::set('module_srl',$this->module_srl); + + // 캐시 파일 지정 + $cache_file = sprintf("%sfiles/cache/page/%d.%s.m.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType()); + $interval = (int)($this->module_info->page_caching_interval); + if($interval>0) { + if(!file_exists($cache_file)) $mtime = 0; + else $mtime = filemtime($cache_file); + + if($mtime + $interval*60 > time()) { + $page_content = FileHandler::readFile($cache_file); + } else { + $oWidgetController = &getController('widget'); + $page_content = $oWidgetController->transWidgetCode($this->module_info->mcontent); + FileHandler::writeFile($cache_file, $page_content); + } + } else { + if(file_exists($cache_file)) FileHandler::removeFile($cache_file); + $page_content = $this->module_info->mcontent; + } + + Context::set('module_info', $this->module_info); + Context::set('page_content', $page_content); + + $this->setTemplateFile('mcontent'); + } + + function dispPageAdminMobileContentModify() { + Context::set('module_info', $this->module_info); + + // 내용을 세팅 + $content = Context::get('mcontent'); + if(!$content) $content = $this->module_info->mcontent; + Context::set('content', $content); + + // 내용중 위젯들을 변환 + $oWidgetController = &getController('widget'); + $content = $oWidgetController->transWidgetCode($content, true); + Context::set('page_content', $content); + + // 위젯 목록을 세팅 + $oWidgetModel = &getModel('widget'); + $widget_list = $oWidgetModel->getDownloadedWidgetList(); + Context::set('widget_list', $widget_list); + + // 템플릿 파일 지정 + $this->setTemplateFile('page_mobile_content_modify'); + } + + /** + * @brief 페이지 내용 수정 + **/ + function dispPageAdminContentModify() { + // 모듈 정보를 세팅 + Context::set('module_info', $this->module_info); + + // 내용을 세팅 + $content = Context::get('content'); + if(!$content) $content = $this->module_info->content; + Context::set('content', $content); + + // 내용중 위젯들을 변환 + $oWidgetController = &getController('widget'); + $content = $oWidgetController->transWidgetCode($content, true); + Context::set('page_content', $content); + + // 위젯 목록을 세팅 + $oWidgetModel = &getModel('widget'); + $widget_list = $oWidgetModel->getDownloadedWidgetList(); + Context::set('widget_list', $widget_list); + + // 템플릿 파일 지정 + $this->setTemplateFile('page_content_modify'); + } + + /** + * @brief 페이지 삭제 화면 출력 + **/ + function dispPageAdminDelete() { + $module_srl = Context::get('module_srl'); + if(!$module_srl) return $this->dispContent(); + + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + Context::set('module_info',$module_info); + + // 템플릿 파일 지정 + $this->setTemplateFile('page_delete'); + } + + /** + * @brief 권한 목록 출력 + **/ + function dispPageAdminGrantInfo() { + // 공통 모듈 권한 설정 페이지 호출 + $oModuleAdminModel = &getAdminModel('module'); + $grant_content = $oModuleAdminModel->getModuleGrantHTML($this->module_info->module_srl, $this->xml_info->grant); + Context::set('grant_content', $grant_content); + + $this->setTemplateFile('grant_list'); + } + } +?> diff --git a/modules/page/page.api.php b/modules/page/page.api.php index 40be8ce4f..5f0b839c9 100644 --- a/modules/page/page.api.php +++ b/modules/page/page.api.php @@ -1,25 +1,25 @@ -triggerWidgetCompile(&$page_content); - Context::setResponseMethod($requestMethod); - - $oModule->add('page_content',$page_content); - } - } -?> +triggerWidgetCompile(&$page_content); + Context::setResponseMethod($requestMethod); + + $oModule->add('page_content',$page_content); + } + } +?> diff --git a/modules/page/page.class.php b/modules/page/page.class.php index 584f88637..116bc3261 100644 --- a/modules/page/page.class.php +++ b/modules/page/page.class.php @@ -1,42 +1,42 @@ - + diff --git a/modules/page/page.view.php b/modules/page/page.view.php index 6dd65e384..44b73ce5e 100644 --- a/modules/page/page.view.php +++ b/modules/page/page.view.php @@ -1,54 +1,54 @@ -setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 일반 요청시 출력 - **/ - function dispPageIndex() { - // 템플릿에서 사용할 변수를 Context::set() - if($this->module_srl) Context::set('module_srl',$this->module_srl); - - // 캐시 파일 지정 - $cache_file = sprintf("%sfiles/cache/page/%d.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType()); - $interval = (int)($this->module_info->page_caching_interval); - if($interval>0) { - if(!file_exists($cache_file)) $mtime = 0; - else $mtime = filemtime($cache_file); - - if($mtime + $interval*60 > time()) { - $page_content = FileHandler::readFile($cache_file); - } else { - $oWidgetController = &getController('widget'); - $page_content = $oWidgetController->transWidgetCode($this->module_info->content); - FileHandler::writeFile($cache_file, $page_content); - } - } else { - if(file_exists($cache_file)) FileHandler::removeFile($cache_file); - $page_content = $this->module_info->content; - } - - Context::set('module_info', $this->module_info); - Context::set('page_content', $page_content); - - $this->setTemplateFile('content'); - } - } -?> +setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 일반 요청시 출력 + **/ + function dispPageIndex() { + // 템플릿에서 사용할 변수를 Context::set() + if($this->module_srl) Context::set('module_srl',$this->module_srl); + + // 캐시 파일 지정 + $cache_file = sprintf("%sfiles/cache/page/%d.%s.cache.php", _XE_PATH_, $this->module_info->module_srl, Context::getLangType()); + $interval = (int)($this->module_info->page_caching_interval); + if($interval>0) { + if(!file_exists($cache_file)) $mtime = 0; + else $mtime = filemtime($cache_file); + + if($mtime + $interval*60 > time()) { + $page_content = FileHandler::readFile($cache_file); + } else { + $oWidgetController = &getController('widget'); + $page_content = $oWidgetController->transWidgetCode($this->module_info->content); + FileHandler::writeFile($cache_file, $page_content); + } + } else { + if(file_exists($cache_file)) FileHandler::removeFile($cache_file); + $page_content = $this->module_info->content; + } + + Context::set('module_info', $this->module_info); + Context::set('page_content', $page_content); + + $this->setTemplateFile('content'); + } + } +?> diff --git a/modules/page/page.wap.php b/modules/page/page.wap.php index 0754cee6e..81aafa878 100644 --- a/modules/page/page.wap.php +++ b/modules/page/page.wap.php @@ -1,26 +1,26 @@ -grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); - - // 위젯의 내용을 추출함 - $oWidgetController = &getController('widget'); - $content = $oWidgetController->transWidgetCode($this->module_info->content); - $oMobile->setContent($content); - } - - } -?> +grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); + + // 위젯의 내용을 추출함 + $oWidgetController = &getController('widget'); + $content = $oWidgetController->transWidgetCode($this->module_info->content); + $oMobile->setContent($content); + } + + } +?> diff --git a/modules/page/tpl/index.html b/modules/page/tpl/index.html index 8ccbbb8d6..6108ae239 100644 --- a/modules/page/tpl/index.html +++ b/modules/page/tpl/index.html @@ -1,101 +1,101 @@ - - - - -
    - - - - - -
    - {$lang->mid} - {$lang->browser_title} - - {$lang->cmd_cancel} -
    -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    -
    - - - - -
    -
    {$lang->mid}
    {$lang->browser_title}
    {$lang->regdate}
     
    {$no} - - - {$lang->virtual_site} - - {$lang->not_exists} - - - {$module_category[$val->module_category_srl]->title} - - {htmlspecialchars($val->mid)}{$val->browser_title}{zdate($val->regdate,"Y-m-d")}{$lang->cmd_setup}{$lang->cmd_copy}{$lang->cmd_delete}
    - - - - -
    - - - + + + + +
    + + + + + +
    + {$lang->mid} + {$lang->browser_title} + + {$lang->cmd_cancel} +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    +
    + + + + +
    +
    {$lang->mid}
    {$lang->browser_title}
    {$lang->regdate}
     
    {$no} + + + {$lang->virtual_site} + + {$lang->not_exists} + + + {$module_category[$val->module_category_srl]->title} + + {htmlspecialchars($val->mid)}{$val->browser_title}{zdate($val->regdate,"Y-m-d")}{$lang->cmd_setup}{$lang->cmd_copy}{$lang->cmd_delete}
    + + + + +
    + + + diff --git a/modules/page/tpl/js/page_admin.js b/modules/page/tpl/js/page_admin.js index 61bb7ed7c..7568e9599 100644 --- a/modules/page/tpl/js/page_admin.js +++ b/modules/page/tpl/js/page_admin.js @@ -1,110 +1,110 @@ -/** - * @file modules/page/js/page_admin.js - * @author NHN (developers@xpressengine.com) - * @brief page모듈의 관리자용 javascript - **/ - -/* 모듈 생성 후 */ -function completeInsertPage(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; - - var page = ret_obj['page']; - var module_srl = ret_obj['module_srl']; - - alert(message); - - var url = ''; - if(location.href.getQuery('module')=='admin') { - url = current_url.setQuery('module_srl',module_srl).setQuery('act','dispPageAdminInfo'); - if(page) url = url.setQuery('page',page); - } else { - url = current_url; - } - - location.href = url; -} - -/* 내용 저장 후 */ -function completeInsertPageContent(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; - - var page = ret_obj['page']; - var module_srl = ret_obj['module_srl']; - var mid = ret_obj['mid']; - - location.href = current_url.setQuery('mid',mid).setQuery('act',''); -} - -function completeInsertMobilePageContent(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; - - var page = ret_obj['page']; - var module_srl = ret_obj['module_srl']; - var mid = ret_obj['mid']; - - location.href = current_url.setQuery('mid',mid).setQuery('act','dispPageAdminMobileContent'); -} - -/* 수정한 페이지 컨텐츠를 저장 */ -function doSubmitPageContent(fo_obj) { - var html = getWidgetContent(); - fo_obj.content.value = html; - return procFilter(fo_obj, insert_page_content); -} - -function doSubmitMPageContent(fo_obj) { - var html = getWidgetContent(); - fo_obj.content.value = html; - return procFilter(fo_obj, insert_mpage_content); -} - -/* 모듈 삭제 후 */ -function completeDeletePage(ret_obj) { - var error = ret_obj['error']; - var message = ret_obj['message']; - var page = ret_obj['page']; - alert(message); - - var url = current_url.setQuery('act','dispPageAdminContent').setQuery('module_srl',''); - if(page) url = url.setQuery('page',page); - - location.href = url; -} - -/* 카테고리 이동 */ -function doChangeCategory(fo_obj) { - var module_category_srl = fo_obj.module_category_srl.options[fo_obj.module_category_srl.selectedIndex].value; - if(module_category_srl==-1) { - location.href = current_url.setQuery('act','dispModuleAdminCategory'); - return false; - } - return true; -} - -/* 위젯 재컴파일 */ -function doRemoveWidgetCache(module_srl) { - var params = new Array(); - params["module_srl"] = module_srl; - exec_xml('page', 'procPageAdminRemoveWidgetCache', params, completeRemoveWidgetCache); -} - -function completeRemoveWidgetCache(ret_obj) { - var message = ret_obj['message']; - location.reload(); -} - -/* 일괄 설정 */ -function doCartSetup(url) { - var module_srl = new Array(); - jQuery('#fo_list input[name=cart]:checked').each(function() { - module_srl[module_srl.length] = jQuery(this).val(); - }); - - if(module_srl.length<1) return; - - url += "&module_srls="+module_srl.join(','); - popopen(url,'modulesSetup'); -} +/** + * @file modules/page/js/page_admin.js + * @author NHN (developers@xpressengine.com) + * @brief page모듈의 관리자용 javascript + **/ + +/* 모듈 생성 후 */ +function completeInsertPage(ret_obj) { + var error = ret_obj['error']; + var message = ret_obj['message']; + + var page = ret_obj['page']; + var module_srl = ret_obj['module_srl']; + + alert(message); + + var url = ''; + if(location.href.getQuery('module')=='admin') { + url = current_url.setQuery('module_srl',module_srl).setQuery('act','dispPageAdminInfo'); + if(page) url = url.setQuery('page',page); + } else { + url = current_url; + } + + location.href = url; +} + +/* 내용 저장 후 */ +function completeInsertPageContent(ret_obj) { + var error = ret_obj['error']; + var message = ret_obj['message']; + + var page = ret_obj['page']; + var module_srl = ret_obj['module_srl']; + var mid = ret_obj['mid']; + + location.href = current_url.setQuery('mid',mid).setQuery('act',''); +} + +function completeInsertMobilePageContent(ret_obj) { + var error = ret_obj['error']; + var message = ret_obj['message']; + + var page = ret_obj['page']; + var module_srl = ret_obj['module_srl']; + var mid = ret_obj['mid']; + + location.href = current_url.setQuery('mid',mid).setQuery('act','dispPageAdminMobileContent'); +} + +/* 수정한 페이지 컨텐츠를 저장 */ +function doSubmitPageContent(fo_obj) { + var html = getWidgetContent(); + fo_obj.content.value = html; + return procFilter(fo_obj, insert_page_content); +} + +function doSubmitMPageContent(fo_obj) { + var html = getWidgetContent(); + fo_obj.content.value = html; + return procFilter(fo_obj, insert_mpage_content); +} + +/* 모듈 삭제 후 */ +function completeDeletePage(ret_obj) { + var error = ret_obj['error']; + var message = ret_obj['message']; + var page = ret_obj['page']; + alert(message); + + var url = current_url.setQuery('act','dispPageAdminContent').setQuery('module_srl',''); + if(page) url = url.setQuery('page',page); + + location.href = url; +} + +/* 카테고리 이동 */ +function doChangeCategory(fo_obj) { + var module_category_srl = fo_obj.module_category_srl.options[fo_obj.module_category_srl.selectedIndex].value; + if(module_category_srl==-1) { + location.href = current_url.setQuery('act','dispModuleAdminCategory'); + return false; + } + return true; +} + +/* 위젯 재컴파일 */ +function doRemoveWidgetCache(module_srl) { + var params = new Array(); + params["module_srl"] = module_srl; + exec_xml('page', 'procPageAdminRemoveWidgetCache', params, completeRemoveWidgetCache); +} + +function completeRemoveWidgetCache(ret_obj) { + var message = ret_obj['message']; + location.reload(); +} + +/* 일괄 설정 */ +function doCartSetup(url) { + var module_srl = new Array(); + jQuery('#fo_list input[name=cart]:checked').each(function() { + module_srl[module_srl.length] = jQuery(this).val(); + }); + + if(module_srl.length<1) return; + + url += "&module_srls="+module_srl.join(','); + popopen(url,'modulesSetup'); +} diff --git a/modules/point/conf/info.xml b/modules/point/conf/info.xml index 8d8cabad2..acffe7446 100644 --- a/modules/point/conf/info.xml +++ b/modules/point/conf/info.xml @@ -1,72 +1,72 @@ - - - 포인트 시스템 - 积分系统 - ポイントシステム - Point System - Hệ thống điểm - Sistema de Punto - Система поитов - 點數系統 - Puanlama Sistemi - - 글작성/삭제/댓글작성/삭제시에 포인트를 부여할 수 있습니다. - 포인트마다 레벨을 지정하여 사용자 이름 앞에 아이콘을 표시할 수도 있습니다. - 단 포인트 관련 애드온을 활성화 시키셔야 됩니다. - - - 可以在发表/删除新帖,发表/删除评论时,付与相应积分。 - 也可以以积分设置级别,并在用户名前显示级别图标。 - 必须是先激活积分系统才可以使用。 - - - 書き込み作成・削除/コメント作成・削除の活動に対するポイントを計算するシステムです。 - ポイントごとレベルを指定してユーザ名の前にアイコンを表示させることが出来ます。 - 但し、ポイントシステムアドオンを「使用」に設定しないと作動しません。 - - - You can grant point on writing/deleting/adding comments/deleting comments. - You can also display point icon in front of user name by selecting level on each point. - But to enable these functions, you need to activate point related addons. - - - Yazmaya/silmeye, yorum eklemeye/yorum silmeye puan atayabilirsiniz. - Her puanın seviyesini seçerek, kullanıcı isimlerinin başında puan simgesi gösterebilirsiniz. - Bu özellikleri mümkün kılmak için, puanlamayla alakalı eklentileri etkinleştirmeniz gerekmektedir. - - - Bạn có thể cho hay trừ điểm của các thành viên khi Gửi bài, Xóa bài, Thêm bình luận, Xóa bình luận. - bạn cũng có thể cho phép hiển thị Icon của cấp độ điểm trước tên sử dụng bằng việc lụa chọn Icon cấp độ điểm. - Để kích hoạt chức năng này, bạn phải kích hoạt Addon Hệ thống điểm. - - - Usted puede entregar puntos a las acciones de escribir/eliminar/agregar comentarios/eliminar comentarios. - Usted también puede mostrar el ícono de punto delande del nombre del usuario seleccionando el nivel sobre cada puntos. - Pero para activar esas funciones, Usted necesita activar addon relacionado a los puntos. - - - Вы можете назначать поинты за написание/удаление/добавление комментариев/удаление комментариев. - Вы также можете отображать икнку поинтов напротив имени пользователя, установив уровени для поинтов. - Но чтобы включить эти функции, Вам надо активировать аддоны, относящиеся к поинтам. - - - 可在發表/刪除評論時,付出相對應的點數。 - 也能以點數設置等級,並在用戶名稱前顯示等級圖示。 - 但是必須先啟用點數系統才能使用。 - - 0.1 - 2007-07-26 - member - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 포인트 시스템 + 积分系统 + ポイントシステム + Point System + Hệ thống điểm + Sistema de Punto + Система поитов + 點數系統 + Puanlama Sistemi + + 글작성/삭제/댓글작성/삭제시에 포인트를 부여할 수 있습니다. + 포인트마다 레벨을 지정하여 사용자 이름 앞에 아이콘을 표시할 수도 있습니다. + 단 포인트 관련 애드온을 활성화 시키셔야 됩니다. + + + 可以在发表/删除新帖,发表/删除评论时,付与相应积分。 + 也可以以积分设置级别,并在用户名前显示级别图标。 + 必须是先激活积分系统才可以使用。 + + + 書き込み作成・削除/コメント作成・削除の活動に対するポイントを計算するシステムです。 + ポイントごとレベルを指定してユーザ名の前にアイコンを表示させることが出来ます。 + 但し、ポイントシステムアドオンを「使用」に設定しないと作動しません。 + + + You can grant point on writing/deleting/adding comments/deleting comments. + You can also display point icon in front of user name by selecting level on each point. + But to enable these functions, you need to activate point related addons. + + + Yazmaya/silmeye, yorum eklemeye/yorum silmeye puan atayabilirsiniz. + Her puanın seviyesini seçerek, kullanıcı isimlerinin başında puan simgesi gösterebilirsiniz. + Bu özellikleri mümkün kılmak için, puanlamayla alakalı eklentileri etkinleştirmeniz gerekmektedir. + + + Bạn có thể cho hay trừ điểm của các thành viên khi Gửi bài, Xóa bài, Thêm bình luận, Xóa bình luận. + bạn cũng có thể cho phép hiển thị Icon của cấp độ điểm trước tên sử dụng bằng việc lụa chọn Icon cấp độ điểm. + Để kích hoạt chức năng này, bạn phải kích hoạt Addon Hệ thống điểm. + + + Usted puede entregar puntos a las acciones de escribir/eliminar/agregar comentarios/eliminar comentarios. + Usted también puede mostrar el ícono de punto delande del nombre del usuario seleccionando el nivel sobre cada puntos. + Pero para activar esas funciones, Usted necesita activar addon relacionado a los puntos. + + + Вы можете назначать поинты за написание/удаление/добавление комментариев/удаление комментариев. + Вы также можете отображать икнку поинтов напротив имени пользователя, установив уровени для поинтов. + Но чтобы включить эти функции, Вам надо активировать аддоны, относящиеся к поинтам. + + + 可在發表/刪除評論時,付出相對應的點數。 + 也能以點數設置等級,並在用戶名稱前顯示等級圖示。 + 但是必須先啟用點數系統才能使用。 + + 0.1 + 2007-07-26 + member + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/point/lang/en.lang.php b/modules/point/lang/en.lang.php index 77c4a731a..5d36ef457 100644 --- a/modules/point/lang/en.lang.php +++ b/modules/point/lang/en.lang.php @@ -1,69 +1,69 @@ -point = "Point"; - $lang->level = "Level"; - - $lang->about_point_module = "You can grant points on writing/adding comments/uploading/downloading."; - $lang->about_act_config = "Each module like board/blog has its own actions such as \"writing/deleting/adding comments/deleting comments\".
    You can just add act values to link modules with point system except board/blog.
    Comma(,) will distinguish multiple values."; - - $lang->max_level = 'Max Level'; - $lang->about_max_level = 'You may set the max level. Level icons should be considered and the level of 1000 is the maximum value you can set'; - - $lang->level_icon = 'Level Icon'; - $lang->about_level_icon = 'Path of level icon is "./module/point/icons/[level].gif" and max level could be different with icon set. So please be careful'; - - $lang->point_name = 'Point Name'; - $lang->about_point_name = 'You may give a name or unit for point'; - - $lang->level_point = 'Level Point'; - $lang->about_level_point = 'Level will be adjusted when point gets to each level point or drops under each level point'; - - $lang->disable_download = 'Prohibit Downloads'; - $lang->about_disable_download = "This will prohibit downloads when there are not enough points. (Exclude image files)"; - $lang->disable_read_document = 'Prohibit Readings'; - $lang->about_disable_read_document = 'Users will be unable to read articles when they do not have enough points'; - - $lang->level_point_calc = 'Point Calculation per Point'; - $lang->expression = 'Please input Javascript formula by using level variable i. ex) Math.pow(i, 2) * 90'; - $lang->cmd_exp_calc = 'Calculate'; - $lang->cmd_exp_reset = 'Reset'; - - $lang->cmd_point_recal = 'Reset Point'; - $lang->about_cmd_point_recal = 'All point will be initialized only with articles/comments/attachments/join points.
    Only members who do website activities will get signup points after reset.
    Please use this function when complete initialization is required in case of data transferring or other situations.'; - - $lang->point_link_group = 'Group Change by Level'; - $lang->point_group_reset_and_add = 'Reset adjusted groups and add new groups'; - $lang->point_group_add_only = 'Only to new groups'; - $lang->about_point_link_group = 'If you specify level for a specific group, users are assigned into the group when they adavnce to the level by getting points.'; - - $lang->about_module_point = "You can set point for each module and modules which don't have any value will use default point.
    All point will be restored on acting reverse."; - - $lang->point_signup = 'Signup'; - $lang->point_insert_document = 'On Writing'; - $lang->point_delete_document = 'On Deleting'; - $lang->point_insert_comment = 'On Adding Comments'; - $lang->point_delete_comment = 'On Deleting Comments'; - $lang->point_upload_file = 'On Uploading'; - $lang->point_delete_file = 'On Deleting Files'; - $lang->point_download_file = 'On Downloading Files (Exclude images)'; - $lang->point_read_document = 'On Reading'; - $lang->point_voted = 'On Recommended'; - $lang->point_blamed = 'On Accused'; - - - $lang->cmd_point_config = 'Default Setting'; - $lang->cmd_point_module_config = 'Module Setting'; - $lang->cmd_point_act_config = 'Act Setting'; - $lang->cmd_point_member_list = 'Member Point List'; - - $lang->msg_cannot_download = "You don't have enough point to download"; - $lang->msg_disallow_by_point = "You need more points to read the article (You need %d, but you have %d)"; - - $lang->point_recal_message = 'Adjusting Point. (%d / %d)'; - $lang->point_recal_finished = 'Point recalculation is finished.'; -?> +point = "Point"; + $lang->level = "Level"; + + $lang->about_point_module = "You can grant points on writing/adding comments/uploading/downloading."; + $lang->about_act_config = "Each module like board/blog has its own actions such as \"writing/deleting/adding comments/deleting comments\".
    You can just add act values to link modules with point system except board/blog.
    Comma(,) will distinguish multiple values."; + + $lang->max_level = 'Max Level'; + $lang->about_max_level = 'You may set the max level. Level icons should be considered and the level of 1000 is the maximum value you can set'; + + $lang->level_icon = 'Level Icon'; + $lang->about_level_icon = 'Path of level icon is "./module/point/icons/[level].gif" and max level could be different with icon set. So please be careful'; + + $lang->point_name = 'Point Name'; + $lang->about_point_name = 'You may give a name or unit for point'; + + $lang->level_point = 'Level Point'; + $lang->about_level_point = 'Level will be adjusted when point gets to each level point or drops under each level point'; + + $lang->disable_download = 'Prohibit Downloads'; + $lang->about_disable_download = "This will prohibit downloads when there are not enough points. (Exclude image files)"; + $lang->disable_read_document = 'Prohibit Readings'; + $lang->about_disable_read_document = 'Users will be unable to read articles when they do not have enough points'; + + $lang->level_point_calc = 'Point Calculation per Point'; + $lang->expression = 'Please input Javascript formula by using level variable i. ex) Math.pow(i, 2) * 90'; + $lang->cmd_exp_calc = 'Calculate'; + $lang->cmd_exp_reset = 'Reset'; + + $lang->cmd_point_recal = 'Reset Point'; + $lang->about_cmd_point_recal = 'All point will be initialized only with articles/comments/attachments/join points.
    Only members who do website activities will get signup points after reset.
    Please use this function when complete initialization is required in case of data transferring or other situations.'; + + $lang->point_link_group = 'Group Change by Level'; + $lang->point_group_reset_and_add = 'Reset adjusted groups and add new groups'; + $lang->point_group_add_only = 'Only to new groups'; + $lang->about_point_link_group = 'If you specify level for a specific group, users are assigned into the group when they adavnce to the level by getting points.'; + + $lang->about_module_point = "You can set point for each module and modules which don't have any value will use default point.
    All point will be restored on acting reverse."; + + $lang->point_signup = 'Signup'; + $lang->point_insert_document = 'On Writing'; + $lang->point_delete_document = 'On Deleting'; + $lang->point_insert_comment = 'On Adding Comments'; + $lang->point_delete_comment = 'On Deleting Comments'; + $lang->point_upload_file = 'On Uploading'; + $lang->point_delete_file = 'On Deleting Files'; + $lang->point_download_file = 'On Downloading Files (Exclude images)'; + $lang->point_read_document = 'On Reading'; + $lang->point_voted = 'On Recommended'; + $lang->point_blamed = 'On Accused'; + + + $lang->cmd_point_config = 'Default Setting'; + $lang->cmd_point_module_config = 'Module Setting'; + $lang->cmd_point_act_config = 'Act Setting'; + $lang->cmd_point_member_list = 'Member Point List'; + + $lang->msg_cannot_download = "You don't have enough point to download"; + $lang->msg_disallow_by_point = "You need more points to read the article (You need %d, but you have %d)"; + + $lang->point_recal_message = 'Adjusting Point. (%d / %d)'; + $lang->point_recal_finished = 'Point recalculation is finished.'; +?> diff --git a/modules/point/lang/es.lang.php b/modules/point/lang/es.lang.php index 6af8099c6..58e60391c 100644 --- a/modules/point/lang/es.lang.php +++ b/modules/point/lang/es.lang.php @@ -1,69 +1,69 @@ -point = "Punto"; - $lang->level = "Nivel"; - - $lang->about_point_module = "Usted puede entregar puntos a las acciones de escribir/agregar comentarios/subir/descargar."; - $lang->about_act_config = "Cada módulo ya sea el tablero o blog tiene sus propias actiones como escribir/eliminar/agregar comentarios/eliminar comentarios/etc.
    Usted puede añadir valores de actos para enlazar con sistema de módulo de puntos excepto el tablero y blog.
    El enlace debe hacerse con una coma(,)."; - - $lang->max_level = 'Nivel Máximo'; - $lang->about_max_level = 'Usted puede definir el nivel máximo. Los íconos del nivel deberan ser considerados y el nivel máximo de puntos límite es 1000'; - - $lang->level_icon = 'Iconos del nivel'; - $lang->about_level_icon = 'Ruta de íconos del nivel es ./module/point/icons/[level].gif y el nivel máximo puede ser diferente con el conjunto de íconos. Tenga cuidado'; - - $lang->point_name = 'Nombre del punto'; - $lang->about_point_name = 'Usted puede otorgar nombre o unidad de punto'; - - $lang->level_point = 'Nivel del punto'; - $lang->about_level_point = 'El nivel sera ajustado cuando los puntos alcancen a cada nivel de puntos o cuando disminuyen a cada nivel de puntos'; - - $lang->disable_download = 'Prohibida la descarga'; - $lang->about_disable_download = "Se prohibe la descarga de archivos al tener los puntos insuficientes.. (Excepto los archivos de imagen)"; - $lang->disable_read_document = '글 열람 금지'; - $lang->about_disable_read_document = '포인트가 없을 경우 글 열람을 금지하게 됩니다'; - - $lang->level_point_calc = 'Punto por punto cálculo'; - $lang->expression = 'Por favor, de entrada mediante el uso de Javascript fórmula nivel variable i . Ex) Math.pow (i, 2) * 90'; - $lang->cmd_exp_calc = 'Calcular'; - $lang->cmd_exp_reset = 'Restablecer'; - - $lang->cmd_point_recal = '포인트 초기화'; - $lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화 합니다.
    회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다.
    데이터 이전등을 하여 포인트를 완전히 초기화 해야 할 경우에만 사용하세요.'; - - $lang->point_link_group = 'Grupo de cambio de nivel'; - $lang->point_group_reset_and_add = '설정된 그룹 초기화 후 새 그룹 부여'; - $lang->point_group_add_only = '새 그룹만 부여'; - $lang->about_point_link_group = 'Si especifica nivel para un grupo específico, a los usuarios se les asigna en el grupo cuando se adavnce al nivel por conseguir puntos.'; - - $lang->about_module_point = "Usted puede definir los puntos para cada módulo y los módulos que no tengan ningun valor usarán punto predefinido.
    Todos los puntos serán restituidos al actuar en forma contraria."; - - $lang->point_signup = 'Fecha del'; - $lang->point_insert_document = 'Al escribir documento'; - $lang->point_delete_document = 'Al borrar documento'; - $lang->point_insert_comment = 'Al agregar comentarios'; - $lang->point_delete_comment = 'Al eliminar comentarios'; - $lang->point_upload_file = 'Al subri archivos'; - $lang->point_delete_file = 'Al borrar archivos'; - $lang->point_download_file = 'Al descargar archivos (Excepto imágenes)'; - $lang->point_read_document = 'El Reading'; - $lang->point_voted = '추천 받음'; - $lang->point_blamed = '비추천 받음'; - - - $lang->cmd_point_config = 'Configuración predefinida'; - $lang->cmd_point_module_config = 'Configuración del módulo'; - $lang->cmd_point_act_config = 'Configuración de actos'; - $lang->cmd_point_member_list = 'Lista de puntos del usuario'; - - $lang->msg_cannot_download = "No tiene puntos suficientes para descagar"; - $lang->msg_disallow_by_point = "포인트가 부족하여 글을 읽을 수 없습니다 (필요포인트 : %d, 현재포인트 : %d)"; - - $lang->point_recal_message = 'Ajuste de Punto. (%d / %d)'; - $lang->point_recal_finished = 'Punto cálculo está acabado.'; -?> +point = "Punto"; + $lang->level = "Nivel"; + + $lang->about_point_module = "Usted puede entregar puntos a las acciones de escribir/agregar comentarios/subir/descargar."; + $lang->about_act_config = "Cada módulo ya sea el tablero o blog tiene sus propias actiones como escribir/eliminar/agregar comentarios/eliminar comentarios/etc.
    Usted puede añadir valores de actos para enlazar con sistema de módulo de puntos excepto el tablero y blog.
    El enlace debe hacerse con una coma(,)."; + + $lang->max_level = 'Nivel Máximo'; + $lang->about_max_level = 'Usted puede definir el nivel máximo. Los íconos del nivel deberan ser considerados y el nivel máximo de puntos límite es 1000'; + + $lang->level_icon = 'Iconos del nivel'; + $lang->about_level_icon = 'Ruta de íconos del nivel es ./module/point/icons/[level].gif y el nivel máximo puede ser diferente con el conjunto de íconos. Tenga cuidado'; + + $lang->point_name = 'Nombre del punto'; + $lang->about_point_name = 'Usted puede otorgar nombre o unidad de punto'; + + $lang->level_point = 'Nivel del punto'; + $lang->about_level_point = 'El nivel sera ajustado cuando los puntos alcancen a cada nivel de puntos o cuando disminuyen a cada nivel de puntos'; + + $lang->disable_download = 'Prohibida la descarga'; + $lang->about_disable_download = "Se prohibe la descarga de archivos al tener los puntos insuficientes.. (Excepto los archivos de imagen)"; + $lang->disable_read_document = '글 열람 금지'; + $lang->about_disable_read_document = '포인트가 없을 경우 글 열람을 금지하게 됩니다'; + + $lang->level_point_calc = 'Punto por punto cálculo'; + $lang->expression = 'Por favor, de entrada mediante el uso de Javascript fórmula nivel variable i . Ex) Math.pow (i, 2) * 90'; + $lang->cmd_exp_calc = 'Calcular'; + $lang->cmd_exp_reset = 'Restablecer'; + + $lang->cmd_point_recal = '포인트 초기화'; + $lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화 합니다.
    회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다.
    데이터 이전등을 하여 포인트를 완전히 초기화 해야 할 경우에만 사용하세요.'; + + $lang->point_link_group = 'Grupo de cambio de nivel'; + $lang->point_group_reset_and_add = '설정된 그룹 초기화 후 새 그룹 부여'; + $lang->point_group_add_only = '새 그룹만 부여'; + $lang->about_point_link_group = 'Si especifica nivel para un grupo específico, a los usuarios se les asigna en el grupo cuando se adavnce al nivel por conseguir puntos.'; + + $lang->about_module_point = "Usted puede definir los puntos para cada módulo y los módulos que no tengan ningun valor usarán punto predefinido.
    Todos los puntos serán restituidos al actuar en forma contraria."; + + $lang->point_signup = 'Fecha del'; + $lang->point_insert_document = 'Al escribir documento'; + $lang->point_delete_document = 'Al borrar documento'; + $lang->point_insert_comment = 'Al agregar comentarios'; + $lang->point_delete_comment = 'Al eliminar comentarios'; + $lang->point_upload_file = 'Al subri archivos'; + $lang->point_delete_file = 'Al borrar archivos'; + $lang->point_download_file = 'Al descargar archivos (Excepto imágenes)'; + $lang->point_read_document = 'El Reading'; + $lang->point_voted = '추천 받음'; + $lang->point_blamed = '비추천 받음'; + + + $lang->cmd_point_config = 'Configuración predefinida'; + $lang->cmd_point_module_config = 'Configuración del módulo'; + $lang->cmd_point_act_config = 'Configuración de actos'; + $lang->cmd_point_member_list = 'Lista de puntos del usuario'; + + $lang->msg_cannot_download = "No tiene puntos suficientes para descagar"; + $lang->msg_disallow_by_point = "포인트가 부족하여 글을 읽을 수 없습니다 (필요포인트 : %d, 현재포인트 : %d)"; + + $lang->point_recal_message = 'Ajuste de Punto. (%d / %d)'; + $lang->point_recal_finished = 'Punto cálculo está acabado.'; +?> diff --git a/modules/point/lang/fr.lang.php b/modules/point/lang/fr.lang.php index 2da5826d2..8ce1c2e25 100644 --- a/modules/point/lang/fr.lang.php +++ b/modules/point/lang/fr.lang.php @@ -1,69 +1,69 @@ - - * @brief Paquet du langage en français pour le module de Point - **/ - - $lang->point = "Point"; - $lang->level = "Niveau"; - - $lang->about_point_module = "Vous pouvez donnez des poins sur l'action d'écrire/d'ajouter commentaire/de télécharger vers le serveur/de télécharger vers le PC etc."; - $lang->about_act_config = "Chaque module comme celui de panneau ou de blogue a les actions propres comme \"écrire/supprimer/ajouter un commentaire/supprimer un commentaire\".
    Vous pouvez ajouter seulement les valeurs des actions pour appliquer le Système de Point au module excepté celui de panneau ou de blogue.
    Vous pouvez délimiter chaque valeur avec virgule(,)."; - - $lang->max_level = 'Niveau le plus haut'; - $lang->about_max_level = 'Vous pouvez configurer le niveau le plus haut. Les icônes des niveaux doit être réflechissés et le niveau de 1 000 est la valeur maximum que vous pouvez configurer.'; - - $lang->level_icon = 'Icône de Niveau'; - $lang->about_level_icon = 'Le Chemin d\'icône est "./module/point/icons/[niveau].gif" et le niveau le plus haut peut différer de l\'ensemble des icônes. Alors faites attention, S.V.P.'; - - $lang->point_name = 'Nom de Point'; - $lang->about_point_name = 'Vous pouvez nommer le point ou configurer l\'unité du point'; - - $lang->level_point = 'Point de niveau'; - $lang->about_level_point = 'Le Niveau sera ajusté quand le point devient les valeurs aux Points de Niveaux ci-dessous.'; - - $lang->disable_download = 'Interdire de télécharger'; - $lang->about_disable_download = "Il est impossible de télécharger quand il n'y a pas de points suffisants. (Sauf les fichier d'images)"; - $lang->disable_read_document = '글 열람 금지'; - $lang->about_disable_read_document = '포인트가 없을 경우 글 열람을 금지하게 됩니다'; - - $lang->level_point_calc = 'Calcul des Points par Niveau'; - $lang->expression = 'Entrez la formule en Javascript en utilisant la Variable de Niveau i. ex) Math.pow(i, 2) * 90'; - $lang->cmd_exp_calc = 'Calculer'; - $lang->cmd_exp_reset = 'Restaurer'; - - $lang->cmd_point_recal = 'Restaurer le Point'; - $lang->about_cmd_point_recal = 'Tous les points seront recalculés basé seulement sur les points des articles/commentaires/annexes/inscription.
    Après la restauration, Les membres gagneront le point d\'inscription seulement quand il fait de l\'activité dans le site Web.
    Utilisez cette fonction seulement quand l\'initialisation complète est necessaire comme le cas de transfert des données etc.'; - - $lang->point_link_group = 'Changement du Groupe lié à celui du Niveau'; - $lang->point_group_reset_and_add = '설정된 그룹 초기화 후 새 그룹 부여'; - $lang->point_group_add_only = '새 그룹만 부여'; - $lang->about_point_link_group = 'Si vous designez un niveau à un groupe particulier, les utilisateur s sont assignés dans le groupe quand ils s\'avancent au groupe en gagnant des points.'; - - $lang->about_module_point = "Vous pouvez configurer les points pour chaque module. Le module qui n'a pas de valeurs utilisera les points par défaut.
    Tous les points seront restaurés quand on fait de l'action inverse."; - - $lang->point_signup = 'Inscription'; - $lang->point_insert_document = 'Écrire'; - $lang->point_delete_document = 'Supprimer'; - $lang->point_insert_comment = 'Ajouter un Commentaire'; - $lang->point_delete_comment = 'Supprimer un Commentaire'; - $lang->point_upload_file = 'Télécharger les Fichiers sur Serveur'; - $lang->point_delete_file = 'Supprimer un Fichier'; - $lang->point_download_file = 'Télécharger les Fichiers sur PC(Sauf des images)'; - $lang->point_read_document = 'lire'; - $lang->point_voted = 'Être Recommandé'; - $lang->point_blamed = 'Être Blâmé'; - - - $lang->cmd_point_config = 'Configuration primaire'; - $lang->cmd_point_module_config = 'Configuration du Module'; - $lang->cmd_point_act_config = 'Configuration des Actions de chaque fonction'; - $lang->cmd_point_member_list = 'Liste des Points des Membres'; - - $lang->msg_cannot_download = "Vous n'avez pas assez de point pour télécharger"; - $lang->msg_disallow_by_point = "포인트가 부족하여 글을 읽을 수 없습니다 (필요포인트 : %d, 현재포인트 : %d)"; - - $lang->point_recal_message = 'En train d\'Adjuster le Point. (%d / %d)'; - $lang->point_recal_finished = 'Recalcul des Points est fini.'; -?> + + * @brief Paquet du langage en français pour le module de Point + **/ + + $lang->point = "Point"; + $lang->level = "Niveau"; + + $lang->about_point_module = "Vous pouvez donnez des poins sur l'action d'écrire/d'ajouter commentaire/de télécharger vers le serveur/de télécharger vers le PC etc."; + $lang->about_act_config = "Chaque module comme celui de panneau ou de blogue a les actions propres comme \"écrire/supprimer/ajouter un commentaire/supprimer un commentaire\".
    Vous pouvez ajouter seulement les valeurs des actions pour appliquer le Système de Point au module excepté celui de panneau ou de blogue.
    Vous pouvez délimiter chaque valeur avec virgule(,)."; + + $lang->max_level = 'Niveau le plus haut'; + $lang->about_max_level = 'Vous pouvez configurer le niveau le plus haut. Les icônes des niveaux doit être réflechissés et le niveau de 1 000 est la valeur maximum que vous pouvez configurer.'; + + $lang->level_icon = 'Icône de Niveau'; + $lang->about_level_icon = 'Le Chemin d\'icône est "./module/point/icons/[niveau].gif" et le niveau le plus haut peut différer de l\'ensemble des icônes. Alors faites attention, S.V.P.'; + + $lang->point_name = 'Nom de Point'; + $lang->about_point_name = 'Vous pouvez nommer le point ou configurer l\'unité du point'; + + $lang->level_point = 'Point de niveau'; + $lang->about_level_point = 'Le Niveau sera ajusté quand le point devient les valeurs aux Points de Niveaux ci-dessous.'; + + $lang->disable_download = 'Interdire de télécharger'; + $lang->about_disable_download = "Il est impossible de télécharger quand il n'y a pas de points suffisants. (Sauf les fichier d'images)"; + $lang->disable_read_document = '글 열람 금지'; + $lang->about_disable_read_document = '포인트가 없을 경우 글 열람을 금지하게 됩니다'; + + $lang->level_point_calc = 'Calcul des Points par Niveau'; + $lang->expression = 'Entrez la formule en Javascript en utilisant la Variable de Niveau i. ex) Math.pow(i, 2) * 90'; + $lang->cmd_exp_calc = 'Calculer'; + $lang->cmd_exp_reset = 'Restaurer'; + + $lang->cmd_point_recal = 'Restaurer le Point'; + $lang->about_cmd_point_recal = 'Tous les points seront recalculés basé seulement sur les points des articles/commentaires/annexes/inscription.
    Après la restauration, Les membres gagneront le point d\'inscription seulement quand il fait de l\'activité dans le site Web.
    Utilisez cette fonction seulement quand l\'initialisation complète est necessaire comme le cas de transfert des données etc.'; + + $lang->point_link_group = 'Changement du Groupe lié à celui du Niveau'; + $lang->point_group_reset_and_add = '설정된 그룹 초기화 후 새 그룹 부여'; + $lang->point_group_add_only = '새 그룹만 부여'; + $lang->about_point_link_group = 'Si vous designez un niveau à un groupe particulier, les utilisateur s sont assignés dans le groupe quand ils s\'avancent au groupe en gagnant des points.'; + + $lang->about_module_point = "Vous pouvez configurer les points pour chaque module. Le module qui n'a pas de valeurs utilisera les points par défaut.
    Tous les points seront restaurés quand on fait de l'action inverse."; + + $lang->point_signup = 'Inscription'; + $lang->point_insert_document = 'Écrire'; + $lang->point_delete_document = 'Supprimer'; + $lang->point_insert_comment = 'Ajouter un Commentaire'; + $lang->point_delete_comment = 'Supprimer un Commentaire'; + $lang->point_upload_file = 'Télécharger les Fichiers sur Serveur'; + $lang->point_delete_file = 'Supprimer un Fichier'; + $lang->point_download_file = 'Télécharger les Fichiers sur PC(Sauf des images)'; + $lang->point_read_document = 'lire'; + $lang->point_voted = 'Être Recommandé'; + $lang->point_blamed = 'Être Blâmé'; + + + $lang->cmd_point_config = 'Configuration primaire'; + $lang->cmd_point_module_config = 'Configuration du Module'; + $lang->cmd_point_act_config = 'Configuration des Actions de chaque fonction'; + $lang->cmd_point_member_list = 'Liste des Points des Membres'; + + $lang->msg_cannot_download = "Vous n'avez pas assez de point pour télécharger"; + $lang->msg_disallow_by_point = "포인트가 부족하여 글을 읽을 수 없습니다 (필요포인트 : %d, 현재포인트 : %d)"; + + $lang->point_recal_message = 'En train d\'Adjuster le Point. (%d / %d)'; + $lang->point_recal_finished = 'Recalcul des Points est fini.'; +?> diff --git a/modules/point/lang/jp.lang.php b/modules/point/lang/jp.lang.php index 146418eff..bd8aaa6e4 100644 --- a/modules/point/lang/jp.lang.php +++ b/modules/point/lang/jp.lang.php @@ -1,68 +1,68 @@ -point = 'ポイント'; - $lang->level = 'レベル'; - - $lang->about_point_module = 'ポイントモジュールでは、書き込み作成/コメント作成/アップロード/ダウンロードなどのユーザの活動に対してポイントの計算を行います。'; - $lang->about_act_config = '掲示板、ブログなどのモジュールごとに「書き込み作成・削除/コメント作成・削除」などのアクションがあります。掲示板/ブログ以外のモジュールにポイントシステムを連動させたい場合は、各機能のアクションの「act値」を追加します。連動は半角「,(コンマ)」で区切って追加します。'; - - $lang->max_level = '最高レベル'; - $lang->about_max_level = '最高レベルを指定することが出来ます。最高レベルは「1000」がマクシマムなので、レベルアイコンに注意が必要です。'; - - $lang->level_icon = 'レベルアイコン'; - $lang->about_level_icon = 'レベルアイコンは、「./modules/point/icons/レベル.gif」で指定されるため、最高レベルとアイコンセットが異なる場合があります。ご注意下さい。'; - - $lang->point_name = 'ポイント名'; - $lang->about_point_name = 'ポイントの名前、単位が指定出来ます。'; - - $lang->level_point = 'レベルポイント'; - $lang->about_level_point = '下の各レベルのポイントが増加したり、減少するとレベルが調整されます。'; - - $lang->disable_download = 'ダウンロード禁止'; - $lang->about_disable_download = 'チェックするとポイントがない場合、ダウンロードを禁止します(イメージファイル除外)。'; - $lang->disable_read_document = '閲覧禁止'; - $lang->about_disable_read_document = 'ポイントがない場合、閲覧を禁止します。'; - - $lang->level_point_calc = 'レベル別ポイント計算'; - $lang->expression = 'レベル変数iを使用してJavaスクリプト数式を入力して下さい(例: Math.pow(i, 2) * 90)。'; - $lang->cmd_exp_calc = '計算'; - $lang->cmd_exp_reset = '初期化'; - - $lang->cmd_point_recal = 'ポイントの初期化'; - $lang->about_cmd_point_recal = '書き込み/コメント/添付ファイル/会員登録のポイントのみ取り、全ての他のポイントを初期化します。
    但し、会員登録ポイントは初期化後、該当会員の活動がスタートしたら付与されます。
    データ移管などによるポイントを完全に初期化する必要がある場合など、利用は慎重に行なって下さい。'; - - $lang->point_link_group = 'グループ連動'; - $lang->point_group_reset_and_add = '設定されたグループの初期化後、新規グループに付与'; - $lang->point_group_add_only = '新規グループのみ付与'; - $lang->about_point_link_group = 'グループにレベルを指定すると、該当レベルになったらグループが変更されます。'; - - $lang->about_module_point = 'モジュール別にポイントを指定することが出来ますが、指定されていないモジュールでは、デフォルトポイントが使用されます。すべてのポイント数は、反対のアクションを行った際には原状復帰されます。'; - - $lang->point_signup = '加入'; - $lang->point_insert_document = '書き込み作成'; - $lang->point_delete_document = '書き込み削除'; - $lang->point_insert_comment = 'コメント作成'; - $lang->point_delete_comment = 'コメント削除'; - $lang->point_upload_file = 'アップロード'; - $lang->point_delete_file = 'ファイル削除'; - $lang->point_download_file = 'ダウンロード'; - $lang->point_read_document = '書き込み閲覧'; - $lang->point_voted = '推薦'; - $lang->point_blamed = '非推薦'; - - $lang->cmd_point_config = 'デフォルト設定'; - $lang->cmd_point_module_config = 'モジュール別設定'; - $lang->cmd_point_act_config = '機能別アクション設定'; - $lang->cmd_point_member_list = '会員ポイントリスト'; - - $lang->msg_cannot_download = 'ポイントが不足しているため、ダウンロード出来ません。'; - $lang->msg_disallow_by_point = "ポイントが不足しているため、閲覧が出来ません。(必要ポイント : %d、 保有ポイント : %d)"; - - $lang->point_recal_message = 'ただ今ポイントを適用しています。 (%d / %d)'; - $lang->point_recal_finished = 'ポイント再計算が完了しました。'; -?> +point = 'ポイント'; + $lang->level = 'レベル'; + + $lang->about_point_module = 'ポイントモジュールでは、書き込み作成/コメント作成/アップロード/ダウンロードなどのユーザの活動に対してポイントの計算を行います。'; + $lang->about_act_config = '掲示板、ブログなどのモジュールごとに「書き込み作成・削除/コメント作成・削除」などのアクションがあります。掲示板/ブログ以外のモジュールにポイントシステムを連動させたい場合は、各機能のアクションの「act値」を追加します。連動は半角「,(コンマ)」で区切って追加します。'; + + $lang->max_level = '最高レベル'; + $lang->about_max_level = '最高レベルを指定することが出来ます。最高レベルは「1000」がマクシマムなので、レベルアイコンに注意が必要です。'; + + $lang->level_icon = 'レベルアイコン'; + $lang->about_level_icon = 'レベルアイコンは、「./modules/point/icons/レベル.gif」で指定されるため、最高レベルとアイコンセットが異なる場合があります。ご注意下さい。'; + + $lang->point_name = 'ポイント名'; + $lang->about_point_name = 'ポイントの名前、単位が指定出来ます。'; + + $lang->level_point = 'レベルポイント'; + $lang->about_level_point = '下の各レベルのポイントが増加したり、減少するとレベルが調整されます。'; + + $lang->disable_download = 'ダウンロード禁止'; + $lang->about_disable_download = 'チェックするとポイントがない場合、ダウンロードを禁止します(イメージファイル除外)。'; + $lang->disable_read_document = '閲覧禁止'; + $lang->about_disable_read_document = 'ポイントがない場合、閲覧を禁止します。'; + + $lang->level_point_calc = 'レベル別ポイント計算'; + $lang->expression = 'レベル変数iを使用してJavaスクリプト数式を入力して下さい(例: Math.pow(i, 2) * 90)。'; + $lang->cmd_exp_calc = '計算'; + $lang->cmd_exp_reset = '初期化'; + + $lang->cmd_point_recal = 'ポイントの初期化'; + $lang->about_cmd_point_recal = '書き込み/コメント/添付ファイル/会員登録のポイントのみ取り、全ての他のポイントを初期化します。
    但し、会員登録ポイントは初期化後、該当会員の活動がスタートしたら付与されます。
    データ移管などによるポイントを完全に初期化する必要がある場合など、利用は慎重に行なって下さい。'; + + $lang->point_link_group = 'グループ連動'; + $lang->point_group_reset_and_add = '設定されたグループの初期化後、新規グループに付与'; + $lang->point_group_add_only = '新規グループのみ付与'; + $lang->about_point_link_group = 'グループにレベルを指定すると、該当レベルになったらグループが変更されます。'; + + $lang->about_module_point = 'モジュール別にポイントを指定することが出来ますが、指定されていないモジュールでは、デフォルトポイントが使用されます。すべてのポイント数は、反対のアクションを行った際には原状復帰されます。'; + + $lang->point_signup = '加入'; + $lang->point_insert_document = '書き込み作成'; + $lang->point_delete_document = '書き込み削除'; + $lang->point_insert_comment = 'コメント作成'; + $lang->point_delete_comment = 'コメント削除'; + $lang->point_upload_file = 'アップロード'; + $lang->point_delete_file = 'ファイル削除'; + $lang->point_download_file = 'ダウンロード'; + $lang->point_read_document = '書き込み閲覧'; + $lang->point_voted = '推薦'; + $lang->point_blamed = '非推薦'; + + $lang->cmd_point_config = 'デフォルト設定'; + $lang->cmd_point_module_config = 'モジュール別設定'; + $lang->cmd_point_act_config = '機能別アクション設定'; + $lang->cmd_point_member_list = '会員ポイントリスト'; + + $lang->msg_cannot_download = 'ポイントが不足しているため、ダウンロード出来ません。'; + $lang->msg_disallow_by_point = "ポイントが不足しているため、閲覧が出来ません。(必要ポイント : %d、 保有ポイント : %d)"; + + $lang->point_recal_message = 'ただ今ポイントを適用しています。 (%d / %d)'; + $lang->point_recal_finished = 'ポイント再計算が完了しました。'; +?> diff --git a/modules/point/lang/ko.lang.php b/modules/point/lang/ko.lang.php index 685c0139e..b55d89f32 100644 --- a/modules/point/lang/ko.lang.php +++ b/modules/point/lang/ko.lang.php @@ -1,68 +1,68 @@ -point = '포인트'; - $lang->level = '레벨'; - - $lang->about_point_module = '포인트 모듈은 글 작성/댓글작성/업로드/다운로드 등의 행동을 할 때 포인트를 부여할 수 있게 합니다.'; - $lang->about_act_config = '게시판, 블로그 등 각 모듈마다 글 작성/삭제/댓글작성/삭제 등의 action이 있습니다.
    게시판/블로그 외에 다른 모듈에 포인트 기능 연동을 하고 싶을 때는 각 기능에 맞는 act값을 추가 하시면 됩니다.
    연결은 ,(콤마)로 하시면 됩니다.'; - - $lang->max_level = '최고 레벨'; - $lang->about_max_level = '최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두셔야 하고 최고 레벨은 1000이 한계입니다.'; - - $lang->level_icon = '레벨 아이콘'; - $lang->about_level_icon = '레벨 아이콘은 ./modules/point/icons/레벨.gif 로 지정되며 최고레벨과 아이콘셋이 다를 수 있으니 주의해주세요!'; - - $lang->point_name = '포인트 명칭'; - $lang->about_point_name = '포인트 이름이나 단위를 정할 수 있습니다.'; - - $lang->level_point = '레벨 포인트'; - $lang->about_level_point = '각 회원의 포인트가 아래 레벨별 포인트에 도달하거나 미달하게 되면 해당 회원의 레벨이 조절됩니다.'; - - $lang->disable_download = '다운로드 금지'; - $lang->about_disable_download = '포인트가 부족할 경우 다운로드를 금지 합니다. (이미지 파일, 동영상 파일등 직접 링크가 가능한 파일들은 예외입니다.)'; - $lang->disable_read_document = '글 열람 금지'; - $lang->about_disable_read_document = '포인트가 부족할 경우 글 열람을 금지 합니다'; - - $lang->level_point_calc = '레벨별 포인트 계산'; - $lang->expression = '레벨 변수 i를 사용하여 자바스크립트 수식을 입력하세요. 예: Math.pow(i, 2) * 90'; - $lang->cmd_exp_calc = '계산'; - $lang->cmd_exp_reset = '초기화'; - - $lang->cmd_point_recal = '포인트 초기화'; - $lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화 합니다.
    회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다.
    데이터 이전 등을 하여 포인트를 완전히 초기화해야 할 경우에만 사용하세요.'; - - $lang->point_link_group = '그룹 연동'; - $lang->point_group_reset_and_add = '설정된 그룹 초기화 후 새 그룹 부여'; - $lang->point_group_add_only = '새 그룹만 부여'; - $lang->about_point_link_group = '그룹에 원하는 레벨을 지정하면, 회원의 포인트가 해당 레벨의 포인트에 도달할 때 그룹이 변경됩니다.'; - - $lang->about_module_point = '모듈별 포인트를 지정할 수 있으며 지정되지 않은 모듈은 기본 포인트를 이용합니다.
    모든 점수는 반대 행동을 하였을 경우 원상복구 됩니다.'; - - $lang->point_signup = '가입'; - $lang->point_insert_document = '글 작성'; - $lang->point_delete_document = '글 삭제'; - $lang->point_insert_comment = '댓글 작성'; - $lang->point_delete_comment = '댓글 삭제'; - $lang->point_upload_file = '파일 업로드'; - $lang->point_delete_file = '파일 삭제'; - $lang->point_download_file = '파일 다운로드 (이미지 제외)'; - $lang->point_read_document = '게시글 조회'; - $lang->point_voted = '추천 받음'; - $lang->point_blamed = '비추천 받음'; - - $lang->cmd_point_config = '기본 설정'; - $lang->cmd_point_module_config = '모듈별 설정'; - $lang->cmd_point_act_config = '기능별 act 설정'; - $lang->cmd_point_member_list = '회원 포인트 목록'; - - $lang->msg_cannot_download = '포인트가 부족하여 다운로드를 하실 수 없습니다.'; - $lang->msg_disallow_by_point = "포인트가 부족하여 글을 읽으실 수 없습니다. (필요한 포인트 : %d, 현재 포인트 : %d)"; - - $lang->point_recal_message = '포인트 적용중입니다. (%d / %d)'; - $lang->point_recal_finished = '포인트 재계산이 완료되었습니다.'; -?> +point = '포인트'; + $lang->level = '레벨'; + + $lang->about_point_module = '포인트 모듈은 글 작성/댓글작성/업로드/다운로드 등의 행동을 할 때 포인트를 부여할 수 있게 합니다.'; + $lang->about_act_config = '게시판, 블로그 등 각 모듈마다 글 작성/삭제/댓글작성/삭제 등의 action이 있습니다.
    게시판/블로그 외에 다른 모듈에 포인트 기능 연동을 하고 싶을 때는 각 기능에 맞는 act값을 추가 하시면 됩니다.
    연결은 ,(콤마)로 하시면 됩니다.'; + + $lang->max_level = '최고 레벨'; + $lang->about_max_level = '최고레벨을 지정할 수 있습니다. 레벨 아이콘을 염두에 두셔야 하고 최고 레벨은 1000이 한계입니다.'; + + $lang->level_icon = '레벨 아이콘'; + $lang->about_level_icon = '레벨 아이콘은 ./modules/point/icons/레벨.gif 로 지정되며 최고레벨과 아이콘셋이 다를 수 있으니 주의해주세요!'; + + $lang->point_name = '포인트 명칭'; + $lang->about_point_name = '포인트 이름이나 단위를 정할 수 있습니다.'; + + $lang->level_point = '레벨 포인트'; + $lang->about_level_point = '각 회원의 포인트가 아래 레벨별 포인트에 도달하거나 미달하게 되면 해당 회원의 레벨이 조절됩니다.'; + + $lang->disable_download = '다운로드 금지'; + $lang->about_disable_download = '포인트가 부족할 경우 다운로드를 금지 합니다. (이미지 파일, 동영상 파일등 직접 링크가 가능한 파일들은 예외입니다.)'; + $lang->disable_read_document = '글 열람 금지'; + $lang->about_disable_read_document = '포인트가 부족할 경우 글 열람을 금지 합니다'; + + $lang->level_point_calc = '레벨별 포인트 계산'; + $lang->expression = '레벨 변수 i를 사용하여 자바스크립트 수식을 입력하세요. 예: Math.pow(i, 2) * 90'; + $lang->cmd_exp_calc = '계산'; + $lang->cmd_exp_reset = '초기화'; + + $lang->cmd_point_recal = '포인트 초기화'; + $lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화 합니다.
    회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다.
    데이터 이전 등을 하여 포인트를 완전히 초기화해야 할 경우에만 사용하세요.'; + + $lang->point_link_group = '그룹 연동'; + $lang->point_group_reset_and_add = '설정된 그룹 초기화 후 새 그룹 부여'; + $lang->point_group_add_only = '새 그룹만 부여'; + $lang->about_point_link_group = '그룹에 원하는 레벨을 지정하면, 회원의 포인트가 해당 레벨의 포인트에 도달할 때 그룹이 변경됩니다.'; + + $lang->about_module_point = '모듈별 포인트를 지정할 수 있으며 지정되지 않은 모듈은 기본 포인트를 이용합니다.
    모든 점수는 반대 행동을 하였을 경우 원상복구 됩니다.'; + + $lang->point_signup = '가입'; + $lang->point_insert_document = '글 작성'; + $lang->point_delete_document = '글 삭제'; + $lang->point_insert_comment = '댓글 작성'; + $lang->point_delete_comment = '댓글 삭제'; + $lang->point_upload_file = '파일 업로드'; + $lang->point_delete_file = '파일 삭제'; + $lang->point_download_file = '파일 다운로드 (이미지 제외)'; + $lang->point_read_document = '게시글 조회'; + $lang->point_voted = '추천 받음'; + $lang->point_blamed = '비추천 받음'; + + $lang->cmd_point_config = '기본 설정'; + $lang->cmd_point_module_config = '모듈별 설정'; + $lang->cmd_point_act_config = '기능별 act 설정'; + $lang->cmd_point_member_list = '회원 포인트 목록'; + + $lang->msg_cannot_download = '포인트가 부족하여 다운로드를 하실 수 없습니다.'; + $lang->msg_disallow_by_point = "포인트가 부족하여 글을 읽으실 수 없습니다. (필요한 포인트 : %d, 현재 포인트 : %d)"; + + $lang->point_recal_message = '포인트 적용중입니다. (%d / %d)'; + $lang->point_recal_finished = '포인트 재계산이 완료되었습니다.'; +?> diff --git a/modules/point/lang/ru.lang.php b/modules/point/lang/ru.lang.php index 7cd7ff58a..4c5ff441f 100644 --- a/modules/point/lang/ru.lang.php +++ b/modules/point/lang/ru.lang.php @@ -1,69 +1,69 @@ -point = "Поинты"; - $lang->level = "Уровень"; - - $lang->about_point_module = "Вы можете распределять поинты за написание/добавление комментариев, закачку/скачку файлов."; - $lang->about_act_config = "Каждый модуль, такой как форум/блог, имеет имеет свои действия, такие как\"написание/удаление/добавление комментариев/удаление комментариев\".
    Вы можете просто добавить значения действий, чтобы связать ситему поинтов, за исключением форума/блога.
    Запятая(,) используется как разделитель значений."; - - $lang->max_level = 'Макс. уровень'; - $lang->about_max_level = 'Вы можете установить максимальный уровень. Иконки уровней должны быть присвоены. (макс. значение равно 1000)'; - - $lang->level_icon = 'Иконка уровня'; - $lang->about_level_icon = 'Путь иконок уровней "./module/point/icons/[level].gif" и максимальный уровень может меняться с набором иконок. Поэтому будте осторожны'; - - $lang->point_name = 'Имя поинта'; - $lang->about_point_name = 'Вы можете дать имя или единицу измерения для поинта'; - - $lang->level_point = 'Уровень поинтов'; - $lang->about_level_point = 'Уровень будет изменен, когда поинты достигают каждого уровня поинтов или падают ниже его'; - - $lang->disable_download = 'Запретить скачивание'; - $lang->about_disable_download = "Это запретит скачивание файлов, когда не хватает достаточного кол-ва поинтов. (За исключением файлов изображений)"; - $lang->disable_read_document = '글 열람 금지'; - $lang->about_disable_read_document = '포인트가 없을 경우 글 열람을 금지하게 됩니다'; - - $lang->level_point_calc = '레벨별 포인트 계산'; - $lang->expression = '레벨 변수 i를 사용하여 자바스크립트 수식을 입력하세요. 예: Math.pow(i, 2) * 90'; - $lang->cmd_exp_calc = '계산'; - $lang->cmd_exp_reset = '초기화'; - - $lang->cmd_point_recal = '포인트 초기화'; - $lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화 합니다.
    회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다.
    데이터 이전등을 하여 포인트를 완전히 초기화 해야 할 경우에만 사용하세요.'; - - $lang->point_link_group = '그룹 연동'; - $lang->point_group_reset_and_add = '설정된 그룹 초기화 후 새 그룹 부여'; - $lang->point_group_add_only = '새 그룹만 부여'; - $lang->about_point_link_group = '그룹에 원하는 레벨을 지정하면 해당 레벨에 도달할때 그룹이 변경됩니다.'; - - $lang->about_module_point = "Вы можете установть поинты для каждого модуля, а модули, не имеющие значения будут использовать значение по умолчанию для поинтов.
    Все поинты будут восстановлены при обратном действии."; - - $lang->point_signup = 'Присвоить'; - $lang->point_insert_document = 'При написании'; - $lang->point_delete_document = 'При удалении'; - $lang->point_insert_comment = 'При добавлении комментариев'; - $lang->point_delete_comment = 'При удалении комментариев'; - $lang->point_upload_file = 'При закачке файлов'; - $lang->point_delete_file = 'При скачке файлов'; - $lang->point_download_file = 'При скачке файлов (кроме изображений)'; - $lang->point_read_document = '게시글 조회'; - $lang->point_voted = '추천 받음'; - $lang->point_blamed = '비추천 받음'; - - - $lang->cmd_point_config = 'Настройки по умолчанию'; - $lang->cmd_point_module_config = 'Настройки модуля'; - $lang->cmd_point_act_config = 'Настройки действий'; - $lang->cmd_point_member_list = 'Список поинтов пользователей'; - - $lang->msg_cannot_download = "У Вас нет достаточного количества поитов, чтобы иметь разрешение скачивать файлы."; - $lang->msg_disallow_by_point = "포인트가 부족하여 글을 읽을 수 없습니다 (필요포인트 : %d, 현재포인트 : %d)"; - - $lang->point_recal_message = '포인트 적용중입니다. (%d / %d)'; - $lang->point_recal_finished = '포인트 재계산이 모두 완료되었습니다'; -?> +point = "Поинты"; + $lang->level = "Уровень"; + + $lang->about_point_module = "Вы можете распределять поинты за написание/добавление комментариев, закачку/скачку файлов."; + $lang->about_act_config = "Каждый модуль, такой как форум/блог, имеет имеет свои действия, такие как\"написание/удаление/добавление комментариев/удаление комментариев\".
    Вы можете просто добавить значения действий, чтобы связать ситему поинтов, за исключением форума/блога.
    Запятая(,) используется как разделитель значений."; + + $lang->max_level = 'Макс. уровень'; + $lang->about_max_level = 'Вы можете установить максимальный уровень. Иконки уровней должны быть присвоены. (макс. значение равно 1000)'; + + $lang->level_icon = 'Иконка уровня'; + $lang->about_level_icon = 'Путь иконок уровней "./module/point/icons/[level].gif" и максимальный уровень может меняться с набором иконок. Поэтому будте осторожны'; + + $lang->point_name = 'Имя поинта'; + $lang->about_point_name = 'Вы можете дать имя или единицу измерения для поинта'; + + $lang->level_point = 'Уровень поинтов'; + $lang->about_level_point = 'Уровень будет изменен, когда поинты достигают каждого уровня поинтов или падают ниже его'; + + $lang->disable_download = 'Запретить скачивание'; + $lang->about_disable_download = "Это запретит скачивание файлов, когда не хватает достаточного кол-ва поинтов. (За исключением файлов изображений)"; + $lang->disable_read_document = '글 열람 금지'; + $lang->about_disable_read_document = '포인트가 없을 경우 글 열람을 금지하게 됩니다'; + + $lang->level_point_calc = '레벨별 포인트 계산'; + $lang->expression = '레벨 변수 i를 사용하여 자바스크립트 수식을 입력하세요. 예: Math.pow(i, 2) * 90'; + $lang->cmd_exp_calc = '계산'; + $lang->cmd_exp_reset = '초기화'; + + $lang->cmd_point_recal = '포인트 초기화'; + $lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화 합니다.
    회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다.
    데이터 이전등을 하여 포인트를 완전히 초기화 해야 할 경우에만 사용하세요.'; + + $lang->point_link_group = '그룹 연동'; + $lang->point_group_reset_and_add = '설정된 그룹 초기화 후 새 그룹 부여'; + $lang->point_group_add_only = '새 그룹만 부여'; + $lang->about_point_link_group = '그룹에 원하는 레벨을 지정하면 해당 레벨에 도달할때 그룹이 변경됩니다.'; + + $lang->about_module_point = "Вы можете установть поинты для каждого модуля, а модули, не имеющие значения будут использовать значение по умолчанию для поинтов.
    Все поинты будут восстановлены при обратном действии."; + + $lang->point_signup = 'Присвоить'; + $lang->point_insert_document = 'При написании'; + $lang->point_delete_document = 'При удалении'; + $lang->point_insert_comment = 'При добавлении комментариев'; + $lang->point_delete_comment = 'При удалении комментариев'; + $lang->point_upload_file = 'При закачке файлов'; + $lang->point_delete_file = 'При скачке файлов'; + $lang->point_download_file = 'При скачке файлов (кроме изображений)'; + $lang->point_read_document = '게시글 조회'; + $lang->point_voted = '추천 받음'; + $lang->point_blamed = '비추천 받음'; + + + $lang->cmd_point_config = 'Настройки по умолчанию'; + $lang->cmd_point_module_config = 'Настройки модуля'; + $lang->cmd_point_act_config = 'Настройки действий'; + $lang->cmd_point_member_list = 'Список поинтов пользователей'; + + $lang->msg_cannot_download = "У Вас нет достаточного количества поитов, чтобы иметь разрешение скачивать файлы."; + $lang->msg_disallow_by_point = "포인트가 부족하여 글을 읽을 수 없습니다 (필요포인트 : %d, 현재포인트 : %d)"; + + $lang->point_recal_message = '포인트 적용중입니다. (%d / %d)'; + $lang->point_recal_finished = '포인트 재계산이 모두 완료되었습니다'; +?> diff --git a/modules/point/lang/tr.lang.php b/modules/point/lang/tr.lang.php index 5e60f0c73..8e38b4fb1 100644 --- a/modules/point/lang/tr.lang.php +++ b/modules/point/lang/tr.lang.php @@ -1,69 +1,69 @@ -point = "Puan"; - $lang->level = "Seviye"; - - $lang->about_point_module = "Yazmaya/silmeye, yorum eklemeye/yorum silmeye puan atayabilirsiniz."; - $lang->about_act_config = "Pano/blog gibi her modülün, \"yazma/silme/yorum ekleme/yorum silme gibi kendi eylemleri bulunmaktadır. \".
    Pano/blog harici, puan sistemli link modüllerine davranış değerleri ekleyebilirsiniz.
    Virgül(,) çoklu değerleri ayıracaktır."; - - $lang->max_level = 'Azami Seviye'; - $lang->about_max_level = 'Azami seviyeyi ayarlayabilirsiniz. Seviye simgelerine değer verirken dikkate alınmalıdır. Verebileceğiniz en yüksek değer 1000dir.'; - - $lang->level_icon = 'Seviye Simgesi'; - $lang->about_level_icon = 'Seviye simgesi yolu "./module/point/icons/[seviye].gif" olmalıdır. Azami seviye farklı simge setiyle gösterilebilir. Bu yüzden lütfen dikkatli olunuz.'; - - $lang->point_name = 'Puan Adı'; - $lang->about_point_name = 'Puan için bir isim veya birim belirleyebilirsiniz'; - - $lang->level_point = 'Seviye Puanı'; - $lang->about_level_point = 'Puan herhangi bir seviyeye gelince veya bir puan seviyesinin altına düşünce, seviye otomatik ayarlanacaktır.'; - - $lang->disable_download = 'İndirmeleri Yasakla'; - $lang->about_disable_download = "Yeterli puan olmadığı zaman indirme yapamayacaklardır. (Resim dosyaları harici)"; - $lang->disable_read_document = 'Okumayı Yasakla'; - $lang->about_disable_read_document = 'Kullanıcıların yeterli puanı olmadığında, makaleleri okuyamayacaklardır.'; - - $lang->level_point_calc = 'Puan başına Puan Hesaplaması'; - $lang->expression = 'Lütfen seviye değişkenini kullanarak Javascript formülü ekleyiniz . örn) Math.pow(i, 2) * 90'; - $lang->cmd_exp_calc = 'Hesapla'; - $lang->cmd_exp_reset = 'Sıfırla'; - - $lang->cmd_point_recal = 'Puan Sıfırla'; - $lang->about_cmd_point_recal = 'Sadece makalelerdeki/yorumlardaki/eklerdeki/katılımlardaki tüm puanlar sıfırlanacaktır.
    Sıfırlamadan sonra sadece, website aktiviteleri yapan üyeler, giriş puanı alacaklardır.
    Lütfen bu özelliği sadece veri taşıma veya cidden gerekliliği olduğu durumlarda kullanınız.'; - - $lang->point_link_group = 'Seviyeye Göre Grup Değiştirme'; - $lang->point_group_reset_and_add = 'Düzenlenmiş grupları sıfırla ve yeni gruplar ekle'; - $lang->point_group_add_only = 'Sadece yeni gruplara'; - $lang->about_point_link_group = 'Belirli bir grup için seviye belirliyorsanız, kullanıcılar gruba o seviyenin puanına eriştiklerinde atanacaklardır.'; - - $lang->about_module_point = "Her modül için puan ayarlayabilirsiniz. Hiçbir değer atanmayan modüller varsayılan puan sistemini kullanacaktır.
    Tersi hareket durumunda tüm puanlar iade edilecektir."; - - $lang->point_signup = 'Kayıt Olmaya'; - $lang->point_insert_document = 'Yazıya'; - $lang->point_delete_document = 'Silmeye'; - $lang->point_insert_comment = 'Yorum Eklemeye'; - $lang->point_delete_comment = 'Yorum Silmeye'; - $lang->point_upload_file = 'Karşıya Yüklemeye (upload)'; - $lang->point_delete_file = 'Dosyaları Silmeye'; - $lang->point_download_file = 'Dosyaları İndirmeye (resimler hariç)'; - $lang->point_read_document = 'Okumaya'; - $lang->point_voted = 'Önerilene'; - $lang->point_blamed = 'Suçlanana'; - - - $lang->cmd_point_config = 'Varsayılan Ayar'; - $lang->cmd_point_module_config = 'Modül Ayarı'; - $lang->cmd_point_act_config = 'Eylem Ayarı'; - $lang->cmd_point_member_list = 'Üye Puan listesi'; - - $lang->msg_cannot_download = "İndirmek için yeteri puanınız bulunmamaktadır"; - $lang->msg_disallow_by_point = "Makaleyi okumak için daha fazla puana ihtiyacınız var (%d lazımken, %d puanınız var)"; - - $lang->point_recal_message = 'Puan Düzeltiliyor. (%d / %d)'; - $lang->point_recal_finished = 'Puan tekrar hesaplaması bitti.'; -?> +point = "Puan"; + $lang->level = "Seviye"; + + $lang->about_point_module = "Yazmaya/silmeye, yorum eklemeye/yorum silmeye puan atayabilirsiniz."; + $lang->about_act_config = "Pano/blog gibi her modülün, \"yazma/silme/yorum ekleme/yorum silme gibi kendi eylemleri bulunmaktadır. \".
    Pano/blog harici, puan sistemli link modüllerine davranış değerleri ekleyebilirsiniz.
    Virgül(,) çoklu değerleri ayıracaktır."; + + $lang->max_level = 'Azami Seviye'; + $lang->about_max_level = 'Azami seviyeyi ayarlayabilirsiniz. Seviye simgelerine değer verirken dikkate alınmalıdır. Verebileceğiniz en yüksek değer 1000dir.'; + + $lang->level_icon = 'Seviye Simgesi'; + $lang->about_level_icon = 'Seviye simgesi yolu "./module/point/icons/[seviye].gif" olmalıdır. Azami seviye farklı simge setiyle gösterilebilir. Bu yüzden lütfen dikkatli olunuz.'; + + $lang->point_name = 'Puan Adı'; + $lang->about_point_name = 'Puan için bir isim veya birim belirleyebilirsiniz'; + + $lang->level_point = 'Seviye Puanı'; + $lang->about_level_point = 'Puan herhangi bir seviyeye gelince veya bir puan seviyesinin altına düşünce, seviye otomatik ayarlanacaktır.'; + + $lang->disable_download = 'İndirmeleri Yasakla'; + $lang->about_disable_download = "Yeterli puan olmadığı zaman indirme yapamayacaklardır. (Resim dosyaları harici)"; + $lang->disable_read_document = 'Okumayı Yasakla'; + $lang->about_disable_read_document = 'Kullanıcıların yeterli puanı olmadığında, makaleleri okuyamayacaklardır.'; + + $lang->level_point_calc = 'Puan başına Puan Hesaplaması'; + $lang->expression = 'Lütfen seviye değişkenini kullanarak Javascript formülü ekleyiniz . örn) Math.pow(i, 2) * 90'; + $lang->cmd_exp_calc = 'Hesapla'; + $lang->cmd_exp_reset = 'Sıfırla'; + + $lang->cmd_point_recal = 'Puan Sıfırla'; + $lang->about_cmd_point_recal = 'Sadece makalelerdeki/yorumlardaki/eklerdeki/katılımlardaki tüm puanlar sıfırlanacaktır.
    Sıfırlamadan sonra sadece, website aktiviteleri yapan üyeler, giriş puanı alacaklardır.
    Lütfen bu özelliği sadece veri taşıma veya cidden gerekliliği olduğu durumlarda kullanınız.'; + + $lang->point_link_group = 'Seviyeye Göre Grup Değiştirme'; + $lang->point_group_reset_and_add = 'Düzenlenmiş grupları sıfırla ve yeni gruplar ekle'; + $lang->point_group_add_only = 'Sadece yeni gruplara'; + $lang->about_point_link_group = 'Belirli bir grup için seviye belirliyorsanız, kullanıcılar gruba o seviyenin puanına eriştiklerinde atanacaklardır.'; + + $lang->about_module_point = "Her modül için puan ayarlayabilirsiniz. Hiçbir değer atanmayan modüller varsayılan puan sistemini kullanacaktır.
    Tersi hareket durumunda tüm puanlar iade edilecektir."; + + $lang->point_signup = 'Kayıt Olmaya'; + $lang->point_insert_document = 'Yazıya'; + $lang->point_delete_document = 'Silmeye'; + $lang->point_insert_comment = 'Yorum Eklemeye'; + $lang->point_delete_comment = 'Yorum Silmeye'; + $lang->point_upload_file = 'Karşıya Yüklemeye (upload)'; + $lang->point_delete_file = 'Dosyaları Silmeye'; + $lang->point_download_file = 'Dosyaları İndirmeye (resimler hariç)'; + $lang->point_read_document = 'Okumaya'; + $lang->point_voted = 'Önerilene'; + $lang->point_blamed = 'Suçlanana'; + + + $lang->cmd_point_config = 'Varsayılan Ayar'; + $lang->cmd_point_module_config = 'Modül Ayarı'; + $lang->cmd_point_act_config = 'Eylem Ayarı'; + $lang->cmd_point_member_list = 'Üye Puan listesi'; + + $lang->msg_cannot_download = "İndirmek için yeteri puanınız bulunmamaktadır"; + $lang->msg_disallow_by_point = "Makaleyi okumak için daha fazla puana ihtiyacınız var (%d lazımken, %d puanınız var)"; + + $lang->point_recal_message = 'Puan Düzeltiliyor. (%d / %d)'; + $lang->point_recal_finished = 'Puan tekrar hesaplaması bitti.'; +?> diff --git a/modules/point/lang/vi.lang.php b/modules/point/lang/vi.lang.php index 2111d9700..97944b888 100644 --- a/modules/point/lang/vi.lang.php +++ b/modules/point/lang/vi.lang.php @@ -1,71 +1,71 @@ -point = "Điểm"; - $lang->level = "Cấp bậc"; - - $lang->about_point_module = "Bạn có thể đặt mức điểm khi thành viên gửi, thêm bài viết, bình luận, Download, Upload.
    Nhưng điểm chỉ có thể cho và tích lũy khi Addon điểm được kích hoạt."; - $lang->about_act_config = "Mỗi Module, Board hay Blog có một mức cho điểm khác nhau khi \"gửi bài, xóa bài, thêm bài, gửi bình luận, xóa bình luận\".
    Bạn có thể chỉ thêm những giá trị liên kết với hệ thống điểm vào mỗi Module Blog, Board.
    Để thêm nhiều giá trị bằng cách sử dụng dấu (,) giữa các giá trị."; - - $lang->max_level = 'Cấp bậc lớn nhất'; - $lang->about_max_level = 'Bạn có thể quy định cấp bậc lớn nhất. Kiểm tra lại Icon của cấp bậc, và bạn có thể đặt cấp bậc tối đa là 1000.'; - - $lang->level_icon = 'Icon của cấp bậc'; - $lang->about_level_icon = 'Thư mục chứa Icon của cấp bậc có dạng "./module/point/icons/[level].gif" và cấp độ lớn nhất có thể khác với bộ Icon hiện tại. Vì vậy xin hãy cẩn thận.'; - - $lang->point_name = 'Tên điểm'; - $lang->about_point_name = 'Bạn có thể đặt tên hay đặt một giá trị nào đó cho điểm.'; - - $lang->level_point = 'Điểm thăng cấp'; - $lang->about_level_point = 'Cấp độ sẽ được thay đổi khi đạt tới số điểm giới hạn.'; - - $lang->disable_download = 'Cấm Download'; - $lang->about_disable_download = "Điều này sẽ cấm thành viên Download khi không đủ điểm. (Ngoại trừ File hình ảnh)"; - $lang->disable_read_document = 'Cấm đọc bài'; - $lang->about_disable_read_document = 'Nếu số điểm không đủ, thành viên sẽ không thể đọc được bài viết.'; - - $lang->level_point_calc = 'Tính toán trên điểm'; - $lang->expression = 'Hãy nhập công thức cần sử dụng i. Ví dụ: Math.pow(i, 2) * 90'; - $lang->cmd_exp_calc = 'Tính toán'; - $lang->cmd_exp_reset = 'Thiết lập lại'; - - $lang->cmd_point_recal = 'Thiết lập lại điểm'; - $lang->about_cmd_point_recal = 'Điểm chỉ có thể có được khi gửi bài, bình luận, đính kèm và khi đăng kí.
    Chỉ có thể thiết lập lại điểm của những thành viên đã đăng kí là thành viên.
    Xin hãy chỉ sử dụng chức năng này khi bạn chuyển nội dung của Website qua một Website khác.'; - - $lang->point_link_group = 'Chuyển nhóm với cấp độ'; - $lang->point_group_reset_and_add = 'Điểm số để thăng cấp cho nhóm mới.'; - $lang->point_group_add_only = 'Chỉ cấp cho nhóm mới'; - $lang->about_point_link_group = 'Nếu bạn đặt cấp độ cho một nhóm đặc biệt nào đó, người sử dụng trong nhóm đó khi đạt đến số điểm giới hạn sẽ tự động được chuyển sang nhóm mới.'; - - $lang->about_module_point = "Bạn có thể đặt thang điểm riêng cho mỗi Module, Module nào không được đặt sẽ sử dụng sự thiết lập mặc định.
    Tất cả điểm sẽ khác khi sử dụng chức năng này."; - - $lang->point_signup = 'Khi đăng kí'; - $lang->point_insert_document = 'Khi gửi bài'; - $lang->point_delete_document = 'Khi xóa bài'; - $lang->point_insert_comment = 'Khi thêm bình luận'; - $lang->point_delete_comment = 'Khi xóa bình luận'; - $lang->point_upload_file = 'Khi Upload'; - $lang->point_delete_file = 'Khi xóa File'; - $lang->point_download_file = 'Khi Download (Trừ hình ảnh)'; - $lang->point_read_document = 'Khi đọc bài'; - $lang->point_voted = 'Khi bình chọn'; - $lang->point_blamed = 'Khi phê bình'; - - - $lang->cmd_point_config = 'Thiết lập mặc định'; - $lang->cmd_point_module_config = 'Thiết lập Module'; - $lang->cmd_point_act_config = 'Thiết lập khác'; - $lang->cmd_point_member_list = 'Danh sách điểm thành viên'; - - $lang->msg_cannot_download = "Bạn không đủ điểm để Download."; - $lang->msg_disallow_by_point = "Bạn không thể xem được bài viết vì điểm của bạn không đủ. (Điểm yêu cầu: %d, Điểm hiện tại: %d)"; - - $lang->point_recal_message = 'Điều chỉnh điểm. (%d / %d)'; - $lang->point_recal_finished = 'Đã kết thúc việc tính toán lại điểm.'; -?> +point = "Điểm"; + $lang->level = "Cấp bậc"; + + $lang->about_point_module = "Bạn có thể đặt mức điểm khi thành viên gửi, thêm bài viết, bình luận, Download, Upload.
    Nhưng điểm chỉ có thể cho và tích lũy khi Addon điểm được kích hoạt."; + $lang->about_act_config = "Mỗi Module, Board hay Blog có một mức cho điểm khác nhau khi \"gửi bài, xóa bài, thêm bài, gửi bình luận, xóa bình luận\".
    Bạn có thể chỉ thêm những giá trị liên kết với hệ thống điểm vào mỗi Module Blog, Board.
    Để thêm nhiều giá trị bằng cách sử dụng dấu (,) giữa các giá trị."; + + $lang->max_level = 'Cấp bậc lớn nhất'; + $lang->about_max_level = 'Bạn có thể quy định cấp bậc lớn nhất. Kiểm tra lại Icon của cấp bậc, và bạn có thể đặt cấp bậc tối đa là 1000.'; + + $lang->level_icon = 'Icon của cấp bậc'; + $lang->about_level_icon = 'Thư mục chứa Icon của cấp bậc có dạng "./module/point/icons/[level].gif" và cấp độ lớn nhất có thể khác với bộ Icon hiện tại. Vì vậy xin hãy cẩn thận.'; + + $lang->point_name = 'Tên điểm'; + $lang->about_point_name = 'Bạn có thể đặt tên hay đặt một giá trị nào đó cho điểm.'; + + $lang->level_point = 'Điểm thăng cấp'; + $lang->about_level_point = 'Cấp độ sẽ được thay đổi khi đạt tới số điểm giới hạn.'; + + $lang->disable_download = 'Cấm Download'; + $lang->about_disable_download = "Điều này sẽ cấm thành viên Download khi không đủ điểm. (Ngoại trừ File hình ảnh)"; + $lang->disable_read_document = 'Cấm đọc bài'; + $lang->about_disable_read_document = 'Nếu số điểm không đủ, thành viên sẽ không thể đọc được bài viết.'; + + $lang->level_point_calc = 'Tính toán trên điểm'; + $lang->expression = 'Hãy nhập công thức cần sử dụng i. Ví dụ: Math.pow(i, 2) * 90'; + $lang->cmd_exp_calc = 'Tính toán'; + $lang->cmd_exp_reset = 'Thiết lập lại'; + + $lang->cmd_point_recal = 'Thiết lập lại điểm'; + $lang->about_cmd_point_recal = 'Điểm chỉ có thể có được khi gửi bài, bình luận, đính kèm và khi đăng kí.
    Chỉ có thể thiết lập lại điểm của những thành viên đã đăng kí là thành viên.
    Xin hãy chỉ sử dụng chức năng này khi bạn chuyển nội dung của Website qua một Website khác.'; + + $lang->point_link_group = 'Chuyển nhóm với cấp độ'; + $lang->point_group_reset_and_add = 'Điểm số để thăng cấp cho nhóm mới.'; + $lang->point_group_add_only = 'Chỉ cấp cho nhóm mới'; + $lang->about_point_link_group = 'Nếu bạn đặt cấp độ cho một nhóm đặc biệt nào đó, người sử dụng trong nhóm đó khi đạt đến số điểm giới hạn sẽ tự động được chuyển sang nhóm mới.'; + + $lang->about_module_point = "Bạn có thể đặt thang điểm riêng cho mỗi Module, Module nào không được đặt sẽ sử dụng sự thiết lập mặc định.
    Tất cả điểm sẽ khác khi sử dụng chức năng này."; + + $lang->point_signup = 'Khi đăng kí'; + $lang->point_insert_document = 'Khi gửi bài'; + $lang->point_delete_document = 'Khi xóa bài'; + $lang->point_insert_comment = 'Khi thêm bình luận'; + $lang->point_delete_comment = 'Khi xóa bình luận'; + $lang->point_upload_file = 'Khi Upload'; + $lang->point_delete_file = 'Khi xóa File'; + $lang->point_download_file = 'Khi Download (Trừ hình ảnh)'; + $lang->point_read_document = 'Khi đọc bài'; + $lang->point_voted = 'Khi bình chọn'; + $lang->point_blamed = 'Khi phê bình'; + + + $lang->cmd_point_config = 'Thiết lập mặc định'; + $lang->cmd_point_module_config = 'Thiết lập Module'; + $lang->cmd_point_act_config = 'Thiết lập khác'; + $lang->cmd_point_member_list = 'Danh sách điểm thành viên'; + + $lang->msg_cannot_download = "Bạn không đủ điểm để Download."; + $lang->msg_disallow_by_point = "Bạn không thể xem được bài viết vì điểm của bạn không đủ. (Điểm yêu cầu: %d, Điểm hiện tại: %d)"; + + $lang->point_recal_message = 'Điều chỉnh điểm. (%d / %d)'; + $lang->point_recal_finished = 'Đã kết thúc việc tính toán lại điểm.'; +?> diff --git a/modules/point/lang/zh-CN.lang.php b/modules/point/lang/zh-CN.lang.php index b5790224d..12ff9a266 100644 --- a/modules/point/lang/zh-CN.lang.php +++ b/modules/point/lang/zh-CN.lang.php @@ -1,68 +1,68 @@ -point = "积分"; - $lang->level = "级别"; - - $lang->about_point_module = "积分系统可以在发表新帖及评论,上传/下载文件等动作时,付与其相应的积分的模块。"; - $lang->about_act_config = "版面,博客等模块都有发表/删除新帖,发表/删除评论等动作。
    要想与版面/博客之外的模块关联积分功能时,添加与其各模块功能相适合的act值即可。"; - - $lang->max_level = '最高级别'; - $lang->about_max_level = '可以指定最高级别。级别共设1000级,因此制作级别图标时要好好考虑一下。'; - - $lang->level_icon = '级别图标'; - $lang->about_level_icon = '级别图标要以 ./modules/point/icons/级别.gif形式指定,有时出现最高级别的图标跟您指定的最高级别图标不同的现象,敬请注意。'; - - $lang->point_name = '积分名'; - $lang->about_point_name = '可以指定积分名或积分单位。'; - - $lang->level_point = '级别积分'; - $lang->about_level_point = '积分达到或减少到下列各级别所设置的积分值时,将会自动调节相应级别。'; - - $lang->disable_download = '禁止下载'; - $lang->about_disable_download = '没有积分时,将禁止下载。 (图片除外)'; - $lang->disable_read_document = '禁止查看主题'; - $lang->about_disable_read_document = '没有积分时,将禁止查看主题。'; - - $lang->level_point_calc = '计算级别积分'; - $lang->expression = '使用级别变数"i"输入JS数学函数。例: Math.pow(i, 2) * 90'; - $lang->cmd_exp_calc = '计算'; - $lang->cmd_exp_reset = '初始化'; - - $lang->cmd_point_recal = '积分初始化'; - $lang->about_cmd_point_recal = '积分初始化。即只保留文章/评论/附件/新会员注册的相关积分项。
    其中,初始化后的新会员注册积分项,将在会员有相关动作(发表主题/评论等)时,才付与其相应的积分。
    此项功能请务必慎用!此项功能只能在数据转移或真的需要初始化所有积分时才可以使用。'; - - $lang->point_link_group = '用户组绑定'; - $lang->point_group_reset_and_add = '初始化已有用户组重新设置'; - $lang->point_group_add_only = '只应用到新用户组'; - $lang->about_point_link_group = '即级别绑定用户组。当级别达到指定级别时,会员所属用户组将自动更新为与其相对应的用户组。'; - - $lang->about_module_point = '可以分别对各模块进行积分设置,没有被设置的模块将使用默认值。
    所有积分在相反动作下恢复原始值。即:发表新帖后再删除得到的积分为0分。'; - - $lang->point_signup = '注册'; - $lang->point_insert_document = '发表新帖'; - $lang->point_delete_document = '删除主题'; - $lang->point_insert_comment = '发表评论'; - $lang->point_delete_comment = '删除评论'; - $lang->point_upload_file = '上传文件'; - $lang->point_delete_file = '删除文件'; - $lang->point_download_file = '下载文件 (图片除外)'; - $lang->point_read_document = '查看主题'; - $lang->point_voted = '推荐'; - $lang->point_blamed = '反对'; - - $lang->cmd_point_config = '常规选项'; - $lang->cmd_point_module_config = '对象模块设置'; - $lang->cmd_point_act_config = '功能act设置'; - $lang->cmd_point_member_list = '会员积分目录'; - - $lang->msg_cannot_download = '积分不足无法下载!'; - $lang->msg_disallow_by_point = "积分不够,无法查看主题。(所需积分 : %d, 当前积分 : %d)"; - - $lang->point_recal_message = '计算并应用中(%d / %d)。'; - $lang->point_recal_finished = '积分重新计算并应用完毕。'; -?> +point = "积分"; + $lang->level = "级别"; + + $lang->about_point_module = "积分系统可以在发表新帖及评论,上传/下载文件等动作时,付与其相应的积分的模块。"; + $lang->about_act_config = "版面,博客等模块都有发表/删除新帖,发表/删除评论等动作。
    要想与版面/博客之外的模块关联积分功能时,添加与其各模块功能相适合的act值即可。"; + + $lang->max_level = '最高级别'; + $lang->about_max_level = '可以指定最高级别。级别共设1000级,因此制作级别图标时要好好考虑一下。'; + + $lang->level_icon = '级别图标'; + $lang->about_level_icon = '级别图标要以 ./modules/point/icons/级别.gif形式指定,有时出现最高级别的图标跟您指定的最高级别图标不同的现象,敬请注意。'; + + $lang->point_name = '积分名'; + $lang->about_point_name = '可以指定积分名或积分单位。'; + + $lang->level_point = '级别积分'; + $lang->about_level_point = '积分达到或减少到下列各级别所设置的积分值时,将会自动调节相应级别。'; + + $lang->disable_download = '禁止下载'; + $lang->about_disable_download = '没有积分时,将禁止下载。 (图片除外)'; + $lang->disable_read_document = '禁止查看主题'; + $lang->about_disable_read_document = '没有积分时,将禁止查看主题。'; + + $lang->level_point_calc = '计算级别积分'; + $lang->expression = '使用级别变数"i"输入JS数学函数。例: Math.pow(i, 2) * 90'; + $lang->cmd_exp_calc = '计算'; + $lang->cmd_exp_reset = '初始化'; + + $lang->cmd_point_recal = '积分初始化'; + $lang->about_cmd_point_recal = '积分初始化。即只保留文章/评论/附件/新会员注册的相关积分项。
    其中,初始化后的新会员注册积分项,将在会员有相关动作(发表主题/评论等)时,才付与其相应的积分。
    此项功能请务必慎用!此项功能只能在数据转移或真的需要初始化所有积分时才可以使用。'; + + $lang->point_link_group = '用户组绑定'; + $lang->point_group_reset_and_add = '初始化已有用户组重新设置'; + $lang->point_group_add_only = '只应用到新用户组'; + $lang->about_point_link_group = '即级别绑定用户组。当级别达到指定级别时,会员所属用户组将自动更新为与其相对应的用户组。'; + + $lang->about_module_point = '可以分别对各模块进行积分设置,没有被设置的模块将使用默认值。
    所有积分在相反动作下恢复原始值。即:发表新帖后再删除得到的积分为0分。'; + + $lang->point_signup = '注册'; + $lang->point_insert_document = '发表新帖'; + $lang->point_delete_document = '删除主题'; + $lang->point_insert_comment = '发表评论'; + $lang->point_delete_comment = '删除评论'; + $lang->point_upload_file = '上传文件'; + $lang->point_delete_file = '删除文件'; + $lang->point_download_file = '下载文件 (图片除外)'; + $lang->point_read_document = '查看主题'; + $lang->point_voted = '推荐'; + $lang->point_blamed = '反对'; + + $lang->cmd_point_config = '常规选项'; + $lang->cmd_point_module_config = '对象模块设置'; + $lang->cmd_point_act_config = '功能act设置'; + $lang->cmd_point_member_list = '会员积分目录'; + + $lang->msg_cannot_download = '积分不足无法下载!'; + $lang->msg_disallow_by_point = "积分不够,无法查看主题。(所需积分 : %d, 当前积分 : %d)"; + + $lang->point_recal_message = '计算并应用中(%d / %d)。'; + $lang->point_recal_finished = '积分重新计算并应用完毕。'; +?> diff --git a/modules/point/lang/zh-TW.lang.php b/modules/point/lang/zh-TW.lang.php index c09e1d9ea..93185d25f 100644 --- a/modules/point/lang/zh-TW.lang.php +++ b/modules/point/lang/zh-TW.lang.php @@ -1,69 +1,69 @@ -point = "點數"; - $lang->level = "等級"; - - $lang->about_point_module = "點數系統可以在發表/刪除主題,發表/刪除評論,上傳/下載/刪除/檔案等動作時,付出相對應的點數。"; - $lang->about_act_config = "討論板,部落格等模組都有發表/刪除主題,發表/刪除評論等動作。
    想要與討論板/部落格之外的模組關聯點數功能時,新增與其各模組功能適合的act值即可。"; - - $lang->max_level = '最高等級'; - $lang->about_max_level = '可以指定最高等級。等級共設1000級,因此製作等級圖示時要好好考慮一下。'; - - $lang->level_icon = '等級圖示'; - $lang->about_level_icon = '等級圖示格式與位置 ./modules/point/icons/等級.gif,請注意,有時出現最高等級的圖示跟您指定的最高等級圖示不同的現象。'; - - $lang->point_name = '點數名稱'; - $lang->about_point_name = '可指定點數名稱或點數單位。'; - - $lang->level_point = '等級點數'; - $lang->about_level_point = '點數達到或減少到下列各等級所設置的點數時,將會自動調節相對應等級。'; - - $lang->disable_download = '禁止下載'; - $lang->about_disable_download = '沒有點數時,將禁止下載。(圖片除外)'; - $lang->disable_read_document = '禁止閱讀文章'; - $lang->about_disable_read_document = '沒有點數時,將禁止閱讀文章。'; - - $lang->level_point_calc = '計算等級點數'; - $lang->expression = '使用等級變數"i"輸入JS數學函數。例: Math.pow(i,2) * 90'; - $lang->cmd_exp_calc = '計算'; - $lang->cmd_exp_reset = '重置'; - - $lang->cmd_point_recal = '重置點數'; - $lang->about_cmd_point_recal = '重置點數。即只保留文章/評論/附加檔案/新會員註冊的相關點數項目。
    其中,重置後的新會員註冊點數,將在會員有相關動作(例如:發表主題/評論等)時,才付與其相對應的點數。
    此項功能請務必慎用!此項功能只能在資料轉移或真的需要重置所有點數時才可以使用。'; - - $lang->point_link_group = '自動升級'; - $lang->point_group_reset_and_add = '重新調整與新增群組'; - $lang->point_group_add_only = '只限新群組'; - $lang->about_point_link_group = '即群組隨等級變化。當等級達到指定等級時,會員所屬群組將自動更新成相對應的群組。'; - - $lang->about_module_point = '可以分別對各模組進行點數設置,沒有設置的模組將使用預設值。
    所有動作在反向操作下將恢復原始值。即:發表主題後再刪除得到的點數為零。'; - - $lang->point_signup = '註冊'; - $lang->point_insert_document = '發表主題'; - $lang->point_delete_document = '刪除主題'; - $lang->point_insert_comment = '發表評論'; - $lang->point_delete_comment = '刪除評論'; - $lang->point_upload_file = '上傳檔案'; - $lang->point_delete_file = '刪除檔案'; - $lang->point_download_file = '下載檔案 (圖片除外)'; - $lang->point_read_document = '檢視主題'; - $lang->point_voted = '推薦'; - $lang->point_blamed = '反對'; - - - $lang->cmd_point_config = '基本設置'; - $lang->cmd_point_module_config = '目標模組設置'; - $lang->cmd_point_act_config = 'Act設置'; - $lang->cmd_point_member_list = '會員點數列表'; - - $lang->msg_cannot_download = '點數不足無法下載!'; - $lang->msg_disallow_by_point = "點數不足無法閱讀文章 (需要 : %d, 目前 : %d)"; - - $lang->point_recal_message = '計算並套用中(%d / %d)。'; - $lang->point_recal_finished = '點數重新計算並套用完畢。'; -?> +point = "點數"; + $lang->level = "等級"; + + $lang->about_point_module = "點數系統可以在發表/刪除主題,發表/刪除評論,上傳/下載/刪除/檔案等動作時,付出相對應的點數。"; + $lang->about_act_config = "討論板,部落格等模組都有發表/刪除主題,發表/刪除評論等動作。
    想要與討論板/部落格之外的模組關聯點數功能時,新增與其各模組功能適合的act值即可。"; + + $lang->max_level = '最高等級'; + $lang->about_max_level = '可以指定最高等級。等級共設1000級,因此製作等級圖示時要好好考慮一下。'; + + $lang->level_icon = '等級圖示'; + $lang->about_level_icon = '等級圖示格式與位置 ./modules/point/icons/等級.gif,請注意,有時出現最高等級的圖示跟您指定的最高等級圖示不同的現象。'; + + $lang->point_name = '點數名稱'; + $lang->about_point_name = '可指定點數名稱或點數單位。'; + + $lang->level_point = '等級點數'; + $lang->about_level_point = '點數達到或減少到下列各等級所設置的點數時,將會自動調節相對應等級。'; + + $lang->disable_download = '禁止下載'; + $lang->about_disable_download = '沒有點數時,將禁止下載。(圖片除外)'; + $lang->disable_read_document = '禁止閱讀文章'; + $lang->about_disable_read_document = '沒有點數時,將禁止閱讀文章。'; + + $lang->level_point_calc = '計算等級點數'; + $lang->expression = '使用等級變數"i"輸入JS數學函數。例: Math.pow(i,2) * 90'; + $lang->cmd_exp_calc = '計算'; + $lang->cmd_exp_reset = '重置'; + + $lang->cmd_point_recal = '重置點數'; + $lang->about_cmd_point_recal = '重置點數。即只保留文章/評論/附加檔案/新會員註冊的相關點數項目。
    其中,重置後的新會員註冊點數,將在會員有相關動作(例如:發表主題/評論等)時,才付與其相對應的點數。
    此項功能請務必慎用!此項功能只能在資料轉移或真的需要重置所有點數時才可以使用。'; + + $lang->point_link_group = '自動升級'; + $lang->point_group_reset_and_add = '重新調整與新增群組'; + $lang->point_group_add_only = '只限新群組'; + $lang->about_point_link_group = '即群組隨等級變化。當等級達到指定等級時,會員所屬群組將自動更新成相對應的群組。'; + + $lang->about_module_point = '可以分別對各模組進行點數設置,沒有設置的模組將使用預設值。
    所有動作在反向操作下將恢復原始值。即:發表主題後再刪除得到的點數為零。'; + + $lang->point_signup = '註冊'; + $lang->point_insert_document = '發表主題'; + $lang->point_delete_document = '刪除主題'; + $lang->point_insert_comment = '發表評論'; + $lang->point_delete_comment = '刪除評論'; + $lang->point_upload_file = '上傳檔案'; + $lang->point_delete_file = '刪除檔案'; + $lang->point_download_file = '下載檔案 (圖片除外)'; + $lang->point_read_document = '檢視主題'; + $lang->point_voted = '推薦'; + $lang->point_blamed = '反對'; + + + $lang->cmd_point_config = '基本設置'; + $lang->cmd_point_module_config = '目標模組設置'; + $lang->cmd_point_act_config = 'Act設置'; + $lang->cmd_point_member_list = '會員點數列表'; + + $lang->msg_cannot_download = '點數不足無法下載!'; + $lang->msg_disallow_by_point = "點數不足無法閱讀文章 (需要 : %d, 目前 : %d)"; + + $lang->point_recal_message = '計算並套用中(%d / %d)。'; + $lang->point_recal_finished = '點數重新計算並套用完畢。'; +?> diff --git a/modules/point/point.admin.controller.php b/modules/point/point.admin.controller.php index 78b52f1ca..bba7f823d 100644 --- a/modules/point/point.admin.controller.php +++ b/modules/point/point.admin.controller.php @@ -1,311 +1,311 @@ -getModuleConfig('point'); - - // 변수 정리 - $args = Context::getRequestVars(); - - // 포인트 이름 체크 - $config->point_name = $args->point_name; - if(!$config->point_name) $config->point_name = 'point'; - - // 기본 포인트 지정 - $config->signup_point = (int)$args->signup_point; - $config->login_point = (int)$args->login_point; - $config->insert_document = (int)$args->insert_document; - $config->read_document = (int)$args->read_document; - $config->insert_comment = (int)$args->insert_comment; - $config->upload_file = (int)$args->upload_file; - $config->download_file = (int)$args->download_file; - $config->voted = (int)$args->voted; - $config->blamed = (int)$args->blamed; - - // 최고 레벨 - $config->max_level = $args->max_level; - if($config->max_level>1000) $config->max_level = 1000; - if($config->max_level<1) $config->max_level = 1; - - // 레벨 아이콘 설정 - $config->level_icon = $args->level_icon; - - // 포인트 미달시 다운로드 금지 여부 체크 - if($args->disable_download == 'Y') $config->disable_download = 'Y'; - else $config->disable_download = 'N'; - - // 포인트 미달시 글 열람 금지 여부 체크 - if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y'; - else $config->disable_read_document = 'N'; - - // 레벨별 그룹 설정 - foreach($args as $key => $val) { - if(substr($key, 0, strlen('point_group_')) != 'point_group_') continue; - $group_srl = substr($key, strlen('point_group_')); - $level = $val; - if(!$level) unset($config->point_group[$group_srl]); - else $config->point_group[$group_srl] = $level; - } - $config->group_reset = $args->group_reset; - - // 레벨별 포인트 설정 - unset($config->level_step); - for($i=1;$i<=$config->max_level;$i++) { - $key = "level_step_".$i; - $config->level_step[$i] = (int)$args->{$key}; - } - - // 레벨별 포인트 계산 함수 - $config->expression = $args->expression; - - // 저장 - $oModuleController = &getController('module'); - $oModuleController->insertModuleConfig('point', $config); - - $this->cacheActList(); - - $this->setMessage('success_updated'); - } - - /** - * @brief 모듈별 설정 저장 - **/ - function procPointAdminInsertModuleConfig() { - $args = Context::getRequestVars(); - - foreach($args as $key => $val) { - preg_match("/^(insert_document|insert_comment|upload_file|download_file|read_document|voted|blamed)_([0-9]+)$/", $key, $matches); - if(!$matches[1]) continue; - $name = $matches[1]; - $module_srl = $matches[2]; - if(strlen($val)>0) $module_config[$module_srl][$name] = (int)$val; - } - - $oModuleController = &getController('module'); - if(count($module_config)) { - foreach($module_config as $module_srl => $config) { - $oModuleController->insertModulePartConfig('point',$module_srl,$config); - } - } - - $this->cacheActList(); - - $this->setMessage('success_updated'); - } - - /** - * @brief 모듈별 개별 포인트 저장 - **/ - function procPointAdminInsertPointModuleConfig() { - $module_srl = Context::get('target_module_srl'); - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); - - // 여러개의 모듈 일괄 설정일 경우 - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); - else $module_srl = array($module_srl); - - // 설정 저장 - $oModuleController = &getController('module'); - for($i=0;$iinsertModulePartConfig('point', $srl, $config); - } - - $this->setError(-1); - $this->setMessage('success_updated'); - } - - /** - * @brief 회원 포인트 변경 - **/ - function procPointAdminUpdatePoint() { - $action = Context::get('action'); - $member_srl = Context::get('member_srl'); - $point = Context::get('point'); - - $oPointController = &getController('point'); - return $oPointController->setPoint($member_srl, (int)$point, $action); - } - - /** - * @brief 전체글/ 댓글/ 첨부파일과 가입정보를 바탕으로 포인트를 재계산함. 단 로그인 점수는 1번만 부여됨 - **/ - function procPointAdminReCal() { - set_time_limit(0); - - // 모듈별 포인트 정보를 가져옴 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - - $module_config = $oModuleModel->getModulePartConfigs('point'); - - // 회원의 포인트 저장을 위한 변수 - $member = array(); - - // 게시글 정보를 가져옴 - $output = executeQueryArray('point.getDocumentPoint'); - if(!$output->toBool()) return $output; - - if($output->data) { - foreach($output->data as $key => $val) { - if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document']; - else $insert_point = $config->insert_document; - - if(!$val->member_srl) continue; - $point = $insert_point * $val->count; - $member[$val->member_srl] += $point; - } - } - $output = null; - - // 댓글 정보를 가져옴 - $output = executeQueryArray('point.getCommentPoint'); - if(!$output->toBool()) return $output; - - if($output->data) { - foreach($output->data as $key => $val) { - if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment']; - else $insert_point = $config->insert_comment; - - if(!$val->member_srl) continue; - $point = $insert_point * $val->count; - $member[$val->member_srl] += $point; - } - } - $output = null; - - // 첨부파일 정보를 가져옴 - $output = executeQueryArray('point.getFilePoint'); - if(!$output->toBool()) return $output; - - if($output->data) { - foreach($output->data as $key => $val) { - if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file']; - else $insert_point = $config->upload_file; - - if(!$val->member_srl) continue; - $point = $insert_point * $val->count; - $member[$val->member_srl] += $point; - } - } - $output = null; - - // 모든 회원의 포인트를 0으로 세팅 - $output = executeQuery("point.initMemberPoint"); - if(!$output->toBool()) return $output; - - // 임시로 파일 저장 - $f = fopen("./files/cache/pointRecal.txt","w"); - foreach($member as $key => $val) { - $val += (int)$config->signup_point; - fwrite($f, $key.','.$val."\r\n"); - } - fclose($f); - - $this->add('total', count($member)); - $this->add('position', 0); - $this->setMessage( sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')) ); - } - - /** - * @brief 파일로 저장한 회원 포인트를 5000명 단위로 적용 - **/ - function procPointAdminApplyPoint() { - $position = (int)Context::get('position'); - $total = (int)Context::get('total'); - - if(!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request'); - - $idx = 0; - $f = fopen("./files/cache/pointRecal.txt","r"); - while(!feof($f)) { - $str = trim(fgets($f, 1024)); - $idx ++; - if($idx > $position) { - list($member_srl, $point) = explode(',',$str); - - $args = null; - $args->member_srl = $member_srl; - $args->point = $point; - $output = executeQuery('point.insertPoint',$args); - if($idx%5000==0) break; - } - } - - if(feof($f)) { - FileHandler::removeFile('./files/cache/pointRecal.txt'); - $idx = $total; - - FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old'); - - FileHandler::removeDir('./files/member_extra_info/point.old'); - } - fclose($f); - - - $this->add('total', $total); - $this->add('position', $idx); - $this->setMessage(sprintf(Context::getLang('point_recal_message'), $idx, $total)); - - } - - /** - * @brief 개별 모듈의 포인트 리셋 - **/ - function procPointAdminReset() { - $module_srl = Context::get('module_srls'); - if(!$module_srl) return new Object(-1, 'msg_invalid_request'); - - // 여러개의 모듈 일괄 설정일 경우 - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); - else $module_srl = array($module_srl); - - // 설정 저장 - $oModuleController = &getController('module'); - for($i=0;$imodule = 'point'; - $args->module_srl = $srl; - executeQuery('module.deleteModulePartConfig', $args); - } - - $this->setMessage('success_updated'); - } - - /** - * @brief 캐시파일 저장 - **/ - function cacheActList() { - return; - } - - } -?> +getModuleConfig('point'); + + // 변수 정리 + $args = Context::getRequestVars(); + + // 포인트 이름 체크 + $config->point_name = $args->point_name; + if(!$config->point_name) $config->point_name = 'point'; + + // 기본 포인트 지정 + $config->signup_point = (int)$args->signup_point; + $config->login_point = (int)$args->login_point; + $config->insert_document = (int)$args->insert_document; + $config->read_document = (int)$args->read_document; + $config->insert_comment = (int)$args->insert_comment; + $config->upload_file = (int)$args->upload_file; + $config->download_file = (int)$args->download_file; + $config->voted = (int)$args->voted; + $config->blamed = (int)$args->blamed; + + // 최고 레벨 + $config->max_level = $args->max_level; + if($config->max_level>1000) $config->max_level = 1000; + if($config->max_level<1) $config->max_level = 1; + + // 레벨 아이콘 설정 + $config->level_icon = $args->level_icon; + + // 포인트 미달시 다운로드 금지 여부 체크 + if($args->disable_download == 'Y') $config->disable_download = 'Y'; + else $config->disable_download = 'N'; + + // 포인트 미달시 글 열람 금지 여부 체크 + if($args->disable_read_document == 'Y') $config->disable_read_document = 'Y'; + else $config->disable_read_document = 'N'; + + // 레벨별 그룹 설정 + foreach($args as $key => $val) { + if(substr($key, 0, strlen('point_group_')) != 'point_group_') continue; + $group_srl = substr($key, strlen('point_group_')); + $level = $val; + if(!$level) unset($config->point_group[$group_srl]); + else $config->point_group[$group_srl] = $level; + } + $config->group_reset = $args->group_reset; + + // 레벨별 포인트 설정 + unset($config->level_step); + for($i=1;$i<=$config->max_level;$i++) { + $key = "level_step_".$i; + $config->level_step[$i] = (int)$args->{$key}; + } + + // 레벨별 포인트 계산 함수 + $config->expression = $args->expression; + + // 저장 + $oModuleController = &getController('module'); + $oModuleController->insertModuleConfig('point', $config); + + $this->cacheActList(); + + $this->setMessage('success_updated'); + } + + /** + * @brief 모듈별 설정 저장 + **/ + function procPointAdminInsertModuleConfig() { + $args = Context::getRequestVars(); + + foreach($args as $key => $val) { + preg_match("/^(insert_document|insert_comment|upload_file|download_file|read_document|voted|blamed)_([0-9]+)$/", $key, $matches); + if(!$matches[1]) continue; + $name = $matches[1]; + $module_srl = $matches[2]; + if(strlen($val)>0) $module_config[$module_srl][$name] = (int)$val; + } + + $oModuleController = &getController('module'); + if(count($module_config)) { + foreach($module_config as $module_srl => $config) { + $oModuleController->insertModulePartConfig('point',$module_srl,$config); + } + } + + $this->cacheActList(); + + $this->setMessage('success_updated'); + } + + /** + * @brief 모듈별 개별 포인트 저장 + **/ + function procPointAdminInsertPointModuleConfig() { + $module_srl = Context::get('target_module_srl'); + if(!$module_srl) return new Object(-1, 'msg_invalid_request'); + + // 여러개의 모듈 일괄 설정일 경우 + if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); + else $module_srl = array($module_srl); + + // 설정 저장 + $oModuleController = &getController('module'); + for($i=0;$iinsertModulePartConfig('point', $srl, $config); + } + + $this->setError(-1); + $this->setMessage('success_updated'); + } + + /** + * @brief 회원 포인트 변경 + **/ + function procPointAdminUpdatePoint() { + $action = Context::get('action'); + $member_srl = Context::get('member_srl'); + $point = Context::get('point'); + + $oPointController = &getController('point'); + return $oPointController->setPoint($member_srl, (int)$point, $action); + } + + /** + * @brief 전체글/ 댓글/ 첨부파일과 가입정보를 바탕으로 포인트를 재계산함. 단 로그인 점수는 1번만 부여됨 + **/ + function procPointAdminReCal() { + set_time_limit(0); + + // 모듈별 포인트 정보를 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + + $module_config = $oModuleModel->getModulePartConfigs('point'); + + // 회원의 포인트 저장을 위한 변수 + $member = array(); + + // 게시글 정보를 가져옴 + $output = executeQueryArray('point.getDocumentPoint'); + if(!$output->toBool()) return $output; + + if($output->data) { + foreach($output->data as $key => $val) { + if($module_config[$val->module_srl]['insert_document']) $insert_point = $module_config[$val->module_srl]['insert_document']; + else $insert_point = $config->insert_document; + + if(!$val->member_srl) continue; + $point = $insert_point * $val->count; + $member[$val->member_srl] += $point; + } + } + $output = null; + + // 댓글 정보를 가져옴 + $output = executeQueryArray('point.getCommentPoint'); + if(!$output->toBool()) return $output; + + if($output->data) { + foreach($output->data as $key => $val) { + if($module_config[$val->module_srl]['insert_comment']) $insert_point = $module_config[$val->module_srl]['insert_comment']; + else $insert_point = $config->insert_comment; + + if(!$val->member_srl) continue; + $point = $insert_point * $val->count; + $member[$val->member_srl] += $point; + } + } + $output = null; + + // 첨부파일 정보를 가져옴 + $output = executeQueryArray('point.getFilePoint'); + if(!$output->toBool()) return $output; + + if($output->data) { + foreach($output->data as $key => $val) { + if($module_config[$val->module_srl]['upload_file']) $insert_point = $module_config[$val->module_srl]['upload_file']; + else $insert_point = $config->upload_file; + + if(!$val->member_srl) continue; + $point = $insert_point * $val->count; + $member[$val->member_srl] += $point; + } + } + $output = null; + + // 모든 회원의 포인트를 0으로 세팅 + $output = executeQuery("point.initMemberPoint"); + if(!$output->toBool()) return $output; + + // 임시로 파일 저장 + $f = fopen("./files/cache/pointRecal.txt","w"); + foreach($member as $key => $val) { + $val += (int)$config->signup_point; + fwrite($f, $key.','.$val."\r\n"); + } + fclose($f); + + $this->add('total', count($member)); + $this->add('position', 0); + $this->setMessage( sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')) ); + } + + /** + * @brief 파일로 저장한 회원 포인트를 5000명 단위로 적용 + **/ + function procPointAdminApplyPoint() { + $position = (int)Context::get('position'); + $total = (int)Context::get('total'); + + if(!file_exists('./files/cache/pointRecal.txt')) return new Object(-1, 'msg_invalid_request'); + + $idx = 0; + $f = fopen("./files/cache/pointRecal.txt","r"); + while(!feof($f)) { + $str = trim(fgets($f, 1024)); + $idx ++; + if($idx > $position) { + list($member_srl, $point) = explode(',',$str); + + $args = null; + $args->member_srl = $member_srl; + $args->point = $point; + $output = executeQuery('point.insertPoint',$args); + if($idx%5000==0) break; + } + } + + if(feof($f)) { + FileHandler::removeFile('./files/cache/pointRecal.txt'); + $idx = $total; + + FileHandler::rename('./files/member_extra_info/point','./files/member_extra_info/point.old'); + + FileHandler::removeDir('./files/member_extra_info/point.old'); + } + fclose($f); + + + $this->add('total', $total); + $this->add('position', $idx); + $this->setMessage(sprintf(Context::getLang('point_recal_message'), $idx, $total)); + + } + + /** + * @brief 개별 모듈의 포인트 리셋 + **/ + function procPointAdminReset() { + $module_srl = Context::get('module_srls'); + if(!$module_srl) return new Object(-1, 'msg_invalid_request'); + + // 여러개의 모듈 일괄 설정일 경우 + if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); + else $module_srl = array($module_srl); + + // 설정 저장 + $oModuleController = &getController('module'); + for($i=0;$imodule = 'point'; + $args->module_srl = $srl; + executeQuery('module.deleteModulePartConfig', $args); + } + + $this->setMessage('success_updated'); + } + + /** + * @brief 캐시파일 저장 + **/ + function cacheActList() { + return; + } + + } +?> diff --git a/modules/point/point.admin.view.php b/modules/point/point.admin.view.php index ec4507b79..d999683ac 100644 --- a/modules/point/point.admin.view.php +++ b/modules/point/point.admin.view.php @@ -1,101 +1,101 @@ -getModuleConfig('point'); - - // 설정 변수 지정 - Context::set('config', $config); - - // template path지정 - $this->setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 기본 설정 - **/ - function dispPointAdminConfig() { - // 레벨 아이콘 목록 구함 - $level_icon_list = FileHandler::readDir("./modules/point/icons"); - Context::set('level_icon_list', $level_icon_list); - - // 그룹 목록 가져오기 - $oMemberModel = &getModel('member'); - $group_list = $oMemberModel->getGroups(); - $selected_group_list = array(); - if(count($group_list)) { - foreach($group_list as $key => $val) { - if($val->is_admin == 'Y' || $val->is_default == 'Y') continue; - $selected_group_list[$key] = $val; - } - } - Context::set('group_list', $selected_group_list); - - // 템플릿 지정 - $this->setTemplateFile('config'); - } - - /** - * @brief 모듈별 점수 지정 - **/ - function dispPointAdminModuleConfig() { - // mid 목록 가져오기 - $oModuleModel = &getModel('module'); - $mid_list = $oModuleModel->getMidList(); - Context::set('mid_list', $mid_list); - - Context::set('module_config', $oModuleModel->getModulePartConfigs('point')); - - // 템플릿 지정 - $this->setTemplateFile('module_config'); - } - - /** - * @brief 기능별 act 설정 - **/ - function dispPointAdminActConfig() { - // 템플릿 지정 - $this->setTemplateFile('action_config'); - } - - /** - * @brief 회원 포인트순 목록 가져오기 - **/ - function dispPointAdminPointList() { - $oPointModel = &getModel('point'); - - $args->list_count = 20; - $args->page = Context::get('page'); - - $output = $oPointModel->getMemberList($args); - - // 템플릿에 쓰기 위해서 context::set - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('member_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - // 멤버모델 객체 생성 - $oMemberModel = &getModel('member'); - - // group 목록 가져오기 - $this->group_list = $oMemberModel->getGroups(); - Context::set('group_list', $this->group_list); - - // 템플릿 지정 - $this->setTemplateFile('member_list'); - } - } -?> +getModuleConfig('point'); + + // 설정 변수 지정 + Context::set('config', $config); + + // template path지정 + $this->setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 기본 설정 + **/ + function dispPointAdminConfig() { + // 레벨 아이콘 목록 구함 + $level_icon_list = FileHandler::readDir("./modules/point/icons"); + Context::set('level_icon_list', $level_icon_list); + + // 그룹 목록 가져오기 + $oMemberModel = &getModel('member'); + $group_list = $oMemberModel->getGroups(); + $selected_group_list = array(); + if(count($group_list)) { + foreach($group_list as $key => $val) { + if($val->is_admin == 'Y' || $val->is_default == 'Y') continue; + $selected_group_list[$key] = $val; + } + } + Context::set('group_list', $selected_group_list); + + // 템플릿 지정 + $this->setTemplateFile('config'); + } + + /** + * @brief 모듈별 점수 지정 + **/ + function dispPointAdminModuleConfig() { + // mid 목록 가져오기 + $oModuleModel = &getModel('module'); + $mid_list = $oModuleModel->getMidList(); + Context::set('mid_list', $mid_list); + + Context::set('module_config', $oModuleModel->getModulePartConfigs('point')); + + // 템플릿 지정 + $this->setTemplateFile('module_config'); + } + + /** + * @brief 기능별 act 설정 + **/ + function dispPointAdminActConfig() { + // 템플릿 지정 + $this->setTemplateFile('action_config'); + } + + /** + * @brief 회원 포인트순 목록 가져오기 + **/ + function dispPointAdminPointList() { + $oPointModel = &getModel('point'); + + $args->list_count = 20; + $args->page = Context::get('page'); + + $output = $oPointModel->getMemberList($args); + + // 템플릿에 쓰기 위해서 context::set + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('member_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + // 멤버모델 객체 생성 + $oMemberModel = &getModel('member'); + + // group 목록 가져오기 + $this->group_list = $oMemberModel->getGroups(); + Context::set('group_list', $this->group_list); + + // 템플릿 지정 + $this->setTemplateFile('member_list'); + } + } +?> diff --git a/modules/point/point.class.php b/modules/point/point.class.php index 5df190bac..83a85381a 100644 --- a/modules/point/point.class.php +++ b/modules/point/point.class.php @@ -1,197 +1,197 @@ -max_level = 30; - - // 레벨별 점수 - for($i=1;$i<=30;$i++) { - $config->level_step[$i] = pow($i,2)*90; - } - - // 회원가입 - $config->signup_point = 10; - - // 로그인 가입 - $config->login_point = 5; - - // 포인트 호칭 - $config->point_name = 'point'; - - // 레벨 아이콘 디렉토리 - $config->level_icon = "default"; - - // 점수가 없을때 다운로드 금지 기능 - $config->disable_download = false; - - /** - * 모듈별 기본 점수 및 각 action 정의 (게시판,블로그외에 어떤 모듈이 생길지 모르니 act값을 명시한다 - **/ - - // 글작성 - $config->insert_document = 10; - - $config->insert_document_act = 'procBoardInsertDocument'; - $config->delete_document_act = 'procBoardDeleteDocument'; - - // 댓글작성 - $config->insert_comment = 5; - - $config->insert_comment_act = 'procBoardInsertComment,procBlogInsertComment'; - $config->delete_comment_act = 'procBoardDeleteComment,procBlogDeleteComment'; - - // 업로드 - $config->upload_file = 5; - - $config->upload_file_act = 'procFileUpload'; - $config->delete_file_act = 'procFileDelete'; - - // 다운로드 - $config->download_file = -5; - $config->download_file_act = 'procFileDownload'; - - // 조회 - $config->read_document = 0; - - // 추천 / 비추천 - $config->voted = 0; - $config->blamed = 0; - - // 설정 저장 - $oModuleController->insertModuleConfig('point', $config); - - // 빠른 실행을 위해서 act list를 캐싱 - $oPointController = &getAdminController('point'); - $oPointController->cacheActList(); - - // 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가 - $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); - $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); - $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); - $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); - $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); - $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); - $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); - $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); - $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); - $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); - $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); - $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); - $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); - - // 추천 / 비추천에 대한 트리거 추가 2008.05.13 haneul - $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); - - // 임시저장글을 정상 저장시 포인트 지급하도록 트리거 추가 2009. 05. 19 zero - $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - - // 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가 - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true; - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true; - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true; - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true; - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true; - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true; - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true; - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true; - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true; - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; - - // 추천 / 비추천에 대한 트리거 추가 2008.05.13 haneul - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true; - - // 임시저장글을 정상 저장시 포인트 지급하도록 트리거 추가 2009. 05. 19 zero - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - // 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가 - if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) - $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); - if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) - $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) - $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); - if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) - $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); - if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) - $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); - if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) - $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); - if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) - $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); - if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) - $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) - $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); - if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) - $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); - if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) - $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) - $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); - if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) - $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); - - // 추천 / 비추천에 대한 트리거 추가 2008.05.13 haneul - if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) - $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); - - // 임시저장글을 정상 저장시 포인트 지급하도록 트리거 추가 2009. 05. 19 zero - if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) - $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - // point action 파일 재정의 - $oPointAdminController = &getAdminController('point'); - $oPointAdminController->cacheActList(); - - } - } -?> +max_level = 30; + + // 레벨별 점수 + for($i=1;$i<=30;$i++) { + $config->level_step[$i] = pow($i,2)*90; + } + + // 회원가입 + $config->signup_point = 10; + + // 로그인 가입 + $config->login_point = 5; + + // 포인트 호칭 + $config->point_name = 'point'; + + // 레벨 아이콘 디렉토리 + $config->level_icon = "default"; + + // 점수가 없을때 다운로드 금지 기능 + $config->disable_download = false; + + /** + * 모듈별 기본 점수 및 각 action 정의 (게시판,블로그외에 어떤 모듈이 생길지 모르니 act값을 명시한다 + **/ + + // 글작성 + $config->insert_document = 10; + + $config->insert_document_act = 'procBoardInsertDocument'; + $config->delete_document_act = 'procBoardDeleteDocument'; + + // 댓글작성 + $config->insert_comment = 5; + + $config->insert_comment_act = 'procBoardInsertComment,procBlogInsertComment'; + $config->delete_comment_act = 'procBoardDeleteComment,procBlogDeleteComment'; + + // 업로드 + $config->upload_file = 5; + + $config->upload_file_act = 'procFileUpload'; + $config->delete_file_act = 'procFileDelete'; + + // 다운로드 + $config->download_file = -5; + $config->download_file_act = 'procFileDownload'; + + // 조회 + $config->read_document = 0; + + // 추천 / 비추천 + $config->voted = 0; + $config->blamed = 0; + + // 설정 저장 + $oModuleController->insertModuleConfig('point', $config); + + // 빠른 실행을 위해서 act list를 캐싱 + $oPointController = &getAdminController('point'); + $oPointController->cacheActList(); + + // 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가 + $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); + $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); + $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); + $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); + $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); + $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); + $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); + $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); + $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); + $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); + $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); + $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); + $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); + + // 추천 / 비추천에 대한 트리거 추가 2008.05.13 haneul + $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); + + // 임시저장글을 정상 저장시 포인트 지급하도록 트리거 추가 2009. 05. 19 zero + $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + + // 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가 + if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) return true; + if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) return true; + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) return true; + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) return true; + if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) return true; + if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) return true; + if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) return true; + if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) return true; + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) return true; + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) return true; + if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) return true; + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) return true; + if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) return true; + + // 추천 / 비추천에 대한 트리거 추가 2008.05.13 haneul + if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) return true; + + // 임시저장글을 정상 저장시 포인트 지급하도록 트리거 추가 2009. 05. 19 zero + if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // 가입/글작성/댓글작성/파일업로드/다운로드에 대한 트리거 추가 + if(!$oModuleModel->getTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after')) + $oModuleController->insertTrigger('member.insertMember', 'point', 'controller', 'triggerInsertMember', 'after'); + if(!$oModuleModel->getTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after')) + $oModuleController->insertTrigger('document.insertDocument', 'point', 'controller', 'triggerInsertDocument', 'after'); + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before')) + $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerBeforeDeleteDocument', 'before'); + if(!$oModuleModel->getTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after')) + $oModuleController->insertTrigger('document.deleteDocument', 'point', 'controller', 'triggerDeleteDocument', 'after'); + if(!$oModuleModel->getTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after')) + $oModuleController->insertTrigger('comment.insertComment', 'point', 'controller', 'triggerInsertComment', 'after'); + if(!$oModuleModel->getTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after')) + $oModuleController->insertTrigger('comment.deleteComment', 'point', 'controller', 'triggerDeleteComment', 'after'); + if(!$oModuleModel->getTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after')) + $oModuleController->insertTrigger('file.insertFile', 'point', 'controller', 'triggerInsertFile', 'after'); + if(!$oModuleModel->getTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after')) + $oModuleController->insertTrigger('file.deleteFile', 'point', 'controller', 'triggerDeleteFile', 'after'); + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before')) + $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerBeforeDownloadFile', 'before'); + if(!$oModuleModel->getTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after')) + $oModuleController->insertTrigger('file.downloadFile', 'point', 'controller', 'triggerDownloadFile', 'after'); + if(!$oModuleModel->getTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after')) + $oModuleController->insertTrigger('member.doLogin', 'point', 'controller', 'triggerAfterLogin', 'after'); + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after')) + $oModuleController->insertTrigger('module.dispAdditionSetup', 'point', 'view', 'triggerDispPointAdditionSetup', 'after'); + if(!$oModuleModel->getTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after')) + $oModuleController->insertTrigger('document.updateReadedCount', 'point', 'controller', 'triggerUpdateReadedCount', 'after'); + + // 추천 / 비추천에 대한 트리거 추가 2008.05.13 haneul + if(!$oModuleModel->getTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after')) + $oModuleController->insertTrigger('document.updateVotedCount', 'point', 'controller', 'triggerUpdateVotedCount', 'after'); + + // 임시저장글을 정상 저장시 포인트 지급하도록 트리거 추가 2009. 05. 19 zero + if(!$oModuleModel->getTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before')) + $oModuleController->insertTrigger('document.updateDocument', 'point', 'controller', 'triggerUpdateDocument', 'before'); + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + // point action 파일 재정의 + $oPointAdminController = &getAdminController('point'); + $oPointAdminController->cacheActList(); + + } + } +?> diff --git a/modules/point/point.controller.php b/modules/point/point.controller.php index 2be6a7172..c41566fd1 100644 --- a/modules/point/point.controller.php +++ b/modules/point/point.controller.php @@ -1,661 +1,661 @@ -getModuleConfig('point'); - - // 가입한 회원의 member_srl을 구함 - $member_srl = $obj->member_srl; - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - $point = $config->signup_point; - - // 포인트 증감 - $cur_point += $point; - $this->setPoint($member_srl,$cur_point, 'signup'); - - return new Object(); - } - - /** - * @brief 회원 로그인 포인트 적용 trigger - **/ - function triggerAfterLogin(&$obj) { - $member_srl = $obj->member_srl; - if(!$member_srl) return new Object(); - - // 바로 이전 로그인이 오늘이 아니어야 포인트를 줌 - if(substr($obj->last_login,0,8)==date("Ymd")) return new Object(); - - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - $point = $config->login_point; - - // 포인트 증감 - $cur_point += $point; - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 게시글 등록 포인트 적용 trigger - **/ - function triggerInsertDocument(&$obj) { - $module_srl = $obj->module_srl; - $member_srl = $obj->member_srl; - if(!$module_srl || !$member_srl) return new Object(); - - // 임시저장일 경우 포인트를 지급하지 않도록 수정 - if($module_srl == $member_srl) return new Object(); - - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point',$module_srl); - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - $point = $module_config['insert_document']; - if(!isset($point)) $point = $config->insert_document; - $cur_point += $point; - - // 첨부파일 등록에 대한 포인트 추가 - $point = $module_config['upload_file']; - if(!isset($point)) $point = $config->upload_file; - if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count; - - // 포인트 증감 - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 임시저장된 글을 정상 등록시 포인트 적용하는 trigger - * 1.2.3 에서 임시저장시에 포인트 지급되지 않도록 변경됨 - **/ - function triggerUpdateDocument(&$obj) { - $oDocumentModel = &getModel('document'); - $oModuleModel = &getModel('module'); - - $document_srl = $obj->document_srl; - $oDocument = $oDocumentModel->getDocument($document_srl); - - $module_srl = $oDocument->get('module_srl'); - $member_srl = $oDocument->get('member_srl'); - if(!$module_srl || !$member_srl) return new Object(); - - // 임시저장된 것이 아니면 return - if($module_srl != $member_srl) return new Object(); - - // point 모듈 정보 가져옴 - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point',$obj->module_srl); - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - $point = $module_config['insert_document']; - if(!isset($point)) $point = $config->insert_document; - $cur_point += $point; - - // 첨부파일 등록에 대한 포인트 추가 - $point = $module_config['upload_file']; - if(!isset($point)) $point = $config->upload_file; - if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count; - - // 포인트 증감 - $this->setPoint($member_srl,$cur_point); - - return new Object(); - - } - - /** - * @brief 게시글 삭제 이전에 게시글의 댓글에 대한 포인트 감소 처리를 하는 trigger - **/ - function triggerBeforeDeleteDocument(&$obj) { - $document_srl = $obj->document_srl; - $member_srl = $obj->member_srl; - - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists()) return new Object(); - - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point',$oDocument->get('module_srl')); - - // 지울 대상 글의 댓글에 대한 처리 - $comment_point = $module_config['insert_comment']; - if(!isset($comment_point)) $comment_point = $config->insert_comment; - - // 댓글 포인트가 있으면 증감(+) 이면 차감 시도 - if($comment_point>0) return new Object(); - - // 해당 글에 포함된 모든 댓글을 추출 - $cp_args->document_srl = $document_srl; - $output = executeQueryArray('point.getCommentUsers', $cp_args); - - // 대상이 없으면 return - if(!$output->data) return new Object(); - - // 대상 회원 번호를 정리 - $member_srls = array(); - $cnt = count($output->data); - for($i=0;$i<$cnt;$i++) { - if($output->data[$i]->member_srl<1) continue; - $member_srls[abs($output->data[$i]->member_srl)] = $output->data[$i]->count; - } - - // 원글 작성 회원의 번호는 제거 - if($member_srl) unset($member_srls[abs($member_srl)]); - if(!count($member_srls)) return new Object(); - - // 각 회원들을 모두 돌면서 포인트 감소 - $oPointModel = &getModel('point'); - - // 포인트를 구해옴 - $point = $module_config['download_file']; - foreach($member_srls as $member_srl => $cnt) { - $cur_point = $oPointModel->getPoint($member_srl, true); - $cur_point -= $cnt * $comment_point; - $this->setPoint($member_srl,$cur_point); - } - - return new Object(); - } - - /** - * @brief 게시글 삭제 포인트 적용 trigger - **/ - function triggerDeleteDocument(&$obj) { - $module_srl = $obj->module_srl; - $member_srl = $obj->member_srl; - - // 지울 대상 글에 대한 처리 - if(!$module_srl || !$member_srl) return new Object(); - - // 로그인 상태일때만 실행 - $logged_info = Context::get('logged_info'); - if(!$logged_info->member_srl) return new Object(); - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); - - $point = $module_config['insert_document']; - if(!isset($point)) $point = $config->insert_document; - - // 포인트가 마이너스 즉 글을 작성시 마다 차감되는 경우라면 글 삭제시 증가시켜주지 않도록 수정 - if($point < 0) return new Object(); - $cur_point -= $point; - - // 첨부파일 삭제에 대한 포인트 추가 - $point = $module_config['upload_file']; - if(!isset($point)) $point = $config->upload_file; - if($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count; - - // 포인트 증감 - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 댓글 등록 포인트 적용 trigger - **/ - function triggerInsertComment(&$obj) { - $module_srl = $obj->module_srl; - $member_srl = $obj->member_srl; - if(!$module_srl || !$member_srl) return new Object(); - - // 원글이 본인의 글이라면 포인트를 올리지 않음 - $document_srl = $obj->document_srl; - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists() || abs($oDocument->get('member_srl'))==abs($member_srl)) return new Object(); - - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - $point = $module_config['insert_comment']; - if(!isset($point)) $point = $config->insert_comment; - - // 포인트 증감 - $cur_point += $point; - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 댓글 삭제 포인트 적용 trigger - **/ - function triggerDeleteComment(&$obj) { - $oModuleModel = &getModel('module'); - $oPointModel = &getModel('point'); - $oDocumentModel = &getModel('document'); - - $module_srl = $obj->module_srl; - $member_srl = abs($obj->member_srl); - $document_srl = $obj->document_srl; - if(!$module_srl || !$member_srl) return new Object(); - - // 원글을 가져옴 (원글이 없거나 원글이 자신의 글이라면 포인트 적용 하지 않음) - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists()) return new Object(); - if($oDocument->get('member_srl')==$member_srl) return new Object(); - - // point 모듈 정보 가져옴 - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); - - // 대상 회원의 포인트를 구함 - $cur_point = $oPointModel->getPoint($member_srl, true); - - $point = $module_config['insert_comment']; - if(!isset($point)) $point = $config->insert_comment; - - // 포인트가 마이너스 즉 댓글을 작성시 마다 차감되는 경우라면 댓글 삭제시 증가시켜주지 않도록 수정 - if($point < 0) return new Object(); - - // 포인트 증감 - $cur_point -= $point; - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 파일 등록 trigger 추가 - * 비유효 파일의 등록에 의한 포인트 획득을 방지하고자 이 method는 일단 무효로 둠 - **/ - function triggerInsertFile(&$obj) { - return new Object(); - } - - /** - * @brief 파일 삭제 포인트 적용 trigger - * 유효파일을 삭제할 경우에만 포인트 삭제 - **/ - function triggerDeleteFile(&$obj) { - if($obj->isvalid != 'Y') return new Object(); - - $module_srl = $obj->module_srl; - $member_srl = $obj->member_srl; - if(!$module_srl || !$member_srl) return new Object(); - - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - $point = $module_config['upload_file']; - if(!isset($point)) $point = $config->upload_file; - - // 포인트 증감 - $cur_point -= $point; - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 파일 다운로드 전에 호출되는 trigger - **/ - function triggerBeforeDownloadFile(&$obj) { - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - $module_srl = $obj->module_srl; - if(!$module_srl) return new Object(); - - // 자신의 올린 파일이면 패스 - if(abs($obj->member_srl) == abs($member_srl)) return new Object(); - - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); - - // 포인트가 없으면 다운로드가 안되도록 하였으면 비로그인 회원일 경우 중지 - if(!Context::get('is_logged')) - { - if($config->disable_download == 'Y' && isset($module_config['download_file'])) return new Object(-1,'msg_not_permitted_download'); - else return new Object(); - } - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - // 포인트를 구해옴 - $point = $module_config['download_file']; - if(!isset($point)) $point = $config->download_file; - - // 포인트가 0보다 작고 포인트가 없으면 파일 다운로드가 안되도록 했다면 오류 - if($cur_point + $point < 0 && $config->disable_download == 'Y') return new Object(-1,'msg_not_permitted_download'); - - return new Object(); - } - - /** - * @brief 파일 다운로드 포인트 적용 trigger - **/ - function triggerDownloadFile(&$obj) { - // 로그인 상태일때만 실행 - $logged_info = Context::get('logged_info'); - if(!$logged_info->member_srl) return new Object(); - $module_srl = $obj->module_srl; - $member_srl = $logged_info->member_srl; - if(!$module_srl) return new Object(); - - // 자신의 올린 파일이면 패스 - if(abs($obj->member_srl) == abs($member_srl)) return new Object(); - - // point 모듈 정보 가져옴 - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); - - // 대상 회원의 포인트를 구함 - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - // 포인트를 구해옴 - $point = $module_config['download_file']; - if(!isset($point)) $point = $config->download_file; - - // 포인트 증감 - $cur_point += $point; - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 조회수 증가시 포인트 적용 - * 포인트가 없을때 조회를 하지 못하는 기능의 적용도 실행 - **/ - function triggerUpdateReadedCount(&$obj) { - $oModuleModel = &getModel('module'); - $oPointModel = &getModel('point'); - - // 접속자의 정보 구함 - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl; - - // 원글의 회원 번호 구함 - $target_member_srl = abs($obj->get('member_srl')); - - // 원글을 적은 이와 동일하면 조회수 올리지 않고 pass - if($target_member_srl == $member_srl) return new Object(); - - // 모듈별 point 정보 가져옴 - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point', $obj->get('module_srl')); - - // 조회 포인트를 구해옴 - $point = $module_config['read_document']; - if(!isset($point)) $point = $config->read_document; - - // 조회 포인트가 없으면 pass - if(!$point) return new Object(); - - // 회원일 경우 읽은 적이 있으면 그냥 pass 하고 그렇지 않으면 현재 포인트 구함 - if($member_srl) { - $args->member_srl = $member_srl; - $args->document_srl = $obj->document_srl; - $output = executeQuery('document.getDocumentReadedLogInfo', $args); - if($output->data->count) return new Object(); - $cur_point = $oPointModel->getPoint($member_srl, true); - } else { - $cur_point = 0; - } - - // 포인트 모듈 기본 설정 가져옴 - $config = $oModuleModel->getModuleConfig('point'); - - // 조회 포인트가 -(마이너스)일때 현재 포인트와 비교 - if($config->disable_read_document == 'Y' && $point < 0 && abs($point)>$cur_point) { - $obj->add('content', sprintf(Context::getLang('msg_disallow_by_point'), abs($point), $cur_point)); - return new Object(); - } - - // 로그인 사용자가 아니라면 pass - if(!$logged_info->member_srl) return new Object(); - - // 조회 포인트가 없으면 패스 - if(!$point) return new Object(); - - // 읽은 기록이 없으면 기록 남김 - $output = executeQuery('document.insertDocumentReadedLog', $args); - - // 포인트 증감 - $cur_point += $point; - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 추천/비추천 시 포인트 적용 - **/ - - function triggerUpdateVotedCount(&$obj) { - $module_srl = $obj->module_srl; - $member_srl = $obj->member_srl; - if(!$module_srl || !$member_srl) return new Object(); - - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); - - $oPointModel = &getModel('point'); - $cur_point = $oPointModel->getPoint($member_srl, true); - - if( $obj->point > 0 ) { - $point = $module_config['voted']; - if(!isset($point)) $point = $config->voted; - } else { - $point = $module_config['blamed']; - if(!isset($point)) $point = $config->blamed; - } - - if(!$point) return new Object(); - - // 포인트 증감 - $cur_point += $point; - $this->setPoint($member_srl,$cur_point); - - return new Object(); - } - - /** - * @brief 포인트 설정 - **/ - function setPoint($member_srl, $point, $mode = null) { - $member_srl = abs($member_srl); - $mode_arr = array('add', 'minus', 'update', 'signup'); - if(!$mode || !in_array($mode,$mode_arr)) $mode = 'update'; - - // 설정 정보 가져오기 - $oMemberModel = &getModel('member'); - $oModuleModel = &getModel('module'); - $oPointModel = &getModel('point'); - $config = $oModuleModel->getModuleConfig('point'); - - // 기존 포인트 정보를 구함 - $prev_point = $oPointModel->getPoint($member_srl, true); - $prev_level = $oPointModel->getLevel($prev_point, $config->level_step); - - // 포인트 변경 - $args->member_srl = $member_srl; - $args->point = $prev_point; - - switch($mode) { - - case 'add' : - $args->point += $point; - break; - case 'minus' : - $args->point -= $point; - break; - case 'update' : - $args->point = $point; - break; - case 'signup' : - $args->point = $point; - break; - } - if($args->point < 0) $args->point = 0; - $point = $args->point; - - // 포인트가 있으면 update, 없으면 insert - $oPointModel = &getModel('point'); - if($oPointModel->isExistsPoint($member_srl)) executeQuery("point.updatePoint", $args); - else executeQuery("point.insertPoint", $args); - - // 새로운 레벨을 구함 - $level = $oPointModel->getLevel($point, $config->level_step); - - // 기존 레벨과 새로운 레벨이 다르면 포인트 그룹 설정 시도 - if($level != $prev_level) { - - // 현재 포인트 대비하여 레벨을 계산하고 레벨에 맞는 그룹 설정을 체크 - $point_group = $config->point_group; - - // 포인트 그룹 정보가 있을때 시행 - if($point_group && is_array($point_group) && count($point_group) ) { - - // 기본 그룹을 구함 - $default_group = $oMemberModel->getDefaultGroup(); - - // 제거될 그룹과 새로 부여 받을 그룹을 구함 - $del_group_list = array(); - $new_group_srls = array(); - - asort($point_group); - - //그룹 초기화 후 재설정 - if($config->group_reset != 'N') { - //새로운 레벨에 맞는 그룹이 있다면 - if(in_array($level, $point_group)) { - //현재 레벨의 그룹을 제외한 나머지는 모두 삭제 - foreach($point_group as $group_srl => $target_level) { - $del_group_list[] = $group_srl; - if($target_level == $level) $new_group_srls[] = $group_srl; - } - } - //그렇지 않고 레벨 감소인 경우 바로 이전 그룹을 추가 - else { - $i = $level; - while($i > 0) { - if(in_array($i, $point_group)) { - foreach($point_group as $group_srl => $target_level) { - if ($target_level == $i) { - $new_group_srls[] = $group_srl; - } - } - $i = 0; - } - - $i--; - } - } - - //현재 레벨보다 높은 레벨의 그룹은 삭제 - foreach($point_group as $group_srl => $target_level) { - if($target_level > $level) $del_group_list[] = $group_srl; - } - } - //새 그룹만 부여 - else { - // 포인트 그룹 설정을 돌면서 현재 레벨까지 체크 - foreach($point_group as $group_srl => $target_level) { - $del_group_list[] = $group_srl; - if($target_level <= $level) $new_group_srls[] = $group_srl; - } - } - - // 만약 새로운 그룹이 없다면 기본 그룹을 부여 받음 - if(!$new_group_srls[0]) $new_group_srls[0] = $default_group->group_srl; - - // 연동 그룹 제거 - if($del_group_list && count($del_group_list)) { - $del_group_args->member_srl = $member_srl; - $del_group_args->group_srl = implode(',', $del_group_list); - $del_group_output = executeQuery('point.deleteMemberGroup', $del_group_args); - } - - // 새로운 그룹을 부여 - foreach($new_group_srls as $group_srl) { - $new_group_args->member_srl = $member_srl; - $new_group_args->group_srl = $group_srl; - executeQuery('member.addMemberToGroup', $new_group_args); - } - } - } - - // 캐시 설정 - $cache_path = sprintf('./files/member_extra_info/point/%s/', getNumberingPath($member_srl)); - FileHandler::makedir($cache_path); - - $cache_filename = sprintf('%s%d.cache.txt', $cache_path, $member_srl); - FileHandler::writeFile($cache_filename, $point); - - return $output; - } - } -?> +getModuleConfig('point'); + + // 가입한 회원의 member_srl을 구함 + $member_srl = $obj->member_srl; + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + $point = $config->signup_point; + + // 포인트 증감 + $cur_point += $point; + $this->setPoint($member_srl,$cur_point, 'signup'); + + return new Object(); + } + + /** + * @brief 회원 로그인 포인트 적용 trigger + **/ + function triggerAfterLogin(&$obj) { + $member_srl = $obj->member_srl; + if(!$member_srl) return new Object(); + + // 바로 이전 로그인이 오늘이 아니어야 포인트를 줌 + if(substr($obj->last_login,0,8)==date("Ymd")) return new Object(); + + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + $point = $config->login_point; + + // 포인트 증감 + $cur_point += $point; + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 게시글 등록 포인트 적용 trigger + **/ + function triggerInsertDocument(&$obj) { + $module_srl = $obj->module_srl; + $member_srl = $obj->member_srl; + if(!$module_srl || !$member_srl) return new Object(); + + // 임시저장일 경우 포인트를 지급하지 않도록 수정 + if($module_srl == $member_srl) return new Object(); + + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point',$module_srl); + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + $point = $module_config['insert_document']; + if(!isset($point)) $point = $config->insert_document; + $cur_point += $point; + + // 첨부파일 등록에 대한 포인트 추가 + $point = $module_config['upload_file']; + if(!isset($point)) $point = $config->upload_file; + if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count; + + // 포인트 증감 + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 임시저장된 글을 정상 등록시 포인트 적용하는 trigger + * 1.2.3 에서 임시저장시에 포인트 지급되지 않도록 변경됨 + **/ + function triggerUpdateDocument(&$obj) { + $oDocumentModel = &getModel('document'); + $oModuleModel = &getModel('module'); + + $document_srl = $obj->document_srl; + $oDocument = $oDocumentModel->getDocument($document_srl); + + $module_srl = $oDocument->get('module_srl'); + $member_srl = $oDocument->get('member_srl'); + if(!$module_srl || !$member_srl) return new Object(); + + // 임시저장된 것이 아니면 return + if($module_srl != $member_srl) return new Object(); + + // point 모듈 정보 가져옴 + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point',$obj->module_srl); + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + $point = $module_config['insert_document']; + if(!isset($point)) $point = $config->insert_document; + $cur_point += $point; + + // 첨부파일 등록에 대한 포인트 추가 + $point = $module_config['upload_file']; + if(!isset($point)) $point = $config->upload_file; + if($obj->uploaded_count) $cur_point += $point * $obj->uploaded_count; + + // 포인트 증감 + $this->setPoint($member_srl,$cur_point); + + return new Object(); + + } + + /** + * @brief 게시글 삭제 이전에 게시글의 댓글에 대한 포인트 감소 처리를 하는 trigger + **/ + function triggerBeforeDeleteDocument(&$obj) { + $document_srl = $obj->document_srl; + $member_srl = $obj->member_srl; + + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + if(!$oDocument->isExists()) return new Object(); + + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point',$oDocument->get('module_srl')); + + // 지울 대상 글의 댓글에 대한 처리 + $comment_point = $module_config['insert_comment']; + if(!isset($comment_point)) $comment_point = $config->insert_comment; + + // 댓글 포인트가 있으면 증감(+) 이면 차감 시도 + if($comment_point>0) return new Object(); + + // 해당 글에 포함된 모든 댓글을 추출 + $cp_args->document_srl = $document_srl; + $output = executeQueryArray('point.getCommentUsers', $cp_args); + + // 대상이 없으면 return + if(!$output->data) return new Object(); + + // 대상 회원 번호를 정리 + $member_srls = array(); + $cnt = count($output->data); + for($i=0;$i<$cnt;$i++) { + if($output->data[$i]->member_srl<1) continue; + $member_srls[abs($output->data[$i]->member_srl)] = $output->data[$i]->count; + } + + // 원글 작성 회원의 번호는 제거 + if($member_srl) unset($member_srls[abs($member_srl)]); + if(!count($member_srls)) return new Object(); + + // 각 회원들을 모두 돌면서 포인트 감소 + $oPointModel = &getModel('point'); + + // 포인트를 구해옴 + $point = $module_config['download_file']; + foreach($member_srls as $member_srl => $cnt) { + $cur_point = $oPointModel->getPoint($member_srl, true); + $cur_point -= $cnt * $comment_point; + $this->setPoint($member_srl,$cur_point); + } + + return new Object(); + } + + /** + * @brief 게시글 삭제 포인트 적용 trigger + **/ + function triggerDeleteDocument(&$obj) { + $module_srl = $obj->module_srl; + $member_srl = $obj->member_srl; + + // 지울 대상 글에 대한 처리 + if(!$module_srl || !$member_srl) return new Object(); + + // 로그인 상태일때만 실행 + $logged_info = Context::get('logged_info'); + if(!$logged_info->member_srl) return new Object(); + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); + + $point = $module_config['insert_document']; + if(!isset($point)) $point = $config->insert_document; + + // 포인트가 마이너스 즉 글을 작성시 마다 차감되는 경우라면 글 삭제시 증가시켜주지 않도록 수정 + if($point < 0) return new Object(); + $cur_point -= $point; + + // 첨부파일 삭제에 대한 포인트 추가 + $point = $module_config['upload_file']; + if(!isset($point)) $point = $config->upload_file; + if($obj->uploaded_count) $cur_point -= $point * $obj->uploaded_count; + + // 포인트 증감 + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 댓글 등록 포인트 적용 trigger + **/ + function triggerInsertComment(&$obj) { + $module_srl = $obj->module_srl; + $member_srl = $obj->member_srl; + if(!$module_srl || !$member_srl) return new Object(); + + // 원글이 본인의 글이라면 포인트를 올리지 않음 + $document_srl = $obj->document_srl; + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + if(!$oDocument->isExists() || abs($oDocument->get('member_srl'))==abs($member_srl)) return new Object(); + + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + $point = $module_config['insert_comment']; + if(!isset($point)) $point = $config->insert_comment; + + // 포인트 증감 + $cur_point += $point; + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 댓글 삭제 포인트 적용 trigger + **/ + function triggerDeleteComment(&$obj) { + $oModuleModel = &getModel('module'); + $oPointModel = &getModel('point'); + $oDocumentModel = &getModel('document'); + + $module_srl = $obj->module_srl; + $member_srl = abs($obj->member_srl); + $document_srl = $obj->document_srl; + if(!$module_srl || !$member_srl) return new Object(); + + // 원글을 가져옴 (원글이 없거나 원글이 자신의 글이라면 포인트 적용 하지 않음) + $oDocument = $oDocumentModel->getDocument($document_srl); + if(!$oDocument->isExists()) return new Object(); + if($oDocument->get('member_srl')==$member_srl) return new Object(); + + // point 모듈 정보 가져옴 + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); + + // 대상 회원의 포인트를 구함 + $cur_point = $oPointModel->getPoint($member_srl, true); + + $point = $module_config['insert_comment']; + if(!isset($point)) $point = $config->insert_comment; + + // 포인트가 마이너스 즉 댓글을 작성시 마다 차감되는 경우라면 댓글 삭제시 증가시켜주지 않도록 수정 + if($point < 0) return new Object(); + + // 포인트 증감 + $cur_point -= $point; + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 파일 등록 trigger 추가 + * 비유효 파일의 등록에 의한 포인트 획득을 방지하고자 이 method는 일단 무효로 둠 + **/ + function triggerInsertFile(&$obj) { + return new Object(); + } + + /** + * @brief 파일 삭제 포인트 적용 trigger + * 유효파일을 삭제할 경우에만 포인트 삭제 + **/ + function triggerDeleteFile(&$obj) { + if($obj->isvalid != 'Y') return new Object(); + + $module_srl = $obj->module_srl; + $member_srl = $obj->member_srl; + if(!$module_srl || !$member_srl) return new Object(); + + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + $point = $module_config['upload_file']; + if(!isset($point)) $point = $config->upload_file; + + // 포인트 증감 + $cur_point -= $point; + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 파일 다운로드 전에 호출되는 trigger + **/ + function triggerBeforeDownloadFile(&$obj) { + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + $module_srl = $obj->module_srl; + if(!$module_srl) return new Object(); + + // 자신의 올린 파일이면 패스 + if(abs($obj->member_srl) == abs($member_srl)) return new Object(); + + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); + + // 포인트가 없으면 다운로드가 안되도록 하였으면 비로그인 회원일 경우 중지 + if(!Context::get('is_logged')) + { + if($config->disable_download == 'Y' && isset($module_config['download_file'])) return new Object(-1,'msg_not_permitted_download'); + else return new Object(); + } + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + // 포인트를 구해옴 + $point = $module_config['download_file']; + if(!isset($point)) $point = $config->download_file; + + // 포인트가 0보다 작고 포인트가 없으면 파일 다운로드가 안되도록 했다면 오류 + if($cur_point + $point < 0 && $config->disable_download == 'Y') return new Object(-1,'msg_not_permitted_download'); + + return new Object(); + } + + /** + * @brief 파일 다운로드 포인트 적용 trigger + **/ + function triggerDownloadFile(&$obj) { + // 로그인 상태일때만 실행 + $logged_info = Context::get('logged_info'); + if(!$logged_info->member_srl) return new Object(); + $module_srl = $obj->module_srl; + $member_srl = $logged_info->member_srl; + if(!$module_srl) return new Object(); + + // 자신의 올린 파일이면 패스 + if(abs($obj->member_srl) == abs($member_srl)) return new Object(); + + // point 모듈 정보 가져옴 + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); + + // 대상 회원의 포인트를 구함 + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + // 포인트를 구해옴 + $point = $module_config['download_file']; + if(!isset($point)) $point = $config->download_file; + + // 포인트 증감 + $cur_point += $point; + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 조회수 증가시 포인트 적용 + * 포인트가 없을때 조회를 하지 못하는 기능의 적용도 실행 + **/ + function triggerUpdateReadedCount(&$obj) { + $oModuleModel = &getModel('module'); + $oPointModel = &getModel('point'); + + // 접속자의 정보 구함 + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + + // 원글의 회원 번호 구함 + $target_member_srl = abs($obj->get('member_srl')); + + // 원글을 적은 이와 동일하면 조회수 올리지 않고 pass + if($target_member_srl == $member_srl) return new Object(); + + // 모듈별 point 정보 가져옴 + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point', $obj->get('module_srl')); + + // 조회 포인트를 구해옴 + $point = $module_config['read_document']; + if(!isset($point)) $point = $config->read_document; + + // 조회 포인트가 없으면 pass + if(!$point) return new Object(); + + // 회원일 경우 읽은 적이 있으면 그냥 pass 하고 그렇지 않으면 현재 포인트 구함 + if($member_srl) { + $args->member_srl = $member_srl; + $args->document_srl = $obj->document_srl; + $output = executeQuery('document.getDocumentReadedLogInfo', $args); + if($output->data->count) return new Object(); + $cur_point = $oPointModel->getPoint($member_srl, true); + } else { + $cur_point = 0; + } + + // 포인트 모듈 기본 설정 가져옴 + $config = $oModuleModel->getModuleConfig('point'); + + // 조회 포인트가 -(마이너스)일때 현재 포인트와 비교 + if($config->disable_read_document == 'Y' && $point < 0 && abs($point)>$cur_point) { + $obj->add('content', sprintf(Context::getLang('msg_disallow_by_point'), abs($point), $cur_point)); + return new Object(); + } + + // 로그인 사용자가 아니라면 pass + if(!$logged_info->member_srl) return new Object(); + + // 조회 포인트가 없으면 패스 + if(!$point) return new Object(); + + // 읽은 기록이 없으면 기록 남김 + $output = executeQuery('document.insertDocumentReadedLog', $args); + + // 포인트 증감 + $cur_point += $point; + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 추천/비추천 시 포인트 적용 + **/ + + function triggerUpdateVotedCount(&$obj) { + $module_srl = $obj->module_srl; + $member_srl = $obj->member_srl; + if(!$module_srl || !$member_srl) return new Object(); + + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + $module_config = $oModuleModel->getModulePartConfig('point', $module_srl); + + $oPointModel = &getModel('point'); + $cur_point = $oPointModel->getPoint($member_srl, true); + + if( $obj->point > 0 ) { + $point = $module_config['voted']; + if(!isset($point)) $point = $config->voted; + } else { + $point = $module_config['blamed']; + if(!isset($point)) $point = $config->blamed; + } + + if(!$point) return new Object(); + + // 포인트 증감 + $cur_point += $point; + $this->setPoint($member_srl,$cur_point); + + return new Object(); + } + + /** + * @brief 포인트 설정 + **/ + function setPoint($member_srl, $point, $mode = null) { + $member_srl = abs($member_srl); + $mode_arr = array('add', 'minus', 'update', 'signup'); + if(!$mode || !in_array($mode,$mode_arr)) $mode = 'update'; + + // 설정 정보 가져오기 + $oMemberModel = &getModel('member'); + $oModuleModel = &getModel('module'); + $oPointModel = &getModel('point'); + $config = $oModuleModel->getModuleConfig('point'); + + // 기존 포인트 정보를 구함 + $prev_point = $oPointModel->getPoint($member_srl, true); + $prev_level = $oPointModel->getLevel($prev_point, $config->level_step); + + // 포인트 변경 + $args->member_srl = $member_srl; + $args->point = $prev_point; + + switch($mode) { + + case 'add' : + $args->point += $point; + break; + case 'minus' : + $args->point -= $point; + break; + case 'update' : + $args->point = $point; + break; + case 'signup' : + $args->point = $point; + break; + } + if($args->point < 0) $args->point = 0; + $point = $args->point; + + // 포인트가 있으면 update, 없으면 insert + $oPointModel = &getModel('point'); + if($oPointModel->isExistsPoint($member_srl)) executeQuery("point.updatePoint", $args); + else executeQuery("point.insertPoint", $args); + + // 새로운 레벨을 구함 + $level = $oPointModel->getLevel($point, $config->level_step); + + // 기존 레벨과 새로운 레벨이 다르면 포인트 그룹 설정 시도 + if($level != $prev_level) { + + // 현재 포인트 대비하여 레벨을 계산하고 레벨에 맞는 그룹 설정을 체크 + $point_group = $config->point_group; + + // 포인트 그룹 정보가 있을때 시행 + if($point_group && is_array($point_group) && count($point_group) ) { + + // 기본 그룹을 구함 + $default_group = $oMemberModel->getDefaultGroup(); + + // 제거될 그룹과 새로 부여 받을 그룹을 구함 + $del_group_list = array(); + $new_group_srls = array(); + + asort($point_group); + + //그룹 초기화 후 재설정 + if($config->group_reset != 'N') { + //새로운 레벨에 맞는 그룹이 있다면 + if(in_array($level, $point_group)) { + //현재 레벨의 그룹을 제외한 나머지는 모두 삭제 + foreach($point_group as $group_srl => $target_level) { + $del_group_list[] = $group_srl; + if($target_level == $level) $new_group_srls[] = $group_srl; + } + } + //그렇지 않고 레벨 감소인 경우 바로 이전 그룹을 추가 + else { + $i = $level; + while($i > 0) { + if(in_array($i, $point_group)) { + foreach($point_group as $group_srl => $target_level) { + if ($target_level == $i) { + $new_group_srls[] = $group_srl; + } + } + $i = 0; + } + + $i--; + } + } + + //현재 레벨보다 높은 레벨의 그룹은 삭제 + foreach($point_group as $group_srl => $target_level) { + if($target_level > $level) $del_group_list[] = $group_srl; + } + } + //새 그룹만 부여 + else { + // 포인트 그룹 설정을 돌면서 현재 레벨까지 체크 + foreach($point_group as $group_srl => $target_level) { + $del_group_list[] = $group_srl; + if($target_level <= $level) $new_group_srls[] = $group_srl; + } + } + + // 만약 새로운 그룹이 없다면 기본 그룹을 부여 받음 + if(!$new_group_srls[0]) $new_group_srls[0] = $default_group->group_srl; + + // 연동 그룹 제거 + if($del_group_list && count($del_group_list)) { + $del_group_args->member_srl = $member_srl; + $del_group_args->group_srl = implode(',', $del_group_list); + $del_group_output = executeQuery('point.deleteMemberGroup', $del_group_args); + } + + // 새로운 그룹을 부여 + foreach($new_group_srls as $group_srl) { + $new_group_args->member_srl = $member_srl; + $new_group_args->group_srl = $group_srl; + executeQuery('member.addMemberToGroup', $new_group_args); + } + } + } + + // 캐시 설정 + $cache_path = sprintf('./files/member_extra_info/point/%s/', getNumberingPath($member_srl)); + FileHandler::makedir($cache_path); + + $cache_filename = sprintf('%s%d.cache.txt', $cache_path, $member_srl); + FileHandler::writeFile($cache_filename, $point); + + return $output; + } + } +?> diff --git a/modules/point/point.model.php b/modules/point/point.model.php index a7da64224..d1c50a78e 100644 --- a/modules/point/point.model.php +++ b/modules/point/point.model.php @@ -1,146 +1,146 @@ -member_srl = $member_srl; - $output = executeQuery('point.getPoint', $args); - if($output->data->member_srl == $member_srl) return true; - return false; - } - - /** - * @brief 포인트를 구해옴 - **/ - function getPoint($member_srl, $from_db = false) { - $member_srl = abs($member_srl); - $path = sprintf('./files/member_extra_info/point/%s',getNumberingPath($member_srl)); - if(!is_dir($path)) FileHandler::makeDir($path); - $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); - - if(!$from_db && file_exists($cache_filename)) return trim(FileHandler::readFile($cache_filename)); - - // DB에서 가져옴 - $args->member_srl = $member_srl; - $output = executeQuery('point.getPoint', $args); - $point = (int)$output->data->point; - - FileHandler::writeFile($cache_filename, $point); - - return $point; - } - - /** - * @brief 레벨을 구함 - **/ - function getLevel($point, $level_step) { - $level_count = count($level_step); - for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break; - $level --; - return $level; - } - - function getMembersPointInfo() - { - $member_srls = Context::get('member_srls'); - $member_srls = explode(',',$member_srls); - if(count($member_srls)==0) return; - array_unique($member_srls); - - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - - $info = array(); - foreach($member_srls as $v) - { - $obj = new stdClass; - $obj->point = $this->getPoint($v); - $obj->level = $this->getLevel($obj->point, $config->level_step); - $obj->member_srl = $v; - $info[] = $obj; - } - - $this->add('point_info',$info); - } - - - /** - * @brief 포인트 순 회원목록 가져오기 - **/ - function getMemberList($args = null) { - - // 검색 옵션 정리 - $args->is_admin = Context::get('is_admin')=='Y'?'Y':''; - $args->is_denied = Context::get('is_denied')=='Y'?'Y':''; - $args->selected_group_srl = Context::get('selected_group_srl'); - - $search_target = trim(Context::get('search_target')); - $search_keyword = trim(Context::get('search_keyword')); - - if($search_target && $search_keyword) { - switch($search_target) { - case 'user_id' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_user_id = $search_keyword; - break; - case 'user_name' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_user_name = $search_keyword; - break; - case 'nick_name' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_nick_name = $search_keyword; - break; - case 'email_address' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_email_address = $search_keyword; - break; - case 'regdate' : - $args->s_regdate = $search_keyword; - break; - case 'last_login' : - $args->s_last_login = $search_keyword; - break; - case 'extra_vars' : - $args->s_extra_vars = $search_keyword; - break; - } - } - - // selected_group_srl이 있으면 query id를 변경 (table join때문에) - if($args->selected_group_srl) { - $query_id = 'point.getMemberListWithinGroup'; - } else { - $query_id = 'point.getMemberList'; - } - - $output = executeQuery($query_id, $args); - - if($output->total_count) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('point'); - - foreach($output->data as $key => $val) { - $output->data[$key]->level = $this->getLevel($val->point, $config->level_step); - } - } - - return $output; - } - } -?> +member_srl = $member_srl; + $output = executeQuery('point.getPoint', $args); + if($output->data->member_srl == $member_srl) return true; + return false; + } + + /** + * @brief 포인트를 구해옴 + **/ + function getPoint($member_srl, $from_db = false) { + $member_srl = abs($member_srl); + $path = sprintf('./files/member_extra_info/point/%s',getNumberingPath($member_srl)); + if(!is_dir($path)) FileHandler::makeDir($path); + $cache_filename = sprintf('%s%d.cache.txt', $path, $member_srl); + + if(!$from_db && file_exists($cache_filename)) return trim(FileHandler::readFile($cache_filename)); + + // DB에서 가져옴 + $args->member_srl = $member_srl; + $output = executeQuery('point.getPoint', $args); + $point = (int)$output->data->point; + + FileHandler::writeFile($cache_filename, $point); + + return $point; + } + + /** + * @brief 레벨을 구함 + **/ + function getLevel($point, $level_step) { + $level_count = count($level_step); + for($level=0;$level<=$level_count;$level++) if($point < $level_step[$level]) break; + $level --; + return $level; + } + + function getMembersPointInfo() + { + $member_srls = Context::get('member_srls'); + $member_srls = explode(',',$member_srls); + if(count($member_srls)==0) return; + array_unique($member_srls); + + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + + $info = array(); + foreach($member_srls as $v) + { + $obj = new stdClass; + $obj->point = $this->getPoint($v); + $obj->level = $this->getLevel($obj->point, $config->level_step); + $obj->member_srl = $v; + $info[] = $obj; + } + + $this->add('point_info',$info); + } + + + /** + * @brief 포인트 순 회원목록 가져오기 + **/ + function getMemberList($args = null) { + + // 검색 옵션 정리 + $args->is_admin = Context::get('is_admin')=='Y'?'Y':''; + $args->is_denied = Context::get('is_denied')=='Y'?'Y':''; + $args->selected_group_srl = Context::get('selected_group_srl'); + + $search_target = trim(Context::get('search_target')); + $search_keyword = trim(Context::get('search_keyword')); + + if($search_target && $search_keyword) { + switch($search_target) { + case 'user_id' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_id = $search_keyword; + break; + case 'user_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_name = $search_keyword; + break; + case 'nick_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_nick_name = $search_keyword; + break; + case 'email_address' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_email_address = $search_keyword; + break; + case 'regdate' : + $args->s_regdate = $search_keyword; + break; + case 'last_login' : + $args->s_last_login = $search_keyword; + break; + case 'extra_vars' : + $args->s_extra_vars = $search_keyword; + break; + } + } + + // selected_group_srl이 있으면 query id를 변경 (table join때문에) + if($args->selected_group_srl) { + $query_id = 'point.getMemberListWithinGroup'; + } else { + $query_id = 'point.getMemberList'; + } + + $output = executeQuery($query_id, $args); + + if($output->total_count) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('point'); + + foreach($output->data as $key => $val) { + $output->data[$key]->level = $this->getLevel($val->point, $config->level_step); + } + } + + return $output; + } + } +?> diff --git a/modules/point/point.view.php b/modules/point/point.view.php index d1e88e9ff..0ed06cc72 100644 --- a/modules/point/point.view.php +++ b/modules/point/point.view.php @@ -1,62 +1,62 @@ -module_srl; - if(!$current_module_srl) return new Object(); - } - - // 설정 정보 가져오기 - $oModuleModel = &getModel('module'); - - if($current_module_srl) { - $module_config = $oModuleModel->getModulePartConfig('point', $current_module_srl); - if(!$module_config) { - $config = $oModuleModel->getModuleConfig('point'); - $module_config['insert_document'] = $config->insert_document; - $module_config['insert_comment'] = $config->insert_comment; - $module_config['upload_file'] = $config->upload_file; - $module_config['download_file'] = $config->download_file; - $module_config['read_document'] = $config->read_document; - $module_config['voted'] = $config->voted; - $module_config['blamed'] = $config->blamed; - } - } - - $module_config['module_srl'] = $current_module_srl; - $module_config['point_name'] = $config->point_name; - Context::set('module_config', $module_config); - - // 템플릿 파일 지정 - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'point_module_config'); - $obj .= $tpl; - - return new Object(); - } - } -?> +module_srl; + if(!$current_module_srl) return new Object(); + } + + // 설정 정보 가져오기 + $oModuleModel = &getModel('module'); + + if($current_module_srl) { + $module_config = $oModuleModel->getModulePartConfig('point', $current_module_srl); + if(!$module_config) { + $config = $oModuleModel->getModuleConfig('point'); + $module_config['insert_document'] = $config->insert_document; + $module_config['insert_comment'] = $config->insert_comment; + $module_config['upload_file'] = $config->upload_file; + $module_config['download_file'] = $config->download_file; + $module_config['read_document'] = $config->read_document; + $module_config['voted'] = $config->voted; + $module_config['blamed'] = $config->blamed; + } + } + + $module_config['module_srl'] = $current_module_srl; + $module_config['point_name'] = $config->point_name; + Context::set('module_config', $module_config); + + // 템플릿 파일 지정 + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'point_module_config'); + $obj .= $tpl; + + return new Object(); + } + } +?> diff --git a/modules/point/queries/getMemberCount.xml b/modules/point/queries/getMemberCount.xml index e59d056e1..24779b32f 100644 --- a/modules/point/queries/getMemberCount.xml +++ b/modules/point/queries/getMemberCount.xml @@ -1,8 +1,8 @@ - - - - - - - + + +
    + + + + \ No newline at end of file diff --git a/modules/point/queries/getPointCount.xml b/modules/point/queries/getPointCount.xml index d336275cf..669a451c2 100644 --- a/modules/point/queries/getPointCount.xml +++ b/modules/point/queries/getPointCount.xml @@ -1,8 +1,8 @@ - - -
    - - - - + + +
    + + + + \ No newline at end of file diff --git a/modules/point/tpl/js/point_admin.js b/modules/point/tpl/js/point_admin.js index 1bfe63f89..3f52045fe 100644 --- a/modules/point/tpl/js/point_admin.js +++ b/modules/point/tpl/js/point_admin.js @@ -1,70 +1,70 @@ -/** - * @file modules/point/js/point_admin.js - * @author NHN (developers@xpressengine.com) - * @brief point 모듈의 관리자용 javascript - **/ - -function exp_calc (form, reset) { - var fo_obj = xGetElementById(form) - var level = fo_obj.max_level.value - var exp = fo_obj.expression - var exp_default = "Math.pow(i, 2) * 90" - - if(reset || !exp.value) exp.value = exp_default - - for(i = 1; i <= level; i++) { - point = eval("fo_obj.level_step_" + i) - point.value = eval(exp.value); - } -} - -/** - * @brief 포인트를 전부 체크하여 재계산하는 action 호출 - **/ -function doPointRecal() { - - var params = new Array(); - var response_tags = new Array('error','message','total', 'position'); - - exec_xml('point','procPointAdminReCal',params, completePointRecal, response_tags); -} - -function completePointRecal(ret_obj) { - var total = ret_obj['total']; - var message = ret_obj['message']; - var position = ret_obj['position']; - - if(position == total) { - xInnerHtml('pointReCal', message); - alert(message); - location.reload(); - } else { - xInnerHtml('pointReCal', message); - - var params = new Array(); - params['position'] = position; - params['total'] = total; - var response_tags = new Array('error','message','total', 'position'); - - exec_xml('point','procPointAdminApplyPoint',params, completePointRecal, response_tags); - } -} - -function updatePoint(member_srl, action) -{ - var pointEl = jQuery("#point_"+member_srl); - var e = jQuery("#update_member_srl").val(member_srl); - e = jQuery("#update_action").val(action); - e = jQuery("#update_point").val(pointEl.attr("value")); - var hF = jQuery("#updateForm").get(0); - procFilter(hF, update_point); -} - - -function doPointReset(module_srls) { - var params = new Array(); - var response_tags = new Array('error','message'); - params['module_srls'] = module_srls; - - exec_xml('point','procPointAdminReset',params,function(ret_obj) {alert(ret_obj['message']);}, response_tags); -} +/** + * @file modules/point/js/point_admin.js + * @author NHN (developers@xpressengine.com) + * @brief point 모듈의 관리자용 javascript + **/ + +function exp_calc (form, reset) { + var fo_obj = xGetElementById(form) + var level = fo_obj.max_level.value + var exp = fo_obj.expression + var exp_default = "Math.pow(i, 2) * 90" + + if(reset || !exp.value) exp.value = exp_default + + for(i = 1; i <= level; i++) { + point = eval("fo_obj.level_step_" + i) + point.value = eval(exp.value); + } +} + +/** + * @brief 포인트를 전부 체크하여 재계산하는 action 호출 + **/ +function doPointRecal() { + + var params = new Array(); + var response_tags = new Array('error','message','total', 'position'); + + exec_xml('point','procPointAdminReCal',params, completePointRecal, response_tags); +} + +function completePointRecal(ret_obj) { + var total = ret_obj['total']; + var message = ret_obj['message']; + var position = ret_obj['position']; + + if(position == total) { + xInnerHtml('pointReCal', message); + alert(message); + location.reload(); + } else { + xInnerHtml('pointReCal', message); + + var params = new Array(); + params['position'] = position; + params['total'] = total; + var response_tags = new Array('error','message','total', 'position'); + + exec_xml('point','procPointAdminApplyPoint',params, completePointRecal, response_tags); + } +} + +function updatePoint(member_srl, action) +{ + var pointEl = jQuery("#point_"+member_srl); + var e = jQuery("#update_member_srl").val(member_srl); + e = jQuery("#update_action").val(action); + e = jQuery("#update_point").val(pointEl.attr("value")); + var hF = jQuery("#updateForm").get(0); + procFilter(hF, update_point); +} + + +function doPointReset(module_srls) { + var params = new Array(); + var response_tags = new Array('error','message'); + params['module_srls'] = module_srls; + + exec_xml('point','procPointAdminReset',params,function(ret_obj) {alert(ret_obj['message']);}, response_tags); +} diff --git a/modules/point/tpl/member_list.html b/modules/point/tpl/member_list.html index 14bdbdfbd..f6aceda9b 100644 --- a/modules/point/tpl/member_list.html +++ b/modules/point/tpl/member_list.html @@ -1,91 +1,91 @@ - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->user_id}
    {$lang->user_name}
    {$lang->nick_name}
    {$lang->point}
    {$lang->level}
    {$no}{htmlspecialchars($val->user_id)}{htmlspecialchars($val->user_name)}{htmlspecialchars($val->nick_name)} -
    - - - - - - -
    -
    {$val->level}
    - -
    - - - -
    - - - - - - -
    - - - -
    - - - - - - - - {$lang->cmd_cancel} -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->user_id}
    {$lang->user_name}
    {$lang->nick_name}
    {$lang->point}
    {$lang->level}
    {$no}{htmlspecialchars($val->user_id)}{htmlspecialchars($val->user_name)}{htmlspecialchars($val->nick_name)} +
    + + + + + + +
    +
    {$val->level}
    + +
    + + + +
    + + + + + + +
    + + + +
    + + + + + + + + {$lang->cmd_cancel} +
    +
    diff --git a/modules/poll/conf/info.xml b/modules/poll/conf/info.xml index 8c5d0f3dc..02147e7aa 100644 --- a/modules/poll/conf/info.xml +++ b/modules/poll/conf/info.xml @@ -1,36 +1,36 @@ - - - 설문조사 - 投票系统 - アンケート - Poll - Bình chọn, Thăm dò - Encuesta - Опрос - 投票調查 - Oylama - 설문조사 관리 모듈 - 管理投票调查的模块。 - アンケート管理モジュール - This module is for managering polls. - Module này quản lý những bình chọn và thăm dò. - Este módulo es para manejar las encuestas. - Этот модуль служит для управления опросами. - 管理投票調查的模組。 - Oylamaları düzenlemek için kullanılan modüldür. - 0.1 - 2007-02-28 - content - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 설문조사 + 投票系统 + アンケート + Poll + Bình chọn, Thăm dò + Encuesta + Опрос + 投票調查 + Oylama + 설문조사 관리 모듈 + 管理投票调查的模块。 + アンケート管理モジュール + This module is for managering polls. + Module này quản lý những bình chọn và thăm dò. + Este módulo es para manejar las encuestas. + Этот модуль служит для управления опросами. + 管理投票調查的模組。 + Oylamaları düzenlemek için kullanılan modüldür. + 0.1 + 2007-02-28 + content + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/poll/lang/en.lang.php b/modules/poll/lang/en.lang.php index 53ee47574..00a6262b7 100644 --- a/modules/poll/lang/en.lang.php +++ b/modules/poll/lang/en.lang.php @@ -1,38 +1,38 @@ -poll = "Poll"; - $lang->poll_stop_date = "Expiration Date"; - $lang->poll_join_count = "Participants"; - $lang->poll_checkcount = "Number of required items"; - - $lang->cmd_poll_list = 'View poll list'; - $lang->cmd_delete_checked_poll = 'Delete selected poll'; - $lang->cmd_apply_poll = 'Apply poll'; - $lang->cmd_view_result = 'Preview result'; - $lang->cmd_delete_checked_poll = 'Delete selected poll'; - - $lang->success_poll = 'Thank you for joining the poll.'; - - $lang->msg_already_poll = 'You already polled!'; - $lang->msg_cart_is_null = 'Please select an article to delete.'; - $lang->msg_checked_poll_is_deleted = '%d poll(s) are deleted.'; - $lang->msg_check_poll_item = 'Please select a poll item to poll.\n(Required poll item(s) may be different in each poll.)'; - $lang->msg_cart_is_null = 'Please select a poll to delete.'; - $lang->msg_checked_poll_is_deleted = '%d poll(s) are deleted.'; - $lang->msg_poll_not_exists = 'Selected poll does not exist.'; - - $lang->cmd_null_item = "No item value exist to post a poll. Please re-try."; - - $lang->confirm_poll_submit = "Confirm to submit the poll?"; - - $lang->search_target_list = array( - 'title' => 'Title', - 'regdate' => 'Posting date', - 'ipaddress' => 'IP Address', - ); -?> +poll = "Poll"; + $lang->poll_stop_date = "Expiration Date"; + $lang->poll_join_count = "Participants"; + $lang->poll_checkcount = "Number of required items"; + + $lang->cmd_poll_list = 'View poll list'; + $lang->cmd_delete_checked_poll = 'Delete selected poll'; + $lang->cmd_apply_poll = 'Apply poll'; + $lang->cmd_view_result = 'Preview result'; + $lang->cmd_delete_checked_poll = 'Delete selected poll'; + + $lang->success_poll = 'Thank you for joining the poll.'; + + $lang->msg_already_poll = 'You already polled!'; + $lang->msg_cart_is_null = 'Please select an article to delete.'; + $lang->msg_checked_poll_is_deleted = '%d poll(s) are deleted.'; + $lang->msg_check_poll_item = 'Please select a poll item to poll.\n(Required poll item(s) may be different in each poll.)'; + $lang->msg_cart_is_null = 'Please select a poll to delete.'; + $lang->msg_checked_poll_is_deleted = '%d poll(s) are deleted.'; + $lang->msg_poll_not_exists = 'Selected poll does not exist.'; + + $lang->cmd_null_item = "No item value exist to post a poll. Please re-try."; + + $lang->confirm_poll_submit = "Confirm to submit the poll?"; + + $lang->search_target_list = array( + 'title' => 'Title', + 'regdate' => 'Posting date', + 'ipaddress' => 'IP Address', + ); +?> diff --git a/modules/poll/lang/es.lang.php b/modules/poll/lang/es.lang.php index d7f0eec65..2433fb1d3 100644 --- a/modules/poll/lang/es.lang.php +++ b/modules/poll/lang/es.lang.php @@ -1,38 +1,38 @@ -poll = "Encuesta"; - $lang->poll_stop_date = "Fecha de expiración"; - $lang->poll_join_count = "Participantes"; - $lang->poll_checkcount = "Número de artículos requeridos."; - - $lang->cmd_poll_list = 'Ver la lista de la encuesta'; - $lang->cmd_delete_checked_poll = 'Eliminar la encuesta seleccionada'; - $lang->cmd_apply_poll = 'Aplicar la encuesta'; - $lang->cmd_view_result = 'Preview result'; - $lang->cmd_delete_checked_poll = 'Eliminar la encuesta seleccionada'; - - $lang->success_poll = 'Gracias por participar en la encuesta.'; - - $lang->msg_already_poll = 'Usted ya realizo la encuesta!'; - $lang->msg_cart_is_null = 'Por favor seleciona un artículo a eliminar.'; - $lang->msg_checked_poll_is_deleted = '%d encustas son eliminados.'; - $lang->msg_check_poll_item = 'Por favor selecciona un artículo de la encuesta.\n(Artículos requeridos pueden ser diferentes in cada encuesta.)'; - $lang->msg_cart_is_null = 'Por favor selecciona una encuesta a eliminar.'; - $lang->msg_checked_poll_is_deleted = '%d encuestas son eliminados.'; - $lang->msg_poll_not_exists = 'Encuesta seleccionada no existe.'; - - $lang->cmd_null_item = "No existe ningún valor para la encuesta. Por favor trate nuevamente."; - - $lang->confirm_poll_submit = "¿Confirma la participación de la encuesta?"; - - $lang->search_target_list = array( - 'title' => 'Título', - 'regdate' => 'Fecha de la participación', - 'ipaddress' => 'Dirección IP', - ); -?> +poll = "Encuesta"; + $lang->poll_stop_date = "Fecha de expiración"; + $lang->poll_join_count = "Participantes"; + $lang->poll_checkcount = "Número de artículos requeridos."; + + $lang->cmd_poll_list = 'Ver la lista de la encuesta'; + $lang->cmd_delete_checked_poll = 'Eliminar la encuesta seleccionada'; + $lang->cmd_apply_poll = 'Aplicar la encuesta'; + $lang->cmd_view_result = 'Preview result'; + $lang->cmd_delete_checked_poll = 'Eliminar la encuesta seleccionada'; + + $lang->success_poll = 'Gracias por participar en la encuesta.'; + + $lang->msg_already_poll = 'Usted ya realizo la encuesta!'; + $lang->msg_cart_is_null = 'Por favor seleciona un artículo a eliminar.'; + $lang->msg_checked_poll_is_deleted = '%d encustas son eliminados.'; + $lang->msg_check_poll_item = 'Por favor selecciona un artículo de la encuesta.\n(Artículos requeridos pueden ser diferentes in cada encuesta.)'; + $lang->msg_cart_is_null = 'Por favor selecciona una encuesta a eliminar.'; + $lang->msg_checked_poll_is_deleted = '%d encuestas son eliminados.'; + $lang->msg_poll_not_exists = 'Encuesta seleccionada no existe.'; + + $lang->cmd_null_item = "No existe ningún valor para la encuesta. Por favor trate nuevamente."; + + $lang->confirm_poll_submit = "¿Confirma la participación de la encuesta?"; + + $lang->search_target_list = array( + 'title' => 'Título', + 'regdate' => 'Fecha de la participación', + 'ipaddress' => 'Dirección IP', + ); +?> diff --git a/modules/poll/lang/fr.lang.php b/modules/poll/lang/fr.lang.php index cd76aaab0..7651d1387 100644 --- a/modules/poll/lang/fr.lang.php +++ b/modules/poll/lang/fr.lang.php @@ -1,38 +1,38 @@ - - * @brief paquet du langage en français pour le module d\'Enquête - **/ - - $lang->poll = "Enquête"; - $lang->poll_stop_date = "Jour d'Expiration"; - $lang->poll_join_count = "Participants"; - $lang->poll_checkcount = "Nombre obligé à choisir"; - - $lang->cmd_poll_list = 'Voir la liste des Enquêtes'; - $lang->cmd_delete_checked_poll = 'Supprimer l\'Enquête choisi'; - $lang->cmd_apply_poll = 'Participer(Soumettre)'; - $lang->cmd_view_result = 'Voir le Résultat'; - $lang->cmd_delete_checked_poll = 'Supprimer l\'Enquête choisi'; - - $lang->success_poll = 'Merci pour participer.'; - - $lang->msg_already_poll = 'Vous avez déjà participé!'; - $lang->msg_cart_is_null = 'Choisissez des Enquêtes à supprimer.'; - $lang->msg_checked_poll_is_deleted = '%d Enquête(s) est(sont) supprimée(s).'; - $lang->msg_check_poll_item = 'Choisissez un des item.\n(Nombre obligé à choisir peut être différent par chaque Enquête.)'; - $lang->msg_cart_is_null = 'Choisissez des Enquêtes à supprimer.'; - $lang->msg_checked_poll_is_deleted = '%d Enquête(s) est(sont) supprimée(s).'; - $lang->msg_poll_not_exists = 'L\'Enquête choisi n\'existe pas.'; - - $lang->cmd_null_item = "Aucune valeur à enrégistrer comme enquête n'existe pas. Essayez encore une fois, S.V.P."; - - $lang->confirm_poll_submit = "Vous voulez sûrement soumettre?"; - - $lang->search_target_list = array( - 'title' => 'Titre', - 'regdate' => 'Jour posté', - 'ipaddress' => 'Adresse IP', - ); -?> + + * @brief paquet du langage en français pour le module d\'Enquête + **/ + + $lang->poll = "Enquête"; + $lang->poll_stop_date = "Jour d'Expiration"; + $lang->poll_join_count = "Participants"; + $lang->poll_checkcount = "Nombre obligé à choisir"; + + $lang->cmd_poll_list = 'Voir la liste des Enquêtes'; + $lang->cmd_delete_checked_poll = 'Supprimer l\'Enquête choisi'; + $lang->cmd_apply_poll = 'Participer(Soumettre)'; + $lang->cmd_view_result = 'Voir le Résultat'; + $lang->cmd_delete_checked_poll = 'Supprimer l\'Enquête choisi'; + + $lang->success_poll = 'Merci pour participer.'; + + $lang->msg_already_poll = 'Vous avez déjà participé!'; + $lang->msg_cart_is_null = 'Choisissez des Enquêtes à supprimer.'; + $lang->msg_checked_poll_is_deleted = '%d Enquête(s) est(sont) supprimée(s).'; + $lang->msg_check_poll_item = 'Choisissez un des item.\n(Nombre obligé à choisir peut être différent par chaque Enquête.)'; + $lang->msg_cart_is_null = 'Choisissez des Enquêtes à supprimer.'; + $lang->msg_checked_poll_is_deleted = '%d Enquête(s) est(sont) supprimée(s).'; + $lang->msg_poll_not_exists = 'L\'Enquête choisi n\'existe pas.'; + + $lang->cmd_null_item = "Aucune valeur à enrégistrer comme enquête n'existe pas. Essayez encore une fois, S.V.P."; + + $lang->confirm_poll_submit = "Vous voulez sûrement soumettre?"; + + $lang->search_target_list = array( + 'title' => 'Titre', + 'regdate' => 'Jour posté', + 'ipaddress' => 'Adresse IP', + ); +?> diff --git a/modules/poll/lang/jp.lang.php b/modules/poll/lang/jp.lang.php index 6f0b12f2d..0ce341f3b 100644 --- a/modules/poll/lang/jp.lang.php +++ b/modules/poll/lang/jp.lang.php @@ -1,38 +1,38 @@ -poll = 'アンケート調査'; - $lang->poll_stop_date = 'アンケート調査の終了日'; - $lang->poll_join_count = '参加者'; - $lang->poll_checkcount = '必須選択項目数'; - - $lang->cmd_poll_list = 'アンケートのリスト表示'; - $lang->cmd_delete_checked_poll = '選択項目削除'; - $lang->cmd_apply_poll = 'アンケート調査へ参加する'; - $lang->cmd_view_result = '結果を見る'; - $lang->cmd_delete_checked_poll = '選択アンケート削除'; - - $lang->success_poll = 'アンケート調査へのご応募ありがとうございます。'; - - $lang->msg_already_poll = '既にアンケート調査に応募しました。'; - $lang->msg_cart_is_null = '削除する書き込みを選択して下さい。'; - $lang->msg_checked_poll_is_deleted = '%d個のアンケートが削除されました。'; - $lang->msg_check_poll_item = 'アンケート調査の項目を選択して下さい(アンケート調査ごと必須の選択項目が異なる場合があります)。'; - $lang->msg_cart_is_null = '削除するアンケートを選択して下さい。'; - $lang->msg_checked_poll_is_deleted = '%d個のアンケートが削除されました。'; - $lang->msg_poll_not_exists = '選択したアンケートは存在しません。'; - - $lang->cmd_null_item = "アンケート調査に登録する項目がありません。\nもう一度設定して下さい。"; - - $lang->confirm_poll_submit = 'アンケート調査にご応募しますか?'; - - $lang->search_target_list = array( - 'title' => 'タイトル', - 'regdate' => '登録日', - 'ipaddress' => 'IPアドレス', - ); -?> +poll = 'アンケート調査'; + $lang->poll_stop_date = 'アンケート調査の終了日'; + $lang->poll_join_count = '参加者'; + $lang->poll_checkcount = '必須選択項目数'; + + $lang->cmd_poll_list = 'アンケートのリスト表示'; + $lang->cmd_delete_checked_poll = '選択項目削除'; + $lang->cmd_apply_poll = 'アンケート調査へ参加する'; + $lang->cmd_view_result = '結果を見る'; + $lang->cmd_delete_checked_poll = '選択アンケート削除'; + + $lang->success_poll = 'アンケート調査へのご応募ありがとうございます。'; + + $lang->msg_already_poll = '既にアンケート調査に応募しました。'; + $lang->msg_cart_is_null = '削除する書き込みを選択して下さい。'; + $lang->msg_checked_poll_is_deleted = '%d個のアンケートが削除されました。'; + $lang->msg_check_poll_item = 'アンケート調査の項目を選択して下さい(アンケート調査ごと必須の選択項目が異なる場合があります)。'; + $lang->msg_cart_is_null = '削除するアンケートを選択して下さい。'; + $lang->msg_checked_poll_is_deleted = '%d個のアンケートが削除されました。'; + $lang->msg_poll_not_exists = '選択したアンケートは存在しません。'; + + $lang->cmd_null_item = "アンケート調査に登録する項目がありません。\nもう一度設定して下さい。"; + + $lang->confirm_poll_submit = 'アンケート調査にご応募しますか?'; + + $lang->search_target_list = array( + 'title' => 'タイトル', + 'regdate' => '登録日', + 'ipaddress' => 'IPアドレス', + ); +?> diff --git a/modules/poll/lang/ko.lang.php b/modules/poll/lang/ko.lang.php index 14a3ac259..44439f2e3 100644 --- a/modules/poll/lang/ko.lang.php +++ b/modules/poll/lang/ko.lang.php @@ -1,38 +1,38 @@ -poll = '설문조사'; - $lang->poll_stop_date = '설문조사 종료일'; - $lang->poll_join_count = '참가자'; - $lang->poll_checkcount = '필수 선택 항목 수'; - - $lang->cmd_poll_list = '설문조사 목록 보기'; - $lang->cmd_delete_checked_poll = '선택항목 삭제'; - $lang->cmd_apply_poll = '설문 참여'; - $lang->cmd_view_result = '결과 보기'; - $lang->cmd_delete_checked_poll = '선택 설문 삭제'; - - $lang->success_poll = '설문에 응하여 주셔서 감사합니다.'; - - $lang->msg_already_poll = '이미 설문조사를 하셨습니다.'; - $lang->msg_cart_is_null = '삭제할 글을 선택해주세요.'; - $lang->msg_checked_poll_is_deleted = '%d개의 설문조사가 삭제되었습니다.'; - $lang->msg_check_poll_item = '설문에 응할 항목을 선택하여 주세요. (설문조사 마다 필수 선택항목이 다를 수 있습니다.)'; - $lang->msg_cart_is_null = '삭제할 설문을 선택해주세요.'; - $lang->msg_checked_poll_is_deleted = '%d개의 설문이 삭제되었습니다.'; - $lang->msg_poll_not_exists = '선택하신 설문이 존재하지 않습니다.'; - - $lang->cmd_null_item = "설문조사로 등록할 값이 없습니다.\n다시 설정해주세요."; - - $lang->confirm_poll_submit = '설문조사에 응하시겠습니까?'; - - $lang->search_target_list = array( - 'title' => '제목', - 'regdate' => '등록일', - 'ipaddress' => 'IP 주소', - ); -?> +poll = '설문조사'; + $lang->poll_stop_date = '설문조사 종료일'; + $lang->poll_join_count = '참가자'; + $lang->poll_checkcount = '필수 선택 항목 수'; + + $lang->cmd_poll_list = '설문조사 목록 보기'; + $lang->cmd_delete_checked_poll = '선택항목 삭제'; + $lang->cmd_apply_poll = '설문 참여'; + $lang->cmd_view_result = '결과 보기'; + $lang->cmd_delete_checked_poll = '선택 설문 삭제'; + + $lang->success_poll = '설문에 응하여 주셔서 감사합니다.'; + + $lang->msg_already_poll = '이미 설문조사를 하셨습니다.'; + $lang->msg_cart_is_null = '삭제할 글을 선택해주세요.'; + $lang->msg_checked_poll_is_deleted = '%d개의 설문조사가 삭제되었습니다.'; + $lang->msg_check_poll_item = '설문에 응할 항목을 선택하여 주세요. (설문조사 마다 필수 선택항목이 다를 수 있습니다.)'; + $lang->msg_cart_is_null = '삭제할 설문을 선택해주세요.'; + $lang->msg_checked_poll_is_deleted = '%d개의 설문이 삭제되었습니다.'; + $lang->msg_poll_not_exists = '선택하신 설문이 존재하지 않습니다.'; + + $lang->cmd_null_item = "설문조사로 등록할 값이 없습니다.\n다시 설정해주세요."; + + $lang->confirm_poll_submit = '설문조사에 응하시겠습니까?'; + + $lang->search_target_list = array( + 'title' => '제목', + 'regdate' => '등록일', + 'ipaddress' => 'IP 주소', + ); +?> diff --git a/modules/poll/lang/ru.lang.php b/modules/poll/lang/ru.lang.php index 9088dce75..523ca958f 100644 --- a/modules/poll/lang/ru.lang.php +++ b/modules/poll/lang/ru.lang.php @@ -1,38 +1,38 @@ -poll = "Опрос"; - $lang->poll_stop_date = "Дата истечения"; - $lang->poll_join_count = "Участников"; - $lang->poll_checkcount = "Число полей выбора"; - - $lang->cmd_poll_list = 'Просмотреть список опросов'; - $lang->cmd_delete_checked_poll = 'Удалить выбранные опросы'; - $lang->cmd_apply_poll = 'Применеть опрос'; - $lang->cmd_view_result = 'Предпросмотр результата'; - $lang->cmd_delete_checked_poll = 'Удалить выбранные опросы'; // translator's remark for devs: double entry, already has $lang->cmd_delete_checked_poll - - $lang->success_poll = 'Благодарим за присоединение к опросу.'; - - $lang->msg_already_poll = 'Вы уже голосовали!'; - $lang->msg_cart_is_null = 'Пожалуйста, выберите статью для удаления.'; - $lang->msg_checked_poll_is_deleted = '%d опросов удалено.'; - $lang->msg_check_poll_item = 'Пожалуйста, выберите ответ, чтобы проголосовать.\n(Требуемые объекты могут различаться для каждого из опросов.)'; - $lang->msg_cart_is_null = 'Пожалуйста, выберите опрос для удаления.'; // translator's remark for devs: double entry, already has it... - $lang->msg_checked_poll_is_deleted = '%d опросов удалено.'; // translator's remark for devs: double entry, already has it... - $lang->msg_poll_not_exists = 'Выбранный опрос не существует.'; - - $lang->cmd_null_item = "Не выбран ответ для голосования. Пожалуйста, попробуйте еще."; - - $lang->confirm_poll_submit = "Подтверждаете ли Вы размещение опроса?"; - - $lang->search_target_list = array( - 'title' => 'Заголовок', - 'regdate' => 'Дата Размещения', // // translator's remark: this may be as "Дата Регистрации" - 'ipaddress' => 'IP-адрес', - ); -?> +poll = "Опрос"; + $lang->poll_stop_date = "Дата истечения"; + $lang->poll_join_count = "Участников"; + $lang->poll_checkcount = "Число полей выбора"; + + $lang->cmd_poll_list = 'Просмотреть список опросов'; + $lang->cmd_delete_checked_poll = 'Удалить выбранные опросы'; + $lang->cmd_apply_poll = 'Применеть опрос'; + $lang->cmd_view_result = 'Предпросмотр результата'; + $lang->cmd_delete_checked_poll = 'Удалить выбранные опросы'; // translator's remark for devs: double entry, already has $lang->cmd_delete_checked_poll + + $lang->success_poll = 'Благодарим за присоединение к опросу.'; + + $lang->msg_already_poll = 'Вы уже голосовали!'; + $lang->msg_cart_is_null = 'Пожалуйста, выберите статью для удаления.'; + $lang->msg_checked_poll_is_deleted = '%d опросов удалено.'; + $lang->msg_check_poll_item = 'Пожалуйста, выберите ответ, чтобы проголосовать.\n(Требуемые объекты могут различаться для каждого из опросов.)'; + $lang->msg_cart_is_null = 'Пожалуйста, выберите опрос для удаления.'; // translator's remark for devs: double entry, already has it... + $lang->msg_checked_poll_is_deleted = '%d опросов удалено.'; // translator's remark for devs: double entry, already has it... + $lang->msg_poll_not_exists = 'Выбранный опрос не существует.'; + + $lang->cmd_null_item = "Не выбран ответ для голосования. Пожалуйста, попробуйте еще."; + + $lang->confirm_poll_submit = "Подтверждаете ли Вы размещение опроса?"; + + $lang->search_target_list = array( + 'title' => 'Заголовок', + 'regdate' => 'Дата Размещения', // // translator's remark: this may be as "Дата Регистрации" + 'ipaddress' => 'IP-адрес', + ); +?> diff --git a/modules/poll/lang/tr.lang.php b/modules/poll/lang/tr.lang.php index 0978a5dd8..19fb4944b 100644 --- a/modules/poll/lang/tr.lang.php +++ b/modules/poll/lang/tr.lang.php @@ -1,38 +1,38 @@ -poll = "Oylama"; - $lang->poll_stop_date = "Kullanım Süresi Bitimi"; - $lang->poll_join_count = "Katılımcılar"; - $lang->poll_checkcount = "Gerekli ögelerin sayısı"; - - $lang->cmd_poll_list = 'Oylama listesini gör'; - $lang->cmd_delete_checked_poll = 'Seçili oylamayı sil'; - $lang->cmd_apply_poll = 'Oyla'; - $lang->cmd_view_result = 'Sonuç Önizlemesi'; - $lang->cmd_delete_checked_poll = 'Seçili oylamayı sil'; - - $lang->success_poll = 'Oylamaya katıldığınız için teşekkürler.'; - - $lang->msg_already_poll = 'Zaten oylamada bulundunuz!'; - $lang->msg_cart_is_null = 'Lütfen silmek için bir makale seçiniz.'; - $lang->msg_checked_poll_is_deleted = '%d oylama silindi.'; - $lang->msg_check_poll_item = 'Lütfen oylama yapmak için oylama parçası seçiniz.\n(Gerekli oylama parçaları her oylamada farklılık gösterebilir.)'; - $lang->msg_cart_is_null = 'Lütfen silmek için bir oylama seçiniz.'; - $lang->msg_checked_poll_is_deleted = '%d oylama silindi.'; - $lang->msg_poll_not_exists = 'Seçili oylama mevcut değil.'; - - $lang->cmd_null_item = "Oylama göndermek için hiçbir öge değeri yok. Lütfen tekrar deneyiniz."; - - $lang->confirm_poll_submit = "Oylamayı göndermeyi onaylıyor musunuz?"; - - $lang->search_target_list = array( - 'title' => 'Başlık', - 'regdate' => 'Mesaj Tarihi', - 'ipaddress' => 'IP Adresi', - ); -?> +poll = "Oylama"; + $lang->poll_stop_date = "Kullanım Süresi Bitimi"; + $lang->poll_join_count = "Katılımcılar"; + $lang->poll_checkcount = "Gerekli ögelerin sayısı"; + + $lang->cmd_poll_list = 'Oylama listesini gör'; + $lang->cmd_delete_checked_poll = 'Seçili oylamayı sil'; + $lang->cmd_apply_poll = 'Oyla'; + $lang->cmd_view_result = 'Sonuç Önizlemesi'; + $lang->cmd_delete_checked_poll = 'Seçili oylamayı sil'; + + $lang->success_poll = 'Oylamaya katıldığınız için teşekkürler.'; + + $lang->msg_already_poll = 'Zaten oylamada bulundunuz!'; + $lang->msg_cart_is_null = 'Lütfen silmek için bir makale seçiniz.'; + $lang->msg_checked_poll_is_deleted = '%d oylama silindi.'; + $lang->msg_check_poll_item = 'Lütfen oylama yapmak için oylama parçası seçiniz.\n(Gerekli oylama parçaları her oylamada farklılık gösterebilir.)'; + $lang->msg_cart_is_null = 'Lütfen silmek için bir oylama seçiniz.'; + $lang->msg_checked_poll_is_deleted = '%d oylama silindi.'; + $lang->msg_poll_not_exists = 'Seçili oylama mevcut değil.'; + + $lang->cmd_null_item = "Oylama göndermek için hiçbir öge değeri yok. Lütfen tekrar deneyiniz."; + + $lang->confirm_poll_submit = "Oylamayı göndermeyi onaylıyor musunuz?"; + + $lang->search_target_list = array( + 'title' => 'Başlık', + 'regdate' => 'Mesaj Tarihi', + 'ipaddress' => 'IP Adresi', + ); +?> diff --git a/modules/poll/lang/vi.lang.php b/modules/poll/lang/vi.lang.php index 8cafed053..5fd71d5d8 100644 --- a/modules/poll/lang/vi.lang.php +++ b/modules/poll/lang/vi.lang.php @@ -1,40 +1,40 @@ -poll = "Thăm dò"; - $lang->poll_stop_date = "Ngày hết hạn"; - $lang->poll_join_count = "Người tham gia"; - $lang->poll_checkcount = "Số mục yêu cầu"; - - $lang->cmd_poll_list = 'Xem danh sách thăm dò'; - $lang->cmd_delete_checked_poll = 'Xóa thăm dò đã chọn'; - $lang->cmd_apply_poll = 'Áp dụng thăm dò'; - $lang->cmd_view_result = 'Xem kết quả'; - $lang->cmd_delete_checked_poll = 'Xóa thăm dò đã chọn'; - - $lang->success_poll = 'Cảm ơn bạn đã tham gia thăm dò.'; - - $lang->msg_already_poll = 'Bạn đã bỏ phiếu rồi!'; - $lang->msg_cart_is_null = 'Hãy chọn bài viết để xóa.'; - $lang->msg_checked_poll_is_deleted = '%d thăm dò đã được xóa.'; - $lang->msg_check_poll_item = 'Xin hãy chọn những mục để tạo thăm dò.\n(Yêu cầu những mục để tạo thăm dò phải là những mục chưa được tạo.)'; - $lang->msg_cart_is_null = 'Xin hãy chọn thăm dò để xóa.'; - $lang->msg_checked_poll_is_deleted = '%d đã được xóa.'; - $lang->msg_poll_not_exists = 'Thăm dò đã chọn không tồn tại.'; - - $lang->cmd_null_item = "Không có giá trị để gửi một thăm dò. Xin hãy thử lại."; - - $lang->confirm_poll_submit = "Bạn có chắc chắn muốn gửi thăm dò?"; - - $lang->search_target_list = array( - 'title' => 'Tiêu đề', - 'regdate' => 'Ngày gửi', - 'ipaddress' => 'IP', - ); -?> +poll = "Thăm dò"; + $lang->poll_stop_date = "Ngày hết hạn"; + $lang->poll_join_count = "Người tham gia"; + $lang->poll_checkcount = "Số mục yêu cầu"; + + $lang->cmd_poll_list = 'Xem danh sách thăm dò'; + $lang->cmd_delete_checked_poll = 'Xóa thăm dò đã chọn'; + $lang->cmd_apply_poll = 'Áp dụng thăm dò'; + $lang->cmd_view_result = 'Xem kết quả'; + $lang->cmd_delete_checked_poll = 'Xóa thăm dò đã chọn'; + + $lang->success_poll = 'Cảm ơn bạn đã tham gia thăm dò.'; + + $lang->msg_already_poll = 'Bạn đã bỏ phiếu rồi!'; + $lang->msg_cart_is_null = 'Hãy chọn bài viết để xóa.'; + $lang->msg_checked_poll_is_deleted = '%d thăm dò đã được xóa.'; + $lang->msg_check_poll_item = 'Xin hãy chọn những mục để tạo thăm dò.\n(Yêu cầu những mục để tạo thăm dò phải là những mục chưa được tạo.)'; + $lang->msg_cart_is_null = 'Xin hãy chọn thăm dò để xóa.'; + $lang->msg_checked_poll_is_deleted = '%d đã được xóa.'; + $lang->msg_poll_not_exists = 'Thăm dò đã chọn không tồn tại.'; + + $lang->cmd_null_item = "Không có giá trị để gửi một thăm dò. Xin hãy thử lại."; + + $lang->confirm_poll_submit = "Bạn có chắc chắn muốn gửi thăm dò?"; + + $lang->search_target_list = array( + 'title' => 'Tiêu đề', + 'regdate' => 'Ngày gửi', + 'ipaddress' => 'IP', + ); +?> diff --git a/modules/poll/lang/zh-CN.lang.php b/modules/poll/lang/zh-CN.lang.php index a01f21ef2..b18de80bf 100644 --- a/modules/poll/lang/zh-CN.lang.php +++ b/modules/poll/lang/zh-CN.lang.php @@ -1,38 +1,38 @@ -poll = "投票系统"; - $lang->poll_stop_date = "投票调查结束日期"; - $lang->poll_join_count = "投票者"; - $lang->poll_checkcount = "必选项目数"; - - $lang->cmd_poll_list = '投票列表'; - $lang->cmd_delete_checked_poll = '删除所选项目'; - $lang->cmd_apply_poll = '参与投票'; - $lang->cmd_view_result = '查看结果'; - $lang->cmd_delete_checked_poll = '删除所选'; - - $lang->success_poll = '感谢您参与投票。'; - - $lang->msg_already_poll = '不能重复投票!'; - $lang->msg_cart_is_null = '请选择要删除的文章。'; - $lang->msg_checked_poll_is_deleted = '已删除%d个投票调查。'; - $lang->msg_check_poll_item = '请选择问卷回应的项目。 (每个问卷调查有不同的必选项目)'; - $lang->msg_cart_is_null = '请选择要删除的问卷。'; - $lang->msg_checked_poll_is_deleted = '已删除%d个问卷。'; - $lang->msg_poll_not_exists = '您选择的问卷不存在!'; - - $lang->cmd_null_item = "没有要登录为投票调查的值。\n请重新设置。"; - - $lang->confirm_poll_submit = "您要参与投票吗?"; - - $lang->search_target_list = array( - 'title' => '标题', - 'regdate' => '登录日期', - 'ipaddress' => 'IP 地址', - ); -?> +poll = "投票系统"; + $lang->poll_stop_date = "投票调查结束日期"; + $lang->poll_join_count = "投票者"; + $lang->poll_checkcount = "必选项目数"; + + $lang->cmd_poll_list = '投票列表'; + $lang->cmd_delete_checked_poll = '删除所选项目'; + $lang->cmd_apply_poll = '参与投票'; + $lang->cmd_view_result = '查看结果'; + $lang->cmd_delete_checked_poll = '删除所选'; + + $lang->success_poll = '感谢您参与投票。'; + + $lang->msg_already_poll = '不能重复投票!'; + $lang->msg_cart_is_null = '请选择要删除的文章。'; + $lang->msg_checked_poll_is_deleted = '已删除%d个投票调查。'; + $lang->msg_check_poll_item = '请选择问卷回应的项目。 (每个问卷调查有不同的必选项目)'; + $lang->msg_cart_is_null = '请选择要删除的问卷。'; + $lang->msg_checked_poll_is_deleted = '已删除%d个问卷。'; + $lang->msg_poll_not_exists = '您选择的问卷不存在!'; + + $lang->cmd_null_item = "没有要登录为投票调查的值。\n请重新设置。"; + + $lang->confirm_poll_submit = "您要参与投票吗?"; + + $lang->search_target_list = array( + 'title' => '标题', + 'regdate' => '登录日期', + 'ipaddress' => 'IP 地址', + ); +?> diff --git a/modules/poll/lang/zh-TW.lang.php b/modules/poll/lang/zh-TW.lang.php index 76f2f95ef..f7bdd00d8 100644 --- a/modules/poll/lang/zh-TW.lang.php +++ b/modules/poll/lang/zh-TW.lang.php @@ -1,38 +1,38 @@ -poll = "投票調查"; - $lang->poll_stop_date = "投票調查結束日期"; - $lang->poll_join_count = "投票人數"; - $lang->poll_checkcount = "必選項目數"; - - $lang->cmd_poll_list = '檢視列表'; - $lang->cmd_delete_checked_poll = '刪除所選項目'; - $lang->cmd_apply_poll = '參與投票'; - $lang->cmd_view_result = '看結果'; - $lang->cmd_delete_checked_poll = '刪除所選'; - - $lang->success_poll = '感謝您參與投票。'; - - $lang->msg_already_poll = '不能重複投票!'; - $lang->msg_cart_is_null = '請選擇要刪除的文章。'; - $lang->msg_checked_poll_is_deleted = '已刪除%d個投票調查。'; - $lang->msg_check_poll_item = '請選擇問卷回應的項目。 (每個問卷調查有不同的必選項目)'; - $lang->msg_cart_is_null = '請選擇要刪除的問卷。'; - $lang->msg_checked_poll_is_deleted = '已刪除%d個問卷。'; - $lang->msg_poll_not_exists = '您選擇的問卷不存在!'; - - $lang->cmd_null_item = "沒有要登錄為投票調查的值。\n請重新設置。"; - - $lang->confirm_poll_submit = "您要參與投票嗎?"; - - $lang->search_target_list = array( - 'title' => '標題', - 'regdate' => '登錄日期', - 'ipaddress' => 'IP位址', - ); -?> +poll = "投票調查"; + $lang->poll_stop_date = "投票調查結束日期"; + $lang->poll_join_count = "投票人數"; + $lang->poll_checkcount = "必選項目數"; + + $lang->cmd_poll_list = '檢視列表'; + $lang->cmd_delete_checked_poll = '刪除所選項目'; + $lang->cmd_apply_poll = '參與投票'; + $lang->cmd_view_result = '看結果'; + $lang->cmd_delete_checked_poll = '刪除所選'; + + $lang->success_poll = '感謝您參與投票。'; + + $lang->msg_already_poll = '不能重複投票!'; + $lang->msg_cart_is_null = '請選擇要刪除的文章。'; + $lang->msg_checked_poll_is_deleted = '已刪除%d個投票調查。'; + $lang->msg_check_poll_item = '請選擇問卷回應的項目。 (每個問卷調查有不同的必選項目)'; + $lang->msg_cart_is_null = '請選擇要刪除的問卷。'; + $lang->msg_checked_poll_is_deleted = '已刪除%d個問卷。'; + $lang->msg_poll_not_exists = '您選擇的問卷不存在!'; + + $lang->cmd_null_item = "沒有要登錄為投票調查的值。\n請重新設置。"; + + $lang->confirm_poll_submit = "您要參與投票嗎?"; + + $lang->search_target_list = array( + 'title' => '標題', + 'regdate' => '登錄日期', + 'ipaddress' => 'IP位址', + ); +?> diff --git a/modules/poll/poll.admin.controller.php b/modules/poll/poll.admin.controller.php index eb92f7ade..cc1b6e53b 100644 --- a/modules/poll/poll.admin.controller.php +++ b/modules/poll/poll.admin.controller.php @@ -1,111 +1,111 @@ -skin = Context::get('skin'); - $config->colorset = Context::get('colorset'); - - $oModuleController = &getController('module'); - $oModuleController->insertModuleConfig('poll', $config); - - $this->setMessage('success_updated'); - } - - /** - * @brief 관리자 페이지에서 선택된 설문조사들을 삭제 - **/ - function procPollAdminDeleteChecked() { - // 선택된 글이 없으면 오류 표시 - $cart = Context::get('cart'); - if(!$cart) return $this->stop('msg_cart_is_null'); - - $poll_srl_list= explode('|@|', $cart); - $poll_count = count($poll_srl_list); - if(!$poll_count) return $this->stop('msg_cart_is_null'); - - // 글삭제 - for($i=0;$i<$poll_count;$i++) { - $poll_index_srl = trim($poll_srl_list[$i]); - if(!$poll_index_srl) continue; - - $output = $this->deletePollTitle($poll_index_srl, true); - if(!$output->toBool()) return $output; - } - - $this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) ); - } - - /** - * @brief 설문조사 삭제 (한번에 여러개의 설문 등록시 그 중 하나의 설문만 삭제) - **/ - function deletePollTitle($poll_index_srl) { - $args->poll_index_srl = $poll_index_srl; - - $oDB = &DB::getInstance(); - $oDB->begin(); - - $output = $oDB->executeQuery('poll.deletePollTitle', $args); - if(!$output) { - $oDB->rollback(); - return $output; - } - - $output = $oDB->executeQuery('poll.deletePollItem', $args); - if(!$output) { - $oDB->rollback(); - return $output; - } - - $oDB->commit(); - - return new Object(); - } - - /** - * @brief 설문조사 삭제 (하나의 묶인 설문조사를 통째로 삭제) - **/ - function deletePoll($poll_srl) { - $args->poll_srl = $poll_srl; - - $oDB = &DB::getInstance(); - $oDB->begin(); - - $output = $oDB->executeQuery('poll.deletePoll', $args); - if(!$output) { - $oDB->rollback(); - return $output; - } - - $output = $oDB->executeQuery('poll.deletePollTitle', $args); - if(!$output) { - $oDB->rollback(); - return $output; - } - - $output = $oDB->executeQuery('poll.deletePollItem', $args); - if(!$output) { - $oDB->rollback(); - return $output; - } - - $oDB->commit(); - - return new Object(); - } - } -?> +skin = Context::get('skin'); + $config->colorset = Context::get('colorset'); + + $oModuleController = &getController('module'); + $oModuleController->insertModuleConfig('poll', $config); + + $this->setMessage('success_updated'); + } + + /** + * @brief 관리자 페이지에서 선택된 설문조사들을 삭제 + **/ + function procPollAdminDeleteChecked() { + // 선택된 글이 없으면 오류 표시 + $cart = Context::get('cart'); + if(!$cart) return $this->stop('msg_cart_is_null'); + + $poll_srl_list= explode('|@|', $cart); + $poll_count = count($poll_srl_list); + if(!$poll_count) return $this->stop('msg_cart_is_null'); + + // 글삭제 + for($i=0;$i<$poll_count;$i++) { + $poll_index_srl = trim($poll_srl_list[$i]); + if(!$poll_index_srl) continue; + + $output = $this->deletePollTitle($poll_index_srl, true); + if(!$output->toBool()) return $output; + } + + $this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) ); + } + + /** + * @brief 설문조사 삭제 (한번에 여러개의 설문 등록시 그 중 하나의 설문만 삭제) + **/ + function deletePollTitle($poll_index_srl) { + $args->poll_index_srl = $poll_index_srl; + + $oDB = &DB::getInstance(); + $oDB->begin(); + + $output = $oDB->executeQuery('poll.deletePollTitle', $args); + if(!$output) { + $oDB->rollback(); + return $output; + } + + $output = $oDB->executeQuery('poll.deletePollItem', $args); + if(!$output) { + $oDB->rollback(); + return $output; + } + + $oDB->commit(); + + return new Object(); + } + + /** + * @brief 설문조사 삭제 (하나의 묶인 설문조사를 통째로 삭제) + **/ + function deletePoll($poll_srl) { + $args->poll_srl = $poll_srl; + + $oDB = &DB::getInstance(); + $oDB->begin(); + + $output = $oDB->executeQuery('poll.deletePoll', $args); + if(!$output) { + $oDB->rollback(); + return $output; + } + + $output = $oDB->executeQuery('poll.deletePollTitle', $args); + if(!$output) { + $oDB->rollback(); + return $output; + } + + $output = $oDB->executeQuery('poll.deletePollItem', $args); + if(!$output) { + $oDB->rollback(); + return $output; + } + + $oDB->commit(); + + return new Object(); + } + } +?> diff --git a/modules/poll/poll.admin.model.php b/modules/poll/poll.admin.model.php index b83b131fa..bf36deed4 100644 --- a/modules/poll/poll.admin.model.php +++ b/modules/poll/poll.admin.model.php @@ -1,50 +1,50 @@ -toBool()) return $output; - - if($output->data && !is_array($output->data)) $output->data = array($output->data); - return $output; - } - - /** - * @brief 설문조사의 원본을 구함 - **/ - function getPollAdminTarget() { - $poll_srl = Context::get('poll_srl'); - $upload_target_srl = Context::get('upload_target_srl'); - - $oDocumentModel = &getModel('document'); - $oCommentModel = &getModel('comment'); - - $oDocument = $oDocumentModel->getDocument($upload_target_srl); - - if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl); - - if($oComment && $oComment->isExists()) { - $this->add('document_srl', $oComment->get('document_srl')); - $this->add('comment_srl', $oComment->get('comment_srl')); - } elseif($oDocument->isExists()) { - $this->add('document_srl', $oDocument->get('document_srl')); - } else return new Object(-1, 'msg_not_founded'); - } - - } -?> +toBool()) return $output; + + if($output->data && !is_array($output->data)) $output->data = array($output->data); + return $output; + } + + /** + * @brief 설문조사의 원본을 구함 + **/ + function getPollAdminTarget() { + $poll_srl = Context::get('poll_srl'); + $upload_target_srl = Context::get('upload_target_srl'); + + $oDocumentModel = &getModel('document'); + $oCommentModel = &getModel('comment'); + + $oDocument = $oDocumentModel->getDocument($upload_target_srl); + + if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl); + + if($oComment && $oComment->isExists()) { + $this->add('document_srl', $oComment->get('document_srl')); + $this->add('comment_srl', $oComment->get('comment_srl')); + } elseif($oDocument->isExists()) { + $this->add('document_srl', $oDocument->get('document_srl')); + } else return new Object(-1, 'msg_not_founded'); + } + + } +?> diff --git a/modules/poll/poll.admin.view.php b/modules/poll/poll.admin.view.php index 64177542d..ce692f62e 100644 --- a/modules/poll/poll.admin.view.php +++ b/modules/poll/poll.admin.view.php @@ -1,127 +1,127 @@ -s_title= $search_keyword; - break; - case 'regdate' : - $args->s_regdate = $search_keyword; - break; - case 'ipaddress' : - $args->s_ipaddress= $search_keyword; - break; - } - } - // 목록을 구하기 위한 옵션 - $args->page = Context::get('page'); ///< 페이지 - $args->list_count = 50; ///< 한페이지에 보여줄 글 수 - $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 - - $args->sort_index = 'list_order'; ///< 소팅 값 - - // 목록 구함 - $oPollAdminModel = &getAdminModel('poll'); - $output = $oPollAdminModel->getPollList($args); - - // 템플릿 변수 설정 - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('poll_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - Context::set('module_list', $module_list); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('poll_list'); - } - - /** - * @brief 설문조사 스킨, 컬러셋 설정 - **/ - function dispPollAdminConfig() { - $oModuleModel = &getModel('module'); - - // 설정 정보 가져오기 - $config = $oModuleModel->getModuleConfig('poll'); - Context::set('config', $config); - - // 스킨 정보 가져오기 - $skin_list = $oModuleModel->getSkins($this->module_path); - Context::set('skin_list', $skin_list); - - if(!$skin_list[$config->skin]) $config->skin = "default"; - - // 설정된 스킨의 컬러셋 설정 - Context::set('colorset_list', $skin_list[$config->skin]->colorset); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('config'); - } - - /** - * @brief 설문조사 결과 - **/ - function dispPollAdminResult() { - // 팝업 레이아웃 - $this->setLayoutFile("popup_layout"); - - // 결과 뽑기 - $args->poll_srl = Context::get('poll_srl'); - $args->poll_index_srl = Context::get('poll_index_srl'); - - $output = executeQuery('poll.getPoll', $args); - if(!$output->data) return $this->stop('msg_poll_not_exists'); - $poll->stop_date = $output->data->stop_date; - $poll->poll_count = $output->data->poll_count; - - $output = executeQuery('poll.getPollTitle', $args); - if(!$output->data) return $this->stop('msg_poll_not_exists'); - - $poll->poll[$args->poll_index_srl]->title = $output->data->title; - $poll->poll[$args->poll_index_srl]->checkcount = $output->data->checkcount; - $poll->poll[$args->poll_index_srl]->poll_count = $output->data->poll_count; - - $output = executeQuery('poll.getPollItem', $args); - foreach($output->data as $key => $val) { - $poll->poll[$val->poll_index_srl]->item[] = $val; - } - - $poll->poll_srl = $poll_srl; - - Context::set('poll',$poll); - - // 기본 설정의 스킨, 컬러셋 설정 - $oModuleModel = &getModel('module'); - $poll_config = $oModuleModel->getModuleConfig('poll'); - Context::set('poll_config', $poll_config); - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('result'); - } - } -?> +s_title= $search_keyword; + break; + case 'regdate' : + $args->s_regdate = $search_keyword; + break; + case 'ipaddress' : + $args->s_ipaddress= $search_keyword; + break; + } + } + // 목록을 구하기 위한 옵션 + $args->page = Context::get('page'); ///< 페이지 + $args->list_count = 50; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'list_order'; ///< 소팅 값 + + // 목록 구함 + $oPollAdminModel = &getAdminModel('poll'); + $output = $oPollAdminModel->getPollList($args); + + // 템플릿 변수 설정 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('poll_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + Context::set('module_list', $module_list); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('poll_list'); + } + + /** + * @brief 설문조사 스킨, 컬러셋 설정 + **/ + function dispPollAdminConfig() { + $oModuleModel = &getModel('module'); + + // 설정 정보 가져오기 + $config = $oModuleModel->getModuleConfig('poll'); + Context::set('config', $config); + + // 스킨 정보 가져오기 + $skin_list = $oModuleModel->getSkins($this->module_path); + Context::set('skin_list', $skin_list); + + if(!$skin_list[$config->skin]) $config->skin = "default"; + + // 설정된 스킨의 컬러셋 설정 + Context::set('colorset_list', $skin_list[$config->skin]->colorset); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('config'); + } + + /** + * @brief 설문조사 결과 + **/ + function dispPollAdminResult() { + // 팝업 레이아웃 + $this->setLayoutFile("popup_layout"); + + // 결과 뽑기 + $args->poll_srl = Context::get('poll_srl'); + $args->poll_index_srl = Context::get('poll_index_srl'); + + $output = executeQuery('poll.getPoll', $args); + if(!$output->data) return $this->stop('msg_poll_not_exists'); + $poll->stop_date = $output->data->stop_date; + $poll->poll_count = $output->data->poll_count; + + $output = executeQuery('poll.getPollTitle', $args); + if(!$output->data) return $this->stop('msg_poll_not_exists'); + + $poll->poll[$args->poll_index_srl]->title = $output->data->title; + $poll->poll[$args->poll_index_srl]->checkcount = $output->data->checkcount; + $poll->poll[$args->poll_index_srl]->poll_count = $output->data->poll_count; + + $output = executeQuery('poll.getPollItem', $args); + foreach($output->data as $key => $val) { + $poll->poll[$val->poll_index_srl]->item[] = $val; + } + + $poll->poll_srl = $poll_srl; + + Context::set('poll',$poll); + + // 기본 설정의 스킨, 컬러셋 설정 + $oModuleModel = &getModel('module'); + $poll_config = $oModuleModel->getModuleConfig('poll'); + Context::set('poll_config', $poll_config); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('result'); + } + } +?> diff --git a/modules/poll/poll.class.php b/modules/poll/poll.class.php index eed9d5030..6edb63796 100644 --- a/modules/poll/poll.class.php +++ b/modules/poll/poll.class.php @@ -1,83 +1,83 @@ -skin = 'default'; - $config->colorset = 'normal'; - $oModuleController->insertModuleConfig('poll', $config); - - // 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제 - $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'); - $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'); - $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'); - $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'); - $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'); - $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oModuleModel = &getModel('module'); - - // 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제 - if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true; - if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true; - if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) return true; - if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) return true; - if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) return true; - if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - // 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제 - if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) - $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'); - if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) - $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'); - - // 2008. 04. 22 글/댓글의 추가기 설문조사의 연결 - if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) - $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'); - if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) - $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'); - if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) - $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'); - if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) - $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'); - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - } - } -?> +skin = 'default'; + $config->colorset = 'normal'; + $oModuleController->insertModuleConfig('poll', $config); + + // 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제 + $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'); + $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'); + $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'); + $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'); + $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'); + $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oModuleModel = &getModel('module'); + + // 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제 + if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true; + if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true; + if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) return true; + if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) return true; + if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) return true; + if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // 2007. 10. 17 글/댓글의 삭제시 설문조사도 삭제 + if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) + $oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'); + if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) + $oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'); + + // 2008. 04. 22 글/댓글의 추가기 설문조사의 연결 + if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) + $oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'); + if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) + $oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'); + if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) + $oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'); + if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) + $oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'); + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + } + } +?> diff --git a/modules/poll/poll.controller.php b/modules/poll/poll.controller.php index 674761028..90e4264f3 100644 --- a/modules/poll/poll.controller.php +++ b/modules/poll/poll.controller.php @@ -1,316 +1,316 @@ - $val) { - if(strpos($key,'tidx')) continue; - if(!preg_match("/^(title|checkcount|item)_/i", $key)) continue; - if(!trim($val)) continue; - - $tmp_arr = explode('_',$key); - - $poll_index = $tmp_arr[1]; - - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - // 세션에서 최고 관리자가 아니면 태그 제거 - if($logged_info->is_admin != 'Y') $val = htmlspecialchars($val); - } - - if($tmp_arr[0]=='title') $tmp_args[$poll_index]->title = $val; - else if($tmp_arr[0]=='checkcount') $tmp_args[$poll_index]->checkcount = $val; - else if($tmp_arr[0]=='item') $tmp_args[$poll_index]->item[] = $val; - } - - foreach($tmp_args as $key => $val) { - if(!$val->checkcount) $val->checkcount = 1; - if($val->title && count($val->item)) $args->poll[] = $val; - } - - if(!count($args->poll)) return new Object(-1, 'cmd_null_item'); - - $args->stop_date = $stop_date; - - // 변수 설정 - $poll_srl = getNextSequence(); - - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl?$logged_info->member_srl:0; - - $oDB = &DB::getInstance(); - $oDB->begin(); - - // 설문의 등록 - unset($poll_args); - $poll_args->poll_srl = $poll_srl; - $poll_args->member_srl = $member_srl; - $poll_args->list_order = $poll_srl*-1; - $poll_args->stop_date = $args->stop_date; - $poll_args->poll_count = 0; - $output = executeQuery('poll.insertPoll', $poll_args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 개별 설문 등록 - foreach($args->poll as $key => $val) { - unset($title_args); - $title_args->poll_srl = $poll_srl; - $title_args->poll_index_srl = getNextSequence(); - $title_args->title = $val->title; - $title_args->checkcount = $val->checkcount; - $title_args->poll_count = 0; - $title_args->list_order = $title_args->poll_index_srl * -1; - $title_args->member_srl = $member_srl; - $title_args->upload_target_srl = $upload_target_srl; - $output = executeQuery('poll.insertPollTitle', $title_args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 개별 설문의 항목 추가 - foreach($val->item as $k => $v) { - unset($item_args); - $item_args->poll_srl = $poll_srl; - $item_args->poll_index_srl = $title_args->poll_index_srl; - $item_args->title = $v; - $item_args->poll_count = 0; - $item_args->upload_target_srl = $upload_target_srl; - $output = executeQuery('poll.insertPollItem', $item_args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - } - } - - $oDB->commit(); - - $this->add('poll_srl', $poll_srl); - $this->setMessage('success_registed'); - } - - /** - * @brief 설문 조사에 응함 - **/ - function procPoll() { - $poll_srl = Context::get('poll_srl'); - $poll_srl_indexes = Context::get('poll_srl_indexes'); - $tmp_item_srls = explode(',',$poll_srl_indexes); - for($i=0;$iisPolled($poll_srl)) return new Object(-1, 'msg_already_poll'); - - $oDB = &DB::getInstance(); - $oDB->begin(); - - $args->poll_srl = $poll_srl; - - // 해당 글의 모든 설문조사의 응답수 올림 - $output = executeQuery('poll.updatePoll', $args); - $output = executeQuery('poll.updatePollTitle', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 각 설문조사의 선택된 항목을 기록 - $args->poll_item_srl = implode(',',$item_srls); - $output = executeQuery('poll.updatePollItems', $args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - // 응답자 정보를 로그로 남김 - $log_args->poll_srl = $poll_srl; - - $logged_info = Context::get('logged_info'); - $member_srl = $logged_info->member_srl?$logged_info->member_srl:0; - - $log_args->member_srl = $member_srl; - $log_args->ipaddress = $_SERVER['REMOTE_ADDR']; - $output = executeQuery('poll.insertPollLog', $log_args); - if(!$output->toBool()) { - $oDB->rollback(); - return $output; - } - - $oDB->commit(); - - $skin = Context::get('skin'); - if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default'; - - // tpl 가져오기 - $tpl = $oPollModel->getPollHtml($poll_srl, '', $skin); - - $this->add('poll_srl', $poll_srl); - $this->add('tpl',$tpl); - $this->setMessage('success_poll'); - } - - /** - * @brief 결과 미리 보기 - **/ - function procPollViewResult() { - $poll_srl = Context::get('poll_srl'); - - $skin = Context::get('skin'); - if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default'; - - $oPollModel = &getModel('poll'); - $tpl = $oPollModel->getPollResultHtml($poll_srl, $skin); - - $this->add('poll_srl', $poll_srl); - $this->add('tpl',$tpl); - } - - /** - * @brief 게시글 등록시 poll 연결하는 trigger - **/ - function triggerInsertDocumentPoll(&$obj) { - $this->syncPoll($obj->document_srl, $obj->content); - return new Object(); - } - - /** - * @brief 댓글 등록시 poll 연결하는 trigger - **/ - function triggerInsertCommentPoll(&$obj) { - $this->syncPoll($obj->comment_srl, $obj->content); - return new Object(); - } - - /** - * @brief 게시글 수정시 poll 연결하는 trigger - **/ - function triggerUpdateDocumentPoll(&$obj) { - $this->syncPoll($obj->document_srl, $obj->content); - return new Object(); - } - - /** - * @brief 댓글 등록시 poll 연결하는 trigger - **/ - function triggerUpdateCommentPoll(&$obj) { - $this->syncPoll($obj->comment_srl, $obj->content); - return new Object(); - } - - /** - * @brief 게시글 삭제시 poll 삭제하는 trigger - **/ - function triggerDeleteDocumentPoll(&$obj) { - $document_srl = $obj->document_srl; - if(!$document_srl) return new Object(); - - // 설문조사를 구함 - $args->upload_target_srl = $document_srl; - $output = executeQuery('poll.getPollByTargetSrl', $args); - if(!$output->data) return new Object(); - - $poll_srl = $output->data->poll_srl; - if(!$poll_srl) return new Object(); - - $args->poll_srl = $poll_srl; - - $output = executeQuery('poll.deletePoll', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('poll.deletePollItem', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('poll.deletePollTitle', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('poll.deletePollLog', $args); - if(!$output->toBool()) return $output; - - return new Object(); - } - - /** - * @brief 댓글 삭제시 poll 삭제하는 trigger - **/ - function triggerDeleteCommentPoll(&$obj) { - $comment_srl = $obj->comment_srl; - if(!$comment_srl) return new Object(); - - // 설문조사를 구함 - $args->upload_target_srl = $comment_srl; - $output = executeQuery('poll.getPollByTargetSrl', $args); - if(!$output->data) return new Object(); - - $poll_srl = $output->data->poll_srl; - if(!$poll_srl) return new Object(); - - $args->poll_srl = $poll_srl; - - $output = executeQuery('poll.deletePoll', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('poll.deletePollItem', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('poll.deletePollTitle', $args); - if(!$output->toBool()) return $output; - - $output = executeQuery('poll.deletePollLog', $args); - if(!$output->toBool()) return $output; - - return new Object(); - } - - /** - * @brief 게시글 내용의 설문조사를 구해와서 문서 번호와 연결 - **/ - function syncPoll($upload_target_srl, $content) { - $match_cnt = preg_match_all('!]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^\>]*?)\>!is',$content, $matches); - for($i=0;$i<$match_cnt;$i++) { - $poll_srl = $matches[3][$i]; - - $args = null; - $args->poll_srl = $poll_srl; - $output = executeQuery('poll.getPoll', $args); - $poll = $output->data; - - if($poll->upload_target_srl) continue; - - $args->upload_target_srl = $upload_target_srl; - $output = executeQuery('poll.updatePollTarget', $args); - $output = executeQuery('poll.updatePollTitleTarget', $args); - $output = executeQuery('poll.updatePollItemTarget', $args); - } - } - } -?> + $val) { + if(strpos($key,'tidx')) continue; + if(!preg_match("/^(title|checkcount|item)_/i", $key)) continue; + if(!trim($val)) continue; + + $tmp_arr = explode('_',$key); + + $poll_index = $tmp_arr[1]; + + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + // 세션에서 최고 관리자가 아니면 태그 제거 + if($logged_info->is_admin != 'Y') $val = htmlspecialchars($val); + } + + if($tmp_arr[0]=='title') $tmp_args[$poll_index]->title = $val; + else if($tmp_arr[0]=='checkcount') $tmp_args[$poll_index]->checkcount = $val; + else if($tmp_arr[0]=='item') $tmp_args[$poll_index]->item[] = $val; + } + + foreach($tmp_args as $key => $val) { + if(!$val->checkcount) $val->checkcount = 1; + if($val->title && count($val->item)) $args->poll[] = $val; + } + + if(!count($args->poll)) return new Object(-1, 'cmd_null_item'); + + $args->stop_date = $stop_date; + + // 변수 설정 + $poll_srl = getNextSequence(); + + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl?$logged_info->member_srl:0; + + $oDB = &DB::getInstance(); + $oDB->begin(); + + // 설문의 등록 + unset($poll_args); + $poll_args->poll_srl = $poll_srl; + $poll_args->member_srl = $member_srl; + $poll_args->list_order = $poll_srl*-1; + $poll_args->stop_date = $args->stop_date; + $poll_args->poll_count = 0; + $output = executeQuery('poll.insertPoll', $poll_args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 개별 설문 등록 + foreach($args->poll as $key => $val) { + unset($title_args); + $title_args->poll_srl = $poll_srl; + $title_args->poll_index_srl = getNextSequence(); + $title_args->title = $val->title; + $title_args->checkcount = $val->checkcount; + $title_args->poll_count = 0; + $title_args->list_order = $title_args->poll_index_srl * -1; + $title_args->member_srl = $member_srl; + $title_args->upload_target_srl = $upload_target_srl; + $output = executeQuery('poll.insertPollTitle', $title_args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 개별 설문의 항목 추가 + foreach($val->item as $k => $v) { + unset($item_args); + $item_args->poll_srl = $poll_srl; + $item_args->poll_index_srl = $title_args->poll_index_srl; + $item_args->title = $v; + $item_args->poll_count = 0; + $item_args->upload_target_srl = $upload_target_srl; + $output = executeQuery('poll.insertPollItem', $item_args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + } + } + + $oDB->commit(); + + $this->add('poll_srl', $poll_srl); + $this->setMessage('success_registed'); + } + + /** + * @brief 설문 조사에 응함 + **/ + function procPoll() { + $poll_srl = Context::get('poll_srl'); + $poll_srl_indexes = Context::get('poll_srl_indexes'); + $tmp_item_srls = explode(',',$poll_srl_indexes); + for($i=0;$iisPolled($poll_srl)) return new Object(-1, 'msg_already_poll'); + + $oDB = &DB::getInstance(); + $oDB->begin(); + + $args->poll_srl = $poll_srl; + + // 해당 글의 모든 설문조사의 응답수 올림 + $output = executeQuery('poll.updatePoll', $args); + $output = executeQuery('poll.updatePollTitle', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 각 설문조사의 선택된 항목을 기록 + $args->poll_item_srl = implode(',',$item_srls); + $output = executeQuery('poll.updatePollItems', $args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + // 응답자 정보를 로그로 남김 + $log_args->poll_srl = $poll_srl; + + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl?$logged_info->member_srl:0; + + $log_args->member_srl = $member_srl; + $log_args->ipaddress = $_SERVER['REMOTE_ADDR']; + $output = executeQuery('poll.insertPollLog', $log_args); + if(!$output->toBool()) { + $oDB->rollback(); + return $output; + } + + $oDB->commit(); + + $skin = Context::get('skin'); + if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default'; + + // tpl 가져오기 + $tpl = $oPollModel->getPollHtml($poll_srl, '', $skin); + + $this->add('poll_srl', $poll_srl); + $this->add('tpl',$tpl); + $this->setMessage('success_poll'); + } + + /** + * @brief 결과 미리 보기 + **/ + function procPollViewResult() { + $poll_srl = Context::get('poll_srl'); + + $skin = Context::get('skin'); + if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default'; + + $oPollModel = &getModel('poll'); + $tpl = $oPollModel->getPollResultHtml($poll_srl, $skin); + + $this->add('poll_srl', $poll_srl); + $this->add('tpl',$tpl); + } + + /** + * @brief 게시글 등록시 poll 연결하는 trigger + **/ + function triggerInsertDocumentPoll(&$obj) { + $this->syncPoll($obj->document_srl, $obj->content); + return new Object(); + } + + /** + * @brief 댓글 등록시 poll 연결하는 trigger + **/ + function triggerInsertCommentPoll(&$obj) { + $this->syncPoll($obj->comment_srl, $obj->content); + return new Object(); + } + + /** + * @brief 게시글 수정시 poll 연결하는 trigger + **/ + function triggerUpdateDocumentPoll(&$obj) { + $this->syncPoll($obj->document_srl, $obj->content); + return new Object(); + } + + /** + * @brief 댓글 등록시 poll 연결하는 trigger + **/ + function triggerUpdateCommentPoll(&$obj) { + $this->syncPoll($obj->comment_srl, $obj->content); + return new Object(); + } + + /** + * @brief 게시글 삭제시 poll 삭제하는 trigger + **/ + function triggerDeleteDocumentPoll(&$obj) { + $document_srl = $obj->document_srl; + if(!$document_srl) return new Object(); + + // 설문조사를 구함 + $args->upload_target_srl = $document_srl; + $output = executeQuery('poll.getPollByTargetSrl', $args); + if(!$output->data) return new Object(); + + $poll_srl = $output->data->poll_srl; + if(!$poll_srl) return new Object(); + + $args->poll_srl = $poll_srl; + + $output = executeQuery('poll.deletePoll', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('poll.deletePollItem', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('poll.deletePollTitle', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('poll.deletePollLog', $args); + if(!$output->toBool()) return $output; + + return new Object(); + } + + /** + * @brief 댓글 삭제시 poll 삭제하는 trigger + **/ + function triggerDeleteCommentPoll(&$obj) { + $comment_srl = $obj->comment_srl; + if(!$comment_srl) return new Object(); + + // 설문조사를 구함 + $args->upload_target_srl = $comment_srl; + $output = executeQuery('poll.getPollByTargetSrl', $args); + if(!$output->data) return new Object(); + + $poll_srl = $output->data->poll_srl; + if(!$poll_srl) return new Object(); + + $args->poll_srl = $poll_srl; + + $output = executeQuery('poll.deletePoll', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('poll.deletePollItem', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('poll.deletePollTitle', $args); + if(!$output->toBool()) return $output; + + $output = executeQuery('poll.deletePollLog', $args); + if(!$output->toBool()) return $output; + + return new Object(); + } + + /** + * @brief 게시글 내용의 설문조사를 구해와서 문서 번호와 연결 + **/ + function syncPoll($upload_target_srl, $content) { + $match_cnt = preg_match_all('!]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^\>]*?)\>!is',$content, $matches); + for($i=0;$i<$match_cnt;$i++) { + $poll_srl = $matches[3][$i]; + + $args = null; + $args->poll_srl = $poll_srl; + $output = executeQuery('poll.getPoll', $args); + $poll = $output->data; + + if($poll->upload_target_srl) continue; + + $args->upload_target_srl = $upload_target_srl; + $output = executeQuery('poll.updatePollTarget', $args); + $output = executeQuery('poll.updatePollTitleTarget', $args); + $output = executeQuery('poll.updatePollItemTarget', $args); + } + } + } +?> diff --git a/modules/poll/poll.model.php b/modules/poll/poll.model.php index 9aea81ada..4afa88ddc 100644 --- a/modules/poll/poll.model.php +++ b/modules/poll/poll.model.php @@ -1,142 +1,142 @@ -poll_srl = $poll_srl; - - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - } else { - $args->ipaddress = $_SERVER['REMOTE_ADDR']; - } - $output = executeQuery('poll.getPollLog', $args); - if($output->data->count) return true; - return false; - } - - /** - * @brief 설문조사의 html데이터를 return - * 설문조사에 응하였는지에 대한 체크를 한 후 결과를 return - **/ - function getPollHtml($poll_srl, $style = '', $skin = 'default') { - - $args->poll_srl = $poll_srl; - - // 해당 설문조사에 대한 내용을 조사 - $output = executeQuery('poll.getPoll', $args); - if(!$output->data) return ''; - - $poll->style = $style; - $poll->poll_count = (int)$output->data->poll_count; - $poll->stop_date = $output->data->stop_date; - - $output = executeQuery('poll.getPollTitle', $args); - if(!$output->data) return; - if(!is_array($output->data)) $output->data = array($output->data); - foreach($output->data as $key => $val) { - $poll->poll[$val->poll_index_srl]->title = $val->title; - $poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount; - $poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count; - } - - $output = executeQuery('poll.getPollItem', $args); - foreach($output->data as $key => $val) { - $poll->poll[$val->poll_index_srl]->item[] = $val; - } - - $poll->poll_srl = $poll_srl; - - // 종료일이 지났으면 무조건 결과만 - if($poll->stop_date > date("Ymd")) { - if($this->isPolled($poll_srl)) $tpl_file = "result"; - else $tpl_file = "form"; - } else { - $tpl_file = "result"; - } - - Context::set('poll',$poll); - Context::set('skin',$skin); - - // 기본 설정의 스킨, 컬러셋 설정 - $tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin); - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - /** - * @brief 결과 html을 return - **/ - function getPollResultHtml($poll_srl, $skin = 'default') { - $args->poll_srl = $poll_srl; - - // 해당 설문조사에 대한 내용을 조사 - $output = executeQuery('poll.getPoll', $args); - if(!$output->data) return ''; - - $poll->style = $style; - $poll->poll_count = (int)$output->data->poll_count; - $poll->stop_date = $output->data->stop_date; - - $output = executeQuery('poll.getPollTitle', $args); - if(!$output->data) return; - if(!is_array($output->data)) $output->data = array($output->data); - foreach($output->data as $key => $val) { - $poll->poll[$val->poll_index_srl]->title = $val->title; - $poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount; - $poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count; - } - - $output = executeQuery('poll.getPollItem', $args); - foreach($output->data as $key => $val) { - $poll->poll[$val->poll_index_srl]->item[] = $val; - } - - $poll->poll_srl = $poll_srl; - - $tpl_file = "result"; - - Context::set('poll',$poll); - - // 기본 설정의 스킨, 컬러셋 설정 - $tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin); - - $oTemplate = &TemplateHandler::getInstance(); - return $oTemplate->compile($tpl_path, $tpl_file); - } - - /** - * @brief 선택된 설문조사 - 스킨의 컬러셋을 return - **/ - function getPollGetColorsetList() { - $skin = Context::get('skin'); - - $oModuleModel = &getModel('module'); - $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin); - - for($i=0;$icolorset);$i++) { - $colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title); - $colorset_list[] = $colorset; - } - - if(count($colorset_list)) $colorsets = implode("\n", $colorset_list); - $this->add('colorset_list', $colorsets); - } - } -?> +poll_srl = $poll_srl; + + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + } else { + $args->ipaddress = $_SERVER['REMOTE_ADDR']; + } + $output = executeQuery('poll.getPollLog', $args); + if($output->data->count) return true; + return false; + } + + /** + * @brief 설문조사의 html데이터를 return + * 설문조사에 응하였는지에 대한 체크를 한 후 결과를 return + **/ + function getPollHtml($poll_srl, $style = '', $skin = 'default') { + + $args->poll_srl = $poll_srl; + + // 해당 설문조사에 대한 내용을 조사 + $output = executeQuery('poll.getPoll', $args); + if(!$output->data) return ''; + + $poll->style = $style; + $poll->poll_count = (int)$output->data->poll_count; + $poll->stop_date = $output->data->stop_date; + + $output = executeQuery('poll.getPollTitle', $args); + if(!$output->data) return; + if(!is_array($output->data)) $output->data = array($output->data); + foreach($output->data as $key => $val) { + $poll->poll[$val->poll_index_srl]->title = $val->title; + $poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount; + $poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count; + } + + $output = executeQuery('poll.getPollItem', $args); + foreach($output->data as $key => $val) { + $poll->poll[$val->poll_index_srl]->item[] = $val; + } + + $poll->poll_srl = $poll_srl; + + // 종료일이 지났으면 무조건 결과만 + if($poll->stop_date > date("Ymd")) { + if($this->isPolled($poll_srl)) $tpl_file = "result"; + else $tpl_file = "form"; + } else { + $tpl_file = "result"; + } + + Context::set('poll',$poll); + Context::set('skin',$skin); + + // 기본 설정의 스킨, 컬러셋 설정 + $tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin); + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 결과 html을 return + **/ + function getPollResultHtml($poll_srl, $skin = 'default') { + $args->poll_srl = $poll_srl; + + // 해당 설문조사에 대한 내용을 조사 + $output = executeQuery('poll.getPoll', $args); + if(!$output->data) return ''; + + $poll->style = $style; + $poll->poll_count = (int)$output->data->poll_count; + $poll->stop_date = $output->data->stop_date; + + $output = executeQuery('poll.getPollTitle', $args); + if(!$output->data) return; + if(!is_array($output->data)) $output->data = array($output->data); + foreach($output->data as $key => $val) { + $poll->poll[$val->poll_index_srl]->title = $val->title; + $poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount; + $poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count; + } + + $output = executeQuery('poll.getPollItem', $args); + foreach($output->data as $key => $val) { + $poll->poll[$val->poll_index_srl]->item[] = $val; + } + + $poll->poll_srl = $poll_srl; + + $tpl_file = "result"; + + Context::set('poll',$poll); + + // 기본 설정의 스킨, 컬러셋 설정 + $tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin); + + $oTemplate = &TemplateHandler::getInstance(); + return $oTemplate->compile($tpl_path, $tpl_file); + } + + /** + * @brief 선택된 설문조사 - 스킨의 컬러셋을 return + **/ + function getPollGetColorsetList() { + $skin = Context::get('skin'); + + $oModuleModel = &getModel('module'); + $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin); + + for($i=0;$icolorset);$i++) { + $colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title); + $colorset_list[] = $colorset; + } + + if(count($colorset_list)) $colorsets = implode("\n", $colorset_list); + $this->add('colorset_list', $colorsets); + } + } +?> diff --git a/modules/poll/skins/default/skin.xml b/modules/poll/skins/default/skin.xml index fc726fa53..42c5d576e 100644 --- a/modules/poll/skins/default/skin.xml +++ b/modules/poll/skins/default/skin.xml @@ -1,41 +1,41 @@ - - - 설문조사 기본 스킨 - 投票系统默认皮肤 - アンケート調査デフォルトスキン - Default Skin of Poll - Skin mặc định của thăm dò - 投票系統預設面板 - Oylamanın Varsayılan Dış Görünümü - 설문조사 기본 스킨 - 投票系统默认皮肤。 - アンケート調査デフォルトスキン - Default Skin of Poll - Skin mặc định của thăm dò. - 投票系統預設面板。 - Oylamanın Varsayılan Dış Görünümü - 0.1 - 2007-02-28 - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - - - - 기본 - Mặc định - 默认 - デフォルト - Default - 預設 - Varsayılan - - - + + + 설문조사 기본 스킨 + 投票系统默认皮肤 + アンケート調査デフォルトスキン + Default Skin of Poll + Skin mặc định của thăm dò + 投票系統預設面板 + Oylamanın Varsayılan Dış Görünümü + 설문조사 기본 스킨 + 投票系统默认皮肤。 + アンケート調査デフォルトスキン + Default Skin of Poll + Skin mặc định của thăm dò. + 投票系統預設面板。 + Oylamanın Varsayılan Dış Görünümü + 0.1 + 2007-02-28 + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + + + + 기본 + Mặc định + 默认 + デフォルト + Default + 預設 + Varsayılan + + + diff --git a/modules/poll/skins/simple/skin.xml b/modules/poll/skins/simple/skin.xml index 01c072ded..ec5ac9bb3 100644 --- a/modules/poll/skins/simple/skin.xml +++ b/modules/poll/skins/simple/skin.xml @@ -1,38 +1,38 @@ - - - 설문조사 간단한 스킨 - Skin thăm dò đơn giản - アンケート調査の簡単スキン - 投票系统简易皮肤 - 投票系統簡單面板 - Oylama Sistem Dış Görünümü - 설문조사 간단한 스킨 - Skin hiển thị thăm dò đơn giản. - アンケート調査の簡単スキン - 投票系统简易皮肤。 - 投票系統簡單面板。 - Oylama Sistemi Dış Görünümü - 0.1 - 2008-04-16 - - - NHN - NHN - NHN - NHN - NHN - NHN - - - - - 기본 - Mặc định - 默认 - デフォルト - Default - 預設 - Varsayılan - - - + + + 설문조사 간단한 스킨 + Skin thăm dò đơn giản + アンケート調査の簡単スキン + 投票系统简易皮肤 + 投票系統簡單面板 + Oylama Sistem Dış Görünümü + 설문조사 간단한 스킨 + Skin hiển thị thăm dò đơn giản. + アンケート調査の簡単スキン + 投票系统简易皮肤。 + 投票系統簡單面板。 + Oylama Sistemi Dış Görünümü + 0.1 + 2008-04-16 + + + NHN + NHN + NHN + NHN + NHN + NHN + + + + + 기본 + Mặc định + 默认 + デフォルト + Default + 預設 + Varsayılan + + + diff --git a/modules/poll/tpl/js/poll_admin.js b/modules/poll/tpl/js/poll_admin.js index 455d8e199..b878eac60 100644 --- a/modules/poll/tpl/js/poll_admin.js +++ b/modules/poll/tpl/js/poll_admin.js @@ -1,56 +1,56 @@ -/** - * @file modules/poll/js/poll_admin.js - * @author NHN (developers@xpressengine.com) - * @brief poll 모듈의 관리자용 javascript - **/ - -/* 위젯 코드 생성시 스킨을 고르면 컬러셋의 정보를 표시 */ -function doDisplaySkinColorset(sel, colorset) { - var skin = sel.options[sel.selectedIndex].value; - - var params = new Array(); - params["skin"] = skin; - params["colorset"] = colorset; - - var response_tags = new Array("error","message","colorset_list"); - - exec_xml("poll", "getPollGetColorsetList", params, completeGetSkinColorset, response_tags, params); -} - -/* 서버에서 받아온 컬러셋을 표시 */ -function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) { - var sel = xGetElementById("fo_poll").poll_colorset; - var length = sel.options.length; - var selected_colorset = params["colorset"]; - for(var i=0;i - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->poll_checkcount}
    {$lang->poll_join_count}
    {$lang->regdate}
     
    {$no}{htmlspecialchars($val->title)}{$val->checkcount}{$val->poll_count}{zdate($val->regdate,"Y-m-d H:i")}{$lang->cmd_view}
    - - - - -
    - - - - - -
    - - -
    - - - - {$lang->cmd_cancel} -
    -
    + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->title}
    {$lang->poll_checkcount}
    {$lang->poll_join_count}
    {$lang->regdate}
     
    {$no}{htmlspecialchars($val->title)}{$val->checkcount}{$val->poll_count}{zdate($val->regdate,"Y-m-d H:i")}{$lang->cmd_view}
    + + + + +
    + + + + + +
    + + +
    + + + + {$lang->cmd_cancel} +
    +
    diff --git a/modules/rss/conf/info.xml b/modules/rss/conf/info.xml index bdbbc84e5..adbcf61b1 100644 --- a/modules/rss/conf/info.xml +++ b/modules/rss/conf/info.xml @@ -1,36 +1,36 @@ - - - RSS - 整站RSS - RSS - RSS - RSS - RSS - RSS - RSS - RSS - RSS 출력을 담당하는 모듈 - 负责输出RSS的模块。 - RSS出力を担うモジュールです。 - This modules is for printing RSS. - Module này dành cho in ấn RSS. - Este módulo es para imprimir RSS. - Этот модуль служит для печати RSS. - 負責輸出RSS的模組。 - Bu modül RSS çıktısı almak içindir. - 0.1 - 2007-02-28 - utility - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + RSS + 整站RSS + RSS + RSS + RSS + RSS + RSS + RSS + RSS + RSS 출력을 담당하는 모듈 + 负责输出RSS的模块。 + RSS出力を担うモジュールです。 + This modules is for printing RSS. + Module này dành cho in ấn RSS. + Este módulo es para imprimir RSS. + Этот модуль служит для печати RSS. + 負責輸出RSS的模組。 + Bu modül RSS çıktısı almak içindir. + 0.1 + 2007-02-28 + utility + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/rss/lang/en.lang.php b/modules/rss/lang/en.lang.php index 8fb55717f..544039c73 100644 --- a/modules/rss/lang/en.lang.php +++ b/modules/rss/lang/en.lang.php @@ -1,25 +1,25 @@ -rss_disable = "Disable RSS"; - $lang->rss_type = "RSS feed type"; - $lang->open_rss = 'Open RSS'; - $lang->open_rss_types = array( - 'Y' => 'Open all', - 'H' => 'Open summary', - 'N' => 'Not open', - ); - - // for description - $lang->about_rss_disable = "If checked, RSS will be disabled."; - $lang->about_rss_type = "You can assign RSS feed type."; - $lang->about_open_rss = 'You can select RSS on the current module to be open to the public.\nNo matter the view permission of article , RSS will be open to the public by its option.'; - - // for error message - $lang->msg_rss_is_disabled = "RSS function is disabled."; -?> +rss_disable = "Disable RSS"; + $lang->rss_type = "RSS feed type"; + $lang->open_rss = 'Open RSS'; + $lang->open_rss_types = array( + 'Y' => 'Open all', + 'H' => 'Open summary', + 'N' => 'Not open', + ); + + // for description + $lang->about_rss_disable = "If checked, RSS will be disabled."; + $lang->about_rss_type = "You can assign RSS feed type."; + $lang->about_open_rss = 'You can select RSS on the current module to be open to the public.\nNo matter the view permission of article , RSS will be open to the public by its option.'; + + // for error message + $lang->msg_rss_is_disabled = "RSS function is disabled."; +?> diff --git a/modules/rss/lang/es.lang.php b/modules/rss/lang/es.lang.php index e95ab9cf9..2454a7a9a 100644 --- a/modules/rss/lang/es.lang.php +++ b/modules/rss/lang/es.lang.php @@ -1,25 +1,25 @@ -rss_disable = "Desactivar RSS"; - $lang->rss_type = "Tipo de RSS a imprimir"; - $lang->open_rss = 'Abrir RSS'; - $lang->open_rss_types = array( - 'Y' => 'Abrir todo', - 'H' => 'Abrir el sumario', - 'N' => 'No abrir', - ); - - // para la descripcion - $lang->about_rss_disable = "Si selecciona esta opción, RSS será desactivado."; - $lang->about_rss_type = "Usted puede asignar el tipo de RSS a imprimir."; - $lang->about_open_rss = 'Usted puede seleccionar RSS abierto al público en el módulo actual.\nIndependiente de la atribución de ver, dependiendo de la opción de RSS puede ser abierto al público.'; - - // mensajes de error - $lang->msg_rss_is_disabled = "Función de RSS esta desactivada."; -?> +rss_disable = "Desactivar RSS"; + $lang->rss_type = "Tipo de RSS a imprimir"; + $lang->open_rss = 'Abrir RSS'; + $lang->open_rss_types = array( + 'Y' => 'Abrir todo', + 'H' => 'Abrir el sumario', + 'N' => 'No abrir', + ); + + // para la descripcion + $lang->about_rss_disable = "Si selecciona esta opción, RSS será desactivado."; + $lang->about_rss_type = "Usted puede asignar el tipo de RSS a imprimir."; + $lang->about_open_rss = 'Usted puede seleccionar RSS abierto al público en el módulo actual.\nIndependiente de la atribución de ver, dependiendo de la opción de RSS puede ser abierto al público.'; + + // mensajes de error + $lang->msg_rss_is_disabled = "Función de RSS esta desactivada."; +?> diff --git a/modules/rss/lang/fr.lang.php b/modules/rss/lang/fr.lang.php index 81acbdb19..add634860 100644 --- a/modules/rss/lang/fr.lang.php +++ b/modules/rss/lang/fr.lang.php @@ -1,25 +1,25 @@ - - * @brief Paquet du langage en français pour le module de RSS - **/ - - // general words - $lang->rss_disable = "Invalider RSS"; - $lang->rss_type = "Le Format pour imprimer RSS"; - $lang->open_rss = 'Exposer RSS'; - $lang->open_rss_types = array( - 'Y' => 'Exposer Tout', - 'H' => 'Exposer Résumé', - 'N' => 'Ne pas exposer', - ); - - // for description - $lang->about_rss_disable = "Si vous cochez, RSS sera invalidé."; - $lang->about_rss_type = "Vous pouvez désignez le format pour inprimer RSS."; - $lang->about_open_rss = 'Vous pouvez exposez au publique le RSS du module courant ou non.\nN\'importe comment est la permission de l\'article, RSS sera exposé au publique selon son option.'; - - // for error message - $lang->msg_rss_is_disabled = "La fonction RSS est invalidé."; -?> + + * @brief Paquet du langage en français pour le module de RSS + **/ + + // general words + $lang->rss_disable = "Invalider RSS"; + $lang->rss_type = "Le Format pour imprimer RSS"; + $lang->open_rss = 'Exposer RSS'; + $lang->open_rss_types = array( + 'Y' => 'Exposer Tout', + 'H' => 'Exposer Résumé', + 'N' => 'Ne pas exposer', + ); + + // for description + $lang->about_rss_disable = "Si vous cochez, RSS sera invalidé."; + $lang->about_rss_type = "Vous pouvez désignez le format pour inprimer RSS."; + $lang->about_open_rss = 'Vous pouvez exposez au publique le RSS du module courant ou non.\nN\'importe comment est la permission de l\'article, RSS sera exposé au publique selon son option.'; + + // for error message + $lang->msg_rss_is_disabled = "La fonction RSS est invalidé."; +?> diff --git a/modules/rss/lang/jp.lang.php b/modules/rss/lang/jp.lang.php index 75fab07e3..40f9ffb70 100644 --- a/modules/rss/lang/jp.lang.php +++ b/modules/rss/lang/jp.lang.php @@ -1,36 +1,36 @@ -feed = 'RSS発行'; - $lang->total_feed = '統合RSS'; - $lang->rss_disable = "RSS機能オフ"; - $lang->feed_copyright = '著作権'; - $lang->feed_document_count = 'RSSコンテンツ数'; - $lang->feed_image = 'RSSイメージ'; - $lang->rss_type = "出力するRSSタイプ"; - $lang->open_rss = 'RSS配信'; - $lang->open_rss_types = array( - 'Y' => '全文配信 ', - 'H' => '要約配信', - 'N' => '配信しない', - ); - $lang->open_feed_to_total = '統合RSSに含む'; - - // 説明文 - $lang->about_rss_disable = 'チェックするとRSSの出力を行いません。'; - $lang->about_rss_type = '出力するRSSタイプを指定することが出来ます。'; - $lang->about_open_rss = '現在のモジュールに対して「RSS配信」を選択することが出来ます。書き込みの内容が読める権限とは関係なくオプションによってRSSが配信されます。'; - $lang->about_feed_description = '発行するRSSに関する説明を入力します。未入力した場合は該当モジュールで設定された管理用説明が含まれます。'; - $lang->about_feed_copyright = '発行するRSSのコンテンツに対する著作権情報です。'; - $lang->about_part_feed_copyright = '未入力の場合、全体RSS著作権の設定と同様に適用されます。'; - $lang->about_feed_document_count = 'RSSに配信するコンテンツの数 (デフォルト : 15)'; - - // エラーメッセージ - $lang->msg_rss_is_disabled = 'RSS機能がロックされています。'; - $lang->msg_rss_invalid_image_format = 'サポートしないイメージファイルです。\nJPEG, GIF, PNGファイルのみサポートします。'; -?> +feed = 'RSS発行'; + $lang->total_feed = '統合RSS'; + $lang->rss_disable = "RSS機能オフ"; + $lang->feed_copyright = '著作権'; + $lang->feed_document_count = 'RSSコンテンツ数'; + $lang->feed_image = 'RSSイメージ'; + $lang->rss_type = "出力するRSSタイプ"; + $lang->open_rss = 'RSS配信'; + $lang->open_rss_types = array( + 'Y' => '全文配信 ', + 'H' => '要約配信', + 'N' => '配信しない', + ); + $lang->open_feed_to_total = '統合RSSに含む'; + + // 説明文 + $lang->about_rss_disable = 'チェックするとRSSの出力を行いません。'; + $lang->about_rss_type = '出力するRSSタイプを指定することが出来ます。'; + $lang->about_open_rss = '現在のモジュールに対して「RSS配信」を選択することが出来ます。書き込みの内容が読める権限とは関係なくオプションによってRSSが配信されます。'; + $lang->about_feed_description = '発行するRSSに関する説明を入力します。未入力した場合は該当モジュールで設定された管理用説明が含まれます。'; + $lang->about_feed_copyright = '発行するRSSのコンテンツに対する著作権情報です。'; + $lang->about_part_feed_copyright = '未入力の場合、全体RSS著作権の設定と同様に適用されます。'; + $lang->about_feed_document_count = 'RSSに配信するコンテンツの数 (デフォルト : 15)'; + + // エラーメッセージ + $lang->msg_rss_is_disabled = 'RSS機能がロックされています。'; + $lang->msg_rss_invalid_image_format = 'サポートしないイメージファイルです。\nJPEG, GIF, PNGファイルのみサポートします。'; +?> diff --git a/modules/rss/lang/ko.lang.php b/modules/rss/lang/ko.lang.php index 7b49f3bbb..64e33fef5 100644 --- a/modules/rss/lang/ko.lang.php +++ b/modules/rss/lang/ko.lang.php @@ -1,36 +1,36 @@ -feed = '피드(Feed) 발행'; - $lang->total_feed = '통합 피드'; - $lang->rss_disable = '피드(Feed) 끄기'; - $lang->feed_copyright = '저작권'; - $lang->feed_document_count = '한 페이지당 글 수'; - $lang->feed_image = '피드 이미지'; - $lang->rss_type = '출력할 피드(Feed) 형식'; - $lang->open_rss = '피드(Feed) 공개'; - $lang->open_rss_types = array( - 'Y' => '전문 공개 ', - 'H' => '요약 공개', - 'N' => '공개하지 않음', - ); - $lang->open_feed_to_total = '통합 피드에 포함'; - - // 설명문 - $lang->about_rss_disable = '체크하시면 피드(Feed) 출력을 하지 않습니다.'; - $lang->about_rss_type = '출력하실 피드(Feed) 형식을 지정하실 수 있습니다.'; - $lang->about_open_rss = '현재 모듈에 대한 피드(Feed) 공개를 선택하실 수 있습니다. 글 열람 권한과 상관없이 옵션에 따라 RSS가 공개됩니다.'; - $lang->about_feed_description = '발행될 피드에 대한 설명을 입력하실 수 있습니다. 설명을 입력하지 않으실 경우, 해당 모듈에 설정된 관리용 설명이 포함됩니다.'; - $lang->about_feed_copyright = '발행될 피드에 대한 저작권 정보를 입력하실 수 있습니다.'; - $lang->about_part_feed_copyright = '입력하지 않으면 전체 피드 저작권 설정과 동일하게 적용됩니다.'; - $lang->about_feed_document_count = '피드 한 페이지에 공개되는 글 수. (기본 값 : 15)'; - - // 에러 메시지들 - $lang->msg_rss_is_disabled = '피드(Feed) 기능이 잠겨 있습니다.'; - $lang->msg_rss_invalid_image_format = '이미지의 형식이 잘못되었습니다.\nJPEG, GIF, PNG 파일만 지원합니다.'; -?> +feed = '피드(Feed) 발행'; + $lang->total_feed = '통합 피드'; + $lang->rss_disable = '피드(Feed) 끄기'; + $lang->feed_copyright = '저작권'; + $lang->feed_document_count = '한 페이지당 글 수'; + $lang->feed_image = '피드 이미지'; + $lang->rss_type = '출력할 피드(Feed) 형식'; + $lang->open_rss = '피드(Feed) 공개'; + $lang->open_rss_types = array( + 'Y' => '전문 공개 ', + 'H' => '요약 공개', + 'N' => '공개하지 않음', + ); + $lang->open_feed_to_total = '통합 피드에 포함'; + + // 설명문 + $lang->about_rss_disable = '체크하시면 피드(Feed) 출력을 하지 않습니다.'; + $lang->about_rss_type = '출력하실 피드(Feed) 형식을 지정하실 수 있습니다.'; + $lang->about_open_rss = '현재 모듈에 대한 피드(Feed) 공개를 선택하실 수 있습니다. 글 열람 권한과 상관없이 옵션에 따라 RSS가 공개됩니다.'; + $lang->about_feed_description = '발행될 피드에 대한 설명을 입력하실 수 있습니다. 설명을 입력하지 않으실 경우, 해당 모듈에 설정된 관리용 설명이 포함됩니다.'; + $lang->about_feed_copyright = '발행될 피드에 대한 저작권 정보를 입력하실 수 있습니다.'; + $lang->about_part_feed_copyright = '입력하지 않으면 전체 피드 저작권 설정과 동일하게 적용됩니다.'; + $lang->about_feed_document_count = '피드 한 페이지에 공개되는 글 수. (기본 값 : 15)'; + + // 에러 메시지들 + $lang->msg_rss_is_disabled = '피드(Feed) 기능이 잠겨 있습니다.'; + $lang->msg_rss_invalid_image_format = '이미지의 형식이 잘못되었습니다.\nJPEG, GIF, PNG 파일만 지원합니다.'; +?> diff --git a/modules/rss/lang/ru.lang.php b/modules/rss/lang/ru.lang.php index 2b895c08a..edc58809f 100644 --- a/modules/rss/lang/ru.lang.php +++ b/modules/rss/lang/ru.lang.php @@ -1,36 +1,36 @@ -feed = 'Создать(Feed)'; - $lang->total_feed = 'Общий Feed'; - $lang->rss_disable = "Отключить RSS"; - $lang->feed_copyright = 'Копирайт'; - $lang->feed_document_count = 'Количество записей на страницу'; - $lang->feed_image = 'Картинка Feed'; - $lang->rss_type = "Тип RSS"; - $lang->open_rss = 'Показать RSS'; - $lang->open_rss_types = array( - 'Y' => 'Показать все', - 'H' => 'Показать выдержку', - 'N' => 'Не показывать', - ); - $lang->open_feed_to_total = 'Включено в общий Feed'; - - // для описаний - $lang->about_rss_disable = "Если выбрано, RSS будет отключен."; - $lang->about_rss_type = "Вы можете присвоить тип RSS."; - $lang->about_open_rss = 'Вы можете выбрать для того, чтобы RSS доступен публично.\nНезависимо от разрешений для статьи, RSS будет доступна публично согласно ее настройке.'; - $lang->about_feed_description = '발행될 피드에 대한 설명을 입력하실 수 있습니다. 설명을 입력하지 않으실 경우, 해당 모듈에 설정된 관리용 설명이 포함됩니다.'; - $lang->about_feed_copyright = '발행될 피드에 대한 저작권 정보를 입력하실 수 있습니다.'; - $lang->about_part_feed_copyright = '입력하지 않으면 전체 피드 저작권 설정과 동일하게 적용됩니다.'; - $lang->about_feed_document_count = '피드 한 페이지에 공개되는 글 수. (기본 값 : 15)'; - - // для ошибок - $lang->msg_rss_is_disabled = "Функция RSS выключена."; - $lang->msg_rss_invalid_image_format = 'Неправильный тип картинки\nПоддерживаются только JPEG, GIF, PNG файлы'; -?> +feed = 'Создать(Feed)'; + $lang->total_feed = 'Общий Feed'; + $lang->rss_disable = "Отключить RSS"; + $lang->feed_copyright = 'Копирайт'; + $lang->feed_document_count = 'Количество записей на страницу'; + $lang->feed_image = 'Картинка Feed'; + $lang->rss_type = "Тип RSS"; + $lang->open_rss = 'Показать RSS'; + $lang->open_rss_types = array( + 'Y' => 'Показать все', + 'H' => 'Показать выдержку', + 'N' => 'Не показывать', + ); + $lang->open_feed_to_total = 'Включено в общий Feed'; + + // для описаний + $lang->about_rss_disable = "Если выбрано, RSS будет отключен."; + $lang->about_rss_type = "Вы можете присвоить тип RSS."; + $lang->about_open_rss = 'Вы можете выбрать для того, чтобы RSS доступен публично.\nНезависимо от разрешений для статьи, RSS будет доступна публично согласно ее настройке.'; + $lang->about_feed_description = '발행될 피드에 대한 설명을 입력하실 수 있습니다. 설명을 입력하지 않으실 경우, 해당 모듈에 설정된 관리용 설명이 포함됩니다.'; + $lang->about_feed_copyright = '발행될 피드에 대한 저작권 정보를 입력하실 수 있습니다.'; + $lang->about_part_feed_copyright = '입력하지 않으면 전체 피드 저작권 설정과 동일하게 적용됩니다.'; + $lang->about_feed_document_count = '피드 한 페이지에 공개되는 글 수. (기본 값 : 15)'; + + // для ошибок + $lang->msg_rss_is_disabled = "Функция RSS выключена."; + $lang->msg_rss_invalid_image_format = 'Неправильный тип картинки\nПоддерживаются только JPEG, GIF, PNG файлы'; +?> diff --git a/modules/rss/lang/tr.lang.php b/modules/rss/lang/tr.lang.php index d144b7183..7af83eefd 100644 --- a/modules/rss/lang/tr.lang.php +++ b/modules/rss/lang/tr.lang.php @@ -1,25 +1,25 @@ -rss_disable = "RSS devredışı"; - $lang->rss_type = "RSS besleme türü"; - $lang->open_rss = 'RSS Aç'; - $lang->open_rss_types = array( - 'Y' => 'Tümünü Aç', - 'H' => 'Özeti Aç', - 'N' => 'Açma', - ); - - // for description - $lang->about_rss_disable = "İşaretlendiğinde, RSS devredışı bırakılacak."; - $lang->about_rss_type = "RSS besleme türünü atayabilirsiniz."; - $lang->about_open_rss = 'Geçerli modülü herkese açmak için, modüldeki RSS\'yi seçebilirsiniz.\nMakale gösterimi iznine bakılmaksızın , RSS bu seçenekle tüm herkese açık hale gelecektir.'; - - // for error message - $lang->msg_rss_is_disabled = "RSS özelliği devredışı."; -?> +rss_disable = "RSS devredışı"; + $lang->rss_type = "RSS besleme türü"; + $lang->open_rss = 'RSS Aç'; + $lang->open_rss_types = array( + 'Y' => 'Tümünü Aç', + 'H' => 'Özeti Aç', + 'N' => 'Açma', + ); + + // for description + $lang->about_rss_disable = "İşaretlendiğinde, RSS devredışı bırakılacak."; + $lang->about_rss_type = "RSS besleme türünü atayabilirsiniz."; + $lang->about_open_rss = 'Geçerli modülü herkese açmak için, modüldeki RSS\'yi seçebilirsiniz.\nMakale gösterimi iznine bakılmaksızın , RSS bu seçenekle tüm herkese açık hale gelecektir.'; + + // for error message + $lang->msg_rss_is_disabled = "RSS özelliği devredışı."; +?> diff --git a/modules/rss/lang/vi.lang.php b/modules/rss/lang/vi.lang.php index a465b0966..342aff917 100644 --- a/modules/rss/lang/vi.lang.php +++ b/modules/rss/lang/vi.lang.php @@ -1,27 +1,27 @@ -rss_disable = "Tắt RSS"; - $lang->rss_type = "Định dạng RSS"; - $lang->open_rss = 'Mở RSS'; - $lang->open_rss_types = array( - 'Y' => 'Mở tất cả', - 'H' => 'Mở tóm tắt', - 'N' => 'Tắt', - ); - - // for description - $lang->about_rss_disable = "Nếu chọn, RSS sẽ bị tắt."; - $lang->about_rss_type = "Bạn có thể đặt định dạng cho RSS."; - $lang->about_open_rss = 'Bạn có thể mở công khai RSS trên Module hiện tại.\nKhông ảnh hưởng tới quyền truy cập bài viết, RSS sẽ mở công khai với tùy chọn của nó.'; - - // for error message - $lang->msg_rss_is_disabled = "Chức năng RSS đã bị tắt."; -?> +rss_disable = "Tắt RSS"; + $lang->rss_type = "Định dạng RSS"; + $lang->open_rss = 'Mở RSS'; + $lang->open_rss_types = array( + 'Y' => 'Mở tất cả', + 'H' => 'Mở tóm tắt', + 'N' => 'Tắt', + ); + + // for description + $lang->about_rss_disable = "Nếu chọn, RSS sẽ bị tắt."; + $lang->about_rss_type = "Bạn có thể đặt định dạng cho RSS."; + $lang->about_open_rss = 'Bạn có thể mở công khai RSS trên Module hiện tại.\nKhông ảnh hưởng tới quyền truy cập bài viết, RSS sẽ mở công khai với tùy chọn của nó.'; + + // for error message + $lang->msg_rss_is_disabled = "Chức năng RSS đã bị tắt."; +?> diff --git a/modules/rss/lang/zh-CN.lang.php b/modules/rss/lang/zh-CN.lang.php index ef6e18d93..a4c4baee5 100644 --- a/modules/rss/lang/zh-CN.lang.php +++ b/modules/rss/lang/zh-CN.lang.php @@ -1,36 +1,36 @@ -feed = 'RSS发布'; - $lang->total_feed = '整站RSS'; - $lang->rss_disable = "关闭RSS"; - $lang->feed_copyright = '版权'; - $lang->feed_document_count = '每页主题数'; - $lang->feed_image = 'RSS图片'; - $lang->rss_type = "RSS Feed显示样式"; - $lang->open_rss = 'RSS公开'; - $lang->open_rss_types = array( - 'Y' => '公开全文', - 'H' => '公开摘要', - 'N' => '不公开', - ); - $lang->open_feed_to_total = '包含到整站RSS'; - - // 说明 - $lang->about_rss_disable = "选此项不显示RSS。"; - $lang->about_rss_type = "可以指定要显示的RSS形式。"; - $lang->about_open_rss = '可以指定RSS公开程度,RSS公开不受查看内容权限的限制。'; - $lang->about_feed_description = '可以输入简单说明,留空输出该模块的说明。'; - $lang->about_feed_copyright = 'RSS Feed版权信息。'; - $lang->about_part_feed_copyright = '留空版权信息参照整站RSS的版权信息。'; - $lang->about_feed_document_count = '每页要显示的主题数(默认: 15)。'; - - // 错误提示 - $lang->msg_rss_is_disabled = "RSS功能处于锁定状态。"; - $lang->msg_rss_invalid_image_format = '上传的文件格式错误!\n只允许上传JPEG, GIF, PNG图片文件。'; -?> +feed = 'RSS发布'; + $lang->total_feed = '整站RSS'; + $lang->rss_disable = "关闭RSS"; + $lang->feed_copyright = '版权'; + $lang->feed_document_count = '每页主题数'; + $lang->feed_image = 'RSS图片'; + $lang->rss_type = "RSS Feed显示样式"; + $lang->open_rss = 'RSS公开'; + $lang->open_rss_types = array( + 'Y' => '公开全文', + 'H' => '公开摘要', + 'N' => '不公开', + ); + $lang->open_feed_to_total = '包含到整站RSS'; + + // 说明 + $lang->about_rss_disable = "选此项不显示RSS。"; + $lang->about_rss_type = "可以指定要显示的RSS形式。"; + $lang->about_open_rss = '可以指定RSS公开程度,RSS公开不受查看内容权限的限制。'; + $lang->about_feed_description = '可以输入简单说明,留空输出该模块的说明。'; + $lang->about_feed_copyright = 'RSS Feed版权信息。'; + $lang->about_part_feed_copyright = '留空版权信息参照整站RSS的版权信息。'; + $lang->about_feed_document_count = '每页要显示的主题数(默认: 15)。'; + + // 错误提示 + $lang->msg_rss_is_disabled = "RSS功能处于锁定状态。"; + $lang->msg_rss_invalid_image_format = '上传的文件格式错误!\n只允许上传JPEG, GIF, PNG图片文件。'; +?> diff --git a/modules/rss/lang/zh-TW.lang.php b/modules/rss/lang/zh-TW.lang.php index 9d0ca1a6b..b1fd6c65d 100644 --- a/modules/rss/lang/zh-TW.lang.php +++ b/modules/rss/lang/zh-TW.lang.php @@ -1,36 +1,36 @@ -feed = 'RSS Feed'; - $lang->total_feed = 'RSS'; - $lang->rss_disable = "關閉 RSS Feed"; - $lang->feed_copyright = '版權'; - $lang->feed_document_count = '每頁主題數'; - $lang->feed_image = 'RSS 圖片'; - $lang->rss_type = "RSS Feed 類型"; - $lang->open_rss = '公開程度'; - $lang->open_rss_types = array( - 'Y' => '全部公開', - 'H' => '公開摘要', - 'N' => '不公開', - ); - $lang->open_feed_to_total = '是否使用'; - - // 說明 - $lang->about_rss_disable = "隱藏 RSS Feed。"; - $lang->about_rss_type = "指定要顯示的 RSS Feed 類型。"; - $lang->about_open_rss = '選擇該模組 RSS Feed 的公開程度。公開 RSS Feed 將不受檢視內容權限的限制,隨公開 RSS Feed 的選項公開 RSS Feed。'; - $lang->about_feed_description = '請輸入簡介。 也可輸入相關管理使用說明。'; - $lang->about_feed_copyright = '請輸入 Feed 著作權資料。'; - $lang->about_part_feed_copyright = '著作權將會適用所有的 Feed 內容。'; - $lang->about_feed_document_count = '每頁要顯示的主題數。(預設: 15)'; - - // 錯誤提示 - $lang->msg_rss_is_disabled = "RSS Feed 功能未開啟。"; - $lang->msg_rss_invalid_image_format = '錯誤的檔案格式,無法上傳。\n只允許上傳 JPEG, GIF, PNG 等檔案格式。'; -?> +feed = 'RSS Feed'; + $lang->total_feed = 'RSS'; + $lang->rss_disable = "關閉 RSS Feed"; + $lang->feed_copyright = '版權'; + $lang->feed_document_count = '每頁主題數'; + $lang->feed_image = 'RSS 圖片'; + $lang->rss_type = "RSS Feed 類型"; + $lang->open_rss = '公開程度'; + $lang->open_rss_types = array( + 'Y' => '全部公開', + 'H' => '公開摘要', + 'N' => '不公開', + ); + $lang->open_feed_to_total = '是否使用'; + + // 說明 + $lang->about_rss_disable = "隱藏 RSS Feed。"; + $lang->about_rss_type = "指定要顯示的 RSS Feed 類型。"; + $lang->about_open_rss = '選擇該模組 RSS Feed 的公開程度。公開 RSS Feed 將不受檢視內容權限的限制,隨公開 RSS Feed 的選項公開 RSS Feed。'; + $lang->about_feed_description = '請輸入簡介。 也可輸入相關管理使用說明。'; + $lang->about_feed_copyright = '請輸入 Feed 著作權資料。'; + $lang->about_part_feed_copyright = '著作權將會適用所有的 Feed 內容。'; + $lang->about_feed_document_count = '每頁要顯示的主題數。(預設: 15)'; + + // 錯誤提示 + $lang->msg_rss_is_disabled = "RSS Feed 功能未開啟。"; + $lang->msg_rss_invalid_image_format = '錯誤的檔案格式,無法上傳。\n只允許上傳 JPEG, GIF, PNG 等檔案格式。'; +?> diff --git a/modules/rss/rss.admin.controller.php b/modules/rss/rss.admin.controller.php index e17caaa74..8e3275049 100644 --- a/modules/rss/rss.admin.controller.php +++ b/modules/rss/rss.admin.controller.php @@ -1,164 +1,164 @@ -getModuleConfig('rss'); - - $config_vars = Context::getRequestVars(); - - $config_vars->feed_document_count = (int)$config_vars->feed_document_count; - - if(!$config_vars->use_total_feed) $alt_message = 'msg_invalid_request'; - if(!in_array($config_vars->use_total_feed, array('Y','N'))) $config_vars->open_rss = 'Y'; - - if($config_vars->image || $config_vars->del_image) { - $image_obj = $config_vars->image; - $config_vars->image = $total_config->image; - - // 삭제 요청에 대한 변수를 구함 - if($config_vars->del_image == 'Y' || $image_obj) { - FileHandler::removeFile($config_vars->image); - $config_vars->image = ''; - $total_config->image = ''; - } - - // 정상적으로 업로드된 파일이 아니면 무시 - if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name'])) { - // 이미지 파일이 아니어도 무시 (swf는 패스~) - $image_obj['name'] = Context::convertEncodingStr($image_obj['name']); - - if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format'; - else { - // 경로를 정해서 업로드 - $path = './files/attach/images/rss/'; - // 디렉토리 생성 - if(!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured'; - else{ - $filename = $path.$image_obj['name']; - // 파일 이동 - if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured'; - else { - $config_vars->image = $filename; - } - } - } - } - } - if(!$config_vars->image && $config_vars->del_image != 'Y') $config_vars->image = $total_config->image; - - $output = $this->setFeedConfig($config_vars); - - if(!$alt_message) $alt_message = 'success_updated'; - - $alt_message = Context::getLang($alt_message); - Context::set('msg', $alt_message); - - $this->setLayoutPath('./common/tpl'); - $this->setLayoutFile('default_layout.html'); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile("top_refresh.html"); - } - - - /** - * @brief RSS 모듈별 설정 - **/ - function procRssAdminInsertModuleConfig() { - // 대상을 구함 - $module_srl = Context::get('target_module_srl'); - - // 여러개의 모듈 일괄 설정일 경우 - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); - else $module_srl = array($module_srl); - if(!is_array($module_srl)) $module_srl[0] = $module_srl; - - $config_vars = Context::getRequestVars(); - - $open_rss = $config_vars->open_rss; - $open_total_feed = $config_vars->open_total_feed; - $feed_description = trim($config_vars->feed_description); - $feed_copyright = trim($config_vars->feed_copyright); - - if(!$module_srl || !$open_rss) return new Object(-1, 'msg_invalid_request'); - - if(!in_array($open_rss, array('Y','H','N'))) $open_rss = 'N'; - - // 설정 저장 - for($i=0;$isetRssModuleConfig($srl, $open_rss, $open_total_feed, $feed_description, $feed_copyright); - } - - $this->setError(-1); - $this->setMessage('success_updated'); - } - - - /** - * @brief Feed 전체 포함/미포함 체인지 - **/ - function procRssAdminToggleActivate() { - $oRssModel = &getModel('rss'); - - // mid값을 받아옴 - $module_srl = Context::get('module_srl'); - if($module_srl) { - $config = $oRssModel->getRssModuleConfig($module_srl); - if($config->open_total_feed == 'T_N') { - $this->setRssModuleConfig($module_srl, $config->open_rss, 'T_Y', $config->feed_description, $config->feed_copyright); - $this->add("open_total_feed", 'T_Y'); - } - else { - $this->setRssModuleConfig($module_srl, $config->open_rss, 'T_N', $config->feed_description, $config->feed_copyright); - $this->add("open_total_feed", 'T_N'); - } - } - - $this->add("module_srl", $module_srl); - } - - - /** - * @brief RSS모듈의 전체 Feed 설정용 함수 - **/ - function setFeedConfig($config) { - $oModuleController = &getController('module'); - $oModuleController->insertModuleConfig('rss',$config); - return new Object(); - } - - - /** - * @brief RSS 모듈별 설정 함수 - **/ - function setRssModuleConfig($module_srl, $open_rss, $open_total_feed = 'N', $feed_description = 'N', $feed_copyright = 'N') { - $oModuleController = &getController('module'); - $config->open_rss = $open_rss; - $config->open_total_feed = $open_total_feed; - if($feed_description != 'N') { $config->feed_description = $feed_description; } - if($feed_copyright != 'N') { $config->feed_copyright = $feed_copyright; } - $oModuleController->insertModulePartConfig('rss',$module_srl,$config); - return new Object(); - } - } -?> +getModuleConfig('rss'); + + $config_vars = Context::getRequestVars(); + + $config_vars->feed_document_count = (int)$config_vars->feed_document_count; + + if(!$config_vars->use_total_feed) $alt_message = 'msg_invalid_request'; + if(!in_array($config_vars->use_total_feed, array('Y','N'))) $config_vars->open_rss = 'Y'; + + if($config_vars->image || $config_vars->del_image) { + $image_obj = $config_vars->image; + $config_vars->image = $total_config->image; + + // 삭제 요청에 대한 변수를 구함 + if($config_vars->del_image == 'Y' || $image_obj) { + FileHandler::removeFile($config_vars->image); + $config_vars->image = ''; + $total_config->image = ''; + } + + // 정상적으로 업로드된 파일이 아니면 무시 + if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name'])) { + // 이미지 파일이 아니어도 무시 (swf는 패스~) + $image_obj['name'] = Context::convertEncodingStr($image_obj['name']); + + if(!preg_match("/\.(jpg|jpeg|gif|png)$/i", $image_obj['name'])) $alt_message = 'msg_rss_invalid_image_format'; + else { + // 경로를 정해서 업로드 + $path = './files/attach/images/rss/'; + // 디렉토리 생성 + if(!FileHandler::makeDir($path)) $alt_message = 'msg_error_occured'; + else{ + $filename = $path.$image_obj['name']; + // 파일 이동 + if(!move_uploaded_file($image_obj['tmp_name'], $filename)) $alt_message = 'msg_error_occured'; + else { + $config_vars->image = $filename; + } + } + } + } + } + if(!$config_vars->image && $config_vars->del_image != 'Y') $config_vars->image = $total_config->image; + + $output = $this->setFeedConfig($config_vars); + + if(!$alt_message) $alt_message = 'success_updated'; + + $alt_message = Context::getLang($alt_message); + Context::set('msg', $alt_message); + + $this->setLayoutPath('./common/tpl'); + $this->setLayoutFile('default_layout.html'); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile("top_refresh.html"); + } + + + /** + * @brief RSS 모듈별 설정 + **/ + function procRssAdminInsertModuleConfig() { + // 대상을 구함 + $module_srl = Context::get('target_module_srl'); + + // 여러개의 모듈 일괄 설정일 경우 + if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); + else $module_srl = array($module_srl); + if(!is_array($module_srl)) $module_srl[0] = $module_srl; + + $config_vars = Context::getRequestVars(); + + $open_rss = $config_vars->open_rss; + $open_total_feed = $config_vars->open_total_feed; + $feed_description = trim($config_vars->feed_description); + $feed_copyright = trim($config_vars->feed_copyright); + + if(!$module_srl || !$open_rss) return new Object(-1, 'msg_invalid_request'); + + if(!in_array($open_rss, array('Y','H','N'))) $open_rss = 'N'; + + // 설정 저장 + for($i=0;$isetRssModuleConfig($srl, $open_rss, $open_total_feed, $feed_description, $feed_copyright); + } + + $this->setError(-1); + $this->setMessage('success_updated'); + } + + + /** + * @brief Feed 전체 포함/미포함 체인지 + **/ + function procRssAdminToggleActivate() { + $oRssModel = &getModel('rss'); + + // mid값을 받아옴 + $module_srl = Context::get('module_srl'); + if($module_srl) { + $config = $oRssModel->getRssModuleConfig($module_srl); + if($config->open_total_feed == 'T_N') { + $this->setRssModuleConfig($module_srl, $config->open_rss, 'T_Y', $config->feed_description, $config->feed_copyright); + $this->add("open_total_feed", 'T_Y'); + } + else { + $this->setRssModuleConfig($module_srl, $config->open_rss, 'T_N', $config->feed_description, $config->feed_copyright); + $this->add("open_total_feed", 'T_N'); + } + } + + $this->add("module_srl", $module_srl); + } + + + /** + * @brief RSS모듈의 전체 Feed 설정용 함수 + **/ + function setFeedConfig($config) { + $oModuleController = &getController('module'); + $oModuleController->insertModuleConfig('rss',$config); + return new Object(); + } + + + /** + * @brief RSS 모듈별 설정 함수 + **/ + function setRssModuleConfig($module_srl, $open_rss, $open_total_feed = 'N', $feed_description = 'N', $feed_copyright = 'N') { + $oModuleController = &getController('module'); + $config->open_rss = $open_rss; + $config->open_total_feed = $open_total_feed; + if($feed_description != 'N') { $config->feed_description = $feed_description; } + if($feed_copyright != 'N') { $config->feed_copyright = $feed_copyright; } + $oModuleController->insertModulePartConfig('rss',$module_srl,$config); + return new Object(); + } + } +?> diff --git a/modules/rss/rss.admin.view.php b/modules/rss/rss.admin.view.php index fe73928eb..5afe95513 100644 --- a/modules/rss/rss.admin.view.php +++ b/modules/rss/rss.admin.view.php @@ -1,48 +1,48 @@ -setTemplatePath($this->module_path.'tpl'); - } - - - /** - * @brief 관리자 페이지 초기화면 - **/ - function dispRssAdminIndex() { - $oModuleModel = &getModel('module'); - $rss_config = $oModuleModel->getModulePartConfigs('rss'); - $total_config = $oModuleModel->getModuleConfig('rss'); - $oRssModel = &getModel('rss'); - - if($rss_config) { - foreach($rss_config as $module_srl => $config) { - if($config) { - $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); - $site = $oModuleModel->getSiteInfo($module_info->site_srl); - if(!strpos($site->domain, '.')) $vid = $site->domain; - else $site = null; - if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss'); - $feed_config[$module_srl]['mid'] = $module_info->mid; - $feed_config[$module_srl]['open_feed'] = $config->open_rss; - $feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed; - } - } - } - - Context::set('feed_config', $feed_config); - Context::set('total_config', $total_config); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('rss_admin_index'); - } - } +setTemplatePath($this->module_path.'tpl'); + } + + + /** + * @brief 관리자 페이지 초기화면 + **/ + function dispRssAdminIndex() { + $oModuleModel = &getModel('module'); + $rss_config = $oModuleModel->getModulePartConfigs('rss'); + $total_config = $oModuleModel->getModuleConfig('rss'); + $oRssModel = &getModel('rss'); + + if($rss_config) { + foreach($rss_config as $module_srl => $config) { + if($config) { + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + $site = $oModuleModel->getSiteInfo($module_info->site_srl); + if(!strpos($site->domain, '.')) $vid = $site->domain; + else $site = null; + if($site) $feed_config[$module_srl]['url'] = $oRssModel->getModuleFeedUrl($vid, $module_info->mid, 'rss'); + $feed_config[$module_srl]['mid'] = $module_info->mid; + $feed_config[$module_srl]['open_feed'] = $config->open_rss; + $feed_config[$module_srl]['open_total_feed'] = $config->open_total_feed; + } + } + } + + Context::set('feed_config', $feed_config); + Context::set('total_config', $total_config); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('rss_admin_index'); + } + } ?> \ No newline at end of file diff --git a/modules/rss/rss.class.php b/modules/rss/rss.class.php index cbbe2e6fb..0d3c0dff6 100644 --- a/modules/rss/rss.class.php +++ b/modules/rss/rss.class.php @@ -1,80 +1,80 @@ -insertActionForward('rss', 'view', 'rss'); - $oModuleController->insertActionForward('rss', 'view', 'atom'); - - // 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가 - $oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'); - - // 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출 - $oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oModuleModel = &getModel('module'); - - // atom 을 위한 Action forward 추가 - if(!$oModuleModel->getActionForward('atom')) return true; - - // 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가 - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true; - - // 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출 - if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true; - - if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - // atom act 추가 - if(!$oModuleModel->getActionForward('atom')) - $oModuleController->insertActionForward('rss', 'view', 'atom'); - - // 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가 - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) - $oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'); - - // 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출 - if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) - $oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'); - if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) - $oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'); - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - } - - } -?> +insertActionForward('rss', 'view', 'rss'); + $oModuleController->insertActionForward('rss', 'view', 'atom'); + + // 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가 + $oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'); + + // 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출 + $oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oModuleModel = &getModel('module'); + + // atom 을 위한 Action forward 추가 + if(!$oModuleModel->getActionForward('atom')) return true; + + // 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가 + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) return true; + + // 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출 + if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) return true; + + if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // atom act 추가 + if(!$oModuleModel->getActionForward('atom')) + $oModuleController->insertActionForward('rss', 'view', 'atom'); + + // 2007. 10. 18 서비스형 모듈의 추가 설정에 참여하기 위한 trigger 추가 + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before')) + $oModuleController->insertTrigger('module.dispAdditionSetup', 'rss', 'view', 'triggerDispRssAdditionSetup', 'before'); + + // 2007. 10. 19 출력하기 전에 rss url을 세팅하는 트리거 호출 + if(!$oModuleModel->getTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after')) + $oModuleController->insertTrigger('moduleHandler.proc', 'rss', 'controller', 'triggerRssUrlInsert', 'after'); + if($oModuleModel->getTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before')) + $oModuleController->deleteTrigger('display', 'rss', 'controller', 'triggerRssUrlInsert', 'before'); + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + } + + } +?> diff --git a/modules/rss/rss.controller.php b/modules/rss/rss.controller.php index 2ef6aff91..c7cfd7fc6 100644 --- a/modules/rss/rss.controller.php +++ b/modules/rss/rss.controller.php @@ -1,58 +1,58 @@ -getModuleConfig('rss'); - $current_module_srl = Context::get('module_srl'); - $site_module_info = Context::get('site_module_info'); - - if(!$current_module_srl) { - $current_module_info = Context::get('current_module_info'); - $current_module_srl = $current_module_info->module_srl; - } - - if(!$current_module_srl) return new Object(); - - // 선택된 모듈의 rss설정을 가져옴 - $oRssModel = &getModel('rss'); - $rss_config = $oRssModel->getRssModuleConfig($current_module_srl); - - if($rss_config->open_rss != 'N') { - Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss')); - Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom')); - } - - if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') { - if(Context::isAllowRewrite() && !Context::get('vid')) { - $request_uri = Context::getRequestUri(); - Context::set('general_rss_url', $request_uri.'rss'); - Context::set('general_atom_url', $request_uri.'atom'); - } else { - Context::set('general_rss_url', getUrl('','module','rss','act','rss')); - Context::set('general_atom_url', getUrl('','module','rss','act','atom')); - } - } - - return new Object(); - } - } -?> +getModuleConfig('rss'); + $current_module_srl = Context::get('module_srl'); + $site_module_info = Context::get('site_module_info'); + + if(!$current_module_srl) { + $current_module_info = Context::get('current_module_info'); + $current_module_srl = $current_module_info->module_srl; + } + + if(!$current_module_srl) return new Object(); + + // 선택된 모듈의 rss설정을 가져옴 + $oRssModel = &getModel('rss'); + $rss_config = $oRssModel->getRssModuleConfig($current_module_srl); + + if($rss_config->open_rss != 'N') { + Context::set('rss_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'rss')); + Context::set('atom_url', $oRssModel->getModuleFeedUrl(Context::get('vid'), Context::get('mid'), 'atom')); + } + + if(Context::isInstalled() && $site_module_info->mid == Context::get('mid') && $total_config->use_total_feed != 'N') { + if(Context::isAllowRewrite() && !Context::get('vid')) { + $request_uri = Context::getRequestUri(); + Context::set('general_rss_url', $request_uri.'rss'); + Context::set('general_atom_url', $request_uri.'atom'); + } else { + Context::set('general_rss_url', getUrl('','module','rss','act','rss')); + Context::set('general_atom_url', getUrl('','module','rss','act','atom')); + } + } + + return new Object(); + } + } +?> diff --git a/modules/rss/rss.model.php b/modules/rss/rss.model.php index ee669f9f6..4d96e63fe 100644 --- a/modules/rss/rss.model.php +++ b/modules/rss/rss.model.php @@ -1,44 +1,44 @@ -getModulePartConfig('rss', $module_srl); - if(!$module_rss_config) $module_rss_config->open_rss = 'N'; - $module_rss_config->module_srl = $module_srl; - return $module_rss_config; - } - } -?> +getModulePartConfig('rss', $module_srl); + if(!$module_rss_config) $module_rss_config->open_rss = 'N'; + $module_rss_config->module_srl = $module_srl; + return $module_rss_config; + } + } +?> diff --git a/modules/rss/rss.view.php b/modules/rss/rss.view.php index 32894558e..4aca99c3c 100644 --- a/modules/rss/rss.view.php +++ b/modules/rss/rss.view.php @@ -1,234 +1,234 @@ -rss($document_list)를 통해서 결과값을 직접 지정 가능 - **/ - function rss($document_list = null, $rss_title = null, $add_description = null) { - $oDocumentModel = &getModel('document'); - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - // 다른 모듈에서 method로 호출되는 것이 아니라면 현재 요청된 모듈을 대상으로 글과 정보를 구함 - if(!$document_list) { - $site_module_info = Context::get('site_module_info'); - $site_srl = $site_module_info->site_srl; - $mid = Context::get('mid'); ///< 대상 모듈 id, 없으면 전체로 - $start_date = (int)Context::get('start_date'); - $end_date = (int)Context::get('end_date'); - - $module_srls = array(); - $rss_config = array(); - $total_config = ''; - $total_config = $oModuleModel->getModuleConfig('rss'); - - // 하나의 mid가 지정되어 있으면 그 mid에 대한 것만 추출 - if($mid) { - $module_srl = $this->module_info->module_srl; - $config = $oModuleModel->getModulePartConfig('rss', $module_srl); - if($config->open_rss && $config->open_rss != 'N') { - $module_srls[] = $module_srl; - $open_rss_config[$module_srl] = $config->open_rss; - } - - // mid 가 선택되어 있지 않으면 전체 - } else { - if($total_config->use_total_feed != 'N') { - $rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl); - if($rss_config) { - foreach($rss_config as $module_srl => $config) { - if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N') { - $module_srls[] = $module_srl; - $open_rss_config[$module_srl] = $config->open_rss; - } - } - } - } - } - - if(!count($module_srls) && !$add_description) return $this->dispError(); - - if($module_srls) { - $args->module_srl = implode(',',$module_srls); - $module_list = $oModuleModel->getMidList($args); - - $args->search_target = 'is_secret'; - $args->search_keyword = 'N'; - $args->page = (int)Context::get('page'); - $args->list_count = 15; - if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count; - if(!$args->page || $args->page < 1) $args->page = 1; - if($start_date || $start_date != 0) $args->start_date = $start_date; - if($end_date || $end_date != 0) $args->end_date = $end_date; - if($start_date == 0) unset($start_date); - if($end_date == 0) unset($end_date); - - $args->sort_index = 'list_order'; - $args->order_type = 'asc'; - $output = $oDocumentModel->getDocumentList($args); - $document_list = $output->data; - - // 피드 제목 및 정보등을 추출 Context::getBrowserTitle - if($mid) { - $info->title = Context::getBrowserTitle(); - $oModuleController->replaceDefinedLangCode($info->title); - - $info->title = str_replace('\'', ''',$info->title); - if($config->feed_description) { - $info->description = str_replace('\'', ''', htmlspecialchars($config->feed_description)); - } - else { - $info->description = str_replace('\'', ''', htmlspecialchars($this->module_info->description)); - } - $info->link = getUrl('','mid',$mid); - $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($feed_config->feed_copyright)); - if(!$info->feed_copyright) { - $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright)); - } - } - } - } - - if(!$info->title) { - if($rss_title) $info->title = $rss_title; - else if($total_config->feed_title) $info->title = $total_config->feed_title; - else { - $site_module_info = Context::get('site_module_info'); - $info->title = $site_module_info->browser_title; - } - - $oModuleController->replaceDefinedLangCode($info->title); - $info->title = str_replace('\'', ''', htmlspecialchars($info->title)); - $info->description = str_replace('\'', ''', htmlspecialchars($total_config->feed_description)); - $info->link = Context::getRequestUri(); - $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright)); - } - if($add_description) $info->description .= "\r\n".$add_description; - - if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image)); - switch (Context::get('format')) { - case 'atom': - $info->date = date('Y-m-d\TH:i:sP'); - if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } - else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } - break; - case 'rss1.0': - $info->date = date('Y-m-d\TH:i:sP'); - break; - default: - $info->date = date("D, d M Y H:i:s").' '.$GLOBALS['_time_zone']; - break; - } - - if($_SERVER['HTTPS']=='on') $proctcl = 'https://'; - else $proctcl = 'http://'; - - $temp_link = explode('/', $info->link); - if($temp_link[0]=='' && $info->link) { - $info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link; - } - - $temp_id = explode('/', $info->id); - if($temp_id[0]=='' && $info->id) { - $info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id; - } - - $info->language = Context::getLangType(); - - // RSS 출력물에서 사용될 변수 세팅 - Context::set('info', $info); - Context::set('feed_config', $config); - Context::set('open_rss_config', $open_rss_config); - Context::set('document_list', $document_list); - - // 결과 출력을 XMLRPC로 강제 지정 - Context::setResponseMethod("XMLRPC"); - - // 결과물을 얻어와서 에디터 컴포넌트등의 전처리 기능을 수행시킴 - $path = $this->module_path.'tpl/'; - //if($args->start_date || $args->end_date) $file = 'xe_rss'; - //else $file = 'rss20'; - switch (Context::get('format')) { - case 'xe': - $file = 'xe_rss'; - break; - case 'atom': - $file = 'atom10'; - break; - case 'rss1.0': - $file = 'rss10'; - break; - default: - $file = 'rss20'; - break; - } - - $oTemplate = new TemplateHandler(); - - $content = $oTemplate->compile($path, $file); - Context::set('content', $content); - - // 템플릿 파일 지정 - $this->setTemplatePath($path); - $this->setTemplateFile('display'); - } - - /** @brief ATOM 출력 **/ - function atom() { - Context::set('format', 'atom'); - $this->rss(); - } - - /** - * @brief 에러 출력 - **/ - function dispError() { - // 출력 메세지 작성 - $this->rss(null, null, Context::getLang('msg_rss_is_disabled') ); - } - - /** - * @brief 서비스형 모듈의 추가 설정을 위한 부분 - * rss의 사용 형태에 대한 설정만 받음 - **/ - function triggerDispRssAdditionSetup(&$obj) { - $current_module_srl = Context::get('module_srl'); - $current_module_srls = Context::get('module_srls'); - - if(!$current_module_srl && !$current_module_srls) { - // 선택된 모듈의 정보를 가져옴 - $current_module_info = Context::get('current_module_info'); - $current_module_srl = $current_module_info->module_srl; - if(!$current_module_srl) return new Object(); - } - - // 선택된 모듈의 rss설정을 가져옴 - $oRssModel = &getModel('rss'); - $rss_config = $oRssModel->getRssModuleConfig($current_module_srl); - Context::set('rss_config', $rss_config); - - // 템플릿 파일 지정 - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'rss_module_config'); - $obj .= $tpl; - - return new Object(); - } - } -?> +rss($document_list)를 통해서 결과값을 직접 지정 가능 + **/ + function rss($document_list = null, $rss_title = null, $add_description = null) { + $oDocumentModel = &getModel('document'); + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // 다른 모듈에서 method로 호출되는 것이 아니라면 현재 요청된 모듈을 대상으로 글과 정보를 구함 + if(!$document_list) { + $site_module_info = Context::get('site_module_info'); + $site_srl = $site_module_info->site_srl; + $mid = Context::get('mid'); ///< 대상 모듈 id, 없으면 전체로 + $start_date = (int)Context::get('start_date'); + $end_date = (int)Context::get('end_date'); + + $module_srls = array(); + $rss_config = array(); + $total_config = ''; + $total_config = $oModuleModel->getModuleConfig('rss'); + + // 하나의 mid가 지정되어 있으면 그 mid에 대한 것만 추출 + if($mid) { + $module_srl = $this->module_info->module_srl; + $config = $oModuleModel->getModulePartConfig('rss', $module_srl); + if($config->open_rss && $config->open_rss != 'N') { + $module_srls[] = $module_srl; + $open_rss_config[$module_srl] = $config->open_rss; + } + + // mid 가 선택되어 있지 않으면 전체 + } else { + if($total_config->use_total_feed != 'N') { + $rss_config = $oModuleModel->getModulePartConfigs('rss', $site_srl); + if($rss_config) { + foreach($rss_config as $module_srl => $config) { + if($config && $config->open_rss != 'N' && $config->open_total_feed != 'T_N') { + $module_srls[] = $module_srl; + $open_rss_config[$module_srl] = $config->open_rss; + } + } + } + } + } + + if(!count($module_srls) && !$add_description) return $this->dispError(); + + if($module_srls) { + $args->module_srl = implode(',',$module_srls); + $module_list = $oModuleModel->getMidList($args); + + $args->search_target = 'is_secret'; + $args->search_keyword = 'N'; + $args->page = (int)Context::get('page'); + $args->list_count = 15; + if($total_config->feed_document_count) $args->list_count = $total_config->feed_document_count; + if(!$args->page || $args->page < 1) $args->page = 1; + if($start_date || $start_date != 0) $args->start_date = $start_date; + if($end_date || $end_date != 0) $args->end_date = $end_date; + if($start_date == 0) unset($start_date); + if($end_date == 0) unset($end_date); + + $args->sort_index = 'list_order'; + $args->order_type = 'asc'; + $output = $oDocumentModel->getDocumentList($args); + $document_list = $output->data; + + // 피드 제목 및 정보등을 추출 Context::getBrowserTitle + if($mid) { + $info->title = Context::getBrowserTitle(); + $oModuleController->replaceDefinedLangCode($info->title); + + $info->title = str_replace('\'', ''',$info->title); + if($config->feed_description) { + $info->description = str_replace('\'', ''', htmlspecialchars($config->feed_description)); + } + else { + $info->description = str_replace('\'', ''', htmlspecialchars($this->module_info->description)); + } + $info->link = getUrl('','mid',$mid); + $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($feed_config->feed_copyright)); + if(!$info->feed_copyright) { + $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright)); + } + } + } + } + + if(!$info->title) { + if($rss_title) $info->title = $rss_title; + else if($total_config->feed_title) $info->title = $total_config->feed_title; + else { + $site_module_info = Context::get('site_module_info'); + $info->title = $site_module_info->browser_title; + } + + $oModuleController->replaceDefinedLangCode($info->title); + $info->title = str_replace('\'', ''', htmlspecialchars($info->title)); + $info->description = str_replace('\'', ''', htmlspecialchars($total_config->feed_description)); + $info->link = Context::getRequestUri(); + $info->feed_copyright = str_replace('\'', ''', htmlspecialchars($total_config->feed_copyright)); + } + if($add_description) $info->description .= "\r\n".$add_description; + + if($total_config->image) $info->image = Context::getRequestUri().str_replace('\'', ''', htmlspecialchars($total_config->image)); + switch (Context::get('format')) { + case 'atom': + $info->date = date('Y-m-d\TH:i:sP'); + if($mid) { $info->id = getUrl('','mid',$mid,'act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } + else { $info->id = getUrl('','module','rss','act','atom','page',Context::get('page'),'start_date',Context::get('start_date'),'end_date',Context::get('end_date')); } + break; + case 'rss1.0': + $info->date = date('Y-m-d\TH:i:sP'); + break; + default: + $info->date = date("D, d M Y H:i:s").' '.$GLOBALS['_time_zone']; + break; + } + + if($_SERVER['HTTPS']=='on') $proctcl = 'https://'; + else $proctcl = 'http://'; + + $temp_link = explode('/', $info->link); + if($temp_link[0]=='' && $info->link) { + $info->link = $proctcl.$_SERVER['HTTP_HOST'].$info->link; + } + + $temp_id = explode('/', $info->id); + if($temp_id[0]=='' && $info->id) { + $info->id = $proctcl.$_SERVER['HTTP_HOST'].$info->id; + } + + $info->language = Context::getLangType(); + + // RSS 출력물에서 사용될 변수 세팅 + Context::set('info', $info); + Context::set('feed_config', $config); + Context::set('open_rss_config', $open_rss_config); + Context::set('document_list', $document_list); + + // 결과 출력을 XMLRPC로 강제 지정 + Context::setResponseMethod("XMLRPC"); + + // 결과물을 얻어와서 에디터 컴포넌트등의 전처리 기능을 수행시킴 + $path = $this->module_path.'tpl/'; + //if($args->start_date || $args->end_date) $file = 'xe_rss'; + //else $file = 'rss20'; + switch (Context::get('format')) { + case 'xe': + $file = 'xe_rss'; + break; + case 'atom': + $file = 'atom10'; + break; + case 'rss1.0': + $file = 'rss10'; + break; + default: + $file = 'rss20'; + break; + } + + $oTemplate = new TemplateHandler(); + + $content = $oTemplate->compile($path, $file); + Context::set('content', $content); + + // 템플릿 파일 지정 + $this->setTemplatePath($path); + $this->setTemplateFile('display'); + } + + /** @brief ATOM 출력 **/ + function atom() { + Context::set('format', 'atom'); + $this->rss(); + } + + /** + * @brief 에러 출력 + **/ + function dispError() { + // 출력 메세지 작성 + $this->rss(null, null, Context::getLang('msg_rss_is_disabled') ); + } + + /** + * @brief 서비스형 모듈의 추가 설정을 위한 부분 + * rss의 사용 형태에 대한 설정만 받음 + **/ + function triggerDispRssAdditionSetup(&$obj) { + $current_module_srl = Context::get('module_srl'); + $current_module_srls = Context::get('module_srls'); + + if(!$current_module_srl && !$current_module_srls) { + // 선택된 모듈의 정보를 가져옴 + $current_module_info = Context::get('current_module_info'); + $current_module_srl = $current_module_info->module_srl; + if(!$current_module_srl) return new Object(); + } + + // 선택된 모듈의 rss설정을 가져옴 + $oRssModel = &getModel('rss'); + $rss_config = $oRssModel->getRssModuleConfig($current_module_srl); + Context::set('rss_config', $rss_config); + + // 템플릿 파일 지정 + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'rss_module_config'); + $obj .= $tpl; + + return new Object(); + } + } +?> diff --git a/modules/rss/tpl/atom10.html b/modules/rss/tpl/atom10.html index 2ebf22df5..86eac9580 100644 --- a/modules/rss/tpl/atom10.html +++ b/modules/rss/tpl/atom10.html @@ -1,37 +1,37 @@ -{''} - - - {$info->title} - - {str_replace('\'', ''', htmlspecialchars($info->description))} - - {$info->date} - {$info->id} - - - XpressEngine - - {str_replace('\'', ''',htmlspecialchars($oDocument->getTitleText()))} - {$oDocument->getPermanentUrl()} - {$oDocument->getRegdate('Y-m-d\TH:i:sP')} - {zdate($oDocument->get('last_update'),'Y-m-d\TH:i:sP')} - - - - {str_replace('\'', ''',$oDocument->getNickName())} - - {$oDocument->getHomepageUrl()} - - - - {str_replace('\'', ''', htmlspecialchars($oDocument->getTransContent(false,false,true)))} - - {str_replace('\'', ''', htmlspecialchars($oDocument->getContentText(100)))} - - - - - - - - +{''} + + + {$info->title} + + {str_replace('\'', ''', htmlspecialchars($info->description))} + + {$info->date} + {$info->id} + + + XpressEngine + + {str_replace('\'', ''',htmlspecialchars($oDocument->getTitleText()))} + {$oDocument->getPermanentUrl()} + {$oDocument->getRegdate('Y-m-d\TH:i:sP')} + {zdate($oDocument->get('last_update'),'Y-m-d\TH:i:sP')} + + + + {str_replace('\'', ''',$oDocument->getNickName())} + + {$oDocument->getHomepageUrl()} + + + + {str_replace('\'', ''', htmlspecialchars($oDocument->getTransContent(false,false,true)))} + + {str_replace('\'', ''', htmlspecialchars($oDocument->getContentText(100)))} + + + + + + + + diff --git a/modules/rss/tpl/js/rss.js b/modules/rss/tpl/js/rss.js index 10f2b3e50..cc8fc9646 100644 --- a/modules/rss/tpl/js/rss.js +++ b/modules/rss/tpl/js/rss.js @@ -1,17 +1,17 @@ - -function doToggleRss(module_srl) { - var params = new Array(); - params['module_srl'] = module_srl; - - var response_tags = new Array('error','message','module_srl','open_total_feed'); - exec_xml('rss','procRssAdminToggleActivate',params, doChangeIcon ,response_tags ); -} - -function doChangeIcon(ret_obj, response_tags) { - var obj = document.getElementById('dotogglerss_'+ret_obj['module_srl']); - if(ret_obj['open_total_feed'] == 'T_N') { - obj.className = "buttonSet buttonDisable"; - } else { - obj.className = "buttonSet buttonActive"; - } + +function doToggleRss(module_srl) { + var params = new Array(); + params['module_srl'] = module_srl; + + var response_tags = new Array('error','message','module_srl','open_total_feed'); + exec_xml('rss','procRssAdminToggleActivate',params, doChangeIcon ,response_tags ); +} + +function doChangeIcon(ret_obj, response_tags) { + var obj = document.getElementById('dotogglerss_'+ret_obj['module_srl']); + if(ret_obj['open_total_feed'] == 'T_N') { + obj.className = "buttonSet buttonDisable"; + } else { + obj.className = "buttonSet buttonActive"; + } } \ No newline at end of file diff --git a/modules/rss/tpl/rss_admin_index.html b/modules/rss/tpl/rss_admin_index.html index 1fb4922e6..faca1ef9f 100644 --- a/modules/rss/tpl/rss_admin_index.html +++ b/modules/rss/tpl/rss_admin_index.html @@ -1,83 +1,83 @@ - -

    {$lang->total_feed} {$lang->cmd_management}

    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {$lang->total_feed}
    - -
    {$lang->title}
    - -
    {$lang->description}
    - -
    {$lang->feed_image}
    - -
    - image
    - - -
    - - -
    {$lang->feed_copyright}
    - -

    {$lang->about_feed_copyright}

    -
    {$lang->feed_document_count}
    - -

    {$lang->about_feed_document_count}

    -
    -
    - -

    {$lang->feed} {$lang->cmd_management}

    - - - - - - - - - - - - - - -
    {$lang->mid} - {$lang->open_rss} - {$lang->open_feed_to_total} -
    {$config['mid']}{$lang->open_rss_types[$config['open_feed']]}class="buttonSet buttonDisable">{$lang->notuse}class="buttonSet buttonActive">{$lang->use}
    - + +

    {$lang->total_feed} {$lang->cmd_management}

    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {$lang->total_feed}
    + +
    {$lang->title}
    + +
    {$lang->description}
    + +
    {$lang->feed_image}
    + +
    + image
    + + +
    + + +
    {$lang->feed_copyright}
    + +

    {$lang->about_feed_copyright}

    +
    {$lang->feed_document_count}
    + +

    {$lang->about_feed_document_count}

    +
    +
    + +

    {$lang->feed} {$lang->cmd_management}

    + + + + + + + + + + + + + + +
    {$lang->mid} + {$lang->open_rss} + {$lang->open_feed_to_total} +
    {$config['mid']}{$lang->open_rss_types[$config['open_feed']]}class="buttonSet buttonDisable">{$lang->notuse}class="buttonSet buttonActive">{$lang->use}
    + \ No newline at end of file diff --git a/modules/session/conf/info.xml b/modules/session/conf/info.xml index f06d7acbe..1aba77f3c 100644 --- a/modules/session/conf/info.xml +++ b/modules/session/conf/info.xml @@ -1,50 +1,50 @@ - - - 세션 관리자 - セッション管理 - Session - Session - 会话管理 - SESSION管理 - Oturum - - 접속자의 세션을 관리하는 모듈입니다. - 기본적인 세션 설정과 사용뿐 아니라 세션 정보를 이용하여 접속자등의 세션 기반의 정보를 제공하는 기능도 있습니다. - - - アクセスユーザのセッションを管理します。 - 基本的セッション設定はもちろん、セッション情報を利用してアクセスユーザなどのセッション基盤の情報を提供する機能も持っています。 - - - This module manages session data. - You will get not only session setting or using but also session-level data such as visitors by using session data. - - - Bu modül oturum verisini yönetir. - Siz sadece oturum ayarı veya kullanımı değil ayrıca oturum bilgilerini kullanan kullanıcıların oturum-seviyesi verilerini de elde edeceksiniz. - - Module này quản lý dữ liệu Session. - Bạn không phải chỉ duy nhất thiết lập Session hay sử dụng, Cấp độ của Session phụ thuộc vào lượng người truy cập trên Website của bạn. - - - 管理在线会员会话(session)功能的模块。 - 提供最基本的会话设置及使用,并且还可以获得基于会话功能的在线会员信息。 - - - 管理線上會員SESSION功能的模組。 - 提供最基本的SESSION設置和使用,且還可以獲得此功能的線上會員資料。 - - 0.1 - 2008-06-18 - system - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 세션 관리자 + セッション管理 + Session + Session + 会话管理 + SESSION管理 + Oturum + + 접속자의 세션을 관리하는 모듈입니다. + 기본적인 세션 설정과 사용뿐 아니라 세션 정보를 이용하여 접속자등의 세션 기반의 정보를 제공하는 기능도 있습니다. + + + アクセスユーザのセッションを管理します。 + 基本的セッション設定はもちろん、セッション情報を利用してアクセスユーザなどのセッション基盤の情報を提供する機能も持っています。 + + + This module manages session data. + You will get not only session setting or using but also session-level data such as visitors by using session data. + + + Bu modül oturum verisini yönetir. + Siz sadece oturum ayarı veya kullanımı değil ayrıca oturum bilgilerini kullanan kullanıcıların oturum-seviyesi verilerini de elde edeceksiniz. + + Module này quản lý dữ liệu Session. + Bạn không phải chỉ duy nhất thiết lập Session hay sử dụng, Cấp độ của Session phụ thuộc vào lượng người truy cập trên Website của bạn. + + + 管理在线会员会话(session)功能的模块。 + 提供最基本的会话设置及使用,并且还可以获得基于会话功能的在线会员信息。 + + + 管理線上會員SESSION功能的模組。 + 提供最基本的SESSION設置和使用,且還可以獲得此功能的線上會員資料。 + + 0.1 + 2008-06-18 + system + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/session/lang/en.lang.php b/modules/session/lang/en.lang.php index bbc9228a5..e4b801906 100644 --- a/modules/session/lang/en.lang.php +++ b/modules/session/lang/en.lang.php @@ -1,13 +1,13 @@ -session = 'Session'; - $lang->about_session = "This module manages sessions\nFrequent session arrangement will provide better environment for your site."; - - $lang->cmd_clear_session = 'Arrange Session'; - $lang->session_cleared = 'Session data have been arranged succesfully'; -?> +session = 'Session'; + $lang->about_session = "This module manages sessions\nFrequent session arrangement will provide better environment for your site."; + + $lang->cmd_clear_session = 'Arrange Session'; + $lang->session_cleared = 'Session data have been arranged succesfully'; +?> diff --git a/modules/session/lang/fr.lang.php b/modules/session/lang/fr.lang.php index d0d3ad35e..84a3043d4 100644 --- a/modules/session/lang/fr.lang.php +++ b/modules/session/lang/fr.lang.php @@ -1,13 +1,13 @@ - - * @brief Paquet du langage en français pour le module de la Session - **/ - - $lang->session = 'Session'; - $lang->about_session = "Ce module administre les sessions\nL'arrangement fréquent des sessions pourvoira de meilleur environnement pour votre site Web."; - - $lang->cmd_clear_session = 'Arranger la Session'; - $lang->session_cleared = 'Les données de Session sont arrangées avec succès'; -?> + + * @brief Paquet du langage en français pour le module de la Session + **/ + + $lang->session = 'Session'; + $lang->about_session = "Ce module administre les sessions\nL'arrangement fréquent des sessions pourvoira de meilleur environnement pour votre site Web."; + + $lang->cmd_clear_session = 'Arranger la Session'; + $lang->session_cleared = 'Les données de Session sont arrangées avec succès'; +?> diff --git a/modules/session/lang/jp.lang.php b/modules/session/lang/jp.lang.php index 4bf76e90d..a0e60f1bf 100644 --- a/modules/session/lang/jp.lang.php +++ b/modules/session/lang/jp.lang.php @@ -1,13 +1,13 @@ -session = 'セッション'; - $lang->about_session = "セッションを管理するモジュールです。\n定期的なセッションの整理はサイトパフォーマンスに効果的です。"; - - $lang->cmd_clear_session = 'セッション整理'; - $lang->session_cleared = 'ごみセッションが整理されました。'; -?> +session = 'セッション'; + $lang->about_session = "セッションを管理するモジュールです。\n定期的なセッションの整理はサイトパフォーマンスに効果的です。"; + + $lang->cmd_clear_session = 'セッション整理'; + $lang->session_cleared = 'ごみセッションが整理されました。'; +?> diff --git a/modules/session/lang/ko.lang.php b/modules/session/lang/ko.lang.php index 379efb2c8..e9353b3e9 100644 --- a/modules/session/lang/ko.lang.php +++ b/modules/session/lang/ko.lang.php @@ -1,13 +1,13 @@ -session = '세션'; - $lang->about_session = "세션 관리를 하는 모듈입니다.\n틈틈이 세션 정리를 하시면 사이트 운영에 보다 좋은 효과를 낼 수 있습니다."; - - $lang->cmd_clear_session = '세션 정리'; - $lang->session_cleared = '쓸모 없는 세션 정보가 정리되었습니다.'; -?> +session = '세션'; + $lang->about_session = "세션 관리를 하는 모듈입니다.\n틈틈이 세션 정리를 하시면 사이트 운영에 보다 좋은 효과를 낼 수 있습니다."; + + $lang->cmd_clear_session = '세션 정리'; + $lang->session_cleared = '쓸모 없는 세션 정보가 정리되었습니다.'; +?> diff --git a/modules/session/lang/tr.lang.php b/modules/session/lang/tr.lang.php index 411efd4b2..9cae1e715 100644 --- a/modules/session/lang/tr.lang.php +++ b/modules/session/lang/tr.lang.php @@ -1,13 +1,13 @@ -session = 'Oturum'; - $lang->about_session = "Bu modül oturumları yönetir\nAlışılmış oturum düzenlemesi, sitenize daha iyi bir ortam sağlayacaktır."; - - $lang->cmd_clear_session = 'Oturum Düzenle'; - $lang->session_cleared = 'Oturum verisi başarıyla düzenlendi'; -?> +session = 'Oturum'; + $lang->about_session = "Bu modül oturumları yönetir\nAlışılmış oturum düzenlemesi, sitenize daha iyi bir ortam sağlayacaktır."; + + $lang->cmd_clear_session = 'Oturum Düzenle'; + $lang->session_cleared = 'Oturum verisi başarıyla düzenlendi'; +?> diff --git a/modules/session/lang/vi.lang.php b/modules/session/lang/vi.lang.php index 26c068b95..b5e035fd2 100644 --- a/modules/session/lang/vi.lang.php +++ b/modules/session/lang/vi.lang.php @@ -1,15 +1,15 @@ -session = 'Session'; - $lang->about_session = "Module này quản lý những Session\nThường xuyên xắp xếp Session sẽ giúp Website của bạn hoạt động ổn định và nhanh hơn."; - - $lang->cmd_clear_session = 'Sắp xếp Session'; - $lang->session_cleared = 'Session Data đã được sắp xếp thành công!'; -?> +session = 'Session'; + $lang->about_session = "Module này quản lý những Session\nThường xuyên xắp xếp Session sẽ giúp Website của bạn hoạt động ổn định và nhanh hơn."; + + $lang->cmd_clear_session = 'Sắp xếp Session'; + $lang->session_cleared = 'Session Data đã được sắp xếp thành công!'; +?> diff --git a/modules/session/lang/zh-CN.lang.php b/modules/session/lang/zh-CN.lang.php index 6da3865e5..636cec3bc 100644 --- a/modules/session/lang/zh-CN.lang.php +++ b/modules/session/lang/zh-CN.lang.php @@ -1,13 +1,13 @@ -session = '会话'; - $lang->about_session = "管理会话的模块。\n有时间清理无用会话,可提高网站效率。"; - - $lang->cmd_clear_session = '清理会话'; - $lang->session_cleared = '无用会话已清理完毕。'; -?> +session = '会话'; + $lang->about_session = "管理会话的模块。\n有时间清理无用会话,可提高网站效率。"; + + $lang->cmd_clear_session = '清理会话'; + $lang->session_cleared = '无用会话已清理完毕。'; +?> diff --git a/modules/session/lang/zh-TW.lang.php b/modules/session/lang/zh-TW.lang.php index 94afec7a9..07be5a37c 100644 --- a/modules/session/lang/zh-TW.lang.php +++ b/modules/session/lang/zh-TW.lang.php @@ -1,13 +1,13 @@ -session = 'SESSION'; - $lang->about_session = "管理SESSION的模組。\n請定時清理SESSION,可提高網站效率。"; - - $lang->cmd_clear_session = '清理SESSION'; - $lang->session_cleared = 'SESSION已清理完畢。'; -?> +session = 'SESSION'; + $lang->about_session = "管理SESSION的模組。\n請定時清理SESSION,可提高網站效率。"; + + $lang->cmd_clear_session = '清理SESSION'; + $lang->session_cleared = 'SESSION已清理完畢。'; +?> diff --git a/modules/session/session.admin.controller.php b/modules/session/session.admin.controller.php index 5bebb9154..6e339a98b 100644 --- a/modules/session/session.admin.controller.php +++ b/modules/session/session.admin.controller.php @@ -1,26 +1,26 @@ -gc(0); - - $this->add('result',Context::getLang('session_cleared')); - } - } -?> +gc(0); + + $this->add('result',Context::getLang('session_cleared')); + } + } +?> diff --git a/modules/session/session.admin.view.php b/modules/session/session.admin.view.php index 46b44f4a7..be07935df 100644 --- a/modules/session/session.admin.view.php +++ b/modules/session/session.admin.view.php @@ -1,26 +1,26 @@ -setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('index'); - } - - } -?> +setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('index'); + } + + } +?> diff --git a/modules/session/session.class.php b/modules/session/session.class.php index 223891743..266c4cdbd 100644 --- a/modules/session/session.class.php +++ b/modules/session/session.class.php @@ -1,83 +1,83 @@ -session_started= true; - } - - /** - * @brief 설치시 추가 작업이 필요할시 구현 - **/ - function moduleInstall() { - $oDB = &DB::getInstance(); - $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid")); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oDB = &DB::getInstance(); - if(!$oDB->isTableExists('session')) return true; - if(!$oDB->isColumnExists("session","cur_mid")) return true; - if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true; - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB = &DB::getInstance(); - $oModuleModel = &getModel('module'); - - if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml'); - - if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128); - - if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid")); - } - - /** - * @brief session string decode - **/ - function unSerializeSession($val) { - $vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); - for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]); - return $result; - } - - /** - * @brief session string encode - **/ - function serializeSession($data) { - if(!count($data)) return; - - $str = ''; - foreach($data as $key => $val) $str .= $key.'|'.serialize($val); - return substr($str, 0, strlen($str)-1).'}'; - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - // 기존 파일 기반의 세션 삭제 - FileHandler::removeDir(_XE_PATH_."files/sessions"); - } - } -?> +session_started= true; + } + + /** + * @brief 설치시 추가 작업이 필요할시 구현 + **/ + function moduleInstall() { + $oDB = &DB::getInstance(); + $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid")); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oDB = &DB::getInstance(); + if(!$oDB->isTableExists('session')) return true; + if(!$oDB->isColumnExists("session","cur_mid")) return true; + if(!$oDB->isIndexExists("session","idx_session_update_mid")) return true; + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB = &DB::getInstance(); + $oModuleModel = &getModel('module'); + + if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml'); + + if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128); + + if(!$oDB->isIndexExists("session","idx_session_update_mid")) $oDB->addIndex("session","idx_session_update_mid", array("member_srl","last_update","cur_mid")); + } + + /** + * @brief session string decode + **/ + function unSerializeSession($val) { + $vars = preg_split('/([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff^|]*)\|/', $val,-1,PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); + for($i=0; $vars[$i]; $i++) $result[$vars[$i++]] = unserialize($vars[$i]); + return $result; + } + + /** + * @brief session string encode + **/ + function serializeSession($data) { + if(!count($data)) return; + + $str = ''; + foreach($data as $key => $val) $str .= $key.'|'.serialize($val); + return substr($str, 0, strlen($str)-1).'}'; + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + // 기존 파일 기반의 세션 삭제 + FileHandler::removeDir(_XE_PATH_."files/sessions"); + } + } +?> diff --git a/modules/session/session.controller.php b/modules/session/session.controller.php index 37059d6b0..9b64e9cbc 100644 --- a/modules/session/session.controller.php +++ b/modules/session/session.controller.php @@ -1,70 +1,70 @@ -session_started) return; - - $args->session_key = $session_key; - $output = executeQuery('session.getSession', $args); - $session_info = $output->data; - if($session_info->session_key == $session_key && $session_info->ipaddress != $_SERVER['REMOTE_ADDR']) { - executeQuery('session.deleteSession', $args); - return true; - } - - $args->expired = date("YmdHis", time()+$this->lifetime); - $args->val = $val; - $args->cur_mid = Context::get('mid'); - if(!$args->cur_mid) { - $module_info = Context::get('current_module_info'); - $args->cur_mid = $module_info->mid; - } - - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - $args->member_srl = $logged_info->member_srl; - } else { - $args->member_srl = 0; - } - - if($session_info->session_key) $output = executeQuery('session.updateSession', $args); - else $output = executeQuery('session.insertSession', $args); - - return true; - } - - function destroy($session_key) { - if(!$session_key || !$this->session_started) return; - - $args->session_key = $session_key; - executeQuery('session.deleteSession', $args); - return true; - } - - function gc($maxlifetime) { - if(!$this->session_started) return; - executeQuery('session.gcSession'); - return true; - } - } -?> +session_started) return; + + $args->session_key = $session_key; + $output = executeQuery('session.getSession', $args); + $session_info = $output->data; + if($session_info->session_key == $session_key && $session_info->ipaddress != $_SERVER['REMOTE_ADDR']) { + executeQuery('session.deleteSession', $args); + return true; + } + + $args->expired = date("YmdHis", time()+$this->lifetime); + $args->val = $val; + $args->cur_mid = Context::get('mid'); + if(!$args->cur_mid) { + $module_info = Context::get('current_module_info'); + $args->cur_mid = $module_info->mid; + } + + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + } else { + $args->member_srl = 0; + } + + if($session_info->session_key) $output = executeQuery('session.updateSession', $args); + else $output = executeQuery('session.insertSession', $args); + + return true; + } + + function destroy($session_key) { + if(!$session_key || !$this->session_started) return; + + $args->session_key = $session_key; + executeQuery('session.deleteSession', $args); + return true; + } + + function gc($maxlifetime) { + if(!$this->session_started) return; + executeQuery('session.gcSession'); + return true; + } + } +?> diff --git a/modules/session/session.model.php b/modules/session/session.model.php index 00b220527..d8542130e 100644 --- a/modules/session/session.model.php +++ b/modules/session/session.model.php @@ -1,93 +1,93 @@ -lifetime; - } - - function read($session_key) { - if(!$session_key || !$this->session_started) return; - - $args->session_key = $session_key; - $output = executeQuery('session.getSession', $args); - - // 읽기 오류 발생시 테이블 생성 유무 확인 - if(!$output->toBool()) { - $oDB = &DB::getInstance(); - if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml'); - if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128); - $output = executeQuery('session.getSession', $args); - } - - // 세션 정보에서 cur_mid값이 없을 경우 테이블 생성 체크 - if(!isset($output->data->cur_mid)) { - $oDB = &DB::getInstance(); - if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128); - } - - return $output->data->val; - } - - /** - * @brief 현재 접속중인 사용자의 목록을 구함 - * 여러개의 인자값을 필요로 해서 object를 인자로 받음 - * limit_count : 대상 수 - * page : 페이지 번호 - * period_time : 인자의 값을 n으로 하여 최근 n분 이내에 세션을 갱신한 대상을 추출함 - * mid : 특정 mid에 속한 사용자 - **/ - function getLoggedMembers($args) { - if(!$args->site_srl) { - $site_module_info = Context::get('site_module_info'); - $args->site_srl = (int)$site_module_info->site_srl; - } - if(!$args->list_count) $args->list_count = 20; - if(!$args->page) $args->page = 1; - if(!$args->period_time) $args->period_time = 3; - $args->last_update = date("YmdHis", time() - $args->period_time*60); - - $output = executeQueryArray('session.getLoggedMembers', $args); - if(!$output->toBool()) return $output; - - $member_srls = array(); - if(count($output->data)) { - foreach($output->data as $key => $val) { - $member_srls[$key] = $val->member_srl; - $member_keys[$val->member_srl] = $key; - } - } - - if(Context::get('is_logged')) { - $logged_info = Context::get('logged_info'); - if(!in_array($logged_info->member_srl, $member_srls)) { - $member_srls[0] = $logged_info->member_srl; - $member_keys[$logged_info->member_srl] = 0; - } - } - - if(!count($member_srls)) return $output; - - $member_args->member_srl = implode(',',$member_srls); - $member_output = executeQueryArray('member.getMembers', $member_args); - if($member_output->data) { - foreach($member_output->data as $key => $val) { - $output->data[$member_keys[$val->member_srl]] = $val; - } - } - - return $output; - } - } -?> +lifetime; + } + + function read($session_key) { + if(!$session_key || !$this->session_started) return; + + $args->session_key = $session_key; + $output = executeQuery('session.getSession', $args); + + // 읽기 오류 발생시 테이블 생성 유무 확인 + if(!$output->toBool()) { + $oDB = &DB::getInstance(); + if(!$oDB->isTableExists('session')) $oDB->createTableByXmlFile($this->module_path.'schemas/session.xml'); + if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128); + $output = executeQuery('session.getSession', $args); + } + + // 세션 정보에서 cur_mid값이 없을 경우 테이블 생성 체크 + if(!isset($output->data->cur_mid)) { + $oDB = &DB::getInstance(); + if(!$oDB->isColumnExists("session","cur_mid")) $oDB->addColumn('session',"cur_mid","varchar",128); + } + + return $output->data->val; + } + + /** + * @brief 현재 접속중인 사용자의 목록을 구함 + * 여러개의 인자값을 필요로 해서 object를 인자로 받음 + * limit_count : 대상 수 + * page : 페이지 번호 + * period_time : 인자의 값을 n으로 하여 최근 n분 이내에 세션을 갱신한 대상을 추출함 + * mid : 특정 mid에 속한 사용자 + **/ + function getLoggedMembers($args) { + if(!$args->site_srl) { + $site_module_info = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + } + if(!$args->list_count) $args->list_count = 20; + if(!$args->page) $args->page = 1; + if(!$args->period_time) $args->period_time = 3; + $args->last_update = date("YmdHis", time() - $args->period_time*60); + + $output = executeQueryArray('session.getLoggedMembers', $args); + if(!$output->toBool()) return $output; + + $member_srls = array(); + if(count($output->data)) { + foreach($output->data as $key => $val) { + $member_srls[$key] = $val->member_srl; + $member_keys[$val->member_srl] = $key; + } + } + + if(Context::get('is_logged')) { + $logged_info = Context::get('logged_info'); + if(!in_array($logged_info->member_srl, $member_srls)) { + $member_srls[0] = $logged_info->member_srl; + $member_keys[$logged_info->member_srl] = 0; + } + } + + if(!count($member_srls)) return $output; + + $member_args->member_srl = implode(',',$member_srls); + $member_output = executeQueryArray('member.getMembers', $member_args); + if($member_output->data) { + foreach($member_output->data as $key => $val) { + $output->data[$member_keys[$val->member_srl]] = $val; + } + } + + return $output; + } + } +?> diff --git a/modules/spamfilter/conf/info.xml b/modules/spamfilter/conf/info.xml index 47f24c540..71e4b4908 100644 --- a/modules/spamfilter/conf/info.xml +++ b/modules/spamfilter/conf/info.xml @@ -1,36 +1,36 @@ - - - 스팸필터 - 垃圾过滤 - Spam Filter - Bộ lọc Spam - Filtro de Spam - スパムフィルター - Фильтр спама - Spam Filtreleyici - 垃圾過濾 - XE의 기본 스팸필터입니다. - XE的基本垃圾过滤模块。 - A default spam filter of XE. - Bộ lọc Spam mặc định của XE. - Filtro de Span predefinido de XE. - XEのスパムフィルターです。 - Стандартный фильтр спама XE. - XE的基本垃圾過濾模組。 - XE\'nin varsayılan spam filtreleyicisidir. - 0.1 - 2007-02-28 - accessory - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 스팸필터 + 垃圾过滤 + Spam Filter + Bộ lọc Spam + Filtro de Spam + スパムフィルター + Фильтр спама + Spam Filtreleyici + 垃圾過濾 + XE의 기본 스팸필터입니다. + XE的基本垃圾过滤模块。 + A default spam filter of XE. + Bộ lọc Spam mặc định của XE. + Filtro de Span predefinido de XE. + XEのスパムフィルターです。 + Стандартный фильтр спама XE. + XE的基本垃圾過濾模組。 + XE\'nin varsayılan spam filtreleyicisidir. + 0.1 + 2007-02-28 + accessory + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/spamfilter/lang/en.lang.php b/modules/spamfilter/lang/en.lang.php index 9af2e4cab..6f53ca95c 100644 --- a/modules/spamfilter/lang/en.lang.php +++ b/modules/spamfilter/lang/en.lang.php @@ -1,34 +1,34 @@ -cmd_denied_ip = "IP Address Blacklist"; - $lang->cmd_denied_word = "Word Blacklist"; - - // general word - $lang->spamfilter = "Spam filter"; - $lang->denied_ip = "IP Address"; - $lang->interval = "Interval for spam filtering"; - $lang->limit_count = "No. of posting limitation"; - $lang->check_trackback = "Check Trackbacks"; - $lang->word = "Word"; - $lang->hit = 'Hit'; - $lang->latest_hit = 'Latest Hits'; - - // for description word - $lang->about_interval = "All articles attempted for posting within the assigned time will be blocked."; - $lang->about_limit_count = "If exceeded the posting limitation,\n that IP will be regarded as a spam, thus will have limitations on posting articles, comments, and trackbacks."; - $lang->about_denied_ip = "You can add IP address range like 127.0.0.* by using *."; - $lang->about_denied_word = "When you add a word to Word Blacklist,\n articles including it will be blocked."; - $lang->about_check_trackback = "A single IP per an article is allowed for trackbacks."; - - // to post a message - $lang->msg_alert_limited_by_config = 'Posting an article within %s second is not allowed.\n If you keep trying, your IP address will be blacklisted.'; - $lang->msg_alert_denied_word = 'The word "%s" is not allowed.'; - $lang->msg_alert_registered_denied_ip = 'Your IP address is blacklisted,\n so you may have limitations on normal using of this site.\n If you have any questions on that matter, please contact to the site administrator.'; - $lang->msg_alert_trackback_denied = 'Only one trackback per an article is allowed.'; +cmd_denied_ip = "IP Address Blacklist"; + $lang->cmd_denied_word = "Word Blacklist"; + + // general word + $lang->spamfilter = "Spam filter"; + $lang->denied_ip = "IP Address"; + $lang->interval = "Interval for spam filtering"; + $lang->limit_count = "No. of posting limitation"; + $lang->check_trackback = "Check Trackbacks"; + $lang->word = "Word"; + $lang->hit = 'Hit'; + $lang->latest_hit = 'Latest Hits'; + + // for description word + $lang->about_interval = "All articles attempted for posting within the assigned time will be blocked."; + $lang->about_limit_count = "If exceeded the posting limitation,\n that IP will be regarded as a spam, thus will have limitations on posting articles, comments, and trackbacks."; + $lang->about_denied_ip = "You can add IP address range like 127.0.0.* by using *."; + $lang->about_denied_word = "When you add a word to Word Blacklist,\n articles including it will be blocked."; + $lang->about_check_trackback = "A single IP per an article is allowed for trackbacks."; + + // to post a message + $lang->msg_alert_limited_by_config = 'Posting an article within %s second is not allowed.\n If you keep trying, your IP address will be blacklisted.'; + $lang->msg_alert_denied_word = 'The word "%s" is not allowed.'; + $lang->msg_alert_registered_denied_ip = 'Your IP address is blacklisted,\n so you may have limitations on normal using of this site.\n If you have any questions on that matter, please contact to the site administrator.'; + $lang->msg_alert_trackback_denied = 'Only one trackback per an article is allowed.'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/es.lang.php b/modules/spamfilter/lang/es.lang.php index e32ac5c1d..a8762f805 100644 --- a/modules/spamfilter/lang/es.lang.php +++ b/modules/spamfilter/lang/es.lang.php @@ -1,34 +1,34 @@ -cmd_denied_ip = "Lista negra de las direcciones IP"; - $lang->cmd_denied_word = "Lista negra de palabras"; - - // palabras generales - $lang->spamfilter = "Filtro de Spam"; - $lang->denied_ip = "IP prohibido"; - $lang->interval = "Intervalo para el filtro de spam"; - $lang->limit_count = "Número limite"; - $lang->check_trackback = "Chequear trackback"; - $lang->word = "Palabra"; - $lang->hit = '히트'; - $lang->latest_hit = '최근 히트'; - - // para las palabras de descripcion - $lang->about_interval = "Se bloquea el posteo de todo tipo de documentos durante el tiempo asignado."; - $lang->about_limit_count = "Si Usted excede el número límite del posteo,\n Su documento serán reconocido como un spam, y su dirección IP sera agregada en la lista negra."; - $lang->about_denied_ip = "Usted puede asignar rangos de direcciones IP como 127.0.0.* usando *."; - $lang->about_denied_word = "Cuando Usted agrega una palabra a la lista negra de palabras,\n documentos con esa palabra no será registrado."; - $lang->about_check_trackback = "En un documento sólo se permite un trackback por IP."; - - // para registrar un documento - $lang->msg_alert_limited_by_config = 'Se prohibe poestear antes de %s segundos.\n Si Usted trata varias veces, su dirección IP puede ser agregada en la lista negra.'; - $lang->msg_alert_denied_word = 'La palabra "%s" no esta permitido para ser posteado.'; - $lang->msg_alert_registered_denied_ip = 'Su dirección IP fue agregaa en la lista negra,\n por lo cual Usted puede tener limitaciones en su uso normal de este sitio.\n Si Usted tiene alguna inquietud sobre el tema, por favor contactese con el administrador del sitio.'; - $lang->msg_alert_trackback_denied = 'Sólo un trackback por documento está permitido.'; +cmd_denied_ip = "Lista negra de las direcciones IP"; + $lang->cmd_denied_word = "Lista negra de palabras"; + + // palabras generales + $lang->spamfilter = "Filtro de Spam"; + $lang->denied_ip = "IP prohibido"; + $lang->interval = "Intervalo para el filtro de spam"; + $lang->limit_count = "Número limite"; + $lang->check_trackback = "Chequear trackback"; + $lang->word = "Palabra"; + $lang->hit = '히트'; + $lang->latest_hit = '최근 히트'; + + // para las palabras de descripcion + $lang->about_interval = "Se bloquea el posteo de todo tipo de documentos durante el tiempo asignado."; + $lang->about_limit_count = "Si Usted excede el número límite del posteo,\n Su documento serán reconocido como un spam, y su dirección IP sera agregada en la lista negra."; + $lang->about_denied_ip = "Usted puede asignar rangos de direcciones IP como 127.0.0.* usando *."; + $lang->about_denied_word = "Cuando Usted agrega una palabra a la lista negra de palabras,\n documentos con esa palabra no será registrado."; + $lang->about_check_trackback = "En un documento sólo se permite un trackback por IP."; + + // para registrar un documento + $lang->msg_alert_limited_by_config = 'Se prohibe poestear antes de %s segundos.\n Si Usted trata varias veces, su dirección IP puede ser agregada en la lista negra.'; + $lang->msg_alert_denied_word = 'La palabra "%s" no esta permitido para ser posteado.'; + $lang->msg_alert_registered_denied_ip = 'Su dirección IP fue agregaa en la lista negra,\n por lo cual Usted puede tener limitaciones en su uso normal de este sitio.\n Si Usted tiene alguna inquietud sobre el tema, por favor contactese con el administrador del sitio.'; + $lang->msg_alert_trackback_denied = 'Sólo un trackback por documento está permitido.'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/fr.lang.php b/modules/spamfilter/lang/fr.lang.php index 17a06a69c..ace463b50 100644 --- a/modules/spamfilter/lang/fr.lang.php +++ b/modules/spamfilter/lang/fr.lang.php @@ -1,34 +1,34 @@ - - * @brief Paquet du langage en français pour le module du Filtre contre polluriel - **/ - - // de l'action - $lang->cmd_denied_ip = "Liste noire d'Address IP"; - $lang->cmd_denied_word = "Liste noire des Mots"; - - // mots générals - $lang->spamfilter = "Filtre contre Polluriel"; - $lang->denied_ip = "IP à bloquer"; - $lang->interval = "Intervalle à filtrer contre polluriel"; - $lang->limit_count = "Limite d'affichage"; - $lang->check_trackback = "Vérifier les Rétroliens"; - $lang->word = "Mot"; - $lang->hit = '히트'; - $lang->latest_hit = '최근 히트'; - - // descriptions - $lang->about_interval = "L'affichage sera bloqué pendant le temps designé."; - $lang->about_limit_count = "Si l'on excéde la limite d'affichage pendant le temps désigné,\nles articles en plus seront reconnus comme polluriel, et l'adresse IP sera bloqué."; - $lang->about_denied_ip = "Vous pouvez bloquer l'étendue de l'adresse IP comme 127.0.0.* en utilisant *."; - $lang->about_denied_word = "Quand vous enrégistrez un mot dans la liste noire, \nl'article qui comporte le mot ne sera pas affichagé."; - $lang->about_check_trackback = "Le rétrolien peut être permis à un seul IP par article."; - - // messages - $lang->msg_alert_limited_by_config = 'L\'Affichage d\'un article en %s secondes n\'est pas permis.\n Si vous essayez encore, votre adresse IP peut être enrégistré dans la liste noire.'; - $lang->msg_alert_denied_word = 'Le mot "%s" n\'est pas permis d\'afficher.'; - $lang->msg_alert_registered_denied_ip = 'Your IP address is blacklisted,\n so you may have limitations on normal using of this site.\n If you have any questions on that matter, please contact to the site administrator. Votre adresse IP est dans la liste noire, \nvous pouvez donc avoir limitation d\'activité dans ce site. Si vous avez quelque question sur ce fait, contactez l\'administrateur du site, S.V.P.'; - $lang->msg_alert_trackback_denied = 'Un seul rétrolien par article est permis.'; + + * @brief Paquet du langage en français pour le module du Filtre contre polluriel + **/ + + // de l'action + $lang->cmd_denied_ip = "Liste noire d'Address IP"; + $lang->cmd_denied_word = "Liste noire des Mots"; + + // mots générals + $lang->spamfilter = "Filtre contre Polluriel"; + $lang->denied_ip = "IP à bloquer"; + $lang->interval = "Intervalle à filtrer contre polluriel"; + $lang->limit_count = "Limite d'affichage"; + $lang->check_trackback = "Vérifier les Rétroliens"; + $lang->word = "Mot"; + $lang->hit = '히트'; + $lang->latest_hit = '최근 히트'; + + // descriptions + $lang->about_interval = "L'affichage sera bloqué pendant le temps designé."; + $lang->about_limit_count = "Si l'on excéde la limite d'affichage pendant le temps désigné,\nles articles en plus seront reconnus comme polluriel, et l'adresse IP sera bloqué."; + $lang->about_denied_ip = "Vous pouvez bloquer l'étendue de l'adresse IP comme 127.0.0.* en utilisant *."; + $lang->about_denied_word = "Quand vous enrégistrez un mot dans la liste noire, \nl'article qui comporte le mot ne sera pas affichagé."; + $lang->about_check_trackback = "Le rétrolien peut être permis à un seul IP par article."; + + // messages + $lang->msg_alert_limited_by_config = 'L\'Affichage d\'un article en %s secondes n\'est pas permis.\n Si vous essayez encore, votre adresse IP peut être enrégistré dans la liste noire.'; + $lang->msg_alert_denied_word = 'Le mot "%s" n\'est pas permis d\'afficher.'; + $lang->msg_alert_registered_denied_ip = 'Your IP address is blacklisted,\n so you may have limitations on normal using of this site.\n If you have any questions on that matter, please contact to the site administrator. Votre adresse IP est dans la liste noire, \nvous pouvez donc avoir limitation d\'activité dans ce site. Si vous avez quelque question sur ce fait, contactez l\'administrateur du site, S.V.P.'; + $lang->msg_alert_trackback_denied = 'Un seul rétrolien par article est permis.'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/jp.lang.php b/modules/spamfilter/lang/jp.lang.php index 0f6e74b6d..be51e1100 100644 --- a/modules/spamfilter/lang/jp.lang.php +++ b/modules/spamfilter/lang/jp.lang.php @@ -1,34 +1,34 @@ -cmd_denied_ip = '禁止IPリスト'; - $lang->cmd_denied_word = '禁止ワードリスト'; - - // 一般用語 - $lang->spamfilter = 'スパムフィルター'; - $lang->denied_ip = '禁止IP'; - $lang->interval = 'スパム処理間隔'; - $lang->limit_count = '制限数'; - $lang->check_trackback = 'トラックバック検査'; - $lang->word = 'ワード'; - $lang->hit = 'ヒット'; - $lang->latest_hit = '最近ヒット'; - - // 説明文 - $lang->about_interval = '指定された時間内の書き込みが行えないようにします。'; - $lang->about_limit_count = '指定された時間内に制限数を超える書き込みが行われるとスパムとして認識し、該当するIPを禁止します。'; - $lang->about_denied_ip = '「127.0.0.* 」のように「*」で、「127.0.0」以下ののIP帯域をすべて禁止することが出来ます。'; - $lang->about_denied_word = '禁止ワードとして登録されると該当するワードが存在する書き込みを禁することが出来ます。'; - $lang->about_check_trackback = '一つのIPからのみトラックバックを受信するようにします。'; - - // メッセージ出力用 - $lang->msg_alert_limited_by_config = '%s秒以内の書き込みは禁止されます。続けて行うとスパムとして認識され、禁止IPに登録されます。'; - $lang->msg_alert_denied_word = '"%s"は使用が禁止されたワードです。'; - $lang->msg_alert_registered_denied_ip = '禁止IPに登録され、サイト内で正常な活動が制限されています。管理者にお問い合わせ下さい。'; - $lang->msg_alert_trackback_denied = '一つの書き込みには、1つのトラックバックしか受け取れません。'; +cmd_denied_ip = '禁止IPリスト'; + $lang->cmd_denied_word = '禁止ワードリスト'; + + // 一般用語 + $lang->spamfilter = 'スパムフィルター'; + $lang->denied_ip = '禁止IP'; + $lang->interval = 'スパム処理間隔'; + $lang->limit_count = '制限数'; + $lang->check_trackback = 'トラックバック検査'; + $lang->word = 'ワード'; + $lang->hit = 'ヒット'; + $lang->latest_hit = '最近ヒット'; + + // 説明文 + $lang->about_interval = '指定された時間内の書き込みが行えないようにします。'; + $lang->about_limit_count = '指定された時間内に制限数を超える書き込みが行われるとスパムとして認識し、該当するIPを禁止します。'; + $lang->about_denied_ip = '「127.0.0.* 」のように「*」で、「127.0.0」以下ののIP帯域をすべて禁止することが出来ます。'; + $lang->about_denied_word = '禁止ワードとして登録されると該当するワードが存在する書き込みを禁することが出来ます。'; + $lang->about_check_trackback = '一つのIPからのみトラックバックを受信するようにします。'; + + // メッセージ出力用 + $lang->msg_alert_limited_by_config = '%s秒以内の書き込みは禁止されます。続けて行うとスパムとして認識され、禁止IPに登録されます。'; + $lang->msg_alert_denied_word = '"%s"は使用が禁止されたワードです。'; + $lang->msg_alert_registered_denied_ip = '禁止IPに登録され、サイト内で正常な活動が制限されています。管理者にお問い合わせ下さい。'; + $lang->msg_alert_trackback_denied = '一つの書き込みには、1つのトラックバックしか受け取れません。'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/ko.lang.php b/modules/spamfilter/lang/ko.lang.php index 5d5c02937..6f3212db9 100644 --- a/modules/spamfilter/lang/ko.lang.php +++ b/modules/spamfilter/lang/ko.lang.php @@ -1,34 +1,34 @@ -cmd_denied_ip = '금지IP 목록'; - $lang->cmd_denied_word = '금지 단어 목록'; - - // 일반 단어 - $lang->spamfilter = '스팸필터'; - $lang->denied_ip = '금지 IP'; - $lang->interval = '스팸 처리 간격'; - $lang->limit_count = '제한 수'; - $lang->check_trackback = '트랙백 검사'; - $lang->word = '단어'; - $lang->hit = '히트'; - $lang->latest_hit = '최근 히트'; - - // 설명문 - $lang->about_interval = '지정된 시간 내에 글을 등록하지 못하게 합니다.'; - $lang->about_limit_count = '지정된 시간 내에 제한수를 넘겨서 글 작성을 시도하면 스팸으로 인식, 해당 IP의 글 작성, 댓글 작성, 트랙백 발송 등을 금지합니다.'; - $lang->about_denied_ip = '127.0.0.* 와 같이 * 로 정해진 패턴의 IP 대역을 모두 금지 시킬 수 있습니다.'; - $lang->about_denied_word = '금지 단어로 등록되면 해당 단어가 있는 글은 등록을 금지 시킬 수 있습니다.'; - $lang->about_check_trackback = '한 글에 한 IP에만 트랙백을 허용할 수 있습니다.'; - - // 메세지 출력용 - $lang->msg_alert_limited_by_config = '%s 초 이내에 글 작성은 금지 됩니다. 계속 시도하시면 금지 IP에 등록되실 수 있습니다.'; - $lang->msg_alert_denied_word = '"%s"는 사용 금지된 단어입니다.'; - $lang->msg_alert_registered_denied_ip = '금지 IP에 등록되셔서 정상적인 활동에 제한을 받게 되셨습니다. 문의는 사이트 관리자에게 해주시기 바랍니다.'; - $lang->msg_alert_trackback_denied = '한 글에는 하나의 트랙백만 허용 됩니다.'; +cmd_denied_ip = '금지IP 목록'; + $lang->cmd_denied_word = '금지 단어 목록'; + + // 일반 단어 + $lang->spamfilter = '스팸필터'; + $lang->denied_ip = '금지 IP'; + $lang->interval = '스팸 처리 간격'; + $lang->limit_count = '제한 수'; + $lang->check_trackback = '트랙백 검사'; + $lang->word = '단어'; + $lang->hit = '히트'; + $lang->latest_hit = '최근 히트'; + + // 설명문 + $lang->about_interval = '지정된 시간 내에 글을 등록하지 못하게 합니다.'; + $lang->about_limit_count = '지정된 시간 내에 제한수를 넘겨서 글 작성을 시도하면 스팸으로 인식, 해당 IP의 글 작성, 댓글 작성, 트랙백 발송 등을 금지합니다.'; + $lang->about_denied_ip = '127.0.0.* 와 같이 * 로 정해진 패턴의 IP 대역을 모두 금지 시킬 수 있습니다.'; + $lang->about_denied_word = '금지 단어로 등록되면 해당 단어가 있는 글은 등록을 금지 시킬 수 있습니다.'; + $lang->about_check_trackback = '한 글에 한 IP에만 트랙백을 허용할 수 있습니다.'; + + // 메세지 출력용 + $lang->msg_alert_limited_by_config = '%s 초 이내에 글 작성은 금지 됩니다. 계속 시도하시면 금지 IP에 등록되실 수 있습니다.'; + $lang->msg_alert_denied_word = '"%s"는 사용 금지된 단어입니다.'; + $lang->msg_alert_registered_denied_ip = '금지 IP에 등록되셔서 정상적인 활동에 제한을 받게 되셨습니다. 문의는 사이트 관리자에게 해주시기 바랍니다.'; + $lang->msg_alert_trackback_denied = '한 글에는 하나의 트랙백만 허용 됩니다.'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/ru.lang.php b/modules/spamfilter/lang/ru.lang.php index 58b91f150..0755f712d 100644 --- a/modules/spamfilter/lang/ru.lang.php +++ b/modules/spamfilter/lang/ru.lang.php @@ -1,34 +1,34 @@ -cmd_denied_ip = "Черный список IP-адресов"; - $lang->cmd_denied_word = "Черный список слов"; - - // главные слова - $lang->spamfilter = "Фильтр спама"; - $lang->denied_ip = "IP в черный список"; - $lang->interval = "Интервал фильтрования спама"; - $lang->limit_count = "Лимит публикаций"; - $lang->check_trackback = "Проверять трекбек"; - $lang->word = "Слово"; - $lang->hit = '히트'; - $lang->latest_hit = '최근 히트'; - - // описание - $lang->about_interval = "Все попытки разместить статьи в установленное время будут заблокированы."; - $lang->about_limit_count = "Если Вы вышли за лимит публикаций (статей/комментариев),\n Ваша статья будет разпознана как спам, и Ваш IP-адрес будет добавлен в черный список."; - $lang->about_denied_ip = "Вы можете добавить в черный список диапазон IP-адресов как 127.0.0.*, используя знак звездочки (*)."; - $lang->about_denied_word = "Когда Вы добавляете слово в черный список,\n статьи с этим словом не будут опубликованы"; - $lang->about_check_trackback = "Только трекбек для оного IP на статью может быть разрешен."; - - // для отправки сообщений - $lang->msg_alert_limited_by_config = 'Размещение статьи с интервалом в %s секунд не разрешено.\n Если Вы будете многократно пытаться это сделать, Ваш IP-адрес может быть добавлен в черный список.'; - $lang->msg_alert_denied_word = 'Слово "%s" запрещено для публикации.'; - $lang->msg_alert_registered_denied_ip = 'Ваш IP-адрес занесен в черный список,\n поэтому Вы можете иметь ограничения на полноценное использование этого сайта.\n Если у Вас есть вопросы насчет этого, пожалуйста, сообщите администратору сайта.'; - $lang->msg_alert_trackback_denied = 'Разрешен только один трекбек на статью.'; +cmd_denied_ip = "Черный список IP-адресов"; + $lang->cmd_denied_word = "Черный список слов"; + + // главные слова + $lang->spamfilter = "Фильтр спама"; + $lang->denied_ip = "IP в черный список"; + $lang->interval = "Интервал фильтрования спама"; + $lang->limit_count = "Лимит публикаций"; + $lang->check_trackback = "Проверять трекбек"; + $lang->word = "Слово"; + $lang->hit = '히트'; + $lang->latest_hit = '최근 히트'; + + // описание + $lang->about_interval = "Все попытки разместить статьи в установленное время будут заблокированы."; + $lang->about_limit_count = "Если Вы вышли за лимит публикаций (статей/комментариев),\n Ваша статья будет разпознана как спам, и Ваш IP-адрес будет добавлен в черный список."; + $lang->about_denied_ip = "Вы можете добавить в черный список диапазон IP-адресов как 127.0.0.*, используя знак звездочки (*)."; + $lang->about_denied_word = "Когда Вы добавляете слово в черный список,\n статьи с этим словом не будут опубликованы"; + $lang->about_check_trackback = "Только трекбек для оного IP на статью может быть разрешен."; + + // для отправки сообщений + $lang->msg_alert_limited_by_config = 'Размещение статьи с интервалом в %s секунд не разрешено.\n Если Вы будете многократно пытаться это сделать, Ваш IP-адрес может быть добавлен в черный список.'; + $lang->msg_alert_denied_word = 'Слово "%s" запрещено для публикации.'; + $lang->msg_alert_registered_denied_ip = 'Ваш IP-адрес занесен в черный список,\n поэтому Вы можете иметь ограничения на полноценное использование этого сайта.\n Если у Вас есть вопросы насчет этого, пожалуйста, сообщите администратору сайта.'; + $lang->msg_alert_trackback_denied = 'Разрешен только один трекбек на статью.'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/tr.lang.php b/modules/spamfilter/lang/tr.lang.php index e4570ddb9..9df6d293d 100644 --- a/modules/spamfilter/lang/tr.lang.php +++ b/modules/spamfilter/lang/tr.lang.php @@ -1,34 +1,34 @@ -cmd_denied_ip = "IP Adresleri Kara Listesi"; - $lang->cmd_denied_word = "Yasak Sözcük Listesi"; - - // general word - $lang->spamfilter = "Spam filtreleyici"; - $lang->denied_ip = "IP Adresi"; - $lang->interval = "Spam filtreleyici için aralık"; - $lang->limit_count = "Gönderi Sınırı"; - $lang->check_trackback = "Geri izlemeleri kontrol et."; - $lang->word = "Kelime"; - $lang->hit = 'Hit'; - $lang->latest_hit = 'Son Hit\'ler'; - - // for description word - $lang->about_interval = "Belirlenen süre içerisinde gönderilmeye çalışılan tüm yazılar engellenecektir."; - $lang->about_limit_count = "Gönderi sınırını aşarsanız,\n o IP bir spam olarak kabul edilecek ve dolayısıyla yazı göndermede, yorum yapmada ve geri izlemede bulunmada sınırlamalarla karşılaşacaktır."; - $lang->about_denied_ip = "* işaretini kullanarak 127.0.0.* şeklinde IP adres aralığı ekleyebilirsiniz."; - $lang->about_denied_word = "Yasak sözcük listesine bir kelime eklediğinizde,\n o kelimeyi içeren tüm yazılar engellenecektir."; - $lang->about_check_trackback = "Geri izlemeler için yazı başına tek bir IP'ye izin verilir."; - - // to post a message - $lang->msg_alert_limited_by_config = '%s saniyede bir yazı göndermek mümkün değildir.\n Denemeyi sürdürürseniz, IP adresiniz kara listeye alınacaktır.'; - $lang->msg_alert_denied_word = ' "%s" kelimesinin kullanılmasına izin verilmemektedir.'; - $lang->msg_alert_registered_denied_ip = 'IP adresiniz kara listeye alındı,\n siteyi kullanırken sınırlamalarla karşılaşacaksınız.\n Bu konuda sorularınız varsa, lütfen site yöneticisi ile görüşün.'; - $lang->msg_alert_trackback_denied = 'Yazı başına sadece bir geri izlemeye izin verilmektedir.'; +cmd_denied_ip = "IP Adresleri Kara Listesi"; + $lang->cmd_denied_word = "Yasak Sözcük Listesi"; + + // general word + $lang->spamfilter = "Spam filtreleyici"; + $lang->denied_ip = "IP Adresi"; + $lang->interval = "Spam filtreleyici için aralık"; + $lang->limit_count = "Gönderi Sınırı"; + $lang->check_trackback = "Geri izlemeleri kontrol et."; + $lang->word = "Kelime"; + $lang->hit = 'Hit'; + $lang->latest_hit = 'Son Hit\'ler'; + + // for description word + $lang->about_interval = "Belirlenen süre içerisinde gönderilmeye çalışılan tüm yazılar engellenecektir."; + $lang->about_limit_count = "Gönderi sınırını aşarsanız,\n o IP bir spam olarak kabul edilecek ve dolayısıyla yazı göndermede, yorum yapmada ve geri izlemede bulunmada sınırlamalarla karşılaşacaktır."; + $lang->about_denied_ip = "* işaretini kullanarak 127.0.0.* şeklinde IP adres aralığı ekleyebilirsiniz."; + $lang->about_denied_word = "Yasak sözcük listesine bir kelime eklediğinizde,\n o kelimeyi içeren tüm yazılar engellenecektir."; + $lang->about_check_trackback = "Geri izlemeler için yazı başına tek bir IP'ye izin verilir."; + + // to post a message + $lang->msg_alert_limited_by_config = '%s saniyede bir yazı göndermek mümkün değildir.\n Denemeyi sürdürürseniz, IP adresiniz kara listeye alınacaktır.'; + $lang->msg_alert_denied_word = ' "%s" kelimesinin kullanılmasına izin verilmemektedir.'; + $lang->msg_alert_registered_denied_ip = 'IP adresiniz kara listeye alındı,\n siteyi kullanırken sınırlamalarla karşılaşacaksınız.\n Bu konuda sorularınız varsa, lütfen site yöneticisi ile görüşün.'; + $lang->msg_alert_trackback_denied = 'Yazı başına sadece bir geri izlemeye izin verilmektedir.'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/vi.lang.php b/modules/spamfilter/lang/vi.lang.php index 9170010ae..3a0a5e62f 100644 --- a/modules/spamfilter/lang/vi.lang.php +++ b/modules/spamfilter/lang/vi.lang.php @@ -1,36 +1,36 @@ -cmd_denied_ip = "Danh sách IP cấm"; - $lang->cmd_denied_word = "Danh sách từ cấm"; - - // general word - $lang->spamfilter = "Bộ lọc Spam"; - $lang->denied_ip = "IP bị cấm"; - $lang->interval = "Thời gian giới hạn"; - $lang->limit_count = "Số bài viết giới hạn"; - $lang->check_trackback = "Kiểm tra liên kết Web"; - $lang->word = "Từ"; - $lang->hit = 'Truy cập'; - $lang->latest_hit = 'Truy cập mới nhất'; - - // for description word - $lang->about_interval = "Tất cả những bài viết trong thời gian giới hạn sẽ bị chặn."; - $lang->about_limit_count = "Nếu bạn gửi bài vượt quá số bài viết quy định,\n bài viết của bạn sẽ bị ghi vào danh sách và IP của bạn sẽ bị lưu vào danh sách IP bị cấm."; - $lang->about_denied_ip = "Bạn có thể thêm IP vào danh sách bị cấm dạng 127.0.0.* bằng cách sử dụng *."; - $lang->about_denied_word = "Khi bạn thêm từ vào danh sách Từ bị cấm,\n những bài viết có chứa những từ này sẽ không được gửi."; - $lang->about_check_trackback = "Chỉ cho phép gửi một bài viết với một IP trên một liên kết Web."; - - // to post a message - $lang->msg_alert_limited_by_config = 'Không được phép gửi bài thứ 2 trong khoảng thời gian %s giây.\n Nếu bạn cứ tiếp tục, IP của bạn sẽ bị thêm vào danh sách IP bị cấm.'; - $lang->msg_alert_denied_word = 'Không được phép gửi từ "%s".'; - $lang->msg_alert_registered_denied_ip = 'IP của bạn đã bị nằm trong danh sách cấm,\n vì vậy bạn bị giới hạn sử dụng trên Website này.\n Nếu bạn có bất cứ thắc mắc gì, xin vui lòng liên hệ với Webmaster để được giải đáp.'; - $lang->msg_alert_trackback_denied = 'Chỉ cho phép một liên kết Web trên một bài viết.'; +cmd_denied_ip = "Danh sách IP cấm"; + $lang->cmd_denied_word = "Danh sách từ cấm"; + + // general word + $lang->spamfilter = "Bộ lọc Spam"; + $lang->denied_ip = "IP bị cấm"; + $lang->interval = "Thời gian giới hạn"; + $lang->limit_count = "Số bài viết giới hạn"; + $lang->check_trackback = "Kiểm tra liên kết Web"; + $lang->word = "Từ"; + $lang->hit = 'Truy cập'; + $lang->latest_hit = 'Truy cập mới nhất'; + + // for description word + $lang->about_interval = "Tất cả những bài viết trong thời gian giới hạn sẽ bị chặn."; + $lang->about_limit_count = "Nếu bạn gửi bài vượt quá số bài viết quy định,\n bài viết của bạn sẽ bị ghi vào danh sách và IP của bạn sẽ bị lưu vào danh sách IP bị cấm."; + $lang->about_denied_ip = "Bạn có thể thêm IP vào danh sách bị cấm dạng 127.0.0.* bằng cách sử dụng *."; + $lang->about_denied_word = "Khi bạn thêm từ vào danh sách Từ bị cấm,\n những bài viết có chứa những từ này sẽ không được gửi."; + $lang->about_check_trackback = "Chỉ cho phép gửi một bài viết với một IP trên một liên kết Web."; + + // to post a message + $lang->msg_alert_limited_by_config = 'Không được phép gửi bài thứ 2 trong khoảng thời gian %s giây.\n Nếu bạn cứ tiếp tục, IP của bạn sẽ bị thêm vào danh sách IP bị cấm.'; + $lang->msg_alert_denied_word = 'Không được phép gửi từ "%s".'; + $lang->msg_alert_registered_denied_ip = 'IP của bạn đã bị nằm trong danh sách cấm,\n vì vậy bạn bị giới hạn sử dụng trên Website này.\n Nếu bạn có bất cứ thắc mắc gì, xin vui lòng liên hệ với Webmaster để được giải đáp.'; + $lang->msg_alert_trackback_denied = 'Chỉ cho phép một liên kết Web trên một bài viết.'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/zh-CN.lang.php b/modules/spamfilter/lang/zh-CN.lang.php index a3d968867..cbe1a6fa3 100644 --- a/modules/spamfilter/lang/zh-CN.lang.php +++ b/modules/spamfilter/lang/zh-CN.lang.php @@ -1,34 +1,34 @@ -cmd_denied_ip = "禁止IP列表"; - $lang->cmd_denied_word = "敏感词列表"; - - // 一般用语 - $lang->spamfilter = "垃圾过滤"; - $lang->denied_ip = "禁止IP"; - $lang->interval = "处理垃圾间隔"; - $lang->limit_count = "限制数"; - $lang->check_trackback = "检查引用"; - $lang->word = "单词"; - $lang->hit = '点击'; - $lang->latest_hit = '最后点击'; - - // 说明文 - $lang->about_interval = "指定的时间内禁止发表新主题。"; - $lang->about_limit_count = "在指定时间内发表的新主题超过限制数时,系统将把它认为是垃圾主题,将自动禁止对方的IP。"; - $lang->about_denied_ip = "禁止IP可以使用通配符。(如:如 \"127.0.*.*\")"; - $lang->about_denied_word = "登录为敏感词,可以对要发表的主题进行检测并禁止含有敏感词的主题发表。"; - $lang->about_check_trackback = "对一个主题只允许一个IP引用。"; - - // 提示信息 - $lang->msg_alert_limited_by_config = '%s秒之内不能连续发表新主题。如您继续再试系统将自动禁止您的IP。'; - $lang->msg_alert_denied_word = '"%s"是敏感词!'; - $lang->msg_alert_registered_denied_ip = '您的IP已被禁止,详情请联系网站管理员。'; - $lang->msg_alert_trackback_denied = '一个主题只允许一个引用。'; +cmd_denied_ip = "禁止IP列表"; + $lang->cmd_denied_word = "敏感词列表"; + + // 一般用语 + $lang->spamfilter = "垃圾过滤"; + $lang->denied_ip = "禁止IP"; + $lang->interval = "处理垃圾间隔"; + $lang->limit_count = "限制数"; + $lang->check_trackback = "检查引用"; + $lang->word = "单词"; + $lang->hit = '点击'; + $lang->latest_hit = '最后点击'; + + // 说明文 + $lang->about_interval = "指定的时间内禁止发表新主题。"; + $lang->about_limit_count = "在指定时间内发表的新主题超过限制数时,系统将把它认为是垃圾主题,将自动禁止对方的IP。"; + $lang->about_denied_ip = "禁止IP可以使用通配符。(如:如 \"127.0.*.*\")"; + $lang->about_denied_word = "登录为敏感词,可以对要发表的主题进行检测并禁止含有敏感词的主题发表。"; + $lang->about_check_trackback = "对一个主题只允许一个IP引用。"; + + // 提示信息 + $lang->msg_alert_limited_by_config = '%s秒之内不能连续发表新主题。如您继续再试系统将自动禁止您的IP。'; + $lang->msg_alert_denied_word = '"%s"是敏感词!'; + $lang->msg_alert_registered_denied_ip = '您的IP已被禁止,详情请联系网站管理员。'; + $lang->msg_alert_trackback_denied = '一个主题只允许一个引用。'; ?> \ No newline at end of file diff --git a/modules/spamfilter/lang/zh-TW.lang.php b/modules/spamfilter/lang/zh-TW.lang.php index af2336c2a..e21803f3b 100644 --- a/modules/spamfilter/lang/zh-TW.lang.php +++ b/modules/spamfilter/lang/zh-TW.lang.php @@ -1,34 +1,34 @@ -cmd_denied_ip = "禁止IP列表"; - $lang->cmd_denied_word = "敏感詞清單"; - - // 一般用語 - $lang->spamfilter = "垃圾過濾"; - $lang->denied_ip = "禁止IP"; - $lang->interval = "處理垃圾間隔"; - $lang->limit_count = "限制數"; - $lang->check_trackback = "檢查引用"; - $lang->word = "單字"; - $lang->hit = '히트'; - $lang->latest_hit = '최근 히트'; - - // 說明 - $lang->about_interval = "指定的時間內禁止發表新主題。"; - $lang->about_limit_count = "在指定時間內發表的新主題超過限制數時,系統將會認為是垃圾主題,並自動禁止對方的IP。"; - $lang->about_denied_ip = "禁止IP可以使用通配符。(如:如 \"127.0.*.*\")"; - $lang->about_denied_word = "登錄為敏感詞,可以對要發表的主題進行檢測並禁止含有敏感詞的主題發表。"; - $lang->about_check_trackback = "對一個主題只允許一個IP引用。"; - - // 提示訊息 - $lang->msg_alert_limited_by_config = '%s秒之內不能連續發表新主題。如您繼續再試系統將自動禁止您的IP。'; - $lang->msg_alert_denied_word = '"%s"是敏感詞!'; - $lang->msg_alert_registered_denied_ip = '您的IP已被禁止,詳情請聯繫網站管理員。'; - $lang->msg_alert_trackback_denied = '一個主題只允許一個引用。'; +cmd_denied_ip = "禁止IP列表"; + $lang->cmd_denied_word = "敏感詞清單"; + + // 一般用語 + $lang->spamfilter = "垃圾過濾"; + $lang->denied_ip = "禁止IP"; + $lang->interval = "處理垃圾間隔"; + $lang->limit_count = "限制數"; + $lang->check_trackback = "檢查引用"; + $lang->word = "單字"; + $lang->hit = '히트'; + $lang->latest_hit = '최근 히트'; + + // 說明 + $lang->about_interval = "指定的時間內禁止發表新主題。"; + $lang->about_limit_count = "在指定時間內發表的新主題超過限制數時,系統將會認為是垃圾主題,並自動禁止對方的IP。"; + $lang->about_denied_ip = "禁止IP可以使用通配符。(如:如 \"127.0.*.*\")"; + $lang->about_denied_word = "登錄為敏感詞,可以對要發表的主題進行檢測並禁止含有敏感詞的主題發表。"; + $lang->about_check_trackback = "對一個主題只允許一個IP引用。"; + + // 提示訊息 + $lang->msg_alert_limited_by_config = '%s秒之內不能連續發表新主題。如您繼續再試系統將自動禁止您的IP。'; + $lang->msg_alert_denied_word = '"%s"是敏感詞!'; + $lang->msg_alert_registered_denied_ip = '您的IP已被禁止,詳情請聯繫網站管理員。'; + $lang->msg_alert_trackback_denied = '一個主題只允許一個引用。'; ?> \ No newline at end of file diff --git a/modules/spamfilter/spamfilter.admin.controller.php b/modules/spamfilter/spamfilter.admin.controller.php index b0fa708e2..663ae6f01 100644 --- a/modules/spamfilter/spamfilter.admin.controller.php +++ b/modules/spamfilter/spamfilter.admin.controller.php @@ -1,99 +1,99 @@ -check_trackback!='Y') $args->check_trackback = 'N'; - - // module Controller 객체 생성하여 입력 - $oModuleController = &getController('module'); - $output = $oModuleController->insertModuleConfig('spamfilter',$args); - return $output; - } - - /** - * @brief 금지 IP등록 - **/ - function procSpamfilterAdminInsertDeniedIP() { - $ipaddress = Context::get('ipaddress'); - $description = Context::get('description'); - - $oSpamfilterController = &getController('spamfilter'); - return $oSpamfilterController->insertIP($ipaddress, $description); - } - - /** - * @brief 금지 IP삭제 - **/ - function procSpamfilterAdminDeleteDeniedIP() { - $ipaddress = Context::get('ipaddress'); - return $this->deleteIP($ipaddress); - } - - /** - * @brief 금지 Word등록 - **/ - function procSpamfilterAdminInsertDeniedWord() { - $word = Context::get('word'); - return $this->insertWord($word); - } - - /** - * @brief 금지 Word삭제 - **/ - function procSpamfilterAdminDeleteDeniedWord() { - $word = base64_decode(Context::get('word')); - return $this->deleteWord($word); - } - - /** - * @brief IP 제거 - * 스패머로 등록된 IP를 제거 - **/ - function deleteIP($ipaddress) { - if(!$ipaddress) return; - - $args->ipaddress = $ipaddress; - return executeQuery('spamfilter.deleteDeniedIP', $args); - } - - /** - * @brief 스팸단어 등록 - * 등록된 단어가 포함된 글은 스팸글로 간주 - **/ - function insertWord($word) { - if(!$word) return; - - $args->word = $word; - return executeQuery('spamfilter.insertDeniedWord', $args); - } - - /** - * @brief 스팸단어 제거 - * 스팸 단어로 등록된 단어 제거 - **/ - function deleteWord($word) { - if(!$word) return; - - $args->word = $word; - return executeQuery('spamfilter.deleteDeniedWord', $args); - } - - } -?> +check_trackback!='Y') $args->check_trackback = 'N'; + + // module Controller 객체 생성하여 입력 + $oModuleController = &getController('module'); + $output = $oModuleController->insertModuleConfig('spamfilter',$args); + return $output; + } + + /** + * @brief 금지 IP등록 + **/ + function procSpamfilterAdminInsertDeniedIP() { + $ipaddress = Context::get('ipaddress'); + $description = Context::get('description'); + + $oSpamfilterController = &getController('spamfilter'); + return $oSpamfilterController->insertIP($ipaddress, $description); + } + + /** + * @brief 금지 IP삭제 + **/ + function procSpamfilterAdminDeleteDeniedIP() { + $ipaddress = Context::get('ipaddress'); + return $this->deleteIP($ipaddress); + } + + /** + * @brief 금지 Word등록 + **/ + function procSpamfilterAdminInsertDeniedWord() { + $word = Context::get('word'); + return $this->insertWord($word); + } + + /** + * @brief 금지 Word삭제 + **/ + function procSpamfilterAdminDeleteDeniedWord() { + $word = base64_decode(Context::get('word')); + return $this->deleteWord($word); + } + + /** + * @brief IP 제거 + * 스패머로 등록된 IP를 제거 + **/ + function deleteIP($ipaddress) { + if(!$ipaddress) return; + + $args->ipaddress = $ipaddress; + return executeQuery('spamfilter.deleteDeniedIP', $args); + } + + /** + * @brief 스팸단어 등록 + * 등록된 단어가 포함된 글은 스팸글로 간주 + **/ + function insertWord($word) { + if(!$word) return; + + $args->word = $word; + return executeQuery('spamfilter.insertDeniedWord', $args); + } + + /** + * @brief 스팸단어 제거 + * 스팸 단어로 등록된 단어 제거 + **/ + function deleteWord($word) { + if(!$word) return; + + $args->word = $word; + return executeQuery('spamfilter.deleteDeniedWord', $args); + } + + } +?> diff --git a/modules/spamfilter/spamfilter.admin.view.php b/modules/spamfilter/spamfilter.admin.view.php index aedd029a1..b20b48499 100644 --- a/modules/spamfilter/spamfilter.admin.view.php +++ b/modules/spamfilter/spamfilter.admin.view.php @@ -1,59 +1,59 @@ -setTemplatePath($this->module_path.'tpl'); - } - - /** - * @brief 스팸필터의 설정 화면 - **/ - function dispSpamfilterAdminConfig() { - // 설정 정보를 받아옴 (module model 객체를 이용) - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('spamfilter'); - Context::set('config',$config); - - // 템플릿 파일 지정 - $this->setTemplateFile('index'); - } - - /** - * @brief 금지 목록 출력 - **/ - function dispSpamfilterAdminDeniedIPList() { - // 등록된 금지 IP 목록을 가져옴 - $oSpamFilterModel = &getModel('spamfilter'); - $ip_list = $oSpamFilterModel->getDeniedIPList(); - - Context::set('ip_list', $ip_list); - - // 템플릿 파일 지정 - $this->setTemplateFile('denied_ip_list'); - } - - /** - * @brief 금지 목록 출력 - **/ - function dispSpamfilterAdminDeniedWordList() { - // 등록된 금지 Word 목록을 가져옴 - $oSpamFilterModel = &getModel('spamfilter'); - $word_list = $oSpamFilterModel->getDeniedWordList(); - - Context::set('word_list', $word_list); - - // 템플릿 파일 지정 - $this->setTemplateFile('denied_word_list'); - } - } -?> +setTemplatePath($this->module_path.'tpl'); + } + + /** + * @brief 스팸필터의 설정 화면 + **/ + function dispSpamfilterAdminConfig() { + // 설정 정보를 받아옴 (module model 객체를 이용) + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('spamfilter'); + Context::set('config',$config); + + // 템플릿 파일 지정 + $this->setTemplateFile('index'); + } + + /** + * @brief 금지 목록 출력 + **/ + function dispSpamfilterAdminDeniedIPList() { + // 등록된 금지 IP 목록을 가져옴 + $oSpamFilterModel = &getModel('spamfilter'); + $ip_list = $oSpamFilterModel->getDeniedIPList(); + + Context::set('ip_list', $ip_list); + + // 템플릿 파일 지정 + $this->setTemplateFile('denied_ip_list'); + } + + /** + * @brief 금지 목록 출력 + **/ + function dispSpamfilterAdminDeniedWordList() { + // 등록된 금지 Word 목록을 가져옴 + $oSpamFilterModel = &getModel('spamfilter'); + $word_list = $oSpamFilterModel->getDeniedWordList(); + + Context::set('word_list', $word_list); + + // 템플릿 파일 지정 + $this->setTemplateFile('denied_word_list'); + } + } +?> diff --git a/modules/spamfilter/spamfilter.class.php b/modules/spamfilter/spamfilter.class.php index 7a0191dd8..56d01c6be 100644 --- a/modules/spamfilter/spamfilter.class.php +++ b/modules/spamfilter/spamfilter.class.php @@ -1,108 +1,108 @@ -insertTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); - $oModuleController->insertTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); - $oModuleController->insertTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before'); - - - //2008-12-17 글 수정시 스펨필터 추가 - $oModuleController->insertTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); - $oModuleController->insertTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); - - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oDB = &DB::getInstance(); - $oModuleModel = &getModel('module'); - - // 2007. 12. 7 글/ 댓글/ 엮인글이 등록될때 스팸필터링을 시도하는 트리거 - if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; - if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; - if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) return true; - - //2008-12-17 글 수정시 스펨필터 추가 - if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; - if(!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; - - /** - * 히트 카운트 필드(hit) 추가 - **/ - if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) return true; - if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) return true; - - if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oDB = &DB::getInstance(); - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - // 2007. 12. 7 글/ 댓글/ 엮인글이 등록될때 스팸필터링을 시도하는 트리거 - if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) - $oModuleController->insertTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); - if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) - $oModuleController->insertTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); - if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) - $oModuleController->insertTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before'); - - //2008-12-17 글 수정시 스펨필터 추가 - if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')){ - $oModuleController->insertTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); - } - //2008-12-17 글 수정시 스펨필터 추가 - if(!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')){ - $oModuleController->insertTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); - } - - /** - * 히트 카운트 필드(hit) 추가 - **/ - if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) { - $oDB->addColumn('spamfilter_denied_word','hit','number',12,0,true); - $oDB->addIndex('spamfilter_denied_word','idx_hit', 'hit'); - } - if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) { - $oDB->addColumn('spamfilter_denied_word','latest_hit','date'); - $oDB->addIndex('spamfilter_denied_word','idx_latest_hit', 'latest_hit'); - } - - if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) { - $oDB->addColumn('spamfilter_denied_ip','description','varchar', 250); - } - - return new Object(0,'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - } - } +insertTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); + $oModuleController->insertTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); + $oModuleController->insertTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before'); + + + //2008-12-17 글 수정시 스펨필터 추가 + $oModuleController->insertTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); + $oModuleController->insertTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); + + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oDB = &DB::getInstance(); + $oModuleModel = &getModel('module'); + + // 2007. 12. 7 글/ 댓글/ 엮인글이 등록될때 스팸필터링을 시도하는 트리거 + if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; + if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; + if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) return true; + + //2008-12-17 글 수정시 스펨필터 추가 + if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) return true; + if(!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) return true; + + /** + * 히트 카운트 필드(hit) 추가 + **/ + if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) return true; + if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) return true; + + if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oDB = &DB::getInstance(); + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // 2007. 12. 7 글/ 댓글/ 엮인글이 등록될때 스팸필터링을 시도하는 트리거 + if(!$oModuleModel->getTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')) + $oModuleController->insertTrigger('document.insertDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); + if(!$oModuleModel->getTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')) + $oModuleController->insertTrigger('comment.insertComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); + if(!$oModuleModel->getTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before')) + $oModuleController->insertTrigger('trackback.insertTrackback', 'spamfilter', 'controller', 'triggerInsertTrackback', 'before'); + + //2008-12-17 글 수정시 스펨필터 추가 + if(!$oModuleModel->getTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before')){ + $oModuleController->insertTrigger('comment.updateComment', 'spamfilter', 'controller', 'triggerInsertComment', 'before'); + } + //2008-12-17 글 수정시 스펨필터 추가 + if(!$oModuleModel->getTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before')){ + $oModuleController->insertTrigger('document.updateDocument', 'spamfilter', 'controller', 'triggerInsertDocument', 'before'); + } + + /** + * 히트 카운트 필드(hit) 추가 + **/ + if(!$oDB->isColumnExists('spamfilter_denied_word', 'hit')) { + $oDB->addColumn('spamfilter_denied_word','hit','number',12,0,true); + $oDB->addIndex('spamfilter_denied_word','idx_hit', 'hit'); + } + if(!$oDB->isColumnExists('spamfilter_denied_word', 'latest_hit')) { + $oDB->addColumn('spamfilter_denied_word','latest_hit','date'); + $oDB->addIndex('spamfilter_denied_word','idx_latest_hit', 'latest_hit'); + } + + if(!$oDB->isColumnExists('spamfilter_denied_ip', 'description')) { + $oDB->addColumn('spamfilter_denied_ip','description','varchar', 250); + } + + return new Object(0,'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + } + } ?> \ No newline at end of file diff --git a/modules/spamfilter/spamfilter.controller.php b/modules/spamfilter/spamfilter.controller.php index 8f774da17..a799f3dfe 100644 --- a/modules/spamfilter/spamfilter.controller.php +++ b/modules/spamfilter/spamfilter.controller.php @@ -1,173 +1,173 @@ -is_admin == 'Y') return new Object(); - if($grant->manager) return new Object(); - } - - $oFilterModel = &getModel('spamfilter'); - - // ip가 금지되어 있는 경우를 체크 - $output = $oFilterModel->isDeniedIP(); - if(!$output->toBool()) return $output; - - // 금지 단어에 있을 경우 체크 - $text = $obj->title.$obj->content; - $output = $oFilterModel->isDeniedWord($text); - if(!$output->toBool()) return $output; - - // 지정된 시간 체크, 수정시 제외 - if($obj->document_srl == 0){ - $output = $oFilterModel->checkLimited(); - if(!$output->toBool()) return $output; - } - - // 로그 남김 - $this->insertLog(); - - return new Object(); - } - - /** - * @brief 댓글 작성 시간 및 금지 ip/ 단어 처리 루틴 - **/ - function triggerInsertComment(&$obj) { - if($_SESSION['avoid_log']) return new Object(); - - // 로그인 여부, 로그인 정보, 권한 유무 체크 - $is_logged = Context::get('is_logged'); - $logged_info = Context::get('logged_info'); - $grant = Context::get('grant'); - - // 로그인 되어 있을 경우 관리자 여부를 체크 - if($is_logged) { - if($logged_info->is_admin == 'Y') return new Object(); - if($grant->manager) return new Object(); - } - - $oFilterModel = &getModel('spamfilter'); - - // ip가 금지되어 있는 경우를 체크 - $output = $oFilterModel->isDeniedIP(); - if(!$output->toBool()) return $output; - - // 금지 단어에 있을 경우 체크 - $text = $obj->content; - $output = $oFilterModel->isDeniedWord($text); - if(!$output->toBool()) return $output; - - // 지정된 시간 체크 수정이 아닌경우만 - if(!$obj->__isupdate){ - $output = $oFilterModel->checkLimited(); - if(!$output->toBool()) return $output; - } - unset($obj->__isupdate); - - // 로그 남김 - $this->insertLog(); - - return new Object(); - } - - /** - * @brief 엮인글 작성시 시간 및 ip 검사 - **/ - function triggerInsertTrackback(&$obj) { - if($_SESSION['avoid_log']) return new Object(); - - $oFilterModel = &getModel('spamfilter'); - - // 해당 글에 엮인글을 한번 이상 추가하였는지를 확인 - $output = $oFilterModel->isInsertedTrackback($obj->document_srl); - if(!$output->toBool()) return $output; - - // ip가 금지되어 있는 경우를 체크 - $output = $oFilterModel->isDeniedIP(); - if(!$output->toBool()) return $output; - - // 금지 단어에 있을 경우 체크 - $text = $obj->blog_name.$obj->title.$obj->excerpt.$obj->url; - $output = $oFilterModel->isDeniedWord($text); - if(!$output->toBool()) return $output; - - // 필터링 시작 - $oTrackbackModel = &getModel('trackback'); - $oTrackbackController = &getController('trackback'); - - list($ipA,$ipB,$ipC,$ipD) = explode('.',$_SERVER['REMOTE_ADDR']); - $ipaddress = $ipA.'.'.$ipB.'.'.$ipC; - - // 제목과 블로그이름이 동일할 경우 최근 6시간내의 ip를 조사하여 삭제하고 금지ip로 등록 - if($obj->title == $obj->excerpt) { - $oTrackbackController->deleteTrackbackSender(60*60*6, $ipaddress, $obj->url, $obj->blog_name, $obj->title, $obj->excerpt); - $this->insertIP($ipaddress.'.*', 'AUTO-DENIED : trackback.insertTrackback'); - return new Object(-1,'msg_alert_trackback_denied'); - } - - // 30분 이내에 1개 이상의 한 C클래스의 ip에서 엮인글 등록 시도시 금지 아이피로 지정하고 해당 ip의 글을 모두 삭제 - /* 호스팅 환경을 감안하여 일단 이 부분은 동작하지 않도록 주석 처리 - $count = $oTrackbackModel->getRegistedTrackback(30*60, $ipaddress, $obj->url, $obj->blog_name, $obj->title, $obj->excerpt); - if($count > 1) { - $oTrackbackController->deleteTrackbackSender(3*60, $ipaddress, $obj->url, $obj->blog_name, $obj->title, $obj->excerpt); - $this->insertIP($ipaddress.'.*'); - return new Object(-1,'msg_alert_trackback_denied'); - } - */ - - return new Object(); - } - - /** - * @brief IP 등록 - * 등록된 IP는 스패머로 간주 - **/ - function insertIP($ipaddress, $description = null) { - $args->ipaddress = $ipaddress; - if($description) $args->description = $description; - - return executeQuery('spamfilter.insertDeniedIP', $args); - } - - /** - * @brief 로그 등록 - * 현 접속 IP를 로그에 등록, 로그의 간격이 특정 시간 이내일 경우 도배로 간주하여 - * 스패머로 등록할 수 있음 - **/ - function insertLog() { - $output = executeQuery('spamfilter.insertLog'); - return $output; - } - } -?> +is_admin == 'Y') return new Object(); + if($grant->manager) return new Object(); + } + + $oFilterModel = &getModel('spamfilter'); + + // ip가 금지되어 있는 경우를 체크 + $output = $oFilterModel->isDeniedIP(); + if(!$output->toBool()) return $output; + + // 금지 단어에 있을 경우 체크 + $text = $obj->title.$obj->content; + $output = $oFilterModel->isDeniedWord($text); + if(!$output->toBool()) return $output; + + // 지정된 시간 체크, 수정시 제외 + if($obj->document_srl == 0){ + $output = $oFilterModel->checkLimited(); + if(!$output->toBool()) return $output; + } + + // 로그 남김 + $this->insertLog(); + + return new Object(); + } + + /** + * @brief 댓글 작성 시간 및 금지 ip/ 단어 처리 루틴 + **/ + function triggerInsertComment(&$obj) { + if($_SESSION['avoid_log']) return new Object(); + + // 로그인 여부, 로그인 정보, 권한 유무 체크 + $is_logged = Context::get('is_logged'); + $logged_info = Context::get('logged_info'); + $grant = Context::get('grant'); + + // 로그인 되어 있을 경우 관리자 여부를 체크 + if($is_logged) { + if($logged_info->is_admin == 'Y') return new Object(); + if($grant->manager) return new Object(); + } + + $oFilterModel = &getModel('spamfilter'); + + // ip가 금지되어 있는 경우를 체크 + $output = $oFilterModel->isDeniedIP(); + if(!$output->toBool()) return $output; + + // 금지 단어에 있을 경우 체크 + $text = $obj->content; + $output = $oFilterModel->isDeniedWord($text); + if(!$output->toBool()) return $output; + + // 지정된 시간 체크 수정이 아닌경우만 + if(!$obj->__isupdate){ + $output = $oFilterModel->checkLimited(); + if(!$output->toBool()) return $output; + } + unset($obj->__isupdate); + + // 로그 남김 + $this->insertLog(); + + return new Object(); + } + + /** + * @brief 엮인글 작성시 시간 및 ip 검사 + **/ + function triggerInsertTrackback(&$obj) { + if($_SESSION['avoid_log']) return new Object(); + + $oFilterModel = &getModel('spamfilter'); + + // 해당 글에 엮인글을 한번 이상 추가하였는지를 확인 + $output = $oFilterModel->isInsertedTrackback($obj->document_srl); + if(!$output->toBool()) return $output; + + // ip가 금지되어 있는 경우를 체크 + $output = $oFilterModel->isDeniedIP(); + if(!$output->toBool()) return $output; + + // 금지 단어에 있을 경우 체크 + $text = $obj->blog_name.$obj->title.$obj->excerpt.$obj->url; + $output = $oFilterModel->isDeniedWord($text); + if(!$output->toBool()) return $output; + + // 필터링 시작 + $oTrackbackModel = &getModel('trackback'); + $oTrackbackController = &getController('trackback'); + + list($ipA,$ipB,$ipC,$ipD) = explode('.',$_SERVER['REMOTE_ADDR']); + $ipaddress = $ipA.'.'.$ipB.'.'.$ipC; + + // 제목과 블로그이름이 동일할 경우 최근 6시간내의 ip를 조사하여 삭제하고 금지ip로 등록 + if($obj->title == $obj->excerpt) { + $oTrackbackController->deleteTrackbackSender(60*60*6, $ipaddress, $obj->url, $obj->blog_name, $obj->title, $obj->excerpt); + $this->insertIP($ipaddress.'.*', 'AUTO-DENIED : trackback.insertTrackback'); + return new Object(-1,'msg_alert_trackback_denied'); + } + + // 30분 이내에 1개 이상의 한 C클래스의 ip에서 엮인글 등록 시도시 금지 아이피로 지정하고 해당 ip의 글을 모두 삭제 + /* 호스팅 환경을 감안하여 일단 이 부분은 동작하지 않도록 주석 처리 + $count = $oTrackbackModel->getRegistedTrackback(30*60, $ipaddress, $obj->url, $obj->blog_name, $obj->title, $obj->excerpt); + if($count > 1) { + $oTrackbackController->deleteTrackbackSender(3*60, $ipaddress, $obj->url, $obj->blog_name, $obj->title, $obj->excerpt); + $this->insertIP($ipaddress.'.*'); + return new Object(-1,'msg_alert_trackback_denied'); + } + */ + + return new Object(); + } + + /** + * @brief IP 등록 + * 등록된 IP는 스패머로 간주 + **/ + function insertIP($ipaddress, $description = null) { + $args->ipaddress = $ipaddress; + if($description) $args->description = $description; + + return executeQuery('spamfilter.insertDeniedIP', $args); + } + + /** + * @brief 로그 등록 + * 현 접속 IP를 로그에 등록, 로그의 간격이 특정 시간 이내일 경우 도배로 간주하여 + * 스패머로 등록할 수 있음 + **/ + function insertLog() { + $output = executeQuery('spamfilter.insertLog'); + return $output; + } + } +?> diff --git a/modules/spamfilter/spamfilter.model.php b/modules/spamfilter/spamfilter.model.php index 263302aff..6d535c6dd 100644 --- a/modules/spamfilter/spamfilter.model.php +++ b/modules/spamfilter/spamfilter.model.php @@ -1,150 +1,150 @@ -getModuleConfig('spamfilter'); - } - - /** - * @brief 등록된 금지 IP의 목록을 return - **/ - function getDeniedIPList() { - $args->sort_index = "regdate"; - $args->page = Context::get('page')?Context::get('page'):1; - $output = executeQuery('spamfilter.getDeniedIPList', $args); - if(!$output->data) return; - if(!is_array($output->data)) return array($output->data); - return $output->data; - } - - /** - * @brief 인자로 넘겨진 ipaddress가 금지 ip인지 체크하여 return - **/ - function isDeniedIP() { - $ipaddress = $_SERVER['REMOTE_ADDR']; - - $ip_list = $this->getDeniedIPList(); - if(!count($ip_list)) return new Object(); - - $count = count($ip_list); - $patterns = array(); - for($i=0;$i<$count;$i++) { - $ip = str_replace('*','',$ip_list[$i]->ipaddress); - $patterns[] = preg_quote($ip); - } - - $pattern = '/^('.implode($patterns,'|').')/'; - - if(preg_match($pattern, $ipaddress, $matches)) return new Object(-1,'msg_alert_registered_denied_ip'); - - return new Object(); - } - - /** - * @brief 등록된 금지 Word 의 목록을 return - **/ - function getDeniedWordList() { - $args->sort_index = "hit"; - $output = executeQuery('spamfilter.getDeniedWordList', $args); - if(!$output->data) return; - if(!is_array($output->data)) return array($output->data); - return $output->data; - } - - /** - * @brief 넘어온 text에 금지 단어가 있는지 확인 - **/ - function isDeniedWord($text) { - $word_list = $this->getDeniedWordList(); - if(!count($word_list)) return new Object(); - - $count = count($word_list); - for($i=0;$i<$count;$i++) { - $word = $word_list[$i]->word; - if(preg_match('/'.preg_quote($word,'/').'/is', $text)) { - $args->word = $word; - $output = executeQuery('spamfilter.updateDeniedWordHit', $args); - return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word)); - } - } - - return new Object(); - } - - /** - * @brief 지정된 시간을 체크 - **/ - function checkLimited() { - $config = $this->getConfig(); - $limit_count = $config->limit_count?$config->limit_count:5; - $interval = $config->interval; - if(!$interval) return new Object(); - - $count = $this->getLogCount($interval); - - $ipaddress = $_SERVER['REMOTE_ADDR']; - - // 정해진 시간보다 클 경우 금지 ip로 등록 - if($count>=$limit_count) { - $oSpamFilterController = &getController('spamfilter'); - $oSpamFilterController->insertIP($ipaddress, 'AUTO-DENIED : Over limit'); - return new Object(-1, 'msg_alert_registered_denied_ip'); - } - - // 제한 글수까지는 아니지만 정해진 시간내에 글 작성을 계속 할때 - if($count) { - $message = sprintf(Context::getLang('msg_alert_limited_by_config'), $interval); - - $oSpamFilterController = &getController('spamfilter'); - $oSpamFilterController->insertLog(); - - return new Object(-1, $message); - } - - return new Object(); - } - - /** - * @brief 특정 글에 이미 엮인글이 등록되어 있는지 확인 - **/ - function isInsertedTrackback($document_srl) { - $oTrackbackModel = &getModel('trackback'); - $count = $oTrackbackModel->getTrackbackCountByIPAddress($document_srl, $_SERVER['REMOTE_ADDR']); - if($count>0) return new Object(-1, 'msg_alert_trackback_denied'); - - return new Object(); - } - - /** - * @brief 지정된 IPaddress의 특정 시간대 내의 로그 수를 return - **/ - function getLogCount($time = 60, $ipaddress='') { - if(!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR']; - - $args->ipaddress = $ipaddress; - $args->regdate = date("YmdHis", time()-$time); - $output = executeQuery('spamfilter.getLogCount', $args); - $count = $output->data->count; - return $count; - } - - - } -?> +getModuleConfig('spamfilter'); + } + + /** + * @brief 등록된 금지 IP의 목록을 return + **/ + function getDeniedIPList() { + $args->sort_index = "regdate"; + $args->page = Context::get('page')?Context::get('page'):1; + $output = executeQuery('spamfilter.getDeniedIPList', $args); + if(!$output->data) return; + if(!is_array($output->data)) return array($output->data); + return $output->data; + } + + /** + * @brief 인자로 넘겨진 ipaddress가 금지 ip인지 체크하여 return + **/ + function isDeniedIP() { + $ipaddress = $_SERVER['REMOTE_ADDR']; + + $ip_list = $this->getDeniedIPList(); + if(!count($ip_list)) return new Object(); + + $count = count($ip_list); + $patterns = array(); + for($i=0;$i<$count;$i++) { + $ip = str_replace('*','',$ip_list[$i]->ipaddress); + $patterns[] = preg_quote($ip); + } + + $pattern = '/^('.implode($patterns,'|').')/'; + + if(preg_match($pattern, $ipaddress, $matches)) return new Object(-1,'msg_alert_registered_denied_ip'); + + return new Object(); + } + + /** + * @brief 등록된 금지 Word 의 목록을 return + **/ + function getDeniedWordList() { + $args->sort_index = "hit"; + $output = executeQuery('spamfilter.getDeniedWordList', $args); + if(!$output->data) return; + if(!is_array($output->data)) return array($output->data); + return $output->data; + } + + /** + * @brief 넘어온 text에 금지 단어가 있는지 확인 + **/ + function isDeniedWord($text) { + $word_list = $this->getDeniedWordList(); + if(!count($word_list)) return new Object(); + + $count = count($word_list); + for($i=0;$i<$count;$i++) { + $word = $word_list[$i]->word; + if(preg_match('/'.preg_quote($word,'/').'/is', $text)) { + $args->word = $word; + $output = executeQuery('spamfilter.updateDeniedWordHit', $args); + return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word)); + } + } + + return new Object(); + } + + /** + * @brief 지정된 시간을 체크 + **/ + function checkLimited() { + $config = $this->getConfig(); + $limit_count = $config->limit_count?$config->limit_count:5; + $interval = $config->interval; + if(!$interval) return new Object(); + + $count = $this->getLogCount($interval); + + $ipaddress = $_SERVER['REMOTE_ADDR']; + + // 정해진 시간보다 클 경우 금지 ip로 등록 + if($count>=$limit_count) { + $oSpamFilterController = &getController('spamfilter'); + $oSpamFilterController->insertIP($ipaddress, 'AUTO-DENIED : Over limit'); + return new Object(-1, 'msg_alert_registered_denied_ip'); + } + + // 제한 글수까지는 아니지만 정해진 시간내에 글 작성을 계속 할때 + if($count) { + $message = sprintf(Context::getLang('msg_alert_limited_by_config'), $interval); + + $oSpamFilterController = &getController('spamfilter'); + $oSpamFilterController->insertLog(); + + return new Object(-1, $message); + } + + return new Object(); + } + + /** + * @brief 특정 글에 이미 엮인글이 등록되어 있는지 확인 + **/ + function isInsertedTrackback($document_srl) { + $oTrackbackModel = &getModel('trackback'); + $count = $oTrackbackModel->getTrackbackCountByIPAddress($document_srl, $_SERVER['REMOTE_ADDR']); + if($count>0) return new Object(-1, 'msg_alert_trackback_denied'); + + return new Object(); + } + + /** + * @brief 지정된 IPaddress의 특정 시간대 내의 로그 수를 return + **/ + function getLogCount($time = 60, $ipaddress='') { + if(!$ipaddress) $ipaddress = $_SERVER['REMOTE_ADDR']; + + $args->ipaddress = $ipaddress; + $args->regdate = date("YmdHis", time()-$time); + $output = executeQuery('spamfilter.getLogCount', $args); + $count = $output->data->count; + return $count; + } + + + } +?> diff --git a/modules/syndication/conf/info.xml b/modules/syndication/conf/info.xml index 0b5179c48..59994825c 100644 --- a/modules/syndication/conf/info.xml +++ b/modules/syndication/conf/info.xml @@ -1,18 +1,18 @@ - - - Syndication - 聯合供搞 - İçerik Paylaşımı - 검색서비스업체와 직접 통신을 통해 컨텐츠를 잘 검색되도록 하는 Syndication 규약을 따라 정보를 주고받는 모듈 - 검색서비스업체와 직접 통신을 통해 컨텐츠를 잘 검색되도록 하는 Syndication 규약을 따라 정보를 주고받는 모듈 - 검색서비스업체와 직접 통신을 통해 컨텐츠를 잘 검색되도록 하는 Syndication 규약을 따라 정보를 주고받는 모듈 - 1.0.1 - 2010-06-23 - interlock - - - NHN - NHN - NHN - - + + + Syndication + 聯合供搞 + İçerik Paylaşımı + 검색서비스업체와 직접 통신을 통해 컨텐츠를 잘 검색되도록 하는 Syndication 규약을 따라 정보를 주고받는 모듈 + 검색서비스업체와 직접 통신을 통해 컨텐츠를 잘 검색되도록 하는 Syndication 규약을 따라 정보를 주고받는 모듈 + 검색서비스업체와 직접 통신을 통해 컨텐츠를 잘 검색되도록 하는 Syndication 규약을 따라 정보를 주고받는 모듈 + 1.0.1 + 2010-06-23 + interlock + + + NHN + NHN + NHN + + diff --git a/modules/syndication/syndication.admin.controller.php b/modules/syndication/syndication.admin.controller.php index d370c10db..d4cb3f8fb 100644 --- a/modules/syndication/syndication.admin.controller.php +++ b/modules/syndication/syndication.admin.controller.php @@ -1,133 +1,133 @@ -target_services = explode('|@|',Context::get('target_services')); - $config->site_url = preg_replace('/\/+$/is','',Context::get('site_url')); - $config->year = Context::get('year'); - if(!$config->site_url) return new Object(-1,'msg_site_url_is_null'); - - $oModuleController->insertModuleConfig('syndication',$config); - $oSyndicationController->ping($oSyndicationModel->getID('site'), 'site'); - - $except_module = Context::get('except_module'); - $output = executeQuery('syndication.deleteExceptModules'); - if(!$output->toBool()) return $output; - - $modules = explode(',',$except_module); - for($i=0,$c=count($modules);$i<$c;$i++) { - $args->module_srl = $modules[$i]; - $output = executeQuery('syndication.insertExceptModule',$args); - if(!$output->toBool()) return $output; - } - - $this->setMessage('success_applied'); - } - - function procSyndicationAdminCheckSitePingResult(){ - $site_url = trim(Context::get('site_url')); - if(!$site_url) return new Object(-1,'msg_invalid_request'); - - $oSyndicationModel = &getModel('syndication'); - - $id = $oSyndicationModel->getID('site'); - if(substr($site_url,-1)!='/') $site_url .= '/'; - $site_ping = sprintf('http://%s?module=syndication&act=getSyndicationList&id=%s&type=site', $site_url, $id); - - $headers = array(); - $headers['Connection'] = 'TE, close'; - $headers['User-Agent'] = 'Mozilla/4.0 (compatible; NaverBot/1.0; http://help.naver.com/customer_webtxt_02.jsp)'; - - $xml = FileHandler::getRemoteResource($site_ping, null, 3, 'GET', '', $headers); - if(!$xml) return new Object(-1, 'msg_ping_test_error'); - - $oXmlParser = new XmlParser(); - $oXml = $oXmlParser->parse($xml); - - if(!$oXml || !is_object($oXml) || !$oXml->entry || !$oXml->entry->id || !$oXml->entry->title) { - $this->setMessage('msg_ping_test_error'); - $this->add('ping_result',$xml); - }else{ - $this->setMessage('msg_success_ping_test'); - } - } - - function procSyndicationAdminCheckApiStatus(){ - $target_service = Context::get('target_service'); - if(!$target_service) return new Object(-1,'msg_invalid_request'); - - $status_url = trim($this->statuses[$target_service]); - if(!$status_url) return new Object(-1,'msg_syndication_status_not_support'); - - $oModuleModel = &getModel('module'); - - $config = $oModuleModel->getModuleConfig('syndication'); - $site_url = preg_replace('/^(http|https):\/\//i','',$config->site_url); - - $method = 'getSyndicationStatus' . ucfirst(strtolower($target_service)); - if(!method_exists(&$this, $method)) return new Object(-1,'msg_syndication_status_not_support'); - - $output = call_user_func(array(&$this,$method),$site_url); - if(!$output->toBool()) return $output; - - $this->add('result_status',$output->get('result_status')); - } - - function getSyndicationStatusNaver($site_url){ - $status_url = trim($this->statuses['Naver']); - - $xml = FileHandler::getRemoteResource(sprintf($status_url,$site_url), null, 3, 'GET', 'application/xml'); - $oXmlParser = new XmlParser(); - $oXml = $oXmlParser->parse($xml); - $oStatus = $oXml->syndication_status; - - if($oStatus->error->body != 0) return new Object(-1,$oStatus->message->body); - - $result->site_name = $oStatus->site_name->body; - $result->first_update = $oStatus->first_update->body; - $result->last_update = $oStatus->last_update->body; - $result->visit_ok_count = $oStatus->visit_ok_count->body; - $result->visit_fail_count = $oStatus->visit_fail_count->body; - $result->status = $oStatus->status->body; - - if(!$oStatus->sync || !$oStatus->sync->article){ - $oArticleList = array(); - }else{ - $oArticleList = $oStatus->sync->article; - if(!is_array($oArticleList)) $oArticleList = array($oArticleList); - } - - if(count($oArticleList)>0){ - $article_count = array(); - foreach($oArticleList as $article){ - $article_count[$article->attrs->date] = $article->body; - } - - $result->article_count = $article_count; - $result->max_article_count = max($result->article_count); - - } - - Context::set('result', $result); - $oTemplateHandler = &TemplateHandler::getInstance(); - $html = $oTemplateHandler->compile($this->module_path.'tpl', 'naver_result'); - - $output = new Object(); - $output->add('result_status', $html); - return $output; - } - } -?> +target_services = explode('|@|',Context::get('target_services')); + $config->site_url = preg_replace('/\/+$/is','',Context::get('site_url')); + $config->year = Context::get('year'); + if(!$config->site_url) return new Object(-1,'msg_site_url_is_null'); + + $oModuleController->insertModuleConfig('syndication',$config); + $oSyndicationController->ping($oSyndicationModel->getID('site'), 'site'); + + $except_module = Context::get('except_module'); + $output = executeQuery('syndication.deleteExceptModules'); + if(!$output->toBool()) return $output; + + $modules = explode(',',$except_module); + for($i=0,$c=count($modules);$i<$c;$i++) { + $args->module_srl = $modules[$i]; + $output = executeQuery('syndication.insertExceptModule',$args); + if(!$output->toBool()) return $output; + } + + $this->setMessage('success_applied'); + } + + function procSyndicationAdminCheckSitePingResult(){ + $site_url = trim(Context::get('site_url')); + if(!$site_url) return new Object(-1,'msg_invalid_request'); + + $oSyndicationModel = &getModel('syndication'); + + $id = $oSyndicationModel->getID('site'); + if(substr($site_url,-1)!='/') $site_url .= '/'; + $site_ping = sprintf('http://%s?module=syndication&act=getSyndicationList&id=%s&type=site', $site_url, $id); + + $headers = array(); + $headers['Connection'] = 'TE, close'; + $headers['User-Agent'] = 'Mozilla/4.0 (compatible; NaverBot/1.0; http://help.naver.com/customer_webtxt_02.jsp)'; + + $xml = FileHandler::getRemoteResource($site_ping, null, 3, 'GET', '', $headers); + if(!$xml) return new Object(-1, 'msg_ping_test_error'); + + $oXmlParser = new XmlParser(); + $oXml = $oXmlParser->parse($xml); + + if(!$oXml || !is_object($oXml) || !$oXml->entry || !$oXml->entry->id || !$oXml->entry->title) { + $this->setMessage('msg_ping_test_error'); + $this->add('ping_result',$xml); + }else{ + $this->setMessage('msg_success_ping_test'); + } + } + + function procSyndicationAdminCheckApiStatus(){ + $target_service = Context::get('target_service'); + if(!$target_service) return new Object(-1,'msg_invalid_request'); + + $status_url = trim($this->statuses[$target_service]); + if(!$status_url) return new Object(-1,'msg_syndication_status_not_support'); + + $oModuleModel = &getModel('module'); + + $config = $oModuleModel->getModuleConfig('syndication'); + $site_url = preg_replace('/^(http|https):\/\//i','',$config->site_url); + + $method = 'getSyndicationStatus' . ucfirst(strtolower($target_service)); + if(!method_exists(&$this, $method)) return new Object(-1,'msg_syndication_status_not_support'); + + $output = call_user_func(array(&$this,$method),$site_url); + if(!$output->toBool()) return $output; + + $this->add('result_status',$output->get('result_status')); + } + + function getSyndicationStatusNaver($site_url){ + $status_url = trim($this->statuses['Naver']); + + $xml = FileHandler::getRemoteResource(sprintf($status_url,$site_url), null, 3, 'GET', 'application/xml'); + $oXmlParser = new XmlParser(); + $oXml = $oXmlParser->parse($xml); + $oStatus = $oXml->syndication_status; + + if($oStatus->error->body != 0) return new Object(-1,$oStatus->message->body); + + $result->site_name = $oStatus->site_name->body; + $result->first_update = $oStatus->first_update->body; + $result->last_update = $oStatus->last_update->body; + $result->visit_ok_count = $oStatus->visit_ok_count->body; + $result->visit_fail_count = $oStatus->visit_fail_count->body; + $result->status = $oStatus->status->body; + + if(!$oStatus->sync || !$oStatus->sync->article){ + $oArticleList = array(); + }else{ + $oArticleList = $oStatus->sync->article; + if(!is_array($oArticleList)) $oArticleList = array($oArticleList); + } + + if(count($oArticleList)>0){ + $article_count = array(); + foreach($oArticleList as $article){ + $article_count[$article->attrs->date] = $article->body; + } + + $result->article_count = $article_count; + $result->max_article_count = max($result->article_count); + + } + + Context::set('result', $result); + $oTemplateHandler = &TemplateHandler::getInstance(); + $html = $oTemplateHandler->compile($this->module_path.'tpl', 'naver_result'); + + $output = new Object(); + $output->add('result_status', $html); + return $output; + } + } +?> diff --git a/modules/syndication/syndication.admin.view.php b/modules/syndication/syndication.admin.view.php index be6a441fb..5c45b1400 100644 --- a/modules/syndication/syndication.admin.view.php +++ b/modules/syndication/syndication.admin.view.php @@ -1,50 +1,50 @@ -getModuleConfig('syndication'); - if(!$module_config->target_services) $module_config->target_services = array(); - - foreach($this->services as $key => $val) { - unset($obj); - $obj->service = $key; - $obj->ping = $val; - $obj->selected = in_array($key, $module_config->target_services)?true:false; - $services[] = $obj; - } - Context::set('services', $services); - - if(!$module_config->site_url) { - $module_config->site_url = Context::getDefaultUrl()?Context::getDefaultUrl():getFullUrl(); - } - Context::set('site_url', preg_replace('/^(http|https):\/\//i','',$module_config->site_url)); - - if(!$module_config->year) { - $module_config->year = date("Y"); - } - Context::set('year', $module_config->year); - - $output = executeQueryArray('syndication.getExceptModules'); - $except_module_list = array(); - for($i=0,$c=count($output->data);$i<$c;$i++) { - $except_module_list[] = $output->data[$i]; - } - Context::set('except_module', $except_module_list); - - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('config'); - } - - } -?> +getModuleConfig('syndication'); + if(!$module_config->target_services) $module_config->target_services = array(); + + foreach($this->services as $key => $val) { + unset($obj); + $obj->service = $key; + $obj->ping = $val; + $obj->selected = in_array($key, $module_config->target_services)?true:false; + $services[] = $obj; + } + Context::set('services', $services); + + if(!$module_config->site_url) { + $module_config->site_url = Context::getDefaultUrl()?Context::getDefaultUrl():getFullUrl(); + } + Context::set('site_url', preg_replace('/^(http|https):\/\//i','',$module_config->site_url)); + + if(!$module_config->year) { + $module_config->year = date("Y"); + } + Context::set('year', $module_config->year); + + $output = executeQueryArray('syndication.getExceptModules'); + $except_module_list = array(); + for($i=0,$c=count($output->data);$i<$c;$i++) { + $except_module_list[] = $output->data[$i]; + } + Context::set('except_module', $except_module_list); + + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('config'); + } + + } +?> diff --git a/modules/syndication/syndication.class.php b/modules/syndication/syndication.class.php index eb2bfa9f7..b23c33df6 100644 --- a/modules/syndication/syndication.class.php +++ b/modules/syndication/syndication.class.php @@ -1,74 +1,74 @@ - 'http://syndication.openapi.naver.com/ping/', - ); - - var $statuses = array( - 'Naver' => 'http://syndication.openapi.naver.com/status/?site=%s', - ); - - function moduleInstall() { - $oModuleController = &getController('module'); - $oModuleController->insertTrigger('document.insertDocument', 'syndication', 'controller', 'triggerInsertDocument', 'after'); - $oModuleController->insertTrigger('document.updateDocument', 'syndication', 'controller', 'triggerUpdateDocument', 'after'); - $oModuleController->insertTrigger('document.deleteDocument', 'syndication', 'controller', 'triggerDeleteDocument', 'after'); - $oModuleController->insertTrigger('module.deleteModule', 'syndication', 'controller', 'triggerDeleteModule', 'after'); - - $oModuleController->insertTrigger('document.moveDocumentToTrash', 'syndication', 'controller', 'triggerMoveDocumentToTrash', 'after'); - $oModuleController->insertTrigger('document.restoreTrash', 'syndication', 'controller', 'triggerRestoreTrash', 'after'); - - $oAddonAdminModel = &getAdminModel('addon'); - if($oAddonAdminModel->getAddonInfoXml('catpcha')){ - $oAddonAdminController = &addonAdminController::getInstance(); - $oAddonAdminController->doActivate('catpcha'); - $oAddonAdminController->makeCacheFile(); - } - } - - function checkUpdate() { - $oModuleModel = &getModel('module'); - if(!$oModuleModel->getTrigger('document.moveDocumentToTrash', 'syndication', 'controller', 'triggerMoveDocumentToTrash', 'after')) return true; - if(!$oModuleModel->getTrigger('document.restoreTrash', 'syndication', 'controller', 'triggerRestoreTrash', 'after')) return true; - - return false; - } - - function moduleUpdate() { - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - if(!$oModuleModel->getTrigger('document.moveDocumentToTrash', 'syndication', 'controller', 'triggerMoveDocumentToTrash', 'after')){ - $oModuleController->insertTrigger('document.moveDocumentToTrash', 'syndication', 'controller', 'triggerMoveDocumentToTrash', 'after'); - } - if(!$oModuleModel->getTrigger('document.restoreTrash', 'syndication', 'controller', 'triggerRestoreTrash', 'after')){ - $oModuleController->insertTrigger('document.restoreTrash', 'syndication', 'controller', 'triggerRestoreTrash', 'after'); - } - - $oAddonAdminModel = &getAdminModel('addon'); - if($oAddonAdminModel->getAddonInfoXml('catpcha')){ - $oAddonAdminController = &addonAdminController::getInstance(); - $oAddonAdminController->doActivate('catpcha'); - $oAddonAdminController->makeCacheFile(); - } - - } - - function recompileCache() { - } - } -?> + 'http://syndication.openapi.naver.com/ping/', + ); + + var $statuses = array( + 'Naver' => 'http://syndication.openapi.naver.com/status/?site=%s', + ); + + function moduleInstall() { + $oModuleController = &getController('module'); + $oModuleController->insertTrigger('document.insertDocument', 'syndication', 'controller', 'triggerInsertDocument', 'after'); + $oModuleController->insertTrigger('document.updateDocument', 'syndication', 'controller', 'triggerUpdateDocument', 'after'); + $oModuleController->insertTrigger('document.deleteDocument', 'syndication', 'controller', 'triggerDeleteDocument', 'after'); + $oModuleController->insertTrigger('module.deleteModule', 'syndication', 'controller', 'triggerDeleteModule', 'after'); + + $oModuleController->insertTrigger('document.moveDocumentToTrash', 'syndication', 'controller', 'triggerMoveDocumentToTrash', 'after'); + $oModuleController->insertTrigger('document.restoreTrash', 'syndication', 'controller', 'triggerRestoreTrash', 'after'); + + $oAddonAdminModel = &getAdminModel('addon'); + if($oAddonAdminModel->getAddonInfoXml('catpcha')){ + $oAddonAdminController = &addonAdminController::getInstance(); + $oAddonAdminController->doActivate('catpcha'); + $oAddonAdminController->makeCacheFile(); + } + } + + function checkUpdate() { + $oModuleModel = &getModel('module'); + if(!$oModuleModel->getTrigger('document.moveDocumentToTrash', 'syndication', 'controller', 'triggerMoveDocumentToTrash', 'after')) return true; + if(!$oModuleModel->getTrigger('document.restoreTrash', 'syndication', 'controller', 'triggerRestoreTrash', 'after')) return true; + + return false; + } + + function moduleUpdate() { + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + if(!$oModuleModel->getTrigger('document.moveDocumentToTrash', 'syndication', 'controller', 'triggerMoveDocumentToTrash', 'after')){ + $oModuleController->insertTrigger('document.moveDocumentToTrash', 'syndication', 'controller', 'triggerMoveDocumentToTrash', 'after'); + } + if(!$oModuleModel->getTrigger('document.restoreTrash', 'syndication', 'controller', 'triggerRestoreTrash', 'after')){ + $oModuleController->insertTrigger('document.restoreTrash', 'syndication', 'controller', 'triggerRestoreTrash', 'after'); + } + + $oAddonAdminModel = &getAdminModel('addon'); + if($oAddonAdminModel->getAddonInfoXml('catpcha')){ + $oAddonAdminController = &addonAdminController::getInstance(); + $oAddonAdminController->doActivate('catpcha'); + $oAddonAdminController->makeCacheFile(); + } + + } + + function recompileCache() { + } + } +?> diff --git a/modules/syndication/syndication.controller.php b/modules/syndication/syndication.controller.php index fcdf4b979..d00d59d7e 100644 --- a/modules/syndication/syndication.controller.php +++ b/modules/syndication/syndication.controller.php @@ -1,127 +1,127 @@ -module_srl < 1) return new Object(); - - $oSyndicationModel = &getModel('syndication'); - $oModuleModel = &getModel('module'); - - if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object(); - - $config = $oModuleModel->getModuleConfig('syndication'); - - $id = $oSyndicationModel->getID('channel', $obj->module_srl); - $this->ping($id, 'article'); - - return new Object(); - } - - function triggerUpdateDocument(&$obj) { - if($obj->module_srl < 1) return new Object(); - - $oSyndicationModel = &getModel('syndication'); - $oModuleModel = &getModel('module'); - - if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object(); - - $config = $oModuleModel->getModuleConfig('syndication'); - - $id = $oSyndicationModel->getID('channel', $obj->module_srl); - $this->ping($id, 'article'); - - return new Object(); - } - - function triggerDeleteDocument(&$obj) { - if($obj->module_srl < 1) return new Object(); - - $oSyndicationModel = &getModel('syndication'); - $oModuleModel = &getModel('module'); - - if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object(); - - $this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content); - - $id = $oSyndicationModel->getID('channel', $obj->module_srl); - $this->ping($id, 'deleted'); - - return new Object(); - } - - function triggerDeleteModule(&$obj) { - $oSyndicationModel = &getModel('syndication'); - $oModuleModel = &getModel('module'); - - if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object(); - - $this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content); - - $output = executeQuery('syndication.getExceptModule', $obj); - if($output->data->count) return new Object(); - - $id = $oSyndicationModel->getID('site', $obj->module_srl); - $this->ping($id, 'deleted'); - - return new Object(); - } - - function triggerMoveDocumentToTrash(&$obj) { - $document_srl = $obj->document_srl; - $module_srl = $obj->module_srl; - - $oSyndicationModel = &getModel('syndication'); - $oModuleModel = &getModel('module'); - - if($oSyndicationModel->isExceptedModules($module_srl)) return new Object(); - - $id = $oSyndicationModel->getID('channel', $module_srl); - $this->ping($id, 'deleted'); - - return new Object(); - } - - function triggerRestoreTrash(&$obj) { - $document_srl = $obj->document_srl; - $module_srl = $obj->module_srl; - - $oSyndicationModel = &getModel('syndication'); - $oModuleModel = &getModel('module'); - - if($oSyndicationModel->isExceptedModules($module_srl)) return new Object(); - - $id = $oSyndicationModel->getID('article', $module_srl.'-'.$document_srl); - $this->ping($id, 'article'); - - return new Object(); - } - - function insertLog($module_srl, $document_srl, $title = null, $summary = null) { - $args->module_srl = $module_srl; - $args->document_srl = $document_srl; - $args->title = $title; - $args->summary = $summary; - $output = executeQuery('syndication.insertLog', $args); - } - - function ping($id, $type) { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('syndication'); - - if(!count($config->target_services)) return; - if(substr($config->site_url,-1)!='/') $config->site_url .= '/'; - foreach($config->target_services as $key => $val) { - $ping_url = trim($this->services[$val]); - if(!$ping_url) continue; - $ping_body = sprintf('http://%s?module=syndication&act=getSyndicationList&id=%s&type=%s', $config->site_url, $id, $type); - FileHandler::getRemoteResource($ping_url, null, 3, 'POST', 'application/x-www-form-urlencoded', array(), array(), array('link'=>$ping_body)); - } - } - } -?> +module_srl < 1) return new Object(); + + $oSyndicationModel = &getModel('syndication'); + $oModuleModel = &getModel('module'); + + if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object(); + + $config = $oModuleModel->getModuleConfig('syndication'); + + $id = $oSyndicationModel->getID('channel', $obj->module_srl); + $this->ping($id, 'article'); + + return new Object(); + } + + function triggerUpdateDocument(&$obj) { + if($obj->module_srl < 1) return new Object(); + + $oSyndicationModel = &getModel('syndication'); + $oModuleModel = &getModel('module'); + + if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object(); + + $config = $oModuleModel->getModuleConfig('syndication'); + + $id = $oSyndicationModel->getID('channel', $obj->module_srl); + $this->ping($id, 'article'); + + return new Object(); + } + + function triggerDeleteDocument(&$obj) { + if($obj->module_srl < 1) return new Object(); + + $oSyndicationModel = &getModel('syndication'); + $oModuleModel = &getModel('module'); + + if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object(); + + $this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content); + + $id = $oSyndicationModel->getID('channel', $obj->module_srl); + $this->ping($id, 'deleted'); + + return new Object(); + } + + function triggerDeleteModule(&$obj) { + $oSyndicationModel = &getModel('syndication'); + $oModuleModel = &getModel('module'); + + if($oSyndicationModel->isExceptedModules($obj->module_srl)) return new Object(); + + $this->insertLog($obj->module_srl, $obj->document_srl, $obj->title, $obj->content); + + $output = executeQuery('syndication.getExceptModule', $obj); + if($output->data->count) return new Object(); + + $id = $oSyndicationModel->getID('site', $obj->module_srl); + $this->ping($id, 'deleted'); + + return new Object(); + } + + function triggerMoveDocumentToTrash(&$obj) { + $document_srl = $obj->document_srl; + $module_srl = $obj->module_srl; + + $oSyndicationModel = &getModel('syndication'); + $oModuleModel = &getModel('module'); + + if($oSyndicationModel->isExceptedModules($module_srl)) return new Object(); + + $id = $oSyndicationModel->getID('channel', $module_srl); + $this->ping($id, 'deleted'); + + return new Object(); + } + + function triggerRestoreTrash(&$obj) { + $document_srl = $obj->document_srl; + $module_srl = $obj->module_srl; + + $oSyndicationModel = &getModel('syndication'); + $oModuleModel = &getModel('module'); + + if($oSyndicationModel->isExceptedModules($module_srl)) return new Object(); + + $id = $oSyndicationModel->getID('article', $module_srl.'-'.$document_srl); + $this->ping($id, 'article'); + + return new Object(); + } + + function insertLog($module_srl, $document_srl, $title = null, $summary = null) { + $args->module_srl = $module_srl; + $args->document_srl = $document_srl; + $args->title = $title; + $args->summary = $summary; + $output = executeQuery('syndication.insertLog', $args); + } + + function ping($id, $type) { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('syndication'); + + if(!count($config->target_services)) return; + if(substr($config->site_url,-1)!='/') $config->site_url .= '/'; + foreach($config->target_services as $key => $val) { + $ping_url = trim($this->services[$val]); + if(!$ping_url) continue; + $ping_body = sprintf('http://%s?module=syndication&act=getSyndicationList&id=%s&type=%s', $config->site_url, $id, $type); + FileHandler::getRemoteResource($ping_url, null, 3, 'POST', 'application/x-www-form-urlencoded', array(), array(), array('link'=>$ping_body)); + } + } + } +?> diff --git a/modules/syndication/syndication.model.php b/modules/syndication/syndication.model.php index 728295155..42c2a02c8 100644 --- a/modules/syndication/syndication.model.php +++ b/modules/syndication/syndication.model.php @@ -1,363 +1,363 @@ -getModuleConfig('syndication'); - $this->site_url = preg_replace('/\/+$/is','',$config->site_url); - $this->target_services = $config->target_services; - $this->year = $config->year; - - $output = executeQueryArray('syndication.getGrantedModules'); - if($output->data) { - foreach($output->data as $key => $val) { - $this->granted_modules[] = $val->module_srl; - } - } - } - - function isExceptedModules($module_srl) { - $args->module_srl = $module_srl; - $output = executeQuery('syndication.getExceptModule', $args); - if($output->data->count) return true; - $output = executeQuery('syndication.getGrantedModule', $args); - if($output->data->count) return true; - return false; - - } - - function getLang($key, $site_srl) - { - if(!$this->langs[$site_srl]) - { - $this->langs[$site_srl] = array(); - $args->site_srl = $site_srl; - $args->lang_code = Context::getLangType(); - $output = executeQueryArray("syndication.getLang", $args); - if(!$output->toBool() || !$output->data) return $key; - foreach($output->data as $value) - { - $this->langs[$site_srl][$value->name] = $value->value; - } - } - if($this->langs[$site_srl][$key]) - { - return $this->langs[$site_srl][$key]; - } - else return $key; - } - - function handleLang($title, $site_srl) - { - $matches = null; - if(!preg_match("/\\\$user_lang->(.+)/",$title, $matches)) return $title; - else - { - return $this->getLang($matches[1], $site_srl); - } - } - - function getSyndicationList() { - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModuleConfig('syndication'); - if(!$config->year || !$config->site_url) return new Object(-1,'msg_check_syndication_config'); - - $id = Context::get('id'); - $type = Context::get('type'); - $page = Context::get('page'); - if(!$id || !$type) return new Object(-1,'msg_invalid_request'); - - if(!preg_match('/^tag:([^,]+),([0-9]+):(site|channel|article)(.*)$/i',$id,$matches)) return new Object(-1,'msg_invalid_request'); - - $url = $matches[1]; - $year = $matches[2]; - $target = $matches[3]; - $id = $matches[4]; - if($id && $id{0}==':') $id = substr($id, 1); - - if($id && strpos($id,'-')!==false) list($module_srl, $document_srl) = explode('-',$id); - elseif($id) $module_srl = $id; - if(!$url || !$year || !$target) return new Object(-1,'msg_invalid_request'); - - $startTime = Context::get('start-time'); - $endTime = Context::get('end-time'); - - $time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3); - Context::set('time_zone', $time_zone); - - $site_module_info = Context::get('site_module_info'); - - if($target == 'channel' && !$module_srl) $target = 'site'; - if($target == 'channel' && $module_srl) { - $args->module_srls = $module_srl; - $output = executeQuery('syndication.getModules', $args); - $module_info = $output->data; - if($module_info) { - $args->module_srl = $module_srl; - $output = executeQuery('syndication.getExceptModules', $args); - if($output->data->count) $error = 'target is not founded'; - } else $error = 'target is not founded'; - - unset($args); - } - - if(!$error) { - Context::set('target', $target); - Context::set('type', $type); - switch($target) { - case 'site' : - $site_info->id = $this->getID('site'); - $site_info->title = $this->handleLang($site_module_info->browser_title, $site_module_info->site_srl); - - $output = executeQuery('syndication.getSiteUpdatedTime'); - if($output->data) $site_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; - $site_info->self_href = $this->getSelfHref($site_info->id,$type); - $site_info->alternative_href =$this->getAlternativeHref(); - Context::set('site_info', $site_info); - - $this->setTemplateFile('site'); - switch($type) { - case 'channel' : - Context::set('channels', $this->getChannels()); - break; - case 'article' : - Context::set('articles', $this->getArticles(null, $page, $startTime, $endTime, 'article',$site_info->id)); - break; - case 'deleted' : - Context::set('deleted', $this->getDeleted(null, $page, $startTime, $endTime, 'deleted',$site_info->id)); - break; - default : - $this->setTemplateFile('site.info'); - break; - } - break; - case 'channel' : - $channel_info->id = $this->getID('channel', $module_info->module_srl); - $channel_info->title = $this->handleLang($module_info->browser_title, $module_info->site_srl); - $channel_info->updated = date("Y-m-d\\TH:i:s").$time_zone; - $channel_info->self_href = $this->getSelfHref($channel_info->id, $type); - $channel_info->alternative_href = $this->getAlternativeHref($module_info); - $channel_info->summary = $module_info->description; - if($module_info->module == "textyle") - { - $channel_info->type = "blog"; - $channel_info->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss'); - } - else - { - $channel_info->type = "web"; - } - $output = executeQuery('syndication.getSiteUpdatedTime'); - if($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; - Context::set('channel_info', $channel_info); - - $this->setTemplateFile('channel'); - switch($type) { - case 'article' : - Context::set('articles', $this->getArticles($module_srl, $page, $startTime, $endTime, 'article', $channel_info->id)); - break; - case 'deleted' : - Context::set('deleted', $this->getDeleted($module_srl, $page, $startTime, $endTime, 'deleted', $channel_info->id)); - break; - default : - $this->setTemplateFile('channel.info'); - break; - } - break; - - case 'article': - Context::set('article', $this->getArticle($document_srl)); - $this->setTemplateFile('include.articles'); - break; - } - } else { - Context::set('message', $error); - $this->setTemplateFile('error'); - } - - $this->setTemplatePath($this->module_path.'tpl'); - Context::setResponseMethod('XMLRPC'); - } - - function getChannels() { - if($module_srls) $args->module_srls = $module_srls; - if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules); - $output = executeQueryArray('syndication.getModules', $args); - if($output->data) { - foreach($output->data as $module_info) { - unset($obj); - $obj->id = $this->getID('channel', $module_info->module_srl); - $obj->title = $this->handleLang($module_info->browser_title, $module_info->site_srl); - $obj->updated = date("Y-m-d\\TH:i:s").$time_zone; - $obj->self_href = $this->getSelfHref($obj->id, 'channel'); - $obj->alternative_href = $this->getAlternativeHref($module_info); - $obj->summary = $module_info->description; - if($module_info->module == "textyle") - { - $obj->type = "blog"; - $obj->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss'); - } - else - { - $obj->type = "web"; - } - - $list[] = $obj; - } - } - return $list; - } - - function getArticle($document_srl) { - if($this->site_url==null) $this->init(); - - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl,false,false); - if(!$oDocument->isExists()) return; - - $val = $oDocument->getObjectVars(); - - $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); - $val->updated = date("Y-m-d\\TH:i:s", ztime($val->last_update)).$GLOBALS['_time_zone']; - $val->alternative_href = getFullSiteUrl($this->site_url, '', 'document_srl', $val->document_srl); - $val->channel_alternative_href = $this->getChannelAlternativeHref($val->module_srl); - $val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl); - if(!$val->nick_name) $val->nick_name = $val->user_name; - - return $val; - } - - function getArticles($module_srl = null, $page=1, $startTime = null, $endTime = null, $type = null, $id = null) { - if($this->site_url==null) $this->init(); - - if($module_srl) $args->module_srl = $module_srl; - if($startTime) $args->start_date = $this->getDate($startTime); - if($endTime) $args->end_date = $this->getDate($endTime); - if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules); - $args->page = $page; - $output = executeQueryArray('syndication.getDocumentList', $args); - $cur_page = $output->page_navigation->cur_page; - $total_page = $output->page_navigation->last_page; - - $result->next_url = null; - $result->list = array(); - - if($cur_page<$total_page) { - $next_url = $this->getSelfHref($id, $type); - if($startTime) $next_url .= '&startTime='.$startTime; - if($endTime) $next_url .= '&endTime='.$endTime; - $result->next_url = $next_url.'&page='.($cur_page+1); - } - - if($output->data) { - foreach($output->data as $key => $val) { - $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); - $val->updated = date("Y-m-d\\TH:i:s", ztime($val->last_update)).$GLOBALS['_time_zone']; - $val->alternative_href = getFullSiteUrl($this->site_url, '', 'document_srl', $val->document_srl); - $val->channel_alternative_href = $this->getChannelAlternativeHref($val->module_srl); - $val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl); - if(!$val->nick_name) $val->nick_name = $val->user_name; - $output->data[$key] = $val; - } - $result->list = $output->data; - } - return $result; - } - - function getDeleted($module_srl = null, $page = 1, $startTime = null, $endTime = null, $type = null, $id = null) { - if($this->site_url==null) $this->init(); - - if($module_srl) $args->module_srl= $module_srl; - if($startTime) $args->start_date = $this->getDate($startTime); - if($endTime) $args->end_date = $this->getDate($endTime); - $args->page = $page; - - $output = executeQueryArray('syndication.getDeletedList', $args); - - $cur_page = $output->page_navigation->cur_page; - $total_page = $output->page_navigation->last_page; - - $result->next_url = null; - $result->list = array(); - - if($cur_page<$total_page) { - $next_url = $this->getSelfHref($id, $type); - if($startTime) $next_url .= '&startTime='.$startTime; - if($endTime) $next_url .= '&endTime='.$endTime; - $result->next_url = $next_url . '&page='.($cur_page+1); - } - - if($output->data) { - foreach($output->data as $key => $val) { - $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); - $val->deleted = date("Y-m-d\\TH:i:s", ztime($val->regdate)).$GLOBALS['_time_zone']; - $val->alternative_href = getFullSiteUrl($this->site_url, '', 'document_srl', $val->document_srl); - $val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl); - $output->data[$key] = $val; - } - $result->list = $output->data; - } - return $result; - } - - function getID($type, $target_id = null) { - if($this->site_url==null) $this->init(); - - return sprintf('tag:%s,%d:%s', $this->site_url, $this->year, $type) . ($target_id?':'.$target_id:''); - } - - function getChannelAlternativeHref($module_srl) { - static $module_info = array(); - if(!isset($module_info[$module_srl])) { - $args->module_srl = $module_srl; - $output = executeQuery('syndication.getModuleSiteInfo', $args); - if($output->data) $module_info[$module_srl] = $output->data; - else $module_info[$module_srl] = null; - } - - if(is_null($module_info[$module_srl])) return $this->site_url; - - $domain = $module_info[$module_srl]->domain; - $url = getFullSiteUrl($domain, '', 'mid', $module_info[$module_srl]->mid); - if(substr($url,0,1)=='/') $domain = 'http://'.$this->site_url.$url; - return $url; - } - - function getSelfHref($id, $type = null) { - if($this->site_url==null) $this->init(); - - return sprintf('http://%s/?module=syndication&act=getSyndicationList&id=%s&type=%s', $this->site_url, $id, $type); - } - - function getAlternativeHref($module_info = null) { - if($this->site_url==null) $this->init(); - - if(!$module_info) return sprintf('http://%s', $this->site_url); - if(!$module_info->site_srl) return getFullUrl('', 'mid', $module_info->mid); - - $domain = $module_info->domain; - $url = getFullSiteUrl($domain, '', 'mid', $module_info->mid); - - if(substr($url,0,1)=='/') $domain = 'http://'.$this->site_url.$url; - return $url; - } - - function getDate($date) { - $time = strtotime($date); - if($time == -1) $time = ztime(str_replace(array('-','T',':'),'',$date)); - return date('YmdHis', $time); - } - } -?> +getModuleConfig('syndication'); + $this->site_url = preg_replace('/\/+$/is','',$config->site_url); + $this->target_services = $config->target_services; + $this->year = $config->year; + + $output = executeQueryArray('syndication.getGrantedModules'); + if($output->data) { + foreach($output->data as $key => $val) { + $this->granted_modules[] = $val->module_srl; + } + } + } + + function isExceptedModules($module_srl) { + $args->module_srl = $module_srl; + $output = executeQuery('syndication.getExceptModule', $args); + if($output->data->count) return true; + $output = executeQuery('syndication.getGrantedModule', $args); + if($output->data->count) return true; + return false; + + } + + function getLang($key, $site_srl) + { + if(!$this->langs[$site_srl]) + { + $this->langs[$site_srl] = array(); + $args->site_srl = $site_srl; + $args->lang_code = Context::getLangType(); + $output = executeQueryArray("syndication.getLang", $args); + if(!$output->toBool() || !$output->data) return $key; + foreach($output->data as $value) + { + $this->langs[$site_srl][$value->name] = $value->value; + } + } + if($this->langs[$site_srl][$key]) + { + return $this->langs[$site_srl][$key]; + } + else return $key; + } + + function handleLang($title, $site_srl) + { + $matches = null; + if(!preg_match("/\\\$user_lang->(.+)/",$title, $matches)) return $title; + else + { + return $this->getLang($matches[1], $site_srl); + } + } + + function getSyndicationList() { + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModuleConfig('syndication'); + if(!$config->year || !$config->site_url) return new Object(-1,'msg_check_syndication_config'); + + $id = Context::get('id'); + $type = Context::get('type'); + $page = Context::get('page'); + if(!$id || !$type) return new Object(-1,'msg_invalid_request'); + + if(!preg_match('/^tag:([^,]+),([0-9]+):(site|channel|article)(.*)$/i',$id,$matches)) return new Object(-1,'msg_invalid_request'); + + $url = $matches[1]; + $year = $matches[2]; + $target = $matches[3]; + $id = $matches[4]; + if($id && $id{0}==':') $id = substr($id, 1); + + if($id && strpos($id,'-')!==false) list($module_srl, $document_srl) = explode('-',$id); + elseif($id) $module_srl = $id; + if(!$url || !$year || !$target) return new Object(-1,'msg_invalid_request'); + + $startTime = Context::get('start-time'); + $endTime = Context::get('end-time'); + + $time_zone = substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3); + Context::set('time_zone', $time_zone); + + $site_module_info = Context::get('site_module_info'); + + if($target == 'channel' && !$module_srl) $target = 'site'; + if($target == 'channel' && $module_srl) { + $args->module_srls = $module_srl; + $output = executeQuery('syndication.getModules', $args); + $module_info = $output->data; + if($module_info) { + $args->module_srl = $module_srl; + $output = executeQuery('syndication.getExceptModules', $args); + if($output->data->count) $error = 'target is not founded'; + } else $error = 'target is not founded'; + + unset($args); + } + + if(!$error) { + Context::set('target', $target); + Context::set('type', $type); + switch($target) { + case 'site' : + $site_info->id = $this->getID('site'); + $site_info->title = $this->handleLang($site_module_info->browser_title, $site_module_info->site_srl); + + $output = executeQuery('syndication.getSiteUpdatedTime'); + if($output->data) $site_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; + $site_info->self_href = $this->getSelfHref($site_info->id,$type); + $site_info->alternative_href =$this->getAlternativeHref(); + Context::set('site_info', $site_info); + + $this->setTemplateFile('site'); + switch($type) { + case 'channel' : + Context::set('channels', $this->getChannels()); + break; + case 'article' : + Context::set('articles', $this->getArticles(null, $page, $startTime, $endTime, 'article',$site_info->id)); + break; + case 'deleted' : + Context::set('deleted', $this->getDeleted(null, $page, $startTime, $endTime, 'deleted',$site_info->id)); + break; + default : + $this->setTemplateFile('site.info'); + break; + } + break; + case 'channel' : + $channel_info->id = $this->getID('channel', $module_info->module_srl); + $channel_info->title = $this->handleLang($module_info->browser_title, $module_info->site_srl); + $channel_info->updated = date("Y-m-d\\TH:i:s").$time_zone; + $channel_info->self_href = $this->getSelfHref($channel_info->id, $type); + $channel_info->alternative_href = $this->getAlternativeHref($module_info); + $channel_info->summary = $module_info->description; + if($module_info->module == "textyle") + { + $channel_info->type = "blog"; + $channel_info->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss'); + } + else + { + $channel_info->type = "web"; + } + $output = executeQuery('syndication.getSiteUpdatedTime'); + if($output->data) $channel_info->updated = date("Y-m-d\\TH:i:s", ztime($output->data->last_update)).$time_zone; + Context::set('channel_info', $channel_info); + + $this->setTemplateFile('channel'); + switch($type) { + case 'article' : + Context::set('articles', $this->getArticles($module_srl, $page, $startTime, $endTime, 'article', $channel_info->id)); + break; + case 'deleted' : + Context::set('deleted', $this->getDeleted($module_srl, $page, $startTime, $endTime, 'deleted', $channel_info->id)); + break; + default : + $this->setTemplateFile('channel.info'); + break; + } + break; + + case 'article': + Context::set('article', $this->getArticle($document_srl)); + $this->setTemplateFile('include.articles'); + break; + } + } else { + Context::set('message', $error); + $this->setTemplateFile('error'); + } + + $this->setTemplatePath($this->module_path.'tpl'); + Context::setResponseMethod('XMLRPC'); + } + + function getChannels() { + if($module_srls) $args->module_srls = $module_srls; + if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules); + $output = executeQueryArray('syndication.getModules', $args); + if($output->data) { + foreach($output->data as $module_info) { + unset($obj); + $obj->id = $this->getID('channel', $module_info->module_srl); + $obj->title = $this->handleLang($module_info->browser_title, $module_info->site_srl); + $obj->updated = date("Y-m-d\\TH:i:s").$time_zone; + $obj->self_href = $this->getSelfHref($obj->id, 'channel'); + $obj->alternative_href = $this->getAlternativeHref($module_info); + $obj->summary = $module_info->description; + if($module_info->module == "textyle") + { + $obj->type = "blog"; + $obj->rss_href = getFullSiteUrl($module_info->domain, '', 'mid', $module_info->mid, 'act', 'rss'); + } + else + { + $obj->type = "web"; + } + + $list[] = $obj; + } + } + return $list; + } + + function getArticle($document_srl) { + if($this->site_url==null) $this->init(); + + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl,false,false); + if(!$oDocument->isExists()) return; + + $val = $oDocument->getObjectVars(); + + $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); + $val->updated = date("Y-m-d\\TH:i:s", ztime($val->last_update)).$GLOBALS['_time_zone']; + $val->alternative_href = getFullSiteUrl($this->site_url, '', 'document_srl', $val->document_srl); + $val->channel_alternative_href = $this->getChannelAlternativeHref($val->module_srl); + $val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl); + if(!$val->nick_name) $val->nick_name = $val->user_name; + + return $val; + } + + function getArticles($module_srl = null, $page=1, $startTime = null, $endTime = null, $type = null, $id = null) { + if($this->site_url==null) $this->init(); + + if($module_srl) $args->module_srl = $module_srl; + if($startTime) $args->start_date = $this->getDate($startTime); + if($endTime) $args->end_date = $this->getDate($endTime); + if(count($this->granted_modules)) $args->except_module_srls = implode(',',$this->granted_modules); + $args->page = $page; + $output = executeQueryArray('syndication.getDocumentList', $args); + $cur_page = $output->page_navigation->cur_page; + $total_page = $output->page_navigation->last_page; + + $result->next_url = null; + $result->list = array(); + + if($cur_page<$total_page) { + $next_url = $this->getSelfHref($id, $type); + if($startTime) $next_url .= '&startTime='.$startTime; + if($endTime) $next_url .= '&endTime='.$endTime; + $result->next_url = $next_url.'&page='.($cur_page+1); + } + + if($output->data) { + foreach($output->data as $key => $val) { + $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); + $val->updated = date("Y-m-d\\TH:i:s", ztime($val->last_update)).$GLOBALS['_time_zone']; + $val->alternative_href = getFullSiteUrl($this->site_url, '', 'document_srl', $val->document_srl); + $val->channel_alternative_href = $this->getChannelAlternativeHref($val->module_srl); + $val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl); + if(!$val->nick_name) $val->nick_name = $val->user_name; + $output->data[$key] = $val; + } + $result->list = $output->data; + } + return $result; + } + + function getDeleted($module_srl = null, $page = 1, $startTime = null, $endTime = null, $type = null, $id = null) { + if($this->site_url==null) $this->init(); + + if($module_srl) $args->module_srl= $module_srl; + if($startTime) $args->start_date = $this->getDate($startTime); + if($endTime) $args->end_date = $this->getDate($endTime); + $args->page = $page; + + $output = executeQueryArray('syndication.getDeletedList', $args); + + $cur_page = $output->page_navigation->cur_page; + $total_page = $output->page_navigation->last_page; + + $result->next_url = null; + $result->list = array(); + + if($cur_page<$total_page) { + $next_url = $this->getSelfHref($id, $type); + if($startTime) $next_url .= '&startTime='.$startTime; + if($endTime) $next_url .= '&endTime='.$endTime; + $result->next_url = $next_url . '&page='.($cur_page+1); + } + + if($output->data) { + foreach($output->data as $key => $val) { + $val->id = $this->getID('article', $val->module_srl.'-'.$val->document_srl); + $val->deleted = date("Y-m-d\\TH:i:s", ztime($val->regdate)).$GLOBALS['_time_zone']; + $val->alternative_href = getFullSiteUrl($this->site_url, '', 'document_srl', $val->document_srl); + $val->channel_id = $this->getID('channel', $val->module_srl.'-'.$val->document_srl); + $output->data[$key] = $val; + } + $result->list = $output->data; + } + return $result; + } + + function getID($type, $target_id = null) { + if($this->site_url==null) $this->init(); + + return sprintf('tag:%s,%d:%s', $this->site_url, $this->year, $type) . ($target_id?':'.$target_id:''); + } + + function getChannelAlternativeHref($module_srl) { + static $module_info = array(); + if(!isset($module_info[$module_srl])) { + $args->module_srl = $module_srl; + $output = executeQuery('syndication.getModuleSiteInfo', $args); + if($output->data) $module_info[$module_srl] = $output->data; + else $module_info[$module_srl] = null; + } + + if(is_null($module_info[$module_srl])) return $this->site_url; + + $domain = $module_info[$module_srl]->domain; + $url = getFullSiteUrl($domain, '', 'mid', $module_info[$module_srl]->mid); + if(substr($url,0,1)=='/') $domain = 'http://'.$this->site_url.$url; + return $url; + } + + function getSelfHref($id, $type = null) { + if($this->site_url==null) $this->init(); + + return sprintf('http://%s/?module=syndication&act=getSyndicationList&id=%s&type=%s', $this->site_url, $id, $type); + } + + function getAlternativeHref($module_info = null) { + if($this->site_url==null) $this->init(); + + if(!$module_info) return sprintf('http://%s', $this->site_url); + if(!$module_info->site_srl) return getFullUrl('', 'mid', $module_info->mid); + + $domain = $module_info->domain; + $url = getFullSiteUrl($domain, '', 'mid', $module_info->mid); + + if(substr($url,0,1)=='/') $domain = 'http://'.$this->site_url.$url; + return $url; + } + + function getDate($date) { + $time = strtotime($date); + if($time == -1) $time = ztime(str_replace(array('-','T',':'),'',$date)); + return date('YmdHis', $time); + } + } +?> diff --git a/modules/tag/conf/info.xml b/modules/tag/conf/info.xml index 08ce31c8c..5443a8cc8 100644 --- a/modules/tag/conf/info.xml +++ b/modules/tag/conf/info.xml @@ -1,36 +1,36 @@ - - - 꼬리표 - 标签 - タグ - Tag - Tag - Etiqueta - Теги - 標籤 - Etiket - 꼬리표 관리 모듈 - 标签管理模块。 - タグ管理用のモジュールです。 - Module for managing tags. - Module quản lý Tag. - Módulo para manejar etiquetas. - Модуль для управления тегами. - 標籤管理模組。 - Etiketleri yönetme modülü. - 0.1 - 2007-02-28 - content - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 꼬리표 + 标签 + タグ + Tag + Tag + Etiqueta + Теги + 標籤 + Etiket + 꼬리표 관리 모듈 + 标签管理模块。 + タグ管理用のモジュールです。 + Module for managing tags. + Module quản lý Tag. + Módulo para manejar etiquetas. + Модуль для управления тегами. + 標籤管理模組。 + Etiketleri yönetme modülü. + 0.1 + 2007-02-28 + content + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/tag/tag.admin.controller.php b/modules/tag/tag.admin.controller.php index 849a9015a..91039367b 100644 --- a/modules/tag/tag.admin.controller.php +++ b/modules/tag/tag.admin.controller.php @@ -1,17 +1,17 @@ -module_srl = $module_srl; - return executeQuery('tag.deleteModuleTags', $args); - } - } -?> +module_srl = $module_srl; + return executeQuery('tag.deleteModuleTags', $args); + } + } +?> diff --git a/modules/tag/tag.class.php b/modules/tag/tag.class.php index f26ae7c85..1e4bca738 100644 --- a/modules/tag/tag.class.php +++ b/modules/tag/tag.class.php @@ -1,96 +1,96 @@ -addIndex("tags","idx_tag", array("document_srl","tag")); - - // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument에 대한 trigger 등록 - $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); - $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); - $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); - $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); - $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'); - - // 2007. 10. 17 모듈이 삭제될때 등록된 태그도 모두 삭제하는 트리거 추가 - $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oModuleModel = &getModel('module'); - $oDB = &DB::getInstance(); - - // 2007. 10. 17 trigger 등록이 안되어 있으면 등록 - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; - if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) return true; - - // 2007. 10. 17 모듈이 삭제될때 등록된 태그도 모두 삭제하는 트리거 추가 - if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) return true; - - // tag 테이블의 tag 컬럼에 index - if(!$oDB->isIndexExists("tags","idx_tag")) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - $oDB = &DB::getInstance(); - - // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument에 대한 trigger 등록 - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) - $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); - - if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) - $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); - - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) - $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); - - if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) - $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); - - if(!$oModuleModel->getTrigger('document.triggerDeleteTag', 'tag', 'controller', 'triggerDeleteTag', 'after')) - $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'); - - // 2007. 10. 17 모듈이 삭제될때 등록된 태그도 모두 삭제하는 트리거 추가 - if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) - $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'); - - // tag 테이블의 tag 컬럼에 index - if(!$oDB->isIndexExists("tags","idx_tag")) - $oDB->addIndex("tags","idx_tag", array("document_srl","tag")); - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - } - } -?> +addIndex("tags","idx_tag", array("document_srl","tag")); + + // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument에 대한 trigger 등록 + $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); + $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); + $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); + $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); + $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'); + + // 2007. 10. 17 모듈이 삭제될때 등록된 태그도 모두 삭제하는 트리거 추가 + $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oModuleModel = &getModel('module'); + $oDB = &DB::getInstance(); + + // 2007. 10. 17 trigger 등록이 안되어 있으면 등록 + if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; + if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; + if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) return true; + if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) return true; + if(!$oModuleModel->getTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after')) return true; + + // 2007. 10. 17 모듈이 삭제될때 등록된 태그도 모두 삭제하는 트리거 추가 + if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) return true; + + // tag 테이블의 tag 컬럼에 index + if(!$oDB->isIndexExists("tags","idx_tag")) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + $oDB = &DB::getInstance(); + + // 2007. 10. 17 document.insertDocument, updateDocument, deleteDocument에 대한 trigger 등록 + if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) + $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); + + if(!$oModuleModel->getTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) + $oModuleController->insertTrigger('document.insertDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); + + if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before')) + $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerArrangeTag', 'before'); + + if(!$oModuleModel->getTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after')) + $oModuleController->insertTrigger('document.updateDocument', 'tag', 'controller', 'triggerInsertTag', 'after'); + + if(!$oModuleModel->getTrigger('document.triggerDeleteTag', 'tag', 'controller', 'triggerDeleteTag', 'after')) + $oModuleController->insertTrigger('document.deleteDocument', 'tag', 'controller', 'triggerDeleteTag', 'after'); + + // 2007. 10. 17 모듈이 삭제될때 등록된 태그도 모두 삭제하는 트리거 추가 + if(!$oModuleModel->getTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after')) + $oModuleController->insertTrigger('module.deleteModule', 'tag', 'controller', 'triggerDeleteModuleTags', 'after'); + + // tag 테이블의 tag 컬럼에 index + if(!$oDB->isIndexExists("tags","idx_tag")) + $oDB->addIndex("tags","idx_tag", array("document_srl","tag")); + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + } + } +?> diff --git a/modules/tag/tag.controller.php b/modules/tag/tag.controller.php index 4e65b8243..9f86dac9b 100644 --- a/modules/tag/tag.controller.php +++ b/modules/tag/tag.controller.php @@ -1,92 +1,92 @@ -tags) return new Object(); - - // tags변수 정리 - $tag_list = explode(',', $obj->tags); - $tag_count = count($tag_list); - $tag_list = array_unique($tag_list); - if(!count($tag_list)) return new Object(); - - foreach($tag_list as $tag) { - if(!trim($tag)) continue; - $arranged_tag_list[] = trim($tag); - } - if(!count($arranged_tag_list)) $obj->tags = null; - else $obj->tags = implode(',',$arranged_tag_list); - return new Object(); - } - - /** - * @brief 태그 입력 trigger - * 태그 입력은 해당 글의 모든 태그를 삭제 후 재 입력하는 방식을 이용 - **/ - function triggerInsertTag(&$obj) { - $module_srl = $obj->module_srl; - $document_srl = $obj->document_srl; - $tags = $obj->tags; - if(!$document_srl) return new Object(); - - // 해당 글의 tags를 모두 삭제 - $output = $this->triggerDeleteTag($obj); - if(!$output->toBool()) return $output; - - // 다시 태그를 입력 - $args->module_srl = $module_srl; - $args->document_srl = $document_srl; - - $tag_list = explode(',',$tags); - $tag_count = count($tag_list); - for($i=0;$i<$tag_count;$i++) { - unset($args->tag); - $args->tag = trim($tag_list[$i]); - if(!$args->tag) continue; - $output = executeQuery('tag.insertTag', $args); - if(!$output->toBool()) return $output; - } - - return new Object(); - } - - /** - * @brief 특정 문서의 태그 삭제 trigger - * document_srl에 속한 tag 모두 삭제 - **/ - function triggerDeleteTag(&$obj) { - $document_srl = $obj->document_srl; - if(!$document_srl) return new Object(); - - $args->document_srl = $document_srl; - return executeQuery('tag.deleteTag', $args); - } - - /** - * @brief module 삭제시 해당 태그 모두 삭제하는 trigger - **/ - function triggerDeleteModuleTags(&$obj) { - $module_srl = $obj->module_srl; - if(!$module_srl) return new Object(); - - $oTagController = &getAdminController('tag'); - return $oTagController->deleteModuleTags($module_srl); - } - - } -?> +tags) return new Object(); + + // tags변수 정리 + $tag_list = explode(',', $obj->tags); + $tag_count = count($tag_list); + $tag_list = array_unique($tag_list); + if(!count($tag_list)) return new Object(); + + foreach($tag_list as $tag) { + if(!trim($tag)) continue; + $arranged_tag_list[] = trim($tag); + } + if(!count($arranged_tag_list)) $obj->tags = null; + else $obj->tags = implode(',',$arranged_tag_list); + return new Object(); + } + + /** + * @brief 태그 입력 trigger + * 태그 입력은 해당 글의 모든 태그를 삭제 후 재 입력하는 방식을 이용 + **/ + function triggerInsertTag(&$obj) { + $module_srl = $obj->module_srl; + $document_srl = $obj->document_srl; + $tags = $obj->tags; + if(!$document_srl) return new Object(); + + // 해당 글의 tags를 모두 삭제 + $output = $this->triggerDeleteTag($obj); + if(!$output->toBool()) return $output; + + // 다시 태그를 입력 + $args->module_srl = $module_srl; + $args->document_srl = $document_srl; + + $tag_list = explode(',',$tags); + $tag_count = count($tag_list); + for($i=0;$i<$tag_count;$i++) { + unset($args->tag); + $args->tag = trim($tag_list[$i]); + if(!$args->tag) continue; + $output = executeQuery('tag.insertTag', $args); + if(!$output->toBool()) return $output; + } + + return new Object(); + } + + /** + * @brief 특정 문서의 태그 삭제 trigger + * document_srl에 속한 tag 모두 삭제 + **/ + function triggerDeleteTag(&$obj) { + $document_srl = $obj->document_srl; + if(!$document_srl) return new Object(); + + $args->document_srl = $document_srl; + return executeQuery('tag.deleteTag', $args); + } + + /** + * @brief module 삭제시 해당 태그 모두 삭제하는 trigger + **/ + function triggerDeleteModuleTags(&$obj) { + $module_srl = $obj->module_srl; + if(!$module_srl) return new Object(); + + $oTagController = &getAdminController('tag'); + return $oTagController->deleteModuleTags($module_srl); + } + + } +?> diff --git a/modules/tag/tag.model.php b/modules/tag/tag.model.php index 996eb164e..14a202b59 100644 --- a/modules/tag/tag.model.php +++ b/modules/tag/tag.model.php @@ -1,87 +1,87 @@ -mid) { - $oModuleModel = &getModel('module'); - $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); - unset($obj->mid); - } - - // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - $args->list_count = $obj->list_count; - $args->count = $obj->sort_index; - - $output = executeQueryArray('tag.getTagList', $args); - if(!$output->toBool()) return $output; - - return $output; - } - - - /** - * @brief tag로 document_srl를 가져오기 - **/ - function getDocumentSrlByTag($obj){ - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - - $args->tag = $obj->tag; - $output = executeQueryArray('tag.getDocumentSrlByTag', $args); - if(!$output->toBool()) return $output; - - return $output; - } - - /** - * @brief document 에서 사용된 tag 가져오기 - **/ - function getDocumentsTagList($obj){ - if(is_array($obj->document_srl)) $args->document_srl = implode(',', $obj->document_srl); - else $args->document_srl = $obj->document_srl; - - $output = executeQueryArray('tag.getDocumentsTagList', $args); - if(!$output->toBool()) return $output; - - return $output; - } - - /** - * @brief 특정tag과 함께 사용된 tag목록 - **/ - function getTagWithUsedList($obj){ - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - - $args->tag = $obj->tag; - $output = $this->getDocumentSrlByTag($args); - $document_srl = array(); - - if($output->data){ - foreach($output->data as $k => $v) $document_srl[] = $v->document_srl; - } - unset($args); - $args->document_srl = $document_srl; - $output = $this->getDocumentsTagList($args); - return $output; - } - } -?> +mid) { + $oModuleModel = &getModel('module'); + $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); + unset($obj->mid); + } + + // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 + if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + $args->list_count = $obj->list_count; + $args->count = $obj->sort_index; + + $output = executeQueryArray('tag.getTagList', $args); + if(!$output->toBool()) return $output; + + return $output; + } + + + /** + * @brief tag로 document_srl를 가져오기 + **/ + function getDocumentSrlByTag($obj){ + if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + + $args->tag = $obj->tag; + $output = executeQueryArray('tag.getDocumentSrlByTag', $args); + if(!$output->toBool()) return $output; + + return $output; + } + + /** + * @brief document 에서 사용된 tag 가져오기 + **/ + function getDocumentsTagList($obj){ + if(is_array($obj->document_srl)) $args->document_srl = implode(',', $obj->document_srl); + else $args->document_srl = $obj->document_srl; + + $output = executeQueryArray('tag.getDocumentsTagList', $args); + if(!$output->toBool()) return $output; + + return $output; + } + + /** + * @brief 특정tag과 함께 사용된 tag목록 + **/ + function getTagWithUsedList($obj){ + if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + + $args->tag = $obj->tag; + $output = $this->getDocumentSrlByTag($args); + $document_srl = array(); + + if($output->data){ + foreach($output->data as $k => $v) $document_srl[] = $v->document_srl; + } + unset($args); + $args->document_srl = $document_srl; + $output = $this->getDocumentsTagList($args); + return $output; + } + } +?> diff --git a/modules/trackback/conf/info.xml b/modules/trackback/conf/info.xml index ed8730efe..bce9023b3 100644 --- a/modules/trackback/conf/info.xml +++ b/modules/trackback/conf/info.xml @@ -1,37 +1,37 @@ - - - 엮인글 - 引用管理 - トラックバック - Trackback - Liên kết Web - Trackback - Трекбек - 引用 - Geri izleme - 엮인글 관리 모듈 - 管理引用模块。 - トラックバック管理モジュール - Module dành cho quản lý liên kết Web. - Module for managing trackbacks. - Módulo para el manejo de trackbacks. - Модуль для управления трекбеками. - 管理引用的模組。 - Module for managing trackbacks. - Geri izlemeleri yönetme modülü. - 0.1 - 2007-02-28 - content - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 엮인글 + 引用管理 + トラックバック + Trackback + Liên kết Web + Trackback + Трекбек + 引用 + Geri izleme + 엮인글 관리 모듈 + 管理引用模块。 + トラックバック管理モジュール + Module dành cho quản lý liên kết Web. + Module for managing trackbacks. + Módulo para el manejo de trackbacks. + Модуль для управления трекбеками. + 管理引用的模組。 + Module for managing trackbacks. + Geri izlemeleri yönetme modülü. + 0.1 + 2007-02-28 + content + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/trackback/lang/en.lang.php b/modules/trackback/lang/en.lang.php index 22531aad0..00970b903 100644 --- a/modules/trackback/lang/en.lang.php +++ b/modules/trackback/lang/en.lang.php @@ -1,29 +1,29 @@ -cmd_toggle_checked_trackback = 'Reverse selected trackback(s)'; - $lang->cmd_delete_checked_trackback = 'Delete selected trackback(s)'; - - $lang->msg_cart_is_null = 'Please select a trackback to be deleted.'; - $lang->msg_checked_trackback_is_deleted = '%d trackback(s) deleted.'; - - $lang->send_trackback_url = 'Destination URL'; - $lang->msg_trackback_url_is_invalid = 'Destination URL is invalid'; - $lang->msg_trackback_send_success = 'Sent successfully'; - $lang->msg_trackback_send_failed = 'Failed to send'; - - $lang->search_target_list = array( - 'url' => 'Target URL', - 'blog_name' => 'Target Site Name', - 'title' => 'Title', - 'excerpt' => 'Excerpt', - 'regdate' => 'Posted Date', - 'ipaddress' => 'IP Address', - ); - - $lang->enable_trackback = "Use Trackback"; - $lang->about_enable_trackback = "When the check is disabled, all trackback collection in the site will be stopped"; -?> +cmd_toggle_checked_trackback = 'Reverse selected trackback(s)'; + $lang->cmd_delete_checked_trackback = 'Delete selected trackback(s)'; + + $lang->msg_cart_is_null = 'Please select a trackback to be deleted.'; + $lang->msg_checked_trackback_is_deleted = '%d trackback(s) deleted.'; + + $lang->send_trackback_url = 'Destination URL'; + $lang->msg_trackback_url_is_invalid = 'Destination URL is invalid'; + $lang->msg_trackback_send_success = 'Sent successfully'; + $lang->msg_trackback_send_failed = 'Failed to send'; + + $lang->search_target_list = array( + 'url' => 'Target URL', + 'blog_name' => 'Target Site Name', + 'title' => 'Title', + 'excerpt' => 'Excerpt', + 'regdate' => 'Posted Date', + 'ipaddress' => 'IP Address', + ); + + $lang->enable_trackback = "Use Trackback"; + $lang->about_enable_trackback = "When the check is disabled, all trackback collection in the site will be stopped"; +?> diff --git a/modules/trackback/lang/es.lang.php b/modules/trackback/lang/es.lang.php index f4718305d..cf2b9b607 100644 --- a/modules/trackback/lang/es.lang.php +++ b/modules/trackback/lang/es.lang.php @@ -1,30 +1,30 @@ -cmd_toggle_checked_trackback = 'Reverse selected trackback(s)'; - $lang->cmd_delete_checked_trackback = 'Trackback(s) es eliminado'; - - $lang->msg_cart_is_null = 'Seleccione un trackback para ser eliminado.'; - $lang->msg_checked_trackback_is_deleted = '%d trackback(s) eliminado.'; - - $lang->send_trackback_url = 'Destination URL'; - $lang->msg_trackback_url_is_invalid = 'Destination URL is invalid'; - $lang->msg_trackback_send_success = 'Sent successfully'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => 'URL objetivo', - 'blog_name' => 'Ojetivo del nombre de sitio', - 'title' => 'Título', - 'excerpt' => 'Contenido', - 'regdate' => 'Fecha del posteo', - 'ipaddress' => 'Dirección IP', - ); - - $lang->enable_trackback = "Usar trackback"; - $lang->about_enable_trackback = "Si no selecciona esta opción, desactiva la inscripción de trackback en todos los documentos del sitio"; -?> +cmd_toggle_checked_trackback = 'Reverse selected trackback(s)'; + $lang->cmd_delete_checked_trackback = 'Trackback(s) es eliminado'; + + $lang->msg_cart_is_null = 'Seleccione un trackback para ser eliminado.'; + $lang->msg_checked_trackback_is_deleted = '%d trackback(s) eliminado.'; + + $lang->send_trackback_url = 'Destination URL'; + $lang->msg_trackback_url_is_invalid = 'Destination URL is invalid'; + $lang->msg_trackback_send_success = 'Sent successfully'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => 'URL objetivo', + 'blog_name' => 'Ojetivo del nombre de sitio', + 'title' => 'Título', + 'excerpt' => 'Contenido', + 'regdate' => 'Fecha del posteo', + 'ipaddress' => 'Dirección IP', + ); + + $lang->enable_trackback = "Usar trackback"; + $lang->about_enable_trackback = "Si no selecciona esta opción, desactiva la inscripción de trackback en todos los documentos del sitio"; +?> diff --git a/modules/trackback/lang/fr.lang.php b/modules/trackback/lang/fr.lang.php index eff2e0417..d454c0097 100644 --- a/modules/trackback/lang/fr.lang.php +++ b/modules/trackback/lang/fr.lang.php @@ -1,29 +1,29 @@ - - * @brief Paquet du langage en français pour le module de Rétrolien - **/ - $lang->cmd_toggle_checked_trackback = 'Renverser les rétroliens choisis'; - $lang->cmd_delete_checked_trackback = 'Supprimer les rétroliens choisis'; - - $lang->msg_cart_is_null = 'Choisissez un rétrolien à supprimer, S.V.P.'; - $lang->msg_checked_trackback_is_deleted = '%d rétrolien(s) est(sont) supprimé(s).'; - - $lang->send_trackback_url = 'URL de Destination'; - $lang->msg_trackback_url_is_invalid = 'URL de Destination est invalide'; - $lang->msg_trackback_send_success = 'Envoyé avec succès'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => 'URL objectif', - 'blog_name' => 'Nom du Site objectif', - 'title' => 'Titre', - 'excerpt' => 'Contenu', - 'regdate' => 'Jour', - 'ipaddress' => 'Adresse IP', - ); - - $lang->enable_trackback = "Utiliser le Rétrolien"; - $lang->about_enable_trackback = "Si vous annulez la coché, on arrêtera de ramasser les rétroliens de tous les articles du site"; -?> + + * @brief Paquet du langage en français pour le module de Rétrolien + **/ + $lang->cmd_toggle_checked_trackback = 'Renverser les rétroliens choisis'; + $lang->cmd_delete_checked_trackback = 'Supprimer les rétroliens choisis'; + + $lang->msg_cart_is_null = 'Choisissez un rétrolien à supprimer, S.V.P.'; + $lang->msg_checked_trackback_is_deleted = '%d rétrolien(s) est(sont) supprimé(s).'; + + $lang->send_trackback_url = 'URL de Destination'; + $lang->msg_trackback_url_is_invalid = 'URL de Destination est invalide'; + $lang->msg_trackback_send_success = 'Envoyé avec succès'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => 'URL objectif', + 'blog_name' => 'Nom du Site objectif', + 'title' => 'Titre', + 'excerpt' => 'Contenu', + 'regdate' => 'Jour', + 'ipaddress' => 'Adresse IP', + ); + + $lang->enable_trackback = "Utiliser le Rétrolien"; + $lang->about_enable_trackback = "Si vous annulez la coché, on arrêtera de ramasser les rétroliens de tous les articles du site"; +?> diff --git a/modules/trackback/lang/jp.lang.php b/modules/trackback/lang/jp.lang.php index df98d91fd..52564a3f5 100644 --- a/modules/trackback/lang/jp.lang.php +++ b/modules/trackback/lang/jp.lang.php @@ -1,29 +1,29 @@ -cmd_toggle_checked_trackback = '選択トラックバック反転'; - $lang->cmd_delete_checked_trackback = '選択トラックバック削除'; - - $lang->msg_cart_is_null = '削除する書き込みを選択して下さい。'; - $lang->msg_checked_trackback_is_deleted = '%d個のトラックバックが削除されました。'; - - $lang->send_trackback_url = '送信するURL'; - $lang->msg_trackback_url_is_invalid = 'トラックバックのurlが正しくありません。'; - $lang->msg_trackback_send_success = 'トラックバックの送信が成功しました。'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => 'URL', - 'blog_name' => 'サイト(ブログ)名', - 'title' => 'タイトル', - 'excerpt' => '要約内容', - 'regdate' => '登録日', - 'ipaddress' => 'IPアドレス', - ); - - $lang->enable_trackback = 'トラックバックを可能にする'; - $lang->about_enable_trackback = 'チェックを外すと、すべてのコンテンツに対し、トラックバックの受信を中止します。'; -?> +cmd_toggle_checked_trackback = '選択トラックバック反転'; + $lang->cmd_delete_checked_trackback = '選択トラックバック削除'; + + $lang->msg_cart_is_null = '削除する書き込みを選択して下さい。'; + $lang->msg_checked_trackback_is_deleted = '%d個のトラックバックが削除されました。'; + + $lang->send_trackback_url = '送信するURL'; + $lang->msg_trackback_url_is_invalid = 'トラックバックのurlが正しくありません。'; + $lang->msg_trackback_send_success = 'トラックバックの送信が成功しました。'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => 'URL', + 'blog_name' => 'サイト(ブログ)名', + 'title' => 'タイトル', + 'excerpt' => '要約内容', + 'regdate' => '登録日', + 'ipaddress' => 'IPアドレス', + ); + + $lang->enable_trackback = 'トラックバックを可能にする'; + $lang->about_enable_trackback = 'チェックを外すと、すべてのコンテンツに対し、トラックバックの受信を中止します。'; +?> diff --git a/modules/trackback/lang/ko.lang.php b/modules/trackback/lang/ko.lang.php index 933426840..5c13b04e0 100644 --- a/modules/trackback/lang/ko.lang.php +++ b/modules/trackback/lang/ko.lang.php @@ -1,29 +1,29 @@ -cmd_toggle_checked_trackback = '선택항목 반전'; - $lang->cmd_delete_checked_trackback = '선택항목 삭제'; - - $lang->msg_cart_is_null = '삭제할 글을 선택해주세요.'; - $lang->msg_checked_trackback_is_deleted = '%d개의 엮인글이 삭제되었습니다.'; - - $lang->send_trackback_url = '발송할 주소'; - $lang->msg_trackback_url_is_invalid = '발송할 대상 url이 올바르지 않습니다.'; - $lang->msg_trackback_send_success = '엮인글 발송을 성공하였습니다.'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => '대상 URL', - 'blog_name' => '대상 사이트 이름', - 'title' => '제목', - 'excerpt' => '내용', - 'regdate' => '등록일', - 'ipaddress' => 'IP 주소', - ); - - $lang->enable_trackback = '엮인글 사용'; - $lang->about_enable_trackback = '체크를 해제하시면 사이트 내에 모든 글의 엮인글 접수를 중지합니다.'; -?> +cmd_toggle_checked_trackback = '선택항목 반전'; + $lang->cmd_delete_checked_trackback = '선택항목 삭제'; + + $lang->msg_cart_is_null = '삭제할 글을 선택해주세요.'; + $lang->msg_checked_trackback_is_deleted = '%d개의 엮인글이 삭제되었습니다.'; + + $lang->send_trackback_url = '발송할 주소'; + $lang->msg_trackback_url_is_invalid = '발송할 대상 url이 올바르지 않습니다.'; + $lang->msg_trackback_send_success = '엮인글 발송을 성공하였습니다.'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => '대상 URL', + 'blog_name' => '대상 사이트 이름', + 'title' => '제목', + 'excerpt' => '내용', + 'regdate' => '등록일', + 'ipaddress' => 'IP 주소', + ); + + $lang->enable_trackback = '엮인글 사용'; + $lang->about_enable_trackback = '체크를 해제하시면 사이트 내에 모든 글의 엮인글 접수를 중지합니다.'; +?> diff --git a/modules/trackback/lang/ru.lang.php b/modules/trackback/lang/ru.lang.php index 6f6270563..e4420dbb1 100644 --- a/modules/trackback/lang/ru.lang.php +++ b/modules/trackback/lang/ru.lang.php @@ -1,30 +1,30 @@ -cmd_toggle_checked_trackback = 'Reverse selected trackback(s)'; - $lang->cmd_delete_checked_trackback = 'Удалить выбранные трекбеки'; - - $lang->msg_cart_is_null = 'Пожалуйста, выберите трекбек для удаления.'; - $lang->msg_checked_trackback_is_deleted = '%d трекбеков удалено.'; - - $lang->send_trackback_url = 'Destination URL'; - $lang->msg_trackback_url_is_invalid = 'Destination URL is invalid'; - $lang->msg_trackback_send_success = 'Sent successfully'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => 'URL назначения', - 'blog_name' => 'Имя сайта', - 'title' => 'Заголовок', - 'excerpt' => 'Выдержка', - 'regdate' => 'Дата отправки', - 'ipaddress' => 'IP-адрес', - ); - - $lang->enable_trackback = "Включить трекбек"; - $lang->about_enable_trackback = "Эта опция включает/выключает фукцию трекбека."; -?> +cmd_toggle_checked_trackback = 'Reverse selected trackback(s)'; + $lang->cmd_delete_checked_trackback = 'Удалить выбранные трекбеки'; + + $lang->msg_cart_is_null = 'Пожалуйста, выберите трекбек для удаления.'; + $lang->msg_checked_trackback_is_deleted = '%d трекбеков удалено.'; + + $lang->send_trackback_url = 'Destination URL'; + $lang->msg_trackback_url_is_invalid = 'Destination URL is invalid'; + $lang->msg_trackback_send_success = 'Sent successfully'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => 'URL назначения', + 'blog_name' => 'Имя сайта', + 'title' => 'Заголовок', + 'excerpt' => 'Выдержка', + 'regdate' => 'Дата отправки', + 'ipaddress' => 'IP-адрес', + ); + + $lang->enable_trackback = "Включить трекбек"; + $lang->about_enable_trackback = "Эта опция включает/выключает фукцию трекбека."; +?> diff --git a/modules/trackback/lang/tr.lang.php b/modules/trackback/lang/tr.lang.php index 4b0432ffa..2c8978845 100644 --- a/modules/trackback/lang/tr.lang.php +++ b/modules/trackback/lang/tr.lang.php @@ -1,29 +1,29 @@ -cmd_toggle_checked_trackback = 'Seçili geri izlemeleri iptal et'; - $lang->cmd_delete_checked_trackback = 'Seçili geri izlemeleri sil'; - - $lang->msg_cart_is_null = 'Lütfen silinecek geri izlemeyi seçin.'; - $lang->msg_checked_trackback_is_deleted = '%d geri izlemeleri silindi.'; - - $lang->send_trackback_url = 'Hedef URL'; - $lang->msg_trackback_url_is_invalid = 'Hedef URL geçersiz.'; - $lang->msg_trackback_send_success = 'Başarıyla gönderildi'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => 'Hedef URL', - 'blog_name' => 'Hedef Site Adı', - 'title' => 'Başlık', - 'excerpt' => 'Alıntı', - 'regdate' => 'Gönderilme Tarihi', - 'ipaddress' => 'IP Adresi', - ); - - $lang->enable_trackback = "Geri izleme kullan."; - $lang->about_enable_trackback = "Geri izleme devredışı bırakıldığında, sitedeki tüm geri izleme (trackback) koleksiyonları durdurulacaktır."; -?> +cmd_toggle_checked_trackback = 'Seçili geri izlemeleri iptal et'; + $lang->cmd_delete_checked_trackback = 'Seçili geri izlemeleri sil'; + + $lang->msg_cart_is_null = 'Lütfen silinecek geri izlemeyi seçin.'; + $lang->msg_checked_trackback_is_deleted = '%d geri izlemeleri silindi.'; + + $lang->send_trackback_url = 'Hedef URL'; + $lang->msg_trackback_url_is_invalid = 'Hedef URL geçersiz.'; + $lang->msg_trackback_send_success = 'Başarıyla gönderildi'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => 'Hedef URL', + 'blog_name' => 'Hedef Site Adı', + 'title' => 'Başlık', + 'excerpt' => 'Alıntı', + 'regdate' => 'Gönderilme Tarihi', + 'ipaddress' => 'IP Adresi', + ); + + $lang->enable_trackback = "Geri izleme kullan."; + $lang->about_enable_trackback = "Geri izleme devredışı bırakıldığında, sitedeki tüm geri izleme (trackback) koleksiyonları durdurulacaktır."; +?> diff --git a/modules/trackback/lang/vi.lang.php b/modules/trackback/lang/vi.lang.php index ce02ac7f6..b08583c86 100644 --- a/modules/trackback/lang/vi.lang.php +++ b/modules/trackback/lang/vi.lang.php @@ -1,32 +1,32 @@ -cmd_toggle_checked_trackback = 'Nhận liên kết Web đã chọn'; - $lang->cmd_delete_checked_trackback = 'Xóa liên kết Web đã chọn'; - - $lang->msg_cart_is_null = 'Xin hãy chọn liên kết Web muốn xóa.'; - $lang->msg_checked_trackback_is_deleted = '%d đã được xóa.'; - - $lang->send_trackback_url = 'Địa chỉ muốn gửi'; - $lang->msg_trackback_url_is_invalid = 'Địa chỉ muốn gửi không hợp lệ'; - $lang->msg_trackback_send_success = 'Đã gửi thành công.'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => 'URL muốn gửi', - 'blog_name' => 'Tên Website muốn gửi', - 'title' => 'Tiêu đề', - 'excerpt' => 'Trích đoạn', - 'regdate' => 'Ngày gửi', - 'ipaddress' => 'IP', - ); - - $lang->enable_trackback = "Sử dụng liên kết Web"; - $lang->about_enable_trackback = "Khi chọn là tắt chức năng này, mọi liên kết Web trên Website sẽ ngừng hoạt động."; -?> +cmd_toggle_checked_trackback = 'Nhận liên kết Web đã chọn'; + $lang->cmd_delete_checked_trackback = 'Xóa liên kết Web đã chọn'; + + $lang->msg_cart_is_null = 'Xin hãy chọn liên kết Web muốn xóa.'; + $lang->msg_checked_trackback_is_deleted = '%d đã được xóa.'; + + $lang->send_trackback_url = 'Địa chỉ muốn gửi'; + $lang->msg_trackback_url_is_invalid = 'Địa chỉ muốn gửi không hợp lệ'; + $lang->msg_trackback_send_success = 'Đã gửi thành công.'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => 'URL muốn gửi', + 'blog_name' => 'Tên Website muốn gửi', + 'title' => 'Tiêu đề', + 'excerpt' => 'Trích đoạn', + 'regdate' => 'Ngày gửi', + 'ipaddress' => 'IP', + ); + + $lang->enable_trackback = "Sử dụng liên kết Web"; + $lang->about_enable_trackback = "Khi chọn là tắt chức năng này, mọi liên kết Web trên Website sẽ ngừng hoạt động."; +?> diff --git a/modules/trackback/lang/zh-CN.lang.php b/modules/trackback/lang/zh-CN.lang.php index 302d89a82..de4ed3399 100644 --- a/modules/trackback/lang/zh-CN.lang.php +++ b/modules/trackback/lang/zh-CN.lang.php @@ -1,29 +1,29 @@ -cmd_toggle_checked_trackback = '反选'; - $lang->cmd_delete_checked_trackback = '删除所选'; - - $lang->msg_cart_is_null = '请选择要删除的文章'; - $lang->msg_checked_trackback_is_deleted = '已删除%d个引用'; - - $lang->send_trackback_url = '发送地址'; - $lang->msg_trackback_url_is_invalid = '错误的发送地址!'; - $lang->msg_trackback_send_success = '成功发送引用。'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => '对象URL', - 'blog_name' => '对象网站名称', - 'title' => '标题', - 'excerpt' => '内容', - 'regdate' => '登录日期', - 'ipaddress' => 'IP地址', - ); - - $lang->enable_trackback = "使用引用"; - $lang->about_enable_trackback = "取消此项勾选将对网站内的所有主题禁止接收引用。"; -?> +cmd_toggle_checked_trackback = '反选'; + $lang->cmd_delete_checked_trackback = '删除所选'; + + $lang->msg_cart_is_null = '请选择要删除的文章'; + $lang->msg_checked_trackback_is_deleted = '已删除%d个引用'; + + $lang->send_trackback_url = '发送地址'; + $lang->msg_trackback_url_is_invalid = '错误的发送地址!'; + $lang->msg_trackback_send_success = '成功发送引用。'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => '对象URL', + 'blog_name' => '对象网站名称', + 'title' => '标题', + 'excerpt' => '内容', + 'regdate' => '登录日期', + 'ipaddress' => 'IP地址', + ); + + $lang->enable_trackback = "使用引用"; + $lang->about_enable_trackback = "取消此项勾选将对网站内的所有主题禁止接收引用。"; +?> diff --git a/modules/trackback/lang/zh-TW.lang.php b/modules/trackback/lang/zh-TW.lang.php index 017466bba..a54a7a78e 100644 --- a/modules/trackback/lang/zh-TW.lang.php +++ b/modules/trackback/lang/zh-TW.lang.php @@ -1,29 +1,29 @@ -cmd_toggle_checked_trackback = '反選'; - $lang->cmd_delete_checked_trackback = '刪除所選'; - - $lang->msg_cart_is_null = '請選擇要刪除的文章'; - $lang->msg_checked_trackback_is_deleted = '已刪除%d個引用'; - - $lang->send_trackback_url = '發送網址'; - $lang->msg_trackback_url_is_invalid = '發送錯誤!'; - $lang->msg_trackback_send_success = '成功發送。'; - $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; - - $lang->search_target_list = array( - 'url' => '目標網址', - 'blog_name' => '目標網站名稱', - 'title' => '標題', - 'excerpt' => '內容', - 'regdate' => '登錄日期', - 'ipaddress' => 'IP位址', - ); - - $lang->enable_trackback = "使用引用"; - $lang->about_enable_trackback = "不選取的話,將會使網站內所有的主題都禁止接收引用。"; -?> +cmd_toggle_checked_trackback = '反選'; + $lang->cmd_delete_checked_trackback = '刪除所選'; + + $lang->msg_cart_is_null = '請選擇要刪除的文章'; + $lang->msg_checked_trackback_is_deleted = '已刪除%d個引用'; + + $lang->send_trackback_url = '發送網址'; + $lang->msg_trackback_url_is_invalid = '發送錯誤!'; + $lang->msg_trackback_send_success = '成功發送。'; + $lang->msg_trackback_send_failed = '엮인글 발송을 실패하였습니다.'; + + $lang->search_target_list = array( + 'url' => '目標網址', + 'blog_name' => '目標網站名稱', + 'title' => '標題', + 'excerpt' => '內容', + 'regdate' => '登錄日期', + 'ipaddress' => 'IP位址', + ); + + $lang->enable_trackback = "使用引用"; + $lang->about_enable_trackback = "不選取的話,將會使網站內所有的主題都禁止接收引用。"; +?> diff --git a/modules/trackback/tpl/trackback_list.html b/modules/trackback/tpl/trackback_list.html index 5e5bb4f7c..df372e007 100644 --- a/modules/trackback/tpl/trackback_list.html +++ b/modules/trackback/tpl/trackback_list.html @@ -1,100 +1,100 @@ - - - - -

    {$lang->trackback} {$lang->cmd_management}

    - -
    - - - - - - - - - - -
    {$lang->enable_trackback}
    - enable_trackback=='Y')-->checked="checked"/> {$lang->cmd_use} -

    {$lang->about_enable_trackback}

    -
    -
    - - -
    -
    - - - - -
    - - - - {$lang->cmd_cancel} -
    -
    -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->blog_name}
    {$lang->title}
    {$lang->date}
    {$lang->ipaddress}
    {$no}{htmlspecialchars($val->title)}{zdate($val->regdate,"Y-m-d")}{$val->ipaddress}
    - {$val->excerpt} -
    -
    - - - - + + + + +

    {$lang->trackback} {$lang->cmd_management}

    + +
    + + + + + + + + + + +
    {$lang->enable_trackback}
    + enable_trackback=='Y')-->checked="checked"/> {$lang->cmd_use} +

    {$lang->about_enable_trackback}

    +
    +
    + + +
    +
    + + + + +
    + + + + {$lang->cmd_cancel} +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
    {$lang->no}
    {$lang->blog_name}
    {$lang->title}
    {$lang->date}
    {$lang->ipaddress}
    {$no}{htmlspecialchars($val->title)}{zdate($val->regdate,"Y-m-d")}{$val->ipaddress}
    + {$val->excerpt} +
    +
    + + + + diff --git a/modules/trackback/trackback.admin.controller.php b/modules/trackback/trackback.admin.controller.php index ef92c9e72..5d54c8416 100644 --- a/modules/trackback/trackback.admin.controller.php +++ b/modules/trackback/trackback.admin.controller.php @@ -1,98 +1,98 @@ -stop('msg_cart_is_null'); - $trackback_srl_list= explode('|@|', $cart); - $trackback_count = count($trackback_srl_list); - if(!$trackback_count) return $this->stop('msg_cart_is_null'); - - $oTrackbackController = &getController('trackback'); - - // 글삭제 - for($i=0;$i<$trackback_count;$i++) { - $trackback_srl = trim($trackback_srl_list[$i]); - if(!$trackback_srl) continue; - - $oTrackbackController->deleteTrackback($trackback_srl, true); - } - - $this->setMessage( sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count) ); - } - - /** - * @brief 설정 저장 - **/ - function procTrackbackAdminInsertConfig() { - $config->enable_trackback = Context::get('enable_trackback'); - if($config->enable_trackback != 'Y') $config->enable_trackback = 'N'; - - $oModuleController = &getController('module'); - $output = $oModuleController->insertModuleConfig('trackback',$config); - return $output; - } - - /** - * @brief Trackback 모듈별 설정 - **/ - function procTrackbackAdminInsertModuleConfig() { - // 필요한 변수를 받아옴 - $module_srl = Context::get('target_module_srl'); - if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); - else $module_srl = array($module_srl); - - $enable_trackback = Context::get('enable_trackback'); - if(!in_array($enable_trackback, array('Y','N'))) $enable_trackback = 'N'; - - if(!$module_srl || !$enable_trackback) return new Object(-1, 'msg_invalid_request'); - - for($i=0;$isetTrackbackModuleConfig($srl, $enable_trackback); - } - - $this->setError(-1); - $this->setMessage('success_updated'); - } - - /** - * @brief Trackback 모듈별 설정 함수 - **/ - function setTrackbackModuleConfig($module_srl, $enable_trackback) { - $config->enable_trackback = $enable_trackback; - - $oModuleController = &getController('module'); - $oModuleController->insertModulePartConfig('trackback', $module_srl, $config); - return new Object(); - } - - /** - * @brief 모듈에 속한 모든 트랙백 삭제 - **/ - function deleteModuleTrackbacks($module_srl) { - // 삭제 - $args->module_srl = $module_srl; - $output = executeQuery('trackback.deleteModuleTrackbacks', $args); - - return $output; - } - } -?> +stop('msg_cart_is_null'); + $trackback_srl_list= explode('|@|', $cart); + $trackback_count = count($trackback_srl_list); + if(!$trackback_count) return $this->stop('msg_cart_is_null'); + + $oTrackbackController = &getController('trackback'); + + // 글삭제 + for($i=0;$i<$trackback_count;$i++) { + $trackback_srl = trim($trackback_srl_list[$i]); + if(!$trackback_srl) continue; + + $oTrackbackController->deleteTrackback($trackback_srl, true); + } + + $this->setMessage( sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count) ); + } + + /** + * @brief 설정 저장 + **/ + function procTrackbackAdminInsertConfig() { + $config->enable_trackback = Context::get('enable_trackback'); + if($config->enable_trackback != 'Y') $config->enable_trackback = 'N'; + + $oModuleController = &getController('module'); + $output = $oModuleController->insertModuleConfig('trackback',$config); + return $output; + } + + /** + * @brief Trackback 모듈별 설정 + **/ + function procTrackbackAdminInsertModuleConfig() { + // 필요한 변수를 받아옴 + $module_srl = Context::get('target_module_srl'); + if(preg_match('/^([0-9,]+)$/',$module_srl)) $module_srl = explode(',',$module_srl); + else $module_srl = array($module_srl); + + $enable_trackback = Context::get('enable_trackback'); + if(!in_array($enable_trackback, array('Y','N'))) $enable_trackback = 'N'; + + if(!$module_srl || !$enable_trackback) return new Object(-1, 'msg_invalid_request'); + + for($i=0;$isetTrackbackModuleConfig($srl, $enable_trackback); + } + + $this->setError(-1); + $this->setMessage('success_updated'); + } + + /** + * @brief Trackback 모듈별 설정 함수 + **/ + function setTrackbackModuleConfig($module_srl, $enable_trackback) { + $config->enable_trackback = $enable_trackback; + + $oModuleController = &getController('module'); + $oModuleController->insertModulePartConfig('trackback', $module_srl, $config); + return new Object(); + } + + /** + * @brief 모듈에 속한 모든 트랙백 삭제 + **/ + function deleteModuleTrackbacks($module_srl) { + // 삭제 + $args->module_srl = $module_srl; + $output = executeQuery('trackback.deleteModuleTrackbacks', $args); + + return $output; + } + } +?> diff --git a/modules/trackback/trackback.admin.model.php b/modules/trackback/trackback.admin.model.php index 820d78b84..2364402f1 100644 --- a/modules/trackback/trackback.admin.model.php +++ b/modules/trackback/trackback.admin.model.php @@ -1,68 +1,68 @@ -search_target?$obj->search_target:trim(Context::get('search_target')); - $search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword')); - - if($search_target && $search_keyword) { - switch($search_target) { - case 'url' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_url = $search_keyword; - break; - case 'title' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_title= $search_keyword; - break; - case 'blog_name' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_blog_name= $search_keyword; - break; - case 'excerpt' : - if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); - $args->s_excerpt = $search_keyword; - break; - case 'regdate' : - $args->s_regdate = $search_keyword; - break; - case 'ipaddress' : - $args->s_ipaddress= $search_keyword; - break; - } - } - - // 변수 설정 - $args->sort_index = $obj->sort_index; - $args->page = $obj->page?$obj->page:1; - $args->list_count = $obj->list_count?$obj->list_count:20; - $args->page_count = $obj->page_count?$obj->page_count:10; - $args->s_module_srl = $obj->module_srl; - $args->exclude_module_srl = $obj->exclude_module_srl; - - // trackback.getTotalTrackbackList 쿼리 실행 - $output = executeQuery('trackback.getTotalTrackbackList', $args); - - // 결과가 없거나 오류 발생시 그냥 return - if(!$output->toBool()||!count($output->data)) return $output; - - return $output; - } - } -?> +search_target?$obj->search_target:trim(Context::get('search_target')); + $search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword')); + + if($search_target && $search_keyword) { + switch($search_target) { + case 'url' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_url = $search_keyword; + break; + case 'title' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_title= $search_keyword; + break; + case 'blog_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_blog_name= $search_keyword; + break; + case 'excerpt' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_excerpt = $search_keyword; + break; + case 'regdate' : + $args->s_regdate = $search_keyword; + break; + case 'ipaddress' : + $args->s_ipaddress= $search_keyword; + break; + } + } + + // 변수 설정 + $args->sort_index = $obj->sort_index; + $args->page = $obj->page?$obj->page:1; + $args->list_count = $obj->list_count?$obj->list_count:20; + $args->page_count = $obj->page_count?$obj->page_count:10; + $args->s_module_srl = $obj->module_srl; + $args->exclude_module_srl = $obj->exclude_module_srl; + + // trackback.getTotalTrackbackList 쿼리 실행 + $output = executeQuery('trackback.getTotalTrackbackList', $args); + + // 결과가 없거나 오류 발생시 그냥 return + if(!$output->toBool()||!count($output->data)) return $output; + + return $output; + } + } +?> diff --git a/modules/trackback/trackback.admin.view.php b/modules/trackback/trackback.admin.view.php index 3f45497f0..91d61199b 100644 --- a/modules/trackback/trackback.admin.view.php +++ b/modules/trackback/trackback.admin.view.php @@ -1,50 +1,50 @@ -getModuleConfig('trackback'); - Context::set('config',$config); - - // 목록을 구하기 위한 옵션 - $args->page = Context::get('page'); ///< 페이지 - $args->list_count = 30; ///< 한페이지에 보여줄 글 수 - $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 - - $args->sort_index = 'list_order'; ///< 소팅 값 - $args->module_srl = Context::get('module_srl'); - - // 목록 구함 - $oTrackbackAdminModel = &getAdminModel('trackback'); - $output = $oTrackbackAdminModel->getTotalTrackbackList($args); - - // 템플릿에 쓰기 위해서 변수 설정 - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('trackback_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - // 템플릿 지정 - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('trackback_list'); - } - - } -?> +getModuleConfig('trackback'); + Context::set('config',$config); + + // 목록을 구하기 위한 옵션 + $args->page = Context::get('page'); ///< 페이지 + $args->list_count = 30; ///< 한페이지에 보여줄 글 수 + $args->page_count = 10; ///< 페이지 네비게이션에 나타날 페이지의 수 + + $args->sort_index = 'list_order'; ///< 소팅 값 + $args->module_srl = Context::get('module_srl'); + + // 목록 구함 + $oTrackbackAdminModel = &getAdminModel('trackback'); + $output = $oTrackbackAdminModel->getTotalTrackbackList($args); + + // 템플릿에 쓰기 위해서 변수 설정 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('trackback_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + // 템플릿 지정 + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('trackback_list'); + } + + } +?> diff --git a/modules/trackback/trackback.class.php b/modules/trackback/trackback.class.php index 2e4c72e05..43930f54b 100644 --- a/modules/trackback/trackback.class.php +++ b/modules/trackback/trackback.class.php @@ -1,87 +1,87 @@ -insertActionForward('trackback', 'controller', 'trackback'); - - // 2007. 10. 17 게시글이 삭제될때 엮인글도 삭제되도록 trigger 등록 - $oModuleController->insertTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after'); - - // 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가 - $oModuleController->insertTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after'); - - // 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가 - $oModuleController->insertTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after'); - - // 2007. 10. 19 모듈별 엮인글 받는 기능 추가 - $oModuleController->insertTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before'); - - return new Object(); - } - - /** - * @brief 설치가 이상이 없는지 체크하는 method - **/ - function checkUpdate() { - $oModuleModel = &getModel('module'); - - // 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록 - if(!$oModuleModel->getTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after')) return true; - - // 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가 - if(!$oModuleModel->getTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after')) return true; - - // 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가 - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after')) return true; - - // 2007. 10. 19 모듈별 엮인글 받는 기능 추가 - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before')) return true; - - return false; - } - - /** - * @brief 업데이트 실행 - **/ - function moduleUpdate() { - $oModuleModel = &getModel('module'); - $oModuleController = &getController('module'); - - // 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록 - if(!$oModuleModel->getTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after')) - $oModuleController->insertTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after'); - - // 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가 - if(!$oModuleModel->getTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after')) - $oModuleController->insertTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after'); - - // 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가 - if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after')) - $oModuleController->insertTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after'); - - // 2007. 10. 19 모듈별 엮인글 받는 기능 추가 - if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before')) - $oModuleController->insertTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before'); - - return new Object(0, 'success_updated'); - } - - /** - * @brief 캐시 파일 재생성 - **/ - function recompileCache() { - } - - } -?> +insertActionForward('trackback', 'controller', 'trackback'); + + // 2007. 10. 17 게시글이 삭제될때 엮인글도 삭제되도록 trigger 등록 + $oModuleController->insertTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after'); + + // 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가 + $oModuleController->insertTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after'); + + // 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가 + $oModuleController->insertTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after'); + + // 2007. 10. 19 모듈별 엮인글 받는 기능 추가 + $oModuleController->insertTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before'); + + return new Object(); + } + + /** + * @brief 설치가 이상이 없는지 체크하는 method + **/ + function checkUpdate() { + $oModuleModel = &getModel('module'); + + // 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록 + if(!$oModuleModel->getTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after')) return true; + + // 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가 + if(!$oModuleModel->getTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after')) return true; + + // 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가 + if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after')) return true; + + // 2007. 10. 19 모듈별 엮인글 받는 기능 추가 + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before')) return true; + + return false; + } + + /** + * @brief 업데이트 실행 + **/ + function moduleUpdate() { + $oModuleModel = &getModel('module'); + $oModuleController = &getController('module'); + + // 2007. 10. 17 게시글이 삭제될때 댓글도 삭제되도록 trigger 등록 + if(!$oModuleModel->getTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after')) + $oModuleController->insertTrigger('document.deleteDocument', 'trackback', 'controller', 'triggerDeleteDocumentTrackbacks', 'after'); + + // 2007. 10. 17 모듈이 삭제될때 등록된 엮인글도 모두 삭제하는 트리거 추가 + if(!$oModuleModel->getTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after')) + $oModuleController->insertTrigger('module.deleteModule', 'trackback', 'controller', 'triggerDeleteModuleTrackbacks', 'after'); + + // 2007. 10. 18 게시글 팝업메뉴에서 엮인글 발송 기능 추가 + if(!$oModuleModel->getTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after')) + $oModuleController->insertTrigger('document.getDocumentMenu', 'trackback', 'controller', 'triggerSendTrackback', 'after'); + + // 2007. 10. 19 모듈별 엮인글 받는 기능 추가 + if(!$oModuleModel->getTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before')) + $oModuleController->insertTrigger('module.dispAdditionSetup', 'trackback', 'view', 'triggerDispTrackbackAdditionSetup', 'before'); + + return new Object(0, 'success_updated'); + } + + /** + * @brief 캐시 파일 재생성 + **/ + function recompileCache() { + } + + } +?> diff --git a/modules/trackback/trackback.controller.php b/modules/trackback/trackback.controller.php index 814dbd24a..7f56971ca 100644 --- a/modules/trackback/trackback.controller.php +++ b/modules/trackback/trackback.controller.php @@ -1,334 +1,334 @@ -member_srl) return new Object(-1, 'msg_not_permitted'); - - // 게시물의 정보를 구해와서 있는지 여부와 권한을 체크 - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists()) return new Object(-1, 'msg_invalid_request'); - if($oDocument->getMemberSrl() != $logged_info->member_srl) return new Object(-1, 'msg_not_permitted'); - - // 현재 글이 있는 모듈의 타이틀 지정 - $oModuleModel = &getModel('module'); - $module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')); - Context::setBrowserTitle($module_info->browser_title); - - // 엮인글 발송 - return $this->sendTrackback($oDocument, $trackback_url, $charset); - } - - /** - * @brief 문서 팝업메뉴에서 엮인글을 발송하는 메뉴 추가 - **/ - function triggerSendTrackback(&$menu_list) { - $logged_info = Context::get('logged_info'); - if(!$logged_info->member_srl) return new Object(); - - // 요청된 게시물 번호와 현재 로그인 정보 구함 - $document_srl = Context::get('target_srl'); - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists()) return new Object(); - if($oDocument->getMemberSrl() != $logged_info->member_srl) return new Object(); - - // 엮인글 발송 링크 추가 - $oDocumentController = &getController('document'); - $url = getUrl('','module','trackback','act','dispTrackbackSend','document_srl', $document_srl); - $oDocumentController->addDocumentPopupMenu($url,'cmd_send_trackback','./modules/document/tpl/icons/send_trackback.gif','popup'); - - return new Object(); - } - - /** - * @brief document삭제시 해당 document의 엮인글을 삭제하는 trigger - **/ - function triggerDeleteDocumentTrackbacks(&$obj) { - $document_srl = $obj->document_srl; - if(!$document_srl) return new Object(); - - return $this->deleteTrackbacks($document_srl, true); - } - - /** - * @brief module 삭제시 해당 엮인글 모두 삭제하는 trigger - **/ - function triggerDeleteModuleTrackbacks(&$obj) { - $module_srl = $obj->module_srl; - if(!$module_srl) return new Object(); - - $oTrackbackController = &getAdminController('trackback'); - return $oTrackbackController->deleteModuleTrackbacks($module_srl); - } - - /** - * @brief 엮인글 입력 - **/ - function trackback() { - // 출력을 XMLRPC로 설정 - Context::setRequestMethod("XMLRPC"); - - // 엮인글 받을때 필요한 변수를 구함 - $obj = Context::gets('document_srl','blog_name','url','title','excerpt'); - if(!$obj->document_srl || !$obj->url || !$obj->title || !$obj->excerpt) return $this->stop('fail'); - - // 올바른 trackback url인지 검사 - $given_key = Context::get('key'); - $oTrackbackModel = &getModel('trackback'); - $key = $oTrackbackModel->getTrackbackKey($obj->document_srl); - if($key != $given_key) return $this->stop('fail'); - - // 엮인글 모듈의 기본 설정을 받음 - $module_srl = Context::get('module_srl'); - $oModuleModel = &getModel('module'); - $config = $oModuleModel->getModulePartConfig('trackback', $module_srl); - $enable_trackback = $config->enable_trackback; - if(!$enable_trackback) { - $config = $oModuleModel->getModuleConfig('trackback'); - $enable_trackback = $config->enable_trackback; - } - - // 관리자가 금지하였을 경우에는 엮인글을 받지 않음 - if($enable_trackback == 'N') return $this->stop('fail'); - - return $this->insertTrackback($obj); - } - - function insertTrackback($obj, $manual_inserted = false) { - // 엮인글 정리 - $obj = Context::convertEncoding($obj); - if(!$obj->blog_name) $obj->blog_name = $obj->title; - $obj->excerpt = strip_tags($obj->excerpt); - - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('trackback.insertTrackback', 'before', $obj); - if(!$output->toBool()) return $output; - - // GET으로 넘어온 document_srl을 참조, 없으면 오류~ - $document_srl = $obj->document_srl; - - if(!$manual_inserted) { - // document model 객체 생성후 원본글을 가져옴 - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - - // 원본글이 없거나 트랙백 허용을 하지 않으면 오류 표시 - if(!$oDocument->isExists()) return $this->stop('fail'); - if(!$oDocument->allowTrackback()) return new Object(-1,'fail'); - - $obj->module_srl = $oDocument->get('module_srl'); - } - - // 엮인글을 입력 - $obj->trackback_srl = getNextSequence(); - $obj->list_order = $obj->trackback_srl*-1; - $output = executeQuery('trackback.insertTrackback', $obj); - if(!$output->toBool()) return $output; - - // 입력에 이상이 없으면 해당 글의 엮인글 수를 올림 - if(!$manual_inserted) { - // trackback model 객체 생성 - $oTrackbackModel = &getModel('trackback'); - - // 해당 글의 전체 엮인글 수를 구해옴 - $trackback_count = $oTrackbackModel->getTrackbackCount($document_srl); - - // document controller 객체 생성 - $oDocumentController = &getController('document'); - - // 해당글의 엮인글 수를 업데이트 - $output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count); - - // 결과 return - if(!$output->toBool()) return $output; - } - - // 원본글에 알림(notify_message)가 설정되어 있으면 메세지 보냄 - if(!$manual_inserted) $oDocument->notify(Context::getLang('trackback'), $obj->excerpt); - - // trigger 호출 (after) - $output = ModuleHandler::triggerCall('trackback.insertTrackback', 'after', $obj); - if(!$output->toBool()) return $output; - - return new Object(); - } - - /** - * @brief 단일 엮인글 삭제 - **/ - function deleteTrackback($trackback_srl, $is_admin = false) { - // trackback model 객체 생성 - $oTrackbackModel = &getModel('trackback'); - - // 삭제하려는 엮인글이 있는지 확인 - $trackback = $oTrackbackModel->getTrackback($trackback_srl); - if($trackback->data->trackback_srl != $trackback_srl) return new Object(-1, 'msg_invalid_request'); - $document_srl = $trackback->data->document_srl; - - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'before', $trackback); - if(!$output->toBool()) return $output; - - // document model 객체 생성 - $oDocumentModel = &getModel('document'); - - // 권한이 있는지 확인 - if(!$is_admin && !$oDocumentModel->isGranted($document_srl)) return new Object(-1, 'msg_not_permitted'); - - $args->trackback_srl = $trackback_srl; - $output = executeQuery('trackback.deleteTrackback', $args); - if(!$output->toBool()) return new Object(-1, 'msg_error_occured'); - - // 엮인글 수를 구해서 업데이트 - $trackback_count = $oTrackbackModel->getTrackbackCount($document_srl); - - // document controller 객체 생성 - $oDocumentController = &getController('document','controller'); - - // 해당글의 엮인글 수를 업데이트 - $output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count); - $output->add('document_srl', $document_srl); - - // trigger 호출 (before) - $output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'after', $trackback); - if(!$output->toBool()) return $output; - - return $output; - } - - /** - * @brief 글에 속한 모든 트랙백 삭제 - **/ - function deleteTrackbacks($document_srl) { - // 삭제 - $args->document_srl = $document_srl; - $output = executeQuery('trackback.deleteTrackbacks', $args); - - return $output; - } - - /** - * @brief 엮인글을 발송 - * - * 발송 후 결과처리는 하지 않는 구조임 - **/ - function sendTrackback($oDocument, $trackback_url, $charset) { - $oModuleController = &getController('module'); - - // 발송할 정보를 정리 - $http = parse_url($trackback_url); - $obj->blog_name = str_replace(array('<','>','&','"'), array('<','>','&','"'), Context::getBrowserTitle()); - $oModuleController->replaceDefinedLangCode($obj->blog_name); - $obj->title = $oDocument->getTitleText(); - $obj->excerpt = $oDocument->getSummary(200); - $obj->url = getFullUrl('','document_srl',$oDocument->document_srl); - - // blog_name, title, excerpt, url의 문자열을 요청된 charset으로 변경 - if($charset && function_exists('iconv')) { - foreach($obj as $key=>$val) { - $obj->{$key} = iconv('UTF-8',$charset,$val); - } - } - - // socket으로 발송할 내용 작성 - if($http['query']) $http['query'].="&"; - if(!$http['port']) $http['port'] = 80; - - $content = - sprintf( - "title=%s&". - "url=%s&". - "blog_name=%s&". - "excerpt=%s", - urlencode($obj->title), - urlencode($obj->url), - urlencode($obj->blog_name), - urlencode($obj->excerpt) - ); - if($http['query']) $content .= '&'.$http['query']; - $content_length = strlen($content); - - // header 정리 - $header = - sprintf( - "POST %s HTTP/1.1\r\n". - "Host: %s\r\n". - "Content-Type: %s\r\n". - "Content-Length: %s\r\n\r\n". - "%s\r\n", - $http['path'], - $http['host'], - "application/x-www-form-urlencoded", - $content_length, - $content - ); - if(!$http['host']||!$http['port']) return new Object(-1,'msg_trackback_url_is_invalid'); - - // 발송하려는 대상 서버의 socket을 연다 - $fp = @fsockopen($http['host'], $http['port'], $errno, $errstr, 5); - if(!$fp) return new Object(-1,'msg_trackback_url_is_invalid'); - - // 작성한 헤더 정보를 발송 - fputs($fp, $header); - - // 결과를 기다림 (특정 서버의 경우 EOF가 떨어지지 않을 수가 있음 - while(!feof($fp)) { - $line = trim(fgets($fp, 4096)); - if(preg_match("/^/i",$line)){ - $error = preg_replace('/[^0-9]/','',$line); - break; - } - } - - // socket 닫음 - fclose($fp); - - if($error == "0") return new Object(0, 'msg_trackback_send_success'); - - return new Object(-1, 'msg_trackback_send_failed'); - } - - /** - * @brief 특정 ipaddress의 특정 시간대 내의 엮인글을 모두 삭제 - **/ - function deleteTrackbackSender($time, $ipaddress, $url, $blog_name, $title, $excerpt) { - $obj->regdate = date("YmdHis",time()-$time); - $obj->ipaddress = $ipaddress; - $obj->url = $url; - $obj->blog_name = $blog_name; - $obj->title = $title; - $obj->excerpt = $excerpt; - $output = executeQueryArray('trackback.getRegistedTrackbacks', $obj); - if(!$output->data || !count($output->data)) return; - - foreach($output->data as $trackback) { - $trackback_srl = $trackback->trackback_srl; - $this->deleteTrackback($trackback_srl, true); - } - } - } -?> +member_srl) return new Object(-1, 'msg_not_permitted'); + + // 게시물의 정보를 구해와서 있는지 여부와 권한을 체크 + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + if(!$oDocument->isExists()) return new Object(-1, 'msg_invalid_request'); + if($oDocument->getMemberSrl() != $logged_info->member_srl) return new Object(-1, 'msg_not_permitted'); + + // 현재 글이 있는 모듈의 타이틀 지정 + $oModuleModel = &getModel('module'); + $module_info = $oModuleModel->getModuleInfoByModuleSrl($oDocument->get('module_srl')); + Context::setBrowserTitle($module_info->browser_title); + + // 엮인글 발송 + return $this->sendTrackback($oDocument, $trackback_url, $charset); + } + + /** + * @brief 문서 팝업메뉴에서 엮인글을 발송하는 메뉴 추가 + **/ + function triggerSendTrackback(&$menu_list) { + $logged_info = Context::get('logged_info'); + if(!$logged_info->member_srl) return new Object(); + + // 요청된 게시물 번호와 현재 로그인 정보 구함 + $document_srl = Context::get('target_srl'); + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + if(!$oDocument->isExists()) return new Object(); + if($oDocument->getMemberSrl() != $logged_info->member_srl) return new Object(); + + // 엮인글 발송 링크 추가 + $oDocumentController = &getController('document'); + $url = getUrl('','module','trackback','act','dispTrackbackSend','document_srl', $document_srl); + $oDocumentController->addDocumentPopupMenu($url,'cmd_send_trackback','./modules/document/tpl/icons/send_trackback.gif','popup'); + + return new Object(); + } + + /** + * @brief document삭제시 해당 document의 엮인글을 삭제하는 trigger + **/ + function triggerDeleteDocumentTrackbacks(&$obj) { + $document_srl = $obj->document_srl; + if(!$document_srl) return new Object(); + + return $this->deleteTrackbacks($document_srl, true); + } + + /** + * @brief module 삭제시 해당 엮인글 모두 삭제하는 trigger + **/ + function triggerDeleteModuleTrackbacks(&$obj) { + $module_srl = $obj->module_srl; + if(!$module_srl) return new Object(); + + $oTrackbackController = &getAdminController('trackback'); + return $oTrackbackController->deleteModuleTrackbacks($module_srl); + } + + /** + * @brief 엮인글 입력 + **/ + function trackback() { + // 출력을 XMLRPC로 설정 + Context::setRequestMethod("XMLRPC"); + + // 엮인글 받을때 필요한 변수를 구함 + $obj = Context::gets('document_srl','blog_name','url','title','excerpt'); + if(!$obj->document_srl || !$obj->url || !$obj->title || !$obj->excerpt) return $this->stop('fail'); + + // 올바른 trackback url인지 검사 + $given_key = Context::get('key'); + $oTrackbackModel = &getModel('trackback'); + $key = $oTrackbackModel->getTrackbackKey($obj->document_srl); + if($key != $given_key) return $this->stop('fail'); + + // 엮인글 모듈의 기본 설정을 받음 + $module_srl = Context::get('module_srl'); + $oModuleModel = &getModel('module'); + $config = $oModuleModel->getModulePartConfig('trackback', $module_srl); + $enable_trackback = $config->enable_trackback; + if(!$enable_trackback) { + $config = $oModuleModel->getModuleConfig('trackback'); + $enable_trackback = $config->enable_trackback; + } + + // 관리자가 금지하였을 경우에는 엮인글을 받지 않음 + if($enable_trackback == 'N') return $this->stop('fail'); + + return $this->insertTrackback($obj); + } + + function insertTrackback($obj, $manual_inserted = false) { + // 엮인글 정리 + $obj = Context::convertEncoding($obj); + if(!$obj->blog_name) $obj->blog_name = $obj->title; + $obj->excerpt = strip_tags($obj->excerpt); + + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('trackback.insertTrackback', 'before', $obj); + if(!$output->toBool()) return $output; + + // GET으로 넘어온 document_srl을 참조, 없으면 오류~ + $document_srl = $obj->document_srl; + + if(!$manual_inserted) { + // document model 객체 생성후 원본글을 가져옴 + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + + // 원본글이 없거나 트랙백 허용을 하지 않으면 오류 표시 + if(!$oDocument->isExists()) return $this->stop('fail'); + if(!$oDocument->allowTrackback()) return new Object(-1,'fail'); + + $obj->module_srl = $oDocument->get('module_srl'); + } + + // 엮인글을 입력 + $obj->trackback_srl = getNextSequence(); + $obj->list_order = $obj->trackback_srl*-1; + $output = executeQuery('trackback.insertTrackback', $obj); + if(!$output->toBool()) return $output; + + // 입력에 이상이 없으면 해당 글의 엮인글 수를 올림 + if(!$manual_inserted) { + // trackback model 객체 생성 + $oTrackbackModel = &getModel('trackback'); + + // 해당 글의 전체 엮인글 수를 구해옴 + $trackback_count = $oTrackbackModel->getTrackbackCount($document_srl); + + // document controller 객체 생성 + $oDocumentController = &getController('document'); + + // 해당글의 엮인글 수를 업데이트 + $output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count); + + // 결과 return + if(!$output->toBool()) return $output; + } + + // 원본글에 알림(notify_message)가 설정되어 있으면 메세지 보냄 + if(!$manual_inserted) $oDocument->notify(Context::getLang('trackback'), $obj->excerpt); + + // trigger 호출 (after) + $output = ModuleHandler::triggerCall('trackback.insertTrackback', 'after', $obj); + if(!$output->toBool()) return $output; + + return new Object(); + } + + /** + * @brief 단일 엮인글 삭제 + **/ + function deleteTrackback($trackback_srl, $is_admin = false) { + // trackback model 객체 생성 + $oTrackbackModel = &getModel('trackback'); + + // 삭제하려는 엮인글이 있는지 확인 + $trackback = $oTrackbackModel->getTrackback($trackback_srl); + if($trackback->data->trackback_srl != $trackback_srl) return new Object(-1, 'msg_invalid_request'); + $document_srl = $trackback->data->document_srl; + + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'before', $trackback); + if(!$output->toBool()) return $output; + + // document model 객체 생성 + $oDocumentModel = &getModel('document'); + + // 권한이 있는지 확인 + if(!$is_admin && !$oDocumentModel->isGranted($document_srl)) return new Object(-1, 'msg_not_permitted'); + + $args->trackback_srl = $trackback_srl; + $output = executeQuery('trackback.deleteTrackback', $args); + if(!$output->toBool()) return new Object(-1, 'msg_error_occured'); + + // 엮인글 수를 구해서 업데이트 + $trackback_count = $oTrackbackModel->getTrackbackCount($document_srl); + + // document controller 객체 생성 + $oDocumentController = &getController('document','controller'); + + // 해당글의 엮인글 수를 업데이트 + $output = $oDocumentController->updateTrackbackCount($document_srl, $trackback_count); + $output->add('document_srl', $document_srl); + + // trigger 호출 (before) + $output = ModuleHandler::triggerCall('trackback.deleteTrackback', 'after', $trackback); + if(!$output->toBool()) return $output; + + return $output; + } + + /** + * @brief 글에 속한 모든 트랙백 삭제 + **/ + function deleteTrackbacks($document_srl) { + // 삭제 + $args->document_srl = $document_srl; + $output = executeQuery('trackback.deleteTrackbacks', $args); + + return $output; + } + + /** + * @brief 엮인글을 발송 + * + * 발송 후 결과처리는 하지 않는 구조임 + **/ + function sendTrackback($oDocument, $trackback_url, $charset) { + $oModuleController = &getController('module'); + + // 발송할 정보를 정리 + $http = parse_url($trackback_url); + $obj->blog_name = str_replace(array('<','>','&','"'), array('<','>','&','"'), Context::getBrowserTitle()); + $oModuleController->replaceDefinedLangCode($obj->blog_name); + $obj->title = $oDocument->getTitleText(); + $obj->excerpt = $oDocument->getSummary(200); + $obj->url = getFullUrl('','document_srl',$oDocument->document_srl); + + // blog_name, title, excerpt, url의 문자열을 요청된 charset으로 변경 + if($charset && function_exists('iconv')) { + foreach($obj as $key=>$val) { + $obj->{$key} = iconv('UTF-8',$charset,$val); + } + } + + // socket으로 발송할 내용 작성 + if($http['query']) $http['query'].="&"; + if(!$http['port']) $http['port'] = 80; + + $content = + sprintf( + "title=%s&". + "url=%s&". + "blog_name=%s&". + "excerpt=%s", + urlencode($obj->title), + urlencode($obj->url), + urlencode($obj->blog_name), + urlencode($obj->excerpt) + ); + if($http['query']) $content .= '&'.$http['query']; + $content_length = strlen($content); + + // header 정리 + $header = + sprintf( + "POST %s HTTP/1.1\r\n". + "Host: %s\r\n". + "Content-Type: %s\r\n". + "Content-Length: %s\r\n\r\n". + "%s\r\n", + $http['path'], + $http['host'], + "application/x-www-form-urlencoded", + $content_length, + $content + ); + if(!$http['host']||!$http['port']) return new Object(-1,'msg_trackback_url_is_invalid'); + + // 발송하려는 대상 서버의 socket을 연다 + $fp = @fsockopen($http['host'], $http['port'], $errno, $errstr, 5); + if(!$fp) return new Object(-1,'msg_trackback_url_is_invalid'); + + // 작성한 헤더 정보를 발송 + fputs($fp, $header); + + // 결과를 기다림 (특정 서버의 경우 EOF가 떨어지지 않을 수가 있음 + while(!feof($fp)) { + $line = trim(fgets($fp, 4096)); + if(preg_match("/^/i",$line)){ + $error = preg_replace('/[^0-9]/','',$line); + break; + } + } + + // socket 닫음 + fclose($fp); + + if($error == "0") return new Object(0, 'msg_trackback_send_success'); + + return new Object(-1, 'msg_trackback_send_failed'); + } + + /** + * @brief 특정 ipaddress의 특정 시간대 내의 엮인글을 모두 삭제 + **/ + function deleteTrackbackSender($time, $ipaddress, $url, $blog_name, $title, $excerpt) { + $obj->regdate = date("YmdHis",time()-$time); + $obj->ipaddress = $ipaddress; + $obj->url = $url; + $obj->blog_name = $blog_name; + $obj->title = $title; + $obj->excerpt = $excerpt; + $output = executeQueryArray('trackback.getRegistedTrackbacks', $obj); + if(!$output->data || !count($output->data)) return; + + foreach($output->data as $trackback) { + $trackback_srl = $trackback->trackback_srl; + $this->deleteTrackback($trackback_srl, true); + } + } + } +?> diff --git a/modules/trackback/trackback.model.php b/modules/trackback/trackback.model.php index 3fade8b7a..9a10a9299 100644 --- a/modules/trackback/trackback.model.php +++ b/modules/trackback/trackback.model.php @@ -1,151 +1,151 @@ -trackback_srl = $trackback_srl; - return executeQuery('trackback.getTrackback', $args); - } - - /** - * @brief document_srl 에 해당하는 엮인글의 전체 갯수를 가져옴 - **/ - function getTrackbackCount($document_srl) { - $args->document_srl = $document_srl; - $output = executeQuery('trackback.getTrackbackCount', $args); - $total_count = $output->data->count; - - return (int)$total_count; - } - - - /** - * @brief module_srl 에 해당하는 엮인글의 전체 갯수를 가져옴 - **/ - function getTrackbackAllCount($module_srl) { - $args->module_srl = $module_srl; - $output = executeQuery('trackback.getTrackbackCount', $args); - $total_count = $output->data->count; - - return (int)$total_count; - } - - - /** - * @brief 특정 document에 특정 ip로 기록된 트랙백의 갯수 - * spamfilter 에서 사용할 method임 - **/ - function getTrackbackCountByIPAddress($document_srl, $ipaddress) { - $args->document_srl = $document_srl; - $args->ipaddress = $ipaddress; - $output = executeQuery('trackback.getTrackbackCountByIPAddress', $args); - $total_count = $output->data->count; - - return (int)$total_count; - } - - /** - * @brief 특정 문서에 속한 엮인글의 목록을 가져옴 - **/ - function getTrackbackList($document_srl) { - $args->document_srl = $document_srl; - $args->list_order = 'list_order'; - $output = executeQuery('trackback.getTrackbackList', $args); - - if(!$output->toBool()) return $output; - - $trackback_list = $output->data; - - if(!is_array($trackback_list)) $trackback_list = array($trackback_list); - - return $trackback_list; - } - - /** - * @brief mid 에 해당하는 엮인글을 가져옴 - **/ - function getNewestTrackbackList($obj) { - if($obj->mid) { - $oModuleModel = &getModel('module'); - $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); - unset($obj->mid); - } - - // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 - if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); - else $args->module_srl = $obj->module_srl; - $args->list_count = $obj->list_count; - if($obj->site_srl) $args->site_srl = (int)$obj->site_srl; - $args->sort_index = 'trackbacks.list_order'; - $args->order = 'asc'; - - $output = executeQueryArray('trackback.getNewestTrackbackList', $args); - - return $output; - } - - /** - * @brief 특정 모듈의 trackback 설정을 return - **/ - function getTrackbackModuleConfig($module_srl) { - // trackback 모듈의 config를 가져옴 - $oModuleModel = &getModel('module'); - $module_trackback_config = $oModuleModel->getModulePartConfig('trackback', $module_srl); - if(!$module_trackback_config) { - $trackback_config = $oModuleModel->getModuleConfig('trackback'); - $module_trackback_config->enable_trackback = $trackback_config->enable_trackback!='N'?'Y':'N'; - } - $module_trackback_config->module_srl = $module_srl; - return $module_trackback_config; - } - - /** - * @brief 정해진 시간내에 전체 엮인글 등록수를 구함 - **/ - function getRegistedTrackback($time, $ipaddress, $url, $blog_name, $title, $excerpt) { - $obj->regdate = date("YmdHis",time()-$time); - $obj->ipaddress = $ipaddress; - $obj->url = $url; - $obj->blog_name = $blog_name; - $obj->title = $title; - $obj->excerpt = $excerpt; - $output = executeQuery('trackback.getRegistedTrackback', $obj); - return $output->data->count; - } - - /** - * @brief trackback url을 생성하여 return - * trackback url에 key값을 추가함. - **/ - function getTrackbackUrl($document_srl) { - $url = getFullUrl('','document_srl',$document_srl,'act','trackback','key',$this->getTrackbackKey($document_srl)); - return $url; - } - - /** - * @brief 키값을 생성하여 return - * key값은 db 비번 정보 + 10분 단위의 시간값을 합쳐서 hash결과를 이용함 - * 단 url이 너무 길어져서 1, 10, 20 자리수의 글자 하나씩만을 조합해서 return - **/ - function getTrackbackKey($document_srl) { - $time = (int) (time()/(60*10)); - $db_info = Context::getDBInfo(); - $key = md5($document_srl.$db_info->db_password.$time); - return sprintf("%s%s%s",substr($key,1,1),substr($key,10,1),substr($key,20,1)); - } - } -?> +trackback_srl = $trackback_srl; + return executeQuery('trackback.getTrackback', $args); + } + + /** + * @brief document_srl 에 해당하는 엮인글의 전체 갯수를 가져옴 + **/ + function getTrackbackCount($document_srl) { + $args->document_srl = $document_srl; + $output = executeQuery('trackback.getTrackbackCount', $args); + $total_count = $output->data->count; + + return (int)$total_count; + } + + + /** + * @brief module_srl 에 해당하는 엮인글의 전체 갯수를 가져옴 + **/ + function getTrackbackAllCount($module_srl) { + $args->module_srl = $module_srl; + $output = executeQuery('trackback.getTrackbackCount', $args); + $total_count = $output->data->count; + + return (int)$total_count; + } + + + /** + * @brief 특정 document에 특정 ip로 기록된 트랙백의 갯수 + * spamfilter 에서 사용할 method임 + **/ + function getTrackbackCountByIPAddress($document_srl, $ipaddress) { + $args->document_srl = $document_srl; + $args->ipaddress = $ipaddress; + $output = executeQuery('trackback.getTrackbackCountByIPAddress', $args); + $total_count = $output->data->count; + + return (int)$total_count; + } + + /** + * @brief 특정 문서에 속한 엮인글의 목록을 가져옴 + **/ + function getTrackbackList($document_srl) { + $args->document_srl = $document_srl; + $args->list_order = 'list_order'; + $output = executeQuery('trackback.getTrackbackList', $args); + + if(!$output->toBool()) return $output; + + $trackback_list = $output->data; + + if(!is_array($trackback_list)) $trackback_list = array($trackback_list); + + return $trackback_list; + } + + /** + * @brief mid 에 해당하는 엮인글을 가져옴 + **/ + function getNewestTrackbackList($obj) { + if($obj->mid) { + $oModuleModel = &getModel('module'); + $obj->module_srl = $oModuleModel->getModuleSrlByMid($obj->mid); + unset($obj->mid); + } + + // 넘어온 module_srl은 array일 수도 있기에 array인지를 체크 + if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl); + else $args->module_srl = $obj->module_srl; + $args->list_count = $obj->list_count; + if($obj->site_srl) $args->site_srl = (int)$obj->site_srl; + $args->sort_index = 'trackbacks.list_order'; + $args->order = 'asc'; + + $output = executeQueryArray('trackback.getNewestTrackbackList', $args); + + return $output; + } + + /** + * @brief 특정 모듈의 trackback 설정을 return + **/ + function getTrackbackModuleConfig($module_srl) { + // trackback 모듈의 config를 가져옴 + $oModuleModel = &getModel('module'); + $module_trackback_config = $oModuleModel->getModulePartConfig('trackback', $module_srl); + if(!$module_trackback_config) { + $trackback_config = $oModuleModel->getModuleConfig('trackback'); + $module_trackback_config->enable_trackback = $trackback_config->enable_trackback!='N'?'Y':'N'; + } + $module_trackback_config->module_srl = $module_srl; + return $module_trackback_config; + } + + /** + * @brief 정해진 시간내에 전체 엮인글 등록수를 구함 + **/ + function getRegistedTrackback($time, $ipaddress, $url, $blog_name, $title, $excerpt) { + $obj->regdate = date("YmdHis",time()-$time); + $obj->ipaddress = $ipaddress; + $obj->url = $url; + $obj->blog_name = $blog_name; + $obj->title = $title; + $obj->excerpt = $excerpt; + $output = executeQuery('trackback.getRegistedTrackback', $obj); + return $output->data->count; + } + + /** + * @brief trackback url을 생성하여 return + * trackback url에 key값을 추가함. + **/ + function getTrackbackUrl($document_srl) { + $url = getFullUrl('','document_srl',$document_srl,'act','trackback','key',$this->getTrackbackKey($document_srl)); + return $url; + } + + /** + * @brief 키값을 생성하여 return + * key값은 db 비번 정보 + 10분 단위의 시간값을 합쳐서 hash결과를 이용함 + * 단 url이 너무 길어져서 1, 10, 20 자리수의 글자 하나씩만을 조합해서 return + **/ + function getTrackbackKey($document_srl) { + $time = (int) (time()/(60*10)); + $db_info = Context::getDBInfo(); + $key = md5($document_srl.$db_info->db_password.$time); + return sprintf("%s%s%s",substr($key,1,1),substr($key,10,1),substr($key,20,1)); + } + } +?> diff --git a/modules/trackback/trackback.view.php b/modules/trackback/trackback.view.php index 7c9ff133b..6e01b7388 100644 --- a/modules/trackback/trackback.view.php +++ b/modules/trackback/trackback.view.php @@ -1,70 +1,70 @@ -stop('msg_invalid_request'); - - $logged_info = Context::get('logged_info'); - if(!$logged_info->member_srl) return $this->stop('msg_not_permitted'); - - // 원본 글의 정보를 구함 - $oDocumentModel = &getModel('document'); - $oDocument = $oDocumentModel->getDocument($document_srl); - if(!$oDocument->isExists()) return $this->stop('msg_invalid_document'); - if($oDocument->isSecret()) return $this->stop('msg_invalid_request'); - - if($oDocument->getMemberSrl() != $logged_info->member_srl) return $this->stop('msg_not_permitted'); - - Context::set('oDocument', $oDocument); - - // 템플릿 지정 - $this->setLayoutFile('popup_layout'); - $this->setTemplatePath($this->module_path.'tpl'); - $this->setTemplateFile('send_trackback_form'); - } - - /** - * @brief 서비스형 모듈의 추가 설정을 위한 부분 - * trackback의 사용 형태에 대한 설정만 받음 - **/ - function triggerDispTrackbackAdditionSetup(&$obj) { - $current_module_srl = Context::get('module_srl'); - $current_module_srls = Context::get('module_srls'); - - if(!$current_module_srl && !$current_module_srls) { - // 선택된 모듈의 정보를 가져옴 - $current_module_info = Context::get('current_module_info'); - $current_module_srl = $current_module_info->module_srl; - if(!$current_module_srl) return new Object(); - } - - // 선택된 모듈의 trackback설정을 가져옴 - $oTrackbackModel = &getModel('trackback'); - $trackback_config = $oTrackbackModel->getTrackbackModuleConfig($current_module_srl); - Context::set('trackback_config', $trackback_config); - - // 템플릿 파일 지정 - $oTemplate = &TemplateHandler::getInstance(); - $tpl = $oTemplate->compile($this->module_path.'tpl', 'trackback_module_config'); - $obj .= $tpl; - - return new Object(); - } - } -?> +stop('msg_invalid_request'); + + $logged_info = Context::get('logged_info'); + if(!$logged_info->member_srl) return $this->stop('msg_not_permitted'); + + // 원본 글의 정보를 구함 + $oDocumentModel = &getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + if(!$oDocument->isExists()) return $this->stop('msg_invalid_document'); + if($oDocument->isSecret()) return $this->stop('msg_invalid_request'); + + if($oDocument->getMemberSrl() != $logged_info->member_srl) return $this->stop('msg_not_permitted'); + + Context::set('oDocument', $oDocument); + + // 템플릿 지정 + $this->setLayoutFile('popup_layout'); + $this->setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile('send_trackback_form'); + } + + /** + * @brief 서비스형 모듈의 추가 설정을 위한 부분 + * trackback의 사용 형태에 대한 설정만 받음 + **/ + function triggerDispTrackbackAdditionSetup(&$obj) { + $current_module_srl = Context::get('module_srl'); + $current_module_srls = Context::get('module_srls'); + + if(!$current_module_srl && !$current_module_srls) { + // 선택된 모듈의 정보를 가져옴 + $current_module_info = Context::get('current_module_info'); + $current_module_srl = $current_module_info->module_srl; + if(!$current_module_srl) return new Object(); + } + + // 선택된 모듈의 trackback설정을 가져옴 + $oTrackbackModel = &getModel('trackback'); + $trackback_config = $oTrackbackModel->getTrackbackModuleConfig($current_module_srl); + Context::set('trackback_config', $trackback_config); + + // 템플릿 파일 지정 + $oTemplate = &TemplateHandler::getInstance(); + $tpl = $oTemplate->compile($this->module_path.'tpl', 'trackback_module_config'); + $obj .= $tpl; + + return new Object(); + } + } +?> diff --git a/modules/widget/conf/info.xml b/modules/widget/conf/info.xml index 2fd5925dd..1439e2d14 100644 --- a/modules/widget/conf/info.xml +++ b/modules/widget/conf/info.xml @@ -1,36 +1,36 @@ - - - 위젯 - 控件管理 - ウィジェット - Widget - Widget - Widget - Виджеты - Widget - Görsel Bileşen (widget) - 위젯 관리 모듈 - 控件管理模块。 - ウィジェット管理モジュール - Module for managing widgets. - Module dành cho quản lý Widget. - Módulo para el manejo de widgets. - Модуль для управления виджетами. - Widget管理模組。 - Widgetları yönetmek için kullanılan modüldür. - 0.1 - 2007-02-28 - construction - - - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - NHN - - + + + 위젯 + 控件管理 + ウィジェット + Widget + Widget + Widget + Виджеты + Widget + Görsel Bileşen (widget) + 위젯 관리 모듈 + 控件管理模块。 + ウィジェット管理モジュール + Module for managing widgets. + Module dành cho quản lý Widget. + Módulo para el manejo de widgets. + Модуль для управления виджетами. + Widget管理模組。 + Widgetları yönetmek için kullanılan modüldür. + 0.1 + 2007-02-28 + construction + + + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + NHN + + diff --git a/modules/widget/lang/en.lang.php b/modules/widget/lang/en.lang.php index c3d5ad973..987d18397 100644 --- a/modules/widget/lang/en.lang.php +++ b/modules/widget/lang/en.lang.php @@ -1,68 +1,68 @@ -cmd_generate_code = 'Generate Code'; - - $lang->widget_name = 'Widget Name'; - $lang->widget_maker = 'Developer'; - $lang->widget_license = 'License'; - $lang->widget_history = 'Update History'; - $lang->widget_info = 'Widget Info'; - $lang->widget_code = 'Code'; - $lang->widget_cache = 'Cache'; - - $lang->widget_fix_width = 'Fix Width'; - $lang->widget_width = 'Width'; - $lang->widget_position = 'Position'; - $lang->widget_position_none = 'Next Line'; - $lang->widget_position_left = 'Left'; - $lang->widget_position_right = 'Right'; - $lang->widget_margin = 'Margin'; - $lang->widget_margin_top = 'Top Margin'; - $lang->widget_margin_right = 'Right Margin'; - $lang->widget_margin_bottom = 'Bottom Margin'; - $lang->widget_margin_left= 'Left Margin'; - $lang->about_widget_fix_width = 'Please check to fix the width.'; - $lang->about_widget_width = 'Please set the width of widget.'; - $lang->about_widget_position = 'Please select the position if you want to display many widgets in one line.'; - $lang->about_widget_margin = "You may set the margin of widgets' top, bottom, right and left."; - $lang->about_widget_cache = 'Cached data can be used during the time you have set.'; - - $lang->generated_code = 'Generated Code'; - $lang->widgetstyle= 'Widget Style'; - - $lang->msg_widget_is_not_exists = "'%s' does not exist."; - $lang->msg_widget_object_is_null = "Object of '%s' could not be created."; - $lang->msg_widget_proc_is_null = "proc() of '%s' could not be executed."; - $lang->msg_widget_skin_is_null = "You should select widget's skin"; - - $lang->about_widget_code = 'Please input required value first, and click [Generate Code] button to generate code to add to the template file.'; - $lang->about_widget_code_in_page = 'After entering the required values, click the [Add] button to insert the widget code into the page.'; - $lang->about_widget = "A widget is a small free-standing application used in a layout or page module.\n It can be linked with internal module or external open api. Through its configuration setting, wide application is possible. \n You can directly add a widget by using the [Generate Code] function without using the XE page module or layout module."; - - $lang->cmd_content_insert = "Insert Content by Yourself"; - $lang->cmd_box_widget_insert = "Insert Box Widget"; - $lang->cmd_remove_all_widgets = "Remove All Widgets"; - - $lang->cmd_widget_size = "Widget Size"; - $lang->cmd_widget_align = "Align Widget"; - $lang->cmd_widget_align_left = "Left"; - $lang->cmd_widget_align_right = "Right"; - $lang->cmd_widget_margin = "Margin"; - $lang->cmd_widget_padding = "Padding"; - $lang->cmd_widget_border = "Border"; - $lang->cmd_widget_border_solid = "Solid"; - $lang->cmd_widget_border_dotted = "Dotted"; - $lang->cmd_widget_background_color = "Background Color"; - $lang->cmd_widget_background_image_url = "Background Image"; - $lang->cmd_widget_background_image_repeat = "Repeat"; - $lang->cmd_widget_background_image_no_repeat = "No Repeat"; - $lang->cmd_widget_background_image_x_repeat = "X Repeat"; - $lang->cmd_widget_background_image_y_repeat = "Y Repeat"; - $lang->cmd_widget_background_image_x = "X Position"; - $lang->cmd_widget_background_image_y = "Y Position"; -?> +cmd_generate_code = 'Generate Code'; + + $lang->widget_name = 'Widget Name'; + $lang->widget_maker = 'Developer'; + $lang->widget_license = 'License'; + $lang->widget_history = 'Update History'; + $lang->widget_info = 'Widget Info'; + $lang->widget_code = 'Code'; + $lang->widget_cache = 'Cache'; + + $lang->widget_fix_width = 'Fix Width'; + $lang->widget_width = 'Width'; + $lang->widget_position = 'Position'; + $lang->widget_position_none = 'Next Line'; + $lang->widget_position_left = 'Left'; + $lang->widget_position_right = 'Right'; + $lang->widget_margin = 'Margin'; + $lang->widget_margin_top = 'Top Margin'; + $lang->widget_margin_right = 'Right Margin'; + $lang->widget_margin_bottom = 'Bottom Margin'; + $lang->widget_margin_left= 'Left Margin'; + $lang->about_widget_fix_width = 'Please check to fix the width.'; + $lang->about_widget_width = 'Please set the width of widget.'; + $lang->about_widget_position = 'Please select the position if you want to display many widgets in one line.'; + $lang->about_widget_margin = "You may set the margin of widgets' top, bottom, right and left."; + $lang->about_widget_cache = 'Cached data can be used during the time you have set.'; + + $lang->generated_code = 'Generated Code'; + $lang->widgetstyle= 'Widget Style'; + + $lang->msg_widget_is_not_exists = "'%s' does not exist."; + $lang->msg_widget_object_is_null = "Object of '%s' could not be created."; + $lang->msg_widget_proc_is_null = "proc() of '%s' could not be executed."; + $lang->msg_widget_skin_is_null = "You should select widget's skin"; + + $lang->about_widget_code = 'Please input required value first, and click [Generate Code] button to generate code to add to the template file.'; + $lang->about_widget_code_in_page = 'After entering the required values, click the [Add] button to insert the widget code into the page.'; + $lang->about_widget = "A widget is a small free-standing application used in a layout or page module.\n It can be linked with internal module or external open api. Through its configuration setting, wide application is possible. \n You can directly add a widget by using the [Generate Code] function without using the XE page module or layout module."; + + $lang->cmd_content_insert = "Insert Content by Yourself"; + $lang->cmd_box_widget_insert = "Insert Box Widget"; + $lang->cmd_remove_all_widgets = "Remove All Widgets"; + + $lang->cmd_widget_size = "Widget Size"; + $lang->cmd_widget_align = "Align Widget"; + $lang->cmd_widget_align_left = "Left"; + $lang->cmd_widget_align_right = "Right"; + $lang->cmd_widget_margin = "Margin"; + $lang->cmd_widget_padding = "Padding"; + $lang->cmd_widget_border = "Border"; + $lang->cmd_widget_border_solid = "Solid"; + $lang->cmd_widget_border_dotted = "Dotted"; + $lang->cmd_widget_background_color = "Background Color"; + $lang->cmd_widget_background_image_url = "Background Image"; + $lang->cmd_widget_background_image_repeat = "Repeat"; + $lang->cmd_widget_background_image_no_repeat = "No Repeat"; + $lang->cmd_widget_background_image_x_repeat = "X Repeat"; + $lang->cmd_widget_background_image_y_repeat = "Y Repeat"; + $lang->cmd_widget_background_image_x = "X Position"; + $lang->cmd_widget_background_image_y = "Y Position"; +?> diff --git a/modules/widget/lang/es.lang.php b/modules/widget/lang/es.lang.php index 7ce1faf1d..8286ed60c 100644 --- a/modules/widget/lang/es.lang.php +++ b/modules/widget/lang/es.lang.php @@ -1,68 +1,68 @@ -cmd_generate_code = 'Generar Código'; - - $lang->widget_name = 'Nombre de Widget'; - $lang->widget_maker = 'Desarrollador de Widget'; - $lang->widget_license = 'License'; - $lang->widget_history = 'Actualizar la historia'; - $lang->widget_info = 'información de Widget'; - $lang->widget_code = 'Código'; - $lang->widget_cache = 'Cache'; - - $lang->widget_fix_width = 'Ancho permanente'; - $lang->widget_width = 'Ancho'; - $lang->widget_position = 'Posición'; - $lang->widget_position_none = 'Próxima línea'; - $lang->widget_position_left = 'Izquierdo'; - $lang->widget_position_right = 'Derecho'; - $lang->widget_margin = 'Márgen'; - $lang->widget_margin_top = 'Márgen superior'; - $lang->widget_margin_right = 'Márgen derecho'; - $lang->widget_margin_bottom = 'Márgen inferior'; - $lang->widget_margin_left= 'Márgen izquierdo'; - $lang->about_widget_fix_width = 'Si selecciona esta opción el ancho será permanente.'; - $lang->about_widget_width = 'Ingrese el ancho de Widget.'; - $lang->about_widget_position = 'Selecciona la posición si desea mostra más widgets en una línea.'; - $lang->about_widget_margin = "Uste puede ingresar el márgen de los widgets : superior, inferior, derecho e izquierdo."; - $lang->about_widget_cache = 'Se puede usar datos de caché creado durante el tiempo asignado.'; - - $lang->generated_code = 'Generar códigos'; - $lang->widgetstyle= '위젯스타일'; - - $lang->msg_widget_is_not_exists = 'No existe widget %s .'; - $lang->msg_widget_object_is_null = 'No puede ser creado el objeto de widget %s.'; - $lang->msg_widget_proc_is_null = 'No puede ser ejecutado el proc() de widget %s.'; - $lang->msg_widget_skin_is_null = '위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다'; - - $lang->about_widget_code = 'Ingrese primero los valores requeridos, luego presiona el botón "Generar códigos" para mostrar el código en el espacio inferior para ser añadido en el archivo de los temas.'; - $lang->about_widget_code_in_page = 'Luego de ingresar los valores requeridos, presiona el botón "Añadir" para insertar el código de widget dentro de la página.'; - $lang->about_widget = "Un Widget es una pequena aplicación para ser usados en los diseños o en el módulo de páginas.\n Puede ser enlazados con un módulo interno o con open api externo y con la configuración de ella puede utilizar en variadas aplicaciones.\nSin la necesidad de utilizar los módulos de página o del diseño de XE, Usted puede directamente añadir un widget usando la función de [Generar Códigos]."; - - $lang->cmd_content_insert = "Introduzca contenido por ti mismo"; - $lang->cmd_box_widget_insert = "Insertar cuadro de widget"; - $lang->cmd_remove_all_widgets = "Eliminar todos los reproductores"; - - $lang->cmd_widget_size = "Tamaño artilugio"; - $lang->cmd_widget_align = "Alinear Widget"; - $lang->cmd_widget_align_left = "Izquierda"; - $lang->cmd_widget_align_right = "Derecho"; - $lang->cmd_widget_margin = "Margen"; - $lang->cmd_widget_padding = "Relleno"; - $lang->cmd_widget_border = "Frontera"; - $lang->cmd_widget_border_solid = "Sólidos"; - $lang->cmd_widget_border_dotted = "Salpicando"; - $lang->cmd_widget_background_color = "Color de fondo"; - $lang->cmd_widget_background_image_url = "Imagen de fondo"; - $lang->cmd_widget_background_image_repeat = "Repita"; - $lang->cmd_widget_background_image_no_repeat = "No Repetir"; - $lang->cmd_widget_background_image_x_repeat = "Repita X"; - $lang->cmd_widget_background_image_y_repeat = "Repita Y"; - $lang->cmd_widget_background_image_x = "Posición X"; - $lang->cmd_widget_background_image_y = "Posición Y"; -?> +cmd_generate_code = 'Generar Código'; + + $lang->widget_name = 'Nombre de Widget'; + $lang->widget_maker = 'Desarrollador de Widget'; + $lang->widget_license = 'License'; + $lang->widget_history = 'Actualizar la historia'; + $lang->widget_info = 'información de Widget'; + $lang->widget_code = 'Código'; + $lang->widget_cache = 'Cache'; + + $lang->widget_fix_width = 'Ancho permanente'; + $lang->widget_width = 'Ancho'; + $lang->widget_position = 'Posición'; + $lang->widget_position_none = 'Próxima línea'; + $lang->widget_position_left = 'Izquierdo'; + $lang->widget_position_right = 'Derecho'; + $lang->widget_margin = 'Márgen'; + $lang->widget_margin_top = 'Márgen superior'; + $lang->widget_margin_right = 'Márgen derecho'; + $lang->widget_margin_bottom = 'Márgen inferior'; + $lang->widget_margin_left= 'Márgen izquierdo'; + $lang->about_widget_fix_width = 'Si selecciona esta opción el ancho será permanente.'; + $lang->about_widget_width = 'Ingrese el ancho de Widget.'; + $lang->about_widget_position = 'Selecciona la posición si desea mostra más widgets en una línea.'; + $lang->about_widget_margin = "Uste puede ingresar el márgen de los widgets : superior, inferior, derecho e izquierdo."; + $lang->about_widget_cache = 'Se puede usar datos de caché creado durante el tiempo asignado.'; + + $lang->generated_code = 'Generar códigos'; + $lang->widgetstyle= '위젯스타일'; + + $lang->msg_widget_is_not_exists = 'No existe widget %s .'; + $lang->msg_widget_object_is_null = 'No puede ser creado el objeto de widget %s.'; + $lang->msg_widget_proc_is_null = 'No puede ser ejecutado el proc() de widget %s.'; + $lang->msg_widget_skin_is_null = '위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다'; + + $lang->about_widget_code = 'Ingrese primero los valores requeridos, luego presiona el botón "Generar códigos" para mostrar el código en el espacio inferior para ser añadido en el archivo de los temas.'; + $lang->about_widget_code_in_page = 'Luego de ingresar los valores requeridos, presiona el botón "Añadir" para insertar el código de widget dentro de la página.'; + $lang->about_widget = "Un Widget es una pequena aplicación para ser usados en los diseños o en el módulo de páginas.\n Puede ser enlazados con un módulo interno o con open api externo y con la configuración de ella puede utilizar en variadas aplicaciones.\nSin la necesidad de utilizar los módulos de página o del diseño de XE, Usted puede directamente añadir un widget usando la función de [Generar Códigos]."; + + $lang->cmd_content_insert = "Introduzca contenido por ti mismo"; + $lang->cmd_box_widget_insert = "Insertar cuadro de widget"; + $lang->cmd_remove_all_widgets = "Eliminar todos los reproductores"; + + $lang->cmd_widget_size = "Tamaño artilugio"; + $lang->cmd_widget_align = "Alinear Widget"; + $lang->cmd_widget_align_left = "Izquierda"; + $lang->cmd_widget_align_right = "Derecho"; + $lang->cmd_widget_margin = "Margen"; + $lang->cmd_widget_padding = "Relleno"; + $lang->cmd_widget_border = "Frontera"; + $lang->cmd_widget_border_solid = "Sólidos"; + $lang->cmd_widget_border_dotted = "Salpicando"; + $lang->cmd_widget_background_color = "Color de fondo"; + $lang->cmd_widget_background_image_url = "Imagen de fondo"; + $lang->cmd_widget_background_image_repeat = "Repita"; + $lang->cmd_widget_background_image_no_repeat = "No Repetir"; + $lang->cmd_widget_background_image_x_repeat = "Repita X"; + $lang->cmd_widget_background_image_y_repeat = "Repita Y"; + $lang->cmd_widget_background_image_x = "Posición X"; + $lang->cmd_widget_background_image_y = "Posición Y"; +?> diff --git a/modules/widget/lang/fr.lang.php b/modules/widget/lang/fr.lang.php index 044029971..576383a3a 100644 --- a/modules/widget/lang/fr.lang.php +++ b/modules/widget/lang/fr.lang.php @@ -1,68 +1,68 @@ - - * @brief Paquet du langage en français pour le module de gadget - **/ - - $lang->cmd_generate_code = 'Générer le Code'; - - $lang->widget_name = 'Nom de Gadget'; - $lang->widget_maker = 'Développeur'; - $lang->widget_license = 'Licence'; - $lang->widget_history = 'Histoire de Mise à jours'; - $lang->widget_info = 'Information de Gadget'; - $lang->widget_code = 'Code'; - $lang->widget_cache = 'Antémémoire'; - - $lang->widget_fix_width = 'Fixer Largeur'; - $lang->widget_width = 'Largeur'; - $lang->widget_position = 'Position'; - $lang->widget_position_none = 'Ligne suivante'; - $lang->widget_position_left = 'Gauche'; - $lang->widget_position_right = 'Droite'; - $lang->widget_margin = 'Marge'; - $lang->widget_margin_top = 'Marge en tête'; - $lang->widget_margin_right = 'Marge à droite'; - $lang->widget_margin_bottom = 'Marge en pied'; - $lang->widget_margin_left= 'Marge à gauche'; - $lang->about_widget_fix_width = 'Cochez pour fixer la largeur, S.V.P.'; - $lang->about_widget_width = 'Configurez la largeur du gadget, S.V.P.'; - $lang->about_widget_position = 'Choisissez la position si vous voulez représenter plusieurs gadgets dans une ligne, S.V.P.'; - $lang->about_widget_margin = "Vous pouvez désigner la marge de gadget 'de tête, en pied, à droite et à gauche."; - $lang->about_widget_cache = 'Les données d\'antémémoire peuvent être utilisées pendant le temps que vous désignez.'; - - $lang->generated_code = 'Code généré'; - $lang->widgetstyle= '위젯스타일'; - - $lang->msg_widget_is_not_exists = "Le Gadget de(d') '%s' n'existe pas."; - $lang->msg_widget_object_is_null = "L'Objet de '%s' n'a pas pu être créé."; - $lang->msg_widget_proc_is_null = "proc() de '%s' n'a pas pu être exécuté."; - $lang->msg_widget_skin_is_null = '위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다'; - - $lang->about_widget_code = 'Entrez les valeurs qui sont requises par le gadget choisi, et puis cliquz le bouton [Générer le Code] pour générer le code. Le code à appliquer au fichier de modèl se présentera en bas.'; - $lang->about_widget_code_in_page = 'Après entrer les valeurs requies, cliquez le bouton [Ajouter] pour insérer le gadjet dans la page.'; - $lang->about_widget = "Un gadjet est un petit application indépendant qui est utilisé dans une Mise en Page ou dans une module de Page. Un gajet peut être lié avec un module intérieur ou avec un API extérieur ouvert. L'application divers est possible par la configuration. \nVous pouvez directement ajouter un gadget en utilisant la fonction [Générer le Code] sans utiliser un module de Page de XE ni un module de Mise en Page."; - - $lang->cmd_content_insert = "Insérer le Contenu par vous-même"; - $lang->cmd_box_widget_insert = "Insérer le Gadget de Boîte"; - $lang->cmd_remove_all_widgets = "Enlever Tous les Gadgets"; - - $lang->cmd_widget_size = "Taille du Gadget"; - $lang->cmd_widget_align = "Alignement des Gadget"; - $lang->cmd_widget_align_left = "Gauche"; - $lang->cmd_widget_align_right = "Droite"; - $lang->cmd_widget_margin = "Marge"; - $lang->cmd_widget_padding = "Remplissage"; - $lang->cmd_widget_border = "Bordure"; - $lang->cmd_widget_border_solid = "Solide"; - $lang->cmd_widget_border_dotted = "Pointillé"; - $lang->cmd_widget_background_color = "Couleur d'arrière-plan"; - $lang->cmd_widget_background_image_url = "Image d'arrière-plan"; - $lang->cmd_widget_background_image_repeat = "Répéter"; - $lang->cmd_widget_background_image_no_repeat = "Ne pas répéter"; - $lang->cmd_widget_background_image_x_repeat = "X Répéter"; - $lang->cmd_widget_background_image_y_repeat = "Y Répéter"; - $lang->cmd_widget_background_image_x = "X Position"; - $lang->cmd_widget_background_image_y = "Y Position"; -?> + + * @brief Paquet du langage en français pour le module de gadget + **/ + + $lang->cmd_generate_code = 'Générer le Code'; + + $lang->widget_name = 'Nom de Gadget'; + $lang->widget_maker = 'Développeur'; + $lang->widget_license = 'Licence'; + $lang->widget_history = 'Histoire de Mise à jours'; + $lang->widget_info = 'Information de Gadget'; + $lang->widget_code = 'Code'; + $lang->widget_cache = 'Antémémoire'; + + $lang->widget_fix_width = 'Fixer Largeur'; + $lang->widget_width = 'Largeur'; + $lang->widget_position = 'Position'; + $lang->widget_position_none = 'Ligne suivante'; + $lang->widget_position_left = 'Gauche'; + $lang->widget_position_right = 'Droite'; + $lang->widget_margin = 'Marge'; + $lang->widget_margin_top = 'Marge en tête'; + $lang->widget_margin_right = 'Marge à droite'; + $lang->widget_margin_bottom = 'Marge en pied'; + $lang->widget_margin_left= 'Marge à gauche'; + $lang->about_widget_fix_width = 'Cochez pour fixer la largeur, S.V.P.'; + $lang->about_widget_width = 'Configurez la largeur du gadget, S.V.P.'; + $lang->about_widget_position = 'Choisissez la position si vous voulez représenter plusieurs gadgets dans une ligne, S.V.P.'; + $lang->about_widget_margin = "Vous pouvez désigner la marge de gadget 'de tête, en pied, à droite et à gauche."; + $lang->about_widget_cache = 'Les données d\'antémémoire peuvent être utilisées pendant le temps que vous désignez.'; + + $lang->generated_code = 'Code généré'; + $lang->widgetstyle= '위젯스타일'; + + $lang->msg_widget_is_not_exists = "Le Gadget de(d') '%s' n'existe pas."; + $lang->msg_widget_object_is_null = "L'Objet de '%s' n'a pas pu être créé."; + $lang->msg_widget_proc_is_null = "proc() de '%s' n'a pas pu être exécuté."; + $lang->msg_widget_skin_is_null = '위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다'; + + $lang->about_widget_code = 'Entrez les valeurs qui sont requises par le gadget choisi, et puis cliquz le bouton [Générer le Code] pour générer le code. Le code à appliquer au fichier de modèl se présentera en bas.'; + $lang->about_widget_code_in_page = 'Après entrer les valeurs requies, cliquez le bouton [Ajouter] pour insérer le gadjet dans la page.'; + $lang->about_widget = "Un gadjet est un petit application indépendant qui est utilisé dans une Mise en Page ou dans une module de Page. Un gajet peut être lié avec un module intérieur ou avec un API extérieur ouvert. L'application divers est possible par la configuration. \nVous pouvez directement ajouter un gadget en utilisant la fonction [Générer le Code] sans utiliser un module de Page de XE ni un module de Mise en Page."; + + $lang->cmd_content_insert = "Insérer le Contenu par vous-même"; + $lang->cmd_box_widget_insert = "Insérer le Gadget de Boîte"; + $lang->cmd_remove_all_widgets = "Enlever Tous les Gadgets"; + + $lang->cmd_widget_size = "Taille du Gadget"; + $lang->cmd_widget_align = "Alignement des Gadget"; + $lang->cmd_widget_align_left = "Gauche"; + $lang->cmd_widget_align_right = "Droite"; + $lang->cmd_widget_margin = "Marge"; + $lang->cmd_widget_padding = "Remplissage"; + $lang->cmd_widget_border = "Bordure"; + $lang->cmd_widget_border_solid = "Solide"; + $lang->cmd_widget_border_dotted = "Pointillé"; + $lang->cmd_widget_background_color = "Couleur d'arrière-plan"; + $lang->cmd_widget_background_image_url = "Image d'arrière-plan"; + $lang->cmd_widget_background_image_repeat = "Répéter"; + $lang->cmd_widget_background_image_no_repeat = "Ne pas répéter"; + $lang->cmd_widget_background_image_x_repeat = "X Répéter"; + $lang->cmd_widget_background_image_y_repeat = "Y Répéter"; + $lang->cmd_widget_background_image_x = "X Position"; + $lang->cmd_widget_background_image_y = "Y Position"; +?> diff --git a/modules/widget/lang/jp.lang.php b/modules/widget/lang/jp.lang.php index 8a6de2460..0b02af314 100644 --- a/modules/widget/lang/jp.lang.php +++ b/modules/widget/lang/jp.lang.php @@ -1,68 +1,68 @@ -cmd_generate_code = 'コード生成'; - - $lang->widget_name = 'ウィジェット名'; - $lang->widget_maker = 'ウィジェット作者'; - $lang->widget_license = 'ライセンス'; - $lang->widget_history = '変更内容'; - $lang->widget_info = 'ウィジェット情報'; - $lang->widget_code = 'コード'; - $lang->widget_cache = 'キャッシュ'; - - $lang->widget_fix_width = '横幅固定'; - $lang->widget_width = '縦幅サイズ'; - $lang->widget_position = 'ポジッション'; - $lang->widget_position_none = '改行'; - $lang->widget_position_left = '左へ'; - $lang->widget_position_right = '右へ'; - $lang->widget_margin = '余白'; - $lang->widget_margin_top = '上'; - $lang->widget_margin_right = '右'; - $lang->widget_margin_bottom = '下 '; - $lang->widget_margin_left= '左'; - $lang->about_widget_fix_width = 'チェックすると横幅が固定されます。'; - $lang->about_widget_width = '縦幅サイズを選択して下さい。'; - $lang->about_widget_position = '一つのラインに多数のウィジェットを羅列したい場合は、ポジッションを選択して下さい。'; - $lang->about_widget_margin = '一つのラインに多数のウィジェットを羅列したい場合は、ポジッションを選択して下さい。'; - $lang->about_widget_cache = '指定された時間内にキャッシュされたデータが利用出来ます。'; - - $lang->generated_code = '生成コード'; - $lang->widgetstyle= 'ウィジェットスタイル'; - - $lang->msg_widget_is_not_exists = '%s ウィジェットが見つかりません。'; - $lang->msg_widget_object_is_null = '%s ウィジェットのオブジェクトが生成出来ません。'; - $lang->msg_widget_proc_is_null = '%s ウィセットの proc() が実行出来ません。'; - $lang->msg_widget_skin_is_null = 'ウィセットスキンを選択してから正常に動作します。'; - - $lang->about_widget_code = '選択されたウィゼットで求められる下の項目の値を入力し、「コード生成」ボタンをクリックすると、
    一番下にテンプレートファイルに適用出来るコードが出力されます。'; - $lang->about_widget_code_in_page = '下に必要な値を入力した後、追加ボタンをクリックするとページ内にウィジェットが挿入されます。'; - $lang->about_widget = "ウィジェットまたはページモジュールに用いられる単体の構成要素です。内部モジュールまたは外部のOPEN API と連動が出来、設定によって様々な応用が可能です。XEのページモジュールまたはレイアウトモジュールを使用しなくても、「コード生成」機能で直接ウィジェットも追加出来ます。"; - - $lang->cmd_content_insert = '内容直接追加'; - $lang->cmd_box_widget_insert = 'ボックスウィジェット追加'; - $lang->cmd_remove_all_widgets = 'すべての内容削除'; - - $lang->cmd_widget_size = 'ウィジェットの大きさ'; - $lang->cmd_widget_align = 'ウィジェット整列'; - $lang->cmd_widget_align_left = '左へ'; - $lang->cmd_widget_align_right = '右へ'; - $lang->cmd_widget_margin = '外部余白'; - $lang->cmd_widget_padding = '内部余白'; - $lang->cmd_widget_border = 'ウィジェットボーダー'; - $lang->cmd_widget_border_solid = '実線'; - $lang->cmd_widget_border_dotted = '点線'; - $lang->cmd_widget_background_color = '背景色'; - $lang->cmd_widget_background_image_url = '背景イメージ'; - $lang->cmd_widget_background_image_repeat = '繰り返す'; - $lang->cmd_widget_background_image_no_repeat = '固定'; - $lang->cmd_widget_background_image_x_repeat = '横の繰り返し'; - $lang->cmd_widget_background_image_y_repeat = '縦の繰り返し'; - $lang->cmd_widget_background_image_x = '横の位置'; - $lang->cmd_widget_background_image_y = '縦の位置'; -?> +cmd_generate_code = 'コード生成'; + + $lang->widget_name = 'ウィジェット名'; + $lang->widget_maker = 'ウィジェット作者'; + $lang->widget_license = 'ライセンス'; + $lang->widget_history = '変更内容'; + $lang->widget_info = 'ウィジェット情報'; + $lang->widget_code = 'コード'; + $lang->widget_cache = 'キャッシュ'; + + $lang->widget_fix_width = '横幅固定'; + $lang->widget_width = '縦幅サイズ'; + $lang->widget_position = 'ポジッション'; + $lang->widget_position_none = '改行'; + $lang->widget_position_left = '左へ'; + $lang->widget_position_right = '右へ'; + $lang->widget_margin = '余白'; + $lang->widget_margin_top = '上'; + $lang->widget_margin_right = '右'; + $lang->widget_margin_bottom = '下 '; + $lang->widget_margin_left= '左'; + $lang->about_widget_fix_width = 'チェックすると横幅が固定されます。'; + $lang->about_widget_width = '縦幅サイズを選択して下さい。'; + $lang->about_widget_position = '一つのラインに多数のウィジェットを羅列したい場合は、ポジッションを選択して下さい。'; + $lang->about_widget_margin = '一つのラインに多数のウィジェットを羅列したい場合は、ポジッションを選択して下さい。'; + $lang->about_widget_cache = '指定された時間内にキャッシュされたデータが利用出来ます。'; + + $lang->generated_code = '生成コード'; + $lang->widgetstyle= 'ウィジェットスタイル'; + + $lang->msg_widget_is_not_exists = '%s ウィジェットが見つかりません。'; + $lang->msg_widget_object_is_null = '%s ウィジェットのオブジェクトが生成出来ません。'; + $lang->msg_widget_proc_is_null = '%s ウィセットの proc() が実行出来ません。'; + $lang->msg_widget_skin_is_null = 'ウィセットスキンを選択してから正常に動作します。'; + + $lang->about_widget_code = '選択されたウィゼットで求められる下の項目の値を入力し、「コード生成」ボタンをクリックすると、
    一番下にテンプレートファイルに適用出来るコードが出力されます。'; + $lang->about_widget_code_in_page = '下に必要な値を入力した後、追加ボタンをクリックするとページ内にウィジェットが挿入されます。'; + $lang->about_widget = "ウィジェットまたはページモジュールに用いられる単体の構成要素です。内部モジュールまたは外部のOPEN API と連動が出来、設定によって様々な応用が可能です。XEのページモジュールまたはレイアウトモジュールを使用しなくても、「コード生成」機能で直接ウィジェットも追加出来ます。"; + + $lang->cmd_content_insert = '内容直接追加'; + $lang->cmd_box_widget_insert = 'ボックスウィジェット追加'; + $lang->cmd_remove_all_widgets = 'すべての内容削除'; + + $lang->cmd_widget_size = 'ウィジェットの大きさ'; + $lang->cmd_widget_align = 'ウィジェット整列'; + $lang->cmd_widget_align_left = '左へ'; + $lang->cmd_widget_align_right = '右へ'; + $lang->cmd_widget_margin = '外部余白'; + $lang->cmd_widget_padding = '内部余白'; + $lang->cmd_widget_border = 'ウィジェットボーダー'; + $lang->cmd_widget_border_solid = '実線'; + $lang->cmd_widget_border_dotted = '点線'; + $lang->cmd_widget_background_color = '背景色'; + $lang->cmd_widget_background_image_url = '背景イメージ'; + $lang->cmd_widget_background_image_repeat = '繰り返す'; + $lang->cmd_widget_background_image_no_repeat = '固定'; + $lang->cmd_widget_background_image_x_repeat = '横の繰り返し'; + $lang->cmd_widget_background_image_y_repeat = '縦の繰り返し'; + $lang->cmd_widget_background_image_x = '横の位置'; + $lang->cmd_widget_background_image_y = '縦の位置'; +?> diff --git a/modules/widget/lang/ko.lang.php b/modules/widget/lang/ko.lang.php index c74e3c9b3..82aaee878 100644 --- a/modules/widget/lang/ko.lang.php +++ b/modules/widget/lang/ko.lang.php @@ -1,68 +1,68 @@ -cmd_generate_code = '코드생성'; - - $lang->widget_name = '위젯 이름'; - $lang->widget_maker = '위젯 제작자'; - $lang->widget_license = '라이선스'; - $lang->widget_history = '변경 이력'; - $lang->widget_info = '위젯 정보'; - $lang->widget_code = '코드'; - $lang->widget_cache = '캐시'; - - $lang->widget_fix_width = '크기 고정'; - $lang->widget_width = '가로 길이'; - $lang->widget_position = '위치'; - $lang->widget_position_none = '줄 바꿈'; - $lang->widget_position_left = '왼쪽'; - $lang->widget_position_right = '오른쪽'; - $lang->widget_margin = '외부 여백'; - $lang->widget_margin_top = '위'; - $lang->widget_margin_right = '오른쪽'; - $lang->widget_margin_bottom = '아래 '; - $lang->widget_margin_left= '왼쪽'; - $lang->about_widget_fix_width = '선택하시면 가로 길이가 고정됩니다.'; - $lang->about_widget_width = '가로 길이를 입력해주세요.'; - $lang->about_widget_position = '한 줄에 여러 개의 위젯을 나열하고 싶을 때는 위치를 선택해주세요.'; - $lang->about_widget_margin = '지정된 위젯의 상하좌우 여백을 지정할 수 있습니다.'; - $lang->about_widget_cache = '지정된 시간동안 캐시된 데이터를 이용할 수 있습니다.'; - - $lang->generated_code = '생성된 코드'; - $lang->widgetstyle= '위젯스타일'; - - $lang->msg_widget_is_not_exists = '%s 위젯을 찾을 수 없습니다.'; - $lang->msg_widget_object_is_null = '%s 위젯의 객체 생성을 할 수 없습니다.'; - $lang->msg_widget_proc_is_null = '%s 위젯의 proc() 를 실행할 수 없습니다.'; - $lang->msg_widget_skin_is_null = '위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다.'; - - $lang->about_widget_code = '선택하신 위젯에서 요구하는 아래 항목들의 값을 넣고 [코드생성]버튼을 누르시면 제일 아래 칸에 템플릿 파일에 적용할 수 있는 코드가 출력 됩니다.'; - $lang->about_widget_code_in_page = '아래 필요한 값들을 입력하신 후 추가 버튼을 누르시면 페이지 내에 위젯이 삽입됩니다.'; - $lang->about_widget = "위젯은 레이아웃이나 페이지 모듈에서 사용되는 작은 구성요소입니다.\n위젯은 내부 모듈 또는 외부 open api와 연동될 수도 있고, 설정을 통해 다양하게 응용될 수 있습니다.\nXE의 페이지 모듈이나 레이아웃 모듈을 사용하지 않더라도 [코드생성] 기능을 통해 직접 위젯 추가도 할 수 있습니다."; - - $lang->cmd_content_insert = '내용 직접 추가'; - $lang->cmd_box_widget_insert = '상자 위젯 추가'; - $lang->cmd_remove_all_widgets = '내용 모두 지우기'; - - $lang->cmd_widget_size = '위젯 크기'; - $lang->cmd_widget_align = '위젯 정렬'; - $lang->cmd_widget_align_left = '왼쪽'; - $lang->cmd_widget_align_right = '오른쪽'; - $lang->cmd_widget_margin = '외부 여백'; - $lang->cmd_widget_padding = '내부 여백'; - $lang->cmd_widget_border = '위젯 테두리'; - $lang->cmd_widget_border_solid = '실선'; - $lang->cmd_widget_border_dotted = '점선'; - $lang->cmd_widget_background_color = '배경색'; - $lang->cmd_widget_background_image_url = '배경 이미지'; - $lang->cmd_widget_background_image_repeat = '반복'; - $lang->cmd_widget_background_image_no_repeat = '고정'; - $lang->cmd_widget_background_image_x_repeat = '가로 반복'; - $lang->cmd_widget_background_image_y_repeat = '세로 반복'; - $lang->cmd_widget_background_image_x = '가로 위치'; - $lang->cmd_widget_background_image_y = '세로 위치'; -?> +cmd_generate_code = '코드생성'; + + $lang->widget_name = '위젯 이름'; + $lang->widget_maker = '위젯 제작자'; + $lang->widget_license = '라이선스'; + $lang->widget_history = '변경 이력'; + $lang->widget_info = '위젯 정보'; + $lang->widget_code = '코드'; + $lang->widget_cache = '캐시'; + + $lang->widget_fix_width = '크기 고정'; + $lang->widget_width = '가로 길이'; + $lang->widget_position = '위치'; + $lang->widget_position_none = '줄 바꿈'; + $lang->widget_position_left = '왼쪽'; + $lang->widget_position_right = '오른쪽'; + $lang->widget_margin = '외부 여백'; + $lang->widget_margin_top = '위'; + $lang->widget_margin_right = '오른쪽'; + $lang->widget_margin_bottom = '아래 '; + $lang->widget_margin_left= '왼쪽'; + $lang->about_widget_fix_width = '선택하시면 가로 길이가 고정됩니다.'; + $lang->about_widget_width = '가로 길이를 입력해주세요.'; + $lang->about_widget_position = '한 줄에 여러 개의 위젯을 나열하고 싶을 때는 위치를 선택해주세요.'; + $lang->about_widget_margin = '지정된 위젯의 상하좌우 여백을 지정할 수 있습니다.'; + $lang->about_widget_cache = '지정된 시간동안 캐시된 데이터를 이용할 수 있습니다.'; + + $lang->generated_code = '생성된 코드'; + $lang->widgetstyle= '위젯스타일'; + + $lang->msg_widget_is_not_exists = '%s 위젯을 찾을 수 없습니다.'; + $lang->msg_widget_object_is_null = '%s 위젯의 객체 생성을 할 수 없습니다.'; + $lang->msg_widget_proc_is_null = '%s 위젯의 proc() 를 실행할 수 없습니다.'; + $lang->msg_widget_skin_is_null = '위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다.'; + + $lang->about_widget_code = '선택하신 위젯에서 요구하는 아래 항목들의 값을 넣고 [코드생성]버튼을 누르시면 제일 아래 칸에 템플릿 파일에 적용할 수 있는 코드가 출력 됩니다.'; + $lang->about_widget_code_in_page = '아래 필요한 값들을 입력하신 후 추가 버튼을 누르시면 페이지 내에 위젯이 삽입됩니다.'; + $lang->about_widget = "위젯은 레이아웃이나 페이지 모듈에서 사용되는 작은 구성요소입니다.\n위젯은 내부 모듈 또는 외부 open api와 연동될 수도 있고, 설정을 통해 다양하게 응용될 수 있습니다.\nXE의 페이지 모듈이나 레이아웃 모듈을 사용하지 않더라도 [코드생성] 기능을 통해 직접 위젯 추가도 할 수 있습니다."; + + $lang->cmd_content_insert = '내용 직접 추가'; + $lang->cmd_box_widget_insert = '상자 위젯 추가'; + $lang->cmd_remove_all_widgets = '내용 모두 지우기'; + + $lang->cmd_widget_size = '위젯 크기'; + $lang->cmd_widget_align = '위젯 정렬'; + $lang->cmd_widget_align_left = '왼쪽'; + $lang->cmd_widget_align_right = '오른쪽'; + $lang->cmd_widget_margin = '외부 여백'; + $lang->cmd_widget_padding = '내부 여백'; + $lang->cmd_widget_border = '위젯 테두리'; + $lang->cmd_widget_border_solid = '실선'; + $lang->cmd_widget_border_dotted = '점선'; + $lang->cmd_widget_background_color = '배경색'; + $lang->cmd_widget_background_image_url = '배경 이미지'; + $lang->cmd_widget_background_image_repeat = '반복'; + $lang->cmd_widget_background_image_no_repeat = '고정'; + $lang->cmd_widget_background_image_x_repeat = '가로 반복'; + $lang->cmd_widget_background_image_y_repeat = '세로 반복'; + $lang->cmd_widget_background_image_x = '가로 위치'; + $lang->cmd_widget_background_image_y = '세로 위치'; +?> diff --git a/modules/widget/lang/ru.lang.php b/modules/widget/lang/ru.lang.php index 00084bfad..f10c0768b 100644 --- a/modules/widget/lang/ru.lang.php +++ b/modules/widget/lang/ru.lang.php @@ -1,46 +1,46 @@ -cmd_generate_code = 'Генерировать код'; - - $lang->widget_name = 'Имя виджета'; - $lang->widget_maker = 'Разработчик виджета'; - $lang->widget_license = 'License'; - $lang->widget_history = 'История обновлений'; - $lang->widget_info = 'Информация виджета'; - $lang->widget_code = 'Код'; - $lang->widget_cache = 'Кеш'; - - $lang->widget_fix_width = 'Фиксированная ширина'; - $lang->widget_width = 'Ширина'; - $lang->widget_position = 'Позиция'; - $lang->widget_position_none = 'Следующая строка'; - $lang->widget_position_left = 'Лево'; - $lang->widget_position_right = 'Право'; - $lang->widget_margin = 'Поля'; - $lang->widget_margin_top = 'Верхнее поле'; - $lang->widget_margin_right = 'Правое поле'; - $lang->widget_margin_bottom = 'Шижнее поле'; - $lang->widget_margin_left= 'Левое поле'; - $lang->about_widget_fix_width = 'Пожалуйста, установите для фиксирования ширины.'; - $lang->about_widget_width = 'Пожалуйста, установите ширину виджета.'; - $lang->about_widget_position = 'Пожалуйста, выберите позицию виджета, если Вы хотите отобразить несколько виджетов в одной строке.'; - $lang->about_widget_margin = "Вы можете установить поля виждета, т.е. его отступы со всех четырех сторон."; - $lang->about_widget_cache = 'Кешированные данные будут использоваться на указанный срок.'; - - $lang->generated_code = 'Сгенерированный код'; - $lang->widgetstyle= '위젯스타일'; - - $lang->msg_widget_is_not_exists = '%s виджет не существует.'; - $lang->msg_widget_object_is_null = '%s объектов виджета не могут быть созданы.'; - $lang->msg_widget_proc_is_null = 'proc() %s виджета не может быть исполнена.'; - $lang->msg_widget_skin_is_null = '위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다'; - - $lang->about_widget_code = 'Пожалуйста, сначала введите требуемые значения, и затем щелкните кнопку [Генерировать Код] для генерации кода и добавления его в файл шаблона.'; - $lang->about_widget_code_in_page = 'После ввода требуемых значений, нажмите пнопку [Добавить], чтобы вставить код виджета в страницу.'; - $lang->about_addon = "Виджет -- это маленькая самостоятельная программа, используемая в лейауте или модуле страниц.\n Он может быть связан с внутренним модулем или внешними открытыми API. Посредством его детального конфигурирования можно добиться широкого его применения. \n Вы можете напрямую добавить виджет, используя функцию генерирования кода без использования модулей страниц или лейаутов XE."; -?> +cmd_generate_code = 'Генерировать код'; + + $lang->widget_name = 'Имя виджета'; + $lang->widget_maker = 'Разработчик виджета'; + $lang->widget_license = 'License'; + $lang->widget_history = 'История обновлений'; + $lang->widget_info = 'Информация виджета'; + $lang->widget_code = 'Код'; + $lang->widget_cache = 'Кеш'; + + $lang->widget_fix_width = 'Фиксированная ширина'; + $lang->widget_width = 'Ширина'; + $lang->widget_position = 'Позиция'; + $lang->widget_position_none = 'Следующая строка'; + $lang->widget_position_left = 'Лево'; + $lang->widget_position_right = 'Право'; + $lang->widget_margin = 'Поля'; + $lang->widget_margin_top = 'Верхнее поле'; + $lang->widget_margin_right = 'Правое поле'; + $lang->widget_margin_bottom = 'Шижнее поле'; + $lang->widget_margin_left= 'Левое поле'; + $lang->about_widget_fix_width = 'Пожалуйста, установите для фиксирования ширины.'; + $lang->about_widget_width = 'Пожалуйста, установите ширину виджета.'; + $lang->about_widget_position = 'Пожалуйста, выберите позицию виджета, если Вы хотите отобразить несколько виджетов в одной строке.'; + $lang->about_widget_margin = "Вы можете установить поля виждета, т.е. его отступы со всех четырех сторон."; + $lang->about_widget_cache = 'Кешированные данные будут использоваться на указанный срок.'; + + $lang->generated_code = 'Сгенерированный код'; + $lang->widgetstyle= '위젯스타일'; + + $lang->msg_widget_is_not_exists = '%s виджет не существует.'; + $lang->msg_widget_object_is_null = '%s объектов виджета не могут быть созданы.'; + $lang->msg_widget_proc_is_null = 'proc() %s виджета не может быть исполнена.'; + $lang->msg_widget_skin_is_null = '위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다'; + + $lang->about_widget_code = 'Пожалуйста, сначала введите требуемые значения, и затем щелкните кнопку [Генерировать Код] для генерации кода и добавления его в файл шаблона.'; + $lang->about_widget_code_in_page = 'После ввода требуемых значений, нажмите пнопку [Добавить], чтобы вставить код виджета в страницу.'; + $lang->about_addon = "Виджет -- это маленькая самостоятельная программа, используемая в лейауте или модуле страниц.\n Он может быть связан с внутренним модулем или внешними открытыми API. Посредством его детального конфигурирования можно добиться широкого его применения. \n Вы можете напрямую добавить виджет, используя функцию генерирования кода без использования модулей страниц или лейаутов XE."; +?> diff --git a/modules/widget/lang/tr.lang.php b/modules/widget/lang/tr.lang.php index ba35b6419..04662f4f3 100644 --- a/modules/widget/lang/tr.lang.php +++ b/modules/widget/lang/tr.lang.php @@ -1,68 +1,68 @@ -cmd_generate_code = 'Kod Üret'; - - $lang->widget_name = 'Widget Adı'; - $lang->widget_maker = 'Geliştirici'; - $lang->widget_license = 'Lisans'; - $lang->widget_history = 'Güncelleme Tarihi'; - $lang->widget_info = 'Widget Bilgileri'; - $lang->widget_code = 'Kod'; - $lang->widget_cache = 'Önbellek'; - - $lang->widget_fix_width = 'Düzeltme Genişliği'; - $lang->widget_width = 'Genişlik'; - $lang->widget_position = 'Konum'; - $lang->widget_position_none = 'Sonraki Hat'; - $lang->widget_position_left = 'Sol'; - $lang->widget_position_right = 'Sağ'; - $lang->widget_margin = 'Kenar boşluğu'; - $lang->widget_margin_top = 'Üst-Kenar Boşluğu'; - $lang->widget_margin_right = 'Sağ-Kenar Boşluğu'; - $lang->widget_margin_bottom = 'Alt-Kenar Boşluğu'; - $lang->widget_margin_left= 'Sol-Kenar Boşluğu'; - $lang->about_widget_fix_width = 'Lütfen genişliği düzeltmeyi kontrol ediniz.'; - $lang->about_widget_width = 'Lütfen widgetın genişliğini ayarlayınız.'; - $lang->about_widget_position = 'Tek bir satırda birkaç widget görüntülemek istiyorsanız, lütfen konumlarını seçiniz.'; - $lang->about_widget_margin = "Widgetların üst, alt, sağ ve sol kenar boşluklarını belirleyebilirsiniz."; - $lang->about_widget_cache = 'Önbelleğe alınmış veriler, ayarlamış olduğunuz süre içinde kullanılabilir.'; - - $lang->generated_code = 'Üretilmiş Kod'; - $lang->widgetstyle= 'Widget Tarzı'; - - $lang->msg_widget_is_not_exists = "'%s' bulunmuyot."; - $lang->msg_widget_object_is_null = " '%s' nesnesi oluşturulamadı."; - $lang->msg_widget_proc_is_null = " '%s' işlemi tamamlanamadı."; - $lang->msg_widget_skin_is_null = "Widgetın dış görünümünü belirlemelisiniz."; - - $lang->about_widget_code = 'Kod üretip şablon dosyaya eklemek için lütfen ilk olarak gerekli değeri girin ve ardından [Kod Üret]e tıklayın.'; - $lang->about_widget_code_in_page = 'Gerekli değerleri girdikten sonra widget kodunu sayfaya eklemek için [Ekle]ye tıklayın.'; - $lang->about_widget = "Widget, yerleşim düzeninde veya sayfa modülünde kullanılan küçük bir serbest uygulamadır.\n Dahili modüle bağlanabileceği gibi, harici açık apilerle de bağlantı kurabilir. Yapılandırma ayarları yoluyla, geniş bir uygulama alanı vardır. \n [Kod Üret] fonksiyonunu kullanarak, XE sayfa modülüne veya yerleşim düzeni modülüne ihtiyaç duymadan widget ekleyebilirsiniz."; - - $lang->cmd_content_insert = "İçeriği kendiniz ekleyin."; - $lang->cmd_box_widget_insert = "Kutu widgetını ekleyin."; - $lang->cmd_remove_all_widgets = "Tüm widgetları kaldır."; - - $lang->cmd_widget_size = "Widget Boyutu"; - $lang->cmd_widget_align = "Hizalama Widgetı"; - $lang->cmd_widget_align_left = "Sol"; - $lang->cmd_widget_align_right = "Sağ"; - $lang->cmd_widget_margin = "Kenar Boşluğu"; - $lang->cmd_widget_padding = "Dolgu"; - $lang->cmd_widget_border = "Sınır"; - $lang->cmd_widget_border_solid = "Kesiksiz"; - $lang->cmd_widget_border_dotted = "Noktalı"; - $lang->cmd_widget_background_color = "Arkaplan Rengi"; - $lang->cmd_widget_background_image_url = "Arkaplan Resmi"; - $lang->cmd_widget_background_image_repeat = "Tekrar et"; - $lang->cmd_widget_background_image_no_repeat = "Tekrar yok."; - $lang->cmd_widget_background_image_x_repeat = "X Tekrar"; - $lang->cmd_widget_background_image_y_repeat = "Y Tekrar"; - $lang->cmd_widget_background_image_x = "X Konum"; - $lang->cmd_widget_background_image_y = "Y Konum"; -?> +cmd_generate_code = 'Kod Üret'; + + $lang->widget_name = 'Widget Adı'; + $lang->widget_maker = 'Geliştirici'; + $lang->widget_license = 'Lisans'; + $lang->widget_history = 'Güncelleme Tarihi'; + $lang->widget_info = 'Widget Bilgileri'; + $lang->widget_code = 'Kod'; + $lang->widget_cache = 'Önbellek'; + + $lang->widget_fix_width = 'Düzeltme Genişliği'; + $lang->widget_width = 'Genişlik'; + $lang->widget_position = 'Konum'; + $lang->widget_position_none = 'Sonraki Hat'; + $lang->widget_position_left = 'Sol'; + $lang->widget_position_right = 'Sağ'; + $lang->widget_margin = 'Kenar boşluğu'; + $lang->widget_margin_top = 'Üst-Kenar Boşluğu'; + $lang->widget_margin_right = 'Sağ-Kenar Boşluğu'; + $lang->widget_margin_bottom = 'Alt-Kenar Boşluğu'; + $lang->widget_margin_left= 'Sol-Kenar Boşluğu'; + $lang->about_widget_fix_width = 'Lütfen genişliği düzeltmeyi kontrol ediniz.'; + $lang->about_widget_width = 'Lütfen widgetın genişliğini ayarlayınız.'; + $lang->about_widget_position = 'Tek bir satırda birkaç widget görüntülemek istiyorsanız, lütfen konumlarını seçiniz.'; + $lang->about_widget_margin = "Widgetların üst, alt, sağ ve sol kenar boşluklarını belirleyebilirsiniz."; + $lang->about_widget_cache = 'Önbelleğe alınmış veriler, ayarlamış olduğunuz süre içinde kullanılabilir.'; + + $lang->generated_code = 'Üretilmiş Kod'; + $lang->widgetstyle= 'Widget Tarzı'; + + $lang->msg_widget_is_not_exists = "'%s' bulunmuyot."; + $lang->msg_widget_object_is_null = " '%s' nesnesi oluşturulamadı."; + $lang->msg_widget_proc_is_null = " '%s' işlemi tamamlanamadı."; + $lang->msg_widget_skin_is_null = "Widgetın dış görünümünü belirlemelisiniz."; + + $lang->about_widget_code = 'Kod üretip şablon dosyaya eklemek için lütfen ilk olarak gerekli değeri girin ve ardından [Kod Üret]e tıklayın.'; + $lang->about_widget_code_in_page = 'Gerekli değerleri girdikten sonra widget kodunu sayfaya eklemek için [Ekle]ye tıklayın.'; + $lang->about_widget = "Widget, yerleşim düzeninde veya sayfa modülünde kullanılan küçük bir serbest uygulamadır.\n Dahili modüle bağlanabileceği gibi, harici açık apilerle de bağlantı kurabilir. Yapılandırma ayarları yoluyla, geniş bir uygulama alanı vardır. \n [Kod Üret] fonksiyonunu kullanarak, XE sayfa modülüne veya yerleşim düzeni modülüne ihtiyaç duymadan widget ekleyebilirsiniz."; + + $lang->cmd_content_insert = "İçeriği kendiniz ekleyin."; + $lang->cmd_box_widget_insert = "Kutu widgetını ekleyin."; + $lang->cmd_remove_all_widgets = "Tüm widgetları kaldır."; + + $lang->cmd_widget_size = "Widget Boyutu"; + $lang->cmd_widget_align = "Hizalama Widgetı"; + $lang->cmd_widget_align_left = "Sol"; + $lang->cmd_widget_align_right = "Sağ"; + $lang->cmd_widget_margin = "Kenar Boşluğu"; + $lang->cmd_widget_padding = "Dolgu"; + $lang->cmd_widget_border = "Sınır"; + $lang->cmd_widget_border_solid = "Kesiksiz"; + $lang->cmd_widget_border_dotted = "Noktalı"; + $lang->cmd_widget_background_color = "Arkaplan Rengi"; + $lang->cmd_widget_background_image_url = "Arkaplan Resmi"; + $lang->cmd_widget_background_image_repeat = "Tekrar et"; + $lang->cmd_widget_background_image_no_repeat = "Tekrar yok."; + $lang->cmd_widget_background_image_x_repeat = "X Tekrar"; + $lang->cmd_widget_background_image_y_repeat = "Y Tekrar"; + $lang->cmd_widget_background_image_x = "X Konum"; + $lang->cmd_widget_background_image_y = "Y Konum"; +?> diff --git a/modules/widget/lang/vi.lang.php b/modules/widget/lang/vi.lang.php index 526b45209..3e8cb964a 100644 --- a/modules/widget/lang/vi.lang.php +++ b/modules/widget/lang/vi.lang.php @@ -1,70 +1,70 @@ -cmd_generate_code = 'Tạo Code'; - - $lang->widget_name = 'Tên Widget'; - $lang->widget_maker = 'Người tạo'; - $lang->widget_license = 'Giấy phép'; - $lang->widget_history = 'Lịch sử cập nhật'; - $lang->widget_info = 'Thông tin Widget'; - $lang->widget_code = 'Code'; - $lang->widget_cache = 'Bộ nhớ đệm'; - - $lang->widget_fix_width = 'Cố định chiều rộng'; - $lang->widget_width = 'Chiều rộng'; - $lang->widget_position = 'Vị trí'; - $lang->widget_position_none = 'Dòng tiếp theo'; - $lang->widget_position_left = 'Trái'; - $lang->widget_position_right = 'Phải'; - $lang->widget_margin = 'Lề'; - $lang->widget_margin_top = 'Lề trên'; - $lang->widget_margin_right = 'Lề phải'; - $lang->widget_margin_bottom = 'Lề dưới'; - $lang->widget_margin_left= 'Lề trái'; - $lang->about_widget_fix_width = 'Hãy kiểm tra để cố định chiều rộng.'; - $lang->about_widget_width = 'Hãy đặt chiều rộng cho Widget.'; - $lang->about_widget_position = 'Hãy chọn vị trí nếu bạn muốn nhiều Widget cùng hiển thị.'; - $lang->about_widget_margin = "Bạn có thể đặt lề của Widget: Trái, Phải, Trên, Dưới."; - $lang->about_widget_cache = 'Bộ nhớ đệm của Data có thể được sử dụng nếu bạn đặt thời gian cho nó.'; - - $lang->generated_code = 'Đã tạo Code'; - $lang->widgetstyle= 'Kiểu dáng Widget'; - - $lang->msg_widget_is_not_exists = "'%s' không tồn tại."; - $lang->msg_widget_object_is_null = "Đối tượng của '%s' đã không được tạo."; - $lang->msg_widget_proc_is_null = "proc() của '%s' đã không được thực hiện."; - $lang->msg_widget_skin_is_null = "Bạn cần phải chọn Skin cho Widget."; - - $lang->about_widget_code = 'Hãy nhập các thông tin cần thiết, sau đó bấm nút [Tạo Code] để lấy Code thêm vào giao diện.'; - $lang->about_widget_code_in_page = 'Sau khi nhập những thông tin cần thiết, bấm nút [Tạo Code] để chèn Code của Widget vào giao diện.'; - $lang->about_widget = "Widget là một ứng dụng nhỏ có thể đặt ở bất kì vị trí nào do người dùng lựa chọn.
    Nó có thể kết nối với những Module trong Website hay Open API bên ngoài và hiển thị nội dung của Module đó.
    Thông qua sự thiết lập cấu hình, nó có thể là một ứng dụng rộng dãi.
    Bạn có thể thêm một Widget bằng cách bấm nút [Tạo Code] để lấy Code thêm vào một Module hay trang nào đó."; - - $lang->cmd_content_insert = "Chèn nội dung của bạn"; - $lang->cmd_box_widget_insert = "Chèn khung Widget"; - $lang->cmd_remove_all_widgets = "Xóa tất cả Widget"; - - $lang->cmd_widget_size = "Kích thước"; - $lang->cmd_widget_align = "Căn chỉnh"; - $lang->cmd_widget_align_left = "Trái"; - $lang->cmd_widget_align_right = "Phải"; - $lang->cmd_widget_margin = "Lề"; - $lang->cmd_widget_padding = "Đệm"; - $lang->cmd_widget_border = "Viền"; - $lang->cmd_widget_border_solid = "Viền liền"; - $lang->cmd_widget_border_dotted = "Viền chấm"; - $lang->cmd_widget_background_color = "Màu nền"; - $lang->cmd_widget_background_image_url = "Hình nền"; - $lang->cmd_widget_background_image_repeat = "Lặp lại"; - $lang->cmd_widget_background_image_no_repeat = "Không lặp"; - $lang->cmd_widget_background_image_x_repeat = "Lặp chiều X"; - $lang->cmd_widget_background_image_y_repeat = "Lặp chiều Y"; - $lang->cmd_widget_background_image_x = "Vị trí X"; - $lang->cmd_widget_background_image_y = "Vị trí Y"; -?> +cmd_generate_code = 'Tạo Code'; + + $lang->widget_name = 'Tên Widget'; + $lang->widget_maker = 'Người tạo'; + $lang->widget_license = 'Giấy phép'; + $lang->widget_history = 'Lịch sử cập nhật'; + $lang->widget_info = 'Thông tin Widget'; + $lang->widget_code = 'Code'; + $lang->widget_cache = 'Bộ nhớ đệm'; + + $lang->widget_fix_width = 'Cố định chiều rộng'; + $lang->widget_width = 'Chiều rộng'; + $lang->widget_position = 'Vị trí'; + $lang->widget_position_none = 'Dòng tiếp theo'; + $lang->widget_position_left = 'Trái'; + $lang->widget_position_right = 'Phải'; + $lang->widget_margin = 'Lề'; + $lang->widget_margin_top = 'Lề trên'; + $lang->widget_margin_right = 'Lề phải'; + $lang->widget_margin_bottom = 'Lề dưới'; + $lang->widget_margin_left= 'Lề trái'; + $lang->about_widget_fix_width = 'Hãy kiểm tra để cố định chiều rộng.'; + $lang->about_widget_width = 'Hãy đặt chiều rộng cho Widget.'; + $lang->about_widget_position = 'Hãy chọn vị trí nếu bạn muốn nhiều Widget cùng hiển thị.'; + $lang->about_widget_margin = "Bạn có thể đặt lề của Widget: Trái, Phải, Trên, Dưới."; + $lang->about_widget_cache = 'Bộ nhớ đệm của Data có thể được sử dụng nếu bạn đặt thời gian cho nó.'; + + $lang->generated_code = 'Đã tạo Code'; + $lang->widgetstyle= 'Kiểu dáng Widget'; + + $lang->msg_widget_is_not_exists = "'%s' không tồn tại."; + $lang->msg_widget_object_is_null = "Đối tượng của '%s' đã không được tạo."; + $lang->msg_widget_proc_is_null = "proc() của '%s' đã không được thực hiện."; + $lang->msg_widget_skin_is_null = "Bạn cần phải chọn Skin cho Widget."; + + $lang->about_widget_code = 'Hãy nhập các thông tin cần thiết, sau đó bấm nút [Tạo Code] để lấy Code thêm vào giao diện.'; + $lang->about_widget_code_in_page = 'Sau khi nhập những thông tin cần thiết, bấm nút [Tạo Code] để chèn Code của Widget vào giao diện.'; + $lang->about_widget = "Widget là một ứng dụng nhỏ có thể đặt ở bất kì vị trí nào do người dùng lựa chọn.
    Nó có thể kết nối với những Module trong Website hay Open API bên ngoài và hiển thị nội dung của Module đó.
    Thông qua sự thiết lập cấu hình, nó có thể là một ứng dụng rộng dãi.
    Bạn có thể thêm một Widget bằng cách bấm nút [Tạo Code] để lấy Code thêm vào một Module hay trang nào đó."; + + $lang->cmd_content_insert = "Chèn nội dung của bạn"; + $lang->cmd_box_widget_insert = "Chèn khung Widget"; + $lang->cmd_remove_all_widgets = "Xóa tất cả Widget"; + + $lang->cmd_widget_size = "Kích thước"; + $lang->cmd_widget_align = "Căn chỉnh"; + $lang->cmd_widget_align_left = "Trái"; + $lang->cmd_widget_align_right = "Phải"; + $lang->cmd_widget_margin = "Lề"; + $lang->cmd_widget_padding = "Đệm"; + $lang->cmd_widget_border = "Viền"; + $lang->cmd_widget_border_solid = "Viền liền"; + $lang->cmd_widget_border_dotted = "Viền chấm"; + $lang->cmd_widget_background_color = "Màu nền"; + $lang->cmd_widget_background_image_url = "Hình nền"; + $lang->cmd_widget_background_image_repeat = "Lặp lại"; + $lang->cmd_widget_background_image_no_repeat = "Không lặp"; + $lang->cmd_widget_background_image_x_repeat = "Lặp chiều X"; + $lang->cmd_widget_background_image_y_repeat = "Lặp chiều Y"; + $lang->cmd_widget_background_image_x = "Vị trí X"; + $lang->cmd_widget_background_image_y = "Vị trí Y"; +?> diff --git a/modules/widget/lang/zh-CN.lang.php b/modules/widget/lang/zh-CN.lang.php index 839532425..30a5cd186 100644 --- a/modules/widget/lang/zh-CN.lang.php +++ b/modules/widget/lang/zh-CN.lang.php @@ -1,68 +1,68 @@ -cmd_generate_code = '生成代码'; - - $lang->widget_name = '控件名称'; - $lang->widget_maker = '控件作者'; - $lang->widget_license = '版权'; - $lang->widget_history = '更新事项'; - $lang->widget_info = '控件信息'; - $lang->widget_code = '代码'; - $lang->widget_cache = '缓冲'; - - $lang->widget_fix_width = '固定大小'; - $lang->widget_width = '宽度'; - $lang->widget_position = '位置'; - $lang->widget_position_none = '换行'; - $lang->widget_position_left = '左对齐'; - $lang->widget_position_right = '右对齐'; - $lang->widget_margin = '边距'; - $lang->widget_margin_top = '上'; - $lang->widget_margin_right = '右'; - $lang->widget_margin_bottom = '下'; - $lang->widget_margin_left= '左'; - $lang->about_widget_fix_width = '选择此项将固定控件显示宽度。'; - $lang->about_widget_width = '请输入宽度大小。'; - $lang->about_widget_position = '想要横向显示多个控件时,请选择位置。'; - $lang->about_widget_margin = '想要横向显示多个控件时,请设置边距。'; - $lang->about_widget_cache = '指定的时间内可以利用已缓冲的数据。'; - - $lang->generated_code = '已生成的代码'; - $lang->widgetstyle= '控件样式'; - - $lang->msg_widget_is_not_exists = '找不到%s控件!'; - $lang->msg_widget_object_is_null = '无法生成%s控件对象!'; - $lang->msg_widget_proc_is_null = '不能执行%s控件的 proc()!'; - $lang->msg_widget_skin_is_null = '请选择控件皮肤!'; - - $lang->about_widget_code = '输入所选控件所需要的下列各项后,按『代码生成』按钮,即可在页面下方获得可以用在布局模版代码片断。'; - $lang->about_widget_code_in_page = '输入下列各项必要值后,按『生成代码』按钮,即可把控件插入到页面当中。'; - $lang->about_widget = "控件是在布局或页面模块中使用的一种小部件。\n不仅可以关联内部模块或外部open api,而且通过设置可以用在多种用途。\n即使不使用XE的页面模块或布局模块,也可以通过『代码生成』功能直接可以添加相应控件。"; - - $lang->cmd_content_insert = "添加内容"; - $lang->cmd_box_widget_insert = "添加控件盒"; - $lang->cmd_remove_all_widgets = "清空内容"; - - $lang->cmd_widget_size = "大小"; - $lang->cmd_widget_align = "对齐"; - $lang->cmd_widget_align_left = "左对齐"; - $lang->cmd_widget_align_right = "右对齐"; - $lang->cmd_widget_margin = "外边距"; - $lang->cmd_widget_padding = "内填充"; - $lang->cmd_widget_border = "边框"; - $lang->cmd_widget_border_solid = "实线"; - $lang->cmd_widget_border_dotted = "点线"; - $lang->cmd_widget_background_color = "背景色"; - $lang->cmd_widget_background_image_url = "背景图片"; - $lang->cmd_widget_background_image_repeat = "平铺"; - $lang->cmd_widget_background_image_no_repeat = "固定"; - $lang->cmd_widget_background_image_x_repeat = "横向平铺"; - $lang->cmd_widget_background_image_y_repeat = "纵向平铺"; - $lang->cmd_widget_background_image_x = "水平位置"; - $lang->cmd_widget_background_image_y = "垂直位置"; -?> +cmd_generate_code = '生成代码'; + + $lang->widget_name = '控件名称'; + $lang->widget_maker = '控件作者'; + $lang->widget_license = '版权'; + $lang->widget_history = '更新事项'; + $lang->widget_info = '控件信息'; + $lang->widget_code = '代码'; + $lang->widget_cache = '缓冲'; + + $lang->widget_fix_width = '固定大小'; + $lang->widget_width = '宽度'; + $lang->widget_position = '位置'; + $lang->widget_position_none = '换行'; + $lang->widget_position_left = '左对齐'; + $lang->widget_position_right = '右对齐'; + $lang->widget_margin = '边距'; + $lang->widget_margin_top = '上'; + $lang->widget_margin_right = '右'; + $lang->widget_margin_bottom = '下'; + $lang->widget_margin_left= '左'; + $lang->about_widget_fix_width = '选择此项将固定控件显示宽度。'; + $lang->about_widget_width = '请输入宽度大小。'; + $lang->about_widget_position = '想要横向显示多个控件时,请选择位置。'; + $lang->about_widget_margin = '想要横向显示多个控件时,请设置边距。'; + $lang->about_widget_cache = '指定的时间内可以利用已缓冲的数据。'; + + $lang->generated_code = '已生成的代码'; + $lang->widgetstyle= '控件样式'; + + $lang->msg_widget_is_not_exists = '找不到%s控件!'; + $lang->msg_widget_object_is_null = '无法生成%s控件对象!'; + $lang->msg_widget_proc_is_null = '不能执行%s控件的 proc()!'; + $lang->msg_widget_skin_is_null = '请选择控件皮肤!'; + + $lang->about_widget_code = '输入所选控件所需要的下列各项后,按『代码生成』按钮,即可在页面下方获得可以用在布局模版代码片断。'; + $lang->about_widget_code_in_page = '输入下列各项必要值后,按『生成代码』按钮,即可把控件插入到页面当中。'; + $lang->about_widget = "控件是在布局或页面模块中使用的一种小部件。\n不仅可以关联内部模块或外部open api,而且通过设置可以用在多种用途。\n即使不使用XE的页面模块或布局模块,也可以通过『代码生成』功能直接可以添加相应控件。"; + + $lang->cmd_content_insert = "添加内容"; + $lang->cmd_box_widget_insert = "添加控件盒"; + $lang->cmd_remove_all_widgets = "清空内容"; + + $lang->cmd_widget_size = "大小"; + $lang->cmd_widget_align = "对齐"; + $lang->cmd_widget_align_left = "左对齐"; + $lang->cmd_widget_align_right = "右对齐"; + $lang->cmd_widget_margin = "外边距"; + $lang->cmd_widget_padding = "内填充"; + $lang->cmd_widget_border = "边框"; + $lang->cmd_widget_border_solid = "实线"; + $lang->cmd_widget_border_dotted = "点线"; + $lang->cmd_widget_background_color = "背景色"; + $lang->cmd_widget_background_image_url = "背景图片"; + $lang->cmd_widget_background_image_repeat = "平铺"; + $lang->cmd_widget_background_image_no_repeat = "固定"; + $lang->cmd_widget_background_image_x_repeat = "横向平铺"; + $lang->cmd_widget_background_image_y_repeat = "纵向平铺"; + $lang->cmd_widget_background_image_x = "水平位置"; + $lang->cmd_widget_background_image_y = "垂直位置"; +?> diff --git a/modules/widget/lang/zh-TW.lang.php b/modules/widget/lang/zh-TW.lang.php index 0ed694451..efc775e85 100644 --- a/modules/widget/lang/zh-TW.lang.php +++ b/modules/widget/lang/zh-TW.lang.php @@ -1,68 +1,68 @@ -cmd_generate_code = '建立原始碼'; - - $lang->widget_name = 'Widget名稱'; - $lang->widget_maker = 'Widget作者'; - $lang->widget_license = '版權'; - $lang->widget_history = '更新紀錄'; - $lang->widget_info = 'Widget資料'; - $lang->widget_code = '原始碼'; - $lang->widget_cache = '暫存'; - - $lang->widget_fix_width = '固定大小'; - $lang->widget_width = '寬度'; - $lang->widget_position = '位置'; - $lang->widget_position_none = '換行'; - $lang->widget_position_left = '靠左對齊'; - $lang->widget_position_right = '靠右對齊'; - $lang->widget_margin = '邊距'; - $lang->widget_margin_top = '上'; - $lang->widget_margin_right = '右'; - $lang->widget_margin_bottom = '下'; - $lang->widget_margin_left= '左'; - $lang->about_widget_fix_width = '選擇此項將固定Widget顯示寬度。'; - $lang->about_widget_width = '請輸入寬度大小。'; - $lang->about_widget_position = '想要橫向顯示多個Widget時,請選擇位置。'; - $lang->about_widget_margin = '想要橫向顯示多個Widget時,請設置邊距。'; - $lang->about_widget_cache = '指定的時間內可以利用已暫存的資料。'; - - $lang->generated_code = '已建立的原始碼'; - $lang->widgetstyle= 'Widget樣式'; - - $lang->msg_widget_is_not_exists = '找不到 %s Widget!'; - $lang->msg_widget_object_is_null = '無法建立 %s Widget目標!'; - $lang->msg_widget_proc_is_null = '無法執行 %s Widget的 proc()!'; - $lang->msg_widget_skin_is_null = '請選擇一個可正常使用的Widget面板'; - - $lang->about_widget_code = '輸入所選Widget所需要的各項資料後,按『建立原始碼』按鈕,即可在頁面下方獲得運用在版面設計中的部分原始碼。'; - $lang->about_widget_code_in_page = '輸入下列各項必要資料後,按『建立原始碼』按鈕,即可把Widget插入到頁面當中。'; - $lang->about_widget = "Widget是在版面或頁面模組中使用的一種元件。\n不僅可以連結內部模組或外部Open API,而且通過設置可以有許多種用途。\n即使不使用XE的頁面或版面設計模組,也可以通過『建立原始碼』功能直接新增相對應Widget。"; - - $lang->cmd_content_insert = "新增內容"; - $lang->cmd_box_widget_insert = "新增Widget Box"; - $lang->cmd_remove_all_widgets = "全部清空"; - - $lang->cmd_widget_size = "大小"; - $lang->cmd_widget_align = "對齊"; - $lang->cmd_widget_align_left = "靠左"; - $lang->cmd_widget_align_right = "靠右"; - $lang->cmd_widget_margin = "邊距"; - $lang->cmd_widget_padding = "內距"; - $lang->cmd_widget_border = "邊框"; - $lang->cmd_widget_border_solid = "實線"; - $lang->cmd_widget_border_dotted = "虛線"; - $lang->cmd_widget_background_color = "背景顏色"; - $lang->cmd_widget_background_image_url = "背景圖片"; - $lang->cmd_widget_background_image_repeat = "重複"; - $lang->cmd_widget_background_image_no_repeat = "不重複"; - $lang->cmd_widget_background_image_x_repeat = "水平重複"; - $lang->cmd_widget_background_image_y_repeat = "垂直重複"; - $lang->cmd_widget_background_image_x = "水平位置"; - $lang->cmd_widget_background_image_y = "垂直位置"; -?> +cmd_generate_code = '建立原始碼'; + + $lang->widget_name = 'Widget名稱'; + $lang->widget_maker = 'Widget作者'; + $lang->widget_license = '版權'; + $lang->widget_history = '更新紀錄'; + $lang->widget_info = 'Widget資料'; + $lang->widget_code = '原始碼'; + $lang->widget_cache = '暫存'; + + $lang->widget_fix_width = '固定大小'; + $lang->widget_width = '寬度'; + $lang->widget_position = '位置'; + $lang->widget_position_none = '換行'; + $lang->widget_position_left = '靠左對齊'; + $lang->widget_position_right = '靠右對齊'; + $lang->widget_margin = '邊距'; + $lang->widget_margin_top = '上'; + $lang->widget_margin_right = '右'; + $lang->widget_margin_bottom = '下'; + $lang->widget_margin_left= '左'; + $lang->about_widget_fix_width = '選擇此項將固定Widget顯示寬度。'; + $lang->about_widget_width = '請輸入寬度大小。'; + $lang->about_widget_position = '想要橫向顯示多個Widget時,請選擇位置。'; + $lang->about_widget_margin = '想要橫向顯示多個Widget時,請設置邊距。'; + $lang->about_widget_cache = '指定的時間內可以利用已暫存的資料。'; + + $lang->generated_code = '已建立的原始碼'; + $lang->widgetstyle= 'Widget樣式'; + + $lang->msg_widget_is_not_exists = '找不到 %s Widget!'; + $lang->msg_widget_object_is_null = '無法建立 %s Widget目標!'; + $lang->msg_widget_proc_is_null = '無法執行 %s Widget的 proc()!'; + $lang->msg_widget_skin_is_null = '請選擇一個可正常使用的Widget面板'; + + $lang->about_widget_code = '輸入所選Widget所需要的各項資料後,按『建立原始碼』按鈕,即可在頁面下方獲得運用在版面設計中的部分原始碼。'; + $lang->about_widget_code_in_page = '輸入下列各項必要資料後,按『建立原始碼』按鈕,即可把Widget插入到頁面當中。'; + $lang->about_widget = "Widget是在版面或頁面模組中使用的一種元件。\n不僅可以連結內部模組或外部Open API,而且通過設置可以有許多種用途。\n即使不使用XE的頁面或版面設計模組,也可以通過『建立原始碼』功能直接新增相對應Widget。"; + + $lang->cmd_content_insert = "新增內容"; + $lang->cmd_box_widget_insert = "新增Widget Box"; + $lang->cmd_remove_all_widgets = "全部清空"; + + $lang->cmd_widget_size = "大小"; + $lang->cmd_widget_align = "對齊"; + $lang->cmd_widget_align_left = "靠左"; + $lang->cmd_widget_align_right = "靠右"; + $lang->cmd_widget_margin = "邊距"; + $lang->cmd_widget_padding = "內距"; + $lang->cmd_widget_border = "邊框"; + $lang->cmd_widget_border_solid = "實線"; + $lang->cmd_widget_border_dotted = "虛線"; + $lang->cmd_widget_background_color = "背景顏色"; + $lang->cmd_widget_background_image_url = "背景圖片"; + $lang->cmd_widget_background_image_repeat = "重複"; + $lang->cmd_widget_background_image_no_repeat = "不重複"; + $lang->cmd_widget_background_image_x_repeat = "水平重複"; + $lang->cmd_widget_background_image_y_repeat = "垂直重複"; + $lang->cmd_widget_background_image_x = "水平位置"; + $lang->cmd_widget_background_image_y = "垂直位置"; +?> diff --git a/modules/widget/tpl/css/widget.css b/modules/widget/tpl/css/widget.css index 8a46287c3..bdb66f1fc 100644 --- a/modules/widget/tpl/css/widget.css +++ b/modules/widget/tpl/css/widget.css @@ -1,62 +1,62 @@ -@charset "utf-8"; - -.widget_title { border:1px solid #DDDDDD; margin:10px 5px 5px 0; padding:3px; } -.widget_mid_list { margin:0 0 5px 10px; } -.widget_description { color:#AAAAAA; border-top:1px dotted #EEEEEE; margin:5px 0 0 0; padding:5px 0 0 0; } -#colorset_area { margin-top:.5em; } - -#colorset_area .header { float:left; margin-right:.5em; padding-top:.2em;} -#colorset_area .footer { float:left; } - -#zonePageContent { overflow:hidden; width:100%; padding:none !important; margin:none !important;} - -.pageAddContent { width:700px; } - -.widgetOutput { float:left; cursor:move; z-index:998; overflow:hidden; position:relative; width:100%; } - -.widgetOutput .widgetBorder { border:1px solid #C7DBE9; z-index:999; } -.widgetOutput .widgetBoxBorder { border:1px solid #D2E9C7; z-index:999; } - -.widgetOutput .widgetResize { background:transparent url("../images/btn_resize.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:1px; right:1px; cursor:pointer; z-index:1000;} -.widgetOutput .widgetResizeLeft { background:transparent url("../images/btn_resize_left.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:0; left:1px; cursor:pointer; z-index:1000;} -.widgetOutput .widgetBoxResize { background:transparent url("../images/btn_resize.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:1px; right:1px; cursor:pointer; z-index:1000;} -.widgetOutput .widgetBoxResizeLeft { background:transparent url("../images/btn_resize_left.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:0; left:1px; cursor:pointer; z-index:1000;} - -.widgetButtons { z-index:9999; overflow:hidden; *zoom:1; float:left; padding:3px; position:absolute; visibility:hidden;} -#widgetButton { background-color:#C7DBE9;left:0; top:0;} -#widgetBoxButton { background-color:#D2E9C7; right:0; top:0;} -.widgetButtons div { float:left; } -.widgetButtons .widgetStyle { background:transparent url("../images/widgetstyle_setup.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} -.widgetButtons .widgetSetup { background:transparent url("../images/widget_setup.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} -.widgetButtons .widgetCopy { background:transparent url("../images/widget_copy.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} -.widgetButtons .widgetSize { background:transparent url("../images/widget_size.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} -.widgetButtons .widgetRemove { background:transparent url("../images/widget_remove.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} -.widgetButtons .widgetBoxCopy { background:transparent url("../images/widget_copy.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} -.widgetButtons .widgetBoxSize { background:transparent url("../images/widget_size.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} -.widgetButtons .widgetBoxRemove { background:transparent url("../images/widget_remove.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} - -#pageSizeLayer { width:500px; overflow:hidden; border:1px solid #888888; background:#FFFFFF; z-index:2000; position:absolute; } -#pageSizeLayer table { border:0; width:100%; table-layout:fixed; } -#pageSizeLayer table th { padding:4px 0 4px 0; background-color:#DEDEDE; text-align:center; color:#888888;} -#pageSizeLayer table th.line { border-top:1px dotted #EEEEEE; } -#pageSizeLayer table td { padding:4px 10px 4px 10px; background-color:#EFEFEF;} -#pageSizeLayer table td div { margin-bottom:5px; } -#pageSizeLayer table td.line { border-top:1px dotted #999999; } -#pageSizeLayer table td.buttonBox { background-color:#FFFFFF; white-space:nowrap; overflow:hidden; vertical-align:top; text-align:center; border-top:1px solid #888888; color:#DDDDDD;} -#pageSizeLayer .input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:60px; } -#pageSizeLayer .full_input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:90%; } -#pageSizeLayer .small_input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:20px; } -#pageSizeLayer .color_input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:44px; } -#pageSizeLayer .submit { width:90%; border:1px solid #DEDEDE; background-color:#FFFFFF;} - -.help { padding:5px 0; background-color:#EFEFEF; border-top:1px solid #CCCCCC; } - -ul.midCommand { float:left; margin:0 0 0 10px;; padding:0; *zoom:1; } -ul.midCommand li { display:block; margin-bottom:5px; list-style:none;} - -a.widgetStyle { float:left; margin:0 10px 10px 0; border:1px solid #fff; overflow:hidden; *zoom:1; width:96px; height:96px; position:relative; text-decoration:none;} -a.widgetStyle:hover { border:1px dashed #ccc; } -a.widgetStyle:hover span { display:none; } -a.widgetStyle.selected { border:1px dashed #999; } -a.widgetStyle img {width:96px; height:96px; margin:1px; } -a.widgetStyle span { position:absolute; left:0; bottom:0; display:block; width:96px; background-color:#888; color:#fff; padding:4px 3px 3px 3px; opacity:.8; filter:alpha(opacity=80); text-align:center; font-family:tahoma;} +@charset "utf-8"; + +.widget_title { border:1px solid #DDDDDD; margin:10px 5px 5px 0; padding:3px; } +.widget_mid_list { margin:0 0 5px 10px; } +.widget_description { color:#AAAAAA; border-top:1px dotted #EEEEEE; margin:5px 0 0 0; padding:5px 0 0 0; } +#colorset_area { margin-top:.5em; } + +#colorset_area .header { float:left; margin-right:.5em; padding-top:.2em;} +#colorset_area .footer { float:left; } + +#zonePageContent { overflow:hidden; width:100%; padding:none !important; margin:none !important;} + +.pageAddContent { width:700px; } + +.widgetOutput { float:left; cursor:move; z-index:998; overflow:hidden; position:relative; width:100%; } + +.widgetOutput .widgetBorder { border:1px solid #C7DBE9; z-index:999; } +.widgetOutput .widgetBoxBorder { border:1px solid #D2E9C7; z-index:999; } + +.widgetOutput .widgetResize { background:transparent url("../images/btn_resize.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:1px; right:1px; cursor:pointer; z-index:1000;} +.widgetOutput .widgetResizeLeft { background:transparent url("../images/btn_resize_left.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:0; left:1px; cursor:pointer; z-index:1000;} +.widgetOutput .widgetBoxResize { background:transparent url("../images/btn_resize.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:1px; right:1px; cursor:pointer; z-index:1000;} +.widgetOutput .widgetBoxResizeLeft { background:transparent url("../images/btn_resize_left.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:0; left:1px; cursor:pointer; z-index:1000;} + +.widgetButtons { z-index:9999; overflow:hidden; *zoom:1; float:left; padding:3px; position:absolute; visibility:hidden;} +#widgetButton { background-color:#C7DBE9;left:0; top:0;} +#widgetBoxButton { background-color:#D2E9C7; right:0; top:0;} +.widgetButtons div { float:left; } +.widgetButtons .widgetStyle { background:transparent url("../images/widgetstyle_setup.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} +.widgetButtons .widgetSetup { background:transparent url("../images/widget_setup.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} +.widgetButtons .widgetCopy { background:transparent url("../images/widget_copy.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} +.widgetButtons .widgetSize { background:transparent url("../images/widget_size.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} +.widgetButtons .widgetRemove { background:transparent url("../images/widget_remove.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} +.widgetButtons .widgetBoxCopy { background:transparent url("../images/widget_copy.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} +.widgetButtons .widgetBoxSize { background:transparent url("../images/widget_size.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} +.widgetButtons .widgetBoxRemove { background:transparent url("../images/widget_remove.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;} + +#pageSizeLayer { width:500px; overflow:hidden; border:1px solid #888888; background:#FFFFFF; z-index:2000; position:absolute; } +#pageSizeLayer table { border:0; width:100%; table-layout:fixed; } +#pageSizeLayer table th { padding:4px 0 4px 0; background-color:#DEDEDE; text-align:center; color:#888888;} +#pageSizeLayer table th.line { border-top:1px dotted #EEEEEE; } +#pageSizeLayer table td { padding:4px 10px 4px 10px; background-color:#EFEFEF;} +#pageSizeLayer table td div { margin-bottom:5px; } +#pageSizeLayer table td.line { border-top:1px dotted #999999; } +#pageSizeLayer table td.buttonBox { background-color:#FFFFFF; white-space:nowrap; overflow:hidden; vertical-align:top; text-align:center; border-top:1px solid #888888; color:#DDDDDD;} +#pageSizeLayer .input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:60px; } +#pageSizeLayer .full_input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:90%; } +#pageSizeLayer .small_input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:20px; } +#pageSizeLayer .color_input { background:#FFFFFF; border:1px solid #AAAAAA; padding:1px; font:8pt verdana; width:44px; } +#pageSizeLayer .submit { width:90%; border:1px solid #DEDEDE; background-color:#FFFFFF;} + +.help { padding:5px 0; background-color:#EFEFEF; border-top:1px solid #CCCCCC; } + +ul.midCommand { float:left; margin:0 0 0 10px;; padding:0; *zoom:1; } +ul.midCommand li { display:block; margin-bottom:5px; list-style:none;} + +a.widgetStyle { float:left; margin:0 10px 10px 0; border:1px solid #fff; overflow:hidden; *zoom:1; width:96px; height:96px; position:relative; text-decoration:none;} +a.widgetStyle:hover { border:1px dashed #ccc; } +a.widgetStyle:hover span { display:none; } +a.widgetStyle.selected { border:1px dashed #999; } +a.widgetStyle img {width:96px; height:96px; margin:1px; } +a.widgetStyle span { position:absolute; left:0; bottom:0; display:block; width:96px; background-color:#888; color:#fff; padding:4px 3px 3px 3px; opacity:.8; filter:alpha(opacity=80); text-align:center; font-family:tahoma;} diff --git a/modules/widget/tpl/filter/style_generate_code_in_page.xml b/modules/widget/tpl/filter/style_generate_code_in_page.xml index bbb543a24..5704533dc 100644 --- a/modules/widget/tpl/filter/style_generate_code_in_page.xml +++ b/modules/widget/tpl/filter/style_generate_code_in_page.xml @@ -1,9 +1,9 @@ - - - - - - - - - + + + + + + + + + diff --git a/modules/widget/tpl/js/widget.js b/modules/widget/tpl/js/widget.js index ce8668a6a..c4a2404c7 100644 --- a/modules/widget/tpl/js/widget.js +++ b/modules/widget/tpl/js/widget.js @@ -1,1353 +1,1353 @@ -/** - * @file modules/widget/js/widget.js - * @author NHN (developers@xpressengine.com) - * @brief 위젯 관리용 자바스크립트 - **/ - -/* DOM 속성을 구하기 위한 몇가지 함수들.. */ -// style의 값을 구하는게 IE랑 그외가 다름. -function getStyle(obj) { - var style = obj.getAttribute("style"); - if(!style) - { - style = obj.style; - } - if(typeof(style)=="object") style = style["cssText"]; - return style; -} - -// float: 값을 구하는게 IE랑 그외가 다름 -function getFloat(obj) { - var cssFloat = xIE4Up?obj.style.styleFloat:obj.style.cssFloat; - if(!cssFloat) cssFloat = 'left'; - return cssFloat; -} -function setFloat(obj, fl) { - if(xIE4Up) obj.style.styleFloat = fl; - else obj.style.cssFloat = fl; -} - -// padding값을 구하는 함수 (없을 경우 0으로 세팅), zbxe의 위젯에서만 사용 -function getPadding(obj, direct) { - var padding = obj.getAttribute("widget_padding_"+direct); - if(!padding || padding == null) padding = 0; - return padding; -} - - -/* 위젯 핸들링 시작 */ -var zonePageObj = null; -var zoneModuleSrl = 0; -function doStartPageModify(zoneID, module_srl) { - zonePageObj = xGetElementById(zoneID); - zoneModuleSrl = module_srl; - - // 위젯 크기/여백 조절 레이어를 가장 밖으로 뺌 - jQuery('#tmpPageSizeLayer') - .attr('id', 'pageSizeLayer') - .css({position:'absolute',left:0,top:0}) - .hide() - .appendTo('body') - .find('>form') - .submit(function(){ doApplyWidgetSize(this); return false; }); - - // 모든 위젯들의 크기를 정해진 크기로 맞춤 - doFitBorderSize(); - - // 드래그와 리사이즈와 관련된 이벤트 리스너 생성 - xAddEventListener(document,"click",doCheckWidget); - xAddEventListener(document,"mousedown",doCheckWidgetDrag); - xAddEventListener(document,'mouseover',widgetSetup); -} - - -// 내용 모두 삭제 -function removeAllWidget() { - if(!confirm(confirm_delete_msg)) return; - restoreWidgetButtons(); - xInnerHtml(zonePageObj,''); -} - -/** - * 특정 영역에 편집된 위젯들을 약속된 태그로 변환하여 return - **/ -function getWidgetContent(obj) { - var html = ""; - if(typeof(obj)=='undefined' || !obj) obj = zonePageObj; - - var widget = null; - jQuery('div.widgetOutput',obj).each(function(){ - if(jQuery(this).parent().get(0) != obj) return; - widget = jQuery(this).attr('widget'); - switch(widget) { - case 'widgetBox' : - html += getWidgetBoxCode(this, widget); - break; - case 'widgetContent' : - html += getContentWidgetCode(this, widget); - break; - default : - html += getWidgetCode(this, widget); - break; - } - }); - - return html; -} - -// 컨텐츠 위젯 코드 구함 -function getContentWidgetCode(childObj, widget) { - var cobj = childObj.firstChild; - - var widgetContent = jQuery('div.widgetContent',childObj); - var body = ''; - var document_srl = 0; - var attrs =''; - - if(widgetContent.size() > 0){ - document_srl = jQuery(childObj).attr('document_srl'); - if(document_srl>0){ - body = ''; - }else{ - body = widgetContent.html(); - } - - - for(var i=0;i'; - }else{ - return ''; - } -} - -// 위젯 박스 코드 구함 -function getWidgetBoxCode(childObj, widget) { - - var attrs = ""; - for(var i=0;i0){ - o = jQuery('.widget_inner',childObj); - o = o.get(0); - }else{ - o = jQuery('.nullWidget',childObj).get(0); - } - - var body = getWidgetContent(o); - return '
    '+body+'
    '; - -/* - var cobj = childObj.firstChild; - while(cobj) { - if(cobj.className == "widgetBorder" || cobj.className == "widgetBoxBorder") { - var c2obj = cobj.firstChild; - while(c2obj) { - if(c2obj.className == "nullWidget") { - var body = getWidgetContent(c2obj); - return '
    '+body+'
    '; - } - c2obj = c2obj.nextSibling; - } - } - cobj = cobj.nextSibling; - } -*/ -} - - - - -// 일반 위젯 컨텐츠 코드 구함 -function getWidgetCode(childObj, widget) { - var attrs = ""; - var code = ""; - for(var i=0;i'; -} - -/** - * 직접 내용을 입력하는 위젯을 추가 - **/ -// 팝업 띄움 -function doAddContent(mid) { - var url = request_uri.setQuery('module','widget').setQuery('act','dispWidgetAdminAddContent').setQuery('module_srl',zoneModuleSrl).setQuery('mid',mid); - popopen(url, "addContent"); -} - -// 직접 내용을 입력하기 위한 에디터 활성화 작업 및 form 데이터 입력 -function doSyncPageContent() { - if(opener && opener.selectedWidget) { - - var fo_obj = xGetElementById("content_fo"); - var sel_obj = opener.selectedWidget; - fo_obj.style.value = getStyle(opener.selectedWidget); - fo_obj.widget_padding_left.value = getPadding(sel_obj, 'left'); - fo_obj.widget_padding_right.value = getPadding(sel_obj,'right'); - fo_obj.widget_padding_bottom.value = getPadding(sel_obj,'bottom'); - fo_obj.widget_padding_top.value = getPadding(sel_obj,'top'); - - var obj = sel_obj.firstChild; - while(obj && obj.className != "widgetContent") obj = obj.nextSibling; - if(obj && obj.className == "widgetContent") { - if(!fo_obj.document_srl || fo_obj.document_srl.value == 0) { - try { - var content = Base64.decode(xInnerHtml(obj)); - content = editorReplacePath(content); - xGetElementById("content_fo").content.value = content; - xe.Editors["1"].exec("SET_IR", [content]); - } - catch(e) - { - } - } - } - } - - if(typeof(editorStart)!='undefined') editorStart(1, "module_srl", "content", false, 400 ); - //editor_upload_start(1); - - setFixedPopupSize(); -} - -// 부모창에 위젯을 추가 -function addContentWidget(fo_obj) { - var editor_sequence = fo_obj.getAttribute('editor_sequence'); - var mid = fo_obj.mid.value; - var module_srl = fo_obj.module_srl.value; - var document_srl = fo_obj.document_srl.value; - var content = editorGetContent(editor_sequence); - var response_tags = new Array('error','message','document_srl'); - var params = new Array(); - params['editor_sequence'] = editor_sequence; - params['content'] = content; - params['module_srl'] = module_srl; - params['document_srl'] = document_srl; - exec_xml('widget',"procWidgetInsertDocument",params,completeAddContent,response_tags,params,fo_obj); - return false; - -} - -function completeAddContent(ret_obj, response_tags, params, fo_obj) { - var document_srl = ret_obj['document_srl']; - - var contentWidget = opener.jQuery('div.widgetOutput[widget=widgetContent][document_srl='+document_srl+']'); - var attr = null; - if(contentWidget.size()>0) { - attr = contentWidget.get(0).attributes; - } - - var editor_sequence = params['editor_sequence']; - var content = editorGetContent(editor_sequence); - - var tpl = ''+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+content+'
    '+ - '
    '+ - ''+ - '
    '; - - var oTpl = jQuery(tpl); - if(attr) { - jQuery.each(attr,function(i){ - if(!oTpl.attr(attr[i].name)){ - oTpl.attr(attr[i].name,attr[i].value); - } - }); - } - - oTpl = jQuery('
    ').append(oTpl); - tpl = oTpl.html(); - opener.doAddWidgetCode(tpl); - window.close(); -} - -/* 박스 위젯 추가 */ -function doAddWidgetBox() { - var tpl = ''+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '; - xInnerHtml(zonePageObj, xInnerHtml(zonePageObj)+tpl); - doFitBorderSize(); -} - - -/* 일반 위젯을 추가하기 위해 위젯 팝업창을 띄움 */ -function doAddWidget(fo) { - var sel = fo.widget_list; - var idx = sel.selectedIndex; - var val = sel.options[idx].value; - var module_srl = fo.module_srl.value; - - var url = request_uri.setQuery('module','widget').setQuery('act','dispWidgetGenerateCodeInPage').setQuery('selected_widget', val).setQuery('module_srl', module_srl); - popopen(url,'GenerateWidgetCode'); -} - - - -// widgetBorder에 height를 widgetOutput와 맞춰줌 -function doFitBorderSize() { - var obj_list = xGetElementsByClassName('widgetBorder', zonePageObj); - for(var i=0;i-1) { - var pos = tmp.indexOf(""); - var cssfile = tmp.substr(9,eos-9); - if(cssfile.indexOf('.js')>-1) { - tmp = tmp.substr(eos); - continue; - } - if(!cssfile) break; - tmp = tmp.substr(eos); - - var cssfile = request_uri+'/'+cssfile; - if(typeof(document.createStyleSheet)=='undefined') { - var css =''; - var dummy = xCreateElement("DIV"); - xInnerHtml(dummy , css); - document.body.appendChild(dummy); - } else { - document.createStyleSheet(cssfile,0); - } - } - - // widget 코드에서 javascript 부분을 빼서 eval후 결과값을 대체함 - checkDocumentWrite = true; ///< document.write(ln)등의 함수값을 바로 사용하기 위한 check flag - - // widget_code의 javascript 부분 수정 - var tmp = widget_code.toLowerCase(); - while(tmp.indexOf("-1) { - - var pos = tmp.indexOf("")+9; - - var script = widget_code.substr(pos,length); - script = script.replace(/^]*)>/i,'').replace(/<\/script>$/i,''); - - writedText = null; - eval(script); - widget_code = widget_code.substr(0,pos)+writedText+widget_code.substr(pos+length); - tmp = widget_code.toLowerCase(); - } - - - - // html 추가 - var dummy = xCreateElement('div'); - xInnerHtml(dummy, widget_code); - var obj = dummy.childNodes[0]; - - if(selectedWidget && selectedWidget.getAttribute("widget")) { - var o = jQuery('div.widget_inner',selectedWidget); - var n = jQuery('div.widget_inner',obj); - - if(n.size()==0) n = jQuery('div.nullWidget',obj); - if(o.size()==0) o = jQuery('div.nullWidget',selectedWidget); - - n.html(o.html()); - - - selectedWidget.parentNode.insertBefore(obj, selectedWidget); - selectedWidget.parentNode.removeChild(selectedWidget); - } else { - xGetElementById('zonePageContent').appendChild(obj); - } - checkDocumentWrite = false; - selectedWidget = null; - - /* - //zoneObj.style.visibility = 'hidden'; - zoneObj.style.opacity = 0.2; - zoneObj.style.filter = "alpha(opacity=20)"; - - // 위젯 추가후 페이지 리로딩 - var tpl = getWidgetContent(); - - var fo_obj = xGetElementById('pageFo'); - fo_obj.content.value = tpl; - fo_obj.mid.value = current_mid; - fo_obj.submit(); - */ -} - -// 클릭 이벤트시 위젯의 수정/제거/이벤트 무효화 처리 -function doCheckWidget(e) { - var evt = new xEvent(e); if(!evt.target) return; - var obj = evt.target; - - selectedWidget = null; - - var pObj = obj.parentNode; - while(pObj) { - if(pObj.id == "pageSizeLayer") return; - pObj = pObj.parentNode; - } - - doHideWidgetSizeSetup(); - // 위젯 설정 - if(obj.className == 'widgetSetup') { - var p_obj = obj.parentNode.parentNode; - var widget = p_obj.getAttribute("widget"); - if(!widget) return; - selectedWidget = p_obj; - if(widget == 'widgetContent') popopen(request_uri+"?module=widget&act=dispWidgetAdminAddContent&module_srl="+zoneModuleSrl+"&document_srl="+p_obj.getAttribute("document_srl")+'&mid='+current_mid, "addContent"); - else popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget+"&widgetstyle="+widgetstyle,'GenerateCodeInPage'); - return; - - // 위젯 스타일 - } else if(obj.className == 'widgetStyle') { - var p_obj = obj.parentNode.parentNode; - var widget = p_obj.getAttribute("widget"); - var widgetstyle = p_obj.getAttribute("widgetstyle"); - if(!widget) return; - selectedWidget = p_obj; - popopen(request_uri+"?module=widget&act=dispWidgetStyleGenerateCodeInPage&selected_widget="+widget+"&widgetstyle="+widgetstyle,'GenerateCodeInPage'); - return; - - // 위젯 복사 - } else if(obj.className == 'widgetCopy' && obj.parentNode.parentNode.className == 'widgetOutput') { - p_obj = obj.parentNode.parentNode; - restoreWidgetButtons(); - - if(p_obj.getAttribute('widget')=='widgetContent' && p_obj.getAttribute('document_srl') ) { - var response_tags = new Array('error','message','document_srl'); - var params = new Array(); - params['document_srl'] =p_obj.getAttribute('document_srl'); - exec_xml('widget','procWidgetCopyDocument', params, completeCopyWidgetContent, response_tags, params, p_obj); - return; - } else { - var dummy = xCreateElement("DIV"); - xInnerHtml(dummy,xInnerHtml(p_obj)); - - dummy.widget_sequence = ''; - dummy.className = "widgetOutput"; - for(var i=0;i 0) return; - - doHideWidgetSizeSetup(); - - if(obj.className == 'widgetSetup' || obj.className == 'widgetStyle' || obj.className == 'widgetCopy' || obj.className == 'widgetBoxCopy' || obj.className == 'widgetSize' || obj.className == 'widgetBoxSize' || obj.className == 'widgetRemove' || obj.className == 'widgetBoxRemove') return; - - p_obj = obj; - while(p_obj) { - if(p_obj.className == 'widgetOutput' || p_obj.className == 'widgetResize' || p_obj.className == 'widgetResizeLeft' || p_obj.className == 'widgetBoxResize' || p_obj.className == 'widgetBoxResizeLeft') { - widgetDragEnable(p_obj, widgetDragStart, widgetDrag, widgetDragEnd); - widgetMouseDown(e); - return; - } - p_obj = p_obj.parentNode; - } -} - -function _getInt(val) { - if(!val || val == "null") return 0; - if(parseInt(val,10)==NaN) return 0; - return parseInt(val,10); -} - -// 위젯 크기 조절 레이어를 보여줌 -var selectedSizeWidget = null; -function doShowWidgetSizeSetup(px, py, obj) { - var layer = jQuery('#pageSizeLayer'); - var form = layer.find('>form:first'); - var obj = jQuery(obj); - - if (!form.length) return; - - selectedSizeWidget = obj[0]; - - var opts = { - widget_align : obj.css('float'), - - width : obj[0].style.width, - height : obj[0].style.height, - - padding_left : _getInt(obj.attr('widget_padding_left')), - padding_right : _getInt(obj.attr('widget_padding_right')), - padding_top : _getInt(obj.attr('widget_padding_top')), - padding_bottom : _getInt(obj.attr('widget_padding_bottom')), - - margin_left : _getInt(obj[0].style.marginLeft), - margin_right : _getInt(obj[0].style.marginRight), - margin_top : _getInt(obj[0].style.marginTop), - margin_bottom : _getInt(obj[0].style.marginBottom), - - border_top_color : transRGB2Hex(obj[0].style.borderTopColor), - border_top_thick : obj[0].style.borderTopWidth.replace(/px$/i, ''), - border_top_type : obj[0].style.borderTopStyle, - - border_bottom_color : transRGB2Hex(obj[0].style.borderBottomColor), - border_bottom_thick : obj[0].style.borderBottomWidth.replace(/px$/i, ''), - border_bottom_type : obj[0].style.borderBottomStyle, - - border_right_color : transRGB2Hex(obj[0].style.borderRightColor), - border_right_thick : obj[0].style.borderRightWidth.replace(/px$/i, ''), - border_right_type : obj[0].style.borderRightStyle, - - border_left_color : transRGB2Hex(obj[0].style.borderLeftColor), - border_left_thick : obj[0].style.borderLeftWidth.replace(/px$/i, ''), - border_left_type : obj[0].style.borderLeftStyle, - - background_color : transRGB2Hex(obj[0].style.backgroundColor), - background_image_url : obj[0].style.backgroundImage.replace(/^url\(/i,'').replace(/\)$/i,''), - - background_x : 0, - background_y : 0, - - background_repeat : obj[0].style.backgroundRepeat - }; - - // background position - var pos = obj[0].style.backgroundPosition; - if(pos) { - pos = pos.split(' '); - if(pos.length == 2) { - opts.background_x = pos[0]; - opts.background_y = pos[1]; - } - } - - layer.css('top', py+'px').show(); - var _zonePageObj = jQuery(zonePageObj) - var zoneOffsetLeft = _zonePageObj.offset().left; - var zoneWidth = _zonePageObj.width(); - if (px + layer.width() > zoneOffsetLeft + zoneWidth) px = zoneOffsetLeft + zoneWidth - layer.width() - 5; - layer.css('left', px+'px'); - - jQuery.each(opts, function(key, val){ - var el = form[0].elements[key]; - if (el) el.value = val; - if (el.tagName.toLowerCase() == "select") - { - if(el.selectedIndex == -1) { - el.selectedIndex = 0; - } - } - }); - - try { form[0].elements[0].focus() } catch(e) {}; -} - -function doHideWidgetSizeSetup() { - jQuery('#pageSizeLayer').hide(); - //var layer = xGetElementById("pageSizeLayer"); - //layer.style.visibility = "hidden"; - //layer.style.display = "none"; -} - -function _getSize(value) { - if(!value) return 0; - var type = "px"; - if(value.lastIndexOf("%")>=0) type = "%"; - var num = parseInt(value,10); - if(num<1) return 0; - if(type == "%" && num > 100) num = 100; - return ""+num+type; -} - -function _getBorderStyle(fld_color, fld_thick, fld_type) { - var color = fld_color.value; - color = color.replace(/^#/,''); - if(!color) color = '#FFFFFF'; - else color = '#'+color; - var width = fld_thick.value; - if(!width) width = '0px'; - else width = parseInt(width,10)+'px'; - var style = fld_type.options[fld_type.selectedIndex].value; - if(!style) style = 'solid'; - - var str = color+' '+width+' '+style; - return str; -} - -function _getBGColorStyle(fld_color) { - var color = fld_color.replace(/^#/,''); - if(!color) color = '#FFFFFF'; - else color = '#'+color; - return color; -} - -function doApplyWidgetSize(fo_obj) { - if(selectedSizeWidget) { - if(fo_obj.widget_align.selectedIndex == 1) setFloat(selectedSizeWidget, 'right'); - else setFloat(selectedSizeWidget, 'left'); - - var width = _getSize(fo_obj.width.value); - if(width) selectedSizeWidget.style.width = width; - - var height = _getSize(fo_obj.height.value); - if(height && height != "100%") selectedSizeWidget.style.height = height; - else { - selectedSizeWidget.style.height = ''; - var widgetBorder = xGetElementsByClassName('widgetBorder',selectedSizeWidget); - for(var i=0;i 0) return; - if(jQuery(obj).is('.buttonBox') || jQuery(obj).parents('.buttonBox').size() > 0) return; - - - var o = jQuery(obj).parents('.widgetOutput'); - if(o.size() == 0){ - restoreWidgetButtons(); - return; - } - /* - if(!obj || typeof(obj.className)=='undefined' || obj.className != 'widgetOutput') { - restoreWidgetButtons(); - return; - } -*/ - - obj = o.get(0); - var widget = o.attr('widget'); - if(!widget) return; - - if(widget == 'widgetBox') { - restoreWidgetButtons(); - showWidgetButton('widgetBoxButton', obj); - } else { - restoreWidgetButtons(); - showWidgetButton('widgetButton', obj); - - var p_obj = obj.parentNode; - if(p_obj) { - while(p_obj) { - if(p_obj.nodeName == 'DIV' && p_obj.getAttribute('widget')=='widgetBox') { - showWidgetButton('widgetBoxButton', p_obj); - break; - } - p_obj = p_obj.parentNode; - } - } - } -} - -/* 위젯 드래그 */ -// 드래그 중이라는 상황을 간직할 변수 -var widgetDragManager = {obj:null, isDrag:false} -var widgetTmpObject = new Array(); -var widgetDisappear = 0; - -function widgetCreateTmpObject(obj) { - var id = obj.getAttribute('id'); - - tmpObj = xCreateElement('DIV'); - tmpObj.id = id + '_tmp'; - tmpObj.className = obj.className; - tmpObj.style.overflow = 'hidden'; - tmpObj.style.margin= '0px'; - tmpObj.style.padding = '0px'; - tmpObj.style.width = obj.style.width; - - tmpObj.style.display = 'none'; - tmpObj.style.position = 'absolute'; - tmpObj.style.opacity = 1; - tmpObj.style.filter = 'alpha(opacity=100)'; - - xLeft(tmpObj, xPageX(obj)); - xTop(tmpObj, xPageY(obj)); - - document.body.appendChild(tmpObj); - widgetTmpObject[obj.id] = tmpObj; - return tmpObj; -} - -// 기생성된 임시 object를 찾아서 return, 없으면 만들어서 return -var idStep = 0; -function widgetGetTmpObject(obj) { - if(!obj.id) obj.id = 'widget_'+idStep++; - var tmpObj = widgetTmpObject[obj.id]; - if(!tmpObj) tmpObj = widgetCreateTmpObject(obj); - return tmpObj; -} - -// 메뉴에 마우스 클릭이 일어난 시점에 드래그를 위한 제일 첫 동작 (해당 object에 각종 함수나 상태변수 설정) -function widgetDragEnable(obj, funcDragStart, funcDrag, funcDragEnd) { - - // 상위 object에 드래그 가능하다는 상태와 각 드래그 관련 함수를 설정 - obj.draggable = true; - obj.dragStart = funcDragStart; - obj.drag = funcDrag; - obj.dragEnd = funcDragEnd; - - // 드래그 가능하지 않다면 드래그 가능하도록 상태 지정하고 mousemove이벤트 등록 - if (!widgetDragManager.isDrag) { - widgetDragManager.isDrag = true; - xAddEventListener(document, 'mousemove', widgetDragMouseMove, false); - } -} - -// 드래그를 시작할때 호출되는 함수 (이동되는 형태를 보여주기 위한 작업을 함) -function widgetDragStart(tobj, px, py) { - if(tobj.className == 'widgetResize' || tobj.className == 'widgetResizeLeft' || tobj.className == 'widgetBoxResize' || tobj.className == 'widgetBoxResizeLeft') return; - var obj = widgetGetTmpObject(tobj); - - xInnerHtml(obj, xInnerHtml(tobj)); - - xLeft(obj, xPageX(tobj)); - xTop(obj, xPageY(tobj)); - xWidth(obj, xWidth(tobj)); - xHeight(obj, xHeight(tobj)); - - xDisplay(obj, 'block'); -} - -// 드래그 시작후 마우스를 이동할때 발생되는 이벤트에 의해 실행되는 함수 -function widgetDrag(tobj, dx, dy) { - var minWidth = 40; - var minHeight = 10; - - var sx = xPageX(tobj.parentNode); - var sy = xPageY(tobj.parentNode); - - var nx = tobj.xDPX; - var ny = tobj.xDPY; - - var zoneWidth = xWidth(zonePageObj); - var zoneLeft = xPageX(zonePageObj); - var zoneRight = zoneLeft + zoneWidth; - - var pWidth = xWidth(tobj.parentNode); - - var cssFloat = getFloat(tobj.parentNode); - if(!cssFloat) cssFloat = 'left'; - - // 위젯 리사이즈 (우측) - if(tobj.className == 'widgetResize' || tobj.className == 'widgetBoxResize') { - if(nx < sx+minWidth) nx = sx+minWidth; - if(nx > zoneRight) nx = zoneRight; - - if(cssFloat == 'right') nx = sx + pWidth; - - var new_width = nx - sx; - if(new_width < minWidth) new_width = minWidth; - - var new_height = ny - sy; - if(new_height < minHeight) new_height = minHeight; - - if( zoneRight < sx+new_width) new_width = zoneRight - sx; - - // 위젯의 크기 조절 - xWidth(tobj.nextSibling.nextSibling, new_width); - xHeight(tobj.nextSibling.nextSibling, new_height); - - xWidth(tobj.parentNode, new_width); - xHeight(tobj.parentNode, new_height); - - // 위젯 리사이즈 (좌측) - } else if(tobj.className == 'widgetResizeLeft' || tobj.className == 'widgetBoxResizeLeft') { - - if(nx < zoneLeft) nx = zoneLeft; - - if(cssFloat == 'left') nx = sx; - - var new_width = pWidth + (sx - nx); - if(new_width < minWidth) new_width = minWidth; - - var new_height = ny - sy; - if(new_height < minHeight) new_height = minHeight; - - // 위젯의 크기 조절 - xWidth(tobj.nextSibling, new_width); - xHeight(tobj.nextSibling, new_height); - - xWidth(tobj.parentNode, new_width); - xHeight(tobj.parentNode, new_height); - - // 위젯 드래그 - } else { - var obj = widgetGetTmpObject(tobj); - - xLeft(obj, parseInt(xPageX(obj),10) + parseInt(dx,10)); - xTop(obj, parseInt(xPageY(obj),10) + parseInt(dy,10)); - - // 박스 안에 있을 경우에는 박스내의 위젯하고 자리를 바꾸고 그 외의 경우에는 박스를 빠져 나간다 - if(tobj.parentNode != zonePageObj) { - // 박스내에 있는 위젯들을 구함 - var widgetList = xGetElementsByClassName("widgetOutput",tobj.parentNode); - - for(var i=0;i= l && tobj.xDPX <= ll && tobj.xDPY >= t && tobj.xDPY <= tt && tobj.parentNode == target_obj.parentNode) { - var next1 = target_obj.nextSibling; - if(!next1) { - next1 = xCreateElement("DIV"); - target_obj.parentNode.appendChild(next1); - } - var next2 = tobj.nextSibling; - if(!next2) { - next2 = xCreateElement("DIV"); - tobj.parentNode.appendChild(next2); - } - - if(next1) next1.parentNode.insertBefore(tobj, next1); - if(next2) next2.parentNode.insertBefore(target_obj, next2); - doFitBorderSize(); - widgetList = null; - return; - } - } - widgetList = null; - - // 만약 다른 위젯과 자리를 바꾸지 못하였는데 자기 부모창밖에 있는게 확인이 되면 박스 밖으로 내보낸다. - var p_tobj = jQuery(tobj).parents('div.nullWidget').get(0); - var l = xPageX(p_tobj); - var t = xPageY(p_tobj); - var ll = parseInt(l,10) + parseInt(xWidth(p_tobj),10); - var tt = parseInt(t,10) + parseInt(xHeight(p_tobj),10); - if( (tobj.xDPX < l || tobj.xDPX > ll) || (tobj.xDPY < t || tobj.xDPY > tt) ) { - -// zonePageObj.insertBefore(tobj, tobj.parentNode.parentNode.parentNode); - zonePageObj.insertBefore(tobj, jQuery(tobj).parents('div.widgetOutput[widget=widgetBox]').get(0)); - - doFitBorderSize(); - return; - } - - // 박스 밖에 있을 경우에는 다른 위젯과 자리를 바꾸거나 박스내에 들어가도록 한다 - } else { - // 이동하려는 위젯이 박스 위젯이 아니라면 박스 위젯들을 구해서 입력 유무를 검사한다 - if(tobj.getAttribute("widget")!="widgetBox") { - - var boxList = xGetElementsByClassName("nullWidget", zonePageObj); - for(var i=0;i= l && tobj.xDPX <= ll && tobj.xDPY >= t && tobj.xDPY <= tt) { - - //박스 위젯이다 - if(target_obj.className == "nullWidget") { - - var wb_ws = jQuery('div.widget_inner',jQuery(target_obj)); - - //박스 위젯에 위젯스타일이 적용 안된경우 - if(wb_ws.size() == 0){ - target_obj.appendChild(tobj); - - //박스 위젯에 위젯스타일이 적용된경우 또는 박스안에 위젯이 위젯스타일이 적용된겅우 - }else{ - wb_ws.get(0).appendChild(tobj); - } - - // 이동을 멈춤 - widgetManualEnd(); - - doFitBorderSize(); - boxList = null; - return; - } - } - } - boxList = null; - } - - // 다른 위젯들을 구해서 자리를 바꿈 - var widgetList = xGetElementsByClassName("widgetOutput",zonePageObj); - for(var i=0;i= l && tobj.xDPX <= ll && tobj.xDPY >= t && tobj.xDPY <= tt && tobj.parentNode == target_obj.parentNode) { - var next1 = target_obj.nextSibling; - if(!next1) next1 = target_obj.parentNode.lastChild; - if(!next1) { - next1 = xCreateElement("DIV"); - target_obj.parentNode.appendChild(next1); - } - var next2 = tobj.nextSibling; - if(!next2) { - next2 = xCreateElement("DIV"); - tobj.parentNode.appendChild(next2); - } - - if(next1) next1.parentNode.insertBefore(tobj, next1); - if(next2) next2.parentNode.insertBefore(target_obj, next2); - doFitBorderSize(); - widgetList = null; - return; - } - } - widgetList = null; - } - } -} - -// 드래그 종료 (이동되는 object가 이동할 곳에 서서히 이동되는 것처럼 보이는 효과) -function widgetDragEnd(tobj, px, py) { - var obj = widgetGetTmpObject(tobj); - widgetDisapear = widgetDisapearObject(obj, tobj); - widgetDragDisable(tobj.getAttribute('id')); -} - -// 스르르 사라지게 함 (일단 사라지게 하는 기능을 제거.. 속도 문제) -function widgetDisapearObject(obj, tobj) { - xInnerHtml(tobj,xInnerHtml(obj)); - xInnerHtml(obj,''); - xDisplay(obj, 'none'); - obj.parentNode.removeChild(obj); - widgetTmpObject[tobj.id] = null; - return; - - /* - var it = 5; - var ib = 1; - - var x = parseInt(xPageX(obj),10); - var y = parseInt(xPageY(obj),10); - var ldt = (x - parseInt(xPageX(tobj),10)) / ib; - var tdt = (y - parseInt(xPageY(tobj),10)) / ib; - - return setInterval(function() { - if(ib < 1) { - clearInterval(widgetDisapear); - xInnerHtml(tobj,xInnerHtml(obj)); - xInnerHtml(obj,''); - xDisplay(obj, 'none'); - obj.parentNode.removeChild(obj); - widgetTmpObject[tobj.id] = null; - return; - } - ib -= 5; - x-=ldt; - y-=tdt; - xLeft(obj, x); - xTop(obj, y); - }, it/ib); - */ -} - -// 마우스다운 이벤트 발생시 호출됨 -function widgetMouseDown(e) { - var evt = new xEvent(e); - var obj = evt.target; - - while(obj && !obj.draggable) { - obj = xParent(obj, true); - } - if(obj) { - xPreventDefault(e); - obj.xDPX = evt.pageX; - obj.xDPY = evt.pageY; - widgetDragManager.obj = obj; - xAddEventListener(document, 'mouseup', widgetMouseUp, false); - if (obj.dragStart) obj.dragStart(obj, evt.pageX, evt.pageY); - } -} - -// 마우스 버튼을 놓았을때 동작될 함수 (각종 이벤트 해제 및 변수 설정 초기화) -function widgetMouseUp(e) { - if (widgetDragManager.obj) { - xPreventDefault(e); - xRemoveEventListener(document, 'mouseup', widgetMouseUp, false); - - if (widgetDragManager.obj.dragEnd) { - var evt = new xEvent(e); - widgetDragManager.obj.dragEnd(widgetDragManager.obj, evt.pageX, evt.pageY); - } - - widgetDragManager.obj = null; - widgetDragManager.isDrag = false; - } -} - -// 드래그할때의 object이동등을 담당 -function widgetDragMouseMove(e) { - var evt = new xEvent(e); - if(widgetDragManager.obj) { - xPreventDefault(e); - - var obj = widgetDragManager.obj; - var dx = evt.pageX - obj.xDPX; - var dy = evt.pageY - obj.xDPY; - - obj.xDPX = evt.pageX; - obj.xDPY = evt.pageY; - - if (obj.drag) { - obj.drag(obj, dx, dy); - } else { - xMoveTo(obj, xLeft(obj) + dx, xTop(obj) + dy); - } - } -} - -// 해당 object 에 더 이상 drag가 되지 않도록 설정 -function widgetDragDisable(id) { - if (!widgetDragManager) return; - var obj = xGetElementById(id); - obj.draggable = false; - obj.dragStart = null; - obj.drag = null; - obj.dragEnd = null; - //obj.style.backgroundColor = obj.getAttribute('source_color'); - - xRemoveEventListener(obj, 'mousedown', widgetMouseDown, false); - - return; -} - -// 강제로 드래그를 종료시킴 -function widgetManualEnd() { - var tobj = widgetDragManager.obj; - if(!tobj) return; - - xRemoveEventListener(document, 'mouseup', widgetMouseUp, false); - xAddEventListener(document, 'mousemove', widgetDragMouseMove, false); - - var obj = widgetGetTmpObject(tobj); - widgetDisapear = widgetDisapearObject(obj, tobj); - widgetDragDisable(tobj.getAttribute('id')); - - widgetDragManager.obj = null; - widgetDragManager.isDrag = false; -} +/** + * @file modules/widget/js/widget.js + * @author NHN (developers@xpressengine.com) + * @brief 위젯 관리용 자바스크립트 + **/ + +/* DOM 속성을 구하기 위한 몇가지 함수들.. */ +// style의 값을 구하는게 IE랑 그외가 다름. +function getStyle(obj) { + var style = obj.getAttribute("style"); + if(!style) + { + style = obj.style; + } + if(typeof(style)=="object") style = style["cssText"]; + return style; +} + +// float: 값을 구하는게 IE랑 그외가 다름 +function getFloat(obj) { + var cssFloat = xIE4Up?obj.style.styleFloat:obj.style.cssFloat; + if(!cssFloat) cssFloat = 'left'; + return cssFloat; +} +function setFloat(obj, fl) { + if(xIE4Up) obj.style.styleFloat = fl; + else obj.style.cssFloat = fl; +} + +// padding값을 구하는 함수 (없을 경우 0으로 세팅), zbxe의 위젯에서만 사용 +function getPadding(obj, direct) { + var padding = obj.getAttribute("widget_padding_"+direct); + if(!padding || padding == null) padding = 0; + return padding; +} + + +/* 위젯 핸들링 시작 */ +var zonePageObj = null; +var zoneModuleSrl = 0; +function doStartPageModify(zoneID, module_srl) { + zonePageObj = xGetElementById(zoneID); + zoneModuleSrl = module_srl; + + // 위젯 크기/여백 조절 레이어를 가장 밖으로 뺌 + jQuery('#tmpPageSizeLayer') + .attr('id', 'pageSizeLayer') + .css({position:'absolute',left:0,top:0}) + .hide() + .appendTo('body') + .find('>form') + .submit(function(){ doApplyWidgetSize(this); return false; }); + + // 모든 위젯들의 크기를 정해진 크기로 맞춤 + doFitBorderSize(); + + // 드래그와 리사이즈와 관련된 이벤트 리스너 생성 + xAddEventListener(document,"click",doCheckWidget); + xAddEventListener(document,"mousedown",doCheckWidgetDrag); + xAddEventListener(document,'mouseover',widgetSetup); +} + + +// 내용 모두 삭제 +function removeAllWidget() { + if(!confirm(confirm_delete_msg)) return; + restoreWidgetButtons(); + xInnerHtml(zonePageObj,''); +} + +/** + * 특정 영역에 편집된 위젯들을 약속된 태그로 변환하여 return + **/ +function getWidgetContent(obj) { + var html = ""; + if(typeof(obj)=='undefined' || !obj) obj = zonePageObj; + + var widget = null; + jQuery('div.widgetOutput',obj).each(function(){ + if(jQuery(this).parent().get(0) != obj) return; + widget = jQuery(this).attr('widget'); + switch(widget) { + case 'widgetBox' : + html += getWidgetBoxCode(this, widget); + break; + case 'widgetContent' : + html += getContentWidgetCode(this, widget); + break; + default : + html += getWidgetCode(this, widget); + break; + } + }); + + return html; +} + +// 컨텐츠 위젯 코드 구함 +function getContentWidgetCode(childObj, widget) { + var cobj = childObj.firstChild; + + var widgetContent = jQuery('div.widgetContent',childObj); + var body = ''; + var document_srl = 0; + var attrs =''; + + if(widgetContent.size() > 0){ + document_srl = jQuery(childObj).attr('document_srl'); + if(document_srl>0){ + body = ''; + }else{ + body = widgetContent.html(); + } + + + for(var i=0;i'; + }else{ + return ''; + } +} + +// 위젯 박스 코드 구함 +function getWidgetBoxCode(childObj, widget) { + + var attrs = ""; + for(var i=0;i0){ + o = jQuery('.widget_inner',childObj); + o = o.get(0); + }else{ + o = jQuery('.nullWidget',childObj).get(0); + } + + var body = getWidgetContent(o); + return '
    '+body+'
    '; + +/* + var cobj = childObj.firstChild; + while(cobj) { + if(cobj.className == "widgetBorder" || cobj.className == "widgetBoxBorder") { + var c2obj = cobj.firstChild; + while(c2obj) { + if(c2obj.className == "nullWidget") { + var body = getWidgetContent(c2obj); + return '
    '+body+'
    '; + } + c2obj = c2obj.nextSibling; + } + } + cobj = cobj.nextSibling; + } +*/ +} + + + + +// 일반 위젯 컨텐츠 코드 구함 +function getWidgetCode(childObj, widget) { + var attrs = ""; + var code = ""; + for(var i=0;i'; +} + +/** + * 직접 내용을 입력하는 위젯을 추가 + **/ +// 팝업 띄움 +function doAddContent(mid) { + var url = request_uri.setQuery('module','widget').setQuery('act','dispWidgetAdminAddContent').setQuery('module_srl',zoneModuleSrl).setQuery('mid',mid); + popopen(url, "addContent"); +} + +// 직접 내용을 입력하기 위한 에디터 활성화 작업 및 form 데이터 입력 +function doSyncPageContent() { + if(opener && opener.selectedWidget) { + + var fo_obj = xGetElementById("content_fo"); + var sel_obj = opener.selectedWidget; + fo_obj.style.value = getStyle(opener.selectedWidget); + fo_obj.widget_padding_left.value = getPadding(sel_obj, 'left'); + fo_obj.widget_padding_right.value = getPadding(sel_obj,'right'); + fo_obj.widget_padding_bottom.value = getPadding(sel_obj,'bottom'); + fo_obj.widget_padding_top.value = getPadding(sel_obj,'top'); + + var obj = sel_obj.firstChild; + while(obj && obj.className != "widgetContent") obj = obj.nextSibling; + if(obj && obj.className == "widgetContent") { + if(!fo_obj.document_srl || fo_obj.document_srl.value == 0) { + try { + var content = Base64.decode(xInnerHtml(obj)); + content = editorReplacePath(content); + xGetElementById("content_fo").content.value = content; + xe.Editors["1"].exec("SET_IR", [content]); + } + catch(e) + { + } + } + } + } + + if(typeof(editorStart)!='undefined') editorStart(1, "module_srl", "content", false, 400 ); + //editor_upload_start(1); + + setFixedPopupSize(); +} + +// 부모창에 위젯을 추가 +function addContentWidget(fo_obj) { + var editor_sequence = fo_obj.getAttribute('editor_sequence'); + var mid = fo_obj.mid.value; + var module_srl = fo_obj.module_srl.value; + var document_srl = fo_obj.document_srl.value; + var content = editorGetContent(editor_sequence); + var response_tags = new Array('error','message','document_srl'); + var params = new Array(); + params['editor_sequence'] = editor_sequence; + params['content'] = content; + params['module_srl'] = module_srl; + params['document_srl'] = document_srl; + exec_xml('widget',"procWidgetInsertDocument",params,completeAddContent,response_tags,params,fo_obj); + return false; + +} + +function completeAddContent(ret_obj, response_tags, params, fo_obj) { + var document_srl = ret_obj['document_srl']; + + var contentWidget = opener.jQuery('div.widgetOutput[widget=widgetContent][document_srl='+document_srl+']'); + var attr = null; + if(contentWidget.size()>0) { + attr = contentWidget.get(0).attributes; + } + + var editor_sequence = params['editor_sequence']; + var content = editorGetContent(editor_sequence); + + var tpl = ''+ + '
    '+ + '
    '+ + '
    '+ + '
    '+ + '
    '+content+'
    '+ + '
    '+ + ''+ + '
    '; + + var oTpl = jQuery(tpl); + if(attr) { + jQuery.each(attr,function(i){ + if(!oTpl.attr(attr[i].name)){ + oTpl.attr(attr[i].name,attr[i].value); + } + }); + } + + oTpl = jQuery('
    ').append(oTpl); + tpl = oTpl.html(); + opener.doAddWidgetCode(tpl); + window.close(); +} + +/* 박스 위젯 추가 */ +function doAddWidgetBox() { + var tpl = ''+ + '
    '+ + '
    '+ + '
    '+ + '
    '+ + '
    '+ + '
    '+ + '
    '+ + '
    '; + xInnerHtml(zonePageObj, xInnerHtml(zonePageObj)+tpl); + doFitBorderSize(); +} + + +/* 일반 위젯을 추가하기 위해 위젯 팝업창을 띄움 */ +function doAddWidget(fo) { + var sel = fo.widget_list; + var idx = sel.selectedIndex; + var val = sel.options[idx].value; + var module_srl = fo.module_srl.value; + + var url = request_uri.setQuery('module','widget').setQuery('act','dispWidgetGenerateCodeInPage').setQuery('selected_widget', val).setQuery('module_srl', module_srl); + popopen(url,'GenerateWidgetCode'); +} + + + +// widgetBorder에 height를 widgetOutput와 맞춰줌 +function doFitBorderSize() { + var obj_list = xGetElementsByClassName('widgetBorder', zonePageObj); + for(var i=0;i-1) { + var pos = tmp.indexOf(""); + var cssfile = tmp.substr(9,eos-9); + if(cssfile.indexOf('.js')>-1) { + tmp = tmp.substr(eos); + continue; + } + if(!cssfile) break; + tmp = tmp.substr(eos); + + var cssfile = request_uri+'/'+cssfile; + if(typeof(document.createStyleSheet)=='undefined') { + var css =''; + var dummy = xCreateElement("DIV"); + xInnerHtml(dummy , css); + document.body.appendChild(dummy); + } else { + document.createStyleSheet(cssfile,0); + } + } + + // widget 코드에서 javascript 부분을 빼서 eval후 결과값을 대체함 + checkDocumentWrite = true; ///< document.write(ln)등의 함수값을 바로 사용하기 위한 check flag + + // widget_code의 javascript 부분 수정 + var tmp = widget_code.toLowerCase(); + while(tmp.indexOf("-1) { + + var pos = tmp.indexOf("")+9; + + var script = widget_code.substr(pos,length); + script = script.replace(/^]*)>/i,'').replace(/<\/script>$/i,''); + + writedText = null; + eval(script); + widget_code = widget_code.substr(0,pos)+writedText+widget_code.substr(pos+length); + tmp = widget_code.toLowerCase(); + } + + + + // html 추가 + var dummy = xCreateElement('div'); + xInnerHtml(dummy, widget_code); + var obj = dummy.childNodes[0]; + + if(selectedWidget && selectedWidget.getAttribute("widget")) { + var o = jQuery('div.widget_inner',selectedWidget); + var n = jQuery('div.widget_inner',obj); + + if(n.size()==0) n = jQuery('div.nullWidget',obj); + if(o.size()==0) o = jQuery('div.nullWidget',selectedWidget); + + n.html(o.html()); + + + selectedWidget.parentNode.insertBefore(obj, selectedWidget); + selectedWidget.parentNode.removeChild(selectedWidget); + } else { + xGetElementById('zonePageContent').appendChild(obj); + } + checkDocumentWrite = false; + selectedWidget = null; + + /* + //zoneObj.style.visibility = 'hidden'; + zoneObj.style.opacity = 0.2; + zoneObj.style.filter = "alpha(opacity=20)"; + + // 위젯 추가후 페이지 리로딩 + var tpl = getWidgetContent(); + + var fo_obj = xGetElementById('pageFo'); + fo_obj.content.value = tpl; + fo_obj.mid.value = current_mid; + fo_obj.submit(); + */ +} + +// 클릭 이벤트시 위젯의 수정/제거/이벤트 무효화 처리 +function doCheckWidget(e) { + var evt = new xEvent(e); if(!evt.target) return; + var obj = evt.target; + + selectedWidget = null; + + var pObj = obj.parentNode; + while(pObj) { + if(pObj.id == "pageSizeLayer") return; + pObj = pObj.parentNode; + } + + doHideWidgetSizeSetup(); + // 위젯 설정 + if(obj.className == 'widgetSetup') { + var p_obj = obj.parentNode.parentNode; + var widget = p_obj.getAttribute("widget"); + if(!widget) return; + selectedWidget = p_obj; + if(widget == 'widgetContent') popopen(request_uri+"?module=widget&act=dispWidgetAdminAddContent&module_srl="+zoneModuleSrl+"&document_srl="+p_obj.getAttribute("document_srl")+'&mid='+current_mid, "addContent"); + else popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget+"&widgetstyle="+widgetstyle,'GenerateCodeInPage'); + return; + + // 위젯 스타일 + } else if(obj.className == 'widgetStyle') { + var p_obj = obj.parentNode.parentNode; + var widget = p_obj.getAttribute("widget"); + var widgetstyle = p_obj.getAttribute("widgetstyle"); + if(!widget) return; + selectedWidget = p_obj; + popopen(request_uri+"?module=widget&act=dispWidgetStyleGenerateCodeInPage&selected_widget="+widget+"&widgetstyle="+widgetstyle,'GenerateCodeInPage'); + return; + + // 위젯 복사 + } else if(obj.className == 'widgetCopy' && obj.parentNode.parentNode.className == 'widgetOutput') { + p_obj = obj.parentNode.parentNode; + restoreWidgetButtons(); + + if(p_obj.getAttribute('widget')=='widgetContent' && p_obj.getAttribute('document_srl') ) { + var response_tags = new Array('error','message','document_srl'); + var params = new Array(); + params['document_srl'] =p_obj.getAttribute('document_srl'); + exec_xml('widget','procWidgetCopyDocument', params, completeCopyWidgetContent, response_tags, params, p_obj); + return; + } else { + var dummy = xCreateElement("DIV"); + xInnerHtml(dummy,xInnerHtml(p_obj)); + + dummy.widget_sequence = ''; + dummy.className = "widgetOutput"; + for(var i=0;i 0) return; + + doHideWidgetSizeSetup(); + + if(obj.className == 'widgetSetup' || obj.className == 'widgetStyle' || obj.className == 'widgetCopy' || obj.className == 'widgetBoxCopy' || obj.className == 'widgetSize' || obj.className == 'widgetBoxSize' || obj.className == 'widgetRemove' || obj.className == 'widgetBoxRemove') return; + + p_obj = obj; + while(p_obj) { + if(p_obj.className == 'widgetOutput' || p_obj.className == 'widgetResize' || p_obj.className == 'widgetResizeLeft' || p_obj.className == 'widgetBoxResize' || p_obj.className == 'widgetBoxResizeLeft') { + widgetDragEnable(p_obj, widgetDragStart, widgetDrag, widgetDragEnd); + widgetMouseDown(e); + return; + } + p_obj = p_obj.parentNode; + } +} + +function _getInt(val) { + if(!val || val == "null") return 0; + if(parseInt(val,10)==NaN) return 0; + return parseInt(val,10); +} + +// 위젯 크기 조절 레이어를 보여줌 +var selectedSizeWidget = null; +function doShowWidgetSizeSetup(px, py, obj) { + var layer = jQuery('#pageSizeLayer'); + var form = layer.find('>form:first'); + var obj = jQuery(obj); + + if (!form.length) return; + + selectedSizeWidget = obj[0]; + + var opts = { + widget_align : obj.css('float'), + + width : obj[0].style.width, + height : obj[0].style.height, + + padding_left : _getInt(obj.attr('widget_padding_left')), + padding_right : _getInt(obj.attr('widget_padding_right')), + padding_top : _getInt(obj.attr('widget_padding_top')), + padding_bottom : _getInt(obj.attr('widget_padding_bottom')), + + margin_left : _getInt(obj[0].style.marginLeft), + margin_right : _getInt(obj[0].style.marginRight), + margin_top : _getInt(obj[0].style.marginTop), + margin_bottom : _getInt(obj[0].style.marginBottom), + + border_top_color : transRGB2Hex(obj[0].style.borderTopColor), + border_top_thick : obj[0].style.borderTopWidth.replace(/px$/i, ''), + border_top_type : obj[0].style.borderTopStyle, + + border_bottom_color : transRGB2Hex(obj[0].style.borderBottomColor), + border_bottom_thick : obj[0].style.borderBottomWidth.replace(/px$/i, ''), + border_bottom_type : obj[0].style.borderBottomStyle, + + border_right_color : transRGB2Hex(obj[0].style.borderRightColor), + border_right_thick : obj[0].style.borderRightWidth.replace(/px$/i, ''), + border_right_type : obj[0].style.borderRightStyle, + + border_left_color : transRGB2Hex(obj[0].style.borderLeftColor), + border_left_thick : obj[0].style.borderLeftWidth.replace(/px$/i, ''), + border_left_type : obj[0].style.borderLeftStyle, + + background_color : transRGB2Hex(obj[0].style.backgroundColor), + background_image_url : obj[0].style.backgroundImage.replace(/^url\(/i,'').replace(/\)$/i,''), + + background_x : 0, + background_y : 0, + + background_repeat : obj[0].style.backgroundRepeat + }; + + // background position + var pos = obj[0].style.backgroundPosition; + if(pos) { + pos = pos.split(' '); + if(pos.length == 2) { + opts.background_x = pos[0]; + opts.background_y = pos[1]; + } + } + + layer.css('top', py+'px').show(); + var _zonePageObj = jQuery(zonePageObj) + var zoneOffsetLeft = _zonePageObj.offset().left; + var zoneWidth = _zonePageObj.width(); + if (px + layer.width() > zoneOffsetLeft + zoneWidth) px = zoneOffsetLeft + zoneWidth - layer.width() - 5; + layer.css('left', px+'px'); + + jQuery.each(opts, function(key, val){ + var el = form[0].elements[key]; + if (el) el.value = val; + if (el.tagName.toLowerCase() == "select") + { + if(el.selectedIndex == -1) { + el.selectedIndex = 0; + } + } + }); + + try { form[0].elements[0].focus() } catch(e) {}; +} + +function doHideWidgetSizeSetup() { + jQuery('#pageSizeLayer').hide(); + //var layer = xGetElementById("pageSizeLayer"); + //layer.style.visibility = "hidden"; + //layer.style.display = "none"; +} + +function _getSize(value) { + if(!value) return 0; + var type = "px"; + if(value.lastIndexOf("%")>=0) type = "%"; + var num = parseInt(value,10); + if(num<1) return 0; + if(type == "%" && num > 100) num = 100; + return ""+num+type; +} + +function _getBorderStyle(fld_color, fld_thick, fld_type) { + var color = fld_color.value; + color = color.replace(/^#/,''); + if(!color) color = '#FFFFFF'; + else color = '#'+color; + var width = fld_thick.value; + if(!width) width = '0px'; + else width = parseInt(width,10)+'px'; + var style = fld_type.options[fld_type.selectedIndex].value; + if(!style) style = 'solid'; + + var str = color+' '+width+' '+style; + return str; +} + +function _getBGColorStyle(fld_color) { + var color = fld_color.replace(/^#/,''); + if(!color) color = '#FFFFFF'; + else color = '#'+color; + return color; +} + +function doApplyWidgetSize(fo_obj) { + if(selectedSizeWidget) { + if(fo_obj.widget_align.selectedIndex == 1) setFloat(selectedSizeWidget, 'right'); + else setFloat(selectedSizeWidget, 'left'); + + var width = _getSize(fo_obj.width.value); + if(width) selectedSizeWidget.style.width = width; + + var height = _getSize(fo_obj.height.value); + if(height && height != "100%") selectedSizeWidget.style.height = height; + else { + selectedSizeWidget.style.height = ''; + var widgetBorder = xGetElementsByClassName('widgetBorder',selectedSizeWidget); + for(var i=0;i 0) return; + if(jQuery(obj).is('.buttonBox') || jQuery(obj).parents('.buttonBox').size() > 0) return; + + + var o = jQuery(obj).parents('.widgetOutput'); + if(o.size() == 0){ + restoreWidgetButtons(); + return; + } + /* + if(!obj || typeof(obj.className)=='undefined' || obj.className != 'widgetOutput') { + restoreWidgetButtons(); + return; + } +*/ + + obj = o.get(0); + var widget = o.attr('widget'); + if(!widget) return; + + if(widget == 'widgetBox') { + restoreWidgetButtons(); + showWidgetButton('widgetBoxButton', obj); + } else { + restoreWidgetButtons(); + showWidgetButton('widgetButton', obj); + + var p_obj = obj.parentNode; + if(p_obj) { + while(p_obj) { + if(p_obj.nodeName == 'DIV' && p_obj.getAttribute('widget')=='widgetBox') { + showWidgetButton('widgetBoxButton', p_obj); + break; + } + p_obj = p_obj.parentNode; + } + } + } +} + +/* 위젯 드래그 */ +// 드래그 중이라는 상황을 간직할 변수 +var widgetDragManager = {obj:null, isDrag:false} +var widgetTmpObject = new Array(); +var widgetDisappear = 0; + +function widgetCreateTmpObject(obj) { + var id = obj.getAttribute('id'); + + tmpObj = xCreateElement('DIV'); + tmpObj.id = id + '_tmp'; + tmpObj.className = obj.className; + tmpObj.style.overflow = 'hidden'; + tmpObj.style.margin= '0px'; + tmpObj.style.padding = '0px'; + tmpObj.style.width = obj.style.width; + + tmpObj.style.display = 'none'; + tmpObj.style.position = 'absolute'; + tmpObj.style.opacity = 1; + tmpObj.style.filter = 'alpha(opacity=100)'; + + xLeft(tmpObj, xPageX(obj)); + xTop(tmpObj, xPageY(obj)); + + document.body.appendChild(tmpObj); + widgetTmpObject[obj.id] = tmpObj; + return tmpObj; +} + +// 기생성된 임시 object를 찾아서 return, 없으면 만들어서 return +var idStep = 0; +function widgetGetTmpObject(obj) { + if(!obj.id) obj.id = 'widget_'+idStep++; + var tmpObj = widgetTmpObject[obj.id]; + if(!tmpObj) tmpObj = widgetCreateTmpObject(obj); + return tmpObj; +} + +// 메뉴에 마우스 클릭이 일어난 시점에 드래그를 위한 제일 첫 동작 (해당 object에 각종 함수나 상태변수 설정) +function widgetDragEnable(obj, funcDragStart, funcDrag, funcDragEnd) { + + // 상위 object에 드래그 가능하다는 상태와 각 드래그 관련 함수를 설정 + obj.draggable = true; + obj.dragStart = funcDragStart; + obj.drag = funcDrag; + obj.dragEnd = funcDragEnd; + + // 드래그 가능하지 않다면 드래그 가능하도록 상태 지정하고 mousemove이벤트 등록 + if (!widgetDragManager.isDrag) { + widgetDragManager.isDrag = true; + xAddEventListener(document, 'mousemove', widgetDragMouseMove, false); + } +} + +// 드래그를 시작할때 호출되는 함수 (이동되는 형태를 보여주기 위한 작업을 함) +function widgetDragStart(tobj, px, py) { + if(tobj.className == 'widgetResize' || tobj.className == 'widgetResizeLeft' || tobj.className == 'widgetBoxResize' || tobj.className == 'widgetBoxResizeLeft') return; + var obj = widgetGetTmpObject(tobj); + + xInnerHtml(obj, xInnerHtml(tobj)); + + xLeft(obj, xPageX(tobj)); + xTop(obj, xPageY(tobj)); + xWidth(obj, xWidth(tobj)); + xHeight(obj, xHeight(tobj)); + + xDisplay(obj, 'block'); +} + +// 드래그 시작후 마우스를 이동할때 발생되는 이벤트에 의해 실행되는 함수 +function widgetDrag(tobj, dx, dy) { + var minWidth = 40; + var minHeight = 10; + + var sx = xPageX(tobj.parentNode); + var sy = xPageY(tobj.parentNode); + + var nx = tobj.xDPX; + var ny = tobj.xDPY; + + var zoneWidth = xWidth(zonePageObj); + var zoneLeft = xPageX(zonePageObj); + var zoneRight = zoneLeft + zoneWidth; + + var pWidth = xWidth(tobj.parentNode); + + var cssFloat = getFloat(tobj.parentNode); + if(!cssFloat) cssFloat = 'left'; + + // 위젯 리사이즈 (우측) + if(tobj.className == 'widgetResize' || tobj.className == 'widgetBoxResize') { + if(nx < sx+minWidth) nx = sx+minWidth; + if(nx > zoneRight) nx = zoneRight; + + if(cssFloat == 'right') nx = sx + pWidth; + + var new_width = nx - sx; + if(new_width < minWidth) new_width = minWidth; + + var new_height = ny - sy; + if(new_height < minHeight) new_height = minHeight; + + if( zoneRight < sx+new_width) new_width = zoneRight - sx; + + // 위젯의 크기 조절 + xWidth(tobj.nextSibling.nextSibling, new_width); + xHeight(tobj.nextSibling.nextSibling, new_height); + + xWidth(tobj.parentNode, new_width); + xHeight(tobj.parentNode, new_height); + + // 위젯 리사이즈 (좌측) + } else if(tobj.className == 'widgetResizeLeft' || tobj.className == 'widgetBoxResizeLeft') { + + if(nx < zoneLeft) nx = zoneLeft; + + if(cssFloat == 'left') nx = sx; + + var new_width = pWidth + (sx - nx); + if(new_width < minWidth) new_width = minWidth; + + var new_height = ny - sy; + if(new_height < minHeight) new_height = minHeight; + + // 위젯의 크기 조절 + xWidth(tobj.nextSibling, new_width); + xHeight(tobj.nextSibling, new_height); + + xWidth(tobj.parentNode, new_width); + xHeight(tobj.parentNode, new_height); + + // 위젯 드래그 + } else { + var obj = widgetGetTmpObject(tobj); + + xLeft(obj, parseInt(xPageX(obj),10) + parseInt(dx,10)); + xTop(obj, parseInt(xPageY(obj),10) + parseInt(dy,10)); + + // 박스 안에 있을 경우에는 박스내의 위젯하고 자리를 바꾸고 그 외의 경우에는 박스를 빠져 나간다 + if(tobj.parentNode != zonePageObj) { + // 박스내에 있는 위젯들을 구함 + var widgetList = xGetElementsByClassName("widgetOutput",tobj.parentNode); + + for(var i=0;i= l && tobj.xDPX <= ll && tobj.xDPY >= t && tobj.xDPY <= tt && tobj.parentNode == target_obj.parentNode) { + var next1 = target_obj.nextSibling; + if(!next1) { + next1 = xCreateElement("DIV"); + target_obj.parentNode.appendChild(next1); + } + var next2 = tobj.nextSibling; + if(!next2) { + next2 = xCreateElement("DIV"); + tobj.parentNode.appendChild(next2); + } + + if(next1) next1.parentNode.insertBefore(tobj, next1); + if(next2) next2.parentNode.insertBefore(target_obj, next2); + doFitBorderSize(); + widgetList = null; + return; + } + } + widgetList = null; + + // 만약 다른 위젯과 자리를 바꾸지 못하였는데 자기 부모창밖에 있는게 확인이 되면 박스 밖으로 내보낸다. + var p_tobj = jQuery(tobj).parents('div.nullWidget').get(0); + var l = xPageX(p_tobj); + var t = xPageY(p_tobj); + var ll = parseInt(l,10) + parseInt(xWidth(p_tobj),10); + var tt = parseInt(t,10) + parseInt(xHeight(p_tobj),10); + if( (tobj.xDPX < l || tobj.xDPX > ll) || (tobj.xDPY < t || tobj.xDPY > tt) ) { + +// zonePageObj.insertBefore(tobj, tobj.parentNode.parentNode.parentNode); + zonePageObj.insertBefore(tobj, jQuery(tobj).parents('div.widgetOutput[widget=widgetBox]').get(0)); + + doFitBorderSize(); + return; + } + + // 박스 밖에 있을 경우에는 다른 위젯과 자리를 바꾸거나 박스내에 들어가도록 한다 + } else { + // 이동하려는 위젯이 박스 위젯이 아니라면 박스 위젯들을 구해서 입력 유무를 검사한다 + if(tobj.getAttribute("widget")!="widgetBox") { + + var boxList = xGetElementsByClassName("nullWidget", zonePageObj); + for(var i=0;i= l && tobj.xDPX <= ll && tobj.xDPY >= t && tobj.xDPY <= tt) { + + //박스 위젯이다 + if(target_obj.className == "nullWidget") { + + var wb_ws = jQuery('div.widget_inner',jQuery(target_obj)); + + //박스 위젯에 위젯스타일이 적용 안된경우 + if(wb_ws.size() == 0){ + target_obj.appendChild(tobj); + + //박스 위젯에 위젯스타일이 적용된경우 또는 박스안에 위젯이 위젯스타일이 적용된겅우 + }else{ + wb_ws.get(0).appendChild(tobj); + } + + // 이동을 멈춤 + widgetManualEnd(); + + doFitBorderSize(); + boxList = null; + return; + } + } + } + boxList = null; + } + + // 다른 위젯들을 구해서 자리를 바꿈 + var widgetList = xGetElementsByClassName("widgetOutput",zonePageObj); + for(var i=0;i= l && tobj.xDPX <= ll && tobj.xDPY >= t && tobj.xDPY <= tt && tobj.parentNode == target_obj.parentNode) { + var next1 = target_obj.nextSibling; + if(!next1) next1 = target_obj.parentNode.lastChild; + if(!next1) { + next1 = xCreateElement("DIV"); + target_obj.parentNode.appendChild(next1); + } + var next2 = tobj.nextSibling; + if(!next2) { + next2 = xCreateElement("DIV"); + tobj.parentNode.appendChild(next2); + } + + if(next1) next1.parentNode.insertBefore(tobj, next1); + if(next2) next2.parentNode.insertBefore(target_obj, next2); + doFitBorderSize(); + widgetList = null; + return; + } + } + widgetList = null; + } + } +} + +// 드래그 종료 (이동되는 object가 이동할 곳에 서서히 이동되는 것처럼 보이는 효과) +function widgetDragEnd(tobj, px, py) { + var obj = widgetGetTmpObject(tobj); + widgetDisapear = widgetDisapearObject(obj, tobj); + widgetDragDisable(tobj.getAttribute('id')); +} + +// 스르르 사라지게 함 (일단 사라지게 하는 기능을 제거.. 속도 문제) +function widgetDisapearObject(obj, tobj) { + xInnerHtml(tobj,xInnerHtml(obj)); + xInnerHtml(obj,''); + xDisplay(obj, 'none'); + obj.parentNode.removeChild(obj); + widgetTmpObject[tobj.id] = null; + return; + + /* + var it = 5; + var ib = 1; + + var x = parseInt(xPageX(obj),10); + var y = parseInt(xPageY(obj),10); + var ldt = (x - parseInt(xPageX(tobj),10)) / ib; + var tdt = (y - parseInt(xPageY(tobj),10)) / ib; + + return setInterval(function() { + if(ib < 1) { + clearInterval(widgetDisapear); + xInnerHtml(tobj,xInnerHtml(obj)); + xInnerHtml(obj,''); + xDisplay(obj, 'none'); + obj.parentNode.removeChild(obj); + widgetTmpObject[tobj.id] = null; + return; + } + ib -= 5; + x-=ldt; + y-=tdt; + xLeft(obj, x); + xTop(obj, y); + }, it/ib); + */ +} + +// 마우스다운 이벤트 발생시 호출됨 +function widgetMouseDown(e) { + var evt = new xEvent(e); + var obj = evt.target; + + while(obj && !obj.draggable) { + obj = xParent(obj, true); + } + if(obj) { + xPreventDefault(e); + obj.xDPX = evt.pageX; + obj.xDPY = evt.pageY; + widgetDragManager.obj = obj; + xAddEventListener(document, 'mouseup', widgetMouseUp, false); + if (obj.dragStart) obj.dragStart(obj, evt.pageX, evt.pageY); + } +} + +// 마우스 버튼을 놓았을때 동작될 함수 (각종 이벤트 해제 및 변수 설정 초기화) +function widgetMouseUp(e) { + if (widgetDragManager.obj) { + xPreventDefault(e); + xRemoveEventListener(document, 'mouseup', widgetMouseUp, false); + + if (widgetDragManager.obj.dragEnd) { + var evt = new xEvent(e); + widgetDragManager.obj.dragEnd(widgetDragManager.obj, evt.pageX, evt.pageY); + } + + widgetDragManager.obj = null; + widgetDragManager.isDrag = false; + } +} + +// 드래그할때의 object이동등을 담당 +function widgetDragMouseMove(e) { + var evt = new xEvent(e); + if(widgetDragManager.obj) { + xPreventDefault(e); + + var obj = widgetDragManager.obj; + var dx = evt.pageX - obj.xDPX; + var dy = evt.pageY - obj.xDPY; + + obj.xDPX = evt.pageX; + obj.xDPY = evt.pageY; + + if (obj.drag) { + obj.drag(obj, dx, dy); + } else { + xMoveTo(obj, xLeft(obj) + dx, xTop(obj) + dy); + } + } +} + +// 해당 object 에 더 이상 drag가 되지 않도록 설정 +function widgetDragDisable(id) { + if (!widgetDragManager) return; + var obj = xGetElementById(id); + obj.draggable = false; + obj.dragStart = null; + obj.drag = null; + obj.dragEnd = null; + //obj.style.backgroundColor = obj.getAttribute('source_color'); + + xRemoveEventListener(obj, 'mousedown', widgetMouseDown, false); + + return; +} + +// 강제로 드래그를 종료시킴 +function widgetManualEnd() { + var tobj = widgetDragManager.obj; + if(!tobj) return; + + xRemoveEventListener(document, 'mouseup', widgetMouseUp, false); + xAddEventListener(document, 'mousemove', widgetDragMouseMove, false); + + var obj = widgetGetTmpObject(tobj); + widgetDisapear = widgetDisapearObject(obj, tobj); + widgetDragDisable(tobj.getAttribute('id')); + + widgetDragManager.obj = null; + widgetDragManager.isDrag = false; +} diff --git a/modules/widget/tpl/js/widget_admin.js b/modules/widget/tpl/js/widget_admin.js index 8c5e312ff..1b2720513 100644 --- a/modules/widget/tpl/js/widget_admin.js +++ b/modules/widget/tpl/js/widget_admin.js @@ -1,470 +1,470 @@ -/** - * @file modules/widget/js/widget_admin.js - * @author NHN (developers@xpressengine.com) - * @brief widget 모듈의 관리자용 javascript - **/ - -/* 생성된 코드를 textarea에 출력 */ -function completeGenerateCode(ret_obj) { - var widget_code = ret_obj["widget_code"]; - widget_code = widget_code.replace(/&/g, "&"); - widget_code = widget_code.replace(/\'/g, "'"); - var zone = xGetElementById("widget_code"); - zone.value = widget_code; -} - -/* 생성된 코드를 페이지 zone에 출력 */ -function completeGenerateCodeInPage(ret_obj,response_tags,params,fo_obj) { - var widget_code = ret_obj["widget_code"]; - if(!opener || !widget_code) { - window.close(); - return; - } - - opener.doAddWidgetCode(widget_code); - window.close(); -} - -/* 위젯 코드 생성시 스킨을 고르면 컬러셋의 정보를 표시 */ -function doDisplaySkinColorset(sel, colorset) { - var skin = sel.options[sel.selectedIndex].value; - if(!skin) { - xGetElementById("colorset_area").style.display = "none"; - setFixedPopupSize(); - return; - } - - var params = new Array(); - params["selected_widget"] = xGetElementById("fo_widget").selected_widget.value; - params["skin"] = skin; - params["colorset"] = colorset; - - var response_tags = new Array("error","message","colorset_list"); - - exec_xml("widget", "procWidgetGetColorsetList", params, completeGetSkinColorset, response_tags, params); -} - -/* 서버에서 받아온 컬러셋을 표시 */ -function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) { - var sel = jQuery("#fo_widget")[0].widget_colorset; - var length = sel.options.length; - var selected_colorset = params["colorset"]; - for(var i=0;i