X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=blockem%2Fblockem.php;h=1880b9be44e5029bcc36a7da1e20c78746177bc8;hb=e34b227e614c9299326ab3ddabac3befe30da7fe;hp=c915cd6cee6795612108cb07840617ea948336aa;hpb=2ed63ea72e83d4020eb701db17e3727c919a1aa1;p=friendica-addons.git
diff --git a/blockem/blockem.php b/blockem/blockem.php
index c915cd6c..1880b9be 100644
--- a/blockem/blockem.php
+++ b/blockem/blockem.php
@@ -8,31 +8,19 @@
*/
use Friendica\App;
-use Friendica\Core\Addon;
-use Friendica\Core\L10n;
-use Friendica\Core\PConfig;
+use Friendica\Core\Hook;
+use Friendica\DI;
+use Friendica\Util\Strings;
function blockem_install()
{
- Addon::registerHook('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter');
- Addon::registerHook('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item');
- Addon::registerHook('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings');
- Addon::registerHook('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
- Addon::registerHook('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start');
- Addon::registerHook('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
- Addon::registerHook('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store');
-}
-
-function blockem_uninstall()
-{
- Addon::unregisterHook('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter');
- Addon::unregisterHook('prepare_body' , 'addon/blockem/blockem.php', 'blockem_prepare_body');
- Addon::unregisterHook('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item');
- Addon::unregisterHook('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings');
- Addon::unregisterHook('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
- Addon::unregisterHook('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start');
- Addon::unregisterHook('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
- Addon::unregisterHook('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store');
+ Hook::register('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter');
+ Hook::register('display_item' , 'addon/blockem/blockem.php', 'blockem_display_item');
+ Hook::register('addon_settings' , 'addon/blockem/blockem.php', 'blockem_addon_settings');
+ Hook::register('addon_settings_post' , 'addon/blockem/blockem.php', 'blockem_addon_settings_post');
+ Hook::register('conversation_start' , 'addon/blockem/blockem.php', 'blockem_conversation_start');
+ Hook::register('item_photo_menu' , 'addon/blockem/blockem.php', 'blockem_item_photo_menu');
+ Hook::register('enotify_store' , 'addon/blockem/blockem.php', 'blockem_enotify_store');
}
function blockem_addon_settings (App $a, &$s)
@@ -42,29 +30,29 @@ function blockem_addon_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";
- $words = PConfig::get(local_user(), 'blockem', 'words');
+ $words = DI::pConfig()->get(local_user(), 'blockem', 'words');
if (!$words) {
$words = '';
}
$s .= '';
- $s .= '' . L10n::t('Blockem') . '
';
+ $s .= '' . DI::l10n()->t('Blockem') . '
';
$s .= '';
$s .= '