Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • AbstractControl_CodeGenerator
  • AjaxTimingForm
  • BasicForm
  • BasicOrmTests
  • BBCodeParser
  • CacheTests
  • CalculatorForm
  • CalculatorWidget
  • ComplexColumn
  • DataRepeaterExample
  • Event
  • ExampleCheckColumn1
  • ExampleCheckColumn2
  • ExampleForm
  • Examples
  • ExampleService
  • ExamplesForm
  • ExampleSingleForm
  • ExpandAsArrayTests
  • HtmlJqDoc
  • InjectForm
  • JavaScriptHelper
  • JqAttributes
  • JqControlGen
  • JqDoc
  • JqIcon
  • Method
  • ModelConnectorTests
  • MyControl
  • MyQSlider_ChangeEvent
  • NavPanel
  • NestedTabForm
  • Option
  • Order
  • PaginatorForm
  • ParamsForm
  • PersistentExampleForm
  • PersonEditPanel
  • PluginEditForm
  • PluginManagerForm
  • Project
  • ProjectEditPanel
  • ProjectListForm
  • ProjectPickerListBox
  • ProjectViewPanel
  • QAbstractCacheProvider
  • QAbstractHtmlTableColumn
  • QAbstractHtmlTableDataColumn
  • QAccordion
  • QAccordion_ActivateEvent
  • QAccordion_BeforeActivateEvent
  • QAccordion_CreateEvent
  • QAccordionBase
  • QAccordionGen
  • QAction
  • QActionControl
  • QAjaxAction
  • QAjaxControlAction
  • QAjaxResponse
  • QAlertAction
  • QApplication
  • QApplicationBase
  • QArchive
  • QAutocomplete
  • QAutocomplete_ChangeEvent
  • QAutocomplete_CloseEvent
  • QAutocomplete_CodeGenerator
  • QAutocomplete_CreateEvent
  • QAutocomplete_FocusEvent
  • QAutocomplete_OpenEvent
  • QAutocomplete_ResponseEvent
  • QAutocomplete_SearchEvent
  • QAutocomplete_SelectEvent
  • QAutocomplete_SourceEvent
  • QAutocompleteBase
  • QAutocompleteBase_CodeGenerator
  • QAutocompleteGen
  • QAutocompleteListItem
  • QBackspaceKeyEvent
  • QBaseClass
  • QBlockControl
  • QBlurControlAction
  • QBlurEvent
  • QBorderCollapse
  • QBorderStyle
  • QBrowserType
  • QButton
  • QButtonBase
  • QCache
  • QCacheDeleteAction
  • QCacheDeleteAllAction
  • QCacheProviderAPC
  • QCacheProviderLocalMemory
  • QCacheProviderLocalMemoryTest
  • QCacheProviderMemcache
  • QCacheProviderNoCache
  • QCacheProviderProxy
  • QCacheSetAction
  • QCalendar
  • QCalendarType
  • QCallType
  • QCausesValidation
  • QCellClickEvent
  • QChangeEvent
  • QCheckBox
  • QCheckBox_CodeGenerator
  • QCheckBoxBase_CodeGenerator
  • QCheckBoxLegacyColumn
  • QCheckBoxList
  • QCheckBoxList_CodeGenerator
  • QCheckBoxListBase_CodeGenerator
  • QClickEvent
  • QCodeGen
  • QCodeGenBase
  • QConfirmAction
  • QContextMenuEvent
  • QControl
  • QControl_CodeGenerator
  • QControlBase
  • QControlBase_CodeGenerator
  • QControlBaseTests
  • QControlCategoryType
  • QControlGrouping
  • QControlLabel
  • QControlProxy
  • QConvertNotation
  • QConvertNotationBase
  • QCrossScripting
  • QCryptography
  • QCss
  • QCssAction
  • QCssClassAction
  • QCssTests
  • QCsvTextBox
  • QCursor
  • QDatabaseBase
  • QDatabaseCodeGen
  • QDatabaseFieldBase
  • QDatabaseFieldType
  • QDatabaseForeignKey
  • QDatabaseIndex
  • QDatabaseResultBase
  • QDatabaseRowBase
  • QDatabaseTests
  • QDataGrid
  • QDataGrid_CheckBoxColumn
  • QDataGrid_CodeGenerator
  • QDataGrid_SortEvent
  • QDataGridBase
  • QDataGridBase_CodeGenerator
  • QDataGridLegacy
  • QDataGridLegacyBase
  • QDataGridLegacyColumn
  • QDataGridLegacyRow
  • QDataGridLegacyRowStyle
  • QDataRepeater
  • QDatepicker
  • QDatepicker_BeforeShowDayEvent
  • QDatepicker_BeforeShowEvent
  • QDatepicker_CalculateWeekEvent
  • QDatepicker_ChangeMonthYearEvent
  • QDatepicker_CloseEvent
  • QDatepicker_SelectEvent
  • QDatepicker_SelectEvent2
  • QDatepickerBase
  • QDatepickerBox
  • QDatepickerBox_BeforeShowDayEvent
  • QDatepickerBox_BeforeShowEvent
  • QDatepickerBox_CalculateWeekEvent
  • QDatepickerBox_ChangeMonthYearEvent
  • QDatepickerBox_CloseEvent
  • QDatepickerBox_CodeGenerator
  • QDatepickerBox_SelectEvent
  • QDatepickerBoxBase
  • QDatepickerBoxBase_CodeGenerator
  • QDatepickerBoxGen
  • QDatepickerGen
  • QDateTime
  • QDateTimePicker
  • QDateTimePicker_CodeGenerator
  • QDateTimePickerBase_CodeGenerator
  • QDateTimePickerFormat
  • QDateTimePickerType
  • QDateTimeSpan
  • QDateTimeTests
  • QDateTimeTextBox
  • QDbBackedFormStateHandler
  • QDbBackedSessionHandler
  • QDialog
  • QDialog_BeforeCloseEvent
  • QDialog_ButtonEvent
  • QDialog_CloseEvent
  • QDialog_CreateEvent
  • QDialog_DragEvent
  • QDialog_DragStartEvent
  • QDialog_DragStopEvent
  • QDialog_FocusEvent
  • QDialog_OpenEvent
  • QDialog_ResizeEvent
  • QDialog_ResizeStartEvent
  • QDialog_ResizeStopEvent
  • QDialogBase
  • QDialogBox
  • QDialogGen
  • QDisplayStyle
  • QDoubleClickEvent
  • QDownArrowKeyEvent
  • QDragDropEvent
  • QDraggable
  • QDraggable_CreateEvent
  • QDraggable_DragEvent
  • QDraggable_StartEvent
  • QDraggable_StopEvent
  • QDraggableBase
  • QDraggableGen
  • QDroppable
  • QDroppable_ActivateEvent
  • QDroppable_CreateEvent
  • QDroppable_DeactivateEvent
  • QDroppable_DropEvent
  • QDroppable_OutEvent
  • QDroppable_OverEvent
  • QDroppableBase
  • QDroppableGen
  • QDropZoneGrouping
  • QEmailAttachment
  • QEmailMessage
  • QEmailServer
  • QEmailStringAttachment
  • QEmailTextBox
  • QEnterKeyEvent
  • QErrorAttribute
  • QEscapeKeyEvent
  • QEvent
  • QFieldset
  • QFile
  • QFileAsset
  • QFileAssetBase
  • QFileAssetDialog
  • QFileAssetType
  • QFileControl
  • QFileFormStateHandler
  • QFilterType
  • QFloatTextBox
  • QFloatTextBox_CodeGenerator
  • QFloatTextBoxBase_CodeGenerator
  • QFocusControlAction
  • QFocusEvent
  • QFocusInEvent
  • QFocusOutEvent
  • QFolder
  • QFontFamily
  • QForm
  • QFormBase
  • QFormGen
  • QFormStateHandler
  • QGridLines
  • QHideCalendarAction
  • QHideDialog
  • QHideDialogBox
  • QHListControl
  • QHListItem
  • QHorizontalAlign
  • QHtml
  • QHtmlAttributeManager
  • QHtmlAttributeManagerBase
  • QHtmlReporter
  • QHtmlTable
  • QHtmlTable_CodeGenerator
  • QHtmlTableBase
  • QHtmlTableCallableColumn
  • QHtmlTableCheckBoxColumn
  • QHtmlTableCheckBoxColumn_ClickEvent
  • QHtmlTableIndexedColumn
  • QHtmlTableLinkColumn
  • QHtmlTableNodeColumn
  • QHtmlTablePropertyColumn
  • QI18n
  • QI18nTests
  • QImageBase
  • QImageBrowser
  • QImageBrowserBase
  • QImageBrowserNav
  • QImageBrowserThumbnails
  • QImageButton
  • QImageControl
  • QImageControlBase
  • QImageFileAsset
  • QImageLabel
  • QImageLabelBase
  • QImageRollover
  • QImageType
  • QIndex
  • QInformixPdoDatabase
  • QInformixPdoDatabaseField
  • QInformixPdoDatabaseResult
  • QInformixPdoDatabaseRow
  • QInputEvent
  • QInstallationValidationResult
  • QInstallationValidator
  • QIntegerTextBox
  • QIntegerTextBox_CodeGenerator
  • QIntegerTextBoxBase_CodeGenerator
  • QJavaScriptAction
  • QJQAction
  • QJQBounceAction
  • QJqButton
  • QJqButton_CreateEvent
  • QJqButtonBase
  • QJqButtonGen
  • QJqCheckBox
  • QJqCheckBox_CreateEvent
  • QJqCheckBoxBase
  • QJqCheckBoxGen
  • QJQHideAction
  • QJQHideEffectAction
  • QJQHighlightAction
  • QJQPulsateAction
  • QJqRadioButton
  • QJqRadioButton_CreateEvent
  • QJqRadioButtonBase
  • QJqRadioButtonGen
  • QJQShakeAction
  • QJQShowAction
  • QJQShowEffectAction
  • QJQSizeAction
  • QJQToggleAction
  • QJQToggleEffectAction
  • QJQTransferAction
  • QJqUiEvent
  • QJqUiPropertyEvent
  • QJsClosure
  • QJsFunction
  • QJsNoQuoteKey
  • QJsParameterList
  • QJsPriority
  • QJsTimer
  • QJsTimerBase
  • QJsVarName
  • QKeyDownEvent
  • QKeyPressEvent
  • QKeyUpEvent
  • QLabel
  • QLabel_CodeGenerator
  • QLabelBase_CodeGenerator
  • QLexer
  • QLinkButton
  • QListBox
  • QListBox_CodeGenerator
  • QListBoxBase
  • QListBoxBase_CodeGenerator
  • QListControl
  • QListControl_CodeGenerator
  • QListControlBase_CodeGenerator
  • QListItem
  • QListItemBase
  • QListItemStyle
  • QManyToManyReference
  • QMenu
  • QMenu_BlurEvent
  • QMenu_CreateEvent
  • QMenu_FocusEvent
  • QMenu_SelectEvent
  • QMenuBase
  • QMenuGen
  • QMimeType
  • QModelConnectorArgumentType
  • QModelConnectorCreateType
  • QModelConnectorEditDlg
  • QModelConnectorOptions
  • QModelConnectorParam
  • QMouseDownEvent
  • QMouseEnterEvent
  • QMouseLeaveEvent
  • QMouseMoveEvent
  • QMouseOutEvent
  • QMouseOverEvent
  • QMouseUpEvent
  • QMultiLevelCacheProvider
  • QMySqlDatabase
  • QMySqlDatabaseField
  • QMySqlDatabaseResult
  • QMySqli5ClusterDatabase
  • QMySqli5Database
  • QMySqli5DatabaseField
  • QMySqli5DatabaseResult
  • QMySqliDatabase
  • QMySqliDatabaseField
  • QMySqliDatabaseResult
  • QMySqliDatabaseRow
  • QNoScriptAjaxAction
  • QNumericTextBox
  • QOnEvent
  • QOracleDatabase
  • QOracleDatabaseField
  • QOracleDatabaseResult
  • QOracleDatabaseRow
  • QOrderedListType
  • QOverflow
  • QPaginatedControl
  • QPaginator
  • QPaginatorBase
  • QPanel
  • QPartialQueryBuilder
  • QPdoDatabase
  • QPdoDatabaseResult
  • QPgConditionILike
  • QPgConditionJsonContains
  • QPgQ
  • QPosition
  • QPostgreSqlDatabase
  • QPostgreSqlDatabaseField
  • QPostgreSqlDatabaseResult
  • QPostgreSqlDatabaseRow
  • QPostgreSqlPdoDatabase
  • QPostgreSqlPdoDatabaseField
  • QPostgreSqlPdoDatabaseResult
  • QPostgreSqlPdoDatabaseRow
  • QProgressbar
  • QProgressbar_ChangeEvent
  • QProgressbar_CompleteEvent
  • QProgressbar_CreateEvent
  • QProgressbarBase
  • QProgressbarGen
  • QQ
  • QQAggregationClause
  • QQAliasTests
  • QQAssociationNode
  • QQAverage
  • QQClause
  • QQColumnNode
  • QQCondition
  • QQConditionAll
  • QQConditionAnd
  • QQConditionBetween
  • QQConditionComparison
  • QQConditionEqual
  • QQConditionExists
  • QQConditionGreaterOrEqual
  • QQConditionGreaterThan
  • QQConditionIn
  • QQConditionIsNotNull
  • QQConditionIsNull
  • QQConditionLessOrEqual
  • QQConditionLessThan
  • QQConditionLike
  • QQConditionLogical
  • QQConditionNone
  • QQConditionNot
  • QQConditionNotBetween
  • QQConditionNotEqual
  • QQConditionNotExists
  • QQConditionNotIn
  • QQConditionNotLike
  • QQConditionOr
  • QQCount
  • QQDistinct
  • QQExpand
  • QQExpandAsArray
  • QQExpandVirtualNode
  • QQFuncTests
  • QQFunctionNode
  • QQGroupBy
  • QQHavingClause
  • QQLimitInfo
  • QQMathNode
  • QQMathOpTests
  • QQMaximum
  • QQMinimum
  • QQNamedValue
  • QQNode
  • QQNoParentNode
  • QQOrderBy
  • QQReverseReferenceNode
  • QQSelect
  • QQSubQueryCountNode
  • QQSubQueryNode
  • QQSubQuerySqlNode
  • QQSum
  • QQTableNode
  • QQuery
  • QQueryBuilder
  • QQueryExpansion
  • QQVirtualNode
  • QRadioButton
  • QRadioButtonList
  • QRadioButtonList_CodeGenerator
  • QRadioButtonListBase_CodeGenerator
  • QRedirectAction
  • QReference
  • QRegex
  • QRegisterClickPositionAction
  • QRepeatDirection
  • QRequestMode
  • QResetTimerAction
  • QResizable
  • QResizable_CreateEvent
  • QResizable_ResizeEvent
  • QResizable_StartEvent
  • QResizable_StopEvent
  • QResizableBase
  • QResizableGen
  • QResizeHandleDirection
  • QRestServiceCodeGen
  • QReverseReference
  • QRssCategory
  • QRssFeed
  • QRssImage
  • QRssItem
  • QSampleControl
  • QSampleTranslation
  • QSelectable
  • QSelectable_CreateEvent
  • QSelectable_SelectedEvent
  • QSelectable_SelectingEvent
  • QSelectable_StartEvent
  • QSelectable_StopEvent
  • QSelectable_UnselectedEvent
  • QSelectable_UnselectingEvent
  • QSelectableBase
  • QSelectableGen
  • QSelectControlAction
  • QSelectEvent
  • QSelectionMode
  • QSelectMenu
  • QSelectMenu_ChangeEvent
  • QSelectMenu_CloseEvent
  • QSelectMenu_CreateEvent
  • QSelectMenu_FocusEvent
  • QSelectMenu_OpenEvent
  • QSelectMenu_SelectEvent
  • QSelectMenuBase
  • QSelectMenuGen
  • QServerAction
  • QServerControlAction
  • QSessionFormStateHandler
  • QSetValueAction
  • QShowCalendarAction
  • QShowDialog
  • QShowDialogBox
  • QSlider
  • QSlider_ChangeEvent
  • QSlider_CodeGenerator
  • QSlider_CreateEvent
  • QSlider_SlideEvent
  • QSlider_StartEvent
  • QSlider_StopEvent
  • QSliderBase
  • QSliderBase_CodeGenerator
  • QSliderGen
  • QSoapMethod
  • QSoapParameter
  • QSoapService
  • QSortable
  • QSortable_ActivateEvent
  • QSortable_BeforeStopEvent
  • QSortable_ChangeEvent
  • QSortable_CreateEvent
  • QSortable_DeactivateEvent
  • QSortable_OutEvent
  • QSortable_OverEvent
  • QSortable_ReceiveEvent
  • QSortable_RemoveEvent
  • QSortable_SortEvent
  • QSortable_StartEvent
  • QSortable_StopEvent
  • QSortable_UpdateEvent
  • QSortableBase
  • QSortableGen
  • QSpinner
  • QSpinner_ChangeEvent
  • QSpinner_CreateEvent
  • QSpinner_SpinEvent
  • QSpinner_StartEvent
  • QSpinner_StopEvent
  • QSpinnerBase
  • QSpinnerGen
  • QSqlColumn
  • QSqLite3PdoDatabase
  • QSqLite3PdoDatabaseField
  • QSqLite3PdoDatabaseResult
  • QSqLite3PdoDatabaseRow
  • QSqlServer2005Database
  • QSqlServer2005DatabaseField
  • QSqlServer2005DatabaseResult
  • QSqlServer2005DatabaseRow
  • QSqlServerDatabase
  • QSqlServerDatabaseField
  • QSqlServerDatabaseResult
  • QSqlServerDatabaseRow
  • QSqlTable
  • QStack
  • QStopPropagationAction
  • QString
  • QStringTest
  • QTabKeyEvent
  • QTabs
  • QTabs_ActivateEvent
  • QTabs_BeforeActivateEvent
  • QTabs_BeforeLoadEvent
  • QTabs_CreateEvent
  • QTabs_LoadEvent
  • QTabsBase
  • QTabsGen
  • QTag
  • QTagStyler
  • QTerminateAction
  • QTestControl
  • QTestForm
  • QTextAlign
  • QTextBox
  • QTextBox_CodeGenerator
  • QTextBoxBase
  • QTextBoxBase_CodeGenerator
  • QTextMode
  • QTimer
  • QTimerExpiredEvent
  • QTimerTests
  • QToggleCssClassAction
  • QToggleDisplayAction
  • QToggleEnableAction
  • QTranslationPoParser
  • QTreeNav
  • QTreeNavItem
  • QType
  • QTypeTable
  • QTypeTests
  • QUnitTestCaseBase
  • QUnorderedListStyle
  • QUpArrowKeyEvent
  • QUrlTextBox
  • QVerticalAlign
  • QVirtualAttributeColumn
  • QWaitIcon
  • QWatcher
  • QWatcherBase
  • QWatcherCache
  • QWatcherDB
  • QWatcherNone
  • QWriteBox
  • RecordsSummary
  • RefreshForm
  • SampleComposite
  • SampleForm
  • SelectableLabel
  • SelectForm
  • SpeedForm
  • TestImageBrowser
  • UrlForm

Interfaces

  • ICacheAction
  • QDataList_CodeGenerator_Interface
  • QTranslationBase

Traits

  • QDataBinder
  • QListItemManager
  • QModelTrait

Exceptions

  • QCallerException
  • QCrossScriptingException
  • QCryptographyException
  • QDatabaseExceptionBase
  • QDataBindException
  • QDateTimeNullException
  • QEmailException
  • QIndexOutOfRangeException
  • QInformixPdoDatabaseException
  • QInvalidCastException
  • QInvalidFormStateException
  • QMySqliDatabaseException
  • QOptimisticLockingException
  • QOracleDatabaseException
  • QPdoDatabaseException
  • QPoParserException
  • QPostgreSqlDatabaseException
  • QPostgreSqlPdoDatabaseException
  • QRemoteAdminDeniedException
  • QSqLite3PdoDatabaseException
  • QSqlServer2005DatabaseException
  • QSqlServerDatabaseException
  • QUndefinedMethodException
  • QUndefinedPrimaryKeyException
  • QUndefinedPropertyException

Functions

  • __database_check_error
  • __QForm_EvaluateTemplate_ObHandler
  • _b
  • _indent
  • _nl
  • _p
  • _r
  • _t
  • _tp
  • _tr
  • array_trim
  • beginsWith
  • CamelCaseFromDash
  • CastToInt
  • DataGridEvalHandleError
  • DisplayMonospacedText
  • endsWith
  • GO_BACK
  • jq_anytime_gen
  • jq_control_gen
  • jq_inc_gen
  • jq_indent
  • PrintExplainStatement
  • PrintInstructions
  • QcubedHandleCodeGenParseError
  • QcubedHandleError
  • QcubedHandleException
  • QCubedShutdown
  • QDateTimeErrorHandler
  • trimOffEnd
  • trimOffFront
  • Overview
  • Package
  • Class
  1: <?php
  2: 
  3: /**
  4:  * This controls works together with a QPaginatedControl to implement a paginator for that control. Multiple
  5:  * paginators per QPaginatedControl can be declared.
  6:  *
  7:  * @package Controls
  8:  * @property integer      $ItemsPerPage        How many items you want to display per page when Pagination is enabled
  9:  * @property integer      $PageNumber          The current page number you are viewing. 1 is the first page, there is no page zero.
 10:  * @property integer      $TotalItemCount      The total number of items in the ENTIRE recordset -- only used when Pagination is enabled
 11:  * @property boolean      $UseAjax             Whether to use ajax in the drawing.
 12:  * @property-read integer $PageCount           Current number of pages being represented
 13:  * @property mixed        $WaitIcon            The wait icon to display
 14:  * @property-read mixed   $PaginatedControl    The paginated control linked to this control
 15:  * @property integer      $IndexCount          The maximum number of page numbers to disply in the paginator
 16:  * @property string       LabelForPrevious     Label to be used for the 'Previous' link.
 17:  * @property string       LabelForNext         Label to be used for the 'Next' link.
 18:  */
 19: abstract class QPaginatorBase extends QControl {
 20:     /** @var string Label for the 'Previous' link */
 21:     protected $strLabelForPrevious;
 22:     /** @var string Label for the 'Next' link */
 23:     protected $strLabelForNext;
 24: 
 25:     // BEHAVIOR
 26:     /** @var int Default number of items per page */
 27:     protected $intItemsPerPage = 15;
 28:     /** @var int Default page number (to begin rendering with) */
 29:     protected $intPageNumber = 1;
 30:     /** @var int Default item count for the paginator */
 31:     protected $intTotalItemCount = 0;
 32:     /** @var bool Should switching the pages happen over AJAX or Server call (page reload) */
 33:     protected $blnUseAjax = true;
 34:     /** @var  QPaginatedControl The control which is going to be paginated with the paginator */
 35:     protected $objPaginatedControl;
 36:     /** @var string Default Wait Icon to be used */
 37:     protected $objWaitIcon = 'default';
 38:     /** @var int Number of index items in the paginator to display */
 39:     protected $intIndexCount = 10;
 40: 
 41: 
 42:     /** @var null|\QControlProxy  */
 43:     protected $prxPagination = null;
 44: 
 45:     // SETUP
 46:     /** @var bool  */
 47:     protected $blnIsBlockElement = false;
 48:     /** @var string The tag element inside which the paginator has to be rendered */
 49:     protected $strTag = 'span';
 50: 
 51:     //////////
 52:     // Methods
 53:     //////////
 54:     /**
 55:      * Constructor method
 56:      *
 57:      * @param QControl|QControlBase|QForm $objParentObject
 58:      * @param null|string                     $strControlId
 59:      *
 60:      * @throws Exception
 61:      * @throws QCallerException
 62:      */
 63:     public function __construct($objParentObject, $strControlId = null) {
 64:         try {
 65:             parent::__construct($objParentObject, $strControlId);
 66:         } catch (QCallerException  $objExc) {
 67:             $objExc->IncrementOffset();
 68:             throw $objExc;
 69:         }
 70: 
 71:         $this->prxPagination = new QControlProxy($this);
 72:         $this->strLabelForPrevious = QApplication::Translate('Previous');
 73:         $this->strLabelForNext = QApplication::Translate('Next');
 74: 
 75:         $this->Setup();
 76:     }
 77: 
 78:     /**
 79:      * Setup the proxy events.
 80:      */
 81:     protected function Setup() {
 82:         // Setup Pagination Events
 83:         $this->prxPagination->RemoveAllActions(QClickEvent::EventName);
 84:         if ($this->blnUseAjax) {
 85:             $this->prxPagination->AddAction(new QClickEvent(), new QAjaxControlAction($this, 'Page_Click'));
 86:         }
 87:         else {
 88:             $this->prxPagination->AddAction(new QClickEvent(), new QServerControlAction($this, 'Page_Click'));
 89:         }
 90:         $this->prxPagination->AddAction(new QClickEvent, new QTerminateAction());
 91:     }
 92: 
 93:     public function ParsePostData() {}
 94: 
 95:     /**
 96:      * Validates the control.
 97:      *
 98:      * For now, it simply returns true
 99:      *
100:      * @return bool
101:      */
102:     public function Validate() {return true;}
103: 
104:     /**
105:      * Respond to the Page_Click event
106:      *
107:      * @param string $strFormId
108:      * @param string $strControlId
109:      * @param string $strParameter
110:      */
111:     public function Page_Click($strFormId, $strControlId, $strParameter) {
112:         $this->objPaginatedControl->PageNumber = QType::Cast($strParameter, QType::Integer);
113:     }
114: 
115:     /**
116:      * Assign a paginated control to the paginator.
117:      *
118:      * @param QPaginatedControl $objPaginatedControl
119:      */
120:     public function SetPaginatedControl(QPaginatedControl $objPaginatedControl) {
121:         $this->objPaginatedControl = $objPaginatedControl;
122: 
123:         $this->UseAjax = $objPaginatedControl->UseAjax;
124:         $this->ItemsPerPage = $objPaginatedControl->ItemsPerPage;
125:         $this->PageNumber = $objPaginatedControl->PageNumber;
126:         $this->TotalItemCount = $objPaginatedControl->TotalItemCount;
127:     }
128: 
129: 
130:     /**
131:      * Renders the set of previous buttons. This would be whatever comes before the page numbers in the paginator.
132:      * This particular implementation renders a "Previous" text button, with a separator, and a Rewind button
133:      * that looks like a number followed by an ellipsis.
134:      *
135:      * @return string
136:      */
137:     protected function GetPreviousButtonsHtml () {
138:         if ($this->intPageNumber <= 1) {
139:             $strPrevious = $this->strLabelForPrevious;
140:         } else {
141:             $mixActionParameter = $this->intPageNumber - 1;
142:             $strPrevious = $this->prxPagination->RenderAsLink($this->strLabelForPrevious, $mixActionParameter, ['id'=>$this->ControlId . "_arrow_" . $mixActionParameter]);
143:         }
144: 
145:         $strToReturn = sprintf('<span class="arrow previous">%s</span><span class="break">|</span>', $strPrevious);
146: 
147:         list($intPageStart, $intPageEnd) = $this->CalcBunch();
148: 
149:         if ($intPageStart != 1) {
150:             $strToReturn .= $this->GetPageButtonHtml(1);
151:             $strToReturn .= '<span class="ellipsis">&hellip;</span>';
152:         }
153: 
154:         return $strToReturn;
155:     }
156: 
157: 
158:     /**
159:      * Return the html for a particular page button.
160:      *
161:      * @param $intIndex
162:      * @return string
163:      */
164:     protected function GetPageButtonHtml ($intIndex) {
165:         if ($this->intPageNumber == $intIndex) {
166:             $strToReturn = sprintf('<span class="selected">%s</span>', $intIndex);
167:         } else {
168:             $mixActionParameter = $intIndex;
169:             $strToReturn = $this->prxPagination->RenderAsLink($intIndex, $mixActionParameter, ['id'=>$this->ControlId . "_page_" . $mixActionParameter]);
170:             $strToReturn = sprintf('<span class="page">%s</span>',$strToReturn);
171:         }
172:         return $strToReturn;
173:     }
174: 
175:     /**
176:      * Returns the HTML for the group of buttons that come after the group of page buttons.
177:      * @return string
178:      */
179:     protected function GetNextButtonsHtml() {
180:         list($intPageStart, $intPageEnd) = $this->CalcBunch();
181: 
182:         // build it backwards
183: 
184:         $intPageCount = $this->PageCount;
185:         if ($this->intPageNumber >= $intPageCount) {
186:             $strNext = $this->strLabelForNext;
187:         } else {
188:             $mixActionParameter = $this->intPageNumber + 1;
189:             $strNext = $this->prxPagination->RenderAsLink($this->strLabelForNext, $mixActionParameter, ['id'=>$this->ControlId . "_arrow_" . $mixActionParameter]);
190:         }
191: 
192:         $strToReturn = sprintf('<span class="arrow next">%s</span>', $strNext);
193: 
194:         $strToReturn = '<span class="break">|</span>' . $strToReturn;
195: 
196:         if ($intPageEnd != $intPageCount) {
197:             $strToReturn = $this->GetPageButtonHtml($intPageCount) . $strToReturn;
198:             $strToReturn = '<span class="ellipsis">&hellip;</span>' . $strToReturn;
199:         }
200: 
201:         return $strToReturn;
202:     }
203: 
204:     /**
205:      * Returns the HTML for rendering the control
206:      *
207:      * @return string HTML for the control
208:      * @throws Exception
209:      * @throws QCallerException
210:      */
211:     public function GetControlHtml() {
212:         $this->objPaginatedControl->DataBind();
213: 
214:         $strToReturn = $this->GetPreviousButtonsHtml();
215: 
216:         list($intPageStart, $intPageEnd) = $this->CalcBunch();
217: 
218:         for ($intIndex = $intPageStart; $intIndex <= $intPageEnd; $intIndex++) {
219:             $strToReturn .= $this->GetPageButtonHtml($intIndex);
220:         }
221: 
222:         $strToReturn .= $this->GetNextButtonsHtml();
223: 
224:         $strStyle = $this->GetStyleAttributes();
225:         if ($strStyle)
226:             $strStyle = sprintf(' style="%s"', $strStyle);
227: 
228:         // Wrap the whole paginator in the main control tag
229:         $strToReturn = sprintf('<%s id="%s" %s%s>%s</%s>', $this->strTag, $this->strControlId, $strStyle, $this->RenderHtmlAttributes(), $strToReturn, $this->strTag);
230: 
231:         return $strToReturn;
232:     }
233: 
234:     /**
235:      * Calculates the start and end of the center bunch of the paginator. If the start is not 1, then we know
236:      * we need to add a first page item too. If the end of the bunch is not the last page, then we need to add a last page item.
237:      * Returns an array that has the start and end of the center bunch.
238:      * @return int[]
239:      */
240:     protected function CalcBunch() {
241:         /**
242:          * "Bunch" is defined as the collection of numbers that lies in between the pair of Ellipsis ("...")
243:          *
244:          * LAYOUT
245:          *
246:          * For IndexCount of 10
247:          * 2   213   2 (two items to the left of the bunch, and then 2 indexes, selected index, 3 indexes, and then two items to the right of the bunch)
248:          * e.g. 1 ... 5 6 *7* 8 9 10 ... 100
249:          *
250:          * For IndexCount of 11
251:          * 2   313   2
252:          *
253:          * For IndexCount of 12
254:          * 2   314   2
255:          *
256:          * For IndexCount of 13
257:          * 2   414   2
258:          *
259:          * For IndexCount of 14
260:          * 2   415   2
261:          *
262:          *
263:          *
264:          * START/END PAGE NUMBERS FOR THE BUNCH
265:          *
266:          * For IndexCount of 10
267:          * 1 2 3 4 5 6 7 8 .. 100
268:          * 1 .. 4 5 *6* 7 8 9 .. 100
269:          * 1 .. 92 93 *94* 95 96 97 .. 100
270:          * 1 .. 93 94 95 96 97 98 99 100
271:          *
272:          * For IndexCount of 11
273:          * 1 2 3 4 5 6 7 8 9 .. 100
274:          * 1 .. 4 5 6 *7* 8 9 10 .. 100
275:          * 1 .. 91 92 93 *94* 95 96 97 .. 100
276:          * 1 .. 92 93 94 95 96 97 98 99 100
277:          *
278:          * For IndexCount of 12
279:          * 1 2 3 4 5 6 7 8 9 10 .. 100
280:          * 1 .. 4 5 6 *7* 8 9 10 11 .. 100
281:          * 1 .. 90 91 92 *93* 94 95 96 97 .. 100
282:          * 1 .. 91 92 93 94 95 96 97 98 99 100
283:          *
284:          * For IndexCount of 13
285:          * 1 2 3 4 5 6 7 8 9 11 .. 100
286:          * 1 .. 4 5 6 7 *8* 9 10 11 12 .. 100
287:          * 1 .. 89 90 91 92 *93* 94 95 96 97 .. 100
288:          * 1 .. 90 91 92 93 94 95 96 97 98 99 100
289:          */
290: 
291:         $intPageCount = $this->PageCount;
292: 
293:         if ($intPageCount <= $this->intIndexCount) {
294:             // no bunches needed
295:             $intPageStart = 1;
296:             $intPageEnd = $intPageCount;
297:         } else {
298:             $intMinimumEndOfBunch = min($this->intIndexCount - 2, $intPageCount);
299:             $intMaximumStartOfBunch = max($intPageCount - $this->intIndexCount + 3, 1);
300: 
301:             $intLeftOfBunchCount = floor(($this->intIndexCount - 5) / 2);
302:             $intRightOfBunchCount = round(($this->intIndexCount - 5.0) / 2.0);
303: 
304:             $intLeftBunchTrigger = 4 + $intLeftOfBunchCount;
305:             $intRightBunchTrigger = $intMaximumStartOfBunch + round(($this->intIndexCount - 8.0) / 2.0);
306: 
307:             if ($this->intPageNumber < $intLeftBunchTrigger) {
308:                 $intPageStart = 1;
309:             } else {
310:                 $intPageStart = min($intMaximumStartOfBunch, $this->intPageNumber - $intLeftOfBunchCount);
311:             }
312: 
313:             if ($this->intPageNumber > $intRightBunchTrigger) {
314:                 $intPageEnd = $intPageCount;
315:             } else {
316:                 $intPageEnd = max($intMinimumEndOfBunch, $this->intPageNumber + $intRightOfBunchCount);
317:             }
318:         }
319:         return [$intPageStart, $intPageEnd];
320:     }
321: 
322:     /**
323:      * After adjusting the total item count, or page size, or other parameters, call this to adjust the page number
324:      * to make sure it is not off the end.
325:      */
326:     public function LimitPageNumber() {
327:         $pageCount = $this->CalcPageCount();
328:         if ($this->intPageNumber > $pageCount) {
329:             if ($pageCount <= 1) {
330:                 $this->intPageNumber = 1;
331:             } else {
332:                 $this->intPageNumber = $pageCount;
333:             }
334:         }
335:     }
336: 
337:     /**
338:      * Calculates the total number of pages for the paginator
339:      *
340:      * @return float Number of pages
341:      */
342:     public function CalcPageCount() {
343:         $intCount = (int) floor($this->intTotalItemCount / $this->intItemsPerPage) +
344:             ((($this->intTotalItemCount % $this->intItemsPerPage) != 0) ? 1 : 0);
345:         return $intCount;
346: 
347:     }
348: 
349:     /////////////////////////
350:     // Public Properties: GET
351:     /////////////////////////
352:     /**
353:      * PHP magic method to get property value
354:      *
355:      * @param string $strName Name of the property
356:      *
357:      * @return bool|float|int|mixed|string
358:      *
359:      * @throws Exception
360:      * @throws QCallerException
361:      */
362:     public function __get($strName) {
363:         switch ($strName) {
364:             // BEHAVIOR
365:             case "ItemsPerPage": return $this->intItemsPerPage;
366:             case "PageNumber": return $this->intPageNumber;
367:             case "TotalItemCount": return $this->intTotalItemCount;
368:             case "UseAjax": return $this->blnUseAjax;
369:             case "PageCount":
370:                 return $this->CalcPageCount();
371:             case 'WaitIcon':
372:                 return $this->objWaitIcon;
373:             case "PaginatedControl":
374:                 return $this->objPaginatedControl;
375:             case 'IndexCount':
376:                 return $this->intIndexCount;
377:             case 'LabelForNext':
378:                 return $this->strLabelForNext;
379:             case 'LabelForPrevious':
380:                 return $this->strLabelForPrevious;
381:             default:
382:                 try {
383:                     return parent::__get($strName);
384:                 } catch (QCallerException $objExc) {
385:                     $objExc->IncrementOffset();
386:                     throw $objExc;
387:                 }
388:         }
389:     }
390: 
391: 
392:     /////////////////////////
393:     // Public Properties: SET
394:     /////////////////////////
395:     /**
396:      * PHP magic method to set the value of property of class
397:      *
398:      * @param string $strName
399:      * @param string $mixValue
400:      *
401:      * @return mixed|void
402:      *
403:      * @throws Exception
404:      * @throws QCallerException
405:      * @throws QInvalidCastException
406:      */
407:     public function __set($strName, $mixValue) {
408:         $this->blnModified = true;
409: 
410:         switch ($strName) {
411:             // BEHAVIOR
412:             case "ItemsPerPage":
413:                 try {
414:                     if ($mixValue > 0)
415:                         return ($this->intItemsPerPage = QType::Cast($mixValue, QType::Integer));
416:                     else
417:                         return ($this->intItemsPerPage = 10);
418:                     break;
419:                 } catch (QInvalidCastException $objExc) {
420:                     $objExc->IncrementOffset();
421:                     throw $objExc;
422:                 }
423: 
424:             case "PageNumber":
425:                 try {
426:                     $intNewPageNum = QType::Cast($mixValue, QType::Integer);
427:                 } catch (QInvalidCastException $objExc) {
428:                     $objExc->IncrementOffset();
429:                     throw $objExc;
430:                 }
431:                 if ($intNewPageNum > 1) {
432:                     return ($this->intPageNumber = $intNewPageNum);
433:                 } else {
434:                     return ($this->intPageNumber = 1);
435:                 }
436:                 break;
437: 
438:             case "TotalItemCount":
439:                 try {
440:                     if ($mixValue > 0) {
441:                         $this->intTotalItemCount = QType::Cast($mixValue, QType::Integer);
442:                     }
443:                     else {
444:                         $this->intTotalItemCount = 0;
445:                     }
446:                     $this->LimitPageNumber();
447:                     return $this->intTotalItemCount;
448:                     break;
449:                 } catch (QInvalidCastException $objExc) {
450:                     $objExc->IncrementOffset();
451:                     throw $objExc;
452:                 }
453: 
454:             case "UseAjax":
455:                 try {
456:                     $blnToReturn = ($this->blnUseAjax = QType::Cast($mixValue, QType::Boolean));
457:                 } catch (QInvalidCastException $objExc) {
458:                     $objExc->IncrementOffset();
459:                     throw $objExc;
460:                 }
461: 
462:                 // Because we are switching to/from Ajax, we need to reset the events
463:                 $this->Setup();
464: 
465:                 return $blnToReturn;
466: 
467:             case 'WaitIcon':
468:                 try {
469:                     $mixToReturn = $this->objWaitIcon = $mixValue;
470:                     //ensure we update our ajax action to use it
471:                     $this->Setup();
472:                     return $mixToReturn;
473:                 } catch (QCallerException $objExc) {
474:                     $objExc->IncrementOffset();
475:                     throw $objExc;
476:                 }
477: 
478:             case 'IndexCount':
479:                 $this->intIndexCount = QType::Cast($mixValue, QType::Integer);
480:                 if ($this->intIndexCount < 7)
481:                     throw new QCallerException('Paginator must have an IndexCount >= 7');
482:                 return $this->intIndexCount;
483: 
484:             case 'LabelForNext':
485:                 try {
486:                     return ($this->strLabelForNext = QType::Cast($mixValue, QType::String));
487:                 } catch (QCallerException $objExc) {
488:                     $objExc->IncrementOffset();
489:                     throw $objExc;
490:                 }
491:             case 'LabelForPrevious':
492:                 try {
493:                     return ($this->strLabelForPrevious = QType::Cast($mixValue, QType::String));
494:                 } catch (QCallerException $objExc) {
495:                     $objExc->IncrementOffset();
496:                     throw $objExc;
497:                 }
498: 
499:             default:
500:                 try {
501:                     return (parent::__set($strName, $mixValue));
502:                 } catch (QCallerException $objExc) {
503:                     $objExc->IncrementOffset();
504:                     throw $objExc;
505:                 }
506:                 break;
507:         }
508:     }
509: }
510: 
API documentation generated by ApiGen