]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
moving boot::check_addons to Friendica\Core\Addon::check
[friendica.git] / mod / settings.php
index 6c7d0fafe77d5a3d9b0c49be66d40c1b5c421f7d..78fa446ce0372dd0fa65a419db4286e79fd1848b 100644 (file)
@@ -60,6 +60,13 @@ function settings_init(App $a)
                ],
        ];
 
+       $tabs[] =       [
+               'label' => L10n::t('Profiles'),
+               'url'   => 'profiles',
+               'selected'      => (($a->argc == 1) && ($a->argv[0] === 'profiles')?'active':''),
+               'accesskey' => 'p',
+       ];
+
        if (Feature::get()) {
                $tabs[] =       [
                                        'label' => L10n::t('Additional features'),
@@ -474,14 +481,14 @@ function settings_post(App $a)
        }
 
        // Adjust the page flag if the account type doesn't fit to the page flag.
-       if (($account_type == ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE])) {
-               $page_flags = PAGE_NORMAL;
-       } elseif (($account_type == ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [PAGE_SOAPBOX])) {
-               $page_flags = PAGE_SOAPBOX;
-       } elseif (($account_type == ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [PAGE_SOAPBOX])) {
-               $page_flags = PAGE_SOAPBOX;
-       } elseif (($account_type == ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [PAGE_COMMUNITY, PAGE_PRVGROUP])) {
-               $page_flags = PAGE_COMMUNITY;
+       if (($account_type == Contact::ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [Contact::PAGE_NORMAL, Contact::PAGE_SOAPBOX, Contact::PAGE_FREELOVE])) {
+               $page_flags = Contact::PAGE_NORMAL;
+       } elseif (($account_type == Contact::ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [Contact::PAGE_SOAPBOX])) {
+               $page_flags = Contact::PAGE_SOAPBOX;
+       } elseif (($account_type == Contact::ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [Contact::PAGE_SOAPBOX])) {
+               $page_flags = Contact::PAGE_SOAPBOX;
+       } elseif (($account_type == Contact::ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [Contact::PAGE_COMMUNITY, Contact::PAGE_PRVGROUP])) {
+               $page_flags = Contact::PAGE_COMMUNITY;
        }
 
        $email_changed = false;
@@ -527,10 +534,10 @@ function settings_post(App $a)
                date_default_timezone_set($timezone);
        }
 
-       $str_group_allow   = perms2str(defaults($_POST, 'group_allow'  , ''));
-       $str_contact_allow = perms2str(defaults($_POST, 'contact_allow', ''));
-       $str_group_deny    = perms2str(defaults($_POST, 'group_deny'   , ''));
-       $str_contact_deny  = perms2str(defaults($_POST, 'contact_deny' , ''));
+       $str_group_allow   = !empty($_POST['group_allow'])   ? perms2str($_POST['group_allow'])   : '';
+       $str_contact_allow = !empty($_POST['contact_allow']) ? perms2str($_POST['contact_allow']) : '';
+       $str_group_deny    = !empty($_POST['group_deny'])    ? perms2str($_POST['group_deny'])    : '';
+       $str_contact_deny  = !empty($_POST['contact_deny'])  ? perms2str($_POST['contact_deny'])  : '';
 
        $openidserver = $a->user['openidserver'];
        //$openid = normalise_openid($openid);
@@ -558,7 +565,7 @@ function settings_post(App $a)
        PConfig::set(local_user(), 'system', 'email_textonly', $email_textonly);
        PConfig::set(local_user(), 'system', 'detailed_notif', $detailed_notif);
 
