summaryrefslogtreecommitdiff
path: root/admin/admin_users_inc.php
blob: 7e612cfc23c6adc12b37152f584fda56770b1846 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
$formFeatures = [
	'users_preferences' => [
			'label' => 'User Preferences',
			'note' => 'Users can view and modify their personal preferences.',
			'page' => 'UserPreferences',
	],
	'users_change_language' => [
			'label' => 'Registered users can change language',
			'note' => 'Allows users to view a translated version of the site.',
	],
	'users_watches' => [
			'label' => 'User Watches',
			'note' => 'Users can mark pages to be watched. If a watched page is modified, the user is informed.',
			'page' => 'UserWatches',
	],
	'display_users_content_list' => [
			'label' => 'Display User\'s Content',
			'note' => 'Display listing of all content owned by this user on the user My page.',
			'page' => 'UserContentList',
	],
];

$gBitSmarty->assign( 'formFeatures', $formFeatures );

if( isset( $_REQUEST['settings'] ) ) {
	foreach ( array_keys( $formFeatures ) as $feature) {
		$gBitSystem->storeConfig( $feature, ($_REQUEST['settings'][$feature][0] ?? 'n'), USERS_PKG_NAME );
	}

	if( $customFields = explode( ',', $_REQUEST['settings']['custom_user_fields'] ) ) {
		trim_array( $customFields );
		$customFields = implode( ',', $customFields );
	}
	$gBitSystem->storeConfig( 'custom_user_fields', $customFields, USERS_PKG_NAME );
	$gBitSystem->storeConfig( 'users_display_name', ($_REQUEST['settings']['users_display_name'] ?? 'real_name'), USERS_PKG_NAME );
	$gBitSystem->storeConfig( 'users_themes', ($_REQUEST['settings']['users_themes'][0] ?? null), USERS_PKG_NAME );
	$gBitSystem->storeConfig( 'users_layouts', ($_REQUEST['settings']['users_layouts'][0] ?? null), USERS_PKG_NAME );
}

?>