/** * Create and setup QListBox lstWikiItemAsCurrent * @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 lstWikiItemAsCurrent_Create($strControlId = null, QQCondition $objCondition = null, $objOptionalClauses = null) { $this->lstWikiItemAsCurrent = new QListBox($this->objParentObject, $strControlId); $this->lstWikiItemAsCurrent->Name = QApplication::Translate('Wiki Item As Current'); $this->lstWikiItemAsCurrent->AddItem(QApplication::Translate('- Select One -'), null); // Setup and perform the Query if (is_null($objCondition)) { $objCondition = QQ::All(); } $objWikiItemCursor = WikiItem::QueryCursor($objCondition, $objOptionalClauses); // Iterate through the Cursor while ($objWikiItem = WikiItem::InstantiateCursor($objWikiItemCursor)) { $objListItem = new QListItem($objWikiItem->__toString(), $objWikiItem->Id); if ($objWikiItem->CurrentWikiVersionId == $this->objWikiVersion->Id) { $objListItem->Selected = true; } $this->lstWikiItemAsCurrent->AddItem($objListItem); } // Return the QListBox return $this->lstWikiItemAsCurrent; }