attachment_list.tpl.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header', 'admin');
  4. ?>
  5. <script type="text/javascript" src="<?php echo JS_PATH?>jquery.sgallery.js"></script>
  6. <div class="pad-lr-10">
  7. <form name="searchform" action="" method="get" >
  8. <input type="hidden" value="attachment" name="m">
  9. <input type="hidden" value="manage" name="c">
  10. <input type="hidden" value="init" name="a">
  11. <table width="100%" cellspacing="0" class="search-form">
  12. <tbody>
  13. <tr>
  14. <td><div class="explain-col"><?php echo L('name')?> <input type="text" value="<?php echo $filename?>" class="input-text" name="info[filename]"> <?php echo L('uploadtime')?> <?php echo form::date('info[start_uploadtime]',$start_uploadtime,'1','0','true','1')?><?php echo L('to')?> <?php echo form::date('info[end_uploadtime]',$end_uploadtime)?> <?php echo L('filetype')?> <input type="text" value="<?php echo $fileext?>" class="input-text" name="info[fileext]"> <input type="submit" value="<?php echo L('search')?>" class="button" name="dosubmit"> <a href="?m=attachment&c=manage&a=dir&menuid=<?php echo $_GET['menuid']?>"><?php echo L('dir_schema')?></a>
  15. </div>
  16. </td>
  17. </tr>
  18. </tbody>
  19. </table>
  20. </form>
  21. <div class="table-list">
  22. <form name="myform" action="?m=admin&c=role&a=listorder" method="post" id="myform">
  23. <table width="100%" cellspacing="0">
  24. <thead>
  25. <tr>
  26. <th width="10%"><?php echo L('delete')?></th>
  27. <th width="5%">ID</th>
  28. <th width="8%" ><?php echo L('moudle')?>
  29. <div class="tab-use">
  30. <div style="position:relative">
  31. <div class="arrows cu" onmouseover="hoverUse('module-div');" onmouseout="hoverUse();" onmouseover="this.style.display='block'"></div>
  32. <ul id="module-div" class="tab-web-panel" onmouseover="this.style.display='block'" onmouseout="hoverUse('module-div');" style="height:150px; width:100px; text-align:left; overflow-y:scroll;">
  33. <?php foreach ($modules as $module) {
  34. if(in_array($module['module'], array('pay','digg','search','scan','attachment','block','dbsource','template','release','cnzz','comment','mood'))) continue;
  35. echo '<li><a href='.url_par('dosubmit=1&module='.$module['module']).'>'.$module['name'].'</a></li>';
  36. }?>
  37. </ul>
  38. </div>
  39. </div>
  40. </th>
  41. <th width="8%" ><?php echo L('catname')?></th>
  42. <th width="20%"><?php echo L('filename')?>
  43. <div class="tab-use">
  44. <div style="position:relative">
  45. <div class="arrows cu" onmouseover="hoverUse('use-div');" onmouseout="hoverUse();" onmouseover="this.style.display='block'"></div>
  46. <ul id="use-div" class="tab-web-panel" onmouseover="this.style.display='block'" onmouseout="hoverUse('use-div');">
  47. <li><a href="<?php echo url_par('dosubmit=1&status=0')?>"><?php echo L('not_used')?></a></li>
  48. <li><a href="<?php echo url_par('dosubmit=1&status=1')?>"><?php echo L('used')?></a></li>
  49. </ul>
  50. </div>
  51. </div></th>
  52. <th width="10%" ><?php echo L('filesize')?></th>
  53. <th width="20%" ><?php echo L('uploadtime')?></th>
  54. <th width="15%" ><?php echo L('operations_manage')?></th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. <?php
  59. if(is_array($infos)){
  60. foreach($infos as $info){
  61. $thumb = glob(dirname($this->upload_path.$info['filepath']).'/thumb_*'.basename($info['filepath']));
  62. ?>
  63. <tr>
  64. <td width="10%" align="center"><input type="checkbox" name="aid[]" value="<?php echo $info['aid']?>" id="att_<?php echo $info['aid']?>" /></td>
  65. <td width="5%" align="center"><?php echo $info['aid']?></td>
  66. <td width="8%" align="center"><?php echo $modules[$info['module']]['name']?></td>
  67. <td width="8%" align="center"><?php echo $category[$info['catid']]['catname']?></td>
  68. <td width="20%"><img src="<?php echo file_icon($info['filename'],'gif')?>" /> <?php echo $info['filename']?> <?php echo $thumb ? '<img title="'.L('att_thumb_manage').'" src="statics/images/admin_img/havthumb.png" onclick="showthumb('.$info['aid'].', \''.new_addslashes($info['filename']).'\')"/>':''?> <?php echo $info['status'] ? '<img src="statics/images/admin_img/link.png"':''?></td>
  69. <td width="10%" align="center"><?php echo $this->attachment->size($info['filesize'])?></td>
  70. <td width="12%" align="center"><?php echo date('Y-m-d H:i:s',$info['uploadtime'])?></td>
  71. <td align="center"><a href="javascript:preview(<?php echo $info['aid']?>, '<?php echo $info['filename']?>','<?php echo $this->upload_url.$info['filepath']?>')"><?php echo L('preview')?></a> | <a href="javascript:;" onclick="att_delete(this,'<?php echo $info['aid']?>')"><?php echo L('delete')?></a></td>
  72. </tr>
  73. <?php
  74. }
  75. }
  76. ?>
  77. </tbody>
  78. </table>
  79. <div class="btn"><a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('selected_all')?></a>/<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a> <input type="submit" class="button" name="dosubmit" value="<?php echo L('delete')?>" onClick="document.myform.action='?m=attachment&c=manage&a=public_delete_all';return confirm('<?php echo L('del_confirm')?>')"/></div>
  80. <div id="pages"> <?php echo $pages?></div>
  81. </form>
  82. </div>
  83. </div>
  84. </body>
  85. </html>
  86. <script type="text/javascript">
  87. <!--
  88. window.top.$('#display_center_id').css('display','none');
  89. function preview(id, name,filepath) {
  90. if(IsImg(filepath)) {
  91. window.top.art.dialog({title:'<?php echo L('preview')?>',fixed:true, content:'<img src="'+filepath+'" onload="$(this).LoadImage(true, 500, 500,\'<?php echo IMG_PATH?>s_nopic.gif\');"/>'});
  92. } else {
  93. window.top.art.dialog({title:'<?php echo L('preview')?>',fixed:true, content:'<a href="'+filepath+'" target="_blank"><img src="<?php echo IMG_PATH?>admin_img/down.gif"><?php echo L('click_open')?></a>'});
  94. }
  95. }
  96. function att_delete(obj,aid){
  97. window.top.art.dialog({content:'<?php echo L('del_confirm')?>', fixed:true, style:'confirm', id:'att_delete'},
  98. function(){
  99. $.get('?m=attachment&c=manage&a=delete&aid='+aid+'&pc_hash=<?php echo $_SESSION['pc_hash']?>',function(data){
  100. if(data == 1) $(obj).parent().parent().fadeOut("slow");
  101. })
  102. },
  103. function(){});
  104. };
  105. function showthumb(id, name) {
  106. window.top.art.dialog({title:'<?php echo L('att_thumb_manage')?>--'+name, id:'edit', iframe:'?m=attachment&c=manage&a=pullic_showthumbs&aid='+id ,width:'500px',height:'400px'});
  107. }
  108. function hoverUse(target){
  109. if($("#"+target).css("display") == "none"){
  110. $("#"+target).show();
  111. }else{
  112. $("#"+target).hide();
  113. }
  114. }
  115. function IsImg(url){
  116. var sTemp;
  117. var b=false;
  118. var opt="jpg|gif|png|bmp|jpeg";
  119. var s=opt.toUpperCase().split("|");
  120. for (var i=0;i<s.length ;i++ ){
  121. sTemp=url.substr(url.length-s[i].length-1);
  122. sTemp=sTemp.toUpperCase();
  123. s[i]="."+s[i];
  124. if (s[i]==sTemp){
  125. b=true;
  126. break;
  127. }
  128. }
  129. return b;
  130. }
  131. //-->
  132. </script>