group_manage_edit_theme.php 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php defined('InShopNC') or exit('Access Invalid!');?>
  2. <link href="<?php echo CIRCLE_TEMPLATES_URL;?>/css/ubb.css" rel="stylesheet" type="text/css">
  3. <div class="group warp-all">
  4. <?php require_once circle_template('group.top');?>
  5. <div class="theme-editor">
  6. <form method="post" id="theme_form" action="<?php echo CIRCLE_SITE_URL;?>/index.php?act=manage&op=edit_theme&c_id=<?php echo $output['c_id'];?>&t_id=<?php echo $output['t_id']; ?>">
  7. <input type="hidden" name="form_submit" value="ok" />
  8. <div class="quick-thread">
  9. <div class="quick-thread-box">
  10. <div class="title">
  11. <label class="mr10"><span class="t"><?php echo $lang['nc_sort'].$lang['nc_colon'];?></span><span class="i">
  12. <select name="thtype" class="select">
  13. <option value="0"><?php echo $lang['nc_default'];?></option>
  14. <?php if(!empty($output['thclass_list'])){?>
  15. <?php foreach($output['thclass_list'] as $val){?>
  16. <?php if($output['super'] || in_array($output['identity'], array(1,2))){?>
  17. <option value="<?php echo $val['thclass_id'];?>" <?php if($output['theme_info']['thclass_id'] == $val['thclass_id']){?>selected="selected"<?php }?>><?php echo $val['thclass_name'];?></option>
  18. <?php }else if($val['is_moderator'] == 0){?>
  19. <option value="<?php echo $val['thclass_id'];?>" <?php if($output['theme_info']['thclass_id'] == $val['thclass_id']){?>selected="selected"<?php }?>><?php echo $val['thclass_name'];?></option>
  20. <?php }?>
  21. <?php }?>
  22. <?php }?>
  23. </select>
  24. </span></label>
  25. <label><span class="t"><?php echo $lang['nc_title'].$lang['nc_colon'];?></span><span class="i">
  26. <input name="name" type="text" class="text" value="<?php echo $output['theme_info']['theme_name'];?>" />
  27. </span></label>
  28. </div>
  29. <?php echo showMiniEditor('themecontent', $output['theme_info']['theme_content'], 'manage', $output['affix_list'], 'goods', $output['goods_list'], $output['readperm'], $output['theme_info']['theme_readperm']);?>
  30. <div class="bottom"> <a class="submit-btn" nctype="theme_submit" href="Javascript: void(0)"><?php echo $lang['nc_edit_theme'];?></a> <a class="cancel-btn" nctype="theme_cancle" href="Javascript:history.go(-1);"><?php echo $lang['nc_cancel']; ?></a>
  31. <div id="warning"></div>
  32. </div>
  33. </div>
  34. </div>
  35. </form>
  36. </div>
  37. </div>
  38. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/fileupload/jquery.iframe-transport.js" charset="utf-8"></script>
  39. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/fileupload/jquery.ui.widget.js" charset="utf-8"></script>
  40. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/fileupload/jquery.fileupload.js" charset="utf-8"></script>
  41. <script type="text/javascript" src="<?php echo CIRCLE_RESOURCE_SITE_URL;?>/js/miniditor/jquery.insertsome.min.js"></script>
  42. <script type="text/javascript" src="<?php echo CIRCLE_RESOURCE_SITE_URL;?>/js/miniditor/ubb.insert.js" charset="utf-8"></script>
  43. <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.validation.min.js"></script>
  44. <script type="text/javascript">
  45. var c_id = <?php echo $output['c_id'];?>;
  46. var t_id = <?php echo $output['t_id'];?>;
  47. $(function(){
  48. // UBB
  49. $('.theme-editor').ncUBB({
  50. c_id : c_id,
  51. t_id : t_id,
  52. UBBContent : $('#themecontent'),
  53. UBBSubmit : $('a[nctype="theme_submit"]'),
  54. UBBform : $('#theme_form'),
  55. UBBfileuploadurl : 'index.php?act=theme&op=image_upload&c_id='+c_id,
  56. UBBcontentleast : <?php echo intval(C('circle_contentleast'));?>
  57. });
  58. // 表单验证
  59. $('#theme_form').validate({
  60. errorLabelContainer: $('#warning'),
  61. invalidHandler: function(form, validator) {
  62. $('#warning').show();
  63. },
  64. submitHandler:function(form){
  65. ajaxpost('theme_form', CIRCLE_SITE_URL+'/index.php?act=manage&op=edit_theme&c_id='+c_id+'&t_id='+t_id, '', 'onerror');
  66. },
  67. rules : {
  68. name : {
  69. required : true,
  70. minlength : 4,
  71. maxlength : 30
  72. },
  73. themecontent : {
  74. required : true
  75. <?php if(intval(C('circle_contentleast')) > 0){?>
  76. ,minlength : <?php echo intval(C('circle_contentleast'));?>
  77. <?php }?>
  78. }
  79. },
  80. messages : {
  81. name : {
  82. required : '<?php echo $lang['nc_name_not_null'];?>',
  83. minlength : '<?php echo $lang['nc_name_min_max_length'];?>',
  84. maxlength : '<?php echo $lang['nc_name_min_max_length'];?>'
  85. },
  86. themecontent : {
  87. required : '<?php echo $lang['nc_content_not_null'];?>'
  88. <?php if(intval(C('circle_contentleast')) > 0){?>
  89. ,minlength : '<?php printf(L('nc_content_min_length'), intval(C('circle_contentleast')));?>'
  90. <?php }?>
  91. }
  92. }
  93. });
  94. });
  95. </script>