当前位置: 首页>>代码示例>>PHP>>正文


PHP SmartyWrap::addJs方法代码示例

本文整理汇总了PHP中SmartyWrap::addJs方法的典型用法代码示例。如果您正苦于以下问题:PHP SmartyWrap::addJs方法的具体用法?PHP SmartyWrap::addJs怎么用?PHP SmartyWrap::addJs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SmartyWrap的用法示例。


在下文中一共展示了SmartyWrap::addJs方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: util_assertModerator

<?php

require_once "../../phplib/util.php";
util_assertModerator(PRIV_EDIT);
util_assertNotMirror();
$reports = array(array('text' => 'Definiții nemoderate', 'url' => 'admin/viewPendingDefinitions', 'count' => Model::factory('Definition')->where('status', ST_PENDING)->count(), 'privilege' => PRIV_EDIT), array('text' => 'Definiții cu greșeli de tipar', 'url' => 'admin/viewTypos', 'count' => Model::factory('Typo')->select('definitionId')->distinct()->count(), 'privilege' => PRIV_EDIT), array('text' => 'Definiții cu abrevieri ambigue', 'url' => 'admin/randomAbbrevReview', 'count' => Definition::countAmbiguousAbbrevs(), 'privilege' => PRIV_EDIT), array('text' => 'Definiții OCR neverificate', 'url' => 'admin/definitionEdit', 'count' => sprintf("%d (disponibile: %d)", Model::factory('OCR')->where('status', 'raw')->count(), OCR::countAvailable(session_getUserId())), 'privilege' => PRIV_EDIT), array('text' => 'Definiții neasociate cu niciun lexem', 'url' => 'admin/viewUnassociatedDefinitions', 'count' => Definition::countUnassociated(), 'privilege' => PRIV_EDIT), array('text' => 'Lexeme neasociate cu nicio definiție', 'url' => 'admin/viewUnassociatedLexems', 'count' => Lexem::countUnassociated(), 'privilege' => PRIV_EDIT), array('text' => 'Lexeme cu comentarii', 'url' => 'admin/viewLexemsWithComments', 'count' => Model::factory('Lexem')->where_not_null('comment')->count(), 'privilege' => PRIV_EDIT), array('text' => 'Lexeme fără accent', 'url' => 'admin/viewLexemsWithoutAccents', 'count' => Model::factory('Lexem')->where('consistentAccent', 0)->count(), 'privilege' => PRIV_EDIT), array('text' => 'Lexeme ambigue', 'url' => 'admin/viewAmbiguousLexems', 'count' => 'numărătoare dezactivată', 'privilege' => PRIV_EDIT), array('text' => 'Lexeme fără paradigme', 'url' => 'admin/viewTemporaryLexems', 'count' => Model::factory('LexemModel')->where('modelType', 'T')->count(), 'privilege' => PRIV_EDIT));
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::assign("allStatuses", util_getAllStatuses());
SmartyWrap::assign('structStatusNames', Lexem::$STRUCT_STATUS_NAMES);
SmartyWrap::assign('reports', $reports);
SmartyWrap::assign('sectionTitle', 'Pagina moderatorului');
SmartyWrap::addCss('jqueryui', 'select2');
SmartyWrap::addJs('jquery', 'jqueryui', 'select2', 'select2Dev', 'modelDropdown');
SmartyWrap::displayAdminPage('admin/index.ihtml');
开发者ID:Jobava,项目名称:mirror-dexonline,代码行数:14,代码来源:index.php

示例2: implode

        $pageDescription .= " din dicționarele: " . implode(", ", $sourceList);
    }
    SmartyWrap::assign('pageDescription', $pageDescription);
}
// Ads
AdsModule::runAllModules(empty($lexems) ? null : $lexems, empty($definitions) ? null : $definitions);
SmartyWrap::assign('text', $text);
SmartyWrap::assign('searchType', $searchType);
SmartyWrap::assign('showParadigm', $showParadigm);
SmartyWrap::assign('locParadigm', session_user_prefers(Preferences::LOC_PARADIGM));
SmartyWrap::assign('paradigmLink', $paradigmLink);
SmartyWrap::assign('advancedSearch', $text || $sourceId);
/* Gallery */
$images = empty($lexems) ? array() : Visual::loadAllForLexems($lexems);
SmartyWrap::assign('images', $images);
if (count($images)) {
    SmartyWrap::addCss('gallery');
    SmartyWrap::addJs('gallery');
}
if (!$xml) {
    SmartyWrap::addCss('paradigm');
    SmartyWrap::display('search.tpl');
} else {
    header('Content-type: text/xml');
    SmartyWrap::displayWithoutSkin('xml/search.tpl');
}
if (Config::get('global.logSearch')) {
    $logDefinitions = isset($definitions) ? $definitions : array();
    $log = new Log($cuv, $redirectFrom, $searchType, $redirect, $logDefinitions);
    $log->logData();
}
开发者ID:florinp,项目名称:dexonline,代码行数:31,代码来源:search.php

