Skip to content
Browse files

Removing 'altclass' from scaffold templates.

Refs #306
  • Loading branch information...
1 parent 67592f9 commit 1f2fef5f0c227e41eb8eca2351f35ae41f46cf0d @markstory markstory committed Jun 22, 2011
Showing with 10 additions and 26 deletions.
  1. +2 −6 Cake/View/Scaffolds/index.ctp
  2. +8 −20 Cake/View/Scaffolds/view.ctp
View
8 Cake/View/Scaffolds/index.ctp
@@ -28,11 +28,7 @@
<?php
$i = 0;
foreach (${$pluralVar} as ${$singularVar}):
- $class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
- echo "<tr{$class}>";
+ echo "<tr>";
foreach ($scaffoldFields as $_field) {
$isKey = false;
if (!empty($associations['belongsTo'])) {
@@ -93,4 +89,4 @@ endforeach;
}
?>
</ul>
-</div>
+</div>
View
28 Cake/View/Scaffolds/view.ctp
@@ -22,24 +22,20 @@
<?php
$i = 0;
foreach ($scaffoldFields as $_field) {
- $class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
$isKey = false;
if (!empty($associations['belongsTo'])) {
foreach ($associations['belongsTo'] as $_alias => $_details) {
if ($_field === $_details['foreignKey']) {
$isKey = true;
- echo "\t\t<dt{$class}>" . Inflector::humanize($_alias) . "</dt>\n";
- echo "\t\t<dd{$class}>\n\t\t\t" . $this->Html->link(${$singularVar}[$_alias][$_details['displayField']], array('controller' => $_details['controller'], 'action' => 'view', ${$singularVar}[$_alias][$_details['primaryKey']])) . "\n\t\t&nbsp;</dd>\n";
+ echo "\t\t<dt>" . Inflector::humanize($_alias) . "</dt>\n";
+ echo "\t\t<dd>\n\t\t\t" . $this->Html->link(${$singularVar}[$_alias][$_details['displayField']], array('controller' => $_details['controller'], 'action' => 'view', ${$singularVar}[$_alias][$_details['primaryKey']])) . "\n\t\t&nbsp;</dd>\n";
break;
}
}
}
if ($isKey !== true) {
- echo "\t\t<dt{$class}>" . Inflector::humanize($_field) . "</dt>\n";
- echo "\t\t<dd{$class}>" . h(${$singularVar}[$modelClass][$_field]) . "&nbsp;</dd>\n";
+ echo "\t\t<dt>" . Inflector::humanize($_field) . "</dt>\n";
+ echo "\t\t<dd>" . h(${$singularVar}[$modelClass][$_field]) . "&nbsp;</dd>\n";
}
}
?>
@@ -78,12 +74,8 @@ foreach ($associations['hasOne'] as $_alias => $_details): ?>
$i = 0;
$otherFields = array_keys(${$singularVar}[$_alias]);
foreach ($otherFields as $_field) {
- $class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
- echo "\t\t<dt{$class}>" . Inflector::humanize($_field) . "</dt>\n";
- echo "\t\t<dd{$class}>\n\t" . ${$singularVar}[$_alias][$_field] . "\n&nbsp;</dd>\n";
+ echo "\t\t<dt>" . Inflector::humanize($_field) . "</dt>\n";
+ echo "\t\t<dd>\n\t" . ${$singularVar}[$_alias][$_field] . "\n&nbsp;</dd>\n";
}
?>
</dl>
@@ -129,11 +121,7 @@ $otherSingularVar = Inflector::variable($_alias);
<?php
$i = 0;
foreach (${$singularVar}[$_alias] as ${$otherSingularVar}):
- $class = null;
- if ($i++ % 2 == 0) {
- $class = ' class="altrow"';
- }
- echo "\t\t<tr{$class}>\n";
+ echo "\t\t<tr>\n";
foreach ($otherFields as $_field) {
echo "\t\t\t<td>" . ${$otherSingularVar}[$_field] . "</td>\n";
@@ -155,4 +143,4 @@ $otherSingularVar = Inflector::variable($_alias);
</ul>
</div>
</div>
-<?php endforeach;?>
+<?php endforeach;?>

0 comments on commit 1f2fef5

Please sign in to comment.
Something went wrong with that request. Please try again.