Esempio n. 1
0
    }
    if (isset($definitions)) {
        $totalDefinitionsCount = count($definitions);
        if (!$all && $totalDefinitionsCount > PREVIEW_LIMIT) {
            $definitions = array_slice($definitions, 0, PREVIEW_LIMIT);
            SmartyWrap::assign('totalDefinitionsCount', $totalDefinitionsCount);
        }
        $searchResults = SearchResult::mapDefinitionArray($definitions);
    }
}
$conjugations = NULL;
$declensions = NULL;
if ($searchType == SEARCH_INFLECTED || $searchType == SEARCH_LEXEM_ID || $searchType == SEARCH_FULL_TEXT || $searchType == SEARCH_MULTIWORD) {
    // Filter out hidden definitions
    $hiddenSources = array();
    SearchResult::filterHidden($searchResults, $hiddenSources);
    if (Config::get('global.aprilFoolsDay')) {
        foreach ($searchResults as $sr) {
            $sr->definition->htmlRep = StringUtil::iNoGrammer($sr->definition->htmlRep);
        }
    }
    SmartyWrap::assign('results', $searchResults);
    SmartyWrap::assign('hiddenSources', $hiddenSources);
    // Maps lexems to arrays of inflected forms (some lexems may lack inflections)
    // Also compute the text of the link to the paradigm div,
    // which can be 'conjugări', 'declinări' or both
    if (!empty($lexems)) {
        $conjugations = false;
        $declensions = false;
        foreach ($lexems as $l) {
            $lm = $l->getFirstLexemModel();