member_modelfield_add.tpl.php 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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?>",
  11. datatype : "html",
  12. cached:false,
  13. getdata:{issystem:'issystem'},
  14. async:'false',
  15. success : function(data){
  16. if( data == "1" )
  17. {
  18. return true;
  19. }
  20. else
  21. {
  22. return false;
  23. }
  24. },
  25. buttons: $("#dosubmit"),
  26. onerror : "<?php echo L('fieldname').L('already_exist')?>",
  27. onwait : "<?php echo L('connecting_please_wait')?>"
  28. });
  29. $("#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')?>!"});
  30. $("#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')?>"});
  31. })
  32. //-->
  33. </script>
  34. <div class="pad_10">
  35. <form name="myform" id="myform" action="?m=member&c=member_modelfield&a=add" method="post">
  36. <div class="common-form">
  37. <fieldset>
  38. <legend><?php echo L('basic_configuration')?></legend>
  39. <table width="100%" class="table_form contentWrap">
  40. <tr>
  41. <th><strong><?php echo L('filedtype')?></strong><br /></th>
  42. <td>
  43. <?php echo form::select($fields,'','name="info[formtype]" id="formtype" onchange="javascript:field_setting(this.value);"',L('filedtype_need'));?>
  44. </td>
  45. </tr>
  46. <tr>
  47. <th width="25%"><font color="red">*</font> <strong><?php echo L('filedname')?></strong><br />
  48. <?php echo L('username_rule')?>
  49. </th>
  50. <td><input type="text" name="info[field]" id="field" size="20" class="input-text"></td>
  51. </tr>
  52. <tr>
  53. <th><font color="red">*</font> <strong><?php echo L('filed_nickname')?></strong><br /><?php echo L('exaple_title')?></th>
  54. <td><input type="text" name="info[name]" id="name" size="30" class="input-text"></td>
  55. </tr>
  56. <tr>
  57. <th><strong><?php echo L('field_cue')?></strong><br /><?php echo L('nickname_alert')?></th>
  58. <td><textarea name="info[tips]" rows="2" cols="20" id="tips" style="height:40px; width:80%"></textarea></td>
  59. </tr>
  60. <tr>
  61. <th><strong><?php echo L('correlation_param')?></strong><br /><?php echo L('correlation_attribute')?></th>
  62. <td><div id="setting"></div></td>
  63. </tr>
  64. <tr>
  65. <th><strong><?php echo L('extra_attribute')?></strong><br /><?php echo L('add_javascript')?></th>
  66. <td><input type="text" name="info[formattribute]" value="" size="50" class="input-text"></td>
  67. </tr>
  68. <tr>
  69. <th><strong><?php echo L('form_css')?></strong><br /><?php echo L('user_form_css')?></th>
  70. <td><input type="text" name="info[css]" value="" size="10" class="input-text"></td>
  71. </tr>
  72. <tr>
  73. <th><strong><?php echo L('string_len_range')?></strong><br /><?php echo L('post_alert')?></th>
  74. <td><?php echo L('min')?><input type="text" name="info[minlength]" id="field_minlength" value="0" size="5" class="input-text"> <?php echo L('max')?><input type="text" name="info[maxlength]" id="field_maxlength" value="" size="5" class="input-text"></td>
  75. </tr>
  76. <tr>
  77. <th><strong><?php echo L('date_regular')?></strong><br /><?php echo L('validity_alert')?></th>
  78. <td><input type="text" name="info[pattern]" id="pattern" value="" size="40" class="input-text">
  79. <select name="pattern_select" onchange="javascript:$('#pattern').val(this.value)">
  80. <option value=""><?php echo L('common_regular')?></option>
  81. <option value="/^[0-9.-]+$/"><?php echo L('number')?></option>
  82. <option value="/^[0-9-]+$/"><?php echo L('int')?></option>
  83. <option value="/^[a-z]+$/i"><?php echo L('alphabet')?></option>
  84. <option value="/^[0-9a-z]+$/i"><?php echo L('alphabet')?>+<?php echo L('number')?></option>
  85. <option value="/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/">E-mail</option>
  86. <option value="/^[0-9]{5,20}$/">QQ</option>
  87. <option value="/^http:\/\//"><?php echo L('http')?></option>
  88. <option value="/^(1)[0-9]{10}$/"><?php echo L('mp')?></option>
  89. <option value="/^[0-9-]{6,13}$/"><?php echo L('tel')?></option>
  90. <option value="/^[0-9]{6}$/"><?php echo L('postcode')?></option>
  91. </select>
  92. </td>
  93. </tr>
  94. <tr>
  95. <th><strong><?php echo L('error_alert')?></strong><br /><?php echo L('form_error_alert')?></th>
  96. <td><input type="text" name="info[errortips]" value="" size="50" class="input-text"></td>
  97. </tr>
  98. <tr>
  99. <th><strong><?php echo L('unique')?></strong></th>
  100. <td><input type="radio" name="info[isunique]" value="1" id="field_allow_isunique1"> <?php echo L('yes')?> <input type="radio" name="info[isunique]" value="0" id="field_allow_isunique0" checked> <?php echo L('no')?></td>
  101. </tr>
  102. <tr>
  103. <th><strong><?php echo L('can_empty')?></strong></th>
  104. <td><input type="radio" name="info[isbase]" value="1" checked> <?php echo L('yes')?> <input type="radio" name="info[isbase]" value="0"> <?php echo L('no')?> </td>
  105. </tr>
  106. <tr>
  107. <th><strong><?php echo L('search_condition')?></strong></th>
  108. <td><input type="radio" name="info[issearch]" value="1" id="field_allow_search1"> <?php echo L('yes')?> <input type="radio" name="info[issearch]" value="0" id="field_allow_search0" checked> <?php echo L('no')?></td>
  109. </tr>
  110. <tr>
  111. <th><strong><?php echo L('isadd_condition')?></strong></th>
  112. <td><input type="radio" name="info[isadd]" value="1" checked><?php echo L('yes')?><input type="radio" name="info[isadd]" value="0" ><?php echo L('no')?></td>
  113. </tr>
  114. <tr>
  115. <th><strong><?php echo L('isomnipotent_condition')?></strong></th>
  116. <td><input type="radio" name="info[isomnipotent]" value="1"><?php echo L('yes')?><input type="radio" name="info[isomnipotent]" value="0" checked><?php echo L('no')?></td>
  117. </tr>
  118. <tr>
  119. <th><strong><?php echo L('deny_set_field_group')?></strong></th>
  120. <td><?php echo form::checkbox($grouplist,$unsetgroupids,'name="unsetgroupids[]" id="unsetgroupids"',0,'100');?></td>
  121. </tr>
  122. <tr>
  123. <th><strong><?php echo L('deny_set_field_role')?></strong></th>
  124. <td><?php echo form::checkbox($roles,$unsetroleids,'name="unsetroleids[]" id="unsetroleids"',0,'100');?> </td>
  125. </tr>
  126. </table>
  127. </fieldset>
  128. <div class="bk15"></div>
  129. <input name="info[modelid]" type="hidden" value="<?php echo $modelid?>">
  130. <input name="dosubmit" id="dosubmit" type="submit" value="<?php echo L('submit')?>" class="dialog">
  131. </form>
  132. <div id="PC__contentHeight" style="display:none">90</div>
  133. <script type="text/javascript">
  134. <!--
  135. function field_setting(fieldtype) {
  136. $.getJSON("?m=member&c=member_modelfield&a=public_field_setting&fieldtype="+fieldtype, function(data){
  137. if(data.field_basic_table=='1') {
  138. $('#field_basic_table0').attr("disabled",false);
  139. $('#field_basic_table1').attr("disabled",false);
  140. } else {
  141. $('#field_basic_table0').attr("checked",true);
  142. $('#field_basic_table0').attr("disabled",true);
  143. $('#field_basic_table1').attr("disabled",true);
  144. }
  145. if(data.field_allow_search=='1') {
  146. $('#field_allow_search0').attr("disabled",false);
  147. $('#field_allow_search1').attr("disabled",false);
  148. } else {
  149. $('#field_allow_search0').attr("checked",true);
  150. $('#field_allow_search0').attr("disabled",true);
  151. $('#field_allow_search1').attr("disabled",true);
  152. }
  153. if(data.field_allow_fulltext=='1') {
  154. $('#field_allow_fulltext0').attr("disabled",false);
  155. $('#field_allow_fulltext1').attr("disabled",false);
  156. } else {
  157. $('#field_allow_fulltext0').attr("checked",true);
  158. $('#field_allow_fulltext0').attr("disabled",true);
  159. $('#field_allow_fulltext1').attr("disabled",true);
  160. }
  161. if(data.field_allow_isunique=='1') {
  162. $('#field_allow_isunique0').attr("disabled",false);
  163. $('#field_allow_isunique1').attr("disabled",false);
  164. } else {
  165. $('#field_allow_isunique0').attr("checked",true);
  166. $('#field_allow_isunique0').attr("disabled",true);
  167. $('#field_allow_isunique1').attr("disabled",true);
  168. }
  169. $('#field_minlength').val(data.field_minlength);
  170. $('#field_maxlength').val(data.field_maxlength);
  171. $('#setting').html(data.setting);
  172. });
  173. }
  174. //-->
  175. </script>
  176. </body>
  177. </html>