Перенос специализированных методов из глобального класса в более узкий.

This commit is contained in:
lopar
2021-03-10 23:43:48 +02:00
parent 0a07d53be7
commit c99e54af1a
3 changed files with 72 additions and 58 deletions
+9 -5
View File
@@ -22,12 +22,16 @@ class InventoryItem extends Item
public function printImage()
{
if (in_array($this->item_type, range(1,12))) {
echo "<a href=/main.php?edit=1&dress={$this->item_id} title='Надеть'>";
parent::printImage();
echo "</a>";
if (in_array($this->item_type, range(1, 12))) {
echo <<<HTML
<a href=/main.php?edit=1&dress={$this->item_id} title='Надеть'>
<img src="/i/sh/{$this->image}" class="item-wrap-normal" alt="">
</a>
HTML;
} else {
parent::printImage();
echo <<<IMG
<img src="/i/sh/{$this->image}" class="item-wrap-normal" alt="">
IMG;
}
}