Пример #1
0
 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();
 }
 protected function lstParentQcodoClass_Create()
 {
     $this->lstParentQcodoClass = new QListBox($this);
     $this->lstParentQcodoClass->Name = QApplication::Translate('Parent Qcodo Class');
     $this->lstParentQcodoClass->AddItem(QApplication::Translate('- Select One -'), null);
     $objParentQcodoClassArray = QcodoClass::LoadAll();
     if ($objParentQcodoClassArray) {
         foreach ($objParentQcodoClassArray as $objParentQcodoClass) {
             $objListItem = new QListItem($objParentQcodoClass->__toString(), $objParentQcodoClass->Id);
             if ($this->objQcodoClass->ParentQcodoClass && $this->objQcodoClass->ParentQcodoClass->Id == $objParentQcodoClass->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstParentQcodoClass->AddItem($objListItem);
         }
     }
 }
 protected function lstObjectType_Create()
 {
     $this->lstObjectType = new QListBox($this);
     $this->lstObjectType->Name = QApplication::Translate('Object Type');
     $this->lstObjectType->AddItem(QApplication::Translate('- Select One -'), null);
     $objObjectTypeArray = QcodoClass::LoadAll();
     if ($objObjectTypeArray) {
         foreach ($objObjectTypeArray as $objObjectType) {
             $objListItem = new QListItem($objObjectType->__toString(), $objObjectType->Id);
             if ($this->objVariable->ObjectType && $this->objVariable->ObjectType->Id == $objObjectType->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstObjectType->AddItem($objListItem);
         }
     }
 }
 protected function dtgQcodoClass_Bind()
 {
     // Get Total Count b/c of Pagination
     $this->dtgQcodoClass->TotalItemCount = QcodoClass::CountAll();
     $objClauses = array();
     if ($objClause = $this->dtgQcodoClass->OrderByClause) {
         array_push($objClauses, $objClause);
     }
     if ($objClause = $this->dtgQcodoClass->LimitClause) {
         array_push($objClauses, $objClause);
     }
     $this->dtgQcodoClass->DataSource = QcodoClass::LoadAll($objClauses);
 }
 protected function lstQcodoClass_Create()
 {
     $this->lstQcodoClass = new QListBox($this);
     $this->lstQcodoClass->Name = QApplication::Translate('Qcodo Class');
     $this->lstQcodoClass->Required = true;
     if (!$this->blnEditMode) {
         $this->lstQcodoClass->AddItem(QApplication::Translate('- Select One -'), null);
     }
     $objQcodoClassArray = QcodoClass::LoadAll();
     if ($objQcodoClassArray) {
         foreach ($objQcodoClassArray as $objQcodoClass) {
             $objListItem = new QListItem($objQcodoClass->__toString(), $objQcodoClass->Id);
             if ($this->objClassProperty->QcodoClass && $this->objClassProperty->QcodoClass->Id == $objQcodoClass->Id) {
                 $objListItem->Selected = true;
             }
             $this->lstQcodoClass->AddItem($objListItem);
         }
     }
 }