PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

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