/** * Prints the result of the search for attribute <code>attribute</code> to * <code>$wgOut</code> * * @param $attribute String: attribute */ private function printSearchResult($attribute) { global $wgOut; if (strlen($attribute)) { try { $searchResult = new TagCloud($attribute); } catch (InvalidAttributeException $e) { if ($attribute) { $proposal = new Proposal($attribute); // Attribute not found -> show attributes that are related try { // Only if suggestions found if ($proposal->getProposal()) { $wgOut->addHTML(wfMsg('fptc-suggestion')); $wgOut->addHTML(' '); } $w = 1; foreach ($proposal->getProposal() as $possibleAttribute) { $wgOut->addHTML('<a href=' . $possibleAttribute . '>' . $possibleAttribute . '</a>'); if ($w < count($proposal->getProposal())) { $wgOut->addHTML(', '); } $w++; } } catch (InvalidAttributeException $e) { $wgOut->addHTML(wfMsg('fptc-no-suggestion')); } if ($proposal->getProposal()) { $wgOut->addHTML('<br /><br />'); } } } } }