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: require(__QCUBED__ . '/codegen/QCodeGen.class.php');
  4: include (__QCUBED_CORE__ . '/codegen/controls/_class_paths.inc.php');
  5: 
  6: 
  7: /**
  8:  * Class QModelConnectorEditDlg
  9:  *
 10:  * A dialog that lets you specify code generation options for a control. These options control how a control
 11:  * is generated, and includes additional parameters that can be specified for a control.
 12:  *
 13:  * This dialog pops up when designer mode is turned on and the user right clicks on a control.
 14:  *
 15:  * The code below will set up the dialog and display options that are generic to all QControls. Individual
 16:  * controls can add parameters to this dialog by implementing the GetModelConnectorParams function.
 17:  *
 18:  * Everything gets saved in the configuration/codegen_options.json file.
 19:  *
 20:  *
 21:  */
 22: class QModelConnectorEditDlg extends QDialog {
 23:     /** @var  QControl */
 24:     protected $objCurrentControl;
 25: 
 26:     protected $tabs;
 27: 
 28:     protected $txtName;
 29:     protected $txtControlId;
 30:     protected $txtControlClass;
 31:     protected $lstFormGen;
 32: 
 33:     protected $params;
 34:     protected $objModelConnectorOptions;
 35: 
 36:     protected $generalOptions;
 37:     protected $dtgGeneralOptions;
 38: 
 39:     protected $categories;
 40:     protected $datagrids;
 41: 
 42:     public function __construct($objParentObject, $strControlId) {
 43:         parent::__construct ($objParentObject, $strControlId);
 44: 
 45:         $this->AutoRenderChildren = true;
 46:         $this->Width = 700;
 47: 
 48:         $this->objModelConnectorOptions = new QModelConnectorOptions();
 49: 
 50:         $this->tabs = new QTabs ($this);
 51:         $this->tabs->HeightStyle = "auto";
 52: 
 53:         $this->AddButton ('Save', 'save');
 54:         $this->AddButton ('Save, Regenerate and Reload', 'saveRefresh');
 55:         $this->AddButton ('Cancel', 'cancel');
 56: 
 57:         $this->AddAction(new QDialog_ButtonEvent(), new QAjaxControlAction($this, 'ButtonClick'));
 58:     }
 59: 
 60:     /**
 61:      * Recreate the tabs in the dialog
 62:      */
 63:     protected function SetupTabs() {
 64:         $strClassNames = $this->CreateClassNameArray();
 65:         $this->tabs->RemoveChildControls(true);
 66:         $this->categories = array();
 67: 
 68:         $this->dtgGeneralOptions = new QHtmlTable($this->tabs, 'definitionTab');
 69:         $this->dtgGeneralOptions->ShowHeader = false;
 70:         $this->dtgGeneralOptions->Name = "General";
 71:         $this->dtgGeneralOptions->CreatePropertyColumn('Attribute', 'Name');
 72:         $col = $this->dtgGeneralOptions->AddColumn (new QHtmlTableCallableColumn('Attribute', array ($this, 'dtg_ValueRender'), $this->dtgGeneralOptions));
 73:         $col->HtmlEntities = false;
 74:         $this->dtgGeneralOptions->SetDataBinder('dtgGeneralOptions_Bind', $this);
 75: 
 76:         /**
 77:          * The following default options are somewhat matched to the default list and edit templates. A more robust
 78:          * implementation would get the options from the templates, or what the templates generate, so that the templates
 79:          * decide what to put there. If someone wants to radically change the templates, but still have them use this dialog
 80:          * to edit the options, then would be the time to change the code below.
 81:          */
 82:         if ($this->objCurrentControl->LinkedNode->_ParentNode) {
 83:             // Specify general options for a database column
 84:             $this->generalOptions = array (
 85:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'ControlClass', 'Override of the PHP type for the control. If you change this, save the dialog and reopen to reload the tabs to show the control specific options.', QModelConnectorParam::SelectionList, $strClassNames),
 86:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'FormGen',
 87:                     'Whether or not to generate this object, just a label for the object, just the control, or both the control and label',
 88:                     QModelConnectorParam::SelectionList,
 89:                     array (QFormGen::Both=>'Both', QFormGen::None=>'None', QFormGen::ControlOnly=>'Control', QFormGen::LabelOnly=>'Label')),
 90:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'Name', 'Control\'s Name', QType::String),
 91:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'NoColumn', 'True to prevent a column in the lister from being generated.', QType::Boolean)
 92:             );
 93:         }
 94:         else {
 95:             // Specify general options for a database table, meaning an object that is listing the content of a whole table.
 96:             // These would be options at a higher level than the control itself, and would modify how the control is used in a form.
 97:             $this->generalOptions = array (
 98:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'ControlClass', 'Override of the PHP type for the control. If you change this, save the dialog and reopen to reload the tabs to show the control specific options.', QModelConnectorParam::SelectionList, $strClassNames),
 99:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'Name', 'The Control\'s Name. Generally leave this blank, or use a plural name.', QType::String),
100:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'ItemName', 'The public name of an item in the list. Its used by the title of the edit form, for example. Defaults to the name of the table in the database.', QType::String),
101:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'CreateFilter', 'Whether to generate a separate control to filter the data. If the data list control does its own filtering, set this to false. Default is true.', QType::Boolean),
102:                 new QModelConnectorParam (QModelConnectorParam::GeneralCategory, 'EditMode',
103:                     'How to edit an item. 1) Options are: to go to a separate form, 2) popup a dialog, or 3) popup a dialog only if not on a mobile device since mobile devices struggle with showing dialogs that are bigger than the screen.',
104:                     QModelConnectorParam::SelectionList,
105:                     array ('form'=>'Edit with a QForm', 'dialog'=>'Edit with a QDialog', 'both'=>'Edit with a form on mobile devices, and a dialog on desktops.'))
106:             );
107:         }
108: 
109:         // load values from settings file
110:         foreach ($this->generalOptions as $objParam) {
111:             $objControl = $objParam->GetControl ($this->dtgGeneralOptions); // get a control that will edit this option
112:             $strName = $objControl->Name;
113: 
114:             if (isset($this->params[$strName])) {
115:                 $objControl->Value = $this->params[$strName];
116:                 if ($strName == 'ControlClass') {
117:                     $strControlClass = $this->params[$strName];
118:                 }
119:             } else {
120:                 $objControl->Value = null;
121:             }
122:         }
123: 
124:         if (!isset ($strControlClass)) {
125:             $strControlClass = get_class ($this->objCurrentControl);
126:         }
127:         $params = $strControlClass::GetModelConnectorParams();
128: 
129:         // gather categories
130:         foreach ($params as $param) {
131:             $this->categories[$param->Category][] = $param;
132:         }
133: 
134:         // Add any additional general items to the general tab
135:         if (isset ($this->categories[QModelConnectorParam::GeneralCategory])) {
136:             // load values from settings file
137:             foreach ($this->categories[QModelConnectorParam::GeneralCategory] as $objParam) {
138:                 $objControl = $objParam->GetControl($this->dtgGeneralOptions);    // get a control that will edit this option
139:                 $strName = $objControl->Name;
140: 
141:                 if (isset($this->params[$strName])) {
142:                     $objControl->Value = $this->params[$strName];
143:                 } else {
144:                     $objControl->Value = null;
145:                 }
146:                 $this->generalOptions[] = $objParam;
147:             }
148: 
149:             unset($this->categories[QModelConnectorParam::GeneralCategory]);
150:         }
151: 
152:         foreach ($this->categories as $tabName=>$params) {
153:             $panel = new QPanel ($this->tabs);
154:             $panel->SetCustomStyle('overflow-y', 'scroll');
155:             $panel->SetCustomStyle('max-height', '200');
156:             $panel->AutoRenderChildren = true;
157:             $panel->Name = $tabName;
158: 
159:             $dtg = new QHtmlTable($panel);
160:             $dtg->ShowHeader = false;
161:             $dtg->CreatePropertyColumn('Attribute', 'Name');
162:             $col = $dtg->AddColumn (new QHtmlTableCallableColumn('Attribute', array ($this, 'dtg_ValueRender'), $dtg));
163:             $col->HtmlEntities = false;
164:             $dtg->SetDataBinder('dtgControlBind', $this);
165:             $dtg->Name = $tabName; // holder for category
166:             $this->datagrids[$tabName] = $dtg;
167: 
168:             // load values from settings file
169:             foreach ($params as $objParam) {
170:                 $objControl = $objParam->GetControl ($this->datagrids[$tabName]);
171:                 if ($objControl) {
172:                     $strName = $objControl->Name;
173: 
174:                     if (isset($this->params['Overrides'][$strName])) {
175:                         $objControl->Value = $this->params['Overrides'][$strName];
176:                     } else {
177:                         $objControl->Value = null;
178:                     }
179:                 }
180:             }
181: 
182:         }
183:     }
184: 
185:     /**
186:      * Bind the general options
187:      */
188:     public function dtgGeneralOptions_Bind() {
189:         $this->dtgGeneralOptions->DataSource = $this->generalOptions;
190:     }
191: 
192:     /**
193:      * Binder for the control specific options
194:      */
195:     public function dtgControlBind($dtg) {
196:         $dtg->DataSource = $this->categories[$dtg->Name];
197:     }
198: 
199:     /**
200:      * Render the value column, which allows the user to specify the value of an option for the control.
201:      *
202:      * @param QModelConnectorParam $objControlParam
203:      * @param QControl $objParent
204:      * @return string
205:      */
206:     public function dtg_ValueRender (QModelConnectorParam $objControlParam, QControl $objParent) {
207:         $objControl = $objControlParam->GetControl ($objParent);
208:         return $objControl->Render(false);
209:     }
210: 
211:     /**
212:      * Entry point for the dialog. Brings up the dialog and loads all the options so that it can be edited.
213:      *
214:      * @param QControl $objControl
215:      */
216:     public function EditControl (QControl $objControl) {
217:         $this->objCurrentControl = $objControl;
218: 
219:         $this->Title = $objControl->Name . ' Edit';
220: 
221:         $blnEditable = $this->ReadParams();
222:         if ($blnEditable) {
223:             $this->SetupTabs();
224:             $this->Open();
225:             $this->tabs->Refresh();
226:         }
227:     }
228: 
229:     /**
230:      * Dialog button has been clicked. Save the options, or Save, codegen, and then reload.
231:      *
232:      * @param $strFormId
233:      * @param $strControlId
234:      * @param $mixParam
235:      */
236:     public function ButtonClick ($strFormId, $strControlId, $mixParam) {
237:         if ($mixParam == 'save') {
238:             $this->UpdateControlInfo();
239:             $this->WriteParams();
240:         } elseif ($mixParam == 'saveRefresh') {
241:             $this->UpdateControlInfo();
242:             $this->WriteParams();
243:             QCodeGen::Run(__CONFIGURATION__ . '/codegen_settings.xml');
244:             foreach (QCodeGen::$CodeGenArray as $objCodeGen) {
245:                 $objCodeGen->GenerateAll(); // silently codegen
246:             }
247:             QApplication::Redirect($_SERVER['PHP_SELF']);
248:         }
249: 
250:         $this->Close();
251:     }
252: 
253:     /**
254:      * Puts the values of the dialog into the params array to be saved off into the settings file.
255:      */
256:     protected function UpdateControlInfo() {
257:         $objParams = $this->generalOptions;
258:         foreach ($objParams as $objParam) {
259:             $objControl = $objParam->GetControl ($this->dtgGeneralOptions);
260:             $strName = $objControl->Name;
261:             $value = $objControl->Value;
262: 
263:             if (!is_null($value)) {
264:                 $this->params[$strName] = $value;
265:             } else {
266:                 unset ($this->params[$strName]);
267:             }
268:         }
269: 
270:         foreach ($this->categories as $objParams) {
271:             foreach ($objParams as $objParam) {
272:                 $objControl = $objParam->GetControl ();
273:                 if ($objControl) {
274:                     $strName = $objControl->Name;
275:                     $value = $objControl->Value;
276: 
277:                     if (!is_null($value)) {
278:                         $this->params['Overrides'][$strName] = $value;
279:                     } else {
280:                         unset ($this->params['Overrides'][$strName]);
281:                     }
282:                 } else {
283:                     unset ($this->params['Overrides'][$strName]);
284:                 }
285:             }
286:         }
287: 
288:         if (empty($this->params['Overrides'])) {
289:             unset ($this->params['Overrides']);
290:         }
291:     }
292: 
293:     /**
294:      * Write the current params into the settings file.
295:      */
296:     protected function WriteParams() {
297:         $node = $this->objCurrentControl->LinkedNode;
298:         if ($node) {
299:             if ($node->_ParentNode) {
300:                 $strClassName = $node->_ParentNode->_ClassName;
301:                 $this->objModelConnectorOptions->SetOptions ($strClassName, $node->_PropertyName, $this->params);
302:                 $this->objModelConnectorOptions->Save();
303:             } else {
304:                 // Table options
305:                 $this->objModelConnectorOptions->SetOptions ($node->_ClassName, QModelConnectorOptions::TableOptionsFieldName, $this->params);
306:                 $this->objModelConnectorOptions->Save();
307:             }
308:         }
309:     }
310: 
311:     /**
312:      * Read the params from the settings file.
313:      * Returns false if there were no params to be read, meaning this control is not attached to a database object.
314:      * @return bool
315:      */
316:     protected function ReadParams() {
317:         $node = $this->objCurrentControl->LinkedNode;
318:         if ($node) {
319:             if ($node->_ParentNode) {
320:                 $strClassName = $node->_ParentNode->_ClassName;
321:                 $this->params = $this->objModelConnectorOptions->GetOptions ($strClassName, $node->_PropertyName);
322:             }
323:             else {
324:                 // Table options
325:                 $this->params = $this->objModelConnectorOptions->GetOptions ($node->_ClassName, QModelConnectorOptions::TableOptionsFieldName);
326:             }
327:             return true;
328:         }
329:         return false;
330:     }
331: 
332:     /**
333:      * Returns an array of class names that can be used to edit the current control's data type.
334:      *
335:      * @return array
336:      */
337:     protected function CreateClassNameArray() {
338:         // create the control array
339:         $controls = array();
340:         include (__QCUBED_CORE__ . '/control_registry.inc.php');
341: 
342:         if (file_exists(__APP_INCLUDES__ . '/control_registry.inc.php')) {
343:             include (__APP_INCLUDES__ . '/control_registry.inc.php');
344:         }
345: 
346:         if (defined ('__PLUGINS__') &&
347:                 is_dir(__PLUGINS__)) {
348:             $plugins = scandir(__PLUGINS__);
349:             foreach ($plugins as $dirName) {
350:                 if ($dirName != '.' && $dirName != '..') {
351:                     if (file_exists(__PLUGINS__ . '/' . $dirName . '/control_registry.inc.php')) {
352:                         include (__PLUGINS__ . '/' . $dirName . '/control_registry.inc.php');
353:                     }
354:                 }
355:             }
356:         }
357: 
358:         // $controls is now an array indexed by QType, with each entry a QControl type name
359: 
360:         // Figure out what type of control we are looking for
361:         // For the most part, the control category types are the same as the database type
362:         $node = $this->objCurrentControl->LinkedNode;
363:         $type = $node->_Type;
364:         if (($node->_Type == QType::ReverseReference && $node->IsUnique()) || $node->_Type == QType::ArrayType) {
365:             $type = QControlCategoryType::SingleSelect;
366:         }
367:         elseif (($node->_Type == QType::ReverseReference && !$node->IsUnique()) || $node->_Type == QType::Association) {
368:             $type = QControlCategoryType::MultiSelect;
369:         }
370:         elseif ($node->_TableName) { // indicates a reference to a table
371:             if ($node->_ParentNode) {
372:                 // A foreign key to another table
373:                 $type = QControlCategoryType::SingleSelect;
374:             } else {
375:                 // A top level table, so a grid or list view
376:                 $type = QControlCategoryType::Table;
377:             }
378:         }
379: 
380:         if (isset ($controls[$type])) {
381:             foreach ($controls[$type] as $strClassName) {
382:                 $a[$strClassName] = $strClassName;  // remove duplicates
383:             }
384: 
385:             return $a;
386:         } else {
387:             return null;
388:         }
389: 
390:     }
391: 
392: }
393: 
394: 
API documentation generated by ApiGen