コード例 #1
0
$searchResults = SearchResult::mapDefinitionArray($definitions);
$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());