| renewal_text() ); ?> | |||||
|---|---|---|---|---|---|
|
get_data_value( 'product_name' ) ) ) ); ?> |
display_as_valid() ? 'active' : 'error'; $status_label = $license_info->get_display_status(); ?> |
get_data_value( 'date_created' ) ) ) ); ?> |
max_seats_exceeded() ? 'gform-c-error-text' : ''; ?> get_data_value( 'active_sites' ), $license_info->get_data_value( 'max_sites' ) ) ); ?> |
renewal_date() ); ?> |
%s
%s
', esc_html__( 'Please complete the reCAPTCHA widget to validate your reCAPTCHA keys:', 'gravityforms' ) ); // Add reCAPTCHA container, reset input. $html .= ''; $html .= sprintf( '', esc_attr( self::get_settings_renderer()->get_input_name_prefix() ), esc_attr( $props['name'] ) ); return $html; } // # SETTINGS RENDERER --------------------------------------------------------------------------------------------- /** * Gets the current instance of Settings handling settings rendering. * * @since 2.5 * * @return false|Settings */ private static function get_settings_renderer() { return self::$_settings_renderer; } /** * Sets the current instance of Settings handling settings rendering. * * @since 2.5 * * @param Settings $renderer Settings renderer. * * @return bool|WP_Error */ private static function set_settings_renderer( $renderer ) { // Ensure renderer is an instance of Settings if ( ! is_a( $renderer, 'Gravity_Forms\Gravity_Forms\Settings\Settings' ) ) { return new WP_Error( 'Renderer must be an instance of Gravity_Forms\Gravity_Forms\Settings\Settings.' ); } self::$_settings_renderer = $renderer; return true; } /** * Handles license upgrades from the Settings page. * * @since Unknown * @access public * * @uses GFCommon::get_key() * @uses GFCommon::post_to_manager() * * @return void */ public static function upgrade_license() { $key = GFCommon::get_key(); $body = "key=$key"; $options = array( 'method' => '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' ), ); $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; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped exit; } /** * Outputs the settings page header. * * @since Unknown * @access public * * @uses SCRIPT_DEBUG * @uses GFSettings::get_subview() * @uses GFSettings::$addon_pages * @uses GFCommon::get_browser_class() * @uses GFCommon::display_dismissible_message() * * @param string $title Optional. The page title to be used. Defaults to an empty string. * @param string $message Optional. The message to display in the header. Defaults to empty string. * * @return void */ public static function page_header( $title = '', $message = '' ) { GFCommon::gf_root_wrapper_open(); // Print admin styles. wp_print_styles( array( 'jquery-ui-styles', 'gform_admin', 'gform_settings' ) ); $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' ), 'icon' => 'gform-icon--cog' ), ); if ( self::has_recaptcha_tab() ) { $setting_tabs['11'] = array( 'name' => 'recaptcha', 'label' => __( 'reCAPTCHA', 'gravityforms' ), 'icon' => 'gform-icon--recaptcha' ); } // Remove an addon from the sidebar if it is uninstalled from the main uninstall page. if ( rgpost( 'uninstall_addon' ) ) { check_admin_referer( 'uninstall', 'gf_addon_uninstall' ); foreach ( self::$addon_pages as $key => $addon ) { if ( rgpost( 'addon' ) == $addon['tab_label'] ) { unset( self::$addon_pages[ $key ] ); break; } } // Set the uninstalled addon variable to display a success message. self::$uninstalled_addon = rgpost( 'addon' ); } if ( ! empty( self::$addon_pages ) ) { $sorted_addons = self::$addon_pages; usort( $sorted_addons, function ( $a, $b ) { return strnatcasecmp( $a['tab_label'], $b['tab_label'] ); } ); // 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' ) ), 'icon' => rgar( $sorted_addon, 'icon', 'gform-icon--cog' ), ); } } // Prevent Uninstall tab from being added for users that don't have gravityforms_uninstall capability. if ( GFCommon::current_user_can_uninstall() ) { $setting_tabs[] = array( 'name' => 'uninstall', 'label' => __( 'Uninstall', 'gravityforms' ), 'icon' => 'gform-icon--trash', ); } /** * Filters the Settings menu tabs. * * @since Unknown * * @param array $setting_tabs The settings tab names and labels. */ $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']; } } } ?>