<?php
+/**
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
namespace Friendica\Module;
Hook::callAll('contact_edit_post', $_POST);
- $profile_id = intval($_POST['profile-assign'] ?? 0);
- if ($profile_id) {
- if (!DBA::exists('profile', ['id' => $profile_id, 'uid' => local_user()])) {
- notice(DI::l10n()->t('Could not locate selected profile.') . EOL);
- return;
- }
- }
-
$hidden = !empty($_POST['hidden']);
$notify = !empty($_POST['notify']);
$info = Strings::escapeHtml(trim($_POST['info'] ?? ''));
$r = DBA::update('contact', [
- 'profile-id' => $profile_id,
'priority' => $priority,
'info' => $info,
'hidden' => $hidden,
if (($a->argc == 3) && intval($a->argv[1]) && in_array($a->argv[2], ['posts', 'conversations'])) {
DI::baseUrl()->redirect('profile/' . $contact['nick']);
} else {
- DI::baseUrl()->redirect('profile/' . $contact['nick'] . '?tab=profile');
+ DI::baseUrl()->redirect('profile/' . $contact['nick'] . '/profile');
}
}
if ($cmd === 'updateprofile' && ($orig_record['uid'] != 0)) {
self::updateContactFromProbe($contact_id);
- DI::baseUrl()->redirect('crepair/' . $contact_id);
+ DI::baseUrl()->redirect('contact/' . $contact_id . '/advanced/');
// NOTREACHED
}
$poll_interval = ContactSelector::pollInterval($contact['priority'], !$poll_enabled);
}
- $profile_select = null;
- if ($contact['network'] == Protocol::DFRN) {
- $profile_select = ContactSelector::profileAssign($contact['profile-id'], $contact['network'] !== Protocol::DFRN);
- }
-
// Load contactact related actions like hide, suggest, delete and others
$contact_actions = self::getContactActions($contact);
if ($contact['uid'] != 0) {
- $lbl_vis1 = DI::l10n()->t('Profile Visibility');
$lbl_info1 = DI::l10n()->t('Contact Information / Notes');
$contact_settings_label = DI::l10n()->t('Contact Settings');
} else {
- $lbl_vis1 = null;
$lbl_info1 = null;
$contact_settings_label = null;
}
'$header' => DI::l10n()->t('Contact'),
'$tab_str' => $tab_str,
'$submit' => DI::l10n()->t('Submit'),
- '$lbl_vis1' => $lbl_vis1,
- '$lbl_vis2' => DI::l10n()->t('Please choose the profile you would like to display to %s when viewing your profile securely.', $contact['name']),
'$lbl_info1' => $lbl_info1,
'$lbl_info2' => DI::l10n()->t('Their personal note'),
'$reason' => trim(Strings::escapeTags($contact['reason'])),
'$visit' => DI::l10n()->t('Visit %s\'s profile [%s]', $contact['name'], $contact['url']),
'$blockunblock' => DI::l10n()->t('Block/Unblock contact'),
'$ignorecont' => DI::l10n()->t('Ignore contact'),
- '$lblcrepair' => DI::l10n()->t('Repair URL settings'),
'$lblrecent' => DI::l10n()->t('View conversations'),
'$lblsuggest' => $lblsuggest,
'$nettype' => $nettype,
'$updpub' => DI::l10n()->t('Update public posts'),
'$last_update' => $last_update,
'$udnow' => DI::l10n()->t('Update now'),
- '$profile_select' => $profile_select,
'$contact_id' => $contact['id'],
'$block_text' => ($contact['blocked'] ? DI::l10n()->t('Unblock') : DI::l10n()->t('Block')),
'$ignore_text' => ($contact['readonly'] ? DI::l10n()->t('Unignore') : DI::l10n()->t('Ignore')),
}
DBA::close($stmt);
- $pager = new Pager(DI::args()->getQueryString());
+ $pager = new Pager(DI::l10n(), DI::args()->getQueryString());
$sql_values[] = $pager->getStart();
$sql_values[] = $pager->getItemsPerPage();
if (!empty($contact['uid'])) {
$tabs[] = ['label' => DI::l10n()->t('Advanced'),
- 'url' => 'crepair/' . $contact['id'],
+ 'url' => 'contact/' . $contact['id'] . '/advanced/',
'sel' => (($active_tab == 6) ? 'active' : ''),
'title' => DI::l10n()->t('Advanced Contact Settings'),
'id' => 'advanced-tab',
$profiledata = Model\Contact::getDetailsByURL($contact['url']);
- Model\Profile::load($a, '', 0, $profiledata, true);
+ Model\Profile::load($a, '', $profiledata, true);
$o .= Model\Contact::getPostsFromUrl($contact['url'], true, $update);
}
$profiledata['remoteconnect'] = DI::baseUrl() . '/follow?url=' . urlencode($profiledata['url']);
}
- Model\Profile::load($a, '', 0, $profiledata, true);
+ Model\Profile::load($a, '', $profiledata, true);
$o .= Model\Contact::getPostsFromUrl($contact['url']);
}