<extend name="Public/base" /> <block name="style"> <style> .dragsort { width:400px; } </style> </block> <block name="body"> <!-- 标题栏 --> <div class="cf main-place top_nav_list navtab_list"> <h3 class="page_title"><present name="data">编辑<else />新增</present>钩子</a></h3> <p class="description_text"></p> </div> <div class="tab-content tabcon1711 tabcon17112"> <!-- 修改密码表单 --> <form action="{:U('updateHook')}" method="post" class="form-horizontal form_info_ml"> <table border="0" cellspacing="0" cellpadding="0"> <tbody> <tr> <td class="l noticeinfo">钩子名称</td> <td class="r table_radio"> <input name="name" value="{$data.name}" type="text" class=""> <span class="notice-text">需要在程序中先添加钩子,否则无效</span> </td> </tr> <tr> <td class="l noticeinfo">钩子描述</td> <td class="r table_radio"> <textarea name="description" >{$data.description}</textarea> <span class="notice-text">钩子的描述信息</span> </td> </tr> <tr> <td class="l noticeinfo">钩子类型</td> <td class="r table_radio"> <select name="type"> <volist name=":C('HOOKS_TYPE')" id="vo"> <option value="{$key}" <eq name="data.type" value="$key"> selected</eq>>{$vo}</option> </volist> </select> <span class="notice-text">区分钩子的主要用途</span> </td> </tr> <present name="data"> <tr> <td class="l noticeinfo">钩子挂载的插件排序</td> <td class="r table_radio"> <input type="hidden" name="addons" value="{$data.addons}" readonly> <empty name="data.addons"> <span style="line-height:34px;">暂无插件,无法排序</span> <else /> <ul id="sortUl" class="dragsort" style="width:100%;"> <volist name=":explode(',',$data['addons'])" id="addons_vo"> <li class="getSort"><b>×</b><em>{$addons_vo}</em></li> </volist> </ul> <script type="text/javascript"> $(function(){ $("#sortUl").dragsort({ dragSelector:'li', placeHolderTemplate: '<li class="draging-place"> </li>', dragEnd:function(){ updateVal(); } }); $('#sortUl li b').click(function(){ $(this).parent().remove(); updateVal(); }); // 更新排序后的隐藏域的值 function updateVal() { var sortVal = []; $('#sortUl li').each(function(){ sortVal.push($('em',this).text()); }); $("input[name='addons']").val(sortVal.join(',')); } }) </script> </empty> <span class="notice-text">拖动后保存顺序,影响同一个钩子挂载的插件执行先后顺序</span> </td> </tr> </present> </tbody> </table> <input type="hidden" name="id" value="{$data.id}"> <input type="hidden" name="account" value="{$data.account}"> <input type="submit" id="submit" value="保存" target-form="form-horizontal" class="submit_btn form_btn ajax-post mlspacing"> <a class="submit_btn " alt="返回上一页" title="返回上一页" href="javascript:window.history.back();" > 返回 </a> </form> </div> </block> <block name="script"> <present name="data"> <script type="text/javascript" src="__STATIC__/jquery.dragsort-0.5.1.min.js"></script> </present> <script type="text/javascript"> $(function(){ //导航高亮 highlight_subnav('{:U('Addons/hooks')}'); }) </script> </block>