configUtils = $configUtils; } /** * Retrieve display style of panel. * * @param int|string|null $store * @return string */ public function getDisplayStyle($store = null): string { return (string) $this->configUtils->getStoreConfig(self::XML_PATH_DISPLAY_STYLE, $store) ?: SettingsPanelDisplayStyle::LEFT_BAR; } /** * Get overview title. * * @param string|int|null $store * @param string|null $scope * @return string */ public function getOverviewTitle($store = null, ?string $scope = null): string { return (string) $this->configUtils->getConfig(self::XML_PATH_OVERVIEW_TITLE, $store, $scope); } /** * Get overview text. * * @param string|int|null $store * @param string|null $scope * @return string */ public function getOverviewText($store = null, ?string $scope = null): string { return (string) $this->configUtils->getConfig(self::XML_PATH_OVERVIEW_TEXT, $store, $scope); } /** * Get panel text color. * * @param string|int|null $store * @param string|null $scope * @return string */ public function getTextColor($store = null, ?string $scope = null): string { return (string) $this->configUtils->getConfig(self::XML_PATH_TEXT_COLOR, $store, $scope); } /** * Get panel background color. * * @param string|int|null $store * @param string|null $scope * @return string */ public function getBackgroundColor($store = null, ?string $scope = null): string { return (string) $this->configUtils->getConfig(self::XML_PATH_BACKGROUND_COLOR, $store, $scope); } /** * Get Consent Settings Header. * * @param string|int|null $store * @param string|null $scope * @return string */ public function getConsentPreferencesHeader($store = null, ?string $scope = null): string { return trim((string) $this->configUtils->getConfig(self::XML_PATH_CONSENT_TITLE, $store, $scope)); } /** * Get status title. * * @param string|int|null $store * @param string|null $scope * @return string */ public function getEssentialCategoryStatus($store = null, ?string $scope = null): string { return trim((string) $this->configUtils->getConfig(self::XML_PATH_ESSENTIAL_CATEGORY_STATUS, $store, $scope)); } /** * Check if if can show cookie details. * * @param string|int|null $store * @param string|null $scope * @return bool */ public function canShowCookieDetails($store = null, ?string $scope = null): bool { return $this->configUtils->isSetFlag(self::XML_PATH_SHOW_COOKIE_DETAILS, $store, $scope); } /** * Get Cookie Details Title. * * @param string|int|null $store * @param string|null $scope * @return string */ public function getCookieDetailsLinkTitle($store = null, ?string $scope = null): string { return trim((string) $this->configUtils->getConfig(self::XML_PATH_COOKIE_DETAILS_LINK, $store, $scope)); } /** * Get configs for accept button. * * @param string|int|null $store * @param string|null $scope * @return array */ public function getAcceptButtonConfig($store = null, ?string $scope = null): array { return (array) $this->configUtils->getConfig(self::XML_PATH_ACCEPT_BUTTON_GROUP, $store, $scope); } /** * Get configs for decline button. * * @param string|int|null $store * @param string|null $scope * @return array */ public function getDeclineButtonConfig($store = null, ?string $scope = null): array { return (array) $this->configUtils->getConfig(self::XML_PATH_DECLINE_BUTTON_GROUP, $store, $scope); } /** * Get configs for confirm button. * * @param string|int|null $store * @param string|null $scope * @return array */ public function getConfirmButtonConfig($store = null, ?string $scope = null): array { return (array) $this->configUtils->getConfig(self::XML_PATH_CONFIRM_BUTTON_GROUP, $store, $scope); } /** * Get template for settings panel. * * @param string|int|null $store * @return string */ public function getJsComponentTemplate($store = null): string { if ($this->getDisplayStyle($store) === SettingsPanelDisplayStyle::ACCORDION_POPUP) { return 'Plumrocket_CookieConsent/settings/accordion-popup'; } return 'Plumrocket_CookieConsent/settings/left-bar'; } }