-       if ($page_flags == PAGE_PRVGROUP) {
+       if ($page_flags == Contact::PAGE_PRVGROUP) {
                $hidewall = 1;
                if (!$str_contact_allow && !$str_group_allow && !$str_contact_deny && !$str_group_deny) {
                        if ($def_gid) {
@@ -975,11 +982,6 @@ function settings_content(App $a)
                        '$theme_config' => $theme_config,
                ]);
 
-               $tpl = get_markup_template('settings/display_end.tpl');
-               $a->page['end'] .= replace_macros($tpl, [
-                       '$theme'        => ['theme', L10n::t('Display Theme:'), $theme_selected, '', $themes]
-               ]);
-
                return $o;
        }
 
@@ -1022,9 +1024,9 @@ function settings_content(App $a)
 
        // Set the account type to "Community" when the page is a community page but the account type doesn't fit
        // This is only happening on the first visit after the update
-       if (in_array($a->user['page-flags'], [PAGE_COMMUNITY, PAGE_PRVGROUP]) &&
-               ($a->user['account-type'] != ACCOUNT_TYPE_COMMUNITY))
-               $a->user['account-type'] = ACCOUNT_TYPE_COMMUNITY;
+       if (in_array($a->user['page-flags'], [Contact::PAGE_COMMUNITY, Contact::PAGE_PRVGROUP]) &&
+               ($a->user['account-type'] != Contact::ACCOUNT_TYPE_COMMUNITY))
+               $a->user['account-type'] = Contact::ACCOUNT_TYPE_COMMUNITY;
 
        $pageset_tpl = get_markup_template('settings/pagetypes.tpl');
 
@@ -1033,46 +1035,46 @@ function settings_content(App $a)
                '$user'                 => L10n::t("Personal Page Subtypes"),
                '$community'            => L10n::t("Community Forum Subtypes"),
                '$account_type'         => $a->user['account-type'],
-               '$type_person'          => ACCOUNT_TYPE_PERSON,
-               '$type_organisation'    => ACCOUNT_TYPE_ORGANISATION,
-               '$type_news'            => ACCOUNT_TYPE_NEWS,
-               '$type_community'       => ACCOUNT_TYPE_COMMUNITY,
+               '$type_person'          => Contact::ACCOUNT_TYPE_PERSON,
+               '$type_organisation'    => Contact::ACCOUNT_TYPE_ORGANISATION,
+               '$type_news'            => Contact::ACCOUNT_TYPE_NEWS,
+               '$type_community'       => Contact::ACCOUNT_TYPE_COMMUNITY,
 
-               '$account_person'       => ['account-type', L10n::t('Personal Page'), ACCOUNT_TYPE_PERSON,
+               '$account_person'       => ['account-type', L10n::t('Personal Page'), Contact::ACCOUNT_TYPE_PERSON,
                                                                        L10n::t('Account for a personal profile.'),
-                                                                       ($a->user['account-type'] == ACCOUNT_TYPE_PERSON)],
+                                                                       ($a->user['account-type'] == Contact::ACCOUNT_TYPE_PERSON)],
 
-               '$account_organisation' => ['account-type', L10n::t('Organisation Page'), ACCOUNT_TYPE_ORGANISATION,
+               '$account_organisation' => ['account-type', L10n::t('Organisation Page'), Contact::ACCOUNT_TYPE_ORGANISATION,
                                                                        L10n::t('Account for an organisation that automatically approves contact requests as "Followers".'),
-                                                                       ($a->user['account-type'] == ACCOUNT_TYPE_ORGANISATION)],
+                                                                       ($a->user['account-type'] == Contact::ACCOUNT_TYPE_ORGANISATION)],
 
-               '$account_news'         => ['account-type', L10n::t('News Page'), ACCOUNT_TYPE_NEWS,
+               '$account_news'         => ['account-type', L10n::t('News Page'), Contact::ACCOUNT_TYPE_NEWS,
                                                                        L10n::t('Account for a news reflector that automatically approves contact requests as "Followers".'),
-                                                                       ($a->user['account-type'] == ACCOUNT_TYPE_NEWS)],
+                                                                       ($a->user['account-type'] == Contact::ACCOUNT_TYPE_NEWS)],
 
-               '$account_community'    => ['account-type', L10n::t('Community Forum'), ACCOUNT_TYPE_COMMUNITY,
+               '$account_community'    => ['account-type', L10n::t('Community Forum'), Contact::ACCOUNT_TYPE_COMMUNITY,
                                                                        L10n::t('Account for community discussions.'),
-                                                                       ($a->user['account-type'] == ACCOUNT_TYPE_COMMUNITY)],
+                                                                       ($a->user['account-type'] == Contact::ACCOUNT_TYPE_COMMUNITY)],
 
-               '$page_normal'          => ['page-flags', L10n::t('Normal Account Page'), PAGE_NORMAL,
+               '$page_normal'          => ['page-flags', L10n::t('Normal Account Page'), Contact::PAGE_NORMAL,
                                                                        L10n::t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),
-                                                                       ($a->user['page-flags'] == PAGE_NORMAL)],
+                                                                       ($a->user['page-flags'] == Contact::PAGE_NORMAL)],
 
-               '$page_soapbox'         => ['page-flags', L10n::t('Soapbox Page'), PAGE_SOAPBOX,
+               '$page_soapbox'         => ['page-flags', L10n::t('Soapbox Page'), Contact::PAGE_SOAPBOX,
                                                                        L10n::t('Account for a public profile that automatically approves contact requests as "Followers".'),
-                                                                       ($a->user['page-flags'] == PAGE_SOAPBOX)],
+                                                                       ($a->user['page-flags'] == Contact::PAGE_SOAPBOX)],
 
-               '$page_community'       => ['page-flags', L10n::t('Public Forum'), PAGE_COMMUNITY,
+               '$page_community'       => ['page-flags', L10n::t('Public Forum'), Contact::PAGE_COMMUNITY,
                                                                        L10n::t('Automatically approves all contact requests.'),
-                                                                       ($a->user['page-flags'] == PAGE_COMMUNITY)],
+                                                                       ($a->user['page-flags'] == Contact::PAGE_COMMUNITY)],
 
-               '$page_freelove'        => ['page-flags', L10n::t('Automatic Friend Page'), PAGE_FREELOVE,
+               '$page_freelove'        => ['page-flags', L10n::t('Automatic Friend Page'), Contact::PAGE_FREELOVE,
                                                                        L10n::t('Account for a popular profile that automatically approves contact requests as "Friends".'),
-                                                                       ($a->user['page-flags'] == PAGE_FREELOVE)],
+                                                                       ($a->user['page-flags'] == Contact::PAGE_FREELOVE)],
 
-               '$page_prvgroup'        => ['page-flags', L10n::t('Private Forum [Experimental]'), PAGE_PRVGROUP,
+               '$page_prvgroup'        => ['page-flags', L10n::t('Private Forum [Experimental]'), Contact::PAGE_PRVGROUP,
                                                                        L10n::t('Requires manual approval of contact requests.'),
-                                                                       ($a->user['page-flags'] == PAGE_PRVGROUP)],
+                                                                       ($a->user['page-flags'] == Contact::PAGE_PRVGROUP)],
 
 
        ]);