/
index.ctp
124 lines (124 loc) · 4.56 KB
/
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
/**
* Comment Template.
*
* @todo -c Implement .this needs to be sorted out.
*
* 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 sort
* @subpackage sort.comments
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
* @since 0.5a
*/
?>
<div class="contents index">
<h2><?php __('Contents');?></h2>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
));
?></p>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id');?></th>
<th><?php echo $this->Paginator->sort('title');?></th>
<th><?php echo $this->Paginator->sort('introduction');?></th>
<th><?php echo $this->Paginator->sort('body');?></th>
<th><?php echo $this->Paginator->sort('locked');?></th>
<th><?php echo $this->Paginator->sort('locked_since');?></th>
<th><?php echo $this->Paginator->sort('locked_by');?></th>
<th><?php echo $this->Paginator->sort('ordering');?></th>
<th><?php echo $this->Paginator->sort('group_id');?></th>
<th><?php echo $this->Paginator->sort('views');?></th>
<th><?php echo $this->Paginator->sort('created');?></th>
<th><?php echo $this->Paginator->sort('modified');?></th>
<th><?php echo $this->Paginator->sort('created_by');?></th>
<th><?php echo $this->Paginator->sort('modified_by');?></th>
<th><?php echo $this->Paginator->sort('category_id');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($contents as $content):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td>
<?php echo $content['Content']['id']; ?>
</td>
<td>
<?php echo $content['Content']['title']; ?>
</td>
<td>
<?php echo $content['Content']['introduction']; ?>
</td>
<td>
<?php echo $content['Content']['body']; ?>
</td>
<td>
<?php echo $content['Content']['locked']; ?>
</td>
<td>
<?php echo $content['Content']['locked_since']; ?>
</td>
<td>
<?php echo $content['Content']['locked_by']; ?>
</td>
<td>
<?php echo $content['Content']['ordering']; ?>
</td>
<td>
<?php echo $content['Content']['group_id']; ?>
</td>
<td>
<?php echo $content['Content']['views']; ?>
</td>
<td>
<?php echo $content['Content']['created']; ?>
</td>
<td>
<?php echo $content['Content']['modified']; ?>
</td>
<td>
<?php echo $content['Content']['created_by']; ?>
</td>
<td>
<?php echo $content['Content']['modified_by']; ?>
</td>
<td>
<?php echo $this->Html->link($content['Category']['title'], array('controller' => 'categories', 'action' => 'view', $content['Category']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View', true), array('action' => 'view', $content['Content']['id'])); ?>
<?php echo $this->Html->link(__('Edit', true), array('action' => 'edit', $content['Content']['id'])); ?>
<?php echo $this->Html->link(__('Delete', true), array('action' => 'delete', $content['Content']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $content['Content']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php echo $this->Paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
| <?php echo $this->Paginator->numbers();?>
<?php echo $this->Paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
</div>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Content', true)), array('action' => 'add')); ?></li>
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Categories', true)), array('controller' => 'categories', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Category', true)), array('controller' => 'categories', 'action' => 'add')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('List %s', true), __('Content Frontpages', true)), array('controller' => 'content_frontpages', 'action' => 'index')); ?> </li>
<li><?php echo $this->Html->link(sprintf(__('New %s', true), __('Content Frontpage', true)), array('controller' => 'content_frontpages', 'action' => 'add')); ?> </li>
</ul>
</div>