last merge for the 0.10.0.1073_dev release

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1073 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-10-04 06:39:40 +00:00
parent 2c99d184f2
commit e37a842373
7 changed files with 90 additions and 82 deletions

View file

@ -39,6 +39,10 @@ if(function_exists('apache_get_modules'))
{ {
define ('BASE_URL', $_SERVER['SCRIPT_NAME']); define ('BASE_URL', $_SERVER['SCRIPT_NAME']);
} }
}
else
{
define ('BASE_URL', $_SERVER['SCRIPT_NAME']);
} }
/** /**

View file

@ -60,19 +60,19 @@ checkbox = "<input type="checkbox" name="data[%s][%s]" id="tag_%s" %s/>"
radio = "<input type="radio" name="data[%s][%s]" id="tag_%s"%s/>" radio = "<input type="radio" name="data[%s][%s]" id="tag_%s"%s/>"
; Tag template for a select opening tag. ; Tag template for a select opening tag.
selectStart = "<select name="data[%s][%s]"%s>" selectstart = "<select name="data[%s][%s]"%s>"
; Tag template for a select opening tag. ; Tag template for a select opening tag.
selectMultipleStart = "<select name="data[%s][%s][]"%s>" selectmultiplestart = "<select name="data[%s][%s][]"%s>"
; Tag template for an empty select option tag. ; Tag template for an empty select option tag.
selectEmpty = "<option value=""%s></option>" selectempty = "<option value=""%s></option>"
; Tag template for a select option tag. ; Tag template for a select option tag.
selectOption = "<option value="%s"%s>%s</option>" selectoption = "<option value="%s"%s>%s</option>"
; Tag template for a closing select tag. ; Tag template for a closing select tag.
selectEnd = "</select>" selectend = "</select>"
; Tag template for a password tag. ; Tag template for a password tag.
password = "<input type="password" name="data[%s][%s]"%s/>" password = "<input type="password" name="data[%s][%s]"%s/>"
@ -87,16 +87,16 @@ submit = "<input type="submit"%s/>"
image =" <img src="%s"%s/>" image =" <img src="%s"%s/>"
; Tag template for a table header tag. ; Tag template for a table header tag.
tableHeader = "<th%s>%s</th>" tableheader = "<th%s>%s</th>"
; Tag template for table headers row tag. ; Tag template for table headers row tag.
tableHeaderRow = "<tr%s>%s</tr>" tableheaderrow = "<tr%s>%s</tr>"
; Tag template for a table cell tag. ; Tag template for a table cell tag.
tableCell = "<td%s>%s</td>" tablecell = "<td%s>%s</td>"
; Tag template for a table row tag. ; Tag template for a table row tag.
tableRow = "<tr%s>%s</tr>" tablerow = "<tr%s>%s</tr>"
; Tag template for a CSS link tag. ; Tag template for a CSS link tag.
css = "<link rel="%s" type="text/css" href="%s" %s/>" css = "<link rel="%s" type="text/css" href="%s" %s/>"
@ -105,7 +105,7 @@ css = "<link rel="%s" type="text/css" href="%s" %s/>"
charset = "<meta http-equiv="Content-Type" content="text/html; charset=%s" />" charset = "<meta http-equiv="Content-Type" content="text/html; charset=%s" />"
; Tag template for inline JavaScript. ; Tag template for inline JavaScript.
javascriptBlock = "<script type="text/javascript">%s</script>" javascriptblock = "<script type="text/javascript">%s</script>"
; Tag template for included JavaScript. ; Tag template for included JavaScript.
javascriptLink = "<script type="text/javascript" src="%s"></script>" javascriptlink = "<script type="text/javascript" src="%s"></script>"

View file

@ -152,16 +152,15 @@ a:hover
padding: 10px; padding: 10px;
} }
***Please Leave Powered by Cake****/ /***Please Leave Powered by Cake****/
#pb-cake { #pb-cake {
width: 752px; width: 752px;
margin-top: 0px; margin-top: 0px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding-right: 6px; padding-right: 6px;
text-align: right; text-align: right;
} }
#pb-cake a{
#pb-cake a{ padding: 0;
padding: 0; }
}

View file

