From b18bc644404e02b57635bfcc8258e85abb141146 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:44:46 +0200 Subject: Adding upstream version 1.1.1. Signed-off-by: Daniel Baumann --- .../Icingadb/Widget/ItemList/BaseHostListItem.php | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 library/Icingadb/Widget/ItemList/BaseHostListItem.php (limited to 'library/Icingadb/Widget/ItemList/BaseHostListItem.php') diff --git a/library/Icingadb/Widget/ItemList/BaseHostListItem.php b/library/Icingadb/Widget/ItemList/BaseHostListItem.php new file mode 100644 index 0000000..edaf6c8 --- /dev/null +++ b/library/Icingadb/Widget/ItemList/BaseHostListItem.php @@ -0,0 +1,56 @@ +getNoSubjectLink()) { + return new HtmlElement( + 'span', + Attributes::create(['class' => 'subject']), + Text::create($this->item->display_name) + ); + } else { + return new Link($this->item->display_name, Links::host($this->item), ['class' => 'subject']); + } + } + + protected function init(): void + { + parent::init(); + + if ($this->list->getNoSubjectLink()) { + $this->setNoSubjectLink(); + } + + $this->list->addDetailFilterAttribute($this, Filter::equal('name', $this->item->name)) + ->addMultiselectFilterAttribute($this, Filter::equal('host.name', $this->item->name)); + } +} -- cgit v1.2.3