sitemodel_field_edit.tpl.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header','admin');?>
  4. <script type="text/javascript">
  5. <!--
  6. $(function(){
  7. $.formValidator.initConfig({autotip:true,formid:"myform"});
  8. $("#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({
  9. type : "get",
  10. url : "",
  11. data : "m=content&c=sitemodel_field&a=public_checkfield&modelid=<?php echo $modelid?>&oldfield=<?php echo $field;?>",
  12. datatype : "html",
  13. cached:false,
  14. getdata:{issystem:'issystem'},
  15. async:'true',
  16. success : function(data){
  17. if( data == "1" )
  18. {
  19. return true;
  20. }
  21. else
  22. {
  23. return false;
  24. }
  25. },
  26. buttons: $("#dosubmit"),
  27. onerror : "<?php echo L('fieldname').L('already_exist')?>",
  28. onwait : "<?php echo L('connecting_please_wait')?>"
  29. }).defaultPassed();
  30. $("#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');?>"});
  31. $("#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');?>"});
  32. })
  33. //-->
  34. </script>
  35. <div class="pad_10">
  36. <div class="subnav">
  37. <h2 class="title-1 line-x f14 fb blue lh28"><?php echo L('model_manage');?>--<?php echo $m_r['name'].L('field_manage');?></h2>
  38. <div class="content-menu ib-a blue line-x">
  39. <a href="javascript:;" class="on"><em><?php echo L('edit_field');?></em></a><span>|</span><a href="?m=content&c=sitemodel_field&a=init&modelid=<?php echo $modelid?>&menuid=<?php echo $_GET['menuid']?>"><em><?php echo L('manage_field');?></em></a><span>|</span></div>
  40. <div class="bk10"></div>
  41. </div>
  42. <form name="myform" id="myform" action="?m=content&c=sitemodel_field&a=edit" method="post">
  43. <div class="common-form">
  44. <table width="100%" class="table_form">
  45. <tr>
  46. <th><strong><?php echo L('field_type');?></strong><br /></th>
  47. <td>
  48. <input type="hidden" name="info[formtype]" value="<?php echo $formtype;?>">
  49. <?php echo form::select($fields,$formtype,'name="info[formtype]" id="formtype" onchange="javascript:field_setting(this.value);" disabled',L('select_fieldtype'));?>
  50. </td>
  51. </tr>
  52. <tr>
  53. <th><strong><?php echo L('issystem_field');?></strong></th>
  54. <td>
  55. <input type="hidden" name="issystem" id="issystem" value="<?php echo $issystem ? 1 : 0;?>">
  56. <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>
  57. </tr>
  58. <tr>
  59. <th width="25%"><font color="red">*</font> <strong><?php echo L('fieldname');?></strong><br />
  60. <?php echo L('fieldname_tips');?>
  61. </th>
  62. <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>
  63. </tr>
  64. <tr>
  65. <th><font color="red">*</font> <strong><?php echo L('field_nickname');?></strong><br /><?php echo L('nickname_tips');?></th>
  66. <td><input type="text" name="info[name]" id="name" size="30" class="input-text" value="<?php echo $name?>"></td>
  67. </tr>
  68. <tr>
  69. <th><strong><?php echo L('field_tip');?></strong><br /><?php echo L('field_tips');?></th>
  70. <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>
  71. </tr>
  72. <tr>
  73. <th><strong><?php echo L('relation_parm');?></strong><br /><?php echo L('relation_parm_tips');?></th>
  74. <td><?php echo $form_data;?></td>
  75. </tr>
  76. <?php if(in_array($formtype,$att_css_js)) { ?>
  77. <tr>
  78. <th><strong><?php echo L('form_attr');?></strong><br /><?php echo L('form_attr_tips');?></th>
  79. <td><input type="text" name="info[formattribute]" size="50" class="input-text" value="<?php echo new_html_special_chars($formattribute);?>"></td>
  80. </tr>
  81. <tr>
  82. <th><strong><?php echo L('form_css_name');?></strong><br /><?php echo L('form_css_name_tips');?></th>
  83. <td><input type="text" name="info[css]" size="10" class="input-text" value="<?php echo new_html_special_chars($css);?>"></td>
  84. </tr>
  85. <?php } ?>
  86. <tr>
  87. <th><strong><?php echo L('string_size');?></strong><br /><?php echo L('string_size_tips');?></th>
  88. <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>
  89. </tr>
  90. <tr>
  91. <th><strong><?php echo L('data_preg');?></strong><br /><?php echo L('data_preg_tips');?></th>
  92. <td><input type="text" name="info[pattern]" id="pattern" value="<?php echo $pattern;?>" size="40" class="input-text">
  93. <select name="pattern_select" onchange="javascript:$('#pattern').val(this.value)">
  94. <option value=""><?php echo L('often_preg');?></option>
  95. <option value="/^[0-9.-]+$/"><?php echo L('figure');?></option>
  96. <option value="/^[0-9-]+$/"><?php echo L('integer');?></option>
  97. <option value="/^[a-z]+$/i"><?php echo L('letter');?></option>
  98. <option value="/^[0-9a-z]+$/i"><?php echo L('integer_letter');?></option>
  99. <option value="/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/">E-mail</option>
  100. <option value="/^[0-9]{5,20}$/">QQ</option>
  101. <option value="/^http:\/\//"><?php echo L('hyperlink');?></option>
  102. <option value="/^(1)[0-9]{10}$/"><?php echo L('mobile_number');?></option>
  103. <option value="/^[0-9-]{6,13}$/"><?php echo L('tel_number');?></option>
  104. <option value="/^[0-9]{6}$/"><?php echo L('zip');?></option>
  105. </select>
  106. </td>
  107. </tr>
  108. <tr>
  109. <th><strong><?php echo L('data_passed_msg');?></strong></th>
  110. <td><input type="text" name="info[errortips]" value="<?php echo new_html_special_chars($errortips);?>" size="50" class="input-text"></td>
  111. </tr>
  112. <tr>
  113. <th><strong><?php echo L('unique');?></strong></th>
  114. <td><input type="radio" name="info[isunique]" value="1" id="field_allow_isunique1" <?php if($isunique) echo 'checked';?> <?php if(!$field_allow_isunique) echo 'disabled'; ?>> <?php echo L('yes');?> <input type="radio" name="info[isunique]" value="0" id="field_allow_isunique0" <?php if(!$isunique) echo 'checked';?> <?php if(!$field_allow_isunique) echo 'disabled'; ?>> <?php echo L('no');?></td>
  115. </tr>
  116. <tr>
  117. <th><strong><?php echo L('basic_field');?></strong><br /><?php echo L('basic_field_tips');?></th>
  118. <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>
  119. </tr>
  120. <tr>
  121. <th><strong><?php echo L('as_search_field');?></strong></th>
  122. <td><input type="radio" name="info[issearch]" value="1" id="field_allow_search1" <?php if($issearch) echo 'checked';?> <?php if(!$field_allow_search) echo 'disabled'; ?>> <?php echo L('yes');?> <input type="radio" name="info[issearch]" value="0" id="field_allow_search0" <?php if(!$issearch) echo 'checked';?> <?php if(!$field_allow_search) echo 'disabled'; ?>> <?php echo L('no');?></td>
  123. </tr>
  124. <tr>
  125. <th><strong><?php echo L('allow_contributor');?></strong></th>
  126. <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>
  127. </tr>
  128. <tr>
  129. <th><strong><?php echo L('as_fulltext_field');?></strong></th>
  130. <td><input type="radio" name="info[isfulltext]" value="1" id="field_allow_fulltext1" <?php if($isfulltext) echo 'checked';?> <?php if(!$field_allow_fulltext) echo 'disabled'; ?>/> <?php echo L('yes');?> <input type="radio" name="info[isfulltext]" value="0" id="field_allow_fulltext0" <?php if(!$isfulltext) echo 'checked';?> <?php if(!$field_allow_fulltext) echo 'disabled'; ?>/> <?php echo L('no');?></td>
  131. </tr>
  132. <tr>
  133. <th><strong><?php echo L('as_omnipotent_field');?></strong><br><?php echo L('as_omnipotent_field_tips');?></th>
  134. <td><input type="radio" name="info[isomnipotent]" value="1" <?php if($isomnipotent) echo 'checked';?> <?php
  135. if(in_array($field,$forbid_fields)) echo 'disabled'; ?>/> <?php echo L('yes');?> <input type="radio" name="info[isomnipotent]" value="0" <?php if(!$isomnipotent) echo 'checked';?> /> <?php echo L('no');?></td>
  136. </tr>
  137. <tr>
  138. <th><strong><?php echo L('as_postion_info');?></strong></th>
  139. <td><input type="radio" name="info[isposition]" value="1" <?php if($isposition) echo 'checked';?> /> <?php echo L('yes');?> <input type="radio" name="info[isposition]" value="0" <?php if(!$isposition) echo 'checked';?>/> <?php echo L('no');?></td>
  140. </tr>
  141. <tr>
  142. <th><strong><?php echo L('disabled_groups_field');?></strong></th>
  143. <td><?php echo form::checkbox($grouplist,$unsetgroupids,'name="unsetgroupids[]" id="unsetgroupids"',0,'100');?></td>
  144. </tr>
  145. <tr>
  146. <th><strong><?php echo L('disabled_role_field');?></strong></th>
  147. <td><?php echo form::checkbox($roles,$unsetroleids,'name="unsetroleids[]" id="unsetroleids"',0,'100');?> </td>
  148. </tr>
  149. </table>
  150. <div class="bk15"></div>
  151. <input name="info[modelid]" type="hidden" value="<?php echo $modelid?>">
  152. <input name="fieldid" type="hidden" value="<?php echo $fieldid?>">
  153. <input name="oldfield" type="hidden" value="<?php echo $field?>">
  154. <div class="btn"><input name="dosubmit" type="submit" value="<?php echo L('submit')?>" class="button"></div>
  155. </form>
  156. </div>
  157. </body>
  158. </html>