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:      * This file contains the QImageBase class.
  4:      *
  5:      * @package Controls
  6:      */
  7: 
  8:     /**
  9:      * @package Controls
 10:      *
 11:      * @property string $CacheFolder
 12:      * @property string $CacheFilename
 13:      * @property string $AlternateText
 14:      * @property string $ImageType
 15:      * @property integer $JpegQuality
 16:      */
 17:     abstract class QImageBase extends QControl {
 18:         ///////////////////////////
 19:         // Private Member Variables
 20:         ///////////////////////////
 21: 
 22:         // APPEARANCE
 23:         protected $strAlternateText;
 24:         protected $strImageType = QImageType::Png;
 25:         protected $intJpegQuality = 100;
 26: 
 27:         // CacheFolder Location for Cached Generated Images (if applicable)
 28:         protected $strCacheFolder = null;
 29:         protected $strCacheFilename = null;
 30: 
 31:         // Internally Used
 32:         protected $strCachedActualFilePath = null;
 33:         protected $strControlClassName = 'QImageBase';
 34:         protected $strImagickTempFilePath = '/tmp';
 35: 
 36:         //////////
 37:         // Methods
 38:         //////////
 39:         public function ParsePostData() {}
 40: 
 41:         /**
 42:          * Validates the control. For now, just returns true (since there is nothing to validate in the control)
 43:          * @return bool
 44:          */
 45:         public function Validate() {return true;}
 46: 
 47:         /**
 48:          * Constructor method
 49:          *
 50:          * @param QControl|QControlBase|QForm $objParentObject
 51:          * @param null|string                        $strControlId
 52:          *
 53:          * @throws Exception
 54:          * @throws QCallerException
 55:          */
 56:         public function __construct($objParentObject, $strControlId = null) {
 57:             if ($objParentObject)
 58:                 parent::__construct($objParentObject, $strControlId);
 59:         }
 60: 
 61:         public function RenderAsImgSrc($blnDisplayOutput = true) {
 62:             // Serialize and Hash Data
 63:             $strSerialized = $this->Serialize();
 64:             $strHash = md5($strSerialized);
 65: 
 66:             // Figure Out Image Filename
 67:             if ($this->strCacheFilename)
 68:                 $strImageFilename = $this->strCacheFilename;
 69:             else {
 70:                 $strImageFilename = $strHash;
 71: 
 72:                 switch ($this->strImageType) {
 73:                     case QImageType::Gif:
 74:                         $strImageFilename .= '.gif';
 75:                         break;
 76:                     case QImageType::AnimatedGif:
 77:                         $strImageFilename .= '.gif';
 78:                         break;
 79:                     case QImageType::Jpeg:
 80:                         $strImageFilename .= '.jpg';
 81:                         break;
 82:                     default:
 83:                         $strImageFilename .= '.png';
 84:                         break;
 85:                 }
 86:             }
 87: 
 88:             // Figure out IMG SRC path based on Caching prefs
 89:             if ($this->strCacheFolder) {
 90:                 $strFilePath = sprintf('%s%s/%s',
 91:                     __DOCROOT__,
 92:                     str_replace(__VIRTUAL_DIRECTORY__, '', $this->strCacheFolder),
 93:                     $strImageFilename);
 94: 
 95:                 if (!file_exists($strFilePath))
 96:                     $this->RenderImage($strFilePath);
 97: 
 98:                 $strPath = sprintf('%s/%s',
 99:                     $this->strCacheFolder,
100:                     $strImageFilename);
101: 
102:                 // Store Cache Filepath Info
103:                 $this->strCachedActualFilePath = $strFilePath;
104:             } else {
105:                 $strPath = sprintf('%s/image_base.php/%s/%s?q=%s',
106:                     __VIRTUAL_DIRECTORY__ . __PHP_ASSETS__,
107:                     $this->strControlClassName,
108:                     $strImageFilename,
109:                     $strSerialized
110:                 );
111:             }
112: 
113:             // Output or Display
114:             if ($blnDisplayOutput)
115:                 print($strPath);
116:             else
117:                 return $strPath;
118:         }
119: 
120:         /**
121:          * Returns the HTML for rendering the control in the browser
122:          *
123:          * @return string HTML for the control
124:          * @throws Exception
125:          * @throws QCallerException
126:          */
127:         protected function GetControlHtml() {
128:             try {
129:                 // Figure Out the Path
130:                 $strPath = $this->RenderAsImgSrc(false);
131:             } catch (QCallerException $objExc) {
132:                 $objExc->IncrementOffset();
133:                 throw $objExc;
134:             }
135: 
136:             if ($this->strCachedActualFilePath) {
137:                 $objDimensions = getimagesize($this->strCachedActualFilePath);
138: 
139:                 // Setup Style and Other Attribute Information (EXCEPT for "BackColor")
140:                 // Use actual "Width" and "Height" values from cached image
141:                 $strBackColor = $this->strBackColor;
142:                 $strWidth = $this->strWidth;
143:                 $strHeight = $this->strHeight;
144:                 $this->strBackColor = null;
145:                 $this->strWidth = $objDimensions[0];
146:                 $this->strHeight = $objDimensions[1];
147:                 $strStyle = $this->GetStyleAttributes();
148:                 if ($strStyle)
149:                     $strStyle = sprintf(' style="%s"', $strStyle);
150:                 $this->strBackColor = $strBackColor;
151:                 $this->strWidth = $strWidth;
152:                 $this->strHeight = $strHeight;
153:             } else {
154:                 // Setup Style and Other Attribute Information (EXCEPT for "BackColor", "Width" and "Height")
155:                 $strBackColor = $this->strBackColor;
156:                 $strWidth = $this->strWidth;
157:                 $strHeight = $this->strHeight;
158:                 $this->strBackColor = null;
159:                 $this->strWidth = null;
160:                 $this->strHeight = null;
161:                 $strStyle = $this->GetStyleAttributes();
162:                 if ($strStyle)
163:                     $strStyle = sprintf(' style="%s"', $strStyle);
164:                 $this->strBackColor = $strBackColor;
165:                 $this->strWidth= $strWidth;
166:                 $this->strHeight = $strHeight;
167:             }
168: 
169:             $strAlt = null;
170:             if ($this->strAlternateText)
171:                 $strAlt = ' alt="' . QApplication::HtmlEntities($this->strAlternateText) . '"';
172: 
173:             // Render final "IMG SRC" tag
174:             $strToReturn = sprintf('<img src="%s" %s%s%s/>',
175:                 $strPath,
176:                 $this->GetAttributes(),
177:                 $strStyle,
178:                 $strAlt);
179:             return $strToReturn;
180:         }
181: 
182:         public function Serialize() {
183:             $objControl = clone($this);
184:             $objControl->objForm = null;
185:             $objControl->objParentControl = null;
186:             $objControl->strCacheFilename = null;
187:             $objControl->strCachedActualFilePath = null;
188:             $objControl->blnOnPage = null;
189:             $objControl->blnModified = null;
190:             $objControl->strControlId = null;
191:             $objControl->strRenderMethod = null;
192:             $objControl->blnOnPage = null;
193:             $objControl->blnRendered = null;
194:             $objControl->blnRendering = null;
195:             $objControl->objActionArray = null;
196:             $objControl->objChildControlArray = null;
197:             $objControl->blnWrapperModified = null;
198:             $objControl->strValidationError = null;
199:             $objControl->strWarning = null;
200: 
201:             $strData = serialize($objControl);
202: 
203:             if (function_exists('gzcompress'))
204:                 $strData = base64_encode(gzcompress($strData, 9));
205:             else
206:                 $strData = base64_encode($strData);
207: 
208:             $strData = str_replace('+', '-', $strData);
209:             $strData = str_replace('/', '_', $strData);
210:             
211:             return $strData;
212:         }
213:         
214:         public static function Run() {
215:             $strData = QApplication::QueryString('q');
216:             $strData = str_replace('-', '+', $strData);
217:             $strData = str_replace('_', '/', $strData);
218: 
219:             $strData = base64_decode($strData);
220: 
221:             if (function_exists('gzcompress'))
222:                 $strData = gzuncompress($strData);
223: 
224:             $objControl = unserialize($strData);
225:             $objControl->RenderImage();
226:         }
227: 
228:         abstract public function RenderImage($strPath = null);
229: 
230:         /**
231:          * Used by custom RenderImage method to output the final image.
232:          * Uses $this->strImageType to determine type of image to be rendered.
233:          * This version is to be used when rendering an image using the GD library.
234:          * 
235:          * If strPath is not set, output to the screen.  If it is, save to strPath.
236:          *
237:          * @param resource $objFinalImage image in GD format
238:          * @param string $strPath
239:          */
240:         protected function RenderImageHelper($objFinalImage, $strPath) {
241:             // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
242:             if (!$strPath) {
243:                 // Output to Output Stream
244:                 QApplication::$ProcessOutput = false;
245:                 header('Cache-Control: cache');
246:                 header('Expires: Wed, 20 Mar 2019 05:00:00 GMT');
247:                 header('Pragma: cache');
248: 
249:                 switch ($this->strImageType) {
250:                     case QImageType::Gif:
251:                         header('Content-Type: image/gif');
252:                         imagegif($objFinalImage);
253:                         break;
254:                     case QImageType::AnimatedGif:
255:                         header('Content-Type: image/gif');
256:                         imagegif($objFinalImage);
257:                         break;
258:                     case QImageType::Jpeg:
259:                         header('Content-Type: image/jpeg');
260:                         imagejpeg($objFinalImage, null, $this->intJpegQuality);
261:                         break;
262:                     default:
263:                         header('Content-Type: image/png');
264:                         imagepng($objFinalImage);
265:                         break;
266:                 }
267:             } else {
268:                 // Make Directory
269:                 QApplication::MakeDirectory(dirname($strPath), 0777);
270: 
271:                 // Output to Disk
272:                 switch ($this->strImageType) {
273:                     case QImageType::Gif:
274:                         imagegif($objFinalImage, $strPath);
275:                         break;
276:                     case QImageType::AnimatedGif:
277:                         imagegif($objFinalImage, $strPath);
278:                         break;
279:                     case QImageType::Jpeg:
280:                         imagejpeg($objFinalImage, $strPath, $this->intJpegQuality);
281:                         break;
282:                     default:
283:                         imagepng($objFinalImage, $strPath);
284:                         break;
285:                 }
286:                 chmod($strPath, 0777);
287:             }
288: 
289:             imagedestroy($objFinalImage);
290:         }
291: 
292:         /**
293:          * Used by custom RenderImage method to output the final image.
294:          * Uses $this->strImageType to determine type of image to be rendered.
295:          * This version is to be used when rendering an image using the Imagick library.
296:          * 
297:          * If strPath is not set, output to the screen.  If it is, save to strPath.
298:          *
299:          * @param Imagick $objFinalImage image as an instance of the Imagick class
300:          * @param string $strPath
301:          */
302:         protected function RenderImageMagickHelper($objFinalImage, $strPath) {
303:             // Output the Image (if path isn't specified, output to buffer.  Otherwise, output to disk)
304:             if (!$strPath) {
305:                 $strPath = $this->strImagickTempFilePath . '/image_' . str_replace('.', '_', microtime(true));
306: 
307:                 // Output to a temporary location
308:                 switch ($this->strImageType) {
309:                     case QImageType::Gif:
310:                         $strPath .= '.gif';
311:                         $objFinalImage->setImageFormat('gif');
312:                         header('Content-Type: image/gif');
313:                         break;
314:                     case QImageType::AnimatedGif:
315:                         $strPath .= '.gif';
316:                         $objFinalImage->setImageFormat('gif');
317:                         header('Content-Type: image/gif');
318:                         break;
319:                     case QImageType::Jpeg:
320:                         $strPath .= '.jpg';
321:                         $objFinalImage->setImageFormat('jpeg');
322:                         $objFinalImage->setCompressionQuality($this->intJpegQuality);
323:                         header('Content-Type: image/jpeg');
324:                         break;
325:                     default:
326:                         $strPath .= '.png';
327:                         $objFinalImage->setImageFormat('png');
328:                         header('Content-Type: image/png');
329:                         break;
330:                 }
331: 
332:                 if ($this->strImageType == QImageType::AnimatedGif)
333:                     file_put_contents($strPath, $objFinalImage->GetImagesBlob());
334:                 else
335:                     $objFinalImage->writeImage($strPath);
336: 
337:                 QApplication::$ProcessOutput = false;
338:                 header('Cache-Control: cache');
339:                 header('Expires: Wed, 20 Mar 2019 05:00:00 GMT');
340:                 header('Pragma: cache');
341: 
342:                 print(file_get_contents($strPath));
343:                 unlink($strPath);
344: 
345:             } else {
346:                 // Make Directory
347:                 QApplication::MakeDirectory(dirname($strPath), 0777);
348: 
349:                 // Output to Disk
350:                 switch ($this->strImageType) {
351:                     case QImageType::Gif:
352:                         $objFinalImage->setImageFormat('gif');
353:                         break;
354:                     case QImageType::AnimatedGif:
355:                         $objFinalImage->setImageFormat('gif');
356:                         break;
357:                     case QImageType::Jpeg:
358:                         $objFinalImage->setImageFormat('jpeg');
359:                         $objFinalImage->setCompressionQuality($this->intJpegQuality);
360:                         break;
361:                     default:
362:                         $objFinalImage->setImageFormat('png');
363:                         break;
364:                 }
365: 
366:                 $objFinalImage->writeImage($strPath);
367:                 chmod($strPath, 0777);
368:             }
369: 
370:             $objFinalImage->Destroy();
371:         }
372: 
373:         /////////////////////////
374:         // Public Properties: GET
375:         /////////////////////////
376:         /**
377:          * PHP magic method to set a property of this class
378:          *
379:          * @param string $strName Name of the property
380:          *
381:          * @return int|mixed|null|string
382:          * @throws Exception
383:          * @throws QCallerException
384:          */
385:         public function __get($strName) {
386:             switch ($strName) {
387:                 // MISCELLANEOUS
388:                 case "CacheFolder": return $this->strCacheFolder;
389:                 case "CacheFilename": return $this->strCacheFilename;
390:                 case "AlternateText": return $this->strAlternateText;
391:                 case "ImageType": return $this->strImageType;
392:                 case "JpegQuality": return $this->intJpegQuality;
393: 
394:                 default:
395:                     try {
396:                         return parent::__get($strName);
397:                     } catch (QCallerException $objExc) {
398:                         $objExc->IncrementOffset();
399:                         throw $objExc;
400:                     }
401:             }
402:         }
403: 
404:         /////////////////////////
405:         // Public Properties: SET
406:         /////////////////////////
407:         /**
408:          * PHP magic method to set the value of class properties
409:          *
410:          * @param string $strName Name of the property
411:          * @param string $mixValue Value of the property
412:          *
413:          * @return mixed|void
414:          * @throws Exception
415:          * @throws QCallerException
416:          * @throws QInvalidCastException
417:          */
418:         public function __set($strName, $mixValue) {
419:             $this->blnModified = true;
420: 
421:             switch ($strName) {
422:                 case "CacheFolder":
423:                     try {
424:                         $this->strCacheFolder = QType::Cast($mixValue, QType::String);
425:                         break;
426:                     } catch (QInvalidCastException $objExc) {
427:                         $objExc->IncrementOffset();
428:                         throw $objExc;
429:                     }
430: 
431:                 case "CacheFilename":
432:                     try {
433:                         $this->strCacheFilename = QType::Cast($mixValue, QType::String);
434:                         break;
435:                     } catch (QInvalidCastException $objExc) {
436:                         $objExc->IncrementOffset();
437:                         throw $objExc;
438:                     }
439: 
440:                 case "AlternateText":
441:                     try {
442:                         $this->strAlternateText = QType::Cast($mixValue, QType::String);
443:                         break;
444:                     } catch (QInvalidCastException $objExc) {
445:                         $objExc->IncrementOffset();
446:                         throw $objExc;
447:                     }
448: 
449:                 case "ImageType":
450:                     try {
451:                         $this->strImageType = QType::Cast($mixValue, QType::String);
452:                         break;
453:                     } catch (QInvalidCastException $objExc) {
454:                         $objExc->IncrementOffset();
455:                         throw $objExc;
456:                     }
457: 
458:                 case "JpegQuality":
459:                     try {
460:                         $this->intJpegQuality = QType::Cast($mixValue, QType::Integer);
461:                         break;
462:                     } catch (QInvalidCastException $objExc) {
463:                         $objExc->IncrementOffset();
464:                         throw $objExc;
465:                     }
466: 
467:                 default:
468:                     try {
469:                         parent::__set($strName, $mixValue);
470:                     } catch (QCallerException $objExc) {
471:                         $objExc->IncrementOffset();
472:                         throw $objExc;
473:                     }
474:                     break;
475:             }
476:         }
477:     }
API documentation generated by ApiGen