@ -234,80 +234,80 @@ class Dispatcher extends Object
* *
* @return string Base URL * @return string Base URL
*/ */
function baseUrl() function baseUrl()
{ {
$htaccess = null;
$base = null; $base = null;
if (defined('BASE_URL')) $this->webroot = '';
{ if (defined('BASE_URL'))
{
$base = BASE_URL; $base = BASE_URL;
} }
$docRoot = $_SERVER['DOCUMENT_ROOT']; $docRoot = $_SERVER['DOCUMENT_ROOT'];
$scriptName = $_SERVER['PHP_SELF']; $scriptName = $_SERVER['PHP_SELF'];
// If document root ends with 'webroot', it's probably correctly set
// if document root ends with 'webroot', it's probably correctly set
$r = null; $r = null;
if (preg_match('/\\/'.APP_DIR.'\/'.WEBROOT_DIR.'(\/)?$/i', $docRoot)) if (preg_match('/'.APP_DIR.'\\'.DS.WEBROOT_DIR.'/', $docRoot))
{ {
$this->webroot = DS; $this->webroot = '/';
//return preg_match('/\\/index.php(\/)?$/i', $scriptName, $r)? $base.$r[1]: $base; if (preg_match('/^(.*)\/index\.php$/', $scriptName, $r))
if (preg_match('/\\/index.php(\/)?$/i', $scriptName, $r))
{ {
if(!empty($r[1])) if(!empty($r[1]))
{ {
return $base.$r[1]; return $r[1];
} }
else
{
return $base;
}
}
else
{
return $base;
} }
} }
else else
{ {
if(empty($base)){ if (defined('BASE_URL'))
$isDir = explode('/', setUri());
$first = $isDir[1];
$webPath[] = DS.$first.DS;
foreach ($isDir as $dirName)
{
if(!empty($dirName) && is_dir($docRoot.$first.DS.$dirName))
{
$webPath[] = $dirName.DS;
}
}
$webroot = implode('', $webPath);
$base = substr($webroot, 0, -1);
}
else
{ {
$webroot =setUri(); $webroot =setUri();
} $htaccess = preg_replace('/(?:'.APP_DIR.'(.*)|index\\.php(.*))/i', '', $webroot).APP_DIR.'/'.WEBROOT_DIR.'/';
$this->webroot = preg_replace('/(?:'.APP_DIR.'(.*)|index\\.php(.*))/i', '', $webroot).APP_DIR.DS.WEBROOT_DIR.DS; }
// document root is probably not set to Cake 'webroot' dir // Document root is probably not set to Cake 'webroot' dir
if (preg_match('/\\/index.php(\/)?$/i', $scriptName, $r)) if(APP_DIR === 'app')
{ {
if(!empty($r[1])) if (preg_match('/^(.*)\\/'.APP_DIR.'\\/'.WEBROOT_DIR.'\\/index\\.php$/', $scriptName, $regs))
{ {
return $base.$r[1]; !empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[1].'/';
return $regs[1];
} }
else else
{ {
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = '/';
return $base; return $base;
} }
} }
else else
{ {
if (preg_match('/^(.*)\\/'.WEBROOT_DIR.'\\/index\\.php$/', $scriptName, $regs))
{
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[1].'/';
return $regs[1];
}
else
{
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = '/';
return $base;
}
}
//Fallback if all others fail
if (preg_match('/^(.*)\\/index\\.php$/', $scriptName, $regs))
{
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = $regs[1].'/';
return $regs[1];
}
else
{
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = '/';
return $base; return $base;
} }
} }
return $base;
} }
/** /**
* Displays an error page (e.g. 404 Not found). * Displays an error page (e.g. 404 Not found).

View file

@ -424,8 +424,7 @@ class HtmlHelper extends Helper
function image($path, $htmlAttributes = null, $return = false) function image($path, $htmlAttributes = null, $return = false)
{ {
$url = $this->webroot.IMAGES_URL.$path; $url = $this->webroot.IMAGES_URL.$path;
$alt = isset($htmlAttributes['alt']) ? $htmlAttributes['alt'] : ""; return $this->output(sprintf($this->tags['image'], $url, $this->parseHtmlOptions($htmlAttributes, null, '', ' ')), $return);
return $this->output(sprintf($this->tags['image'], $url, $alt, $this->parseHtmlOptions($htmlAttributes, null, '', ' ')), $return);
} }
/** /**

View file

@ -1,15 +1,15 @@
<!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 : a rapid development framework :: <?=$title_for_layout?></title> <title>CakePHP :: A Rapid Development Framework :: <?php echo $title_for_layout?></title>
<link REL="SHORTCUT ICON" HREF="favicon.ico" type="image/x-icon"> <link REL="SHORTCUT ICON" HREF="img/favicon.ico" type="image/x-icon">
<?=$html->charsetTag('UTF-8')?> <?php echo $html->charsetTag('UTF-8')?>
<?=$html->cssTag('cake.default')?> <?php echo $html->cssTag('cake.default')?>
</head> </head>
<body> <body>
<div id="main"> <div id="main">
<div id="header"> <div id="header">
<div id="headerLogo"><?= $html->image('cake.logo.png'); ?></div> <div id="headerLogo"><?php echo $html->image('cake.logo.png',array('alt'=>"CakePHP :: A Rapid Development Framework")); ?></div>
<div id="headerNav"> <div id="headerNav">
<? <?
$css_class = ($title_for_layout == 'Home') ? 'active' : ''; $css_class = ($title_for_layout == 'Home') ? 'active' : '';
@ -33,11 +33,11 @@
$css_class = ($title_for_layout == 'Blog') ? 'active' : ''; $css_class = ($title_for_layout == 'Blog') ? 'active' : '';
echo $html->link('Blog', '/',array('class'=>$css_class)); echo $html->link('Blog', '/',array('class'=>$css_class));
$css_class = ($title_for_layout == 'Community') ? 'active' : ''; $css_class = ($title_for_layout == 'Wiki Community') ? 'active' : '';
echo $html->link('Community', '/',array('class'=>$css_class)); echo $html->link('Wiki Community', 'http://wiki.cakephp.org',array('class'=>$css_class));
$css_class = ($title_for_layout == 'Plugins') ? 'active' : ''; $css_class = ($title_for_layout == 'Plugins') ? 'active' : '';
echo $html->link('Apps & Plugins', '/',array('class'=>$css_class)); echo $html->link('Apps & Plugins', 'http://cakeforge.org',array('class'=>$css_class));
$css_class = ($title_for_layout == 'Cakebin') ? 'active' : ''; $css_class = ($title_for_layout == 'Cakebin') ? 'active' : '';
echo $html->link('Cakebin', 'http://cakephp.org/pastes/',array('class'=>$css_class)); echo $html->link('Cakebin', 'http://cakephp.org/pastes/',array('class'=>$css_class));
@ -46,12 +46,19 @@
</div> </div>
</div> </div>
<div id="content"> <div id="content">
<?=$content_for_layout?> <?php echo $content_for_layout?>
</div> </div>
</div> </div>
<div id="footer" align="center"> <div id="footer" align="center">
&copy; 2005 CakePHP :: &copy; 2005 CakePHP ::
<a href="https://trac.cakephp.org/wiki/Authors">CakePHP Developers and Authors</a> <a href="https://trac.cakephp.org/wiki/Authors">CakePHP Developers and Authors</a>
<p>CakePHP v 0.10.0.1073_dev</p>
</div>
<!---PLEASE LEAVE THE POWERED BY CAKE LOGO------->
<div id="pb-cake">
<a href="http://www.cakephp.org/" target="_new" class="simple">
<?php echo $html->image('pbcake.gif',array('width'=>"120",'height'=>"28",'alt'=>"CakePHP :: A Rapid Development Framework", 'border'=>"0"))?>
</a>
</div> </div>
</body> </body>
</html> </html>

View file

@ -17,7 +17,7 @@ Our primary goal is to provide a structured framework that enables PHP users at
to rapidly develop robust web applications, without any loss to flexibility. to rapidly develop robust web applications, without any loss to flexibility.
</p> </p>
<h2><a href="http://cakephp.org/downloads/index/release">What's <em>New</em></a></h2> <h2><a href="http://cakephp.org/downloads/index/release">What's <em>New</em></a></h2>
<p>Release 0.10.0_dev with:</p> <p>Release 0.10.0.1073_dev with:</p>
<ul> <ul>
<li>Scaffolding</li> <li>Scaffolding</li>
<li>Output Types</li> <li>Output Types</li>
@ -38,4 +38,3 @@ Obviously, everyone and anyone can always make a suggestion, raise a new idea, h
<a href="https://trac.cakephp.org/">Cake TRAC (Wiki, SVN repository, etc.)</a> <a href="https://trac.cakephp.org/">Cake TRAC (Wiki, SVN repository, etc.)</a>
</p> </p>
<br/> <br/>
<p>Cake 0.10.0.x</p>