/**
  * PHPDOC
  *
  * @return void
  *
  * @since PHPDOC
  */
 public function preview_css()
 {
     if (!nelioab_can_user_manage_plugin()) {
         return;
     }
     $css_id = '';
     if (isset($_GET['nelioab_preview_css'])) {
         $css_id = $_GET['nelioab_preview_css'];
     }
     $css = get_option('nelioab_css_' . $css_id, false);
     echo $this->prepare_css_as_js($css);
 }
 public function init()
 {
     // If the user has been disabled... get out of here
     try {
         $aux = NelioABAccountSettings::check_user_settings();
     } catch (Exception $e) {
         // We do nothing here (if the user is deactivated, proper "ERROR" pages will be shown).
         // However, it is important we add the check here: if the user was deactivated, but it
         // no longer is, then it's important his settings are checked from the admin area.
     }
     // Some relevant global warnings
     // -----------------------------
     // If the current user is NOT admin, do not show the plugin
     if (!nelioab_can_user_manage_plugin()) {
         return;
     }
     require_once NELIOAB_ADMIN_DIR . '/about.php';
     NelioABAboutPage::get_instance();
     $this->process_special_pages();
     // Iconography
     add_action('admin_head', array($this, 'add_custom_styles'));
     // Some hooks
     add_action('wp_count_posts', array($this, 'exclude_alternatives_from_post_count'), 10, 2);
     add_action('pre_get_posts', array($this, 'exclude_alternative_posts_and_pages'));
     add_filter('plugin_action_links', array($this, 'add_plugin_action_links'), 10, 2);
     // (Super)Settings for multisite
     add_action('network_admin_menu', array($this, 'create_nelioab_site_settings_page'));
     // Regular settings
     add_action('admin_menu', array($this, 'create_nelioab_admin_pages'));
     require_once NELIOAB_ADMIN_DIR . '/views/settings-page.php';
     add_action('admin_init', array('NelioABSettingsPage', 'register_settings'));
     add_action('admin_menu', array($this, 'configure_edit_nelioab_alternative'));
     // AJAX functions
     add_action('wp_ajax_nelioab_get_html_content', array($this, 'generate_html_content'));
     add_action('wp_ajax_nelioab_rated', array($this, 'mark_as_rated'));
     require_once NELIOAB_UTILS_DIR . '/wp-helper.php';
     add_action('wp_ajax_nelioab_post_searcher', array('NelioABWpHelper', 'search_posts'));
     add_action('wp_ajax_nelioab_form_searcher', array('NelioABWpHelper', 'search_forms'));
     add_action('admin_enqueue_scripts', array(&$this, 'load_custom_style_and_scripts'));
     // Footer Message
     add_filter('admin_footer_text', array($this, 'admin_footer_text'), 1);
 }
 /**
  * This function initializes some administration stuff.
  *
  * For instance, it loads the Heatmap controller, which is used for viewing
  * heatmaps using Nelio's interface.
  *
  * @return void
  *
  * @see NelioABHeatmapController
  *
  * @since 2.0.10
  */
 public function init_admin_stuff()
 {
     if (!nelioab_can_user_manage_plugin()) {
         return;
     }
     // Controller for viewing heatmaps
     require_once NELIOAB_EXP_CONTROLLERS_DIR . '/heatmap-controller.php';
     new NelioABHeatmapController();
 }