From c5983c0440913cd67f3744c7dda3c3bfc7eee0ed Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 1 May 2006 15:40:31 +0000 Subject: Merge from 3.0 branch till 1004. --- .gitattributes | 1 + HISTORY | 2 +- .../phing/tasks/BuildPradoPEARPackageTask.php | 6 +- framework/3rdParty/readme.html | 69 +++++++++++++++++++++- framework/I18N/core/data/license.txt | 35 +++++++++++ framework/Web/Javascripts/js/prado.js | 4 +- framework/Web/Javascripts/prado/element.js | 4 +- framework/Web/THttpRequest.php | 34 ++++++++--- framework/Web/UI/TTemplateManager.php | 2 +- framework/Web/UI/WebControls/TBaseValidator.php | 11 ++-- .../Web/UI/WebControls/TValidationSummary.php | 6 +- .../features/protected/pages/ValidatorEffects.page | 18 +++--- 12 files changed, 157 insertions(+), 35 deletions(-) create mode 100644 framework/I18N/core/data/license.txt 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 diff --git a/HISTORY b/HISTORY index b240e13e..6211df23 100644 --- a/HISTORY +++ b/HISTORY @@ -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. N.A. Tar.php - Version 3.0 of the PHP license + PHP License 3.0 System.IO.TTarFileExtractor TTarFileExtractor is based on Tar.php whose author is Vincent Blavet. + + ../I18N/core/data + International Components for Unicode (Locale Data) + BSD??? + System.I18N.core.* + The ICU data http://dev.icu-project.org/cgi-bin/viewcvs.cgi/icu/source/data/locales/ are PHP serialized. + + + ../I18N/core/util.php + PEAR :: Package :: DB + PHP License 3.0 + N.A. + The parseDSN() function from DB.php file. + + + ../I18N/core/TCache_Lite.php + PEAR :: Package :: Cache_Lite + LGPL + N.A. + Cache_Lite class was renamed as TCache_Lite for packaging purposes. + + + ../I18N/core/Gettext + PEAR :: Package :: File_Gettext + PHP License 3.0 + N.A. + File_Gettext, File::Gettext::MO, and File::Gettext::PO + + + + ../Web/Javascripts/TJSON.php + Service_JSON proposal + BSD + N.A. + JSON encoder/decoder by Michal Migurski, Matt Knapp and Brett Stimmerman + + + + ../Web/Javascripts/effects/rico.js + Rico + Apache License v2 + N.A. + Rico Javascript Library (not yet utilized in Prado) + + + ../Web/Javascripts/prototype + Prototype javascript library + The Prototype License (MIT based) + N.A. + Core of Prado javascript library. + + + ../Web/Javascripts/extra/logger.js + http://gleepglop.com/javascripts/logger/ http://slayeroffice.com + None + TJavascriptLogger + Javascript logger by Corey Johnson. Object Tree by S.G. Chipman. + + + + ../Web/Javascripts/extra/json.js + http://www.JSON.org + MIT based + N.A. + Has "The Software shall be used for Good, not Evil." clause. + +

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_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 OnValidate 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 OnHideSummary 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."> - + Effect.Shake(validator.control); Effect.Appear(validator.message); - - + + Effect.Fade(validator.message); - +
@@ -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." />
@@ -82,12 +82,12 @@ ID="summary2" ValidationGroup="signin" Display="Dynamic" - ClientValidation.OnHideSummary="Effect.Squish(summary.messages)" + ClientSide.OnHideSummary="Effect.Squish(summary.messages)" HeaderText="

You could not login because

"> - + Effect.Appear(summary.messages) Effect.Shake(summary.messages,{ queue: 'end'}) - +
-- cgit v1.2.3