link_edit.tpl.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. include $this->admin_tpl('header','admin');
  3. ?>
  4. <script type="text/javascript">
  5. <!--
  6. $(function(){
  7. $.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();})}});
  8. $("#link_name").formValidator({onshow:"<?php echo L("input").L('link_name')?>",onfocus:"<?php echo L("input").L('link_name')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('link_name')?>"}).ajaxValidator({type : "get",url : "",data :"m=link&c=link&a=public_name&linkid=<?php echo $linkid;?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('link_name').L('exists')?>",onwait : "<?php echo L('connecting')?>"}).defaultPassed();
  9. $("#link_url").formValidator({onshow:"<?php echo L("input").L('url')?>",onfocus:"<?php echo L("input").L('url')?>"}).inputValidator({min:1,onerror:"<?php echo L("input").L('url')?>"}).regexValidator({regexp:"^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&]*([^<>])*$",onerror:"<?php echo L('link_onerror')?>"})
  10. })
  11. //-->
  12. </script>
  13. <div class="pad_10">
  14. <form action="?m=link&c=link&a=edit&linkid=<?php echo $linkid; ?>" method="post" name="myform" id="myform">
  15. <table cellpadding="2" cellspacing="1" class="table_form" width="100%">
  16. <tr>
  17. <th width="20%"><?php echo L('typeid')?>:</th>
  18. <td><select name="link[typeid]" id="">
  19. <option value="0" <?php if($typeid=='0'){echo "selected";}?>>默认分类</option>
  20. <?php
  21. $i=0;
  22. foreach($types as $type_key=>$type){
  23. $i++;
  24. ?>
  25. <option value="<?php echo $type['typeid'];?>" <?php if($type['typeid']==$typeid){echo "selected";}?>><?php echo $type['name'];?></option>
  26. <?php }?>
  27. </select></td>
  28. </tr>
  29. <tr>
  30. <th width="100"><?php echo L('link_type')?>:</th>
  31. <td>
  32. <?php if($linktype == 1){
  33. ?>
  34. <input name="link[linktype]" type="radio" value="1" checked="checked" style="border:0" onclick="$('#logolink').show()" class="radio_style">
  35. <?php echo L('logo_link')?>&nbsp;&nbsp;&nbsp;&nbsp;
  36. <input type="radio" name="link[linktype]" value="0" style="border:0" onclick="$('#logolink').hide()" class="radio_style">
  37. <?php echo L('word_link')?>
  38. <?php }else{?>
  39. <input name="link[linktype]" type="radio" value="1" style="border:0" onclick="$('#logolink').show()" class="radio_style">
  40. <?php echo L('logo_link')?>&nbsp;&nbsp;&nbsp;&nbsp;
  41. <input type="radio" name="link[linktype]" value="0" checked="checked" style="border:0" onclick="$('#logolink').hide()" class="radio_style">
  42. <?php echo L('word_link')?>
  43. <?php } ?>
  44. </td>
  45. </tr>
  46. <tr>
  47. <th width="100"><?php echo L('link_name')?>:</th>
  48. <td><input type="text" name="link[name]" id="link_name"
  49. size="30" class="input-text" value="<?php echo $name;?>"></td>
  50. </tr>
  51. <tr>
  52. <th width="100"><?php echo L('url')?>:</th>
  53. <td><input type="text" name="link[url]" id="link_url"
  54. size="30" class="input-text" value="<?php echo $url;?>"></td>
  55. </tr>
  56. <?php if($linktype==1){?>
  57. <tr id="logolink">
  58. <th width="100"><?php echo L('logo')?>:</th>
  59. <td><?php echo form::images('link[logo]', 'logo', $info['logo'], 'link')?></td>
  60. </tr>
  61. <?php }else{?>
  62. <tr id="logolink" style="display: none;">
  63. <th width="100"><?php echo L('logo')?>:</th>
  64. <td><?php echo form::images('link[logo]', 'logo', $info['logo'], 'link')?></td>
  65. </tr>
  66. <?php }?>
  67. <tr>
  68. <th width="100"><?php echo L('username')?>:</th>
  69. <td><input type="text" name="link[username]" id="link_username"
  70. size="30" class="input-text" value="<?php echo $username;?>"></td>
  71. </tr>
  72. <tr>
  73. <th><?php echo L('web_description')?>:</th>
  74. <td><textarea name="link[introduce]" id="introduce" cols="50"
  75. rows="6"><?php echo $introduce;?></textarea></td>
  76. </tr>
  77. <tr>
  78. <th><?php echo L('elite')?>:</th>
  79. <td><input name="link[elite]" type="radio" value="1" <?php if($elite==1){echo "checked";}?>>&nbsp;<?php echo L('yes')?>&nbsp;&nbsp;<input
  80. name="link[elite]" type="radio" value="0" <?php if($elite==0){echo "checked";}?>>&nbsp;<?php echo L('no')?></td>
  81. </tr>
  82. <tr>
  83. <th><?php echo L('passed')?>:</th>
  84. <td><input name="link[passed]" type="radio" value="1" <?php if($passed==1){echo "checked";}?>>&nbsp;<?php echo L('yes')?>&nbsp;&nbsp;<input
  85. name="link[passed]" type="radio" value="0" <?php if($passed==0){echo "checked";}?>>&nbsp;<?php echo L('no')?></td>
  86. </tr>
  87. <tr>
  88. <th></th>
  89. <td><input type="hidden" name="forward" value="?m=link&c=link&a=edit"> <input
  90. type="submit" name="dosubmit" id="dosubmit" class="dialog"
  91. value=" <?php echo L('submit')?> "></td>
  92. </tr>
  93. </table>
  94. </form>
  95. </div>
  96. </body>
  97. </html>