Browse Source

Update missing namespace uses in mod/

- Update missing constant moves in mod/
Hypolite Petovan 1 month ago
parent
commit
45ada943b4
9 changed files with 26 additions and 20 deletions
  1. 1
    0
      mod/dfrn_notify.php
  2. 1
    0
      mod/hcard.php
  3. 1
    0
      mod/profile.php
  4. 1
    0
      mod/profiles.php
  5. 18
    18
      mod/settings.php
  6. 1
    0
      mod/videos.php
  7. 1
    1
      mod/wall_attach.php
  8. 1
    0
      mod/wall_upload.php
  9. 1
    1
      update.php

+ 1
- 0
mod/dfrn_notify.php View File

@@ -12,6 +12,7 @@ use Friendica\Core\Logger;
12 12
 use Friendica\Core\System;
13 13
 use Friendica\Database\DBA;
14 14
 use Friendica\Model\Contact;
15
+use Friendica\Model\User;
15 16
 use Friendica\Protocol\DFRN;
16 17
 use Friendica\Protocol\Diaspora;
17 18
 use Friendica\Util\Strings;

+ 1
- 0
mod/hcard.php View File

@@ -8,6 +8,7 @@ use Friendica\Core\L10n;
8 8
 use Friendica\Core\System;
9 9
 use Friendica\Model\Contact;
10 10
 use Friendica\Model\Profile;
11
+use Friendica\Model\User;
11 12
 
12 13
 function hcard_init(App $a)
13 14
 {

+ 1
- 0
mod/profile.php View File

@@ -19,6 +19,7 @@ use Friendica\Model\Contact;
19 19
 use Friendica\Model\Group;
20 20
 use Friendica\Model\Item;
21 21
 use Friendica\Model\Profile;
22
+use Friendica\Model\User;
22 23
 use Friendica\Module\Login;
23 24
 use Friendica\Protocol\ActivityPub;
24 25
 use Friendica\Protocol\DFRN;

+ 1
- 0
mod/profiles.php View File

@@ -19,6 +19,7 @@ use Friendica\Database\DBA;
19 19
 use Friendica\Model\Contact;
20 20
 use Friendica\Model\GContact;
21 21
 use Friendica\Model\Profile;
22
+use Friendica\Model\User;
22 23
 use Friendica\Module\Login;
23 24
 use Friendica\Network\Probe;
24 25
 use Friendica\Util\DateTimeFormat;

+ 18
- 18
mod/settings.php View File

@@ -474,13 +474,13 @@ function settings_post(App $a)
474 474
 	}
475 475
 
476 476
 	// Adjust the page flag if the account type doesn't fit to the page flag.
