2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
/* SVN FILE: $Id$ */
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* PHP versions 4 and 5
|
|
|
|
*
|
2010-01-26 22:15:15 +00:00
|
|
|
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
|
2010-01-26 19:18:20 +00:00
|
|
|
* Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
2008-05-30 11:40:08 +00:00
|
|
|
*
|
|
|
|
* Licensed under The MIT License
|
|
|
|
* Redistributions of files must retain the above copyright notice.
|
|
|
|
*
|
2010-01-26 19:18:20 +00:00
|
|
|
* @copyright Copyright 2005-2010, Cake Software Foundation, Inc. (http://cakefoundation.org)
|
|
|
|
* @link http://cakephp.org CakePHP(tm) Project
|
2008-10-30 17:30:26 +00:00
|
|
|
* @package cake
|
|
|
|
* @subpackage cake.cake.console.libs.templates.views
|
|
|
|
* @since CakePHP(tm) v 0.10.0.1076
|
|
|
|
* @version $Revision$
|
|
|
|
* @modifiedby $LastChangedBy$
|
|
|
|
* @lastmodified $Date$
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.php The MIT License
|
2008-05-30 11:40:08 +00:00
|
|
|
*/
|
|
|
|
?>
|
|
|
|
<div class="<?php echo $pluralVar;?> index">
|
|
|
|
<h2><?php echo $pluralHumanName;?></h2>
|
|
|
|
<p><?php
|
|
|
|
echo $paginator->counter(array(
|
2008-11-08 02:54:07 +00:00
|
|
|
'format' => 'Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%'
|
2008-05-30 11:40:08 +00:00
|
|
|
));
|
|
|
|
?></p>
|
|
|
|
<table cellpadding="0" cellspacing="0">
|
|
|
|
<tr>
|
2008-06-10 02:12:32 +00:00
|
|
|
<?php foreach ($scaffoldFields as $_field):?>
|
|
|
|
<th><?php echo $paginator->sort($_field);?></th>
|
2008-05-30 11:40:08 +00:00
|
|
|
<?php endforeach;?>
|
|
|
|
<th><?php __('Actions');?></th>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
$i = 0;
|
|
|
|
foreach (${$pluralVar} as ${$singularVar}):
|
|
|
|
$class = null;
|
|
|
|
if ($i++ % 2 == 0) {
|
|
|
|
$class = ' class="altrow"';
|
|
|
|
}
|
|
|
|
echo "\n";
|
|
|
|
echo "\t<tr{$class}>\n";
|
2008-06-10 02:12:32 +00:00
|
|
|
foreach ($scaffoldFields as $_field) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$isKey = false;
|
2008-10-23 00:10:44 +00:00
|
|
|
if (!empty($associations['belongsTo'])) {
|
2008-06-10 02:12:32 +00:00
|
|
|
foreach ($associations['belongsTo'] as $_alias => $_details) {
|
2008-10-23 00:10:44 +00:00
|
|
|
if ($_field === $_details['foreignKey']) {
|
2008-05-30 11:40:08 +00:00
|
|
|
$isKey = true;
|
2009-05-07 00:53:44 +00:00
|
|
|
echo "\t\t<td>\n\t\t\t" . $html->link(${$singularVar}[$_alias][$_details['displayField']], array('controller' => $_details['controller'], 'action' => 'view', ${$singularVar}[$_alias][$_details['primaryKey']])) . "\n\t\t</td>\n";
|
2008-05-30 11:40:08 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-10-23 00:10:44 +00:00
|
|
|
if ($isKey !== true) {
|
2008-06-10 02:12:32 +00:00
|
|
|
echo "\t\t<td>\n\t\t\t" . ${$singularVar}[$modelClass][$_field] . " \n\t\t</td>\n";
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "\t\t<td class=\"actions\">\n";
|
2009-05-07 00:53:44 +00:00
|
|
|
echo "\t\t\t" . $html->link(__('View', true), array('action' => 'view', ${$singularVar}[$modelClass][$primaryKey])) . "\n";
|
|
|
|
echo "\t\t\t" . $html->link(__('Edit', true), array('action' => 'edit', ${$singularVar}[$modelClass][$primaryKey])) . "\n";
|
|
|
|
echo "\t\t\t" . $html->link(__('Delete', true), array('action' => 'delete', ${$singularVar}[$modelClass][$primaryKey]), null, __('Are you sure you want to delete', true).' #' . ${$singularVar}[$modelClass][$primaryKey]) . "\n";
|
2008-05-30 11:40:08 +00:00
|
|
|
echo "\t\t</td>\n";
|
|
|
|
echo "\t</tr>\n";
|
|
|
|
|
|
|
|
endforeach;
|
|
|
|
echo "\n";
|
|
|
|
?>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div class="paging">
|
2009-05-07 00:53:44 +00:00
|
|
|
<?php echo "\t" . $paginator->prev('<< ' . __('previous', true), array(), null, array('class' => 'disabled')) . "\n";?>
|
2008-05-30 11:40:08 +00:00
|
|
|
| <?php echo $paginator->numbers() . "\n"?>
|
2009-05-07 00:53:44 +00:00
|
|
|
<?php echo "\t ". $paginator->next(__('next', true) .' >>', array(), null, array('class' => 'disabled')) . "\n";?>
|
2008-05-30 11:40:08 +00:00
|
|
|
</div>
|
|
|
|
<div class="actions">
|
|
|
|
<ul>
|
2009-05-07 00:53:44 +00:00
|
|
|
<li><?php echo $html->link('New '.$singularHumanName, array('action' => 'add')); ?></li>
|
2008-05-30 11:40:08 +00:00
|
|
|
<?php
|
|
|
|
$done = array();
|
2008-06-10 02:12:32 +00:00
|
|
|
foreach ($associations as $_type => $_data) {
|
2008-10-23 00:10:44 +00:00
|
|
|
foreach ($_data as $_alias => $_details) {
|
2008-06-10 02:12:32 +00:00
|
|
|
if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) {
|
2009-07-28 20:01:42 +00:00
|
|
|
echo "\t\t<li>" . $html->link(sprintf(__('List %s', true), Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "</li>\n";
|
|
|
|
echo "\t\t<li>" . $html->link(sprintf(__('New %s', true), Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "</li>\n";
|
2008-06-10 02:12:32 +00:00
|
|
|
$done[] = $_details['controller'];
|
2008-05-30 11:40:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</ul>
|
|
|
|
</div>
|