本文整理汇总了PHP中QControl::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP QControl::__construct方法的具体用法?PHP QControl::__construct怎么用?PHP QControl::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QControl
的用法示例。
在下文中一共展示了QControl::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($objParentObject, $strControlId = null, $blnShowCheckboxes = false)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->objParentObject = $objParentObject;
$this->dtgLocation = new QDataGrid($this);
$this->dtgLocation->Name = 'location_list';
$this->dtgLocation->CellPadding = 5;
$this->dtgLocation->CellSpacing = 0;
$this->dtgLocation->CssClass = "datagrid";
// Disable AJAX for the datagrid
$this->dtgLocation->UseAjax = false;
// Allow for column toggling
$this->dtgLocation->ShowColumnToggle = true;
// Allow for CSV Export
$this->dtgLocation->ShowExportCsv = true;
// Enable Pagination, and set to 20 items per page
$objPaginator = new QPaginator($this->dtgLocation);
$this->dtgLocation->Paginator = $objPaginator;
$this->dtgLocation->ItemsPerPage = 20;
// If the user wants the checkboxes column
if ($blnShowCheckboxes) {
// This will render all of the necessary controls and actions. chkSelected_Render expects a unique ID for each row of the database.
$this->dtgLocation->AddColumn(new QDataGridColumnExt('<?=$_CONTROL->chkSelectAll_Render() ?>', '<?=$_CONTROL->chkSelected_Render($_ITEM->LocationId) ?>', 'CssClass="dtg_column"', 'HtmlEntities=false'));
}
$this->dtgLocation->AddColumn(new QDataGridColumnExt('Location', '<?= $_ITEM->__toStringWithLink("bluelink") ?>', array('OrderByClause' => QQ::OrderBy(QQN::Location()->ShortDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Location()->ShortDescription, false)), 'CssClass="dtg_column"', 'HtmlEntities=false'));
$this->dtgLocation->AddColumn(new QDataGridColumnExt('Description', '<?= $_ITEM->LongDescription ?>', 'Width=200', array('OrderByClause' => QQ::OrderBy(QQN::Location()->LongDescription), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Location()->LongDescription, false)), 'CssClass="dtg_column"'));
$this->dtgLocation->AddColumn(new QDataGridColumnExt('Created By', '<?= $_ITEM->CreatedByObject->__toStringFullName() ?>', array('OrderByClause' => QQ::OrderBy(QQN::Location()->CreatedByObject->LastName), 'ReverseOrderByClause' => QQ::OrderBy(QQN::Location()->CreatedByObject->LastName, false)), 'CssClass="dtg_column"'));
// Add the custom field columns with Display set to false. These can be shown by using the column toggle menu.
$objCustomFieldArray = CustomField::LoadObjCustomFieldArray(2, false);
if ($objCustomFieldArray) {
foreach ($objCustomFieldArray as $objCustomField) {
//Only add the custom field column if the role has authorization to view it.
if ($objCustomField->objRoleAuthView && $objCustomField->objRoleAuthView->AuthorizedFlag) {
$this->dtgLocation->AddColumn(new QDataGridColumnExt($objCustomField->ShortDescription, '<?= $_ITEM->GetVirtualAttribute(\'' . $objCustomField->CustomFieldId . '\') ?>', 'SortByCommand="__' . $objCustomField->CustomFieldId . ' ASC"', 'ReverseSortByCommand="__' . $objCustomField->CustomFieldId . ' DESC"', 'HtmlEntities="false"', 'CssClass="dtg_column"', 'Display="false"'));
}
}
}
$this->dtgLocation->SortColumnIndex = 1;
$this->dtgLocation->SortDirection = 0;
$objStyle = $this->dtgLocation->RowStyle;
$objStyle->ForeColor = '#000000';
$objStyle->BackColor = '#FFFFFF';
$objStyle->FontSize = 12;
$objStyle = $this->dtgLocation->AlternateRowStyle;
$objStyle->BackColor = '#EFEFEF';
$objStyle = $this->dtgLocation->HeaderRowStyle;
$objStyle->ForeColor = '#000000';
$objStyle->BackColor = '#EFEFEF';
$objStyle->CssClass = 'dtg_header';
$this->dtgLocation->SetDataBinder('dtgLocation_Bind', $this);
$this->txtLocation_Create();
$this->btnSearch_Create();
$this->btnClear_Create();
}
示例2: __construct
public function __construct($objParentObject, $intEntityQtypeId = null, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->objParentObject = $objParentObject;
$this->intEntityQtypeId = $intEntityQtypeId;
if ($objParentObject instanceof AssetListForm) {
$this->txtAssetModelCode_Create();
$this->lstReservedBy_Create();
$this->lstCheckedOutBy_Create();
}
if ($objParentObject instanceof ShipmentListForm) {
$this->txtFromCompany_Create();
$this->txtFromContact_Create();
$this->txtTrackingNumber_Create();
$this->lstCourier_Create();
$this->txtNote_Create();
$this->dtpShipmentDate_Create();
}
if ($objParentObject instanceof ReceiptListForm) {
$this->txtNote_Create();
$this->dtpDueDate_Create();
$this->dtpReceiptDate_Create();
}
$this->lstDateModified_Create();
$this->dtpDateModifiedFirst_Create();
$this->dtpDateModifiedLast_Create();
$this->chkAttachment_Create();
$this->customFields_Create();
}
示例3: __construct
public function __construct($objParentObject, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// Assign the parent object (InventoryModelEditForm from inventory_edit.php)
$this->objParentObject = $objParentObject;
// This is necessary for blnEditMode, but not much else.
// objInventoryModel is only declared because this is called, even though it is not used.
$this->objParentObject->SetupInventoryModel($this);
// Create the blank InventoryLocationArray
$this->objInventoryLocationArray = array();
$this->lstSourceLocation_Create();
$this->txtNote_Create();
$this->txtNewInventoryModelCode_Create();
$this->lstDestinationLocation_Create();
$this->txtQuantity_Create();
$this->btnLookup_Create();
$this->btnSave_Create();
$this->btnCancel_Create();
$this->btnAdd_Create();
$this->dtgInventoryTransact_Create();
$this->ctlInventorySearchTool_Create();
}
示例4: __construct
public function __construct($objParentObject, $strControlId = null)
{
parent::__construct($objParentObject, $strControlId);
$this->strNoun = QApplication::Translate('item');
$this->strNounPlural = QApplication::Translate('items');
$this->prxDatagridSorting = new QControlProxy($this);
}
示例5: __construct
public function __construct($objParentObject, $objVariableOrParameter, $blnDefaultValueEditable, $blnShowExtendedDescription, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
if ($objVariableOrParameter instanceof Parameter) {
$this->objParameter = $objVariableOrParameter;
$this->objVariable = $this->objParameter->Variable;
$blnShowReference = true;
} else {
$this->objVariable = $objVariableOrParameter;
$blnShowReference = false;
}
// Setup Local Variables
$this->strName = $this->objVariable->Name;
// Next, we'll create our local subcontrols. Make sure to set "this" as these subcontrols' parent.
$this->lstVariableType = new QListBox($this);
$this->lstVariableType->Name = $this->strName . ' Variable Type';
$this->lstVariableType->CssClass .= ' vctl';
foreach (VariableType::$NameArray as $intId => $strName) {
$this->lstVariableType->AddItem($strName, $intId, $this->objVariable->VariableTypeId == $intId);
}
$this->lstObjectType = new QListBox($this);
$this->lstObjectType->Name = 'Object Type';
$this->lstObjectType->AddItem('- Unspecified -', null);
$this->lstObjectType->CssClass .= ' vctl';
foreach (QcodoClass::LoadAll(QQ::Clause(QQ::OrderBy(QQN::QcodoClass()->Name))) as $objQcodoClass) {
$this->lstObjectType->AddItem($objQcodoClass->Name, $objQcodoClass->Id, $this->objVariable->ObjectTypeId == $objQcodoClass->Id);
}
$this->chkArray = new QCheckBox($this);
$this->chkArray->Name = $this->strName . ' is an Array?';
$this->chkArray->Checked = $this->objVariable->ArrayFlag;
$this->chkReference = new QCheckBox($this);
$this->chkReference->Visible = $blnShowReference;
if ($this->objParameter) {
$this->chkReference->Checked = $this->objParameter->ReferenceFlag;
}
$this->txtDefaultValue = new QTextBox($this);
$this->txtDefaultValue->Name = $this->strName . ' Default Value';
$this->txtDefaultValue->Text = $this->objVariable->DefaultValue;
$this->txtDefaultValue->Enabled = $blnDefaultValueEditable;
$this->txtDefaultValue->CssClass .= ' vctl';
$this->txtShortDescription = new QTextBox($this);
$this->txtShortDescription->Name = $this->strName . ' Short Description';
$this->txtShortDescription->Text = $this->objVariable->ShortDescription;
$this->txtShortDescription->TextMode = QTextMode::MultiLine;
$this->txtShortDescription->CssClass = 'textbox_multiline';
$this->txtExtendedDescription = new QWriteBox($this);
$this->txtExtendedDescription->Name = $this->strName . ' Extended Description';
$this->txtExtendedDescription->Text = $this->objVariable->ExtendedDescription;
$this->txtExtendedDescription->CssClass = 'textbox_multiline';
$this->txtExtendedDescription->Visible = $blnShowExtendedDescription;
$this->lstVariableType->AddAction(new QChangeEvent(), new QAjaxControlAction($this, 'lstVariableType_Change'));
$this->lstVariableType_Change();
}
示例6: __construct
public function __construct($objParentObject, $strControlId = null)
{
parent::__construct($objParentObject, $strControlId);
$this->strLabelForRequired = QApplication::Translate('%s is required');
$this->strLabelForRequiredUnnamed = QApplication::Translate('Required');
$this->strLabelForTooShort = QApplication::Translate('%s must have at least %s characters');
$this->strLabelForTooShortUnnamed = QApplication::Translate('Must have at least %s characters');
$this->strLabelForTooLong = QApplication::Translate('%s must have at most %s characters');
$this->strLabelForTooLongUnnamed = QApplication::Translate('Must have at most %s characters');
}
示例7: __construct
public function __construct($objParentObject, $strControlId = null)
{
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->Setup();
}
示例8: __construct
public function __construct($objParentObject, $strControlId = null)
{
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->pnlColumnToggleMenu_Create();
}
示例9: __construct
public function __construct($objParentObject, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->objShortcutArray = Shortcut::LoadArrayByRoleModule();
}
示例10: __construct
public function __construct($objParentObject, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->objParentObject = $objParentObject;
$this->dlgAssetModelSearchTool_Create();
}
示例11: __construct
public function __construct($objParentObject, QDateTimeTextBox $dtxLinkedControl, $strControlId = null)
{
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
// Setup Linked DateTimeTextBox control
$this->dtxLinkedControl = $dtxLinkedControl;
// Other Setup
$this->strCalendarImageSource = __IMAGE_ASSETS__ . '/calendar.png';
}
示例12: __construct
/**
* Constructor method
*
* @param QControl|QControlBase|QForm $objParentObject
* @param null|string $strControlId
*
* @throws Exception
* @throws QCallerException
*/
public function __construct($objParentObject, $strControlId = null)
{
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->prxPagination = new QControlProxy($this);
$this->strLabelForPrevious = QApplication::Translate('Previous');
$this->strLabelForNext = QApplication::Translate('Next');
$this->Setup();
}
示例13: __construct
public function __construct($objParentObject, $intEntityQtypeId = null, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->objParentObject = $objParentObject;
$this->intEntityQtypeId = $intEntityQtypeId;
$this->chkEntityView = new QCheckBox($this);
$this->chkEntityEdit = new QCheckBox($this);
$this->chkBuiltInView = new QCheckBox($this);
$this->chkBuiltInView->Enabled = false;
$this->chkBuiltInView->Checked = true;
$intRoleId = QApplication::QueryString('intRoleId');
if ($intRoleId) {
$objBuiltInViewAuth = RoleEntityQtypeBuiltInAuthorization::LoadByRoleIdEntityQtypeIdAuthorizationId($intRoleId, $intEntityQtypeId, 1);
}
if (isset($objBuiltInViewAuth)) {
$this->chkBuiltInView->Checked = $objBuiltInViewAuth->AuthorizedFlag;
}
$this->chkBuiltInEdit = new QCheckBox($this);
if ($intRoleId) {
$objBuiltInEditAuth = RoleEntityQtypeBuiltInAuthorization::LoadByRoleIdEntityQtypeIdAuthorizationId($intRoleId, $intEntityQtypeId, 2);
}
if (isset($objBuiltInEditAuth)) {
$this->chkBuiltInEdit->Checked = $objBuiltInEditAuth->AuthorizedFlag;
}
// Load all custom fields and their values into an array arrCustomChecks
$objCustomFieldArray = CustomField::LoadObjCustomFieldArray($intEntityQtypeId, false, null);
foreach ($objCustomFieldArray as $objCustomField) {
$chkCustomView = new QCheckBox($this);
$chkCustomEdit = new QCheckBox($this);
$objEntityQtypeCustomField = EntityQtypeCustomField::LoadByEntityQtypeIdCustomFieldId($intEntityQtypeId, $objCustomField->CustomFieldId);
if ($objEntityQtypeCustomField) {
$objCustomAuthView = RoleEntityQtypeCustomFieldAuthorization::LoadByRoleIdEntityQtypeCustomFieldIdAuthorizationId($intRoleId, $objEntityQtypeCustomField->EntityQtypeCustomFieldId, 1);
if ($objCustomAuthView) {
$chkCustomView->Checked = $objCustomAuthView->AuthorizedFlag;
}
$objCustomAuthEdit = RoleEntityQtypeCustomFieldAuthorization::LoadByRoleIdEntityQtypeCustomFieldIdAuthorizationId($intRoleId, $objEntityQtypeCustomField->EntityQtypeCustomFieldId, 2);
if ($objCustomAuthEdit) {
$chkCustomEdit->Checked = $objCustomAuthEdit->AuthorizedFlag;
}
}
$this->arrCustomChecks[] = array('name' => $objCustomField->ShortDescription . ':', 'view' => $chkCustomView, 'edit' => $chkCustomEdit);
}
}
示例14: __construct
/**
* @param QForm|QControl $objParentObject the form or parent control
* @param int $intTime timer interval in ms
* @param boolean $blnPeriodic if true the timer is "restarted" automatically after it has fired
* @param boolean $blnStartNow starts the timer automatically after adding the first action
* @param string $strTimerId
*
* @throws QCallerException
* @return QJsTimer
*/
public function __construct($objParentObject, $intTime = 0, $blnPeriodic = true, $blnStartNow = true, $strTimerId = null)
{
try {
parent::__construct($objParentObject, $strTimerId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->intDeltaTime = $intTime;
$this->blnPeriodic = $blnPeriodic;
if ($intTime != QJsTimer::Stopped && $blnStartNow) {
$this->intState = QJsTimer::AutoStart;
}
//prepare to start the timer after the first action gets added
}
示例15: __construct
public function __construct($objParentObject, $strControlId = null)
{
// First, call the parent to do most of the basic setup
try {
parent::__construct($objParentObject, $strControlId);
} catch (QCallerException $objExc) {
$objExc->IncrementOffset();
throw $objExc;
}
$this->objParentObject = $objParentObject;
$objExpansionMap[RoleModule::ExpandModule] = true;
$this->objRoleModuleArray = RoleModule::LoadArrayByRoleIdAccessFlag(QApplication::$objUserAccount->RoleId, true, null, null, $objExpansionMap);
$this->lblSignOut_Create();
$this->lblLogo_Create();
$this->objDefaultWaitIcon_Create();
}