X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=windowsphonepush%2Fwindowsphonepush.php;h=3aaf1d3092e90434cf12eb25cd10bde10da3a8ae;hb=e0bc167742cdde2fec6fd4e110d26134b3222e6c;hp=861bb7afa7a45dbc66f8b6942e303babc5d4b9f6;hpb=c6e5bc3429c9c610895ba826d841cddd8c0f378b;p=friendica-addons.git diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index 861bb7af..3aaf1d30 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -25,8 +25,12 @@ * sets the counter back * count only unseen elements which are not type=activity (likes and dislikes not seen as new elements) */ + use Friendica\App; +use Friendica\Content\Text\BBCode; +use Friendica\Content\Text\HTML; use Friendica\Core\Addon; +use Friendica\Core\L10n; use Friendica\Core\PConfig; use Friendica\Model\User; @@ -86,7 +90,7 @@ function windowsphonepush_settings_post($a, $post) PConfig::set(local_user(), 'windowsphonepush', 'senditemtext', intval($_POST['windowsphonepush-senditemtext'])); - info(t('WindowsPhonePush settings updated.') . EOL); + info(L10n::t('WindowsPhonePush settings updated.') . EOL); } /* Called from the Addon Setting form. @@ -112,20 +116,20 @@ function windowsphonepush_settings(&$a, &$s) /* Add some HTML to the existing form */ $s .= '
'; - $s .= '

' . t('WindowsPhonePush Settings') . '

'; + $s .= '

' . L10n::t('WindowsPhonePush Settings') . '

'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; $s .= '
'; - $s .= ''; + $s .= ''; $s .= ''; $s .= '
'; /* provide a submit button - enable und senditemtext can be changed by the user */ - $s .= '
'; + $s .= '
'; /* provide further read-only information concerning the addon (useful for */ $s .= '
'; @@ -208,10 +212,8 @@ function windowsphonepush_cron() if (substr($body, 0, 4) == "[url") { $body = "URL/Image ..."; } else { - require_once('include/bbcode.php'); - require_once("include/html2plain.php"); - $body = bbcode($body, false, false, 2, true); - $body = html2plain($body, 0); + $body = BBCode::convert($body, false, 2, true); + $body = HTML::toPlaintext($body, 0); $body = ((strlen($body) > 137) ? substr($body, 0, 137) . "..." : $body); } } else { @@ -470,5 +472,5 @@ function windowsphonepush_login(App $a) require_once 'include/security.php'; authenticate_success($record); $_SESSION["allow_api"] = true; - call_hooks('logged_in', $a->user); + Addon::callHooks('logged_in', $a->user); }