mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 15:19:57 +09:00
merge from branch luminous (version 1.5.4.2, ~r12561)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@12611 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
2263200ce4
commit
cc47d2b247
196 changed files with 3655 additions and 2033 deletions
|
|
@ -22,7 +22,9 @@ RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/(rss|atom|api)$ ./index.php?vid=$1&
|
||||||
|
|
||||||
# trackback
|
# trackback
|
||||||
RewriteRule ^([0-9]+)/(.+)/trackback$ ./index.php?document_srl=$1&key=$2&act=trackback [L]
|
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_]+)/([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]
|
||||||
|
|
||||||
# administrator page
|
# administrator page
|
||||||
RewriteRule ^admin/?$ ./index.php?module=admin [L]
|
RewriteRule ^admin/?$ ./index.php?module=admin [L]
|
||||||
|
|
@ -47,3 +49,6 @@ RewriteRule ^([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?mid=$1&entry=$2 [L,QSA]
|
||||||
# vid + mid + entry title
|
# vid + mid + entry title
|
||||||
RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/entry/(.+)$ ./index.php?vid=$1&mid=$2&entry=$3 [L,QSA]
|
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]
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
.xe_content img { max-width:100%; height:auto; }
|
.xe_content img{max-width:100%;height:auto !important}
|
||||||
|
|
|
||||||
|
|
@ -90,10 +90,14 @@ function getScreen() {
|
||||||
|
|
||||||
$("#xe_gallery_controls,#xe_gallery_screen").css({
|
$("#xe_gallery_controls,#xe_gallery_screen").css({
|
||||||
display:"block",
|
display:"block",
|
||||||
width : clientWidth + "px",
|
width : $(document).width() + "px",
|
||||||
height : clientHeight + "px",
|
height : $(document).height() + "px",
|
||||||
left : $(document).scrollLeft(),
|
left : 0,
|
||||||
top : $(document).scrollTop()
|
top : 0
|
||||||
|
//width : clientWidth + "px",
|
||||||
|
//height : clientHeight + "px",
|
||||||
|
// left : $(document).scrollLeft(),
|
||||||
|
// top : $(document).scrollTop()
|
||||||
});
|
});
|
||||||
|
|
||||||
closebtn.css("left", Math.round((clientWidth-60)/2) + "px");
|
closebtn.css("left", Math.round((clientWidth-60)/2) + "px");
|
||||||
|
|
@ -126,8 +130,13 @@ function getScreen() {
|
||||||
if(!src) src = this.list.eq(this.index).attr("src");
|
if(!src) src = this.list.eq(this.index).attr("src");
|
||||||
|
|
||||||
imgframe.attr("src", src).css({
|
imgframe.attr("src", src).css({
|
||||||
left : Math.round( Math.max( (clientWidth-imgframe.width()-14)/2, 0 ) ) + "px",
|
left : Math.round( Math.max( parseInt($(document).scrollLeft()) + (clientWidth-imgframe.width()-14)/2, 0 ) ) + "px",
|
||||||
top : Math.round( Math.max( (clientHeight-imgframe.height()-14)/2, 0 ) ) + "px"
|
top : Math.round( Math.max( parseInt($(document).scrollTop()) + (clientHeight-imgframe.height()-14)/2, 0 ) ) + "px"
|
||||||
|
});
|
||||||
|
|
||||||
|
closebtn.css({
|
||||||
|
left : Math.round( Math.max( parseInt($(document).scrollLeft()) + (clientWidth-closebtn.width())/2, 0 ) ) + "px",
|
||||||
|
top : Math.round( Math.max( parseInt($(document).scrollTop()) + 10, 0 ) ) + "px"
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
10
addons/resize_image/js/resize_image.min.js
vendored
10
addons/resize_image/js/resize_image.min.js
vendored
|
|
@ -1,9 +1,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief 화면내에서 상위 영역보다 이미지가 크면 리사이즈를 하고 클릭시 원본을 보여줄수 있도록 변경
|
* @brief 화면내에서 상위 영역보다 이미지가 크면 리사이즈를 하고 클릭시 원본을 보여줄수 있도록 변경
|
||||||
**/
|
**/
|
||||||
(function($){var xScreen=null;function getScreen(){var body=$(document.body);var controls,imgframe,closebtn,prevbtn,nextbtn;if(!xScreen){xScreen=$("<div>").attr("id","xe_gallery_screen").css({position:"absolute",display:"none",backgroundColor:"black",zIndex:500,opacity:0.5});controls=$("<div>").attr("id","xe_gallery_controls").css({position:"absolute",display:"none",overflow:"hidden",zIndex:510});closebtn=$("<img>").attr("id","xe_gallery_closebtn").attr("src",request_uri+"addons/resize_image/iconClose.png").css({top:"10px"}).click(function(){xScreen.xeHide()}).appendTo(controls);prevbtn=$("<img>").attr("id","xe_gallery_prevbtn").attr("src",request_uri+"addons/resize_image/iconLeft.png").css("left","10px").click(function(){xScreen.xePrev()}).appendTo(controls);nextbtn=$("<img>").attr("id","xe_gallery_nextbtn").attr("src",request_uri+"addons/resize_image/iconRight.png").css("right","10px").click(function(){xScreen.xeNext()}).appendTo(controls);controls.find("img").attr({width:60,height:60,className:"iePngFix"}).css({position:"absolute",width:"60px",height:"60px",zIndex:530,cursor:"pointer"});imgframe=$("<img>").attr("id","xe_gallery_holder").css("border","7px solid white").css("zIndex",520).appendTo(controls).draggable();body.append(xScreen).append(controls);xScreen.xeShow=function(){var clientWidth=$(window).width();var clientHeight=$(window).height();$("#xe_gallery_controls,#xe_gallery_screen").css({display:"block",width:clientWidth+"px",height:clientHeight+"px",left:$(document).scrollLeft(),top:$(document).scrollTop()});closebtn.css("left",Math.round((clientWidth-60)/2)+"px");$("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round((clientHeight-60)/2)+"px");this.xeMove(0);};xScreen.xeHide=function(event){xScreen.css("display","none");controls.css("display","none");};xScreen.xePrev=function(){this.xeMove(-1);};xScreen.xeNext=function(){this.xeMove(1);};xScreen.xeMove=function(val){var clientWidth=$(window).width();var clientHeight=$(window).height();this.index+=val;prevbtn.css("visibility",(this.index>0)?"visible":"hidden");nextbtn.css("visibility",(this.index<this.list.size()-1)?"visible":"hidden");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:Math.round(Math.max((clientWidth-imgframe.width()-14)/2,0))+"px",top:Math.round(Math.max((clientHeight-imgframe.height()-14)/2,0))+"px"});};$(document).keydown(xScreen.xeHide);}else{controls=$("#xe_gallery_controls");imgframe=$("#xe_gallery_holder");closebtn=$("#xe_gallery_closebtn");prevbtn=$("#xe_gallery_prevbtn");nextbtn=$("#xe_gallery_nextbtn");}
|
(function($){var xScreen=null
|
||||||
return xScreen;}
|
function getScreen(){var body=$(document.body),controls,imgframe,closebtn,prevbtn,nextbtn;if(!xScreen){xScreen=$("<div>").attr("id","xe_gallery_screen").css({position:"absolute",display:"none",backgroundColor:"black",zIndex:500,opacity:0.5});controls=$("<div>").attr("id","xe_gallery_controls").css({position:"absolute",display:"none",overflow:"hidden",zIndex:510});closebtn=$("<img>").attr("id","xe_gallery_closebtn").attr("src",request_uri+"addons/resize_image/iconClose.png").css({top:"10px"}).click(function(){xScreen.xeHide()}).appendTo(controls);prevbtn=$("<img>").attr("id","xe_gallery_prevbtn").attr("src",request_uri+"addons/resize_image/iconLeft.png").css("left","10px").click(function(){xScreen.xePrev()}).appendTo(controls);nextbtn=$("<img>").attr("id","xe_gallery_nextbtn").attr("src",request_uri+"addons/resize_image/iconRight.png").css("right","10px").click(function(){xScreen.xeNext()}).appendTo(controls);controls.find("img").attr({width:60,height:60,className:"iePngFix"}).css({position:"absolute",width:"60px",height:"60px",zIndex:530,cursor:"pointer"});imgframe=$("<img>").attr("id","xe_gallery_holder").css("border","7px solid white").css("zIndex",520).appendTo(controls).draggable();body.append(xScreen).append(controls);xScreen.xeShow=function(){var clientWidth=$(window).width(),clientHeight=$(window).height();$("#xe_gallery_controls,#xe_gallery_screen").css({display:"block",width:$(document).width()+"px",height:$(document).height()+"px",left:0,top:0});closebtn.css("left",Math.round((clientWidth-60)/2)+"px");$("#xe_gallery_prevbtn,#xe_gallery_nextbtn").css("top",Math.round((clientHeight-60)/2)+"px");this.xeMove(0)};xScreen.xeHide=function(event){xScreen.css("display","none");controls.css("display","none")};xScreen.xePrev=function(){this.xeMove(-1)};xScreen.xeNext=function(){this.xeMove(1)};xScreen.xeMove=function(val){var clientWidth=$(window).width(),clientHeight=$(window).height();this.index+=val;prevbtn.css("visibility",(this.index>0)?"visible":"hidden");nextbtn.css("visibility",(this.index<this.list.size()-1)?"visible":"hidden");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:Math.round(Math.max(parseInt($(document).scrollLeft())+(clientWidth-imgframe.width()-14)/2,0))+"px",top:Math.round(Math.max(parseInt($(document).scrollTop())+(clientHeight-imgframe.height()-14)/2,0))+"px"});closebtn.css({left:Math.round(Math.max(parseInt($(document).scrollLeft())+(clientWidth-closebtn.width())/2,0))+"px",top:Math.round(Math.max(parseInt($(document).scrollTop())+10,0))+"px"})};$(document).keydown(xScreen.xeHide)}else{controls=$("#xe_gallery_controls");imgframe=$("#xe_gallery_holder");closebtn=$("#xe_gallery_closebtn");prevbtn=$("#xe_gallery_prevbtn");nextbtn=$("#xe_gallery_nextbtn")};return xScreen}
|
||||||
function slideshow(event){var container=$(this).closest('.xe_content');var imglist=container.find("img[rel=xe_gallery]");var currentIdx=$.inArray($(this).get(0),imglist.get());var xScreen=getScreen();xScreen.list=imglist;xScreen.index=currentIdx;xScreen.xeShow();}
|
function slideshow(event){var container=$(this).closest('.xe_content'),imglist=container.find("img[rel=xe_gallery]"),currentIdx=$.inArray($(this).get(0),imglist.get()),xScreen=getScreen();xScreen.list=imglist;xScreen.index=currentIdx;xScreen.xeShow()};$(function(){var regx_skip=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i,regx_allow_i6pngfix=/(?:common\/tpl\/images\/blank\.gif$)/i,dummy=$('<div style="height:1; overflow:hidden; opacity:0; display:block; clear:both;"></div>')
|
||||||
$(function(){var regx_skip=/(?:(modules|addons|classes|common|layouts|libs|widgets|widgetstyles)\/)/i;var regx_allow_i6pngfix=/(?:common\/tpl\/images\/blank\.gif$)/i;var dummy=$('<div style="height:1; overflow:hidden; opacity:0; display:block; clear:both;"></div>');function doResize(contentWidth,count){if(!count)count=0;if(count>=10)return;var $img=this;var beforSize={'width':$img.width(),'height':$img.height()};if(!beforSize.width||!beforSize.height){setTimeout(function(){doResize.call($img,contentWidth,++count)},200);return;}
|
function doResize(contentWidth,count){if(!count)count=0;if(count>=10)return;var $img=this,beforSize={width:$img.width(),height:$img.height()};if(!beforSize.width||!beforSize.height){setTimeout(function(){doResize.call($img,contentWidth,++count)},200);return};if(beforSize.width<=contentWidth)return;var resize_ratio=contentWidth/beforSize.width;$img.removeAttr('width').removeAttr('height').css({width:contentWidth,height:parseInt(beforSize.height*resize_ratio,10)})};$('div.xe_content').each(function(){var contentWidth=dummy.appendTo(this).width();dummy.remove();if(!contentWidth)return;$('img',this).each(function(){var $img=$(this),imgSrc=$img.attr('src');if(regx_skip.test(imgSrc)&&!regx_allow_i6pngfix.test(imgSrc))return;$img.attr('rel','xe_gallery');doResize.call($img,contentWidth)});$('img[rel=xe_gallery]',this).live('mouseover',function(){var $img=$(this);if(!$img.parent('a').length&&!$img.attr('onclick'))$img.css('cursor','pointer').click(slideshow)})})})})(jQuery)
|
||||||
if(beforSize.width<=contentWidth)return;var resize_ratio=contentWidth/beforSize.width;$img.removeAttr('width').removeAttr('height').css({'width':contentWidth,'height':parseInt(beforSize.height*resize_ratio,10)});}
|
|
||||||
$('div.xe_content').each(function(){dummy.appendTo(this);var contentWidth=dummy.width();dummy.remove();if(!contentWidth)return;$('img',this).each(function(){var $img=$(this);var imgSrc=$img.attr('src');if(regx_skip.test(imgSrc)&&!regx_allow_i6pngfix.test(imgSrc))return;$img.attr('rel','xe_gallery');doResize.call($img,contentWidth);});$('img[rel=xe_gallery]',this).live('mouseover',function(){var $img=$(this);if(!$img.parent('a').length&&!$img.attr('onclick')){$img.css('cursor','pointer').click(slideshow);}});});});})(jQuery);
|
|
||||||
|
|
@ -113,6 +113,20 @@ class Context {
|
||||||
* @var bool true if attached file exists
|
* @var bool true if attached file exists
|
||||||
*/
|
*/
|
||||||
var $is_uploaded = false;
|
var $is_uploaded = false;
|
||||||
|
/**
|
||||||
|
* Pattern for request vars check
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
var $patterns = array(
|
||||||
|
'/<\?/iUsm',
|
||||||
|
'/<\%/iUsm',
|
||||||
|
'/<script\s*?language\s*?=\s*?("|\')?\s*?php\s*("|\')?/iUsm'
|
||||||
|
);
|
||||||
|
/**
|
||||||
|
* Check init
|
||||||
|
* @var bool false if init fail
|
||||||
|
*/
|
||||||
|
var $isSuccessInit = true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns static context object (Singleton). It's to use Context without declaration of an object
|
* returns static context object (Singleton). It's to use Context without declaration of an object
|
||||||
|
|
@ -235,16 +249,19 @@ class Context {
|
||||||
$oMemberModel = &getModel('member');
|
$oMemberModel = &getModel('member');
|
||||||
$oMemberController = &getController('member');
|
$oMemberController = &getController('member');
|
||||||
|
|
||||||
// if signed in, validate it.
|
if($oMemberController && $oMemberModel)
|
||||||
if($oMemberModel->isLogged()) {
|
{
|
||||||
$oMemberController->setSessionInfo();
|
// if signed in, validate it.
|
||||||
}
|
if($oMemberModel->isLogged()) {
|
||||||
elseif($_COOKIE['xeak']) { // check auto sign-in
|
$oMemberController->setSessionInfo();
|
||||||
$oMemberController->doAutologin();
|
}
|
||||||
}
|
elseif($_COOKIE['xeak']) { // check auto sign-in
|
||||||
|
$oMemberController->doAutologin();
|
||||||
|
}
|
||||||
|
|
||||||
$this->set('is_logged', $oMemberModel->isLogged() );
|
$this->set('is_logged', $oMemberModel->isLogged() );
|
||||||
$this->set('logged_info', $oMemberModel->getLoggedInfo() );
|
$this->set('logged_info', $oMemberModel->getLoggedInfo() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// load common language file
|
// load common language file
|
||||||
|
|
@ -722,21 +739,63 @@ class Context {
|
||||||
|
|
||||||
$obj = clone($source_obj);
|
$obj = clone($source_obj);
|
||||||
|
|
||||||
foreach($charset_list as $charset) {
|
foreach($charset_list as $charset)
|
||||||
$flag = true;
|
{
|
||||||
foreach($obj as $key=>$val) {
|
array_walk($obj,'Context::checkConvertFlag',$charset);
|
||||||
if(!$val) continue;
|
$flag = Context::checkConvertFlag($flag = true);
|
||||||
if($val && iconv($charset,$charset,$val)!=$val) $flag = false;
|
if($flag)
|
||||||
}
|
{
|
||||||
if($flag) {
|
|
||||||
if($charset == 'UTF-8') return $obj;
|
if($charset == 'UTF-8') return $obj;
|
||||||
foreach($obj as $key => $val) $obj->{$key} = iconv($charset,'UTF-8',$val);
|
array_walk($obj,'Context::doConvertEncoding',$charset);
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $obj;
|
return $obj;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Check flag
|
||||||
|
*
|
||||||
|
* @param mixed $val
|
||||||
|
* @param string $key
|
||||||
|
* @param mixed $charset charset
|
||||||
|
* @see arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function checkConvertFlag(&$val, $key = null, $charset = null)
|
||||||
|
{
|
||||||
|
static $flag = true;
|
||||||
|
if($charset)
|
||||||
|
{
|
||||||
|
if(is_array($val))
|
||||||
|
array_walk($val,'Context::checkConvertFlag',$charset);
|
||||||
|
else if($val && iconv($charset,$charset,$val)!=$val) $flag = false;
|
||||||
|
else $flag = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$return = $flag;
|
||||||
|
$flag = true;
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert array type variables into UTF-8
|
||||||
|
*
|
||||||
|
* @param mixed $val
|
||||||
|
* @param string $key
|
||||||
|
* @param string $charset character set
|
||||||
|
* @see arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5
|
||||||
|
* @return object converted object
|
||||||
|
*/
|
||||||
|
function doConvertEncoding(&$val, $key = null, $charset)
|
||||||
|
{
|
||||||
|
if (is_array($val))
|
||||||
|
{
|
||||||
|
array_walk($val,'Context::doConvertEncoding',$charset);
|
||||||
|
}
|
||||||
|
else $val = iconv($charset,'UTF-8',$val);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert strings into UTF-8
|
* Convert strings into UTF-8
|
||||||
|
|
@ -812,15 +871,36 @@ class Context {
|
||||||
|
|
||||||
if($set_to_vars)
|
if($set_to_vars)
|
||||||
{
|
{
|
||||||
$val = preg_replace('/<\?.*(\?>)?/iUsm', '', $val);
|
$this->_recursiveCheckVar($val);
|
||||||
$val = preg_replace('/<\%.*(\%>)?/iUsm', '', $val);
|
|
||||||
$val = preg_replace('/<script(\s|\S)*language[\s]*=("|\')php("|\')(\s|\S)*>.*<[\s]*\/[\s]*script[\s]*>/iUsm', '', $val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->set($key, $val, $set_to_vars);
|
$this->set($key, $val, $set_to_vars);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _recursiveCheckVar($val)
|
||||||
|
{
|
||||||
|
if(is_string($val))
|
||||||
|
{
|
||||||
|
foreach($this->patterns as $pattern)
|
||||||
|
{
|
||||||
|
$result = preg_match($pattern, $val);
|
||||||
|
if($result)
|
||||||
|
{
|
||||||
|
$this->isSuccessInit = FALSE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(is_array($val))
|
||||||
|
{
|
||||||
|
foreach($val as $val2)
|
||||||
|
{
|
||||||
|
$this->_recursiveCheckVar($val2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle request arguments for JSON
|
* Handle request arguments for JSON
|
||||||
*
|
*
|
||||||
|
|
@ -893,7 +973,7 @@ class Context {
|
||||||
$v = stripslashes($v);
|
$v = stripslashes($v);
|
||||||
}
|
}
|
||||||
|
|
||||||
$val[$k] = trim($v);
|
if (is_string($v)) $val[$k] = trim($v);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1097,7 +1177,9 @@ class Context {
|
||||||
'act.mid' =>$is_feed?"$mid/$act":'',
|
'act.mid' =>$is_feed?"$mid/$act":'',
|
||||||
'act.mid.vid'=>$is_feed?"$vid/$mid/$act":'',
|
'act.mid.vid'=>$is_feed?"$vid/$mid/$act":'',
|
||||||
'act.document_srl.key' =>($act=='trackback')?"$srl/$key/$act":'',
|
'act.document_srl.key' =>($act=='trackback')?"$srl/$key/$act":'',
|
||||||
'act.document_srl.key.vid'=>($act=='trackback')?"$vid/$srl/$key/$act":''
|
'act.document_srl.key.mid'=>($act=='trackback')?"$mid/$srl/$key/$act":'',
|
||||||
|
'act.document_srl.key.vid'=>($act=='trackback')?"$vid/$srl/$key/$act":'',
|
||||||
|
'act.document_srl.key.mid.vid'=>($act=='trackback')?"$vid/$mid/$srl/$key/$act":''
|
||||||
);
|
);
|
||||||
|
|
||||||
$query = $target_map[$target];
|
$query = $target_map[$target];
|
||||||
|
|
@ -1109,7 +1191,7 @@ class Context {
|
||||||
if(is_array($val) && count($val)) {
|
if(is_array($val) && count($val)) {
|
||||||
foreach($val as $k => $v) $queries[] = $key.'['.$k.']='.urlencode($v);
|
foreach($val as $k => $v) $queries[] = $key.'['.$k.']='.urlencode($v);
|
||||||
} else {
|
} else {
|
||||||
$queries[] = $key.'='.urlencode($val);
|
$queries[] = $key.'='.@urlencode($val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(count($queries)) $query = 'index.php?'.implode('&', $queries);
|
if(count($queries)) $query = 'index.php?'.implode('&', $queries);
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
require(_XE_PATH_.'classes/db/queryparts/expression/InsertExpression.class.php');
|
require(_XE_PATH_.'classes/db/queryparts/expression/InsertExpression.class.php');
|
||||||
require(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpression.class.php');
|
require(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpression.class.php');
|
||||||
require(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpressionWithoutArgument.class.php');
|
require(_XE_PATH_.'classes/db/queryparts/expression/UpdateExpressionWithoutArgument.class.php');
|
||||||
|
require(_XE_PATH_.'classes/db/queryparts/expression/ClickCountExpression.class.php');
|
||||||
require(_XE_PATH_.'classes/db/queryparts/table/Table.class.php');
|
require(_XE_PATH_.'classes/db/queryparts/table/Table.class.php');
|
||||||
require(_XE_PATH_.'classes/db/queryparts/table/JoinTable.class.php');
|
require(_XE_PATH_.'classes/db/queryparts/table/JoinTable.class.php');
|
||||||
require(_XE_PATH_.'classes/db/queryparts/table/CubridTableWithHint.class.php');
|
require(_XE_PATH_.'classes/db/queryparts/table/CubridTableWithHint.class.php');
|
||||||
|
|
@ -110,9 +111,9 @@
|
||||||
* transaction flag
|
* transaction flag
|
||||||
* @var boolean
|
* @var boolean
|
||||||
*/
|
*/
|
||||||
var $transaction_started = false;
|
var $transaction_started = FALSE;
|
||||||
|
|
||||||
var $is_connected = false;
|
var $is_connected = FALSE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns enable list in supported dbms list
|
* returns enable list in supported dbms list
|
||||||
|
|
@ -249,7 +250,7 @@
|
||||||
$get_supported_list = array();
|
$get_supported_list = array();
|
||||||
$db_classes_path = _XE_PATH_."classes/db/";
|
$db_classes_path = _XE_PATH_."classes/db/";
|
||||||
$filter = "/^DB([^\.]+)\.class\.php/i";
|
$filter = "/^DB([^\.]+)\.class\.php/i";
|
||||||
$supported_list = FileHandler::readDir($db_classes_path, $filter, true);
|
$supported_list = FileHandler::readDir($db_classes_path, $filter, TRUE);
|
||||||
sort($supported_list);
|
sort($supported_list);
|
||||||
|
|
||||||
// after creating instance of class, check is supported
|
// after creating instance of class, check is supported
|
||||||
|
|
@ -269,9 +270,9 @@
|
||||||
|
|
||||||
if(!$oDB) continue;
|
if(!$oDB) continue;
|
||||||
|
|
||||||
$obj = null;
|
$obj = NULL;
|
||||||
$obj->db_type = $db_type;
|
$obj->db_type = $db_type;
|
||||||
$obj->enable = $oDB->isSupported() ? true : false;
|
$obj->enable = $oDB->isSupported() ? TRUE : FALSE;
|
||||||
|
|
||||||
$get_supported_list[] = $obj;
|
$get_supported_list[] = $obj;
|
||||||
}
|
}
|
||||||
|
|
@ -295,8 +296,8 @@
|
||||||
* @return boolean true: connected, false: not connected
|
* @return boolean true: connected, false: not connected
|
||||||
*/
|
*/
|
||||||
function isConnected($type = 'master', $indx = 0) {
|
function isConnected($type = 'master', $indx = 0) {
|
||||||
if($type == 'master') return $this->master_db["is_connected"] ? true : false;
|
if($type == 'master') return $this->master_db["is_connected"] ? TRUE : FALSE;
|
||||||
else return $this->slave_db[$indx]["is_connected"] ? true : false;
|
else return $this->slave_db[$indx]["is_connected"] ? TRUE : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -341,7 +342,7 @@
|
||||||
$debug_file = _XE_PATH_."files/_debug_db_query.php";
|
$debug_file = _XE_PATH_."files/_debug_db_query.php";
|
||||||
$buff = array();
|
$buff = array();
|
||||||
if(!file_exists($debug_file)) $buff[] = '<?php exit(); ?>';
|
if(!file_exists($debug_file)) $buff[] = '<?php exit(); ?>';
|
||||||
$buff[] = print_r($log, true);
|
$buff[] = print_r($log, TRUE);
|
||||||
|
|
||||||
if(@!$fp = fopen($debug_file, "a")) return;
|
if(@!$fp = fopen($debug_file, "a")) return;
|
||||||
fwrite($fp, implode("\n", $buff)."\n\n");
|
fwrite($fp, implode("\n", $buff)."\n\n");
|
||||||
|
|
@ -385,7 +386,7 @@
|
||||||
* @return boolean true: error, false: no error
|
* @return boolean true: error, false: no error
|
||||||
*/
|
*/
|
||||||
function isError() {
|
function isError() {
|
||||||
return $this->errno === 0 ? false : true;
|
return $this->errno === 0 ? FALSE : TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -535,8 +536,8 @@
|
||||||
* @return int count of cache data
|
* @return int count of cache data
|
||||||
*/
|
*/
|
||||||
function getCountCache($tables, $condition) {
|
function getCountCache($tables, $condition) {
|
||||||
return false;
|
return FALSE;
|
||||||
if(!$tables) return false;
|
if(!$tables) return FALSE;
|
||||||
if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path);
|
if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path);
|
||||||
|
|
||||||
$condition = md5($condition);
|
$condition = md5($condition);
|
||||||
|
|
@ -548,14 +549,14 @@
|
||||||
if(!is_dir($cache_path)) FileHandler::makeDir($cache_path);
|
if(!is_dir($cache_path)) FileHandler::makeDir($cache_path);
|
||||||
|
|
||||||
$cache_filename = sprintf('%s/%s.%s', $cache_path, $tables_str, $condition);
|
$cache_filename = sprintf('%s/%s.%s', $cache_path, $tables_str, $condition);
|
||||||
if(!file_exists($cache_filename)) return false;
|
if(!file_exists($cache_filename)) return FALSE;
|
||||||
|
|
||||||
$cache_mtime = filemtime($cache_filename);
|
$cache_mtime = filemtime($cache_filename);
|
||||||
|
|
||||||
if(!is_array($tables)) $tables = array($tables);
|
if(!is_array($tables)) $tables = array($tables);
|
||||||
foreach($tables as $alias => $table) {
|
foreach($tables as $alias => $table) {
|
||||||
$table_filename = sprintf('%s/cache.%s%s', $this->count_cache_path, $this->prefix, $table) ;
|
$table_filename = sprintf('%s/cache.%s%s', $this->count_cache_path, $this->prefix, $table) ;
|
||||||
if(!file_exists($table_filename) || filemtime($table_filename) > $cache_mtime) return false;
|
if(!file_exists($table_filename) || filemtime($table_filename) > $cache_mtime) return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$count = (int)FileHandler::readFile($cache_filename);
|
$count = (int)FileHandler::readFile($cache_filename);
|
||||||
|
|
@ -570,8 +571,8 @@
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function putCountCache($tables, $condition, $count = 0) {
|
function putCountCache($tables, $condition, $count = 0) {
|
||||||
return false;
|
return FALSE;
|
||||||
if(!$tables) return false;
|
if(!$tables) return FALSE;
|
||||||
if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path);
|
if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path);
|
||||||
|
|
||||||
$condition = md5($condition);
|
$condition = md5($condition);
|
||||||
|
|
@ -593,8 +594,8 @@
|
||||||
* @return boolean true: success, false: failed
|
* @return boolean true: success, false: failed
|
||||||
*/
|
*/
|
||||||
function resetCountCache($tables) {
|
function resetCountCache($tables) {
|
||||||
return false;
|
return FALSE;
|
||||||
if(!$tables) return false;
|
if(!$tables) return FALSE;
|
||||||
if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path);
|
if(!is_dir($this->count_cache_path)) return FileHandler::makeDir($this->count_cache_path);
|
||||||
|
|
||||||
if(!is_array($tables)) $tables = array($tables);
|
if(!is_array($tables)) $tables = array($tables);
|
||||||
|
|
@ -604,7 +605,7 @@
|
||||||
FileHandler::writeFile($filename, '');
|
FileHandler::writeFile($filename, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -642,7 +643,7 @@
|
||||||
* @param boolean $with_values
|
* @param boolean $with_values
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getSelectSql($query, $with_values = true){
|
function getSelectSql($query, $with_values = TRUE){
|
||||||
$select = $query->getSelectString($with_values);
|
$select = $query->getSelectString($with_values);
|
||||||
if($select == '') return new Object(-1, "Invalid query");
|
if($select == '') return new Object(-1, "Invalid query");
|
||||||
$select = 'SELECT ' .$select;
|
$select = 'SELECT ' .$select;
|
||||||
|
|
@ -676,6 +677,36 @@
|
||||||
return $select . ' ' . $from . ' ' . $where . ' ' . $index_hint_list . ' ' . $groupBy . ' ' . $orderBy . ' ' . $limit;
|
return $select . ' ' . $from . ' ' . $where . ' ' . $index_hint_list . ' ' . $groupBy . ' ' . $orderBy . ' ' . $limit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given a SELECT statement that uses click count
|
||||||
|
* returns the corresponding update sql string
|
||||||
|
* for databases that don't have click count support built in
|
||||||
|
* (aka all besides CUBRID)
|
||||||
|
*
|
||||||
|
* Function does not check if click count columns exist!
|
||||||
|
* You must call $query->usesClickCount() before using this function
|
||||||
|
*
|
||||||
|
* @param $queryObject
|
||||||
|
*/
|
||||||
|
function getClickCountQuery($queryObject)
|
||||||
|
{
|
||||||
|
$new_update_columns = array();
|
||||||
|
$click_count_columns = $queryObject->getClickCountColumns();
|
||||||
|
foreach($click_count_columns as $click_count_column)
|
||||||
|
{
|
||||||
|
$click_count_column_name = $click_count_column->column_name;
|
||||||
|
|
||||||
|
$increase_by_1 = new Argument($click_count_column_name, null);
|
||||||
|
$increase_by_1->setColumnOperation('+');
|
||||||
|
$increase_by_1->ensureDefaultValue(1);
|
||||||
|
|
||||||
|
$update_expression = new UpdateExpression($click_count_column_name, $increase_by_1);
|
||||||
|
$new_update_columns[] = $update_expression;
|
||||||
|
}
|
||||||
|
$queryObject->columns = $new_update_columns;
|
||||||
|
return $queryObject;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return delete query string
|
* Return delete query string
|
||||||
* @param object $query
|
* @param object $query
|
||||||
|
|
@ -683,7 +714,7 @@
|
||||||
* @param boolean $with_priority
|
* @param boolean $with_priority
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getDeleteSql($query, $with_values = true, $with_priority = false){
|
function getDeleteSql($query, $with_values = TRUE, $with_priority = FALSE){
|
||||||
$sql = 'DELETE ';
|
$sql = 'DELETE ';
|
||||||
|
|
||||||
$sql .= $with_priority?$query->getPriority():'';
|
$sql .= $with_priority?$query->getPriority():'';
|
||||||
|
|
@ -708,7 +739,7 @@
|
||||||
* @param boolean $with_priority
|
* @param boolean $with_priority
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getUpdateSql($query, $with_values = true, $with_priority = false){
|
function getUpdateSql($query, $with_values = TRUE, $with_priority = FALSE){
|
||||||
$columnsList = $query->getUpdateString($with_values);
|
$columnsList = $query->getUpdateString($with_values);
|
||||||
if($columnsList == '') return new Object(-1, "Invalid query");
|
if($columnsList == '') return new Object(-1, "Invalid query");
|
||||||
|
|
||||||
|
|
@ -730,7 +761,7 @@
|
||||||
* @param boolean $with_priority
|
* @param boolean $with_priority
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getInsertSql($query, $with_values = true, $with_priority = false){
|
function getInsertSql($query, $with_values = TRUE, $with_priority = FALSE){
|
||||||
$tableName = $query->getFirstTableName();
|
$tableName = $query->getFirstTableName();
|
||||||
$values = $query->getInsertString($with_values);
|
$values = $query->getInsertString($with_values);
|
||||||
$priority = $with_priority?$query->getPriority():'';
|
$priority = $with_priority?$query->getPriority():'';
|
||||||
|
|
@ -778,10 +809,10 @@
|
||||||
*/
|
*/
|
||||||
function _dbInfoExists() {
|
function _dbInfoExists() {
|
||||||
if (!$this->master_db)
|
if (!$this->master_db)
|
||||||
return false;
|
return FALSE;
|
||||||
if (count($this->slave_db) === 0)
|
if (count($this->slave_db) === 0)
|
||||||
return false;
|
return FALSE;
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -811,7 +842,7 @@
|
||||||
|
|
||||||
$this->_close($connection["resource"]);
|
$this->_close($connection["resource"]);
|
||||||
|
|
||||||
$connection["is_connected"] = false;
|
$connection["is_connected"] = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -820,7 +851,7 @@
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function _begin(){
|
function _begin(){
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -832,7 +863,7 @@
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if($this->_begin())
|
if($this->_begin())
|
||||||
$this->transaction_started = true;
|
$this->transaction_started = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -841,7 +872,7 @@
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function _rollback(){
|
function _rollback(){
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -852,7 +883,7 @@
|
||||||
if (!$this->isConnected() || !$this->transaction_started)
|
if (!$this->isConnected() || !$this->transaction_started)
|
||||||
return;
|
return;
|
||||||
if($this->_rollback())
|
if($this->_rollback())
|
||||||
$this->transaction_started = false;
|
$this->transaction_started = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -861,7 +892,7 @@
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function _commit(){
|
function _commit(){
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -869,11 +900,11 @@
|
||||||
* @param boolean $force regardless transaction start status or connect status, forced to commit
|
* @param boolean $force regardless transaction start status or connect status, forced to commit
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function commit($force = false) {
|
function commit($force = FALSE) {
|
||||||
if (!$force && (!$this->isConnected() || !$this->transaction_started))
|
if (!$force && (!$this->isConnected() || !$this->transaction_started))
|
||||||
return;
|
return;
|
||||||
if($this->_commit())
|
if($this->_commit())
|
||||||
$this->transaction_started = false;
|
$this->transaction_started = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -894,8 +925,8 @@
|
||||||
* @param resource $connection
|
* @param resource $connection
|
||||||
* @return resource
|
* @return resource
|
||||||
*/
|
*/
|
||||||
function _query($query, $connection = null) {
|
function _query($query, $connection = NULL) {
|
||||||
if($connection == null)
|
if($connection == NULL)
|
||||||
$connection = $this->_getConnection('master');
|
$connection = $this->_getConnection('master');
|
||||||
// Notify to start a query execution
|
// Notify to start a query execution
|
||||||
$this->actStart($query);
|
$this->actStart($query);
|
||||||
|
|
@ -971,14 +1002,14 @@
|
||||||
$connection = &$this->slave_db[$indx];
|
$connection = &$this->slave_db[$indx];
|
||||||
|
|
||||||
$result = $this->__connect($connection);
|
$result = $this->__connect($connection);
|
||||||
if($result === NULL || $result === false) {
|
if($result === NULL || $result === FALSE) {
|
||||||
$connection["is_connected"] = false;
|
$connection["is_connected"] = FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check connections
|
// Check connections
|
||||||
$connection["resource"] = $result;
|
$connection["resource"] = $result;
|
||||||
$connection["is_connected"] = true;
|
$connection["is_connected"] = TRUE;
|
||||||
|
|
||||||
// Save connection info for db logs
|
// Save connection info for db logs
|
||||||
$this->connection = ucfirst($type) . ' ' . $connection["db_hostname"];
|
$this->connection = ucfirst($type) . ' ' . $connection["db_hostname"];
|
||||||
|
|
@ -1018,8 +1049,8 @@
|
||||||
* @param boolean $force force load DBParser instance
|
* @param boolean $force force load DBParser instance
|
||||||
* @return DBParser
|
* @return DBParser
|
||||||
*/
|
*/
|
||||||
function &getParser($force = false){
|
function &getParser($force = FALSE){
|
||||||
static $dbParser = null;
|
static $dbParser = NULL;
|
||||||
if(!$dbParser || $force) {
|
if(!$dbParser || $force) {
|
||||||
$oDB = &DB::getInstance();
|
$oDB = &DB::getInstance();
|
||||||
$dbParser = $oDB->getParser();
|
$dbParser = $oDB->getParser();
|
||||||
|
|
|
||||||
|
|
@ -455,7 +455,7 @@
|
||||||
|
|
||||||
if ($notnull) $query .= "not null ";
|
if ($notnull) $query .= "not null ";
|
||||||
|
|
||||||
$this->_query ($query);
|
return $this->_query ($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@
|
||||||
if($default) $query .= sprintf(" default '%s' ", $default);
|
if($default) $query .= sprintf(" default '%s' ", $default);
|
||||||
if($notnull) $query .= " not null ";
|
if($notnull) $query .= " not null ";
|
||||||
|
|
||||||
$this->_query($query);
|
return $this->_query($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -729,6 +729,12 @@
|
||||||
$data = $this->_fetch($result);
|
$data = $this->_fetch($result);
|
||||||
$buff = new Object ();
|
$buff = new Object ();
|
||||||
$buff->data = $data;
|
$buff->data = $data;
|
||||||
|
|
||||||
|
if($queryObject->usesClickCount())
|
||||||
|
{
|
||||||
|
$update_query = $this->getClickCountQuery($queryObject);
|
||||||
|
$this->_executeUpdateAct($update_query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $buff;
|
return $buff;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ class DBMysql extends DB {
|
||||||
if($default) $query .= sprintf(" default '%s' ", $default);
|
if($default) $query .= sprintf(" default '%s' ", $default);
|
||||||
if($notnull) $query .= " not null ";
|
if($notnull) $query .= " not null ";
|
||||||
|
|
||||||
$this->_query($query);
|
return $this->_query($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -501,6 +501,13 @@ class DBMysql extends DB {
|
||||||
$data = $this->_fetch($result);
|
$data = $this->_fetch($result);
|
||||||
$buff = new Object ();
|
$buff = new Object ();
|
||||||
$buff->data = $data;
|
$buff->data = $data;
|
||||||
|
|
||||||
|
if($queryObject->usesClickCount())
|
||||||
|
{
|
||||||
|
$update_query = $this->getClickCountQuery($queryObject);
|
||||||
|
$this->_executeUpdateAct($update_query, $with_values);
|
||||||
|
}
|
||||||
|
|
||||||
return $buff;
|
return $buff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,13 @@
|
||||||
* argument list
|
* argument list
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $arguments = null;
|
var $arguments = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* column list
|
* column list
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
var $columnList = null;
|
var $columnList = NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* order by text
|
* order by text
|
||||||
|
|
@ -83,15 +83,15 @@
|
||||||
* @param string $priority
|
* @param string $priority
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function Query($queryID = null
|
function Query($queryID = NULL
|
||||||
, $action = null
|
, $action = NULL
|
||||||
, $columns = null
|
, $columns = NULL
|
||||||
, $tables = null
|
, $tables = NULL
|
||||||
, $conditions = null
|
, $conditions = NULL
|
||||||
, $groups = null
|
, $groups = NULL
|
||||||
, $orderby = null
|
, $orderby = NULL
|
||||||
, $limit = null
|
, $limit = NULL
|
||||||
, $priority = null){
|
, $priority = NULL){
|
||||||
$this->queryID = $queryID;
|
$this->queryID = $queryID;
|
||||||
$this->action = $action;
|
$this->action = $action;
|
||||||
$this->priority = $priority;
|
$this->priority = $priority;
|
||||||
|
|
@ -106,7 +106,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function show(){
|
function show(){
|
||||||
return true;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setQueryId($queryID){
|
function setQueryId($queryID){
|
||||||
|
|
@ -149,7 +149,7 @@
|
||||||
|
|
||||||
function setTables($tables){
|
function setTables($tables){
|
||||||
if(!isset($tables) || count($tables) === 0){
|
if(!isset($tables) || count($tables) === 0){
|
||||||
$this->setError(true);
|
$this->setError(TRUE);
|
||||||
$this->setMessage("You must provide at least one table for the query.");
|
$this->setMessage("You must provide at least one table for the query.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +198,7 @@
|
||||||
* @param string|array $columns
|
* @param string|array $columns
|
||||||
* @return Query return Query instance
|
* @return Query return Query instance
|
||||||
*/
|
*/
|
||||||
function select($columns= null){
|
function select($columns= NULL){
|
||||||
$this->action = 'select';
|
$this->action = 'select';
|
||||||
$this->setColumns($columns);
|
$this->setColumns($columns);
|
||||||
return $this;
|
return $this;
|
||||||
|
|
@ -263,12 +263,34 @@
|
||||||
return $this->priority?'LOW_PRIORITY':'';
|
return $this->priority?'LOW_PRIORITY':'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if current query uses the click count attribute
|
||||||
|
* For CUBRID, this statement uses the click count feature.
|
||||||
|
* For the other databases, using this attribute causes a query
|
||||||
|
* to produce both a select and an update
|
||||||
|
*/
|
||||||
|
function usesClickCount()
|
||||||
|
{
|
||||||
|
return count($this->getClickCountColumns()) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getClickCountColumns()
|
||||||
|
{
|
||||||
|
$click_count_columns = array();
|
||||||
|
foreach($this->columns as $column){
|
||||||
|
if($column->show() && is_a($column, 'ClickCountExpression'))
|
||||||
|
$click_count_columns[] = $column;
|
||||||
|
}
|
||||||
|
return $click_count_columns;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return select sql
|
* Return select sql
|
||||||
* @param boolean $with_values
|
* @param boolean $with_values
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getSelectString($with_values = true){
|
function getSelectString($with_values = TRUE){
|
||||||
|
$select = array();
|
||||||
foreach($this->columns as $column){
|
foreach($this->columns as $column){
|
||||||
if($column->show())
|
if($column->show())
|
||||||
if($column->isSubquery()){
|
if($column->isSubquery()){
|
||||||
|
|
@ -285,7 +307,7 @@
|
||||||
* @param boolean $with_values
|
* @param boolean $with_values
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getUpdateString($with_values = true){
|
function getUpdateString($with_values = TRUE){
|
||||||
foreach($this->columns as $column){
|
foreach($this->columns as $column){
|
||||||
if($column->show())
|
if($column->show())
|
||||||
$update[] = $column->getExpression($with_values);
|
$update[] = $column->getExpression($with_values);
|
||||||
|
|
@ -298,7 +320,7 @@
|
||||||
* @param boolean $with_values
|
* @param boolean $with_values
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getInsertString($with_values = true){
|
function getInsertString($with_values = TRUE){
|
||||||
$columnsList = '';
|
$columnsList = '';
|
||||||
if($this->subquery){ // means we have insert-select
|
if($this->subquery){ // means we have insert-select
|
||||||
|
|
||||||
|
|
@ -339,7 +361,7 @@
|
||||||
* @param boolean $with_values
|
* @param boolean $with_values
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getFromString($with_values = true){
|
function getFromString($with_values = TRUE){
|
||||||
$from = '';
|
$from = '';
|
||||||
$simple_table_count = 0;
|
$simple_table_count = 0;
|
||||||
foreach($this->tables as $table){
|
foreach($this->tables as $table){
|
||||||
|
|
@ -360,7 +382,7 @@
|
||||||
* @param boolean $with_optimization
|
* @param boolean $with_optimization
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getWhereString($with_values = true, $with_optimization = true){
|
function getWhereString($with_values = TRUE, $with_optimization = TRUE){
|
||||||
$where = '';
|
$where = '';
|
||||||
$condition_count = 0;
|
$condition_count = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,8 @@
|
||||||
parent::SelectExpression($column_name, $alias);
|
parent::SelectExpression($column_name, $alias);
|
||||||
|
|
||||||
if(!is_bool($click_count)){
|
if(!is_bool($click_count)){
|
||||||
error_log("Click_count value for $column_name was not boolean", 0);
|
// error_log("Click_count value for $column_name was not boolean", 0);
|
||||||
$this->click_count = false;
|
$this->click_count = false;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
$this->click_count = $click_count;
|
$this->click_count = $click_count;
|
||||||
}
|
}
|
||||||
|
|
@ -39,7 +38,15 @@
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getExpression(){
|
function getExpression(){
|
||||||
return "$this->column_name = $this->column_name + 1";
|
$db_type = Context::getDBType();
|
||||||
|
if($db_type == 'cubrid')
|
||||||
|
{
|
||||||
|
return "INCR($this->column_name)";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "$this->column_name";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@
|
||||||
(defined('__OB_GZHANDLER_ENABLE__') && __OB_GZHANDLER_ENABLE__ == 1) &&
|
(defined('__OB_GZHANDLER_ENABLE__') && __OB_GZHANDLER_ENABLE__ == 1) &&
|
||||||
strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')!==false &&
|
strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')!==false &&
|
||||||
function_exists('ob_gzhandler') &&
|
function_exists('ob_gzhandler') &&
|
||||||
extension_loaded('zlib')
|
extension_loaded('zlib') &&
|
||||||
|
$oModule->gzhandler_enable
|
||||||
) $this->gz_enabled = true;
|
) $this->gz_enabled = true;
|
||||||
// Extract contents to display by the request method
|
// Extract contents to display by the request method
|
||||||
if(Context::get('xeVirtualRequestMethod')=='xml') {
|
if(Context::get('xeVirtualRequestMethod')=='xml') {
|
||||||
|
|
|
||||||
|
|
@ -370,6 +370,32 @@ class FileHandler {
|
||||||
* @return string If success, the content of the target file. Otherwise: none
|
* @return string If success, the content of the target file. Otherwise: none
|
||||||
**/
|
**/
|
||||||
function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array()) {
|
function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array()) {
|
||||||
|
if(version_compare(PHP_VERSION, '5.0.0', '>='))
|
||||||
|
{
|
||||||
|
return include _XE_PATH_ . 'classes/file/getRemoteResourcePHP5.php';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return FileHandler::_getRemoteResource($url, $boyd, $timeout, $mehtod, $conent_type, $headers, $cookies, $post_data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return remote file's content via HTTP
|
||||||
|
*
|
||||||
|
* If the target is moved (when return code is 300~399), this function follows the location specified response header.
|
||||||
|
*
|
||||||
|
* @param string $url The address of the target file
|
||||||
|
* @param string $body HTTP request body
|
||||||
|
* @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[] $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
|
||||||
|
**/
|
||||||
|
function _getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $content_type = null, $headers = array(), $cookies = array(), $post_data = array()) {
|
||||||
requirePear();
|
requirePear();
|
||||||
require_once('HTTP/Request.php');
|
require_once('HTTP/Request.php');
|
||||||
|
|
||||||
|
|
|
||||||
9
classes/file/getRemoteResourcePHP5.php
Normal file
9
classes/file/getRemoteResourcePHP5.php
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return self::_getRemoteResource($url, $body, $timeout, $method, $content_type, $headers, $cookies, $post_data);
|
||||||
|
}
|
||||||
|
catch(Exception $e)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
@ -97,12 +97,35 @@
|
||||||
if (!is_array($args)) $args = array($args);
|
if (!is_array($args)) $args = array($args);
|
||||||
|
|
||||||
$pathInfo = pathinfo($args[0]);
|
$pathInfo = pathinfo($args[0]);
|
||||||
|
$file = new stdClass();
|
||||||
$file->fileName = $pathInfo['basename'];
|
$file->fileName = $pathInfo['basename'];
|
||||||
$file->filePath = $this->_getAbsFileUrl($pathInfo['dirname']);
|
$file->filePath = $this->_getAbsFileUrl($pathInfo['dirname']);
|
||||||
|
$file->fileRealPath = FileHandler::getRealPath($pathInfo['dirname']);
|
||||||
$file->fileExtension = strtolower($pathInfo['extension']);
|
$file->fileExtension = strtolower($pathInfo['extension']);
|
||||||
|
$file->fileNameNoExt = preg_replace('/\.min$/', '', $pathInfo['filename']);
|
||||||
|
$file->keyName = implode('.', array($file->fileNameNoExt, $file->fileExtension));
|
||||||
|
|
||||||
if (strpos($file->filePath, '://') == false)
|
if(strpos($file->filePath, '://') === FALSE)
|
||||||
{
|
{
|
||||||
|
if(!__DEBUG__)
|
||||||
|
{
|
||||||
|
// if no debug mode, load minifed file
|
||||||
|
$minifiedFileName = implode('.', array($file->fileNameNoExt, 'min', $file->fileExtension));
|
||||||
|
$minifiedRealPath = implode('/', array($file->fileRealPath, $minifiedFileName));
|
||||||
|
if(file_exists($minifiedRealPath))
|
||||||
|
{
|
||||||
|
$file->fileName = $minifiedFileName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Remove .min
|
||||||
|
if(file_exists(implode('/', array($file->fileRealPath, $file->keyName))))
|
||||||
|
{
|
||||||
|
$file->fileName = $file->keyName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$file->useCdn = $useCdn;
|
$file->useCdn = $useCdn;
|
||||||
$file->cdnPath = $this->_normalizeFilePath($pathInfo['dirname']);
|
$file->cdnPath = $this->_normalizeFilePath($pathInfo['dirname']);
|
||||||
$file->cdnPrefix = $cdnPrefix;
|
$file->cdnPrefix = $cdnPrefix;
|
||||||
|
|
@ -121,7 +144,7 @@
|
||||||
if (!$file->media) $file->media = 'all';
|
if (!$file->media) $file->media = 'all';
|
||||||
$map = &$this->cssMap;
|
$map = &$this->cssMap;
|
||||||
$mapIndex = &$this->cssMapIndex;
|
$mapIndex = &$this->cssMapIndex;
|
||||||
$key = $file->filePath . $file->fileName . "\t" . $file->targetIe . "\t" . $file->media;
|
$key = $file->filePath . $file->keyName . "\t" . $file->targetIe . "\t" . $file->media;
|
||||||
|
|
||||||
$this->_arrangeCssIndex($pathInfo['dirname'], $file);
|
$this->_arrangeCssIndex($pathInfo['dirname'], $file);
|
||||||
}
|
}
|
||||||
|
|
@ -138,11 +161,11 @@
|
||||||
$map = &$this->jsHeadMap;
|
$map = &$this->jsHeadMap;
|
||||||
$mapIndex = &$this->jsHeadMapIndex;
|
$mapIndex = &$this->jsHeadMapIndex;
|
||||||
}
|
}
|
||||||
$key = $file->filePath . $file->fileName . "\t" . $file->targetIe;
|
$key = $file->filePath . $file->keyName . "\t" . $file->targetIe;
|
||||||
}
|
}
|
||||||
|
|
||||||
(is_null($file->index))?$file->index=0:$file->index=$file->index;
|
(is_null($file->index))?$file->index=0:$file->index=$file->index;
|
||||||
if (!isset($map[$file->index][$key]) || $mapIndex[$key] != $file->index)
|
if (!isset($map[$file->index][$key]) || $mapIndex[$key] > $file->index)
|
||||||
{
|
{
|
||||||
$this->unloadFile($args[0], $args[2], $args[1]);
|
$this->unloadFile($args[0], $args[2], $args[1]);
|
||||||
$map[$file->index][$key] = $file;
|
$map[$file->index][$key] = $file;
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,14 @@
|
||||||
$this->act = Context::get('act');
|
$this->act = Context::get('act');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$oContext = Context::getInstance();
|
||||||
|
if($oContext->isSuccessInit == false)
|
||||||
|
{
|
||||||
|
$this->error = 'msg_invalid_request';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Set variables from request arguments
|
// Set variables from request arguments
|
||||||
$this->module = $module?$module:Context::get('module');
|
$this->module = $module?$module:Context::get('module');
|
||||||
$this->act = $act?$act:Context::get('act');
|
$this->act = $act?$act:Context::get('act');
|
||||||
|
|
@ -151,7 +159,17 @@
|
||||||
$this->mid = $module_info->mid;
|
$this->mid = $module_info->mid;
|
||||||
$this->module_info = $module_info;
|
$this->module_info = $module_info;
|
||||||
Context::setBrowserTitle($module_info->browser_title);
|
Context::setBrowserTitle($module_info->browser_title);
|
||||||
$part_config= $oModuleModel->getModulePartConfig('layout',$module_info->layout_srl);
|
|
||||||
|
if($module_info->use_mobile && Mobile::isFromMobilePhone())
|
||||||
|
{
|
||||||
|
$layoutSrl = $module_info->mlayout_srl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$layoutSrl = $module_info->layout_srl;
|
||||||
|
}
|
||||||
|
|
||||||
|
$part_config= $oModuleModel->getModulePartConfig('layout',$layoutSrl);
|
||||||
Context::addHtmlHeader($part_config->header_script);
|
Context::addHtmlHeader($part_config->header_script);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -361,6 +379,20 @@
|
||||||
{
|
{
|
||||||
$oModule = &$this->getModuleInstance($forward->module, $type, $kind);
|
$oModule = &$this->getModuleInstance($forward->module, $type, $kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!is_object($oModule)) {
|
||||||
|
$type = Mobile::isFromMobilePhone() ? 'mobile' : 'view';
|
||||||
|
$oMessageObject = &ModuleHandler::getModuleInstance('message',$type);
|
||||||
|
$oMessageObject->setError(-1);
|
||||||
|
$oMessageObject->setMessage('msg_module_is_not_exists');
|
||||||
|
$oMessageObject->dispMessage();
|
||||||
|
if($this->httpStatusCode)
|
||||||
|
{
|
||||||
|
$oMessageObject->setHttpStatusCode($this->httpStatusCode);
|
||||||
|
}
|
||||||
|
return $oMessageObject;
|
||||||
|
}
|
||||||
|
|
||||||
$xml_info = $oModuleModel->getModuleActionXml($forward->module);
|
$xml_info = $oModuleModel->getModuleActionXml($forward->module);
|
||||||
$oMemberModel = &getModel('member');
|
$oMemberModel = &getModel('member');
|
||||||
|
|
||||||
|
|
@ -686,6 +718,7 @@
|
||||||
|
|
||||||
if(__DEBUG__==3) $start_time = getMicroTime();
|
if(__DEBUG__==3) $start_time = getMicroTime();
|
||||||
|
|
||||||
|
$parent_module = $module;
|
||||||
$kind = strtolower($kind);
|
$kind = strtolower($kind);
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
|
|
||||||
|
|
@ -702,10 +735,13 @@
|
||||||
// if there is no instance of the module in global variable, create a new one
|
// if there is no instance of the module in global variable, create a new one
|
||||||
if(!isset($GLOBALS['_loaded_module'][$module][$type][$kind]))
|
if(!isset($GLOBALS['_loaded_module'][$module][$type][$kind]))
|
||||||
{
|
{
|
||||||
$parent_module = $module;
|
ModuleHandler::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name);
|
||||||
|
|
||||||
$class_path = ModuleHandler::getModulePath($module);
|
if($extend_module && (!is_readable($high_class_file) || !is_readable($class_file)))
|
||||||
if(!is_dir(FileHandler::getRealPath($class_path))) return NULL;
|
{
|
||||||
|
$module = $parent_module;
|
||||||
|
ModuleHandler::_getModuleFilePath($module, $type, $kind, $class_path, $high_class_file, $class_file, $instance_name);
|
||||||
|
}
|
||||||
|
|
||||||
// Get base class name and load the file contains it
|
// Get base class name and load the file contains it
|
||||||
if(!class_exists($module)) {
|
if(!class_exists($module)) {
|
||||||
|
|
@ -714,23 +750,6 @@
|
||||||
require_once($high_class_file);
|
require_once($high_class_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the object's name
|
|
||||||
$types = explode(' ', 'view controller model api wap mobile class');
|
|
||||||
if(!in_array($type, $types)) $type = $types[0];
|
|
||||||
if($type == 'class') {
|
|
||||||
$instance_name = '%s';
|
|
||||||
$class_file = '%s%s.%s.php';
|
|
||||||
} elseif($kind == 'admin' && array_search($type, $types) < 3) {
|
|
||||||
$instance_name = '%sAdmin%s';
|
|
||||||
$class_file = '%s%s.admin.%s.php';
|
|
||||||
} else{
|
|
||||||
$instance_name = '%s%s';
|
|
||||||
$class_file = '%s%s.%s.php';
|
|
||||||
}
|
|
||||||
$instance_name = sprintf($instance_name, $module, ucfirst($type));
|
|
||||||
$class_file = sprintf($class_file, $class_path, $module, $type);
|
|
||||||
$class_file = FileHandler::getRealPath($class_file);
|
|
||||||
|
|
||||||
// Get the name of the class file
|
// Get the name of the class file
|
||||||
if(!is_readable($class_file)) return NULL;
|
if(!is_readable($class_file)) return NULL;
|
||||||
|
|
||||||
|
|
@ -767,6 +786,31 @@
|
||||||
return $GLOBALS['_loaded_module'][$module][$type][$kind];
|
return $GLOBALS['_loaded_module'][$module][$type][$kind];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _getModuleFilePath($module, $type, $kind, &$classPath, &$highClassFile, &$classFile, &$instanceName)
|
||||||
|
{
|
||||||
|
$classPath = ModuleHandler::getModulePath($module);
|
||||||
|
|
||||||
|
$highClassFile = sprintf('%s%s%s.class.php', _XE_PATH_,$classPath, $module);
|
||||||
|
$highClassFile = FileHandler::getRealPath($highClassFile);
|
||||||
|
|
||||||
|
$types = explode(' ', 'view controller model api wap mobile class');
|
||||||
|
if(!in_array($type, $types)) $type = $types[0];
|
||||||
|
if($type == 'class') {
|
||||||
|
$instanceName = '%s';
|
||||||
|
$classFile = '%s%s.%s.php';
|
||||||
|
} elseif($kind == 'admin' && array_search($type, $types) < 3) {
|
||||||
|
$instanceName = '%sAdmin%s';
|
||||||
|
$classFile = '%s%s.admin.%s.php';
|
||||||
|
} else{
|
||||||
|
$instanceName = '%s%s';
|
||||||
|
$classFile = '%s%s.%s.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
$instanceName = sprintf($instanceName, $module, ucfirst($type));
|
||||||
|
$classFile = sprintf($classFile, $classPath, $module, $type);
|
||||||
|
$classFile = FileHandler::getRealPath($classFile);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* call a trigger
|
* call a trigger
|
||||||
* @param string $trigger_name trigger's name to call
|
* @param string $trigger_name trigger's name to call
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@
|
||||||
var $module_config = NULL;
|
var $module_config = NULL;
|
||||||
var $ajaxRequestMethod = array('XMLRPC', 'JSON');
|
var $ajaxRequestMethod = array('XMLRPC', 'JSON');
|
||||||
|
|
||||||
|
var $gzhandler_enable = TRUE;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setter to set the name of module
|
* setter to set the name of module
|
||||||
* @param string $module name of module
|
* @param string $module name of module
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,18 @@
|
||||||
<?php
|
<?php
|
||||||
include "phphtmlparser/src/htmlparser.inc";
|
include _XE_PATH_ . 'classes/security/phphtmlparser/src/htmlparser.inc';
|
||||||
|
|
||||||
class EmbedFilter
|
class EmbedFilter
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* allow script access list
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
var $allowscriptaccessList = array();
|
||||||
|
/**
|
||||||
|
* allow script access key
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
var $allowscriptaccessKey = 0;
|
||||||
var $whiteUrlXmlFile = './classes/security/conf/embedWhiteUrl.xml';
|
var $whiteUrlXmlFile = './classes/security/conf/embedWhiteUrl.xml';
|
||||||
var $whiteUrlCacheFile = './files/cache/embedfilter/embedWhiteUrl.php';
|
var $whiteUrlCacheFile = './files/cache/embedfilter/embedWhiteUrl.php';
|
||||||
var $whiteUrlList = array();
|
var $whiteUrlList = array();
|
||||||
|
|
@ -275,6 +285,9 @@ class EmbedFilter
|
||||||
*/
|
*/
|
||||||
function check(&$content)
|
function check(&$content)
|
||||||
{
|
{
|
||||||
|
$content = preg_replace_callback('/<(object|param|embed)[^>]*/is', array($this, '_checkAllowScriptAccess'), $content);
|
||||||
|
$content = preg_replace_callback('/<object[^>]*>/is', array($this, '_addAllowScriptAccess'), $content);
|
||||||
|
|
||||||
$this->checkObjectTag($content);
|
$this->checkObjectTag($content);
|
||||||
$this->checkEmbedTag($content);
|
$this->checkEmbedTag($content);
|
||||||
$this->checkIframeTag($content);
|
$this->checkIframeTag($content);
|
||||||
|
|
@ -530,6 +543,49 @@ class EmbedFilter
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _checkAllowScriptAccess($m)
|
||||||
|
{
|
||||||
|
if($m[1] == 'object')
|
||||||
|
{
|
||||||
|
$this->allowscriptaccessList[] = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($m[1] == 'param')
|
||||||
|
{
|
||||||
|
if(strpos(strtolower($m[0]), 'allowscriptaccess'))
|
||||||
|
{
|
||||||
|
$m[0] = '<param name="allowscriptaccess" value="never"';
|
||||||
|
if(substr($m[0], -1) == '/')
|
||||||
|
{
|
||||||
|
$m[0] .= '/';
|
||||||
|
}
|
||||||
|
$this->allowscriptaccessList[count($this->allowscriptaccessList)-1]--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($m[1] == 'embed')
|
||||||
|
{
|
||||||
|
if(strpos(strtolower($m[0]), 'allowscriptaccess'))
|
||||||
|
{
|
||||||
|
$m[0] = preg_replace('/always|samedomain/i', 'never', $m[0]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$m[0] = preg_replace('/\<embed/i', '<embed allowscriptaccess="never"', $m[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $m[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
function _addAllowScriptAccess($m)
|
||||||
|
{
|
||||||
|
if($this->allowscriptaccessList[$this->allowscriptaccessKey] == 1)
|
||||||
|
{
|
||||||
|
$m[0] = $m[0].'<param name="allowscriptaccess" value="never"></param>';
|
||||||
|
}
|
||||||
|
$this->allowscriptaccessKey++;
|
||||||
|
return $m[0];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make white domain list cache file from xml config file.
|
* Make white domain list cache file from xml config file.
|
||||||
* @return void
|
* @return void
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,13 @@ class Validator
|
||||||
$value = $exists ? $fields[$fname] : null;
|
$value = $exists ? $fields[$fname] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($value)) $value = implode('', $value);
|
if(is_array($value)) {
|
||||||
|
if(!isset($value[tmp_name])){
|
||||||
|
$value = implode('', $value);
|
||||||
|
}else{
|
||||||
|
$value = $value['name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// conditional statement
|
// conditional statement
|
||||||
foreach($filter['if'] as $cond) {
|
foreach($filter['if'] as $cond) {
|
||||||
|
|
|
||||||
|
|
@ -1,109 +1,124 @@
|
||||||
<?php
|
<?php
|
||||||
if(!defined('__XE_LOADED_XML_CLASS__')){
|
/**
|
||||||
define('__XE_LOADED_XML_CLASS__', 1);
|
* File containing the XE 1.5 XmlQueryParserClass
|
||||||
|
*/
|
||||||
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/query/QueryTag.class.php');
|
if(!defined('__XE_LOADED_XML_CLASS__')){
|
||||||
|
define('__XE_LOADED_XML_CLASS__', 1);
|
||||||
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/table/TableTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/query/QueryTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/table/HintTableTag.class.php');
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/table/TablesTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/table/TableTag.class.php');
|
||||||
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/table/HintTableTag.class.php');
|
||||||
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/table/TablesTag.class.php');
|
||||||
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/ColumnTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/ColumnTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/SelectColumnTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/SelectColumnTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/InsertColumnTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/InsertColumnTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/InsertColumnTagWithoutArgument.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/InsertColumnTagWithoutArgument.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/UpdateColumnTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/UpdateColumnTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/SelectColumnsTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/SelectColumnsTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/InsertColumnsTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/InsertColumnsTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/UpdateColumnsTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/column/UpdateColumnsTag.class.php');
|
||||||
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/condition/ConditionTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/condition/ConditionTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/condition/ConditionsTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/condition/ConditionsTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/condition/JoinConditionsTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/condition/JoinConditionsTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/condition/ConditionGroupTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/condition/ConditionGroupTag.class.php');
|
||||||
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/group/GroupsTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/group/GroupsTag.class.php');
|
||||||
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/navigation/NavigationTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/navigation/NavigationTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/navigation/IndexTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/navigation/IndexTag.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/tags/navigation/LimitTag.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/tags/navigation/LimitTag.class.php');
|
||||||
|
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/QueryArgument.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/QueryArgument.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/SortQueryArgument.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/SortQueryArgument.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/validator/QueryArgumentValidator.class.php');
|
||||||
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/DefaultValue.class.php');
|
require(_XE_PATH_.'classes/xml/xmlquery/queryargument/DefaultValue.class.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* New XmlQueryParser class <br />
|
||||||
|
* Parses XE XML query files
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class XmlQueryParser extends XmlParser {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* New XmlQueryParser class
|
* Create XmlQueryParser instance for Singleton
|
||||||
* @author NHN (developers@xpressengine.com)
|
|
||||||
* @brief case to parse XE xml query
|
|
||||||
* @version 0.1
|
|
||||||
*
|
*
|
||||||
* @todo need to support extend query such as subquery, union
|
* @return XmlQueryParser object
|
||||||
* @todo include info about column types for parsing user input
|
|
||||||
*/
|
*/
|
||||||
class XmlQueryParser extends XmlParser {
|
function &getInstance()
|
||||||
/**
|
|
||||||
* constructor
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function XmlQueryParser(){
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create XmlQueryParser instance for Singleton
|
|
||||||
* @return XmlQueryParser object
|
|
||||||
*/
|
|
||||||
function &getInstance(){
|
|
||||||
static $theInstance = null;
|
|
||||||
if(!isset($theInstance)){
|
|
||||||
$theInstance = new XmlQueryParser();
|
|
||||||
}
|
|
||||||
return $theInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 1. Read xml file<br />
|
|
||||||
* 2. Check the action<br />
|
|
||||||
* 3. Parsing and write a cache file<br />
|
|
||||||
* @return QueryParser object
|
|
||||||
*/
|
|
||||||
function &parse_xml_query($query_id, $xml_file, $cache_file)
|
|
||||||
{
|
{
|
||||||
// Read xml file
|
static $theInstance = NULL;
|
||||||
$xml_obj = $this->getXmlFileContent($xml_file);
|
if(!isset($theInstance)){
|
||||||
|
$theInstance = new XmlQueryParser();
|
||||||
// insert, update, delete, select action
|
}
|
||||||
$action = strtolower($xml_obj->query->attrs->action);
|
return $theInstance;
|
||||||
if(!$action) return;
|
|
||||||
|
|
||||||
// Write query cache file
|
|
||||||
$parser = new QueryParser($xml_obj->query);
|
|
||||||
FileHandler::writeFile($cache_file, $parser->toString());
|
|
||||||
|
|
||||||
return $parser;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Query XML file parsing
|
|
||||||
* @return QueryParser object
|
|
||||||
*/
|
|
||||||
function parse($query_id = NULL, $xml_file = NULL, $cache_file = NULL)
|
|
||||||
{
|
|
||||||
$this->parse_xml_query($query_id, $xml_file, $cache_file);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return XML file content
|
* Parses an XML query file
|
||||||
* @return array|NULL Returns a resultant data object or NULL in case of error
|
*
|
||||||
*/
|
* 1. Read xml file <br />
|
||||||
function getXmlFileContent($xml_file){
|
* 2. Check the action <br />
|
||||||
$buff = FileHandler::readFile($xml_file);
|
* 3. Parse and write cache file <br />
|
||||||
$xml_obj = parent::parse($buff);
|
*
|
||||||
if(!$xml_obj) return;
|
* @param $query_id
|
||||||
unset($buff);
|
* @param $xml_file
|
||||||
return $xml_obj;
|
* @param $cache_file
|
||||||
}
|
*
|
||||||
}
|
* @return QueryParser object
|
||||||
|
*/
|
||||||
|
function &parse_xml_query($query_id, $xml_file, $cache_file)
|
||||||
|
{
|
||||||
|
// Read xml file
|
||||||
|
$xml_obj = $this->getXmlFileContent($xml_file);
|
||||||
|
|
||||||
|
// insert, update, delete, select action
|
||||||
|
$action = strtolower($xml_obj->query->attrs->action);
|
||||||
|
if(!$action) return;
|
||||||
|
|
||||||
|
// Write query cache file
|
||||||
|
$parser = new QueryParser($xml_obj->query);
|
||||||
|
FileHandler::writeFile($cache_file, $parser->toString());
|
||||||
|
|
||||||
|
return $parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Override for parent "parse" method
|
||||||
|
*
|
||||||
|
* @param null $query_id
|
||||||
|
* @param null $xml_file
|
||||||
|
* @param null $cache_file
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function parse($query_id = NULL, $xml_file = NULL, $cache_file = NULL)
|
||||||
|
{
|
||||||
|
$this->parse_xml_query($query_id, $xml_file, $cache_file);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns XML file contents as an object
|
||||||
|
* or NULL in case of error
|
||||||
|
*
|
||||||
|
* @param $xml_file
|
||||||
|
* @return array|NULL
|
||||||
|
*/
|
||||||
|
function getXmlFileContent($xml_file)
|
||||||
|
{
|
||||||
|
$buff = FileHandler::readFile($xml_file);
|
||||||
|
$xml_obj = parent::parse($buff);
|
||||||
|
if(!$xml_obj) return;
|
||||||
|
unset($buff);
|
||||||
|
return $xml_obj;
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,193 +1,272 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* File containing the DBParser class
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Escapes query statements: <br />
|
||||||
|
* - column names: member.member_srl => "member"."member_srl" <br />
|
||||||
|
* - expressions: SUM(member.member_srl) => SUM("member"."member_srl") <br />
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class DBParser
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* DBParser class
|
* Character for escape target value on the left
|
||||||
* @author NHN (developers@xpressengine.com)
|
*
|
||||||
* @package /classes/xml/xmlquery
|
* For example, in CUBRID left and right escape
|
||||||
* @version 0.1
|
* chars are the same, the double quote - " <br />
|
||||||
|
* But for SQL Server, the escape is made with
|
||||||
|
* [double brackets], so the left and right char differ
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
*/
|
*/
|
||||||
class DBParser {
|
var $escape_char_left;
|
||||||
/**
|
|
||||||
* Character for escape target value on the left
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
var $escape_char_left;
|
|
||||||
/**
|
|
||||||
* Character for escape target value on the right
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
var $escape_char_right;
|
|
||||||
/**
|
|
||||||
* Table prefix string
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
var $table_prefix;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* Character for escape target value on the right
|
||||||
* @param string $escape_char_left
|
*
|
||||||
* @param string $escape_char_right
|
* For example, in CUBRID left and right escape
|
||||||
* @param string $table_prefix
|
* chars are the same, the double quote - " <br />
|
||||||
* @return void
|
* But for SQL Server, the escape is made with
|
||||||
*/
|
* [double brackets], so the left and right char differ
|
||||||
function DBParser($escape_char_left, $escape_char_right = "", $table_prefix = "xe_"){
|
*
|
||||||
$this->escape_char_left = $escape_char_left;
|
* @var string
|
||||||
if ($escape_char_right !== "")$this->escape_char_right = $escape_char_right;
|
*/
|
||||||
else $this->escape_char_right = $escape_char_left;
|
var $escape_char_right;
|
||||||
$this->table_prefix = $table_prefix;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get escape character
|
* Table prefix string
|
||||||
* @param string $leftOrRight left or right
|
*
|
||||||
* @return string
|
* Default is "xe_"
|
||||||
*/
|
*
|
||||||
function getEscapeChar($leftOrRight){
|
* @var string
|
||||||
if ($leftOrRight === 'left')return $this->escape_char_left;
|
*/
|
||||||
else return $this->escape_char_right;
|
var $table_prefix;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* escape the value
|
* Constructor
|
||||||
* @param mixed $name
|
*
|
||||||
* @return string
|
* @param string $escape_char_left
|
||||||
*/
|
* @param string $escape_char_right
|
||||||
function escape($name){
|
* @param string $table_prefix
|
||||||
return $this->escape_char_left . $name . $this->escape_char_right;
|
*
|
||||||
}
|
* @return void
|
||||||
|
*/
|
||||||
|
function DBParser($escape_char_left, $escape_char_right = "", $table_prefix = "xe_")
|
||||||
|
{
|
||||||
|
$this->escape_char_left = $escape_char_left;
|
||||||
|
if ($escape_char_right !== "")$this->escape_char_right = $escape_char_right;
|
||||||
|
else $this->escape_char_right = $escape_char_left;
|
||||||
|
$this->table_prefix = $table_prefix;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* escape the string value
|
* Get escape character
|
||||||
* @param string $name
|
*
|
||||||
* @return string
|
* @param string $leftOrRight left or right
|
||||||
*/
|
* @return string
|
||||||
function escapeString($name){
|
*/
|
||||||
return "'".$this->escapeStringValue($name)."'";
|
function getEscapeChar($leftOrRight)
|
||||||
}
|
{
|
||||||
|
if ($leftOrRight === 'left')return $this->escape_char_left;
|
||||||
|
else return $this->escape_char_right;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* escape the string value
|
* Escape the value
|
||||||
* @param string $value
|
*
|
||||||
* @return string
|
* @param mixed $name
|
||||||
*/
|
* @return string
|
||||||
function escapeStringValue($value){
|
*/
|
||||||
if($value == "*") return $value;
|
function escape($name)
|
||||||
if (is_string($value)) return $value = str_replace("'","''",$value);
|
{
|
||||||
return $value;
|
return $this->escape_char_left . $name . $this->escape_char_right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return table full name
|
* Escape the string value
|
||||||
* @param string $name table name without table prefix
|
*
|
||||||
* @return string table full name with table prefix
|
* @param string $name
|
||||||
*/
|
* @return string
|
||||||
function parseTableName($name){
|
*/
|
||||||
return $this->table_prefix . $name;
|
function escapeString($name)
|
||||||
}
|
{
|
||||||
|
return "'".$this->escapeStringValue($name)."'";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return colmun name after escape
|
* Escape the string value
|
||||||
* @param string $name column name before escape
|
*
|
||||||
* @return string column name after escape
|
* @param string $value
|
||||||
*/
|
* @return string
|
||||||
function parseColumnName($name){
|
*/
|
||||||
return $this->escapeColumn($name);
|
function escapeStringValue($value)
|
||||||
}
|
{
|
||||||
|
if($value == "*") return $value;
|
||||||
|
if (is_string($value)) return $value = str_replace("'","''",$value);
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escape column
|
* Return table full name
|
||||||
* @param string $column_name
|
*
|
||||||
* @return string column name with db name
|
* @param string $name table name without table prefix
|
||||||
*/
|
*
|
||||||
function escapeColumn($column_name){
|
* @return string table full name with table prefix
|
||||||
if($this->isUnqualifiedColumnName($column_name))
|
*/
|
||||||
return $this->escape($column_name);
|
function parseTableName($name)
|
||||||
if($this->isQualifiedColumnName($column_name)){
|
{
|
||||||
list($table, $column) = explode('.', $column_name);
|
return $this->table_prefix . $name;
|
||||||
// $table can also be an alias, so the prefix should not be added
|
}
|
||||||
return $this->escape($table).'.'.$this->escape($column);
|
|
||||||
//return $this->escape($this->parseTableName($table)).'.'.$this->escape($column);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Column name is suitable for use in checking
|
* Return column name after escape
|
||||||
* @param string $column_name
|
*
|
||||||
* @return bool
|
* @param string $name column name before escape
|
||||||
*/
|
*
|
||||||
function isUnqualifiedColumnName($column_name){
|
* @return string column name after escape
|
||||||
if(strpos($column_name,'.')===false && strpos($column_name,'(')===false) return true;
|
*/
|
||||||
return false;
|
function parseColumnName($name)
|
||||||
}
|
{
|
||||||
|
return $this->escapeColumn($name);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Column name is suitable for use in checking
|
* Escape column name
|
||||||
* @param string $column_name
|
*
|
||||||
* @return bool
|
* @param string $column_name
|
||||||
*/
|
* @return string column name with db name
|
||||||
function isQualifiedColumnName($column_name){
|
*/
|
||||||
if(strpos($column_name,'.')!==false && strpos($column_name,'(')===false) return true;
|
function escapeColumn($column_name)
|
||||||
return false;
|
{
|
||||||
}
|
if($this->isUnqualifiedColumnName($column_name))
|
||||||
|
return $this->escape($column_name);
|
||||||
function parseExpression($column_name){
|
if($this->isQualifiedColumnName($column_name)){
|
||||||
$functions = preg_split('/([\+\-\*\/\ ])/', $column_name, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
|
list($table, $column) = explode('.', $column_name);
|
||||||
foreach($functions as $k => $v){
|
// $table can also be an alias, so the prefix should not be added
|
||||||
$function = &$functions[$k];
|
return $this->escape($table).'.'.$this->escape($column);
|
||||||
if(strlen($function)==1) continue; // skip delimiters
|
//return $this->escape($this->parseTableName($table)).'.'.$this->escape($column);
|
||||||
$pos = strrpos("(", $function);
|
|
||||||
$matches = preg_split('/([a-zA-Z0-9_*]+)/', $function, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
|
|
||||||
$total_brackets = substr_count($function, "(");
|
|
||||||
$brackets = 0;
|
|
||||||
foreach($matches as $i => $j){
|
|
||||||
$match = &$matches[$i];
|
|
||||||
if($match == '(') {$brackets++; continue;}
|
|
||||||
if(strpos($match,')') !== false) continue;
|
|
||||||
if(in_array($match, array(',', '.'))) continue;
|
|
||||||
if($brackets == $total_brackets){
|
|
||||||
if(!is_numeric($match)) {
|
|
||||||
$match = $this->escapeColumnExpression($match);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$function = implode('', $matches);
|
|
||||||
}
|
|
||||||
return implode('', $functions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Checks argument is asterisk
|
|
||||||
* @param string $column_name
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function isStar($column_name){
|
|
||||||
if(substr($column_name,-1) == '*') return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Checks to see if expression is an aggregate star function
|
|
||||||
* like count(*)
|
|
||||||
* @param string $column_name
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
function isStarFunction($column_name){
|
|
||||||
if(strpos($column_name, "(*)")!==false) return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return column name after escape
|
|
||||||
* @param string $column_name
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function escapeColumnExpression($column_name){
|
|
||||||
if($this->isStar($column_name)) return $column_name;
|
|
||||||
if($this->isStarFunction($column_name)){
|
|
||||||
return $column_name;
|
|
||||||
}
|
|
||||||
if(strpos(strtolower($column_name), 'distinct') !== false) return $column_name;
|
|
||||||
return $this->escapeColumn($column_name);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to see if a given column name is unqualified
|
||||||
|
*
|
||||||
|
* Ex: "member_srl" -> unqualified <br />
|
||||||
|
* "member"."member_srl" -> qualified
|
||||||
|
*
|
||||||
|
* @param string $column_name
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function isUnqualifiedColumnName($column_name)
|
||||||
|
{
|
||||||
|
if(strpos($column_name,'.')===FALSE && strpos($column_name,'(')===FALSE) return TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to see if a given column name is qualified
|
||||||
|
*
|
||||||
|
* Ex: "member_srl" -> unqualified <br />
|
||||||
|
* "member"."member_srl" -> qualified
|
||||||
|
*
|
||||||
|
* @param string $column_name
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function isQualifiedColumnName($column_name)
|
||||||
|
{
|
||||||
|
if(strpos($column_name,'.')!==FALSE && strpos($column_name,'(')===FALSE) return TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escapes a query expression
|
||||||
|
*
|
||||||
|
* An expression can be: <br />
|
||||||
|
* <ul>
|
||||||
|
* <li> a column name: "member_srl" or "xe_member"."member_srl"
|
||||||
|
* <li> an expression:
|
||||||
|
* <ul>
|
||||||
|
* <li> LEFT(UPPER("content")) <br />
|
||||||
|
* <li> readed_count + voted_count <br />
|
||||||
|
* <li> CAST(regdate as DATE) </li>
|
||||||
|
* </ul>
|
||||||
|
* </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param $column_name
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function parseExpression($column_name)
|
||||||
|
{
|
||||||
|
$functions = preg_split('/([\+\-\*\/\ ])/', $column_name, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
|
||||||
|
foreach($functions as $k => $v){
|
||||||
|
$function = &$functions[$k];
|
||||||
|
if(strlen($function)==1) continue; // skip delimiters
|
||||||
|
$pos = strrpos("(", $function);
|
||||||
|
$matches = preg_split('/([a-zA-Z0-9_*]+)/', $function, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
|
||||||
|
$total_brackets = substr_count($function, "(");
|
||||||
|
$brackets = 0;
|
||||||
|
foreach($matches as $i => $j){
|
||||||
|
$match = &$matches[$i];
|
||||||
|
if($match == '(') {$brackets++; continue;}
|
||||||
|
if(strpos($match,')') !== FALSE) continue;
|
||||||
|
if(in_array($match, array(',', '.'))) continue;
|
||||||
|
if($brackets == $total_brackets){
|
||||||
|
if(!is_numeric($match) && !in_array(strtoupper($match), array('UNSIGNED', 'INTEGER', 'AS'))) {
|
||||||
|
$match = $this->escapeColumnExpression($match);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$function = implode('', $matches);
|
||||||
|
}
|
||||||
|
return implode('', $functions);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if a given argument is an asterisk
|
||||||
|
*
|
||||||
|
* @param string $column_name
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function isStar($column_name)
|
||||||
|
{
|
||||||
|
if(substr($column_name,-1) == '*') return TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks to see if expression is an aggregate star function
|
||||||
|
* like count(*)
|
||||||
|
*
|
||||||
|
* @param string $column_name
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
function isStarFunction($column_name)
|
||||||
|
{
|
||||||
|
if(strpos($column_name, "(*)")!==FALSE) return TRUE;
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return column name after escape
|
||||||
|
* @param string $column_name
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function escapeColumnExpression($column_name)
|
||||||
|
{
|
||||||
|
if($this->isStar($column_name)) return $column_name;
|
||||||
|
if($this->isStarFunction($column_name))
|
||||||
|
{
|
||||||
|
return $column_name;
|
||||||
|
}
|
||||||
|
if(strpos(strtolower($column_name), 'distinct') !== FALSE) return $column_name;
|
||||||
|
return $this->escapeColumn($column_name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,92 +1,108 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* File containing the QueryParser class
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
* Parses an XML Object and returns a string used for generating the PHP cache file <br />
|
||||||
|
* The XML Object structure must be the one defined in the XmlParser class
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class QueryParser {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QueryParser class
|
* Property containing the associated QueryTag object
|
||||||
* @author NHN (developers@xpressengine.com)
|
*
|
||||||
* @package /classes/xml/xmlquery
|
* @var QueryTag object
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class QueryParser {
|
var $queryTag;
|
||||||
/**
|
|
||||||
* QueryTag object
|
|
||||||
* @var QueryTag object
|
|
||||||
*/
|
|
||||||
var $queryTag;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* Constructor
|
||||||
* @param object $query
|
*
|
||||||
* @param bool $isSubQuery
|
* @param object $query XML object obtained after reading the XML Query file
|
||||||
* @return void
|
* @param bool $isSubQuery
|
||||||
*/
|
* @return void
|
||||||
function QueryParser($query = NULL, $isSubQuery = false) {
|
*/
|
||||||
if ($query)
|
function QueryParser($query = NULL, $isSubQuery = FALSE)
|
||||||
$this->queryTag = new QueryTag($query, $isSubQuery);
|
{
|
||||||
}
|
if ($query)
|
||||||
|
{
|
||||||
|
$this->queryTag = new QueryTag($query, $isSubQuery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return table information
|
* Returns table information
|
||||||
* @param object $query_id
|
*
|
||||||
* @param bool $table_name
|
* Used for finding column type info (string/numeric) <br />
|
||||||
* @return array
|
* Obtains the table info from XE's XML schema files
|
||||||
*/
|
*
|
||||||
function getTableInfo($query_id, $table_name) {
|
* @param object $query_id
|
||||||
$column_type = array();
|
* @param bool $table_name
|
||||||
$module = '';
|
* @return array
|
||||||
|
*/
|
||||||
|
function getTableInfo($query_id, $table_name) {
|
||||||
|
$column_type = array();
|
||||||
|
$module = '';
|
||||||
|
|
||||||
$id_args = explode('.', $query_id);
|
$id_args = explode('.', $query_id);
|
||||||
if (count($id_args) == 2) {
|
if (count($id_args) == 2) {
|
||||||
$target = 'modules';
|
$target = 'modules';
|
||||||
$module = $id_args[0];
|
$module = $id_args[0];
|
||||||
$id = $id_args[1];
|
$id = $id_args[1];
|
||||||
} elseif (count($id_args) == 3) {
|
} elseif (count($id_args) == 3) {
|
||||||
$target = $id_args[0];
|
$target = $id_args[0];
|
||||||
$targetList = array('modules'=>1, 'addons'=>1, 'widgets'=>1);
|
$targetList = array('modules'=>1, 'addons'=>1, 'widgets'=>1);
|
||||||
if (!isset($targetList[$target]))
|
if (!isset($targetList[$target]))
|
||||||
return;
|
return;
|
||||||
$module = $id_args[1];
|
$module = $id_args[1];
|
||||||
$id = $id_args[2];
|
$id = $id_args[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
// get column properties from the table
|
// get column properties from the table
|
||||||
$table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $module, $table_name);
|
$table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $module, $table_name);
|
||||||
if (!file_exists($table_file)) {
|
if (!file_exists($table_file)) {
|
||||||
$searched_list = FileHandler::readDir(_XE_PATH_ . 'modules');
|
$searched_list = FileHandler::readDir(_XE_PATH_ . 'modules');
|
||||||
$searched_count = count($searched_list);
|
$searched_count = count($searched_list);
|
||||||
for ($i = 0; $i < $searched_count; $i++) {
|
for ($i = 0; $i < $searched_count; $i++) {
|
||||||
$table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $searched_list[$i], $table_name);
|
$table_file = sprintf('%s%s/%s/schemas/%s.xml', _XE_PATH_, 'modules', $searched_list[$i], $table_name);
|
||||||
if (file_exists($table_file))
|
if (file_exists($table_file))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_exists($table_file)) {
|
if (file_exists($table_file)) {
|
||||||
$table_xml = FileHandler::readFile($table_file);
|
$table_xml = FileHandler::readFile($table_file);
|
||||||
$xml_parser = new XmlParser();
|
$xml_parser = new XmlParser();
|
||||||
$table_obj = $xml_parser->parse($table_xml);
|
$table_obj = $xml_parser->parse($table_xml);
|
||||||
if ($table_obj->table) {
|
if ($table_obj->table) {
|
||||||
if (isset($table_obj->table->column) && !is_array($table_obj->table->column)) {
|
if (isset($table_obj->table->column) && !is_array($table_obj->table->column)) {
|
||||||
$table_obj->table->column = array($table_obj->table->column);
|
$table_obj->table->column = array($table_obj->table->column);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($table_obj->table->column as $k => $v) {
|
foreach ($table_obj->table->column as $k => $v) {
|
||||||
$column_type[$v->attrs->name] = $v->attrs->type;
|
$column_type[$v->attrs->name] = $v->attrs->type;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $column_type;
|
return $column_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change code string from queryTag object
|
* Returns the contents for the query cache file
|
||||||
* @return string
|
*
|
||||||
*/
|
* @return string
|
||||||
function toString() {
|
*/
|
||||||
return "<?php if(!defined('__ZBXE__')) exit();\n"
|
function toString() {
|
||||||
. $this->queryTag->toString()
|
return "<?php if(!defined('__ZBXE__')) exit();\n"
|
||||||
. 'return $query; ?>';
|
. $this->queryTag->toString()
|
||||||
}
|
. 'return $query; ?>';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,7 @@ class Argument {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUnescapedValue() {
|
function getUnescapedValue() {
|
||||||
|
if($this->value === 'null') return null;
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -163,19 +164,47 @@ class Argument {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function _escapeStringValue($value) {
|
function _escapeStringValue($value) {
|
||||||
|
// Remove non-utf8 chars.
|
||||||
|
$regex = '@((?:[\x00-\x7F]|[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}){1,100})|([\xF0-\xF7][\x80-\xBF]{3})|([\x80-\xBF])|([\xC0-\xFF])@x';
|
||||||
|
|
||||||
|
$value = preg_replace_callback($regex, array($this, 'utf8Replacer'), $value);
|
||||||
$db = &DB::getInstance();
|
$db = &DB::getInstance();
|
||||||
$value = $db->addQuotes($value);
|
$value = $db->addQuotes($value);
|
||||||
return '\'' . $value . '\'';
|
return '\'' . $value . '\'';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function utf8Replacer($captures) {
|
||||||
|
if (!empty($captures[1]))
|
||||||
|
{
|
||||||
|
// Valid byte sequence. Return unmodified.
|
||||||
|
return $captures[1];
|
||||||
|
}
|
||||||
|
elseif(!empty($captures[2]))
|
||||||
|
{
|
||||||
|
// Remove user defined area
|
||||||
|
if("\xF3\xB0\x80\x80" <= $captures[2])
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $captures[2];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function isValid() {
|
function isValid() {
|
||||||
return $this->isValid;
|
return $this->isValid;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isColumnName(){
|
function isColumnName(){
|
||||||
$type = $this->getType();
|
$type = $this->getType();
|
||||||
|
$value = $this->getUnescapedValue();
|
||||||
if($type == 'column_name') return true;
|
if($type == 'column_name') return true;
|
||||||
if($type == 'number' && !is_numeric($this->value) && $this->uses_default_value) return true;
|
if($type == 'number' && is_null($value)) return false;
|
||||||
|
if($type == 'number' && !is_numeric($value) && $this->uses_default_value) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +1,29 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Models the <column> tag inside an XML Query file <br />
|
||||||
|
* Since the <column> tag supports different attributes depending on
|
||||||
|
* the type of query (select, update, insert, delete) this is only
|
||||||
|
* the base class for the classes that will model each type <column> tag.
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery\tags\column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class ColumnTag
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* ColumnTag class
|
* Column name
|
||||||
* Models the <column> tag inside an XML Query file
|
* @var string
|
||||||
* Since the <column> tag supports different attributes depending on
|
|
||||||
* the type of query (select, update, insert, delete) this is only
|
|
||||||
* the base class for the classes that will model each type <column> tag.
|
|
||||||
*
|
|
||||||
* @author Arnia Software
|
|
||||||
* @package /classes/xml/xmlquery/tags/column
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class ColumnTag {
|
var $name;
|
||||||
/**
|
|
||||||
* Column name
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
var $name;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* Constructor
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function ColumnTag($name){
|
function ColumnTag($name)
|
||||||
$this->name = $name;
|
{
|
||||||
}
|
$this->name = $name;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,40 +1,58 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Models the <column> tag inside an XML Query file whose action is 'insert'
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery\tags\column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class InsertColumnTag extends ColumnTag
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* InsertColumnTag
|
* Argument
|
||||||
* Models the <column> tag inside an XML Query file whose action is 'insert'
|
|
||||||
*
|
*
|
||||||
* @author Arnia Software
|
* @var QueryArgument object
|
||||||
* @package /classes/xml/xmlquery/tags/column
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class InsertColumnTag extends ColumnTag {
|
var $argument;
|
||||||
/**
|
|
||||||
* argument
|
|
||||||
* @var QueryArgument object
|
|
||||||
*/
|
|
||||||
var $argument;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* constructor
|
|
||||||
* @param object $column
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
function InsertColumnTag($column) {
|
|
||||||
parent::ColumnTag($column->attrs->name);
|
|
||||||
$dbParser = DB::getParser();
|
|
||||||
$this->name = $dbParser->parseColumnName($this->name);
|
|
||||||
$this->argument = new QueryArgument($column);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getExpressionString(){
|
|
||||||
return sprintf('new InsertExpression(\'%s\', ${\'%s_argument\'})'
|
|
||||||
, $this->name
|
|
||||||
, $this->argument->argument_name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getArgument(){
|
|
||||||
return $this->argument;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param object $column
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function InsertColumnTag($column)
|
||||||
|
{
|
||||||
|
parent::ColumnTag($column->attrs->name);
|
||||||
|
$dbParser = DB::getParser();
|
||||||
|
$this->name = $dbParser->parseColumnName($this->name);
|
||||||
|
$this->argument = new QueryArgument($column);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string to be output in the cache file
|
||||||
|
* used for instantiating an InsertExpression when a
|
||||||
|
* query is executed
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getExpressionString()
|
||||||
|
{
|
||||||
|
return sprintf('new InsertExpression(\'%s\', ${\'%s_argument\'})'
|
||||||
|
, $this->name
|
||||||
|
, $this->argument->argument_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the QueryArgument object associated with this INSERT statement
|
||||||
|
*
|
||||||
|
* @return QueryArgument
|
||||||
|
*/
|
||||||
|
function getArgument()
|
||||||
|
{
|
||||||
|
return $this->argument;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,45 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Models the <column> tag inside an XML Query file whose action is 'insert-select'
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery\tags\column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class InsertColumnTagWithoutArgument extends ColumnTag
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* InsertColumnTagWithoutArgument
|
* Constructor
|
||||||
* Models the <column> tag inside an XML Query file whose action is 'insert-select'
|
|
||||||
*
|
*
|
||||||
* @author Arnia Software
|
* @param object $column
|
||||||
* @package /classes/xml/xmlquery/tags/column
|
* @return void
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class InsertColumnTagWithoutArgument extends ColumnTag {
|
function InsertColumnTagWithoutArgument($column)
|
||||||
/**
|
{
|
||||||
* constructor
|
parent::ColumnTag($column->attrs->name);
|
||||||
* @param object $column
|
$dbParser = DB::getParser();
|
||||||
* @return void
|
$this->name = $dbParser->parseColumnName($this->name);
|
||||||
*/
|
|
||||||
function InsertColumnTagWithoutArgument($column) {
|
|
||||||
parent::ColumnTag($column->attrs->name);
|
|
||||||
$dbParser = DB::getParser();
|
|
||||||
$this->name = $dbParser->parseColumnName($this->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getExpressionString(){
|
|
||||||
return sprintf('new Expression(\'%s\')', $this->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getArgument(){
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string to be output in the cache file
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getExpressionString()
|
||||||
|
{
|
||||||
|
return sprintf('new Expression(\'%s\')', $this->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the QueryArgument object associated with this INSERT statement
|
||||||
|
*
|
||||||
|
* @return null
|
||||||
|
*/
|
||||||
|
function getArgument()
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,65 +1,72 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Models the <columns> tag inside an XML Query file whose action is 'insert'
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery\tags\column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class InsertColumnsTag
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* InsertColumnsTag class
|
* Column list
|
||||||
* Models the <column> tag inside an XML Query file whose action is 'insert'
|
|
||||||
*
|
*
|
||||||
* @author Arnia Software
|
* @var array value is InsertColumnTag object
|
||||||
* @package /classes/xml/xmlquery/tags/column
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class InsertColumnsTag{
|
var $columns;
|
||||||
/**
|
|
||||||
* Column list
|
|
||||||
* @var array value is InsertColumnTag object
|
|
||||||
*/
|
|
||||||
var $columns;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* Constructor
|
||||||
* @param array|string $xml_columns
|
*
|
||||||
* @return void
|
* @param array|string $xml_columns
|
||||||
*/
|
* @return void
|
||||||
function InsertColumnsTag($xml_columns) {
|
*/
|
||||||
$this->columns = array();
|
function InsertColumnsTag($xml_columns)
|
||||||
|
{
|
||||||
|
$this->columns = array();
|
||||||
|
|
||||||
if(!$xml_columns)
|
if(!$xml_columns)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!is_array($xml_columns)) $xml_columns = array($xml_columns);
|
if(!is_array($xml_columns)) $xml_columns = array($xml_columns);
|
||||||
|
|
||||||
foreach($xml_columns as $column){
|
foreach($xml_columns as $column){
|
||||||
if($column->name === 'query') $this->columns[] = new QueryTag($column, true);
|
if($column->name === 'query') $this->columns[] = new QueryTag($column, true);
|
||||||
else if(!isset($column->attrs->var) && !isset($column->attrs->default)) $this->columns[] = new InsertColumnTagWithoutArgument($column);
|
else if(!isset($column->attrs->var) && !isset($column->attrs->default)) $this->columns[] = new InsertColumnTagWithoutArgument($column);
|
||||||
else $this->columns[] = new InsertColumnTag($column);
|
else $this->columns[] = new InsertColumnTag($column);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* InsertColumnTag object to string
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function toString(){
|
|
||||||
$output_columns = 'array(' . PHP_EOL;
|
|
||||||
foreach($this->columns as $column){
|
|
||||||
$output_columns .= $column->getExpressionString() . PHP_EOL . ',';
|
|
||||||
}
|
|
||||||
$output_columns = substr($output_columns, 0, -1);
|
|
||||||
$output_columns .= ')';
|
|
||||||
return $output_columns;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return argument list
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function getArguments(){
|
|
||||||
$arguments = array();
|
|
||||||
foreach($this->columns as $column){
|
|
||||||
$arguments[] = $column->getArgument();
|
|
||||||
}
|
|
||||||
return $arguments;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* InsertColumnTag object to string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function toString()
|
||||||
|
{
|
||||||
|
$output_columns = 'array(' . PHP_EOL;
|
||||||
|
foreach($this->columns as $column){
|
||||||
|
$output_columns .= $column->getExpressionString() . PHP_EOL . ',';
|
||||||
|
}
|
||||||
|
$output_columns = substr($output_columns, 0, -1);
|
||||||
|
$output_columns .= ')';
|
||||||
|
return $output_columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return argument list
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function getArguments()
|
||||||
|
{
|
||||||
|
$arguments = array();
|
||||||
|
foreach($this->columns as $column){
|
||||||
|
$arguments[] = $column->getArgument();
|
||||||
|
}
|
||||||
|
return $arguments;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,53 +1,71 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Models the <column> tag inside an XML Query file whose action is 'select'
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery\tags\column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class SelectColumnTag extends ColumnTag
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* SelectColumnTag
|
* Column alias
|
||||||
* Models the <column> tag inside an XML Query file whose action is 'select'
|
|
||||||
*
|
*
|
||||||
* @author Arnia Software
|
* @var string
|
||||||
* @package /classes/xml/xmlquery/tags/column
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class SelectColumnTag extends ColumnTag{
|
var $alias;
|
||||||
/**
|
|
||||||
* alias
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
var $alias;
|
|
||||||
/**
|
|
||||||
* click count status
|
|
||||||
* @var bool
|
|
||||||
*/
|
|
||||||
var $click_count;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* Click count status
|
||||||
* @param string|object $column
|
*
|
||||||
* @return void
|
* @var bool
|
||||||
*/
|
*/
|
||||||
function SelectColumnTag($column){
|
var $click_count;
|
||||||
if ($column == "*" || $column->attrs->name == '*')
|
|
||||||
{
|
|
||||||
parent::ColumnTag(NULL);
|
|
||||||
$this->name = "*";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
parent::ColumnTag($column->attrs->name);
|
|
||||||
$dbParser = new DB(); $dbParser = &$dbParser->getParser();
|
|
||||||
$this->name = $dbParser->parseExpression($this->name);
|
|
||||||
|
|
||||||
$this->alias = $column->attrs->alias;
|
/**
|
||||||
$this->click_count = $column->attrs->click_count;
|
* Constructor
|
||||||
}
|
*
|
||||||
|
* @param string|object $column
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function SelectColumnTag($column)
|
||||||
|
{
|
||||||
|
if ($column == "*" || $column->attrs->name == '*')
|
||||||
|
{
|
||||||
|
parent::ColumnTag(NULL);
|
||||||
|
$this->name = "*";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parent::ColumnTag($column->attrs->name);
|
||||||
|
$dbParser = new DB(); $dbParser = &$dbParser->getParser();
|
||||||
|
$this->name = $dbParser->parseExpression($this->name);
|
||||||
|
|
||||||
function getExpressionString(){
|
$this->alias = $column->attrs->alias;
|
||||||
if($this->name == '*') return "new StarExpression()";
|
$this->click_count = $column->attrs->click_count;
|
||||||
if($this->click_count)
|
|
||||||
return sprintf('new ClickCountExpression(%s, %s, $args->%s)', $this->name, $this->alias,$this->click_count);
|
|
||||||
if(strpos($this->name, '$') === 0)
|
|
||||||
return sprintf('new SelectExpression($args->%s)', substr($this->name, 1));
|
|
||||||
$dbParser = DB::getParser();
|
|
||||||
return sprintf('new SelectExpression(\'%s\'%s)', $this->name, $this->alias ? ', \''.$dbParser->escape($this->alias) .'\'': '');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string to be output in the cache file
|
||||||
|
*
|
||||||
|
* A select column tag in an XML query can be used for:
|
||||||
|
* <ul>
|
||||||
|
* <li> a star expression: SELECT *
|
||||||
|
* <li> a click count expression: SELECT + UPDATE
|
||||||
|
* <li> any other select expression (column name, function call etc). </li>
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getExpressionString()
|
||||||
|
{
|
||||||
|
if($this->name == '*') return "new StarExpression()";
|
||||||
|
if($this->click_count)
|
||||||
|
return sprintf('new ClickCountExpression(\'%s\', %s, $args->%s)', $this->name, $this->alias ? '\'' . $this->alias . '\'' : "''",$this->click_count);
|
||||||
|
if(strpos($this->name, '$') === 0)
|
||||||
|
return sprintf('new SelectExpression($args->%s)', substr($this->name, 1));
|
||||||
|
$dbParser = DB::getParser();
|
||||||
|
return sprintf('new SelectExpression(\'%s\'%s)', $this->name, $this->alias ? ', \''.$dbParser->escape($this->alias) .'\'': '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,83 +1,92 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Models the <columns> tag inside an XML Query file whose action is 'select'
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery\tags\column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class SelectColumnsTag
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* SelectColumnTag class
|
* Column list
|
||||||
*
|
*
|
||||||
* @author Arnia Software
|
* @var array value is SelectColumnTag object
|
||||||
* @package /classes/xml/xmlquery/tags/column
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class SelectColumnsTag {
|
var $columns;
|
||||||
/**
|
|
||||||
* Column list
|
|
||||||
* @var array value is SelectColumnTag object
|
|
||||||
*/
|
|
||||||
var $columns;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* Constructor
|
||||||
* @param Xml_Node_ $xml_columns
|
*
|
||||||
* @return void
|
* @param $xml_columns_tag
|
||||||
*/
|
* @internal param \Xml_Node_ $xml_columns
|
||||||
function SelectColumnsTag($xml_columns_tag){
|
* @return void
|
||||||
if (!$xml_columns_tag)
|
*/
|
||||||
$xml_columns_tag = new Xml_Node_();
|
function SelectColumnsTag($xml_columns_tag)
|
||||||
|
{
|
||||||
|
if (!$xml_columns_tag)
|
||||||
|
$xml_columns_tag = new Xml_Node_();
|
||||||
|
|
||||||
$xml_columns = $xml_columns_tag->column;
|
$xml_columns = $xml_columns_tag->column;
|
||||||
$xml_queries = $xml_columns_tag->query;
|
$xml_queries = $xml_columns_tag->query;
|
||||||
|
|
||||||
$this->columns = array();
|
$this->columns = array();
|
||||||
|
|
||||||
if(!$xml_columns) {
|
if(!$xml_columns) {
|
||||||
$this->columns[] = new SelectColumnTag("*");
|
$this->columns[] = new SelectColumnTag("*");
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
if(!is_array($xml_columns)) $xml_columns = array($xml_columns);
|
|
||||||
|
|
||||||
foreach($xml_columns as $column){
|
|
||||||
$this->columns[] = new SelectColumnTag($column);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(!$xml_queries) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!is_array($xml_queries)) $xml_queries = array($xml_queries);
|
|
||||||
|
|
||||||
foreach($xml_queries as $column){
|
|
||||||
$this->columns[] = new QueryTag($column, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
if(!is_array($xml_columns)) $xml_columns = array($xml_columns);
|
||||||
* SelectColumnTag object to string
|
|
||||||
* @return string
|
foreach($xml_columns as $column){
|
||||||
*/
|
$this->columns[] = new SelectColumnTag($column);
|
||||||
function toString(){
|
|
||||||
$output_columns = 'array(' . PHP_EOL;
|
|
||||||
foreach($this->columns as $column){
|
|
||||||
if(is_a($column, 'QueryTag'))
|
|
||||||
$output_columns .= $column->toString() . PHP_EOL . ',';
|
|
||||||
else
|
|
||||||
$output_columns .= $column->getExpressionString() . PHP_EOL . ',';
|
|
||||||
}
|
|
||||||
$output_columns = substr($output_columns, 0, -1);
|
|
||||||
$output_columns .= ')';
|
|
||||||
return $output_columns;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return argument list
|
if(!$xml_queries) {
|
||||||
* @return array
|
return;
|
||||||
*/
|
}
|
||||||
function getArguments(){
|
|
||||||
$arguments = array();
|
if(!is_array($xml_queries)) $xml_queries = array($xml_queries);
|
||||||
foreach($this->columns as $column){
|
|
||||||
if(is_a($column, 'QueryTag'))
|
foreach($xml_queries as $column){
|
||||||
$arguments = array_merge($arguments, $column->getArguments());
|
$this->columns[] = new QueryTag($column, TRUE);
|
||||||
}
|
|
||||||
return $arguments;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string to be output in the cache file
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function toString()
|
||||||
|
{
|
||||||
|
$output_columns = 'array(' . PHP_EOL;
|
||||||
|
foreach($this->columns as $column){
|
||||||
|
if(is_a($column, 'QueryTag'))
|
||||||
|
$output_columns .= $column->toString() . PHP_EOL . ',';
|
||||||
|
else
|
||||||
|
$output_columns .= $column->getExpressionString() . PHP_EOL . ',';
|
||||||
|
}
|
||||||
|
$output_columns = substr($output_columns, 0, -1);
|
||||||
|
$output_columns .= ')';
|
||||||
|
return $output_columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return argument list
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function getArguments()
|
||||||
|
{
|
||||||
|
$arguments = array();
|
||||||
|
foreach($this->columns as $column){
|
||||||
|
if(is_a($column, 'QueryTag'))
|
||||||
|
$arguments = array_merge($arguments, $column->getArguments());
|
||||||
|
}
|
||||||
|
return $arguments;
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,73 +1,103 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Models the <column> tag inside an XML Query file whose action is 'update'
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery\tags\column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class UpdateColumnTag extends ColumnTag
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* UpdateColumnTag
|
* Argument
|
||||||
* Models the <column> tag inside an XML Query file whose action is 'update'
|
|
||||||
*
|
*
|
||||||
* @author Arnia Software
|
* @var QueryArgument object
|
||||||
* @package /classes/xml/xmlquery/tags/column
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class UpdateColumnTag extends ColumnTag {
|
var $argument;
|
||||||
/**
|
|
||||||
* argument
|
|
||||||
* @var QueryArgument object
|
|
||||||
*/
|
|
||||||
var $argument;
|
|
||||||
/**
|
|
||||||
* default value
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
var $default_value;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* Default value
|
||||||
* @param object $column
|
*
|
||||||
* @return void
|
* @var string
|
||||||
*/
|
*/
|
||||||
function UpdateColumnTag($column) {
|
var $default_value;
|
||||||
parent::ColumnTag($column->attrs->name);
|
|
||||||
$dbParser = DB::getParser();
|
/**
|
||||||
$this->name = $dbParser->parseColumnName($this->name);
|
* Constructor
|
||||||
if($column->attrs->var)
|
*
|
||||||
$this->argument = new QueryArgument($column);
|
* @param object $column
|
||||||
else {
|
* @return void
|
||||||
if(strpos($column->attrs->default, '.') !== false)
|
*/
|
||||||
$this->default_value = "'" . $dbParser->parseColumnName($column->attrs->default) . "'";
|
function UpdateColumnTag($column)
|
||||||
else {
|
{
|
||||||
$default_value = new DefaultValue($this->name, $column->attrs->default);
|
parent::ColumnTag($column->attrs->name);
|
||||||
if($default_value->isOperation())
|
|
||||||
$this->argument = new QueryArgument($column, true);
|
$dbParser = DB::getParser();
|
||||||
//else $this->default_value = $dbParser->parseColumnName($column->attrs->default);
|
$this->name = $dbParser->parseColumnName($this->name);
|
||||||
else {
|
|
||||||
$this->default_value = $default_value->toString();
|
if($column->attrs->var)
|
||||||
if($default_value->isStringFromFunction()){
|
$this->argument = new QueryArgument($column);
|
||||||
$this->default_value = '"\'".' . $this->default_value . '."\'"';
|
else {
|
||||||
}
|
if(strpos($column->attrs->default, '.') !== FALSE)
|
||||||
if($default_value->isString()){
|
{
|
||||||
$this->default_value = '"' . $this->default_value . '"';
|
$this->default_value = "'" . $dbParser->parseColumnName($column->attrs->default) . "'";
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
$default_value = new DefaultValue($this->name, $column->attrs->default);
|
||||||
|
if($default_value->isOperation())
|
||||||
|
{
|
||||||
|
$this->argument = new QueryArgument($column, TRUE);
|
||||||
|
}
|
||||||
|
//else $this->default_value = $dbParser->parseColumnName($column->attrs->default);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->default_value = $default_value->toString();
|
||||||
|
if($default_value->isStringFromFunction())
|
||||||
|
{
|
||||||
|
$this->default_value = '"\'".' . $this->default_value . '."\'"';
|
||||||
|
}
|
||||||
|
if($default_value->isString())
|
||||||
|
{
|
||||||
|
$this->default_value = '"' . $this->default_value . '"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getExpressionString(){
|
|
||||||
if($this->argument)
|
|
||||||
return sprintf('new UpdateExpression(\'%s\', ${\'%s_argument\'})'
|
|
||||||
, $this->name
|
|
||||||
, $this->argument->argument_name);
|
|
||||||
else {
|
|
||||||
return sprintf('new UpdateExpressionWithoutArgument(\'%s\', %s)'
|
|
||||||
, $this->name
|
|
||||||
, $this->default_value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getArgument(){
|
|
||||||
return $this->argument;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string to be output in the cache file
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getExpressionString()
|
||||||
|
{
|
||||||
|
if($this->argument)
|
||||||
|
{
|
||||||
|
return sprintf('new UpdateExpression(\'%s\', ${\'%s_argument\'})'
|
||||||
|
, $this->name
|
||||||
|
, $this->argument->argument_name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return sprintf('new UpdateExpressionWithoutArgument(\'%s\', %s)'
|
||||||
|
, $this->name
|
||||||
|
, $this->default_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the Argument associated with this update statement
|
||||||
|
*
|
||||||
|
* @return QueryArgument
|
||||||
|
*/
|
||||||
|
function getArgument()
|
||||||
|
{
|
||||||
|
return $this->argument;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,61 +1,68 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Models the <columns> tag inside an XML Query file whose action is 'update'
|
||||||
|
*
|
||||||
|
* @author Corina Udrescu (corina.udrescu@arnia.ro)
|
||||||
|
* @package classes\xml\xmlquery\tags\column
|
||||||
|
* @version 0.1
|
||||||
|
*/
|
||||||
|
class UpdateColumnsTag
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* UpdateColumnsTag
|
* Column list
|
||||||
* Models the <column> tag inside an XML Query file whose action is 'update'
|
|
||||||
*
|
*
|
||||||
* @author Arnia Software
|
* @var array value is UpdateColumnTag object
|
||||||
* @package /classes/xml/xmlquery/tags/column
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
class UpdateColumnsTag{
|
var $columns;
|
||||||
/**
|
|
||||||
* Column list
|
|
||||||
* @var array value is UpdateColumnTag object
|
|
||||||
*/
|
|
||||||
var $columns;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor
|
* Constructor
|
||||||
* @param array|string $xml_columns
|
*
|
||||||
* @return void
|
* @param array|object $xml_columns
|
||||||
*/
|
* @return void
|
||||||
function UpdateColumnsTag($xml_columns) {
|
*/
|
||||||
$this->columns = array();
|
function UpdateColumnsTag($xml_columns)
|
||||||
|
{
|
||||||
|
$this->columns = array();
|
||||||
|
|
||||||
if(!is_array($xml_columns)) $xml_columns = array($xml_columns);
|
if(!is_array($xml_columns)) $xml_columns = array($xml_columns);
|
||||||
|
|
||||||
foreach($xml_columns as $column){
|
foreach($xml_columns as $column){
|
||||||
if($column->name === 'query') $this->columns[] = new QueryTag($column, true);
|
if($column->name === 'query') $this->columns[] = new QueryTag($column, true);
|
||||||
else $this->columns[] = new UpdateColumnTag($column);
|
else $this->columns[] = new UpdateColumnTag($column);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* UpdateColumnTag object to string
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function toString(){
|
|
||||||
$output_columns = 'array(' . PHP_EOL;
|
|
||||||
foreach($this->columns as $column){
|
|
||||||
$output_columns .= $column->getExpressionString() . PHP_EOL . ',';
|
|
||||||
}
|
|
||||||
$output_columns = substr($output_columns, 0, -1);
|
|
||||||
$output_columns .= ')';
|
|
||||||
return $output_columns;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return argument list
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function getArguments(){
|
|
||||||
$arguments = array();
|
|
||||||
foreach($this->columns as $column){
|
|
||||||
$arguments[] = $column->getArgument();
|
|
||||||
}
|
|
||||||
return $arguments;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string to be output in the cache file
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function toString()
|
||||||
|
{
|
||||||
|
$output_columns = 'array(' . PHP_EOL;
|
||||||
|
foreach($this->columns as $column){
|
||||||
|
$output_columns .= $column->getExpressionString() . PHP_EOL . ',';
|
||||||
|
}
|
||||||
|
$output_columns = substr($output_columns, 0, -1);
|
||||||
|
$output_columns .= ')';
|
||||||
|
return $output_columns;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return argument list
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function getArguments()
|
||||||
|
{
|
||||||
|
$arguments = array();
|
||||||
|
foreach($this->columns as $column){
|
||||||
|
$arguments[] = $column->getArgument();
|
||||||
|
}
|
||||||
|
return $arguments;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ jQuery(function($) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('input[type="submit"]').click(function(ev){
|
jQuery('input[type="submit"],button[type="submit"]').click(function(ev){
|
||||||
var $el = jQuery(ev.currentTarget);
|
var $el = jQuery(ev.currentTarget);
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,7 @@ jQuery(function($) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery('input[type="submit"]').click(function(ev){
|
jQuery('input[type="submit"],button[type="submit"]').click(function(ev){
|
||||||
var $el = jQuery(ev.currentTarget);
|
var $el = jQuery(ev.currentTarget);
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
|
|
|
||||||
2
common/js/xe.min.js
vendored
2
common/js/xe.min.js
vendored
|
|
@ -14,7 +14,7 @@ arguments[0],a.extend(c,arguments[1]||{})}!0==c.doClick&&(c.checked=null);"strin
|
||||||
if("undefined"==typeof g.length||1>g.length)g=Array(g);if(g.length)for(var j=0;j<g.length;j++){var i=g[j].url,l=g[j].str,m=g[j].target,h="";switch(m){case "popup":h=" onclick=\"popopen(this.href,'"+m+"'); return false;\"";break;case "javascript":h=' onclick="'+i+'; return false; "';i="#";break;default:h=' onclick="window.open(this.href); return false;"'}b+='<li ><a href="'+i+'"'+h+">"+l+"</a></li> "}}this.loaded_popup_menus[c]=b}b&&(c=a("#popup_menu_area").html("<ul>"+b+"</ul>"),b=e.page_y,e=e.page_x,
|
if("undefined"==typeof g.length||1>g.length)g=Array(g);if(g.length)for(var j=0;j<g.length;j++){var i=g[j].url,l=g[j].str,m=g[j].target,h="";switch(m){case "popup":h=" onclick=\"popopen(this.href,'"+m+"'); return false;\"";break;case "javascript":h=' onclick="'+i+'; return false; "';i="#";break;default:h=' onclick="window.open(this.href); return false;"'}b+='<li ><a href="'+i+'"'+h+">"+l+"</a></li> "}}this.loaded_popup_menus[c]=b}b&&(c=a("#popup_menu_area").html("<ul>"+b+"</ul>"),b=e.page_y,e=e.page_x,
|
||||||
c.outerHeight()+b>a(window).height()+a(window).scrollTop()&&(b=a(window).height()-c.outerHeight()+a(window).scrollTop()),c.outerWidth()+e>a(window).width()+a(window).scrollLeft()&&(e=a(window).width()-c.outerWidth()+a(window).scrollLeft()),c.css({top:b,left:e}).show())}}})(jQuery);
|
c.outerHeight()+b>a(window).height()+a(window).scrollTop()&&(b=a(window).height()-c.outerHeight()+a(window).scrollTop()),c.outerWidth()+e>a(window).width()+a(window).scrollLeft()&&(e=a(window).width()-c.outerWidth()+a(window).scrollLeft()),c.css({top:b,left:e}).show())}}})(jQuery);
|
||||||
jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var g=!1,d=[],i=0;i<b.options.length;i++)b.options[i].disabled?(b.options[i].style.color="#CCCCCC",g=!0):d[a]=-1<d[a]?d[a]:i;if(g&&(b.oldonchange=b.onchange,b.onchange=function(){this.options[this.selectedIndex].disabled?this.selectedIndex=d[a]:this.oldonchange&&this.oldonchange()},0<=b.selectedIndex&&b.options[b.selectedIndex].disabled))b.onchange()});var b=a(".xe_content .fold_button");if(b.size()){var d=a("div.fold_container",
|
jQuery(function(a){a.browser.msie&&a("select").each(function(a,b){for(var g=!1,d=[],i=0;i<b.options.length;i++)b.options[i].disabled?(b.options[i].style.color="#CCCCCC",g=!0):d[a]=-1<d[a]?d[a]:i;if(g&&(b.oldonchange=b.onchange,b.onchange=function(){this.options[this.selectedIndex].disabled?this.selectedIndex=d[a]:this.oldonchange&&this.oldonchange()},0<=b.selectedIndex&&b.options[b.selectedIndex].disabled))b.onchange()});var b=a(".xe_content .fold_button");if(b.size()){var d=a("div.fold_container",
|
||||||
b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(d).show()});a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(d).hide()})}jQuery('input[type="submit"]').click(function(a){var b=jQuery(a.currentTarget);setTimeout(function(){b.attr("disabled","disabled")},0);setTimeout(function(){b.removeAttr("disabled")},3E3)})});
|
b);a("button.more",b).click(function(){a(this).hide().next("button").show().parent().next(d).show()});a("button.less",b).click(function(){a(this).hide().prev("button").show().parent().next(d).hide()})}jQuery('input[type="submit"],button[type="submit"]').click(function(a){var b=jQuery(a.currentTarget);setTimeout(function(){b.attr("disabled","disabled")},0);setTimeout(function(){b.removeAttr("disabled")},3E3)})});
|
||||||
(function(){var a=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)};String.prototype.getQuery=function(a){var d=this.replace(/#.*$/,"")===window.location.href.replace(/#.*$/,"")?current_url:this,c=d.indexOf("?");if(-1==c)return null;var e={};d.substr(c+1,this.length).replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){e[b]=c});a=e[a];"undefined"==typeof a&&(a="");return a};String.prototype.setQuery=function(b,d){var c=this.replace(/#.*$/,"")===window.location.href.replace(/#.*$/,
|
(function(){var a=Array.isArray||function(a){return"[object Array]"==Object.prototype.toString.call(a)};String.prototype.getQuery=function(a){var d=this.replace(/#.*$/,"")===window.location.href.replace(/#.*$/,"")?current_url:this,c=d.indexOf("?");if(-1==c)return null;var e={};d.substr(c+1,this.length).replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){e[b]=c});a=e[a];"undefined"==typeof a&&(a="");return a};String.prototype.setQuery=function(b,d){var c=this.replace(/#.*$/,"")===window.location.href.replace(/#.*$/,
|
||||||
"")?current_url:this,e=c.indexOf("?"),g=c.replace(/#$/,""),j,i;"undefined"==typeof d&&(d="");if(-1!=e){var l=g.substr(e+1,c.length),m={},h=[],g=c.substr(0,e);l.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){m[b]=c});m[b]=d;for(var n in m)m.hasOwnProperty(n)&&(i=String(m[n]).trim())&&h.push(n+"="+decodeURI(i));l=h.join("&");g+=l?"?"+l:""}else String(d).trim()&&(g=g+"?"+b+"="+d);e=/^https:\/\/([^:\/]+)(:\d+|)/i;e.test(g)&&(c="http://"+RegExp.$1,window.http_port&&80!=http_port&&(c+=":"+http_port),g=
|
"")?current_url:this,e=c.indexOf("?"),g=c.replace(/#$/,""),j,i;"undefined"==typeof d&&(d="");if(-1!=e){var l=g.substr(e+1,c.length),m={},h=[],g=c.substr(0,e);l.replace(/([^=]+)=([^&]*)(&|$)/g,function(a,b,c){m[b]=c});m[b]=d;for(var n in m)m.hasOwnProperty(n)&&(i=String(m[n]).trim())&&h.push(n+"="+decodeURI(i));l=h.join("&");g+=l?"?"+l:""}else String(d).trim()&&(g=g+"?"+b+"="+d);e=/^https:\/\/([^:\/]+)(:\d+|)/i;e.test(g)&&(c="http://"+RegExp.$1,window.http_port&&80!=http_port&&(c+=":"+http_port),g=
|
||||||
g.replace(e,c));c=!!window.enforce_ssl;if(!c&&a(window.ssl_actions)&&(j=g.getQuery("act"))){e=0;for(i=ssl_actions.length;e<i;e++)if(ssl_actions[e]===j){c=!0;break}}e=/http:\/\/([^:\/]+)(:\d+|)/i;c&&e.test(g)&&(c="https://"+RegExp.$1,window.https_port&&443!=https_port&&(c+=":"+https_port),g=g.replace(e,c));g=g.replace(/\/(index\.php)?\?/,"/index.php?");return encodeURI(g)};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}})();
|
g.replace(e,c));c=!!window.enforce_ssl;if(!c&&a(window.ssl_actions)&&(j=g.getQuery("act"))){e=0;for(i=ssl_actions.length;e<i;e++)if(ssl_actions[e]===j){c=!0;break}}e=/http:\/\/([^:\/]+)(:\d+|)/i;c&&e.test(g)&&(c="https://"+RegExp.$1,window.https_port&&443!=https_port&&(c+=":"+https_port),g=g.replace(e,c));g=g.replace(/\/(index\.php)?\?/,"/index.php?");return encodeURI(g)};String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")}})();
|
||||||
|
|
|
||||||
|
|
@ -2935,6 +2935,10 @@
|
||||||
<value xml:lang="vi"><![CDATA[Đã phê bình.]]></value>
|
<value xml:lang="vi"><![CDATA[Đã phê bình.]]></value>
|
||||||
<value xml:lang="mn"><![CDATA[Санал болгогдоогүй]]></value>
|
<value xml:lang="mn"><![CDATA[Санал болгогдоогүй]]></value>
|
||||||
</item>
|
</item>
|
||||||
|
<item name="success_copied">
|
||||||
|
<value xml:lang="ko"><![CDATA[복사했습니다.]]></value>
|
||||||
|
<value xml:lang="en"><![CDATA[Copied successfully.]]></value>
|
||||||
|
</item>
|
||||||
<item name="success_moved">
|
<item name="success_moved">
|
||||||
<value xml:lang="ko"><![CDATA[이동했습니다.]]></value>
|
<value xml:lang="ko"><![CDATA[이동했습니다.]]></value>
|
||||||
<value xml:lang="en"><![CDATA[Moved successfully.]]></value>
|
<value xml:lang="en"><![CDATA[Moved successfully.]]></value>
|
||||||
|
|
@ -3454,7 +3458,7 @@
|
||||||
</item>
|
</item>
|
||||||
<item name="filter">
|
<item name="filter">
|
||||||
<item name="isnull">
|
<item name="isnull">
|
||||||
<value xml:lang="ko"><![CDATA[%s에 값을 입력해주세요.]]></value>
|
<value xml:lang="ko"><![CDATA[%s 값은 필수입니다.]]></value>
|
||||||
<value xml:lang="en"><![CDATA[Please enter a value for %s]]></value>
|
<value xml:lang="en"><![CDATA[Please enter a value for %s]]></value>
|
||||||
<value xml:lang="jp"><![CDATA[%sに値を入力してください。]]></value>
|
<value xml:lang="jp"><![CDATA[%sに値を入力してください。]]></value>
|
||||||
<value xml:lang="zh-CN"><![CDATA[请输入%s]]></value>
|
<value xml:lang="zh-CN"><![CDATA[请输入%s]]></value>
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,7 @@ var default_url = "{Context::getDefaultUrl()}";
|
||||||
<block cond="Context::get('_http_port')">var http_port = {Context::get("_http_port")};</block>
|
<block cond="Context::get('_http_port')">var http_port = {Context::get("_http_port")};</block>
|
||||||
<block cond="Context::get('_https_port')">var https_port = {Context::get("_https_port")};</block>
|
<block cond="Context::get('_https_port')">var https_port = {Context::get("_https_port")};</block>
|
||||||
<block cond="Context::get('_use_ssl') && Context::get('_use_ssl') == 'always'">var enforce_ssl = true;</block>
|
<block cond="Context::get('_use_ssl') && Context::get('_use_ssl') == 'always'">var enforce_ssl = true;</block>
|
||||||
|
xe.current_lang = "{$lang_type}";
|
||||||
//]]>
|
//]]>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* Display XE's full version
|
* Display XE's full version
|
||||||
* Even The file should be revised when releasing altough no change is made
|
* Even The file should be revised when releasing altough no change is made
|
||||||
*/
|
*/
|
||||||
define('__XE_VERSION__', '1.5.3.3');
|
define('__XE_VERSION__', '1.5.4.2');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated __ZBXE_VERSION__ will be removed. Use __XE_VERSION__ instead.
|
* @deprecated __ZBXE_VERSION__ will be removed. Use __XE_VERSION__ instead.
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@
|
||||||
$request_uri = Context::getRequestUri();
|
$request_uri = Context::getRequestUri();
|
||||||
if(!$num_args) return $request_uri;
|
if(!$num_args) return $request_uri;
|
||||||
|
|
||||||
$url = Context::getUrl($num_args, $args_list);
|
$url = Context::getUrl($num_args, $args_list, null, false);
|
||||||
if(!preg_match('/^http/i',$url)){
|
if(!preg_match('/^http/i',$url)){
|
||||||
preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match);
|
preg_match('/^(http|https):\/\/([^\/]+)\//',$request_uri,$match);
|
||||||
$url = Context::getUrl($num_args, $args_list, null, false);
|
$url = Context::getUrl($num_args, $args_list, null, false);
|
||||||
|
|
@ -780,7 +780,7 @@
|
||||||
$oEmbedFilter->check($content);
|
$oEmbedFilter->check($content);
|
||||||
|
|
||||||
// change the specific tags to the common texts
|
// change the specific tags to the common texts
|
||||||
$content = preg_replace('@<(\/?(?:html|body|head|title|meta|base|link|script|style|applet)(/*)[\w\s>])@i', '<$1', $content);
|
$content = preg_replace('@<(\/?(?:html|body|head|title|meta|base|link|script|style|applet)(/*).*?>)@i', '<$1', $content);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove codes to abuse the admin session in src by tags of imaages and video postings
|
* Remove codes to abuse the admin session in src by tags of imaages and video postings
|
||||||
|
|
@ -938,7 +938,7 @@
|
||||||
**/
|
**/
|
||||||
function getRequestUriByServerEnviroment()
|
function getRequestUriByServerEnviroment()
|
||||||
{
|
{
|
||||||
return $_SERVER['REQUEST_URI'];
|
return removeHackTag($_SERVER['REQUEST_URI']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1131,6 +1131,38 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkCSRF()
|
||||||
|
{
|
||||||
|
if($_SERVER['REQUEST_METHOD'] != 'POST')
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$defaultUrl = Context::getDefaultUrl();
|
||||||
|
$referer = parse_url($_SERVER["HTTP_REFERER"]);
|
||||||
|
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$siteModuleInfo = $oModuleModel->getDefaultMid();
|
||||||
|
|
||||||
|
if($siteModuleInfo->site_srl == 0)
|
||||||
|
{
|
||||||
|
if(!strstr(strtolower($defaultUrl), strtolower($referer['host'])))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$virtualSiteInfo = $oModuleModel->getSiteInfo($siteModuleInfo->site_srl);
|
||||||
|
if(strtolower($virtualSiteInfo->domain) != strtolower(Context::get('vid')) && !strstr(strtolower($virtualSiteInfo->domain), strtolower($referer['host'])))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Print raw html header
|
* Print raw html header
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -210,7 +210,7 @@
|
||||||
<title xml:lang="ge">Top Menü</title>
|
<title xml:lang="ge">Top Menü</title>
|
||||||
<title xml:lang="ru">Верхнее меню</title>
|
<title xml:lang="ru">Верхнее меню</title>
|
||||||
<title xml:lang="es">Menú Principal</title>
|
<title xml:lang="es">Menú Principal</title>
|
||||||
<title xml:lang="vi">Menu trên</title>
|
<title xml:lang="vi">Menu trên</title>
|
||||||
<title xml:lang="tr">Ana Menü</title>
|
<title xml:lang="tr">Ana Menü</title>
|
||||||
</menu>
|
</menu>
|
||||||
</menus>
|
</menus>
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
<!--@elseif($act!='dispMemberLoginForm')-->
|
<!--@elseif($act!='dispMemberLoginForm')-->
|
||||||
<li class="fl"><a href="{getUrl('act','dispMemberLoginForm')}">{$lang->cmd_login}...</a></li>
|
<li class="fl"><a href="{getUrl('act','dispMemberLoginForm')}">{$lang->cmd_login}...</a></li>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
<li class="fl" cond="$is_logged"><a href="{getUrl('act', 'dispMemberInfo')}">{$lang->cmd_view_member_info}...</a></li>
|
||||||
<li class="fr"><a href="{getUrl('m',0)}">PC</a></li>
|
<li class="fr"><a href="{getUrl('m',0)}">PC</a></li>
|
||||||
<li class="fr"><a href="{getUrl('act','dispModuleChangeLang','oldact',$act)}">LANG</a></li>
|
<li class="fr"><a href="{getUrl('act','dispModuleChangeLang','oldact',$act)}">LANG</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,11 @@ body,input,textarea,select,button,table{font-family:Tahoma,Geneva,sans-serif}
|
||||||
.hd .h1 a{color:#fff}
|
.hd .h1 a{color:#fff}
|
||||||
.hd .h1 img{border:0}
|
.hd .h1 img{border:0}
|
||||||
.hd .mu{display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;text-decoration:none;box-shadow:0 0 1px #000;-webkit-box-shadow:0 0 1px #000;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b}
|
.hd .mu{display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;text-decoration:none;box-shadow:0 0 1px #000;-webkit-box-shadow:0 0 1px #000;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b}
|
||||||
.hd .mu:after{content:"›";margin:0 0 0 3px;font-size:24px;vertical-align:middle;position:relative;top:-2px}
|
.hd .mu:after{content:"›";margin:0 0 0 2px}
|
||||||
.hd .muon{cursor:pointer;display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;text-decoration:none;box-shadow:0 0 1px #000;-webkit-box-shadow:0 0 1px #000;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b}
|
.hd .muon{cursor:pointer;display:inline-block;height:26px;line-height:26px;padding:0 10px;font-size:12px;font-weight:bold;color:#fff;text-decoration:none;box-shadow:0 0 1px #000;-webkit-box-shadow:0 0 1px #000;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background:#1b1b1b -webkit-gradient(linear,0% 0%,0% 100%,from(#777),to(#373737),color-stop(0.5,#323232),color-stop(0.5,#1b1b1b));background:#1b1b1b -moz-linear-gradient(top,#777,#373737);background-color:#1b1b1b}
|
||||||
.hd .muon:before{content:"‹";font-weight:bold;font-size:16px;line-height:16px;margin:0 2px 0 0;font-family:Verdana, Geneva, sans-serif}
|
.hd .muon:before{content:"‹";margin:0 2px 0 0}
|
||||||
|
.hd .mu:after,
|
||||||
|
.hd .muon:before{font-size:16px;line-height:16px;vertical-align:middle;position:relative;top:-2px;font-family:Verdana, Geneva, sans-serif}
|
||||||
/* Footer */
|
/* Footer */
|
||||||
.ft{padding:0;margin:0;list-style:none;background:#868686;overflow:hidden;zoom:1}
|
.ft{padding:0;margin:0;list-style:none;background:#868686;overflow:hidden;zoom:1}
|
||||||
.ft:after{content:"";display:block;clear:both}
|
.ft:after{content:"";display:block;clear:both}
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,54 @@
|
||||||
return $this->setRedirectUrl(Context::get('error_return_url'), $output);
|
return $this->setRedirectUrl(Context::get('error_return_url'), $output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cleanning favorite
|
||||||
|
* @return Object
|
||||||
|
*/
|
||||||
|
function cleanFavorite()
|
||||||
|
{
|
||||||
|
$oModel = getAdminModel('admin');
|
||||||
|
$output = $oModel->getFavoriteList();
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
$favoriteList = $output->get('favoriteList');
|
||||||
|
if(!$favoriteList)
|
||||||
|
{
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
|
|
||||||
|
$deleteTargets = array();
|
||||||
|
foreach($favoriteList as $favorite)
|
||||||
|
{
|
||||||
|
if($favorite->type == 'module')
|
||||||
|
{
|
||||||
|
$modulePath = './modules/' . $favorite->module;
|
||||||
|
$modulePath = FileHandler::getRealPath($modulePath);
|
||||||
|
if(!is_dir($modulePath))
|
||||||
|
{
|
||||||
|
$deleteTargets[] = $favorite->admin_favorite_srl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!count($deleteTargets))
|
||||||
|
{
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
|
|
||||||
|
$args->admin_favorite_srls = $deleteTargets;
|
||||||
|
$output = executeQuery('admin.deleteFavorites', $args);
|
||||||
|
if(!$output->toBool())
|
||||||
|
{
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Object();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enviroment gathering agreement
|
* Enviroment gathering agreement
|
||||||
* @return void
|
* @return void
|
||||||
|
|
|
||||||
|
|
@ -462,41 +462,54 @@
|
||||||
*/
|
*/
|
||||||
function getSiteAllList()
|
function getSiteAllList()
|
||||||
{
|
{
|
||||||
if(Context::get('domain')) $args->domain = Context::get('domain');
|
if(Context::get('domain')) $domain = Context::get('domain');
|
||||||
$columnList = array('domain', 'site_srl');
|
$siteList = $this->getAllSitesThatHaveModules($domain);
|
||||||
|
$this->add('site_list', $siteList);
|
||||||
$siteList = array();
|
|
||||||
$output = executeQueryArray('admin.getSiteAllList', $args, $columnList);
|
|
||||||
if($output->toBool()) $siteList = $output->data;
|
|
||||||
|
|
||||||
$oModuleModel = &getModel('module');
|
|
||||||
foreach($siteList as $key => $value)
|
|
||||||
{
|
|
||||||
$args->site_srl = $value->site_srl;
|
|
||||||
$list = $oModuleModel->getModuleSrlList($args);
|
|
||||||
|
|
||||||
if(!is_array($list))
|
|
||||||
{
|
|
||||||
$list = array($list);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach($list as $k => $v)
|
|
||||||
{
|
|
||||||
if(!is_dir('./modules/' . $v->module))
|
|
||||||
{
|
|
||||||
unset($list[$k]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!count($list))
|
|
||||||
{
|
|
||||||
unset($siteList[$key]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->add('site_list', $siteList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a list of all sites that contain modules
|
||||||
|
* For each site domain and site_srl are retrieved
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
function getAllSitesThatHaveModules($domain = null)
|
||||||
|
{
|
||||||
|
$args = new stdClass();
|
||||||
|
if($domain) $args->domain = $domain;
|
||||||
|
$columnList = array('domain', 'site_srl');
|
||||||
|
|
||||||
|
$siteList = array();
|
||||||
|
$output = executeQueryArray('admin.getSiteAllList', $args, $columnList);
|
||||||
|
if($output->toBool()) $siteList = $output->data;
|
||||||
|
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
foreach($siteList as $key => $value)
|
||||||
|
{
|
||||||
|
$args->site_srl = $value->site_srl;
|
||||||
|
$list = $oModuleModel->getModuleSrlList($args);
|
||||||
|
|
||||||
|
if(!is_array($list))
|
||||||
|
{
|
||||||
|
$list = array($list);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($list as $k => $v)
|
||||||
|
{
|
||||||
|
if(!is_dir('./modules/' . $v->module))
|
||||||
|
{
|
||||||
|
unset($list[$k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!count($list))
|
||||||
|
{
|
||||||
|
unset($siteList[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $siteList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return site count
|
* Return site count
|
||||||
* @param string $date
|
* @param string $date
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,7 @@
|
||||||
unset($layout_info);
|
unset($layout_info);
|
||||||
$layout_info = $oLayoutModel->getLayout($val->layout_srl);
|
$layout_info = $oLayoutModel->getLayout($val->layout_srl);
|
||||||
if (!$layout_info) continue;
|
if (!$layout_info) continue;
|
||||||
$layout_parse = explode('.', $layout_info->layout);
|
$layout_parse = explode('|@|', $layout_info->layout);
|
||||||
if (count($layout_parse) == 2){
|
if (count($layout_parse) == 2){
|
||||||
$thumb_path = sprintf('./themes/%s/layouts/%s/thumbnail.png', $layout_parse[0], $layout_parse[1]);
|
$thumb_path = sprintf('./themes/%s/layouts/%s/thumbnail.png', $layout_parse[0], $layout_parse[1]);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -712,16 +712,16 @@
|
||||||
</item>
|
</item>
|
||||||
</item>
|
</item>
|
||||||
<item name="about_use_ssl">
|
<item name="about_use_ssl">
|
||||||
<value xml:lang="ko"><![CDATA['선택적으로'는 회원가입, 정보수정 등의 지정된 동작(action)에서 보안접속(SSL)을 사용합니다.<br /> '항상 사용'은 모든 서비스에 SSL을 사용 합니다.]]></value>
|
<value xml:lang="ko"><![CDATA['선택적으로'는 회원가입, 정보수정 등의 지정된 동작(action)에서 보안접속(SSL)을 사용합니다.<br /> '항상 사용'은 모든 서비스에 SSL을 사용 합니다.<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="en"><![CDATA[Select 'Optional' to use SSL for the specified actions such as signing up and changing information.<br /> 'Always' to use SSL for all services.]]></value>
|
<value xml:lang="en"><![CDATA[Select 'Optional' to use SSL for the specified actions such as signing up and changing information.<br /> 'Always' to use SSL for all services.<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="jp"><![CDATA[「部分的に使う」は、「会員登録/会員情報変更」など指定のアクションでSSLを利用する場合。「常に使う」は、すべてのサービスにSSLを使う場合に選択します。]]></value>
|
<value xml:lang="jp"><![CDATA[「部分的に使う」は、「会員登録/会員情報変更」など指定のアクションでSSLを利用する場合。「常に使う」は、すべてのサービスにSSLを使う場合に選択します。<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="zh-CN"><![CDATA[选择性使用选项应用于新用户注册/修改用户信息等已指定的action当中,使用选项应用于所有服务。]]></value>
|
<value xml:lang="zh-CN"><![CDATA[选择性使用选项应用于新用户注册/修改用户信息等已指定的action当中,使用选项应用于所有服务。<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="zh-TW"><![CDATA[選擇手動時,在會員註冊或修改資料等動作時才會使用 SSL功能。<br/>選擇開啟時,所有的服務都會使用 SSL功能。]]></value>
|
<value xml:lang="zh-TW"><![CDATA[選擇手動時,在會員註冊或修改資料等動作時才會使用 SSL功能。<br/>選擇開啟時,所有的服務都會使用 SSL功能。<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="fr"><![CDATA[Si l'on choisit 'Optionnel' , on utilise protocole SSL seulement dans quelques services comme inscription ou modification. Si l'on choisit 'Toujours', on utilise protocole SSL dans tous les services.]]></value>
|
<value xml:lang="fr"><![CDATA[Si l'on choisit 'Optionnel' , on utilise protocole SSL seulement dans quelques services comme inscription ou modification. Si l'on choisit 'Toujours', on utilise protocole SSL dans tous les services.<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="ru"><![CDATA[In case of "Optional", SSL will be used for actions such as signing up / changing information. And for "Always", your site will be served only via https]]></value>
|
<value xml:lang="ru"><![CDATA[In case of "Optional", SSL will be used for actions such as signing up / changing information. And for "Always", your site will be served only via https<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="es"><![CDATA[Opcionalmente, la composición de suscripción / editar la información y el uso de SSL especificada en la acción es siempre el uso de SSL para todos los servicios que se utilizarán]]></value>
|
<value xml:lang="es"><![CDATA[Opcionalmente, la composición de suscripción / editar la información y el uso de SSL especificada en la acción es siempre el uso de SSL para todos los servicios que se utilizarán<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="tr"><![CDATA['İsteği Bağlı' seçiminde; SSL, kayıt olma/bilgi değiştirme gibi eylemler için kullanılacaktır. 'Her zaman' seçiminde, siteniz sadece http yoluyla hizmet verecektir.]]></value>
|
<value xml:lang="tr"><![CDATA['İsteği Bağlı' seçiminde; SSL, kayıt olma/bilgi değiştirme gibi eylemler için kullanılacaktır. 'Her zaman' seçiminde, siteniz sadece http yoluyla hizmet verecektir.<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
<value xml:lang="vi"><![CDATA[Nếu bạn chọn 'Tùy chỉnh', SSL sẽ sử dụng và những công việc như đăng kí, sửa thông tin thành viên, .<br />Chỉ chọn 'Luôn luôn' khi Website của bạn đang chạy trên Server có hỗ trợ https.]]></value>
|
<value xml:lang="vi"><![CDATA[Nếu bạn chọn 'Tùy chỉnh', SSL sẽ sử dụng và những công việc như đăng kí, sửa thông tin thành viên, .<br />Chỉ chọn 'Luôn luôn' khi Website của bạn đang chạy trên Server có hỗ trợ https.<br /><span style="color:red">SSL 환경이 갖춰지지 않은 상태에서 SSL을 사용할 경우 접속이 되지 않을 수 있으니 주의하시기 바랍니다.</span>]]></value>
|
||||||
</item>
|
</item>
|
||||||
<item name="server_ports">
|
<item name="server_ports">
|
||||||
<value xml:lang="ko"><![CDATA[서버 포트 지정]]></value>
|
<value xml:lang="ko"><![CDATA[서버 포트 지정]]></value>
|
||||||
|
|
|
||||||
8
modules/admin/queries/deleteFavorites.xml
Normal file
8
modules/admin/queries/deleteFavorites.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<query id="deleteFavorite" action="delete">
|
||||||
|
<tables>
|
||||||
|
<table name="admin_favorite" />
|
||||||
|
</tables>
|
||||||
|
<conditions>
|
||||||
|
<condition operation="in" column="admin_favorite_srl" var="admin_favorite_srls" filter="number" notnull="notnull" />
|
||||||
|
</conditions>
|
||||||
|
</query>
|
||||||
|
|
@ -58,7 +58,7 @@ header,footer,section,article,aside,nav,hgroup,details,menu,figure,figcaption{di
|
||||||
.x .table caption .side{float:right;font-weight:normal;margin-left:1em}
|
.x .table caption .side{float:right;font-weight:normal;margin-left:1em}
|
||||||
.x .table th,
|
.x .table th,
|
||||||
.x .table td{border:0;padding:8px;vertical-align:top;text-align:left;border-bottom:1px solid #ddd}
|
.x .table td{border:0;padding:8px;vertical-align:top;text-align:left;border-bottom:1px solid #ddd}
|
||||||
.x .table th{background:#f8f8f8;white-space:nowrap}
|
.x .table th{background:#f8f8f8}
|
||||||
.x .table thead th{border-bottom:1px solid #999}
|
.x .table thead th{border-bottom:1px solid #999}
|
||||||
.x .table tfoot td{font-weight:bold;background:#f8f8f8}
|
.x .table tfoot td{font-weight:bold;background:#f8f8f8}
|
||||||
.x .table.even tbody tr:nth-of-type(even){background-color:#fafafa}
|
.x .table.even tbody tr:nth-of-type(even){background-color:#fafafa}
|
||||||
|
|
@ -68,10 +68,6 @@ header,footer,section,article,aside,nav,hgroup,details,menu,figure,figcaption{di
|
||||||
.x .table em{font-style:normal;font-weight:normal;color:#e00}
|
.x .table em{font-style:normal;font-weight:normal;color:#e00}
|
||||||
.x .table th.nowr,
|
.x .table th.nowr,
|
||||||
.x .table td.nowr{white-space:nowrap}
|
.x .table td.nowr{white-space:nowrap}
|
||||||
.x .table th.title,
|
|
||||||
.x .table td.title,
|
|
||||||
.x .table th.text,
|
|
||||||
.x .table td.text{width:100%}
|
|
||||||
/* Form */
|
/* Form */
|
||||||
.x .form{margin:0 0 1em 0;padding:0}
|
.x .form{margin:0 0 1em 0;padding:0}
|
||||||
.x .form fieldset{margin:0 0 2em 0;padding:0;border:0}
|
.x .form fieldset{margin:0 0 2em 0;padding:0;border:0}
|
||||||
|
|
@ -149,7 +145,7 @@ header,footer,section,article,aside,nav,hgroup,details,menu,figure,figcaption{di
|
||||||
.x .gnb .mnv{display:block}
|
.x .gnb .mnv{display:block}
|
||||||
}
|
}
|
||||||
/* Local Navigation */
|
/* Local Navigation */
|
||||||
.x .lnb{position:relative;float:left;width:210px;margin:0 0 1em -230px;line-height:normal;zoom:1;display:inline}
|
.x .lnb{position:relative;float:left;width:210px;left:-230px;margin:0 0 20px 0;line-height:normal;zoom:1;display:inline}
|
||||||
.x .lnb .h2{position:relative;z-index:2;margin:0 0 -1px 0;padding:0 10px;border:1px solid #444;border-bottom:0;border-radius:4px 4px 0 0;background:#555;font-size:13px;color:#fff;line-height:36px}
|
.x .lnb .h2{position:relative;z-index:2;margin:0 0 -1px 0;padding:0 10px;border:1px solid #444;border-bottom:0;border-radius:4px 4px 0 0;background:#555;font-size:13px;color:#fff;line-height:36px}
|
||||||
.x .lnb ul{margin:0 !important;padding:0;list-style:none;position:relative;z-index:1}
|
.x .lnb ul{margin:0 !important;padding:0;list-style:none;position:relative;z-index:1}
|
||||||
.x .lnb li{position:relative;margin:0 0 -1px 0;vertical-align:top;zoom:1}
|
.x .lnb li{position:relative;margin:0 0 -1px 0;vertical-align:top;zoom:1}
|
||||||
|
|
@ -170,11 +166,11 @@ header,footer,section,article,aside,nav,hgroup,details,menu,figure,figcaption{di
|
||||||
.x .lnb li:last-child a,
|
.x .lnb li:last-child a,
|
||||||
.x .lnb li.active:last-child{border-radius:0 0 4px 4px !important}
|
.x .lnb li.active:last-child{border-radius:0 0 4px 4px !important}
|
||||||
/* Shortcut */
|
/* Shortcut */
|
||||||
.x .sct{float:right;width:138px;position:relative;right:-160px;margin:0 0 0 -140px;padding:8px 0}
|
.x .sct{float:left;width:210px;position:relative;left:-230px;margin:0;padding:8px 0;border:0;box-shadow:inset 0 0 1px rgba(0,0,0,0.5)}
|
||||||
.x .sct h2{margin:0 0 5px 15px;font-size:13px}
|
.x .sct h2{margin:0 0 5px 10px;font-size:13px}
|
||||||
.x .sct ul{margin:0;font-size:12px}
|
.x .sct ul{margin:0;font-size:12px}
|
||||||
.x .sct li{position:relative}
|
.x .sct li{position:relative}
|
||||||
.x .sct a{text-decoration:none}
|
.x .sct a{text-decoration:none;padding:3px 18px 3px 10px}
|
||||||
.x .sct form{position:absolute;margin:0;padding:0;top:2px;right:-10px}
|
.x .sct form{position:absolute;margin:0;padding:0;top:2px;right:-10px}
|
||||||
.x .sct .text{text-decoration:none;font-weight:bold;color:#999 !important;width:16px;height:16px;margin:0}
|
.x .sct .text{text-decoration:none;font-weight:bold;color:#999 !important;width:16px;height:16px;margin:0}
|
||||||
.x .sct .text:hover,
|
.x .sct .text:hover,
|
||||||
|
|
@ -305,10 +301,10 @@ body.modalContainer{_height:100%;_width:100%} /* IE6 only */
|
||||||
.x .footer .cache{float:right}
|
.x .footer .cache{float:right}
|
||||||
.x .footer .vr{color:#ccc}
|
.x .footer .vr{color:#ccc}
|
||||||
/* Body */
|
/* Body */
|
||||||
.x .body{position:relative;z-index:1;padding:30px 170px 30px 240px;zoom:1}
|
.x .body{position:relative;z-index:1;padding:30px 10px 30px 240px;zoom:1}
|
||||||
.x .body:after{content:"";display:block;clear:both}
|
.x .body:after{content:"";display:block;clear:both}
|
||||||
/* Content */
|
/* Content */
|
||||||
.x .content{float:right;width:100%;margin-left:-100%;zoom:1;outline:0}
|
.x .content{float:right;width:100%;margin-left:-210px;zoom:1;outline:0;min-height:500px}
|
||||||
.x .content:after{content:"";display:block;clear:both}
|
.x .content:after{content:"";display:block;clear:both}
|
||||||
.x .content a{color:#33a}
|
.x .content a{color:#33a}
|
||||||
.x .content a:hover,
|
.x .content a:hover,
|
||||||
|
|
@ -320,15 +316,12 @@ body.modalContainer{_height:100%;_width:100%} /* IE6 only */
|
||||||
.x .content .portlet a:focus{text-decoration:underline}
|
.x .content .portlet a:focus{text-decoration:underline}
|
||||||
/* Dashboard */
|
/* Dashboard */
|
||||||
.x .dashboard .section{margin-top:0}
|
.x .dashboard .section{margin-top:0}
|
||||||
.x .dashboard .portlet{float:left;width:48%;margin-right:1em;margin-top:0}
|
.x .dashboard .portlet{float:left;width:48%;margin-right:1em;margin-top:0;min-height:188px}
|
||||||
.x .dashboard .portlet:nth-of-type(odd){float:left;width:49%;margin-right:0}
|
.x .dashboard .portlet:nth-of-type(odd){float:left;width:49%;margin-right:0}
|
||||||
.x .dashboard .portlet:nth-of-type(even){float:right;width:49%;margin-right:0}
|
.x .dashboard .portlet:nth-of-type(even){float:right;width:49%;margin-right:0}
|
||||||
@media all and (min-width:1300px){
|
@media all and (min-width:1300px){
|
||||||
.x .dashboard .portlet{float:left !important;width:32% !important;margin-right:1em !important}
|
.x .dashboard .portlet{float:left !important;width:32% !important;margin-right:1em !important}
|
||||||
}
|
}
|
||||||
/* Single Column*/
|
|
||||||
.x .single{padding-left:10px}
|
|
||||||
.x .single .content{position:relative;float:left;width:100%;margin:0}
|
|
||||||
/* Search */
|
/* Search */
|
||||||
.x .search{zoom:1}
|
.x .search{zoom:1}
|
||||||
.x .search:after{content:"";display:block;clear:both}
|
.x .search:after{content:"";display:block;clear:both}
|
||||||
|
|
@ -587,7 +580,7 @@ body.modalContainer{_height:100%;_width:100%} /* IE6 only */
|
||||||
.x .header .account ul{padding-right:10px}
|
.x .header .account ul{padding-right:10px}
|
||||||
.x .body{padding:1em 0 0 0}
|
.x .body{padding:1em 0 0 0}
|
||||||
.x .content{float:none;margin-left:0}
|
.x .content{float:none;margin-left:0}
|
||||||
.x .lnb{float:none;width:auto;margin:1em 0}
|
.x .lnb{float:none;width:auto;margin:1em 0;left:auto}
|
||||||
.x .dashboard .portlet{float:none !important;width:auto !important;margin-right:0}
|
.x .dashboard .portlet{float:none !important;width:auto !important;margin-right:0}
|
||||||
.modal .fg,
|
.modal .fg,
|
||||||
.wfsr .fg{width:auto}
|
.wfsr .fg{width:auto}
|
||||||
|
|
|
||||||
12
modules/admin/tpl/css/admin.min.css
vendored
12
modules/admin/tpl/css/admin.min.css
vendored
File diff suppressed because one or more lines are too long
|
|
@ -23,19 +23,6 @@ jQuery(function($){
|
||||||
.parent()
|
.parent()
|
||||||
.css('position', 'relative');
|
.css('position', 'relative');
|
||||||
|
|
||||||
// Make selected checkbox elements bold
|
|
||||||
var $rc_label = $('input:radio+label,input:checkbox+label'), $input_rc = $rc_label.prev('input');
|
|
||||||
$input_rc
|
|
||||||
.change(function(){
|
|
||||||
var name = $(this).attr('name');
|
|
||||||
$input_rc
|
|
||||||
.filter(function(){ return this.name == name })
|
|
||||||
.next('label').css('font-weight', 'normal').end()
|
|
||||||
.filter(':checked')
|
|
||||||
.next('label').css('font-weight', 'bold').end();
|
|
||||||
})
|
|
||||||
.change();
|
|
||||||
|
|
||||||
// Toogle checkbox all
|
// Toogle checkbox all
|
||||||
$('.form th>input:checkbox')
|
$('.form th>input:checkbox')
|
||||||
.change(function() {
|
.change(function() {
|
||||||
|
|
@ -1388,22 +1375,19 @@ function completeInstallModule(ret_obj) {
|
||||||
|
|
||||||
jQuery(function($){
|
jQuery(function($){
|
||||||
$('body').ajaxComplete(function(){ hideWaitingFogLayer() });
|
$('body').ajaxComplete(function(){ hideWaitingFogLayer() });
|
||||||
// admin single column layout
|
|
||||||
if($('.x>.body .lnb').length == 0){ // When it have no lnb
|
|
||||||
$('.x>.body').addClass('single'); // Add class single
|
|
||||||
}
|
|
||||||
// Details toggle in admin table
|
// Details toggle in admin table
|
||||||
var viewBtn = $('.x .dsTg span.side>button.text');
|
var viewBtn = $('.x .dsTg span.side>button.text');
|
||||||
var tdTitle = $('.x .dsTg td.title');
|
var tdTitle = $('.x .dsTg td.title');
|
||||||
tdTitle.each(function(){
|
tdTitle.each(function(){
|
||||||
var $t = $(this)
|
var $t = $(this)
|
||||||
if($t.find('p.update').length==0){
|
if($t.find('p.update').length==0){
|
||||||
$t.addClass('tg').find('>p:not(:first-child)').hide();
|
$t.addClass('tg').find('>*:not(:first-child)').hide();
|
||||||
} else {
|
} else {
|
||||||
$t.addClass('up');
|
$t.addClass('up');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var details = $('.x .dsTg td.tg>p:not(:first-child)');
|
$('.x .dsTg .thumb').hide();
|
||||||
|
var details = $('.x .dsTg td.tg>*:not(:first-child), .x .dsTg .thumb');
|
||||||
viewBtn.click(function(){
|
viewBtn.click(function(){
|
||||||
viewBtn.toggleClass('details');
|
viewBtn.toggleClass('details');
|
||||||
details.slideToggle(200);
|
details.slideToggle(200);
|
||||||
|
|
|
||||||
47
modules/admin/tpl/js/admin.min.js
vendored
47
modules/admin/tpl/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
4
modules/admin/tpl/js/sitemap.min.js
vendored
4
modules/admin/tpl/js/sitemap.min.js
vendored
|
|
@ -1,5 +1,5 @@
|
||||||
jQuery(function(c){function o(a,c){for(var b=0,g=0;a&&a!=c;)b+=a.offsetTop,g+=a.offsetLeft,a=a.offsetParent;return{top:b,left:g}}var l=!1,k=c('<li class="placeholder">');c("form.siteMap").delegate("li:not(.placeholder)",{"mousedown.st":function(a){var d,b,g,h,n,p,i,m,j;if(!(c(a.target).is("a,input,label,textarea")||1!=a.which)){l=!0;b=c(this);p=b.height();n=b.width();g=b.parentsUntil(".siteMap").filter("ul");h=g.eq(-1);h.css("position","relative");d=a.pageY;i=o(this,h.get(0));$clone=b.clone(!0).attr("target",
|
jQuery(function(c){function p(a,c){for(var b=0,g=0;a&&a!=c;)b+=a.offsetTop,g+=a.offsetLeft,a=a.offsetParent;return{top:b,left:g}}var l=!1,k=c('<li class="placeholder">');c("form.siteMap").delegate("li:not(.placeholder)",{"mousedown.st":function(a){var d,b,g,h,n,q,i,m,j;if(!(c(a.target).is("a,input,label,textarea")||1!=a.which)){l=!0;b=c(this);q=b.height();n=b.width();g=b.parentsUntil(".siteMap").filter("ul");h=g.eq(-1);h.css("position","relative");d=a.pageY;i=p(this,h.get(0));$clone=b.clone(!0).attr("target",
|
||||||
!0);for(a=g.length-1;a;a--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();m=[];h.find("li").each(function(){if(b[0]===this||b.has(this).length)return!0;var a=o(this,h.get(0));m.push({top:a.top,bottom:a.top+32,item:this})});$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:0.6,width:n,height:p,left:i.left,top:i.top,zIndex:100}).appendTo(h.eq(0));k.css({position:"absolute",opacity:0.6,width:n,height:"5px",left:i.left,top:i.top,zIndex:99}).appendTo(h.eq(0));
|
!0);for(a=g.length-1;a;a--)$clone=$clone.wrap("<li><ul /></li>").parent().parent();m=[];h.find("li").each(function(){if(b[0]===this||b.has(this).length)return!0;var a=p(this,h.get(0));m.push({top:a.top,bottom:a.top+32,item:this})});$clone.find(".side,input").remove().end().addClass("draggable").css({position:"absolute",opacity:0.6,width:n,height:q,left:i.left,top:i.top,zIndex:100}).appendTo(h.eq(0));k.css({position:"absolute",opacity:0.6,width:n,height:"5px",left:i.left,top:i.top,zIndex:99}).appendTo(h.eq(0));
|
||||||
b.css("opacity",0.6);c(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f;j=null;a=i.top-(d-a.pageY);b=0;for(c=m.length;b<c;b++)if(f=a,e=m[b],0==b&&f<e.top&&(f=e.top),b==c-1&&f>e.bottom&&(f=e.bottom),e.top<=f&&e.bottom>=f){b=e.item;3>=Math.abs(e.top-f)?(k.css({top:e.top-3,height:"5px"}),f="before"):3>=Math.abs(e.bottom-f)?(k.css({top:e.bottom-3,height:"5px"}),f="after"):(k.css({top:e.top+3,height:"27px"}),f="prepend");j={element:b,state:f};break}$clone.css({top:a})}).bind("mouseup.st",
|
b.css("opacity",0.6);c(document).unbind("mousemove.st mouseup.st").bind("mousemove.st",function(a){var b,c,e,f;j=null;a=i.top-(d-a.pageY);b=0;for(c=m.length;b<c;b++)if(f=a,e=m[b],0==b&&f<e.top&&(f=e.top),b==c-1&&f>e.bottom&&(f=e.bottom),e.top<=f&&e.bottom>=f){b=e.item;3>=Math.abs(e.top-f)?(k.css({top:e.top-3,height:"5px"}),f="before"):3>=Math.abs(e.bottom-f)?(k.css({top:e.bottom-3,height:"5px"}),f="after"):(k.css({top:e.top+3,height:"27px"}),f="prepend");j={element:b,state:f};break}$clone.css({top:a})}).bind("mouseup.st",
|
||||||
function(){var a,d;l=!1;c(document).unbind("mousemove.st mouseup.st");b.css("opacity","");$clone.remove();k.remove();d=c("<li />").height(b.height());if(j){a=c(j.element);b.before(d);if("prepend"==j.state)a.find(">ul").length||a.find(">.side").after("<ul>"),a.find(">ul").prepend(b.hide());else a[j.state](b.hide());b.slideDown(100,function(){b.removeClass("active")});d.slideUp(100,function(){var a=d.parent();d.remove();a.children("li").length||a.remove()});b.trigger("dropped.st")}});return!1}},"mouseover.st":function(){l||
|
function(){var a,d;l=!1;c(document).unbind("mousemove.st mouseup.st");b.css("opacity","");$clone.remove();k.remove();d=c("<li />").height(b.height());if(j){a=c(j.element);b.before(d);if("prepend"==j.state)a.find(">ul").length||a.find(">.side").after("<ul>"),a.find(">ul").prepend(b.hide());else a[j.state](b.hide());b.slideDown(100,function(){b.removeClass("active")});d.slideUp(100,function(){var a=d.parent();d.remove();a.children("li").length||a.remove()});b.trigger("dropped.st")}});return!1}},"mouseover.st":function(){l||
|
||||||
c(this).addClass("active");return!1},"mouseout.st":function(){l||c(this).removeClass("active");return!1}}).find("li").prepend('<button type="button" class="moveTo">Move to</button>').append('<span class="vr"></span><span class="hr"></span>').find("input:text").focus(function(){var a=c(this),d=a.prev("label"),b=a.parent();a.width(b.width()-(parseInt(b.css("text-indent"))||0)-a.next(".side").width()-60).css("opacity","");d.hide()}).blur(function(){var a=c(this),d=a.prev("label"),b=a.val();a.width(0).css("opacity",
|
c(this).addClass("active");return!1},"mouseout.st":function(){l||c(this).removeClass("active");return!1}}).find("li").prepend('<button type="button" class="moveTo">Move to</button>').append('<span class="vr"></span><span class="hr"></span>').find("input:text").focus(function(){var a=c(this),d=a.prev("label"),b=a.parent();a.width(b.width()-(parseInt(b.css("text-indent"))||0)-a.next(".side").width()-60).css("opacity","");d.hide()}).blur(function(){var a=c(this),d=a.prev("label"),b=a.val();a.width(0).css("opacity",
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@
|
||||||
$this->updateCategory($xmlDoc);
|
$this->updateCategory($xmlDoc);
|
||||||
$this->updatePackages($xmlDoc);
|
$this->updatePackages($xmlDoc);
|
||||||
$this->checkInstalled();
|
$this->checkInstalled();
|
||||||
|
|
||||||
|
$oAdminController = &getAdminController('admin');
|
||||||
|
$output = $oAdminController->cleanFavorite();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -259,10 +259,23 @@
|
||||||
$res = array();
|
$res = array();
|
||||||
foreach($package_list as $package_srl => $package)
|
foreach($package_list as $package_srl => $package)
|
||||||
{
|
{
|
||||||
$res[] = $item_list[$package_srl];
|
if($item_list[$package_srl])
|
||||||
|
{
|
||||||
|
$res[] = $item_list[$package_srl];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Context::set('item_list', $res);
|
Context::set('item_list', $res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(count($package_list) != count($res))
|
||||||
|
{
|
||||||
|
$localPackageSrls = array_keys($package_list);
|
||||||
|
$remotePackageSrls = array_keys($item_list);
|
||||||
|
$targetPackageSrls = array_diff($localPackageSrls, $remotePackageSrls);
|
||||||
|
$countDiff = count($targetPackageSrls);
|
||||||
|
$output->page_navigation->total_count -= $countDiff;
|
||||||
|
}
|
||||||
|
|
||||||
Context::set('page_navigation', $output->page_navigation);
|
Context::set('page_navigation', $output->page_navigation);
|
||||||
|
|
||||||
$this->setTemplateFile('index');
|
$this->setTemplateFile('index');
|
||||||
|
|
|
||||||
|
|
@ -150,11 +150,14 @@
|
||||||
$schema_dir = sprintf('%s/schemas/', $this->package->path);
|
$schema_dir = sprintf('%s/schemas/', $this->package->path);
|
||||||
$schema_files = FileHandler::readDir($schema_dir);
|
$schema_files = FileHandler::readDir($schema_dir);
|
||||||
$oDB =& DB::getInstance();
|
$oDB =& DB::getInstance();
|
||||||
foreach($schema_files as $file)
|
if(is_array($schema_files))
|
||||||
{
|
{
|
||||||
$filename_arr = explode(".", $file);
|
foreach($schema_files as $file)
|
||||||
$filename = array_shift($filename_arr);
|
{
|
||||||
$oDB->dropTable($filename);
|
$filename_arr = explode(".", $file);
|
||||||
|
$filename = array_shift($filename_arr);
|
||||||
|
$oDB->dropTable($filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
@ -399,22 +402,25 @@
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
|
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
|
||||||
|
|
||||||
foreach($file_list as $k => $file){
|
if(is_array($file_list))
|
||||||
$org_file = $file;
|
{
|
||||||
if($this->package->path == ".")
|
foreach($file_list as $k => $file){
|
||||||
{
|
$org_file = $file;
|
||||||
$file = substr($file,3);
|
if($this->package->path == ".")
|
||||||
}
|
{
|
||||||
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
|
$file = substr($file,3);
|
||||||
$pathname = dirname($target_dir."/".$file);
|
}
|
||||||
|
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
|
||||||
|
$pathname = dirname($target_dir."/".$file);
|
||||||
|
|
||||||
if(!file_exists(FileHandler::getRealPath($real_path)))
|
if(!file_exists(FileHandler::getRealPath($real_path)))
|
||||||
{
|
{
|
||||||
ssh2_sftp_mkdir($this->sftp, $pathname, 0755, true);
|
ssh2_sftp_mkdir($this->sftp, $pathname, 0755, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path."/".$org_file), $target_dir."/".$file);
|
ssh2_scp_send($this->connection, FileHandler::getRealPath($this->download_path."/".$org_file), $target_dir."/".$file);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -550,54 +556,57 @@
|
||||||
}
|
}
|
||||||
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
|
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
|
||||||
|
|
||||||
foreach($file_list as $k => $file){
|
if(is_array($file_list))
|
||||||
if(!$file) continue;
|
{
|
||||||
$org_file = $file;
|
foreach($file_list as $k => $file){
|
||||||
if($this->package->path == ".")
|
if(!$file) continue;
|
||||||
{
|
$org_file = $file;
|
||||||
$file = substr($file,3);
|
if($this->package->path == ".")
|
||||||
}
|
{
|
||||||
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
|
$file = substr($file,3);
|
||||||
$path_list = explode('/', dirname($this->target_path."/".$file));
|
}
|
||||||
|
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
|
||||||
|
$path_list = explode('/', dirname($this->target_path."/".$file));
|
||||||
|
|
||||||
$real_path = "./";
|
$real_path = "./";
|
||||||
$ftp_path = $this->ftp_info->ftp_root_path;
|
$ftp_path = $this->ftp_info->ftp_root_path;
|
||||||
|
|
||||||
for($i=0;$i<count($path_list);$i++)
|
for($i=0;$i<count($path_list);$i++)
|
||||||
{
|
{
|
||||||
if($path_list=="") continue;
|
if($path_list=="") continue;
|
||||||
$real_path .= $path_list[$i]."/";
|
$real_path .= $path_list[$i]."/";
|
||||||
$ftp_path .= $path_list[$i]."/";
|
$ftp_path .= $path_list[$i]."/";
|
||||||
if(!file_exists(FileHandler::getRealPath($real_path)))
|
if(!file_exists(FileHandler::getRealPath($real_path)))
|
||||||
{
|
{
|
||||||
if(!@ftp_mkdir($this->connection, $ftp_path))
|
if(!@ftp_mkdir($this->connection, $ftp_path))
|
||||||
{
|
{
|
||||||
return new Object(-1, "msg_make_directory_failed");
|
return new Object(-1, "msg_make_directory_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
|
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')
|
||||||
{
|
{
|
||||||
if (function_exists('ftp_chmod')) {
|
if (function_exists('ftp_chmod')) {
|
||||||
if(!ftp_chmod($this->connection, 0755, $ftp_path))
|
if(!ftp_chmod($this->connection, 0755, $ftp_path))
|
||||||
{
|
{
|
||||||
return new Object(-1, "msg_permission_adjust_failed");
|
return new Object(-1, "msg_permission_adjust_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(!ftp_site($this->connection, "CHMOD 755 ".$ftp_path))
|
if(!ftp_site($this->connection, "CHMOD 755 ".$ftp_path))
|
||||||
{
|
{
|
||||||
return new Object(-1, "msg_permission_adjust_failed");
|
return new Object(-1, "msg_permission_adjust_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!ftp_put($this->connection, $target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY))
|
if(!ftp_put($this->connection, $target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file), FTP_BINARY))
|
||||||
{
|
{
|
||||||
return new Object(-1, "msg_ftp_upload_failed");
|
return new Object(-1, "msg_ftp_upload_failed");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->_close();
|
$this->_close();
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
@ -718,31 +727,34 @@
|
||||||
$oFtp =& $this->oFtp;
|
$oFtp =& $this->oFtp;
|
||||||
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
|
$target_dir = $this->ftp_info->ftp_root_path.$this->target_path;
|
||||||
|
|
||||||
foreach($file_list as $k => $file){
|
if(is_array($file_list))
|
||||||
$org_file = $file;
|
{
|
||||||
if($this->package->path == ".")
|
foreach($file_list as $k => $file){
|
||||||
{
|
$org_file = $file;
|
||||||
$file = substr($file,3);
|
if($this->package->path == ".")
|
||||||
}
|
{
|
||||||
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
|
$file = substr($file,3);
|
||||||
$path_list = explode('/', dirname($this->target_path."/".$file));
|
}
|
||||||
|
$path = FileHandler::getRealPath("./".$this->target_path."/".$file);
|
||||||
|
$path_list = explode('/', dirname($this->target_path."/".$file));
|
||||||
|
|
||||||
$real_path = "./";
|
$real_path = "./";
|
||||||
$ftp_path = $this->ftp_info->ftp_root_path;
|
$ftp_path = $this->ftp_info->ftp_root_path;
|
||||||
|
|
||||||
for($i=0;$i<count($path_list);$i++)
|
for($i=0;$i<count($path_list);$i++)
|
||||||
{
|
{
|
||||||
if($path_list=="") continue;
|
if($path_list=="") continue;
|
||||||
$real_path .= $path_list[$i]."/";
|
$real_path .= $path_list[$i]."/";
|
||||||
$ftp_path .= $path_list[$i]."/";
|
$ftp_path .= $path_list[$i]."/";
|
||||||
if(!file_exists(FileHandler::getRealPath($real_path)))
|
if(!file_exists(FileHandler::getRealPath($real_path)))
|
||||||
{
|
{
|
||||||
$oFtp->ftp_mkdir($ftp_path);
|
$oFtp->ftp_mkdir($ftp_path);
|
||||||
$oFtp->ftp_site("CHMOD 755 ".$ftp_path);
|
$oFtp->ftp_site("CHMOD 755 ".$ftp_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$oFtp->ftp_put($target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file));
|
$oFtp->ftp_put($target_dir .'/'. $file, FileHandler::getRealPath($this->download_path."/".$org_file));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->_close();
|
$this->_close();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<include target="category.html" />
|
<include target="category.html" />
|
||||||
|
|
||||||
<div class="table even easyList">
|
<div class="table even easyList dsTg">
|
||||||
<table width="100%" border="1" cellspacing="0">
|
<table width="100%" border="1" cellspacing="0">
|
||||||
<caption>
|
<caption>
|
||||||
<block cond="$current_category">{$current_category}</block>
|
<block cond="$current_category">{$current_category}</block>
|
||||||
|
|
@ -28,11 +28,12 @@
|
||||||
<a href="{getUrl('order_target','download','order_type',$_download_order_type)}">{$lang->order_download}<!--@if($order_target == 'download')--><!--@if($_download_order_type == 'asc')-->▼<!--@else-->▲<!--@end--><!--@end--></a> |
|
<a href="{getUrl('order_target','download','order_type',$_download_order_type)}">{$lang->order_download}<!--@if($order_target == 'download')--><!--@if($_download_order_type == 'asc')-->▼<!--@else-->▲<!--@end--><!--@end--></a> |
|
||||||
<a href="{getUrl('order_target','popular','order_type',$_popular_order_type)}">{$lang->order_popular}<!--@if($order_target == 'popular')--><!--@if($_popular_order_type == 'asc')-->▼<!--@else-->▲<!--@end--><!--@end--></a>
|
<a href="{getUrl('order_target','popular','order_type',$_popular_order_type)}">{$lang->order_popular}<!--@if($order_target == 'popular')--><!--@if($_popular_order_type == 'asc')-->▼<!--@else-->▲<!--@end--><!--@end--></a>
|
||||||
</span>
|
</span>
|
||||||
|
<span class="side"><button type="button" class="text"><span class="hide">{$lang->simple_view}</span><span class="show">{$lang->detail_view}</span></button></span>
|
||||||
</caption>
|
</caption>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" class="nowr">{$lang->category}</th>
|
<th scope="col" class="nowr">{$lang->category}</th>
|
||||||
<th scope="col">{$lang->thumbnail}</th>
|
<th scope="col" class="thumb">{$lang->thumbnail}</th>
|
||||||
<th scope="col" class="title">{$lang->name}</th>
|
<th scope="col" class="title">{$lang->name}</th>
|
||||||
<th scope="col" class="nowr">{$lang->distribute_version}</th>
|
<th scope="col" class="nowr">{$lang->distribute_version}</th>
|
||||||
<th scope="col" class="nowr">{$lang->current_version}</th>
|
<th scope="col" class="nowr">{$lang->current_version}</th>
|
||||||
|
|
@ -43,7 +44,7 @@
|
||||||
<tr loop="$item_list => $key, $item">
|
<tr loop="$item_list => $key, $item">
|
||||||
{@ $target_url = $original_site."?mid=download&package_srl=".$item->package_srl; }
|
{@ $target_url = $original_site."?mid=download&package_srl=".$item->package_srl; }
|
||||||
<td class="nowr">{$item->category}</td>
|
<td class="nowr">{$item->category}</td>
|
||||||
<td><img src="{str_replace('./', $uri, $item->item_screenshot_url)}" alt="" width="100" height="100" /></td>
|
<td class="thumb"><img src="{str_replace('./', $uri, $item->item_screenshot_url)}" alt="" width="100" height="100" /></td>
|
||||||
<td class="title">
|
<td class="title">
|
||||||
<p><a href="{$target_url}">{htmlspecialchars($item->title)}</a></p>
|
<p><a href="{$target_url}">{htmlspecialchars($item->title)}</a></p>
|
||||||
<p>{cut_str(htmlspecialchars($item->package_description),200)}</p>
|
<p>{cut_str(htmlspecialchars($item->package_description),200)}</p>
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
// get a list by using comment->getCommentList.
|
// get a list by using comment->getCommentList.
|
||||||
$oCommentModel = &getModel('comment');
|
$oCommentModel = &getModel('comment');
|
||||||
$secretNameList = $oCommentModel->getSecretNameList();
|
$secretNameList = $oCommentModel->getSecretNameList();
|
||||||
$columnList = array('comment_srl', 'document_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress');
|
$columnList = array('comment_srl', 'document_srl', 'is_secret', 'status', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress', 'voted_count', 'blamed_count');
|
||||||
$output = $oCommentModel->getTotalCommentList($args, $columnList);
|
$output = $oCommentModel->getTotalCommentList($args, $columnList);
|
||||||
|
|
||||||
$oCommentModel = &getModel("comment");
|
$oCommentModel = &getModel("comment");
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||||
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,6 +132,12 @@
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||||
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after'))
|
||||||
|
{
|
||||||
|
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'comment', 'controller', 'triggerCopyModule', 'after');
|
||||||
|
}
|
||||||
|
|
||||||
return new Object(0, 'success_updated');
|
return new Object(0, 'success_updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,13 @@
|
||||||
* @param int $module_srl
|
* @param int $module_srl
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function isModuleUsingPublishValidation($document_srl=null, $module_srl=null)
|
function isModuleUsingPublishValidation($module_srl=null)
|
||||||
{
|
{
|
||||||
|
if(!$module_srl == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||||
$module_part_config = $oModuleModel->getModulePartConfig('comment',$module_info->module_srl);
|
$module_part_config = $oModuleModel->getModulePartConfig('comment',$module_info->module_srl);
|
||||||
|
|
@ -956,36 +961,51 @@
|
||||||
return new Object();
|
return new Object();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get comment all list
|
* Get comment all list
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function procCommentGetList()
|
function procCommentGetList()
|
||||||
{
|
{
|
||||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||||
$commentSrls = Context::get('comment_srls');
|
$commentSrls = Context::get('comment_srls');
|
||||||
if($commentSrls) $commentSrlList = explode(',', $commentSrls);
|
if($commentSrls) $commentSrlList = explode(',', $commentSrls);
|
||||||
|
|
||||||
if(count($commentSrlList) > 0) {
|
if(count($commentSrlList) > 0) {
|
||||||
$oCommentModel = &getModel('comment');
|
$oCommentModel = &getModel('comment');
|
||||||
$commentList = $oCommentModel->getComments($commentSrlList);
|
$commentList = $oCommentModel->getComments($commentSrlList);
|
||||||
|
|
||||||
if(is_array($commentList))
|
if(is_array($commentList))
|
||||||
{
|
|
||||||
foreach($commentList AS $key=>$value)
|
|
||||||
{
|
{
|
||||||
$value->content = strip_tags($value->content);
|
foreach($commentList AS $key=>$value)
|
||||||
|
{
|
||||||
|
$value->content = strip_tags($value->content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
global $lang;
|
||||||
|
$commentList = array();
|
||||||
|
$this->setMessage($lang->no_documents);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->add('comment_list', $commentList);
|
||||||
|
}
|
||||||
|
|
||||||
|
function triggerCopyModule(&$obj)
|
||||||
|
{
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$commentConfig = $oModuleModel->getModulePartConfig('comment', $obj->originModuleSrl);
|
||||||
|
|
||||||
|
$oModuleController = &getController('module');
|
||||||
|
if(is_array($obj->moduleSrlList))
|
||||||
|
{
|
||||||
|
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||||
|
{
|
||||||
|
$oModuleController->insertModulePartConfig('comment', $moduleSrl, $commentConfig);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
global $lang;
|
|
||||||
$commentList = array();
|
|
||||||
$this->setMessage($lang->no_documents);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->add('comment_list', $commentList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,7 @@
|
||||||
if(!$this->get('uploaded_count')) return;
|
if(!$this->get('uploaded_count')) return;
|
||||||
|
|
||||||
$oFileModel = &getModel('file');
|
$oFileModel = &getModel('file');
|
||||||
$file_list = $oFileModel->getFiles($this->comment_srl, $is_admin);
|
$file_list = $oFileModel->getFiles($this->comment_srl, array(), 'file_srl', true);
|
||||||
return $file_list;
|
return $file_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -280,27 +280,30 @@
|
||||||
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
|
if(is_array($obj->module_srl)) $args->module_srl = implode(',', $obj->module_srl);
|
||||||
else $args->module_srl = $obj->module_srl;
|
else $args->module_srl = $obj->module_srl;
|
||||||
$args->list_count = $obj->list_count;
|
$args->list_count = $obj->list_count;
|
||||||
// cache controll
|
// cache controll
|
||||||
$oCacheHandler = &CacheHandler::getInstance('object');
|
$oCacheHandler = &CacheHandler::getInstance('object');
|
||||||
if($oCacheHandler->isSupport()){
|
if($oCacheHandler->isSupport()){
|
||||||
$object_key = 'object_newest_comment_list:'.$obj->module_srl;
|
$object_key = 'object_newest_comment_list:'.$obj->module_srl;
|
||||||
$cache_key = $oCacheHandler->getGroupKey('newestCommentsList', $object_key);
|
$cache_key = $oCacheHandler->getGroupKey('newestCommentsList', $object_key);
|
||||||
$output = $oCacheHandler->get($cache_key);
|
$output = $oCacheHandler->get($cache_key);
|
||||||
}
|
}
|
||||||
if(!$output){
|
if(!$output)
|
||||||
|
{
|
||||||
if(strpos($args->module_srl,",")===false)
|
if(strpos($args->module_srl,",")===false)
|
||||||
{
|
{
|
||||||
// check if module is using comment validation system
|
if($args->module_srl)
|
||||||
$oCommentController = &getController("comment");
|
|
||||||
$is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl);
|
|
||||||
if($is_using_validation)
|
|
||||||
{
|
{
|
||||||
$args->status = 1;
|
// check if module is using comment validation system
|
||||||
|
$oCommentController = &getController("comment");
|
||||||
|
$is_using_validation = $oCommentController->isModuleUsingPublishValidation($obj->module_srl);
|
||||||
|
if($is_using_validation)
|
||||||
|
{
|
||||||
|
$args->status = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
|
$output = executeQuery('comment.getNewestCommentList', $args, $columnList);
|
||||||
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$output);
|
||||||
}
|
}
|
||||||
if(!$output->toBool()) return $output;
|
if(!$output->toBool()) return $output;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
<condition operation="in" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
<condition operation="in" column="module_srl" var="module_srl" filter="number" pipe="and" />
|
||||||
</conditions>
|
</conditions>
|
||||||
<navigation>
|
<navigation>
|
||||||
<index var="sort_index" default="status" order="desc" />
|
|
||||||
<index var="sort_index" default="list_order" order="asc" />
|
<index var="sort_index" default="list_order" order="asc" />
|
||||||
<list_count var="list_count" default="20" />
|
<list_count var="list_count" default="20" />
|
||||||
</navigation>
|
</navigation>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,6 @@
|
||||||
<column name="last_update" var="last_update" default="curdate()" />
|
<column name="last_update" var="last_update" default="curdate()" />
|
||||||
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
<column name="ipaddress" var="ipaddress" default="ipaddress()" />
|
||||||
<column name="list_order" var="list_order" default="0" />
|
<column name="list_order" var="list_order" default="0" />
|
||||||
<column name="status" var="status" notnull="notnull" default="0" />
|
<column name="status" var="status" notnull="notnull" default="1" />
|
||||||
</columns>
|
</columns>
|
||||||
</query>
|
</query>
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" target="_blank"><!--@if(strlen($comment))-->{$comment}<!--@else--><em>{$lang->no_text_comment}</em><!--@end--></a></td>
|
<td class="text"><a href="{getUrl('','document_srl',$val->document_srl)}#comment_{$val->comment_srl}" target="_blank"><!--@if(strlen($comment))-->{$comment}<!--@else--><em>{$lang->no_text_comment}</em><!--@end--></a></td>
|
||||||
<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
|
<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
|
||||||
<td class="nowr">0/0</td>
|
<td class="nowr">{number_format($val->get('voted_count'))}/{number_format($val->get('blamed_count'))}</td>
|
||||||
<td class="nowr">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>
|
<td class="nowr">{(zdate($val->regdate,"Y-m-d\nH:i:s"))}</td>
|
||||||
<td class="nowr"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>
|
<td class="nowr"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>
|
||||||
<td class="nowr"><!--@if($val->isSecret())-->{$secret_name_list['Y']}<!--@else-->{$secret_name_list['N']}<!--@end--></td>
|
<td class="nowr"><!--@if($val->isSecret())-->{$secret_name_list['Y']}<!--@else-->{$secret_name_list['N']}<!--@end--></td>
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,13 @@
|
||||||
**/
|
**/
|
||||||
function procCommunicationAdminInsertConfig() {
|
function procCommunicationAdminInsertConfig() {
|
||||||
// get the default information
|
// get the default information
|
||||||
$args = Context::gets('skin','colorset','editor_skin','editor_colorset', 'mskin');
|
$args = Context::gets('skin','colorset','editor_skin','editor_colorset', 'mskin', 'layout_srl', 'mlayout_srl');
|
||||||
|
|
||||||
if(!$args->skin) $args->skin = 'default';
|
if(!$args->skin) $args->skin = 'default';
|
||||||
if(!$args->colorset) $args->colorset = 'white';
|
if(!$args->colorset) $args->colorset = 'white';
|
||||||
if(!$args->editor_skin) $args->editor_skin = 'default';
|
if(!$args->editor_skin) $args->editor_skin = 'default';
|
||||||
if(!$args->mskin) $args->mskin = 'default';
|
if(!$args->mskin) $args->mskin = 'default';
|
||||||
|
if(!$args->layout_srl) $args->layout_srl = null;
|
||||||
|
|
||||||
// create the module module Controller object
|
// create the module module Controller object
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
|
|
|
||||||
|
|
@ -17,13 +17,17 @@
|
||||||
* configuration to manage messages and friends
|
* configuration to manage messages and friends
|
||||||
* @return void
|
* @return void
|
||||||
**/
|
**/
|
||||||
function dispCommunicationAdminConfig() {
|
function dispCommunicationAdminConfig()
|
||||||
|
{
|
||||||
// Creating an object
|
// Creating an object
|
||||||
$oEditorModel = &getModel('editor');
|
$oEditorModel = &getModel('editor');
|
||||||
$oModuleModel = &getModel('module');
|
$oModuleModel = &getModel('module');
|
||||||
|
$oLayoutModel = &getModel('layout');
|
||||||
$oCommunicationModel = &getModel('communication');
|
$oCommunicationModel = &getModel('communication');
|
||||||
// get the configurations of communication module
|
// get the configurations of communication module
|
||||||
Context::set('communication_config', $oCommunicationModel->getConfig() );
|
Context::set('communication_config', $oCommunicationModel->getConfig() );
|
||||||
|
// get a list of layout
|
||||||
|
Context::set('layout_list', $oLayoutModel->getLayoutList() );
|
||||||
// get a list of editor skins
|
// get a list of editor skins
|
||||||
Context::set('editor_skin_list', $oEditorModel->getEditorSkinList() );
|
Context::set('editor_skin_list', $oEditorModel->getEditorSkinList() );
|
||||||
// get a list of communication skins
|
// get a list of communication skins
|
||||||
|
|
@ -31,8 +35,16 @@
|
||||||
// get a list of communication skins
|
// get a list of communication skins
|
||||||
Context::set('communication_mobile_skin_list', $oModuleModel->getSkins($this->module_path, 'm.skins') );
|
Context::set('communication_mobile_skin_list', $oModuleModel->getSkins($this->module_path, 'm.skins') );
|
||||||
|
|
||||||
|
// Get a layout list
|
||||||
|
$layout_list = $oLayoutModel->getLayoutList();
|
||||||
|
Context::set('layout_list', $layout_list);
|
||||||
|
|
||||||
|
$mlayout_list = $oLayoutModel->getLayoutList(0, 'M');
|
||||||
|
Context::set('mlayout_list', $mlayout_list);
|
||||||
|
|
||||||
$security = new Security();
|
$security = new Security();
|
||||||
$security->encodeHTML('communication_config..');
|
$security->encodeHTML('communication_config..');
|
||||||
|
$security->encodeHTML('layout_list..');
|
||||||
$security->encodeHTML('editor_skin_list..');
|
$security->encodeHTML('editor_skin_list..');
|
||||||
$security->encodeHTML('communication_skin_list..title');
|
$security->encodeHTML('communication_skin_list..title');
|
||||||
$security->encodeHTML('communication_mobile_skin_list..title');
|
$security->encodeHTML('communication_mobile_skin_list..title');
|
||||||
|
|
|
||||||
|
|
@ -195,12 +195,16 @@
|
||||||
$oCommunicationModel = &getModel('communication');
|
$oCommunicationModel = &getModel('communication');
|
||||||
$message = $oCommunicationModel->getSelectedMessage($message_srl);
|
$message = $oCommunicationModel->getSelectedMessage($message_srl);
|
||||||
if(!$message) return new Object(-1,'msg_invalid_request');
|
if(!$message) return new Object(-1,'msg_invalid_request');
|
||||||
// Check a message type if 'S' or 'R'
|
// Check the grant
|
||||||
if($message->sender_srl == $member_srl && $message->message_type == 'S') {
|
switch($message->message_type)
|
||||||
if(!$message_srl) return new Object(-1, 'msg_invalid_request');
|
{
|
||||||
} elseif($message->receiver_srl == $member_srl && $message->message_type == 'R') {
|
case 'S':
|
||||||
if(!$message_srl) return new Object(-1, 'msg_invalid_request');
|
if($message->sender_srl != $member_srl) return new Object(-1, 'msg_invalid_request');
|
||||||
}
|
break;
|
||||||
|
case 'R':
|
||||||
|
if($message->receiver_srl != $member_srl) return new Object(-1, 'msg_invalid_request');
|
||||||
|
break;
|
||||||
|
}
|
||||||
// Delete
|
// Delete
|
||||||
$args->message_srl = $message_srl;
|
$args->message_srl = $message_srl;
|
||||||
$output = executeQuery('communication.deleteMessage', $args);
|
$output = executeQuery('communication.deleteMessage', $args);
|
||||||
|
|
@ -290,15 +294,27 @@
|
||||||
* Move a group of the friend
|
* Move a group of the friend
|
||||||
* @return void|Object (success : void, fail : Object)
|
* @return void|Object (success : void, fail : Object)
|
||||||
**/
|
**/
|
||||||
function procCommunicationMoveFriend() {
|
function procCommunicationMoveFriend()
|
||||||
|
{
|
||||||
// Check login information
|
// Check login information
|
||||||
if(!Context::get('is_logged')) return new Object(-1, 'msg_not_logged');
|
if(!Context::get('is_logged'))
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_not_logged');
|
||||||
|
}
|
||||||
|
|
||||||
$logged_info = Context::get('logged_info');
|
$logged_info = Context::get('logged_info');
|
||||||
// Check variables
|
// Check variables
|
||||||
$friend_srl_list = trim(Context::get('friend_srl_list'));
|
$friend_srl_list = Context::get('friend_srl_list');
|
||||||
if(!$friend_srl_list) return new Object(-1, 'msg_cart_is_null');
|
if(!$friend_srl_list)
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_cart_is_null');
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!is_array($friend_srl_list))
|
||||||
|
{
|
||||||
|
$friend_srl_list = explode('|@|', $friend_srl_list);
|
||||||
|
}
|
||||||
|
|
||||||
$friend_srl_list = explode('|@|', $friend_srl_list);
|
|
||||||
if(!count($friend_srl_list)) return new Object(-1, 'msg_cart_is_null');
|
if(!count($friend_srl_list)) return new Object(-1, 'msg_cart_is_null');
|
||||||
|
|
||||||
$friend_count = count($friend_srl_list);
|
$friend_count = count($friend_srl_list);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,14 @@ class communicationMobile extends communicationView {
|
||||||
|
|
||||||
$tpl_path = sprintf('%sm.skins/%s', $this->module_path, $skin);
|
$tpl_path = sprintf('%sm.skins/%s', $this->module_path, $skin);
|
||||||
$this->setTemplatePath($tpl_path);
|
$this->setTemplatePath($tpl_path);
|
||||||
|
|
||||||
|
$oLayoutModel = &getModel('layout');
|
||||||
|
$layout_info = $oLayoutModel->getLayout($this->communication_config->mlayout_srl);
|
||||||
|
if($layout_info)
|
||||||
|
{
|
||||||
|
$this->module_info->mlayout_srl = $this->communication_config->mlayout_srl;
|
||||||
|
$this->setLayoutPath($layout_info->path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function dispCommunicationMessages()
|
function dispCommunicationMessages()
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,14 @@
|
||||||
$tpl_path = sprintf('%sskins/%s', $this->module_path, $skin);
|
$tpl_path = sprintf('%sskins/%s', $this->module_path, $skin);
|
||||||
}
|
}
|
||||||
$this->setTemplatePath($tpl_path);
|
$this->setTemplatePath($tpl_path);
|
||||||
|
|
||||||
|
$oLayoutModel = &getModel('layout');
|
||||||
|
$layout_info = $oLayoutModel->getLayout($this->communication_config->layout_srl);
|
||||||
|
if($layout_info)
|
||||||
|
{
|
||||||
|
$this->module_info->layout_srl = $this->communication_config->layout_srl;
|
||||||
|
$this->setLayoutPath($layout_info->path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,6 +62,27 @@
|
||||||
if($message_srl) {
|
if($message_srl) {
|
||||||
$columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate');
|
$columnList = array('message_srl', 'sender_srl', 'receiver_srl', 'message_type', 'title', 'content', 'readed', 'regdate');
|
||||||
$message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList);
|
$message = $oCommunicationModel->getSelectedMessage($message_srl, $columnList);
|
||||||
|
switch($message->message_type)
|
||||||
|
{
|
||||||
|
case 'R':
|
||||||
|
if($message->receiver_srl != $logged_info->member_srl)
|
||||||
|
{
|
||||||
|
return $this->stop('msg_invalid_request');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'S':
|
||||||
|
if($message->sender_srl != $logged_info->member_srl)
|
||||||
|
{
|
||||||
|
return $this->stop('msg_invalid_request');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'T':
|
||||||
|
if($message->receiver_srl != $logged_info->member_srl && $message->sender_srl != $logged_info->member_srl)
|
||||||
|
{
|
||||||
|
return $this->stop('msg_invalid_request');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl) ) {
|
if($message->message_srl == $message_srl && ($message->receiver_srl == $logged_info->member_srl || $message->sender_srl == $logged_info->member_srl) ) {
|
||||||
stripEmbedTagForAdmin($message->content, $message->sender_srl);
|
stripEmbedTagForAdmin($message->content, $message->sender_srl);
|
||||||
Context::set('message', $message);
|
Context::set('message', $message);
|
||||||
|
|
@ -81,6 +110,7 @@
|
||||||
* @return void|Object (void : success, Object : fail)
|
* @return void|Object (void : success, Object : fail)
|
||||||
**/
|
**/
|
||||||
function dispCommunicationNewMessage() {
|
function dispCommunicationNewMessage() {
|
||||||
|
$this->setLayoutPath('./common/tpl/');
|
||||||
$this->setLayoutFile('popup_layout');
|
$this->setLayoutFile('popup_layout');
|
||||||
// Error appears if not logged-in
|
// Error appears if not logged-in
|
||||||
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
|
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
|
||||||
|
|
@ -108,6 +138,7 @@
|
||||||
* @return void|Object (void : success, Object : fail)
|
* @return void|Object (void : success, Object : fail)
|
||||||
**/
|
**/
|
||||||
function dispCommunicationSendMessage() {
|
function dispCommunicationSendMessage() {
|
||||||
|
$this->setLayoutPath('./common/tpl/');
|
||||||
$this->setLayoutFile("popup_layout");
|
$this->setLayoutFile("popup_layout");
|
||||||
$oCommunicationModel = &getModel('communication');
|
$oCommunicationModel = &getModel('communication');
|
||||||
$oMemberModel = &getModel('member');
|
$oMemberModel = &getModel('member');
|
||||||
|
|
@ -201,6 +232,7 @@
|
||||||
* @return void|Object (void : success, Object : fail)
|
* @return void|Object (void : success, Object : fail)
|
||||||
**/
|
**/
|
||||||
function dispCommunicationAddFriend() {
|
function dispCommunicationAddFriend() {
|
||||||
|
$this->setLayoutPath('./common/tpl/');
|
||||||
$this->setLayoutFile("popup_layout");
|
$this->setLayoutFile("popup_layout");
|
||||||
// error appears if not logged-in
|
// error appears if not logged-in
|
||||||
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
|
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
|
||||||
|
|
@ -226,6 +258,7 @@
|
||||||
* @return void|Object (void : success, Object : fail)
|
* @return void|Object (void : success, Object : fail)
|
||||||
**/
|
**/
|
||||||
function dispCommunicationAddFriendGroup() {
|
function dispCommunicationAddFriendGroup() {
|
||||||
|
$this->setLayoutPath('./common/tpl/');
|
||||||
$this->setLayoutFile("popup_layout");
|
$this->setLayoutFile("popup_layout");
|
||||||
// error apprears if not logged-in
|
// error apprears if not logged-in
|
||||||
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
|
if(!Context::get('is_logged')) return $this->stop('msg_not_logged');
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,15 @@
|
||||||
//]]></script>
|
//]]></script>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">{$lang->layout}</th>
|
||||||
|
<td>
|
||||||
|
<select id="layout" name="layout_srl">
|
||||||
|
<option value="0">{$lang->notuse}</option>
|
||||||
|
<option loop="$layout_list => $key,$val" value="{$val->layout_srl}" selected="selected"|cond="$val->layout_srl == $communication_config->layout_srl">{$val->title} ({$val->layout})</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{$lang->skin}</th>
|
<th scope="row">{$lang->skin}</th>
|
||||||
<td>
|
<td>
|
||||||
|
|
@ -39,6 +48,15 @@
|
||||||
<th scope="row">{$lang->colorset}</th>
|
<th scope="row">{$lang->colorset}</th>
|
||||||
<td><div id="communication_colorset"></div></td>
|
<td><div id="communication_colorset"></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>{$lang->mobile_layout}</th>
|
||||||
|
<td>
|
||||||
|
<select id="layout" name="mlayout_srl">
|
||||||
|
<option value="0">{$lang->notuse}</option>
|
||||||
|
<option loop="$mlayout_list => $key,$val" value="{$val->layout_srl}" selected="selected"|cond="$val->layout_srl == $communication_config->mlayout_srl">{$val->title} ({$val->layout})</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{$lang->mobile_skin}</th>
|
<th scope="row">{$lang->mobile_skin}</th>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write a post
|
// Write a post
|
||||||
$output = $oDocumentController->insertDocument($obj, true);
|
$output = $oDocumentController->insertDocument($obj, true, true);
|
||||||
if(!$output->toBool()) {
|
if(!$output->toBool()) {
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
return $output;
|
return $output;
|
||||||
|
|
@ -361,6 +361,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call a trigger (before)
|
// Call a trigger (before)
|
||||||
|
$triggerObj->copied_srls = $copied_srls;
|
||||||
$output = ModuleHandler::triggerCall('document.copyDocumentModule', 'after', $triggerObj);
|
$output = ModuleHandler::triggerCall('document.copyDocumentModule', 'after', $triggerObj);
|
||||||
if(!$output->toBool()) {
|
if(!$output->toBool()) {
|
||||||
$oDB->rollback();
|
$oDB->rollback();
|
||||||
|
|
@ -480,7 +481,7 @@
|
||||||
$type = Context::get('type');
|
$type = Context::get('type');
|
||||||
$is_required = Context::get('is_required');
|
$is_required = Context::get('is_required');
|
||||||
$default = Context::get('default');
|
$default = Context::get('default');
|
||||||
$desc = Context::get('desc');
|
$desc = Context::get('desc') ? Context::get('desc') : '';
|
||||||
$search = Context::get('search');
|
$search = Context::get('search');
|
||||||
$eid = Context::get('eid');
|
$eid = Context::get('eid');
|
||||||
|
|
||||||
|
|
@ -709,7 +710,7 @@
|
||||||
$oDB->begin();
|
$oDB->begin();
|
||||||
|
|
||||||
//DB restore
|
//DB restore
|
||||||
$output = $oDocumentController->insertDocument($originObject, false, true);
|
$output = $oDocumentController->insertDocument($originObject, false, true, false);
|
||||||
if(!$output->toBool()) return new Object(-1, $output->getMessage());
|
if(!$output->toBool()) return new Object(-1, $output->getMessage());
|
||||||
|
|
||||||
//FILE restore
|
//FILE restore
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,9 @@
|
||||||
Context::set('status_name_list', $statusNameList);
|
Context::set('status_name_list', $statusNameList);
|
||||||
Context::set('page_navigation', $output->page_navigation);
|
Context::set('page_navigation', $output->page_navigation);
|
||||||
|
|
||||||
|
$oSecurity = new Security();
|
||||||
|
$oSecurity->encodeHTML('document_list..variables.');
|
||||||
|
|
||||||
// set a search option used in the template
|
// set a search option used in the template
|
||||||
$count_search_option = count($this->search_option);
|
$count_search_option = count($this->search_option);
|
||||||
for($i=0;$i<$count_search_option;$i++) {
|
for($i=0;$i<$count_search_option;$i++) {
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,9 @@ class document extends ModuleObject
|
||||||
// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
|
// 2012. 02. 27 Add a trigger to copy extra keys when the module is copied
|
||||||
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after')) return true;
|
||||||
|
|
||||||
|
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||||
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -296,6 +299,12 @@ class document extends ModuleObject
|
||||||
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after');
|
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModuleExtraKeys', 'after');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||||
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after'))
|
||||||
|
{
|
||||||
|
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'document', 'controller', 'triggerCopyModule', 'after');
|
||||||
|
}
|
||||||
|
|
||||||
return new Object(0,'success_updated');
|
return new Object(0,'success_updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,12 @@ class documentController extends document {
|
||||||
* @param bool $isRestore
|
* @param bool $isRestore
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function insertDocument($obj, $manual_inserted = false, $isRestore = false) {
|
function insertDocument($obj, $manual_inserted = false, $isRestore = false, $isLatest = true) {
|
||||||
|
if(!checkCSRF())
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_invalid_request');
|
||||||
|
}
|
||||||
|
|
||||||
// begin transaction
|
// begin transaction
|
||||||
$oDB = &DB::getInstance();
|
$oDB = &DB::getInstance();
|
||||||
$oDB->begin();
|
$oDB->begin();
|
||||||
|
|
@ -212,7 +217,7 @@ class documentController extends document {
|
||||||
}
|
}
|
||||||
// Set the read counts and update order.
|
// Set the read counts and update order.
|
||||||
if(!$obj->readed_count) $obj->readed_count = 0;
|
if(!$obj->readed_count) $obj->readed_count = 0;
|
||||||
if(!$isRestore) $obj->update_order = $obj->list_order = getNextSequence() * -1;
|
if($isLatest) $obj->update_order = $obj->list_order = getNextSequence() * -1;
|
||||||
else $obj->update_order = $obj->list_order;
|
else $obj->update_order = $obj->list_order;
|
||||||
// Check the status of password hash for manually inserting. Apply md5 hashing for otherwise.
|
// Check the status of password hash for manually inserting. Apply md5 hashing for otherwise.
|
||||||
if($obj->password && !$obj->password_is_hashed) $obj->password = md5($obj->password);
|
if($obj->password && !$obj->password_is_hashed) $obj->password = md5($obj->password);
|
||||||
|
|
@ -309,6 +314,11 @@ class documentController extends document {
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function updateDocument($source_obj, $obj) {
|
function updateDocument($source_obj, $obj) {
|
||||||
|
if(!checkCSRF())
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_invalid_request');
|
||||||
|
}
|
||||||
|
|
||||||
if(!$source_obj->document_srl || !$obj->document_srl) return new Object(-1,'msg_invalied_request');
|
if(!$source_obj->document_srl || !$obj->document_srl) return new Object(-1,'msg_invalied_request');
|
||||||
if(!$obj->status && $obj->is_secret == 'Y') $obj->status = 'SECRET';
|
if(!$obj->status && $obj->is_secret == 'Y') $obj->status = 'SECRET';
|
||||||
if(!$obj->status) $obj->status = 'PUBLIC';
|
if(!$obj->status) $obj->status = 'PUBLIC';
|
||||||
|
|
@ -745,6 +755,8 @@ class documentController extends document {
|
||||||
$cache_key = 'object_document_item:'.$document_srl;
|
$cache_key = 'object_document_item:'.$document_srl;
|
||||||
$oCacheHandler->delete($cache_key);
|
$oCacheHandler->delete($cache_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -1616,6 +1628,7 @@ class documentController extends document {
|
||||||
$xml_buff = sprintf(
|
$xml_buff = sprintf(
|
||||||
'<?php '.
|
'<?php '.
|
||||||
'define(\'__ZBXE__\', true); '.
|
'define(\'__ZBXE__\', true); '.
|
||||||
|
'define(\'__XE__\', true); '.
|
||||||
'require_once(\''.FileHandler::getRealPath('./config/config.inc.php').'\'); '.
|
'require_once(\''.FileHandler::getRealPath('./config/config.inc.php').'\'); '.
|
||||||
'$oContext = &Context::getInstance(); '.
|
'$oContext = &Context::getInstance(); '.
|
||||||
'$oContext->init(); '.
|
'$oContext->init(); '.
|
||||||
|
|
@ -1862,6 +1875,11 @@ class documentController extends document {
|
||||||
set_time_limit(0);
|
set_time_limit(0);
|
||||||
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
|
||||||
|
|
||||||
|
if(!checkCSRF())
|
||||||
|
{
|
||||||
|
return new Object(-1, 'msg_invalid_request');
|
||||||
|
}
|
||||||
|
|
||||||
$type = Context::get('type');
|
$type = Context::get('type');
|
||||||
$target_module = Context::get('target_module');
|
$target_module = Context::get('target_module');
|
||||||
$module_srl = Context::get('module_srl');
|
$module_srl = Context::get('module_srl');
|
||||||
|
|
@ -1918,14 +1936,14 @@ class documentController extends document {
|
||||||
$msg_code = 'success_moved';
|
$msg_code = 'success_moved';
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif($type == 'copy') {
|
elseif($type == 'copy')
|
||||||
|
{
|
||||||
if(!$module_srl) return new Object(-1, 'fail_to_move');
|
if(!$module_srl) return new Object(-1, 'fail_to_move');
|
||||||
|
|
||||||
$output = $oDocumentAdminController->copyDocumentModule($document_srl_list, $module_srl, $category_srl);
|
$output = $oDocumentAdminController->copyDocumentModule($document_srl_list, $module_srl, $category_srl);
|
||||||
if(!$output->toBool()) return new Object(-1, 'fail_to_move');
|
if(!$output->toBool()) return new Object(-1, 'fail_to_move');
|
||||||
|
|
||||||
$msg_code = 'success_copy';
|
$msg_code = 'success_copied';
|
||||||
|
|
||||||
}
|
}
|
||||||
elseif($type =='delete') {
|
elseif($type =='delete') {
|
||||||
$oDB = &DB::getInstance();
|
$oDB = &DB::getInstance();
|
||||||
|
|
@ -2130,5 +2148,20 @@ class documentController extends document {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function triggerCopyModule(&$obj)
|
||||||
|
{
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$documentConfig = $oModuleModel->getModulePartConfig('document', $obj->originModuleSrl);
|
||||||
|
|
||||||
|
$oModuleController = &getController('module');
|
||||||
|
if(is_array($obj->moduleSrlList))
|
||||||
|
{
|
||||||
|
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||||
|
{
|
||||||
|
$oModuleController->insertModulePartConfig('document', $moduleSrl, $documentConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -454,42 +454,52 @@
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdate($format = 'Y.m.d H:i:s') {
|
function getRegdate($format = 'Y.m.d H:i:s') {
|
||||||
return zdate($this->get('regdate'), $format);
|
return zdate($this->get('regdate'), $format);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdateTime() {
|
function getRegdateTime() {
|
||||||
$regdate = $this->get('regdate');
|
$regdate = $this->get('regdate');
|
||||||
$year = substr($regdate,0,4);
|
$year = substr($regdate,0,4);
|
||||||
$month = substr($regdate,4,2);
|
$month = substr($regdate,4,2);
|
||||||
$day = substr($regdate,6,2);
|
$day = substr($regdate,6,2);
|
||||||
$hour = substr($regdate,8,2);
|
$hour = substr($regdate,8,2);
|
||||||
$min = substr($regdate,10,2);
|
$min = substr($regdate,10,2);
|
||||||
$sec = substr($regdate,12,2);
|
$sec = substr($regdate,12,2);
|
||||||
return mktime($hour,$min,$sec,$month,$day,$year);
|
return mktime($hour,$min,$sec,$month,$day,$year);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRegdateGM() {
|
function getRegdateGM() {
|
||||||
return $this->getRegdate('D, d M Y H:i:s').' '.$GLOBALS['_time_zone'];
|
return $this->getRegdate('D, d M Y H:i:s').' '.$GLOBALS['_time_zone'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUpdate($format = 'Y.m.d H:i:s') {
|
function getRegdateDT()
|
||||||
return zdate($this->get('last_update'), $format);
|
{
|
||||||
}
|
return $this->getRegdate('Y-m-d').'T'.$this->getRegdate('H:i:s').substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3,2);
|
||||||
|
}
|
||||||
|
|
||||||
function getUpdateTime() {
|
function getUpdate($format = 'Y.m.d H:i:s') {
|
||||||
$year = substr($this->get('last_update'),0,4);
|
return zdate($this->get('last_update'), $format);
|
||||||
$month = substr($this->get('last_update'),4,2);
|
}
|
||||||
$day = substr($this->get('last_update'),6,2);
|
|
||||||
$hour = substr($this->get('last_update'),8,2);
|
|
||||||
$min = substr($this->get('last_update'),10,2);
|
|
||||||
$sec = substr($this->get('last_update'),12,2);
|
|
||||||
return mktime($hour,$min,$sec,$month,$day,$year);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getUpdateGM() {
|
function getUpdateTime() {
|
||||||
return gmdate("D, d M Y H:i:s", $this->getUpdateTime());
|
$year = substr($this->get('last_update'),0,4);
|
||||||
}
|
$month = substr($this->get('last_update'),4,2);
|
||||||
|
$day = substr($this->get('last_update'),6,2);
|
||||||
|
$hour = substr($this->get('last_update'),8,2);
|
||||||
|
$min = substr($this->get('last_update'),10,2);
|
||||||
|
$sec = substr($this->get('last_update'),12,2);
|
||||||
|
return mktime($hour,$min,$sec,$month,$day,$year);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUpdateGM() {
|
||||||
|
return gmdate("D, d M Y H:i:s", $this->getUpdateTime());
|
||||||
|
}
|
||||||
|
|
||||||
|
function getUpdateDT()
|
||||||
|
{
|
||||||
|
return $this->getUpdate('Y-m-d').'T'.$this->getUpdate('H:i:s').substr($GLOBALS['_time_zone'],0,3).':'.substr($GLOBALS['_time_zone'],3,2);
|
||||||
|
}
|
||||||
|
|
||||||
function getPermanentUrl() {
|
function getPermanentUrl() {
|
||||||
return getFullUrl('','document_srl',$this->get('document_srl'));
|
return getFullUrl('','document_srl',$this->get('document_srl'));
|
||||||
|
|
@ -499,7 +509,7 @@
|
||||||
if(!$this->document_srl) return;
|
if(!$this->document_srl) return;
|
||||||
// Generate a key to prevent spams
|
// Generate a key to prevent spams
|
||||||
$oTrackbackModel = &getModel('trackback');
|
$oTrackbackModel = &getModel('trackback');
|
||||||
return $oTrackbackModel->getTrackbackUrl($this->document_srl);
|
return $oTrackbackModel->getTrackbackUrl($this->document_srl, $this->getDocumentMid());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -665,7 +675,7 @@
|
||||||
// Find an iamge file among attached files if exists
|
// Find an iamge file among attached files if exists
|
||||||
if($this->get('uploaded_count')) {
|
if($this->get('uploaded_count')) {
|
||||||
$oFileModel = &getModel('file');
|
$oFileModel = &getModel('file');
|
||||||
$file_list = $oFileModel->getFiles($this->document_srl);
|
$file_list = $oFileModel->getFiles($this->document_srl, array(), 'file_srl', true);
|
||||||
if(count($file_list)) {
|
if(count($file_list)) {
|
||||||
foreach($file_list as $file) {
|
foreach($file_list as $file) {
|
||||||
if($file->direct_download!='Y') continue;
|
if($file->direct_download!='Y') continue;
|
||||||
|
|
@ -809,7 +819,7 @@
|
||||||
if(!$this->uploadedFiles[$sortIndex])
|
if(!$this->uploadedFiles[$sortIndex])
|
||||||
{
|
{
|
||||||
$oFileModel = &getModel('file');
|
$oFileModel = &getModel('file');
|
||||||
$this->uploadedFiles[$sortIndex] = $oFileModel->getFiles($this->document_srl, array(), $sortIndex);
|
$this->uploadedFiles[$sortIndex] = $oFileModel->getFiles($this->document_srl, array(), $sortIndex, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->uploadedFiles[$sortIndex];
|
return $this->uploadedFiles[$sortIndex];
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,19 @@ var slideShow = xe.createPlugin('slideShow', {
|
||||||
|
|
||||||
API_SHOW_SLIDE : function(sender, params) {
|
API_SHOW_SLIDE : function(sender, params) {
|
||||||
var self=this, srl = params[0], key = '@'+srl, imgs, $zone, $thumb, $holder, i, c;
|
var self=this, srl = params[0], key = '@'+srl, imgs, $zone, $thumb, $holder, i, c;
|
||||||
|
var p = params;
|
||||||
imgs = this.cast('GET_IMAGES', [srl]);
|
imgs = this.cast('GET_IMAGES', [srl]);
|
||||||
if(!imgs.length) return;
|
if(!imgs.length) return;
|
||||||
|
|
||||||
|
for(var i=0, nLen=imgs.length; i<nLen; i++){
|
||||||
|
if(!imgs[i].loaded){
|
||||||
|
setTimeout(function(){
|
||||||
|
self.cast('SHOW_SLIDE', params);
|
||||||
|
}, 200);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$zone = $('#zone_slide_gallery_'+srl);
|
$zone = $('#zone_slide_gallery_'+srl);
|
||||||
$holder = $zone.find('.slide_gallery_placeholder').css('overflow', 'hidden');
|
$holder = $zone.find('.slide_gallery_placeholder').css('overflow', 'hidden');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
* @brief Slideshow type image gallery plugin
|
* @brief Slideshow type image gallery plugin
|
||||||
* @author NHN (developers@xpressengine.com)
|
* @author NHN (developers@xpressengine.com)
|
||||||
**/
|
**/
|
||||||
(function(k){var m=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={};this._thumbs={};this._current={}},API_SHOW_SLIDE:function(g,f){var b=this,a=f[0],c="@"+a,d,e,j,i,h,l;d=this.cast("GET_IMAGES",[a]);if(d.length){e=k("#zone_slide_gallery_"+a);i=e.find(".slide_gallery_placeholder").css("overflow","hidden");e.find(".slide_gallery_loading_text").remove();j=e.find(".slide_gallery_thumbnail_image_box").show();h=0;for(l=d.length;h<l;h++)d[h].$obj.clone().css({cursor:"pointer",
|
(function(k){var m=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={};this._thumbs={};this._current={}},API_SHOW_SLIDE:function(h,f){var b=this,a=f[0],d="@"+a,c,e,j,i,g,l;c=this.cast("GET_IMAGES",[a]);if(c.length){g=0;for(e=c.length;g<e;g++)if(!c[g].loaded){setTimeout(function(){b.cast("SHOW_SLIDE",f)},200);return}e=k("#zone_slide_gallery_"+a);i=e.find(".slide_gallery_placeholder").css("overflow","hidden");e.find(".slide_gallery_loading_text").remove();
|
||||||
width:"60px",height:"60px",margin:"5px",opacity:0.5}).click({idx:h},function(c){b.cast("SET_SLIDE",[a,c.data.idx])}).appendTo(j);k("#zone_gallery_navigator_status_"+a).click(function(){j.toggle()});e.find(".__prev").click(function(){b.cast("PREV_SLIDE",[a]);return!1}).end().find(".__next").click(function(){b.cast("NEXT_SLIDE",[a]);return!1});this._holders[c]=i;this._thumbs[c]=j;this._current[c]=0;this.cast("SET_SLIDE",[a,0])}},_showSideSlide:function(g,f){var b,a;b=this.cast("GET_IMAGES",[g]);b.length&&
|
j=e.find(".slide_gallery_thumbnail_image_box").show();g=0;for(l=c.length;g<l;g++)c[g].$obj.clone().css({cursor:"pointer",width:"60px",height:"60px",margin:"5px",opacity:0.5}).click({idx:g},function(c){b.cast("SET_SLIDE",[a,c.data.idx])}).appendTo(j);k("#zone_gallery_navigator_status_"+a).click(function(){j.toggle()});e.find(".__prev").click(function(){b.cast("PREV_SLIDE",[a]);return!1}).end().find(".__next").click(function(){b.cast("NEXT_SLIDE",[a]);return!1});this._holders[d]=i;this._thumbs[d]=j;
|
||||||
(a=this._current["@"+g],a+=f,0>a?a=b.length-1:a>=b.length&&(a=0),this.cast("SET_SLIDE",[g,a]))},API_NEXT_SLIDE:function(g,f){this._showSideSlide(f[0],1)},API_PREV_SLIDE:function(g,f){this._showSideSlide(f[0],-1)},API_SET_SLIDE:function(g,f){var b=f[0],a=f[1],c,d,e;c=this.cast("GET_IMAGES",[b]);if(c.length&&is_def(d=c[a]))this._current["@"+b]=a,k("#zone_gallery_navigator_status_"+b).text(a+1+"/"+c.length),this._thumbs["@"+b].find("img").eq(a).animate({opacity:1}).end().not(":eq("+a+")").animate({opacity:0.5}),
|
this._current[d]=0;this.cast("SET_SLIDE",[a,0])}},_showSideSlide:function(h,f){var b,a;b=this.cast("GET_IMAGES",[h]);b.length&&(a=this._current["@"+h],a+=f,0>a?a=b.length-1:a>=b.length&&(a=0),this.cast("SET_SLIDE",[h,a]))},API_NEXT_SLIDE:function(h,f){this._showSideSlide(f[0],1)},API_PREV_SLIDE:function(h,f){this._showSideSlide(f[0],-1)},API_SET_SLIDE:function(h,f){var b=f[0],a=f[1],d,c,e;d=this.cast("GET_IMAGES",[b]);if(d.length&&is_def(c=d[a]))this._current["@"+b]=a,k("#zone_gallery_navigator_status_"+
|
||||||
b=this._holders["@"+b],c=b.parent().innerWidth(),a=d.$obj.prop("width"),e=d.$obj.prop("height"),0==a&&(a=d.$obj.attr("width")),0==e&&(e=d.$obj.attr("height")),a>c-20&&(c-=20,e=Math.floor(e*(c/a)),a=c,d.$obj.css("cursor","pointer"),d.$obj.attr("rel","xe_gallery")),d.$obj.css({width:a,height:e,margin:"0 10px"}),b.empty().append(d.$obj)}}),i=xe.getApp("Gallery")[0];i&&i.registerPlugin(new m)})(jQuery);
|
b).text(a+1+"/"+d.length),this._thumbs["@"+b].find("img").eq(a).animate({opacity:1}).end().not(":eq("+a+")").animate({opacity:0.5}),b=this._holders["@"+b],d=b.parent().innerWidth(),a=c.$obj.prop("width"),e=c.$obj.prop("height"),0==a&&(a=c.$obj.attr("width")),0==e&&(e=c.$obj.attr("height")),a>d-20&&(d-=20,e=Math.floor(e*(d/a)),a=d,c.$obj.css("cursor","pointer"),c.$obj.attr("rel","xe_gallery")),c.$obj.css({width:a,height:e,margin:"0 10px"}),b.empty().append(c.$obj)}}),i=xe.getApp("Gallery")[0];i&&i.registerPlugin(new m)})(jQuery);
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,9 @@
|
||||||
// 2009. 06. 19 Remove unused trigger
|
// 2009. 06. 19 Remove unused trigger
|
||||||
if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
|
if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before')) return true;
|
||||||
|
|
||||||
|
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||||
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,6 +96,12 @@
|
||||||
if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
|
if($oModuleModel->getTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before'))
|
||||||
$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
|
$oModuleController->deleteTrigger('file.getIsPermitted', 'editor', 'controller', 'triggerSrlSetting', 'before');
|
||||||
|
|
||||||
|
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||||
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after'))
|
||||||
|
{
|
||||||
|
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'editor', 'controller', 'triggerCopyModule', 'after');
|
||||||
|
}
|
||||||
|
|
||||||
return new Object(0, 'success_updated');
|
return new Object(0, 'success_updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -426,5 +426,20 @@
|
||||||
FileHandler::removeFile($oEditorModel->getCacheFile(true, $site_srl));
|
FileHandler::removeFile($oEditorModel->getCacheFile(true, $site_srl));
|
||||||
FileHandler::removeFile($oEditorModel->getCacheFile(false, $site_srl));
|
FileHandler::removeFile($oEditorModel->getCacheFile(false, $site_srl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function triggerCopyModule(&$obj)
|
||||||
|
{
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$editorConfig = $oModuleModel->getModulePartConfig('editor', $obj->originModuleSrl);
|
||||||
|
|
||||||
|
$oModuleController = &getController('module');
|
||||||
|
if(is_array($obj->moduleSrlList))
|
||||||
|
{
|
||||||
|
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||||
|
{
|
||||||
|
$oModuleController->insertModulePartConfig('editor', $moduleSrl, $editorConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
.xpress-editor .tool:after{content:"";display:block;clear:both}
|
.xpress-editor .tool:after{content:"";display:block;clear:both}
|
||||||
.xpress-editor .tool ul{position:relative;overflow:visible;float:left;margin:0 5px 2px 0 !important;z-index:2;border:0 !important}
|
.xpress-editor .tool ul{position:relative;overflow:visible;float:left;margin:0 5px 2px 0 !important;z-index:2;border:0 !important}
|
||||||
.xpress-editor .tool ul.action{width:43px}
|
.xpress-editor .tool ul.action{width:43px}
|
||||||
.xpress-editor .tool ul.type{width:auto;white-space:nowrap}
|
.xpress-editor .tool ul.type{width:auto;white-space:nowrap;height:21px}
|
||||||
.xpress-editor .tool ul.style{width:169px;z-index:6}
|
.xpress-editor .tool ul.style{width:169px;z-index:6}
|
||||||
.xpress-editor .tool ul.paragraph{width:169px;z-index:5}
|
.xpress-editor .tool ul.paragraph{width:169px;z-index:5}
|
||||||
.xpress-editor .tool ul.extra1{width:69px;z-index:4}
|
.xpress-editor .tool ul.extra1{width:69px;z-index:4}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -88,6 +88,11 @@ function start(cfg) {
|
||||||
uploaderStatusID : cfg.uploaderStatusID
|
uploaderStatusID : cfg.uploaderStatusID
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(typeof(enforce_ssl)!=="undefined" && enforce_ssl)
|
||||||
|
{
|
||||||
|
settings.upload_url = request_uri+'index.php';
|
||||||
|
};
|
||||||
|
|
||||||
// preview
|
// preview
|
||||||
$('#'+cfg.fileListAreaID).click(previewFiles);
|
$('#'+cfg.fileListAreaID).click(previewFiles);
|
||||||
|
|
||||||
|
|
@ -137,7 +142,7 @@ function _true(){ return true };
|
||||||
|
|
||||||
defaultHandlers = {
|
defaultHandlers = {
|
||||||
onFileQueued : _true,
|
onFileQueued : _true,
|
||||||
onFileQueueError : function(flie, errorCode, message) {
|
onFileQueueError : function(file, errorCode, message) {
|
||||||
try {
|
try {
|
||||||
switch(errorCode) {
|
switch(errorCode) {
|
||||||
case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED :
|
case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED :
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,9 @@
|
||||||
// A column to determine a target type
|
// A column to determine a target type
|
||||||
if(!$oDB->isColumnExists('files', 'upload_target_type')) return true;
|
if(!$oDB->isColumnExists('files', 'upload_target_type')) return true;
|
||||||
|
|
||||||
|
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||||
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'file', 'controller', 'triggerCopyModule', 'after')) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,6 +127,12 @@
|
||||||
// A column to determine a target type
|
// A column to determine a target type
|
||||||
if(!$oDB->isColumnExists('files', 'upload_target_type')) $oDB->addColumn('files', 'upload_target_type', 'char', '3');
|
if(!$oDB->isColumnExists('files', 'upload_target_type')) $oDB->addColumn('files', 'upload_target_type', 'char', '3');
|
||||||
|
|
||||||
|
// 2012. 08. 29 Add a trigger to copy additional setting when the module is copied
|
||||||
|
if(!$oModuleModel->getTrigger('module.procModuleAdminCopyModule', 'file', 'controller', 'triggerCopyModule', 'after'))
|
||||||
|
{
|
||||||
|
$oModuleController->insertTrigger('module.procModuleAdminCopyModule', 'file', 'controller', 'triggerCopyModule', 'after');
|
||||||
|
}
|
||||||
|
|
||||||
return new Object(0, 'success_updated');
|
return new Object(0, 'success_updated');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -777,5 +777,20 @@
|
||||||
function printUploadedFileList($editor_sequence, $upload_target_srl) {
|
function printUploadedFileList($editor_sequence, $upload_target_srl) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function triggerCopyModule(&$obj)
|
||||||
|
{
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$fileConfig = $oModuleModel->getModulePartConfig('file', $obj->originModuleSrl);
|
||||||
|
|
||||||
|
$oModuleController = &getController('module');
|
||||||
|
if(is_array($obj->moduleSrlList))
|
||||||
|
{
|
||||||
|
foreach($obj->moduleSrlList AS $key=>$moduleSrl)
|
||||||
|
{
|
||||||
|
$oModuleController->insertModulePartConfig('file', $moduleSrl, $fileConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -177,9 +177,10 @@
|
||||||
* @param string $sortIndex The column that used as sort index
|
* @param string $sortIndex The column that used as sort index
|
||||||
* @return array Returns array of object that contains file information. If no result returns null.
|
* @return array Returns array of object that contains file information. If no result returns null.
|
||||||
**/
|
**/
|
||||||
function getFiles($upload_target_srl, $columnList = array(), $sortIndex = 'file_srl') {
|
function getFiles($upload_target_srl, $columnList = array(), $sortIndex = 'file_srl', $ckValid = false) {
|
||||||
$args->upload_target_srl = $upload_target_srl;
|
$args->upload_target_srl = $upload_target_srl;
|
||||||
$args->sort_index = $sortIndex;
|
$args->sort_index = $sortIndex;
|
||||||
|
if($ckValid) $args->isvalid = 'Y';
|
||||||
$output = executeQuery('file.getFiles', $args, $columnList);
|
$output = executeQuery('file.getFiles', $args, $columnList);
|
||||||
if(!$output->data) return;
|
if(!$output->data) return;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@
|
||||||
<value xml:lang="ko"><![CDATA[허용 확장자]]></value>
|
<value xml:lang="ko"><![CDATA[허용 확장자]]></value>
|
||||||
<value xml:lang="en"><![CDATA[Allowed extentsions]]></value>
|
<value xml:lang="en"><![CDATA[Allowed extentsions]]></value>
|
||||||
<value xml:lang="jp"><![CDATA[ここで指定された種類のファイルのみ添付できます。]]></value>
|
<value xml:lang="jp"><![CDATA[ここで指定された種類のファイルのみ添付できます。]]></value>
|
||||||
<value xml:lang="zh-CN"><![CDATA[只允许上传指定的扩展名。></value>
|
<value xml:lang="zh-CN"><![CDATA[只允许上传指定的扩展名。]]></value>
|
||||||
<value xml:lang="zh-TW"><![CDATA[設定允許上傳的檔案類型。]]></value>
|
<value xml:lang="zh-TW"><![CDATA[設定允許上傳的檔案類型。]]></value>
|
||||||
<value xml:lang="fr"><![CDATA[Extensions consentis seulement peuvent etre attaches.]]></value>
|
<value xml:lang="fr"><![CDATA[Extensions consentis seulement peuvent etre attaches.]]></value>
|
||||||
<value xml:lang="ru"><![CDATA[Только файлы с разрешенными расширениями могут быть вложены.]]></value>
|
<value xml:lang="ru"><![CDATA[Только файлы с разрешенными расширениями могут быть вложены.]]></value>
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
</tables>
|
</tables>
|
||||||
<conditions>
|
<conditions>
|
||||||
<condition operation="equal" column="upload_target_srl" var="upload_target_srl" filter="number" notnull="notnull" />
|
<condition operation="equal" column="upload_target_srl" var="upload_target_srl" filter="number" notnull="notnull" />
|
||||||
|
<condition operation="equal" column="isvalid" var="isvalid" pipe="and" />
|
||||||
</conditions>
|
</conditions>
|
||||||
<navigation>
|
<navigation>
|
||||||
<index var="sort_index" defualt="source_filename" order="asc" />
|
<index var="sort_index" defualt="source_filename" order="asc" />
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@
|
||||||
$buff = '<?php if(!defined("__ZBXE__")) exit();'."\n";
|
$buff = '<?php if(!defined("__ZBXE__")) exit();'."\n";
|
||||||
foreach($ftp_info as $key => $val) {
|
foreach($ftp_info as $key => $val) {
|
||||||
if(!$val) continue;
|
if(!$val) continue;
|
||||||
if(preg_match('/(<\?|<\?php|\?>)/xsm', preg_replace('/\s/', '', $val)))
|
if(preg_match('/(<\?|<\?php|\?>|fputs|fopen|fwrite|fgets|fread|\/\*|\*\/|chr\()/xsm', preg_replace('/\s/', '', $val)))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>ウェブサイトを始める前にこのページを削除してください。<br />以下のリストの格項目をチェックして設置状態を確認することができます。<br />管理ページから全てのコンポネントを確認することができます。</p>
|
<p>ウェブサイトを始める前にこのページを削除してください。<br />以下のリストの格項目をチェックして設置状態を確認することができます。<br />管理ページから全てのコンポネントを確認することができます。</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
画面の構成から <strong>header</strong>, <strong>body</strong>, <strong>footer</strong>が見えたら、<strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">レイアウト</a></strong>は正常に設置されたことです。
|
画面の構成から <strong>header</strong>, <strong>body</strong>, <strong>footer</strong>が見えたら、<strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">レイアウト</a></strong>は正常に設置されたことです。
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>画面上端と左に位置する二つのメニュー</strong>が見えたら、<strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">メニューモジュール</a></strong>は正常に設置されたことです
|
<strong>画面上端と左に位置する二つのメニュー</strong>が見えたら、<strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">メニューモジュール</a></strong>は正常に設置されたことです
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>XE core설치가 성공적으로 완료되었습니다.<br />이 페이지는 데모 페이지 이므로 추후 사이트 운영시 삭제 가능합니다.<br />모든 설치요소는 관리자로 로그인하셔야 확인할 수 있습니다.</p>
|
<p>XE core설치가 성공적으로 완료되었습니다.<br />이 페이지는 데모 페이지 이므로 추후 사이트 운영시 삭제 가능합니다.<br />모든 설치요소는 관리자로 로그인하셔야 확인할 수 있습니다.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
<strong>헤더</strong>, <strong>본문</strong>, <strong>풋터</strong>로 구성된 화면이 보인다면 <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">레이아웃</a></strong>이 정상적으로 설치된 것입니다.
|
<strong>헤더</strong>, <strong>본문</strong>, <strong>풋터</strong>로 구성된 화면이 보인다면 <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">레이아웃</a></strong>이 정상적으로 설치된 것입니다.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>글로벌 네비게이션</strong>과 <strong>로컬 네비게이션</strong>이 보인다면 <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">메뉴 모듈</a></strong>이 설치된 것입니다.
|
<strong>글로벌 네비게이션</strong>과 <strong>로컬 네비게이션</strong>이 보인다면 <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">메뉴 모듈</a></strong>이 설치된 것입니다.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
<p>We recommend you to delete this demo page before launching the site.<br />Please check the following list to verify whether the installation has been properly completed.<br />You can see all the components on the administration page.</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
When <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">the layout</a></strong> has been successfully installed, you can see the screen containing a <strong>header</strong>, a <strong>content body</strong>, and a <strong>footer</strong>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
When <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">Menu module</a></strong> has been successfully installed, you can see both <strong>global and local navigations</strong>.
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<p>瞍艘惴孙亍匮笞颀铖,綦嗷撷鸲螽闫埕<EFBFBD>攸。<br />綦塔?欷<><E6ACB7>偻<EFBFBD>煦憷茭飓镝<E9A393>颌涮睇枨圜。<br />师瞍畏租戡<EFBFBD>攸耖首谈岫牦疒遂。</p>
|
<p>瞍艘惴孙亍匮笞颀铖,綦嗷撷鸲螽闫埕<EFBFBD>攸。<br />綦塔?欷<><E6ACB7>偻<EFBFBD>煦憷茭飓镝<E9A393>颌涮睇枨圜。<br />师瞍畏租戡<EFBFBD>攸耖首谈岫牦疒遂。</p>
|
||||||
<ol>
|
<ol>
|
||||||
<li>
|
<li>
|
||||||
幼 <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminContent')}" target="_blank">鼹攸噔酮</a></strong> 飓圜晚颌涮睇懔,师首谈镖肆匮<E88286>钴 <strong><EFBFBD>庀</strong>,<strong>耶榛瘾赭</strong>妯 <strong><EFBFBD>诃</strong>。
|
幼 <strong><a href="{getUrl('', 'module','admin', 'act', 'dispLayoutAdminAllInstanceList')}" target="_blank">鼹攸噔酮</a></strong> 飓圜晚颌涮睇懔,师首谈镖肆匮<E88286>钴 <strong><EFBFBD>庀</strong>,<strong>耶榛瘾赭</strong>妯 <strong><EFBFBD>诃</strong>。
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
幼 <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">嘣婴偌疒</a></strong> 飓圜晚颌涮睇懔,师首谈 <strong>瘾嘣婴<EFBFBD>憝嘣婴</strong>。
|
幼 <strong><a href="{getUrl('', 'module', 'admin', 'act', 'dispMenuAdminContent')}" target="_blank">嘣婴偌疒</a></strong> 飓圜晚颌涮睇懔,师首谈 <strong>瘾嘣婴<EFBFBD>憝嘣婴</strong>。
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,6 @@
|
||||||
<!--%import("white.css")-->
|
<!--%import("white.css")-->
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
|
|
||||||
<!--%import("is.js")-->
|
|
||||||
|
|
||||||
<div id="spot">
|
<div id="spot">
|
||||||
<form action="{getUrl()}" method="post" class="search" id="fo_is" no-error-return-url="true" >
|
<form action="{getUrl()}" method="post" class="search" id="fo_is" no-error-return-url="true" >
|
||||||
<input type="hidden" name="mid" value="{$mid}" />
|
<input type="hidden" name="mid" value="{$mid}" />
|
||||||
|
|
|
||||||
|
|
@ -272,9 +272,6 @@
|
||||||
return new Object(-1, 'msg_invalid_request');
|
return new Object(-1, 'msg_invalid_request');
|
||||||
}
|
}
|
||||||
|
|
||||||
$code = preg_replace('/<\?.*(\?>)?/Usm', '', $code);
|
|
||||||
$code = preg_replace('/<script[\s]*language[\s]*=("|\')php("|\')[\s]*>.*<\/script>/Usm', '', $code);
|
|
||||||
|
|
||||||
$oLayoutModel = &getModel('layout');
|
$oLayoutModel = &getModel('layout');
|
||||||
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl);
|
$layout_file = $oLayoutModel->getUserLayoutHtml($layout_srl);
|
||||||
FileHandler::writeFile($layout_file, $code);
|
FileHandler::writeFile($layout_file, $code);
|
||||||
|
|
@ -630,7 +627,8 @@
|
||||||
$oLayoutModel = &getModel('layout');
|
$oLayoutModel = &getModel('layout');
|
||||||
$layout = $oLayoutModel->getLayout($sourceArgs->layout_srl);
|
$layout = $oLayoutModel->getLayout($sourceArgs->layout_srl);
|
||||||
|
|
||||||
$args->extra_vars = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars'));
|
$output = $oLayoutModel->getLayoutRawData($sourceArgs->layout_srl, array('extra_vars'));
|
||||||
|
$args->extra_vars = $output->extra_vars;
|
||||||
$extra_vars = unserialize($args->extra_vars);
|
$extra_vars = unserialize($args->extra_vars);
|
||||||
|
|
||||||
$oModuleController = &getController('module');
|
$oModuleController = &getController('module');
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue