. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Module; use Illuminate\Support\Collection; /** * Trait ModuleSidebarTrait - default implementation of ModuleSidebarInterface */ trait ModuleSidebarTrait { /** @var int The default position for this sidebar. It can be changed in the control panel. */ protected $sidebar_order = 0; /** * The text that appears on the sidebar's title. * * @return string */ public function sidebarTitle(): string { return $this->title(); } /** * Users change change the order of sidebars using the control panel. * * @param int $sidebar_order * * @return void */ public function setSidebarOrder(int $sidebar_order): void { $this->sidebar_order = $sidebar_order; } /** * Users change change the order of sidebars using the control panel. * * @return int */ public function getSidebarOrder(): int { return $this->sidebar_order ?? $this->defaultSidebarOrder(); } /** * The default position for this sdiebar. * * @return int */ public function defaultSidebarOrder(): int { return 9999; } /** * This module handles the following facts - so don't show them on the "Facts and events" tab. * * @return Collection|string[] */ public function supportedFacts(): Collection { return new Collection([]); } }