mirror of
https://github.com/friendica/friendica
synced 2024-12-23 02:00:17 +00:00
Useless info messages removed
This commit is contained in:
parent
0b423b73ac
commit
3fc3ded750
39 changed files with 47 additions and 90 deletions
|
@ -584,8 +584,6 @@ function events_content(App $a)
|
||||||
|
|
||||||
if (Item::exists(['id' => $ev[0]['itemid']])) {
|
if (Item::exists(['id' => $ev[0]['itemid']])) {
|
||||||
notice(DI::l10n()->t('Failed to remove event') . EOL);
|
notice(DI::l10n()->t('Failed to remove event') . EOL);
|
||||||
} else {
|
|
||||||
info(DI::l10n()->t('Event removed') . EOL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::baseUrl()->redirect('events');
|
DI::baseUrl()->redirect('events');
|
||||||
|
|
|
@ -62,7 +62,7 @@ function follow_post(App $a)
|
||||||
DI::baseUrl()->redirect('contact/' . $result['cid']);
|
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);
|
DI::baseUrl()->redirect($return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
|
|
|
@ -333,7 +333,7 @@ function item_post(App $a) {
|
||||||
System::jsonExit(['preview' => '']);
|
System::jsonExit(['preview' => '']);
|
||||||
}
|
}
|
||||||
|
|
||||||
info(DI::l10n()->t('Empty post discarded.'));
|
notice(DI::l10n()->t('Empty post discarded.'));
|
||||||
if ($return_path) {
|
if ($return_path) {
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
@ -703,7 +703,6 @@ function item_post(App $a) {
|
||||||
// update filetags in pconfig
|
// update filetags in pconfig
|
||||||
FileTag::updatePconfig($uid, $categories_old, $categories_new, 'category');
|
FileTag::updatePconfig($uid, $categories_old, $categories_new, 'category');
|
||||||
|
|
||||||
info(DI::l10n()->t('Post updated.'));
|
|
||||||
if ($return_path) {
|
if ($return_path) {
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
@ -725,7 +724,7 @@ function item_post(App $a) {
|
||||||
$post_id = Item::insert($datarray);
|
$post_id = Item::insert($datarray);
|
||||||
|
|
||||||
if (!$post_id) {
|
if (!$post_id) {
|
||||||
info(DI::l10n()->t('Item wasn\'t stored.'));
|
notice(DI::l10n()->t('Item wasn\'t stored.'));
|
||||||
if ($return_path) {
|
if ($return_path) {
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
}
|
}
|
||||||
|
@ -826,7 +825,6 @@ function item_post(App $a) {
|
||||||
return $post_id;
|
return $post_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
info(DI::l10n()->t('Post published.'));
|
|
||||||
item_post_return(DI::baseUrl(), $api_source, $return_path);
|
item_post_return(DI::baseUrl(), $api_source, $return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,8 +94,6 @@ function message_post(App $a)
|
||||||
case -4:
|
case -4:
|
||||||
notice(DI::l10n()->t('Message collection failure.') . EOL);
|
notice(DI::l10n()->t('Message collection failure.') . EOL);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
info(DI::l10n()->t('Message sent.') . EOL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// fake it to go back to the input form if no recipient listed
|
// 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') {
|
if ($cmd === 'drop') {
|
||||||
$message = DBA::selectFirst('mail', ['convid'], ['id' => $a->argv[2], 'uid' => local_user()]);
|
$message = DBA::selectFirst('mail', ['convid'], ['id' => $a->argv[2], 'uid' => local_user()]);
|
||||||
if(!DBA::isResult($message)){
|
if(!DBA::isResult($message)){
|
||||||
info(DI::l10n()->t('Conversation not found.') . EOL);
|
notice(DI::l10n()->t('Conversation not found.') . EOL);
|
||||||
DI::baseUrl()->redirect('message');
|
DI::baseUrl()->redirect('message');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
|
if (!DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
|
||||||
info(DI::l10n()->t('Message deleted.') . EOL);
|
notice(DI::l10n()->t('Message was not deleted.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
|
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
|
||||||
if(!DBA::isResult($conversation)){
|
if(!DBA::isResult($conversation)){
|
||||||
info(DI::l10n()->t('Conversation removed.') . EOL);
|
|
||||||
DI::baseUrl()->redirect('message');
|
DI::baseUrl()->redirect('message');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,8 +198,8 @@ function message_content(App $a)
|
||||||
if (DBA::isResult($r)) {
|
if (DBA::isResult($r)) {
|
||||||
$parent = $r[0]['parent-uri'];
|
$parent = $r[0]['parent-uri'];
|
||||||
|
|
||||||
if (DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
|
if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
|
||||||
info(DI::l10n()->t('Conversation removed.') . EOL);
|
notice(DI::l10n()->t('Conversation was not removed.') . EOL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DI::baseUrl()->redirect('message');
|
DI::baseUrl()->redirect('message');
|
||||||
|
@ -301,7 +298,7 @@ function message_content(App $a)
|
||||||
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
|
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
|
||||||
|
|
||||||
if (!DBA::isResult($r)) {
|
if (!DBA::isResult($r)) {
|
||||||
info(DI::l10n()->t('No messages.') . EOL);
|
notice(DI::l10n()->t('No messages.') . EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -305,7 +305,7 @@ function network_content(App $a, $update = 0, $parent = 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($o === '') {
|
if ($o === '') {
|
||||||
info("No items found");
|
notice("No items found");
|
||||||
}
|
}
|
||||||
|
|
||||||
return $o;
|
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`))";
|
$sql_extra3 .= " OR (`thread`.`contact-id` = '$contact_str_self' AND `temp1`.`allow_gid` LIKE '" . Strings::protectSprintf('%<' . intval($gid) . '>%') . "' AND `temp1`.`private`))";
|
||||||
} else {
|
} else {
|
||||||
$sql_extra3 .= " AND false ";
|
$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'), [
|
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('section_title.tpl'), [
|
||||||
|
|
|
@ -45,7 +45,6 @@ function oexchange_content(App $a) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($a->argc > 1) && $a->argv[1] === 'done') {
|
if (($a->argc > 1) && $a->argv[1] === 'done') {
|
||||||
info(DI::l10n()->t('Post successful.') . EOL);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -295,7 +295,6 @@ function photos_post(App $a)
|
||||||
|
|
||||||
// Update the photo albums cache
|
// Update the photo albums cache
|
||||||
Photo::clearAlbumCache($page_owner_uid);
|
Photo::clearAlbumCache($page_owner_uid);
|
||||||
notice('Successfully deleted the photo.');
|
|
||||||
} else {
|
} else {
|
||||||
notice('Failed to delete the photo.');
|
notice('Failed to delete the photo.');
|
||||||
DI::baseUrl()->redirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
|
DI::baseUrl()->redirect('photos/' . $a->argv[1] . '/image/' . $a->argv[3]);
|
||||||
|
|
|
@ -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));
|
DI::pConfig()->set(local_user(), 'feature', substr($k, 8), ((intval($v)) ? 1 : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info(DI::l10n()->t('Features updated') . EOL);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -231,7 +227,7 @@ function settings_post(App $a)
|
||||||
// was there an error
|
// was there an error
|
||||||
if ($_FILES['importcontact-filename']['error'] > 0) {
|
if ($_FILES['importcontact-filename']['error'] > 0) {
|
||||||
Logger::notice('Contact CSV file upload error');
|
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 {
|
} else {
|
||||||
$csvArray = array_map('str_getcsv', file($_FILES['importcontact-filename']['tmp_name']));
|
$csvArray = array_map('str_getcsv', file($_FILES['importcontact-filename']['tmp_name']));
|
||||||
// import contacts
|
// import contacts
|
||||||
|
@ -443,8 +439,8 @@ function settings_post(App $a)
|
||||||
$fields['openidserver'] = '';
|
$fields['openidserver'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DBA::update('user', $fields, ['uid' => local_user()])) {
|
if (!DBA::update('user', $fields, ['uid' => local_user()])) {
|
||||||
info(DI::l10n()->t('Settings updated.') . EOL);
|
notice(DI::l10n()->t('Settings were not updated.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear session language
|
// clear session language
|
||||||
|
|
|
@ -44,7 +44,6 @@ function tagrm_post(App $a)
|
||||||
|
|
||||||
$item_id = $_POST['item'] ?? 0;
|
$item_id = $_POST['item'] ?? 0;
|
||||||
update_tags($item_id, $tags);
|
update_tags($item_id, $tags);
|
||||||
info(DI::l10n()->t('Tag(s) removed') . EOL);
|
|
||||||
|
|
||||||
DI::baseUrl()->redirect($_SESSION['photo_return']);
|
DI::baseUrl()->redirect($_SESSION['photo_return']);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
|
|
|
@ -79,7 +79,6 @@ function unfollow_post(App $a)
|
||||||
$return_path = $base_return_path . '/' . $contact['id'];
|
$return_path = $base_return_path . '/' . $contact['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
info(DI::l10n()->t('Contact unfollowed'));
|
|
||||||
DI::baseUrl()->redirect($return_path);
|
DI::baseUrl()->redirect($return_path);
|
||||||
// NOTREACHED
|
// NOTREACHED
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,8 +84,6 @@ function wallmessage_post(App $a) {
|
||||||
case -4:
|
case -4:
|
||||||
notice(DI::l10n()->t('Message collection failure.') . EOL);
|
notice(DI::l10n()->t('Message collection failure.') . EOL);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
info(DI::l10n()->t('Message sent.') . EOL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::baseUrl()->redirect('profile/'.$user['nickname']);
|
DI::baseUrl()->redirect('profile/'.$user['nickname']);
|
||||||
|
|
|
@ -270,7 +270,7 @@ class Authentication
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->logger->warning('authenticate: failed login attempt', ['action' => 'login', 'username' => Strings::escapeTags($username), 'ip' => $_SERVER['REMOTE_ADDR']]);
|
$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();
|
$this->baseUrl->redirect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,8 +389,6 @@ class Authentication
|
||||||
info($this->l10n->t('Welcome %s', $user_record['username']));
|
info($this->l10n->t('Welcome %s', $user_record['username']));
|
||||||
info($this->l10n->t('Please upload a profile photo.'));
|
info($this->l10n->t('Please upload a profile photo.'));
|
||||||
$this->baseUrl->redirect('settings/profile/photo/new');
|
$this->baseUrl->redirect('settings/profile/photo/new');
|
||||||
} else {
|
|
||||||
info($this->l10n->t("Welcome back %s", $user_record['username']));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,7 @@ class Module
|
||||||
public function run(Core\L10n $l10n, App\BaseURL $baseUrl, LoggerInterface $logger, array $server, array $post)
|
public function run(Core\L10n $l10n, App\BaseURL $baseUrl, LoggerInterface $logger, array $server, array $post)
|
||||||
{
|
{
|
||||||
if ($this->printNotAllowedAddon) {
|
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.
|
/* The URL provided does not resolve to a valid module.
|
||||||
|
|
|
@ -271,7 +271,7 @@ class UserImport
|
||||||
|
|
||||||
if ($r === false) {
|
if ($r === false) {
|
||||||
Logger::log("uimport:insert profile: ERROR : " . DBA::errorMessage(), Logger::INFO);
|
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('user', ['uid' => $newuid]);
|
||||||
DBA::delete('profile_field', ['uid' => $newuid]);
|
DBA::delete('profile_field', ['uid' => $newuid]);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -271,8 +271,6 @@ class FileTag
|
||||||
if (!strlen($saved) || !stristr($saved, '[' . self::encode($file) . ']')) {
|
if (!strlen($saved) || !stristr($saved, '[' . self::encode($file) . ']')) {
|
||||||
DI::pConfig()->set($uid, 'system', 'filetags', $saved . '[' . self::encode($file) . ']');
|
DI::pConfig()->set($uid, 'system', 'filetags', $saved . '[' . self::encode($file) . ']');
|
||||||
}
|
}
|
||||||
|
|
||||||
info(DI::l10n()->t('Item filed'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -50,7 +50,7 @@ class Index extends BaseAdmin
|
||||||
} elseif (Addon::install($addon)) {
|
} elseif (Addon::install($addon)) {
|
||||||
info(DI::l10n()->t('Addon %s enabled.', $addon));
|
info(DI::l10n()->t('Addon %s enabled.', $addon));
|
||||||
} else {
|
} else {
|
||||||
info(DI::l10n()->t('Addon %s failed to install.', $addon));
|
notice(DI::l10n()->t('Addon %s failed to install.', $addon));
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -62,7 +62,6 @@ class Server extends BaseAdmin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DI::config()->set('system', 'blocklist', $blocklist);
|
DI::config()->set('system', 'blocklist', $blocklist);
|
||||||
info(DI::l10n()->t('Site blocklist updated.') . EOL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::baseUrl()->redirect('admin/blocklist/server');
|
DI::baseUrl()->redirect('admin/blocklist/server');
|
||||||
|
|
|
@ -51,7 +51,6 @@ class Settings extends BaseAdmin
|
||||||
DI::config()->set('system', 'loglevel', $loglevel);
|
DI::config()->set('system', 'loglevel', $loglevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
info(DI::l10n()->t("Log settings updated."));
|
|
||||||
DI::baseUrl()->redirect('admin/logs');
|
DI::baseUrl()->redirect('admin/logs');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,7 @@ class Site extends BaseAdmin
|
||||||
DI::baseUrl()->redirect('admin/site' . $active_panel);
|
DI::baseUrl()->redirect('admin/site' . $active_panel);
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
// 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);
|
DI::config()->set('system', 'rino_encrypt' , $rino);
|
||||||
|
|
||||||
info(DI::l10n()->t('Site settings updated.') . EOL);
|
|
||||||
|
|
||||||
DI::baseUrl()->redirect('admin/site' . $active_panel);
|
DI::baseUrl()->redirect('admin/site' . $active_panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,8 +48,6 @@ class Details extends BaseAdmin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info(DI::l10n()->t('Theme settings updated.'));
|
|
||||||
|
|
||||||
if (DI::mode()->isAjax()) {
|
if (DI::mode()->isAjax()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -91,7 +89,7 @@ class Details extends BaseAdmin
|
||||||
} elseif (Theme::install($theme)) {
|
} elseif (Theme::install($theme)) {
|
||||||
info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
|
info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
|
||||||
} else {
|
} 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);
|
DI::baseUrl()->redirect('admin/themes/' . $theme);
|
||||||
|
|
|
@ -62,8 +62,6 @@ class Embed extends BaseAdmin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info(DI::l10n()->t('Theme settings updated.'));
|
|
||||||
|
|
||||||
if (DI::mode()->isAjax()) {
|
if (DI::mode()->isAjax()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ class Index extends BaseAdmin
|
||||||
} elseif (Theme::install($theme)) {
|
} elseif (Theme::install($theme)) {
|
||||||
info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
|
info(DI::l10n()->t('Theme %s successfully enabled.', $theme));
|
||||||
} else {
|
} else {
|
||||||
info(DI::l10n()->t('Theme %s failed to install.', $theme));
|
notice(DI::l10n()->t('Theme %s failed to install.', $theme));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,6 @@ class Tos extends BaseAdmin
|
||||||
DI::config()->set('system', 'tosprivstatement', $displayprivstatement);
|
DI::config()->set('system', 'tosprivstatement', $displayprivstatement);
|
||||||
DI::config()->set('system', 'tostext', $tostext);
|
DI::config()->set('system', 'tostext', $tostext);
|
||||||
|
|
||||||
info(DI::l10n()->t('The Terms of Service settings have been updated.'));
|
|
||||||
|
|
||||||
DI::baseUrl()->redirect('admin/tos');
|
DI::baseUrl()->redirect('admin/tos');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ class BaseSearch extends BaseModule
|
||||||
protected static function printResult(ResultList $results, Pager $pager, $header = '')
|
protected static function printResult(ResultList $results, Pager $pager, $header = '')
|
||||||
{
|
{
|
||||||
if ($results->getTotal() == 0) {
|
if ($results->getTotal() == 0) {
|
||||||
info(DI::l10n()->t('No matches'));
|
notice(DI::l10n()->t('No matches'));
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,9 +144,7 @@ class Contact extends BaseModule
|
||||||
['id' => $contact_id, 'uid' => local_user()]
|
['id' => $contact_id, 'uid' => local_user()]
|
||||||
);
|
);
|
||||||
|
|
||||||
if (DBA::isResult($r)) {
|
if (!DBA::isResult($r)) {
|
||||||
info(DI::l10n()->t('Contact updated.') . EOL);
|
|
||||||
} else {
|
|
||||||
notice(DI::l10n()->t('Failed to update contact record.') . EOL);
|
notice(DI::l10n()->t('Failed to update contact record.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,9 +90,7 @@ class Advanced extends BaseModule
|
||||||
Model\Contact::updateAvatar($photo, local_user(), $contact['id'], true);
|
Model\Contact::updateAvatar($photo, local_user(), $contact['id'], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($r) {
|
if (!$r) {
|
||||||
info(DI::l10n()->t('Contact settings applied.') . EOL);
|
|
||||||
} else {
|
|
||||||
notice(DI::l10n()->t('Contact update failed.') . EOL);
|
notice(DI::l10n()->t('Contact update failed.') . EOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,9 +110,7 @@ class Poke extends BaseModule
|
||||||
*/
|
*/
|
||||||
private static function postReturn(bool $success)
|
private static function postReturn(bool $success)
|
||||||
{
|
{
|
||||||
if ($success) {
|
if (!$success) {
|
||||||
info(DI::l10n()->t('Poke successfully sent.'));
|
|
||||||
} else {
|
|
||||||
notice(DI::l10n()->t('Error while sending poke, please retry.'));
|
notice(DI::l10n()->t('Error while sending poke, please retry.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ class Community extends BaseModule
|
||||||
$items = self::getItems();
|
$items = self::getItems();
|
||||||
|
|
||||||
if (!DBA::isResult($items)) {
|
if (!DBA::isResult($items)) {
|
||||||
info(DI::l10n()->t('No results.'));
|
notice(DI::l10n()->t('No results.'));
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class Feed extends BaseModule
|
||||||
public static function init(array $parameters = [])
|
public static function init(array $parameters = [])
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
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();
|
DI::baseUrl()->redirect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ class Directory extends BaseModule
|
||||||
$profiles = Profile::searchProfiles($pager->getStart(), $pager->getItemsPerPage(), $search);
|
$profiles = Profile::searchProfiles($pager->getStart(), $pager->getItemsPerPage(), $search);
|
||||||
|
|
||||||
if ($profiles['total'] === 0) {
|
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 {
|
} else {
|
||||||
if (in_array('small', $app->argv)) {
|
if (in_array('small', $app->argv)) {
|
||||||
$photo = 'thumb';
|
$photo = 'thumb';
|
||||||
|
|
|
@ -59,11 +59,11 @@ class RemoveTag extends BaseModule
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($item_id && strlen($term)) {
|
if ($item_id && strlen($term)) {
|
||||||
if (FileTag::unsaveFile(local_user(), $item_id, $term, $category)) {
|
if (!FileTag::unsaveFile(local_user(), $item_id, $term, $category)) {
|
||||||
info('Item removed');
|
notice(DI::l10n()->t('Item was not removed'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
info('Item was not deleted');
|
notice(DI::l10n()->t('Item was not deleted'));
|
||||||
}
|
}
|
||||||
|
|
||||||
DI::baseUrl()->redirect('network?file=' . rawurlencode($term));
|
DI::baseUrl()->redirect('network?file=' . rawurlencode($term));
|
||||||
|
|
|
@ -35,7 +35,7 @@ class SaveTag extends BaseModule
|
||||||
public static function init(array $parameters = [])
|
public static function init(array $parameters = [])
|
||||||
{
|
{
|
||||||
if (!local_user()) {
|
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();
|
DI::baseUrl()->redirect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,6 @@ class SaveTag extends BaseModule
|
||||||
if ($item_id && strlen($term)) {
|
if ($item_id && strlen($term)) {
|
||||||
// file item
|
// file item
|
||||||
Model\FileTag::saveFile(local_user(), $item_id, $term);
|
Model\FileTag::saveFile(local_user(), $item_id, $term);
|
||||||
info(DI::l10n()->t('Filetag %s saved to item', $term));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// return filer dialog
|
// return filer dialog
|
||||||
|
|
|
@ -53,7 +53,6 @@ class Group extends BaseModule
|
||||||
$name = Strings::escapeTags(trim($_POST['groupname']));
|
$name = Strings::escapeTags(trim($_POST['groupname']));
|
||||||
$r = Model\Group::create(local_user(), $name);
|
$r = Model\Group::create(local_user(), $name);
|
||||||
if ($r) {
|
if ($r) {
|
||||||
info(DI::l10n()->t('Group created.'));
|
|
||||||
$r = Model\Group::getIdByName(local_user(), $name);
|
$r = Model\Group::getIdByName(local_user(), $name);
|
||||||
if ($r) {
|
if ($r) {
|
||||||
DI::baseUrl()->redirect('group/' . $r);
|
DI::baseUrl()->redirect('group/' . $r);
|
||||||
|
@ -75,8 +74,8 @@ class Group extends BaseModule
|
||||||
}
|
}
|
||||||
$groupname = Strings::escapeTags(trim($_POST['groupname']));
|
$groupname = Strings::escapeTags(trim($_POST['groupname']));
|
||||||
if (strlen($groupname) && ($groupname != $group['name'])) {
|
if (strlen($groupname) && ($groupname != $group['name'])) {
|
||||||
if (Model\Group::update($group['id'], $groupname)) {
|
if (!Model\Group::update($group['id'], $groupname)) {
|
||||||
info(DI::l10n()->t('Group name changed.'));
|
notice(DI::l10n()->t('Group name was not changed.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,9 +215,7 @@ class Group extends BaseModule
|
||||||
DI::baseUrl()->redirect('contact');
|
DI::baseUrl()->redirect('contact');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Model\Group::remove($a->argv[2])) {
|
if (!Model\Group::remove($a->argv[2])) {
|
||||||
info(DI::l10n()->t('Group removed.'));
|
|
||||||
} else {
|
|
||||||
notice(DI::l10n()->t('Unable to remove group.'));
|
notice(DI::l10n()->t('Unable to remove group.'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -191,7 +191,7 @@ class Introductions extends BaseNotifications
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($notifications['notifications']) == 0) {
|
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']);
|
$notificationNoContent = DI::l10n()->t('No more %s notifications.', $notifications['ident']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ class Contacts extends BaseProfile
|
||||||
$contacts_stmt = DBA::select('contact', [], $condition, $params);
|
$contacts_stmt = DBA::select('contact', [], $condition, $params);
|
||||||
|
|
||||||
if (!DBA::isResult($contacts_stmt)) {
|
if (!DBA::isResult($contacts_stmt)) {
|
||||||
info(DI::l10n()->t('No contacts.') . EOL);
|
notice(DI::l10n()->t('No contacts.') . EOL);
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,7 +176,7 @@ class Index extends BaseSearch
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!DBA::isResult($r)) {
|
if (!DBA::isResult($r)) {
|
||||||
info(DI::l10n()->t('No results.'));
|
notice(DI::l10n()->t('No results.'));
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,16 +41,18 @@ class Saved extends BaseModule
|
||||||
case 'add':
|
case 'add':
|
||||||
$fields = ['uid' => local_user(), 'term' => $search];
|
$fields = ['uid' => local_user(), 'term' => $search];
|
||||||
if (!DBA::exists('search', $fields)) {
|
if (!DBA::exists('search', $fields)) {
|
||||||
DBA::insert('search', $fields);
|
if (!DBA::insert('search', $fields)) {
|
||||||
info(DI::l10n()->t('Search term successfully saved.'));
|
notice(DI::l10n()->t('Search term was not saved.'));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
info(DI::l10n()->t('Search term already saved.'));
|
notice(DI::l10n()->t('Search term already saved.'));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'remove':
|
case 'remove':
|
||||||
DBA::delete('search', ['uid' => local_user(), 'term' => $search]);
|
if (!DBA::delete('search', ['uid' => local_user(), 'term' => $search])) {
|
||||||
info(DI::l10n()->t('Search term successfully removed.'));
|
notice(DI::l10n()->t('Search term was not removed.'));
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,9 +134,7 @@ class Index extends BaseSettings
|
||||||
['uid' => local_user()]
|
['uid' => local_user()]
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($result) {
|
if (!$result) {
|
||||||
info(DI::l10n()->t('Profile updated.'));
|
|
||||||
} else {
|
|
||||||
notice(DI::l10n()->t('Profile couldn\'t be updated.'));
|
notice(DI::l10n()->t('Profile couldn\'t be updated.'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,9 +93,7 @@ class Index extends BaseSettings
|
||||||
|
|
||||||
$filename = '';
|
$filename = '';
|
||||||
|
|
||||||
if (Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 0)) {
|
if (!Photo::store($Image, local_user(), 0, $resource_id, $filename, DI::l10n()->t('Profile Photos'), 0)) {
|
||||||
info(DI::l10n()->t('Image uploaded successfully.'));
|
|
||||||
} else {
|
|
||||||
notice(DI::l10n()->t('Image upload failed.'));
|
notice(DI::l10n()->t('Image upload failed.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue