From 5b6eb9f59d51f9f57b9658e773248cfbf95c0841 Mon Sep 17 00:00:00 2001 From: gwoo Date: Thu, 19 Oct 2006 04:55:07 +0000 Subject: [PATCH] 1.2: updating bake to use _ _() function git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3718 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/scripts/bake.php | 132 +++++++++++++++++++++--------------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/cake/scripts/bake.php b/cake/scripts/bake.php index 7b63f97a7..b471390dc 100644 --- a/cake/scripts/bake.php +++ b/cake/scripts/bake.php @@ -302,7 +302,7 @@ class Bake { $login = ''; while ($login == '') { - $login = $this->getInput('What is the database username?'); + $login = $this->getInput('What is the database username?', null, 'root'); if ($login == '') { $this->stdout('The database username you supplied was empty. Please try again.'); @@ -312,7 +312,7 @@ class Bake { $blankPassword = false; while ($password == '' && $blankPassword == false) { - $password = $this->getInput('What is the database password?'); + $password = $this->getInput('What is the database password?', null, ''); if ($password == '') { $blank = $this->getInput('The password you supplied was empty. Use an empty password?', array('y', 'n'), 'n'); if($blank == 'y') @@ -324,7 +324,7 @@ class Bake { $database = ''; while ($database == '') { - $database = $this->getInput('What is the name of the database you will be using?'); + $database = $this->getInput('What is the name of the database you will be using?', null, 'cake'); if ($database == '') { $this->stdout('The database name you supplied was empty. Please try again.'); @@ -864,14 +864,14 @@ class Bake { } } $indexView .= "
\n"; - $indexView .= "

List " . $pluralHumanName . "

\n\n"; + $indexView .= "

\n\n"; $indexView .= "\n"; $indexView .= "\n"; foreach ($fieldNames as $fieldName) { - $indexView .= "\t\n"; + $indexView .= "\t\n"; } - $indexView .= "\t\n"; + $indexView .= "\t\n"; $indexView .= "\n"; $indexView .= "\n"; $indexView .= "\n"; @@ -885,25 +885,25 @@ class Bake { $otherControllerPath = $this->__controllerPath($otherControllerName); if(is_object($otherModelObj)) { $displayField = $otherModelObj->getDisplayField(); - $indexView .= "\t\n"; + $indexView .= "\t\n"; } else { - $indexView .= "\t\n"; + $indexView .= "\t\n"; } $count++; } else { - $indexView .= "\t\n"; + $indexView .= "\t\n"; } } $indexView .= "\t\n"; $indexView .= "\n"; $indexView .= "\n"; $indexView .= "
".$fieldName['prompt']."Actions
 link(\$".$singularName."['{$alias[$count]}']['{$displayField}'], '/" . $otherControllerPath . "/view/' .\$".$singularName."['{$alias[$count]}']['{$otherModelObj->primaryKey}'])?> link(__(\$".$singularName."['{$alias[$count]}']['{$displayField}'], true), '/" . $otherControllerPath . "/view/' .\$".$singularName."['{$alias[$count]}']['{$otherModelObj->primaryKey}'])?>name}']['{$field}']; ?>name}']['{$field}']); ?>name}']['{$field}']; ?>name}']['{$field}']); ?>\n"; - $indexView .= "\t\tlink('View','/{$controllerPath}/view/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'])?>\n"; - $indexView .= "\t\tlink('Edit','/{$controllerPath}/edit/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'])?>\n"; - $indexView .= "\t\tlink('Delete','/{$controllerPath}/delete/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'], null, 'Are you sure you want to delete: id ' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'])?>\n"; + $indexView .= "\t\tlink(__('View', true),'/{$controllerPath}/view/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'])?>\n"; + $indexView .= "\t\tlink(__('Edit', true),'/{$controllerPath}/edit/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'])?>\n"; + $indexView .= "\t\tlink(__('Delete', true),'/{$controllerPath}/delete/' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'], null, __('Are you sure you want to delete: id ' . \$".$singularName."['{$modelObj->name}']['{$modelObj->primaryKey}'], true))?>\n"; $indexView .= "\t
\n\n"; $indexView .= "\n"; $indexView .= "
"; @@ -911,11 +911,11 @@ class Bake { $viewView = null; $viewView .= "
\n"; - $viewView .= "

View " . $singularHumanName . "

\n\n"; + $viewView .= "

\n\n"; $viewView .= "
\n"; $count = 0; foreach($fieldNames as $field => $value) { - $viewView .= "\t
" . $value['prompt'] . "
\n"; + $viewView .= "\t
\n"; if(isset($value['foreignKey'])) { $otherModelName = $this->__modelName($value['model']); $otherModelKey = Inflector::underscore($otherModelName); @@ -923,18 +923,18 @@ class Bake { $otherControllerName = $this->__controllerName($otherModelName); $otherControllerPath = $this->__controllerPath($otherControllerName); $displayField = $otherModelObj->getDisplayField(); - $viewView .= "\t
 link(\$".$singularName."['{$alias[$count]}']['{$displayField}'], '/" . $otherControllerPath . "/view/' .\$".$singularName."['{$alias[$count]}']['{$otherModelObj->primaryKey}'])?>
\n"; + $viewView .= "\t
 link(__(\$".$singularName."['{$alias[$count]}']['{$displayField}'], true), '/" . $otherControllerPath . "/view/' .\$".$singularName."['{$alias[$count]}']['{$otherModelObj->primaryKey}']); ?>
\n"; $count++; } else { - $viewView .= "\t
 name}']['{$field}']?>
\n"; + $viewView .= "\t
 name}']['{$field}']);?>
\n"; } } $viewView .= "
\n"; $viewView .= "