/
admin_index.ctp
95 lines (93 loc) · 3.87 KB
/
admin_index.ctp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
/**
* Blog Comments admin index
*
* this is the page for admins to view all the posts on the site.
*
* Copyright (c) 2009 Carl Sutton ( dogmatic69 )
*
* Licensed under The MIT License
* Redistributions of files must retain the above copyright notice.
*
* @filesource
* @copyright Copyright (c) 2009 Carl Sutton ( dogmatic69 )
* @link http://www.dogmatic.co.za
* @package blog
* @subpackage blog.views.posts.admin_index
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
*/
echo $this->Form->create( 'Post', array( 'url' => array( 'controller' => 'posts', 'action' => 'mass', 'admin' => 'true' ) ) );
echo $this->Blog->adminIndexHead( $this, $paginator, $filterOptions );
?>
<div class="table">
<?php echo $this->Blog->adminTableHeadImages(); ?>
<table class="listing" cellpadding="0" cellspacing="0">
<?php
echo $this->Blog->adminTableHeader(
array(
$this->Form->checkbox( 'all' ) => array(
'class' => 'first',
'style' => 'width:25px;'
),
$paginator->sort( 'title' ) => array(
'style' => 'width:150px;'
),
__( 'Introduction', true ),
__( 'Tags', true ),
$paginator->sort( 'Comments','comment_count' ) => array(
'style' => 'width:50px;'
),
$paginator->sort( 'views' ) => array(
'style' => 'width:50px;'
),
__( 'Status', true ) => array(
'class' => 'actions'
),
__( 'Actions', true ) => array(
'class' => 'last actions'
)
)
);
$i = 0;
foreach( $posts as $post )
{
?>
<tr class="<?php echo $this->Blog->rowClass( $i ); ?>">
<td><?php echo $this->Form->checkbox( $post['Post']['id'] ); ?> </td>
<td title="<?php echo $post['Post']['slug']; ?>">
<?php $this->Html->link( $post['Post']['title'], array( 'action' => 'edit', $post['Post']['id'] ) ); ?>
</td>
<td><?php echo strip_tags( $post['Post']['intro'] ); ?> </td>
<td><?php echo implode( ', ', Set::extract( '/Tag/name', $post ) ); ?> </td>
<td><?php echo $post['Post']['comment_count']; ?> </td>
<td><?php echo $post['Post']['views']; ?> </td>
<td>
<?php
echo $this->Status->toggle( $post['Post']['active'], $post['Post']['id'] ),
$this->Status->locked( $post, 'Post' );
?>
</td>
<td>
<?php
echo $this->Html->link( 'preview', array( 'action' => 'view', $post['Post']['id'], 'admin' => false ), array( 'target' => '_blank' ) ), ' ',
$this->Html->link( 'edit', array( 'action' => 'edit', $post['Post']['id'] ) );
?>
</td>
</tr>
<?
$i++;
}
?>
</table>
<?php
echo $this->Blog->massActionButtons(
array(
'toggle',
'copy',
'delete'
)
);
echo $this->Form->end();
?>
</div>
<?php echo $this->element( 'pagination/navigation' ); ?>