示例3: array

if ($submitButton) {
    // Re-rank the inflections according to the order in $inflectionIds
    $modelTypeMap = array();
    foreach ($inflectionIds as $inflId) {
        $infl = Inflection::get_by_id($inflId);
        $rank = array_key_exists($infl->modelType, $modelTypeMap) ? $modelTypeMap[$infl->modelType] + 1 : 1;
        $modelTypeMap[$infl->modelType] = $rank;
        $infl->rank = $rank;
        $infl->save();
    }
    // Add a new inflection if one is given
    if ($newDescription) {
        $infl = Model::factory('Inflection')->create();
        $infl->description = $newDescription;
        $infl->modelType = $newModelType;
        $infl->rank = $modelTypeMap[$newModelType] + 1;
        $infl->save();
    }
    util_redirect('flexiuni');
}
// Tag inflections which can be safely deleted (only those that aren't being used by any model)
$inflections = Model::factory('Inflection')->order_by_asc('modelType')->order_by_asc('rank')->find_many();
$usedInflectionIds = db_getArray('select distinct inflectionId from ModelDescription');
foreach ($inflections as $infl) {
    $infl->canDelete = !in_array($infl->id, $usedInflectionIds);
}
SmartyWrap::assign('suggestHiddenSearchForm', true);
SmartyWrap::assign('inflections', $inflections);
SmartyWrap::assign('modelTypes', ModelType::loadCanonical());
SmartyWrap::addJs('jqTableDnd');
SmartyWrap::display('flexiuni.tpl');
开发者ID:florinp,项目名称:dexonline,代码行数:31,代码来源:flexiuni.php

示例4: util_assertModerator

<?php

require_once "../../phplib/util.php";
util_assertModerator(PRIV_VISUAL);
util_assertNotMirror();
RecentLink::createOrUpdate('Adăugare imagini definiții');
SmartyWrap::assign('sectionTitle', 'Imagini pentru definiții');
SmartyWrap::addCss('elfinder', 'jqueryui');
SmartyWrap::addJs('jquery', 'jqueryui', 'elfinder', 'visual');
SmartyWrap::displayAdminPage('admin/visual.ihtml');
开发者ID:Jobava,项目名称:mirror-dexonline,代码行数:10,代码来源:visual.php

示例5: setlocale

<?php

require_once "../phplib/util.php";
setlocale(LC_ALL, "ro_RO.utf8");
SmartyWrap::addCss('mill');
SmartyWrap::addJs('mill');
SmartyWrap::display("mill.tpl");
开发者ID:florinp,项目名称:dexonline,代码行数:7,代码来源:mill.php

示例6: count

        $definition->abbrevReview = count($ambiguousMatches) ? ABBREV_AMBIGUOUS : ABBREV_REVIEW_COMPLETE;
        $definition->save();
        log_userLog("Added definition {$definition->id} ({$definition->lexicon})");
        foreach ($lexemIds as $lexemId) {
            $lexemId = addslashes(AdminStringUtil::formatLexem($lexemId));
            if (StringUtil::startsWith($lexemId, '@')) {
                // create a new lexem
                $lexem = Lexem::deepCreate(substr($lexemId, 1), 'T', '1');
                $lexem->deepSave();
                LexemDefinitionMap::associate($lexem->id, $definition->id);
                log_userLog("Created lexem {$lexem->id} ({$lexem->form})");
            } else {
                $lexem = Lexem::get_by_id($lexemId);
                LexemDefinitionMap::associate($lexem->id, $definition->id);
                log_userLog("Associating with lexem {$lexem->id} ({$lexem->form})");
            }
        }
        FlashMessage::add('Definiția a fost trimisă. Un moderator o va examina în scurt timp. Vă mulțumim!', 'info');
        util_redirect('contribuie');
    }
} else {
    SmartyWrap::assign('sourceId', session_getDefaultContribSourceId());
}
SmartyWrap::assign('lexemIds', $lexemIds);
SmartyWrap::assign('contribSources', Model::factory('Source')->where('canContribute', true)->order_by_asc('displayOrder')->find_many());
SmartyWrap::assign('page_title', 'Contribuie cu definiții');
SmartyWrap::assign('suggestNoBanner', true);
SmartyWrap::addCss('jqueryui', 'select2');
SmartyWrap::addJs('jqueryui', 'select2', 'select2Dev');
SmartyWrap::display('contribuie.ihtml');
/**************************************************************************/
开发者ID:Jobava,项目名称:mirror-dexonline,代码行数:31,代码来源:contribuie.php

