3 * @file mod/profiles.php
7 use Friendica\BaseModule;
8 use Friendica\Content\ContactSelector;
9 use Friendica\Content\Feature;
10 use Friendica\Content\Nav;
11 use Friendica\Core\Config;
12 use Friendica\Core\Hook;
13 use Friendica\Core\L10n;
14 use Friendica\Core\PConfig;
15 use Friendica\Core\Renderer;
16 use Friendica\Core\System;
17 use Friendica\Core\Worker;
18 use Friendica\Database\DBA;
20 use Friendica\Model\Contact;
21 use Friendica\Model\GContact;
22 use Friendica\Model\Profile;
23 use Friendica\Model\User;
24 use Friendica\Module\Security\Login;
25 use Friendica\Network\Probe;
26 use Friendica\Util\DateTimeFormat;
27 use Friendica\Util\Strings;
28 use Friendica\Util\Temporal;
30 function profiles_init(App $a) {
32 Nav::setSelected('profiles');
38 if (($a->argc > 2) && ($a->argv[1] === "drop") && intval($a->argv[2])) {
39 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d AND `is-default` = 0 LIMIT 1",
43 if (! DBA::isResult($r)) {
44 notice(L10n::t('Profile not found.') . EOL);
45 DI::baseUrl()->redirect('profiles');
49 BaseModule::checkFormSecurityTokenRedirectOnError('/profiles', 'profile_drop', 't');
51 // move every contact using this profile as their default to the user default
53 q("UPDATE `contact` SET `profile-id` = (SELECT `profile`.`id` AS `profile-id` FROM `profile` WHERE `profile`.`is-default` = 1 AND `profile`.`uid` = %d LIMIT 1) WHERE `profile-id` = %d AND `uid` = %d ",
58 q("DELETE FROM `profile` WHERE `id` = %d AND `uid` = %d",
62 if (DBA::isResult($r)) {
63 info(L10n::t('Profile deleted.').EOL);
66 DI::baseUrl()->redirect('profiles');
70 if (($a->argc > 1) && ($a->argv[1] === 'new')) {
72 BaseModule::checkFormSecurityTokenRedirectOnError('/profiles', 'profile_new', 't');
74 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
75 intval(local_user()));
77 $num_profiles = (DBA::isResult($r0) ? count($r0) : 0);
79 $name = L10n::t('Profile-') . ($num_profiles + 1);
81 $r1 = q("SELECT `name`, `photo`, `thumb` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
82 intval(local_user()));
84 q("INSERT INTO `profile` (`uid` , `profile-name` , `name`, `photo`, `thumb`)
85 VALUES ( %d, '%s', '%s', '%s', '%s' )",
88 DBA::escape($r1[0]['name']),
89 DBA::escape($r1[0]['photo']),
90 DBA::escape($r1[0]['thumb'])
93 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
98 info(L10n::t('New profile created.') . EOL);
99 if (DBA::isResult($r3) && count($r3) == 1) {
100 DI::baseUrl()->redirect('profiles/' . $r3[0]['id']);
103 DI::baseUrl()->redirect('profiles');
106 if (($a->argc > 2) && ($a->argv[1] === 'clone')) {
108 BaseModule::checkFormSecurityTokenRedirectOnError('/profiles', 'profile_clone', 't');
110 $r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
111 intval(local_user()));
113 $num_profiles = (DBA::isResult($r0) ? count($r0) : 0);
115 $name = L10n::t('Profile-') . ($num_profiles + 1);
116 $r1 = q("SELECT * FROM `profile` WHERE `uid` = %d AND `id` = %d LIMIT 1",
117 intval(local_user()),
120 if(! DBA::isResult($r1)) {
121 notice(L10n::t('Profile unavailable to clone.') . EOL);
125 $r1[0]['is-default'] = 0;
126 $r1[0]['publish'] = 0;
127 $r1[0]['net-publish'] = 0;
128 $r1[0]['profile-name'] = DBA::escape($name);
130 DBA::insert('profile', $r1[0]);
132 $r3 = q("SELECT `id` FROM `profile` WHERE `uid` = %d AND `profile-name` = '%s' LIMIT 1",
133 intval(local_user()),
136 info(L10n::t('New profile created.') . EOL);
137 if ((DBA::isResult($r3)) && (count($r3) == 1)) {
138 DI::baseUrl()->redirect('profiles/'.$r3[0]['id']);
141 DI::baseUrl()->redirect('profiles');
143 return; // NOTREACHED
147 if (($a->argc > 1) && (intval($a->argv[1]))) {
148 $r = q("SELECT id FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
152 if (! DBA::isResult($r)) {
153 notice(L10n::t('Profile not found.') . EOL);
157 Profile::load($a, $a->user['nickname'], $r[0]['id']);
161 function profile_clean_keywords($keywords)
163 $keywords = str_replace(",", " ", $keywords);
164 $keywords = explode(" ", $keywords);
167 foreach ($keywords as $keyword) {
168 $keyword = trim(strtolower($keyword));
169 $keyword = trim($keyword, "#");
170 if ($keyword != "") {
171 $cleaned[] = $keyword;
175 $keywords = implode(", ", $cleaned);
180 function profiles_post(App $a) {
182 if (! local_user()) {
183 notice(L10n::t('Permission denied.') . EOL);
187 $namechanged = false;
189 Hook::callAll('profile_post', $_POST);
191 if (($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
192 $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
196 if (! DBA::isResult($orig)) {
197 notice(L10n::t('Profile not found.') . EOL);
201 BaseModule::checkFormSecurityTokenRedirectOnError('/profiles', 'profile_edit');
203 $is_default = (($orig[0]['is-default']) ? 1 : 0);
205 $profile_name = Strings::escapeTags(trim($_POST['profile_name']));
206 if (! strlen($profile_name)) {
207 notice(L10n::t('Profile Name is required.') . EOL);
211 $dob = !empty($_POST['dob']) ? Strings::escapeHtml(trim($_POST['dob'])) : '0000-00-00';
213 $y = substr($dob, 0, 4);
214 if ((! ctype_digit($y)) || ($y < 1900)) {
217 $ignore_year = false;
219 if (!in_array($dob, ['0000-00-00', DBA::NULL_DATE])) {
220 if (strpos($dob, '0000-') === 0 || strpos($dob, '0001-') === 0) {
222 $dob = substr($dob, 5);
226 $dob = '0000-' . DateTimeFormat::utc('1900-' . $dob, 'm-d');
228 $dob = DateTimeFormat::utc($dob, 'Y-m-d');
232 $name = Strings::escapeTags(trim($_POST['name']));
234 if (! strlen($name)) {
238 if ($orig[0]['name'] != $name) {
242 $pdesc = Strings::escapeTags(trim($_POST['pdesc'] ?? ''));
243 $gender = Strings::escapeTags(trim($_POST['gender'] ?? ''));
244 $address = Strings::escapeTags(trim($_POST['address'] ?? ''));
245 $locality = Strings::escapeTags(trim($_POST['locality'] ?? ''));
246 $region = Strings::escapeTags(trim($_POST['region'] ?? ''));
247 $postal_code = Strings::escapeTags(trim($_POST['postal_code'] ?? ''));
248 $country_name = Strings::escapeTags(trim($_POST['country_name'] ?? ''));
249 $pub_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['pub_keywords'] ?? '')));
250 $prv_keywords = profile_clean_keywords(Strings::escapeTags(trim($_POST['prv_keywords'] ?? '')));
251 $marital = Strings::escapeTags(trim($_POST['marital'] ?? ''));
252 $howlong = Strings::escapeTags(trim($_POST['howlong'] ?? ''));
254 $with = (!empty($_POST['with']) ? Strings::escapeTags(trim($_POST['with'])) : '');
256 if (! strlen($howlong)) {
257 $howlong = DBA::NULL_DATETIME;
259 $howlong = DateTimeFormat::convert($howlong, 'UTC', date_default_timezone_get());
261 // linkify the relationship target if applicable
263 $withchanged = false;
266 if ($with != strip_tags($orig[0]['with'])) {
270 if (strpos($lookup, '@') === 0) {
271 $lookup = substr($lookup, 1);
273 $lookup = str_replace('_',' ', $lookup);
274 if (strpos($lookup, '@') || (strpos($lookup, 'http://'))) {
276 $links = @Probe::lrdd($lookup);
278 foreach ($links as $link) {
279 if ($link['@attributes']['rel'] === 'http://webfinger.net/rel/profile-page') {
280 $prf = $link['@attributes']['href'];
287 $r = q("SELECT * FROM `contact` WHERE `name` = '%s' AND `uid` = %d LIMIT 1",
288 DBA::escape($newname),
291 if (! DBA::isResult($r)) {
292 $r = q("SELECT * FROM `contact` WHERE `nick` = '%s' AND `uid` = %d LIMIT 1",
293 DBA::escape($lookup),
297 if (DBA::isResult($r)) {
299 $newname = $r[0]['name'];
304 $with = str_replace($lookup, '<a href="' . $prf . '">' . $newname . '</a>', $with);
305 if (strpos($with, '@') === 0) {
306 $with = substr($with, 1);
310 $with = $orig[0]['with'];
314 /// @TODO Not flexible enough for later expansion, let's have more OOP here
315 $sexual = Strings::escapeTags(trim($_POST['sexual']));
316 $xmpp = Strings::escapeTags(trim($_POST['xmpp']));
317 $homepage = Strings::escapeTags(trim($_POST['homepage']));
318 if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) {
319 // neither http nor https in URL, add them
320 $homepage = 'http://'.$homepage;
322 $hometown = Strings::escapeTags(trim($_POST['hometown']));
323 $politic = Strings::escapeTags(trim($_POST['politic']));
324 $religion = Strings::escapeTags(trim($_POST['religion']));
326 $likes = Strings::escapeHtml(trim($_POST['likes']));
327 $dislikes = Strings::escapeHtml(trim($_POST['dislikes']));
329 $about = Strings::escapeHtml(trim($_POST['about']));
330 $interest = Strings::escapeHtml(trim($_POST['interest']));
331 $contact = Strings::escapeHtml(trim($_POST['contact']));
332 $music = Strings::escapeHtml(trim($_POST['music']));
333 $book = Strings::escapeHtml(trim($_POST['book']));
334 $tv = Strings::escapeHtml(trim($_POST['tv']));
335 $film = Strings::escapeHtml(trim($_POST['film']));
336 $romance = Strings::escapeHtml(trim($_POST['romance']));
337 $work = Strings::escapeHtml(trim($_POST['work']));
338 $education = Strings::escapeHtml(trim($_POST['education']));
340 $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
342 PConfig::set(local_user(), 'system', 'detailled_profile', !empty($_POST['detailed_profile']) ? 1: 0);
346 if ($marital != $orig[0]['marital']) {
347 $changes[] = '[color=#ff0000]♥[/color] ' . L10n::t('Marital Status');
350 $changes[] = '[color=#ff0000]♥[/color] ' . L10n::t('Romantic Partner');
352 if ($likes != $orig[0]['likes']) {
353 $changes[] = L10n::t('Likes');
355 if ($dislikes != $orig[0]['dislikes']) {
356 $changes[] = L10n::t('Dislikes');
358 if ($work != $orig[0]['work']) {
359 $changes[] = L10n::t('Work/Employment');
361 if ($religion != $orig[0]['religion']) {
362 $changes[] = L10n::t('Religion');
364 if ($politic != $orig[0]['politic']) {
365 $changes[] = L10n::t('Political Views');
367 if ($gender != $orig[0]['gender']) {
368 $changes[] = L10n::t('Gender');
370 if ($sexual != $orig[0]['sexual']) {
371 $changes[] = L10n::t('Sexual Preference');
373 if ($xmpp != $orig[0]['xmpp']) {
374 $changes[] = L10n::t('XMPP');
376 if ($homepage != $orig[0]['homepage']) {
377 $changes[] = L10n::t('Homepage');
379 if ($interest != $orig[0]['interest']) {
380 $changes[] = L10n::t('Interests');
382 if ($address != $orig[0]['address']) {
383 $changes[] = L10n::t('Address');
384 // New address not sent in notifications, potential privacy issues
385 // in case this leaks to unintended recipients. Yes, it's in the public
386 // profile but that doesn't mean we have to broadcast it to everybody.
388 if ($locality != $orig[0]['locality'] || $region != $orig[0]['region']
389 || $country_name != $orig[0]['country-name']) {
390 $changes[] = L10n::t('Location');
394 $r = q("UPDATE `profile`
395 SET `profile-name` = '%s',
403 `postal-code` = '%s',
404 `country-name` = '%s',
414 `pub_keywords` = '%s',
415 `prv_keywords` = '%s',
429 WHERE `id` = %d AND `uid` = %d",
430 DBA::escape($profile_name),
433 DBA::escape($gender),
435 DBA::escape($address),
436 DBA::escape($locality),
437 DBA::escape($region),
438 DBA::escape($postal_code),
439 DBA::escape($country_name),
440 DBA::escape($marital),
442 DBA::escape($howlong),
443 DBA::escape($sexual),
445 DBA::escape($homepage),
446 DBA::escape($hometown),
447 DBA::escape($politic),
448 DBA::escape($religion),
449 DBA::escape($pub_keywords),
450 DBA::escape($prv_keywords),
452 DBA::escape($dislikes),
454 DBA::escape($interest),
455 DBA::escape($contact),
460 DBA::escape($romance),
462 DBA::escape($education),
463 intval($hide_friends),
468 /// @TODO decide to use DBA::isResult() here and check $r
470 info(L10n::t('Profile updated.') . EOL);
475 q("UPDATE `user` set `username` = '%s' where `uid` = %d",
481 Contact::updateSelfFromUserID(local_user());
483 // Update global directory in background
484 $url = $_SESSION['my_url'];
485 if ($url && strlen(Config::get('system', 'directory'))) {
486 Worker::add(PRIORITY_LOW, "Directory", $url);
489 Worker::add(PRIORITY_LOW, 'ProfileUpdate', local_user());
491 // Update the global contact for the user
492 GContact::updateForUser(local_user());
497 function profiles_content(App $a) {
499 if (! local_user()) {
500 notice(L10n::t('Permission denied.') . EOL);
501 return Login::form();
506 if (($a->argc > 1) && (intval($a->argv[1]))) {
507 $r = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
511 if (! DBA::isResult($r)) {
512 notice(L10n::t('Profile not found.') . EOL);
516 DI::page()['htmlhead'] .= Renderer::replaceMacros(Renderer::getMarkupTemplate('profed_head.tpl'), [
517 '$baseurl' => System::baseUrl(true),
520 $opt_tpl = Renderer::getMarkupTemplate("profile-hide-friends.tpl");
521 $hide_friends = Renderer::replaceMacros($opt_tpl,[
523 'hide-friends', //Name
524 L10n::t('Hide contacts and friends:'), //Label
525 !!$r[0]['hide-friends'], //Value
527 [L10n::t('No'), L10n::t('Yes')] //Off - On strings
529 '$desc' => L10n::t('Hide your contact/friend list from viewers of this profile?'),
530 '$yes_str' => L10n::t('Yes'),
531 '$no_str' => L10n::t('No'),
532 '$yes_selected' => (($r[0]['hide-friends']) ? " checked=\"checked\" " : ""),
533 '$no_selected' => (($r[0]['hide-friends'] == 0) ? " checked=\"checked\" " : "")
536 $personal_account = !(in_array($a->user["page-flags"],
537 [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]));
539 $detailed_profile = (PConfig::get(local_user(), 'system', 'detailled_profile') AND $personal_account);
541 $is_default = (($r[0]['is-default']) ? 1 : 0);
542 $tpl = Renderer::getMarkupTemplate("profile_edit.tpl");
543 $o .= Renderer::replaceMacros($tpl, [
544 '$personal_account' => $personal_account,
545 '$detailled_profile' => $detailed_profile,
548 'detailed_profile', //Name
549 L10n::t('Show more profile fields:'), //Label
550 $detailed_profile, //Value
552 [L10n::t('No'), L10n::t('Yes')] //Off - On strings
555 '$multi_profiles' => Feature::isEnabled(local_user(), 'multi_profiles'),
556 '$form_security_token' => BaseModule::getFormSecurityToken("profile_edit"),
557 '$form_security_token_photo' => BaseModule::getFormSecurityToken("profile_photo"),
558 '$profile_clone_link' => ((Feature::isEnabled(local_user(), 'multi_profiles')) ? 'profiles/clone/' . $r[0]['id'] . '?t=' . BaseModule::getFormSecurityToken("profile_clone") : ""),
559 '$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t=' . BaseModule::getFormSecurityToken("profile_drop"),
561 '$profile_action' => L10n::t('Profile Actions'),
562 '$banner' => L10n::t('Edit Profile Details'),
563 '$submit' => L10n::t('Submit'),
564 '$profpic' => L10n::t('Change Profile Photo'),
565 '$profpiclink' => '/photos/' . $a->user['nickname'],
566 '$viewprof' => L10n::t('View this profile'),
567 '$viewallprof' => L10n::t('View all profiles'),
568 '$editvis' => L10n::t('Edit visibility'),
569 '$cr_prof' => L10n::t('Create a new profile using these settings'),
570 '$cl_prof' => L10n::t('Clone this profile'),
571 '$del_prof' => L10n::t('Delete this profile'),
573 '$lbl_basic_section' => L10n::t('Basic information'),
574 '$lbl_picture_section' => L10n::t('Profile picture'),
575 '$lbl_location_section' => L10n::t('Location'),
576 '$lbl_preferences_section' => L10n::t('Preferences'),
577 '$lbl_status_section' => L10n::t('Status information'),
578 '$lbl_about_section' => L10n::t('Additional information'),
579 '$lbl_interests_section' => L10n::t('Interests'),
580 '$lbl_personal_section' => L10n::t('Personal'),
581 '$lbl_relation_section' => L10n::t('Relation'),
582 '$lbl_miscellaneous_section' => L10n::t('Miscellaneous'),
584 '$lbl_profile_photo' => L10n::t('Upload Profile Photo'),
585 '$lbl_gender' => L10n::t('Your Gender:'),
586 '$lbl_marital' => L10n::t('<span class="heart">♥</span> Marital Status:'),
587 '$lbl_sexual' => L10n::t('Sexual Preference:'),
588 '$lbl_ex2' => L10n::t('Example: fishing photography software'),
590 '$disabled' => (($is_default) ? 'onclick="return false;" style="color: #BBBBFF;"' : ''),
591 '$baseurl' => System::baseUrl(true),
592 '$profile_id' => $r[0]['id'],
593 '$profile_name' => ['profile_name', L10n::t('Profile Name:'), $r[0]['profile-name'], L10n::t('Required'), '*'],
594 '$is_default' => $is_default,
595 '$default' => (($is_default) ? '<p id="profile-edit-default-desc">' . L10n::t('This is your <strong>public</strong> profile.<br />It <strong>may</strong> be visible to anybody using the internet.') . '</p>' : ""),
596 '$name' => ['name', L10n::t('Your Full Name:'), $r[0]['name']],
597 '$pdesc' => ['pdesc', L10n::t('Title/Description:'), $r[0]['pdesc']],
598 '$dob' => Temporal::getDateofBirthField($r[0]['dob'], $a->user['timezone']),
599 '$hide_friends' => $hide_friends,
600 '$address' => ['address', L10n::t('Street Address:'), $r[0]['address']],
601 '$locality' => ['locality', L10n::t('Locality/City:'), $r[0]['locality']],
602 '$region' => ['region', L10n::t('Region/State:'), $r[0]['region']],
603 '$postal_code' => ['postal_code', L10n::t('Postal/Zip Code:'), $r[0]['postal-code']],
604 '$country_name' => ['country_name', L10n::t('Country:'), $r[0]['country-name']],
605 '$age' => ((intval($r[0]['dob'])) ? '(' . L10n::t('Age: ') . Temporal::getAgeByTimezone($r[0]['dob'],$a->user['timezone'],$a->user['timezone']) . ')' : ''),
606 '$gender' => L10n::t(ContactSelector::gender($r[0]['gender'])),
607 '$marital' => ['selector' => ContactSelector::maritalStatus($r[0]['marital']), 'value' => L10n::t($r[0]['marital'])],
608 '$with' => ['with', L10n::t("Who: \x28if applicable\x29"), strip_tags($r[0]['with']), L10n::t('Examples: cathy123, Cathy Williams, cathy@example.com')],
609 '$howlong' => ['howlong', L10n::t('Since [date]:'), ($r[0]['howlong'] <= DBA::NULL_DATETIME ? '' : DateTimeFormat::local($r[0]['howlong']))],
610 '$sexual' => ['selector' => ContactSelector::sexualPreference($r[0]['sexual']), 'value' => L10n::t($r[0]['sexual'])],
611 '$about' => ['about', L10n::t('Tell us about yourself...'), $r[0]['about']],
612 '$xmpp' => ['xmpp', L10n::t("XMPP \x28Jabber\x29 address:"), $r[0]['xmpp'], L10n::t("The XMPP address will be propagated to your contacts so that they can follow you.")],
613 '$homepage' => ['homepage', L10n::t('Homepage URL:'), $r[0]['homepage']],
614 '$hometown' => ['hometown', L10n::t('Hometown:'), $r[0]['hometown']],
615 '$politic' => ['politic', L10n::t('Political Views:'), $r[0]['politic']],
616 '$religion' => ['religion', L10n::t('Religious Views:'), $r[0]['religion']],
617 '$pub_keywords' => ['pub_keywords', L10n::t('Public Keywords:'), $r[0]['pub_keywords'], L10n::t("\x28Used for suggesting potential friends, can be seen by others\x29")],
618 '$prv_keywords' => ['prv_keywords', L10n::t('Private Keywords:'), $r[0]['prv_keywords'], L10n::t("\x28Used for searching profiles, never shown to others\x29")],
619 '$likes' => ['likes', L10n::t('Likes:'), $r[0]['likes']],
620 '$dislikes' => ['dislikes', L10n::t('Dislikes:'), $r[0]['dislikes']],
621 '$music' => ['music', L10n::t('Musical interests'), $r[0]['music']],
622 '$book' => ['book', L10n::t('Books, literature'), $r[0]['book']],
623 '$tv' => ['tv', L10n::t('Television'), $r[0]['tv']],
624 '$film' => ['film', L10n::t('Film/dance/culture/entertainment'), $r[0]['film']],
625 '$interest' => ['interest', L10n::t('Hobbies/Interests'), $r[0]['interest']],
626 '$romance' => ['romance', L10n::t('Love/romance'), $r[0]['romance']],
627 '$work' => ['work', L10n::t('Work/employment'), $r[0]['work']],
628 '$education' => ['education', L10n::t('School/education'), $r[0]['education']],
629 '$contact' => ['contact', L10n::t('Contact information and Social Networks'), $r[0]['contact']],
632 $arr = ['profile' => $r[0], 'entry' => $o];
633 Hook::callAll('profile_edit', $arr);
637 // If we don't support multi profiles, don't display this list.
638 if (!Feature::isEnabled(local_user(), 'multi_profiles')) {
639 $r = q("SELECT * FROM `profile` WHERE `uid` = %d AND `is-default`=1",
642 if (DBA::isResult($r)) {
643 //Go to the default profile.
644 DI::baseUrl()->redirect('profiles/' . $r[0]['id']);
648 $r = q("SELECT * FROM `profile` WHERE `uid` = %d",
651 if (DBA::isResult($r)) {
653 $tpl = Renderer::getMarkupTemplate('profile_entry.tpl');
656 foreach ($r as $rr) {
657 $profiles .= Renderer::replaceMacros($tpl, [
658 '$photo' => DI::baseUrl()->remove($rr['thumb']),
660 '$alt' => L10n::t('Profile Image'),
661 '$profile_name' => $rr['profile-name'],
662 '$visible' => (($rr['is-default']) ? '<strong>' . L10n::t('visible to everybody') . '</strong>'
663 : '<a href="'.'profperm/'.$rr['id'].'" />' . L10n::t('Edit visibility') . '</a>')
667 $tpl_header = Renderer::getMarkupTemplate('profile_listing_header.tpl');
668 $o .= Renderer::replaceMacros($tpl_header,[
669 '$header' => L10n::t('Edit/Manage Profiles'),
670 '$chg_photo' => L10n::t('Change profile photo'),
671 '$cr_new' => L10n::t('Create New Profile'),
672 '$cr_new_link' => 'profiles/new?t=' . BaseModule::getFormSecurityToken("profile_new"),
673 '$profiles' => $profiles