mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Template/Update (Part 19)
* convert dbtype 'achievement'
This commit is contained in:
@@ -3,24 +3,24 @@
|
||||
|
||||
use \Aowow\Lang;
|
||||
|
||||
if ($m = $this->mail):
|
||||
if (['header' => $header, 'subject' => $subject, 'text' => $text, 'attachments' => $attachments] = $this->mail):
|
||||
$offset ??= 0; // in case we have multiple icons on the page (prominently quest-rewards)
|
||||
|
||||
echo ' <h3>'.Lang::mail('mailDelivery', $m['header'])."</h3>\n";
|
||||
echo ' <h3>'.Lang::mail('mailDelivery', $header)."</h3>\n";
|
||||
|
||||
if ($m['subject']):
|
||||
echo ' <div class="book"><div class="page">'.$m['subject']."</div></div>\n";
|
||||
if ($subject):
|
||||
echo ' <div class="book"><div class="page">'.$subject."</div></div>\n";
|
||||
endif;
|
||||
|
||||
if ($m['text']):
|
||||
echo ' <div class="book" style="float:left; margin-bottom:26px;"><div class="page">'.$m['text']."</div></div>\n";
|
||||
if ($text):
|
||||
echo ' <div class="book" style="float:left; margin-bottom:26px;"><div class="page">'.$text."</div></div>\n";
|
||||
endif;
|
||||
|
||||
if ($m['attachments']):
|
||||
if ($attachments):
|
||||
?>
|
||||
<table class="icontab icontab-box" style="padding-left:10px;">
|
||||
<?php
|
||||
foreach ($m['attachments'] as $icon):
|
||||
foreach ($attachments as $icon):
|
||||
echo $icon->renderContainer(20, $offset, true);
|
||||
endforeach;
|
||||
?>
|
||||
@@ -28,8 +28,8 @@ if ($m = $this->mail):
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
foreach ($m['attachments'] as $icon):
|
||||
echo $icon->renderJS();
|
||||
foreach ($attachments as $icon):
|
||||
echo $icon->renderJS(20);
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<?php namespace Aowow; ?>
|
||||
<?php
|
||||
namespace Aowow\Template;
|
||||
|
||||
<?php $this->brick('header'); ?>
|
||||
use \Aowow\Lang;
|
||||
|
||||
$this->brick('header');
|
||||
?>
|
||||
<div class="main" id="main">
|
||||
<div class="main-precontents" id="main-precontents"></div>
|
||||
<div class="main-contents" id="main-contents">
|
||||
@@ -20,75 +23,29 @@ $this->brick('headIcons');
|
||||
|
||||
$this->brick('redButtons');
|
||||
?>
|
||||
<h1><?=$this->name; ?></h1>
|
||||
|
||||
<h1><?=$this->h1; ?></h1>
|
||||
<?=$this->description.PHP_EOL; ?>
|
||||
<h3><?=Lang::achievement('criteria').($this->reqCrtQty ? ' – <small><b>'.Lang::achievement('reqNumCrt', [$this->reqCrtQty, count($this->criteria)]).'</b></small>' : ''); ?></h3>
|
||||
<?php
|
||||
echo $this->description;
|
||||
|
||||
echo '<h3>'.Lang::achievement('criteria').($this->criteria['reqQty'] ? ' – <small><b>'.Lang::achievement('reqNumCrt').' '.$this->criteria['reqQty'].' '.Lang::achievement('outOf').' '.count($this->criteria['data']).'</b></small>' : null)."</h3>\n";
|
||||
?>
|
||||
|
||||
|
||||
<?php
|
||||
$tbl1 = '<div style="float: left;"><table class="iconlist">%s</table></div>';
|
||||
$tbl2 = '<div style="float: left; margin-right: 25px"><table class="iconlist">%s</table></div>';
|
||||
$rows1 = '';
|
||||
$rows2 = '';
|
||||
|
||||
foreach ($this->criteria['data'] as $i => $cr):
|
||||
if (isset($cr['icon'])):
|
||||
$row = '<tr><th align="right" id="iconlist-icon'.$cr['icon'].'"></th>';
|
||||
else:
|
||||
$row = '<tr><th><ul><li><var> </var></li></ul></th>';
|
||||
endif;
|
||||
|
||||
$row .= '<td><span class="tip" title="ID'.Lang::main('colon').$cr['id'].'">';
|
||||
|
||||
if (!empty($cr['link'])):
|
||||
$row .= '<a href="'.$cr['link']['href'].'"'.(isset($cr['link']['quality']) ? ' class="q'.$cr['link']['quality'].'"' : null).'>'.Util::htmlEscape($cr['link']['text']).'</a>';
|
||||
endif;
|
||||
|
||||
if (!empty($cr['link']['count']) && $cr['link']['count'] > 1):
|
||||
$row .= ' ('.$cr['link']['count'].')';
|
||||
endif;
|
||||
|
||||
if (isset($cr['extraText'])):
|
||||
$row .= ' '.$cr['extraText'];
|
||||
endif;
|
||||
|
||||
$row .= '</span>';
|
||||
|
||||
if (!empty($cr['extraData'])):
|
||||
$buff = [];
|
||||
foreach ($cr['extraData'] as $xd):
|
||||
$buff[] = $xd[0] ? '<a href="'.$xd[0].'">'.$xd[1].'</a>' : '<span>'.$xd[1].'</span>';
|
||||
endforeach;
|
||||
|
||||
$row .= '<br /><sup style="margin-left:8px;">('.implode(', ', $buff).')</sup>';
|
||||
endif;
|
||||
|
||||
$row .= '</td></tr>';
|
||||
|
||||
$rows0 = $rows1 = '';
|
||||
foreach ($this->criteria as $i => $icon):
|
||||
// every odd number of elements
|
||||
if ($i + 1 > round(count($this->criteria['data']) / 2)):
|
||||
$rows2 .= $row;
|
||||
else:
|
||||
$rows1 .= $row;
|
||||
endif;
|
||||
${'rows' . ($i % 2)} .= $icon->renderContainer(20, $i, true);
|
||||
endforeach;
|
||||
|
||||
if ($rows2):
|
||||
echo sprintf($tbl2, $rows2);
|
||||
if ($rows0):
|
||||
echo " <div style=\"float: left; margin-right: 25px\"><table class=\"iconlist\">\n".$rows0." </table></div>\n";
|
||||
endif;
|
||||
if ($rows1):
|
||||
echo sprintf($tbl1, $rows1);
|
||||
echo " <div style=\"float: left;\"><table class=\"iconlist\">\n".$rows1." </table></div>\n";
|
||||
endif;
|
||||
?>
|
||||
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
<?php
|
||||
foreach ($this->criteria['icons'] as $k => $ic):
|
||||
echo ' $WH.ge(\'iconlist-icon'.$ic['itr'].'\').appendChild('.$ic['type'].'.createIcon('.$ic['id'].', 0, '.(!empty($ic['count']) ? $ic['count'] : 0)."));\n";
|
||||
foreach ($this->criteria as $crt):
|
||||
echo $crt->renderJS(24);
|
||||
endforeach;
|
||||
?>
|
||||
//]]></script>
|
||||
@@ -96,29 +53,28 @@ endforeach;
|
||||
<div style="clear: left"></div>
|
||||
|
||||
<?php
|
||||
if ($r = $this->rewards):
|
||||
if (!empty($r['item'])):
|
||||
if ([$rewItems, $rewTitle, $rewText] = $this->rewards):
|
||||
if ($rewItems):
|
||||
echo '<h3>'.Lang::main('rewards')."</h3>\n";
|
||||
$this->brick('rewards', ['rewards' => $r['item'], 'rewTitle' => null]);
|
||||
$this->brick('rewards', ['rewards' => $rewItems, 'rewTitle' => null]);
|
||||
endif;
|
||||
|
||||
if (!empty($r['title'])):
|
||||
if ($rewTitle):
|
||||
echo '<h3>'.Lang::main('gains')."</h3>\n<ul>";
|
||||
foreach ($r['title'] as $i):
|
||||
foreach ($rewTitle as $i):
|
||||
echo ' <li><div>'.$i."</div></li>\n";
|
||||
endforeach;
|
||||
echo "</ul>\n";
|
||||
endif;
|
||||
|
||||
if (empty($r['title']) && empty($r['item']) && $r['text']):
|
||||
echo '<h3>'.Lang::main('rewards')."</h3>\n" .
|
||||
'<ul><li><div>'.$r['text']."</div></li></ul>\n";
|
||||
if (!$rewTitle && !$rewItems && $rewText):
|
||||
echo '<h3>'.Lang::main('rewards')."</h3>\n<ul><li><div>".$rewText."</div></li></ul>\n";
|
||||
endif;
|
||||
endif;
|
||||
|
||||
$this->brick('mail');
|
||||
$this->brickIf($this->mail, 'mail');
|
||||
|
||||
if (!empty($this->transfer)):
|
||||
if ($this->transfer):
|
||||
echo " <div style=\"clear: left\"></div>";
|
||||
echo " <div class=\"pad\"></div>\n ".$this->transfer."\n";
|
||||
endif;
|
||||
@@ -129,7 +85,7 @@ endif;
|
||||
</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,37 +13,38 @@ $f = $this->filterObj->values // shorthand
|
||||
<?php
|
||||
$this->brick('announcement');
|
||||
|
||||
$this->brick('pageTemplate', ['fiQuery' => $this->filterObj->query, 'fiMenuItem' => [9]]);
|
||||
$this->brick('pageTemplate', ['fiQuery' => $this->filter->query, 'fiMenuItem' => [9]]);
|
||||
?>
|
||||
|
||||
<div id="fi" style="display: <?=$this->filterObj->query ? 'block' : 'none'; ?>;">
|
||||
<div id="fi" style="display: <?=$this->filter->query ? 'block' : 'none'; ?>;">
|
||||
<form action="?filter=achievements<?=$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>
|
||||
<table>
|
||||
<tr>
|
||||
<td><?=Util::ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td><?=$this->ucFirst(Lang::main('name')).Lang::main('colon'); ?></td>
|
||||
<td colspan="3">
|
||||
<table><tr>
|
||||
<td> <input type="text" name="na" size="30" <?=isset($f['na']) ? 'value="'.$f['na'].'"' : null; ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="achievement-ex" <?=isset($f['ex']) ? 'checked="checked"' : null; ?>/></td>
|
||||
<td> <input type="text" name="na" size="30" <?=$f['na'] ? 'value="'.$f['na'].'"' : ''; ?>/></td>
|
||||
<td> <input type="checkbox" name="ex" value="on" id="achievement-ex" <?=$f['ex'] ? 'checked="checked"' : ''; ?>/></td>
|
||||
<td><label for="achievement-ex"><span class="tip" onmouseover="$WH.Tooltip.showAtCursor(event, LANG.tooltip_extendedachievementsearch, 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::main('side').Lang::main('colon'); ?></td>
|
||||
<td class="padded"><?=Lang::main('side'); ?></td>
|
||||
<td class="padded"> <select name="si">
|
||||
<option></option>
|
||||
<?php
|
||||
foreach (Lang::game('si') as $i => $str):
|
||||
if ($str):
|
||||
echo ' <option value="'.$i.'" '.((isset($f['si']) && $f['si'] == $i) ? 'selected' : null).'>'.$str."</option>\n";
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?=$this->makeOptionsList(Lang::game('si'), $f['si'], 36); ?>
|
||||
</select>
|
||||
</td>
|
||||
<td class="padded"><table><tr>
|
||||
<td> <?=Lang::achievement('points').Lang::main('colon'); ?></td>
|
||||
<td> <input type="text" name="minpt" maxlength="2" class="smalltextbox" <?=isset($f['minpt']) ? 'value="'.$f['minpt'].'"' : null; ?>/> - <input type="text" name="maxpt" maxlength="2" class="smalltextbox" <?=isset($f['maxpt']) ? 'value="'.$f['maxpt'].'"' : null; ?>/></td>
|
||||
<td> <input type="text" name="minpt" maxlength="2" class="smalltextbox" <?=$f['minpt'] ? 'value="'.$f['minpt'].'"' : ''; ?>/> - <input type="text" name="maxpt" maxlength="2" class="smalltextbox" <?=$f['maxpt'] ? 'value="'.$f['maxpt'].'"' : ''; ?>/></td>
|
||||
</tr></table></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -51,7 +53,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>
|
||||
@@ -65,7 +67,7 @@ endforeach;
|
||||
<div class="pad"></div>
|
||||
</div>
|
||||
|
||||
<?php $this->brick('filter'); ?>
|
||||
<?=$this->renderFilter(12); ?>
|
||||
|
||||
<?php $this->brick('lvTabs'); ?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user