477
-	if (($account_type == Contact::ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_SOAPBOX, User::PAGE_FLAGS_FREELOVE])) {
477
+	if (($account_type == User::ACCOUNT_TYPE_PERSON) && !in_array($page_flags, [User::PAGE_FLAGS_NORMAL, User::PAGE_FLAGS_SOAPBOX, User::PAGE_FLAGS_FREELOVE])) {
478 478
 		$page_flags = User::PAGE_FLAGS_NORMAL;
479
-	} elseif (($account_type == Contact::ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [User::PAGE_FLAGS_SOAPBOX])) {
479
+	} elseif (($account_type == User::ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, [User::PAGE_FLAGS_SOAPBOX])) {
480 480
 		$page_flags = User::PAGE_FLAGS_SOAPBOX;
481
-	} elseif (($account_type == Contact::ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [User::PAGE_FLAGS_SOAPBOX])) {
481
+	} elseif (($account_type == User::ACCOUNT_TYPE_NEWS) && !in_array($page_flags, [User::PAGE_FLAGS_SOAPBOX])) {
482 482
 		$page_flags = User::PAGE_FLAGS_SOAPBOX;
483
-	} elseif (($account_type == Contact::ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
483
+	} elseif (($account_type == User::ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) {
484 484
 		$page_flags = User::PAGE_FLAGS_COMMUNITY;
485 485
 	}
486 486
 
@@ -1015,8 +1015,8 @@ function settings_content(App $a)
1015 1015
 	// Set the account type to "Community" when the page is a community page but the account type doesn't fit
1016 1016
 	// This is only happening on the first visit after the update
1017 1017
 	if (in_array($a->user['page-flags'], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP]) &&
1018
-		($a->user['account-type'] != Contact::ACCOUNT_TYPE_COMMUNITY))
1019
-		$a->user['account-type'] = Contact::ACCOUNT_TYPE_COMMUNITY;
1018
+		($a->user['account-type'] != User::ACCOUNT_TYPE_COMMUNITY))
1019
+		$a->user['account-type'] = User::ACCOUNT_TYPE_COMMUNITY;
1020 1020
 
1021 1021
 	$pageset_tpl = Renderer::getMarkupTemplate('settings/pagetypes.tpl');
1022 1022
 
@@ -1025,26 +1025,26 @@ function settings_content(App $a)
1025 1025
 		'$user' 		=> L10n::t("Personal Page Subtypes"),
1026 1026
 		'$community'		=> L10n::t("Community Forum Subtypes"),
1027 1027
 		'$account_type'		=> $a->user['account-type'],
1028
-		'$type_person'		=> Contact::ACCOUNT_TYPE_PERSON,
1029
-		'$type_organisation' 	=> Contact::ACCOUNT_TYPE_ORGANISATION,
1030
-		'$type_news'		=> Contact::ACCOUNT_TYPE_NEWS,
1031
-		'$type_community' 	=> Contact::ACCOUNT_TYPE_COMMUNITY,
1028
+		'$type_person'		=> User::ACCOUNT_TYPE_PERSON,
1029
+		'$type_organisation' 	=> User::ACCOUNT_TYPE_ORGANISATION,
1030
+		'$type_news'		=> User::ACCOUNT_TYPE_NEWS,
1031
+		'$type_community' 	=> User::ACCOUNT_TYPE_COMMUNITY,
1032 1032
 
1033
-		'$account_person' 	=> ['account-type', L10n::t('Personal Page'), Contact::ACCOUNT_TYPE_PERSON,
1033
+		'$account_person' 	=> ['account-type', L10n::t('Personal Page'), User::ACCOUNT_TYPE_PERSON,
1034 1034
 									L10n::t('Account for a personal profile.'),
1035
-									($a->user['account-type'] == Contact::ACCOUNT_TYPE_PERSON)],
1035
+									($a->user['account-type'] == User::ACCOUNT_TYPE_PERSON)],
1036 1036
 
1037
-		'$account_organisation'	=> ['account-type', L10n::t('Organisation Page'), Contact::ACCOUNT_TYPE_ORGANISATION,
1037
+		'$account_organisation'	=> ['account-type', L10n::t('Organisation Page'), User::ACCOUNT_TYPE_ORGANISATION,
1038 1038
 									L10n::t('Account for an organisation that automatically approves contact requests as "Followers".'),
1039
-									($a->user['account-type'] == Contact::ACCOUNT_TYPE_ORGANISATION)],
1039
+									($a->user['account-type'] == User::ACCOUNT_TYPE_ORGANISATION)],
1040 1040
 
1041
-		'$account_news'		=> ['account-type', L10n::t('News Page'), Contact::ACCOUNT_TYPE_NEWS,
1041
+		'$account_news'		=> ['account-type', L10n::t('News Page'), User::ACCOUNT_TYPE_NEWS,
1042 1042
 									L10n::t('Account for a news reflector that automatically approves contact requests as "Followers".'),
1043
-									($a->user['account-type'] == Contact::ACCOUNT_TYPE_NEWS)],
1043
+									($a->user['account-type'] == User::ACCOUNT_TYPE_NEWS)],
1044 1044
 
1045
-		'$account_community' 	=> ['account-type', L10n::t('Community Forum'), Contact::ACCOUNT_TYPE_COMMUNITY,
1045
+		'$account_community' 	=> ['account-type', L10n::t('Community Forum'), User::ACCOUNT_TYPE_COMMUNITY,
1046 1046
 									L10n::t('Account for community discussions.'),
1047
-									($a->user['account-type'] == Contact::ACCOUNT_TYPE_COMMUNITY)],
1047
+									($a->user['account-type'] == User::ACCOUNT_TYPE_COMMUNITY)],
1048 1048
 
1049 1049
 		'$page_normal'		=> ['page-flags', L10n::t('Normal Account Page'), User::PAGE_FLAGS_NORMAL,
1050 1050
 									L10n::t('Account for a regular personal profile that requires manual approval of "Friends" and "Followers".'),

+ 1
- 0
mod/videos.php View File

@@ -16,6 +16,7 @@ use Friendica\Model\Contact;
16 16
 use Friendica\Model\Group;
17 17
 use Friendica\Model\Item;
18 18
 use Friendica\Model\Profile;
19
+use Friendica\Model\User;
19 20
 use Friendica\Protocol\DFRN;
20 21
 use Friendica\Util\Security;
21 22
 

+ 1
- 1
mod/wall_attach.php View File

@@ -8,7 +8,7 @@ use Friendica\Core\Config;
8 8
 use Friendica\Core\L10n;
9 9
 use Friendica\Database\DBA;
10 10
 use Friendica\Model\Attach;
11
-use Friendica\Model\Contact;
11
+use Friendica\Model\User;
12 12
 use Friendica\Util\Strings;
13 13
 
14 14
 function wall_attach_post(App $a) {

+ 1
- 0
mod/wall_upload.php View File

@@ -16,6 +16,7 @@ use Friendica\Core\Config;
16 16
 use Friendica\Database\DBA;
17 17
 use Friendica\Model\Contact;
18 18
 use Friendica\Model\Photo;
19
+use Friendica\Model\User;
19 20
 use Friendica\Object\Image;
20 21
 use Friendica\Util\Strings;
21 22
 

+ 1
- 1
update.php View File

@@ -161,7 +161,7 @@ function update_1191()
161 161
 function update_1203()
162 162
 {
163 163
 	$r = q("UPDATE `user` SET `account-type` = %d WHERE `page-flags` IN (%d, %d)",
164
-		DBA::escape(Contact::ACCOUNT_TYPE_COMMUNITY),
164
+		DBA::escape(User::ACCOUNT_TYPE_COMMUNITY),
165 165
 		DBA::escape(User::PAGE_FLAGS_COMMUNITY),
166 166
 		DBA::escape(User::PAGE_FLAGS_PRVGROUP)
167 167
 	);

Loading…
Cancel
Save