本文整理汇总了PHP中SmartyWrap::displayAdminPage方法的典型用法代码示例。如果您正苦于以下问题:PHP SmartyWrap::displayAdminPage方法的具体用法?PHP SmartyWrap::displayAdminPage怎么用?PHP SmartyWrap::displayAdminPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartyWrap
的用法示例。
在下文中一共展示了SmartyWrap::displayAdminPage方法的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');
示例2: util_assertModerator
<?php
require_once "../../phplib/util.php";
util_assertModerator(PRIV_EDIT);
util_assertNotMirror();
RecentLink::createOrUpdate('Lexeme ambigue');
$lexems = Lexem::loadAmbiguous();
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::assign('lexems', $lexems);
SmartyWrap::displayAdminPage('admin/viewAmbiguousLexems.tpl');
示例3: array
// $lmMatrix[$i][$j] = lexem model (with inflected forms) for lexem $i and model $j
$lmMatrix = array();
foreach ($lexems as $l) {
$lm = $l->getFirstLexemModel();
$lmArray = array();
foreach ($models as $m) {
// Force a reload
$lm = LexemModel::get_by_id($lm->id);
$lm->modelType = $m->modelType;
$lm->modelNumber = $m->number;
$lm->generateInflectedFormMap();
$lmArray[] = $lm;
}
$lmMatrix[] = $lmArray;
}
// Load the definitions for each lexem
$searchResults = array();
foreach ($lexems as $l) {
$definitions = Definition::loadByLexemId($l->id);
$searchResults[] = SearchResult::mapDefinitionArray($definitions);
}
SmartyWrap::assign('suffix', $suffix);
SmartyWrap::assign('lexems', $lexems);
SmartyWrap::assign('models', $models);
SmartyWrap::assign('modelTypes', $modelTypes);
SmartyWrap::assign('searchResults', $searchResults);
SmartyWrap::assign('lmMatrix', $lmMatrix);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::addCss('paradigm');
SmartyWrap::displayAdminPage('admin/bulkLabel.tpl');
示例4: util_assertModerator
<?php
require_once "../../phplib/util.php";
util_assertModerator(PRIV_EDIT);
util_assertNotMirror();
RecentLink::createOrUpdate('Lexeme neasociate');
$lexems = Lexem::loadUnassociated();
SmartyWrap::assign('lexems', $lexems);
SmartyWrap::assign('sectionTitle', 'Lexeme neasociate');
SmartyWrap::assign('sectionCount', count($lexems));
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/lexemList.ihtml');
示例5: foreach
}
// Delete lexems
foreach ($deleteMap as $lId => $value) {
if ($value == 2) {
// Checked and confirmed
$l = Lexem::get_by_id($lId);
$l->delete();
}
}
// Now save the ones that can be saved and present errors for the others
foreach ($lexemMap as $id => $l) {
if (!array_key_exists($id, $errorMap) && !array_key_exists($id, $deleteMap)) {
$l->save();
$lm = $l->getFirstLexemModel();
$lm->save();
$lm->regenerateParadigm();
}
}
}
$deSource = Source::get_by_shortName('DE');
$lexems = Model::factory('Lexem')->table_alias('l')->select('l.*')->distinct()->join('LexemModel', 'l.id = lm.lexemId', 'lm')->join('LexemDefinitionMap', 'l.id = ldm.lexemId', 'ldm')->join('Definition', 'ldm.definitionId = d.id', 'd')->where('d.status', Definition::ST_ACTIVE)->where('d.sourceId', $deSource->id)->where('lm.isLoc', 0)->where_like('l.formNoAccent', "{$prefix}%")->where('l.verifSp', 0)->where_not_equal('lm.modelType', 'SP')->order_by_asc('l.formNoAccent')->limit(100)->find_many();
foreach ($lexems as $l) {
$l->restrP = strpos($l->restriction, 'P') !== false;
$l->restrS = strpos($l->restriction, 'S') !== false;
}
RecentLink::createOrUpdate('Marcare substantive proprii');
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::assign('lexems', $lexems);
SmartyWrap::assign('prefix', $prefix);
SmartyWrap::displayAdminPage('admin/properNouns.tpl');
示例6: foreach
$pm = ParticipleModel::loadByVerbModel($modelNumber);
$clonePm = Model::factory('ParticipleModel')->create();
$clonePm->verbModel = $newModelNumber;
$clonePm->adjectiveModel = $pm->adjectiveModel;
$clonePm->save();
}
// Migrate the selected lexems.
if ($chooseLexems && $lexemModelIds) {
foreach ($lexemModelIds as $lexemModelId) {
$lm = LexemModel::get_by_id($lexemModelId);
$lm->modelNumber = $newModelNumber;
$lm->save();
// It is not necessary to regenerate the paradigm for now, since
// the inflected forms are identical.
}
}
util_redirect('../admin/index.php');
exit;
}
} else {
$newModelNumber = $modelNumber . ".1";
}
$lexemModels = LexemModel::loadByCanonicalModel($modelType, $modelNumber);
SmartyWrap::assign('modelType', $modelType);
SmartyWrap::assign('modelNumber', $modelNumber);
SmartyWrap::assign('newModelNumber', $newModelNumber);
SmartyWrap::assign('lexemModels', $lexemModels);
SmartyWrap::assign('errorMessage', $errorMessages);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/cloneModel.tpl');
示例7: foreach
$where[] = "structStatus = {$structStatus}";
}
// Process the $nick argument
if ($nick) {
$user = User::get_by_nick($nick);
if ($user) {
$joins['definition'] = true;
$where[] = "userId = {$user->id}";
}
}
// Assemble the query
$query = Model::factory('Lexem')->table_alias('l')->select('l.*')->distinct()->order_by_asc('formNoAccent')->limit(10000);
// ... and joins
foreach ($joins as $join => $ignored) {
switch ($join) {
case 'definition':
$query = $query->join('LexemDefinitionMap', 'l.id = ldm.lexemId', 'ldm')->join('Definition', 'ldm.definitionId = d.id', 'd');
break;
case 'lexemModel':
$query = $query->join('LexemModel', 'l.id = lm.lexemId', 'lm');
}
}
// ... and where clauses
foreach ($where as $clause) {
$query = $query->where_raw("({$clause})");
}
$lexems = $query->find_many();
SmartyWrap::assign('lexems', $lexems);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/lexemSearch.tpl');
示例8: db_execute
<?php
require_once "../../phplib/util.php";
// Select suffixes and counts for temporary lexems.
$dbResult = db_execute("select reverse(substring(reverse, 1, 4)) as s, count(*) as c " . "from Lexem join LexemModel on lexemId = Lexem.id " . "where modelType = 'T' " . "group by s having c >= 5 order by c desc, s", PDO::FETCH_ASSOC);
$stats = array();
foreach ($dbResult as $row) {
$stats[] = array($row['s'], $row['c']);
}
SmartyWrap::assign('stats', $stats);
SmartyWrap::assign('sectionTitle', 'Alegere sufix pentru etichetare asistată');
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/bulkLabelSelectSuffix.ihtml');
示例9: util_assertModerator
<?php
require_once "../../phplib/util.php";
util_assertModerator(PRIV_STRUCT);
util_assertNotMirror();
// Select lexems that
// * are associated with definitions from DEX '98 or DEX '09
// * have the shortest total definition length (from all sources)
$lexems = Model::factory('Lexem')->table_alias('l')->select('l.*')->join('LexemDefinitionMap', 'l.id = ldm.lexemId', 'ldm')->join('Definition', 'ldm.definitionId = d.id', 'd')->where('l.structStatus', Lexem::STRUCT_STATUS_NEW)->where_not_equal('d.status', Definition::ST_DELETED)->group_by('l.id')->having_raw('sum(sourceId in (1, 27)) > 0')->having_raw('sum(length(internalRep)) < 300')->limit(100)->find_many();
// Load the definitions for each lexem
$searchResults = array();
foreach ($lexems as $l) {
$defs = Definition::loadByLexemId($l->id);
$searchResults[] = SearchResult::mapDefinitionArray($defs);
}
SmartyWrap::assign('lexems', $lexems);
SmartyWrap::assign('searchResults', $searchResults);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/structChooseLexem.tpl');
示例10: util_assertModerator
<?php
require_once "../../phplib/util.php";
util_assertModerator(PRIV_WOTD);
util_assertNotMirror();
RecentLink::createOrUpdate('Word of the Day - Imagini');
SmartyWrap::assign('sectionTitle', 'Imagini pentru cuvântul zilei');
SmartyWrap::addCss('elfinder', 'jqueryui');
SmartyWrap::addJs('jquery', 'jqueryui', 'elfinder');
SmartyWrap::displayAdminPage('admin/wotdImages.ihtml');
示例11: util_assertModerator
<?php
require_once "../../phplib/util.php";
util_assertModerator(PRIV_EDIT);
util_assertNotMirror();
RecentLink::createOrUpdate('Lexeme cu comentarii');
$lexems = Model::factory('Lexem')->where_not_null('comment')->order_by_asc('formNoAccent')->find_many();
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::assign('lexems', $lexems);
SmartyWrap::displayAdminPage('admin/viewLexemsWithComments.tpl');
示例12: mktime
if ($nextPageButton) {
$page++;
}
$name = StringUtil::cleanupQuery($name);
$arr = StringUtil::analyzeQuery($name);
$hasDiacritics = $arr[0];
$hasRegexp = $arr[1];
$isAllDigits = $arr[2];
$field = $hasDiacritics ? 'formNoAccent' : 'formUtf8General';
$userId = '';
if ($nick) {
$user = User::get_by_nick($nick);
if ($user) {
$userId = $user->id;
}
}
$beginTime = mktime(0, 0, 0, $mo1, $da1, $yr1);
$endTime = mktime(23, 59, 59, $mo2, $da2, $yr2);
// Query the database and output the results
$defs = Definition::searchModerator($name, $hasDiacritics, $sourceId, $status, $userId, $beginTime, $endTime, $page, RESULTS_PER_PAGE);
$searchResults = SearchResult::mapDefinitionArray($defs);
$args = array('name' => $name, 'status' => $status, 'nick' => $nick, 'sourceId' => $sourceId, 'yr1' => $yr1, 'mo1' => $mo1, 'da1' => $da1, 'yr2' => $yr2, 'mo2' => $mo2, 'da2' => $da2, 'page' => $page);
FileCache::putModeratorQueryResults($ip, array($searchResults, $args));
} else {
list($searchResults, $args) = FileCache::getModeratorQueryResults($ip);
}
SmartyWrap::assign('searchResults', $searchResults);
SmartyWrap::assign('args', $args);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/definitionLookup.tpl');
示例13: ini_set
<?php
require_once "../../phplib/util.php";
ini_set('memory_limit', '256M');
$modelType = util_getRequestParameter('modelType');
$modelNumber = util_getRequestParameter('modelNumber');
$lexems = Lexem::loadByCanonicalModel($modelType, $modelNumber);
RecentLink::createOrUpdate("Model: {$modelType}{$modelNumber}");
SmartyWrap::assign('lexems', $lexems);
SmartyWrap::assign('modelType', $modelType);
SmartyWrap::assign('modelNumber', $modelNumber);
SmartyWrap::assign('recentLinks', RecentLink::loadForUser());
SmartyWrap::displayAdminPage('admin/viewLexemsByModel.tpl');
示例14: handleLexemActions
function handleLexemActions()
{
$lexemId = util_getRequestParameter('lexemId');
$lexem = Lexem::get_by_id($lexemId);
$associateDefinitionId = util_getRequestParameter('associateDefinitionId');
if ($associateDefinitionId) {
LexemDefinitionMap::associate($lexem->id, $associateDefinitionId);
util_redirect("lexemEdit.php?lexemId={$lexem->id}");
}
$dissociateDefinitionId = util_getRequestParameter('dissociateDefinitionId');
if ($dissociateDefinitionId) {
LexemDefinitionMap::dissociate($lexem->id, $dissociateDefinitionId);
util_redirect("lexemEdit.php?lexemId={$lexem->id}");
}
$createDefinition = util_getRequestParameter('createDefinition');
$miniDefTarget = util_getRequestParameter('miniDefTarget');
if ($createDefinition) {
$def = Model::factory('Definition')->create();
$def->userId = session_getUserId();
$def->sourceId = Source::get_by_shortName('Neoficial')->id;
$def->lexicon = $lexem->formNoAccent;
$def->internalRep = '@' . mb_strtoupper(AdminStringUtil::internalize($lexem->form, false)) . '@ v. @' . $miniDefTarget . '.@';
$def->htmlRep = AdminStringUtil::htmlize($def->internalRep, $def->sourceId);
$def->status = Definition::ST_ACTIVE;
$def->save();
LexemDefinitionMap::associate($lexem->id, $def->id);
util_redirect("lexemEdit.php?lexemId={$lexem->id}");
}
$deleteLexem = util_getRequestParameter('deleteLexem');
if ($deleteLexem) {
$homonyms = Model::factory('Lexem')->where('formNoAccent', $lexem->formNoAccent)->where_not_equal('id', $lexem->id)->find_many();
$lexem->delete();
SmartyWrap::assign('lexem', $lexem);
SmartyWrap::assign('homonyms', $homonyms);
SmartyWrap::displayAdminPage('admin/lexemDeleted.tpl');
exit;
}
$cloneLexem = util_getRequestParameter('cloneLexem');
if ($cloneLexem) {
$newLexem = $lexem->cloneLexem();
log_userLog("Cloned lexem {$lexem->id} ({$lexem->form}), new id is {$newLexem->id}");
util_redirect("lexemEdit.php?lexemId={$newLexem->id}");
}
$mergeLexem = util_getRequestParameter('mergeLexem');
$mergeLexemId = util_getRequestParameter('mergeLexemId');
if ($mergeLexem) {
$other = Lexem::get_by_id($mergeLexemId);
if ($lexem->form != $other->form) {
FlashMessage::add('Nu pot unifica lexemele deoarece accentele diferă. Rezolvați diferența și încercați din nou.');
util_redirect("lexemEdit.php?lexemId={$lexem->id}");
}
$defs = Definition::loadByLexemId($lexem->id);
foreach ($defs as $def) {
LexemDefinitionMap::associate($other->id, $def->id);
}
// Add lexem models from $lexem to $other if the form is the same. Exclude T-type models.
$displayOrder = count($other->getLexemModels());
foreach ($lexem->getLexemModels() as $lm) {
if ($lm->modelType != 'T' && !$other->hasModel($lm->modelType, $lm->modelNumber)) {
$lm->lexemId = $other->id;
$lm->displayOrder = ++$displayOrder;
$lm->save();
}
}
// Add meanings from $lexem to $other and renumber their displayOrder and breadcrumb
// displayOrders are generated sequentially regardless of level.
// Breadcrumbs follow levels so only their first part changes.
$counter = Model::factory('Meaning')->where('lexemId', $other->id)->count();
$numRoots = Model::factory('Meaning')->where('lexemId', $other->id)->where('parentId', 0)->count();
$meanings = Model::factory('Meaning')->where('lexemId', $lexem->id)->order_by_asc('displayOrder')->find_many();
foreach ($meanings as $m) {
$m->lexemId = $other->id;
$m->displayOrder = ++$counter;
$parts = explode('.', $m->breadcrumb, 2);
$parts[0] += $numRoots;
$m->breadcrumb = implode('.', $parts);
$m->save();
}
// Add images and image tags from $lexem to $other
$visuals = Visual::get_all_by_lexemeId($lexem->id);
foreach ($visuals as $v) {
$v->lexemeId = $other->id;
$v->save();
}
$visualTags = VisualTag::get_all_by_lexemeId($lexem->id);
foreach ($visualTags as $vt) {
$vt->lexemeId = $other->id;
$vt->save();
}
$lexem->delete();
util_redirect("lexemEdit.php?lexemId={$other->id}");
}
}
示例15: tempnam
// Compress the directory
OS::executeAndAssert("zip -r0 compressed.zip *");
// Move the resulting file to another temp location so it lives a little longer
$outputFile = tempnam(Config::get('global.tempDir'), 'compress_');
@unlink($outputFile);
rename("{$workDir}/compressed.zip", $outputFile);
OS::executeAndAssert("rm -rf {$workDir}");
header('Content-disposition: attachment; filename=comprimate.zip');
header('Content-Type: application/zip');
readfile($outputFile);
exit;
}
}
}
}
SmartyWrap::displayAdminPage('admin/wotdCompressImages.tpl');
/**************************************************************************/
function recursiveScan($path, $logFile)
{
global $IGNORED_DIRS, $EXTENSIONS, $beforeBytes, $afterBytes;
$files = scandir($path);
foreach ($files as $file) {
if (in_array($file, $IGNORED_DIRS)) {
continue;
}
$full = "{$path}/{$file}";
if (is_dir($full)) {
recursiveScan($full, $logFile);
} else {
$extension = pathinfo(strtolower($full), PATHINFO_EXTENSION);
$fullNoExt = substr($full, 0, strlen($full) - strlen($extension) - 1);