Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

edit.htm 8.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. {include file="public/layout" /}
  2. <body class="bodystyle" style="overflow-y: scroll; cursor: default; -moz-user-select: inherit;">
  3. <div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
  4. <div id="append_parent"></div>
  5. <div id="ajaxwaitid"></div>
  6. <div class="page">
  7. <form class="form-horizontal" id="post_form" action="{:url('Navigation/edit')}" method="post">
  8. <input type="hidden" name="nav_id" value="{$navigList.nav_id}">
  9. <input type="hidden" name="position_id" value="{$navigList.position_id}">
  10. <div class="ncap-form-default tab_div_1">
  11. <dl class="row">
  12. <dt class="tit"><label for="typename"><em>*</em>导航位置</label></dt>
  13. <dd class="opt">{$navigList.position_name}</dd>
  14. </dl>
  15. <dl class="row">
  16. <dt class="tit"><label>快速生成菜单</label></dt>
  17. <dd class="opt">
  18. <select class="small form-control" onchange="functionData(this);">
  19. <option value="0" id="default" {notempty name="$navigList.type_id"} selected="true" {/notempty}>功能页面</option>
  20. {volist name="$function" id="vo"}
  21. <option value="{$vo.url}" data-title="{$vo.title}" {eq name="$navigList.nav_url" value="$vo.url"}selected="true"{/eq}>{$vo.title}</option>
  22. {/volist}
  23. </select>
  24. <span id="huozhe" {empty name="$navigList.type_id"} style="display: none;" {/empty}>或者</span>
  25. <span id="choose_type" {empty name="$navigList.type_id"} style="display: none;" {/empty}>
  26. {$arctypeHtml}
  27. </span>
  28. </dd>
  29. </dl>
  30. <dl class="row">
  31. <dt class="tit"><label for="nav_name"><em>*</em>菜单名称</label></dt>
  32. <dd class="opt">
  33. <input type="text" name="nav_name" id="nav_name" value="{$navigList.nav_name}" class="input-txt" {eq name="$navigList.arctype_sync" value="1"} readonly="readonly" {/eq}>
  34. <p class="notic"></p>
  35. </dd>
  36. </dl>
  37. <dl class="row {if condition='0 == $allowUpdate || !empty($navigList.type_id)' } none {/if}" id="dl_nav_url">
  38. <dt class="tit"><label for="nav_url"><em>*</em>菜单链接</label></dt>
  39. <dd class="opt">
  40. <input type="text" name="nav_url" id="nav_url" value="{$navigList.nav_url}" class="input-txt" {eq name="$navigList.arctype_sync" value="1"} readonly="readonly" {/eq}>
  41. <p class="notic"></p>
  42. </dd>
  43. </dl>
  44. <dl class="row">
  45. <dt class="tit"><label for="en_name">菜单副名</label></dt>
  46. <dd class="opt">
  47. <input type="text" name="en_name" id="en_name" value="{$navigList.en_name}" class="input-txt">
  48. <p class="notic">副名可用作栏目英文名、副标题等用途,若不用可不必填写</p>
  49. </dd>
  50. </dl>
  51. <dl class="row">
  52. <dt class="tit">
  53. <label>栏目图片</label>
  54. </dt>
  55. <dd class="opt">
  56. <div class="input-file-show" >
  57. <span class="show">
  58. <a id="img_a" target="_blank" class="nyroModal" rel="gal" href="{$navigList.nav_pic|default='javascript:void(0);'}">
  59. <i id="img_i" class="fa fa-picture-o" {notempty name="$navigList.nav_pic"}onmouseover="layer_tips=layer.tips('<img src={$navigList.nav_pic} class=\'layer_tips_img\'>',this,{tips: [1, '#fff']});"{/notempty} onmouseout="layer.close(layer_tips);"></i>
  60. </a>
  61. </span>
  62. <span class="type-file-box">
  63. <input type="text" id="nav_pic" name="nav_pic" value="{$navigList.nav_pic|default=''}" class="type-file-text" autocomplete="off">
  64. <input type="button" name="button" id="button1" value="选择上传..." class="type-file-button">
  65. <input class="type-file-file" onClick="GetUploadifyFrame(1,'','allimg','img_call_back')" size="30" hidefocus="true" nc_type="change_site_logo"
  66. title="点击前方预览图可查看大图,点击按钮选择文件并提交表单后上传生效">
  67. </span>
  68. </div>
  69. <span class="err"></span>
  70. <p class="notic"></p>
  71. </dd>
  72. </dl>
  73. <dl class="row">
  74. <dt class="tit"><label>链接属性</label></dt>
  75. <dd class="opt">
  76. <label><input type="checkbox" name="target" value="1" {eq name="$navigList.target" value="1"}checked="checked"{/eq}>&nbsp;新窗口打开</label>
  77. &nbsp;&nbsp;
  78. <label><input type="checkbox" name="nofollow" value="1" {eq name="$navigList.nofollow" value="1"}checked="checked"{/eq}>&nbsp;nofollow</label>
  79. </dd>
  80. </dl>
  81. </div>
  82. <div class="ncap-form-default">
  83. <div class="bot">
  84. <a href="JavaScript:void(0);" onclick="check_submit();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
  85. </div>
  86. </div>
  87. </form>
  88. </div>
  89. <script type="text/javascript">
  90. function check_submit() {
  91. if($('input[name="nav_name"]').val() == ''){
  92. showErrorMsg('请填写菜单名称');
  93. $('input[name=nav_name]').focus();
  94. return false;
  95. }
  96. if($('input[name="nav_url"]').val() == ''){
  97. showErrorMsg('请填写菜单链接');
  98. $('input[name=nav_url]').focus();
  99. return false;
  100. }
  101. layer_loading('正在处理');
  102. $.ajax({
  103. type : 'post',
  104. url : "{:url('Navigation/edit', ['_ajax'=>1])}",
  105. data : $('#post_form').serialize(),
  106. dataType : 'json',
  107. success : function(data){
  108. layer.closeAll();
  109. if(data.code == 1){
  110. layer.msg(data.msg, {icon: 1, time:1000}, function(){
  111. parent.window.location.reload();
  112. });
  113. }else{
  114. layer.alert(data.msg, {icon: 2, title:false});
  115. }
  116. }
  117. });
  118. }
  119. function img_call_back(fileurl_tmp) {
  120. $("#nav_pic").val(fileurl_tmp);
  121. $("#img_a").attr('href', fileurl_tmp);
  122. $("#img_i").attr('onmouseover', "layer_tips=layer.tips('<img src="+fileurl_tmp+" class=\\'layer_tips_img\\'>',this,{tips: [1, '#fff']});");
  123. }
  124. // 加载栏目信息
  125. function SyncData(obj) {
  126. var type_name = $(obj).find("option:selected").attr('data-typename');
  127. var type_url = $(obj).find("option:selected").attr('data-typeurl');
  128. if (type_name) $('#nav_name').val(type_name);
  129. if (type_url) $('#nav_url').val(type_url);
  130. $('#nav_name').attr('readonly',true);
  131. $('#dl_nav_url').hide();
  132. }
  133. // 加载前台功能信息
  134. function functionData(obj) {
  135. var title = $(obj).find("option:selected").attr('data-title');
  136. if (title) $('#nav_name').val(title);
  137. $("#arctype_default").attr("selected", true);
  138. $('#arctype_sync').attr("checked", false);
  139. $('#nav_name').attr("readonly", false);
  140. $('#nav_url').attr("readonly", false);
  141. var url = $(obj).find("option:selected").val();
  142. if (0 == url || 'external_link' == url){
  143. $('#nav_url').val('');
  144. $('#dl_nav_url').show();
  145. }else{
  146. $('#nav_url').val(url);
  147. $('#dl_nav_url').hide()
  148. }
  149. if (0 == url){
  150. $('#dl_nav_url').hide()
  151. $('#type_id').show();
  152. $('#huozhe').show();
  153. $('#choose_type').show();
  154. } else{
  155. $('#type_id').hide();
  156. $('#huozhe').hide();
  157. $('#choose_type').hide();
  158. }
  159. }
  160. </script>
  161. {include file="public/footer" /}