member_modelfield_edit.tpl.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php defined('IN_ADMIN') or exit('No permission resources.');?>
  2. <?php include $this->admin_tpl('header','admin');?>
  3. <script type="text/javascript">
  4. <!--
  5. $(function(){
  6. $.formValidator.initConfig({autotip:true,formid:"myform"});
  7. $("#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('filedname_incorrect')?>"}).inputValidator({min:1,max:20,onerror:"<?php echo L('fieldname').L('between_1_to_20')?>"}).ajaxValidator({
  8. type : "get",
  9. url : "",
  10. data : "m=member&c=member_modelfield&a=public_checkfield&modelid=<?php echo $modelid?>&oldfield=<?php echo $field;?>",
  11. datatype : "html",
  12. cached:false,
  13. async:'true',
  14. success : function(data){
  15. if( data == "1" )
  16. {
  17. return true;
  18. }
  19. else
  20. {
  21. return false;
  22. }
  23. },
  24. buttons: $("#dosubmit"),
  25. onerror : "<?php echo L('fieldname').L('already_exist')?>",
  26. onwait : "<?php echo L('connecting_please_wait')?>"
  27. }).defaultPassed();
  28. $("#formtype").formValidator({onshow:"<?php echo L('filedtype_need')?>",onfocus:"<?php echo L('filedtype_need')?>",oncorrect:"<?php echo L('input_correct')?>",defaultvalue:""}).inputValidator({min:1,onerror: "<?php echo L('filedtype_need')?>"});
  29. $("#name").formValidator({onshow:"<?php echo L('filed_nickname_need')?>",onfocus:"<?php echo L('filed_nickname_need')?>",oncorrect:"<?php echo L('input_correct')?>"}).inputValidator({min:1,onerror:"<?php echo L('filed_nickname_need')?>"});
  30. })
  31. //-->
  32. </script>
  33. <div class="pad-10">
  34. <div class="common-form">
  35. <form name="myform" id="myform" action="?m=member&c=member_modelfield&a=edit" method="post">
  36. <input name="info[modelid]" type="hidden" value="<?php echo $modelid?>">
  37. <input name="fieldid" type="hidden" value="<?php echo $fieldid?>">
  38. <input name="oldfield" type="hidden" value="<?php echo $field?>">
  39. <fieldset>
  40. <legend><?php echo L('basic_configuration')?></legend>
  41. <table width="100%" class="table_form contentWrap">
  42. <tr>
  43. <th><strong><?php echo L('filedtype')?></strong><br /></th>
  44. <td>
  45. <input type="hidden" name="info[formtype]" value="<?php echo $formtype;?>">
  46. <?php echo form::select($fields,$formtype,'name="info[formtype]" id="formtype" onchange="javascript:field_setting(this.value);" disabled',L('filedtype_need'));?>
  47. </td>
  48. </tr>
  49. <tr>
  50. <th><strong><?php echo L('main_table_filed')?></strong></th>
  51. <td>
  52. <input type="hidden" name="issystem" id="issystem" value="<?php echo $issystem ? 1 : 0;?>">
  53. <input type="radio" name="info[issystem]" id="field_basic_table1" value="1" <?php if($issystem) echo 'checked';?> disabled> <?php echo L('yes')?> <input type="radio" id="field_basic_table0" name="info[issystem]" value="0" <?php if(!$issystem) echo 'checked';?> disabled> <?php echo L('no')?></td>
  54. </tr>
  55. <tr>
  56. <th width="25%"><font color="red">*</font> <strong><?php echo L('filedname')?></strong><br />
  57. <?php echo L('username_rule')?>
  58. </th>
  59. <td><input type="text" name="info[field]" id="field" size="20" class="input-text" value="<?php echo $field?>"></td>
  60. </tr>
  61. <tr>
  62. <th><font color="red">*</font> <strong><?php echo L('filed_nickname')?></strong><br /><?php echo L('exaple_title')?></th>
  63. <td><input type="text" name="info[name]" id="name" size="30" class="input-text" value="<?php echo $name?>"></td>
  64. </tr>
  65. <tr>
  66. <th><strong><?php echo L('field_cue')?></strong><br /><?php echo L('nickname_alert')?></th>
  67. <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>
  68. </tr>
  69. <tr>
  70. <th><strong><?php echo L('correlation_param')?></strong><br /><?php echo L('correlation_attribute')?></th>
  71. <td><?php echo $form_data;?></td>
  72. </tr>
  73. <tr>
  74. <th><strong><?php echo L('extra_attribute')?></strong><br /><?php echo L('add_javascript')?></th>
  75. <td><input type="text" name="info[formattribute]" size="50" class="input-text" value="<?php echo new_html_special_chars($formattribute);?>"></td>
  76. </tr>
  77. <tr>
  78. <th><strong><?php echo L('form_css')?></strong><br /><?php echo L('user_form_css')?></th>
  79. <td><input type="text" name="info[css]" size="10" class="input-text" value="<?php echo new_html_special_chars($css);?>"></td>
  80. </tr>
  81. <tr>
  82. <th><strong><?php echo L('string_len_range')?></strong><br /><?php echo L('post_alert')?></th>
  83. <td><?php echo L('min')?><input type="text" name="info[minlength]" id="field_minlength" value="<?php echo $minlength;?>" size="5" class="input-text"> <?php echo L('max')?><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('date_regular')?></strong><br /><?php echo L('validity_alert')?></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('common_regular')?></option>
  90. <option value="/^[0-9.-]+$/"><?php echo L('number')?></option>
  91. <option value="/^[0-9-]+$/"><?php echo L('int')?></option>
  92. <option value="/^[a-z]+$/i"><?php echo L('alphabet')?></option>
  93. <option value="/^[0-9a-z]+$/i"><?php echo L('alphabet')?>+<?php echo L('number')?></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('http')?></option>
  97. <option value="/^(1)[0-9]{10}$/"><?php echo L('mp')?></option>
  98. <option value="/^[0-9-]{6,13}$/"><?php echo L('tel')?></option>
  99. <option value="/^[0-9]{6}$/"><?php echo L('postcode')?></option>
  100. </select>
  101. </td>
  102. </tr>
  103. <tr>
  104. <th><strong><?php echo L('error_alert')?></strong><br /><?php echo L('form_error_alert')?></th>
  105. <td><input type="text" name="info[errortips]" value="<?php echo $errortips;?>" size="50" class="input-text"></td>
  106. </tr>
  107. <tr>
  108. <th><strong><?php echo L('unique')?></strong></th>
  109. <td><input type="radio" name="info[isunique]" value="1" id="field_allow_isunique1" <?php if($isunique) echo 'checked';?>><?php echo L('yes')?><input type="radio" name="info[isunique]" value="0" id="field_allow_isunique0" <?php if(!$isunique) echo 'checked';?>><?php echo L('no')?></td>
  110. </tr>
  111. <tr>
  112. <th><strong><?php echo L('can_empty')?></strong></th>
  113. <td><input type="radio" name="info[isbase]" value="1" <?php if($isbase) echo 'checked';?>><?php echo L('yes')?><input type="radio" name="info[isbase]" value="0" <?php if(!$isbase) echo 'checked';?>><?php echo L('no')?> </td>
  114. </tr>
  115. <tr>
  116. <th><strong><?php echo L('search_condition')?></strong></th>
  117. <td><input type="radio" name="info[issearch]" value="1" id="field_allow_search1" <?php if($issearch) echo 'checked';?>><?php echo L('yes')?><input type="radio" name="info[issearch]" value="0" id="field_allow_search0" <?php if(!$issearch) echo 'checked';?>><?php echo L('no')?></td>
  118. </tr>
  119. <tr>
  120. <th><strong><?php echo L('isadd_condition')?></strong></th>
  121. <td><input type="radio" name="info[isadd]" value="1" <?php if($isadd) echo 'checked';?>><?php echo L('yes')?><input type="radio" name="info[isadd]" value="0" <?php if(!$isadd) echo 'checked';?>><?php echo L('no')?></td>
  122. </tr>
  123. <tr>
  124. <th><strong><?php echo L('isomnipotent_condition')?></strong></th>
  125. <td><input type="radio" name="info[isomnipotent]" value="1" <?php if($isomnipotent) echo 'checked';?>><?php echo L('yes')?><input type="radio" name="info[isomnipotent]" value="0" <?php if(!$isomnipotent) echo 'checked';?>><?php echo L('no')?></td>
  126. </tr>
  127. <tr>
  128. <th><strong><?php echo L('deny_set_field_group')?></strong></th>
  129. <td><?php echo form::checkbox($grouplist,$unsetgroupids,'name="unsetgroupids[]" id="unsetgroupids"',0,'100');?></td>
  130. </tr>
  131. <tr>
  132. <th><strong><?php echo L('deny_set_field_role')?></strong></th>
  133. <td><?php echo form::checkbox($roles,$unsetroleids,'name="unsetroleids[]" id="unsetroleids"',0,'100');?> </td>
  134. </tr>
  135. </table>
  136. </fieldset>
  137. <div class="bk15"></div>
  138. <input name="dosubmit" type="submit" id="dosubmit" value="<?php echo L('submit')?>" class="dialog">
  139. </form>
  140. </div>
  141. </div>
  142. </body>
  143. </html>