/**
  * Adds Wonderflux admin menus, registers settings and setsup contextual help.
  *
  * @since	0.93
  * @version	0.93
  *
  * @param	none
  *
  * @todo	Will need to review all admin options when they are moved to Customizer!
  */
 function wf_admin_menus()
 {
     if (WF_ADMIN_ACCESS == 'none') {
         // Silence is golden
     } else {
         $input = @unserialize(WF_ADMIN_ACCESS);
         // Check against serialised data
         if ($input === false) {
             // Must be single user role supplied
             if (WF_ADMIN_ACCESS == wfx_user_role('') && current_user_can('manage_options')) {
                 // Build admin menus
                 add_action('admin_menu', array($this, 'wf_add_pages'));
                 // Setup options
                 add_action('admin_init', array($this, 'wf_register_settings'));
                 // Setup help
                 add_filter('contextual_help', array($this, 'wf_contextual_help'), 10, 3);
             }
         } else {
             // Must be array of user ID's supplied
             global $current_user;
             get_currentuserinfo();
             foreach ($input as $key => $user_id) {
                 if ($user_id == $current_user->ID && current_user_can('manage_options')) {
                     // Build admin menus
                     add_action('admin_menu', array($this, 'wf_add_pages'));
                     // Setup options
                     add_action('admin_init', array($this, 'wf_register_settings'));
                     // Setup help
                     add_filter('contextual_help', array($this, 'wf_contextual_help'), 10, 3);
                 }
             }
         }
     }
 }
 /**
  * Adds Wonderflux links to the WordPress admin bar
  *
  * @since	0.93
  * @version	2.0
  */
 function wf_admin_bar_links()
 {
     global $wp_admin_bar;
     if (!is_admin_bar_showing() || !current_user_can('manage_options')) {
         return;
     } elseif (WF_ADMIN_ACCESS == 'none') {
         return;
     } elseif (WF_ADMIN_ACCESS != '') {
         if (WF_ADMIN_ACCESS == wfx_user_role('')) {
             //Backpat < WordPress 3.3
             if (WF_WORDPRESS_VERSION < 3.3) {
                 $wp_admin_bar->add_menu(array('parent' => 'appearance', 'title' => __('Wonderflux Stylelab', 'wonderflux'), 'href' => wp_sanitize_redirect(admin_url() . 'admin.php?page=wonderflux_stylelab')));
             } else {
                 $wp_admin_bar->add_menu(array('id' => 'wonderflux-admin-bar-menu', 'title' => __('Wonderflux', 'wonderflux'), 'href' => wp_sanitize_redirect(admin_url() . 'admin.php?page=wonderflux')));
                 $wp_admin_bar->add_menu(array('parent' => 'wonderflux-admin-bar-menu', 'id' => 'wonderflux-admin-bar-menu-2', 'title' => __('Wonderflux home', 'wonderflux'), 'href' => wp_sanitize_redirect(admin_url() . 'admin.php?page=wonderflux')));
                 $wp_admin_bar->add_menu(array('parent' => 'wonderflux-admin-bar-menu', 'id' => 'wonderflux-stylelab', 'title' => __('Stylelab', 'wonderflux'), 'href' => wp_sanitize_redirect(admin_url() . 'admin.php?page=wonderflux_stylelab')));
                 $wp_admin_bar->add_menu(array('parent' => 'wonderflux-admin-bar-menu', 'id' => 'wonderflux-advanced', 'title' => __('Advanced options', 'wonderflux'), 'href' => wp_sanitize_redirect(admin_url() . 'admin.php?page=wonderflux_advanced')));
                 $wp_admin_bar->add_menu(array('parent' => 'wonderflux-admin-bar-menu', 'id' => 'wonderflux-system', 'title' => __('System information', 'wonderflux'), 'href' => wp_sanitize_redirect(admin_url() . 'admin.php?page=wonderflux_system')));
                 $wp_admin_bar->add_menu(array('parent' => 'wonderflux-admin-bar-menu', 'id' => 'wonderflux-backup', 'title' => __('Backup/restore', 'wonderflux'), 'href' => wp_sanitize_redirect(admin_url() . 'admin.php?page=wonderflux_backup')));
                 $wp_admin_bar->add_menu(array('parent' => 'wonderflux-admin-bar-menu', 'id' => 'wonderflux-ext-guide', 'title' => __('API/documentation', 'wonderflux'), 'href' => wp_sanitize_redirect('wonderflux.com/guide')));
             }
         }
     } else {
         // Silence is golden
     }
 }