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
This commit is contained in:
gwoo 2006-10-10 22:05:41 +00:00
parent 5f88da5d70
commit ff847150e2
4 changed files with 36 additions and 19 deletions

View file

@ -236,7 +236,6 @@ margin-left: 140px;
#flashMessage, .error, .error_message { #flashMessage, .error, .error_message {
color:#900; color:#900;
font-size: 16px; font-size: 16px;
background-color: #fff;
margin: 8px 0px; margin: 8px 0px;
font-weight: bold; font-weight: bold;
} }

View file

@ -64,11 +64,21 @@
case '-project': case '-project':
$project = true; $project = true;
$projectPath = $argv[$i + 1]; $projectPath = $argv[$i + 1];
$app = $argv[$i + 1];
break; break;
} }
} }
if(!$app) $app = $argv[1]; if(!$app) {
if($project) $app = $projectPath; $app = $argv[1];
}
if(!is_dir($app)) {
$project = true;
$projectPath = $app;
}
if($project) {
$app = $projectPath;
}
$shortPath = str_replace($root, '', $app); $shortPath = str_replace($root, '', $app);
$shortPath = str_replace('../', '', $shortPath); $shortPath = str_replace('../', '', $shortPath);
$shortPath = str_replace('//', '/', $shortPath); $shortPath = str_replace('//', '/', $shortPath);
@ -1095,6 +1105,7 @@ class Bake {
$otherPluralName = $this->__pluralName($associationName); $otherPluralName = $this->__pluralName($associationName);
$actions .= "\t\t\t\t\$this->set('{$otherPluralName}', \$this->{$currentModelName}->{$otherModelName}->generateList());\n"; $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"; $actions .= "\t\t\t\t\$this->set('selected_{$otherPluralName}', \$this->data['{$associationName}']['{$associationName}']);\n";
} }
} }
@ -2070,11 +2081,11 @@ class Bake {
* *
* @param string $projectPath * @param string $projectPath
*/ */
function project($projectPath) { function project($projectPath = null) {
if($projectPath != '') { if($projectPath != '') {
while ($this->__checkPath($projectPath) === true) { while ($this->__checkPath($projectPath) === true) {
$projectPath = $this->getInput('Directory exists please choose another name:'); $projectPath = $this->getInput('Directory exists please choose another name:');
$this->__buildDirLayout($projectPath); $this->__buildDirLayout(null, null);
exit(); exit();
} }
} else { } else {
@ -2169,7 +2180,7 @@ class Bake {
} elseif (strtolower($looksGood) == 'q' || strtolower($looksGood) == 'quit') { } elseif (strtolower($looksGood) == 'q' || strtolower($looksGood) == 'quit') {
$this->stdout('Bake Aborted.'); $this->stdout('Bake Aborted.');
} else { } else {
$this->project($projectPath); $this->project();
} }
} }
/** /**

View file

@ -1,28 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>CakePHP : <?php echo $title_for_layout;?></title> <title>CakePHP: the PHP Rapid Development Framework: <?php echo $title_for_layout;?></title>
<link rel="shortcut icon" href="<?php echo $html->url('/favicon.ico')?>" type="image/x-icon" /> <?php echo $html->charset('UTF-8');?>
<link rel="icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->webroot;?>favicon.ico" type="image/x-icon" />
<?php echo $html->css('cake.generic');?> <?php echo $html->css('cake.generic');?>
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<div id="header"> <div id="header">
<h1>CakePHP Rapid Development</h1> <h1>CakePHP: the PHP Rapid Development Framework</h1>
</div> </div>
<div id="content"> <div id="content">
<?php if ($this->controller->Session->check('Message.flash')) <?php
{ if($session->check('Message.flash')):
$this->controller->Session->flash(); $session->flash();
} endif;
echo $content_for_layout;
?> ?>
<?php echo $content_for_layout;?>
</div> </div>
<div id="footer"> <div id="footer">
&nbsp; <?php echo $html->link(
<a href="http://www.cakephp.org/" target="_new"> $html->image('cake.power.png', array('alt'=>"CakePHP: the PHP Rapid Development Framework", 'border'=>"0")),
<?php echo $html->image('cake.power.png', array('alt'=>"CakePHP : Rapid Development Framework", 'border'=>"0"));?> 'http://www.cakephp.org/',
</a> array('target'=>'_new'),
null,
false
);
?>
</div> </div>
</div> </div>
</body> </body>

View file

@ -236,7 +236,6 @@ margin-left: 140px;
#flashMessage, .error, .error_message { #flashMessage, .error, .error_message {
color:#900; color:#900;
font-size: 16px; font-size: 16px;
background-color: #fff;
margin: 8px 0px; margin: 8px 0px;
font-weight: bold; font-weight: bold;
} }