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.

142 lines
6.8 KiB

7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. @extends('admin.layouts.app')
  2. @section('title', '文章修改')
  3. @section('content')
  4. <h5 class="sub-header"><a href="/fladmin/article">文章列表</a> > 修改文章</h5>
  5. <form id="addarc" method="post" action="/fladmin/article/doedit" role="form" enctype="multipart/form-data" class="table-responsive">{{ csrf_field() }}
  6. <table class="table table-striped table-bordered">
  7. <tbody>
  8. <tr>
  9. <td align="right">文章标题:</td>
  10. <td><input name="title" type="text" id="title" value="<?php echo $post["title"]; ?>" class="required" style="width:60%" placeholder="在此输入标题"><input style="display:none;" name="id" type="text" id="id" value="<?php echo $id; ?>"></td>
  11. </tr>
  12. <tr>
  13. <td align="right">是否审核:</td>
  14. <td>
  15. <input type="radio" value='0' name="ischeck" <?php if($post['ischeck']==0){ echo 'checked'; } ?> />&nbsp;是&nbsp;&nbsp;
  16. <input type="radio" value='1' name="ischeck" <?php if($post['ischeck']==1){ echo 'checked'; } ?> />&nbsp;否
  17. </td>
  18. </tr>
  19. <tr>
  20. <td align="right">推荐:</td>
  21. <td>
  22. <select name="tuijian" id="tuijian">
  23. <?php $tuijian = config('custom.tuijian');
  24. for($i=0;$i<count($tuijian);$i++){if($i==$post["tuijian"]){?><option selected="selected" value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option>
  25. <?php }else{?><option value="<?php echo $i; ?>"><?php echo $tuijian[$i]; ?></option><?php }} ?>
  26. </select>
  27. </td>
  28. </tr>
  29. <tr>
  30. <td align="right">seoTitle:</td>
  31. <td><input name="seotitle" type="text" id="seotitle" value="<?php echo $post["seotitle"]; ?>" style="width:60%"></td>
  32. </tr>
  33. <tr>
  34. <td align="right" style="vertical-align:middle;">缩略图:</td>
  35. <td style="vertical-align:middle;"><button type="button" onclick="upImage();">选择图片</button> <input name="litpic" type="text" id="litpic" value="<?php echo $post["litpic"]; ?>" style="width:40%"> <img style="margin-left:20px;<?php if(empty($post["litpic"]) || !imgmatch($post["litpic"])){ echo "display:none;"; } ?>" src="<?php if(imgmatch($post["litpic"])){echo $post["litpic"];} ?>" width="120" height="80" id="picview" name="picview"></td>
  36. </tr>
  37. <script type="text/javascript">
  38. var _editor;
  39. $(function() {
  40. //重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
  41. _editor = UE.getEditor('ueditorimg');
  42. _editor.ready(function () {
  43. //设置编辑器不可用
  44. _editor.setDisabled('insertimage');
  45. //隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
  46. _editor.hide();
  47. //侦听图片上传
  48. _editor.addListener('beforeInsertImage', function (t, arg) {
  49. //将地址赋值给相应的input,只取第一张图片的路径
  50. $('#litpic').val(arg[0].src);
  51. //图片预览
  52. $('#picview').attr("src",arg[0].src).css("display","inline-block");
  53. })
  54. });
  55. });
  56. //弹出图片上传的对话框
  57. function upImage()
  58. {
  59. var myImage = _editor.getDialog("insertimage");
  60. myImage.render();
  61. myImage.open();
  62. }
  63. </script>
  64. <script type="text/plain" id="ueditorimg"></script>
  65. <tr>
  66. <td align="right">来源:</td>
  67. <td colspan="2"><input name="source" type="text" id="source" style="width:160px" value="<?php echo $post["source"]; ?>" size="16">&nbsp;&nbsp; 作者:<input name="writer" type="text" id="writer" style="width:100px" value="<?php echo $post["writer"]; ?>">&nbsp;&nbsp; 浏览次数:<input type="text" name="click" id="click" value="<?php echo rand(200,500); ?>" style="width:80px;"></td>
  68. </tr>
  69. <tr>
  70. <td align="right">文章栏目:</td>
  71. <td>
  72. <select name="typeid" id="typeid">
  73. <?php $catlist = category_tree(get_category('arctype',0));foreach($catlist as $row){
  74. if($row["id"]==$post["typeid"]){ ?>
  75. <option selected="selected" value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["name"]; ?></option>
  76. <?php }else{ ?>
  77. <option value="<?php echo $row["id"]; ?>"><?php for($i=0;$i<$row["deep"];$i++){echo "";}echo $row["name"]; ?></option>
  78. <?php }} ?>
  79. </select>
  80. </td>
  81. </tr>
  82. <tr>
  83. <td align="right">关键词:</td>
  84. <td><input type="text" name="keywords" id="keywords" style="width:50%" value="<?php echo $post["keywords"]; ?>"> (多个用","分开)</td>
  85. </tr>
  86. <tr>
  87. <td align="right" style="vertical-align:middle;">内容摘要:</td>
  88. <td><textarea name="description" rows="5" id="description" style="width:80%;height:70px;vertical-align:middle;"><?php echo $post["description"]; ?></textarea></td>
  89. </tr>
  90. <tr>
  91. <td align="right">附加选项:</td>
  92. <td>
  93. <input name="dellink" type="checkbox" class="np" id="dellink" value="1">
  94. 删除非站内链接
  95. <input name="autolitpic" type="checkbox" class="np" id="autolitpic" value="1" checked>
  96. 提取第一个图片为缩略图
  97. </td>
  98. </tr>
  99. <tr>
  100. <td colspan="2"><strong>文章内容:</strong></td>
  101. </tr>
  102. <tr>
  103. <td colspan="2">
  104. <!-- 加载编辑器的容器 --><script id="container" name="body" type="text/plain"><?php echo $post["body"]; ?></script>
  105. <!-- 配置文件 --><script type="text/javascript" src="/other/flueditor/ueditor.config.js"></script>
  106. <!-- 编辑器源码文件 --><script type="text/javascript" src="/other/flueditor/ueditor.all.min.js"></script>
  107. <!-- 实例化编辑器 --><script type="text/javascript">var ue = UE.getEditor('container',{maximumWords:100000,initialFrameHeight:320,enableAutoSave:false});</script></td>
  108. </tr>
  109. <tr>
  110. <td colspan="2"><button type="submit" class="btn btn-success" value="Submit">保存(Submit)</button>&nbsp;&nbsp;<button type="reset" class="btn btn-default" value="Reset">重置(Reset)</button><input type="hidden"></input></td>
  111. </tr>
  112. </tbody></table></form><!-- 表单结束 -->
  113. <script>
  114. $(function(){
  115. $(".required").blur(function(){
  116. var $parent = $(this).parent();
  117. $parent.find(".formtips").remove();
  118. if(this.value=="")
  119. {
  120. $parent.append(' <small class="formtips onError"><font color="red">不能为空!</font></small>');
  121. }
  122. else
  123. {
  124. $parent.append(' <small class="formtips onSuccess"><font color="green">OK</font></small>');
  125. }
  126. });
  127. //重置
  128. $('#addarc input[type="reset"]').click(function(){
  129. $(".formtips").remove();
  130. });
  131. $("#addarc").submit(function(){
  132. $(".required").trigger('blur');
  133. var numError = $('#addarc .onError').length;
  134. if(numError){return false;}
  135. });
  136. });
  137. </script>
  138. @endsection