use Friendica\Core\Search;
use Friendica\Database\DBA;
use Friendica\DI;
+use Friendica\Model\Notify\Type;
use Friendica\Model\User;
use Friendica\Util\ConfigFileLoader;
use Friendica\Util\DateTimeFormat;
}
-
-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'));
foreach($r as $rr) {
notification([
'uid' => $rr['uid'],
- 'type' => NOTIFY_SYSTEM,
+ 'type' => Type::SYSTEM,
'system_type' => 'testdrive_expire',
'language' => $rr['language'],
'to_name' => $rr['username'],
}
function testdrive_enotify(&$a, &$b) {
- if (!empty($b['params']) && $b['params']['type'] == NOTIFY_SYSTEM
+ if (!empty($b['params']) && $b['params']['type'] == 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'));