use Friendica\Core\Renderer;
use Friendica\DI;
-function notifyall_install()
-{
- Logger::log("installed notifyall");
-}
-
-function notifyall_uninstall()
-{
- Logger::log("removed notifyall");
-}
-
+/**
+ * This is a statement rather than an actual function definition. The simple
+ * existence of this method is checked to figure out if the addon offers a
+ * module.
+ */
function notifyall_module() {}
-function notifyall_addon_admin(App $a, &$o)
+function notifyall_addon_admin(App $a, string &$o)
{
$o = '<div></div> <a href="' . DI::baseUrl()->get() . '/notifyall">' . DI::l10n()->t('Send email to all members') . '</a></br/>';
}
function notifyall_post(App $a)
{
- if(!is_site_admin()) {
+ if (!$a->isSiteAdmin()) {
return;
}
$recipients = DBA::p("SELECT DISTINCT `email` FROM `user` WHERE `verified` AND NOT `account_removed` AND NOT `account_expired` $sql_extra");
if (! $recipients) {
- notice(DI::l10n()->t('No recipients found.') . EOL);
+ DI::sysmsg()->addNotice(DI::l10n()->t('No recipients found.'));
return;
}
DI::emailer()->send($notifyEmail->withRecipient($recipient['email']));
}
- info(DI::l10n()->t('Emails sent'));
+ DI::sysmsg()->addInfo(DI::l10n()->t('Emails sent'));
DI::baseUrl()->redirect('admin');
}
-function notifyall_content(&$a)
+function notifyall_content(App $a)
{
- if (! is_site_admin()) {
+ if (!$a->isSiteAdmin()) {
return '';
}