<?php 
_e('Display Notification Widget<br/><small><i>Note:  Email Users can show a notifcation widget on the Post/Page editing screen.</i></small>', MAILUSERS_I18N_DOMAIN);
?>
<br/>
		</td>
	</tr>
	<tr>
    <th><?php 
_e('Notification Menus', MAILUSERS_I18N_DOMAIN);
?>
</th>
		<td>
			<input 	type="checkbox"
					name="mailusers_notification_menus" id="mailusers_notification_menus" value="true"
					<?php 
if (mailusers_get_notification_menus() == 'true') {
    echo 'checked="checked"';
}
?>
 ></input>
			<?php 
_e('Display Notification Menus<br/><small><i>Note:  Email Users can show a notifcation menu on the Post/Page sections of the Dashboard menu.</i></small>', MAILUSERS_I18N_DOMAIN);
?>
<br/>
		</td>
	</tr>
	<tr>
    <th><?php 
_e('Debug', MAILUSERS_I18N_DOMAIN);
?>
</th>
Ejemplo n.º 2
0
function mailusers_add_pages()
{
    global $mailusers_user_custom_meta_filters;
    global $mailusers_group_custom_meta_filters;
    mailusers_init_i18n();
    //  Show Notify Menus only when notification menus enabled
    if (mailusers_get_notification_menus() === 'true') {
        add_posts_page(__('Notify Users', MAILUSERS_I18N_DOMAIN), __('Notify Users', MAILUSERS_I18N_DOMAIN), MAILUSERS_NOTIFY_USERS_CAP, 'mailusers-send-notify-mail-post', 'mailusers_send_notify_mail');
        add_pages_page(__('Notify Users', MAILUSERS_I18N_DOMAIN), __('Notify Users', MAILUSERS_I18N_DOMAIN), MAILUSERS_NOTIFY_USERS_CAP, 'mailusers-send-notify-mail-page', 'mailusers_send_notify_mail');
    }
    $mailusers_options_page = add_options_page(__('Email Users', MAILUSERS_I18N_DOMAIN), __('Email Users', MAILUSERS_I18N_DOMAIN), 'manage_options', 'mailusers-options-page', 'mailusers_options_page');
    add_menu_page(__('Email Users', MAILUSERS_I18N_DOMAIN), __('Email Users', MAILUSERS_I18N_DOMAIN), MAILUSERS_EMAIL_SINGLE_USER_CAP, plugin_basename(__FILE__), 'mailusers_overview_page', plugins_url('images/email.png', __FILE__));
    //  Send to User(s) Menu
    add_submenu_page(plugin_basename(__FILE__), __('Send to User(s)', MAILUSERS_I18N_DOMAIN), __('Send to User(s)', MAILUSERS_I18N_DOMAIN), MAILUSERS_EMAIL_SINGLE_USER_CAP, 'mailusers-send-to-user-page', 'mailusers_send_to_user_page');
    /**
     * Do we need to deal with a user custom meta filter?
     *
     */
    //  Load any custom meta filters
    do_action('mailusers_user_custom_meta_filter');
    foreach ($mailusers_user_custom_meta_filters as $mf) {
        $slug = strtolower($mf['label']);
        $slug = preg_replace("/[^a-z0-9\\s-]/", "", $slug);
        $slug = trim(preg_replace("/[\\s-]+/", " ", $slug));
        $slug = trim(substr($slug, 0));
        $slug1 = preg_replace("/\\s/", "-", $slug);
        $slug2 = preg_replace("/\\s/", "_", $slug);
        //  Need to create the function to call the custom filter email script
        $fn = create_function('', 'global $mailusers_mf, $mailusers_mv, $mailusers_mc; $mailusers_mf = \'' . $mf['meta_filter'] . '\' ; $mailusers_mv = \'' . $mf['meta_value'] . '\' ; $mailusers_mc = \'' . $mf['meta_compare'] . '\' ; require(\'email_users_send_custom_filter_mail.php\') ;');
        add_submenu_page(plugin_basename(__FILE__), sprintf(__('Send to %s'), $mf['label'], MAILUSERS_I18N_DOMAIN), sprintf(__('Send to %s'), $mf['label'], MAILUSERS_I18N_DOMAIN), MAILUSERS_EMAIL_USER_GROUPS_CAP, 'mailusers-send-to-custom-filter-page-' . $slug1, $fn);
        //'mailusers_send_to_custom_filter_page_' . $slug2) ;
    }
    //  Send to Group(s) Menu
    add_submenu_page(plugin_basename(__FILE__), __('Send to Group(s)', MAILUSERS_I18N_DOMAIN), __('Send to Group(s)', MAILUSERS_I18N_DOMAIN), MAILUSERS_EMAIL_USER_GROUPS_CAP, 'mailusers-send-to-group-page', 'mailusers_send_to_group_page');
    /**
     * Do we need to deal with a user custom meta filter?
     *
     */
    //  Load any custom meta key filters
    do_action('mailusers_group_custom_meta_key_filter');
    //  Load any custom meta filters
    do_action('mailusers_group_custom_meta_filter');
    /**
        if (!empty($mailusers_group_custom_meta_filters))
        {
            //  Send to Group(s) Menu
            add_submenu_page(plugin_basename(__FILE__),
    	        __('Send to Meta Group(s)', MAILUSERS_I18N_DOMAIN), 
    	        __('Send to Meta Group(s)', MAILUSERS_I18N_DOMAIN), 
    	        MAILUSERS_EMAIL_USER_GROUPS_CAP,
                'mailusers-send-to-group-custom-meta-page',
       	        'mailusers_send_to_group_custom_meta_page') ;
        }
        **/
    //  User Settings Menu
    add_submenu_page(plugin_basename(__FILE__), __('User Settings', MAILUSERS_I18N_DOMAIN), __('User Settings', MAILUSERS_I18N_DOMAIN), 'edit_users', 'mailusers-user-settings', 'mailusers_user_settings_page');
    //  Plugin specific script and CSS loading ...
    //  ***  Not currently used!  ***
    //add_action('admin_footer-'.$mailusers_options_page, 'mailusers_options_admin_footer') ;
    //add_action('admin_print_scripts-'.$mailusers_options_page, 'mailusers_options_print_scripts') ;
    //add_action('admin_print_styles-'.$mailusers_options_page, 'mailusers_options_print_styles') ;
}