コード例 #1
0
ファイル: edit.php プロジェクト: alcf/chms
 protected function Form_Create()
 {
     $this->mctCommentCategory = CommentCategoryMetaControl::Create($this, QApplication::PathInfo(0), QMetaControlCreateType::CreateOrEdit);
     if (!$this->mctCommentCategory->EditMode) {
         $this->mctCommentCategory->CommentCategory->OrderNumber = 0;
     }
     $this->strPageTitle = 'Administration - ' . ($this->mctCommentCategory->EditMode ? 'Edit' : 'Create New') . ' Comment Category';
     $this->txtName = $this->mctCommentCategory->txtName_Create();
     $this->txtName->AddAction(new QEnterKeyEvent(), new QTerminateAction());
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = $this->mctCommentCategory->EditMode ? 'Update' : 'Create';
     $this->btnSave->CssClass = 'primary';
     $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
     $this->btnSave->CausesValidation = true;
     $this->btnCancel = new QLinkButton($this);
     $this->btnCancel->Text = 'Cancel';
     $this->btnCancel->CssClass = 'cancel';
     $this->btnCancel->AddAction(new QClickEvent(), new QAjaxAction('btnCancel_Click'));
     $this->btnCancel->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 CommentCategoryMetaControl
  * @param QMetaControlCreateType $intCreateType rules governing CommentCategory object creation - defaults to CreateOrEdit
  * @return CommentCategoryMetaControl
  */
 public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     $intId = QApplication::QueryString('intId');
     return CommentCategoryMetaControl::Create($objParentObject, $intId, $intCreateType);
 }