getUser(); $this->toolbox = $toolbox; $this->actionsMenu = $actionsMenu; $this->isPinned = $isPinned; $this->pinnableHeader = $user->isRegistered() ? new VectorComponentPinnableHeader( $skin->getContext(), $isPinned, // Name 'vector-page-tools', // Feature name 'page-tools-pinned' ) : null; $this->skin = $skin; } /** * @inheritDoc */ public function getTemplateData(): array { $menusData = [ $this->toolbox, $this->actionsMenu ]; $id = 'vector-page-tools'; $pinnedContainer = new VectorComponentPinnedContainer( $id, $this->isPinned ); $pinnableElement = new VectorComponentPinnableElement( $id ); $data = $pinnableElement->getTemplateData() + $pinnedContainer->getTemplateData(); return $data + [ 'data-pinnable-header' => $this->pinnableHeader ? $this->pinnableHeader->getTemplateData() : null, 'data-menus' => $menusData, ]; } }