From: Peter Liebetrau Date: Wed, 23 Jan 2019 10:00:52 +0000 (+0100) Subject: cookienotice addon - added default values for config data X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=145fb69eb64bf1afc5865d9d38f198dbf01e0371;p=friendica-addons.git cookienotice addon - added default values for config data --- diff --git a/cookienotice/cookienotice.php b/cookienotice/cookienotice.php index 7e945c15..fbe5a1b1 100644 --- a/cookienotice/cookienotice.php +++ b/cookienotice/cookienotice.php @@ -7,7 +7,6 @@ * Author: Peter Liebetrau * */ -use Friendica\Core\Addon; use Friendica\Core\Hook; use Friendica\Core\Config; use Friendica\Core\L10n; @@ -60,17 +59,11 @@ function cookienotice_addon_settings(\Friendica\App $a, &$s) } /* Add our stylesheet to the page so we can make our settings look nice */ - $stylesheetPath = 'addon/cookienotice/cookienotice.css'; - $a->registerStylesheet($stylesheetPath); + $stylesheetPath = 'addon/cookienotice/cookienotice.css'; + $a->registerStylesheet($stylesheetPath); - $text = Config::get('cookienotice', 'text'); - if (!$text) { - $text = ''; - } - $oktext = Config::get('cookienotice', 'oktext'); - if (!$oktext) { - $oktext = ''; - } + $text = Config::get('cookienotice', 'text', L10n::t('This website uses cookies. If you continue browsing this website, you agree to the usage of cookies.')); + $oktext = Config::get('cookienotice', 'oktext', L10n::t('OK')); $t = Renderer::getMarkupTemplate("settings.tpl", "addon/cookienotice/"); $s .= Renderer::replaceMacros($t, [