Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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