'widget-drag-initiator']); } /** * Assemble a header element for this item list * * @param Url $url * @param string $title * * @return void */ protected function assembleHeader(Url $url, string $title) { $header = HtmlElement::create('h1', ['class' => 'collapsible-header'], $title); $header->addHtml(new Link(t('Edit'), $url, [ 'data-icinga-modal' => true, 'data-no-icinga-ajax' => true ])); $header->addHtml(self::createDragInitiator()); $this->addHtml($header); } protected function assemble() { $this->getAttributes()->add([ 'id' => $this->getHtmlId(), 'class' => 'collapsible', 'data-toggle-element' => '.dashboard-list-info', ]); $this->addHtml(HtmlElement::create('div', ['class' => $this->getCollapsibleControlClass()], [ new Icon('angle-down', ['class' => 'expand-icon', 'title' => t('Expand')]), new Icon('angle-up', ['class' => 'collapse-icon', 'title' => t('Collapse')]) ])); $this->addHtml($this->createItemList()); $actionLink = $this->createActionLink(); $actionLink->getAttributes()->add([ 'data-icinga-modal' => true, 'data-no-icinga-ajax' => true ]); $this->addHtml($actionLink); } }