Beispiel #1
0
 protected function Form_Create()
 {
     parent::Form_Create();
     $objShowcases = ShowcaseItem::LoadArrayByLiveFlag(true);
     $this->objShowcaseArray = array();
     while (count($this->objShowcaseArray) < 14 && count($objShowcases)) {
         $intKeyArray = array_keys($objShowcases);
         $intRandomKey = $intKeyArray[rand(0, count($intKeyArray) - 1)];
         $this->objShowcaseArray[] = $objShowcases[$intRandomKey];
         unset($objShowcases[$intRandomKey]);
     }
     $this->btnNew = new RoundedLinkButton($this);
     $this->btnNew->Text = 'Submit a Project or Site';
     $this->btnNew->AddAction(new QClickEvent(), new QAjaxAction('btnNew_Click'));
     $this->btnNew->AddAction(new QClickEvent(), new QTerminateAction());
     $this->pxyItem = new QControlProxy($this);
     $this->pxyItem->AddAction(new QClickEvent(), new QAjaxAction('pxyItem_Click'));
     $this->pxyItem->AddAction(new QClickEvent(), new QTerminateAction());
     if (ShowcaseItem::IsAdminableForPerson(QApplication::$Person)) {
         $this->btnAdmin = new RoundedLinkButton($this);
         $this->btnAdmin->Text = 'Administer Showcase Items';
         $this->btnAdmin->LinkUrl = '/showcase/admin.php';
     }
     $this->dlgBox = new QDialogBox($this);
     $this->dlgBox->MatteClickable = true;
     $this->dlgBox->HideDialogBox();
     $this->btnClose = new QButton($this->dlgBox);
     $this->btnClose->AddAction(new QClickEvent(), new QHideDialogBox($this->dlgBox));
     $this->txtName = new QTextBox($this->dlgBox);
     $this->txtName->Required = true;
     $this->txtDescription = new QTextBox($this->dlgBox);
     $this->txtDescription->TextMode = QTextMode::MultiLine;
     $this->txtUrl = new UrlTextBox($this->dlgBox);
     $this->txtUrl->Required = true;
     $this->flcImage = new QFileControl($this->dlgBox);
     $this->flcImage->Required = true;
     $this->btnOkay = new QButton($this->dlgBox);
     $this->btnOkay->CausesValidation = true;
     $this->btnOkay->AddAction(new QClickEvent(), new QServerAction('btnOkay_Click'));
     $this->btnCancel = new QLinkButton($this->dlgBox);
     $this->btnCancel->AddAction(new QClickEvent(), new QHideDialogBox($this->dlgBox));
     $this->btnCancel->AddAction(new QClickEvent(), new QTerminateAction());
 }