sitemodel_add.tpl.php 4.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header','admin');
  4. ?>
  5. <script type="text/javascript">
  6. <!--
  7. $(function(){
  8. $.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
  9. $("#name").formValidator({onshow:"<?php echo L("input").L('model_name')?>",onfocus:"<?php echo L("input").L('model_name')?>",oncorrect:"<?php echo L('input_right');?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('model_name')?>"});
  10. $("#tablename").formValidator({onshow:"<?php echo L("input").L('model_tablename')?>",onfocus:"<?php echo L("input").L('model_tablename')?>"}).regexValidator({regexp:"^([a-zA-Z0-9]|[_]){0,20}$",onerror:"<?php echo L("model_tablename_wrong");?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('model_tablename')?>"}).ajaxValidator({type : "get",url : "",data :"m=content&c=sitemodel&a=public_check_tablename",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('model_tablename').L('exists')?>",onwait : "<?php echo L('connecting')?>"});
  11. })
  12. //-->
  13. </script>
  14. <div class="pad-lr-10">
  15. <form action="?m=content&c=sitemodel&a=add" method="post" id="myform">
  16. <fieldset>
  17. <legend><?php echo L('basic_configuration')?></legend>
  18. <table width="100%" class="table_form">
  19. <tr>
  20. <th width="120"><?php echo L('model_name')?>:</th>
  21. <td class="y-bg"><input type="text" class="input-text" name="info[name]" id="name" size="30" /></td>
  22. </tr>
  23. <tr>
  24. <th><?php echo L('model_tablename')?>:</th>
  25. <td class="y-bg"><input type="text" class="input-text" name="info[tablename]" id="tablename" size="30" /></td>
  26. </tr>
  27. <tr>
  28. <th><?php echo L('description')?>:</th>
  29. <td class="y-bg"><input type="text" class="input-text" name="info[description]" id="description" size="30"/></td>
  30. </tr>
  31. </table>
  32. </fieldset>
  33. <div class="bk15"></div>
  34. <fieldset>
  35. <legend><?php echo L('template_setting')?></legend>
  36. <table width="100%" class="table_form">
  37. <tr>
  38. <th width="200"><?php echo L('available_styles');?></th>
  39. <td>
  40. <?php echo form::select($style_list, '', 'name="info[default_style]" id="default_style" onchange="load_file_list(this.value)"', L('please_select'))?>
  41. </td>
  42. </tr>
  43. <tr>
  44. <th width="200"><?php echo L('category_index_tpl')?>:</th>
  45. <td id="category_template">
  46. </td>
  47. </tr>
  48. <tr>
  49. <th width="200"><?php echo L('category_list_tpl')?>:</th>
  50. <td id="list_template">
  51. </td>
  52. </tr>
  53. <tr>
  54. <th width="200"><?php echo L('content_tpl')?>:</th>
  55. <td id="show_template">
  56. </td>
  57. </tr>
  58. </table>
  59. </fieldset>
  60. <div class="bk15"></div>
  61. <fieldset>
  62. <legend><?php echo L('other_template_setting')?> <input type="checkbox" id="other" value="1" name="other"></legend>
  63. <table width="100%" id="other_tab" class="table_form" style="display:none;">
  64. <tr>
  65. <th width="200"><?php echo L('admin_content_list')?></th>
  66. <td id="admin_list_template"><?php echo $admin_list_template;?>
  67. </td>
  68. </tr>
  69. <tr>
  70. <th width="200"><?php echo L('member_content_add')?></th>
  71. <td id="member_add_template"><?php echo form::select_template($default_style,'member', '', 'name="setting[member_add_template]" id="template_member_add"', 'content_publish')?>
  72. </td>
  73. </tr>
  74. </table>
  75. </fieldset>
  76. <div class="bk15"></div>
  77. <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="<?php echo L('submit');?>" />
  78. </form>
  79. </div>
  80. <script language="JavaScript">
  81. <!--
  82. function load_file_list(id) {
  83. $.getJSON('?m=admin&c=category&a=public_tpl_file_list&style='+id+'&catid=', function(data){$('#category_template').html(data.category_template);$('#list_template').html(data.list_template);$('#show_template').html(data.show_template);});
  84. }
  85. $("#other").click(function() {
  86. if ($('#other').attr('checked')) {
  87. $('#other_tab').show();
  88. } else {
  89. $('#other_tab').hide();
  90. }
  91. })
  92. //-->
  93. </script>
  94. </body>
  95. </html>