コード例 #1
0
 protected function Form_Create()
 {
     if (!QApplication::$User) {
         $this->RedirectToListPage();
     }
     // Use the CreateFromPathInfo shortcut (this can also be done manually using the WordMetaControl constructor)
     // MAKE SURE we specify "$this" as the MetaControl's (and thus all subsequent controls') parent
     $this->mctWord = WordMetaControl::CreateFromPathInfo($this);
     // Call MetaControl's methods to create qcontrols based on Word's data fields
     $this->lblWordId = $this->mctWord->lblWordId_Create();
     $this->lblWordId->Name = 'Id';
     $this->txtWord = $this->mctWord->txtWord_Create();
     $this->txtWord->Name = 'Cuvânt';
     $this->lstStatusType = $this->mctWord->lstStatusType_Create();
     $this->lstStatusType->Name = 'Stare';
     $this->txtProposalCount = $this->mctWord->txtProposalCount_Create();
     $this->txtProposalCount->Enabled = false;
     $this->txtProposalCount->Name = 'Propuneri';
     $this->calLastSent = $this->mctWord->calLastSent_Create();
     $this->calLastSent->Name = 'Ultima propunere';
     $this->calLastSent->Enabled = false;
     // Create Buttons and Actions on this Form
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = QApplication::Translate('Save');
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QButton($this);
     $this->btnCancel->Text = QApplication::Translate('Cancel');
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnDelete = new QButton($this);
     $this->btnDelete->Text = QApplication::Translate('Delete');
     $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction(QApplication::Translate('Are you SURE you want to DELETE this') . ' ' . QApplication::Translate('Word') . '?'));
     $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
     $this->btnDelete->Visible = $this->mctWord->EditMode;
 }
コード例 #2
0
 /**
  * Static Helper Method to Create using QueryString arguments
  *
  * @param mixed $objParentObject QForm or QPanel which will be using this WordMetaControl
  * @param QMetaControlCreateType $intCreateType rules governing Word object creation - defaults to CreateOrEdit
  * @return WordMetaControl
  */
 public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     $intWordId = QApplication::QueryString('intWordId');
     return WordMetaControl::Create($objParentObject, $intWordId, $intCreateType);
 }