Skip to content
This repository was archived by the owner on Jan 3, 2024. It is now read-only.

Commit 9dd9148

Browse files
author
David Yell
committed
Fixed a missing tab and new line.
Also formatted the code a little better.
1 parent feac2d6 commit 9dd9148

File tree

1 file changed

+42
-40
lines changed

1 file changed

+42
-40
lines changed
Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
<div class="<?php echo $pluralVar; ?> index">
2-
<h2><?php echo "<?php echo __('{$pluralHumanName}'); ?>"; ?></h2>
3-
<?php echo "<?php echo \$this->Html->link('New', array('action'=>'add'), array('title'=>'Add new','class'=>'btn add-button'));?>\n";?>
2+
<h2><?php echo "<?php echo __('{$pluralHumanName}'); ?>"; ?></h2>
3+
<?php echo "<?php echo \$this->Html->link('New', array('action'=>'add'), array('title'=>'Add new','class'=>'btn add-button'));?>\n"; ?>
44

5-
<?php echo "<?php echo \$this->Form->postLink(\"Purge (\$purgeable)\", array('action'=>'purge'), array('class' => 'btn btn-small btn-danger purge-button'), 'Are you sure you want to purge? This will remove records permanently!');?>\n";?>
6-
<?php echo "<?php echo \$this->Html->link(\"Deleted (\$deleted)\", array('action'=>'deleted'), array('title'=>\"Deleted (\$deleted)\", 'class' => 'btn btn-small btn-primary deleted-button'));?>\n";?>
5+
<?php echo "<?php echo \$this->Form->postLink(\"Purge (\$purgeable)\", array('action'=>'purge'), array('class' => 'btn btn-small btn-danger purge-button'), 'Are you sure you want to purge? This will remove records permanently!');?>\n"; ?>
6+
<?php echo "<?php echo \$this->Html->link(\"Deleted (\$deleted)\", array('action'=>'deleted'), array('title'=>\"Deleted (\$deleted)\", 'class' => 'btn btn-small btn-primary deleted-button'));?>\n"; ?>
77

8-
<table cellpadding="0" cellspacing="0" class="table table-bordered table-striped">
9-
<tr>
10-
<?php foreach ($fields as $field):
11-
if (!in_array($field, array('created', 'deleted', 'deleted_date'))) {
12-
?>
13-
<th><?php echo "<?php echo \$this->Paginator->sort('{$field}'); ?>"; ?></th>
8+
<table cellpadding="0" cellspacing="0" class="table table-bordered table-striped">
9+
<tr>
1410
<?php
15-
}
16-
endforeach; ?>
17-
<th class="actions"><?php echo "<?php echo __('Actions'); ?>"; ?></th>
18-
</tr>
19-
<?php
20-
echo "<?php foreach (\${$pluralVar} as \${$singularVar}): ?>\n";
21-
echo "\t<tr>\n";
22-
foreach ($fields as $field) {
23-
if (!in_array($field, array('created', 'deleted', 'deleted_date'))){
11+
foreach ($fields as $field):
12+
if (!in_array($field, array('created', 'deleted', 'deleted_date'))) {
13+
?>
14+
<th><?php echo "<?php echo \$this->Paginator->sort('{$field}'); ?>"; ?></th>
15+
<?php
16+
}
17+
endforeach;
18+
?>
19+
<th class="actions"><?php echo "<?php echo __('Actions'); ?>"; ?></th>
20+
</tr>
21+
<?php
22+
echo "<?php foreach (\${$pluralVar} as \${$singularVar}): ?>\n";
23+
echo "\t<tr>\n";
24+
foreach ($fields as $field) {
25+
if (!in_array($field, array('created', 'deleted', 'deleted_date'))) {
2426
$isKey = false;
2527
if (!empty($associations['belongsTo'])) {
2628
foreach ($associations['belongsTo'] as $alias => $details) {
2729
if ($field === $details['foreignKey']) {
2830
$isKey = true;
2931
if ($field == 'status_id') {
30-
echo "\t\t<td><?php echo \$this->StatusLights->status(\${$singularVar}['{$alias}']['{$details['primaryKey']}']);?></td>";
32+
echo "\t\t<td><?php echo \$this->StatusLights->status(\${$singularVar}['{$alias}']['{$details['primaryKey']}']);?></td>\n";
3133
} else {
3234
echo "\t\t<td>\n\t\t\t<?php echo \$this->Html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'edit', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t</td>\n";
3335
}
@@ -41,30 +43,30 @@
4143
echo "\t\t<td><?php echo h(\${$singularVar}['{$modelClass}']['{$field}']); ?>&nbsp;</td>\n";
4244
}
4345
}
44-
}
46+
}
4547

46-
echo "\t\t<td class=\"actions\">\n";
47-
echo "<?php echo \$this->Actions->actions(\${$singularVar}['{$modelClass}']['{$primaryKey}'], array('e','d'));?>\n";
48-
echo "\t\t</td>\n";
49-
echo "\t</tr>\n";
48+
echo "\t\t<td class=\"actions\">\n";
49+
echo "\t\t\t<?php echo \$this->Actions->actions(\${$singularVar}['{$modelClass}']['{$primaryKey}'], array('e','d'));?>\n";
50+
echo "\t\t</td>\n";
51+
echo "\t</tr>\n";
5052

51-
echo "<?php endforeach; ?>\n";
52-
?>
53-
</table>
54-
<p>
55-
<?php echo "<?php
53+
echo "<?php endforeach; ?>\n";
54+
?>
55+
</table>
56+
<p>
57+
<?php echo "<?php
5658
echo \$this->Paginator->counter(array(
5759
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
5860
));
5961
?>"; ?>
60-
</p>
61-
<div class="paging">
62-
<?php
63-
echo "<?php\n";
64-
echo "\t\techo \$this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));\n";
65-
echo "\t\techo \$this->Paginator->numbers(array('separator' => ''));\n";
66-
echo "\t\techo \$this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));\n";
67-
echo "\t?>\n";
68-
?>
69-
</div>
62+
</p>
63+
<div class="paging">
64+
<?php
65+
echo "<?php\n";
66+
echo "\t\techo \$this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));\n";
67+
echo "\t\techo \$this->Paginator->numbers(array('separator' => ''));\n";
68+
echo "\t\techo \$this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));\n";
69+
echo "\t?>\n";
70+
?>
71+
</div>
7072
</div>

0 commit comments

Comments
 (0)