/**
  * view function
  *
  * @return void
  **/
 public function view()
 {
     global $ai1ec_view_helper, $ai1ec_settings, $ct;
     // defaults
     $activated = false;
     $deleted = false;
     // check if action is set
     if (isset($_GET['action']) && !empty($_GET['action'])) {
         // action can activate or delete a theme
         switch ($_GET['action']) {
             // activate theme
             case 'activate':
                 $activated = $this->activate_theme();
                 break;
                 // delete theme
             // delete theme
             case 'delete':
                 $deleted = $this->delete_theme();
                 break;
         }
     }
     if ($activated) {
         Ai1ec_Less_Factory::set_active_theme_path(AI1EC_THEMES_ROOT . DIRECTORY_SEPARATOR . $_GET['ai1ec_template']);
         $this->generate_notice_if_legacy_theme_installed(true);
     }
     $_list_table = new Ai1ec_Themes_List_Table();
     $_list_table->prepare_items();
     $args = array('activated' => $activated, 'deleted' => $deleted, 'ct' => $ct, 'wp_list_table' => $_list_table, 'page_title' => __('All-in-One Event Calendar: Themes', AI1EC_PLUGIN_NAME));
     add_thickbox();
     wp_enqueue_script('theme-preview');
     $ai1ec_view_helper->display_admin('themes.php', $args);
 }
}
Logger::configure($ai1ec_log4php_config);
global $ai1ec_themes_controller;
$ai1ec_themes_controller = Ai1ec_Themes_Controller::get_instance();
// get the active theme from the the theme controllor
$active_theme = $ai1ec_themes_controller->active_template_path();
// Are we in preview_mode?
$preview_mode = false;
// If we are previewing the theme, use the theme passed in the url
if (isset($_GET['preview']) && isset($_GET['ai1ec_stylesheet'])) {
    Ai1ec_Less_Factory::set_preview_mode(true);
    $active_theme = $_GET['ai1ec_stylesheet'];
    $preview_mode = true;
}
// Start_up the factories
Ai1ec_Less_Factory::set_active_theme_path(AI1EC_THEMES_ROOT . DIRECTORY_SEPARATOR . $active_theme);
Ai1ec_Less_Factory::set_default_theme_path(AI1EC_DEFAULT_THEME_PATH);
Ai1ec_Less_Factory::set_default_theme_url(AI1EC_DEFAULT_THEME_URL);
// ==================================
// = Add the hook to render the css =
// ==================================
if (isset($_GET[Ai1ec_Css_Controller::GET_VARIBALE_NAME])) {
    $css_controller = Ai1ec_Less_Factory::create_css_controller_instance();
    $css_controller->render_css();
    exit(0);
}
// ================================================
// = Disable updates checking for premium version =
// ================================================
function ai1ec_disable_updates($r, $url)
{