X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=blogger%2Fblogger.php;h=5cf0d27b3f22397a717bd42437ed5c1fd5192e76;hb=05d2707d501b7b1cdd98b0802121e69a6df7d05d;hp=5c03e760e8786cf52d781211300ec9ced2b4da0e;hpb=ffe5038102b53dc9e00ef0b52d33e27226d35f7f;p=friendica-addons.git
diff --git a/blogger/blogger.php b/blogger/blogger.php
index 5c03e760..5cf0d27b 100644
--- a/blogger/blogger.php
+++ b/blogger/blogger.php
@@ -9,10 +9,8 @@
use Friendica\App;
use Friendica\Content\Text\BBCode;
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
use Friendica\Core\Logger;
-use Friendica\Core\PConfig;
-use Friendica\Util\Network;
+use Friendica\DI;
use Friendica\Util\XML;
function blogger_install()
@@ -25,35 +23,19 @@ function blogger_install()
Hook::register('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
}
-function blogger_uninstall()
-{
- Hook::unregister('hook_fork', 'addon/blogger/blogger.php', 'blogger_hook_fork');
- Hook::unregister('post_local', 'addon/blogger/blogger.php', 'blogger_post_local');
- Hook::unregister('notifier_normal', 'addon/blogger/blogger.php', 'blogger_send');
- Hook::unregister('jot_networks', 'addon/blogger/blogger.php', 'blogger_jot_nets');
- Hook::unregister('connector_settings', 'addon/blogger/blogger.php', 'blogger_settings');
- Hook::unregister('connector_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
-
- // obsolete - remove
- Hook::unregister('post_local_end', 'addon/blogger/blogger.php', 'blogger_send');
- Hook::unregister('addon_settings', 'addon/blogger/blogger.php', 'blogger_settings');
- Hook::unregister('addon_settings_post', 'addon/blogger/blogger.php', 'blogger_settings_post');
-}
-
-
function blogger_jot_nets(App $a, array &$jotnets_fields)
{
if (!local_user()) {
return;
}
- if (PConfig::get(local_user(), 'blogger', 'post')) {
+ if (DI::pConfig()->get(local_user(), 'blogger', 'post')) {
$jotnets_fields[] = [
'type' => 'checkbox',
'field' => [
'blogger_enable',
- L10n::t('Post to blogger'),
- PConfig::get(local_user(), 'blogger', 'post_by_default')
+ DI::l10n()->t('Post to blogger'),
+ DI::pConfig()->get(local_user(), 'blogger', 'post_by_default')
]
];
}
@@ -68,69 +50,69 @@ function blogger_settings(App $a, &$s)
/* Add our stylesheet to the page so we can make our settings look nice */
- $a->page['htmlhead'] .= '' . "\r\n";
+ DI::page()['htmlhead'] .= '' . "\r\n";
/* Get the current state of our config variables */
- $enabled = PConfig::get(local_user(), 'blogger', 'post');
+ $enabled = DI::pConfig()->get(local_user(), 'blogger', 'post');
$checked = (($enabled) ? ' checked="checked" ' : '');
$css = (($enabled) ? '' : '-disabled');
- $def_enabled = PConfig::get(local_user(), 'blogger', 'post_by_default');
+ $def_enabled = DI::pConfig()->get(local_user(), 'blogger', 'post_by_default');
$def_checked = (($def_enabled) ? ' checked="checked" ' : '');
- $bl_username = PConfig::get(local_user(), 'blogger', 'bl_username');
- $bl_password = PConfig::get(local_user(), 'blogger', 'bl_password');
- $bl_blog = PConfig::get(local_user(), 'blogger', 'bl_blog');
+ $bl_username = DI::pConfig()->get(local_user(), 'blogger', 'bl_username');
+ $bl_password = DI::pConfig()->get(local_user(), 'blogger', 'bl_password');
+ $bl_blog = DI::pConfig()->get(local_user(), 'blogger', 'bl_blog');
/* Add some HTML to the existing form */
$s .= '';
- $s .= ''. L10n::t('Blogger Export').'
';
+ $s .= ''. DI::l10n()->t('Blogger Export').'
';
$s .= '';
$s .= '