diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..719153d4b --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = false +insert_final_newline = true +indent_style = tab +indent_size = 4 diff --git a/.gitignore b/.gitignore index 1ab6c7b20..f6d44c481 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,5 @@ composer.phar *.sublime-workspace *.sublime-project .codeintel +error_log diff --git a/.travis.yml b/.travis.yml index 23ccb125a..eb62f813c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: php php: -- 5.3 - 5.4 - 5.5 - 5.6 @@ -11,14 +10,14 @@ before_script: - npm install grunt grunt-cli grunt-contrib-jshint grunt-contrib-csslint grunt-phplint --save-dev - mysql -u root -e "CREATE DATABASE rhymix" - mysql -u root -e "SET PASSWORD FOR 'travis'@'localhost' = PASSWORD('travis')" -- if [[ $TRAVIS_PHP_VERSION != "hhvm" ]]; then php -S localhost:8000 & fi -- if [[ $TRAVIS_PHP_VERSION == "5.3" ]]; then touch codecept.phar; fi +- if [[ $TRAVIS_PHP_VERSION != "5.4" && $TRAVIS_PHP_VERSION != "hhvm" ]]; then php -S localhost:8000 & fi - if [[ $TRAVIS_PHP_VERSION == "5.4" ]]; then wget http://codeception.com/releases/2.0.16/codecept.phar; fi -- if [[ ! -f codecept.phar ]]; then wget http://codeception.com/codecept.phar; fi +- if [[ ! -f codecept.phar ]]; then wget http://codeception.com/releases/2.1.6/codecept.phar; fi script: -- if [[ -f codecept.phar ]]; then php codecept.phar build; fi -- if [[ $TRAVIS_PHP_VERSION == "hhvm" ]]; then php codecept.phar run -d --fail-fast --env travis --skip install; fi -- if [[ $TRAVIS_PHP_VERSION != "hhvm" ]]; then php codecept.phar run -d --fail-fast --env travis; fi +- if [[ -s codecept.phar ]]; then php codecept.phar build; fi +- if [[ -s codecept.phar && $TRAVIS_PHP_VERSION == "hhvm" ]]; then php codecept.phar run -d --fail-fast --env travis --skip install; fi +- if [[ -s codecept.phar && $TRAVIS_PHP_VERSION == "5.4" ]]; then php codecept.phar run -d --fail-fast --env travis --skip install; fi +- if [[ -s codecept.phar && $TRAVIS_PHP_VERSION != "5.4" && $TRAVIS_PHP_VERSION != "hhvm" ]]; then php codecept.phar run -d --fail-fast --env travis; fi - grunt lint notifications: email: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7e482d998..fd98ea028 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -58,6 +58,8 @@ PHP, HTML, XML, CSS, JS 등 모든 텍스트 파일의 문자셋은 BOM이 없 들여쓰기는 1개의 탭으로 합니다. 단, 탭 대신 공백을 사용하는 파일에서는 일관성 유지를 위해 4칸의 공백을 사용할 수 있습니다. +들여쓴 줄들 사이의 빈 줄도 들여씁니다. (에디터에서 후행 공백을 제거하지 않도록 설정하십시오.) + PHP 코드만으로 이루어진 파일은 맨 끝에 `?>` 태그를 사용하지 않습니다. ### 공백 및 줄바꿈 규칙 @@ -155,5 +157,8 @@ Rhymix에서 정한 `error_reporting` 설정 하에서 어떤 에러도 발생 문자열과 문자열, 정수와 정수를 비교할 때는 가능하면 `==` 대신 `===`을 사용합니다. 실제 자료형이 다를 가능성이 있는 경우 `intval()`, `strval()` 등의 함수와 함께 사용합니다. +PHP 5.4 이상에서 지원하는 간단한 배열 문법(`[1, 2, 3]`)을 사용할 수 있으나, +복잡한 구조의 배열을 선언할 때는 이 문법이 오히려 가독성을 해칠 수 있으니 주의하시기 바랍니다. + 여기에서 규정하지 않은 내용은 [PSR-1](http://www.php-fig.org/psr/psr-1/)과 [PSR-2](http://www.php-fig.org/psr/psr-2/)를 따릅니다. diff --git a/README.md b/README.md index 7c3975e43..83fc1d487 100644 --- a/README.md +++ b/README.md @@ -32,18 +32,23 @@ Rhymix는 개발자와 사용자가 서로의 권리와 책임을 존중하는 ### 설치 환경 -- PHP 5.3.3 이상 (PHP 5.5.9 이상 권장, PHP 7 지원) -- MySQL 4.1.13 이상 (MySQL 5.0.7 이상 또는 MariaDB 권장) -- CUBRID 또는 MS SQL을 DB로 사용할 수도 있으나, 권장하지는 않습니다. +Rhymix를 사용하려면 아래의 조건을 충족하는 웹호스팅이나 서버를 마련하셔야 합니다. + + +- PHP 5.5.9 이상 (PHP 7 권장) +- MySQL 5.0.7 이상 (MariaDB 권장) - 필수 PHP 모듈 - curl - gd - iconv 또는 mbstring - json - mcrypt 또는 openssl - - xml 및 simplexml + - simplexml - php.ini에서 session.auto_start = Off로 설정되어 있어야 합니다. - 설치 폴더 또는 files 폴더에 쓰기 권한이 주어져야 합니다. +- MySQL/MariaDB 외에도 아래의 DB를 사용할 수 있습니다. + - CUBRID 9.0 이상 + - Microsoft SQL Server 2008 이상 ### 개발 참여 diff --git a/addons/captcha/captcha.addon.php b/addons/captcha/captcha.addon.php index 128aa917d..9c12f9b01 100644 --- a/addons/captcha/captcha.addon.php +++ b/addons/captcha/captcha.addon.php @@ -62,7 +62,7 @@ if(!class_exists('AddonCaptcha', false)) { Context::loadLang(_XE_PATH_ . 'addons/captcha/lang'); $_SESSION['XE_VALIDATOR_ERROR'] = -1; - $_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied'); + $_SESSION['XE_VALIDATOR_MESSAGE'] = lang('captcha_denied'); $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error'; $_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url'); $ModuleHandler->_setInputValueToSession(); @@ -113,7 +113,7 @@ if(!class_exists('AddonCaptcha', false)) // Generate keywords $this->createKeyword(); - $target = Context::getLang('target_captcha'); + $target = lang('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"); @@ -121,11 +121,11 @@ if(!class_exists('AddonCaptcha', false)) 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') + , lang('about_captcha') + , lang('captcha_reload') + , lang('captcha_play') + , lang('cmd_input') + , lang('cmd_cancel') ); Context::close(); exit(); diff --git a/addons/captcha_member/captcha_member.addon.php b/addons/captcha_member/captcha_member.addon.php index 3d5471a13..feeded237 100644 --- a/addons/captcha_member/captcha_member.addon.php +++ b/addons/captcha_member/captcha_member.addon.php @@ -73,7 +73,7 @@ if(!class_exists('AddonMemberCaptcha', false)) { Context::loadLang(_XE_PATH_ . 'addons/captcha_member/lang'); $_SESSION['XE_VALIDATOR_ERROR'] = -1; - $_SESSION['XE_VALIDATOR_MESSAGE'] = Context::getLang('captcha_denied'); + $_SESSION['XE_VALIDATOR_MESSAGE'] = lang('captcha_denied'); $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error'; $_SESSION['XE_VALIDATOR_RETURN_URL'] = Context::get('error_return_url'); $ModuleHandler->_setInputValueToSession(); @@ -124,7 +124,7 @@ if(!class_exists('AddonMemberCaptcha', false)) // Generate keywords $this->createKeyword(); - $target = Context::getLang('target_captcha'); + $target = lang('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"); @@ -132,11 +132,11 @@ if(!class_exists('AddonMemberCaptcha', false)) 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') + , lang('about_captcha') + , lang('captcha_reload') + , lang('captcha_play') + , lang('cmd_input') + , lang('cmd_cancel') ); Context::close(); exit(); diff --git a/addons/member_communication/conf/info.xml b/addons/member_communication/conf/info.xml index d9419aec7..3ae24aac0 100644 --- a/addons/member_communication/conf/info.xml +++ b/addons/member_communication/conf/info.xml @@ -1,16 +1,16 @@ - [DEPRECATED] 커뮤니케이션 - [DEPRECATED] コミュニケーション - [DEPRECATED] 会员交流 - [DEPRECATED] Communication - [DEPRECATED] Truyền thông - [DEPRECATED] Communication - [DEPRECATED] Communication - [DEPRECATED] Общение - [DEPRECATED] 交流 + 커뮤니케이션 + コミュニケーション + 会员交流 + Communication + Truyền thông + Communication + Communication + Общение + 交流 - [DEPRECATED] 이 애드온은 빈 애드온입니다. 모든 기능은 커뮤니케이션 모듈로 이전되었습니다. + 이 애드온은 빈 애드온입니다. 모든 기능은 커뮤니케이션 모듈로 이전되었습니다. 1.7 2013-11-27 @@ -28,4 +28,4 @@ - \ No newline at end of file + diff --git a/addons/mobile/classes/hdml.class.php b/addons/mobile/classes/hdml.class.php index 7e67ce3f5..69205f741 100644 --- a/addons/mobile/classes/hdml.class.php +++ b/addons/mobile/classes/hdml.class.php @@ -55,7 +55,7 @@ class wap extends mobileXE { foreach($this->getChilds() as $key => $val) { if(!$val['link']) continue; - printf('%s%s',Context::getLang('cmd_select'), $val['href'], $val['text'], "\n"); + printf('%s%s',lang('cmd_select'), $val['href'], $val['text'], "\n"); } } else diff --git a/addons/mobile/classes/mhtml.class.php b/addons/mobile/classes/mhtml.class.php index 250878d11..34a9fe19b 100644 --- a/addons/mobile/classes/mhtml.class.php +++ b/addons/mobile/classes/mhtml.class.php @@ -71,11 +71,11 @@ class wap extends mobileXE 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"); + printf('%s
%s', $url, 'Language : '.lang('select_lang'), "\n"); } else { - printf('%s
%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n"); + printf('%s
%s', Context::get('return_uri'), lang('lang_return'), "\n"); } if($this->upperUrl) { diff --git a/addons/mobile/classes/mobile.class.php b/addons/mobile/classes/mobile.class.php index 53951e99e..946e5d7ea 100644 --- a/addons/mobile/classes/mobile.class.php +++ b/addons/mobile/classes/mobile.class.php @@ -168,12 +168,12 @@ class mobileXE 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')); + if($parent_item) $this->setUpperUrl(getUrl('','mid',$parent_item['mid']), lang('cmd_go_upper')); } } elseif (!$this->isNavigationMode()) { - $this->setUpperUrl(getUrl('','mid',$this->index_mid,'nm','1','cmid',0), Context::getLang('cmd_view_sitemap')); + $this->setUpperUrl(getUrl('','mid',$this->index_mid,'nm','1','cmid',0), lang('cmd_view_sitemap')); } } @@ -247,14 +247,14 @@ class mobileXE 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); + $text = sprintf('%s (%d/%d)', lang('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); + $text = sprintf('%s (%d/%d)', lang('cmd_next'), $this->mobilePage+1, $this->totalPage); $this->setNextUrl($url, $text); } } @@ -353,14 +353,14 @@ class mobileXE 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); + $text = sprintf('%s (%d/%d)', lang('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); + $text = sprintf('%s (%d/%d)', lang('cmd_next'), $this->mobilePage+1, $this->totalPage); $this->setNextUrl($url, $text); } @@ -442,7 +442,7 @@ class mobileXE function display() { // Home button assignments - $this->setHomeUrl(getUrl(), Context::getLang('cmd_go_home')); + $this->setHomeUrl(getUrl(), lang('cmd_go_home')); // Specify the title if(!$this->title) $this->setTitle(Context::getBrowserTitle()); @@ -520,7 +520,7 @@ class mobileXE $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')); + $this->setUpperUrl(getUrl('cmid',$upper_srl), lang('cmd_go_upper')); if(preg_match('/^([a-zA-Z0-9\_\-]+)$/', $cur_item['url'])) { $obj = array(); @@ -575,7 +575,7 @@ class mobileXE $lang_supported = Context::get('lang_supported'); $lang_type = Context::getLangType(); $obj = array(); - $obj['link'] = $obj['text'] = Context::getLang('president_lang').' : '.$lang_supported[$lang_type]; + $obj['link'] = $obj['text'] = lang('president_lang').' : '.$lang_supported[$lang_type]; $obj['href'] = getUrl('sel_lang',$lang_type); $childs[] = $obj; diff --git a/addons/mobile/classes/wml.class.php b/addons/mobile/classes/wml.class.php index d46c976a7..644e5d4b9 100644 --- a/addons/mobile/classes/wml.class.php +++ b/addons/mobile/classes/wml.class.php @@ -87,11 +87,11 @@ class wap extends mobileXE 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"); + printf('%s', 'Language : '.lang('select_lang'), $url, "\n"); } else { - printf('%s', Context::getLang('lang_return'), Context::get('return_uri'), "\n"); + printf('%s', lang('lang_return'), Context::get('return_uri'), "\n"); } if($this->homeUrl) { diff --git a/addons/oembed/jquery.oembed.js b/addons/oembed/jquery.oembed.js index dd17f4841..1bafb620e 100755 --- a/addons/oembed/jquery.oembed.js +++ b/addons/oembed/jquery.oembed.js @@ -5,1054 +5,952 @@ * Licensed under the MIT license * * Orignal Author: Richard Chamorro - * Forked by Andrew Mee to Provide a slightly diffent kind of embedding - * experience - * - * Modified : NAVER Corp. + * Forked by Andrew Mee to Provide a slightly diffent kind of embedding experience */ (function ($) { - $.fn.oembed = function (url, options, embedAction) { - settings = $.extend(true, $.fn.oembed.defaults, options); - var shortURLList = ["0rz.tw", "1link.in", "1url.com", "2.gp", "2big.at", "2tu.us", "3.ly", "307.to", "4ms.me", "4sq.com", "4url.cc", "6url.com", "7.ly", "a.gg", "a.nf", "aa.cx", "abcurl.net", - "ad.vu", "adf.ly", "adjix.com", "afx.cc", "all.fuseurl.com", "alturl.com", "amzn.to", "ar.gy", "arst.ch", "atu.ca", "azc.cc", "b23.ru", "b2l.me", "bacn.me", "bcool.bz", "binged.it", - "bit.ly", "bizj.us", "bloat.me", "bravo.ly", "bsa.ly", "budurl.com", "canurl.com", "chilp.it", "chzb.gr", "cl.lk", "cl.ly", "clck.ru", "cli.gs", "cliccami.info", - "clickthru.ca", "clop.in", "conta.cc", "cort.as", "cot.ag", "crks.me", "ctvr.us", "cutt.us", "dai.ly", "decenturl.com", "dfl8.me", "digbig.com", - "http:\/\/digg\.com\/[^\/]+$", "disq.us", "dld.bz", "dlvr.it", "do.my", "doiop.com", "dopen.us", "easyuri.com", "easyurl.net", "eepurl.com", "eweri.com", - "fa.by", "fav.me", "fb.me", "fbshare.me", "ff.im", "fff.to", "fire.to", "firsturl.de", "firsturl.net", "flic.kr", "flq.us", "fly2.ws", "fon.gs", "freak.to", - "fuseurl.com", "fuzzy.to", "fwd4.me", "fwib.net", "g.ro.lt", "gizmo.do", "gl.am", "go.9nl.com", "go.ign.com", "go.usa.gov", "goo.gl", "goshrink.com", "gurl.es", - "hex.io", "hiderefer.com", "hmm.ph", "href.in", "hsblinks.com", "htxt.it", "huff.to", "hulu.com", "hurl.me", "hurl.ws", "icanhaz.com", "idek.net", "ilix.in", "is.gd", - "its.my", "ix.lt", "j.mp", "jijr.com", "kl.am", "klck.me", "korta.nu", "krunchd.com", "l9k.net", "lat.ms", "liip.to", "liltext.com", "linkbee.com", "linkbun.ch", - "liurl.cn", "ln-s.net", "ln-s.ru", "lnk.gd", "lnk.ms", "lnkd.in", "lnkurl.com", "lru.jp", "lt.tl", "lurl.no", "macte.ch", "mash.to", "merky.de", "migre.me", "miniurl.com", - "minurl.fr", "mke.me", "moby.to", "moourl.com", "mrte.ch", "myloc.me", "myurl.in", "n.pr", "nbc.co", "nblo.gs", "nn.nf", "not.my", "notlong.com", "nsfw.in", - "nutshellurl.com", "nxy.in", "nyti.ms", "o-x.fr", "oc1.us", "om.ly", "omf.gd", "omoikane.net", "on.cnn.com", "on.mktw.net", "onforb.es", "orz.se", "ow.ly", "ping.fm", - "pli.gs", "pnt.me", "politi.co", "post.ly", "pp.gg", "profile.to", "ptiturl.com", "pub.vitrue.com", "qlnk.net", "qte.me", "qu.tc", "qy.fi", "r.ebay.com", "r.im", "rb6.me", "read.bi", - "readthis.ca", "reallytinyurl.com", "redir.ec", "redirects.ca", "redirx.com", "retwt.me", "ri.ms", "rickroll.it", "riz.gd", "rt.nu", "ru.ly", "rubyurl.com", "rurl.org", - "rww.tw", "s4c.in", "s7y.us", "safe.mn", "sameurl.com", "sdut.us", "shar.es", "shink.de", "shorl.com", "short.ie", "short.to", "shortlinks.co.uk", "shorturl.com", - "shout.to", "show.my", "shrinkify.com", "shrinkr.com", "shrt.fr", "shrt.st", "shrten.com", "shrunkin.com", "simurl.com", "slate.me", "smallr.com", "smsh.me", "smurl.name", - "sn.im", "snipr.com", "snipurl.com", "snurl.com", "sp2.ro", "spedr.com", "srnk.net", "srs.li", "starturl.com", "stks.co", "su.pr", "surl.co.uk", "surl.hu", "t.cn", "t.co", "t.lh.com", - "ta.gd", "tbd.ly", "tcrn.ch", "tgr.me", "tgr.ph", "tighturl.com", "tiniuri.com", "tiny.cc", "tiny.ly", "tiny.pl", "tinylink.in", "tinyuri.ca", "tinyurl.com", "tk.", "tl.gd", - "tmi.me", "tnij.org", "tnw.to", "tny.com", "to.ly", "togoto.us", "totc.us", "toysr.us", "tpm.ly", "tr.im", "tra.kz", "trunc.it", "twhub.com", "twirl.at", - "twitclicks.com", "twitterurl.net", "twitterurl.org", "twiturl.de", "twurl.cc", "twurl.nl", "u.mavrev.com", "u.nu", "u76.org", "ub0.cc", "ulu.lu", "updating.me", "ur1.ca", - "url.az", "url.co.uk", "url.ie", "url360.me", "url4.eu", "urlborg.com", "urlbrief.com", "urlcover.com", "urlcut.com", "urlenco.de", "urli.nl", "urls.im", - "urlshorteningservicefortwitter.com", "urlx.ie", "urlzen.com", "usat.ly", "use.my", "vb.ly", "vevo.ly", "vgn.am", "vl.am", "vm.lc", "w55.de", "wapo.st", "wapurl.co.uk", "wipi.es", - "wp.me", "x.vu", "xr.com", "xrl.in", "xrl.us", "xurl.es", "xurl.jp", "y.ahoo.it", "yatuc.com", "ye.pe", "yep.it", "yfrog.com", "yhoo.it", "yiyd.com", "youtu.be", "yuarel.com", - "z0p.de", "zi.ma", "zi.mu", "zipmyurl.com", "zud.me", "zurl.ws", "zz.gd", "zzang.kr", "›.ws", "✩.ws", "✿.ws", "❥.ws", "➔.ws", "➞.ws", "➡.ws", "➨.ws", "➯.ws", "➹.ws", "➽.ws" - ]; + $.fn.oembed = function (url, options, embedAction) { - if($('#jqoembeddata').length === 0) $('').appendTo('body'); + settings = $.extend(true, $.fn.oembed.defaults, options); + var shortURLList = ["0rz.tw", "1link.in", "1url.com", "2.gp", "2big.at", "2tu.us", "3.ly", "307.to", "4ms.me", "4sq.com", "4url.cc", "6url.com", "7.ly", "a.gg", "a.nf", "aa.cx", "abcurl.net", + "ad.vu", "adf.ly", "adjix.com", "afx.cc", "all.fuseurl.com", "alturl.com", "amzn.to", "ar.gy", "arst.ch", "atu.ca", "azc.cc", "b23.ru", "b2l.me", "bacn.me", "bcool.bz", "binged.it", + "bit.ly", "bizj.us", "bloat.me", "bravo.ly", "bsa.ly", "budurl.com", "canurl.com", "chilp.it", "chzb.gr", "cl.lk", "cl.ly", "clck.ru", "cli.gs", "cliccami.info", + "clickthru.ca", "clop.in", "conta.cc", "cort.as", "cot.ag", "crks.me", "ctvr.us", "cutt.us", "dai.ly", "decenturl.com", "dfl8.me", "digbig.com", + "http:\/\/digg\.com\/[^\/]+$", "disq.us", "dld.bz", "dlvr.it", "do.my", "doiop.com", "dopen.us", "easyuri.com", "easyurl.net", "eepurl.com", "eweri.com", + "fa.by", "fav.me", "fb.me", "fbshare.me", "ff.im", "fff.to", "fire.to", "firsturl.de", "firsturl.net", "flic.kr", "flq.us", "fly2.ws", "fon.gs", "freak.to", + "fuseurl.com", "fuzzy.to", "fwd4.me", "fwib.net", "g.ro.lt", "gizmo.do", "gl.am", "go.9nl.com", "go.ign.com", "go.usa.gov", "goo.gl", "goshrink.com", "gurl.es", + "hex.io", "hiderefer.com", "hmm.ph", "href.in", "hsblinks.com", "htxt.it", "huff.to", "hulu.com", "hurl.me", "hurl.ws", "icanhaz.com", "idek.net", "ilix.in", "is.gd", + "its.my", "ix.lt", "j.mp", "jijr.com", "kl.am", "klck.me", "korta.nu", "krunchd.com", "l9k.net", "lat.ms", "liip.to", "liltext.com", "linkbee.com", "linkbun.ch", + "liurl.cn", "ln-s.net", "ln-s.ru", "lnk.gd", "lnk.ms", "lnkd.in", "lnkurl.com", "lru.jp", "lt.tl", "lurl.no", "macte.ch", "mash.to", "merky.de", "migre.me", "miniurl.com", + "minurl.fr", "mke.me", "moby.to", "moourl.com", "mrte.ch", "myloc.me", "myurl.in", "n.pr", "nbc.co", "nblo.gs", "nn.nf", "not.my", "notlong.com", "nsfw.in", + "nutshellurl.com", "nxy.in", "nyti.ms", "o-x.fr", "oc1.us", "om.ly", "omf.gd", "omoikane.net", "on.cnn.com", "on.mktw.net", "onforb.es", "orz.se", "ow.ly", "ping.fm", + "pli.gs", "pnt.me", "politi.co", "post.ly", "pp.gg", "profile.to", "ptiturl.com", "pub.vitrue.com", "qlnk.net", "qte.me", "qu.tc", "qy.fi", "r.ebay.com", "r.im", "rb6.me", "read.bi", + "readthis.ca", "reallytinyurl.com", "redir.ec", "redirects.ca", "redirx.com", "retwt.me", "ri.ms", "rickroll.it", "riz.gd", "rt.nu", "ru.ly", "rubyurl.com", "rurl.org", + "rww.tw", "s4c.in", "s7y.us", "safe.mn", "sameurl.com", "sdut.us", "shar.es", "shink.de", "shorl.com", "short.ie", "short.to", "shortlinks.co.uk", "shorturl.com", + "shout.to", "show.my", "shrinkify.com", "shrinkr.com", "shrt.fr", "shrt.st", "shrten.com", "shrunkin.com", "simurl.com", "slate.me", "smallr.com", "smsh.me", "smurl.name", + "sn.im", "snipr.com", "snipurl.com", "snurl.com", "sp2.ro", "spedr.com", "srnk.net", "srs.li", "starturl.com", "stks.co", "su.pr", "surl.co.uk", "surl.hu", "t.cn", "t.co", "t.lh.com", + "ta.gd", "tbd.ly", "tcrn.ch", "tgr.me", "tgr.ph", "tighturl.com", "tiniuri.com", "tiny.cc", "tiny.ly", "tiny.pl", "tinylink.in", "tinyuri.ca", "tinyurl.com", "tk.", "tl.gd", + "tmi.me", "tnij.org", "tnw.to", "tny.com", "to.ly", "togoto.us", "totc.us", "toysr.us", "tpm.ly", "tr.im", "tra.kz", "trunc.it", "twhub.com", "twirl.at", + "twitclicks.com", "twitterurl.net", "twitterurl.org", "twiturl.de", "twurl.cc", "twurl.nl", "u.mavrev.com", "u.nu", "u76.org", "ub0.cc", "ulu.lu", "updating.me", "ur1.ca", + "url.az", "url.co.uk", "url.ie", "url360.me", "url4.eu", "urlborg.com", "urlbrief.com", "urlcover.com", "urlcut.com", "urlenco.de", "urli.nl", "urls.im", + "urlshorteningservicefortwitter.com", "urlx.ie", "urlzen.com", "usat.ly", "use.my", "vb.ly", "vevo.ly", "vgn.am", "vl.am", "vm.lc", "w55.de", "wapo.st", "wapurl.co.uk", "wipi.es", + "wp.me", "x.vu", "xr.com", "xrl.in", "xrl.us", "xurl.es", "xurl.jp", "y.ahoo.it", "yatuc.com", "ye.pe", "yep.it", "yfrog.com", "yhoo.it", "yiyd.com", "youtu.be", "yuarel.com", + "z0p.de", "zi.ma", "zi.mu", "zipmyurl.com", "zud.me", "zurl.ws", "zz.gd", "zzang.kr", "›.ws", "✩.ws", "✿.ws", "❥.ws", "➔.ws", "➞.ws", "➡.ws", "➨.ws", "➯.ws", "➹.ws", "➽.ws"]; - return this.each(function () { - var container = $(this), - resourceURL = (url && (!url.indexOf('http://') || !url.indexOf('https://'))) ? url : container.attr("href"), - provider; + if ($('#jqoembeddata').length === 0) $('').appendTo('body'); - if(embedAction) { - settings.onEmbed = embedAction; - } else if(!settings.onEmbed) { - settings.onEmbed = function (oembedData) { - $.fn.oembed.insertCode(this, settings.embedMethod, oembedData); - }; - } + return this.each(function () { + var container = $(this), + resourceURL = (url && (!url.indexOf('http://') || !url.indexOf('https://'))) ? url : container.attr("href"), + provider; - if(resourceURL !== null && resourceURL !== undefined) { - //Check if shorten URL - for(var j = 0, l = shortURLList.length; j < l; j++) { - var regExp = new RegExp('://' + shortURLList[j] + '/', "i"); - if(resourceURL.match(regExp) !== null) { - //AJAX to http://api.longurl.org/v2/expand?url=http://bit.ly/JATvIs&format=json&callback=hhh - var ajaxopts = $.extend({ - url: "http://api.longurl.org/v2/expand", - dataType: 'jsonp', - data: { - url: resourceURL, - format: "json" - //callback: "?" - }, - success: function (data) { - //this = $.fn.oembed; - resourceURL = data['long-url']; - provider = $.fn.oembed.getOEmbedProvider(data['long-url']); + if (embedAction) { + settings.onEmbed = embedAction; + } + else if (!settings.onEmbed) { + settings.onEmbed = function (oembedData) { + $.fn.oembed.insertCode(this, settings.embedMethod, oembedData); + }; + } - if(provider !== null) { - provider.params = getNormalizedParams(settings[provider.name]) || {}; - provider.maxWidth = settings.maxWidth; - provider.maxHeight = settings.maxHeight; - embedCode(container, resourceURL, provider); - } else { - settings.onProviderNotFound.call(container, resourceURL); - } - } - }, settings.ajaxOptions || {}); + if (resourceURL !== null && resourceURL !== undefined) { + //Check if shorten URL + for (var j = 0, l = shortURLList.length; j < l; j++) { + var regExp = new RegExp('://' + shortURLList[j] + '/', "i"); + + provider = $.fn.oembed.getOEmbedProvider(resourceURL); - $.ajax(ajaxopts); + if (!provider && window.location.protocol !== "https:" && resourceURL.match(regExp) !== null) { + //AJAX to http://api.longurl.org/v2/expand?url=http://bit.ly/JATvIs&format=json&callback=hhh + var ajaxopts = $.extend({ + url: "http://api.longurl.org/v2/expand", + dataType: 'jsonp', + data: { + url: resourceURL, + format: "json" + //callback: "?" + }, + success: function (data) { + //this = $.fn.oembed; + resourceURL = data['long-url']; + provider = $.fn.oembed.getOEmbedProvider(data['long-url']); - return container; - } - } - provider = $.fn.oembed.getOEmbedProvider(resourceURL); + //remove fallback + if (!!settings.fallback === false) { + provider = provider.name.toLowerCase() === 'opengraph' ? null : provider; + } - if(provider !== null) { - provider.params = getNormalizedParams(settings[provider.name]) || {}; - provider.maxWidth = settings.maxWidth; - provider.maxHeight = settings.maxHeight; - embedCode(container, resourceURL, provider); - } else { - settings.onProviderNotFound.call(container, resourceURL); - } - } + if (provider !== null) { + provider.params = getNormalizedParams(settings[provider.name]) || {}; + provider.maxWidth = settings.maxWidth; + provider.maxHeight = settings.maxHeight; + embedCode(container, resourceURL, provider); + } else { + settings.onProviderNotFound.call(container, resourceURL); + } + }, + error: function () { + settings.onError.call(container, resourceURL) + } + }, settings.longUrlAjaxOptions || settings.ajaxOptions || {}); - return container; - }); + $.ajax(ajaxopts); + + return container; + } + } + + //remove fallback + if (!!settings.fallback === false) { + provider = provider.name.toLowerCase() === 'opengraph' ? null : provider; + } + if (provider !== null) { + provider.params = getNormalizedParams(settings[provider.name]) || {}; + provider.maxWidth = settings.maxWidth; + provider.maxHeight = settings.maxHeight; + embedCode(container, resourceURL, provider); + } else { + settings.onProviderNotFound.call(container, resourceURL); + } + } + return container; + }); + }; + + var settings; + + // Plugin defaults + $.fn.oembed.defaults = { + fallback: true, + maxWidth: null, + maxHeight: null, + includeHandle: true, + embedMethod: 'auto', + // "auto", "append", "fill" + onProviderNotFound: function () { + }, + beforeEmbed: function () { + }, + afterEmbed: function () { + }, + onEmbed: false, + onError: function (a, b, c, d) { + console.log('err:', a, b, c, d) + }, + ajaxOptions: {}, + longUrlAjaxOptions: {} + }; + + /* Private functions */ + function rand(length, current) { //Found on http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript + current = current ? current : ''; + return length ? rand(--length, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(Math.random() * 60)) + current) : current; + } + + function getRequestUrl(provider, externalUrl) { + var url = provider.apiendpoint, + qs = "", + i; + url += (url.indexOf("?") <= 0) ? "?" : "&"; + url = url.replace('#', '%23'); + + if (provider.maxWidth !== null && (typeof provider.params.maxwidth === 'undefined' || provider.params.maxwidth === null)) { + provider.params.maxwidth = provider.maxWidth; + } + + if (provider.maxHeight !== null && (typeof provider.params.maxheight === 'undefined' || provider.params.maxheight === null)) { + provider.params.maxheight = provider.maxHeight; + } + + for (i in provider.params) { + // We don't want them to jack everything up by changing the callback parameter + if (i == provider.callbackparameter) + continue; + + // allows the options to be set to null, don't send null values to the server as parameters + if (provider.params[i] !== null) + qs += "&" + escape(i) + "=" + provider.params[i]; + } + + url += "format=" + provider.format + "&url=" + escape(externalUrl) + qs; + if (provider.dataType != 'json') + url += "&" + provider.callbackparameter + "=?"; + + return url; + } + + function success(oembedData, externalUrl, container) { + $('#jqoembeddata').data(externalUrl, oembedData.code); + settings.beforeEmbed.call(container, oembedData); + settings.onEmbed.call(container, oembedData); + settings.afterEmbed.call(container, oembedData); + } + + function embedCode(container, externalUrl, embedProvider) { + if ($('#jqoembeddata').data(externalUrl) != undefined && embedProvider.embedtag.tag != 'iframe') { + var oembedData = {code: $('#jqoembeddata').data(externalUrl)}; + success(oembedData, externalUrl, container); + } else if (embedProvider.yql) { + var from = embedProvider.yql.from || 'htmlstring'; + var url = embedProvider.yql.url ? embedProvider.yql.url(externalUrl) : externalUrl; + var query = 'SELECT * FROM ' + from + + ' WHERE url="' + (url) + '"' + + " and " + (/html/.test(from) ? 'xpath' : 'itemPath') + "='" + (embedProvider.yql.xpath || '/') + "'"; + if (from == 'html') + query += " and compat='html5'"; + var ajaxopts = $.extend({ + url: "//query.yahooapis.com/v1/public/yql", + dataType: 'jsonp', + data: { + q: query, + format: "json", + env: 'store://datatables.org/alltableswithkeys', + callback: "?" + }, + success: function (data) { + var result; + + if (embedProvider.yql.xpath && embedProvider.yql.xpath == '//meta|//title|//link') { + var meta = {}; + + if (data.query == null) { + data.query = {}; + } + if (data.query.results == null) { + data.query.results = {"meta": []}; + } + for (var i = 0, l = data.query.results.meta.length; i < l; i++) { + var name = data.query.results.meta[i].name || data.query.results.meta[i].property || null; + if (name == null)continue; + meta[name.toLowerCase()] = data.query.results.meta[i].content; + } + if (!meta.hasOwnProperty("title") || !meta.hasOwnProperty("og:title")) { + if (data.query.results.title != null) { + meta.title = data.query.results.title; + } + } + if (!meta.hasOwnProperty("og:image") && data.query.results.hasOwnProperty("link")) { + for (var i = 0, l = data.query.results.link.length; i < l; i++) { + if (data.query.results.link[i].hasOwnProperty("rel")) { + if (data.query.results.link[i].rel == "apple-touch-icon") { + if (data.query.results.link[i].href.charAt(0) == "/") { + meta["og:image"] = url.match(/^(([a-z]+:)?(\/\/)?[^\/]+\/).*$/)[1] + data.query.results.link[i].href; + } else { + meta["og:image"] = data.query.results.link[i].href; + } + } + } + } + } + result = embedProvider.yql.datareturn(meta); + } else { + result = embedProvider.yql.datareturn ? embedProvider.yql.datareturn(data.query.results) : data.query.results.result; + } + if (result === false)return; + var oembedData = $.extend({}, result); + oembedData.code = result; + success(oembedData, externalUrl, container); + }, + error: settings.onError.call(container, externalUrl, embedProvider) + }, settings.ajaxOptions || {}); + $.ajax(ajaxopts); + } else if (embedProvider.templateRegex) { + if (embedProvider.embedtag.tag !== '') { + var flashvars = embedProvider.embedtag.flashvars || ''; + var tag = embedProvider.embedtag.tag || 'embed'; + var width = embedProvider.embedtag.width || 'auto'; + var height = embedProvider.embedtag.height || 'auto'; + var src = externalUrl.replace(embedProvider.templateRegex, embedProvider.apiendpoint); + + if (!embedProvider.nocache) { + src += '&jqoemcache=' + rand(5); + } + + if (embedProvider.apikey) { + src = src.replace('_APIKEY_', settings.apikeys[embedProvider.name]); + } + + var code = $('<' + tag + '/>').attr('src', src).attr('width', width) + .attr('height', height) + .attr('allowfullscreen', embedProvider.embedtag.allowfullscreen || 'true') + .attr('allowscriptaccess', embedProvider.embedtag.allowfullscreen || 'always') + .css('max-height', settings.maxHeight || 'auto') + .css('max-width', settings.maxWidth || 'auto'); + + if (tag == 'embed') { + code.attr('type', embedProvider.embedtag.type || "application/x-shockwave-flash") + .attr('flashvars', externalUrl.replace(embedProvider.templateRegex, flashvars)); + } + + if (tag == 'iframe') { + code.attr('scrolling', embedProvider.embedtag.scrolling || "no") + .attr('frameborder', embedProvider.embedtag.frameborder || "0"); + + } + + success({code: code}, externalUrl, container); + } else if (embedProvider.apiendpoint) { + //Add APIkey if true + if (embedProvider.apikey) + embedProvider.apiendpoint = embedProvider.apiendpoint.replace('_APIKEY_', settings.apikeys[embedProvider.name]); + + ajaxopts = $.extend({ + url: externalUrl.replace(embedProvider.templateRegex, embedProvider.apiendpoint), + dataType: 'jsonp', + success: function (data) { + var oembedData = $.extend({}, data); + oembedData.code = embedProvider.templateData(data); + success(oembedData, externalUrl, container); + }, + error: settings.onError.call(container, externalUrl, embedProvider) + }, settings.ajaxOptions || {}); + $.ajax(ajaxopts); + } else { + success({code: externalUrl.replace(embedProvider.templateRegex, embedProvider.template)}, externalUrl, container); + } + } else { + + var requestUrl = getRequestUrl(embedProvider, externalUrl); + ajaxopts = $.extend({ + url: requestUrl, + dataType: embedProvider.dataType || 'jsonp', + success: function (data) { + var oembedData = $.extend({}, data); + switch (oembedData.type) { + case "file": //Deviant Art has this + case "photo": + oembedData.code = $.fn.oembed.getPhotoCode(externalUrl, oembedData); + break; + case "video": + case "rich": + oembedData.code = $.fn.oembed.getRichCode(externalUrl, oembedData); + break; + default: + oembedData.code = $.fn.oembed.getGenericCode(externalUrl, oembedData); + break; + } + success(oembedData, externalUrl, container); + }, + error: settings.onError.call(container, externalUrl, embedProvider) + }, settings.ajaxOptions || {}); + $.ajax(ajaxopts); + } + } + + function getNormalizedParams(params) { + if (params === null) return null; + var key, normalizedParams = {}; + for (key in params) { + if (key !== null) normalizedParams[key.toLowerCase()] = params[key]; + } + return normalizedParams; + } + + /* Public functions */ + $.fn.oembed.insertCode = function (container, embedMethod, oembedData) { + if (oembedData === null) + return; + + if (embedMethod === 'auto' && container.attr('href') !== null) { + embedMethod = 'append'; + } else if (embedMethod == 'auto') { + embedMethod = 'replace'; + } + + switch (embedMethod) { + case "replace": + container.replaceWith(oembedData.code); + break; + case "fill": + container.html(oembedData.code); + break; + case "append": + container.wrap('
'); + var oembedContainer = container.parent(); + if (settings.includeHandle) { + $('').insertBefore(container).click(function () { + var encodedString = encodeURIComponent($(this).text()); + $(this).html((encodedString == '%E2%86%91') ? '↓' : '↑'); + $(this).parent().children().last().toggle(); + }); + } + oembedContainer.append('
'); + try { + oembedData.code.clone().appendTo(oembedContainer); + } catch (e) { + oembedContainer.append(oembedData.code); + } + /* Make videos semi-responsive + * If parent div width less than embeded iframe video then iframe gets shrunk to fit smaller width + * If parent div width greater thans embed iframe use the max widht + * - works on youtubes and vimeo + */ + if (settings.maxWidth) { + var post_width = oembedContainer.parent().width(); + if (post_width < settings.maxWidth) { + var iframe_width_orig = $('iframe', oembedContainer).width(); + var iframe_height_orig = $('iframe', oembedContainer).height(); + var ratio = iframe_width_orig / post_width; + $('iframe', oembedContainer).width(iframe_width_orig / ratio); + $('iframe', oembedContainer).height(iframe_height_orig / ratio); + } else { + if (settings.maxWidth) { + $('iframe', oembedContainer).width(settings.maxWidth); + } + if (settings.maxHeight) { + $('iframe', oembedContainer).height(settings.maxHeight); + } + } + } + break; + } + }; + + $.fn.oembed.getPhotoCode = function (url, oembedData) { + var code; + var alt = oembedData.title ? oembedData.title : ''; + alt += oembedData.author_name ? ' - ' + oembedData.author_name : ''; + alt += oembedData.provider_name ? ' - ' + oembedData.provider_name : ''; + + if (oembedData.url) { + code = '
' + alt + '
'; + } else if (oembedData.thumbnail_url) { + var newURL = oembedData.thumbnail_url.replace('_s', '_b'); + code = '
' + alt + '
'; + } else { + code = '
Error loading this picture
'; + } + + if (oembedData.html) { + code += "
" + oembedData.html + "
"; + } + + return code; + }; + + $.fn.oembed.getRichCode = function (url, oembedData) { + return oembedData.html; + }; + + $.fn.oembed.getGenericCode = function (url, oembedData) { + var title = ((oembedData.title) && (oembedData.title !== null)) ? oembedData.title : url; + var code = '' + title + ''; + + if (oembedData.html) { + code += "
" + oembedData.html + "
"; + } + + return code; + }; + + $.fn.oembed.getOEmbedProvider = function (url) { + for (var i = 0; i < $.fn.oembed.providers.length; i++) { + for (var j = 0, l = $.fn.oembed.providers[i].urlschemes.length; j < l; j++) { + var regExp = new RegExp($.fn.oembed.providers[i].urlschemes[j], "i"); + + if (url.match(regExp) !== null) + return $.fn.oembed.providers[i]; + } + } + return null; + }; + + // Constructor Function for OEmbedProvider Class. + $.fn.oembed.OEmbedProvider = function (name, type, urlschemesarray, apiendpoint, extraSettings) { + this.name = name; + this.type = type; // "photo", "video", "link", "rich", null + this.urlschemes = urlschemesarray; + this.apiendpoint = apiendpoint; + this.maxWidth = 500; + this.maxHeight = 400; + extraSettings = extraSettings || {}; + + if (extraSettings.useYQL) { + + if (extraSettings.useYQL == 'xml') { + extraSettings.yql = { + xpath: "//oembed/html", + from: 'xml', + apiendpoint: this.apiendpoint, + url: function (externalurl) { + return this.apiendpoint + '?format=xml&url=' + externalurl + }, + datareturn: function (results) { + return results.html.replace(/.*\[CDATA\[(.*)\]\]>$/, '$1') || '' + } + }; + } else { + extraSettings.yql = { + from: 'json', + apiendpoint: this.apiendpoint, + url: function (externalurl) { + return this.apiendpoint + '?format=json&url=' + externalurl + }, + datareturn: function (results) { + if (results.json.type != 'video' && (results.json.url || results.json.thumbnail_url)) { + return ''; + } + return results.json.html || '' + } + }; + } + this.apiendpoint = null; + } - }; + for (var property in extraSettings) { + this[property] = extraSettings[property]; + } - var settings; + this.format = this.format || 'json'; + this.callbackparameter = this.callbackparameter || "callback"; + this.embedtag = this.embedtag || {tag: ""}; - // Plugin defaults - $.fn.oembed.defaults = { - maxWidth: null, - maxHeight: null, - includeHandle: true, - embedMethod: 'auto', - // "auto", "append", "fill" - onProviderNotFound: function () {}, - beforeEmbed: function () {}, - afterEmbed: function () {}, - onEmbed: false, - onError: function () {}, - ajaxOptions: {} - }; - /* Private functions */ - function rand(length, current) { //Found on http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript - current = current ? current : ''; - return length ? rand(--length, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz".charAt(Math.floor(Math.random() * 60)) + current) : current; - } + }; - function getRequestUrl(provider, externalUrl) { - var url = provider.apiendpoint, - qs = "", - i; - url += (url.indexOf("?") <= 0) ? "?" : "&"; - url = url.replace('#', '%23'); + /* + * Function to update existing providers + * + * @param {String} name The name of the provider + * @param {String} type The type of the provider can be "file", "photo", "video", "rich" + * @param {String} urlshemesarray Array of url of the provider + * @param {String} apiendpoint The endpoint of the provider + * @param {String} extraSettings Extra settings of the provider + */ + $.fn.updateOEmbedProvider = function (name, type, urlschemesarray, apiendpoint, extraSettings) { + for (var i = 0; i < $.fn.oembed.providers.length; i++) { + if ($.fn.oembed.providers[i].name === name) { + if (type !== null) { + $.fn.oembed.providers[i].type = type; + } + if (urlschemesarray !== null) { + $.fn.oembed.providers[i].urlschemes = urlschemesarray; + } + if (apiendpoint !== null) { + $.fn.oembed.providers[i].apiendpoint = apiendpoint; + } + if (extraSettings !== null) { + $.fn.oembed.providers[i].extraSettings = extraSettings; + for (var property in extraSettings) { + if (property !== null && extraSettings[property] !== null) { + $.fn.oembed.providers[i][property] = extraSettings[property]; + } + } + } + } + } + }; - if(provider.maxWidth !== null && (typeof provider.params.maxwidth === 'undefined' || provider.params.maxwidth === null)) { - provider.params.maxwidth = provider.maxWidth; - } + /* Native & common providers */ + $.fn.oembed.providers = [ - if(provider.maxHeight !== null && (typeof provider.params.maxheight === 'undefined' || provider.params.maxheight === null)) { - provider.params.maxheight = provider.maxHeight; - } + //Video + new $.fn.oembed.OEmbedProvider("youtube", "video", ["youtube\\.com/watch.+v=[\\w-]+&?", "youtu\\.be/[\\w-]+", "youtube.com/embed"], '//www.youtube.com/embed/$1?wmode=transparent', { + templateRegex: /.*(?:v\=|be\/|embed\/)([\w\-]+)&?.*/, embedtag: {tag: 'iframe', width: '425', height: '349'} + }), - for(i in provider.params) { - // We don't want them to jack everything up by changing the callback parameter - if(i == provider.callbackparameter) continue; + //new $.fn.oembed.OEmbedProvider("youtube", "video", ["youtube\\.com/watch.+v=[\\w-]+&?", "youtu\\.be/[\\w-]+"], 'http://www.youtube.com/oembed', {useYQL:'json'}), + //new $.fn.oembed.OEmbedProvider("youtubeiframe", "video", ["youtube.com/embed"], "$1?wmode=transparent", + // {templateRegex:/(.*)/,embedtag : {tag: 'iframe', width:'425',height: '349'}}), + new $.fn.oembed.OEmbedProvider("wistia", "video", ["wistia.com/medias/.+", "wistia.com/m/.+", "wistia.com/embed/.+", "wi.st/m/.+", "wi.st/embed/.+"], 'http://fast.wistia.com/oembed', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("xtranormal", "video", ["xtranormal\\.com/watch/.+"], "http://www.xtranormal.com/xtraplayr/$1/$2", { + templateRegex: /.*com\/watch\/([\w\-]+)\/([\w\-]+).*/, embedtag: {tag: 'iframe', width: '320', height: '269'}}), + new $.fn.oembed.OEmbedProvider("scivee", "video", ["scivee.tv/node/.+"], "http://www.scivee.tv/flash/embedCast.swf?", { + templateRegex: /.*tv\/node\/(.+)/, embedtag: {width: '480', height: '400', flashvars: "id=$1&type=3"}}), + new $.fn.oembed.OEmbedProvider("veoh", "video", ["veoh.com/watch/.+"], "http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1337&permalinkId=$1&player=videodetailsembedded&videoAutoPlay=0&id=anonymous", { + templateRegex: /.*watch\/([^\?]+).*/, embedtag: {width: '410', height: '341'}}), + new $.fn.oembed.OEmbedProvider("gametrailers", "video", ["gametrailers\\.com/video/.+"], "http://media.mtvnservices.com/mgid:moses:video:gametrailers.com:$2", { + templateRegex: /.*com\/video\/([\w\-]+)\/([\w\-]+).*/, embedtag: {width: '512', height: '288' }}), + new $.fn.oembed.OEmbedProvider("funnyordie", "video", ["funnyordie\\.com/videos/.+"], "http://player.ordienetworks.com/flash/fodplayer.swf?", { + templateRegex: /.*videos\/([^\/]+)\/([^\/]+)?/, embedtag: {width: 512, height: 328, flashvars: "key=$1"}}), + new $.fn.oembed.OEmbedProvider("colledgehumour", "video", ["collegehumor\\.com/video/.+"], "http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=$1&use_node_id=true&fullscreen=1", + {templateRegex: /.*video\/([^\/]+).*/, embedtag: {width: 600, height: 338}}), + new $.fn.oembed.OEmbedProvider("metacafe", "video", ["metacafe\\.com/watch/.+"], "http://www.metacafe.com/fplayer/$1/$2.swf", + {templateRegex: /.*watch\/(\d+)\/(\w+)\/.*/, embedtag: {width: 400, height: 345}}), + new $.fn.oembed.OEmbedProvider("bambuser", "video", ["bambuser\\.com\/channel\/.*\/broadcast\/.*"], "http://static.bambuser.com/r/player.swf?vid=$1", + {templateRegex: /.*bambuser\.com\/channel\/.*\/broadcast\/(\w+).*/, embedtag: {width: 512, height: 339 }}), + new $.fn.oembed.OEmbedProvider("twitvid", "video", ["twitvid\\.com/.+"], "http://www.twitvid.com/embed.php?guid=$1&autoplay=0", + {templateRegex: /.*twitvid\.com\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }}), + new $.fn.oembed.OEmbedProvider("aniboom", "video", ["aniboom\\.com/animation-video/.+"], "http://api.aniboom.com/e/$1", + {templateRegex: /.*animation-video\/(\d+).*/, embedtag: {width: 594, height: 334}}), + new $.fn.oembed.OEmbedProvider("vzaar", "video", ["vzaar\\.com/videos/.+", "vzaar.tv/.+"], "http://view.vzaar.com/$1/player?", + {templateRegex: /.*\/(\d+).*/, embedtag: {tag: 'iframe', width: 576, height: 324 }}), + new $.fn.oembed.OEmbedProvider("snotr", "video", ["snotr\\.com/video/.+"], "http://www.snotr.com/embed/$1", + {templateRegex: /.*\/(\d+).*/, embedtag: {tag: 'iframe', width: 400, height: 330}, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("youku", "video", ["v.youku.com/v_show/id_.+"], "http://player.youku.com/player.php/sid/$1/v.swf", + {templateRegex: /.*id_(.+)\.html.*/, embedtag: {width: 480, height: 400}, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("tudou", "video", ["tudou.com/programs/view/.+\/"], "http://www.tudou.com/v/$1/v.swf", + {templateRegex: /.*view\/(.+)\//, embedtag: {width: 480, height: 400}, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("embedr", "video", ["embedr\\.com/playlist/.+"], "http://embedr.com/swf/slider/$1/425/520/default/false/std?", + {templateRegex: /.*playlist\/([^\/]+).*/, embedtag: {width: 425, height: 520}}), + new $.fn.oembed.OEmbedProvider("blip", "video", ["blip\\.tv/.+"], "//blip.tv/oembed/"), + new $.fn.oembed.OEmbedProvider("minoto-video", "video", ["http://api.minoto-video.com/publishers/.+/videos/.+", "http://dashboard.minoto-video.com/main/video/details/.+", "http://embed.minoto-video.com/.+"], "http://api.minoto-video.com/services/oembed.json", {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("animoto", "video", ["animoto.com/play/.+"], "http://animoto.com/services/oembed"), + new $.fn.oembed.OEmbedProvider("hulu", "video", ["hulu\\.com/watch/.*"], "//www.hulu.com/api/oembed.json"), + new $.fn.oembed.OEmbedProvider("ustream", "video", ["ustream\\.tv/recorded/.*"], "http://www.ustream.tv/oembed", {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("videojug", "video", ["videojug\\.com/(film|payer|interview).*"], "http://www.videojug.com/oembed.json", {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("sapo", "video", ["videos\\.sapo\\.pt/.*"], "http://videos.sapo.pt/oembed", {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("vodpod", "video", ["vodpod.com/watch/.*"], "http://vodpod.com/oembed.js", {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("vimeo", "video", ["www\.vimeo\.com\/groups\/.*\/videos\/.*", "www\.vimeo\.com\/.*", "vimeo\.com\/groups\/.*\/videos\/.*", "vimeo\.com\/.*"], "//vimeo.com/api/oembed.json"), + new $.fn.oembed.OEmbedProvider("dailymotion", "video", ["dailymotion\\.com/.+"], '//www.dailymotion.com/services/oembed'), + new $.fn.oembed.OEmbedProvider("5min", "video", ["www\\.5min\\.com/.+"], 'http://api.5min.com/oembed.xml', {useYQL: 'xml'}), + new $.fn.oembed.OEmbedProvider("National Film Board of Canada", "video", ["nfb\\.ca/film/.+"], 'http://www.nfb.ca/remote/services/oembed/', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("qik", "video", ["qik\\.com/\\w+"], 'http://qik.com/api/oembed.json', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("revision3", "video", ["revision3\\.com"], "http://revision3.com/api/oembed/"), + new $.fn.oembed.OEmbedProvider("dotsub", "video", ["dotsub\\.com/view/.+"], "http://dotsub.com/services/oembed", {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("clikthrough", "video", ["clikthrough\\.com/theater/video/\\d+"], "http://clikthrough.com/services/oembed"), + new $.fn.oembed.OEmbedProvider("Kinomap", "video", ["kinomap\\.com/.+"], "http://www.kinomap.com/oembed"), + new $.fn.oembed.OEmbedProvider("VHX", "video", ["vhx.tv/.+"], "http://vhx.tv/services/oembed.json"), + new $.fn.oembed.OEmbedProvider("bambuser", "video", ["bambuser.com/.+"], "http://api.bambuser.com/oembed/iframe.json"), + new $.fn.oembed.OEmbedProvider("justin.tv", "video", ["justin.tv/.+"], 'http://api.justin.tv/api/embed/from_url.json', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("vine", "video", ["vine.co/v/.*"], null, + { + templateRegex: /https?:\/\/w?w?w?.?vine\.co\/v\/([a-zA-Z0-9]*).*/, + template: '' + + '', + nocache: 1 + }), + new $.fn.oembed.OEmbedProvider("boxofficebuz", "video", ["boxofficebuz\\.com\\/embed/.+"], "http://boxofficebuz.com/embed/$1/$2", {templateRegex: [/.*boxofficebuz\.com\/embed\/(\w+)\/([\w*\-*]+)/], embedtag: {tag: 'iframe', width: 480, height: 360 }}), + new $.fn.oembed.OEmbedProvider("clipsyndicate", "video", ["clipsyndicate\\.com/video/play/.+", "clipsyndicate\\.com/embed/iframe\?.+"], "http://eplayer.clipsyndicate.com/embed/iframe?pf_id=1&show_title=0&va_id=$1&windows=1", {templateRegex: [/.*www\.clipsyndicate\.com\/video\/play\/(\w+)\/.*/, /.*eplayer\.clipsyndicate\.com\/embed\/iframe\?.*va_id=(\w+).*.*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("coub", "video", ["coub\\.com/.+"], "http://www.coub.com/embed/$1?muted=false&autostart=false&originalSize=false&hideTopBar=false&noSiteButtons=false&startWithHD=false", {templateRegex: [/.*coub\.com\/embed\/(\w+)\?*.*/, /.*coub\.com\/view\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("discoverychannel", "video", ["snagplayer\\.video\\.dp\\.discovery\\.com/.+"], "http://snagplayer.video.dp.discovery.com/$1/snag-it-player.htm?auto=no", {templateRegex: [/.*snagplayer\.video\.dp\.discovery\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }}), + new $.fn.oembed.OEmbedProvider("telly", "video", ["telly\\.com/.+"], "http://www.telly.com/embed.php?guid=$1&autoplay=0", {templateRegex: [/.*telly\.com\/embed\.php\?guid=(\w+).*/, /.*telly\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }}), + new $.fn.oembed.OEmbedProvider("minilogs", "video", ["minilogs\\.com/.+"], "http://www.minilogs.com/e/$1", {templateRegex: [/.*minilogs\.com\/e\/(\w+).*/, /.*minilogs\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("viddy", "video", ["viddy\\.com/.+"], "http://www.viddy.com/embed/video/$1", {templateRegex: [/.*viddy\.com\/embed\/video\/(\.*)/, /.*viddy\.com\/video\/(\.*)/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("worldstarhiphop", "video", ["worldstarhiphop\\.com\/embed/.+"], "http://www.worldstarhiphop.com/embed/$1", {templateRegex: /.*worldstarhiphop\.com\/embed\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("zapiks", "video", ["zapiks\\.fr\/.+"], "http://www.zapiks.fr/index.php?action=playerIframe&media_id=$1&autoStart=fals", {templateRegex: /.*zapiks\.fr\/index.php\?[\w\=\&]*media_id=(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - // allows the options to be set to null, don't send null values to the server as parameters - if(provider.params[i] !== null) qs += "&" + escape(i) + "=" + provider.params[i]; - } + //Audio + new $.fn.oembed.OEmbedProvider("official.fm", "rich", ["official.fm/.+"], 'http://official.fm/services/oembed', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("chirbit", "rich", ["chirb.it/.+"], 'http://chirb.it/oembed.json', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("chirbit", "audio", ["chirb\\.it/.+"], "http://chirb.it/wp/$1", {templateRegex: [/.*chirb\.it\/wp\/(\w+).*/, /.*chirb\.it\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("Huffduffer", "rich", ["huffduffer.com/[-.\\w@]+/\\d+"], "http://huffduffer.com/oembed"), + new $.fn.oembed.OEmbedProvider("Spotify", "rich", ["open.spotify.com/(track|album|user)/"], "https://embed.spotify.com/oembed/"), + new $.fn.oembed.OEmbedProvider("shoudio", "rich", ["shoudio.com/.+", "shoud.io/.+"], "http://shoudio.com/api/oembed"), + new $.fn.oembed.OEmbedProvider("mixcloud", "rich", ["mixcloud.com/.+"], 'http://www.mixcloud.com/oembed/', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("rdio.com", "rich", ["rd.io/.+", "rdio.com"], "http://www.rdio.com/api/oembed/"), + new $.fn.oembed.OEmbedProvider("Soundcloud", "rich", ["soundcloud.com/.+", "snd.sc/.+"], "//soundcloud.com/oembed", {format: 'js'}), + new $.fn.oembed.OEmbedProvider("bandcamp", "rich", ["bandcamp\\.com/album/.+"], null, + { + yql: { + xpath: "//meta[contains(@content, \\'EmbeddedPlayer\\')]", + from: 'html', + datareturn: function (results) { + return results.meta ? '' : false; + } + } + }), - url += "format=" + provider.format + "&url=" + escape(externalUrl) + qs; - if(provider.dataType != 'json') url += "&" + provider.callbackparameter + "=?"; + //Photo + new $.fn.oembed.OEmbedProvider("deviantart", "photo", ["deviantart.com/.+", "fav.me/.+", "deviantart.com/.+"], "//backend.deviantart.com/oembed", {format: 'jsonp'}), + new $.fn.oembed.OEmbedProvider("skitch", "photo", ["skitch.com/.+"], null, + { + yql: { + xpath: "json", + from: 'json', + url: function (externalurl) { + return 'http://skitch.com/oembed/?format=json&url=' + externalurl + }, + datareturn: function (data) { + return $.fn.oembed.getPhotoCode(data.json.url, data.json); + } + } + }), + new $.fn.oembed.OEmbedProvider("mobypicture", "photo", ["mobypicture.com/user/.+/view/.+", "moby.to/.+"], "http://api.mobypicture.com/oEmbed"), + new $.fn.oembed.OEmbedProvider("flickr", "photo", ["flickr\\.com/photos/.+"], "//flickr.com/services/oembed", {callbackparameter: 'jsoncallback'}), + new $.fn.oembed.OEmbedProvider("photobucket", "photo", ["photobucket\\.com/(albums|groups)/.+"], "http://photobucket.com/oembed/"), + new $.fn.oembed.OEmbedProvider("instagram", "photo", ["instagr\\.?am(\\.com)?/.+"], "//api.instagram.com/oembed"), + //new $.fn.oembed.OEmbedProvider("yfrog", "photo", ["yfrog\\.(com|ru|com\\.tr|it|fr|co\\.il|co\\.uk|com\\.pl|pl|eu|us)/.+"], "http://www.yfrog.com/api/oembed",{useYQL:"json"}), + new $.fn.oembed.OEmbedProvider("SmugMug", "photo", ["smugmug.com/[-.\\w@]+/.+"], "http://api.smugmug.com/services/oembed/"), + new $.fn.oembed.OEmbedProvider("dribbble", "photo", ["dribbble.com/shots/.+"], "http://api.dribbble.com/shots/$1?callback=?", + { + templateRegex: /.*shots\/([\d]+).*/, + templateData: function (data) { + if (!data.image_teaser_url) { + return false; + } + return ''; + } + }), + new $.fn.oembed.OEmbedProvider("chart.ly", "photo", ["chart\\.ly/[a-z0-9]{6,8}"], "http://chart.ly/uploads/large_$1.png", + {templateRegex: /.*ly\/([^\/]+).*/, embedtag: {tag: 'img'}, nocache: 1}), + //new $.fn.oembed.OEmbedProvider("stocktwits.com", "photo", ["stocktwits\\.com/message/.+"], "http://charts.stocktwits.com/production/original_$1.png?", + // { templateRegex: /.*message\/([^\/]+).*/, embedtag: { tag: 'img'},nocache:1 }), + new $.fn.oembed.OEmbedProvider("circuitlab", "photo", ["circuitlab.com/circuit/.+"], "https://www.circuitlab.com/circuit/$1/screenshot/540x405/", + {templateRegex: /.*circuit\/([^\/]+).*/, embedtag: {tag: 'img'}, nocache: 1}), + new $.fn.oembed.OEmbedProvider("23hq", "photo", ["23hq.com/[-.\\w@]+/photo/.+"], "http://www.23hq.com/23/oembed", {useYQL: "json"}), + new $.fn.oembed.OEmbedProvider("img.ly", "photo", ["img\\.ly/.+"], "//img.ly/show/thumb/$1", + {templateRegex: /.*ly\/([^\/]+).*/, embedtag: {tag: 'img'}, nocache: 1}), + new $.fn.oembed.OEmbedProvider("twitgoo.com", "photo", ["twitgoo\\.com/.+"], "http://twitgoo.com/show/thumb/$1", + {templateRegex: /.*com\/([^\/]+).*/, embedtag: {tag: 'img'}, nocache: 1}), + new $.fn.oembed.OEmbedProvider("imgur.com", "photo", ["imgur\\.com/gallery/.+"], "http://imgur.com/$1l.jpg", + {templateRegex: /.*gallery\/([^\/]+).*/, embedtag: {tag: 'img'}, nocache: 1}), + new $.fn.oembed.OEmbedProvider("visual.ly", "rich", ["visual\\.ly/.+"], null, + { + yql: { + xpath: "//a[@id=\\'gc_article_graphic_image\\']/img", + from: 'htmlstring' + } + }), + new $.fn.oembed.OEmbedProvider("achewood", "photo", ["achewood\\.com\\/index.php\\?date=.+"], "http://www.achewood.com/comic.php?date=$1", {templateRegex: /.*achewood\.com\/index.php\?date=(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("fotokritik", "photo", ["fotokritik\\.com/.+"], "http://www.fotokritik.com/embed/$1", {templateRegex: [/.*fotokritik\.com\/embed\/(\w+).*/, /.*fotokritik\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("giflike", "photo", ["giflike\\.com/.+"], "http://www.giflike.com/embed/$1", {templateRegex: [/.*giflike\.com\/embed\/(\w+).*/, /.*giflike\.com\/a\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - return url; - } + //Rich + new $.fn.oembed.OEmbedProvider("twitter", "rich", ["twitter.com/.+"], "https://api.twitter.com/1/statuses/oembed.json"), + new $.fn.oembed.OEmbedProvider("gmep", "rich", ["gmep.imeducate.com/.*", "gmep.org/.*"], "http://gmep.org/oembed.json"), + new $.fn.oembed.OEmbedProvider("urtak", "rich", ["urtak.com/(u|clr)/.+"], "http://oembed.urtak.com/1/oembed"), + new $.fn.oembed.OEmbedProvider("cacoo", "rich", ["cacoo.com/.+"], "http://cacoo.com/oembed.json"), + new $.fn.oembed.OEmbedProvider("dailymile", "rich", ["dailymile.com/people/.*/entries/.*"], "http://api.dailymile.com/oembed"), + new $.fn.oembed.OEmbedProvider("documentcloud", "rich", ["documentcloud.org/documents/.+"], "https://www.documentcloud.org/api/oembed.json"), + new $.fn.oembed.OEmbedProvider("dipity", "rich", ["dipity.com/timeline/.+"], 'http://www.dipity.com/oembed/timeline/', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("sketchfab", "rich", ["sketchfab.com/show/.+"], 'http://sketchfab.com/oembed', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("speakerdeck", "rich", ["speakerdeck.com/.+"], 'http://speakerdeck.com/oembed.json', {useYQL: 'json'}), + new $.fn.oembed.OEmbedProvider("popplet", "rich", ["popplet.com/app/.*"], "http://popplet.com/app/Popplet_Alpha.swf?page_id=$1&em=1", + { + templateRegex: /.*#\/([^\/]+).*/, + embedtag: { + width: 460, + height: 460 + } + }), - function success(oembedData, externalUrl, container) { - $('#jqoembeddata').data(externalUrl, oembedData.code); - settings.beforeEmbed.call(container, oembedData); - settings.onEmbed.call(container, oembedData); - settings.afterEmbed.call(container, oembedData); - } + new $.fn.oembed.OEmbedProvider("pearltrees", "rich", ["pearltrees.com/.*"], "http://cdn.pearltrees.com/s/embed/getApp?", + { + templateRegex: /.*N-f=1_(\d+).*N-p=(\d+).*/, + embedtag: { + width: 460, + height: 460, + flashvars: "lang=en_US&embedId=pt-embed-$1-693&treeId=$1&pearlId=$2&treeTitle=Diagrams%2FVisualization&site=www.pearltrees.com%2FF" + } + }), - function embedCode(container, externalUrl, embedProvider) { - if($('#jqoembeddata').data(externalUrl) != undefined && embedProvider.embedtag.tag != 'iframe') { - var oembedData = { - code: $('#jqoembeddata').data(externalUrl) - }; - success(oembedData, externalUrl, container); - } else if(embedProvider.yql) { - var from = embedProvider.yql.from || 'htmlstring'; - var url = embedProvider.yql.url ? embedProvider.yql.url(externalUrl) : externalUrl; - var query = 'SELECT * FROM ' + from + ' WHERE url="' + (url) + '"' + " and " + (/html/.test(from) ? 'xpath' : 'itemPath') + "='" + (embedProvider.yql.xpath || '/') + "'"; - if(from == 'html') query += " and compat='html5'"; - var ajaxopts = $.extend({ - url: "http://query.yahooapis.com/v1/public/yql", - dataType: 'jsonp', - data: { - q: query, - format: "json", - env: 'store://datatables.org/alltableswithkeys', - callback: "?" - }, - success: function (data) { - var result; - if(embedProvider.yql.xpath && embedProvider.yql.xpath == '//meta|//title|//link') { - var meta = {}; - if(data.query.results == null) { - data.query.results = { - "meta": [] - }; - } - for(var i = 0, l = data.query.results.meta.length; i < l; i++) { - var name = data.query.results.meta[i].name || data.query.results.meta[i].property || null; - if(name == null) continue; - meta[name.toLowerCase()] = data.query.results.meta[i].content; - } - if(!meta.hasOwnProperty("title") || !meta.hasOwnProperty("og:title")) { - if(data.query.results.title != null) { - meta.title = data.query.results.title; - } - } - result = embedProvider.yql.datareturn(meta); - } else { - result = embedProvider.yql.datareturn ? embedProvider.yql.datareturn(data.query.results) : data.query.results.result; - } - if(result === false) return; - var oembedData = $.extend({}, result); - oembedData.code = result; - success(oembedData, externalUrl, container); - }, - error: settings.onError.call(container, externalUrl, embedProvider) - }, settings.ajaxOptions || {}); + new $.fn.oembed.OEmbedProvider("prezi", "rich", ["prezi.com/.*"], "//prezi.com/bin/preziloader.swf?", + { + templateRegex: /.*com\/([^\/]+)\/.*/, + embedtag: { + width: 550, + height: 400, + flashvars: "prezi_id=$1&lock_to_path=0&color=ffffff&autoplay=no&autohide_ctrls=0" + } + }), - $.ajax(ajaxopts); - } else if(embedProvider.templateRegex) { - if(embedProvider.embedtag.tag !== '') { - var flashvars = embedProvider.embedtag.flashvars || ''; - var tag = embedProvider.embedtag.tag || 'embed'; - var width = embedProvider.embedtag.width || 'auto'; - var nocache = embedProvider.embedtag.nocache || 0; - var height = embedProvider.embedtag.height || 'auto'; - var src = externalUrl.replace(embedProvider.templateRegex, embedProvider.apiendpoint); - if(!embedProvider.nocache) src += '&jqoemcache=' + rand(5); - if(embedProvider.apikey) src = src.replace('_APIKEY_', settings.apikeys[embedProvider.name]); + new $.fn.oembed.OEmbedProvider("tourwrist", "rich", ["tourwrist.com/tours/.+"], null, + { + templateRegex: /.*tours.([\d]+).*/, + template: function (wm, tourid) { + setTimeout(function () { + if (loadEmbeds)loadEmbeds(); + }, 2000); + return "
"; + } + }), - var code = $('<' + tag + '/>') - .attr('src', src) - .attr('width', width) - .attr('height', height) - .attr('allowfullscreen', embedProvider.embedtag.allowfullscreen || 'true') - .attr('allowscriptaccess', embedProvider.embedtag.allowfullscreen || 'always') - .css('max-height', settings.maxHeight || 'auto') - .css('max-width', settings.maxWidth || 'auto'); - if(tag == 'embed') { - code - .attr('type', embedProvider.embedtag.type || "application/x-shockwave-flash") - .attr('flashvars', externalUrl.replace(embedProvider.templateRegex, flashvars)); - } - if(tag == 'iframe'){ - code - .attr('scrolling', embedProvider.embedtag.scrolling || "no") - .attr('frameborder', embedProvider.embedtag.frameborder || "0"); - } + new $.fn.oembed.OEmbedProvider("meetup", "rich", ["meetup\\.(com|ps)/.+"], "http://api.meetup.com/oembed"), + new $.fn.oembed.OEmbedProvider("ebay", "rich", ["ebay\\.*"], "http://togo.ebay.com/togo/togo.swf?2008013100", + { + templateRegex: /.*\/([^\/]+)\/(\d{10,13}).*/, + embedtag: { + width: 355, + height: 300, + flashvars: "base=http://togo.ebay.com/togo/&lang=en-us&mode=normal&itemid=$2&query=$1" + } + }), + new $.fn.oembed.OEmbedProvider("wikipedia", "rich", ["wikipedia.org/wiki/.+"], "http://$1.wikipedia.org/w/api.php?action=parse&page=$2&format=json§ion=0&callback=?", { + templateRegex: /.*\/\/([\w]+).*\/wiki\/([^\/]+).*/, + templateData: function (data) { + if (!data.parse) + return false; + var text = data.parse['text']['*'].replace(/href="\/wiki/g, 'href="http://en.wikipedia.org/wiki'); + return ''; + } + }), + new $.fn.oembed.OEmbedProvider("imdb", "rich", ["imdb.com/title/.+"], "http://www.imdbapi.com/?i=$1&callback=?", + { + templateRegex: /.*\/title\/([^\/]+).*/, + templateData: function (data) { + if (!data.Title) + return false; + return '

' + data.Title + ' (' + data.Year + ')

Rating: ' + data.imdbRating + '
Genre: ' + data.Genre + '
Starring: ' + data.Actors + '

' + data.Plot + '
'; + } + }), + new $.fn.oembed.OEmbedProvider("livejournal", "rich", ["livejournal.com/"], "http://ljpic.seacrow.com/json/$2$4?jsonp=?" + , { + templateRegex: /(http:\/\/(((?!users).)+)\.livejournal\.com|.*users\.livejournal\.com\/([^\/]+)).*/, + templateData: function (data) { + if (!data.username) + return false; + return '
[info]' + data.username + '
' + data.name + '
'; + } + }), + new $.fn.oembed.OEmbedProvider("circuitbee", "rich", ["circuitbee\\.com/circuit/view/.+"], "http://c.circuitbee.com/build/r/schematic-embed.html?id=$1", + { + templateRegex: /.*circuit\/view\/(\d+).*/, + embedtag: { + tag: 'iframe', + width: '500', + height: '350' + } + }), - var oembedData = { - code: code - }; - success(oembedData, externalUrl, container); - } else if(embedProvider.apiendpoint) { - //Add APIkey if true - if(embedProvider.apikey) embedProvider.apiendpoint = embedProvider.apiendpoint.replace('_APIKEY_', settings.apikeys[embedProvider.name]); - ajaxopts = $.extend({ - url: externalUrl.replace(embedProvider.templateRegex, embedProvider.apiendpoint), - dataType: 'jsonp', - success: function (data) { - var oembedData = $.extend({}, data); - oembedData.code = embedProvider.templateData(data); - if(oembedData.code) success(oembedData, externalUrl, container); - }, - error: settings.onError.call(container, externalUrl, embedProvider) - }, settings.ajaxOptions || {}); + new $.fn.oembed.OEmbedProvider("googlecalendar", "rich", ["www.google.com/calendar/embed?.+"], "$1", + {templateRegex: /(.*)/, embedtag: {tag: 'iframe', width: '800', height: '600' }}), + new $.fn.oembed.OEmbedProvider("jsfiddle", "rich", ["jsfiddle.net/[^/]+/?"], "http://jsfiddle.net/$1/embedded/result,js,resources,html,css/?", + {templateRegex: /.*net\/([^\/]+).*/, embedtag: {tag: 'iframe', width: '100%', height: '300' }}), + new $.fn.oembed.OEmbedProvider("jsbin", "rich", ["jsbin.com/.+"], "http://jsbin.com/$1/?", + {templateRegex: /.*com\/([^\/]+).*/, embedtag: {tag: 'iframe', width: '100%', height: '300' }}), + new $.fn.oembed.OEmbedProvider("jotform", "rich", ["form.jotform.co/form/.+"], "$1?", + {templateRegex: /(.*)/, embedtag: {tag: 'iframe', width: '100%', height: '507' }}), + new $.fn.oembed.OEmbedProvider("reelapp", "rich", ["reelapp\\.com/.+"], "http://www.reelapp.com/$1/embed", + {templateRegex: /.*com\/(\S{6}).*/, embedtag: {tag: 'iframe', width: '400', height: '338'}}), + new $.fn.oembed.OEmbedProvider("linkedin", "rich", ["linkedin.com/pub/.+"], "https://www.linkedin.com/cws/member/public_profile?public_profile_url=$1&format=inline&isFramed=true", + {templateRegex: /(.*)/, embedtag: {tag: 'iframe', width: '368px', height: 'auto'}}), + new $.fn.oembed.OEmbedProvider("timetoast", "rich", ["timetoast.com/timelines/[0-9]+"], "http://www.timetoast.com/flash/TimelineViewer.swf?passedTimelines=$1", + {templateRegex: /.*timelines\/([0-9]*)/, embedtag: { width: 550, height: 400}, nocache: 1}), + new $.fn.oembed.OEmbedProvider("pastebin", "rich", ["pastebin\\.com/[\\S]{8}"], "http://pastebin.com/embed_iframe.php?i=$1", + {templateRegex: /.*\/(\S{8}).*/, embedtag: {tag: 'iframe', width: '100%', height: 'auto'}}), + new $.fn.oembed.OEmbedProvider("mixlr", "rich", ["mixlr.com/.+"], "http://mixlr.com/embed/$1?autoplay=ae", + {templateRegex: /.*com\/([^\/]+).*/, embedtag: {tag: 'iframe', width: '100%', height: 'auto' }}), + new $.fn.oembed.OEmbedProvider("pastie", "rich", ["pastie\\.org/pastes/.+"], null, {yql: {xpath: '//pre[@class="textmate-source"]'}}), + new $.fn.oembed.OEmbedProvider("github", "rich", ["gist.github.com/.+"], "https://github.com/api/oembed"), + new $.fn.oembed.OEmbedProvider("github", "rich", ["github.com/[-.\\w@]+/[-.\\w@]+"], "https://api.github.com/repos/$1/$2?callback=?" + , {templateRegex: /.*\/([^\/]+)\/([^\/]+).*/, + templateData: function (data) { + if (!data.data.html_url)return false; + return '

' + data.data.name + '

' + data.data.description + '

' + + '

Last updated: ' + data.data.pushed_at + '

'; + } + }), + new $.fn.oembed.OEmbedProvider("facebook", "rich", ["facebook.com"], null + , {templateRegex: /.*\/([^\/]+)\/([^\/]+).*/, + template: function (url) { + // adding script directly to DOM to make sure that it is loaded correctly. + if (!$.fn.oembed.facebokScriptHasBeenAdded) { + $('
').appendTo('body'); + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.text = '(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0";fjs.parentNode.insertBefore(js, fjs);}(document, "script", "facebook-jssdk"));'; + document.body.appendChild(script); + $.fn.oembed.facebokScriptHasBeenAdded = true; + } - $.ajax(ajaxopts); - } else { - var oembedData = { - code: externalUrl.replace(embedProvider.templateRegex, embedProvider.template) - }; - success(oembedData, externalUrl, container); - } - } else { + // returning template with url of facebook post. + return '
'; - var requestUrl = getRequestUrl(embedProvider, externalUrl), - ajaxopts = $.extend({ - url: requestUrl, - dataType: embedProvider.dataType || 'jsonp', - success: function (data) { - var oembedData = $.extend({}, data); - switch(oembedData.type) { - case "file": //Deviant Art has this - case "photo": - oembedData.code = $.fn.oembed.getPhotoCode(externalUrl, oembedData); - break; - case "video": - case "rich": - oembedData.code = $.fn.oembed.getRichCode(externalUrl, oembedData); - break; - default: - oembedData.code = $.fn.oembed.getGenericCode(externalUrl, oembedData); - break; - } - success(oembedData, externalUrl, container); - }, - error: settings.onError.call(container, externalUrl, embedProvider) - }, settings.ajaxOptions || {}); + } + }), + /* + // Saving old implementation of Facebook in case we will need it as example in the future. + new $.fn.oembed.OEmbedProvider("facebook", "rich", ["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"], "https://graph.facebook.com/$2$3/?callback=?" + ,{templateRegex:/.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/, + templateData : function(data){ if(!data.id)return false; + var out = '
facebook '; + if(data.from) out += ''+data.from.name+''; + else if(data.link) out += ''+data.name+''; + else if(data.username) out += ''+data.name+''; + else out += ''+data.name+''; + out += '
'; + if(data.picture) out += ''; + else out += ''; + if(data.from) out += ''+data.name+''; + if(data.founded) out += 'Founded: '+data.founded+'
'; + if(data.category) out += 'Category: '+data.category+'
'; + if(data.website) out += 'Website: '+data.website+'
'; + if(data.gender) out += 'Gender: '+data.gender+'
'; + if(data.description) out += data.description + '
'; + out += '
'; + return out; + } + }), + */ + new $.fn.oembed.OEmbedProvider("stackoverflow", "rich", ["stackoverflow.com/questions/[\\d]+"], "http://api.stackoverflow.com/1.1/questions/$1?body=true&jsonp=?" + , {templateRegex: /.*questions\/([\d]+).*/, + templateData: function (data) { + if (!data.questions) + return false; + var q = data.questions[0]; + var body = $(q.body).text(); + var out = '
' + + '' + (q.up_vote_count - q.down_vote_count) + '
vote(s)
' + + '
' + q.answer_count + 'answer
' + q.view_count + ' view(s)
' + + '

' + q.title + '

' + + '
' + body.substring(0, 100) + '...
'; + for (i in q.tags) { + out += ''; + } - $.ajax(ajaxopts); - } - }; + out += '
'; + return out; + } + }), + new $.fn.oembed.OEmbedProvider("wordpress", "rich", ["wordpress\\.com/.+", "blogs\\.cnn\\.com/.+", "techcrunch\\.com/.+", "wp\\.me/.+"], "http://public-api.wordpress.com/oembed/1.0/?for=jquery-oembed-all"), + new $.fn.oembed.OEmbedProvider("screenr", "rich", ["screenr\.com"], "http://www.screenr.com/embed/$1", + {templateRegex: /.*\/([^\/]+).*/, embedtag: {tag: 'iframe', width: '650', height: 396}}) , + new $.fn.oembed.OEmbedProvider("gigpans", "rich", ["gigapan\\.org/[-.\\w@]+/\\d+"], "http://gigapan.org/gigapans/$1/options/nosnapshots/iframe/flash.html", + {templateRegex: /.*\/(\d+)\/?.*/, embedtag: {tag: 'iframe', width: '100%', height: 400 }}), + new $.fn.oembed.OEmbedProvider("scribd", "rich", ["scribd\\.com/.+"], "http://www.scribd.com/embeds/$1/content?start_page=1&view_mode=list", + {templateRegex: /.*doc\/([^\/]+).*/, embedtag: {tag: 'iframe', width: '100%', height: 600}}), + new $.fn.oembed.OEmbedProvider("kickstarter", "rich", ["kickstarter\\.com/projects/.+"], "$1/widget/card.html", + {templateRegex: /([^\?]+).*/, embedtag: {tag: 'iframe', width: '220', height: 380}}), + new $.fn.oembed.OEmbedProvider("amazon", "rich", ["amzn.com/B+", "amazon.com.*/(B\\S+)($|\\/.*)"], "http://rcm.amazon.com/e/cm?t=_APIKEY_&o=1&p=8&l=as1&asins=$1&ref=qf_br_asin_til&fc1=000000&IS2=1<1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr", + { + apikey: true, + templateRegex: /.*\/(B[0-9A-Z]+)($|\/.*)/, + embedtag: { + tag: 'iframe', + width: '120px', + height: '240px'} + }), + new $.fn.oembed.OEmbedProvider("slideshare", "rich", ["slideshare\.net"], "//www.slideshare.net/api/oembed/2", {format: 'jsonp'}), + new $.fn.oembed.OEmbedProvider("roomsharejp", "rich", ["roomshare\\.jp/(en/)?post/.*"], "http://roomshare.jp/oembed.json"), + new $.fn.oembed.OEmbedProvider("lanyard", "rich", ["lanyrd.com/\\d+/.+"], null, + { + yql: { + xpath: '(//div[@class="primary"])[1]', + from: 'htmlstring', + datareturn: function (results) { + if (!results.result) + return false; + return '
' + results.result + '
'; + } + } + }), + new $.fn.oembed.OEmbedProvider("asciiartfarts", "rich", ["asciiartfarts.com/\\d+.html"], null, + { + yql: { + xpath: '//pre/font', + from: 'htmlstring', + datareturn: function (results) { + if (!results.result) + return false; + return '
' + results.result + '
'; + } + } + }), + new $.fn.oembed.OEmbedProvider("coveritlive", "rich", ["coveritlive.com/"], null, { + templateRegex: /(.*)/, + template: ''}), + new $.fn.oembed.OEmbedProvider("polldaddy", "rich", ["polldaddy.com/"], null, { + templateRegex: /(?:https?:\/\/w?w?w?.?polldaddy.com\/poll\/)([0-9]*)\//, + template: '', + nocache: 1 + }), + new $.fn.oembed.OEmbedProvider("360io", "rich", ["360\\.io/.+"], "http://360.io/$1", {templateRegex: /.*360\.io\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("bubbli", "rich", ["on\\.bubb\\.li/.+"], "http://on.bubb.li/$1", {templateRegex: /.*on\.bubb\.li\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360}, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("cloudup", "rich", ["cloudup\\.com/.+"], "http://cloudup.com/$1?chromeless", {templateRegex: [/.*cloudup\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }}), + new $.fn.oembed.OEmbedProvider("codepen", "rich", ["codepen.io/.+"], "http://codepen.io/$1/embed/$2", {templateRegex: [/.*io\/(\w+)\/pen\/(\w+).*/, /.*io\/(\w+)\/full\/(\w+).*/], embedtag: {tag: 'iframe', width: '100%', height: '300'}, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("googleviews", "rich", ["(.*maps\\.google\\.com\\/maps\\?).+(output=svembed).+(cbp=(.*)).*"], "https://maps.google.com/maps?layer=c&panoid=$3&ie=UTF8&source=embed&output=svembed&cbp=$5", {templateRegex: /(.*maps\.google\.com\/maps\?).+(panoid=(\w+)&).*(cbp=(.*)).*/, embedtag: {tag: 'iframe', width: 480, height: 360}, nocache: 1 }), + new $.fn.oembed.OEmbedProvider("googlemaps", "rich", ["google\\.com\/maps\/place/.+"], "http://maps.google.com/maps?t=m&q=$1&output=embed", {templateRegex: /.*google\.com\/maps\/place\/([\w\+]*)\/.*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("imajize", "rich", ["embed\\.imajize\\.com/.+"], "http://embed.imajize.com/$1", {templateRegex: /.*embed\.imajize\.com\/(.*)/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("mapjam", "rich", ["mapjam\\.com/.+"], "http://www.mapjam.com/$1", {templateRegex: /.*mapjam\.com\/(.*)/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("polar", "rich", ["polarb\\.com/.+"], "http://assets-polarb-com.a.ssl.fastly.net/api/v4/publishers/unknown/embedded_polls/iframe?poll_id=$1", {templateRegex: /.*polarb\.com\/polls\/(\w+).*/, embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), + new $.fn.oembed.OEmbedProvider("ponga", "rich", ["ponga\\.com/.+"], "https://www.ponga.com/embedded?id=$1", {templateRegex: [/.*ponga\.com\/embedded\?id=(\w+).*/, /.*ponga\.com\/(\w+).*/], embedtag: {tag: 'iframe', width: 480, height: 360 }, nocache: 1}), - function getNormalizedParams(params) { - if(params === null) return null; - var key, normalizedParams = {}; - for(key in params) { - if(key !== null) normalizedParams[key.toLowerCase()] = params[key]; - } - return normalizedParams; - } - - /* Public functions */ - $.fn.oembed.insertCode = function (container, embedMethod, oembedData) { - if(oembedData === null) return; - if(embedMethod == 'auto' && container.attr("href") !== null) embedMethod = 'append'; - else if(embedMethod == 'auto') embedMethod = 'replace'; - switch(embedMethod) { - case "replace": - container.replaceWith(oembedData.code); - break; - case "fill": - container.html(oembedData.code); - break; - case "append": - container.wrap('
'); - var oembedContainer = container.parent(); - if(settings.includeHandle) { - $('').insertBefore(container).click(function () { - var encodedString = encodeURIComponent($(this).text()); - $(this).html((encodedString == '%E2%86%91') ? '↓' : '↑'); - $(this).parent().children().last().toggle(); - }); - } - oembedContainer.append('
'); - try { - oembedData.code.clone().appendTo(oembedContainer); - } catch(e) { - oembedContainer.append(oembedData.code); - } - /* Make videos semi-responsive - * If parent div width less than embeded iframe video then iframe gets shrunk to fit smaller width - * If parent div width greater thans embed iframe use the max widht - * - works on youtubes and vimeo - */ - if(settings.maxWidth) { - var post_width = oembedContainer.parent().width(); - if(post_width < settings.maxWidth) { - var iframe_width_orig = $('iframe', oembedContainer).width(); - var iframe_height_orig = $('iframe', oembedContainer).height(); - var ratio = iframe_width_orig / post_width; - $('iframe', oembedContainer).width(iframe_width_orig / ratio); - $('iframe', oembedContainer).height(iframe_height_orig / ratio); - } else { - if(settings.maxWidth) { - $('iframe', oembedContainer).width(settings.maxWidth); - } - if(settings.maxHeight) { - $('iframe', oembedContainer).height(settings.maxHeight); - } - } - } - break; - } - }; - - $.fn.oembed.getPhotoCode = function (url, oembedData) { - var code, alt = oembedData.title ? oembedData.title : ''; - alt += oembedData.author_name ? ' - ' + oembedData.author_name : ''; - alt += oembedData.provider_name ? ' - ' + oembedData.provider_name : ''; - if(oembedData.url) { - code = '
' + alt + '
'; - } else if(oembedData.thumbnail_url) { - var newURL = oembedData.thumbnail_url.replace('_s', '_b'); - code = '
' + alt + '
'; - } else { - code = '
Error loading this picture
'; - } - if(oembedData.html) code += "
" + oembedData.html + "
"; - return code; - }; - - $.fn.oembed.getRichCode = function (url, oembedData) { - var code = oembedData.html; - return code; - }; - - $.fn.oembed.getGenericCode = function (url, oembedData) { - var title = (oembedData.title !== null) ? oembedData.title : url, - code = ''; - if(oembedData.html) code += '
' + title + '
' + jQuery(oembedData.html).text().substring(0,200) + '... more
'; - return code; - }; - - $.fn.oembed.getOEmbedProvider = function (url) { - for(var i = 0; i < $.fn.oembed.providers.length; i++) { - for(var j = 0, l = $.fn.oembed.providers[i].urlschemes.length; j < l; j++) { - var regExp = new RegExp($.fn.oembed.providers[i].urlschemes[j], "i"); - if(url.match(regExp) !== null) return $.fn.oembed.providers[i]; - } - } - return null; - }; - - $.fn.oembed.OEmbedProvider = function (name, type, urlschemesarray, apiendpoint, extraSettings) { - this.name = name; - this.type = type; // "photo", "video", "link", "rich", null - this.urlschemes = urlschemesarray; - this.apiendpoint = apiendpoint; - this.maxWidth = 500; - this.maxHeight = 400; - extraSettings = extraSettings || {}; - - if(extraSettings.useYQL) { - if(extraSettings.useYQL == 'xml') { - extraSettings.yql = { - xpath: "//oembed/html", - from: 'xml', - apiendpoint: this.apiendpoint, - url: function (externalurl) { - return this.apiendpoint + '?format=xml&url=' + externalurl - }, - datareturn: function (results) { - return results.html.replace(/.*\[CDATA\[(.*)\]\]>$/, '$1') || '' - } - }; - } else { - extraSettings.yql = { - from: 'json', - apiendpoint: this.apiendpoint, - url: function (externalurl) { - return this.apiendpoint + '?format=json&url=' + externalurl - }, - datareturn: function (results) { - if(results.json.type != 'video' && (results.json.url || results.json.thumbnail_url)) { - return ''; - } - return results.json.html || '' - } - }; - } - this.apiendpoint = null; - } - - for(var property in extraSettings) { - this[property] = extraSettings[property]; - } - - this.format = this.format || 'json'; - this.callbackparameter = this.callbackparameter || "callback"; - this.embedtag = this.embedtag || { - tag: "" - }; - }; - - /* - * Function to update existing providers - * - * @param {String} name The name of the provider - * @param {String} type The type of the provider can be "file", "photo", "video", "rich" - * @param {String} urlshemesarray Array of url of the provider - * @param {String} apiendpoint The endpoint of the provider - * @param {String} extraSettings Extra settings of the provider - */ - $.fn.updateOEmbedProvider = function (name, type, urlschemesarray, apiendpoint, extraSettings) { - for(var i = 0; i < $.fn.oembed.providers.length; i++) { - if($.fn.oembed.providers[i].name === name) { - if(type !== null) { - $.fn.oembed.providers[i].type = type; - } - if(urlschemesarray !== null) { - $.fn.oembed.providers[i].urlschemes = urlschemesarray; - } - if(apiendpoint !== null) { - $.fn.oembed.providers[i].apiendpoint = apiendpoint; - } - if(extraSettings !== null) { - $.fn.oembed.providers[i].extraSettings = extraSettings; - for(var property in extraSettings) { - if(property !== null && extraSettings[property] !== null) { - $.fn.oembed.providers[i][property] = extraSettings[property]; - } - } - } - } - } - }; - - /* Native & common providers */ - $.fn.oembed.providers = [ - //Video - new $.fn.oembed.OEmbedProvider("youtube", "video", ["youtube\\.com/watch.+v=[\\w-]+&?", "youtu\\.be/[\\w-]+", "youtube.com/embed"], 'http://www.youtube.com/embed/$1?wmode=transparent', { - templateRegex: /.*(?:v\=|be\/|embed\/)([\w\-]+)&?.*/, - embedtag: { - tag: 'iframe', - width: '425', - height: '349' - } - }), - - // new $.fn.oembed.OEmbedProvider("youtube", "video", ["youtube\\.com/watch.+v=[\\w-]+&?", "youtu\\.be/[\\w-]+"], 'http://www.youtube.com/oembed', { - // useYQL: 'json' - // }), - // new $.fn.oembed.OEmbedProvider("youtubeiframe", "video", ["youtube.com/embed"], "$1?wmode=transparent", { - // templateRegex: /(.*)/, - // embedtag: { - // tag: 'iframe', - // width: '425', - // height: '349' - // } - // }), - new $.fn.oembed.OEmbedProvider("wistia", "video", ["wistia.com/m/.+", "wistia.com/embed/.+", "wi.st/m/.+", "wi.st/embed/.+"], 'http://fast.wistia.com/oembed', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("xtranormal", "video", ["xtranormal\\.com/watch/.+"], "http://www.xtranormal.com/xtraplayr/$1/$2", { - templateRegex: /.*com\/watch\/([\w\-]+)\/([\w\-]+).*/, - embedtag: { - tag: 'iframe', - width: '320', - height: '269' - } - }), - new $.fn.oembed.OEmbedProvider("scivee", "video", ["scivee.tv/node/.+"], "http://www.scivee.tv/flash/embedCast.swf?", { - templateRegex: /.*tv\/node\/(.+)/, - embedtag: { - width: '480', - height: '400', - flashvars: "id=$1&type=3" - } - }), - new $.fn.oembed.OEmbedProvider("veoh", "video", ["veoh.com/watch/.+"], "http://www.veoh.com/swf/webplayer/WebPlayer.swf?version=AFrontend.5.7.0.1337&permalinkId=$1&player=videodetailsembedded&videoAutoPlay=0&id=anonymous", { - templateRegex: /.*watch\/([^\?]+).*/, - embedtag: { - width: '410', - height: '341' - } - }), - new $.fn.oembed.OEmbedProvider("gametrailers", "video", ["gametrailers\\.com/video/.+"], "http://media.mtvnservices.com/mgid:moses:video:gametrailers.com:$2", { - templateRegex: /.*com\/video\/([\w\-]+)\/([\w\-]+).*/, - embedtag: { - width: '512', - height: '288' - } - }), - new $.fn.oembed.OEmbedProvider("funnyordie", "video", ["funnyordie\\.com/videos/.+"], "http://player.ordienetworks.com/flash/fodplayer.swf?", { - templateRegex: /.*videos\/([^\/]+)\/([^\/]+)?/, - embedtag: { - width: 512, - height: 328, - flashvars: "key=$1" - } - }), - new $.fn.oembed.OEmbedProvider("colledgehumour", "video", ["collegehumor\\.com/video/.+"], "http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=$1&use_node_id=true&fullscreen=1", { - templateRegex: /.*video\/([^\/]+).*/, - embedtag: { - width: 600, - height: 338 - } - }), - new $.fn.oembed.OEmbedProvider("metacafe", "video", ["metacafe\\.com/watch/.+"], "http://www.metacafe.com/fplayer/$1/$2.swf", { - templateRegex: /.*watch\/(\d+)\/(\w+)\/.*/, - embedtag: { - width: 400, - height: 345 - } - }), - new $.fn.oembed.OEmbedProvider("bambuser", "video", ["bambuser\\.com\/channel\/.*\/broadcast\/.*"], "http://static.bambuser.com/r/player.swf?vid=$1", { - templateRegex: /.*bambuser\.com\/channel\/.*\/broadcast\/(\w+).*/, - embedtag: { - width: 512, - height: 339 - } - }), - new $.fn.oembed.OEmbedProvider("twitvid", "video", ["twitvid\\.com/.+"], "http://www.twitvid.com/embed.php?guid=$1&autoplay=0", { - templateRegex: /.*twitvid\.com\/(\w+).*/, - embedtag: { - tag: 'iframe', - width: 480, - height: 360 - } - }), - new $.fn.oembed.OEmbedProvider("aniboom", "video", ["aniboom\\.com/animation-video/.+"], "http://api.aniboom.com/e/$1", { - templateRegex: /.*animation-video\/(\d+).*/, - embedtag: { - width: 594, - height: 334 - } - }), - new $.fn.oembed.OEmbedProvider("vzaar", "video", ["vzaar\\.com/videos/.+", "vzaar.tv/.+"], "http://view.vzaar.com/$1/player?", { - templateRegex: /.*\/(\d+).*/, - embedtag: { - tag: 'iframe', - width: 576, - height: 324 - } - }), - new $.fn.oembed.OEmbedProvider("snotr", "video", ["snotr\\.com/video/.+"], "http://www.snotr.com/embed/$1", { - templateRegex: /.*\/(\d+).*/, - embedtag: { - tag: 'iframe', - width: 400, - height: 330, - nocache: 1 - } - }), - new $.fn.oembed.OEmbedProvider("youku", "video", ["v.youku.com/v_show/id_.+"], "http://player.youku.com/player.php/sid/$1/v.swf", { - templateRegex: /.*id_(.+)\.html.*/, - embedtag: { - width: 480, - height: 400, - nocache: 1 - } - }), - new $.fn.oembed.OEmbedProvider("tudou", "video", ["tudou.com/programs/view/.+\/"], "http://www.tudou.com/v/$1/v.swf", { - templateRegex: /.*view\/(.+)\//, - embedtag: { - width: 480, - height: 400, - nocache: 1 - } - }), - new $.fn.oembed.OEmbedProvider("embedr", "video", ["embedr\\.com/playlist/.+"], "http://embedr.com/swf/slider/$1/425/520/default/false/std?", { - templateRegex: /.*playlist\/([^\/]+).*/, - embedtag: { - width: 425, - height: 520 - } - }), - new $.fn.oembed.OEmbedProvider("blip", "video", ["blip\\.tv/.+"], "http://blip.tv/oembed/"), - new $.fn.oembed.OEmbedProvider("minoto-video", "video", ["http://api.minoto-video.com/publishers/.+/videos/.+", "http://dashboard.minoto-video.com/main/video/details/.+", "http://embed.minoto-video.com/.+"], "http://api.minoto-video.com/services/oembed.json", { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("animoto", "video", ["animoto.com/play/.+"], "http://animoto.com/services/oembed"), - new $.fn.oembed.OEmbedProvider("hulu", "video", ["hulu\\.com/watch/.*"], "http://www.hulu.com/api/oembed.json"), - new $.fn.oembed.OEmbedProvider("ustream", "video", ["ustream\\.tv/recorded/.*"], "http://www.ustream.tv/oembed", { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("videojug", "video", ["videojug\\.com/(film|payer|interview).*"], "http://www.videojug.com/oembed.json", { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("sapo", "video", ["videos\\.sapo\\.pt/.*"], "http://videos.sapo.pt/oembed", { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("vodpod", "video", ["vodpod.com/watch/.*"], "http://vodpod.com/oembed.js", { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("vimeo", "video", ["www\.vimeo\.com\/groups\/.*\/videos\/.*", "www\.vimeo\.com\/.*", "vimeo\.com\/groups\/.*\/videos\/.*", "vimeo\.com\/.*"], "//vimeo.com/api/oembed.json"), - new $.fn.oembed.OEmbedProvider("dailymotion", "video", ["dailymotion\\.com/.+"], 'http://www.dailymotion.com/services/oembed'), - new $.fn.oembed.OEmbedProvider("5min", "video", ["www\\.5min\\.com/.+"], 'http://api.5min.com/oembed.xml', { - useYQL: 'xml' - }), - new $.fn.oembed.OEmbedProvider("National Film Board of Canada", "video", ["nfb\\.ca/film/.+"], 'http://www.nfb.ca/remote/services/oembed/', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("qik", "video", ["qik\\.com/\\w+"], 'http://qik.com/api/oembed.json', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("revision3", "video", ["revision3\\.com"], "http://revision3.com/api/oembed/"), - new $.fn.oembed.OEmbedProvider("dotsub", "video", ["dotsub\\.com/view/.+"], "http://dotsub.com/services/oembed", { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("clikthrough", "video", ["clikthrough\\.com/theater/video/\\d+"], "http://clikthrough.com/services/oembed"), - new $.fn.oembed.OEmbedProvider("Kinomap", "video", ["kinomap\\.com/.+"], "http://www.kinomap.com/oembed"), - new $.fn.oembed.OEmbedProvider("VHX", "video", ["vhx.tv/.+"], "http://vhx.tv/services/oembed.json"), - new $.fn.oembed.OEmbedProvider("bambuser", "video", ["bambuser.com/.+"], "http://api.bambuser.com/oembed/iframe.json"), - new $.fn.oembed.OEmbedProvider("justin.tv", "video", ["justin.tv/.+"], 'http://api.justin.tv/api/embed/from_url.json', { - useYQL: 'json' - }), - - //Audio - new $.fn.oembed.OEmbedProvider("official.fm", "rich", ["official.fm/.+"], 'http://official.fm/services/oembed', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("chirbit", "rich", ["chirb.it/.+"], 'http://chirb.it/oembed.json', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("Huffduffer", "rich", ["huffduffer.com/[-.\\w@]+/\\d+"], "http://huffduffer.com/oembed"), - new $.fn.oembed.OEmbedProvider("Spotify", "rich", ["open.spotify.com/(track|album|user)/"], "https://embed.spotify.com/oembed/"), - new $.fn.oembed.OEmbedProvider("shoudio", "rich", ["shoudio.com/.+", "shoud.io/.+"], "http://shoudio.com/api/oembed"), - new $.fn.oembed.OEmbedProvider("mixcloud", "rich", ["mixcloud.com/.+"], 'http://www.mixcloud.com/oembed/', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("rdio.com", "rich", ["rd.io/.+", "rdio.com"], "http://www.rdio.com/api/oembed/"), - new $.fn.oembed.OEmbedProvider("Soundcloud", "rich", ["soundcloud.com/.+", "snd.sc/.+"], "http://soundcloud.com/oembed", { - format: 'js' - }), - new $.fn.oembed.OEmbedProvider("bandcamp", "rich", ["bandcamp\\.com/album/.+"], null, { - yql: { - xpath: "//meta[contains(@content, \\'EmbeddedPlayer\\')]", - from: 'html', - datareturn: function (results) { - return results.meta ? '' : false; - } - } - }), - - //Photo - new $.fn.oembed.OEmbedProvider("deviantart", "photo", ["deviantart.com/.+", "fav.me/.+", "deviantart.com/.+"], "http://backend.deviantart.com/oembed", { - format: 'jsonp' - }), - new $.fn.oembed.OEmbedProvider("skitch", "photo", ["skitch.com/.+"], null, { - yql: { - xpath: "json", - from: 'json', - url: function (externalurl) { - return 'http://skitch.com/oembed/?format=json&url=' + externalurl - }, - datareturn: function (data) { - return $.fn.oembed.getPhotoCode(data.json.url, data.json); - } - } - }), - new $.fn.oembed.OEmbedProvider("mobypicture", "photo", ["mobypicture.com/user/.+/view/.+", "moby.to/.+"], "http://api.mobypicture.com/oEmbed"), - new $.fn.oembed.OEmbedProvider("flickr", "photo", ["flickr\\.com/photos/.+"], "http://flickr.com/services/oembed", { - callbackparameter: 'jsoncallback' - }), - new $.fn.oembed.OEmbedProvider("photobucket", "photo", ["photobucket\\.com/(albums|groups)/.+"], "http://photobucket.com/oembed/"), - new $.fn.oembed.OEmbedProvider("instagram", "photo", ["instagr\\.?am(\\.com)?/.+"], "http://api.instagram.com/oembed"), - // new $.fn.oembed.OEmbedProvider("yfrog", "photo", ["yfrog\\.(com|ru|com\\.tr|it|fr|co\\.il|co\\.uk|com\\.pl|pl|eu|us)/.+"], "http://www.yfrog.com/api/oembed", { - // useYQL: "json" - // }), - new $.fn.oembed.OEmbedProvider("SmugMug", "photo", ["smugmug.com/[-.\\w@]+/.+"], "http://api.smugmug.com/services/oembed/"), - - new $.fn.oembed.OEmbedProvider("dribbble", "photo", ["dribbble.com/shots/.+"], "http://api.dribbble.com/shots/$1?callback=?", { - templateRegex: /.*shots\/([\d]+).*/, - templateData: function (data) { - if(!data.image_teaser_url) return false; - return ''; - } - }), - new $.fn.oembed.OEmbedProvider("chart.ly", "photo", ["chart\\.ly/[a-z0-9]{6,8}"], "http://chart.ly/uploads/large_$1.png", { - templateRegex: /.*ly\/([^\/]+).*/, - embedtag: { - tag: 'img' - }, - nocache: 1 - }), - // new $.fn.oembed.OEmbedProvider("stocktwits.com", "photo", ["stocktwits\\.com/message/.+"], "http://charts.stocktwits.com/production/original_$1.png?", { - // templateRegex: /.*message\/([^\/]+).*/, - // embedtag: { - // tag: 'img' - // }, - // nocache: 1 - // }), - new $.fn.oembed.OEmbedProvider("circuitlab", "photo", ["circuitlab.com/circuit/.+"], "https://www.circuitlab.com/circuit/$1/screenshot/540x405/", { - templateRegex: /.*circuit\/([^\/]+).*/, - embedtag: { - tag: 'img' - }, - nocache: 1 - }), - new $.fn.oembed.OEmbedProvider("23hq", "photo", ["23hq.com/[-.\\w@]+/photo/.+"], "http://www.23hq.com/23/oembed", { - useYQL: "json" - }), - new $.fn.oembed.OEmbedProvider("img.ly", "photo", ["img\\.ly/.+"], "http://img.ly/show/thumb/$1", { - templateRegex: /.*ly\/([^\/]+).*/, - embedtag: { - tag: 'img' - }, - nocache: 1 - }), - new $.fn.oembed.OEmbedProvider("twitgoo.com", "photo", ["twitgoo\\.com/.+"], "http://twitgoo.com/show/thumb/$1", { - templateRegex: /.*com\/([^\/]+).*/, - embedtag: { - tag: 'img' - }, - nocache: 1 - }), - new $.fn.oembed.OEmbedProvider("imgur.com", "photo", ["imgur\\.com/gallery/.+"], "http://imgur.com/$1l.jpg", { - templateRegex: /.*gallery\/([^\/]+).*/, - embedtag: { - tag: 'img' - }, - nocache: 1 - }), - new $.fn.oembed.OEmbedProvider("visual.ly", "rich", ["visual\\.ly/.+"], null, { - yql: { - xpath: "//a[@id=\\'gc_article_graphic_image\\']/img", - from: 'htmlstring' - } - }), - - //Rich - new $.fn.oembed.OEmbedProvider("twitter", "rich", ["twitter.com/.+"], "https://api.twitter.com/1/statuses/oembed.json"), - new $.fn.oembed.OEmbedProvider("gmep", "rich", ["gmep.imeducate.com/.*", "gmep.org/.*"], "http://gmep.org/oembed.json"), - new $.fn.oembed.OEmbedProvider("urtak", "rich", ["urtak.com/(u|clr)/.+"], "http://oembed.urtak.com/1/oembed"), - new $.fn.oembed.OEmbedProvider("cacoo", "rich", ["cacoo.com/.+"], "http://cacoo.com/oembed.json"), - new $.fn.oembed.OEmbedProvider("dailymile", "rich", ["dailymile.com/people/.*/entries/.*"], "http://api.dailymile.com/oembed"), - new $.fn.oembed.OEmbedProvider("dipity", "rich", ["dipity.com/timeline/.+"], 'http://www.dipity.com/oembed/timeline/', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("sketchfab", "rich", ["sketchfab.com/show/.+"], 'http://sketchfab.com/oembed', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("speakerdeck", "rich", ["speakerdeck.com/.+"], 'http://speakerdeck.com/oembed.json', { - useYQL: 'json' - }), - new $.fn.oembed.OEmbedProvider("popplet", "rich", ["popplet.com/app/.*"], "http://popplet.com/app/Popplet_Alpha.swf?page_id=$1&em=1", { - templateRegex: /.*#\/([^\/]+).*/, - embedtag: { - width: 460, - height: 460 - } - }), - new $.fn.oembed.OEmbedProvider("pearltrees", "rich", ["pearltrees.com/.*"], "http://cdn.pearltrees.com/s/embed/getApp?", { - templateRegex: /.*N-f=1_(\d+).*N-p=(\d+).*/, - embedtag: { - width: 460, - height: 460, - flashvars: "lang=en_US&embedId=pt-embed-$1-693&treeId=$1&pearlId=$2&treeTitle=Diagrams%2FVisualization&site=www.pearltrees.com%2FF" - } - }), - new $.fn.oembed.OEmbedProvider("prezi", "rich", ["prezi.com/.*"], "http://prezi.com/bin/preziloader.swf?", { - templateRegex: /.*com\/([^\/]+)\/.*/, - embedtag: { - width: 550, - height: 400, - flashvars: "prezi_id=$1&lock_to_path=0&color=ffffff&autoplay=no&autohide_ctrls=0" - } - }), - new $.fn.oembed.OEmbedProvider("tourwrist", "rich", ["tourwrist.com/tours/.+"], null, { - templateRegex: /.*tours.([\d]+).*/, - template: function (wm, tourid) { - setTimeout(function () { - if(loadEmbeds) loadEmbeds(); - }, 2000); - return "
"; - } - }), - new $.fn.oembed.OEmbedProvider("meetup", "rich", ["meetup\\.(com|ps)/.+"], "http://api.meetup.com/oembed"), - new $.fn.oembed.OEmbedProvider("ebay", "rich", ["ebay\\.*"], "http://togo.ebay.com/togo/togo.swf?2008013100", { - templateRegex: /.*\/([^\/]+)\/(\d{10,13}).*/, - embedtag: { - width: 355, - height: 300, - flashvars: "base=http://togo.ebay.com/togo/&lang=en-us&mode=normal&itemid=$2&query=$1" - } - }), - new $.fn.oembed.OEmbedProvider("wikipedia", "rich", ["wikipedia.org/wiki/.+"], "http://$1.wikipedia.org/w/api.php?action=parse&page=$2&format=json§ion=0&callback=?", { - templateRegex: /.*\/\/([\w]+).*\/wiki\/([^\/]+).*/, - templateData: function (data) { - if(!data.parse) return false; - var text = data.parse['text']['*'].replace(/href="\/wiki/g, 'href="http://en.wikipedia.org/wiki'); - return '
' + data.parse['displaytitle'] + '
' +jQuery(text).text().substring(0,200) + '...
'; - } - }), - new $.fn.oembed.OEmbedProvider("imdb", "rich", ["imdb.com/title/.+"], "http://www.imdbapi.com/?i=$1&callback=?", { - templateRegex: /.*\/title\/([^\/]+).*/, - templateData: function (data) { - if(!data.Title) return false; - return '

' + data.Title + ' (' + data.Year + ')

Rating: ' + data.imdbRating + '
Genre: ' + data.Genre + '
Starring: ' + data.Actors + '

' + data.Plot + '
'; - } - }), - new $.fn.oembed.OEmbedProvider("livejournal", "rich", ["livejournal.com/"], "http://ljpic.seacrow.com/json/$2$4?jsonp=?", { - templateRegex: /(http:\/\/(((?!users).)+)\.livejournal\.com|.*users\.livejournal\.com\/([^\/]+)).*/, - templateData: function (data) { - if(!data.username) return false; - return '
[info]' + data.username + '
' + data.name + '
'; - } - }), - new $.fn.oembed.OEmbedProvider("circuitbee", "rich", ["circuitbee\\.com/circuit/view/.+"], "http://c.circuitbee.com/build/r/schematic-embed.html?id=$1", { - templateRegex: /.*circuit\/view\/(\d+).*/, - embedtag: { - tag: 'iframe', - width: '500', - height: '350' - } - }), - new $.fn.oembed.OEmbedProvider("googlecalendar", "rich", ["www.google.com/calendar/embed?.+"], "$1", { - templateRegex: /(.*)/, - embedtag: { - tag: 'iframe', - width: '800', - height: '600' - } - }), - new $.fn.oembed.OEmbedProvider("jsfiddle", "rich", ["jsfiddle.net/[^/]+/?"], "http://jsfiddle.net/$1/embedded/result,js,resources,html,css/?", { - templateRegex: /.*net\/([^\/]+).*/, - embedtag: { - tag: 'iframe', - width: '100%', - height: '300' - } - }), - new $.fn.oembed.OEmbedProvider("jsbin", "rich", ["jsbin.com/.+"], "http://jsbin.com/$1/?", { - templateRegex: /.*com\/([^\/]+).*/, - embedtag: { - tag: 'iframe', - width: '100%', - height: '300' - } - }), - new $.fn.oembed.OEmbedProvider("jotform", "rich", ["form.jotform.co/form/.+"], "$1?", { - templateRegex: /(.*)/, - embedtag: { - tag: 'iframe', - width: '100%', - height: '507' - } - }), - new $.fn.oembed.OEmbedProvider("reelapp", "rich", ["reelapp\\.com/.+"], "http://www.reelapp.com/$1/embed", { - templateRegex: /.*com\/(\S{6}).*/, - embedtag: { - tag: 'iframe', - width: '400', - height: '338' - } - }), - new $.fn.oembed.OEmbedProvider("linkedin", "rich", ["linkedin.com/pub/.+"], "https://www.linkedin.com/cws/member/public_profile?public_profile_url=$1&format=inline&isFramed=true", { - templateRegex: /(.*)/, - embedtag: { - tag: 'iframe', - width: '368px', - height: 'auto' - } - }), - new $.fn.oembed.OEmbedProvider("timetoast", "rich", ["timetoast.com/timelines/[0-9]+"], "http://www.timetoast.com/flash/TimelineViewer.swf?passedTimelines=$1", { - templateRegex: /.*timelines\/([0-9]*)/, - embedtag: { - width: 550, - height: 400, - nocache: 1 - } - }), - new $.fn.oembed.OEmbedProvider("pastebin", "rich", ["pastebin\\.com/[\\S]{8}"], "http://pastebin.com/embed_iframe.php?i=$1", { - templateRegex: /.*\/(\S{8}).*/, - embedtag: { - tag: 'iframe', - width: '100%', - height: 'auto' - } - }), - new $.fn.oembed.OEmbedProvider("mixlr", "rich", ["mixlr.com/.+"], "http://mixlr.com/embed/$1?autoplay=ae", { - templateRegex: /.*com\/([^\/]+).*/, - embedtag: { - tag: 'iframe', - width: '100%', - height: 'auto' - } - }), - new $.fn.oembed.OEmbedProvider("pastie", "rich", ["pastie\\.org/pastes/.+"], null, { - yql: { - xpath: '//pre[@class="textmate-source"]' - } - }), - new $.fn.oembed.OEmbedProvider("github", "rich", ["gist.github.com/.+"], "https://github.com/api/oembed"), - new $.fn.oembed.OEmbedProvider("github", "rich", ["github.com/[-.\\w@]+/[-.\\w@]+"], "https://api.github.com/repos/$1/$2?callback=?", { - templateRegex: /.*\/([^\/]+)\/([^\/]+).*/, - templateData: function (data) { - if(!data.data.html_url) return false; - return '

' + data.data.name + '

' + data.data.description + '

' + '

Last updated: ' + data.data.pushed_at + '

'; - } - }), - new $.fn.oembed.OEmbedProvider("facebook", "rich", ["facebook.com/(people/[^\\/]+/\\d+|[^\\/]+$)"], "https://graph.facebook.com/$2$3/?callback=?", { - templateRegex: /.*facebook.com\/(people\/[^\/]+\/(\d+).*|([^\/]+$))/, - templateData: function (data) { - if(!data.id) return false; - var out = '
facebook '; - if(data.from) out += '' + data.from.name + ''; - else if(data.link) out += '' + data.name + ''; - else if(data.username) out += '' + data.name + ''; - else out += '' + data.name + ''; - out += '
'; - if(data.picture) out += ''; - else out += ''; - if(data.from) out += '' + data.name + ''; - if(data.founded) out += 'Founded: ' + data.founded + '
' - if(data.category) out += 'Category: ' + data.category + '
'; - if(data.website) out += 'Website: ' + data.website + '
'; - if(data.gender) out += 'Gender: ' + data.gender + '
'; - if(data.description) out += data.description + '
'; - out += '
'; - return out; - } - }), - new $.fn.oembed.OEmbedProvider("stackoverflow", "rich", ["stackoverflow.com/questions/[\\d]+"], "http://api.stackoverflow.com/1.1/questions/$1?body=true&jsonp=?", { - templateRegex: /.*questions\/([\d]+).*/, - templateData: function (data) { - if(!data.questions) return false; - var q = data.questions[0]; - var body = $(q.body).text(); - var out = '
' + '' + (q.up_vote_count - q.down_vote_count) + '
vote(s)
' + '
' + q.answer_count + 'answer
' + q.view_count + ' view(s)
' + '

' + q.title + '

' + '
' + body.substring(0, 100) + '...
'; - for(i in q.tags) - out += ''; - out += '
'; - return out; - } - }), - new $.fn.oembed.OEmbedProvider("wordpress", "rich", ["wordpress\\.com/.+", "blogs\\.cnn\\.com/.+", "techcrunch\\.com/.+", "wp\\.me/.+"], "http://public-api.wordpress.com/oembed/1.0/?for=jquery-oembed-all"), - new $.fn.oembed.OEmbedProvider("screenr", "rich", ["screenr\.com"], "http://www.screenr.com/embed/$1", { - templateRegex: /.*\/([^\/]+).*/, - embedtag: { - tag: 'iframe', - width: '650', - height: 396 - } - }), - new $.fn.oembed.OEmbedProvider("gigpans", "rich", ["gigapan\\.org/[-.\\w@]+/\\d+"], "http://gigapan.org/gigapans/$1/options/nosnapshots/iframe/flash.html", { - templateRegex: /.*\/(\d+)\/?.*/, - embedtag: { - tag: 'iframe', - width: '100%', - height: 400 - } - }), - new $.fn.oembed.OEmbedProvider("scribd", "rich", ["scribd\\.com/.+"], "http://www.scribd.com/embeds/$1/content?start_page=1&view_mode=list", { - templateRegex: /.*doc\/([^\/]+).*/, - embedtag: { - tag: 'iframe', - width: '100%', - height: 600 - } - }), - new $.fn.oembed.OEmbedProvider("kickstarter", "rich", ["kickstarter\\.com/projects/.+"], "$1/widget/card.html", { - templateRegex: /([^\?]+).*/, - embedtag: { - tag: 'iframe', - width: '220', - height: 380 - } - }), - new $.fn.oembed.OEmbedProvider("amazon", "rich", ["amzn.com/B+", "amazon.com.*/(B\\S+)($|\\/.*)"], "http://rcm.amazon.com/e/cm?t=_APIKEY_&o=1&p=8&l=as1&asins=$1&ref=qf_br_asin_til&fc1=000000&IS2=1<1=_blank&m=amazon&lc1=0000FF&bc1=000000&bg1=FFFFFF&f=ifr", { - apikey: true, - templateRegex: /.*\/(B[0-9A-Z]+)($|\/.*)/, - embedtag: { - tag: 'iframe', - width: '120px', - height: '240px' - } - }), - new $.fn.oembed.OEmbedProvider("slideshare", "rich", ["slideshare\.net"], "http://www.slideshare.net/api/oembed/2", { - format: 'jsonp' - }), - new $.fn.oembed.OEmbedProvider("roomsharejp", "rich", ["roomshare\\.jp/(en/)?post/.*"], "http://roomshare.jp/oembed.json"), - new $.fn.oembed.OEmbedProvider("lanyard", "rich", ["lanyrd.com/\\d+/.+"], null, { - yql: { - xpath: '(//div[@class="primary"])[1]', - from: 'htmlstring', - datareturn: function (results) { - if(!results.result) return false; - return '
' + results.result + '
'; - } - } - }), - new $.fn.oembed.OEmbedProvider("asciiartfarts", "rich", ["asciiartfarts.com/\\d+.html"], null, { - yql: { - xpath: '//pre/font', - from: 'htmlstring', - datareturn: function (results) { - if(!results.result) return false; - return '
' + results.result + '
'; - } - } - }) - ]; + ]; })(jQuery); +//This is needed for gravatar :( +String.prototype.md5=function(){var a=function(a,b){var c=(a&65535)+(b&65535);var d=(a>>16)+(b>>16)+(c>>16);return d<<16|c&65535};var b=function(a,b){return a<>>32-b};var c=function(c,d,e,f,g,h){return a(b(a(a(d,c),a(f,h)),g),e)};var d=function(a,b,d,e,f,g,h){return c(b&d|~b&e,a,b,f,g,h)};var e=function(a,b,d,e,f,g,h){return c(b&e|d&~e,a,b,f,g,h)};var f=function(a,b,d,e,f,g,h){return c(b^d^e,a,b,f,g,h)};var g=function(a,b,d,e,f,g,h){return c(d^(b|~e),a,b,f,g,h)};var h=function(b){var c,h,i,j,k,l=b.length;var m=1732584193;var n=-271733879;var o=-1732584194;var p=271733878;for(k=0;k>2]>>d%4*8+4&15)+b.charAt(a[d>>2]>>d%4*8&15)}return c};var j=function(a){var b=(a.length+8>>6)+1;var c=[],d,e=b*16,f,g=a.length;for(d=0;d>2]|=(a.charCodeAt(f)&255)<>2]|=128< - 아이콘 중복 설정 - 아이콘 중복 설정을 적용할 경우 그룹아이콘이 있을때 포인트 레벨 아이콘은 띄우지 않도록 합니다. + 아이콘 중복 방지 + 그룹아이콘이 있을 경우 중복으로 레벨 아이콘을 달지 않습니다. - 적용하지 않음 - 不启用 - 적용하지 않음 - 關閉 - Not apply - Not apply - Không áp dụng + 사용함 + Enabled - - 적용 - 启用 - 적용 - 開啟 - Apply - Apply - Áp dụng + + 사용하지 않음 + Disabled diff --git a/addons/point_level_icon/point_level_icon.lib.php b/addons/point_level_icon/point_level_icon.lib.php index f72b46359..97b40f98b 100644 --- a/addons/point_level_icon/point_level_icon.lib.php +++ b/addons/point_level_icon/point_level_icon.lib.php @@ -13,18 +13,18 @@ function pointLevelIconTrans($matches, $addon_info) return $matches[0]; } - $orig_text = preg_replace('/' . preg_quote($matches[5], '/') . '<\/' . $matches[6] . '>$/', '', $matches[0]); - - if($addon_info->icon_duplication != 'Y') + if($addon_info->icon_duplication != 'N') { // Check Group Image Mark $oMemberModel = getModel('member'); if($oMemberModel->getGroupImageMark($member_srl)) { - return $orig_text . $matches[5] . ''; + return $matches[0]; } } + $orig_text = preg_replace('/' . preg_quote($matches[5], '/') . '<\/' . $matches[6] . '>$/', '', $matches[0]); + if(!isset($GLOBALS['_pointLevelIcon'][$member_srl])) { // Get point configuration @@ -70,8 +70,8 @@ function pointLevelIconTrans($matches, $addon_info) } } - $title = sprintf('%s:%s%s%s, %s:%s/%s', Context::getLang('point'), $point, $config->point_name, $per ? ' (' . $per . ')' : '', Context::getLang('level'), $level, $config->max_level); - $alt = sprintf('[%s:%s]', Context::getLang('level'), $level); + $title = sprintf('%s:%s%s%s, %s:%s/%s', lang('point'), $point, $config->point_name, $per ? ' (' . $per . ')' : '', lang('level'), $level, $config->max_level); + $alt = sprintf('[%s:%s]', lang('level'), $level); $GLOBALS['_pointLevelIcon'][$member_srl] = sprintf('%s', $level_icon, $alt, $title); } diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index d3f6914ea..6bca4401c 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -3,7 +3,6 @@ /** * Manages Context such as request arguments/environment variables - * It has dual method structure, easy-to use methods which can be called as self::methodname(),and methods called with static object. * * @author NAVER (developers@xpressengine.com) */ @@ -157,6 +156,11 @@ class Context */ public $isSuccessInit = TRUE; + /** + * Plugin blacklist cache + */ + private static $_blacklist = null; + /** * Singleton instance * @var object @@ -270,7 +274,7 @@ class Context if($this->lang_type = self::get('l')) { - if($_COOKIE['lang_type'] != $this->lang_type) + if($_COOKIE['lang_type'] !== $this->lang_type) { setcookie('lang_type', $this->lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000, '/'); } @@ -279,18 +283,31 @@ class Context { $this->lang_type = $_COOKIE['lang_type']; } - elseif($site_module_info->default_language) + elseif(config('locale.auto_select_lang') && count($enabled_langs) > 1) { - $this->lang_type = $this->db_info->lang_type = $site_module_info->default_language; - } - else - { - $this->lang_type = $this->db_info->lang_type; + if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + { + foreach($enabled_langs as $lang_code => $lang_name) + { + if(!strncasecmp($lang_code, $_SERVER['HTTP_ACCEPT_LANGUAGE'], strlen($lang_code))) + { + $this->lang_type = $lang_code; + setcookie('lang_type', $this->lang_type, $_SERVER['REQUEST_TIME'] + 3600 * 24 * 1000, '/'); + } + } + } } if(!$this->lang_type || !isset($enabled_langs[$this->lang_type])) { - $this->lang_type = 'ko'; + if($site_module_info->default_language) + { + $this->lang_type = $this->db_info->lang_type = $site_module_info->default_language; + } + else + { + $this->lang_type = $this->db_info->lang_type ?: 'ko'; + } } self::setLangType($this->lang_type); @@ -376,11 +393,11 @@ class Context } if (strpos($current_url, 'xn--') !== false) { - $current_url = self::decodeIdna($current_url); + $current_url = Rhymix\Framework\URL::decodeIdna($current_url); } if (strpos($request_uri, 'xn--') !== false) { - $request_uri = self::decodeIdna($request_uri); + $request_uri = Rhymix\Framework\URL::decodeIdna($request_uri); } self::set('current_url', $current_url); self::set('request_uri', $request_uri); @@ -431,6 +448,12 @@ class Context */ public static function close() { + // Save debugging information. + if (!DisplayHandler::$debug_printed) + { + DisplayHandler::getDebugInfo(); + } + // Check session status and close it if open. if (self::checkSessionStatus()) { @@ -482,7 +505,7 @@ class Context // Copy to old format for backward compatibility. self::$_instance->db_info = self::convertDBInfo($config); - self::$_instance->allow_rewrite = self::$_instance->db_info->use_rewrite; + self::$_instance->allow_rewrite = self::$_instance->db_info->use_rewrite === 'Y'; self::set('_http_port', self::$_instance->db_info->http_port ?: null); self::set('_https_port', self::$_instance->db_info->https_port ?: null); self::set('_use_ssl', self::$_instance->db_info->use_ssl); @@ -556,8 +579,8 @@ class Context $db_info->sitelock_title = $config['lock']['title']; $db_info->sitelock_message = $config['lock']['message']; $db_info->sitelock_whitelist = count($config['lock']['allow']) ? $config['lock']['allow'] : array('127.0.0.1'); - $db_info->embed_white_iframe = $config['embedfilter']['iframe']; - $db_info->embed_white_object = $config['embedfilter']['object']; + $db_info->embed_white_iframe = $config['mediafilter']['iframe'] ?: $config['embedfilter']['iframe']; + $db_info->embed_white_object = $config['mediafilter']['object'] ?: $config['embedfilter']['object']; $db_info->use_mobile_view = $config['use_mobile_view'] ? 'Y' : 'N'; $db_info->use_prepared_statements = $config['use_prepared_statements'] ? 'Y' : 'N'; $db_info->use_rewrite = $config['use_rewrite'] ? 'Y' : 'N'; @@ -668,7 +691,7 @@ class Context public function checkSSO() { // pass if it's not GET request or XE is not yet installed - if(!config('use_sso') || isCrawler()) + if(!config('use_sso') || Rhymix\Framework\UA::isRobot()) { return TRUE; } @@ -694,61 +717,66 @@ class Context $current_site = self::getRequestUri(); // Step 1: if the current site is not the default site, send SSO validation request to the default site - if($default_url !== $current_site && !self::get('SSOID') && $_COOKIE['sso'] !== md5($current_site)) + if($default_url !== $current_site && !self::get('sso_response') && $_COOKIE['sso'] !== md5($current_site)) { // Set sso cookie to prevent multiple simultaneous SSO validation requests setcookie('sso', md5($current_site), 0, '/'); // Redirect to the default site - $redirect_url = sprintf('%s?return_url=%s', $default_url, urlencode(base64_encode($current_site))); + $sso_request = Rhymix\Framework\Security::encrypt(Rhymix\Framework\URL::getCurrentURL()); + $redirect_url = $default_url . '?sso_request=' . urlencode($sso_request); header('Location:' . $redirect_url); - return FALSE; + return false; } // Step 2: receive and process SSO validation request at the default site - if($default_url === $current_site && self::get('return_url')) + if($default_url === $current_site && self::get('sso_request')) { // Get the URL of the origin site - $url = base64_decode(self::get('return_url')); - $url_info = parse_url($url); + $sso_request = Rhymix\Framework\Security::decrypt(self::get('sso_request')); + if (!$sso_request || !preg_match('!^https?://!', $sso_request)) + { + self::displayErrorPage('SSO Error', 'Invalid SSO Request', 400); + return false; + } // Check that the origin site is a valid site in this XE installation (to prevent open redirect vuln) if(!getModel('module')->getSiteInfoByDomain(rtrim($url, '/'))->site_srl) { - htmlHeader(); - echo self::getLang("msg_invalid_request"); - htmlFooter(); - return FALSE; + self::displayErrorPage('SSO Error', 'Invalid SSO Request', 400); + return false; } // Redirect back to the origin site - $url_info['query'] .= ($url_info['query'] ? '&' : '') . 'SSOID=' . session_id(); - $redirect_url = sprintf('%s://%s%s%s%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? (':' . $url_info['port']) : '', $url_info['path'], ($url_info['query'] ? ('?' . $url_info['query']) : '')); - header('Location:' . $redirect_url); - return FALSE; + $sso_response = Rhymix\Framework\Security::encrypt(session_id()); + header('Location: ' . Rhymix\Framework\URL::modifyURL($sso_request, array('sso_response' => $sso_response))); + return false; } // Step 3: back at the origin site, set session ID to be the same as the default site - if($default_url !== $current_site && self::get('SSOID')) + if($default_url !== $current_site && self::get('sso_response')) { - // Check that the session ID was given by the default site (to prevent session fixation CSRF) + // Check SSO response + $sso_response = Rhymix\Framework\Security::decrypt(self::get('sso_response')); + if ($sso_response === false) + { + self::displayErrorPage('SSO Error', 'Invalid SSO Response', 400); + return false; + } + + // Check that the response was given by the default site (to prevent session fixation CSRF) if(isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $default_url) !== 0) { - htmlHeader(); - echo self::getLang("msg_invalid_request"); - htmlFooter(); - return FALSE; + self::displayErrorPage('SSO Error', 'Invalid SSO Response', 400); + return false; } // Set session ID - setcookie(session_name(), self::get('SSOID')); + setcookie(session_name(), $sso_response); // Finally, redirect to the originally requested URL - $url_info = parse_url(self::getRequestUrl()); - $url_info['query'] = preg_replace('/(^|\b)SSOID=([^&?]+)/', '', $url_info['query']); - $redirect_url = sprintf('%s://%s%s%s%s', $url_info['scheme'], $url_info['host'], $url_info['port'] ? (':' . $url_info['port']) : '', $url_info['path'], ($url_info['query'] ? ('?' . $url_info['query']) : '')); - header('Location:' . $redirect_url); - return FALSE; + header('Location: ' . Rhymix\Framework\URL::getCurrentURL(array('sso_response' => null))); + return false; } // If none of the conditions above apply, proceed normally @@ -1040,7 +1068,11 @@ class Context */ public static function convertEncodingStr($str) { - if(!$str) return null; + if (!$str || utf8_check($str)) + { + return $str; + } + $obj = new stdClass; $obj->str = $str; $obj = self::convertEncoding($obj); @@ -1055,15 +1087,7 @@ class Context */ public static function encodeIdna($domain) { - if(function_exists('idn_to_ascii')) - { - return idn_to_ascii($domain); - } - else - { - $encoder = new TrueBV\Punycode(); - return $encoder->encode($domain); - } + return Rhymix\Framework\URL::encodeIdna($domain); } /** @@ -1074,15 +1098,7 @@ class Context */ public static function decodeIdna($domain) { - if(function_exists('idn_to_utf8')) - { - return idn_to_utf8($domain); - } - else - { - $decoder = new TrueBV\Punycode(); - return $decoder->decode($domain); - } + return Rhymix\Framework\URL::decodeIdna($domain); } /** @@ -1265,11 +1281,15 @@ class Context } $xml = $GLOBALS['HTTP_RAW_POST_DATA']; - if(Security::detectingXEE($xml)) + if(!Rhymix\Framework\Security::checkXEE($xml)) { header("HTTP/1.0 400 Bad Request"); exit; } + if(function_exists('libxml_disable_entity_loader')) + { + libxml_disable_entity_loader(true); + } $oXml = new XmlParser(); $xml_obj = $oXml->parse($xml); @@ -1345,10 +1365,9 @@ class Context * @see Cast variables, such as _srl, page, and cpage, into interger * @param string $key Variable key * @param string $val Variable value - * @param string $do_stripslashes Whether to strip slashes * @return mixed filtered value. Type are string or array */ - public function _filterRequestVar($key, $val, $do_stripslashes = 1) + public function _filterRequestVar($key, $val) { if(!($isArray = is_array($val))) { @@ -1374,19 +1393,6 @@ class Context else { $result[$k] = $v; - - if($do_stripslashes && version_compare(PHP_VERSION, '5.4.0', '<') && get_magic_quotes_gpc()) - { - if (is_array($result[$k])) - { - array_walk_recursive($result[$k], function(&$val) { $val = stripslashes($val); }); - } - else - { - $result[$k] = stripslashes($result[$k]); - } - } - if(is_array($result[$k])) { array_walk_recursive($result[$k], function(&$val) { $val = trim($val); }); @@ -1472,13 +1478,9 @@ class Context } // Allow if the current user is in the list of allowed IPs. - $allowed_list = config('lock.allow'); - foreach ($allowed_list as $allowed_ip) + if (Rhymix\Framework\Filters\IpFilter::inRanges(RX_CLIENT_IP, config('lock.allow'))) { - if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $allowed_ip)) - { - return; - } + return; } // Set headers and constants for backward compatibility. @@ -2566,6 +2568,26 @@ class Context return self::$_instance->allow_rewrite; } + /** + * Check whether an addon, module, or widget is blacklisted + * + * @param string $plugin_name + * @return bool + */ + public static function isBlacklistedPlugin($plugin_name) + { + if (self::$_blacklist === null) + { + self::$_blacklist = (include RX_BASEDIR . 'common/defaults/blacklist.php'); + if (!is_array(self::$_blacklist)) + { + self::$_blacklist = array(); + } + } + + return isset(self::$_blacklist[$plugin_name]); + } + /** * Converts a local path into an URL * diff --git a/classes/db/DB.class.php b/classes/db/DB.class.php index fbc205adc..e9f75a05f 100644 --- a/classes/db/DB.class.php +++ b/classes/db/DB.class.php @@ -24,7 +24,6 @@ class DB */ protected static $priority_dbms = array( 'mysqli' => 6, - 'mysql' => 4, 'cubrid' => 2, 'mssql' => 1 ); @@ -271,9 +270,13 @@ class DB // after creating instance of class, check is supported foreach ($supported_list as $db_type) { + if (strncasecmp($db_type, 'mysql', 5) === 0 && strtolower($db_type) !== 'mysqli') + { + 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) || stripos($class_file, '_innodb') !== false) + if (!file_exists($class_file)) { continue; } diff --git a/classes/db/DBCubrid.class.php b/classes/db/DBCubrid.class.php index 9059b99ce..1491eb73b 100644 --- a/classes/db/DBCubrid.class.php +++ b/classes/db/DBCubrid.class.php @@ -81,9 +81,14 @@ class DBCubrid extends DB define('__CUBRID_VERSION__', $cubrid_version); } - if(__CUBRID_VERSION__ >= '8.4.0') - cubrid_set_autocommit($result, CUBRID_AUTOCOMMIT_TRUE); - + if(version_compare(__CUBRID_VERSION__, '9.0', '<')) + { + $this->setError(-1, 'Rhymix requires CUBRID 9.0 or later. Current CUBRID version is ' . __CUBRID_VERSION__); + return; + } + + cubrid_set_autocommit($result, CUBRID_AUTOCOMMIT_TRUE); + return $result; } diff --git a/classes/db/DBMssql.class.php b/classes/db/DBMssql.class.php index c6d150b8c..a1473ac73 100644 --- a/classes/db/DBMssql.class.php +++ b/classes/db/DBMssql.class.php @@ -71,6 +71,16 @@ class DBMssql extends DB $this->setError(-1, 'database connect fail' . PHP_EOL . $errors); return; } + + $server_info = sqlsrv_server_info($result); + $server_version = $server_info['SQLServerVersion']; + if ($server_version && version_compare($server_version, '10', '<')) + { + $this->setError(-1, 'Rhymix requires Microsoft SQL Server 2008 or later. Current version is ' . $server_version); + return; + } + + return $result; } diff --git a/classes/db/DBMysql.class.php b/classes/db/DBMysql.class.php index 1b5264ed8..27e16b315 100644 --- a/classes/db/DBMysql.class.php +++ b/classes/db/DBMysql.class.php @@ -67,7 +67,8 @@ class DBMysql extends DB $result = @mysql_connect($connection['host'], $connection['user'], $connection['pass']); if(!$result) { - exit('Unable to connect to DB.'); + $this->setError(-1, 'Unable to connect to DB.'); + return; } if(mysql_error()) @@ -76,10 +77,10 @@ class DBMysql extends DB return; } - // Error appears if the version is lower than 4.1.13 - if(version_compare(mysql_get_server_info($result), '4.1.13', '<')) + // Error appears if the version is lower than 5.0.7 + if(version_compare(mysql_get_server_info($result), '5.0.7', '<')) { - $this->setError(-1, 'Rhymix requires MySQL 4.1.13 or later. Current MySQL version is ' . mysql_get_server_info()); + $this->setError(-1, 'Rhymix requires MySQL 5.0.7 or later. Current MySQL version is ' . mysql_get_server_info()); return; } @@ -164,7 +165,8 @@ class DBMysql extends DB { if(!$connection) { - exit('Rhymix cannot handle DB connection.'); + $this->setError(-1, 'Unable to connect to DB.'); + return false; } // Run the query statement $result = @mysql_query($query, $connection); diff --git a/classes/db/DBMysqli.class.php b/classes/db/DBMysqli.class.php index 8c425be45..ef8f845ba 100644 --- a/classes/db/DBMysqli.class.php +++ b/classes/db/DBMysqli.class.php @@ -80,8 +80,8 @@ class DBMysqli extends DBMysql { if ($connection === null) { - debug_print_backtrace(); - exit; + $this->setError(-1, 'Unable to connect to DB.'); + return false; } if($this->use_prepared_statements == 'Y') { diff --git a/classes/display/DisplayHandler.class.php b/classes/display/DisplayHandler.class.php index f48da0460..ebbdbb3e4 100644 --- a/classes/display/DisplayHandler.class.php +++ b/classes/display/DisplayHandler.class.php @@ -12,6 +12,7 @@ class DisplayHandler extends Handler { public static $response_size = 0; + public static $debug_printed = 0; var $content_size = 0; // /< The size of displaying contents var $gz_enabled = FALSE; // / entries = null; + } + if (count($display_content) && !isset($display_content['queries'])) + { + unset($data->queries); + } + if (count($display_content) && !isset($display_content['slow_queries'])) + { + unset($data->slow_queries); + } + if (count($display_content) && !isset($display_content['slow_triggers'])) + { + unset($data->slow_triggers); + } + if (count($display_content) && !isset($display_content['slow_widgets'])) + { + unset($data->slow_widgets); + } if ($data->entries) { foreach ($data->entries as &$entry) @@ -206,8 +246,9 @@ class DisplayHandler extends Handler } ob_start(); $data = Rhymix\Framework\Debug::getDebugData(); + $display_content = array_fill_keys(config('debug.display_content'), true); include RX_BASEDIR . 'common/tpl/debug_comment.html'; - $content = ob_get_clean(); + $content = preg_replace('/\n{2,}/', "\n\n", trim(ob_get_clean())) . PHP_EOL; if ($display_type === 'file') { $log_filename = config('debug.log_filename') ?: 'files/debug/YYYYMMDD.php'; @@ -226,7 +267,7 @@ class DisplayHandler extends Handler { $phpheader = ''; } - FileHandler::writeFile($log_filename, $phpheader . $content, 'a'); + FileHandler::writeFile($log_filename, $phpheader . $content . PHP_EOL, 'a'); return ''; } else diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 2254c2694..cf2556c27 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -394,7 +394,6 @@ class HTMLDisplayHandler if(Context::get('module') == 'admin' || strpos(Context::get('act'), 'Admin') > 0) { Context::loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true); - Context::loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true); Context::loadFile(array("./modules/admin/tpl/css/admin.iefix.css", '', 'ie', 10), true); Context::loadFile('./modules/admin/tpl/js/admin.js', true); Context::loadFile(array('./modules/admin/tpl/css/admin.bootstrap.css', '', '', 1), true); diff --git a/classes/display/JSONDisplayHandler.php b/classes/display/JSONDisplayHandler.php index 069b6464e..7e7fc61a1 100644 --- a/classes/display/JSONDisplayHandler.php +++ b/classes/display/JSONDisplayHandler.php @@ -15,20 +15,41 @@ class JSONDisplayHandler $variables['error'] = $oModule->getError(); $variables['message'] = $oModule->getMessage(); - $temp = array(); - foreach ($variables as $key => $value) + self::_convertCompat($variables, Context::getRequestMethod()); + return json_encode($variables); + } + + /** + * Convert arrays in a format that is compatible with XE. + * + * @param array $array + * @param string $compat_type + * @return array + */ + protected static function _convertCompat(&$array, $compat_type = 'JSON') + { + foreach ($array as $key => &$value) { - if (self::_isNumericArray($value)) + if (is_object($value)) { - $temp[$key] = array_values($value); + $value = get_object_vars($value); } - else + if (is_array($value)) { - $temp[$key] = $value; + self::_convertCompat($value, $compat_type); + if (self::_isNumericArray($value)) + { + if ($compat_type === 'XMLRPC') + { + $value = array('item' => array_values($value)); + } + else + { + $value = array_values($value); + } + } } } - - return json_encode($temp); } /** diff --git a/classes/display/VirtualXMLDisplayHandler.php b/classes/display/VirtualXMLDisplayHandler.php index aa67ee21d..124818aaa 100644 --- a/classes/display/VirtualXMLDisplayHandler.php +++ b/classes/display/VirtualXMLDisplayHandler.php @@ -24,11 +24,6 @@ class VirtualXMLDisplayHandler if($error === 0) { - if($message != 'success') - { - $output->message = $message; - } - if($redirect_url) { $output->url = $redirect_url; @@ -40,29 +35,32 @@ class VirtualXMLDisplayHandler } else { - if($message != 'fail') - { - $output->message = $message; - } + $output->message = $message; } $html = array(); - $html[] = ''; - + $html[] = ''; + return join(PHP_EOL, $html); } diff --git a/classes/extravar/Extravar.class.php b/classes/extravar/Extravar.class.php index 3960d4d94..ee70691f4 100644 --- a/classes/extravar/Extravar.class.php +++ b/classes/extravar/Extravar.class.php @@ -445,7 +445,7 @@ class ExtraItem $buff[] = ''; $buff[] = ''; - $buff[] = ''; + $buff[] = ''; $buff[] = ' diff --git a/common/tpl/debug_comment.html b/common/tpl/debug_comment.html index db0b873b0..3e9741aee 100644 --- a/common/tpl/debug_comment.html +++ b/common/tpl/debug_comment.html @@ -2,9 +2,11 @@ timestamp . ']' . "\n"; ?> + Request / Response ================== Request URL: url . "\n"; ?> +Request IP Address: Request Method: request->method . "\n" ?> Request Body Size: request->size . "\n" ?> Response Method: response->method . "\n"; ?> @@ -25,7 +27,9 @@ Resource Usage ============== Peak Memory Usage: Included Files: + + Debug Entries ============= + + PHP Errors and Warnings ======================= -errors === null): ?> -Error logging is disabled. - errors)) @@ -74,11 +77,9 @@ Error logging is disabled. ?> + Database Queries ================ -queries === null): ?> -Query logging is disabled. - queries)) @@ -99,6 +100,7 @@ Query logging is disabled. ?> + Slow Queries ============ + + Slow Triggers ============= trigger_time) . "\n"; } ?> + + Slow Widgets ============ widget_time) . "\n"; } ?> + diff --git a/composer.json b/composer.json index be2c76685..93d8d662d 100644 --- a/composer.json +++ b/composer.json @@ -1,38 +1,43 @@ { - "name": "rhymix/rhymix", - "description": "Rhymix", - "homepage": "https://www.rhymix.org", - "license": "GPL-2.0+", - "type": "project", - "authors": [ - { "name": "Rhymix Developers and Contributors", "email": "devops@rhymix.org" }, - { "name": "NAVER", "email": "developers@xpressengine.com" } - ], - "require": { - "php": ">=5.3.0", - "ext-curl": "*", - "ext-gd": "*", - "ext-iconv": "*", - "ext-json": "*", - "ext-mbstring": "*", - "ext-mcrypt": "*", - "ext-openssl": "*", - "ext-pcre": "*", - "ext-xml": "*", - "defuse/php-encryption": "1.2.1", - "ezyang/htmlpurifier": "4.7.*", - "firephp/firephp-core": "0.4.0", - "matthiasmullie/minify": "1.3.*", - "michelf/php-markdown": "1.5.*", - "rmccue/requests": "1.6.*", - "sunra/php-simple-html-dom-parser": "1.5.*", + "name": "rhymix/rhymix", + "description": "Rhymix", + "homepage": "https://www.rhymix.org", + "license": "GPL-2.0+", + "type": "project", + "authors": [ + { "name": "Rhymix Developers and Contributors", "email": "devops@rhymix.org" }, + { "name": "NAVER", "email": "developers@xpressengine.com" } + ], + "require": { + "php": ">=5.5.9", + "ext-curl": "*", + "ext-gd": "*", + "ext-iconv": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-mcrypt": "*", + "ext-openssl": "*", + "ext-pcre": "*", + "ext-xml": "*", + "defuse/php-encryption": "1.2.1", + "ezyang/htmlpurifier": "4.7.*", + "hautelook/phpass": "0.3.*", + "jbbcode/jbbcode": "1.3.*", + "leafo/lessphp": "0.5.*", + "leafo/scssphp": "0.6.*", + "league/html-to-markdown": "4.2.*", + "matthiasmullie/minify": "1.3.*", + "matthiasmullie/path-converter": "1.*", + "michelf/php-markdown": "1.6.*", + "michelf/php-smartypants": "1.6.0-beta1", + "rmccue/requests": "1.6.*", + "sunra/php-simple-html-dom-parser": "1.5.*", "swiftmailer/swiftmailer": "5.4.*", "true/punycode": "2.*" - }, - "require-dev": { - "php": ">=5.4.0", - "codeception/codeception": "2.1.*", - "codeception/verify": "0.3.*", - "codeception/specify": "0.4.*" - } + }, + "require-dev": { + "codeception/codeception": "2.1.*", + "codeception/verify": "0.3.*", + "codeception/specify": "0.4.*" + } } diff --git a/composer.lock b/composer.lock index 043cbfd87..94887961c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "a35061b94658a2dbdafe943dddcdc898", - "content-hash": "1a71937e1cbc600f8a237c6445d6a69f", + "hash": "ff1a5bab9497b1e5f25dd3069ffbbf13", + "content-hash": "9478a148fd56f1f50543063e3971a777", "packages": [ { "name": "defuse/php-encryption", @@ -97,25 +97,74 @@ "time": "2015-08-05 01:03:42" }, { - "name": "firephp/firephp-core", - "version": "v0.4.0", + "name": "hautelook/phpass", + "version": "0.3.4", "source": { "type": "git", - "url": "https://github.com/firephp/firephp-core.git", - "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf" + "url": "https://github.com/hautelook/phpass.git", + "reference": "f0217d804225822f9bdb0d392839029b0fcb0914" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firephp/firephp-core/zipball/fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf", - "reference": "fabad0f2503f9577fe8dd2cb1d1c7cd73ed2aacf", + "url": "https://api.github.com/repos/hautelook/phpass/zipball/f0217d804225822f9bdb0d392839029b0fcb0914", + "reference": "f0217d804225822f9bdb0d392839029b0fcb0914", "shasum": "" }, + "require": { + "php": ">=5.3.3" + }, "type": "library", "autoload": { - "classmap": [ - "lib/FirePHPCore/FirePHP.class.php", - "lib/FirePHPCore/fb.php" - ] + "psr-0": { + "Hautelook": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Public Domain" + ], + "authors": [ + { + "name": "Solar Designer", + "email": "solar@openwall.com", + "homepage": "http://openwall.com/phpass/" + } + ], + "description": "Portable PHP password hashing framework", + "homepage": "http://github.com/hautelook/phpass/", + "keywords": [ + "blowfish", + "crypt", + "password", + "security" + ], + "time": "2012-08-31 00:00:00" + }, + { + "name": "jbbcode/jbbcode", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/jbowens/jBBCode.git", + "reference": "645b6a1c0afa92b7d029d3417ebd8b60a5c578b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/jbowens/jBBCode/zipball/645b6a1c0afa92b7d029d3417ebd8b60a5c578b3", + "reference": "645b6a1c0afa92b7d029d3417ebd8b60a5c578b3", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "3.7.*" + }, + "type": "library", + "autoload": { + "psr-0": { + "JBBCode": "." + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -123,27 +172,190 @@ ], "authors": [ { - "name": "Christoph Dorn", - "email": "christoph@christophdorn.com", - "homepage": "http://christophdorn.com" + "name": "Jackson Owens", + "email": "jackson_owens@alumni.brown.edu", + "homepage": "http://jbowens.org/", + "role": "Developer" } ], - "description": "Traditional FirePHPCore library for sending PHP variables to the browser.", - "homepage": "https://github.com/firephp/firephp-core", - "time": "2013-04-23 15:28:20" + "description": "A lightweight but extensible BBCode parser written in PHP 5.3.", + "homepage": "http://jbbcode.com/", + "keywords": [ + "BB", + "bbcode" + ], + "time": "2014-07-06 05:48:20" }, { - "name": "matthiasmullie/minify", - "version": "1.3.32", + "name": "leafo/lessphp", + "version": "v0.5.0", "source": { "type": "git", - "url": "https://github.com/matthiasmullie/minify.git", - "reference": "140c714688908afcecde87338c8309233bdc2519" + "url": "https://github.com/leafo/lessphp.git", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/140c714688908afcecde87338c8309233bdc2519", - "reference": "140c714688908afcecde87338c8309233bdc2519", + "url": "https://api.github.com/repos/leafo/lessphp/zipball/0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "reference": "0f5a7f5545d2bcf4e9fad9a228c8ad89cc9aa283", + "shasum": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT", + "GPL-3.0" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" + } + ], + "description": "lessphp is a compiler for LESS written in PHP.", + "homepage": "http://leafo.net/lessphp/", + "time": "2014-11-24 18:39:20" + }, + { + "name": "leafo/scssphp", + "version": "v0.6.3", + "source": { + "type": "git", + "url": "https://github.com/leafo/scssphp.git", + "reference": "a27edad3d16635a222d7204706572e24c338aa17" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/leafo/scssphp/zipball/a27edad3d16635a222d7204706572e24c338aa17", + "reference": "a27edad3d16635a222d7204706572e24c338aa17", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "kherge/box": "~2.5", + "phpunit/phpunit": "~3.7", + "squizlabs/php_codesniffer": "~2.5" + }, + "bin": [ + "bin/pscss" + ], + "type": "library", + "autoload": { + "psr-4": { + "Leafo\\ScssPhp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Leaf Corcoran", + "email": "leafot@gmail.com", + "homepage": "http://leafo.net" + } + ], + "description": "scssphp is a compiler for SCSS written in PHP.", + "homepage": "http://leafo.github.io/scssphp/", + "keywords": [ + "css", + "less", + "sass", + "scss", + "stylesheet" + ], + "time": "2016-01-15 02:50:06" + }, + { + "name": "league/html-to-markdown", + "version": "4.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/html-to-markdown.git", + "reference": "9a5becc8c6b520920fb846afefcfd7faf4c31712" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/html-to-markdown/zipball/9a5becc8c6b520920fb846afefcfd7faf4c31712", + "reference": "9a5becc8c6b520920fb846afefcfd7faf4c31712", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xml": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "mikehaertl/php-shellcommand": "~1.1.0", + "phpunit/phpunit": "4.*", + "scrutinizer/ocular": "~1.1" + }, + "bin": [ + "bin/html-to-markdown" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.3-dev" + } + }, + "autoload": { + "psr-4": { + "League\\HTMLToMarkdown\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Colin O'Dell", + "email": "colinodell@gmail.com", + "homepage": "http://www.colinodell.com", + "role": "Lead Developer" + }, + { + "name": "Nick Cernis", + "email": "nick@cern.is", + "homepage": "http://modernnerd.net", + "role": "Original Author" + } + ], + "description": "An HTML-to-markdown conversion helper for PHP", + "homepage": "https://github.com/thephpleague/html-to-markdown", + "keywords": [ + "html", + "markdown" + ], + "time": "2016-02-01 16:49:02" + }, + { + "name": "matthiasmullie/minify", + "version": "1.3.34", + "source": { + "type": "git", + "url": "https://github.com/matthiasmullie/minify.git", + "reference": "272e46113404f66ced256659552a0cc074a7810f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/272e46113404f66ced256659552a0cc074a7810f", + "reference": "272e46113404f66ced256659552a0cc074a7810f", "shasum": "" }, "require": { @@ -153,8 +365,7 @@ }, "require-dev": { "matthiasmullie/scrapbook": "~1.0", - "phpunit/phpunit": "~4.8", - "satooshi/php-coveralls": "~1.0" + "phpunit/phpunit": "~4.8" }, "bin": [ "bin/minifycss", @@ -187,7 +398,7 @@ "minifier", "minify" ], - "time": "2016-01-11 02:10:11" + "time": "2016-03-01 08:00:27" }, { "name": "matthiasmullie/path-converter", @@ -241,16 +452,16 @@ }, { "name": "michelf/php-markdown", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/michelf/php-markdown.git", - "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9" + "reference": "156e56ee036505ec637d761ee62dc425d807183c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/michelf/php-markdown/zipball/e1aabe18173231ebcefc90e615565742fc1c7fd9", - "reference": "e1aabe18173231ebcefc90e615565742fc1c7fd9", + "url": "https://api.github.com/repos/michelf/php-markdown/zipball/156e56ee036505ec637d761ee62dc425d807183c", + "reference": "156e56ee036505ec637d761ee62dc425d807183c", "shasum": "" }, "require": { @@ -272,15 +483,15 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "John Gruber", - "homepage": "http://daringfireball.net/" - }, { "name": "Michel Fortin", "email": "michel.fortin@michelf.ca", "homepage": "https://michelf.ca/", "role": "Developer" + }, + { + "name": "John Gruber", + "homepage": "https://daringfireball.net/" } ], "description": "PHP Markdown", @@ -288,7 +499,62 @@ "keywords": [ "markdown" ], - "time": "2015-03-01 12:03:08" + "time": "2015-12-24 01:37:31" + }, + { + "name": "michelf/php-smartypants", + "version": "1.6.0-beta1", + "source": { + "type": "git", + "url": "https://github.com/michelf/php-smartypants.git", + "reference": "c0465c6d4c5ab853c2fa45df6c10bce7e35cc137" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/michelf/php-smartypants/zipball/c0465c6d4c5ab853c2fa45df6c10bce7e35cc137", + "reference": "c0465c6d4c5ab853c2fa45df6c10bce7e35cc137", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-lib": "1.6.x-dev" + } + }, + "autoload": { + "psr-0": { + "Michelf": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Michel Fortin", + "email": "michel.fortin@michelf.ca", + "homepage": "http://michelf.ca/", + "role": "Developer" + }, + { + "name": "John Gruber", + "homepage": "http://daringfireball.net/" + } + ], + "description": "PHP SmartyPants", + "homepage": "http://michelf.ca/projects/php-smartypants/", + "keywords": [ + "dashes", + "quotes", + "spaces", + "typographer", + "typography" + ], + "time": "2013-07-31 18:13:10" }, { "name": "rmccue/requests", @@ -485,11 +751,13 @@ "packages-dev": null, "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "michelf/php-smartypants": 10 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.3.0", + "php": ">=5.5.9", "ext-curl": "*", "ext-gd": "*", "ext-iconv": "*", diff --git a/layouts/xedition/conf/info.xml b/layouts/xedition/conf/info.xml index c20d39ca0..0acb07993 100644 --- a/layouts/xedition/conf/info.xml +++ b/layouts/xedition/conf/info.xml @@ -73,7 +73,7 @@ - contet_fixed_width + 고정폭 사용 시작 모듈만 전체 폭 diff --git a/layouts/xedition/lang/ko.php b/layouts/xedition/lang/ko.php new file mode 100644 index 000000000..b00f8c757 --- /dev/null +++ b/layouts/xedition/lang/ko.php @@ -0,0 +1,2 @@ +cmd_xedition_search_close = '검색창 닫기'; diff --git a/layouts/xedition/lang/lang.xml b/layouts/xedition/lang/lang.xml deleted file mode 100644 index 1ecfe33d3..000000000 --- a/layouts/xedition/lang/lang.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/layouts/xedition/layout.html b/layouts/xedition/layout.html index f1baa7776..105ab3911 100644 --- a/layouts/xedition/layout.html +++ b/layouts/xedition/layout.html @@ -228,7 +228,7 @@ -
- -
- - -
-
-
- -
- - -
-
- +  {$lang->debug_seconds}
- +  {$lang->debug_seconds}
- +  {$lang->debug_seconds}
@@ -57,10 +43,22 @@ +
+ +
+ + + + + + + +
+
- +

{$lang->about_debug_log_filename}

diff --git a/modules/admin/tpl/config_general.html b/modules/admin/tpl/config_general.html index 3fa98f0d6..3837dc106 100644 --- a/modules/admin/tpl/config_general.html +++ b/modules/admin/tpl/config_general.html @@ -45,6 +45,21 @@ +
+ +
+ + +
+

{$lang->about_auto_select_lang}

+
+
@@ -92,7 +107,7 @@

- +

{$lang->about_use_favicon} @@ -111,7 +126,7 @@

- +

{$lang->detail_use_mobile_icon} diff --git a/modules/admin/tpl/config_security.html b/modules/admin/tpl/config_security.html index ff81ba143..a8050b94c 100644 --- a/modules/admin/tpl/config_security.html +++ b/modules/admin/tpl/config_security.html @@ -8,15 +8,15 @@
- +
- +
- +
- +
diff --git a/modules/admin/tpl/css/admin.css b/modules/admin/tpl/css/admin.css index b0180e4c0..a0d16fea2 100644 --- a/modules/admin/tpl/css/admin.css +++ b/modules/admin/tpl/css/admin.css @@ -2389,3 +2389,36 @@ html[lang="mn"] .x .g11n.active>[disabled], height: 1px; overflow: hidden; } + +/* language specific styles */ +/* English admin_en.css */ +html:lang(en) body>.x, +html:lang(en) .x table, +html:lang(en) .x input, +html:lang(en) .x textarea, +html:lang(en) .x select, +html:lang(en) .x button{font-family:Arial,Helvetica,sans-serif} +@media all and (max-width:980px){ + html:lang(en) body>.x, + html:lang(en) .x table, + html:lang(en) .x input, + html:lang(en) .x textarea, + html:lang(en) .x select, + html:lang(en) .x button{font-family:sans-serif} +} + +/* Korean admin_ko.css */ +html:lang(ko) body>.x, +html:lang(ko) .x table, +html:lang(ko) .x input, +html:lang(ko) .x textarea, +html:lang(ko) .x select, +html:lang(ko) .x button{font-family: 'NanumGothic', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Dotum', Arial, Helvetica, sans-serif} + +/* Japanese admin_jp.css */ +html:lang(ja) body>.x, +html:lang(ja) .x table, +html:lang(ja) .x input, +html:lang(ja) .x textarea, +html:lang(ja) .x select, +html:lang(ja) .x button{font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif} \ No newline at end of file diff --git a/modules/admin/tpl/css/admin_en.css b/modules/admin/tpl/css/admin_en.css deleted file mode 100644 index 6cbb6efe0..000000000 --- a/modules/admin/tpl/css/admin_en.css +++ /dev/null @@ -1,5 +0,0 @@ -@charset "utf-8"; -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:Arial,Helvetica,sans-serif} -@media all and (max-width:980px){ -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:sans-serif} -} \ No newline at end of file diff --git a/modules/admin/tpl/css/admin_jp.css b/modules/admin/tpl/css/admin_jp.css deleted file mode 100644 index 178114846..000000000 --- a/modules/admin/tpl/css/admin_jp.css +++ /dev/null @@ -1,5 +0,0 @@ -@charset "utf-8"; -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif} -@media all and (max-width:980px){ -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:'ヒラギノ角ゴ Pro W3','Hiragino Kaku Gothic Pro','メイリオ',Meiryo,'MS Pゴシック',sans-serif} -} \ No newline at end of file diff --git a/modules/admin/tpl/css/admin_ko.css b/modules/admin/tpl/css/admin_ko.css deleted file mode 100644 index d16de3ca5..000000000 --- a/modules/admin/tpl/css/admin_ko.css +++ /dev/null @@ -1,5 +0,0 @@ -@charset "utf-8"; -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:나눔고딕,NanumGothic,돋움,Dotum,Arial,Helvetica,sans-serif} -@media all and (max-width:980px){ -body>.x,.x table,.x input,.x textarea,.x select,.x button{font-family:sans-serif} -} \ No newline at end of file diff --git a/modules/autoinstall/autoinstall.lib.php b/modules/autoinstall/autoinstall.lib.php index b4542e0c6..52f0819cc 100644 --- a/modules/autoinstall/autoinstall.lib.php +++ b/modules/autoinstall/autoinstall.lib.php @@ -411,7 +411,7 @@ class SFTPModuleInstaller extends ModuleInstaller if(!@ssh2_sftp_unlink($this->sftp, $target_path)) { - return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); + return new Object(-1, sprintf(lang('msg_delete_file_failed'), $path)); } return new Object(); } @@ -432,7 +432,7 @@ class SFTPModuleInstaller extends ModuleInstaller if(!@ssh2_sftp_rmdir($this->sftp, $target_path)) { - return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path)); + return new Object(-1, sprintf(lang('msg_delete_dir_failed'), $path)); } return new Object(); } @@ -532,7 +532,7 @@ class PHPFTPModuleInstaller extends ModuleInstaller $this->connection = ftp_connect($ftp_host, $this->ftp_info->ftp_port); if(!$this->connection) { - return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); + return new Object(-1, sprintf(lang('msg_ftp_not_connected'), $ftp_host)); } $login_result = @ftp_login($this->connection, $this->ftp_info->ftp_user, $this->ftp_password); @@ -745,7 +745,7 @@ class FTPModuleInstaller extends ModuleInstaller $this->oFtp = new ftp(); if(!$this->oFtp->ftp_connect($ftp_host, $this->ftp_info->ftp_port)) { - return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_host)); + return new Object(-1, sprintf(lang('msg_ftp_not_connected'), $ftp_host)); } if(!$this->oFtp->ftp_login($this->ftp_info->ftp_user, $this->ftp_password)) { @@ -772,7 +772,7 @@ class FTPModuleInstaller extends ModuleInstaller if(!$this->oFtp->ftp_delete($target_path)) { - return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); + return new Object(-1, sprintf(lang('msg_delete_file_failed'), $path)); } return new Object(); } @@ -792,7 +792,7 @@ class FTPModuleInstaller extends ModuleInstaller if(!$this->oFtp->ftp_rmdir($target_path)) { - return new Object(-1, sprintf(Context::getLang('msg_delete_dir_failed'), $path)); + return new Object(-1, sprintf(lang('msg_delete_dir_failed'), $path)); } return new Object(); } @@ -911,7 +911,7 @@ class DirectModuleInstaller extends ModuleInstaller if(!FileHandler::removeFile($target_path)) { - return new Object(-1, sprintf(Context::getLang('msg_delete_file_failed'), $path)); + return new Object(-1, sprintf(lang('msg_delete_file_failed'), $path)); } return new Object(); } diff --git a/modules/autoinstall/lang/fr.php b/modules/autoinstall/lang/fr.php index 98d74fb32..b3d9bbc7f 100644 --- a/modules/autoinstall/lang/fr.php +++ b/modules/autoinstall/lang/fr.php @@ -1,4 +1 @@ current_version = 'Version Courante'; -$lang->msg_ftp_invalid_auth_info = 'Cannot log in with the FTP password you entered. Please check if it is correct.'; -$lang->msg_ftp_not_connected = 'Connection to the %s via FTP failed. Please check the port number and whether the FTP service is available.'; diff --git a/modules/autoinstall/lang/ru.php b/modules/autoinstall/lang/ru.php index aa4fc4661..dfe603e26 100644 --- a/modules/autoinstall/lang/ru.php +++ b/modules/autoinstall/lang/ru.php @@ -3,13 +3,5 @@ $lang->order_newest = 'Новый'; $lang->order_popular = 'Популярный'; $lang->order_download = 'Скачать'; $lang->success_installed = 'Установлено успешно'; -$lang->description_ftp_note = 'If %s 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 %s to renew new information'; $lang->install = 'Инсталлировать'; $lang->update = 'Обновить'; -$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->rate = 'points'; -$lang->msg_ftp_not_connected = 'Connection to %s via FTP failed. Please check the port number and if FTP service is available.'; diff --git a/modules/board/board.admin.model.php b/modules/board/board.admin.model.php index 99d449112..f86a48657 100644 --- a/modules/board/board.admin.model.php +++ b/modules/board/board.admin.model.php @@ -48,10 +48,10 @@ class boardAdminModel extends board // set order target list foreach($this->order_target AS $key) { - $order_target[$key] = Context::getLang($key); + $order_target[$key] = lang($key); } - $order_target['list_order'] = Context::getLang('document_srl'); - $order_target['update_order'] = Context::getLang('last_update'); + $order_target['list_order'] = lang('document_srl'); + $order_target['update_order'] = lang('last_update'); Context::set('order_target', $order_target); // for advanced language & url diff --git a/modules/board/board.admin.view.php b/modules/board/board.admin.view.php index 12383f051..83f5683ab 100644 --- a/modules/board/board.admin.view.php +++ b/modules/board/board.admin.view.php @@ -54,9 +54,9 @@ class boardAdminView extends board { $this->setTemplatePath($template_path); // install order (sorting) options - foreach($this->order_target as $key) $order_target[$key] = Context::getLang($key); - $order_target['list_order'] = Context::getLang('document_srl'); - $order_target['update_order'] = Context::getLang('last_update'); + foreach($this->order_target as $key) $order_target[$key] = lang($key); + $order_target['list_order'] = lang('document_srl'); + $order_target['update_order'] = lang('last_update'); Context::set('order_target', $order_target); } @@ -295,7 +295,7 @@ class boardAdminView extends board { * @brief board module message **/ function alertMessage($message) { - $script = sprintf('', Context::getLang($message)); + $script = sprintf('', lang($message)); Context::addHtmlHeader( $script ); } } diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index e1646246c..4b726a63a 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -50,6 +50,10 @@ class boardController extends board unset($obj->title_color); unset($obj->title_bold); } + else + { + $obj->is_admin = 'Y'; + } // generate document module model object $oDocumentModel = getModel('document'); @@ -106,6 +110,11 @@ class boardController extends board } } + if($this->module_info->update_log == 'Y') + { + $obj->update_log_setting = 'Y'; + } + // update the document if it is existed if($is_update) { @@ -122,11 +131,16 @@ class boardController extends board } } + if($this->module_info->use_anonymous == 'Y') { + $obj->member_srl = abs($oDocument->get('member_srl')) * -1; + $oDocument->add('member_srl', $obj->member_srl); + } + if($this->module_info->protect_document_regdate > 0 && $this->grant->manager == false) { if($oDocument->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = Context::getLang('msg_protect_regdate_document'); + $format = lang('msg_protect_regdate_document'); $massage = sprintf($format, $this->module_info->protect_document_regdate); return new Object(-1, $massage); } @@ -146,12 +160,14 @@ class boardController extends board $obj->last_update = $obj->regdate = date('YmdHis'); $obj->update_order = $obj->list_order = (getNextSequence() * -1); } - - $output = $oDocumentController->updateDocument($oDocument, $obj); + $obj->reason_update = escape($obj->reason_update); + $output = $oDocumentController->updateDocument($oDocument, $obj, true); $msg_code = 'success_updated'; // insert a new document otherwise - } else { + } + else + { $output = $oDocumentController->insertDocument($obj, $bAnonymous); $msg_code = 'success_registed'; $obj->document_srl = $output->get('document_srl'); @@ -191,6 +207,7 @@ class boardController extends board } // return the results + $this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '', 'document_srl', $output->get('document_srl'))); $this->add('mid', Context::get('mid')); $this->add('document_srl', $output->get('document_srl')); @@ -198,6 +215,48 @@ class boardController extends board $this->setMessage($msg_code); } + function procBoardRevertDocument() + { + $update_id = Context::get('update_id'); + $logged_info = Context::get('logged_info'); + if(!$update_id) + { + return new Object(-1, 'msg_no_update_id'); + } + + $oDocumentModel = getModel('document'); + $oDocumentController = getController('document'); + $update_log = $oDocumentModel->getUpdateLog($update_id); + + if($logged_info->is_admin != 'Y') + { + $Exists_log = $oDocumentModel->getUpdateLogAdminisExists($update_log->document_srl); + if($Exists_log === true) + { + return new Object(-1, 'msg_admin_update_log'); + } + } + + if(!$update_log) + { + return new Object(-1, 'msg_no_update_log'); + } + + $oDocument = $oDocumentModel->getDocument($update_log->document_srl); + $obj = new stdClass(); + $obj->title = $update_log->title; + $obj->document_srl = $update_log->document_srl; + $obj->title_bold = $update_log->title_bold; + $obj->title_color = $update_log->title_color; + $obj->content = $update_log->content; + $obj->update_log_setting = 'Y'; + $obj->reason_update = lang('board.revert_reason_update'); + $output = $oDocumentController->updateDocument($oDocument, $obj); + $this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'),'act', '', 'document_srl', $update_log->document_srl)); + $this->add('mid', Context::get('mid')); + $this->add('document_srl', $update_log->document_srl); + } + /** * @brief delete the document **/ @@ -227,7 +286,7 @@ class boardController extends board { if($oDocument->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = Context::getLang('msg_protect_regdate_document'); + $format = lang('msg_protect_regdate_document'); $massage = sprintf($format, $this->module_info->protect_document_regdate); return new Object(-1, $massage); } @@ -378,7 +437,7 @@ class boardController extends board { if($comment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = Context::getLang('msg_protect_regdate_comment'); + $format = lang('msg_protect_regdate_comment'); $massage = sprintf($format, $this->module_info->protect_document_regdate); return new Object(-1, $massage); } @@ -399,6 +458,7 @@ class boardController extends board } $this->setMessage('success_registed'); + $this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '', 'document_srl', $obj->document_srl) . '#comment_' . $obj->comment_srl); $this->add('mid', Context::get('mid')); $this->add('document_srl', $obj->document_srl); $this->add('comment_srl', $obj->comment_srl); @@ -431,7 +491,7 @@ class boardController extends board { if($comment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = Context::getLang('msg_protect_regdate_comment'); + $format = lang('msg_protect_regdate_comment'); $massage = sprintf($format, $this->module_info->protect_document_regdate); return new Object(-1, $massage); } @@ -449,6 +509,7 @@ class boardController extends board $this->add('page', Context::get('page')); $this->add('document_srl', $output->get('document_srl')); $this->setMessage('success_deleted'); + $this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '', 'page', Context::get('page'), 'document_srl', $output->get('document_srl'))); } /** @@ -473,6 +534,7 @@ class boardController extends board $this->add('page', Context::get('page')); $this->add('document_srl', $output->get('document_srl')); $this->setMessage('success_deleted'); + $this->setRedirectUrl(getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', '', 'page', Context::get('page'), 'document_srl', $output->get('document_srl'))); } /** diff --git a/modules/board/board.mobile.php b/modules/board/board.mobile.php index 6223d2d6a..a036a0156 100644 --- a/modules/board/board.mobile.php +++ b/modules/board/board.mobile.php @@ -105,7 +105,7 @@ class boardMobile extends boardView function dispBoardMessage($msg_code) { - $msg = Context::getLang($msg_code); + $msg = lang($msg_code); $oMessageObject = &ModuleHandler::getModuleInstance('message','mobile'); $oMessageObject->setError(-1); $oMessageObject->setMessage($msg); diff --git a/modules/board/board.model.php b/modules/board/board.model.php index 002632f2e..ef2fa52d3 100644 --- a/modules/board/board.model.php +++ b/modules/board/board.model.php @@ -48,7 +48,7 @@ class boardModel extends module } else { - $output[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null); + $output[$key] = new ExtraItem($module_srl, -1, lang($key), $key, 'N', 'N', 'N', null); } } return $output; @@ -64,7 +64,7 @@ class boardModel extends module 'user_id', 'user_name', 'readed_count', 'voted_count', 'blamed_count', 'thumbnail', 'summary', 'comment_status'); foreach($virtual_vars as $key) { - $extra_vars[$key] = new ExtraItem($module_srl, -1, Context::getLang($key), $key, 'N', 'N', 'N', null); + $extra_vars[$key] = new ExtraItem($module_srl, -1, lang($key), $key, 'N', 'N', 'N', null); } // get the extra variables from the document model diff --git a/modules/board/board.view.php b/modules/board/board.view.php index 015241e69..b59acb0a1 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -160,7 +160,7 @@ class boardView extends board * add extra vaiables to the search options **/ // use search options on the template (the search options key has been declared, based on the language selected) - foreach($this->search_option as $opt) $search_option[$opt] = Context::getLang($opt); + foreach($this->search_option as $opt) $search_option[$opt] = lang($opt); $extra_keys = Context::get('extra_keys'); if($extra_keys) { @@ -328,11 +328,13 @@ class boardView extends board // disappear the document if it is secret if($oDocument->isSecret() && !$oDocument->isGranted()) { - $oDocument->add('content',Context::getLang('thisissecret')); + $oDocument->add('content',lang('thisissecret')); } } } + Context::set('update_view', $this->grant->update_view); + // setup the document oject on context $oDocument->add('module_srl', $this->module_srl); Context::set('oDocument', $oDocument); @@ -430,7 +432,7 @@ class boardView extends board { if(!$val->isAccessible()) { - $val->add('content',Context::getLang('thisissecret')); + $val->add('content',lang('thisissecret')); } } } @@ -698,7 +700,7 @@ class boardView extends board { if($oDocument->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = Context::getLang('msg_protect_regdate_document'); + $format = lang('msg_protect_regdate_document'); $massage = sprintf($format, $this->module_info->protect_document_regdate); return new Object(-1, $massage); } @@ -825,7 +827,7 @@ class boardView extends board { if($oDocument->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = Context::getLang('msg_protect_regdate_document'); + $format = lang('msg_protect_regdate_document'); $massage = sprintf($format, $this->module_info->protect_document_regdate); return new Object(-1, $massage); } @@ -987,7 +989,7 @@ class boardView extends board { if($oComment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = Context::getLang('msg_protect_regdate_comment'); + $format = lang('msg_protect_regdate_comment'); $massage = sprintf($format, $this->module_info->protect_document_regdate); return new Object(-1, $massage); } @@ -1055,7 +1057,7 @@ class boardView extends board { if($oComment->get('regdate') < date('YmdHis', strtotime('-'.$this->module_info->protect_document_regdate.' day'))) { - $format = Context::getLang('msg_protect_regdate_comment'); + $format = lang('msg_protect_regdate_comment'); $massage = sprintf($format, $this->module_info->protect_document_regdate); return new Object(-1, $massage); } @@ -1134,19 +1136,59 @@ class boardView extends board **/ function dispBoardMessage($msg_code) { - $msg = Context::getLang($msg_code); + $msg = lang($msg_code); if(!$msg) $msg = $msg_code; Context::set('message', $msg); $this->setTemplateFile('message'); } + function dispBoardUpdateLog() + { + $oDocumentModel = getModel('document'); + $document_srl = Context::get('document_srl'); + + if($this->grant->update_view !== true) + { + return new Object(-1, 'msg_not_permitted'); + } + + $updatelog = $oDocumentModel->getDocumentUpdateLog($document_srl); + Context::set('total_count', $updatelog->page_navigation->total_count); + Context::set('total_page', $updatelog->page_navigation->total_page); + Context::set('page', $updatelog->page); + Context::set('page_navigation', $updatelog->page_navigation); + Context::set('updatelog', $updatelog); + + $this->setTemplateFile('update_list'); + } + + function dispBoardUpdateLogView() + { + $oDocumentModel = getModel('document'); + $update_id = Context::get('update_id'); + + if($this->grant->update_view !== true) + { + return new Object(-1, 'msg_not_permitted'); + } + $update_log = $oDocumentModel->getUpdateLog($update_id); + $extra_vars = unserialize($update_log->extra_vars); + + Context::addJsFilter($this->module_path.'tpl/filter', 'update.xml'); + + Context::set('extra_vars', $extra_vars); + Context::set('update_log', $update_log); + + $this->setTemplateFile('update_view'); + } + /** * @brief the method for displaying the warning messages * display an error message if it has not a special design **/ function alertMessage($message) { - $script = sprintf('', Context::getLang($message)); + $script = sprintf('', lang($message)); Context::addHtmlFooter( $script ); } diff --git a/modules/board/board.wap.php b/modules/board/board.wap.php index 53e64ac96..10d06f85f 100644 --- a/modules/board/board.wap.php +++ b/modules/board/board.wap.php @@ -17,7 +17,7 @@ class boardWAP extends board // check grant if(!$this->grant->list || $this->module_info->consultation == 'Y') { - return $oMobile->setContent(Context::getLang('msg_not_permitted')); + return $oMobile->setContent(lang('msg_not_permitted')); } // generate document model object @@ -33,7 +33,7 @@ class boardWAP extends board // check the grant if(!$this->grant->view) { - return $oMobile->setContent(Context::getLang('msg_not_permitted')); + return $oMobile->setContent(lang('msg_not_permitted')); } // setup the browser title @@ -64,7 +64,7 @@ class boardWAP extends board $oMobile->setContent( $content ); // setup upper URL - $oMobile->setUpperUrl( getUrl('act',''), Context::getLang('cmd_go_upper') ); + $oMobile->setUpperUrl( getUrl('act',''), lang('cmd_go_upper') ); // display the document if the act is not display the comment list } else { @@ -74,14 +74,14 @@ class boardWAP extends board // setup content information(include the comments link) - $content = Context::getLang('replies').' : '.$oDocument->getCommentCount().'
'."\r\n".$content; + $content = lang('replies').' : '.$oDocument->getCommentCount().'
'."\r\n".$content; $content = ''.$oDocument->getNickName().' ('.$oDocument->getRegdate("Y-m-d").")
\r\n".$content; // setup mobile contents $oMobile->setContent( $content ); // setup upper URL - $oMobile->setUpperUrl( getUrl('document_srl',''), Context::getLang('cmd_list') ); + $oMobile->setUpperUrl( getUrl('document_srl',''), lang('cmd_list') ); } @@ -124,12 +124,12 @@ class boardWAP extends board // next/prevUrl specification if($page > 1) { - $oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', Context::getLang('cmd_prev'), $page-1, $totalPage)); + $oMobile->setPrevUrl(getUrl('mid',$_GET['mid'],'page',$page-1), sprintf('%s (%d/%d)', lang('cmd_prev'), $page-1, $totalPage)); } if($page < $totalPage) { - $oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', Context::getLang('cmd_next'), $page+1, $totalPage)); + $oMobile->setNextUrl(getUrl('mid',$_GET['mid'],'page',$page+1), sprintf('%s (%d/%d)', lang('cmd_next'), $page+1, $totalPage)); } $oMobile->mobilePage = $page; diff --git a/modules/board/conf/module.xml b/modules/board/conf/module.xml index 72002fed7..dfa619e9b 100644 --- a/modules/board/conf/module.xml +++ b/modules/board/conf/module.xml @@ -21,6 +21,9 @@ 檢視 görüş + + 수정내역 조회 + 글 작성 发表新主题 @@ -63,6 +66,7 @@ + @@ -73,8 +77,10 @@ + + diff --git a/modules/board/lang/es.php b/modules/board/lang/es.php index 3799f7ce2..40fbda476 100644 --- a/modules/board/lang/es.php +++ b/modules/board/lang/es.php @@ -13,7 +13,6 @@ $lang->cmd_board_info = 'Información del Tablero'; $lang->about_layout_setup = 'Puede modificar manualmente el código del diseño de tableros. Insertar o modificar el código de widget.'; $lang->about_board_category = 'Puede crear las categorias de tableros. Cuando no funciona la categoría de tableros, rehacer el archivo caché manualmente para solucionar.'; $lang->about_except_notice = 'Aviso de los artículos no se mostrará en la lista normal.'; -$lang->about_use_anonymous = '글쓴이의 정보를 없애고 익명으로 게시판 사용을 할 수 있게 합니다. 스킨설정에서 글쓴이 정보등을 보이지 않도록 하시면 더욱 유용합니다'; $lang->about_board = 'Este módulo es para crear y manejar los tableros.'; $lang->about_consultation = 'No administrador de los miembros que consideran que su propia artocles. \\ NNon miembros no serían capaces de escribir artículos al utilizar la consulta.'; $lang->about_secret = 'Boletín y los comentarios de bimilgeul utilizar.'; diff --git a/modules/board/lang/fr.php b/modules/board/lang/fr.php index 30497e469..4fd5a7566 100644 --- a/modules/board/lang/fr.php +++ b/modules/board/lang/fr.php @@ -10,8 +10,6 @@ $lang->cmd_board_info = 'Information des Panneaux'; $lang->about_layout_setup = 'Vous pouvez manuellement modifier le code de Mise en Page du blogue. Insérez ou administrez le code de Gadget n\'importe où vous voulez.'; $lang->about_board_category = 'Vous pouvez créer des catégories de Panneau d\'Affichage. Quand la catégorie d\'affichage est cassé, essayez manuellement rétablir l\'antémémoire du fichier.'; $lang->about_except_notice = 'Le titre de Notice dont l\'article se représentera toujours en tête de la liste ne sera exposé sur la liste générale.'; -$lang->about_use_anonymous = '글쓴이의 정보를 없애고 익명으로 게시판 사용을 할 수 있게 합니다. 스킨설정에서 글쓴이 정보등을 보이지 않도록 하시면 더욱 유용합니다'; $lang->about_board = 'Ce module se sert à créer et à administrer des Panneaux d\'Affichage.'; $lang->about_consultation = 'Les membres non-administratifs verront seulement les ariticles d\'eux-même. Non-membres ne pourraient pas écrire des articles quand la Consultation est appliqué.'; $lang->about_admin_mail = 'Un message éléctronique sera envoyé à l\'adresse inscrite quand un article ou commentaire se soumet. On peut inscrire multiple adresses délimité par les virgules.'; -$lang->about_list_config = '게시판의 목록형식 사용시 원하는 항목들로 배치를 할 수 있습니다. 단 스킨에서 지원하지 않는 경우 지원되지 않을 수 있습니다 대상항목/ 표시항목의 항목을 더블클릭하면 추가/ 제거가 됩니다.'; diff --git a/modules/board/lang/ko.php b/modules/board/lang/ko.php index ce76b6e86..23e90484a 100644 --- a/modules/board/lang/ko.php +++ b/modules/board/lang/ko.php @@ -14,6 +14,8 @@ $lang->consultation = '상담 기능'; $lang->secret = '비밀글 기능'; $lang->thisissecret = '비밀글입니다.'; $lang->admin_mail = '관리자 메일'; +$lang->update_log = '게시글 수정 내역'; +$lang->last_updater = '수정한사람'; $lang->cmd_board_list = '게시판 목록'; $lang->cmd_module_config = '게시판 공통 설정'; $lang->cmd_board_info = '게시판 정보'; @@ -31,6 +33,7 @@ $lang->about_admin_mail = '글이나 댓글이 등록될때 등록된 메일주 $lang->about_list_config = '게시판의 목록형식 사용시 원하는 항목들로 배치를 할 수 있습니다. 단 스킨에서 지원하지 않는 경우 불가능합니다. 대상항목/ 표시항목의 항목을 더블클릭하면 추가/ 제거가 됩니다.'; $lang->about_use_status = '글 작성 시 선택할 수 있는 상태를 지정해주세요.'; $lang->about_protect_comment = '댓글의 댓글이 있을경우 해당댓글을 삭제 및 수정을 할 수 없도록 합니다.'; +$lang->about_update_log = '게시글을 수정할 경우 수정한 내역을 저장하도록 합니다.'; $lang->msg_not_enough_point = '포인트가 부족합니다'; $lang->write_comment = '댓글 쓰기'; $lang->msg_not_allow_comment = '해당 글의 댓글 쓰기가 잠겨있습니다.'; @@ -52,4 +55,15 @@ $lang->msg_admin_comment_no_modify = '최고관리자의 댓글을 수정할 권 $lang->msg_board_delete_protect_comment = '댓글이 작성된 댓글의 글을 삭제할 수 없습니다.'; $lang->msg_board_update_protect_comment = '댓글이 작성된 댓글의 글을 수정할 수 없습니다.'; $lang->msg_protect_regdate_document = '%s일 이전의 게시글은 수정 또는 삭제 할 수 없습니다.'; -$lang->msg_protect_regdate_comment = '%s일 이전의 댓글은 수정 또는 삭제 할 수 없습니다.'; \ No newline at end of file +$lang->msg_protect_regdate_comment = '%s일 이전의 댓글은 수정 또는 삭제 할 수 없습니다.'; +$lang->msg_dont_have_update_log = '업데이트 로그가 기록되어 있지 않은 게시글입니다.'; +$lang->original_letter = '원본글'; +$lang->msg_warning_update_log = '주의! 사용시 디비가 많이 늘어날 수 있습니다.'; +$lang->reason_update = '수정한 이유'; +$lang->msg_no_update_id = '업데이트 고유 번호는 필수입니다.'; +$lang->msg_no_update_log = '업데이트 로그가 존재하지 않습니다.'; +$lang->cmd_modify_by_update_log = '이 로그로 게시물을 수정하기'; +$lang->msg_admin_update_log = '관리자가 수정한 적이 있는 게시물입니다. 관리자에게 문의하세요.'; +$lang->msg_update_log_revert = '정말로 이 버전으로 되돌리시겠습니까?'; +$lang->write_admin = '관리자작성'; +$lang->revert_reason_update = '이 버전으로 되돌림'; diff --git a/modules/board/lang/ru.php b/modules/board/lang/ru.php index 3db404004..e51067ae9 100644 --- a/modules/board/lang/ru.php +++ b/modules/board/lang/ru.php @@ -7,8 +7,4 @@ $lang->cmd_module_config = 'Общие настройки форума'; $lang->cmd_board_info = 'Информация форума'; $lang->about_layout_setup = 'Вы можете вручную изменять лейаут код блога. Вставляйте или управляйте кодом виджетов везде, где хотите'; $lang->about_board_category = 'Вы можете сделать категории блога. Когда категория блога испорчена, попробуйте перепостроить файл кеша вручную.'; -$lang->about_use_anonymous = '글쓴이의 정보를 없애고 익명으로 게시판 사용을 할 수 있게 합니다. 스킨설정에서 글쓴이 정보등을 보이지 않도록 하시면 더욱 유용합니다'; -$lang->about_board = 'Этот модуль служит для создания и управления форумами.'; -$lang->about_consultation = '상담 기능은 관리권한이 없는 회원은 자신이 쓴 글만 보이도록 하는 기능입니다. 단 상담기능 사용시 비회원 글쓰기는 자동으로 금지됩니다.'; -$lang->about_admin_mail = '글이나 댓글이 등록될때 등록된 메일주소로 메일이 발송됩니다 ,(콤마)로 연결시 다수의 메일주소로 발송할 수 있습니다.'; -$lang->about_list_config = '게시판의 목록형식 사용시 원하는 항목들로 배치를 할 수 있습니다. 단 스킨에서 지원하지 않는 경우 지원되지 않을 수 있습니다 대상항목/ 표시항목의 항목을 더블클릭하면 추가/ 제거가 됩니다.'; +$lang->about_board = 'Этот модуль служит для создания и управления форумами.'; \ No newline at end of file diff --git a/modules/board/lang/zh-CN.php b/modules/board/lang/zh-CN.php index 9fab19e2e..47ad27694 100644 --- a/modules/board/lang/zh-CN.php +++ b/modules/board/lang/zh-CN.php @@ -16,7 +16,6 @@ $lang->cmd_list_setting = '列表设置'; $lang->about_layout_setup = '可直接编辑博客布局代码。可以把控件代码插入到您喜欢的位置。'; $lang->about_board_category = '可以添加/删除分类项 分类有异常情况时,可以尝试重新生成缓冲文件。'; $lang->about_except_notice = '设置公告目录项不再重复显示到普通目录当中。'; -$lang->about_use_anonymous = '글쓴이의 정보를 없애고 익명으로 게시판 사용을 할 수 있게 합니다. 스킨설정에서 글쓴이 정보등을 보이지 않도록 하시면 더욱 유용합니다'; $lang->about_board = '可生成及管理版面的模块。'; $lang->about_consultation = '咨询功能是指除有管理权限的会员以外,其他会员只能浏览自己发表的主题。使用咨询功能时系统将自动禁止非会员的发表主题权限。'; $lang->about_secret = '设置主题及评论当中使用密帖与否。'; diff --git a/modules/board/skins/default/write_form.html b/modules/board/skins/default/write_form.html index f3e13930e..62301dd1a 100644 --- a/modules/board/skins/default/write_form.html +++ b/modules/board/skins/default/write_form.html @@ -10,7 +10,7 @@ {str_repeat("  ",$val->depth)} {$val->title} ({$val->document_count}) - + diff --git a/modules/board/skins/xedition/_read.html b/modules/board/skins/xedition/_read.html index 7c3e6030b..f0102cb25 100644 --- a/modules/board/skins/xedition/_read.html +++ b/modules/board/skins/xedition/_read.html @@ -114,7 +114,8 @@ Profile
{$oDocument->getSignature()}
-
+
+ {$lang->update_log} {$lang->cmd_modify} {$lang->cmd_delete} diff --git a/modules/board/skins/xedition/board.default.css b/modules/board/skins/xedition/board.default.css index 866a9f86f..92fd8f4c9 100644 --- a/modules/board/skins/xedition/board.default.css +++ b/modules/board/skins/xedition/board.default.css @@ -263,6 +263,16 @@ right:0; border-radius: 0 2px 2px 0; } + +.update-log { + width:100%; + border-bottom:1px solid #dbdbdb; + margin: 5px auto 5px auto; + + padding:5px; + +} + /* Board Write */ /* write_form.html */ @@ -445,6 +455,13 @@ text-overflow: ellipsis; color: #555; } +.read_header h1 span.is_admin { + font-size: 15px; + font-weight: normal; + line-height:15px; + color:#FF6C00; +} + .read_header h1 a { text-decoration: none; color: #444; @@ -463,6 +480,9 @@ white-space: nowrap; color : #666; } +.update-log .read_header .meta { + border-bottom:0; +} .read_header .meta > span { margin-left: 8px ;} .read_header .meta > span:first-child {margin-left:0;} .read_header .meta:after { diff --git a/modules/board/skins/xedition/update_list.html b/modules/board/skins/xedition/update_list.html new file mode 100644 index 000000000..088295a78 --- /dev/null +++ b/modules/board/skins/xedition/update_list.html @@ -0,0 +1,43 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + +
{$lang->title}{$lang->writer}{$lang->last_updater}{$lang->last_post}
+ {$val->title} + + {$val->nick_name} + + {$val->update_nick_name} + + {zdate($val->regdate, 'Y.m.d H:i:s')} +
{$lang->msg_dont_have_update_log}
+
+ + diff --git a/modules/board/skins/xedition/update_view.html b/modules/board/skins/xedition/update_view.html new file mode 100644 index 000000000..bfbffda3c --- /dev/null +++ b/modules/board/skins/xedition/update_view.html @@ -0,0 +1,37 @@ + +
+
+ +
+

+ {$category_list[$update_log->category_srl]->title} + {$update_log->title} {$lang->write_admin} +

+

+ + {zdate($update_log->regdate,'Y.m.d H:i:s')} + +

+
+ +
+ {$update_log->content} +
+

+ {$key} : {$val} +

+

+ {$lang->reason_update} : + {$update_log->reason_update} +

+ +
+ +
+ + + + +
+
+ diff --git a/modules/board/skins/xedition/write_form.html b/modules/board/skins/xedition/write_form.html index e9a197a07..98455f834 100644 --- a/modules/board/skins/xedition/write_form.html +++ b/modules/board/skins/xedition/write_form.html @@ -10,7 +10,7 @@ {str_repeat("  ",$val->depth)} {$val->title} ({$val->document_count}) - + @@ -43,6 +43,7 @@ + get('status') == $key || ($key == 'PUBLIC' && !$document_srl))-->checked="checked" /> @@ -66,7 +67,11 @@ - +
+ + + +
diff --git a/modules/board/tpl/board_insert.html b/modules/board/tpl/board_insert.html index ad2e7c176..457b8a550 100644 --- a/modules/board/tpl/board_insert.html +++ b/modules/board/tpl/board_insert.html @@ -199,6 +199,13 @@
+
+ +
+ +

{$lang->msg_warning_update_log}

+
+
diff --git a/modules/board/tpl/filter/update.xml b/modules/board/tpl/filter/update.xml new file mode 100644 index 000000000..a55476429 --- /dev/null +++ b/modules/board/tpl/filter/update.xml @@ -0,0 +1,7 @@ + +
+ + + + +
diff --git a/modules/board/tpl/js/board.js b/modules/board/tpl/js/board.js index 9e344c435..d0e7fa165 100644 --- a/modules/board/tpl/js/board.js +++ b/modules/board/tpl/js/board.js @@ -13,19 +13,21 @@ function completeDocumentInserted(ret_obj) var document_srl = ret_obj.document_srl; var category_srl = ret_obj.category_srl; - //alert(message); - - var url; - if(!document_srl) - { - url = current_url.setQuery('mid',mid).setQuery('act',''); + if (ret_obj.redirect_url) { + redirect(ret_obj.redirect_url); + } else { + var url; + if(!document_srl) + { + url = current_url.setQuery('mid',mid).setQuery('act',''); + } + else + { + url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act',''); + } + if(category_srl) url = url.setQuery('category',category_srl); + redirect(url); } - else - { - url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act',''); - } - if(category_srl) url = url.setQuery('category',category_srl); - location.href = url; } /* delete the document */ @@ -38,10 +40,7 @@ function completeDeleteDocument(ret_obj) var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl',''); if(page) url = url.setQuery('page',page); - - //alert(message); - - location.href = url; + redirect(url); } /* document search */ @@ -54,8 +53,7 @@ function completeVote(ret_obj) { var error = ret_obj.error; var message = ret_obj.message; - alert(message); - location.href = location.href; + redirect(window.location.href); } // current page reload @@ -63,8 +61,7 @@ function completeReload(ret_obj) { var error = ret_obj.error; var message = ret_obj.message; - - location.href = location.href; + redirect(window.location.href); } /* complete to insert comment*/ @@ -75,13 +72,13 @@ function completeInsertComment(ret_obj) var mid = ret_obj.mid; var document_srl = ret_obj.document_srl; var comment_srl = ret_obj.comment_srl; - - var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act',''); - if(comment_srl) url = url.setQuery('rnd',comment_srl)+"#comment_"+comment_srl; - - //alert(message); - - location.href = url; + if (ret_obj.redirect_url) { + redirect(ret_obj.redirect_url); + } else { + var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act',''); + if (comment_srl) url = url.setQuery('rnd',comment_srl)+"#comment_"+comment_srl; + redirect(url); + } } /* delete the comment */ @@ -93,12 +90,13 @@ function completeDeleteComment(ret_obj) var document_srl = ret_obj.document_srl; var page = ret_obj.page; - var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act',''); - if(page) url = url.setQuery('page',page); - - //alert(message); - - location.href = url; + if (ret_obj.redirect_url) { + redirect(ret_obj.redirect_url); + } else { + var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act',''); + if (page) url = url.setQuery('page',page); + redirect(url); + } } /* delete the trackback */ @@ -110,12 +108,13 @@ function completeDeleteTrackback(ret_obj) var document_srl = ret_obj.document_srl; var page = ret_obj.page; - var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act',''); - if(page) url = url.setQuery('page',page); - - //alert(message); - - location.href = url; + if (ret_obj.redirect_url) { + redirect(ret_obj.redirect_url); + } else { + var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act',''); + if (page) url = url.setQuery('page',page); + redirect(url); + } } /* change category */ diff --git a/modules/comment/comment.admin.controller.php b/modules/comment/comment.admin.controller.php index da6d95a78..40fd69af3 100644 --- a/modules/comment/comment.admin.controller.php +++ b/modules/comment/comment.admin.controller.php @@ -267,7 +267,7 @@ class commentAdminController extends comment { $msgCode = 'success_deleted'; } - //$this->setMessage( sprintf(Context::getLang('msg_checked_comment_is_deleted'), $deleted_count) ); + //$this->setMessage( sprintf(lang('msg_checked_comment_is_deleted'), $deleted_count) ); $this->setMessage($msgCode, 'info'); //set url params diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 5ba090ca2..ab2c4262e 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -207,7 +207,7 @@ class commentController extends comment // if an user select message from options, message would be the option. $message_option = strval(Context::get('message_option')); - $improper_comment_reasons = Context::getLang('improper_comment_reasons'); + $improper_comment_reasons = lang('improper_comment_reasons'); $declare_message = ($message_option !== 'others' && isset($improper_comment_reasons[$message_option]))? $improper_comment_reasons[$message_option] : trim(Context::get('declare_message')); @@ -594,7 +594,7 @@ class commentController extends comment if(!$manual_inserted) { // send a message if notify_message option in enabled in the original article - $oDocument->notify(Context::getLang('comment'), $obj->content); + $oDocument->notify(lang('comment'), $obj->content); // send a message if notify_message option in enabled in the original comment if($obj->parent_srl) @@ -602,7 +602,7 @@ class commentController extends comment $oParent = $oCommentModel->getComment($obj->parent_srl); if($oParent->get('member_srl') != $oDocument->get('member_srl')) { - $oParent->notify(Context::getLang('comment'), $obj->content); + $oParent->notify(lang('comment'), $obj->content); } } } @@ -829,9 +829,9 @@ class commentController extends comment } // set modifier's information if logged-in and posting author and modifier are matched. + $logged_info = Context::get('logged_info'); 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; diff --git a/modules/comment/comment.item.php b/modules/comment/comment.item.php index 744d17994..4b1906f4a 100644 --- a/modules/comment/comment.item.php +++ b/modules/comment/comment.item.php @@ -312,7 +312,7 @@ class commentItem extends Object { if($this->isSecret() && !$this->isAccessible()) { - return Context::getLang('msg_is_secret'); + return lang('msg_is_secret'); } $content = $this->get('content'); @@ -333,7 +333,7 @@ class commentItem extends Object { if($this->isSecret() && !$this->isAccessible()) { - return Context::getLang('msg_is_secret'); + return lang('msg_is_secret'); } $content = $this->get('content'); @@ -343,7 +343,7 @@ class commentItem extends Object if($add_popup_menu && Context::get('is_logged')) { $content = sprintf( - '%s', $content, $this->comment_srl, Context::getLang('cmd_comment_do') + '%s', $content, $this->comment_srl, lang('cmd_comment_do') ); } diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php index 09ca6be0f..1a2def9d5 100644 --- a/modules/comment/comment.model.php +++ b/modules/comment/comment.model.php @@ -77,7 +77,7 @@ class commentModel extends comment ModuleHandler::triggerCall('comment.getCommentMenu', 'after', $menu_list); if($this->grant->manager){ - $str_confirm = Context::getLang('confirm_move'); + $str_confirm = lang('confirm_move'); $url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['comment_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('comment', 'procCommentAdminMoveToTrash', params)", $str_confirm, $comment_srl); $oCommentController->addCommentPopupMenu($url,'cmd_trash','','javascript'); @@ -106,7 +106,7 @@ class commentModel extends comment for($i = 0; $i < $menus_count; $i++) { - $menus[$i]->str = Context::getLang($menus[$i]->str); + $menus[$i]->str = lang($menus[$i]->str); } // get a list of final organized pop-up menus diff --git a/modules/comment/lang/lang.xml b/modules/comment/lang/lang.xml deleted file mode 100644 index 6fe6ea89d..000000000 --- a/modules/comment/lang/lang.xml +++ /dev/null @@ -1,377 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/modules/communication/communication.admin.controller.php b/modules/communication/communication.admin.controller.php index f0e7f0974..fd05dcb35 100644 --- a/modules/communication/communication.admin.controller.php +++ b/modules/communication/communication.admin.controller.php @@ -24,39 +24,14 @@ class communicationAdminController extends communication function procCommunicationAdminInsertConfig() { // get the default information - $args = Context::gets('skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_write_default','grant_write_group', 'member_menu'); + $args = Context::gets('enable_message', 'enable_friend', 'skin', 'colorset', 'editor_skin', 'sel_editor_colorset', 'mskin', 'mcolorset', 'layout_srl', 'mlayout_srl', 'grant_send_default','grant_send_group'); $args->editor_colorset = $args->sel_editor_colorset; unset($args->sel_editor_colorset); - if(!$args->skin) - { - $args->skin = 'default'; - } - - if(!$args->colorset) - { - $args->colorset = 'white'; - } - - if(!$args->editor_skin) - { - $args->editor_skin = 'default'; - } - - if(!$args->mskin) - { - $args->mskin = 'default'; - } - - if(!$args->layout_srl) - { - $args->layout_srl = NULL; - } - $oCommunicationModel = getModel('communication'); - $args->grant_write = $oCommunicationModel->getGrantArray($args->grant_write_default, $args->grant_write_group); - unset($args->grant_write_default); - unset($args->grant_write_group); + $args->grant_send = $oCommunicationModel->getGrantArray($args->grant_send_default, $args->grant_send_group); + unset($args->grant_send_default); + unset($args->grant_send_group); // create the module module Controller object $oModuleController = getController('module'); diff --git a/modules/communication/communication.admin.view.php b/modules/communication/communication.admin.view.php index 9fc91e73d..89dd8f498 100644 --- a/modules/communication/communication.admin.view.php +++ b/modules/communication/communication.admin.view.php @@ -30,7 +30,7 @@ class communicationAdminView extends communication $oCommunicationModel = getModel('communication'); // get the configurations of communication module - Context::set('communication_config', $oCommunicationModel->getConfig()); + Context::set('config', $oCommunicationModel->getConfig()); // get a list of layout Context::set('layout_list', $oLayoutModel->getLayoutList()); @@ -39,10 +39,10 @@ class communicationAdminView extends communication Context::set('editor_skin_list', $oEditorModel->getEditorSkinList()); // get a list of communication skins - Context::set('communication_skin_list', $oModuleModel->getSkins($this->module_path)); + Context::set('skin_list', $oModuleModel->getSkins($this->module_path)); // get a list of communication skins - Context::set('communication_mobile_skin_list', $oModuleModel->getSkins($this->module_path, 'm.skins')); + Context::set('mobile_skin_list', $oModuleModel->getSkins($this->module_path, 'm.skins')); // Get a layout list $layout_list = $oLayoutModel->getLayoutList(); @@ -52,11 +52,11 @@ class communicationAdminView extends communication Context::set('mlayout_list', $mlayout_list); $security = new Security(); - $security->encodeHTML('communication_config..'); + $security->encodeHTML('config..'); $security->encodeHTML('layout_list..'); $security->encodeHTML('editor_skin_list..'); - $security->encodeHTML('communication_skin_list..title'); - $security->encodeHTML('communication_mobile_skin_list..title'); + $security->encodeHTML('skin_list..title'); + $security->encodeHTML('mobile_skin_list..title'); $oMemberModel = getModel('member'); $group_list = $oMemberModel->getGroups($this->site_srl); diff --git a/modules/communication/communication.class.php b/modules/communication/communication.class.php index 559e2f28b..1da302005 100644 --- a/modules/communication/communication.class.php +++ b/modules/communication/communication.class.php @@ -9,7 +9,11 @@ class communication extends ModuleObject { private $triggers = array( - array('moduleHandler.init', 'communication', 'controller', 'triggerModuleHandlerAfter', 'after') + array('moduleHandler.init', 'communication', 'controller', 'triggerModuleHandlerBefore', 'before'), + array('member.getMemberMenu', 'communication', 'controller', 'triggerMemberMenu', 'before') + ); + private $delete_triggers = array( + array('moduleObject.proc', 'communication', 'controller', 'triggerModuleProcAfter', 'after') ); /** * Implement if additional tasks are necessary when installing @@ -18,6 +22,7 @@ class communication extends ModuleObject function moduleInstall() { $oModuleController = getController('module'); + foreach($this->triggers as $trigger) { $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); @@ -25,6 +30,7 @@ class communication extends ModuleObject // Create a temporary file storage for one new private message notification FileHandler::makeDir('./files/member_extra_info/new_message_flags'); + return new Object(); } @@ -34,28 +40,8 @@ class communication extends ModuleObject */ function checkUpdate() { - if(!is_dir("./files/member_extra_info/new_message_flags")) - { - return TRUE; - } - - $oModuleModel = getModel('module'); - $config = $oModuleModel->getModuleConfig('message'); - - if($config->skin) - { - $config_parse = explode('.', $config->skin); - if(count($config_parse) > 1) - { - $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); - if(is_dir($template_path)) - { - return TRUE; - } - } - } - $oModuleModel = getModel('module'); + foreach($this->triggers as $trigger) { if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) @@ -63,6 +49,21 @@ class communication extends ModuleObject return TRUE; } } + + foreach($this->delete_triggers as $trigger) + { + + if($oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) + { + return TRUE; + } + } + + if(!is_dir("./files/member_extra_info/new_message_flags")) + { + return TRUE; + } + return FALSE; } @@ -72,13 +73,9 @@ class communication extends ModuleObject */ function moduleUpdate() { - if(!is_dir("./files/member_extra_info/new_message_flags")) - { - FileHandler::makeDir('./files/member_extra_info/new_message_flags'); - } - $oModuleModel = getModel('module'); $oModuleController = getController('module'); + foreach($this->triggers as $trigger) { if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) @@ -86,24 +83,18 @@ class communication extends ModuleObject $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); } } - $config = $oModuleModel->getModuleConfig('message'); - if(!is_object($config)) + + foreach($this->delete_triggers as $trigger) { - $config = new stdClass(); + if($oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) + { + $oModuleController->deleteTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); + } } - if($config->skin) + if(!is_dir("./files/member_extra_info/new_message_flags")) { - $config_parse = explode('.', $config->skin); - if(count($config_parse) > 1) - { - $template_path = sprintf('./themes/%s/modules/communication/', $config_parse[0]); - if(is_dir($template_path)) - { - $config->skin = implode('|@|', $config_parse); - $oModuleController->updateModuleConfig('communication', $config); - } - } + FileHandler::makeDir('./files/member_extra_info/new_message_flags'); } return new Object(0, 'success_updated'); diff --git a/modules/communication/communication.controller.php b/modules/communication/communication.controller.php index 452c61afc..026fbbb76 100644 --- a/modules/communication/communication.controller.php +++ b/modules/communication/communication.controller.php @@ -89,7 +89,7 @@ class communicationController extends communication $oCommunicationModel = getModel('communication'); $config = $oCommunicationModel->getConfig(); - if(!$oCommunicationModel->checkGrant($config->grant_write)) + if(!$oCommunicationModel->checkGrant($config->grant_send)) { return new Object(-1, 'msg_not_permitted'); } @@ -254,15 +254,11 @@ class communicationController extends communication $oDB->rollback(); return $trigger_output; } - - // create a flag that message is sent (in file format) - $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(); + + // create a flag that message is sent (in file format) + $this->updateFlagFile($receiver_srl); return new Object(0, 'success_sended'); } @@ -303,7 +299,7 @@ class communicationController extends communication { return $output; } - + $this->updateFlagFile($logged_info->member_srl); $this->setMessage('success_registed'); } @@ -363,7 +359,7 @@ class communicationController extends communication { return $output; } - + $this->updateFlagFile($member_srl); $this->setMessage('success_deleted'); } @@ -441,7 +437,7 @@ class communicationController extends communication { return $output; } - + $this->updateFlagFile($member_srl); $this->setMessage('success_deleted'); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispCommunicationMessages', 'message_type', Context::get('message_type')); @@ -463,10 +459,20 @@ class communicationController extends communication $logged_info = Context::get('logged_info'); $target_srl = (int) trim(Context::get('target_srl')); - if(!$target_srl) + if(!$target_srl || $target_srl == $logged_info->member_srl) { return new Object(-1, 'msg_invalid_request'); } + + // Check duplicate friend + $args = new stdClass(); + $args->member_srl = $logged_info->member_srl; + $args->target_srl = $target_srl; + $output = executeQuery('communication.isAddedFriend', $args); + if($output->data->count) + { + return new Object(-1, 'msg_already_friend'); + } // Variable $args = new stdClass(); @@ -771,85 +777,111 @@ class communicationController extends communication */ function setMessageReaded($message_srl) { - $args = new stdClass(); + $args = new stdClass; $args->message_srl = $message_srl; $args->related_srl = $message_srl; - return executeQuery('communication.setMessageReaded', $args); + $output = executeQuery('communication.setMessageReaded', $args); + + // Update flag file + $logged_info = Context::get('logged_info'); + $this->updateFlagFile($logged_info->member_srl); + + return $output; + } + + /** + * Update flag file + * @param int $member_srl + * @return void + */ + function updateFlagFile($member_srl) + { + $flag_path = \RX_BASEDIR . 'files/member_extra_info/new_message_flags/' . getNumberingPath($member_srl); + $flag_file = $flag_path . $member_srl; + $new_message_count = getModel('communication')->getNewMessageCount($member_srl); + if($new_message_count > 0) + { + FileHandler::writeFile($flag_file, $new_message_count); + } + else + { + FileHandler::removeFile($flag_file); + } } - function triggerModuleHandlerAfter($module) + function triggerModuleHandlerBefore($obj) { - if(!Context::get('is_logged') && isCrawler()) + // Add menus on the member login information + $config = getModel('communication')->getConfig(); + $oMemberController = getController('member'); + + if($config->enable_message == 'Y') + { + $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box'); + } + + if($config->enable_friend == 'Y') + { + $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend'); + } + } + + function triggerMemberMenu() + { + if(!Context::get('is_logged')) { return new Object(); } - - if($module->module == 'admin') - { - return new Object(); - } - + $oCommunicationModel = getModel('communication'); $config = $oCommunicationModel->getConfig(); - - if($config->member_menu != 'Y') + + if($config->enable_message == 'N' && $config->enable_friend == 'N') { return new Object(); } - $act = Context::get('act'); - if($module->module != 'member') + + $mid = Context::get('cur_mid'); + $member_srl = Context::get('target_srl'); + $logged_info = Context::get('logged_info'); + $oMemberController = getController('member'); + + // Add a feature to display own message box. + if($logged_info->member_srl == $member_srl) { - $oMemberController = getController('member'); - $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend'); - $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box'); - - // Pop-up to display messages if a flag on new message is set - $new_message_count = $oCommunicationModel->getNewMessageCount(); - if($new_message_count > 0) + // Add your own viewing Note Template + if($config->enable_message == 'Y') { - Context::loadFile('./modules/communication/tpl/js/member_communication.js'); - $text = preg_replace('@\r?\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived'))); - Context::addHtmlHeader(""); - } - - } - elseif($act == 'getMemberMenu') - { - $member_srl = Context::get('target_srl'); - $oCommunicationModel = getModel('communication'); - $logged_info = Context::get('logged_info'); - // Add a feature to display own message box. - if($logged_info->member_srl == $member_srl) - { - $mid = Context::get('cur_mid'); - $oMemberController = getController('member'); - // Add your own viewing Note Template $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationMessages'), 'cmd_view_message_box', '', 'self'); - // Display a list of friends - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationFriend'), 'cmd_view_friend', '', 'self'); - // If not, Add menus to send message and to add friends } - else + + // Display a list of friends + if($config->enable_friend == 'Y') { - // Get member information - $oMemberModel = getModel('member'); - $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); - if(!$target_member_info->member_srl) - { - return new Object(); - } + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationFriend'), 'cmd_view_friend', '', 'self'); + } + } + // If not, Add menus to send message and to add friends + else + { + // Get member information + $oMemberModel = getModel('member'); + $target_member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + if(!$target_member_info->member_srl) + { + return new Object(); + } - $oMemberController = getController('member'); - // Add a menu for sending message - if($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl))) - { - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup'); - } - // Add a menu for listing friends (if a friend is new) - if(!$oCommunicationModel->isAddedFriend($member_srl)) - { - $oMemberController->addMemberPopupMenu(getUrl('', 'mid', Context::get('cur_mid'), 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup'); - } + // Add a menu for sending message + if($config->enable_message == 'Y' && ($logged_info->is_admin == 'Y' || $target_member_info->allow_message == 'Y' || ($target_member_info->allow_message == 'F' && $oCommunicationModel->isFriend($member_srl)))) + { + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationSendMessage', 'receiver_srl', $member_srl), 'cmd_send_message', '', 'popup'); + } + + // Add a menu for listing friends (if a friend is new) + if($config->enable_friend == 'Y' && !$oCommunicationModel->isAddedFriend($member_srl)) + { + $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationAddFriend', 'target_srl', $member_srl), 'cmd_add_friend', '', 'popup'); } } } diff --git a/modules/communication/communication.model.php b/modules/communication/communication.model.php index 753bb2132..b4bb6974c 100644 --- a/modules/communication/communication.model.php +++ b/modules/communication/communication.model.php @@ -25,44 +25,44 @@ class communicationModel extends communication function getConfig() { $oModuleModel = getModel('module'); - $communication_config = $oModuleModel->getModuleConfig('communication'); + $config = $oModuleModel->getModuleConfig('communication'); - if(!is_object($communication_config)) + if(!$config->skin) { - $communication_config = new stdClass(); + $config->skin = 'default'; } - if(!$communication_config->skin) + if(!$config->colorset) { - $communication_config->skin = 'default'; + $config->colorset = 'white'; } - if(!$communication_config->colorset) + if(!$config->editor_skin) { - $communication_config->colorset = 'white'; + $config->editor_skin = 'ckeditor'; } - if(!$communication_config->editor_skin) + if(!$config->mskin) { - $communication_config->editor_skin = 'ckeditor'; + $config->mskin = 'default'; + } + + if(!$config->grant_send) + { + $config->grant_send = array('default' => 'member'); } - if(!$communication_config->mskin) + if(!$config->enable_message) { - $communication_config->mskin = 'default'; + $config->enable_message = 'Y'; + } + + if(!$config->enable_friend) + { + $config->enable_friend = 'Y'; } - if(!$communication_config->grant_write) - { - $communication_config->grant_write = array('default_grant' => 'member'); - } - - if(!$communication_config->member_menu) - { - $communication_config->member_menu = 'Y'; - } - - return $communication_config; + return $config; } /** @@ -74,82 +74,60 @@ class communicationModel extends communication function getGrantArray($default, $group) { $grant = array(); - if($default!="") + if($default) { - switch($default) - { - case "-2": - $grant = array("default_grant"=>"site"); - break; - case "-3": - $grant = array("default_grant"=>"manager"); - break; - default : - $grant = array("default_grant"=>"member"); - break; - } - } + $grant = array('default' => $default); + } else if(is_array($group)) { - $oMemberModel = getModel('member'); - $group_list = $oMemberModel->getGroups($this->site_srl); - - $group_grant = array(); + $grant_group = array(); foreach($group as $group_srl) { - $group_grant[$group_srl] = $group_list[$group_srl]->title; + $grant_group[$group_srl] = true; } - $grant = array('group_grant'=>$group_grant); + + $grant = array('group' => $grant_group); } + return $grant; } /** - * @brief check member's grant - * @param object $member_info + * @brief Check Grant * @param array $arrGrant * @return boolean */ function checkGrant($arrGrant) { - if(!$arrGrant) - return false; - - if(!Context::get('is_logged')) - return false; + if(!$arrGrant) return false; $logged_info = Context::get('logged_info'); - if($logged_info->is_admin == "Y") - return true; + if($logged_info->is_admin == 'Y') return true; - if($arrGrant['default_grant']) + if($arrGrant['default']) { - if($arrGrant['default_grant'] == "member" && $logged_info) - return true; - - if($arrGrant['default_grant'] == "site" && $this->site_srl == $logged_info->site_srl) - return true; - - if($arrGrant['default_grant'] == "manager" && $logged_info->is_admin == "Y") - return true; - } - - if($arrGrant['group_grant']) - { - $group_grant = $arrGrant['group_grant']; - if(!is_array($group_grant)) - return false; - - foreach($logged_info->group_list as $group_srl=>$title) + if($arrGrant['default'] == 'member') { - if(isset($group_grant[$group_srl])&&$group_grant[$group_srl]==$title) - return true; + if(Context::get('is_logged')) return true; + } + else if($arrGrant['default'] == 'site') + { + if($this->site_srl == $logged_info->site_srl) return true; + } + else if($arrGrant['default'] == 'manager') + { + if($logged_info->is_admin == 'Y') return true; + } + } + else if(is_array($arrGrant['group'])) + { + foreach($logged_info->group_list as $group_srl => $title) + { + if(isset($arrGrant['group'][$group_srl])) return true; } - } return false; - } /** diff --git a/modules/communication/communication.view.php b/modules/communication/communication.view.php index 23c008524..28e043767 100644 --- a/modules/communication/communication.view.php +++ b/modules/communication/communication.view.php @@ -17,10 +17,10 @@ class communicationView extends communication { $oCommunicationModel = getModel('communication'); - $this->communication_config = $oCommunicationModel->getConfig(); - $skin = $this->communication_config->skin; + $this->config = $oCommunicationModel->getConfig(); + $skin = $this->config->skin; - Context::set('communication_config', $this->communication_config); + Context::set('communication_config', $this->config); $config_parse = explode('|@|', $skin); @@ -36,10 +36,10 @@ class communicationView extends communication $this->setTemplatePath($tpl_path); $oLayoutModel = getModel('layout'); - $layout_info = $oLayoutModel->getLayout($this->communication_config->layout_srl); + $layout_info = $oLayoutModel->getLayout($this->config->layout_srl); if($layout_info) { - $this->module_info->layout_srl = $this->communication_config->layout_srl; + $this->module_info->layout_srl = $this->config->layout_srl; $this->setLayoutPath($layout_info->path); } } @@ -50,6 +50,11 @@ class communicationView extends communication */ function dispCommunicationMessages() { + if($this->config->enable_message == 'N') + { + return $this->stop('msg_invalid_request'); + } + // Error appears if not logged-in if(!Context::get('is_logged')) { @@ -58,11 +63,6 @@ class communicationView extends communication $logged_info = Context::get('logged_info'); - if(!array_key_exists('dispCommunicationMessages', $logged_info->menu_list)) - { - return $this->stop('msg_invalid_request'); - } - // Set the variables $message_srl = Context::get('message_srl'); $message_type = Context::get('message_type'); @@ -115,7 +115,7 @@ class communicationView extends communication // Extract a list $columnList = array('message_srl', 'readed', 'title', 'member.member_srl', 'member.nick_name', 'message.regdate', 'readed_date'); $output = $oCommunicationModel->getMessages($message_type, $columnList); - + // set a template file Context::set('total_count', $output->total_count); Context::set('total_page', $output->total_page); @@ -138,6 +138,11 @@ class communicationView extends communication $this->setLayoutPath('./common/tpl/'); $this->setLayoutFile('popup_layout'); + if($this->config->enable_message == 'N') + { + return $this->stop('msg_invalid_request'); + } + // Error appears if not logged-in if(!Context::get('is_logged')) { @@ -157,11 +162,6 @@ class communicationView extends communication Context::set('message', $message); } - // Delete a flag - $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'); } @@ -174,9 +174,11 @@ class communicationView extends communication $this->setLayoutPath('./common/tpl/'); $this->setLayoutFile("popup_layout"); - $oCommunicationModel = getModel('communication'); - $oMemberModel = getModel('member'); - + if($this->config->enable_message == 'N') + { + return $this->stop('msg_invalid_request'); + } + // Error appears if not logged-in if(!Context::get('is_logged')) { @@ -199,6 +201,9 @@ class communicationView extends communication return $this->stop('msg_cannot_send_to_yourself'); } + $oCommunicationModel = getModel('communication'); + $oMemberModel = getModel('member'); + // get message_srl of the original message if it is a reply $message_srl = Context::get('message_srl'); if($message_srl) @@ -235,8 +240,8 @@ class communicationView extends communication $option->resizable = FALSE; $option->disable_html = TRUE; $option->height = 300; - $option->skin = $this->communication_config->editor_skin; - $option->colorset = $this->communication_config->editor_colorset; + $option->skin = $this->config->editor_skin; + $option->colorset = $this->config->editor_colorset; $editor = $oEditorModel->getEditor($logged_info->member_srl, $option); Context::set('editor', $editor); @@ -249,12 +254,17 @@ class communicationView extends communication */ function dispCommunicationFriend() { + if($this->config->enable_friend == 'N') + { + return $this->stop('msg_invalid_request'); + } + // Error appears if not logged-in if(!Context::get('is_logged')) { return $this->stop('msg_not_logged'); } - + $oCommunicationModel = getModel('communication'); // get a group list @@ -307,7 +317,12 @@ class communicationView extends communication { $this->setLayoutPath('./common/tpl/'); $this->setLayoutFile("popup_layout"); - + + if($this->config->enable_friend == 'N') + { + return $this->stop('msg_invalid_request'); + } + // error appears if not logged-in if(!Context::get('is_logged')) { @@ -349,7 +364,12 @@ class communicationView extends communication { $this->setLayoutPath('./common/tpl/'); $this->setLayoutFile("popup_layout"); - + + if($this->config->enable_friend == 'N') + { + return $this->stop('msg_invalid_request'); + } + // error apprears if not logged-in if(!Context::get('is_logged')) { diff --git a/modules/communication/lang/en.php b/modules/communication/lang/en.php index 4289cec4c..ed0c26480 100644 --- a/modules/communication/lang/en.php +++ b/modules/communication/lang/en.php @@ -21,7 +21,9 @@ $lang->cmd_message_box = 'Message Box'; $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->cmd_rename_friend_group = 'Rename Friend Group'; +$lang->cmd_delete_friend_group = 'Delete Friend Group'; +$lang->msg_already_friend = 'You are already friends with this person.'; $lang->msg_no_message = 'There is no message.'; $lang->msg_cannot_send_to_yourself = 'Cannot send a message to yourself.'; $lang->message_received = 'You have a new message.'; @@ -32,6 +34,8 @@ $lang->msg_disallow_message = 'Failed to send a message because the recipient bl $lang->about_allow_message = 'You can set whether to receive messages or not.'; $lang->message_notice = 'Send a message to the author about this. If you don\'t write a message, it is not sent.'; $lang->friends_page_does_not_support = 'Friends in a mobile environment is not supported. Please go to the PC page.'; -$lang->cmd_write_communication = 'Write Grant'; +$lang->communication_send_message_grant = 'Send Message Grant'; $lang->cmd_manage_base = 'Basic infomation'; $lang->alert_new_message_arrived = 'You have %d new message(s). Do you want to check it now?'; +$lang->enable_communication_friend = 'Friend Enable'; +$lang->enable_communication_message = 'Message Enable'; diff --git a/modules/communication/lang/es.php b/modules/communication/lang/es.php index 789ed1c77..55de5ace5 100644 --- a/modules/communication/lang/es.php +++ b/modules/communication/lang/es.php @@ -1,5 +1,4 @@ about_communication = '회원간의 쪽지나 친구 관리 등 커뮤니케이션 기능을 수행합니다'; $lang->allow_message = 'Permitir la recepción del mensaje'; $lang->allow_message_type['Y'] = 'Recibir todo'; $lang->allow_message_type['N'] = 'Rechazar'; diff --git a/modules/communication/lang/ja.php b/modules/communication/lang/ja.php index b0a821f76..3c8345302 100644 --- a/modules/communication/lang/ja.php +++ b/modules/communication/lang/ja.php @@ -22,6 +22,8 @@ $lang->cmd_view_message_box = 'メッセージ'; $lang->cmd_store = '保存'; $lang->cmd_add_friend_group = '友達グループ追加'; $lang->cmd_rename_friend_group = '友達グループ名変更'; +$lang->cmd_delete_friend_group = '友達グループ削除'; +$lang->msg_already_friend = '既に友達として登録されています。'; $lang->msg_no_message = 'メッセージがありません。'; $lang->msg_cannot_send_to_yourself = '自分自身へのメッセージ送信はできません。'; $lang->message_received = 'メッセージが届きました。'; diff --git a/modules/communication/lang/ko.php b/modules/communication/lang/ko.php index fc7b22f74..9b4548cdd 100644 --- a/modules/communication/lang/ko.php +++ b/modules/communication/lang/ko.php @@ -22,6 +22,8 @@ $lang->cmd_view_message_box = '쪽지함 보기'; $lang->cmd_store = '보관'; $lang->cmd_add_friend_group = '친구 그룹 추가'; $lang->cmd_rename_friend_group = '친구 그룹 이름 변경'; +$lang->cmd_delete_friend_group = '친구 그룹 삭제'; +$lang->msg_already_friend = '이미 친구로 등록되어 있습니다.'; $lang->msg_no_message = '쪽지가 없습니다.'; $lang->msg_cannot_send_to_yourself = '자기 자신에게 쪽지를 보낼 수 없습니다.'; $lang->message_received = '쪽지가 왔습니다.'; @@ -32,6 +34,8 @@ $lang->msg_disallow_message = '쪽지 수신을 거부한 사용자라서 쪽지 $lang->about_allow_message = '쪽지 수신 여부를 결정할 수 있습니다.'; $lang->message_notice = '저작자에게 쪽지를 발송해서 이 사실을 알립니다. 작성하지 않으면 발송하지 않습니다.'; $lang->friends_page_does_not_support = '모바일 환경에서는 친구 보기 페이지를 지원하지 않습니다. PC 화면으로 이동하세요.'; -$lang->cmd_write_communication = '작성 권한'; +$lang->communication_send_message_grant = '쪽지 발송 권한'; $lang->cmd_manage_base = '기본 정보'; $lang->alert_new_message_arrived = '%d개의 새로운 메시지가 도착하였습니다. 확인하시겠습니까?'; +$lang->enable_communication_friend = '친구기능 사용'; +$lang->enable_communication_message = '쪽지기능 사용'; diff --git a/modules/communication/skins/default/common_header.html b/modules/communication/skins/default/common_header.html index 5113f50d2..8e504c290 100644 --- a/modules/communication/skins/default/common_header.html +++ b/modules/communication/skins/default/common_header.html @@ -3,6 +3,6 @@
diff --git a/modules/communication/skins/default/friends.html b/modules/communication/skins/default/friends.html index ffaba4538..bd2bdbf2c 100644 --- a/modules/communication/skins/default/friends.html +++ b/modules/communication/skins/default/friends.html @@ -20,12 +20,12 @@ - - - + + {$lang->cmd_add_friend_group}
@@ -42,7 +42,7 @@ - {$val->group_title?$val->group_title:" "} + {$val->group_title?$val->group_title:$lang->default_friend_group} {$val->nick_name} {zdate($val->regdate,"Y-m-d")} @@ -50,11 +50,11 @@
- - +
diff --git a/modules/communication/skins/default/send_message.html b/modules/communication/skins/default/send_message.html index 461d05f4c..c77307eec 100644 --- a/modules/communication/skins/default/send_message.html +++ b/modules/communication/skins/default/send_message.html @@ -8,7 +8,7 @@
- + diff --git a/modules/communication/tpl/index.html b/modules/communication/tpl/index.html index da496c9b0..4f3909820 100644 --- a/modules/communication/tpl/index.html +++ b/modules/communication/tpl/index.html @@ -20,18 +20,37 @@ +
+
{$lang->enable_communication_message}
+
+ + +
+
+
+
{$lang->enable_communication_friend}
+
+ + +
+
- +
@@ -40,7 +59,7 @@
@@ -48,7 +67,7 @@
@@ -63,7 +82,7 @@
@@ -71,7 +90,7 @@
@@ -81,39 +100,41 @@
-
- +
- + + + + -
-
- -
- -
-
diff --git a/modules/communication/tpl/js/member_communication.js b/modules/communication/tpl/js/member_communication.js index 78f6501e2..661a431ab 100644 --- a/modules/communication/tpl/js/member_communication.js +++ b/modules/communication/tpl/js/member_communication.js @@ -1,26 +1,28 @@ (function($){ + var $bar; window.xeNotifyMessage = function(text, count){ - var $bar; $bar = $('div.message.info'); if(!$bar.length) { - $bar = $('
') - .hide() - .css({ - 'position' : 'absolute', - 'z-index' : '100', - }) - .prependTo(document.body); + $bar = jQuery('
').hide().css({ + 'position' : 'absolute', + 'opacity' : 0.7, + 'z-index' : 10000, + }).appendTo(document.body); } + text = text.replace('%d', count); - var cur_module = current_url.getQuery('module'); - if( cur_module == "admin" ) - h = $bar.html('

'+text+'

').height(); - else - h = $bar.html('

'+text+'

').height(); + var link = jQuery(''); + link.attr("href", current_url.setQuery('module','').setQuery('act','dispCommunicationMessages')); + //link.attr("onclick", "popopen(this.href, 'popup');xeNotifyMessageClose(); return false;"); + link.text(text); + var para = jQuery('

'); + para.append(link).appendTo($bar); $bar.show().animate({top:0}); - // hide after 10 seconds + }; + + window.xeNotifyMessageClose = function(){ setTimeout(function(){ $bar.slideUp(); - }, 5000); + }, 2000); }; })(jQuery); diff --git a/modules/counter/tpl/index.html b/modules/counter/tpl/index.html index 04884cbc7..e8c58f4b7 100644 --- a/modules/counter/tpl/index.html +++ b/modules/counter/tpl/index.html @@ -47,7 +47,7 @@ } }; - $.extend(option,$.datepicker.regional['{$lang_type}']); + $.extend($.datepicker.regional['{$lang_type}'],option); $(".inputDate").datepicker(option); }); })(jQuery); diff --git a/modules/document/document.admin.controller.php b/modules/document/document.admin.controller.php index 8e6de0410..9ccb1c869 100644 --- a/modules/document/document.admin.controller.php +++ b/modules/document/document.admin.controller.php @@ -41,7 +41,7 @@ class documentAdminController extends document $oDocumentController->deleteDocument($document_srl, true); } - $this->setMessage(sprintf(Context::getLang('msg_checked_document_is_deleted'), $document_count) ); + $this->setMessage(sprintf(lang('msg_checked_document_is_deleted'), $document_count) ); } /** @@ -145,11 +145,20 @@ class documentAdminController extends document $obj->module_srl = $module_srl; $obj->category_srl = $category_srl; $output = executeQuery('document.updateDocumentModule', $obj); - if(!$output->toBool()) { + if(!$output->toBool()) + { $oDB->rollback(); return $output; } - + else + { + $update_output = $oDocumentController->insertDocumentUpdateLog($obj); + if(!$update_output->toBool()) + { + $oDB->rollback(); + return $update_output; + } + } //Move a module of the extra vars $output = executeQuery('document.moveDocumentExtraVars', $obj); if(!$output->toBool()) { diff --git a/modules/document/document.admin.view.php b/modules/document/document.admin.view.php index 4efa55613..5e322fc38 100644 --- a/modules/document/document.admin.view.php +++ b/modules/document/document.admin.view.php @@ -68,7 +68,7 @@ class documentAdminView extends document $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]); + $search_option[$this->search_option[$i]] = lang($this->search_option[$i]); } Context::set('search_option', $search_option); diff --git a/modules/document/document.class.php b/modules/document/document.class.php index 17d9d0530..3eef195d0 100644 --- a/modules/document/document.class.php +++ b/modules/document/document.class.php @@ -127,6 +127,9 @@ class document extends ModuleObject // 2016. 1. 27: Add a column(declare_message) for report if(!$oDB->isColumnExists("document_declared_log","declare_message")) return true; + // 2016. 3. 14 Add a column(document_upate_log) for admin + if(!$oDB->isColumnExists('document_update_log', 'is_admin')) return true; + return false; } @@ -328,6 +331,13 @@ class document extends ModuleObject $oDB->addColumn('document_declared_log',"declare_message","text"); } + // 2016. 3. 14 Add a column(document_update_log) for admin + if(!$oDB->isColumnExists('document_update_log', 'is_admin')) + { + $oDB->addColumn('document_update_log', 'is_admin', 'varchar', 1); + $oDB->addIndex('document_update_log', 'idx_is_admin', array('is_admin')); + } + return new Object(0,'success_updated'); } diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 569cbc022..4f109ba0c 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -205,7 +205,7 @@ class documentController extends document // if an user select message from options, message would be the option. $message_option = strval(Context::get('message_option')); - $improper_document_reasons = Context::getLang('improper_document_reasons'); + $improper_document_reasons = lang('improper_document_reasons'); $declare_message = ($message_option !== 'others' && isset($improper_document_reasons[$message_option]))? $improper_document_reasons[$message_option] : trim(Context::get('declare_message')); @@ -439,6 +439,7 @@ class documentController extends document return $output; } // Insert extra variables if the document successfully inserted. + $extra_vars = array(); $extra_keys = $oDocumentModel->getExtraKeys($obj->module_srl); if(count($extra_keys)) { @@ -449,13 +450,20 @@ class documentController extends document { $tmp = $obj->{'extra_vars'.$idx}; if(is_array($tmp)) + { $value = implode('|@|', $tmp); + } else + { $value = trim($tmp); + } + } + else if(isset($obj->{$extra_item->name})) + { + $value = trim($obj->{$extra_item->name}); } - else if(isset($obj->{$extra_item->name})) $value = trim($obj->{$extra_item->name}); if($value == NULL) continue; - + $extra_vars[$extra_item->name] = $value; $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, $idx, $value, $extra_item->eid); } } @@ -464,6 +472,17 @@ class documentController extends document // Call a trigger (after) if($output->toBool()) { + if($obj->update_log_setting === 'Y') + { + $obj->extra_vars = serialize($extra_vars); + $update_output = $this->insertDocumentUpdateLog($obj); + + if(!$update_output->toBool()) + { + $oDB->rollback(); + return $update_output; + } + } $trigger_output = ModuleHandler::triggerCall('document.insertDocument', 'after', $obj); if(!$trigger_output->toBool()) { @@ -517,6 +536,8 @@ class documentController extends document $oModuleModel = getModel('module'); if(!$obj->module_srl) $obj->module_srl = $source_obj->get('module_srl'); $module_srl = $obj->module_srl; + $module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl); + $document_config = $oModuleModel->getModulePartConfig('document', $module_srl); if(!$document_config) { @@ -587,10 +608,11 @@ class documentController extends document { $obj->password = getModel('member')->hashPassword($obj->password); } + // If an author is identical to the modifier or history is used, use the logged-in user's information. - if(Context::get('is_logged')) + $logged_info = Context::get('logged_info'); + if(Context::get('is_logged') && !$manual_updated && $module_info->use_anonymous != 'Y') { - $logged_info = Context::get('logged_info'); if($source_obj->get('member_srl')==$logged_info->member_srl) { $obj->member_srl = $logged_info->member_srl; @@ -600,6 +622,7 @@ class documentController extends document $obj->homepage = $logged_info->homepage; } } + // For the document written by logged-in user however no nick_name exists if($source_obj->get('member_srl')&& !$obj->nick_name) { @@ -647,6 +670,7 @@ class documentController extends document // Change not extra vars but language code of the original document if document's lang_code doesn't exist. if(!$source_obj->get('lang_code')) { + $lang_code_args = new stdClass(); $lang_code_args->document_srl = $source_obj->get('document_srl'); $lang_code_args->lang_code = Context::getLangType(); $output = executeQuery('document.updateDocumentsLangCode', $lang_code_args); @@ -683,7 +707,9 @@ class documentController extends document $oDB->rollback(); return $output; } + // Remove all extra variables + $extra_vars = array(); if(Context::get('act')!='procFileDelete') { $this->deleteDocumentExtraVars($source_obj->get('module_srl'), $obj->document_srl, null, Context::getLangType()); @@ -704,6 +730,7 @@ class documentController extends document } else if(isset($obj->{$extra_item->name})) $value = trim($obj->{$extra_item->name}); if($value == NULL) continue; + $extra_vars[$extra_item->name] = $value; $this->insertDocumentExtraVar($obj->module_srl, $obj->document_srl, $idx, $value, $extra_item->eid); } } @@ -720,6 +747,20 @@ class documentController extends document // Call a trigger (after) if($output->toBool()) { + if($obj->update_log_setting === 'Y') + { + $obj->extra_vars = serialize($extra_vars); + if($this->grant->manager) + { + $obj->is_admin = 'Y'; + } + $update_output = $this->insertDocumentUpdateLog($obj, $source_obj); + if(!$update_output->toBool()) + { + $oDB->rollback(); + return $update_output; + } + } $trigger_output = ModuleHandler::triggerCall('document.updateDocument', 'after', $obj); if(!$trigger_output->toBool()) { @@ -746,6 +787,46 @@ class documentController extends document return $output; } + function insertDocumentUpdateLog($obj, $source_obj = null) + { + $update_args = new stdClass(); + $logged_info = Context::get('logged_info'); + if($source_obj === null) + { + $update_args->category_srl = $obj->category_srl; + $update_args->module_srl = $obj->module_srl; + $update_args->nick_name = $obj->nick_name; + } + else + { + if($obj->category_srl) + { + $update_args->category_srl = $obj->category_srl; + } + else + { + $update_args->category_srl = $source_obj->get('category_srl'); + } + $update_args->module_srl = $source_obj->get('module_srl'); + $update_args->nick_name = $source_obj->get('nick_name'); + } + + $update_args->document_srl = $obj->document_srl; + $update_args->update_member_srl = $logged_info->member_srl; + $update_args->title = $obj->title; + $update_args->title_bold = $obj->title_bold; + $update_args->title_color = $obj->title_color; + $update_args->content = $obj->content; + $update_args->update_nick_name = $logged_info->nick_name; + $update_args->tags = $obj->tags; + $update_args->extra_vars = $obj->extra_vars; + $update_args->reason_update = $obj->reason_update; + $update_args->is_admin = $obj->is_admin; + $update_output = executeQuery('document.insertDocumentUpdateLog', $update_args); + + return $update_output; + } + /** * Deleting Documents * @param int $document_srl @@ -829,6 +910,7 @@ class documentController extends document $this->_deleteDeclaredDocuments($args); $this->_deleteDocumentReadedLog($args); $this->_deleteDocumentVotedLog($args); + $this->_deleteDocumentUpdateLog($args); // Remove the thumbnail file FileHandler::removeDir(sprintf('files/thumbnails/%s',getNumberingPath($document_srl, 3))); @@ -878,6 +960,11 @@ class documentController extends document executeQuery('document.deleteDocumentVotedLog', $documentSrls); } + function _deleteDocumentUpdateLog($document_srl) + { + executeQuery('document.deleteDocumentUpdateLog', $document_srl); + } + /** * Move the doc into the trash * @param object $obj @@ -1011,7 +1098,11 @@ class documentController extends document function updateReadedCount(&$oDocument) { // Pass if Crawler access - if(isCrawler()) return false; + if (\Rhymix\Framework\UA::isRobot()) + { + return false; + } + $oDocumentModel = getModel('document'); $config = $oDocumentModel->getDocumentConfig(); @@ -1735,9 +1826,9 @@ class documentController extends document $prev_category = $val; } // Return if the previous category doesn't exist - if(!$prev_category) return new Object(-1,Context::getLang('msg_category_not_moved')); + if(!$prev_category) return new Object(-1,lang('msg_category_not_moved')); // Return if the selected category is the top level - if($category_srl_list[0]==$category_srl) return new Object(-1,Context::getLang('msg_category_not_moved')); + if($category_srl_list[0]==$category_srl) return new Object(-1,lang('msg_category_not_moved')); // Information of the selected category $cur_args = new stdClass; $cur_args->category_srl = $category_srl; @@ -1781,7 +1872,7 @@ class documentController extends document } $next_category_srl = $category_srl_list[$i+1]; - if(!$category_list[$next_category_srl]) return new Object(-1,Context::getLang('msg_category_not_moved')); + if(!$category_list[$next_category_srl]) return new Object(-1,lang('msg_category_not_moved')); $next_category = $category_list[$next_category_srl]; // Information of the selected category $cur_args = new stdClass; @@ -2450,10 +2541,10 @@ class documentController extends document { $logged_info = Context::get('logged_info'); $message_content = ''; - $default_message_verbs = Context::getLang('default_message_verbs'); + $default_message_verbs = lang('default_message_verbs'); if(isset($default_message_verbs[$type]) && is_string($default_message_verbs[$type])) { - $message_content = sprintf(Context::getLang('default_message_format'), $logged_info->nick_name, $default_message_verbs[$type]); + $message_content = sprintf(lang('default_message_format'), $logged_info->nick_name, $default_message_verbs[$type]); } } else diff --git a/modules/document/document.item.php b/modules/document/document.item.php index abb9e9614..3990506bd 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -411,7 +411,7 @@ class documentItem extends Object { if(!$this->document_srl) return; - if($this->isSecret() && !$this->isGranted() && !$this->isAccessible()) return Context::getLang('msg_is_secret'); + if($this->isSecret() && !$this->isGranted() && !$this->isAccessible()) return lang('msg_is_secret'); $result = $this->_checkAccessibleFromStatus(); if($result && Context::getSessionStatus()) @@ -475,7 +475,7 @@ class documentItem extends Object { if(!$this->document_srl) return; - if($this->isSecret() && !$this->isGranted() && !$this->isAccessible()) return Context::getLang('msg_is_secret'); + if($this->isSecret() && !$this->isGranted() && !$this->isAccessible()) return lang('msg_is_secret'); $result = $this->_checkAccessibleFromStatus(); if($result && Context::getSessionStatus()) @@ -498,7 +498,7 @@ class documentItem extends Object $content = sprintf( '%s', $content, - $this->document_srl, Context::getLang('cmd_document_do') + $this->document_srl, lang('cmd_document_do') ); } // If additional content information is set diff --git a/modules/document/document.model.php b/modules/document/document.model.php index 2420eebb0..16e345d59 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -528,7 +528,7 @@ class documentModel extends document ModuleHandler::triggerCall('document.getDocumentMenu', 'after', $menu_list); if($this->grant->manager) { - $str_confirm = Context::getLang('confirm_move'); + $str_confirm = lang('confirm_move'); $url = sprintf("if(!confirm('%s')) return; var params = new Array(); params['document_srl']='%s'; params['mid']=current_mid;params['cur_url']=current_url; exec_xml('document', 'procDocumentAdminMoveToTrash', params)", $str_confirm, $document_srl); $oDocumentController->addDocumentPopupMenu($url,'cmd_trash','','javascript'); } @@ -554,7 +554,7 @@ class documentModel extends document $menus_count = count($menus); for($i=0;$i<$menus_count;$i++) { - $menus[$i]->str = Context::getLang($menus[$i]->str); + $menus[$i]->str = lang($menus[$i]->str); } // Wanted to finally clean pop-up menu list $this->add('menus', $menus); @@ -1548,6 +1548,44 @@ class documentModel extends document return $document_list; } + + function getDocumentUpdateLog($document_srl) + { + $args = new stdClass(); + $args->document_srl = $document_srl; + $output = executeQueryArray('document.getDocumentUpdateLog', $args); + + return $output; + } + + function getUpdateLog($update_id) + { + $args = new stdClass(); + $args->update_id = $update_id; + $output = exeCuteQuery('document.getUpdateLog', $args); + $updage_log = $output->data; + + return $updage_log; + } + + function getUpdateLogAdminisExists($document_srl = null) + { + if($document_srl == null) + { + return; + } + $args = new stdClass(); + $args->document_srl = $document_srl; + $args->is_admin = 'Y'; + $output = executeQuery('document.getUpdateLogAdminisExists', $args); + + if($output->data->count > 0) + { + return true; + } + + return false; + } } /* End of file document.model.php */ /* Location: ./modules/document/document.model.php */ diff --git a/modules/document/lang/es.php b/modules/document/lang/es.php index 42ed4364a..d69d8bf4d 100644 --- a/modules/document/lang/es.php +++ b/modules/document/lang/es.php @@ -1,6 +1,5 @@ document_list = 'Document list'; -$lang->new_document_count = '새글'; $lang->parent_category_title = 'Categoría Superior'; $lang->category_title = 'Nombre de la categoría'; $lang->expand = 'Expandir'; @@ -9,8 +8,6 @@ $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'; @@ -40,5 +37,4 @@ $lang->search_target_list['uploaded_count'] = 'Número de archivos adjuntos (sob $lang->search_target_list['regdate'] = 'Día del registro'; $lang->search_target_list['last_update'] = 'Día de la última actualización'; $lang->search_target_list['ipaddress'] = 'Dirección IP'; -$lang->about_use_history = '히스토리 기능의 사용여부를 지정합니다. 히스토리 기능을 사용할 경우 문서 수정시 이전 리비전을 기록하고 복원할 수 있습니다.'; $lang->trash_nick_name = 'Person who deleted'; diff --git a/modules/document/lang/fr.php b/modules/document/lang/fr.php index ff4ced221..2fa9e8831 100644 --- a/modules/document/lang/fr.php +++ b/modules/document/lang/fr.php @@ -6,7 +6,6 @@ $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->expand = 'Etendre'; @@ -44,5 +43,4 @@ $lang->search_target_list['uploaded_count'] = 'Fichiers Attachés (surplus)'; $lang->search_target_list['regdate'] = 'Enrégistré'; $lang->search_target_list['last_update'] = 'La Dernière Mise à Jour'; $lang->search_target_list['ipaddress'] = 'Adresse IP'; -$lang->about_use_history = '히스토리 기능의 사용여부를 지정합니다. 히스토리 기능을 사용할 경우 문서 수정시 이전 리비전을 기록하고 복원할 수 있습니다.'; $lang->trash_nick_name = 'Person who deleted'; diff --git a/modules/document/lang/ru.php b/modules/document/lang/ru.php index 22d0bc01d..6421d2f0e 100644 --- a/modules/document/lang/ru.php +++ b/modules/document/lang/ru.php @@ -16,7 +16,6 @@ $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 = 'Перевернуть выбранные объекты'; diff --git a/modules/document/queries/deleteDocumentUpdateLog.xml b/modules/document/queries/deleteDocumentUpdateLog.xml new file mode 100644 index 000000000..6f0ee246c --- /dev/null +++ b/modules/document/queries/deleteDocumentUpdateLog.xml @@ -0,0 +1,8 @@ + + +
+ + + + + diff --git a/modules/document/queries/getDocumentUpdateLog.xml b/modules/document/queries/getDocumentUpdateLog.xml new file mode 100644 index 000000000..db61979cb --- /dev/null +++ b/modules/document/queries/getDocumentUpdateLog.xml @@ -0,0 +1,23 @@ + + +
+ + + + + + + + + + + + + + + + + + + + diff --git a/modules/document/queries/getUpdateLog.xml b/modules/document/queries/getUpdateLog.xml new file mode 100644 index 000000000..daae71601 --- /dev/null +++ b/modules/document/queries/getUpdateLog.xml @@ -0,0 +1,11 @@ + + +
+ + + + + + + + diff --git a/modules/document/queries/getUpdateLogAdminisExists.xml b/modules/document/queries/getUpdateLogAdminisExists.xml new file mode 100644 index 000000000..5c494fc5d --- /dev/null +++ b/modules/document/queries/getUpdateLogAdminisExists.xml @@ -0,0 +1,12 @@ + + +
+ + + + + + + + + diff --git a/modules/document/queries/insertDocumentUpdateLog.xml b/modules/document/queries/insertDocumentUpdateLog.xml new file mode 100644 index 000000000..e92360a85 --- /dev/null +++ b/modules/document/queries/insertDocumentUpdateLog.xml @@ -0,0 +1,23 @@ + + +
+ + + + + + + + + + + + + + + + + + + + diff --git a/modules/document/schemas/document_update_log.xml b/modules/document/schemas/document_update_log.xml new file mode 100644 index 000000000..fee66b4bd --- /dev/null +++ b/modules/document/schemas/document_update_log.xml @@ -0,0 +1,19 @@ +
+ + + + + + + + + + + + + + + + + +
diff --git a/modules/document/tpl/category_list.html b/modules/document/tpl/category_list.html index e9f03e0ad..664266301 100644 --- a/modules/document/tpl/category_list.html +++ b/modules/document/tpl/category_list.html @@ -61,7 +61,7 @@
- + {$lang->help}
@@ -77,7 +77,6 @@
- {$lang->about_category_group_srls}
diff --git a/modules/editor/components/image_gallery/tpl/popup.html b/modules/editor/components/image_gallery/tpl/popup.html index d8cd62292..3e0b93d5a 100644 --- a/modules/editor/components/image_gallery/tpl/popup.html +++ b/modules/editor/components/image_gallery/tpl/popup.html @@ -40,13 +40,13 @@
- +
- +
diff --git a/modules/editor/editor.controller.php b/modules/editor/editor.controller.php index b4782b307..b1a97de71 100644 --- a/modules/editor/editor.controller.php +++ b/modules/editor/editor.controller.php @@ -47,13 +47,13 @@ class editorController extends editor { $component = Context::get('component'); $method = Context::get('method'); - if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + if(!$component) return new Object(-1, sprintf(lang('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)); + if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(lang('msg_component_is_not_founded'), $component)); //$output = call_user_method($method, $oComponent); //$output = call_user_func(array($oComponent, $method)); diff --git a/modules/editor/editor.model.php b/modules/editor/editor.model.php index 2dcbe26fd..5a95186b5 100644 --- a/modules/editor/editor.model.php +++ b/modules/editor/editor.model.php @@ -547,11 +547,11 @@ class editorModel extends editor // Create an object of the component and execute $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)); + if(!file_exists($class_file)) return new Object(-1, sprintf(lang('msg_component_is_not_founded'), $component)); // Create an object after loading the class file require_once($class_file); $oComponent = new $component($editor_sequence, $class_path); - if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + if(!$oComponent) return new Object(-1, sprintf(lang('msg_component_is_not_founded'), $component)); // Add configuration information $component_info = $this->getComponent($component, $site_srl); $oComponent->setInfo($component_info); diff --git a/modules/editor/editor.view.php b/modules/editor/editor.view.php index cbe3edacf..d0dd2777b 100644 --- a/modules/editor/editor.view.php +++ b/modules/editor/editor.view.php @@ -33,7 +33,7 @@ class editorView extends editor $oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence, $site_srl); if(!$oComponent->toBool()) { - Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component)); + Context::set('message', sprintf(lang('msg_component_is_not_founded'), $component)); $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('component_not_founded'); } diff --git a/modules/editor/lang/en.php b/modules/editor/lang/en.php index 75e711140..cbdbe5a99 100644 --- a/modules/editor/lang/en.php +++ b/modules/editor/lang/en.php @@ -1,5 +1,4 @@ editor_now = '현재 설정 상태'; $lang->editor_component = 'Editor Component'; $lang->main_editor = 'Main editor'; $lang->comment_editor = 'Comment editor'; diff --git a/modules/editor/lang/es.php b/modules/editor/lang/es.php index 12d6c149d..02e2166a3 100644 --- a/modules/editor/lang/es.php +++ b/modules/editor/lang/es.php @@ -10,7 +10,6 @@ $lang->component_description = 'Descripción'; $lang->component_extra_vars = 'Varibles Extras'; $lang->component_grant = 'Ajuste de las atribuciones'; $lang->about_component = 'Presentación del componente'; -$lang->about_component_mid = '에디터 컴포넌트가 사용될 대상을 지정할 수 있습니다.(모두 해제시 모든 대상에서 사용 가능합니다)'; $lang->msg_component_is_not_founded = 'No se puede encontrar el componente del editor %s'; $lang->msg_component_is_inserted = 'El componente seleccionado ya esta insertado'; $lang->msg_component_is_first_order = 'El componente seleccionado se localiza en la primera posición'; @@ -28,8 +27,6 @@ $lang->enable_html_grant = 'La autorización de uso de HTML'; $lang->enable_autosave = 'Utilice función de guardado automático,'; $lang->height_resizable = 'Altura cambiar de tamaño'; $lang->editor_height = 'Altura de Editor'; -$lang->about_content_font = '콤마(,)로 여러 폰트를 지정할 수 있습니다.'; -$lang->about_content_font_size = '12px, 1em등 단위까지 포함해서 입력해주세요.'; $lang->about_enable_autosave = 'Usted puede permitir que la función de guardado automático, en tanto que función de la redacción de artículos'; $lang->edit['fontname'] = 'Fuente'; $lang->edit['fontsize'] = 'Tamaño'; @@ -68,17 +65,4 @@ $lang->edit['icon_align_left'] = 'Margen izquierdo'; $lang->edit['icon_align_middle'] = 'Margen central'; $lang->edit['icon_align_right'] = 'Margen derecho'; $lang->edit['lineheight'] = 'Line Height'; -$lang->edit['target_blank'] = '새창으로'; -$lang->edit['add_one_row'] = '1행추가'; -$lang->edit['del_one_row'] = '1행삭제'; -$lang->edit['add_one_col'] = '1열추가'; -$lang->edit['del_one_col'] = '1열삭제'; -$lang->edit['search_color'] = '색상찾기'; -$lang->edit['circle_bracket'] = '원,괄호'; -$lang->edit['replace_all'] = '모두바꾸기'; -$lang->edit['search_words'] = '찾을단어'; -$lang->edit['replace_words'] = '바꿀단어'; -$lang->edit['next_search_words'] = '다음찾기'; -$lang->edit['materials'] = '글감보관함'; -$lang->edit['temporary_savings'] = '임시저장목록'; $lang->about_dblclick_in_editor = 'Para la configuracion más detallada debera hacer dobleclick sobre el texto, imagen, fondo, etc.'; diff --git a/modules/editor/lang/fr.php b/modules/editor/lang/fr.php index 987139e9f..59f26ea7f 100644 --- a/modules/editor/lang/fr.php +++ b/modules/editor/lang/fr.php @@ -27,8 +27,6 @@ $lang->enable_html_grant = 'Permission d\'utiliser HTML'; $lang->enable_autosave = 'Valider à conserver automatiquement'; $lang->height_resizable = 'Permettre de remettre l\'hauteur'; $lang->editor_height = 'Hauteur de l\'Editeur'; -$lang->about_content_font = '콤마(,)로 여러 폰트를 지정할 수 있습니다.'; -$lang->about_content_font_size = '12px, 1em등 단위까지 포함해서 입력해주세요.'; $lang->about_enable_autosave = 'Vous pouvez valider la fonction à Conserver Automatiquement pendant écrire des articles.'; $lang->edit['fontname'] = 'Police de caractères'; $lang->edit['fontsize'] = 'Mesure'; @@ -69,17 +67,4 @@ $lang->edit['icon_align_left'] = 'Placer à gauche du texte'; $lang->edit['icon_align_middle'] = 'Placer au centre'; $lang->edit['icon_align_right'] = 'Placer à droite du texte'; $lang->edit['lineheight'] = 'Line Height'; -$lang->edit['target_blank'] = '새창으로'; -$lang->edit['add_one_row'] = '1행추가'; -$lang->edit['del_one_row'] = '1행삭제'; -$lang->edit['add_one_col'] = '1열추가'; -$lang->edit['del_one_col'] = '1열삭제'; -$lang->edit['search_color'] = '색상찾기'; -$lang->edit['circle_bracket'] = '원,괄호'; -$lang->edit['replace_all'] = '모두바꾸기'; -$lang->edit['search_words'] = '찾을단어'; -$lang->edit['replace_words'] = '바꿀단어'; -$lang->edit['next_search_words'] = '다음찾기'; -$lang->edit['materials'] = '글감보관함'; -$lang->edit['temporary_savings'] = '임시저장목록'; $lang->about_dblclick_in_editor = 'Vous pouvez configurer en détail des composants par double-clic sur un arrière-plan, un texte, une image ou une citation'; diff --git a/modules/editor/lang/ru.php b/modules/editor/lang/ru.php index 28dd7e72e..43a17ecc1 100644 --- a/modules/editor/lang/ru.php +++ b/modules/editor/lang/ru.php @@ -1,16 +1,4 @@ editor_now = '현재 설정 상태'; -$lang->editor_component = 'Editor Component'; -$lang->main_editor = 'Main editor'; -$lang->comment_editor = 'Comment editor'; -$lang->editor_option = 'Editor Option'; -$lang->guide_choose_main_editor = 'Main editor.'; -$lang->guide_set_height_main_editor = 'Height of the main editor.'; -$lang->guide_choose_comment_editor = 'Comment editor.'; -$lang->guide_set_height_comment_editor = 'Height of the comment editor.'; -$lang->guide_choose_text_formatting = 'Text formatting.'; -$lang->guide_choose_font_body = 'Font body.'; -$lang->guide_choose_font_size_body = 'Font size body.'; $lang->editor = 'WYSIWYG-Редактор'; $lang->component_name = 'Компонент'; $lang->component_version = 'Версия'; diff --git a/modules/editor/lang/tr.php b/modules/editor/lang/tr.php index 12e1eadaf..9cafab0fd 100644 --- a/modules/editor/lang/tr.php +++ b/modules/editor/lang/tr.php @@ -1,16 +1,4 @@ editor_now = '현재 설정 상태'; -$lang->editor_component = 'Editor Component'; -$lang->main_editor = 'Main editor'; -$lang->comment_editor = 'Comment editor'; -$lang->editor_option = 'Editor Option'; -$lang->guide_choose_main_editor = 'Main editor.'; -$lang->guide_set_height_main_editor = 'Height of the main editor.'; -$lang->guide_choose_comment_editor = 'Comment editor.'; -$lang->guide_set_height_comment_editor = 'Height of the comment editor.'; -$lang->guide_choose_text_formatting = 'Text formatting.'; -$lang->guide_choose_font_body = 'Font body.'; -$lang->guide_choose_font_size_body = 'Font size body.'; $lang->component_name = 'Bileşen'; $lang->component_version = 'Sürüm'; $lang->component_author = 'Geliştirici'; diff --git a/modules/editor/lang/vi.php b/modules/editor/lang/vi.php index 7b3c69df8..468c08e81 100644 --- a/modules/editor/lang/vi.php +++ b/modules/editor/lang/vi.php @@ -1,16 +1,4 @@ editor_now = '현재 설정 상태'; -$lang->editor_component = 'Editor Component'; -$lang->main_editor = 'Main editor'; -$lang->comment_editor = 'Comment editor'; -$lang->editor_option = 'Editor Option'; -$lang->guide_choose_main_editor = 'Main editor.'; -$lang->guide_set_height_main_editor = 'Height of the main editor.'; -$lang->guide_choose_comment_editor = 'Comment editor.'; -$lang->guide_set_height_comment_editor = 'Height of the comment editor.'; -$lang->guide_choose_text_formatting = 'Text formatting.'; -$lang->guide_choose_font_body = 'Font body.'; -$lang->guide_choose_font_size_body = 'Font size body.'; $lang->editor = 'WYSIWYG toàn diện'; $lang->component_name = 'Thành phần'; $lang->component_version = 'Phiên bản'; diff --git a/modules/editor/lang/zh-CN.php b/modules/editor/lang/zh-CN.php index 4ff949d03..b8b9d5393 100644 --- a/modules/editor/lang/zh-CN.php +++ b/modules/editor/lang/zh-CN.php @@ -1,16 +1,4 @@ editor_now = '현재 설정 상태'; -$lang->editor_component = 'Editor Component'; -$lang->main_editor = 'Main editor'; -$lang->comment_editor = 'Comment editor'; -$lang->editor_option = 'Editor Option'; -$lang->guide_choose_main_editor = 'Main editor.'; -$lang->guide_set_height_main_editor = 'Height of the main editor.'; -$lang->guide_choose_comment_editor = 'Comment editor.'; -$lang->guide_set_height_comment_editor = 'Height of the comment editor.'; -$lang->guide_choose_text_formatting = 'Text formatting.'; -$lang->guide_choose_font_body = 'Font body.'; -$lang->guide_choose_font_size_body = 'Font size body.'; $lang->editor = '网页编辑器'; $lang->component_name = '组件'; $lang->component_version = '版本'; diff --git a/modules/editor/lang/zh-TW.php b/modules/editor/lang/zh-TW.php index d9db8a058..f4f3f03a8 100644 --- a/modules/editor/lang/zh-TW.php +++ b/modules/editor/lang/zh-TW.php @@ -1,16 +1,4 @@ editor_now = '현재 설정 상태'; -$lang->editor_component = 'Editor Component'; -$lang->main_editor = 'Main editor'; -$lang->comment_editor = 'Comment editor'; -$lang->editor_option = 'Editor Option'; -$lang->guide_choose_main_editor = 'Main editor.'; -$lang->guide_set_height_main_editor = 'Height of the main editor.'; -$lang->guide_choose_comment_editor = 'Comment editor.'; -$lang->guide_set_height_comment_editor = 'Height of the comment editor.'; -$lang->guide_choose_text_formatting = 'Text formatting.'; -$lang->guide_choose_font_body = 'Font body.'; -$lang->guide_choose_font_size_body = 'Font size body.'; $lang->editor = '網頁編輯器'; $lang->component_name = '組件'; $lang->component_version = '版本'; diff --git a/modules/editor/skins/ckeditor/js/xe_interface.js b/modules/editor/skins/ckeditor/js/xe_interface.js index 454e3d055..2639e7ee4 100755 --- a/modules/editor/skins/ckeditor/js/xe_interface.js +++ b/modules/editor/skins/ckeditor/js/xe_interface.js @@ -19,8 +19,6 @@ function editorGetContent(editor_sequence) { //Replace html content to editor function editorReplaceHTML(iframe_obj, content) { - content = editorReplacePath(content); - var editor_sequence = parseInt(iframe_obj.id.replace(/^.*_/, ''), 10); _getCkeInstance(editor_sequence).insertHtml(content, "unfiltered_html"); @@ -29,16 +27,3 @@ function editorReplaceHTML(iframe_obj, content) { function editorGetIFrame(editor_sequence) { return jQuery('#ckeditor_instance_' + editor_sequence).get(0); } - - -function editorReplacePath(content) { - // 태그 내 src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = content.replace(/\<([^\>\<]*)(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/ig, function(m0,m1,m2,m3,m4,m5,m6) { - if(m2=="url(") { m3=''; m5=')'; } else { if(typeof(m3)=='undefined') m3 = '"'; if(typeof(m5)=='undefined') m5 = '"'; if(typeof(m6)=='undefined') m6 = ''; } - var val = jQuery.trim(m4).replace(/^\.\//,''); - if(/^(http\:|https\:|ftp\:|telnet\:|mms\:|mailto\:|\/|\.\.|\#)/i.test(val)) return m0; - return '<'+m1+m2+m3+request_uri+val+m5+m6; - }); - - return content; -} diff --git a/modules/editor/skins/ckeditor/lang/en.php b/modules/editor/skins/ckeditor/lang/en.php new file mode 100644 index 000000000..11786b678 --- /dev/null +++ b/modules/editor/skins/ckeditor/lang/en.php @@ -0,0 +1,4 @@ +ckeditor_about_file_drop_area = 'Drag and drop your files here, or Click attach files button.'; +$lang->ckeditor_file_uploading = 'Uploading...'; +$lang->ckeditor_file_count = '0 file(s) attached'; diff --git a/modules/editor/skins/ckeditor/lang/ko.php b/modules/editor/skins/ckeditor/lang/ko.php new file mode 100644 index 000000000..0f9b6c0f1 --- /dev/null +++ b/modules/editor/skins/ckeditor/lang/ko.php @@ -0,0 +1,4 @@ +ckeditor_about_file_drop_area = '여기에 파일을 끌어 놓거나 파일 첨부 버튼을 클릭하세요.'; +$lang->ckeditor_file_uploading = '파일 업로드 중...'; +$lang->ckeditor_file_count = '0개 첨부 됨'; diff --git a/modules/editor/skins/ckeditor/lang/lang.xml b/modules/editor/skins/ckeditor/lang/lang.xml deleted file mode 100644 index 429479dbd..000000000 --- a/modules/editor/skins/ckeditor/lang/lang.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - 0개 첨부 됨]]> - 0 file(s) attached]]> - 0 file(s) attached]]> - 0 file(s) attached]]> - 0 file(s) attached]]> - 0 file(s) attached]]> - 0 file(s) attached]]> - 0 file(s) attached]]> - - diff --git a/modules/editor/skins/xpresseditor/js/xe_interface.js b/modules/editor/skins/xpresseditor/js/xe_interface.js index e2b97cc0a..3d8884403 100644 --- a/modules/editor/skins/xpresseditor/js/xe_interface.js +++ b/modules/editor/skins/xpresseditor/js/xe_interface.js @@ -41,9 +41,6 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height var content = form[content_key].value; if(xFF && !content) content = '
'; - // src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = editorReplacePath(content); - form[content_key].value = content; jQuery("#xpress-editor-"+editor_sequence).val(content); @@ -203,24 +200,10 @@ function editorGetIframe(srl) { } function editorReplaceHTML(iframe_obj, content) { - // src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = editorReplacePath(content); - var srl = parseInt(iframe_obj.id.replace(/^.*_/,''),10); editorRelKeys[srl]["pasteHTML"](content); } -function editorReplacePath(content) { - // 태그 내 src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = content.replace(/\<([^\>\<]*)(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/ig, function(m0,m1,m2,m3,m4,m5,m6) { - if(m2=="url(") { m3=''; m5=')'; } else { if(typeof(m3)=='undefined') m3 = '"'; if(typeof(m5)=='undefined') m5 = '"'; if(typeof(m6)=='undefined') m6 = ''; } - var val = jQuery.trim(m4).replace(/^\.\//,''); - if(/^(http\:|https\:|ftp\:|telnet\:|mms\:|mailto\:|\/|\.\.|\#)/i.test(val)) return m0; - return '<'+m1+m2+m3+request_uri+val+m5+m6; - }); - return content; -} - function editorGetAutoSavedDoc(form) { var param = new Array(); param['mid'] = current_mid; diff --git a/modules/editor/skins/xpresseditor/js/xpresseditor.js b/modules/editor/skins/xpresseditor/js/xpresseditor.js index 5688cdcb4..e2f1d82ee 100644 --- a/modules/editor/skins/xpresseditor/js/xpresseditor.js +++ b/modules/editor/skins/xpresseditor/js/xpresseditor.js @@ -5868,9 +5868,6 @@ function editorStart_xe(editor_sequence, primary_key, content_key, editor_height var content = form[content_key].value; if(xFF && !content) content = '
'; - // src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = editorReplacePath(content); - form[content_key].value = content; jQuery("#xpress-editor-"+editor_sequence).val(content); @@ -6030,24 +6027,10 @@ function editorGetIframe(srl) { } function editorReplaceHTML(iframe_obj, content) { - // src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = editorReplacePath(content); - var srl = parseInt(iframe_obj.id.replace(/^.*_/,''),10); editorRelKeys[srl]["pasteHTML"](content); } -function editorReplacePath(content) { - // 태그 내 src, href, url의 XE 상대경로를 http로 시작하는 full path로 변경 - content = content.replace(/\<([^\>\<]*)(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/ig, function(m0,m1,m2,m3,m4,m5,m6) { - if(m2=="url(") { m3=''; m5=')'; } else { if(typeof(m3)=='undefined') m3 = '"'; if(typeof(m5)=='undefined') m5 = '"'; if(typeof(m6)=='undefined') m6 = ''; } - var val = jQuery.trim(m4).replace(/^\.\//,''); - if(/^(http\:|https\:|ftp\:|telnet\:|mms\:|mailto\:|\/|\.\.|\#)/i.test(val)) return m0; - return '<'+m1+m2+m3+request_uri+val+m5+m6; - }); - return content; -} - function editorGetAutoSavedDoc(form) { var param = new Array(); param['mid'] = current_mid; diff --git a/modules/file/file.admin.controller.php b/modules/file/file.admin.controller.php index af453c707..212800d70 100644 --- a/modules/file/file.admin.controller.php +++ b/modules/file/file.admin.controller.php @@ -78,7 +78,7 @@ class fileAdminController extends file $oFileController->deleteFile($file_srl); } - $this->setMessage( sprintf(Context::getLang('msg_checked_file_is_deleted'), $file_count) ); + $this->setMessage( sprintf(lang('msg_checked_file_is_deleted'), $file_count) ); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispFileAdminList'); $this->setRedirectUrl($returnUrl); diff --git a/modules/file/file.controller.php b/modules/file/file.controller.php index 11b876063..655b73b9b 100644 --- a/modules/file/file.controller.php +++ b/modules/file/file.controller.php @@ -45,13 +45,15 @@ class fileController extends file if(!$upload_target_srl) $_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl = getNextSequence(); $output = $this->insertFile($file_info, $module_srl, $upload_target_srl); + Context::setResponseMethod('JSON'); - $this->add('file_srl',$output->get('file_srl')); - $this->add('file_size',$output->get('file_size')); - $this->add('direct_download',$output->get('direct_download')); - $this->add('source_filename',$output->get('source_filename')); - $this->add('download_url',$output->get('uploaded_filename')); - $this->add('upload_target_srl',$output->get('upload_target_srl')); + $this->add('file_srl', $output->get('file_srl')); + $this->add('file_size', $output->get('file_size')); + $this->add('direct_download', $output->get('direct_download')); + $this->add('source_filename', $output->get('source_filename')); + $this->add('upload_target_srl', $output->get('upload_target_srl')); + $this->add('download_url', $oFileModel->getDirectFileUrl($output->get('uploaded_filename'))); + if($output->error != '0') $this->stop($output->message); } @@ -285,8 +287,7 @@ class fileController extends file // Redirect to procFileOutput using file key if(!isset($_SESSION['__XE_FILE_KEY__']) || !is_string($_SESSION['__XE_FILE_KEY__']) || strlen($_SESSION['__XE_FILE_KEY__']) != 32) { - $random = new Password(); - $_SESSION['__XE_FILE_KEY__'] = $random->createSecureSalt(32, 'hex'); + $_SESSION['__XE_FILE_KEY__'] = Rhymix\Framework\Security::getRandom(32, 'hex'); } $file_key_data = $file_obj->file_srl . $file_obj->file_size . $file_obj->uploaded_filename . $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']; $file_key = substr(hash_hmac('sha256', $file_key_data, $_SESSION['__XE_FILE_KEY__']), 0, 32); @@ -732,13 +733,8 @@ class fileController extends file } } - // https://github.com/xpressengine/xe-core/issues/1713 - $file_info['name'] = preg_replace('/\.(php|phtm|phar|html?|cgi|pl|exe|jsp|asp|inc)/i', '$0-x',$file_info['name']); - $file_info['name'] = removeHackTag($file_info['name']); - $file_info['name'] = str_replace(array('<','>'),array('%3C','%3E'),$file_info['name']); - - // Get random number generator - $random = new Password(); + // Sanitize filename + $file_info['name'] = Rhymix\Framework\Filters\FilenameFilter::clean($file_info['name']); // Set upload path by checking if the attachement is an image or other kinds of file if(preg_match("/\.(jpe?g|gif|png|wm[va]|mpe?g|avi|swf|flv|mp[1-4]|as[fx]|wav|midi?|moo?v|qt|r[am]{1,2}|m4v)$/i", $file_info['name'])) @@ -749,7 +745,7 @@ class fileController extends file // change to random file name. because window php bug. window php is not recognize unicode character file name - by cherryfilter $ext = substr(strrchr($file_info['name'],'.'),1); //$_filename = preg_replace('/[#$&*?+%"\']/', '_', $file_info['name']); - $_filename = $random->createSecureSalt(32, 'hex').'.'.$ext; + $_filename = Rhymix\Framework\Security::getRandom(32, 'hex') . '.' . $ext; $filename = $path.$_filename; $idx = 1; while(file_exists($filename)) @@ -762,17 +758,15 @@ class fileController extends file else { $path = sprintf("./files/attach/binaries/%s/%s", $module_srl, getNumberingPath($upload_target_srl,3)); - $filename = $path.$random->createSecureSalt(32, 'hex'); + $filename = $path . Rhymix\Framework\Security::getRandom(32, 'hex'); $direct_download = 'N'; } + // Create a directory - if(!FileHandler::makeDir($path)) return new Object(-1,'msg_not_permitted_create'); - - // Check uploaded file - if(!checkUploadedFile($file_info['tmp_name'])) return new Object(-1,'msg_file_upload_error'); - - // Get random number generator - $random = new Password(); + if(!Rhymix\Framework\Storage::isDirectory($path) && !Rhymix\Framework\Storage::createDirectory($path)) + { + return new Object(-1,'msg_not_permitted_create'); + } // Move the file if($manual_insert) @@ -780,7 +774,7 @@ class fileController extends file @copy($file_info['tmp_name'], $filename); if(!file_exists($filename)) { - $filename = $path.$random->createSecureSalt(32, 'hex').'.'.$ext; + $filename = $path . Rhymix\Framework\Security::getRandom(32, 'hex') . '.' . $ext; @copy($file_info['tmp_name'], $filename); } } @@ -788,7 +782,7 @@ class fileController extends file { if(!@move_uploaded_file($file_info['tmp_name'], $filename)) { - $filename = $path.$random->createSecureSalt(32, 'hex').'.'.$ext; + $filename = $path . Rhymix\Framework\Security::getRandom(32, 'hex') . '.' . $ext; if(!@move_uploaded_file($file_info['tmp_name'], $filename)) return new Object(-1,'msg_file_upload_error'); } } @@ -807,7 +801,7 @@ class fileController extends file $args->file_size = @filesize($filename); $args->comment = NULL; $args->member_srl = $member_srl; - $args->sid = $random->createSecureSalt(32, 'hex'); + $args->sid = Rhymix\Framework\Security::getRandom(32, 'hex'); $output = executeQuery('file.insertFile', $args); if(!$output->toBool()) return $output; @@ -982,13 +976,12 @@ class fileController extends file if(preg_match("/\.(jpg|jpeg|gif|png|wmv|wma|mpg|mpeg|avi|swf|flv|mp1|mp2|mp3|mp4|asf|wav|asx|mid|midi|asf|mov|moov|qt|rm|ram|ra|rmm|m4v)$/i", $file_info->source_filename)) { $path = sprintf("./files/attach/images/%s/%s/", $target_module_srl,$target_srl); - $new_file = $path.$file_info->source_filename; + $new_file = $path . $file_info->source_filename; } else { $path = sprintf("./files/attach/binaries/%s/%s/", $target_module_srl, $target_srl); - $random = new Password(); - $new_file = $path.$random->createSecureSalt(32, 'hex'); + $new_file = $path . Rhymix\Framework\Security::getRandom(32, 'hex'); } // Pass if a target document to move is same if($old_file == $new_file) continue; diff --git a/modules/file/file.model.php b/modules/file/file.model.php index cd8deb2e7..cee62d217 100644 --- a/modules/file/file.model.php +++ b/modules/file/file.model.php @@ -47,8 +47,14 @@ class fileModel extends file $obj->source_filename = $file_info->source_filename; $obj->file_size = $file_info->file_size; $obj->disp_file_size = FileHandler::filesize($file_info->file_size); - if($file_info->direct_download=='N') $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); - else $obj->download_url = str_replace('./', '', $file_info->uploaded_filename); + if($file_info->direct_download == 'N') + { + $obj->download_url = $this->getDownloadUrl($file_info->file_srl, $file_info->sid, $file_info->module_srl); + } + else + { + $obj->download_url = $this->getDirectFileUrl($file_info->uploaded_filename); + } $obj->direct_download = $file_info->direct_download; $obj->cover_image = ($file_info->cover_image === 'Y') ? true : false; $files[] = $obj; @@ -109,7 +115,23 @@ class fileModel extends file { return sprintf('?module=%s&act=%s&file_srl=%s&sid=%s&module_srl=%s', 'file', 'procFileDownload', $file_srl, $sid, $module_srl); } + + /** + * Return direct download file url + * + * @param string $path + * @return string + */ + function getDirectFileUrl($path) + { + if(dirname($_SERVER['SCRIPT_NAME']) == '/' || dirname($_SERVER['SCRIPT_NAME']) == '\\') + { + return '/' . substr($path, 2); + } + return dirname($_SERVER['SCRIPT_NAME']) . '/' . substr($path, 2); + } + /** * Get file configurations * @@ -271,12 +293,12 @@ class fileModel extends file // Display upload status $upload_status = sprintf( '%s : %s/ %s
%s : %s (%s : %s)', - Context::getLang('allowed_attach_size'), + lang('allowed_attach_size'), FileHandler::filesize($attached_size), FileHandler::filesize($file_config->allowed_attach_size*1024*1024), - Context::getLang('allowed_filesize'), + lang('allowed_filesize'), FileHandler::filesize($file_config->allowed_filesize*1024*1024), - Context::getLang('allowed_filetypes'), + lang('allowed_filetypes'), $file_config->allowed_filetypes ); return $upload_status; diff --git a/modules/file/lang/es.php b/modules/file/lang/es.php index ab7d83d72..1b3286f9b 100644 --- a/modules/file/lang/es.php +++ b/modules/file/lang/es.php @@ -28,8 +28,6 @@ $lang->msg_exceeds_limit_size = 'Ha excedido el límite del tamaño total de los $lang->file_search_target_list['filename'] = 'Nombre del archivo'; $lang->file_search_target_list['filesize_more'] = 'Tamaño del archivo(Byte, sobre)'; $lang->file_search_target_list['filesize_mega_more'] = 'Tamaño del archivo(Mb, o mb)'; -$lang->file_search_target_list['filesize_less'] = '파일크기(byte, 이하)'; -$lang->file_search_target_list['filesize_mega_less'] = '파일크기(Mb, 이하)'; $lang->file_search_target_list['download_count'] = 'Descargados(Sobre)'; $lang->file_search_target_list['user_id'] = 'ID'; $lang->file_search_target_list['user_name'] = 'Nombre'; diff --git a/modules/file/lang/fr.php b/modules/file/lang/fr.php index 0ba07d70f..c0629cd88 100644 --- a/modules/file/lang/fr.php +++ b/modules/file/lang/fr.php @@ -7,13 +7,10 @@ $lang->status = 'Statut'; $lang->is_valid = 'Valide'; $lang->is_stand_by = 'Attente'; $lang->file_list = 'Liste des Annexes'; -$lang->allow_outlink_site = '파일 외부 허용 사이트'; $lang->allowed_filesize = 'Mesure du Fichier Maximum'; $lang->allowed_attach_size = 'Somme des Annexes Maximum'; $lang->allowed_filetypes = 'Extensions consentis seulement peuvent etre attaches.'; $lang->enable_download_group = 'Groupe permis de telecharger'; -$lang->about_allow_outlink = '리퍼러에 따라 파일 외부 링크를 차단할 수 있습니다.(*.wmv, *.mp3등 미디어 파일 제외)'; -$lang->about_allow_outlink_site = '파일 외부 링크 설정에 관계 없이 허용하는 사이트 주소입니다. 여러개 입력시에 줄을 바꿔서 구분해주세요. ex)https://www.rhymix.org/'; $lang->about_allowed_filesize = 'Vous pouvez designer la limite de mesure pour chaque fichier.(Exclure administrateurs)'; $lang->about_allowed_attach_size = 'Vous pouvez designer la limite de mesure pour chaque document.(Exclure administrateurs)'; $lang->about_allowed_filetypes = 'Pour consentir une extension, utilisez "*.[extention]". Pour consentir plusieurs extensions, utilisez ";" entre chaque extension. ex) *.* ou *.jpg;*.gif;'; @@ -26,9 +23,6 @@ $lang->msg_checked_file_is_deleted = '%d Annexe(s) est(sont) supprime(s)'; $lang->msg_exceeds_limit_size = 'La mesure de l\'(des) Annexe(s) est plus grande que celle consentie.'; $lang->file_search_target_list['filename'] = 'Nom de Fichier'; $lang->file_search_target_list['filesize_more'] = 'Mesure de Fichier(octet, surplus)'; -$lang->file_search_target_list['filesize_mega_more'] = '파일크기(Mb, 이상)'; -$lang->file_search_target_list['filesize_less'] = '파일크기(byte, 이하)'; -$lang->file_search_target_list['filesize_mega_less'] = '파일크기(Mb, 이하)'; $lang->file_search_target_list['download_count'] = 'Telecharges(surplus)'; $lang->file_search_target_list['regdate'] = 'Enrgistre'; $lang->file_search_target_list['ipaddress'] = 'Adresse IP'; diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index f0ac7f915..a442c80bb 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -328,10 +328,10 @@ class importerAdminController extends importer // When completing, success message appears and remove the cache files if($total <= $cur) { - $this->setMessage( sprintf(Context::getLang('msg_import_finished'), $cur, $total) ); + $this->setMessage( sprintf(lang('msg_import_finished'), $cur, $total) ); FileHandler::removeDir('./files/cache/importer/'.$key); } - else $this->setMessage( sprintf(Context::getLang('msg_importing'), $total, $cur) ); + else $this->setMessage( sprintf(lang('msg_importing'), $total, $cur) ); } /** diff --git a/modules/importer/lang/es.php b/modules/importer/lang/es.php index cc8b0cf41..a7a65d535 100644 --- a/modules/importer/lang/es.php +++ b/modules/importer/lang/es.php @@ -1,7 +1,6 @@ cmd_sync_member = 'Sincronizar'; $lang->cmd_continue = 'Continuar'; -$lang->preprocessing = '데이터 이전을 위한 사전 준비중입니다.'; $lang->importer = 'Transferir los datos de Rhymix'; $lang->source_type = 'Objetivo a transferir'; $lang->type_member = 'Información del usuario'; @@ -21,7 +20,6 @@ $lang->import_step_desc['13'] = 'Seleccione la categoría para transferir los da $lang->import_step_desc['2'] = 'Ingrese la ubicación del archivo XML para transfer los datos. Puede ser ruta absoluto o relativo.'; $lang->import_step_desc['3'] = 'La información del usuario y del documento podría ser incorrecto luego de la transferencia. Si ese es el caso, sincroniza para la corrección basado a la ID del usuario.'; -$lang->import_step_desc['99'] = '데이터를 이전중입니다'; $lang->msg_sync_member = 'Al presionar el botón sincronizar comenzará a sincronizar la información del usuario y la del artículo.'; $lang->msg_no_xml_file = 'No se puede encontrar el archivo XML. Verifique su ruta.'; $lang->msg_invalid_xml_file = 'Tipo de archivo XML inválido.'; diff --git a/modules/install/install.controller.php b/modules/install/install.controller.php index 90d608952..c5f45d224 100644 --- a/modules/install/install.controller.php +++ b/modules/install/install.controller.php @@ -284,7 +284,7 @@ class installController extends install if(!$ftp_info->ftp_user || !$ftp_info->ftp_password) return new Object(-1,'msg_safe_mode_ftp_needed'); $oFtp = new ftp(); - if(!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_info->ftp_host)); + if(!$oFtp->ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port)) return new Object(-1, sprintf(lang('msg_ftp_not_connected'), $ftp_info->ftp_host)); if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) { @@ -342,7 +342,7 @@ class installController extends install else { $oFtp = new ftp(); - if(!$oFtp->ftp_connect('127.0.0.1', $ftp_info->ftp_port)) return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), 'localhost')); + if(!$oFtp->ftp_connect('127.0.0.1', $ftp_info->ftp_port)) return new Object(-1, sprintf(lang('msg_ftp_not_connected'), 'localhost')); if(!$oFtp->ftp_login($ftp_info->ftp_user, $ftp_info->ftp_password)) { @@ -364,15 +364,14 @@ class installController extends install $checklist = array(); // Check PHP version - $checklist['php_version'] = true; - if(version_compare(PHP_VERSION, __XE_MIN_PHP_VERSION__, '<')) + if(version_compare(PHP_VERSION, __XE_MIN_PHP_VERSION__, '>=')) + { + $checklist['php_version'] = true; + } + else { $checklist['php_version'] = false; } - if(version_compare(PHP_VERSION, __XE_RECOMMEND_PHP_VERSION__, '<')) - { - Context::set('phpversion_warning', true); - } // Check DB if(DB::getEnableList()) @@ -542,9 +541,7 @@ class installController extends install foreach($module_list as $module_path) { // Get module name - $tmp_arr = explode('/',$module_path); - $module = $tmp_arr[count($tmp_arr)-1]; - + $module = basename($module_path); $xml_info = $oModuleModel->getModuleInfoXml($module); if(!$xml_info) continue; $modules[$xml_info->category][] = $module; diff --git a/modules/install/install.model.php b/modules/install/install.model.php index f4b854a50..b9d749b67 100644 --- a/modules/install/install.model.php +++ b/modules/install/install.model.php @@ -54,7 +54,7 @@ class installModel extends install if(function_exists('ftp_connect')) { $connection = ftp_connect($ftp_info->ftp_host, $ftp_info->ftp_port); - if(!$connection) return new Object(-1, sprintf(Context::getLang('msg_ftp_not_connected'), $ftp_info->ftp_host)); + if(!$connection) return new Object(-1, sprintf(lang('msg_ftp_not_connected'), $ftp_info->ftp_host)); if(! @ftp_login($connection, $ftp_info->ftp_user, $ftp_info->ftp_password)) { ftp_close($connection); diff --git a/modules/install/install.view.php b/modules/install/install.view.php index 752208b80..27f504ea7 100644 --- a/modules/install/install.view.php +++ b/modules/install/install.view.php @@ -23,7 +23,7 @@ class installView extends install } // Set the browser title. - Context::setBrowserTitle(Context::getLang('introduce_title')); + Context::setBrowserTitle(lang('introduce_title')); // Specify the template path. $this->setTemplatePath($this->module_path.'tpl'); @@ -74,7 +74,7 @@ class installView extends install function dispInstallCheckEnv() { // Create a temporary file for mod_rewrite check. - self::$rewriteCheckString = Password::createSecureSalt(32); + self::$rewriteCheckString = Rhymix\Framework\Security::getRandom(32); FileHandler::writeFile(_XE_PATH_ . self::$rewriteCheckFilePath, self::$rewriteCheckString);; // Check if the web server is nginx. diff --git a/modules/install/lang/es.php b/modules/install/lang/es.php index 294d415dd..ac0ed2a5f 100644 --- a/modules/install/lang/es.php +++ b/modules/install/lang/es.php @@ -68,4 +68,3 @@ $lang->msg_ftp_invalid_auth_info = 'Los datos de login para el FTP no son correc $lang->msg_ftp_mkdir_fail = 'Ha fallado el comando de FTP para la creación de directorio. Verifique la configuración del servicio FTP en el servidor'; $lang->msg_ftp_chmod_fail = 'Ha fallado el comando de FTP para la modificación de atributos de directorio. Verifique la configuración del servicio FTP en el servidor.'; $lang->msg_ftp_connect_success = 'conexión con éxito al FTP'; -$lang->msg_ftp_installed_ftp_realpath = '설치된 Rhymix의 FTP 절대경로'; diff --git a/modules/install/lang/fr.php b/modules/install/lang/fr.php index 4d5a64573..dbc97e419 100644 --- a/modules/install/lang/fr.php +++ b/modules/install/lang/fr.php @@ -59,12 +59,4 @@ $lang->msg_dbconnect_failed = 'Erreur a lieu en essayant connecter à la Base de $lang->msg_table_is_exists = 'La Table est déjà créée dans la Base de Données. Le fichier de Configuration est recréé.'; $lang->msg_install_completed = 'Installation a complété. Merci pour choisir Rhymix.'; $lang->msg_install_failed = 'Une erreur a lieu en créant le fichier d\'installation.'; -$lang->ftp_form_title = 'FTP 정보 입력'; $lang->ftp = 'FTP'; -$lang->msg_safe_mode_ftp_needed = 'PHP의 safe_mode가 On일 경우 FTP 정보를 꼭 입력해야 Rhymix의 설치 및 사용이 가능합니다'; -$lang->msg_ftp_not_connected = 'localhost로의 FTP 접속 오류가 발생하였습니다. ftp 포트 번호를 확인하거나 ftp 서비스가 가능한지 확인해주세요'; -$lang->msg_ftp_invalid_auth_info = '입력한 FTP 정보로 로그인을 하지 못했습니다. FTP정보를 확인해주세요'; -$lang->msg_ftp_mkdir_fail = 'FTP를 이용한 디렉토리 생성 명령을 실패하였습니다. FTP 서버의 설정을 확인해주세요'; -$lang->msg_ftp_chmod_fail = 'FTP를 이용한 디렉토리의 속성 변경을 실패하였습니다. FTP 서버의 설정을 확인해주세요'; -$lang->msg_ftp_connect_success = 'FTP 접속 및 인증 성공하였습니다'; -$lang->msg_ftp_installed_ftp_realpath = '설치된 Rhymix의 FTP 절대경로'; diff --git a/modules/install/lang/ru.php b/modules/install/lang/ru.php index 041ee560d..22cc1d90c 100644 --- a/modules/install/lang/ru.php +++ b/modules/install/lang/ru.php @@ -61,5 +61,3 @@ $lang->msg_install_completed = 'Установка завершена. Спас $lang->msg_install_failed = 'Произошла ошибка при создании файла конфигурации.'; $lang->ftp_form_title = 'Введите данные FTP'; $lang->ftp = 'FTP'; -$lang->msg_ftp_not_connected = 'Connection to localhost via FTP failed. Please check the port number and if FTP service is available.'; -$lang->msg_ftp_chmod_fail = 'Chmod failed. Please check the permission and configuration of FTP server.'; diff --git a/modules/install/tpl/check_env.html b/modules/install/tpl/check_env.html index 8bb498790..e2cc54949 100644 --- a/modules/install/tpl/check_env.html +++ b/modules/install/tpl/check_env.html @@ -16,14 +16,13 @@ ERROR - + - {sprintf($lang->install_checklist_desc['php_version_warning'], __XE_RECOMMEND_PHP_VERSION__)} [{$lang->more}] - - - - - {$lang->install_checklist_desc[$key]} + + {sprintf($lang->install_checklist_desc[$key], __XE_MIN_PHP_VERSION__)} + + {$lang->install_checklist_desc[$key]} + diff --git a/modules/integration_search/integration_search.admin.controller.php b/modules/integration_search/integration_search.admin.controller.php index 232af8d62..3bd38c4e4 100644 --- a/modules/integration_search/integration_search.admin.controller.php +++ b/modules/integration_search/integration_search.admin.controller.php @@ -85,7 +85,7 @@ class integration_searchAdminController extends integration_search continue; } // Ignore if the file is not successfully uploaded, and check uploaded file - if(!is_uploaded_file($image_obj['tmp_name']) || !checkUploadedFile($image_obj['tmp_name'])) + if(!is_uploaded_file($image_obj['tmp_name'])) { unset($obj->{$vars->name}); continue; diff --git a/modules/layout/lang/de.php b/modules/layout/lang/de.php index 11ebb2963..eaa712107 100644 --- a/modules/layout/lang/de.php +++ b/modules/layout/lang/de.php @@ -1,23 +1,3 @@ cmd_layout_edit = 'Layout bearbeiten'; $lang->about_layout = 'Layouts schmücken das Aussehen Ihrer Module. Sie können sie von Layout-Menü am oberen Rand '; -$lang->layout_manager['0'] = 'L'; -$lang->layout_manager['1'] = 'a'; -$lang->layout_manager['2'] = 'y'; -$lang->layout_manager['3'] = 'o'; -$lang->layout_manager['4'] = 'u'; -$lang->layout_manager['5'] = 't'; -$lang->layout_manager['6'] = '-'; -$lang->layout_manager['7'] = 'E'; -$lang->layout_manager['8'] = 'i'; -$lang->layout_manager['9'] = 'n'; -$lang->layout_manager['10'] = 's'; -$lang->layout_manager['11'] = 't'; -$lang->layout_manager['12'] = 'e'; -$lang->layout_manager['13'] = 'l'; -$lang->layout_manager['14'] = 'l'; -$lang->layout_manager['15'] = 'u'; -$lang->layout_manager['16'] = 'n'; -$lang->layout_manager['17'] = 'g'; -$lang->layout_manager['18'] = 'e'; -$lang->layout_manager['19'] = 'n'; diff --git a/modules/layout/lang/es.php b/modules/layout/lang/es.php index 9247e495d..2740a312c 100644 --- a/modules/layout/lang/es.php +++ b/modules/layout/lang/es.php @@ -16,16 +16,3 @@ $lang->about_title = 'Ingresar un nombre fácil de distinguir cuando conecta al $lang->about_not_apply_menu = 'Al seleccionar esta opción, cambia todos los diseños conectados.'; $lang->about_layout = 'Módulo del diseño ayuda a usted para crear el diseño de la página web fácilmente. Por usar la configuración del diseño y el menú de conección, completa con varios módulos la forma de la página web que a ser mostrados Esos diseños que no pueden ser modificados ni eliminados son propios de blog y de otros módulos, por lo cual para la configuración de ellos debe hacerse en los modulos correspondientes.'; $lang->about_layout_code = 'El diseño sera aplicado al servicio cuando usted guarda el código del diseño luego de haber editado. Primero visualiza previamente tus códigos y luego guardalos. Referente al código de planillas de XE dirijirse aXE Pamphlet(Ingles) '; -$lang->about_layout_import = '가져오기를 할 경우 기존 수정된 레이아웃을 삭제가 됩니다. 가져오기를 하기전에 내보내기를 통해 백업을 하세요.'; -$lang->layout_manager['30'] = '가로 너비'; -$lang->layout_manager['31'] = '높이'; -$lang->about_layout_image_repository = '선택된 레이아웃에 사용될 이미지/플래시파일등을 올릴 수 있습니다. 내보내기에 같이 포함이 됩니다'; -$lang->msg_layout_image_target = 'gif, png, jpg, swf, flv파일만 가능합니다'; -$lang->layout_migration = '레이아웃 내보내기/ 들이기'; -$lang->about_layout_migration = '수정된 레이아웃을 tar 파일로 내보내거나 tar 파일로 저장된 것을 불러올 수 있습니다 -(아직은 faceOff레이아웃만 내보내기/들이기가 됩니다'; -$lang->about_faceoff['description'] = 'FaceOff Layout관리자는 웹상에서 쉽게 레이아웃을 꾸밀 수 있습니다.
아래 그림을 보고 구성요소와 기능을 이용하여 원하는 레이아웃을 만드세요'; -$lang->about_faceoff['layout'] = 'FaceOff는 위와 같은 HTML 구조로 되어 있습니다.
이 구조에서 CSS를 이용하여 형태/배열/정렬을 할 수 있고 또 Style을 이용하여 꾸밀 수 있습니다.
위젯 추가는 Extension(e1, e2)와 Neck, Knee에서 가능합니다.
이 외 Body, Layout, Header, Body, Footer는 Style을 꾸밀 수 있고 Content는 내용이 출력됩니다.'; -$lang->about_faceoff['setting'] = '좌측 상단의 메뉴에 대해 설명 드립니다.
  • 저장 : 설정된 내용을 저장합니다.
  • 취소 : 설정한 내용을 저장하지 않고 돌아갑니다.
  • 초기화 : 아무 설정도 되어 있지 않은 백지 상태로 돌립니다
  • 형태 : 고정/ 가변/ 고정+가변(내용)의 형태를 지정합니다.
  • 배열 : Extension 2개와 Content를 배열합니다.
  • 정렬 : 레이아웃의 위치를 정렬시킬 수 있습니다.
'; -$lang->about_faceoff['hotkey'] = '마우스로 각 영역을 선택하면서 Hot Key를 이용하면 더 쉽게 꾸밀 수 있습니다.
  • tab 키 : 위젯이 선택되어 있지 않으면 Header, Body, Footer 순으로 선택됩니다. 위젯이 선택되어 있다면 다음 위젯으로 선택이 이동됩니다.
  • Shift + tab키 : tab키와 반대 역할을 합니다.
  • Esc : 아무것도 선택되어 있지 않을때 Esc를 누르면 Neck, Extension(e1,e2),Knee 순서대로 선택이 되며 위젯이 선택되어 있다면 선택된 위젯을 감싸는 영역이 선택됩니다.
  • 방향키 : 위젯이 선택되어 있을때 방향키를 이용하여 위젯을 다른 영역으로 이동시킬 수 있습니다.
'; -$lang->about_apply_mobile_view = 'All connected module use mobile view to display when accessing with mobile device.'; diff --git a/modules/layout/lang/fr.php b/modules/layout/lang/fr.php index 88c0fd147..2ec0bedde 100644 --- a/modules/layout/lang/fr.php +++ b/modules/layout/lang/fr.php @@ -16,16 +16,3 @@ $lang->about_title = 'Entrez le titre pour distinguer facilement quand vous le l $lang->about_not_apply_menu = 'Tous les Mises en Page qui sont liés sur le menu seront changés si vous cochez cette option.'; $lang->about_layout = 'Le module de Mise en Page vous aide à créer facilement le Mise en Page du site. Vous pouvez présentez la forme du site Web complété par les modules divers en utilisant la configuration du Mise en Page et la connexion sur le menu. Les Mises en Page qui ne sont pas possibles à supprimer ou à modifier sont propres à ceux des blogues ou d\'autres Mises en Page. Essayez à modifier/supprimer en dedans elles-mêmes'; $lang->about_layout_code = 'Vous conservez la code de Mise en Page après l\'éditer, la code sera appliquée sur le service. Utilisez [Avant-première] avant conserver la code S.V.P. Vous pouvez référer la grammaire de modèle de XE sur Modèle du XE.'; -$lang->about_layout_import = '가져오기를 할 경우 기존 수정된 레이아웃을 삭제가 됩니다. 가져오기를 하기전에 내보내기를 통해 백업을 하세요.'; -$lang->layout_manager['30'] = '가로 너비'; -$lang->layout_manager['31'] = '높이'; -$lang->about_layout_image_repository = '선택된 레이아웃에 사용될 이미지/플래시파일등을 올릴 수 있습니다. 내보내기에 같이 포함이 됩니다'; -$lang->msg_layout_image_target = 'gif, png, jpg, swf, flv파일만 가능합니다'; -$lang->layout_migration = '레이아웃 내보내기/ 들이기'; -$lang->about_layout_migration = '수정된 레이아웃을 tar 파일로 내보내거나 tar 파일로 저장된 것을 불러올 수 있습니다 -(아직은 faceOff레이아웃만 내보내기/들이기가 됩니다'; -$lang->about_faceoff['description'] = 'FaceOff Layout관리자는 웹상에서 쉽게 레이아웃을 꾸밀 수 있습니다.
아래 그림을 보고 구성요소와 기능을 이용하여 원하는 레이아웃을 만드세요'; -$lang->about_faceoff['layout'] = 'FaceOff는 위와 같은 HTML 구조로 되어 있습니다.
이 구조에서 CSS를 이용하여 형태/배열/정렬을 할 수 있고 또 Style을 이용하여 꾸밀 수 있습니다.
위젯 추가는 Extension(e1, e2)와 Neck, Knee에서 가능합니다.
이 외 Body, Layout, Header, Body, Footer는 Style을 꾸밀 수 있고 Content는 내용이 출력됩니다.'; -$lang->about_faceoff['setting'] = '좌측 상단의 메뉴에 대해 설명 드립니다.
  • 저장 : 설정된 내용을 저장합니다.
  • 취소 : 설정한 내용을 저장하지 않고 돌아갑니다.
  • 초기화 : 아무 설정도 되어 있지 않은 백지 상태로 돌립니다
  • 형태 : 고정/ 가변/ 고정+가변(내용)의 형태를 지정합니다.
  • 배열 : Extension 2개와 Content를 배열합니다.
  • 정렬 : 레이아웃의 위치를 정렬시킬 수 있습니다.
'; -$lang->about_faceoff['hotkey'] = '마우스로 각 영역을 선택하면서 Hot Key를 이용하면 더 쉽게 꾸밀 수 있습니다.
  • tab 키 : 위젯이 선택되어 있지 않으면 Header, Body, Footer 순으로 선택됩니다. 위젯이 선택되어 있다면 다음 위젯으로 선택이 이동됩니다.
  • Shift + tab키 : tab키와 반대 역할을 합니다.
  • Esc : 아무것도 선택되어 있지 않을때 Esc를 누르면 Neck, Extension(e1,e2),Knee 순서대로 선택이 되며 위젯이 선택되어 있다면 선택된 위젯을 감싸는 영역이 선택됩니다.
  • 방향키 : 위젯이 선택되어 있을때 방향키를 이용하여 위젯을 다른 영역으로 이동시킬 수 있습니다.
'; -$lang->about_apply_mobile_view = 'All connected module use mobile view to display when accessing with mobile device.'; diff --git a/modules/layout/lang/ru.php b/modules/layout/lang/ru.php index bfc6385f6..74aa07a09 100644 --- a/modules/layout/lang/ru.php +++ b/modules/layout/lang/ru.php @@ -16,12 +16,3 @@ $lang->about_title = 'Пожалуйста, введите название, к $lang->about_not_apply_menu = 'Все подключенные лейауты модулей будут изменены при включении это опции.'; $lang->about_layout = 'Модуль лейаутов помогает Вам создать лейаут сайта с легкостью. Используя настройки лейаута и подключение меню, полная форма сайта будет отображена множеством модулей. Теми лейаутами, которые невозможно удалить или изменить, являются лейауты блога и лейауты других модулей.'; $lang->about_layout_code = 'Применения к службе будут проиведены, когда Вы сохраните код лейаут после редактирование. Пожалуйста, сначала используйте предпросмотр кода и затем сохраните его. Вы можете обратиться к грамматике шаблонов XE с XE Template.'; -$lang->about_layout_export = 'Export currently editted layout.'; -$lang->about_layout_import = 'Original layout will be deleted when you import. Please export current layout before importing.'; -$lang->about_layout_image_repository = 'You can upload images/flash files for selected layout. They will be included in exports'; -$lang->about_layout_migration = 'You can export or import editted layout as tar file -(So far only FaceOff supports exports/imports)'; -$lang->about_faceoff['setting'] = 'Let me explain you the upper menu on left.
  • Save : Save current settings.
  • Cancel : Discard current settings and go back.
  • Reset : Clear current settings
  • Form : Set form as Fixed/ Variable/ Fixed+Variable(Content).
  • Arrange : Arrange 2 Extensions and Content.
  • Align : Align the position of layout.
'; -$lang->about_faceoff['hotkey'] = 'You can design your layout more easily with Hot Keys.
  • tab : Unless a widget is selected, Header, Body, Footer will be selected in order. If not, next widget will be selected.
  • Shift + tab : It does the opposite function to tab key.
  • Esc : If nothing is selected, Neck, Extension(e1,e2),Knee will be selected in order, if a widget is selected, area of the widget will be selected.
  • Arrow Key : If a widget is selected, arrow key will move the widget to other areas.
'; -$lang->about_faceoff['attribute'] = 'You can set background color/image to every area except widget, and font color(include tag).'; -$lang->about_apply_mobile_view = 'All connected module use mobile view to display when accessing with mobile device.'; diff --git a/modules/layout/lang/vi.php b/modules/layout/lang/vi.php index 7f4d6e73f..f9a5a38d3 100644 --- a/modules/layout/lang/vi.php +++ b/modules/layout/lang/vi.php @@ -88,4 +88,3 @@ $lang->about_faceoff['layout'] = 'FaceOff có cấu trúc HTML như trên.
b $lang->about_faceoff['setting'] = 'Menu phía bên trái.
  • "Lưu lại": là lưu lại những thiết lập hiện tại.
  • "Loại bỏ": là bỏ qua những thay đổi hiện tại và trở lại.
  • "Thiết lập lại": là xóa bỏ tất cả những thay đổi.
  • "Form": đặt Form dạng Cố định, Biến thiên, Cố định+Biến thiên (Nội dung).
  • "Thu nhỏ": là thu nhỏ hai phần mở rộng và nội dung.
  • "Căn chỉnh" : là sắp xếp sự thẳng hàng.
'; $lang->about_faceoff['hotkey'] = 'Bạn có thể thiết kế giao diện của mình dễ dàng hơn nữa với những phím tắt.
  • "Tab": trừ khi một Widget được chọn, Header, Body, Footer sẽ được chọn trong lệnh. Nếu không, Widget tiếp theo sẽ được chọn.
  • "Shift+Tab": nó ngược lại với phím "Tab".
  • "Esc": Nếu không có gì được chọn, Neck, Extension (e1, e2 ), Knee sẽ được lựa chọn theo thứ tự, nếu một Widget được chọn, kích thước Widget sẽ được lựa chọn.
  • "4 phím mũi tên": Nếu Widget đã được chọn, nó sẽ di chuyển Widget tới một vị trí mới.
'; $lang->about_faceoff['attribute'] = 'Bạn có thể đặt màu nền / hình nền tới mọi khu vực trừ Widget, và màu chữ (bao gồm cả Tag).'; -$lang->about_apply_mobile_view = 'All connected module use mobile view to display when accessing with mobile device.'; diff --git a/modules/layout/lang/zh-TW.php b/modules/layout/lang/zh-TW.php index cdec0df1d..8fb73d324 100644 --- a/modules/layout/lang/zh-TW.php +++ b/modules/layout/lang/zh-TW.php @@ -91,7 +91,6 @@ $lang->about_faceoff['attribute'] = '除了 Widget 以外的各個區域都可 $lang->mobile_layout_list = '手機版面列表'; $lang->mobile_downloaded_list = '下載手機版面'; $lang->apply_mobile_view = '使用手機面板'; -$lang->about_apply_mobile_view = 'All connected module use mobile view to display when accessing with mobile device.'; $lang->installed_layout = '已安裝版面'; $lang->instance_layout = '已安裝版面'; $lang->faceoff_export = '匯出 FaceOff 版面'; diff --git a/modules/layout/layout.admin.controller.php b/modules/layout/layout.admin.controller.php index 1e571a24f..572d052ee 100644 --- a/modules/layout/layout.admin.controller.php +++ b/modules/layout/layout.admin.controller.php @@ -435,9 +435,6 @@ class layoutAdminController extends layout $ext = substr(strrchr($filename,'.'),1); $filename = sprintf('%s.%s', md5($filename), $ext); } - - // Check uploaded file - if(!checkUploadedFile($source['tmp_name'])) return false; if(file_exists($path .'/'. $filename)) @unlink($path . $filename); if(!move_uploaded_file($source['tmp_name'], $path . $filename )) return false; @@ -690,7 +687,7 @@ class layoutAdminController extends layout // check upload if(!Context::isUploaded()) exit(); $file = Context::get('file'); - if(!is_uploaded_file($file['tmp_name']) || !checkUploadedFile($file['tmp_name'])) exit(); + if(!is_uploaded_file($file['tmp_name'])) exit(); if(substr_compare($file['name'], '.tar', -4) !== 0) exit(); @@ -925,15 +922,15 @@ class layoutAdminController extends layout $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile("after_upload_config_image.html"); - if(!$img['tmp_name'] || !is_uploaded_file($img['tmp_name']) || !checkUploadedFile($img['tmp_name'])) + if(!$img['tmp_name'] || !is_uploaded_file($img['tmp_name'])) { - Context::set('msg', Context::getLang('upload failed')); + Context::set('msg', lang('upload failed')); return; } if(!preg_match('/\.(jpg|jpeg|gif|png|swf)$/i', $img['name'])) { - Context::set('msg', Context::getLang('msg_layout_image_target')); + Context::set('msg', lang('msg_layout_image_target')); return; } @@ -941,7 +938,7 @@ class layoutAdminController extends layout $tmpPath = $path . 'tmp/'; if(!FileHandler::makeDir($tmpPath)) { - Context::set('msg', Context::getLang('make directory failed')); + Context::set('msg', lang('make directory failed')); return; } @@ -952,7 +949,7 @@ class layoutAdminController extends layout if(!move_uploaded_file($img['tmp_name'], $tmpFileName)) { - Context::set('msg', Context::getLang('move file failed')); + Context::set('msg', lang('move file failed')); return; } @@ -990,7 +987,7 @@ class layoutAdminController extends layout $output = $this->updateLayout($args); if(!$output->toBool()) { - Context::set('msg', Context::getLang($output->getMessage())); + Context::set('msg', lang($output->getMessage())); return $output; } diff --git a/modules/layout/layout.admin.view.php b/modules/layout/layout.admin.view.php index 33d9ff6b8..75a384088 100644 --- a/modules/layout/layout.admin.view.php +++ b/modules/layout/layout.admin.view.php @@ -324,7 +324,7 @@ class layoutAdminView extends layout } Context::set('layout_info', $layout_info); - Context::set('content', Context::getLang('layout_preview_content')); + Context::set('content', lang('layout_preview_content')); // Temporary save the codes $edited_layout_file = sprintf('./files/cache/layout/tmp.tpl'); FileHandler::writeFile($edited_layout_file, $code); diff --git a/modules/layout/layout.model.php b/modules/layout/layout.model.php index 7797edf4d..0ea869c7b 100644 --- a/modules/layout/layout.model.php +++ b/modules/layout/layout.model.php @@ -58,7 +58,7 @@ class layoutModel extends layout $siteDefaultLayoutInfo = $this->getlayout($siteDefaultLayoutSrl); $newLayout = sprintf('%s, %s', $siteDefaultLayoutInfo->title, $siteDefaultLayoutInfo->layout); $siteDefaultLayoutInfo->layout_srl = -1; - $siteDefaultLayoutInfo->title = Context::getLang('use_site_default_layout'); + $siteDefaultLayoutInfo->title = lang('use_site_default_layout'); $siteDefaultLayoutInfo->layout = $newLayout; array_unshift($output->data, $siteDefaultLayoutInfo); @@ -1030,7 +1030,7 @@ class layoutModel extends layout // Display edit button for faceoff layout if(Context::get('module')!='admin' && strpos(Context::get('act'),'Admin')===false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) { - Context::addHtmlFooter('
'); + Context::addHtmlFooter(''); } // Display menu when editing the faceOff page if(Context::get('act')=='dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) diff --git a/modules/layout/layout.view.php b/modules/layout/layout.view.php index 50b134560..acacca938 100644 --- a/modules/layout/layout.view.php +++ b/modules/layout/layout.view.php @@ -55,7 +55,7 @@ class layoutView extends layout $logged_info = Context::get('logged_info'); if($logged_info->is_admin != 'Y') { - throw new Exception(Context::getLang('msg_invalid_request')); + throw new Exception(lang('msg_invalid_request')); } // if module is 'ARTiCLE' and from site design setting, make content directly @@ -64,7 +64,7 @@ class layoutView extends layout $oDocumentModel = getModel('document'); $oDocument = $oDocumentModel->getDocument(0, true); - $t = Context::getLang('article_preview_title'); + $t = lang('article_preview_title'); $c = ''; for($i = 0; $i < 4; $i++) @@ -72,7 +72,7 @@ class layoutView extends layout $c .= '

'; for($j = 0; $j < 20; $j++) { - $c .= Context::getLang('article_preview_content') . ' '; + $c .= lang('article_preview_content') . ' '; } $c .= '

'; } @@ -259,7 +259,7 @@ class layoutView extends layout // if there is no module instance, error... if(!$output->data) { - throw new Exception(Context::getLang('msg_unabled_preview')); + throw new Exception(lang('msg_unabled_preview')); } $mid = current($output->data)->mid; @@ -301,7 +301,7 @@ class layoutView extends layout $oModule = $oModuleHandler->procModule(); if(!$oModule->toBool()) { - throw new Exception(Context::getLang('not_support_layout_preview')); + throw new Exception(lang('not_support_layout_preview')); } // get module html @@ -361,7 +361,7 @@ class layoutView extends layout } Context::set('layout_info', $layout_info); - Context::set('content', Context::getLang('layout_preview_content')); + Context::set('content', lang('layout_preview_content')); // Temporary save the codes $edited_layout_file = _XE_PATH_ . 'files/cache/layout/tmp.tpl'; FileHandler::writeFile($edited_layout_file, $code); diff --git a/modules/layout/tpl/faceoff_layout_menu.html b/modules/layout/tpl/faceoff_layout_menu.html index 13bc6d802..a2dc156d9 100644 --- a/modules/layout/tpl/faceoff_layout_menu.html +++ b/modules/layout/tpl/faceoff_layout_menu.html @@ -218,7 +218,7 @@ {$lang->layout_manager[38]} - + - + - + - + - + +
@@ -335,7 +335,7 @@
- +
diff --git a/modules/layout/tpl/layout_info_view.html b/modules/layout/tpl/layout_info_view.html index 780111419..98b48ef9b 100644 --- a/modules/layout/tpl/layout_info_view.html +++ b/modules/layout/tpl/layout_info_view.html @@ -129,7 +129,7 @@ {@ $use_colorpicker = true; } - +

{$var->description}

diff --git a/modules/member/conf/module.xml b/modules/member/conf/module.xml index d7d7c9550..b8670f010 100644 --- a/modules/member/conf/module.xml +++ b/modules/member/conf/module.xml @@ -32,6 +32,7 @@ + diff --git a/modules/member/lang/en.php b/modules/member/lang/en.php index f4c4940cd..e21f18402 100644 --- a/modules/member/lang/en.php +++ b/modules/member/lang/en.php @@ -63,7 +63,6 @@ $lang->allow_message_type['F'] = 'Allow for Friends only'; $lang->allow_message_type['N'] = 'Reject All'; $lang->about_allow_message = 'You may allow or reject messages.'; $lang->logged_users = 'Logged on Users'; -$lang->msg_mail_authorization = '메일 인증을 사용하려면 웸마스터의 이름과 메일주소가 유효해야 합니다.'; $lang->webmaster_name = 'Webmaster Name'; $lang->webmaster_email = 'Webmaster Email'; $lang->column_id = 'The column id'; @@ -206,7 +205,7 @@ $lang->about_profile_image = 'Members will be able to use profile images'; $lang->about_signature_max_height = 'You can limit the signature max height. Set this as 0 or leave it blank not to limit it.'; $lang->about_accept_agreement = 'I have read the agreement and agree with it'; $lang->about_member_default = 'It will be set as the default group on sign up'; -$lang->about_find_member_account = 'lease input the email address you have entered during the registration and we will send your account info to this email address.'; +$lang->about_find_member_account = 'Please input the email address you have entered during the registration and we will send your account info to this email address.'; $lang->about_ssl_port = 'Please enter if you are using non-default SSL port'; $lang->about_resend_auth_mail = 'You can request for the activation email if you have not activated yet.'; $lang->no_article = 'No articles'; diff --git a/modules/member/lang/es.php b/modules/member/lang/es.php index 45557fec6..b8901be12 100644 --- a/modules/member/lang/es.php +++ b/modules/member/lang/es.php @@ -42,18 +42,14 @@ $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->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_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['email_address'] = 'Dirección de Email'; $lang->search_target_list['regdate'] = 'Fecha del registro'; $lang->search_target_list['last_login'] = 'Fecha de su última conección'; -$lang->search_target_list['last_login_more'] = '최근로그인일시(이상)'; -$lang->search_target_list['last_login_less'] = '최근로그인일시(이하)'; $lang->search_target_list['birthday'] = 'Fecha de Nacimiento'; $lang->search_target_list['extra_vars'] = 'Variables Extra'; $lang->cmd_login = 'Conectar'; @@ -80,10 +76,7 @@ $lang->msg_cart_is_null = 'Seleciona el objetivo'; $lang->msg_checked_file_is_deleted = '%d archivos adjuntos son eliminados'; $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_auth_mail_sent = 'La autenticación de correo ha sido enviado a% s. Por favor, compruebe su correo.'; -$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_new_member = 'Agregar usuario'; $lang->msg_update_member = 'Modificar información del usuario'; @@ -102,10 +95,8 @@ $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->msg_admin_ip_not_allowed = 'Su dirección IP no se puede iniciar la sesión como administrador.'; $lang->about_user_id = 'ID del usuario debe ser entre 3-20 letras que consiste en alfabetos+número con alfabeto como primera letra.'; @@ -129,20 +120,14 @@ $lang->about_active = 'Si selecciona "Activar" los artículos seran mostrados en $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_join = 'Debe seleccionar esta opción para permitir el registro de los usuarios'; -$lang->about_enable_confirm = '입력된 메일 주소로 인증 메일을 보내 회원 가입을 확인합니다'; $lang->about_enable_find_account_question = 'Compruebe si desea permitir a los miembros a recuperar sus cuentas utilizando una pregunta y respuesta de seguridad.'; -$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_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_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->about_resend_auth_mail = 'You can request for authentication mail if you have failed before.'; -$lang->no_article = 'There exists no article'; diff --git a/modules/member/lang/fr.php b/modules/member/lang/fr.php index d3674d841..3f0dba7b0 100644 --- a/modules/member/lang/fr.php +++ b/modules/member/lang/fr.php @@ -46,7 +46,6 @@ $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->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다'; $lang->logged_users = 'Logged Users'; $lang->webmaster_name = 'Nom de Webmestre'; $lang->webmaster_email = 'Mél de Webmestre'; @@ -57,8 +56,6 @@ $lang->about_webmaster_email = 'Entrez l\'adresse du mél de webmestre, S.V.P.'; $lang->search_target_list['email_address'] = 'Mél'; $lang->search_target_list['regdate'] = 'Jour d\'Inscription'; $lang->search_target_list['last_login'] = 'Jour de la connexion dernière'; -$lang->search_target_list['last_login_more'] = '최근로그인일시(이상)'; -$lang->search_target_list['last_login_less'] = '최근로그인일시(이하)'; $lang->search_target_list['birthday'] = 'Anniversaire'; $lang->search_target_list['extra_vars'] = 'Variables additionnels '; $lang->cmd_login = 'Connexion'; @@ -115,7 +112,6 @@ $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.'; @@ -153,7 +149,6 @@ $lang->about_redirect_url = 'Entrez URL où l\'utilisateur irra après l\'inscri $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'; diff --git a/modules/member/lang/ja.php b/modules/member/lang/ja.php index 2338a3d7f..95a0165b8 100644 --- a/modules/member/lang/ja.php +++ b/modules/member/lang/ja.php @@ -190,7 +190,6 @@ $lang->about_column_name = 'テンプレートで使用できる英文字の名 $lang->about_column_title = '登録または情報修正・閲覧時に表示されるタイトルです。'; $lang->about_default_value = 'デフォルトで入力される値を指定することができます。'; $lang->about_active = '有効項目にチェックを入れないと加入時に正常に表示されません。'; -$lang->about_emailhost_check = 'Empty value will allow almost all email account providers.
You can set new member\'s e-mail address providers. You can allow or prohibit some e-mail hosts(eg.: naver.com, gmail.com).'; $lang->about_form_description = '説明欄に入力すると登録時に表示されます。'; $lang->about_required = 'チェックを入れると会員登録時に必須入力項目として設定されます。'; $lang->about_enable_join = 'チェックを入れないとユーザーが会員に登録できません。'; @@ -260,7 +259,6 @@ $lang->cmd_input_extend_form = '会員拡張項目入力'; $lang->about_multi_type = '多重または単一項目の選択値を入力してください。(改行で区別)'; $lang->msg_delete_extend_form = '選択した項目を削除します。'; $lang->set_manage_id = '改行で区別'; -$lang->count_manage_email_host = 'There are %s %s e-mail address providers below.'; $lang->count_manage_id = '%s個の禁止IDがあります。'; $lang->count_manage_nick_name = '%s個の禁止ニックネームがあります。'; $lang->user_list = '会員リスト'; @@ -281,7 +279,6 @@ $lang->multi_line_input = '複数の項目は、改行して入力してくだ $lang->add_extend_form = 'ユーザー定義項目追加'; $lang->msg_null_prohibited_id = '追加する禁止IDを入力してください。'; $lang->msg_null_prohibited_nick_name = '追加するニックネームを入力してください。'; -$lang->msg_null_managed_emailhost = 'Please enter email address providers to manage. (eg.: gmail.com)'; $lang->identifier = 'ログインアカウント'; $lang->about_identifier = 'ログインに使用するアカウントを選択してください。'; $lang->about_public_item = '本人以外に他の会員にも露出される情報なのか選択します。'; diff --git a/modules/member/lang/ru.php b/modules/member/lang/ru.php index 0b1497fbf..b9df8e47a 100644 --- a/modules/member/lang/ru.php +++ b/modules/member/lang/ru.php @@ -48,7 +48,6 @@ $lang->allow_message = 'Сообщения разрешены'; $lang->allow_message_type['Y'] = 'Разрешено всем'; $lang->allow_message_type['F'] = 'Разрешено только зарегистрированным друзьям'; $lang->allow_message_type['N'] = 'Запрещено всем'; -$lang->about_allow_message = '쪽지 허용 방법 및 대상을 지정할 수 있습니다'; $lang->logged_users = 'Logged Users'; $lang->webmaster_name = 'Имя веб-мастера'; $lang->webmaster_email = 'Email веб-мастера'; diff --git a/modules/member/lang/zh-CN.php b/modules/member/lang/zh-CN.php index cdc5fefd5..f9cf9e4b2 100644 --- a/modules/member/lang/zh-CN.php +++ b/modules/member/lang/zh-CN.php @@ -12,8 +12,6 @@ $lang->remember_user_id = '保存ID'; $lang->already_logged = '您已经登录!'; $lang->denied_user_id = '被禁止的用户名。'; $lang->denied_nick_name = '被禁止的昵称。'; -$lang->managed_email_host['allowed'] = 'Only %s e-mail accounts are allowed. (%s)'; -$lang->managed_email_host['prohibited'] = 'E-mail accounts at %s are not allowed. (%s)'; $lang->null_user_id = '请输入用户名。'; $lang->null_password = '请输入密码。'; $lang->invalid_authorization = '还没有认证!'; @@ -174,7 +172,6 @@ $lang->about_column_name = '请输入在模板中可以使用的英文名称。 $lang->about_column_title = '注册或修改/查看信息时要显示的标题。'; $lang->about_default_value = '可以设置缺省值。'; $lang->about_active = '必须选择此项后才可以正常启用。'; -$lang->about_emailhost_check = 'Empty value will allow almost all email account providers.
You can set new member\'s e-mail address providers. You can allow or prohibit some e-mail hosts(eg.: naver.com, gmail.com).'; $lang->about_form_description = '说明栏里输入的内容,注册时将会显示。'; $lang->about_required = '注册时成为必填项目。'; $lang->about_enable_join = '选择此项后用户才可以注册。'; @@ -237,7 +234,6 @@ $lang->cmd_input_extend_form = '使用者自定'; $lang->about_multi_type = '请输入单个或多个项目值。(用换行区分)'; $lang->msg_delete_extend_form = '删除所选项目'; $lang->set_manage_id = '用换行区分'; -$lang->count_manage_email_host = 'There are %s %s e-mail address providers below.'; $lang->count_manage_id = '已有 %s个禁止账号'; $lang->count_manage_nick_name = '已有 %s个禁止昵称'; $lang->user_list = '会员列表'; @@ -258,7 +254,6 @@ $lang->multi_line_input = '多各项请换行'; $lang->add_extend_form = '增加自定义项目'; $lang->msg_null_prohibited_id = '请输入禁止账号'; $lang->msg_null_prohibited_nick_name = '请输入禁止昵称'; -$lang->msg_null_managed_emailhost = 'Please enter email address providers to manage. (eg.: gmail.com)'; $lang->identifier = '登录账号'; $lang->about_identifier = '请选择账号登录方式'; $lang->about_public_item = '选择是不是除了本人别的会员也能看到'; diff --git a/modules/member/lang/zh-TW.php b/modules/member/lang/zh-TW.php index 8b168786e..3fcd0bb9c 100644 --- a/modules/member/lang/zh-TW.php +++ b/modules/member/lang/zh-TW.php @@ -10,8 +10,6 @@ $lang->keep_signed = '自動登入'; $lang->remember_user_id = '儲存帳號'; $lang->already_logged = '您已經登入!'; $lang->denied_user_id = '被禁止的帳號。'; -$lang->managed_email_host['allowed'] = 'Only %s e-mail accounts are allowed. (%s)'; -$lang->managed_email_host['prohibited'] = 'E-mail accounts at %s are not allowed. (%s)'; $lang->null_user_id = '請輸入帳號。'; $lang->null_password = '請輸入密碼。'; $lang->invalid_authorization = '還沒有認證!'; @@ -92,7 +90,6 @@ $lang->cmd_module_config = '基本設置'; $lang->cmd_member_group = '群組管理'; $lang->cmd_send_mail = '發送郵件'; $lang->cmd_manage_id = '禁止帳號'; -$lang->cmd_manage_email_host = 'E-mail provider check'; $lang->cmd_manage_form = '註冊表單管理'; $lang->cmd_view_own_document = '發表主題'; $lang->cmd_manage_member_info = '管理會員資料'; @@ -161,7 +158,6 @@ $lang->about_column_name = '請輸入在樣板中可以使用的英文名稱。( $lang->about_column_title = '註冊或修改/檢視資料時要顯示的標題。'; $lang->about_default_value = '可以設置預設值。'; $lang->about_active = '必須選擇此項後才可以正常啟用。'; -$lang->about_emailhost_check = 'Empty value will allow almost all email account providers.
You can set new member\'s e-mail address providers. You can allow or prohibit some e-mail hosts(eg.: naver.com, gmail.com).'; $lang->about_form_description = '說明欄裡輸入的內容,在註冊時會顯示。'; $lang->about_required = '註冊時成為必填項目。'; $lang->about_enable_join = '選擇此項後,用戶才可以註冊。'; @@ -206,7 +202,6 @@ $lang->msg_question_not_exists = '尚未輸入提示問答'; $lang->msg_answer_not_matches = '答案不正確'; $lang->change_password_date = '密碼更新'; $lang->about_change_password_date = '可設定密碼更新週期,將會定期通知更換密碼。 (設為零則不使用)'; -$lang->msg_kr_address = 'Search for the name of eup, myeon or dong of your address.'; $lang->msg_kr_address_etc = '請輸入住址。'; $lang->cmd_search_again = '再找一次'; $lang->msg_select_user = '請選擇一位會員進行管理。'; @@ -214,8 +209,6 @@ $lang->msg_delete_user = '刪除所選會員'; $lang->cmd_selected_user_manage = '管理所選會員'; $lang->about_change_user_group = '重新設定所選會員群組'; $lang->about_send_message = '向此會員發送通知信'; -$lang->cmd_allowed = 'Allowed'; -$lang->cmd_prohibited = 'Prohibited'; $lang->cmd_required = '必填'; $lang->cmd_optional = '選填'; $lang->cmd_image_max_width = '寬度限制'; @@ -224,7 +217,6 @@ $lang->cmd_input_extend_form = '使用者自訂'; $lang->about_multi_type = '請輸入單個或多個項目值。(換行區隔)'; $lang->msg_delete_extend_form = '刪除所選項目'; $lang->set_manage_id = '換行區隔'; -$lang->count_manage_email_host = 'There are %s %s e-mail address providers below.'; $lang->count_manage_id = '已有 %s 個禁止帳號'; $lang->user_list = '會員列表'; $lang->cmd_show_all_member = '所有會員'; @@ -238,11 +230,9 @@ $lang->add_group_image_mark = '新增群組圖標'; $lang->link_file_box = '前往檔案盒'; $lang->msg_group_delete = '刪除所選群組'; $lang->email = '電子郵件'; -$lang->add_managed_emailhost = 'Add E-mail Host'; $lang->add_prohibited_id = '新增禁止帳號'; $lang->add_extend_form = '新增自訂項目'; $lang->msg_null_prohibited_id = '請輸入禁止帳號'; -$lang->msg_null_managed_emailhost = 'Please enter email address providers to manage. (eg.: gmail.com)'; $lang->identifier = '登入帳號'; $lang->about_identifier = '請選擇帳號登入方式。'; $lang->cmd_add_group = '新增群組'; diff --git a/modules/member/m.skins/default/common_header.html b/modules/member/m.skins/default/common_header.html index 5d824928b..f882e2d41 100644 --- a/modules/member/m.skins/default/common_header.html +++ b/modules/member/m.skins/default/common_header.html @@ -3,7 +3,7 @@ \ No newline at end of file diff --git a/modules/member/m.skins/default/leave_form.html b/modules/member/m.skins/default/leave_form.html index b81eb1ee7..77698aabd 100644 --- a/modules/member/m.skins/default/leave_form.html +++ b/modules/member/m.skins/default/leave_form.html @@ -12,7 +12,7 @@
  • - +

    {$formValue}

  • diff --git a/modules/member/m.skins/default/modify_info.html b/modules/member/m.skins/default/modify_info.html index e70313449..551bdeceb 100644 --- a/modules/member/m.skins/default/modify_info.html +++ b/modules/member/m.skins/default/modify_info.html @@ -8,6 +8,10 @@ + + + + \ No newline at end of file diff --git a/modules/member/m.skins/default/modify_password.html b/modules/member/m.skins/default/modify_password.html index df0e96976..9a466f847 100644 --- a/modules/member/m.skins/default/modify_password.html +++ b/modules/member/m.skins/default/modify_password.html @@ -14,7 +14,7 @@
    • - +
    • diff --git a/modules/member/m.skins/default/signup_form.html b/modules/member/m.skins/default/signup_form.html index 62e0c1669..fffc40e05 100644 --- a/modules/member/m.skins/default/signup_form.html +++ b/modules/member/m.skins/default/signup_form.html @@ -1,5 +1,7 @@ + +

      {$lang->cmd_signup}

      @@ -58,3 +60,34 @@
      + \ No newline at end of file diff --git a/modules/member/member.admin.controller.php b/modules/member/member.admin.controller.php index ddfb69ba8..f18ec15c8 100644 --- a/modules/member/member.admin.controller.php +++ b/modules/member/member.admin.controller.php @@ -166,8 +166,7 @@ class memberAdminController extends member 'update_nickname_log' ); - $oPassword = new Password(); - if(!array_key_exists($args->password_hashing_algorithm, $oPassword->getSupportedAlgorithms())) + if(!array_key_exists($args->password_hashing_algorithm, Rhymix\Framework\Password::getSupportedAlgorithms())) { $args->password_hashing_algorithm = 'md5'; } @@ -1296,7 +1295,7 @@ class memberAdminController extends member $default_args->group_srl = $defaultGroupSrl; $output = $this->updateGroup($default_args); - $this->setMessage(Context::getLang('success_updated').' ('.Context::getLang('msg_insert_group_name_detail').')'); + $this->setMessage(lang('success_updated').' ('.lang('msg_insert_group_name_detail').')'); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispMemberAdminGroupList'); $this->setRedirectUrl($returnUrl); diff --git a/modules/member/member.admin.model.php b/modules/member/member.admin.model.php index 9bca07a60..e9930e5db 100644 --- a/modules/member/member.admin.model.php +++ b/modules/member/member.admin.model.php @@ -298,26 +298,12 @@ class memberAdminModel extends member { if ($allow_list = ($allow_list === null) ? config('admin.allow') : $allow_list) { - foreach ($allow_list as $range) - { - if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $range)) - { - return true; - } - } - return false; + return Rhymix\Framework\Filters\IpFilter::inRanges(RX_CLIENT_IP, $allow_list); } if ($deny_list = ($deny_list === null) ? config('admin.deny') : $deny_list) { - foreach ($deny_list as $range) - { - if (Rhymix\Framework\IpFilter::inRange(RX_CLIENT_IP, $range)) - { - return false; - } - } - return true; + return !Rhymix\Framework\Filters\IpFilter::inRanges(RX_CLIENT_IP, $deny_list); } return true; diff --git a/modules/member/member.admin.view.php b/modules/member/member.admin.view.php index 21e3d6ba8..954fd81da 100644 --- a/modules/member/member.admin.view.php +++ b/modules/member/member.admin.view.php @@ -129,8 +129,7 @@ class memberAdminView extends member */ public function dispMemberAdminConfig() { - $oPassword = new Password(); - Context::set('password_hashing_algos', $oPassword->getSupportedAlgorithms()); + Context::set('password_hashing_algos', Rhymix\Framework\Password::getSupportedAlgorithms()); $this->setTemplateFile('default_config'); } @@ -486,7 +485,7 @@ class memberAdminView extends member else if($formInfo->name == 'birthday') { $formTag->type = 'date'; - $inputTag = sprintf(' ', + $inputTag = sprintf(' ', $memberInfo['birthday'], zdate($memberInfo['birthday'], 'Y-m-d', false), $lang->cmd_delete); @@ -506,7 +505,7 @@ class memberAdminView extends member $val); } $inputTag = sprintf($inputTag, implode('', $optionTag)); - $inputTag .= ''; + $inputTag .= ''; } else if($formInfo->name == 'email_address') { @@ -627,7 +626,7 @@ class memberAdminView extends member else if($extendForm->column_type == 'date') { $extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete); - $template = ' '; + $template = ' '; } $replace = array_merge($extentionReplace, $replace); @@ -680,6 +679,20 @@ class memberAdminView extends member } $this->setTemplateFile('insert_join_form'); } + + function dispMemberAdminNickNameLog() + { + $page = Context::get('page'); + $output = getModel('member')->getMemberModifyNicknameLog($page); + + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('nickname_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('nick_name_log'); + } } /* End of file member.admin.view.php */ /* Location: ./modules/member/member.admin.view.php */ diff --git a/modules/member/member.class.php b/modules/member/member.class.php index 84328637d..5922c11f7 100644 --- a/modules/member/member.class.php +++ b/modules/member/member.class.php @@ -73,8 +73,7 @@ class member extends ModuleObject { if(!$config->password_hashing_algorithm) { - $oPassword = new Password(); - $config->password_hashing_algorithm = $oPassword->getBestAlgorithm(); + $config->password_hashing_algorithm = Rhymix\Framework\Password::getBestSupportedAlgorithm(); } if(!$config->password_hashing_work_factor) { @@ -110,19 +109,19 @@ class member extends ModuleObject { { // Set an administrator, regular member(group1), and associate member(group2) $group_args = new stdClass; - $group_args->title = Context::getLang('admin_group'); + $group_args->title = lang('admin_group'); $group_args->is_default = 'N'; $group_args->is_admin = 'Y'; $output = $oMemberAdminController->insertGroup($group_args); $group_args = new stdClass; - $group_args->title = Context::getLang('default_group_1'); + $group_args->title = lang('default_group_1'); $group_args->is_default = 'Y'; $group_args->is_admin = 'N'; $output = $oMemberAdminController->insertGroup($group_args); $group_args = new stdClass; - $group_args->title = Context::getLang('default_group_2'); + $group_args->title = lang('default_group_2'); $group_args->is_default = 'N'; $group_args->is_admin = 'N'; $oMemberAdminController->insertGroup($group_args); @@ -455,14 +454,14 @@ class member extends ModuleObject { { //update $content = unserialize($output->data->content); - $content[] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); + $content[] = array($_SERVER['REMOTE_ADDR'],lang($message),$_SERVER['REQUEST_TIME']); $args->content = serialize($content); $output = executeQuery('member.updateLoginCountHistoryByMemberSrl', $args); } else { //insert - $content[0] = array($_SERVER['REMOTE_ADDR'],Context::getLang($message),$_SERVER['REQUEST_TIME']); + $content[0] = array($_SERVER['REMOTE_ADDR'],lang($message),$_SERVER['REQUEST_TIME']); $args->content = serialize($content); $output = executeQuery('member.insertLoginCountHistoryByMemberSrl', $args); } diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php index c99dc0062..3de91d867 100644 --- a/modules/member/member.controller.php +++ b/modules/member/member.controller.php @@ -67,7 +67,7 @@ class memberController extends member $oMemberModel = getModel('member'); if($this->memberInfo->change_password_date < date ('YmdHis', strtotime ('-' . $limit_date . ' day'))) { - $msg = sprintf(Context::getLang('msg_change_password_date'), $limit_date); + $msg = sprintf(lang('msg_change_password_date'), $limit_date); return $this->setRedirectUrl(getNotEncodedUrl('','vid',Context::get('vid'),'mid',Context::get('mid'),'act','dispMemberModifyPassword'), new Object(-1, $msg)); } } @@ -245,7 +245,7 @@ class memberController extends member $config = $oMemberModel->getMemberConfig(); $emailhost_check = $config->emailhost_check; - $managed_email_host = Context::getLang('managed_email_host'); + $managed_email_host = lang('managed_email_host'); $email_hosts = $oMemberModel->getManagedEmailHosts(); foreach ($email_hosts as $host) @@ -301,7 +301,16 @@ class memberController extends member $args->{$val} = Context::get($val); if($val == 'birthday') $args->birthday_ui = Context::get('birthday_ui'); } - $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); + + // mobile input date format can be different + if($args->birthday !== intval($args->birthday)) + { + $args->birthday = date('Ymd', strtotime($args->birthday)); + } + else + { + $args->birthday = intval($args->birthday); + } if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); $args->find_account_answer = Context::get('find_account_answer'); @@ -313,7 +322,7 @@ class memberController extends member // check password strength if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) { - $message = Context::getLang('about_password_strength'); + $message = lang('about_password_strength'); return new Object(-1, $message[$config->password_strength]); } @@ -412,7 +421,7 @@ class memberController extends member 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); + $msg = sprintf(lang('msg_confirm_mail_sent'), $args->email_address); $this->setMessage($msg); return $this->setRedirectUrl(getUrl('', 'act', 'dispMemberLoginForm'), new Object(-12, $msg)); } @@ -535,8 +544,18 @@ class memberController extends member // Login Information $logged_info = Context::get('logged_info'); $args->member_srl = $logged_info->member_srl; - $args->birthday = intval(strtr($args->birthday, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); + + // mobile input date format can be different + if($args->birthday !== intval($args->birthday)) + { + $args->birthday = date('Ymd', strtotime($args->birthday)); + } + else + { + $args->birthday = intval($args->birthday); + } if(!$args->birthday && $args->birthday_ui) $args->birthday = intval(strtr($args->birthday_ui, array('-'=>'', '/'=>'', '.'=>'', ' '=>''))); + // Remove some unnecessary variables from all the vars $all_args = Context::getRequestVars(); unset($all_args->module); @@ -729,10 +748,6 @@ class memberController extends member */ function insertProfileImage($member_srl, $target_file) { - - // Check uploaded file - if(!checkUploadedFile($target_file)) return; - $oMemberModel = getModel('member'); $config = $oMemberModel->getMemberConfig(); @@ -808,9 +823,6 @@ class memberController extends member */ function insertImageName($member_srl, $target_file) { - // Check uploaded file - if(!checkUploadedFile($target_file)) return; - $oModuleModel = getModel('module'); $config = $oModuleModel->getModuleConfig('member'); // Get an image size @@ -917,9 +929,6 @@ class memberController extends member */ function insertImageMark($member_srl, $target_file) { - // Check uploaded file - if(!checkUploadedFile($target_file)) return; - $oModuleModel = getModel('module'); $config = $oModuleModel->getModuleConfig('member'); // Get an image size @@ -994,12 +1003,11 @@ class memberController extends member } // Insert data into the authentication DB - $oPassword = new Password(); $args = new stdClass(); $args->user_id = $member_info->user_id; $args->member_srl = $member_info->member_srl; - $args->new_password = $oPassword->createTemporaryPassword(8); - $args->auth_key = $oPassword->createSecureSalt(40); + $args->new_password = Rhymix\Framework\Password::getRandomPassword(8); + $args->auth_key = Rhymix\Framework\Security::getRandom(40, 'hex'); $args->is_register = 'N'; $output = executeQuery('member.insertAuthMail', $args); @@ -1048,13 +1056,13 @@ class memberController extends member $member_config = $oModuleModel->getModuleConfig('member'); // Send a mail $oMail = new Mail(); - $oMail->setTitle( Context::getLang('msg_find_account_title') ); + $oMail->setTitle( lang('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 message - $msg = sprintf(Context::getLang('msg_auth_mail_sent'), $member_info->email_address); + $msg = sprintf(lang('msg_auth_mail_sent'), $member_info->email_address); if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) { $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', 'dispMemberFindAccount'); @@ -1103,8 +1111,7 @@ class memberController extends member } // Update to a temporary password and set change_password_date to 1 - $oPassword = new Password(); - $temp_password = $oPassword->createTemporaryPassword(8); + $temp_password = Rhymix\Framework\Password::getRandomPassword(8); $args = new stdClass(); $args->member_srl = $member_srl; @@ -1273,13 +1280,13 @@ class memberController extends member $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); // Send a mail $oMail = new Mail(); - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); + $oMail->setTitle( lang('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(); - $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $args->email_address); + $msg = sprintf(lang('msg_confirm_mail_sent'), $args->email_address); $this->setMessage($msg); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); @@ -1333,12 +1340,11 @@ class memberController extends member $this->_clearMemberCache($args->member_srl); // generate new auth key - $oPassword = new Password(); $auth_args = new stdClass(); $auth_args->user_id = $memberInfo->user_id; $auth_args->member_srl = $memberInfo->member_srl; $auth_args->new_password = $memberInfo->password; - $auth_args->auth_key = $oPassword->createSecureSalt(40); + $auth_args->auth_key = Rhymix\Framework\Security::getRandom(40, 'hex'); $auth_args->is_register = 'Y'; $output = executeQuery('member.insertAuthMail', $auth_args); @@ -1349,7 +1355,7 @@ class memberController extends member // resend auth mail. $this->_sendAuthMail($auth_args, $memberInfo); - $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $memberInfo->email_address); + $msg = sprintf(lang('msg_confirm_mail_sent'), $memberInfo->email_address); $this->setMessage($msg); $returnUrl = getUrl(''); @@ -1401,7 +1407,7 @@ class memberController extends member $content = $oTemplate->compile($tpl_path, 'confirm_member_account_mail'); // Send a mail $oMail = new Mail(); - $oMail->setTitle( Context::getLang('msg_confirm_account_title') ); + $oMail->setTitle( lang('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 ); @@ -1720,12 +1726,12 @@ class memberController extends member if($term < $config->max_error_count_time) { $term = $config->max_error_count_time - $term; - if($term < 60) $term = intval($term).Context::getLang('unit_sec'); - elseif(60 <= $term && $term < 3600) $term = intval($term/60).Context::getLang('unit_min'); - elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).Context::getLang('unit_hour'); - else $term = intval($term/86400).Context::getLang('unit_day'); + if($term < 60) $term = intval($term).lang('unit_sec'); + elseif(60 <= $term && $term < 3600) $term = intval($term/60).lang('unit_min'); + elseif(3600 <= $term && $term < 86400) $term = intval($term/3600).lang('unit_hour'); + else $term = intval($term/86400).lang('unit_day'); - return new Object(-1, sprintf(Context::getLang('excess_ip_access_count'),$term)); + return new Object(-1, sprintf(lang('excess_ip_access_count'),$term)); } else { @@ -1751,13 +1757,13 @@ class memberController extends member $redirectUrl = getUrl('', 'act', 'dispMemberResendAuthMail'); return $this->setRedirectUrl($redirectUrl, new Object(-1,'msg_user_not_confirmed')); } - return new Object(-1, ($this->memberInfo->refused_reason)? Context::getLang('msg_user_denied') . "\n" . $this->memberInfo->refused_reason : 'msg_user_denied'); + return new Object(-1, ($this->memberInfo->refused_reason)? lang('msg_user_denied') . "\n" . $this->memberInfo->refused_reason : 'msg_user_denied'); } // Notify if user is limited if($this->memberInfo->limit_date && substr($this->memberInfo->limit_date,0,8) >= date("Ymd")) { - return new Object(-9,sprintf(Context::getLang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); + return new Object(-9,sprintf(lang('msg_user_limited'),zdate($this->memberInfo->limit_date,"Y-m-d"))); } // Do not allow login as admin if not in allowed IP list @@ -1785,17 +1791,17 @@ class memberController extends member $output = executeQuery('member.getLoginCountHistoryByMemberSrl', $args); if($output->data && $output->data->content) { - $title = Context::getLang('login_fail_report'); + $title = lang('login_fail_report'); $message = '
        '; $content = unserialize($output->data->content); if(count($content) > $config->max_error_count) { foreach($content as $val) { - $message .= '
      • '.Context::getLang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'
        • '.Context::getLang('ipaddress').': '.$val[0].'
        • '.Context::getLang('message').': '.$val[1].'
      • '; + $message .= '
      • '.lang('regdate').': '.date('Y-m-d h:i:sa',$val[2]).'
        • '.lang('ipaddress').': '.$val[0].'
        • '.lang('message').': '.$val[1].'
      • '; } $message .= '
      '; - $content = sprintf(Context::getLang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa')); + $content = sprintf(lang('login_fail_report_contents'),$message,date('Y-m-d h:i:sa')); //send message $oCommunicationController = getController('communication'); @@ -1823,8 +1829,7 @@ class memberController extends member if($keep_signed) { // Key generate for auto login - $oPassword = new Password(); - $random_key = $oPassword->createSecureSalt(32, 'hex'); + $random_key = Rhymix\Framework\Security::getRandom(32, 'hex'); $extra_key = strtolower($user_id).$this->memberInfo->password.$_SERVER['HTTP_USER_AGENT']; $extra_key = substr(hash_hmac('sha256', $extra_key, $random_key), 0, 32); $autologin_args = new stdClass; @@ -1892,7 +1897,7 @@ class memberController extends member $this->addMemberMenu( 'dispMemberScrappedDocument', 'cmd_view_scrapped_document'); $this->addMemberMenu( 'dispMemberSavedDocument', 'cmd_view_saved_document'); $this->addMemberMenu( 'dispMemberOwnDocument', 'cmd_view_own_document'); - if($config->update_nick_log == 'Y') + if($config->update_nickname_log == 'Y') { $this->addMemberMenu( 'dispMemberModifyNicknameLog', 'cmd_modify_nickname_log'); } @@ -1906,7 +1911,7 @@ class memberController extends member { $logged_info = Context::get('logged_info'); - $logged_info->menu_list[$act] = Context::getLang($str); + $logged_info->menu_list[$act] = lang($str); Context::set('logged_info', $logged_info); } @@ -1938,10 +1943,23 @@ class memberController extends member $output = ModuleHandler::triggerCall('member.insertMember', 'before', $args); if(!$output->toBool()) return $output; // Terms and Conditions portion of the information set up by members reaffirmed - $oModuleModel = getModel('module'); - $config = $oModuleModel->getModuleConfig('member'); + $oMemberModel = getModel('member'); + $config = $oMemberModel->getMemberConfig(); $logged_info = Context::get('logged_info'); + // limit_date format is YYYYMMDD + if($args->limit_date) + { + // mobile input date format can be different + if($args->limit_date !== intval($args->limit_date)) + { + $args->limit_date = date('Ymd', strtotime($args->limit_date)); + } + else + { + $args->limit_date = intval($args->limit_date); + } + } // If the date of the temporary restrictions limit further information on the date of if($config->limit_day) $args->limit_date = date("YmdHis", $_SERVER['REQUEST_TIME']+$config->limit_day*60*60*24); @@ -1980,6 +1998,49 @@ class memberController extends member 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; + + $extend_form_list = $oMemberModel->getCombineJoinForm($memberInfo); + $security = new Security($extend_form_list); + $security->encodeHTML('..column_title', '..description', '..default_value.'); + if($config->signupForm) { + foreach($config->signupForm as $no => $formInfo) + { + if(!$formInfo->isUse) continue; + if($formInfo->isDefaultForm) + { + // birthday format is YYYYMMDD + if($formInfo->name === 'birthday' && $args->{$formInfo->name}) + { + // mobile input date format can be different + if($args->{$formInfo->name} !== intval($args->{$formInfo->name})) + { + $args->{$formInfo->name} = date('Ymd', strtotime($args->{$formInfo->name})); + } + else + { + $args->{$formInfo->name} = intval($args->{$formInfo->name}); + } + } + } + else + { + $extendForm = $extend_form_list[$formInfo->member_join_form_srl]; + // date format is YYYYMMDD + if($extendForm->column_type == 'date' && $args->{$formInfo->name}) + { + if($args->{$formInfo->name} !== intval($args->{$formInfo->name})) + { + $args->{$formInfo->name} = date('Ymd', strtotime($args->{$formInfo->name})); + } + else + { + $args->{$formInfo->name} = intval($args->{$formInfo->name}); + } + } + } + } + } + // Create a model object $oMemberModel = getModel('member'); @@ -1988,7 +2049,7 @@ class memberController extends member { if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) { - $message = Context::getLang('about_password_strength'); + $message = lang('about_password_strength'); return new Object(-1, $message[$config->password_strength]); } $args->password = $oMemberModel->hashPassword($args->password); @@ -2030,7 +2091,7 @@ class memberController extends member $config = $oMemberModel->getMemberConfig(); $emailhost_check = $config->emailhost_check; - $managed_email_host = Context::getLang('managed_email_host'); + $managed_email_host = lang('managed_email_host'); $email_hosts = $oMemberModel->getManagedEmailHosts(); foreach ($email_hosts as $host) { @@ -2096,17 +2157,15 @@ class memberController extends member } } - $member_config = $oModuleModel->getModuleConfig('member'); // When using email authentication mode (when you subscribed members denied a) certified mail sent if($args->denied == 'Y') { // Insert data into the authentication DB - $oPassword = new Password(); $auth_args = new stdClass(); $auth_args->user_id = $args->user_id; $auth_args->member_srl = $args->member_srl; $auth_args->new_password = $args->password; - $auth_args->auth_key = $oPassword->createSecureSalt(40); + $auth_args->auth_key = Rhymix\Framework\Security::getRandom(40, 'hex'); $auth_args->is_register = 'Y'; $output = executeQuery('member.insertAuthMail', $auth_args); @@ -2146,6 +2205,7 @@ class memberController extends member if(!$output->toBool()) return $output; // Create a model object $oMemberModel = getModel('member'); + $config = $oMemberModel->getMemberConfig(); $logged_info = Context::get('logged_info'); // Get what you want to modify the original information @@ -2180,7 +2240,62 @@ class memberController extends member if($args->blog && !preg_match("/^[a-z]+:\/\//is",$args->blog)) $args->blog = 'http://'.$args->blog; // check member identifier form - $config = $oMemberModel->getMemberConfig(); + + // limit_date format is YYYYMMDD + if($args->limit_date) + { + // mobile input date format can be different + if($args->limit_date !== intval($args->limit_date)) + { + $args->limit_date = date('Ymd', strtotime($args->limit_date)); + } + else + { + $args->limit_date = intval($args->limit_date); + } + } + + $extend_form_list = $oMemberModel->getCombineJoinForm($memberInfo); + $security = new Security($extend_form_list); + $security->encodeHTML('..column_title', '..description', '..default_value.'); + if($config->signupForm){ + foreach($config->signupForm as $no => $formInfo) + { + if(!$formInfo->isUse) continue; + + if($formInfo->isDefaultForm) + { + // birthday format is YYYYMMDD + if($formInfo->name === 'birthday' && $args->{$formInfo->name}) + { + if($args->{$formInfo->name} !== intval($args->{$formInfo->name})) + { + $args->{$formInfo->name} = date('Ymd', strtotime($args->{$formInfo->name})); + } + else + { + $args->{$formInfo->name} = intval($args->{$formInfo->name}); + } + } + } + else + { + $extendForm = $extend_form_list[$formInfo->member_join_form_srl]; + // date format is YYYYMMDD + if($extendForm->column_type == 'date' && $args->{$formInfo->name}) + { + if($args->{$formInfo->name} !== intval($args->{$formInfo->name})) + { + $args->{$formInfo->name} = date('Ymd', strtotime($args->{$formInfo->name})); + } + else + { + $args->{$formInfo->name} = intval($args->{$formInfo->name}); + } + } + } + } + } $output = executeQuery('member.getMemberInfoByMemberSrl', $args); $orgMemberInfo = $output->data; @@ -2191,7 +2306,7 @@ class memberController extends member $config = $oMemberModel->getMemberConfig(); $emailhost_check = $config->emailhost_check; - $managed_email_host = Context::getLang('managed_email_host'); + $managed_email_host = lang('managed_email_host'); $email_hosts = $oMemberModel->getManagedEmailHosts(); foreach ($email_hosts as $host) { @@ -2261,7 +2376,7 @@ class memberController extends member { if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) { - $message = Context::getLang('about_password_strength'); + $message = lang('about_password_strength'); return new Object(-1, $message[$config->password_strength]); } $args->password = $oMemberModel->hashPassword($args->password); @@ -2286,7 +2401,7 @@ class memberController extends member } else { - if($args->nick_name != $orgMemberInfo->nick_name && $config->update_nick_log == 'Y') + if($args->nick_name != $orgMemberInfo->nick_name && $config->update_nickname_log == 'Y') { $log_args = new stdClass(); $log_args->member_srl = $args->member_srl; @@ -2364,7 +2479,7 @@ class memberController extends member if(!$oMemberModel->checkPasswordStrength($args->password, $config->password_strength)) { - $message = Context::getLang('about_password_strength'); + $message = lang('about_password_strength'); return new Object(-1, $message[$config->password_strength]); } @@ -2542,7 +2657,7 @@ class memberController extends member $config = $oMemberModel->getMemberConfig(); $emailhost_check = $config->emailhost_check; - $managed_email_host = Context::getLang('managed_email_host'); + $managed_email_host = lang('managed_email_host'); $email_hosts = $oMemberModel->getManagedEmailHosts(); foreach ($email_hosts as $host) { @@ -2562,11 +2677,10 @@ class memberController extends member } unset($_SESSION['rechecked_password_step']); - $oPassword = new Password(); $auth_args = new stdClass(); $auth_args->user_id = $newEmail; $auth_args->member_srl = $member_info->member_srl; - $auth_args->auth_key = $oPassword->createSecureSalt(40); + $auth_args->auth_key = Rhymix\Framework\Security::getRandom(40, 'hex'); $auth_args->new_password = 'XE_change_emaill_address'; $oDB = &DB::getInstance(); @@ -2601,13 +2715,13 @@ class memberController extends member $content = $oTemplate->compile($tpl_path, 'confirm_member_new_email'); $oMail = new Mail(); - $oMail->setTitle( Context::getLang('title_modify_email_address') ); + $oMail->setTitle( lang('title_modify_email_address') ); $oMail->setContent($content); $oMail->setSender( $member_config->webmaster_name?$member_config->webmaster_name:'webmaster', $member_config->webmaster_email); $oMail->setReceiptor( $member_info->nick_name, $newEmail ); $result = $oMail->send(); - $msg = sprintf(Context::getLang('msg_confirm_mail_sent'), $newEmail); + $msg = sprintf(lang('msg_confirm_mail_sent'), $newEmail); $this->setMessage($msg); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'mid', Context::get('mid'), 'act', ''); @@ -2803,7 +2917,7 @@ class memberController extends member $args->description = trim( $member_info->description ); if( $args->description != "" ) $args->description .= "\n"; // add new line - $args->description .= Context::getLang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]"; + $args->description .= lang('cmd_spammer') . "[" . date("Y-m-d H:i:s") . " from:" . $logged_info->user_id . " info:" . $spam_description . " docuemnts count:" . $total_count . "]"; $output = $this->updateMember($args, true); diff --git a/modules/member/member.model.php b/modules/member/member.model.php index fd72ef1ce..dc7d6aed4 100644 --- a/modules/member/member.model.php +++ b/modules/member/member.model.php @@ -44,7 +44,7 @@ class memberModel extends member //for multi language foreach($config->signupForm AS $key=>$value) { - $config->signupForm[$key]->title = ($value->isDefaultForm) ? Context::getLang($value->name) : $value->title; + $config->signupForm[$key]->title = ($value->isDefaultForm) ? lang($value->name) : $value->title; if($config->signupForm[$key]->isPublic != 'N') $config->signupForm[$key]->isPublic = 'Y'; if($value->name == 'find_account_question') $config->signupForm[$key]->isPublic = 'N'; } @@ -155,10 +155,14 @@ class memberModel extends member } // Send an email only if email address is public - if(($logged_info->is_admin == 'Y' || $email_config->isPublic == 'Y') && $member_info->email_address) + if($email_config->isPublic == 'Y' && $member_info->email_address) { - $url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); - $oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path); + $oCommunicationModel = getModel('communication'); + if($logged_info->is_admin == 'Y' || $oCommunicationModel->isFriend($member_info->member_srl)) + { + $url = 'mailto:'.htmlspecialchars($member_info->email_address, ENT_COMPAT | ENT_HTML401, 'UTF-8', false); + $oMemberController->addMemberPopupMenu($url,'cmd_send_email',$icon_path); + } } } // View homepage info @@ -186,7 +190,7 @@ class memberModel extends member $menus_count = count($menus); for($i=0;$i<$menus_count;$i++) { - $menus[$i]->str = Context::getLang($menus[$i]->str); + $menus[$i]->str = lang($menus[$i]->str); } // Get a list of finalized pop-up menu $this->add('menus', $menus); @@ -1047,6 +1051,14 @@ class memberModel extends member $info->title = $group_info->title; $info->description = $group_info->description; $info->src = $group_info->image_mark; + if(preg_match('@^https?://@', $info->src)) + { + $localpath = str_replace('/./', '/', parse_url($info->src, PHP_URL_PATH)); + if(file_exists($_SERVER['DOCUMENT_ROOT'] . $localpath)) + { + $info->src = $localpath . '?' . date('YmdHis', filemtime($_SERVER['DOCUMENT_ROOT'] . $localpath)); + } + } $GLOBALS['__member_info__']['group_image_mark'][$member_srl] = $info; break; } @@ -1095,10 +1107,19 @@ class memberModel extends member } // Check the password - $oPassword = new Password(); - $current_algorithm = $oPassword->checkAlgorithm($hashed_password); - $match = $oPassword->checkPassword($password_text, $hashed_password, $current_algorithm); - if(!$match) + $password_match = false; + $current_algorithm = false; + $possible_algorithms = Rhymix\Framework\Password::checkAlgorithm($hashed_password); + foreach ($possible_algorithms as $algorithm) + { + if (Rhymix\Framework\Password::checkPassword($password_text, $hashed_password, $algorithm)) + { + $password_match = true; + $current_algorithm = $algorithm; + break; + } + } + if (!$password_match) { return false; } @@ -1107,22 +1128,26 @@ class memberModel extends member $config = $this->getMemberConfig(); if($member_srl > 0 && $config->password_hashing_auto_upgrade != 'N') { - $need_upgrade = false; - - if(!$need_upgrade) + $required_algorithm = Rhymix\Framework\Password::getDefaultAlgorithm(); + if ($required_algorithm !== $current_algorithm) { - $required_algorithm = $oPassword->getCurrentlySelectedAlgorithm(); - if($required_algorithm !== $current_algorithm) $need_upgrade = true; + $need_upgrade = true; + } + else + { + $required_work_factor = Rhymix\Framework\Password::getWorkFactor(); + $current_work_factor = Rhymix\Framework\Password::checkWorkFactor($hashed_password); + if ($current_work_factor !== false && $required_work_factor > $current_work_factor) + { + $need_upgrade = true; + } + else + { + $need_upgrade = false; + } } - if(!$need_upgrade) - { - $required_work_factor = $oPassword->getWorkFactor(); - $current_work_factor = $oPassword->checkWorkFactor($hashed_password); - if($current_work_factor !== false && $required_work_factor > $current_work_factor) $need_upgrade = true; - } - - if($need_upgrade === true) + if ($need_upgrade) { $args = new stdClass(); $args->member_srl = $member_srl; @@ -1143,8 +1168,7 @@ class memberModel extends member */ function hashPassword($password_text, $algorithm = null) { - $oPassword = new Password(); - return $oPassword->createHash($password_text, $algorithm); + return Rhymix\Framework\Password::hashPassword($password_text, $algorithm); } function checkPasswordStrength($password, $strength) @@ -1194,6 +1218,16 @@ class memberModel extends member } return $groupSrl; } + + function getMemberModifyNicknameLog($page = 1, $member_srl = null) + { + $args = new stdClass(); + $args->member_srl = $member_srl; + $args->page = $page; + $output = executeQueryArray('member.getMemberModifyNickName', $args); + + return $output; + } } /* End of file member.model.php */ /* Location: ./modules/member/member.model.php */ diff --git a/modules/member/member.view.php b/modules/member/member.view.php index 687dd1cc9..9cae49896 100644 --- a/modules/member/member.view.php +++ b/modules/member/member.view.php @@ -84,9 +84,9 @@ class memberView extends member if($logged_info->is_admin != 'Y' && ($member_info->member_srl != $logged_info->member_srl)) { - $start = strpos($member_info->email_address, '@')+1; - $replaceStr = str_repeat('*', (strlen($member_info->email_address) - $start)); - $member_info->email_address = substr_replace($member_info->email_address, $replaceStr, $start); + list($email_id, $email_host) = explode('@', $member_info->email_address); + $protect_id = substr($email_id, 0, 2) . str_repeat('*', strlen($email_id)-2); + $member_info->email_address = sprintf('%s@%s', $protect_id, $email_host); } if(!$member_info->member_srl) return $this->dispMemberSignUpForm(); @@ -128,7 +128,7 @@ class memberView extends member if($formInfo->isDefaultForm) { - $item->title = Context::getLang($formInfo->name); + $item->title = lang($formInfo->name); $item->value = $memberInfo->{$formInfo->name}; if($formInfo->name == 'profile_image' && $memberInfo->profile_image) @@ -265,12 +265,12 @@ class memberView extends member if ($this->member_config->identifier == 'email_address') { - Context::set('identifierTitle', Context::getLang('email_address')); + Context::set('identifierTitle', lang('email_address')); Context::set('identifierValue', $logged_info->email_address); } else { - Context::set('identifierTitle', Context::getLang('user_id')); + Context::set('identifierTitle', lang('user_id')); Context::set('identifierValue', $logged_info->user_id); } @@ -709,10 +709,8 @@ class memberView extends member } } - $args = new stdClass(); - $args->member_srl = $member_srl; - $args->page = Context::get('page'); - $output = executeQuery('member.getMemberModifyNickName', $args); + $page = Context::get('page'); + $output = getModel('member')->getMemberModifyNicknameLog($page, $member_srl); Context::set('total_count', $output->page_navigation->total_count); Context::set('total_page', $output->page_navigation->total_page); diff --git a/modules/member/queries/getMemberModifyNickName.xml b/modules/member/queries/getMemberModifyNickName.xml index 3dea7f6bb..ded6b8b64 100644 --- a/modules/member/queries/getMemberModifyNickName.xml +++ b/modules/member/queries/getMemberModifyNickName.xml @@ -6,12 +6,12 @@ - + - + - \ No newline at end of file + diff --git a/modules/member/skins/default/common_header.html b/modules/member/skins/default/common_header.html index 7a755d48d..6d930eaf4 100644 --- a/modules/member/skins/default/common_header.html +++ b/modules/member/skins/default/common_header.html @@ -4,6 +4,6 @@
      diff --git a/modules/member/skins/default/leave_form.html b/modules/member/skins/default/leave_form.html index db2653ed4..839f941e5 100644 --- a/modules/member/skins/default/leave_form.html +++ b/modules/member/skins/default/leave_form.html @@ -11,7 +11,7 @@
      - +
      diff --git a/modules/member/skins/default/modify_info.html b/modules/member/skins/default/modify_info.html index f09eefd3a..ced6dae08 100644 --- a/modules/member/skins/default/modify_info.html +++ b/modules/member/skins/default/modify_info.html @@ -66,16 +66,33 @@ jQuery(function($){ }); }); (function($){ - $(function(){ - var option = { changeMonth: true, changeYear: true, gotoCurrent: false,yearRange:'-100:+10', dateFormat:'yy-mm-dd', onSelect:function(){ - $(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,""))} - }; - $.extend(option,$.datepicker.regional['{$lang_type}']); - $(".inputDate").datepicker(option); + $(function(){ + // check if the browser support type date. + if ( $(".inputDate").prop('type') != 'date' ) { + var option = { + changeMonth: true, + changeYear: true, + gotoCurrent: false, + yearRange:'-200:+10', + dateFormat:'yy-mm-dd', + defaultDate: new Date("{date('Y-m-d',time())}"), + minDate: new Date("{date('Y-m-d',strtotime('-200 years'))}"), + + onSelect:function(){ + $(this).prev('input[type="hidden"]').val(this.value.replace(/-/g,"")) + } + }; + $.extend($.datepicker.regional['{$lang_type}'],option); + + //if the browser does not support type date input, start datepicker. If it does, brower's UI will show their datepicker. + $(".inputDate").datepicker(option); + } else { + $(".inputDate").prop('readonly', false); + } $(".dateRemover").click(function() { $(this).prevAll('input').val(''); return false;}); - }); + }); })(jQuery); diff --git a/modules/member/skins/default/modify_password.html b/modules/member/skins/default/modify_password.html index ff1940b9b..09fbb12b2 100644 --- a/modules/member/skins/default/modify_password.html +++ b/modules/member/skins/default/modify_password.html @@ -12,7 +12,7 @@
      - +
      diff --git a/modules/member/skins/default/signup_form.html b/modules/member/skins/default/signup_form.html index cc6788c4e..b3d464d38 100644 --- a/modules/member/skins/default/signup_form.html +++ b/modules/member/skins/default/signup_form.html @@ -72,7 +72,7 @@
      - + \ No newline at end of file diff --git a/modules/member/tpl/group_list.html b/modules/member/tpl/group_list.html index 1ff21815f..c053d616d 100644 --- a/modules/member/tpl/group_list.html +++ b/modules/member/tpl/group_list.html @@ -92,6 +92,13 @@

      {$lang->group_image_mark} {$lang->cmd_setup}

      +

      {$lang->usable_group_image_mark_list}

      diff --git a/modules/member/tpl/header.html b/modules/member/tpl/header.html index 98dba615e..cf2d0a07e 100644 --- a/modules/member/tpl/header.html +++ b/modules/member/tpl/header.html @@ -10,6 +10,7 @@
    • {$lang->cmd_signup}
    • {$lang->cmd_login}
    • {$lang->cmd_set_design_info}
    • +
    • {$lang->cmd_modify_nickname_log}
    diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.black.css b/modules/ncenterlite/m.skins/default/ncenterlite.black.css new file mode 100644 index 000000000..6f2596f91 --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.black.css @@ -0,0 +1,15 @@ +#nc_container { border-bottom-color:#555; background-color:#333; color:#B0B0B0; opacity:0.95; } +#nc_container a { color:#B0B0B0; } +#nc_container a:hover { color:#B0B0B0; } +#nc_container strong { color:#F3F3F3; } + +#nc_container .list { background-color:#333; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#555; } +#nc_container .list li a:hover { background-color:#555; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list .more { background: #555; } +#nc_container a.readall { display:none; color:#555; color:#D83722;} + +#nc_container a.notify { color:white; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.blacknoprofile.css b/modules/ncenterlite/m.skins/default/ncenterlite.blacknoprofile.css new file mode 100644 index 000000000..88c94a4a4 --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.blacknoprofile.css @@ -0,0 +1,17 @@ +#nc_container { border-bottom-color:#555; background-color:#333; color:#B0B0B0; opacity:0.95; } +#nc_container a { color:#B0B0B0; } +#nc_container a:hover { color:#B0B0B0; } +#nc_container strong { color:#F3F3F3; } + +#nc_container .list { background-color:#333; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#555; } +#nc_container .list li a:hover { background-color:#555; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list .more { background: #555; } +#nc_container a.readall { display:none; color:#555; color:#D83722;} + +#nc_container a.notify { color:white; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.css b/modules/ncenterlite/m.skins/default/ncenterlite.css new file mode 100644 index 000000000..60df8e548 --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.css @@ -0,0 +1,185 @@ +#nc_container { + z-index:99; + position:fixed; + top:0; + left:0; + margin:0; + padding:0; + width:100%; + height:30px; + border-bottom:1px solid; + font-size:12px; + line-height:15px; +} + +.ncenterlite_block { + height:28px; +} + +#nc_container a { + padding:0; + font-size:12px; + text-decoration:none; +} + +#nc_container ul.nc_memu { + display:block; + margin:0; + padding:4px; + list-style:none; + line-height:20px; +} + +#nc_container ul:after { + content:""; + display:block; + clear:both; +} + +#nc_container ul.nc_memu li { + display:inline-block; + padding:0 5px; + height:20px; + width:auto; + background:transparent!important; +} + +#nc_container ul.nc_memu li.fLeft { + float:left; +} + +#nc_container ul.nc_memu li.fRight { + float:right; +} + +#nc_container ul.nc_memu li a.notify { + display:block; + float:left; +} + +#nc_container a.close { + display:block; +} + +#nc_container .nc_profile img { + width:20px; + height:20px; + vertical-align:top; +} + +#nc_container a.notify .num { + padding:1px 2px; + border:0; + border-radius:3px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + font-size:12px; + font-weight:700; + font-family:Gulim,"lucida grande",tahoma,verdana,arial,sans-serif; +} + +#nc_container .list { + display:none; + position:absolute; + top:30px; + left:0; + max-width:330px; + width:330px; + box-sizing:border-box; + -moz-box-sizing:border-box; + -webkit-box-sizing:border-box; + -o-box-sizing:border-box; +} + +#nc_container a.readall { + display:none; + float:left; + margin:0 4px; + font-size:11px; + font-weight:700; +} + +#nc_container .listscroll { + overflow-y:auto; + overflow-x:hidden; +} + +#nc_container .list ul { + overflow:hidden; + margin:-1px 0; + padding:0; + list-style:none; +} + +#nc_container .list li { + margin:-1px 0; + border:1px solid #555; + border-width:1px 0; +} + +#nc_container .list li img { + float:left; + margin-right:5px; + width:45px; + height:45px; + border:0; +} + +#nc_container .list li a { + display:block; + overflow:hidden; + padding:10px; + font-size:12px; +} + +#nc_container .list span.ago { + display:block; + font-size:10px; +} + +#nc_container .list .more { + display:block; + padding:10px; + text-align:center; +} + +#nc_container ~ .navbar.navbar-fixed-top { + top:28px; +} + +#nc_container a:hover,#nc_container .list li a:hover,#nc_container .list .more:hover { + text-decoration:none; +} + +@media only screen and max-device-width 480px { + #nc_container { + position:relative; + height:auto; + } + + #nc_container .list { + top:2px; + position:relative; + } + + #nc_container .list ul { + display:block; + position:relative; + } + + #nc_container ul.nc_memu:after { + content:""; + display:block; + visibility:hidden; + height:0; + clear:both; + } + + #nc_container .listscroll { + overflow:visible; + } + + .ncenterlite_block { + display:none; + } +} diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.gray.css b/modules/ncenterlite/m.skins/default/ncenterlite.gray.css new file mode 100644 index 000000000..4d167ea21 --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.gray.css @@ -0,0 +1,16 @@ +#nc_container { border-bottom-color:#C0C0C0; background-color:#efefef; color:#666; opacity:0.95; } +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#666; } +#nc_container a.notify strong { color:#FC2772; } +#nc_container .list { background-color:#efefef; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#ddd; } +#nc_container .list li a:hover { background-color: #ddd; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify sup.num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #ddd; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.graynoprofile.css b/modules/ncenterlite/m.skins/default/ncenterlite.graynoprofile.css new file mode 100644 index 000000000..d8704070b --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.graynoprofile.css @@ -0,0 +1,18 @@ +#nc_container { border-bottom-color:#C0C0C0; background-color:#efefef; color:#666; opacity:0.95; } +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#666; } +#nc_container a.notify strong { color:#FC2772; } +#nc_container .list { background-color:#efefef; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#ddd; } +#nc_container .list li a:hover { background-color: #ddd; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify sup.num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #ddd; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.html b/modules/ncenterlite/m.skins/default/ncenterlite.html new file mode 100644 index 000000000..07c776b5d --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.html @@ -0,0 +1,122 @@ + +
    + + diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.mobile.css b/modules/ncenterlite/m.skins/default/ncenterlite.mobile.css new file mode 100644 index 000000000..ef3125177 --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.mobile.css @@ -0,0 +1,12 @@ +#nc_container { height:auto; position:relative; } +#nc_container .list { top:2px; position:relative; } +#nc_container .list ul { display:block; position:relative; } +#nc_container ul.nc_memu:after { + content: ""; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +#nc_container .listscroll { overflow: visible; } +.ncenterlite_block { display:none; } diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.white.css b/modules/ncenterlite/m.skins/default/ncenterlite.white.css new file mode 100644 index 000000000..c3fd4444a --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.white.css @@ -0,0 +1,16 @@ +#nc_container { border:1px solid #efefef; background-color:#fff; color:#000; opacity:0.95; } +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#000; } +#nc_container a.notify strong { color:#F60; } +#nc_container .list { border:1px solid #efefef; background-color:#fff; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#eee; } +#nc_container .list li a:hover { background-color: #eee; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify .num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #eee; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/m.skins/default/ncenterlite.whitenoprofile.css b/modules/ncenterlite/m.skins/default/ncenterlite.whitenoprofile.css new file mode 100644 index 000000000..69342bd1d --- /dev/null +++ b/modules/ncenterlite/m.skins/default/ncenterlite.whitenoprofile.css @@ -0,0 +1,18 @@ +#nc_container { border:1px solid #efefef; background-color:#fff; color:#000; opacity:0.95; } +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#000; } +#nc_container a.notify strong { color:#F60; } +#nc_container .list { border:1px solid #efefef; background-color:#fff; filter:alpha(opacity=97); opacity:0.97; -moz-opacity:0.97; } +#nc_container .list li { border-color:#eee; } +#nc_container .list li a:hover { background-color: #eee; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify .num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #eee; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/m.skins/default/notify.css b/modules/ncenterlite/m.skins/default/notify.css new file mode 100644 index 000000000..0c6e55f3d --- /dev/null +++ b/modules/ncenterlite/m.skins/default/notify.css @@ -0,0 +1,97 @@ +@charset "utf-8"; + +.sosi-title { + position: relative; + font-size: 16px; + font-style: bold; + display: block; + margin: 14px 0 14px 14px; + width: auto; +} + + +.history-list { + margin: 0 0 22px 0px; +} + +.history-list .history-item { + position: relative; + padding: 4px 0 4px 14px; + border-top: 1px solid #ececec; + overflow: hidden; + +} + +.history-list .history-info { +padding: 0 11px 9px 0; +} + +.history-list .history-info .history-gird{ + color: #252525; + font-size: 14px; + line-height: 16px; + font-weight: bold; + margin-top: 9px; + display:block; +} + +.text-ellipsis { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.history-list .history-info .history-gird .history-succeed{ + color:#3c763d +} +.history-list .history-info .history-gird .history-failed{ + color:#a94442 +} +.history-list .history-text{ + color: #252525; + font-size: 11px; + line-height: 16px; +} +.history-list .history-text .history-ip{ + color: #8A8D99; + font-size: 12px; +} + +.history-list .history-text .history-auth{ + color: #8A8D99; + margin-left:3px; +} + + +html{color:#000;background:#fff;} +legend{color:#000;} +html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,ul,li,ol,dl,dt,dd,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;} +abbr,acronym,address,caption,cite,code,dfn,em,strong,th,var,h1,h2,h3,h4,h5,h6{font-style:normal;font-weight:normal;font-variant:normal;} + + + +body{line-height:1; color: #333; font: normal normal normal 13px/1.5 'Helvetica Neue', Helvetica, Arial, sans-serif;} +ol,ul,li{list-style:none;} + + + + + +html {margin: 0; padding: 0; border: 0; overflow: auto; background-color: #f4f4f4;} +body, .default-font {font: normal normal normal 12px/16px 'Helvetica Neue', Helvetica, Arial, sans-serif;} +body, .default-color {color: #3b3b3b;} +body, .default-background-color {background-color: #fff;} +table {font-size: inherit; font: 100%;} + +h1, h2, h3, h4, h5, h6 {margin: 0; font-weight: bold;} +h1 {font-size: 36px; line-height: 45px;} +h2 {font-size: 24px; line-height: 30px;} +h3 {font-size: 18px; line-height: 22px;} +h4 {font-size: 16px; line-height: 20px;} +h5 {font-size: 14px; line-height: 18px;} +h6 {font-size: 12px; line-height: 16px;} + +.cfix { zoom:1 } +.cfix:after { content: '.'; display:block; clear:both; visibility:hidden; line-height:0; height:0; overflow: hidden; } +strong, .bold {font-weight: bold;} +a { text-decoration:none; color:#1769FF;} diff --git a/modules/ncenterlite/m.skins/default/skin.xml b/modules/ncenterlite/m.skins/default/skin.xml new file mode 100644 index 000000000..bc4725b2d --- /dev/null +++ b/modules/ncenterlite/m.skins/default/skin.xml @@ -0,0 +1,32 @@ + + + XE 알림센터 Lite 기본스킨 + 1.1.1 + 2013-03-21 + + + XE Magazine + + + + + 검은색 + + + 회색 + + + 흰색 + + + + 검은색(no profile) + + + 회색(no profile) + + + 흰색(no profile) + + + diff --git a/modules/ncenterlite/m.skins/default/userconfig.html b/modules/ncenterlite/m.skins/default/userconfig.html new file mode 100644 index 000000000..fae62dae5 --- /dev/null +++ b/modules/ncenterlite/m.skins/default/userconfig.html @@ -0,0 +1,66 @@ + +
    + +
    +

    {$XE_VALIDATOR_MESSAGE}

    +
    + + +
    + + + + +
    +

    {@$user_str = $member_info->nick_name} + {@$user_str = $logged_info->nick_name} + {@$title_str = Context::getLang('ncenterlite_userconfig_title')} + {sprintf($title_str, $user_str)} +

    + +

    {$lang->ncenterlite_userconfig_about} ({$lang->ncenterlite_userconfig_about_warning})

    +
    + +
    + + +

    {$lang->ncenterlite_comment_noti_about}

    +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_mention_noti_about}

    +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_message_noti_about}

    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    \ No newline at end of file diff --git a/modules/ncenterlite/ncenterlite.admin.controller.php b/modules/ncenterlite/ncenterlite.admin.controller.php new file mode 100644 index 000000000..5c5b57c61 --- /dev/null +++ b/modules/ncenterlite/ncenterlite.admin.controller.php @@ -0,0 +1,155 @@ +getConfig(); + + $config_vars = array( + 'use', + 'display_use', + 'user_config_list', + 'mention_format', + 'mention_names', + 'document_notify', + 'hide_module_srls', + 'mention_format', + 'admin_notify_module_srls', + 'skin', + 'mskin', + 'mcolorset', + 'colorset', + 'zindex', + 'anonymous_name', + 'document_read', + 'layout_srl', + 'mlayout_srl', + 'document_notify' + ); + if(!$obj->use && $obj->disp_act == 'dispNcenterliteAdminConfig') + { + $config->use = array(); + } + foreach($config_vars as $val) + { + if($obj->{$val}) + { + $config->{$val} = $obj->{$val}; + } + if($obj->disp_act == 'dispNcenterliteAdminConfig' && !$obj->anonymous_name) + { + $config->anonymous_name = null; + } + if($obj->disp_act == 'dispNcenterliteAdminConfig' && !$obj->mention_format) + { + $config->mention_format = array(); + } + if($obj->disp_act == 'dispNcenterliteAdminSeletedmid' && !$obj->hide_module_srls) + { + $config->hide_module_srls = array(); + } + if($obj->disp_act == 'dispNcenterliteAdminSeletedmid' && !$obj->admin_notify_module_srls) + { + $config->admin_notify_module_srls = array(); + } + } + $output = $oModuleController->updateModuleConfig('ncenterlite', $config); + if(!$output->toBool()) + { + return new Object(-1, 'ncenterlite_msg_setting_error'); + } + + $this->setMessage('success_updated'); + + if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) + { + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', $obj->disp_act); + header('location: ' . $returnUrl); + return; + } + } + + /** + * @brief 스킨 테스트를 위한 더미 데이터 생성 5개 생성 + **/ + function procNcenterliteAdminInsertDummyData() + { + $oNcenterliteController = getController('ncenterlite'); + $logged_info = Context::get('logged_info'); + + for($i = 1; $i <= 5; $i++) + { + $args = new stdClass(); + $args->member_srl = $logged_info->member_srl; + $args->srl = 1; + $args->target_srl = 1; + $args->type = $this->_TYPE_TEST; + $args->target_type = $this->_TYPE_TEST; + $args->target_url = getUrl(''); + $args->target_summary = Context::getLang('ncenterlite_thisistest') . rand(); + $args->target_nick_name = $logged_info->nick_name; + $args->regdate = date('YmdHis'); + $args->notify = $oNcenterliteController->_getNotifyId($args); + $output = $oNcenterliteController->_insertNotify($args); + } + } + + /** + * @brief 모듈 푸시 테스트를 위한 더미 데이터 생성 1개 생성 + **/ + function procNcenterliteAdminInsertPushData() + { + $oNcenterliteController = getController('ncenterlite'); + $logged_info = Context::get('logged_info'); + + $args = new stdClass(); + $args->member_srl = $logged_info->member_srl; + $args->srl = 1; + $args->target_srl = 1; + $args->type = $this->_TYPE_DOCUMENT; + $args->target_type = $this->_TYPE_COMMENT; + $args->target_url = getUrl(''); + $args->target_summary = Context::getLang('ncenterlite_thisistest') . rand(); + $args->target_nick_name = $logged_info->nick_name; + $args->regdate = date('YmdHis'); + $args->notify = $oNcenterliteController->_getNotifyId($args); + $output = $oNcenterliteController->_insertNotify($args); + } + + function procNcenterliteAdminDeleteNofity() + { + $old_date = Context::get('old_date'); + $args = new stdClass; + if($old_date) + { + $args->old_date = $old_date; + } + $output = executeQuery('ncenterlite.deleteNotifyAll', $args); + if(!$output->toBool()) + { + $oDB->rollback(); + return $output; + } + + if($old_date) + { + $oNcenterliteModel = getModel('ncenterlite'); + $message = Context::getLang('ncenterlite_message_delete_notification_before'); + $message = sprintf($message, $oNcenterliteModel->getAgo($old_date) ); + $this->setMessage($message); + } + else + { + $this->setMessage('ncenterlite_message_delete_notification_all'); + } + + if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON'))) + { + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispNcenterliteAdminList'); + header('location: ' .$returnUrl); + return; + } + } +} diff --git a/modules/ncenterlite/ncenterlite.admin.model.php b/modules/ncenterlite/ncenterlite.admin.model.php new file mode 100644 index 000000000..4e5a9ecb9 --- /dev/null +++ b/modules/ncenterlite/ncenterlite.admin.model.php @@ -0,0 +1,105 @@ +getConfig(); + + global $lang; + + $act = Context::get('act'); + $output = $oNcenterliteModel->getNcenterliteAdminList(); + + $oMemberModel = getModel('member'); + $list = $output->data; + + foreach($list as $k => $v) + { + $target_member = $v->target_nick_name; + + switch($v->type) + { + case 'D': + $type = $lang->ncenterlite_document; //$type = '글'; + break; + case 'C': + $type = $lang->ncenterlite_comment; //$type = '댓글'; + break; + // 메시지. 쪽지 + case 'E': + $type = $lang->ncenterlite_type_message; //$type = '쪽지'; + break; + } + + switch($v->target_type) + { + case 'C': + $str = sprintf($lang->ncenterlite_commented, $target_member, $type, $v->target_summary); + //$str = sprintf('%s님이 회원님의 %s에 "%s" 댓글을 남겼습니다.', $target_member, $type, $v->target_summary); + break; + case 'A': + $str = sprintf($lang->ncenterlite_commented_board, $target_member, $v->target_browser, $v->target_summary); + //$str = sprintf('%1$s님이 게시판 "%2$s""%3$s"라고 댓글을 남겼습니다.', $target_member, $type, $v->target_summary); + break; + case 'M': + $str = sprintf($lang->ncenterlite_mentioned, $target_member, $v->target_summary, $type); + //$str = sprintf('%s님이 "%s" %s에서 회원님을 언급하였습니다.', $target_member, $v->target_summary, $type); + break; + // 메시지. 쪽지 + case 'E': + if(version_compare(__XE_VERSION__, '1.7.4', '>=')) + { + $str = sprintf($lang->ncenterlite_message_mention, $target_member, $v->target_summary); + //%s님께서 "%s"라고 메세지를 보내셨습니다. + } + else + { + $str = sprintf($lang->ncenterlite_message_string, $v->target_summary); + } + break; + case 'T': + $str = sprintf($lang->ncenterlite_test_noti, $target_member); + break; + case 'P': + $str = sprintf($lang->ncenterlite_board, $target_member, $v->target_browser, $v->target_summary); + //%1$s님이 게시판 "%2$s""%3$s"라고 글을 남겼습니다. + break; + case 'S': + if($v->target_browser) + { + $str = sprintf($lang->ncenterlite_board, $target_member, $v->target_browser, $v->target_summary); + } + else + { + $str = sprintf($lang->ncenterlite_article, $target_member, $v->target_summary); + } + break; + case 'V': + $str = sprintf($lang->ncenterlite_vote, $target_member, $v->target_summary); + break; + } + + if($v->type=='U') + { + $str = $oNcenterliteModel->getNotifyTypeString($v->notify_type,unserialize($v->target_body)); + } + $v->text = $str; + $v->ago = $oNcenterliteModel->getAgo($v->regdate); + $v->url = getUrl('','act','procNcenterliteRedirect', 'notify', $v->notify, 'url', $v->target_url); + if($v->target_member_srl) + { + $profileImage = $oMemberModel->getProfileImage($v->target_member_srl); + $v->profileImage = $profileImage->src; + } + + $list[$k] = $v; + } + + $output->data = $list; + return $output; + } + +} \ No newline at end of file diff --git a/modules/ncenterlite/ncenterlite.admin.view.php b/modules/ncenterlite/ncenterlite.admin.view.php new file mode 100644 index 000000000..7be649aec --- /dev/null +++ b/modules/ncenterlite/ncenterlite.admin.view.php @@ -0,0 +1,82 @@ +setTemplatePath($this->module_path.'tpl'); + $this->setTemplateFile(lcfirst(str_replace('dispNcenterliteAdmin', '', $this->act))); + } + + function dispNcenterliteAdminConfig() + { + $oNcenterliteModel = getModel('ncenterlite'); + + $config = $oNcenterliteModel->getConfig(); + Context::set('config', $config); + } + + function dispNcenterliteAdminSeletedmid() + { + $oModuleModel = getModel('module'); + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + + $mid_list = $oModuleModel->getMidList(null, array('module_srl', 'mid', 'browser_title', 'module')); + + Context::set('mid_list', $mid_list); + Context::set('config', $config); + } + + function dispNcenterliteAdminSkinsetting() + { + $oModuleModel = getModel('module'); + $oLayoutModel = getModel('layout'); + $oNcenterliteModel = getModel('ncenterlite'); + + $config = $oNcenterliteModel->getConfig(); + Context::set('config', $config); + + $layout_list = $oLayoutModel->getLayoutList(); + Context::set('layout_list', $layout_list); + + $mobile_layout_list = $oLayoutModel->getLayoutList(0, 'M'); + Context::set('mlayout_list', $mobile_layout_list); + + $skin_list = $oModuleModel->getSkins($this->module_path); + Context::set('skin_list', $skin_list); + + $mskin_list = $oModuleModel->getSkins($this->module_path, "m.skins"); + Context::set('mskin_list', $mskin_list); + + if(!$skin_list[$config->skin]) $config->skin = 'default'; + Context::set('colorset_list', $skin_list[$config->skin]->colorset); + + if(!$mskin_list[$config->mskin]) $config->mskin = 'default'; + Context::set('mcolorset_list', $mskin_list[$config->mskin]->colorset); + + $security = new Security(); + $security->encodeHTML('config..'); + $security->encodeHTML('skin_list..title'); + $security->encodeHTML('colorset_list..name','colorset_list..title'); + } + + function dispNcenterliteAdminList() + { + $oNcenterliteAdminModel = getAdminModel('ncenterlite'); + + $output = $oNcenterliteAdminModel->getAdminNotifyList(); + + Context::set('total_count', $output->page_navigation->total_count); + Context::set('total_page', $output->page_navigation->total_page); + Context::set('page', $output->page); + Context::set('ncenterlite_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('ncenter_list'); + } + + function dispNcenterliteAdminTest() + { + + } +} diff --git a/modules/ncenterlite/ncenterlite.class.php b/modules/ncenterlite/ncenterlite.class.php new file mode 100644 index 000000000..ccf755e2e --- /dev/null +++ b/modules/ncenterlite/ncenterlite.class.php @@ -0,0 +1,232 @@ +disable_notify)) + { + $module_info = Context::get('module_info'); + if(in_array($module_info->mid, $this->disable_notify)) $result = TRUE; + } + + return $result; + } + + function moduleInstall() + { + return new Object(); + } + + function checkUpdate() + { + $oModuleModel = getModel('module'); + $oDB = &DB::getInstance(); + + foreach($this->triggers as $trigger) + { + if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) return true; + } + + foreach($this->delete_triggers as $trigger) + { + if($oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) + { + return true; + } + } + + if(!$oDB->isColumnExists('ncenterlite_notify', 'readed')) + { + return true; + } + + if(!$oDB->isColumnExists('ncenterlite_notify', 'target_body')) + { + return true; + } + + if(!$oDB->isColumnExists('ncenterlite_notify', 'notify_type')) + { + return true; + } + + if(!$oDB->isColumnExists('ncenterlite_notify', 'target_browser')) + { + return true; + } + + if(!$oDB->isColumnExists('ncenterlite_notify', 'target_p_srl')) + { + return true; + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_srl')) + { + return true; + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_srl')) + { + return true; + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_p_srl')) + { + return true; + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_notify')) + { + return true; + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_member_srl')) + { + return true; + } + + return false; + } + + function moduleUpdate() + { + $oModuleModel = getModel('module'); + $oModuleController = getController('module'); + $oDB = &DB::getInstance(); + + foreach($this->triggers as $trigger) + { + if(!$oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) + { + $oModuleController->insertTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); + } + } + + foreach($this->delete_triggers as $trigger) + { + if($oModuleModel->getTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4])) + { + $oModuleController->deleteTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); + } + } + + if(!$oDB->isColumnExists('ncenterlite_notify','readed')) + { + $oDB->addColumn('ncenterlite_notify', 'readed', 'char', 1, 'N', true); + $oDB->addIndex('ncenterlite_notify', 'idx_readed', array('readed')); + $oDB->addIndex('ncenterlite_notify', 'idx_member_srl', array('member_srl')); + $oDB->addIndex('ncenterlite_notify', 'idx_regdate', array('regdate')); + } + + if(!$oDB->isColumnExists('ncenterlite_notify','target_browser')) + { + $oDB->addColumn('ncenterlite_notify', 'target_browser', 'varchar', 50, true); + } + + if(!$oDB->isColumnExists('ncenterlite_notify','target_body')) + { + $oDB->addColumn('ncenterlite_notify', 'target_body', 'varchar', 255, true); + } + + if(!$oDB->isColumnExists('ncenterlite_notify','notify_type')) + { + $oDB->addColumn('ncenterlite_notify', 'notify_type', 'number', 11, 0); + } + + if(!$oDB->isColumnExists('ncenterlite_notify','target_p_srl')) + { + $oDB->addColumn('ncenterlite_notify', 'target_p_srl', 'number', 10, true); + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_srl')) + { + $oDB->addIndex('ncenterlite_notify', 'idx_srl', array('srl')); + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_srl')) + { + $oDB->addIndex('ncenterlite_notify', 'idx_target_srl', array('target_srl')); + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_p_srl')) + { + $oDB->addIndex('ncenterlite_notify', 'idx_target_p_srl', array('target_p_srl')); + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_notify')) + { + $oDB->addIndex('ncenterlite_notify', 'idx_notify', array('notify')); + } + + if(!$oDB->isIndexExists('ncenterlite_notify', 'idx_target_member_srl')) + { + $oDB->addIndex('ncenterlite_notify', 'idx_target_member_srl', array('target_member_srl')); + } + + return new Object(0, 'success_updated'); + } + + function recompileCache() + { + return new Object(); + } + + function moduleUninstall() + { + $oModuleController = getController('module'); + + foreach($this->triggers as $trigger) + { + $oModuleController->deleteTrigger($trigger[0], $trigger[1], $trigger[2], $trigger[3], $trigger[4]); + } + return new Object(); + } +} diff --git a/modules/ncenterlite/ncenterlite.controller.php b/modules/ncenterlite/ncenterlite.controller.php new file mode 100644 index 000000000..185318f04 --- /dev/null +++ b/modules/ncenterlite/ncenterlite.controller.php @@ -0,0 +1,1128 @@ +member_srl; + } + + if($logged_info->member_srl != $member_srl && $logged_info->is_admin != 'Y') + { + return new Object(-1, 'ncenterlite_stop_no_permission_other_user_settings'); + } + + $output = $oNcenterliteModel->getMemberConfig($member_srl); + + $obj = Context::getRequestVars(); + + $args = new stdClass(); + $args->member_srl = $member_srl; + $args->comment_notify = $obj->comment_notify; + $args->mention_notify = $obj->mention_notify; + $args->message_notify = $obj->message_notify; + + if(!$output) + { + $outputs = executeQuery('ncenterlite.insertUserConfig', $args); + } + else + { + $outputs = executeQuery('ncenterlite.updateUserConfig', $args); + } + + $this->setMessage('success_updated'); + + if(!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) + { + $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'act', 'dispNcenterliteUserConfig', 'member_srl', $member_srl); + header('location: ' . $returnUrl); + return; + } + } + + function triggerAfterDeleteMember($obj) + { + $member_srl = $obj->member_srl; + if(!$member_srl) + { + return new Object(); + } + + $args = new stdClass(); + $args->member_srl = $member_srl; + $output = executeQuery('ncenterlite.deleteNotifyByMemberSrl', $args); + if(!$output->toBool()) + { + return $output; + } + return new Object(); + } + + function triggerAfterInsertDocument(&$obj) + { + $oModuleModel = getModel('module'); + + if($this->_isDisable()) + { + return; + } + + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + + $content = strip_tags($obj->title . ' ' . $obj->content); + + $mention_targets = $this->_getMentionTarget($content); + + $document_srl = $obj->document_srl; + $module_info = $oModuleModel->getModuleInfoByDocumentSrl($document_srl); + + $is_anonymous = $this->_isAnonymous($this->_TYPE_DOCUMENT, $obj); + + $admin_list = $oNcenterliteModel->getMemberAdmins(); + $admins_list = $admin_list->data; + $logged_info = Context::get('logged_info'); + + if(isset($config->use['admin_content'])) + { + foreach($admins_list as $admins) + { + if($logged_info->member_srl == $admins->member_srl) + { + continue; + } + if(is_array($config->admin_notify_module_srls) && in_array($module_info->module_srl, $config->admin_notify_module_srls)) + { + $args = new stdClass(); + $args->member_srl = $admins->member_srl; + $args->srl = $obj->document_srl; + $args->target_p_srl = $obj->document_srl; + $args->target_srl = $obj->document_srl; + $args->type = $this->_TYPE_DOCUMENT; + $args->target_type = $this->_TYPE_ADMIN_DOCUMENT; + $args->target_url = getNotEncodedFullUrl('', 'document_srl', $obj->document_srl); + $args->target_summary = cut_str(strip_tags($obj->title), 50); + $args->regdate = date('YmdHis'); + $args->target_browser = $module_info->browser_title; + $args->notify = $this->_getNotifyId($args); + $output = $this->_insertNotify($args, $is_anonymous); + if(!$output->toBool()) + { + return $output; + } + } + } + } + + if(!$mention_targets || !count($mention_targets) || !isset($config->use['mention'])) + { + return new Object(); + } + + // 맨션 알림일경우 맨션알림 시작. + if($mention_targets) + { + // !TODO 공용 메소드로 분리 + foreach($mention_targets as $mention_member_srl) + { + $target_member_config = $oNcenterliteModel->getMemberConfig($mention_member_srl); + $notify_member_config = $target_member_config->data; + + if($notify_member_config->mention_notify == 'N') + { + continue; + } + + $args = new stdClass(); + $args->member_srl = $mention_member_srl; + $args->srl = $obj->document_srl; + $args->target_p_srl = $obj->document_srl; + $args->target_srl = $obj->document_srl; + $args->type = $this->_TYPE_DOCUMENT; + $args->target_type = $this->_TYPE_MENTION; + $args->target_url = getNotEncodedFullUrl('', 'document_srl', $obj->document_srl); + $args->target_summary = cut_str(strip_tags($obj->title), 50); + $args->target_nick_name = $obj->nick_name; + $args->target_email_address = $obj->email_address; + $args->regdate = date('YmdHis'); + $args->target_browser = $module_info->browser_title; + $args->notify = $this->_getNotifyId($args); + $output = $this->_insertNotify($args, $is_anonymous); + if($output->toBool()) + { + return $output; + } + } + } + + return new Object(); + } + + function triggerAfterInsertComment(&$obj) + { + if($this->_isDisable()) + { + return; + } + + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + + $logged_info = Context::get('logged_info'); + $notify_member_srl = array(); + + $document_srl = $obj->document_srl; + $oModuleModel = getModel('module'); + $module_info = $oModuleModel->getModuleInfoByDocumentSrl($document_srl); + $comment_srl = $obj->comment_srl; + $parent_srl = $obj->parent_srl; + $content = $obj->content; + $regdate = $obj->regdate; + + // 익명 노티 체크 + $is_anonymous = $this->_isAnonymous($this->_TYPE_COMMENT, $obj); + + // check use the mention option. + if(isset($config->use['mention'])) + { + $mention_targets = $this->_getMentionTarget(strip_tags($obj->content)); + // !TODO 공용 메소드로 분리 + foreach($mention_targets as $mention_member_srl) + { + $target_member_config = $oNcenterliteModel->getMemberConfig($mention_member_srl); + $notify_member_config = $target_member_config->data; + if($notify_member_config->mention_notify == 'N') + { + continue; + } + + $args = new stdClass(); + $args->member_srl = $mention_member_srl; + $args->target_p_srl = $obj->comment_srl; + $args->srl = $obj->document_srl; + $args->target_srl = $obj->comment_srl; + $args->type = $this->_TYPE_COMMENT; + $args->target_type = $this->_TYPE_MENTION; + $args->target_url = getNotEncodedFullUrl('', 'document_srl', $document_srl, '_comment_srl', $comment_srl) . '#comment_' . $comment_srl; + $args->target_summary = cut_str(strip_tags($content), 50); + $args->target_nick_name = $obj->nick_name; + $args->target_email_address = $obj->email_address; + $args->regdate = date('YmdHis'); + $args->target_browser = $module_info->browser_title; + $args->notify = $this->_getNotifyId($args); + $output = $this->_insertNotify($args, $is_anonymous); + $notify_member_srl[] = $mention_member_srl; + } + } + + if(!isset($config->use['comment'])) + { + return new Object(); + } + + $admin_list = $oNcenterliteModel->getMemberAdmins(); + $admins_list = $admin_list->data; + if(isset($config->use['admin_content'])) + { + foreach($admins_list as $admins) + { + if(is_array($config->admin_notify_module_srls) && in_array($module_info->module_srl, $config->admin_notify_module_srls)) + { + $args = new stdClass(); + $args->member_srl = $admins->member_srl; + $args->target_p_srl = $obj->comment_srl; + $args->srl = $obj->document_srl; + $args->target_srl = $obj->comment_srl; + $args->type = $this->_TYPE_COMMENT; + $args->target_type = $this->_TYPE_ADMIN_COMMENT; + $args->target_url = getNotEncodedFullUrl('', 'document_srl', $document_srl, '_comment_srl', $comment_srl) . '#comment_' . $comment_srl; + $args->target_summary = cut_str(strip_tags($content), 50); + $args->target_nick_name = $obj->nick_name; + $args->target_email_address = $obj->email_address; + $args->regdate = date('YmdHis'); + $args->target_browser = $module_info->browser_title; + $args->notify = $this->_getNotifyId($args); + $output = $this->_insertNotify($args, $is_anonymous); + } + } + } + // 대댓글 + if($parent_srl) + { + $oCommentModel = getModel('comment'); + $oComment = $oCommentModel->getComment($parent_srl); + $member_srl = $oComment->member_srl; + $comment_member_config = $oNcenterliteModel->getMemberConfig($member_srl); + $parent_member_config = $comment_member_config->data; + + // !TODO 공용 메소드로 분리 + if(!in_array(abs($member_srl), $notify_member_srl) && (!$logged_info || ($member_srl != 0 && abs($member_srl) != $logged_info->member_srl)) && $parent_member_config->comment_notify != 'N') + { + $args = new stdClass(); + $args->member_srl = abs($member_srl); + $args->srl = $obj->document_srl; + $args->target_p_srl = $parent_srl; + $args->target_srl = $obj->comment_srl; + $args->type = $this->_TYPE_COMMENT; + $args->target_type = $this->_TYPE_COMMENT; + $args->target_url = getNotEncodedFullUrl('', 'document_srl', $document_srl, '_comment_srl', $comment_srl) . '#comment_' . $comment_srl; + $args->target_summary = cut_str(strip_tags($content), 50); + $args->target_nick_name = $obj->nick_name; + $args->target_email_address = $obj->email_address; + $args->regdate = $regdate; + $args->target_browser = $module_info->browser_title; + $args->notify = $this->_getNotifyId($args); + $output = $this->_insertNotify($args, $is_anonymous); + $notify_member_srl[] = abs($member_srl); + } + } + // 대댓글이 아니고, 게시글의 댓글을 남길 경우 + if(!$parent_srl || ($parent_srl && isset($config->use['comment_comment']))) + { + $oDocumentModel = getModel('document'); + $oDocument = $oDocumentModel->getDocument($document_srl); + + $member_srl = $oDocument->get('member_srl'); + $comment_member_config = $oNcenterliteModel->getMemberConfig($member_srl); + $document_comment_member_config = $comment_member_config->data; + + // !TODO 공용 메소드로 분리 + if(!in_array(abs($member_srl), $notify_member_srl) && (!$logged_info || ($member_srl != 0 && abs($member_srl) != $logged_info->member_srl)) && $document_comment_member_config->comment_notify != 'N') + { + $args = new stdClass(); + $args->member_srl = abs($member_srl); + $args->srl = $document_srl; + $args->target_p_srl = $comment_srl; + $args->target_srl = $comment_srl; + $args->type = $this->_TYPE_DOCUMENT; + $args->target_type = $this->_TYPE_COMMENT; + $args->target_url = getNotEncodedFullUrl('', 'document_srl', $document_srl, '_comment_srl', $comment_srl) . '#comment_' . $comment_srl; + $args->target_summary = cut_str(strip_tags($content), 50); + $args->target_nick_name = $obj->nick_name; + $args->target_email_address = $obj->email_address; + $args->regdate = $regdate; + $args->target_browser = $module_info->browser_title; + $args->notify = $this->_getNotifyId($args); + $output = $this->_insertNotify($args, $is_anonymous); + } + } + + return new Object(); + } + + function triggerAfterSendMessage(&$trigger_obj) + { + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + $communication_config = getModel('communication')->getConfig(); + + if($communication_config->enable_message != 'Y') + { + return new Object(); + } + + if(!isset($config->use['message'])) + { + return new Object(); + } + + $messages_member_config = $oNcenterliteModel->getMemberConfig($trigger_obj->receiver_srl); + $message_member_config = $messages_member_config->data; + + if($message_member_config->message_notify != 'N') + { + $args = new stdClass(); + $args->member_srl = $trigger_obj->receiver_srl; + $args->srl = $trigger_obj->related_srl; + $args->target_p_srl = '1'; + $args->target_srl = $trigger_obj->message_srl; + $args->type = $this->_TYPE_MESSAGE; + $args->target_type = $this->_TYPE_MESSAGE; + $args->target_summary = $trigger_obj->title; + $args->regdate = date('YmdHis'); + $args->notify = $this->_getNotifyId($args); + $args->target_url = getNotEncodedFullUrl('', 'act', 'dispCommunicationMessages', 'message_srl', $trigger_obj->related_srl); + $output = $this->_insertNotify($args); + } + } + + function triggerAfterVotedupdate(&$obj) + { + $oDocumentModel = getModel('document'); + $oDocument = $oDocumentModel->getDocument($obj->document_srl, false, false); + + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + if(!isset($config->use['vote'])) + { + return new Object(); + } + + if($obj->point < 0) + { + return new Object(); + } + + $args = new stdClass(); + $args->member_srl = $obj->member_srl; + $args->srl = $obj->document_srl; + $args->target_p_srl = '1'; + $args->target_srl = $obj->document_srl; + $args->type = $this->_TYPE_DOCUMENT; + $args->target_type = $this->_TYPE_VOTED; + $args->target_summary = $oDocument->get('title'); + $args->regdate = date('YmdHis'); + $args->notify = $this->_getNotifyId($args); + $args->target_url = getNotEncodedFullUrl('', 'document_srl', $obj->document_srl); + $output = $this->_insertNotify($args); + } + + function triggerAfterDeleteComment(&$obj) + { + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + if(empty($config->use)) + { + return new Object(); + } + + $args = new stdClass(); + $args->srl = $obj->comment_srl; + $output = executeQuery('ncenterlite.deleteNotifyBySrl', $args); + return new Object(); + } + + function triggerAfterDeleteDocument(&$obj) + { + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + if(empty($config->use)) + { + return new Object(); + } + + $args = new stdClass(); + $args->srl = $obj->document_srl; + $output = executeQuery('ncenterlite.deleteNotifyBySrl', $args); + return new Object(); + } + + function triggerAfterModuleHandlerProc(&$oModule) + { + $vars = Context::getRequestVars(); + $logged_info = Context::get('logged_info'); + $args = new stdClass(); + + if($oModule->getLayoutFile() == 'popup_layout.html') + { + Context::set('ncenterlite_is_popup', TRUE); + } + + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + // if the array is empty, lets return. + if(empty($config->use)) + { + return new Object(); + } + $this->_hide_ncenterlite = false; + if($oModule->module == 'beluxe' && Context::get('is_modal')) + { + $this->_hide_ncenterlite = true; + } + if($oModule->module == 'bodex' && Context::get('is_iframe')) + { + $this->_hide_ncenterlite = true; + } + if($oModule->getLayoutFile() == 'popup_layout.html') + { + $this->_hide_ncenterlite = true; + } + + if($oModule->act == 'dispBoardReplyComment') + { + $comment_srl = Context::get('comment_srl'); + $logged_info = Context::get('logged_info'); + if($comment_srl && $logged_info) + { + $args->target_srl = $comment_srl; + $args->member_srl = $logged_info->member_srl; + $output_update = executeQuery('ncenterlite.updateNotifyReadedByTargetSrl', $args); + } + } + else if($oModule->act == 'dispBoardContent') + { + $comment_srl = Context::get('_comment_srl'); + $document_srl = Context::get('document_srl'); + $oDocument = Context::get('oDocument'); + $logged_info = Context::get('logged_info'); + + if($document_srl && $logged_info && $config->document_read == 'Y') + { + $args->srl = $document_srl; + $args->member_srl = $logged_info->member_srl; + $outputs = executeQuery('ncenterlite.updateNotifyReadedBySrl', $args); + } + + if($comment_srl && $document_srl && $oDocument) + { + $_comment_list = $oDocument->getComments(); + if($_comment_list) + { + if(array_key_exists($comment_srl, $_comment_list)) + { + $url = getNotEncodedUrl('_comment_srl', '') . '#comment_' . $comment_srl; + $need_check_socialxe = true; + } + else + { + $cpage = $oDocument->comment_page_navigation->cur_page; + if($cpage > 1) + { + $url = getNotEncodedUrl('cpage', $cpage - 1) . '#comment_' . $comment_srl; + $need_check_socialxe = true; + } + else + { + $url = getNotEncodedUrl('_comment_srl', '', 'cpage', '') . '#comment_' . $comment_srl; + } + } + + if($need_check_socialxe) + { + $oDB = &DB::getInstance(); + if($oDB->isTableExists('socialxe')) + { + $args = new stdClass(); + $oModuleModel = getModel('module'); + $module_info = $oModuleModel->getModuleInfoByDocumentSrl($document_srl); + $args->module_srl = $module_info->module_srl; + $output = executeQuery('ncenterlite.getSocialxeCount', $args); + if($output->data->cnt) + { + $socialxe_comment_srl = $comment_srl; + + $args = new stdClass(); + $args->comment_srl = $comment_srl; + $oCommentModel = getModel('comment'); + $oComment = $oCommentModel->getComment($comment_srl); + $parent_srl = $oComment->get('parent_srl'); + if($parent_srl) + { + $socialxe_comment_srl = $parent_srl; + } + + $url = getNotEncodedUrl('_comment_srl', '', 'cpage', '', 'comment_srl', $socialxe_comment_srl) . '#comment_' . $comment_srl; + } + } + } + + $url = str_replace('&', '&', $url); + header('location: ' . $url); + Context::close(); + exit; + } + } + } + elseif($oModule->act == 'dispCommunicationMessages') + { + $message_srl = Context::get('message_srl'); + $logged_info = Context::get('logged_info'); + if($message_srl) + { + $args = new stdClass(); + $args->target_srl = $message_srl; + $args->member_srl = $logged_info->member_srl; + executeQuery('ncenterlite.updateNotifyReadedByTargetSrl', $args); + } + } + + // 지식인 모듈의 의견 + // TODO: 코드 분리 + if($oModule->act == 'procKinInsertComment') + { + // 글, 댓글 구분 + $parent_type = ($vars->document_srl == $vars->parent_srl) ? 'DOCUMENT' : 'COMMENT'; + if($parent_type == 'DOCUMENT') + { + $oDocumentModel = getModel('document'); + $oDocument = $oDocumentModel->getDocument($vars->document_srl); + $member_srl = $oDocument->get('member_srl'); + $type = $this->_TYPE_DOCUMENT; + } + else + { + $oCommentModel = getModel('comment'); + $oComment = $oCommentModel->getComment($vars->parent_srl); + $member_srl = $oComment->get('member_srl'); + $type = $this->_TYPE_COMMENT; + } + + if($logged_info->member_srl != $member_srl) + { + $args = new stdClass(); + $args->member_srl = abs($member_srl); + $args->srl = ($parent_type == 'DOCUMENT') ? $vars->document_srl : $vars->parent_srl; + $args->type = $type; + $args->target_type = $this->_TYPE_COMMENT; + $args->target_srl = $vars->parent_srl; + $args->target_p_srl = '1'; + $args->target_url = getNotEncodedFullUrl('', 'document_srl', $vars->document_srl, '_comment_srl', $vars->parent_srl) . '#comment_' . $vars->parent_srl; + $args->target_summary = cut_str(strip_tags($vars->content), 50); + $args->target_nick_name = $logged_info->nick_name; + $args->target_email_address = $logged_info->email_address; + $args->regdate = date('YmdHis'); + $args->notify = $this->_getNotifyId($args); + $output = $this->_insertNotify($args); + } + } + else if($oModule->act == 'dispKinView' || $oModule->act == 'dispKinIndex') + { + // 글을 볼 때 알림 제거 + $oDocumentModel = getModel('document'); + $oDocument = $oDocumentModel->getDocument($vars->document_srl); + $member_srl = $oDocument->get('member_srl'); + + if($logged_info->member_srl == $member_srl) + { + $args = new stdClass; + $args->member_srl = $logged_info->member_srl; + $args->srl = $vars->document_srl; + $args->type = $this->_TYPE_DOCUMENT; + $output = executeQuery('ncenterlite.updateNotifyReadedBySrl', $args); + } + } + else if($oModule->act == 'getKinComments') + { + // 의견을 펼칠 때 알림 제거 + $args = new stdClass; + $args->member_srl = $logged_info->member_srl; + $args->target_srl = $vars->parent_srl; + $output = executeQuery('ncenterlite.updateNotifyReadedByTargetSrl', $args); + } + + return new Object(); + } + + function triggerBeforeDisplay(&$output_display) + { + $act = Context::get('act'); + // 팝업창이면 중지 + if(Context::get('ncenterlite_is_popup')) + { + return; + } + + // 자신의 알림목록을 보고 있을 경우엔 알림센터창을 띄우지 않는다. + if($act == 'dispNcenterliteNotifyList') + { + return; + } + + if(count($this->disable_notify_bar_act)) + { + if(in_array(Context::get('act'), $this->disable_notify_bar_act)) + { + return; + } + } + + // HTML 모드가 아니면 중지 + act에 admin이 포함되어 있으면 중지 + if(Context::getResponseMethod() != 'HTML' || strpos(strtolower(Context::get('act')), 'admin') !== false) + { + return; + } + + $logged_info = Context::get('logged_info'); + + // 로그인 상태가 아니면 중지 + if(!$logged_info) + { + return; + } + + $module_info = Context::get('module_info'); + + if(count($this->disable_notify_bar_mid)) + { + if(in_array($module_info->mid, $this->disable_notify_bar_mid)) + { + return; + } + } + + // admin 모듈이면 중지 + if($module_info->module == 'admin') + { + return; + } + + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + + // if the array is empty, dose not output the notification. + if(empty($config->use)) + { + return new Object(); + } + + if($config->display_use == 'N') + { + return new Object(); + } + + // 노티바 제외 페이지이면 중지 + if(in_array($module_info->module_srl, $config->hide_module_srls)) + { + return new Object(); + } + + Context::set('ncenterlite_config', $config); + + $js_args = array('./modules/ncenterlite/tpl/js/ncenterlite.js', 'body', '', 100000); + Context::loadFile($js_args); + + $oNcenterliteModel = getModel('ncenterlite'); + + // 알림 목록 가져오기 + $logged_info = Context::get('logged_info'); + $_output = $oNcenterliteModel->getMyNotifyList($logged_info->member_srl); + // 알림 메시지가 없어도 항상 표시하게 하려면 이 줄을 제거 또는 주석 처리하세요. + if(!$_output->data) + { + return; + } + + $_latest_notify_id = array_slice($_output->data, 0, 1); + $_latest_notify_id = $_latest_notify_id[0]->notify; + Context::set('ncenterlite_latest_notify_id', $_latest_notify_id); + + if($_COOKIE['_ncenterlite_hide_id'] && $_COOKIE['_ncenterlite_hide_id'] == $_latest_notify_id) + { + return; + } + setcookie('_ncenterlite_hide_id', '', 0, '/'); + + $oMemberModel = getModel('member'); + $memberConfig = $oMemberModel->getMemberConfig(); + if($memberConfig->profile_image == 'Y') + { + $profileImage = $oMemberModel->getProfileImage($logged_info->member_srl); + Context::set('profileImage', $profileImage); + } + Context::set('useProfileImage', ($memberConfig->profile_image == 'Y') ? true : false); + + Context::set('ncenterlite_list', $_output->data); + Context::set('ncenterlite_page_navigation', $_output->page_navigation); + + if(Mobile::isFromMobilePhone()) + { + $this->template_path = sprintf('%sm.skins/%s/', $this->module_path, $config->mskin); + if(!is_dir($this->template_path) || !$config->mskin) + { + $config->mskin = 'default'; + $this->template_path = sprintf('%sm.skins/%s/', $this->module_path, $config->mskin); + } + } + else + { + $this->template_path = sprintf('%sskins/%s/', $this->module_path, $config->skin); + if(!is_dir($this->template_path) || !$config->skin) + { + $config->skin = 'default'; + $this->template_path = sprintf('%sskins/%s/', $this->module_path, $config->skin); + } + } + + $this->_addFile(); + $html = $this->_getTemplate(); + $output_display = $html . $output_display; + } + + function triggerAddMemberMenu() + { + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + + if($config->user_config_list == 'Y') + { + $logged_info = Context::get('logged_info'); + if(!Context::get('is_logged')) + { + return new Object(); + } + $target_srl = Context::get('target_srl'); + + $oMemberController = getController('member'); + $oMemberController->addMemberMenu('dispNcenterliteNotifyList', 'ncenterlite_my_list'); + $oMemberController->addMemberMenu('dispNcenterliteUserConfig', 'ncenterlite_my_settings'); + + if($logged_info->is_admin == 'Y') + { + $url = getUrl('', 'act', 'dispNcenterliteUserConfig', 'member_srl', $target_srl); + $str = Context::getLang('ncenterlite_user_settings'); + $oMemberController->addMemberPopupMenu($url, $str, ''); + } + } + + return new Object(); + } + + function _addFile() + { + if(file_exists(FileHandler::getRealPath($this->template_path . 'ncenterlite.css'))) + { + Context::loadFile(array($this->template_path . 'ncenterlite.css', '', '', 100), true); + } + + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + if(!Mobile::isFromMobilePhone()) + { + if($config->colorset && file_exists(FileHandler::getRealPath($this->template_path . 'ncenterlite.' . $config->colorset . '.css'))) + { + Context::loadFile(array($this->template_path . 'ncenterlite.' . $config->colorset . '.css', '', '', 100), true); + } + } + elseif(Mobile::isFromMobilePhone()) + { + if($config->mcolorset && file_exists(FileHandler::getRealPath($this->template_path . 'ncenterlite.' . $config->mcolorset . '.css'))) + { + Context::loadFile(array($this->template_path . 'ncenterlite.' . $config->mcolorset . '.css', '', '', 100), true); + } + + Context::loadFile(array('./common/js/jquery.min.js', 'head', '', -100000), true); + Context::loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true); + Context::loadFile(array($this->template_path . 'ncenterlite.mobile.css', '', '', 100), true); + } + if($config->zindex) + { + Context::set('ncenterlite_zindex', ' style="z-index:' . $config->zindex . ';" '); + } + } + + function _getTemplate() + { + $oNcenterModel = getModel('ncenterlite'); + $config = $oNcenterModel->getConfig(); + + $oTemplateHandler = TemplateHandler::getInstance(); + $result = ''; + + if(Mobile::isFromMobilePhone()) + { + $path = sprintf('%sm.skins/%s/', $this->module_path, $config->mskin); + } + else + { + $path = sprintf('%sskins/%s/', $this->module_path, $config->skin); + } + $result = $oTemplateHandler->compile($path, 'ncenterlite.html'); + + return $result; + } + + function updateNotifyRead($notify, $member_srl) + { + $args = new stdClass(); + $args->member_srl = $member_srl; + $args->notify = $notify; + $output = executeQuery('ncenterlite.updateNotifyReaded', $args); + //$output = executeQuery('ncenterlite.deleteNotify', $args); + + return $output; + } + + function updateNotifyReadiByTargetSrl($target_srl, $member_srl) + { + $args = new stdClass(); + $args->member_srl = $member_srl; + $args->target_srl = $target_srl; + $output = executeQuery('ncenterlite.updateNotifyReadedByTargetSrl', $args); + //$output = executeQuery('ncenterlite.deleteNotifyByTargetSrl', $args); + + return $output; + } + + function updateNotifyReadAll($member_srl) + { + $args = new stdClass(); + $args->member_srl = $member_srl; + $output = executeQuery('ncenterlite.updateNotifyReadedAll', $args); + //$output = executeQuery('ncenterlite.deleteNotifyByMemberSrl', $args); + + return $output; + } + + function procNcenterliteNotifyReadAll() + { + $logged_info = Context::get('logged_info'); + if(!$logged_info) + { + return new Object(-1, 'msg_invalid_request'); + } + + $output = $this->updateNotifyReadAll($logged_info->member_srl); + return $output; + } + + function procNcenterliteRedirect() + { + $logged_info = Context::get('logged_info'); + $url = Context::get('url'); + $notify = Context::get('notify'); + if(!$logged_info || !$url || !$notify) + { + return new Object(-1, 'msg_invalid_request'); + } + + $output = $this->updateNotifyRead($notify, $logged_info->member_srl); + if(!$output->toBool()) + { + return $output; + } + + $url = str_replace('&', '&', $url); + header('Location: ' . $url, TRUE, 302); + Context::close(); + exit; + } + + /** + * @brief 익명으로 노티해야 할지 체크하여 반환 + * @return boolean + **/ + function _isAnonymous($source_type, $triggerObj) + { + // 회원번호가 음수 + if($triggerObj->member_srl < 0) + { + return TRUE; + } + + $module_info = Context::get('module_info'); + + // DX 익명 체크박스 + if($module_info->module == 'beluxe' && $triggerObj->anonymous == 'Y') + { + return TRUE; + } + + if($source_type == $this->_TYPE_COMMENT) + { + // DX 익명 강제 + if($module_info->module == 'beluxe' && $module_info->use_anonymous == 'Y') + { + return TRUE; + } + } + + if($source_type == $this->_TYPE_DOCUMENT) + { + // DX 익명 강제 + if($module_info->module == 'beluxe' && $module_info->use_anonymous == 'Y') + { + return TRUE; + } + } + + return FALSE; + } + + function _insertNotify($args, $anonymous = FALSE) + { + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + // 비회원 노티 제거 + if($args->member_srl <= 0) + { + return new Object(); + } + + $logged_info = Context::get('logged_info'); + + if($anonymous == TRUE) + { + // 설정에서 익명 이름이 설정되어 있으면 익명 이름을 설정함. 없을 경우 Anonymous 를 사용한다. + if(!$config->anonymous_name) + { + $anonymous_name = 'Anonymous'; + } + else + { + $anonymous_name = $config->anonymous_name; + } + // 익명 노티 시 회원정보 제거 + $args->target_member_srl = 0; + $args->target_nick_name = $anonymous_name; + $args->target_user_id = $anonymous_name; + $args->target_email_address = $anonymous_name; + } + else if($logged_info) + { + // 익명 노티가 아닐 때 로그인 세션의 회원정보 넣기 + $args->target_member_srl = $logged_info->member_srl; + $args->target_nick_name = $logged_info->nick_name; + $args->target_user_id = $logged_info->user_id; + $args->target_email_address = $logged_info->email_address; + } + else if($args->target_member_srl) + { + $oMemberModel = getModel('member'); + $member_info = $oMemberModel->getMemberInfoByMemberSrl($args->target_member_srl); + $args->target_member_srl = $member_info->member_srl; + $args->target_nick_name = $member_info->nick_name; + $args->target_user_id = $member_info->user_id; + $args->target_email_address = $member_info->email_address; + } + else + { + // 비회원 + $args->target_member_srl = 0; + $args->target_user_id = ''; + } + + $output = executeQuery('ncenterlite.insertNotify', $args); + if(!$output->toBool()) + { + return $output; + } + + if($output->toBool()) + { + $trigger_notify = ModuleHandler::triggerCall('ncenterlite._insertNotify', 'after', $args); + if(!$trigger_notify->toBool()) + { + return $trigger_notify; + } + } + + $flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($args->target_member_srl) . $args->target_member_srl . '.php'; + if(file_exists($flag_path)) + { + //remove flag files + FileHandler::removeFile($flag_path); + } + + return $output; + } + + public static function updateFlagFile($member_srl = null, $output) + { + if(!$member_srl) + { + return; + } + $flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php'; + if(file_exists($flag_path)) + { + return; + } + + FileHandler::makeDir(\RX_BASEDIR . 'files/cache/ncenterlite/new_notify' . getNumberingPath($member_srl)); + $buff = "member_srl . $args->srl . $args->target_srl . $args->type . $args->target_type); + } + + /** + * @brief 멘션 대상 member_srl 목록 반환 + * @return array + **/ + function _getMentionTarget($content) + { + $oNcenterliteModel = getModel('ncenterlite'); + $config = $oNcenterliteModel->getConfig(); + $logged_info = Context::get('logged_info'); + + $list = array(); + + $content = strip_tags($content); + $content = str_replace(' ', ' ', $content); + + // 정규표현식 정리 + $split = array(); + if(in_array('comma', $config->mention_format)) + { + $split[] = ','; + } + $regx = join('', array('/(^|\s)@([^@\s', join('', $split), ']+)/i')); + + preg_match_all($regx, $content, $matches); + + // '님'문자 이후 제거 + if(in_array('respect', $config->mention_format)) + { + $nick_name = array_unique($matches[2]); + foreach($nick_name as $nick) + { + $nick_member_srl = getModel('member')->getMemberSrlByNickName($nick); + if($nick_member_srl) + { + $list[] = $nick_member_srl; + } + } + if(!empty($list)) + { + return $list; + } + foreach($matches[2] as $idx => $item) + { + $pos = strpos($item, '님'); + if($pos !== false && $pos > 0) + { + $matches[2][$idx] = trim(substr($item, 0, $pos)); + if($logged_info && $logged_info->nick_name == $matches[2][$idx]) + { + unset($matches[2][$idx]); + } + } + } + } + $nicks = array_unique($matches[2]); + + $oMemberModel = getModel('member'); + $member_config = $oMemberModel->getMemberConfig(); + + if($config->mention_names == 'id' && $member_config->identifier != 'email_address') + { + foreach($nicks as $user_id) + { + $id_member_srl = $oMemberModel->getMemberSrlByUserID($user_id); + if($id_member_srl) + { + $list[] = $id_member_srl; + } + } + } + else + { + foreach($nicks as $nick_name) + { + $nick_member_srl = $oMemberModel->getMemberSrlByNickName($nick_name); + if($nick_member_srl) + { + $list[] = $nick_member_srl; + } + } + } + + return $list; + } +} diff --git a/modules/ncenterlite/ncenterlite.mobile.php b/modules/ncenterlite/ncenterlite.mobile.php new file mode 100644 index 000000000..8d8a5a7c0 --- /dev/null +++ b/modules/ncenterlite/ncenterlite.mobile.php @@ -0,0 +1,38 @@ +getConfig(); + $template_path = sprintf("%sm.skins/%s/",$this->module_path, $config->mskin); + if(!is_dir($template_path)||!$config->mskin) + { + $config->skin = 'default'; + $template_path = sprintf("%sm.skins/%s/",$this->module_path, $config->mskin); + } + $this->setTemplatePath($template_path); + + $oLayoutModel = getModel('layout'); + $layout_info = $oLayoutModel->getLayout($config->mlayout_srl); + + if($layout_info) + { + $this->module_info->mlayout_srl = $config->mlayout_srl; + $this->setLayoutPath($layout_info->path); + } + + } + + function dispNcenterliteNotifyList() + { + parent::dispNcenterliteNotifyList(); + } + + function dispNcenterliteUserConfig() + { + parent::dispNcenterliteUserConfig(); + } + +} diff --git a/modules/ncenterlite/ncenterlite.model.php b/modules/ncenterlite/ncenterlite.model.php new file mode 100644 index 000000000..35234564e --- /dev/null +++ b/modules/ncenterlite/ncenterlite.model.php @@ -0,0 +1,393 @@ +getModuleConfig('ncenterlite'); + + if(!$config) + { + $config = new stdClass(); + } + if(!$config->use) + { + $config->use = array(); + } + if(!$config->display_use) $config->display_use = 'Y'; + + if(!$config->mention_names) $config->mention_names = 'nick_name'; + if(!$config->mention_format && !is_array($config->mention_format)) $config->mention_format = array('respect'); + if(!is_array($config->mention_format)) $config->mention_format = explode('|@|', $config->mention_format); + if(!$config->document_notify) $config->document_notify = 'direct-comment'; + if(!$config->hide_module_srls) $config->hide_module_srls = array(); + if(!is_array($config->hide_module_srls)) $config->hide_module_srls = explode('|@|', $config->hide_module_srls); + if(!$config->document_read) $config->document_read = 'N'; + if(!$config->voted_format) $config->voted_format = 'N'; + if(!$config->skin) $config->skin = 'default'; + if(!$config->colorset) $config->colorset = 'black'; + if(!$config->zindex) $config->zindex = '9999'; + + self::$config = $config; + } + + return self::$config; + } + + function getNotifyTypebySrl($notify_srl='') + { + $args = new stdClass(); + $args->notify_type_srl = $notify_srl; + + $output = executeQuery('ncenterlite.getNotifyType',$args); + + return $output; + } + + function getNotifyTypeString($notify_srl='',$notify_args) + { + $this->notify_args = $notify_args; + + $output = $this->getNotifyTypebySrl($notify_srl); + + $this->notify_arguments = explode("|",$output->data->notify_type_args); + $string = preg_replace_callback("/%([^%]*)%/",array($this, 'replaceNotifyType'),$output->data->notify_string); + + return $string; + } + + function replaceNotifyType($match) + { + //if replace string is not at arguments, return + if(!in_array($match[1],$this->notify_arguments)) + { + return $match[0]; + } + + //if replace string is not set, return + if(!isset($this->notify_args->{$match[1]})) + { + return $match[0]; + } + + return $this->notify_args->{$match[1]}; + } + + function isNotifyTypeExistsbySrl($notify_srl='') + { + $args = new stdClass(); + $args->notify_type_srl = $notify_srl; + + $output = executeQuery('ncenterlite.getNotifyType',$args); + + return isset($output->data->notify_type_id); + } + + function insertNotifyType($args) + { + return executeQuery('ncenterlite.insertNotifyType',$args); + } + + function getMemberConfig($member_srl=null) + { + if(!$member_srl) + { + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + } + + $args = new stdClass(); + $args->member_srl = $member_srl; + $output = executeQuery('ncenterlite.getUserConfig', $args); + if(!$output->data) return $output->data; + + return $output; + } + + function getAllMemberConfig() + { + $output = executeQueryArray('ncenterlite.getAllUserConfig'); + + return $output; + } + + function getMyNotifyList($member_srl=null, $page=1, $readed='N') + { + global $lang; + + $act = Context::get('act'); + if($act=='dispNcenterliteNotifyList') + { + $output = $this->getMyDispNotifyList($member_srl); + } + else + { + $output = $this->_getMyNotifyList($member_srl, $page, $readed); + } + + $oMemberModel = getModel('member'); + $list = $output->data; + + foreach($list as $k => $v) + { + + $target_member = $v->target_nick_name; + + switch($v->type) + { + case 'D': + $type = $lang->ncenterlite_document; //$type = '글'; + break; + case 'C': + $type = $lang->ncenterlite_comment; //$type = '댓글'; + break; + // 메시지. 쪽지 + case 'E': + $type = $lang->ncenterlite_type_message; //$type = '쪽지'; + break; + } + + switch($v->target_type) + { + case 'C': + $str = sprintf($lang->ncenterlite_commented, $target_member, $type, $v->target_summary); + //$str = sprintf('%s님이 회원님의 %s에 "%s" 댓글을 남겼습니다.', $target_member, $type, $v->target_summary); + break; + case 'A': + $str = sprintf($lang->ncenterlite_commented_board, $target_member, $v->target_browser, $v->target_summary); + //$str = sprintf('%1$s님이 게시판 "%2$s""%3$s"라고 댓글을 남겼습니다.', $target_member, $type, $v->target_summary); + break; + case 'M': + $str = sprintf($lang->ncenterlite_mentioned, $target_member, $v->target_summary, $type); + //$str = sprintf('%s님이 "%s" %s에서 회원님을 언급하였습니다.', $target_member, $v->target_summary, $type); + break; + // 메시지. 쪽지 + case 'E': + $str = sprintf($lang->ncenterlite_message_mention,$target_member, $v->target_summary); + break; + case 'T': + $str = sprintf($lang->ncenterlite_test_noti, $target_member); + break; + case 'P': + $str = sprintf($lang->ncenterlite_board, $target_member, $v->target_browser, $v->target_summary); + break; + case 'S': + if($v->target_browser) + { + $str = sprintf($lang->ncenterlite_board, $target_member, $v->target_browser, $v->target_summary); + } + else + { + $str = sprintf($lang->ncenterlite_article, $target_member, $v->target_summary); + } + break; + case 'V': + $str = sprintf($lang->ncenterlite_vote, $target_member, $v->target_summary); + break; + case 'B': + $str = sprintf($lang->ncenterlite_admin_content_message, $target_member, $v->target_browser, $v->target_summary); + break; + } + + if($v->type=='U') + { + $str = $this->getNotifyTypeString($v->notify_type,unserialize($v->target_body)); + } + + $v->text = $str; + $v->ago = $this->getAgo($v->regdate); + $v->url = getUrl('','act','procNcenterliteRedirect', 'notify', $v->notify, 'url', $v->target_url); + if($v->target_member_srl) + { + $profileImage = $oMemberModel->getProfileImage($v->target_member_srl); + $v->profileImage = $profileImage->src; + } + + $list[$k] = $v; + } + + $output->data = $list; + if($page <= 1) + { + $oNcenterliteController = getController('ncenterlite'); + $oNcenterliteController->updateFlagFile($member_srl, $output); + } + return $output; + } + + function getMyNotifyListTpl() + { + $logged_info = Context::get('logged_info'); + if(!$logged_info) return new Object(-1, 'msg_not_permitted'); + + $oMemberModel = getModel('member'); + $memberConfig = $oMemberModel->getMemberConfig(); + $page = Context::get('page'); + + $member_srl = $logged_info->member_srl; + $tmp = $this->getMyNotifyList($member_srl, $page); + foreach($tmp->data as $key => $obj) + { + $tmp->data[$key]->url = str_replace('&', '&', $obj->url); + } + + $list = new stdClass(); + $list->data = $tmp->data; + $list->page = $tmp->page_navigation; + $this->add('list', $list); + $this->add('useProfileImage', $memberConfig->profile_image); + } + + function _getMyNotifyList($member_srl=null, $page=1, $readed='N') + { + if(!$member_srl) + { + $logged_info = Context::get('logged_info'); + if(!$logged_info) return array(); + + $member_srl = $logged_info->member_srl; + } + $flag_path = \RX_BASEDIR . 'files/cache/ncenterlite/new_notify/' . getNumberingPath($member_srl) . $member_srl . '.php'; + if(FileHandler::exists($flag_path) && $page <= 1) + { + $output = require_once $flag_path; + if(is_object($output->data)) + { + return $output; + } + } + $args = new stdClass(); + $args->member_srl = $member_srl; + $args->page = $page ? $page : 1; + if($readed) $args->readed = $readed; + $output = executeQueryArray('ncenterlite.getNotifyList', $args); + + if(!$output->data) $output->data = array(); + + return $output; + } + + function getMyDispNotifyList($member_srl = null) + { + if(!$member_srl) + { + $logged_info = Context::get('logged_info'); + $member_srl = $logged_info->member_srl; + } + + $args = new stdClass(); + $args->page = Context::get('page'); + $args->list_count = '20'; + $args->page_count = '10'; + $args->member_srl = $member_srl; + $output = executeQueryArray('ncenterlite.getDispNotifyList', $args); + if(!$output->data) $output->data = array(); + + return $output; + } + + function getNcenterliteAdminList() + { + $args = new stdClass(); + $args->page = Context::get('page'); + $args->list_count = '20'; + $args->page_count = '10'; + $output = executeQueryArray('ncenterlite.getAdminNotifyList', $args); + if(!$output->data) $output->data = array(); + + return $output; + } + + function getMemberAdmins() + { + $args = new stdClass(); + $args->is_admin = 'Y'; + $output = executeQueryArray('ncenterlite.getMemberAdmins', $args); + if(!$output->data) $output->data = array(); + + return $output; + } + + function _getNewCount($member_srl=null) + { + if(!$member_srl) + { + $logged_info = Context::get('logged_info'); + if(!$logged_info) return 0; + + $member_srl = $logged_info->member_srl; + } + + $args = new stdClass(); + $args->member_srl = $member_srl; + $output = executeQuery('ncenterlite.getNotifyNewCount', $args); + if(!$output->data) return 0; + return $output->data->cnt; + } + + + function getColorsetList() + { + $oModuleModel = getModel('module'); + $skin = Context::get('skin'); + + $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin); + + for($i=0, $c=count($skin_info->colorset); $i<$c; $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); + } + + /** + * @brief 주어진 시간이 얼마 전 인지 반환 + * @param string YmdHis + * @return string + **/ + function getAgo($datetime) + { + global $lang; + $lang_type = Context::getLangType(); + + $display = $lang->ncenterlite_date; // array('Year', 'Month', 'Day', 'Hour', 'Minute', 'Second') + + $ago = $lang->ncenterlite_ago; // 'Ago' + + $date = getdate(strtotime(zdate($datetime, 'Y-m-d H:i:s'))); + + $current = getdate(); + $p = array('year', 'mon', 'mday', 'hours', 'minutes', 'seconds'); + $factor = array(0, 12, 30, 24, 60, 60); + + for($i = 0; $i < 6; $i++) + { + if($i > 0) + { + $current[$p[$i]] += $current[$p[$i - 1]] * $factor[$i]; + $date[$p[$i]] += $date[$p[$i - 1]] * $factor[$i]; + } + + if($current[$p[$i]] - $date[$p[$i]] > 1) + { + $value = $current[$p[$i]] - $date[$p[$i]]; + if($lang_type == 'en') + { + return $value . ' ' . $display[$i] . (($value != 1) ? 's' : '') . ' ' . $ago; + } + return $value . $display[$i] . ' ' . $ago; + } + } + + return zdate($datetime, 'Y-m-d'); + } +} diff --git a/modules/ncenterlite/ncenterlite.view.php b/modules/ncenterlite/ncenterlite.view.php new file mode 100644 index 000000000..13c9b4823 --- /dev/null +++ b/modules/ncenterlite/ncenterlite.view.php @@ -0,0 +1,71 @@ +getConfig(); + $template_path = sprintf("%sskins/%s/",$this->module_path, $config->skin); + if(!is_dir($template_path)||!$config->skin) + { + $config->skin = 'default'; + $template_path = sprintf("%sskins/%s/",$this->module_path, $config->skin); + } + $this->setTemplatePath($template_path); + + $oLayoutModel = getModel('layout'); + $layout_info = $oLayoutModel->getLayout($config->layout_srl); + + if($layout_info) + { + $this->module_info->layout_srl = $config->layout_srl; + $this->setLayoutPath($layout_info->path); + } + } + + function dispNcenterliteNotifyList() + { + $oNcenterliteModel = getModel('ncenterlite'); + + $output = $oNcenterliteModel->getMyNotifyList(); + + Context::set('total_count', $output->page_navigation->total_count); + Context::set('total_page', $output->page_navigation->total_page); + Context::set('page', $output->page); + Context::set('ncenterlite_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $this->setTemplateFile('NotifyList'); + } + + function dispNcenterliteUserConfig() + { + $oMemberModel = getModel('member'); + $member_srl = Context::get('member_srl'); + $logged_info = Context::get('logged_info'); + if(!$logged_info) return new Object(-1, 'ncenterlite_stop_login_required'); + + if($logged_info->is_admin == 'Y') + { + $member_info = $oMemberModel->getMemberInfoByMemberSrl($member_srl); + } + if($logged_info->is_admin != 'Y' && $member_srl) + { + if($member_srl != $logged_info->member_srl) + { + return new Object(-1, 'ncenterlite_stop_no_permission_other_user'); + } + } + $oNcenterliteModel = getModel('ncenterlite'); + if(!$member_srl) + { + $member_srl = $logged_info->member_srl; + } + $output = $oNcenterliteModel->getMemberConfig($member_srl); + + Context::set('member_info', $member_info); + Context::set('user_config', $output->data); + $this->setTemplateFile('userconfig'); + } +} diff --git a/modules/ncenterlite/queries/deleteNotify.xml b/modules/ncenterlite/queries/deleteNotify.xml new file mode 100644 index 000000000..53f3b42a6 --- /dev/null +++ b/modules/ncenterlite/queries/deleteNotify.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/modules/ncenterlite/queries/deleteNotifyAll.xml b/modules/ncenterlite/queries/deleteNotifyAll.xml new file mode 100644 index 000000000..f6886172b --- /dev/null +++ b/modules/ncenterlite/queries/deleteNotifyAll.xml @@ -0,0 +1,8 @@ + + +
    + + + + + diff --git a/modules/ncenterlite/queries/deleteNotifyByMemberSrl.xml b/modules/ncenterlite/queries/deleteNotifyByMemberSrl.xml new file mode 100644 index 000000000..35492b021 --- /dev/null +++ b/modules/ncenterlite/queries/deleteNotifyByMemberSrl.xml @@ -0,0 +1,10 @@ + + +
    + + + + + + + diff --git a/modules/ncenterlite/queries/deleteNotifyBySrl.xml b/modules/ncenterlite/queries/deleteNotifyBySrl.xml new file mode 100644 index 000000000..384f992c0 --- /dev/null +++ b/modules/ncenterlite/queries/deleteNotifyBySrl.xml @@ -0,0 +1,10 @@ + + +
    + + + + + + + diff --git a/modules/ncenterlite/queries/deleteNotifyByTargetSrl.xml b/modules/ncenterlite/queries/deleteNotifyByTargetSrl.xml new file mode 100644 index 000000000..202147b77 --- /dev/null +++ b/modules/ncenterlite/queries/deleteNotifyByTargetSrl.xml @@ -0,0 +1,10 @@ + + +
    + + + + + + + diff --git a/modules/ncenterlite/queries/getAdminNotifyList.xml b/modules/ncenterlite/queries/getAdminNotifyList.xml new file mode 100644 index 000000000..d1a12d794 --- /dev/null +++ b/modules/ncenterlite/queries/getAdminNotifyList.xml @@ -0,0 +1,11 @@ + + +
    + + + + + + + + diff --git a/modules/ncenterlite/queries/getAllUserConfig.xml b/modules/ncenterlite/queries/getAllUserConfig.xml new file mode 100644 index 000000000..61bb35180 --- /dev/null +++ b/modules/ncenterlite/queries/getAllUserConfig.xml @@ -0,0 +1,11 @@ + + +
    + + + + + + + + diff --git a/modules/ncenterlite/queries/getCountNewMessage.xml b/modules/ncenterlite/queries/getCountNewMessage.xml new file mode 100644 index 000000000..ba1aa4a84 --- /dev/null +++ b/modules/ncenterlite/queries/getCountNewMessage.xml @@ -0,0 +1,13 @@ + + +
    + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getDispNotifyList.xml b/modules/ncenterlite/queries/getDispNotifyList.xml new file mode 100644 index 000000000..e39b573b2 --- /dev/null +++ b/modules/ncenterlite/queries/getDispNotifyList.xml @@ -0,0 +1,20 @@ + + +
    + + + + + + + + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getMemberAdmins.xml b/modules/ncenterlite/queries/getMemberAdmins.xml new file mode 100644 index 000000000..46a776b5c --- /dev/null +++ b/modules/ncenterlite/queries/getMemberAdmins.xml @@ -0,0 +1,12 @@ + + +
    + + + + + + + + + diff --git a/modules/ncenterlite/queries/getMemberSrlById.xml b/modules/ncenterlite/queries/getMemberSrlById.xml new file mode 100644 index 000000000..2fcec16c1 --- /dev/null +++ b/modules/ncenterlite/queries/getMemberSrlById.xml @@ -0,0 +1,13 @@ + + +
    + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getMemberSrlByNickName.xml b/modules/ncenterlite/queries/getMemberSrlByNickName.xml new file mode 100644 index 000000000..3bb63a178 --- /dev/null +++ b/modules/ncenterlite/queries/getMemberSrlByNickName.xml @@ -0,0 +1,13 @@ + + +
    + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getMemberTotals.xml b/modules/ncenterlite/queries/getMemberTotals.xml new file mode 100644 index 000000000..9036bc858 --- /dev/null +++ b/modules/ncenterlite/queries/getMemberTotals.xml @@ -0,0 +1,12 @@ + + +
    + + + + + + + + + diff --git a/modules/ncenterlite/queries/getNotifyList.xml b/modules/ncenterlite/queries/getNotifyList.xml new file mode 100644 index 000000000..fc8901dde --- /dev/null +++ b/modules/ncenterlite/queries/getNotifyList.xml @@ -0,0 +1,21 @@ + + +
    + + + + + + + + + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getNotifyNewCount.xml b/modules/ncenterlite/queries/getNotifyNewCount.xml new file mode 100644 index 000000000..dd6b55f1f --- /dev/null +++ b/modules/ncenterlite/queries/getNotifyNewCount.xml @@ -0,0 +1,14 @@ + + +
    + + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getNotifyType.xml b/modules/ncenterlite/queries/getNotifyType.xml new file mode 100644 index 000000000..803ce2aba --- /dev/null +++ b/modules/ncenterlite/queries/getNotifyType.xml @@ -0,0 +1,13 @@ + + +
    + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getNotifyTypeByID.xml b/modules/ncenterlite/queries/getNotifyTypeByID.xml new file mode 100644 index 000000000..c2977adfe --- /dev/null +++ b/modules/ncenterlite/queries/getNotifyTypeByID.xml @@ -0,0 +1,13 @@ + + +
    + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getSocialxeCount.xml b/modules/ncenterlite/queries/getSocialxeCount.xml new file mode 100644 index 000000000..33b2c96ae --- /dev/null +++ b/modules/ncenterlite/queries/getSocialxeCount.xml @@ -0,0 +1,13 @@ + + +
    + + + + + + + + + + diff --git a/modules/ncenterlite/queries/getUserConfig.xml b/modules/ncenterlite/queries/getUserConfig.xml new file mode 100644 index 000000000..2a0ce0f41 --- /dev/null +++ b/modules/ncenterlite/queries/getUserConfig.xml @@ -0,0 +1,13 @@ + + +
    + + + + + + + + + + diff --git a/modules/ncenterlite/queries/insertNotify.xml b/modules/ncenterlite/queries/insertNotify.xml new file mode 100644 index 000000000..24e96cdd4 --- /dev/null +++ b/modules/ncenterlite/queries/insertNotify.xml @@ -0,0 +1,24 @@ + + +
    + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/ncenterlite/queries/insertNotifyType.xml b/modules/ncenterlite/queries/insertNotifyType.xml new file mode 100644 index 000000000..5f1e1f27e --- /dev/null +++ b/modules/ncenterlite/queries/insertNotifyType.xml @@ -0,0 +1,11 @@ + + +
    + + + + + + + + diff --git a/modules/ncenterlite/queries/insertUserConfig.xml b/modules/ncenterlite/queries/insertUserConfig.xml new file mode 100644 index 000000000..c2bc581e3 --- /dev/null +++ b/modules/ncenterlite/queries/insertUserConfig.xml @@ -0,0 +1,12 @@ + + +
    + + + + + + + + + diff --git a/modules/ncenterlite/queries/updateNotifyReaded.xml b/modules/ncenterlite/queries/updateNotifyReaded.xml new file mode 100644 index 000000000..23f9f24bc --- /dev/null +++ b/modules/ncenterlite/queries/updateNotifyReaded.xml @@ -0,0 +1,12 @@ + + +
    + + + + + + + + + diff --git a/modules/ncenterlite/queries/updateNotifyReadedAll.xml b/modules/ncenterlite/queries/updateNotifyReadedAll.xml new file mode 100644 index 000000000..935cea3bf --- /dev/null +++ b/modules/ncenterlite/queries/updateNotifyReadedAll.xml @@ -0,0 +1,11 @@ + + +
    + + + + + + + + diff --git a/modules/ncenterlite/queries/updateNotifyReadedBySrl.xml b/modules/ncenterlite/queries/updateNotifyReadedBySrl.xml new file mode 100644 index 000000000..2ecae2689 --- /dev/null +++ b/modules/ncenterlite/queries/updateNotifyReadedBySrl.xml @@ -0,0 +1,13 @@ + + +
    + + + + + + + + + + diff --git a/modules/ncenterlite/queries/updateNotifyReadedByTargetSrl.xml b/modules/ncenterlite/queries/updateNotifyReadedByTargetSrl.xml new file mode 100644 index 000000000..842363152 --- /dev/null +++ b/modules/ncenterlite/queries/updateNotifyReadedByTargetSrl.xml @@ -0,0 +1,12 @@ + + +
    + + + + + + + + + diff --git a/modules/ncenterlite/queries/updateNotifyReadedByType.xml b/modules/ncenterlite/queries/updateNotifyReadedByType.xml new file mode 100644 index 000000000..6f6328df3 --- /dev/null +++ b/modules/ncenterlite/queries/updateNotifyReadedByType.xml @@ -0,0 +1,12 @@ + + +
    + + + + + + + + + diff --git a/modules/ncenterlite/queries/updateUserConfig.xml b/modules/ncenterlite/queries/updateUserConfig.xml new file mode 100644 index 000000000..7bfcb07d6 --- /dev/null +++ b/modules/ncenterlite/queries/updateUserConfig.xml @@ -0,0 +1,14 @@ + + +
    + + + + + + + + + + + diff --git a/modules/ncenterlite/ruleset/insertConfig.xml b/modules/ncenterlite/ruleset/insertConfig.xml new file mode 100644 index 000000000..8cebec2e1 --- /dev/null +++ b/modules/ncenterlite/ruleset/insertConfig.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/modules/ncenterlite/schemas/ncenterlite_notify.xml b/modules/ncenterlite/schemas/ncenterlite_notify.xml new file mode 100644 index 000000000..083da9708 --- /dev/null +++ b/modules/ncenterlite/schemas/ncenterlite_notify.xml @@ -0,0 +1,24 @@ +
    + + + + + + + + + + + + + + + + + + + + + + +
    diff --git a/modules/ncenterlite/schemas/ncenterlite_notify_type.xml b/modules/ncenterlite/schemas/ncenterlite_notify_type.xml new file mode 100644 index 000000000..5beb4bf6e --- /dev/null +++ b/modules/ncenterlite/schemas/ncenterlite_notify_type.xml @@ -0,0 +1,6 @@ + + + + + +
    diff --git a/modules/ncenterlite/schemas/ncenterlite_user_set.xml b/modules/ncenterlite/schemas/ncenterlite_user_set.xml new file mode 100644 index 000000000..0562ed1e4 --- /dev/null +++ b/modules/ncenterlite/schemas/ncenterlite_user_set.xml @@ -0,0 +1,7 @@ + + + + + + +
    diff --git a/modules/ncenterlite/skins/default/NotifyList.html b/modules/ncenterlite/skins/default/NotifyList.html new file mode 100644 index 000000000..dae56b337 --- /dev/null +++ b/modules/ncenterlite/skins/default/NotifyList.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + {@ + $oMemberModel = getModel('member'); + $member_info = $oMemberModel->getMemberInfoByMemberSrl($val->member_srl); + } + + + + + + + + + +
    {$lang->ncenterlite_sender}{$lang->ncenterlite_addressee}{$lang->ncenterlite_noti_contents}{$lang->ncenterlite_read}{$lang->date}
    {$val->target_nick_name}{$member_info->nick_name} {$lang->ncenterlite_no_target}{$val->text} + {$lang->ncenterlite_read_y} + {$lang->ncenterlite_read_n} + + {zdate($val->regdate,"Y-m-d")} +
    + {zdate($val->regdate,"H:i:s")} +
    + + + + \ No newline at end of file diff --git a/modules/ncenterlite/skins/default/img/p.png b/modules/ncenterlite/skins/default/img/p.png new file mode 100644 index 000000000..44e3d8d12 Binary files /dev/null and b/modules/ncenterlite/skins/default/img/p.png differ diff --git a/modules/ncenterlite/skins/default/ncenterlite.black.css b/modules/ncenterlite/skins/default/ncenterlite.black.css new file mode 100644 index 000000000..6f2596f91 --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.black.css @@ -0,0 +1,15 @@ +#nc_container { border-bottom-color:#555; background-color:#333; color:#B0B0B0; opacity:0.95; } +#nc_container a { color:#B0B0B0; } +#nc_container a:hover { color:#B0B0B0; } +#nc_container strong { color:#F3F3F3; } + +#nc_container .list { background-color:#333; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#555; } +#nc_container .list li a:hover { background-color:#555; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list .more { background: #555; } +#nc_container a.readall { display:none; color:#555; color:#D83722;} + +#nc_container a.notify { color:white; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/skins/default/ncenterlite.blacknoprofile.css b/modules/ncenterlite/skins/default/ncenterlite.blacknoprofile.css new file mode 100644 index 000000000..88c94a4a4 --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.blacknoprofile.css @@ -0,0 +1,17 @@ +#nc_container { border-bottom-color:#555; background-color:#333; color:#B0B0B0; opacity:0.95; } +#nc_container a { color:#B0B0B0; } +#nc_container a:hover { color:#B0B0B0; } +#nc_container strong { color:#F3F3F3; } + +#nc_container .list { background-color:#333; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#555; } +#nc_container .list li a:hover { background-color:#555; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list .more { background: #555; } +#nc_container a.readall { display:none; color:#555; color:#D83722;} + +#nc_container a.notify { color:white; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/skins/default/ncenterlite.css b/modules/ncenterlite/skins/default/ncenterlite.css new file mode 100644 index 000000000..60df8e548 --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.css @@ -0,0 +1,185 @@ +#nc_container { + z-index:99; + position:fixed; + top:0; + left:0; + margin:0; + padding:0; + width:100%; + height:30px; + border-bottom:1px solid; + font-size:12px; + line-height:15px; +} + +.ncenterlite_block { + height:28px; +} + +#nc_container a { + padding:0; + font-size:12px; + text-decoration:none; +} + +#nc_container ul.nc_memu { + display:block; + margin:0; + padding:4px; + list-style:none; + line-height:20px; +} + +#nc_container ul:after { + content:""; + display:block; + clear:both; +} + +#nc_container ul.nc_memu li { + display:inline-block; + padding:0 5px; + height:20px; + width:auto; + background:transparent!important; +} + +#nc_container ul.nc_memu li.fLeft { + float:left; +} + +#nc_container ul.nc_memu li.fRight { + float:right; +} + +#nc_container ul.nc_memu li a.notify { + display:block; + float:left; +} + +#nc_container a.close { + display:block; +} + +#nc_container .nc_profile img { + width:20px; + height:20px; + vertical-align:top; +} + +#nc_container a.notify .num { + padding:1px 2px; + border:0; + border-radius:3px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + font-size:12px; + font-weight:700; + font-family:Gulim,"lucida grande",tahoma,verdana,arial,sans-serif; +} + +#nc_container .list { + display:none; + position:absolute; + top:30px; + left:0; + max-width:330px; + width:330px; + box-sizing:border-box; + -moz-box-sizing:border-box; + -webkit-box-sizing:border-box; + -o-box-sizing:border-box; +} + +#nc_container a.readall { + display:none; + float:left; + margin:0 4px; + font-size:11px; + font-weight:700; +} + +#nc_container .listscroll { + overflow-y:auto; + overflow-x:hidden; +} + +#nc_container .list ul { + overflow:hidden; + margin:-1px 0; + padding:0; + list-style:none; +} + +#nc_container .list li { + margin:-1px 0; + border:1px solid #555; + border-width:1px 0; +} + +#nc_container .list li img { + float:left; + margin-right:5px; + width:45px; + height:45px; + border:0; +} + +#nc_container .list li a { + display:block; + overflow:hidden; + padding:10px; + font-size:12px; +} + +#nc_container .list span.ago { + display:block; + font-size:10px; +} + +#nc_container .list .more { + display:block; + padding:10px; + text-align:center; +} + +#nc_container ~ .navbar.navbar-fixed-top { + top:28px; +} + +#nc_container a:hover,#nc_container .list li a:hover,#nc_container .list .more:hover { + text-decoration:none; +} + +@media only screen and max-device-width 480px { + #nc_container { + position:relative; + height:auto; + } + + #nc_container .list { + top:2px; + position:relative; + } + + #nc_container .list ul { + display:block; + position:relative; + } + + #nc_container ul.nc_memu:after { + content:""; + display:block; + visibility:hidden; + height:0; + clear:both; + } + + #nc_container .listscroll { + overflow:visible; + } + + .ncenterlite_block { + display:none; + } +} diff --git a/modules/ncenterlite/skins/default/ncenterlite.gray.css b/modules/ncenterlite/skins/default/ncenterlite.gray.css new file mode 100644 index 000000000..4d167ea21 --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.gray.css @@ -0,0 +1,16 @@ +#nc_container { border-bottom-color:#C0C0C0; background-color:#efefef; color:#666; opacity:0.95; } +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#666; } +#nc_container a.notify strong { color:#FC2772; } +#nc_container .list { background-color:#efefef; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#ddd; } +#nc_container .list li a:hover { background-color: #ddd; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify sup.num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #ddd; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/skins/default/ncenterlite.graynoprofile.css b/modules/ncenterlite/skins/default/ncenterlite.graynoprofile.css new file mode 100644 index 000000000..d8704070b --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.graynoprofile.css @@ -0,0 +1,18 @@ +#nc_container { border-bottom-color:#C0C0C0; background-color:#efefef; color:#666; opacity:0.95; } +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#666; } +#nc_container a.notify strong { color:#FC2772; } +#nc_container .list { background-color:#efefef; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#ddd; } +#nc_container .list li a:hover { background-color: #ddd; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify sup.num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #ddd; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/skins/default/ncenterlite.html b/modules/ncenterlite/skins/default/ncenterlite.html new file mode 100644 index 000000000..39d6ebe10 --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.html @@ -0,0 +1,125 @@ + +
    + + diff --git a/modules/ncenterlite/skins/default/ncenterlite.mobile.css b/modules/ncenterlite/skins/default/ncenterlite.mobile.css new file mode 100644 index 000000000..ef3125177 --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.mobile.css @@ -0,0 +1,12 @@ +#nc_container { height:auto; position:relative; } +#nc_container .list { top:2px; position:relative; } +#nc_container .list ul { display:block; position:relative; } +#nc_container ul.nc_memu:after { + content: ""; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +#nc_container .listscroll { overflow: visible; } +.ncenterlite_block { display:none; } diff --git a/modules/ncenterlite/skins/default/ncenterlite.white.css b/modules/ncenterlite/skins/default/ncenterlite.white.css new file mode 100644 index 000000000..c3fd4444a --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.white.css @@ -0,0 +1,16 @@ +#nc_container { border:1px solid #efefef; background-color:#fff; color:#000; opacity:0.95; } +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#000; } +#nc_container a.notify strong { color:#F60; } +#nc_container .list { border:1px solid #efefef; background-color:#fff; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#eee; } +#nc_container .list li a:hover { background-color: #eee; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify .num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #eee; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/skins/default/ncenterlite.whitenoprofile.css b/modules/ncenterlite/skins/default/ncenterlite.whitenoprofile.css new file mode 100644 index 000000000..69342bd1d --- /dev/null +++ b/modules/ncenterlite/skins/default/ncenterlite.whitenoprofile.css @@ -0,0 +1,18 @@ +#nc_container { border:1px solid #efefef; background-color:#fff; color:#000; opacity:0.95; } +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#000; } +#nc_container a.notify strong { color:#F60; } +#nc_container .list { border:1px solid #efefef; background-color:#fff; filter:alpha(opacity=97); opacity:0.97; -moz-opacity:0.97; } +#nc_container .list li { border-color:#eee; } +#nc_container .list li a:hover { background-color: #eee; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify .num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #eee; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/skins/default/skin.xml b/modules/ncenterlite/skins/default/skin.xml new file mode 100644 index 000000000..78ac42418 --- /dev/null +++ b/modules/ncenterlite/skins/default/skin.xml @@ -0,0 +1,40 @@ + + + XE 알림센터 Lite 기본스킨 + XE Notification Center Lite Default Skin + 1.1.1 + 2013-03-21 + + + XE Public + XE Public + + + + + 검은색 + Black + + + 회색 + Gray + + + 흰색 + White + + + + 검은색(no profile) + Black (no profile) + + + 회색(no profile) + Gray (no profile) + + + 흰색(no profile) + White (no profile) + + + diff --git a/modules/ncenterlite/skins/default/userconfig.html b/modules/ncenterlite/skins/default/userconfig.html new file mode 100644 index 000000000..fffbfeaeb --- /dev/null +++ b/modules/ncenterlite/skins/default/userconfig.html @@ -0,0 +1,68 @@ + + +
    + +
    +

    {$XE_VALIDATOR_MESSAGE}

    +
    + + +
    + + + + +
    +

    {@$user_str = $member_info->nick_name} + {@$user_str = $logged_info->nick_name} + {@$title_str = Context::getLang('ncenterlite_userconfig_title')} + {sprintf($title_str, $user_str)} +

    + +

    {$lang->ncenterlite_userconfig_about} ({$lang->ncenterlite_userconfig_about_warning})

    +
    + +
    + + +

    {$lang->ncenterlite_comment_noti_about}

    +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_mention_noti_about}

    +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_message_noti_about}

    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/modules/ncenterlite/skins/default_bottom/NotifyList.html b/modules/ncenterlite/skins/default_bottom/NotifyList.html new file mode 100644 index 000000000..dae56b337 --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/NotifyList.html @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + {@ + $oMemberModel = getModel('member'); + $member_info = $oMemberModel->getMemberInfoByMemberSrl($val->member_srl); + } + + + + + + + + + +
    {$lang->ncenterlite_sender}{$lang->ncenterlite_addressee}{$lang->ncenterlite_noti_contents}{$lang->ncenterlite_read}{$lang->date}
    {$val->target_nick_name}{$member_info->nick_name} {$lang->ncenterlite_no_target}{$val->text} + {$lang->ncenterlite_read_y} + {$lang->ncenterlite_read_n} + + {zdate($val->regdate,"Y-m-d")} +
    + {zdate($val->regdate,"H:i:s")} +
    + + + + \ No newline at end of file diff --git a/modules/ncenterlite/skins/default_bottom/img/p.png b/modules/ncenterlite/skins/default_bottom/img/p.png new file mode 100644 index 000000000..44e3d8d12 Binary files /dev/null and b/modules/ncenterlite/skins/default_bottom/img/p.png differ diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.black.css b/modules/ncenterlite/skins/default_bottom/ncenterlite.black.css new file mode 100644 index 000000000..e0eb7f2ac --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.black.css @@ -0,0 +1,15 @@ +#nc_container { border-bottom-color:#555; background-color:#333; color:#B0B0B0; opacity:0.95;} +#nc_container a { color:#B0B0B0; } +#nc_container a:hover { color:#B0B0B0; } +#nc_container strong { color:#F3F3F3; } + +#nc_container .list { background-color:#333; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#555; } +#nc_container .list li a:hover { background-color:#555; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list .more { background: #555; } +#nc_container a.readall { display:none; color:#555; color:#D83722;} + +#nc_container a.notify { color:white; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.blacknoprofile.css b/modules/ncenterlite/skins/default_bottom/ncenterlite.blacknoprofile.css new file mode 100644 index 000000000..3db203843 --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.blacknoprofile.css @@ -0,0 +1,17 @@ +#nc_container { border-bottom-color:#555; background-color:#333; color:#B0B0B0; opacity:0.95;} +#nc_container a { color:#B0B0B0; } +#nc_container a:hover { color:#B0B0B0; } +#nc_container strong { color:#F3F3F3; } + +#nc_container .list { background-color:#333; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#555; } +#nc_container .list li a:hover { background-color:#555; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list .more { background: #555; } +#nc_container a.readall { display:none; color:#555; color:#D83722;} + +#nc_container a.notify { color:white; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.css b/modules/ncenterlite/skins/default_bottom/ncenterlite.css new file mode 100644 index 000000000..d22532260 --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.css @@ -0,0 +1,177 @@ +#nc_container { + z-index:99; + position:fixed; + bottom:0; + right:0; + margin:0; + padding:0; + width:330px; + height:50px; + border-bottom:1px solid; + font-size:12px; + line-height:15px; +} + +#nc_container a { + padding:0; + font-size:12px; + text-decoration:none; +} + +#nc_container ul.nc_memu { + display:block; + margin:0; + padding:4px; + list-style:none; + line-height:20px; +} + +#nc_container ul:after { + content:""; + display:block; + clear:both; +} + +#nc_container ul.nc_memu li { + display:inline-block; + padding:0 5px; + height:20px; + width:auto; + background:transparent!important; +} + +#nc_container ul.nc_memu li.fLeft { + float:left; +} + +#nc_container ul.nc_memu li.fRight { + float:right; +} + +#nc_container ul.nc_memu li a.notify { + display:block; + float:left; +} + +#nc_container a.close { + display:block; +} + +#nc_container .nc_profile img { + width:20px; + height:20px; + vertical-align:top; +} + +#nc_container a.notify .num { + padding:1px 2px; + border:0; + border-radius:3px; + -webkit-border-radius:3px; + -moz-border-radius:3px; + font-size:12px; + font-weight:700; + font-family:Gulim,"lucida grande",tahoma,verdana,arial,sans-serif; +} + +#nc_container .list { + display:none; + position:absolute; + left:0; + bottom:50px; + max-width:330px; + width:330px; + box-sizing:border-box; + -moz-box-sizing:border-box; + -webkit-box-sizing:border-box; + -o-box-sizing:border-box; +} + +#nc_container a.readall { + display:none; + float:left; + margin:0 4px; + font-size:11px; + font-weight:700; +} + +#nc_container .listscroll { + overflow-y:auto; + overflow-x:hidden; +} + +#nc_container .list ul { + overflow:hidden; + margin:-1px 0; + padding:0; + list-style:none; +} + +#nc_container .list li { + margin:-1px 0; + border:1px solid #555; + border-width:1px 0; +} + +#nc_container .list li img { + float:left; + margin-right:5px; + width:45px; + height:45px; + border:0; +} + +#nc_container .list li a { + display:block; + overflow:hidden; + padding:10px; + font-size:12px; +} + +#nc_container .list span.ago { + display:block; + font-size:10px; +} + +#nc_container .list .more { + display:block; + padding:10px; + text-align:center; +} + +#nc_container a:hover,#nc_container .list li a:hover,#nc_container .list .more:hover { + text-decoration:none; +} + +@media only screen and max-device-width 480px { + #nc_container { + position:relative; + height:auto; + } + + #nc_container .list { + top:2px; + position:relative; + } + + #nc_container .list ul { + display:block; + position:relative; + } + + #nc_container ul.nc_memu:after { + content:""; + display:block; + visibility:hidden; + height:0; + clear:both; + } + + #nc_container .listscroll { + overflow:visible; + } + + .ncenterlite_block { + display:none; + } +} diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.gray.css b/modules/ncenterlite/skins/default_bottom/ncenterlite.gray.css new file mode 100644 index 000000000..91f3e6898 --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.gray.css @@ -0,0 +1,16 @@ +#nc_container { border-bottom-color:#C0C0C0; background-color:#efefef; color:#666; opacity:0.95;} +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#666; } +#nc_container a.notify strong { color:#FC2772; } +#nc_container .list { background-color:#efefef; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#ddd; } +#nc_container .list li a:hover { background-color: #ddd; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify sup.num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #ddd; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.graynoprofile.css b/modules/ncenterlite/skins/default_bottom/ncenterlite.graynoprofile.css new file mode 100644 index 000000000..b7a8c5d5a --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.graynoprofile.css @@ -0,0 +1,18 @@ +#nc_container { border-bottom-color:#C0C0C0; background-color:#efefef; color:#666; opacity:0.95;} +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#666; } +#nc_container a.notify strong { color:#FC2772; } +#nc_container .list { background-color:#efefef; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#ddd; } +#nc_container .list li a:hover { background-color: #ddd; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify sup.num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #ddd; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.html b/modules/ncenterlite/skins/default_bottom/ncenterlite.html new file mode 100644 index 000000000..b4a5b5703 --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.html @@ -0,0 +1,124 @@ + + + diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.mobile.css b/modules/ncenterlite/skins/default_bottom/ncenterlite.mobile.css new file mode 100644 index 000000000..c221ae4da --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.mobile.css @@ -0,0 +1,12 @@ +#nc_container { width:100%; height:auto; position:relative; } +#nc_container .list { top:2px; position:relative; } +#nc_container .list ul { display:block; position:relative; } +#nc_container ul.nc_memu:after { + content: ""; + display: block; + height: 0; + clear: both; + visibility: hidden; +} +#nc_container .listscroll { overflow: visible; } +.ncenterlite_block { display:none; } diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.white.css b/modules/ncenterlite/skins/default_bottom/ncenterlite.white.css new file mode 100644 index 000000000..5cd778257 --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.white.css @@ -0,0 +1,16 @@ +#nc_container { border:1px solid #EFEFEF; background-color:#fff; color:#000; opacity:0.95;} +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#000; } +#nc_container a.notify strong { color:#F60; } +#nc_container .list { border:1px solid #EFEFEF; background-color:#fff; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#eee; } +#nc_container .list li a:hover { background-color: #eee; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify .num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #eee; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } diff --git a/modules/ncenterlite/skins/default_bottom/ncenterlite.whitenoprofile.css b/modules/ncenterlite/skins/default_bottom/ncenterlite.whitenoprofile.css new file mode 100644 index 000000000..175a58afe --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/ncenterlite.whitenoprofile.css @@ -0,0 +1,18 @@ +#nc_container { border:1px solid #EFEFEF; background-color:#fff; color:#000; opacity:0.95;} +#nc_container a { color:#666; } +#nc_container a:hover { color:#666; } +#nc_container strong { color:#000; } +#nc_container a.notify strong { color:#F60; } +#nc_container .list { border:1px solid #EFEFEF; background-color:#fff; filter:alpha(opacity=95); opacity:0.95; -moz-opacity:0.95; } +#nc_container .list li { border-color:#eee; } +#nc_container .list li a:hover { background-color: #eee; } +#nc_container .list span.ago { color:#D4AF37; } +#nc_container .list a.notify .num { background-color:#D83722; color:white; } +#nc_container .list .more { background: #eee; } +#nc_container a.readall { display:none; color:#555; font-size:10px; color:#D83722;} + +#nc_container a.notify { color:#666; } +#nc_container a.notify .num { background-color:#D83722; color:white; } +#nc_container ul.nc_memu li { padding-right:5px; } + +#nc_container img.nc_profile_img { display:none;} diff --git a/modules/ncenterlite/skins/default_bottom/skin.xml b/modules/ncenterlite/skins/default_bottom/skin.xml new file mode 100644 index 000000000..aeecfd5cf --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/skin.xml @@ -0,0 +1,40 @@ + + + XE 알림센터 Lite 기본스킨 - 우측 하단 + XE Notification Center Lite Default Skin - Right bottom + 1.2.0 + 2013-05-10 + + + XE Public + XE Public + + + + + 검은색 + Black + + + 회색 + Gray + + + 흰색 + White + + + + 검은색(no profile) + Black (no profile) + + + 회색(no profile) + Gray (no profile) + + + 흰색(no profile) + White (no profile) + + + diff --git a/modules/ncenterlite/skins/default_bottom/userconfig.html b/modules/ncenterlite/skins/default_bottom/userconfig.html new file mode 100644 index 000000000..52e2e2f0b --- /dev/null +++ b/modules/ncenterlite/skins/default_bottom/userconfig.html @@ -0,0 +1,68 @@ + + +
    + +
    +

    {$XE_VALIDATOR_MESSAGE}

    +
    + + +
    + + + + +
    +

    {@$user_str = $member_info->nick_name} + {@$user_str = $logged_info->nick_name} + {@$title_str = Context::getLang('ncenterlite_userconfig_title')} + {sprintf($title_str, $user_str)} +

    + +

    {$lang->ncenterlite_userconfig_about} ({$lang->ncenterlite_userconfig_about_warning})

    +
    + +
    + + +

    {$lang->ncenterlite_comment_noti_about}

    +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_mention_noti_about}

    +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_message_noti_about}

    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + \ No newline at end of file diff --git a/modules/ncenterlite/tpl/config.html b/modules/ncenterlite/tpl/config.html new file mode 100644 index 000000000..33d4a0a47 --- /dev/null +++ b/modules/ncenterlite/tpl/config.html @@ -0,0 +1,89 @@ + + + + +
    + + + + +
    +
    + +
    + + + + + + +

    {$lang->about_admin_content}

    +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_display_about}

    +
    +
    +
    + +
    + +

    {$lang->about_anonymous_nick_name}

    +
    +
    +
    + +
    + + {$lang->about_mention_preview} +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_mention_target_about}

    +
    +
    +
    + +
    + + +

    {$lang->about_member_menu_view}

    +
    +
    +
    + +
    + + +

    {$lang->ncenterlite_document_event_read_about}

    +
    +
    +
    +
    +
    + +
    +
    +
    diff --git a/modules/ncenterlite/tpl/css/ncenter_admin.css b/modules/ncenterlite/tpl/css/ncenter_admin.css new file mode 100644 index 000000000..b01d9527b --- /dev/null +++ b/modules/ncenterlite/tpl/css/ncenter_admin.css @@ -0,0 +1,12 @@ +.mention_option ul.preview, +.mention_option ul.preview li { margin:0; padding:0; list-style:none; } + +.mention_option ul.preview li { display:inline-block; margin:5px; padding:3px 7px; border-radius:50px; color:red; font-size:1.2em; background:#EEE; } +.mention_option ul.preview li strong { color:black; } + +.mention_option ul.preview li.enable, +.mention_option ul.preview li.disable { color:black; } +.mention_option ul.preview li.enable strong, +.mention_option ul.preview li.disable strong { color:#FFF; } +.mention_option ul.preview li.enable { background:green; } +.mention_option ul.preview li.disable { background:red; } diff --git a/modules/ncenterlite/tpl/header.html b/modules/ncenterlite/tpl/header.html new file mode 100644 index 000000000..0d5e6a757 --- /dev/null +++ b/modules/ncenterlite/tpl/header.html @@ -0,0 +1,17 @@ +
    +

    {$lang->ncenterlite}

    +
    + + + +
    +

    {$XE_VALIDATOR_MESSAGE}

    +
    diff --git a/modules/ncenterlite/tpl/js/ncenter_admin.js b/modules/ncenterlite/tpl/js/ncenter_admin.js new file mode 100644 index 000000000..5fa289894 --- /dev/null +++ b/modules/ncenterlite/tpl/js/ncenter_admin.js @@ -0,0 +1,106 @@ +function doDisplaySkinColorset(sel, colorset) +{ + var skin = sel.options[sel.selectedIndex].value; + + var params = new Array(); + params["skin"] = skin; + params["colorset"] = colorset; + + var response_tags = ['error', 'message', 'colorset_list']; + + exec_xml('ncenterlite', 'getColorsetList', params, completeGetSkinColorset, response_tags, params); +} + +function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) +{ + var sel = get_by_id('fo_ncenterlite').colorset; + var length = sel.options.length; + var selected_colorset = params['colorset']; + for(var i=0;i= steps) { + //element.style.backgroundColor = 'rgb(' + endcolour.toString() + ')'; + element.style.backgroundColor = c; //'rgb(' + endcolour.toString() + ')'; + clearInterval(timer); + } + }, interval); + } + + var s = decodeURIComponent(location.href).replace(/.*#comment_/,''); + if(!s || s === decodeURIComponent(location.href)) return; + s = 'comment_' + s; + jQuery('.xe_content').each(function(){ + var t = jQuery(this); + if(t.hasClass(s) || (new RegExp(s + '_')).test(t.attr('class'))){ + var c = t.css('display','block').css('background-color'); + y(this, [255,255,60], [255,255,255], 750, c); + ncenterlite_need_highlight = false; + } + }); +} + +if(typeof _viewSubComment == 'function') { + old__viewSubComment = _viewSubComment; + _viewSubComment = function(ret_obj) { + old__viewSubComment(ret_obj); + if(ncenterlite_need_highlight) { + setTimeout(function(){ + var s = decodeURIComponent(location.href).match(/#.*comment_([0-9]+)/); + if(s) { + ncenterlite_highlight(); + location.href = '#social_comment_' + s[1]; + } + }, 500); + } + }; +} + +jQuery(function(){ + ncenterlite_highlight(); +}); diff --git a/modules/ncenterlite/tpl/ncenter_list.html b/modules/ncenterlite/tpl/ncenter_list.html new file mode 100644 index 000000000..60d598a57 --- /dev/null +++ b/modules/ncenterlite/tpl/ncenter_list.html @@ -0,0 +1,70 @@ + + + +
    +

    알림 목록

    + +

    {$lang->ncenterlite_no_notify}

    + + +
    +
    +
    + + + + +

    {$lang->ncenterlite_warning} {$lang->dont_check_notify_delete}

    +
    +
    +
    + + + + + + + + + + + + + + {@ + $oMemberModel = getModel('member'); + $member_info = $oMemberModel->getMemberInfoByMemberSrl($val->member_srl); + } + + + + + + + + + +
    {$lang->send_member}{$lang->resiver_member}{$lang->notify_content}{$lang->notify_read_check}{$lang->date}
    {$val->target_nick_name}{$member_info->nick_name} 타겟없음{$val->text} + {$lang->notify_readed} + {$lang->notify_dont_readed} + + {zdate($val->regdate,"Y-m-d")} +
    + {zdate($val->regdate,"H:i:s")} +
    + + +
    +
    \ No newline at end of file diff --git a/modules/ncenterlite/tpl/seletedmid.html b/modules/ncenterlite/tpl/seletedmid.html new file mode 100644 index 000000000..f047e2266 --- /dev/null +++ b/modules/ncenterlite/tpl/seletedmid.html @@ -0,0 +1,42 @@ + + + + + +
    + + + + +
    +
    + +
    +

    {$lang->ncenterlite_about_notify_setting}

    +
    + +
    +
    +
    +
    + +
    +

    {$lang->ncenterlite_about_mid_all}

    +
    + +
    +
    +
    +
    +
    +
    + +
    +
    +
    diff --git a/modules/ncenterlite/tpl/skinsetting.html b/modules/ncenterlite/tpl/skinsetting.html new file mode 100644 index 000000000..8f38c6c29 --- /dev/null +++ b/modules/ncenterlite/tpl/skinsetting.html @@ -0,0 +1,91 @@ + + + + + +
    + + + +
    +

    {$lang->cmd_layout_setup}

    +
    + +
    + + {$lang->help} + +
    +
    +
    + +
    + + {$lang->help} + +
    +
    +
    + +
    +

    {$lang->ncenterlite_skin_settings}

    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +

    {$lang->ncenterlite_zindex_about}

    +
    +
    +
    +
    +
    + +
    +
    +
    diff --git a/modules/ncenterlite/tpl/test.html b/modules/ncenterlite/tpl/test.html new file mode 100644 index 000000000..9940af531 --- /dev/null +++ b/modules/ncenterlite/tpl/test.html @@ -0,0 +1,22 @@ + + + + +
    +
    +

    {$lang->etc}

    +
    + +
    + +
    +
    + +
    + +
    + +
    +
    +
    +
    diff --git a/modules/page/lang/ru.php b/modules/page/lang/ru.php index dc85b7651..c07f88689 100644 --- a/modules/page/lang/ru.php +++ b/modules/page/lang/ru.php @@ -3,5 +3,4 @@ $lang->page = 'Страница'; $lang->about_page = 'Это модуль блога, который создает полную страницу. Используя последние и другие виджеты, Вы можете создавать динамические страницы. Посредством компонента редактора, Вы можете также создать различные вариации страницы. URL модуля следует тем же правилам, что и другие модули: mid=имя_модуля. Если он выбран как модуль по умолчанию, то он будет главной страницей сайта.'; $lang->cmd_page_modify = 'Изменить'; $lang->page_caching_interval = 'Установить время кеширования'; -$lang->about_page_caching_interval = 'Единица измерения равна одной минуте. Это отображает временно сохраненные данные для присвоенного времени. Рекомендуется устанавливать разумное время кеширования, если множество ресурсов нуждаются в показе данных с других серверов. Значение 0 отключает кеширование.'; -$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->about_page_caching_interval = 'Единица измерения равна одной минуте. Это отображает временно сохраненные данные для присвоенного времени. Рекомендуется устанавливать разумное время кеширования, если множество ресурсов нуждаются в показе данных с других серверов. Значение 0 отключает кеширование.'; \ No newline at end of file diff --git a/modules/page/lang/vi.php b/modules/page/lang/vi.php index 2937b4538..ee161a573 100644 --- a/modules/page/lang/vi.php +++ b/modules/page/lang/vi.php @@ -3,5 +3,4 @@ $lang->page = 'Trang'; $lang->about_page = 'Là Module tạo ra một trang đầy đủ. Sử 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. Địa chỉ của nó như một Module dạng \'mid=module name\'. Nếu chọn là mặc định, nó sẽ là trang chủ của Website.'; $lang->cmd_page_modify = 'Sửa đổi'; $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->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.'; \ No newline at end of file diff --git a/modules/page/page.wap.php b/modules/page/page.wap.php index ea30a524b..ad60f0999 100644 --- a/modules/page/page.wap.php +++ b/modules/page/page.wap.php @@ -15,7 +15,7 @@ class pageWap extends page function procWAP(&$oMobile) { // Check permissions - if(!$this->grant->access) return $oMobile->setContent(Context::getLang('msg_not_permitted')); + if(!$this->grant->access) return $oMobile->setContent(lang('msg_not_permitted')); // The contents of the widget chuchulham $oWidgetController = getController('widget'); $content = $oWidgetController->transWidgetCode($this->module_info->content); diff --git a/modules/point/lang/es.php b/modules/point/lang/es.php index b6a016e6a..14300bab0 100644 --- a/modules/point/lang/es.php +++ b/modules/point/lang/es.php @@ -15,12 +15,10 @@ $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->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->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화 합니다.
    회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다.
    데이터 이전등을 하여 포인트를 완전히 초기화 해야 할 경우에만 사용하세요.'; $lang->point_link_group = 'Grupo de cambio de nivel'; $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.'; @@ -38,13 +36,10 @@ $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.'; $lang->search_target_list['nick_name'] = 'Apodo'; $lang->search_target_list['user_name'] = 'Nombre del Usuario'; $lang->search_target_list['regdate'] = 'Fecha del registro'; $lang->search_target_list['last_login'] = 'Fecha de su última conección'; -$lang->search_target_list['last_login_more'] = '최근로그인일시(이상)'; -$lang->search_target_list['last_login_less'] = '최근로그인일시(이하)'; $lang->search_target_list['extra_vars'] = 'Variables Extra'; diff --git a/modules/point/lang/fr.php b/modules/point/lang/fr.php index 7b8949337..a16315b3b 100644 --- a/modules/point/lang/fr.php +++ b/modules/point/lang/fr.php @@ -12,7 +12,6 @@ $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->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'; @@ -38,13 +37,10 @@ $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.'; $lang->search_target_list['nick_name'] = 'Surnom'; $lang->search_target_list['user_name'] = 'Nom'; $lang->search_target_list['regdate'] = 'Jour d\'Inscription'; $lang->search_target_list['last_login'] = 'Jour de la connexion dernière'; -$lang->search_target_list['last_login_more'] = '최근로그인일시(이상)'; -$lang->search_target_list['last_login_less'] = '최근로그인일시(이하)'; $lang->search_target_list['extra_vars'] = 'Variables additionnels '; diff --git a/modules/point/lang/ja.php b/modules/point/lang/ja.php index 1c0085d8e..30d247080 100644 --- a/modules/point/lang/ja.php +++ b/modules/point/lang/ja.php @@ -3,8 +3,6 @@ $lang->point = 'ポイント'; $lang->level = 'レベル'; $lang->about_point_module = 'ポイントモジュールでは、書き込み作成/コメント作成/アップロード/ダウンロードなどのユーザーの活動に対してポイントの計算を行います。'; $lang->about_act_config = '掲示板、ブログなどのモジュールごとに「書き込み作成・削除/コメント作成・削除」などのアクションがあります。掲示板/ブログ以外のモジュールにポイントシステムを連動させたい場合は、各機能のアクションの「act値」を追加します。連動は半角「,(コンマ)」で区切って追加します。'; -$lang->point_io = 'Point module On'; -$lang->about_point_io = 'Point module can be on or off. If you OFF this module, every triggers will be deleted from database and will not be called by Rhymix Core. Point record would be preserved.'; $lang->max_level = '最高レベル'; $lang->about_max_level = '最高レベルを指定することができます。最高レベルは「1000」が最大値であるため、レベルアイコンに注意が必要です。'; $lang->level_icon = 'レベルアイコン'; diff --git a/modules/point/lang/ru.php b/modules/point/lang/ru.php index 6b3844e6f..83b2aa2ae 100644 --- a/modules/point/lang/ru.php +++ b/modules/point/lang/ru.php @@ -15,9 +15,6 @@ $lang->level_point = 'Уровень поинтов'; $lang->about_level_point = 'Уровень будет изменен, когда поинты достигают каждого уровня поинтов или падают ниже его'; $lang->disable_download = 'Запретить скачивание'; $lang->about_disable_download = 'Это запретит скачивание файлов, когда не хватает достаточного кол-ва поинтов. (За исключением файлов изображений)'; -$lang->about_disable_read_document = '포인트가 없을 경우 글 열람을 금지하게 됩니다'; -$lang->about_cmd_point_recal = '게시글/댓글/첨부파일/회원가입 점수만 이용하여 모든 포인트 점수를 초기화 합니다.
    회원 가입 점수는 초기화 후 해당 회원이 활동을 하면 부여되고 그 전에는 부여되지 않습니다.
    데이터 이전등을 하여 포인트를 완전히 초기화 해야 할 경우에만 사용하세요.'; -$lang->about_point_link_group = '그룹에 원하는 레벨을 지정하면 해당 레벨에 도달할때 그룹이 변경됩니다.'; $lang->about_module_point = 'Вы можете установть поинты для каждого модуля, а модули, не имеющие значения будут использовать значение по умолчанию для поинтов.
    Все поинты будут восстановлены при обратном действии.'; $lang->point_signup = 'Присвоить'; $lang->point_insert_document = 'При написании'; @@ -32,8 +29,6 @@ $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_finished = '포인트 재계산이 모두 완료되었습니다'; $lang->search_target_list['nick_name'] = 'Ник'; $lang->search_target_list['user_name'] = 'Имя пользователя'; $lang->search_target_list['regdate'] = 'Дата регистрации'; diff --git a/modules/point/lang/zh-CN.php b/modules/point/lang/zh-CN.php index 9ce042e7e..ada98e17d 100644 --- a/modules/point/lang/zh-CN.php +++ b/modules/point/lang/zh-CN.php @@ -3,8 +3,6 @@ $lang->point = '积分'; $lang->level = '级别'; $lang->about_point_module = '积分系统可以在发表新帖及评论,上传/下载文件等动作时,付与其相应的积分的模块。'; $lang->about_act_config = '版面,博客等模块都有发表/删除新帖,发表/删除评论等动作。
    要想与版面/博客之外的模块关联积分功能时,添加与其各模块功能相适合的act值即可。'; -$lang->point_io = 'Point module On'; -$lang->about_point_io = 'Point module can be on or off. If you OFF this module, every triggers will be deleted from database and will not be called by Rhymix Core. Point record would be preserved.'; $lang->max_level = '最高级别'; $lang->about_max_level = '可以指定最高级别。级别共设1000级,因此制作级别图标时要好好考虑一下。'; $lang->level_icon = '级别图标'; diff --git a/modules/point/lang/zh-TW.php b/modules/point/lang/zh-TW.php index be20b4862..baec73b50 100644 --- a/modules/point/lang/zh-TW.php +++ b/modules/point/lang/zh-TW.php @@ -3,8 +3,6 @@ $lang->point = '點數'; $lang->level = '等級'; $lang->about_point_module = '點數系統可以在發表/刪除主題,發表/刪除評論,上傳/下載/刪除/檔案等動作時,付出相對應的點數。'; $lang->about_act_config = '討論板,部落格等模組都有發表/刪除主題,發表/刪除評論等動作。
    想要與討論板/部落格之外的模組關聯點數功能時,新增與其各模組功能適合的act值即可。'; -$lang->point_io = 'Point module On'; -$lang->about_point_io = 'Point module can be on or off. If you OFF this module, every triggers will be deleted from database and will not be called by Rhymix Core. Point record would be preserved.'; $lang->max_level = '最高等級'; $lang->about_max_level = '可以指定最高等級。等級共設1000級,因此製作等級圖示時要好好考慮一下。'; $lang->level_icon = '等級圖示'; @@ -47,7 +45,6 @@ $lang->msg_cannot_download = '點數不足無法下載!'; $lang->msg_disallow_by_point = '點數不足無法閱讀文章 (需要 : %d, 目前 : %d)'; $lang->point_recal_message = '計算並套用中(%d / %d)。'; $lang->point_recal_finished = '點數重新計算並套用完畢。'; -$lang->point_update_desc = 'Insert + in front of the number to increase the point or - to decrease, and update the point. If you don\'t insert + or -, the point will be set as the value you entered.'; $lang->give_point = '給予點數'; $lang->search_target_list['nick_name'] = '暱稱'; $lang->search_target_list['user_name'] = '姓名'; diff --git a/modules/point/point.admin.controller.php b/modules/point/point.admin.controller.php index 4727e7242..77fa68645 100644 --- a/modules/point/point.admin.controller.php +++ b/modules/point/point.admin.controller.php @@ -332,7 +332,7 @@ class pointAdminController extends point $this->add('total', count($member)); $this->add('position', 0); - $this->setMessage( sprintf(Context::getLang('point_recal_message'), 0, $this->get('total')) ); + $this->setMessage( sprintf(lang('point_recal_message'), 0, $this->get('total')) ); } /** @@ -376,7 +376,7 @@ class pointAdminController extends point $this->add('total', $total); $this->add('position', $idx); - $this->setMessage(sprintf(Context::getLang('point_recal_message'), $idx, $total)); + $this->setMessage(sprintf(lang('point_recal_message'), $idx, $total)); } diff --git a/modules/point/point.controller.php b/modules/point/point.controller.php index 9fef9fe5f..21ca270ea 100644 --- a/modules/point/point.controller.php +++ b/modules/point/point.controller.php @@ -436,7 +436,7 @@ class pointController extends point $_SESSION['banned_document'][$obj->document_srl] = false; if($config->disable_read_document == 'Y' && $point < 0 && abs($point)>$cur_point) { - $message = sprintf(Context::getLang('msg_disallow_by_point'), abs($point), $cur_point); + $message = sprintf(lang('msg_disallow_by_point'), abs($point), $cur_point); $obj->add('content', $message); $_SESSION['banned_document'][$obj->document_srl] = true; return new Object(-1, $message); diff --git a/modules/point/tpl/member_list.html b/modules/point/tpl/member_list.html index 447944c6d..cfb81364f 100644 --- a/modules/point/tpl/member_list.html +++ b/modules/point/tpl/member_list.html @@ -22,7 +22,7 @@ @@ -36,7 +36,7 @@ {$lang->no} - {Context::getLang($identifier)} + {lang($identifier)} {$lang->nick_name} {$lang->point} {$lang->level} @@ -125,7 +125,7 @@ diff --git a/modules/poll/poll.admin.controller.php b/modules/poll/poll.admin.controller.php index a4c023e62..7cf9d47ae 100644 --- a/modules/poll/poll.admin.controller.php +++ b/modules/poll/poll.admin.controller.php @@ -55,7 +55,7 @@ class pollAdminController extends poll if(!$output->toBool()) return $output; } - $this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) ); + $this->setMessage( sprintf(lang('msg_checked_poll_is_deleted'), $poll_count) ); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminList'); $this->setRedirectUrl($returnUrl); diff --git a/modules/poll/poll.controller.php b/modules/poll/poll.controller.php index c954d77fb..155385bdb 100644 --- a/modules/poll/poll.controller.php +++ b/modules/poll/poll.controller.php @@ -23,7 +23,7 @@ class pollController extends poll // mobile input date format can be different if($stop_date != Context::get('stop_date')) { - $stop_date = date('Ymd', strtodate(Context::get('stop_date'))); + $stop_date = date('Ymd', strtotime(Context::get('stop_date'))); } if($stop_date < date('Ymd')) { diff --git a/modules/poll/poll.model.php b/modules/poll/poll.model.php index 7c42be029..f34170c8c 100644 --- a/modules/poll/poll.model.php +++ b/modules/poll/poll.model.php @@ -139,7 +139,7 @@ class pollModel extends poll $ip = md5($value->ip_address); $poll->member[$ip] = new stdClass(); $poll->member[$ip]->member_srl = 0; - $poll->member[$ip]->nick_name = Context::getLang("anonymous") . ' IP: ' . $value->ip_address; + $poll->member[$ip]->nick_name = lang("anonymous") . ' IP: ' . $value->ip_address; $poll->member[$ip]->profile_image = ""; } else @@ -147,7 +147,7 @@ class pollModel extends poll $ip = md5($value->ip_address); $poll->member[$ip] = new stdClass(); $poll->member[$ip]->member_srl = 0; - $poll->member[$ip]->nick_name = Context::getLang("anonymous"); + $poll->member[$ip]->nick_name = lang("anonymous"); $poll->member[$ip]->profile_image = ""; } } diff --git a/modules/rss/rss.admin.controller.php b/modules/rss/rss.admin.controller.php index 6d1de7db3..8368cb413 100644 --- a/modules/rss/rss.admin.controller.php +++ b/modules/rss/rss.admin.controller.php @@ -44,7 +44,7 @@ class rssAdminController extends rss $total_config->image = ''; } // Ignore if the file is not the one which has been successfully uploaded - if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name']) && checkUploadedFile($image_obj['tmp_name'])) + if($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name'])) { // Ignore if the file is not an image (swf is accepted ~) $image_obj['name'] = Context::convertEncodingStr($image_obj['name']); @@ -76,7 +76,7 @@ class rssAdminController extends rss if(!$alt_message) $alt_message = 'success_updated'; - $alt_message = Context::getLang($alt_message); + $alt_message = lang($alt_message); $this->setMessage($alt_message, 'info'); //$this->setLayoutPath('./common/tpl'); diff --git a/modules/rss/rss.class.php b/modules/rss/rss.class.php index 0ed625ca4..4a35d476e 100644 --- a/modules/rss/rss.class.php +++ b/modules/rss/rss.class.php @@ -7,6 +7,8 @@ */ class rss extends ModuleObject { + public $gzhandler_enable = false; + /** * Additional tasks required to accomplish during the installation * diff --git a/modules/rss/rss.view.php b/modules/rss/rss.view.php index f37823cd9..0ac78303d 100644 --- a/modules/rss/rss.view.php +++ b/modules/rss/rss.view.php @@ -34,7 +34,7 @@ class rssView extends rss { $site_module_info = Context::get('site_module_info'); $site_srl = $site_module_info->site_srl; - $mid = Context::get('mid'); // The target module id, if absent, then all + $mid = isset($_REQUEST['mid']) ? Context::get('mid') : null; $start_date = (int)Context::get('start_date'); $end_date = (int)Context::get('end_date'); @@ -42,6 +42,7 @@ class rssView extends rss $rss_config = array(); $total_config = ''; $total_config = $oModuleModel->getModuleConfig('rss'); + // If one is specified, extract only for this mid if($mid) { @@ -52,8 +53,8 @@ class rssView extends rss $module_srls[] = $module_srl; $open_rss_config[$module_srl] = $config->open_rss; } - // If mid is not selected, then get all } + // If mid is not selected, then get all else { if($total_config->use_total_feed != 'N') @@ -73,7 +74,10 @@ class rssView extends rss } } - if(!count($module_srls) && !$add_description) return $this->dispError(); + if (!count($module_srls) && !$add_description) + { + return $this->dispError(); + } $info = new stdClass; $args = new stdClass; @@ -227,7 +231,7 @@ class rssView extends rss function dispError() { // Prepare the output message - $this->rss(null, null, Context::getLang('msg_rss_is_disabled') ); + $this->rss(null, null, lang('msg_rss_is_disabled') ); } /** diff --git a/modules/session/session.admin.controller.php b/modules/session/session.admin.controller.php index 627043b4a..5dbc28e92 100644 --- a/modules/session/session.admin.controller.php +++ b/modules/session/session.admin.controller.php @@ -22,7 +22,7 @@ class sessionAdminController extends session $oSessionController = getController('session'); $oSessionController->gc(0); - $this->add('result',Context::getLang('session_cleared')); + $this->add('result',lang('session_cleared')); } } /* End of file session.admin.controller.php */ diff --git a/modules/spamfilter/spamfilter.admin.controller.php b/modules/spamfilter/spamfilter.admin.controller.php index af1969ffa..d2e78244c 100644 --- a/modules/spamfilter/spamfilter.admin.controller.php +++ b/modules/spamfilter/spamfilter.admin.controller.php @@ -41,8 +41,8 @@ class spamfilterAdminController extends spamfilter $output = $oSpamfilterController->insertIP($ipaddress_list); if(!$output->toBool() && !$output->get('fail_list')) return $output; - if($output->get('fail_list')) $message_fail = ''.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).''; - $this->setMessage(Context::getLang('success_registed').$message_fail); + if($output->get('fail_list')) $message_fail = ''.sprintf(lang('msg_faillist'),$output->get('fail_list')).''; + $this->setMessage(lang('success_registed').$message_fail); } @@ -59,8 +59,8 @@ class spamfilterAdminController extends spamfilter $output = $this->insertWord($word_list); if(!$output->toBool() && !$output->get('fail_list')) return $output; - if($output->get('fail_list')) $message_fail = ''.sprintf(Context::getLang('msg_faillist'),$output->get('fail_list')).''; - $this->setMessage(Context::getLang('success_registed').$message_fail); + if($output->get('fail_list')) $message_fail = ''.sprintf(lang('msg_faillist'),$output->get('fail_list')).''; + $this->setMessage(lang('success_registed').$message_fail); } $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedWordList'); @@ -75,7 +75,7 @@ class spamfilterAdminController extends spamfilter $ipAddressList = Context::get('ipaddress'); if($ipAddressList) $this->deleteIP($ipAddressList); - $this->setMessage(Context::getLang('success_deleted')); + $this->setMessage(lang('success_deleted')); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedIPList'); return $this->setRedirectUrl($returnUrl); @@ -89,7 +89,7 @@ class spamfilterAdminController extends spamfilter $wordList = Context::get('word'); $this->deleteWord($wordList); - $this->setMessage(Context::getLang('success_deleted')); + $this->setMessage(lang('success_deleted')); $returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispSpamfilterAdminDeniedWordList','active','word'); return $this->setRedirectUrl($returnUrl); diff --git a/modules/spamfilter/spamfilter.model.php b/modules/spamfilter/spamfilter.model.php index a521e0bb0..e29bf0494 100644 --- a/modules/spamfilter/spamfilter.model.php +++ b/modules/spamfilter/spamfilter.model.php @@ -87,7 +87,7 @@ class spamfilterModel extends spamfilter { $args->word = $word; $output = executeQuery('spamfilter.updateDeniedWordHit', $args); - return new Object(-1,sprintf(Context::getLang('msg_alert_denied_word'), $word)); + return new Object(-1,sprintf(lang('msg_alert_denied_word'), $word)); } } @@ -120,11 +120,11 @@ class spamfilterModel extends spamfilter { if($isMessage) { - $message = sprintf(Context::getLang('msg_alert_limited_message_by_config'), $interval); + $message = sprintf(lang('msg_alert_limited_message_by_config'), $interval); } else { - $message = sprintf(Context::getLang('msg_alert_limited_by_config'), $interval); + $message = sprintf(lang('msg_alert_limited_by_config'), $interval); } $oSpamFilterController = getController('spamfilter'); diff --git a/modules/widget/lang/fr.php b/modules/widget/lang/fr.php index 6d7cf6014..ced2de80e 100644 --- a/modules/widget/lang/fr.php +++ b/modules/widget/lang/fr.php @@ -25,7 +25,6 @@ $lang->generated_code = 'Code généré'; $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. diff --git a/modules/widget/lang/ru.php b/modules/widget/lang/ru.php index c54ac65b9..c0e85b86b 100644 --- a/modules/widget/lang/ru.php +++ b/modules/widget/lang/ru.php @@ -26,6 +26,5 @@ $lang->generated_code = 'Сгенерированный код'; $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 = 'После ввода требуемых значений, нажмите пнопку [Добавить], чтобы вставить код виджета в страницу.'; diff --git a/modules/widget/lang/vi.php b/modules/widget/lang/vi.php index dfcf777e7..1c9d19a97 100644 --- a/modules/widget/lang/vi.php +++ b/modules/widget/lang/vi.php @@ -35,7 +35,6 @@ $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_css_class = '위젯 CSS class'; $lang->cmd_widget_align = 'Căn chỉnh'; $lang->cmd_widget_align_left = 'Trái'; $lang->cmd_widget_align_right = 'Phải'; diff --git a/modules/widget/lang/zh-CN.php b/modules/widget/lang/zh-CN.php index 2dad8b717..e27fb2db1 100644 --- a/modules/widget/lang/zh-CN.php +++ b/modules/widget/lang/zh-CN.php @@ -38,7 +38,6 @@ $lang->cmd_content_insert = '添加内容'; $lang->cmd_box_widget_insert = '添加控件盒'; $lang->cmd_remove_all_widgets = '清空内容'; $lang->cmd_widget_size = '大小'; -$lang->cmd_widget_css_class = '위젯 CSS class'; $lang->cmd_widget_align = '对齐'; $lang->cmd_widget_align_left = '左对齐'; $lang->cmd_widget_align_right = '右对齐'; diff --git a/modules/widget/lang/zh-TW.php b/modules/widget/lang/zh-TW.php index 167f93748..106f63df0 100644 --- a/modules/widget/lang/zh-TW.php +++ b/modules/widget/lang/zh-TW.php @@ -38,7 +38,6 @@ $lang->cmd_content_insert = '新增內容'; $lang->cmd_box_widget_insert = '新增 Widget Box'; $lang->cmd_remove_all_widgets = '全部清空'; $lang->cmd_widget_size = '大小'; -$lang->cmd_widget_css_class = '위젯 CSS class'; $lang->cmd_widget_align = '對齊'; $lang->cmd_widget_align_left = '靠左'; $lang->cmd_widget_align_right = '靠右'; diff --git a/modules/widget/tpl/js/generate_code.js b/modules/widget/tpl/js/generate_code.js index 759b270e7..1d2dc9edf 100644 --- a/modules/widget/tpl/js/generate_code.js +++ b/modules/widget/tpl/js/generate_code.js @@ -119,6 +119,20 @@ function doFillWidgetVars() { if(node.type == 'button') continue; if(node.name === '') continue; + if (node.name == 'widget_cache') { + var widget_cache = selected_node.getAttribute(node.name); + var widget_cache_unit = widget_cache.match(/[smhd]$/i); + if (widget_cache_unit) { + jQuery("#widget_cache_unit").val(widget_cache_unit); + widget_cache = widget_cache.replace(/[smhd]$/i, ""); + } + jQuery("#widget_cache").val(widget_cache); + continue; + } + if (node.name == 'widget_cache_unit') { + continue; + } + var length = node.length; var type = node.type; diff --git a/modules/widget/tpl/js/widget.js b/modules/widget/tpl/js/widget.js index 68dea693c..c23414bd2 100644 --- a/modules/widget/tpl/js/widget.js +++ b/modules/widget/tpl/js/widget.js @@ -200,7 +200,6 @@ function doSyncPageContent() { if(!fo_obj.document_srl || fo_obj.document_srl.value == '0') { try { var content = Base64.decode(xInnerHtml(obj)); - content = editorReplacePath(content); get_by_id("content_fo").content.value = content; xe.Editors["1"].exec("SET_IR", [content]); } diff --git a/modules/widget/tpl/widget_generate_code.include.html b/modules/widget/tpl/widget_generate_code.include.html index 8d931af62..5e7656d04 100644 --- a/modules/widget/tpl/widget_generate_code.include.html +++ b/modules/widget/tpl/widget_generate_code.include.html @@ -25,7 +25,14 @@
    - {$lang->unit_min} + + +

    {$lang->about_widget_cache}

    @@ -49,7 +56,7 @@ - + diff --git a/modules/widget/tpl/widget_generate_code_in_page.html b/modules/widget/tpl/widget_generate_code_in_page.html index 1780a887d..7c17c8019 100644 --- a/modules/widget/tpl/widget_generate_code_in_page.html +++ b/modules/widget/tpl/widget_generate_code_in_page.html @@ -1,12 +1,14 @@ - -