X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=nsfw%2Fnsfw.php;h=9f81b29d8333557f669a26dc735a9a23c711616b;hb=af10b60e97b94ba5e8bf60195038c51433966e08;hp=ba59f007caacaa3d28deba7ff51ed552956f9c6a;hpb=d3717045f7024396a46dd2cb1a472b482f6d6d63;p=friendica-addons.git
diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php
index ba59f007..9f81b29d 100644
--- a/nsfw/nsfw.php
+++ b/nsfw/nsfw.php
@@ -8,8 +8,6 @@
*
*/
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
-use Friendica\Core\PConfig;
use Friendica\DI;
function nsfw_install()
@@ -19,14 +17,6 @@ function nsfw_install()
Hook::register('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
}
-function nsfw_uninstall()
-{
- Hook::unregister('prepare_body_content_filter', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body_content_filter');
- Hook::unregister('prepare_body', 'addon/nsfw/nsfw.php', 'nsfw_prepare_body');
- Hook::unregister('addon_settings', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings');
- Hook::unregister('addon_settings_post', 'addon/nsfw/nsfw.php', 'nsfw_addon_settings_post');
-}
-
// This function isn't perfect and isn't trying to preserve the html structure - it's just a
// quick and dirty filter to pull out embedded photo blobs because 'nsfw' seems to come up
// inside them quite often. We don't need anything fancy, just pull out the data blob so we can
@@ -68,31 +58,31 @@ function nsfw_addon_settings(&$a, &$s)
DI::page()['htmlhead'] .= '' . "\r\n";
- $enable_checked = (intval(PConfig::get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" ');
- $words = PConfig::get(local_user(), 'nsfw', 'words');
+ $enable_checked = (intval(DI::pConfig()->get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" ');
+ $words = DI::pConfig()->get(local_user(), 'nsfw', 'words');
if (!$words) {
$words = 'nsfw,';
}
$s .= '';
- $s .= '
' . L10n::t('Content Filter (NSFW and more)') . '
';
+ $s .= '
' . DI::l10n()->t('Content Filter (NSFW and more)') . '
';
$s .= '';
$s .= '
';
$s .= '';
- $s .= '
' . L10n::t('Content Filter (NSFW and more)') . '
';
+ $s .= '
' . DI::l10n()->t('Content Filter (NSFW and more)') . '
';
$s .= '';
$s .= '
';
- $s .= '
' . L10n::t('This addon searches for specified words/text in posts and collapses them. It can be used to filter content tagged with for instance #NSFW that may be deemed inappropriate at certain times or places, such as being at work. It is also useful for hiding irrelevant or annoying content from direct view.') . '
';
- $s .= '';
+ $s .= '
' . DI::l10n()->t('This addon searches for specified words/text in posts and collapses them. It can be used to filter content tagged with for instance #NSFW that may be deemed inappropriate at certain times or places, such as being at work. It is also useful for hiding irrelevant or annoying content from direct view.') . '