%%A1^A11^A11968FA%%edit.html.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <?php /* Smarty version 2.6.17, created on 2018-05-26 12:00:57
  2. compiled from admin/Category/edit.html */ ?>
  3. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  4. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/header.html", 'smarty_include_vars' => array()));
  5. $this->_tpl_vars = $_smarty_tpl_vars;
  6. unset($_smarty_tpl_vars);
  7. ?>
  8. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  9. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/left.html", 'smarty_include_vars' => array()));
  10. $this->_tpl_vars = $_smarty_tpl_vars;
  11. unset($_smarty_tpl_vars);
  12. ?>
  13. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  14. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/nav.html", 'smarty_include_vars' => array()));
  15. $this->_tpl_vars = $_smarty_tpl_vars;
  16. unset($_smarty_tpl_vars);
  17. ?>
  18. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  19. $this->_smarty_include(array('smarty_include_tpl_file' => "get_kindeditor.html", 'smarty_include_vars' => array()));
  20. $this->_tpl_vars = $_smarty_tpl_vars;
  21. unset($_smarty_tpl_vars);
  22. ?>
  23. <script type="text/javascript" src="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
  24. /public/static/js/jquery-1.7.2.min.js"></script>
  25. <link rel="stylesheet" href="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
  26. /public/static/js/jquery.minicolors.css" />
  27. <script type="text/javascript" src="<?php echo $this->_tpl_vars['web_cfg']['cdn']; ?>
  28. /public/static/js/jquery.minicolors.js"></script>
  29. <style>
  30. .set-nav {
  31. margin: 0 auto;
  32. }
  33. .set-nav-hr {
  34. background-color: #ddd;
  35. height: 1px;
  36. position: relative;
  37. }
  38. .form-group label {
  39. font-weight: 600;
  40. }
  41. .checkbox-inline, .radio-inline {
  42. font-weight: 400!important;
  43. }
  44. .rowlabel {
  45. font-weight: 300!important;
  46. }
  47. .music_play_hide {
  48. display:none;
  49. }
  50. </style>
  51. <form id="add_platform_form">
  52. <input name="id" type="hidden" value="<?php echo $this->_tpl_vars['CategoryData']['id']; ?>
  53. ">
  54. <div class="col-md-5" style="padding-left: 30px;">
  55. <div class="form-group">
  56. <label class="control-label">编辑分类信息</label>
  57. </div>
  58. <div class="form-group">
  59. <label class="control-label rowlabel">分类名称</label>
  60. <input name="name" type="text" class="form-control" value="<?php echo $this->_tpl_vars['CategoryData']['name']; ?>
  61. ">
  62. </div>
  63. <div class="form-group">
  64. <label class="control-label rowlabel">分类图标</label>
  65. <div>
  66. <img id="icon_image_tag" src="<?php echo $this->_tpl_vars['CategoryData']['icon']; ?>
  67. " style="width:30px;" class="img-thumbnail">
  68. <input id="icon_image_input" name='icon' type="hidden" value="<?php echo $this->_tpl_vars['CategoryData']['icon']; ?>
  69. ">
  70. <input id="icon_image_upload" type="button" value="选中图片" >
  71. </div>
  72. </div>
  73. <div>
  74. <a id="add_platform_btn" href="javascript:;" class="button button-primary button-small">修改分类</a>
  75. </div>
  76. </div>
  77. </form>
  78. <script>
  79. KISSY.use('node, io', function (S, Node, IO) {
  80. var $ = S.all;
  81. $("#add_platform_btn").on('click', function () {
  82. var name = $("input[name=name]").val();
  83. if (!name) {
  84. alert('请填写名称');
  85. return false;
  86. }
  87. var icon = $("input[name=icon]").val();
  88. if (!icon) {
  89. alert('请选择分类图标');
  90. return false;
  91. }
  92. var data = IO.serialize("#add_platform_form");
  93. new IO({
  94. type: "post"
  95. , url: VG.conf.root_domain + '/?c=Admin_Category_index&a=PageList&a=ReqUp'
  96. , data: data
  97. , success: function (data) {
  98. if (data.ok) { //ok
  99. var url = data.msg;
  100. location.href = VG.conf.root_domain + '/?c=Admin_Category_index&a=PageList';
  101. } else {
  102. alert('操作失败,原因:'+data.msg);
  103. }
  104. return false;
  105. }
  106. , error: function (NULL, textStatus) {
  107. alert("请求服务器失败,原因:"+textStatus);
  108. }
  109. , dataType: "json"
  110. });
  111. });
  112. });
  113. //icon image
  114. KindEditor.ready(function(K) {
  115. var uploadbutton = K.uploadbutton({
  116. button : K('#icon_image_upload')[0],
  117. fieldName : 'imgFile',
  118. url : VG.conf.root_domain + '/?c=kindeditor&a=updateJson&dir=image',
  119. afterUpload : function(data) {
  120. if (data.error === 0) {
  121. var url = K.formatUrl(data.url, 'absolute');
  122. K('#icon_image_input').val(data.url);
  123. K('#icon_image_tag').attr('src', data.url);
  124. } else {
  125. alert(data.message);
  126. }
  127. },
  128. afterError : function(str) {
  129. alert('自定义错误信息: ' + str);
  130. }
  131. });
  132. uploadbutton.fileBox.change(function(e) {
  133. uploadbutton.submit();
  134. });
  135. });
  136. </script>
  137. <?php $_smarty_tpl_vars = $this->_tpl_vars;
  138. $this->_smarty_include(array('smarty_include_tpl_file' => "./admin/bottom.html", 'smarty_include_vars' => array()));
  139. $this->_tpl_vars = $_smarty_tpl_vars;
  140. unset($_smarty_tpl_vars);
  141. ?>