mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
#17044128 컨텐츠 위젯을 게시글로 저장하도록 하여 용량 제한 없게 하고 검색에서 노출될 수 있또록 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5116 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
471aba08e2
commit
83e02e05c4
11 changed files with 385 additions and 75 deletions
|
|
@ -121,6 +121,7 @@
|
|||
$widget_padding_bottom = $args->widget_padding_bottom;
|
||||
$inner_style = sprintf("padding:%dpx %dpx %dpx %dpx !important; padding:none !important;", $widget_padding_top, $widget_padding_right, $widget_padding_bottom, $widget_padding_left);
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
/**
|
||||
* 위젯 출력물을 구함
|
||||
**/
|
||||
|
|
@ -129,7 +130,12 @@
|
|||
switch($widget) {
|
||||
// 내용 직접 추가일 경우
|
||||
case 'widgetContent' :
|
||||
$body = base64_decode($args->body);
|
||||
if($args->document_srl) {
|
||||
$oDocument = $oDocumentModel->getDocument($args->document_srl);
|
||||
$body = $oDocument->getContent(false,false,false);
|
||||
} else {
|
||||
$body = base64_decode($args->body);
|
||||
}
|
||||
$output = sprintf('<div style="overflow:hidden;%s"><div style="%s">%s</div></div>', $style, $inner_style, $body);
|
||||
break;
|
||||
|
||||
|
|
@ -149,15 +155,16 @@
|
|||
switch($widget) {
|
||||
// 내용 직접 추가일 경우
|
||||
case 'widgetContent' :
|
||||
$body = base64_decode($args->body);
|
||||
if($args->document_srl) {
|
||||
$oDocument = $oDocumentModel->getDocument($args->document_srl);
|
||||
$body = $oDocument->getContent(false,false,false);
|
||||
} else {
|
||||
$body = base64_decode($args->body);
|
||||
}
|
||||
$oWidgetController = &getController('widget');
|
||||
|
||||
$output = sprintf(
|
||||
'<div class="widgetOutput" style="%s" widget_padding_left="%s" widget_padding_right="%s" widget_padding_top="%s" widget_padding_bottom="%s" widget="widgetContent">'.
|
||||
'<div class="widgetSetup"></div>'.
|
||||
'<div class="widgetCopy"></div>'.
|
||||
'<div class="widgetSize"></div>'.
|
||||
'<div class="widgetRemove"></div>'.
|
||||
'<div class="widgetOutput" style="%s" widget_padding_left="%s" widget_padding_right="%s" widget_padding_top="%s" widget_padding_bottom="%s" widget="widgetContent" document_srl="%d">'.
|
||||
'<div class="widgetResize"></div>'.
|
||||
'<div class="widgetResizeLeft"></div>'.
|
||||
'<div class="widgetBorder">'.
|
||||
|
|
@ -169,6 +176,7 @@
|
|||
'</div>',
|
||||
$style,
|
||||
$args->widget_padding_left, $args->widget_padding_right, $args->widget_padding_top, $args->widget_padding_bottom,
|
||||
$args->document_srl,
|
||||
$inner_style,
|
||||
$body,
|
||||
base64_encode($body)
|
||||
|
|
@ -179,9 +187,6 @@
|
|||
case 'widgetBox' :
|
||||
$output = sprintf(
|
||||
'<div class="widgetOutput" widget="widgetBox" style="%s;" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s">'.
|
||||
'<div class="widgetBoxCopy"></div>'.
|
||||
'<div class="widgetBoxSize"></div>'.
|
||||
'<div class="widgetBoxRemove"></div>'.
|
||||
'<div class="widgetBoxResize"></div>'.
|
||||
'<div class="widgetBoxResizeLeft"></div>'.
|
||||
'<div class="widgetBoxBorder">'.
|
||||
|
|
@ -203,10 +208,6 @@
|
|||
|
||||
$output = sprintf(
|
||||
'<div class="widgetOutput" style="%s" widget_padding_top="%s" widget_padding_right="%s" widget_padding_bottom="%s" widget_padding_left="%s" widget="%s" %s >'.
|
||||
'<div class="widgetSetup"></div>'.
|
||||
'<div class="widgetCopy"></div>'.
|
||||
'<div class="widgetSize"></div>'.
|
||||
'<div class="widgetRemove"></div>'.
|
||||
'<div class="widgetResize"></div>'.
|
||||
'<div class="widgetResizeLeft"></div>'.
|
||||
'<div class="widgetBorder">'.
|
||||
|
|
|
|||
|
|
@ -338,10 +338,14 @@
|
|||
$oDocumentController->updateTrackbackCount($obj->document_srl, $success_count);
|
||||
}
|
||||
}
|
||||
|
||||
$copied_srls[$document_srl] = $obj->document_srl;
|
||||
}
|
||||
|
||||
$oDB->commit();
|
||||
return new Object();
|
||||
|
||||
$output = new Object();
|
||||
$output->add('copied_srls', $copied_srls);
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
@charset "utf-8";
|
||||
h3 { margin:0 10px 0 10px; }
|
||||
.widget_list { margin:10px; }
|
||||
.widget_list a { margin-bottom:10px; }
|
||||
.editor_box { margin:0 10px 10px 10px; }
|
||||
.button_box { float:right; overflow:hidden; }
|
||||
|
||||
.adminLayer { margin-top:30px; }
|
||||
|
||||
.buttonBox { border:2px solid #EEEEEE; padding:5px; overflow:hidden; *zoom:1;}
|
||||
.buttonBox .fr { height:28px; }
|
||||
.buttonBox .fl { height:28px; }
|
||||
.buttonBox .buttonDiv { margin:2px 0; padding:0; border-top:1px solid #EEEEEE; clear:both; }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<filter name="insert_page_content" module="page" act="procPageAdminInsertContent" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="module_srl" required="true" />
|
||||
<node target="content" required="true" />
|
||||
</form>
|
||||
<parameter>
|
||||
<param name="module_srl" target="module_srl" />
|
||||
|
|
|
|||
|
|
@ -15,25 +15,41 @@
|
|||
<input type="hidden" name="module_srl" value="{$module_info->module_srl}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($content)}" />
|
||||
|
||||
<div class="tCenter">
|
||||
<select name="widget_list">
|
||||
<!--@foreach($widget_list as $widget)-->
|
||||
<option value="{$widget->widget}">{$widget->title}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<span class="button"><input type="button" value="{$lang->cmd_insert}" onclick="doAddWidget(this.form); return false;"/></span>
|
||||
<span class="button"><input type="button" value="{$lang->cmd_content_insert}" onclick="doAddContent('{$module_info->mid}'); return false;" /></span>
|
||||
<span class="button"><input type="button" value="{$lang->cmd_box_widget_insert}" onclick="doAddWidgetBox(); return false;" /></span>
|
||||
</div>
|
||||
<div class="buttonBox">
|
||||
|
||||
<div class="tRight">
|
||||
<span class="button"><input type="button" value="{$lang->cmd_remove_all_widgets}" onclick="removeAllWidget();return false;"/></span>
|
||||
<span class="button"><input type="button" value="{$lang->cmd_back}" onclick="location.href=current_url.setQuery('mid','{$module_info->mid}').setQuery('act','');return false;"/></span>
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_save}"/></span>
|
||||
<div class="fl">
|
||||
<span class="button black "><input type="button" value="{$lang->cmd_box_widget_insert}" onclick="doAddWidgetBox(); return false;" /></span>
|
||||
</div>
|
||||
<div class="fr">
|
||||
<select name="widget_list">
|
||||
<!--@foreach($widget_list as $widget)-->
|
||||
<option value="{$widget->widget}">{$widget->title}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<span class="button blue"><input type="button" value="{$lang->cmd_insert}" onclick="doAddWidget(this.form); return false;"/></span>
|
||||
<span class="button green"><input type="button" value="{$lang->cmd_content_insert}" onclick="doAddContent('{$module_info->mid}'); return false;" /></span>
|
||||
</div>
|
||||
<div class="buttonDiv"></div>
|
||||
<div class="tRight">
|
||||
<span class="button"><input type="button" value="{$lang->cmd_back}" onclick="location.href=current_url.setQuery('mid','{$module_info->mid}').setQuery('act','');return false;"/></span>
|
||||
<span class="button red"><input type="button" value="{$lang->cmd_remove_all_widgets}" onclick="removeAllWidget();return false;"/></span>
|
||||
<span class="button blue"><input type="submit" value="{$lang->cmd_save}"/></span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="widgetButton" class="widgetButtons">
|
||||
<div class="widgetSetup"></div>
|
||||
<div class="widgetCopy"></div>
|
||||
<div class="widgetSize"></div>
|
||||
<div class="widgetRemove"></div>
|
||||
</div>
|
||||
<div id="widgetBoxButton" class="widgetButtons">
|
||||
<div class="widgetBoxSize"></div>
|
||||
<div class="widgetBoxRemove"></div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var confirm_delete_msg = "{$lang->confirm_delete}";
|
||||
xAddEventListener(window,"load",function() { doStartPageModify('zonePageContent', '{$module_info->module_srl}'); });
|
||||
|
|
|
|||
|
|
@ -10,7 +10,11 @@
|
|||
|
||||
<action name="procWidgetGenerateCode" type="controller" standalone="true" />
|
||||
<action name="procWidgetAddContent" type="controller" standalone="true" />
|
||||
<action name="procWidgetInsertDocument" type="controller" standalone="true" />
|
||||
<action name="procWidgetCopyDocument" type="controller" standalone="true" />
|
||||
<action name="procWidgetDeleteDocument" type="controller" standalone="true" />
|
||||
<action name="procWidgetGenerateCodeInPage" type="controller" standalone="true" />
|
||||
<action name="procWidgetGetColorsetList" type="controller" standalone="true" />
|
||||
<action name="procWidgetRemoveContents" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -2,10 +2,11 @@
|
|||
<!--%import("css/widget.css")-->
|
||||
|
||||
<div class="pageAddContent"></div>
|
||||
<form action="./" method="get" onsubmit="return completeAddContent(this); return false;" id="content_fo">
|
||||
<input type="hidden" name="content" value="" />
|
||||
<form action="./" method="get" onsubmit="return addContentWidget(this); return false;" id="content_fo">
|
||||
<input type="hidden" name="content" value="{$oDocument->getContentText()}" />
|
||||
<input type="hidden" name="mid" value="{$module_info->mid}" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl}" />
|
||||
<input type="hidden" name="style" value="float:left;padding:none;margin:none;width:100%;" />
|
||||
<input type="hidden" name="widget_padding_left" value="" />
|
||||
<input type="hidden" name="widget_padding_right" value="" />
|
||||
|
|
|
|||
|
|
@ -14,21 +14,25 @@
|
|||
.pageAddContent { width:700px; }
|
||||
|
||||
.widgetOutput { float:left; cursor:move; z-index:998; overflow:hidden; position:relative; width:100%; }
|
||||
|
||||
.widgetOutput .widgetBorder { border:1px dotted #17DA29; z-index:999; }
|
||||
.widgetOutput .widgetSetup { background:transparent url("../images/widget_setup.gif") no-repeat 1px 1px; width:14px; height:14px; position:absolute; top:1px; right:58px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetCopy { background:transparent url("../images/widget_copy.gif") no-repeat 1px 1px; width:14px; height:14px; position:absolute; top:1px; right:44px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetSize { background:transparent url("../images/widget_size.gif") no-repeat 1px 1px; width:14px; height:14px; position:absolute; top:1px; right:30px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetRemove { background:transparent url("../images/widget_remove.gif") no-repeat 1px 1px; width:14px; height:14px; position:absolute; top:1px; right:15px; cursor:pointer; z-index:1000;}
|
||||
|
||||
.widgetOutput .widgetResize { background:transparent url("../images/btn_resize.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:1px; right:1px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetResizeLeft { background:transparent url("../images/btn_resize_left.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:0; left:1px; cursor:pointer; z-index:1000;}
|
||||
|
||||
.widgetOutput .widgetBoxBorder { border:1px dotted #267BEE; z-index:999; }
|
||||
.widgetOutput .widgetBoxCopy { background:transparent url("../images/widget_copy.gif") no-repeat 1px 1px; width:14px; height:14px; position:absolute; top:1px; left:1px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetBoxSize { background:transparent url("../images/widget_size.gif") no-repeat 1px 1px; width:14px; height:14px; position:absolute; top:1px; left:15px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetBoxRemove { background:transparent url("../images/widget_remove.gif") no-repeat 1px 1px; width:14px; height:14px; position:absolute; top:1px; left:30px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetBoxResize { background:transparent url("../images/btn_resize.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:1px; right:1px; cursor:pointer; z-index:1000;}
|
||||
.widgetOutput .widgetBoxResizeLeft { background:transparent url("../images/btn_resize_left.gif") no-repeat left bottom; width:12px; height:12px; position:absolute; bottom:0; left:1px; cursor:pointer; z-index:1000;}
|
||||
|
||||
.widgetButtons { z-index:9999; border:1px solid #555555; background-color:#FFFFFF; overflow:hidden; *zoom:1; float:left; padding:3px; position:absolute; left:0; top:0; visibility:hidden;}
|
||||
.widgetButtons div { float:left; }
|
||||
.widgetButtons .widgetSetup { background:transparent url("../images/widget_setup.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;}
|
||||
.widgetButtons .widgetCopy { background:transparent url("../images/widget_copy.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;}
|
||||
.widgetButtons .widgetSize { background:transparent url("../images/widget_size.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;}
|
||||
.widgetButtons .widgetRemove { background:transparent url("../images/widget_remove.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;}
|
||||
.widgetButtons .widgetBoxBorder { border:1px dotted #267BEE; z-index:999; }
|
||||
.widgetButtons .widgetBoxCopy { background:transparent url("../images/widget_copy.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;}
|
||||
.widgetButtons .widgetBoxSize { background:transparent url("../images/widget_size.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;}
|
||||
.widgetButtons .widgetBoxRemove { background:transparent url("../images/widget_remove.gif") no-repeat 1px 1px; width:14px; height:14px; cursor:pointer; z-index:1000;}
|
||||
|
||||
#pageSizeLayer { width:500px; overflow:hidden; border:1px solid #888888; background:#FFFFFF; z-index:2000; position:absolute; }
|
||||
#pageSizeLayer table { border:0; width:100%; table-layout:fixed; }
|
||||
#pageSizeLayer table th { padding:4px 0 4px 0; background-color:#DEDEDE; text-align:center; color:#888888;}
|
||||
|
|
@ -44,3 +48,5 @@
|
|||
#pageSizeLayer .submit { width:90%; border:1px solid #DEDEDE; background-color:#FFFFFF;}
|
||||
|
||||
div.editor { width:700px; }
|
||||
|
||||
.help { padding:5px 0; background-color:#EFEFEF; border-top:1px solid #CCCCCC; }
|
||||
|
|
|
|||
|
|
@ -80,7 +80,11 @@ function doStartPageModify(zoneID, module_srl) {
|
|||
|
||||
// 내용 모두 삭제
|
||||
function removeAllWidget() {
|
||||
xInnerHtml(zonePageObj, '');
|
||||
if(!confirm(confirm_delete_msg)) return;
|
||||
var response_tags = new Array('error','message');
|
||||
var params = new Array();
|
||||
params['module_srl'] = xGetElementById('pageFo').module_srl.value;
|
||||
exec_xml('widget',"procWidgetRemoveContents",params,function() { xInnerHtml(zonePageObj,'') });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -119,14 +123,14 @@ function getContentWidgetCode(childObj, widget) {
|
|||
var cobj = childObj.firstChild;
|
||||
while(cobj) {
|
||||
if(cobj.nodeName == "DIV" && cobj.className == "widgetContent") {
|
||||
var body = xInnerHtml(cobj);
|
||||
return '<img src="./common/tpl/images/widget_bg.jpg" class="zbxe_widget_output" widget="widgetContent" style="'+getStyle(childObj)+'" body="'+body+'" widget_padding_left="'+getPadding(childObj,'left')+'" widget_padding_right="'+getPadding(childObj, 'right')+'" widget_padding_top="'+getPadding(childObj, 'top')+'" widget_padding_bottom="'+getPadding(childObj,'bottom')+'" />';
|
||||
var document_srl = childObj.getAttribute('document_srl');
|
||||
return '<img src="./common/tpl/images/widget_bg.jpg" class="zbxe_widget_output" widget="widgetContent" style="'+getStyle(childObj)+'" document_srl="'+document_srl+'" widget_padding_left="'+getPadding(childObj,'left')+'" widget_padding_right="'+getPadding(childObj, 'right')+'" widget_padding_top="'+getPadding(childObj, 'top')+'" widget_padding_bottom="'+getPadding(childObj,'bottom')+'" />';
|
||||
}
|
||||
cobj = cobj.nextSibling;
|
||||
}
|
||||
}
|
||||
|
||||
// 위젯 박스 컨텐츠 코드 구함
|
||||
// 위젯 박스 코드 구함
|
||||
function getWidgetBoxCode(childObj, widget) {
|
||||
var cobj = childObj.firstChild;
|
||||
while(cobj) {
|
||||
|
|
@ -184,8 +188,10 @@ function doSyncPageContent() {
|
|||
var obj = sel_obj.firstChild;
|
||||
while(obj && obj.className != "widgetContent") obj = obj.nextSibling;
|
||||
if(obj && obj.className == "widgetContent") {
|
||||
var content = Base64.decode(xInnerHtml(obj));
|
||||
xGetElementById("content_fo").content.value = content;
|
||||
if(!fo_obj.content.value) {
|
||||
var content = Base64.decode(xInnerHtml(obj));
|
||||
xGetElementById("content_fo").content.value = content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -196,24 +202,34 @@ function doSyncPageContent() {
|
|||
}
|
||||
|
||||
// 부모창에 위젯을 추가
|
||||
function completeAddContent(fo_obj) {
|
||||
function addContentWidget(fo_obj) {
|
||||
var editor_sequence = fo_obj.getAttribute('editor_sequence');
|
||||
var mid = fo_obj.mid.value;
|
||||
var module_srl = fo_obj.module_srl.value;
|
||||
var document_srl = fo_obj.document_srl.value;
|
||||
var content = editorGetContent(editor_sequence);
|
||||
|
||||
var response_tags = new Array('error','message','document_srl');
|
||||
var params = new Array();
|
||||
params['editor_sequence'] = editor_sequence;
|
||||
params['content'] = content;
|
||||
params['module_srl'] = module_srl;
|
||||
params['document_srl'] = document_srl;
|
||||
exec_xml('widget',"procWidgetInsertDocument",params,completeAddContent,response_tags,params,fo_obj);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function completeAddContent(ret_obj, response_tags, params, fo_obj) {
|
||||
var document_srl = ret_obj['document_srl'];
|
||||
var tpl = ''+
|
||||
'<div class="widgetOutput" style="'+fo_obj.style.value+'" widget_padding_left="'+fo_obj.widget_padding_left.value+'" widget_padding_right="'+fo_obj.widget_padding_right.value+'" widget_padding_top="'+fo_obj.widget_padding_top.value+'" widget_padding_bottom="'+fo_obj.widget_padding_bottom.value+'" widget="widgetContent">'+
|
||||
'<div class="widgetSetup"></div>'+
|
||||
'<div class="widgetCopy"></div>'+
|
||||
'<div class="widgetSize"></div>'+
|
||||
'<div class="widgetRemove"></div>'+
|
||||
'<div class="widgetOutput" style="'+fo_obj.style.value+'" widget_padding_left="'+fo_obj.widget_padding_left.value+'" widget_padding_right="'+fo_obj.widget_padding_right.value+'" widget_padding_top="'+fo_obj.widget_padding_top.value+'" widget_padding_bottom="'+fo_obj.widget_padding_bottom.value+'" document_srl="'+document_srl+'" widget="widgetContent">'+
|
||||
'<div class="widgetResize"></div>'+
|
||||
'<div class="widgetResizeLeft"></div>'+
|
||||
'<div class="widgetBorder">'+
|
||||
'<div style="padding:'+fo_obj.widget_padding_top.value+'px '+fo_obj.widget_padding_right.value+'px'+fo_obj.widget_padding_bottom.value+'px'+fo_obj.widget_padding_left.value+'px">'+
|
||||
content+
|
||||
'</div><div class="clear"></div>'+
|
||||
'<div style="padding:'+fo_obj.widget_padding_top.value+'px '+fo_obj.widget_padding_right.value+'px'+fo_obj.widget_padding_bottom.value+'px'+fo_obj.widget_padding_left.value+'px"></div><div class="clear"></div>'+
|
||||
'</div>'+
|
||||
'<div class="widgetContent" style="display:none;width:1px;height:1px;overflow:hidden;">'+Base64.encode(content)+'</div>'+
|
||||
'<div class="widgetContent" style="display:none;width:1px;height:1px;overflow:hidden;"></div>'+
|
||||
'</div>';
|
||||
|
||||
opener.doAddWidgetCode(tpl);
|
||||
|
|
@ -224,9 +240,6 @@ function completeAddContent(fo_obj) {
|
|||
function doAddWidgetBox() {
|
||||
var tpl = ''+
|
||||
'<div class="widgetOutput" style="float:left;width:100%;height:12px;" widget="widgetBox" >'+
|
||||
'<div class="widgetBoxCopy"></div>'+
|
||||
'<div class="widgetBoxSize"></div>'+
|
||||
'<div class="widgetBoxRemove"></div>'+
|
||||
'<div class="widgetBoxResize"></div>'+
|
||||
'<div class="widgetBoxResizeLeft"></div>'+
|
||||
'<div class="widgetBoxBorder">'+
|
||||
|
|
@ -318,20 +331,28 @@ function doCheckWidget(e) {
|
|||
}
|
||||
|
||||
doHideWidgetSizeSetup();
|
||||
|
||||
// 위젯 설정
|
||||
if(obj.className == 'widgetSetup') {
|
||||
var p_obj = obj.parentNode;
|
||||
var p_obj = obj.parentNode.parentNode;
|
||||
var widget = p_obj.getAttribute("widget");
|
||||
if(!widget) return;
|
||||
selectedWidget = p_obj;
|
||||
if(widget == 'widgetContent') popopen(request_uri+"?module=widget&act=dispWidgetAdminAddContent&module_srl="+zoneModuleSrl, "addContent");
|
||||
if(widget == 'widgetContent') popopen(request_uri+"?module=widget&act=dispWidgetAdminAddContent&module_srl="+zoneModuleSrl+"&document_srl="+p_obj.getAttribute("document_srl"), "addContent");
|
||||
else popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget,'GenerateCodeInPage');
|
||||
return;
|
||||
|
||||
// 위젯 복사
|
||||
} else if(obj.className == 'widgetCopy' || obj.className == 'widgetBoxCopy') {
|
||||
var p_obj = obj.parentNode;
|
||||
if(p_obj.className == 'widgetOutput') {
|
||||
} else if(obj.className == 'widgetCopy' && obj.parentNode.parentNode.className == 'widgetOutput') {
|
||||
p_obj = obj.parentNode.parentNode;
|
||||
restoreWidgetButtons();
|
||||
|
||||
if(p_obj.getAttribute('widget')=='widgetContent' && p_obj.getAttribute('document_srl') ) {
|
||||
var response_tags = new Array('error','message','document_srl');
|
||||
var params = new Array();
|
||||
params['document_srl'] =p_obj.getAttribute('document_srl');
|
||||
exec_xml('widget','procWidgetCopyDocument', params, completeCopyWidgetContent, response_tags, params, p_obj);
|
||||
return;
|
||||
} else {
|
||||
var dummy = xCreateElement("DIV");
|
||||
xInnerHtml(dummy,xInnerHtml(p_obj));
|
||||
|
||||
|
|
@ -356,17 +377,30 @@ function doCheckWidget(e) {
|
|||
|
||||
// 위젯 사이트/ 여백 조절
|
||||
} else if(obj.className == 'widgetSize' || obj.className == 'widgetBoxSize') {
|
||||
var p_obj = obj.parentNode;
|
||||
var p_obj = obj.parentNode.parentNode;
|
||||
var widget = p_obj.getAttribute("widget");
|
||||
if(!widget) return;
|
||||
selectedWidget = p_obj;
|
||||
doShowWidgetSizeSetup(evt.pageX, evt.pageY, selectedWidget);
|
||||
return;
|
||||
|
||||
// 위젯 제거
|
||||
} else if(obj.className == 'widgetRemove' || obj.className == 'widgetBoxRemove') {
|
||||
var p_obj = obj.parentNode;
|
||||
var p_obj = obj.parentNode.parentNode;
|
||||
var widget = p_obj.getAttribute("widget");
|
||||
if(confirm(confirm_delete_msg)) p_obj.parentNode.removeChild(p_obj);
|
||||
if(confirm(confirm_delete_msg)) {
|
||||
restoreWidgetButtons();
|
||||
|
||||
if(p_obj.getAttribute('widget')=='widgetContent') {
|
||||
var response_tags = new Array('error','message','document_srl');
|
||||
var params = new Array();
|
||||
params['document_srl'] =p_obj.getAttribute('document_srl');
|
||||
exec_xml('widget','procWidgetDeleteDocument', params, completeDeleteWidgetContent, response_tags, params, p_obj);
|
||||
return;
|
||||
} else {
|
||||
p_obj.parentNode.removeChild(p_obj);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -384,6 +418,37 @@ function doCheckWidget(e) {
|
|||
}
|
||||
}
|
||||
|
||||
// content widget 복사
|
||||
function completeCopyWidgetContent(ret_obj, response_tags, params, p_obj) {
|
||||
var document_srl = ret_obj['document_srl'];
|
||||
var dummy = xCreateElement("DIV");
|
||||
xInnerHtml(dummy,xInnerHtml(p_obj));
|
||||
|
||||
|
||||
dummy.widget_sequence = '';
|
||||
dummy.className = "widgetOutput";
|
||||
for(var i=0;i<p_obj.attributes.length;i++) {
|
||||
if(!p_obj.attributes[i].nodeName || !p_obj.attributes[i].nodeValue) continue;
|
||||
var name = p_obj.attributes[i].nodeName.toLowerCase();
|
||||
|
||||
var value = p_obj.attributes[i].nodeValue;
|
||||
if(!value) continue;
|
||||
|
||||
if(value && typeof(value)=="string") value = value.replace(/\"/ig,'"');
|
||||
|
||||
dummy.setAttribute(name, value);
|
||||
}
|
||||
p_obj.setAttribute('document_srl', document_srl);
|
||||
|
||||
if(xIE4Up) dummy.style["cssText"] = p_obj.getAttribute("style")["cssText"];
|
||||
p_obj.parentNode.insertBefore(dummy, p_obj);
|
||||
}
|
||||
|
||||
// content widget 제거
|
||||
function completeDeleteWidgetContent(ret_obj, response_tags, params, p_obj) {
|
||||
p_obj.parentNode.removeChild(p_obj);
|
||||
}
|
||||
|
||||
|
||||
// 마우스 다운 이벤트 발생시 위젯의 이동을 처리
|
||||
function doCheckWidgetDrag(e) {
|
||||
|
|
@ -639,6 +704,48 @@ function doApplyWidgetSize(fo_obj) {
|
|||
doHideWidgetSizeSetup();
|
||||
}
|
||||
|
||||
/* 위젯 조절 */
|
||||
xAddEventListener(document,'mouseover',widgetSetup);
|
||||
|
||||
function restoreWidgetButtons() {
|
||||
var widgetButton = xGetElementById('widgetButton');
|
||||
var boxWidgetButton = xGetElementById('widgetBoxButton');
|
||||
if(!widgetButton || !boxWidgetButton) return;
|
||||
widgetButton.style.visibility = 'hidden';
|
||||
document.body.appendChild(widgetButton);
|
||||
boxWidgetButton.style.visibility = 'hidden';
|
||||
document.body.appendChild(boxWidgetButton);
|
||||
}
|
||||
|
||||
function showWidgetButton(name, obj) {
|
||||
restoreWidgetButtons();
|
||||
var widgetButton = xGetElementById(name);
|
||||
if(!widgetButton) return;
|
||||
widgetButton.style.visibility = 'visible';
|
||||
obj.appendChild(widgetButton);
|
||||
}
|
||||
|
||||
function widgetSetup(evt) {
|
||||
|
||||
var e = new xEvent(evt);
|
||||
var obj = e.target;
|
||||
while(obj) {
|
||||
if(obj.parentNode && typeof(obj.parentNode.className)!='undefined' && obj.parentNode.className == 'widgetButtons') return;
|
||||
if(typeof(obj.className)!='undefined' && obj.className == 'widgetOutput') break;
|
||||
obj = obj.parentNode;
|
||||
}
|
||||
if(!obj || typeof(obj.className)=='undefined' || obj.className != 'widgetOutput') {
|
||||
restoreWidgetButtons();
|
||||
return;
|
||||
}
|
||||
|
||||
var widget = obj.getAttribute('widget');
|
||||
if(!widget) return;
|
||||
|
||||
if(widget == 'widgetBox') showWidgetButton('widgetBoxButton', obj);
|
||||
else showWidgetButton('widgetButton', obj);
|
||||
}
|
||||
|
||||
/* 위젯 드래그 */
|
||||
// 드래그 중이라는 상황을 간직할 변수
|
||||
var widgetDragManager = {obj:null, isDrag:false}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@
|
|||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl) return $this->stop("msg_invalid_request");
|
||||
|
||||
$document_srl = Context::get('document_srl');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
Context::set('module_info', $module_info);
|
||||
|
|
@ -48,7 +53,7 @@
|
|||
$option->enable_default_component = true;
|
||||
$option->enable_component = true;
|
||||
$option->resizable = false;
|
||||
$option->height = 400;
|
||||
$option->height = 300;
|
||||
$editor = $oEditorModel->getEditor($module_srl, $option);
|
||||
Context::set('editor', $editor);
|
||||
|
||||
|
|
|
|||
|
|
@ -219,5 +219,171 @@
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컨텐츠 위젯 추가
|
||||
**/
|
||||
function procWidgetInsertDocument() {
|
||||
// 변수 구함
|
||||
$module_srl = Context::get('module_srl');
|
||||
$document_srl = Context::get('document_srl');
|
||||
$content = Context::get('content');
|
||||
$editor_sequence = Context::get('editor_sequence');
|
||||
|
||||
// 대상 페이지 모듈 정보 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request');
|
||||
|
||||
// 권한 체크
|
||||
$is_logged = Context::get('is_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
$user_group = $logged_info->group_list;
|
||||
$is_admin = false;
|
||||
if(count($user_group)&&count($page_info->grants['manager'])) {
|
||||
$manager_group = $page_info->grants['manager'];
|
||||
foreach($user_group as $group_srl => $group_info) {
|
||||
if(in_array($group_srl, $manager_group)) $is_admin = true;
|
||||
}
|
||||
}
|
||||
if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin() && !(is_array($page_info->admin_id) && in_array($logged_infoi->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
|
||||
// 글 입력
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->content = $content;
|
||||
$obj->document_srl = $document_srl;
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($obj->document_srl, true);
|
||||
if($oDocument->isExists() && $oDocument->document_srl == $obj->document_srl) {
|
||||
$output = $oDocumentController->updateDocument($oDocument, $obj);
|
||||
} else {
|
||||
$output = $oDocumentController->insertDocument($obj);
|
||||
$obj->document_srl = $output->get('document_srl');
|
||||
}
|
||||
|
||||
// 오류 발생시 멈춤
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 결과를 리턴
|
||||
$this->add('document_srl', $obj->document_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컨텐츠 위젯 복사
|
||||
**/
|
||||
function procWidgetCopyDocument() {
|
||||
// 변수 구함
|
||||
$document_srl = Context::get('document_srl');
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentController = &getController('document');
|
||||
$oDocumentAdminController = &getAdminController('document');
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, true);
|
||||
if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
|
||||
// 대상 페이지 모듈 정보 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request');
|
||||
|
||||
// 권한 체크
|
||||
$is_logged = Context::get('is_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
$user_group = $logged_info->group_list;
|
||||
$is_admin = false;
|
||||
if(count($user_group)&&count($page_info->grants['manager'])) {
|
||||
$manager_group = $page_info->grants['manager'];
|
||||
foreach($user_group as $group_srl => $group_info) {
|
||||
if(in_array($group_srl, $manager_group)) $is_admin = true;
|
||||
}
|
||||
}
|
||||
if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin() && !(is_array($page_info->admin_id) && in_array($logged_infoi->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
$output = $oDocumentAdminController->copyDocumentModule(array($oDocument->get('document_srl')), $oDocument->get('module_srl'),0);
|
||||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 결과를 리턴
|
||||
$copied_srls = $output->get('copied_srls');
|
||||
$this->add('document_srl', $copied_srls[$oDocument->get('document_srl')]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 위젯 삭제
|
||||
**/
|
||||
function procWidgetDeleteDocument() {
|
||||
// 변수 구함
|
||||
$document_srl = Context::get('document_srl');
|
||||
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentController = &getController('document');
|
||||
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl, true);
|
||||
if(!$oDocument->isExists()) return new Object(-1,'msg_invalid_request');
|
||||
$module_srl = $oDocument->get('module_srl');
|
||||
|
||||
// 대상 페이지 모듈 정보 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request');
|
||||
|
||||
// 권한 체크
|
||||
$is_logged = Context::get('is_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
$user_group = $logged_info->group_list;
|
||||
$is_admin = false;
|
||||
if(count($user_group)&&count($page_info->grants['manager'])) {
|
||||
$manager_group = $page_info->grants['manager'];
|
||||
foreach($user_group as $group_srl => $group_info) {
|
||||
if(in_array($group_srl, $manager_group)) $is_admin = true;
|
||||
}
|
||||
}
|
||||
if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin() && !(is_array($page_info->admin_id) && in_array($logged_infoi->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
$output = $oDocumentController->deleteDocument($oDocument->get('document_srl'), true);
|
||||
if(!$output->toBool()) return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 내용 지우기
|
||||
**/
|
||||
function procWidgetRemoveContents() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl) return new Object(-1,'msg_invalid_request');
|
||||
|
||||
// 대상 페이지 모듈 정보 구함
|
||||
$oModuleModel = &getModel('module');
|
||||
$page_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl);
|
||||
if(!$page_info->module_srl || $page_info->module != 'page') return new Object(-1,'msg_invalid_request');
|
||||
|
||||
// 권한 체크
|
||||
$is_logged = Context::get('is_logged');
|
||||
$logged_info = Context::get('logged_info');
|
||||
$user_group = $logged_info->group_list;
|
||||
$is_admin = false;
|
||||
if(count($user_group)&&count($page_info->grants['manager'])) {
|
||||
$manager_group = $page_info->grants['manager'];
|
||||
foreach($user_group as $group_srl => $group_info) {
|
||||
if(in_array($group_srl, $manager_group)) $is_admin = true;
|
||||
}
|
||||
}
|
||||
if(!$is_admin && !$is_logged && $logged_info->is_admin != 'Y' && !$oModuleModel->isSiteAdmin() && !(is_array($page_info->admin_id) && in_array($logged_infoi->user_id, $page_info->admin_id))) return new Object(-1,'msg_not_permitted');
|
||||
|
||||
// 등록된 글 목록 구함
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocumentController = &getController('document');
|
||||
$obj->module_srl = $module_srl;
|
||||
$obj->list_count = 99999999;
|
||||
$output = $oDocumentModel->getDocumentList($obj);
|
||||
if(!$output->total_count) return new Object();
|
||||
for($i=0;$i<$output->data;$i++) {
|
||||
$oDocumentController->deleteDocument($output->data[$i]->document_srl, true);
|
||||
}
|
||||
return new Object();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue