$hasUnrecommendedForms = false; foreach ($ifMaps as $ifMap) { foreach ($ifMap as $rank => $ifs) { foreach ($ifs as $if) { $hasUnrecommendedForms |= !$if->recommended; } } } smarty_assign('hasUnrecommendedForms', $hasUnrecommendedForms); if ($showParadigm) { smarty_assign('ifMaps', $ifMaps); } smarty_assign('declensionText', $declensionText); $sourceNamesArr = array(); foreach ($lexems as $l) { $sourceNamesArr[] = LexemSources::getNamesOfSources($l->source); } smarty_assign('sourceNamesArr', $sourceNamesArr); } } if (pref_getServerPreference('logSearch')) { $logDefinitions = isset($definitions) ? $definitions : array(); $log = new Log($cuv, $redirectFrom, $searchType, $redirect, $logDefinitions); $log->logData(); } $sourceList = array(); if (isset($searchResults)) { foreach ($searchResults as $row) { if (!in_array($row->source->shortName, $sourceList)) { $sourceList[] = $row->source->shortName; }
$definitionLexem = mb_strtoupper(AdminStringUtil::internalize($lexem->form, false)); // Generate new inflected forms, but do not overwrite the old ones. $ifs = $lexem->generateParadigm(); if (!is_array($ifs)) { $infl = Inflection::get_by_id($ifs); if (!$errorMessage) { $errorMessage = "Nu pot genera flexiunea '" . htmlentities($infl->description) . "' " . "conform modelului {$lexem->modelType}{$lexem->modelNumber}."; } } else { $ifMap = InflectedForm::mapByInflectionRank($ifs); smarty_assign('ifMap', $ifMap); smarty_assign('searchResults', $searchResults); } $models = FlexModel::loadByType($lexem->modelType); $sources = LexemSources::getSourceArrayChecked($lexem->source); $sourceNames = LexemSources::getNamesOfSources($lexem->source); $canEditForm = !$lexem->isLoc || util_isModerator(PRIV_LOC); smarty_assign('lexem', $lexem); smarty_assign('sources', $sources); smarty_assign('sourceNames', $sourceNames); smarty_assign('searchResults', $searchResults); smarty_assign('definitionLexem', $definitionLexem); smarty_assign('homonyms', Model::factory('Lexem')->where('formNoAccent', $lexem->formNoAccent)->where_not_equal('id', $lexem->id)->find_many()); smarty_assign('suggestedLexems', loadSuggestions($lexem, 5)); smarty_assign('restrS', FlexStringUtil::contains($lexem->restriction, 'S')); smarty_assign('restrP', FlexStringUtil::contains($lexem->restriction, 'P')); smarty_assign('restrU', FlexStringUtil::contains($lexem->restriction, 'U')); smarty_assign('restrI', FlexStringUtil::contains($lexem->restriction, 'I')); smarty_assign('restrT', FlexStringUtil::contains($lexem->restriction, 'T')); smarty_assign('modelTypes', Model::factory('ModelType')->order_by_asc('code')->find_many()); smarty_assign('models', $models);