summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchristophe.boulain <>2008-12-03 14:22:03 +0000
committerchristophe.boulain <>2008-12-03 14:22:03 +0000
commit6228873cf9d6471463d2413e7dfd7447f759baf2 (patch)
tree496a0e658330c39d4caa35602ba9f783b6f24f9c
parente8f239fea7351b248302a593a8e5eaa2a88c3e80 (diff)
Merge from trunk
-rw-r--r--.gitattributes41
-rw-r--r--.gitignore2
-rw-r--r--HISTORY56
-rw-r--r--UPGRADE353
-rw-r--r--demos/personal/protected/Pages/Settings.page2
-rw-r--r--demos/personal/protected/Pages/config.php6
-rw-r--r--demos/personal/protected/application.php2
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/DragDrop.page26
-rw-r--r--demos/quickstart/protected/pages/ActiveControls/Home.page22
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.page90
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php112
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product1.pngbin0 -> 10711 bytes
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product2.pngbin0 -> 9550 bytes
-rwxr-xr-xdemos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/trash.pngbin0 -> 783 bytes
-rw-r--r--demos/quickstart/protected/pages/Configurations/Templates2.page14
-rw-r--r--demos/quickstart/protected/pages/Configurations/UrlMapping.page5
-rw-r--r--demos/quickstart/protected/pages/Database/ActiveRecord.page15
-rw-r--r--demos/quickstart/protected/pages/GettingStarted/NewFeatures.page8
-rw-r--r--framework/3rdParty/TinyMCE/tiny_mce.md52
-rw-r--r--framework/3rdParty/TinyMCE/tiny_mce.tarbin3645440 -> 3880960 bytes
-rw-r--r--framework/Caching/TAPCCache.php1
-rw-r--r--framework/Caching/TCache.php20
-rw-r--r--framework/Caching/TMemCache.php1
-rw-r--r--framework/Caching/TSqliteCache.php1
-rw-r--r--framework/Collections/TAttributeCollection.php1
-rw-r--r--framework/Collections/TDummyDataSource.php1
-rw-r--r--framework/Collections/TList.php1
-rw-r--r--framework/Collections/TMap.php1
-rw-r--r--framework/Collections/TPagedDataSource.php1
-rw-r--r--framework/Collections/TPagedList.php1
-rw-r--r--framework/Collections/TQueue.php1
-rw-r--r--framework/Collections/TStack.php1
-rw-r--r--framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php1
-rw-r--r--framework/Data/ActiveRecord/Exceptions/messages.txt3
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php1
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php1
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php1
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php1
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php1
-rw-r--r--framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php1
-rw-r--r--framework/Data/ActiveRecord/Scaffold/TScaffoldView.php1
-rw-r--r--framework/Data/ActiveRecord/TActiveRecord.php29
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordConfig.php1
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordCriteria.php1
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordGateway.php839
-rw-r--r--framework/Data/ActiveRecord/TActiveRecordManager.php1
-rw-r--r--framework/Data/Common/IbmDb2/TIbmColumnMetaData.php1
-rw-r--r--framework/Data/Common/IbmDb2/TIbmMetaData.php1
-rw-r--r--framework/Data/Common/IbmDb2/TIbmMetaDataInspector.php1
-rw-r--r--framework/Data/Common/Mssql/TMssqlCommandBuilder.php1
-rw-r--r--framework/Data/Common/Mssql/TMssqlMetaData.php1
-rw-r--r--framework/Data/Common/Mssql/TMssqlTableColumn.php1
-rw-r--r--framework/Data/Common/Mssql/TMssqlTableInfo.php1
-rw-r--r--framework/Data/Common/Mysql/TMysqlCommandBuilder.php1
-rw-r--r--framework/Data/Common/Mysql/TMysqlMetaData.php5
-rw-r--r--framework/Data/Common/Mysql/TMysqlTableColumn.php1
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php1
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlMetaData.php1
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlTableColumn.php1
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlTableInfo.php1
-rw-r--r--framework/Data/Common/Sqlite/TSqliteCommandBuilder.php1
-rw-r--r--framework/Data/Common/Sqlite/TSqliteMetaData.php1
-rw-r--r--framework/Data/Common/Sqlite/TSqliteTableColumn.php1
-rw-r--r--framework/Data/Common/Sqlite/TSqliteTableInfo.php1
-rw-r--r--framework/Data/Common/TDbMetaData.php1
-rw-r--r--framework/Data/Common/TDbTableColumn.php1
-rw-r--r--framework/Data/Common/TDbTableInfo.php1
-rw-r--r--framework/Data/DataGateway/TTableGateway.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TDiscriminator.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php3
-rw-r--r--framework/Data/SqlMap/Configuration/TParameterMap.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TParameterProperty.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TResultMap.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TResultProperty.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapStatement.php1
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php15
-rw-r--r--framework/Data/SqlMap/DataMapper/TLazyLoadList.php1
-rw-r--r--framework/Data/SqlMap/DataMapper/TPropertyAccess.php3
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapCache.php1
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapException.php1
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php1
-rw-r--r--framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php1
-rw-r--r--framework/Data/SqlMap/Statements/IMappedStatement.php1
-rw-r--r--framework/Data/SqlMap/Statements/TCachingStatement.php1
-rw-r--r--framework/Data/SqlMap/Statements/TDeleteMappedStatement.php1
-rw-r--r--framework/Data/SqlMap/Statements/TInsertMappedStatement.php1
-rw-r--r--framework/Data/SqlMap/Statements/TMappedStatement.php7
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedCommand.php1
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedStatement.php1
-rw-r--r--framework/Data/SqlMap/Statements/TPreparedStatementFactory.php1
-rw-r--r--framework/Data/SqlMap/Statements/TSelectMappedStatement.php1
-rw-r--r--framework/Data/SqlMap/Statements/TSimpleDynamicSql.php1
-rw-r--r--framework/Data/SqlMap/Statements/TStaticSql.php1
-rw-r--r--framework/Data/SqlMap/Statements/TUpdateMappedStatement.php1
-rw-r--r--framework/Data/SqlMap/TSqlMapConfig.php1
-rw-r--r--framework/Data/SqlMap/TSqlMapGateway.php1
-rw-r--r--framework/Data/SqlMap/TSqlMapManager.php1
-rw-r--r--framework/Data/TDataSourceConfig.php2
-rw-r--r--framework/Data/TDbCommand.php1
-rw-r--r--framework/Data/TDbConnection.php6
-rw-r--r--framework/Data/TDbDataReader.php1
-rw-r--r--framework/Data/TDbTransaction.php1
-rw-r--r--framework/Exceptions/TErrorHandler.php1
-rw-r--r--framework/Exceptions/TException.php1
-rw-r--r--framework/Exceptions/messages/messages.txt7
-rw-r--r--framework/I18N/TDateFormat.php41
-rw-r--r--framework/I18N/TGlobalizationAutoDetect.php1
-rw-r--r--framework/I18N/TI18NControl.php1
-rw-r--r--framework/I18N/TNumberFormat.php29
-rw-r--r--framework/I18N/TTranslate.php1
-rw-r--r--framework/I18N/TTranslateParameter.php1
-rw-r--r--framework/I18N/Translation.php1
-rw-r--r--framework/I18N/core/CultureInfo.php1
-rw-r--r--framework/I18N/core/DateTimeFormatInfo.php1
-rw-r--r--framework/I18N/core/Gettext/MO.php1
-rw-r--r--framework/I18N/core/Gettext/PO.php1
-rw-r--r--framework/I18N/core/Gettext/TGettext.php1
-rw-r--r--framework/I18N/core/HTTPNegotiator.php1
-rw-r--r--framework/I18N/core/IMessageSource.php1
-rw-r--r--framework/I18N/core/MessageFormat.php1
-rw-r--r--framework/I18N/core/MessageSource_XLIFF.php2
-rw-r--r--framework/I18N/core/NumberFormat.php1
-rw-r--r--framework/I18N/core/NumberFormatInfo.php1
-rw-r--r--framework/IO/TTextWriter.php1
-rw-r--r--framework/PradoBase.php5
-rw-r--r--framework/Security/IUserManager.php1
-rw-r--r--framework/Security/TAuthManager.php61
-rw-r--r--framework/Security/TAuthorizationRule.php1
-rw-r--r--framework/Security/TDbUserManager.php1
-rw-r--r--framework/Security/TSecurityManager.php1
-rw-r--r--framework/Security/TUser.php1
-rw-r--r--framework/Security/TUserManager.php2
-rw-r--r--framework/TApplication.php36
-rw-r--r--framework/TApplicationComponent.php1
-rw-r--r--framework/TComponent.php1
-rw-r--r--framework/TModule.php1
-rw-r--r--framework/TService.php1
-rw-r--r--framework/TShellApplication.php1
-rw-r--r--framework/Util/TDataFieldAccessor.php1
-rw-r--r--framework/Util/TLogRouter.php21
-rw-r--r--framework/Util/TLogger.php1
-rw-r--r--framework/Util/TParameterModule.php1
-rw-r--r--framework/Util/TVarDumper.php1
-rw-r--r--framework/Web/Javascripts/TJavaScript.php1
-rw-r--r--framework/Web/Javascripts/source/packages.php36
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js749
-rwxr-xr-xframework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js79
-rwxr-xr-xframework/Web/Javascripts/source/prado/activecontrols/dragdrop.js24
-rw-r--r--framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js2
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html1
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.pngbin0 -> 663 bytes
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.pngbin0 -> 589 bytes
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gifbin0 -> 1553 bytes
-rwxr-xr-xframework/Web/Javascripts/source/prado/activefileupload/activefileupload.js63
-rw-r--r--framework/Web/Javascripts/source/prado/activeratings/blocks.css42
-rw-r--r--framework/Web/Javascripts/source/prado/activeratings/default.css43
-rw-r--r--framework/Web/Javascripts/source/prado/activeratings/ratings.js178
-rw-r--r--framework/Web/Javascripts/source/prado/controls/controls.js19
-rw-r--r--framework/Web/Javascripts/source/prado/datepicker/datepicker.js21
-rw-r--r--framework/Web/Javascripts/source/prado/ratings/ratings.js207
-rw-r--r--framework/Web/Javascripts/source/prado/validator/validation3.js13
-rw-r--r--framework/Web/Javascripts/source/scriptaculous-1.8.1/dragdrop.js2
-rw-r--r--framework/Web/Services/TFeedService.php1
-rw-r--r--framework/Web/Services/TJsonService.php2
-rw-r--r--framework/Web/Services/TSoapService.php1
-rw-r--r--framework/Web/TAssetManager.php9
-rw-r--r--framework/Web/TCacheHttpSession.php1
-rw-r--r--framework/Web/THttpRequest.php1
-rw-r--r--framework/Web/THttpResponse.php1
-rw-r--r--framework/Web/THttpSession.php1
-rw-r--r--framework/Web/THttpUtility.php1
-rw-r--r--framework/Web/TUrlManager.php1
-rw-r--r--framework/Web/TUrlMapping.php50
-rw-r--r--framework/Web/UI/ActiveControls/TActiveButton.php1
-rw-r--r--framework/Web/UI/ActiveControls/TActiveControlAdapter.php9
-rw-r--r--framework/Web/UI/ActiveControls/TActiveCustomValidator.php1
-rwxr-xr-xframework/Web/UI/ActiveControls/TActiveDatePicker.php129
-rwxr-xr-xframework/Web/UI/ActiveControls/TActiveFileUpload.php315
-rw-r--r--framework/Web/UI/ActiveControls/TActiveHiddenField.php1
-rw-r--r--framework/Web/UI/ActiveControls/TActiveLabel.php10
-rw-r--r--framework/Web/UI/ActiveControls/TActiveLinkButton.php5
-rw-r--r--framework/Web/UI/ActiveControls/TActivePageAdapter.php9
-rw-r--r--framework/Web/UI/ActiveControls/TActivePager.php9
-rw-r--r--framework/Web/UI/ActiveControls/TActivePanel.php1
-rw-r--r--framework/Web/UI/ActiveControls/TActiveRadioButtonList.php6
-rw-r--r--framework/Web/UI/ActiveControls/TActiveRatingList.php344
-rw-r--r--framework/Web/UI/ActiveControls/TActiveTextBox.php1
-rw-r--r--framework/Web/UI/ActiveControls/TAutoComplete.php9
-rw-r--r--framework/Web/UI/ActiveControls/TBaseActiveControl.php5
-rw-r--r--framework/Web/UI/ActiveControls/TCallback.php1
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackClientScript.php1
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackClientSide.php1
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackEventParameter.php1
-rw-r--r--framework/Web/UI/ActiveControls/TCallbackOptions.php1
-rwxr-xr-xframework/Web/UI/ActiveControls/TDraggable.php152
-rwxr-xr-xframework/Web/UI/ActiveControls/TDropContainer.php275
-rw-r--r--framework/Web/UI/ActiveControls/TEventTriggeredCallback.php1
-rw-r--r--framework/Web/UI/ActiveControls/TInPlaceTextBox.php1
-rw-r--r--framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php24
-rw-r--r--framework/Web/UI/ActiveControls/TTriggeredCallback.php1
-rw-r--r--framework/Web/UI/ActiveControls/TValueTriggeredCallback.php1
-rw-r--r--framework/Web/UI/TCachePageStatePersister.php1
-rw-r--r--framework/Web/UI/TClientScriptManager.php10
-rw-r--r--framework/Web/UI/TCompositeControl.php1
-rw-r--r--framework/Web/UI/TControl.php8
-rw-r--r--framework/Web/UI/TControlAdapter.php1
-rw-r--r--framework/Web/UI/TForm.php1
-rw-r--r--framework/Web/UI/THtmlWriter.php1
-rw-r--r--framework/Web/UI/TPage.php8
-rw-r--r--framework/Web/UI/TPageStatePersister.php1
-rw-r--r--framework/Web/UI/TSessionPageStatePersister.php1
-rw-r--r--framework/Web/UI/TTemplateControl.php1
-rw-r--r--framework/Web/UI/TTemplateManager.php9
-rw-r--r--framework/Web/UI/WebControls/TBaseDataList.php1
-rw-r--r--framework/Web/UI/WebControls/TBaseValidator.php15
-rw-r--r--framework/Web/UI/WebControls/TBoundColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TBulletedList.php1
-rw-r--r--framework/Web/UI/WebControls/TButton.php1
-rw-r--r--framework/Web/UI/WebControls/TButtonColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TCaptcha.php1
-rw-r--r--framework/Web/UI/WebControls/TCaptchaValidator.php1
-rw-r--r--framework/Web/UI/WebControls/TCheckBox.php18
-rw-r--r--framework/Web/UI/WebControls/TCheckBoxColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TCheckBoxList.php19
-rw-r--r--framework/Web/UI/WebControls/TClientScript.php1
-rw-r--r--framework/Web/UI/WebControls/TClientScriptLoader.php1
-rw-r--r--framework/Web/UI/WebControls/TColorPicker.php4
-rw-r--r--framework/Web/UI/WebControls/TCompareValidator.php1
-rw-r--r--framework/Web/UI/WebControls/TConditional.php1
-rw-r--r--framework/Web/UI/WebControls/TContent.php1
-rw-r--r--framework/Web/UI/WebControls/TContentPlaceHolder.php1
-rw-r--r--framework/Web/UI/WebControls/TCustomValidator.php26
-rw-r--r--framework/Web/UI/WebControls/TDataGrid.php1
-rw-r--r--framework/Web/UI/WebControls/TDataGridColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TDataGridItemRenderer.php1
-rw-r--r--framework/Web/UI/WebControls/TDataGridPagerStyle.php1
-rw-r--r--framework/Web/UI/WebControls/TDataList.php1
-rw-r--r--framework/Web/UI/WebControls/TDataListItemRenderer.php1
-rw-r--r--framework/Web/UI/WebControls/TDataRenderer.php1
-rw-r--r--framework/Web/UI/WebControls/TDataSourceControl.php1
-rw-r--r--framework/Web/UI/WebControls/TDataSourceView.php1
-rw-r--r--framework/Web/UI/WebControls/TDataTypeValidator.php1
-rw-r--r--framework/Web/UI/WebControls/TDatePicker.php46
-rw-r--r--framework/Web/UI/WebControls/TDropDownList.php19
-rw-r--r--framework/Web/UI/WebControls/TDropDownListColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TEditCommandColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TEmailAddressValidator.php1
-rw-r--r--framework/Web/UI/WebControls/TExpression.php1
-rw-r--r--framework/Web/UI/WebControls/TFileUpload.php20
-rw-r--r--framework/Web/UI/WebControls/TFont.php1
-rw-r--r--framework/Web/UI/WebControls/THead.php21
-rw-r--r--framework/Web/UI/WebControls/THiddenField.php19
-rw-r--r--framework/Web/UI/WebControls/THtmlArea.php1
-rw-r--r--framework/Web/UI/WebControls/THyperLink.php1
-rw-r--r--framework/Web/UI/WebControls/THyperLinkColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TImage.php1
-rw-r--r--framework/Web/UI/WebControls/TImageMap.php1
-rw-r--r--framework/Web/UI/WebControls/TInlineFrame.php1
-rw-r--r--framework/Web/UI/WebControls/TItemDataRenderer.php1
-rw-r--r--framework/Web/UI/WebControls/TJavascriptLogger.php1
-rw-r--r--framework/Web/UI/WebControls/TKeyboard.php1
-rw-r--r--framework/Web/UI/WebControls/TLabel.php1
-rw-r--r--framework/Web/UI/WebControls/TLinkButton.php1
-rw-r--r--framework/Web/UI/WebControls/TListBox.php19
-rw-r--r--framework/Web/UI/WebControls/TListControlValidator.php1
-rw-r--r--framework/Web/UI/WebControls/TListItem.php1
-rw-r--r--framework/Web/UI/WebControls/TLiteral.php1
-rw-r--r--framework/Web/UI/WebControls/TLiteralColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TMarkdown.php1
-rw-r--r--framework/Web/UI/WebControls/TMultiView.php1
-rw-r--r--framework/Web/UI/WebControls/TOutputCache.php1
-rw-r--r--framework/Web/UI/WebControls/TPager.php1
-rw-r--r--framework/Web/UI/WebControls/TPanel.php1
-rw-r--r--framework/Web/UI/WebControls/TPanelStyle.php1
-rw-r--r--framework/Web/UI/WebControls/TPlaceHolder.php1
-rw-r--r--framework/Web/UI/WebControls/TRadioButton.php1
-rw-r--r--framework/Web/UI/WebControls/TRadioButtonList.php1
-rw-r--r--framework/Web/UI/WebControls/TRangeValidator.php1
-rw-r--r--framework/Web/UI/WebControls/TRatingList.php348
-rw-r--r--framework/Web/UI/WebControls/TRegularExpressionValidator.php21
-rw-r--r--framework/Web/UI/WebControls/TRepeatInfo.php1
-rw-r--r--framework/Web/UI/WebControls/TRepeater.php1
-rw-r--r--framework/Web/UI/WebControls/TRepeaterItemRenderer.php1
-rw-r--r--framework/Web/UI/WebControls/TRequiredFieldValidator.php1
-rw-r--r--framework/Web/UI/WebControls/TSafeHtml.php1
-rw-r--r--framework/Web/UI/WebControls/TSlider.php7
-rw-r--r--framework/Web/UI/WebControls/TStatements.php1
-rw-r--r--framework/Web/UI/WebControls/TStyle.php1
-rw-r--r--framework/Web/UI/WebControls/TTable.php1
-rw-r--r--framework/Web/UI/WebControls/TTableCell.php1
-rw-r--r--framework/Web/UI/WebControls/TTableFooterRow.php1
-rw-r--r--framework/Web/UI/WebControls/TTableHeaderCell.php1
-rw-r--r--framework/Web/UI/WebControls/TTableHeaderRow.php1
-rw-r--r--framework/Web/UI/WebControls/TTableRow.php1
-rw-r--r--framework/Web/UI/WebControls/TTemplateColumn.php1
-rw-r--r--framework/Web/UI/WebControls/TTextBox.php19
-rw-r--r--framework/Web/UI/WebControls/TTextHighlighter.php1
-rw-r--r--framework/Web/UI/WebControls/TTextProcessor.php1
-rw-r--r--framework/Web/UI/WebControls/TValidationSummary.php1
-rw-r--r--framework/Web/UI/WebControls/TWebControl.php1
-rw-r--r--framework/Web/UI/WebControls/TWebControlAdapter.php1
-rw-r--r--framework/Web/UI/WebControls/TWizard.php1
-rw-r--r--framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php1
-rw-r--r--framework/Web/UI/WebControls/TXmlTransform.php1
-rw-r--r--framework/Web/UI/WebControls/assets/captcha.php1
-rw-r--r--framework/Xml/TXmlDocument.php1
-rw-r--r--framework/interfaces.php1
-rw-r--r--framework/prado.php1
-rw-r--r--index.html344
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page17
-rwxr-xr-xtests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php42
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page14
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php27
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page16
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php27
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page12
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php23
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page17
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php37
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page14
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php27
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page17
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php32
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page17
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php38
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page17
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php32
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/RatingList.page13
-rwxr-xr-xtests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php97
-rw-r--r--tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php253
-rw-r--r--tests/FunctionalTests/tickets/protected/application.xml3
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php11
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket900.page45
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket900.php58
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket922.page12
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket922.php13
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket925.page11
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket925.php76
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket595TestCase.php4
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket900TestCase.php19
-rw-r--r--tests/FunctionalTests/tickets/tests/Ticket922TestCase.php18
354 files changed, 4774 insertions, 2245 deletions
diff --git a/.gitattributes b/.gitattributes
index 3b7e0920..eeda95c0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1282,8 +1282,13 @@ demos/quickstart/protected/pages/ActiveControls/ActiveCustomValidator.page -text
demos/quickstart/protected/pages/ActiveControls/ActiveHyperLink.page -text
demos/quickstart/protected/pages/ActiveControls/ActivePager.page -text
demos/quickstart/protected/pages/ActiveControls/AutoComplete.page -text
+demos/quickstart/protected/pages/ActiveControls/DragDrop.page -text
demos/quickstart/protected/pages/ActiveControls/Home.page -text
demos/quickstart/protected/pages/ActiveControls/Introduction.page -text
+demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.page -text
+demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product1.png -text svneol=unset#image/png
+demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product2.png -text svneol=unset#image/png
+demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/trash.png -text svneol=unset#image/png
demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.page -text
demos/quickstart/protected/pages/ActiveControls/Samples/TActiveButton/Home.php -text
demos/quickstart/protected/pages/ActiveControls/Samples/TActiveCheckBox/Home.page -text
@@ -2522,22 +2527,26 @@ framework/Web/Javascripts/TJavaScript.php -text
framework/Web/Javascripts/clientscripts.php -text
framework/Web/Javascripts/source/packages.php -text
framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js -text
+framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js -text
framework/Web/Javascripts/source/prado/activecontrols/ajax3.js -text
+framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js -text
framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js -text
framework/Web/Javascripts/source/prado/activecontrols/json.js -text
-framework/Web/Javascripts/source/prado/activeratings/blocks.css -text
+framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html -text
+framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png -text svneol=unset#image/png
+framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png -text svneol=unset#image/png
+framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif -text
+framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js -text
framework/Web/Javascripts/source/prado/activeratings/blocks.png -text
framework/Web/Javascripts/source/prado/activeratings/blocks_blank.gif -text
framework/Web/Javascripts/source/prado/activeratings/blocks_combined.gif -text
framework/Web/Javascripts/source/prado/activeratings/blocks_half.gif -text
framework/Web/Javascripts/source/prado/activeratings/blocks_selected.gif -text
-framework/Web/Javascripts/source/prado/activeratings/default.css -text
framework/Web/Javascripts/source/prado/activeratings/default.png -text
framework/Web/Javascripts/source/prado/activeratings/default_blank.gif -text
framework/Web/Javascripts/source/prado/activeratings/default_combined.gif -text
framework/Web/Javascripts/source/prado/activeratings/default_half.gif -text
framework/Web/Javascripts/source/prado/activeratings/default_selected.gif -text
-framework/Web/Javascripts/source/prado/activeratings/ratings.js -text
framework/Web/Javascripts/source/prado/colorpicker/background.png -text
framework/Web/Javascripts/source/prado/colorpicker/button.gif -text
framework/Web/Javascripts/source/prado/colorpicker/colorpicker.js -text
@@ -2757,6 +2766,8 @@ tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag
tests/FunctionalTests/active-controls/protected/pages/ActiveControlExpressionTag.php -text
tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.page -text
tests/FunctionalTests/active-controls/protected/pages/ActiveControlWithTinyMce.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php -text
tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.page -text
tests/FunctionalTests/active-controls/protected/pages/ActiveHiddenFieldTest.php -text
tests/FunctionalTests/active-controls/protected/pages/ActiveImageButtonTest.page -text
@@ -2773,6 +2784,22 @@ tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.
tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonListTest.php -text
tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.page -text
tests/FunctionalTests/active-controls/protected/pages/ActiveRadioButtonTest.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page -text
+tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php -text
tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.page -text
tests/FunctionalTests/active-controls/protected/pages/ActiveRedirectionTest.php -text
tests/FunctionalTests/active-controls/protected/pages/Callback.page -text
@@ -2862,6 +2889,7 @@ tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php -text
tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php -text
tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php -text
tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php -text
+tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php -text
tests/FunctionalTests/features.php -text
tests/FunctionalTests/features/index.php -text
tests/FunctionalTests/features/protected/application.xml -text
@@ -3097,6 +3125,11 @@ tests/FunctionalTests/tickets/protected/pages/Ticket886.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket886.php -text
tests/FunctionalTests/tickets/protected/pages/Ticket897.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket897.php -text
+tests/FunctionalTests/tickets/protected/pages/Ticket900.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket900.php -text
+tests/FunctionalTests/tickets/protected/pages/Ticket922.page -text
+tests/FunctionalTests/tickets/protected/pages/Ticket922.php -text
+tests/FunctionalTests/tickets/protected/pages/Ticket925.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket93.page -text
tests/FunctionalTests/tickets/protected/pages/Ticket93.php -text
tests/FunctionalTests/tickets/protected/pages/ToggleTest.page -text
@@ -3164,6 +3197,8 @@ tests/FunctionalTests/tickets/tests/Ticket823TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket876TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket886TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket897TestCase.php -text
+tests/FunctionalTests/tickets/tests/Ticket900TestCase.php -text
+tests/FunctionalTests/tickets/tests/Ticket922TestCase.php -text
tests/FunctionalTests/tickets/tests/Ticket93TestCase.php -text
tests/FunctionalTests/validators.php -text
tests/FunctionalTests/validators/index.php -text
diff --git a/.gitignore b/.gitignore
index de444e61..8f33048c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
+/.cache
/.project
+/.settings
/assets
buildscripts/chmbuilder/assets/*
buildscripts/chmbuilder/classes/runtime/*
diff --git a/HISTORY b/HISTORY
index 7c515716..136366a7 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,33 +1,79 @@
-Version 3.1.3 To Be Released
-============================
+Version 3.1.4 To be released
+==============================
+BUG: Issue#59 - TPropertyAccess::has() returns false even if the property of an object was found (Carl)
+BUG: Issue#61 - TLogRouter throws exception when using external config file (Michael)
+BUG: Issue#62 - Some mistyping: TJavascript or TJavaScript? (Carl)
+BUG: Issue#79 - Missing new operator for Exception in TSqlMapObjectCollectionTree::onChildNodesVisited() (Christophe)
+BUG: TActiveLinkButton and TActiveRadioButtonList crashes if it's the only active control imported. Added TActiveControlAdapter (Carl)
+BUG: TUrlMapping encoded extra parameters twice (Michael)
+ENH: Issue#36 - Refactored TRatingList/TActiveRatingList, and added some docs (Bradley)
+ENH: Issue#52 - Upgraded to TinyMCE 3.2.1
+ENH: Issue#72 - Add wildcard support to TUrlMapping (friendly-urls) (Michael)
+ENH: Issue#77 - TJsonService missing exception messages (Carl)
+ENH: Issue#29 - Ability to specify position of popup TDatePicker/TActiveDatePicker (Carl)
+ENH: Issue#75 - TApplication::setRuntimePath() to update uniqueID and cacheFile (Carl)
+NEW: Issue#51 - Additional template tag (Carl)
+
+Version 3.1.3 November 1, 2008
+==============================
+BUG: Ticket#595 - ControlCssClass not applied correctly if using multiple validators on same control (Michael)
BUG: Ticket#834 - TDbCommandBuilder::applyOrdering(): Add support for function calls in ORDER BY clause (Knut)
BUG: Ticket#836 - TRatingList downgrade (Christophe)
BUG: Ticket#841 - Strange output from THttpResponse (Christophe)
BUG: Ticket#847 - getBaseUrl sometimes fails (Christophe)
BUG: Ticket#843 - TDataList alternatinItem issue after changes in rev 2227 (Christophe)
+BUG: Ticket#845 - TCaptchaValidator with TCaptcha.CaseSensitive=false JS Error (Christophe)
BUG: Ticket#849 - TDatePicker selecting current date problem (Christophe)
BUG: Ticket#851 - TPropertyAccess doesn't get properties right if an object has a __call() method (Simon Lehmann, Knut)
BUG: Ticket#855 - TActiveRecord: Make db-connection serializable in __sleep() function (Knut)
+BUG: Ticket#856 - Assets PRADO_CHMOD constant missing in several places (Carl)
BUG: Ticket#859 - errorhandler error (stever)
BUG: Ticket#860 - Prado::localize() bug (japplegame)
+BUG: Ticket#865 - TActiveLabels always get an id attribute (Michael)
BUG: Ticket#870 - Callback with redirect breaks lifecycle of page (stever)
BUG: Ticket#872 - use PATH_SEPARATOR in phpunit.php (fragmaster b)
BUG: Ticket#886 - TSimpleDateFormatter: One month offset in time stamp with date pattern "yyyy" (Knut)
BUG: Ticket#897 - TSimpleDateFormatter: If no YearPattern is set it should default to current year (Knut)
BUG: Ticket#899 - TSqlCriteria: SQL-statements with limit and offset doesn't work (Knut)
+BUG: Ticket#900 - TDataGrid with TRequireFieldValidator and TEditCommandColumn interaction error (Michael)
BUG: Ticket#904 - TDbConnection: Add emulate prepares workaround for boolean compares (Knut)
BUG: Ticket#908 - TDbCache::init / Exception (Knut)
-ENH: Added Prado.Validation.validateControl(id) on client side to validate a specific control (Michael)
-ENH: Added MessageSource_Database to I18N (uses TDbConnection) (Michael)
+BUG: Ticket#922 - Problem with TUrlMapping and urlencoding (Michael)
+BUG: Ticket#938 - TPageStateFormatter EnableStateEncryption causes massive page state (Michael)
+BUG: Ticket#942 - MultiLine TInplaceTextBox (Christophe)
+BUG: Issue#38 - TValidationSummary, works different when it's showing Javascript Validation than Server Validation (Carl)
+CHG: Ticket#844 - Upgraded TinyMCE to 3.1.0.1 (Christophe)
+CHG: Ticket#917 - TUrlMapping - change members to protected (Michael)
+CHG: Ticket#919 - TUserManager loadUserData function (Michael)
+CHG: Issue#39 - Implement validator not requiring ControlToValidate (Carl)
+ENH: Workaround for slow meta data retrieval in MySQL<5.1.21 (Michael)
+ENH: Ticket#756 - TDateFormat & TNumberFormat - allow settings default text when Value isn't set. (Carl)
ENH: Ticket#823 - PromptText/PromptValue only populated if there is data (Knut)
ENH: Ticket#876 - Assign empty string to CssUrl on TTabPanel to avoid loading extra css (GoDZilla, Knut)
+ENH: Ticket#882 - Allow to escape # and $ in sqlmap (Michael)
ENH: Ticket#890 - Minor optimization: Use $var===null over is_null($var) (Knut)
ENH: Ticket#893 - Added page parameter to queryForPagedList() to specify the initial page to load (Michael)
ENH: Ticket#896 - TTheme - enhance for subclassing (Knut)
ENH: Ticket#898 - Minor optimization: Use (int) over intval() (Knut)
+ENH: Ticket#813 - (Issue #13) TRegularExpressionValidator has new ClientSidePatternModifier property (Michael)
+ENH: Ticket#809 - "LIMIT 1" for ActiveRecord find() and findBy() (Carl)
+ENH: Ticket#848 - TCache "set" and "add" with empty values (Carl)
+ENH: Ticket#822 - Not receiving emails from TEmailLogRoute (Carl)
ENH: Ticket#901 - Using TDbDataReader directly as a DataSource of TDataBoundControl's like TDataGrid (Knut)
ENH: Ticket#911 - prado-cli: Better error message if database connection fails when generating Active Record skeletons (Knut)
-CHG: Ticket#844 - Upgraded TinyMCE to 3.1.0.1 (Christophe)
+ENH: Ticket#913 - PRADO Copyright notice in HTML source (Carl)
+ENH: Ticket#925 - TTimeTriggeredCallback update interval during callback (Brad, Christophe)
+ENH: Ticket#941 - Add addRoute() method to TLogRouter (Michael)
+ENH: Ticket#46 - TColorPicker - Output is missing alt tag (Carl)
+ENH: Issue#32 - Implement ability to specify default service ID (Carl)
+ENH: Issue#31 - Consider UTF MessageSource_XLIFF class file (Carl)
+NEW: Added Prado.Validation.validateControl(id) on client side to validate a specific control (Michael)
+NEW: Added MessageSource_Database to I18N (uses TDbConnection) (Michael)
+NEW: Ticket#790 - Added TActiveFileUpload (Bradley, Christophe)
+NEW: Ticket#935 - Added TActiveDatePicker (Bradley, Christophe)
+NEW: Ticket#857 - Added Authentication expiration support to TAuthManager (Michael)
+NEW: Ticket#853 - Added Drag and drop components (Christophe)
+NEW: Ticket#891 - Added method that returns table name to TActiveRecord (Michael)
Version 3.1.2 April 21, 2008
============================
diff --git a/UPGRADE b/UPGRADE
index 4fa19f8c..05fe6547 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -1,172 +1,181 @@
-
- Upgrading Instructions for PRADO Framework v3.1.3
- =================================================
-
-!!!IMPORTANT!!!
-
-The following upgrading instructions are cumulative. That is,
-if you want to upgrade from version A to version C and there is
-version B between A and C, you need to following the instructions
-for both A and B.
-
-Upgrading from v3.1.2
----------------------
-- The Translation configuration now also accepts type 'Database' to
- ease the setup of DB base translation. A valid ConnectionID has to
- be supplied in the source parameter:
- <translation type="Database" source="db1" autosave="true" cache="false" />
- Type 'MySQL' can still be used but is deprecated and might be removed
- in a later release.
-- TinyMCE (used by THtmlArea component) has been upgraded to version 3.1.0.1.
- Since the 3.X branch of TinyMCE has a different API than 2.X, you should
- upgrade your Customs Plugins if you use any.
- See http://wiki.moxiecode.com/index.php/TinyMCE:Migration_guide for more information.
-
-
-Upgrading from v3.1.1
----------------------
-- The RELATIONS type declaration in Active Record classes for Many-to-Many using
- an association table was change from "self::HAS_MANY" to "self::MANY_TO_MANY".
- E.g. change
- 'albums' => array(self::HAS_MANY, 'Artist', 'album_artists')
- to
- 'albums' => array(self::MANY_TO_MANY, 'Artist', 'album_artists')
-- Active Record no longer automatically adds/removes/updates related objects.
-- 'Raw' mode for TCheckboxList and TRadioButtonList (and their active counter parts) now render
- a surrounding <span> tag to allow client scripts to identify them with the ClientId. You may
- have to check your CSS.
-
-
-Upgrading from v3.1.0
----------------------
-- The RELATIONS declaration in Acive Record classes is changed from
- "protected static $RELATIONS" to "public static $RELATIONS".
-- IFeedContentProvider adds a new method: getContentType(). This affects any
- class implementing this interface.
-- TUrlMapping now only uses the PATH_INFO part of URL for matching, and the matching
- is for the whole PATH_INFO.
-- IUserManager adds two new methods: getUserFromCookie() and saveUserToCookie().
- This affects classes that implements this interface and does not extend from
- TUserManager.
-- The order of application lifecycles is changed. The loadState and loadStateComplete
- are moved to right after onBeginRequest.
-- TDropDownList will be in an unselected state if no initial selection is specified.
- That is, its SelectedIndex will be -1. Previously, the first item will be considered as selected.
-
-Upgrading from v3.1b
---------------------
-- Comment tag <!-- ... ---> (introduced in v3.1a) is changed to <!--- ... --->
-- When TDataList.RepeatLayout is Raw, the items will render <div> instead of <span>
-- TActiveRecord finder methods will always return a new object instance (identity mapping was removed).
-- TActiveRecord::findBySql() will return an object rather than an array
-- TActiveRecord::findAllBySql() will return an array of objects.
-
-Upgrading from v3.1a
----------------------
-- The signature of TActiveRecord::finder() is changed. This affects
- all TActiveRecord-descendant classes that override this method.
- Please use the following code to override the method:
- public static function finder($className=__CLASS__)
- {
- return parent::finder($className);
- }
-
-- The way to specify the table name for an active record class is changed.
- Previously, it used the static class member '_tablename'.
- Now it uses class constant as follows:
- class UserRecord extends TActiveRecord
- {
- const TABLE='users_table';
- }
-
-- Changed TActiveRatingList's javascript control class
- name from "Prado.WebUI.TRatingList" to "Prado.WebUI.TActiveRatingList".
-
-- PRADO's javascript library locations moved from Web/Javascripts/xxx to Web/Javascripts/source/xxx
-
-- IPostBackDataHandler added a new method getDataChanged(). Any control
- implementing this interface will be required to implement this new method.
-
-Upgrading from v3.0.x
----------------------
-- Validators ClientSide.OnSuccess becomes ClientSide.OnValidationSuccess,
-- Validators ClientSide.OnError becomes ClientSide.OnValidationError,
-- Validator OnSuccess event becomes OnValidationSuccess.
-- Validator OnError event becomes OnValidationError.
-- Content enclosed in <!-- --> is now parsed as normal template content.
- Previously, it was not parsed and was rendered as is.
-
-Upgrading from v3.0.7
----------------------
-
-Upgrading from v3.0.6
----------------------
-
-Upgrading from v3.0.5
----------------------
-- TRepeater does not render <span> anymore for empty item template.
-- constructUrl() now encodes ampersand by default. This should have minimal
- impact on any existing PRADO applications, though.
-- TDataGrid does not generate default table styles. This may affect
- the appearance of existing PRADO applications that use TDataGrid.
-- If TUrlMapping is used, you need to set the UrlManager property of
- THttpRequest to the module ID of TUrlMapping.
-- TJavascriptLogger toggle key is changed from ALT-D to ALT-J.
- Use the ToggleKey property chanage to a different key.
-- Javascript Library rico was REMOVED.
-
-Upgrading from v3.0.4
----------------------
-- TFileUpload::saveAs() will return false instead of raising an exception
- if it encounters any error.
-- TDropDownListColumn.DataField is renamed to DataTextField and
- DataFormatString is renamed to DataTextFormatString.
- A new property named DataValueField is added.
-
-Upgrading from v3.0.3
----------------------
-- The 'Static' value is changed to 'Fixed' for the Display property of
- all validators as well as TValidationSummary, due to conflict with PHP keywords.
-- The 'List' value is changed to 'SimpleList' for TValidationSummary.DisplayMode.
-- The 'List' value is changed to 'DropDownList' for TPager.Mode
-- This change affects existing client-side javascript handlers such as
- <com:TRequiredFieldValidator ClientSide.OnSuccess="xxx" />
- All ClientSide javascript event handlers (such as ClientSide.OnSuccess)
- are by default wrapped within the function block.
- function(sender, parameter){ // handler code }
- You may override this behaviour by providing your own javascript statement block
- as "javascript:MyHandlerFunction", e.g. ClientSide.OnSuccess="javascript:MyHandlerFunction"
- or ClientSide.OnSuccess="javascript:function(validator,sender){ ... }"
-
-
-Upgrading from v3.0.2
----------------------
-- The minimum PHP version required is raised to 5.1.0 and above.
- If your server is installed with a lower version of PHP, you will
- have to upgrade it in order to run PRADO applications.
-- The signature of TControl::broadcastEvent() is changed from
- broadcastEvent($sender,TBroadCastEventParameter $param) to
- broadcastEvent($name,$sender,$param).
- This makes the call to broadcastEvent() to be consistent with raiseEvent().
-
-Upgrading from v3.0.1
----------------------
-- Postback enabled control will always disable default client-side browser action.
- This is due to google toolbar's interference of event stopping scheme.
- This modification should only affect user-derived postback javascripts.
-
-Upgrading from v3.0.0
----------------------
-- URL format is modified when THttpRequest.UrlFormat=='Path'.
- This modification affects both the URLs generated by calling constructUrl()
- and the URLs understood by PRADO. In particular, PRADO now understands
- the following URL format:
- /index.php/ServiceID,ServiceParam/Name1,Value1/Name2,Value2/...
- In v3.0.0, the above URL is written as:
- /index.php/ServiceID/ServiceParam/Name1/Value1/Name2/Value2/...
-- TControl::onBubbleEvent() has been changed to TControl::bubbleEvent().
- This change only affects user controls that override this method.
-
-Upgrading from v2.x and v1.x
-----------------------------
-PRADO v3.x is not backward compatible with v2.x and v1.x.
+
+ Upgrading Instructions for PRADO Framework v3.1.4
+ =================================================
+
+!!!IMPORTANT!!!
+
+The following upgrading instructions are cumulative. That is,
+if you want to upgrade from version A to version C and there is
+version B between A and C, you need to following the instructions
+for both A and B.
+
+Upgrading from v3.1.3
+---------------------
+
+
+Upgrading from v3.1.2
+---------------------
+- The Translation configuration now also accepts type 'Database' to
+ ease the setup of DB base translation. A valid ConnectionID has to
+ be supplied in the source parameter:
+ <translation type="Database" source="db1" autosave="true" cache="false" />
+ Type 'MySQL' can still be used but is deprecated and might be removed
+ in a later release.
+- TinyMCE (used by THtmlArea component) has been upgraded to version 3.1.0.1.
+ Since the 3.X branch of TinyMCE has a different API than 2.X, you should
+ upgrade your Customs Plugins if you use any.
+ See http://wiki.moxiecode.com/index.php/TinyMCE:Migration_guide for more information.
+- If you use EnableStateEncryption, the PageState of your current user sessions
+ will no longer be valid, since we optimized the encryption/compression logic.
+- You can now use # and $ characters in your SQL statements with SQLMap by
+ escaping them as ## and $$. That induces that you can't have consecutive
+ parameters like #param1##param2# or $param1$$param2$ in your statements anymore.
+
+
+Upgrading from v3.1.1
+---------------------
+- The RELATIONS type declaration in Active Record classes for Many-to-Many using
+ an association table was change from "self::HAS_MANY" to "self::MANY_TO_MANY".
+ E.g. change
+ 'albums' => array(self::HAS_MANY, 'Artist', 'album_artists')
+ to
+ 'albums' => array(self::MANY_TO_MANY, 'Artist', 'album_artists')
+- Active Record no longer automatically adds/removes/updates related objects.
+- 'Raw' mode for TCheckboxList and TRadioButtonList (and their active counter parts) now render
+ a surrounding <span> tag to allow client scripts to identify them with the ClientId. You may
+ have to check your CSS.
+
+
+Upgrading from v3.1.0
+---------------------
+- The RELATIONS declaration in Acive Record classes is changed from
+ "protected static $RELATIONS" to "public static $RELATIONS".
+- IFeedContentProvider adds a new method: getContentType(). This affects any
+ class implementing this interface.
+- TUrlMapping now only uses the PATH_INFO part of URL for matching, and the matching
+ is for the whole PATH_INFO.
+- IUserManager adds two new methods: getUserFromCookie() and saveUserToCookie().
+ This affects classes that implements this interface and does not extend from
+ TUserManager.
+- The order of application lifecycles is changed. The loadState and loadStateComplete
+ are moved to right after onBeginRequest.
+- TDropDownList will be in an unselected state if no initial selection is specified.
+ That is, its SelectedIndex will be -1. Previously, the first item will be considered as selected.
+
+Upgrading from v3.1b
+--------------------
+- Comment tag <!-- ... ---> (introduced in v3.1a) is changed to <!--- ... --->
+- When TDataList.RepeatLayout is Raw, the items will render <div> instead of <span>
+- TActiveRecord finder methods will always return a new object instance (identity mapping was removed).
+- TActiveRecord::findBySql() will return an object rather than an array
+- TActiveRecord::findAllBySql() will return an array of objects.
+
+Upgrading from v3.1a
+---------------------
+- The signature of TActiveRecord::finder() is changed. This affects
+ all TActiveRecord-descendant classes that override this method.
+ Please use the following code to override the method:
+ public static function finder($className=__CLASS__)
+ {
+ return parent::finder($className);
+ }
+
+- The way to specify the table name for an active record class is changed.
+ Previously, it used the static class member '_tablename'.
+ Now it uses class constant as follows:
+ class UserRecord extends TActiveRecord
+ {
+ const TABLE='users_table';
+ }
+
+- Changed TActiveRatingList's javascript control class
+ name from "Prado.WebUI.TRatingList" to "Prado.WebUI.TActiveRatingList".
+
+- PRADO's javascript library locations moved from Web/Javascripts/xxx to Web/Javascripts/source/xxx
+
+- IPostBackDataHandler added a new method getDataChanged(). Any control
+ implementing this interface will be required to implement this new method.
+
+Upgrading from v3.0.x
+---------------------
+- Validators ClientSide.OnSuccess becomes ClientSide.OnValidationSuccess,
+- Validators ClientSide.OnError becomes ClientSide.OnValidationError,
+- Validator OnSuccess event becomes OnValidationSuccess.
+- Validator OnError event becomes OnValidationError.
+- Content enclosed in <!-- --> is now parsed as normal template content.
+ Previously, it was not parsed and was rendered as is.
+
+Upgrading from v3.0.7
+---------------------
+
+Upgrading from v3.0.6
+---------------------
+
+Upgrading from v3.0.5
+---------------------
+- TRepeater does not render <span> anymore for empty item template.
+- constructUrl() now encodes ampersand by default. This should have minimal
+ impact on any existing PRADO applications, though.
+- TDataGrid does not generate default table styles. This may affect
+ the appearance of existing PRADO applications that use TDataGrid.
+- If TUrlMapping is used, you need to set the UrlManager property of
+ THttpRequest to the module ID of TUrlMapping.
+- TJavascriptLogger toggle key is changed from ALT-D to ALT-J.
+ Use the ToggleKey property chanage to a different key.
+- Javascript Library rico was REMOVED.
+
+Upgrading from v3.0.4
+---------------------
+- TFileUpload::saveAs() will return false instead of raising an exception
+ if it encounters any error.
+- TDropDownListColumn.DataField is renamed to DataTextField and
+ DataFormatString is renamed to DataTextFormatString.
+ A new property named DataValueField is added.
+
+Upgrading from v3.0.3
+---------------------
+- The 'Static' value is changed to 'Fixed' for the Display property of
+ all validators as well as TValidationSummary, due to conflict with PHP keywords.
+- The 'List' value is changed to 'SimpleList' for TValidationSummary.DisplayMode.
+- The 'List' value is changed to 'DropDownList' for TPager.Mode
+- This change affects existing client-side javascript handlers such as
+ <com:TRequiredFieldValidator ClientSide.OnSuccess="xxx" />
+ All ClientSide javascript event handlers (such as ClientSide.OnSuccess)
+ are by default wrapped within the function block.
+ function(sender, parameter){ // handler code }
+ You may override this behaviour by providing your own javascript statement block
+ as "javascript:MyHandlerFunction", e.g. ClientSide.OnSuccess="javascript:MyHandlerFunction"
+ or ClientSide.OnSuccess="javascript:function(validator,sender){ ... }"
+
+
+Upgrading from v3.0.2
+---------------------
+- The minimum PHP version required is raised to 5.1.0 and above.
+ If your server is installed with a lower version of PHP, you will
+ have to upgrade it in order to run PRADO applications.
+- The signature of TControl::broadcastEvent() is changed from
+ broadcastEvent($sender,TBroadCastEventParameter $param) to
+ broadcastEvent($name,$sender,$param).
+ This makes the call to broadcastEvent() to be consistent with raiseEvent().
+
+Upgrading from v3.0.1
+---------------------
+- Postback enabled control will always disable default client-side browser action.
+ This is due to google toolbar's interference of event stopping scheme.
+ This modification should only affect user-derived postback javascripts.
+
+Upgrading from v3.0.0
+---------------------
+- URL format is modified when THttpRequest.UrlFormat=='Path'.
+ This modification affects both the URLs generated by calling constructUrl()
+ and the URLs understood by PRADO. In particular, PRADO now understands
+ the following URL format:
+ /index.php/ServiceID,ServiceParam/Name1,Value1/Name2,Value2/...
+ In v3.0.0, the above URL is written as:
+ /index.php/ServiceID/ServiceParam/Name1/Value1/Name2/Value2/...
+- TControl::onBubbleEvent() has been changed to TControl::bubbleEvent().
+ This change only affects user controls that override this method.
+
+Upgrading from v2.x and v1.x
+----------------------------
+PRADO v3.x is not backward compatible with v2.x and v1.x.
diff --git a/demos/personal/protected/Pages/Settings.page b/demos/personal/protected/Pages/Settings.page
index 48dfde96..f461fa13 100644
--- a/demos/personal/protected/Pages/Settings.page
+++ b/demos/personal/protected/Pages/Settings.page
@@ -1,4 +1,4 @@
-<com:TContent ID="main" >
+<com:TContent ID="content" >
Welcome, <com:TLabel Text=<%= $this->User->Name %> />!
This page contains site settings accessible only to site admin.
</com:TContent> \ No newline at end of file
diff --git a/demos/personal/protected/Pages/config.php b/demos/personal/protected/Pages/config.php
index 7a6c9a6c..23cb184e 100644
--- a/demos/personal/protected/Pages/config.php
+++ b/demos/personal/protected/Pages/config.php
@@ -3,10 +3,8 @@ return array(
'authorization' => array(
array(
'action' => 'deny',
- 'properties' => array(
- 'pages' => 'Settings',
- 'users' => '?',
- ),
+ 'pages' => 'Settings',
+ 'users' => '?',
),
),
'pages' => array(
diff --git a/demos/personal/protected/application.php b/demos/personal/protected/application.php
index 0d9cadd4..26100576 100644
--- a/demos/personal/protected/application.php
+++ b/demos/personal/protected/application.php
@@ -5,7 +5,7 @@ return array(
'mode' => 'Debug',
),
'paths' => array(
- 'using'=>array('Application.common.*'),
+ 'using'=>array('Application.Common.*'),
),
'modules' => array(
),
diff --git a/demos/quickstart/protected/pages/ActiveControls/DragDrop.page b/demos/quickstart/protected/pages/ActiveControls/DragDrop.page
new file mode 100755
index 00000000..0969ddd0
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/DragDrop.page
@@ -0,0 +1,26 @@
+<com:TContent ID="body">
+<!-- $Id$ -->
+<h1>TDropContainer</h1>
+<com:DocLink ClassPath="System.Web.UI.ActiveControls.TDropContainer" />
+
+<p class="block-content"><tt>TDropContainer</tt> represent an area where
+<tt>TDraggable</tt> controls can be dropped.
+When a <tt>TDraggable</tt> is dropped, a
+callback request is initiated. The <tt>OnCallback</tt> event is raised
+during a callback request and it is raised <strong>after</strong>
+the <tt>OnDropk</tt> event.
+</p>
+
+
+<h1>TDraggable</h1>
+<com:DocLink ClassPath="System.Web.UI.ActiveControls.TDraggable" />
+
+<p class="block-content"><tt>TDraggable</tt> will make its child controls 'draggable'.
+When a <tt>TDraggable</tt> is dropped, a
+callback request is initiated. The <tt>OnCallback</tt> event is raised
+during a callback request and it is raised <strong>after</strong>
+the <tt>OnDropk</tt> event.
+</p>
+<com:RunBar PagePath="ActiveControls.Samples.DragDrop.Home" />
+
+<div class="last-modified">$Id$</div></com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Home.page b/demos/quickstart/protected/pages/ActiveControls/Home.page
index 5cf4ab17..49855980 100644
--- a/demos/quickstart/protected/pages/ActiveControls/Home.page
+++ b/demos/quickstart/protected/pages/ActiveControls/Home.page
@@ -160,6 +160,12 @@ TActiveButton</a> control. See also the later part of the <a href="?page=Tutoria
* <a href="?page=ActiveControls.ValueTriggeredCallback">TValueTriggeredCallback</a>
monitors (using a timer) an attribute of an HTML element and triggers a callback request
when the attribute value changes.
+ </li>
+
+ <li>
+ <a href="?page=ActiveControls.DragDrop">TDropContainer & TDraggable</a> represents drag and drop containers.
+ The former will make its child controls "draggable" while the latter will raise a callback when a draggable
+ control is dropped on it.
</li>
</ul>
@@ -310,7 +316,21 @@ if Javascript was disabled on the client's browser.</p>
<a href="?page=ActiveControls.ValueTriggeredCallback">TValueTriggeredCallback</a>
</td>
<td>Yes</td><td>No</td>
- </tr>
+ </tr>
+
+ <tr><td>
+ <a href="?page=ActiveControls.DragDrop">TDropContainer</a>
+ </td>
+ <td>Yes</td><td>No</td>
+ </tr>
+
+ <tr><td>
+ <a href="?page=ActiveControls.DragDrop">TDraggable</a>
+ </td>
+ <td>No</td><td>No</td>
+ </tr>
+
+
</table>
<h2 id="128036">Active Control Infrastructure Classes</h2>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.page b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.page
new file mode 100755
index 00000000..89d64110
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.page
@@ -0,0 +1,90 @@
+<com:TContent id="body">
+<style>
+.cart {
+ border: 1px solid #E8A400;
+ background-color: white;
+ padding: 8px;
+ width: 500px;
+ height: 150px;
+}
+
+.cart-hover {
+ background-color: #E8A400;
+}
+
+.cart-items {
+ width: 30px;
+ height: 30px;
+}
+
+.products {
+ float: left;
+ width: 100px;
+ height: 100px;
+ margin-right: 10px;
+}
+
+.draggable {
+ cursor: move
+}
+
+.removable {
+}
+
+.trash {
+ width: 50px;
+ height: 50px;
+ border: 1px solid black;
+}
+
+.trash-hover {
+ background-image: url(<%~ assets/trash.png%>);
+}
+
+</style>
+<h1>Drag &amp; Drop demo !</h1>
+
+<h2>Product List :</h2>
+
+<div style="margin-bottom: 20px; height: 120px">
+
+<com:TRepeater Id="ProductList" DataKeyField="ProductId">
+ <prop:ItemTemplate>
+ <com:TDraggable CssClass="products draggable" >
+ <com:TImage ImageUrl=<%#$this->Data['ProductImageUrl']%> />
+ </com:TDraggable>
+ </prop:ItemTemplate>
+</com:TRepeater>
+</div>
+<h2>Your shopping cart :</h2>
+<com:TDropContainer CssClass="cart" Id="cart"
+ AcceptCssClass="draggable"
+ HoverCssClass="cart-hover"
+ OnDrop="addItemToCart"
+ OnCallback="redrawCart"
+ >
+ <com:TRepeater id="ShoppingList" DataKeyField="ProductId">
+ <prop:EmptyTemplate>
+ Your shopping cart is empty, please add some items !
+ </prop:EmptyTemplate>
+ <prop:ItemTemplate>
+ <com:TDraggable CssClass="removable"
+ Revert="true"
+ Handle="<%=$this->itemImage->ClientId%>"
+ Ghosting=<%#($this->Data['ProductCount'] > 1)%>
+ >
+ <com:TImage id="itemImage" CssClass="cart-items" Style="cursor:move" ImageUrl=<%#$this->Data['ProductImageUrl']%>/>
+ <com:TLabel id="itemTitle" Text=<%#$this->Data['ProductTitle']%>/>
+ <com:TLabel id="itemCount" Text="(<%#$this->Data['ProductCount']%>)" />
+ </com:TDraggable>
+ </prop:ItemTemplate>
+ </com:TRepeater>
+</com:TDropContainer>
+<h2>Remove Items from cart by dropping them here</h2>
+<com:TDropContainer CssClass="trash" id="trash"
+ AcceptCssClass="removable"
+ OnDrop="removeItemFromCart"
+ OnCallback="redrawCart"
+ HoverCssClass="trash-hover"
+/>
+</com:TContent>
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php
new file mode 100755
index 00000000..276ee6a4
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/Home.php
@@ -0,0 +1,112 @@
+<?php
+
+prado::using ('System.Web.UI.ActiveControls.*');
+
+class Home extends TPage
+{
+ public function onInit ($param)
+ {
+ parent::onInit($param);
+ if (!$this->getIsPostBack() && !$this->getIsCallBack())
+ {
+
+ $this->populateProductList();
+ $this->populateShoppingList();
+ }
+ }
+
+ private function getProductData ()
+ {
+ return array (
+ array (
+ 'ProductId' => 'Product1',
+ 'ProductImageUrl' => $this->publishAsset('assets/product1.png'),
+ 'ProductTitle' => 'Cup'
+ ),
+ array (
+ 'ProductId' => 'Product2',
+ 'ProductImageUrl' => $this->publishAsset('assets/product2.png'),
+ 'ProductTitle' => 'T-Shirt'
+ )
+ );
+ }
+
+ private function getProduct ($key)
+ {
+ foreach ($this->getProductData() as $product)
+ if ($product['ProductId']==$key) return $product;
+ return null;
+ }
+
+ protected function populateProductList ()
+ {
+ $this->ProductList->DataSource=$this->getProductData();
+ $this->ProductList->Databind();
+ }
+
+ protected function populateShoppingList ()
+ {
+ $this->ShoppingList->DataSource=$this->getShoppingListData();
+ $this->ShoppingList->Databind();
+
+ }
+
+
+ public function getShoppingListData ()
+ {
+ return $this->getViewState('ShoppingList', array ());
+ }
+
+ public function setShoppingListData ($value)
+ {
+ $this->setViewState('ShoppingList', TPropertyValue::ensureArray($value), array ());
+ }
+
+ public function addItemToCart ($sender, $param)
+ {
+ $control=$param->getDroppedControl();
+ // Get the Key from the repeater item
+ $item=$control->getNamingContainer();
+ $key=$this->ProductList->getDataKeys()->itemAt($item->getItemIndex());
+ $product=$this->getProduct($key);
+ $shoppingList=$this->getShoppingListData();
+ if (isset ($shoppingList[$key]))
+ {
+ // Already an item of this type, increment counter
+ $shoppingList[$key]['ProductCount']++;
+ }
+ else
+ {
+ // Add an item to the shopping list
+ $shoppingList[$key]=$product;
+ $shoppingList[$key]['ProductCount']=1;
+ }
+ $this->setShoppingListData($shoppingList);
+
+ }
+
+ public function removeItemFromCart ($sender, $param)
+ {
+ $control=$param->getDroppedControl();
+ $item=$control->getNamingContainer();
+ $key=$this->ShoppingList->getDataKeys()->itemAt($item->getItemIndex());
+ $shoppingList=$this->getShoppingListData();
+ if (isset($shoppingList[$key]))
+ {
+ if ($shoppingList[$key]['ProductCount'] > 1)
+ $shoppingList[$key]['ProductCount'] --;
+ else
+ unset($shoppingList[$key]);
+ }
+ $this->setShoppingListData($shoppingList);
+
+ }
+
+ public function redrawCart ($sender, $param)
+ {
+ $this->populateShoppingList();
+ $this->cart->render($param->NewWriter);
+
+ }
+}
+?> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product1.png b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product1.png
new file mode 100755
index 00000000..ae03d551
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product1.png
Binary files differ
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product2.png b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product2.png
new file mode 100755
index 00000000..25e81ad7
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/product2.png
Binary files differ
diff --git a/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/trash.png b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/trash.png
new file mode 100755
index 00000000..184f7628
--- /dev/null
+++ b/demos/quickstart/protected/pages/ActiveControls/Samples/DragDrop/assets/trash.png
Binary files differ
diff --git a/demos/quickstart/protected/pages/Configurations/Templates2.page b/demos/quickstart/protected/pages/Configurations/Templates2.page
index e8442f1f..8a17c72c 100644
--- a/demos/quickstart/protected/pages/Configurations/Templates2.page
+++ b/demos/quickstart/protected/pages/Configurations/Templates2.page
@@ -96,4 +96,18 @@ Localization tags represent localized texts. They are in the following format,
where <tt>string</tt> will be translated to different languages according to the end-user's language preference. Localization tags are in fact shortcuts to the function call <tt>Prado::localize(string)</tt>.
</p>
+
+<a name="ut"></a>
+<h3 id="1609">URL Tags</h3>
+<p id="190195" class="block-content">
+URL tags are used to insert the relative web url path to the Prado application in the template. You can use it in the following format:
+</p>
+<com:TTextHighlighter Language="prado" CssClass="source block-content" id="code_190087">
+&lt;%/ image.jpg %&gt;
+</com:TTextHighlighter>
+</p>
+<p id="190196" class="block-content">
+If your Prado application is deployed on http://localhost/pradoapp/, the tag above will produce "/pradoapp/image.jpg". This tag will help you to use the correct file path even with UrlFormat set to Path, or if you are using url mappings.
+</p>
+
<div class="last-modified">$Id$</div></com:TContent> \ No newline at end of file
diff --git a/demos/quickstart/protected/pages/Configurations/UrlMapping.page b/demos/quickstart/protected/pages/Configurations/UrlMapping.page
index 0837d50d..ec393012 100644
--- a/demos/quickstart/protected/pages/Configurations/UrlMapping.page
+++ b/demos/quickstart/protected/pages/Configurations/UrlMapping.page
@@ -124,4 +124,7 @@ A matching pattern is one whose <tt>ServiceID</tt> and <tt>ServiceParameter</tt>
By default, <tt>TUrlMapping</tt> will construct URLs prefixed with the currently requesting PHP script path, such as <tt><b>/path/to/index.php</b>/article/3</tt>. Users may change this behavior by explicitly specifying the URL prefix through its <tt>UrlPrefix</tt> property. For example, if the Web server configuration treats <tt>index.php</tt> as the default script, we can set <tt>UrlPrefix</tt> as <tt>/path/to</tt> and the constructed URL will look like <tt>/path/to/article/3</tt>.
</p>
-<div class="last-modified">$Id$</div></com:TContent> \ No newline at end of file
+<div class="note"><b class="tip">Note:</b> If you use <tt>constructUrl()</tt> with string parameters that contain slashes ("/") they will get encoded to %2F. By default most Apache installations give a "404 Not found" if a URL contains a %2F. You can add <tt>AllowEncodedSlashes On</tt> to your <tt>VirtualHost</tt> configuration to resolve this. (Available since Apache 2.0.46).
+</div>
+
+<div class="last-modified">$Id$</div></com:TContent>
diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page
index 70998587..bc0df529 100644
--- a/demos/quickstart/protected/pages/Database/ActiveRecord.page
+++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page
@@ -129,6 +129,19 @@ class UserRecord extends TActiveRecord
You may specify qualified table names. E.g. for MySQL, <tt>TABLE = "`database1`.`table1`"</tt>.
</div>
+<div class="note"><b class="note">Note:</b>
+Since version <b>3.1.3</b> you can also use a method <tt>table()</tt> to define the table name.
+This allows you to dynamically specify which table should be used by the ActiveRecord.
+<com:TTextHighlighter Language="php" CssClass="source block-content">
+class TeamRecord extends TActiveRecord
+{
+ public function table() {
+ return 'Teams';
+ }
+}
+</com:TTextHighlighter>
+</div>
+
<p class="block-content" id="ar_as_component">
Since <tt>TActiveRecord</tt> extends <tt>TComponent</tt>, setter and
getter methods can be defined to allow control over how variables
@@ -1183,4 +1196,4 @@ instead of <tt>$userRecord->first_name</tt>. This helps separation of logic and
</ul>
-<div class="last-modified">$Id$</div></com:TContent> \ No newline at end of file
+<div class="last-modified">$Id$</div></com:TContent>
diff --git a/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page b/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page
index 66e3111d..51dbb981 100644
--- a/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page
+++ b/demos/quickstart/protected/pages/GettingStarted/NewFeatures.page
@@ -4,7 +4,13 @@
<p id="40005" class="block-content">
This page summarizes the main new features that are introduced in each PRADO release.
-</p>
+</p>
+
+<h2>Version 3.1.3</h2>
+<ul>
+<li>Added <a href="?page=ActiveControls.DragDrop">Drag and drop controls</a></li>
+<li>Added TActiveDatePicker control</li>
+</ul>
<h2>Version 3.1.2</h2>
<ul>
diff --git a/framework/3rdParty/TinyMCE/tiny_mce.md5 b/framework/3rdParty/TinyMCE/tiny_mce.md5
index a5b8fc8e..bf138c10 100644
--- a/framework/3rdParty/TinyMCE/tiny_mce.md5
+++ b/framework/3rdParty/TinyMCE/tiny_mce.md5
@@ -1 +1 @@
-6f0b8991531854895cb4461d218023bd tiny_mce.tar
+cf8b1ec3fc54577b1d834772ddecfc2e tiny_mce.tar
diff --git a/framework/3rdParty/TinyMCE/tiny_mce.tar b/framework/3rdParty/TinyMCE/tiny_mce.tar
index b4e9060d..beb06fb9 100644
--- a/framework/3rdParty/TinyMCE/tiny_mce.tar
+++ b/framework/3rdParty/TinyMCE/tiny_mce.tar
Binary files differ
diff --git a/framework/Caching/TAPCCache.php b/framework/Caching/TAPCCache.php
index 057d7585..5935e732 100644
--- a/framework/Caching/TAPCCache.php
+++ b/framework/Caching/TAPCCache.php
@@ -131,4 +131,3 @@ class TAPCCache extends TCache
}
}
-?>
diff --git a/framework/Caching/TCache.php b/framework/Caching/TCache.php
index 27618e84..02a4ae3b 100644
--- a/framework/Caching/TCache.php
+++ b/framework/Caching/TCache.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Caching
@@ -136,7 +136,8 @@ abstract class TCache extends TModule implements ICache, ArrayAccess
/**
* Stores a value identified by a key into cache.
* If the cache already contains such a key, the existing value and
- * expiration time will be replaced with the new ones.
+ * expiration time will be replaced with the new ones. If the value is
+ * empty, the cache key will be deleted.
*
* @param string the key identifying the value to be cached
* @param mixed the value to be cached
@@ -146,13 +147,18 @@ abstract class TCache extends TModule implements ICache, ArrayAccess
*/
public function set($id,$value,$expire=0,$dependency=null)
{
- $data=array($value,$dependency);
- return $this->setValue($this->generateUniqueKey($id),serialize($data),$expire);
+ if(empty($value) && $expire === 0)
+ $this->delete($id);
+ else
+ {
+ $data=array($value,$dependency);
+ return $this->setValue($this->generateUniqueKey($id),serialize($data),$expire);
+ }
}
/**
* Stores a value identified by a key into cache if the cache does not contain this key.
- * Nothing will be done if the cache already contains the key.
+ * Nothing will be done if the cache already contains the key or if value is empty.
* @param string the key identifying the value to be cached
* @param mixed the value to be cached
* @param integer the number of seconds in which the cached value will expire. 0 means never expire.
@@ -161,6 +167,8 @@ abstract class TCache extends TModule implements ICache, ArrayAccess
*/
public function add($id,$value,$expire=0,$dependency=null)
{
+ if(empty($value) && $expire === 0)
+ return false;
$data=array($value,$dependency);
return $this->addValue($this->generateUniqueKey($id),serialize($data),$expire);
}
@@ -710,4 +718,4 @@ class TCacheDependencyList extends TList
}
}
-?>
+?>
diff --git a/framework/Caching/TMemCache.php b/framework/Caching/TMemCache.php
index b6e9c7d8..0f0ac26d 100644
--- a/framework/Caching/TMemCache.php
+++ b/framework/Caching/TMemCache.php
@@ -307,4 +307,3 @@ class TMemCache extends TCache
}
}
-?>
diff --git a/framework/Caching/TSqliteCache.php b/framework/Caching/TSqliteCache.php
index 4d41542c..ca8d2261 100644
--- a/framework/Caching/TSqliteCache.php
+++ b/framework/Caching/TSqliteCache.php
@@ -221,4 +221,3 @@ class TSqliteCache extends TCache
}
}
-?>
diff --git a/framework/Collections/TAttributeCollection.php b/framework/Collections/TAttributeCollection.php
index 6b35d70e..93a48e1c 100644
--- a/framework/Collections/TAttributeCollection.php
+++ b/framework/Collections/TAttributeCollection.php
@@ -170,4 +170,3 @@ class TAttributeCollection extends TMap
}
}
-?>
diff --git a/framework/Collections/TDummyDataSource.php b/framework/Collections/TDummyDataSource.php
index ef11b286..491c36c0 100644
--- a/framework/Collections/TDummyDataSource.php
+++ b/framework/Collections/TDummyDataSource.php
@@ -144,4 +144,3 @@ class TDummyDataSourceIterator implements Iterator
}
}
-?>
diff --git a/framework/Collections/TList.php b/framework/Collections/TList.php
index 329e162f..50cbaf01 100644
--- a/framework/Collections/TList.php
+++ b/framework/Collections/TList.php
@@ -427,4 +427,3 @@ class TListIterator implements Iterator
}
}
-?>
diff --git a/framework/Collections/TMap.php b/framework/Collections/TMap.php
index 42f57890..56748ea2 100644
--- a/framework/Collections/TMap.php
+++ b/framework/Collections/TMap.php
@@ -350,4 +350,3 @@ class TMapIterator implements Iterator
return $this->_key!==false;
}
}
-?>
diff --git a/framework/Collections/TPagedDataSource.php b/framework/Collections/TPagedDataSource.php
index 3db4882a..fcb17f53 100644
--- a/framework/Collections/TPagedDataSource.php
+++ b/framework/Collections/TPagedDataSource.php
@@ -444,4 +444,3 @@ class TPagedMapIterator implements Iterator
}
}
-?>
diff --git a/framework/Collections/TPagedList.php b/framework/Collections/TPagedList.php
index a2a2aa14..50286aec 100644
--- a/framework/Collections/TPagedList.php
+++ b/framework/Collections/TPagedList.php
@@ -475,4 +475,3 @@ class TPagedListFetchDataEventParameter extends TEventParameter
}
}
-?>
diff --git a/framework/Collections/TQueue.php b/framework/Collections/TQueue.php
index 856b12ff..d8b692d1 100644
--- a/framework/Collections/TQueue.php
+++ b/framework/Collections/TQueue.php
@@ -261,4 +261,3 @@ class TQueueIterator implements Iterator
}
}
-?>
diff --git a/framework/Collections/TStack.php b/framework/Collections/TStack.php
index 58394a8a..0d3890b4 100644
--- a/framework/Collections/TStack.php
+++ b/framework/Collections/TStack.php
@@ -260,4 +260,3 @@ class TStackIterator implements Iterator
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php b/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php
index be88f015..eaab5735 100644
--- a/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php
+++ b/framework/Data/ActiveRecord/Exceptions/TActiveRecordException.php
@@ -39,4 +39,3 @@ class TActiveRecordConfigurationException extends TActiveRecordException
}
-?>
diff --git a/framework/Data/ActiveRecord/Exceptions/messages.txt b/framework/Data/ActiveRecord/Exceptions/messages.txt
index fabfc1a4..0702c840 100644
--- a/framework/Data/ActiveRecord/Exceptions/messages.txt
+++ b/framework/Data/ActiveRecord/Exceptions/messages.txt
@@ -10,6 +10,7 @@ ar_primary_key_is_scalar = Primary key '{1}' in table '{0}' is NOT a composi
ar_invalid_db_connection = Missing or invalid default database connection for ActiveRecord class '{0}', default connection is set by the DbConnection property of TActiveRecordManager.
ar_mismatch_args_exception = ActiveRecord finder method '{0}' expects {1} parameters but found only {2} parameters instead.
ar_invalid_tablename_property = Constant {0}::{1} must be a valid database table name.
+ar_invalid_tablename_method = Method {0}::{1} must return a valid database table name.
ar_value_must_not_be_null = Property '{0}::${2}' must not be null as defined by column '{2}' in table '{1}'.
ar_missing_pk_values = Missing primary key values in forming IN(key1, key2, ...) for table '{0}'.
ar_pk_value_count_mismatch = Composite key value count mismatch in forming IN( (key1, key2, ..), (key3, key4, ..)) for table '{0}'.
@@ -21,4 +22,4 @@ ar_invalid_criteria = Invalid criteria object, must be a string or instanc
ar_relations_undefined = Unable to determine Active Record relationships because static array property {0}::${1} is not defined.
ar_undefined_relation_prop = Unable to find {1}::${2}['{0}'], Active Record relationship definition for property "{0}" not found in entries of {1}::${2}.
ar_invalid_relationship = Invalid active record relationship.
-ar_relations_missing_fk = Unable to find foreign key relationships in table '{0}' that corresponds to table '{1}'. \ No newline at end of file
+ar_relations_missing_fk = Unable to find foreign key relationships in table '{0}' that corresponds to table '{1}'.
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
index 9f8777e2..40936011 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordBelongsTo.php
@@ -136,4 +136,3 @@ class TActiveRecordBelongsTo extends TActiveRecordRelation
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
index c66afa14..6f191b9f 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasMany.php
@@ -119,4 +119,3 @@ class TActiveRecordHasMany extends TActiveRecordRelation
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
index 9b01d323..4c71f91c 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasManyAssociation.php
@@ -374,4 +374,3 @@ class TActiveRecordHasManyAssociation extends TActiveRecordRelation
return $data;
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php b/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
index 6e8d30de..b1aa7b91 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordHasOne.php
@@ -143,4 +143,3 @@ class TActiveRecordHasOne extends TActiveRecordRelation
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
index 4044a5ce..a352cb07 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelation.php
@@ -247,4 +247,3 @@ abstract class TActiveRecordRelation
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
index 329007af..696bb5b1 100644
--- a/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
+++ b/framework/Data/ActiveRecord/Relations/TActiveRecordRelationContext.php
@@ -228,4 +228,3 @@ class TActiveRecordRelationContext
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php
index 05de2019..c8177d5e 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TIbmScaffoldInput.php
@@ -49,4 +49,3 @@ class TIbmScaffoldInput extends TScaffoldInputCommon
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php
index bca1bcb2..be495e98 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMssqlScaffoldInput.php
@@ -51,4 +51,3 @@ class TMssqlScaffoldInput extends TScaffoldInputCommon
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php
index a8ecdd13..c06e4113 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TMysqlScaffoldInput.php
@@ -81,4 +81,3 @@ class TMysqlScaffoldInput extends TScaffoldInputCommon
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php
index 69b67e7f..cd244b27 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TPgsqlScaffoldInput.php
@@ -52,4 +52,3 @@ class TPgsqlScaffoldInput extends TScaffoldInputCommon
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php
index ad563f2f..d8db9c59 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputBase.php
@@ -101,4 +101,3 @@ class TScaffoldInputBase
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php
index 12f9bc25..d02bc9a0 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TScaffoldInputCommon.php
@@ -307,4 +307,3 @@ class TScaffoldInputCommon extends TScaffoldInputBase
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php
index c187e825..5f431067 100644
--- a/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php
+++ b/framework/Data/ActiveRecord/Scaffold/InputBuilder/TSqliteScaffoldInput.php
@@ -97,4 +97,3 @@ class TSqliteScaffoldInput extends TScaffoldInputCommon
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php
index 1e9b87e7..9c548308 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldBase.php
@@ -204,4 +204,3 @@ abstract class TScaffoldBase extends TTemplateControl
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php
index 1760b27d..b38b739f 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldEditView.php
@@ -307,4 +307,3 @@ interface IScaffoldEditRenderer extends IDataRenderer
public function updateRecord($record);
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
index 79ab40ab..6c28651a 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldListView.php
@@ -304,4 +304,3 @@ class TScaffoldListView extends TScaffoldBase
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php
index a7f58735..b1cd6cbc 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldSearch.php
@@ -148,4 +148,3 @@ class TScaffoldSearch extends TScaffoldBase
}
}
-?>
diff --git a/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php b/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php
index 1ddba335..04420e9a 100644
--- a/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php
+++ b/framework/Data/ActiveRecord/Scaffold/TScaffoldView.php
@@ -141,4 +141,3 @@ class TScaffoldView extends TScaffoldBase
}
}
-?>
diff --git a/framework/Data/ActiveRecord/TActiveRecord.php b/framework/Data/ActiveRecord/TActiveRecord.php
index 370dd69a..fa134a9f 100644
--- a/framework/Data/ActiveRecord/TActiveRecord.php
+++ b/framework/Data/ActiveRecord/TActiveRecord.php
@@ -79,7 +79,7 @@ Prado::using('System.Data.ActiveRecord.Relations.TActiveRecordRelationContext');
* 'email_address'=>'email',
* );
* public $username;
- * pulbic $email;
+ * public $email;
* }
* </code>
* In the above, the 'users' table consists of 'user_id' and 'email_address' columns,
@@ -129,6 +129,18 @@ Prado::using('System.Data.ActiveRecord.Relations.TActiveRecordRelationContext');
* }
* </code>
*
+ * Since v3.1.3 you can also define a method that returns the table name.
+ * <code>
+ * class UserRecord extends TActiveRecord
+ * {
+ * public function table()
+ * {
+ * return 'users';
+ * }
+ *
+ * }
+ * </code>
+ *
* @author Wei Zhuo <weizho[at]gmail[dot]com>
* @version $Id$
* @package System.Data.ActiveRecord
@@ -318,6 +330,14 @@ abstract class TActiveRecord extends TComponent
}
/**
+ * @return TDbTableInfo the meta information of the table associated with this AR class.
+ */
+ public function getRecordTableInfo()
+ {
+ return $this->getRecordGateway()->getRecordTableInfo($this);
+ }
+
+ /**
* Compare two records using their primary key values (all column values if
* table does not defined primary keys). The default uses simple == for
* comparison of their values. Set $strict=true for identity comparison (===).
@@ -329,7 +349,7 @@ abstract class TActiveRecord extends TComponent
{
if($record===null || get_class($this)!==get_class($record))
return false;
- $tableInfo = $this->getRecordGateway()->getRecordTableInfo($this);
+ $tableInfo = $this->getRecordTableInfo();
$pks = $tableInfo->getPrimaryKeys();
$properties = count($pks) > 0 ? $pks : $tableInfo->getColumns()->getKeys();
$equals=true;
@@ -378,7 +398,7 @@ abstract class TActiveRecord extends TComponent
/**
* @return TActiveRecordGateway record table gateway.
*/
- public static function getRecordGateway()
+ public function getRecordGateway()
{
return TActiveRecordManager::getInstance()->getRecordGateway();
}
@@ -552,6 +572,7 @@ abstract class TActiveRecord extends TComponent
{
$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
$criteria = $this->getRecordCriteria($criteria,$parameters, $args);
+ $criteria->setLimit(1);
$data = $this->getRecordGateway()->findRecordsByCriteria($this,$criteria);
return $this->populateObject($data);
}
@@ -629,6 +650,7 @@ abstract class TActiveRecord extends TComponent
{
$args = func_num_args() > 1 ? array_slice(func_get_args(),1) : null;
$criteria = $this->getRecordCriteria($sql,$parameters, $args);
+ $criteria->setLimit(1);
$data = $this->getRecordGateway()->findRecordBySql($this,$criteria);
return $this->populateObject($data);
}
@@ -1000,4 +1022,3 @@ class TActiveRecordChangeEventParameter extends TEventParameter
}
}
-?>
diff --git a/framework/Data/ActiveRecord/TActiveRecordConfig.php b/framework/Data/ActiveRecord/TActiveRecordConfig.php
index 4e21635e..63f05aef 100644
--- a/framework/Data/ActiveRecord/TActiveRecordConfig.php
+++ b/framework/Data/ActiveRecord/TActiveRecordConfig.php
@@ -105,4 +105,3 @@ class TActiveRecordConfig extends TDataSourceConfig
}
}
-?>
diff --git a/framework/Data/ActiveRecord/TActiveRecordCriteria.php b/framework/Data/ActiveRecord/TActiveRecordCriteria.php
index eec6df04..41e8ad02 100644
--- a/framework/Data/ActiveRecord/TActiveRecordCriteria.php
+++ b/framework/Data/ActiveRecord/TActiveRecordCriteria.php
@@ -37,4 +37,3 @@ class TActiveRecordCriteria extends TSqlCriteria
}
-?>
diff --git a/framework/Data/ActiveRecord/TActiveRecordGateway.php b/framework/Data/ActiveRecord/TActiveRecordGateway.php
index 23104c00..6cce9eb9 100644
--- a/framework/Data/ActiveRecord/TActiveRecordGateway.php
+++ b/framework/Data/ActiveRecord/TActiveRecordGateway.php
@@ -1,414 +1,425 @@
-<?php
-/**
- * TActiveRecordGateway, TActiveRecordStatementType, TActiveRecordEventParameter classes file.
- *
- * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
- * @license http://www.pradosoft.com/license/
- * @version $Id$
- * @package System.Data.ActiveRecord
- */
-
-/**
- * TActiveRecordGateway excutes the SQL command queries and returns the data
- * record as arrays (for most finder methods).
- *
- * @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id$
- * @package System.Data.ActiveRecord
- * @since 3.1
- */
-class TActiveRecordGateway extends TComponent
-{
- private $_manager;
- private $_tables=array(); //table cache
- private $_meta=array(); //meta data cache.
- private $_commandBuilders=array();
- private $_currentRecord;
-
- /**
- * Constant name for specifying optional table name in TActiveRecord.
- */
- const TABLE_CONST='TABLE';
-
- /**
- * Record gateway constructor.
- * @param TActiveRecordManager $manager
- */
- public function __construct(TActiveRecordManager $manager)
- {
- $this->_manager=$manager;
- }
-
- /**
- * @return TActiveRecordManager record manager.
- */
- protected function getManager()
- {
- return $this->_manager;
- }
-
- /**
- * Gets the table name from the 'TABLE' constant of the active record
- * class if defined, otherwise use the class name as table name.
- * @param TActiveRecord active record instance
- * @return string table name for the given record class.
- */
- protected function getRecordTableName(TActiveRecord $record)
- {
- $class = new ReflectionClass($record);
- if($class->hasConstant(self::TABLE_CONST))
- {
- $value = $class->getConstant(self::TABLE_CONST);
- if(empty($value))
- throw new TActiveRecordException('ar_invalid_tablename_property',
- get_class($record),self::TABLE_CONST);
- return $value;
- }
- else
- return strtolower(get_class($record));
- }
-
- /**
- * Returns table information, trys the application cache first.
- * @param TActiveRecord $record
- * @return TDbTableInfo table information.
- */
- public function getRecordTableInfo(TActiveRecord $record)
- {
- $tableName = $this->getRecordTableName($record);
- return $this->getTableInfo($record->getDbConnection(), $tableName);
- }
-
- /**
- * Returns table information for table in the database connection.
- * @param TDbConnection database connection
- * @param string table name
- * @return TDbTableInfo table details.
- */
- public function getTableInfo(TDbConnection $connection, $tableName)
- {
- $connStr = $connection->getConnectionString();
- $key = $connStr.$tableName;
- if(!isset($this->_tables[$key]))
- {
- //call this first to ensure that unserializing the cache
- //will find the correct driver dependent classes.
- if(!isset($this->_meta[$connStr]))
- {
- Prado::using('System.Data.Common.TDbMetaData');
- $this->_meta[$connStr] = TDbMetaData::getInstance($connection);
- }
-
- $tableInfo = null;
- if(($cache=$this->getManager()->getCache())!==null)
- $tableInfo = $cache->get($key);
- if(empty($tableInfo))
- {
- $tableInfo = $this->_meta[$connStr]->getTableInfo($tableName);
- if($cache!==null)
- $cache->set($key, $tableInfo);
- }
- $this->_tables[$key] = $tableInfo;
- }
- return $this->_tables[$key];
- }
-
- /**
- * @param TActiveRecord $record
- * @return TDataGatewayCommand
- */
- public function getCommand(TActiveRecord $record)
- {
- $conn = $record->getDbConnection();
- $connStr = $conn->getConnectionString();
- $tableInfo = $this->getRecordTableInfo($record);
- if(!isset($this->_commandBuilders[$connStr]))
- {
- $builder = $tableInfo->createCommandBuilder($record->getDbConnection());
- Prado::using('System.Data.DataGateway.TDataGatewayCommand');
- $command = new TDataGatewayCommand($builder);
- $command->OnCreateCommand[] = array($this, 'onCreateCommand');
- $command->OnExecuteCommand[] = array($this, 'onExecuteCommand');
- $this->_commandBuilders[$connStr] = $command;
-
- }
- $this->_commandBuilders[$connStr]->getBuilder()->setTableInfo($tableInfo);
- $this->_currentRecord=$record;
- return $this->_commandBuilders[$connStr];
- }
-
- /**
- * Raised when a command is prepared and parameter binding is completed.
- * The parameter object is TDataGatewayEventParameter of which the
- * {@link TDataGatewayEventParameter::getCommand Command} property can be
- * inspected to obtain the sql query to be executed.
- * This method also raises the OnCreateCommand event on the ActiveRecord
- * object calling this gateway.
- * @param TDataGatewayCommand originator $sender
- * @param TDataGatewayEventParameter
- */
- public function onCreateCommand($sender, $param)
- {
- $this->raiseEvent('OnCreateCommand', $this, $param);
- if($this->_currentRecord!==null)
- $this->_currentRecord->onCreateCommand($param);
- }
-
- /**
- * Raised when a command is executed and the result from the database was returned.
- * The parameter object is TDataGatewayResultEventParameter of which the
- * {@link TDataGatewayEventParameter::getResult Result} property contains
- * the data return from the database. The data returned can be changed
- * by setting the {@link TDataGatewayEventParameter::setResult Result} property.
- * This method also raises the OnCreateCommand event on the ActiveRecord
- * object calling this gateway.
- * @param TDataGatewayCommand originator $sender
- * @param TDataGatewayResultEventParameter
- */
- public function onExecuteCommand($sender, $param)
- {
- $this->raiseEvent('OnExecuteCommand', $this, $param);
- if($this->_currentRecord!==null)
- $this->_currentRecord->onExecuteCommand($param);
- }
-
- /**
- * Returns record data matching the given primary key(s). If the table uses
- * composite key, specify the name value pairs as an array.
- * @param TActiveRecord active record instance.
- * @param array primary name value pairs
- * @return array record data
- */
- public function findRecordByPK(TActiveRecord $record,$keys)
- {
- $command = $this->getCommand($record);
- return $command->findByPk($keys);
- }
-
- /**
- * Returns records matching the list of given primary keys.
- * @param TActiveRecord active record instance.
- * @param array list of primary name value pairs
- * @return array matching data.
- */
- public function findRecordsByPks(TActiveRecord $record, $keys)
- {
- return $this->getCommand($record)->findAllByPk($keys);
- }
-
-
- /**
- * Returns record data matching the given critera. If $iterator is true, it will
- * return multiple rows as TDbDataReader otherwise it returns the <b>first</b> row data.
- * @param TActiveRecord active record finder instance.
- * @param TActiveRecordCriteria search criteria.
- * @param boolean true to return multiple rows as iterator, false returns first row.
- * @return mixed matching data.
- */
- public function findRecordsByCriteria(TActiveRecord $record, $criteria, $iterator=false)
- {
- $command = $this->getCommand($record);
- return $iterator ? $command->findAll($criteria) : $command->find($criteria);
- }
-
- /**
- * Return record data from sql query.
- * @param TActiveRecord active record finder instance.
- * @param TActiveRecordCriteria sql query
- * @return array result.
- */
- public function findRecordBySql(TActiveRecord $record, $criteria)
- {
- return $this->getCommand($record)->findBySql($criteria);
- }
-
- /**
- * Return record data from sql query.
- * @param TActiveRecord active record finder instance.
- * @param TActiveRecordCriteria sql query
- * @return TDbDataReader result iterator.
- */
- public function findRecordsBySql(TActiveRecord $record, $criteria)
- {
- return $this->getCommand($record)->findAllBySql($criteria);
- }
-
- public function findRecordsByIndex(TActiveRecord $record, $criteria, $fields, $values)
- {
- return $this->getCommand($record)->findAllByIndex($criteria,$fields,$values);
- }
-
- /**
- * Returns the number of records that match the given criteria.
- * @param TActiveRecord active record finder instance.
- * @param TActiveRecordCriteria search criteria
- * @return int number of records.
- */
- public function countRecords(TActiveRecord $record, $criteria)
- {
- return $this->getCommand($record)->count($criteria);
- }
-
- /**
- * Insert a new record.
- * @param TActiveRecord new record.
- * @return int number of rows affected.
- */
- public function insert(TActiveRecord $record)
- {
- //$this->updateAssociatedRecords($record,true);
- $result = $this->getCommand($record)->insert($this->getInsertValues($record));
- if($result)
- $this->updatePostInsert($record);
- //$this->updateAssociatedRecords($record);
- return $result;
- }
-
- /**
- * Sets the last insert ID to the corresponding property of the record if available.
- * @param TActiveRecord record for insertion
- */
- protected function updatePostInsert($record)
- {
- $command = $this->getCommand($record);
- $tableInfo = $command->getTableInfo();
- foreach($tableInfo->getColumns() as $name => $column)
- {
- if($column->hasSequence())
- $record->setColumnValue($name,$command->getLastInsertID($column->getSequenceName()));
- }
- }
-
- /**
- * @param TActiveRecord record
- * @return array insert values.
- */
- protected function getInsertValues(TActiveRecord $record)
- {
- $values=array();
- $tableInfo = $this->getCommand($record)->getTableInfo();
- foreach($tableInfo->getColumns() as $name=>$column)
- {
- if($column->getIsExcluded())
- continue;
- $value = $record->getColumnValue($name);
- if(!$column->getAllowNull() && $value===null && !$column->hasSequence())
- {
- throw new TActiveRecordException(
- 'ar_value_must_not_be_null', get_class($record),
- $tableInfo->getTableFullName(), $name);
- }
- if($value!==null)
- $values[$name] = $value;
- }
- return $values;
- }
-
- /**
- * Update the record.
- * @param TActiveRecord dirty record.
- * @return int number of rows affected.
- */
- public function update(TActiveRecord $record)
- {
- //$this->updateAssociatedRecords($record,true);
- list($data, $keys) = $this->getUpdateValues($record);
- $result = $this->getCommand($record)->updateByPk($data, $keys);
- //$this->updateAssociatedRecords($record);
- return $result;
- }
-
- protected function getUpdateValues(TActiveRecord $record)
- {
- $values=array();
- $tableInfo = $this->getCommand($record)->getTableInfo();
- $primary=array();
- foreach($tableInfo->getColumns() as $name=>$column)
- {
- if($column->getIsExcluded())
- continue;
- $value = $record->getColumnValue($name);
- if(!$column->getAllowNull() && $value===null)
- {
- throw new TActiveRecordException(
- 'ar_value_must_not_be_null', get_class($record),
- $tableInfo->getTableFullName(), $name);
- }
- if($column->getIsPrimaryKey())
- $primary[] = $value;
- else
- $values[$name] = $value;
- }
- return array($values,$primary);
- }
-
- protected function updateAssociatedRecords(TActiveRecord $record,$updateBelongsTo=false)
- {
- $context = new TActiveRecordRelationContext($record);
- return $context->updateAssociatedRecords($updateBelongsTo);
- }
-
- /**
- * Delete the record.
- * @param TActiveRecord record to be deleted.
- * @return int number of rows affected.
- */
- public function delete(TActiveRecord $record)
- {
- return $this->getCommand($record)->deleteByPk($this->getPrimaryKeyValues($record));
- }
-
- protected function getPrimaryKeyValues(TActiveRecord $record)
- {
- $tableInfo = $this->getCommand($record)->getTableInfo();
- $primary=array();
- foreach($tableInfo->getColumns() as $name=>$column)
- {
- if($column->getIsPrimaryKey())
- $primary[$name] = $record->getColumnValue($name);
- }
- return $primary;
- }
-
- /**
- * Delete multiple records using primary keys.
- * @param TActiveRecord finder instance.
- * @return int number of rows deleted.
- */
- public function deleteRecordsByPk(TActiveRecord $record, $keys)
- {
- return $this->getCommand($record)->deleteByPk($keys);
- }
-
- /**
- * Delete multiple records by criteria.
- * @param TActiveRecord active record finder instance.
- * @param TActiveRecordCriteria search criteria
- * @return int number of records.
- */
- public function deleteRecordsByCriteria(TActiveRecord $record, $criteria)
- {
- return $this->getCommand($record)->delete($criteria);
- }
-
- /**
- * Raise the corresponding command event, insert, update, delete or select.
- * @param string command type
- * @param TDbCommand sql command to be executed.
- * @param TActiveRecord active record
- * @param TActiveRecordCriteria data for the command.
- */
- protected function raiseCommandEvent($event,$command,$record,$criteria)
- {
- if(!($criteria instanceof TSqlCriteria))
- $criteria = new TActiveRecordCriteria(null,$criteria);
- $param = new TActiveRecordEventParameter($command,$record,$criteria);
- $manager = $record->getRecordManager();
- $manager->{$event}($param);
- $record->{$event}($param);
- }
-}
-
-?>
+<?php
+/**
+ * TActiveRecordGateway, TActiveRecordStatementType, TActiveRecordEventParameter classes file.
+ *
+ * @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @package System.Data.ActiveRecord
+ */
+
+/**
+ * TActiveRecordGateway excutes the SQL command queries and returns the data
+ * record as arrays (for most finder methods).
+ *
+ * @author Wei Zhuo <weizho[at]gmail[dot]com>
+ * @version $Id$
+ * @package System.Data.ActiveRecord
+ * @since 3.1
+ */
+class TActiveRecordGateway extends TComponent
+{
+ private $_manager;
+ private $_tables=array(); //table cache
+ private $_meta=array(); //meta data cache.
+ private $_commandBuilders=array();
+ private $_currentRecord;
+
+ /**
+ * Constant name for specifying optional table name in TActiveRecord.
+ */
+ const TABLE_CONST='TABLE';
+ /**
+ * Method name for returning optional table name in in TActiveRecord
+ */
+ const TABLE_METHOD='table';
+
+ /**
+ * Record gateway constructor.
+ * @param TActiveRecordManager $manager
+ */
+ public function __construct(TActiveRecordManager $manager)
+ {
+ $this->_manager=$manager;
+ }
+
+ /**
+ * @return TActiveRecordManager record manager.
+ */
+ protected function getManager()
+ {
+ return $this->_manager;
+ }
+
+ /**
+ * Gets the table name from the 'TABLE' constant of the active record
+ * class if defined, otherwise use the class name as table name.
+ * @param TActiveRecord active record instance
+ * @return string table name for the given record class.
+ */
+ protected function getRecordTableName(TActiveRecord $record)
+ {
+ $class = new ReflectionClass($record);
+ if($class->hasConstant(self::TABLE_CONST))
+ {
+ $value = $class->getConstant(self::TABLE_CONST);
+ if(empty($value))
+ throw new TActiveRecordException('ar_invalid_tablename_property',
+ get_class($record),self::TABLE_CONST);
+ return $value;
+ }
+ elseif ($class->hasMethod(self::TABLE_METHOD))
+ {
+ $value = $record->{self::TABLE_METHOD}();
+ if(empty($value))
+ throw new TActiveRecordException('ar_invalid_tablename_method',
+ get_class($record),self::TABLE_METHOD);
+ return $value;
+ }
+ else
+ return strtolower(get_class($record));
+ }
+
+ /**
+ * Returns table information, trys the application cache first.
+ * @param TActiveRecord $record
+ * @return TDbTableInfo table information.
+ */
+ public function getRecordTableInfo(TActiveRecord $record)
+ {
+ $tableName = $this->getRecordTableName($record);
+ return $this->getTableInfo($record->getDbConnection(), $tableName);
+ }
+
+ /**
+ * Returns table information for table in the database connection.
+ * @param TDbConnection database connection
+ * @param string table name
+ * @return TDbTableInfo table details.
+ */
+ public function getTableInfo(TDbConnection $connection, $tableName)
+ {
+ $connStr = $connection->getConnectionString();
+ $key = $connStr.$tableName;
+ if(!isset($this->_tables[$key]))
+ {
+ //call this first to ensure that unserializing the cache
+ //will find the correct driver dependent classes.
+ if(!isset($this->_meta[$connStr]))
+ {
+ Prado::using('System.Data.Common.TDbMetaData');
+ $this->_meta[$connStr] = TDbMetaData::getInstance($connection);
+ }
+
+ $tableInfo = null;
+ if(($cache=$this->getManager()->getCache())!==null)
+ $tableInfo = $cache->get($key);
+ if(empty($tableInfo))
+ {
+ $tableInfo = $this->_meta[$connStr]->getTableInfo($tableName);
+ if($cache!==null)
+ $cache->set($key, $tableInfo);
+ }
+ $this->_tables[$key] = $tableInfo;
+ }
+ return $this->_tables[$key];
+ }
+
+ /**
+ * @param TActiveRecord $record
+ * @return TDataGatewayCommand
+ */
+ public function getCommand(TActiveRecord $record)
+ {
+ $conn = $record->getDbConnection();
+ $connStr = $conn->getConnectionString();
+ $tableInfo = $this->getRecordTableInfo($record);
+ if(!isset($this->_commandBuilders[$connStr]))
+ {
+ $builder = $tableInfo->createCommandBuilder($record->getDbConnection());
+ Prado::using('System.Data.DataGateway.TDataGatewayCommand');
+ $command = new TDataGatewayCommand($builder);
+ $command->OnCreateCommand[] = array($this, 'onCreateCommand');
+ $command->OnExecuteCommand[] = array($this, 'onExecuteCommand');
+ $this->_commandBuilders[$connStr] = $command;
+
+ }
+ $this->_commandBuilders[$connStr]->getBuilder()->setTableInfo($tableInfo);
+ $this->_currentRecord=$record;
+ return $this->_commandBuilders[$connStr];
+ }
+
+ /**
+ * Raised when a command is prepared and parameter binding is completed.
+ * The parameter object is TDataGatewayEventParameter of which the
+ * {@link TDataGatewayEventParameter::getCommand Command} property can be
+ * inspected to obtain the sql query to be executed.
+ * This method also raises the OnCreateCommand event on the ActiveRecord
+ * object calling this gateway.
+ * @param TDataGatewayCommand originator $sender
+ * @param TDataGatewayEventParameter
+ */
+ public function onCreateCommand($sender, $param)
+ {
+ $this->raiseEvent('OnCreateCommand', $this, $param);
+ if($this->_currentRecord!==null)
+ $this->_currentRecord->onCreateCommand($param);
+ }
+
+ /**
+ * Raised when a command is executed and the result from the database was returned.
+ * The parameter object is TDataGatewayResultEventParameter of which the
+ * {@link TDataGatewayEventParameter::getResult Result} property contains
+ * the data return from the database. The data returned can be changed
+ * by setting the {@link TDataGatewayEventParameter::setResult Result} property.
+ * This method also raises the OnCreateCommand event on the ActiveRecord
+ * object calling this gateway.
+ * @param TDataGatewayCommand originator $sender
+ * @param TDataGatewayResultEventParameter
+ */
+ public function onExecuteCommand($sender, $param)
+ {
+ $this->raiseEvent('OnExecuteCommand', $this, $param);
+ if($this->_currentRecord!==null)
+ $this->_currentRecord->onExecuteCommand($param);
+ }
+
+ /**
+ * Returns record data matching the given primary key(s). If the table uses
+ * composite key, specify the name value pairs as an array.
+ * @param TActiveRecord active record instance.
+ * @param array primary name value pairs
+ * @return array record data
+ */
+ public function findRecordByPK(TActiveRecord $record,$keys)
+ {
+ $command = $this->getCommand($record);
+ return $command->findByPk($keys);
+ }
+
+ /**
+ * Returns records matching the list of given primary keys.
+ * @param TActiveRecord active record instance.
+ * @param array list of primary name value pairs
+ * @return array matching data.
+ */
+ public function findRecordsByPks(TActiveRecord $record, $keys)
+ {
+ return $this->getCommand($record)->findAllByPk($keys);
+ }
+
+
+ /**
+ * Returns record data matching the given critera. If $iterator is true, it will
+ * return multiple rows as TDbDataReader otherwise it returns the <b>first</b> row data.
+ * @param TActiveRecord active record finder instance.
+ * @param TActiveRecordCriteria search criteria.
+ * @param boolean true to return multiple rows as iterator, false returns first row.
+ * @return mixed matching data.
+ */
+ public function findRecordsByCriteria(TActiveRecord $record, $criteria, $iterator=false)
+ {
+ $command = $this->getCommand($record);
+ return $iterator ? $command->findAll($criteria) : $command->find($criteria);
+ }
+
+ /**
+ * Return record data from sql query.
+ * @param TActiveRecord active record finder instance.
+ * @param TActiveRecordCriteria sql query
+ * @return array result.
+ */
+ public function findRecordBySql(TActiveRecord $record, $criteria)
+ {
+ return $this->getCommand($record)->findBySql($criteria);
+ }
+
+ /**
+ * Return record data from sql query.
+ * @param TActiveRecord active record finder instance.
+ * @param TActiveRecordCriteria sql query
+ * @return TDbDataReader result iterator.
+ */
+ public function findRecordsBySql(TActiveRecord $record, $criteria)
+ {
+ return $this->getCommand($record)->findAllBySql($criteria);
+ }
+
+ public function findRecordsByIndex(TActiveRecord $record, $criteria, $fields, $values)
+ {
+ return $this->getCommand($record)->findAllByIndex($criteria,$fields,$values);
+ }
+
+ /**
+ * Returns the number of records that match the given criteria.
+ * @param TActiveRecord active record finder instance.
+ * @param TActiveRecordCriteria search criteria
+ * @return int number of records.
+ */
+ public function countRecords(TActiveRecord $record, $criteria)
+ {
+ return $this->getCommand($record)->count($criteria);
+ }
+
+ /**
+ * Insert a new record.
+ * @param TActiveRecord new record.
+ * @return int number of rows affected.
+ */
+ public function insert(TActiveRecord $record)
+ {
+ //$this->updateAssociatedRecords($record,true);
+ $result = $this->getCommand($record)->insert($this->getInsertValues($record));
+ if($result)
+ $this->updatePostInsert($record);
+ //$this->updateAssociatedRecords($record);
+ return $result;
+ }
+
+ /**
+ * Sets the last insert ID to the corresponding property of the record if available.
+ * @param TActiveRecord record for insertion
+ */
+ protected function updatePostInsert($record)
+ {
+ $command = $this->getCommand($record);
+ $tableInfo = $command->getTableInfo();
+ foreach($tableInfo->getColumns() as $name => $column)
+ {
+ if($column->hasSequence())
+ $record->setColumnValue($name,$command->getLastInsertID($column->getSequenceName()));
+ }
+ }
+
+ /**
+ * @param TActiveRecord record
+ * @return array insert values.
+ */
+ protected function getInsertValues(TActiveRecord $record)
+ {
+ $values=array();
+ $tableInfo = $this->getCommand($record)->getTableInfo();
+ foreach($tableInfo->getColumns() as $name=>$column)
+ {
+ if($column->getIsExcluded())
+ continue;
+ $value = $record->getColumnValue($name);
+ if(!$column->getAllowNull() && $value===null && !$column->hasSequence() && !$column->getDefaultValue())
+ {
+ throw new TActiveRecordException(
+ 'ar_value_must_not_be_null', get_class($record),
+ $tableInfo->getTableFullName(), $name);
+ }
+ if($value!==null)
+ $values[$name] = $value;
+ }
+ return $values;
+ }
+
+ /**
+ * Update the record.
+ * @param TActiveRecord dirty record.
+ * @return int number of rows affected.
+ */
+ public function update(TActiveRecord $record)
+ {
+ //$this->updateAssociatedRecords($record,true);
+ list($data, $keys) = $this->getUpdateValues($record);
+ $result = $this->getCommand($record)->updateByPk($data, $keys);
+ //$this->updateAssociatedRecords($record);
+ return $result;
+ }
+
+ protected function getUpdateValues(TActiveRecord $record)
+ {
+ $values=array();
+ $tableInfo = $this->getCommand($record)->getTableInfo();
+ $primary=array();
+ foreach($tableInfo->getColumns() as $name=>$column)
+ {
+ if($column->getIsExcluded())
+ continue;
+ $value = $record->getColumnValue($name);
+ if(!$column->getAllowNull() && $value===null)
+ {
+ throw new TActiveRecordException(
+ 'ar_value_must_not_be_null', get_class($record),
+ $tableInfo->getTableFullName(), $name);
+ }
+ if($column->getIsPrimaryKey())
+ $primary[] = $value;
+ else
+ $values[$name] = $value;
+ }
+ return array($values,$primary);
+ }
+
+ protected function updateAssociatedRecords(TActiveRecord $record,$updateBelongsTo=false)
+ {
+ $context = new TActiveRecordRelationContext($record);
+ return $context->updateAssociatedRecords($updateBelongsTo);
+ }
+
+ /**
+ * Delete the record.
+ * @param TActiveRecord record to be deleted.
+ * @return int number of rows affected.
+ */
+ public function delete(TActiveRecord $record)
+ {
+ return $this->getCommand($record)->deleteByPk($this->getPrimaryKeyValues($record));
+ }
+
+ protected function getPrimaryKeyValues(TActiveRecord $record)
+ {
+ $tableInfo = $this->getCommand($record)->getTableInfo();
+ $primary=array();
+ foreach($tableInfo->getColumns() as $name=>$column)
+ {
+ if($column->getIsPrimaryKey())
+ $primary[$name] = $record->getColumnValue($name);
+ }
+ return $primary;
+ }
+
+ /**
+ * Delete multiple records using primary keys.
+ * @param TActiveRecord finder instance.
+ * @return int number of rows deleted.
+ */
+ public function deleteRecordsByPk(TActiveRecord $record, $keys)
+ {
+ return $this->getCommand($record)->deleteByPk($keys);
+ }
+
+ /**
+ * Delete multiple records by criteria.
+ * @param TActiveRecord active record finder instance.
+ * @param TActiveRecordCriteria search criteria
+ * @return int number of records.
+ */
+ public function deleteRecordsByCriteria(TActiveRecord $record, $criteria)
+ {
+ return $this->getCommand($record)->delete($criteria);
+ }
+
+ /**
+ * Raise the corresponding command event, insert, update, delete or select.
+ * @param string command type
+ * @param TDbCommand sql command to be executed.
+ * @param TActiveRecord active record
+ * @param TActiveRecordCriteria data for the command.
+ */
+ protected function raiseCommandEvent($event,$command,$record,$criteria)
+ {
+ if(!($criteria instanceof TSqlCriteria))
+ $criteria = new TActiveRecordCriteria(null,$criteria);
+ $param = new TActiveRecordEventParameter($command,$record,$criteria);
+ $manager = $record->getRecordManager();
+ $manager->{$event}($param);
+ $record->{$event}($param);
+ }
+}
+
diff --git a/framework/Data/ActiveRecord/TActiveRecordManager.php b/framework/Data/ActiveRecord/TActiveRecordManager.php
index ce14ac4d..9912e7ff 100644
--- a/framework/Data/ActiveRecord/TActiveRecordManager.php
+++ b/framework/Data/ActiveRecord/TActiveRecordManager.php
@@ -109,4 +109,3 @@ class TActiveRecordManager extends TComponent
}
-?>
diff --git a/framework/Data/Common/IbmDb2/TIbmColumnMetaData.php b/framework/Data/Common/IbmDb2/TIbmColumnMetaData.php
index ee87a374..3b7001ab 100644
--- a/framework/Data/Common/IbmDb2/TIbmColumnMetaData.php
+++ b/framework/Data/Common/IbmDb2/TIbmColumnMetaData.php
@@ -154,4 +154,3 @@ class TIbmColumnMetaData extends TComponent
}
-?>
diff --git a/framework/Data/Common/IbmDb2/TIbmMetaData.php b/framework/Data/Common/IbmDb2/TIbmMetaData.php
index 059ef2d5..496bb12f 100644
--- a/framework/Data/Common/IbmDb2/TIbmMetaData.php
+++ b/framework/Data/Common/IbmDb2/TIbmMetaData.php
@@ -110,4 +110,3 @@ class TIbmMetaData extends TDbMetaDataCommon
}
-?>
diff --git a/framework/Data/Common/IbmDb2/TIbmMetaDataInspector.php b/framework/Data/Common/IbmDb2/TIbmMetaDataInspector.php
index cfb4803d..a37fad6e 100644
--- a/framework/Data/Common/IbmDb2/TIbmMetaDataInspector.php
+++ b/framework/Data/Common/IbmDb2/TIbmMetaDataInspector.php
@@ -110,4 +110,3 @@ class TIbmMetaDataInspector extends TDbMetaDataInspector
return new TIbmMetaData($table,$columns,$pks);
}
}
-?>
diff --git a/framework/Data/Common/Mssql/TMssqlCommandBuilder.php b/framework/Data/Common/Mssql/TMssqlCommandBuilder.php
index 75d98198..1a0ad4ce 100644
--- a/framework/Data/Common/Mssql/TMssqlCommandBuilder.php
+++ b/framework/Data/Common/Mssql/TMssqlCommandBuilder.php
@@ -170,4 +170,3 @@ class TMssqlCommandBuilder extends TDbCommandBuilder
}
}
-?>
diff --git a/framework/Data/Common/Mssql/TMssqlMetaData.php b/framework/Data/Common/Mssql/TMssqlMetaData.php
index faa94e69..8309e4ec 100644
--- a/framework/Data/Common/Mssql/TMssqlMetaData.php
+++ b/framework/Data/Common/Mssql/TMssqlMetaData.php
@@ -232,4 +232,3 @@ EOD;
}
}
-?>
diff --git a/framework/Data/Common/Mssql/TMssqlTableColumn.php b/framework/Data/Common/Mssql/TMssqlTableColumn.php
index 5f41f429..8a291b52 100644
--- a/framework/Data/Common/Mssql/TMssqlTableColumn.php
+++ b/framework/Data/Common/Mssql/TMssqlTableColumn.php
@@ -62,4 +62,3 @@ class TMssqlTableColumn extends TDbTableColumn
}
}
-?>
diff --git a/framework/Data/Common/Mssql/TMssqlTableInfo.php b/framework/Data/Common/Mssql/TMssqlTableInfo.php
index 3a2ae033..356c6f26 100644
--- a/framework/Data/Common/Mssql/TMssqlTableInfo.php
+++ b/framework/Data/Common/Mssql/TMssqlTableInfo.php
@@ -62,4 +62,3 @@ class TMssqlTableInfo extends TDbTableInfo
}
}
-?>
diff --git a/framework/Data/Common/Mysql/TMysqlCommandBuilder.php b/framework/Data/Common/Mysql/TMysqlCommandBuilder.php
index b296a82d..3326851f 100644
--- a/framework/Data/Common/Mysql/TMysqlCommandBuilder.php
+++ b/framework/Data/Common/Mysql/TMysqlCommandBuilder.php
@@ -24,4 +24,3 @@ class TMysqlCommandBuilder extends TDbCommandBuilder
{
}
-?>
diff --git a/framework/Data/Common/Mysql/TMysqlMetaData.php b/framework/Data/Common/Mysql/TMysqlMetaData.php
index aaebd8dc..75f7a7cf 100644
--- a/framework/Data/Common/Mysql/TMysqlMetaData.php
+++ b/framework/Data/Common/Mysql/TMysqlMetaData.php
@@ -246,7 +246,9 @@ class TMysqlMetaData extends TDbMetaData
if($row['Key_name']==='PRIMARY')
$primary[] = $row['Column_name'];
}
- if($this->getServerVersion() > 5)
+ // MySQL version was increased to >=5.1.21 instead of 5.x
+ // due to a MySQL bug (http://bugs.mysql.com/bug.php?id=19588)
+ if($this->getServerVersion() >= 5.121)
$foreign = $this->getForeignConstraints($schemaName,$tableName);
else
$foreign = $this->findForeignConstraints($schemaName,$tableName);
@@ -352,4 +354,3 @@ EOD;
}
}
-?>
diff --git a/framework/Data/Common/Mysql/TMysqlTableColumn.php b/framework/Data/Common/Mysql/TMysqlTableColumn.php
index 99b4333a..5f4351a7 100644
--- a/framework/Data/Common/Mysql/TMysqlTableColumn.php
+++ b/framework/Data/Common/Mysql/TMysqlTableColumn.php
@@ -70,4 +70,3 @@ class TMysqlTableColumn extends TDbTableColumn
}
}
-?>
diff --git a/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php b/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php
index 460da46a..4cae8b89 100644
--- a/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php
+++ b/framework/Data/Common/Pgsql/TPgsqlCommandBuilder.php
@@ -67,4 +67,3 @@ class TPgsqlCommandBuilder extends TDbCommandBuilder
}
-?>
diff --git a/framework/Data/Common/Pgsql/TPgsqlMetaData.php b/framework/Data/Common/Pgsql/TPgsqlMetaData.php
index 45d55086..a2243531 100644
--- a/framework/Data/Common/Pgsql/TPgsqlMetaData.php
+++ b/framework/Data/Common/Pgsql/TPgsqlMetaData.php
@@ -390,4 +390,3 @@ EOD;
}
}
-?>
diff --git a/framework/Data/Common/Pgsql/TPgsqlTableColumn.php b/framework/Data/Common/Pgsql/TPgsqlTableColumn.php
index 7ec2312a..562e2c56 100644
--- a/framework/Data/Common/Pgsql/TPgsqlTableColumn.php
+++ b/framework/Data/Common/Pgsql/TPgsqlTableColumn.php
@@ -47,4 +47,3 @@ class TPgsqlTableColumn extends TDbTableColumn
}
}
-?>
diff --git a/framework/Data/Common/Pgsql/TPgsqlTableInfo.php b/framework/Data/Common/Pgsql/TPgsqlTableInfo.php
index 2a3a8461..2447c141 100644
--- a/framework/Data/Common/Pgsql/TPgsqlTableInfo.php
+++ b/framework/Data/Common/Pgsql/TPgsqlTableInfo.php
@@ -56,4 +56,3 @@ class TPgsqlTableInfo extends TDbTableInfo
}
}
-?>
diff --git a/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php b/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php
index c02ed76d..c60e17a3 100644
--- a/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php
+++ b/framework/Data/Common/Sqlite/TSqliteCommandBuilder.php
@@ -45,4 +45,3 @@ class TSqliteCommandBuilder extends TDbCommandBuilder
}
}
-?>
diff --git a/framework/Data/Common/Sqlite/TSqliteMetaData.php b/framework/Data/Common/Sqlite/TSqliteMetaData.php
index c562c930..010a2148 100644
--- a/framework/Data/Common/Sqlite/TSqliteMetaData.php
+++ b/framework/Data/Common/Sqlite/TSqliteMetaData.php
@@ -178,4 +178,3 @@ CREATE TABLE bar
);
*/
-?>
diff --git a/framework/Data/Common/Sqlite/TSqliteTableColumn.php b/framework/Data/Common/Sqlite/TSqliteTableColumn.php
index 3c9100ab..4e79de6d 100644
--- a/framework/Data/Common/Sqlite/TSqliteTableColumn.php
+++ b/framework/Data/Common/Sqlite/TSqliteTableColumn.php
@@ -62,4 +62,3 @@ class TSqliteTableColumn extends TDbTableColumn
}
}
-?>
diff --git a/framework/Data/Common/Sqlite/TSqliteTableInfo.php b/framework/Data/Common/Sqlite/TSqliteTableInfo.php
index 95c3fe02..b729a593 100644
--- a/framework/Data/Common/Sqlite/TSqliteTableInfo.php
+++ b/framework/Data/Common/Sqlite/TSqliteTableInfo.php
@@ -45,4 +45,3 @@ class TSqliteTableInfo extends TDbTableInfo
}
}
-?>
diff --git a/framework/Data/Common/TDbMetaData.php b/framework/Data/Common/TDbMetaData.php
index c0f10d41..bcdf0e46 100644
--- a/framework/Data/Common/TDbMetaData.php
+++ b/framework/Data/Common/TDbMetaData.php
@@ -121,4 +121,3 @@ abstract class TDbMetaData extends TComponent
}
}
-?>
diff --git a/framework/Data/Common/TDbTableColumn.php b/framework/Data/Common/TDbTableColumn.php
index b3d603ae..3bb9454b 100644
--- a/framework/Data/Common/TDbTableColumn.php
+++ b/framework/Data/Common/TDbTableColumn.php
@@ -197,4 +197,3 @@ class TDbTableColumn extends TComponent
}
}
-?>
diff --git a/framework/Data/Common/TDbTableInfo.php b/framework/Data/Common/TDbTableInfo.php
index 87af2234..e2aae3d0 100644
--- a/framework/Data/Common/TDbTableInfo.php
+++ b/framework/Data/Common/TDbTableInfo.php
@@ -156,4 +156,3 @@ class TDbTableInfo extends TComponent
}
}
-?>
diff --git a/framework/Data/DataGateway/TTableGateway.php b/framework/Data/DataGateway/TTableGateway.php
index 0f2644be..163efcf5 100644
--- a/framework/Data/DataGateway/TTableGateway.php
+++ b/framework/Data/DataGateway/TTableGateway.php
@@ -474,4 +474,3 @@ class TTableGateway extends TComponent
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TDiscriminator.php b/framework/Data/SqlMap/Configuration/TDiscriminator.php
index 75ce2352..747c4158 100644
--- a/framework/Data/SqlMap/Configuration/TDiscriminator.php
+++ b/framework/Data/SqlMap/Configuration/TDiscriminator.php
@@ -230,4 +230,3 @@ class TSubMap extends TComponent
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php b/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php
index d29d5f27..2e8f38d6 100644
--- a/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php
+++ b/framework/Data/SqlMap/Configuration/TInlineParameterMapParser.php
@@ -27,7 +27,7 @@ class TInlineParameterMapParser
/**
* Regular expression for parsing inline parameter maps.
*/
- const PARAMETER_TOKEN_REGEXP = '/#(#?[^#]+#?)#/';
+ const PARAMETER_TOKEN_REGEXP = '/#([^#]+)#/';
/**
* Parse the sql text for inline parameters.
@@ -77,4 +77,3 @@ class TInlineParameterMapParser
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TParameterMap.php b/framework/Data/SqlMap/Configuration/TParameterMap.php
index 117c6037..f4fbbe1c 100644
--- a/framework/Data/SqlMap/Configuration/TParameterMap.php
+++ b/framework/Data/SqlMap/Configuration/TParameterMap.php
@@ -205,4 +205,3 @@ class TParameterMap extends TComponent
return $value;
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TParameterProperty.php b/framework/Data/SqlMap/Configuration/TParameterProperty.php
index d0af3a75..dcea754c 100644
--- a/framework/Data/SqlMap/Configuration/TParameterProperty.php
+++ b/framework/Data/SqlMap/Configuration/TParameterProperty.php
@@ -136,4 +136,3 @@ class TParameterProperty extends TComponent
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TResultMap.php b/framework/Data/SqlMap/Configuration/TResultMap.php
index 168041d2..d59d9522 100644
--- a/framework/Data/SqlMap/Configuration/TResultMap.php
+++ b/framework/Data/SqlMap/Configuration/TResultMap.php
@@ -198,4 +198,3 @@ class TResultMap extends TComponent
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TResultProperty.php b/framework/Data/SqlMap/Configuration/TResultProperty.php
index 711fa7a0..8e20d5e4 100644
--- a/framework/Data/SqlMap/Configuration/TResultProperty.php
+++ b/framework/Data/SqlMap/Configuration/TResultProperty.php
@@ -326,4 +326,3 @@ class TResultProperty extends TComponent
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php b/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php
index 6df8cefd..9a9b1277 100644
--- a/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php
+++ b/framework/Data/SqlMap/Configuration/TSimpleDynamicParser.php
@@ -43,4 +43,3 @@ class TSimpleDynamicParser
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php b/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php
index edb78ea7..d7984dc4 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapCacheModel.php
@@ -214,4 +214,3 @@ class TSqlMapCacheKey
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapStatement.php b/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
index 77b714fd..3afcc75f 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
@@ -428,4 +428,3 @@ class TSqlMapSelectKey extends TSqlMapStatement
}
}
-?>
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
index d0c57d57..f2d13966 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
@@ -309,6 +309,16 @@ class TSqlMapXmlMappingConfiguration extends TSqlMapXmlConfigBuilder
private $_FlushOnExecuteStatements=array();
+ /**
+ * Regular expressions for escaping simple/inline parameter symbols
+ */
+ const SIMPLE_MARK='$';
+ const INLINE_SYMBOL='#';
+ const ESCAPED_SIMPLE_MARK_REGEXP='/\$\$/';
+ const ESCAPED_INLINE_SYMBOL_REGEXP='/\#\#/';
+ const SIMPLE_PLACEHOLDER='`!!`';
+ const INLINE_PLACEHOLDER='`!!!`';
+
/**
* @param TSqlMapXmlConfiguration parent xml configuration.
*/
@@ -532,6 +542,7 @@ class TSqlMapXmlMappingConfiguration extends TSqlMapXmlConfigBuilder
$scope['file'] = $this->_configFile;
$scope['node'] = $node;
+ $sqlStatement=preg_replace(self::ESCAPED_INLINE_SYMBOL_REGEXP,self::INLINE_PLACEHOLDER,$sqlStatement);
if($statement->parameterMap() === null)
{
// Build a Parametermap with the inline parameters.
@@ -548,6 +559,7 @@ class TSqlMapXmlMappingConfiguration extends TSqlMapXmlConfigBuilder
}
$sqlStatement = $sqlText['sql'];
}
+ $sqlStatement=preg_replace('/'.self::INLINE_PLACEHOLDER.'/',self::INLINE_SYMBOL,$sqlStatement);
$this->prepareSql($statement, $sqlStatement, $node);
}
@@ -562,6 +574,7 @@ class TSqlMapXmlMappingConfiguration extends TSqlMapXmlConfigBuilder
protected function prepareSql($statement,$sqlStatement, $node)
{
$simpleDynamic = new TSimpleDynamicParser;
+ $sqlStatement=preg_replace(self::ESCAPED_SIMPLE_MARK_REGEXP,self::SIMPLE_PLACEHOLDER,$sqlStatement);
$dynamics = $simpleDynamic->parse($sqlStatement);
if(count($dynamics['parameters']) > 0)
{
@@ -570,6 +583,7 @@ class TSqlMapXmlMappingConfiguration extends TSqlMapXmlConfigBuilder
}
else
$sql = new TStaticSql();
+ $sqlStatement=preg_replace('/'.self::SIMPLE_PLACEHOLDER.'/',self::SIMPLE_MARK,$sqlStatement);
$sql->buildPreparedStatement($statement, $sqlStatement);
$statement->setSqlText($sql);
}
@@ -724,4 +738,3 @@ class TSqlMapXmlMappingConfiguration extends TSqlMapXmlConfigBuilder
}
}
-?>
diff --git a/framework/Data/SqlMap/DataMapper/TLazyLoadList.php b/framework/Data/SqlMap/DataMapper/TLazyLoadList.php
index 02b08e8e..69b20bf6 100644
--- a/framework/Data/SqlMap/DataMapper/TLazyLoadList.php
+++ b/framework/Data/SqlMap/DataMapper/TLazyLoadList.php
@@ -142,4 +142,3 @@ class TObjectProxy
}
}
-?>
diff --git a/framework/Data/SqlMap/DataMapper/TPropertyAccess.php b/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
index 23e854ac..a27cb50f 100644
--- a/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
+++ b/framework/Data/SqlMap/DataMapper/TPropertyAccess.php
@@ -106,7 +106,8 @@ class TPropertyAccess
$object = $object->{$getter}();
else if(in_array($prop, array_keys(get_object_vars($object))))
$object = $object->{$prop};
- return false;
+ else
+ return false;
}
else
return false;
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapCache.php b/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
index 61c5bb95..05b72e08 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapCache.php
@@ -225,4 +225,3 @@ class TSqlMapApplicationCache implements ICache
}
}
-?>
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapException.php b/framework/Data/SqlMap/DataMapper/TSqlMapException.php
index 69a0b0cd..0bf0ac32 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapException.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapException.php
@@ -113,4 +113,3 @@ class TSqlMapExecutionException extends TSqlMapException
{
}
-?>
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php b/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
index b3a88653..86171c1e 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapPagedList.php
@@ -206,4 +206,3 @@ class TSqlMapPagedList extends TPagedList
}
}
-?>
diff --git a/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php b/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php
index aa39dce1..05866395 100644
--- a/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php
+++ b/framework/Data/SqlMap/DataMapper/TSqlMapTypeHandlerRegistry.php
@@ -190,4 +190,3 @@ abstract class TSqlMapTypeHandler extends TComponent
public abstract function createNewInstance($row=null);
}
-?>
diff --git a/framework/Data/SqlMap/Statements/IMappedStatement.php b/framework/Data/SqlMap/Statements/IMappedStatement.php
index 94189420..dc628c9e 100644
--- a/framework/Data/SqlMap/Statements/IMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/IMappedStatement.php
@@ -80,4 +80,3 @@ interface IMappedStatement
public function executeQueryForObject($connection,$parameter, $result=null);
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TCachingStatement.php b/framework/Data/SqlMap/Statements/TCachingStatement.php
index 7c9498d4..c8a748c1 100644
--- a/framework/Data/SqlMap/Statements/TCachingStatement.php
+++ b/framework/Data/SqlMap/Statements/TCachingStatement.php
@@ -106,4 +106,3 @@ class TCachingStatement implements IMappedStatement
}
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php b/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php
index bb95cab9..1a3d738a 100644
--- a/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TDeleteMappedStatement.php
@@ -22,4 +22,3 @@ class TDeleteMappedStatement extends TUpdateMappedStatement
{
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TInsertMappedStatement.php b/framework/Data/SqlMap/Statements/TInsertMappedStatement.php
index 28ade045..1efb5b6b 100644
--- a/framework/Data/SqlMap/Statements/TInsertMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TInsertMappedStatement.php
@@ -47,4 +47,3 @@ class TInsertMappedStatement extends TMappedStatement
}
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TMappedStatement.php b/framework/Data/SqlMap/Statements/TMappedStatement.php
index 2feeba90..6a9130fe 100644
--- a/framework/Data/SqlMap/Statements/TMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TMappedStatement.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Data.SqlMap.Statements
@@ -561,7 +561,7 @@ class TMappedStatement extends TComponent implements IMappedStatement
else
$obj = $this->fillDefaultResultMap(null, $row, $resultObject);
if(class_exists('TActiveRecord',false) && $obj instanceof TActiveRecord)
- //Create a new clean active record.
+ //Create a new clean active record.
$obj=TActiveRecord::createRecord(get_class($obj),$obj);
return $obj;
}
@@ -1115,7 +1115,7 @@ class TSqlMapObjectCollectionTree
else if(is_array($list))
$list[] = $this->_entries[$node]['object'];
else
- throw TSqlMapExecutionException(
+ throw new TSqlMapExecutionException(
'sqlmap_property_must_be_list');
}
@@ -1216,4 +1216,3 @@ class TResultSetMapItemParameter extends TComponent
}
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TPreparedCommand.php b/framework/Data/SqlMap/Statements/TPreparedCommand.php
index 76407190..99bb6eff 100644
--- a/framework/Data/SqlMap/Statements/TPreparedCommand.php
+++ b/framework/Data/SqlMap/Statements/TPreparedCommand.php
@@ -58,4 +58,3 @@ class TPreparedCommand
}
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TPreparedStatement.php b/framework/Data/SqlMap/Statements/TPreparedStatement.php
index be005e81..7d862378 100644
--- a/framework/Data/SqlMap/Statements/TPreparedStatement.php
+++ b/framework/Data/SqlMap/Statements/TPreparedStatement.php
@@ -41,4 +41,3 @@ class TPreparedStatement extends TComponent
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
index 5c3e2f22..44603408 100644
--- a/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
+++ b/framework/Data/SqlMap/Statements/TPreparedStatementFactory.php
@@ -47,4 +47,3 @@ class TPreparedStatementFactory
}
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TSelectMappedStatement.php b/framework/Data/SqlMap/Statements/TSelectMappedStatement.php
index a8253536..1802db2f 100644
--- a/framework/Data/SqlMap/Statements/TSelectMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TSelectMappedStatement.php
@@ -34,4 +34,3 @@ class TSelectMappedStatement extends TMappedStatement
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php b/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
index 38554778..910fd659 100644
--- a/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
+++ b/framework/Data/SqlMap/Statements/TSimpleDynamicSql.php
@@ -47,4 +47,3 @@ class TSimpleDynamicSql extends TStaticSql
}
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TStaticSql.php b/framework/Data/SqlMap/Statements/TStaticSql.php
index 8f4687df..eba54ed7 100644
--- a/framework/Data/SqlMap/Statements/TStaticSql.php
+++ b/framework/Data/SqlMap/Statements/TStaticSql.php
@@ -34,4 +34,3 @@ class TStaticSql extends TComponent
}
}
-?>
diff --git a/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php b/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php
index c0aa798e..633ec797 100644
--- a/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php
+++ b/framework/Data/SqlMap/Statements/TUpdateMappedStatement.php
@@ -47,4 +47,3 @@ class TUpdateMappedStatement extends TMappedStatement
}
}
-?>
diff --git a/framework/Data/SqlMap/TSqlMapConfig.php b/framework/Data/SqlMap/TSqlMapConfig.php
index 5a779dda..98f2a844 100644
--- a/framework/Data/SqlMap/TSqlMapConfig.php
+++ b/framework/Data/SqlMap/TSqlMapConfig.php
@@ -162,4 +162,3 @@ class TSqlMapConfig extends TDataSourceConfig
}
}
-?>
diff --git a/framework/Data/SqlMap/TSqlMapGateway.php b/framework/Data/SqlMap/TSqlMapGateway.php
index dd7c2069..97b31b50 100644
--- a/framework/Data/SqlMap/TSqlMapGateway.php
+++ b/framework/Data/SqlMap/TSqlMapGateway.php
@@ -259,4 +259,3 @@ class TSqlMapGateway extends TComponent
}
}
-?>
diff --git a/framework/Data/SqlMap/TSqlMapManager.php b/framework/Data/SqlMap/TSqlMapManager.php
index 62c2de20..290050d1 100644
--- a/framework/Data/SqlMap/TSqlMapManager.php
+++ b/framework/Data/SqlMap/TSqlMapManager.php
@@ -258,4 +258,3 @@ class TSqlMapManager extends TComponent
}
}
-?>
diff --git a/framework/Data/TDataSourceConfig.php b/framework/Data/TDataSourceConfig.php
index 804ea848..9e6bb2fc 100644
--- a/framework/Data/TDataSourceConfig.php
+++ b/framework/Data/TDataSourceConfig.php
@@ -165,5 +165,3 @@ class TDataSourceConfig extends TModule
throw new TConfigurationException('datasource_dbconnection_invalid',$id);
}
}
-
-?>
diff --git a/framework/Data/TDbCommand.php b/framework/Data/TDbCommand.php
index c48e7ded..d09c53f4 100644
--- a/framework/Data/TDbCommand.php
+++ b/framework/Data/TDbCommand.php
@@ -305,4 +305,3 @@ class TDbCommand extends TComponent
}
}
-?>
diff --git a/framework/Data/TDbConnection.php b/framework/Data/TDbConnection.php
index 5489c7fd..259ca7b7 100644
--- a/framework/Data/TDbConnection.php
+++ b/framework/Data/TDbConnection.php
@@ -167,9 +167,11 @@ class TDbConnection extends TComponent
try
{
$this->_pdo=new PDO($this->getConnectionString(),$this->getUsername(),
- $this->getPassword(),$this->_attributes);
+ $this->getPassword(),$this->_attributes);
+ // This attribute is only useful for PDO::MySql driver.
+ // Ignore the warning if a driver doesn't understand this.
+ @$this->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $this->_pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$this->_active=true;
$this->setConnectionCharset();
}
diff --git a/framework/Data/TDbDataReader.php b/framework/Data/TDbDataReader.php
index 65fc363d..7b54414e 100644
--- a/framework/Data/TDbDataReader.php
+++ b/framework/Data/TDbDataReader.php
@@ -223,4 +223,3 @@ class TDbDataReader extends TComponent implements Iterator
}
}
-?>
diff --git a/framework/Data/TDbTransaction.php b/framework/Data/TDbTransaction.php
index 5a19cacf..60b14a55 100644
--- a/framework/Data/TDbTransaction.php
+++ b/framework/Data/TDbTransaction.php
@@ -110,4 +110,3 @@ class TDbTransaction extends TComponent
}
}
-?>
diff --git a/framework/Exceptions/TErrorHandler.php b/framework/Exceptions/TErrorHandler.php
index 589e841c..fa8e6d4a 100644
--- a/framework/Exceptions/TErrorHandler.php
+++ b/framework/Exceptions/TErrorHandler.php
@@ -362,4 +362,3 @@ class TErrorHandler extends TModule
}
}
-?>
diff --git a/framework/Exceptions/TException.php b/framework/Exceptions/TException.php
index 4173a04e..c6a87b4d 100644
--- a/framework/Exceptions/TException.php
+++ b/framework/Exceptions/TException.php
@@ -417,4 +417,3 @@ class THttpException extends TSystemException
}
}
-?>
diff --git a/framework/Exceptions/messages/messages.txt b/framework/Exceptions/messages/messages.txt
index 3edd5d49..fc2b63f1 100644
--- a/framework/Exceptions/messages/messages.txt
+++ b/framework/Exceptions/messages/messages.txt
@@ -408,6 +408,11 @@ soapservice_serverid_duplicated = SOAP server ID '{0}' is duplicated.
soapserver_id_invalid = Invalid SOAP server ID '{0}'. It should not end with '.wsdl'.
soapserver_version_invalid = Invalid SOAP version '{0}'. It must be either '1.1' or '1.2'.
+jsonservice_id_required = TJsonService requires 'id' attribute in its JSON elements.
+jsonservice_response_type_invalid = JSON class {0} is invalid. It should be TJsonResponse or extend from TJsonResponse.
+jsonservice_class_required = TJsonService requires 'class' attribute in its JSON elements.
+jsonservice_provider_unknown = Unknown JSON provider '{0}' requested.
+
dbusermanager_userclass_required = TDbUserManager.UserClass is required.
dbusermanager_userclass_invalid = TDbUserManager.UserClass '{0}' is not a valid user class. The class must extend TDbUser.
dbusermanager_connectionid_invalid = TDbUserManager.ConnectionID '{0}' does not point to a valid TDataSourceConfig module.
@@ -466,3 +471,5 @@ datasource_dbconnection_invalid = TDataSourceConfig.DbConnection '{0}' is inva
response_status_reason_missing = HTTP 1.1 need reason for extended status-codes
response_status_reason_badchars = For HTTP 1.1 header, the token status-reason must not contain token CR or LF
+
+activefileupload_temppath_invalid = TActiveFileUpload TempPath path '{0}' does not exist or is not writable by Web server process.
diff --git a/framework/I18N/TDateFormat.php b/framework/I18N/TDateFormat.php
index 2343011e..914131bd 100644
--- a/framework/I18N/TDateFormat.php
+++ b/framework/I18N/TDateFormat.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.I18N
@@ -51,6 +51,9 @@ Prado::using('System.I18N.TI18NControl');
* 'fulldate', 'longdate', 'mediumdate', 'shortdate', 'fulltime',
* 'longtime', 'mediumtime', and 'shorttime'. Custom patterns can specified
* when the Pattern property does not match the predefined patterns.
+ * - <b>DefaultText</b>, string,
+ * <br>Gets or sets the default text. If Value is not set, DefaultText will be
+ * shown instead of todays date and time.
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
* @version v1.0, last update on Sat Dec 11 15:25:11 EST 2004
@@ -146,7 +149,11 @@ class TDateFormat extends TI18NControl implements IDataRenderer
{
$value = $this->getViewState('Value','');
if(empty($value))
- return time();
+ {
+ $defaultText = $this->getDefaultText();
+ if(empty($defaultText))
+ return time();
+ }
return $value;
}
@@ -158,6 +165,24 @@ class TDateFormat extends TI18NControl implements IDataRenderer
{
$this->setViewState('Value',$value,'');
}
+
+ /**
+ * Get the default text value for this control.
+ * @return string default text value
+ */
+ public function getDefaultText()
+ {
+ return $this->getViewState('DefaultText','');
+ }
+
+ /**
+ * Set the default text value for this control.
+ * @param string default text value
+ */
+ public function setDefaultText($value)
+ {
+ $this->setViewState('DefaultText',$value,'');
+ }
/**
* Get the date-time value for this control.
@@ -193,6 +218,11 @@ class TDateFormat extends TI18NControl implements IDataRenderer
*/
protected function getFormattedDate()
{
+ $value = $this->getValue();
+ $defaultText = $this->getDefaultText();
+ if(empty($value) && !empty($defaultText))
+ return $this->getDefaultText();
+
$app = $this->getApplication()->getGlobalization();
//initialized the default class wide formatter
@@ -205,12 +235,12 @@ class TDateFormat extends TI18NControl implements IDataRenderer
if(strlen($culture) && $app->getCulture() !== $culture)
{
$formatter = new DateFormat($culture);
- return $formatter->format($this->getValue(),
+ return $formatter->format($value,
$this->getPattern(),
$this->getCharset());
}
//return the application wide culture formatted date time.
- $result = self::$formatter->format($this->getValue(),
+ $result = self::$formatter->format($value,
$this->getPattern(),
$this->getCharset());
return $result;
@@ -221,5 +251,4 @@ class TDateFormat extends TI18NControl implements IDataRenderer
$writer->write($this->getFormattedDate());
}
-}
-?>
+} \ No newline at end of file
diff --git a/framework/I18N/TGlobalizationAutoDetect.php b/framework/I18N/TGlobalizationAutoDetect.php
index b4611910..a77ea861 100644
--- a/framework/I18N/TGlobalizationAutoDetect.php
+++ b/framework/I18N/TGlobalizationAutoDetect.php
@@ -47,4 +47,3 @@ class TGlobalizationAutoDetect extends TGlobalization
}
}
-?>
diff --git a/framework/I18N/TI18NControl.php b/framework/I18N/TI18NControl.php
index 9060ee77..ac3246fe 100644
--- a/framework/I18N/TI18NControl.php
+++ b/framework/I18N/TI18NControl.php
@@ -88,4 +88,3 @@ class TI18NControl extends TControl
}
}
-?>
diff --git a/framework/I18N/TNumberFormat.php b/framework/I18N/TNumberFormat.php
index 12422521..62b43243 100644
--- a/framework/I18N/TNumberFormat.php
+++ b/framework/I18N/TNumberFormat.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.I18N
@@ -56,6 +56,9 @@ Prado::using('System.I18N.TI18NControl');
* The default is 'USD' if the Currency property is not specified.
* - <b>Pattern</b>, string,
* <br>Gets or sets the custom number formatting pattern.
+ * - <b>DefaultText</b>, string,
+ * <br>Gets or sets the default text. If Value is not set, DefaultText will be
+ * shown instead of the default currency Value/Pattern.
*
* @author Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>
* @version v1.0, last update on Sat Dec 11 17:49:56 EST 2004
@@ -105,6 +108,23 @@ class TNumberFormat extends TI18NControl implements IDataRenderer
$this->setViewState('Value',$value,'');
}
+ /**
+ * Get the default text value for this control.
+ * @return string default text value
+ */
+ public function getDefaultText()
+ {
+ return $this->getViewState('DefaultText','');
+ }
+
+ /**
+ * Set the default text value for this control.
+ * @param string default text value
+ */
+ public function setDefaultText($value)
+ {
+ $this->setViewState('DefaultText',$value,'');
+ }
/**
* Get the numberic value for this control.
@@ -193,6 +213,11 @@ class TNumberFormat extends TI18NControl implements IDataRenderer
*/
protected function getFormattedValue()
{
+ $value = $this->getValue();
+ $defaultText = $this->getDefaultText();
+ if(empty($value) && !empty($defaultText))
+ return $this->getDefaultText();
+
$app = $this->getApplication()->getGlobalization();
//initialized the default class wide formatter
if(is_null(self::$formatter))
@@ -223,4 +248,4 @@ class TNumberFormat extends TI18NControl implements IDataRenderer
}
}
-?>
+?>
diff --git a/framework/I18N/TTranslate.php b/framework/I18N/TTranslate.php
index c3b28c79..2f1e0633 100644
--- a/framework/I18N/TTranslate.php
+++ b/framework/I18N/TTranslate.php
@@ -254,4 +254,3 @@ class TTranslate extends TI18NControl
}
}
-?>
diff --git a/framework/I18N/TTranslateParameter.php b/framework/I18N/TTranslateParameter.php
index 2b32b27b..37443133 100644
--- a/framework/I18N/TTranslateParameter.php
+++ b/framework/I18N/TTranslateParameter.php
@@ -117,4 +117,3 @@ class TTranslateParameter extends TControl
}
}
-?>
diff --git a/framework/I18N/Translation.php b/framework/I18N/Translation.php
index cb90577f..a0fa504d 100644
--- a/framework/I18N/Translation.php
+++ b/framework/I18N/Translation.php
@@ -106,4 +106,3 @@ class Translation extends TComponent
}
}
-?>
diff --git a/framework/I18N/core/CultureInfo.php b/framework/I18N/core/CultureInfo.php
index 46b833b7..7ee50bba 100644
--- a/framework/I18N/core/CultureInfo.php
+++ b/framework/I18N/core/CultureInfo.php
@@ -630,4 +630,3 @@ class CultureInfo
}
}
-?>
diff --git a/framework/I18N/core/DateTimeFormatInfo.php b/framework/I18N/core/DateTimeFormatInfo.php
index 0a99082d..aebd094a 100644
--- a/framework/I18N/core/DateTimeFormatInfo.php
+++ b/framework/I18N/core/DateTimeFormatInfo.php
@@ -514,4 +514,3 @@ class DateTimeFormatInfo
}
}
-?>
diff --git a/framework/I18N/core/Gettext/MO.php b/framework/I18N/core/Gettext/MO.php
index 2a85598a..2a97aee7 100644
--- a/framework/I18N/core/Gettext/MO.php
+++ b/framework/I18N/core/Gettext/MO.php
@@ -353,4 +353,3 @@ class TGettext_MO extends TGettext
return true;
}
}
-?>
diff --git a/framework/I18N/core/Gettext/PO.php b/framework/I18N/core/Gettext/PO.php
index edadbf9a..54fe10e3 100644
--- a/framework/I18N/core/Gettext/PO.php
+++ b/framework/I18N/core/Gettext/PO.php
@@ -158,4 +158,3 @@ class TGettext_PO extends TGettext
return true;
}
}
-?>
diff --git a/framework/I18N/core/Gettext/TGettext.php b/framework/I18N/core/Gettext/TGettext.php
index ea35154b..39e5d07e 100644
--- a/framework/I18N/core/Gettext/TGettext.php
+++ b/framework/I18N/core/Gettext/TGettext.php
@@ -284,4 +284,3 @@ class TGettext
return $PO;
}
}
-?>
diff --git a/framework/I18N/core/HTTPNegotiator.php b/framework/I18N/core/HTTPNegotiator.php
index f76efbe2..9199ba15 100644
--- a/framework/I18N/core/HTTPNegotiator.php
+++ b/framework/I18N/core/HTTPNegotiator.php
@@ -127,4 +127,3 @@ class HTTPNegotiator
}
}
-?>
diff --git a/framework/I18N/core/IMessageSource.php b/framework/I18N/core/IMessageSource.php
index eb0e5a1a..1d40bd73 100644
--- a/framework/I18N/core/IMessageSource.php
+++ b/framework/I18N/core/IMessageSource.php
@@ -120,4 +120,3 @@ interface IMessageSource
}
-?>
diff --git a/framework/I18N/core/MessageFormat.php b/framework/I18N/core/MessageFormat.php
index 21cf5f23..7af6deb1 100644
--- a/framework/I18N/core/MessageFormat.php
+++ b/framework/I18N/core/MessageFormat.php
@@ -253,4 +253,3 @@ class MessageFormat
}
}
-?>
diff --git a/framework/I18N/core/MessageSource_XLIFF.php b/framework/I18N/core/MessageSource_XLIFF.php
index f962e9a1..4c101bf0 100644
--- a/framework/I18N/core/MessageSource_XLIFF.php
+++ b/framework/I18N/core/MessageSource_XLIFF.php
@@ -502,7 +502,7 @@ class MessageSource_XLIFF extends MessageSource
{
$date = @date('c');
$xml = <<<EOD
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.0">
<file
source-language="EN"
diff --git a/framework/I18N/core/NumberFormat.php b/framework/I18N/core/NumberFormat.php
index 3edc6482..3b683c6c 100644
--- a/framework/I18N/core/NumberFormat.php
+++ b/framework/I18N/core/NumberFormat.php
@@ -304,4 +304,3 @@ class NumberFormat
}
}
-?>
diff --git a/framework/I18N/core/NumberFormatInfo.php b/framework/I18N/core/NumberFormatInfo.php
index 136a20eb..17149317 100644
--- a/framework/I18N/core/NumberFormatInfo.php
+++ b/framework/I18N/core/NumberFormatInfo.php
@@ -648,4 +648,3 @@ class NumberFormatInfo
}
}
-?>
diff --git a/framework/IO/TTextWriter.php b/framework/IO/TTextWriter.php
index 0dd9bcf5..b043e217 100644
--- a/framework/IO/TTextWriter.php
+++ b/framework/IO/TTextWriter.php
@@ -57,4 +57,3 @@ class TTextWriter extends TComponent implements ITextWriter
}
}
-?>
diff --git a/framework/PradoBase.php b/framework/PradoBase.php
index 15932cad..11bc7f41 100644
--- a/framework/PradoBase.php
+++ b/framework/PradoBase.php
@@ -115,6 +115,11 @@ class PradoBase
return '<a title="Powered by PRADO" href="http://www.pradosoft.com/" target="_blank"><img src="'.$url.'" style="border-width:0px;" alt="Powered by PRADO" /></a>';
}
+ public static function metaGenerator()
+ {
+ return 'PRADO - http://www.pradosoft.com/';
+ }
+
/**
* PHP error handler.
* This method should be registered as PHP error handler using
diff --git a/framework/Security/IUserManager.php b/framework/Security/IUserManager.php
index d8907160..37cf632f 100644
--- a/framework/Security/IUserManager.php
+++ b/framework/Security/IUserManager.php
@@ -56,4 +56,3 @@ interface IUserManager
public function validateUser($username,$password);
}
-?>
diff --git a/framework/Security/TAuthManager.php b/framework/Security/TAuthManager.php
index 64422845..40d94e19 100644
--- a/framework/Security/TAuthManager.php
+++ b/framework/Security/TAuthManager.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Security
@@ -25,6 +25,13 @@ Prado::using('System.Security.IUserManager');
* browser to a login page that is specified via the {@link setLoginPage LoginPage}.
* To login or logout a user, call {@link login} or {@link logout}, respectively.
*
+ * The {@link setAuthExpire AuthExpire} property can be used to define the time
+ * in seconds after which the authentication should expire.
+ * {@link setAllowAutoLogin AllowAutoLogin} specifies if the login information
+ * should be stored in a cookie to perform automatic login. Enabling this
+ * feature will cause that {@link setAuthExpire AuthExpire} has no effect
+ * since the user will be logged in again on authentication expiration.
+ *
* To load TAuthManager, configure it in application configuration as follows,
* <module id="auth" class="System.Security.TAuthManager" UserManager="users" LoginPage="login" />
* <module id="users" class="System.Security.TUserManager" />
@@ -68,6 +75,10 @@ class TAuthManager extends TModule
* @var string variable name used to store user session or cookie
*/
private $_userKey;
+ /**
+ * @var integer authentication expiration time in seconds. Defaults to zero (no expiration)
+ */
+ private $_authExpire=0;
/**
* Initializes this module.
@@ -242,6 +253,24 @@ class TAuthManager extends TModule
}
/**
+ * @return integer authentication expiration time in seconds. Defaults to zero (no expiration).
+ * @since 3.1.3
+ */
+ public function getAuthExpire()
+ {
+ return $this->_authExpire;
+ }
+
+ /**
+ * @param integer authentication expiration time in seconds. Defaults to zero (no expiration).
+ * @since 3.1.3
+ */
+ public function setAuthExpire($value)
+ {
+ $this->_authExpire=TPropertyValue::ensureInteger($value);
+ }
+
+ /**
* Performs the real authentication work.
* An OnAuthenticate event will be raised if there is any handler attached to it.
* If the application already has a non-null user, it will return without further authentication.
@@ -260,8 +289,12 @@ class TAuthManager extends TModule
$sessionInfo=$session->itemAt($this->getUserKey());
$user=$this->_userManager->getUser(null)->loadFromString($sessionInfo);
+ // check for authentication expiration
+ $isAuthExpired = $this->_authExpire>0 && !$user->getIsGuest() &&
+ ($expiretime=$session->itemAt('AuthExpireTime')) && $expiretime<time();
+
// try authenticating through cookie if possible
- if($this->getAllowAutoLogin() && $user->getIsGuest())
+ if($this->getAllowAutoLogin() && ($user->getIsGuest() || $isAuthExpired))
{
$cookie=$this->getRequest()->getCookies()->itemAt($this->getUserKey());
if($cookie instanceof THttpCookie)
@@ -270,17 +303,37 @@ class TAuthManager extends TModule
{
$user=$user2;
$this->updateSessionUser($user);
+ // user is restored from cookie, auth may not expire
+ $isAuthExpired = false;
}
}
}
$application->setUser($user);
+ // handle authentication expiration or update expiration time
+ if($isAuthExpired)
+ $this->onAuthExpire($param);
+ else
+ $session->add('AuthExpireTime', time() + $this->_authExpire);
+
// event handler gets a chance to do further auth work
if($this->hasEventHandler('OnAuthenticate'))
$this->raiseEvent('OnAuthenticate',$this,$application);
}
-
+
+ /**
+ * Performs user logout on authentication expiration.
+ * An 'OnAuthExpire' event will be raised if there is any handler attached to it.
+ * @param mixed parameter to be passed to OnAuthExpire event.
+ */
+ public function onAuthExpire($param)
+ {
+ $this->logout();
+ if($this->hasEventHandler('OnAuthExpire'))
+ $this->raiseEvent('OnAuthExpire',$this,$param);
+ }
+
/**
* Performs the real authorization work.
* Authorization rules obtained from the application will be used to check
@@ -401,4 +454,4 @@ class TAuthManager extends TModule
}
}
-?>
+?>
diff --git a/framework/Security/TAuthorizationRule.php b/framework/Security/TAuthorizationRule.php
index d301737b..896ce376 100644
--- a/framework/Security/TAuthorizationRule.php
+++ b/framework/Security/TAuthorizationRule.php
@@ -294,4 +294,3 @@ class TAuthorizationRuleCollection extends TList
}
}
-?>
diff --git a/framework/Security/TDbUserManager.php b/framework/Security/TDbUserManager.php
index bd70de8d..873d43f8 100644
--- a/framework/Security/TDbUserManager.php
+++ b/framework/Security/TDbUserManager.php
@@ -318,4 +318,3 @@ abstract class TDbUser extends TUser
}
}
-?>
diff --git a/framework/Security/TSecurityManager.php b/framework/Security/TSecurityManager.php
index 9fbadd10..d43c9fec 100644
--- a/framework/Security/TSecurityManager.php
+++ b/framework/Security/TSecurityManager.php
@@ -279,4 +279,3 @@ class TSecurityManagerValidationMode extends TEnumerable
const SHA1='SHA1';
}
-?>
diff --git a/framework/Security/TUser.php b/framework/Security/TUser.php
index d0e850cf..35e3e3a5 100644
--- a/framework/Security/TUser.php
+++ b/framework/Security/TUser.php
@@ -220,4 +220,3 @@ class TUser extends TComponent implements IUser
}
}
-?>
diff --git a/framework/Security/TUserManager.php b/framework/Security/TUserManager.php
index 6326803d..dbaa5ffb 100644
--- a/framework/Security/TUserManager.php
+++ b/framework/Security/TUserManager.php
@@ -148,7 +148,7 @@ class TUserManager extends TModule implements IUserManager
* Loads user/role information from an XML node.
* @param TXmlElement the XML node containing the user information
*/
- private function loadUserDataFromXml($xmlNode)
+ protected function loadUserDataFromXml($xmlNode)
{
foreach($xmlNode->getElementsByTagName('user') as $node)
{
diff --git a/framework/TApplication.php b/framework/TApplication.php
index d9626179..e690aa96 100644
--- a/framework/TApplication.php
+++ b/framework/TApplication.php
@@ -293,6 +293,11 @@ class TApplication extends TComponent
* @var TApplicationMode application mode
*/
private $_mode=TApplicationMode::Debug;
+
+ /**
+ * @var string Customizable page service ID
+ */
+ private $_pageServiceID = self::PAGE_SERVICE_ID;
/**
* Constructor.
@@ -325,7 +330,8 @@ class TApplication extends TComponent
// generates unique ID by hashing the runtime path
$this->_uniqueID=md5($this->_runtimePath);
$this->_parameters=new TMap;
- $this->_services=array(self::PAGE_SERVICE_ID=>array('TPageService',array(),null));
+ $this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null));
+
Prado::setPathOfAlias('Application',$this->_basePath);
}
@@ -509,6 +515,22 @@ class TApplication extends TComponent
{
$this->_id=$value;
}
+
+ /**
+ * @return string page service ID
+ */
+ public function getPageServiceID()
+ {
+ return $this->_pageServiceID;
+ }
+
+ /**
+ * @param string page service ID
+ */
+ public function setPageServiceID($value)
+ {
+ $this->_pageServiceID=$value;
+ }
/**
* @return string an ID that uniquely identifies this Prado application from the others
@@ -623,6 +645,10 @@ class TApplication extends TComponent
public function setRuntimePath($value)
{
$this->_runtimePath=$value;
+ if($this->_cacheFile)
+ $this->_cacheFile=$this->_runtimePath.DIRECTORY_SEPARATOR.self::CONFIGCACHE_FILE;
+ // generates unique ID by hashing the runtime path
+ $this->_uniqueID=md5($this->_runtimePath);
}
/**
@@ -912,6 +938,9 @@ class TApplication extends TComponent
foreach($config->getProperties() as $name=>$value)
$this->setSubProperty($name,$value);
}
+
+ if(empty($this->_services))
+ $this->_services=array($this->getPageServiceID()=>array('TPageService',array(),null));
// load parameters
foreach($config->getParameters() as $id=>$parameter)
@@ -996,8 +1025,8 @@ class TApplication extends TComponent
}
if(($serviceID=$this->getRequest()->resolveRequest(array_keys($this->_services)))===null)
- $serviceID=self::PAGE_SERVICE_ID;
-
+ $serviceID=$this->getPageServiceID();
+
$this->startService($serviceID);
}
@@ -1761,4 +1790,3 @@ class TApplicationStatePersister extends TModule implements IStatePersister
}
}
-?>
diff --git a/framework/TApplicationComponent.php b/framework/TApplicationComponent.php
index 41e1b80e..6e2c5bbe 100644
--- a/framework/TApplicationComponent.php
+++ b/framework/TApplicationComponent.php
@@ -116,4 +116,3 @@ class TApplicationComponent extends TComponent
}
}
-?>
diff --git a/framework/TComponent.php b/framework/TComponent.php
index cba21b7d..f9c36cc8 100644
--- a/framework/TComponent.php
+++ b/framework/TComponent.php
@@ -839,4 +839,3 @@ class TComponentReflection extends TComponent
}
}
-?>
diff --git a/framework/TModule.php b/framework/TModule.php
index 9ff20d6f..6426aa70 100644
--- a/framework/TModule.php
+++ b/framework/TModule.php
@@ -54,4 +54,3 @@ abstract class TModule extends TApplicationComponent implements IModule
}
}
-?>
diff --git a/framework/TService.php b/framework/TService.php
index a10460cc..cf2fb142 100644
--- a/framework/TService.php
+++ b/framework/TService.php
@@ -81,4 +81,3 @@ abstract class TService extends TApplicationComponent implements IService
}
}
-?>
diff --git a/framework/TShellApplication.php b/framework/TShellApplication.php
index ad219cd1..0d2cb826 100644
--- a/framework/TShellApplication.php
+++ b/framework/TShellApplication.php
@@ -46,4 +46,3 @@ class TShellApplication extends TApplication
}
}
-?>
diff --git a/framework/Util/TDataFieldAccessor.php b/framework/Util/TDataFieldAccessor.php
index fa65a9a2..bf0b58ae 100644
--- a/framework/Util/TDataFieldAccessor.php
+++ b/framework/Util/TDataFieldAccessor.php
@@ -80,4 +80,3 @@ class TDataFieldAccessor
}
}
-?>
diff --git a/framework/Util/TLogRouter.php b/framework/Util/TLogRouter.php
index 5c755985..aa772194 100644
--- a/framework/Util/TLogRouter.php
+++ b/framework/Util/TLogRouter.php
@@ -96,6 +96,20 @@ class TLogRouter extends TModule
}
/**
+ * Adds a TLogRoute instance to the log router.
+ *
+ * @param TLogRoute $route
+ * @throws TInvalidDataTypeException if the route object is invalid
+ */
+ public function addRoute($route)
+ {
+ if(!($route instanceof TLogRoute))
+ throw new TInvalidDataTypeException('logrouter_routetype_invalid');
+ $this->_routes[]=$route;
+ $route->init(null);
+ }
+
+ /**
* @return string external configuration file. Defaults to null.
*/
public function getConfigFile()
@@ -106,11 +120,11 @@ class TLogRouter extends TModule
/**
* @param string external configuration file in namespace format. The file
* must be suffixed with '.xml'.
- * @throws TInvalidDataValueException if the file is invalid.
+ * @throws TConfigurationException if the file is invalid.
*/
public function setConfigFile($value)
{
- if(($this->_configFile=Prado::getPathOfNamespace($value,self::LOG_FILE_EXT))===null)
+ if(($this->_configFile=Prado::getPathOfNamespace($value,self::CONFIG_FILE_EXT))===null)
throw new TConfigurationException('logrouter_configfile_invalid',$value);
}
@@ -509,8 +523,9 @@ class TEmailLogRoute extends TLogRoute
foreach($logs as $log)
$message.=$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]);
$message=wordwrap($message,70);
+ $returnPath = ini_get('sendmail_path') ? "Return-Path:{$this->_from}\r\n" : '';
foreach($this->_emails as $email)
- mail($email,$this->getSubject(),$message,"From:{$this->_from}\r\n");
+ mail($email,$this->getSubject(),$message,"From:{$this->_from}\r\n{$returnPath}");
}
diff --git a/framework/Util/TLogger.php b/framework/Util/TLogger.php
index 6d5385eb..51005883 100644
--- a/framework/Util/TLogger.php
+++ b/framework/Util/TLogger.php
@@ -127,4 +127,3 @@ class TLogger extends TComponent
}
}
-?>
diff --git a/framework/Util/TParameterModule.php b/framework/Util/TParameterModule.php
index 020db8db..529f20ca 100644
--- a/framework/Util/TParameterModule.php
+++ b/framework/Util/TParameterModule.php
@@ -141,4 +141,3 @@ class TParameterModule extends TModule
}
}
-?>
diff --git a/framework/Util/TVarDumper.php b/framework/Util/TVarDumper.php
index 180bb71a..e30e2400 100644
--- a/framework/Util/TVarDumper.php
+++ b/framework/Util/TVarDumper.php
@@ -126,4 +126,3 @@ class TVarDumper
}
}
-?>
diff --git a/framework/Web/Javascripts/TJavaScript.php b/framework/Web/Javascripts/TJavaScript.php
index 511515c8..9c4741a4 100644
--- a/framework/Web/Javascripts/TJavaScript.php
+++ b/framework/Web/Javascripts/TJavaScript.php
@@ -227,4 +227,3 @@ class TJavaScript
}
}
-?>
diff --git a/framework/Web/Javascripts/source/packages.php b/framework/Web/Javascripts/source/packages.php
index 1cca7b7c..d6c04e7f 100644
--- a/framework/Web/Javascripts/source/packages.php
+++ b/framework/Web/Javascripts/source/packages.php
@@ -47,7 +47,8 @@ $packages = array(
),
'dragdrop'=>array(
- SCRIPTACULOUS_DIR.'/dragdrop.js'
+ SCRIPTACULOUS_DIR.'/dragdrop.js',
+ 'prado/activecontrols/dragdrop.js'
),
'slider'=>array(
@@ -60,6 +61,14 @@ $packages = array(
'tabpanel'=>array(
'prado/controls/tabpanel.js'
+ ),
+
+ 'activedatepicker' => array(
+ 'prado/activecontrols/activedatepicker.js'
+ ),
+
+ 'activefileupload' => array(
+ 'prado/activefileupload/activefileupload.js'
),
);
@@ -67,19 +76,20 @@ $packages = array(
//package names and their dependencies
$dependencies = array(
- 'prado' => array('prado'),
- 'effects' => array('prado', 'effects'),
- 'validator' => array('prado', 'validator'),
- 'logger' => array('prado', 'logger'),
- 'datepicker' => array('prado', 'datepicker'),
- 'colorpicker' => array('prado', 'colorpicker'),
- 'ajax' => array('prado', 'effects', 'ajax'),
- 'dragdrop' => array('prado', 'effects', 'dragdrop'),
- 'slider' => array('prado', 'slider'),
- 'keyboard' => array('prado', 'keyboard'),
- 'tabpanel' => array('prado', 'tabpanel'),
+ 'prado' => array('prado'),
+ 'effects' => array('prado', 'effects'),
+ 'validator' => array('prado', 'validator'),
+ 'logger' => array('prado', 'logger'),
+ 'datepicker' => array('prado', 'datepicker'),
+ 'colorpicker' => array('prado', 'colorpicker'),
+ 'ajax' => array('prado', 'effects', 'ajax'),
+ 'dragdrop' => array('prado', 'effects', 'ajax', 'dragdrop'),
+ 'slider' => array('prado', 'slider'),
+ 'keyboard' => array('prado', 'keyboard'),
+ 'tabpanel' => array('prado', 'tabpanel'),
+ 'activedatepicker' => array('datepicker', 'ajax', 'activedatepicker'),
+ 'activefileupload' => array('prado', 'ajax', 'activefileupload'),
);
return array($packages, $dependencies);
-?>
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js
index 7ee4c0e6..d5cae7b8 100644
--- a/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/activecontrols3.js
@@ -1,362 +1,387 @@
-/**
- * Generic postback control.
- */
-Prado.WebUI.CallbackControl = Class.extend(Prado.WebUI.PostBackControl,
-{
- onPostBack : function(event, options)
- {
- var request = new Prado.CallbackRequest(options.EventTarget, options);
- request.dispatch();
- Event.stop(event);
- }
-});
-
-/**
- * TActiveButton control.
- */
-Prado.WebUI.TActiveButton = Class.extend(Prado.WebUI.CallbackControl);
-/**
- * TActiveLinkButton control.
- */
-Prado.WebUI.TActiveLinkButton = Class.extend(Prado.WebUI.CallbackControl);
-
-Prado.WebUI.TActiveImageButton = Class.extend(Prado.WebUI.TImageButton,
-{
- onPostBack : function(event, options)
- {
- this.addXYInput(event,options);
- var request = new Prado.CallbackRequest(options.EventTarget, options);
- request.dispatch();
- Event.stop(event);
- }
-});
-/**
- * Active check box.
- */
-Prado.WebUI.TActiveCheckBox = Class.extend(Prado.WebUI.CallbackControl,
-{
- onPostBack : function(event, options)
- {
- var request = new Prado.CallbackRequest(options.EventTarget, options);
- if(request.dispatch()==false)
- Event.stop(event);
- }
-});
-
-/**
- * TActiveRadioButton control.
- */
-Prado.WebUI.TActiveRadioButton = Class.extend(Prado.WebUI.TActiveCheckBox);
-
-
-Prado.WebUI.TActiveCheckBoxList = Base.extend(
-{
- constructor : function(options)
- {
- for(var i = 0; i<options.ItemCount; i++)
- {
- var checkBoxOptions = Object.extend(
- {
- ID : options.ListID+"_c"+i,
- EventTarget : options.ListName+"$c"+i
- }, options);
- new Prado.WebUI.TActiveCheckBox(checkBoxOptions);
- }
- }
-});
-
-Prado.WebUI.TActiveRadioButtonList = Prado.WebUI.TActiveCheckBoxList;
-
-/**
- * TActiveTextBox control, handles onchange event.
- */
-Prado.WebUI.TActiveTextBox = Class.extend(Prado.WebUI.TTextBox,
-{
- onInit : function(options)
- {
- this.options=options;
- if(options['TextMode'] != 'MultiLine')
- Event.observe(this.element, "keydown", this.handleReturnKey.bind(this));
- if(this.options['AutoPostBack']==true)
- Event.observe(this.element, "change", this.doCallback.bindEvent(this,options));
- },
-
- doCallback : function(event, options)
- {
- var request = new Prado.CallbackRequest(options.EventTarget, options);
- request.dispatch();
- if (!Prototype.Browser.IE)
- Event.stop(event);
- }
-});
-
-/**
- * TAutoComplete control.
- */
-Prado.WebUI.TAutoComplete = Class.extend(Autocompleter.Base, Prado.WebUI.TActiveTextBox.prototype);
-Prado.WebUI.TAutoComplete = Class.extend(Prado.WebUI.TAutoComplete,
-{
- initialize : function(options)
- {
- this.options = options;
- this.hasResults = false;
- this.baseInitialize(options.ID, options.ResultPanel, options);
- Object.extend(this.options,
- {
- onSuccess : this.onComplete.bind(this)
- });
-
- if(options.AutoPostBack)
- this.onInit(options);
- },
-
- doCallback : function(event, options)
- {
- if(!this.active)
- {
- var request = new Prado.CallbackRequest(this.options.EventTarget, options);
- request.dispatch();
- Event.stop(event);
- }
- },
-
- //Overrides parent implementation, fires onchange event.
- onClick: function(event)
- {
- var element = Event.findElement(event, 'LI');
- this.index = element.autocompleteIndex;
- this.selectEntry();
- this.hide();
- Event.fireEvent(this.element, "change");
- },
-
- getUpdatedChoices : function()
- {
- var options = new Array(this.getToken(),"__TAutoComplete_onSuggest__");
- Prado.Callback(this.options.EventTarget, options, null, this.options);
- },
-
- /**
- * Overrides parent implements, don't update if no results.
- */
- selectEntry: function()
- {
- if(this.hasResults)
- {
- this.active = false;
- this.updateElement(this.getCurrentEntry());
- var options = [this.index, "__TAutoComplete_onSuggestionSelected__"];
- Prado.Callback(this.options.EventTarget, options, null, this.options);
- }
- },
-
- onComplete : function(request, boundary)
- {
- var result = Prado.Element.extractContent(request.transport.responseText, boundary);
- if(typeof(result) == "string")
- {
- if(result.length > 0)
- {
- this.hasResults = true;
- this.updateChoices(result);
- }
- else
- {
- this.active = false;
- this.hasResults = false;
- this.hide();
- }
- }
- }
-});
-
-/**
- * Time Triggered Callback class.
- */
-Prado.WebUI.TTimeTriggeredCallback = Base.extend(
-{
- constructor : function(options)
- {
- this.options = Object.extend({ Interval : 1 }, options || {});
- Prado.WebUI.TTimeTriggeredCallback.register(this);
- },
-
- startTimer : function()
- {
- setTimeout(this.onTimerEvent.bind(this), 100);
- if(typeof(this.timer) == 'undefined' || this.timer == null)
- this.timer = setInterval(this.onTimerEvent.bind(this),this.options.Interval*1000);
- },
-
- stopTimer : function()
- {
- if(typeof(this.timer) != 'undefined')
- {
- clearInterval(this.timer);
- this.timer = null;
- }
- },
-
- onTimerEvent : function()
- {
- var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
- request.dispatch();
- }
-},
-//class methods
-{
- timers : {},
-
- register : function(timer)
- {
- Prado.WebUI.TTimeTriggeredCallback.timers[timer.options.ID] = timer;
- },
-
- start : function(id)
- {
- if(Prado.WebUI.TTimeTriggeredCallback.timers[id])
- Prado.WebUI.TTimeTriggeredCallback.timers[id].startTimer();
- },
-
- stop : function(id)
- {
- if(Prado.WebUI.TTimeTriggeredCallback.timers[id])
- Prado.WebUI.TTimeTriggeredCallback.timers[id].stopTimer();
- }
-});
-
-Prado.WebUI.ActiveListControl = Base.extend(
-{
- constructor : function(options)
- {
- this.element = $(options.ID);
- if(this.element)
- {
- this.options = options;
- Event.observe(this.element, "change", this.doCallback.bind(this));
- }
- },
-
- doCallback : function(event)
- {
- var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
- request.dispatch();
- Event.stop(event);
- }
-});
-
-Prado.WebUI.TActiveDropDownList = Prado.WebUI.ActiveListControl;
-Prado.WebUI.TActiveListBox = Prado.WebUI.ActiveListControl;
-
-/**
- * Observe event of a particular control to trigger a callback request.
- */
-Prado.WebUI.TEventTriggeredCallback = Base.extend(
-{
- constructor : function(options)
- {
- this.options = options;
- var element = $(options['ControlID']);
- if(element)
- Event.observe(element, this.getEventName(element), this.doCallback.bind(this));
- },
-
- getEventName : function(element)
- {
- var name = this.options.EventName;
- if(typeof(name) == "undefined" && element.type)
- {
- switch (element.type.toLowerCase())
- {
- case 'password':
- case 'text':
- case 'textarea':
- case 'select-one':
- case 'select-multiple':
- return 'change';
- }
- }
- return typeof(name) == "undefined" || name == "undefined" ? 'click' : name;
- },
-
- doCallback : function(event)
- {
- var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
- request.dispatch();
- if(this.options.StopEvent == true)
- Event.stop(event);
- }
-});
-
-/**
- * Observe changes to a property of a particular control to trigger a callback.
- */
-Prado.WebUI.TValueTriggeredCallback = Base.extend(
-{
- count : 1,
-
- observing : true,
-
- constructor : function(options)
- {
- this.options = options;
- this.options.PropertyName = this.options.PropertyName || 'value';
- var element = $(options['ControlID']);
- this.value = element ? element[this.options.PropertyName] : undefined;
- Prado.WebUI.TValueTriggeredCallback.register(this);
- this.startObserving();
- },
-
- stopObserving : function()
- {
- clearTimeout(this.timer);
- this.observing = false;
- },
-
- startObserving : function()
- {
- this.timer = setTimeout(this.checkChanges.bind(this), this.options.Interval*1000);
- },
-
- checkChanges : function()
- {
- var element = $(this.options.ControlID);
- if(element)
- {
- var value = element[this.options.PropertyName];
- if(this.value != value)
- {
- this.doCallback(this.value, value);
- this.value = value;
- this.count=1;
- }
- else
- this.count = this.count + this.options.Decay;
- if(this.observing)
- this.time = setTimeout(this.checkChanges.bind(this),
- parseInt(this.options.Interval*1000*this.count));
- }
- },
-
- doCallback : function(oldValue, newValue)
- {
- var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
- var param = {'OldValue' : oldValue, 'NewValue' : newValue};
- request.setCallbackParameter(param);
- request.dispatch();
- }
-},
-//class methods
-{
- timers : {},
-
- register : function(timer)
- {
- Prado.WebUI.TValueTriggeredCallback.timers[timer.options.ID] = timer;
- },
-
- stop : function(id)
- {
- Prado.WebUI.TValueTriggeredCallback.timers[id].stopObserving();
- }
-});
+/**
+ * Generic postback control.
+ */
+Prado.WebUI.CallbackControl = Class.extend(Prado.WebUI.PostBackControl,
+{
+ onPostBack : function(event, options)
+ {
+ var request = new Prado.CallbackRequest(options.EventTarget, options);
+ request.dispatch();
+ Event.stop(event);
+ }
+});
+
+/**
+ * TActiveButton control.
+ */
+Prado.WebUI.TActiveButton = Class.extend(Prado.WebUI.CallbackControl);
+/**
+ * TActiveLinkButton control.
+ */
+Prado.WebUI.TActiveLinkButton = Class.extend(Prado.WebUI.CallbackControl);
+
+Prado.WebUI.TActiveImageButton = Class.extend(Prado.WebUI.TImageButton,
+{
+ onPostBack : function(event, options)
+ {
+ this.addXYInput(event,options);
+ var request = new Prado.CallbackRequest(options.EventTarget, options);
+ request.dispatch();
+ Event.stop(event);
+ this.removeXYInput(event,options);
+ }
+});
+/**
+ * Active check box.
+ */
+Prado.WebUI.TActiveCheckBox = Class.extend(Prado.WebUI.CallbackControl,
+{
+ onPostBack : function(event, options)
+ {
+ var request = new Prado.CallbackRequest(options.EventTarget, options);
+ if(request.dispatch()==false)
+ Event.stop(event);
+ }
+});
+
+/**
+ * TActiveRadioButton control.
+ */
+Prado.WebUI.TActiveRadioButton = Class.extend(Prado.WebUI.TActiveCheckBox);
+
+
+Prado.WebUI.TActiveCheckBoxList = Base.extend(
+{
+ constructor : function(options)
+ {
+ for(var i = 0; i<options.ItemCount; i++)
+ {
+ var checkBoxOptions = Object.extend(
+ {
+ ID : options.ListID+"_c"+i,
+ EventTarget : options.ListName+"$c"+i
+ }, options);
+ new Prado.WebUI.TActiveCheckBox(checkBoxOptions);
+ }
+ }
+});
+
+Prado.WebUI.TActiveRadioButtonList = Prado.WebUI.TActiveCheckBoxList;
+
+/**
+ * TActiveTextBox control, handles onchange event.
+ */
+Prado.WebUI.TActiveTextBox = Class.extend(Prado.WebUI.TTextBox,
+{
+ onInit : function(options)
+ {
+ this.options=options;
+ if(options['TextMode'] != 'MultiLine')
+ Event.observe(this.element, "keydown", this.handleReturnKey.bind(this));
+ if(this.options['AutoPostBack']==true)
+ Event.observe(this.element, "change", this.doCallback.bindEvent(this,options));
+ },
+
+ doCallback : function(event, options)
+ {
+ var request = new Prado.CallbackRequest(options.EventTarget, options);
+ request.dispatch();
+ if (!Prototype.Browser.IE)
+ Event.stop(event);
+ }
+});
+
+/**
+ * TAutoComplete control.
+ */
+Prado.WebUI.TAutoComplete = Class.extend(Autocompleter.Base, Prado.WebUI.TActiveTextBox.prototype);
+Prado.WebUI.TAutoComplete = Class.extend(Prado.WebUI.TAutoComplete,
+{
+ initialize : function(options)
+ {
+ this.options = options;
+ this.hasResults = false;
+ this.baseInitialize(options.ID, options.ResultPanel, options);
+ Object.extend(this.options,
+ {
+ onSuccess : this.onComplete.bind(this)
+ });
+
+ if(options.AutoPostBack)
+ this.onInit(options);
+ },
+
+ doCallback : function(event, options)
+ {
+ if(!this.active)
+ {
+ var request = new Prado.CallbackRequest(this.options.EventTarget, options);
+ request.dispatch();
+ Event.stop(event);
+ }
+ },
+
+ //Overrides parent implementation, fires onchange event.
+ onClick: function(event)
+ {
+ var element = Event.findElement(event, 'LI');
+ this.index = element.autocompleteIndex;
+ this.selectEntry();
+ this.hide();
+ Event.fireEvent(this.element, "change");
+ },
+
+ getUpdatedChoices : function()
+ {
+ var options = new Array(this.getToken(),"__TAutoComplete_onSuggest__");
+ Prado.Callback(this.options.EventTarget, options, null, this.options);
+ },
+
+ /**
+ * Overrides parent implements, don't update if no results.
+ */
+ selectEntry: function()
+ {
+ if(this.hasResults)
+ {
+ this.active = false;
+ this.updateElement(this.getCurrentEntry());
+ var options = [this.index, "__TAutoComplete_onSuggestionSelected__"];
+ Prado.Callback(this.options.EventTarget, options, null, this.options);
+ }
+ },
+
+ onComplete : function(request, boundary)
+ {
+ var result = Prado.Element.extractContent(request.transport.responseText, boundary);
+ if(typeof(result) == "string")
+ {
+ if(result.length > 0)
+ {
+ this.hasResults = true;
+ this.updateChoices(result);
+ }
+ else
+ {
+ this.active = false;
+ this.hasResults = false;
+ this.hide();
+ }
+ }
+ }
+});
+
+/**
+ * Time Triggered Callback class.
+ */
+Prado.WebUI.TTimeTriggeredCallback = Base.extend(
+{
+ constructor : function(options)
+ {
+ this.options = Object.extend({ Interval : 1 }, options || {});
+ Prado.WebUI.TTimeTriggeredCallback.register(this);
+ },
+
+ startTimer : function()
+ {
+ setTimeout(this.onTimerEvent.bind(this), 100);
+ if(typeof(this.timer) == 'undefined' || this.timer == null)
+ this.timer = setInterval(this.onTimerEvent.bind(this),this.options.Interval*1000);
+ },
+
+ stopTimer : function()
+ {
+ if(typeof(this.timer) != 'undefined')
+ {
+ clearInterval(this.timer);
+ this.timer = null;
+ }
+ },
+
+ resetTimer : function()
+ {
+ if(typeof(this.timer) != 'undefined')
+ {
+ clearInterval(this.timer);
+ this.timer = null;
+ this.timer = setInterval(this.onTimerEvent.bind(this),this.options.Interval*1000);
+ }
+ },
+
+ onTimerEvent : function()
+ {
+ var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
+ request.dispatch();
+ },
+
+ setInterval : function(value)
+ {
+ if (this.options.Interval != value){
+ this.options.Interval = value;
+ this.resetTimer();
+ }
+ }
+},
+//class methods
+{
+ timers : {},
+
+ register : function(timer)
+ {
+ Prado.WebUI.TTimeTriggeredCallback.timers[timer.options.ID] = timer;
+ },
+
+ start : function(id)
+ {
+ if(Prado.WebUI.TTimeTriggeredCallback.timers[id])
+ Prado.WebUI.TTimeTriggeredCallback.timers[id].startTimer();
+ },
+
+ stop : function(id)
+ {
+ if(Prado.WebUI.TTimeTriggeredCallback.timers[id])
+ Prado.WebUI.TTimeTriggeredCallback.timers[id].stopTimer();
+ },
+
+ setInterval : function (id,value)
+ {
+ if(Prado.WebUI.TTimeTriggeredCallback.timers[id])
+ Prado.WebUI.TTimeTriggeredCallback.timers[id].setInterval(value);
+ }
+});
+
+Prado.WebUI.ActiveListControl = Base.extend(
+{
+ constructor : function(options)
+ {
+ this.element = $(options.ID);
+ if(this.element)
+ {
+ this.options = options;
+ Event.observe(this.element, "change", this.doCallback.bind(this));
+ }
+ },
+
+ doCallback : function(event)
+ {
+ var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
+ request.dispatch();
+ Event.stop(event);
+ }
+});
+
+Prado.WebUI.TActiveDropDownList = Prado.WebUI.ActiveListControl;
+Prado.WebUI.TActiveListBox = Prado.WebUI.ActiveListControl;
+
+/**
+ * Observe event of a particular control to trigger a callback request.
+ */
+Prado.WebUI.TEventTriggeredCallback = Base.extend(
+{
+ constructor : function(options)
+ {
+ this.options = options;
+ var element = $(options['ControlID']);
+ if(element)
+ Event.observe(element, this.getEventName(element), this.doCallback.bind(this));
+ },
+
+ getEventName : function(element)
+ {
+ var name = this.options.EventName;
+ if(typeof(name) == "undefined" && element.type)
+ {
+ switch (element.type.toLowerCase())
+ {
+ case 'password':
+ case 'text':
+ case 'textarea':
+ case 'select-one':
+ case 'select-multiple':
+ return 'change';
+ }
+ }
+ return typeof(name) == "undefined" || name == "undefined" ? 'click' : name;
+ },
+
+ doCallback : function(event)
+ {
+ var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
+ request.dispatch();
+ if(this.options.StopEvent == true)
+ Event.stop(event);
+ }
+});
+
+/**
+ * Observe changes to a property of a particular control to trigger a callback.
+ */
+Prado.WebUI.TValueTriggeredCallback = Base.extend(
+{
+ count : 1,
+
+ observing : true,
+
+ constructor : function(options)
+ {
+ this.options = options;
+ this.options.PropertyName = this.options.PropertyName || 'value';
+ var element = $(options['ControlID']);
+ this.value = element ? element[this.options.PropertyName] : undefined;
+ Prado.WebUI.TValueTriggeredCallback.register(this);
+ this.startObserving();
+ },
+
+ stopObserving : function()
+ {
+ clearTimeout(this.timer);
+ this.observing = false;
+ },
+
+ startObserving : function()
+ {
+ this.timer = setTimeout(this.checkChanges.bind(this), this.options.Interval*1000);
+ },
+
+ checkChanges : function()
+ {
+ var element = $(this.options.ControlID);
+ if(element)
+ {
+ var value = element[this.options.PropertyName];
+ if(this.value != value)
+ {
+ this.doCallback(this.value, value);
+ this.value = value;
+ this.count=1;
+ }
+ else
+ this.count = this.count + this.options.Decay;
+ if(this.observing)
+ this.time = setTimeout(this.checkChanges.bind(this),
+ parseInt(this.options.Interval*1000*this.count));
+ }
+ },
+
+ doCallback : function(oldValue, newValue)
+ {
+ var request = new Prado.CallbackRequest(this.options.EventTarget, this.options);
+ var param = {'OldValue' : oldValue, 'NewValue' : newValue};
+ request.setCallbackParameter(param);
+ request.dispatch();
+ }
+},
+//class methods
+{
+ timers : {},
+
+ register : function(timer)
+ {
+ Prado.WebUI.TValueTriggeredCallback.timers[timer.options.ID] = timer;
+ },
+
+ stop : function(id)
+ {
+ Prado.WebUI.TValueTriggeredCallback.timers[id].stopObserving();
+ }
+});
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
new file mode 100755
index 00000000..87b48bf3
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activecontrols/activedatepicker.js
@@ -0,0 +1,79 @@
+/**
+ * TActiveDatePicker control
+ */
+Prado.WebUI.TActiveDatePicker = Class.extend(Prado.WebUI.TDatePicker,
+{
+ initialize : function(options)
+ {
+ this.options = options || [];
+ this.control = $(options.ID);
+ this.dateSlot = new Array(42);
+ this.weekSlot = new Array(6);
+ this.minimalDaysInFirstWeek = 4;
+ this.selectedDate = this.newDate();
+ this.positionMode = 'Bottom';
+
+ //which element to trigger to show the calendar
+ if(this.options.Trigger)
+ {
+ this.trigger = $(this.options.Trigger) ;
+ var triggerEvent = this.options.TriggerEvent || "click";
+ }
+ else
+ {
+ this.trigger = this.control;
+ var triggerEvent = this.options.TriggerEvent || "focus";
+ }
+
+ // Popup position
+ if(this.options.PositionMode == 'Top')
+ {
+ this.positionMode = this.options.PositionMode;
+ }
+
+ Object.extend(this,options);
+
+ Event.observe(this.trigger, triggerEvent, this.show.bindEvent(this));
+
+ // Listen to change event
+ if(this.options.InputMode == "TextBox")
+ {
+ Event.observe(this.control, "change", this.onDateChanged.bindEvent(this));
+ }
+ else
+ {
+ var day = Prado.WebUI.TDatePicker.getDayListControl(this.control);
+ var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control);
+ var year = Prado.WebUI.TDatePicker.getYearListControl(this.control);
+ Event.observe (day, "change", this.onDateChanged.bindEvent(this));
+ Event.observe (month, "change", this.onDateChanged.bindEvent(this));
+ Event.observe (year, "change", this.onDateChanged.bindEvent(this));
+
+ }
+
+ },
+
+ // Respond to change event on the textbox or dropdown list
+ // This method raises OnDateChanged event on client side if it has been defined,
+ // and raise the callback request
+ onDateChanged : function ()
+ {
+ var date;
+ if (this.options.InputMode == "TextBox")
+ {
+ date=this.control.value;
+ }
+ else
+ {
+ var day = Prado.WebUI.TDatePicker.getDayListControl(this.control).selectedIndex+1;
+ var month = Prado.WebUI.TDatePicker.getMonthListControl(this.control).selectedIndex;
+ var year = Prado.WebUI.TDatePicker.getYearListControl(this.control).value;
+ date=new Date(year, month, day, 0,0,0).SimpleFormat(this.Format, this);
+ }
+ if (typeof(this.options.OnDateChanged) == "function") this.options.OnDateChanged(this, date);
+
+ // Make callback request
+ var request = new Prado.CallbackRequest(this.options.EventTarget,this.options);
+ request.dispatch();
+ }
+});
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js
new file mode 100755
index 00000000..0b42afd5
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activecontrols/dragdrop.js
@@ -0,0 +1,24 @@
+/**
+ * DropContainer control
+ */
+
+Prado.WebUI.DropContainer = Class.extend(Prado.WebUI.CallbackControl);
+
+Object.extend(Prado.WebUI.DropContainer.prototype,
+{
+ initialize: function(options)
+ {
+ this.options = options;
+ Object.extend (this.options,
+ {
+ onDrop: this.onDrop.bind(this)
+ });
+
+ Droppables.add (options.ID, this.options);
+ },
+
+ onDrop: function(dragElement, dropElement)
+ {
+ Prado.Callback(this.options.EventTarget, dragElement.id, null, this.options);
+ }
+});
diff --git a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js
index 87b8ddde..51e3f489 100644
--- a/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js
+++ b/framework/Web/Javascripts/source/prado/activecontrols/inlineeditor.js
@@ -188,7 +188,7 @@ Prado.WebUI.TInPlaceTextBox = Base.extend(
if(this.options.AutoHide)
this.showLabel();
}
- else if (Event.keyCode(e) == Event.KEY_RETURN)
+ else if (Event.keyCode(e) == Event.KEY_RETURN && this.options.TextMode != 'MultiLine')
Event.stop(e);
},
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html
new file mode 100755
index 00000000..44f50ce4
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadBlank.html
@@ -0,0 +1 @@
+<!-- Nothing here to see, move right along. --> \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png
new file mode 100755
index 00000000..98badd7f
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadComplete.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png
new file mode 100755
index 00000000..26c529fc
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadError.png
Binary files differ
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif
new file mode 100755
index 00000000..085ccaec
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/ActiveFileUploadIndicator.gif
Binary files differ
diff --git a/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
new file mode 100755
index 00000000..9f57f912
--- /dev/null
+++ b/framework/Web/Javascripts/source/prado/activefileupload/activefileupload.js
@@ -0,0 +1,63 @@
+Prado.WebUI.TActiveFileUpload = Base.extend(
+{
+ constructor : function(options)
+ {
+ this.options = options || {};
+ Prado.WebUI.TActiveFileUpload.register(this);
+
+ this.input = $(options.inputID);
+ this.flag = $(options.flagID);
+ this.form = $(options.formID);
+
+ this.indicator = $(options.indicatorID);
+ this.complete = $(options.completeID);
+ this.error = $(options.errorID);
+
+ // set up events
+ Event.observe(this.input,"change",this.fileChanged.bind(this));
+ },
+
+ fileChanged:function(){
+ // show the upload indicator, and hide the complete and error indicators (if they areSn't already).
+ this.flag.value = '1';
+ this.complete.style.display = 'none';
+ this.error.style.display = 'none';
+ this.indicator.style.display = '';
+
+ // set the form to submit in the iframe, submit it, and then reset it.
+ this.oldtargetID = this.form.target;
+ this.form.target = this.options.targetID;
+ this.form.submit();
+ this.form.target = this.oldtargetID;
+ },
+
+ finishUpload:function(options){
+ // hide the display indicator.
+ this.flag.value = '';
+ this.indicator.style.display = 'none';
+ if (this.options.targetID == options.targetID){
+ // show the complete indicator.
+ if (options.errorCode == 0){
+ this.complete.style.display = '';
+ this.input.value = '';
+ } else {
+ this.error.style.display = '';
+ }
+ Prado.Callback(this.options.EventTarget, options, null, this.options);
+ }
+ }
+},
+{
+// class methods
+ controls : {},
+
+ register : function(control)
+ {
+ Prado.WebUI.TActiveFileUpload.controls[control.options.ID] = control;
+ },
+
+ onFileUpload: function(options)
+ {
+ Prado.WebUI.TActiveFileUpload.controls[options.clientID].finishUpload(options);
+ }
+}); \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/prado/activeratings/blocks.css b/framework/Web/Javascripts/source/prado/activeratings/blocks.css
deleted file mode 100644
index bb846094..00000000
--- a/framework/Web/Javascripts/source/prado/activeratings/blocks.css
+++ /dev/null
@@ -1,42 +0,0 @@
-.TActiveRatingList_blocks
-{
- border-collapse: collapse;
-}
-.TActiveRatingList_blocks input, .TActiveRatingList_blocks label
-{
- display: none;
-}
-
-.TActiveRatingList_blocks td
-{
- width: 18px;
- height: 9px;
- padding: 1px;
-}
-
-.TActiveRatingList_blocks td.rating
-{
- background-image: url(blocks_combined.gif);
- background-repeat: no-repeat;
- cursor: pointer;
- background-position: 1px 0px;
-}
-.TActiveRatingList_blocks td.rating_selected
-{
- background-position: 1px -100px;
-}
-
-.TActiveRatingList_blocks td.rating_half
-{
- background-position: 1px -200px;
-}
-
-.TActiveRatingList_blocks td.rating_hover
-{
- background-position: 1px -300px;
-}
-
-.TActiveRatingList_blocks td.rating_disabled
-{
- cursor: default !important;
-}
diff --git a/framework/Web/Javascripts/source/prado/activeratings/default.css b/framework/Web/Javascripts/source/prado/activeratings/default.css
deleted file mode 100644
index ba90eb27..00000000
--- a/framework/Web/Javascripts/source/prado/activeratings/default.css
+++ /dev/null
@@ -1,43 +0,0 @@
-.TActiveRatingList_default
-{
- border-collapse: collapse;
-}
-.TActiveRatingList_default input, .TActiveRatingList_default label
-{
- display: none;
-}
-
-.TActiveRatingList_default td
-{
- width: 18px;
- height: 18px;
- padding: 0;
-}
-
-.TActiveRatingList_default td.rating
-{
- background-image: url(default_combined.gif);
- background-repeat: no-repeat;
- cursor: pointer;
- background-position: 0px 0px;
-}
-
-.TActiveRatingList_default td.rating_selected
-{
- background-position: 0px -100px;
-}
-
-.TActiveRatingList_default td.rating_half
-{
- background-position: 0px -200px;
-}
-
-.TActiveRatingList_default td.rating_hover
-{
- background-position: 0px -300px;
-}
-
-.TActiveRatingList_default td.rating_disabled
-{
- cursor: default !important;
-} \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/prado/activeratings/ratings.js b/framework/Web/Javascripts/source/prado/activeratings/ratings.js
deleted file mode 100644
index 4eeddbd8..00000000
--- a/framework/Web/Javascripts/source/prado/activeratings/ratings.js
+++ /dev/null
@@ -1,178 +0,0 @@
-Prado.WebUI.TActiveRatingList = Base.extend(
-{
- selectedIndex : -1,
- rating: -1,
- enabled : true,
- readOnly : false,
-
- constructor : function(options)
- {
- var cap = $(options.CaptionID);
- this.options = Object.extend(
- {
- caption : cap ? cap.innerHTML : ''
- }, options || {});
-
- Prado.WebUI.TActiveRatingList.register(this);
- this._init();
- this.selectedIndex = options.SelectedIndex;
- this.rating = options.Rating;
- if(options.Rating <= 0 && options.SelectedIndex >= 0)
- this.rating = options.SelectedIndex+1;
- this.showRating(this.rating);
- },
-
- _init: function(options)
- {
- Element.addClassName($(this.options.ListID),this.options.Style);
- this.radios = new Array();
- var index=0;
- for(var i = 0; i<this.options.ItemCount; i++)
- {
- var radio = $(this.options.ListID+'_c'+i);
- var td = radio.parentNode.parentNode;
- if(radio && td.tagName.toLowerCase()=='td')
- {
- this.radios.push(radio);
- Event.observe(td, "mouseover", this.hover.bindEvent(this,index));
- Event.observe(td, "mouseout", this.recover.bindEvent(this,index));
- Event.observe(td, "click", this.click.bindEvent(this, index));
- index++;
- Element.addClassName(td,"rating");
- }
- }
- },
-
- hover : function(ev,index)
- {
- if(this.enabled==false) return;
- for(var i = 0; i<this.radios.length; i++)
- {
- var node = this.radios[i].parentNode.parentNode;
- var action = i <= index ? 'addClassName' : 'removeClassName'
- Element[action](node,"rating_hover");
- Element.removeClassName(node,"rating_selected");
- Element.removeClassName(node,"rating_half");
- }
- this.showCaption(this.getIndexCaption(index));
- },
-
- recover : function(ev,index)
- {
- if(this.enabled==false) return;
- this.showRating(this.rating);
- this.showCaption(this.options.caption);
- },
-
- click : function(ev, index)
- {
- if(this.enabled==false) return;
- for(var i = 0; i<this.radios.length; i++)
- this.radios[i].checked = (i == index);
-
- this.selectedIndex = index;
- this.setRating(index+1);
-
- this.dispatchRequest(ev);
- },
-
- dispatchRequest : function(ev)
- {
- var requestOptions = Object.extend(
- {
- ID : this.options.ListID+"_c"+this.selectedIndex,
- EventTarget : this.options.ListName+"$c"+this.selectedIndex
- },this.options);
- var request = new Prado.CallbackRequest(requestOptions.EventTarget, requestOptions);
- if(request.dispatch()==false)
- Event.stop(ev);
- },
-
- setRating : function(value)
- {
- this.rating = value;
- var base = Math.floor(value-1);
- var remainder = value - base-1;
- var halfMax = this.options.HalfRating["1"];
- var index = remainder > halfMax ? base+1 : base;
- for(var i = 0; i<this.radios.length; i++)
- this.radios[i].checked = (i == index);
-
- var caption = this.getIndexCaption(index);
- this.setCaption(caption);
- this.showCaption(caption);
-
- this.showRating(value);
- },
-
- showRating: function(value)
- {
- var base = Math.floor(value-1);
- var remainder = value - base-1;
- var halfMin = this.options.HalfRating["0"];
- var halfMax = this.options.HalfRating["1"];
- var index = remainder > halfMax ? base+1 : base;
- var hasHalf = remainder >= halfMin && remainder <= halfMax;
- for(var i = 0; i<this.radios.length; i++)
- {
- var node = this.radios[i].parentNode.parentNode;
- var action = i > index ? 'removeClassName' : 'addClassName';
- Element[action](node, "rating_selected");
- if(i==index+1 && hasHalf)
- Element.addClassName(node, "rating_half");
- else
- Element.removeClassName(node, "rating_half");
- Element.removeClassName(node,"rating_hover");
- }
- },
-
- getIndexCaption : function(index)
- {
- return index > -1 ? this.radios[index].value : this.options.caption;
- },
-
- showCaption : function(value)
- {
- var caption = $(this.options.CaptionID);
- if(caption) caption.innerHTML = value;
- $(this.options.ListID).title = value;
- },
-
- setCaption : function(value)
- {
- this.options.caption = value;
- this.showCaption(value);
- },
-
- setEnabled : function(value)
- {
- this.enabled = value;
- for(var i = 0; i<this.radios.length; i++)
- {
- var action = value ? 'removeClassName' : 'addClassName'
- Element[action](this.radios[i].parentNode.parentNode, "rating_disabled");
- }
- }
-},
-{
-ratings : {},
-register : function(rating)
-{
- Prado.WebUI.TActiveRatingList.ratings[rating.options.ListID] = rating;
-},
-
-setEnabled : function(id,value)
-{
- Prado.WebUI.TActiveRatingList.ratings[id].setEnabled(value);
-},
-
-setRating : function(id,value)
-{
- Prado.WebUI.TActiveRatingList.ratings[id].setRating(value);
-},
-
-setCaption : function(id,value)
-{
- Prado.WebUI.TActiveRatingList.ratings[id].setCaption(value);
-}
-}); \ No newline at end of file
diff --git a/framework/Web/Javascripts/source/prado/controls/controls.js b/framework/Web/Javascripts/source/prado/controls/controls.js
index bea18e76..dac7a0c0 100644
--- a/framework/Web/Javascripts/source/prado/controls/controls.js
+++ b/framework/Web/Javascripts/source/prado/controls/controls.js
@@ -69,12 +69,9 @@ Object.extend(Prado.WebUI.TImageButton.prototype,
*/
onPostBack : function(event, options)
{
- if(!this.hasXYInput)
- {
- this.addXYInput(event,options);
- this.hasXYInput = true;
- }
+ this.addXYInput(event,options);
Prado.PostBack(event, options);
+ this.removeXYInput(event,options);
},
/**
@@ -111,6 +108,18 @@ Object.extend(Prado.WebUI.TImageButton.prototype,
y_input = INPUT({type:'hidden',name:id+'_y','id':id+'_y',value:y});
this.element.parentNode.appendChild(y_input);
}
+ },
+
+ /**
+ * Remove hidden inputs for x,y-click capturing
+ * @param event DOM click event.
+ * @param array image button options.
+ */
+ removeXYInput : function(event,options)
+ {
+ id = options['EventTarget'];
+ this.element.parentNode.removeChild($(id+"_x"));
+ this.element.parentNode.removeChild($(id+"_y"));
}
});
diff --git a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
index 834e89cf..a16cc3d6 100644
--- a/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
+++ b/framework/Web/Javascripts/source/prado/datepicker/datepicker.js
@@ -67,6 +67,7 @@ Prado.WebUI.TDatePicker.prototype =
this.weekSlot = new Array(6);
this.minimalDaysInFirstWeek = 4;
this.selectedDate = this.newDate();
+ this.positionMode = 'Bottom';
//which element to trigger to show the calendar
if(this.options.Trigger)
@@ -79,6 +80,12 @@ Prado.WebUI.TDatePicker.prototype =
this.trigger = this.control;
var triggerEvent = this.options.TriggerEvent || "focus";
}
+
+ // Popup position
+ if(this.options.PositionMode == 'Top')
+ {
+ this.positionMode = this.options.PositionMode;
+ }
Object.extend(this,options);
@@ -309,8 +316,8 @@ Prado.WebUI.TDatePicker.prototype =
if(this.iePopUp)
{
this.iePopUp.style.display = "block";
- this.iePopUp.style.top = (this._calDiv.offsetTop -1 ) + "px";
this.iePopUp.style.left = (this._calDiv.offsetLeft -1)+ "px";
+ this.iePopUp.style.top = (this._calDiv.offsetTop -1 ) + "px";
this.iePopUp.style.width = Math.abs(this._calDiv.offsetWidth -2)+ "px";
this.iePopUp.style.height = (this._calDiv.offsetHeight + 1)+ "px";
if(cleanup) this.iePopUp.style.display = "none";
@@ -603,12 +610,10 @@ Prado.WebUI.TDatePicker.prototype =
var pos = this.control.positionedOffset();
pos[1] += this.getDatePickerOffsetHeight();
-
- this._calDiv.style.display = "block";
this._calDiv.style.top = (pos[1]-1) + "px";
+ this._calDiv.style.display = "block";
this._calDiv.style.left = pos[0] + "px";
- this.ieHack(false);
this.documentClickEvent = this.hideOnClick.bindEvent(this);
this.documentKeyDownEvent = this.keyPressed.bindEvent(this);
Event.observe(document.body, "click", this.documentClickEvent);
@@ -620,6 +625,14 @@ Prado.WebUI.TDatePicker.prototype =
}
Event.observe(document,"keydown", this.documentKeyDownEvent);
this.showing = true;
+
+ if(this.positionMode=='Top')
+ {
+ this._calDiv.style.top = ((pos[1]-1) - this.getDatePickerOffsetHeight() - this._calDiv.offsetHeight) + 'px';
+ if(Prado.Browser().ie)
+ this.iePopup = this._calDiv.style.top;
+ }
+ this.ieHack(false);
}
},
diff --git a/framework/Web/Javascripts/source/prado/ratings/ratings.js b/framework/Web/Javascripts/source/prado/ratings/ratings.js
index e1770f1f..8af32bb9 100644
--- a/framework/Web/Javascripts/source/prado/ratings/ratings.js
+++ b/framework/Web/Javascripts/source/prado/ratings/ratings.js
@@ -1,60 +1,205 @@
-Prado.WebUI.TRatingList = Class.create();
-Prado.WebUI.TRatingList.prototype =
+Prado.WebUI.TRatingList = Base.extend(
{
selectedIndex : -1,
+ rating: -1,
+ readOnly : false,
- initialize : function(options)
+ constructor : function(options)
{
- this.options = options;
- this.element = $(options['ID']);
- Element.addClassName(this.element,options.cssClass);
- this.radios = document.getElementsByName(options.field);
- for(var i = 0; i<this.radios.length; i++)
+ var cap = $(options.CaptionID);
+ this.options = Object.extend(
+ {
+ caption : cap ? cap.innerHTML : ''
+ }, options || {});
+
+ Prado.WebUI.TRatingList.register(this);
+ this._init();
+ this.selectedIndex = options.SelectedIndex;
+ this.rating = options.Rating;
+ this.readOnly = options.ReadOnly
+ if(options.Rating <= 0 && options.SelectedIndex >= 0)
+ this.rating = options.SelectedIndex+1;
+ this.setReadOnly(this.readOnly);
+ },
+
+ _init: function(options)
+ {
+ Element.addClassName($(this.options.ListID),this.options.Style);
+ this.radios = new Array();
+ this._mouseOvers = new Array();
+ this._mouseOuts = new Array();
+ this._clicks = new Array();
+ var index=0;
+ for(var i = 0; i<this.options.ItemCount; i++)
{
- Event.observe(this.radios[i].parentNode.parentNode, "mouseover", this.hover.bindEvent(this,i));
- Event.observe(this.radios[i].parentNode.parentNode, "mouseout", this.recover.bindEvent(this,i));
- Event.observe(this.radios[i].parentNode.parentNode, "click", this.click.bindEvent(this, i));
+ var radio = $(this.options.ListID+'_c'+i);
+ var td = radio.parentNode.parentNode;
+ if(radio && td.tagName.toLowerCase()=='td')
+ {
+ this.radios.push(radio);
+ this._mouseOvers.push(this.hover.bindEvent(this,index));
+ this._mouseOuts.push(this.recover.bindEvent(this,index));
+ this._clicks.push(this.click.bindEvent(this,index));
+ index++;
+ Element.addClassName(td,"rating");
+ }
}
- this.caption = CAPTION();
- this.element.appendChild(this.caption);
- this.selectedIndex = options.selectedIndex;
- this.setRating(this.selectedIndex);
},
hover : function(ev,index)
{
+ if(this.readOnly==true) return;
for(var i = 0; i<this.radios.length; i++)
- this.radios[i].parentNode.parentNode.className = (i<=index) ? "rating_hover" : "";
- this.setCaption(index);
+ {
+ var node = this.radios[i].parentNode.parentNode;
+ var action = i <= index ? 'addClassName' : 'removeClassName'
+ Element[action](node,"rating_hover");
+ Element.removeClassName(node,"rating_selected");
+ Element.removeClassName(node,"rating_half");
+ }
+ this.showCaption(this.getIndexCaption(index));
},
recover : function(ev,index)
{
- for(var i = 0; i<=index; i++)
- Element.removeClassName(this.radios[i].parentNode.parentNode, "rating_hover");
- this.setRating(this.selectedIndex);
+ if(this.readOnly==true) return;
+ this.showRating(this.rating);
+ this.showCaption(this.options.caption);
},
click : function(ev, index)
{
+ if(this.readOnly==true) return;
for(var i = 0; i<this.radios.length; i++)
this.radios[i].checked = (i == index);
this.selectedIndex = index;
- this.setRating(index);
- if(typeof(this.options.onChange)=="function")
- this.options.onChange(this,index);
+ this.setRating(index+1);
+
+ if(this.options['AutoPostBack']==true){
+ this.dispatchRequest(ev);
+ }
+ },
+
+ dispatchRequest : function(ev)
+ {
+ var requestOptions = Object.extend(
+ {
+ ID : this.options.ListID+"_c"+this.selectedIndex,
+ EventTarget : this.options.ListName+"$c"+this.selectedIndex
+ },this.options);
+ Prado.PostBack(ev, requestOptions);
+ },
+
+ setRating : function(value)
+ {
+ this.rating = value;
+ var base = Math.floor(value-1);
+ var remainder = value - base-1;
+ var halfMax = this.options.HalfRating["1"];
+ var index = remainder > halfMax ? base+1 : base;
+ for(var i = 0; i<this.radios.length; i++)
+ this.radios[i].checked = (i == index);
+
+ var caption = this.getIndexCaption(index);
+ this.setCaption(caption);
+ this.showCaption(caption);
+
+ this.showRating(this.rating);
+ },
+
+ showRating: function(value)
+ {
+ var base = Math.floor(value-1);
+ var remainder = value - base-1;
+ var halfMin = this.options.HalfRating["0"];
+ var halfMax = this.options.HalfRating["1"];
+ var index = remainder > halfMax ? base+1 : base;
+ var hasHalf = remainder >= halfMin && remainder <= halfMax;
+ for(var i = 0; i<this.radios.length; i++)
+ {
+ var node = this.radios[i].parentNode.parentNode;
+ var action = i > index ? 'removeClassName' : 'addClassName';
+ Element[action](node, "rating_selected");
+ if(i==index+1 && hasHalf)
+ Element.addClassName(node, "rating_half");
+ else
+ Element.removeClassName(node, "rating_half");
+ Element.removeClassName(node,"rating_hover");
+ }
+ },
+
+ getIndexCaption : function(index)
+ {
+ return index > -1 ? this.radios[index].value : this.options.caption;
+ },
+
+ showCaption : function(value)
+ {
+ var caption = $(this.options.CaptionID);
+ if(caption) caption.innerHTML = value;
+ $(this.options.ListID).title = value;
},
- setRating: function(index)
+ setCaption : function(value)
{
- for(var i = 0; i<=index; i++)
- this.radios[i].parentNode.parentNode.className = "rating_selected";
- this.setCaption(index);
+ this.options.caption = value;
+ this.showCaption(value);
},
- setCaption : function(index)
+ setReadOnly : function(value)
+ {
+ this.readOnly = value;
+ for(var i = 0; i<this.radios.length; i++)
+ {
+
+ var action = value ? 'addClassName' : 'removeClassName';
+ Element[action](this.radios[i].parentNode.parentNode, "rating_disabled");
+
+ var action = value ? 'stopObserving' : 'observe';
+ var td = this.radios[i].parentNode.parentNode;
+ Event[action](td, "mouseover", this._mouseOvers[i]);
+ Event[action](td, "mouseout", this._mouseOuts[i]);
+ Event[action](td, "click", this._clicks[i]);
+ }
+
+ this.showRating(this.rating);
+ }
+},
+{
+ratings : {},
+register : function(rating)
+{
+ Prado.WebUI.TRatingList.ratings[rating.options.ListID] = rating;
+},
+
+setReadOnly : function(id,value)
+{
+ Prado.WebUI.TRatingList.ratings[id].setReadOnly(value);
+},
+
+setRating : function(id,value)
+{
+ Prado.WebUI.TRatingList.ratings[id].setRating(value);
+},
+
+setCaption : function(id,value)
+{
+ Prado.WebUI.TRatingList.ratings[id].setCaption(value);
+}
+});
+
+Prado.WebUI.TActiveRatingList = Prado.WebUI.TRatingList.extend(
+{
+ dispatchRequest : function(ev)
{
- this.caption.innerHTML = index > -1 ?
- this.radios[index].value : this.options.caption;
+ var requestOptions = Object.extend(
+ {
+ ID : this.options.ListID+"_c"+this.selectedIndex,
+ EventTarget : this.options.ListName+"$c"+this.selectedIndex
+ },this.options);
+ var request = new Prado.CallbackRequest(requestOptions.EventTarget, requestOptions);
+ if(request.dispatch()==false)
+ Event.stop(ev);
}
-};
+
+});
diff --git a/framework/Web/Javascripts/source/prado/validator/validation3.js b/framework/Web/Javascripts/source/prado/validator/validation3.js
index c9dba7a1..a3b803d8 100644
--- a/framework/Web/Javascripts/source/prado/validator/validation3.js
+++ b/framework/Web/Javascripts/source/prado/validator/validation3.js
@@ -686,7 +686,7 @@ Prado.WebUI.TValidationSummary.prototype =
{
switch(type)
{
- case "List":
+ case "SimpleList":
return { header : "<br />", first : "", pre : "", post : "<br />", last : ""};
case "SingleParagraph":
return { header : " ", first : "", pre : "", post : " ", last : "<br />"};
@@ -1668,6 +1668,7 @@ Prado.WebUI.TRegularExpressionValidator = Class.extend(Prado.WebUI.TBaseValidato
* @constructor initialize
* @param {object} options - Additional constructor option:
* @... {string} ValidationExpression - Regular expression to match against.
+ * @... {string} PatternModifiers - Pattern modifiers: combinations of g, i, and m
*/
/**
@@ -1678,12 +1679,12 @@ Prado.WebUI.TRegularExpressionValidator = Class.extend(Prado.WebUI.TBaseValidato
evaluateIsValid : function()
{
var value = this.getValidationValue();
- if (value.length <= 0)
+ if (value.length <= 0)
return true;
- var rx = new RegExp(this.options.ValidationExpression);
- var matches = rx.exec(value);
- return (matches != null && value == matches[0]);
+ var rx = new RegExp(this.options.ValidationExpression,this.options.PatternModifiers);
+ var matches = rx.exec(value);
+ return (matches != null && value == matches[0]);
}
});
@@ -1847,6 +1848,8 @@ Prado.WebUI.TCaptchaValidator = Class.extend(Prado.WebUI.TBaseValidator,
{
var a = this.getValidationValue();
var h = 0;
+ if (this.options.CaseSensitive==false)
+ a = a.toUpperCase();
for(var i = a.length-1; i >= 0; --i)
h += a.charCodeAt(i);
return h == this.options.TokenHash;
diff --git a/framework/Web/Javascripts/source/scriptaculous-1.8.1/dragdrop.js b/framework/Web/Javascripts/source/scriptaculous-1.8.1/dragdrop.js
index bf429c26..14f9546e 100644
--- a/framework/Web/Javascripts/source/scriptaculous-1.8.1/dragdrop.js
+++ b/framework/Web/Javascripts/source/scriptaculous-1.8.1/dragdrop.js
@@ -407,7 +407,7 @@ var Draggable = Class.create({
if(this.options.ghosting) {
if (!this.element._originallyAbsolute)
Position.relativize(this.element);
- delete this.element._originallyAbsolute;
+ this.element._originallyAbsolute=null;
Element.remove(this._clone);
this._clone = null;
}
diff --git a/framework/Web/Services/TFeedService.php b/framework/Web/Services/TFeedService.php
index fea39290..7ecd10a7 100644
--- a/framework/Web/Services/TFeedService.php
+++ b/framework/Web/Services/TFeedService.php
@@ -143,4 +143,3 @@ interface IFeedContentProvider
public function getContentType();
}
-?>
diff --git a/framework/Web/Services/TJsonService.php b/framework/Web/Services/TJsonService.php
index 93ad10d2..e3ed9a7f 100644
--- a/framework/Web/Services/TJsonService.php
+++ b/framework/Web/Services/TJsonService.php
@@ -92,7 +92,7 @@ class TJsonService extends TService
throw new TConfigurationException('jsonservice_class_required',$id);
}
else
- throw new THttpException(404,'jsonservice_feed_unknown',$id);
+ throw new THttpException(404,'jsonservice_provider_unknown',$id);
}
/**
diff --git a/framework/Web/Services/TSoapService.php b/framework/Web/Services/TSoapService.php
index 259fa5f8..f5962647 100644
--- a/framework/Web/Services/TSoapService.php
+++ b/framework/Web/Services/TSoapService.php
@@ -612,4 +612,3 @@ class TSoapServer extends TApplicationComponent
}
}
-?>
diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php
index d8028d93..7925d209 100644
--- a/framework/Web/TAssetManager.php
+++ b/framework/Web/TAssetManager.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web
@@ -113,7 +113,7 @@ class TAssetManager extends TModule
{
$this->_basePath=Prado::getPathOfNamespace($value);
if($this->_basePath===null || !is_dir($this->_basePath) || !is_writable($this->_basePath))
- throw new TInvalidDataValueException('assetmanage_basepath_invalid',$value);
+ throw new TInvalidDataValueException('assetmanager_basepath_invalid',$value);
}
}
@@ -267,7 +267,10 @@ class TAssetManager extends TModule
else if(is_file($src.DIRECTORY_SEPARATOR.$file))
{
if(@filemtime($dst.DIRECTORY_SEPARATOR.$file)<@filemtime($src.DIRECTORY_SEPARATOR.$file))
+ {
@copy($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
+ @chmod($dst.DIRECTORY_SEPARATOR.$file, PRADO_CHMOD);
+ }
}
else
$this->copyDirectory($src.DIRECTORY_SEPARATOR.$file,$dst.DIRECTORY_SEPARATOR.$file);
@@ -333,4 +336,4 @@ class TAssetManager extends TModule
}
-?>
+?>
diff --git a/framework/Web/TCacheHttpSession.php b/framework/Web/TCacheHttpSession.php
index 0d89a519..daa94122 100644
--- a/framework/Web/TCacheHttpSession.php
+++ b/framework/Web/TCacheHttpSession.php
@@ -148,4 +148,3 @@ class TCacheHttpSession extends THttpSession
}
}
-?>
diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php
index d595c1b9..7100a4c5 100644
--- a/framework/Web/THttpRequest.php
+++ b/framework/Web/THttpRequest.php
@@ -1237,4 +1237,3 @@ class THttpRequestUrlFormat extends TEnumerable
const Path='Path';
}
-?>
diff --git a/framework/Web/THttpResponse.php b/framework/Web/THttpResponse.php
index 44a853b0..fd45acf5 100644
--- a/framework/Web/THttpResponse.php
+++ b/framework/Web/THttpResponse.php
@@ -574,4 +574,3 @@ class THttpResponse extends TModule implements ITextWriter
}
}
-?>
diff --git a/framework/Web/THttpSession.php b/framework/Web/THttpSession.php
index 251db64b..96d70704 100644
--- a/framework/Web/THttpSession.php
+++ b/framework/Web/THttpSession.php
@@ -708,4 +708,3 @@ class THttpSessionCookieMode extends TEnumerable
const Only='Only';
}
-?>
diff --git a/framework/Web/THttpUtility.php b/framework/Web/THttpUtility.php
index c6e7c3fc..a410b957 100644
--- a/framework/Web/THttpUtility.php
+++ b/framework/Web/THttpUtility.php
@@ -48,4 +48,3 @@ class THttpUtility
}
}
-?>
diff --git a/framework/Web/TUrlManager.php b/framework/Web/TUrlManager.php
index 778b762a..f87bee8f 100644
--- a/framework/Web/TUrlManager.php
+++ b/framework/Web/TUrlManager.php
@@ -139,4 +139,3 @@ class TUrlManager extends TModule
}
}
-?>
diff --git a/framework/Web/TUrlMapping.php b/framework/Web/TUrlMapping.php
index e1deea0f..83dd99b6 100644
--- a/framework/Web/TUrlMapping.php
+++ b/framework/Web/TUrlMapping.php
@@ -76,7 +76,7 @@ class TUrlMapping extends TUrlManager
/**
* @var TUrlMappingPattern[] list of patterns.
*/
- private $_patterns=array();
+ protected $_patterns=array();
/**
* @var TUrlMappingPattern matched pattern.
*/
@@ -92,7 +92,7 @@ class TUrlMapping extends TUrlManager
/**
* @var array rules for constructing URLs
*/
- private $_constructRules=array();
+ protected $_constructRules=array();
private $_urlPrefix='';
@@ -264,7 +264,8 @@ class TUrlMapping extends TUrlManager
if(is_string($key))
$params[$key]=$value;
}
- $params[$pattern->getServiceID()]=$pattern->getServiceParameter();
+ if (!$pattern->getIsWildCardPattern())
+ $params[$pattern->getServiceID()]=$pattern->getServiceParameter();
return $params;
}
}
@@ -299,6 +300,8 @@ class TUrlMapping extends TUrlManager
if(!(is_array($getItems) || ($getItems instanceof Traversable)))
$getItems=array();
$key=$serviceID.':'.$serviceParam;
+ $wildCardKey = ($pos=strrpos($serviceParam,'.'))!==false ?
+ $serviceID.':'.substr($serviceParam,0,$pos).'.*' : $serviceID.':*';
if(isset($this->_constructRules[$key]))
{
foreach($this->_constructRules[$key] as $rule)
@@ -306,6 +309,17 @@ class TUrlMapping extends TUrlManager
if($rule->supportCustomUrl($getItems))
return $rule->constructUrl($getItems,$encodeAmpersand,$encodeGetItems);
}
+ }
+ elseif(isset($this->_constructRules[$wildCardKey]))
+ {
+ foreach($this->_constructRules[$wildCardKey] as $rule)
+ {
+ if($rule->supportCustomUrl($getItems))
+ {
+ $getItems['*']= $pos ? substr($serviceParam,$pos+1) : $serviceParam;
+ return $rule->constructUrl($getItems,$encodeAmpersand,$encodeGetItems);
+ }
+ }
}
}
return parent::constructUrl($serviceID,$serviceParam,$getItems,$encodeAmpersand,$encodeGetItems);
@@ -399,6 +413,8 @@ class TUrlMappingPattern extends TComponent
private $_manager;
private $_caseSensitive=true;
+
+ private $_isWildCardPattern=false;
/**
* Constructor.
@@ -428,6 +444,8 @@ class TUrlMappingPattern extends TComponent
{
if($this->_serviceParameter===null)
throw new TConfigurationException('urlmappingpattern_serviceparameter_required', $this->getPattern());
+ if(strpos($this->_serviceParameter,'*')!==false)
+ $this->_isWildCardPattern=true;
}
/**
@@ -444,6 +462,11 @@ class TUrlMappingPattern extends TComponent
$params[]='{'.$key.'}';
$values[]='(?P<'.$key.'>'.$value.')';
}
+ if ($this->getIsWildCardPattern()) {
+ $params[]='{*}';
+ // service parameter must not contain '=' and '/'
+ $values[]='(?P<'.$this->getServiceID().'>[^=/]+)';
+ }
$params[]='/';
$values[]='\\/';
$regexp=str_replace($params,$values,trim($this->getPattern(),'/').'/');
@@ -585,6 +608,14 @@ class TUrlMappingPattern extends TComponent
}
/**
+ * @return boolean whether this pattern is a wildcard pattern
+ * @since 3.1.4
+ */
+ public function getIsWildCardPattern() {
+ return $this->_isWildCardPattern;
+ }
+
+ /**
* @param array list of GET items to be put in the constructed URL
* @return boolean whether this pattern IS the one for constructing the URL with the specified GET items.
* @since 3.1.1
@@ -616,10 +647,8 @@ class TUrlMappingPattern extends TComponent
// for the GET variables matching the pattern, put them in the URL path
foreach($getItems as $key=>$value)
{
- if($encodeGetItems)
- $value=urlencode($value);
- if($this->_parameters->contains($key))
- $replace['{'.$key.'}']=$value;
+ if($this->_parameters->contains($key) || $key==='*' && $this->getIsWildCardPattern())
+ $replace['{'.$key.'}']=$encodeGetItems ? rawurlencode($value) : $value;
else
$extra[$key]=$value;
}
@@ -637,12 +666,12 @@ class TUrlMappingPattern extends TComponent
{
if(is_array($value))
{
- $name=urlencode($name.'[]');
+ $name=rawurlencode($name.'[]');
foreach($value as $v)
- $url2.=$amp.$name.'='.urlencode($v);
+ $url2.=$amp.$name.'='.rawurlencode($v);
}
else
- $url2.=$amp.urlencode($name).'='.urlencode($value);
+ $url2.=$amp.rawurlencode($name).'='.rawurlencode($value);
}
}
else
@@ -664,4 +693,3 @@ class TUrlMappingPattern extends TComponent
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActiveButton.php b/framework/Web/UI/ActiveControls/TActiveButton.php
index 992f41e3..0990ff41 100644
--- a/framework/Web/UI/ActiveControls/TActiveButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveButton.php
@@ -130,4 +130,3 @@ class TActiveButton extends TButton implements ICallbackEventHandler, IActiveCon
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
index 88e4fdfe..34872f98 100644
--- a/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActiveControlAdapter.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
@@ -97,7 +97,7 @@ class TActiveControlAdapter extends TControlAdapter
$data = $this->getPage()->getPostDataLoaders();
if(count($data) > 0)
{
- $options = TJavascript::encode($data,false);
+ $options = TJavaScript::encode($data,false);
$script = "Prado.CallbackRequest.addPostLoaders({$options});";
$cs->registerEndScript($key, $script);
}
@@ -146,12 +146,12 @@ class TActiveControlAdapter extends TControlAdapter
* Starts viewstate tracking if necessary after when controls has been loaded
*/
public function onLoad($param)
- {
+ {
if($this->getIsTrackingPageState())
{
$this->_stateTracker = new TCallbackPageStateTracker($this->getControl());
$this->_stateTracker->trackChanges();
- }
+ }
parent::onLoad($param);
}
@@ -560,4 +560,3 @@ class TMapCollectionDiff extends TViewStateDiff
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
index 8428c810..6c74aa7d 100644
--- a/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
+++ b/framework/Web/UI/ActiveControls/TActiveCustomValidator.php
@@ -239,4 +239,3 @@ class TActiveCustomValidatorClientSide extends TCallbackClientSide
return is_null($changes) ? true : $changes;
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActiveDatePicker.php b/framework/Web/UI/ActiveControls/TActiveDatePicker.php
new file mode 100755
index 00000000..052ed199
--- /dev/null
+++ b/framework/Web/UI/ActiveControls/TActiveDatePicker.php
@@ -0,0 +1,129 @@
+<?php
+/**
+ * TActiveDatePicker class file
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @author Christophe Boulain <Christophe.Boulain@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @license http://www.pradosoft.com/license/
+ * @version $Id$
+ * @package System.Web.UI.ActiveControls
+ */
+
+/**
+ * Load active control adapter.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
+
+/**
+ * TActiveDatePicker class
+ *
+ * The active control counter part to date picker control.
+ * When the date selection is changed, the {@link onCallback OnCallback} event is
+ * raised.
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @author Christophe Boulain <Christophe.Boulain@gmail.com>
+ * @version $Id$
+ * @package System.Web.UI.ActiveControls
+ * @since 3.1.3
+ */
+class TActiveDatePicker extends TDatePicker implements ICallbackEventHandler, IActiveControl {
+
+
+ /**
+ * Get javascript date picker options.
+ * @return array date picker client-side options
+ */
+ protected function getDatePickerOptions(){
+ $options = parent::getDatePickerOptions();
+ $options['EventTarget'] = $this->getUniqueID();
+ return $options;
+ }
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TActiveControlAdapter($this));
+ }
+
+ /**
+ * @return TBaseActiveCallbackControl standard callback control options.
+ */
+ public function getActiveControl(){
+ return $this->getAdapter()->getBaseActiveControl();
+ }
+
+ /**
+ * Client-side Text property can only be updated after the OnLoad stage.
+ * @param string text content for the textbox
+ */
+ public function setText($value){
+ parent::setText($value);
+ if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){
+ $cb=$this->getPage()->getCallbackClient();
+ $cb->setValue($this, $value);
+ if ($this->getInputMode()==TDatePickerInputMode::DropDownList)
+ {
+ $s = Prado::createComponent('System.Util.TDateTimeStamp');
+ $date = $s->getDate($this->getTimeStampFromText());
+ $id=$this->getClientID();
+ $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $date['mday'], 'select');
+ $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon']-1, 'select');
+ $cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $date['year'], 'select');
+
+ }
+ }
+ }
+
+ /**
+ * Raises the callback event. This method is required by {@link
+ * ICallbackEventHandler} interface.
+ * This method is mainly used by framework and control developers.
+ * @param TCallbackEventParameter the event parameter
+ */
+ public function raiseCallbackEvent($param){
+ $this->onCallback($param);
+ }
+
+ /**
+ * This method is invoked when a callback is requested. The method raises
+ * 'OnCallback' event to fire up the event handlers. If you override this
+ * method, be sure to call the parent implementation so that the event
+ * handler can be invoked.
+ * @param TCallbackEventParameter event parameter to be passed to the event handlers
+ */
+ public function onCallback($param){
+ $this->raiseEvent('OnCallback', $this, $param);
+ }
+
+ /**
+ * Registers the javascript code to initialize the date picker.
+ */
+ protected function registerCalendarClientScript()
+ {
+ if($this->getShowCalendar())
+ {
+ $cs = $this->getPage()->getClientScript();
+ $cs->registerPradoScript("activedatepicker");
+
+ if(!$cs->isEndScriptRegistered('TDatePicker.spacer'))
+ {
+ $spacer = $this->getAssetUrl('spacer.gif');
+ $code = "Prado.WebUI.TDatePicker.spacer = '$spacer';";
+ $cs->registerEndScript('TDatePicker.spacer', $code);
+ }
+
+ $options = TJavaScript::encode($this->getDatePickerOptions());
+ $code = "new Prado.WebUI.TActiveDatePicker($options);";
+ $cs->registerEndScript("prado:".$this->getClientID(), $code);
+ }
+ }
+}
+?>
diff --git a/framework/Web/UI/ActiveControls/TActiveFileUpload.php b/framework/Web/UI/ActiveControls/TActiveFileUpload.php
new file mode 100755
index 00000000..e1b85f0d
--- /dev/null
+++ b/framework/Web/UI/ActiveControls/TActiveFileUpload.php
@@ -0,0 +1,315 @@
+<?php
+/**
+ * TActiveFileUpload.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @author Christophe Boulain <Christophe.Boulain@gmail.com>
+ * @version $Id$
+ */
+
+/**
+ * Load TActiveControlAdapter and TFileUpload.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
+Prado::using('System.Web.UI.WebControls.TFileUpload');
+
+/**
+ * TActiveFileUpload
+ *
+ * TActiveFileUpload displays a file upload field on a page. Upon postback,
+ * the text entered into the field will be treated as the name of the file
+ * that will be uploaded to the server. The property {@link getHasFile HasFile}
+ * indicates whether the file upload is successful. If successful, the file
+ * may be obtained by calling {@link saveAs} to save it at a specified place.
+ * You can use {@link getFileName FileName}, {@link getFileType FileType},
+ * {@link getFileSize FileSize} to get the original client-side file name,
+ * the file mime type, and the file size information. If the upload is not
+ * successful, {@link getErrorCode ErrorCode} contains the error code
+ * describing the cause of failure.
+ *
+ * TActiveFileUpload raises {@link onFileUpload OnFileUpload} event if a file is uploaded
+ * (whether it succeeds or not).
+ *
+ * TActiveFileUpload actually does a postback in a hidden IFrame, and then does a callback.
+ * This callback then raises the {@link onFileUpload OnFileUpload} event. After the postback
+ * a status icon is displayed; either a green checkmark if the upload is successful,
+ * or a red x if there was an error.
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @author Christophe Boulain <Christophe.Boulain@gmail.com>
+ *
+ * @version $Id$
+ */
+class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer
+{
+
+ const SCRIPT_PATH = 'prado/activefileupload';
+
+ /**
+ * @var THiddenField a flag to tell which component is doing the callback.
+ */
+ private $_flag;
+ /**
+ * @var TImage that spins to show that the file is being uploaded.
+ */
+ private $_busy;
+ /**
+ * @var TImage that shows a green check mark for completed upload.
+ */
+ private $_success;
+ /**
+ * @var TImage that shows a red X for incomplete upload.
+ */
+ private $_error;
+ /**
+ * @var TInlineFrame used to submit the data in an "asynchronous" fashion.
+ */
+ private $_target;
+
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct(){
+ parent::__construct();
+ $this->setAdapter(new TActiveControlAdapter($this));
+ }
+
+
+ /**
+ * @param string asset file in the self::SCRIPT_PATH directory.
+ * @return string asset file url.
+ */
+ protected function getAssetUrl($file='')
+ {
+ $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
+ return $base.'/'.self::SCRIPT_PATH.'/'.$file;
+ }
+
+
+ /**
+ * This method is invoked when a file is uploaded.
+ * If you override this method, be sure to call the parent implementation to ensure
+ * the invocation of the attached event handlers.
+ * @param TEventParameter event parameter to be passed to the event handlers
+ */
+ public function onFileUpload($param){
+ if ($this->_flag->getValue() && $this->getPage()->getIsPostBack()){
+ // save the file so that it will persist past the end of this return.
+ $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),''));
+ parent::saveAs($localName);
+
+ $filename=addslashes($this->getFileName());
+ // return some javascript to display a completion status.
+ echo <<<EOS
+<script language="Javascript">
+ Options = new Object();
+ Options.clientID = '{$this->getClientID()}';
+ Options.targetID = '{$this->_target->getUniqueID()}';
+ Options.localName = '$localName';
+ Options.fileName = '{$filename}';
+ Options.fileSize = '{$this->getFileSize()}';
+ Options.fileType = '{$this->getFileType()}';
+ Options.errorCode = '{$this->getErrorCode()}';
+ parent.Prado.WebUI.TActiveFileUpload.onFileUpload(Options);
+</script>
+EOS;
+ exit();
+ }
+ }
+
+ /**
+ * @return string the path where the uploaded file will be stored temporarily, in namespace format
+ * default "Application.runtime.*"
+ */
+ public function getTempPath(){
+ return $this->getViewState('TempPath', 'Application.runtime.*');
+ }
+
+ /**
+ * @param string the path where the uploaded file will be stored temporarily in namespace format
+ * default "Application.runtime.*"
+ */
+ public function setTempPath($value){
+ $this->setViewState('TempNamespace',$value,'Application.runtime.*');
+ }
+
+ /**
+ * @throws TInvalidDataValueException if the {@link getTempPath TempPath} is not writable.
+ */
+ public function onInit($sender){
+ parent::onInit($sender);
+ if (!is_writable(Prado::getPathOfNamespace($this->getTempPath()))){
+ throw new TInvalidDataValueException("activefileupload_temppath_invalid", $this->getTempPath());
+ }
+ }
+
+ /**
+ * Raises <b>OnFileUpload</b> event.
+ *
+ * This method is required by {@link ICallbackEventHandler} interface.
+ * This method is mainly used by framework and control developers.
+ * @param TCallbackEventParameter the event parameter
+ */
+ public function raiseCallbackEvent($param){
+ $cp = $param->getCallbackParameter();
+ if ($key = $cp->targetID == $this->_target->getUniqueID()){
+ $_FILES[$key]['name'] = $cp->fileName;
+ $_FILES[$key]['size'] = intval($cp->fileSize);
+ $_FILES[$key]['type'] = $cp->fileType;
+ $_FILES[$key]['error'] = intval($cp->errorCode);
+ $_FILES[$key]['tmp_name'] = $cp->localName;
+ $this->loadPostData($key, null);
+
+ $this->raiseEvent('OnFileUpload', $this, $param);
+ }
+ }
+
+ /**
+ * Publish the javascript
+ */
+ public function onPreRender($param){
+ parent::onPreRender($param);
+ $this->getPage()->getClientScript()->registerPradoScript('activefileupload');
+ }
+
+
+ public function createChildControls(){
+ $this->_flag = Prado::createComponent('THiddenField');
+ $this->_flag->setID('Flag');
+ $this->getControls()->add($this->_flag);
+
+ $this->_busy = Prado::createComponent('TImage');
+ $this->_busy->setID('Busy');
+ $this->_busy->setImageUrl($this->getAssetUrl('ActiveFileUploadIndicator.gif'));
+ $this->_busy->setStyle("display:none");
+ $this->getControls()->add($this->_busy);
+
+ $this->_success = Prado::createComponent('TImage');
+ $this->_success->setID('Success');
+ $this->_success->setImageUrl($this->getAssetUrl('ActiveFileUploadComplete.png'));
+ $this->_success->setStyle("display:none");
+ $this->getControls()->add($this->_success);
+
+ $this->_error = Prado::createComponent('TImage');
+ $this->_error->setID('Error');
+ $this->_error->setImageUrl($this->getAssetUrl('ActiveFileUploadError.png'));
+ $this->_error->setStyle("display:none");
+ $this->getControls()->add($this->_error);
+
+ $this->_target = Prado::createComponent('TInlineFrame');
+ $this->_target->setID('Target');
+ $this->_target->setFrameUrl($this->getAssetUrl('ActiveFileUploadBlank.html'));
+ $this->_target->setStyle("width:0px; height:0px;");
+ $this->_target->setShowBorder(false);
+ $this->getControls()->add($this->_target);
+ }
+
+
+ /**
+ * Removes localfile on ending of the callback.
+ */
+ public function onUnload($param){
+ if ($this->getPage()->getIsCallback() &&
+ $this->getHasFile() &&
+ file_exists($this->getLocalName())){
+ unlink($this->getLocalName());
+ }
+ parent::onUnload($param);
+ }
+
+ /**
+ * @return TBaseActiveCallbackControl standard callback control options.
+ */
+ public function getActiveControl(){
+ return $this->getAdapter()->getBaseActiveControl();
+ }
+
+ /**
+ * Adds ID attribute, and renders the javascript for active component.
+ * @param THtmlWriter the writer used for the rendering purpose
+ */
+ public function addAttributesToRender($writer){
+ parent::addAttributesToRender($writer);
+ $writer->addAttribute('id',$this->getClientID());
+
+ $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(),$this->getClientOptions());
+ }
+
+ /**
+ * @return string corresponding javascript class name for this control.
+ */
+ protected function getClientClassName(){
+ return 'Prado.WebUI.TActiveFileUpload';
+ }
+
+ /**
+ * Gets the client side options for this control.
+ * @return array ( inputID => input client ID,
+ * flagID => flag client ID,
+ * targetName => target unique ID,
+ * formID => form client ID,
+ * indicatorID => upload indicator client ID,
+ * completeID => complete client ID,
+ * errorID => error client ID)
+ */
+ protected function getClientOptions(){
+ $options['ID'] = $this->getClientID();
+ $options['EventTarget'] = $this->getUniqueID();
+
+ $options['inputID'] = $this->getClientID();
+ $options['flagID'] = $this->_flag->getClientID();
+ $options['targetID'] = $this->_target->getUniqueID();
+ $options['formID'] = $this->getPage()->getForm()->getClientID();
+ $options['indicatorID'] = $this->_busy->getClientID();
+ $options['completeID'] = $this->_success->getClientID();
+ $options['errorID'] = $this->_error->getClientID();
+ return $options;
+ }
+
+ /**
+ * Saves the uploaded file.
+ * @param string the file name used to save the uploaded file
+ * @param boolean whether to delete the temporary file after saving.
+ * If true, you will not be able to save the uploaded file again.
+ * @return boolean true if the file saving is successful
+ */
+ public function saveAs($fileName,$deleteTempFile=true){
+ if (($this->getErrorCode()===UPLOAD_ERR_OK) && (file_exists($this->getLocalName()))){
+ if ($deleteTempFile)
+ return rename($this->getLocalName(),$fileName);
+ else
+ return copy($this->getLocalName(),$fileName);
+ } else
+ return false;
+ }
+
+ /**
+ * @return TImage the image displayed when an upload
+ * completes successfully.
+ */
+ public function getSuccessImage(){
+ $this->ensureChildControls();
+ return $this->_success;
+ }
+
+ /**
+ * @return TImage the image displayed when an upload
+ * does not complete successfully.
+ */
+ public function getErrorImage(){
+ $this->ensureChildControls();
+ return $this->_error;
+ }
+
+ /**
+ * @return TImage the image displayed when an upload
+ * is in progress.
+ */
+ public function getBusyImage(){
+ $this->ensureChildControls();
+ return $this->_busy;
+ }
+} \ No newline at end of file
diff --git a/framework/Web/UI/ActiveControls/TActiveHiddenField.php b/framework/Web/UI/ActiveControls/TActiveHiddenField.php
index 378fc76f..6d837cb2 100644
--- a/framework/Web/UI/ActiveControls/TActiveHiddenField.php
+++ b/framework/Web/UI/ActiveControls/TActiveHiddenField.php
@@ -114,4 +114,3 @@ class TActiveHiddenField extends THiddenField implements ICallbackEventHandler,
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActiveLabel.php b/framework/Web/UI/ActiveControls/TActiveLabel.php
index e4b4bc6f..4105e3dc 100644
--- a/framework/Web/UI/ActiveControls/TActiveLabel.php
+++ b/framework/Web/UI/ActiveControls/TActiveLabel.php
@@ -77,6 +77,14 @@ class TActiveLabel extends TLabel implements IActiveControl
$this->getPage()->getCallbackClient()->setAttribute($this, 'for', $id);
}
}
+
+ /**
+ * Adds attribute id to the renderer.
+ * @param THtmlWriter the writer used for the rendering purpose
+ */
+ protected function addAttributesToRender($writer) {
+ $writer->addAttribute('id',$this->getClientID());
+ parent::addAttributesToRender($writer);
+ }
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActiveLinkButton.php b/framework/Web/UI/ActiveControls/TActiveLinkButton.php
index 5a863a9d..f1551b40 100644
--- a/framework/Web/UI/ActiveControls/TActiveLinkButton.php
+++ b/framework/Web/UI/ActiveControls/TActiveLinkButton.php
@@ -11,6 +11,11 @@
*/
/**
+ * Load active control adapter.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
+
+/**
* TActiveLinkButton is the active control counter part to TLinkButton.
*
* When a TActiveLinkButton is clicked, rather than a normal post back request a
diff --git a/framework/Web/UI/ActiveControls/TActivePageAdapter.php b/framework/Web/UI/ActiveControls/TActivePageAdapter.php
index 684082b8..c52f0775 100644
--- a/framework/Web/UI/ActiveControls/TActivePageAdapter.php
+++ b/framework/Web/UI/ActiveControls/TActivePageAdapter.php
@@ -155,7 +155,7 @@ class TActivePageAdapter extends TControlAdapter
$responseData = $response->getAdapter()->getResponseData();
if(!is_null($responseData))
{
- $data = TJavascript::jsonEncode($responseData);
+ $data = TJavaScript::jsonEncode($responseData);
$this->appendContentPart($response, self::CALLBACK_DATA_HEADER, $data);
//$response->appendHeader(self::CALLBACK_DATA_HEADER.': '.$data);
@@ -186,7 +186,7 @@ class TActivePageAdapter extends TControlAdapter
//output the actions
$executeJavascript = $this->getCallbackClientHandler()->getClientFunctionsToExecute();
- $actions = TJavascript::jsonEncode($executeJavascript);
+ $actions = TJavaScript::jsonEncode($executeJavascript);
$this->appendContentPart($response, self::CALLBACK_ACTION_HEADER, $actions);
//$response->appendHeader(self::CALLBACK_ACTION_HEADER.': '.$actions);
}
@@ -264,7 +264,7 @@ class TActivePageAdapter extends TControlAdapter
{
$param = $this->getRequest()->itemAt(TPage::FIELD_CALLBACK_PARAMETER);
if(strlen($param) > 0)
- $this->_callbackEventParameter=TJavascript::jsonDecode((string)$param);
+ $this->_callbackEventParameter=TJavaScript::jsonDecode((string)$param);
}
return $this->_callbackEventParameter;
}
@@ -315,7 +315,7 @@ class TCallbackErrorHandler extends TErrorHandler
if($this->getApplication()->getMode()===TApplication::STATE_DEBUG)
{
$response = $this->getApplication()->getResponse();
- $trace = TJavascript::jsonEncode($this->getExceptionStackTrace($exception));
+ $trace = TJavaScript::jsonEncode($this->getExceptionStackTrace($exception));
$response->appendHeader('HTTP/1.0 500 Internal Error');
$response->appendHeader(TActivePageAdapter::CALLBACK_ERROR_HEADER.': '.$trace);
}
@@ -367,4 +367,3 @@ class TInvalidCallbackException extends TException
{
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActivePager.php b/framework/Web/UI/ActiveControls/TActivePager.php
index 7e5ee33e..9dd856c9 100644
--- a/framework/Web/UI/ActiveControls/TActivePager.php
+++ b/framework/Web/UI/ActiveControls/TActivePager.php
@@ -176,12 +176,16 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
// Update all the buttons pagers attached to the same control.
// Dropdown pagers doesn't need to be re-rendered.
$controlToPaginate=$this->getControlToPaginate();
- foreach ($this->getNamingContainer()->findControlsByType('TActivePager') as $control)
+ foreach ($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control)
{
if ($control->getMode() !== TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate)
+ {
$control->render($param->getNewWriter());
+ // FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting
+ // of getting the same boundaries in ajax response. Wait 1 microsecond to avoid this.
+ usleep(1);
+ }
}
-
// Raise callback event
$this->onCallback($param);
}
@@ -202,4 +206,3 @@ class TActivePager extends TPager implements IActiveControl, ICallbackEventHandl
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActivePanel.php b/framework/Web/UI/ActiveControls/TActivePanel.php
index ef41a1dd..51e9fb08 100644
--- a/framework/Web/UI/ActiveControls/TActivePanel.php
+++ b/framework/Web/UI/ActiveControls/TActivePanel.php
@@ -89,4 +89,3 @@ class TActivePanel extends TPanel implements IActiveControl
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
index 10602427..63ef8ef4 100644
--- a/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
+++ b/framework/Web/UI/ActiveControls/TActiveRadioButtonList.php
@@ -11,6 +11,12 @@
*/
/**
+ * Load active control adapter and active radio button.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActiveListControlAdapter');
+Prado::using('System.Web.UI.ActiveControls.TActiveRadioButton');
+
+/**
* TActiveRadioButtonList class.
*
* The active control counter part to radio button list control.
diff --git a/framework/Web/UI/ActiveControls/TActiveRatingList.php b/framework/Web/UI/ActiveControls/TActiveRatingList.php
index 4ec7b6c3..473ca06a 100644
--- a/framework/Web/UI/ActiveControls/TActiveRatingList.php
+++ b/framework/Web/UI/ActiveControls/TActiveRatingList.php
@@ -3,8 +3,9 @@
* TActiveRatingList class file.
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
+ * @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
@@ -13,107 +14,85 @@
/**
* TActiveRatingList Class
*
- * Displays clickable images that represent a TActiveRadioButtonList
+ * Displays clickable images that represent a TRadioButtonList
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com>
* @version $Id$
* @package System.Web.UI.ActiveControls
* @since 3.1
*/
-class TActiveRatingList extends TActiveRadioButtonList
+class TActiveRatingList extends TRatingList implements IActiveControl, ICallbackEventHandler
{
- const SCRIPT_PATH = 'prado/activeratings';
-
- /**
- * @var array list of published rating images.
- */
- private $_ratingImages = array();
-
/**
- * Sets the default repeat direction to horizontal.
+ * Creates a new callback control, sets the adapter to
+ * TActiveListControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
*/
public function __construct()
{
+ $this->setAdapter(new TActiveListControlAdapter($this));
+ $this->setAutoPostBack(true);
parent::__construct();
- $this->setRepeatDirection(TRepeatDirection::Horizontal);
- }
-
- /**
- * @return boolean whether the items in the column can be edited. Defaults to false.
- */
- public function getReadOnly()
- {
- return $this->getViewState('ReadOnly',false);
}
/**
- * @param boolean whether the items in the column can be edited
+ * @return TBaseActiveCallbackControl standard callback control options.
*/
- public function setReadOnly($value)
+ public function getActiveControl()
{
- $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false);
+ return $this->getAdapter()->getBaseActiveControl();
}
/**
- * The repeat layout must be Table.
- * @param string repeat layout type
- * @throws TInvaliddataValueException when repeat layout is not Table.
+ * @return TCallbackClientSide client side request options.
*/
- public function setRepeatLayout($value)
+ public function getClientSide()
{
- if($value!==TRepeatLayout::Table)
- throw new TInvalidDataValueException('ratinglist_table_layout_only');
- else
- parent::setRepeatLayout($value);
+ return $this->getAdapter()->getBaseActiveControl()->getClientSide();
}
/**
- * @return float rating value.
+ * Raises the callback event. This method is required by {@link
+ * ICallbackEventHandler} interface.
+ * This method is mainly used by framework and control developers.
+ * @param TCallbackEventParameter the event parameter
*/
- public function getRating()
+ public function raiseCallbackEvent($param)
{
- return $this->getViewState('Rating',0.0);
+ $this->onCallback($param);
}
/**
- * @param float rating value, also sets the selected Index
+ * This method is invoked when a callback is requested. The method raises
+ * 'OnCallback' event to fire up the event handlers. If you override this
+ * method, be sure to call the parent implementation so that the event
+ * handler can be invoked.
+ * @param TCallbackEventParameter event parameter to be passed to the event handlers
*/
- public function setRating($value)
+ public function onCallback($param)
{
- $rating = TPropertyValue::ensureFloat($value);
- $this->setViewState('Rating', $rating);
- $canUpdate = $this->getActiveControl()->getEnableUpdate();
- $this->getActiveControl()->setEnableUpdate(false);
- parent::setSelectedIndex($this->getRatingIndex($rating));
- $this->getActiveControl()->setEnableUpdate($canUpdate);
- if($this->getActiveControl()->canUpdateClientSide())
- $this->callClientFunction('setRating',$rating);
+ $this->raiseEvent('OnCallback', $this, $param);
}
/**
- * @param float rating value
- * @return int rating as integer
+ * @param boolean whether the items in the column can be edited
*/
- protected function getRatingIndex($rating)
+ public function setReadOnly($value)
{
- $interval = $this->getHalfRatingInterval();
- $base = intval($rating)-1;
- $remainder = $rating-$base-1;
- return $remainder > $interval[1] ? $base+1 : $base;
+ parent::setReadOnly($value);
+ $value = $this->getReadOnly();
+ $this->callClientFunction('setReadOnly',$value);
}
/**
- * @param int change the rating selection index
+ * @param float rating value, also sets the selected Index
*/
- public function setSelectedIndex($value)
+ public function setRating($value)
{
- $value = TPropertyValue::ensureInteger($value);
- $canUpdate = $this->getActiveControl()->getEnableUpdate();
- $this->getActiveControl()->setEnableUpdate(false);
- parent::setSelectedIndex($value);
- $this->getActiveControl()->setEnableUpdate($canUpdate);
- if($this->getActiveControl()->canUpdateClientSide())
- $this->callClientFunction('setRating',$value+1);
+ parent::setRating($value);
+ $value = $this->getRating();
+ $this->callClientFunction('setRating',$value);
}
/**
@@ -123,250 +102,22 @@ class TActiveRatingList extends TActiveRadioButtonList
*/
protected function callClientFunction($func,$value)
{
- $client = $this->getPage()->getCallbackClient();
- $code = $this->getClientClassName().'.'.$func;
- $client->callClientFunction($code,array($this,$value));
- }
-
- /**
- * @return string control or html element ID for displaying a caption.
- */
- public function getCaptionID()
- {
- return $this->getViewState('CaptionID', '');
- }
-
- /**
- * @param string control or html element ID for displaying a caption.
- */
- public function setCaptionID($value)
- {
- $this->setViewState('CaptionID', $value, '');
- }
-
- protected function getCaptionControl()
- {
- if(($id=$this->getCaptionID())!=='')
- {
- if($control=$this->getParent()->findControl($id))
- return $control;
- }
- throw new TInvalidDataValueException(
- 'ratinglist_invalid_caption_id',$id,$this->getID());
- }
-
- public function setCaption($value)
- {
- $this->getCaptionControl()->setText($value);
- if($this->getActiveControl()->canUpdateClientSide())
- $this->callClientFunction('setCaption',$value);
- }
-
- public function getCaption()
- {
- return $this->getCaptionControl()->getText();
- }
-
- /**
- * @param boolean true to enable the rating to be changed.
- */
- public function setEnabled($value)
- {
- $value = TPropertyValue::ensureBoolean($value);
- parent::setEnabled($value);
if($this->getActiveControl()->canUpdateClientSide())
- $this->callClientFunction('setEnabled',$value);
- }
-
- /**
- * @param string set the rating style, default is "default"
- */
- public function setRatingStyle($value)
- {
- $this->setViewState('RatingStyle', $value, 'default');
- }
-
- /**
- * @return TActiveRatingListStyle current rating style
- */
- public function getRatingStyle()
- {
- return $this->getViewState('RatingStyle', 'default');
- }
-
- /**
- * Sets the interval such that those rating values within the interval
- * will be considered as a half star rating.
- * @param array rating display half value interval, default is array(0.3, 0.7);
- */
- public function setHalfRatingInterval($value)
- {
- $this->setViewState('HalfRating',
- TPropertyValue::ensureArray($value), array(0.3, 0.7));
- }
-
- /**
- * @return array rating display half value interval, default is array(0.3, 0.7);
- */
- public function getHalfRatingInterval()
- {
- return $this->getViewState('HalfRating', array(0.3, 0.7));
- }
-
- /**
- * @return string rating style css class name.
- */
- protected function getRatingStyleCssClass()
- {
- return 'TActiveRatingList_'.$this->getRatingStyle();
- }
-
- /**
- * @return array list of post back options.
- */
- protected function getPostBackOptions()
- {
- $options = parent::getPostBackOptions();
- $options['Style'] = $this->getRatingStyleCssClass();
- $options['CaptionID'] = $this->getCaptionControlID();
- $options['SelectedIndex'] = $this->getSelectedIndex();
- $options['Rating'] = $this->getRating();
- $options['HalfRating'] = $this->getHalfRatingInterval();
- return $options;
- }
-
- /**
- * Registers the javascript code for initializing the active control
- * only if {@link setReadOnly ReadOnly} property is false.
- */
- protected function renderClientControlScript($writer)
- {
- if($this->getReadOnly()===false)
- parent::renderClientControlScript($writer);
- }
-
- /**
- * @return string find the client ID of the caption control.
- */
- protected function getCaptionControlID()
- {
- if(($id=$this->getCaptionID())!=='')
{
- if($control=$this->getParent()->findControl($id))
- {
- if($control->getVisible(true))
- return $control->getClientID();
- }
- else
- return $id;
+ $client = $this->getPage()->getCallbackClient();
+ $code = parent::getClientClassName().'.'.$func;
+ $client->callClientFunction($code,array($this,$value));
}
- return '';
}
/**
- * @param string asset file in the self::SCRIPT_PATH directory.
- * @return string asset file url.
+ * @param string caption text
*/
- protected function getAssetUrl($file='')
- {
- $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
- return $base.'/'.self::SCRIPT_PATH.'/'.$file;
- }
-
- /**
- * @param string rating style name
- * @return string URL of the css style file
- */
- protected function publishRatingListStyle($style)
- {
- $cs = $this->getPage()->getClientScript();
- $url = $this->getAssetUrl($style.'.css');
- if(!$cs->isStyleSheetFileRegistered($url))
- $cs->registerStyleSheetFile($url, $url);
- return $url;
- }
-
- /**
- * @param string rating style name
- * @param string rating image file extension, default is '.gif'
- * @return array URL of publish the rating images
- */
- protected function publishRatingListImages($style, $fileExt='.gif')
- {
- $types = array('blank', 'selected', 'half', 'combined');
- $files = array();
- foreach($types as $type)
- $files[$type] = $this->getAssetUrl("{$style}_{$type}{$fileExt}");
- return $files;
- }
-
- /**
- * Add rating style class name to the class attribute
- * when {@link setReadOnly ReadOnly} property is true and when the
- * {@link setCssClass CssClass} property is empty.
- * @param THtmlWriter renderer
- */
- public function render($writer)
- {
- if($this->getReadOnly())
- $writer->addAttribute('class', $this->getRatingStyleCssClass());
- else
- {
- $writer->addAttribute('id',$this->getClientID());
- $this->getActiveControl()->registerCallbackClientScript(
- $this->getClientClassName(), $this->getPostBackOptions());
- }
- parent::render($writer);
- }
-
- /**
- * Publish the the rating style css file and rating image files.
- */
- public function onPreRender($param)
- {
- parent::onPreRender($param);
-
- $this->publishRatingListStyle($this->getRatingStyle());
- $this->_ratingImages = $this->publishRatingListImages($this->getRatingStyle());
- }
-
- /**
- * Renders the rating images if {@link setReadOnly ReadOnly} is true
- * otherwise render the radio buttons.
- */
- public function renderItem($writer,$repeatInfo,$itemType,$index)
- {
- if($this->getReadOnly())
- $this->renderStaticRating($writer, $repeatInfo, $itemType, $index);
- else
- parent::renderItem($writer, $repeatInfo, $itemType, $index);
- }
-
- /**
- * Renders the static rating images.
- */
- protected function renderStaticRating($writer, $repeatInfo, $itemType, $index)
- {
- $image = new TImage;
- $image->setImageUrl($this->_ratingImages[$this->getRatingImageType($index)]);
- $image->setAlternateText($this->getRating());
- $image->render($writer);
- }
-
- /**
- * @param integer rating image index
- * @return string the rating image corresponding to current index to be rendered.
- */
- protected function getRatingImageType($index)
+ public function setCaption($value)
{
- $rating = floatval($this->getRating());
- $int = intval($rating);
- $limit = $this->getHalfRatingInterval();
- if($index < $int || ($rating < $index+1 && $rating > $index+$limit[1]))
- return 'selected';
- if($rating >= $index+$limit[0] && $rating <= $index+$limit[1])
- return 'half';
- return 'blank';
+ parent::setCaption($value);
+ // if it's an active control, this should not be needed.
+ $this->callClientFunction('setCaption',$value);
}
/**
@@ -380,4 +131,3 @@ class TActiveRatingList extends TActiveRadioButtonList
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TActiveTextBox.php b/framework/Web/UI/ActiveControls/TActiveTextBox.php
index f7acfe6a..97efe008 100644
--- a/framework/Web/UI/ActiveControls/TActiveTextBox.php
+++ b/framework/Web/UI/ActiveControls/TActiveTextBox.php
@@ -123,4 +123,3 @@ class TActiveTextBox extends TTextBox implements ICallbackEventHandler, IActiveC
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TAutoComplete.php b/framework/Web/UI/ActiveControls/TAutoComplete.php
index c1379ac1..5a3633ec 100644
--- a/framework/Web/UI/ActiveControls/TAutoComplete.php
+++ b/framework/Web/UI/ActiveControls/TAutoComplete.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
@@ -328,7 +328,7 @@ class TAutoComplete extends TActiveTextBox implements INamingContainer
{
$string = strtr($string,array('\t'=>"\t",'\n'=>"\n",'\r'=>"\r"));
$token = preg_split('//', $string, -1, PREG_SPLIT_NO_EMPTY);
- $options['tokens'] = TJavascript::encode($token,false);
+ $options['tokens'] = TJavaScript::encode($token,false);
}
if($this->getAutoPostBack())
{
@@ -343,8 +343,8 @@ class TAutoComplete extends TActiveTextBox implements INamingContainer
if(($minchars=$this->getMinChars())!=='')
$options['minChars'] = $minchars;
if(($frequency=$this->getFrequency())!=='')
- $options['frequency'] = $frequency;
- $options['CausesValidation'] = $this->getCausesValidation();
+ $options['frequency'] = $frequency;
+ $options['CausesValidation'] = $this->getCausesValidation();
$options['ValidationGroup'] = $this->getValidationGroup();
return $options;
}
@@ -438,4 +438,3 @@ class TAutoCompleteTemplate extends TComponent implements ITemplate
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TBaseActiveControl.php b/framework/Web/UI/ActiveControls/TBaseActiveControl.php
index 4ede6ff6..8f55e27b 100644
--- a/framework/Web/UI/ActiveControls/TBaseActiveControl.php
+++ b/framework/Web/UI/ActiveControls/TBaseActiveControl.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gamil[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.ActiveControls
@@ -385,8 +385,7 @@ class TBaseActiveCallbackControl extends TBaseActiveControl
*/
public function getJsCallbackOptions()
{
- return TJavascript::encode($this->getClientSideOptions());
+ return TJavaScript::encode($this->getClientSideOptions());
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TCallback.php b/framework/Web/UI/ActiveControls/TCallback.php
index 2e0fed69..c1559c1f 100644
--- a/framework/Web/UI/ActiveControls/TCallback.php
+++ b/framework/Web/UI/ActiveControls/TCallback.php
@@ -99,4 +99,3 @@ class TCallback extends TControl implements ICallbackEventHandler, IActiveContro
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientScript.php b/framework/Web/UI/ActiveControls/TCallbackClientScript.php
index bc02182d..8f275ef8 100644
--- a/framework/Web/UI/ActiveControls/TCallbackClientScript.php
+++ b/framework/Web/UI/ActiveControls/TCallbackClientScript.php
@@ -670,4 +670,3 @@ class TCallbackClientScript extends TApplicationComponent
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TCallbackClientSide.php b/framework/Web/UI/ActiveControls/TCallbackClientSide.php
index a11204fb..57436278 100644
--- a/framework/Web/UI/ActiveControls/TCallbackClientSide.php
+++ b/framework/Web/UI/ActiveControls/TCallbackClientSide.php
@@ -322,4 +322,3 @@ class TCallbackClientSide extends TClientSideOptions
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TCallbackEventParameter.php b/framework/Web/UI/ActiveControls/TCallbackEventParameter.php
index 8e33407d..f08d40a9 100644
--- a/framework/Web/UI/ActiveControls/TCallbackEventParameter.php
+++ b/framework/Web/UI/ActiveControls/TCallbackEventParameter.php
@@ -85,4 +85,3 @@ class TCallbackEventParameter extends TEventParameter
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TCallbackOptions.php b/framework/Web/UI/ActiveControls/TCallbackOptions.php
index 745cef17..7c48b795 100644
--- a/framework/Web/UI/ActiveControls/TCallbackOptions.php
+++ b/framework/Web/UI/ActiveControls/TCallbackOptions.php
@@ -51,4 +51,3 @@ class TCallbackOptions extends TControl
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TDraggable.php b/framework/Web/UI/ActiveControls/TDraggable.php
new file mode 100755
index 00000000..e4e4c4c4
--- /dev/null
+++ b/framework/Web/UI/ActiveControls/TDraggable.php
@@ -0,0 +1,152 @@
+<?php
+/**
+ * TDraggable class file
+ *
+ * @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
+ * @copyright Copyright &copy; 2008, PradoSoft
+ * @license http://www.pradosoft.com/license
+ * @version $Id$
+ */
+
+/**
+ * TDraggable is a control which can be dragged
+ *
+ * This control will make "draggable" control.
+ *
+ * @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
+ * @copyright Copyright &copy; 2008, PradoSoft
+ * @license http://www.pradosoft.com/license
+ * @version $Id$
+ */
+class TDraggable extends TPanel
+{
+ /**
+ * Set the handle id or css class
+ * @param string
+ */
+ public function setHandle ($value)
+ {
+ $this->setViewState('DragHandle', TPropertyValue::ensureString($value), null);
+ }
+
+ /**
+ * Get the handle id or css class
+ * @return string
+ */
+ public function getHandle ()
+ {
+ return $this->getViewState('DragHandle', null);
+ }
+
+ /**
+ * Determine if draggable element should revert to it orginal position
+ * upon release in an non-droppable container.
+ * @return boolean true to revert
+ */
+ public function getRevert()
+ {
+ return $this->getViewState('Revert', true);
+ }
+
+ /**
+ * Sets whether the draggable element should revert to it orginal position
+ * upon release in an non-droppable container.
+ * @param boolean true to revert
+ */
+ public function setRevert($value)
+ {
+ $this->setViewState('Revert', TPropertyValue::ensureBoolean($value), true);
+ }
+
+ /**
+ * Determine if the element should be cloned when dragged
+ * If true, Clones the element and drags the clone, leaving the original in place until the clone is dropped.
+ * Defaults to false
+ * @return boolean true to clone the element
+ */
+ public function getGhosting ()
+ {
+ return $this->getViewState('Ghosting', false);
+ }
+
+ /**
+ * Sets wether the element should be cloned when dragged
+ * If true, Clones the element and drags the clone, leaving the original in place until the clone is dropped.
+ * Defaults to false
+ * @return boolean true to clone the element
+ */
+ public function setGhosting ($value)
+ {
+ $this->setViewState('Ghosting', TPropertyValue::ensureBoolean($value), false);
+ }
+
+ /**
+ * Determine if the element should be constrainted in one direction or not
+ * @return CDraggableConstraint
+ */
+ public function getConstraint()
+ {
+ return $this->getViewState('Constraint', TDraggableConstraint::None);
+ }
+
+ /**
+ * Set wether the element should be constrainted in one direction
+ * @param CDraggableConstraint
+ */
+ public function setConstraint($value)
+ {
+ $this->setViewState('Constraint', TPropertyValue::ensureEnum($value, 'TDraggableConstraint'), TDraggableConstraint::None);
+ }
+
+
+ /**
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
+ */
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+ $writer->addAttribute('id',$this->getClientID());
+ $cs=$this->getPage()->getClientScript();
+ $cs->registerPradoScript('dragdrop');
+ $options=TJavascript::encode($this->getPostBackOptions());
+ $class=$this->getClientClassName();
+ $code="new {$class}('{$this->getClientId()}', {$options}) ";
+ $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
+ }
+
+ /**
+ * Gets the name of the javascript class responsible for performing postback for this control.
+ * This method overrides the parent implementation.
+ * @return string the javascript class name
+ */
+ protected function getClientClassName ()
+ {
+ return 'Draggable';
+ }
+
+ /**
+ * Gets the post back options for this textbox.
+ * @return array
+ */
+ protected function getPostBackOptions()
+ {
+ $options['ID'] = $this->getClientID();
+
+ if (($handle=$this->getHandle())!== null) $options['handle']=$handle;
+ $options['revert']=$this->getRevert();
+ if (($constraint=$this->getConstraint())!==TDraggableConstraint::None) $options['constraint']=strtolower($constraint);
+ $options['ghosting']=$this->getGhosting();
+
+ return $options;
+ }
+
+}
+
+class TDraggableConstraint extends TEnumerable
+{
+ const None='None';
+ const Horizontal='Horizontal';
+ const Vertical='Vertical';
+}
+?> \ No newline at end of file
diff --git a/framework/Web/UI/ActiveControls/TDropContainer.php b/framework/Web/UI/ActiveControls/TDropContainer.php
new file mode 100755
index 00000000..5d090d95
--- /dev/null
+++ b/framework/Web/UI/ActiveControls/TDropContainer.php
@@ -0,0 +1,275 @@
+<?php
+/**
+ * TDropContainer class file
+ *
+ * @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
+ * @copyright Copyright &copy; 2008, PradoSoft
+ * @license http://www.pradosoft.com/license
+ * @version $Id$
+ */
+
+/**
+ * Load active control adapter.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActiveControlAdapter');
+/**
+ * Load active panel.
+ */
+Prado::using('System.Web.UI.ActiveControls.TActivePanel');
+
+
+/**
+ * TDropContainer is a panel where TDraggable controls can be dropped.
+ * When a TDraggable component is dropped into a TDropContainer, the {@link OnDrop OnDrop} event is raised.
+ * The {@link TDropContainerEventParameter} param will contain the dropped control.
+ *
+ * Properties :
+ *
+ * <b>{@link setAcceptCssClass AcceptCssClass}</b> : a coma delimited classname of elements that the drop container can accept.
+ * <b>{@link setHoverCssClass HoverCssClass}</b>: CSS classname of the container when a draggable element hovers over the container.
+ *
+ * Events:
+ *
+ * <b>{@link OnDrop OnDrop} : raised when a TDraggable control is dropped. The dropped control is encapsulated in the event parameter
+ *
+ * @author Christophe BOULAIN (Christophe.Boulain@gmail.com)
+ * @copyright Copyright &copy; 2008, PradoSoft
+ * @license http://www.pradosoft.com/license
+ * @version $Id$
+ */
+class TDropContainer extends TPanel implements IActiveControl, ICallbackEventHandler
+{
+ private $_container=null;
+
+ /**
+ * Creates a new callback control, sets the adapter to
+ * TActiveControlAdapter. If you override this class, be sure to set the
+ * adapter appropriately by, for example, by calling this constructor.
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ $this->setAdapter(new TActiveControlAdapter($this));
+ }
+
+ /**
+ * @return TBaseActiveControl standard active control options.
+ */
+ public function getActiveControl()
+ {
+ return $this->getAdapter()->getBaseActiveControl();
+ }
+
+
+ /**
+ * Gets the Css class name that this container can accept.
+ * @return string
+ */
+ public function getAcceptCssClass()
+ {
+ return $this->getViewState('Accepts', '');
+ }
+
+ /**
+ * Sets the Css class name that this container can accept.
+ * @param string comma delimited css class names.
+ */
+ public function setAcceptCssClass($value)
+ {
+ $this->setViewState('Accepts', TPropertyValue::ensureArray($value), '');
+ }
+
+ /**
+ * Sets the Css class name used when a draggble element is hovering
+ * over this container.
+ * @param string css class name during draggable hover.
+ */
+ public function setHoverCssClass($value)
+ {
+ $this->setViewState('HoverClass', $value, '');
+ }
+
+ /**
+ * Gets the Css class name used when a draggble element is hovering
+ * over this container.
+ * @return string css class name during draggable hover.
+ */
+ public function getHoverCssClass()
+ {
+ return $this->getViewState('HoverClass', '');
+ }
+
+
+ /**
+ * Raises callback event. This method is required bu {@link ICallbackEventHandler}
+ * interface.
+ * It raises the {@link onDrop OnDrop} event, then, the {@link onCallback OnCallback} event
+ * This method is mainly used by framework and control developers.
+ * @param TCallbackEventParameter the parameter associated with the callback event
+ */
+ public function raiseCallbackEvent($param)
+ {
+ $this->onDrop($param->getCallbackParameter());
+ $this->onCallback($param);
+ }
+
+ /**
+ * Raises the onDrop event.
+ * The dropped control is encapsulated into a {@link TDropContainerEventParameter}
+ *
+ * @param string $dropControlId
+ */
+ public function onDrop ($dropControlId)
+ {
+ // Find the control
+ // Warning, this will not work if you have a '_' in your control Id !
+ $control=$this->getPage();
+ $namingContainers=explode(TControl::CLIENT_ID_SEPARATOR, $dropControlId);
+ foreach ($namingContainers as $nc)
+ {
+ $control=$control->findControl($nc);
+ }
+ $this->raiseEvent('OnDrop', $this, new TDropContainerEventParameter ($control));
+
+ }
+
+ /**
+ * This method is invoked when a callback is requested. The method raises
+ * 'OnCallback' event to fire up the event handlers. If you override this
+ * method, be sure to call the parent implementation so that the event
+ * handler can be invoked.
+ * @param TCallbackEventParameter event parameter to be passed to the event handlers
+ */
+ public function onCallback($param)
+ {
+ $this->raiseEvent('OnCallback', $this, $param);
+ }
+
+ /**
+ * Gets the post back options for this textbox.
+ * @return array
+ */
+ protected function getPostBackOptions()
+ {
+ $options['ID'] = $this->getClientID();
+ $options['EventTarget'] = $this->getUniqueID();
+
+ $options['accept'] = TJavascript::encode($this->getAcceptCssClass());
+ $options['hoverclass'] = $this->getHoverCssClass();
+ return $options;
+ }
+
+ /**
+ * Gets the name of the javascript class responsible for performing postback for this control.
+ * This method overrides the parent implementation.
+ * @return string the javascript class name
+ */
+ protected function getClientClassName()
+ {
+ return 'Prado.WebUI.DropContainer';
+ }
+
+
+ /**
+ * Ensure that the ID attribute is rendered and registers the javascript code
+ * for initializing the active control.
+ */
+ protected function addAttributesToRender($writer)
+ {
+ parent::addAttributesToRender($writer);
+ $writer->addAttribute('id',$this->getClientID());
+
+ $this->getPage()->getClientScript()->registerPradoScript('dragdrop');
+
+ $this->getActiveControl()->registerCallbackClientScript(
+ $this->getClientClassName(), $this->getPostBackOptions());
+ }
+
+ /**
+ * Creates child control
+ * Override parent implementation to create a container which will contain all
+ * child controls. This container will be a TActivePanel, in order to allow user
+ * to update its content on callback.
+ */
+ public function createChildControls ()
+ {
+ if ($this->_container===null)
+ {
+ $this->_container=Prado::CreateComponent('System.Web.UI.ActiveControls.TActivePanel');
+ $this->_container->setId($this->getId().'_content');
+ parent::getControls()->add($this->_container);
+ }
+ }
+
+ /**
+ * Override parent implementation to return the container control collection.
+ *
+ * @return TControlCollection
+ */
+ public function getControls()
+ {
+ $this->ensureChildControls();
+ return $this->_container->getControls();
+ }
+
+ /**
+ * Renders and replaces the panel's content on the client-side.
+ * When render() is called before the OnPreRender event, such as when render()
+ * is called during a callback event handler, the rendering
+ * is defered until OnPreRender event is raised.
+ * @param THtmlWriter html writer
+ */
+ public function render ($writer)
+ {
+ if($this->getHasPreRendered())
+ {
+ parent::render($writer);
+ if($this->getActiveControl()->canUpdateClientSide())
+ $this->getPage()->getCallbackClient()->replaceContent($this->_container,$writer);
+ }
+ else
+ {
+ $this->getPage()->getAdapter()->registerControlToRender($this->_container,$writer);
+ }
+ }
+
+}
+
+/**
+ * TDropContainerEventParameter class
+ *
+ * TDropContainerEventParameter encapsulate the parameter
+ * data for <b>OnDrop</b> event of TDropContainer components
+ *
+ * @author Christophe BOULAIN (Christophe.Boulain@ceram.fr)
+ * @copyright Copyright &copy; 2008, PradoSoft
+ * @license http://www.pradosoft.com/license
+ * @version $Id$
+ */
+class TDropContainerEventParameter extends TEventParameter
+{
+ /*
+ * the id of control which has been dropped
+ * @var string
+ */
+ private $_droppedControl;
+
+ /**
+ * constructor
+ *
+ * @param string the id of control which been dropped
+ */
+ public function __construct ($control)
+ {
+ $this->_droppedControl=$control;
+ }
+
+ /**
+ * @return TDraggable
+ */
+ public function getDroppedControl ()
+ {
+ return $this->_droppedControl;
+ }
+}
+?> \ No newline at end of file
diff --git a/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php b/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php
index 735ff926..fe4be8a8 100644
--- a/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TEventTriggeredCallback.php
@@ -93,4 +93,3 @@ class TEventTriggeredCallback extends TTriggeredCallback
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
index 855e78a0..6e1c6b7a 100644
--- a/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
+++ b/framework/Web/UI/ActiveControls/TInPlaceTextBox.php
@@ -269,4 +269,3 @@ class TInPlaceTextBox extends TActiveTextBox
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php b/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
index a1410364..3dee5c59 100644
--- a/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TTimeTriggeredCallback.php
@@ -49,6 +49,10 @@ class TTimeTriggeredCallback extends TCallback
if($interval <= 0)
throw new TConfigurationException('callback_interval_be_positive', $this->getID());
$this->setViewState('Interval', $interval, 1);
+ if ($this->getActiveControl()->canUpdateClientSide()){
+ $client = $this->getPage()->getCallbackClient();
+ $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.setInterval', array($this, $interval));
+ }
}
/**
@@ -56,10 +60,8 @@ class TTimeTriggeredCallback extends TCallback
*/
public function startTimer()
{
- $id = $this->getClientID();
- $code = "Prado.WebUI.TTimeTriggeredCallback.start('{$id}');";
- $cs = $this->getPage()->getClientScript();
- $cs->registerEndScript("{$id}:start", $code);
+ $client = $this->getPage()->getCallbackClient();
+ $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.start', array($this));
}
/**
@@ -67,10 +69,8 @@ class TTimeTriggeredCallback extends TCallback
*/
public function stopTimer()
{
- $id = $this->getClientID();
- $code = "Prado.WebUI.TTimeTriggeredCallback.stop('{$id}');";
- $cs = $this->getPage()->getClientScript();
- $cs->registerEndScript("{$id}:stop", $code);
+ $client = $this->getPage()->getCallbackClient();
+ $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.stop', array($this));
}
/**
@@ -110,8 +110,12 @@ class TTimeTriggeredCallback extends TCallback
parent::render($writer);
$this->getActiveControl()->registerCallbackClientScript(
$this->getClientClassName(), $this->getTriggerOptions());
- if($this->getStartTimerOnLoad())
- $this->startTimer();
+ if($this->getStartTimerOnLoad()){
+ $id = $this->getClientID();
+ $code = "Prado.WebUI.TTimeTriggeredCallback.start('{$id}');";
+ $cs = $this->getPage()->getClientScript();
+ $cs->registerEndScript("{$id}:start", $code);
+ }
}
/**
diff --git a/framework/Web/UI/ActiveControls/TTriggeredCallback.php b/framework/Web/UI/ActiveControls/TTriggeredCallback.php
index 18679b4a..6923a53a 100644
--- a/framework/Web/UI/ActiveControls/TTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TTriggeredCallback.php
@@ -68,4 +68,3 @@ abstract class TTriggeredCallback extends TCallback
}
}
-?>
diff --git a/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php b/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php
index 5a44f380..305afd70 100644
--- a/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php
+++ b/framework/Web/UI/ActiveControls/TValueTriggeredCallback.php
@@ -116,4 +116,3 @@ class TValueTriggeredCallback extends TTriggeredCallback
return 'Prado.WebUI.TValueTriggeredCallback';
}
}
-?>
diff --git a/framework/Web/UI/TCachePageStatePersister.php b/framework/Web/UI/TCachePageStatePersister.php
index 0b201d92..742bd687 100644
--- a/framework/Web/UI/TCachePageStatePersister.php
+++ b/framework/Web/UI/TCachePageStatePersister.php
@@ -199,4 +199,3 @@ class TCachePageStatePersister extends TComponent implements IPageStatePersister
}
}
-?>
diff --git a/framework/Web/UI/TClientScriptManager.php b/framework/Web/UI/TClientScriptManager.php
index 83fdf789..f0eb6157 100644
--- a/framework/Web/UI/TClientScriptManager.php
+++ b/framework/Web/UI/TClientScriptManager.php
@@ -169,7 +169,10 @@ class TClientScriptManager extends TApplicationComponent
$scriptLoaderPath = $path.'/'.basename(self::SCRIPT_LOADER);
$scriptLoaderSrc = Prado::getFrameworkPath().DIRECTORY_SEPARATOR.self::SCRIPT_LOADER;
if(!is_file($scriptLoaderPath))
+ {
copy($scriptLoaderSrc, $scriptLoaderPath);
+ chmod($scriptLoaderPath, PRADO_CHMOD);
+ }
$url .= '/'.basename(self::SCRIPT_LOADER).'?js='.implode(',', $packages);
if($debug!==false && $this->getApplication()->getMode()===TApplicationMode::Debug)
{
@@ -230,7 +233,7 @@ class TClientScriptManager extends TApplicationComponent
$class = new TReflectionClass($callbackHandler);
$clientSide = $callbackHandler->getActiveControl()->getClientSide();
$options = array_merge($options, $clientSide->getOptions()->toArray());
- $optionString = TJavascript::encode($options);
+ $optionString = TJavaScript::encode($options);
$this->registerPradoScriptInternal('ajax');
$id = $callbackHandler->getUniqueID();
return "new Prado.CallbackRequest('{$id}',{$optionString})";
@@ -677,8 +680,8 @@ abstract class TClientSideOptions extends TComponent
*/
protected function setFunction($name, $code)
{
- if(!TJavascript::isFunction($code))
- $code = TJavascript::quoteFunction($this->ensureFunction($code));
+ if(!TJavaScript::isFunction($code))
+ $code = TJavaScript::quoteFunction($this->ensureFunction($code));
$this->setOption($name, $code);
}
@@ -717,4 +720,3 @@ abstract class TClientSideOptions extends TComponent
}
}
-?>
diff --git a/framework/Web/UI/TCompositeControl.php b/framework/Web/UI/TCompositeControl.php
index d30756e2..1cf31440 100644
--- a/framework/Web/UI/TCompositeControl.php
+++ b/framework/Web/UI/TCompositeControl.php
@@ -36,4 +36,3 @@ class TCompositeControl extends TControl implements INamingContainer
}
}
-?>
diff --git a/framework/Web/UI/TControl.php b/framework/Web/UI/TControl.php
index 576db89b..1c03a04d 100644
--- a/framework/Web/UI/TControl.php
+++ b/framework/Web/UI/TControl.php
@@ -1997,6 +1997,14 @@ interface IValidatable
* @return mixed the value of the property to be validated.
*/
public function getValidationPropertyValue();
+ /**
+ * @return boolean wether this control's validators validated successfully (must default to true)
+ */
+ public function getIsValid();
+ /**
+ * @return boolean wether this control's validators validated successfully
+ */
+ public function setIsValid($value);
}
/**
diff --git a/framework/Web/UI/TControlAdapter.php b/framework/Web/UI/TControlAdapter.php
index a6263f7f..16a8c839 100644
--- a/framework/Web/UI/TControlAdapter.php
+++ b/framework/Web/UI/TControlAdapter.php
@@ -141,4 +141,3 @@ class TControlAdapter extends TApplicationComponent
}
}
-?>
diff --git a/framework/Web/UI/TForm.php b/framework/Web/UI/TForm.php
index 436352c5..2356a733 100644
--- a/framework/Web/UI/TForm.php
+++ b/framework/Web/UI/TForm.php
@@ -165,4 +165,3 @@ class TForm extends TControl
}
}
-?>
diff --git a/framework/Web/UI/THtmlWriter.php b/framework/Web/UI/THtmlWriter.php
index dd68b828..217b9663 100644
--- a/framework/Web/UI/THtmlWriter.php
+++ b/framework/Web/UI/THtmlWriter.php
@@ -254,4 +254,3 @@ class THtmlWriter extends TApplicationComponent implements ITextWriter
}
}
-?>
diff --git a/framework/Web/UI/TPage.php b/framework/Web/UI/TPage.php
index 1a0f04a6..12433715 100644
--- a/framework/Web/UI/TPage.php
+++ b/framework/Web/UI/TPage.php
@@ -1234,10 +1234,10 @@ class TPageStateFormatter
$str=$sm->hashData(Prado::serialize($data));
else
$str=Prado::serialize($data);
- if($page->getEnableStateEncryption())
- $str=$sm->encrypt($str);
if(extension_loaded('zlib'))
$str=gzcompress($str);
+ if($page->getEnableStateEncryption())
+ $str=$sm->encrypt($str);
return base64_encode($str);
}
@@ -1251,13 +1251,13 @@ class TPageStateFormatter
$str=base64_decode($data);
if($str==='')
return null;
- if(extension_loaded('zlib'))
- $str=@gzuncompress($str);
if($str!==false)
{
$sm=$page->getApplication()->getSecurityManager();
if($page->getEnableStateEncryption())
$str=$sm->decrypt($str);
+ if(extension_loaded('zlib'))
+ $str=@gzuncompress($str);
if($page->getEnableStateValidation())
{
if(($str=$sm->validateData($str))!==false)
diff --git a/framework/Web/UI/TPageStatePersister.php b/framework/Web/UI/TPageStatePersister.php
index e8ea0713..4b217aee 100644
--- a/framework/Web/UI/TPageStatePersister.php
+++ b/framework/Web/UI/TPageStatePersister.php
@@ -69,4 +69,3 @@ class TPageStatePersister extends TComponent implements IPageStatePersister
}
}
-?>
diff --git a/framework/Web/UI/TSessionPageStatePersister.php b/framework/Web/UI/TSessionPageStatePersister.php
index 2c93118c..f422dfa8 100644
--- a/framework/Web/UI/TSessionPageStatePersister.php
+++ b/framework/Web/UI/TSessionPageStatePersister.php
@@ -129,4 +129,3 @@ class TSessionPageStatePersister extends TComponent implements IPageStatePersist
}
}
-?>
diff --git a/framework/Web/UI/TTemplateControl.php b/framework/Web/UI/TTemplateControl.php
index e8138e30..7da54e6c 100644
--- a/framework/Web/UI/TTemplateControl.php
+++ b/framework/Web/UI/TTemplateControl.php
@@ -241,4 +241,3 @@ class TTemplateControl extends TCompositeControl
}
}
-?>
diff --git a/framework/Web/UI/TTemplateManager.php b/framework/Web/UI/TTemplateManager.php
index be2beba6..f44d414c 100644
--- a/framework/Web/UI/TTemplateManager.php
+++ b/framework/Web/UI/TTemplateManager.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI
@@ -174,10 +174,10 @@ class TTemplate extends TApplicationComponent implements ITemplate
* '<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>' - component tags
* '<\/?prop:([\w\.]+)\s*>' - property tags
* '<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>' - directives
- * '<%[%#~\\$=\\[](.*?)%>' - expressions
+ * '<%[%#~\/\\$=\\[](.*?)%>' - expressions
* '<prop:([\w\.]+)((?:\s*[\w\.]+=\'.*?\'|\s*[\w\.]+=".*?"|\s*[\w\.]+=<%.*?%>)*)\s*\/>' - group subproperty tags
*/
- const REGEX_RULES='/<!--.*?--!>|<!---.*?--->|<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>|<%[%#~\\$=\\[](.*?)%>|<prop:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/>/msS';
+ const REGEX_RULES='/<!--.*?--!>|<!---.*?--->|<\/?com:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/?>|<\/?prop:([\w\.]+)\s*>|<%@\s*((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?")*)\s*%>|<%[%#~\/\\$=\\[](.*?)%>|<prop:([\w\.]+)((?:\s*[\w\.]+\s*=\s*\'.*?\'|\s*[\w\.]+\s*=\s*".*?"|\s*[\w\.]+\s*=\s*<%.*?%>)*)\s*\/>/msS';
/**
* Different configurations of component property/event/attribute
@@ -661,6 +661,8 @@ class TTemplate extends TApplicationComponent implements ITemplate
$tpl[$c++]=array($container,array(TCompositeLiteral::TYPE_EXPRESSION,"\$this->getApplication()->getParameters()->itemAt('$literal')"));
else if($str[2]==='~')
$tpl[$c++]=array($container,array(TCompositeLiteral::TYPE_EXPRESSION,"\$this->publishFilePath('$this->_contextPath/$literal')"));
+ else if($str[2]==='/')
+ $tpl[$c++]=array($container,array(TCompositeLiteral::TYPE_EXPRESSION,"dirname(\$this->getApplication()->getRequest()->getApplicationUrl()).'/$literal'"));
else if($str[2]==='[')
{
$literal=strtr(trim(substr($literal,0,strlen($literal)-1)),array("'"=>"\'","\\"=>"\\\\"));
@@ -1064,4 +1066,3 @@ class TTemplate extends TApplicationComponent implements ITemplate
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TBaseDataList.php b/framework/Web/UI/WebControls/TBaseDataList.php
index df91a0a6..d202eab8 100644
--- a/framework/Web/UI/WebControls/TBaseDataList.php
+++ b/framework/Web/UI/WebControls/TBaseDataList.php
@@ -188,4 +188,3 @@ abstract class TBaseDataList extends TDataBoundControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TBaseValidator.php b/framework/Web/UI/WebControls/TBaseValidator.php
index add771cc..b418885c 100644
--- a/framework/Web/UI/WebControls/TBaseValidator.php
+++ b/framework/Web/UI/WebControls/TBaseValidator.php
@@ -269,8 +269,11 @@ abstract class TBaseValidator extends TLabel implements IValidator
{
$class = preg_replace ('/ '.preg_quote($cssClass).'/', '',$control->getCssClass());
if(!$this->getIsValid())
+ {
$class .= ' '.$cssClass;
- $control->setCssClass($class);
+ $control->setCssClass($class);
+ } elseif ($control->getIsValid())
+ $control->setCssClass($class);
}
}
}
@@ -493,7 +496,7 @@ abstract class TBaseValidator extends TLabel implements IValidator
$this->setIsValid(true);
$this->onValidate();
if($this->getVisible(true) && $this->getEnabled(true))
- {
+ {
// if the target is not a disabled web control
if(($target=$this->getValidationTarget())!==null && !($target instanceof TWebControl && !$target->getEnabled(true)))
{
@@ -504,10 +507,17 @@ abstract class TBaseValidator extends TLabel implements IValidator
}
else
{
+ $target->setIsValid(false);
$this->setIsValid(false);
$this->onValidationError();
}
}
+ else
+ {
+ $this->evaluateIsValid();
+ $this->setIsValid(true);
+ $this->onValidationSuccess();
+ }
}
return $this->getIsValid();
}
@@ -721,4 +731,3 @@ class TValidationDataType extends TEnumerable
const String='String';
}
-?>
diff --git a/framework/Web/UI/WebControls/TBoundColumn.php b/framework/Web/UI/WebControls/TBoundColumn.php
index 13fb6af8..264bbc6c 100644
--- a/framework/Web/UI/WebControls/TBoundColumn.php
+++ b/framework/Web/UI/WebControls/TBoundColumn.php
@@ -233,4 +233,3 @@ class TBoundColumn extends TDataGridColumn
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TBulletedList.php b/framework/Web/UI/WebControls/TBulletedList.php
index f99c7986..60cf743e 100644
--- a/framework/Web/UI/WebControls/TBulletedList.php
+++ b/framework/Web/UI/WebControls/TBulletedList.php
@@ -485,4 +485,3 @@ class TBulletedListDisplayMode extends TEnumerable
const LinkButton='LinkButton';
}
-?>
diff --git a/framework/Web/UI/WebControls/TButton.php b/framework/Web/UI/WebControls/TButton.php
index dc66e9d6..81929a28 100644
--- a/framework/Web/UI/WebControls/TButton.php
+++ b/framework/Web/UI/WebControls/TButton.php
@@ -366,4 +366,3 @@ class TButtonType extends TEnumerable
const Button='Button';
}
-?>
diff --git a/framework/Web/UI/WebControls/TButtonColumn.php b/framework/Web/UI/WebControls/TButtonColumn.php
index 24199ddd..186577e5 100644
--- a/framework/Web/UI/WebControls/TButtonColumn.php
+++ b/framework/Web/UI/WebControls/TButtonColumn.php
@@ -276,4 +276,3 @@ class TButtonColumn extends TDataGridColumn
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TCaptcha.php b/framework/Web/UI/WebControls/TCaptcha.php
index 153b1d30..3c51c389 100644
--- a/framework/Web/UI/WebControls/TCaptcha.php
+++ b/framework/Web/UI/WebControls/TCaptcha.php
@@ -489,4 +489,3 @@ class TCaptcha extends TImage
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TCaptchaValidator.php b/framework/Web/UI/WebControls/TCaptchaValidator.php
index 770cd514..5477fe54 100644
--- a/framework/Web/UI/WebControls/TCaptchaValidator.php
+++ b/framework/Web/UI/WebControls/TCaptchaValidator.php
@@ -121,4 +121,3 @@ class TCaptchaValidator extends TBaseValidator
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TCheckBox.php b/framework/Web/UI/WebControls/TCheckBox.php
index faff5086..d8c2cc0b 100644
--- a/framework/Web/UI/WebControls/TCheckBox.php
+++ b/framework/Web/UI/WebControls/TCheckBox.php
@@ -43,6 +43,7 @@
class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatable, IDataRenderer, ISurroundable
{
private $_dataChanged=false;
+ private $_isValid=true;
/**
* @return string tag name of the button
@@ -125,6 +126,23 @@ class TCheckBox extends TWebControl implements IPostBackDataHandler, IValidatabl
return $this->getChecked();
}
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+
/**
* @return string the text caption of the checkbox
*/
diff --git a/framework/Web/UI/WebControls/TCheckBoxColumn.php b/framework/Web/UI/WebControls/TCheckBoxColumn.php
index 36217343..71eea97f 100644
--- a/framework/Web/UI/WebControls/TCheckBoxColumn.php
+++ b/framework/Web/UI/WebControls/TCheckBoxColumn.php
@@ -121,4 +121,3 @@ class TCheckBoxColumn extends TDataGridColumn
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TCheckBoxList.php b/framework/Web/UI/WebControls/TCheckBoxList.php
index 1e1c3b10..742dd18b 100644
--- a/framework/Web/UI/WebControls/TCheckBoxList.php
+++ b/framework/Web/UI/WebControls/TCheckBoxList.php
@@ -53,6 +53,7 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
private $_isEnabled;
private $_changedEventRaised=false;
private $_dataChanged=false;
+ private $_isValid=true;
/**
* Constructor.
@@ -428,6 +429,23 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
return $this->getSelectedValue();
}
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+
/**
* Gets the name of the javascript class responsible for performing postback for this control.
* This method overrides the parent implementation.
@@ -454,4 +472,3 @@ class TCheckBoxList extends TListControl implements IRepeatInfoUser, INamingCont
}
-?>
diff --git a/framework/Web/UI/WebControls/TClientScript.php b/framework/Web/UI/WebControls/TClientScript.php
index 5369d27d..b5806a57 100644
--- a/framework/Web/UI/WebControls/TClientScript.php
+++ b/framework/Web/UI/WebControls/TClientScript.php
@@ -129,4 +129,3 @@ class TClientScript extends TControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TClientScriptLoader.php b/framework/Web/UI/WebControls/TClientScriptLoader.php
index c916bcc5..ec763bb3 100644
--- a/framework/Web/UI/WebControls/TClientScriptLoader.php
+++ b/framework/Web/UI/WebControls/TClientScriptLoader.php
@@ -168,4 +168,3 @@ class TClientScriptLoader extends TWebControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TColorPicker.php b/framework/Web/UI/WebControls/TColorPicker.php
index 5b96723a..67a4ccfe 100644
--- a/framework/Web/UI/WebControls/TColorPicker.php
+++ b/framework/Web/UI/WebControls/TColorPicker.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -203,6 +203,7 @@ class TColorPicker extends TTextBox
$writer->addAttribute('style', "background-color:{$color};");
$writer->addAttribute('width', '20');
$writer->addAttribute('height', '20');
+ $writer->addAttribute('alt', '');
$writer->renderBeginTag('img');
$writer->renderEndTag();
$writer->renderEndTag();
@@ -270,4 +271,3 @@ class TColorPickerClientSide extends TClientSideOptions
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TCompareValidator.php b/framework/Web/UI/WebControls/TCompareValidator.php
index e5723f2a..1261cded 100644
--- a/framework/Web/UI/WebControls/TCompareValidator.php
+++ b/framework/Web/UI/WebControls/TCompareValidator.php
@@ -263,4 +263,3 @@ class TValidationCompareOperator extends TEnumerable
const LessThanEqual='LessThanEqual';
}
-?>
diff --git a/framework/Web/UI/WebControls/TConditional.php b/framework/Web/UI/WebControls/TConditional.php
index 7af6622e..fafe12c9 100644
--- a/framework/Web/UI/WebControls/TConditional.php
+++ b/framework/Web/UI/WebControls/TConditional.php
@@ -141,4 +141,3 @@ class TConditional extends TControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TContent.php b/framework/Web/UI/WebControls/TContent.php
index ecc2a1b5..b327b440 100644
--- a/framework/Web/UI/WebControls/TContent.php
+++ b/framework/Web/UI/WebControls/TContent.php
@@ -45,4 +45,3 @@ class TContent extends TControl implements INamingContainer
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TContentPlaceHolder.php b/framework/Web/UI/WebControls/TContentPlaceHolder.php
index 29e12ab3..90390d9d 100644
--- a/framework/Web/UI/WebControls/TContentPlaceHolder.php
+++ b/framework/Web/UI/WebControls/TContentPlaceHolder.php
@@ -46,4 +46,3 @@ class TContentPlaceHolder extends TControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TCustomValidator.php b/framework/Web/UI/WebControls/TCustomValidator.php
index e998cef6..0b82ac5c 100644
--- a/framework/Web/UI/WebControls/TCustomValidator.php
+++ b/framework/Web/UI/WebControls/TCustomValidator.php
@@ -4,7 +4,7 @@
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -88,7 +88,9 @@ class TCustomValidator extends TBaseValidator
*/
public function evaluateIsValid()
{
- $value=$this->getValidationValue($this->getValidationTarget());
+ $value = '';
+ if($this->getValidationTarget()!==null)
+ $value=$this->getValidationValue($this->getValidationTarget());
return $this->onServerValidate($value);
}
@@ -105,9 +107,24 @@ class TCustomValidator extends TBaseValidator
{
$param=new TServerValidateEventParameter($value,true);
$this->raiseEvent('OnServerValidate',$this,$param);
- return $param->getIsValid();
+ if($this->getValidationTarget()==null)
+ return true;
+ else
+ return $param->getIsValid();
+ }
+
+ /**
+ * @return TControl control to be validated. Null if no control is found.
+ */
+ protected function getValidationTarget()
+ {
+ if(($id=$this->getControlToValidate())!=='' && ($control=$this->findControl($id))!==null)
+ return $control;
+ else if(($id=$this->getControlToValidate())!=='')
+ throw new TInvalidDataTypeException('basevalidator_validatable_required',get_class($this));
+ else
+ return null;
}
-
/**
* Returns an array of javascript validator options.
@@ -191,4 +208,3 @@ class TServerValidateEventParameter extends TEventParameter
$this->_isValid=TPropertyValue::ensureBoolean($value);
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataGrid.php b/framework/Web/UI/WebControls/TDataGrid.php
index c8e6c9a8..9551b376 100644
--- a/framework/Web/UI/WebControls/TDataGrid.php
+++ b/framework/Web/UI/WebControls/TDataGrid.php
@@ -2203,4 +2203,3 @@ class TDataGridPagerPosition extends TEnumerable
const TopAndBottom='TopAndBottom';
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataGridColumn.php b/framework/Web/UI/WebControls/TDataGridColumn.php
index e3c2f297..577c0068 100644
--- a/framework/Web/UI/WebControls/TDataGridColumn.php
+++ b/framework/Web/UI/WebControls/TDataGridColumn.php
@@ -565,4 +565,3 @@ class TButtonColumnType extends TEnumerable
const ImageButton='ImageButton';
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataGridItemRenderer.php b/framework/Web/UI/WebControls/TDataGridItemRenderer.php
index 8e0f9e70..62c226f6 100644
--- a/framework/Web/UI/WebControls/TDataGridItemRenderer.php
+++ b/framework/Web/UI/WebControls/TDataGridItemRenderer.php
@@ -28,4 +28,3 @@ class TDataGridItemRenderer extends TItemDataRenderer
{
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataGridPagerStyle.php b/framework/Web/UI/WebControls/TDataGridPagerStyle.php
index dcc9d983..e29b9dc9 100644
--- a/framework/Web/UI/WebControls/TDataGridPagerStyle.php
+++ b/framework/Web/UI/WebControls/TDataGridPagerStyle.php
@@ -219,4 +219,3 @@ class TDataGridPagerStyle extends TPanelStyle
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataList.php b/framework/Web/UI/WebControls/TDataList.php
index 7d0965a2..ca628b21 100644
--- a/framework/Web/UI/WebControls/TDataList.php
+++ b/framework/Web/UI/WebControls/TDataList.php
@@ -1764,4 +1764,3 @@ class TDataListItemCollection extends TList
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataListItemRenderer.php b/framework/Web/UI/WebControls/TDataListItemRenderer.php
index 5481cad7..1bf2fcb2 100644
--- a/framework/Web/UI/WebControls/TDataListItemRenderer.php
+++ b/framework/Web/UI/WebControls/TDataListItemRenderer.php
@@ -170,4 +170,3 @@ class TDataListItemRenderer extends TItemDataRenderer implements IStyleable
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataRenderer.php b/framework/Web/UI/WebControls/TDataRenderer.php
index e884afe1..4aaeec0a 100644
--- a/framework/Web/UI/WebControls/TDataRenderer.php
+++ b/framework/Web/UI/WebControls/TDataRenderer.php
@@ -50,4 +50,3 @@ abstract class TDataRenderer extends TTemplateControl implements IDataRenderer
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataSourceControl.php b/framework/Web/UI/WebControls/TDataSourceControl.php
index e42d7381..1d0823ff 100644
--- a/framework/Web/UI/WebControls/TDataSourceControl.php
+++ b/framework/Web/UI/WebControls/TDataSourceControl.php
@@ -116,4 +116,3 @@ class TReadOnlyDataSource extends TDataSourceControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataSourceView.php b/framework/Web/UI/WebControls/TDataSourceView.php
index 7c0ee2d0..7297fd45 100644
--- a/framework/Web/UI/WebControls/TDataSourceView.php
+++ b/framework/Web/UI/WebControls/TDataSourceView.php
@@ -204,4 +204,3 @@ class TReadOnlyDataSourceView extends TDataSourceView
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TDataTypeValidator.php b/framework/Web/UI/WebControls/TDataTypeValidator.php
index d4fa20c3..14017585 100644
--- a/framework/Web/UI/WebControls/TDataTypeValidator.php
+++ b/framework/Web/UI/WebControls/TDataTypeValidator.php
@@ -139,4 +139,3 @@ class TDataTypeValidator extends TBaseValidator
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TDatePicker.php b/framework/Web/UI/WebControls/TDatePicker.php
index 84455fee..770099eb 100644
--- a/framework/Web/UI/WebControls/TDatePicker.php
+++ b/framework/Web/UI/WebControls/TDatePicker.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -59,7 +59,12 @@ Prado::using('System.Web.UI.WebControls.TTextBox');
* In <tt>DropDownList</tt> mode, in addition to the popup date picker, three
* drop down list (day, month and year) are presented to select the date .
*
+ * The <b>PositionMode</b> property can be set to "Top" or "Bottom" with default
+ * as "Bottom". It specifies the position of the calendar popup, relative to the
+ * input field.
+ *
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @author Carl G. Mathisen <carlgmathisen@gmail.com>
* @version $Id$
* @package System.Web.UI.WebControls
* @since 3.0
@@ -263,6 +268,22 @@ class TDatePicker extends TTextBox
{
return $this->getViewState('UpToYear', intval(@date('Y'))+10);
}
+
+ /**
+ * @param TDatePickerPositionMode calendar UI position
+ */
+ public function setPositionMode($value)
+ {
+ $this->setViewState('PositionMode', TPropertyValue::ensureEnum($value, 'TDatePickerPositionMode'), TDatePickerPositionMode::Bottom);
+ }
+
+ /**
+ * @return TDatePickerPositionMode current calendar UI position.
+ */
+ public function getPositionMode()
+ {
+ return $this->getViewState('PositionMode', TDatePickerPositionMode::Bottom);
+ }
/**
* @return integer current selected date from the date picker as timestamp, NULL if timestamp is not set previously.
@@ -505,6 +526,7 @@ class TDatePicker extends TTextBox
$options['UpToYear'] = $this->getUpToYear();
if($this->getMode()!==TDatePickerMode::Basic)
$options['Trigger'] = $this->getDatePickerButtonID();
+ $options['PositionMode'] = $this->getPositionMode();
$options = array_merge($options, $this->getCulturalOptions());
if(!is_null($this->_clientScript))
@@ -853,8 +875,8 @@ class TDatePicker extends TTextBox
*
* The <tt>OnDateChanged</tt> event is raise when the date picker's date
* is changed.
- * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
- * as parameter to this event
+ * The formatted date according to {@link TDatePicker::getDateFormat DateFormat} is sent
+ * as parameter to this event
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @version $Id$
@@ -923,4 +945,20 @@ class TDatePickerMode extends TEnumerable
const ImageButton='ImageButton';
}
-?>
+/**
+ * TDatePickerPositionMode class.
+ * TDatePickerPositionMode defines the positions available for the calendar popup, relative to the corresponding input.
+ *
+ * The following enumerable values are defined:
+ * - Top: the date picker is placed above the input field
+ * - Bottom: the date picker is placed below the input field
+ *
+ * @author Carl G. Mathisen <carlgmathisen@gmail.com>
+ * @package System.Web.UI.WebControls
+ * @since 3.1.4
+ */
+class TDatePickerPositionMode extends TEnumerable
+{
+ const Top='Top';
+ const Bottom='Bottom';
+} \ No newline at end of file
diff --git a/framework/Web/UI/WebControls/TDropDownList.php b/framework/Web/UI/WebControls/TDropDownList.php
index f00466d5..73be981c 100644
--- a/framework/Web/UI/WebControls/TDropDownList.php
+++ b/framework/Web/UI/WebControls/TDropDownList.php
@@ -40,6 +40,7 @@ Prado::using('System.Web.UI.WebControls.TListControl');
class TDropDownList extends TListControl implements IPostBackDataHandler, IValidatable
{
private $_dataChanged=false;
+ private $_isValid=true;
/**
* Adds attributes to renderer.
@@ -127,5 +128,21 @@ class TDropDownList extends TListControl implements IPostBackDataHandler, IValid
{
return $this->getSelectedValue();
}
+
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
}
-?>
diff --git a/framework/Web/UI/WebControls/TDropDownListColumn.php b/framework/Web/UI/WebControls/TDropDownListColumn.php
index cff42cad..a225abac 100644
--- a/framework/Web/UI/WebControls/TDropDownListColumn.php
+++ b/framework/Web/UI/WebControls/TDropDownListColumn.php
@@ -319,4 +319,3 @@ class TDropDownListColumn extends TDataGridColumn
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TEditCommandColumn.php b/framework/Web/UI/WebControls/TEditCommandColumn.php
index f9989a4e..1699afa2 100644
--- a/framework/Web/UI/WebControls/TEditCommandColumn.php
+++ b/framework/Web/UI/WebControls/TEditCommandColumn.php
@@ -263,4 +263,3 @@ class TEditCommandColumn extends TDataGridColumn
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TEmailAddressValidator.php b/framework/Web/UI/WebControls/TEmailAddressValidator.php
index c5407516..206bd23d 100644
--- a/framework/Web/UI/WebControls/TEmailAddressValidator.php
+++ b/framework/Web/UI/WebControls/TEmailAddressValidator.php
@@ -95,4 +95,3 @@ class TEmailAddressValidator extends TRegularExpressionValidator
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TExpression.php b/framework/Web/UI/WebControls/TExpression.php
index 022a0b21..34190473 100644
--- a/framework/Web/UI/WebControls/TExpression.php
+++ b/framework/Web/UI/WebControls/TExpression.php
@@ -60,4 +60,3 @@ class TExpression extends TControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TFileUpload.php b/framework/Web/UI/WebControls/TFileUpload.php
index 47d49c0c..6658e93d 100644
--- a/framework/Web/UI/WebControls/TFileUpload.php
+++ b/framework/Web/UI/WebControls/TFileUpload.php
@@ -59,6 +59,7 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata
*/
private $_errorCode=UPLOAD_ERR_NO_FILE;
private $_dataChanged=false;
+ private $_isValid=true;
/**
* @return string tag name of the file upload control
@@ -255,6 +256,23 @@ class TFileUpload extends TWebControl implements IPostBackDataHandler, IValidata
{
return $this->getFileName();
}
+
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+
}
-?>
diff --git a/framework/Web/UI/WebControls/TFont.php b/framework/Web/UI/WebControls/TFont.php
index cb0fba93..9ba644f8 100644
--- a/framework/Web/UI/WebControls/TFont.php
+++ b/framework/Web/UI/WebControls/TFont.php
@@ -316,4 +316,3 @@ class TFont extends TComponent
$writer->addStyleAttribute('font-family',$this->_name);
}
}
-?>
diff --git a/framework/Web/UI/WebControls/THead.php b/framework/Web/UI/WebControls/THead.php
index 1b51f8ae..62ee46d3 100644
--- a/framework/Web/UI/WebControls/THead.php
+++ b/framework/Web/UI/WebControls/THead.php
@@ -4,7 +4,7 @@
*
* @author Marcus Nyeholt <tanus@users.sourceforge.net> and Qiang Xue <qiang.xue@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI
@@ -29,6 +29,13 @@
* <com:TMetaTag Name="keywords" Content="Prado" />
* </com:THead>
* </code>
+ *
+ * A MetaTag for "generator" is added by default if you haven't specified your own generator meta tag. You can override
+ * the property by adding the following code to your template:
+ * <com:THead>
+ * <com:TMetaTag Name="generator" Content="Custom name" />
+ * </com:THead>
+ * </code>
*
* Note, {@link TPage} has a property {@link TPage::getHead Head} that refers to
* the THead control currently on the page. A page can have at most once THead
@@ -155,14 +162,24 @@ class THead extends TControl
if(($icon=$this->getShortcutIcon())!=='')
$writer->write('<link rel="shortcut icon" href="'.$icon."\" />\n");
+ $generatorAdded = false;
if(($metaTags=$this->getMetaTags())!==null)
{
foreach($metaTags as $metaTag)
{
+ if(strtolower($metaTag->getName()) == 'generator')
+ $generatorAdded = true;
$metaTag->render($writer);
$writer->writeLine();
}
}
+ if(!$generatorAdded)
+ {
+ $metaTag = new TMetaTag();
+ $metaTag->setName('generator');
+ $metaTag->setContent(Prado::metaGenerator());
+ $metaTag->render($writer);
+ }
$cs=$page->getClientScript();
$cs->renderStyleSheetFiles($writer);
$cs->renderStyleSheets($writer);
@@ -374,4 +391,4 @@ class TMetaTagCollection extends TList
}
}
-?>
+?>
diff --git a/framework/Web/UI/WebControls/THiddenField.php b/framework/Web/UI/WebControls/THiddenField.php
index 2fbbcf99..49b1aa39 100644
--- a/framework/Web/UI/WebControls/THiddenField.php
+++ b/framework/Web/UI/WebControls/THiddenField.php
@@ -26,6 +26,7 @@
class THiddenField extends TControl implements IPostBackDataHandler, IValidatable, IDataRenderer
{
private $_dataChanged=false;
+ private $_isValid=true;
/**
* @return string tag name of the hidden field.
@@ -111,6 +112,23 @@ class THiddenField extends TControl implements IPostBackDataHandler, IValidatabl
return $this->getValue();
}
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+
/**
* Raises postdata changed event.
* This method calls {@link onValueChanged} method.
@@ -204,4 +222,3 @@ class THiddenField extends TControl implements IPostBackDataHandler, IValidatabl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/THtmlArea.php b/framework/Web/UI/WebControls/THtmlArea.php
index b9245be3..7fea5862 100644
--- a/framework/Web/UI/WebControls/THtmlArea.php
+++ b/framework/Web/UI/WebControls/THtmlArea.php
@@ -473,4 +473,3 @@ class THtmlArea extends TTextBox
}
}
-?>
diff --git a/framework/Web/UI/WebControls/THyperLink.php b/framework/Web/UI/WebControls/THyperLink.php
index 3bd92ffd..217fa267 100644
--- a/framework/Web/UI/WebControls/THyperLink.php
+++ b/framework/Web/UI/WebControls/THyperLink.php
@@ -187,4 +187,3 @@ class THyperLink extends TWebControl implements IDataRenderer
}
}
-?>
diff --git a/framework/Web/UI/WebControls/THyperLinkColumn.php b/framework/Web/UI/WebControls/THyperLinkColumn.php
index 8ac1177f..7db6eda8 100644
--- a/framework/Web/UI/WebControls/THyperLinkColumn.php
+++ b/framework/Web/UI/WebControls/THyperLinkColumn.php
@@ -215,4 +215,3 @@ class THyperLinkColumn extends TDataGridColumn
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TImage.php b/framework/Web/UI/WebControls/TImage.php
index e1ff8535..220fa4a6 100644
--- a/framework/Web/UI/WebControls/TImage.php
+++ b/framework/Web/UI/WebControls/TImage.php
@@ -155,4 +155,3 @@ class TImage extends TWebControl implements IDataRenderer
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TImageMap.php b/framework/Web/UI/WebControls/TImageMap.php
index 89daca44..d0cd8a0a 100644
--- a/framework/Web/UI/WebControls/TImageMap.php
+++ b/framework/Web/UI/WebControls/TImageMap.php
@@ -835,4 +835,3 @@ class THotSpotMode extends TEnumerable
const Inactive='Inactive';
}
-?>
diff --git a/framework/Web/UI/WebControls/TInlineFrame.php b/framework/Web/UI/WebControls/TInlineFrame.php
index dae728d3..c47af648 100644
--- a/framework/Web/UI/WebControls/TInlineFrame.php
+++ b/framework/Web/UI/WebControls/TInlineFrame.php
@@ -274,4 +274,3 @@ class TInlineFrameScrollBars extends TEnumerable
const Auto='Auto';
const Both='Both';
}
-?>
diff --git a/framework/Web/UI/WebControls/TItemDataRenderer.php b/framework/Web/UI/WebControls/TItemDataRenderer.php
index a57ff27d..79e0186e 100644
--- a/framework/Web/UI/WebControls/TItemDataRenderer.php
+++ b/framework/Web/UI/WebControls/TItemDataRenderer.php
@@ -81,4 +81,3 @@ abstract class TItemDataRenderer extends TDataRenderer implements IItemDataRende
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TJavascriptLogger.php b/framework/Web/UI/WebControls/TJavascriptLogger.php
index 11e64735..6d49f801 100644
--- a/framework/Web/UI/WebControls/TJavascriptLogger.php
+++ b/framework/Web/UI/WebControls/TJavascriptLogger.php
@@ -91,4 +91,3 @@ class TJavascriptLogger extends TWebControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TKeyboard.php b/framework/Web/UI/WebControls/TKeyboard.php
index 7c9357d7..9c26fab8 100644
--- a/framework/Web/UI/WebControls/TKeyboard.php
+++ b/framework/Web/UI/WebControls/TKeyboard.php
@@ -186,4 +186,3 @@ class TKeyboard extends TWebControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TLabel.php b/framework/Web/UI/WebControls/TLabel.php
index 3e61eddf..d1595ead 100644
--- a/framework/Web/UI/WebControls/TLabel.php
+++ b/framework/Web/UI/WebControls/TLabel.php
@@ -152,4 +152,3 @@ class TLabel extends TWebControl implements IDataRenderer
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TLinkButton.php b/framework/Web/UI/WebControls/TLinkButton.php
index d847f07e..459b98cf 100644
--- a/framework/Web/UI/WebControls/TLinkButton.php
+++ b/framework/Web/UI/WebControls/TLinkButton.php
@@ -332,4 +332,3 @@ class TLinkButton extends TWebControl implements IPostBackEventHandler, IButtonC
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TListBox.php b/framework/Web/UI/WebControls/TListBox.php
index 903dbed8..1b4599fc 100644
--- a/framework/Web/UI/WebControls/TListBox.php
+++ b/framework/Web/UI/WebControls/TListBox.php
@@ -39,6 +39,7 @@ Prado::using('System.Web.UI.WebControls.TListControl');
class TListBox extends TListControl implements IPostBackDataHandler, IValidatable
{
private $_dataChanged=false;
+ private $_isValid=true;
/**
* Adds attribute name-value pairs to renderer.
@@ -220,6 +221,23 @@ class TListBox extends TListControl implements IPostBackDataHandler, IValidatabl
{
return $this->getSelectedValue();
}
+
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
}
@@ -242,4 +260,3 @@ class TListSelectionMode extends TEnumerable
const Multiple='Multiple';
}
-?>
diff --git a/framework/Web/UI/WebControls/TListControlValidator.php b/framework/Web/UI/WebControls/TListControlValidator.php
index f468a30e..f547884f 100644
--- a/framework/Web/UI/WebControls/TListControlValidator.php
+++ b/framework/Web/UI/WebControls/TListControlValidator.php
@@ -223,4 +223,3 @@ class TListControlValidator extends TBaseValidator
return $options;
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TListItem.php b/framework/Web/UI/WebControls/TListItem.php
index 2017b64e..eb72d183 100644
--- a/framework/Web/UI/WebControls/TListItem.php
+++ b/framework/Web/UI/WebControls/TListItem.php
@@ -182,4 +182,3 @@ class TListItem extends TComponent
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TLiteral.php b/framework/Web/UI/WebControls/TLiteral.php
index 0c93043a..3a7f4581 100644
--- a/framework/Web/UI/WebControls/TLiteral.php
+++ b/framework/Web/UI/WebControls/TLiteral.php
@@ -110,4 +110,3 @@ class TLiteral extends TControl implements IDataRenderer
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TLiteralColumn.php b/framework/Web/UI/WebControls/TLiteralColumn.php
index cb97adb5..8ca87023 100644
--- a/framework/Web/UI/WebControls/TLiteralColumn.php
+++ b/framework/Web/UI/WebControls/TLiteralColumn.php
@@ -152,4 +152,3 @@ class TLiteralColumn extends TDataGridColumn
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TMarkdown.php b/framework/Web/UI/WebControls/TMarkdown.php
index dc6bc5e2..d630cd29 100644
--- a/framework/Web/UI/WebControls/TMarkdown.php
+++ b/framework/Web/UI/WebControls/TMarkdown.php
@@ -73,4 +73,3 @@ class TMarkdown extends TTextHighlighter
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TMultiView.php b/framework/Web/UI/WebControls/TMultiView.php
index 6adaed5b..1f87b03f 100644
--- a/framework/Web/UI/WebControls/TMultiView.php
+++ b/framework/Web/UI/WebControls/TMultiView.php
@@ -376,4 +376,3 @@ class TView extends TControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TOutputCache.php b/framework/Web/UI/WebControls/TOutputCache.php
index dd38ae03..c0747a11 100644
--- a/framework/Web/UI/WebControls/TOutputCache.php
+++ b/framework/Web/UI/WebControls/TOutputCache.php
@@ -582,4 +582,3 @@ class TOutputCacheCalculateKeyEventParameter extends TEventParameter
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TPager.php b/framework/Web/UI/WebControls/TPager.php
index d1a5db25..51ea2a11 100644
--- a/framework/Web/UI/WebControls/TPager.php
+++ b/framework/Web/UI/WebControls/TPager.php
@@ -790,4 +790,3 @@ class TPagerButtonType extends TEnumerable
const ImageButton='ImageButton';
}
-?>
diff --git a/framework/Web/UI/WebControls/TPanel.php b/framework/Web/UI/WebControls/TPanel.php
index 661795d7..5bbcdcca 100644
--- a/framework/Web/UI/WebControls/TPanel.php
+++ b/framework/Web/UI/WebControls/TPanel.php
@@ -234,4 +234,3 @@ class TPanel extends TWebControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TPanelStyle.php b/framework/Web/UI/WebControls/TPanelStyle.php
index 08667860..2d6ee824 100644
--- a/framework/Web/UI/WebControls/TPanelStyle.php
+++ b/framework/Web/UI/WebControls/TPanelStyle.php
@@ -276,4 +276,3 @@ class TScrollBars extends TEnumerable
const Vertical='Vertical';
}
-?>
diff --git a/framework/Web/UI/WebControls/TPlaceHolder.php b/framework/Web/UI/WebControls/TPlaceHolder.php
index ae878e2b..cdfd3873 100644
--- a/framework/Web/UI/WebControls/TPlaceHolder.php
+++ b/framework/Web/UI/WebControls/TPlaceHolder.php
@@ -26,4 +26,3 @@ class TPlaceHolder extends TControl
{
}
-?>
diff --git a/framework/Web/UI/WebControls/TRadioButton.php b/framework/Web/UI/WebControls/TRadioButton.php
index 20973732..fdaf53a8 100644
--- a/framework/Web/UI/WebControls/TRadioButton.php
+++ b/framework/Web/UI/WebControls/TRadioButton.php
@@ -318,4 +318,3 @@ class TRadioButton extends TCheckBox
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TRadioButtonList.php b/framework/Web/UI/WebControls/TRadioButtonList.php
index b225834a..a8c53dee 100644
--- a/framework/Web/UI/WebControls/TRadioButtonList.php
+++ b/framework/Web/UI/WebControls/TRadioButtonList.php
@@ -99,4 +99,3 @@ class TRadioButtonList extends TCheckBoxList
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TRangeValidator.php b/framework/Web/UI/WebControls/TRangeValidator.php
index 0f92fb45..d741118f 100644
--- a/framework/Web/UI/WebControls/TRangeValidator.php
+++ b/framework/Web/UI/WebControls/TRangeValidator.php
@@ -358,4 +358,3 @@ class TRangeValidationDataType extends TValidationDataType
{
const StringLength='StringLength';
}
-?>
diff --git a/framework/Web/UI/WebControls/TRatingList.php b/framework/Web/UI/WebControls/TRatingList.php
index 22cc0844..aba44fb0 100644
--- a/framework/Web/UI/WebControls/TRatingList.php
+++ b/framework/Web/UI/WebControls/TRatingList.php
@@ -4,7 +4,7 @@
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -21,191 +21,320 @@ Prado::using('System.Web.UI.WebControls.TRadioButtonList');
* This class is EXPERIMENTAL.
*
* @author Wei Zhuo <weizhuo[at]gmail[dot]com>
+ * @author Bradley Booms <bradley[dot]booms[at]gmail[dot]com>
* @version $Id$
* @package System.Web.UI.WebControls
* @since 3.0
*/
class TRatingList extends TRadioButtonList
{
+ /**
+ * Script path relative to the TClientScriptManager::SCRIPT_PATH
+ */
const SCRIPT_PATH='prado/ratings';
+ /**
+ * @var array list of published rating images.
+ */
private $_ratingImages = array();
+ /**
+ * Sets the default repeat direction to horizontal.
+ */
public function __construct()
{
parent::__construct();
- $this->getRepeatInfo()->setRepeatDirection('Horizontal');
+ $this->setRepeatDirection(TRepeatDirection::Horizontal);
}
+ /**
+ * @return boolean whether the items in the column can be edited. Defaults to false.
+ */
+ public function getReadOnly()
+ {
+ return $this->getViewState('ReadOnly',false);
+ }
+
+ /**
+ * @param boolean whether the items in the column can be edited
+ */
+ public function setReadOnly($value)
+ {
+ $this->setViewState('ReadOnly',TPropertyValue::ensureBoolean($value),false);
+ }
+
+ /**
+ * Wrapper for {@link setReadOnly ReadOnly} property.
+ * @return boolean whether the rating list can be edited. Defaults to true.
+ */
public function getAllowInput()
{
- return $this->getViewState('AllowInput', true);
+ return !$this->getReadOnly();
}
+ /**
+ * Wrapper for {@link setReadOnly ReadOnly} property.
+ * @param boolean whether the rating list can be edited
+ */
public function setAllowInput($value)
{
- $this->setViewState('AllowInput', TPropertyValue::ensureBoolean($value), true);
+ $this->setReadOnly(!TPropertyValue::ensureBoolean($value));
}
- public function getRating()
+ /**
+ * Wrapper for {@link setReadOnly ReadOnly} property.
+ * @param boolean whether the rating list can be edited
+ */
+ public function setEnabled($value)
{
- if($this->getAllowInput())
- return $this->getSelectedIndex();
- else
- return $this->getViewState('Rating',0);
+ $this->setReadOnly(!TPropertyValue::ensureBoolean($value));
}
- public function setRating($value)
+ /**
+ * The repeat layout must be Table.
+ * @param string repeat layout type
+ * @throws TInvaliddataValueException when repeat layout is not Table.
+ */
+ public function setRepeatLayout($value)
{
- if($this->getAllowInput())
- $this->setSelectedIndex($value);
+ if($value!==TRepeatLayout::Table)
+ throw new TInvalidDataValueException('ratinglist_table_layout_only');
else
- $this->setViewState('Rating', TPropertyValue::ensureFloat($value),0);
+ parent::setRepeatLayout($value);
}
/**
- * @param string set the rating style
+ * @return float rating value.
*/
- public function setRatingStyle($value)
+ public function getRating()
{
- $this->setViewState('RatingStyle', $value, 'default');
+ $rating = $this->getViewState('Rating', null);
+ if ($rating === null)
+ return $this->getSelectedIndex()+1;
+ else
+ return $rating;
}
/**
- * @return TRatingListStyle current rating style
+ * @param float rating value, also sets the selected Index
*/
- public function getRatingStyle()
+ public function setRating($value)
{
- return $this->getViewState('RatingStyle', 'default');
+ $value = TPropertyValue::ensureFloat($value);
+ $this->setViewState('Rating', $value, null);
+ $index = $this->getRatingIndex($value);
+ parent::setSelectedIndex($index);
+ }
+
+ public function setSelectedIndex($value)
+ {
+ $this->setRating($value+1);
+ parent::setSelectedIndex($value);
}
/**
- * @return string caption text. Default is "Rate It:".
+ * @param float rating value
+ * @return int rating as integer
*/
- public function getCaption()
+ protected function getRatingIndex($rating)
{
- return $this->getViewState('Caption', 'Rate It:');
+ $interval = $this->getHalfRatingInterval();
+ $base = intval($rating)-1;
+ $remainder = $rating-$base-1;
+ return $remainder > $interval[1] ? $base+1 : $base;
}
/**
- * @param string caption text
+ * @param int change the rating selection index
*/
- public function setCaption($value)
+ public function onSelectedIndexChanged($param)
{
- $this->setViewState('Caption', $value, 'Rate It:');
+ $value = $this->getRating();
+ $value = TPropertyValue::ensureInteger($value);
+ $this->setRating($value);
+ parent::onSelectedIndexChanged($param);
}
+ /**
+ * @return string control or html element ID for displaying a caption.
+ */
+ public function getCaptionID()
+ {
+ return $this->getViewState('CaptionID', '');
+ }
- public function setHalfRatingLimit($value)
+ /**
+ * @param string control or html element ID for displaying a caption.
+ */
+ public function setCaptionID($value)
{
- $this->setViewState('HalfRating',
- TPropertyValue::ensureArray($value), array(0.3, 0.7));
+ $this->setViewState('CaptionID', $value, '');
}
- public function getHalfRatingLimit()
+ protected function getCaptionControl()
{
- return $this->getViewState('HalfRating', array(0.3, 0.7));
+ if(($id=$this->getCaptionID())!=='')
+ {
+ if($control=$this->getParent()->findControl($id))
+ return $control;
+ }
+ throw new TInvalidDataValueException(
+ 'ratinglist_invalid_caption_id',$id,$this->getID());
}
/**
- * @param string asset file in the self::SCRIPT_PATH directory.
- * @return string asset file url.
+ * @return string caption text. Default is "Rate It:".
*/
- protected function getAssetUrl($file='')
+ public function getCaption()
{
- $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
- return $base.'/'.self::SCRIPT_PATH.'/'.$file;
+ return $this->getCaptionControl()->getText();
}
- public function getRatingClientOptions()
- {
- $options['cssClass'] = 'TRatingList_'.$this->getRatingStyle();
- $options['ID'] = $this->getClientID();
- $options['caption'] = $this->getCaption();
- $options['field'] = $this->getUniqueID();
- $options['selectedIndex'] = $this->getSelectedIndex();
+ /**
+ * @return TRatingListStyle current rating style
+ */
+ public function setCaption($value)
+ {
+ $this->getCaptionControl()->setText($value);
+ }
+
+ /**
+ * @param string set the rating style, default is "default"
+ */
+ public function setRatingStyle($value)
+ {
+ $this->setViewState('RatingStyle', $value, 'default');
+ }
+
+ /**
+ * @return TRatingListStyle current rating style
+ */
+ public function getRatingStyle()
+ {
+ return $this->getViewState('RatingStyle', 'default');
+ }
+
+ /**
+ * @return string rating style css class name.
+ */
+ protected function getRatingStyleCssClass()
+ {
+ return 'TRatingList_'.$this->getRatingStyle();
+ }
+
+ /**
+ * Sets the interval such that those rating values within the interval
+ * will be considered as a half star rating.
+ * @param array rating display half value interval, default is array(0.3, 0.7);
+ */
+ public function setHalfRatingInterval($value)
+ {
+ $this->setViewState('HalfRating',
+ TPropertyValue::ensureArray($value), array(0.3, 0.7));
+ }
+
+ /**
+ * @return array rating display half value interval, default is array(0.3, 0.7);
+ */
+ public function getHalfRatingInterval()
+ {
+ return $this->getViewState('HalfRating', array(0.3, 0.7));
+ }
+
+ /**
+ * @return array list of post back options.
+ */
+ protected function getPostBackOptions()
+ {
+ $options = parent::getPostBackOptions();
+ $options['AutoPostBack'] = $this->getAutoPostBack();
+ $options['ReadOnly'] = $this->getReadOnly();
+ $options['Style'] = $this->getRatingStyleCssClass();
+ $options['CaptionID'] = $this->getCaptionControlID();
+ $options['SelectedIndex'] = $this->getSelectedIndex();
+ $options['Rating'] = $this->getRating();
+ $options['HalfRating'] = $this->getHalfRatingInterval();
return $options;
- }
+ }
- protected function publishRatingListStyle($style)
- {
+ /**
+ * @return string find the client ID of the caption control.
+ */
+ protected function getCaptionControlID()
+ {
+ if(($id=$this->getCaptionID())!=='')
+ {
+ if($control=$this->getParent()->findControl($id))
+ {
+ if($control->getVisible(true))
+ return $control->getClientID();
+ }
+ else
+ return $id;
+ }
+ return '';
+ }
+
+ /**
+ * Publish the the rating style css file and rating image files.
+ */
+ public function onPreRender($param)
+ {
+ parent::onPreRender($param);
+ $this->publishStyle($this->getRatingStyle());
+ $this->_ratingImages = $this->publishImages($this->getRatingStyle());
+ }
+
+ /**
+ * @param string rating style name
+ * @return string URL of the css style file
+ */
+ protected function publishStyle($style)
+ {
$cs = $this->getPage()->getClientScript();
$url = $this->getAssetUrl($style.'.css');
if(!$cs->isStyleSheetFileRegistered($url))
$cs->registerStyleSheetFile($url, $url);
return $url;
- }
+ }
- protected function publishRatingListImages($style, $fileExt='.gif')
- {
- $images = array('blank', 'hover', 'selected', 'half');
+ /**
+ * @param string rating style name
+ * @param string rating image file extension, default is '.gif'
+ * @return array URL of publish the rating images
+ */
+ protected function publishImages($style, $fileExt='.gif')
+ {
+ $types = array('blank', 'selected', 'half', 'combined');
$files = array();
- foreach($images as $type)
+ foreach($types as $type)
$files[$type] = $this->getAssetUrl("{$style}_{$type}{$fileExt}");
return $files;
- }
+ }
/**
- * @param THtmlWriter writer
+ * @param string asset file in the self::SCRIPT_PATH directory.
+ * @return string asset file url.
*/
- public function onPreRender($param)
- {
- parent::onPreRender($param);
-
- $this->publishRatingListStyle($this->getRatingStyle());
- $this->_ratingImages = $this->publishRatingListImages($this->getRatingStyle());
-
- if($this->getAllowInput())
- $this->registerRatingListClientScript();
- else
- {
- $this->getRepeatInfo()->setCaption($this->getCaption());
- $this->setAttribute('title', $this->getRating());
- }
- }
-
- protected function registerRatingListClientScript()
- {
- $id = $this->getClientID();
- $scripts = $this->getPage()->getClientScript();
- $scripts->registerPradoScript('prado');
- $options = TJavaScript::encode($this->getRatingClientOptions());
- $code = "new Prado.WebUI.TRatingList($options);";
- $scripts->registerEndScript("prado:$id", $code);
- }
-
- public function renderItem($writer,$repeatInfo,$itemType,$index)
- {
- if($this->getAllowInput())
- parent::renderItem($writer, $repeatInfo, $itemType, $index);
- else
- $this->renderRatingListItem($writer, $repeatInfo, $itemType, $index);
- }
-
- protected function renderRatingListItem($writer, $repeatInfo, $itemType, $index)
- {
- $image = new TImage;
- $image->setImageUrl($this->_ratingImages[$this->getRatingImageType($index)]);
- $image->setAlternateText($this->getRating());
- $image->render($writer);
- }
-
- protected function getRatingImageType($index)
- {
- $rating = floatval($this->getRating());
- $int = intval($rating);
- $limit = $this->getHalfRatingLimit();
- if($index < $int || ($rating < $index + 1 && $rating > $index +$limit[1]))
- return 'selected';
- if($rating >= $index+$limit[0] && $rating <= $index+$limit[1])
- return 'half';
- return 'blank';
- }
+ protected function getAssetUrl($file='')
+ {
+ $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl();
+ return $base.'/'.self::SCRIPT_PATH.'/'.$file;
+ }
- public function generateItemStyle($itemType,$index)
- {
- return new TStyle;
- }
+ /**
+ * Add rating style class name to the class attribute
+ * when {@link setReadOnly ReadOnly} property is true and when the
+ * {@link setCssClass CssClass} property is empty.
+ * @param THtmlWriter renderer
+ */
+ public function render($writer)
+ {
+ $writer->addAttribute('id',$this->getClientID());
+ $this->getPage()->getClientScript()->registerPostBackControl(
+ $this->getClientClassName(), $this->getPostBackOptions());
+ parent::render($writer);
+ }
/**
* Gets the name of the javascript class responsible for performing postback for this control.
@@ -218,4 +347,3 @@ class TRatingList extends TRadioButtonList
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TRegularExpressionValidator.php b/framework/Web/UI/WebControls/TRegularExpressionValidator.php
index f0c645a4..be861e45 100644
--- a/framework/Web/UI/WebControls/TRegularExpressionValidator.php
+++ b/framework/Web/UI/WebControls/TRegularExpressionValidator.php
@@ -96,7 +96,7 @@ class TRegularExpressionValidator extends TBaseValidator
}
/**
- * @param string pattern modifiers,
+ * @param string pattern modifiers for server side validation,
* see http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php
*/
public function setPatternModifiers($value)
@@ -113,6 +113,23 @@ class TRegularExpressionValidator extends TBaseValidator
}
/**
+ * @param string pattern modifiers for clientside.
+ * (Only 'g','i' and 'm' are available.)
+ */
+ public function setClientSidePatternModifiers($value)
+ {
+ $this->setViewState('ClientSidePatternModifiers', $value);
+ }
+
+ /**
+ * @return string clientside pattern modifiers, no modifiers by default.
+ */
+ public function getClientSidePatternModifiers()
+ {
+ return $this->getViewState('ClientSidePatternModifiers', '');
+ }
+
+ /**
* Returns an array of javascript validator options.
* @return array javascript validator options.
*/
@@ -120,8 +137,8 @@ class TRegularExpressionValidator extends TBaseValidator
{
$options = parent::getClientScriptOptions();
$options['ValidationExpression']=$this->getRegularExpression();
+ $options['PatternModifiers']=$this->getClientSidePatternModifiers();
return $options;
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TRepeatInfo.php b/framework/Web/UI/WebControls/TRepeatInfo.php
index ecf0ebf7..30c85f14 100644
--- a/framework/Web/UI/WebControls/TRepeatInfo.php
+++ b/framework/Web/UI/WebControls/TRepeatInfo.php
@@ -558,4 +558,3 @@ class TRepeatLayout extends TEnumerable
const Raw='Raw';
}
-?>
diff --git a/framework/Web/UI/WebControls/TRepeater.php b/framework/Web/UI/WebControls/TRepeater.php
index 6b9c08c1..a6c9903d 100644
--- a/framework/Web/UI/WebControls/TRepeater.php
+++ b/framework/Web/UI/WebControls/TRepeater.php
@@ -1023,4 +1023,3 @@ class TRepeaterItemCollection extends TList
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TRepeaterItemRenderer.php b/framework/Web/UI/WebControls/TRepeaterItemRenderer.php
index d99da302..79ff9087 100644
--- a/framework/Web/UI/WebControls/TRepeaterItemRenderer.php
+++ b/framework/Web/UI/WebControls/TRepeaterItemRenderer.php
@@ -48,4 +48,3 @@ class TRepeaterItemRenderer extends TItemDataRenderer
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TRequiredFieldValidator.php b/framework/Web/UI/WebControls/TRequiredFieldValidator.php
index 8d0eaec2..e6ddd6d3 100644
--- a/framework/Web/UI/WebControls/TRequiredFieldValidator.php
+++ b/framework/Web/UI/WebControls/TRequiredFieldValidator.php
@@ -136,4 +136,3 @@ class TRequiredFieldValidator extends TBaseValidator
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TSafeHtml.php b/framework/Web/UI/WebControls/TSafeHtml.php
index 0f4de2cb..d6829f8b 100644
--- a/framework/Web/UI/WebControls/TSafeHtml.php
+++ b/framework/Web/UI/WebControls/TSafeHtml.php
@@ -62,4 +62,3 @@ class TSafeHtml extends TControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TSlider.php b/framework/Web/UI/WebControls/TSlider.php
index 3fd8e244..ee725e99 100644
--- a/framework/Web/UI/WebControls/TSlider.php
+++ b/framework/Web/UI/WebControls/TSlider.php
@@ -4,7 +4,7 @@
*
* @author Christophe Boulain <Christophe.Boulain@gmail.com>
* @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-2008 PradoSoft
+ * @copyright Copyright &copy; 2005-2008 PradoSoft
* @license http://www.pradosoft.com/license/
* @version $Id$
* @package System.Web.UI.WebControls
@@ -218,7 +218,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
public function setValues($value)
{
$this->setViewState('Values', TPropertyValue::ensureArray($value), array());
- }
+ }
/**
* @return boolean a value indicating whether an automatic postback to the server
@@ -488,7 +488,7 @@ class TSlider extends TWebControl implements IPostBackDataHandler, IDataRenderer
// Add max if it's not in the array because of step
if (!in_array($maxValue, $values)) $values[]=$maxValue;
}
- $options['values'] = TJavascript::Encode($values,false);
+ $options['values'] = TJavaScript::Encode($values,false);
if($this->_clientScript!==null)
$options = array_merge($options,$this->_clientScript->getOptions()->toArray());
return $options;
@@ -572,4 +572,3 @@ class TSliderDirection extends TEnumerable
}
-?>
diff --git a/framework/Web/UI/WebControls/TStatements.php b/framework/Web/UI/WebControls/TStatements.php
index 09c03cb9..d07e68a1 100644
--- a/framework/Web/UI/WebControls/TStatements.php
+++ b/framework/Web/UI/WebControls/TStatements.php
@@ -61,4 +61,3 @@ class TStatements extends TControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TStyle.php b/framework/Web/UI/WebControls/TStyle.php
index c81a6db9..7cb1d8c8 100644
--- a/framework/Web/UI/WebControls/TStyle.php
+++ b/framework/Web/UI/WebControls/TStyle.php
@@ -891,4 +891,3 @@ class TTableGridLines extends TEnumerable
const Both='Both';
}
-?>
diff --git a/framework/Web/UI/WebControls/TTable.php b/framework/Web/UI/WebControls/TTable.php
index 9fa9130d..57efa7f7 100644
--- a/framework/Web/UI/WebControls/TTable.php
+++ b/framework/Web/UI/WebControls/TTable.php
@@ -408,4 +408,3 @@ class TTableCaptionAlign extends TEnumerable
const Right='Right';
}
-?>
diff --git a/framework/Web/UI/WebControls/TTableCell.php b/framework/Web/UI/WebControls/TTableCell.php
index 10d4f457..8bc83c52 100644
--- a/framework/Web/UI/WebControls/TTableCell.php
+++ b/framework/Web/UI/WebControls/TTableCell.php
@@ -220,4 +220,3 @@ class TTableCell extends TWebControl implements IDataRenderer
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TTableFooterRow.php b/framework/Web/UI/WebControls/TTableFooterRow.php
index f3c35dc3..dd0de143 100644
--- a/framework/Web/UI/WebControls/TTableFooterRow.php
+++ b/framework/Web/UI/WebControls/TTableFooterRow.php
@@ -45,4 +45,3 @@ class TTableFooterRow extends TTableRow
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TTableHeaderCell.php b/framework/Web/UI/WebControls/TTableHeaderCell.php
index a1a8919a..1e18cee3 100644
--- a/framework/Web/UI/WebControls/TTableHeaderCell.php
+++ b/framework/Web/UI/WebControls/TTableHeaderCell.php
@@ -122,4 +122,3 @@ class TTableHeaderScope extends TEnumerable
const Column='Column';
}
-?>
diff --git a/framework/Web/UI/WebControls/TTableHeaderRow.php b/framework/Web/UI/WebControls/TTableHeaderRow.php
index fa7e4515..7b8488bd 100644
--- a/framework/Web/UI/WebControls/TTableHeaderRow.php
+++ b/framework/Web/UI/WebControls/TTableHeaderRow.php
@@ -45,4 +45,3 @@ class TTableHeaderRow extends TTableRow
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TTableRow.php b/framework/Web/UI/WebControls/TTableRow.php
index be93529e..c70f28dd 100644
--- a/framework/Web/UI/WebControls/TTableRow.php
+++ b/framework/Web/UI/WebControls/TTableRow.php
@@ -206,4 +206,3 @@ class TTableRowSection extends TEnumerable
const Footer='Footer';
}
-?>
diff --git a/framework/Web/UI/WebControls/TTemplateColumn.php b/framework/Web/UI/WebControls/TTemplateColumn.php
index de4bc2ef..21190f23 100644
--- a/framework/Web/UI/WebControls/TTemplateColumn.php
+++ b/framework/Web/UI/WebControls/TTemplateColumn.php
@@ -254,4 +254,3 @@ class TTemplateColumn extends TDataGridColumn
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TTextBox.php b/framework/Web/UI/WebControls/TTextBox.php
index 3c3e6d0e..4e6a66e9 100644
--- a/framework/Web/UI/WebControls/TTextBox.php
+++ b/framework/Web/UI/WebControls/TTextBox.php
@@ -67,6 +67,7 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
*/
private $_safeText;
private $_dataChanged=false;
+ private $_isValid=true;
/**
* @return string tag name of the textbox
@@ -243,6 +244,23 @@ class TTextBox extends TWebControl implements IPostBackDataHandler, IValidatable
return $this->getText();
}
+ /**
+ * Returns true if this control validated successfully.
+ * Defaults to true.
+ * @return bool wether this control validated successfully.
+ */
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ /**
+ * @param bool wether this control is valid.
+ */
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+
/**
* Raises <b>OnTextChanged</b> event.
* This method is invoked when the value of the {@link getText Text}
@@ -618,4 +636,3 @@ class TTextBoxAutoCompleteType extends TEnumerable
const Search='Search';
}
-?>
diff --git a/framework/Web/UI/WebControls/TTextHighlighter.php b/framework/Web/UI/WebControls/TTextHighlighter.php
index 0356c4e7..890deb05 100644
--- a/framework/Web/UI/WebControls/TTextHighlighter.php
+++ b/framework/Web/UI/WebControls/TTextHighlighter.php
@@ -198,4 +198,3 @@ class TTextHighlighterLineNumberStyle extends TEnumerable
const Li='Li';
const Table='Table';
}
-?>
diff --git a/framework/Web/UI/WebControls/TTextProcessor.php b/framework/Web/UI/WebControls/TTextProcessor.php
index ccb78196..26dab754 100644
--- a/framework/Web/UI/WebControls/TTextProcessor.php
+++ b/framework/Web/UI/WebControls/TTextProcessor.php
@@ -84,4 +84,3 @@ abstract class TTextProcessor extends TWebControl
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TValidationSummary.php b/framework/Web/UI/WebControls/TValidationSummary.php
index 4e0e0e50..95679e15 100644
--- a/framework/Web/UI/WebControls/TValidationSummary.php
+++ b/framework/Web/UI/WebControls/TValidationSummary.php
@@ -504,4 +504,3 @@ class TValidationSummaryDisplayStyle extends TEnumerable
const Fixed='Fixed';
}
-?>
diff --git a/framework/Web/UI/WebControls/TWebControl.php b/framework/Web/UI/WebControls/TWebControl.php
index 829a9d03..2e1899ad 100644
--- a/framework/Web/UI/WebControls/TWebControl.php
+++ b/framework/Web/UI/WebControls/TWebControl.php
@@ -432,4 +432,3 @@ class TWebControl extends TControl implements IStyleable
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TWebControlAdapter.php b/framework/Web/UI/WebControls/TWebControlAdapter.php
index 35e157af..a99afe7f 100644
--- a/framework/Web/UI/WebControls/TWebControlAdapter.php
+++ b/framework/Web/UI/WebControls/TWebControlAdapter.php
@@ -69,4 +69,3 @@ class TWebControlAdapter extends TControlAdapter
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TWizard.php b/framework/Web/UI/WebControls/TWizard.php
index 1f9e886b..774096f7 100644
--- a/framework/Web/UI/WebControls/TWizard.php
+++ b/framework/Web/UI/WebControls/TWizard.php
@@ -2153,4 +2153,3 @@ class TWizardStepType extends TEnumerable
const Finish='Finish';
}
-?>
diff --git a/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php b/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php
index 6eebce74..54d585c4 100644
--- a/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php
+++ b/framework/Web/UI/WebControls/TWizardNavigationButtonStyle.php
@@ -153,4 +153,3 @@ class TWizardNavigationButtonStyle extends TStyle
}
}
-?>
diff --git a/framework/Web/UI/WebControls/TXmlTransform.php b/framework/Web/UI/WebControls/TXmlTransform.php
index ab49ae61..991aed39 100644
--- a/framework/Web/UI/WebControls/TXmlTransform.php
+++ b/framework/Web/UI/WebControls/TXmlTransform.php
@@ -191,4 +191,3 @@ class TXmlTransform extends TControl {
}
}
-?>
diff --git a/framework/Web/UI/WebControls/assets/captcha.php b/framework/Web/UI/WebControls/assets/captcha.php
index bff2f61a..8c9ff0a3 100644
--- a/framework/Web/UI/WebControls/assets/captcha.php
+++ b/framework/Web/UI/WebControls/assets/captcha.php
@@ -221,4 +221,3 @@ function morphImage($image,$width,$height)
}
}
-?>
diff --git a/framework/Xml/TXmlDocument.php b/framework/Xml/TXmlDocument.php
index 9325c62a..d7ddf187 100644
--- a/framework/Xml/TXmlDocument.php
+++ b/framework/Xml/TXmlDocument.php
@@ -547,4 +547,3 @@ class TXmlElementList extends TList
}
}
-?>
diff --git a/framework/interfaces.php b/framework/interfaces.php
index 634a6e51..2012dff7 100644
--- a/framework/interfaces.php
+++ b/framework/interfaces.php
@@ -379,4 +379,3 @@ interface IDataRenderer
*/
public function setData($value);
}
-?>
diff --git a/framework/prado.php b/framework/prado.php
index 4690617c..3777f763 100644
--- a/framework/prado.php
+++ b/framework/prado.php
@@ -56,4 +56,3 @@ require_once(dirname(__FILE__).'/TApplication.php');
*/
require_once(dirname(__FILE__).'/TShellApplication.php');
-?>
diff --git a/index.html b/index.html
index 07f10f4e..4a323035 100644
--- a/index.html
+++ b/index.html
@@ -1,172 +1,172 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title>PRADO Framework for PHP 5</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
-<meta http-equiv="content-language" content="en"/>
-</head>
-
-<body>
-<h1>PRADO Framework for PHP 5 </h1>
-<p>Version 3.1.3, To Be Released<br>
-Copyright&copy; 2004-2008 by <a href="http://www.pradosoft.com/">Prado Software</a><br>
-All Rights Reserved.
-</p>
-
-<p>
-PRADO is a component-based and event-driven framework for Web application development in PHP 5.
-</p>
-<p>
-PRADO is best suitable for creating Web applications that are highly user-interactive. It can be used to develop systems as simple as a blog system to those as complex as a content management system (CMS) or a complete e-commerce solution. Because PRADO promotes object-oriented programming (OOP) through its component-based methodology, it fits extremely well for team work and enterprise development. Its event-driven programming pattern helps developers gain better focus on business logic rather than distracted by various tedious and repetitive low-level coding handling.
-</p>
-<p>
-PRADO comes with many features that can cut down development time signficantly. In particular, it provides a rich set of pluggable Web controls, complete database support including both active record and complex object mapper, seamless AJAX support, theme and skin, internationalization and localization, various caching solutions, security measures, and many other features that are seldom found in other programming frameworks.
-</p>
-<p>
-Developers who have sufficient OOP experience will find PRADO is easy to learn and understand. In fact, PRADO shares many similarities with ASP.NET and other RAD kits for Windows GUI development, such as Borland Delphi and Microsoft Visual Basic.
-</p>
-
-<h2>Requirements</h2>
-<p>
-The sole requirement for PRADO is PHP 5.1.0 or higher. Please run <a href="requirements/index.php">requirement checker</a> to obtain more detailed requirement information.
-</p>
-<p>
-PRADO has been tested with Apache 2.0 on both Windows XP and RedHat Linux.
-</p>
-
-<h2>Installation</h2>
-<p>
-After downloading the latest PRADO release file, unpack it to a Web-accessible directory. The installation is done! You will see the following subdirectories:
-</p>
-<ul>
- <li>framework - contains the core code of PRADO. This is the only directory that you will need in order to deploy with your PRADO application. It does NOT need to reside in a Web-accessible directory.</li>
- <li>demos - contains PRADO demo applications.</li>
- <li>docs - contains tutorials and documentation about PRADO.</li>
- <li>editors - contains editor plugins for PRADO.</li>
- <li>requirements - contains a requirement checker script that can check if your system can run PRADO applications.</li>
- <li>tests - contains test tools that can be used to do unit test and functionality test about Web applications.</li>
-</ul>
-
-<h2>Included Demos</h2>
-<ul>
- <li><a href="demos/helloworld/index.php">Hello World</a></li>
- <li><a href="demos/blog-tutorial/index.php">PRADO Blog Tutorial</a> (a good start point for new PRADO users)</li>
- <li><a href="demos/quickstart/index.php">PRADO QuickStart Tutorial</a> (a definitive PRADO guidance. It contains many small examples.)</li>
- <li><a href="demos/blog/index.php">PRADO Blog</a> (requires php_sqlite extension)</li>
- <li><a href="demos/time-tracker/index.php">Time Tracker</a> (requires php_pdo and php_pdo_mysql extensions)</li>
- <li><a href="demos/composer/index.php">PRADO Component Writer</a></li>
- <li><a href="demos/chat/index.php">Chat</a> (requires php_pdo and php_pdo_sqlite extensions)</li>
- <li><a href="demos/currency-converter/index.php">Currency Converter</a></li>
- <li><a href="demos/soap/index.php">SOAP</a> (requires php_soap extension)</li>
- <li><a href="demos/personal/index.php">Personal Website</a></li>
- <li><a href="demos/address-book/index.php">Flex Addressbook</a> (requires php_soap, php_pdo and php_pdo_sqlite extensions)</li>
- <!--<li><a href="demos/sqlmap/index.php">SqlMap Tutorial</a> (not completed yet)</li> -->
- <li><a href="demos/northwind-db/index.php">Northwind database</a> (requires php_pdo and php_pdo_sqlite extensions)</li>
-</ul>
-
-<h2>Editor Support</h2>
-<p>
-A Macromedia Dreamweaver extension can be found under <b>editors/Dreamweaver</b>.
-This extension contains a tag library that enables Dreamweaver to auto-complete
-PRADO component tags when you use it to edit PRADO templates.
-</p>
-
-<h2>Documentation</h2>
-<ul>
-<li><a href="docs/prado3_manual.chm">Integrated manual (CHM)</a>, including quickstart, API, class docs and wiki</li>
-<li><a href="docs/quickstart.pdf">Quickstart tutorial (PDF)</a></li>
-<li><a href="docs/manual/index.html">API documentation (HTML)</a></li>
-<li><a href="docs/sqlmap/sqlmap.pdf">SQLMap PHP DataMapper Tutorial (PDF)</a></li>
-</ul>
-
-<h2>Credits</h2>
-
-<h3>Prado v3 Developer Team</h3>
-<ul>
-<li><a href="mailto:qiang.xue@gmail.com">Qiang Xue</a></li>
-<li><a href="mailto:weizhuo@gmail.com">Xiang Wei Zhuo</a></li>
-<li><a href="mailto:jrags@jasrags.net">Jason Ragsdale</a></li>
-<li><a href="mailto:nyeholt@optushome.com.au">Marcus Nyeholt</a></li>
-<li><a href="mailto:carl@decart.no">Carl Mathisen</a></li>
-<li><a href="mailto:compte_messagerie@hotmail.com">Alban Hanry</a></li>
-<li><a href="mailto:knut.urdalen@gmail.com">Knut Urdalen</a></li>
-<li><a href="mailto:Christophe.Boulain@gmail.com">Christophe Boulain</a></li>
-<li><a href="mailto:mh@m-h-it.de">Michael Härtl</a></li>
-</ul>
-
-<h3>Translations</h3>
-<ul>
-<li>Indonesian: Zaenal Mutaqin</li>
-<li>French: Eric Marchetti</li>
-<li>Japanese: Yoshinari Ueyama, Shinya Kawamura, Tsuchimoto Hiroki</li>
-</ul>
-
-<h3>Prado v2 Maintenance Team</h3>
-<ul>
-<li><a href="mailto:rodolfo@equinoxe.g-networks.net">Rodolfo Gonzales</a></li>
-<li><a href="mailto:wkonkel@gmail.com">Warren Konkel</a></li>
-<li><a href="mailto:jnavratil@houston.rr.com">John Navratil</a></li>
-</ul>
-
-<h3>Past Team Members</h3>
-<ul>
-<li><a href="mailto:alex@linium.net">Alex Flint</a></li>
-<li><a href="mailto:luftyluft@gmail.com">Brian Luft</a></li>
-<li><a href="mailto:j.todd.patrick@gmail.com">Todd Patrick</a></li>
-<li><a href="mailto:pimvanderzwet@gmail.com">Pim van der Zwet</a></li>
-<li><a href="mailto:tim.evans@gmail.com">Tim Evans</a></li>
-<li><a href="mailto:johnteag@gmail.com">John Teague</a></li>
-</ul>
-
-<h3>Special Credits To</h3>
-<ul>
-<li>Stever for providing an Apple G3 notebook for testing safari browser issues.</li>
-<li>Stanislav Yordanov - the script of generating Dreameweaver extension for PRADO</li>
-<li>Andres Adolfo Testi - original concept and naming for Active Controls.</li>
-<li><a href="http://www.jackslocum.com/">Jack Slocum</a> - inspiration for the quickstart commenting system.</li>
-<li>Cesar Ramos - Active Record driver for IBM DB2.</li>
-<li>Sergey Morkovkin - TKeyboard control</li>
-<li>Tomasz Wolny - TTabPanel control</li>
-<li>All PRADO users - great suggestions, feedback and support</li>
-<li>ASP.NET 2.0 for its great inspiration and reference</li>
-<li>All <a href="framework/3rdParty/readme.html">third-party work</a> used in PRADO</li>
-</ul>
-
-
-<h2>License</h2>
-<p>
-The PRADO framework and the included demos are free software. They are released under
-the terms of the following BSD License.
-</p>
-<p>
-Copyright 2004-2008 by The PRADO Group (http://www.pradosoft.com)<br/>
-All rights reserved.
-</p>
-<p>
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-</p>
-<ul>
-<li>Redistributions of source code must retain the above copyright notice, this
-list of conditions and the following disclaimer. </li>
-<li>Redistributions in binary form must reproduce the above copyright notice,
-this list of conditions and the following disclaimer in the documentation and/or
-other materials provided with the distribution.</li>
-<li>Neither the name of the PRADO Group nor the names of its contributors may be
-used to endorse or promote products derived from this software without specific
-prior written permission.</li>
-</ul>
-<p>
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
-OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-OF SUCH DAMAGE.
-</p>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>PRADO Framework for PHP 5</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<meta http-equiv="content-language" content="en"/>
+</head>
+
+<body>
+<h1>PRADO Framework for PHP 5 </h1>
+<p>Version 3.2, To be released<br>
+Copyright&copy; 2004-2008 by <a href="http://www.pradosoft.com/">Prado Software</a><br>
+All Rights Reserved.
+</p>
+
+<p>
+PRADO is a component-based and event-driven framework for Web application development in PHP 5.
+</p>
+<p>
+PRADO is best suitable for creating Web applications that are highly user-interactive. It can be used to develop systems as simple as a blog system to those as complex as a content management system (CMS) or a complete e-commerce solution. Because PRADO promotes object-oriented programming (OOP) through its component-based methodology, it fits extremely well for team work and enterprise development. Its event-driven programming pattern helps developers gain better focus on business logic rather than distracted by various tedious and repetitive low-level coding handling.
+</p>
+<p>
+PRADO comes with many features that can cut down development time signficantly. In particular, it provides a rich set of pluggable Web controls, complete database support including both active record and complex object mapper, seamless AJAX support, theme and skin, internationalization and localization, various caching solutions, security measures, and many other features that are seldom found in other programming frameworks.
+</p>
+<p>
+Developers who have sufficient OOP experience will find PRADO is easy to learn and understand. In fact, PRADO shares many similarities with ASP.NET and other RAD kits for Windows GUI development, such as Borland Delphi and Microsoft Visual Basic.
+</p>
+
+<h2>Requirements</h2>
+<p>
+The sole requirement for PRADO is PHP 5.1.0 or higher. Please run <a href="requirements/index.php">requirement checker</a> to obtain more detailed requirement information.
+</p>
+<p>
+PRADO has been tested with Apache 2.0 on both Windows XP and RedHat Linux.
+</p>
+
+<h2>Installation</h2>
+<p>
+After downloading the latest PRADO release file, unpack it to a Web-accessible directory. The installation is done! You will see the following subdirectories:
+</p>
+<ul>
+ <li>framework - contains the core code of PRADO. This is the only directory that you will need in order to deploy with your PRADO application. It does NOT need to reside in a Web-accessible directory.</li>
+ <li>demos - contains PRADO demo applications.</li>
+ <li>docs - contains tutorials and documentation about PRADO.</li>
+ <li>editors - contains editor plugins for PRADO.</li>
+ <li>requirements - contains a requirement checker script that can check if your system can run PRADO applications.</li>
+ <li>tests - contains test tools that can be used to do unit test and functionality test about Web applications.</li>
+</ul>
+
+<h2>Included Demos</h2>
+<ul>
+ <li><a href="demos/helloworld/index.php">Hello World</a></li>
+ <li><a href="demos/blog-tutorial/index.php">PRADO Blog Tutorial</a> (a good start point for new PRADO users)</li>
+ <li><a href="demos/quickstart/index.php">PRADO QuickStart Tutorial</a> (a definitive PRADO guidance. It contains many small examples.)</li>
+ <li><a href="demos/blog/index.php">PRADO Blog</a> (requires php_sqlite extension)</li>
+ <li><a href="demos/time-tracker/index.php">Time Tracker</a> (requires php_pdo and php_pdo_mysql extensions)</li>
+ <li><a href="demos/composer/index.php">PRADO Component Writer</a></li>
+ <li><a href="demos/chat/index.php">Chat</a> (requires php_pdo and php_pdo_sqlite extensions)</li>
+ <li><a href="demos/currency-converter/index.php">Currency Converter</a></li>
+ <li><a href="demos/soap/index.php">SOAP</a> (requires php_soap extension)</li>
+ <li><a href="demos/personal/index.php">Personal Website</a></li>
+ <li><a href="demos/address-book/index.php">Flex Addressbook</a> (requires php_soap, php_pdo and php_pdo_sqlite extensions)</li>
+ <!--<li><a href="demos/sqlmap/index.php">SqlMap Tutorial</a> (not completed yet)</li> -->
+ <li><a href="demos/northwind-db/index.php">Northwind database</a> (requires php_pdo and php_pdo_sqlite extensions)</li>
+</ul>
+
+<h2>Editor Support</h2>
+<p>
+A Macromedia Dreamweaver extension can be found under <b>editors/Dreamweaver</b>.
+This extension contains a tag library that enables Dreamweaver to auto-complete
+PRADO component tags when you use it to edit PRADO templates.
+</p>
+
+<h2>Documentation</h2>
+<ul>
+<li><a href="docs/prado3_manual.chm">Integrated manual (CHM)</a>, including quickstart, API, class docs and wiki</li>
+<li><a href="docs/quickstart.pdf">Quickstart tutorial (PDF)</a></li>
+<li><a href="docs/manual/index.html">API documentation (HTML)</a></li>
+<li><a href="docs/sqlmap/sqlmap.pdf">SQLMap PHP DataMapper Tutorial (PDF)</a></li>
+</ul>
+
+<h2>Credits</h2>
+
+<h3>Prado v3 Developer Team</h3>
+<ul>
+<li><a href="mailto:qiang.xue@gmail.com">Qiang Xue</a></li>
+<li><a href="mailto:weizhuo@gmail.com">Xiang Wei Zhuo</a></li>
+<li><a href="mailto:jrags@jasrags.net">Jason Ragsdale</a></li>
+<li><a href="mailto:nyeholt@optushome.com.au">Marcus Nyeholt</a></li>
+<li><a href="mailto:carlgmathisen@gmail.com">Carl Mathisen</a></li>
+<li><a href="mailto:compte_messagerie@hotmail.com">Alban Hanry</a></li>
+<li><a href="mailto:knut.urdalen@gmail.com">Knut Urdalen</a></li>
+<li><a href="mailto:Christophe.Boulain@gmail.com">Christophe Boulain</a></li>
+<li><a href="mailto:mh@m-h-it.de">Michael Härtl</a></li>
+</ul>
+
+<h3>Translations</h3>
+<ul>
+<li>Indonesian: Zaenal Mutaqin</li>
+<li>French: Eric Marchetti</li>
+<li>Japanese: Yoshinari Ueyama, Shinya Kawamura, Tsuchimoto Hiroki</li>
+</ul>
+
+<h3>Prado v2 Maintenance Team</h3>
+<ul>
+<li><a href="mailto:rodolfo@equinoxe.g-networks.net">Rodolfo Gonzales</a></li>
+<li><a href="mailto:wkonkel@gmail.com">Warren Konkel</a></li>
+<li><a href="mailto:jnavratil@houston.rr.com">John Navratil</a></li>
+</ul>
+
+<h3>Past Team Members</h3>
+<ul>
+<li><a href="mailto:alex@linium.net">Alex Flint</a></li>
+<li><a href="mailto:luftyluft@gmail.com">Brian Luft</a></li>
+<li><a href="mailto:j.todd.patrick@gmail.com">Todd Patrick</a></li>
+<li><a href="mailto:pimvanderzwet@gmail.com">Pim van der Zwet</a></li>
+<li><a href="mailto:tim.evans@gmail.com">Tim Evans</a></li>
+<li><a href="mailto:johnteag@gmail.com">John Teague</a></li>
+</ul>
+
+<h3>Special Credits To</h3>
+<ul>
+<li>Stever for providing an Apple G3 notebook for testing safari browser issues.</li>
+<li>Stanislav Yordanov - the script of generating Dreameweaver extension for PRADO</li>
+<li>Andres Adolfo Testi - original concept and naming for Active Controls.</li>
+<li><a href="http://www.jackslocum.com/">Jack Slocum</a> - inspiration for the quickstart commenting system.</li>
+<li>Cesar Ramos - Active Record driver for IBM DB2.</li>
+<li>Sergey Morkovkin - TKeyboard control</li>
+<li>Tomasz Wolny - TTabPanel control</li>
+<li>All PRADO users - great suggestions, feedback and support</li>
+<li>ASP.NET 2.0 for its great inspiration and reference</li>
+<li>All <a href="framework/3rdParty/readme.html">third-party work</a> used in PRADO</li>
+</ul>
+
+
+<h2>License</h2>
+<p>
+The PRADO framework and the included demos are free software. They are released under
+the terms of the following BSD License.
+</p>
+<p>
+Copyright 2004-2008 by The PRADO Group (http://www.pradosoft.com)<br/>
+All rights reserved.
+</p>
+<p>
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+</p>
+<ul>
+<li>Redistributions of source code must retain the above copyright notice, this
+list of conditions and the following disclaimer. </li>
+<li>Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation and/or
+other materials provided with the distribution.</li>
+<li>Neither the name of the PRADO Group nor the names of its contributors may be
+used to endorse or promote products derived from this software without specific
+prior written permission.</li>
+</ul>
+<p>
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+OF SUCH DAMAGE.
+</p>
+</body>
+</html>
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page
new file mode 100755
index 00000000..ed35293e
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page
@@ -0,0 +1,17 @@
+<html>
+<com:THead/>
+<body>
+<com:TForm>
+<h1>TActiveDatePicker test</h1>
+<p>
+<com:TActiveDatePicker ID="datepicker" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker"/>
+<com:TActiveLabel ID="status" /><br/>
+<com:TActiveButton ID="decreaseButton" OnClick="decrease" Text="-1" OnCallback="testDatePicker"/>
+<com:TActiveButton ID="todayButton" OnClick="today" Text="Today" OnCallback="testDatePicker"/>
+<com:TActiveButton ID="increaseButton" OnClick="increase" Text="+1" OnCallback="testDatePicker"/>
+<com:TButton ID="toggleButton" OnClick="toggleMode" Text="Toggle input mode (postback)"/>
+</p>
+
+</com:TForm>
+</body>
+</html> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php
new file mode 100755
index 00000000..6d78a664
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php
@@ -0,0 +1,42 @@
+<?php
+
+prado::using('System.Web.UI.ActiveControls.*');
+
+class ActiveDatePicker extends TPage {
+
+ public function onLoad($param){
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ $this->datepicker->setTimeStamp(time());
+ }
+
+ public function testDatePicker($sender, $param){
+ $this->status->Text = $this->datepicker->getText();
+ }
+
+ public function today ($sender, $param)
+ {
+ $this->datepicker->setTimestamp(time());
+ }
+
+ public function increase ($sender, $param)
+ {
+ $this->datepicker->setTimestamp(strtotime('+1 day', $this->datepicker->getTimestamp()));
+ }
+ public function decrease ($sender, $param)
+ {
+ $this->datepicker->setTimestamp(strtotime('-1 day', $this->datepicker->getTimestamp()));
+ }
+
+ public function toggleMode ($sender, $param)
+ {
+ if ($this->datepicker->getInputMode()==TDatePickerInputMode::DropDownList)
+ $this->datepicker->setInputMode(TDatePickerInputMode::TextBox);
+ else
+ $this->datepicker->setInputMode(TDatePickerInputMode::DropDownList);
+ }
+
+ }
+
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page
new file mode 100644
index 00000000..35fcadc7
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.page
@@ -0,0 +1,14 @@
+<com:THead />
+<com:TForm ID="form1">
+ <h1>TActiveRatingList AllowInput Test Case</h1>
+ <com:TActiveRatingList ID="RatingList" AllowInput="false"
+ OnSelectedIndexChanged="ratingChanged">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" Selected="true" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+ </com:TActiveRatingList>
+ <com:TActiveLabel ID="Status" Text="AllowInput=false" />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php
new file mode 100644
index 00000000..c825f3f8
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAllowInputTest.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * TRatingListTest.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 13, 2008
+ */
+
+/**
+ * TRatingListTest.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 13, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListAllowInputTest extends TPage{
+ public function ratingChanged($sender, $param){
+ $this->Status->setText($sender->getRating().' : '.$sender->getSelectedValue());
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page
new file mode 100644
index 00000000..84ce4ef3
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.page
@@ -0,0 +1,16 @@
+<com:THead />
+<com:TForm ID="form1">
+ <h1>TActiveRatingList AutoPostBack Test Case</h1>
+ <com:TActiveRatingList ID="RatingList" AutoPostback="false"
+ OnSelectedIndexChanged="ratingChanged">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" Selected="true" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+ </com:TActiveRatingList>
+ <com:TActiveLabel ID="Status" Text="AutoPostback=false" />
+ <br />
+ <com:TActiveButton ID="Submit" Text="Submit" />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php
new file mode 100644
index 00000000..4b087b76
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListAutoPostBackTest.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * TRatingListTest.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 13, 2008
+ */
+
+/**
+ * TRatingListTest.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 13, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListAutoPostBackTest extends TPage{
+ public function ratingChanged($sender, $param){
+ $this->Status->setText($sender->getRating().' : '.$sender->getSelectedValue());
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page
new file mode 100644
index 00000000..36f4404d
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.page
@@ -0,0 +1,12 @@
+<com:THead />
+<com:TForm ID="form1">
+ <h1>TActiveRatingList Check Boxes Test Case</h1>
+ <com:TActiveRatingList ID="RatingList">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" Selected="true" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+ </com:TActiveRatingList>
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php
new file mode 100644
index 00000000..5c6dfa70
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListCheckBoxesTest.php
@@ -0,0 +1,23 @@
+<?php
+/**
+ * TRatingListTest.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 13, 2008
+ */
+
+/**
+ * TRatingListTest.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 13, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListCheckBoxesTest extends TPage{ }
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page
new file mode 100644
index 00000000..5f732e0d
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.page
@@ -0,0 +1,17 @@
+<com:THead />
+<com:TForm ID="form1">
+ <h1>TActiveRatingList Enabled Test Case</h1>
+ <com:TActiveRatingList ID="RatingList" Enabled="false"
+ OnSelectedIndexChanged="ratingChanged">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" Selected="true" />
+ </com:TActiveRatingList>
+ <com:TActiveLabel ID="Status" Text="Enabled=false" />
+ <br />
+ <com:TActiveButton ID="Enable" Text="Enable" OnClick="enable" />
+ <com:TActiveButton ID="Disable" Text="Disable" OnClick="disable" />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php
new file mode 100644
index 00000000..0cac7418
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListEnabledTest.php
@@ -0,0 +1,37 @@
+<?php
+/**
+ * TRatingListTest.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 13, 2008
+ */
+
+/**
+ * TRatingListTest.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 13, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListEnabledTest extends TPage{
+ public function ratingChanged($sender, $param){
+ $this->Status->setText($sender->getRating().' : '.$sender->getSelectedValue());
+ }
+
+ public function enable($sender, $param){
+ $this->RatingList->setEnabled(true);
+ $this->Status->setText('Enabled=true');
+ }
+
+ public function disable($sender, $param){
+ $this->RatingList->setEnabled(false);
+ $this->Status->setText('Enabled=false');
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page
new file mode 100644
index 00000000..01e47a34
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.page
@@ -0,0 +1,14 @@
+<com:THead />
+<com:TForm ID="form1">
+ <h1>TActiveRatingList Hover Caption Test Case</h1>
+ <com:TActiveRatingList ID="RatingList" CaptionID="Status"
+ OnSelectedIndexChanged="ratingChanged" Rating="3.5">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+ </com:TActiveRatingList>
+ <com:TActiveLabel ID="Status" Text="CaptionID='Status'" />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php
new file mode 100644
index 00000000..06d82d39
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListHoverCaptionTest.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * TRatingListTest.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 13, 2008
+ */
+
+/**
+ * TRatingListTest.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 13, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListHoverCaptionTest extends TPage{
+ public function ratingChanged($sender, $param){
+ $sender->setCaption($sender->getRating().' : '.$sender->getSelectedValue());
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page
new file mode 100644
index 00000000..942a5b45
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.page
@@ -0,0 +1,17 @@
+<com:THead />
+<com:TForm ID="form1">
+ <h1>TActiveRatingList Rating Test Case</h1>
+ <com:TActiveRatingList ID="RatingList" Rating="5"
+ OnSelectedIndexChanged="ratingChanged">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+ </com:TActiveRatingList>
+ <com:TActiveLabel ID="Status" Text="Rating: 5" />
+ <br />
+ <com:TActiveButton ID="SetRating" Text="Set Rating=3"
+ OnClick="setRating" />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php
new file mode 100644
index 00000000..fe5c8404
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListRatingTest.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TRatingListTest.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 13, 2008
+ */
+
+/**
+ * TRatingListTest.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 13, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListRatingTest extends TPage{
+ public function ratingChanged($sender, $param){
+ $this->Status->setText('Rating: '.$sender->getRating());
+ }
+
+ public function setRating($sender, $param){
+ $this->RatingList->setRating(3);
+ $this->ratingChanged($this->RatingList, null);
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page
new file mode 100644
index 00000000..dad3fd6e
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.page
@@ -0,0 +1,17 @@
+<com:THead />
+<com:TForm ID="form1">
+ <h1>TActiveRatingList ReadOnly Test Case</h1>
+ <com:TActiveRatingList ID="RatingList" ReadOnly="true"
+ OnSelectedIndexChanged="ratingChanged">
+ <com:TListItem Text="Poor" Selected="true" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+ </com:TActiveRatingList>
+ <com:TActiveLabel ID="Status" Text="ReadOnly=true" />
+ <br />
+ <com:TActiveButton ID="Writable" Text="Writable" OnClick="writable" />
+ <com:TActiveButton ID="ReadOnly" Text="ReadOnly" OnClick="readOnly" />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php
new file mode 100644
index 00000000..070fd13f
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListReadOnlyTest.php
@@ -0,0 +1,38 @@
+<?php
+/**
+ * TRatingListTest.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 13, 2008
+ */
+
+/**
+ * TRatingListTest.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 13, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListReadOnlyTest extends TPage{
+ public function ratingChanged($sender, $param){
+ $this->Status->setText($sender->getRating().' : '.$sender->getSelectedValue());
+ }
+
+ public function readOnly($sender, $param){
+ $this->RatingList->setReadOnly(true);
+ $this->Status->setText('ReadOnly=true');
+ }
+
+ public function writable($sender, $param){
+ $this->RatingList->setReadOnly(false);
+ $this->Status->setText('ReadOnly=false');
+ }
+
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page
new file mode 100644
index 00000000..6fb52822
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.page
@@ -0,0 +1,17 @@
+<com:THead />
+<com:TForm ID="form1">
+ <h1>TActiveRatingList SelectedIndex Test Case</h1>
+ <com:TActiveRatingList ID="RatingList" SelectedIndex="1"
+ OnSelectedIndexChanged="ratingChanged">
+ <com:TListItem Text="Poor" />
+ <com:TListItem Text="Fair" />
+ <com:TListItem Text="Average" />
+ <com:TListItem Text="Good" />
+ <com:TListItem Text="Excellent" />
+ <com:TListItem Text="Super" />
+ </com:TActiveRatingList>
+ <com:TActiveLabel ID="Status" Text="SelectedIndex: 1" />
+ <br />
+ <com:TActiveButton ID="SetSelectedIndex" Text="Set SelectedIndex=5"
+ OnClick="setSelectedIndex" />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php
new file mode 100644
index 00000000..4dbc6949
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveRatingListSelectedIndexTest.php
@@ -0,0 +1,32 @@
+<?php
+/**
+ * TRatingListTest.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 13, 2008
+ */
+
+/**
+ * TRatingListTest.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 13, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListSelectedIndexTest extends TPage{
+ public function ratingChanged($sender, $param){
+ $this->Status->setText('SelectedIndex: '.$sender->getSelectedIndex());
+ }
+
+ public function setSelectedIndex($sender, $param){
+ $this->RatingList->setSelectedIndex(5);
+ $this->ratingChanged($this->RatingList, null);
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
index f9be4aee..ba9c2e5d 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
+++ b/tests/FunctionalTests/active-controls/protected/pages/RatingList.page
@@ -3,22 +3,11 @@
<style>
.more td
{
+ background-position: 10px 10px;
border: 1px solid #eee;
width: 40px;
height: 40px;
}
- .more td.rating
- {
- background-position: 10px 10px;
- }
- .more td.rating_selected
- {
- background-position: 10px -90px;
- }
- .more td.rating_hover
- {
- background-position: 10px -290px;
- }
</style>
<com:TLabel ID="label1" Text="Rate It:" />
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
new file mode 100755
index 00000000..b8e9594e
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php
@@ -0,0 +1,97 @@
+<?php
+class ActiveDatePickerTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open("active-controls/index.php?page=ActiveDatePicker");
+ $this->verifyTextPresent("TActiveDatePicker test");
+ $this->verifyText("status", "");
+ $this->verifyValue("datepicker", date('m-d-Y'));
+ $this->click("increaseButton");
+ $this->pause(800);
+ $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 1 day')));
+ $this->verifyText("status", date('m-d-Y', strtotime('+ 1 day')));
+ $this->click("increaseButton");
+ $this->pause(800);
+ $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 2 day')));
+ $this->verifyText("status", date('m-d-Y', strtotime('+ 2 day')));
+ $this->click("todayButton");
+ $this->pause(800);
+ $this->verifyValue("datepicker", date('m-d-Y'));
+ $this->verifyText("status", date('m-d-Y'));
+ $this->click("decreaseButton");
+ $this->pause(800);
+ $this->verifyValue("datepicker", date('m-d-Y', strtotime('- 1 day')));
+ $this->verifyText("status", date('m-d-Y', strtotime('- 1 day')));
+ $this->click("datepicker");
+ $this->pause(800);
+ $this->click("css=input.todayButton");
+ $this->pause(800);
+ $this->verifyValue("datepicker", date('m-d-Y'));
+ $this->verifyText("status", date('m-d-Y'));
+ $this->click("css=input.nextMonthButton");
+ $this->pause(800);
+ $this->verifyValue("datepicker", date('m-d-Y', strtotime('+ 1 month')));
+ $this->verifyText("status", date('m-d-Y', strtotime('+1 month')));
+
+ $this->click('toggleButton');
+ $this->pause(1000);
+
+ $this->click("todayButton");
+ $this->pause(800);
+ $this->verifySelected("datepicker_month", date('m'));
+ $this->verifyText("status", date('m-d-Y'));
+
+ $this->click("increaseButton");
+ $this->pause(800);
+ $dateToCheck=strtotime('+ 1 day');
+ $this->verifySelected("datepicker_month", date('m', $dateToCheck));
+ $this->verifySelected("datepicker_day", date('d', $dateToCheck));
+ $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->verifyText("status", date('m-d-Y', $dateToCheck));
+
+ $this->click("increaseButton");
+ $this->pause(800);
+ $dateToCheck=strtotime('+ 2 day');
+ $this->verifySelected("datepicker_month", date('m', $dateToCheck));
+ $this->verifySelected("datepicker_day", date('d', $dateToCheck));
+ $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->verifyText("status", date('m-d-Y', $dateToCheck));
+
+ $this->click("todayButton");
+ $this->pause(800);
+ $dateToCheck=time();
+ $this->verifySelected("datepicker_month", date('m', $dateToCheck));
+ $this->verifySelected("datepicker_day", date('d', $dateToCheck));
+ $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->verifyText("status", date('m-d-Y', $dateToCheck));
+
+ $this->click("decreaseButton");
+ $this->pause(800);
+ $dateToCheck=strtotime('- 1 day');
+ $this->verifySelected("datepicker_month", date('m', $dateToCheck));
+ $this->verifySelected("datepicker_day", date('d', $dateToCheck));
+ $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->verifyText("status", date('m-d-Y', $dateToCheck));
+
+ $this->click("datepickerbutton");
+ $this->pause(800);
+ $this->click("css=input.todayButton");
+ $this->pause(800);
+ $dateToCheck=time();
+ $this->verifySelected("datepicker_month", date('m', $dateToCheck));
+ $this->verifySelected("datepicker_day", date('d', $dateToCheck));
+ $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->verifyText("status", date('m-d-Y', $dateToCheck));
+
+ $this->click("css=input.nextMonthButton");
+ $this->pause(800);
+ $dateToCheck=strtotime('+ 1 month');
+ $this->verifySelected("datepicker_month", date('m', $dateToCheck));
+ $this->verifySelected("datepicker_day", date('d', $dateToCheck));
+ $this->verifySelected("datepicker_year", date('Y', $dateToCheck));
+ $this->verifyText("status", date('m-d-Y', $dateToCheck));
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php
new file mode 100644
index 00000000..c6dc50c2
--- /dev/null
+++ b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php
@@ -0,0 +1,253 @@
+<?php
+/**
+ * ActiveRatingListTestCase.php
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Creation Date: Oct 22, 2008
+ */
+
+/**
+ * ActiveRatingListTestCase.php class
+ *
+ *
+ *
+ * Properties
+ * -
+ *
+ * @author Bradley Booms <Bradley.Booms@nsighttel.com>
+ * @version Modified Date: Oct 22, 2008
+ *
+ * Modifications:
+ */
+class ActiveRatingListTestCase extends SeleniumTestCase
+{
+ function testCheckBoxes()
+ {
+ // Verify we're on the right page.
+ $this->open("active-controls/index.php?page=ActiveRatingListCheckBoxesTest");
+ $this->verifyTextPresent("TActiveRatingList Check Boxes Test Case");
+ $this->assertCheckBoxes("RatingList", array(2), 6);
+
+ // Change the list and make sure the radio buttons get updated properly.
+ $this->clickTD("RatingList_c4");
+ $this->pause(800);
+ $this->assertCheckBoxes("RatingList", array(4), 6);
+
+ $this->clickTD("RatingList_c2");
+ $this->pause(800);
+ $this->assertCheckBoxes("RatingList", array(2), 6);
+ }
+
+ function testRating()
+ {
+ // Verify we're on the right page.
+ $this->open("active-controls/index.php?page=ActiveRatingListRatingTest");
+ $this->verifyTextPresent("TActiveRatingList Rating Test Case");
+
+ // Check the list, make sure it starts out with 5 stars.
+ $this->assertText("Status", "Rating: 5");
+
+ // Click on 1 star and make sure the Rating property updates.
+ $this->clickTD("RatingList_c0");
+ $this->pause(800);
+ $this->assertText("Status", "Rating: 1");
+
+ // Then set Rating to three on the server side and make sure it's correct.
+ $this->click("SetRating");
+ $this->pause(800);
+ $this->assertText("Status", "Rating: 3");
+ }
+
+ function testSelectedIndex()
+ {
+ // Verify we're on the right page.
+ $this->open("active-controls/index.php?page=ActiveRatingListSelectedIndexTest");
+ $this->verifyTextPresent("TActiveRatingList SelectedIndex Test Case");
+ $this->assertText("Status", " SelectedIndex: 1");
+
+ // Click on 5 stars and make sure the SelectedIndex property updates.
+ $this->clickTD("RatingList_c4");
+ $this->pause(800);
+ $this->assertText("Status", " SelectedIndex: 4");
+
+ // Then set SelectedIndex to 5 on the server side and make sure it's correct.
+ $this->click("SetSelectedIndex");
+ $this->pause(800);
+ $this->assertText("Status", " SelectedIndex: 5");
+ }
+
+ function testAutoPostBack()
+ {
+ // Verify we're on the right page.
+ $this->open("active-controls/index.php?page=ActiveRatingListAutoPostBackTest");
+ $this->verifyTextPresent("TActiveRatingList AutoPostBack Test Case");
+ $this->assertText("Status", "AutoPostback=false");
+
+ // Make sure that it doesn't auto post when clicked.
+ $this->clickTD("RatingList_c3");
+ $this->pause(800);
+ $this->assertText("Status", "AutoPostback=false");
+
+ // Then submit with an active button and make sure it updates.
+ $this->click("Submit");
+ $this->pause(800);
+ $this->assertText("Status", "4 : Good");
+ }
+
+ function testAllowInput()
+ {
+ // Verify we're on the right page.
+ $this->open("active-controls/index.php?page=ActiveRatingListAllowInputTest");
+ $this->verifyTextPresent("TActiveRatingList AllowInput Test Case");
+ $this->assertText("Status", "AllowInput=false");
+ $this->assertCheckBoxes("RatingList", array(3), 6);
+
+ // Make sure that clicking doesn't change anything.
+ $this->clickTD("RatingList_c5");
+ $this->pause(800);
+ $this->assertText("Status", "AllowInput=false");
+ $this->assertCheckBoxes("RatingList", array(3), 6);
+ }
+
+ function testReadOnly()
+ {
+ // Verify we're on the right page.
+ $this->open("active-controls/index.php?page=ActiveRatingListReadOnlyTest");
+ $this->verifyTextPresent("TActiveRatingList ReadOnly Test Case");
+ $this->assertText("Status", "ReadOnly=true");
+ $this->assertCheckBoxes("RatingList", array(0), 6);
+
+ $this->clickTD("RatingList_c4");
+ $this->pause(800);
+ $this->assertText("Status", "ReadOnly=true");
+ $this->assertCheckBoxes("RatingList", array(0), 6);
+
+ // Then set ReadOnly to false, and make sure it works.
+ $this->click("Writable");
+ $this->pause(800);
+ $this->assertText("Status", "ReadOnly=false");
+ $this->assertCheckBoxes("RatingList", array(0), 6);
+
+
+ $this->clickTD("RatingList_c1");
+ $this->pause(800);
+ $this->assertText("Status", "2 : Fair");
+ $this->assertCheckBoxes("RatingList", array(1), 6);
+
+ // Then set ReadOnly to true, and make sure it doesn't work anymore.
+ $this->click("ReadOnly");
+ $this->pause(800);
+ $this->assertText("Status", "ReadOnly=true");
+ $this->assertCheckBoxes("RatingList", array(1), 6);
+
+
+ $this->clickTD("RatingList_c2");
+ $this->pause(800);
+ $this->assertText("Status", "ReadOnly=true");
+ $this->assertCheckBoxes("RatingList", array(1), 6);
+ }
+
+ function testEnabled()
+ {
+ // Verify we're on the right page.
+ $this->open("active-controls/index.php?page=ActiveRatingListEnabledTest");
+ $this->verifyTextPresent("TActiveRatingList Enabled Test Case");
+ $this->assertText("Status", "Enabled=false");
+ $this->assertCheckBoxes("RatingList", array(5), 6);
+
+ $this->clickTD("RatingList_c4");
+ $this->pause(800);
+ $this->assertText("Status", "Enabled=false");
+ $this->assertCheckBoxes("RatingList", array(5), 6);
+
+ // Then set Enable to true, and make sure it works.
+ $this->click("Enable");
+ $this->pause(800);
+ $this->assertText("Status", "Enabled=true");
+ $this->assertCheckBoxes("RatingList", array(5), 6);
+
+
+ $this->clickTD("RatingList_c3");
+ $this->pause(800);
+ $this->assertText("Status", "4 : Good");
+ $this->assertCheckBoxes("RatingList", array(3), 6);
+
+ // Then set Enable to false, and make sure it doesn't work anymore.
+ $this->click("Disable");
+ $this->pause(800);
+ $this->assertText("Status", "Enabled=false");
+ $this->assertCheckBoxes("RatingList", array(3), 6);
+
+
+ $this->clickTD("RatingList_c5");
+ $this->pause(800);
+ $this->assertText("Status", "Enabled=false");
+ $this->assertCheckBoxes("RatingList", array(3), 6);
+ }
+
+ function testHoverCaption()
+ {
+ // Verify we're on the right page.
+ $this->open("active-controls/index.php?page=ActiveRatingListHoverCaptionTest");
+ $this->verifyTextPresent("TActiveRatingList Hover Caption Test Case");
+ $this->assertText("Status", "CaptionID='Status'");
+ $this->assertElementPresent("//input[@id='RatingList_c0']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c1']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating_half')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c4']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating')]");
+
+ $this->mouseOver("//input[@id='RatingList_c4']/../../");
+ $this->assertText("Status", "Excellent");
+ $this->assertElementPresent("//input[@id='RatingList_c0']/../..[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c1']/../..[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c4']/../..[contains(@class, 'rating_hover')]");
+ $this->assertElementNotPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating_hover')]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating')]");
+
+ $this->mouseOut("//input[@id='RatingList_c4']/../../");
+ $this->assertText("Status", "CaptionID='Status'");
+ $this->assertElementPresent("//input[@id='RatingList_c0']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c1']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementNotPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c4']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating')]");
+
+
+ $this->mouseOver("//input[@id='RatingList_c1']/../../");
+ $this->assertText("Status", "Fair");
+
+ $this->click("//input[@id='RatingList_c1']/../../");
+ $this->pause(800);
+ $this->assertText("Status", "2 : Fair");
+ $this->assertElementPresent("//input[@id='RatingList_c0']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c1']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementNotPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating_selected')]");
+ $this->assertElementPresent("//input[@id='RatingList_c2']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c3']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c4']/../..[contains(@class, 'rating')]");
+ $this->assertElementPresent("//input[@id='RatingList_c5']/../..[contains(@class, 'rating')]");
+ }
+
+ function clickTD($clientID){
+ $this->click("//input[@id='{$clientID}']/../..");
+ }
+
+ function assertCheckBoxes($clientID, $checks, $total = 5)
+ {
+ for($i = 0; $i < $total; $i++)
+ {
+ if(in_array($i, $checks))
+ $this->assertChecked("{$clientID}_c{$i}");
+ else
+ $this->assertNotChecked("{$clientID}_c{$i}");
+ }
+ }
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/application.xml b/tests/FunctionalTests/tickets/protected/application.xml
index 29273a2f..113b8455 100644
--- a/tests/FunctionalTests/tickets/protected/application.xml
+++ b/tests/FunctionalTests/tickets/protected/application.xml
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<application id="TicketTests" Mode="Debug">
<modules>
- <module id="friendly-url" class="System.Web.TUrlMapping">
+ <module id="friendly-url" class="System.Web.TUrlMapping" EnableCustomUrl="True">
<url ServiceID="testService" ServiceParameter="ticket653" pattern="/ticket653/?" />
+ <url ServiceParameter="Ticket922" pattern="/ticket922/{text}" parameters.text=".*" />
</module>
<module id="request" class="THttpRequest" UrlManager="friendly-url"/>
</modules>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php b/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php
index 892bdc87..da6ad153 100644
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php
@@ -2,6 +2,7 @@
class Ticket284Component extends TTemplateControl implements IValidatable
{
+ private $_isValid;
public function onPreRender($param)
{
if (!$this->ShowHours && $this->ShowMinutes)
@@ -90,5 +91,13 @@ class Ticket284Component extends TTemplateControl implements IValidatable
return $this->TimeStamp;
}
}
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
}
-?> \ No newline at end of file
+?>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket900.page b/tests/FunctionalTests/tickets/protected/pages/Ticket900.page
new file mode 100644
index 00000000..41c0fbc2
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket900.page
@@ -0,0 +1,45 @@
+<com:TContent ID="Content">
+
+Current Command:<com:TLabel ID="CommandName" Text="None." /><br />
+
+<com:TDataGrid
+ CellPadding="2"
+ ID="DataGrid"
+ DataKeyField="title"
+ AutoGenerateColumns="false"
+ OnEditCommand="editItem"
+ OnUpdateCommand="saveItem"
+ OnCancelCommand="cancelItem"
+ OnDeleteCommand="deleteItem"
+ >
+
+ <com:TTemplateColumn >
+ <prop:ItemTemplate>
+ <com:TLabel Text=<%# $this->Parent->Data['title']%>/>
+ </prop:ItemTemplate>
+ <prop:EditItemTemplate>
+ <com:TTextBox ID="TextBox" Text=<%# $this->Parent->Data['title']%>/>
+ <com:TRequiredFieldValidator
+ ControlToValidate="TextBox"
+ ErrorMessage="*"
+ Text="Field required."/>
+ </prop:EditItemTemplate>
+ </com:TTemplateColumn>
+ <com:TEditCommandColumn
+ ButtonType="ImageButton"
+ HeaderText="Edit"
+ EditText="Edit"
+ UpdateText="Save"
+ CancelText="Cancel"
+ />
+ <com:TButtonColumn
+ ID="DeleteColumn"
+ HeaderText="Delete"
+ HeaderStyle.Width="50px"
+ ItemStyle.HorizontalAlign="Center"
+ ItemStyle.Font.Italic="false"
+ Text="Delete"
+ CommandName="delete"
+ />
+</com:TDataGrid>
+</com:TContent>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket900.php b/tests/FunctionalTests/tickets/protected/pages/Ticket900.php
new file mode 100644
index 00000000..21e87f67
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket900.php
@@ -0,0 +1,58 @@
+<?php
+class Ticket900 extends TPage {
+
+ public function onLoad($param)
+ {
+ parent::onLoad($param);
+ if(!$this->IsPostBack)
+ {
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+ }
+
+
+ protected function getData()
+ {
+ return array(
+ array( 'title' => 'Title A'),
+ array( 'title' => 'Title B'),
+ array( 'title' => 'Title C')
+ );
+ }
+
+
+ public function editItem($sender,$param)
+ {
+ $this->CommandName->Text='edit';
+ $this->DataGrid->EditItemIndex=$param->Item->ItemIndex;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function saveItem($sender,$param)
+ {
+ $this->CommandName->Text='save';
+ $this->DataGrid->EditItemIndex=-1;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function cancelItem($sender,$param)
+ {
+ $this->CommandName->Text='cancel';
+ $this->DataGrid->EditItemIndex=-1;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+ public function deleteItem($sender,$param)
+ {
+ $this->CommandName->Text='delete';
+ $this->DataGrid->EditItemIndex=-1;
+ $this->DataGrid->DataSource=$this->Data;
+ $this->DataGrid->dataBind();
+ }
+
+}
+?>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket922.page b/tests/FunctionalTests/tickets/protected/pages/Ticket922.page
new file mode 100644
index 00000000..87932680
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket922.page
@@ -0,0 +1,12 @@
+<com:TContent ID="Content">
+
+<h1>Problem with TUrlMapping and urlencoding</h1>
+
+Enter a string with spaces that will be used as URL parameter
+<com:TTextBox ID="Text" />
+<com:TButton Text="Perform redirect" OnClick="processString" />
+
+<br />
+Decoded String:
+<com:TLabel ID="Result" />
+</com:TContent>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket922.php b/tests/FunctionalTests/tickets/protected/pages/Ticket922.php
new file mode 100644
index 00000000..52d4e411
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket922.php
@@ -0,0 +1,13 @@
+<?php
+class Ticket922 extends TPage {
+ public function processString($sender,$param) {
+ $text = $this->Text->Text;
+ $url= $this->getService()->constructUrl('Ticket922', array('text'=>$text));
+ $this->getResponse()->redirect($url);
+ }
+
+ public function onLoad($param) {
+ if ($this->Request->contains('text'))
+ $this->Result->setText($this->Request->itemAt('text'));
+ }
+}
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket925.page b/tests/FunctionalTests/tickets/protected/pages/Ticket925.page
new file mode 100755
index 00000000..cdb1e0fe
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket925.page
@@ -0,0 +1,11 @@
+<com:TContent ID="Content">
+ <com:TTimeTriggeredCallback id="timer1" Interval="2" OnCallback="timer1callback"/>
+ <com:TTimeTriggeredCallback id="timer2" Interval="1" OnCallback="timer2callback" StartTimerOnLoad="true"/>
+ Timer 1 : <com:TActiveLabel id="timer1result"/><br/>
+ Timer 2 : <com:TActiveLabel id="timer2result"/><br/>
+ <com:TActiveButton OnClick="startTimer1" Text="Start Timer1"/>
+ <com:TActiveButton OnClick="stopTimer1" Text="Stop Timer1"/>
+ <com:TActiveButton OnClick="startTimer2" Text="Start Timer2"/>
+ <com:TActiveButton OnClick="stopTimer2" Text="Stop Timer2"/>
+ <com:TActiveButton OnClick="changeIntervalTimer1" Text="Change Interval of Timer1 to 1 sec"/>
+</com:TContent> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket925.php b/tests/FunctionalTests/tickets/protected/pages/Ticket925.php
new file mode 100755
index 00000000..0284bd66
--- /dev/null
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket925.php
@@ -0,0 +1,76 @@
+<?php
+
+prado::using('System.Web.UI.ActiveControls.*');
+
+class Ticket925 extends TPage
+{
+ public function getTimer1Value()
+ {
+ return $this->getViewState('timer1', 0);
+ }
+
+ public function getTimer2Value()
+ {
+ return $this->getViewState('timer2', 0);
+ }
+
+ public function setTimer1Value($value)
+ {
+ $this->setViewState('timer1', $value, 0);
+ }
+
+ public function setTimer2Value($value)
+ {
+ $this->setViewState('timer2', $value, 0);
+ }
+
+ public function startTimer1($sender, $param)
+ {
+ $this->timer1->startTimer();
+ }
+
+ public function stopTimer1($sender, $param)
+ {
+ $this->timer1->stopTimer();
+ }
+
+ public function startTimer2($sender, $param)
+ {
+ $this->timer2->startTimer();
+ }
+
+ public function stopTimer2($sender, $param)
+ {
+ $this->timer2->stopTimer();
+ }
+
+ public function changeIntervalTimer1($sender, $param)
+ {
+ $this->timer1->setInterval(1);
+ }
+
+ public function timer1callback ($sender, $param)
+ {
+ $this->timer1result->Text .= ($this->Timer1Value+=$this->timer1->Interval).'... ';
+ if ($this->Timer1Value > 20)
+ {
+ $this->timer1Value=0;
+ $this->timer1result->Text='';
+ $this->timer1->stopTimer();
+ }
+
+ }
+
+ public function timer2callback ($sender, $param)
+ {
+ $this->timer2result->Text .= ($this->Timer2Value+=$this->timer2->Interval).'... ';
+ if ($this->Timer2Value > 20)
+ {
+ $this->timer2Value=0;
+ $this->timer2result->Text='';
+ $this->timer2->stopTimer();
+ }
+ }
+
+}
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php
index e2487f25..4321bd67 100644
--- a/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php
+++ b/tests/FunctionalTests/tickets/tests/Ticket595TestCase.php
@@ -18,7 +18,7 @@ class Ticket595TestCase extends SeleniumTestCase
$this->type($base.'A', 'test@pradosoft.com');
$this->click($base.'ctl2');
$this->pause(800);
- $this->assertAttribute($base.'A@class','');
+ $this->assertAttribute($base.'A@class','null');
$this->click($base.'ctl5');
@@ -33,7 +33,7 @@ class Ticket595TestCase extends SeleniumTestCase
$this->type($base.'B', 'test@pradosoft.com');
$this->click($base.'ctl5');
$this->pause(800);
- $this->assertAttribute($base.'B@class','');
+ $this->assertAttribute($base.'B@class','null');
}
}
?>
diff --git a/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php
new file mode 100644
index 00000000..b80e1187
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php
@@ -0,0 +1,19 @@
+<?php
+
+class Ticket900TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Ticket900');
+ $this->assertTitle("Verifying Ticket 900");
+ $base = 'ctl0_Content_';
+
+ $this->clickAndWait('ctl0$Content$DataGrid$ctl1$ctl3');
+ $this->type($base.'DataGrid_ctl1_TextBox', '');
+ $this->click($base.'DataGrid_ctl1_ctl3');
+ $this->clickAndWait('ctl0$Content$DataGrid$ctl1$ctl4');
+ $this->assertText($base.'CommandName', 'cancel');
+ }
+}
+
+?>
diff --git a/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php
new file mode 100644
index 00000000..8420c10d
--- /dev/null
+++ b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php
@@ -0,0 +1,18 @@
+<?php
+
+class Ticket922TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Ticket922');
+ $this->assertTitle("Verifying Ticket 922");
+ $base = 'ctl0_Content_';
+
+ $this->type($base.'Text', 'two words');
+ $this->clickAndWait('ctl0$Content$ctl0');
+ $this->assertText($base.'Result','two words');
+
+ }
+}
+
+?>