summaryrefslogtreecommitdiffstats
path: root/include/plugin-options.php
blob: 2635375ab998ce8b39a5dd947380997eb2991b50 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?php
/*****************************************************************************************
* Settings Sections
*******************************************************************************************/
// Add a form section for the Gravatar Display
add_settings_section('dnxup_settings_gravatar_display', __('Gravatar setting', 'dnxup'), 'dnxup_settings_gravatar_section_text', 'dnxup_settings_sections');

// Add a form section for the Logged out Heading
add_settings_section('dnxup_settings_log_out_heading_display', __('Logged out Heading', 'dnxup'), 'dnxup_settings_log_out_heading_section_text', 'dnxup_settings_sections');

// Add a form section for the Logged in Heading
add_settings_section('dnxup_settings_log_in_heading_display', __('Logged in Heading', 'dnxup'), 'dnxup_settings_log_in_heading_section_text', 'dnxup_settings_sections');

// Add a form section for the Logged in Custom Links
add_settings_section('dnxup_settings_log_in_custom_links_display', __('Logged in Custom Links', 'dnxup'), 'dnxup_settings_log_in_custom_links_section_text', 'dnxup_settings_sections');


/*****************************************************************************************
* Settings Fields
*******************************************************************************************/
// Add Gravatar Display field to his section
add_settings_field('dnxup_setting_gravatar_display', __('Display Gravatar?', 'dnxup'), 'dnxup_setting_gravatar_display', 'dnxup_settings_sections', 'dnxup_settings_gravatar_display');

// Add Logged out Heading field to his section
add_settings_field('dnxup_setting_log_out_heading_display', __('Logged out Heading', 'dnxup'), 'dnxup_setting_log_out_heading_display', 'dnxup_settings_sections', 'dnxup_settings_log_out_heading_display');

// Add Logged in Heading field to his section
add_settings_field('dnxup_setting_log_in_heading_display', __('Logged in Heading', 'dnxup'), 'dnxup_setting_log_in_heading_display', 'dnxup_settings_sections', 'dnxup_settings_log_in_heading_display');

// Add Logged in Heading field to his section
add_settings_field('dnxup_setting_log_in_custom_links_display', __('Logged in Custom Links', 'dnxup'), 'dnxup_setting_log_in_custom_links_display', 'dnxup_settings_sections', 'dnxup_settings_log_in_custom_links_display');


/*****************************************************************************************
* Fields text
*******************************************************************************************/
// Gravatar Display Section
function dnxup_settings_gravatar_section_text() { ?>
<p><?php _e( 'Select this if you want to display the Gravatar image on the widget', 'dnxup' ); ?></p>
<?php }

// Logged out Heading Display Section
function dnxup_settings_log_out_heading_section_text() { ?>
<p><?php _e( 'Heading for widget when user is logged out.', 'dnxup' ); ?></p>
<?php }

// Logged in Heading Display Section
function dnxup_settings_log_in_heading_section_text() { ?>
<p><?php _e( 'Heading for widget when user is logged in.', 'dnxup' ); ?></p>
<?php }

// Logged in Custom Links Display Section
function dnxup_settings_log_in_custom_links_section_text() { ?>
<p><?php _e( 'Custom Links to display when user is logged in.', 'dnxup' ); ?></p>
<?php }


/*****************************************************************************************
* Form display functions
*******************************************************************************************/
// Display Gravatar??
function dnxup_setting_gravatar_display() {
$dnxup_options = get_option( 'dnxup_options' ); ?>
<input type="checkbox" name="dnxup_options[show_gravatar]" <?php checked( $dnxup_options['show_gravatar'] ); ?> />
<span class="description"><?php _e('Select this to display the Gravatar image for the current user', 'dnxup'); ?></span>
<?php }

// Logged out Heading
function dnxup_setting_log_out_heading_display() {
$dnxup_options = get_option( 'dnxup_options' ); ?>
<input type="text" name="dnxup_options[logged_out_heading]" value="<?php echo $dnxup_options['logged_out_heading']; ?>" />
<span class="description"><?php _e('This is the heading your users will see when they\'re not logged in to your site', 'dnxup'); ?></span>
<?php }

// Logged in Heading
function dnxup_setting_log_in_heading_display() {
$dnxup_options = get_option( 'dnxup_options' ); ?>
<input type="text" name="dnxup_options[logged_in_heading]" value="<?php echo $dnxup_options['logged_in_heading']; ?>" />
<span class="description"><?php _e('This is the heading your users will see when they\'re logged in. <code>%username%</code> shows username.', 'dnxup'); ?></span>
<?php }

// Logged in Custom Links
function dnxup_setting_log_in_custom_links_display() {
$dnxup_options = get_option( 'dnxup_options' ); ?>
<textarea name="dnxup_options[logged_in_links]" rows="10" cols="80" /><?php echo wp_kses_data( $dnxup_options['logged_in_links'] ) ?></textarea>
<div class="description">
	<p>
		<?php _e("<strong>One link per line</strong>. Note: Logout link will always show regardless. Tip: Add <code>|true</code> after a link to only show it to admin users or alternatively use a <code>|user_capability</code> and the link will only be shown to users with that capability. See <a href='http://codex.wordpress.org/Roles_and_Capabilities' target='_blank'>http://codex.wordpress.org/Roles_and_Capabilities</a> for more info on roles and Capabilities.<br/> You can also type <code>%USERNAME%</code> and <code>%USERID%</code> which will be replaced by the user info.<br />Example:",'dnxup');
		echo '<br /><code>&lt;a href="'.get_bloginfo('wpurl').'/wp-admin/"&gt;'. __('Dashboard', 'dnxup') . '&lt;/a&gt;<br/>&lt;a href="'.get_bloginfo('wpurl').'/wp-admin/profile.php"&gt;'. __('Profile', 'dnxup') .'&lt;/a&gt;</code>'; ?>
	</p>
</div>
<?php }

?>