block_add_edit.tpl.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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'})}});
  9. $("#name").formValidator({onshow:"<?php echo L('input').L('name')?>",onfocus:"<?php echo L('input').L('name')?>"}).inputValidator({min:1,onerror:"<?php echo L('input').L('name')?>"}).ajaxValidator({type : "get",url : "",data :"m=block&c=block_admin&a=public_name&id=<?php if(isset($id) && !empty($id))echo $id;?>",datatype : "html",async:'false',success : function(data){ if( data == "1" ){return true;}else{return false;}},buttons: $("#dosubmit"),onerror : "<?php echo L('name').L('exists')?>",onwait : "<?php echo L('connecting')?>"})<?php if(ROUTE_A=='edit')echo '.defaultPassed()';?>;
  10. })
  11. //-->
  12. </script>
  13. <div class="pad-10">
  14. <form action="?m=block&c=block_admin&a=<?php echo ROUTE_A?>&pos=<?php echo $_GET['pos']?>&id=<?php if(isset($id) && !empty($id))echo $id;?>" method="post" id="myform">
  15. <div>
  16. <fieldset>
  17. <legend><?php echo L('block_configuration')?></legend>
  18. <table width="100%" class="table_form">
  19. <tr>
  20. <th width="80"><?php echo L('name')?>:</th>
  21. <td class="y-bg"><input type="text" name="name" id="name" size="30" value="<?php echo isset($data['name']) ? $data['name'] : '';?>" /></td>
  22. </tr>
  23. <tr>
  24. <th width="80"><?php echo L('display_position')?>:</th>
  25. <td class="y-bg"> <?php echo isset($data['pos']) ? $data['pos'] : $_GET['pos'];?></td>
  26. </tr>
  27. <tr>
  28. <th width="80"><?php echo L('type')?>:</th>
  29. <td class="y-bg"><?php echo form::radio(array('1'=>L('code'), '2'=>L('table_style')), (isset($data['type']) ? $data['type'] : 1), 'name="type"'.(ROUTE_A=='edit' ? ' disabled = "disabled"' : ''))?></td>
  30. </tr>
  31. </table>
  32. </fieldset>
  33. <div class="bk15"></div>
  34. <fieldset>
  35. <legend><?php echo L('permission_configuration')?></legend>
  36. <table width="100%" class="table_form">
  37. <tr>
  38. <th width="80"><?php echo L('role')?>:</th>
  39. <td class="y-bg"><?php echo form::checkbox($administrator, (isset($priv_list) ? implode(',', $priv_list) : ''), 'name="priv[]"')?></td>
  40. </tr>
  41. </table>
  42. </fieldset>
  43. <input type="submit" class="dialog" id="dosubmit" name="dosubmit" value="" />
  44. </div>
  45. </div>
  46. </form>
  47. </body>
  48. </html>