manage-pages.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?php
  2. include 'common.php';
  3. include 'header.php';
  4. include 'menu.php';
  5. $stat = \Widget\Stat::alloc();
  6. $pages = \Widget\Contents\Page\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 typecho-list">
  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-page-edit?do=delete'); ?>"><?php _e('删除'); ?></a>
  25. </li>
  26. <li>
  27. <a href="<?php $security->index('/action/contents-page-edit?do=mark&status=publish'); ?>"><?php _e('标记为<strong>%s</strong>', _t('公开')); ?></a>
  28. </li>
  29. <li>
  30. <a href="<?php $security->index('/action/contents-page-edit?do=mark&status=hidden'); ?>"><?php _e('标记为<strong>%s</strong>', _t('隐藏')); ?></a>
  31. </li>
  32. </ul>
  33. </div>
  34. </div>
  35. <div class="search" role="search">
  36. <?php if ('' != $request->keywords): ?>
  37. <a href="<?php $options->adminUrl('manage-pages.php'); ?>"><?php _e('&laquo; 取消筛选'); ?></a>
  38. <?php endif; ?>
  39. <input type="text" class="text-s" placeholder="<?php _e('请输入关键字'); ?>"
  40. value="<?php echo $request->filter('html')->keywords; ?>" name="keywords"/>
  41. <button type="submit" class="btn btn-s"><?php _e('筛选'); ?></button>
  42. </div>
  43. </form>
  44. </div><!-- end .typecho-list-operate -->
  45. <form method="post" name="manage_pages" class="operate-form">
  46. <div class="typecho-table-wrap">
  47. <table class="typecho-list-table">
  48. <colgroup>
  49. <col width="20" class="kit-hidden-mb"/>
  50. <col width="6%" class="kit-hidden-mb"/>
  51. <col width="30%"/>
  52. <col width="30%"/>
  53. <col width="" class="kit-hidden-mb"/>
  54. <col width="16%"/>
  55. </colgroup>
  56. <thead>
  57. <tr class="nodrag">
  58. <th class="kit-hidden-mb"></th>
  59. <th class="kit-hidden-mb"></th>
  60. <th><?php _e('标题'); ?></th>
  61. <th><?php _e('缩略名'); ?></th>
  62. <th class="kit-hidden-mb"><?php _e('作者'); ?></th>
  63. <th><?php _e('日期'); ?></th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <?php if ($pages->have()): ?>
  68. <?php while ($pages->next()): ?>
  69. <tr id="<?php $pages->theId(); ?>">
  70. <td class="kit-hidden-mb"><input type="checkbox" value="<?php $pages->cid(); ?>"
  71. name="cid[]"/></td>
  72. <td class="kit-hidden-mb"><a
  73. href="<?php $options->adminUrl('manage-comments.php?cid=' . $pages->cid); ?>"
  74. class="balloon-button size-<?php echo \Typecho\Common::splitByCount($pages->commentsNum, 1, 10, 20, 50, 100); ?>"
  75. title="<?php $pages->commentsNum(); ?> <?php _e('评论'); ?>"><?php $pages->commentsNum(); ?></a>
  76. </td>
  77. <td>
  78. <a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"><?php $pages->title(); ?></a>
  79. <?php
  80. if ($pages->hasSaved || 'page_draft' == $pages->type) {
  81. echo '<em class="status">' . _t('草稿') . '</em>';
  82. }
  83. if ('hidden' == $pages->status) {
  84. echo '<em class="status">' . _t('隐藏') . '</em>';
  85. }
  86. ?>
  87. <a href="<?php $options->adminUrl('write-page.php?cid=' . $pages->cid); ?>"
  88. title="<?php _e('编辑 %s', htmlspecialchars($pages->title)); ?>"><i
  89. class="i-edit"></i></a>
  90. <?php if ('page_draft' != $pages->type): ?>
  91. <a href="<?php $pages->permalink(); ?>"
  92. title="<?php _e('浏览 %s', htmlspecialchars($pages->title)); ?>"><i
  93. class="i-exlink"></i></a>
  94. <?php endif; ?>
  95. </td>
  96. <td><?php $pages->slug(); ?></td>
  97. <td class="kit-hidden-mb"><?php $pages->author(); ?></td>
  98. <td>
  99. <?php if ($pages->hasSaved): ?>
  100. <span class="description">
  101. <?php $modifyDate = new \Typecho\Date($pages->modified); ?>
  102. <?php _e('保存于 %s', $modifyDate->word()); ?>
  103. </span>
  104. <?php else: ?>
  105. <?php $pages->dateWord(); ?>
  106. <?php endif; ?>
  107. </td>
  108. </tr>
  109. <?php endwhile; ?>
  110. <?php else: ?>
  111. <tr>
  112. <td colspan="6"><h6 class="typecho-list-table-title"><?php _e('没有任何页面'); ?></h6>
  113. </td>
  114. </tr>
  115. <?php endif; ?>
  116. </tbody>
  117. </table>
  118. </div><!-- end .typecho-table-wrap -->
  119. </form><!-- end .operate-form -->
  120. </div><!-- end .typecho-list -->
  121. </div><!-- end .typecho-page-main -->
  122. </div>
  123. </div>
  124. <?php
  125. include 'copyright.php';
  126. include 'common-js.php';
  127. include 'table-js.php';
  128. ?>
  129. <?php if (!isset($request->status) || 'publish' == $request->get('status')): ?>
  130. <script type="text/javascript">
  131. (function () {
  132. $(document).ready(function () {
  133. var table = $('.typecho-list-table').tableDnD({
  134. onDrop: function () {
  135. var ids = [];
  136. $('input[type=checkbox]', table).each(function () {
  137. ids.push($(this).val());
  138. });
  139. $.post('<?php $security->index('/action/contents-page-edit?do=sort'); ?>',
  140. $.param({cid: ids}));
  141. }
  142. });
  143. });
  144. })();
  145. </script>
  146. <?php endif; ?>
  147. <?php include 'footer.php'; ?>