No Description
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.

add.htm 8.0KB

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