/halogy/application/modules/blog/views/admin/index.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 84 lines · 76 code · 8 blank · 0 comment · 7 complexity · 48f1bdd57d5a4b1b318519bcd2d79c14 MD5 · raw file

  1. <!-- [Content] start -->
  2. <div class="content wide">
  3. <h1 id="blog">Blog Admininistration</h1>
  4. <ul class="manage">
  5. <li><a href="<?=site_url('admin/blog/create')?>">Write Post</a></li>
  6. <li><a href="<?=site_url('admin/blog/comments')?>">Comments</a></li>
  7. <li><a href="<?=site_url('admin/blog/tags')?>">Tags</a></li>
  8. <li><a href="<?=site_url('admin/blog/settings')?>">Blog Settings</a></li>
  9. <li><a href="<?=site_url('admin')?>" class="last">Cancel</a></li>
  10. </ul>
  11. <br class="clearfloat" />
  12. <hr />
  13. <?php if ($notice = $this->session->flashdata('notification')):?>
  14. <p class="notice"><?=$notice;?></p>
  15. <?php endif;?>
  16. <div id="latest_comments">
  17. <h2>Latest Comments<?php if ($comments_pending > 0):?> <a href="<?=site_url('admin/blog/comments/moderate')?>">(<?=$comments_pending?> in Moderation)</a><?php endif;?> &raquo;</h2>
  18. <?php if (!empty($comments)): ?>
  19. <ul>
  20. <?php foreach ($comments as $comment): ?>
  21. <li>
  22. <a href="<?php echo (!empty($comment['website'])) ? $comment['website'] : 'mailto:'.$comment['email']?>"><?php echo $comment['author']?></a> on <a href="<?php echo site_url('blog/'.date('Y/m', $comment['post_date_posted']).'/'.$comment['post_uri'])?>"><?php echo $comment['post_title']?></a> (<a href="<?php echo site_url('admin/blog/comments/edit/'.$comment['id'])?>">edit</a>)
  23. </li>
  24. <?php endforeach; ?>
  25. </ul>
  26. <?php else:?>
  27. None
  28. <?php endif; ?>
  29. </div>
  30. <div id="latest_trackbacks">
  31. <h2>Latest Trackbacks <?php if ($trackbacks_pending > 0):?> <a href="<?=site_url('admin/blog/trackbacks/moderate')?>">(<?=$trackbacks_pending?> in Moderation)</a><?php endif;?>&raquo;</h2>
  32. <ul>
  33. <?php if (!empty($trackbacks)): ?>
  34. <ul>
  35. <?php foreach ($trackbacks as $trackback): ?>
  36. <li>
  37. <a href="<?php echo $trackback['urk']?>"><?php echo $trackback['title']?></a> on <a href="<?php echo site_url('blog/'.date('Y/m', $trackback['post_date_posted']).'/'.$trackback['post_uri'])?>"><?php echo $trackback['post_title']?></a> (<a href="<?php echo site_url('admin/blog/trackbacks/edit/'.$trackback['id'])?>">edit</a>)
  38. </li>
  39. <?php endforeach; ?>
  40. </ul>
  41. <?php else:?>
  42. None
  43. <?php endif; ?>
  44. </ul>
  45. </div>
  46. <h2>Posts</h2>
  47. <table class="page-list">
  48. <thead>
  49. <tr>
  50. <th width="3%" class="center">#</th>
  51. <th width="27%">Title</th>
  52. <th width="27%">URI</th>
  53. <th width="10%">Post status</th>
  54. <th width="10%">View post</th>
  55. <th width="10%">Edit post</th>
  56. <th width="10%">Delete post</th>
  57. <th width="3%" class="last center">ID</th>
  58. </tr>
  59. </thead>
  60. <tbody>
  61. <?php $i = 1; foreach ($posts as $post): ?>
  62. <?php if ($i % 2 != 0): $rowClass = 'odd'; else: $rowClass = 'even'; endif;?>
  63. <tr class="<?=$rowClass?>">
  64. <td class="center"><?=$i?></td>
  65. <td><?=$post['title']?></td>
  66. <td><?=$post['uri']?></td>
  67. <td><?=ucfirst($post['status'])?></td>
  68. <td><a href="<?=site_url('blog/'.date('Y/m', $post['date_posted']).'/'.$post['uri'])?>" rel="external">View</a></td>
  69. <td><a href="<?=site_url('admin/'.$module.'/edit/'.$post['id'])?>">Edit</a></td>
  70. <td><a href="<?=site_url('admin/'.$module.'/delete/'.$post['id'])?>">Delete</a></td>
  71. <td class="center"><?=$post['id']?></td>
  72. </tr>
  73. <?php $i++; endforeach;?>
  74. </tbody>
  75. </table>
  76. </div>