summaryrefslogtreecommitdiff
path: root/user_preferences_inc.php
blob: 74e92d6a11b7dc10ca7d7fd1745d8754f5ea8507 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
/**
 * @package boards
 * @subpackage functions
 */

$boardsSettings = array(
'boards_show_avatars' => array(
'pref' => 'boards_show_avatars',
'label' => "Show Avatars",
'type' => "checkbox",
'default'=> 'y',
'note' => "",
),
);

foreach( $boardsSettings as $option => $op) {
	if ($op['type']=="checkbox") {
		$editUser->storePreference($op['pref'], !empty( $_REQUEST['boards'][$option]) ? 'y' : 'n', 'users');
	} else {
		$editUser->storePreference($op['pref'], !empty( $_REQUEST['boards'][$option]) ? $_REQUEST['boards'][$option] : '', 'users');
	}
}

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

if( isset( $_REQUEST['bitboarduprefs']['board_id'] ) ) {
	$_REQUEST['b'] = $_REQUEST['bitboarduprefs']['board_id'];
}

$signatureContent= new LibertyContent();
$content_type = $gBitUser->getPreference('signiture_content_type',"");
$content_data = $gBitUser->getPreference('signiture_content_data',"");
if (!empty($content_type) && !empty($content_data)) {
	$signatureContent->mInfo['format_guid']=$gBitUser->getPreference('signiture_content_type');
	$signatureContent->mInfo['data']=$content_data;
}
$gBitSmarty->assign_by_ref( 'signatureContent', $signatureContent );


if( isset( $_REQUEST["format_guid"] ) ) {
	$signatureContent->mInfo['format_guid'] = $_REQUEST["format_guid"];
}

if( isset( $_REQUEST['bitboarduprefs']["edit"] ) ) {
	$signatureContent->mInfo["data"] = $_REQUEST['bitboarduprefs']["edit"];
	$signatureContent->mInfo['parsed_data'] = $signatureContent->parseData();
}

// If we are in preview mode then preview it!
if( isset( $_REQUEST["preview"] ) ) {
	$gBitSmarty->assign('preview', 'y');
}

// Pro
// Check if the page has changed
if( !empty( $_REQUEST["save_bitboarduprefs"] ) ) {
	// Check if all Request values are delivered, and if not, set them
	// to avoid error messages. This can happen if some features are
	// disabled
	$gBitUser->storePreference('signiture_content_type',$signatureContent->mInfo['format_guid'], 'users');
	$gBitUser->storePreference('signiture_content_data',$signatureContent->mInfo['data'], 'users');
}

/**
 * Configure quicktags list
 */ 
if( $gBitSystem->isPackageActive( 'quicktags' ) ) {
	include_once( QUICKTAGS_PKG_PATH.'quicktags_inc.php' );
}

// WYSIWYG and Quicktag variable
$gBitSmarty->assign( 'textarea_id', 'editbitboard' );

?>