/** * Display update information * * @access public */ public function backendHtml() { global $current_screen; $parent_string = is_child_theme() ? 'Parent Theme (' . ucfirst($this->theme_name) . ')' : 'Theme'; if (empty($this->user_name) || empty($this->api_key)) { echo Message::display(Translate::params('Once you have entered and saved your Username and API Key WordPress will check for updates every 12 Hours and notify you here, if one is available <br/><br/> Your current %s Version Number is <strong> %s </strong>', $parent_string, $this->version), 'updated'); UpdateNotifier::getInstance(); } else { if (($update = $this->isThemeUpdated()) !== false) { if ($current_screen->base != 'update-core') { $target = network_admin_url('update-core.php?action=do-theme-upgrade'); $data = array('new_version' => $update['new_version'], 'target' => $target, 'parent' => $parent_string, 'version' => $this->version, 'theme_name' => $this->theme_name); $view = View::render('Helper/auto-update', $data); echo $view; } } } }
/** * Import WPML settings * * @access public */ public function import() { ?> <h1><?php echo Translate::translate('WPML settings import'); ?> </h1> <?php if (isset($_POST['wpml_settings_import']) || wp_verify_nonce($_POST['wpml_settings_import'], 'wpml_settings_import')) { if (isset($_FILES['wpml-settings']) && $_FILES['wpml-settings']['error'] == 0) { $file = wp_handle_upload($_FILES['wpml-settings'], array('test_form' => false)); if (isset($file['url'])) { $import = new ICLImportXML(); $result = $import->importSettings($file['url']); if ($result == true && !is_wp_error($result)) { echo Message::display(Translate::translate('Your WPML settings have been successfully imported!')); } else { echo Message::display(Translate::translate('Something went wrong. Either WPML is not installed or the wpml.xml could not be found or be opened!')); if (is_wp_error($result)) { echo Message::display($result->get_error_message()); } } unlink($file['file']); } } } $this->importForm(); }