refactor
This commit is contained in:
@@ -2243,13 +2243,17 @@ class Priems
|
||||
return [0 => $lvar, 1 => $pz];
|
||||
}
|
||||
|
||||
/**
|
||||
* Генерирует html строку для вставки в JS $("#priems").html(" сюда ");
|
||||
* @return string
|
||||
*/
|
||||
public function seeMy(): string
|
||||
{
|
||||
global $btl;
|
||||
$i = 0;
|
||||
$p = explode('|', $this->u->info['priems']);
|
||||
$pr = '';
|
||||
$all = (int)$_GET['all'];
|
||||
$all = $_GET['all'] ??= '0';
|
||||
while ($i < $this->u->info['priemslot']) {
|
||||
if ($p[$i] > 0) {
|
||||
$pl = Db::getRow('select * from priems where level <= ? and activ > 0 and id = ?', [$this->u->info['level'], $p[$i]]);
|
||||
@@ -2289,14 +2293,20 @@ class Priems
|
||||
$notr = $this->testpriem($pl, 2);
|
||||
|
||||
$cli2 = '';
|
||||
if (($pz[$i] > 0 || $notr > 0) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || $this->u->stats['notuse_last_pr'] == $pl['id']) {
|
||||
if (($pz[$i] > 0 || $notr > 0) || (isset($this->u->stats['nopriems']) && $pl['nosh'] == 0) || isset($this->u->stats['notuse_last_pr']) && $this->u->stats['notuse_last_pr'] == $pl['id']) {
|
||||
$cli2 = ' class="nopriemuse" ';
|
||||
}
|
||||
/// ТУТ!
|
||||
$priemName = $pl['name'];
|
||||
$priemImg = $pl['img'];
|
||||
|
||||
// Слава StackOverflow! https://stackoverflow.com/a/43631576
|
||||
$var = json_encode("<b>$priemName</b><br>$lvar");
|
||||
$jsOnmouseover = "top.hi(this,$var,event,3,0,1,1,'width: 240px;')";
|
||||
$htmlJs = htmlspecialchars($jsOnmouseover, ENT_QUOTES);
|
||||
|
||||
$pr .= <<<HTML
|
||||
<a onmouseover="let a = `<b>$priemName</b><br>$lvar`; top.hi(this,a,event,3,0,1,1,'width: 240px;')" onmouseout="top.hic();" onmousedown="top.hic();" $cl>
|
||||
<a onmouseover="$htmlJs" onmouseout="top.hic();" onmousedown="top.hic();" $cl>
|
||||
<img $cli2 style="margin-top: 3px; margin-left: 4px;" src="//img.new-combats.tech/i/eff/$priemImg.gif" alt=""></a>
|
||||
</a>
|
||||
HTML;
|
||||
|
||||
Reference in New Issue
Block a user