manage-medias.php 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <?php
  2. include 'common.php';
  3. include 'header.php';
  4. include 'menu.php';
  5. $stat = \Widget\Stat::alloc();
  6. $attachments = \Widget\Contents\Attachment\Admin::alloc();
  7. ?>
  8. <div class="main">
  9. <div class="body container">
  10. <?php include 'page-title.php'; ?>
  11. <div class="row typecho-page-main" role="main">
  12. <div class="col-mb-12">
  13. <div class="typecho-list-operate clearfix">
  14. <form method="get">
  15. <div class="operate">
  16. <label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
  17. class="typecho-table-select-all"/></label>
  18. <div class="btn-group btn-drop">
  19. <button class="btn dropdown-toggle btn-s" type="button"><i
  20. class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
  21. class="i-caret-down"></i></button>
  22. <ul class="dropdown-menu">
  23. <li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
  24. href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
  25. </li>
  26. </ul>
  27. <button class="btn btn-s btn-warn btn-operate"
  28. href="<?php $security->index('/action/contents-attachment-edit?do=clear'); ?>"
  29. lang="<?php _e('您确认要清理未归档的文件吗?'); ?>"><?php _e('清理未归档文件'); ?></button>
  30. </div>
  31. </div>
  32. <div class="search" role="search">
  33. <?php if ('' != $request->keywords): ?>
  34. <a href="<?php $options->adminUrl('manage-medias.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
  35. <?php endif; ?>
  36. <input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
  37. value="<?php echo $request->filter('html')->keywords; ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
  38. <button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
  39. </div>
  40. </form>
  41. </div><!-- end .typecho-list-operate -->
  42. <form method="post" name="manage_medias" class="operate-form">
  43. <div class="typecho-table-wrap">
  44. <table class="typecho-list-table draggable">
  45. <colgroup>
  46. <col width="20" class="kit-hidden-mb"/>
  47. <col width="6%" class="kit-hidden-mb"/>
  48. <col width="30%"/>
  49. <col width="" class="kit-hidden-mb"/>
  50. <col width="30%" class="kit-hidden-mb"/>
  51. <col width="16%"/>
  52. </colgroup>
  53. <thead>
  54. <tr>
  55. <th class="kit-hidden-mb"></th>
  56. <th class="kit-hidden-mb"></th>
  57. <th><?php _e('文件名'); ?></th>
  58. <th class="kit-hidden-mb"><?php _e('上传者'); ?></th>
  59. <th class="kit-hidden-mb"><?php _e('所属文章'); ?></th>
  60. <th><?php _e('发布日期'); ?></th>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <?php if ($attachments->have()): ?>
  65. <?php while ($attachments->next()): ?>
  66. <?php $mime = \Typecho\Common::mimeIconType($attachments->attachment->mime); ?>
  67. <tr id="<?php $attachments->theId(); ?>">
  68. <td class="kit-hidden-mb"><input type="checkbox"
  69. value="<?php $attachments->cid(); ?>"
  70. name="cid[]"/></td>
  71. <td class="kit-hidden-mb"><a
  72. href="<?php $options->adminUrl('manage-comments.php?cid=' . $attachments->cid); ?>"
  73. class="balloon-button size-<?php echo \Typecho\Common::splitByCount($attachments->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $attachments->commentsNum(); ?></a>
  74. </td>
  75. <td>
  76. <i class="mime-<?php echo $mime; ?>"></i>
  77. <a href="<?php $options->adminUrl('media.php?cid=' . $attachments->cid); ?>"><?php $attachments->title(); ?></a>
  78. <a href="<?php $attachments->permalink(); ?>"
  79. title="<?php _e('浏览 %s', $attachments->title); ?>"><i
  80. class="i-exlink"></i></a>
  81. </td>
  82. <td class="kit-hidden-mb"><?php $attachments->author(); ?></td>
  83. <td class="kit-hidden-mb">
  84. <?php if ($attachments->parentPost->cid): ?>
  85. <a href="<?php $options->adminUrl('write-' . (0 === strpos($attachments->parentPost->type, 'post') ? 'post' : 'page') . '.php?cid=' . $attachments->parentPost->cid); ?>"><?php $attachments->parentPost->title(); ?></a>
  86. <?php else: ?>
  87. <span class="description"><?php _e('未归档'); ?></span>
  88. <?php endif; ?>
  89. </td>
  90. <td><?php $attachments->dateWord(); ?></td>
  91. </tr>
  92. <?php endwhile; ?>
  93. <?php else: ?>
  94. <tr>
  95. <td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何文件'); ?></h6>
  96. </td>
  97. </tr>
  98. <?php endif; ?>
  99. </tbody>
  100. </table><!-- end .typecho-list-table -->
  101. </div><!-- end .typecho-table-wrap -->
  102. </form><!-- end .operate-form -->
  103. <div class="typecho-list-operate clearfix">
  104. <form method="get">
  105. <div class="operate">
  106. <label><i class="sr-only"><?php _e('全选'); ?></i><input type="checkbox"
  107. class="typecho-table-select-all"/></label>
  108. <div class="btn-group btn-drop">
  109. <button class="btn dropdown-toggle btn-s" type="button"><i
  110. class="sr-only"><?php _e('操作'); ?></i><?php _e('选中项'); ?> <i
  111. class="i-caret-down"></i></button>
  112. <ul class="dropdown-menu">
  113. <li><a lang="<?php _e('你确认要删除这些文件吗?'); ?>"
  114. href="<?php $security->index('/action/contents-attachment-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
  115. </li>
  116. </ul>
  117. </div>
  118. <button class="btn btn-s btn-warn btn-operate"
  119. href="<?php $security->index('/action/contents-attachment-edit?do=clear'); ?>"
  120. lang="<?php _e('您确认要清理未归档的文件吗?'); ?>"><?php _e('清理未归档文件'); ?></button>
  121. </div>
  122. <?php if ($attachments->have()): ?>
  123. <ul class="typecho-pager">
  124. <?php $attachments->pageNav(); ?>
  125. </ul>
  126. <?php endif; ?>
  127. </form>
  128. </div><!-- end .typecho-list-operate -->
  129. </div>
  130. </div><!-- end .typecho-page-main -->
  131. </div>
  132. </div>
  133. <?php
  134. include 'copyright.php';
  135. include 'common-js.php';
  136. include 'table-js.php';
  137. include 'footer.php';
  138. ?>