Merge branch 'develop' into feature/pwhash

This commit is contained in:
bnu 2015-01-15 16:46:17 +09:00
commit a837f1e00a
156 changed files with 10370 additions and 658 deletions

View file

@ -15,7 +15,37 @@ RewriteRule ^(.+)/files/(member_extra_info|attach|cache|faceOff)/(.*) ./files/$2
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^(.+)/(files|modules|widgets|widgetstyles|layouts|m.layouts|addons)/(.*) ./$2/$3 [L]
# router
RewriteCond %{SCRIPT_FILENAME} !-f
# rss , blogAPI
RewriteRule ^(rss|atom)$ ./index.php?module=rss&act=$1 [L]
RewriteRule ^([a-zA-Z0-9_]+)/(rss|atom|api)$ ./index.php?mid=$1&act=$2 [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)$ ./index.php?vid=$1&mid=$2&act=$3 [L]
# trackback
RewriteRule ^([0-9]+)/(.+)/trackback$ ./index.php?document_srl=$1&key=$2&act=trackback [L]
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?mid=$1&document_srl=$2&key=$3&act=trackback [L]
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?vid=$1&document_srl=$2&key=$3&act=trackback [L]
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback$ ./index.php?vid=$1&mid=$2&document_srl=$3&key=$4&act=trackback [L]
# document permanent link
RewriteRule ^([0-9]+)$ ./index.php?document_srl=$1 [L,QSA]
# mid link
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php [L]
RewriteRule ^([a-zA-Z0-9_]+)/?$ ./index.php?mid=$1 [L,QSA]
# mid + document link
RewriteRule ^([a-zA-Z0-9_]+)/([0-9]+)$ ./index.php?mid=$1&document_srl=$2 [L,QSA]
# vid + mid link
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/?$ ./index.php?vid=$1&mid=$2 [L,QSA]
# vid + mid + document link
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)$ ./index.php?vid=$1&mid=$2&document_srl=$3 [L,QSA]
# mid + entry title
RewriteRule ^([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?mid=$1&entry=$2 [L,QSA]
# vid + mid + entry title
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?vid=$1&mid=$2&entry=$3 [L,QSA]
#shop / vid / [category|product] / identifier
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_\.-]+)$ ./index.php?act=route&vid=$1&type=$2&identifier=$3 [L,QSA]

View file

