Merge branch 'develop' of https://github.com/xpressengine/xe-core into develop

This commit is contained in:
khongchi 2015-01-28 16:08:34 +09:00
commit 427b95899b
216 changed files with 14748 additions and 823 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]

9
.jshintignore Normal file
View file

@ -0,0 +1,9 @@
common/js/jquery*.js
common/js/modernizr.js
common/js/xe.js
common/js/x.js
common/js/*.min.js
common/js/unittest/*
common/js/plugins/*
common/js/foggyLayer.js
common/js/html5.js

68
.jshintrc Normal file
View file

@ -0,0 +1,68 @@
{
"globalstrict": false,
"undef": false,
"eqeqeq": false,
"browser": true,
"devel": true,
"jquery": true,
"evil": true,
"globals": {
"window": true,
"current_url": true,
"exec_json": true,
"exec_xml": true,
"procFilter": true,
"xe": true,
"request_uri": true,
"xAddEventListener": false,
"xResizeEvent": false,
"xScrollEvent": false,
"xAppendChild": false,
"xClientHeight": false,
"xClientWidth": false,
"xCreateElement": false,
"xDef": false,
"xDeleteCookie": false,
"xDisplay": false,
"xEvent": false,
"xFirstChild": false,
"xGetBodyWidth": false,
"xGetBodyHeight": false,
"xGetComputedStyle": false,
"xGetCookie": false,
"xGetElementById": false,
"xGetElementsByAttribute": false,
"xGetElementsByClassName": false,
"xGetElementsByTagName": false,
"xGetURLArguments": false,
"xHeight": false,
"xHex": false,
"xHide": false,
"xInnerHtml": false,
"xLeft": false,
"xMoveTo": false,
"xName": false,
"xNextSib": false,
"xNum": false,
"xOffsetLeft": false,
"xOffsetTop": false,
"xPad": false,
"xPageX": false,
"xPageY": false,
"xParent": false,
"xPreventDefault": false,
"xPrevSib": false,
"xRemoveEventListener": false,
"xResizeTo": false,
"xScrollLeft": false,
"xScrollTop": false,
"xSetCookie": false,
"xShow": false,
"xStr": false,
"xTop": false,
"xVisibility": false,
"xWidth": false,
"xZIndex": false,
"xStopPropagation": false
}
}

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,13 +45,26 @@ 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']
}
},
'handlebars': {
options: {
sourceMap: true
},
files: {
'common/js/plugins/handlebars/handlebars.min.js': ['common/js/plugins/handlebars/handlebars.js'],
'common/js/plugins/handlebars.runtime/handlebars.runtime.min.js': ['common/js/plugins/handlebars.runtime/handlebars.runtime.js'],
}
},
'modules': {
options: {
sourceMap: true
},
files: {
'common/js/x.min.js' : ['common/js/x.js'],
// addon
@ -145,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',
@ -153,15 +172,6 @@ module.exports = function(grunt) {
'modules/widget/tpl/js/*.js',
],
options : {
globalstrict: false,
undef : false,
eqeqeq: false,
browser : true,
globals: {
"jQuery" : true,
"console" : true,
"window" : true
},
ignores : [
'**/jquery*.js',
'**/swfupload.js',
@ -259,9 +269,10 @@ module.exports = function(grunt) {
if(tasks.length === 0) {
grunt.util.spawn({
cmd: "tar",
args: ['cfz', 'xe.'+version+'.tar.gz', 'xe/'],
args: ['cfz', '../xe.'+version+'.tar.gz', './'],
opts: {
cwd: 'build'
cwd: 'build/xe',
cache: false
}
}, function (error, result, code) {
grunt.log.ok('Archived(full) : ' + build_dir + '/xe.'+version+'.tar.gz');
@ -269,9 +280,10 @@ module.exports = function(grunt) {
grunt.util.spawn({
cmd: "zip",
args: ['-r', 'xe.'+version+'.zip', 'xe/'],
args: ['-r', '../xe.'+version+'.zip', './'],
opts: {
cwd: 'build'
cwd: 'build/xe',
cache: false
}
}, function (error, result, code) {
grunt.log.ok('Archived(full) : ' + build_dir + '/xe.'+version+'.zip');
@ -303,7 +315,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;
@ -313,8 +325,8 @@ module.exports = function(grunt) {
// changed
if(diff.length) {
var args_tar = ['archive', '--prefix=xe/', '-o', 'build/xe.'+version+'.changed.tar.gz', version];
var args_zip = ['archive', '--prefix=xe/', '-o', 'build/xe.'+version+'.changed.zip', version];
var args_tar = ['archive', '-o', 'build/xe.'+version+'.changed.tar.gz', version];
var args_zip = ['archive', '-o', 'build/xe.'+version+'.changed.zip', version];
args_tar = args_tar.concat(diff);
args_zip = args_zip.concat(diff);

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,KAAK,GAAIL,OAAM,QAAQ,UAAU,gBAAgB,iBAAiB,eAAe,YAAY,mBAI9HtB,GAAE4B,SAASC,KAGzB,KAAKH,EAAW,CACf,GAAII,GAAoD,IAAxCC,UAAUC,WAAWzB,QAAQ,SAAiB,GAAO,EACjE0B,EAAiE,IAArDF,UAAUC,WAAWE,cAAc3B,QAAQ,QAAgB,GAAO,EAC9E4B,EAAsD,IAAxCJ,UAAUK,UAAU7B,QAAQ,UAAkB,GAAO,EACnE8B,EAAWC,YAAc,6BAE1BR,IAAWG,IAAaE,GAC1BI,SAAU,wNACVA,UAAY,oDACZA,UAAY,wCACZA,UAAY,8BAA8BF,EAAS,OACnDE,UAAY,wCACZA,UAAY,+CACZA,UAAY,0CACZA,UAAY,aAEZA,SAAW,eAAeF,EAAS,kQAGpCX,EAAY1B,EAAE,mHAAmHwC,SAASZ,SAASC,KAEnJ,IAAIY,GAAW,8CACZC,QAAOC,MAAM,MAAOF,EAAW,GAClC,IAAIG,GAAO5C,EAAE,2DAA6DyC,EAAW,oeAIsHH,YAAc,6bACbA,YAAc,y+CAQ5MC,SACX,UAAUC,SAASd,EAEpBkB,GAAKnC,KAAK,iBACVoC,MAAM,WAAY7C,EAAE,kBAAkB8C,SAEtCF,EAAKnC,KAAK,eACVoC,MAAM,WACN,GAAIE,GAAMvB,OAAsB,eAAKI,SAAwB,cACzDoB,EAAQlC,YAAYmC,SAAS,iBAAiB,gBAAgBA,SAAS,OAAO,GAAKC,OAAMC,UAC7FP,GAAKnC,KAAK,oBAAoBW,QAC9B2B,EAAIK,eAAeJ,EAAM,OAGzBJ,EAAKnC,KAAK,iBACVoC,MAAM,WACN,GAAIxB,GAAS,GAAIC,MACjBD,GAAuB,eAAI,oBAC3BA,EAAY,IAAIE,YAChBC,OAAOC,WAAW,GAAG,GAAGJ,EAAQ,WAC/BrB,EAAE,kBAAkBM,KAAK,MAAOQ,YAAYmC,SAAS,iBAAiB,gBAAgBA,SAAS,OAAO,GAAKC,OAAMC,gBAIpHzB,EAAU2B,KAAO,SAASC,EAAQ9C,EAAKa,EAAQkC,EAAeC,EAAeC,EAAmBC,GAC/F,GAAIC,IAAU,CAId,IAFA3D,EAAEE,KAAKS,qBAAwB,SAASiD,EAAIlD,GAAM,MAAIA,IAAOF,GAAMmD,GAAU,GAAa,GAAxC,SAE9CA,EAAS,CAEZ3D,EAAE,uBACDe,OAAO,SAASI,GAEhB,MADAA,GAAEF,iBACEjB,EAAE,gBAAgBU,OAItBgB,EAAUmC,WAAkB,IAH3B7D,EAAEK,MAAMI,KAAK,oBAAoBC,IAAI,IAAIU,SAClC,KAITrB,YAAcuD,OAASA,EAAO9C,IAAMA,EAAIa,OAASA,EAAOkC,cAAgBA,EAAcC,cAAgBA,EAAcC,kBAAoBA,EAAkBC,OAASA,EACnK,IAAIrC,GAAS,GAAIC,MACjBD,GAAuB,eAAI,oBAC3BA,EAAY,IAAIE,YAChBC,OAAOC,WAAW6B,EAAQ9C,EAAKa,EAAQK,EAAUC,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,KAAK,GAAIL,OAAM,QAAQ,UAAU,gBAAgB,iBAAiB,eAAe,YAAY,mBAI9HtB,GAAE4B,SAASC,KAGzB,KAAKH,EAAW,CACf,GAAII,GAAoD,IAAxCC,UAAUC,WAAWzB,QAAQ,SAAiB,GAAO,EACjE0B,EAAiE,IAArDF,UAAUC,WAAWE,cAAc3B,QAAQ,QAAgB,GAAO,EAC9E4B,EAAsD,IAAxCJ,UAAUK,UAAU7B,QAAQ,UAAkB,GAAO,EACnE8B,EAAWC,YAAc,6BAE1BR,IAAWG,IAAaE,GAC1BI,SAAU,wNACVA,UAAY,oDACZA,UAAY,wCACZA,UAAY,8BAA8BF,EAAS,OACnDE,UAAY,wCACZA,UAAY,+CACZA,UAAY,0CACZA,UAAY,aAEZA,SAAW,eAAeF,EAAS,kQAGpCX,EAAY1B,EAAE,mHAAmHwC,SAASZ,SAASC,KAEnJ,IAAIY,GAAW,8CACZC,QAAOC,MAAM,MAAOF,EAAW,GAClC,IAAIG,GAAO5C,EAAE,2DAA6DyC,EAAW,oeAIsHH,YAAc,6bACbA,YAAc,y+CAQ5MC,SACX,UAAUC,SAASd,EAEpBkB,GAAKnC,KAAK,iBACVoC,MAAM,WAAY7C,EAAE,kBAAkB8C,SAEtCF,EAAKnC,KAAK,eACVoC,MAAM,WACN,GAAIE,GAAMvB,OAAsB,eAAKI,SAAwB,cACzDoB,EAAQlC,YAAYmC,SAAS,iBAAiB,gBAAgBA,SAAS,OAAO,GAAKC,OAAMC,UAC7FP,GAAKnC,KAAK,oBAAoBW,QAC9B2B,EAAIK,eAAeJ,EAAM,OAGzBJ,EAAKnC,KAAK,iBACVoC,MAAM,WACN,GAAIxB,GAAS,GAAIC,MACjBD,GAAuB,eAAI,oBAC3BA,EAAY,IAAIE,YAChBC,OAAOC,WAAW,GAAG,GAAGJ,EAAQ,WAC/BrB,EAAE,kBAAkBM,KAAK,MAAOQ,YAAYmC,SAAS,iBAAiB,gBAAgBA,SAAS,OAAO,GAAKC,OAAMC,gBAIpHzB,EAAU2B,KAAO,SAASC,EAAQ9C,EAAKa,EAAQkC,EAAeC,EAAeC,EAAmBC,GAC/F,GAAIC,IAAU,CAId,IAFA3D,EAAEE,KAAKS,qBAAwB,SAASiD,EAAIlD,GAAM,MAAIA,IAAOF,GAAMmD,GAAU,GAAa,GAAxC,SAE9CA,EAAS,CAEZ3D,EAAE,uBACDe,OAAO,SAASI,GAEhB,MADAA,GAAEF,iBACEjB,EAAE,gBAAgBU,OAItBgB,EAAUmC,WAAkB,IAH3B7D,EAAEK,MAAMI,KAAK,oBAAoBC,IAAI,IAAIU,SAClC,KAITrB,YAAcuD,OAASA,EAAO9C,IAAMA,EAAIa,OAASA,EAAOkC,cAAgBA,EAAcC,cAAgBA,EAAcC,kBAAoBA,EAAkBC,OAASA,EACnK,IAAIrC,GAAS,GAAIC,MACjBD,GAAuB,eAAI,oBAC3BA,EAAY,IAAIE,YAChBC,OAAOC,WAAW6B,EAAQ9C,EAAKa,EAAQK,EAAUC,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"}

View file

@ -10,7 +10,7 @@ if(!defined('__XE__'))
* @brief Counter add-on
*/
// Execute if called_position is before_display_content
if($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled())
if($called_position == 'before_module_init' && Context::get('module') != 'admin' && Context::getResponseMethod() == 'HTML' && Context::isInstalled() && !isCrawler())
{
$oCounterController = getController('counter');
$oCounterController->counterExecute();

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

@ -98,7 +98,8 @@ function getScreen() {
;
// 이미지 홀더
imgframe = $("<img>")
imgframe = $(new Image());
imgframe
.attr("id", "xe_gallery_holder")
.css({
border: '5px solid white',
@ -111,6 +112,15 @@ function getScreen() {
body.append(xScreen).append(controls);
imgframe.live('load', function(){
var clientWidth = $(window).width();
var clientHeight = $(window).height();
imgframe.css({
left : clientWidth/2 - imgframe.width()/2 + "px",
top : clientHeight/2 - imgframe.height()/2 + "px"
});
});
// xScreen 객체를 확장한다.
xScreen.xeShow = function() {
var clientWidth = $(window).width();
@ -140,13 +150,18 @@ function getScreen() {
this.index += val;
prevbtn.css("visibility", (this.index>0)?"visible":"hidden");
nextbtn.css("visibility", (this.index<this.list.size()-1)?"visible":"hidden");
//textyle 이미지 리사이즈 처리
var src = this.list.eq(this.index).attr("rawsrc");
if(!src) src = this.list.eq(this.index).attr("src");
imgframe.attr("src", src).css({
left : clientWidth/2 - imgframe.width()/2 + "px",
top : clientHeight/2 - imgframe.height()/2 + "px"
});
//textyle 이미지 리사이즈 처리
var src = this.list.eq(this.index).attr("rawsrc");
if(!src) src = this.list.eq(this.index).attr("src");
imgframe.attr("src", src).removeAttr('width').removeAttr('height');
if(imgframe.width() > 0) {
imgframe.css({
left : clientWidth/2 - imgframe.width()/2 + "px",
top : clientHeight/2 - imgframe.height()/2 + "px"
});
}
closebtn.css({
left : clientWidth/2 - 32 + "px",
top : "10px"

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("<img>").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),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).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","each","remove","imgSrc","test","parent","length","jQuery"],"mappings":"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"}

View file

@ -2,14 +2,16 @@
/* Copyright (C) NAVER <http://www.navercorp.com> */
if(!defined('__XE__'))
{
exit();
}
/**
* @file resize_image.addon.php
* @author NAVER (developers@xpressengine.com)
* @brief Add-on to resize images in the body
*/
if($called_position == 'after_module_proc' && (Context::getResponseMethod() == "HTML" || !isCrawler()))
if($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && !isCrawler())
{
if(Mobile::isFromMobilePhone())
{

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...';
@ -328,11 +328,9 @@ class Context
array(&$oSessionController, 'open'), array(&$oSessionController, 'close'), array(&$oSessionModel, 'read'), array(&$oSessionController, 'write'), array(&$oSessionController, 'destroy'), array(&$oSessionController, 'gc')
);
}
if($sess = $_POST[session_name()]) session_id($sess);
session_start();
if($sess = $_POST[session_name()])
{
session_id($sess);
}
// set authentication information in Context and session
if(self::isInstalled())
@ -368,12 +366,6 @@ class Context
// check if using rewrite module
$this->allow_rewrite = ($this->db_info->use_rewrite == 'Y' ? TRUE : FALSE);
// If using rewrite module, initializes router
if($this->allow_rewrite)
{
Router::proc();
}
// set locations for javascript use
if($_SERVER['REQUEST_METHOD'] == 'GET')
{
@ -488,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';
@ -1123,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
@ -1254,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
*
@ -1283,31 +1329,39 @@ class Context
$val = array($val);
}
$result = array();
foreach($val as $k => $v)
{
$k = htmlentities($k);
if($key === 'page' || $key === 'cpage' || substr_compare($key, 'srl', -3) === 0)
{
$val[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
$result[$k] = !preg_match('/^[0-9,]+$/', $v) ? (int) $v : $v;
}
elseif($key === 'mid' || $key === 'vid' || $key === 'search_keyword')
elseif($key === 'mid' || $key === 'search_keyword')
{
$val[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
$result[$k] = htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', FALSE);
}
elseif($key === 'vid')
{
$result[$k] = urlencode($v);
}
else
{
$result[$k] = $v;
if($do_stripslashes && version_compare(PHP_VERSION, '5.9.0', '<') && get_magic_quotes_gpc())
{
$v = stripslashes($v);
$result[$k] = stripslashes($result[$k]);
}
if(!is_array($v))
if(!is_array($result[$k]))
{
$val[$k] = trim($v);
$result[$k] = trim($result[$k]);
}
}
}
return $isArray ? $val : $val[0];
return $isArray ? $result : $result[0];
}
/**
@ -1404,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;
}
/**
@ -1568,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)
@ -1606,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

@ -447,7 +447,8 @@ class DB
$log['act'] = Context::get('act');
$log['time'] = date('Y-m-d H:i:s');
$bt = debug_backtrace();
$bt = version_compare(PHP_VERSION, '5.3.6', '>=') ? debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) : debug_backtrace();
foreach($bt as $no => $call)
{
if($call['function'] == 'executeQuery' || $call['function'] == 'executeQueryArray')
@ -455,6 +456,7 @@ class DB
$call_no = $no;
$call_no++;
$log['called_file'] = $bt[$call_no]['file'].':'.$bt[$call_no]['line'];
$log['called_file'] = str_replace(_XE_PATH_ , '', $log['called_file']);
$call_no++;
$log['called_method'] = $bt[$call_no]['class'].$bt[$call_no]['type'].$bt[$call_no]['function'];
break;
@ -487,20 +489,12 @@ class DB
$this->setQueryLog($log);
// if __LOG_SLOW_QUERY__ if defined, check elapsed time and leave query log
if(__LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
{
$buff = '';
$log_file = _XE_PATH_ . 'files/_db_slow_query.php';
if(!file_exists($log_file))
{
$buff = '<?php exit(); ?' . '>' . "\n";
}
$buff .= sprintf("%s\t%s\n\t%0.6f sec\tquery_id:%s\n\n", date("Y-m-d H:i"), $this->query, $elapsed_time, $this->query_id);
@file_put_contents($log_file, $buff, FILE_APPEND|LOCK_EX);
}
$log_args = new stdClass;
$log_args->query = $this->query;
$log_args->query_id = $this->query_id;
$log_args->caller = $log['called_method'] . '() in ' . $log['called_file'];
$log_args->connection = $log['connection'];
writeSlowlog('query', $elapsed_time, $log_args);
}
/**

View file

@ -126,6 +126,8 @@ class DisplayHandler extends Handler
// call a trigger after display
ModuleHandler::triggerCall('display', 'after', $output);
flushSlowlog();
}
/**
@ -292,7 +294,7 @@ class DisplayHandler extends Handler
$buff = 'The IP address is not allowed. Change the value of __DEBUG_PROTECT_IP__ into your IP address in config/config.user.inc.php or config/config.inc.php';
}
return "<!--\r\n" . implode("\r\n", $buff) . "\r\n-->";
return "<!--\r\n" . $buff . "\r\n-->";
}
// Output to a file

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

@ -297,7 +297,7 @@ class ExtraItem
return ($value) ? sprintf('<a href="mailto:%s">%s</a>', $value, $value) : "";
case 'tel' :
return sprintf('%s - %s - %s', $value[0], $value[1], $value[2]);
return sprintf('%s-%s-%s', $value[0], $value[1], $value[2]);
case 'textarea' :
return nl2br($value);

View file

@ -138,7 +138,7 @@ class FileHandler
* Write $buff into the specified file
*
* @param string $filename Path of target file
* @param string $buff Content to be writeen
* @param string $buff Content to be written
* @param string $mode a(append) / w(write)
* @return void
*/
@ -510,7 +510,7 @@ class FileHandler
* @param int $timeout Connection timeout
* @param string $method GET/POST
* @param string $content_type Content type header of HTTP request
* @param string[] $headers Headers key vaule array.
* @param string[] $headers Headers key value array.
* @param string[] $cookies Cookies key value array.
* @param string $post_data Request arguments array for POST method
* @return string If success, the content of the target file. Otherwise: none
@ -612,12 +612,12 @@ class FileHandler
* @param string $timeout Connection timeout
* @param string $method GET/POST
* @param string $content_type Content type header of HTTP request
* @param string[] $headers Headers key vaule array.
* @param string[] $headers Headers key value array.
* @return bool TRUE: success, FALSE: failed
*/
function getRemoteFile($url, $target_filename, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array())
function getRemoteFile($url, $target_filename, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array(), $request_config = array())
{
if(!($body = self::getRemoteResource($url, $body, $timeout, $method, $content_type, $headers)))
if(!($body = self::getRemoteResource($url, $body, $timeout, $method, $content_type, $headers,$cookies,$post_data,$request_config)))
{
return FALSE;
}

View file

@ -579,7 +579,7 @@ class ModuleHandler extends Handler
if($kind == 'admin')
{
$grant = $oModuleModel->getGrant($this->module_info, $logged_info);
if(!$grant->is_admin && !$grant->manager)
if(!$grant->manager)
{
$this->_setInputErrorToContext();
$this->error = 'msg_is_not_manager';
@ -589,6 +589,19 @@ class ModuleHandler extends Handler
$oMessageObject->dispMessage();
return $oMessageObject;
}
else
{
if(!$grant->is_admin && $this->module != $this->orig_module->module && $xml_info->permission->{$this->act} != 'manager')
{
$this->_setInputErrorToContext();
$this->error = 'msg_is_not_administrator';
$oMessageObject = ModuleHandler::getModuleInstance('message', 'view');
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
return $oMessageObject;
}
}
}
}
else if($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act))
@ -1147,6 +1160,13 @@ class ModuleHandler extends Handler
{
return new Object();
}
//store before trigger call time
$before_trigger_time = NULL;
if(__LOG_SLOW_TRIGGER__> 0)
{
$before_trigger_time = microtime(true);
}
foreach($triggers as $item)
{
@ -1161,7 +1181,19 @@ class ModuleHandler extends Handler
continue;
}
$before_each_trigger_time = microtime(true);
$output = $oModule->{$called_method}($obj);
$after_each_trigger_time = microtime(true);
$elapsed_time_trigger = $after_each_trigger_time - $before_each_trigger_time;
$slowlog = new stdClass;
$slowlog->caller = $trigger_name . '.' . $called_position;
$slowlog->called = $module . '.' . $called_method;
$slowlog->called_extension = $module;
if($trigger_name != 'XE.writeSlowlog') writeSlowlog('trigger', $elapsed_time_trigger, $slowlog);
if(is_object($output) && method_exists($output, 'toBool') && !$output->toBool())
{
return $output;

View file

@ -22,7 +22,7 @@ class ModuleObject extends Object
var $layout_path = ''; ///< a path of directory where layout files reside
var $layout_file = ''; ///< name of layout file
var $edited_layout_file = ''; ///< name of temporary layout files that is modified in an admin mode
var $stop_proc = false; ///< a flag to indicating whether to stop the execution of code.
var $stop_proc = FALSE; ///< a flag to indicating whether to stop the execution of code.
var $module_config = NULL;
var $ajaxRequestMethod = array('XMLRPC', 'JSON');
var $gzhandler_enable = TRUE;
@ -385,7 +385,7 @@ class ModuleObject extends Object
if($this->stop_proc)
{
debugPrint($this->message, 'ERROR');
return false;
return FALSE;
}
// trigger call
@ -394,7 +394,7 @@ class ModuleObject extends Object
{
$this->setError($triggerOutput->getError());
$this->setMessage($triggerOutput->getMessage());
return false;
return FALSE;
}
// execute an addon(call called_position as before_module_proc)
@ -444,7 +444,7 @@ class ModuleObject extends Object
}
else
{
return false;
return FALSE;
}
// trigger call
@ -453,7 +453,7 @@ class ModuleObject extends Object
{
$this->setError($triggerOutput->getError());
$this->setMessage($triggerOutput->getMessage());
return false;
return FALSE;
}
// execute an addon(call called_position as after_module_proc)
@ -469,7 +469,7 @@ class ModuleObject extends Object
if(!$output->toBool())
{
return false;
return FALSE;
}
}
// execute api methos of the module if view action is and result is XMLRPC or JSON
@ -484,8 +484,9 @@ class ModuleObject extends Object
}
}
}
return true;
return TRUE;
}
}
?>
/* End of file ModuleObject.class.php */
/* Location: ./classes/module/ModuleObject.class.php */

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

@ -14,19 +14,17 @@
<pattern>http://flvs.daum.net/flvPlayer.swf</pattern>
<pattern>http://api.v.daum.net/</pattern>
<pattern>http://tvpot.daum.net/playlist/playlist.swf</pattern>
<pattern>http://videofarm.daum.net/</pattern>
</domain>
<domain name="http://www.youtube.com" desc="Youtube">
<pattern>http://www.youtube.com/v/</pattern>
<pattern>http://www.youtube.com/</pattern>
<pattern>https://www.youtube.com/</pattern>
<pattern>http://www.youtube-nocookie.com/</pattern>
<pattern>//www.youtube.com/v/</pattern>
<pattern>//www.youtube-nocookie.com/</pattern>
<pattern>//www.youtube.com/embed/</pattern>
<pattern>https://www.youtube-nocookie.com/</pattern>
</domain>
<domain name="http://www.mgoon.com" desc="엠군">
<pattern>http://play.mgoon.com/Video/</pattern>
<pattern>http://play.mgoon.com/</pattern>
<pattern>http://doc.mgoon.com/player/</pattern>
<pattern>http://play.mgoon.com/Game/</pattern>
<pattern>http://play.mgoon.com/Photo/</pattern>
</domain>
<domain name="http://www.pandora.tv" desc="판도라TV">
<pattern>http://flvr.pandora.tv/flv2pan/</pattern>
@ -53,7 +51,7 @@
<pattern>http://vmark.kbs.co.kr/zzim/vmplayer/vmplayer.xap</pattern>
</domain>
<domain name="http://www.sbs.co.kr" desc="SBS">
<pattern>http://netv.sbs.co.kr/sbox/silverlight/ClientBin/NeTVPlayer.xap</pattern>
<pattern>http://netv.sbs.co.kr/sbox/</pattern>
<pattern>http://news.sbs.co.kr/</pattern>
<pattern>http://wizard2.sbs.co.kr/</pattern>
<pattern>http://sbsplayer.sbs.co.kr/</pattern>
@ -62,7 +60,7 @@
<pattern>http://onemore.imbc.com/ClientBin/oneplus.xap</pattern>
</domain>
<domain name="" isNAVER="true" desc="socialsearch">
<pattern>http://static.campaign.naver.com/0/campaign/2010/10/socialsearch/swf/</pattern>
<pattern>http://static.campaign.naver.com/</pattern>
</domain>
</embed>
<iframe>
@ -71,9 +69,6 @@
<pattern>https://www.youtube.com/</pattern>
<pattern>http://www.youtube-nocookie.com/</pattern>
<pattern>https://www.youtube-nocookie.com/</pattern>
<pattern>//www.youtube.com/v/</pattern>
<pattern>//www.youtube.com/embed/</pattern>
<pattern>//www.youtube-nocookie.com/</pattern>
</domain>
<domain name="http://maps.google.com" desc="구글맵스" mobile="true">
<pattern>http://maps.google.com/</pattern>
@ -88,5 +83,8 @@
<domain name="http://www.vimeo.com" desc="vimeo.com">
<pattern>http://player.vimeo.com/</pattern>
</domain>
<domain name="http://tvcast.naver.com" isNAVER="true" desc="NAVER TVCAST">
<pattern>http://serviceapi.rmcnmv.naver.com/</pattern>
</domain>
</iframe>
</whiteurl>

View file

@ -714,7 +714,7 @@ class Validator
{
$name = strtolower($name);
if(strpos('email,userid,url,alpha,alpha_number,number,', $name . ',') !== false)
if(in_array($name, array('email', 'userid', 'url', 'alpha', 'alpha_number', 'number')))
{
continue;
}

View file

@ -88,7 +88,7 @@ class ConditionTag
{
if(isset($condition->attrs->default))
{
$operationList = array('in' => 1, 'between' => 1, 'not in' => 1);
$operationList = array('in' => 1, 'between' => 1, 'notin' => 1, 'not_in' => 1);
if(isset($operationList[$this->operation]))
{
$default_value = $condition->attrs->default;

View file

@ -416,7 +416,7 @@ function _displayMultimedia(src, width, height, options) {
if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(src)){
html = '<img src="'+src+'" width="'+width+'" height="'+height+'" />';
} else if(/\.flv$/i.test(src) || /\.mov$/i.test(src) || /\.moov$/i.test(src) || /\.m4v$/i.test(src)) {
html = '<embed src="'+request_uri+'common/img/flvplayer.swf" allowfullscreen="true" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="&file='+src+'&width='+width+'&height='+height+'&autostart='+autostart+'" wmode="'+params.wmode+'" />';
html = '<embed src="'+request_uri+'common/img/flvplayer.swf" allowfullscreen="true" allowscriptaccess="never" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="&file='+src+'&width='+width+'&height='+height+'&autostart='+autostart+'" wmode="'+params.wmode+'" />';
} else if(/\.swf/i.test(src)) {
clsid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
@ -429,14 +429,14 @@ function _displayMultimedia(src, width, height, options) {
html += '<param name="'+name+'" value="'+params[name]+'" />';
}
}
html += '' + '<embed src="'+src+'" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="'+params.flashvars+'" wmode="'+params.wmode+'"></embed>' + '</object>';
html += '' + '<embed src="'+src+'" allowscriptaccess="never" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="'+params.flashvars+'" wmode="'+params.wmode+'"></embed>' + '</object>';
} else {
if (jQuery.browser.mozilla || jQuery.browser.opera) {
// firefox and opera uses 0 or 1 for autostart parameter.
autostart = (params.autostart && params.autostart != 'false') ? '1' : '0';
}
html = '<embed src="'+src+'" autostart="'+autostart+'" width="'+width+'" height="'+height+'"';
html = '<embed src="'+src+'" allowscriptaccess="never" autostart="'+autostart+'" width="'+width+'" height="'+height+'"';
if(params.wmode == 'transparent') {
html += ' windowlessvideo="1"';
}
@ -609,9 +609,20 @@ function doDocumentSelect(document_srl, module) {
// 게시글을 가져와서 등록하기
switch(module) {
case 'page' :
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispPageAdminContentModify');
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 :
default :
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
break;
}
@ -911,7 +922,7 @@ function get_by_id(id) {
jQuery(function($){
// display popup menu that contains member actions and document actions
$(document).click(function(evt) {
$(document).on('click', function(evt) {
var $area = $('#popup_menu_area');
if(!$area.length) $area = $('<div id="popup_menu_area" tabindex="0" style="display:none;z-index:9999" />').appendTo(document.body);
@ -927,6 +938,18 @@ jQuery(function($){
if(cls) match = cls.match(new RegExp('(?:^| )((document|comment|member)_([1-9]\\d*))(?: |$)',''));
if(!match) return;
// mobile에서 touchstart에 의한 동작 시 pageX, pageY 위치를 구함
if(evt.pageX===undefined || evt.pageY===undefined)
{
var touch = evt.originalEvent.touches[0];
if(touch!==undefined || !touch)
{
touch = evt.originalEvent.changedTouches[0];
}
evt.pageX = touch.pageX;
evt.pageY = touch.pageY;
}
var action = 'get'+ucfirst(match[2])+'Menu';
var params = {
mid : current_mid,

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

View file

@ -0,0 +1,660 @@
/*!
handlebars v2.0.0
Copyright (C) 2011-2014 by Yehuda Katz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@license
*/
/* exported Handlebars */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.Handlebars = root.Handlebars || factory();
}
}(this, function () {
// handlebars/safe-string.js
var __module3__ = (function() {
"use strict";
var __exports__;
// Build out our basic SafeString type
function SafeString(string) {
this.string = string;
}
SafeString.prototype.toString = function() {
return "" + this.string;
};
__exports__ = SafeString;
return __exports__;
})();
// handlebars/utils.js
var __module2__ = (function(__dependency1__) {
"use strict";
var __exports__ = {};
/*jshint -W004 */
var SafeString = __dependency1__;
var escape = {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
'"': "&quot;",
"'": "&#x27;",
"`": "&#x60;"
};
var badChars = /[&<>"'`]/g;
var possible = /[&<>"'`]/;
function escapeChar(chr) {
return escape[chr];
}
function extend(obj /* , ...source */) {
for (var i = 1; i < arguments.length; i++) {
for (var key in arguments[i]) {
if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
obj[key] = arguments[i][key];
}
}
}
return obj;
}
__exports__.extend = extend;var toString = Object.prototype.toString;
__exports__.toString = toString;
// Sourced from lodash
// https://github.com/bestiejs/lodash/blob/master/LICENSE.txt
var isFunction = function(value) {
return typeof value === 'function';
};
// fallback for older versions of Chrome and Safari
/* istanbul ignore next */
if (isFunction(/x/)) {
isFunction = function(value) {
return typeof value === 'function' && toString.call(value) === '[object Function]';
};
}
var isFunction;
__exports__.isFunction = isFunction;
/* istanbul ignore next */
var isArray = Array.isArray || function(value) {
return (value && typeof value === 'object') ? toString.call(value) === '[object Array]' : false;
};
__exports__.isArray = isArray;
function escapeExpression(string) {
// don't escape SafeStrings, since they're already safe
if (string instanceof SafeString) {
return string.toString();
} else if (string == null) {
return "";
} else if (!string) {
return string + '';
}
// Force a string conversion as this will be done by the append regardless and
// the regex test will do this transparently behind the scenes, causing issues if
// an object's to string has escaped characters in it.
string = "" + string;
if(!possible.test(string)) { return string; }
return string.replace(badChars, escapeChar);
}
__exports__.escapeExpression = escapeExpression;function isEmpty(value) {
if (!value && value !== 0) {
return true;
} else if (isArray(value) && value.length === 0) {
return true;
} else {
return false;
}
}
__exports__.isEmpty = isEmpty;function appendContextPath(contextPath, id) {
return (contextPath ? contextPath + '.' : '') + id;
}
__exports__.appendContextPath = appendContextPath;
return __exports__;
})(__module3__);
// handlebars/exception.js
var __module4__ = (function() {
"use strict";
var __exports__;
var errorProps = ['description', 'fileName', 'lineNumber', 'message', 'name', 'number', 'stack'];
function Exception(message, node) {
var line;
if (node && node.firstLine) {
line = node.firstLine;
message += ' - ' + line + ':' + node.firstColumn;
}
var tmp = Error.prototype.constructor.call(this, message);
// Unfortunately errors are not enumerable in Chrome (at least), so `for prop in tmp` doesn't work.
for (var idx = 0; idx < errorProps.length; idx++) {
this[errorProps[idx]] = tmp[errorProps[idx]];
}
if (line) {
this.lineNumber = line;
this.column = node.firstColumn;
}
}
Exception.prototype = new Error();
__exports__ = Exception;
return __exports__;
})();
// handlebars/base.js
var __module1__ = (function(__dependency1__, __dependency2__) {
"use strict";
var __exports__ = {};
var Utils = __dependency1__;
var Exception = __dependency2__;
var VERSION = "2.0.0";
__exports__.VERSION = VERSION;var COMPILER_REVISION = 6;
__exports__.COMPILER_REVISION = COMPILER_REVISION;
var REVISION_CHANGES = {
1: '<= 1.0.rc.2', // 1.0.rc.2 is actually rev2 but doesn't report it
2: '== 1.0.0-rc.3',
3: '== 1.0.0-rc.4',
4: '== 1.x.x',
5: '== 2.0.0-alpha.x',
6: '>= 2.0.0-beta.1'
};
__exports__.REVISION_CHANGES = REVISION_CHANGES;
var isArray = Utils.isArray,
isFunction = Utils.isFunction,
toString = Utils.toString,
objectType = '[object Object]';
function HandlebarsEnvironment(helpers, partials) {
this.helpers = helpers || {};
this.partials = partials || {};
registerDefaultHelpers(this);
}
__exports__.HandlebarsEnvironment = HandlebarsEnvironment;HandlebarsEnvironment.prototype = {
constructor: HandlebarsEnvironment,
logger: logger,
log: log,
registerHelper: function(name, fn) {
if (toString.call(name) === objectType) {
if (fn) { throw new Exception('Arg not supported with multiple helpers'); }
Utils.extend(this.helpers, name);
} else {
this.helpers[name] = fn;
}
},
unregisterHelper: function(name) {
delete this.helpers[name];
},
registerPartial: function(name, partial) {
if (toString.call(name) === objectType) {
Utils.extend(this.partials, name);
} else {
this.partials[name] = partial;
}
},
unregisterPartial: function(name) {
delete this.partials[name];
}
};
function registerDefaultHelpers(instance) {
instance.registerHelper('helperMissing', function(/* [args, ]options */) {
if(arguments.length === 1) {
// A missing field in a {{foo}} constuct.
return undefined;
} else {
// Someone is actually trying to call something, blow up.
throw new Exception("Missing helper: '" + arguments[arguments.length-1].name + "'");
}
});
instance.registerHelper('blockHelperMissing', function(context, options) {
var inverse = options.inverse,
fn = options.fn;
if(context === true) {
return fn(this);
} else if(context === false || context == null) {
return inverse(this);
} else if (isArray(context)) {
if(context.length > 0) {
if (options.ids) {
options.ids = [options.name];
}
return instance.helpers.each(context, options);
} else {
return inverse(this);
}
} else {
if (options.data && options.ids) {
var data = createFrame(options.data);
data.contextPath = Utils.appendContextPath(options.data.contextPath, options.name);
options = {data: data};
}
return fn(context, options);
}
});
instance.registerHelper('each', function(context, options) {
if (!options) {
throw new Exception('Must pass iterator to #each');
}
var fn = options.fn, inverse = options.inverse;
var i = 0, ret = "", data;
var contextPath;
if (options.data && options.ids) {
contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]) + '.';
}
if (isFunction(context)) { context = context.call(this); }
if (options.data) {
data = createFrame(options.data);
}
if(context && typeof context === 'object') {
if (isArray(context)) {
for(var j = context.length; i<j; i++) {
if (data) {
data.index = i;
data.first = (i === 0);
data.last = (i === (context.length-1));
if (contextPath) {
data.contextPath = contextPath + i;
}
}
ret = ret + fn(context[i], { data: data });
}
} else {
for(var key in context) {
if(context.hasOwnProperty(key)) {
if(data) {
data.key = key;
data.index = i;
data.first = (i === 0);
if (contextPath) {
data.contextPath = contextPath + key;
}
}
ret = ret + fn(context[key], {data: data});
i++;
}
}
}
}
if(i === 0){
ret = inverse(this);
}
return ret;
});
instance.registerHelper('if', function(conditional, options) {
if (isFunction(conditional)) { conditional = conditional.call(this); }
// Default behavior is to render the positive path if the value is truthy and not empty.
// The `includeZero` option may be set to treat the condtional as purely not empty based on the
// behavior of isEmpty. Effectively this determines if 0 is handled by the positive path or negative.
if ((!options.hash.includeZero && !conditional) || Utils.isEmpty(conditional)) {
return options.inverse(this);
} else {
return options.fn(this);
}
});
instance.registerHelper('unless', function(conditional, options) {
return instance.helpers['if'].call(this, conditional, {fn: options.inverse, inverse: options.fn, hash: options.hash});
});
instance.registerHelper('with', function(context, options) {
if (isFunction(context)) { context = context.call(this); }
var fn = options.fn;
if (!Utils.isEmpty(context)) {
if (options.data && options.ids) {
var data = createFrame(options.data);
data.contextPath = Utils.appendContextPath(options.data.contextPath, options.ids[0]);
options = {data:data};
}
return fn(context, options);
} else {
return options.inverse(this);
}
});
instance.registerHelper('log', function(message, options) {
var level = options.data && options.data.level != null ? parseInt(options.data.level, 10) : 1;
instance.log(level, message);
});
instance.registerHelper('lookup', function(obj, field) {
return obj && obj[field];
});
}
var logger = {
methodMap: { 0: 'debug', 1: 'info', 2: 'warn', 3: 'error' },
// State enum
DEBUG: 0,
INFO: 1,
WARN: 2,
ERROR: 3,
level: 3,
// can be overridden in the host environment
log: function(level, message) {
if (logger.level <= level) {
var method = logger.methodMap[level];
if (typeof console !== 'undefined' && console[method]) {
console[method].call(console, message);
}
}
}
};
__exports__.logger = logger;
var log = logger.log;
__exports__.log = log;
var createFrame = function(object) {
var frame = Utils.extend({}, object);
frame._parent = object;
return frame;
};
__exports__.createFrame = createFrame;
return __exports__;
})(__module2__, __module4__);
// handlebars/runtime.js
var __module5__ = (function(__dependency1__, __dependency2__, __dependency3__) {
"use strict";
var __exports__ = {};
var Utils = __dependency1__;
var Exception = __dependency2__;
var COMPILER_REVISION = __dependency3__.COMPILER_REVISION;
var REVISION_CHANGES = __dependency3__.REVISION_CHANGES;
var createFrame = __dependency3__.createFrame;
function checkRevision(compilerInfo) {
var compilerRevision = compilerInfo && compilerInfo[0] || 1,
currentRevision = COMPILER_REVISION;
if (compilerRevision !== currentRevision) {
if (compilerRevision < currentRevision) {
var runtimeVersions = REVISION_CHANGES[currentRevision],
compilerVersions = REVISION_CHANGES[compilerRevision];
throw new Exception("Template was precompiled with an older version of Handlebars than the current runtime. "+
"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+compilerVersions+").");
} else {
// Use the embedded version info since the runtime doesn't know about this revision yet
throw new Exception("Template was precompiled with a newer version of Handlebars than the current runtime. "+
"Please update your runtime to a newer version ("+compilerInfo[1]+").");
}
}
}
__exports__.checkRevision = checkRevision;// TODO: Remove this line and break up compilePartial
function template(templateSpec, env) {
/* istanbul ignore next */
if (!env) {
throw new Exception("No environment passed to template");
}
if (!templateSpec || !templateSpec.main) {
throw new Exception('Unknown template object: ' + typeof templateSpec);
}
// Note: Using env.VM references rather than local var references throughout this section to allow
// for external users to override these as psuedo-supported APIs.
env.VM.checkRevision(templateSpec.compiler);
var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {
if (hash) {
context = Utils.extend({}, context, hash);
}
var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);
if (result == null && env.compile) {
var options = { helpers: helpers, partials: partials, data: data, depths: depths };
partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);
result = partials[name](context, options);
}
if (result != null) {
if (indent) {
var lines = result.split('\n');
for (var i = 0, l = lines.length; i < l; i++) {
if (!lines[i] && i + 1 === l) {
break;
}
lines[i] = indent + lines[i];
}
result = lines.join('\n');
}
return result;
} else {
throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
}
};
// Just add water
var container = {
lookup: function(depths, name) {
var len = depths.length;
for (var i = 0; i < len; i++) {
if (depths[i] && depths[i][name] != null) {
return depths[i][name];
}
}
},
lambda: function(current, context) {
return typeof current === 'function' ? current.call(context) : current;
},
escapeExpression: Utils.escapeExpression,
invokePartial: invokePartialWrapper,
fn: function(i) {
return templateSpec[i];
},
programs: [],
program: function(i, data, depths) {
var programWrapper = this.programs[i],
fn = this.fn(i);
if (data || depths) {
programWrapper = program(this, i, fn, data, depths);
} else if (!programWrapper) {
programWrapper = this.programs[i] = program(this, i, fn);
}
return programWrapper;
},
data: function(data, depth) {
while (data && depth--) {
data = data._parent;
}
return data;
},
merge: function(param, common) {
var ret = param || common;
if (param && common && (param !== common)) {
ret = Utils.extend({}, common, param);
}
return ret;
},
noop: env.VM.noop,
compilerInfo: templateSpec.compiler
};
var ret = function(context, options) {
options = options || {};
var data = options.data;
ret._setup(options);
if (!options.partial && templateSpec.useData) {
data = initData(context, data);
}
var depths;
if (templateSpec.useDepths) {
depths = options.depths ? [context].concat(options.depths) : [context];
}
return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);
};
ret.isTop = true;
ret._setup = function(options) {
if (!options.partial) {
container.helpers = container.merge(options.helpers, env.helpers);
if (templateSpec.usePartial) {
container.partials = container.merge(options.partials, env.partials);
}
} else {
container.helpers = options.helpers;
container.partials = options.partials;
}
};
ret._child = function(i, data, depths) {
if (templateSpec.useDepths && !depths) {
throw new Exception('must pass parent depths');
}
return program(container, i, templateSpec[i], data, depths);
};
return ret;
}
__exports__.template = template;function program(container, i, fn, data, depths) {
var prog = function(context, options) {
options = options || {};
return fn.call(container, context, container.helpers, container.partials, options.data || data, depths && [context].concat(depths));
};
prog.program = i;
prog.depth = depths ? depths.length : 0;
return prog;
}
__exports__.program = program;function invokePartial(partial, name, context, helpers, partials, data, depths) {
var options = { partial: true, helpers: helpers, partials: partials, data: data, depths: depths };
if(partial === undefined) {
throw new Exception("The partial " + name + " could not be found");
} else if(partial instanceof Function) {
return partial(context, options);
}
}
__exports__.invokePartial = invokePartial;function noop() { return ""; }
__exports__.noop = noop;function initData(context, data) {
if (!data || !('root' in data)) {
data = data ? createFrame(data) : {};
data.root = context;
}
return data;
}
return __exports__;
})(__module2__, __module4__, __module1__);
// handlebars.runtime.js
var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
"use strict";
var __exports__;
/*globals Handlebars: true */
var base = __dependency1__;
// Each of these augment the Handlebars object. No need to setup here.
// (This is done to easily share code between commonjs and browse envs)
var SafeString = __dependency2__;
var Exception = __dependency3__;
var Utils = __dependency4__;
var runtime = __dependency5__;
// For compatibility and usage outside of module systems, make the Handlebars object a namespace
var create = function() {
var hb = new base.HandlebarsEnvironment();
Utils.extend(hb, base);
hb.SafeString = SafeString;
hb.Exception = Exception;
hb.Utils = Utils;
hb.escapeExpression = Utils.escapeExpression;
hb.VM = runtime;
hb.template = function(spec) {
return runtime.template(spec, hb);
};
return hb;
};
var Handlebars = create();
Handlebars.create = create;
Handlebars['default'] = Handlebars;
__exports__ = Handlebars;
return __exports__;
})(__module1__, __module3__, __module4__, __module2__, __module5__);
return __module0__;
}));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
handlebars.runtime.min.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
handlebars.min.js

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

View file

@ -1,8 +1,831 @@
/*! Copyright (C) NAVER <http://www.navercorp.com> */
/**!
* @file common.js + js_app.js + xml_handler.js + xml_js_filter.js
* @brief XE Common JavaScript
* @concat modernizr.js + common.js + js_app.js + xml_handler.js + xml_js_filter.js
* @brief XE Common JavaScript
**/
;
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));};
;
/* jQuery 참조변수($) 제거 */
if(jQuery) jQuery.noConflict();
@ -415,7 +1238,7 @@ function _displayMultimedia(src, width, height, options) {
if(/\.(gif|jpg|jpeg|bmp|png)$/i.test(src)){
html = '<img src="'+src+'" width="'+width+'" height="'+height+'" />';
} else if(/\.flv$/i.test(src) || /\.mov$/i.test(src) || /\.moov$/i.test(src) || /\.m4v$/i.test(src)) {
html = '<embed src="'+request_uri+'common/img/flvplayer.swf" allowfullscreen="true" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="&file='+src+'&width='+width+'&height='+height+'&autostart='+autostart+'" wmode="'+params.wmode+'" />';
html = '<embed src="'+request_uri+'common/img/flvplayer.swf" allowfullscreen="true" allowscriptaccess="never" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="&file='+src+'&width='+width+'&height='+height+'&autostart='+autostart+'" wmode="'+params.wmode+'" />';
} else if(/\.swf/i.test(src)) {
clsid = 'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000';
@ -428,14 +1251,14 @@ function _displayMultimedia(src, width, height, options) {
html += '<param name="'+name+'" value="'+params[name]+'" />';
}
}
html += '' + '<embed src="'+src+'" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="'+params.flashvars+'" wmode="'+params.wmode+'"></embed>' + '</object>';
html += '' + '<embed src="'+src+'" allowscriptaccess="never" autostart="'+autostart+'" width="'+width+'" height="'+height+'" flashvars="'+params.flashvars+'" wmode="'+params.wmode+'"></embed>' + '</object>';
} else {
if (jQuery.browser.mozilla || jQuery.browser.opera) {
// firefox and opera uses 0 or 1 for autostart parameter.
autostart = (params.autostart && params.autostart != 'false') ? '1' : '0';
}
html = '<embed src="'+src+'" autostart="'+autostart+'" width="'+width+'" height="'+height+'"';
html = '<embed src="'+src+'" allowscriptaccess="never" autostart="'+autostart+'" width="'+width+'" height="'+height+'"';
if(params.wmode == 'transparent') {
html += ' windowlessvideo="1"';
}
@ -608,9 +1431,20 @@ function doDocumentSelect(document_srl, module) {
// 게시글을 가져와서 등록하기
switch(module) {
case 'page' :
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispPageAdminContentModify');
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 :
default :
opener.location.href = opener.current_url.setQuery('document_srl', document_srl).setQuery('act', 'dispBoardWrite');
break;
}
@ -910,7 +1744,7 @@ function get_by_id(id) {
jQuery(function($){
// display popup menu that contains member actions and document actions
$(document).click(function(evt) {
$(document).on('click', function(evt) {
var $area = $('#popup_menu_area');
if(!$area.length) $area = $('<div id="popup_menu_area" tabindex="0" style="display:none;z-index:9999" />').appendTo(document.body);
@ -926,6 +1760,18 @@ jQuery(function($){
if(cls) match = cls.match(new RegExp('(?:^| )((document|comment|member)_([1-9]\\d*))(?: |$)',''));
if(!match) return;
// mobile에서 touchstart에 의한 동작 시 pageX, pageY 위치를 구함
if(evt.pageX===undefined || evt.pageY===undefined)
{
var touch = evt.originalEvent.touches[0];
if(touch!==undefined || !touch)
{
touch = evt.originalEvent.changedTouches[0];
}
evt.pageX = touch.pageX;
evt.pageY = touch.pageY;
}
var action = 'get'+ucfirst(match[2])+'Menu';
var params = {
mid : current_mid,
@ -1473,17 +2319,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();

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

@ -4,6 +4,7 @@
<value xml:lang="ko"><![CDATA[도움말]]></value>
<value xml:lang="en"><![CDATA[Help]]></value>
<value xml:lang="jp"><![CDATA[ヘルプ]]></value>
<value xml:lang="de"><![CDATA[Hilfe]]></value>
</item>
<item name="cmd_write">
<value xml:lang="ko"><![CDATA[쓰기]]></value>
@ -93,6 +94,7 @@
<value xml:lang="ko"><![CDATA[조회]]></value>
<value xml:lang="en"><![CDATA[Inquiry]]></value>
<value xml:lang="jp"><![CDATA[お問い合わせ]]></value>
<value xml:lang="de"><![CDATA[Ansichten]]></value>
</item>
<item name="all">
<value xml:lang="ko"><![CDATA[전체]]></value>
@ -100,6 +102,7 @@
<value xml:lang="jp"><![CDATA[すべて]]></value>
<value xml:lang="zh-CN"><![CDATA[全部]]></value>
<value xml:lang="zh-TW"><![CDATA[全部]]></value>
<value xml:lang="de"><![CDATA[Alle]]></value>
</item>
<item name="cmd_view_all">
<value xml:lang="ko"><![CDATA[전체 보기]]></value>
@ -1972,6 +1975,7 @@
<value xml:lang="jp"><![CDATA[非推奨数]]></value>
<value xml:lang="zh-CN"><![CDATA[Blames]]></value>
<value xml:lang="zh-TW"><![CDATA[Blames]]></value>
<value xml:lang="de"><![CDATA[Anzahl der Neinsager]]></value>
<value xml:lang="tr"><![CDATA[Suçlama]]></value>
</item>
<item name="comment_count">
@ -2176,7 +2180,7 @@
<value xml:lang="zh-CN"><![CDATA[版面管理]]></value>
<value xml:lang="zh-TW"><![CDATA[討論板管理]]></value>
<value xml:lang="fr"><![CDATA[Administration des Panneaux]]></value>
<value xml:lang="de"><![CDATA[Forum verwalten]]></value>
<value xml:lang="de"><![CDATA[Anschlagbrett verwalten]]></value>
<value xml:lang="ru"><![CDATA[Настройки форума]]></value>
<value xml:lang="es"><![CDATA[Adm. Tableros]]></value>
<value xml:lang="tr"><![CDATA[Yönetim Ayarları]]></value>
@ -2303,7 +2307,7 @@
<value xml:lang="jp"><![CDATA[その他]]></value>
<value xml:lang="zh-CN"><![CDATA[其他]]></value>
<value xml:lang="zh-TW"><![CDATA[其他]]></value>
<value xml:lang="de"><![CDATA[Sonstiges]]></value>
<value xml:lang="de"><![CDATA[Ander]]></value>
<value xml:lang="tr"><![CDATA[Diğer]]></value>
</item>
<item name="unit_sec">
@ -2394,6 +2398,7 @@
<value xml:lang="ko"><![CDATA[회]]></value>
<value xml:lang="en"><![CDATA[count]]></value>
<value xml:lang="jp"><![CDATA[回]]></value>
<value xml:lang="de"><![CDATA[Zeit]]></value>
</item>
<item name="unit_week" type="array">
<item name="Monday">
@ -2627,26 +2632,32 @@
<value xml:lang="ko"><![CDATA[IP주소 입력형식<br />1. 와일드카드(*) 사용가능(예: 192.168.0.*)<br />2. 하이픈(-)을 사용하여 대역으로 입력가능<br />(단, 대역폭으로 입력할 경우 와일드카드 사용불가. 예: 192.168.0.1-192.168.0.254)<br />3.여러개의 항목은 줄을 바꾸어 입력하세요]]></value>
<value xml:lang="en"><![CDATA[IP address input format<br />You can use wildcard(*) (ex: 192.168.0.*)<br />You can use hyphen(*) for ip range (you can't use wild card with hyphen, ex: 192.168.0.1-192.168.0.254)<br />]]></value>
<value xml:lang="jp"><![CDATA[IPアドレス入力方法<br />ワイルドカード使用可能192.168.0.*)<br />2.ハイフン(-)を使用して帯域で入力可能<br />ただし、帯域幅で入力する場合、ワイルドカードは使用不可。例192.168.0.1-192.168.0.254<br />3.複数の項目は行を変えて入力してください。]]></value>
<value xml:lang="de"><![CDATA[IP adresse eingabeformat<br />Sie können Platzhalter (*) verwenden (zB:. 192.168.0 *)<br />Sie können Bindestrich (*) für IP-Bereich nutzen (können Sie nicht wild card mit Bindestrich, ex: 192.168.0.1-192.168.0.254)]]></value>
</item>
<item name="msg_invalid_ip">
<value xml:lang="ko"><![CDATA[잘못된 IP주소 형식입니다.]]></value>
<value xml:lang="en"><![CDATA[Specified IP address is invalid.]]></value>
<value xml:lang="jp"><![CDATA[正しくないIPアドレス形式です。]]></value>
<value xml:lang="de"><![CDATA[Angegebenen IP adresse ist ungültig.]]></value>
</item>
<item name="msg_no_root">
<value xml:lang="ko"><![CDATA[루트는 선택 할 수 없습니다.]]></value>
<value xml:lang="en"><![CDATA[You cannot select a root.]]></value>
<value xml:lang="jp"><![CDATA[ルートは選択できません。]]></value>
<value xml:lang="de"><![CDATA[Sie können eine root nicht auswählen.]]></value>
</item>
<item name="msg_no_shortcut">
<value xml:lang="ko"><![CDATA[바로가기는 선택 할 수 없습니다.]]></value>
<value xml:lang="en"><![CDATA[You cannot select a shortcut.]]></value>
<value xml:lang="jp"><![CDATA[ショートカットは選択できません。]]></value>
<value xml:lang="de"><![CDATA[Sie können eine verknüpfung nicht auswählen.]]></value>
</item>
<item name="msg_select_menu">
<value xml:lang="ko"><![CDATA[대상 메뉴 선택]]></value>
<value xml:lang="en"><![CDATA[Select target menu]]></value>
<value xml:lang="jp"><![CDATA[対象メニュー選択]]></value>
<value xml:lang="de"><![CDATA[Wählen Sie das Menü, das Sie anwenden möchten]]></value>
</item>
<item name="msg_call_server">
<value xml:lang="ko"><![CDATA[서버에 요청 중입니다. 잠시만 기다려주세요.]]></value>
@ -2890,6 +2901,7 @@
<value xml:lang="jp"><![CDATA[検索対象がありません。]]></value>
<value xml:lang="zh-CN"><![CDATA[搜索不到目标]]></value>
<value xml:lang="zh-TW"><![CDATA[搜尋不到目標]]></value>
<value xml:lang="de"><![CDATA[Nicht finden können die das Suchziel.]]></value>
<value xml:lang="tr"><![CDATA[Arama amacı bulunamadı]]></value>
</item>
<item name="msg_empty_search_keyword">
@ -2898,6 +2910,7 @@
<value xml:lang="jp"><![CDATA[キーワードがありません。]]></value>
<value xml:lang="zh-CN"><![CDATA[搜索不到关键字]]></value>
<value xml:lang="zh-TW"><![CDATA[搜尋不到關鍵字]]></value>
<value xml:lang="de"><![CDATA[Nicht finden können das Stichwort.]]></value>
<value xml:lang="tr"><![CDATA[Anahtar kelime yok]]></value>
</item>
<item name="comment_to_be_approved">
@ -2905,6 +2918,7 @@
<value xml:lang="en"><![CDATA[Your comment must be approved by admin before being published.]]></value>
<value xml:lang="jp"><![CDATA[管理者の確認が必要なコメントです。]]></value>
<value xml:lang="zh-CN"><![CDATA[您的回复在通过管理员审核之后才会被显示出来。]]></value>
<value xml:lang="de"><![CDATA[Ihr Kommentar muss von admin vor der Veröffentlichung genehmigt werden.]]></value>
<value xml:lang="tr"><![CDATA[Yorumunuz, yayınlanmadan önce adminden onay almanız gerekir]]></value>
</item>
<item name="success_registed">
@ -2964,9 +2978,10 @@
<value xml:lang="mn"><![CDATA[Устгагдсан]]></value>
</item>
<item name="success_declare_canceled">
<value xml:lang="ko"><![CDATA[신고 취소되었습니다.]]></value>
<value xml:lang="ko"><![CDATA[신고 취소되었습니다.]]></value>
<value xml:lang="en"><![CDATA[Declare was canceled successfully.]]></value>
<value xml:lang="jp"><![CDATA[通報が取り消しされました。]]></value>
<value xml:lang="de"><![CDATA[Deklarieren wurde abgebrochen.]]></value>
</item>
<item name="success_restore">
<value xml:lang="ko"><![CDATA[복원했습니다.]]></value>
@ -3092,6 +3107,7 @@
<value xml:lang="ko"><![CDATA[수정하지 못했습니다.]]></value>
<value xml:lang="en"><![CDATA[Fail to update.]]></value>
<value xml:lang="jp"><![CDATA[修正されませんでした。]]></value>
<value xml:lang="de"><![CDATA[Update fehlgeschlagen]]></value>
<value xml:lang="tr"><![CDATA[Güncellenemedi]]></value>
</item>
<item name="fail_to_delete">
@ -3301,6 +3317,7 @@
<value xml:lang="ko"><![CDATA[처리하시겠습니까?]]></value>
<value xml:lang="en"><![CDATA[Are you sure you want to process?]]></value>
<value xml:lang="jp"><![CDATA[処理しますか?]]></value>
<value xml:lang="de"><![CDATA[Sind Sie sicher, dass Sie fortfahren möchten?]]></value>
</item>
<item name="column_type">
<value xml:lang="ko"><![CDATA[형식]]></value>
@ -3578,6 +3595,7 @@
<value xml:lang="jp"><![CDATA[%sの値が正しくありません。]]></value>
<value xml:lang="zh-CN"><![CDATA[%s值有误。]]></value>
<value xml:lang="zh-TW"><![CDATA[%s值有誤。]]></value>
<value xml:lang="de"><![CDATA[Der Wert% ist ungültig.]]></value>
<value xml:lang="tr"><![CDATA[%s değeri uymuyordur.]]></value>
</item>
<item name="invalid_email">
@ -3717,6 +3735,19 @@
<value xml:lang="mn"><![CDATA[%s-ын хэлбэр буруу байна. Зөвхөн тоогоор оруулах ёстой.]]></value>
</item>
</item>
<item name="security_invalid_session">
<value xml:lang="ko"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="en"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="jp"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="zh-CN"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="zh-TW"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="fr"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="de"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="es"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="tr"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="vi"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
<value xml:lang="mn"><![CDATA[바르지 않은 접근입니다. 인증을 위해 다시 로그인해야 합니다.]]></value>
</item>
<item name="security_warning_embed">
<value xml:lang="ko"><![CDATA[보안 문제로 관리자 아이디로는 embed를 볼 수 없습니다. 확인하려면 다른 아이디로 접속하세요]]></value>
<value xml:lang="en"><![CDATA[Due to security concern, administrators are not allowed to view embedded items.<BR /> To view them, please use another non-administrator ID.]]></value>
@ -3822,6 +3853,7 @@
<value xml:lang="ko"><![CDATA[모바일]]></value>
<value xml:lang="en"><![CDATA[Mobile]]></value>
<value xml:lang="jp"><![CDATA[モバイル]]></value>
<value xml:lang="de"><![CDATA[Handy]]></value>
</item>
<item name="mobile_view">
<value xml:lang="ko"><![CDATA[모바일 뷰 사용]]></value>
@ -3852,6 +3884,7 @@
<value xml:lang="en"><![CDATA[Simple View]]></value>
<value xml:lang="jp"><![CDATA[シンプルビュー]]></value>
<value xml:lang="zh-CN"><![CDATA[预览]]></value>
<value xml:lang="de"><![CDATA[einfache ansicht]]></value>
<value xml:lang="tr"><![CDATA[Basit Görünüm]]></value>
</item>
<item name="detail_view">
@ -3859,6 +3892,7 @@
<value xml:lang="en"><![CDATA[Detail View]]></value>
<value xml:lang="jp"><![CDATA[詳細ビュー]]></value>
<value xml:lang="zh-CN"><![CDATA[查看详情]]></value>
<value xml:lang="de"><![CDATA[detail ansicht]]></value>
<value xml:lang="tr"><![CDATA[Detaylı Görünüm]]></value>
</item>
<item name="more">
@ -3867,19 +3901,22 @@
<value xml:lang="jp"><![CDATA[もっと見る]]></value>
<value xml:lang="zh-CN"><![CDATA[更多]]></value>
<value xml:lang="zh-TW"><![CDATA[更多]]></value>
<value xml:lang="de"><![CDATA[mehr]]></value>
<value xml:lang="tr"><![CDATA[Daha Fazla]]></value>
<value xml:lang="vi"><![CDATA[Xem thêm]]></value>
</item>
<item name="skip_to_content">
<value xml:lang="ko"><![CDATA[메뉴 건너뛰기]]></value>
<value xml:lang="en"><![CDATA[Skip to content]]></value>
<value xml:lang="en"><![CDATA[Skip to menu]]></value>
<value xml:lang="jp"><![CDATA[メニュースキップ]]></value>
<value xml:lang="de"><![CDATA[Menü überspringen]]></value>
</item>
<item name="dashboard">
<value xml:lang="ko"><![CDATA[대시보드]]></value>
<value xml:lang="en"><![CDATA[Dashboard]]></value>
<value xml:lang="jp"><![CDATA[ダッシュボード]]></value>
<value xml:lang="zh-CN"><![CDATA[控制面板]]></value>
<value xml:lang="de"><![CDATA[Armaturenbrett]]></value>
<value xml:lang="tr"><![CDATA[Kontrol Paneli]]></value>
</item>
<item name="user">
@ -3887,21 +3924,41 @@
<value xml:lang="en"><![CDATA[Member]]></value>
<value xml:lang="jp"><![CDATA[会員]]></value>
<value xml:lang="zh-CN"><![CDATA[会员]]></value>
<value xml:lang="de"><![CDATA[Mitglied]]></value>
<value xml:lang="tr"><![CDATA[Üye]]></value>
</item>
<item name="yes">
<value xml:lang="ko"><![CDATA[예]]></value>
<value xml:lang="en"><![CDATA[Yes]]></value>
<value xml:lang="jp"><![CDATA[はい]]></value>
<value xml:lang="de"><![CDATA[ja]]></value>
</item>
<item name="not">
<value xml:lang="ko"><![CDATA[아니오]]></value>
<value xml:lang="en"><![CDATA[No]]></value>
<value xml:lang="jp"><![CDATA[いいえ]]></value>
<value xml:lang="de"><![CDATA[nicht]]></value>
</item>
<item name="msg_default_url_is_null">
<value xml:lang="ko"><![CDATA[기본 URL 설정이 안 되어 있습니다.]]></value>
<value xml:lang="en"><![CDATA[Default url is null.]]></value>
<value xml:lang="jp"><![CDATA[基本URLが設定されていません。]]></value>
<value xml:lang="de"><![CDATA[Standard URL ist null.]]></value>
</item>
<item name="license_agreement">
<value xml:lang="ko"><![CDATA[사용권 동의]]></value>
<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://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">
<value xml:lang="ko"><![CDATA[사용권에 대해 이해했으며, 이에 동의합니다.]]></value>
<value xml:lang="en"><![CDATA[I understand the license. I agree.]]></value>
</item>
<item name="msg_must_accept_license_agreement">
<value xml:lang="ko"><![CDATA[사용권에 동의해야 설치할 수 있습니다.]]></value>
<value xml:lang="en"><![CDATA[You must accept the license agreement]]></value>
</item>
</lang>

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.5.7');
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));
@ -87,6 +87,9 @@ else
* define('__DEBUG_PROTECT_IP__', '127.0.0.1');
* define('__DEBUG_DB_OUTPUT__', 0);
* define('__LOG_SLOW_QUERY__', 0);
* define('__LOG_SLOW_TRIGGER__', 0);
* define('__LOG_SLOW_ADDON__', 0);
* define('__LOG_SLOW_WIDGET__', 0);
* define('__OB_GZHANDLER_ENABLE__', 1);
* define('__ENABLE_PHPUNIT_TEST__', 0);
* define('__PROXY_SERVER__', 'http://domain:port/path');
@ -167,12 +170,54 @@ if(!defined('__LOG_SLOW_QUERY__'))
* <pre>
* 0: Do not leave a log
* = 0: leave a log when the slow query takes over specified seconds
* Log file is saved as ./files/_db_slow_query.php file
* Log file is saved as ./files/_slowlog_query.php file
* </pre>
*/
define('__LOG_SLOW_QUERY__', 0);
}
if(!defined('__LOG_SLOW_TRIGGER__'))
{
/**
* Trigger excute time log
*
* <pre>
* 0: Do not leave a log
* > 0: leave a log when the trigger takes over specified milliseconds
* Log file is saved as ./files/_slowlog_trigger.php
* </pre>
*/
define('__LOG_SLOW_TRIGGER__', 0);
}
if(!defined('__LOG_SLOW_ADDON__'))
{
/**
* Addon excute time log
*
* <pre>
* 0: Do not leave a log
* > 0: leave a log when the trigger takes over specified milliseconds
* Log file is saved as ./files/_slowlog_addon.php
* </pre>
*/
define('__LOG_SLOW_ADDON__', 0);
}
if(!defined('__LOG_SLOW_WIDGET__'))
{
/**
* Widget excute time log
*
* <pre>
* 0: Do not leave a log
* > 0: leave a log when the widget takes over specified milliseconds
* Log file is saved as ./files/_slowlog_widget.php
* </pre>
*/
define('__LOG_SLOW_WIDGET__', 0);
}
if(!defined('__DEBUG_QUERY__'))
{
/**
@ -254,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

@ -838,6 +838,83 @@ function debugPrint($debug_output = NULL, $display_option = TRUE, $file = '_debu
}
}
/**
* @param string $type query, trigger
* @param float $elapsed_time
* @param object $obj
*/
function writeSlowlog($type, $elapsed_time, $obj)
{
if(!__LOG_SLOW_TRIGGER__ && !__LOG_SLOW_ADDON__ && !__LOG_SLOW_WIDGET__ && !__LOG_SLOW_QUERY__) return;
static $log_filename = array(
'query' => 'files/_slowlog_query.php',
'trigger' => 'files/_slowlog_trigger.php',
'addon' => 'files/_slowlog_addon.php',
'widget' => 'files/_slowlog_widget.php'
);
$write_file = true;
$log_file = _XE_PATH_ . $log_filename[$type];
$buff = array();
$buff[] = '<?php exit(); ?>';
$buff[] = date('c');
if($type == 'trigger' && __LOG_SLOW_TRIGGER__ > 0 && $elapsed_time > __LOG_SLOW_TRIGGER__)
{
$buff[] = "\tCaller : " . $obj->caller;
$buff[] = "\tCalled : " . $obj->called;
}
else if($type == 'addon' && __LOG_SLOW_ADDON__ > 0 && $elapsed_time > __LOG_SLOW_ADDON__)
{
$buff[] = "\tAddon : " . $obj->called;
$buff[] = "\tCalled position : " . $obj->caller;
}
else if($type == 'widget' && __LOG_SLOW_WIDGET__ > 0 && $elapsed_time > __LOG_SLOW_WIDGET__)
{
$buff[] = "\tWidget : " . $obj->called;
}
else if($type == 'query' && __LOG_SLOW_QUERY__ > 0 && $elapsed_time > __LOG_SLOW_QUERY__)
{
$buff[] = $obj->query;
$buff[] = "\tQuery ID : " . $obj->query_id;
$buff[] = "\tCaller : " . $obj->caller;
$buff[] = "\tConnection : " . $obj->connection;
}
else
{
$write_file = false;
}
if($write_file)
{
$buff[] = sprintf("\t%0.6f sec", $elapsed_time);
$buff[] = PHP_EOL . PHP_EOL;
file_put_contents($log_file, implode(PHP_EOL, $buff), FILE_APPEND);
}
if($type != 'query')
{
$trigger_args = $obj;
$trigger_args->_log_type = $type;
$trigger_args->_elapsed_time = $elapsed_time;
ModuleHandler::triggerCall('XE.writeSlowlog', 'after', $trigger_args);
}
}
/**
* @param void
*/
function flushSlowlog()
{
$trigger_args = new stdClass();
$trigger_args->_log_type = 'flush';
$trigger_args->_elapsed_time = 0;
ModuleHandler::triggerCall('XE.writeSlowlog', 'after', $trigger_args);
}
/**
* microtime() return
*
@ -1428,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

@ -5,13 +5,10 @@
* @author NAVER (developers@xpressengine.com)
* @brief Start page
*
* Find and create module object by mif, act in Request Argument
* Set module information
*
* @mainpage XpressEngine
* @section intro introduction
*
* XE is an opensource and being developed in the opensource project.\n
* "XpressEngine (XE)" is an opensource and being developed in the opensource project.\n
* For more information, please see the link below.
* - Official website: http://www.xpressengine.com
* - Offcial Repository: https://github.com/xpressengine/xe-core
@ -21,7 +18,7 @@
* License as published by the Free Software Foundation; either \n
* version 2.1 of the License, or (at your option) any later version. \n
* \n
* This library is distributed in the hope that it will be useful,
* 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.

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

@ -100,6 +100,7 @@ class addonController extends addon
$mid_list = NULL;
}
$buff[] = '$before_time = microtime(true);';
$buff[] = '$rm = \'' . $extra_vars->xe_run_method . "';";
$buff[] = '$ml = array(';
if($mid_list)
@ -127,8 +128,13 @@ class addonController extends addon
$buff[] = 'if(isset($ml[$_m]) || count($ml) === 0){';
$buff[] = $addon_include;
$buff[] = '}}}';
$buff[] = '$after_time = microtime(true);';
$buff[] = '$addon_time_log = new stdClass();';
$buff[] = '$addon_time_log->caller = $called_position;';
$buff[] = '$addon_time_log->called = "' . $addon . '";';
$buff[] = '$addon_time_log->called_extension = "' . $addon . '";';
$buff[] = 'writeSlowlog("addon",$after_time-$before_time,$addon_time_log);';
}
$addon_path = _XE_PATH_ . 'files/cache/addons/';
FileHandler::makeDir($addon_path);
$addon_file = $addon_path . ($gtype == 'site' ? $site_srl : '') . $type . '.acivated_addons.cache.php';

View file

@ -61,6 +61,9 @@ class adminAdminController extends admin
FileHandler::rename('./files/cache', $temp_cache_dir);
FileHandler::makeDir('./files/cache');
// remove module extend cache
FileHandler::removeFile(_XE_PATH_ . 'files/config/module_extend.php');
// remove debug files
FileHandler::removeFile(_XE_PATH_ . 'files/_debug_message.php');
FileHandler::removeFile(_XE_PATH_ . 'files/_debug_db_query.php');

View file

@ -935,19 +935,18 @@ 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 = '';
if($site_info->site_srl)
@ -956,13 +955,14 @@ class adminAdminModel extends admin
}
$file_exsit = FileHandler::readFile(_XE_PATH_ . 'files/attach/xeicon/' . $virtual_site . $iconname);
if(!$file_exsit)
if(!$file_exsit && $default === true)
{
$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
}
elseif($file_exsit)
{
$icon_url = './modules/admin/tpl/img/' . $default_icon_name;
}
else
{
$icon_url = $db_info->default_url . 'files/attach/xeicon/' . $virtual_site . $iconname;
$default_url = Context::getDefaultUrl();
$icon_url = $default_url . 'files/attach/xeicon/' . $virtual_site . $iconname;
}
return $icon_url;
}

View file

@ -248,6 +248,9 @@ class adminAdminView extends admin
*/
function dispAdminIndex()
{
$db_info = Context::getDBInfo();
Context::set('db_info',$db_info);
// Get statistics
$args = new stdClass();
$args->date = date("Ymd000000", $_SERVER['REQUEST_TIME'] - 60 * 60 * 24);
@ -273,7 +276,6 @@ class adminAdminView extends admin
$oDocumentModel = getModel('document');
$columnList = array('document_srl', 'module_srl', 'category_srl', 'title', 'nick_name', 'member_srl');
$args->list_count = 5;
;
$output = $oDocumentModel->getDocumentList($args, FALSE, FALSE, $columnList);
Context::set('latestDocumentList', $output->data);
unset($args, $output, $columnList);
@ -381,6 +383,16 @@ class adminAdminView extends admin
$isEnviromentGatheringAgreement = TRUE;
}
Context::set('isEnviromentGatheringAgreement', $isEnviromentGatheringAgreement);
// license agreement check
$isLicenseAgreement = FALSE;
$path = FileHandler::getRealPath('./files/env/license_agreement');
$isLicenseAgreement = FALSE;
if(file_exists($path))
{
$isLicenseAgreement = TRUE;
}
Context::set('isLicenseAgreement', $isLicenseAgreement);
Context::set('layout', 'none');
$this->setTemplateFile('index');
@ -436,7 +448,7 @@ class adminAdminView extends admin
$oModuleModel = getModel('module');
$config = $oModuleModel->getModuleConfig('module');
Context::set('siteTitle', $config->siteTitle);
Context::set('htmlFooter', $config->htmlFooter);
Context::set('htmlFooter', htmlspecialchars($config->htmlFooter));
// embed filter
require_once(_XE_PATH_ . 'classes/security/EmbedFilter.class.php');
@ -515,7 +527,6 @@ class adminAdminView extends admin
$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server . $params);
Context::addHtmlFooter($img);
FileHandler::removeDir($path);
FileHandler::writeFile($path . $mainVersion, '1');
}
else if(isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path . $mainVersion)))
@ -528,7 +539,6 @@ class adminAdminView extends admin
Context::addHtmlFooter($img);
}
FileHandler::removeDir($path);
FileHandler::writeFile($path . $mainVersion, '1');
unset($_SESSION['enviroment_gather']);
}
@ -619,6 +629,7 @@ class adminAdminView extends admin
$info['PHP_Core'] = $php_core;
$str_info = "[XE Server Environment " . date("Y-m-d") . "]\n\n";
$str_info .= "realpath : ".realpath('./')."\n";
foreach( $info as $key=>$value )
{
if( is_array( $value ) == false ) {

View file

@ -1597,8 +1597,8 @@
<value xml:lang="jp"><![CDATA[HTMLタグを使用できます。]]></value>
</item>
<item name="sitelock_warning_whitelist">
<value xml:lang="ko"><![CDATA[이곳에 관리자의 IP를 반드시 포함해야 합니다.<br />만약 접근이 차단된 경우 './files/config/db.config.php' 파일에서 `'use_sitelock' => '<strong>Y</strong>'`를 `'use_sitelock' => '<strong>N</strong>'`으로 변경하여 차단을 해제할 수 있습니다.<br />사이트 잠금 디자인 파일의 위치는 './common/tpl/sitelock.html'이며<br />'./common/tpl/sitelock.user.html' 파일을 만들어서 디자인 파일을 편집하실 수 있습니다.]]></value>
<value xml:lang="en"><![CDATA[You should include the IP of the administrator here.<br />If the access is blocked, you can unbrick this by changing `'use_sitelock' => '<strong>Y</strong>'` to `'use_sitelock' => '<strong>N</strong>'` in './files/config/db.config.php.'<br />The file of site lock design is at './common/tpl/sitelock.html'.<br />You can modify design file by creating './common/tpl/sitelock.user.html'.]]></value>
<value xml:lang="ko"><![CDATA[이곳에 관리자의 IP를 반드시 포함해야 합니다.<br />만약 접근이 차단된 경우 './files/config/db.config.php' 파일에서 `'use_sitelock' => '<strong>Y</strong>'`를 `'use_sitelock' => '<strong>N</strong>'`으로 변경하여 차단을 해제할 수 있습니다.<br />사이트 잠금 디자인 파일의 위치는 './common/tpl/sitelock.html'니다.]]></value>
<value xml:lang="en"><![CDATA[You should include the IP of the administrator here.<br />If the access is blocked, you can unbrick this by changing `'use_sitelock' => '<strong>Y</strong>'` to `'use_sitelock' => '<strong>N</strong>'` in './files/config/db.config.php.'<br />The file of site lock design is at './common/tpl/sitelock.html.']]></value>
<value xml:lang="jp"><![CDATA[ここに管理者のIPを必ず記入てください。<br />もし接近が遮断された場合、'./files/config/db.config.php' ファイルから `'use_sitelock' => '<strong>Y</strong>'`を `'use_sitelock' => '<strong>N</strong>'`へ変更すれば遮断が解除できます。<br />サイトロックの設計ファイルの場所は、'./commo/tpl/sitelock.html' です。]]></value>
</item>
<item name="your_ip">
@ -1606,4 +1606,11 @@
<value xml:lang="en"><![CDATA[Your IP]]></value>
<value xml:lang="jp"><![CDATA[接続したIP]]></value>
</item>
<item name="sitelock_in_use">
<value xml:lang="ko"><![CDATA[사이트 잠금을 사용중입니다.]]></value>
<value xml:lang="en"><![CDATA[Site lock in use]]></value>
</item>
<item name="about_sitelock_in_use">
<value xml:lang="ko"><![CDATA[관리자 페이지에서 허용한 IP를 제외한 사용자는 접속할 수 없습니다.]]></value>
</item>
</lang>

View file

@ -10,12 +10,34 @@
<div class="x_page-header">
<h1>{$lang->control_panel} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_dashboard" target="_blank">{$lang->help}</a></h1>
</div>
<div id="checkBrowserMessage" class="message error" style="display:none;">
<h2>{$lang->checkBrowserIE8}</h2>
</div>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/admin/tpl/index/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<div class="message error" cond="$db_info->use_sitelock == 'Y'">
<h2>{$lang->sitelock_in_use}</h2>
<p>{$lang->about_sitelock_in_use}</p>
</div>
<form action="./" method="post" class="message info x_clearfix" cond="!$isLicenseAgreement">
<input type="hidden" name="success_return_url" value="{getUrl('', 'module', 'admin')}" />
<input type="hidden" name="module" value="install" />
<input type="hidden" name="act" value="procInstallLicenseAggrement" />
<input type="hidden" name="license_agreement" value="Y" />
<input type="hidden" name="XE_VALIDATOR_ID" value="modules/admin/tpl/index/1">
<h2>{$lang->license_agreement}</h2>
<div>{$lang->license}</div>
<div class="x_btn-group x_pull-right" style="margin-bottom:10px">
<button type="submit" class="x_btn x_btn-small x_btn-primary" value="">{$lang->cmd_license_agree}</button>
</div>
</form>
<form action="./" method="post" class="message info x_clearfix" cond="!$isEnviromentGatheringAgreement">
<input type="hidden" name="module" value="admin" />
<input type="hidden" name="act" value="procAdminEnviromentGatheringAgreement" />
@ -27,17 +49,19 @@
<button type="submit" name="is_agree" value="true" class="x_btn x_btn-small x_btn-primary">{$lang->agree}</button>
</div>
</form>
<div class="message update" cond="$addTables || $needUpdate">
<h2 cond="$needUpdate && $addTables">{$lang->need_update_and_table}</h2>
<h2 cond="$needUpdate && !$addTables">{$lang->need_update}</h2>
<h2 cond="!$needUpdate && $addTables">{$lang->need_table}</h2>
<ul>
<block loop="$module_list => $key,$value">
<li style="margin:0 0 4px 0" cond="$value->need_install">{$value->module} - <button type="button" onclick="doInstallModule('{$value->module}')" class="x_btn x_btn-small">{$lang->cmd_create_db_table}</button></li>
<li style="margin:0 0 4px 0" cond="$value->need_update">{$value->module} - <button type="button" onclick="doUpdateModule('{$value->module}')" class="x_btn x_btn-small">{$lang->cmd_module_update}</button></li>
</block>
<block loop="$module_list => $key,$value">
<li style="margin:0 0 4px 0" cond="$value->need_install">{$value->module} - <button type="button" onclick="doInstallModule('{$value->module}')" class="x_btn x_btn-small">{$lang->cmd_create_db_table}</button></li>
<li style="margin:0 0 4px 0" cond="$value->need_update">{$value->module} - <button type="button" onclick="doUpdateModule('{$value->module}')" class="x_btn x_btn-small">{$lang->cmd_module_update}</button></li>
</block>
</ul>
</div>
<div class="message update" cond="count($newVersionList)">
<h2>{$lang->available_new_version}</h2>
<ul>
@ -46,7 +70,7 @@
</li>
</ul>
</div>
<div class="dashboard">
<block cond="$counterAddonActivated">
<include target="./_dashboard_counter.html" />

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,aAAaS,IAAI,EAGlCD,GAAKE,cAAcC,MAFF,mBAAT,GAEmBJ,GAIvBC,EAAKE,cAAcC,OAA8B,mBAAdH,GAAS,MAAoBA,EAAKI,KAAKC,QAElDC,QAIA,GAI7B,IAAIC,KAEJA,GAAOC,SAAWhB,OAAO,aAAaG,MACtCY,EAAOE,aAAcjB,OAAO,iBAAiBG,MAC7CY,EAAOG,SAAWlB,OAAO,aAAaG,MACtCY,EAAOI,SAAWnB,OAAO,aAAaG,MACtCY,EAAOL,cAAgBV,OAAO,kBAAkBG,MAChDY,EAAOH,KAAOZ,OAAO,4BAA4BG,MAEjDiB,SAAS,QAAS,kBAAmBL,EAAQM,oBAAqB,OAAQ,QAAS,WAAYN,EAAQP,GAGxG,QAASc,iBAER,GAAIP,KACJK,UAAS,UAAW,gCAAiCL,EAAQQ,oBAAqB,QAAS,WAAYR,GAGxG,QAASM,oBAAmBG,GAE3B,GAAqB,IAAlBA,EAAQC,MAIV,MAFAC,OAAMF,EAAQC,WACdC,OAAMF,EAAQG,QAGf,IAAIC,GAAI5B,OAAO,kBAAkB6B,QAE7BC,EAAO,EACP9B,QAAO+B,QAAQP,EAAQM,KAAKE,QAE/BR,EAAQM,KAAKE,MAAQR,EAAQM,KAAKE,OAGnCzB,IAAMP,OAAO,aAAaS,IAAI,GAAGC,cAAcC,MACrC,KAAPJ,MAEF0B,IAAM1B,IAAI2B,MAAM,KAChBD,IAAIE,MACJF,IAAIE,MACJF,IAAIG,KAAK,IACTC,OAASJ,IAAIK,KAAK,KAClBR,EAAOA,EAAO,mDAAmDO,OAAO,yBAGzE,KAAI,GAAIE,GAAE,EAAEA,EAAEf,EAAQM,KAAKE,KAAKQ,OAAOD,IACvC,CACC,GAAIE,GAAIjB,EAAQM,KAAKE,KAAKO,EAClB,QAALE,GAIW,MAALA,IAMRX,EAAOA,EAAO,mDAAmDvB,IAAIkC,EAAE,QAAQA,EAAE,kBAGnFX,EAAO,OAAOA,EAAK,QACnBF,EAAEc,OAAO1C,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":"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"}

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,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,GAMIM,GAJAL,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,IAE/CH,SAASC,KAAOJ,EAGjB,QAASO,iBAAgBC,GAExBC,OAAO,OAAOC,SACdD,OAAO,SAASC,SAChBD,OAAO,QAAQE,SAASC,MAAMJ,EAAQK,MAGvC,QAASC,UAAShB,EAAciB,GAE/B,GAAIC,KACJA,GAAOC,MAAQF,EACfC,EAAOlB,aAAeA,EACtBkB,EAAOrB,IAAMuB,YACbT,OAAOU,UAAU,4BAA6BH,EAAQT,iBAGvD,QAASa,uBAAsB1B,GAE9B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdG,EAAeJ,EAAQI,aACvBiB,EAAOrB,EAAQqB,KAEff,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,eAAeJ,GAAcI,SAAS,MAAM,GAC5Fa,KAAMf,EAAMA,EAAIE,SAAS,OAAOa,IAEnCZ,SAASC,KAAOJ,EAGjB,QAASqB,wBAAuB3B,GAE/B,GAEIC,IAFQD,EAAQE,MACNF,EAAQG,QACZH,EAAQC,KACdoB,EAAOrB,EAAQqB,KAEff,EAAMC,YAAYC,SAAS,MAAMP,GAAKO,SAAS,MAAM,IAAIA,SAAS,eAAe,GAClFa,KAAMf,EAAMA,EAAIE,SAAS,OAAOa,IAEnCZ,SAASC,KAAOJ"}

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)">

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