X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=buffer%2Fbuffer.php;h=9bbdf21e529850b09f0524494abd1eac4c6d1eb6;hb=e34b227e614c9299326ab3ddabac3befe30da7fe;hp=a583496d85327b8c7a1a3882b9ecb84999ae9d7e;hpb=f2fc22227a0dfae8f5c85f24f1c5bfa6e5c4c245;p=friendica-addons.git
diff --git a/buffer/buffer.php b/buffer/buffer.php
index a583496d..9bbdf21e 100644
--- a/buffer/buffer.php
+++ b/buffer/buffer.php
@@ -9,7 +9,6 @@
require 'addon/buffer/bufferapp.php';
use Friendica\App;
-use Friendica\Core\Config;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Protocol;
@@ -30,16 +29,6 @@ function buffer_install()
Hook::register('connector_settings_post', 'addon/buffer/buffer.php', 'buffer_settings_post');
}
-function buffer_uninstall()
-{
- Hook::unregister('hook_fork', 'addon/buffer/buffer.php', 'buffer_hook_fork');
- Hook::unregister('post_local', 'addon/buffer/buffer.php', 'buffer_post_local');
- Hook::unregister('notifier_normal', 'addon/buffer/buffer.php', 'buffer_send');
- Hook::unregister('jot_networks', 'addon/buffer/buffer.php', 'buffer_jot_nets');
- Hook::unregister('connector_settings', 'addon/buffer/buffer.php', 'buffer_settings');
- Hook::unregister('connector_settings_post', 'addon/buffer/buffer.php', 'buffer_settings_post');
-}
-
function buffer_module()
{
}
@@ -78,8 +67,8 @@ function buffer_addon_admin(App $a, &$o)
$o = Renderer::replaceMacros($t, [
'$submit' => DI::l10n()->t('Save Settings'),
// name, label, value, help, [extra values]
- '$client_id' => ['client_id', DI::l10n()->t('Client ID'), Config::get('buffer', 'client_id'), ''],
- '$client_secret' => ['client_secret', DI::l10n()->t('Client Secret'), Config::get('buffer', 'client_secret'), ''],
+ '$client_id' => ['client_id', DI::l10n()->t('Client ID'), DI::config()->get('buffer', 'client_id'), ''],
+ '$client_secret' => ['client_secret', DI::l10n()->t('Client Secret'), DI::config()->get('buffer', 'client_secret'), ''],
]);
}
@@ -88,10 +77,8 @@ function buffer_addon_admin_post(App $a)
$client_id = (!empty($_POST['client_id']) ? Strings::escapeTags(trim($_POST['client_id'])) : '');
$client_secret = (!empty($_POST['client_secret']) ? Strings::escapeTags(trim($_POST['client_secret'])) : '');
- Config::set('buffer', 'client_id' , $client_id);
- Config::set('buffer', 'client_secret', $client_secret);
-
- info(DI::l10n()->t('Settings updated.'). EOL);
+ DI::config()->set('buffer', 'client_id' , $client_id);
+ DI::config()->set('buffer', 'client_secret', $client_secret);
}
function buffer_connect(App $a)
@@ -105,8 +92,8 @@ function buffer_connect(App $a)
session_start();
// Define the needed keys
- $client_id = Config::get('buffer','client_id');
- $client_secret = Config::get('buffer','client_secret');
+ $client_id = DI::config()->get('buffer','client_id');
+ $client_secret = DI::config()->get('buffer','client_secret');
// The callback URL is the script that gets called after the user authenticates with buffer
$callback_url = DI::baseUrl()->get()."/buffer/connect";
@@ -172,8 +159,8 @@ function buffer_settings(App $a, &$s)
$s .= '