예제 #1
0
파일: term.php 프로젝트: alcf/chms
 protected function Form_Create()
 {
     $this->mctObject = ClassTermMetaControl::CreateFromPathInfo($this, QMetaControlCreateType::CreateOnRecordNotFound);
     if ($this->mctObject->EditMode) {
         $this->strPageTitle .= 'Edit Class Term';
     } else {
         $this->strPageTitle .= 'Create New Class Term';
     }
     $this->txtName = $this->mctObject->txtName_Create();
     $this->txtName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->chkActiveFlag = $this->mctObject->chkActiveFlag_Create();
     $this->btnSave = new QButton($this);
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->Text = $this->mctObject->EditMode ? 'Update' : 'Create';
     $this->btnSave->CausesValidation = true;
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->AddAction(new QClickEvent(), new QTerminateAction());
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
     if ($this->mctObject->EditMode) {
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->CssClass = 'delete';
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->AddAction(new QClickEvent(), new QConfirmAction('Are you SURE you want to PERMANENTLY DELETE this?'));
         $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
         $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
     }
 }
예제 #2
0
 /**
  * Static Helper Method to Create using QueryString arguments
  *
  * @param mixed $objParentObject QForm or QPanel which will be using this ClassTermMetaControl
  * @param QMetaControlCreateType $intCreateType rules governing ClassTerm object creation - defaults to CreateOrEdit
  * @return ClassTermMetaControl
  */
 public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     $intId = QApplication::QueryString('intId');
     return ClassTermMetaControl::Create($objParentObject, $intId, $intCreateType);
 }