]> git.mxchange.org Git - friendica-addons.git/blobdiff - testdrive/testdrive.php
jappixmini addon IT translation update THX Sylke Vicious
[friendica-addons.git] / testdrive / testdrive.php
index 1732c6a9883dff6509faf6c4dd757b7392c35a73..7c3af59e0253e21c5442d605dc5895669db64823 100644 (file)
@@ -11,6 +11,7 @@ use Friendica\Core\Hook;
 use Friendica\Core\Search;
 use Friendica\Database\DBA;
 use Friendica\DI;
+use Friendica\Model\Notification;
 use Friendica\Model\User;
 use Friendica\Util\ConfigFileLoader;
 use Friendica\Util\DateTimeFormat;
@@ -25,17 +26,6 @@ function testdrive_install() {
 
 }
 
-
-function testdrive_uninstall() {
-
-       Hook::unregister('load_config',      'addon/testdrive/testdrive.php', 'testdrive_load_config');
-       Hook::unregister('register_account', 'addon/testdrive/testdrive.php', 'testdrive_register_account');
-       Hook::unregister('cron', 'addon/testdrive/testdrive.php', 'testdrive_cron');
-       Hook::unregister('enotify','addon/testdrive/testdrive.php', 'testdrive_enotify');
-       Hook::unregister('globaldir_update','addon/testdrive/testdrive.php', 'testdrive_globaldir_update');
-
-}
-
 function testdrive_load_config(App $a, ConfigFileLoader $loader)
 {
        $a->getConfigCache()->load($loader->loadAddonConfig('testdrive'));
@@ -68,12 +58,9 @@ function testdrive_cron($a,$b) {
        if(count($r)) {
                foreach($r as $rr) {
                        notification([
+                               'type' => Notification\Type::SYSTEM,
                                'uid' => $rr['uid'],
-                               'type' => NOTIFY_SYSTEM,
                                'system_type' => 'testdrive_expire',
-                               'language'     => $rr['language'],
-                               'to_name'      => $rr['username'],
-                               'to_email'     => $rr['email'],
                                'source_name'  => DI::l10n()->t('Administrator'),
                                'source_link'  => DI::baseUrl()->get(),
                                'source_photo' => DI::baseUrl()->get() . '/images/person-80.jpg',
@@ -96,7 +83,7 @@ function testdrive_cron($a,$b) {
 }
 
 function testdrive_enotify(&$a, &$b) {
-    if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM
+    if (!empty($b['params']) && $b['params']['type'] == Notification\Type::SYSTEM
                && !empty($b['params']['system_type']) && $b['params']['system_type'] === 'testdrive_expire') {
         $b['itemlink'] = DI::baseUrl()->get();
         $b['epreamble'] = $b['preamble'] = DI::l10n()->t('Your account on %s will expire in a few days.', DI::config()->get('system', 'sitename'));