--- a/web/lib/Zend/Tool/Project/Context/Zf/ViewScriptFile.php Thu Mar 21 17:31:31 2013 +0100
+++ b/web/lib/Zend/Tool/Project/Context/Zf/ViewScriptFile.php Thu Mar 21 19:50:53 2013 +0100
@@ -15,9 +15,9 @@
* @category Zend
* @package Zend_Tool
* @subpackage Framework
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: ViewScriptFile.php 23343 2010-11-15 15:33:22Z ramon $
+ * @version $Id: ViewScriptFile.php 24593 2012-01-05 20:35:02Z matthew $
*/
/**
@@ -49,7 +49,7 @@
*
* @category Zend
* @package Zend_Tool
- * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Tool_Project_Context_Zf_ViewScriptFile extends Zend_Tool_Project_Context_Filesystem_File
@@ -130,6 +130,18 @@
{
$contents = '';
+ $controllerName = $this->_resource->getParentResource()->getAttribute('forControllerName');
+
+ $viewsDirectoryResource = $this->_resource
+ ->getParentResource() // view script
+ ->getParentResource() // view controller dir
+ ->getParentResource(); // views dir
+ if ($viewsDirectoryResource->getParentResource()->getName() == 'ModuleDirectory') {
+ $moduleName = $viewsDirectoryResource->getParentResource()->getModuleName();
+ } else {
+ $moduleName = 'default';
+ }
+
if ($this->_filesystemName == 'error.phtml') { // should also check that the above directory is forController=error
$contents .= <<<EOS
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
@@ -143,7 +155,7 @@
<h2><?php echo \$this->message ?></h2>
<?php if (isset(\$this->exception)): ?>
-
+
<h3>Exception information:</h3>
<p>
<b>Message:</b> <?php echo \$this->exception->getMessage() ?>
@@ -154,15 +166,16 @@
</pre>
<h3>Request Parameters:</h3>
- <pre><?php echo var_export(\$this->request->getParams(), true) ?>
+ <pre><?php echo \$this->escape(var_export(\$this->request->getParams(), true)) ?>
</pre>
+
<?php endif ?>
</body>
</html>
EOS;
- } elseif ($this->_forActionName == 'index' && $this->_resource->getParentResource()->getAttribute('forControllerName') == 'Index') {
+ } elseif ($this->_forActionName == 'index' && $controllerName == 'Index' && $moduleName == 'default') {
$contents =<<<EOS
<style>
@@ -211,8 +224,14 @@
EOS;
} else {
- $contents = '<br /><br /><center>View script for controller <b>' . $this->_resource->getParentResource()->getAttribute('forControllerName') . '</b>'
- . ' and script/action name <b>' . $this->_forActionName . '</b></center>';
+ $controllerName = $this->_resource->getParentResource()->getAttribute('forControllerName');
+ $actionName = $this->_forActionName;
+ $contents = <<<EOS
+<br /><br />
+<div id="view-content">
+ <p>View script for controller <b>$controllerName</b> and script/action name <b>$actionName</b></p>
+</div>
+EOS;
}
return $contents;
}