/** * Create and setup QListBox lstWikiImage * @param string $strControlId optional ControlId to use * @param QQCondition $objConditions override the default condition of QQ::All() to the query, itself * @param QQClause[] $objOptionalClauses additional optional QQClause object or array of QQClause objects for the query * @return QListBox */ public function lstWikiImage_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstWikiImage = new QListBox($this->objParentObject, $strControlId); $this->lstWikiImage->Name = QApplication::Translate('Wiki Image'); $this->lstWikiImage->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objWikiImageCursor = WikiImage::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objWikiImage = WikiImage::InstantiateCursor($objWikiImageCursor)) { $objListItem = new QListItem($objWikiImage->__toString(), $objWikiImage->WikiVersionId); if ($objWikiImage->WikiVersionId == $this->objWikiVersion->Id) { $objListItem->Selected = true; } $this->lstWikiImage->AddItem($objListItem); } // Because WikiImage's WikiImage is not null, if a value is already selected, it cannot be changed. if ($this->lstWikiImage->SelectedValue) { $this->lstWikiImage->Enabled = false; } // Return the QListBox return $this->lstWikiImage; }