summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxue <>2006-03-24 23:06:31 +0000
committerxue <>2006-03-24 23:06:31 +0000
commit8df1407a11df3e5a8c33c6fae1c522707aefccf3 (patch)
treed65fbc70a3c0f22e188f26d413fc7a52f22edb23
parentc8494fb1d1b8e5e6d2c135d8a8d8777442dae306 (diff)
Enhanced error context display when a PHP error occurs.
-rw-r--r--HISTORY6
-rw-r--r--demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample2.page2
-rw-r--r--demos/quickstart/protected/pages/Controls/Wizard.page31
-rw-r--r--framework/Data/TDataFieldAccessor.php2
-rw-r--r--framework/Exceptions/TErrorHandler.php17
5 files changed, 47 insertions, 11 deletions
diff --git a/HISTORY b/HISTORY
index 8e91244a..6ac5f3fa 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,14 +1,16 @@
Version 3.0RC1 April 1, 2006
============================
-BUG: Ticket#88 - Unclosed HTML tag rendered in TDatePicker
- and TColorPicker (Qiang)
+BUG: Ticket#88 - Unclosed HTML tag in TDatePicker and TColorPicker (Qiang)
BUG: Ticket#85 - Undefined TDataGrid::setSelectedIndex (Qiang)
BUG: Ticket#87 - Typo in IDbConnection (Qiang)
+BUG: Ticket#95 - Typo in TTemplateControl::registerContentPlaceHolder (Qiang)
BUG: SF#1446846 - Typo in THead (Qiang)
BUG: SF#1432624 - Incorrect documentation about caching expiry (Qiang)
BUG: THttpSession fails when user storage module is used (Qiang)
ENH: TDataFieldAccessor can access public class variables (Qiang)
ENH: Pagers in TDataGrid are now enclosed within panels (Qiang)
+ENH: Ticket#92 - Support for user exception message file (Qiang)
+ENH: TPhpErrorException now shows the actual error lines (Qiang)
NEW: TSQLMap module (Wei)
NEW: TStack class (Qiang)
NEW: TImageMap control (Qiang)
diff --git a/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample2.page b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample2.page
index 727179bd..ea01e320 100644
--- a/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample2.page
+++ b/demos/quickstart/protected/pages/Controls/Samples/TWizard/Sample2.page
@@ -12,6 +12,8 @@
SideBarStyle.Width="100px"
SideBarStyle.Height="100px"
SideBarStyle.BackColor="#507CD1"
+ SideBarStyle.HorizontalAlign="Center"
+ StepStyle.HorizontalAlign="Center"
NavigationStyle.HorizontalAlign="Right"
NavigationButtonStyle.BackColor="White"
NavigationButtonStyle.BorderColor="#507CD1"
diff --git a/demos/quickstart/protected/pages/Controls/Wizard.page b/demos/quickstart/protected/pages/Controls/Wizard.page
index 3034c0c6..0de4a44a 100644
--- a/demos/quickstart/protected/pages/Controls/Wizard.page
+++ b/demos/quickstart/protected/pages/Controls/Wizard.page
@@ -5,7 +5,7 @@
<h2>Overview</h2>
<p>
-<tt>TWizard</tt> is analogous to the installation wizard commonly used to install software on Windows. It splits a large form and presents the user with a series of smaller forms, called wizard steps, to complete. The following figure shows how a wizard is composed of when presented to users, where <tt>step content</tt> is the main content of a wizard step for users to complete, <tt>header</tt> refers to header content common to all steps, <tt>navigation</tt> contains buttons that allow users to navigate step by step, and <tt>side bar</tt> contains a list of hyperlinks by which users can reach to any step with one click.
+<tt>TWizard</tt> is analogous to the installation wizard commonly used to install software on Windows. It splits a large form and presents the user with a series of smaller forms, called wizard steps, to complete. The following figure shows how a wizard is composed of when presented to users, where <tt>step content</tt> is the main content of a wizard step for users to complete, <tt>header</tt> refers to header content common to all steps, <tt>navigation</tt> contains buttons that allow users to navigate step by step, and <tt>side bar</tt> contains a list of hyperlinks by which users can reach to any step with one click. The visibility of the side bar can be toggled by setting <tt>DisplaySideBar</tt>.
</p>
<img src="<%~wizard.gif%>" alt="components of wizard" />
@@ -40,7 +40,7 @@ In the above, <tt>StepType</tt> refers to the type of a wizard step, which can a
<li><tt>Start</tt> - the first step in the wizard.</li>
<li><tt>Step</tt> - the internal steps in the wizard.</li>
<li><tt>Finish</tt> - the last step that allows user interaction.</li>
- <li><tt>Complete</tt> - the step that shows a summary to user (no interaction is allowed).</li>
+ <li><tt>Complete</tt> - the step that shows a summary to user. In this step, both side bar and navigation panel are invisible. Thus, this step usually does not allow user interaction.</li>
<li><tt>Auto</tt> - the step type is determined by wizard automatically.</li>
</ul>
@@ -55,15 +55,34 @@ In this sample, we use wizard to collect user's preference of color. In the firs
<h3>Customizing Wizard Styles</h3>
<p>
-<tt>TWizard</tt> defines a whole set of properties for customization of its various components as shown in the above figure. In particular, the following properties are provided:
+<tt>TWizard</tt> defines a whole set of properties for customization of appearance of its various components as shown in the above figure. In particular, the following properties are provided for style customization:
</p>
<ul>
- <li>Header - <tt>HeaderText</tt>, <tt>HeaderTemplate</tt>, <tt>HeaderStyle</tt>.</li>
+ <li>Header - <tt>HeaderStyle</tt>.</li>
<li>Step - <tt>StepStyle</tt>.</li>
- <li>Navigation - <tt>NavigationStyle</tt>, <tt>StartNavigationTemplate</tt>, <tt>StepNavigationTemplate</tt>, <tt>FinishNavigationTemplate</tt>, <tt>StartNextButtonStyle</tt>, <tt>StepNextButtonStyle</tt>, <tt>StepPreviousButtonStyle</tt>, <tt>FinishPreviousButtonStyle</tt>, <tt>FinishCompleteButtonStyle</tt>, <tt>CancelButtonStyle</tt>.</li>
- <li>Side bar - <tt>SideBarTemplate</tt>, <tt>SideBarStyle</tt>, <tt>SideBarButtonStyle</tt>, <tt>DisplaySideBar</tt>.</li>
+ <li>Navigation - <tt>NavigationStyle</tt>, <tt>StartNextButtonStyle</tt>, <tt>StepNextButtonStyle</tt>, <tt>StepPreviousButtonStyle</tt>, <tt>FinishPreviousButtonStyle</tt>, <tt>FinishCompleteButtonStyle</tt>, <tt>CancelButtonStyle</tt>.</li>
+ <li>Side bar - <tt>SideBarStyle</tt>, <tt>SideBarButtonStyle</tt>.</li>
</ul>
<com:RunBar PagePath="Controls.Samples.TWizard.Sample2" />
+<h3>Customizing Wizard Navigation</h3>
+<p>
+Bidirectional,
+Unidirectional,
+Non-linear
+</p>
+
+<h3>Using Templates in Wizard</h3>
+<p>
+</p>
+<ul>
+ <li>Header - <tt>HeaderTemplate</tt>.</li>
+ <li>Navigation - <tt>StartNavigationTemplate</tt>, <tt>StepNavigationTemplate</tt>, <tt>FinishNavigationTemplate</tt>.</li>
+ <li>Side bar - <tt>SideBarTemplate</tt>.</li>
+</ul>
+
+<h3>Using Templated Wizard Steps</h3>
+<p>
+</p>
</com:TContent> \ No newline at end of file
diff --git a/framework/Data/TDataFieldAccessor.php b/framework/Data/TDataFieldAccessor.php
index a28b9d1f..aa6d7be7 100644
--- a/framework/Data/TDataFieldAccessor.php
+++ b/framework/Data/TDataFieldAccessor.php
@@ -78,7 +78,7 @@ class TDataFieldAccessor
{
if(is_array($data) || ($data instanceof ArrayAccess))
{
- if(isset($data[$field]))
+ if(isset($data[$field]) || $data[$field]===null)
return $data[$field];
else
throw new TInvalidDataValueException('datafieldaccessor_datafield_invalid',$field);
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php
index 23644fb7..4b42491e 100644
--- a/framework/Exceptions/TErrorHandler.php
+++ b/framework/Exceptions/TErrorHandler.php
@@ -207,8 +207,21 @@ class TErrorHandler extends TModule
*/
protected function displayException($exception)
{
- $lines=file($exception->getFile());
+ $fileName=$exception->getFile();
$errorLine=$exception->getLine();
+ if($exception instanceof TPhpErrorException)
+ {
+ // if PHP exception, we want to show the 2nd stack level context
+ // because the 1st stack level is of little use (it's in error handler)
+ $trace=$exception->getTrace();
+ if(isset($trace[0]) && isset($trace[0]['file']) && isset($trace[0]['line']))
+ {
+ $fileName=$trace[0]['file'];
+ $errorLine=$trace[0]['line'];
+ }
+ }
+ $lines=file($fileName);
+
$beginLine=$errorLine-self::SOURCE_LINES>=0?$errorLine-self::SOURCE_LINES:0;
$endLine=$errorLine+self::SOURCE_LINES<=count($lines)?$errorLine+self::SOURCE_LINES:count($lines);
@@ -227,7 +240,7 @@ class TErrorHandler extends TModule
$tokens=array(
'%%ErrorType%%' => get_class($exception),
'%%ErrorMessage%%' => htmlspecialchars($exception->getMessage()),
- '%%SourceFile%%' => htmlspecialchars($exception->getFile()).' ('.$exception->getLine().')',
+ '%%SourceFile%%' => htmlspecialchars($fileName).' ('.$errorLine.')',
'%%SourceCode%%' => $source,
'%%StackTrace%%' => htmlspecialchars($exception->getTraceAsString()),
'%%Version%%' => $_SERVER['SERVER_SOFTWARE'].' <a href="http://www.pradosoft.com/">PRADO</a>/'.Prado::getVersion(),