]> git.mxchange.org Git - friendica-addons.git/commitdiff
cookienotice addon - fixes for 2019.01 - Template loading and replace macros
authorPeter Liebetrau <peter.liebetrau@gmail.com>
Tue, 22 Jan 2019 15:50:13 +0000 (16:50 +0100)
committerPeter Liebetrau <peter.liebetrau@gmail.com>
Tue, 22 Jan 2019 15:50:13 +0000 (16:50 +0100)
cookienotice/cookienotice.php

index 4eea080f271422376ef2c071006ee9ed3b6ea16b..f0f7a8ee31dd092101aa3cd7efdad4cb018425c5 100644 (file)
@@ -7,9 +7,11 @@
  * Author: Peter Liebetrau <https://socivitas/profile/peerteer>
  * 
  */
+use Friendica\Core\Addon;
 use Friendica\Core\Hook;
 use Friendica\Core\Config;
 use Friendica\Core\L10n;
+use Friendica\Core\Renderer;
 
 /**
  * cookienotice_install
@@ -71,8 +73,8 @@ function cookienotice_addon_settings(\Friendica\App $a, &$s)
                $oktext = '';
        }
 
-       $t = get_markup_template("settings.tpl", "addon/cookienotice/");
-       $s .= replace_macros($t, [
+       $t = Renderer::getMarkupTemplate("settings.tpl", "addon/cookienotice/");
+       $s .= Renderer::replaceMacros($t, [
                '$title' => L10n::t('"cookienotice" Settings'),
                '$description' => L10n::t('<b>Configure your cookie usage notice.</b> It should just be a notice, saying that the website uses cookies. It is shown as long as a user didnt confirm clicking the OK button.'),
                '$text' => ['cookienotice-text', L10n::t('Cookie Usage Notice'), $text, L10n::t('The cookie usage notice')],
@@ -138,9 +140,9 @@ function cookienotice_page_end(\Friendica\App $a, &$b)
        $text = (string) Config::get('cookienotice', 'text', L10n::t('This website uses cookies to recognize revisiting and logged in users. You accept the usage of these cookies by continue browsing this website.'));
        $oktext = (string) Config::get('cookienotice', 'oktext', L10n::t('OK'));
 
-       $page_end_tpl = get_markup_template("cookienotice.tpl", "addon/cookienotice/");
+       $page_end_tpl = Renderer::getMarkupTemplate("cookienotice.tpl", "addon/cookienotice/");
 
-       $page_end = replace_macros($page_end_tpl, [
+       $page_end = Renderer::replaceMacros($page_end_tpl, [
                '$text' => $text,
                '$oktext' => $oktext,
        ]);