diff --git a/cake/libs/view/helpers/html.php b/cake/libs/view/helpers/html.php
index 31c4a2e8c..3ed9ddcd8 100644
--- a/cake/libs/view/helpers/html.php
+++ b/cake/libs/view/helpers/html.php
@@ -1,6 +1,5 @@
'',
@@ -99,13 +89,18 @@ class HtmlHelper extends AppHelper {
'ul' => '
',
'ol' => '%s
',
'li' => '%s',
- 'error' => '%s
'
+ 'error' => '%s
',
+ 'javascriptblock' => '',
+ 'javascriptstart' => '',
+ 'javascriptend' => ''
);
/**
* Base URL
*
* @var string
+ * @access public
*/
var $base = null;
@@ -113,6 +108,7 @@ class HtmlHelper extends AppHelper {
* URL to current action.
*
* @var string
+ * @access public
*/
var $here = null;
@@ -120,6 +116,7 @@ class HtmlHelper extends AppHelper {
* Parameter array.
*
* @var array
+ * @access public
*/
var $params = array();
@@ -127,6 +124,7 @@ class HtmlHelper extends AppHelper {
* Current action.
*
* @var string
+ * @access public
*/
var $action = null;
@@ -134,27 +132,31 @@ class HtmlHelper extends AppHelper {
* Enter description here...
*
* @var array
+ * @access public
*/
var $data = null;
-
-/**#@-*/
-
-/*************************************************************************
- * Private variables
- *************************************************************************/
-
-/**#@+
- * @access private
- */
-
/**
* Breadcrumbs.
*
* @var array
- * @access private
+ * @access protected
*/
var $_crumbs = array();
+/**
+ * Names of script files that have been included once
+ *
+ * @var array
+ * @access private
+ **/
+ var $__includedScripts = array();
+/**
+ * Options for the currently opened script block buffer if any.
+ *
+ * @var array
+ * @access protected
+ **/
+ var $_scriptBlockOptions = array();
/**
* Document type definitions
*
@@ -177,6 +179,7 @@ class HtmlHelper extends AppHelper {
* @param string $name Text for link
* @param string $link URL for link (if empty it won't be a link)
* @param mixed $options Link attributes e.g. array('id'=>'selected')
+ * @access public
*/
function addCrumb($name, $link = null, $options = null) {
$this->_crumbs[] = array($name, $link, $options);
@@ -195,7 +198,8 @@ class HtmlHelper extends AppHelper {
* + xhtml11: XHTML1.1.
*
* @param string $type Doctype to use.
- * @return string Doctype.
+ * @return string Doctype string
+ * @access public
*/
function docType($type = 'xhtml-strict') {
if (isset($this->__docTypes[$type])) {
@@ -212,6 +216,7 @@ class HtmlHelper extends AppHelper {
* @param array $attributes Other attributes for the generated tag. If the type attribute is html, rss, atom, or icon, the mime-type is returned.
* @param boolean $inline If set to false, the generated tag appears in the head tag of the layout.
* @return string
+ * @access public
*/
function meta($type, $url = null, $attributes = array(), $inline = true) {
if (!is_array($type)) {
@@ -272,6 +277,7 @@ class HtmlHelper extends AppHelper {
*
* @param string $charset The character set to be used in the meta tag. Example: "utf-8".
* @return string A meta tag containing the specified character set.
+ * @access public
*/
function charset($charset = null) {
if (empty($charset)) {
@@ -295,6 +301,7 @@ class HtmlHelper extends AppHelper {
* @param string $confirmMessage JavaScript confirmation message.
* @param boolean $escapeTitle Whether or not $title should be HTML escaped.
* @return string An element.
+ * @access public
*/
function link($title, $url = null, $htmlAttributes = array(), $confirmMessage = false, $escapeTitle = true) {
if ($url !== null) {
@@ -344,6 +351,7 @@ class HtmlHelper extends AppHelper {
* @param array $htmlAttributes Array of HTML attributes.
* @param boolean $inline If set to false, the generated tag appears in the head tag of the layout.
* @return string CSS or tag, depending on the type of link.
+ * @access public
*/
function css($path, $rel = null, $htmlAttributes = array(), $inline = true) {
if (is_array($path)) {
@@ -373,7 +381,11 @@ class HtmlHelper extends AppHelper {
$path = $this->webroot($path);
$url = $path;
- if (strpos($path, '?') === false && ((Configure::read('Asset.timestamp') === true && Configure::read() > 0) || Configure::read('Asset.timestamp') === 'force')) {
+ $timestampEnabled = (
+ (Configure::read('Asset.timestamp') === true && Configure::read() > 0) ||
+ Configure::read('Asset.timestamp') === 'force'
+ );
+ if (strpos($path, '?') === false && $timestampEnabled) {
$url .= '?' . @filemtime(WWW_ROOT . str_replace('/', DS, $path));
}
@@ -400,12 +412,137 @@ class HtmlHelper extends AppHelper {
}
}
+/**
+ * Returns one or many