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']);
}
}
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/>"
; 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.
selectMultipleStart = "<select name="data[%s][%s][]"%s>"
selectmultiplestart = "<select name="data[%s][%s][]"%s>"
; 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.
selectOption = "<option value="%s"%s>%s</option>"
selectoption = "<option value="%s"%s>%s</option>"
; Tag template for a closing select tag.
selectEnd = "</select>"
selectend = "</select>"
; Tag template for a password tag.
password = "<input type="password" name="data[%s][%s]"%s/>"
@ -87,16 +87,16 @@ submit = "<input type="submit"%s/>"
image =" <img src="%s"%s/>"
; Tag template for a table header tag.
tableHeader = "<th%s>%s</th>"
tableheader = "<th%s>%s</th>"
; Tag template for table headers row tag.
tableHeaderRow = "<tr%s>%s</tr>"
tableheaderrow = "<tr%s>%s</tr>"
; Tag template for a table cell tag.
tableCell = "<td%s>%s</td>"
tablecell = "<td%s>%s</td>"
; Tag template for a table row tag.
tableRow = "<tr%s>%s</tr>"
tablerow = "<tr%s>%s</tr>"
; Tag template for a CSS link tag.
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" />"
; Tag template for inline JavaScript.
javascriptBlock = "<script type="text/javascript">%s</script>"
javascriptblock = "<script type="text/javascript">%s</script>"
; 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;
}
***Please Leave Powered by Cake****/
#pb-cake {
width: 752px;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
padding-right: 6px;
text-align: right;
}
#pb-cake a{
padding: 0;
}
/***Please Leave Powered by Cake****/
#pb-cake {
width: 752px;
margin-top: 0px;
margin-left: auto;
margin-right: auto;
padding-right: 6px;
text-align: right;
}
#pb-cake a{
padding: 0;
}

View file

@ -234,80 +234,80 @@ class Dispatcher extends Object
*
* @return string Base URL
*/
function baseUrl()
{
function baseUrl()
{
$htaccess = null;
$base = null;
if (defined('BASE_URL'))
{
$this->webroot = '';
if (defined('BASE_URL'))
{
$base = BASE_URL;
}
$docRoot = $_SERVER['DOCUMENT_ROOT'];
$scriptName = $_SERVER['PHP_SELF'];
}
$docRoot = $_SERVER['DOCUMENT_ROOT'];
$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;
if (preg_match('/\\/'.APP_DIR.'\/'.WEBROOT_DIR.'(\/)?$/i', $docRoot))
if (preg_match('/'.APP_DIR.'\\'.DS.WEBROOT_DIR.'/', $docRoot))
{
$this->webroot = DS;
//return preg_match('/\\/index.php(\/)?$/i', $scriptName, $r)? $base.$r[1]: $base;
if (preg_match('/\\/index.php(\/)?$/i', $scriptName, $r))
$this->webroot = '/';
if (preg_match('/^(.*)\/index\.php$/', $scriptName, $r))
{
if(!empty($r[1]))
{
return $base.$r[1];
return $r[1];
}
else
{
return $base;
}
}
else
{
return $base;
}
}
else
{
if(empty($base)){
$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
if (defined('BASE_URL'))
{
$webroot =setUri();
}
$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
if (preg_match('/\\/index.php(\/)?$/i', $scriptName, $r))
$htaccess = preg_replace('/(?:'.APP_DIR.'(.*)|index\\.php(.*))/i', '', $webroot).APP_DIR.'/'.WEBROOT_DIR.'/';
}
// Document root is probably not set to Cake 'webroot' dir
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
{
!empty($htaccess)? $this->webroot = $htaccess : $this->webroot = '/';
return $base;
}
}
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;
}
/**
* 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)
{
$url = $this->webroot.IMAGES_URL.$path;
$alt = isset($htmlAttributes['alt']) ? $htmlAttributes['alt'] : "";
return $this->output(sprintf($this->tags['image'], $url, $alt, $this->parseHtmlOptions($htmlAttributes, null, '', ' ')), $return);
return $this->output(sprintf($this->tags['image'], $url, $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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>CakePHP : a rapid development framework :: <?=$title_for_layout?></title>
<link REL="SHORTCUT ICON" HREF="favicon.ico" type="image/x-icon">
<?=$html->charsetTag('UTF-8')?>
<?=$html->cssTag('cake.default')?>
<title>CakePHP :: A Rapid Development Framework :: <?php echo $title_for_layout?></title>
<link REL="SHORTCUT ICON" HREF="img/favicon.ico" type="image/x-icon">
<?php echo $html->charsetTag('UTF-8')?>
<?php echo $html->cssTag('cake.default')?>
</head>
<body>
<div id="main">
<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">
<?
$css_class = ($title_for_layout == 'Home') ? 'active' : '';
@ -33,11 +33,11 @@
$css_class = ($title_for_layout == 'Blog') ? 'active' : '';
echo $html->link('Blog', '/',array('class'=>$css_class));
$css_class = ($title_for_layout == 'Community') ? 'active' : '';
echo $html->link('Community', '/',array('class'=>$css_class));
$css_class = ($title_for_layout == 'Wiki Community') ? 'active' : '';
echo $html->link('Wiki Community', 'http://wiki.cakephp.org',array('class'=>$css_class));
$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' : '';
echo $html->link('Cakebin', 'http://cakephp.org/pastes/',array('class'=>$css_class));
@ -46,12 +46,19 @@
</div>
</div>
<div id="content">
<?=$content_for_layout?>
<?php echo $content_for_layout?>
</div>
</div>
<div id="footer" align="center">
&copy; 2005 CakePHP ::
<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>
</body>
</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.
</p>
<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>
<li>Scaffolding</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>
</p>
<br/>
<p>Cake 0.10.0.x</p>