chore: sync module from working instance and add install guide
This commit is contained in:
41
events/AnimalTileRenderEvent.php
Normal file
41
events/AnimalTileRenderEvent.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace humhub\modules\animal_management\events;
|
||||
|
||||
use humhub\modules\animal_management\models\Animal;
|
||||
use humhub\modules\content\components\ContentContainerActiveRecord;
|
||||
use yii\base\Event;
|
||||
|
||||
class AnimalTileRenderEvent extends Event
|
||||
{
|
||||
public const EVENT_RENDER_OVERLAY = 'renderOverlay';
|
||||
|
||||
public Animal $animal;
|
||||
public ContentContainerActiveRecord $contentContainer;
|
||||
public $existingDonationGoal = null;
|
||||
public bool $showDonationSettingsButton = false;
|
||||
public string $donationToggleInputId = '';
|
||||
public string $donationInlineFormId = '';
|
||||
|
||||
/** @var string[] */
|
||||
private array $htmlFragments = [];
|
||||
|
||||
public function addHtml(string $html): void
|
||||
{
|
||||
$html = trim($html);
|
||||
if ($html === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->htmlFragments[] = $html;
|
||||
}
|
||||
|
||||
public function getHtml(): string
|
||||
{
|
||||
if (empty($this->htmlFragments)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return implode("\n", $this->htmlFragments);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user