file_list.tpl.php 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header','admin');
  4. ?>
  5. <div class="subnav">
  6. <h1 class="title-2 line-x"><?php echo $this->style_info['name'].' - '.L('detail')?></h1>
  7. </div>
  8. <div class="pad-lr-10">
  9. <div class="table-list">
  10. <form action="?m=template&c=file&a=updatefilename&style=<?php echo $this->style?>" method="post">
  11. <table width="100%" cellspacing="0">
  12. <thead>
  13. <tr>
  14. <th align="left" ><?php echo L("dir")?></th>
  15. <th align="left" ><?php echo L('desc')?></th>
  16. <th align="left" ><?php echo L('operation')?></th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. <tr>
  21. <td align="left" colspan="3"><?php echo L("local_dir")?>:<?php echo $local?></td>
  22. </tr>
  23. <?php if ($dir !='' && $dir != '.'):?>
  24. <tr>
  25. <td align="left" colspan="3"><a href="<?php echo '?m=template&c=file&a=init&style='.$this->style.'&dir='.stripslashes(dirname($dir))?>"><img src="<?php echo IMG_PATH?>folder-closed.gif" /><?php echo L("parent_directory")?></a></td>
  26. </tr>
  27. <?php endif;?>
  28. <?php
  29. if(is_array($list)):
  30. foreach($list as $v):
  31. $filename = basename($v);
  32. ?>
  33. <tr>
  34. <?php if (is_dir($v)) {
  35. echo '<td align="left"><img src="'.IMG_PATH.'folder-closed.gif" /> <a href="?m=template&c=file&a=init&style='.$this->style.'&dir='.(isset($_GET['dir']) && !empty($_GET['dir']) ? stripslashes($_GET['dir']).DIRECTORY_SEPARATOR : '').$filename.'"><b>'.$filename.'</b></a></td><td align="left"><input type="text" name="file_explan['.$encode_local.']['.$filename.']" value="'.(isset($file_explan[$encode_local][$filename]) ? $file_explan[$encode_local][$filename] : "").'"></td><td></td>';
  36. } else {
  37. if (substr($filename,-4,4) == 'html') {
  38. echo '<td align="left"><img src="'.IMG_PATH.'file.gif" /> '.$filename.'</td><td align="left"><input type="text" name="file_explan['.$encode_local.']['.$filename.']" value="'.(isset($file_explan[$encode_local][$filename]) ? $file_explan[$encode_local][$filename] : "").'"></td>';
  39. if($tpl_edit=='1'){
  40. echo '<td> <a href="?m=template&c=file&a=edit_file&style='.$this->style.'&dir='.urlencode(stripslashes($dir)).'&file='.$filename.'">['.L('edit').']</a> <a href="?m=template&c=file&a=visualization&style='.$this->style.'&dir='.urlencode(stripslashes($dir)).'&file='.$filename.'" target="_blank">['.L('visualization').']</a> <a href="javascript:history_file(\''.$filename.'\')">['.L('histroy').']</a></td>';
  41. }else{
  42. echo '<td></td>';
  43. }
  44. }
  45. }?>
  46. </tr>
  47. <?php
  48. endforeach;
  49. endif;
  50. ?></tbody>
  51. </table>
  52. <div class="btn"><input type="button" onclick="location.href='?m=template&c=style&a=init&pc_hash=<?php echo $_SESSION['pc_hash'];?>'" class="button" name="dosubmit" value="<?php echo L('returns_list_style')?>" /> <input type="button" class="button" name="dosubmit" value="<?php echo L('new')?>" onclick="add_file()" /> <input type="submit" class="button" name="dosubmit" value="<?php echo L('update')?>" ></div>
  53. </form>
  54. </div>
  55. <div id="pages"><?php echo $pages?></div>
  56. </div>
  57. <script type="text/javascript">
  58. <!--
  59. function history_file(name) {
  60. window.top.art.dialog({title:'《'+name+'》<?php echo L("histroy")?>',id:'history',iframe:'?m=template&c=template_bak&a=init&style=<?php echo $this->style;?>&dir=<?php echo urlencode(stripslashes($dir))?>&filename='+name,width:'700',height:'521'}, function(){var d = window.top.art.dialog({id:'history'}).close();return false;}, function(){window.top.art.dialog({id:'history'}).close()});
  61. }
  62. function add_file() {
  63. window.top.art.dialog({title:'<?php echo L("new")?>',id:'add_file',iframe:'?m=template&c=file&a=add_file&style=<?php echo $this->style;?>&dir=<?php echo urlencode(stripslashes($dir))?>',width:'500',height:'100'}, function(){var d = window.top.art.dialog({id:'add_file'}).data.iframe;d.document.getElementById('dosubmit').click();return false;}, function(){window.top.art.dialog({id:'add_file'}).close()});
  64. }
  65. //-->
  66. </script>
  67. </body>
  68. </html>