From fde0d21053af17c5eb23fd5fbf3f8b07ed34afc5 Mon Sep 17 00:00:00 2001
From: nate
%s", true), $viewFileName, $out), E_USER_ERROR); + $msg = __("Error in view %s, got:
%s", true); + trigger_error(sprintf($msg, $viewFileName, $out), E_USER_ERROR); } return $out; } @@ -414,7 +420,7 @@ class View extends Object { $debug = ''; if (isset($this->viewVars['cakeDebug']) && Configure::read() > 2) { - $params = array('controller' => $this->viewVars['cakeDebug']); + $params = array('controller' => $this->viewVars['cakeDebug']); $debug = View::element('dump', $params, false); unset($this->viewVars['cakeDebug']); } @@ -424,14 +430,12 @@ class View extends Object { } else { $pageTitle = Inflector::humanize($this->viewPath); } - $data_for_layout = array_merge($this->viewVars, - array( - 'title_for_layout' => $pageTitle, - 'content_for_layout' => $content_for_layout, - 'scripts_for_layout' => join("\n\t", $this->__scripts), - 'cakeDebug' => $debug - ) - ); + $data_for_layout = array_merge($this->viewVars, array( + 'title_for_layout' => $pageTitle, + 'content_for_layout' => $content_for_layout, + 'scripts_for_layout' => join("\n\t", $this->__scripts), + 'cakeDebug' => $debug + )); if (empty($this->loaded) && !empty($this->helpers)) { $loadHelpers = true; @@ -460,14 +464,8 @@ class View extends Object { if ($this->output === false) { $this->output = $this->_render($layoutFileName, $data_for_layout); - - trigger_error( - sprintf( - __("Error in layout %s, got:
%s", true), - $layoutFileName, $this->output - ), - E_USER_ERROR - ); + $msg = __("Error in layout %s, got:
%s", true); + trigger_error(sprintf($msg, $layoutFileName, $this->output), E_USER_ERROR); return false; } @@ -508,8 +506,7 @@ class View extends Object { if ($this->layout === 'xml') { header('Content-type: text/xml'); } - $out = str_replace('', '', $out); - echo $out; + echo str_replace('', '', $out); return true; } } @@ -581,7 +578,7 @@ class View extends Object { function entity() { $assoc = ($this->association) ? $this->association : $this->model; return array_values(Set::filter( - array($assoc, $this->modelId, $this->field, $this->fieldSuffix) + array($assoc, $this->modelId, $this->field, $this->fieldSuffix) )); } /** @@ -681,8 +678,12 @@ class View extends Object { } } $out = ob_get_clean(); + $caching = ( + isset($this->loaded['cache']) && + (($this->cacheAction != false)) && (Configure::read('Cache.check') === true) + ); - if (isset($this->loaded['cache']) && (($this->cacheAction != false)) && (Configure::read('Cache.check') === true)) { + if ($caching) { if (is_a($this->loaded['cache'], 'CacheHelper')) { $cache =& $this->loaded['cache']; $cache->base = $this->base; @@ -750,7 +751,9 @@ class View extends Object { } } $loaded[$helper] =& new $helperCn($options); - $vars = array('base', 'webroot', 'here', 'params', 'action', 'data', 'themeWeb', 'plugin'); + $vars = array( + 'base', 'webroot', 'here', 'params', 'action', 'data', 'themeWeb', 'plugin' + ); $c = count($vars); for ($j = 0; $j < $c; $j++) { @@ -869,21 +872,20 @@ class View extends Object { if ($error === 'missingView') { $this->cakeError('missingView', array( - 'className' => $this->name, - 'action' => $this->action, - 'file' => $file, - 'base' => $this->base - )); + 'className' => $this->name, + 'action' => $this->action, + 'file' => $file, + 'base' => $this->base + )); return false; } elseif ($error === 'missingLayout') { $this->cakeError('missingLayout', array( - 'layout' => $this->layout, - 'file' => $file, - 'base' => $this->base - )); + 'layout' => $this->layout, + 'file' => $file, + 'base' => $this->base + )); return false; } - } /** * Return all possible paths to find view files in order @@ -926,4 +928,5 @@ class View extends Object { return $this->element($name, $params, $loadHelpers); } } + ?> \ No newline at end of file