Add gravity flow demo
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
if ( ! class_exists( 'GFForms' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Class GF_System_Status
|
||||
*
|
||||
* Handles the system status page.
|
||||
*
|
||||
* @since 2.2
|
||||
*/
|
||||
class GF_System_Status {
|
||||
|
||||
/**
|
||||
* Determines which system status page to display.
|
||||
*
|
||||
* @since 2.2
|
||||
* @access public
|
||||
*/
|
||||
public static function system_status_page() {
|
||||
|
||||
$subview = rgget( 'subview' ) ? rgget( 'subview' ) : 'report';
|
||||
|
||||
switch ( $subview ) {
|
||||
case 'report':
|
||||
GF_System_Report::system_report();
|
||||
break;
|
||||
case 'updates':
|
||||
GF_Update::updates();
|
||||
break;
|
||||
default:
|
||||
/**
|
||||
* Fires when the settings page view is determined
|
||||
*
|
||||
* Used to add additional pages to the form settings
|
||||
*
|
||||
* @since Unknown
|
||||
*
|
||||
* @param string $subview Used to complete the action name, allowing an additional subview to be detected
|
||||
*/
|
||||
do_action( "gform_system_status_page_{$subview}" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get System Status page subviews.
|
||||
*
|
||||
* @since 2.2
|
||||
* @access public
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function get_subviews() {
|
||||
|
||||
// Define default subview.
|
||||
$subviews = array(
|
||||
10 => array(
|
||||
'name' => 'report',
|
||||
'label' => __( 'System Report', 'gravityforms' ),
|
||||
),
|
||||
);
|
||||
|
||||
// Add Update subview if user has capabilities.
|
||||
if ( current_user_can( 'install_plugins' ) ) {
|
||||
$subviews[20] = array(
|
||||
'name' => 'updates',
|
||||
'label' => __( 'Updates', 'gravityforms' ),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modify menu items which will appear in the System Status menu.
|
||||
*
|
||||
* @since 2.2
|
||||
* @param array $subviews An array of menu items to be displayed on the System Status page.
|
||||
*/
|
||||
$subviews = apply_filters( 'gform_system_status_menu', $subviews );
|
||||
|
||||
ksort( $subviews, SORT_NUMERIC );
|
||||
|
||||
return $subviews;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get current System Status subview.
|
||||
*
|
||||
* @since 2.2
|
||||
* @access public
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function get_current_subview() {
|
||||
|
||||
return rgempty( 'subview', $_GET ) ? 'report' : rgget( 'subview' );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Render System Status page header.
|
||||
*
|
||||
* @since 2.2
|
||||
* @access public
|
||||
*
|
||||
* @param string $title Page title.
|
||||
*
|
||||
* @uses GFCommon::display_dismissible_message()
|
||||
* @uses GFCommon::get_base_url()
|
||||
* @uses GFCommon::get_browser_class()
|
||||
* @uses GFCommon::get_remote_message()
|
||||
* @uses GFSystemStatus::get_current_subview()
|
||||
* @uses GFSystemStatus::get_subviews()
|
||||
*/
|
||||
public static function page_header( $title = '' ) {
|
||||
|
||||
// Print admin styles.
|
||||
wp_print_styles( array( 'jquery-ui-styles', 'gform_admin', 'wp-pointer' ) );
|
||||
|
||||
// get view details
|
||||
$subviews = self::get_subviews();
|
||||
|
||||
?>
|
||||
|
||||
<?php echo GFCommon::get_remote_message(); ?>
|
||||
<div class="wrap <?php echo GFCommon::get_browser_class() ?>">
|
||||
|
||||
<h2><?php esc_html_e( 'System Status', 'gravityforms' ) ?></h2>
|
||||
<?php GFCommon::display_dismissible_message(); ?>
|
||||
|
||||
<div id="gform_tab_group" class="gform_tab_group vertical_tabs">
|
||||
|
||||
<ul id="gform_tabs" class="gform_tabs">
|
||||
<?php foreach( $subviews as $view ):
|
||||
$query = array( 'subview' => $view['name'] );
|
||||
if( isset( $view['query'] ) )
|
||||
$query = array_merge( $query, $view['query'] );
|
||||
?>
|
||||
<li <?php echo self::get_current_subview() == $view['name'] ? 'class="active"' : '' ?>>
|
||||
<a href="<?php echo esc_url( add_query_arg( $query ) ); ?>"><?php echo $view['label'] ?></a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
|
||||
<div id="gform_tab_container" class="gform_tab_container">
|
||||
<div class="gform_tab_content" id="tab_<?php echo self::get_current_subview() ?>">
|
||||
|
||||
<?php
|
||||
}
|
||||
|
||||
/**
|
||||
* Render System Status page footer.
|
||||
*
|
||||
* @since 2.2
|
||||
* @access public
|
||||
*/
|
||||
public static function page_footer() {
|
||||
?>
|
||||
|
||||
</div> <!-- / gform_tab_content -->
|
||||
</div> <!-- / gform_tab_container -->
|
||||
</div> <!-- / gform_tab_group -->
|
||||
|
||||
<br class="clear" style="clear: both;" />
|
||||
|
||||
</div> <!-- / wrap -->
|
||||
|
||||
<script type="text/javascript">
|
||||
jQuery(document).ready( function( $ ) {
|
||||
$( '.gform_tab_container' ).css( 'minHeight', jQuery( '#gform_tabs' ).height() + 100 );
|
||||
} );
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
<?php
|
||||
|
||||
if ( ! class_exists( 'GFForms' ) ) {
|
||||
die();
|
||||
}
|
||||
|
||||
/**
|
||||
* Class GF_Update
|
||||
*
|
||||
* Handles the Updates subview on the System Status page.
|
||||
*/
|
||||
class GF_Update {
|
||||
|
||||
/**
|
||||
* Display updates page.
|
||||
*
|
||||
* @since 2.2
|
||||
* @access public
|
||||
*
|
||||
* @uses GFSystemReport::get_system_report()
|
||||
* @uses GFSystemReport::maybe_process_action()
|
||||
* @uses GFSystemReport::prepare_item_value()
|
||||
* @uses GFSystemStatus::page_footer()
|
||||
* @uses GFSystemStatus::page_header()
|
||||
*/
|
||||
public static function updates() {
|
||||
|
||||
// If user does not have access to this page, die.
|
||||
if ( ! GFCommon::current_user_can_any( 'gravityforms_view_updates' ) ) {
|
||||
wp_die( esc_html__( "You don't have permissions to view this page", 'gravityforms' ) );
|
||||
}
|
||||
|
||||
// Get available updates.
|
||||
$updates = self::available_updates();
|
||||
|
||||
// Display page header.
|
||||
GF_System_Status::page_header();
|
||||
|
||||
wp_print_styles( array( 'thickbox' ) );
|
||||
|
||||
?>
|
||||
<h3><span><?php esc_html_e( 'Updates', 'gravityforms' )?></span></h3>
|
||||
<table class="wp-list-table widefat plugins">
|
||||
<thead>
|
||||
<tr>
|
||||
<td id="cb" class="manage-column column-cb check-column">
|
||||
|
||||
</td>
|
||||
<th scope="col" id="name" class="manage-column column-name column-primary"><?php esc_html_e( 'Plugin', 'gravityforms' ); ?></th>
|
||||
<th scope="col" id="description" class="manage-column column-description"><?php esc_html_e( 'Description', 'gravityforms' ); ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody id="the-list">
|
||||
<?php
|
||||
// All installed plugins
|
||||
$plugins = get_plugins();
|
||||
|
||||
// Loop through updates.
|
||||
foreach ( $updates as $update ) {
|
||||
$update_available = version_compare( $update['installed_version'], $update['latest_version'], '<' );
|
||||
$update_class = $update_available ? ' update' : '';
|
||||
$settings_link = $update['slug'] == 'gravityforms' ? admin_url( 'admin.php?page=gf_settings' ) : admin_url( 'admin.php?page=gf_settings&subview=' . $update['slug'] );
|
||||
$plugin = $plugins[ $update['path'] ];
|
||||
|
||||
?>
|
||||
<tr class="inactive<?php echo $update_class?>" data-slug="admin-bar-form-search" data-plugin="gw-admin-bar-form-manager.php">
|
||||
<th scope="row" class="check-column">
|
||||
|
||||
</th>
|
||||
<td class="plugin-title column-primary"><strong><?php echo $update['name'] ?></strong>
|
||||
<div class="row-actions visible">
|
||||
<span class="deactivate"><a href="<?php echo $settings_link ?>"><?php esc_html_e( 'Settings', 'gravityforms' ) ?></a></span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="column-description desc">
|
||||
<div class="plugin-description">
|
||||
<p><?php echo $plugin['Description']?></p>
|
||||
</div>
|
||||
<div class="active second plugin-version-author-uri">
|
||||
Version <?php echo $update['installed_version'] ?> |
|
||||
<a href="<?php echo $plugin['PluginURI'] ?>"><?php esc_html_e( 'Visit plugin page', 'gravityforms' ) ?></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php if ( $update_available ) { ?>
|
||||
<tr class="plugin-update-tr inactive">
|
||||
<td colspan="3" class="plugin-update colspanchange">
|
||||
<div class="update-message notice inline notice-warning notice-alt">
|
||||
<p>
|
||||
<?php
|
||||
|
||||
printf( esc_html__( 'There is a new version of %s available.', 'gravityforms' ), $update['name'] );
|
||||
|
||||
if ( $update['is_valid_key'] ) {
|
||||
|
||||
printf( esc_html__( '%1$sView version %2$s details %3$s or %4$supdate now%5$s.', 'gravityforms' ),
|
||||
'<a href="plugin-install.php?tab=plugin-information&plugin=' . urlencode( $update['slug'] ) . '§ion=changelog&TB_iframe=true&width=600&height=700" class="thickbox open-plugin-details-modal">',
|
||||
$update['latest_version'],
|
||||
'</a>',
|
||||
'<a href="' . $update['upgrade_url'] . '" class="update-link">',
|
||||
'</a>'
|
||||
);
|
||||
|
||||
} else {
|
||||
|
||||
printf(
|
||||
esc_html( ' %sRegister%s your copy of Gravity Forms to receive access to automatic updates and support. Need a license key? %sPurchase one now%s.', 'gravityforms' ),
|
||||
'<a href="admin.php?page=gf_settings">',
|
||||
'</a>',
|
||||
'<a href="https://www.gravityforms.com">',
|
||||
'</a>'
|
||||
);
|
||||
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
// Display page footer.
|
||||
GF_System_Status::page_footer();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get available Gravity Forms updates.
|
||||
*
|
||||
* @since 2.2
|
||||
* @access public
|
||||
*
|
||||
* @uses GFCommon::get_version_info()
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function available_updates() {
|
||||
|
||||
// Initialize updates array.
|
||||
$updates = array();
|
||||
|
||||
// Get Gravity Forms version info.
|
||||
$version_info = GFCommon::get_version_info( false );
|
||||
|
||||
// Define Gravity Forms plugin path.
|
||||
$plugin_path = 'gravityforms/gravityforms.php';
|
||||
|
||||
// Get upgrade URL.
|
||||
$upgrade_url = wp_nonce_url( 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin_path ), 'upgrade-plugin_' . $plugin_path );
|
||||
|
||||
// Prepare version message and icon.
|
||||
if ( version_compare( GFCommon::$version, $version_info['version'], '>=' ) ) {
|
||||
|
||||
$version_icon = 'dashicons-yes';
|
||||
$version_message = esc_html__( 'Your version of Gravity Forms is up to date.', 'gravityforms' );
|
||||
|
||||
} else {
|
||||
|
||||
if ( rgar( $version_info, 'is_valid_key' ) ) {
|
||||
|
||||
$version_icon = 'dashicons-no';
|
||||
$version_message = sprintf(
|
||||
'%s<p>%s</p>',
|
||||
esc_html__( 'There is a new version of Gravity Forms available.', 'gravityforms' ),
|
||||
esc_html__( 'You can update to the latest version automatically or download the update and install it manually.', 'gravityforms' )
|
||||
);
|
||||
} else {
|
||||
|
||||
|
||||
$version_icon = 'dashicons-no';
|
||||
$version_message = sprintf(
|
||||
'%s<p>%s</p>',
|
||||
esc_html__( 'There is a new version of Gravity Forms available.', 'gravityforms' ),
|
||||
sprintf(
|
||||
esc_html( '%sRegister%s your copy of Gravity Forms to receive access to automatic updates and support. Need a license key? %sPurchase one now%s.', 'gravityforms' ),
|
||||
'<a href="admin.php?page=gf_settings">',
|
||||
'</a>',
|
||||
'<a href="https://www.gravityforms.com">',
|
||||
'</a>'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Add Gravity Forms core to updates array.
|
||||
$updates[] = array(
|
||||
'is_valid_key' => rgar( $version_info, 'is_valid_key' ),
|
||||
'name' => esc_html__( 'Gravity Forms', 'gravityforms' ),
|
||||
'path' => $plugin_path,
|
||||
'slug' => 'gravityforms',
|
||||
'latest_version' => $version_info['version'],
|
||||
'installed_version' => GFCommon::$version,
|
||||
'upgrade_url' => $upgrade_url,
|
||||
'download_url' => $version_info['url'],
|
||||
'version_icon' => $version_icon,
|
||||
'version_message' => $version_message,
|
||||
);
|
||||
|
||||
/**
|
||||
* Modify plugins displayed on the Updates page.
|
||||
*
|
||||
* @since 2.2
|
||||
*
|
||||
* @param array $updates An array of plugins displayed on the Updates page.
|
||||
*/
|
||||
$updates = apply_filters( 'gform_updates_list', $updates );
|
||||
|
||||
return $updates;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
7
backend/wordpress/wp-content/plugins/gravityforms-master/includes/system-status/js/clipboard.min.js
vendored
Executable file
7
backend/wordpress/wp-content/plugins/gravityforms-master/includes/system-status/js/clipboard.min.js
vendored
Executable file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user