コード例 #1
0
 function hasRestriction($letter)
 {
     return FlexStringUtil::contains($this->restriction, $letter);
 }
コード例 #2
0
$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);
smarty_assign('canEditForm', $canEditForm);
smarty_assign('allStatuses', util_getAllStatuses());
smarty_assign('errorMessage', $errorMessage);
smarty_assign('recentLinks', RecentLink::loadForUser());
smarty_displayWithoutSkin('admin/lexemEdit.ihtml');
function validate($lexem)
{
    if (!$lexem->form) {
        return 'Forma nu poate fi vidă.';
    }
    $numAccents = mb_substr_count($lexem->form, "'");
    // Note: we allow multiple accents for lexems like hárcea-párcea
    if ($numAccents && $lexem->noAccent) {