Syntro\SilverstripeKlaro\Config
allows the configuration of klaro using the SilverStripe yaml config interface
The configuration follows https://kiprotect.com/docs/klaro/annotated-configuration
as far as possible. Language is handled by outputting only one key which
corresponds to the current i18n lang.
- Author: Matthias Leutenegger <hello@syntro.ch>
Synopsis
class Config
{
- // members
- private static array $klaro_options = ;
- private static array $klaro_purposes = ;
- private static array $klaro_services = ;
- // methods
- public static string getLang()
- public static string render()
- public static array getPurposes()
- public static array getServices()
- public static array getOptions()
- public static array getTranslationsForTemplate()
- public static array getPurposesForTemplate()
- public static array getServicesForTemplate()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Members
private
- $klaro_options
—
array
Array specifying additional global options. The options are described here: https://kiprotect.com/docs/klaro/annotated-configuration valid keys are: - 'testing' - 'elementID' - 'storageMethod' - 'storageName' - 'htmlTexts' (default: true) - 'cookieDomain' - 'cookieExpiresAfterDays' - 'default' - 'mustConsent' - 'acceptAll' - 'hideDeclineAll' - 'hideLearnMore' - $klaro_purposes
—
array
Contains purposes used by klaro. This is an array where the keys specify the identifier of the purpose and value is an array with: - 'title' : the title of the purpose - 'description' - $klaro_services
—
array
Contains the services managed by klaro. This is an array where the key represents the identifier (name used in KlaroRequirements) of the service.
Methods
public
- getLang() — getLang - returns the language part from the current locale
- getOptions() — getOptions - returns the configured services
- getPurposes() — getPurposes - returns the configured purposes
- getPurposesForTemplate() — getPurposesForTemplate - return templatable descriptions of the purposes
- getServices() — getServices - returns the configured services
- getServicesForTemplate() — getServiceForTemplate - return templatable descriptions of the services
- getTranslationsForTemplate() — getTranslationsForTemplate - constructs the translation key
- render() — render - renders the config as a js script