From 3fc3ded750afe4b90c95f3036bded015ed5c9572 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 23 Jul 2020 06:11:21 +0000 Subject: [PATCH] Useless info messages removed --- mod/events.php | 2 -- mod/follow.php | 2 +- mod/item.php | 6 ++---- mod/message.php | 15 ++++++--------- mod/network.php | 4 ++-- mod/oexchange.php | 1 - mod/photos.php | 1 - mod/settings.php | 10 +++------- mod/tagrm.php | 1 - mod/unfollow.php | 1 - mod/wallmessage.php | 2 -- src/App/Authentication.php | 4 +--- src/App/Module.php | 2 +- src/Core/UserImport.php | 2 +- src/Model/FileTag.php | 2 -- src/Module/Admin/Addons/Index.php | 2 +- src/Module/Admin/Blocklist/Server.php | 1 - src/Module/Admin/Logs/Settings.php | 1 - src/Module/Admin/Site.php | 4 +--- src/Module/Admin/Themes/Details.php | 4 +--- src/Module/Admin/Themes/Embed.php | 2 -- src/Module/Admin/Themes/Index.php | 2 +- src/Module/Admin/Tos.php | 2 -- src/Module/BaseSearch.php | 2 +- src/Module/Contact.php | 4 +--- src/Module/Contact/Advanced.php | 4 +--- src/Module/Contact/Poke.php | 4 +--- src/Module/Conversation/Community.php | 2 +- src/Module/Debug/Feed.php | 2 +- src/Module/Directory.php | 2 +- src/Module/Filer/RemoveTag.php | 6 +++--- src/Module/Filer/SaveTag.php | 3 +-- src/Module/Group.php | 9 +++------ src/Module/Notifications/Introductions.php | 2 +- src/Module/Profile/Contacts.php | 2 +- src/Module/Search/Index.php | 2 +- src/Module/Search/Saved.php | 12 +++++++----- src/Module/Settings/Profile/Index.php | 4 +--- src/Module/Settings/Profile/Photo/Index.php | 4 +--- 39 files changed, 47 insertions(+), 90 deletions(-) diff --git a/mod/events.php b/mod/events.php index 437cc160b4..0c16044b48 100644 --- a/mod/events.php +++ b/mod/events.php @@ -584,8 +584,6 @@ function events_content(App $a) if (Item::exists(['id' => $ev[0]['itemid']])) { notice(DI::l10n()->t('Failed to remove event') . EOL); - } else { - info(DI::l10n()->t('Event removed') . EOL); } DI::baseUrl()->redirect('events'); diff --git a/mod/follow.php b/mod/follow.php index 141fa9fdba..ac07d040cc 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -62,7 +62,7 @@ function follow_post(App $a) DI::baseUrl()->redirect('contact/' . $result['cid']); } - info(DI::l10n()->t('The contact could not be added.')); + notice(DI::l10n()->t('The contact could not be added.')); DI::baseUrl()->redirect($return_path); // NOTREACHED diff --git a/mod/item.php b/mod/item.php index c4d7231c22..57fb64e3da 100644 --- a/mod/item.php +++ b/mod/item.php @@ -333,7 +333,7 @@ function item_post(App $a) { System::jsonExit(['preview' => '']); } - info(DI::l10n()->t('Empty post discarded.')); + notice(DI::l10n()->t('Empty post discarded.')); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -703,7 +703,6 @@ function item_post(App $a) { // update filetags in pconfig FileTag::updatePconfig($uid, $categories_old, $categories_new, 'category'); - info(DI::l10n()->t('Post updated.')); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -725,7 +724,7 @@ function item_post(App $a) { $post_id = Item::insert($datarray); if (!$post_id) { - info(DI::l10n()->t('Item wasn\'t stored.')); + notice(DI::l10n()->t('Item wasn\'t stored.')); if ($return_path) { DI::baseUrl()->redirect($return_path); } @@ -826,7 +825,6 @@ function item_post(App $a) { return $post_id; } - info(DI::l10n()->t('Post published.')); item_post_return(DI::baseUrl(), $api_source, $return_path); // NOTREACHED } diff --git a/mod/message.php b/mod/message.php index 438f96030b..4404e6aff8 100644 --- a/mod/message.php +++ b/mod/message.php @@ -94,8 +94,6 @@ function message_post(App $a) case -4: notice(DI::l10n()->t('Message collection failure.') . EOL); break; - default: - info(DI::l10n()->t('Message sent.') . EOL); } // fake it to go back to the input form if no recipient listed @@ -178,17 +176,16 @@ function message_content(App $a) if ($cmd === 'drop') { $message = DBA::selectFirst('mail', ['convid'], ['id' => $a->argv[2], 'uid' => local_user()]); if(!DBA::isResult($message)){ - info(DI::l10n()->t('Conversation not found.') . EOL); + notice(DI::l10n()->t('Conversation not found.') . EOL); DI::baseUrl()->redirect('message'); } - if (DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) { - info(DI::l10n()->t('Message deleted.') . EOL); + if (!DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) { + notice(DI::l10n()->t('Message was not deleted.') . EOL); } $conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]); if(!DBA::isResult($conversation)){ - info(DI::l10n()->t('Conversation removed.') . EOL); DI::baseUrl()->redirect('message'); } @@ -201,8 +198,8 @@ function message_content(App $a) if (DBA::isResult($r)) { $parent = $r[0]['parent-uri']; - if (DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) { - info(DI::l10n()->t('Conversation removed.') . EOL); + if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) { + notice(DI::l10n()->t('Conversation was not removed.') . EOL); } } DI::baseUrl()->redirect('message'); @@ -301,7 +298,7 @@ function message_content(App $a) $r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage()); if (!DBA::isResult($r)) { - info(DI::l10n()->t('No messages.') . EOL); + notice(DI::l10n()->t('No messages.') . EOL); return $o; } diff --git a/mod/network.php b/mod/network.php index f847e6757e..2afc90dbf1 100644 --- a/mod/network.php +++ b/mod/network.php @@ -305,7 +305,7 @@ function network_content(App $a, $update = 0, $parent = 0) } if ($o === '') { - info("No items found"); + notice("No items found"); } return $o; @@ -569,7 +569,7 @@ function networkThreadedView(App $a, $update, $parent) $sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . Strings::protectSprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))"; } else { $sql_extra3 .= " AND false "; - info(DI::l10n()->t('Group is empty')); + notice(DI::l10n()->t('Group is empty')); } $o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [ diff --git a/mod/oexchange.php b/mod/oexchange.php index 97367c3ea5..6a05d49944 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -45,7 +45,6 @@ function oexchange_content(App $a) { } if (($a->argc > 1) && $a->argv[1] === 'done') { - info(DI::l10n()->t('Post successful.') . EOL); return; } diff --git a/mod/photos.php b/mod/photos.php index f33a9241ef..4118b80695 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -295,7 +295,6 @@ function photos_post(App $a) // Update the photo albums cache Photo::clearAlbumCache($page_owner_uid); - notice('Successfully deleted the photo.'); } else { notice('Failed to delete the photo.'); DI::baseUrl()->redirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]); diff --git a/mod/settings.php b/mod/settings.php index 9b2f4f650e..14db27e6f8 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -202,9 +202,6 @@ function settings_post(App $a) } } } - if (!$failed) { - info(DI::l10n()->t('Email settings updated.') . EOL); - } } } @@ -219,7 +216,6 @@ function settings_post(App $a) DI::pConfig()->set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0)); } } - info(DI::l10n()->t('Features updated') . EOL); return; } @@ -231,7 +227,7 @@ function settings_post(App $a) // was there an error if ($_FILES['importcontact-filename']['error'] > 0) { Logger::notice('Contact CSV file upload error'); - info(DI::l10n()->t('Contact CSV file upload error')); + notice(DI::l10n()->t('Contact CSV file upload error')); } else { $csvArray = array_map('str_getcsv', file($_FILES['importcontact-filename']['tmp_name'])); // import contacts @@ -443,8 +439,8 @@ function settings_post(App $a) $fields['openidserver'] = ''; } - if (DBA::update('user', $fields, ['uid' => local_user()])) { - info(DI::l10n()->t('Settings updated.') . EOL); + if (!DBA::update('user', $fields, ['uid' => local_user()])) { + notice(DI::l10n()->t('Settings were not updated.') . EOL); } // clear session language diff --git a/mod/tagrm.php b/mod/tagrm.php index 4022f999db..179276663b 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -44,7 +44,6 @@ function tagrm_post(App $a) $item_id = $_POST['item'] ?? 0; update_tags($item_id, $tags); - info(DI::l10n()->t('Tag(s) removed') . EOL); DI::baseUrl()->redirect($_SESSION['photo_return']); // NOTREACHED diff --git a/mod/unfollow.php b/mod/unfollow.php index 09466ba802..5ccc9c859a 100644 --- a/mod/unfollow.php +++ b/mod/unfollow.php @@ -79,7 +79,6 @@ function unfollow_post(App $a) $return_path = $base_return_path . '/' . $contact['id']; } - info(DI::l10n()->t('Contact unfollowed')); DI::baseUrl()->redirect($return_path); // NOTREACHED } diff --git a/mod/wallmessage.php b/mod/wallmessage.php index e5b482a65e..82d87ca290 100644 --- a/mod/wallmessage.php +++ b/mod/wallmessage.php @@ -84,8 +84,6 @@ function wallmessage_post(App $a) { case -4: notice(DI::l10n()->t('Message collection failure.') . EOL); break; - default: - info(DI::l10n()->t('Message sent.') . EOL); } DI::baseUrl()->redirect('profile/'.$user['nickname']); diff --git a/src/App/Authentication.php b/src/App/Authentication.php index 678bb0058c..a0ce5df650 100644 --- a/src/App/Authentication.php +++ b/src/App/Authentication.php @@ -270,7 +270,7 @@ class Authentication } } catch (Exception $e) { $this->logger->warning('authenticate: failed login attempt', ['action' => 'login', 'username' => Strings::escapeTags($username), 'ip' => $_SERVER['REMOTE_ADDR']]); - info($this->l10n->t('Login failed. Please check your credentials.' . EOL)); + notice($this->l10n->t('Login failed. Please check your credentials.' . EOL)); $this->baseUrl->redirect(); } @@ -389,8 +389,6 @@ class Authentication info($this->l10n->t('Welcome %s', $user_record['username'])); info($this->l10n->t('Please upload a profile photo.')); $this->baseUrl->redirect('settings/profile/photo/new'); - } else { - info($this->l10n->t("Welcome back %s", $user_record['username'])); } } diff --git a/src/App/Module.php b/src/App/Module.php index 4b9eb68bdd..58c595cb7b 100644 --- a/src/App/Module.php +++ b/src/App/Module.php @@ -237,7 +237,7 @@ class Module public function run(Core\L10n $l10n, App\BaseURL $baseUrl, LoggerInterface $logger, array $server, array $post) { if ($this->printNotAllowedAddon) { - info($l10n->t("You must be logged in to use addons. ")); + notice($l10n->t("You must be logged in to use addons. ")); } /* The URL provided does not resolve to a valid module. diff --git a/src/Core/UserImport.php b/src/Core/UserImport.php index 06ba6398a8..ed131910c7 100644 --- a/src/Core/UserImport.php +++ b/src/Core/UserImport.php @@ -271,7 +271,7 @@ class UserImport if ($r === false) { Logger::log("uimport:insert profile: ERROR : " . DBA::errorMessage(), Logger::INFO); - info(DI::l10n()->t("User profile creation error")); + notice(DI::l10n()->t("User profile creation error")); DBA::delete('user', ['uid' => $newuid]); DBA::delete('profile_field', ['uid' => $newuid]); return; diff --git a/src/Model/FileTag.php b/src/Model/FileTag.php index 0b728e33d7..a2c8bb4397 100644 --- a/src/Model/FileTag.php +++ b/src/Model/FileTag.php @@ -271,8 +271,6 @@ class FileTag if (!strlen($saved) || !stristr($saved, '[' . self::encode($file) . ']')) { DI::pConfig()->set($uid, 'system', 'filetags', $saved . '[' . self::encode($file) . ']'); } - - info(DI::l10n()->t('Item filed')); } return true; diff --git a/src/Module/Admin/Addons/Index.php b/src/Module/Admin/Addons/Index.php index 3049cdc6a7..d52085389d 100644 --- a/src/Module/Admin/Addons/Index.php +++ b/src/Module/Admin/Addons/Index.php @@ -50,7 +50,7 @@ class Index extends BaseAdmin } elseif (Addon::install($addon)) { info(DI::l10n()->t('Addon %s enabled.', $addon)); } else { - info(DI::l10n()->t('Addon %s failed to install.', $addon)); + notice(DI::l10n()->t('Addon %s failed to install.', $addon)); } break; diff --git a/src/Module/Admin/Blocklist/Server.php b/src/Module/Admin/Blocklist/Server.php index 4f19ca361d..eccb65598f 100644 --- a/src/Module/Admin/Blocklist/Server.php +++ b/src/Module/Admin/Blocklist/Server.php @@ -62,7 +62,6 @@ class Server extends BaseAdmin } } DI::config()->set('system', 'blocklist', $blocklist); - info(DI::l10n()->t('Site blocklist updated.') . EOL); } DI::baseUrl()->redirect('admin/blocklist/server'); diff --git a/src/Module/Admin/Logs/Settings.php b/src/Module/Admin/Logs/Settings.php index 5158108e46..b60936c785 100644 --- a/src/Module/Admin/Logs/Settings.php +++ b/src/Module/Admin/Logs/Settings.php @@ -51,7 +51,6 @@ class Settings extends BaseAdmin DI::config()->set('system', 'loglevel', $loglevel); } - info(DI::l10n()->t("Log settings updated.")); DI::baseUrl()->redirect('admin/logs'); } diff --git a/src/Module/Admin/Site.php b/src/Module/Admin/Site.php index 2e16cc657e..c4b320e72d 100644 --- a/src/Module/Admin/Site.php +++ b/src/Module/Admin/Site.php @@ -250,7 +250,7 @@ class Site extends BaseAdmin DI::baseUrl()->redirect('admin/site' . $active_panel); } } else { - info(DI::l10n()->t('Invalid storage backend setting value.')); + notice(DI::l10n()->t('Invalid storage backend setting value.')); } // Has the directory url changed? If yes, then resubmit the existing profiles there @@ -433,8 +433,6 @@ class Site extends BaseAdmin DI::config()->set('system', 'rino_encrypt' , $rino); - info(DI::l10n()->t('Site settings updated.') . EOL); - DI::baseUrl()->redirect('admin/site' . $active_panel); } diff --git a/src/Module/Admin/Themes/Details.php b/src/Module/Admin/Themes/Details.php index c8d0578382..405e289022 100644 --- a/src/Module/Admin/Themes/Details.php +++ b/src/Module/Admin/Themes/Details.php @@ -48,8 +48,6 @@ class Details extends BaseAdmin } } - info(DI::l10n()->t('Theme settings updated.')); - if (DI::mode()->isAjax()) { return; } @@ -91,7 +89,7 @@ class Details extends BaseAdmin } elseif (Theme::install($theme)) { info(DI::l10n()->t('Theme %s successfully enabled.', $theme)); } else { - info(DI::l10n()->t('Theme %s failed to install.', $theme)); + notice(DI::l10n()->t('Theme %s failed to install.', $theme)); } DI::baseUrl()->redirect('admin/themes/' . $theme); diff --git a/src/Module/Admin/Themes/Embed.php b/src/Module/Admin/Themes/Embed.php index 675e33c846..37de7c2384 100644 --- a/src/Module/Admin/Themes/Embed.php +++ b/src/Module/Admin/Themes/Embed.php @@ -62,8 +62,6 @@ class Embed extends BaseAdmin } } - info(DI::l10n()->t('Theme settings updated.')); - if (DI::mode()->isAjax()) { return; } diff --git a/src/Module/Admin/Themes/Index.php b/src/Module/Admin/Themes/Index.php index 955ddadc70..78d27dfa0b 100644 --- a/src/Module/Admin/Themes/Index.php +++ b/src/Module/Admin/Themes/Index.php @@ -66,7 +66,7 @@ class Index extends BaseAdmin } elseif (Theme::install($theme)) { info(DI::l10n()->t('Theme %s successfully enabled.', $theme)); } else { - info(DI::l10n()->t('Theme %s failed to install.', $theme)); + notice(DI::l10n()->t('Theme %s failed to install.', $theme)); } } diff --git a/src/Module/Admin/Tos.php b/src/Module/Admin/Tos.php index 811a0eb25c..a3bc94a1fe 100644 --- a/src/Module/Admin/Tos.php +++ b/src/Module/Admin/Tos.php @@ -45,8 +45,6 @@ class Tos extends BaseAdmin DI::config()->set('system', 'tosprivstatement', $displayprivstatement); DI::config()->set('system', 'tostext', $tostext); - info(DI::l10n()->t('The Terms of Service settings have been updated.')); - DI::baseUrl()->redirect('admin/tos'); } diff --git a/src/Module/BaseSearch.php b/src/Module/BaseSearch.php index e67d3c3c93..57b5976ef0 100644 --- a/src/Module/BaseSearch.php +++ b/src/Module/BaseSearch.php @@ -116,7 +116,7 @@ class BaseSearch extends BaseModule protected static function printResult(ResultList $results, Pager $pager, $header = '') { if ($results->getTotal() == 0) { - info(DI::l10n()->t('No matches')); + notice(DI::l10n()->t('No matches')); return ''; } diff --git a/src/Module/Contact.php b/src/Module/Contact.php index f63d42c0ea..ee8ad3663d 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -144,9 +144,7 @@ class Contact extends BaseModule ['id' => $contact_id, 'uid' => local_user()] ); - if (DBA::isResult($r)) { - info(DI::l10n()->t('Contact updated.') . EOL); - } else { + if (!DBA::isResult($r)) { notice(DI::l10n()->t('Failed to update contact record.') . EOL); } diff --git a/src/Module/Contact/Advanced.php b/src/Module/Contact/Advanced.php index d29d0609a9..8640808439 100644 --- a/src/Module/Contact/Advanced.php +++ b/src/Module/Contact/Advanced.php @@ -90,9 +90,7 @@ class Advanced extends BaseModule Model\Contact::updateAvatar($photo, local_user(), $contact['id'], true); } - if ($r) { - info(DI::l10n()->t('Contact settings applied.') . EOL); - } else { + if (!$r) { notice(DI::l10n()->t('Contact update failed.') . EOL); } diff --git a/src/Module/Contact/Poke.php b/src/Module/Contact/Poke.php index b4adff46d3..9f2ae7bde6 100644 --- a/src/Module/Contact/Poke.php +++ b/src/Module/Contact/Poke.php @@ -110,9 +110,7 @@ class Poke extends BaseModule */ private static function postReturn(bool $success) { - if ($success) { - info(DI::l10n()->t('Poke successfully sent.')); - } else { + if (!$success) { notice(DI::l10n()->t('Error while sending poke, please retry.')); } diff --git a/src/Module/Conversation/Community.php b/src/Module/Conversation/Community.php index 5637c6f419..c86bf9176c 100644 --- a/src/Module/Conversation/Community.php +++ b/src/Module/Conversation/Community.php @@ -81,7 +81,7 @@ class Community extends BaseModule $items = self::getItems(); if (!DBA::isResult($items)) { - info(DI::l10n()->t('No results.')); + notice(DI::l10n()->t('No results.')); return $o; } diff --git a/src/Module/Debug/Feed.php b/src/Module/Debug/Feed.php index e969de9cc3..f0f86f607f 100644 --- a/src/Module/Debug/Feed.php +++ b/src/Module/Debug/Feed.php @@ -36,7 +36,7 @@ class Feed extends BaseModule public static function init(array $parameters = []) { if (!local_user()) { - info(DI::l10n()->t('You must be logged in to use this module')); + notice(DI::l10n()->t('You must be logged in to use this module')); DI::baseUrl()->redirect(); } } diff --git a/src/Module/Directory.php b/src/Module/Directory.php index 3d03f10711..491023145c 100644 --- a/src/Module/Directory.php +++ b/src/Module/Directory.php @@ -75,7 +75,7 @@ class Directory extends BaseModule $profiles = Profile::searchProfiles($pager->getStart(), $pager->getItemsPerPage(), $search); if ($profiles['total'] === 0) { - info(DI::l10n()->t('No entries (some entries may be hidden).') . EOL); + notice(DI::l10n()->t('No entries (some entries may be hidden).') . EOL); } else { if (in_array('small', $app->argv)) { $photo = 'thumb'; diff --git a/src/Module/Filer/RemoveTag.php b/src/Module/Filer/RemoveTag.php index 7866656e33..a8a8a896b3 100644 --- a/src/Module/Filer/RemoveTag.php +++ b/src/Module/Filer/RemoveTag.php @@ -59,11 +59,11 @@ class RemoveTag extends BaseModule ]); if ($item_id && strlen($term)) { - if (FileTag::unsaveFile(local_user(), $item_id, $term, $category)) { - info('Item removed'); + if (!FileTag::unsaveFile(local_user(), $item_id, $term, $category)) { + notice(DI::l10n()->t('Item was not removed')); } } else { - info('Item was not deleted'); + notice(DI::l10n()->t('Item was not deleted')); } DI::baseUrl()->redirect('network?file=' . rawurlencode($term)); diff --git a/src/Module/Filer/SaveTag.php b/src/Module/Filer/SaveTag.php index 12226107ba..4b2fdb09e8 100644 --- a/src/Module/Filer/SaveTag.php +++ b/src/Module/Filer/SaveTag.php @@ -35,7 +35,7 @@ class SaveTag extends BaseModule public static function init(array $parameters = []) { if (!local_user()) { - info(DI::l10n()->t('You must be logged in to use this module')); + notice(DI::l10n()->t('You must be logged in to use this module')); DI::baseUrl()->redirect(); } } @@ -54,7 +54,6 @@ class SaveTag extends BaseModule if ($item_id && strlen($term)) { // file item Model\FileTag::saveFile(local_user(), $item_id, $term); - info(DI::l10n()->t('Filetag %s saved to item', $term)); } // return filer dialog diff --git a/src/Module/Group.php b/src/Module/Group.php index 11e7f1a760..d5f1fc8ef8 100644 --- a/src/Module/Group.php +++ b/src/Module/Group.php @@ -53,7 +53,6 @@ class Group extends BaseModule $name = Strings::escapeTags(trim($_POST['groupname'])); $r = Model\Group::create(local_user(), $name); if ($r) { - info(DI::l10n()->t('Group created.')); $r = Model\Group::getIdByName(local_user(), $name); if ($r) { DI::baseUrl()->redirect('group/' . $r); @@ -75,8 +74,8 @@ class Group extends BaseModule } $groupname = Strings::escapeTags(trim($_POST['groupname'])); if (strlen($groupname) && ($groupname != $group['name'])) { - if (Model\Group::update($group['id'], $groupname)) { - info(DI::l10n()->t('Group name changed.')); + if (!Model\Group::update($group['id'], $groupname)) { + notice(DI::l10n()->t('Group name was not changed.')); } } } @@ -216,9 +215,7 @@ class Group extends BaseModule DI::baseUrl()->redirect('contact'); } - if (Model\Group::remove($a->argv[2])) { - info(DI::l10n()->t('Group removed.')); - } else { + if (!Model\Group::remove($a->argv[2])) { notice(DI::l10n()->t('Unable to remove group.')); } } diff --git a/src/Module/Notifications/Introductions.php b/src/Module/Notifications/Introductions.php index 0b1cb9e6a3..4b05b8c2cd 100644 --- a/src/Module/Notifications/Introductions.php +++ b/src/Module/Notifications/Introductions.php @@ -191,7 +191,7 @@ class Introductions extends BaseNotifications } if (count($notifications['notifications']) == 0) { - info(DI::l10n()->t('No introductions.') . EOL); + notice(DI::l10n()->t('No introductions.') . EOL); $notificationNoContent = DI::l10n()->t('No more %s notifications.', $notifications['ident']); } diff --git a/src/Module/Profile/Contacts.php b/src/Module/Profile/Contacts.php index 3d55c57f48..dbf0cf8d84 100644 --- a/src/Module/Profile/Contacts.php +++ b/src/Module/Profile/Contacts.php @@ -92,7 +92,7 @@ class Contacts extends BaseProfile $contacts_stmt = DBA::select('contact', [], $condition, $params); if (!DBA::isResult($contacts_stmt)) { - info(DI::l10n()->t('No contacts.') . EOL); + notice(DI::l10n()->t('No contacts.') . EOL); return $o; } diff --git a/src/Module/Search/Index.php b/src/Module/Search/Index.php index 23f12d2638..bf3ae2585b 100644 --- a/src/Module/Search/Index.php +++ b/src/Module/Search/Index.php @@ -176,7 +176,7 @@ class Index extends BaseSearch } if (!DBA::isResult($r)) { - info(DI::l10n()->t('No results.')); + notice(DI::l10n()->t('No results.')); return $o; } diff --git a/src/Module/Search/Saved.php b/src/Module/Search/Saved.php index 73372b03a0..0f45b50f5b 100644 --- a/src/Module/Search/Saved.php +++ b/src/Module/Search/Saved.php @@ -41,16 +41,18 @@ class Saved extends BaseModule case 'add': $fields = ['uid' => local_user(), 'term' => $search]; if (!DBA::exists('search', $fields)) { - DBA::insert('search', $fields); - info(DI::l10n()->t('Search term successfully saved.')); + if (!DBA::insert('search', $fields)) { + notice(DI::l10n()->t('Search term was not saved.')); + } } else { - info(DI::l10n()->t('Search term already saved.')); + notice(DI::l10n()->t('Search term already saved.')); } break; case 'remove': - DBA::delete('search', ['uid' => local_user(), 'term' => $search]); - info(DI::l10n()->t('Search term successfully removed.')); + if (!DBA::delete('search', ['uid' => local_user(), 'term' => $search])) { + notice(DI::l10n()->t('Search term was not removed.')); + } break; } } diff --git a/src/Module/Settings/Profile/Index.php b/src/Module/Settings/Profile/Index.php index 1335a8211e..a7e02f4299 100644 --- a/src/Module/Settings/Profile/Index.php +++ b/src/Module/Settings/Profile/Index.php @@ -134,9 +134,7 @@ class Index extends BaseSettings ['uid' => local_user()] ); - if ($result) { - info(DI::l10n()->t('Profile updated.')); - } else { + if (!$result) { notice(DI::l10n()->t('Profile couldn\'t be updated.')); return; } diff --git a/src/Module/Settings/Profile/Photo/Index.php b/src/Module/Settings/Profile/Photo/Index.php index 3e4f9b8a4e..df9622f2e9 100644 --- a/src/Module/Settings/Profile/Photo/Index.php +++ b/src/Module/Settings/Profile/Photo/Index.php @@ -93,9 +93,7 @@ class Index extends BaseSettings $filename = ''; - if (Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 0)) { - info(DI::l10n()->t('Image uploaded successfully.')); - } else { + if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 0)) { notice(DI::l10n()->t('Image upload failed.')); }