Beispiel #1
0
 protected function btnOkay_Click()
 {
     if (!$this->IsImageUploadedValid()) {
         $this->flcImage->Warning = 'Invalid Image File';
         return;
     }
     $objShowcaseItem = new ShowcaseItem();
     $objShowcaseItem->Person = QApplication::$Person;
     $objShowcaseItem->Name = trim($this->txtName->Text);
     $objShowcaseItem->Description = trim($this->txtDescription->Text);
     $objShowcaseItem->Url = trim($this->txtUrl->Text);
     $objShowcaseItem->LiveFlag = false;
     $objShowcaseItem->SaveWithImage($this->flcImage->File);
     $this->dlgBox->HideDialogBox();
     QApplication::DisplayAlert('Thank you for your submission!  We will email you if/when your showcase item is posted.');
 }
    // Set the DisplayName
    $objPerson->RefreshDisplayName();
    // Update the MaxId count
    $intMaxPersonId = $objPerson->Id;
}
//////////////////////
// Showcase Tables and Classes
//////////////////////
while (QDataGen::DisplayWhileTask('Generating Showcase Items...', GENERATE_SHOWCASE)) {
    $objShowcase = new ShowcaseItem();
    $objShowcase->Person = Person::Load(rand(1, $intMaxPersonId));
    $objShowcase->Name = QDataGen::GenerateTitle(1, 8);
    $objShowcase->Description = QDataGen::GenerateContent(rand(1, 2), 20, 40);
    $objShowcase->Url = 'http://www.foobar.com/';
    $objShowcase->LiveFlag = rand(0, 4);
    $objShowcase->SaveWithImage(QDataGen::GenerateFromArray($strRandomImagePathArray));
}
//////////////////////
// Wiki Tables and Classes
//////////////////////
while (QDataGen::DisplayWhileTask('Generating Wiki Items...', GENERATE_WIKI)) {
    $intWikiItemTypeId = rand(1, WikiItemType::MaxId);
    $intPathLength = rand(1, 3);
    if ($intWikiItemTypeId == WikiItemType::Page) {
        $strPath = '';
    } else {
        $strPath = '';
        for ($intIndex = 0; $intIndex < $intPathLength; $intIndex++) {
            $strPath .= '/' . QDataGen::GenerateTitle(1, 2);
        }
    }