Template/Update (Part 25)
* convert dbtype 'spell' * point spell effects on detail page to spells filter
This commit is contained in:
parent
3ba0cc4ade
commit
e6980ce220
14 changed files with 973 additions and 863 deletions
|
|
@ -1,7 +1,12 @@
|
|||
<?php namespace Aowow; ?>
|
||||
<?php
|
||||
namespace Aowow\Template;
|
||||
|
||||
<?php $this->brick('header'); ?>
|
||||
use \Aowow\Lang;
|
||||
|
||||
$this->brick('header');
|
||||
|
||||
$iconOffset = 0;
|
||||
?>
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
|
@ -18,7 +23,7 @@
|
|||
|
||||
<?php $this->brick('redButtons'); ?>
|
||||
|
||||
<h1 class="h1-icon"><?=$this->name; ?></h1>
|
||||
<h1 class="h1-icon"><?=$this->h1; ?></h1>
|
||||
|
||||
<?php
|
||||
$this->brick('tooltip');
|
||||
|
|
@ -28,6 +33,7 @@ if ($this->tools):
|
|||
endif;
|
||||
|
||||
if ($this->reagents[1]):
|
||||
$iconOffset += count($this->reagents[1]);
|
||||
$this->brick('reagentList', ['reagents' => $this->reagents[1], 'enhanced' => $this->reagents[0]]);
|
||||
endif;
|
||||
|
||||
|
|
@ -41,17 +47,15 @@ if ($this->tools):
|
|||
<h3><?=Lang::spell('tools'); ?></h3>
|
||||
<table class="iconlist">
|
||||
<?php
|
||||
foreach ($this->tools as $i => $t):
|
||||
echo ' <tr><th align="right" id="iconlist-icon'.($i + 1).'"></th><td><span class="q1"><a href="'.$t['url'].'">'.$t['name']."</a></span></td></tr>\n";
|
||||
foreach ($this->tools as $icon):
|
||||
echo $icon->renderContainer(20, $iconOffset, true);
|
||||
endforeach;
|
||||
?>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
<?php
|
||||
foreach ($this->tools as $i => $t):
|
||||
if (isset($t['itemId'])):
|
||||
echo $this->fmtCreateIcon($i + 1, Type::ITEM, $t['itemId'], 20, 'iconlist-icon', size: 0);
|
||||
endif;
|
||||
foreach ($this->tools as $icon):
|
||||
echo $icon->renderJS(20);
|
||||
endforeach;
|
||||
?>
|
||||
</script>
|
||||
|
|
@ -63,10 +67,10 @@ endif;
|
|||
?>
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php $this->brick('article'); ?>
|
||||
|
||||
<?php
|
||||
if (!empty($this->transfer)):
|
||||
$this->brick('markup', ['markup' => $this->article]);
|
||||
|
||||
if ($this->transfer):
|
||||
echo " <div class=\"pad\"></div>\n ".$this->transfer."\n";
|
||||
endif;
|
||||
?>
|
||||
|
|
@ -111,7 +115,7 @@ endif;
|
|||
</tr>
|
||||
<tr>
|
||||
<th style="border-top: 0"><?=Lang::spell('_cost');?></th>
|
||||
<td style="border-top: 0"><?=(!empty($this->powerCost) ? $this->powerCost : Lang::spell('_none'));?></td>
|
||||
<td style="border-top: 0"><?=($this->powerCost ?: Lang::spell('_none'));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?=Lang::spell('_range');?></th>
|
||||
|
|
@ -139,7 +143,7 @@ if ($this->scaling):
|
|||
|
||||
<?php
|
||||
foreach ($this->scaling as $k => $v):
|
||||
echo ' '.Lang::spell('scaling', $k, [$v * 100])."<br>\n";
|
||||
echo ' '.Lang::spell('scaling', $k, [$v * 100])."<br />\n";
|
||||
endforeach;
|
||||
?>
|
||||
</td>
|
||||
|
|
@ -175,7 +179,7 @@ foreach ($this->effects as $i => $e):
|
|||
echo ' '.$e['name'];
|
||||
|
||||
if ($e['footer']):
|
||||
echo "<small><br>".implode("<br>", $e['footer'])."</small>\n";
|
||||
echo "<small><br />".implode("<br />", $e['footer'])."</small>\n";
|
||||
endif;
|
||||
|
||||
if ($e['markup']):
|
||||
|
|
@ -185,63 +189,54 @@ $WH.aE(window,\'load\',function(){$WH.ge(\'spelleffectmarkup-'.$i.'\').innerHTML
|
|||
endif;
|
||||
|
||||
if ($e['icon']):
|
||||
['type' => $ty, 'typeId' => $ti, 'name' => $na, 'quality' => $qu, 'count' => $co] = $e['icon'];
|
||||
?>
|
||||
<table class="icontab">
|
||||
<tr>
|
||||
<th id="icontab-icon<?=++$iconTabIdx;?>"></th>
|
||||
<?php
|
||||
if ($qu):
|
||||
echo ' <td><span class="q'.$qu.'">'.($na ? sprintf('<a href="?item=%d">%s</a>', $ti, $na) : Util::ucFirst(Lang::game('item')).' #'.$ti)."</span></td>\n";
|
||||
else:
|
||||
echo ' <td>'.($na ? sprintf('<a href="?spell=%d">%s</a>', $ti, $na) : Util::ucFirst(Lang::game('spell')).' #'.$ti)."</td>\n";
|
||||
endif;
|
||||
?>
|
||||
<?=$e['icon']->renderContainer(iconIdxOffset: $iconTabIdx); ?>
|
||||
<th></th><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
<?=$this->fmtCreateIcon($iconTabIdx, $ty, $ti, num: $co);?>
|
||||
<?=$e['icon']->renderJS(); ?>
|
||||
</script>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if ($e['perfectItem']):
|
||||
['spellId' => $si, 'spellName' => $sn, 'itemId' => $ii, 'itemName' => $in, 'quality' => $qu, 'icon' => $ic, 'chance' => $ch] = $e['perfectItem'];
|
||||
['spellId' => $si, 'spellName' => $sn, 'item' => $it, 'icon' => $ic, 'chance' => $ch] = $e['perfectItem'];
|
||||
?>
|
||||
<small><a href="?spell=<?=$si;?>" class="icontiny"><img src="<?=Cfg::get('STATIC_URL');?>/images/wow/icons/tiny/<?=$ic;?>.gif" align="absmiddle">
|
||||
<small><a href="?spell=<?=$si;?>" class="icontiny"><img src="<?=$this->gStaticUrl;?>/images/wow/icons/tiny/<?=$ic;?>.gif" align="absmiddle">
|
||||
<span class="tinyicontxt"><?=$sn;?></span></a><?=Lang::main('colon').' '.$ch.'%';?></small><table class="icontab">
|
||||
<tr><th id="icontab-icon<?=++$iconTabIdx;?>"></th><td><small><a href="?item=<?=$ii;?>" class="q<?=$qu;?>"><?=$in;?></a></small></td></tr></table>
|
||||
<?=$it->renderContainer(0, $iconTabIdx, true); ?></table>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?=$this->fmtCreateIcon($iconTabIdx, Type::ITEM, $ii);?>
|
||||
<?=$it->renderJS(); ?>
|
||||
//]]></script>
|
||||
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if (isset($e['modifies'])):
|
||||
if ($e['modifies']):
|
||||
?>
|
||||
<br><small><?=Lang::spell('_affected').Lang::main('colon');?></small>
|
||||
<br /><small><?=Lang::spell('_affected');?></small>
|
||||
<?php
|
||||
for ($type = 0; $type < 2; $type++):
|
||||
for ($type = 0; $type < 2; $type++): // [classSpells, miscSpells]
|
||||
if (!$e['modifies'][$type])
|
||||
continue;
|
||||
|
||||
$folded = false;
|
||||
$iconData = [];
|
||||
|
||||
if ($type && count($e['modifies'][0])) // #effectspells-856451 < the number is ID from SpellEffect.db2 (not available in 3.3.5a, use effectIdx instead)
|
||||
echo '<a href="javascript:" class="disclosure-off" onclick="return g_disclose($(\'#effectspells-'.$i.'\')[0], this);">'.Lang::spell('_seeMore').'</a><div id="effectspells-'.$i.'" style="display: none">';
|
||||
|
||||
echo '<table class="icontab">';
|
||||
|
||||
foreach ($e['modifies'][$type] as $idx => [$id, $name, $minRank, $maxRank]):
|
||||
foreach ($e['modifies'][$type] as $idx => [$icon, $ranks]):
|
||||
if (!$idx || !($idx % 3))
|
||||
echo "<tr".($folded ? ' style="display:none;"' : '').">";
|
||||
|
||||
$iconData[] = [++$iconTabIdx, $id];
|
||||
echo "<th id=\"icontab-icon".$iconTabIdx."\"></th><td><a href=\"?spell=".$id."\">".($type ? $name : "<b>".$name."</b>")."</a>".($minRank != $maxRank ? "<br><small>(".Lang::spell('_rankRange', [$minRank, $maxRank]).")</small>" : '')."</td>\n";
|
||||
$icon->renderContainer(iconIdxOffset: $iconTabIdx); // just to assign iconOffset
|
||||
echo "<th id=\"icontab-icon".$iconTabIdx."\"></th><td><a href=\"?spell=".$icon->typeId."\">".($type ? $icon->text : "<b>".$icon->text."</b>")."</a>".($ranks ? "<br /><small>(".Lang::spell('_rankRange', $ranks).")</small>" : '')."</td>\n";
|
||||
|
||||
if ($idx == count($e['modifies'][$type]) - 1 || !(($idx + 1) % 3))
|
||||
echo "</tr>";
|
||||
|
|
@ -265,8 +260,8 @@ $WH.aE(window,\'load\',function(){$WH.ge(\'spelleffectmarkup-'.$i.'\').innerHTML
|
|||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
foreach ($iconData as [$idx, $spell])
|
||||
echo $this->fmtCreateIcon($idx, Type::SPELL, $spell, 32, size: 0);
|
||||
foreach ($e['modifies'][$type] as [$icon, ])
|
||||
echo $icon->renderJS(32);
|
||||
?>
|
||||
//]]></script>
|
||||
|
||||
|
|
@ -301,7 +296,7 @@ if ($this->attributes):
|
|||
</div>
|
||||
|
||||
<?php
|
||||
$this->brick('lvTabs', ['relTabs' => true]);
|
||||
$this->brick('lvTabs');
|
||||
|
||||
$this->brick('contribute');
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
<?php namespace Aowow; ?>
|
||||
|
||||
<?php
|
||||
$this->brick('header');
|
||||
$f = $this->filterObj->values // shorthand
|
||||
?>
|
||||
namespace Aowow\Template;
|
||||
|
||||
use Aowow\Lang;
|
||||
|
||||
$this->brick('header');
|
||||
$f = $this->filter->values; // shorthand
|
||||
?>
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
|
|
@ -12,38 +13,33 @@ $f = $this->filterObj->values // shorthand
|
|||
<?php
|
||||
$this->brick('announcement');
|
||||
|
||||
$this->brick('pageTemplate', ['fiQuery' => $this->filterObj->query, 'fiMenuItem' => [1]]);
|
||||
$this->brick('pageTemplate', ['fiQuery' => $this->filter->query, 'fiMenuItem' => [1]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?=($this->filterObj->query ? 'block' : 'none'); ?>;">
|
||||
<div id="fi" style="display: <?=($this->filter->query ? 'block' : 'none'); ?>;">
|
||||
<form action="?filter=spells<?=$this->subCat; ?>" method="post" name="fi" onsubmit="return fi_submit(this)" onreset="return fi_reset(this)">
|
||||
<div class="text">
|
||||
<?php
|
||||
$this->brick('headIcons');
|
||||
|
||||
$this->brick('redButtons');
|
||||
?>
|
||||
<h1><?=$this->h1; ?></h1>
|
||||
</div>
|
||||
<div class="rightpanel">
|
||||
<div style="float: left"><?=Lang::game('school').Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['sc[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="sc[]" size="7" multiple="multiple" class="rightselect" style="width: 8em">
|
||||
<?php
|
||||
foreach (Lang::game('sc') as $i => $str):
|
||||
if ($str):
|
||||
echo ' <option value="'.$i.'"'.(isset($f['sc']) && in_array($i, (array)$f['sc']) ? ' selected' : null).'>'.$str."</option>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?=$this->makeOptionsList(Lang::game('sc') , $f['sc'], 28,); ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php if ($this->classPanel): ?>
|
||||
<div class="rightpanel2">
|
||||
<div style="float: left"><?=Util::ucFirst(Lang::game('class')).Lang::main('colon'); ?></div>
|
||||
<div style="float: left"><?=$this->ucFirst(Lang::game('class')).Lang::main('colon'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['cl[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="cl[]" size="8" multiple="multiple" class="rightselect" style="width: 8em; background-color: #181818">
|
||||
<?php
|
||||
foreach (Lang::game('cl') as $i => $str):
|
||||
if ($str):
|
||||
echo ' <option value="'.$i.'"'.(isset($f['cl']) && in_array($i, (array)$f['cl']) ? ' selected' : null).' class="c'.$i.'">'.$str."</option>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?=$this->makeOptionsList(Lang::game('cl') , $f['cl'], 28, fn($v, $k, &$e) => $v && ($e = ['class' => 'c'.$k])); ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php
|
||||
|
|
@ -52,76 +48,52 @@ endif;
|
|||
if ($this->glyphPanel):
|
||||
?>
|
||||
<div class="rightpanel2">
|
||||
<div style="float: left"><?=Util::ucFirst(Lang::game('glyphType')).Lang::main('colon'); ?></div>
|
||||
<div style="float: left"><?=Lang::game('glyphType'); ?></div>
|
||||
<small><a href="javascript:;" onclick="document.forms['fi'].elements['gl[]'].selectedIndex = -1; return false" onmousedown="return false"><?=Lang::main('clear'); ?></a></small>
|
||||
<div class="clear"></div>
|
||||
<select name="gl[]" size="2" multiple="multiple" class="rightselect" style="width: 8em">
|
||||
<?php
|
||||
foreach (Lang::game('gl') as $i => $str):
|
||||
if ($str):
|
||||
echo ' <option value="'.$i.'"'.(isset($f['gl']) && in_array($i, (array)$f['gl']) ? ' selected' : null).'>'.$str."</option>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?=$this->makeOptionsList(Lang::game('gl') , $f['gl'], 28); ?>
|
||||
</select>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=$this->ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="2">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?=(isset($f['na']) ? 'value="'.Util::htmlEscape($f['na']).'" ' : null); ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="spell-ex" <?=(isset($f['ex']) ? 'checked="checked" ' : null); ?>/></td>
|
||||
<td> <input type="text" name="na" size="30" <?=($f['na'] ? 'value="'.$this->escHTML($f['na']).'" ' : ''); ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="spell-ex" <?=($f['ex'] ? 'checked="checked" ' : ''); ?>/></td>
|
||||
<td><label for="spell-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendedspellsearch, 0, 0, 'q')" onmousemove="$WH.Tooltip.cursorUpdate(event)" onmouseout="$WH.Tooltip.hide()"><?=Lang::main('extSearch'); ?></span></label></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?=Lang::game('level').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="2" class="smalltextbox" <?=(isset($f['minle']) ? 'value="'.$f['minle'].'" ' : null); ?>/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" <?=(isset($f['maxle']) ? 'value="'.$f['maxle'].'" ' : null); ?>/></td>
|
||||
<td class="padded"> <input type="text" name="minle" maxlength="2" class="smalltextbox" <?=($f['minle'] ? 'value="'.$f['minle'].'" ' : ''); ?>/> - <input type="text" name="maxle" maxlength="2" class="smalltextbox" <?=($f['maxle'] ? 'value="'.$f['maxle'].'" ' : ''); ?>/></td>
|
||||
<td class="padded">
|
||||
<table cellpadding="0" cellspacing="0" border="0"><tr>
|
||||
<td> <?=Lang::game('reqSkillLevel').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minrs" maxlength="3" class="smalltextbox2" <?=(isset($f['minrs']) ? 'value="'.$f['minrs'].'" ' : null); ?>/> - <input type="text" name="maxrs" maxlength="3" class="smalltextbox2" <?=(isset($f['maxrs']) ? 'value="'.$f['maxrs'].'" ' : null); ?>/></td>
|
||||
<td> <?=Lang::game('reqSkillLevel'); ?></td>
|
||||
<td> <input type="text" name="minrs" maxlength="3" class="smalltextbox2" <?=($f['minrs'] ? 'value="'.$f['minrs'].'" ' : ''); ?>/> - <input type="text" name="maxrs" maxlength="3" class="smalltextbox2" <?=($f['maxrs'] ? 'value="'.$f['maxrs'].'" ' : ''); ?>/></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?=Util::ucFirst(Lang::game('race')).Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=$this->ucFirst(Lang::game('race')).Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <select name="ra">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach (Lang::game('ra') as $i => $str):
|
||||
if ($str && $i > 0):
|
||||
echo ' <option value="'.$i.'"'.(isset($f['ra']) && $f['ra'] == $i ? ' selected' : null).'>'.$str."</option>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?=$this->makeOptionsList(Lang::game('ra') , $f['ra'], 28, fn($v, $k) => $v && $k > 0); ?>
|
||||
</select></td>
|
||||
<td class="padded"></td>
|
||||
</tr><tr>
|
||||
<td class="padded"><?=Lang::game('mechAbbr').Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=Lang::game('mechAbbr'); ?></td>
|
||||
<td class="padded"> <select name="me">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach (Lang::game('me') as $i => $str):
|
||||
if ($str):
|
||||
echo ' <option value="'.$i.'"'.(isset($f['me']) && $f['me'] == $i ? ' selected' : null).'>'.$str."</option>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?=$this->makeOptionsList(Lang::game('me') , $f['me'], 28); ?>
|
||||
</select></td>
|
||||
<td>
|
||||
<table cellpadding="0" cellspacing="0" border="0"><tr>
|
||||
<td class="padded"> <?=Lang::game('dispelType').Lang::main('colon'); ?></td>
|
||||
<td class="padded"> <select name="dt">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach (Lang::game('dt') as $i => $str):
|
||||
if ($str):
|
||||
echo ' <option value="'.$i.'"'.(isset($f['dt']) && $f['dt'] == $i ? ' selected' : null).'>'.$str."</option>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?=$this->makeOptionsList(Lang::game('dt') , $f['dt'], 28, fn($v, $k) => $v && $k != 7 && $k != 8); ?>
|
||||
</select></td>
|
||||
</tr></table>
|
||||
</td>
|
||||
|
|
@ -132,7 +104,7 @@ endforeach;
|
|||
|
||||
<div class="padded2">
|
||||
<div style="float: right"><?=Lang::main('refineSearch'); ?></div>
|
||||
<?=Lang::main('match').Lang::main('colon'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!isset($f['ma']) ? 'checked="checked" ' : null); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=(isset($f['ma']) ? 'checked="checked" ' : null); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
<?=Lang::main('match'); ?><input type="radio" name="ma" value="" id="ma-0" <?=(!$f['ma'] ? 'checked="checked" ' : ''); ?>/><label for="ma-0"><?=Lang::main('allFilter'); ?></label><input type="radio" name="ma" value="1" id="ma-1" <?=($f['ma'] ? 'checked="checked" ' : ''); ?> /><label for="ma-1"><?=Lang::main('oneFilter'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
|
@ -146,7 +118,7 @@ endforeach;
|
|||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<?php $this->brick('filter'); ?>
|
||||
<?=$this->renderFilter(12); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue