pictcode / lib / Cake / Console / Templates / default / views / index.ctp @ 635eef61
履歴 | 表示 | アノテート | ダウンロード (3.92 KB)
| 1 |
<?php |
|---|---|
| 2 |
/** |
| 3 |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) |
| 4 |
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
| 5 |
* |
| 6 |
* Licensed under The MIT License |
| 7 |
* For full copyright and license information, please see the LICENSE.txt |
| 8 |
* Redistributions of files must retain the above copyright notice. |
| 9 |
* |
| 10 |
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) |
| 11 |
* @link http://cakephp.org CakePHP(tm) Project |
| 12 |
* @package Cake.Console.Templates.default.views |
| 13 |
* @since CakePHP(tm) v 1.2.0.5234 |
| 14 |
* @license http://www.opensource.org/licenses/mit-license.php MIT License |
| 15 |
*/ |
| 16 |
?> |
| 17 |
<div class="<?php echo $pluralVar; ?> index"> |
| 18 |
<h2><?php echo "<?php echo __('{$pluralHumanName}'); ?>"; ?></h2>
|
| 19 |
<table cellpadding="0" cellspacing="0"> |
| 20 |
<thead> |
| 21 |
<tr> |
| 22 |
<?php foreach ($fields as $field): ?> |
| 23 |
<th><?php echo "<?php echo \$this->Paginator->sort('{$field}'); ?>"; ?></th>
|
| 24 |
<?php endforeach; ?> |
| 25 |
<th class="actions"><?php echo "<?php echo __('Actions'); ?>"; ?></th>
|
| 26 |
</tr> |
| 27 |
</thead> |
| 28 |
<tbody> |
| 29 |
<?php |
| 30 |
echo "<?php foreach (\${$pluralVar} as \${$singularVar}): ?>\n";
|
| 31 |
echo "\t<tr>\n"; |
| 32 |
foreach ($fields as $field) {
|
| 33 |
$isKey = false; |
| 34 |
if (!empty($associations['belongsTo'])) {
|
| 35 |
foreach ($associations['belongsTo'] as $alias => $details) {
|
| 36 |
if ($field === $details['foreignKey']) {
|
| 37 |
$isKey = true; |
| 38 |
echo "\t\t<td>\n\t\t\t<?php echo \$this->Html->link(\${$singularVar}['{$alias}']['{$details['displayField']}'], array('controller' => '{$details['controller']}', 'action' => 'view', \${$singularVar}['{$alias}']['{$details['primaryKey']}'])); ?>\n\t\t</td>\n";
|
| 39 |
break; |
| 40 |
} |
| 41 |
} |
| 42 |
} |
| 43 |
if ($isKey !== true) {
|
| 44 |
echo "\t\t<td><?php echo h(\${$singularVar}['{$modelClass}']['{$field}']); ?> </td>\n";
|
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
echo "\t\t<td class=\"actions\">\n"; |
| 49 |
echo "\t\t\t<?php echo \$this->Html->link(__('View'), array('action' => 'view', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
|
| 50 |
echo "\t\t\t<?php echo \$this->Html->link(__('Edit'), array('action' => 'edit', \${$singularVar}['{$modelClass}']['{$primaryKey}'])); ?>\n";
|
| 51 |
echo "\t\t\t<?php echo \$this->Form->postLink(__('Delete'), array('action' => 'delete', \${$singularVar}['{$modelClass}']['{$primaryKey}']), array('confirm' => __('Are you sure you want to delete # %s?', \${$singularVar}['{$modelClass}']['{$primaryKey}']))); ?>\n";
|
| 52 |
echo "\t\t</td>\n"; |
| 53 |
echo "\t</tr>\n"; |
| 54 |
|
| 55 |
echo "<?php endforeach; ?>\n"; |
| 56 |
?> |
| 57 |
</tbody> |
| 58 |
</table> |
| 59 |
<p> |
| 60 |
<?php echo "<?php |
| 61 |
echo \$this->Paginator->counter(array( |
| 62 |
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
|
| 63 |
)); |
| 64 |
?>"; ?> |
| 65 |
</p> |
| 66 |
<div class="paging"> |
| 67 |
<?php |
| 68 |
echo "<?php\n"; |
| 69 |
echo "\t\techo \$this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));\n";
|
| 70 |
echo "\t\techo \$this->Paginator->numbers(array('separator' => ''));\n";
|
| 71 |
echo "\t\techo \$this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));\n";
|
| 72 |
echo "\t?>\n"; |
| 73 |
?> |
| 74 |
</div> |
| 75 |
</div> |
| 76 |
<div class="actions"> |
| 77 |
<h3><?php echo "<?php echo __('Actions'); ?>"; ?></h3>
|
| 78 |
<ul> |
| 79 |
<li><?php echo "<?php echo \$this->Html->link(__('New " . $singularHumanName . "'), array('action' => 'add')); ?>"; ?></li>
|
| 80 |
<?php |
| 81 |
$done = array(); |
| 82 |
foreach ($associations as $type => $data) {
|
| 83 |
foreach ($data as $alias => $details) {
|
| 84 |
if ($details['controller'] != $this->name && !in_array($details['controller'], $done)) {
|
| 85 |
echo "\t\t<li><?php echo \$this->Html->link(__('List " . Inflector::humanize($details['controller']) . "'), array('controller' => '{$details['controller']}', 'action' => 'index')); ?> </li>\n";
|
| 86 |
echo "\t\t<li><?php echo \$this->Html->link(__('New " . Inflector::humanize(Inflector::underscore($alias)) . "'), array('controller' => '{$details['controller']}', 'action' => 'add')); ?> </li>\n";
|
| 87 |
$done[] = $details['controller']; |
| 88 |
} |
| 89 |
} |
| 90 |
} |
| 91 |
?> |
| 92 |
</ul> |
| 93 |
</div> |