示例#1
0
文件: category.php 项目: alcf/chms
 protected function Form_Create()
 {
     $this->mctClassifiedCategory = ClassifiedCategoryMetaControl::Create($this, QApplication::PathInfo(0), QMetaControlCreateType::CreateOrEdit);
     if (!$this->mctClassifiedCategory->EditMode) {
         $this->mctClassifiedCategory->ClassifiedCategory->OrderNumber = 0;
     }
     $this->strPageTitle = 'Classifieds - ' . ($this->mctClassifiedCategory->EditMode ? 'Edit' : 'Create New') . ' Posting Category';
     $this->txtName = $this->mctClassifiedCategory->txtName_Create();
     $this->txtName->Required = true;
     $this->txtToken = $this->mctClassifiedCategory->txtToken_Create();
     $this->txtToken->Required = true;
     $this->txtDescription = $this->mctClassifiedCategory->txtDescription_Create();
     $this->txtDescription->Required = true;
     $this->txtDescription->Instructions = 'HTML of Description Text for this Posting Category';
     $this->txtDisclaimer = $this->mctClassifiedCategory->txtDisclaimer_Create();
     $this->txtDisclaimer->Required = true;
     $this->txtDisclaimer->Instructions = 'HTML of the ALCF Disclaimer to be placed at the top of the Submission Request screen';
     $this->txtInstructions = $this->mctClassifiedCategory->txtInstructions_Create();
     $this->txtInstructions->Required = true;
     $this->txtInstructions->Instructions = 'Bullet points of what needs to be included in every post (one per line)';
     $this->btnSave = new QButton($this);
     $this->btnSave->Text = $this->mctClassifiedCategory->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());
     if (!$this->mctClassifiedCategory->ClassifiedCategory->CountClassifiedPosts()) {
         $this->btnDelete = new QLinkButton($this);
         $this->btnDelete->Text = 'Delete';
         $this->btnDelete->CssClass = 'delete';
         $this->btnDelete->AddAction(new QClickEvent(), new QAjaxAction('btnDelete_Click'));
         $this->btnDelete->AddAction(new QClickEvent(), new QTerminateAction());
     }
 }
 /**
  * Static Helper Method to Create using QueryString arguments
  *
  * @param mixed $objParentObject QForm or QPanel which will be using this ClassifiedCategoryMetaControl
  * @param QMetaControlCreateType $intCreateType rules governing ClassifiedCategory object creation - defaults to CreateOrEdit
  * @return ClassifiedCategoryMetaControl
  */
 public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit)
 {
     $intId = QApplication::QueryString('intId');
     return ClassifiedCategoryMetaControl::Create($objParentObject, $intId, $intCreateType);
 }