示例7: loadSetHomonyms

}
SmartyWrap::assign('isOCR', $isOCR);
if ($definitionId) {
    SmartyWrap::assign('definitionId', $definitionId);
}
SmartyWrap::assign('def', $definition);
SmartyWrap::assign('source', $source);
SmartyWrap::assign('sim', SimilarRecord::create($definition, $lexemIds));
SmartyWrap::assign('user', User::get_by_id($definition->userId));
SmartyWrap::assign('comment', $comment);
SmartyWrap::assign('commentUser', $commentUser);
SmartyWrap::assign('lexemIds', $lexemIds);
SmartyWrap::assign('typos', Typo::get_all_by_definitionId($definition->id));
SmartyWrap::assign('homonyms', loadSetHomonyms($lexems));
SmartyWrap::assign("allModeratorSources", Model::factory('Source')->where('canModerate', true)->order_by_asc('displayOrder')->find_many());
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::addCss('jqueryui', 'select2');
SmartyWrap::addJs('jquery', 'jqueryui', 'select2', 'select2Dev', 'definitionEdit');
SmartyWrap::displayAdminPage('admin/definitionEdit.tpl');
/**
 * Load all lexems having the same form as one of the given lexems, but exclude the given lexems.
 **/
function loadSetHomonyms($lexems)
{
    if (count($lexems) == 0) {
        return array();
    }
    $names = util_objectProperty($lexems, 'formNoAccent');
    $ids = util_objectProperty($lexems, 'id');
    return Model::factory('Lexem')->where_in('formNoAccent', $names)->where_not_in('id', $ids)->find_many();
}
开发者ID:florinp,项目名称:dexonline,代码行数:31,代码来源:definitionEdit.php

示例8: util_getRequestParameter

<?php

require_once "../phplib/util.php";
$form = util_getRequestParameter('form');
$locVersion = util_getRequestParameter('locVersion');
$locVersions = Config::getLocVersions();
if (!util_isModerator(PRIV_LOC)) {
    $locVersions = array_slice($locVersions, 1);
    // remove the version in progress
}
if ($locVersion && $form) {
    LocVersion::changeDatabase($locVersion);
    $form = StringUtil::cleanupQuery($form);
    $field = StringUtil::hasDiacritics($form) ? 'formNoAccent' : 'formUtf8General';
    $data = Model::factory('InflectedForm')->table_alias('I')->select('I.form', 'inflectedForm')->select('L.formNoAccent', 'lexemFormNoAccent')->select('L.form', 'lexemForm')->select('LM.modelType', 'modelType')->select('LM.modelNumber', 'modelNumber')->select('LM.restriction', 'restriction')->select('Infl.description', 'inflection')->join('LexemModel', 'I.lexemModelId = LM.id', 'LM')->join('Lexem', 'LM.lexemId = L.id', 'L')->join('ModelType', 'LM.modelType = MT.code', 'MT')->join('Model', 'MT.canonical = M.modelType and LM.modelNumber = M.number', 'M')->join('ModelDescription', 'M.id = MD.modelId and I.variant = MD.variant and I.inflectionId = MD.inflectionId', 'MD')->join('Inflection', 'I.inflectionId = Infl.id', 'Infl')->where('MD.applOrder', 0)->where("I.{$field}", $form)->where('LM.isLoc', 1)->where('MD.isLoc', 1)->order_by_asc('LM.lexemId')->find_array();
    SmartyWrap::assign('page_title', 'Verificare LOC: ' . $form);
    SmartyWrap::assign('form', $form);
    SmartyWrap::assign('selectedLocVersion', $locVersion);
    SmartyWrap::assign('data', $data);
} else {
    SmartyWrap::assign('selectedLocVersion', $locVersions[0]->name);
    SmartyWrap::assign('page_title', 'Căutare formă flexionară în LOC ' . $form);
}
SmartyWrap::addJs('modelDropdown');
SmartyWrap::assign('suggestHiddenSearchForm', true);
SmartyWrap::assign('page_title', 'Scrabble');
SmartyWrap::assign('locVersions', $locVersions);
SmartyWrap::display('scrabble.ihtml');
开发者ID:Jobava,项目名称:mirror-dexonline,代码行数:28,代码来源:scrabble.php

