]> git.mxchange.org Git - friendica-addons.git/commitdiff
Remove "notice" with new function
authorMichael <heluecht@pirati.ca>
Mon, 17 Oct 2022 20:17:25 +0000 (20:17 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 17 Oct 2022 20:17:25 +0000 (20:17 +0000)
birdavatar/birdavatar.php
catavatar/catavatar.php
curweather/curweather.php
forumdirectory/forumdirectory.php
notifyall/notifyall.php
pumpio/pumpio.php
securemail/securemail.php
statusnet/statusnet.php
tumblr/tumblr.php
twitter/twitter.php

index 7975311022f58c96d5484eb5b723cbe05e50a3cb..2fe1fa37fc80ad5d648eca4afe46cb9e03527227 100644 (file)
@@ -73,7 +73,7 @@ function birdavatar_addon_settings_post(App $a, &$s)
 
                $self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]);
                if (!DBA::isResult($self)) {
-                       notice(DI::l10n()->t("The bird has not found itself."));
+                       DI::sysmsg()->addNotice(DI::l10n()->t("The bird has not found itself."));
                        return;
                }
 
@@ -82,7 +82,7 @@ function birdavatar_addon_settings_post(App $a, &$s)
                $condition = ['uid' => local_user(), 'contact-id' => $self['id']];
                $photo     = DBA::selectFirst('photo', ['resource-id'], $condition);
                if (!DBA::isResult($photo)) {
-                       notice(DI::l10n()->t('There was an error, the bird flew away.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('There was an error, the bird flew away.'));
                        return;
                }
 
@@ -98,7 +98,7 @@ function birdavatar_addon_settings_post(App $a, &$s)
                // Update global directory in background
                Profile::publishUpdate(local_user());
 
-               info(DI::l10n()->t('Meow!'));
+               DI::sysmsg()->addInfo(DI::l10n()->t('Meow!'));
                return;
        }
 
index ce1fc78bc538b53d457bac4856c2f2e0698a931c..7a2bdc2eaf9623e5b15db868972f323a809dff45 100644 (file)
@@ -74,7 +74,7 @@ function catavatar_addon_settings_post(App $a, &$s)
 
                $self = DBA::selectFirst('contact', ['id'], ['uid' => local_user(), 'self' => true]);
                if (!DBA::isResult($self)) {
-                       notice(DI::l10n()->t("The cat hadn't found itself."));
+                       DI::sysmsg()->addNotice(DI::l10n()->t("The cat hadn't found itself."));
                        return;
                }
 
@@ -83,7 +83,7 @@ function catavatar_addon_settings_post(App $a, &$s)
                $condition = ['uid' => local_user(), 'contact-id' => $self['id']];
                $photo = DBA::selectFirst('photo', ['resource-id'], $condition);
                if (!DBA::isResult($photo)) {
-                       notice(DI::l10n()->t('There was an error, the cat ran away.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('There was an error, the cat ran away.'));
                        return;
                }
 
@@ -99,7 +99,7 @@ function catavatar_addon_settings_post(App $a, &$s)
                // Update global directory in background
                Profile::publishUpdate(local_user());
 
-               info(DI::l10n()->t('Meow!'));
+               DI::sysmsg()->addInfo(DI::l10n()->t('Meow!'));
                return;
        }
 
index dc634b59c83a9f99b4b41fd7e466843c8cd8750e..27d6f94013945d26ab6927f207bdb02b5404cbfa 100644 (file)
@@ -44,7 +44,7 @@ function getWeather($loc, $units = 'metric', $lang = 'en', $appid = '', $cacheti
                $res = new SimpleXMLElement(DI::httpClient()->fetch($url));
        } catch (Exception $e) {
                if (empty($_SESSION['curweather_notice_shown'])) {
-                       notice(DI::l10n()->t('Error fetching weather data. Error was: ' . $e->getMessage()));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Error fetching weather data. Error was: ' . $e->getMessage()));
                        $_SESSION['curweather_notice_shown'] = true;
                }
 
index 42cc4c54be068886a9abb6842eefacf191997c17..b04d3a468ae40481cc69db895e547c4deedaebc1 100644 (file)
@@ -63,7 +63,7 @@ function forumdirectory_content(App $a)
        global $forumdirectory_search;
 
        if ((DI::config()->get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
-               notice(DI::l10n()->t('Public access denied.') . EOL);
+               DI::sysmsg()->addNotice(DI::l10n()->t('Public access denied.') . EOL);
                return;
        }
 
@@ -135,7 +135,7 @@ function forumdirectory_content(App $a)
                }
                DBA::close($r);
        } else {
-               notice(DI::l10n()->t("No entries \x28some entries may be hidden\x29."));
+               DI::sysmsg()->addNotice(DI::l10n()->t("No entries \x28some entries may be hidden\x29."));
        }
 
        $tpl = Renderer::getMarkupTemplate('directory_header.tpl');
index ef8e6470fa1e6d2e7512f66ffbe08950040764f6..52d75e10c0e5b0d6c5b8850440ca3441d46791c7 100644 (file)
@@ -51,7 +51,7 @@ function notifyall_post(App $a)
        $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.') . EOL);
                return;
        }
 
@@ -61,7 +61,7 @@ function notifyall_post(App $a)
                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');
 }
 
index a88b0d3251407fa354d57f4041cc48878b5e1294..4fbc3de54e99f2a358cd45f473b16e6be587fe5a 100644 (file)
@@ -60,7 +60,7 @@ function pumpio_module() {}
 function pumpio_content(App $a)
 {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.') . EOL);
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.') . EOL);
                return '';
        }
 
index 62673eb190ed936346c1ddb500e393e8fcf84ccf..a8a04df15b12d984851abedb5a92610d3094afab 100644 (file)
@@ -90,9 +90,9 @@ function securemail_settings_post(App &$a, array &$b)
                        DI::pConfig()->set(local_user(), 'securemail', 'enable', $enable);
 
                        if ($res) {
-                               info(DI::l10n()->t('Test email sent') . EOL);
+                               DI::sysmsg()->addInfo(DI::l10n()->t('Test email sent') . EOL);
                        } else {
-                               notice(DI::l10n()->t('There was an error sending the test email') . EOL);
+                               DI::sysmsg()->addNotice(DI::l10n()->t('There was an error sending the test email') . EOL);
                        }
                }
        }
index 4f5abfc8183c677d81e1e6cc3a2de0f1c439943b..4cf3f77a730eaafd35eac48255a91da5d2eb2689 100644 (file)
@@ -146,7 +146,7 @@ function statusnet_settings_post(App $a, $post)
                                                DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $asn['apiurl']);
                                                //DI::pConfig()->set(local_user(), 'statusnet', 'application_name', $asn['applicationname'] );
                                        } else {
-                                               notice(DI::l10n()->t('Please contact your site administrator.<br />The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL);
+                                               DI::sysmsg()->addNotice(DI::l10n()->t('Please contact your site administrator.<br />The provided API URL is not valid.') . EOL . $asn['apiurl'] . EOL);
                                        }
                                }
                        }
@@ -174,7 +174,7 @@ function statusnet_settings_post(App $a, $post)
                                                DI::pConfig()->set(local_user(), 'statusnet', 'baseapi', $apibase);
                                        } else {
                                                //  still not the correct API base, let's do noting
-                                               notice(DI::l10n()->t('We could not contact the GNU Social API with the Path you entered.') . EOL);
+                                               DI::sysmsg()->addNotice(DI::l10n()->t('We could not contact the GNU Social API with the Path you entered.') . EOL);
                                        }
                                }
                        } else {
index de9805983cf78010919a547cbcf11317933269bc..33cc581f7e86ab8ec033f3342461e9e28df0a847 100644 (file)
@@ -39,7 +39,7 @@ function tumblr_module() {}
 function tumblr_content(App $a)
 {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.') . EOL);
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.') . EOL);
                return '';
        }
 
index a4acb3f1660800ccf147614eabba31c81f11c877..d2847a1843cb7c2c578ea580ea42339b191705de 100644 (file)
@@ -269,9 +269,9 @@ function twitter_settings_post(App $a)
                                DI::pConfig()->set(local_user(), 'twitter', 'oauthsecret', $token['oauth_token_secret']);
                                DI::pConfig()->set(local_user(), 'twitter', 'post', 1);
                        } catch(Exception $e) {
-                               notice($e->getMessage());
+                               DI::sysmsg()->addNotice($e->getMessage());
                        } catch(TwitterOAuthException $e) {
-                               notice($e->getMessage());
+                               DI::sysmsg()->addNotice($e->getMessage());
                        }
                } else {
                        //  if no PIN is supplied in the POST variables, the user has changed the setting
@@ -551,14 +551,14 @@ function twitter_item_by_link(App $a, array &$hookData)
                empty(DI::pConfig()->get($hookData['uid'], 'twitter', 'oauthtoken'))
                || empty(DI::pConfig()->get($hookData['uid'], 'twitter', 'oauthsecret'))
        ) {
-               notice(DI::l10n()->t('Please connect a Twitter account in your Social Network settings to import Twitter posts.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Please connect a Twitter account in your Social Network settings to import Twitter posts.'));
                return;
        }
 
        $status = twitter_statuses_show($matches[1]);
 
        if (empty($status->id_str)) {
-               notice(DI::l10n()->t('Twitter post not found.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Twitter post not found.'));
                return;
        }