]> git.mxchange.org Git - friendica-addons.git/blobdiff - gnot/gnot.php
IT translation update blackout addon THX Sylke Vicious
[friendica-addons.git] / gnot / gnot.php
index 128b37dd7b3695d9b94562ff9b8fd0680c6a3447..ca32d6d5e6134ef932ee2d713e13a1d2b4ca1b4d 100644 (file)
@@ -7,11 +7,12 @@
  * 
  *
  */
+
 use Friendica\Core\Hook;
-use Friendica\Core\L10n;
 use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\DI;
+use Friendica\Model\Notification;
 
 function gnot_install() {
 
@@ -22,19 +23,6 @@ function gnot_install() {
        Logger::log("installed gnot");
 }
 
-
-function gnot_uninstall() {
-
-       Hook::unregister('addon_settings', 'addon/gnot/gnot.php', 'gnot_settings');
-       Hook::unregister('addon_settings_post', 'addon/gnot/gnot.php', 'gnot_settings_post');
-       Hook::unregister('enotify_mail', 'addon/gnot/gnot.php', 'gnot_enotify_mail');
-
-
-       Logger::log("removed gnot");
-}
-
-
-
 /**
  *
  * Callback from the settings post function.
@@ -49,7 +37,6 @@ function gnot_settings_post($a,$post) {
                return;
 
        DI::pConfig()->set(local_user(),'gnot','enable',intval($_POST['gnot']));
-       info(L10n::t('Gnot settings updated.') . EOL);
 }
 
 
@@ -81,11 +68,11 @@ function gnot_settings(&$a,&$s) {
        /* Add some HTML to the existing form */
 
        $s .= Renderer::replaceMacros($t, [
-               '$title' => L10n::t('Gnot Settings') ,
-               '$submit' => L10n::t('Save Settings'),
-               '$enable' => L10n::t('Enable this addon?'),
+               '$title' => DI::l10n()->t('Gnot Settings') ,
+               '$submit' => DI::l10n()->t('Save Settings'),
+               '$enable' => DI::l10n()->t('Enable this addon?'),
                '$enabled' => $gnot_checked,
-               '$text' => L10n::t("Allows threading of email comment notifications on Gmail and anonymising the subject line.") 
+               '$text' => DI::l10n()->t("Allows threading of email comment notifications on Gmail and anonymising the subject line.")
        ]);
 }
 
@@ -93,6 +80,6 @@ function gnot_settings(&$a,&$s) {
 function gnot_enotify_mail(&$a,&$b) {
        if((! $b['uid']) || (! intval(DI::pConfig()->get($b['uid'], 'gnot','enable'))))
                return;
-       if($b['type'] == NOTIFY_COMMENT)
-               $b['subject'] = L10n::t('[Friendica:Notify] Comment to conversation #%d', $b['parent']);
+       if($b['type'] == Notification\Type::COMMENT)
+               $b['subject'] = DI::l10n()->t('[Friendica:Notify] Comment to conversation #%d', $b['parent']);
 }