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

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 53 lines · 44 code · 9 blank · 0 comment · 6 complexity · d238b30d31266a8a9a2a75eb6640c027 MD5 · raw file

  1. <h1 class="headingleft">Blog Posts</h1>
  2. <div class="headingright">
  3. <?php if (in_array('blog_edit', $this->permission->permissions)): ?>
  4. <a href="/admin/blog/add_post" class="button">Add Post</a>
  5. <?php endif; ?>
  6. </div>
  7. <?php if ($blog_posts): ?>
  8. <?php echo $this->pagination->create_links(); ?>
  9. <table class="default clear">
  10. <tr>
  11. <th><?php echo order_link('/admin/blog/viewall','posttitle','Post'); ?></th>
  12. <th><?php echo order_link('/admin/blog/viewall','datecreated','Date'); ?></th>
  13. <th class="narrow"><?php echo order_link('/admin/blog/viewall','published','Published'); ?></th>
  14. <th class="tiny">&nbsp;</th>
  15. <th class="tiny">&nbsp;</th>
  16. </tr>
  17. <?php foreach ($blog_posts as $post): ?>
  18. <tr class="<?php echo (!$post['published']) ? 'draft' : ''; ?>">
  19. <td><?php echo (in_array('blog_edit', $this->permission->permissions)) ? anchor('/admin/blog/edit_post/'.$post['postID'], $post['postTitle']) : $post['postTitle']; ?></td>
  20. <td><?php echo dateFmt($post['dateCreated'], '', '', TRUE); ?></td>
  21. <td>
  22. <?php
  23. if ($post['published']) echo '<span style="color:green;">Yes</span>';
  24. else echo 'No';
  25. ?>
  26. </td>
  27. <td class="tiny">
  28. <?php if (in_array('blog_edit', $this->permission->permissions)): ?>
  29. <?php echo anchor('/admin/blog/edit_post/'.$post['postID'], 'Edit'); ?>
  30. <?php endif; ?>
  31. </td>
  32. <td class="tiny">
  33. <?php if (in_array('blog_delete', $this->permission->permissions)): ?>
  34. <?php echo anchor('/admin/blog/delete_post/'.$post['postID'], 'Delete', 'onclick="return confirm(\'Are you sure you want to delete this?\')"'); ?>
  35. <?php endif; ?>
  36. </td>
  37. </tr>
  38. <?php endforeach; ?>
  39. </table>
  40. <?php echo $this->pagination->create_links(); ?>
  41. <p style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
  42. <?php else: ?>
  43. <p class="clear">There are no blog posts yet.</p>
  44. <?php endif; ?>