sitemodel_import.tpl.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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_name')?>"}).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=import" method="post" id="myform" enctype="multipart/form-data">
  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[modelname]" 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. <tr>
  32. <th><?php echo L('import_model');?></th>
  33. <td>
  34. <input type="file" name="model_import" value="" class="input-text" id="model_import"></input>
  35. </td>
  36. </tr>
  37. </table>
  38. </fieldset>
  39. <div class="bk15"></div>
  40. <fieldset>
  41. <legend><?php echo L('template_setting')?></legend>
  42. <table width="100%" class="table_form">
  43. <tr>
  44. <th width="200"><?php echo L('available_styles');?>:</th>
  45. <td>
  46. <?php echo form::select($style_list, '', 'name="default_style" id="default_style" onchange="load_file_list(this.value)"', L('please_select'))?>
  47. </td>
  48. </tr>
  49. <tr>
  50. <th width="200"><?php echo L('category_index_tpl')?>:</th>
  51. <td id="category_template">
  52. </td>
  53. </tr>
  54. <tr>
  55. <th width="200"><?php echo L('category_list_tpl')?>:</th>
  56. <td id="list_template">
  57. </td>
  58. </tr>
  59. <tr>
  60. <th width="200"><?php echo L('content_tpl')?>:</th>
  61. <td id="show_template">
  62. </td>
  63. </tr>
  64. </table>
  65. </fieldset>
  66. <div class="bk15"></div>
  67. <div class="btn"><input type="submit" id="dosubmit" name="dosubmit" value="<?php echo L('submit');?>" class="button"/></div>
  68. </form>
  69. </div>
  70. <script language="JavaScript">
  71. <!--
  72. function load_file_list(id) {
  73. $.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);});
  74. }
  75. //-->
  76. </script>
  77. </body>
  78. </html>