Files
Pichome/admin/setting/template/smileyedit.htm
2024-01-31 01:00:33 +08:00

124 lines
5.6 KiB
HTML

<!--{template common/header_simple_start}-->
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
<script src="admin/scripts/admin.js?{VERHASH}"></script>
<style>
.form-horizontal-left .radio-inline {
padding: 5px 20px;
margin: 0;
}
</style>
<!--{template common/header_simple_end}-->
<!--{template common/commer_header}-->
<div class="bs-container clearfix">
<div class="bs-left-container clearfix">
<!--{template left}-->
</div>
<div class="left-drager">
<div class="left-drager-op">
<div class="left-drager-sub"></div>
</div>
</div>
<div class="bs-main-container clearfix" style="min-width:250px">
<div class="main-header clearfix ">
<ul class="nav navbar-nav nav-pills-bottomguide">
<li>
<a href="{BASESCRIPT}?mod=setting&operation=smiley">{lang expression_set}</a>
</li>
<li>
<a href="{BASESCRIPT}?mod=setting&op=smiley">{lang expression_class}</a>
</li>
<li class="active">
<a href="{BASESCRIPT}?mod=setting&operation=$operation&op=smiley&id=$id">{lang detailedness} - $smtype[name]</a>
</li>
</ul>
</div>
<div class="main-content clearfix" style="border-top:1px solid #FFF">
<form id="appform" name="appform" class="form-horizontal" action="{BASESCRIPT}?mod=setting&op=smiley&operation=edit" method="post">
<input type="hidden" name="editsubmit" value="true" />
<input type="hidden" name="id" value="$id" />
<input type="hidden" name="formhash" value="{FORMHASH}" />
<table class="table table-hover">
<thead>
<th width="30">&nbsp;</th>
<th>{lang sort}</th>
<th>{lang photo}</th>
<th>{lang expression}ID</th>
<th>{lang expression_code}</th>
<th>{lang expression_describing}</th>
<th>{lang filename}</th>
</thead>
<!--{loop $list $key $value}-->
<tr>
<td align="center">
<input type="checkbox" name="delete[]" value="$value[id]" />
</td>
<td><input type="text" class="form-control" style="width:45px;" name="displayorder[{$value[id]}]" value="$value[displayorder]" style="width:20px;" /></td>
<td><img src="$smurl/$value[url]" border="0" onload="if(this.height>30) {this.resized=true; this.height=30;}" onmouseover="if(this.resized) this.style.cursor='pointer';" onclick="if(!this.resized) {return false;} else {window.open(this.src);}"></td>
<td>$value[id]</td>
<td><input type="text" class="form-control" name="code[{$value[id]}]" id="code_{$key}" value="$value[code]" smileyid="$value[id]" /></td>
<td><input type="text" class="form-control" name="title[{$value[id]}]" id="title_{$key}" value="$value[title]" /></td>
<td>$value[url]<input type="hidden" value="$value[url]" id="url_{$key}" /></td>
</tr>
<!--{/loop}-->
<tr>
<td></td>
<td colspan="8" style="">
{lang batch_code_set_expression}
<input type="text" style="margin-right:0;width:40px;height:30px;padding:2px 4px" value="{:" title="{lang prefix}" id="prefix" onclick="clearinput(this, '{lang prefix}')"> +
<select id="middle" style="width:100px;height:30px;padding:2px 4px">
<option value="1">{lang filename}</option>
<option value="2">{lang natural_order}</option>
<option value="3">{lang expression} ID</option>
<option value="4">{lang expression_describing}</option>
</select>
+
<input type="text" style="margin-right:0;width:40px;height:30px;padding:2px 4px" value=":}" title="{lang suffix}" id="suffix" onclick="clearinput(this, '{lang suffix}')">
<input type="button" class="btn btn-default" onclick="addsmileycodes('{$smileynum}', '');" value="{lang type_app}"> &nbsp;&nbsp; <input type="button" class="btn btn-default" onclick="autoaddsmileycodes('{$smileynum}');" value="{lang automatic_set}">
</td>
</tr>
<thead>
<th colspan="15" valign="middle" style="border:none"><label for="chkall" class="checkbox-inline"><input type="checkbox" name="chkall" id="chkall" onclick="checkAll('prefix', this.form, 'delete')">&nbsp;{lang del}</label>&nbsp;&nbsp;<input type="submit" class="btn btn-primary" value="{lang submit}" /></th>
</thead>
</table>
</form>
</div>
</div>
</div>
<script type="text/JavaScript">
jQuery('.left-drager').leftDrager_layout();
function addsmileycodes(smiliesnum, pre) {
smiliesnum = parseInt(smiliesnum);
if(smiliesnum > 1) {
for(var i = 1; i < smiliesnum; i++) {
var prefix=trim($(pre + 'prefix').value);
var suffix=trim($(pre + 'suffix').value);
var page=parseInt( '$page');
var middle=$(pre + 'middle').value==1 ? $(pre + 'url_' + i).value.substr(0,$(pre + 'url_' + i).value.lastIndexOf( '.')) : ($(pre + 'middle').value==2 ? i + page * 10 : ($(pre + 'middle').value==3 ? $(pre + 'code_'+ i).attributes[ 'smileyid'].nodeValue:$(pre + 'title_'+ i).value));
if(!prefix || prefix=='{lang prefix}' || !suffix || suffix=='{lang suffix}' ) {
alert( '{lang seeting_smileyedit_prefix}');
return;
}
suffix=! suffix || suffix=='{lang suffix}' ? '' : suffix; $(pre + 'code_' + i).value=prefix + middle + suffix;
}
}
}
function autoaddsmileycodes(smiliesnum) {
smiliesnum=parseInt(smiliesnum);
if(smiliesnum > 1) {
for(var i = 1; i < smiliesnum; i++) {
$( 'code_' + i).value='{:' + '$id' + '_' + $( 'code_'+ i).attributes[ 'smileyid'].nodeValue + ':}';
}
}
}
function clearinput(obj, defaultval) {
if(obj.value==defaultval) {
obj.value='' ;
}
}
</script>
<!--{template common/footer_simple}-->