diff options
author | xue <> | 2006-05-01 15:40:31 +0000 |
---|---|---|
committer | xue <> | 2006-05-01 15:40:31 +0000 |
commit | c5983c0440913cd67f3744c7dda3c3bfc7eee0ed (patch) | |
tree | d20f9c309cb212d309231d8a990fff11b512e973 | |
parent | ddfafaac2c1f18aca0fda3b4157acd935b9ac9a2 (diff) |
Merge from 3.0 branch till 1004.
-rw-r--r-- | .gitattributes | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | buildscripts/phing/tasks/BuildPradoPEARPackageTask.php | 6 | ||||
-rw-r--r-- | framework/3rdParty/readme.html | 69 | ||||
-rw-r--r-- | framework/I18N/core/data/license.txt | 35 | ||||
-rw-r--r-- | framework/Web/Javascripts/js/prado.js | 4 | ||||
-rw-r--r-- | framework/Web/Javascripts/prado/element.js | 4 | ||||
-rw-r--r-- | framework/Web/THttpRequest.php | 34 | ||||
-rw-r--r-- | framework/Web/UI/TTemplateManager.php | 2 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TBaseValidator.php | 11 | ||||
-rw-r--r-- | framework/Web/UI/WebControls/TValidationSummary.php | 6 | ||||
-rw-r--r-- | tests/FunctionalTests/features/protected/pages/ValidatorEffects.page | 18 |
12 files changed, 157 insertions, 35 deletions
diff --git a/.gitattributes b/.gitattributes index ea8660ec..a9170941 100644 --- a/.gitattributes +++ b/.gitattributes @@ -719,6 +719,7 @@ framework/I18N/core/data/kok.dat -text framework/I18N/core/data/kok_IN.dat -text framework/I18N/core/data/kw.dat -text framework/I18N/core/data/kw_GB.dat -text +framework/I18N/core/data/license.txt -text framework/I18N/core/data/lt.dat -text framework/I18N/core/data/lt_LT.dat -text framework/I18N/core/data/lv.dat -text @@ -25,7 +25,7 @@ ENH: TLiteral will display body content if Text is empty (Qiang) ENH: Format string in classes extending TDataGridColumn can now evaluate an expression (Qiang)
ENH: Format string in classes extending TListControl can now evaluate an expression (Qiang)
ENH: Added THttpResponse::reload() (Qiang)
-ENH: Custom visual effects can be added to client-side validators. (Wei)
+ENH: Custom visual effects can be added to client-side validators via ClientSide property in validators. (Wei)
ENH: TJavascript::encode() allows raw javascript code when string begins with "javascript:" (Wei)
ENH: Update TinyMCE to 2.0.5.1
CHG: Rewrote client-side javascript validators, check your client-side validation behaviour (Wei)
diff --git a/buildscripts/phing/tasks/BuildPradoPEARPackageTask.php b/buildscripts/phing/tasks/BuildPradoPEARPackageTask.php index 0e764146..72ad8798 100644 --- a/buildscripts/phing/tasks/BuildPradoPEARPackageTask.php +++ b/buildscripts/phing/tasks/BuildPradoPEARPackageTask.php @@ -124,9 +124,9 @@ o Team Integration - PRADO enables separation of content and presentation. Compo $package->addMaintainer('lead', 'knut', 'Knut Urdalen', 'knut.urdalen@gmail.com'); // "core" dependencies - $package->setPhpDep('5.0.0'); - $package->setPearinstallerDep('1.4.0'); - + $package->setPhpDep('5.0.4'); + $package->setPearinstallerDep('1.4.7'); + $package->generateContents(); $e = $package->writePackageFile(); diff --git a/framework/3rdParty/readme.html b/framework/3rdParty/readme.html index c81d263e..b48f5b74 100644 --- a/framework/3rdParty/readme.html +++ b/framework/3rdParty/readme.html @@ -45,10 +45,77 @@ projects. <tr>
<td>N.A.</td>
<td>Tar.php</td>
- <td><a href="http://www.php.net/license/3_0.txt">Version 3.0 of the PHP license</a></td>
+ <td><a href="http://www.php.net/license/3_0.txt">PHP License 3.0</a></td>
<td>System.IO.TTarFileExtractor</td>
<td>TTarFileExtractor is based on Tar.php whose author is Vincent Blavet.</td>
</tr>
+<tr>
+ <td><a href="../I18N/core/data">../I18N/core/data</a></td>
+ <td><a href="http://icu.sourceforge.net/">International Components for Unicode (Locale Data)</a></td>
+ <td><a href="http://dev.icu-project.org/cgi-bin/viewcvs.cgi/*checkout*/icu/license.html">BSD???</a></td>
+ <td>System.I18N.core.*</td>
+ <td>The ICU data http://dev.icu-project.org/cgi-bin/viewcvs.cgi/icu/source/data/locales/ are PHP serialized.</td>
+</tr>
+<tr>
+ <td><a href="../I18N/core/util.php">../I18N/core/util.php</a></td>
+ <td><a href="http://pear.php.net/package/DB">PEAR :: Package :: DB</a></td>
+ <td><a href="http://www.php.net/license/3_0.txt">PHP License 3.0</a></td>
+ <td>N.A.</td>
+ <td>The parseDSN() function from DB.php file.</td>
+</tr>
+<tr>
+ <td><a href="../I18N/core/TCache_Lite.php">../I18N/core/TCache_Lite.php</a></td>
+ <td><a href="http://pear.php.net/package/Cache_Lite">PEAR :: Package :: Cache_Lite</a></td>
+ <td><a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a></td>
+ <td>N.A.</td>
+ <td>Cache_Lite class was renamed as TCache_Lite for packaging purposes.</td>
+</tr>
+<tr>
+ <td><a href="../I18N/core/Gettext">../I18N/core/Gettext</a></td>
+ <td><a href="http://pear.php.net/package/File_Gettext">PEAR :: Package :: File_Gettext</a></td>
+ <td><a href="http://www.php.net/license/3_0.txt">PHP License 3.0</a></td>
+ <td>N.A.</td>
+ <td>File_Gettext, File::Gettext::MO, and File::Gettext::PO</td>
+</tr>
+
+<tr>
+ <td><a href="../Web/Javascripts/TJSON.php">../Web/Javascripts/TJSON.php</a></td>
+ <td><a href="http://pear.php.net/pepr/pepr-proposal-show.php?id=198">Service_JSON proposal</a></td>
+ <td><a href="http://www.opensource.org/licenses/bsd-license.php">BSD</a></td>
+ <td>N.A.</td>
+ <td>JSON encoder/decoder by Michal Migurski, Matt Knapp and Brett Stimmerman</td>
+</tr>
+
+<tr>
+ <td><a href="../Web/Javascripts/effects/rico.js">../Web/Javascripts/effects/rico.js</a></td>
+ <td><a href="http://openrico.org/">Rico</a></td>
+ <td><a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache License v2</a></td>
+ <td>N.A.</td>
+ <td>Rico Javascript Library (not yet utilized in Prado)</td>
+</tr>
+<tr>
+ <td><a href="../Web/Javascripts/prototype/">../Web/Javascripts/prototype</a></td>
+ <td><a href="http://dev.rubyonrails.org/browser/spinoffs/prototype">Prototype javascript library</a></td>
+ <td><a href="../Web/Javascripts/prototype/LICENSE">The Prototype License (MIT based)</a></td>
+ <td>N.A.</td>
+ <td>Core of Prado javascript library.</td>
+</tr>
+<tr>
+ <td><a href="../Web/Javascripts/extra/logger.js">../Web/Javascripts/extra/logger.js</a></td>
+ <td><a href="http://gleepglop.com/javascripts/logger/">http://gleepglop.com/javascripts/logger/</a> <a href="http://slayeroffice.com">http://slayeroffice.com</a></td>
+ <td>None</td>
+ <td>TJavascriptLogger</td>
+ <td>Javascript logger by Corey Johnson. Object Tree by S.G. Chipman.</td>
+</tr>
+
+<tr>
+ <td><a href="../Web/Javascripts/extra/json.js">../Web/Javascripts/extra/json.js</a></td>
+ <td><a href="http://www.JSON.org">http://www.JSON.org</a></td>
+ <td><a href="http://www.json.org/license.html">MIT based</a></td>
+ <td>N.A.</td>
+ <td>Has "The Software shall be used for Good, not Evil." clause.</td>
+</tr>
+
</table>
</p>
</body>
diff --git a/framework/I18N/core/data/license.txt b/framework/I18N/core/data/license.txt new file mode 100644 index 00000000..ccbd57fe --- /dev/null +++ b/framework/I18N/core/data/license.txt @@ -0,0 +1,35 @@ +ICU License - ICU 1.8.1 and later
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2005 International Business Machines Corporation and others
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
+INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
+FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+--------------------------------------------------------------------------------
+All trademarks and registered trademarks mentioned herein are the property of their respective owners.
+
diff --git a/framework/Web/Javascripts/js/prado.js b/framework/Web/Javascripts/js/prado.js index d80f984d..498a6cf7 100644 --- a/framework/Web/Javascripts/js/prado.js +++ b/framework/Web/Javascripts/js/prado.js @@ -256,7 +256,7 @@ selection[method](isList?element:el,value);},click:function(element) {var el=$(element);if(!el)return;if(document.createEvent) {var evt=document.createEvent('HTMLEvents');evt.initEvent('click',true,true);el.dispatchEvent(evt);} else if(el.fireEvent) -{el.fireEvent('onclick');if(isFunction(el.onclick)) +{el.fireEvent('onclick');if(typeof(el.onclick)=="function") el.onclick();}},setAttribute:function(element,attribute,value) {var el=$(element);if(attribute=="disabled"&&value==false) el.removeAttribute(attribute);else @@ -265,7 +265,7 @@ el.setAttribute(attribute,value);},setOptions:function(element,options) {while(el.length>0) el.remove(0);for(var i=0;i<options.length;i++) el.options[el.options.length]=new Option(options[i][0],options[i][1]);}},focus:function(element) -{var obj=$(element);if(isObject(obj)&&isdef(obj.focus)) +{var obj=$(element);if(typeof(obj)!="undefined"&&typeof(obj.focus)!="undefined") setTimeout(function(){obj.focus();},100);return false;}} Prado.Element.Selection={inputValue:function(el,value) {switch(el.type.toLowerCase()) diff --git a/framework/Web/Javascripts/prado/element.js b/framework/Web/Javascripts/prado/element.js index fc84e4b1..06937253 100644 --- a/framework/Web/Javascripts/prado/element.js +++ b/framework/Web/Javascripts/prado/element.js @@ -38,7 +38,7 @@ Prado.Element = else if(el.fireEvent)
{
el.fireEvent('onclick');
- if(isFunction(el.onclick))
+ if(typeof(el.onclick) == "function")
el.onclick();
}
},
@@ -71,7 +71,7 @@ Prado.Element = focus : function(element)
{
var obj = $(element);
- if(isObject(obj) && isdef(obj.focus))
+ if(typeof(obj) != "undefined" && typeof(obj.focus) != "undefined")
setTimeout(function(){ obj.focus(); }, 100);
return false;
}
diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index 5ec09fc9..71237fa1 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -161,10 +161,13 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar $paths=explode('/',$pathInfo);
$n=count($paths);
$getVariables=array();
- for($i=0;$i<$n;++$i)
+ for($i=0;$i<$n-1;++$i)
{
- if($i+1<$n)
- $getVariables[$paths[$i]]=$paths[++$i];
+ $name=$paths[$i];
+ if(($pos=strpos($name,'[]'))!==false)
+ $getVariables[substr($name,0,$pos)][]=$paths[++$i];
+ else
+ $getVariables[$name]=$paths[++$i];
}
$this->_items=array_merge($getVariables,array_merge($_GET,$_POST));
}
@@ -452,24 +455,41 @@ class THttpRequest extends TApplicationComponent implements IteratorAggregate,Ar if($encodeGetItems)
{
foreach($getItems as $name=>$value)
- $url.=$amp.urlencode($name).'='.urlencode($value);
+ {
+ if(is_array($value))
+ {
+ $name=urlencode($name.'[]');
+ foreach($value as $v)
+ $url.=$amp.$name.'='.$v;
+ }
+ else
+ $url.=$amp.urlencode($name).'='.urlencode($value);
+ }
}
else
{
foreach($getItems as $name=>$value)
- $url.=$amp.$name.'='.$value;
+ {
+ if(is_array($value))
+ {
+ foreach($value as $v)
+ $url.=$amp.$name.'[]='.$v;
+ }
+ else
+ $url.=$amp.$name.'='.$value;
+ }
}
}
if($this->getUrlFormat()==='Path')
{
$url=strtr($url,array($amp=>'/','?'=>'/','='=>'/'));
- if(defined('SID') && SID != '')
+ if(defined('SID') && SID != '' && !((int)ini_get('session.use_cookies')===1 && ((int)ini_get('session.use_only_cookies')===1)))
$url.='?'.SID;
return $this->getApplicationUrl().'/'.$url;
}
else
{
- if(defined('SID') && SID != '')
+ if(defined('SID') && SID != '' && !((int)ini_get('session.use_cookies')===1 && ((int)ini_get('session.use_only_cookies')===1)))
$url.=$amp.SID;
return $this->getApplicationUrl().'?'.$url;
}
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php index 5f75caf3..eac7c157 100644 --- a/framework/Web/UI/TTemplateManager.php +++ b/framework/Web/UI/TTemplateManager.php @@ -158,7 +158,7 @@ class TTemplate extends TApplicationComponent implements ITemplate * '<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>' - directives
* '<%[%#~\\$=\\[](.*?)%>' - expressions
*/
- const REGEX_RULES='/<!.*?!>|<!--.*?-->|<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>/msS';
+ const REGEX_RULES='/<!--.*?--!>|<!--.*?-->|<\/?com:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>/msS';
/**
* Different configurations of component property/event/attribute
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php index a63941db..ea1a5836 100644 --- a/framework/Web/UI/WebControls/TBaseValidator.php +++ b/framework/Web/UI/WebControls/TBaseValidator.php @@ -42,7 +42,7 @@ * be displayed. Error display is controlled by {@link setDisplay Display} property. * * You can also customized the client-side behaviour by adding javascript - * code to the subproperties of the {@link getClientValidation ClientValidation} + * code to the subproperties of the {@link getClientSide ClientSide} * property. See quickstart documentation for further details. * * You can also place a {@link TValidationSummary} control on a page to display error messages @@ -176,7 +176,7 @@ abstract class TBaseValidator extends TLabel implements IValidator * * @return TValidatorClientScript javascript validator event options. */ - public function getClientValidation() + public function getClientSide() { if(is_null($this->_clientScript)) $this->_clientScript = $this->createClientScript(); @@ -494,10 +494,9 @@ abstract class TBaseValidator extends TLabel implements IValidator * TValidatorClientScript class. * * Client-side validator events can be modified through the {@link - * TBaseValidator::getClientValidation ClientValidation} property of a - * validator. The subproperties of ClientValidation are those of the - * TValidatorClientScript properties. The client-side validator supports the - * following events. + * TBaseValidator::getClientSide ClientSide} property of a validator. The + * subproperties of ClientSide are those of the TValidatorClientScript + * properties. The client-side validator supports the following events. * * The <tt>OnValidate</tt> event is raise before the validator validation * functions are called. diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php index aa46142b..87821292 100644 --- a/framework/Web/UI/WebControls/TValidationSummary.php +++ b/framework/Web/UI/WebControls/TValidationSummary.php @@ -258,7 +258,7 @@ class TValidationSummary extends TWebControl * @return TValidationSummaryClientScript client-side validation summary
* event options.
*/
- public function getClientValidation()
+ public function getClientSide()
{
if(is_null($this->_clientScript))
$this->_clientScript = $this->createClientScript();
@@ -376,8 +376,8 @@ class TValidationSummary extends TWebControl *
* Client-side validation summary events such as {@link setOnHideSummary
* OnHideSummary} and {@link setOnShowSummary OnShowSummary} can be modified
- * through the {@link TBaseValidator:: getClientValidation ClientValidation}
- * property of a validation summary.
+ * through the {@link TBaseValidator:: getClientSide ClientSide} property of a
+ * validation summary.
*
* The <tt>OnHideSummary</tt> event is raise when the validation summary
* requests to hide the messages.
diff --git a/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page index da03f9b8..1a97a249 100644 --- a/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page +++ b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page @@ -16,13 +16,13 @@ ControlCssClass="required"
Display="Dynamic"
ErrorMessage="a username is required.">
- <prop:ClientValidation.OnError>
+ <prop:ClientSide.OnError>
Effect.Shake(validator.control);
Effect.Appear(validator.message);
- </prop:ClientValidation.OnError>
- <prop:ClientValidation.OnSuccess>
+ </prop:ClientSide.OnError>
+ <prop:ClientSide.OnSuccess>
Effect.Fade(validator.message);
- </prop:ClientValidation.OnSuccess>
+ </prop:ClientSide.OnSuccess>
</com:TRequiredFieldValidator>
</div>
<div class="password">
@@ -37,8 +37,8 @@ ValidationGroup="registration"
ControlCssClass="required"
Display="Dynamic"
- ClientValidation.OnError="validator.message.visualEffect('appear')"
- ClientValidation.OnSuccess="validator.message.visualEffect('fade')"
+ ClientSide.OnError="validator.message.visualEffect('appear')"
+ ClientSide.OnSuccess="validator.message.visualEffect('fade')"
ErrorMessage="a password is required." />
</div>
<div class="create">
@@ -82,12 +82,12 @@ ID="summary2"
ValidationGroup="signin"
Display="Dynamic"
- ClientValidation.OnHideSummary="Effect.Squish(summary.messages)"
+ ClientSide.OnHideSummary="Effect.Squish(summary.messages)"
HeaderText="<p>You could not login because</p>">
- <prop:ClientValidation.OnShowSummary>
+ <prop:ClientSide.OnShowSummary>
Effect.Appear(summary.messages)
Effect.Shake(summary.messages,{ queue: 'end'})
- </prop:ClientValidation.OnShowSummary>
+ </prop:ClientSide.OnShowSummary>
</com:TValidationSummary>
</div>
|