]> git.mxchange.org Git - friendica.git/commitdiff
Replace "notice" calls
authorMichael <heluecht@pirati.ca>
Mon, 17 Oct 2022 11:27:32 +0000 (11:27 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 17 Oct 2022 11:27:32 +0000 (11:27 +0000)
mod/cal.php
mod/editpost.php
mod/events.php
mod/follow.php
mod/item.php
mod/lostpass.php
mod/match.php
mod/message.php
mod/notes.php
src/Module/Delegation.php

index 3f249da0aca21c457146fd4243eebc669ea06430..ec6df1f165e89630f9a8d9322dd143a6a3e98d33 100644 (file)
@@ -119,7 +119,7 @@ function cal_content(App $a)
        $is_owner = local_user() == $owner['uid'];
 
        if ($owner['hidewall'] && !$is_owner && !$remote_contact) {
-               notice(DI::l10n()->t('Access to this profile has been restricted.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Access to this profile has been restricted.'));
                return;
        }
 
@@ -262,7 +262,7 @@ function cal_content(App $a)
 
        if ($mode == 'export') {
                if (!$owner_uid) {
-                       notice(DI::l10n()->t('User not found'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('User not found'));
                        return;
                }
 
@@ -271,9 +271,9 @@ function cal_content(App $a)
 
                if (!$evexport["success"]) {
                        if ($evexport["content"]) {
-                               notice(DI::l10n()->t('This calendar format is not supported'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('This calendar format is not supported'));
                        } else {
-                               notice(DI::l10n()->t('No exportable data found'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('No exportable data found'));
                        }
 
                        // If it the own calendar return to the events page
index 3fb8c80ec0510bff5c09260ea8115c684f4ff7f1..8d2160fde059af098008429707ee8c75c6f15dd3 100644 (file)
@@ -35,14 +35,14 @@ function editpost_content(App $a)
        $o = '';
 
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return;
        }
 
        $post_id = ((DI::args()->getArgc() > 1) ? intval(DI::args()->getArgv()[1]) : 0);
 
        if (!$post_id) {
-               notice(DI::l10n()->t('Item not found'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
                return;
        }
 
@@ -52,7 +52,7 @@ function editpost_content(App $a)
        $item = Post::selectFirstForUser(local_user(), $fields, ['id' => $post_id, 'uid' => local_user()]);
 
        if (!DBA::isResult($item)) {
-               notice(DI::l10n()->t('Item not found'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Item not found'));
                return;
        }
 
index eead66c01022dba9a20ec70b2de6d2e8c732a2b3..f1d8a7ca60455f11adab3c6c8b917c80fb73dcf6 100644 (file)
@@ -121,7 +121,7 @@ function events_post(App $a)
        $onerror_path = 'events/' . $action . '?' . http_build_query($params, '', '&', PHP_QUERY_RFC3986);
 
        if (strcmp($finish, $start) < 0 && !$nofinish) {
-               notice(DI::l10n()->t('Event can not end before it has started.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Event can not end before it has started.'));
                if (intval($_REQUEST['preview'])) {
                        System::httpExit(DI::l10n()->t('Event can not end before it has started.'));
                }
@@ -129,7 +129,7 @@ function events_post(App $a)
        }
 
        if (!$summary || ($start === DBA::NULL_DATETIME)) {
-               notice(DI::l10n()->t('Event title and start time are required.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Event title and start time are required.'));
                if (intval($_REQUEST['preview'])) {
                        System::httpExit(DI::l10n()->t('Event title and start time are required.'));
                }
@@ -214,7 +214,7 @@ function events_post(App $a)
 function events_content(App $a)
 {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return Login::form();
        }
 
@@ -531,7 +531,7 @@ function events_content(App $a)
                }
 
                if (Post::exists(['id' => $ev[0]['itemid']])) {
-                       notice(DI::l10n()->t('Failed to remove event'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Failed to remove event'));
                }
 
                DI::baseUrl()->redirect('events');
index 818a1ae5e95c7dd6ac0291655a2d50799ef5d526..b6ffe2ef0a9c45d48571250996919212b6b89d19 100644 (file)
@@ -53,7 +53,7 @@ function follow_content(App $a)
        $return_path = 'contact';
 
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
@@ -81,7 +81,7 @@ function follow_content(App $a)
 
        if (DBA::isResult($user_contact)) {
                if ($user_contact['pending']) {
-                       notice(DI::l10n()->t('You already added this contact.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('You already added this contact.'));
                        $submit = '';
                }
        }
@@ -97,7 +97,7 @@ function follow_content(App $a)
                // Possibly it is a remote item and not an account
                follow_remote_item($url);
 
-               notice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added."));
+               DI::sysmsg()->addNotice(DI::l10n()->t("The network type couldn't be detected. Contact can't be added."));
                $submit = '';
                $contact = ['url' => $url, 'network' => Protocol::PHANTOM, 'name' => $url, 'keywords' => ''];
        }
@@ -105,12 +105,12 @@ function follow_content(App $a)
        $protocol = Contact::getProtocol($contact['url'], $contact['network']);
 
        if (($protocol == Protocol::DIASPORA) && !DI::config()->get('system', 'diaspora_enabled')) {
-               notice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
+               DI::sysmsg()->addNotice(DI::l10n()->t("Diaspora support isn't enabled. Contact can't be added."));
                $submit = '';
        }
 
        if (($protocol == Protocol::OSTATUS) && DI::config()->get('system', 'ostatus_disabled')) {
-               notice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
+               DI::sysmsg()->addNotice(DI::l10n()->t("OStatus support is disabled. Contact can't be added."));
                $submit = '';
        }
 
@@ -127,7 +127,7 @@ function follow_content(App $a)
 
        $owner = User::getOwnerDataById($uid);
        if (empty($owner)) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect($return_path);
                // NOTREACHED
        }
@@ -181,14 +181,14 @@ function follow_process(App $a, string $url)
                follow_remote_item($url);
 
                if ($result['message']) {
-                       notice($result['message']);
+                       DI::sysmsg()->addNotice($result['message']);
                }
                DI::baseUrl()->redirect($return_path);
        } elseif ($result['cid']) {
                DI::baseUrl()->redirect('contact/' . $result['cid']);
        }
 
-       notice(DI::l10n()->t('The contact could not be added.'));
+       DI::sysmsg()->addNotice(DI::l10n()->t('The contact could not be added.'));
 
        DI::baseUrl()->redirect($return_path);
 }
index 8f4494ca72f6dd7908bdb3bf740e27eaf585a564..cc8e9538583ff3c53fd19f1785f58eba47f2775e 100644 (file)
@@ -129,7 +129,7 @@ function item_post(App $a) {
                }
 
                if (!DBA::isResult($toplevel_item)) {
-                       notice(DI::l10n()->t('Unable to locate original post.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate original post.'));
                        if ($return_path) {
                                DI::baseUrl()->redirect($return_path);
                        }
@@ -179,7 +179,7 @@ function item_post(App $a) {
        // Now check that valid personal details have been provided
        if (!Security::canWriteToUserWall($profile_uid) && !$allow_comment) {
                Logger::warning('Permission denied.', ['local' => local_user(), 'profile_uid' => $profile_uid, 'toplevel_item_id' => $toplevel_item_id, 'network' => $toplevel_item['network']]);
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                if ($return_path) {
                        DI::baseUrl()->redirect($return_path);
                }
@@ -335,7 +335,7 @@ function item_post(App $a) {
                                System::jsonExit(['preview' => '']);
                        }
 
-                       notice(DI::l10n()->t('Empty post discarded.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Empty post discarded.'));
                        if ($return_path) {
                                DI::baseUrl()->redirect($return_path);
                        }
@@ -685,7 +685,7 @@ function item_post(App $a) {
        $post_id = Item::insert($datarray);
 
        if (!$post_id) {
-               notice(DI::l10n()->t('Item wasn\'t stored.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Item wasn\'t stored.'));
                if ($return_path) {
                        DI::baseUrl()->redirect($return_path);
                }
@@ -841,7 +841,7 @@ function drop_item(int $id, string $return = '')
        $item = Post::selectFirstForUser(local_user(), $fields, ['id' => $id]);
 
        if (!DBA::isResult($item)) {
-               notice(DI::l10n()->t('Item not found.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Item not found.'));
                DI::baseUrl()->redirect('network');
        }
 
@@ -863,7 +863,7 @@ function drop_item(int $id, string $return = '')
                item_redirect_after_action($item, $return);
        } else {
                Logger::warning('Permission denied.', ['local' => local_user(), 'uid' => $item['uid'], 'cid' => $contact_id]);
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                DI::baseUrl()->redirect('display/' . $item['guid']);
                //NOTREACHED
        }
index 6aa76e0cc6c4ee45d9d0bfd3a06e52055283f1e3..150c170d7a47b53bae77ca428e7a523bde016db6 100644 (file)
@@ -37,7 +37,7 @@ function lostpass_post(App $a)
        $condition = ['(`email` = ? OR `nickname` = ?) AND `verified` = 1 AND `blocked` = 0', $loginame, $loginame];
        $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'language'], $condition);
        if (!DBA::isResult($user)) {
-               notice(DI::l10n()->t('No valid account found.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('No valid account found.'));
                DI::baseUrl()->redirect();
        }
 
@@ -97,7 +97,7 @@ function lostpass_content(App $a)
 
                $user = DBA::selectFirst('user', ['uid', 'username', 'nickname', 'email', 'pwdreset_time', 'language'], ['pwdreset' => hash('sha256', $pwdreset_token)]);
                if (!DBA::isResult($user)) {
-                       notice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
+                       DI::sysmsg()->addNotice(DI::l10n()->t("Request could not be verified. \x28You may have previously submitted it.\x29 Password reset failed."));
 
                        return lostpass_form();
                }
@@ -110,7 +110,7 @@ function lostpass_content(App $a)
                        ];
                        DBA::update('user', $fields, ['uid' => $user['uid']]);
 
-                       notice(DI::l10n()->t('Request has expired, please make a new one.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Request has expired, please make a new one.'));
 
                        return lostpass_form();
                }
index 02ee0c3339241bc2a5a490a5238cf3d8695da6ab..5a5d3be93d9941e67ce7ae6d8eb32eee8ad62d23 100644 (file)
@@ -59,7 +59,7 @@ function match_content(App $a)
                return '';
        }
        if (!$profile['pub_keywords'] && (!$profile['prv_keywords'])) {
-               notice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('No keywords to match. Please add keywords to your profile.'));
                return '';
        }
 
index a07c8b44931284ca72757ebef8df8e0ccc2b3a70..d1231b7c5dcb0425a91feb61f0511c6be30674e5 100644 (file)
@@ -66,7 +66,7 @@ function message_init(App $a)
 function message_post(App $a)
 {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return;
        }
 
@@ -80,17 +80,17 @@ function message_post(App $a)
 
        switch ($ret) {
                case -1:
-                       notice(DI::l10n()->t('No recipient selected.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('No recipient selected.'));
                        $norecip = true;
                        break;
                case -2:
-                       notice(DI::l10n()->t('Unable to locate contact information.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Unable to locate contact information.'));
                        break;
                case -3:
-                       notice(DI::l10n()->t('Message could not be sent.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Message could not be sent.'));
                        break;
                case -4:
-                       notice(DI::l10n()->t('Message collection failure.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Message collection failure.'));
                        break;
        }
 
@@ -108,7 +108,7 @@ function message_content(App $a)
        Nav::setSelected('messages');
 
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return Login::form();
        }
 
@@ -143,12 +143,12 @@ function message_content(App $a)
                if ($cmd === 'drop') {
                        $message = DBA::selectFirst('mail', ['convid'], ['id' => DI::args()->getArgv()[2], 'uid' => local_user()]);
                        if(!DBA::isResult($message)){
-                               notice(DI::l10n()->t('Conversation not found.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Conversation not found.'));
                                DI::baseUrl()->redirect('message');
                        }
 
                        if (!DBA::delete('mail', ['id' => DI::args()->getArgv()[2], 'uid' => local_user()])) {
-                               notice(DI::l10n()->t('Message was not deleted.'));
+                               DI::sysmsg()->addNotice(DI::l10n()->t('Message was not deleted.'));
                        }
 
                        $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
@@ -163,7 +163,7 @@ function message_content(App $a)
                                $parent = $parentmail['parent-uri'];
 
                                if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
-                                       notice(DI::l10n()->t('Conversation was not removed.'));
+                                       DI::sysmsg()->addNotice(DI::l10n()->t('Conversation was not removed.'));
                                }
                        }
                        DI::baseUrl()->redirect('message');
@@ -219,7 +219,7 @@ function message_content(App $a)
                $r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
 
                if (!DBA::isResult($r)) {
-                       notice(DI::l10n()->t('No messages.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('No messages.'));
                        return $o;
                }
 
@@ -275,7 +275,7 @@ function message_content(App $a)
                }
 
                if (!DBA::isResult($messages)) {
-                       notice(DI::l10n()->t('Message not available.'));
+                       DI::sysmsg()->addNotice(DI::l10n()->t('Message not available.'));
                        return $o;
                }
 
index b5bdbf870f8c2031031620c57a792c9eedb354ec..a30d807693b7c2ad497adb27ae4e2f753c35099b 100644 (file)
@@ -41,7 +41,7 @@ function notes_init(App $a)
 function notes_content(App $a, $update = false)
 {
        if (!local_user()) {
-               notice(DI::l10n()->t('Permission denied.'));
+               DI::sysmsg()->addNotice(DI::l10n()->t('Permission denied.'));
                return;
        }
 
index c14573c8b330c9a76e55384ac6e31d6e44938aa1..146e9382b8bb5beb24b151e9de4a979d6c9ecf9a 100644 (file)
@@ -108,7 +108,7 @@ class Delegation extends BaseModule
                $ret = [];
                Hook::callAll('home_init', $ret);
 
-               notice($this->t('You are now logged in as %s', $user['username']));
+               DI::sysmsg()->addNotice($this->t('You are now logged in as %s', $user['username']));
 
                DI::baseUrl()->redirect('network');
        }