@ -2,7 +2,7 @@ module.exports = function(grunt) {
"use strict";
var banner = '/*! Copyright (C) NAVER <http://www.navercorp.com> */\n';
var banner_xe_js = banner + '/**!\n * @file common.js + js_app.js + xml_handler.js + xml_js_filter.js\n * @brief XE Common JavaScript\n **/\n';
var banner_xe_js = banner + '/**!\n * @concat modernizr.js + common.js + js_app.js + xml_handler.js + xml_js_filter.js\n * @brief XE Common JavaScript\n **/\n';
grunt.file.defaultEncoding = 'utf8';
@ -22,6 +22,7 @@ module.exports = function(grunt) {
banner: banner_xe_js
},
src: [
'common/js/modernizr.js',
'common/js/common.js',
'common/js/js_app.js',
'common/js/xml_handler.js',
@ -32,7 +33,7 @@ module.exports = function(grunt) {
'xpresseditor': {
options: {
stripBanners: true,
banner: banner_xe_js
banner: '/**!\n * @concat Xpress_Editor.js + xe_interface.js \n **/\n'
},
src: [
'modules/editor/skins/xpresseditor/js/Xpress_Editor.js',
@ -44,7 +45,8 @@ module.exports = function(grunt) {
uglify: {
'common-js': {
options: {
banner: banner_xe_js
banner: banner_xe_js,
sourceMap: true
},
files: {
'common/js/xe.min.js': ['common/js/xe.js']
@ -60,6 +62,9 @@ module.exports = function(grunt) {
}
},
'modules': {
options: {
sourceMap: true
},
files: {
'common/js/x.min.js' : ['common/js/x.js'],
// addon
@ -154,7 +159,12 @@ module.exports = function(grunt) {
jshint: {
files: [
'Gruntfile.js',
'common/js/*.js', '!common/js/html5.js', '!common/js/jquery.js', '!common/js/x.js', '!common/js/xe.js',
'common/js/*.js',
'!common/js/html5.js',
'!common/js/jquery.js',
'!common/js/x.js',
'!common/js/xe.js',
'!common/js/modernizr.js',
'modules/admin/tpl/js/*.js',
'modules/board/tpl/js/*.js',
'modules/editor/tpl/js/*.js',
@ -314,7 +324,7 @@ module.exports = function(grunt) {
// changed
grunt.util.spawn({
cmd: "git",
args: ['diff', '--name-only', target]
args: ['diff', '--name-only', '--diff-filter' ,'ACM', target]
}, function (error, result, code) {
diff = result.stdout;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"version":3,"file":"captcha.min.js","sources":["captcha.js"],"names":["calledArgs","$","xeCaptcha","each","i","isSubmitHook","this","attr","indexOf","act","find","val","captchaTargetAct","length","append","current_url","submit","event","preventDefault","self","e","focus","params","Array","current_mid","window","oldExecXml","captchaXE","show","document","body","fc_isIE","navigator","appVersion","fc_isWin","toLowerCase","fc_isOpera","userAgent","_swfURL_","request_uri","_object_","appendTo","top_left","screen","width","$div","click","hide","swf","audio","setQuery","Date","getTime","setSoundTarget","exec","module","callback_func","response_tags","callback_func_arg","fo_obj","doCheck","key","compare","ret_obj","html","css","ready","exec_xml","jQuery"],"mappings":"AACA,GAAIA,YAAa,MACjB,SAAUC,GACTA,EAAE,WAGD,QAASC,KACRD,EAAE,QAAQE,KAAK,SAASC,GAEvB,GAAIC,IAAe,CACnB,KAAKJ,EAAEK,MAAMC,KAAK,aAAgBN,EAAEK,MAAMC,KAAK,YAAYC,QAAQ,cAAgB,EAGlF,IAAI,GADAC,GAAMR,EAAEK,MAAMI,KAAK,mBAAmBC,MAClCP,EAAI,EAAGA,EAAEQ,iBAAiBC,OAAQT,IAEzC,G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AUC,KAAK,GAAIL,OAAM,QAAQ,UAAU,gBAAgB,iBAAiB,eAAe,YAAY,mBAE9IE,QAAOC,WAAW6B,EAAQ9C,EAAKa,EAAQkC,EAAeC,EAAeC,EAAmBC,EAGzF,QAAO,GAGRhC,EAAUC,KAAO,SAASmC,GACzB9D,EAAE,kBAAkB2B,OACpB3B,EAAE,iBAAiB+D,KAAKD,EAAuB,eAC/C9D,EAAE,0BAA0BM,KAAK,QAAQwD,EAAwB,gBACjE9D,EAAE,wBAAwBM,KAAK,QAAQwD,EAAsB,cAC7D9D,EAAE,sCAAsC+D,KAAKD,EAAmB,WAChE9D,EAAE,gCAAgC+D,KAAKD,EAAoB,YAC3D9D,EAAE,kBAAkBM,KAAK,MAAOQ,YAAYmC,SAAS,iBAAiB,gBAAgBA,SAAS,OAAO,GAAKC,OAAMC,YACjHP,EAAKnC,KAAK,oBAAoBC,IAAI,IAAIU,QACtCpB,EAAE,cAAcgE,IAAI,SAAS,SAG9BtC,EAAUmC,QAAU,WACnB,GAAIxC,GAAS,GAAIC,MACjBD,GAAuB,eAAI,iBAC3BA,EAAY,IAAIE,YAChBF,EAAoB,YAAIrB,EAAE,gBAAgBU,MAC1Cc,OAAOC,WAAW1B,WAAWuD,OAAOvD,WAAWS,IAAIa,EAAQ,WAC1DrB,EAAE,kBAAkB8C,OACpBtB,OAAOC,WAAW1B,WAAWuD,OAAQvD,WAAWS,IAAKT,WAAWsB,OAAQtB,WAAWwD,cAAexD,WAAWyD,cAAezD,WAAW0D,kBAAmB1D,WAAW2D,WAIxK,MAAOhC,GArKR,GAAIA,GAAY,IAwKhB1B,GAAEwB,QAAQyC,MAAM,WACXzC,OAAOC,aACVD,OAAOC,WAAaD,OAAO0C,SAC3B1C,OAAO0C,SAAWjE,IAAYoD,WAI/Bc"}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"version":3,"file":"captcha.min.js","sources":["captcha.js"],"names":["calledArgs","$","xeCaptcha","each","i","isSubmitHook","this","attr","indexOf","act","find","val","captchaTargetAct","length","append","current_url","submit","event","preventDefault","self","e","focus","params","Array","current_mid","window","oldExecXml","captchaXE","show","document","body","fc_isIE","navigator","appVersion","fc_isWin","toLowerCase","fc_isOpera","userAgent","_swfURL_","request_uri","_object_","appendTo","top_left","screen","width","$div","click","hide","swf","audio","setQuery","Date","getTime","setSoundTarget","exec","module","callback_func","response_tags","callback_func_arg","fo_obj","doCheck","key","compare","ret_obj","html","css","ready","exec_xml","jQuery"],"mappings":"AACA,GAAIA,YAAa,MACjB,SAAUC,GACTA,EAAE,WAGD,QAASC,KACRD,EAAE,QAAQE,KAAK,SAASC,GAEvB,GAAIC,IAAe,CACnB,KAAKJ,EAAEK,MAAMC,KAAK,aAAgBN,EAAEK,MAAMC,KAAK,YAAYC,QAAQ,cAAgB,EAGlF,IAAI,GADAC,GAAMR,EAAEK,MAAMI,KAAK,mBAAmBC,MAClCP,EAAI,EAAGA,EAAEQ,iBAAiBC,OAAQT,IAEzC,GAAGQ,iBAAiBR,IAAMK,EAC1B,CACCJ,GAAe,CACf,OAKCA,IAEHJ,EAAEK,MAAMQ,OAAO,6DACXb,EAAEK,MAAMI,KAAK,iCAChBT,EAAEK,MAAMQ,OAAO,uDAAuDC,YAAY,QACnFd,EAAEK,MAAMU,OAAO,SAASC,GACvB,GAAIhB,EAAEK,MAAMI,KAAK,2BAA2BC,MAE3C,OAAO,CAGRM,GAAMC,gBACN,IAAIC,GAAOb,IAEXL,GAAE,uBACDe,OAAO,SAASI,GAEhB,MADAA,GAAEF,iBACEjB,EAAE,gBAAgBU,OAKtBV,EAAEkB,GAAML,OAAO,kDAAmDb,EAAE,gBAAgBU,MAAO,YAC3FV,GAAEkB,GAAMH,WALPf,EAAEK,MAAMI,KAAK,oBAAoBC,IAAI,IAAIU,SAClC,IAMT,IAAIC,GAAS,GAAIC,MACjBD,GAAuB,eAAI,oBAC3BA,EAAY,IAAIE,YAChBC,OAAOC,WAAW,GAAI,GAAIJ,EAAQK,EAAUC,K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WACnB,GAAIxC,GAAS,GAAIC,MACjBD,GAAuB,eAAI,iBAC3BA,EAAY,IAAIE,YAChBF,EAAoB,YAAIrB,EAAE,gBAAgBU,MAC1Cc,OAAOC,WAAW1B,WAAWuD,OAAOvD,WAAWS,IAAIa,EAAQ,WAC1DrB,EAAE,kBAAkB8C,OACpBtB,OAAOC,WAAW1B,WAAWuD,OAAQvD,WAAWS,IAAKT,WAAWsB,OAAQtB,WAAWwD,cAAexD,WAAWyD,cAAezD,WAAW0D,kBAAmB1D,WAAW2D,WAIxK,MAAOhC,GArKR,GAAIA,GAAY,IAwKhB1B,GAAEwB,QAAQyC,MAAM,WACXzC,OAAOC,aACVD,OAAOC,WAAaD,OAAO0C,SAC3B1C,OAAO0C,SAAWjE,IAAYoD,WAI/Bc"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1,2 @@
!function(a){var b="(https?|ftp|news|telnet|irc|mms)://",c="(?:[\\w\\-]+\\.)+(?:[a-z]+)",d="(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])",e="(?:"+d+"\\.){3}"+d,f="(?::([0-9]+))?",g="(?:/~[\\w-]+)?",h='((?:/[\\w!"$-/:-@]+)*)',i="(?:#([\\w!-@]+))?",j=new RegExp("("+b+"("+c+"|"+e+"|localhost)"+f+g+h+i+")","ig"),k=xe.createPlugin("OEmbed",{targets:[],init:function(){this.targets=[],this.enableAutoLink=!1,this.castedOembedA=!1,this.embedSetting=[]},API_ONREADY:function(){var b=this;this.extractTargets(a(".xe_content")),this.oApp.getPlugin("autolink").length&&(this.enableAutoLink=!0),b.cast("OEMBEDA"),this.enableAutoLink||a(this.targets).each(function(){b.cast("OEMBED",[this])})},API_BEFORE_AUTOLINK:function(){var a=this;a.cast("OEMBEDA")},API_AFTER_AUTOLINK:function(a,b){this.oembed(b[0])},API_OEMBED:function(b,c){if(!this.enableAutoLink){var d=c[0];if(!a(d).parent().length||"a"==a(d).parent().get(0).nodeName.toLowerCase())return void this.oembed(a(d));var e=d.nodeValue,f=a("<span>");e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(j,'<a href="$1" target="_blank">$1</a>'),a(d).before(f),a(d).replaceWith(e),c[0]=f.next("a"),f.remove(),this.oembed(c[0])}},API_OEMBEDA:function(){if(!this.castedOembedA){var b=this;this.castedOembedA=!0,a(".read_body a").not("_oembed").each(function(){b.oembed(a(this))})}},oembed:function(b){var c=this;this.embedSetting.maxWidth||(this.embedSetting.maxWidth=a(".xe_content").width()),b&&(b&&3==b.nodeType&&(b=a(b)),b.oembed(null,c.embedSetting).addClass("_oembed"))},extractTargets:function(b){var c=this,d=a(".xe_content",b);return d.length?void this.extractTargets(d):void a(b).contents().each(function(){var b=this.nodeName.toLowerCase();if(-1==a.inArray(b,["a","pre","xml","textarea","input","select","option","code","script","style","iframe","button","img","embed","object","ins"]))if(j.exec(""),3==this.nodeType){var d=this.nodeValue;if(d.length<5)return;if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(d))return;c.targets.push(this)}else c.extractTargets(this)})}});xe.registerPlugin(new k)}(jQuery);
!function(a){var b="(https?|ftp|news|telnet|irc|mms)://",c="(?:[\\w\\-]+\\.)+(?:[a-z]+)",d="(?:1[0-9]{2}|2[0-4][0-9]|25[0-5]|[1-9]?[0-9])",e="(?:"+d+"\\.){3}"+d,f="(?::([0-9]+))?",g="(?:/~[\\w-]+)?",h='((?:/[\\w!"$-/:-@]+)*)',i="(?:#([\\w!-@]+))?",j=new RegExp("("+b+"("+c+"|"+e+"|localhost)"+f+g+h+i+")","ig"),k=xe.createPlugin("OEmbed",{targets:[],init:function(){this.targets=[],this.enableAutoLink=!1,this.castedOembedA=!1,this.embedSetting=[]},API_ONREADY:function(){var b=this;this.extractTargets(a(".xe_content")),this.oApp.getPlugin("autolink").length&&(this.enableAutoLink=!0),b.cast("OEMBEDA"),this.enableAutoLink||a(this.targets).each(function(){b.cast("OEMBED",[this])})},API_BEFORE_AUTOLINK:function(){var a=this;a.cast("OEMBEDA")},API_AFTER_AUTOLINK:function(a,b){this.oembed(b[0])},API_OEMBED:function(b,c){if(!this.enableAutoLink){var d=c[0];if(!a(d).parent().length||"a"==a(d).parent().get(0).nodeName.toLowerCase())return void this.oembed(a(d));var e=d.nodeValue,f=a("<span>");e=e.replace(/</g,"&lt;").replace(/>/g,"&gt;"),e=e.replace(j,'<a href="$1" target="_blank">$1</a>'),a(d).before(f),a(d).replaceWith(e),c[0]=f.next("a"),f.remove(),this.oembed(c[0])}},API_OEMBEDA:function(){if(!this.castedOembedA){var b=this;this.castedOembedA=!0,a(".read_body a").not("_oembed").each(function(){b.oembed(a(this))})}},oembed:function(b){var c=this;this.embedSetting.maxWidth||(this.embedSetting.maxWidth=a(".xe_content").width()),b&&(b&&3==b.nodeType&&(b=a(b)),b.oembed(null,c.embedSetting).addClass("_oembed"))},extractTargets:function(b){var c=this,d=a(".xe_content",b);return d.length?void this.extractTargets(d):void a(b).contents().each(function(){var b=this.nodeName.toLowerCase();if(-1==a.inArray(b,["a","pre","xml","textarea","input","select","option","code","script","style","iframe","button","img","embed","object","ins"]))if(j.exec(""),3==this.nodeType){var d=this.nodeValue;if(d.length<5)return;if(!/(http|https|ftp|news|telnet|irc|mms):\/\//i.test(d))return;c.targets.push(this)}else c.extractTargets(this)})}});xe.registerPlugin(new k)}(jQuery);
//# sourceMappingURL=oembed.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"oembed.min.js","sources":["oembed.js"],"names":["$","protocol_re","domain_re","max_255_re","ip_re","port_re","user_re","path_re","hash_re","url_regex","RegExp","OEmbed","xe","createPlugin","targets","init","this","enableAutoLink","castedOembedA","embedSetting","API_ONREADY","thisPlugin","extractTargets","oApp","getPlugin","length","cast","each","API_BEFORE_AUTOLINK","API_AFTER_AUTOLINK","oSender","params","oembed","API_OEMBED","textNode","parent","get","nodeName","toLowerCase","content","nodeValue","dummy","replace","before","replaceWith","next","remove","API_OEMBEDA","not","target","maxWidth","width","nodeType","addClass","obj","wrap","contents","node_name","inArray","exec","test","push","registerPlugin","jQuery"],"mappings":"CAKA,SAAUA,GACT,GAAIC,GAAc,sCACdC,EAAc,8BACdC,EAAc,gDACdC,EAAc,MAAMD,EAAW,UAAUA,EACzCE,EAAc,iBACdC,EAAc,iBACdC,EAAc,yBACdC,EAAc,oBAEdC,EAAY,GAAIC,QAAO,IAAIT,EAAY,IAAIC,EAAU,IAAIE,EAAM,cAAiBC,EAAQC,EAAQC,EAAQC,EAAQ,IAAK,MAErHG,EAASC,GAAGC,aAAa,UAC5BC,WACAC,KAAO,WACNC,KAAKF,WACLE,KAAKC,gBAAiB,EACtBD,KAAKE,eAAgB,EACrBF,KAAKG,iBAGNC,YAAc,WACb,GAAIC,GAAaL,IAGjBA,MAAKM,eAAetB,EAAE,gBAEnBgB,KAAKO,KAAKC,UAAU,YAAYC,SAElCT,KAAKC,gBAAiB,GAEvBI,EAAWK,KAAK,WAEZV,KAAKC,gBAERjB,EAAEgB,KAAKF,SAASa,KAAK,WACpBN,EAAWK,KAAK,UAAWV,UAI9BY,oBAAsB,WACrB,GAAIP,GAAaL,IACjBK,GAAWK,KAAK,YAEjBG,mBAAqB,SAASC,EAASC,GACtCf,KAAKgB,OAAOD,EAAO,KAEpBE,WAAa,SAASH,EAASC,GAC9B,IAAGf,KAAKC,eAAR,CACA,GAEIiB,GAAWH,EAAO,EACtB,KAAI/B,EAAEkC,GAAUC,SAASV,QAAgE,KAAtDzB,EAAEkC,GAAUC,SAASC,IAAI,GAAGC,SAASC,cAGvE,WADAtB,MAAKgB,OAAOhC,EAAEkC,GAGf,IAAIK,GAAWL,EAASM,UACpBC,EAAWzC,EAAE,SAEjBuC,GAAUA,EAAQG,QAAQ,KAAM,QAAQA,QAAQ,KAAM,QACtDH,EAAUA,EAAQG,QAAQjC,EAAW,uCAErCT,EAAEkC,GAAUS,OAAOF,GACnBzC,EAAEkC,GAAUU,YAAYL,GACxBR,EAAO,GAAKU,EAAMI,KAAK,KACvBJ,EAAMK,SAEN9B,KAAKgB,OAAOD,EAAO,MAEpBgB,YAAc,WACb,IAAG/B,KAAKE,cAAR,CACA,GAAIG,GAAaL,IAEjBA,MAAKE,eAAgB,EAErBlB,EAAE,gBAAgBgD,IAAI,WAAWrB,KAAK,WACrCN,EAAWW,OAAOhC,EAAEgB,WAGtBgB,OAAS,SAASiB,GACjB,GAAI5B,GAAaL,IAEbA,MAAKG,aAAa+B,WAErBlC,KAAKG,aAAa+B,SAAWlD,EAAE,eAAemD,SAG3CF,IACDA,GAA6B,GAAnBA,EAAOG,WAAeH,EAASjD,EAAEiD,IAE9CA,EAAOjB,OAAO,KAAMX,EAAWF,cAAckC,SAAS,aAEvD/B,eAAiB,SAASgC,GACzB,GAAIjC,GAAaL,KACbuC,EAAOvD,EAAE,cAAesD,EAC5B,OAAGC,GAAK9B,WACPT,MAAKM,eAAeiC,OAIrBvD,GAAEsD,GACDE,WACA7B,KAAK,WACL,GAAI8B,GAAYzC,KAAKqB,SAASC,aAC9B,IAAyK,IAAtKtC,EAAE0D,QAAQD,GAAY,IAAK,MAAO,MAAO,WAAY,QAAS,SAAU,SAAU,OAAQ,SAAU,QAAS,SAAU,SAAU,MAAO,QAAS,SAAU,QAK9J,GAFAhD,EAAUkD,KAAK,IAEK,GAAjB3C,KAAKoC,SAAe,CACtB,GAAIb,GAAUvB,KAAKwB,SAEnB,IAAGD,EAAQd,OAAS,EAAG,MAEvB,KAAI,6CAA6CmC,KAAKrB,GAAU,MAEhElB,GAAWP,QAAQ+C,KAAK7C,UAExBK,GAAWC,eAAeN,UAM9BJ,IAAGkD,eAAe,GAAInD,KACpBoD"}

View file

@ -1 +1,2 @@
!function(a){function b(){var b,c,e,f,g,h=a(document.body);return d?(b=a("#xe_gallery_controls"),c=a("#xe_gallery_holder"),e=a("#xe_gallery_closebtn"),f=a("#xe_gallery_prevbtn"),g=a("#xe_gallery_nextbtn")):(d=a("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:.7}),b=a("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510}),f=a('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(b),e=a('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(b),g=a('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(b),b.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){a(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){a(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){a(this).trigger("mouseover")}).blur(function(){a(this).trigger("mouseout")}),c=a(new Image),c.attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(b).draggable(),h.append(d).append(b),c.live("load",function(){var b=a(window).width(),d=a(window).height();c.css({left:b/2-c.width()/2+"px",top:d/2-c.height()/2+"px"})}),d.xeShow=function(){var b=(a(window).width(),a(window).height());a("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0}),a("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(b/2-32)+"px"),this.xeMove(0)},d.xeHide=function(){d.hide(),b.hide()},d.xePrev=function(){this.xeMove(-1)},d.xeNext=function(){this.xeMove(1)},d.xeMove=function(b){var d=a(window).width(),h=a(window).height();this.index+=b,f.css("visibility",this.index>0?"visible":"hidden"),g.css("visibility",this.index<this.list.size()-1?"visible":"hidden");var i=this.list.eq(this.index).attr("rawsrc");i||(i=this.list.eq(this.index).attr("src")),c.attr("src",i).removeAttr("width").removeAttr("height"),c.width()>0&&c.css({left:d/2-c.width()/2+"px",top:h/2-c.height()/2+"px"}),e.css({left:d/2-32+"px",top:"10px"}).focus()},a(document).keydown(function(a){return 27==a.which?(d.xeHide(),!1):!0})),d}function c(){var c=a(this).closest(".xe_content"),d=c.find("img[rel=xe_gallery]"),e=a.inArray(a(this).get(0),d.get()),f=b();f.list=d,f.index=e,f.xeShow()}var d=null;a(window).load(function(){function b(a,c){if(c||(c=0),!(c>=10)){var d=this,e={width:d.width(),height:d.height()};if(!e.width||!e.height)return void setTimeout(function(){b.call(d,a,++c)},200);if(!(e.width<=a)){var f=a/e.width;d.removeAttr("width").removeAttr("height").css({width:a,height:parseInt(e.height*f,10)})}}}var d=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i,e=/(?:common\/tpl\/images\/blank\.gif$)/i,f=a('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');a(".xe_content").each(function(){var g=f.appendTo(this).width();f.remove(),g&&(a("img",this).each(function(){var c=a(this),f=c.attr("src");(!d.test(f)||e.test(f))&&(c.attr("rel","xe_gallery"),b.call(c,g))}),a("img[rel=xe_gallery]",this).live("mouseover",function(){var b=a(this);b.parent("a").length||b.attr("onclick")||b.css("cursor","pointer").click(c)}))})})}(jQuery);
!function(a){function b(){var b,c,e,f,g,h=a(document.body);return d?(b=a("#xe_gallery_controls"),c=a("#xe_gallery_holder"),e=a("#xe_gallery_closebtn"),f=a("#xe_gallery_prevbtn"),g=a("#xe_gallery_nextbtn")):(d=a("<div>").attr("id","xe_gallery_screen").css({position:"fixed",display:"none",backgroundColor:"black",zIndex:500,opacity:.7}),b=a("<div>").attr("id","xe_gallery_controls").css({position:"fixed",display:"none",overflow:"hidden",zIndex:510}),f=a('<button type="button" id="xe_gallery_prevbtn" />').css({left:"10px",backgroundPosition:"0 -64px"}).click(function(){d.xePrev()}).appendTo(b),e=a('<button type="button" id="xe_gallery_closebtn" />').css({top:"10px",backgroundPosition:"0 0"}).click(function(){d.xeHide()}).appendTo(b),g=a('<button type="button" id="xe_gallery_nextbtn" />').attr("id","xe_gallery_nextbtn").css({right:"10px",backgroundPosition:"0 -128px"}).click(function(){d.xeNext()}).appendTo(b),b.find(">button").css({position:"absolute",width:"64px",height:"64px",zIndex:530,cursor:"pointer",border:0,margin:0,padding:0,backgroundColor:"transparent",backgroundImage:"url("+request_uri+"addons/resize_image/btn.png)",backgroundRepeat:"no-repeat",opacity:".5",filter:"alpha(opacity=50)"}).mouseover(function(){a(this).css({opacity:"1",filter:"alpha(opacity=100)"})}).mouseout(function(){a(this).css({opacity:".5",filter:"alpha(opacity=50)"})}).focus(function(){a(this).trigger("mouseover")}).blur(function(){a(this).trigger("mouseout")}),c=a(new Image),c.attr("id","xe_gallery_holder").css({border:"5px solid white",zindex:520,maxWidth:"none",borderRadius:"5px",boxShadow:"0 0 10px #000"}).appendTo(b).draggable(),h.append(d).append(b),c.live("load",function(){var b=a(window).width(),d=a(window).height();c.css({left:b/2-c.width()/2+"px",top:d/2-c.height()/2+"px"})}),d.xeShow=function(){var b=(a(window).width(),a(window).height());a("#xe_gallery_controls,#xe_gallery_screen").show().css({top:0,right:0,bottom:0,left:0}),a("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round(b/2-32)+"px"),this.xeMove(0)},d.xeHide=function(){d.hide(),b.hide()},d.xePrev=function(){this.xeMove(-1)},d.xeNext=function(){this.xeMove(1)},d.xeMove=function(b){var d=a(window).width(),h=a(window).height();this.index+=b,f.css("visibility",this.index>0?"visible":"hidden"),g.css("visibility",this.index<this.list.size()-1?"visible":"hidden");var i=this.list.eq(this.index).attr("rawsrc");i||(i=this.list.eq(this.index).attr("src")),c.attr("src",i).removeAttr("width").removeAttr("height"),c.width()>0&&c.css({left:d/2-c.width()/2+"px",top:h/2-c.height()/2+"px"}),e.css({left:d/2-32+"px",top:"10px"}).focus()},a(document).keydown(function(a){return 27==a.which?(d.xeHide(),!1):!0})),d}function c(){var c=a(this).closest(".xe_content"),d=c.find("img[rel=xe_gallery]"),e=a.inArray(a(this).get(0),d.get()),f=b();f.list=d,f.index=e,f.xeShow()}var d=null;a(window).load(function(){function b(a,c){if(c||(c=0),!(c>=10)){var d=this,e={width:d.width(),height:d.height()};if(!e.width||!e.height)return void setTimeout(function(){b.call(d,a,++c)},200);if(!(e.width<=a)){var f=a/e.width;d.removeAttr("width").removeAttr("height").css({width:a,height:parseInt(e.height*f,10)})}}}var d=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i,e=/(?:common\/tpl\/images\/blank\.gif$)/i,f=a('<div style="height:1px;overflow:hidden;opacity:0;display:block;clear:both"></div>');a(".xe_content").each(function(){var g=f.appendTo(this).width();f.remove(),g&&(a("img",this).each(function(){var c=a(this),f=c.attr("src");(!d.test(f)||e.test(f))&&(c.attr("rel","xe_gallery"),b.call(c,g))}),a("img[rel=xe_gallery]",this).live("mouseover",function(){var b=a(this);b.parent("a").length||b.attr("onclick")||b.css("cursor","pointer").click(c)}))})})}(jQuery);
//# sourceMappingURL=resize_image.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"resize_image.min.js","sources":["resize_image.js"],"names":["$","getScreen","controls","imgframe","closebtn","prevbtn","nextbtn","body","document","xScreen","attr","css","position","display","backgroundColor","zIndex","opacity","overflow","left","backgroundPosition","click","xePrev","appendTo","top","xeHide","right","xeNext","find","width","height","cursor","border","margin","padding","backgroundImage","request_uri","backgroundRepeat","filter","mouseover","this","mouseout","focus","trigger","blur","Image","zindex","maxWidth","borderRadius","boxShadow","draggable","append","live","clientWidth","window","clientHeight","xeShow","show","bottom","Math","round","xeMove","hide","val","index","list","size","src","eq","removeAttr","keydown","e","which","slideshow","container","closest","imglist","currentIdx","inArray","get","load","doResize","contentWidth","count","$img","beforSize","setTimeout","call","resize_ratio","parseInt","regx_skip","regx_allow_i6pngfix","dummy","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AAMqD,KAAK,WACnB,GAAIT,GAAOnF,EAAEuC,MACTuD,EAASX,EAAKzE,KAAK,SACpB+E,EAAUM,KAAKD,IAAYJ,EAAoBK,KAAKD,MACvDX,EAAKzE,KAAK,MAAO,cACjBsE,EAASM,KAAKH,EAAMF,MAIrBjF,EAAE,sBAAuBuC,MAAMY,KAAK,YAAa,WAChD,GAAIgC,GAAOnF,EAAEuC,KACT4C,GAAKa,OAAO,KAAKC,QAAWd,EAAKzE,KAAK,YACzCyE,EAAKxE,IAAI,SAAU,WAAWS,MAAMoD,WAMrC0B"}

View file

@ -219,7 +219,7 @@ class Context
if($this->db_info->use_sitelock == 'Y')
{
if(is_array($this->db_info->sitelock_whitelist)) $whitelist = $this->db_info->sitelock_whitelist;
if(!IpFilter::filter($whitelist))
{
$title = ($this->db_info->sitelock_title) ? $this->db_info->sitelock_title : 'Maintenance in progress...';
@ -242,18 +242,9 @@ class Context
}
}
// check if using rewrite module
$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
// If XE is installed, get virtual site information
if(self::isInstalled())
{
// If using rewrite module, initializes router
if($this->allow_rewrite)
{
Router::proc();
}
$oModuleModel = getModel('module');
$site_module_info = $oModuleModel->getDefaultMid();
@ -372,6 +363,9 @@ class Context
$this->lang = &$GLOBALS['lang'];
$this->loadLang(_XE_PATH_ . 'common/lang/');
// check if using rewrite module
$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
// set locations for javascript use
if($_SERVER['REQUEST_METHOD'] == 'GET')
{
@ -486,10 +480,8 @@ class Context
$db_info->use_ssl = 'none';
$this->set('_use_ssl', $db_info->use_ssl);
if($db_info->http_port)
$self->set('_http_port', $db_info->http_port);
if($db_info->https_port)
$self->set('_https_port', $db_info->https_port);
$self->set('_http_port', ($db_info->http_port) ? $db_info->http_port : NULL);
$self->set('_https_port', ($db_info->https_port) ? $db_info->https_port : NULL);
if(!$db_info->sitelock_whitelist) {
$db_info->sitelock_whitelist = '127.0.0.1';
@ -1121,7 +1113,7 @@ class Context
{
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
$self->js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
$self->js_callback_func = $self->getJSCallbackFunc();
($type && $self->request_method = $type) or
(strpos($_SERVER['CONTENT_TYPE'], 'json') && $self->request_method = 'JSON') or
@ -1252,19 +1244,75 @@ class Context
$xml_obj = $oXml->parse();
$params = $xml_obj->methodcall->params;
unset($params->node_name, $params->attrs);
unset($params->node_name, $params->attrs, $params->body);
if(!count($params))
if(!count(get_object_vars($params)))
{
return;
}
foreach($params as $key => $obj)
foreach($params as $key => $val)
{
$this->set($key, $this->_filterRequestVar($key, $obj->body, 0), TRUE);
$this->set($key, $this->_filterXmlVars($key, $val), TRUE);
}
}
/**
* Filter xml variables
*
* @param string $key Variable key
* @param object $val Variable value
* @return mixed filtered value
*/
function _filterXmlVars($key, $val)
{
if(is_array($val))
{
$stack = array();
foreach($val as $k => $v)
{
$stack[$k] = $this->_filterXmlVars($k, $v);
}
return $stack;
}
$body = $this->_filterRequestVar($key, trim($val->body ? $val->body : ''), 0);
if($body)
{
return $body;
}
unset($val->node_name, $val->attrs, $val->body);
if(!count(get_object_vars($val)))
{
return NULL;
}
$stack = new stdClass();
foreach($val as $k => $v)
{
$output = $this->_filterXmlVars($k, $v);
if(is_object($v) && $v->attrs->type == 'array')
{
$output = array($output);
}
if($k == 'value' && (is_array($v) || $v->attrs->type == 'array'))
{
return $output;
}
$stack->{$k} = $output;
}
if(!count(get_object_vars($stack)))
{
return NULL;
}
return $stack;
}
/**
* Filter request variable
*
@ -1410,7 +1458,16 @@ class Context
function getJSCallbackFunc()
{
is_a($this, 'Context') ? $self = $this : $self = self::getInstance();
return $self->js_callback_func;
$js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback'];
if(!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func))
{
unset($js_callback_func);
unset($_GET['xe_js_callback']);
unset($_POST['xe_js_callback']);
}
return $js_callback_func;
}
/**
@ -1574,9 +1631,7 @@ class Context
'act.document_srl.key.mid.vid' => ($act == 'trackback') ? "$vid/$mid/$srl/$key/$act" : ''
);
Router::setMap($target_map);
$query = Router::makePrettyUrl($target);
$query = $target_map[$target];
}
if(!$query)
@ -1612,7 +1667,7 @@ class Context
}
elseif($_use_ssl == 'optional')
{
$ssl_mode = ($get_vars['act'] && $self->isExistsSSLAction($get_vars['act'])) ? ENFORCE_SSL : RELEASE_SSL;
$ssl_mode = (($self->get('module') === 'admin') || ($get_vars['module'] === 'admin') || (isset($get_vars['act']) && $self->isExistsSSLAction($get_vars['act']))) ? ENFORCE_SSL : RELEASE_SSL;
$query = $self->getRequestUri($ssl_mode, $domain) . $query;
// no SSL
}

View file

@ -219,8 +219,8 @@ class HTMLDisplayHandler
// set icon
$oAdminModel = getAdminModel('admin');
$favicon_url = $oAdminModel->getFaviconUrl();
$mobicon_url = $oAdminModel->getMobileIconUrl();
$favicon_url = $oAdminModel->getFaviconUrl(false);
$mobicon_url = $oAdminModel->getMobileIconUrl(false);
Context::set('favicon_url', $favicon_url);
Context::set('mobicon_url', $mobicon_url);
@ -398,6 +398,7 @@ class HTMLDisplayHandler
{
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/x.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/common.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -100000), true);
@ -451,8 +452,8 @@ class HTMLDisplayHandler
// add common JS/CSS files
if(__DEBUG__ || !__XE_VERSION_STABLE__)
{
$oContext->loadFile(array('./common/js/jquery-1.x.js', 'head', 'lt IE 9', -111000), true);
$oContext->loadFile(array('./common/js/jquery.js', 'head', 'gte IE 9', -110000), true);
$oContext->loadFile(array('./common/js/jquery.js', 'head', '', -110000), true);
$oContext->loadFile(array('./common/js/modernizr.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/x.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/common.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/js_app.js', 'head', '', -100000), true);
@ -463,8 +464,7 @@ class HTMLDisplayHandler
}
else
{
$oContext->loadFile(array('./common/js/jquery-1.x.min.js', 'head', 'lt IE 9', -111000), true);
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', 'gte IE 9', -110000), true);
$oContext->loadFile(array('./common/js/jquery.min.js', 'head', '', -110000), true);
$oContext->loadFile(array('./common/js/x.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
$oContext->loadFile(array('./common/css/xe.min.css', '', '', -1000000), true);

View file

@ -1,253 +0,0 @@
<?php
/**
* @file Router.class.php
* @brief Parses URIs and determines routing
* @author FunnyXE (admin@funnyxe.com)
*/
class Router
{
/**
* URI Segments
* @var array
*/
private static $segments = array();
/**
* Routes
* @var array
*/
private static $routes = array(
// rss , blogAPI
'(rss|atom)' => array('module' => 'rss', 'act' => '$1', '[L]' => TRUE),
'([a-zA-Z0-9_]+)/(rss|atom|api)' => array('mid' => '$1', 'act' => '$2', '[L]' => TRUE),
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)' => array('vid' => '$1', 'mid' => '$2', 'act' => '$3', '[L]' => TRUE),
// trackback
'([0-9]+)/(.+)/trackback' => array('document_srl' => '$1', 'key' => '$2', 'act' => 'trackback', '[L]' => TRUE),
'([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback' => array('mid' => '$1', 'document_srl' => '$2', 'key' => '$3', 'act' => 'trackback', '[L]' => TRUE),
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)/(.+)/trackback' => array('vid' => '$1', 'mid' => '$2', 'document_srl' => '$3' , 'key' => '$4', 'act' => 'trackback', '[L]' => TRUE),
// document_srl
'([0-9]+)' => array('document_srl' => '$1', '[L]' => TRUE),
// mid
'([a-zA-Z0-9_]+)/?' => array('mid' => '$1', '[L]' => TRUE),
// mid + document_srl
'([a-zA-Z0-9_]+)/([0-9]+)' => array('mid' => '$1', 'document_srl' => '$2', '[L]' => TRUE),
// vid + mid
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/' => array('vid' => '$1', 'mid' => '$2', '[L]' => TRUE),
// vid + mid + document_srl
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([0-9]+)?' => array('vid' => '$1', 'mid' => '$2', 'document_srl' => '$3', '[L]' => TRUE),
// mid + entry title
'([a-zA-Z0-9_]+)/entry/(.+)' => array('mid' => '$1', 'entry' => '$2', '[L]' => TRUE),
// vid + mid + entry title
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)' => array('vid' => '$1', 'mid' => '$2', 'entry' => '$3', '[L]' => TRUE),
// shop / vid / [category|product] / identifier
'([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-zA-Z0-9_\.-]+)' => array('act' => 'route', 'vid' => '$1', 'type' => '$2', 'identifier'=> '$3', '[L]' => TRUE)
);
/**
* Rewrite map
* @var array
*/
private static $rewrite_map = array();
/**
* @brief Applys routes.
* @see This function should be called only once
* @return void
*/
public static function proc()
{
$uri = $_SERVER['REQUEST_URI'];
if (stripos($uri, $_SERVER['SCRIPT_NAME']) === 0)
{
$uri = substr($uri, strlen($_SERVER['SCRIPT_NAME']));
}
elseif (strpos($uri, dirname($_SERVER['SCRIPT_NAME'])) === 0)
{
$uri = substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME'])));
}
if ($uri == '/' || empty($uri))
{
return;
}
// Get relative path from request uri
$path = parse_url($uri, PHP_URL_PATH);
// Do some final cleaning of the URI and return it
$path = str_replace(array('//', '../'), '/', trim($path, '/'));
if(strlen($path) > 0)
{
self::$segments = explode('/', $path);
}
if(isset(self::$routes[$path]))
{
foreach(self::$routes[$path] as $key => $val)
{
if(strlen($val) > 0)
{
if(substr_compare($val, '$', 0, 1) == 0)
{
$segment_index = (int) substr($val, 1) - 1;
if($segment_index < 0)
{
continue;
}
Context::set($key, self::$segments[$segment_index], TRUE);
}
else
{
Context::set($key, $val, TRUE);
}
}
else
{
Context::set($key, '', TRUE);
}
}
return;
}
$break = FALSE;
// Apply routes
foreach(self::$routes as $regex => $query)
{
// Stop the routing proccess
if($break)
{
break;
}
if(preg_match('#^' . $regex . '$#', $path, $matches))
{
foreach($query as $key => $val)
{
// If [L] keyword is defined
if($key == '[L]')
{
// Stop the routing process and don't apply any more rules
$break = TRUE;
continue;
}
if(strlen($val) > 0)
{
if(substr($val, 0, 1) == '$')
{
$segment_index = (int) substr($val, 1) - 1;
if($segment_index < 0)
{
continue;
}
Context::set($key, self::$segments[$segment_index], TRUE);
}
else
{
Context::set($key, $val, TRUE);
}
}
else
{
Context::set($key, '', TRUE);
}
}
}
}
}
/**
* @brief Add a rewrite map(s)
* @param array $map
* @return void
*/
public static function setMap($map)
{
self::$rewrite_map = array_merge(self::$rewrite_map, $map);
}
/**
* @brief Add a route
* @param string $target
* @param array $query
* @return void
*/
public static function add($target, $query)
{
self::$routes[$target] = $query;
}
/**
* @brief Add multiple routes
* @param array $routes
* @return void
*/
public function adds($routes)
{
self::$routes = array_merge(self::$routes, $routes);
}
/**
* @brief Get segment from request uri
* @param int $index
* @return string
*/
public static function getSegment($index)
{
return self::$segments[$index - 1];
}
/**
* @brief Get segment from request uri
* @param int $index
* @return string
*/
public static function getSegments()
{
return self::$segments;
}
/**
* @brief Get route info
* @param string $regex
* @return array
*/
public static function getRoute($regex)
{
return self::$routes[$regex];
}
/**
* @brief Get routes list
* @return array
*/
public static function getRoutes()
{
return self::$routes;
}
/**
* @brief Get routes list
* @param string $regex
* @return boolean
*/
public static function isExistsRoute($regex)
{
return isset(self::$routes[$regex]);
}
/**
* @brief Makes shortten url
* @param string $regex
* @return string
*/
public static function makePrettyUrl($regex)
{
return self::$rewrite_map[$regex];
}
}

View file

@ -596,14 +596,36 @@ function doDocumentLoad(obj) {
}
/* 저장된 게시글의 선택 */
function doDocumentSelect(document_srl) {
function doDocumentSelect(document_srl, module) {
if(!opener || !opener.objForSavedDoc) {
window.close();
return;
}
if(module===undefined) {
module = 'document';
}
// 게시글을 가져와서 등록하기
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
switch(module) {
case 'page' :
var url = opener.current_url;
url = url.setQuery('document_srl', document_srl);
if(url.getQuery('act') === 'dispPageAdminMobileContentModify')
{
url = url.setQuery('act', 'dispPageAdminMobileContentModify');
}
else
{
url = url.setQuery('act', 'dispPageAdminContentModify');
}
opener.location.href = url;
break;
default :
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
break;
}
window.close();
}

826
common/js/modernizr.js Normal file
View file

@ -0,0 +1,826 @@
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load-cssclassprefix:modernizr!
*/
;
window.Modernizr = (function( window, document, undefined ) {
var version = '2.8.3',
Modernizr = {},
enableClasses = true,
docElement = document.documentElement,
mod = 'modernizr',
modElem = document.createElement(mod),
mStyle = modElem.style,
inputElem = document.createElement('input') ,
smile = ':)',
toString = {}.toString,
prefixes = ' -webkit- -moz- -o- -ms- '.split(' '),
omPrefixes = 'Webkit Moz O ms',
cssomPrefixes = omPrefixes.split(' '),
domPrefixes = omPrefixes.toLowerCase().split(' '),
ns = {'svg': 'http://www.w3.org/2000/svg'},
tests = {},
inputs = {},
attrs = {},
classes = [],
slice = classes.slice,
featureName,
injectElementWithStyles = function( rule, callback, nodes, testnames ) {
var style, ret, node, docOverflow,
div = document.createElement('div'),
body = document.body,
fakeBody = body || document.createElement('body');
if ( parseInt(nodes, 10) ) {
while ( nodes-- ) {
node = document.createElement('div');
node.id = testnames ? testnames[nodes] : mod + (nodes + 1);
div.appendChild(node);
}
}
style = ['&#173;','<style id="s', mod, '">', rule, '</style>'].join('');
div.id = mod;
(body ? div : fakeBody).innerHTML += style;
fakeBody.appendChild(div);
if ( !body ) {
fakeBody.style.background = '';
fakeBody.style.overflow = 'hidden';
docOverflow = docElement.style.overflow;
docElement.style.overflow = 'hidden';
docElement.appendChild(fakeBody);
}
ret = callback(div, rule);
if ( !body ) {
fakeBody.parentNode.removeChild(fakeBody);
docElement.style.overflow = docOverflow;
} else {
div.parentNode.removeChild(div);
}
return !!ret;
},
isEventSupported = (function() {
var TAGNAMES = {
'select': 'input', 'change': 'input',
'submit': 'form', 'reset': 'form',
'error': 'img', 'load': 'img', 'abort': 'img'
};
function isEventSupported( eventName, element ) {
element = element || document.createElement(TAGNAMES[eventName] || 'div');
eventName = 'on' + eventName;
var isSupported = eventName in element;
if ( !isSupported ) {
if ( !element.setAttribute ) {
element = document.createElement('div');
}
if ( element.setAttribute && element.removeAttribute ) {
element.setAttribute(eventName, '');
isSupported = is(element[eventName], 'function');
if ( !is(element[eventName], 'undefined') ) {
element[eventName] = undefined;
}
element.removeAttribute(eventName);
}
}
element = null;
return isSupported;
}
return isEventSupported;
})(),
_hasOwnProperty = ({}).hasOwnProperty, hasOwnProp;
if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) {
hasOwnProp = function (object, property) {
return _hasOwnProperty.call(object, property);
};
}
else {
hasOwnProp = function (object, property) {
return ((property in object) && is(object.constructor.prototype[property], 'undefined'));
};
}
if (!Function.prototype.bind) {
Function.prototype.bind = function bind(that) {
var target = this;
if (typeof target != "function") {
throw new TypeError();
}
var args = slice.call(arguments, 1),
bound = function () {
if (this instanceof bound) {
var F = function(){};
F.prototype = target.prototype;
var self = new F();
var result = target.apply(
self,
args.concat(slice.call(arguments))
);
if (Object(result) === result) {
return result;
}
return self;
} else {
return target.apply(
that,
args.concat(slice.call(arguments))
);
}
};
return bound;
};
}
function setCss( str ) {
mStyle.cssText = str;
}
function setCssAll( str1, str2 ) {
return setCss(prefixes.join(str1 + ';') + ( str2 || '' ));
}
function is( obj, type ) {
return typeof obj === type;
}
function contains( str, substr ) {
return !!~('' + str).indexOf(substr);
}
function testProps( props, prefixed ) {
for ( var i in props ) {
var prop = props[i];
if ( !contains(prop, "-") && mStyle[prop] !== undefined ) {
return prefixed == 'pfx' ? prop : true;
}
}
return false;
}
function testDOMProps( props, obj, elem ) {
for ( var i in props ) {
var item = obj[props[i]];
if ( item !== undefined) {
if (elem === false) return props[i];
if (is(item, 'function')){
return item.bind(elem || obj);
}
return item;
}
}
return false;
}
function testPropsAll( prop, prefixed, elem ) {
var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' ');
if(is(prefixed, "string") || is(prefixed, "undefined")) {
return testProps(props, prefixed);
} else {
props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' ');
return testDOMProps(props, prefixed, elem);
}
} tests['flexbox'] = function() {
return testPropsAll('flexWrap');
};
tests['flexboxlegacy'] = function() {
return testPropsAll('boxDirection');
};
tests['canvas'] = function() {
var elem = document.createElement('canvas');
return !!(elem.getContext && elem.getContext('2d'));
};
tests['canvastext'] = function() {
return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function'));
};
tests['webgl'] = function() {
return !!window.WebGLRenderingContext;
};
tests['touch'] = function() {
var bool;
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
bool = true;
} else {
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
bool = node.offsetTop === 9;
});
}
return bool;
};
tests['geolocation'] = function() {
return 'geolocation' in navigator;
};
tests['postmessage'] = function() {
return !!window.postMessage;
};
tests['websqldatabase'] = function() {
return !!window.openDatabase;
};
tests['indexedDB'] = function() {
return !!testPropsAll("indexedDB", window);
};
tests['hashchange'] = function() {
return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7);
};
tests['history'] = function() {
return !!(window.history && history.pushState);
};
tests['draganddrop'] = function() {
var div = document.createElement('div');
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
};
tests['websockets'] = function() {
return 'WebSocket' in window || 'MozWebSocket' in window;
};
tests['rgba'] = function() {
setCss('background-color:rgba(150,255,150,.5)');
return contains(mStyle.backgroundColor, 'rgba');
};
tests['hsla'] = function() {
setCss('background-color:hsla(120,40%,100%,.5)');
return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla');
};
tests['multiplebgs'] = function() {
setCss('background:url(https://),url(https://),red url(https://)');
return (/(url\s*\(.*?){3}/).test(mStyle.background);
}; tests['backgroundsize'] = function() {
return testPropsAll('backgroundSize');
};
tests['borderimage'] = function() {
return testPropsAll('borderImage');
};
tests['borderradius'] = function() {
return testPropsAll('borderRadius');
};
tests['boxshadow'] = function() {
return testPropsAll('boxShadow');
};
tests['textshadow'] = function() {
return document.createElement('div').style.textShadow === '';
};
tests['opacity'] = function() {
setCssAll('opacity:.55');
return (/^0.55$/).test(mStyle.opacity);
};
tests['cssanimations'] = function() {
return testPropsAll('animationName');
};
tests['csscolumns'] = function() {
return testPropsAll('columnCount');
};
tests['cssgradients'] = function() {
var str1 = 'background-image:',
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
str3 = 'linear-gradient(left top,#9f9, white);';
setCss(
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
prefixes.join(str3 + str1)).slice(0, -str1.length)
);
return contains(mStyle.backgroundImage, 'gradient');
};
tests['cssreflections'] = function() {
return testPropsAll('boxReflect');
};
tests['csstransforms'] = function() {
return !!testPropsAll('transform');
};
tests['csstransforms3d'] = function() {
var ret = !!testPropsAll('perspective');
if ( ret && 'webkitPerspective' in docElement.style ) {
injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) {
ret = node.offsetLeft === 9 && node.offsetHeight === 3;
});
}
return ret;
};
tests['csstransitions'] = function() {
return testPropsAll('transition');
};
tests['fontface'] = function() {
var bool;
injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) {
var style = document.getElementById('smodernizr'),
sheet = style.sheet || style.styleSheet,
cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : '';
bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0;
});
return bool;
};
tests['generatedcontent'] = function() {
var bool;
injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) {
bool = node.offsetHeight >= 3;
});
return bool;
};
tests['video'] = function() {
var elem = document.createElement('video'),
bool = false;
try {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,'');
bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,'');
bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,'');
}
} catch(e) { }
return bool;
};
tests['audio'] = function() {
var elem = document.createElement('audio'),
bool = false;
try {
if ( bool = !!elem.canPlayType ) {
bool = new Boolean(bool);
bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,'');
bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,'');
bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,'');
bool.m4a = ( elem.canPlayType('audio/x-m4a;') ||
elem.canPlayType('audio/aac;')) .replace(/^no$/,'');
}
} catch(e) { }
return bool;
};
tests['localstorage'] = function() {
try {
localStorage.setItem(mod, mod);
localStorage.removeItem(mod);
return true;
} catch(e) {
return false;
}
};
tests['sessionstorage'] = function() {
try {
sessionStorage.setItem(mod, mod);
sessionStorage.removeItem(mod);
return true;
} catch(e) {
return false;
}
};
tests['webworkers'] = function() {
return !!window.Worker;
};
tests['applicationcache'] = function() {
return !!window.applicationCache;
};
tests['svg'] = function() {
return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect;
};
tests['inlinesvg'] = function() {
var div = document.createElement('div');
div.innerHTML = '<svg/>';
return (div.firstChild && div.firstChild.namespaceURI) == ns.svg;
};
tests['smil'] = function() {
return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate')));
};
tests['svgclippaths'] = function() {
return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath')));
};
function webforms() {
Modernizr['input'] = (function( props ) {
for ( var i = 0, len = props.length; i < len; i++ ) {
attrs[ props[i] ] = !!(props[i] in inputElem);
}
if (attrs.list){
attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement);
}
return attrs;
})('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));
Modernizr['inputtypes'] = (function(props) {
for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) {
inputElem.setAttribute('type', inputElemType = props[i]);
bool = inputElem.type !== 'text';
if ( bool ) {
inputElem.value = smile;
inputElem.style.cssText = 'position:absolute;visibility:hidden;';
if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) {
docElement.appendChild(inputElem);
defaultView = document.defaultView;
bool = defaultView.getComputedStyle &&
defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' &&
(inputElem.offsetHeight !== 0);
docElement.removeChild(inputElem);
} else if ( /^(search|tel)$/.test(inputElemType) ){
} else if ( /^(url|email)$/.test(inputElemType) ) {
bool = inputElem.checkValidity && inputElem.checkValidity() === false;
} else {
bool = inputElem.value != smile;
}
}
inputs[ props[i] ] = !!bool;
}
return inputs;
})('search tel url email datetime date month week time datetime-local number range color'.split(' '));
}
for ( var feature in tests ) {
if ( hasOwnProp(tests, feature) ) {
featureName = feature.toLowerCase();
Modernizr[featureName] = tests[feature]();
classes.push((Modernizr[featureName] ? '' : 'no-') + featureName);
}
}
Modernizr.input || webforms();
Modernizr.addTest = function ( feature, test ) {
if ( typeof feature == 'object' ) {
for ( var key in feature ) {
if ( hasOwnProp( feature, key ) ) {
Modernizr.addTest( key, feature[ key ] );
}
}
} else {
feature = feature.toLowerCase();
if ( Modernizr[feature] !== undefined ) {
return Modernizr;
}
test = typeof test == 'function' ? test() : test;
if (typeof enableClasses !== "undefined" && enableClasses) {
docElement.className+=" modernizr-" + (test ? '' : 'no-') + feature;
}
Modernizr[feature] = test;
}
return Modernizr;
};
setCss('');
modElem = inputElem = null;
;(function(window, document) {
var version = '3.7.0';
var options = window.html5 || {};
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
var supportsHtml5Styles;
var expando = '_html5shiv';
var expanID = 0;
var expandoData = {};
var supportsUnknownElements;
(function() {
try {
var a = document.createElement('a');
a.innerHTML = '<xyz></xyz>';
supportsHtml5Styles = ('hidden' in a);
supportsUnknownElements = a.childNodes.length == 1 || (function() {
(document.createElement)('a');
var frag = document.createDocumentFragment();
return (
typeof frag.cloneNode == 'undefined' ||
typeof frag.createDocumentFragment == 'undefined' ||
typeof frag.createElement == 'undefined'
);
}());
} catch(e) {
supportsHtml5Styles = true;
supportsUnknownElements = true;
}
}());
function addStyleSheet(ownerDocument, cssText) {
var p = ownerDocument.createElement('p'),
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
p.innerHTML = 'x<style>' + cssText + '</style>';
return parent.insertBefore(p.lastChild, parent.firstChild);
}
function getElements() {
var elements = html5.elements;
return typeof elements == 'string' ? elements.split(' ') : elements;
}
function getExpandoData(ownerDocument) {
var data = expandoData[ownerDocument[expando]];
if (!data) {
data = {};
expanID++;
ownerDocument[expando] = expanID;
expandoData[expanID] = data;
}
return data;
}
function createElement(nodeName, ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createElement(nodeName);
}
if (!data) {
data = getExpandoData(ownerDocument);
}
var node;
if (data.cache[nodeName]) {
node = data.cache[nodeName].cloneNode();
} else if (saveClones.test(nodeName)) {
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
} else {
node = data.createElem(nodeName);
}
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
}
function createDocumentFragment(ownerDocument, data){
if (!ownerDocument) {
ownerDocument = document;
}
if(supportsUnknownElements){
return ownerDocument.createDocumentFragment();
}
data = data || getExpandoData(ownerDocument);
var clone = data.frag.cloneNode(),
i = 0,
elems = getElements(),
l = elems.length;
for(;i<l;i++){
clone.createElement(elems[i]);
}
return clone;
}
function shivMethods(ownerDocument, data) {
if (!data.cache) {
data.cache = {};
data.createElem = ownerDocument.createElement;
data.createFrag = ownerDocument.createDocumentFragment;
data.frag = data.createFrag();
}
ownerDocument.createElement = function(nodeName) {
if (!html5.shivMethods) {
return data.createElem(nodeName);
}
return createElement(nodeName, ownerDocument, data);
};
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
'var n=f.cloneNode(),c=n.createElement;' +
'h.shivMethods&&(' +
getElements().join().replace(/[\w\-]+/g, function(nodeName) {
data.createElem(nodeName);
data.frag.createElement(nodeName);
return 'c("' + nodeName + '")';
}) +
');return n}'
)(html5, data.frag);
}
function shivDocument(ownerDocument) {
if (!ownerDocument) {
ownerDocument = document;
}
var data = getExpandoData(ownerDocument);
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
data.hasCSS = !!addStyleSheet(ownerDocument,
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
'mark{background:#FF0;color:#000}' +
'template{display:none}'
);
}
if (!supportsUnknownElements) {
shivMethods(ownerDocument, data);
}
return ownerDocument;
}
var html5 = {
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video',
'version': version,
'shivCSS': (options.shivCSS !== false),
'supportsUnknownElements': supportsUnknownElements,
'shivMethods': (options.shivMethods !== false),
'type': 'default',
'shivDocument': shivDocument,
createElement: createElement,
createDocumentFragment: createDocumentFragment
};
window.html5 = html5;
shivDocument(document);
}(this, document));
Modernizr._version = version;
Modernizr._prefixes = prefixes;
Modernizr._domPrefixes = domPrefixes;
Modernizr._cssomPrefixes = cssomPrefixes;
Modernizr.hasEvent = isEventSupported;
Modernizr.testProp = function(prop){
return testProps([prop]);
};
Modernizr.testAllProps = testPropsAll;
Modernizr.testStyles = injectElementWithStyles; docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') +
(enableClasses ? " modernizr-js modernizr-"+classes.join(" modernizr-") : '');
return Modernizr;
})(this, this.document);
/*yepnope1.5.4|WTFPL*/
(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}})(this,document);
Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0));};
;

4
common/js/modernizr.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3
common/js/x.min.js vendored

File diff suppressed because one or more lines are too long

1
common/js/x.min.map Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

9
common/js/xe.min.js vendored

File diff suppressed because one or more lines are too long

1
common/js/xe.min.map Normal file

File diff suppressed because one or more lines are too long

View file

@ -237,17 +237,33 @@ function xml2json(xml, tab, ignoreAttrib) {
// 현 url과 ajax call 대상 url의 schema 또는 port가 다르면 직접 form 전송
if(_u1.protocol != _u2.protocol || _u1.port != _u2.port) return send_by_form(xml_path, params);
var xml = [], i = 0;
xml[i++] = '<?xml version="1.0" encoding="utf-8" ?>';
xml[i++] = '<methodCall>';
xml[i++] = '<params>';
var xml = [],
xmlHelper = function(params) {
var stack = [];
$.each(params, function(key, val) {
xml[i++] = '<'+key+'><![CDATA['+val+']]></'+key+'>';
});
if ($.isArray(params)) {
$.each(params, function(key, val) {
stack.push('<value type="array">' + xmlHelper(val) + '</value>');
});
}
else if ($.isPlainObject(params)) {
$.each(params, function(key, val) {
stack.push('<' + key + '>' + xmlHelper(val) + '</' + key + '>');
});
}
else if (!$.isFunction(params)) {
stack.push('<![CDATA[' + params + ']]>');
}
xml[i++] = '</params>';
xml[i++] = '</methodCall>';
return stack.join('\n');
};
xml.push('<?xml version="1.0" encoding="utf-8" ?>');
xml.push('<methodCall>');
xml.push('<params>');
xml.push(xmlHelper(params));
xml.push('</params>');
xml.push('</methodCall>');
var _xhr = null;
if (_xhr && _xhr.readyState !== 0) _xhr.abort();

View file

@ -3950,7 +3950,7 @@
<value xml:lang="en"><![CDATA[License agree]]></value>
</item>
<item name="license">
<value xml:lang="ko"><![CDATA[<p>Copyright (C) NAVER &lt;http://www.navercorp.com&gt;</p> <p>"XpressEngine (XE)"은 자유 소프트웨어이며, 오픈 소스 프로젝트로 개발되고 있습니다. 자세한 내용은 아래 링크를 참조하시기 바랍니다.</p> <ul> <li>공식 사이트: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>공식 저장소: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"XpressEngine (XE)"은 자유 소프트웨어입니다. 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 약소 일반 공중 사용 허가서 2.1판 또는 그 이후 판을 임의로 선택해서, 그 규정에 따라 소프트웨어를 개작하거나 재배포할 수 있습니다.</p> <p>이 소프트웨어는 유용하게 사용될 수 있으리라는 희망에서 배포되고 있지만, 특정한 목적에 맞는 적합성 여부나 판매용으로 사용할 수 있으리라는 묵시적인 보증을 포함한 어떠한 형태의 보증도 제공하지 않습니다. 보다 자세한 사항에 대해서는 GNU 약소 일반 공중 사용 허가서를 참고하시기 바랍니다.</p> <p>GNU 약소 일반 공중 사용 허가서는 이 라이브러리와 함께 제공됩니다. 만약, 이 문서가 누락되어 있다면 자유 소프트웨어 재단으로 문의하시기 바랍니다. (자유 소프트웨어 재단: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA)</p> <ul> <li>한국어 번역문 (비공식) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> <li>영문 (공식 원본) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
<value xml:lang="ko"><![CDATA[<p>Copyright (C) NAVER &lt;http://www.navercorp.com&gt;</p> <p>"XpressEngine (XE)"은 자유 소프트웨어이며, 오픈 소스 프로젝트로 개발되고 있습니다. 자세한 내용은 아래 링크를 참조하시기 바랍니다.</p> <ul> <li>공식 사이트: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>공식 저장소: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"XpressEngine (XE)"은 자유 소프트웨어입니다. 소프트웨어의 피양도자는 자유 소프트웨어 재단이 공표한 GNU 약소 일반 공중 사용 허가서 2.1판 또는 그 이후 판을 임의로 선택해서, 그 규정에 따라 소프트웨어를 개작하거나 재배포할 수 있습니다.</p> <p>이 소프트웨어는 유용하게 사용될 수 있으리라는 희망에서 배포되고 있지만, 특정한 목적에 맞는 적합성 여부나 판매용으로 사용할 수 있으리라는 묵시적인 보증을 포함한 어떠한 형태의 보증도 제공하지 않습니다. 보다 자세한 사항에 대해서는 GNU 약소 일반 공중 사용 허가서를 참고하시기 바랍니다.</p> <p>GNU 약소 일반 공중 사용 허가서는 이 라이브러리와 함께 제공됩니다. 만약, 이 문서가 누락되어 있다면 자유 소프트웨어 재단으로 문의하시기 바랍니다. (자유 소프트웨어 재단: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA)</p> <ul> <li>한국어 번역문 (비공식) : <a href="http://korea.gnu.org/people/chsong/copyleft/lgpl.ko.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> <li>영문 (공식 원본) : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
<value xml:lang="en"><![CDATA[<p>Copyright (C) NAVER &lt;http://www.navercorp.com&gt;</p> <p>"XpressEngine (XE)" is an opensource and being developed in the opensource project. For more information, please see the link below.</p> <ul> <li>Official website: <a href="http://www.xpressengine.com">http://www.xpressengine.com</a></li> <li>Official Repository: <a href="http://github.com/xpressengine">http://github.com/xpressengine</a></li> </ul> <p>"XpressEngine (XE)" is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.</p> <p>This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</p> <p>You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</p> <ul> <li>License : <a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html" target="_blank">GNU Lesser General Public License, version 2.1</a></li> </ul>]]></value>
</item>
<item name="cmd_license_agree">

View file

@ -29,7 +29,7 @@
<script src="{$js_file['file']}"></script>
<block cond="$js_file['targetie']"><![endif]--></block>
</block>
<!--[if lt IE 9]><script src="../js/html5.js"></script><![endif]-->
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="{$rss_url}" cond="$rss_url" />
<link rel="alternate" type="application/rss+xml" title="Site RSS" href="{$general_rss_url}" cond="$general_rss_url" />

View file

@ -23,7 +23,6 @@
<script src="{$js_file['file']}"></script>
<block cond="$js_file['targetie']"><![endif]--></block>
</block>
<!--[if lt IE 9]><script src="../js/html5.js"></script><![endif]-->
<!--// RSS -->
<!--@if($rss_url)-->

View file

@ -29,7 +29,7 @@ define('__ZBXE__', __XE__);
/**
* Display XE's full version.
*/
define('__XE_VERSION__', '1.7.8');
define('__XE_VERSION__', '1.7.9');
define('__XE_VERSION_ALPHA__', (stripos(__XE_VERSION__, 'alpha') !== false));
define('__XE_VERSION_BETA__', (stripos(__XE_VERSION__, 'beta') !== false));
define('__XE_VERSION_RC__', (stripos(__XE_VERSION__, 'rc') !== false));
@ -299,7 +299,6 @@ if(!defined('__XE_LOADED_CLASS__'))
require(_XE_PATH_ . 'classes/xml/XmlJsFilter.class.php');
require(_XE_PATH_ . 'classes/xml/XmlLangParser.class.php');
require(_XE_PATH_ . 'classes/cache/CacheHandler.class.php');
require(_XE_PATH_ . 'classes/router/Router.class.php');
require(_XE_PATH_ . 'classes/context/Context.class.php');
require(_XE_PATH_ . 'classes/db/DB.class.php');
require(_XE_PATH_ . 'classes/file/FileHandler.class.php');

View file

@ -1505,7 +1505,7 @@ function requirePear()
}
else
{
set_include_path(_XE_PATH_ . "libs/PEAR.1.9");
set_include_path(_XE_PATH_ . "libs/PEAR.1.9.5");
}
}

View file

@ -0,0 +1,55 @@
<?php
require_once 'HTTP/Request2.php';
class HTTP_Request extends HTTP_Request2
{
private $reponse = null;
public function addHeader($name, $value)
{
$this->setHeader($name, $value);
}
public function sendRequest($saveBody = true)
{
$response = $this->send();
$this->response = $response;
return $response;
}
public function getResponseCode() {
if($this->response)
{
return $this->response->getStatus();
}
}
public function getResponseHeader() {
if($this->response)
{
return $this->response->getHeader();
}
}
public function getResponseBody() {
if($this->response)
{
return $this->response->getBody();
}
}
public function getResponseCookies() {
if($this->response)
{
return $this->response->getCookies();
}
}
public function addPostData($name, $value, $preencoded = false)
{
$this->addPostParameter($name, $value);
}
}
?>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,137 @@
<?php
/**
* Base class for HTTP_Request2 adapters
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Class representing a HTTP response
*/
require_once 'HTTP/Request2/Response.php';
/**
* Base class for HTTP_Request2 adapters
*
* HTTP_Request2 class itself only defines methods for aggregating the request
* data, all actual work of sending the request to the remote server and
* receiving its response is performed by adapters.
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
abstract class HTTP_Request2_Adapter
{
/**
* A list of methods that MUST NOT have a request body, per RFC 2616
* @var array
*/
protected static $bodyDisallowed = array('TRACE');
/**
* Methods having defined semantics for request body
*
* Content-Length header (indicating that the body follows, section 4.3 of
* RFC 2616) will be sent for these methods even if no body was added
*
* @var array
* @link http://pear.php.net/bugs/bug.php?id=12900
* @link http://pear.php.net/bugs/bug.php?id=14740
*/
protected static $bodyRequired = array('POST', 'PUT');
/**
* Request being sent
* @var HTTP_Request2
*/
protected $request;
/**
* Request body
* @var string|resource|HTTP_Request2_MultipartBody
* @see HTTP_Request2::getBody()
*/
protected $requestBody;
/**
* Length of the request body
* @var integer
*/
protected $contentLength;
/**
* Sends request to the remote server and returns its response
*
* @param HTTP_Request2 $request HTTP request message
*
* @return HTTP_Request2_Response
* @throws HTTP_Request2_Exception
*/
abstract public function sendRequest(HTTP_Request2 $request);
/**
* Calculates length of the request body, adds proper headers
*
* @param array &$headers associative array of request headers, this method
* will add proper 'Content-Length' and 'Content-Type'
* headers to this array (or remove them if not needed)
*/
protected function calculateRequestLength(&$headers)
{
$this->requestBody = $this->request->getBody();
if (is_string($this->requestBody)) {
$this->contentLength = strlen($this->requestBody);
} elseif (is_resource($this->requestBody)) {
$stat = fstat($this->requestBody);
$this->contentLength = $stat['size'];
rewind($this->requestBody);
} else {
$this->contentLength = $this->requestBody->getLength();
$headers['content-type'] = 'multipart/form-data; boundary=' .
$this->requestBody->getBoundary();
$this->requestBody->rewind();
}
if (in_array($this->request->getMethod(), self::$bodyDisallowed)
|| 0 == $this->contentLength
) {
// No body: send a Content-Length header nonetheless (request #12900),
// but do that only for methods that require a body (bug #14740)
if (in_array($this->request->getMethod(), self::$bodyRequired)) {
$headers['content-length'] = 0;
} else {
unset($headers['content-length']);
// if the method doesn't require a body and doesn't have a
// body, don't send a Content-Type header. (request #16799)
unset($headers['content-type']);
}
} else {
if (empty($headers['content-type'])) {
$headers['content-type'] = 'application/x-www-form-urlencoded';
}
// Content-Length should not be sent for chunked Transfer-Encoding (bug #20125)
if (!isset($headers['transfer-encoding'])) {
$headers['content-length'] = $this->contentLength;
}
}
}
}
?>

View file

@ -0,0 +1,567 @@
<?php
/**
* Adapter for HTTP_Request2 wrapping around cURL extension
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Base class for HTTP_Request2 adapters
*/
require_once 'HTTP/Request2/Adapter.php';
/**
* Adapter for HTTP_Request2 wrapping around cURL extension
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_Adapter_Curl extends HTTP_Request2_Adapter
{
/**
* Mapping of header names to cURL options
* @var array
*/
protected static $headerMap = array(
'accept-encoding' => CURLOPT_ENCODING,
'cookie' => CURLOPT_COOKIE,
'referer' => CURLOPT_REFERER,
'user-agent' => CURLOPT_USERAGENT
);
/**
* Mapping of SSL context options to cURL options
* @var array
*/
protected static $sslContextMap = array(
'ssl_verify_peer' => CURLOPT_SSL_VERIFYPEER,
'ssl_cafile' => CURLOPT_CAINFO,
'ssl_capath' => CURLOPT_CAPATH,
'ssl_local_cert' => CURLOPT_SSLCERT,
'ssl_passphrase' => CURLOPT_SSLCERTPASSWD
);
/**
* Mapping of CURLE_* constants to Exception subclasses and error codes
* @var array
*/
protected static $errorMap = array(
CURLE_UNSUPPORTED_PROTOCOL => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
CURLE_COULDNT_RESOLVE_PROXY => array('HTTP_Request2_ConnectionException'),
CURLE_COULDNT_RESOLVE_HOST => array('HTTP_Request2_ConnectionException'),
CURLE_COULDNT_CONNECT => array('HTTP_Request2_ConnectionException'),
// error returned from write callback
CURLE_WRITE_ERROR => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
CURLE_OPERATION_TIMEOUTED => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::TIMEOUT),
CURLE_HTTP_RANGE_ERROR => array('HTTP_Request2_MessageException'),
CURLE_SSL_CONNECT_ERROR => array('HTTP_Request2_ConnectionException'),
CURLE_LIBRARY_NOT_FOUND => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::MISCONFIGURATION),
CURLE_FUNCTION_NOT_FOUND => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::MISCONFIGURATION),
CURLE_ABORTED_BY_CALLBACK => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::NON_HTTP_REDIRECT),
CURLE_TOO_MANY_REDIRECTS => array('HTTP_Request2_MessageException',
HTTP_Request2_Exception::TOO_MANY_REDIRECTS),
CURLE_SSL_PEER_CERTIFICATE => array('HTTP_Request2_ConnectionException'),
CURLE_GOT_NOTHING => array('HTTP_Request2_MessageException'),
CURLE_SSL_ENGINE_NOTFOUND => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::MISCONFIGURATION),
CURLE_SSL_ENGINE_SETFAILED => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::MISCONFIGURATION),
CURLE_SEND_ERROR => array('HTTP_Request2_MessageException'),
CURLE_RECV_ERROR => array('HTTP_Request2_MessageException'),
CURLE_SSL_CERTPROBLEM => array('HTTP_Request2_LogicException',
HTTP_Request2_Exception::INVALID_ARGUMENT),
CURLE_SSL_CIPHER => array('HTTP_Request2_ConnectionException'),
CURLE_SSL_CACERT => array('HTTP_Request2_ConnectionException'),
CURLE_BAD_CONTENT_ENCODING => array('HTTP_Request2_MessageException'),
);
/**
* Response being received
* @var HTTP_Request2_Response
*/
protected $response;
/**
* Whether 'sentHeaders' event was sent to observers
* @var boolean
*/
protected $eventSentHeaders = false;
/**
* Whether 'receivedHeaders' event was sent to observers
* @var boolean
*/
protected $eventReceivedHeaders = false;
/**
* Position within request body
* @var integer
* @see callbackReadBody()
*/
protected $position = 0;
/**
* Information about last transfer, as returned by curl_getinfo()
* @var array
*/
protected $lastInfo;
/**
* Creates a subclass of HTTP_Request2_Exception from curl error data
*
* @param resource $ch curl handle
*
* @return HTTP_Request2_Exception
*/
protected static function wrapCurlError($ch)
{
$nativeCode = curl_errno($ch);
$message = 'Curl error: ' . curl_error($ch);
if (!isset(self::$errorMap[$nativeCode])) {
return new HTTP_Request2_Exception($message, 0, $nativeCode);
} else {
$class = self::$errorMap[$nativeCode][0];
$code = empty(self::$errorMap[$nativeCode][1])
? 0 : self::$errorMap[$nativeCode][1];
return new $class($message, $code, $nativeCode);
}
}
/**
* Sends request to the remote server and returns its response
*
* @param HTTP_Request2 $request HTTP request message
*
* @return HTTP_Request2_Response
* @throws HTTP_Request2_Exception
*/
public function sendRequest(HTTP_Request2 $request)
{
if (!extension_loaded('curl')) {
throw new HTTP_Request2_LogicException(
'cURL extension not available', HTTP_Request2_Exception::MISCONFIGURATION
);
}
$this->request = $request;
$this->response = null;
$this->position = 0;
$this->eventSentHeaders = false;
$this->eventReceivedHeaders = false;
try {
if (false === curl_exec($ch = $this->createCurlHandle())) {
$e = self::wrapCurlError($ch);
}
} catch (Exception $e) {
}
if (isset($ch)) {
$this->lastInfo = curl_getinfo($ch);
curl_close($ch);
}
$response = $this->response;
unset($this->request, $this->requestBody, $this->response);
if (!empty($e)) {
throw $e;
}
if ($jar = $request->getCookieJar()) {
$jar->addCookiesFromResponse($response, $request->getUrl());
}
if (0 < $this->lastInfo['size_download']) {
$request->setLastEvent('receivedBody', $response);
}
return $response;
}
/**
* Returns information about last transfer
*
* @return array associative array as returned by curl_getinfo()
*/
public function getInfo()
{
return $this->lastInfo;
}
/**
* Creates a new cURL handle and populates it with data from the request
*
* @return resource a cURL handle, as created by curl_init()
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_NotImplementedException
*/
protected function createCurlHandle()
{
$ch = curl_init();
curl_setopt_array($ch, array(
// setup write callbacks
CURLOPT_HEADERFUNCTION => array($this, 'callbackWriteHeader'),
CURLOPT_WRITEFUNCTION => array($this, 'callbackWriteBody'),
// buffer size
CURLOPT_BUFFERSIZE => $this->request->getConfig('buffer_size'),
// connection timeout
CURLOPT_CONNECTTIMEOUT => $this->request->getConfig('connect_timeout'),
// save full outgoing headers, in case someone is interested
CURLINFO_HEADER_OUT => true,
// request url
CURLOPT_URL => $this->request->getUrl()->getUrl()
));
// set up redirects
if (!$this->request->getConfig('follow_redirects')) {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
} else {
if (!@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true)) {
throw new HTTP_Request2_LogicException(
'Redirect support in curl is unavailable due to open_basedir or safe_mode setting',
HTTP_Request2_Exception::MISCONFIGURATION
);
}
curl_setopt($ch, CURLOPT_MAXREDIRS, $this->request->getConfig('max_redirects'));
// limit redirects to http(s), works in 5.2.10+
if (defined('CURLOPT_REDIR_PROTOCOLS')) {
curl_setopt($ch, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
}
// works in 5.3.2+, http://bugs.php.net/bug.php?id=49571
if ($this->request->getConfig('strict_redirects') && defined('CURLOPT_POSTREDIR')) {
curl_setopt($ch, CURLOPT_POSTREDIR, 3);
}
}
// set local IP via CURLOPT_INTERFACE (request #19515)
if ($ip = $this->request->getConfig('local_ip')) {
curl_setopt($ch, CURLOPT_INTERFACE, $ip);
}
// request timeout
if ($timeout = $this->request->getConfig('timeout')) {
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
}
// set HTTP version
switch ($this->request->getConfig('protocol_version')) {
case '1.0':
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
break;
case '1.1':
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
}
// set request method
switch ($this->request->getMethod()) {
case HTTP_Request2::METHOD_GET:
curl_setopt($ch, CURLOPT_HTTPGET, true);
break;
case HTTP_Request2::METHOD_POST:
curl_setopt($ch, CURLOPT_POST, true);
break;
case HTTP_Request2::METHOD_HEAD:
curl_setopt($ch, CURLOPT_NOBODY, true);
break;
case HTTP_Request2::METHOD_PUT:
curl_setopt($ch, CURLOPT_UPLOAD, true);
break;
default:
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $this->request->getMethod());
}
// set proxy, if needed
if ($host = $this->request->getConfig('proxy_host')) {
if (!($port = $this->request->getConfig('proxy_port'))) {
throw new HTTP_Request2_LogicException(
'Proxy port not provided', HTTP_Request2_Exception::MISSING_VALUE
);
}
curl_setopt($ch, CURLOPT_PROXY, $host . ':' . $port);
if ($user = $this->request->getConfig('proxy_user')) {
curl_setopt(
$ch, CURLOPT_PROXYUSERPWD,
$user . ':' . $this->request->getConfig('proxy_password')
);
switch ($this->request->getConfig('proxy_auth_scheme')) {
case HTTP_Request2::AUTH_BASIC:
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
break;
case HTTP_Request2::AUTH_DIGEST:
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_DIGEST);
}
}
if ($type = $this->request->getConfig('proxy_type')) {
switch ($type) {
case 'http':
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
break;
case 'socks5':
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
break;
default:
throw new HTTP_Request2_NotImplementedException(
"Proxy type '{$type}' is not supported"
);
}
}
}
// set authentication data
if ($auth = $this->request->getAuth()) {
curl_setopt($ch, CURLOPT_USERPWD, $auth['user'] . ':' . $auth['password']);
switch ($auth['scheme']) {
case HTTP_Request2::AUTH_BASIC:
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
break;
case HTTP_Request2::AUTH_DIGEST:
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_DIGEST);
}
}
// set SSL options
foreach ($this->request->getConfig() as $name => $value) {
if ('ssl_verify_host' == $name && null !== $value) {
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $value? 2: 0);
} elseif (isset(self::$sslContextMap[$name]) && null !== $value) {
curl_setopt($ch, self::$sslContextMap[$name], $value);
}
}
$headers = $this->request->getHeaders();
// make cURL automagically send proper header
if (!isset($headers['accept-encoding'])) {
$headers['accept-encoding'] = '';
}
if (($jar = $this->request->getCookieJar())
&& ($cookies = $jar->getMatching($this->request->getUrl(), true))
) {
$headers['cookie'] = (empty($headers['cookie'])? '': $headers['cookie'] . '; ') . $cookies;
}
// set headers having special cURL keys
foreach (self::$headerMap as $name => $option) {
if (isset($headers[$name])) {
curl_setopt($ch, $option, $headers[$name]);
unset($headers[$name]);
}
}
$this->calculateRequestLength($headers);
if (isset($headers['content-length']) || isset($headers['transfer-encoding'])) {
$this->workaroundPhpBug47204($ch, $headers);
}
// set headers not having special keys
$headersFmt = array();
foreach ($headers as $name => $value) {
$canonicalName = implode('-', array_map('ucfirst', explode('-', $name)));
$headersFmt[] = $canonicalName . ': ' . $value;
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $headersFmt);
return $ch;
}
/**
* Workaround for PHP bug #47204 that prevents rewinding request body
*
* The workaround consists of reading the entire request body into memory
* and setting it as CURLOPT_POSTFIELDS, so it isn't recommended for large
* file uploads, use Socket adapter instead.
*
* @param resource $ch cURL handle
* @param array &$headers Request headers
*/
protected function workaroundPhpBug47204($ch, &$headers)
{
// no redirects, no digest auth -> probably no rewind needed
if (!$this->request->getConfig('follow_redirects')
&& (!($auth = $this->request->getAuth())
|| HTTP_Request2::AUTH_DIGEST != $auth['scheme'])
) {
curl_setopt($ch, CURLOPT_READFUNCTION, array($this, 'callbackReadBody'));
} else {
// rewind may be needed, read the whole body into memory
if ($this->requestBody instanceof HTTP_Request2_MultipartBody) {
$this->requestBody = $this->requestBody->__toString();
} elseif (is_resource($this->requestBody)) {
$fp = $this->requestBody;
$this->requestBody = '';
while (!feof($fp)) {
$this->requestBody .= fread($fp, 16384);
}
}
// curl hangs up if content-length is present
unset($headers['content-length']);
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->requestBody);
}
}
/**
* Callback function called by cURL for reading the request body
*
* @param resource $ch cURL handle
* @param resource $fd file descriptor (not used)
* @param integer $length maximum length of data to return
*
* @return string part of the request body, up to $length bytes
*/
protected function callbackReadBody($ch, $fd, $length)
{
if (!$this->eventSentHeaders) {
$this->request->setLastEvent(
'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT)
);
$this->eventSentHeaders = true;
}
if (in_array($this->request->getMethod(), self::$bodyDisallowed)
|| 0 == $this->contentLength || $this->position >= $this->contentLength
) {
return '';
}
if (is_string($this->requestBody)) {
$string = substr($this->requestBody, $this->position, $length);
} elseif (is_resource($this->requestBody)) {
$string = fread($this->requestBody, $length);
} else {
$string = $this->requestBody->read($length);
}
$this->request->setLastEvent('sentBodyPart', strlen($string));
$this->position += strlen($string);
return $string;
}
/**
* Callback function called by cURL for saving the response headers
*
* @param resource $ch cURL handle
* @param string $string response header (with trailing CRLF)
*
* @return integer number of bytes saved
* @see HTTP_Request2_Response::parseHeaderLine()
*/
protected function callbackWriteHeader($ch, $string)
{
// we may receive a second set of headers if doing e.g. digest auth
if ($this->eventReceivedHeaders || !$this->eventSentHeaders) {
// don't bother with 100-Continue responses (bug #15785)
if (!$this->eventSentHeaders
|| $this->response->getStatus() >= 200
) {
$this->request->setLastEvent(
'sentHeaders', curl_getinfo($ch, CURLINFO_HEADER_OUT)
);
}
$upload = curl_getinfo($ch, CURLINFO_SIZE_UPLOAD);
// if body wasn't read by a callback, send event with total body size
if ($upload > $this->position) {
$this->request->setLastEvent(
'sentBodyPart', $upload - $this->position
);
$this->position = $upload;
}
if ($upload && (!$this->eventSentHeaders
|| $this->response->getStatus() >= 200)
) {
$this->request->setLastEvent('sentBody', $upload);
}
$this->eventSentHeaders = true;
// we'll need a new response object
if ($this->eventReceivedHeaders) {
$this->eventReceivedHeaders = false;
$this->response = null;
}
}
if (empty($this->response)) {
$this->response = new HTTP_Request2_Response(
$string, false, curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)
);
} else {
$this->response->parseHeaderLine($string);
if ('' == trim($string)) {
// don't bother with 100-Continue responses (bug #15785)
if (200 <= $this->response->getStatus()) {
$this->request->setLastEvent('receivedHeaders', $this->response);
}
if ($this->request->getConfig('follow_redirects') && $this->response->isRedirect()) {
$redirectUrl = new Net_URL2($this->response->getHeader('location'));
// for versions lower than 5.2.10, check the redirection URL protocol
if (!defined('CURLOPT_REDIR_PROTOCOLS') && $redirectUrl->isAbsolute()
&& !in_array($redirectUrl->getScheme(), array('http', 'https'))
) {
return -1;
}
if ($jar = $this->request->getCookieJar()) {
$jar->addCookiesFromResponse($this->response, $this->request->getUrl());
if (!$redirectUrl->isAbsolute()) {
$redirectUrl = $this->request->getUrl()->resolve($redirectUrl);
}
if ($cookies = $jar->getMatching($redirectUrl, true)) {
curl_setopt($ch, CURLOPT_COOKIE, $cookies);
}
}
}
$this->eventReceivedHeaders = true;
}
}
return strlen($string);
}
/**
* Callback function called by cURL for saving the response body
*
* @param resource $ch cURL handle (not used)
* @param string $string part of the response body
*
* @return integer number of bytes saved
* @throws HTTP_Request2_MessageException
* @see HTTP_Request2_Response::appendBody()
*/
protected function callbackWriteBody($ch, $string)
{
// cURL calls WRITEFUNCTION callback without calling HEADERFUNCTION if
// response doesn't start with proper HTTP status line (see bug #15716)
if (empty($this->response)) {
throw new HTTP_Request2_MessageException(
"Malformed response: {$string}",
HTTP_Request2_Exception::MALFORMED_RESPONSE
);
}
if ($this->request->getConfig('store_body')) {
$this->response->appendBody($string);
}
$this->request->setLastEvent('receivedBodyPart', $string);
return strlen($string);
}
}
?>

