コード例 #1
0
ファイル: lexemEdit.php プロジェクト: florinp/dexonline
    $def->internalRepAbbrev = AdminStringUtil::expandAbbreviations($def->internalRep, $def->sourceId);
    $def->htmlRepAbbrev = AdminStringUtil::htmlize($def->internalRepAbbrev, $def->sourceId);
}
$searchResults = SearchResult::mapDefinitionArray($definitions);
$definitionLexem = mb_strtoupper(AdminStringUtil::internalize($lexem->form, false));
$meaningTags = Model::factory('MeaningTag')->order_by_asc('value')->find_many();
$ss = $lexem->structStatus;
$oss = $original->structStatus;
// syntactic sugar
$canEdit = array('general' => util_isModerator(PRIV_EDIT), 'defStructured' => util_isModerator(PRIV_EDIT), 'description' => util_isModerator(PRIV_EDIT), 'form' => !$lexem->isLoc() || util_isModerator(PRIV_LOC), 'hyphenations' => $ss == Lexem::STRUCT_STATUS_IN_PROGRESS || util_isModerator(PRIV_EDIT), 'loc' => (int) util_isModerator(PRIV_LOC), 'meanings' => $ss == Lexem::STRUCT_STATUS_IN_PROGRESS || util_isModerator(PRIV_EDIT), 'paradigm' => util_isModerator(PRIV_EDIT), 'pronunciations' => $ss == Lexem::STRUCT_STATUS_IN_PROGRESS || util_isModerator(PRIV_EDIT), 'sources' => util_isModerator(PRIV_LOC | PRIV_EDIT), 'structStatus' => $oss == Lexem::STRUCT_STATUS_NEW || $oss == Lexem::STRUCT_STATUS_IN_PROGRESS || util_isModerator(PRIV_EDIT), 'tags' => util_isModerator(PRIV_LOC | PRIV_EDIT), 'variants' => $ss == Lexem::STRUCT_STATUS_IN_PROGRESS || util_isModerator(PRIV_EDIT));
// Prepare a list of models for each LexemModel, to be used in the paradigm drop-down.
$models = array();
foreach ($lexem->getLexemModels() as $lm) {
    $models[] = FlexModel::loadByType($lm->modelType);
}
$stemLexemModel = LexemModel::create('T', 1);
SmartyWrap::assign('lexem', $lexem);
SmartyWrap::assign('lexemModels', $lexem->getLexemModels());
SmartyWrap::assign('stemLexemModel', $stemLexemModel);
SmartyWrap::assign('searchResults', $searchResults);
SmartyWrap::assign('definitionLexem', $definitionLexem);
SmartyWrap::assign('homonyms', Model::factory('Lexem')->where('formNoAccent', $lexem->formNoAccent)->where_not_equal('id', $lexem->id)->find_many());
SmartyWrap::assign('meaningTags', $meaningTags);
SmartyWrap::assign('modelTypes', Model::factory('ModelType')->order_by_asc('code')->find_many());
SmartyWrap::assign('models', $models);
SmartyWrap::assign('jsonSources', Source::getJson());
SmartyWrap::assign('modelsT', FlexModel::loadByType('T'));
SmartyWrap::assign('canEdit', $canEdit);
SmartyWrap::assign('structStatusNames', Lexem::$STRUCT_STATUS_NAMES);
SmartyWrap::addCss('jqueryui-smoothness', 'paradigm', 'select2', 'lexemEdit', 'windowEngine', 'textComplete');
SmartyWrap::addJs('jqueryui', 'select2', 'select2Dev', 'lexemEdit', 'windowEngine', 'cookie', 'modelDropdown', 'textComplete');