X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=ijpost%2Fijpost.php;h=9d9f9112087f80fd37272a9f008f68219e0b7127;hb=f1514063559930de791c0bff18a3f6ae4b455f7c;hp=ccd45fcaff436919dc107610bf04d04311ab2870;hpb=27b60e003f92dd9f3aebbeddb34ebb905488ca82;p=friendica-addons.git diff --git a/ijpost/ijpost.php b/ijpost/ijpost.php index ccd45fca..9d9f9112 100644 --- a/ijpost/ijpost.php +++ b/ijpost/ijpost.php @@ -1,5 +1,4 @@ */ - +use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; +use Friendica\Util\Network; function ijpost_install() { - register_hook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); - register_hook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); - register_hook('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); - register_hook('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); - register_hook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); + Addon::registerHook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); + Addon::registerHook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); + Addon::registerHook('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); + Addon::registerHook('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); + Addon::registerHook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); } function ijpost_uninstall() { - unregister_hook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); - unregister_hook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); - unregister_hook('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); - unregister_hook('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); - unregister_hook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); + Addon::unregisterHook('post_local', 'addon/ijpost/ijpost.php', 'ijpost_post_local'); + Addon::unregisterHook('notifier_normal', 'addon/ijpost/ijpost.php', 'ijpost_send'); + Addon::unregisterHook('jot_networks', 'addon/ijpost/ijpost.php', 'ijpost_jot_nets'); + Addon::unregisterHook('connector_settings', 'addon/ijpost/ijpost.php', 'ijpost_settings'); + Addon::unregisterHook('connector_settings_post', 'addon/ijpost/ijpost.php', 'ijpost_settings_post'); } @@ -38,7 +39,7 @@ function ijpost_jot_nets(&$a,&$b) { $ij_defpost = PConfig::get(local_user(),'ijpost','post_by_default'); $selected = ((intval($ij_defpost) == 1) ? ' checked="checked" ' : ''); $b .= '
' - . t('Post to Insanejournal') . '
'; + . L10n::t('Post to Insanejournal') . ''; } } @@ -68,36 +69,36 @@ function ijpost_settings(&$a,&$s) { /* Add some HTML to the existing form */ $s .= ''; - $s .= '

'. t("InsaneJournal Export").'

'; + $s .= '

'. L10n::t("InsaneJournal Export").'

'; $s .= '
'; $s .= ''; + $s .= '
'; } @@ -219,8 +220,9 @@ EOT; logger('ijpost: data: ' . $xml, LOGGER_DATA); - if($ij_blog !== 'test') - $x = post_url($ij_blog,$xml,["Content-Type: text/xml"]); + if($ij_blog !== 'test') { + $x = Network::post($ij_blog, $xml, ["Content-Type: text/xml"]); + } logger('posted to insanejournal: ' . ($x) ? $x : '', LOGGER_DEBUG); }