X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=superblock%2Fsuperblock.php;h=e0b3ff83e9f859803e5e173aca6053c25492d9ee;hb=4e9838f5717f789c650a1109574189e23fdf88da;hp=da4260d0a3926a5d5580ab2e85aee706f197ec3b;hpb=08206fdcc0750ec9dd12a68addb341cd05f8bcfb;p=friendica-addons.git
diff --git a/superblock/superblock.php b/superblock/superblock.php
index da4260d0..e0b3ff83 100644
--- a/superblock/superblock.php
+++ b/superblock/superblock.php
@@ -7,8 +7,7 @@
*
*/
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
-use Friendica\Core\PConfig;
+use Friendica\DI;
use Friendica\Util\Strings;
function superblock_install()
@@ -37,26 +36,26 @@ function superblock_addon_settings(&$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(), 'system', 'blocked');
+ $words = DI::pConfig()->get(local_user(), 'system', 'blocked');
if (!$words) {
$words = '';
}
$s .= '';
- $s .= '' . L10n::t('Superblock') . '
';
+ $s .= '' . DI::l10n()->t('Superblock') . '
';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '' . L10n::t('Superblock') . '
';
+ $s .= '' . DI::l10n()->t('Superblock') . '
';
$s .= '';
$s .= '
';
- $s .= '';
+ $s .= '';
$s .= '';
$s .= '
';
- $s .= '
';
+ $s .= '';
return;
}
@@ -68,14 +67,14 @@ function superblock_addon_settings_post(&$a, &$b)
}
if (!empty($_POST['superblock-submit'])) {
- PConfig::set(local_user(), 'system', 'blocked',trim($_POST['superblock-words']));
- info(L10n::t('SUPERBLOCK Settings saved.') . EOL);
+ DI::pConfig()->set(local_user(), 'system', 'blocked',trim($_POST['superblock-words']));
+ info(DI::l10n()->t('SUPERBLOCK Settings saved.') . EOL);
}
}
function superblock_enotify_store(&$a,&$b) {
- $words = PConfig::get($b['uid'], 'system', 'blocked');
+ $words = DI::pConfig()->get($b['uid'], 'system', 'blocked');
if ($words) {
$arr = explode(',', $words);
} else {
@@ -96,7 +95,8 @@ function superblock_enotify_store(&$a,&$b) {
}
}
if ($found) {
- $b['abort'] = true;
+ // Empty out the fields
+ $b = [];
}
}
@@ -107,11 +107,11 @@ function superblock_conversation_start(&$a, &$b)
return;
}
- $words = PConfig::get(local_user(), 'system', 'blocked');
+ $words = DI::pConfig()->get(local_user(), 'system', 'blocked');
if ($words) {
$a->data['superblock'] = explode(',', $words);
}
- $a->page['htmlhead'] .= <<< EOT
+ DI::page()['htmlhead'] .= <<< EOT