示例9: while

        $maxFreq = hard_medium;
        $maxLength = hardLength;
        break;
    case 2:
        $minFreq = hard_medium;
        $maxFreq = medium_easy;
        $maxLength = mediumLength;
        break;
    default:
        $minFreq = medium_easy;
        $maxFreq = maxFreq;
        $maxLength = easyLength;
}
$count = Model::factory('Lexem')->where_gte('frequency', $minFreq)->where_lte('frequency', $maxFreq)->where_raw('char_length(formUtf8General) >= 5')->where_raw('char_length(formUtf8General) <= ' . $maxLength)->count();
do {
    $lexem = Model::factory('Lexem')->where_gte('frequency', $minFreq)->where_lte('frequency', $maxFreq)->where_raw('char_length(formUtf8General) >= 5')->where_raw('char_length(formUtf8General) <= ' . $maxLength)->limit(1)->offset(rand(0, $count - 1))->find_one();
    // select all the definitions for the given lexem
    $defs = Model::factory('Definition')->select('Definition.*')->join('LexemDefinitionMap', 'Definition.id = ldm.definitionId', 'ldm')->join('Source', 's.id = sourceId', 's')->where('ldm.lexemId', $lexem->id)->where('status', 0)->where('s.isOfficial', 2)->order_by_asc('displayOrder')->find_many();
    // loop untill you find a lexem with a definition
} while (!$defs);
$searchResults = SearchResult::mapDefinitionArray($defs);
$word = mb_strtoupper($lexem->formNoAccent);
SmartyWrap::assign('wordLength', mb_strlen($word));
SmartyWrap::assign('letters', preg_split('//u', 'aăâbcdefghiîjklmnopqrsștțuvwxyz', null, PREG_SPLIT_NO_EMPTY));
SmartyWrap::assign('word', $word);
SmartyWrap::assign('searchResults', $searchResults);
SmartyWrap::assign('difficulty', $difficulty);
SmartyWrap::assign('suggestHiddenSearchForm', true);
SmartyWrap::addCss('hangman');
SmartyWrap::addJs('hangman', 'jqnotice');
SmartyWrap::display("hangman.tpl");
开发者ID:florinp,项目名称:dexonline,代码行数:31,代码来源:hangman.php

示例10:

<?php

require_once "../phplib/util.php";
SmartyWrap::assign('manualData', TopEntry::getTopData(CRIT_CHARS, SORT_DESC, true));
SmartyWrap::assign('bulkData', TopEntry::getTopData(CRIT_CHARS, SORT_DESC, false));
SmartyWrap::addCss('tablesorter');
SmartyWrap::addJs('pager', 'tablesorter');
SmartyWrap::display('top.tpl');
开发者ID:florinp,项目名称:dexonline,代码行数:8,代码来源:top.php

示例11: populate

