formguide_field_edit.tpl.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. $show_validator = $show_dialog = 1;
  4. include $this->admin_tpl('header','admin');?>
  5. <script type="text/javascript">
  6. <!--
  7. $(function(){
  8. $.formValidator.initConfig({autotip:true,formid:"myform"});
  9. $("#field").formValidator({onshow:"<?php echo L('input').L('fieldname')?>",onfocus:"<?php echo L('fieldname').L('between_1_to_20')?>"}).regexValidator({regexp:"^[a-zA-Z]{1}([a-zA-Z0-9]|[_]){0,19}$",onerror:"<?php echo L('fieldname_was_wrong');?>"}).inputValidator({min:1,max:20,onerror:"<?php echo L('fieldname').L('between_1_to_20')?>"}).ajaxValidator({
  10. type : "get",
  11. url : "",
  12. data : "m=formguide&c=formguide_field&a=public_checkfield&formid=<?php echo $formid?>&oldfield=<?php echo $field;?>",
  13. datatype : "html",
  14. cached:false,
  15. getdata:{issystem:'issystem'},
  16. async:'true',
  17. success : function(data){
  18. if( data == "1" )
  19. {
  20. return true;
  21. }
  22. else
  23. {
  24. return false;
  25. }
  26. },
  27. buttons: $("#dosubmit"),
  28. onerror : "<?php echo L('fieldname').L('already_exist')?>",
  29. onwait : "<?php echo L('connecting_please_wait')?>"
  30. }).defaultPassed();
  31. $("#formtype").formValidator({onshow:"<?php echo L('select_fieldtype');?>",onfocus:"<?php echo L('select_fieldtype');?>",oncorrect:"<?php echo L('input_right');?>",defaultvalue:""}).inputValidator({min:1,onerror: "<?php echo L('select_fieldtype');?>"});
  32. $("#name").formValidator({onshow:"<?php echo L('input_nickname');?>",onfocus:"<?php echo L('nickname_empty');?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L('input_nickname');?>"});
  33. })
  34. //-->
  35. </script>
  36. <div class="pad_10">
  37. <div class="subnav">
  38. <h2 class="title-1 line-x f14 fb blue lh28"><?php echo L('model_manage');?>--<?php echo $m_r['name'].L('field_manage');?></h2>
  39. <div class="content-menu ib-a blue line-x">
  40. <a href="javascript:;" class="on"><em><?php echo L('edit_field');?></em></a><span>|</span><a href="?m=formguide&c=formguide_field&a=init&formid=<?php echo $formid?>&menuid=<?php echo $_GET['menuid']?>"><em><?php echo L('manage_field');?></em></a><span>|</span></div>
  41. <div class="bk10"></div>
  42. </div>
  43. <form name="myform" id="myform" action="?m=formguide&c=formguide_field&a=edit" method="post">
  44. <div class="common-form">
  45. <table width="100%" class="table_form">
  46. <tr>
  47. <th><strong><?php echo L('field_type');?></strong><br /></th>
  48. <td>
  49. <input type="hidden" name="info[formtype]" value="<?php echo $formtype;?>">
  50. <?php echo form::select($fields,$formtype,'name="info[formtype]" id="formtype" onchange="javascript:field_setting(this.value);" disabled',L('select_fieldtype'));?>
  51. </td>
  52. </tr>
  53. <tr>
  54. <th width="25%"><font color="red">*</font> <strong><?php echo L('fieldname');?></strong><br />
  55. <?php echo L('fieldname_tips');?>
  56. </th>
  57. <td><input type="text" name="info[field]" id="field" size="20" class="input-text" value="<?php echo $field?>" <?php if(in_array($field,$forbid_delete)) echo 'readonly';?>></td>
  58. </tr>
  59. <tr>
  60. <th><font color="red">*</font> <strong><?php echo L('field_nickname');?></strong><br /><?php echo L('nickname_tips');?></th>
  61. <td><input type="text" name="info[name]" id="name" size="30" class="input-text" value="<?php echo $name?>"></td>
  62. </tr>
  63. <tr>
  64. <th><strong><?php echo L('field_tip');?></strong><br /><?php echo L('field_tips');?></th>
  65. <td><textarea name="info[tips]" rows="2" cols="20" id="tips" style="height:40px; width:80%"><?php echo new_html_special_chars($tips);?></textarea></td>
  66. </tr>
  67. <tr>
  68. <th><strong><?php echo L('relation_parm');?></strong><br /><?php echo L('relation_parm_tips');?></th>
  69. <td><?php echo $form_data;?></td>
  70. </tr>
  71. <?php if(in_array($formtype,$att_css_js)) { ?>
  72. <tr>
  73. <th><strong><?php echo L('form_attr');?></strong><br /><?php echo L('form_attr_tips');?></th>
  74. <td><input type="text" name="info[formattribute]" size="50" class="input-text" value="<?php echo new_html_special_chars($formattribute);?>"></td>
  75. </tr>
  76. <tr>
  77. <th><strong><?php echo L('form_css_name');?></strong><br /><?php echo L('form_css_name_tips');?></th>
  78. <td><input type="text" name="info[css]" size="10" class="input-text" value="<?php echo new_html_special_chars($css);?>"></td>
  79. </tr>
  80. <?php } ?>
  81. <tr>
  82. <th><strong><?php echo L('string_size');?></strong><br /><?php echo L('string_size_tips');?></th>
  83. <td><?php echo L('minlength');?>:<input type="text" name="info[minlength]" id="field_minlength" value="<?php echo $minlength;?>" size="5" class="input-text"><?php echo L('maxlength');?>:<input type="text" name="info[maxlength]" id="field_maxlength" value="<?php echo $maxlength;?>" size="5" class="input-text"></td>
  84. </tr>
  85. <tr>
  86. <th><strong><?php echo L('data_preg');?></strong><br /><?php echo L('data_preg_tips');?></th>
  87. <td><input type="text" name="info[pattern]" id="pattern" value="<?php echo $pattern;?>" size="40" class="input-text">
  88. <select name="pattern_select" onchange="javascript:$('#pattern').val(this.value)">
  89. <option value=""><?php echo L('often_preg');?></option>
  90. <option value="/^[0-9.-]+$/"><?php echo L('figure');?></option>
  91. <option value="/^[0-9-]+$/"><?php echo L('integer');?></option>
  92. <option value="/^[a-z]+$/i"><?php echo L('letter');?></option>
  93. <option value="/^[0-9a-z]+$/i"><?php echo L('integer_letter');?></option>
  94. <option value="/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/">E-mail</option>
  95. <option value="/^[0-9]{5,20}$/">QQ</option>
  96. <option value="/^http:\/\//"><?php echo L('hyperlink');?></option>
  97. <option value="/^(1)[0-9]{10}$/"><?php echo L('mobile_number');?></option>
  98. <option value="/^[0-9-]{6,13}$/"><?php echo L('tel_number');?></option>
  99. <option value="/^[0-9]{6}$/"><?php echo L('zip');?></option>
  100. </select>
  101. </td>
  102. </tr>
  103. <tr>
  104. <th><strong><?php echo L('data_passed_msg');?></strong></th>
  105. <td><input type="text" name="info[errortips]" value="<?php echo new_html_special_chars($errortips);?>" size="50" class="input-text"></td>
  106. </tr>
  107. <tr>
  108. <th><strong><?php echo L('disabled_groups_field');?></strong></th>
  109. <td><?php echo form::checkbox($grouplist,$unsetgroupids,'name="unsetgroupids[]" id="unsetgroupids"',0,'100');?></td>
  110. </tr>
  111. </table>
  112. <div class="bk15"></div>
  113. <input name="info[modelid]" type="hidden" value="<?php echo $formid?>">
  114. <input name="fieldid" type="hidden" value="<?php echo $fieldid?>">
  115. <input name="oldfield" type="hidden" value="<?php echo $field?>">
  116. <div class="btn"><input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button"></div>
  117. </form>
  118. </div>
  119. </body>
  120. </html>