widget module

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9031 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-05 10:01:33 +00:00
parent 249ba8c7f5
commit 2a8c16d4f9
13 changed files with 550 additions and 557 deletions

View file

@ -1,111 +1,95 @@
<!--%import("filter/style_generate_code_in_page.xml")-->
<!--%import("js/widget_admin.js")-->
<!--%import("css/widget.css")-->
<!--%import("../../admin/tpl/css/admin.css")-->
<!--%load_js_plugin("filebox")-->
<load target="../../admin/tpl/js/admin.js" />
<load target="../../admin/tpl/css/admin.css" />
<load target="../../admin/tpl/css/admin_{$lang_type}.css" />
<load target="css/widget.css" />
<load target="js/generate_code.js" />
<!--%load_js_plugin("ui.colorpicker")-->
<script type="text/javascript">
doAddWindowLoadEventLoader(getWidgetVars);
jQuery(document).ready(function(){
getWidgetVars();
});
</script>
<div id="popHeader" class="wide">
<h3 class="xeAdmin">{$lang->widgetstyle}</h3>
</div>
<div class="x" style="padding: 0 10px;">
<h2 class="h2">{$lang->widgetstyle}</h2>
<form action="{getUrl('')}" method="post" enctype="multipart/form-data" target="hidden_iframe" onsubmit="return procFilter(this, style_generate_code_in_page);" 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="" />
<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="module" value="widget" />
<input type="hidden" name="act" value="" />
<input type="hidden" name="widgetstyle" value="{$widgetstyle}" />
<input type="hidden" name="selected_widget" value="{$selected_widget}" />
<div id="popBody">
<form class="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="" />
<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="module" value="widget" />
<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 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>
<div class="clear"></div>
<!--@foreach($widgetStyle_list as $key => $widgetStyle)-->
<!--@if($widgetStyle->preview)-->
<a 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>
<!--@end-->
<!--@end-->
<div class="clear"></div>
<block cond="$widgetstyle_info">
<h3 class="h3">{$widgetstyle_info->title} ver {$widgetstyle_info->version}</h3>
<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">
<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>
<!--@if($widgetstyle_info)-->
<h4 class="xeAdmin">{$widgetstyle_info->title} ver {$widgetstyle_info->version}</h4>
<table cellspacing="0" class="rowTable">
<tr>
<th scope="row"><div>{$lang->description}</div></th>
<td>{$widgetstyle_info->description}</td>
</tr>
<tr>
<th scope="row"><div>{$lang->author}</div></th>
<td>
<!--@foreach($widgetstyle_info->author as $k => $author)-->
{$author->name} ({$author->homepage})
<!--@end-->
</td>
</tr>
<tr>
<th scope="row"><div>{$lang->regdate}</div></th>
<td>{zdate($widgetstyle_info->date,'Y-m-d')}</td>
</tr>
</table>
<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">{$var->name}</p>
<p class="a">
<input cond="$var->type == 'text'" type="text" name="{$id}" />
<h4 class="xeAdmin">{$lang->cmd_setup}</h4>
<table cellspacing="0" class="rowTable">
<!--@foreach($widgetstyle_info->extra_var as $id => $var)-->
<tr>
<th scope="row">
<div>
{$var->name}
</div>
</th>
<td>
<!--@if($var->type == "text")-->
<input type="text" name="{$id}" id="{$id}" value="" class="inputTypeText w400 lang_code" />
<input cond="$var->type == 'color'" type="text" name="{$id}" class="color-indicator" />
<!--@elseif($var->type == "color")-->
<textarea cond="$var->type == 'textarea'" name="{$id}"></textarea>
<input type="text" name="{$id}" value="" class="inputTypeText color-indicator" />
<select cond="$var->type == 'select'" name="{$id}">
<option loop="$var->options => $key, $val" value="{$key}">{$val}</option>
</select>
<!--@elseif($var->type == "textarea")-->
<textarea name="{$id}" class="inputTypeTextArea w400"></textarea>
<block cond="$var->type == 'filebox'">
<input type="hidden" name="{$id}" />
<a href="#modalFilebox" class="modalAnchor filebox">{$lang->cmd_select}</a>
</block>
</p>
<p class="desc">{$var->description}</p>
</li>
</block>
</block>
<!--@elseif($var->type == "select")-->
<select name="{$id}">
<!--@foreach($var->options as $key => $val)-->
<option value="{$key}">{$val}</option>
<!--@end-->
</select>
<!--@elseif($var->type == "filebox")-->
<div id="filebox_preview_{$id}" style="width:100px;height:100px;display:none" ></div>
<input type="hidden" name="{$id}" value="" />
<span class="button black"><button type="button" onclick="XE.filebox.open(jQuery('[name={$id}]', '#fo_widget').get(0), '{$var->filter}')">{$lang->cmd_select}</button></span>
<span id="filebox_cancel_{$id}" class="button red" style="display:none" ><button type="button" onclick="XE.filebox.cancel('{$id}')">{$lang->cmd_delete}</button></span>
<script type="text/javascript">//<![CDATA[
XE.filebox.init('{$id}');
//]]></script>
<!--@end-->
<p class="clear">{nl2br($var->description)}</p>
</td>
</tr>
<!--@end-->
</table>
<!--@end-->
<div class="btnArea">
<span class="btn small"><input type="submit" value="{$lang->cmd_setup}" /></span>
</div>
</form>
<include target="widget_generate_code.filebox.html" />
</div>
<div id="popFooter">
<span class="button black strong"><input type="submit" value="{$lang->cmd_setup}" /></span>
</div>
</form>
<iframe name="hidden_iframe" frameborder="0" style="display:none"></iframe>