file_var_setting.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <include file="theme/functions"/>
  2. <include file="public@header"/>
  3. </head>
  4. <body>
  5. <div class="wrap">
  6. <ul class="nav nav-tabs">
  7. <li>
  8. <a href="{:url('Theme/fileSetting',['file'=>$fileName,'theme'=>$theme,'tab'=>'widget'])}">
  9. 组件
  10. </a>
  11. </li>
  12. <notempty name="file.more.vars">
  13. <li class="active">
  14. <a href="{:url('Theme/fileSetting',['file'=>$fileName,'theme'=>$theme,'tab'=>'var'])}">
  15. 设置
  16. </a>
  17. </li>
  18. </notempty>
  19. <notempty name="has_public_var">
  20. <li>
  21. <a href="{:url('Theme/fileSetting',['file'=>$fileName,'theme'=>$theme,'tab'=>'public_var'])}">
  22. 全局设置
  23. </a>
  24. </li>
  25. </notempty>
  26. </ul>
  27. <form method="post" class="js-ajax-form margin-top-20" action="{:url('Theme/settingPost')}">
  28. <notempty name="file['more']['vars']">
  29. {:_parse_vars($file.more.vars,'files['.$file['id'].'][vars]')}
  30. <else/>
  31. </notempty>
  32. <div class="form-group text-center" style="display: none;">
  33. <button type="submit" class="btn btn-primary js-ajax-submit" id="submit-btn" data-success="successCallback">
  34. {:lang('SAVE')}
  35. </button>
  36. </div>
  37. </form>
  38. </div>
  39. <include file="theme/scripts"/>
  40. <script>
  41. function successCallback(data, statusText, xhr, $form) {
  42. function _refresh() {
  43. if (data.url) {
  44. //返回带跳转地址
  45. window.location.href = data.url;
  46. } else {
  47. if (data.code == 1) {
  48. //刷新当前页
  49. reloadPage(window);
  50. }
  51. }
  52. }
  53. noty({
  54. text: data.msg,
  55. type: 'success',
  56. layout: 'topCenter',
  57. modal: true,
  58. // animation: {
  59. // open: 'animated bounceInDown', // Animate.css class names
  60. // close: 'animated bounceOutUp', // Animate.css class names
  61. // },
  62. timeout: 800,
  63. callback: {
  64. afterClose: function () {
  65. if (parent.afterSaveSetting) {
  66. parent.afterSaveSetting();
  67. }
  68. _refresh();
  69. }
  70. }
  71. });
  72. }
  73. </script>
  74. </body>
  75. </html>