View file

@ -0,0 +1,166 @@
<?php
/**
* Mock adapter intended for testing
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Base class for HTTP_Request2 adapters
*/
require_once 'HTTP/Request2/Adapter.php';
/**
* Mock adapter intended for testing
*
* Can be used to test applications depending on HTTP_Request2 package without
* actually performing any HTTP requests. This adapter will return responses
* previously added via addResponse()
* <code>
* $mock = new HTTP_Request2_Adapter_Mock();
* $mock->addResponse("HTTP/1.1 ... ");
*
* $request = new HTTP_Request2();
* $request->setAdapter($mock);
*
* // This will return the response set above
* $response = $req->send();
* </code>
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_Adapter_Mock extends HTTP_Request2_Adapter
{
/**
* A queue of responses to be returned by sendRequest()
* @var array
*/
protected $responses = array();
/**
* Returns the next response from the queue built by addResponse()
*
* Only responses without explicit URLs or with URLs equal to request URL
* will be considered. If matching response is not found or the queue is
* empty then default empty response with status 400 will be returned,
* if an Exception object was added to the queue it will be thrown.
*
* @param HTTP_Request2 $request HTTP request message
*
* @return HTTP_Request2_Response
* @throws Exception
*/
public function sendRequest(HTTP_Request2 $request)
{
$requestUrl = (string)$request->getUrl();
$response = null;
foreach ($this->responses as $k => $v) {
if (!$v[1] || $requestUrl == $v[1]) {
$response = $v[0];
array_splice($this->responses, $k, 1);
break;
}
}
if (!$response) {
return self::createResponseFromString("HTTP/1.1 400 Bad Request\r\n\r\n");
} elseif ($response instanceof HTTP_Request2_Response) {
return $response;
} else {
// rethrow the exception
$class = get_class($response);
$message = $response->getMessage();
$code = $response->getCode();
throw new $class($message, $code);
}
}
/**
* Adds response to the queue
*
* @param mixed $response either a string, a pointer to an open file,
* an instance of HTTP_Request2_Response or Exception
* @param string $url A request URL this response should be valid for
* (see {@link http://pear.php.net/bugs/bug.php?id=19276})
*
* @throws HTTP_Request2_Exception
*/
public function addResponse($response, $url = null)
{
if (is_string($response)) {
$response = self::createResponseFromString($response);
} elseif (is_resource($response)) {
$response = self::createResponseFromFile($response);
} elseif (!$response instanceof HTTP_Request2_Response &&
!$response instanceof Exception
) {
throw new HTTP_Request2_Exception('Parameter is not a valid response');
}
$this->responses[] = array($response, $url);
}
/**
* Creates a new HTTP_Request2_Response object from a string
*
* @param string $str string containing HTTP response message
*
* @return HTTP_Request2_Response
* @throws HTTP_Request2_Exception
*/
public static function createResponseFromString($str)
{
$parts = preg_split('!(\r?\n){2}!m', $str, 2);
$headerLines = explode("\n", $parts[0]);
$response = new HTTP_Request2_Response(array_shift($headerLines));
foreach ($headerLines as $headerLine) {
$response->parseHeaderLine($headerLine);
}
$response->parseHeaderLine('');
if (isset($parts[1])) {
$response->appendBody($parts[1]);
}
return $response;
}
/**
* Creates a new HTTP_Request2_Response object from a file
*
* @param resource $fp file pointer returned by fopen()
*
* @return HTTP_Request2_Response
* @throws HTTP_Request2_Exception
*/
public static function createResponseFromFile($fp)
{
$response = new HTTP_Request2_Response(fgets($fp));
do {
$headerLine = fgets($fp);
$response->parseHeaderLine($headerLine);
} while ('' != trim($headerLine));
while (!feof($fp)) {
$response->appendBody(fread($fp, 8192));
}
return $response;
}
}
?>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,494 @@
<?php
/**
* Stores cookies and passes them between HTTP requests
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/** Class representing a HTTP request message */
require_once 'HTTP/Request2.php';
/**
* Stores cookies and passes them between HTTP requests
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: @package_version@
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_CookieJar implements Serializable
{
/**
* Array of stored cookies
*
* The array is indexed by domain, path and cookie name
* .example.com
* /
* some_cookie => cookie data
* /subdir
* other_cookie => cookie data
* .example.org
* ...
*
* @var array
*/
protected $cookies = array();
/**
* Whether session cookies should be serialized when serializing the jar
* @var bool
*/
protected $serializeSession = false;
/**
* Whether Public Suffix List should be used for domain matching
* @var bool
*/
protected $useList = true;
/**
* Array with Public Suffix List data
* @var array
* @link http://publicsuffix.org/
*/
protected static $psl = array();
/**
* Class constructor, sets various options
*
* @param bool $serializeSessionCookies Controls serializing session cookies,
* see {@link serializeSessionCookies()}
* @param bool $usePublicSuffixList Controls using Public Suffix List,
* see {@link usePublicSuffixList()}
*/
public function __construct(
$serializeSessionCookies = false, $usePublicSuffixList = true
) {
$this->serializeSessionCookies($serializeSessionCookies);
$this->usePublicSuffixList($usePublicSuffixList);
}
/**
* Returns current time formatted in ISO-8601 at UTC timezone
*
* @return string
*/
protected function now()
{
$dt = new DateTime();
$dt->setTimezone(new DateTimeZone('UTC'));
return $dt->format(DateTime::ISO8601);
}
/**
* Checks cookie array for correctness, possibly updating its 'domain', 'path' and 'expires' fields
*
* The checks are as follows:
* - cookie array should contain 'name' and 'value' fields;
* - name and value should not contain disallowed symbols;
* - 'expires' should be either empty parseable by DateTime;
* - 'domain' and 'path' should be either not empty or an URL where
* cookie was set should be provided.
* - if $setter is provided, then document at that URL should be allowed
* to set a cookie for that 'domain'. If $setter is not provided,
* then no domain checks will be made.
*
* 'expires' field will be converted to ISO8601 format from COOKIE format,
* 'domain' and 'path' will be set from setter URL if empty.
*
* @param array $cookie cookie data, as returned by
* {@link HTTP_Request2_Response::getCookies()}
* @param Net_URL2 $setter URL of the document that sent Set-Cookie header
*
* @return array Updated cookie array
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_MessageException
*/
protected function checkAndUpdateFields(array $cookie, Net_URL2 $setter = null)
{
if ($missing = array_diff(array('name', 'value'), array_keys($cookie))) {
throw new HTTP_Request2_LogicException(
"Cookie array should contain 'name' and 'value' fields",
HTTP_Request2_Exception::MISSING_VALUE
);
}
if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie['name'])) {
throw new HTTP_Request2_LogicException(
"Invalid cookie name: '{$cookie['name']}'",
HTTP_Request2_Exception::INVALID_ARGUMENT
);
}
if (preg_match(HTTP_Request2::REGEXP_INVALID_COOKIE, $cookie['value'])) {
throw new HTTP_Request2_LogicException(
"Invalid cookie value: '{$cookie['value']}'",
HTTP_Request2_Exception::INVALID_ARGUMENT
);
}
$cookie += array('domain' => '', 'path' => '', 'expires' => null, 'secure' => false);
// Need ISO-8601 date @ UTC timezone
if (!empty($cookie['expires'])
&& !preg_match('/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+0000$/', $cookie['expires'])
) {
try {
$dt = new DateTime($cookie['expires']);
$dt->setTimezone(new DateTimeZone('UTC'));
$cookie['expires'] = $dt->format(DateTime::ISO8601);
} catch (Exception $e) {
throw new HTTP_Request2_LogicException($e->getMessage());
}
}
if (empty($cookie['domain']) || empty($cookie['path'])) {
if (!$setter) {
throw new HTTP_Request2_LogicException(
'Cookie misses domain and/or path component, cookie setter URL needed',
HTTP_Request2_Exception::MISSING_VALUE
);
}
if (empty($cookie['domain'])) {
if ($host = $setter->getHost()) {
$cookie['domain'] = $host;
} else {
throw new HTTP_Request2_LogicException(
'Setter URL does not contain host part, can\'t set cookie domain',
HTTP_Request2_Exception::MISSING_VALUE
);
}
}
if (empty($cookie['path'])) {
$path = $setter->getPath();
$cookie['path'] = empty($path)? '/': substr($path, 0, strrpos($path, '/') + 1);
}
}
if ($setter && !$this->domainMatch($setter->getHost(), $cookie['domain'])) {
throw new HTTP_Request2_MessageException(
"Domain " . $setter->getHost() . " cannot set cookies for "
. $cookie['domain']
);
}
return $cookie;
}
/**
* Stores a cookie in the jar
*
* @param array $cookie cookie data, as returned by
* {@link HTTP_Request2_Response::getCookies()}
* @param Net_URL2 $setter URL of the document that sent Set-Cookie header
*
* @throws HTTP_Request2_Exception
*/
public function store(array $cookie, Net_URL2 $setter = null)
{
$cookie = $this->checkAndUpdateFields($cookie, $setter);
if (strlen($cookie['value'])
&& (is_null($cookie['expires']) || $cookie['expires'] > $this->now())
) {
if (!isset($this->cookies[$cookie['domain']])) {
$this->cookies[$cookie['domain']] = array();
}
if (!isset($this->cookies[$cookie['domain']][$cookie['path']])) {
$this->cookies[$cookie['domain']][$cookie['path']] = array();
}
$this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']] = $cookie;
} elseif (isset($this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']])) {
unset($this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']]);
}
}
/**
* Adds cookies set in HTTP response to the jar
*
* @param HTTP_Request2_Response $response HTTP response message
* @param Net_URL2 $setter original request URL, needed for
* setting default domain/path
*/
public function addCookiesFromResponse(HTTP_Request2_Response $response, Net_URL2 $setter)
{
foreach ($response->getCookies() as $cookie) {
$this->store($cookie, $setter);
}
}
/**
* Returns all cookies matching a given request URL
*
* The following checks are made:
* - cookie domain should match request host
* - cookie path should be a prefix for request path
* - 'secure' cookies will only be sent for HTTPS requests
*
* @param Net_URL2 $url Request url
* @param bool $asString Whether to return cookies as string for "Cookie: " header
*
* @return array|string Matching cookies
*/
public function getMatching(Net_URL2 $url, $asString = false)
{
$host = $url->getHost();
$path = $url->getPath();
$secure = 0 == strcasecmp($url->getScheme(), 'https');
$matched = $ret = array();
foreach (array_keys($this->cookies) as $domain) {
if ($this->domainMatch($host, $domain)) {
foreach (array_keys($this->cookies[$domain]) as $cPath) {
if (0 === strpos($path, $cPath)) {
foreach ($this->cookies[$domain][$cPath] as $name => $cookie) {
if (!$cookie['secure'] || $secure) {
$matched[$name][strlen($cookie['path'])] = $cookie;
}
}
}
}
}
}
foreach ($matched as $cookies) {
krsort($cookies);
$ret = array_merge($ret, $cookies);
}
if (!$asString) {
return $ret;
} else {
$str = '';
foreach ($ret as $c) {
$str .= (empty($str)? '': '; ') . $c['name'] . '=' . $c['value'];
}
return $str;
}
}
/**
* Returns all cookies stored in a jar
*
* @return array
*/
public function getAll()
{
$cookies = array();
foreach (array_keys($this->cookies) as $domain) {
foreach (array_keys($this->cookies[$domain]) as $path) {
foreach ($this->cookies[$domain][$path] as $name => $cookie) {
$cookies[] = $cookie;
}
}
}
return $cookies;
}
/**
* Sets whether session cookies should be serialized when serializing the jar
*
* @param boolean $serialize serialize?
*/
public function serializeSessionCookies($serialize)
{
$this->serializeSession = (bool)$serialize;
}
/**
* Sets whether Public Suffix List should be used for restricting cookie-setting
*
* Without PSL {@link domainMatch()} will only prevent setting cookies for
* top-level domains like '.com' or '.org'. However, it will not prevent
* setting a cookie for '.co.uk' even though only third-level registrations
* are possible in .uk domain.
*
* With the List it is possible to find the highest level at which a domain
* may be registered for a particular top-level domain and consequently
* prevent cookies set for '.co.uk' or '.msk.ru'. The same list is used by
* Firefox, Chrome and Opera browsers to restrict cookie setting.
*
* Note that PSL is licensed differently to HTTP_Request2 package (refer to
* the license information in public-suffix-list.php), so you can disable
* its use if this is an issue for you.
*
* @param boolean $useList use the list?
*
* @link http://publicsuffix.org/learn/
*/
public function usePublicSuffixList($useList)
{
$this->useList = (bool)$useList;
}
/**
* Returns string representation of object
*
* @return string
*
* @see Serializable::serialize()
*/
public function serialize()
{
$cookies = $this->getAll();
if (!$this->serializeSession) {
for ($i = count($cookies) - 1; $i >= 0; $i--) {
if (empty($cookies[$i]['expires'])) {
unset($cookies[$i]);
}
}
}
return serialize(array(
'cookies' => $cookies,
'serializeSession' => $this->serializeSession,
'useList' => $this->useList
));
}
/**
* Constructs the object from serialized string
*
* @param string $serialized string representation
*
* @see Serializable::unserialize()
*/
public function unserialize($serialized)
{
$data = unserialize($serialized);
$now = $this->now();
$this->serializeSessionCookies($data['serializeSession']);
$this->usePublicSuffixList($data['useList']);
foreach ($data['cookies'] as $cookie) {
if (!empty($cookie['expires']) && $cookie['expires'] <= $now) {
continue;
}
if (!isset($this->cookies[$cookie['domain']])) {
$this->cookies[$cookie['domain']] = array();
}
if (!isset($this->cookies[$cookie['domain']][$cookie['path']])) {
$this->cookies[$cookie['domain']][$cookie['path']] = array();
}
$this->cookies[$cookie['domain']][$cookie['path']][$cookie['name']] = $cookie;
}
}
/**
* Checks whether a cookie domain matches a request host.
*
* The method is used by {@link store()} to check for whether a document
* at given URL can set a cookie with a given domain attribute and by
* {@link getMatching()} to find cookies matching the request URL.
*
* @param string $requestHost request host
* @param string $cookieDomain cookie domain
*
* @return bool match success
*/
public function domainMatch($requestHost, $cookieDomain)
{
if ($requestHost == $cookieDomain) {
return true;
}
// IP address, we require exact match
if (preg_match('/^(?:\d{1,3}\.){3}\d{1,3}$/', $requestHost)) {
return false;
}
if ('.' != $cookieDomain[0]) {
$cookieDomain = '.' . $cookieDomain;
}
// prevents setting cookies for '.com' and similar domains
if (!$this->useList && substr_count($cookieDomain, '.') < 2
|| $this->useList && !self::getRegisteredDomain($cookieDomain)
) {
return false;
}
return substr('.' . $requestHost, -strlen($cookieDomain)) == $cookieDomain;
}
/**
* Removes subdomains to get the registered domain (the first after top-level)
*
* The method will check Public Suffix List to find out where top-level
* domain ends and registered domain starts. It will remove domain parts
* to the left of registered one.
*
* @param string $domain domain name
*
* @return string|bool registered domain, will return false if $domain is
* either invalid or a TLD itself
*/
public static function getRegisteredDomain($domain)
{
$domainParts = explode('.', ltrim($domain, '.'));
// load the list if needed
if (empty(self::$psl)) {
$path = '@data_dir@' . DIRECTORY_SEPARATOR . 'HTTP_Request2';
if (0 === strpos($path, '@' . 'data_dir@')) {
$path = realpath(
dirname(__FILE__) . DIRECTORY_SEPARATOR . '..'
. DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'data'
);
}
self::$psl = include_once $path . DIRECTORY_SEPARATOR . 'public-suffix-list.php';
}
if (!($result = self::checkDomainsList($domainParts, self::$psl))) {
// known TLD, invalid domain name
return false;
}
// unknown TLD
if (!strpos($result, '.')) {
// fallback to checking that domain "has at least two dots"
if (2 > ($count = count($domainParts))) {
return false;
}
return $domainParts[$count - 2] . '.' . $domainParts[$count - 1];
}
return $result;
}
/**
* Recursive helper method for {@link getRegisteredDomain()}
*
* @param array $domainParts remaining domain parts
* @param mixed $listNode node in {@link HTTP_Request2_CookieJar::$psl} to check
*
* @return string|null concatenated domain parts, null in case of error
*/
protected static function checkDomainsList(array $domainParts, $listNode)
{
$sub = array_pop($domainParts);
$result = null;
if (!is_array($listNode) || is_null($sub)
|| array_key_exists('!' . $sub, $listNode)
) {
return $sub;
} elseif (array_key_exists($sub, $listNode)) {
$result = self::checkDomainsList($domainParts, $listNode[$sub]);
} elseif (array_key_exists('*', $listNode)) {
$result = self::checkDomainsList($domainParts, $listNode['*']);
} else {
return $sub;
}
return (strlen($result) > 0) ? ($result . '.' . $sub) : null;
}
}
?>

View file

@ -0,0 +1,160 @@
<?php
/**
* Exception classes for HTTP_Request2 package
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Base class for exceptions in PEAR
*/
require_once 'PEAR/Exception.php';
/**
* Base exception class for HTTP_Request2 package
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://pear.php.net/pepr/pepr-proposal-show.php?id=132
*/
class HTTP_Request2_Exception extends PEAR_Exception
{
/** An invalid argument was passed to a method */
const INVALID_ARGUMENT = 1;
/** Some required value was not available */
const MISSING_VALUE = 2;
/** Request cannot be processed due to errors in PHP configuration */
const MISCONFIGURATION = 3;
/** Error reading the local file */
const READ_ERROR = 4;
/** Server returned a response that does not conform to HTTP protocol */
const MALFORMED_RESPONSE = 10;
/** Failure decoding Content-Encoding or Transfer-Encoding of response */
const DECODE_ERROR = 20;
/** Operation timed out */
const TIMEOUT = 30;
/** Number of redirects exceeded 'max_redirects' configuration parameter */
const TOO_MANY_REDIRECTS = 40;
/** Redirect to a protocol other than http(s):// */
const NON_HTTP_REDIRECT = 50;
/**
* Native error code
* @var int
*/
private $_nativeCode;
/**
* Constructor, can set package error code and native error code
*
* @param string $message exception message
* @param int $code package error code, one of class constants
* @param int $nativeCode error code from underlying PHP extension
*/
public function __construct($message = null, $code = null, $nativeCode = null)
{
parent::__construct($message, $code);
$this->_nativeCode = $nativeCode;
}
/**
* Returns error code produced by underlying PHP extension
*
* For Socket Adapter this may contain error number returned by
* stream_socket_client(), for Curl Adapter this will contain error number
* returned by curl_errno()
*
* @return integer
*/
public function getNativeCode()
{
return $this->_nativeCode;
}
}
/**
* Exception thrown in case of missing features
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_NotImplementedException extends HTTP_Request2_Exception
{
}
/**
* Exception that represents error in the program logic
*
* This exception usually implies a programmer's error, like passing invalid
* data to methods or trying to use PHP extensions that weren't installed or
* enabled. Usually exceptions of this kind will be thrown before request even
* starts.
*
* The exception will usually contain a package error code.
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_LogicException extends HTTP_Request2_Exception
{
}
/**
* Exception thrown when connection to a web or proxy server fails
*
* The exception will not contain a package error code, but will contain
* native error code, as returned by stream_socket_client() or curl_errno().
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_ConnectionException extends HTTP_Request2_Exception
{
}
/**
* Exception thrown when sending or receiving HTTP message fails
*
* The exception may contain both package error code and native error code.
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_MessageException extends HTTP_Request2_Exception
{
}
?>

View file

@ -0,0 +1,268 @@
<?php
/**
* Helper class for building multipart/form-data request body
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/** Exception class for HTTP_Request2 package */
require_once 'HTTP/Request2/Exception.php';
/**
* Class for building multipart/form-data request body
*
* The class helps to reduce memory consumption by streaming large file uploads
* from disk, it also allows monitoring of upload progress (see request #7630)
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://tools.ietf.org/html/rfc1867
*/
class HTTP_Request2_MultipartBody
{
/**
* MIME boundary
* @var string
*/
private $_boundary;
/**
* Form parameters added via {@link HTTP_Request2::addPostParameter()}
* @var array
*/
private $_params = array();
/**
* File uploads added via {@link HTTP_Request2::addUpload()}
* @var array
*/
private $_uploads = array();
/**
* Header for parts with parameters
* @var string
*/
private $_headerParam = "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n";
/**
* Header for parts with uploads
* @var string
*/
private $_headerUpload = "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n";
/**
* Current position in parameter and upload arrays
*
* First number is index of "current" part, second number is position within
* "current" part
*
* @var array
*/
private $_pos = array(0, 0);
/**
* Constructor. Sets the arrays with POST data.
*
* @param array $params values of form fields set via
* {@link HTTP_Request2::addPostParameter()}
* @param array $uploads file uploads set via
* {@link HTTP_Request2::addUpload()}
* @param bool $useBrackets whether to append brackets to array variable names
*/
public function __construct(array $params, array $uploads, $useBrackets = true)
{
$this->_params = self::_flattenArray('', $params, $useBrackets);
foreach ($uploads as $fieldName => $f) {
if (!is_array($f['fp'])) {
$this->_uploads[] = $f + array('name' => $fieldName);
} else {
for ($i = 0; $i < count($f['fp']); $i++) {
$upload = array(
'name' => ($useBrackets? $fieldName . '[' . $i . ']': $fieldName)
);
foreach (array('fp', 'filename', 'size', 'type') as $key) {
$upload[$key] = $f[$key][$i];
}
$this->_uploads[] = $upload;
}
}
}
}
/**
* Returns the length of the body to use in Content-Length header
*
* @return integer
*/
public function getLength()
{
$boundaryLength = strlen($this->getBoundary());
$headerParamLength = strlen($this->_headerParam) - 4 + $boundaryLength;
$headerUploadLength = strlen($this->_headerUpload) - 8 + $boundaryLength;
$length = $boundaryLength + 6;
foreach ($this->_params as $p) {
$length += $headerParamLength + strlen($p[0]) + strlen($p[1]) + 2;
}
foreach ($this->_uploads as $u) {
$length += $headerUploadLength + strlen($u['name']) + strlen($u['type']) +
strlen($u['filename']) + $u['size'] + 2;
}
return $length;
}
/**
* Returns the boundary to use in Content-Type header
*
* @return string
*/
public function getBoundary()
{
if (empty($this->_boundary)) {
$this->_boundary = '--' . md5('PEAR-HTTP_Request2-' . microtime());
}
return $this->_boundary;
}
/**
* Returns next chunk of request body
*
* @param integer $length Number of bytes to read
*
* @return string Up to $length bytes of data, empty string if at end
* @throws HTTP_Request2_LogicException
*/
public function read($length)
{
$ret = '';
$boundary = $this->getBoundary();
$paramCount = count($this->_params);
$uploadCount = count($this->_uploads);
while ($length > 0 && $this->_pos[0] <= $paramCount + $uploadCount) {
$oldLength = $length;
if ($this->_pos[0] < $paramCount) {
$param = sprintf(
$this->_headerParam, $boundary, $this->_params[$this->_pos[0]][0]
) . $this->_params[$this->_pos[0]][1] . "\r\n";
$ret .= substr($param, $this->_pos[1], $length);
$length -= min(strlen($param) - $this->_pos[1], $length);
} elseif ($this->_pos[0] < $paramCount + $uploadCount) {
$pos = $this->_pos[0] - $paramCount;
$header = sprintf(
$this->_headerUpload, $boundary, $this->_uploads[$pos]['name'],
$this->_uploads[$pos]['filename'], $this->_uploads[$pos]['type']
);
if ($this->_pos[1] < strlen($header)) {
$ret .= substr($header, $this->_pos[1], $length);
$length -= min(strlen($header) - $this->_pos[1], $length);
}
$filePos = max(0, $this->_pos[1] - strlen($header));
if ($filePos < $this->_uploads[$pos]['size']) {
while ($length > 0 && !feof($this->_uploads[$pos]['fp'])) {
if (false === ($chunk = fread($this->_uploads[$pos]['fp'], $length))) {
throw new HTTP_Request2_LogicException(
'Failed reading file upload', HTTP_Request2_Exception::READ_ERROR
);
}
$ret .= $chunk;
$length -= strlen($chunk);
}
}
if ($length > 0) {
$start = $this->_pos[1] + ($oldLength - $length) -
strlen($header) - $this->_uploads[$pos]['size'];
$ret .= substr("\r\n", $start, $length);
$length -= min(2 - $start, $length);
}
} else {
$closing = '--' . $boundary . "--\r\n";
$ret .= substr($closing, $this->_pos[1], $length);
$length -= min(strlen($closing) - $this->_pos[1], $length);
}
if ($length > 0) {
$this->_pos = array($this->_pos[0] + 1, 0);
} else {
$this->_pos[1] += $oldLength;
}
}
return $ret;
}
/**
* Sets the current position to the start of the body
*
* This allows reusing the same body in another request
*/
public function rewind()
{
$this->_pos = array(0, 0);
foreach ($this->_uploads as $u) {
rewind($u['fp']);
}
}
/**
* Returns the body as string
*
* Note that it reads all file uploads into memory so it is a good idea not
* to use this method with large file uploads and rely on read() instead.
*
* @return string
*/
public function __toString()
{
$this->rewind();
return $this->read($this->getLength());
}
/**
* Helper function to change the (probably multidimensional) associative array
* into the simple one.
*
* @param string $name name for item
* @param mixed $values item's values
* @param bool $useBrackets whether to append [] to array variables' names
*
* @return array array with the following items: array('item name', 'item value');
*/
private static function _flattenArray($name, $values, $useBrackets)
{
if (!is_array($values)) {
return array(array($name, $values));
} else {
$ret = array();
foreach ($values as $k => $v) {
if (empty($name)) {
$newName = $k;
} elseif ($useBrackets) {
$newName = $name . '[' . $k . ']';
} else {
$newName = $name;
}
$ret = array_merge($ret, self::_flattenArray($newName, $v, $useBrackets));
}
return $ret;
}
}
}
?>

View file

@ -0,0 +1,192 @@
<?php
/**
* An observer useful for debugging / testing.
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author David Jean Louis <izi@php.net>
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Exception class for HTTP_Request2 package
*/
require_once 'HTTP/Request2/Exception.php';
/**
* A debug observer useful for debugging / testing.
*
* This observer logs to a log target data corresponding to the various request
* and response events, it logs by default to php://output but can be configured
* to log to a file or via the PEAR Log package.
*
* A simple example:
* <code>
* require_once 'HTTP/Request2.php';
* require_once 'HTTP/Request2/Observer/Log.php';
*
* $request = new HTTP_Request2('http://www.example.com');
* $observer = new HTTP_Request2_Observer_Log();
* $request->attach($observer);
* $request->send();
* </code>
*
* A more complex example with PEAR Log:
* <code>
* require_once 'HTTP/Request2.php';
* require_once 'HTTP/Request2/Observer/Log.php';
* require_once 'Log.php';
*
* $request = new HTTP_Request2('http://www.example.com');
* // we want to log with PEAR log
* $observer = new HTTP_Request2_Observer_Log(Log::factory('console'));
*
* // we only want to log received headers
* $observer->events = array('receivedHeaders');
*
* $request->attach($observer);
* $request->send();
* </code>
*
* @category HTTP
* @package HTTP_Request2
* @author David Jean Louis <izi@php.net>
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
*/
class HTTP_Request2_Observer_Log implements SplObserver
{
// properties {{{
/**
* The log target, it can be a a resource or a PEAR Log instance.
*
* @var resource|Log $target
*/
protected $target = null;
/**
* The events to log.
*
* @var array $events
*/
public $events = array(
'connect',
'sentHeaders',
'sentBody',
'receivedHeaders',
'receivedBody',
'disconnect',
);
// }}}
// __construct() {{{
/**
* Constructor.
*
* @param mixed $target Can be a file path (default: php://output), a resource,
* or an instance of the PEAR Log class.
* @param array $events Array of events to listen to (default: all events)
*
* @return void
*/
public function __construct($target = 'php://output', array $events = array())
{
if (!empty($events)) {
$this->events = $events;
}
if (is_resource($target) || $target instanceof Log) {
$this->target = $target;
} elseif (false === ($this->target = @fopen($target, 'ab'))) {
throw new HTTP_Request2_Exception("Unable to open '{$target}'");
}
}
// }}}
// update() {{{
/**
* Called when the request notifies us of an event.
*
* @param HTTP_Request2 $subject The HTTP_Request2 instance
*
* @return void
*/
public function update(SplSubject $subject)
{
$event = $subject->getLastEvent();
if (!in_array($event['name'], $this->events)) {
return;
}
switch ($event['name']) {
case 'connect':
$this->log('* Connected to ' . $event['data']);
break;
case 'sentHeaders':
$headers = explode("\r\n", $event['data']);
array_pop($headers);
foreach ($headers as $header) {
$this->log('> ' . $header);
}
break;
case 'sentBody':
$this->log('> ' . $event['data'] . ' byte(s) sent');
break;
case 'receivedHeaders':
$this->log(sprintf(
'< HTTP/%s %s %s', $event['data']->getVersion(),
$event['data']->getStatus(), $event['data']->getReasonPhrase()
));
$headers = $event['data']->getHeader();
foreach ($headers as $key => $val) {
$this->log('< ' . $key . ': ' . $val);
}
$this->log('< ');
break;
case 'receivedBody':
$this->log($event['data']->getBody());
break;
case 'disconnect':
$this->log('* Disconnected');
break;
}
}
// }}}
// log() {{{
/**
* Logs the given message to the configured target.
*
* @param string $message Message to display
*
* @return void
*/
protected function log($message)
{
if ($this->target instanceof Log) {
$this->target->debug($message);
} elseif (is_resource($this->target)) {
fwrite($this->target, $message . "\r\n");
}
}
// }}}
}
?>

View file

@ -0,0 +1,631 @@
<?php
/**
* Class representing a HTTP response
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/**
* Exception class for HTTP_Request2 package
*/
require_once 'HTTP/Request2/Exception.php';
/**
* Class representing a HTTP response
*
* The class is designed to be used in "streaming" scenario, building the
* response as it is being received:
* <code>
* $statusLine = read_status_line();
* $response = new HTTP_Request2_Response($statusLine);
* do {
* $headerLine = read_header_line();
* $response->parseHeaderLine($headerLine);
* } while ($headerLine != '');
*
* while ($chunk = read_body()) {
* $response->appendBody($chunk);
* }
*
* var_dump($response->getHeader(), $response->getCookies(), $response->getBody());
* </code>
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://tools.ietf.org/html/rfc2616#section-6
*/
class HTTP_Request2_Response
{
/**
* HTTP protocol version (e.g. 1.0, 1.1)
* @var string
*/
protected $version;
/**
* Status code
* @var integer
* @link http://tools.ietf.org/html/rfc2616#section-6.1.1
*/
protected $code;
/**
* Reason phrase
* @var string
* @link http://tools.ietf.org/html/rfc2616#section-6.1.1
*/
protected $reasonPhrase;
/**
* Effective URL (may be different from original request URL in case of redirects)
* @var string
*/
protected $effectiveUrl;
/**
* Associative array of response headers
* @var array
*/
protected $headers = array();
/**
* Cookies set in the response
* @var array
*/
protected $cookies = array();
/**
* Name of last header processed by parseHederLine()
*
* Used to handle the headers that span multiple lines
*
* @var string
*/
protected $lastHeader = null;
/**
* Response body
* @var string
*/
protected $body = '';
/**
* Whether the body is still encoded by Content-Encoding
*
* cURL provides the decoded body to the callback; if we are reading from
* socket the body is still gzipped / deflated
*
* @var bool
*/
protected $bodyEncoded;
/**
* Associative array of HTTP status code / reason phrase.
*
* @var array
* @link http://tools.ietf.org/html/rfc2616#section-10
*/
protected static $phrases = array(
// 1xx: Informational - Request received, continuing process
100 => 'Continue',
101 => 'Switching Protocols',
// 2xx: Success - The action was successfully received, understood and
// accepted
200 => 'OK',
201 => 'Created',
202 => 'Accepted',
203 => 'Non-Authoritative Information',
204 => 'No Content',
205 => 'Reset Content',
206 => 'Partial Content',
// 3xx: Redirection - Further action must be taken in order to complete
// the request
300 => 'Multiple Choices',
301 => 'Moved Permanently',
302 => 'Found', // 1.1
303 => 'See Other',
304 => 'Not Modified',
305 => 'Use Proxy',
307 => 'Temporary Redirect',
// 4xx: Client Error - The request contains bad syntax or cannot be
// fulfilled
400 => 'Bad Request',
401 => 'Unauthorized',
402 => 'Payment Required',
403 => 'Forbidden',
404 => 'Not Found',
405 => 'Method Not Allowed',
406 => 'Not Acceptable',
407 => 'Proxy Authentication Required',
408 => 'Request Timeout',
409 => 'Conflict',
410 => 'Gone',
411 => 'Length Required',
412 => 'Precondition Failed',
413 => 'Request Entity Too Large',
414 => 'Request-URI Too Long',
415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
// 5xx: Server Error - The server failed to fulfill an apparently
// valid request
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway',
503 => 'Service Unavailable',
504 => 'Gateway Timeout',
505 => 'HTTP Version Not Supported',
509 => 'Bandwidth Limit Exceeded',
);
/**
* Returns the default reason phrase for the given code or all reason phrases
*
* @param int $code Response code
*
* @return string|array|null Default reason phrase for $code if $code is given
* (null if no phrase is available), array of all
* reason phrases if $code is null
* @link http://pear.php.net/bugs/18716
*/
public static function getDefaultReasonPhrase($code = null)
{
if (null === $code) {
return self::$phrases;
} else {
return isset(self::$phrases[$code]) ? self::$phrases[$code] : null;
}
}
/**
* Constructor, parses the response status line
*
* @param string $statusLine Response status line (e.g. "HTTP/1.1 200 OK")
* @param bool $bodyEncoded Whether body is still encoded by Content-Encoding
* @param string $effectiveUrl Effective URL of the response
*
* @throws HTTP_Request2_MessageException if status line is invalid according to spec
*/
public function __construct($statusLine, $bodyEncoded = true, $effectiveUrl = null)
{
if (!preg_match('!^HTTP/(\d\.\d) (\d{3})(?: (.+))?!', $statusLine, $m)) {
throw new HTTP_Request2_MessageException(
"Malformed response: {$statusLine}",
HTTP_Request2_Exception::MALFORMED_RESPONSE
);
}
$this->version = $m[1];
$this->code = intval($m[2]);
$this->reasonPhrase = !empty($m[3]) ? trim($m[3]) : self::getDefaultReasonPhrase($this->code);
$this->bodyEncoded = (bool)$bodyEncoded;
$this->effectiveUrl = (string)$effectiveUrl;
}
/**
* Parses the line from HTTP response filling $headers array
*
* The method should be called after reading the line from socket or receiving
* it into cURL callback. Passing an empty string here indicates the end of
* response headers and triggers additional processing, so be sure to pass an
* empty string in the end.
*
* @param string $headerLine Line from HTTP response
*/
public function parseHeaderLine($headerLine)
{
$headerLine = trim($headerLine, "\r\n");
if ('' == $headerLine) {
// empty string signals the end of headers, process the received ones
if (!empty($this->headers['set-cookie'])) {
$cookies = is_array($this->headers['set-cookie'])?
$this->headers['set-cookie']:
array($this->headers['set-cookie']);
foreach ($cookies as $cookieString) {
$this->parseCookie($cookieString);
}
unset($this->headers['set-cookie']);
}
foreach (array_keys($this->headers) as $k) {
if (is_array($this->headers[$k])) {
$this->headers[$k] = implode(', ', $this->headers[$k]);
}
}
} elseif (preg_match('!^([^\x00-\x1f\x7f-\xff()<>@,;:\\\\"/\[\]?={}\s]+):(.+)$!', $headerLine, $m)) {
// string of the form header-name: header value
$name = strtolower($m[1]);
$value = trim($m[2]);
if (empty($this->headers[$name])) {
$this->headers[$name] = $value;
} else {
if (!is_array($this->headers[$name])) {
$this->headers[$name] = array($this->headers[$name]);
}
$this->headers[$name][] = $value;
}
$this->lastHeader = $name;
} elseif (preg_match('!^\s+(.+)$!', $headerLine, $m) && $this->lastHeader) {
// continuation of a previous header
if (!is_array($this->headers[$this->lastHeader])) {
$this->headers[$this->lastHeader] .= ' ' . trim($m[1]);
} else {
$key = count($this->headers[$this->lastHeader]) - 1;
$this->headers[$this->lastHeader][$key] .= ' ' . trim($m[1]);
}
}
}
/**
* Parses a Set-Cookie header to fill $cookies array
*
* @param string $cookieString value of Set-Cookie header
*
* @link http://web.archive.org/web/20080331104521/http://cgi.netscape.com/newsref/std/cookie_spec.html
*/
protected function parseCookie($cookieString)
{
$cookie = array(
'expires' => null,
'domain' => null,
'path' => null,
'secure' => false
);
if (!strpos($cookieString, ';')) {
// Only a name=value pair
$pos = strpos($cookieString, '=');
$cookie['name'] = trim(substr($cookieString, 0, $pos));
$cookie['value'] = trim(substr($cookieString, $pos + 1));
} else {
// Some optional parameters are supplied
$elements = explode(';', $cookieString);
$pos = strpos($elements[0], '=');
$cookie['name'] = trim(substr($elements[0], 0, $pos));
$cookie['value'] = trim(substr($elements[0], $pos + 1));
for ($i = 1; $i < count($elements); $i++) {
if (false === strpos($elements[$i], '=')) {
$elName = trim($elements[$i]);
$elValue = null;
} else {
list ($elName, $elValue) = array_map('trim', explode('=', $elements[$i]));
}
$elName = strtolower($elName);
if ('secure' == $elName) {
$cookie['secure'] = true;
} elseif ('expires' == $elName) {
$cookie['expires'] = str_replace('"', '', $elValue);
} elseif ('path' == $elName || 'domain' == $elName) {
$cookie[$elName] = urldecode($elValue);
} else {
$cookie[$elName] = $elValue;
}
}
}
$this->cookies[] = $cookie;
}
/**
* Appends a string to the response body
*
* @param string $bodyChunk part of response body
*/
public function appendBody($bodyChunk)
{
$this->body .= $bodyChunk;
}
/**
* Returns the effective URL of the response
*
* This may be different from the request URL if redirects were followed.
*
* @return string
* @link http://pear.php.net/bugs/bug.php?id=18412
*/
public function getEffectiveUrl()
{
return $this->effectiveUrl;
}
/**
* Returns the status code
*
* @return integer
*/
public function getStatus()
{
return $this->code;
}
/**
* Returns the reason phrase
*
* @return string
*/
public function getReasonPhrase()
{
return $this->reasonPhrase;
}
/**
* Whether response is a redirect that can be automatically handled by HTTP_Request2
*
* @return bool
*/
public function isRedirect()
{
return in_array($this->code, array(300, 301, 302, 303, 307))
&& isset($this->headers['location']);
}
/**
* Returns either the named header or all response headers
*
* @param string $headerName Name of header to return
*
* @return string|array Value of $headerName header (null if header is
* not present), array of all response headers if
* $headerName is null
*/
public function getHeader($headerName = null)
{
if (null === $headerName) {
return $this->headers;
} else {
$headerName = strtolower($headerName);
return isset($this->headers[$headerName])? $this->headers[$headerName]: null;
}
}
/**
* Returns cookies set in response
*
* @return array
*/
public function getCookies()
{
return $this->cookies;
}
/**
* Returns the body of the response
*
* @return string
* @throws HTTP_Request2_Exception if body cannot be decoded
*/
public function getBody()
{
if (0 == strlen($this->body) || !$this->bodyEncoded
|| !in_array(strtolower($this->getHeader('content-encoding')), array('gzip', 'deflate'))
) {
return $this->body;
} else {
if (extension_loaded('mbstring') && (2 & ini_get('mbstring.func_overload'))) {
$oldEncoding = mb_internal_encoding();
mb_internal_encoding('8bit');
}
try {
switch (strtolower($this->getHeader('content-encoding'))) {
case 'gzip':
$decoded = self::decodeGzip($this->body);
break;
case 'deflate':
$decoded = self::decodeDeflate($this->body);
}
} catch (Exception $e) {
}
if (!empty($oldEncoding)) {
mb_internal_encoding($oldEncoding);
}
if (!empty($e)) {
throw $e;
}
return $decoded;
}
}
/**
* Get the HTTP version of the response
*
* @return string
*/
public function getVersion()
{
return $this->version;
}
/**
* Decodes the message-body encoded by gzip
*
* The real decoding work is done by gzinflate() built-in function, this
* method only parses the header and checks data for compliance with
* RFC 1952
*
* @param string $data gzip-encoded data
*
* @return string decoded data
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_MessageException
* @link http://tools.ietf.org/html/rfc1952
*/
public static function decodeGzip($data)
{
$length = strlen($data);
// If it doesn't look like gzip-encoded data, don't bother
if (18 > $length || strcmp(substr($data, 0, 2), "\x1f\x8b")) {
return $data;
}
if (!function_exists('gzinflate')) {
throw new HTTP_Request2_LogicException(
'Unable to decode body: gzip extension not available',
HTTP_Request2_Exception::MISCONFIGURATION
);
}
$method = ord(substr($data, 2, 1));
if (8 != $method) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: unknown compression method',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$flags = ord(substr($data, 3, 1));
if ($flags & 224) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: reserved bits are set',
HTTP_Request2_Exception::DECODE_ERROR
);
}
// header is 10 bytes minimum. may be longer, though.
$headerLength = 10;
// extra fields, need to skip 'em
if ($flags & 4) {
if ($length - $headerLength - 2 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$extraLength = unpack('v', substr($data, 10, 2));
if ($length - $headerLength - 2 - $extraLength[1] < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$headerLength += $extraLength[1] + 2;
}
// file name, need to skip that
if ($flags & 8) {
if ($length - $headerLength - 1 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$filenameLength = strpos(substr($data, $headerLength), chr(0));
if (false === $filenameLength || $length - $headerLength - $filenameLength - 1 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$headerLength += $filenameLength + 1;
}
// comment, need to skip that also
if ($flags & 16) {
if ($length - $headerLength - 1 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$commentLength = strpos(substr($data, $headerLength), chr(0));
if (false === $commentLength || $length - $headerLength - $commentLength - 1 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$headerLength += $commentLength + 1;
}
// have a CRC for header. let's check
if ($flags & 2) {
if ($length - $headerLength - 2 < 8) {
throw new HTTP_Request2_MessageException(
'Error parsing gzip header: data too short',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$crcReal = 0xffff & crc32(substr($data, 0, $headerLength));
$crcStored = unpack('v', substr($data, $headerLength, 2));
if ($crcReal != $crcStored[1]) {
throw new HTTP_Request2_MessageException(
'Header CRC check failed',
HTTP_Request2_Exception::DECODE_ERROR
);
}
$headerLength += 2;
}
// unpacked data CRC and size at the end of encoded data
$tmp = unpack('V2', substr($data, -8));
$dataCrc = $tmp[1];
$dataSize = $tmp[2];
// finally, call the gzinflate() function
// don't pass $dataSize to gzinflate, see bugs #13135, #14370
$unpacked = gzinflate(substr($data, $headerLength, -8));
if (false === $unpacked) {
throw new HTTP_Request2_MessageException(
'gzinflate() call failed',
HTTP_Request2_Exception::DECODE_ERROR
);
} elseif ($dataSize != strlen($unpacked)) {
throw new HTTP_Request2_MessageException(
'Data size check failed',
HTTP_Request2_Exception::DECODE_ERROR
);
} elseif ((0xffffffff & $dataCrc) != (0xffffffff & crc32($unpacked))) {
throw new HTTP_Request2_Exception(
'Data CRC check failed',
HTTP_Request2_Exception::DECODE_ERROR
);
}
return $unpacked;
}
/**
* Decodes the message-body encoded by deflate
*
* @param string $data deflate-encoded data
*
* @return string decoded data
* @throws HTTP_Request2_LogicException
*/
public static function decodeDeflate($data)
{
if (!function_exists('gzuncompress')) {
throw new HTTP_Request2_LogicException(
'Unable to decode body: gzip extension not available',
HTTP_Request2_Exception::MISCONFIGURATION
);
}
// RFC 2616 defines 'deflate' encoding as zlib format from RFC 1950,
// while many applications send raw deflate stream from RFC 1951.
// We should check for presence of zlib header and use gzuncompress() or
// gzinflate() as needed. See bug #15305
$header = unpack('n', substr($data, 0, 2));
return (0 == $header[1] % 31)? gzuncompress($data): gzinflate($data);
}
}
?>

View file

@ -0,0 +1,135 @@
<?php
/**
* SOCKS5 proxy connection class
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/** Socket wrapper class used by Socket Adapter */
require_once 'HTTP/Request2/SocketWrapper.php';
/**
* SOCKS5 proxy connection class (used by Socket Adapter)
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://pear.php.net/bugs/bug.php?id=19332
* @link http://tools.ietf.org/html/rfc1928
*/
class HTTP_Request2_SOCKS5 extends HTTP_Request2_SocketWrapper
{
/**
* Constructor, tries to connect and authenticate to a SOCKS5 proxy
*
* @param string $address Proxy address, e.g. 'tcp://localhost:1080'
* @param int $timeout Connection timeout (seconds)
* @param array $contextOptions Stream context options
* @param string $username Proxy user name
* @param string $password Proxy password
*
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_ConnectionException
* @throws HTTP_Request2_MessageException
*/
public function __construct(
$address, $timeout = 10, array $contextOptions = array(),
$username = null, $password = null
) {
parent::__construct($address, $timeout, $contextOptions);
if (strlen($username)) {
$request = pack('C4', 5, 2, 0, 2);
} else {
$request = pack('C3', 5, 1, 0);
}
$this->write($request);
$response = unpack('Cversion/Cmethod', $this->read(3));
if (5 != $response['version']) {
throw new HTTP_Request2_MessageException(
'Invalid version received from SOCKS5 proxy: ' . $response['version'],
HTTP_Request2_Exception::MALFORMED_RESPONSE
);
}
switch ($response['method']) {
case 2:
$this->performAuthentication($username, $password);
case 0:
break;
default:
throw new HTTP_Request2_ConnectionException(
"Connection rejected by proxy due to unsupported auth method"
);
}
}
/**
* Performs username/password authentication for SOCKS5
*
* @param string $username Proxy user name
* @param string $password Proxy password
*
* @throws HTTP_Request2_ConnectionException
* @throws HTTP_Request2_MessageException
* @link http://tools.ietf.org/html/rfc1929
*/
protected function performAuthentication($username, $password)
{
$request = pack('C2', 1, strlen($username)) . $username
. pack('C', strlen($password)) . $password;
$this->write($request);
$response = unpack('Cvn/Cstatus', $this->read(3));
if (1 != $response['vn'] || 0 != $response['status']) {
throw new HTTP_Request2_ConnectionException(
'Connection rejected by proxy due to invalid username and/or password'
);
}
}
/**
* Connects to a remote host via proxy
*
* @param string $remoteHost Remote host
* @param int $remotePort Remote port
*
* @throws HTTP_Request2_ConnectionException
* @throws HTTP_Request2_MessageException
*/
public function connect($remoteHost, $remotePort)
{
$request = pack('C5', 0x05, 0x01, 0x00, 0x03, strlen($remoteHost))
. $remoteHost . pack('n', $remotePort);
$this->write($request);
$response = unpack('Cversion/Creply/Creserved', $this->read(1024));
if (5 != $response['version'] || 0 != $response['reserved']) {
throw new HTTP_Request2_MessageException(
'Invalid response received from SOCKS5 proxy',
HTTP_Request2_Exception::MALFORMED_RESPONSE
);
} elseif (0 != $response['reply']) {
throw new HTTP_Request2_ConnectionException(
"Unable to connect to {$remoteHost}:{$remotePort} through SOCKS5 proxy",
0, $response['reply']
);
}
}
}
?>

View file

@ -0,0 +1,297 @@
<?php
/**
* Socket wrapper class used by Socket Adapter
*
* PHP version 5
*
* LICENSE
*
* This source file is subject to BSD 3-Clause License that is bundled
* with this package in the file LICENSE and available at the URL
* https://raw.github.com/pear/HTTP_Request2/trunk/docs/LICENSE
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @copyright 2008-2014 Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @link http://pear.php.net/package/HTTP_Request2
*/
/** Exception classes for HTTP_Request2 package */
require_once 'HTTP/Request2/Exception.php';
/**
* Socket wrapper class used by Socket Adapter
*
* Needed to properly handle connection errors, global timeout support and
* similar things. Loosely based on Net_Socket used by older HTTP_Request.
*
* @category HTTP
* @package HTTP_Request2
* @author Alexey Borzov <avb@php.net>
* @license http://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
* @version Release: 2.2.1
* @link http://pear.php.net/package/HTTP_Request2
* @link http://pear.php.net/bugs/bug.php?id=19332
* @link http://tools.ietf.org/html/rfc1928
*/
class HTTP_Request2_SocketWrapper
{
/**
* PHP warning messages raised during stream_socket_client() call
* @var array
*/
protected $connectionWarnings = array();
/**
* Connected socket
* @var resource
*/
protected $socket;
/**
* Sum of start time and global timeout, exception will be thrown if request continues past this time
* @var integer
*/
protected $deadline;
/**
* Global timeout value, mostly for exception messages
* @var integer
*/
protected $timeout;
/**
* Class constructor, tries to establish connection
*
* @param string $address Address for stream_socket_client() call,
* e.g. 'tcp://localhost:80'
* @param int $timeout Connection timeout (seconds)
* @param array $contextOptions Context options
*
* @throws HTTP_Request2_LogicException
* @throws HTTP_Request2_ConnectionException
*/
public function __construct($address, $timeout, array $contextOptions = array())
{
if (!empty($contextOptions)
&& !isset($contextOptions['socket']) && !isset($contextOptions['ssl'])
) {
// Backwards compatibility with 2.1.0 and 2.1.1 releases
$contextOptions = array('ssl' => $contextOptions);
}
$context = stream_context_create();
foreach ($contextOptions as $wrapper => $options) {
foreach ($options as $name => $value) {
if (!stream_context_set_option($context, $wrapper, $name, $value)) {
throw new HTTP_Request2_LogicException(
"Error setting '{$wrapper}' wrapper context option '{$name}'"
);
}
}
}
set_error_handler(array($this, 'connectionWarningsHandler'));
$this->socket = stream_socket_client(
$address, $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context
);
restore_error_handler();
// if we fail to bind to a specified local address (see request #19515),
// connection still succeeds, albeit with a warning. Throw an Exception
// with the warning text in this case as that connection is unlikely
// to be what user wants and as Curl throws an error in similar case.
if ($this->connectionWarnings) {
if ($this->socket) {
fclose($this->socket);
}
$error = $errstr ? $errstr : implode("\n", $this->connectionWarnings);
throw new HTTP_Request2_ConnectionException(
"Unable to connect to {$address}. Error: {$error}", 0, $errno
);
}
}
/**
* Destructor, disconnects socket
*/
public function __destruct()
{
fclose($this->socket);
}
/**
* Wrapper around fread(), handles global request timeout
*
* @param int $length Reads up to this number of bytes
*
* @return string Data read from socket
* @throws HTTP_Request2_MessageException In case of timeout
*/
public function read($length)
{
if ($this->deadline) {
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
}
$data = fread($this->socket, $length);
$this->checkTimeout();
return $data;
}
/**
* Reads until either the end of the socket or a newline, whichever comes first
*
* Strips the trailing newline from the returned data, handles global
* request timeout. Method idea borrowed from Net_Socket PEAR package.
*
* @param int $bufferSize buffer size to use for reading
* @param int $localTimeout timeout value to use just for this call
* (used when waiting for "100 Continue" response)
*
* @return string Available data up to the newline (not including newline)
* @throws HTTP_Request2_MessageException In case of timeout
*/
public function readLine($bufferSize, $localTimeout = null)
{
$line = '';
while (!feof($this->socket)) {
if (null !== $localTimeout) {
stream_set_timeout($this->socket, $localTimeout);
} elseif ($this->deadline) {
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
}
$line .= @fgets($this->socket, $bufferSize);
if (null === $localTimeout) {
$this->checkTimeout();
} else {
$info = stream_get_meta_data($this->socket);
// reset socket timeout if we don't have request timeout specified,
// prevents further calls failing with a bogus Exception
if (!$this->deadline) {
$default = (int)@ini_get('default_socket_timeout');
stream_set_timeout($this->socket, $default > 0 ? $default : PHP_INT_MAX);
}
if ($info['timed_out']) {
throw new HTTP_Request2_MessageException(
"readLine() call timed out", HTTP_Request2_Exception::TIMEOUT
);
}
}
if (substr($line, -1) == "\n") {
return rtrim($line, "\r\n");
}
}
return $line;
}
/**
* Wrapper around fwrite(), handles global request timeout
*
* @param string $data String to be written
*
* @return int
* @throws HTTP_Request2_MessageException
*/
public function write($data)
{
if ($this->deadline) {
stream_set_timeout($this->socket, max($this->deadline - time(), 1));
}
$written = fwrite($this->socket, $data);
$this->checkTimeout();
// http://www.php.net/manual/en/function.fwrite.php#96951
if ($written < strlen($data)) {
throw new HTTP_Request2_MessageException('Error writing request');
}
return $written;
}
/**
* Tests for end-of-file on a socket
*
* @return bool
*/
public function eof()
{
return feof($this->socket);
}
/**
* Sets request deadline
*
* @param int $deadline Exception will be thrown if request continues
* past this time
* @param int $timeout Original request timeout value, to use in
* Exception message
*/
public function setDeadline($deadline, $timeout)
{
$this->deadline = $deadline;
$this->timeout = $timeout;
}
/**
* Turns on encryption on a socket
*
* @throws HTTP_Request2_ConnectionException
*/
public function enableCrypto()
{
$modes = array(
STREAM_CRYPTO_METHOD_TLS_CLIENT,
STREAM_CRYPTO_METHOD_SSLv3_CLIENT,
STREAM_CRYPTO_METHOD_SSLv23_CLIENT,
STREAM_CRYPTO_METHOD_SSLv2_CLIENT
);
foreach ($modes as $mode) {
if (stream_socket_enable_crypto($this->socket, true, $mode)) {
return;
}
}
throw new HTTP_Request2_ConnectionException(
'Failed to enable secure connection when connecting through proxy'
);
}
/**
* Throws an Exception if stream timed out
*
* @throws HTTP_Request2_MessageException
*/
protected function checkTimeout()
{
$info = stream_get_meta_data($this->socket);
if ($info['timed_out'] || $this->deadline && time() > $this->deadline) {
$reason = $this->deadline
? "after {$this->timeout} second(s)"
: 'due to default_socket_timeout php.ini setting';
throw new HTTP_Request2_MessageException(
"Request timed out {$reason}", HTTP_Request2_Exception::TIMEOUT
);
}
}
/**
* Error handler to use during stream_socket_client() call
*
* One stream_socket_client() call may produce *multiple* PHP warnings
* (especially OpenSSL-related), we keep them in an array to later use for
* the message of HTTP_Request2_ConnectionException
*
* @param int $errno error level
* @param string $errstr error message
*
* @return bool
*/
protected function connectionWarningsHandler($errno, $errstr)
{
if ($errno & E_WARNING) {
array_unshift($this->connectionWarnings, $errstr);
}
return true;
}
}
?>

1219
libs/PEAR.1.9.5/Net/URL2.php Normal file

File diff suppressed because it is too large Load diff

1063
libs/PEAR.1.9.5/PEAR.php Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,389 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker: */
/**
* PEAR_Exception
*
* PHP versions 4 and 5
*
* @category pear
* @package PEAR
* @author Tomas V. V. Cox <cox@idecnet.com>
* @author Hans Lellelid <hans@velum.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version CVS: $Id$
* @link http://pear.php.net/package/PEAR
* @since File available since Release 1.3.3
*/
/**
* Base PEAR_Exception Class
*
* 1) Features:
*
* - Nestable exceptions (throw new PEAR_Exception($msg, $prev_exception))
* - Definable triggers, shot when exceptions occur
* - Pretty and informative error messages
* - Added more context info available (like class, method or cause)
* - cause can be a PEAR_Exception or an array of mixed
* PEAR_Exceptions/PEAR_ErrorStack warnings
* - callbacks for specific exception classes and their children
*
* 2) Ideas:
*
* - Maybe a way to define a 'template' for the output
*
* 3) Inherited properties from PHP Exception Class:
*
* protected $message
* protected $code
* protected $line
* protected $file
* private $trace
*
* 4) Inherited methods from PHP Exception Class:
*
* __clone
* __construct
* getMessage
* getCode
* getFile
* getLine
* getTraceSafe
* getTraceSafeAsString
* __toString
*
* 5) Usage example
*
* <code>
* require_once 'PEAR/Exception.php';
*
* class Test {
* function foo() {
* throw new PEAR_Exception('Error Message', ERROR_CODE);
* }
* }
*
* function myLogger($pear_exception) {
* echo $pear_exception->getMessage();
* }
* // each time a exception is thrown the 'myLogger' will be called
* // (its use is completely optional)
* PEAR_Exception::addObserver('myLogger');
* $test = new Test;
* try {
* $test->foo();
* } catch (PEAR_Exception $e) {
* print $e;
* }
* </code>
*
* @category pear
* @package PEAR
* @author Tomas V.V.Cox <cox@idecnet.com>
* @author Hans Lellelid <hans@velum.net>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Greg Beaver <cellog@php.net>
* @copyright 1997-2009 The Authors
* @license http://opensource.org/licenses/bsd-license.php New BSD License
* @version Release: 1.9.5
* @link http://pear.php.net/package/PEAR
* @since Class available since Release 1.3.3
*
*/
class PEAR_Exception extends Exception
{
const OBSERVER_PRINT = -2;
const OBSERVER_TRIGGER = -4;
const OBSERVER_DIE = -8;
protected $cause;
private static $_observers = array();
private static $_uniqueid = 0;
private $_trace;
/**
* Supported signatures:
* - PEAR_Exception(string $message);
* - PEAR_Exception(string $message, int $code);
* - PEAR_Exception(string $message, Exception $cause);
* - PEAR_Exception(string $message, Exception $cause, int $code);
* - PEAR_Exception(string $message, PEAR_Error $cause);
* - PEAR_Exception(string $message, PEAR_Error $cause, int $code);
* - PEAR_Exception(string $message, array $causes);
* - PEAR_Exception(string $message, array $causes, int $code);
* @param string exception message
* @param int|Exception|PEAR_Error|array|null exception cause
* @param int|null exception code or null
*/
public function __construct($message, $p2 = null, $p3 = null)
{
if (is_int($p2)) {
$code = $p2;
$this->cause = null;
} elseif (is_object($p2) || is_array($p2)) {
// using is_object allows both Exception and PEAR_Error
if (is_object($p2) && !($p2 instanceof Exception)) {
if (!class_exists('PEAR_Error') || !($p2 instanceof PEAR_Error)) {
throw new PEAR_Exception('exception cause must be Exception, ' .
'array, or PEAR_Error');
}
}
$code = $p3;
if (is_array($p2) && isset($p2['message'])) {
// fix potential problem of passing in a single warning
$p2 = array($p2);
}
$this->cause = $p2;
} else {
$code = null;
$this->cause = null;
}
parent::__construct($message, $code);
$this->signal();
}
/**
* @param mixed $callback - A valid php callback, see php func is_callable()
* - A PEAR_Exception::OBSERVER_* constant
* - An array(const PEAR_Exception::OBSERVER_*,
* mixed $options)
* @param string $label The name of the observer. Use this if you want
* to remove it later with removeObserver()
*/
public static function addObserver($callback, $label = 'default')
{
self::$_observers[$label] = $callback;
}
public static function removeObserver($label = 'default')
{
unset(self::$_observers[$label]);
}
/**
* @return int unique identifier for an observer
*/
public static function getUniqueId()
{
return self::$_uniqueid++;
}
private function signal()
{
foreach (self::$_observers as $func) {
if (is_callable($func)) {
call_user_func($func, $this);
continue;
}
settype($func, 'array');
switch ($func[0]) {
case self::OBSERVER_PRINT :
$f = (isset($func[1])) ? $func[1] : '%s';
printf($f, $this->getMessage());
break;
case self::OBSERVER_TRIGGER :
$f = (isset($func[1])) ? $func[1] : E_USER_NOTICE;
trigger_error($this->getMessage(), $f);
break;
case self::OBSERVER_DIE :
$f = (isset($func[1])) ? $func[1] : '%s';
die(printf($f, $this->getMessage()));
break;
default:
trigger_error('invalid observer type', E_USER_WARNING);
}
}
}
/**
* Return specific error information that can be used for more detailed
* error messages or translation.
*
* This method may be overridden in child exception classes in order
* to add functionality not present in PEAR_Exception and is a placeholder
* to define API
*
* The returned array must be an associative array of parameter => value like so:
* <pre>
* array('name' => $name, 'context' => array(...))
* </pre>
* @return array
*/
public function getErrorData()
{
return array();
}
/**
* Returns the exception that caused this exception to be thrown
* @access public
* @return Exception|array The context of the exception
*/
public function getCause()
{
return $this->cause;
}
/**
* Function must be public to call on caused exceptions
* @param array
*/
public function getCauseMessage(&$causes)
{
$trace = $this->getTraceSafe();
$cause = array('class' => get_class($this),
'message' => $this->message,
'file' => 'unknown',
'line' => 'unknown');
if (isset($trace[0])) {
if (isset($trace[0]['file'])) {
$cause['file'] = $trace[0]['file'];
$cause['line'] = $trace[0]['line'];
}
}
$causes[] = $cause;
if ($this->cause instanceof PEAR_Exception) {
$this->cause->getCauseMessage($causes);
} elseif ($this->cause instanceof Exception) {
$causes[] = array('class' => get_class($this->cause),
'message' => $this->cause->getMessage(),
'file' => $this->cause->getFile(),
'line' => $this->cause->getLine());
} elseif (class_exists('PEAR_Error') && $this->cause instanceof PEAR_Error) {
$causes[] = array('class' => get_class($this->cause),
'message' => $this->cause->getMessage(),
'file' => 'unknown',
'line' => 'unknown');
} elseif (is_array($this->cause)) {
foreach ($this->cause as $cause) {
if ($cause instanceof PEAR_Exception) {
$cause->getCauseMessage($causes);
} elseif ($cause instanceof Exception) {
$causes[] = array('class' => get_class($cause),
'message' => $cause->getMessage(),
'file' => $cause->getFile(),
'line' => $cause->getLine());
} elseif (class_exists('PEAR_Error') && $cause instanceof PEAR_Error) {
$causes[] = array('class' => get_class($cause),
'message' => $cause->getMessage(),
'file' => 'unknown',
'line' => 'unknown');
} elseif (is_array($cause) && isset($cause['message'])) {
// PEAR_ErrorStack warning
$causes[] = array(
'class' => $cause['package'],
'message' => $cause['message'],
'file' => isset($cause['context']['file']) ?
$cause['context']['file'] :
'unknown',
'line' => isset($cause['context']['line']) ?
$cause['context']['line'] :
'unknown',
);
}
}
}
}
public function getTraceSafe()
{
if (!isset($this->_trace)) {
$this->_trace = $this->getTrace();
if (empty($this->_trace)) {
$backtrace = debug_backtrace();
$this->_trace = array($backtrace[count($backtrace)-1]);
}
}
return $this->_trace;
}
public function getErrorClass()
{
$trace = $this->getTraceSafe();
return $trace[0]['class'];
}
public function getErrorMethod()
{
$trace = $this->getTraceSafe();
return $trace[0]['function'];
}
public function __toString()
{
if (isset($_SERVER['REQUEST_URI'])) {
return $this->toHtml();
}
return $this->toText();
}
public function toHtml()
{
$trace = $this->getTraceSafe();
$causes = array();
$this->getCauseMessage($causes);
$html = '<table style="border: 1px" cellspacing="0">' . "\n";
foreach ($causes as $i => $cause) {
$html .= '<tr><td colspan="3" style="background: #ff9999">'
. str_repeat('-', $i) . ' <b>' . $cause['class'] . '</b>: '
. htmlspecialchars($cause['message']) . ' in <b>' . $cause['file'] . '</b> '
. 'on line <b>' . $cause['line'] . '</b>'
. "</td></tr>\n";
}
$html .= '<tr><td colspan="3" style="background-color: #aaaaaa; text-align: center; font-weight: bold;">Exception trace</td></tr>' . "\n"
. '<tr><td style="text-align: center; background: #cccccc; width:20px; font-weight: bold;">#</td>'
. '<td style="text-align: center; background: #cccccc; font-weight: bold;">Function</td>'
. '<td style="text-align: center; background: #cccccc; font-weight: bold;">Location</td></tr>' . "\n";
foreach ($trace as $k => $v) {
$html .= '<tr><td style="text-align: center;">' . $k . '</td>'
. '<td>';
if (!empty($v['class'])) {
$html .= $v['class'] . $v['type'];
}
$html .= $v['function'];
$args = array();
if (!empty($v['args'])) {
foreach ($v['args'] as $arg) {
if (is_null($arg)) $args[] = 'null';
elseif (is_array($arg)) $args[] = 'Array';
elseif (is_object($arg)) $args[] = 'Object('.get_class($arg).')';
elseif (is_bool($arg)) $args[] = $arg ? 'true' : 'false';
elseif (is_int($arg) || is_double($arg)) $args[] = $arg;
else {
$arg = (string)$arg;
$str = htmlspecialchars(substr($arg, 0, 16));
if (strlen($arg) > 16) $str .= '&hellip;';
$args[] = "'" . $str . "'";
}
}
}
$html .= '(' . implode(', ',$args) . ')'
. '</td>'
. '<td>' . (isset($v['file']) ? $v['file'] : 'unknown')
. ':' . (isset($v['line']) ? $v['line'] : 'unknown')
. '</td></tr>' . "\n";
}
$html .= '<tr><td style="text-align: center;">' . ($k+1) . '</td>'
. '<td>{main}</td>'
. '<td>&nbsp;</td></tr>' . "\n"
. '</table>';
return $html;
}
public function toText()
{
$causes = array();
$this->getCauseMessage($causes);
$causeMsg = '';
foreach ($causes as $i => $cause) {
$causeMsg .= str_repeat(' ', $i) . $cause['class'] . ': '
. $cause['message'] . ' in ' . $cause['file']
. ' on line ' . $cause['line'] . "\n";
}
return $causeMsg . $this->getTraceAsString();
}
}

33
libs/PEAR.1.9.5/PEAR5.php Normal file
View file

@ -0,0 +1,33 @@
<?php
/**
* This is only meant for PHP 5 to get rid of certain strict warning
* that doesn't get hidden since it's in the shutdown function
*/
class PEAR5
{
/**
* If you have a class that's mostly/entirely static, and you need static
* properties, you can use this method to simulate them. Eg. in your method(s)
* do this: $myVar = &PEAR5::getStaticProperty('myclass', 'myVar');
* You MUST use a reference, or they will not persist!
*
* @access public
* @param string $class The calling classname, to prevent clashes
* @param string $var The variable to retrieve.
* @return mixed A reference to the variable. If not set it will be
* auto initialised to NULL.
*/
static function &getStaticProperty($class, $var)
{
static $properties;
if (!isset($properties[$class])) {
$properties[$class] = array();
}
if (!array_key_exists($var, $properties[$class])) {
$properties[$class][$var] = null;
}
return $properties[$class][$var];
}
}

View file

@ -935,17 +935,17 @@ class adminAdminModel extends admin
return $output->data->count;
}
function getFaviconUrl()
function getFaviconUrl($default = true)
{
return $this->iconUrlCheck('favicon.ico', 'faviconSample.png');
return $this->iconUrlCheck('favicon.ico', 'faviconSample.png', $default);
}
function getMobileIconUrl()
function getMobileIconUrl($default = true)
{
return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png');
return $this->iconUrlCheck('mobicon.png', 'mobiconSample.png', $default);
}
function iconUrlCheck($iconname, $default_icon_name)
function iconUrlCheck($iconname, $default_icon_name, $default)
{
$site_info = Context::get('site_module_info');
$virtual_site = '';
@ -955,11 +955,11 @@ class adminAdminModel extends admin
}
$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
if(!$file_exsit)
{
$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
}
else
if(!$file_exsit && $default === true)
{
$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
}
elseif($file_exsit)
{
$default_url = Context::getDefaultUrl();
$icon_url = $default_url . 'files/attach/xeicon/' . $virtual_site . $iconname;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -1 +1,2 @@
function setStartModule(){var a=jQuery(".moduleIdList option:selected").text(),b=jQuery(".moduleIdList").val();jQuery("#_target_module").val(a),jQuery("#index_module_srl").val(b),jQuery(".moduleList,.moduleIdList, .site_keyword_search, #sitefind_addBtn").css("display","none")}function viewSiteSearch(){jQuery(".site_keyword_search").css("display","")}function getFTPList(a){var b=jQuery("#ftp_form").get(0);b.ftp_root_path.value="undefined"!=typeof a?a:!b.ftp_root_path.value&&"undefined"!=typeof b.sftp&&b.sftp.checked?xe_root:"/";var c=[];c.ftp_user=jQuery("#ftp_user").val(),c.ftp_password=jQuery("#ftp_password").val(),c.ftp_host=jQuery("#ftp_host").val(),c.ftp_port=jQuery("#ftp_port").val(),c.ftp_root_path=jQuery("#ftp_root_path").val(),c.sftp=jQuery("input[name=sftp]:checked").val(),exec_xml("admin","getAdminFTPList",c,completeGetFtpInfo,["list","error","message"],c,b)}function removeFTPInfo(){var a={};exec_xml("install","procInstallAdminRemoveFTPInfo",a,filterAlertMessage,["error","message"],a)}function completeGetFtpInfo(a){if(0!==a.error)return alert(a.error),void alert(a.message);var b=jQuery("#ftpSuggestion").empty(),c="";jQuery.isArray(a.list.item)||(a.list.item=[a.list.item]),pwd=jQuery("#ftp_form").get(0).ftp_root_path.value,"/"!=pwd&&(arr=pwd.split("/"),arr.pop(),arr.pop(),arr.push(""),target=arr.join("/"),c=c+"<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>");for(var d=0;d<a.list.item.length;d++){var e=a.list.item[d];"../"!=e&&"./"!=e&&(c=c+"<li><button type='button' onclick=\"getFTPList('"+pwd+e+"')\">"+e+"</button></li>")}c="<ul>"+c+"</ul>",b.append(jQuery(c))}function deleteIcon(a){var b=[];b.iconname=a,exec_xml("admin","procAdminRemoveIcons",b,iconDeleteMessage,["error","message"],b),icon=a}function iconDeleteMessage(a){alert(a.message),"0"==a.error&&("favicon.ico"==icon?jQuery(".faviconPreview img").attr("src","modules/admin/tpl/img/faviconSample.png"):"mobicon.png"==icon&&jQuery(".mobiconPreview img").attr("src","modules/admin/tpl/img/mobiconSample.png"))}function doRecompileCacheFile(){if(confirm(xe.lang.confirm_run)){var a=[];exec_xml("admin","procAdminRecompileCacheFile",a,completeCacheMessage)}}function completeCacheMessage(a){alert(a.message)}function doResetAdminMenu(){if(confirm(xe.lang.confirm_reset_admin_menu)){var a=[];a.menu_srl=admin_menu_srl,exec_xml("admin","procAdminMenuReset",a,completeResetAdminMenu)}}function completeResetAdminMenu(){document.location.reload()}jQuery(function(a){a(".tgContent ul").bind("click",function(){a("#sitefind_addBtn").css("display","")})});var icon=null;
function setStartModule(){var a=jQuery(".moduleIdList option:selected").text(),b=jQuery(".moduleIdList").val();jQuery("#_target_module").val(a),jQuery("#index_module_srl").val(b),jQuery(".moduleList,.moduleIdList, .site_keyword_search, #sitefind_addBtn").css("display","none")}function viewSiteSearch(){jQuery(".site_keyword_search").css("display","")}function getFTPList(a){var b=jQuery("#ftp_form").get(0);b.ftp_root_path.value="undefined"!=typeof a?a:!b.ftp_root_path.value&&"undefined"!=typeof b.sftp&&b.sftp.checked?xe_root:"/";var c=[];c.ftp_user=jQuery("#ftp_user").val(),c.ftp_password=jQuery("#ftp_password").val(),c.ftp_host=jQuery("#ftp_host").val(),c.ftp_port=jQuery("#ftp_port").val(),c.ftp_root_path=jQuery("#ftp_root_path").val(),c.sftp=jQuery("input[name=sftp]:checked").val(),exec_xml("admin","getAdminFTPList",c,completeGetFtpInfo,["list","error","message"],c,b)}function removeFTPInfo(){var a={};exec_xml("install","procInstallAdminRemoveFTPInfo",a,filterAlertMessage,["error","message"],a)}function completeGetFtpInfo(a){if(0!==a.error)return alert(a.error),void alert(a.message);var b=jQuery("#ftpSuggestion").empty(),c="";jQuery.isArray(a.list.item)||(a.list.item=[a.list.item]),pwd=jQuery("#ftp_form").get(0).ftp_root_path.value,"/"!=pwd&&(arr=pwd.split("/"),arr.pop(),arr.pop(),arr.push(""),target=arr.join("/"),c=c+"<li><button type='button' onclick=\"getFTPList('"+target+"')\">../</button></li>");for(var d=0;d<a.list.item.length;d++){var e=a.list.item[d];"../"!=e&&"./"!=e&&(c=c+"<li><button type='button' onclick=\"getFTPList('"+pwd+e+"')\">"+e+"</button></li>")}c="<ul>"+c+"</ul>",b.append(jQuery(c))}function deleteIcon(a){var b=[];b.iconname=a,exec_xml("admin","procAdminRemoveIcons",b,iconDeleteMessage,["error","message"],b),icon=a}function iconDeleteMessage(a){alert(a.message),"0"==a.error&&("favicon.ico"==icon?jQuery(".faviconPreview img").attr("src","modules/admin/tpl/img/faviconSample.png"):"mobicon.png"==icon&&jQuery(".mobiconPreview img").attr("src","modules/admin/tpl/img/mobiconSample.png"))}function doRecompileCacheFile(){if(confirm(xe.lang.confirm_run)){var a=[];exec_xml("admin","procAdminRecompileCacheFile",a,completeCacheMessage)}}function completeCacheMessage(a){alert(a.message)}function doResetAdminMenu(){if(confirm(xe.lang.confirm_reset_admin_menu)){var a=[];a.menu_srl=admin_menu_srl,exec_xml("admin","procAdminMenuReset",a,completeResetAdminMenu)}}function completeResetAdminMenu(){document.location.reload()}jQuery(function(a){a(".tgContent ul").bind("click",function(){a("#sitefind_addBtn").css("display","")})});var icon=null;
//# sourceMappingURL=config.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"config.min.js","sources":["config.js"],"names":["setStartModule","target_module","jQuery","text","index_module_srl","val","css","viewSiteSearch","getFTPList","pwd","form","get","ftp_root_path","value","sftp","checked","xe_root","params","ftp_user","ftp_password","ftp_host","ftp_port","exec_xml","completeGetFtpInfo","removeFTPInfo","filterAlertMessage","ret_obj","error","alert","message","e","empty","list","isArray","item","arr","split","pop","push","target","join","i","length","v","append","deleteIcon","iconname","iconDeleteMessage","icon","attr","doRecompileCacheFile","confirm","xe","lang","confirm_run","completeCacheMessage","doResetAdminMenu","confirm_reset_admin_menu","menu_srl","admin_menu_srl","completeResetAdminMenu","document","location","reload","$","bind"],"mappings":"AAMA,QAASA,kBACR,GAAIC,GAAgBC,OAAO,iCAAiCC,OACxDC,EAAmBF,OAAO,iBAAiBG,KAC/CH,QAAO,mBAAmBG,IAAIJ,GAC9BC,OAAO,qBAAqBG,IAAID,GAChCF,OAAO,qEAAqEI,IAAI,UAAU,QAG3F,QAASC,kBACRL,OAAO,wBAAwBI,IAAI,UAAU,IAG9C,QAASE,YAAWC,GAEnB,GAAIC,GAAOR,OAAO,a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,OAAO8B,IAIjB,QAASa,YAAWC,GACnB,GAAI7B,KACJA,GAAO6B,SAAWA,EAClBxB,SAAS,QAAS,uBAAwBL,EAAQ8B,mBAAoB,QAAS,WAAY9B,GAC3F+B,KAAOF,EAER,QAASC,mBAAkBrB,GAC1BE,MAAMF,EAAQG,SAEO,KAAjBH,EAAQC,QAEC,eAARqB,KACH9C,OAAO,uBAAuB+C,KAAK,MAAO,2CACzB,eAARD,MACT9C,OAAO,uBAAuB+C,KAAK,MAAO,4CAI7C,QAASC,wBACR,GAAKC,QAAQC,GAAGC,KAAKC,aAArB,CACA,GAAIrC,KACJK,UAAS,QAAQ,8BAA+BL,EAAQsC,uBAEzD,QAASA,sBAAqB7B,GAC7BE,MAAMF,EAAQG,SAGf,QAAS2B,oBACR,GAAKL,QAAQC,GAAGC,KAAKI,0BAArB,CACA,GAAIxC,KACJA,GAAOyC,SAAWC,eAClBrC,SAAS,QAAQ,qBAAsBL,EAAQ2C,yBAEhD,QAASA,0BACRC,SAASC,SAASC,SAzInB7D,OAAO,SAAS8D,GACfA,EAAE,iBAAiBC,KAAK,QAAS,WAChCD,EAAE,oBAAoB1D,IAAI,UAAU,OAoGtC,IAAI0C,MAAO"}

View file

@ -1 +1,2 @@
jQuery(function(a){function b(b){var c;if(moduleList=b.menuList){var d=a("#menuNameList");for(var e in moduleList){var f=moduleList[e];c=a('<optgroup label="'+e+'" />').appendTo(d);for(var g in f)c.append('<option value="'+e+":"+g+'">'+f[g].title+"</option>")}}}var c,d,e=a("#editForm"),f=a("#listForm");a("a._add").click(function(){if(d=a(this).parent().prevAll("._item_key").val(),e.find("input[name=parent_srl]").val(d),!c){var f=[],g=["menuList"];exec_xml("menu","procMenuAdminAllActList",f,b,g)}}),a("a._parent_delete").click(function(){var b=a(this).parent().prevAll("._parent_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()}),a("a._child_delete").click(function(){var b=a(this).closest("li").find("._item_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()})}),jQuery(function(a){function b(a,b){for(var c=0,d=0;a&&a!=b;)c+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:c,left:d}}a("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var b,c,d=a(this);b=d.find(">input._parent_key"),c=!!d.parent("ul").parent("li").length,b.val(c?d.parent("ul").parent("li").find(">input._item_key").val():"0")});var c=!1,d=a('<li class="placeholder">');a("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(e){var f,g,h,i,j,k,l,m,n,o;if(!a(e.target).is("a,input,label,textarea")&&1==e.which){for(c=!0,f=a(this),j=f.height(),i=f.width(),g=f.parentsUntil(".adminMap").filter("ul"),h=g.eq(-1),l={x:e.pageX,y:e.pageY},k=b(this,h.get(0)),$clone=f.clone(!0).attr("target",!0),n=g.length-1;n;n--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();return m=[],h.find("li").each(function(){if(f[0]===this||f.has(this).length)return!0;var c=b(this,h.get(0));m.push({top:c.top,bottom:c.top+32,$item:a(this)})}),$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:.6,width:i,height:j,left:k.left,top:k.top,zIndex:100}).appendTo(h.eq(0)),d.css({position:"absolute",opacity:.6,width:i,height:"10px",left:k.left,top:k.top,zIndex:99}).appendTo(h.eq(0)),f.css("opacity",.6),a(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f,g;for(o=null,b={x:l.x-a.pageX,y:l.y-a.pageY},c=k.top-b.y,e=0,f=m.length;f>e;e++)g=m[e],g.top>c||g.bottom<c||(o={element:g.$item},g.$item.hasClass("parent")?(o.state="prepend",d.css("top",g.bottom-5)):g.top>c-12?(o.state="before",d.css("top",g.top-5)):(o.state="after",d.css("top",g.bottom-5)));$clone.css({top:c})}).bind("mouseup.st",function(){var b,e;c=!1,a(document).unbind("mousemove.st mouseup.st"),f.css("opacity",""),$clone.remove(),d.remove(),e=a("<li />").height(f.height()),o&&(b=a(o.element),f.before(e),"prepend"==o.state?(b.find(">ul").length||b.find(">.side").after("<ul>"),b.find(">ul").prepend(f.hide())):b[o.state](f.hide()),f.slideDown(100,function(){f.removeClass("active")}),e.slideUp(100,function(){var a=e.parent();e.remove(),a.children("li").length||a.remove()}),f.trigger("dropped.st"))}),!1}},"mouseover.st":function(){return c||a(this).addClass("active"),!1},"mouseout.st":function(){return c||a(this).removeClass("active"),!1}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end(),a('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:.7}).appendTo("body")});
jQuery(function(a){function b(b){var c;if(moduleList=b.menuList){var d=a("#menuNameList");for(var e in moduleList){var f=moduleList[e];c=a('<optgroup label="'+e+'" />').appendTo(d);for(var g in f)c.append('<option value="'+e+":"+g+'">'+f[g].title+"</option>")}}}var c,d,e=a("#editForm"),f=a("#listForm");a("a._add").click(function(){if(d=a(this).parent().prevAll("._item_key").val(),e.find("input[name=parent_srl]").val(d),!c){var f=[],g=["menuList"];exec_xml("menu","procMenuAdminAllActList",f,b,g)}}),a("a._parent_delete").click(function(){var b=a(this).parent().prevAll("._parent_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()}),a("a._child_delete").click(function(){var b=a(this).closest("li").find("._item_key").val();f.find("input[name=menu_item_srl]").val(b),f.submit()})}),jQuery(function(a){function b(a,b){for(var c=0,d=0;a&&a!=b;)c+=a.offsetTop,d+=a.offsetLeft,a=a.offsetParent;return{top:c,left:d}}a("form.adminMap").delegate("li:not(.placeholder)","dropped.st",function(){var b,c,d=a(this);b=d.find(">input._parent_key"),c=!!d.parent("ul").parent("li").length,b.val(c?d.parent("ul").parent("li").find(">input._item_key").val():"0")});var c=!1,d=a('<li class="placeholder">');a("form.adminMap>ul").delegate("li:not(.placeholder,.parent)",{"mousedown.st":function(e){var f,g,h,i,j,k,l,m,n,o;if(!a(e.target).is("a,input,label,textarea")&&1==e.which){for(c=!0,f=a(this),j=f.height(),i=f.width(),g=f.parentsUntil(".adminMap").filter("ul"),h=g.eq(-1),l={x:e.pageX,y:e.pageY},k=b(this,h.get(0)),$clone=f.clone(!0).attr("target",!0),n=g.length-1;n;n--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();return m=[],h.find("li").each(function(){if(f[0]===this||f.has(this).length)return!0;var c=b(this,h.get(0));m.push({top:c.top,bottom:c.top+32,$item:a(this)})}),$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:.6,width:i,height:j,left:k.left,top:k.top,zIndex:100}).appendTo(h.eq(0)),d.css({position:"absolute",opacity:.6,width:i,height:"10px",left:k.left,top:k.top,zIndex:99}).appendTo(h.eq(0)),f.css("opacity",.6),a(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f,g;for(o=null,b={x:l.x-a.pageX,y:l.y-a.pageY},c=k.top-b.y,e=0,f=m.length;f>e;e++)g=m[e],g.top>c||g.bottom<c||(o={element:g.$item},g.$item.hasClass("parent")?(o.state="prepend",d.css("top",g.bottom-5)):g.top>c-12?(o.state="before",d.css("top",g.top-5)):(o.state="after",d.css("top",g.bottom-5)));$clone.css({top:c})}).bind("mouseup.st",function(){var b,e;c=!1,a(document).unbind("mousemove.st mouseup.st"),f.css("opacity",""),$clone.remove(),d.remove(),e=a("<li />").height(f.height()),o&&(b=a(o.element),f.before(e),"prepend"==o.state?(b.find(">ul").length||b.find(">.side").after("<ul>"),b.find(">ul").prepend(f.hide())):b[o.state](f.hide()),f.slideDown(100,function(){f.removeClass("active")}),e.slideUp(100,function(){var a=e.parent();e.remove(),a.children("li").length||a.remove()}),f.trigger("dropped.st"))}),!1}},"mouseover.st":function(){return c||a(this).addClass("active"),!1},"mouseout.st":function(){return c||a(this).removeClass("active"),!1}}).find("li li").prepend('<button type="button" class="moveTo">Move to</button>').end().end(),a('<div id="dropzone-marker" />').css({display:"none",position:"absolute",backgroundColor:"#000",opacity:.7}).appendTo("body")});
//# sourceMappingURL=menu_setup.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"menu_setup.min.js","sources":["menu_setup.js"],"names":["jQuery","$","completeGetActList","obj","$optgroup","moduleList","menuList","menuNameList","x","appendTo","y","append","title","parentSrl","editForm","listForm","click","this","parent","prevAll","val","find","params","response_tags","exec_xml","menu_item_srl","submit","closest","getOffset","elem","offsetParent","top","left","offsetTop","offsetLeft","delegate","$pkey","is_child","$this","length","dragging","$holder","mousedown.st","event","$uls","$ul","width","height","offset","position","offsets","i","dropzone","target","is","which","parentsUntil","filter","eq","pageX","pageY","get","$clone","clone","attr","wrap","each","has","o","push","bottom","$item","remove","end","addClass","css","opacity","zIndex","document","unbind","bind","diff","nTop","c","element","hasClass","state","$dropzone","$li","before","after","prepend","hide","slideDown","removeClass","slideUp","$par","children","trigger","mouseover.st","mouseout.st","display","backgroundColor"],"mappings":"AAAAA,OAAO,SAASC,GAiBf,QAASC,GAAmBC,GAE3B,GAAIC,EAGJ,IADAC,WAAaF,EAAIG,SAEjB,CACC,GAAIC,GAAeN,EAAE,gBACrB,KAAI,GAAIO,KAAKH,YACb,CACC,GAAIC,GAAWD,WAAWG,EAC1BJ,GAAYH,EAAE,oBAAoBO,EAAE,QAAQC,SAASF,EACrD,KAAI,GAAIG,KAAKJ,GAEZF,EAAUO,OAAO,kBAAkBH,EAAE,IAAIE,EAAE,KAAKJ,EAASI,GAAGE,MAAM,eA9BtE,GAAIN,GACAO,EACAC,EAAWb,EAAE,aACbc,EAAWd,EAAE,YAEjBA,GAAE,UAAUe,MAAM,WAGjB,GAFAH,EAAYZ,EAAEgB,MAAMC,SAASC,QAAQ,cAAcC,MACnDN,EAASO,KAAK,0BAA0BD,IAAIP,IACxCP,EACJ,CACC,GAAIgB,MACAC,GAAiB,WACrBC,UAAS,OAAO,0BAA2BF,EAAQpB,EAAoBqB,MAwBzEtB,EAAE,oBAAoBe,MAAM,WAC3B,GAAIS,GAAgBxB,EAAEgB,MAAMC,SAASC,QAAQ,gBAAgBC,KAC7DL,GAASM,KAAK,6BA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,IACnBF,EAAErC,IAAMmD,EAAO,IACxB9B,EAASkC,MAAQ,SACjB7C,EAAQkC,IAAI,MAAOP,EAAErC,IAAI,KAEzBqB,EAASkC,MAAQ,QACjB7C,EAAQkC,IAAI,MAAOP,EAAEE,OAAO,IAI9BR,QAAOa,KAAK5C,IAAImD,MAEhBF,KAAK,aAAc,WACnB,GAAIO,GAAWC,CAEfhD,IAAW,EAEXvC,EAAE6E,UAAUC,OAAO,2BACnBzC,EAAMqC,IAAI,UAAW,IACrBb,OAAOU,SACP/B,EAAQ+B,SAGRgB,EAAMvF,EAAE,UAAU8C,OAAOT,EAAMS,UAE3BK,IACJmC,EAAYtF,EAAEmD,EAASgC,SAEvB9C,EAAMmD,OAAOD,GAEQ,WAAlBpC,EAASkC,OACPC,EAAUlE,KAAK,OAAOkB,QAAQgD,EAAUlE,KAAK,UAAUqE,MAAM,QACjEH,EAAUlE,KAAK,OAAOsE,QAAQrD,EAAMsD,SAEpCL,EAAUnC,EAASkC,OAAOhD,EAAMsD,QAGjCtD,EAAMuD,UAAU,IAAK,WAAYvD,EAAMwD,YAAY,YACnDN,EAAIO,QAAQ,IAAK,WAAY,GAAIC,GAAOR,EAAItE,QAAUsE,GAAIhB,SAAcwB,EAAKC,SAAS,MAAM1D,QAAQyD,EAAKxB,WAGzGlC,EAAM4D,QAAQ,kBAGT,IAERC,eAAiB,WAEhB,MADI3D,IAAUvC,EAAEgB,MAAMyD,SAAS,WACxB,GAER0B,cAAgB,WAEf,MADI5D,IAAUvC,EAAEgB,MAAM6E,YAAY,WAC3B,KAGRzE,KAAK,SACJsE,QAAQ,yDAAyDlB,MAClEA,MAEFxE,EAAE,gCACA0E,KAAK0B,QAAQ,OAAOpD,SAAS,WAAWqD,gBAAgB,OAAO1B,QAAQ,KACvEnE,SAAS"}

View file

@ -124,7 +124,7 @@ class ModuleInstaller
}
else
{
$subpath = substr($this->package->path, 2);
$subpath = trim(substr($this->package->path, 2), '/');
$this->download_file = $this->temp_dir . $subpath . ".tar";
$subpatharr = explode("/", $subpath);
array_pop($subpatharr);

View file

@ -19,7 +19,7 @@ class boardAdminController extends board {
* @brief insert borad module
**/
function procBoardAdminInsertBoard($args = null) {
// igenerate module model/controller object
// generate module model/controller object
$oModuleController = getController('module');
$oModuleModel = getModel('module');

View file

@ -1,4 +1,5 @@
<!--%import("css/mboard.css")-->
<load target="css/mboard.css" />
<div class="bd">
<div class="hx h2">
<h2><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a> &rsaquo; {$lang->category}</h2>

View file

@ -1,10 +1,6 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="bd rd">
<div class="hx h2">
<h2><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a></h2>

View file

@ -378,8 +378,10 @@ input[type=radio] {
}
.rp .btn {
display: inline-block;
width: 15px;
height: 15px;
width: 15px !important;
height: 15px !important;
padding: 0 !important;
border: 0 !important;
overflow: hidden;
vertical-align: middle;
text-indent: 15px;

File diff suppressed because one or more lines are too long

View file

@ -1,10 +1,6 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="bd">
<div class="hx h2">
<h2>{$lang->confirm_delete}</h2>

View file

@ -1,10 +1,6 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="bd">
<div class="hx h2">
<h2>{$lang->confirm_delete}</h2>

View file

@ -1,9 +1,5 @@
<!--%import("css/mboard.css")-->
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<load target="css/mboard.css" />
<div class="bd">
<div class="hx h2">
<h2>{$lang->msg_input_password}</h2>

View file

@ -1 +1,2 @@
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").parent().after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").parent().after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
//# sourceMappingURL=mboard.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"mboard.min.js","sources":["mboard.js"],"names":["completeInsertComment","ret_obj","mid","error","message","document_srl","comment_srl","url","current_url","setQuery","location","href","completeDocumentInserted","category_srl","completeGetPage","ret_val","jQuery","remove","parent","after","html","loadPage","page","params","cpage","current_mid","exec_json","completeDeleteComment","completeDeleteDocument"],"mappings":"AAAA,QAASA,uBAAsBC,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBC,EAAcL,EAAQK,YAEtBC,EAA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"}

View file

@ -1,7 +0,0 @@
<?xml version='1.0' encoding='UTF-8'?>
<lang>
<item name="skip_to_content">
<value xml:lang="ko"><![CDATA[본문 건너뛰기]]></value>
<value xml:lang="en"><![CDATA[Skip to content]]></value>
</item>
</lang>

View file

@ -1,13 +1,9 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("css/mboard.css")-->
<load target="css/mboard.css" />
<div class="bd">
<!--@if($oDocument->isExists())-->
<!--#include("read.html")-->
<include target="read.html" />
<!--@else-->
<!--#include("_list.html")-->
<include target="_list.html" />
<!--@end-->
</div>

View file

@ -1,11 +1,6 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
{@ Context::loadLang('./modules/board/m.skins/default/lang')}
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="hx h2">
<h2><a href="{getUrl('document_srl','','category','','page','')}">{$module_info->browser_title}</a>
<!--@if($module_info->use_category == "Y" && $oDocument->get('category_srl'))-->&rsaquo; <a href="{getUrl('document_srl','','category',$oDocument->get('category_srl'))}">{$category_list[$oDocument->get('category_srl')]->title}</a><!--@end--> &rsaquo; {$oDocument->getTitle()}</h2>
@ -62,7 +57,7 @@
<em>{htmlspecialchars($val->title)} - {htmlspecialchars($val->blog_name)}</em>
<span class="time">{zdate($val->regdate, "Y.m.d")}</span>
<!--@if($grant->manager)-->
<a href="07_password.html" class="btn de">삭제</a>
<a href="07_password.html" class="btn de">{$lang->cmd_delete}</a>
<!--@endif-->
</span>
</li>

View file

@ -22,10 +22,10 @@
</description>
<version>0.1</version>
<date>2010-06-10</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NHN</name>
<name xml:lang="en">NHN</name>
<name xml:lang="zh-TW">NHN</name>
<name xml:lang="tr">NHN</name>
<author email_address="developers@xpressengine.com" link="http://www.xpressengine.com/">
<name xml:lang="ko">NAVER</name>
<name xml:lang="en">NAVER</name>
<name xml:lang="zh-TW">NAVER</name>
<name xml:lang="tr">NAVER</name>
</author>
</skin>

View file

@ -1,11 +1,6 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/x.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="bd">
<div class="hx h2">
<h2><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a></h2>

View file

@ -1,4 +1,5 @@
<!--%import("css/mboard.css")-->
<load target="css/mboard.css" />
<div class="bd">
<h2 class="h2"><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a> &rsaquo; {$lang->category}</h2>
<ul class="gn">

View file

@ -1,12 +1,7 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<div class="bd rd">
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="bd rd">
<!--@if($oSourceComment->isExists())-->
<div class="origin">{$oSourceComment->getContent(false)}</div>
<!--@end-->

View file

@ -1,10 +1,6 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="bd">
<h2 class="ac">{$lang->confirm_delete}</h2>
<form action="./" method="get" onsubmit="return procFilter(this, delete_comment)">

View file

@ -1,10 +1,6 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="bd">
<h2 class="ac">{$lang->confirm_delete}</h2>
<form action="./" method="get" onsubmit="return procFilter(this, delete_document)">

View file

@ -1,9 +1,5 @@
<!--%import("css/mboard.css")-->
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<load target="css/mboard.css" />
<div class="bd">
<h2 class="h2">{$lang->msg_input_password}</h2>
<form action="./" method="POST" onsubmit="return procFilter(this, input_password)" class="requirePassword">

View file

@ -1 +1,2 @@
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeGetPage(a){jQuery("#cl").remove(),jQuery("#clpn").remove(),jQuery("#clb").after(a.html)}function loadPage(a,b){var c={};c.cpage=b,c.document_srl=a,c.mid=current_mid,jQuery.exec_json("board.getBoardCommentPage",c,completeGetPage)}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}
//# sourceMappingURL=mboard.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"mboard.min.js","sources":["mboard.js"],"names":["completeInsertComment","ret_obj","mid","error","message","document_srl","comment_srl","url","current_url","setQuery","location","href","completeDocumentInserted","category_srl","completeGetPage","ret_val","jQuery","remove","after","html","loadPage","page","params","cpage","current_mid","exec_json","completeDeleteComment","completeDeleteDocument"],"mappings":"AAAA,QAASA,uBAAsBC,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBC,EAAcL,EAAQK,YAEtBC,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5FH,KAAaC,EAAMA,EAAIE,SAAS,MAAMH,GAAa,YAAYA,GAElEI,SAASC,KAAOJ,EAGjB,QAASK,0BAAyBX,GAEjC,GAKIM,GAHAL,GAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBQ,EAAeZ,EAAQY,YAS1BN,GANGF,EAMGG,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,IAJrFD,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAMnDI,IAAcN,EAAMA,EAAIE,SAAS,WAAWI,IAC/CH,SAASC,KAAOJ,EAGjB,QAASO,iBAAgBC,GAExBC,OAAO,OAAOC,SACdD,OAAO,SAASC,SAChBD,OAAO,QAAQE,MAAMH,EAAQI,MAG9B,QAASC,UAASf,EAAcgB,GAE/B,GAAIC,KAEJA,GAAOC,MAAQF,EACfC,EAAOjB,aAAeA,EACtBiB,EAAOpB,IAAMsB,YACbR,OAAOS,UAAU,4BAA6BH,EAAQR,iBAGvD,QAASY,uBAAsBzB,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBgB,EAAOpB,EAAQoB,KAEfd,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5FY,KAAMd,EAAMA,EAAIE,SAAS,OAAOY,IAEnCX,SAASC,KAAOJ,EAGjB,QAASoB,wBAAuB1B,GAE/B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdmB,EAAOpB,EAAQoB,KAEfd,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAAIA,SAAS,eAAe,GAClFY,KAAMd,EAAMA,EAAIE,SAAS,OAAOY,IAEnCX,SAASC,KAAOJ"}

View file

@ -1,9 +1,5 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("css/mboard.css")-->
<load target="css/mboard.css" />
<div class="bd">
<!--@if($oDocument->isExists())-->
<!--#include("read.html")-->

View file

@ -1,13 +1,9 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="rd">
<div class="hx">
<h2><a href="{getUrl('document_srl','','category','','page','')}">{$module_info->browser_title}</a>
<h2><a href="{getUrl('document_srl','','category','','page','')}">{$module_info->browser_title}</a>
<!--@if($module_info->use_category == "Y" && $oDocument->get('category_srl'))-->&rsaquo; <a href="{getUrl('document_srl','','category',$oDocument->get('category_srl'))}">{$category_list[$oDocument->get('category_srl')]->title}</a><!--@end--> &rsaquo; {$oDocument->getTitle()}</h2>
<em><a href="#">{$oDocument->getNickName()}</a></em>
<span>{$oDocument->getRegdate()}</span>

View file

@ -14,9 +14,9 @@
</description>
<version>0.1</version>
<date>2010-06-10</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NHN</name>
<name xml:lang="en">NHN</name>
<name xml:lang="zh-TW">NHN</name>
<author email_address="developers@xpressengine.com" link="http://www.xpressengine.com/">
<name xml:lang="ko">NAVER</name>
<name xml:lang="en">NAVER</name>
<name xml:lang="zh-TW">NAVER</name>
</author>
</skin>

View file

@ -1,11 +1,6 @@
{@ Context::addJsFile("./common/js/jquery.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/js_app.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/x.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/common.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_handler.js", true, '', -100000) }
{@ Context::addJsFile("./common/js/xml_js_filter.js", true, '', -100000) }
<!--%import("js/mboard.js")-->
<!--%import("css/mboard.css")-->
<load target="js/mboard.js" />
<load target="css/mboard.css" />
<div class="bd">
<h2 class="h2"><a href="{getUrl('','vid',$vid,'mid',$mid)}">{$module_info->browser_title}</a> &rsaquo; {$lang->cmd_write}</h2>
<form action="./" method="POST" onsubmit="return procFilter(this, insert)">

View file

@ -1 +1,2 @@
jQuery(function(a){a(".board_list tr:last-child>td").css("border","0"),a(".read_footer .tags span:last-child").hide();var b=a(".board_search");b.hide().addClass("off"),a(".bsToggle").click(function(){b.hasClass("off")?b.show().removeClass("off").find(".iText").focus():b.hide().addClass("off")});var c=a(".item .iLabel").next(".iText");a(".item .iLabel").css("position","absolute"),c.focus(function(){a(this).prev(".iLabel").css("visibility","hidden")}).blur(function(){a(this).val()?a(this).prev(".iLabel").css("visibility","hidden"):a(this).prev(".iLabel").css("visibility","visible")}).change(function(){a(this).val()?a(this).prev(".iLabel").css("visibility","hidden"):a(this).prev(".iLabel").css("visibility","visible")}).blur(),a(".cTab>li>ul>li.on_").parents("li:first").addClass("on"),a(".feedback .xe_content>*:first-child").css("margin-top","0")}),function(a){a.fn.snspost=function(b){var c="";switch(b=a.extend({},{type:"twitter",event:"click",content:""},b),b.content=encodeURIComponent(b.content),b.type){case"facebook":c="http://www.facebook.com/share.php?t="+b.content+"&u="+encodeURIComponent(b.url||location.href);break;case"delicious":c="http://www.delicious.com/save?v=5&noui&jump=close&url="+encodeURIComponent(b.url||location.href)+"&title="+b.content;break;case"twitter":c="http://twitter.com/home?status="+b.content}this.bind(b.event,function(){return window.open(c),!1})},a.snspost=function(b,c){a.each(b,function(b,d){a(d).snspost(a.extend({},c,{type:b}))})}}(jQuery);
jQuery(function(a){a(".board_list tr:last-child>td").css("border","0"),a(".read_footer .tags span:last-child").hide();var b=a(".board_search");b.hide().addClass("off"),a(".bsToggle").click(function(){b.hasClass("off")?b.show().removeClass("off").find(".iText").focus():b.hide().addClass("off")});var c=a(".item .iLabel").next(".iText");a(".item .iLabel").css("position","absolute"),c.focus(function(){a(this).prev(".iLabel").css("visibility","hidden")}).blur(function(){a(this).val()?a(this).prev(".iLabel").css("visibility","hidden"):a(this).prev(".iLabel").css("visibility","visible")}).change(function(){a(this).val()?a(this).prev(".iLabel").css("visibility","hidden"):a(this).prev(".iLabel").css("visibility","visible")}).blur(),a(".cTab>li>ul>li.on_").parents("li:first").addClass("on"),a(".feedback .xe_content>*:first-child").css("margin-top","0")}),function(a){a.fn.snspost=function(b){var c="";switch(b=a.extend({},{type:"twitter",event:"click",content:""},b),b.content=encodeURIComponent(b.content),b.type){case"facebook":c="http://www.facebook.com/share.php?t="+b.content+"&u="+encodeURIComponent(b.url||location.href);break;case"delicious":c="http://www.delicious.com/save?v=5&noui&jump=close&url="+encodeURIComponent(b.url||location.href)+"&title="+b.content;break;case"twitter":c="http://twitter.com/home?status="+b.content}this.bind(b.event,function(){return window.open(c),!1})},a.snspost=function(b,c){a.each(b,function(b,d){a(d).snspost(a.extend({},c,{type:b}))})}}(jQuery);
//# sourceMappingURL=board.default.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"board.default.min.js","sources":["board.default.js"],"names":["jQuery","$","css","hide","bs","addClass","click","hasClass","show","removeClass","find","focus","iText","next","this","prev","blur","val","change","parents","fn","snspost","opts","loc","extend","type","event","content","encodeURIComponent","url","location","href","bind","window","open","selectors","action","each","key"],"mappings":"AAAAA,OAAO,SAASC,GAEfA,EAAE,gCAAgCC,IAAI,SAAS,KAE/CD,EAAE,sCAAsCE,MAExC,IAAIC,GAAKH,EAAE,gBACXG,GAAGD,OAAOE,SAAS,OACnBJ,EAAE,aAAaK,MAAM,WACjBF,EAAGG,SAAS,OACdH,EAAGI,OAAOC,YAAY,OAAOC,KAAK,UAAUC,QAE5CP,EAAGD,OAAOE,SAAS,QAIrB,IAAIO,GAAQX,EAAE,iBAAiBY,KAAK,SACpCZ,GAAE,iBAAiBC,IAAI,WAAW,YAClCU,EACED,MAAM,WACNV,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,YAEzCc,KAAK,WACDf,EAAEa,MAAMG,MAGXhB,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,UAFzCD,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,aAK1CgB,OAAO,WACHjB,EAAEa,MAAMG,MAGXhB,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,UAFzCD,EAAEa,MAAMC,KAAK,WAAWb,IAAI,aAAa,aAK1Cc,OAEFf,EAAE,sBAAsBkB,QAAQ,YAAYd,SAAS,MAErDJ,EAAE,uCAAuCC,IAAI,aAAa,OAI3D,SAAUD,GACTA,EAAEmB,GAAGC,QAAU,SAASC,GACvB,GAAIC,GAAM,EAGV,QAFAD,EAAOrB,EAAEuB,WAAYC,KAAK,UAAWC,MAAM,QAASC,QAAQ,IAAKL,GACjEA,EAAKK,QAAUC,mBAAmBN,EAAKK,SAChCL,EAAKG,MACX,IAAK,WACJF,EAAM,uCAAuCD,EAAKK,QAAQ,MAAMC,mBAAmBN,EAAKO,KAAKC,SAASC,KACtG,MACD,KAAK,YACJR,EAAM,yDAAyDK,mBAAmBN,EAAKO,KAAKC,SAASC,MAAM,UAAUT,EAAKK,OAC1H,MACD,KAAK,UACJJ,EAAM,kCAAkCD,EAAKK,QAG/Cb,KAAKkB,KAAKV,EAAKI,MAAO,WAErB,MADAO,QAAOC,KAAKX,IACL,KAGTtB,EAAEoB,QAAU,SAASc,EAAWC,GAC/BnC,EAAEoC,KAAKF,EAAW,SAASG,EAAIrB,GAC9BhB,EAAEgB,GAAKI,QAASpB,EAAEuB,UAAWY,GAASX,KAAKa,SAG3CtC"}

View file

@ -1 +1,2 @@
function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}function completeSearch(a,b,c,d){d.submit()}function completeVote(a){var b=(a.error,a.message);alert(b),location.href=location.href}function completeReload(a){a.error,a.message;location.href=location.href}function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteTrackback(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function doChangeCategory(){var a=jQuery("#board_category option:selected").val();location.href=decodeURI(current_url).setQuery("category",a).setQuery("page","")}function doScrap(a){var b=[];b.document_srl=a,jQuery.exec_json("member.procMemberScrapDocument",b)}jQuery(function(a){a(document.body).click(function(b){var c,d=a(b.target),e={};if(0!==d.parents(".layer_voted_member").length||d.is(".layer_voted_member")||a(".layer_voted_member").hide().remove(),d.is("a[class^=voted_member_]")){var f=parseInt(d.attr("class").replace(/[^0-9]/g,""));f&&(d.hasClass("comment")?(c="comment.getCommentVotedMemberList",e={comment_srl:f,point:d.hasClass("votedup")?1:-1}):(c="document.getDocumentVotedMemberList",e={document_srl:f,point:d.hasClass("votedup")?1:-1}),a.exec_json(c,e,function(c){var e=c.voted_member_list,f=[];e&&0!==e.length&&(a.each(e,function(){f.push(this.nick_name)}),d.after(a("<ul>").addClass("layer_voted_member").css({position:"absolute",top:b.pageY+5,left:b.pageX}).append("<li>"+f.join("</li><li>")+"</li>")))}))}})});
function completeDocumentInserted(a){var b,c=(a.error,a.message,a.mid),d=a.document_srl,e=a.category_srl;b=d?current_url.setQuery("mid",c).setQuery("document_srl",d).setQuery("act",""):current_url.setQuery("mid",c).setQuery("act",""),e&&(b=b.setQuery("category",e)),location.href=b}function completeDeleteDocument(a){var b=(a.error,a.message,a.mid),c=a.page,d=current_url.setQuery("mid",b).setQuery("act","").setQuery("document_srl","");c&&(d=d.setQuery("page",c)),location.href=d}function completeSearch(a,b,c,d){d.submit()}function completeVote(a){var b=(a.error,a.message);alert(b),location.href=location.href}function completeReload(a){a.error,a.message;location.href=location.href}function completeInsertComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.comment_srl,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("rnd",d)+"#comment_"+d),location.href=e}function completeDeleteComment(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function completeDeleteTrackback(a){var b=(a.error,a.message,a.mid),c=a.document_srl,d=a.page,e=current_url.setQuery("mid",b).setQuery("document_srl",c).setQuery("act","");d&&(e=e.setQuery("page",d)),location.href=e}function doChangeCategory(){var a=jQuery("#board_category option:selected").val();location.href=decodeURI(current_url).setQuery("category",a).setQuery("page","")}function doScrap(a){var b=[];b.document_srl=a,jQuery.exec_json("member.procMemberScrapDocument",b)}jQuery(function(a){a(document.body).click(function(b){var c,d=a(b.target),e={};if(0!==d.parents(".layer_voted_member").length||d.is(".layer_voted_member")||a(".layer_voted_member").hide().remove(),d.is("a[class^=voted_member_]")){var f=parseInt(d.attr("class").replace(/[^0-9]/g,""));f&&(d.hasClass("comment")?(c="comment.getCommentVotedMemberList",e={comment_srl:f,point:d.hasClass("votedup")?1:-1}):(c="document.getDocumentVotedMemberList",e={document_srl:f,point:d.hasClass("votedup")?1:-1}),a.exec_json(c,e,function(c){var e=c.voted_member_list,f=[];e&&0!==e.length&&(a.each(e,function(){f.push(this.nick_name)}),d.after(a("<ul>").addClass("layer_voted_member").css({position:"absolute",top:b.pageY+5,left:b.pageX}).append("<li>"+f.join("</li><li>")+"</li>")))}))}})});
//# sourceMappingURL=board.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"board.min.js","sources":["board.js"],"names":["completeDocumentInserted","ret_obj","url","mid","error","message","document_srl","category_srl","current_url","setQuery","location","href","completeDeleteDocument","page","completeSearch","response_tags","params","fo_obj","submit","completeVote","alert","completeReload","completeInsertComment","comment_srl","completeDeleteComment","completeDeleteTrackback","doChangeCategory","jQuery","val","decodeURI","doScrap","exec_json","$","document","body","click","e","act","t","target","parents","length","is","hide","remove","srl","parseInt","attr","replace","hasClass","point","data","l","voted_member_list","ul","each","push","this","nick_name","after","addClass","css","position","top","pageY","left","pageX","append","join"],"mappings":"AAOA,QAASA,0BAAyBC,GAEjC,GAQIC,GANAC,GAFQF,EAAQG,MACNH,EAAQI,QACZJ,EAAQE,KACdG,EAAeL,EAAQK,aACvBC,EAAeN,EAAQM,YAW1BL,GANGI,EAMGE,YAAYC,SAAS,MAAMN,GAAKM,SAAS,eAAeH,GAAcG,SAAS,MAAM,IAJrFD,YAAYC,SAAS,MAAMN,GAAKM,SAAS,MAAM,IAMnDF,IAAcL,EAAMA,EAAIO,SAAS,WAAWF,IAC/CG,SAASC,KAAOT,EAIjB,QAASU,wBAAuBX,GAE/B,GAEIE,IAFQF,EAAQG,MACNH,EAAQI,QACZJ,EAAQE,KACdU,EAAOZ,EAAQY,KAEfX,EAAMM,YAAYC,SAAS,MAAMN,GAAKM,SAAS,MAAM,IAAIA,SAAS,eAAe,GAClFI,KAAMX,EAAMA,EAAIO,SAAS,OAAOI,IAInCH,SAASC,KAAOT,EAIjB,QAASY,gBAAeb,EAASc,EAAeC,EAAQC,GAEvDA,EAAOC,SAGR,QAASC,cAAalB,GAErB,GACII,IADQJ,EAAQG,MACNH,EAAQI,QACtBe,OAAMf,GACNK,SAASC,KAAOD,SAASC,KAI1B,QAASU,gBAAepB,GAEXA,EAAQG,MACNH,EAAQI,OAEtBK,UAASC,KAAOD,SAASC,KAI1B,QAASW,uBAAsBrB,GAE9B,GAEIE,IAFQF,EAAQG,MACNH,EAAQI,QACZJ,EAAQE,KACdG,EAAeL,EAAQK,aACvBiB,EAActB,EAAQsB,YAEtBrB,EAAMM,YAAYC,SAAS,MAAMN,GAAKM,SAAS,eAAeH,GAAcG,SAAS,MAAM,GAC5Fc,KAAarB,EAAMA,EAAIO,SAAS,MAAMc,GAAa,YAAYA,GAIlEb,SAASC,KAAOT,EAIjB,QAASsB,uBAAsBvB,GAE9B,GAEIE,IAFQF,EAAQG,MACNH,EAAQI,QACZJ,EAAQE,KACdG,EAAeL,EAAQ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,SAEXT,EAAEuB,KAAKH,EAAE,WACRE,EAAGE,KAAKC,KAAKC,aAGdpB,EAAEqB,MAAM3B,EAAE,QACR4B,SAAS,sBACTC,KAAKC,SAAW,WAAWC,IAAM3B,EAAE4B,MAAM,EAAEC,KAAO7B,EAAE8B,QACpDC,OAAO,OAAOb,EAAGc,KAAK,aAAa"}

View file

@ -1 +1,2 @@
function completeInsertBoard(a){var b=(a.error,a.message),c=a.page,d=a.module_srl;alert(b);var e=current_url.setQuery("act","dispBoardAdminBoardInfo");d&&(e=e.setQuery("module_srl",d)),c&&e.setQuery("page",c),location.href=e}function completeDeleteBoard(a){var b=(a.error,a.message),c=a.page;alert(b);var d=current_url.setQuery("act","dispBoardAdminContent").setQuery("module_srl","");c&&(d=d.setQuery("page",c)),location.href=d}function doUpdateCategory(a,b,c){if("undefined"==typeof c||confirm(c)){var d=xGetElementById("fo_category_info");d.category_srl.value=a,d.mode.value=b,procFilter(d,update_category)}}function completeUpdateCategory(a){var b=(a.error,a.message),c=a.module_srl,d=a.page;alert(b);var e=current_url.setQuery("module_srl",c).setQuery("act","dispBoardAdminCategoryInfo");d&&e.setQuery("page",d),location.href=e}function doCartSetup(a){var b=[];jQuery("#fo_list input[name=cart]:checked").each(function(){b[b.length]=jQuery(this).val()}),b.length<1||(a+="&module_srls="+b.join(","),popopen(a,"modulesSetup"))}function doInsertItem(){var a=xGetElementById("targetItem"),b=xGetElementById("displayItem");if(a&&b){for(var c=a.options[a.selectedIndex].text,d=a.options[a.selectedIndex].value,e=0;e<b.options.length;e++)if(b.options[e].value==d)return;var f=new Option(c,d,!0,!0);b.options[b.options.length]=f}}function doDeleteItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;0>b||a.options.length<2||(a.remove(b),a.selectedIndex=b-1)}function doMoveUpItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;if(!(1>b)&&b){var c=a.options[b].text,d=a.options[b].value;a.options[b].text=a.options[b-1].text,a.options[b].value=a.options[b-1].value,a.options[b-1].text=c,a.options[b-1].value=d,a.selectedIndex=b-1}}function doMoveDownItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;if(!(b>=a.options.length-1)){var c=a.options[b].text,d=a.options[b].value;a.options[b].text=a.options[b+1].text,a.options[b].value=a.options[b+1].value,a.options[b+1].text=c,a.options[b+1].value=d,a.selectedIndex=b+1}}function doSaveListConfig(a){if(a){for(var b=xGetElementById("displayItem"),c=(b.selectedIndex,[]),d=0;d<b.options.length;d++)c[c.length]=b.options[d].value;if(!(c.length<1)){var e={};e.module_srl=a,e.list=c.join(",");{new Array("error","message")}exec_json("board.procBoardAdminInsertListConfig",e,function(){location.reload()})}}}
function completeInsertBoard(a){var b=(a.error,a.message),c=a.page,d=a.module_srl;alert(b);var e=current_url.setQuery("act","dispBoardAdminBoardInfo");d&&(e=e.setQuery("module_srl",d)),c&&e.setQuery("page",c),location.href=e}function completeDeleteBoard(a){var b=(a.error,a.message),c=a.page;alert(b);var d=current_url.setQuery("act","dispBoardAdminContent").setQuery("module_srl","");c&&(d=d.setQuery("page",c)),location.href=d}function doUpdateCategory(a,b,c){if("undefined"==typeof c||confirm(c)){var d=xGetElementById("fo_category_info");d.category_srl.value=a,d.mode.value=b,procFilter(d,update_category)}}function completeUpdateCategory(a){var b=(a.error,a.message),c=a.module_srl,d=a.page;alert(b);var e=current_url.setQuery("module_srl",c).setQuery("act","dispBoardAdminCategoryInfo");d&&e.setQuery("page",d),location.href=e}function doCartSetup(a){var b=[];jQuery("#fo_list input[name=cart]:checked").each(function(){b[b.length]=jQuery(this).val()}),b.length<1||(a+="&module_srls="+b.join(","),popopen(a,"modulesSetup"))}function doInsertItem(){var a=xGetElementById("targetItem"),b=xGetElementById("displayItem");if(a&&b){for(var c=a.options[a.selectedIndex].text,d=a.options[a.selectedIndex].value,e=0;e<b.options.length;e++)if(b.options[e].value==d)return;var f=new Option(c,d,!0,!0);b.options[b.options.length]=f}}function doDeleteItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;0>b||a.options.length<2||(a.remove(b),a.selectedIndex=b-1)}function doMoveUpItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;if(!(1>b)&&b){var c=a.options[b].text,d=a.options[b].value;a.options[b].text=a.options[b-1].text,a.options[b].value=a.options[b-1].value,a.options[b-1].text=c,a.options[b-1].value=d,a.selectedIndex=b-1}}function doMoveDownItem(){var a=xGetElementById("displayItem"),b=a.selectedIndex;if(!(b>=a.options.length-1)){var c=a.options[b].text,d=a.options[b].value;a.options[b].text=a.options[b+1].text,a.options[b].value=a.options[b+1].value,a.options[b+1].text=c,a.options[b+1].value=d,a.selectedIndex=b+1}}function doSaveListConfig(a){if(a){for(var b=xGetElementById("displayItem"),c=(b.selectedIndex,[]),d=0;d<b.options.length;d++)c[c.length]=b.options[d].value;if(!(c.length<1)){var e={};e.module_srl=a,e.list=c.join(",");{new Array("error","message")}exec_json("board.procBoardAdminInsertListConfig",e,function(){location.reload()})}}}
//# sourceMappingURL=board_admin.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"board_admin.min.js","sources":["board_admin.js"],"names":["completeInsertBoard","ret_obj","message","error","page","module_srl","alert","url","current_url","setQuery","location","href","completeDeleteBoard","doUpdateCategory","category_srl","mode","confirm","fo_obj","xGetElementById","value","procFilter","update_category","completeUpdateCategory","doCartSetup","jQuery","each","length","this","val","join","popopen","doInsertItem","target_obj","display_obj","text","options","selectedIndex","i","obj","Option","doDeleteItem","sel_obj","idx","remove","doMoveUpItem","doMoveDownItem","doSaveListConfig","list","params","Array","exec_json","reload"],"mappings":"AAMA,QAASA,qBAAoBC,GAE5B,GACIC,IADQD,EAAQE,MACNF,EAAQC,SAElBE,EAAOH,EAAQG,KACfC,EAAaJ,EAAQI,UAEzBC,OAAMJ,EAEN,IAAIK,GAAMC,YAAYC,SAAS,MAAM,0BAClCJ,KAAYE,EAAMA,EAAIE,SAAS,aAAaJ,IAC5CD,GAAMG,EAAIE,SAAS,OAAOL,GAC7BM,SAASC,KAAOJ,EAIjB,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AAKrB,QAAUe,EAAQN,QAAQE,GAAGlB,KACjF,MAAG4B,EAAKrB,OAAO,GAAf,CAEA,GAAIsB,KACJA,GAAO3C,WAAaA,EACpB2C,EAAOD,KAAOA,EAAKlB,KAAK,IAExB,EAAoB,GAAIoB,OAAM,QAAQ,WAEtCC,UAAU,uCAAwCF,EAAQ,WAAatC,SAASyC"}

View file

@ -908,7 +908,7 @@ class commentController extends comment
* Remove all comment relation log
* @return Object
*/
function deleteCommentLog()
function deleteCommentLog($args)
{
$this->_deleteDeclaredComments($args);
$this->_deleteVotedComments($args);

View file

@ -162,7 +162,7 @@ class communicationController extends communication
}
/**
* Send a message (DB controll)
* Send a message (DB control)
* @param int $sender_srl member_srl of sender
* @param int $receiver_srl member_srl of receiver_srl
* @param string $title

View file

@ -83,12 +83,19 @@ class documentAdminController extends document
unset($obj);
$obj = $oDocument->getObjectVars();
// ISSUE https://github.com/xpressengine/xe-core/issues/32
$args_doc_origin->document_srl = $document_srl;
$output_ori = executeQuery('document.getDocument', $args_doc_origin, array('content'));
$obj->content = $output_ori->data->content;
// Move the attached file if the target module is different
if($module_srl != $obj->module_srl && $oDocument->hasUploadedFiles())
{
$oFileController = getController('file');
$files = $oDocument->getUploadedFiles();
$delete_file_srls = array();
if(is_array($files))
{
foreach($files as $val)
@ -113,9 +120,10 @@ class documentAdminController extends document
$obj->content = str_replace('sid='.$val->sid, 'sid='.$inserted_file->get('sid'), $obj->content);
}
}
// Delete an existing file
$oFileController->deleteFile($val->file_srl);
$delete_file_srls[] = $val->file_srl;
}
// Delete an existing file
$oFileController->deleteFile($delete_file_srls);
}
// Set the all files to be valid
$oFileController->setFilesValid($obj->document_srl);

View file

@ -2482,18 +2482,13 @@ class documentController extends document
if(is_array($documentSrlList))
{
$documentSrlList = array_unique($documentSrlList);
foreach($documentSrlList AS $key=>$documentSrl)
foreach($documentSrlList AS $key => $documentSrl)
{
$oldDocument = $oDocumentModel->getDocument($documentSrl);
$fileCount = $oFileModel->getFilesCount($documentSrl);
if($oldDocument != null)
{
$newDocumentArray = $oldDocument->variables;
$newDocumentArray['uploaded_count'] = $fileCount;
$newDocumentObject = (object) $newDocumentArray;
$this->updateDocument($oldDocument, $newDocumentObject);
}
$args = new stdClass();
$args->document_srl = $documentSrl;
$args->uploaded_count = $fileCount;
executeQuery('document.updateUploadedCount', $args);
}
}
}

View file

@ -232,7 +232,7 @@ class documentModel extends document
{
// document.getDocumentList query execution
// Query_id if you have a group by clause getDocumentListWithinTag getDocumentListWithinComment or used again to perform the query because
$groupByQuery = array('document.getDocumentListWithinComment' => 1, 'document.getDocumentListWithinTag' => 1);
$groupByQuery = array('document.getDocumentListWithinComment' => 1, 'document.getDocumentListWithinTag' => 1, 'document.getDocumentListWithinExtraVars' => 1);
if(isset($groupByQuery[$query_id]))
{
$group_args = clone($args);
@ -1417,6 +1417,10 @@ class documentModel extends document
$args->s_tags = str_replace(' ','%',$search_keyword);
$query_id = 'document.getDocumentListWithinTag';
break;
case 'extra_vars':
$args->var_value = str_replace(' ', '%', $search_keyword);
$query_id = 'document.getDocumentListWithinExtraVars';
break;
default :
if(strpos($search_target,'extra_vars')!==false) {
$args->var_idx = substr($search_target, strlen('extra_vars'));

View file

@ -0,0 +1,27 @@
<query id="getDocumentListWithinExtraVars" action="select">
<tables>
<table name="documents" />
<table name="document_extra_vars" alias="extra_vars" />
</tables>
<columns>
<column name="documents.*" />
</columns>
<conditions>
<condition operation="in" column="documents.module_srl" var="module_srl" filter="number" />
<condition operation="in" column="documents.category_srl" var="category_srl" filter="number" pipe="and" />
<condition operation="equal" column="documents.member_srl" var="member_srl" filter="number" pipe="and" />
<condition operation="equal" column="extra_vars.module_srl" default="documents.module_srl" pipe="and" />
<condition operation="equal" column="extra_vars.document_srl" default="documents.document_srl" pipe="and" />
<condition operation="in" column="documents.status" var="statusList" pipe="and" />
<condition operation="like" column="extra_vars.value" var="var_value" notnull="notnull" pipe="and" />
</conditions>
<groups>
<group column="extra_vars.document_srl" />
</groups>
<navigation>
<index var="sort_index" default="documents.list_order" order="order_type" />
<list_count var="list_count" default="20" />
<page_count var="page_count" default="10" />
<page var="page" default="1" />
</navigation>
</query>

View file

@ -0,0 +1,11 @@
<query id="updateUploadedCount" action="update">
<tables>
<table name="documents" />
</tables>
<columns>
<column name="uploaded_count" var="uploaded_count" default="0" filter="number" />
</columns>
<conditions>
<condition operation="equal" column="document_srl" var="document_srl" filter="number" notnull="notnull" />
</conditions>
</query>

View file

@ -1 +1,2 @@
!function(a){var b=xe.createApp("Gallery",{_imgs:{},_styles:{},init:function(){this._imgs={}},API_ADD_IMAGE:function(a,b){var c=b[0],d=b[1],e="@"+c;/^files/.test(d)&&(d=request_uri+d),is_def(this._imgs[e])||(this._imgs[e]=[]),this._imgs[e].push({path:d,loaded:!1})},API_ONREADY:function(){var b,c,d,e,f=this._imgs;for(d in f)if(f.hasOwnProperty(d))for(b=0,c=f[d].length;c>b;b++)e=f[d][b],e.$obj=a("<img />").attr("src",e.path),e.$obj.load({img:e},function(a){var b=a.data.img;b.loaded=!0,b.$obj.unbind("load")})},API_GET_IMAGES:function(a,b){var c=b[0];return this._imgs["@"+c]||[]},API_SET_STYLE:function(a,b){var c=b[0],d=b[1];this._styles["@"+c]=d},API_ONLOAD:function(){var a,b;for(a in this._imgs)this._imgs.hasOwnProperty(a)&&(b=this._styles[a]||"list",this.cast("SHOW_"+b.toUpperCase(),[a.substr(1)]))}});xe.registerApp(new b)}(jQuery);
!function(a){var b=xe.createApp("Gallery",{_imgs:{},_styles:{},init:function(){this._imgs={}},API_ADD_IMAGE:function(a,b){var c=b[0],d=b[1],e="@"+c;/^files/.test(d)&&(d=request_uri+d),is_def(this._imgs[e])||(this._imgs[e]=[]),this._imgs[e].push({path:d,loaded:!1})},API_ONREADY:function(){var b,c,d,e,f=this._imgs;for(d in f)if(f.hasOwnProperty(d))for(b=0,c=f[d].length;c>b;b++)e=f[d][b],e.$obj=a("<img />").attr("src",e.path),e.$obj.load({img:e},function(a){var b=a.data.img;b.loaded=!0,b.$obj.unbind("load")})},API_GET_IMAGES:function(a,b){var c=b[0];return this._imgs["@"+c]||[]},API_SET_STYLE:function(a,b){var c=b[0],d=b[1];this._styles["@"+c]=d},API_ONLOAD:function(){var a,b;for(a in this._imgs)this._imgs.hasOwnProperty(a)&&(b=this._styles[a]||"list",this.cast("SHOW_"+b.toUpperCase(),[a.substr(1)]))}});xe.registerApp(new b)}(jQuery);
//# sourceMappingURL=gallery.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"gallery.min.js","sources":["gallery.js"],"names":["$","g","xe","createApp","_imgs","_styles","init","this","API_ADD_IMAGE","sender","params","srl","path","key","test","request_uri","is_def","push","loaded","API_ONREADY","i","c","img","imgs","hasOwnProperty","length","$obj","attr","load","event","im","data","unbind","API_GET_IMAGES","API_SET_STYLE","sty","API_ONLOAD","cast","toUpperCase","substr","registerApp","jQuery"],"mappings":"CAGA,SAAUA,GAEV,GAAIC,GAAIC,GAAGC,UAAU,WACpBC,SACAC,WAEAC,KAAO,WACNC,KAAKH,UAENI,cAAgB,SAASC,EAAQC,GAChC,GAAIC,GAAMD,EAAO,GAAIE,EAAOF,EAAO,GAAIG,EAAM,IAAIF,CAE9C,UAASG,KAAKF,KAAOA,EAAOG,YAAcH,GACzCI,OAAOT,KAAKH,MAAMS,MAAON,KAAKH,MAAMS,OAExCN,KAAKH,MAAMS,GAAKI,MAAML,KAAKA,EAAKM,QAAO,KAExCC,YAAc,WACb,GAAIC,GAAGC,EAAGR,EAAKS,EAAKC,EAAOhB,KAAKH,KAGhC,KAAIS,IAAOU,GACV,GAAIA,EAAKC,eAAeX,GAExB,IAAIO,EAAE,EAAEC,EAAEE,EAAKV,GAAKY,OAAYJ,EAAJD,EAAOA,IAClCE,EAAMC,EAAKV,GAAKO,GAChBE,EAAII,KAAO1B,EAAE,WAAW2B,KAAK,MAAOL,EAAIV,MACxCU,EAAII,KAAKE,MAAMN,IAAIA,GAAM,SAASO,GACjC,GAAIC,GAAKD,EAAME,KAAKT,GAEpBQ,GAAGZ,QAAS,EACZY,EAAGJ,KAAKM,OAAO,WAKnBC,eAAiB,SAASxB,EAAQC,GACjC,GAAIC,GAAMD,EAAO,EAEjB,OAAOH,MAAKH,MAAM,IAAIO,QAEvBuB,cAAgB,SAASzB,EAAQC,GAChC,GAAIC,GAAMD,EAAO,GAAIyB,EAAMzB,EAAO,EAElCH,MAAKF,QAAQ,IAAIM,GAAOwB,GAEzBC,WAAa,WACZ,GAAIvB,GAAKsB,CAET,KAAItB,IAAON,MAAKH,MACXG,KAAKH,MAAMoB,eAAeX,KAC9BsB,EAAM5B,KAAKF,QAAQQ,IAAQ,OAE3BN,KAAK8B,KAAK,QAAQF,EAAIG,eAAgBzB,EAAI0B,OAAO,QAKpDrC,IAAGsC,YAAY,GAAIvC,KAEhBwC"}

View file

@ -1 +1,2 @@
!function(a){var b=xe.createPlugin("list",{API_SHOW_LIST:function(b,c){var d,e,f,g,h,i,j,k,l,m,n=c[0];if(d=this.cast("GET_IMAGES",[n]),d.length)for(e=a("#zone_list_gallery_"+n).empty(),width=e.innerWidth(),f=0,g=d.length;g>f;f++)h=d[f],j=h.$obj.prop("width"),l=h.$obj.prop("height"),0==j&&(j=h.$obj.attr("width")),0==l&&(l=h.$obj.attr("height")),j>width-25&&(k=width-25,i=k/j,m=Math.floor(l*i),j=k,l=m,h.$obj.attr("rel","xe_gallery")),e.append(h.$obj),h.$obj.css({width:j+"px",height:l,margin:"0 10px",display:"block"})}}),c=xe.getApp("Gallery")[0];c&&c.registerPlugin(new b)}(jQuery);
!function(a){var b=xe.createPlugin("list",{API_SHOW_LIST:function(b,c){var d,e,f,g,h,i,j,k,l,m,n=c[0];if(d=this.cast("GET_IMAGES",[n]),d.length)for(e=a("#zone_list_gallery_"+n).empty(),width=e.innerWidth(),f=0,g=d.length;g>f;f++)h=d[f],j=h.$obj.prop("width"),l=h.$obj.prop("height"),0==j&&(j=h.$obj.attr("width")),0==l&&(l=h.$obj.attr("height")),j>width-25&&(k=width-25,i=k/j,m=Math.floor(l*i),j=k,l=m,h.$obj.attr("rel","xe_gallery")),e.append(h.$obj),h.$obj.css({width:j+"px",height:l,margin:"0 10px",display:"block"})}}),c=xe.getApp("Gallery")[0];c&&c.registerPlugin(new b)}(jQuery);
//# sourceMappingURL=list_gallery.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"list_gallery.min.js","sources":["list_gallery.js"],"names":["$","listShow","xe","createPlugin","API_SHOW_LIST","sender","params","imgs","$zone","i","c","im","scale","w1","w2","h1","h2","srl","this","cast","length","empty","width","innerWidth","$obj","prop","attr","Math","floor","append","css","height","margin","display","gallery","getApp","registerPlugin","jQuery"],"mappings":"CAMA,SAAUA,GAEV,GAAIC,GAAWC,GAAGC,aAAa,QAC9BC,cAAgB,SAASC,EAAQC,GAChC,GAAqBC,GAAMC,EAAOC,EAAGC,EAAGC,EAAIC,EAAOC,EAAIC,EAAIC,EAAIC,EAA3DC,EAAMX,EAAO,EAIjB,IAFAC,EAAOW,KAAKC,KAAK,cAAeF,IAE5BV,EAAKa,OAKT,IAHAZ,EAAQR,EAAE,sBAAsBiB,GAAKI,QACrCC,MAAQd,EAAMe,aAEVd,EAAE,EAAEC,EAAEH,EAAKa,OAAYV,EAAJD,EAAOA,IAC7BE,EAAKJ,EAAKE,GACVI,EAAKF,EAAGa,KAAKC,KAAK,SAClBV,EAAKJ,EAAGa,KAAKC,KAAK,UAER,GAANZ,IACHA,EAAKF,EAAGa,KAAKE,KAAK,UAEX,GAALX,IACFA,EAAKJ,EAAGa,KAAKE,KAAK,WAGhBb,EAAKS,MAAQ,KACfR,EAAKQ,MAAQ,GACbV,EAASE,EAAKD,EACdG,EAAKW,KAAKC,MAAMb,EAAKH,GAErBC,EAAKC,EAAIC,EAAKC,EACdL,EAAGa,KAAKE,KAAK,MAAO,eAGrBlB,EAAMqB,OAAOlB,EAAGa,MAChBb,EAAGa,KAAKM,KAAKR,MAAMT,EAAG,KAAMkB,OAAOhB,EAAIiB,OAAO,SAAUC,QAAQ,aAK/DC,EAAUhC,GAAGiC,OAAO,WAAW,EAChCD,IAASA,EAAQE,eAAe,GAAInC,KAEpCoC"}

View file

@ -1 +1,2 @@
function getSlideShow(){var a,b,c,d,e,f,g,h,i="";if("undefined"!=typeof opener){a=opener.editorPrevNode,b=jQuery(a),b.is("img")&&(selected_node=a,c=b.width(),d=b.attr("gallery_style"),e=b.attr("gallery_align")||"center",f=b.attr("border_color"),g=b.attr("bg_color"),h=b.attr("border_thickness")||1,get_by_id("width").value=c,get_by_id("gallery_style").selectedIndex="list"==d?1:0,get_by_id("gallery_align").selectedIndex="left"==e?1:"right"==e?2:0,get_by_id("border_thickness").value=h,get_by_id("border_color_input").value=f,get_by_id("bg_color_input").value=g,i=b.attr("images_list"));var j=get_by_id("fo"),k=j.editor_sequence.value,l=opener.get_by_id("uploaded_file_list_"+k);if(l)for(var m=get_by_id("image_list"),n=0;n<l.length;n++){var o=l.options[n],p=o.value;if(!p)return;var q=opener.uploadedFiles[p],r=q.download_url.replace(request_uri,"");if(/(jpg|jpeg|gif|png)$/i.test(r)){var s=!1;-1!=i.indexOf(r)&&(s=!0);var o=new Option(o.text,o.value,!1,s);m.options.add(o)}}}}function insertSlideShow(){if("undefined"!=typeof opener){for(var a=new Array,b=get_by_id("image_list"),c=0;c<b.length;c++){var d=b.options[c];if(d.selected){var e=d.value,f=opener.uploadedFiles[e],g=f.download_url.replace(request_uri,"");a[a.length]=g}}if(!a.length)return void window.close();for(var h=get_by_id("width").value,i=get_by_id("gallery_style").options[get_by_id("gallery_style").selectedIndex].value,j=get_by_id("gallery_align").options[get_by_id("gallery_align").selectedIndex].value,k=get_by_id("border_thickness").value,l=get_by_id("border_color_input").value,m=get_by_id("bg_color_input").value,n="",c=0;c<a.length;c++)n+=a[c].trim()+" ";if(selected_node)selected_node.setAttribute("width",h),selected_node.setAttribute("gallery_style",i),selected_node.setAttribute("align",j),selected_node.setAttribute("gallery_align",j),selected_node.setAttribute("border_thickness",k),selected_node.setAttribute("border_color",l),selected_node.setAttribute("bg_color",m),selected_node.setAttribute("images_list",n),selected_node.style.width=h+"px";else{var o='<img src="../../../../common/img/blank.gif" editor_component="image_gallery" width="'+h+'" gallery_style="'+i+'" align="'+j+'" gallery_align="'+j+'" border_thickness="'+k+'" border_color="'+l+'" bg_color="'+m+'" style="width:'+h+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;" images_list="'+n+'" />';opener.editorFocus(opener.editorPrevSrl);var p=opener.editorGetIFrame(opener.editorPrevSrl);opener.editorReplaceHTML(p,o)}opener.editorFocus(opener.editorPrevSrl),window.close()}}function select_color(a,b){get_by_id(a+"_preview_color").style.backgroundColor="#"+b,get_by_id(a+"_color_input").value=b}var selected_node=null;jQuery(function(){getSlideShow()});
function getSlideShow(){var a,b,c,d,e,f,g,h,i="";if("undefined"!=typeof opener){a=opener.editorPrevNode,b=jQuery(a),b.is("img")&&(selected_node=a,c=b.width(),d=b.attr("gallery_style"),e=b.attr("gallery_align")||"center",f=b.attr("border_color"),g=b.attr("bg_color"),h=b.attr("border_thickness")||1,get_by_id("width").value=c,get_by_id("gallery_style").selectedIndex="list"==d?1:0,get_by_id("gallery_align").selectedIndex="left"==e?1:"right"==e?2:0,get_by_id("border_thickness").value=h,get_by_id("border_color_input").value=f,get_by_id("bg_color_input").value=g,i=b.attr("images_list"));var j=get_by_id("fo"),k=j.editor_sequence.value,l=opener.get_by_id("uploaded_file_list_"+k);if(l)for(var m=get_by_id("image_list"),n=0;n<l.length;n++){var o=l.options[n],p=o.value;if(!p)return;var q=opener.uploadedFiles[p],r=q.download_url.replace(request_uri,"");if(/(jpg|jpeg|gif|png)$/i.test(r)){var s=!1;-1!=i.indexOf(r)&&(s=!0);var o=new Option(o.text,o.value,!1,s);m.options.add(o)}}}}function insertSlideShow(){if("undefined"!=typeof opener){for(var a=new Array,b=get_by_id("image_list"),c=0;c<b.length;c++){var d=b.options[c];if(d.selected){var e=d.value,f=opener.uploadedFiles[e],g=f.download_url.replace(request_uri,"");a[a.length]=g}}if(!a.length)return void window.close();for(var h=get_by_id("width").value,i=get_by_id("gallery_style").options[get_by_id("gallery_style").selectedIndex].value,j=get_by_id("gallery_align").options[get_by_id("gallery_align").selectedIndex].value,k=get_by_id("border_thickness").value,l=get_by_id("border_color_input").value,m=get_by_id("bg_color_input").value,n="",c=0;c<a.length;c++)n+=a[c].trim()+" ";if(selected_node)selected_node.setAttribute("width",h),selected_node.setAttribute("gallery_style",i),selected_node.setAttribute("align",j),selected_node.setAttribute("gallery_align",j),selected_node.setAttribute("border_thickness",k),selected_node.setAttribute("border_color",l),selected_node.setAttribute("bg_color",m),selected_node.setAttribute("images_list",n),selected_node.style.width=h+"px";else{var o='<img src="../../../../common/img/blank.gif" editor_component="image_gallery" width="'+h+'" gallery_style="'+i+'" align="'+j+'" gallery_align="'+j+'" border_thickness="'+k+'" border_color="'+l+'" bg_color="'+m+'" style="width:'+h+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;" images_list="'+n+'" />';opener.editorFocus(opener.editorPrevSrl);var p=opener.editorGetIFrame(opener.editorPrevSrl);opener.editorReplaceHTML(p,o)}opener.editorFocus(opener.editorPrevSrl),window.close()}}function select_color(a,b){get_by_id(a+"_preview_color").style.backgroundColor="#"+b,get_by_id(a+"_color_input").value=b}var selected_node=null;jQuery(function(){getSlideShow()});
//# sourceMappingURL=popup.min.map

View file

@ -0,0 +1 @@
{"version":3,"file":"popup.min.js","sources":["popup.js"],"names":["getSlideShow","node","$node","width","style","align","border_color","bg_color","thickness","selected_images","opener","editorPrevNode","jQuery","is","selected_node","attr","get_by_id","value","selectedIndex","fo","editor_sequence","parent_list_obj","list_obj","i","length","opt","options","file_srl","file_obj","uploadedFiles","filename","download_url","replace","request_uri","test","selected","indexOf","Option","text","add","insertSlideShow","list","Array","window","close","gallery_style","gallery_align","border_thickness","images_list","trim","setAttribute","editorFocus","editorPrevSrl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Y,MACzftC,QAAOyC,YAAYzC,OAAO0C,cAC1B,IAAIC,GAAa3C,OAAO4C,gBAAgB5C,OAAO0C,cAC/C1C,QAAO6C,kBAAkBF,EAAYf,GAGzC5B,OAAOyC,YAAYzC,OAAO0C,eAE1BT,OAAOC,SAIX,QAASY,cAAaC,EAAMC,GAC1B1C,UAAUyC,EAAK,kBAAkBrD,MAAMuD,gBAAkB,IAAID,EAC7D1C,UAAUyC,EAAK,gBAAgBxC,MAAQyC,EAnHzC,GAAI5C,eAAgB,IAsHpBF,QAAO,WACNZ"}

View file

@ -1 +1,2 @@
!function(a){var b=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={},this._thumbs={},this._current={}},API_SHOW_SLIDE:function(b,c){var d,e,f,g,h,i,j=this,k=c[0],l="@"+k;if(d=this.cast("GET_IMAGES",[k]),d.length){for(var h=0,m=d.length;m>h;h++)if(!d[h].loaded)return void setTimeout(function(){j.cast("SHOW_SLIDE",c)},200);for(e=a("#zone_slide_gallery_"+k),g=e.find(".slide_gallery_placeholder").css("overflow","hidden"),e.find(".slide_gallery_loading_text").remove(),f=e.find(".slide_gallery_thumbnail_image_box").show(),h=0,i=d.length;i>h;h++)d[h].$obj.clone().css({cursor:"pointer",width:"60px",height:"60px",margin:"5px",opacity:.5}).click({idx:h},function(a){j.cast("SET_SLIDE",[k,a.data.idx])}).appendTo(f);a("#zone_gallery_navigator_status_"+k).click(function(){f.toggle()}),e.find(".__prev").click(function(){return j.cast("PREV_SLIDE",[k]),!1}).end().find(".__next").click(function(){return j.cast("NEXT_SLIDE",[k]),!1}),this._holders[l]=g,this._thumbs[l]=f,this._current[l]=0,this.cast("SET_SLIDE",[k,0])}},_showSideSlide:function(a,b){var c,d,e;c=this.cast("GET_IMAGES",[a]),c.length&&(d=this._current["@"+a],e=d+b,0>e?e=c.length-1:e>=c.length&&(e=0),this.cast("SET_SLIDE",[a,e]))},API_NEXT_SLIDE:function(a,b){this._showSideSlide(b[0],1)},API_PREV_SLIDE:function(a,b){this._showSideSlide(b[0],-1)},API_SET_SLIDE:function(b,c){var d,e,f,g,h,i,j,k,l,m=c[0],n=c[1];d=this.cast("GET_IMAGES",[m]),d.length&&is_def(e=d[n])&&(this._current["@"+m]=n,a("#zone_gallery_navigator_status_"+m).text(n+1+"/"+d.length),this._thumbs["@"+m].find("img").eq(n).animate({opacity:1}).end().not(":eq("+n+")").animate({opacity:.5}),f=this._holders["@"+m],g=f.parent().innerWidth(),h=e.$obj.prop("width"),j=e.$obj.prop("height"),0==h&&(h=e.$obj.attr("width")),0==j&&(j=e.$obj.attr("height")),h>g-20&&(i=g-20,l=i/h,k=Math.floor(j*l),h=i,j=k,e.$obj.css("cursor","pointer"),e.$obj.attr("rel","xe_gallery")),e.$obj.css({width:h,height:j,margin:"0 10px"}),f.empty().append(e.$obj))}}),c=xe.getApp("Gallery")[0];c&&c.registerPlugin(new b)}(jQuery);
!function(a){var b=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={},this._thumbs={},this._current={}},API_SHOW_SLIDE:function(b,c){var d,e,f,g,h,i,j=this,k=c[0],l="@"+k;if(d=this.cast("GET_IMAGES",[k]),d.length){for(var h=0,m=d.length;m>h;h++)if(!d[h].loaded)return void setTimeout(function(){j.cast("SHOW_SLIDE",c)},200);for(e=a("#zone_slide_gallery_"+k),g=e.find(".slide_gallery_placeholder").css("overflow","hidden"),e.find(".slide_gallery_loading_text").remove(),f=e.find(".slide_gallery_thumbnail_image_box").show(),h=0,i=d.length;i>h;h++)d[h].$obj.clone().css({cursor:"pointer",width:"60px",height:"60px",margin:"5px",opacity:.5}).click({idx:h},function(a){j.cast("SET_SLIDE",[k,a.data.idx])}).appendTo(f);a("#zone_gallery_navigator_status_"+k).click(function(){f.toggle()}),e.find(".__prev").click(function(){return j.cast("PREV_SLIDE",[k]),!1}).end().find(".__next").click(function(){return j.cast("NEXT_SLIDE",[k]),!1}),this._holders[l]=g,this._thumbs[l]=f,this._current[l]=0,this.cast("SET_SLIDE",[k,0])}},_showSideSlide:function(a,b){var c,d,e;c=this.cast("GET_IMAGES",[a]),c.length&&(d=this._current["@"+a],e=d+b,0>e?e=c.length-1:e>=c.length&&(e=0),this.cast("SET_SLIDE",[a,e]))},API_NEXT_SLIDE:function(a,b){this._showSideSlide(b[0],1)},API_PREV_SLIDE:function(a,b){this._showSideSlide(b[0],-1)},API_SET_SLIDE:function(b,c){var d,e,f,g,h,i,j,k,l,m=c[0],n=c[1];d=this.cast("GET_IMAGES",[m]),d.length&&is_def(e=d[n])&&(this._current["@"+m]=n,a("#zone_gallery_navigator_status_"+m).text(n+1+"/"+d.length),this._thumbs["@"+m].find("img").eq(n).animate({opacity:1}).end().not(":eq("+n+")").animate({opacity:.5}),f=this._holders["@"+m],g=f.parent().innerWidth(),h=e.$obj.prop("width"),j=e.$obj.prop("height"),0==h&&(h=e.$obj.attr("width")),0==j&&(j=e.$obj.attr("height")),h>g-20&&(i=g-20,l=i/h,k=Math.floor(j*l),h=i,j=k,e.$obj.css("cursor","pointer"),e.$obj.attr("rel","xe_gallery")),e.$obj.css({width:h,height:j,margin:"0 10px"}),f.empty().append(e.$obj))}}),c=xe.getApp("Gallery")[0];c&&c.registerPlugin(new b)}(jQuery);
//# sourceMappingURL=slide_gallery.min.map

Some files were not shown because too many files have changed in this diff Show more