X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=showmore%2Fshowmore.php;h=bfde40f3c473c45e8a287504210d511f6976ff03;hb=30eb87e939f0a94df3caaa89f5404169a01c99d2;hp=dcc9e2f91e84d8c70a68666362e65f3f56a65de2;hpb=8504f2e9997e83c19d76a01a4fdbafd480b0926d;p=friendica-addons.git
diff --git a/showmore/showmore.php b/showmore/showmore.php
index dcc9e2f9..bfde40f3 100644
--- a/showmore/showmore.php
+++ b/showmore/showmore.php
@@ -8,8 +8,6 @@
*
*/
use Friendica\Core\Hook;
-use Friendica\Core\L10n;
-use Friendica\Core\PConfig;
use Friendica\DI;
use Friendica\Util\Strings;
@@ -37,28 +35,28 @@ function showmore_addon_settings(&$a, &$s)
DI::page()['htmlhead'] .= ''."\r\n";
- $enable_checked = (intval(PConfig::get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"');
- $chars = PConfig::get(local_user(), 'showmore', 'chars', 1100);
+ $enable_checked = (intval(DI::pConfig()->get(local_user(), 'showmore', 'disable')) ? '' : ' checked="checked"');
+ $chars = DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100);
$s .= '';
- $s .= '' . L10n::t('"Show more" Settings').'
';
+ $s .= '' . DI::l10n()->t('"Show more" Settings').'
';
$s .= '';
$s .= '
';
$s .= '
';
- $s .= '' . L10n::t('"Show more" Settings').'
';
+ $s .= '' . DI::l10n()->t('"Show more" Settings').'
';
$s .= '';
$s .= '
';
- $s .= '
';
+ $s .= '
';
$s .= '
';
$s .= '
';
- $s .= '
';
+ $s .= '
';
$s .= '
';
$s .= '
';
- $s .= '
';
-// $s .= '
' . L10n::t('Use /expression/ to provide regular expressions') . '
';
+ $s .= '
';
+// $s .= '
' . DI::l10n()->t('Use /expression/ to provide regular expressions') . '
';
$s .= '
';
return;
@@ -71,11 +69,11 @@ function showmore_addon_settings_post(&$a, &$b)
}
if (!empty($_POST['showmore-submit'])) {
- PConfig::set(local_user(), 'showmore', 'chars', trim($_POST['showmore-chars']));
+ DI::pConfig()->set(local_user(), 'showmore', 'chars', trim($_POST['showmore-chars']));
$enable = (!empty($_POST['showmore-enable']) ? intval($_POST['showmore-enable']) : 0);
$disable = 1-$enable;
- PConfig::set(local_user(), 'showmore', 'disable', $disable);
- info(L10n::t('Show More Settings saved.') . EOL);
+ DI::pConfig()->set(local_user(), 'showmore', 'disable', $disable);
+ info(DI::l10n()->t('Show More Settings saved.') . EOL);
}
}
@@ -119,11 +117,11 @@ function showmore_prepare_body(\Friendica\App $a, &$hook_data)
return;
}
- if (PConfig::get(local_user(), 'showmore', 'disable')) {
+ if (DI::pConfig()->get(local_user(), 'showmore', 'disable')) {
return;
}
- $chars = (int) PConfig::get(local_user(), 'showmore', 'chars', 1100);
+ $chars = (int) DI::pConfig()->get(local_user(), 'showmore', 'chars', 1100);
if (get_body_length($hook_data['html']) > $chars) {
$found = true;
@@ -135,7 +133,7 @@ function showmore_prepare_body(\Friendica\App $a, &$hook_data)
if ($found) {
$rnd = Strings::getRandomHex(8);
$hook_data['html'] = '' . $shortened . " " .
- '' . L10n::t('show more') . '' .
+ '' . DI::l10n()->t('show more') . '' .
'' . $hook_data['html'] . '
';
}
}