merge from 1.7.3.5(r13153:r13167)
git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
|
|
@ -9,7 +9,7 @@
|
|||
<title xml:lang="ru">Виджеты</title>
|
||||
<title xml:lang="zh-TW">Widget</title>
|
||||
<title xml:lang="tr">Görsel Bileşen (widget)</title>
|
||||
<description xml:lang="ko">위젯 관리 모듈</description>
|
||||
<description xml:lang="ko">위젯 관리</description>
|
||||
<description xml:lang="zh-CN">控件管理模块。</description>
|
||||
<description xml:lang="jp">ウィジェット管理モジュール</description>
|
||||
<description xml:lang="en">Module for managing widgets.</description>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<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="procWidgetGenerateCodeInPage" type="controller" standalone="true" ruleset="generateCodeInPage" />
|
||||
<action name="procWidgetGetColorsetList" type="controller" standalone="true" />
|
||||
|
||||
<action name="procWidgetStyleExtraImageUpload" type="controller" standalone="true" />
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@
|
|||
<value xml:lang="vi"><![CDATA[Lề trái]]></value>
|
||||
</item>
|
||||
<item name="about_widget_fix_width">
|
||||
<value xml:lang="ko"><![CDATA[선택하시면 가로 길이가 고정됩니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[선택하면 가로 길이가 고정됩니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Check this to fix the width.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[チェックを入れると横幅が固定されます。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[选择此项将固定控件显示宽度。]]></value>
|
||||
|
|
@ -340,19 +340,19 @@
|
|||
<value xml:lang="vi"><![CDATA[proc() của '%s' đã không được thực hiện.]]></value>
|
||||
</item>
|
||||
<item name="msg_widget_skin_is_null">
|
||||
<value xml:lang="ko"><![CDATA[위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[위젯의 스킨을 선택해야 정상적으로 동작할 수 있습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You should select widget's skin.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[ウィジェットスキンを選択しないと正常に動作できません。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[请选择控件皮肤!]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[請選擇一個可正常使用的 Widget 面板]]></value>
|
||||
<value xml:lang="fr"><![CDATA[위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다]]></value>
|
||||
<value xml:lang="ru"><![CDATA[위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다]]></value>
|
||||
<value xml:lang="es"><![CDATA[위젯의 스킨을 선택해 주셔야 정상적으로 동작할 수 있습니다]]></value>
|
||||
<value xml:lang="fr"><![CDATA[위젯의 스킨을 선택해야 정상적으로 동작할 수 있습니다]]></value>
|
||||
<value xml:lang="ru"><![CDATA[위젯의 스킨을 선택해야 정상적으로 동작할 수 있습니다]]></value>
|
||||
<value xml:lang="es"><![CDATA[위젯의 스킨을 선택해야 정상적으로 동작할 수 있습니다]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Widgetın dış görünümünü belirlemelisiniz.]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Bạn cần phải chọn Skin cho Widget.]]></value>
|
||||
</item>
|
||||
<item name="about_widget_code">
|
||||
<value xml:lang="ko"><![CDATA[선택하신 위젯에서 요구하는 아래 항목들의 값을 넣고 [코드생성]버튼을 누르시면 제일 아래 칸에 템플릿 파일에 적용할 수 있는 코드가 출력 됩니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[선택한 위젯에서 요구하는 아래 항목들의 값을 넣고 [코드생성]버튼을 누르면 제일 아래 칸에 템플릿 파일에 적용할 수 있는 코드가 출력 됩니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[Please input the required value first, and click [Generate Code] button to generate the code for adding to the template file.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[選択したウィジェットで要求する下記項目の値を入力し、「コード生成」ボタンをクリックすると、<br />一番下にテンプレートファイルに適用できるコードが出力されます。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[输入所选控件所需要的下列各项后,按『代码生成』按钮,即可在页面下方获得可以用在布局模版代码片断。]]></value>
|
||||
|
|
@ -364,7 +364,7 @@
|
|||
<value xml:lang="vi"><![CDATA[Hãy nhập các thông tin cần thiết, sau đó bấm nút [<b>Tạo Code</b>] để lấy Code thêm vào giao diện.]]></value>
|
||||
</item>
|
||||
<item name="about_widget_code_in_page">
|
||||
<value xml:lang="ko"><![CDATA[아래 필요한 값들을 입력하신 후 추가 버튼을 누르시면 페이지 내에 위젯이 삽입됩니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[아래 필요한 값들을 입력한 후 추가 버튼을 누르면 페이지 내에 위젯이 삽입됩니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[After entering the required values, click the [Add] button to insert the widget code into the page.]]></value>
|
||||
<value xml:lang="jp"><![CDATA[下記に必要な値を入力した後、追加ボタンをクリックするとページ内にウィジェットが挿入されます。]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[输入下列各项必要值后,按『生成代码』按钮,即可把控件插入到页面当中。]]></value>
|
||||
|
|
@ -376,9 +376,9 @@
|
|||
<value xml:lang="vi"><![CDATA[Sau khi nhập những thông tin cần thiết, bấm nút [<b>Tạo Code</b>] để chèn Code của Widget vào giao diện.]]></value>
|
||||
</item>
|
||||
<item name="about_widget">
|
||||
<value xml:lang="ko"><![CDATA[위젯은 레이아웃이나 페이지 모듈에서 사용되는 작은 구성요소입니다.
|
||||
위젯은 내부 모듈 또는 외부 open api와 연동될 수도 있고, 설정을 통해 다양하게 응용될 수 있습니다.
|
||||
XE의 페이지 모듈이나 레이아웃 모듈을 사용하지 않더라도 [코드생성] 기능을 통해 직접 위젯 추가도 할 수 있습니다.]]></value>
|
||||
<value xml:lang="ko"><![CDATA[위젯은 레이아웃이나 페이지에서 사용하는 작은 구성요소입니다.
|
||||
위젯은 내부 페이지 또는 외부 open api와 연동될 수도 있고, 설정을 통해 다양하게 응용될 수 있습니다.
|
||||
XE의 페이지나 레이아웃 모듈을 사용하지 않더라도 [코드생성] 기능을 통해 직접 위젯 추가도 할 수 있습니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[A widget is a small free-standing application used in a layout or page module.
|
||||
It can be linked with internal module or external Open API. Through its configuration setting, wide application is possible.
|
||||
You can directly add a widget by using the [Generate Code] function without using the XE page module or layout module.]]></value>
|
||||
|
|
@ -623,4 +623,12 @@ Sin la necesidad de utilizar los módulos de página o del diseño de XE, Usted
|
|||
<value xml:lang="jp"><![CDATA[インストールされたウィジェット]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[已安裝的 Widget]]></value>
|
||||
</item>
|
||||
<item name="display_no">
|
||||
<value xml:lang="ko"><![CDATA[표시안함]]></value>
|
||||
<value xml:lang="en"><![CDATA[Not displayed]]></value>
|
||||
</item>
|
||||
<item name="display_yes">
|
||||
<value xml:lang="ko"><![CDATA[표시함]]></value>
|
||||
<value xml:lang="en"><![CDATA[Display]]></value>
|
||||
</item>
|
||||
</lang>
|
||||
|
|
|
|||
11
modules/widget/ruleset/generateCodeInPage.xml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ruleset version="1.5.0">
|
||||
<customrules>
|
||||
<rule name="class_name" type="regex" test="/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/" />
|
||||
<rule name="skin_name" type="regex" test="/^[a-zA-Z0-9_\-\.]+$/" />
|
||||
</customrules>
|
||||
<fields>
|
||||
<field name="selected_widget" required="true" rule="class_name" />
|
||||
<field name="skin" required="true" rule="skin_name" />
|
||||
</fields>
|
||||
</ruleset>
|
||||
|
|
@ -1,33 +1,24 @@
|
|||
<load target="js/widget.js" usecdn="true" />
|
||||
<load target="css/widget.css" usecdn="true" />
|
||||
|
||||
<div class="x" style="padding: 0 10px;">
|
||||
|
||||
<h2 class="h2">{$lang->cmd_content_insert}</h2>
|
||||
|
||||
<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="" />
|
||||
<input type="hidden" name="widget_padding_top" value="" />
|
||||
<input type="hidden" name="widget_padding_bottom" 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="" />
|
||||
<input type="hidden" name="widget_padding_top" value="" />
|
||||
<input type="hidden" name="widget_padding_bottom" value="" />
|
||||
<div class="x_modal-header">
|
||||
<h1>{$lang->cmd_content_insert}</h1>
|
||||
</div>
|
||||
<div class="x_modal-body">
|
||||
<div class="pageAddContent"></div>
|
||||
|
||||
<div class="editor">
|
||||
{$editor}
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
xAddEventListener(window, 'load', doSyncPageContent);
|
||||
</script>
|
||||
|
||||
<div class="btnArea">
|
||||
<span class="btn small"><input type="submit" value="{$lang->cmd_save}" class="editor_button" /></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="editor">{$editor}</div>
|
||||
<script>xAddEventListener(window, 'load', doSyncPageContent);</script>
|
||||
</div>
|
||||
<div class="x_modal-footer">
|
||||
<input type="submit" value="{$lang->cmd_save}" class="x_btn x_btn-inverse" />
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -5,47 +5,34 @@
|
|||
#colorset_area{margin-top:.5em}
|
||||
#colorset_area .header{float:left;margin-right:.5em;padding-top:.2em}
|
||||
#colorset_area .footer{float:left}
|
||||
#zonePageContent{overflow:hidden;width:100%;padding:none !important;margin:none !important}
|
||||
#zonePageContent{overflow:hidden;width:100%;padding:0 !important;margin:0 !important}
|
||||
.pageAddContent{width:700px}
|
||||
.widgetOutput{float:left;cursor:move;z-index:998;overflow:hidden;position:relative;width:100%}
|
||||
.widgetOutput .widgetBorder{border:1px dashed #ccc;z-index:999}
|
||||
.widgetOutput .widgetBoxBorder{border:1px dashed #ccc;z-index:999}
|
||||
.widgetOutput{float:left;cursor:move;z-index:998;overflow:hidden;position:relative;width:100%;min-height:24px}
|
||||
.widgetOutput .widgetBorder,
|
||||
.widgetOutput .widgetBoxBorder{height:100%;border:1px dashed #ccc;z-index:999;box-sizing:border-box;min-height:24px}
|
||||
.widgetOutput .widgetResize {border:0;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 {border:0;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 .widgetResizeLeft {border:0;background:transparent url("../images/btn_resize_left.gif") no-repeat left bottom;width:12px;height:12px;position:absolute;bottom:1px;left:1px;cursor:pointer;z-index:1000}
|
||||
.widgetOutput .widgetBoxResize {border:0;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{border:0;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;overflow:hidden;*zoom:1;float:left;padding:3px;position:absolute;visibility:hidden}
|
||||
#widgetButton{background-color:#C7DBE9;left:0;top:0}
|
||||
#widgetBoxButton{background-color:#D2E9C7;right:0;top:0}
|
||||
.widgetButtons div{float:left}
|
||||
.widgetButtons .widgetStyle{background:transparent url("../images/widgetstyle_setup.gif") no-repeat 1px 1px;width:14px;height:14px; cursor:pointer;z-index:1000}
|
||||
.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 .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 #888;background:#fff;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:#888}
|
||||
#pageSizeLayer table th.line {border-top:1px dotted #eee}
|
||||
#pageSizeLayer table td{padding:4px 10px 4px 10px;background-color:#EFEFEF}
|
||||
#pageSizeLayer table td div{margin-bottom:5px}
|
||||
#pageSizeLayer table td.line {border-top:1px dotted #999}
|
||||
#pageSizeLayer table td.buttonBox{background-color:#fff;white-space:nowrap;overflow:hidden;vertical-align:top;text-align:center;border-top:1px solid #888;color:#ddd}
|
||||
#pageSizeLayer .input{background:#fff;border:1px solid #aaa;padding:1px;font:8pt verdana;width:60px}
|
||||
#pageSizeLayer .full_input{background:#fff;border:1px solid #aaa;padding:1px;font:8pt verdana;width:90%}
|
||||
#pageSizeLayer .small_input{background:#fff;border:1px solid #aaa;padding:1px;font:8pt verdana;width:20px}
|
||||
#pageSizeLayer .color_input{background:#fff;border:1px solid #aaa;padding:1px;font:8pt verdana;width:44px}
|
||||
#pageSizeLayer .submit{width:90%;border:1px solid #DEDEDE;background-color:#fff}
|
||||
.widgetButtons{z-index:1000;overflow:hidden;*zoom:1;float:left;padding:0 10px;line-height:24px;position:absolute;top:0;visibility:hidden;box-shadow:0 0 3px #333 inset}
|
||||
.widgetButtons#widgetButton{background-color:#C7DBE9;left:0}
|
||||
.widgetButtons#widgetBoxButton{background-color:#D2E9C7;right:0}
|
||||
.widgetButtons>button{border:0;width:14px;height:14px;padding:14px 0 0 0;overflow:hidden;cursor:pointer;z-index:99;background:transparent url("../../../admin/tpl/img/glyphicons-halflings.png") no-repeat}
|
||||
.widgetButtons .widgetSetup{background-position:-432px 0}
|
||||
.widgetButtons .widgetSize,
|
||||
.widgetButtons .widgetBoxSize{background-position:-96px -120px}
|
||||
.widgetButtons .widgetStyle{background-position:-456px -144px}
|
||||
.widgetButtons .widgetCopy,
|
||||
.widgetButtons .widgetBoxCopy{background-position:0 -96px}
|
||||
.widgetButtons .widgetRemove,
|
||||
.widgetButtons .widgetBoxRemove{background-position:-456px 0}
|
||||
.help{padding:5px 0;background-color:#EFEFEF;border-top:1px solid #ccc}
|
||||
ul.midCommand{float:left;margin:0 0 0 10px;;padding:0;*zoom:1}
|
||||
ul.midCommand li{display:block;margin-bottom:5px;list-style:none}
|
||||
a.widgetStyle{display:inline-block;margin:0 10px 10px 0;border:1px solid #fff;overflow:hidden;*zoom:1; width:96px;height:96px;position:relative;text-decoration:none}
|
||||
a.widgetStyle{display:inline-block;margin:0 10px 10px 0;border:1px solid #fff;overflow:hidden;*zoom:1;width:96px;height:96px;position:relative;text-decoration:none}
|
||||
a.widgetStyle:hover{border:1px dashed #ccc}
|
||||
a.widgetStyle:hover span{display:none}
|
||||
a.widgetStyle.selected{border:1px dashed #999}
|
||||
a.widgetStyle img {width:96px;height:96px;margin:1px}
|
||||
a.widgetStyle span{position:absolute;left:0;bottom:0;display:block;width:96px;background-color:#888;color:#fff;padding:4px 3px 3px 3px;opacity:.8;filter:alpha(opacity=80);text-align:center;font-family:tahoma}
|
||||
#zonePageContent .widgetContainer { min-height: 20px; }
|
||||
#zonePageContent .widgetContainer{min-height:20px}
|
||||
|
|
@ -1,41 +1,41 @@
|
|||
<include target="header.html" />
|
||||
|
||||
<div class="table even easyList dsTg">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<caption>
|
||||
All({$tCount})
|
||||
<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>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="title">{$lang->widget_name}</th>
|
||||
<th scope="col" class="nowr">{$lang->version}</th>
|
||||
<th scope="col" class="nowr">{$lang->author}</th>
|
||||
<th scope="col" class="nowr">{$lang->path}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_generate_code}</th>
|
||||
<th scope="col" class="nowr">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$widget_list => $widget">
|
||||
<td class="title">
|
||||
<p><strong>{$widget->title}</strong></p>
|
||||
<p>{$widget->description}</p>
|
||||
<p cond="$widget->need_update == 'Y'" class="update">
|
||||
{$lang->msg_avail_easy_update} <a href="{$widget->update_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->msg_do_you_like_update}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td class="nowr">{$widget->version}</td>
|
||||
<td class="nowr">
|
||||
<block loop="$widget->author => $author">
|
||||
<a cond="$author->homepage" href="{$author->homepage}" target="_blank">{$author->name}</a>
|
||||
<block cond="!$author->homepage">{$author->name}</block>
|
||||
</block>
|
||||
</td>
|
||||
<td class="nowr">{$widget->path}</td>
|
||||
<td class="nowr"><a href="{getUrl('act', 'dispWidgetAdminGenerateCode', 'selected_widget', $widget->widget)}">{$lang->cmd_generate_code}</a></td>
|
||||
<td class="nowr"><a cond="$widget->remove_url" href="{$widget->remove_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->cmd_delete}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table class="x_table x_table-striped x_table-hover dsTg">
|
||||
<caption>
|
||||
<strong>All({$tCount})</strong>
|
||||
<div class="x_pull-right x_btn-group">
|
||||
<button class="x_btn x_active __simple">{$lang->simple_view}</button>
|
||||
<button class="x_btn __detail">{$lang->detail_view}</button>
|
||||
</div>
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">{$lang->widget_name}</th>
|
||||
<th scope="col">{$lang->version}</th>
|
||||
<th scope="col">{$lang->author}</th>
|
||||
<th scope="col">{$lang->path}</th>
|
||||
<th scope="col">{$lang->cmd_generate_code}</th>
|
||||
<th scope="col">{$lang->cmd_delete}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr loop="$widget_list => $widget">
|
||||
<td class="title">
|
||||
<p><strong>{$widget->title}</strong></p>
|
||||
<p>{$widget->description}</p>
|
||||
<p cond="$widget->need_update == 'Y'" class="update">
|
||||
{$lang->msg_avail_easy_update} <a href="{$widget->update_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->msg_do_you_like_update}</a>
|
||||
</p>
|
||||
</td>
|
||||
<td>{$widget->version}</td>
|
||||
<td>
|
||||
<block loop="$widget->author => $author">
|
||||
<a cond="$author->homepage" href="{$author->homepage}" target="_blank">{$author->name}</a>
|
||||
<block cond="!$author->homepage">{$author->name}</block>
|
||||
</block>
|
||||
</td>
|
||||
<td>{$widget->path}</td>
|
||||
<td><a class="x_btn x_btn-link" href="{getUrl('act', 'dispWidgetAdminGenerateCode', 'selected_widget', $widget->widget)}">{$lang->cmd_generate_code}</a></td>
|
||||
<td><a class="x_btn x_btn-link" cond="$widget->remove_url" href="{$widget->remove_url}&return_url={urlencode(getRequestUriByServerEnviroment())}">{$lang->cmd_delete}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,14 @@
|
|||
<h1 class="h1">{$lang->installed_widgets}</h1>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<div class="x_page-header">
|
||||
<h1>
|
||||
{$lang->installed_widgets} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_advanced_installed_widget" target="_blank">{$lang->help}</a>
|
||||
<span class="path" cond="$widget_info">
|
||||
> {$widget_info->title} <a cond="$widget_info" href="#widgetInfo" class="x_icon-question-sign" data-toggle>{$lang->help}</a>
|
||||
</span>
|
||||
<span class="path" cond="$widget_info">
|
||||
> {$lang->cmd_generate_code} <a href="#codeHelp" class="x_icon-question-sign" data-toggle style="vertical-align:middle">{$lang->help}</a>
|
||||
</span>
|
||||
</h1>
|
||||
</div>
|
||||
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/autoinstall/tpl/uninstall/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
|
||||
<p>{$XE_VALIDATOR_MESSAGE}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 202 B |
|
Before Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 191 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 143 B |
|
|
@ -41,12 +41,12 @@ function doDisplaySkinColorset(colorset)
|
|||
|
||||
function doHideSkinColorset()
|
||||
{
|
||||
jQuery('select[name=colorset]').parents('li').hide();
|
||||
jQuery('select[name=colorset]').closest('.x_control-group').hide();
|
||||
}
|
||||
|
||||
function doShowSkinColorset()
|
||||
{
|
||||
jQuery('select[name=colorset]').parents('li').show();
|
||||
jQuery('select[name=colorset]').closest('.x_control-group').show();
|
||||
}
|
||||
|
||||
function completeGenerateCodeInPage(widget_code) {
|
||||
|
|
@ -219,7 +219,7 @@ jQuery(document).ready(function($){
|
|||
if(src instanceof Object ) {
|
||||
for(var i=0;i<src.length;i++){
|
||||
if(src[i].id) {
|
||||
htmlCode += '<img src="'+src[i].id+'" alt="" style="border: 1px solid #ccc; padding: 5px; max-height: 200px; max-width: 200px;"><button class="filebox_del text" type="button">'+xe.lang.cmd_delete+'</button>';
|
||||
htmlCode += '<img src="'+src[i].id+'" alt="" style="border:1px solid #ccc;padding:5px;max-height:200px;max-width:200px"> <button type="button" class="filebox_del x_icon-remove">'+xe.lang.cmd_delete+'</button> ';
|
||||
if(i==0) $(this).siblings('input').val(src[i].id);
|
||||
else {
|
||||
var aux = $(this).siblings('input').val();
|
||||
|
|
@ -228,7 +228,7 @@ jQuery(document).ready(function($){
|
|||
}
|
||||
else {
|
||||
if(src[i]){
|
||||
htmlCode += '<img src="'+src[i]+'" alt="" style="border: 1px solid #ccc; padding: 5px; max-height: 200px; max-width: 200px;"><button class="filebox_del text" type="button">'+xe.lang.cmd_delete+'</button>';
|
||||
htmlCode += '<img src="'+src[i]+'" alt="" style="border:1px solid #ccc;padding:5px;max-height:200px;max-width:200px"> <button type="button" class="filebox_del x_icon-remove">'+xe.lang.cmd_delete+'</button> ';
|
||||
if(i==0) $(this).siblings('input').val(src[i]);
|
||||
else {
|
||||
var aux = $(this).siblings('input').val();
|
||||
|
|
@ -238,7 +238,7 @@ jQuery(document).ready(function($){
|
|||
}
|
||||
}
|
||||
} else {
|
||||
htmlCode = '<img src="'+src+'" alt="" style="border: 1px solid #ccc; padding: 5px; max-height: 200px; max-width: 200px;"> <button class="filebox_del text" type="button">'+xe.lang.cmd_delete+'</button>';
|
||||
htmlCode = '<img src="'+src+'" alt="" style="border: 1px solid #ccc; padding: 5px; max-height: 200px; max-width: 200px;"> <button class="filebox_del x_btn x_btn-danger" type="button">'+xe.lang.cmd_delete+'</button> ';
|
||||
$(this).siblings('input').val(src);
|
||||
}
|
||||
$(this).before(htmlCode);
|
||||
|
|
|
|||
|
|
@ -1,78 +0,0 @@
|
|||
(function($){
|
||||
|
||||
xe.MidManager = xe.createApp("MidManager", {
|
||||
$keyObj: null,
|
||||
|
||||
init: function(key){
|
||||
var self = this;
|
||||
var $keyObj = this.$keyObj = $('.extra_vars input[name='+key+']');
|
||||
var $finder = $keyObj.siblings('.finder');
|
||||
|
||||
$keyObj.siblings('button.search').bind('click', function(){
|
||||
$finder.slideDown(100);
|
||||
return false;
|
||||
});
|
||||
|
||||
$keyObj.parent().find('button.delete,a.delete').bind('click', function(){
|
||||
$keyObj.val('').next().val('');
|
||||
return false;
|
||||
});
|
||||
|
||||
$finder.find('.moduleIdList').siblings('button').bind('click', function(){
|
||||
$keyObj.val($finder.find('.moduleIdList').val());
|
||||
self.cast('MID_SYNC');
|
||||
$finder.slideUp(100);
|
||||
return false;
|
||||
});
|
||||
|
||||
jQuery(function($){
|
||||
$('.moduleSearch').bind('moduleSelect', function(e, aSelected){
|
||||
self.cast('MID_SYNC_NEW', aSelected);
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
API_MID_SYNC: function(){
|
||||
var self = this;
|
||||
var $finder = self.$keyObj.closest('.modulefinder');
|
||||
|
||||
var module_srl = this.$keyObj.val();
|
||||
if (!module_srl) return;
|
||||
|
||||
function on_complete(data){
|
||||
if (data.error){
|
||||
alert(data.message);
|
||||
return;
|
||||
}
|
||||
|
||||
self.$keyObj.val(data.module_list[0].module_srl);
|
||||
self.$keyObj.next().val(data.module_list[0].browser_title+' ('+data.module_list[0].mid+', '+data.module_list[0].module_name+')');
|
||||
}
|
||||
|
||||
$.exec_json('module.getModuleAdminModuleList', {'module_srls': module_srl}, on_complete);
|
||||
},
|
||||
|
||||
API_MID_SYNC_NEW: function(htBase, aParam){
|
||||
var self = this;
|
||||
|
||||
htSelected = aParam[0];
|
||||
|
||||
var module_srl = htSelected.module_srl;
|
||||
if (!module_srl) return;
|
||||
|
||||
function on_complete(data){
|
||||
if (data.error){
|
||||
alert(data.message);
|
||||
return;
|
||||
}
|
||||
|
||||
self.$keyObj.val(data.module_list[0].module_srl);
|
||||
self.$keyObj.next().val(data.module_list[0].browser_title+' ('+data.module_list[0].mid+', '+data.module_list[0].module_name+')');
|
||||
}
|
||||
|
||||
$.exec_json('module.getModuleAdminModuleList', {'module_srls': module_srl}, on_complete);
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
(function($){
|
||||
|
||||
xe.ModuleListManager = xe.createApp("ModuleListManager", {
|
||||
$keyObj: null,
|
||||
$moduleNameObj: null,
|
||||
$moduleSrlObj: null,
|
||||
$selectedObj: null,
|
||||
|
||||
init: function(key){
|
||||
var self = this;
|
||||
var $keyObj = this.$keyObj = $('.extra_vars input[name='+key+']');
|
||||
this.$moduleNameObj = $keyObj.parent().find('.moduleList');
|
||||
this.$moduleSrlObj = $keyObj.parent().find('.moduleIdList');
|
||||
this.$selectedObj = $keyObj.parent().find('.modulelist_selected');
|
||||
|
||||
this.$selectedObj
|
||||
.nextAll('button')
|
||||
.filter('.modulelist_add').bind('click', function(){ self.cast('MODULELIST_ADD'); return false; }).hide().end()
|
||||
.filter('.modulelist_del').bind('click', function(){ self.cast('MODULELIST_DEL'); return false; }).end()
|
||||
.filter('.modulelist_up').bind('click', function(){ self.cast('MODULELIST_UP'); return false; }).end()
|
||||
.filter('.modulelist_down').bind('click', function(){ self.cast('MODULELIST_DOWN'); return false; }).end()
|
||||
.end()
|
||||
.bind('show', function(){
|
||||
$(this).nextAll().show();
|
||||
});
|
||||
|
||||
this.cast('MODULELIST_SYNC');
|
||||
},
|
||||
|
||||
addModule: function(sModuleType, sModuleInstanceName, sModuleSrl){
|
||||
$('<OPTION>').val(sModuleSrl).text(sModuleInstanceName + ' ('+sModuleType+')').appendTo(this.$selectedObj);
|
||||
|
||||
this.removeDuplicated();
|
||||
this.refreshValue();
|
||||
},
|
||||
|
||||
API_ADD_MODULE_TO_MODULELIST_MANAGER : function(sender, aParams){
|
||||
this.addModule(aParams[0], aParams[1], aParams[2]);
|
||||
},
|
||||
|
||||
API_MODULELIST_ADD: function(){
|
||||
var sModuleType = this.$moduleNameObj.find('>option:selected').text();
|
||||
var sModuleInstanceName = this.$moduleSrlObj.find('>option:selected').text();
|
||||
var sModuleSrl = this.$moduleSrlObj.find('>option:selected').val();
|
||||
|
||||
this.addModule(sModuleType, sModuleInstanceName, sModuleSrl);
|
||||
},
|
||||
|
||||
API_MODULELIST_DEL: function(){
|
||||
this.$selectedObj.find('>option:selected').remove();
|
||||
this.refreshValue();
|
||||
},
|
||||
|
||||
API_MODULELIST_UP: function(){
|
||||
var $selected = this.$selectedObj.find('>option:selected');
|
||||
$selected.eq(0).prev('option').before($selected);
|
||||
this.refreshValue();
|
||||
},
|
||||
|
||||
API_MODULELIST_DOWN: function(){
|
||||
var $selected = this.$selectedObj.find('>option:selected');
|
||||
$selected.eq(-1).next('option').after($selected);
|
||||
this.refreshValue();
|
||||
},
|
||||
|
||||
API_MODULELIST_SYNC: function(){
|
||||
var values = this.$keyObj.val();
|
||||
if (!values) return;
|
||||
|
||||
var self = this;
|
||||
function on_complete(data){
|
||||
if (data.error) return;
|
||||
|
||||
for(var i in data.module_list){
|
||||
var module = data.module_list[i];
|
||||
var obj = $(document.createElement('option'));
|
||||
obj.val(module.module_srl).html(module.browser_title+' ('+module.module_name+')').appendTo(self.$selectedObj);
|
||||
}
|
||||
}
|
||||
|
||||
$.exec_json('module.getModuleAdminModuleList', {'module_srls': values}, on_complete);
|
||||
},
|
||||
|
||||
removeDuplicated : function() {
|
||||
var selected = {};
|
||||
this.$selectedObj.find('>option').each(function(){
|
||||
if(selected[this.value]) $(this).remove();
|
||||
selected[this.value] = true;
|
||||
});
|
||||
},
|
||||
|
||||
refreshValue : function() {
|
||||
var srls = [];
|
||||
|
||||
this.$selectedObj.find('>option').each(function(){
|
||||
srls.push(this.value);
|
||||
});
|
||||
|
||||
this.$keyObj.val(srls.join(','));
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
(function($){
|
||||
|
||||
xe.MultiLangManager = xe.createApp("MultiLangManager", {
|
||||
$keyObj: null,
|
||||
|
||||
init: function(key){
|
||||
var $keyObj = this.$keyObj = $('.extra_vars input[name='+key+']');
|
||||
},
|
||||
|
||||
API_MULTILANG_SYNC: function(){
|
||||
var self = this;
|
||||
var regexp = /^\$user_lang\-\>/;
|
||||
|
||||
var langCode = this.$keyObj.val();
|
||||
if (!regexp.test(langCode)) return;
|
||||
|
||||
function on_complete(data){
|
||||
if (data.error){
|
||||
alert(data.message);
|
||||
return;
|
||||
}
|
||||
|
||||
$('#' + self.$keyObj.attr('name')).val(data.lang);
|
||||
}
|
||||
|
||||
$.exec_json('module.getLangByLangcode', {'langCode': langCode}, on_complete);
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
(function($){
|
||||
|
||||
xe.MultiOrderManager = xe.createApp("MultiOrderManager", {
|
||||
$keyObj: null,
|
||||
$showObj: null,
|
||||
$selectedObj: null,
|
||||
|
||||
init: function(key){
|
||||
var self = this;
|
||||
var $keyObj = this.$keyObj = jQuery('.extra_vars input[name='+key+']');
|
||||
this.$showObj = $keyObj.parent().find('.multiorder_show');
|
||||
this.$selectedObj = $keyObj.parent().find('.multiorder_selected');
|
||||
|
||||
this.$showObj
|
||||
.nextAll('button')
|
||||
.filter('.multiorder_add').bind('click', function(){ self.cast('MULTIORDER_ADD'); return false; }).end()
|
||||
.filter('.multiorder_del').bind('click', function(){ self.cast('MULTIORDER_DEL'); return false; }).end()
|
||||
.filter('.multiorder_up').bind('click', function(){ self.cast('MULTIORDER_UP'); return false; }).end()
|
||||
.filter('.multiorder_down').bind('click', function(){ self.cast('MULTIORDER_DOWN'); return false; }).end()
|
||||
|
||||
this.cast('MULTIORDER_SYNC');
|
||||
},
|
||||
|
||||
API_MULTIORDER_ADD: function(){
|
||||
this.$showObj
|
||||
.find('>option:selected')
|
||||
.appendTo(this.$selectedObj);
|
||||
|
||||
this.refreshValue();
|
||||
},
|
||||
|
||||
API_MULTIORDER_DEL: function(){
|
||||
this.$selectedObj
|
||||
.find('>option:selected[default!="true"]')
|
||||
.appendTo(this.$showObj);
|
||||
|
||||
this.refreshValue();
|
||||
},
|
||||
|
||||
API_MULTIORDER_UP: function(){
|
||||
var $selected = this.$selectedObj.find('>option:selected');
|
||||
$selected.eq(0).prev('option').before($selected);
|
||||
this.refreshValue();
|
||||
},
|
||||
|
||||
API_MULTIORDER_DOWN: function(){
|
||||
var $selected = this.$selectedObj.find('>option:selected');
|
||||
$selected.eq(-1).next('option').after($selected);
|
||||
this.refreshValue();
|
||||
},
|
||||
|
||||
API_MULTIORDER_SYNC: function(){
|
||||
var values = this.$keyObj.val().split(',');
|
||||
this.$selectedObj.find('>option').appendTo(this.$showObj);
|
||||
|
||||
var targets = [];
|
||||
for(var i in values){
|
||||
var target = this.$showObj.find('>option[value='+values[i]+']').get(0);
|
||||
if (target != undefined) targets.push(target);
|
||||
}
|
||||
$(targets).appendTo(this.$selectedObj);
|
||||
},
|
||||
|
||||
refreshValue : function() {
|
||||
var values = [];
|
||||
|
||||
this.$selectedObj.find('>option').each(function(){
|
||||
values.push(this.value);
|
||||
});
|
||||
|
||||
this.$keyObj.val(values.join(','));
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
|
@ -42,23 +42,20 @@ function doStartPageModify(zoneID, module_srl) {
|
|||
|
||||
// 위젯 크기/여백 조절 레이어를 가장 밖으로 뺌
|
||||
jQuery('#tmpPageSizeLayer')
|
||||
.attr('id', 'pageSizeLayer')
|
||||
.css({position:'absolute',left:0,top:0})
|
||||
.hide()
|
||||
.appendTo('body')
|
||||
.hide()
|
||||
.attr('id', 'pageSizeLayer')
|
||||
.css({position:'fixed'})
|
||||
.before('<div class="x_modal-backdrop" />')
|
||||
.find('>form')
|
||||
.submit(function(){ doApplyWidgetSize(this); return false; });
|
||||
|
||||
// 모든 위젯들의 크기를 정해진 크기로 맞춤
|
||||
doFitBorderSize();
|
||||
|
||||
// 드래그와 리사이즈와 관련된 이벤트 리스너 생성
|
||||
xAddEventListener(document.getElementById('zonePageContent'), "click",doCheckWidget);
|
||||
xAddEventListener(document.getElementById('zonePageContent'), "mousedown",doCheckWidgetDrag);
|
||||
xAddEventListener(document.getElementById('zonePageContent'), 'mouseover',widgetSetup);
|
||||
}
|
||||
|
||||
|
||||
// 내용 모두 삭제
|
||||
function removeAllWidget() {
|
||||
if(!confirm(confirm_delete_msg)) return;
|
||||
|
|
@ -213,9 +210,6 @@ function doSyncPageContent() {
|
|||
}
|
||||
|
||||
if(typeof(editorStart)!='undefined') editorStart(1, "module_srl", "content", false, 400 );
|
||||
//editor_upload_start(1);
|
||||
|
||||
//setFixedPopupSize();
|
||||
}
|
||||
|
||||
// 부모창에 위젯을 추가
|
||||
|
|
@ -263,7 +257,7 @@ function addContentWidget(fo_obj) {
|
|||
'<button type="button" class="widgetResize"></button>'+
|
||||
'<button type="button" class="widgetResizeLeft"></button>'+
|
||||
'<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"></div>'+content+
|
||||
'<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>'+content+
|
||||
'</div>'+
|
||||
'<div class="widgetContent" style="display:none;width:1px;height:1px;overflow:hidden;"></div>'+
|
||||
'</div>';
|
||||
|
|
@ -294,7 +288,6 @@ function doAddWidgetBox() {
|
|||
'</div>'+
|
||||
'</div>';
|
||||
zonePageObj.innerHTML += tpl;
|
||||
doFitBorderSize();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -304,31 +297,11 @@ function doAddWidget(fo) {
|
|||
var idx = sel.selectedIndex;
|
||||
var val = sel.options[idx].value;
|
||||
var module_srl = fo.module_srl.value;
|
||||
|
||||
var url = request_uri.setQuery('module','widget').setQuery('act','dispWidgetGenerateCodeInPage').setQuery('selected_widget', val).setQuery('module_srl', module_srl);
|
||||
popopen(url,'GenerateWidgetCode');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// widgetBorder에 height를 widgetOutput와 맞춰줌
|
||||
function doFitBorderSize() {
|
||||
var obj_list = jQuery('.widgetBorer', zonePageObj).get();
|
||||
for(var i=0;i<obj_list.length;i++) {
|
||||
var obj = obj_list[i];
|
||||
var height = xHeight(obj.parentNode);
|
||||
if(height<3) height = 20;
|
||||
xHeight(obj, height);
|
||||
obj.parentNode.style.clear = '';
|
||||
}
|
||||
var obj_list = jQuery('.widgetBoxBorder', zonePageObj).get();
|
||||
for(var i=0;i<obj_list.length;i++) {
|
||||
var obj = obj_list[i];
|
||||
xHeight(obj, xHeight(obj.parentNode));
|
||||
obj.parentNode.style.clear = '';
|
||||
}
|
||||
}
|
||||
|
||||
var selectedWidget = null;
|
||||
var writedText = null;
|
||||
var checkDocumentWrite = false;
|
||||
|
|
@ -375,7 +348,7 @@ function doAddWidgetCode(widget_code) {
|
|||
|
||||
var cssfile = request_uri+cssfile;
|
||||
if(typeof(document.createStyleSheet)=='undefined') {
|
||||
var css ='<link rel="stylesheet" href="'+cssfile+'" type="text/css" charset="UTF-8" />';
|
||||
var css ='<link rel="stylesheet" href="'+cssfile+'" />';
|
||||
var dummy = xCreateElement("DIV");
|
||||
xInnerHtml(dummy , css);
|
||||
document.body.appendChild(dummy);
|
||||
|
|
@ -432,20 +405,6 @@ function doAddWidgetCode(widget_code) {
|
|||
}
|
||||
checkDocumentWrite = false;
|
||||
selectedWidget = null;
|
||||
|
||||
/*
|
||||
//zoneObj.style.visibility = 'hidden';
|
||||
zoneObj.style.opacity = 0.2;
|
||||
zoneObj.style.filter = "alpha(opacity=20)";
|
||||
|
||||
// 위젯 추가후 페이지 리로딩
|
||||
var tpl = getWidgetContent();
|
||||
|
||||
var fo_obj = get_by_id('pageFo');
|
||||
fo_obj.content.value = tpl;
|
||||
fo_obj.mid.value = current_mid;
|
||||
fo_obj.submit();
|
||||
*/
|
||||
}
|
||||
|
||||
// 클릭 이벤트시 위젯의 수정/제거/이벤트 무효화 처리
|
||||
|
|
@ -672,17 +631,43 @@ function doShowWidgetSizeSetup(px, py, obj) {
|
|||
opts.background_y = pos[1];
|
||||
}
|
||||
}
|
||||
|
||||
layer.css('top', py+'px').show();
|
||||
var _zonePageObj = jQuery(zonePageObj)
|
||||
var zoneOffsetLeft = _zonePageObj.offset().left;
|
||||
var zoneWidth = _zonePageObj.width();
|
||||
if (px + layer.width() > zoneOffsetLeft + zoneWidth) px = zoneOffsetLeft + zoneWidth - layer.width() - 5;
|
||||
layer.css('left', px+'px');
|
||||
layer.show();
|
||||
jQuery(function($){
|
||||
var $psLayer = $('#pageSizeLayer');
|
||||
var $backdrop = $('.x_modal-backdrop');
|
||||
var ww = $(window).width();
|
||||
var wh = $(window).height();
|
||||
var pw = $psLayer.width();
|
||||
var ph = $psLayer.height();
|
||||
if(ww>pw && wh>ph){
|
||||
$backdrop.show();
|
||||
$psLayer.css({
|
||||
position : 'fixed',
|
||||
top : wh/2 - ph/2 + 'px',
|
||||
left : ww/2 - pw/2 + 'px',
|
||||
width : '700px'
|
||||
});
|
||||
}else{
|
||||
$backdrop.hide();
|
||||
$psLayer.css({
|
||||
position : 'static',
|
||||
top : 'auto',
|
||||
left : 'auto',
|
||||
width : 'auto'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
jQuery.each(opts, function(key, val){
|
||||
var el = form[0].elements[key];
|
||||
if (el) el.value = val;
|
||||
if (el)
|
||||
{
|
||||
el.value = val;
|
||||
if(el.className.match(/\bcolor-indicator\b/))
|
||||
{
|
||||
el.style.background = el.value = '#'+el.value;
|
||||
}
|
||||
}
|
||||
if (el.tagName.toLowerCase() == "select")
|
||||
{
|
||||
if(el.selectedIndex == -1) {
|
||||
|
|
@ -695,11 +680,22 @@ function doShowWidgetSizeSetup(px, py, obj) {
|
|||
}
|
||||
|
||||
function doHideWidgetSizeSetup() {
|
||||
jQuery('#pageSizeLayer').hide();
|
||||
//var layer = get_by_id("pageSizeLayer");
|
||||
//layer.style.visibility = "hidden";
|
||||
//layer.style.display = "none";
|
||||
jQuery('#pageSizeLayer, .x_modal-backdrop, .jPicker.Container').hide();
|
||||
}
|
||||
jQuery(function($){
|
||||
$(document).keydown(function(e){
|
||||
var $jpicker = $('.jPicker.Container:visible');
|
||||
if(e.which == 27 && !$jpicker.length){
|
||||
doHideWidgetSizeSetup();
|
||||
return false;
|
||||
}else if(e.which == 27 && $jpicker.length){
|
||||
$jpicker.hide();
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function _getSize(value) {
|
||||
if(!value) return 0;
|
||||
|
|
@ -877,14 +873,6 @@ function showWidgetButton(name, obj) {
|
|||
if(!widgetButton) return;
|
||||
widgetButton.style.visibility = 'visible';
|
||||
obj.insertBefore(widgetButton, obj.firstChild);
|
||||
/*
|
||||
var cobj = obj.firstChild;
|
||||
while(cobj) {
|
||||
cobj = cobj.nextSibling;
|
||||
}
|
||||
|
||||
obj.appendChild(widgetButton);
|
||||
*/
|
||||
}
|
||||
|
||||
function widgetSetup(evt) {
|
||||
|
|
@ -900,12 +888,6 @@ function widgetSetup(evt) {
|
|||
restoreWidgetButtons();
|
||||
return;
|
||||
}
|
||||
/*
|
||||
if(!obj || typeof(obj.className)=='undefined' || obj.className != 'widgetOutput') {
|
||||
restoreWidgetButtons();
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
obj = o.get(0);
|
||||
var widget = o.attr('widget');
|
||||
|
|
@ -939,7 +921,6 @@ var widgetDisappear = 0;
|
|||
|
||||
function widgetCreateTmpObject(obj) {
|
||||
var id = obj.getAttribute('id');
|
||||
|
||||
tmpObj = xCreateElement('DIV');
|
||||
tmpObj.id = id + '_tmp';
|
||||
tmpObj.className = obj.className;
|
||||
|
|
@ -947,15 +928,12 @@ function widgetCreateTmpObject(obj) {
|
|||
tmpObj.style.margin= '0px';
|
||||
tmpObj.style.padding = '0px';
|
||||
tmpObj.style.width = obj.style.width;
|
||||
|
||||
tmpObj.style.display = 'none';
|
||||
tmpObj.style.position = 'absolute';
|
||||
tmpObj.style.opacity = 1;
|
||||
tmpObj.style.filter = 'alpha(opacity=100)';
|
||||
|
||||
xLeft(tmpObj, xPageX(obj));
|
||||
xTop(tmpObj, xPageY(obj));
|
||||
|
||||
document.body.appendChild(tmpObj);
|
||||
widgetTmpObject[obj.id] = tmpObj;
|
||||
return tmpObj;
|
||||
|
|
@ -1036,10 +1014,6 @@ function widgetDrag(tobj, dx, dy) {
|
|||
|
||||
if( zoneRight < sx+new_width) new_width = zoneRight - sx;
|
||||
|
||||
// 위젯의 크기 조절
|
||||
xWidth(tobj.nextSibling.nextSibling, new_width);
|
||||
xHeight(tobj.nextSibling.nextSibling, new_height);
|
||||
|
||||
xWidth(tobj.parentNode, new_width);
|
||||
xHeight(tobj.parentNode, new_height);
|
||||
|
||||
|
|
@ -1056,10 +1030,6 @@ function widgetDrag(tobj, dx, dy) {
|
|||
var new_height = ny - sy;
|
||||
if(new_height < minHeight) new_height = minHeight;
|
||||
|
||||
// 위젯의 크기 조절
|
||||
xWidth(tobj.nextSibling, new_width);
|
||||
xHeight(tobj.nextSibling, new_height);
|
||||
|
||||
xWidth(tobj.parentNode, new_width);
|
||||
xHeight(tobj.parentNode, new_height);
|
||||
|
||||
|
|
@ -1096,7 +1066,6 @@ function widgetDrag(tobj, dx, dy) {
|
|||
|
||||
if(next1) next1.parentNode.insertBefore(tobj, next1);
|
||||
if(next2) next2.parentNode.insertBefore(target_obj, next2);
|
||||
doFitBorderSize();
|
||||
widgetList = null;
|
||||
return;
|
||||
}
|
||||
|
|
@ -1110,11 +1079,7 @@ function widgetDrag(tobj, dx, dy) {
|
|||
var ll = parseInt(l,10) + parseInt(xWidth(p_tobj),10);
|
||||
var tt = parseInt(t,10) + parseInt(xHeight(p_tobj),10);
|
||||
if( (tobj.xDPX < l || tobj.xDPX > ll) || (tobj.xDPY < t || tobj.xDPY > tt) ) {
|
||||
|
||||
// zonePageObj.insertBefore(tobj, tobj.parentNode.parentNode.parentNode);
|
||||
zonePageObj.insertBefore(tobj, jQuery(tobj).parents('div.widgetOutput[widget=widgetBox]').get(0));
|
||||
|
||||
doFitBorderSize();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1153,7 +1118,6 @@ function widgetDrag(tobj, dx, dy) {
|
|||
// 이동을 멈춤
|
||||
widgetManualEnd();
|
||||
|
||||
doFitBorderSize();
|
||||
boxList = null;
|
||||
return;
|
||||
}
|
||||
|
|
@ -1188,7 +1152,6 @@ function widgetDrag(tobj, dx, dy) {
|
|||
|
||||
if(next1) next1.parentNode.insertBefore(tobj, next1);
|
||||
if(next2) next2.parentNode.insertBefore(target_obj, next2);
|
||||
doFitBorderSize();
|
||||
widgetList = null;
|
||||
return;
|
||||
}
|
||||
|
|
@ -1213,33 +1176,6 @@ function widgetDisapearObject(obj, tobj) {
|
|||
obj.parentNode.removeChild(obj);
|
||||
widgetTmpObject[tobj.id] = null;
|
||||
return;
|
||||
|
||||
/*
|
||||
var it = 5;
|
||||
var ib = 1;
|
||||
|
||||
var x = parseInt(xPageX(obj),10);
|
||||
var y = parseInt(xPageY(obj),10);
|
||||
var ldt = (x - parseInt(xPageX(tobj),10)) / ib;
|
||||
var tdt = (y - parseInt(xPageY(tobj),10)) / ib;
|
||||
|
||||
return setInterval(function() {
|
||||
if(ib < 1) {
|
||||
clearInterval(widgetDisapear);
|
||||
xInnerHtml(tobj,xInnerHtml(obj));
|
||||
xInnerHtml(obj,'');
|
||||
xDisplay(obj, 'none');
|
||||
obj.parentNode.removeChild(obj);
|
||||
widgetTmpObject[tobj.id] = null;
|
||||
return;
|
||||
}
|
||||
ib -= 5;
|
||||
x-=ldt;
|
||||
y-=tdt;
|
||||
xLeft(obj, x);
|
||||
xTop(obj, y);
|
||||
}, it/ib);
|
||||
*/
|
||||
}
|
||||
|
||||
// 마우스다운 이벤트 발생시 호출됨
|
||||
|
|
@ -1305,10 +1241,7 @@ function widgetDragDisable(id) {
|
|||
obj.dragStart = null;
|
||||
obj.drag = null;
|
||||
obj.dragEnd = null;
|
||||
//obj.style.backgroundColor = obj.getAttribute('source_color');
|
||||
|
||||
xRemoveEventListener(obj, 'mousedown', widgetMouseDown, false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
47
modules/widget/tpl/js/widget.min.js
vendored
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/**
|
||||
* @file modules/widget/js/widget.js
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief 위젯 관리용 자바스크립트
|
||||
**/
|
||||
function getStyle(obj){var style=obj.getAttribute("style");if(!style)style=obj.style;if(typeof (style)=="object")style=style.cssText;style=style.replace(/\burl\s*\(\s*"(.*?)"\s*\)/i,"url('$1')");return style}
|
||||
function getFloat(obj){return jQuery(obj).css('float')}
|
||||
function setFloat(obj,fl){jQuery(obj).css('float',fl)}
|
||||
function getPadding(obj,direct){var padding=obj.getAttribute("widget_padding_"+direct);if(!padding||padding==null)padding=0;return padding};var zonePageObj=null,zoneModuleSrl=0
|
||||
function doStartPageModify(zoneID,module_srl){zonePageObj=get_by_id(zoneID);zoneModuleSrl=module_srl;jQuery('#tmpPageSizeLayer').appendTo('body').hide().attr('id','pageSizeLayer').css({position:'fixed'}).before('<div class="x_modal-backdrop" />').find('>form').submit(function(){doApplyWidgetSize(this);return false});xAddEventListener(document.getElementById('zonePageContent'),"click",doCheckWidget);xAddEventListener(document.getElementById('zonePageContent'),"mousedown",doCheckWidgetDrag);xAddEventListener(document.getElementById('zonePageContent'),'mouseover',widgetSetup)}
|
||||
function removeAllWidget(){if(!confirm(confirm_delete_msg))return;restoreWidgetButtons();jQuery(zonePageObj).html('')}
|
||||
function getWidgetContent(obj){var html="";if(typeof (obj)=='undefined'||!obj)obj=zonePageObj;var widget=null;jQuery('div.widgetOutput',obj).each(function(){if(jQuery(this).parent().get(0)!=obj)return;widget=jQuery(this).attr('widget');switch(widget){case'widgetBox':html+=getWidgetBoxCode(this,widget);break;case'widgetContent':html+=getContentWidgetCode(this,widget);break;default:html+=getWidgetCode(this,widget);break}});return html}
|
||||
function getContentWidgetCode(childObj,widget){var cobj=childObj.firstChild,widgetContent=jQuery('div.widgetContent',childObj),body='',attrs='',code='',name,document_srl=0,toIgnore='contenteditable,id,style,src,widget,body,class,widget_width,widget_width_type,xdpx,xdpy,height,document_srl,widget_padding_left,widget_padding_right,widget_padding_top,widget_padding_bottom,hascontent';if(widgetContent.size()>0){document_srl=jQuery(childObj).attr('document_srl');if(document_srl>0){body=''}else body=widgetContent.html();var reIgnore=new RegExp('^('+toIgnore.replace(/,/g,'|')+')$','i'),value;for(var i=0;i<childObj.attributes.length;i++){if(!(name=childObj.attributes[i].nodeName)||!childObj.attributes[i].nodeValue)continue;if(reIgnore.test(name))continue;if(!(value=childObj.attributes[i].nodeValue))continue;attrs+=name+'="'+encodeURIComponent(value)+'" '};return'<img hasContent="true" class="zbxe_widget_output" widget="widgetContent" style="'+getStyle(childObj)+'" body="'+body+'" 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')+'" '+attrs+' />'}else return'';return code}
|
||||
function getWidgetBoxCode(childObj,widget){var attrs="";for(var i=0;i<childObj.attributes.length;i++){if(!childObj.attributes[i].nodeName||!childObj.attributes[i].nodeValue||/^jquery[0-9]+/i.test(childObj.attributes[i].nodeName))continue;var name=childObj.attributes[i].nodeName.toLowerCase();if(name=="widget_padding_left"||name=="widget_padding_right"||name=="widget_padding_top"||name=="widget_padding_bottom"||name=="contenteditable"||name=="id"||name=="style"||name=="src"||name=="widget"||name=="body"||name=="class"||name=="widget_width"||name=="widget_width_type"||name=="xdpx"||name=="xdpy"||name=="height")continue;var value=childObj.attributes[i].nodeValue;if(!value||value=="Array")continue;attrs+=name+'="'+encodeURIComponent(value)+'" '};var o;if(jQuery('.widget_inner',childObj).size()>0){o=jQuery('.widget_inner',childObj);o=o.get(0)}else o=jQuery('.nullWidget',childObj).get(0);var body=getWidgetContent(o);return'<div widget="widgetBox" style="'+getStyle(childObj)+'" widget_padding_left="'+getPadding(childObj,'left')+'" widget_padding_right="'+getPadding(childObj,'right')+'" widget_padding_top="'+getPadding(childObj,'top')+'" widget_padding_bottom="'+getPadding(childObj,'bottom')+'" '+attrs+'><div><div>'+body+'</div></div></div>'}
|
||||
function getWidgetCode(childObj,widget){var attrs="",code="";for(var i=0;i<childObj.attributes.length;i++){if(!childObj.attributes[i].nodeName||!childObj.attributes[i].nodeValue||/^jquery[0-9]+/i.test(childObj.attributes[i].nodeName))continue;var name=childObj.attributes[i].nodeName.toLowerCase();if(name=="contenteditable"||name=="id"||name=="style"||name=="src"||name=="widget"||name=="body"||name=="class"||name=="widget_width"||name=="widget_width_type"||name=="xdpx"||name=="xdpy"||name=="height")continue;var value=childObj.attributes[i].nodeValue;if(!value||value=="Array"||value=="null")continue;attrs+=name+'="'+encodeURIComponent(value)+'" '};var style=childObj.getAttribute("style");return'<img class="zbxe_widget_output" style="'+getStyle(childObj)+'" widget="'+widget+'" '+attrs+' />'}
|
||||
function doAddContent(mid){var url=request_uri.setQuery('module','widget').setQuery('act','dispWidgetAdminAddContent').setQuery('module_srl',zoneModuleSrl).setQuery('mid',mid);popopen(url,"addContent")}
|
||||
function doSyncPageContent(){if(opener&&opener.selectedWidget){var fo_obj=get_by_id("content_fo"),sel_obj=opener.selectedWidget;fo_obj.style.value=getStyle(opener.selectedWidget);fo_obj.widget_padding_left.value=getPadding(sel_obj,'left');fo_obj.widget_padding_right.value=getPadding(sel_obj,'right');fo_obj.widget_padding_bottom.value=getPadding(sel_obj,'bottom');fo_obj.widget_padding_top.value=getPadding(sel_obj,'top');var obj=sel_obj.firstChild;while(obj&&obj.className!="widgetContent")obj=obj.nextSibling;if(obj&&obj.className=="widgetContent")if(!fo_obj.document_srl||fo_obj.document_srl.value==0)try{var content=Base64.decode(xInnerHtml(obj));content=editorReplacePath(content);get_by_id("content_fo").content.value=content;xe.Editors["1"].exec("SET_IR",[content])}catch(e){}};if(typeof (editorStart)!='undefined')editorStart(1,"module_srl","content",false,400)}
|
||||
function addContentWidget(fo_obj){var editor_sequence=fo_obj.getAttribute('editor_sequence'),mid=fo_obj.mid.value,module_srl=fo_obj.module_srl.value,document_srl=fo_obj.document_srl.value,content=editorGetContent(editor_sequence),params={editor_sequence:editor_sequence,content:content,module_srl:module_srl,document_srl:document_srl};if(/^\s*<p>.*<\/p>\s*$/i.test(params.content)){var lowerContent=params.content.toLowerCase(),idx=lowerContent.indexOf('</p>'),last_idx=lowerContent.lastIndexOf('</p>');if(idx>0&&last_idx>0&&idx==last_idx)params.content=content=params.content.replace(/^\s*<p>|<\/p>\s*$/ig,'')};exec_xml('widget','procWidgetInsertDocument',params,function(ret_obj,response_tags){if(!ret_obj||ret_obj.error!='0')return;var document_srl=ret_obj.document_srl,contentWidget=opener.jQuery('div.widgetOutput[widget=widgetContent][document_srl='+document_srl+']'),attr=[];if(contentWidget.size()>0)attr=contentWidget.get(0).attributes;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+'" document_srl="'+document_srl+'" widget="widgetContent"><button type="button" class="widgetResize"></button><button type="button" class="widgetResizeLeft"></button><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"></div>'+content+'</div><div class="widgetContent" style="display:none;width:1px;height:1px;overflow:hidden;"></div></div>',$tpl=jQuery(tpl);for(var i=0,l=attr.length;i<l;i++)if(!$tpl.attr(attr[i].name))$tpl.attr(attr[i].name,attr[i].value);tpl=jQuery('<div>').append($tpl).html();opener.doAddWidgetCode(tpl);window.close()},'document_srl'.split(','));return false}
|
||||
function doAddWidgetBox(){var tpl='<div class="widgetOutput" style="float:left;width:100%;height:20px;" widget="widgetBox" ><button type="button" class="widgetBoxResize"></button><button type="button" class="widgetBoxResizeLeft"></button><div class="widgetBoxBorder"><div class="nullWidget" style="width:100%;height:100px;"></div></div></div>';zonePageObj.innerHTML+=tpl}
|
||||
function doAddWidget(fo){var sel=fo.widget_list,idx=sel.selectedIndex,val=sel.options[idx].value,module_srl=fo.module_srl.value,url=request_uri.setQuery('module','widget').setQuery('act','dispWidgetGenerateCodeInPage').setQuery('selected_widget',val).setQuery('module_srl',module_srl);popopen(url,'GenerateWidgetCode')};var selectedWidget=null,writedText=null,checkDocumentWrite=false;window.document.write=window.document.writeln=function(str){if(checkDocumentWrite){writedText=str;return};if(str.match(/^<\//))return;if(!window.opera)str=str.replace(/&(?![#a-z0-9]+;)/g,"&");str=str.replace(/(<[a-z]+)/g,"$1 xmlns='http://www.w3.org/1999/xhtml'");var div=jQuery('<div>').html(str)[0],pos;pos=document.getElementsByTagName("*");pos=pos[pos.length-1];var nodes=div.childNodes;while(nodes.length)pos.parentNode.appendChild(nodes[0])}
|
||||
function doAddWidgetCode(widget_code){restoreWidgetButtons();var tmp=widget_code;while(tmp.indexOf("<!--#Meta:")>-1){var pos=tmp.indexOf("<!--#Meta:");tmp=tmp.substr(pos);var eos=tmp.indexOf("-->"),cssfile=tmp.substr(10,eos-10);if(cssfile.indexOf('.js')>-1){tmp=tmp.substr(eos);continue};if(!cssfile)break;tmp=tmp.substr(eos);var cssfile=request_uri+cssfile;if(typeof (document.createStyleSheet)=='undefined'){var css='<link rel="stylesheet" href="'+cssfile+'" />',dummy=xCreateElement("DIV");xInnerHtml(dummy,css);document.body.appendChild(dummy)}else document.createStyleSheet(cssfile,0)};checkDocumentWrite=true;var tmp=widget_code.toLowerCase();while(tmp.indexOf("<script")>-1){var pos=tmp.indexOf("<script");tmp=tmp.substr(pos);var length=tmp.indexOf("</script>")+9,script=widget_code.substr(pos,length);script=script.replace(/^<script([^>]*)>/i,'').replace(/<\/script>$/i,'');writedText=null;try{eval(script)}catch(e){};widget_code=widget_code.substr(0,pos)+writedText+widget_code.substr(pos+length);tmp=widget_code.toLowerCase()};var dummy=xCreateElement('div');xInnerHtml(dummy,widget_code);var obj=dummy.childNodes[0];if(selectedWidget&&selectedWidget.getAttribute("widget")){var o=jQuery('div.widget_inner',selectedWidget),n=jQuery('div.widget_inner',obj);if(n.size()==0)n=jQuery('div.nullWidget',obj);if(o.size()==0)o=jQuery('div.nullWidget',selectedWidget);n.html(o.html());selectedWidget.parentNode.insertBefore(obj,selectedWidget);selectedWidget.parentNode.removeChild(selectedWidget)}else get_by_id('zonePageContent').appendChild(obj);checkDocumentWrite=false;selectedWidget=null}
|
||||
function doCheckWidget(e){var evt=new xEvent(e);if(!evt.target)return;var obj=evt.target;selectedWidget=null;var pObj=obj.parentNode;while(pObj){if(pObj.id=="pageSizeLayer")return;pObj=pObj.parentNode};doHideWidgetSizeSetup();if(obj.className=='widgetSetup'){var p_obj=obj.parentNode.parentNode,widget=p_obj.getAttribute("widget");if(!widget)return;selectedWidget=p_obj;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+"&widgetstyle="+widgetstyle,'GenerateCodeInPage');return}else if(obj.className=='widgetStyle'){var p_obj=obj.parentNode.parentNode,widget=p_obj.getAttribute("widget"),widgetstyle=p_obj.getAttribute("widgetstyle");if(!widget)return;selectedWidget=p_obj;popopen(request_uri+"?module=widget&act=dispWidgetStyleGenerateCodeInPage&selected_widget="+widget+"&widgetstyle="+widgetstyle,'GenerateCodeInPage');return}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'),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));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(),value=p_obj.attributes[i].nodeValue;if(!value)continue;if(value&&typeof (value)=="string")value=value.replace(/\"/ig,'"');dummy.setAttribute(name,value)};if(xIE4Up)dummy.style["cssText"]=p_obj.style["cssText"];p_obj.parentNode.insertBefore(dummy,p_obj)};return}else if(obj.className=='widgetSize'||obj.className=='widgetBoxSize'){var p_obj=obj.parentNode.parentNode,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.parentNode,widget=p_obj.getAttribute("widget");if(confirm(confirm_delete_msg)){restoreWidgetButtons();p_obj.parentNode.removeChild(p_obj)};return};var p_obj=obj;while(p_obj){if(p_obj.className=='widgetOutput'){evt.cancelBubble=true;evt.returnValue=false;xPreventDefault(e);xStopPropagation(e);break};p_obj=p_obj.parentNode}}
|
||||
function completeCopyWidgetContent(ret_obj,response_tags,params,p_obj){var document_srl=ret_obj.document_srl,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(),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)}
|
||||
function completeDeleteWidgetContent(ret_obj,response_tags,params,p_obj){restoreWidgetButtons();p_obj.parentNode.removeChild(p_obj)}
|
||||
function doCheckWidgetDrag(e){var evt=new xEvent(e);if(!evt.target)return;var obj=evt.target;if(jQuery(obj).parents('#pageSizeLayer').size()>0)return;doHideWidgetSizeSetup();if(obj.className=='widgetSetup'||obj.className=='widgetStyle'||obj.className=='widgetCopy'||obj.className=='widgetBoxCopy'||obj.className=='widgetSize'||obj.className=='widgetBoxSize'||obj.className=='widgetRemove'||obj.className=='widgetBoxRemove')return;p_obj=obj;while(p_obj){if(p_obj.className=='widgetOutput'||p_obj.className=='widgetResize'||p_obj.className=='widgetResizeLeft'||p_obj.className=='widgetBoxResize'||p_obj.className=='widgetBoxResizeLeft'){widgetDragEnable(p_obj,widgetDragStart,widgetDrag,widgetDragEnd);widgetMouseDown(e);return};p_obj=p_obj.parentNode}}
|
||||
function _getInt(val){if(!val||val=="null")return 0;if(parseInt(val,10)==NaN)return 0;return parseInt(val,10)};var selectedSizeWidget=null
|
||||
function doShowWidgetSizeSetup(px,py,obj){var layer=jQuery('#pageSizeLayer'),form=layer.find('>form:first'),obj=jQuery(obj);if(!form.length)return;selectedSizeWidget=obj[0];var opts={widget_align:obj.css('float'),width:obj[0].style.width,height:obj[0].style.height,padding_left:_getInt(obj.attr('widget_padding_left')),padding_right:_getInt(obj.attr('widget_padding_right')),padding_top:_getInt(obj.attr('widget_padding_top')),padding_bottom:_getInt(obj.attr('widget_padding_bottom')),margin_left:_getInt(obj[0].style.marginLeft),margin_right:_getInt(obj[0].style.marginRight),margin_top:_getInt(obj[0].style.marginTop),margin_bottom:_getInt(obj[0].style.marginBottom),border_top_color:transRGB2Hex(obj[0].style.borderTopColor),border_top_thick:obj[0].style.borderTopWidth.replace(/px$/i,''),border_top_type:obj[0].style.borderTopStyle,border_bottom_color:transRGB2Hex(obj[0].style.borderBottomColor),border_bottom_thick:obj[0].style.borderBottomWidth.replace(/px$/i,''),border_bottom_type:obj[0].style.borderBottomStyle,border_right_color:transRGB2Hex(obj[0].style.borderRightColor),border_right_thick:obj[0].style.borderRightWidth.replace(/px$/i,''),border_right_type:obj[0].style.borderRightStyle,border_left_color:transRGB2Hex(obj[0].style.borderLeftColor),border_left_thick:obj[0].style.borderLeftWidth.replace(/px$/i,''),border_left_type:obj[0].style.borderLeftStyle,background_color:transRGB2Hex(obj[0].style.backgroundColor),background_image_url:obj[0].style.backgroundImage.replace(/^url\(/i,'').replace(/\)$/i,''),background_x:0,background_y:0,background_repeat:obj[0].style.backgroundRepeat},pos=obj[0].style.backgroundPosition;if(pos){pos=pos.split(' ');if(pos.length==2){opts.background_x=pos[0];opts.background_y=pos[1]}};layer.show();jQuery(function($){var $psLayer=$('#pageSizeLayer'),$backdrop=$('.x_modal-backdrop'),ww=$(window).width(),wh=$(window).height(),pw=$psLayer.width(),ph=$psLayer.height();if(ww>pw&&wh>ph){$backdrop.show();$psLayer.css({position:'fixed',top:wh/2-ph/2+'px',left:ww/2-pw/2+'px',width:'700px'})}else{$backdrop.hide();$psLayer.css({position:'static',top:'auto',left:'auto',width:'auto'})}});jQuery.each(opts,function(key,val){var el=form[0].elements[key];if(el){el.value=val;if(el.className.match(/\bcolor-indicator\b/))el.style.background=el.value='#'+el.value};if(el.tagName.toLowerCase()=="select")if(el.selectedIndex==-1)el.selectedIndex=0});try{form[0].elements[0].focus()}catch(e){}}
|
||||
function doHideWidgetSizeSetup(){jQuery('#pageSizeLayer, .x_modal-backdrop, .jPicker.Container').hide()};jQuery(function($){$(document).keydown(function(e){var $jpicker=$('.jPicker.Container:visible');if(e.which==27&&!$jpicker.length){doHideWidgetSizeSetup();return false}else if(e.which==27&&$jpicker.length){$jpicker.hide();return false}else return true})})
|
||||
function _getSize(value){if(!value)return 0;var type="px";if(value.lastIndexOf("%")>=0)type="%";var num=parseInt(value,10);if(num<1)return 0;if(type=="%"&&num>100)num=100;return""+num+type}
|
||||
function _getBorderStyle(fld_color,fld_thick,fld_type){var color=fld_color.value;color=color.replace(/^#/,'');if(!color){color='#FFFFFF'}else color='#'+color;var width=fld_thick.value;if(!width){width='0px'}else width=parseInt(width,10)+'px';var style=fld_type.options[fld_type.selectedIndex].value;if(!style)style='solid';var str=color+' '+width+' '+style;return str}
|
||||
function _getBGColorStyle(fld_color){var color=fld_color.replace(/^#/,'');if(!color){color='#FFFFFF'}else color='#'+color;return color}
|
||||
function doApplyWidgetSize(fo_obj){if(selectedSizeWidget){if(fo_obj.widget_align.selectedIndex==1){setFloat(selectedSizeWidget,'right')}else setFloat(selectedSizeWidget,'left');var width=_getSize(fo_obj.width.value);if(width)selectedSizeWidget.style.width=width;var height=_getSize(fo_obj.height.value);if(height&&height!="100%"){selectedSizeWidget.style.height=height}else{selectedSizeWidget.style.height='';var widgetBorder=xGetElementsByClassName('widgetBorder',selectedSizeWidget);for(var i=0;i<widgetBorder.length;i++){var obj=widgetBorder[i];obj.style.height=''}};selectedSizeWidget.style.borderTop=_getBorderStyle(fo_obj.border_top_color,fo_obj.border_top_thick,fo_obj.border_top_type);selectedSizeWidget.style.borderBottom=_getBorderStyle(fo_obj.border_bottom_color,fo_obj.border_bottom_thick,fo_obj.border_bottom_type);selectedSizeWidget.style.borderLeft=_getBorderStyle(fo_obj.border_left_color,fo_obj.border_left_thick,fo_obj.border_left_type);selectedSizeWidget.style.borderRight=_getBorderStyle(fo_obj.border_right_color,fo_obj.border_right_thick,fo_obj.border_right_type);selectedSizeWidget.style.marginTop=_getSize(fo_obj.margin_top.value);selectedSizeWidget.style.marginRight=_getSize(fo_obj.margin_right.value);selectedSizeWidget.style.marginBottom=_getSize(fo_obj.margin_bottom.value);selectedSizeWidget.style.marginLeft=_getSize(fo_obj.margin_left.value);if(!fo_obj.background_color.value||fo_obj.background_color.value=='transparent'){selectedSizeWidget.style.backgroundColor='transparent'}else selectedSizeWidget.style.backgroundColor=_getBGColorStyle(fo_obj.background_color.value);var image_url=fo_obj.background_image_url.value;if(image_url&&image_url!='none'){selectedSizeWidget.style.backgroundImage="url("+image_url+")"}else selectedSizeWidget.style.backgroundImage='none';switch(fo_obj.background_repeat.selectedIndex){case 1:selectedSizeWidget.style.backgroundRepeat='no-repeat';break;case 2:selectedSizeWidget.style.backgroundRepeat='repeat-x';break;case 3:selectedSizeWidget.style.backgroundRepeat='repeat-y';break;default:selectedSizeWidget.style.backgroundRepeat='repeat';break};selectedSizeWidget.style.backgroundPosition=fo_obj.background_x.value+' '+fo_obj.background_y.value;var borderObj=selectedSizeWidget.firstChild;while(borderObj){if(borderObj.nodeName=="DIV"&&(borderObj.className=="widgetBorder"||borderObj.className=="widgetBoxBorder")){var contentObj=borderObj.firstChild;while(contentObj){if(contentObj.nodeName=="DIV"){contentObj.style.padding="";var paddingLeft=_getSize(fo_obj.padding_left.value);if(paddingLeft){contentObj.style.paddingLeft=paddingLeft;selectedSizeWidget.setAttribute('widget_padding_left',paddingLeft)}else{contentObj.style.paddingLeft='';selectedSizeWidget.setAttribute('widget_padding_left','')};var paddingRight=_getSize(fo_obj.padding_right.value);if(paddingRight){contentObj.style.paddingRight=paddingRight;selectedSizeWidget.setAttribute('widget_padding_right',paddingRight)}else{contentObj.style.paddingRight='';selectedSizeWidget.setAttribute('widget_padding_right','')};var paddingTop=_getSize(fo_obj.padding_top.value);if(paddingTop){contentObj.style.paddingTop=paddingTop;selectedSizeWidget.setAttribute('widget_padding_top',paddingTop)}else{contentObj.style.paddingTop='';selectedSizeWidget.setAttribute('widget_padding_top','')};var paddingBottom=_getSize(fo_obj.padding_bottom.value);if(paddingBottom){contentObj.style.paddingBottom=paddingBottom;selectedSizeWidget.setAttribute('widget_padding_bottom',paddingBottom)}else{contentObj.style.paddingBottom='';selectedSizeWidget.setAttribute('widget_padding_bottom','')};break};contentObj=contentObj.nextSibling};break};borderObj=borderObj.nextSibling};selectedWidget=selectedSizeWidget;selectedSizeWidget=null;var widget=selectedWidget.getAttribute("widget"),params=new Array();for(var i=0;i<selectedWidget.attributes.length;i++){if(!selectedWidget.attributes[i].nodeName||!selectedWidget.attributes[i].nodeValue)continue;var name=selectedWidget.attributes[i].nodeName.toLowerCase();if(name=="contenteditable"||name=="id"||name=="src"||name=="widget"||name=="body"||name=="class"||name=="widget_width"||name=="widget_width_type"||name=="xdpx"||name=="xdpy"||name=="height")continue;var value=selectedWidget.attributes[i].nodeValue;if(!value||value=="Array")continue;params[name]=value};params.style=getStyle(selectedWidget);params.selected_widget=widget;params.module_srl=get_by_id("pageFo").module_srl.value;exec_xml('widget','procWidgetGenerateCodeInPage',params,function(ret_obj){doAddWidgetCode(ret_obj.widget_code)},new Array('error','message','widget_code','tpl','css_header'))};doHideWidgetSizeSetup()};var hideElements=new Array()
|
||||
function restoreWidgetButtons(){var widgetButton=get_by_id('widgetButton'),boxWidgetButton=get_by_id('widgetBoxButton');if(!widgetButton||!boxWidgetButton)return;widgetButton.style.visibility='hidden';get_by_id("zonePageContent").parentNode.appendChild(widgetButton);boxWidgetButton.style.visibility='hidden';get_by_id("zonePageContent").parentNode.appendChild(boxWidgetButton);for(var i=0;i<hideElements.length;i++){var obj=hideElements[0];obj.style.paddingTop=0};hideElements=new Array()}
|
||||
function showWidgetButton(name,obj){var widgetButton=get_by_id(name);if(!widgetButton)return;widgetButton.style.visibility='visible';obj.insertBefore(widgetButton,obj.firstChild)}
|
||||
function widgetSetup(evt){var e=new xEvent(evt),obj=e.target;if(jQuery(obj).is('.widgetButtons')||jQuery(obj).parents('.widgetButtons').size()>0)return;if(jQuery(obj).is('.buttonBox')||jQuery(obj).parents('.buttonBox').size()>0)return;var o=jQuery(obj).parents('.widgetOutput');if(o.size()==0){restoreWidgetButtons();return};obj=o.get(0);var widget=o.attr('widget');if(!widget)return;if(widget=='widgetBox'){restoreWidgetButtons();showWidgetButton('widgetBoxButton',obj)}else{restoreWidgetButtons();showWidgetButton('widgetButton',obj);var p_obj=obj.parentNode;if(p_obj)while(p_obj){if(p_obj.nodeName=='DIV'&&p_obj.getAttribute('widget')=='widgetBox'){showWidgetButton('widgetBoxButton',p_obj);break};p_obj=p_obj.parentNode}}};var widgetDragManager={obj:null,isDrag:false},widgetTmpObject=new Array(),widgetDisappear=0
|
||||
function widgetCreateTmpObject(obj){var id=obj.getAttribute('id');tmpObj=xCreateElement('DIV');tmpObj.id=id+'_tmp';tmpObj.className=obj.className;tmpObj.style.overflow='hidden';tmpObj.style.margin='0px';tmpObj.style.padding='0px';tmpObj.style.width=obj.style.width;tmpObj.style.display='none';tmpObj.style.position='absolute';tmpObj.style.opacity=1;tmpObj.style.filter='alpha(opacity=100)';xLeft(tmpObj,xPageX(obj));xTop(tmpObj,xPageY(obj));document.body.appendChild(tmpObj);widgetTmpObject[obj.id]=tmpObj;return tmpObj};var idStep=0
|
||||
function widgetGetTmpObject(obj){if(!obj.id)obj.id='widget_'+ idStep++;var tmpObj=widgetTmpObject[obj.id];if(!tmpObj)tmpObj=widgetCreateTmpObject(obj);return tmpObj}
|
||||
function widgetDragEnable(obj,funcDragStart,funcDrag,funcDragEnd){obj.draggable=true;obj.dragStart=funcDragStart;obj.drag=funcDrag;obj.dragEnd=funcDragEnd;if(!widgetDragManager.isDrag){widgetDragManager.isDrag=true;xAddEventListener(document,'mousemove',widgetDragMouseMove,false)}}
|
||||
function widgetDragStart(tobj,px,py){if(tobj.className=='widgetResize'||tobj.className=='widgetResizeLeft'||tobj.className=='widgetBoxResize'||tobj.className=='widgetBoxResizeLeft')return;var obj=widgetGetTmpObject(tobj);xInnerHtml(obj,xInnerHtml(tobj));xLeft(obj,xPageX(tobj));xTop(obj,xPageY(tobj));xWidth(obj,xWidth(tobj));xHeight(obj,xHeight(tobj));xDisplay(obj,'block')}
|
||||
function widgetDrag(tobj,dx,dy){var minWidth=40,minHeight=10,sx=xPageX(tobj.parentNode),sy=xPageY(tobj.parentNode),nx=tobj.xDPX,ny=tobj.xDPY,zoneWidth=xWidth(zonePageObj),zoneLeft=xPageX(zonePageObj),zoneRight=zoneLeft+zoneWidth,pWidth=xWidth(tobj.parentNode),cssFloat=getFloat(tobj.parentNode);if(!cssFloat)cssFloat='left';if(tobj.className=='widgetResize'||tobj.className=='widgetBoxResize'){if(nx<sx+minWidth)nx=sx+minWidth;if(nx>zoneRight)nx=zoneRight;if(cssFloat=='right')nx=sx+pWidth;var new_width=nx-sx;if(new_width<minWidth)new_width=minWidth;var new_height=ny-sy;if(new_height<minHeight)new_height=minHeight;if(zoneRight<sx+new_width)new_width=zoneRight-sx;xWidth(tobj.parentNode,new_width);xHeight(tobj.parentNode,new_height)}else if(tobj.className=='widgetResizeLeft'||tobj.className=='widgetBoxResizeLeft'){if(nx<zoneLeft)nx=zoneLeft;if(cssFloat=='left')nx=sx;var new_width=pWidth+(sx-nx);if(new_width<minWidth)new_width=minWidth;var new_height=ny-sy;if(new_height<minHeight)new_height=minHeight;xWidth(tobj.parentNode,new_width);xHeight(tobj.parentNode,new_height)}else{var obj=widgetGetTmpObject(tobj);xLeft(obj,parseInt(xPageX(obj),10)+parseInt(dx,10));xTop(obj,parseInt(xPageY(obj),10)+parseInt(dy,10));if(tobj.parentNode!=zonePageObj){var widgetList=xGetElementsByClassName("widgetOutput",tobj.parentNode);for(var i=0;i<widgetList.length;i++){var target_obj=widgetList[i],l=xPageX(target_obj),t=xPageY(target_obj),ll=parseInt(l,10)+parseInt(xWidth(target_obj),10),tt=parseInt(t,10)+parseInt(xHeight(target_obj),10);if(tobj!=target_obj&&tobj.xDPX>=l&&tobj.xDPX<=ll&&tobj.xDPY>=t&&tobj.xDPY<=tt&&tobj.parentNode==target_obj.parentNode){var next1=target_obj.nextSibling;if(!next1){next1=xCreateElement("DIV");target_obj.parentNode.appendChild(next1)};var next2=tobj.nextSibling;if(!next2){next2=xCreateElement("DIV");tobj.parentNode.appendChild(next2)};if(next1)next1.parentNode.insertBefore(tobj,next1);if(next2)next2.parentNode.insertBefore(target_obj,next2);widgetList=null;return}};widgetList=null;var p_tobj=jQuery(tobj).parents('div.nullWidget').get(0),l=xPageX(p_tobj),t=xPageY(p_tobj),ll=parseInt(l,10)+parseInt(xWidth(p_tobj),10),tt=parseInt(t,10)+parseInt(xHeight(p_tobj),10);if((tobj.xDPX<l||tobj.xDPX>ll)||(tobj.xDPY<t||tobj.xDPY>tt)){zonePageObj.insertBefore(tobj,jQuery(tobj).parents('div.widgetOutput[widget=widgetBox]').get(0));return}}else{if(tobj.getAttribute("widget")!="widgetBox"){var boxList=xGetElementsByClassName("nullWidget",zonePageObj);for(var i=0;i<boxList.length;i++){var target_obj=boxList[i];xHeight(target_obj,xHeight(target_obj.parentNode));xWidth(target_obj,xWidth(target_obj.parentNode));var l=xPageX(target_obj),t=xPageY(target_obj),ll=parseInt(l,10)+parseInt(xWidth(target_obj),10),tt=parseInt(t,10)+parseInt(xHeight(target_obj),10);if(tobj.xDPX>=l&&tobj.xDPX<=ll&&tobj.xDPY>=t&&tobj.xDPY<=tt)if(target_obj.className=="nullWidget"){var wb_ws=jQuery('div.widget_inner',jQuery(target_obj));if(wb_ws.size()==0){target_obj.appendChild(tobj)}else wb_ws.get(0).appendChild(tobj);widgetManualEnd();boxList=null;return}};boxList=null};var widgetList=xGetElementsByClassName("widgetOutput",zonePageObj);for(var i=0;i<widgetList.length;i++){var target_obj=widgetList[i],widget=target_obj.getAttribute("widget");if(widget=='widgetBox'||target_obj.parentNode!=zonePageObj)continue;var l=xPageX(target_obj),t=xPageY(target_obj),ll=parseInt(l,10)+parseInt(xWidth(target_obj),10),tt=parseInt(t,10)+parseInt(xHeight(target_obj),10);if(tobj!=target_obj&&tobj.xDPX>=l&&tobj.xDPX<=ll&&tobj.xDPY>=t&&tobj.xDPY<=tt&&tobj.parentNode==target_obj.parentNode){var next1=target_obj.nextSibling;if(!next1)next1=target_obj.parentNode.lastChild;if(!next1){next1=xCreateElement("DIV");target_obj.parentNode.appendChild(next1)};var next2=tobj.nextSibling;if(!next2){next2=xCreateElement("DIV");tobj.parentNode.appendChild(next2)};if(next1)next1.parentNode.insertBefore(tobj,next1);if(next2)next2.parentNode.insertBefore(target_obj,next2);widgetList=null;return}};widgetList=null}}}
|
||||
function widgetDragEnd(tobj,px,py){var obj=widgetGetTmpObject(tobj);widgetDisapear=widgetDisapearObject(obj,tobj);widgetDragDisable(tobj.getAttribute('id'))}
|
||||
function widgetDisapearObject(obj,tobj){xInnerHtml(tobj,xInnerHtml(obj));xInnerHtml(obj,'');xDisplay(obj,'none');obj.parentNode.removeChild(obj);widgetTmpObject[tobj.id]=null;return}
|
||||
function widgetMouseDown(e){var evt=new xEvent(e),obj=evt.target;while(obj&&!obj.draggable)obj=xParent(obj,true);if(obj){xPreventDefault(e);obj.xDPX=evt.pageX;obj.xDPY=evt.pageY;widgetDragManager.obj=obj;xAddEventListener(document,'mouseup',widgetMouseUp,false);if(obj.dragStart)obj.dragStart(obj,evt.pageX,evt.pageY)}}
|
||||
function widgetMouseUp(e){if(widgetDragManager.obj){xPreventDefault(e);xRemoveEventListener(document,'mouseup',widgetMouseUp,false);if(widgetDragManager.obj.dragEnd){var evt=new xEvent(e);widgetDragManager.obj.dragEnd(widgetDragManager.obj,evt.pageX,evt.pageY)};widgetDragManager.obj=null;widgetDragManager.isDrag=false}}
|
||||
function widgetDragMouseMove(e){var evt=new xEvent(e);if(widgetDragManager.obj){xPreventDefault(e);var obj=widgetDragManager.obj,dx=evt.pageX-obj.xDPX,dy=evt.pageY-obj.xDPY;obj.xDPX=evt.pageX;obj.xDPY=evt.pageY;if(obj.drag){obj.drag(obj,dx,dy)}else xMoveTo(obj,xLeft(obj)+dx,xTop(obj)+dy)}}
|
||||
function widgetDragDisable(id){if(!widgetDragManager)return;var obj=get_by_id(id);obj.draggable=false;obj.dragStart=null;obj.drag=null;obj.dragEnd=null;xRemoveEventListener(obj,'mousedown',widgetMouseDown,false);return}
|
||||
function widgetManualEnd(){var tobj=widgetDragManager.obj;if(!tobj)return;xRemoveEventListener(document,'mouseup',widgetMouseUp,false);xAddEventListener(document,'mousemove',widgetDragMouseMove,false);var obj=widgetGetTmpObject(tobj);widgetDisapear=widgetDisapearObject(obj,tobj);widgetDragDisable(tobj.getAttribute('id'));widgetDragManager.obj=null;widgetDragManager.isDrag=false}
|
||||
|
|
@ -1,86 +1,81 @@
|
|||
<load target="../../admin/tpl/css/admin.css" usecdn="true" />
|
||||
<h1 class="h1">{$skin_info->title}</h1>
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<col width="100" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row"><label for="textfield1">{$lang->title}</label></th>
|
||||
<td>{$skin_info->title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="textfield2">{$lang->author}</label></th>
|
||||
<td class="blue">
|
||||
<!--@foreach($skin_info->author as $author)-->
|
||||
{$author->name} <!--@if($author->homepage || $author->email_address)-->(<!--@if($author->homepage)--><a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a><!--@end--><!--@if($author->homepage && $author->email_address)-->, <!--@end--><!--@if($author->email_address)--><a href="mailto:{$author->email_address}">{$author->email_address}</a><!--@end-->)<!--@end--><br />
|
||||
<!--@endforeach-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@if($skin_info->homepage)-->
|
||||
<tr>
|
||||
<th scope="row"><label for="textfield2">{$lang->homepage}</label></th>
|
||||
<td class="blue"><a href="{$skin_info->homepage}" onclick="window.open(this.href);return false;">{$skin_info->homepage}</a></td>
|
||||
</tr>
|
||||
<!--@endif-->
|
||||
<tr>
|
||||
<th scope="row"><label for="textfield2">{$lang->regdate}</label></th>
|
||||
<td>{zdate($skin_info->date, 'Y-m-d')}</td>
|
||||
</tr>
|
||||
<!--@if($skin_info->license || $skin_info->license_link)-->
|
||||
<tr>
|
||||
<th scope="row">{$lang->skin_license}</th>
|
||||
<td>
|
||||
{nl2br(trim($skin_info->license))}
|
||||
<!--@if($skin_info->license_link)-->
|
||||
<p><a href="{$skin_info->license_link}" onclick="window.close(); return false;">{$skin_info->license_link}</a></p>
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<!--@if($skin_info->description)-->
|
||||
<tr>
|
||||
<th scope="row" class="borderBottomNone">{$lang->description}</th>
|
||||
<td class="borderBottomNone">{nl2br(trim($skin_info->description))}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</table>
|
||||
</div>
|
||||
<h1>{$skin_info->title}</h1>
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<col width="100" />
|
||||
<col />
|
||||
<tr>
|
||||
<th scope="row"><label for="textfield1">{$lang->title}</label></th>
|
||||
<td>{$skin_info->title}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><label for="textfield2">{$lang->author}</label></th>
|
||||
<td class="blue">
|
||||
<!--@foreach($skin_info->author as $author)-->
|
||||
{$author->name} <!--@if($author->homepage || $author->email_address)-->(<!--@if($author->homepage)--><a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a><!--@end--><!--@if($author->homepage && $author->email_address)-->, <!--@end--><!--@if($author->email_address)--><a href="mailto:{$author->email_address}">{$author->email_address}</a><!--@end-->)<!--@end--><br />
|
||||
<!--@endforeach-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@if($skin_info->homepage)-->
|
||||
<tr>
|
||||
<th scope="row"><label for="textfield2">{$lang->homepage}</label></th>
|
||||
<td class="blue"><a href="{$skin_info->homepage}" onclick="window.open(this.href);return false;">{$skin_info->homepage}</a></td>
|
||||
</tr>
|
||||
<!--@endif-->
|
||||
<tr>
|
||||
<th scope="row"><label for="textfield2">{$lang->regdate}</label></th>
|
||||
<td>{zdate($skin_info->date, 'Y-m-d')}</td>
|
||||
</tr>
|
||||
<!--@if($skin_info->license || $skin_info->license_link)-->
|
||||
<tr>
|
||||
<th scope="row">{$lang->skin_license}</th>
|
||||
<td>
|
||||
{nl2br(trim($skin_info->license))}
|
||||
<!--@if($skin_info->license_link)-->
|
||||
<p><a href="{$skin_info->license_link}" onclick="window.close(); return false;">{$skin_info->license_link}</a></p>
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<!--@if($skin_info->description)-->
|
||||
<tr>
|
||||
<th scope="row" class="borderBottomNone">{$lang->description}</th>
|
||||
<td class="borderBottomNone">{nl2br(trim($skin_info->description))}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
</table>
|
||||
|
||||
<!--@if($skin_info->history)-->
|
||||
<h1 class="h1">{$lang->skin_history}</h1>
|
||||
<h1>{$lang->skin_history}</h1>
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<col width="100" />
|
||||
<col />
|
||||
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<col width="100" />
|
||||
<col />
|
||||
|
||||
<!--@foreach($skin_info->history as $history)-->
|
||||
<tr>
|
||||
<th scope="row">
|
||||
{$history->version}<br />
|
||||
{$history->date}
|
||||
</th>
|
||||
<td>
|
||||
<!--@foreach($history->author as $author)-->
|
||||
<p>{$author->name} (<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a> / <a href="mailto:{$author->email_address}">{$author->email_address}</a>)</p>
|
||||
<!--@endforeach-->
|
||||
<!--@if($history->description)-->
|
||||
<p>{nl2br(trim($history->description))}</p>
|
||||
<!--@endif-->
|
||||
<!--@if($history->logs)-->
|
||||
<ul>
|
||||
<!--@foreach($history->logs as $log)-->
|
||||
<!--@if($log->link)-->
|
||||
<li><a href="{$log->link}">{$log->text}</a></li>
|
||||
<!--@else-->
|
||||
<li>{$log->text}</li>
|
||||
<!--@endif-->
|
||||
<!--@endforeach-->
|
||||
</ul>
|
||||
<!--@endif-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@endforeach-->
|
||||
</table>
|
||||
</div>
|
||||
<!--@foreach($skin_info->history as $history)-->
|
||||
<tr>
|
||||
<th scope="row">
|
||||
{$history->version}<br />
|
||||
{$history->date}
|
||||
</th>
|
||||
<td>
|
||||
<!--@foreach($history->author as $author)-->
|
||||
<p>{$author->name} (<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a> / <a href="mailto:{$author->email_address}">{$author->email_address}</a>)</p>
|
||||
<!--@endforeach-->
|
||||
<!--@if($history->description)-->
|
||||
<p>{nl2br(trim($history->description))}</p>
|
||||
<!--@endif-->
|
||||
<!--@if($history->logs)-->
|
||||
<ul>
|
||||
<!--@foreach($history->logs as $log)-->
|
||||
<!--@if($log->link)-->
|
||||
<li><a href="{$log->link}">{$log->text}</a></li>
|
||||
<!--@else-->
|
||||
<li>{$log->text}</li>
|
||||
<!--@endif-->
|
||||
<!--@endforeach-->
|
||||
</ul>
|
||||
<!--@endif-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@endforeach-->
|
||||
</table>
|
||||
<!--@endif-->
|
||||
|
|
|
|||
|
|
@ -1,80 +1,76 @@
|
|||
<load target="css/widget.css" usecdn="true" />
|
||||
<load target="../../admin/tpl/css/admin.css" usecdn="true" />
|
||||
|
||||
<h1 class="h1">{$lang->widget}</h1>
|
||||
<h2 class="h2">{$lang->widget_maker}</h2>
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->title}</div></th>
|
||||
<td>{$widget_info->title} ver {$widget_info->version}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->author}</div></th>
|
||||
<td>
|
||||
<!--@foreach($widget_info->author as $author)-->
|
||||
{$author->name} <!--@if($author->homepage || $author->email_address)-->(<!--@if($author->homepage)--><a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a><!--@end--><!--@if($author->homepage && $author->email_address)-->, <!--@end--><!--@if($author->email_address)--><a href="mailto:{$author->email_address}">{$author->email_address}</a><!--@end-->)<!--@end--><br />
|
||||
<!--@endforeach-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@if($widget_info->homepage)-->
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->homepage}</div></th>
|
||||
<td><a href="{$widget_info->homepage}" onclick="window.open(this.href);return false;">{$widget_info->homepage}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->regdate}</div></th>
|
||||
<td>{zdate($widget_info->date, 'Y-m-d')}</td>
|
||||
</tr>
|
||||
<!--@if($widget_info->license || $widget_info->license_link)-->
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->widget_license}</div></th>
|
||||
<td>
|
||||
{nl2br(trim($widget_info->license))}
|
||||
<!--@if($widget_info->license_link)-->
|
||||
<p><a href="{$widget_info->license_link}" onclick="window.close(); return false;">{$widget_info->license_link}</a></p>
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr><!--@end-->
|
||||
<h1>{$lang->widget}</h1>
|
||||
<h2>{$lang->widget_maker}</h2>
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->title}</div></th>
|
||||
<td>{$widget_info->title} ver {$widget_info->version}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->author}</div></th>
|
||||
<td>
|
||||
<!--@foreach($widget_info->author as $author)-->
|
||||
{$author->name} <!--@if($author->homepage || $author->email_address)-->(<!--@if($author->homepage)--><a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a><!--@end--><!--@if($author->homepage && $author->email_address)-->, <!--@end--><!--@if($author->email_address)--><a href="mailto:{$author->email_address}">{$author->email_address}</a><!--@end-->)<!--@end--><br />
|
||||
<!--@endforeach-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@if($widget_info->homepage)-->
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->homepage}</div></th>
|
||||
<td><a href="{$widget_info->homepage}" onclick="window.open(this.href);return false;">{$widget_info->homepage}</a></td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->regdate}</div></th>
|
||||
<td>{zdate($widget_info->date, 'Y-m-d')}</td>
|
||||
</tr>
|
||||
<!--@if($widget_info->license || $widget_info->license_link)-->
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->widget_license}</div></th>
|
||||
<td>
|
||||
{nl2br(trim($widget_info->license))}
|
||||
<!--@if($widget_info->license_link)-->
|
||||
<p><a href="{$widget_info->license_link}" onclick="window.close(); return false;">{$widget_info->license_link}</a></p>
|
||||
<!--@end-->
|
||||
</td>
|
||||
</tr><!--@end-->
|
||||
<!--@if($widget_info->description)-->
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->description}</div></th>
|
||||
<td>{nl2br(trim($widget_info->description))}</td>
|
||||
</tr><!--@end-->
|
||||
</table>
|
||||
</div>
|
||||
<tr>
|
||||
<th scope="row"><div>{$lang->description}</div></th>
|
||||
<td>{nl2br(trim($widget_info->description))}</td>
|
||||
</tr><!--@end-->
|
||||
</table>
|
||||
|
||||
<!--@if($widget_info->history)-->
|
||||
<h1 class="h1">{$lang->widget_history}</h1>
|
||||
<h1>{$lang->widget_history}</h1>
|
||||
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<!--@foreach($widget_info->history as $history)-->
|
||||
<tr>
|
||||
<th scope="row"><div>
|
||||
{$history->version}<br />
|
||||
{$history->date}
|
||||
</div></th>
|
||||
<td>
|
||||
<!--@if($history->author)-->
|
||||
<!--@foreach($history->author as $author)-->
|
||||
<p>{$author->name} (<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a> / <a href="mailto:{$author->email_address}">{$author->email_address}</a>)</p>
|
||||
<!--@endforeach-->
|
||||
<!--@endif-->
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<!--@foreach($widget_info->history as $history)-->
|
||||
<tr>
|
||||
<th scope="row"><div>
|
||||
{$history->version}<br />
|
||||
{$history->date}
|
||||
</div></th>
|
||||
<td>
|
||||
<!--@if($history->author)-->
|
||||
<!--@foreach($history->author as $author)-->
|
||||
<p>{$author->name} (<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a> / <a href="mailto:{$author->email_address}">{$author->email_address}</a>)</p>
|
||||
<!--@endforeach-->
|
||||
<!--@endif-->
|
||||
|
||||
<!--@if($history->description)-->
|
||||
<p>{nl2br(trim($history->description))}</p>
|
||||
<!--@endif-->
|
||||
<!--@if($history->description)-->
|
||||
<p>{nl2br(trim($history->description))}</p>
|
||||
<!--@endif-->
|
||||
|
||||
<!--@if($history->logs)-->
|
||||
<ul>
|
||||
<!--@foreach($history->logs as $log)--><li>{$log->text}</li><!--@endforeach-->
|
||||
</ul>
|
||||
<!--@endif-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@endforeach-->
|
||||
</table>
|
||||
</div>
|
||||
<!--@if($history->logs)-->
|
||||
<ul>
|
||||
<!--@foreach($history->logs as $log)--><li>{$log->text}</li><!--@endforeach-->
|
||||
</ul>
|
||||
<!--@endif-->
|
||||
</td>
|
||||
</tr>
|
||||
<!--@endforeach-->
|
||||
</table>
|
||||
<!--@endif-->
|
||||
|
|
|
|||
|
|
@ -1,103 +0,0 @@
|
|||
<block cond="$use_filebox">
|
||||
<style type="text/css">
|
||||
.filebox_item { border: 1px solid #ccc!important; padding: 5px; max-height: 200px; max-width: 200px; }
|
||||
</style>
|
||||
|
||||
<div class="modal" id="modalFilebox">
|
||||
<div class="fg portlet">
|
||||
<h2 class="h2">FileBox</h2>
|
||||
<div class="filebox_list"></div>
|
||||
<h2 class="h2">Upload</h2>
|
||||
<form id="filebox_upload" class="form" action="./" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="module" value="module" />
|
||||
<input type="hidden" name="act" value="procModuleFileBoxAdd" />
|
||||
<input type="hidden" name="ajax" value="true" />
|
||||
<table cellspacing="0" id="attributes">
|
||||
<tr>
|
||||
<td>
|
||||
<label for="attribute_name1">{$lang->attribute_name} </label><input type="text" name="attribute_name1" id="attribute_name1" />
|
||||
</td>
|
||||
<td>
|
||||
<label for="attribute_value1">{$lang->attribute_value} </label><input type="text" name="attribute_value1" id="attribute_value1" />
|
||||
</td>
|
||||
<td><a href="javascript:addRow('attributes')">{$lang->add}</a></td>
|
||||
<td><a href="javascript:clearRow('attributes',1)">{$lang->delete}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<label for="file">{$lang->file}</label><input type="file" name="addfile" id="file"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="btnArea">
|
||||
<span class="btn small"><input type="submit" value="{$lang->cmd_submit}" /></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
xe.lang.cmd_delete = '{$lang->cmd_delete}';
|
||||
function addRow(tableID){
|
||||
|
||||
var table = document.getElementById(tableID);
|
||||
var rowCount = table.rows.length;
|
||||
var initial = table.rows(0);
|
||||
var text1 = initial.cells(0).children(0).innerHTML;
|
||||
var text2 = initial.cells(1).children(0).innerHTML;
|
||||
var addrow = table.rows(rowCount-2).cells(2).children(0);
|
||||
var deleteLink = table.rows(rowCount-2).cells(3).children(0).cloneNode(true);
|
||||
var row = table.insertRow(rowCount-1);
|
||||
|
||||
//cell for attribute name
|
||||
var cell0= row.insertCell(0)
|
||||
var element0 = document.createElement("label");
|
||||
element0.innerHTML = text1;
|
||||
element0.htmlFor = "attribute_name"+rowCount;
|
||||
cell0.appendChild(element0);
|
||||
var element1 = document.createElement("input");
|
||||
element1.type = "text";
|
||||
element1.name="attribute_name"+rowCount;
|
||||
element1.id="attribute_name"+rowCount;
|
||||
cell0.appendChild(element1);
|
||||
|
||||
//cell for attribute value
|
||||
var cell1 = row.insertCell(1);
|
||||
var element2 = document.createElement("label");
|
||||
element2.innerHTML = text2;
|
||||
element2.htmlFor = "attribute_value"+rowCount;
|
||||
cell1.appendChild(element2);
|
||||
var element3 = document.createElement("input");
|
||||
element3.type = "text";
|
||||
element3.id="attribute_value"+rowCount;
|
||||
element3.name="attribute_value"+rowCount;
|
||||
cell1.appendChild(element3);
|
||||
|
||||
//cell for addrow link
|
||||
var cell2 = row.insertCell(2);
|
||||
cell2.appendChild(addrow);
|
||||
|
||||
//cell for delete link
|
||||
var cell3 = row.insertCell(3);
|
||||
deleteLink.href = "javascript:clearRow('attributes',"+rowCount+")";
|
||||
cell3.appendChild(deleteLink);
|
||||
}
|
||||
|
||||
function clearRow(tableID,rowNumber){
|
||||
var table = document.getElementById(tableID);
|
||||
var text = "attribute_name"+rowNumber;
|
||||
var rowCount = table.rows.length;
|
||||
var sw = 0;
|
||||
for(i=0;i<rowCount-2;i++){
|
||||
if(table.rows(i).cells[0].children(1).id == text) {
|
||||
table.deleteRow(i);
|
||||
sw = 1;
|
||||
}
|
||||
}
|
||||
if(!sw){
|
||||
var addrow = table.rows(rowCount-2).cells(2).children(0);
|
||||
table.rows(rowCount-3).cells(2).appendChild(addrow);
|
||||
table.deleteRow(rowCount-2);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</block>
|
||||
|
|
@ -1,25 +1,19 @@
|
|||
<include cond="$in_admin" target="header.html" />
|
||||
<load target="js/generate_code.js" usecdn="true" />
|
||||
|
||||
<h2 class="h2">{$widget_info->title}</h2>
|
||||
<p>{$widget_info->description}</p>
|
||||
<form id="widget_code_form" class="form" action="./" method="post">
|
||||
<div class="x_alert x_alert-info" id="widgetInfo" hidden><p>{$widget_info->description}</p></div>
|
||||
<div class="x_alert x_alert-info" id="codeHelp" hidden><p>{$lang->about_widget_code}</p></div>
|
||||
<form id="widget_code_form" class="x_form-horizontal" action="./" method="post">
|
||||
<input type="hidden" name="module" value="widget" />
|
||||
<input type="hidden" name="act" value="procWidgetGenerateCode" />
|
||||
<input type="hidden" name="selected_widget" value="{$widget_info->widget}" />
|
||||
|
||||
<h3 class="h3">{$lang->cmd_generate_code}</h3>
|
||||
<p>{$lang->about_widget_code}</p>
|
||||
<include target="widget_generate_code.include.html" />
|
||||
|
||||
<div class="btnArea">
|
||||
<span class="btn small"><input type="submit" value="{$lang->cmd_generate_code}" /></span>
|
||||
<div class="x_clearfix btnArea">
|
||||
<a href="{getUrl('', 'module', 'admin', 'act', 'dispWidgetAdminDownloadedList')}" class="x_btn x_pull-left">{$lang->cmd_list}</a>
|
||||
<input type="submit" class="x_btn x_btn-primary" value="{$lang->cmd_generate_code}" />
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<h3 class="h3">{$lang->widget_code}</h3>
|
||||
<p><textarea id="widget_code" rows="8" cols="42" style="width: 100%; height: 50px;" readonly="readonly"></textarea>
|
||||
|
||||
<include target="widget_generate_code.filebox.html" />
|
||||
<include target="widget_generate_code.multilang.html" />
|
||||
<include target="widget_generate_code.multilang.textarea.html" />
|
||||
<div class="x_well">
|
||||
<h3>{$lang->widget_code}</h3>
|
||||
<p style="margin-right:14px"><textarea id="widget_code" rows="4" cols="42" style="width:100%;cursor:text;font-family:'Courier New', Courier, monospace" readonly="readonly"></textarea>
|
||||
</div>
|
||||
<include target="../../module/tpl/include.filebox.html" />
|
||||
|
|
|
|||
|
|
@ -1,69 +1,53 @@
|
|||
<load target="js/multi_order.js" usecdn="true" />
|
||||
<load target="js/module_list.js" usecdn="true" />
|
||||
<load target="js/mid.js" usecdn="true" />
|
||||
<load target="js/multi_lang.js" usecdn="true" />
|
||||
<load target="../../module/tpl/js/multi_order.js" usecdn="true" />
|
||||
<load target="../../module/tpl/js/module_list.js" usecdn="true" />
|
||||
<load target="../../module/tpl/js/mid.js" usecdn="true" />
|
||||
<!--%load_js_plugin("ui.colorpicker")-->
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<p class="q"><label for="skin">{$lang->skin}</label></p>
|
||||
<p class="a">
|
||||
<select name="skin" id="skin" style="width:280px">
|
||||
<option value="">{$lang->select}</option>
|
||||
<option loop="$skin_list => $skin_name, $skin" value="{$skin_name}">{$skin->title} ({$skin_name})</option>
|
||||
</select>
|
||||
<input type="button" value="{$lang->cmd_select}" />
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="colorset">{$lang->colorset}</label></p>
|
||||
<p class="a">
|
||||
<select name="colorset" id="widget_colorset" style="width:280px">
|
||||
</select>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q"><label for="widget_cache">{$lang->widget_cache}</label></p>
|
||||
<p class="a">
|
||||
<input type="text" name="widget_cache" id="widget_cache" value="0" size="2" style="width:auto" /> {$lang->unit_min}
|
||||
({$lang->about_widget_cache})
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="skin">{$lang->skin}</label>
|
||||
<div class="x_controls">
|
||||
<select name="skin" id="skin">
|
||||
<option value="">{$lang->select}</option>
|
||||
<option loop="$skin_list => $skin_name, $skin" value="{$skin_name}">{$skin->title}({$skin_name})</option>
|
||||
</select>
|
||||
<input type="button" class="x_btn" value="{$lang->cmd_select}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="colorset">{$lang->colorset}</label>
|
||||
<div class="x_controls">
|
||||
<select name="colorset" id="widget_colorset">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="widget_cache">{$lang->widget_cache}</label>
|
||||
<div class="x_controls">
|
||||
<input type="number" name="widget_cache" id="widget_cache" value="0" size="2" /> {$lang->unit_min}
|
||||
<p class="x_help-inline">{$lang->about_widget_cache}</p>
|
||||
</div>
|
||||
</div>
|
||||
{@$suggestion_id = 0}
|
||||
<block loop="$widget_info->extra_var => $id, $var">
|
||||
{@$suggestion_id++}
|
||||
<block cond="!$not_first && !$var->group"><ul class="extra_vars"></block>
|
||||
<block cond="!$not_first && !$var->group"><section class="extra_vars section"></block>
|
||||
<block cond="$group != $var->group">
|
||||
<block cond="$not_first"></ul></block>
|
||||
<h3 class="h3">{$var->group}</h3>
|
||||
<ul class="extra_vars">
|
||||
<block cond="$not_first"></section></block>
|
||||
<section class="extra_vars section">
|
||||
<h1>{$var->group}</h1>
|
||||
{@$group = $var->group}
|
||||
</block>
|
||||
{@$not_first = true}
|
||||
<li class="moduleSearch moduleSearch1 modulefinder"|cond="$var->type == 'mid' || $var->type == 'module_srl_list'">
|
||||
<p class="q"><label for="{$id}">{$var->name}</label></p>
|
||||
<div class="a">
|
||||
<div cond="$var->type == 'text'" class="multiLangEdit">
|
||||
{@$use_multilang = true}
|
||||
<input type="hidden" name="{$id}" value="" class="vLang" />
|
||||
<input type="text" id="{$id}" class="vLang" />
|
||||
<span class="desc"><a href="#langEdit" class="editUserLang tgAnchor">{$lang->cmd_set_multilingual}</a></span>
|
||||
<script type="text/javascript">
|
||||
xe.registerApp(new xe.MultiLangManager('{$id}'));
|
||||
</script>
|
||||
<div class="x_control-group <!--@if($var->type == 'mid' || $var->type == 'module_srl_list')-->moduleSearch moduleSearch1 modulefinder<!--@end-->">
|
||||
<label class="x_control-label" for="{$id}">{$var->name}</label>
|
||||
<div class="x_controls">
|
||||
<div cond="$var->type == 'text'">
|
||||
<input type="text" name="{$id}" />
|
||||
</div>
|
||||
<input cond="$var->type == 'color'" type="text" name="{$id}" value="" id="{$id}" class="color-indicator" />
|
||||
<div cond="$var->type == 'textarea'" class="multiLangEdit">
|
||||
{@$use_multilang_textarea = true}
|
||||
<input type="hidden" name="{$id}" value="" class="vLang" />
|
||||
<textarea cond="$var->type == 'textarea'" id="{$id}" class="vLang" rows="8" cols="42"></textarea>
|
||||
<span class="desc"><a href="#langEditTextarea" class="editUserLang tgAnchor">{$lang->cmd_set_multilingual}</a></span>
|
||||
<script type="text/javascript">
|
||||
xe.registerApp(new xe.MultiLangManager('{$id}'));
|
||||
</script>
|
||||
<input cond="$var->type == 'color'" type="text" name="{$id}" value="" id="{$id}" class="color-indicator" style="width:178px" />
|
||||
<div cond="$var->type == 'textarea'">
|
||||
<textarea cond="$var->type == 'textarea'" name="{$id}" id="{$id}" rows="8" cols="42"></textarea>
|
||||
</div>
|
||||
<select cond="$var->type == 'select'" name="{$id}" id="{$id}" style="width:290px">
|
||||
<select cond="$var->type == 'select'" name="{$id}" id="{$id}">
|
||||
<option loop="$var->options => $key, $val" value="{$key}">{$val}</option>
|
||||
</select>
|
||||
<block cond="$var->type == 'select-multi-order'">
|
||||
|
|
@ -73,168 +57,80 @@
|
|||
<!--@else-->
|
||||
<input type="hidden" name="{$id}" value="" />
|
||||
<!--@end-->
|
||||
<select class="multiorder_show" size="8" multiple="multiple" style="width:290px;vertical-align:top">
|
||||
<option loop="$var->options => $key, $val" cond="!$var->init_options[$key]" value="{$key}" default="true"|cond="$var->default_options[$key]">{$val}</option>
|
||||
</select>
|
||||
<button type="button" class="text multiorder_add" style="vertical-align:top">{$lang->cmd_insert}</button>
|
||||
<select class="multiorder_selected" size="8" multiple="multiple" style="width:290px;vertical-align:top">
|
||||
<option loop="$var->options => $key, $val" cond="$var->init_options[$key]" value="{$key}" default="true"|cond="$var->default_options[$key]">{$val}</option>
|
||||
</select>
|
||||
<button type="button" class="text multiorder_up" style="vertical-align:top">{$lang->cmd_move_up}</button>
|
||||
<button type="button" class="text multiorder_down" style="vertical-align:top">{$lang->cmd_move_down}</button>
|
||||
<button type="button" class="text multiorder_del" style="vertical-align:top">{$lang->cmd_delete}</button>
|
||||
<script type="text/javascript">
|
||||
<div style="display:inline-block;padding-top:3px">
|
||||
<label>{$lang->display_no}</label>
|
||||
<select class="multiorder_show" size="8" multiple="multiple" style="vertical-align:top;margin-bottom:5px">
|
||||
<option loop="$var->options => $key, $val" cond="!$var->init_options[$key]" value="{$key}" default="true"|cond="$var->default_options[$key]">{$val}</option>
|
||||
</select>
|
||||
<br>
|
||||
<button type="button" class="x_btn multiorder_add" style="vertical-align:top">{$lang->cmd_insert}</button>
|
||||
</div>
|
||||
<div style="display:inline-block;padding-top:3px">
|
||||
<label>{$lang->display_yes}</label>
|
||||
<select class="multiorder_selected" size="8" multiple="multiple" style="vertical-align:top;margin-bottom:5px">
|
||||
<option loop="$var->options => $key, $val" cond="$var->init_options[$key]" value="{$key}" default="true"|cond="$var->default_options[$key]">{$val}</option>
|
||||
</select>
|
||||
<br>
|
||||
<button type="button" class="x_btn multiorder_up" style="margin:0 -5px 0 0;border-radius:2px 0 0 2px">{$lang->cmd_move_up}</button>
|
||||
<button type="button" class="x_btn multiorder_down" style="margin:0 -5px 0 0;border-radius:0">{$lang->cmd_move_down}</button>
|
||||
<button type="button" class="x_btn multiorder_del" style="border-radius:0 2px 2px 0">{$lang->cmd_delete}</button>
|
||||
</div>
|
||||
<script>
|
||||
xe.registerApp(new xe.MultiOrderManager('{$id}'));
|
||||
</script>
|
||||
</block>
|
||||
<block cond="$var->type == 'mid_list'">
|
||||
<fieldset loop="$mid_list => $module_category_srl, $modules" style="border: 1px solid #ccc; margin:1em 0; padding:.5em 1em">
|
||||
<legend cond="$modules->title">{$modules->title}</legend>
|
||||
<legend cond="!$modules->title">{$lang->none_category}</legend>
|
||||
<fieldset loop="$mid_list => $module_category_srl, $modules">
|
||||
<block cond="count($mid_list) > 1">
|
||||
<legend cond="$modules->title">{$modules->title}</legend>
|
||||
<legend cond="!$modules->title">{$lang->none_category}</legend>
|
||||
</block>
|
||||
<div loop="$modules->list => $key, $val">
|
||||
<input type="checkbox" value="{$key}" name="{$id}" id="chk_mid_list_{$key}" />
|
||||
<label for="chk_mid_list_{$key}">{$key} ({$val->browser_title})</label>
|
||||
<label class="x_inline"><input type="checkbox" value="{$key}" name="{$id}" /> {$key} ({$val->browser_title})</label>
|
||||
</div>
|
||||
</fieldset>
|
||||
</block>
|
||||
<block cond="$var->type == 'member_group'">
|
||||
<block loop="$group_list => $key, $val">
|
||||
<input type="checkbox" value="{$key}" name="{$id}" id="chk_member_gruop_{$id}_{$key}" />
|
||||
<label for="chk_member_gruop_{$id}_{$key}">{$val->title}</label>
|
||||
<label class="x_inline"><input type="checkbox" value="{$key}" name="{$id}" id="chk_member_gruop_{$id}_{$key}" /> {$val->title}</label>
|
||||
</block>
|
||||
</block>
|
||||
<block cond="$var->type == 'module_srl_list'">
|
||||
<input type="hidden" name="{$id}" value="" />
|
||||
<select class="modulelist_selected" size="8" multiple="multiple" style="width:290px;"></select>
|
||||
<br/>
|
||||
<span style="padding:1px;margin:1px"><b><a href="#moduleSearchWindow1" class="tgAnchor moduleSearch">{$lang->cmd_add}</a></b></span>
|
||||
<button type="button" class="text modulelist_up" style="vertical-align:top">{$lang->cmd_move_up}</button>
|
||||
<button type="button" class="text modulelist_down" style="vertical-align:top">{$lang->cmd_move_down}</button>
|
||||
<button type="button" class="text modulelist_del" style="vertical-align:top">{$lang->cmd_delete}</button>
|
||||
<script type="text/javascript">
|
||||
<select class="modulelist_selected" size="8" multiple="multiple" style="vertical-align:top;margin-bottom:5px"></select>
|
||||
<p class="x_help-inline">{$var->description}</p>
|
||||
<br>
|
||||
<a href="#" id="__module_srl_list_{$id}" class="x_btn moduleTrigger" data-multiple="true" style="margin:0 -5px 0 0;border-radius:2px 0 0 2px">{$lang->cmd_add}</a>
|
||||
<button type="button" class="x_btn modulelist_up" style="margin:0 -5px 0 0;border-radius:0">{$lang->cmd_move_up}</button>
|
||||
<button type="button" class="x_btn modulelist_down" style="margin:0 -5px 0 0;border-radius:0">{$lang->cmd_move_down}</button>
|
||||
<button type="button" class="x_btn modulelist_del" style="border-radius:0 2px 2px 0">{$lang->cmd_delete}</button>
|
||||
<script>
|
||||
xe.registerApp(new xe.ModuleListManager('{$id}'));
|
||||
</script>
|
||||
|
||||
<script>
|
||||
jQuery(function($){
|
||||
$('.moduleSearch1').bind('moduleSelect', function(e, aSelected){
|
||||
var sType, sName, sSrl;
|
||||
|
||||
for(var i=0, nLen=aSelected.length; i<nLen; i++){
|
||||
sType = aSelected[i].type;
|
||||
sName = aSelected[i].browser_title;
|
||||
sSrl = aSelected[i].module_srl;
|
||||
xe.broadcast("ADD_MODULE_TO_MODULELIST_MANAGER", [sType, sName, sSrl]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!-- new module search -->
|
||||
<div id="moduleSearchWindow1" class="moduleSearchWindow tgContent">
|
||||
<div class="siteList sectionDiv">
|
||||
<h2>{$lang->select_site}</h2>
|
||||
<div class="siteListSearchBox">
|
||||
<div class="siteListSearchBoxBorder">
|
||||
<div class="searchImg icon-search"></div>
|
||||
<input type="text" class="siteListSearchInput" name="site_filter">
|
||||
</div>
|
||||
</div>
|
||||
<div class="siteListUL">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="moduleTypeList sectionDiv">
|
||||
<h2>{$lang->select_module_type}</h2>
|
||||
<div>
|
||||
<ul class="moduleTypeListUL">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="moduleInstanceList sectionDiv">
|
||||
<h2>{$lang->select_module_instance}</h2>
|
||||
<div>
|
||||
<select class="moduleInstanceListSelect" multiple="multiple" size="8">
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn_primary moduleSearch_ok">{$lang->cmd_select}</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--// new module search -->
|
||||
</block>
|
||||
<block cond="$var->type == 'mid'">
|
||||
<input type="hidden" name="{$id}" value="" />
|
||||
<input type="text" readonly="readonly" /> <!--button class="text search">{$lang->cmd_search}</button> <button class="text delete">{$lang->cmd_delete}</button-->
|
||||
<span style="padding:1px;margin:1px"><b><a href="#moduleSearchWindow2" class="tgAnchor moduleSearch">{$lang->cmd_select}</a></b></span>
|
||||
<span style="padding:1px;margin:1px"><b><a href="#" class="text delete">{$lang->cmd_delete}</a></b></span>
|
||||
|
||||
<!-- callback function for moduleSearchWindow2 is defined in MidManager -->
|
||||
<!-- new module search -->
|
||||
<div id="moduleSearchWindow2" class="moduleSearchWindow tgContent">
|
||||
<div class="siteList sectionDiv">
|
||||
<h2>{$lang->select_site}</h2>
|
||||
<div class="siteListSearchBox">
|
||||
<div class="siteListSearchBoxBorder">
|
||||
<div class="searchImg icon-search"></div>
|
||||
<input type="text" class="siteListSearchInput" name="site_filter">
|
||||
</div>
|
||||
</div>
|
||||
<div class="siteListUL">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="moduleTypeList sectionDiv">
|
||||
<h2>{$lang->select_module_type}</h2>
|
||||
<div>
|
||||
<ul class="moduleTypeListUL">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="moduleInstanceList sectionDiv">
|
||||
<h2>{$lang->select_module_instance}</h2>
|
||||
<div>
|
||||
<select class="moduleInstanceListSelect"size="8">
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn_primary moduleSearch_ok">{$lang->cmd_select}</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--// new module search -->
|
||||
<div class="finder" style="display: none;">
|
||||
<div class="a">
|
||||
|
||||
<input type="text" class="site_keyword" /> <a href="#suggestion_{$suggestion_id}" class="tgAnchor findSite">{$lang->find_site}</a>
|
||||
<div id="suggestion_{$suggestion_id}" class="tgContent suggestion">
|
||||
<ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<p class="a"><select class="moduleList" style="width:290px;"></select></p>
|
||||
<p class="a"><select class="moduleIdList" style="width:290px;"></select> <button class="text">{$lang->cmd_select}</button></p>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
<input type="text" readonly="readonly" />
|
||||
<a href="#" class="x_btn moduleTrigger">{$lang->cmd_select}</a>
|
||||
<button type="button" class="x_btn delete">{$lang->cmd_delete}</button>
|
||||
<script>
|
||||
xe.registerApp(new xe.MidManager('{$id}'));
|
||||
</script>
|
||||
|
||||
|
||||
</block>
|
||||
<block cond="$var->type == 'filebox'">
|
||||
{@$use_filebox = true}
|
||||
<input type="hidden" name="{$id}" />
|
||||
<a class="modalAnchor filebox" href="#modalFilebox">{$lang->cmd_select}</a>
|
||||
<a class="x_btn modalAnchor filebox" href="#modalFilebox">{$lang->cmd_select}</a>
|
||||
</block>
|
||||
<select cond="$var->type == 'menu'" name="{$id}" style="width:290px">
|
||||
<select cond="$var->type == 'menu'" name="{$id}">
|
||||
<option value="">-</option>
|
||||
<option loop="$menu_list => $key, $val" value="{$val->menu_srl}">{$val->title}</option>
|
||||
</select>
|
||||
<p cond="$var->description">{$var->description}</p>
|
||||
</div>
|
||||
<p class="desc">{$var->description}</p>
|
||||
</li>
|
||||
</div>
|
||||
</block>
|
||||
</ul>
|
||||
<script type="text/javascript">
|
||||
</section>
|
||||
<script>
|
||||
xe.current_lang = "{$lang_type}";
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<block cond="$use_multilang">
|
||||
<div id="langEdit" class="langEdit tgContent">
|
||||
<ul class="langList"></ul>
|
||||
<div class="langInput form">
|
||||
<h2>{$lang->multilingual} <strong>{$lang->cmd_modify}...</strong> | <a href="#langEdit">{$lang->cmd_insert}</a></h2>
|
||||
<ul>
|
||||
{@
|
||||
/* move current language to the top */
|
||||
$a = array($lang_type=>$lang_supported[$lang_type]);
|
||||
unset($lang_supported[$lang_type]);
|
||||
$lang_supported = array_merge($a, $lang_supported);
|
||||
}
|
||||
<li loop="$lang_supported=>$code,$name" class="{$code}"><label for="{$code}_var1">{$name}</label> <input type="text" value="" id="{$code}_var1" /></li>
|
||||
</ul>
|
||||
<div class="action">
|
||||
<div class="btnArea">
|
||||
<span class="btn small"><input type="submit" value="{$lang->use}|{$lang->use_after_save}" /></span>
|
||||
</div>
|
||||
<p><a href="{getUrl('act','dispModuleAdminLangcode')}">{$lang->multilingual_manager}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</block>
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
<block cond="$use_multilang_textarea">
|
||||
<style type="text/css">
|
||||
#langEditTextarea textarea { width: 258px; }
|
||||
</style>
|
||||
|
||||
<div id="langEditTextarea" class="langEdit tgContent">
|
||||
<ul class="langList"></ul>
|
||||
<div class="langInput form">
|
||||
<h2>{$lang->multilingual} <strong>{$lang->cmd_modify}...</strong> | <a href="#langEdit">{$lang->cmd_insert}</a></h2>
|
||||
<ul>
|
||||
{@
|
||||
/* move current language to the top */
|
||||
$a = array($lang_type=>$lang_supported[$lang_type]);
|
||||
unset($lang_supported[$lang_type]);
|
||||
$lang_supported = array_merge($a, $lang_supported);
|
||||
}
|
||||
<li loop="$lang_supported=>$code,$name" class="{$code}"><label for="{$code}_var1">{$name}</label> <textarea id="{$code}_var1" rows="8" cols="42"></textarea></li>
|
||||
</ul>
|
||||
<div class="action">
|
||||
<div class="btnArea">
|
||||
<span class="btn small"><input type="submit" value="{$lang->use}|{$lang->use_after_save}" /></span>
|
||||
</div>
|
||||
<p><a href="{getUrl('act','dispModuleAdminLangcode')}">{$lang->multilingual_manager}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</block>
|
||||
|
|
@ -1,63 +1,59 @@
|
|||
<load target="../../admin/tpl/js/admin.js" usecdn="true" />
|
||||
<load target="../../admin/tpl/css/admin.bootstrap.css" usecdn="true" />
|
||||
<load target="../../admin/tpl/css/admin.css" usecdn="true" />
|
||||
<load cond="$lang_type=='ko'" target="../../admin/tpl/css/admin_ko.css" usecdn="true" />
|
||||
<load cond="$lang_type=='en'" target="../../admin/tpl/css/admin_en.css" usecdn="true" />
|
||||
<load target="../../admin/tpl/js/admin.js" usecdn="true" />
|
||||
<load target="js/generate_code.js" usecdn="true" />
|
||||
|
||||
<script type="text/javascript">
|
||||
<load target="../../admin/tpl/js/jquery.tmpl.js" usecdn="true" />
|
||||
<load target="../../admin/tpl/js/jquery.jstree.js" usecdn="true" />
|
||||
<script>
|
||||
xe.lang.cmd_delete = '{$lang->cmd_delete}';
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
doFillWidgetVars();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div cond="$type=='faceoff'" class="x" style="padding: 0 10px;">
|
||||
<form class="form">
|
||||
<input type="hidden" name="module" value="widget" />
|
||||
<input type="hidden" name="type" value="faceoff" />
|
||||
<input type="hidden" name="act" value="dispWidgetGenerateCodeInPage" />
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
|
||||
<h2 class="h2">{$lang->widget}</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<p class="a">
|
||||
<select name="selected_widget">
|
||||
<div class="x">
|
||||
<div class="x_modal-header">
|
||||
<h1>{$widget_info->title} {$lang->cmd_generate_code}</h1>
|
||||
</div>
|
||||
<div id="content" class="x_modal-body">
|
||||
<p>{$widget_info->description} {$lang->about_widget_code_in_page}</p>
|
||||
<form cond="$type=='faceoff'" class="x_form-horizontal">
|
||||
<input type="hidden" name="module" value="widget" />
|
||||
<input type="hidden" name="type" value="faceoff" />
|
||||
<input type="hidden" name="act" value="dispWidgetGenerateCodeInPage" />
|
||||
<input type="hidden" name="error_return_url" value="" />
|
||||
<div class="x_control-group">
|
||||
<label for="selected_widget" class="x_control-label">
|
||||
{$lang->widget}
|
||||
</label>
|
||||
<div class="x_controls">
|
||||
<select name="selected_widget" id="selected_widget" style="margin:0">
|
||||
<option loop="$widget_list => $list_widget_info" value="{$list_widget_info->widget}">{$list_widget_info->title}</option>
|
||||
</select>
|
||||
<input type="submit" value="{$lang->cmd_select}" />
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
</div>
|
||||
<div class="x" style="padding: 0 10px;">
|
||||
<h2 class="h2">{$widget_info->title}</h2>
|
||||
<p>{$widget_info->description}</p>
|
||||
|
||||
<h3 class="h3">{$lang->cmd_generate_code}</h3>
|
||||
<p>{$lang->about_widget_code_in_page}</p>
|
||||
|
||||
<form class="form" action="./" method="post" id="fo_widget">
|
||||
<input type="hidden" name="module" value="widget" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="widget_sequence" value="" />
|
||||
<input type="hidden" name="style" value="float:left;width:100%;margin:none;padding:none;" />
|
||||
<input type="hidden" name="widget_padding_left" value="" />
|
||||
<input type="hidden" name="widget_padding_right" value="" />
|
||||
<input type="hidden" name="widget_padding_top" value="" />
|
||||
<input type="hidden" name="widget_padding_bottom" value="" />
|
||||
<input type="hidden" name="selected_widget" value="{$widget_info->widget}" />
|
||||
|
||||
<include target="widget_generate_code.include.html" />
|
||||
|
||||
<div class="btnArea">
|
||||
<span class="btn small"><input type="submit" value="{$lang->cmd_generate_code}" /></span>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<include target="widget_generate_code.filebox.html" />
|
||||
<include target="widget_generate_code.multilang.html" />
|
||||
<include target="widget_generate_code.multilang.textarea.html" />
|
||||
<input type="submit" value="{$lang->cmd_select}" class="x_btn" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form class="x_form-horizontal" action="./" method="post" id="fo_widget">
|
||||
<input type="hidden" name="module" value="widget" />
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="widget_sequence" value="" />
|
||||
<input type="hidden" name="style" value="float:left;width:100%;margin:none;padding:none;" />
|
||||
<input type="hidden" name="widget_padding_left" value="" />
|
||||
<input type="hidden" name="widget_padding_right" value="" />
|
||||
<input type="hidden" name="widget_padding_top" value="" />
|
||||
<input type="hidden" name="widget_padding_bottom" value="" />
|
||||
<input type="hidden" name="selected_widget" value="{$widget_info->widget}" />
|
||||
|
||||
<include target="widget_generate_code.include.html" />
|
||||
|
||||
<div class="btnArea">
|
||||
<input type="submit" class="x_btn x_btn-primary" value="{$lang->cmd_generate_code}" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<include target="../../module/tpl/include.filebox.html" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
<div id="tmpPageSizeLayer" class="layer x">
|
||||
<section id="tmpPageSizeLayer" class="x_modal x wgs" hidden>
|
||||
<button type="button" class="x_close" data-hide=".wgs, .x_modal-backdrop, .jPicker.Container">×</button>
|
||||
<form action="index.php">
|
||||
<div class="table">
|
||||
<table width="100%" border="1" cellspacing="0">
|
||||
<div class="x_modal-header">
|
||||
<h1>{$lang->cmd_widget_size}</h1>
|
||||
</div>
|
||||
<div class="x_modal-body">
|
||||
<table class="x_table x_table-striped x_table-hover">
|
||||
<col width="140" />
|
||||
<col />
|
||||
<col />
|
||||
|
|
@ -15,79 +19,83 @@
|
|||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="line">{$lang->cmd_widget_size}</th>
|
||||
<td colspan="2" class="line"><input type="text" name="width" class="input" value="" /> - <input type="text" class="input" name="height" value="" /></td>
|
||||
<th>{$lang->cmd_widget_size}</th>
|
||||
<td colspan="2">
|
||||
<label for="width" style="display:inline">W:</label> <input type="text" name="width" id="width" value="" />
|
||||
|
||||
<label for="height" style="display:inline">H:</label> <input type="text" name="height" id="height" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="3" class="line">{$lang->cmd_widget_margin}</th>
|
||||
<td colspan="2" class="line tCenter"><input type="text" name="margin_top" class="input" value="" />px</td>
|
||||
<th rowspan="3">{$lang->cmd_widget_margin}</th>
|
||||
<td colspan="2" style="text-align:center"><label for="margin_top" style="display:inline">T:</label> <input type="number" name="margin_top" id="margin_top" value="" /> px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="margin_left" class="input" value="" />px</td>
|
||||
<td class="tRight"><input type="text" name="margin_right" class="input" value="" />px</td>
|
||||
<td style="text-align:left"><label for="margin_left" style="display:inline">L:</label> <input type="number" name="margin_left" id="margin_left" value="" /> px</td>
|
||||
<td style="text-align:right"><label for="margin_right" style="display:inline">R:</label> <input type="number" name="margin_right" id="margin_right" value="" /> px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="tCenter"><input type="text" name="margin_bottom" class="input" value="" />px</td>
|
||||
<td colspan="2" style="text-align:center"><label for="margin_bottom" style="display:inline">B:</label> <input type="number" name="margin_bottom" id="margin_bottom" value="" /> px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="3" class="line">{$lang->cmd_widget_padding}</th>
|
||||
<td colspan="2" class="line tCenter"><input type="text" name="padding_top" class="input" value="" />px</td>
|
||||
<th rowspan="3">{$lang->cmd_widget_padding}</th>
|
||||
<td colspan="2" style="text-align:center"><label for="padding_top" style="display:inline">T:</label> <input type="number" name="padding_top" id="padding_top" value="" /> px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><input type="text" name="padding_left" class="input" value="" />px</td>
|
||||
<td class="tRight"><input type="text" name="padding_right" class="input" value="" />px</td>
|
||||
<td style="text-align:left"><label for="padding_left" style="display:inline">L:</label> <input type="number" name="padding_left" id="padding_left" value="" /> px</td>
|
||||
<td style="text-align:right"><label for="padding_right" style="display:inline">R:</label> <input type="number" name="padding_right" id="padding_right" value="" /> px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="tCenter"><input type="text" name="padding_bottom" class="input" value="" />px</td>
|
||||
<td colspan="2" style="text-align:center"><label for="padding_bottom" style="display:inline">B:</label> <input type="number" name="padding_bottom" id="padding_bottom" value="" /> px</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="3" class="line">{$lang->cmd_widget_border}</th>
|
||||
<td colspan="2" class="tCenter line">
|
||||
<input type="text" name="border_top_thick" value="" class="small_input" />px
|
||||
<th rowspan="3">{$lang->cmd_widget_border}</th>
|
||||
<td colspan="2" style="text-align:center">
|
||||
<input type="number" name="border_top_thick" value="" class="small_input" /> px
|
||||
<select name="border_top_type">
|
||||
<option value="solid">{$lang->cmd_widget_border_solid}</option>
|
||||
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
|
||||
</select>
|
||||
#<input type="text" name="border_top_color" value="" class="color_input" maxlength="6"/>
|
||||
<input type="text" name="border_top_color" value="" class="color_input color-indicator" maxlength="6"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="text" name="border_left_thick" value="" class="small_input" />px
|
||||
<td style="text-align:left">
|
||||
<input type="number" name="border_left_thick" value="" class="small_input" /> px
|
||||
<select name="border_left_type">
|
||||
<option value="solid">{$lang->cmd_widget_border_solid}</option>
|
||||
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
|
||||
</select>
|
||||
#<input type="text" name="border_left_color" value="" class="color_input" maxlength="6"/>
|
||||
<input type="text" name="border_left_color" value="" class="color_input color-indicator" maxlength="6"/>
|
||||
</td>
|
||||
<td class="tRight">
|
||||
<input type="text" name="border_right_thick" value="" class="small_input" />px
|
||||
<td style="text-align:right">
|
||||
<input type="number" name="border_right_thick" value="" class="small_input" /> px
|
||||
<select name="border_right_type">
|
||||
<option value="solid">{$lang->cmd_widget_border_solid}</option>
|
||||
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
|
||||
</select>
|
||||
#<input type="text" name="border_right_color" value="" class="color_input" maxlength="6"/>
|
||||
<input type="text" name="border_right_color" value="" class="color_input color-indicator" maxlength="6"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" class="tCenter">
|
||||
<input type="text" name="border_bottom_thick" value="" class="small_input" />px
|
||||
<td colspan="2" style="text-align:center">
|
||||
<input type="number" name="border_bottom_thick" value="" class="small_input" /> px
|
||||
<select name="border_bottom_type">
|
||||
<option value="solid">{$lang->cmd_widget_border_solid}</option>
|
||||
<option value="dotted">{$lang->cmd_widget_border_dotted}</option>
|
||||
</select>
|
||||
#<input type="text" name="border_bottom_color" value="" class="color_input" maxlength="6"/>
|
||||
<input type="text" name="border_bottom_color" value="" class="color_input color-indicator" maxlength="6"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="line">{$lang->cmd_widget_background_color}</th>
|
||||
<td colspan="2" class="line"><input type="text" name="background_color" value="" class="input" /></td>
|
||||
<th>{$lang->cmd_widget_background_color}</th>
|
||||
<td colspan="2"><input type="text" name="background_color" value="" class="input color-indicator" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="line">{$lang->cmd_widget_background_image_url}</th>
|
||||
<td colspan="2" class="line">
|
||||
<div><input type="text" name="background_image_url" value="" class="full_input"/></div>
|
||||
<div>
|
||||
<th>{$lang->cmd_widget_background_image_url}</th>
|
||||
<td colspan="2">
|
||||
<div style="margin-bottom:5px"><input type="text" name="background_image_url" value="" style="width:400px"/></div>
|
||||
<div style="margin-bottom:5px">
|
||||
<select name="background_repeat">
|
||||
<option value="repeat">{$lang->cmd_widget_background_image_repeat}</option>
|
||||
<option value="no-repeat">{$lang->cmd_widget_background_image_no_repeat}</option>
|
||||
|
|
@ -95,18 +103,25 @@
|
|||
<option value="repeat-y">{$lang->cmd_widget_background_image_y_repeat}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
{$lang->cmd_widget_background_image_x} : <input type="text" name="background_x" value="0" class="input" />
|
||||
<div style="margin-bottom:5px">
|
||||
{$lang->cmd_widget_background_image_x} : <input type="text" name="background_x" value="0" />
|
||||
</div>
|
||||
<div>
|
||||
{$lang->cmd_widget_background_image_y} : <input type="text" name="background_y" value="0" class="input" />
|
||||
<div style="margin-bottom:5px">
|
||||
{$lang->cmd_widget_background_image_y} : <input type="text" name="background_y" value="0" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="btnArea">
|
||||
<span class="btn"><input type="submit" value="{$lang->cmd_save}" /></span>
|
||||
<div class="x_modal-footer">
|
||||
<input class="x_btn x_btn-inverse" type="submit" value="{$lang->cmd_save}" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<style scoped>
|
||||
.wgs{margin:0;width:700px}
|
||||
.wgs select{margin:0;width:auto}
|
||||
.wgs input{margin:0!important;width:50px}
|
||||
</style>
|
||||
</section>
|
||||
<!--%load_js_plugin("ui.colorpicker")-->
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,19 @@
|
|||
<load target="../../admin/tpl/js/admin.js" usecdn="true" />
|
||||
<load target="../../admin/tpl/css/admin.bootstrap.css" usecdn="true" />
|
||||
<load target="../../admin/tpl/css/admin.css" usecdn="true" />
|
||||
<load cond="$lang_type=='ko'" target="../../admin/tpl/css/admin_ko.css" usecdn="true" />
|
||||
<load cond="$lang_type=='en'" target="../../admin/tpl/css/admin_en.css" usecdn="true" />
|
||||
<load target="css/widget.css" usecdn="true" />
|
||||
<load target="../../admin/tpl/js/admin.js" usecdn="true" />
|
||||
<load target="../../admin/tpl/js/jquery.tmpl.js" usecdn="true" />
|
||||
<load target="js/generate_code.js" usecdn="true" />
|
||||
<load target="js/multi_lang.js" usecdn="true" />
|
||||
<!--%load_js_plugin("ui.colorpicker")-->
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready(function(){
|
||||
<script>
|
||||
jQuery(function(){
|
||||
getWidgetVars();
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="x" style="padding: 0 10px;">
|
||||
<h1 class="h1">{$lang->widgetstyle}</h1>
|
||||
|
||||
<form class="form" action="./" method="post" id="fo_widget">
|
||||
<div id="content" class="x">
|
||||
<form action="./" method="post" id="fo_widget">
|
||||
<input type="hidden" name="module_srl" value="{$module_srl}" />
|
||||
<input type="hidden" name="widget_sequence" value="" />
|
||||
<input type="hidden" name="style" value="" />
|
||||
|
|
@ -28,91 +25,81 @@
|
|||
<input type="hidden" name="act" value="" />
|
||||
<input type="hidden" name="widgetstyle" value="{$widgetstyle}" />
|
||||
<input type="hidden" name="selected_widget" value="{$selected_widget}" />
|
||||
|
||||
<a href="{getUrl('widgetstyle','none')}" class="widgetStyle"><img src="images/widgetstyle_none.gif" title="{$lang->notuse}" /></a>
|
||||
<a loop="$widgetStyle_list => $key, $widgetStyle" cond="$widgetStyle->preview" href="{getUrl('widgetstyle',$widgetStyle->widgetStyle)}" class="widgetStyle <!--@if($widgetStyle->widgetStyle==$widgetstyle)-->selected<!--@end-->"><img src="{getUrl()}{$widgetStyle->preview}" title="{$widgetStyle->title}" /><span>{$widgetStyle->title}</span></a>
|
||||
<block cond="$widgetstyle_info">
|
||||
|
||||
<h2 class="h2">{$widgetstyle_info->title} ver {$widgetstyle_info->version}</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<p class="q">{$lang->description}</p>
|
||||
<p class="a">{$widgetstyle_info->description}</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q">{$lang->author}</p>
|
||||
<p class="a">
|
||||
<div class="x_modal-header">
|
||||
<h1>{$lang->widgetstyle}</h1>
|
||||
</div>
|
||||
<div class="x_modal-body x_form-horizontal">
|
||||
<a href="{getUrl('widgetstyle','none')}" class="widgetStyle"><img src="images/widgetstyle_none.gif" title="{$lang->notuse}" /></a>
|
||||
<a loop="$widgetStyle_list => $key, $widgetStyle" cond="$widgetStyle->preview" href="{getUrl('widgetstyle',$widgetStyle->widgetStyle)}" class="widgetStyle <!--@if($widgetStyle->widgetStyle==$widgetstyle)-->selected<!--@end-->"><img src="{getUrl()}{$widgetStyle->preview}" title="{$widgetStyle->title}" /><span>{$widgetStyle->title}</span></a>
|
||||
<block cond="$widgetstyle_info">
|
||||
|
||||
<h2>{$widgetstyle_info->title} ver {$widgetstyle_info->version}</h2>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->description}</label>
|
||||
<div class="x_controls">
|
||||
{$widgetstyle_info->description}
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->author}</label>
|
||||
<div class="x_controls">
|
||||
<block loop="$widgetstyle_info->author => $author">
|
||||
{$author->name} ({$author->homepage})
|
||||
</block>
|
||||
</p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="q">{$lang->regdate}</p>
|
||||
<p class="a">{zdate($widgetstyle_info->date,'Y-m-d')}</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<block loop="$widgetstyle_info->extra_var => $id, $var">
|
||||
{@$suggestion_id++}
|
||||
<block cond="!$not_first && !$var->group"><ul></block>
|
||||
<block cond="$group != $var->group">
|
||||
<block cond="$not_first"></ul></block>
|
||||
<h3 class="h3">{$var->group}</h3>
|
||||
<ul>
|
||||
{@$group = $var->group}
|
||||
</block>
|
||||
{@$not_first = true}
|
||||
<li>
|
||||
<p class="q"><label for="{$id}">{$var->name}</label></p>
|
||||
<div class="a extra_vars">
|
||||
<div cond="$var->type == 'text'" class="multiLangEdit">
|
||||
{@$use_multilang = TRUE}
|
||||
<input type="hidden" name="{$id}" value="" class="vLang" />
|
||||
<input type="text" id="{$id}" class="vLang" />
|
||||
<span class="desc"><a href="#langEdit" class="editUserLang tgAnchor">{$lang->cmd_set_multilingual}</a></span>
|
||||
<script>
|
||||
xe.registerApp(new xe.MultiLangManager('{$id}'));
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<input cond="$var->type == 'color'" type="text" name="{$id}" class="color-indicator" />
|
||||
|
||||
<div cond="$var->type == 'textarea'" class="multiLangEdit">
|
||||
{@$use_multilang_textarea = TRUE}
|
||||
<input type="hidden" name="{$id}" value="" class="vLang" />
|
||||
<textarea id="{$id}" rows="8" cols="42"></textarea>
|
||||
<span class="desc"><a href="#langEditTextarea" class="editUserLang tgAnchor">{$lang->cmd_set_multilingaul}</a></span>
|
||||
<script>
|
||||
xe.registerApp(new xe.MultiLangManager('{$id}'));
|
||||
</script>
|
||||
</div>
|
||||
|
||||
<select cond="$var->type == 'select'" name="{$id}">
|
||||
<option loop="$var->options => $key, $val" value="{$key}">{$val}</option>
|
||||
</select>
|
||||
|
||||
<block cond="$var->type == 'filebox'">
|
||||
<input type="hidden" name="{$id}" />
|
||||
<a href="#modalFilebox" class="modalAnchor filebox">{$lang->cmd_select}</a>
|
||||
{@$use_filebox = TRUE}
|
||||
</block>
|
||||
</div>
|
||||
<p class="desc">{$var->description}</p>
|
||||
</li>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">{$lang->regdate}</label>
|
||||
<div class="x_controls">
|
||||
{zdate($widgetstyle_info->date,'Y-m-d')}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<block loop="$widgetstyle_info->extra_var => $id, $var">
|
||||
{@$suggestion_id++}
|
||||
<block cond="!$not_first && !$var->group"><section class="section"></block>
|
||||
<block cond="$group != $var->group">
|
||||
<block cond="$not_first"></section></block>
|
||||
<h1>{$var->group}</h1>
|
||||
<section class="section">
|
||||
{@$group = $var->group}
|
||||
</block>
|
||||
{@$not_first = true}
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label" for="{$id}"|cond="$var->type!='text'&&$var->type!='textarea'" for="lang_{$id}"|cond="$var->type=='text'||$var->type=='textarea'">{$var->name}</label>
|
||||
<div class="x_controls extra_vars">
|
||||
<div cond="$var->type == 'text'">
|
||||
<input type="text" name="{$id}" value="" class="lang_code" />
|
||||
</div>
|
||||
|
||||
<input cond="$var->type == 'color'" type="text" name="{$id}" class="color-indicator" />
|
||||
|
||||
<div cond="$var->type == 'textarea'">
|
||||
<textarea name="{$id}" rows="8" cols="42" class="lang_code"></textarea>
|
||||
</div>
|
||||
|
||||
<select cond="$var->type == 'select'" name="{$id}">
|
||||
<option loop="$var->options => $key, $val" value="{$key}">{$val}</option>
|
||||
</select>
|
||||
|
||||
<block cond="$var->type == 'filebox'">
|
||||
<input type="hidden" name="{$id}" />
|
||||
<a href="#modalFilebox" class="modalAnchor filebox">{$lang->cmd_select}</a>
|
||||
{@$use_filebox = TRUE}
|
||||
</block>
|
||||
<span class="x_help-block">{$var->description}</span>
|
||||
</div>
|
||||
</div>
|
||||
</block>
|
||||
</section>
|
||||
</block>
|
||||
</ul>
|
||||
</block>
|
||||
|
||||
<div class="btnArea">
|
||||
<span class="btn small"><input type="submit" value="{$lang->cmd_setup}" /></span>
|
||||
</div>
|
||||
<div class="x_modal-footer">
|
||||
<input class="x_btn x_btn-primary" type="submit" value="{$lang->cmd_setup}" />
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
xe.current_lang = "{$lang_type}";
|
||||
</script>
|
||||
<include target="widget_generate_code.filebox.html" />
|
||||
<include target="widget_generate_code.multilang.html" />
|
||||
<include target="widget_generate_code.multilang.textarea.html" />
|
||||
|
||||
<script>
|
||||
xe.current_lang = "{$lang_type}";
|
||||
</script>
|
||||
<include target="../../module/tpl/include.filebox.html" />
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,78 +1,86 @@
|
|||
<?php
|
||||
/**
|
||||
* @class widgetAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief admin view class for widget modules
|
||||
**/
|
||||
/**
|
||||
* @class widgetAdminView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief admin view class for widget modules
|
||||
*/
|
||||
class widgetAdminView extends widget
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
class widgetAdminView extends widget {
|
||||
/**
|
||||
* @brief Showing a list of widgets
|
||||
*/
|
||||
function dispWidgetAdminDownloadedList()
|
||||
{
|
||||
// Set widget list
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
$security = new Security($widget_list);
|
||||
$widget_list = $security->encodeHTML('..', '..author..');
|
||||
|
||||
/**
|
||||
* @brief Showing a list of widgets
|
||||
**/
|
||||
function dispWidgetAdminDownloadedList() {
|
||||
// Set widget list
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
|
||||
$security = new Security($widget_list);
|
||||
$widget_list = $security->encodeHTML('..', '..author..');
|
||||
|
||||
foreach($widget_list as $no => $widget)
|
||||
foreach($widget_list as $no => $widget)
|
||||
{
|
||||
if($widget->widget)
|
||||
{
|
||||
$widget_list[$no]->description = nl2br(trim($widget->description));
|
||||
}
|
||||
|
||||
Context::set('widget_list', $widget_list);
|
||||
Context::set('tCount', count($widget_list));
|
||||
|
||||
$this->setTemplateFile('downloaded_widget_list');
|
||||
}
|
||||
|
||||
function dispWidgetAdminGenerateCode()
|
||||
{
|
||||
$oView = &getView('widget');
|
||||
Context::set('in_admin', true);
|
||||
$this->setTemplateFile('widget_generate_code');
|
||||
return $oView->dispWidgetGenerateCode();
|
||||
else
|
||||
{
|
||||
unset($widget_list[$no]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief For information on direct entry widget popup kkuhim
|
||||
**/
|
||||
function dispWidgetAdminAddContent() {
|
||||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl) return $this->stop("msg_invalid_request");
|
||||
Context::set('widget_list', $widget_list);
|
||||
Context::set('tCount', count($widget_list));
|
||||
|
||||
$document_srl = Context::get('document_srl');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
Context::set('oDocument', $oDocument);
|
||||
$this->setTemplateFile('downloaded_widget_list');
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
$columnList = array('module_srl', 'mid');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
Context::set('module_info', $module_info);
|
||||
// Editors settings of the module by calling getEditor
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getModuleEditor('document',$module_srl, $module_srl,'module_srl','content');
|
||||
Context::set('editor', $editor);
|
||||
function dispWidgetAdminGenerateCode()
|
||||
{
|
||||
$oView = &getView('widget');
|
||||
Context::set('in_admin', true);
|
||||
$this->setTemplateFile('widget_generate_code');
|
||||
return $oView->dispWidgetGenerateCode();
|
||||
}
|
||||
|
||||
$security = new Security();
|
||||
$security->encodeHTML('member_config..');
|
||||
/**
|
||||
* @brief For information on direct entry widget popup kkuhim
|
||||
*/
|
||||
function dispWidgetAdminAddContent()
|
||||
{
|
||||
$module_srl = Context::get('module_srl');
|
||||
if(!$module_srl) return $this->stop("msg_invalid_request");
|
||||
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile("default_layout");
|
||||
$this->setTemplateFile('add_content_widget');
|
||||
$document_srl = Context::get('document_srl');
|
||||
$oDocumentModel = &getModel('document');
|
||||
$oDocument = $oDocumentModel->getDocument($document_srl);
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
}
|
||||
$oModuleModel = &getModel('module');
|
||||
$columnList = array('module_srl', 'mid');
|
||||
$module_info = $oModuleModel->getModuleInfoByModuleSrl($module_srl, $columnList);
|
||||
Context::set('module_info', $module_info);
|
||||
// Editors settings of the module by calling getEditor
|
||||
$oEditorModel = &getModel('editor');
|
||||
$editor = $oEditorModel->getModuleEditor('document',$module_srl, $module_srl,'module_srl','content');
|
||||
Context::set('editor', $editor);
|
||||
|
||||
}
|
||||
?>
|
||||
$security = new Security();
|
||||
$security->encodeHTML('member_config..');
|
||||
|
||||
$this->setLayoutPath('./common/tpl');
|
||||
$this->setLayoutFile("default_layout");
|
||||
$this->setTemplateFile('add_content_widget');
|
||||
}
|
||||
}
|
||||
/* End of file widget.admin.view.php */
|
||||
/* Location: ./modules/widget/widget.admin.view.php */
|
||||
|
|
|
|||
|
|
@ -1,56 +1,60 @@
|
|||
<?php
|
||||
/**
|
||||
* @class widget
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief widget module's high class
|
||||
**/
|
||||
/**
|
||||
* @class widget
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief widget module's high class
|
||||
*/
|
||||
class widget extends ModuleObject
|
||||
{
|
||||
/**
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
*/
|
||||
function moduleInstall()
|
||||
{
|
||||
// Create cache directory used by widget
|
||||
FileHandler::makeDir('./files/cache/widget');
|
||||
FileHandler::makeDir('./files/cache/widget_cache');
|
||||
// Add this widget compile the trigger for the display.after
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
|
||||
|
||||
class widget extends ModuleObject {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Implement if additional tasks are necessary when installing
|
||||
**/
|
||||
function moduleInstall() {
|
||||
// Create cache directory used by widget
|
||||
FileHandler::makeDir('./files/cache/widget');
|
||||
FileHandler::makeDir('./files/cache/widget_cache');
|
||||
// Add this widget compile the trigger for the display.after
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
|
||||
/**
|
||||
* @brief a method to check if successfully installed
|
||||
*/
|
||||
function checkUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
// widget compile display.after trigger for further (04/14/2009)
|
||||
if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
|
||||
|
||||
return new Object();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief a method to check if successfully installed
|
||||
**/
|
||||
function checkUpdate() {
|
||||
$oModuleModel = &getModel('module');
|
||||
// widget compile display.after trigger for further (04/14/2009)
|
||||
if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) return true;
|
||||
/**
|
||||
* @brief Execute update
|
||||
*/
|
||||
function moduleUpdate()
|
||||
{
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// widget compile display.after trigger for further (04/14/2009)
|
||||
if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before'))
|
||||
{
|
||||
$oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Execute update
|
||||
**/
|
||||
function moduleUpdate() {
|
||||
$oModuleModel = &getModel('module');
|
||||
$oModuleController = &getController('module');
|
||||
// widget compile display.after trigger for further (04/14/2009)
|
||||
if(!$oModuleModel->getTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before')) {
|
||||
$oModuleController->insertTrigger('display', 'widget', 'controller', 'triggerWidgetCompile', 'before');
|
||||
}
|
||||
|
||||
return new Object(0, 'success_updated');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Re-generate the cache file
|
||||
**/
|
||||
function recompileCache() {
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
/**
|
||||
* @brief Re-generate the cache file
|
||||
*/
|
||||
function recompileCache()
|
||||
{
|
||||
}
|
||||
}
|
||||
/* End of file widget.class.php */
|
||||
/* Location: ./modules/widget/widget.class.php */
|
||||
|
|
|
|||
|
|
@ -1,403 +1,435 @@
|
|||
<?php
|
||||
/**
|
||||
* @class widgetModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @version 0.1
|
||||
* @brief Model class for widget modules
|
||||
**/
|
||||
/**
|
||||
* @class widgetModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @version 0.1
|
||||
* @brief Model class for widget modules
|
||||
*/
|
||||
class widgetModel extends widget
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
}
|
||||
|
||||
class widgetModel extends widget {
|
||||
/**
|
||||
* @brief Wanted widget's path
|
||||
*/
|
||||
function getWidgetPath($widget_name)
|
||||
{
|
||||
$path = sprintf('./widgets/%s/', $widget_name);
|
||||
if(is_dir($path)) return $path;
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wanted widget's path
|
||||
**/
|
||||
function getWidgetPath($widget_name) {
|
||||
$path = sprintf('./widgets/%s/', $widget_name);
|
||||
if(is_dir($path)) return $path;
|
||||
/**
|
||||
* @brief Wanted widget style path
|
||||
*/
|
||||
function getWidgetStylePath($widgetStyle_name)
|
||||
{
|
||||
$path = sprintf('./widgetstyles/%s/', $widgetStyle_name);
|
||||
if(is_dir($path)) return $path;
|
||||
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wanted widget style path
|
||||
*/
|
||||
function getWidgetStyleTpl($widgetStyle_name)
|
||||
{
|
||||
$path = $this->getWidgetStylePath($widgetStyle_name);
|
||||
$tpl = sprintf('%swidgetstyle.html', $path);
|
||||
return $tpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wanted widget style path
|
||||
**/
|
||||
function getWidgetStylePath($widgetStyle_name) {
|
||||
$path = sprintf('./widgetstyles/%s/', $widgetStyle_name);
|
||||
if(is_dir($path)) return $path;
|
||||
/**
|
||||
* @brief Wanted photos of the type and information
|
||||
* Download a widget with type (generation and other means)
|
||||
*/
|
||||
function getDownloadedWidgetList()
|
||||
{
|
||||
$oAutoinstallModel = &getModel('autoinstall');
|
||||
|
||||
return "";
|
||||
}
|
||||
// 've Downloaded the widget and the widget's list of installed Wanted
|
||||
$searched_list = FileHandler::readDir('./widgets');
|
||||
$searched_count = count($searched_list);
|
||||
if(!$searched_count) return;
|
||||
sort($searched_list);
|
||||
// D which pertain to the list of widgets loop spins return statement review the information you need
|
||||
for($i=0;$i<$searched_count;$i++)
|
||||
{
|
||||
// The name of the widget
|
||||
$widget = $searched_list[$i];
|
||||
// Wanted information on the Widget
|
||||
$widget_info = $this->getWidgetInfo($widget);
|
||||
|
||||
/**
|
||||
* @brief Wanted widget style path
|
||||
**/
|
||||
function getWidgetStyleTpl($widgetStyle_name) {
|
||||
$path = $this->getWidgetStylePath($widgetStyle_name);
|
||||
$tpl = sprintf('%swidgetstyle.html', $path);
|
||||
return $tpl;
|
||||
}
|
||||
if(!$widget_info)
|
||||
{
|
||||
$widget_info = new stdClass();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Wanted photos of the type and information
|
||||
* Download a widget with type (generation and other means)
|
||||
**/
|
||||
function getDownloadedWidgetList() {
|
||||
$oAutoinstallModel = &getModel('autoinstall');
|
||||
// get easyinstall remove url
|
||||
$packageSrl = $oAutoinstallModel->getPackageSrlByPath($widget_info->path);
|
||||
$widget_info->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
|
||||
|
||||
// 've Downloaded the widget and the widget's list of installed Wanted
|
||||
$searched_list = FileHandler::readDir('./widgets');
|
||||
$searched_count = count($searched_list);
|
||||
if(!$searched_count) return;
|
||||
sort($searched_list);
|
||||
// D which pertain to the list of widgets loop spins return statement review the information you need
|
||||
for($i=0;$i<$searched_count;$i++) {
|
||||
// The name of the widget
|
||||
$widget = $searched_list[$i];
|
||||
// Wanted information on the Widget
|
||||
$widget_info = $this->getWidgetInfo($widget);
|
||||
// get easyinstall need update
|
||||
$package = $oAutoinstallModel->getInstalledPackages($packageSrl);
|
||||
$widget_info->need_update = $package[$packageSrl]->need_update;
|
||||
|
||||
// get easyinstall remove url
|
||||
$packageSrl = $oAutoinstallModel->getPackageSrlByPath($widget_info->path);
|
||||
$widget_info->remove_url = $oAutoinstallModel->getRemoveUrlByPackageSrl($packageSrl);
|
||||
// get easyinstall update url
|
||||
if ($widget_info->need_update == 'Y')
|
||||
{
|
||||
$widget_info->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
|
||||
}
|
||||
|
||||
// get easyinstall need update
|
||||
$package = $oAutoinstallModel->getInstalledPackages($packageSrl);
|
||||
$widget_info->need_update = $package[$packageSrl]->need_update;
|
||||
$list[] = $widget_info;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
// get easyinstall update url
|
||||
if ($widget_info->need_update == 'Y')
|
||||
/**
|
||||
* @brief Wanted photos of the type and information
|
||||
* Download a widget with type (generation and other means)
|
||||
*/
|
||||
function getDownloadedWidgetStyleList()
|
||||
{
|
||||
// 've Downloaded the widget and the widget's list of installed Wanted
|
||||
$searched_list = FileHandler::readDir('./widgetstyles');
|
||||
$searched_count = count($searched_list);
|
||||
if(!$searched_count) return;
|
||||
sort($searched_list);
|
||||
// D which pertain to the list of widgets loop spins return statement review the information you need
|
||||
for($i=0;$i<$searched_count;$i++)
|
||||
{
|
||||
// The name of the widget
|
||||
$widgetStyle = $searched_list[$i];
|
||||
// Wanted information on the Widget
|
||||
$widgetStyle_info = $this->getWidgetStyleInfo($widgetStyle);
|
||||
|
||||
$list[] = $widgetStyle_info;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Modules conf/info.xml wanted to read the information
|
||||
* It uses caching to reduce time for xml parsing ..
|
||||
*/
|
||||
function getWidgetInfo($widget)
|
||||
{
|
||||
// Get a path of the requested module. Return if not exists.
|
||||
$widget_path = $this->getWidgetPath($widget);
|
||||
if(!$widget_path) return;
|
||||
// Read the xml file for module skin information
|
||||
$xml_file = sprintf("%sconf/info.xml", $widget_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
// If the problem by comparing the cache file and include the return variable $widget_info
|
||||
$cache_file = sprintf('./files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
|
||||
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
|
||||
{
|
||||
@include($cache_file);
|
||||
return $widget_info;
|
||||
}
|
||||
// If no cache file exists, parse the xml and then return the variable.
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
$xml_obj = $tmp_xml_obj->widget;
|
||||
if(!$xml_obj) return;
|
||||
|
||||
$buff = '';
|
||||
|
||||
if($xml_obj->version && $xml_obj->attrs->version == '0.2')
|
||||
{
|
||||
// Title of the widget, version
|
||||
$buff .= sprintf('$widget_info->widget = "%s";', $widget);
|
||||
$buff .= sprintf('$widget_info->path = "%s";', $widget_path);
|
||||
$buff .= sprintf('$widget_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$widget_info->description = "%s";', $xml_obj->description->body);
|
||||
$buff .= sprintf('$widget_info->version = "%s";', $xml_obj->version->body);
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widget_info->date = "%s";', $date);
|
||||
$buff .= sprintf('$widget_info->homepage = "%s";', $xml_obj->link->body);
|
||||
$buff .= sprintf('$widget_info->license = "%s";', $xml_obj->license->body);
|
||||
$buff .= sprintf('$widget_info->license_link = "%s";', $xml_obj->license->attrs->link);
|
||||
$buff .= sprintf('$widget_info->widget_srl = $widget_srl;');
|
||||
$buff .= sprintf('$widget_info->widget_title = $widget_title;');
|
||||
// Author information
|
||||
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
|
||||
else $author_list = $xml_obj->author;
|
||||
|
||||
for($i=0; $i < count($author_list); $i++)
|
||||
{
|
||||
$buff .= sprintf('$widget_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
|
||||
$buff .= sprintf('$widget_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
|
||||
$buff .= sprintf('$widget_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
|
||||
}
|
||||
|
||||
// history
|
||||
if($xml_obj->history)
|
||||
{
|
||||
if(!is_array($xml_obj->history)) $history_list[] = $xml_obj->history;
|
||||
else $history_list = $xml_obj->history;
|
||||
|
||||
for($i=0; $i < count($history_list); $i++)
|
||||
{
|
||||
$widget_info->update_url = $oAutoinstallModel->getUpdateUrlByPackageSrl($packageSrl);
|
||||
sscanf($history_list[$i]->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->date = "%s";', $date);
|
||||
|
||||
if($history_list[$i]->author)
|
||||
{
|
||||
(!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author;
|
||||
|
||||
for($j=0; $j < count($obj->author_list); $j++)
|
||||
{
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
|
||||
if($history_list[$i]->log)
|
||||
{
|
||||
(!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log;
|
||||
|
||||
for($j=0; $j < count($obj->log_list); $j++) {
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Title of the widget, version
|
||||
$buff .= sprintf('$widget_info->widget = "%s";', $widget);
|
||||
$buff .= sprintf('$widget_info->path = "%s";', $widget_path);
|
||||
$buff .= sprintf('$widget_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$widget_info->description = "%s";', $xml_obj->author->description->body);
|
||||
$buff .= sprintf('$widget_info->version = "%s";', $xml_obj->attrs->version);
|
||||
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widget_info->date = "%s";', $date);
|
||||
$buff .= sprintf('$widget_info->widget_srl = $widget_srl;');
|
||||
$buff .= sprintf('$widget_info->widget_title = $widget_title;');
|
||||
// Author information
|
||||
$buff .= sprintf('$widget_info->author[0]->name = "%s";', $xml_obj->author->name->body);
|
||||
$buff .= sprintf('$widget_info->author[0]->email_address = "%s";', $xml_obj->author->attrs->email_address);
|
||||
$buff .= sprintf('$widget_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link);
|
||||
}
|
||||
// Extra vars (user defined variables to use in a template)
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
foreach($extra_var_groups as $group)
|
||||
{
|
||||
$extra_vars = $group->var;
|
||||
if(!is_array($group->var)) $extra_vars = array($group->var);
|
||||
|
||||
if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name)
|
||||
{
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$widget_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++)
|
||||
{
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
|
||||
$id = $var->attrs->id?$var->attrs->id:$var->attrs->name;
|
||||
$name = $var->name->body?$var->name->body:$var->title->body;
|
||||
$type = $var->attrs->type?$var->attrs->type:$var->type->body;
|
||||
if($type =='filebox') $buff .= sprintf('$widget_info->extra_var->%s->filter = "%s";', $id, $var->type->attrs->filter);
|
||||
if($type =='filebox') $buff .= sprintf('$widget_info->extra_var->%s->allow_multiple = "%s";', $id, $var->type->attrs->allow_multiple);
|
||||
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->group = "%s";', $id, $group->title->body);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->name = "%s";', $id, $name);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->type = "%s";', $id, $type);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->value = $vars->%s;', $id, $id);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body));
|
||||
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
||||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++)
|
||||
{
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->options["%s"] = "%s";', $id, $options[$j]->value->body, $options[$j]->name->body);
|
||||
|
||||
if($options[$j]->attrs->default && $options[$j]->attrs->default=='true')
|
||||
{
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->default_options["%s"] = true;', $id, $options[$j]->value->body);
|
||||
}
|
||||
|
||||
if($options[$j]->attrs->init && $options[$j]->attrs->init=='true')
|
||||
{
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->init_options["%s"] = true;', $id, $options[$j]->value->body);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$buff = '<?php if(!defined("__XE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
|
||||
if(file_exists($cache_file)) @include($cache_file);
|
||||
return $widget_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Modules conf/info.xml wanted to read the information
|
||||
* It uses caching to reduce time for xml parsing ..
|
||||
*/
|
||||
function getWidgetStyleInfo($widgetStyle)
|
||||
{
|
||||
$widgetStyle_path = $this->getWidgetStylePath($widgetStyle);
|
||||
if(!$widgetStyle_path) return;
|
||||
$xml_file = sprintf("%sskin.xml", $widgetStyle_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
// If the problem by comparing the cache file and include the return variable $widgetStyle_info
|
||||
$cache_file = sprintf('./files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
|
||||
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file))
|
||||
{
|
||||
@include($cache_file);
|
||||
return $widgetStyle_info;
|
||||
}
|
||||
// If no cache file exists, parse the xml and then return the variable.
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
$xml_obj = $tmp_xml_obj->widgetstyle;
|
||||
if(!$xml_obj) return;
|
||||
|
||||
$buff = '';
|
||||
// Title of the widget, version
|
||||
$buff .= sprintf('$widgetStyle_info->widgetStyle = "%s";', $widgetStyle);
|
||||
$buff .= sprintf('$widgetStyle_info->path = "%s";', $widgetStyle_path);
|
||||
$buff .= sprintf('$widgetStyle_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$widgetStyle_info->description = "%s";', $xml_obj->description->body);
|
||||
$buff .= sprintf('$widgetStyle_info->version = "%s";', $xml_obj->version->body);
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widgetStyle_info->date = "%s";', $date);
|
||||
$buff .= sprintf('$widgetStyle_info->homepage = "%s";', $xml_obj->link->body);
|
||||
$buff .= sprintf('$widgetStyle_info->license = "%s";', $xml_obj->license->body);
|
||||
$buff .= sprintf('$widgetStyle_info->license_link = "%s";', $xml_obj->license->attrs->link);
|
||||
|
||||
// preview
|
||||
if(!$xml_obj->preview->body) $xml_obj->preview->body = 'preview.jpg';
|
||||
$preview_file = sprintf("%s%s", $widgetStyle_path,$xml_obj->preview->body);
|
||||
if(file_exists($preview_file)) $buff .= sprintf('$widgetStyle_info->preview = "%s";', $preview_file);
|
||||
// Author information
|
||||
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
|
||||
else $author_list = $xml_obj->author;
|
||||
|
||||
for($i=0; $i < count($author_list); $i++)
|
||||
{
|
||||
$buff .= sprintf('$widgetStyle_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
|
||||
$buff .= sprintf('$widgetStyle_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
|
||||
$buff .= sprintf('$widgetStyle_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
|
||||
}
|
||||
|
||||
// history
|
||||
if($xml_obj->history)
|
||||
{
|
||||
if(!is_array($xml_obj->history)) $history_list[] = $xml_obj->history;
|
||||
else $history_list = $xml_obj->history;
|
||||
|
||||
for($i=0; $i < count($history_list); $i++)
|
||||
{
|
||||
sscanf($history_list[$i]->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->date = "%s";', $date);
|
||||
|
||||
if($history_list[$i]->author)
|
||||
{
|
||||
(!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author;
|
||||
|
||||
for($j=0; $j < count($obj->author_list); $j++)
|
||||
{
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
|
||||
$list[] = $widget_info;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
if($history_list[$i]->log)
|
||||
{
|
||||
(!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log;
|
||||
|
||||
/**
|
||||
* @brief Wanted photos of the type and information
|
||||
* Download a widget with type (generation and other means)
|
||||
**/
|
||||
function getDownloadedWidgetStyleList() {
|
||||
// 've Downloaded the widget and the widget's list of installed Wanted
|
||||
$searched_list = FileHandler::readDir('./widgetstyles');
|
||||
$searched_count = count($searched_list);
|
||||
if(!$searched_count) return;
|
||||
sort($searched_list);
|
||||
// D which pertain to the list of widgets loop spins return statement review the information you need
|
||||
for($i=0;$i<$searched_count;$i++) {
|
||||
// The name of the widget
|
||||
$widgetStyle = $searched_list[$i];
|
||||
// Wanted information on the Widget
|
||||
$widgetStyle_info = $this->getWidgetStyleInfo($widgetStyle);
|
||||
for($j=0; $j < count($obj->log_list); $j++)
|
||||
{
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Extra vars (user defined variables to use in a template)
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
foreach($extra_var_groups as $group)
|
||||
{
|
||||
$extra_vars = $group->var;
|
||||
if(!is_array($group->var)) $extra_vars = array($group->var);
|
||||
|
||||
$list[] = $widgetStyle_info;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name)
|
||||
{
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++)
|
||||
{
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
|
||||
/**
|
||||
* @brief Modules conf/info.xml wanted to read the information
|
||||
* It uses caching to reduce time for xml parsing ..
|
||||
**/
|
||||
function getWidgetInfo($widget) {
|
||||
// Get a path of the requested module. Return if not exists.
|
||||
$widget_path = $this->getWidgetPath($widget);
|
||||
if(!$widget_path) return;
|
||||
// Read the xml file for module skin information
|
||||
$xml_file = sprintf("%sconf/info.xml", $widget_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
// If the problem by comparing the cache file and include the return variable $widget_info
|
||||
$cache_file = sprintf('./files/cache/widget/%s.%s.cache.php', $widget, Context::getLangType());
|
||||
$id = $var->attrs->id?$var->attrs->id:$var->attrs->name;
|
||||
$name = $var->name->body?$var->name->body:$var->title->body;
|
||||
$type = $var->attrs->type?$var->attrs->type:$var->type->body;
|
||||
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->group = "%s";', $id, $group->title->body);
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->name = "%s";', $id, $name);
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->type = "%s";', $id, $type);
|
||||
if($type =='filebox') $buff .= sprintf('$widgetStyle_info->extra_var->%s->filter = "%s";', $id, $var->attrs->filter);
|
||||
if($type =='filebox') $buff .= sprintf('$widgetStyle_info->extra_var->%s->allow_multiple = "%s";', $id, $var->attrs->allow_multiple);
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->value = $vars->%s;', $id, $id);
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body));
|
||||
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file)) {
|
||||
@include($cache_file);
|
||||
return $widget_info;
|
||||
}
|
||||
// If no cache file exists, parse the xml and then return the variable.
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
$xml_obj = $tmp_xml_obj->widget;
|
||||
if(!$xml_obj) return;
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
||||
$buff = '';
|
||||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++)
|
||||
{
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->options["%s"] = "%s";', $id, $options[$j]->value->body, $options[$j]->name->body);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($xml_obj->version && $xml_obj->attrs->version == '0.2') {
|
||||
// Title of the widget, version
|
||||
$buff .= sprintf('$widget_info->widget = "%s";', $widget);
|
||||
$buff .= sprintf('$widget_info->path = "%s";', $widget_path);
|
||||
$buff .= sprintf('$widget_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$widget_info->description = "%s";', $xml_obj->description->body);
|
||||
$buff .= sprintf('$widget_info->version = "%s";', $xml_obj->version->body);
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widget_info->date = "%s";', $date);
|
||||
$buff .= sprintf('$widget_info->homepage = "%s";', $xml_obj->link->body);
|
||||
$buff .= sprintf('$widget_info->license = "%s";', $xml_obj->license->body);
|
||||
$buff .= sprintf('$widget_info->license_link = "%s";', $xml_obj->license->attrs->link);
|
||||
$buff .= sprintf('$widget_info->widget_srl = $widget_srl;');
|
||||
$buff .= sprintf('$widget_info->widget_title = $widget_title;');
|
||||
// Author information
|
||||
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
|
||||
else $author_list = $xml_obj->author;
|
||||
$buff = '<?php if(!defined("__XE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
|
||||
for($i=0; $i < count($author_list); $i++) {
|
||||
$buff .= sprintf('$widget_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
|
||||
$buff .= sprintf('$widget_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
|
||||
$buff .= sprintf('$widget_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
|
||||
}
|
||||
|
||||
// history
|
||||
if($xml_obj->history) {
|
||||
if(!is_array($xml_obj->history)) $history_list[] = $xml_obj->history;
|
||||
else $history_list = $xml_obj->history;
|
||||
|
||||
for($i=0; $i < count($history_list); $i++) {
|
||||
sscanf($history_list[$i]->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->date = "%s";', $date);
|
||||
|
||||
if($history_list[$i]->author) {
|
||||
(!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author;
|
||||
|
||||
for($j=0; $j < count($obj->author_list); $j++) {
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
|
||||
if($history_list[$i]->log) {
|
||||
(!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log;
|
||||
|
||||
for($j=0; $j < count($obj->log_list); $j++) {
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body);
|
||||
$buff .= sprintf('$widget_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// Title of the widget, version
|
||||
$buff .= sprintf('$widget_info->widget = "%s";', $widget);
|
||||
$buff .= sprintf('$widget_info->path = "%s";', $widget_path);
|
||||
$buff .= sprintf('$widget_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$widget_info->description = "%s";', $xml_obj->author->description->body);
|
||||
$buff .= sprintf('$widget_info->version = "%s";', $xml_obj->attrs->version);
|
||||
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widget_info->date = "%s";', $date);
|
||||
$buff .= sprintf('$widget_info->widget_srl = $widget_srl;');
|
||||
$buff .= sprintf('$widget_info->widget_title = $widget_title;');
|
||||
// Author information
|
||||
$buff .= sprintf('$widget_info->author[0]->name = "%s";', $xml_obj->author->name->body);
|
||||
$buff .= sprintf('$widget_info->author[0]->email_address = "%s";', $xml_obj->author->attrs->email_address);
|
||||
$buff .= sprintf('$widget_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link);
|
||||
}
|
||||
// Extra vars (user defined variables to use in a template)
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
foreach($extra_var_groups as $group){
|
||||
$extra_vars = $group->var;
|
||||
if(!is_array($group->var)) $extra_vars = array($group->var);
|
||||
|
||||
if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) {
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$widget_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++) {
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
|
||||
$id = $var->attrs->id?$var->attrs->id:$var->attrs->name;
|
||||
$name = $var->name->body?$var->name->body:$var->title->body;
|
||||
$type = $var->attrs->type?$var->attrs->type:$var->type->body;
|
||||
if($type =='filebox') $buff .= sprintf('$widget_info->extra_var->%s->filter = "%s";', $id, $var->type->attrs->filter);
|
||||
if($type =='filebox') $buff .= sprintf('$widget_info->extra_var->%s->allow_multiple = "%s";', $id, $var->type->attrs->allow_multiple);
|
||||
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->group = "%s";', $id, $group->title->body);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->name = "%s";', $id, $name);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->type = "%s";', $id, $type);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->value = $vars->%s;', $id, $id);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body));
|
||||
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
||||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++) {
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->options["%s"] = "%s";', $id, $options[$j]->value->body, $options[$j]->name->body);
|
||||
|
||||
if($options[$j]->attrs->default && $options[$j]->attrs->default=='true'){
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->default_options["%s"] = true;', $id, $options[$j]->value->body);
|
||||
}
|
||||
|
||||
if($options[$j]->attrs->init && $options[$j]->attrs->init=='true'){
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->init_options["%s"] = true;', $id, $options[$j]->value->body);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$buff = '<?php if(!defined("__ZBXE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
|
||||
if(file_exists($cache_file)) @include($cache_file);
|
||||
return $widget_info;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @brief Modules conf/info.xml wanted to read the information
|
||||
* It uses caching to reduce time for xml parsing ..
|
||||
**/
|
||||
function getWidgetStyleInfo($widgetStyle) {
|
||||
|
||||
$widgetStyle_path = $this->getWidgetStylePath($widgetStyle);
|
||||
if(!$widgetStyle_path) return;
|
||||
$xml_file = sprintf("%sskin.xml", $widgetStyle_path);
|
||||
if(!file_exists($xml_file)) return;
|
||||
// If the problem by comparing the cache file and include the return variable $widgetStyle_info
|
||||
$cache_file = sprintf('./files/cache/widgetstyles/%s.%s.cache.php', $widgetStyle, Context::getLangType());
|
||||
|
||||
if(file_exists($cache_file)&&filemtime($cache_file)>filemtime($xml_file)) {
|
||||
@include($cache_file);
|
||||
return $widgetStyle_info;
|
||||
}
|
||||
// If no cache file exists, parse the xml and then return the variable.
|
||||
$oXmlParser = new XmlParser();
|
||||
$tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file);
|
||||
$xml_obj = $tmp_xml_obj->widgetstyle;
|
||||
if(!$xml_obj) return;
|
||||
|
||||
$buff = '';
|
||||
// Title of the widget, version
|
||||
$buff .= sprintf('$widgetStyle_info->widgetStyle = "%s";', $widgetStyle);
|
||||
$buff .= sprintf('$widgetStyle_info->path = "%s";', $widgetStyle_path);
|
||||
$buff .= sprintf('$widgetStyle_info->title = "%s";', $xml_obj->title->body);
|
||||
$buff .= sprintf('$widgetStyle_info->description = "%s";', $xml_obj->description->body);
|
||||
$buff .= sprintf('$widgetStyle_info->version = "%s";', $xml_obj->version->body);
|
||||
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widgetStyle_info->date = "%s";', $date);
|
||||
$buff .= sprintf('$widgetStyle_info->homepage = "%s";', $xml_obj->link->body);
|
||||
$buff .= sprintf('$widgetStyle_info->license = "%s";', $xml_obj->license->body);
|
||||
$buff .= sprintf('$widgetStyle_info->license_link = "%s";', $xml_obj->license->attrs->link);
|
||||
|
||||
// preview
|
||||
if(!$xml_obj->preview->body) $xml_obj->preview->body = 'preview.jpg';
|
||||
$preview_file = sprintf("%s%s", $widgetStyle_path,$xml_obj->preview->body);
|
||||
if(file_exists($preview_file)) $buff .= sprintf('$widgetStyle_info->preview = "%s";', $preview_file);
|
||||
// Author information
|
||||
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
|
||||
else $author_list = $xml_obj->author;
|
||||
|
||||
for($i=0; $i < count($author_list); $i++) {
|
||||
$buff .= sprintf('$widgetStyle_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
|
||||
$buff .= sprintf('$widgetStyle_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
|
||||
$buff .= sprintf('$widgetStyle_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
|
||||
}
|
||||
|
||||
// history
|
||||
if($xml_obj->history) {
|
||||
if(!is_array($xml_obj->history)) $history_list[] = $xml_obj->history;
|
||||
else $history_list = $xml_obj->history;
|
||||
|
||||
for($i=0; $i < count($history_list); $i++) {
|
||||
sscanf($history_list[$i]->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->date = "%s";', $date);
|
||||
|
||||
if($history_list[$i]->author) {
|
||||
(!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author;
|
||||
|
||||
for($j=0; $j < count($obj->author_list); $j++) {
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
|
||||
if($history_list[$i]->log) {
|
||||
(!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log;
|
||||
|
||||
for($j=0; $j < count($obj->log_list); $j++) {
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body);
|
||||
$buff .= sprintf('$widgetStyle_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Extra vars (user defined variables to use in a template)
|
||||
$extra_var_groups = $xml_obj->extra_vars->group;
|
||||
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
|
||||
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
|
||||
foreach($extra_var_groups as $group){
|
||||
$extra_vars = $group->var;
|
||||
if(!is_array($group->var)) $extra_vars = array($group->var);
|
||||
|
||||
if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) {
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++) {
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
|
||||
$id = $var->attrs->id?$var->attrs->id:$var->attrs->name;
|
||||
$name = $var->name->body?$var->name->body:$var->title->body;
|
||||
$type = $var->attrs->type?$var->attrs->type:$var->type->body;
|
||||
|
||||
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->group = "%s";', $id, $group->title->body);
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->name = "%s";', $id, $name);
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->type = "%s";', $id, $type);
|
||||
if($type =='filebox') $buff .= sprintf('$widgetStyle_info->extra_var->%s->filter = "%s";', $id, $var->attrs->filter);
|
||||
if($type =='filebox') $buff .= sprintf('$widgetStyle_info->extra_var->%s->allow_multiple = "%s";', $id, $var->attrs->allow_multiple);
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->value = $vars->%s;', $id, $id);
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body));
|
||||
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
||||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++) {
|
||||
$buff .= sprintf('$widgetStyle_info->extra_var->%s->options["%s"] = "%s";', $id, $options[$j]->value->body, $options[$j]->name->body);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$buff = '<?php if(!defined("__ZBXE__")) exit(); '.$buff.' ?>';
|
||||
FileHandler::writeFile($cache_file, $buff);
|
||||
|
||||
if(file_exists($cache_file)) @include($cache_file);
|
||||
return $widgetStyle_info;
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
if(file_exists($cache_file)) @include($cache_file);
|
||||
return $widgetStyle_info;
|
||||
}
|
||||
}
|
||||
/* End of file widget.model.php */
|
||||
/* Location: ./modules/widget/widget.model.php */
|
||||
|
|
|
|||
|
|
@ -1,138 +1,152 @@
|
|||
<?php
|
||||
/**
|
||||
* @class widgetView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief View class of the widget modules
|
||||
**/
|
||||
/**
|
||||
* @class widgetView
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief View class of the widget modules
|
||||
*/
|
||||
class widgetView extends widget
|
||||
{
|
||||
/**
|
||||
* @brief Initialization
|
||||
*/
|
||||
function init()
|
||||
{
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
|
||||
class widgetView extends widget {
|
||||
/**
|
||||
* @brief Details of the widget (conf/info.xml) a pop-out
|
||||
*/
|
||||
function dispWidgetInfo()
|
||||
{
|
||||
// If people have skin widget widget output as a function of the skin More Details
|
||||
if(Context::get('skin')) return $this->dispWidgetSkinInfo();
|
||||
// Wanted widget is selected information
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_info = $oWidgetModel->getWidgetInfo(Context::get('selected_widget'));
|
||||
Context::set('widget_info', $widget_info);
|
||||
// Specifies the widget to pop up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Set a template file
|
||||
$this->setTemplateFile('widget_detail_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialization
|
||||
**/
|
||||
function init() {
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
}
|
||||
/**
|
||||
* @brief Widget details of the skin (skin.xml) a pop-out
|
||||
*/
|
||||
function dispWidgetSkinInfo()
|
||||
{
|
||||
$widget = Context::get('selected_widget');
|
||||
$skin = Context::get('skin');
|
||||
|
||||
/**
|
||||
* @brief Details of the widget (conf/info.xml) a pop-out
|
||||
**/
|
||||
function dispWidgetInfo() {
|
||||
// If people have skin widget widget output as a function of the skin More Details
|
||||
if(Context::get('skin')) return $this->dispWidgetSkinInfo();
|
||||
// Wanted widget is selected information
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_info = $oWidgetModel->getWidgetInfo(Context::get('selected_widget'));
|
||||
Context::set('widget_info', $widget_info);
|
||||
// Specifies the widget to pop up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Set a template file
|
||||
$this->setTemplateFile('widget_detail_info');
|
||||
}
|
||||
$path = sprintf('./widgets/%s/', $widget);
|
||||
// Wanted widget is selected information
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($path, $skin);
|
||||
|
||||
/**
|
||||
* @brief Widget details of the skin (skin.xml) a pop-out
|
||||
**/
|
||||
function dispWidgetSkinInfo() {
|
||||
$widget = Context::get('selected_widget');
|
||||
$skin = Context::get('skin');
|
||||
Context::set('skin_info',$skin_info);
|
||||
// Specifies the widget to pop up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Set a template file
|
||||
$this->setTemplateFile('skin_info');
|
||||
}
|
||||
|
||||
$path = sprintf('./widgets/%s/', $widget);
|
||||
// Wanted widget is selected information
|
||||
$oModuleModel = &getModel('module');
|
||||
$skin_info = $oModuleModel->loadSkinInfo($path, $skin);
|
||||
/**
|
||||
* @brief Widget's code generator
|
||||
*/
|
||||
function dispWidgetGenerateCode()
|
||||
{
|
||||
// Wanted widget is selected information
|
||||
$oWidgetModel = &getModel('widget');
|
||||
|
||||
Context::set('skin_info',$skin_info);
|
||||
// Specifies the widget to pop up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Set a template file
|
||||
$this->setTemplateFile('skin_info');
|
||||
}
|
||||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
$selected_widget = Context::get('selected_widget');
|
||||
if(!$selected_widget) $selected_widget = $widget_list[0]->widget;
|
||||
|
||||
/**
|
||||
* @brief Widget's code generator
|
||||
**/
|
||||
function dispWidgetGenerateCode() {
|
||||
// Wanted widget is selected information
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
|
||||
Context::set('widget_info', $widget_info);
|
||||
Context::set('widget_list', $widget_list);
|
||||
Context::set('selected_widget', $selected_widget);
|
||||
|
||||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
$selected_widget = Context::get('selected_widget');
|
||||
if(!$selected_widget) $selected_widget = $widget_list[0]->widget;
|
||||
$oModuleModel = &getModel('module');
|
||||
// Get a list of module categories
|
||||
$module_categories = $oModuleModel->getModuleCategories();
|
||||
// Get a mid list
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args = new stdClass();
|
||||
$args->site_srl = $site_module_info->site_srl;
|
||||
$columnList = array('module_srl', 'module_category_srl', 'browser_title', 'mid');
|
||||
$mid_list = $oModuleModel->getMidList($args, $columnList);
|
||||
|
||||
$widget_info = $oWidgetModel->getWidgetInfo($selected_widget);
|
||||
Context::set('widget_info', $widget_info);
|
||||
Context::set('widget_list', $widget_list);
|
||||
Context::set('selected_widget', $selected_widget);
|
||||
// Get a list of groups
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups($site_module_info->site_srl);
|
||||
Context::set('group_list', $group_list);
|
||||
// module_category and module combination
|
||||
if($module_categories)
|
||||
{
|
||||
foreach($mid_list as $module_srl => $module) {
|
||||
$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$module_categories[0] = new stdClass();
|
||||
$module_categories[0]->list = $mid_list;
|
||||
}
|
||||
|
||||
$oModuleModel = &getModel('module');
|
||||
// Get a list of module categories
|
||||
$module_categories = $oModuleModel->getModuleCategories();
|
||||
// Get a mid list
|
||||
$site_module_info = Context::get('site_module_info');
|
||||
$args->site_srl = $site_module_info->site_srl;
|
||||
$columnList = array('module_srl', 'module_category_srl', 'browser_title', 'mid');
|
||||
$mid_list = $oModuleModel->getMidList($args, $columnList);
|
||||
Context::set('mid_list',$module_categories);
|
||||
// Menu Get a list
|
||||
$output = executeQueryArray('menu.getMenus');
|
||||
Context::set('menu_list',$output->data);
|
||||
// Wanted information on skin
|
||||
$skin_list = $oModuleModel->getSkins($widget_info->path);
|
||||
Context::set('skin_list', $skin_list);
|
||||
// Specifies the widget to pop up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Set a template file
|
||||
$this->setTemplateFile('widget_generate_code');
|
||||
}
|
||||
|
||||
// Get a list of groups
|
||||
$oMemberModel = &getModel('member');
|
||||
$group_list = $oMemberModel->getGroups($site_module_info->site_srl);
|
||||
Context::set('group_list', $group_list);
|
||||
// module_category and module combination
|
||||
if($module_categories) {
|
||||
foreach($mid_list as $module_srl => $module) {
|
||||
$module_categories[$module->module_category_srl]->list[$module_srl] = $module;
|
||||
}
|
||||
} else {
|
||||
$module_categories[0]->list = $mid_list;
|
||||
}
|
||||
/**
|
||||
* @brief Managing pop-up pages used in the generated code
|
||||
*/
|
||||
function dispWidgetGenerateCodeInPage()
|
||||
{
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
Context::set('widget_list',$widget_list);
|
||||
Context::set('admin_bar','false');
|
||||
// When there is no widget is selected in the first widget
|
||||
if(!Context::get('selected_widget')) Context::set('selected_widget',$widget_list[0]->widget);
|
||||
|
||||
Context::set('mid_list',$module_categories);
|
||||
// Menu Get a list
|
||||
$output = executeQueryArray('menu.getMenus');
|
||||
Context::set('menu_list',$output->data);
|
||||
// Wanted information on skin
|
||||
$skin_list = $oModuleModel->getSkins($widget_info->path);
|
||||
Context::set('skin_list', $skin_list);
|
||||
// Specifies the widget to pop up
|
||||
$this->setLayoutFile('popup_layout');
|
||||
// Set a template file
|
||||
$this->setTemplateFile('widget_generate_code');
|
||||
}
|
||||
$this->dispWidgetGenerateCode();
|
||||
$this->setLayoutFile('default_layout');
|
||||
$this->setTemplateFile('widget_generate_code_in_page');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Managing pop-up pages used in the generated code
|
||||
**/
|
||||
function dispWidgetGenerateCodeInPage() {
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widget_list = $oWidgetModel->getDownloadedWidgetList();
|
||||
Context::set('widget_list',$widget_list);
|
||||
// When there is no widget is selected in the first widget
|
||||
if(!Context::get('selected_widget')) Context::set('selected_widget',$widget_list[0]->widget);
|
||||
/**
|
||||
* @brief Create widget style code page used in the pop-up management
|
||||
*/
|
||||
function dispWidgetStyleGenerateCodeInPage()
|
||||
{
|
||||
// Widget-style list
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widgetStyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
|
||||
Context::set('widgetStyle_list',$widgetStyle_list);
|
||||
Context::set('admin_bar','false');
|
||||
// Selected list of widget styles
|
||||
$widgetstyle = Context::get('widgetstyle');
|
||||
$widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetstyle);
|
||||
if($widgetstyle && $widgetstyle_info)
|
||||
{
|
||||
Context::set('widgetstyle_info',$widgetstyle_info);
|
||||
}
|
||||
|
||||
$this->dispWidgetGenerateCode();
|
||||
$this->setLayoutFile('default_layout');
|
||||
$this->setTemplateFile('widget_generate_code_in_page');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Create widget style code page used in the pop-up management
|
||||
**/
|
||||
function dispWidgetStyleGenerateCodeInPage() {
|
||||
// Widget-style list
|
||||
$oWidgetModel = &getModel('widget');
|
||||
$widgetStyle_list = $oWidgetModel->getDownloadedWidgetStyleList();
|
||||
Context::set('widgetStyle_list',$widgetStyle_list);
|
||||
// Selected list of widget styles
|
||||
$widgetstyle = Context::get('widgetstyle');
|
||||
$widgetstyle_info = $oWidgetModel->getWidgetStyleInfo($widgetstyle);
|
||||
if($widgetstyle && $widgetstyle_info){
|
||||
Context::set('widgetstyle_info',$widgetstyle_info);
|
||||
}
|
||||
|
||||
$this->dispWidgetGenerateCode();
|
||||
$this->setLayoutFile('default_layout');
|
||||
$this->setTemplateFile('widget_style_generate_code_in_page');
|
||||
}
|
||||
}
|
||||
?>
|
||||
$this->dispWidgetGenerateCode();
|
||||
$this->setLayoutFile('default_layout');
|
||||
$this->setTemplateFile('widget_style_generate_code_in_page');
|
||||
}
|
||||
}
|
||||
/* End of file widget.view.php */
|
||||
/* Location: ./modules/widget/widget.view.php */
|
||||
|
|
|
|||