PageRenderTime 41ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/manage-posts.php

http://typecho.googlecode.com/
PHP | 135 lines | 130 code | 5 blank | 0 comment | 32 complexity | 4971c128bf856393c3687220f4b1c99d MD5 | raw file
Possible License(s): AGPL-1.0
  1. <?php
  2. include 'common.php';
  3. include 'header.php';
  4. include 'menu.php';
  5. $stat = Typecho_Widget::widget('Widget_Stat');
  6. ?>
  7. <div class="main">
  8. <div class="body body-950">
  9. <?php include 'page-title.php'; ?>
  10. <div class="container typecho-page-main">
  11. <div class="column-24 start-01 typecho-list">
  12. <div class="typecho-list-operate">
  13. <form method="get">
  14. <p class="operate"><?php _e('??'); ?>:
  15. <span class="operate-button typecho-table-select-all"><?php _e('??'); ?></span>,
  16. <span class="operate-button typecho-table-select-none"><?php _e('??'); ?></span>&nbsp;&nbsp;&nbsp;
  17. <?php _e('???'); ?>:
  18. <span rel="delete" lang="<?php _e('????????????'); ?>" class="operate-button operate-delete typecho-table-select-submit"><?php _e('??'); ?></span>
  19. </p>
  20. <p class="search">
  21. <?php if ('' != $request->keywords || '' != $request->category): ?>
  22. <a href="<?php $options->adminUrl('manage-posts.php' . (isset($request->uid) ? '?uid=' . htmlspecialchars($request->get('uid')) : '')); ?>"><?php _e('&laquo; ????'); ?></a>
  23. <?php endif; ?>
  24. <input type="text" value="<?php '' != $request->keywords ? print(htmlspecialchars($request->keywords)) : _e('??????'); ?>"<?php if ('' == $request->keywords): ?> onclick="value='';name='keywords';" <?php else: ?> name="keywords"<?php endif; ?>/>
  25. <select name="category">
  26. <option value=""><?php _e('????'); ?></option>
  27. <?php Typecho_Widget::widget('Widget_Metas_Category_List')->to($category); ?>
  28. <?php while($category->next()): ?>
  29. <option value="<?php $category->mid(); ?>"<?php if($request->get('category') == $category->mid): ?> selected="true"<?php endif; ?>><?php $category->name(); ?></option>
  30. <?php endwhile; ?>
  31. </select>
  32. <button type="submit"><?php _e('??'); ?></button>
  33. <?php if(isset($request->uid)): ?>
  34. <input type="hidden" value="<?php echo htmlspecialchars($request->get('uid')); ?>" name="uid" />
  35. <?php endif; ?>
  36. </p>
  37. </form>
  38. </div>
  39. <form method="post" name="manage_posts" class="operate-form" action="<?php $options->index('/action/contents-post-edit'); ?>">
  40. <table class="typecho-list-table">
  41. <colgroup>
  42. <col width="25"/>
  43. <col width="50"/>
  44. <col width="280"/>
  45. <col width="80"/>
  46. <col width="30"/>
  47. <col width="110"/>
  48. <col width="185"/>
  49. <col width="130"/>
  50. </colgroup>
  51. <thead>
  52. <tr>
  53. <th class="typecho-radius-topleft"> </th>
  54. <th> </th>
  55. <th><?php _e('??'); ?></th>
  56. <th> </th>
  57. <th> </th>
  58. <th><?php _e('??'); ?></th>
  59. <th><?php _e('??'); ?></th>
  60. <th class="typecho-radius-topright"><?php _e('??'); ?></th>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. <?php Typecho_Widget::widget('Widget_Contents_Post_Admin')->to($posts); ?>
  65. <?php if($posts->have()): ?>
  66. <?php while($posts->next()): ?>
  67. <tr<?php $posts->alt(' class="even"', ''); ?> id="<?php $posts->theId(); ?>">
  68. <td><input type="checkbox" value="<?php $posts->cid(); ?>" name="cid[]"/></td>
  69. <td><a href="<?php $options->adminUrl('manage-comments.php?cid=' . $posts->cid); ?>" class="balloon-button right size-<?php echo Typecho_Common::splitByCount($posts->commentsNum, 1, 10, 20, 50, 100); ?>"><?php $posts->commentsNum(); ?></a></td>
  70. <td<?php if ('draft' != $posts->status && 'waiting' != $posts->status && 'private' != $posts->status && !$posts->password): ?> colspan="2"<?php endif; ?>>
  71. <a href="<?php $options->adminUrl('write-post.php?cid=' . $posts->cid); ?>"><?php $posts->title(); ?></a>
  72. <?php if ('draft' == $posts->status || 'waiting' == $posts->status || 'private' == $posts->status || $posts->password): ?>
  73. </td>
  74. <td>
  75. <span class="balloon right"><?php 'draft' == $posts->status ? _e('??') : ('waiting' == $posts->status ? _e('???') : ('private' == $posts->status ? _e('??') : _e(''))); ?> <?php $posts->password ? _e('??') : _e(''); ?></span>
  76. <?php endif; ?></td>
  77. <td>
  78. <?php if ('publish' == $posts->status): ?>
  79. <a class="right hidden-by-mouse" href="<?php $posts->permalink(); ?>"><img src="<?php $options->adminUrl('images/link.png'); ?>" title="<?php _e('?? %s', htmlspecialchars($posts->title)); ?>" width="16" height="16" alt="view" /></a>
  80. <?php endif; ?>
  81. </td>
  82. <td><a href="<?php $options->adminUrl('manage-posts.php?uid=' . $posts->author->uid); ?>"><?php $posts->author(); ?></a></td>
  83. <td><?php $categories = $posts->categories; $length = count($categories); ?>
  84. <?php foreach ($categories as $key => $val): ?>
  85. <?php echo '<a href="';
  86. $options->adminUrl('manage-posts.php?category=' . $val['mid']
  87. . (isset($request->uid) ? '&uid=' . $request->uid : '')
  88. . (isset($request->status) ? '&status=' . $request->status : ''));
  89. echo '">' . $val['name'] . '</a>' . ($key < $length - 1 ? ', ' : ''); ?>
  90. <?php endforeach; ?>
  91. </td>
  92. <td>
  93. <?php if ($posts->hasSaved): ?>
  94. <span class="description">
  95. <?php $modifyDate = new Typecho_Date($posts->modified); ?>
  96. <?php _e('??? %s', $modifyDate->word()); ?>
  97. </span>
  98. <?php else: ?>
  99. <?php $posts->dateWord(); ?>
  100. <?php endif; ?>
  101. </td>
  102. </tr>
  103. <?php endwhile; ?>
  104. <?php else: ?>
  105. <tr class="even">
  106. <td colspan="8"><h6 class="typecho-list-table-title"><?php _e('??????'); ?></h6></td>
  107. </tr>
  108. <?php endif; ?>
  109. </tbody>
  110. </table>
  111. <input type="hidden" name="do" value="delete" />
  112. </form>
  113. <?php if($posts->have()): ?>
  114. <div class="typecho-pager">
  115. <div class="typecho-pager-content">
  116. <ul>
  117. <?php $posts->pageNav(); ?>
  118. </ul>
  119. </div>
  120. </div>
  121. <?php endif; ?>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <?php
  127. include 'copyright.php';
  128. include 'common-js.php';
  129. include 'footer.php';
  130. ?>