re syncing all sandboxes and updated trunk with all the latest changes

git-svn-id: https://svn.cakephp.org/repo/trunk/cake@634 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-08-22 04:15:57 +00:00
parent 650c85809a
commit 184e0d06e8
7 changed files with 456 additions and 465 deletions

View file

@ -3,7 +3,9 @@
<head>
<title><?=$page_title?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<?php if(DEBUG == 0) { ?>
<meta http-equiv="Refresh" content="<?=$time?>;url=<?=$url?>" />
<?php } ?>
<style><!--
P { text-align:center; font:bold 1.1em sans-serif }
A { color:#444; text-decoration:none }

View file

@ -138,6 +138,8 @@ class Folder extends Object {
sort($files);
}
closedir($dir);
return array($dirs,$files);
}
else

View file

@ -113,7 +113,11 @@ class AjaxHelper extends Helper
* @return string html code for link to remote action
*/
function linkToRemote ($html, $title, $options = null, $html_options = null) {
return $html->link($title, $this->remoteFunction($html, $options), $html_options);
// mouse click should call our remote function
$html_options['onclick'] = $this->remoteFunction($html, $options);
// generate actual link
return $html->link($title, '#', $html_options);
}
/**
@ -309,6 +313,9 @@ class AjaxHelper extends Helper
$script->codeBlock("new Ajax.Autocompleter('" . $options['id'] . "', '" . $divOptions['id'] . "', '" . $html->url($url) . "', " . $this->__optionsForAjax($ajaxOptions) . ");");
}
/**
*
*/
function drag($script, $id, $options = array())
{
return $script->codeBlock("new Draggable('$id', " . $this->__optionsForDraggable($options) . ");");

View file

@ -311,7 +311,7 @@ class HtmlHelper extends Helper
$this->setFormTag($fieldName);
$this->tagValue($fieldName)? $htmlAttributes['checked'] = 'checked': null;
$title = $title? $title: ucfirst($fieldName);
return $this->output(sprintf(TAG_CHECKBOX, $this->model, $this->field,
return $this->output(sprintf($this->tags['checkbox'], $this->model, $this->field,
$this->field, $this->field,
$this->_parseAttributes($htmlAttributes, null, '', ' '), $title), $return);
}
@ -347,7 +347,7 @@ class HtmlHelper extends Helper
*/
function file($fieldName, $htmlAttributes = null, $return = false)
{
return $this->output(sprintf(TAG_FILE, $fieldName,
return $this->output(sprintf($this->tags['file'], $fieldName,
$this->_parseAttributes($htmlAttributes, null, '', ' ')), $return);
}
@ -470,7 +470,7 @@ class HtmlHelper extends Helper
$opt_value==$value? $options_here['checked'] = 'checked': null;
$parsed_options = $this->parseHtmlOptions(array_merge($htmlAttributes, $options_here), null, '', ' ');
$individual_tag_name = "{$this->field}_{$opt_value}";
$out[] = sprintf(TAG_RADIOS, $individual_tag_name, $this->model, $this->field, $individual_tag_name, $parsed_options, $opt_title);
$out[] = sprintf($this->tags['radio'], $individual_tag_name, $this->model, $this->field, $individual_tag_name, $parsed_options, $opt_title);
}
$out = join($inbetween, $out);
@ -478,15 +478,6 @@ class HtmlHelper extends Helper
}
/**
* Returns a row of formatted and named TABLE headers.
*
@ -500,10 +491,10 @@ class HtmlHelper extends Helper
$out = array();
foreach ($names as $arg)
{
$out[] = sprintf(TAG_TABLE_HEADER, $this->parseHtmlOptions($th_options), $arg);
$out[] = sprintf($this->tags['tableHeader'], $this->parseHtmlOptions($th_options), $arg);
}
return sprintf(TAG_TABLE_HEADERS, $this->parseHtmlOptions($tr_options), join(' ', $out));
return sprintf($this->tags['tableHeader'], $this->parseHtmlOptions($tr_options), join(' ', $out));
}
/**
@ -528,11 +519,11 @@ class HtmlHelper extends Helper
$cells_out = array();
foreach ($line as $cell)
{
$cells_out[] = sprintf(TAG_TABLE_CELL, null, $cell);
$cells_out[] = sprintf($this->tags['tableCell'], null, $cell);
}
$options = $this->parseHtmlOptions($count%2? $odd_tr_options: $even_tr_options);
$out[] = sprintf(TAG_TABLE_ROW, $options, join(' ', $cells_out));
$out[] = sprintf($this->tags['tableRow'], $options, join(' ', $cells_out));
}
return join("\n", $out);
@ -1152,7 +1143,7 @@ class HtmlHelper extends Helper
// plaintext
if (empty($options['encode']) || !empty($match[2]))
{
return sprintf(TAG_MAILTO, $email, $this->parseHtmlOptions($options), $title);
return sprintf($this->tags['mailto'], $email, $this->parseHtmlOptions($options), $title);
}
// encoded to avoid spiders
else
@ -1176,7 +1167,7 @@ class HtmlHelper extends Helper
$title_encoded .= preg_match('/^[A-Za-z0-9]$/', $title[$ii])? '&#x' . bin2hex($title[$ii]).';': $title[$ii];
}
return sprintf(TAG_MAILTO, $email_encoded, $this->parseHtmlOptions($options, array('encode')), $title_encoded);
return sprintf($this->tags['mailto'], $email_encoded, $this->parseHtmlOptions($options, array('encode')), $title_encoded);
}
}

View file

@ -54,6 +54,13 @@ class Object
*/
var $db = null;
/**
* Log object
*
* @var object
*/
var $_log = null;
/**
* A hack to support __construct() on PHP 4
* Hint: descendant classes have no PHP4 class_name() constructors,
@ -103,7 +110,7 @@ class Object
*/
function log ($msg, $type=LOG_ERROR)
{
if (!$this->_log)
if (is_null($this->_log))
{
$this->_log = new Log ();
}

View file

@ -187,9 +187,9 @@ class View extends Object
}
/**
* Enter description here...
* Returns a view instance (singleton)
*
* @return unknown
* @return object
*/
function getInstance()
{
@ -201,24 +201,6 @@ class View extends Object
return $instance[0];
}
/**
* Displays a flash message. A flash message is feedback to the user that displays after editing actions, among other things.
*
* @param string $message Text to display to the user
* @param string $url URL fragment
* @param int $time Display time, in seconds
*/
function flash($message, $url, $time=1)
{
$this->autoRender = false;
$this->autoLayout = false;
$this->set('url', $this->base.$url);
$this->set('message', $message);
$this->set('time', $time);
$this->render(null,false,VIEWS.'layouts'.DS.'flash.thtml');
}
/**
* Render view for given action and layout. If $file is given, that is used

View file

@ -37,8 +37,6 @@
*/
$url = empty($_GET['url'])? null: $_GET['url'];
session_start();
/**
* Get Cake's root directory
*/
@ -82,6 +80,8 @@ $TIME_START = getMicrotime();
uses('folder', 'dispatcher', 'dbo_factory');
session_start();
config('database');
if (class_exists('DATABASE_CONFIG'))