public function __construct() { Avada::$is_updating = true; /* Raise the memory limit and max_execution_time time */ @ini_set('memory_limit', '256M'); @set_time_limit(0); $this->available_languages = Avada_Multilingual::get_available_languages(); $this->active_language = Avada_Multilingual::get_active_language(); $this->default_language = Avada_Multilingual::get_default_language(); // If English is used then make this first in array order. Also set starting language so that it is migrated first if (in_array('en', $this->available_languages)) { $en_array = array('en'); $en_key = array_search('en', $this->available_languages); $available_languages_no_en = $this->available_languages; unset($available_languages_no_en[$en_key]); $this->available_languages = array_merge($en_array, $available_languages_no_en); $this->starting_language = 'en'; } else { // If not English then make default language first in array order. Also set it to be starting language for migration. $default_array = array($this->default_language); $default_key = array_search($this->default_language, $this->available_languages); $available_languages_no_default = $this->available_languages; unset($available_languages_no_default[$default_key]); $this->available_languages = array_merge($default_array, $available_languages_no_default); $this->starting_language = $this->default_language; } if ($_GET && isset($_GET['avada_update'])) { // Only continue if the URL is ?avada_update=1 if ('1' != $_GET['avada_update']) { return; } // Only continue if we're updating to version 4.0.0 if (!isset($_GET['ver']) || $this->version != $_GET['ver']) { return; } // Get the current step if (!isset($_GET['step'])) { $this->step = 0; } else { $this->step = intval($_GET['step']); } if (isset($_GET['proceed']) && '0' == $_GET['proceed']) { $this->proceed = false; } if (isset($_GET['lang']) && !in_array($_GET['lang'], array('', 'en', 'all', null))) { Avada_Multilingual::set_active_language($_GET['lang']); } $this->options = get_option(Avada::get_option_name(), array()); $this->fields = Avada_Options::get_option_fields(); add_action('admin_init', array($this, 'migrate_page')); } }
/** * The class constructor */ public function __construct() { Avada::$is_updating = $_GET && isset($_GET['avada_update']) && '1' == $_GET['avada_update'] ? true : false; /** * The array of sections by ID. * These are used in the filenames AND the function-names. */ $this->section_names = array('layout', 'menu', 'responsive', 'colors', 'header', 'logo', 'page_title_bar', 'sliding_bar', 'footer', 'sidebars', 'background', 'typography', 'shortcode_styling', 'blog', 'portfolio', 'social_media', 'slideshows', 'elastic_slider', 'lightbox', 'contact', 'search_page', 'extra', 'advanced', 'bbpress', 'woocommerce', 'events_calendar', 'custom_css'); /** * Include the section files */ $this->include_files(); /** * Set the $sections */ $this->set_sections(); /** * Set the $fields */ $this->set_fields(); }
/** * Checks if we're in the migration page * It does that by checking _GET, and then sets the $is_updating property. */ public function set_is_updating() { if (!self::$is_updating && $_GET && isset($_GET['avada_update']) && '1' == $_GET['avada_update']) { self::$is_updating = true; } }