From ff847150e22c872aa5e6d44874f6416e21b8ca30 Mon Sep 17 00:00:00 2001 From: gwoo Date: Tue, 10 Oct 2006 22:05:41 +0000 Subject: [PATCH] bake 1.2 fixes, skel and css updates git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3627 3807eeeb-6ff5-0310-8944-8be069107fe0 --- app/webroot/css/cake.generic.css | 1 - cake/scripts/bake.php | 21 +++++++++--- .../skel/views/layouts/default.thtml | 32 ++++++++++++------- .../skel/webroot/css/cake.generic.css | 1 - 4 files changed, 36 insertions(+), 19 deletions(-) diff --git a/app/webroot/css/cake.generic.css b/app/webroot/css/cake.generic.css index 129f484ee..e5cfa6d6a 100644 --- a/app/webroot/css/cake.generic.css +++ b/app/webroot/css/cake.generic.css @@ -236,7 +236,6 @@ margin-left: 140px; #flashMessage, .error, .error_message { color:#900; font-size: 16px; -background-color: #fff; margin: 8px 0px; font-weight: bold; } diff --git a/cake/scripts/bake.php b/cake/scripts/bake.php index 1dd7d9cd2..219894f6f 100644 --- a/cake/scripts/bake.php +++ b/cake/scripts/bake.php @@ -64,11 +64,21 @@ case '-project': $project = true; $projectPath = $argv[$i + 1]; + $app = $argv[$i + 1]; break; } } - if(!$app) $app = $argv[1]; - if($project) $app = $projectPath; + if(!$app) { + $app = $argv[1]; + } + if(!is_dir($app)) { + $project = true; + $projectPath = $app; + + } + if($project) { + $app = $projectPath; + } $shortPath = str_replace($root, '', $app); $shortPath = str_replace('../', '', $shortPath); $shortPath = str_replace('//', '/', $shortPath); @@ -1095,6 +1105,7 @@ class Bake { $otherPluralName = $this->__pluralName($associationName); $actions .= "\t\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n"; + $actions .= "\t\t\t\tif(empty(\$this->data['{$associationName}']['{$associationName}'])) { \$this->data['{$associationName}']['{$associationName}'] = null; }\n"; $actions .= "\t\t\t\t\$this->set('selected_{$otherPluralName}', \$this->data['{$associationName}']['{$associationName}']);\n"; } } @@ -2070,11 +2081,11 @@ class Bake { * * @param string $projectPath */ - function project($projectPath) { + function project($projectPath = null) { if($projectPath != '') { while ($this->__checkPath($projectPath) === true) { $projectPath = $this->getInput('Directory exists please choose another name:'); - $this->__buildDirLayout($projectPath); + $this->__buildDirLayout(null, null); exit(); } } else { @@ -2169,7 +2180,7 @@ class Bake { } elseif (strtolower($looksGood) == 'q' || strtolower($looksGood) == 'quit') { $this->stdout('Bake Aborted.'); } else { - $this->project($projectPath); + $this->project(); } } /** diff --git a/cake/scripts/templates/skel/views/layouts/default.thtml b/cake/scripts/templates/skel/views/layouts/default.thtml index cddea0be0..54f52ad7b 100644 --- a/cake/scripts/templates/skel/views/layouts/default.thtml +++ b/cake/scripts/templates/skel/views/layouts/default.thtml @@ -1,28 +1,36 @@ -CakePHP : <?php echo $title_for_layout;?> - +CakePHP: the PHP Rapid Development Framework: <?php echo $title_for_layout;?> +charset('UTF-8');?> + + css('cake.generic');?>
- controller->Session->check('Message.flash')) - { - $this->controller->Session->flash(); - } - echo $content_for_layout; + check('Message.flash')): + $session->flash(); + endif; ?> + + +
diff --git a/cake/scripts/templates/skel/webroot/css/cake.generic.css b/cake/scripts/templates/skel/webroot/css/cake.generic.css index 129f484ee..e5cfa6d6a 100644 --- a/cake/scripts/templates/skel/webroot/css/cake.generic.css +++ b/cake/scripts/templates/skel/webroot/css/cake.generic.css @@ -236,7 +236,6 @@ margin-left: 140px; #flashMessage, .error, .error_message { color:#900; font-size: 16px; -background-color: #fff; margin: 8px 0px; font-weight: bold; }