'', 'title' => '', 'tab_label' => '', 'handler' => false, 'icon_path' => '', ) ) ); } if ( ! isset( $tab_label ) || ! $tab_label ) { $tab_label = $name; } add_action( 'gform_settings_' . str_replace( ' ', '_', $name ), $handler ); self::$addon_pages[ $name ] = array( 'name' => $name, 'title' => $title, 'tab_label' => $tab_label, 'icon' => $icon_path ); } public static function settings_page() { $subview = self::get_subview(); switch ( $subview ) { case 'settings': self::gravityforms_settings_page(); break; case 'uninstall': self::settings_uninstall_page(); break; default: self::page_header(); /** * Fires in the settings page depending on which page of the settings page you are in (the Subview) * * @param mixed $subview The sub-section of the main Form's settings */ do_action( 'gform_settings_' . str_replace( ' ', '_', $subview ) ); self::page_footer(); } } public static function settings_uninstall_page() { self::page_header( __( 'Uninstall Gravity Forms', 'gravityforms' ), '' ); if ( isset( $_POST['uninstall'] ) ) { if ( ! GFCommon::current_user_can_any( 'gravityforms_uninstall' ) || ( function_exists( 'is_multisite' ) && is_multisite() && ! is_super_admin() ) ) { die( esc_html__( "You don't have adequate permission to uninstall Gravity Forms.", 'gravityforms' ) ); } //dropping all tables RGFormsModel::drop_tables(); //removing options delete_option( 'rg_form_version' ); delete_option( 'rg_gforms_key' ); delete_option( 'rg_gforms_disable_css' ); delete_option( 'rg_gforms_enable_html5' ); delete_option( 'rg_gforms_captcha_public_key' ); delete_option( 'rg_gforms_captcha_private_key' ); delete_option( 'rg_gforms_message' ); delete_option( 'gform_enable_noconflict' ); delete_option( 'gform_enable_background_updates' ); delete_option( 'gf_dismissed_upgrades' ); delete_option( 'rg_gforms_currency' ); delete_option( 'gform_api_count' ); delete_option( 'gform_email_count' ); //removing gravity forms upload folder GFCommon::delete_directory( RGFormsModel::get_upload_root() ); //Deactivating plugin $plugin = 'gravityforms/gravityforms.php'; deactivate_plugins( $plugin ); update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ) ); ?>
", '' ) ?>

'; /** * Allows for the modification of the Gravity Forms uninstall button * * @param string $uninstall_button The HTML of the uninstall button */ echo apply_filters( 'gform_uninstall_button', $uninstall_button ); ?>
.

'; if ( ! rgempty( 'is_error', $version_info ) ) { $key_field .= " There was an error validating your key' . esc_attr__( 'There was an error while validating your license key. Gravity Forms will continue to work, but automatic upgrades will not be available. Please contact support to resolve this issue.', 'gravityforms' ) . "'/>"; } else if ( rgar( $version_info, 'is_valid_key' ) ) { $key_field .= "  " . esc_html__( 'Valid Key : Your license key has been successfully validated.', 'gravityforms' ) . ''; } else if ( ! empty( $key ) ) { $key_field .= "  " . esc_html__( 'Invalid or Expired Key : Please make sure you have entered the correct value and that your key is not expired.', 'gravityforms' ) . ''; } echo apply_filters( 'gform_settings_key_field', $key_field ); ?>
/>    />
id="gforms_enable_html5" />    />
id="gform_enable_noconflict" />    id="gform_disable_noconflict" />
id="gforms_enable_akismet" />    />
id="gform_enable_background_updates" />    id="gform_disable_background_updates" />

.


', '' ); ?>

', '' ); ?>

'; /** * Filters through and allows modification of the Settings save button HTML in a Form * * @param string $save_button */ echo apply_filters( 'gform_settings_save_button', $save_button ); ?>

' ) ) { ?>
db_version() ); ?> db_version(), '5.0.0', '>' ) ) { ?>
' ) ) { ?>
=' ) ) { ?> ', '' ); } ?>
'POST', 'timeout' => 3, 'body' => $body ); $options['headers'] = array( 'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option( 'blog_charset' ), 'Content-Length' => strlen( $body ), 'User-Agent' => 'WordPress/' . get_bloginfo( 'version' ), 'Referer' => get_bloginfo( 'url' ) ); $raw_response = GFCommon::post_to_manager( 'api.php', 'op=upgrade_message&key=' . GFCommon::get_key(), $options ); if ( is_wp_error( $raw_response ) || 200 != $raw_response['response']['code'] ) { $message = ''; } else { $message = $raw_response['body']; } //validating that message is a valid Gravity Form message. If message is invalid, don't display anything if ( substr( $message, 0, 10 ) != '' ) { $message = ''; } echo $message; exit; } public static function page_header( $title = '', $message = '' ) { $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; // register admin styles wp_register_style( 'gform_admin', GFCommon::get_base_url() . "/css/admin{$min}.css" ); wp_print_styles( array( 'jquery-ui-styles', 'gform_admin' ) ); $current_tab = self::get_subview(); //build left side options, always have GF Settings first and Uninstall last, put add-ons in the middle $setting_tabs = array( '10' => array( 'name' => 'settings', 'label' => __( 'Settings', 'gravityforms' ) ) ); if ( ! empty( self::$addon_pages ) ) { $sorted_addons = self::$addon_pages; asort( $sorted_addons ); //add add-ons to menu foreach ( $sorted_addons as $sorted_addon ) { $setting_tabs[] = array( 'name' => urlencode( $sorted_addon['name'] ), 'label' => esc_html( $sorted_addon['tab_label'] ), 'title' => esc_html( rgar( $sorted_addon, 'title' ) ), ); } } $setting_tabs[] = array( 'name' => 'uninstall', 'label' => __( 'Uninstall', 'gravityforms' ) ); $setting_tabs = apply_filters( 'gform_settings_menu', $setting_tabs ); ksort( $setting_tabs, SORT_NUMERIC ); // kind of boring having to pass the title, optionally get it from the settings tab if ( ! $title ) { foreach ( $setting_tabs as $tab ) { if ( $tab['name'] == urlencode( $current_tab ) ) { $title = ! empty( $tab['title'] ) ? $tab['title'] : $tab['label']; } } } ?>