Move Module\Profile to Module\Profile\Index

- Move /profiles to Module\Settings\Profile\Index
This commit is contained in:
Hypolite Petovan 2019-10-27 10:08:14 -04:00
parent 3c1f174c7f
commit d1be68b754
25 changed files with 1007 additions and 1359 deletions

View file

@ -202,7 +202,7 @@ class Profile
if (local_user() && local_user() == $a->profile['uid'] && $profiledata) {
DI::page()['aside'] .= Renderer::replaceMacros(
Renderer::getMarkupTemplate('profile_edlink.tpl'),
Renderer::getMarkupTemplate('settings/profile/link.tpl'),
[
'$editprofile' => DI::l10n()->t('Edit profile'),
'$profid' => $a->profile['id']
@ -388,40 +388,12 @@ class Profile
// show edit profile to yourself
if (!$is_contact && $local_user_is_self) {
if (Feature::isEnabled(local_user(), 'multi_profiles')) {
$profile['edit'] = [DI::baseUrl() . '/profiles', DI::l10n()->t('Profiles'), '', DI::l10n()->t('Manage/edit profiles')];
$r = q(
"SELECT * FROM `profile` WHERE `uid` = %d",
local_user()
);
$profile['menu'] = [
'chg_photo' => DI::l10n()->t('Change profile photo'),
'cr_new' => DI::l10n()->t('Create New Profile'),
'entries' => [],
];
if (DBA::isResult($r)) {
foreach ($r as $rr) {
$profile['menu']['entries'][] = [
'photo' => $rr['thumb'],
'id' => $rr['id'],
'alt' => DI::l10n()->t('Profile Image'),
'profile_name' => $rr['profile-name'],
'isdefault' => $rr['is-default'],
'visibile_to_everybody' => DI::l10n()->t('visible to everybody'),
'edit_visibility' => DI::l10n()->t('Edit visibility'),
];
}
}
} else {
$profile['edit'] = [DI::baseUrl() . '/profiles/' . $profile['id'], DI::l10n()->t('Edit profile'), '', DI::l10n()->t('Edit profile')];
$profile['menu'] = [
'chg_photo' => DI::l10n()->t('Change profile photo'),
'cr_new' => null,
'entries' => [],
];
}
$profile['edit'] = [DI::baseUrl() . '/settings/profile', DI::l10n()->t('Edit profile'), '', DI::l10n()->t('Edit profile')];
$profile['menu'] = [
'chg_photo' => DI::l10n()->t('Change profile photo'),
'cr_new' => null,
'entries' => [],
];
}
// Fetch the account type
@ -870,7 +842,7 @@ class Profile
}
if ($a->profile['uid'] == local_user()) {
$profile['edit'] = [DI::baseUrl() . '/profiles/' . $a->profile['id'], DI::l10n()->t('Edit profile'), '', DI::l10n()->t('Edit profile')];
$profile['edit'] = [DI::baseUrl() . '/settings/profile', DI::l10n()->t('Edit profile'), '', DI::l10n()->t('Edit profile')];
}
$tpl = Renderer::getMarkupTemplate('profile/advanced.tpl');
@ -902,22 +874,22 @@ class Profile
$baseProfileUrl = DI::baseUrl() . '/profile/' . $nickname;
$tabs = [
[
'label' => DI::l10n()->t('Status'),
'url' => $baseProfileUrl,
'sel' => !$current ? 'active' : '',
'title' => DI::l10n()->t('Status Messages and Posts'),
'id' => 'status-tab',
'accesskey' => 'm',
],
[
'label' => DI::l10n()->t('Profile'),
'url' => $baseProfileUrl . '/?tab=profile',
'url' => $baseProfileUrl,
'sel' => $current == 'profile' ? 'active' : '',
'title' => DI::l10n()->t('Profile Details'),
'id' => 'profile-tab',
'accesskey' => 'r',
],
[
'label' => DI::l10n()->t('Status'),
'url' => $baseProfileUrl . '/status',
'sel' => $current == 'status' ? 'active' : '',
'title' => DI::l10n()->t('Status Messages and Posts'),
'id' => 'status-tab',
'accesskey' => 'm',
],
[
'label' => DI::l10n()->t('Photos'),
'url' => DI::baseUrl() . '/photos/' . $nickname,
@ -970,17 +942,7 @@ class Profile
];
}
if (!empty($_SESSION['new_member']) && $is_owner) {
$tabs[] = [
'label' => DI::l10n()->t('Tips for New Members'),
'url' => DI::baseUrl() . '/newmember',
'sel' => false,
'title' => DI::l10n()->t('Tips for New Members'),
'id' => 'newmember-tab',
];
}
if ($is_owner || empty($a->profile['hide-friends'])) {
if (empty($a->profile['hide-friends'])) {
$tabs[] = [
'label' => DI::l10n()->t('Contacts'),
'url' => $baseProfileUrl . '/contacts',
@ -991,7 +953,18 @@ class Profile
];
}
if (!empty($_SESSION['new_member']) && $is_owner) {
$tabs[] = [
'label' => DI::l10n()->t('Tips for New Members'),
'url' => DI::baseUrl() . '/newmember',
'sel' => false,
'title' => DI::l10n()->t('Tips for New Members'),
'id' => 'newmember-tab',
];
}
$arr = ['is_owner' => $is_owner, 'nickname' => $nickname, 'tab' => $current, 'tabs' => $tabs];
Hook::callAll('profile_tabs', $arr);
$tpl = Renderer::getMarkupTemplate('common_tabs.tpl');