X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=wppost%2Fwppost.php;h=f9caf232857da1b62cb43ff958230a3de7a8022a;hb=bfcf9feca18a51524fa79e7415f56a430643e9f0;hp=4e4ae7138e59e708e7e2dc73db499cafaa5d0110;hpb=74f89673cb21c263e41d1e5957d85176eb5de8d5;p=friendica-addons.git diff --git a/wppost/wppost.php b/wppost/wppost.php index 4e4ae713..f9caf232 100644 --- a/wppost/wppost.php +++ b/wppost/wppost.php @@ -9,11 +9,9 @@ use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; use Friendica\Core\Hook; -use Friendica\Core\L10n; use Friendica\Core\Logger; -use Friendica\Core\PConfig; use Friendica\Database\DBA; -use Friendica\Util\Network; +use Friendica\DI; use Friendica\Util\Strings; use Friendica\Util\XML; @@ -27,139 +25,128 @@ function wppost_install() Hook::register('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); } -function wppost_uninstall() -{ - Hook::unregister('hook_fork', 'addon/wppost/wppost.php', 'wppost_hook_fork'); - Hook::unregister('post_local', 'addon/wppost/wppost.php', 'wppost_post_local'); - Hook::unregister('notifier_normal', 'addon/wppost/wppost.php', 'wppost_send'); - Hook::unregister('jot_networks', 'addon/wppost/wppost.php', 'wppost_jot_nets'); - Hook::unregister('connector_settings', 'addon/wppost/wppost.php', 'wppost_settings'); - Hook::unregister('connector_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); - - // obsolete - remove - Hook::unregister('post_local_end', 'addon/wppost/wppost.php', 'wppost_send'); - Hook::unregister('addon_settings', 'addon/wppost/wppost.php', 'wppost_settings'); - Hook::unregister('addon_settings_post', 'addon/wppost/wppost.php', 'wppost_settings_post'); -} - - -function wppost_jot_nets(&$a, &$b) +function wppost_jot_nets(\Friendica\App &$a, array &$jotnets_fields) { if (!local_user()) { return; } - $wp_post = PConfig::get(local_user(), 'wppost', 'post'); - if (intval($wp_post) == 1) { - $wp_defpost = PConfig::get(local_user(),'wppost','post_by_default'); - $selected = ((intval($wp_defpost) == 1) ? ' checked="checked" ' : ''); - $b .= '