本文整理汇总了PHP中Util::jsEscape方法的典型用法代码示例。如果您正苦于以下问题:PHP Util::jsEscape方法的具体用法?PHP Util::jsEscape怎么用?PHP Util::jsEscape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Util
的用法示例。
在下文中一共展示了Util::jsEscape方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderTooltip
public function renderTooltip()
{
if (!$this->curTpl) {
return array();
}
$x = '<table><tr><td>';
$x .= '<span class="q' . $this->getField('quality') . '">' . Util::jsEscape($this->getField('name', true)) . '</span><br />';
$nClasses = 0;
if ($_ = $this->getField('classMask')) {
$cl = Lang::getClassString($_, $__, $nClasses);
$x .= Util::ucFirst($nClasses > 1 ? Lang::game('classes') : Lang::game('class')) . Lang::main('colon') . $cl . '<br />';
}
if ($_ = $this->getField('contentGroup')) {
$x .= Util::jsEscape(Lang::itemset('notes', $_)) . ($this->getField('heroic') ? ' <i class="q2">(' . Lang::item('heroic') . ')</i>' : '') . '<br />';
}
if (!$nClasses || !$this->getField('contentGroup')) {
$x .= Lang::itemset('types', $this->getField('type')) . '<br />';
}
if ($bonuses = $this->getBonuses()) {
$x .= '<span>';
foreach ($bonuses as $b) {
$x .= '<br /><span class=\\"q13\\">' . $b['bonus'] . ' ' . Lang::itemset('_pieces') . Lang::main('colon') . '</span>' . Util::jsEscape($b['desc']);
}
$x .= '</span>';
}
$x .= '</td></tr></table>';
return $x;
}
示例2: generateContent
protected function generateContent()
{
$this->addCSS(['string' => '.announcement { margin: auto; max-width: 1200px; padding: 0px 15px 15px 15px }']);
// load oneliner
if ($_ = DB::Aowow()->selectRow('SELECT * FROM ?_home_oneliner WHERE active = 1 LIMIT 1')) {
$this->oneliner = Util::jsEscape(Util::localizedString($_, 'text'));
}
// load news
$this->news = DB::Aowow()->selectRow('SELECT id as ARRAY_KEY, n.* FROM ?_home_featuredbox n WHERE active = 1 ORDER BY id DESC LIMIT 1');
if (!$this->news) {
return;
}
$this->news['text'] = Util::localizedString($this->news, 'text', true);
if ($_ = (new Markup($this->news['text']))->parseGlobalsFromText()) {
$this->extendGlobalData($_);
}
if (empty($this->news['bgImgUrl'])) {
$this->news['bgImgUrl'] = STATIC_URL . '/images/' . User::$localeString . '/mainpage-bg-news.jpg';
} else {
$this->news['bgImgUrl'] = strtr($this->news['bgImgUrl'], ['HOST_URL' => HOST_URL, 'STATIC_URL' => STATIC_URL]);
}
// load overlay links
$this->news['overlays'] = DB::Aowow()->select('SELECT * FROM ?_home_featuredbox_overlay WHERE featureId = ?d', $this->news['id']);
foreach ($this->news['overlays'] as &$o) {
$o['title'] = Util::localizedString($o, 'title', true);
$o['title'] = strtr($o['title'], ['HOST_URL' => HOST_URL, 'STATIC_URL' => STATIC_URL]);
}
}
示例3: renderTooltip
public function renderTooltip()
{
if (!$this->curTpl) {
return array();
}
$x = '<table><tr><td>';
$x .= '<b>' . Util::jsEscape($this->getField('name', true)) . '</b><br>';
// cata+ (or go fill it by hand)
if ($_ = $this->getField('description', true)) {
$x .= '<div style="max-width: 300px" class="q">' . Util::jsEscape($_) . '</div>';
}
if ($_ = $this->getField('cap')) {
$x .= '<br><span class="q">' . Lang::currency('cap') . Lang::main('colon') . '</span>' . Lang::nf($_) . '<br>';
}
$x .= '</td></tr></table>';
return $x;
}
示例4: getInfoBoxForFlags
public static function getInfoBoxForFlags($flags)
{
$tmp = [];
if ($flags & CUSTOM_DISABLED) {
$tmp[] = '[tooltip name=disabledHint]' . Util::jsEscape(self::main('disabledHint')) . '[/tooltip][span class=tip tooltip=disabledHint]' . Util::jsEscape(self::main('disabled')) . '[/span]';
}
if ($flags & CUSTOM_SERVERSIDE) {
$tmp[] = '[tooltip name=serversideHint]' . Util::jsEscape(self::main('serversideHint')) . '[/tooltip][span class=tip tooltip=serversideHint]' . Util::jsEscape(self::main('serverside')) . '[/span]';
}
if ($flags & CUSTOM_UNAVAILABLE) {
$tmp[] = self::main('unavailable');
}
if ($flags & CUSTOM_EXCLUDE_FOR_LISTVIEW && User::isInGroup(U_GROUP_STAFF)) {
$tmp[] = '[tooltip name=excludedHint]This entry is excluded from lists and is not searchable.[/tooltip][span tooltip=excludedHint class="tip q10"]Hidden[/span]';
}
return $tmp;
}
示例5: foreach
<?php
// link to wowhead
if (isset($this->redButtons[BUTTON_WOWHEAD])) {
if ($this->redButtons[BUTTON_WOWHEAD]) {
echo '<a href="' . Util::$wowheadLink . '" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>';
} else {
echo '<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>';
}
}
// ingame-links/markdown/ect
if (isset($this->redButtons[BUTTON_LINKS])) {
if ($b = $this->redButtons[BUTTON_LINKS]) {
echo '<a href="javascript:;" id="open-links-button" class="button-red" onclick="this.blur(); Links.show({' . (isset($b['color']) ? "linkColor: '" . $b['color'] . "', " : null) . (isset($b['linkId']) ? "linkId: '" . $b['linkId'] . "', " : null) . "linkName: '" . Util::jsEscape(isset($b['name']) ? $b['name'] : $this->name) . "', type: " . $this->type . ', typeId: ' . $this->typeId . ' });"><em><b><i>' . Lang::main('links') . '</i></b><span>' . Lang::main('links') . '</span></em></a>';
} else {
echo '<a href="javascript:;" id="open-links-button" class="button-red button-red-disabled"><em><b><i>' . Lang::main('links') . '</i></b><span>' . Lang::main('links') . '</span></em></a>';
}
}
// view in 3D
if (isset($this->redButtons[BUTTON_VIEW3D])) {
if ($b = $this->redButtons[BUTTON_VIEW3D]) {
// json_encode puts property names in brackets wich is not cool with inline javascript
$data = [];
foreach ($b as $k => $v) {
$data[] = $k . ': ' . json_encode($v, JSON_NUMERIC_CHECK);
}
echo '<a href="javascript:;" id="view3D-button" class="button-red" onclick="this.blur(); ModelViewer.show({' . implode(', ', $data) . '})"><em><b><i>' . Lang::main('view3D') . '</i></b><span>' . Lang::main('view3D') . '</span></em></a>';
} else {
echo '<a href="javascript:;" id="view3D-button" class="button-red button-red-disabled"><em><b><i>' . Lang::main('view3D') . '</i></b><span>' . Lang::main('view3D') . '</span></em></a>';
}
}
示例6: renderTooltip
public function renderTooltip()
{
$criteria = $this->getCriteria();
$tmp = [];
$rows = [];
$i = 0;
foreach ($criteria as $_row) {
if ($i++ % 2) {
$tmp[] = $_row;
} else {
$rows[] = $_row;
}
}
if ($tmp) {
$rows = array_merge($rows, $tmp);
}
$description = $this->getField('description', true);
$name = $this->getField('name', true);
$criteria = '';
$i = 0;
foreach ($rows as $crt) {
$obj = (int) $crt['value1'];
$qty = (int) $crt['value2'];
// we could show them, but the tooltips are cluttered
if ($crt['completionFlags'] & ACHIEVEMENT_CRITERIA_FLAG_HIDDEN && User::$perms <= 0) {
continue;
}
$crtName = Util::localizedString($crt, 'name');
switch ($crt['type']) {
// link to title - todo (low): crosslink
case ACHIEVEMENT_CRITERIA_TYPE_EARNED_PVP_TITLE:
$crtName = Util::ucFirst(Lang::game('title')) . Lang::main('colon') . $crtName;
break;
// link to quest
// link to quest
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST:
if (!$crtName) {
$crtName = QuestList::getName($obj);
}
break;
// link to spell (/w icon)
// link to spell (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET:
case ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
case ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL2:
if (!$crtName) {
$crtName = SpellList::getName($obj);
}
break;
// link to item (/w icon)
// link to item (/w icon)
case ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_USE_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM:
case ACHIEVEMENT_CRITERIA_TYPE_EQUIP_ITEM:
if (!$crtName) {
$crtName = ItemList::getName($obj);
}
break;
// link to faction (/w target reputation)
// link to faction (/w target reputation)
case ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION:
if (!$crtName) {
$crtName = FactionList::getName($obj);
}
break;
}
if ($crt['completionFlags'] & ACHIEVEMENT_CRITERIA_FLAG_MONEY_COUNTER) {
$criteria .= '- ' . Util::jsEscape($crtName) . ' <span class="moneygold">' . number_format($crt['value2'] / 10000) . '</span><br />';
} else {
$criteria .= '- ' . Util::jsEscape($crtName) . '<br />';
}
if (++$i == round(count($rows) / 2)) {
$criteria .= '</small></td><th class="q0" style="white-space: nowrap; text-align: left"><small>';
}
}
$x = '<table><tr><td><b class="q">';
$x .= Util::jsEscape($name);
$x .= '</b></td></tr></table>';
if ($description || $criteria) {
$x .= '<table><tr><td>';
}
if ($description) {
$x .= '<br />' . Util::jsEscape($description) . '<br />';
}
if ($criteria) {
$x .= '<br /><span class="q">' . Lang::achievement('criteria') . ':</span>';
$x .= '<table width="100%"><tr><td class="q0" style="white-space: nowrap"><small>' . $criteria . '</small></th></tr></table>';
}
if ($description || $criteria) {
$x .= '</td></tr></table>';
}
return $x;
}
示例7: generateOpenSearch
private function generateOpenSearch($asError = false)
{
// this one is funny: we want 10 results, ideally equally distributed over each type
$foundTotal = 0;
$limit = $this->maxResults;
$result = array($this->search, [], [], [], [], [], [], []);
foreach ($this->lvTabs as list($_, $_, $_, $osInfo)) {
$foundTotal += $osInfo[2];
}
if (!$foundTotal || $asError) {
return '["' . Util::jsEscape($this->search) . '", []]';
}
foreach ($this->lvTabs as list($_, $tabData, $_, $osInfo)) {
$max = max(1, intVal($limit * $osInfo[2] / $foundTotal));
$limit -= $max;
for ($i = 0; $i < $max; $i++) {
$data = array_shift($tabData['data']);
if (!$data) {
break;
}
$hasQ = is_numeric($data['name'][0]) || $data['name'][0] == '@';
$result[1][] = ($hasQ ? mb_substr($data['name'], 1) : $data['name']) . $osInfo[1];
$result[3][] = HOST_URL . '/?' . Util::$typeStrings[$osInfo[0]] . '=' . $data['id'];
$extra = [$osInfo[0], $data['id']];
// type, typeId
if (isset($osInfo[3][$data['id']])) {
$extra[] = $osInfo[3][$data['id']];
}
// param1
if (isset($osInfo[4][$data['id']])) {
$extra[] = $osInfo[4][$data['id']];
}
// param2
$result[7][] = $extra;
}
if ($limit <= 0) {
break;
}
}
return Util::toJSON($result);
}
示例8: strtr
<?php
/* Util::jsEscape gets a bit greedy here */
if (!empty($this->article)) {
?>
<div id="article-generic" class="left"></div>
<script type="text/javascript">//<![CDATA[
Markup.printHtml("<?php
echo strtr(Util::jsEscape($this->article['text']), ['scr\\"+\\"ipt' => 'scr"+"ipt']);
?>
", "article-generic", {
<?php
foreach ($this->article['params'] as $k => $v) {
echo $k . ': ' . ($v[0] == '$' ? substr($v, 1) : "'" . $v . "'") . ",\n";
}
?>
allow: Markup.CLASS_ADMIN,
dbpage: true
});
//]]></script>
<div class="pad2"></div>
<?php
}
示例9: generateTooltip
protected function generateTooltip($asError = false)
{
$x = '$WowheadPower.registerProfile(' . ($this->isCustom ? $this->profile : "'" . implode('.', $this->profile) . "'") . ', ' . User::$localeId . ', {';
if ($asError) {
return $x . "});";
}
@(include 'datasets/ProfilerExampleChar');
// tmp char data
$name = $character['name'];
$guild = $character['guild'];
$gRankName = $character['guildrank'];
$lvl = $character['level'];
$ra = $character['race'];
$cl = $character['classs'];
$gender = $character['gender'];
$desc = $character['description'];
$title = (new TitleList(array(['id', $character['title']])))->getField($gender ? 'female' : 'male', true);
if ($this->isCustom) {
$name .= ' (Custom Profile)';
} else {
if ($title) {
$name = sprintf($title, $name);
}
}
$x .= "\n";
$x .= "\tname_" . User::$localeString . ": '" . Util::jsEscape($name) . "',\n";
$x .= "\ttooltip_" . User::$localeString . ": '" . $this->subject->renderTooltip() . "',\n";
$x .= "\ticon: \$WH.g_getProfileIcon(" . $ra . ", " . $cl . ", " . $gender . ", " . $lvl . "),\n";
// (race, class, gender, level, iconOrId, 'medium')
$x .= "});";
return $x;
}
示例10: renderTooltip
public function renderTooltip()
{
if (!$this->curTpl) {
return null;
}
$title = Util::jsEscape($this->getField('name', true));
$level = $this->curTpl['level'];
if ($level < 0) {
$level = 0;
}
$x = '';
if ($level) {
$level = sprintf(Lang::quest('questLevel'), $level);
if ($this->curTpl['flags'] & QUEST_FLAG_DAILY) {
// daily
$level .= ' ' . Lang::quest('daily');
}
$x .= '<table><tr><td><table width="100%"><tr><td><b class="q">' . $title . '</b></td><th><b class="q0">' . $level . '</b></th></tr></table></td></tr></table>';
} else {
$x .= '<table><tr><td><b class="q">' . $title . '</b></td></tr></table>';
}
$x .= '<table><tr><td><br />' . $this->parseText('objectives');
$xReq = '';
for ($i = 1; $i < 5; $i++) {
$ot = $this->getField('objectiveText' . $i, true);
$rng = $this->curTpl['reqNpcOrGo' . $i];
$rngQty = $this->curTpl['reqNpcOrGoCount' . $i];
if ($rngQty < 1 && (!$rng || $ot)) {
continue;
}
if ($ot) {
$name = $ot;
} else {
$name = $rng > 0 ? CreatureList::getName($rng) : GameObjectList::getName(-$rng);
}
$xReq .= '<br /> - ' . Util::jsEscape($name) . ($rngQty > 1 ? ' x ' . $rngQty : null);
}
for ($i = 1; $i < 7; $i++) {
$ri = $this->curTpl['reqItemId' . $i];
$riQty = $this->curTpl['reqItemCount' . $i];
if (!$ri || $riQty < 1) {
continue;
}
$xReq .= '<br /> - ' . Util::jsEscape(ItemList::getName($ri)) . ($riQty > 1 ? ' x ' . $riQty : null);
}
if ($et = $this->getField('end', true)) {
$xReq .= '<br /> - ' . Util::jsEscape($et);
}
if ($_ = $this->getField('rewardOrReqMoney')) {
if ($_ < 0) {
$xReq .= '<br /> - ' . Lang::quest('money') . Lang::main('colon') . Util::formatMoney(abs($_));
}
}
if ($xReq) {
$x .= '<br /><br /><span class="q">' . Lang::quest('requirements') . Lang::main('colon') . '</span>' . $xReq;
}
$x .= '</td></tr></table>';
return $x;
}
示例11: generateTooltip
protected function generateTooltip($asError = false)
{
if ($asError) {
return '$WowheadPower.registerQuest(' . $this->typeId . ', ' . User::$localeId . ', {});';
}
$x = '$WowheadPower.registerQuest(' . $this->typeId . ', ' . User::$localeId . ", {\n";
$x .= "\tname_" . User::$localeString . ": '" . Util::jsEscape($this->subject->getField('name', true)) . "',\n";
$x .= "\ttooltip_" . User::$localeString . ': \'' . $this->subject->renderTooltip() . "'";
if ($this->subject->isDaily()) {
$x .= ",\n\tdaily: 1";
}
$x .= "\n});";
return $x;
}
示例12: generateContent
//.........这里部分代码省略.........
$this->map = array('data' => ['parent' => 'mapper-generic', 'zone' => $this->typeId], 'som' => $som);
} else {
$this->map = false;
}
$this->infobox = $infobox ? '[ul][li]' . implode('[/li][li]', $infobox) . '[/li][/ul]' : null;
$this->expansion = Util::$expansionString[$this->subject->getField('expansion')];
$this->redButtons = array(BUTTON_WOWHEAD => true, BUTTON_LINKS => true);
/*
- associated with holiday?
*/
/**************/
/* Extra Tabs */
/**************/
// tab: NPCs
if ($cSpawns && !$creatureSpawns->error) {
$lvData = array('file' => 'creature', 'data' => $creatureSpawns->getListviewData(), 'params' => ['note' => sprintf(Util::$filterResultString, '?npcs&filter=cr=6;crs=' . $this->typeId . ';crv=0')]);
if ($creatureSpawns->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
$lvData['params']['_truncated'] = 1;
}
$this->extendGlobalData($creatureSpawns->getJSGlobals(GLOBALINFO_SELF));
$this->lvTabs[] = $lvData;
}
// tab: Objects
if ($oSpawns && !$objectSpawns->error) {
$lvData = array('file' => 'object', 'data' => $objectSpawns->getListviewData(), 'params' => ['note' => sprintf(Util::$filterResultString, '?objects&filter=cr=1;crs=' . $this->typeId . ';crv=0')]);
if ($objectSpawns->getMatches() > CFG_SQL_LIMIT_DEFAULT) {
$lvData['params']['_truncated'] = 1;
}
$this->extendGlobalData($objectSpawns->getJSGlobals(GLOBALINFO_SELF));
$this->lvTabs[] = $lvData;
}
// tab: Quests [data collected by SOM-routine]
if ($questsLV) {
$this->lvTabs[] = array('file' => 'quest', 'data' => $questsLV, 'params' => ['note' => '$$WH.sprintf(LANG.lvnote_zonequests, ' . $this->subject->getField('mapId') . ', ' . $this->typeId . ', \'' . Util::jsEscape($this->subject->getField('name', true)) . '\', ' . $this->typeId . ')']);
}
// tab: item-quest starter
// select every quest starter, that is a drop
$questStartItem = DB::Aowow()->select('
SELECT qse.typeId AS ARRAY_KEY, moreType, moreTypeId, moreZoneId
FROM ?_quests_startend qse JOIN ?_source src ON src.type = qse.type AND src.typeId = qse.typeId
WHERE src.src2 IS NOT NULL AND qse.type = ?d AND (moreZoneId = ?d OR (moreType = ?d AND moreTypeId IN (?a)) OR (moreType = ?d AND moreTypeId IN (?a)))', TYPE_ITEM, $this->typeId, TYPE_NPC, array_unique(array_column($cSpawns, 'typeId')) ?: [0], TYPE_OBJECT, array_unique(array_column($oSpawns, 'typeId')) ?: [0]);
if ($questStartItem) {
$qsiList = new ItemList(array(['id', array_keys($questStartItem)]));
if (!$qsiList->error) {
$this->lvTabs[] = array('file' => 'item', 'data' => $qsiList->getListviewData(), 'params' => ['name' => '$LANG.tab_startsquest', 'id' => 'starts-quest']);
$this->extendGlobalData($qsiList->getJSGlobals(GLOBALINFO_SELF));
}
}
// tab: Quest Rewards [ids collected by SOM-routine]
if ($rewardsLV) {
$rewards = new ItemList(array(['id', array_unique($rewardsLV)]));
if (!$rewards->error) {
$this->lvTabs[] = array('file' => 'item', 'data' => $rewards->getListviewData(), 'params' => ['name' => '$LANG.tab_questrewards', 'id' => 'quest-rewards', 'note' => sprintf(Util::$filterResultString, '?items&filter=cr=126;crs=' . $this->typeId . ';crv=0')]);
$this->extendGlobalData($rewards->getJSGlobals(GLOBALINFO_SELF));
}
}
// tab: achievements
// tab: fished in zone
$fish = new Loot();
if ($fish->getByContainer(LOOT_FISHING, $this->typeId)) {
$this->extendGlobalData($fish->jsGlobals);
$xCols = array_merge(['Listview.extraCols.percent'], $fish->extraCols);
foreach ($fish->iterate() as $lv) {
if (!$lv['quest']) {
continue;
}
示例13:
$this->brick('header');
?>
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
<?php
$this->brick('announcement');
$this->brick('pageTemplate');
$this->brick('infobox');
?>
<script type="text/javascript">var g_pageInfo = { username: '<?php
echo Util::jsEscape($this->gUser['name']);
?>
' }</script>
<div class="text">
<div id="h1-icon-generic" class="h1-icon"></div>
<script type="text/javascript">
$WH.ge('h1-icon-generic').appendChild(Icon.createUser(<?php
echo (is_numeric(User::$avatar) ? 2 : 1) . ' , \'' . User::$avatar . '\'';
?>
, 1, null, <?php
echo User::isInGroup(U_GROUP_PREMIUM) ? 0 : 2;
?>
, false, Icon.getPrivilegeBorder(<?php
echo User::getReputation();
?>
示例14: handleLoad
protected function handleLoad()
{
/* params
id: profileId
items: string [itemIds.join(':')]
unnamed: unixtime [only to force the browser to reload instead of cache]
return
lots...
*/
// titles, achievements, characterData, talents (, pets)
// and some onLoad-hook to .. load it registerProfile($data)
// everything else goes through data.php .. strangely enough
if (!$this->_get['id']) {
return;
}
$char = new ProfileList(array(['id', $this->_get['id'][0]]));
// or string or whatever
$buff = '';
if ($it = array_column($char->getField('inventory'), 0)) {
$itemz = new ItemList(array(['id', $it, CFG_SQL_LIMIT_NONE]));
$data = $itemz->getListviewData(ITEMINFO_JSON | ITEMINFO_SUBITEMS);
// get and apply inventory
foreach ($itemz->iterate() as $iId => $__) {
$buff .= 'g_items.add(' . $iId . ', {name_' . User::$localeString . ":'" . Util::jsEscape($itemz->getField('name', true)) . "', quality:" . $itemz->getField('quality') . ", icon:'" . $itemz->getField('iconString') . "', jsonequip:" . Util::toJSON($data[$iId]) . "});\n";
}
$buff .= "\n";
}
if ($au = $char->getField('auras')) {
$auraz = new SpellList(array(['id', $char->getField('auras')], CFG_SQL_LIMIT_NONE));
$dataz = $auraz->getListviewData();
$modz = $auraz->getProfilerMods();
// get and apply aura-mods
foreach ($dataz as $id => $data) {
$mods = [];
if (!empty($modz[$id])) {
foreach ($modz[$id] as $k => $v) {
if (is_array($v)) {
$mods[] = $v;
} else {
if ($str = @Util::$itemMods[$k]) {
$mods[$str] = $v;
}
}
}
}
$buff .= 'g_spells.add(' . $id . ", {id:" . $id . ", name:'" . Util::jsEscape(mb_substr($data['name'], 1)) . "', icon:'" . $data['icon'] . "', modifier:" . Util::toJSON($mods) . "});\n";
}
$buff .= "\n";
}
/* depending on progress-achievements
// required by progress in JScript move to handleLoad()?
Util::$pageTemplate->extendGlobalIds(TYPE_NPC, [29120, 31134, 29306, 29311, 23980, 27656, 26861, 26723, 28923, 15991]);
*/
// load available titles
Util::loadStaticFile('p-titles-' . $char->getField('gender'), $buff, true);
// load available achievements
if (!Util::loadStaticFile('p-achievements', $buff, true)) {
$buff .= "\n\ng_achievement_catorder = [];";
$buff .= "\n\ng_achievement_points = [0];";
}
// excludes; structure UNK type => [maskBit => [typeIds]] ?
/*
g_user.excludes = [type:[typeIds]]
g_user.includes = [type:[typeIds]]
g_user.excludegroups = groupMask // requires g_user.settings != null
maskBit are matched against fieldId from excludeGroups
id: 1, label: LANG.dialog_notavail
id: 2, label: LANG.dialog_tcg
id: 4, label: LANG.dialog_collector
id: 8, label: LANG.dialog_promo
id: 16, label: LANG.dialog_nonus
id: 96, label: LANG.dialog_faction
id: 896, label: LANG.dialog_profession
id: 1024, label: LANG.dialog_noexalted
*/
// $buff .= "\n\ng_excludes = {};";
// add profile to buffer
$buff .= "\n\n\$WowheadProfiler.registerProfile(" . Util::toJSON($char->getEntry(2)) . ");";
// can't use JSON_NUMERIC_CHECK or the talent-string becomes a float
return $buff . "\n";
}
示例15:
$this->brick('header');
?>
<div class="main" id="main">
<div class="main-precontents" id="main-precontents"></div>
<div class="main-contents" id="main-contents">
<?php
$this->brick('announcement');
$this->brick('pageTemplate');
$this->brick('infobox');
?>
<script type="text/javascript">var g_pageInfo = { username: '<?php
echo Util::jsEscape($this->user['displayName']);
?>
' }</script>
<div class="text">
<div id="h1-icon-generic" class="h1-icon"></div>
<script type="text/javascript">
$WH.ge('h1-icon-generic').appendChild(Icon.createUser(<?php
echo (is_numeric($this->user['avatar']) ? 2 : 1) . ', \'' . ($this->user['avatar'] ?: 'inv_misc_questionmark') . '\'';
?>
, 1, null, <?php
echo User::isInGroup(U_GROUP_PREMIUM) ? 0 : 2;
?>
, false, Icon.getPrivilegeBorder(<?php
echo $this->user['sumRep'];
?>