mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
bake, redirect links
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4252 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
e4b66db20e
commit
6f864c367d
1 changed files with 17 additions and 17 deletions
|
@ -1420,10 +1420,10 @@ class Bake {
|
||||||
$actions .= "\tfunction {$admin}view(\$id = null) {\n";
|
$actions .= "\tfunction {$admin}view(\$id = null) {\n";
|
||||||
$actions .= "\t\tif(!\$id) {\n";
|
$actions .= "\t\tif(!\$id) {\n";
|
||||||
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
||||||
$actions .= "\t\t\t\$this->Session->setFlash('Invalid id for {$singularHumanName}.');\n";
|
$actions .= "\t\t\t\$this->Session->setFlash('Invalid {$singularHumanName}.');\n";
|
||||||
$actions .= "\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index', null, true);\n";
|
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
|
||||||
} else {
|
} else {
|
||||||
$actions .= "\t\t\t\$this->flash('Invalid id for {$singularHumanName}', '{$admin_url}/{$controllerPath}/index');\n";
|
$actions .= "\t\t\t\$this->flash('Invalid {$singularHumanName}', array('action'=>'index'));\n";
|
||||||
}
|
}
|
||||||
$actions .= "\t\t}\n";
|
$actions .= "\t\t}\n";
|
||||||
$actions .= "\t\t\$this->set('".$singularName."', \$this->{$currentModelName}->read(null, \$id));\n";
|
$actions .= "\t\t\$this->set('".$singularName."', \$this->{$currentModelName}->read(null, \$id));\n";
|
||||||
|
@ -1438,11 +1438,11 @@ class Bake {
|
||||||
$actions .= "\t\t\t\$this->{$currentModelName}->create();\n";
|
$actions .= "\t\t\t\$this->{$currentModelName}->create();\n";
|
||||||
$actions .= "\t\t\tif(\$this->{$currentModelName}->save(\$this->data)) {\n";
|
$actions .= "\t\t\tif(\$this->{$currentModelName}->save(\$this->data)) {\n";
|
||||||
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
||||||
$actions .= "\t\t\t\t\$this->Session->setFlash('The ".$this->__singularHumanName($currentModelName)." has been saved');\n";
|
$actions .= "\t\t\t\t\$this->Session->setFlash('The ".$singularHumanName." has been saved');\n";
|
||||||
$actions .= "\t\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index', null, true);\n";
|
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
|
||||||
$actions .= "\t\t\t\texit();\n";
|
$actions .= "\t\t\t\texit();\n";
|
||||||
} else {
|
} else {
|
||||||
$actions .= "\t\t\t\t\$this->flash('{$currentModelName} saved.', '{$admin_url}/{$controllerPath}/index');\n";
|
$actions .= "\t\t\t\t\$this->flash('{$currentModelName} saved.', array('action'=>'index'));\n";
|
||||||
$actions .= "\t\t\t\texit();\n";
|
$actions .= "\t\t\t\texit();\n";
|
||||||
}
|
}
|
||||||
$actions .= "\t\t\t} else {\n";
|
$actions .= "\t\t\t} else {\n";
|
||||||
|
@ -1479,10 +1479,10 @@ class Bake {
|
||||||
$actions .= "\tfunction {$admin}edit(\$id = null) {\n";
|
$actions .= "\tfunction {$admin}edit(\$id = null) {\n";
|
||||||
$actions .= "\t\tif(!\$id && empty(\$this->data)) {\n";
|
$actions .= "\t\tif(!\$id && empty(\$this->data)) {\n";
|
||||||
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
||||||
$actions .= "\t\t\t\$this->Session->setFlash('Invalid id for {$singularHumanName}');\n";
|
$actions .= "\t\t\t\$this->Session->setFlash('Invalid {$singularHumanName}');\n";
|
||||||
$actions .= "\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index', null, true);\n";
|
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
|
||||||
} else {
|
} else {
|
||||||
$actions .= "\t\t\t\$this->flash('Invalid id for {$singularHumanName}', '{$admin_url}/{$controllerPath}/index');\n";
|
$actions .= "\t\t\t\$this->flash('Invalid {$singularHumanName}', array('action'=>'index'));\n";
|
||||||
}
|
}
|
||||||
$actions .= "\t\t\texit();\n";
|
$actions .= "\t\t\texit();\n";
|
||||||
$actions .= "\t\t}\n";
|
$actions .= "\t\t}\n";
|
||||||
|
@ -1490,10 +1490,10 @@ class Bake {
|
||||||
$actions .= "\t\t\t\$this->cleanUpFields();\n";
|
$actions .= "\t\t\t\$this->cleanUpFields();\n";
|
||||||
$actions .= "\t\t\tif(\$this->{$currentModelName}->save(\$this->data)) {\n";
|
$actions .= "\t\t\tif(\$this->{$currentModelName}->save(\$this->data)) {\n";
|
||||||
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
||||||
$actions .= "\t\t\t\t\$this->Session->setFlash('The ".$this->__singularHumanName($currentModelName)." has been saved');\n";
|
$actions .= "\t\t\t\t\$this->Session->setFlash('The ".$singularHumanName." saved');\n";
|
||||||
$actions .= "\t\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index', null, true);\n";
|
$actions .= "\t\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
|
||||||
} else {
|
} else {
|
||||||
$actions .= "\t\t\t\t\$this->flash('{$currentModelName} saved.', '{$admin_url}/{$controllerPath}/index');\n";
|
$actions .= "\t\t\t\t\$this->flash('The ".$singularHumanName." saved.', array('action'=>'index'));\n";
|
||||||
}
|
}
|
||||||
$actions .= "\t\t\t\texit();\n";
|
$actions .= "\t\t\t\texit();\n";
|
||||||
$actions .= "\t\t\t} else {\n";
|
$actions .= "\t\t\t} else {\n";
|
||||||
|
@ -1532,17 +1532,17 @@ class Bake {
|
||||||
$actions .= "\t\tif(!\$id) {\n";
|
$actions .= "\t\tif(!\$id) {\n";
|
||||||
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
||||||
$actions .= "\t\t\t\$this->Session->setFlash('Invalid id for {$singularHumanName}');\n";
|
$actions .= "\t\t\t\$this->Session->setFlash('Invalid id for {$singularHumanName}');\n";
|
||||||
$actions .= "\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index', null, true);\n";
|
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
|
||||||
} else {
|
} else {
|
||||||
$actions .= "\t\t\t\$this->flash('Invalid id for {$singularHumanName}', '{$admin_url}/{$controllerPath}/index');\n";
|
$actions .= "\t\t\t\$this->flash('Invalid {$singularHumanName}', array('action'=>'index'));\n";
|
||||||
}
|
}
|
||||||
$actions .= "\t\t}\n";
|
$actions .= "\t\t}\n";
|
||||||
$actions .= "\t\tif(\$this->{$currentModelName}->del(\$id)) {\n";
|
$actions .= "\t\tif(\$this->{$currentModelName}->del(\$id)) {\n";
|
||||||
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
if (low($wannaUseSession) == 'y' || low($wannaUseSession) == 'yes') {
|
||||||
$actions .= "\t\t\t\$this->Session->setFlash('The ".$this->__singularHumanName($currentModelName)." deleted: id '.\$id.'');\n";
|
$actions .= "\t\t\t\$this->Session->setFlash('".$singularHumanName." #'.\$id.' deleted');\n";
|
||||||
$actions .= "\t\t\t\$this->redirect('{$admin_url}/{$controllerPath}/index', null, true);\n";
|
$actions .= "\t\t\t\$this->redirect(array('action'=>'index'), null, true);\n";
|
||||||
} else {
|
} else {
|
||||||
$actions .= "\t\t\t\$this->flash('{$currentModelName} deleted: id '.\$id.'.', '{$admin_url}/{$controllerPath}/index');\n";
|
$actions .= "\t\t\t\$this->flash('".$singularHumanName." #'.\$id.' deleted', array('action'=>'index'));\n";
|
||||||
}
|
}
|
||||||
$actions .= "\t\t}\n";
|
$actions .= "\t\t}\n";
|
||||||
$actions .= "\t}\n";
|
$actions .= "\t}\n";
|
||||||
|
|
Loading…
Add table
Reference in a new issue