Skip to content
Permalink
Browse files

Array coding convention and extraneous punctuation

Signed-off-by: Mark Story <mark@mark-story.com>
  • Loading branch information...
petteyg authored and markstory committed Oct 30, 2009
1 parent 17edec8 commit 2e3bbe363dde2bfab61f783d4adea78d839e618c
Showing with 13 additions and 13 deletions.
  1. +13 −13 cake/console/libs/tasks/controller.php
@@ -267,10 +267,10 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$actions .= "\tfunction {$admin}view(\$id = null) {\n";
$actions .= "\t\tif (!\$id) {\n";
if ($wannaUseSession) {
$actions .= "\t\t\t\$this->Session->setFlash(__('Invalid {$singularHumanName}.', true));\n";
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n";
$actions .= "\t\t\t\$this->Session->setFlash(__('Invalid {$singularHumanName}', true));\n";
$actions .= "\t\t\t\$this->redirect(array('action' => 'index'));\n";
} else {
$actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n";
$actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action' => 'index'));\n";
}
$actions .= "\t\t}\n";
$actions .= "\t\t\$this->set('" . $singularName . "', \$this->{$currentModelName}->read(null, \$id));\n";
@@ -285,9 +285,9 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
if ($wannaUseSession) {
$actions .= "\t\t\t\t\$this->Session->setFlash(__('The " . $singularHumanName . " has been saved', true));\n";
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n";
$actions .= "\t\t\t\t\$this->redirect(array('action' => 'index'));\n";
} else {
$actions .= "\t\t\t\t\$this->flash(__('{$currentModelName} saved.', true), array('action'=>'index'));\n";
$actions .= "\t\t\t\t\$this->flash(__('{$currentModelName} saved.', true), array('action' => 'index'));\n";
}
$actions .= "\t\t\t} else {\n";
if ($wannaUseSession) {
@@ -324,18 +324,18 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$actions .= "\t\tif (!\$id && empty(\$this->data)) {\n";
if ($wannaUseSession) {
$actions .= "\t\t\t\$this->Session->setFlash(__('Invalid {$singularHumanName}', true));\n";
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n";
$actions .= "\t\t\t\$this->redirect(array('action' => 'index'));\n";
} else {
$actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n";
$actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action' => 'index'));\n";
}
$actions .= "\t\t}\n";
$actions .= "\t\tif (!empty(\$this->data)) {\n";
$actions .= "\t\t\tif (\$this->{$currentModelName}->save(\$this->data)) {\n";
if ($wannaUseSession) {
$actions .= "\t\t\t\t\$this->Session->setFlash(__('The " . $singularHumanName . " has been saved', true));\n";
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'));\n";
$actions .= "\t\t\t\t\$this->redirect(array('action' => 'index'));\n";
} else {
$actions .= "\t\t\t\t\$this->flash(__('The " . $singularHumanName . " has been saved.', true), array('action'=>'index'));\n";
$actions .= "\t\t\t\t\$this->flash(__('The " . $singularHumanName . " has been saved.', true), array('action' => 'index'));\n";
}
$actions .= "\t\t\t} else {\n";
if ($wannaUseSession) {
@@ -373,17 +373,17 @@ function bakeActions($controllerName, $admin = null, $wannaUseSession = true) {
$actions .= "\t\tif (!\$id) {\n";
if ($wannaUseSession) {
$actions .= "\t\t\t\$this->Session->setFlash(__('Invalid id for {$singularHumanName}', true));\n";
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n";
$actions .= "\t\t\t\$this->redirect(array('action' => 'index'));\n";
} else {
$actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action'=>'index'));\n";
$actions .= "\t\t\t\$this->flash(__('Invalid {$singularHumanName}', true), array('action' => 'index'));\n";
}
$actions .= "\t\t}\n";
$actions .= "\t\tif (\$this->{$currentModelName}->del(\$id)) {\n";
if ($wannaUseSession) {
$actions .= "\t\t\t\$this->Session->setFlash(__('{$singularHumanName} deleted', true));\n";
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'));\n";
$actions .= "\t\t\t\$this->redirect(array('action' => 'index'));\n";
} else {
$actions .= "\t\t\t\$this->flash(__('{$singularHumanName} deleted', true), array('action'=>'index'));\n";
$actions .= "\t\t\t\$this->flash(__('{$singularHumanName} deleted', true), array('action' => 'index'));\n";
}
$actions .= "\t\t}\n";
$actions .= "\t}\n";

0 comments on commit 2e3bbe3

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.