]> git.mxchange.org Git - friendica-addons.git/blobdiff - piwik/piwik.php
Remove unneeded Config namespace usages
[friendica-addons.git] / piwik / piwik.php
index f4d10b2263df1851e2fe9e26776fec3b84d2c78f..6dba45a347c1466215b1ed6a91be4941869b0284 100644 (file)
@@ -31,9 +31,7 @@
  *     setting.
  */
 
-use Friendica\Core\Config;
 use Friendica\Core\Hook;
-use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\DI;
@@ -71,10 +69,10 @@ function piwik_analytics($a,&$b) {
        /*
         *   Get the configuration variables from the config/addon.config.php file.
         */
-       $baseurl = Config::get('piwik', 'baseurl');
-       $siteid  = Config::get('piwik', 'siteid');
-       $optout  = Config::get('piwik', 'optout');
-       $async   = Config::get('piwik', 'async');
+       $baseurl = DI::config()->get('piwik', 'baseurl');
+       $siteid  = DI::config()->get('piwik', 'siteid');
+       $optout  = DI::config()->get('piwik', 'optout');
+       $async   = DI::config()->get('piwik', 'async');
 
        /*
         *   Add the Piwik tracking code for the site.
@@ -104,10 +102,10 @@ function piwik_addon_admin (&$a, &$o) {
        $t = Renderer::getMarkupTemplate( "admin.tpl", "addon/piwik/" );
        $o = Renderer::replaceMacros( $t, [
                '$submit' => DI::l10n()->t('Save Settings'),
-               '$piwikbaseurl' => ['baseurl', DI::l10n()->t('Matomo (Piwik) Base URL'), Config::get('piwik','baseurl' ), DI::l10n()->t('Absolute path to your Matomo (Piwik) installation. (without protocol (http/s), with trailing slash)')],
-               '$siteid' => ['siteid', DI::l10n()->t('Site ID'), Config::get('piwik','siteid' ), ''],
-               '$optout' => ['optout', DI::l10n()->t('Show opt-out cookie link?'), Config::get('piwik','optout' ), ''],
-               '$async' => ['async', DI::l10n()->t('Asynchronous tracking'), Config::get('piwik','async' ), ''],
+               '$piwikbaseurl' => ['baseurl', DI::l10n()->t('Matomo (Piwik) Base URL'), DI::config()->get('piwik','baseurl' ), DI::l10n()->t('Absolute path to your Matomo (Piwik) installation. (without protocol (http/s), with trailing slash)')],
+               '$siteid' => ['siteid', DI::l10n()->t('Site ID'), DI::config()->get('piwik','siteid' ), ''],
+               '$optout' => ['optout', DI::l10n()->t('Show opt-out cookie link?'), DI::config()->get('piwik','optout' ), ''],
+               '$async' => ['async', DI::l10n()->t('Asynchronous tracking'), DI::config()->get('piwik','async' ), ''],
        ]);
 }
 function piwik_addon_admin_post (&$a) {
@@ -115,9 +113,9 @@ function piwik_addon_admin_post (&$a) {
        $id = (!empty($_POST['siteid']) ? trim($_POST['siteid']) : '');
        $optout = (!empty($_POST['optout']) ? trim($_POST['optout']) : '');
        $async = (!empty($_POST['async']) ? trim($_POST['async']) : '');
-       Config::set('piwik', 'baseurl', $url);
-       Config::set('piwik', 'siteid', $id);
-       Config::set('piwik', 'optout', $optout);
-       Config::set('piwik', 'async', $async);
+       DI::config()->set('piwik', 'baseurl', $url);
+       DI::config()->set('piwik', 'siteid', $id);
+       DI::config()->set('piwik', 'optout', $optout);
+       DI::config()->set('piwik', 'async', $async);
        info(DI::l10n()->t('Settings updated.'). EOL);
 }