* the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$t_subject = $this->getVar('t_subject');
$vs_search = $this->getVar('search');
?>
	
<div id="resultBox">
	<div class="subTitle"><?php 
print $this->getVar('search') ? _t("Your search found no %1", $this->getVar('mode_type_plural')) : _t("Please enter a search");
?>
</div>
<?php 
if (sizeof($va_suggestions = DidYouMean::suggest($vs_search, $t_subject->tableNum(), 10))) {
    $vn_top_score = null;
    $va_suggestions_to_use = array();
    foreach ($va_suggestions as $vs_suggestion => $vn_score) {
        if (!$vn_top_score) {
            $vn_top_score = $vn_score;
        }
        if ($vn_top_score == $vn_score) {
            $va_suggestions_to_use[] = caNavLink($this->request, $vs_suggestion, 'searchSuggestion', 'find', 'SearchObjects', 'Index', array('search' => $vs_suggestion));
        }
    }
    if (sizeof($va_suggestions_to_use) > 1) {
        print "<div class='searchSuggestion'>" . _t("Did you mean one of these: %1 ?", join(', ', $va_suggestions_to_use)) . "</div>";
    } else {
        print "<div class='searchSuggestion'>" . _t("Did you mean %1 ?", $va_suggestions_to_use[0]) . "</div>";
    }
 public static function articleUndelete(&$title, &$create)
 {
     if ($create == false || $title->getNamespace() != 0) {
         return true;
     }
     # TODO it's not possible to detect if the undeleted article is a redirect!
     #$artic1e = new Article( $title );
     #if ($article->isRedirect( $article->getContent() )) {
     #	return true;
     #}
     DidYouMean::doInsert($title->getArticleId(), $title->getText());
     return true;
 }