$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');
SmartyWrap::displayAdminPage('admin/lexemEdit.tpl');
/**************************************************************************/
// Populate lexem fields from request parameters.
function populate(&$lexem, &$original, $lexemForm, $lexemNumber, $lexemDescription, $lexemComment, $needsAccent, $hyphenations, $pronunciations, $variantOfId, $structStatus, $modelType, $modelNumber, $restriction, $lmTags, $isLoc, $sourceIds)
{
    $lexem->form = AdminStringUtil::formatLexem($lexemForm);
    $lexem->formNoAccent = str_replace("'", '', $lexem->form);
    $lexem->number = $lexemNumber;
    $lexem->description = AdminStringUtil::internalize($lexemDescription, false);
    $lexem->comment = trim(AdminStringUtil::internalize($lexemComment, false));
    // Sign appended comments
    if (StringUtil::startsWith($lexem->comment, $original->comment) && $lexem->comment != $original->comment && !StringUtil::endsWith($lexem->comment, ']]')) {
        $lexem->comment .= " [[" . session_getUser() . ", " . strftime("%d %b %Y %H:%M") . "]]";
    }
    $lexem->noAccent = !$needsAccent;
开发者ID:florinp,项目名称:dexonline,代码行数:31,代码来源:lexemEdit.php

示例12: util_getRequestParameter

<?php

require_once "../phplib/util.php";
$title = util_getRequestParameter('title');
$wikiTitle = WikiArticle::urlTitleToWikiTitle($title);
$wa = WikiArticle::get_by_title(addslashes($wikiTitle));
if ($wa) {
    SmartyWrap::assign('wa', $wa);
    SmartyWrap::assign('page_title', $wikiTitle);
} else {
    SmartyWrap::assign('page_title', 'Articol inexistent');
}
SmartyWrap::assign('wikiTitles', WikiArticle::loadAllTitles());
SmartyWrap::addCss('tablesorter');
SmartyWrap::addJs('tablesorter');
SmartyWrap::display('wikiArticle.ihtml');
开发者ID:Jobava,项目名称:mirror-dexonline,代码行数:16,代码来源:wikiArticle.php

示例13: util_assertModerator

<?php

require_once "../../phplib/util.php";
util_assertModerator(PRIV_WOTD);
util_assertNotMirror();
RecentLink::createOrUpdate('Cuvântul zilei');
SmartyWrap::assign('downloadYear', date("Y", strtotime("+1 month")));
SmartyWrap::assign('downloadMonth', date("m", strtotime("+1 month")));
SmartyWrap::addCss('jqgrid', 'jqueryui', 'select2');
SmartyWrap::addJs('jquery', 'jqgrid', 'jqueryui', 'wotd', 'select2');
SmartyWrap::displayAdminPage('admin/wotd.tpl');
开发者ID:florinp,项目名称:dexonline,代码行数:11,代码来源:wotd.php

示例14: equalArrays

SmartyWrap::assign('modelNumber', $modelNumber);
SmartyWrap::assign('newModelNumber', $newModelNumber);
SmartyWrap::assign('exponent', $exponent);
SmartyWrap::assign('newExponent', $newExponent);
SmartyWrap::assign('description', $model->description);
SmartyWrap::assign('newDescription', $newDescription);
SmartyWrap::assign('participleNumber', $participleNumber);
SmartyWrap::assign('newParticipleNumber', $newParticipleNumber);
SmartyWrap::assign('newForms', $newForms);
SmartyWrap::assign('inputValues', $inputValues);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::assign('wasPreviewed', $previewButton);
SmartyWrap::assign('errorMessage', $errorMessage);
SmartyWrap::assign('sectionTitle', "Editare model {$modelType}{$modelNumber}");
SmartyWrap::addCss('paradigm', 'jqueryui');
SmartyWrap::addJs('jquery', 'jqueryui');
SmartyWrap::displayAdminPage('admin/editModel.ihtml');
/****************************************************************************/
/**
 * $a, $b: arrays of ($form, $isLoc, $recommended) tuples. Only compares the forms.
 */
function equalArrays($a, $b)
{
    if (count($a) != count($b)) {
        return false;
    }
    foreach ($a as $key => $tuple) {
        if ($a[$key]['form'] != $b[$key]['form']) {
            return false;
        }
    }
开发者ID:Jobava,项目名称:mirror-dexonline,代码行数:31,代码来源:editModel.php

示例15: util_getRequestParameter

<?php

require_once "../phplib/util.php";
$submitButton = util_getRequestParameter('submitButton');
if ($submitButton) {
    util_assertModerator(PRIV_ADMIN);
    $order = 1;
    $ids = util_getRequestParameter("ids");
    foreach ($ids as $id) {
        $src = Source::get_by_id($id);
        $src->displayOrder = $order++;
        $src->save();
    }
    FlashMessage::add('Ordinea a fost salvată.', 'info');
    util_redirect('surse');
}
if (util_isModerator(PRIV_VIEW_HIDDEN)) {
    $sources = Model::factory('Source')->order_by_asc('displayOrder')->find_many();
} else {
    $sources = Model::factory('Source')->where_not_equal('isOfficial', SOURCE_TYPE_HIDDEN)->order_by_asc('displayOrder')->find_many();
}
SmartyWrap::assign('sources', $sources);
SmartyWrap::addCss('jqueryui');
SmartyWrap::addJs('jqueryui', 'jqTableDnd', 'tablesorter');
SmartyWrap::display('surse.tpl');
开发者ID:florinp,项目名称:dexonline,代码行数:25,代码来源:surse.php


注:本文中的SmartyWrap::addJs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。