diff --git a/addons/install_info.php b/addons/install_info.php deleted file mode 100644 index 46784aba..00000000 --- a/addons/install_info.php +++ /dev/null @@ -1,417 +0,0 @@ -addon = $ultimatemember->addons['install_info']; - add_submenu_page('ultimatemember', "System Info","System Info", 'manage_options', 'um_install_info', array(&$this, 'content') ); - - } - - function um_admin_addon_hook( $hook ) { - switch ( $hook ) { - - case 'download_install_info': - - nocache_headers(); - - header( "Content-type: text/plain" ); - header( 'Content-Disposition: attachment; filename="ultimatemember-install-info.txt"' ); - - echo wp_strip_all_tags( $_POST['um-install-info'] ); - exit; - - break; - - default: - - break; - } - - } - - function admin_init() { - if ( isset( $_REQUEST['um-addon-hook'] ) ) { - $hook = $_REQUEST['um-addon-hook']; - do_action("um_admin_addon_hook", $hook ); - } - } - - function content() { - global $wpdb; - - if( !class_exists( 'Browser' ) ) - require_once um_path . 'core/lib/browser.php'; - - // Detect browser - $browser = new Browser(); - - // Get theme info - $theme_data = wp_get_theme(); - $theme = $theme_data->Name . ' ' . $theme_data->Version; - - // Identify Hosting Provider - $host = um_get_host(); - - um_fetch_user( get_current_user_id() ); - ?> - -
- -

Ultimate Member

- -

addon[0]; ?>

- - content ) ) { - echo $this->content; - } else { ?> - -
- -

- - -

-
- - - - __( 'Are sure, maybe some settings not saved', 'ultimate-member' ), 'texts' => array( 'remove' => __( 'Remove', 'ultimate-member' ), 'select' => __( 'Select', 'ultimate-member' ) diff --git a/includes/admin/core/class-admin-forms.php b/includes/admin/core/class-admin-forms.php index 6f6e7eee..6cded95c 100644 --- a/includes/admin/core/class-admin-forms.php +++ b/includes/admin/core/class-admin-forms.php @@ -80,6 +80,8 @@ if ( ! class_exists( 'Admin_Forms' ) ) { $conditional = ! empty( $data['conditional'] ) ? 'data-conditional="' . esc_attr( json_encode( $data['conditional'] ) ) . '"' : ''; $prefix_attr = ! empty( $this->form_data['prefix_id'] ) ? ' data-prefix="' . $this->form_data['prefix_id'] . '" ' : ''; + $type_attr = ' data-field_type="' . $data['type'] . '" '; + $html = ''; if ( $data['type'] != 'hidden' ) { @@ -87,7 +89,7 @@ if ( ! class_exists( 'Admin_Forms' ) ) { if ( strpos( $this->form_data['class'], 'um-top-label' ) !== false ) { - $html .= '
' . $this->render_field_label( $data ); + $html .= '
' . $this->render_field_label( $data ); if ( method_exists( $this, 'render_' . $data['type'] ) ) { @@ -108,7 +110,7 @@ if ( ! class_exists( 'Admin_Forms' ) ) { if ( ! empty( $data['without_label'] ) ) { - $html .= '
'; + $html .= '
'; if ( method_exists( $this, 'render_' . $data['type'] ) ) { @@ -127,7 +129,7 @@ if ( ! class_exists( 'Admin_Forms' ) ) { } else { - $html .= '
' . $this->render_field_label( $data ); + $html .= '
' . $this->render_field_label( $data ); if ( method_exists( $this, 'render_' . $data['type'] ) ) { @@ -150,7 +152,7 @@ if ( ! class_exists( 'Admin_Forms' ) ) { } else { if ( strpos( $this->form_data['class'], 'um-top-label' ) !== false ) { - $html .= ' + $html .= ' ' . $this->render_field_label( $data ); if ( method_exists( $this, 'render_' . $data['type'] ) ) { @@ -172,7 +174,7 @@ if ( ! class_exists( 'Admin_Forms' ) ) { if ( ! empty( $data['without_label'] ) ) { - $html .= ' + $html .= ' '; if ( method_exists( $this, 'render_' . $data['type'] ) ) { @@ -192,7 +194,7 @@ if ( ! class_exists( 'Admin_Forms' ) ) { } else { - $html .= ' + $html .= ' ' . $this->render_field_label( $data ) . ' '; diff --git a/includes/admin/core/class-admin-settings.php b/includes/admin/core/class-admin-settings.php index ccae94c4..2ef86377 100644 --- a/includes/admin/core/class-admin-settings.php +++ b/includes/admin/core/class-admin-settings.php @@ -27,6 +27,8 @@ if ( ! class_exists( 'Admin_Settings' ) ) { //custom content for licenses tab add_filter( 'um_settings_section_licenses__content', array( $this, 'settings_licenses_tab' ), 10, 2 ); + add_filter( 'um_settings_section_install_info__content', array( $this, 'settings_install_info_tab' ), 10, 2 ); + add_filter( 'um_settings_structure', array( $this, 'sorting_licenses_options' ), 9999, 1 ); @@ -45,6 +47,8 @@ if ( ! class_exists( 'Admin_Settings' ) ) { //invalid licenses notice add_action( 'admin_notices', array( $this, 'check_wrong_licenses' ) ); + + add_action( 'admin_init', array( &$this, 'um_download_install_info' ) ); } @@ -1085,7 +1089,15 @@ if ( ! class_exists( 'Admin_Settings' ) ) { 'default' => UM()->um_get_default( 'uninstall_on_delete' ), ) ) - ) + ), + 'install_info' => array( + 'title' => __( 'Install Info', 'ultimate-member' ), + 'fields' => array( + array( + 'type' => 'install_info', + ), + ) + ), ) ); } @@ -1176,7 +1188,7 @@ if ( ! class_exists( 'Admin_Settings' ) ) { do_action( "um_settings_page_before_" . $current_tab . "_" . $current_subtab . "_content" ); - if ( 'licenses' == $current_tab ) { + if ( 'licenses' == $current_tab || 'install_info' == $current_tab ) { do_action( "um_settings_page_" . $current_tab . "_" . $current_subtab . "_before_section" ); $section_fields = $this->get_section_fields( $current_tab, $current_subtab ); @@ -1787,6 +1799,362 @@ if ( ! class_exists( 'Admin_Settings' ) ) { return $section; } + + function settings_install_info_tab( $html, $section_fields ) { + global $wpdb; + + if ( ! class_exists( '\Browser' ) ) + require_once um_path . 'includes/lib/browser.php'; + + // Detect browser + $browser = new \Browser(); + + // Get theme info + $theme_data = wp_get_theme(); + $theme = $theme_data->Name . ' ' . $theme_data->Version; + + // Identify Hosting Provider + $host = um_get_host(); + + um_fetch_user( get_current_user_id() ); + + if ( isset( $this->content ) ) { + echo $this->content; + } else { ?> + +

Install Info

+ +
+ +

+ + +

+
+ + '; - } else { - echo '—'; - } + echo ! empty( $item['_um_is_custom'] ) ? __( 'Yes', 'ultimate-member' ) : __( 'No', 'ultimate-member' ); } function column_admin_access( $item ) { - if ( ! empty( $item['_um_can_access_wpadmin'] ) ) { - echo ''; - } else { - echo __( 'No', 'ultimate-member' ); - } + echo ! empty( $item['_um_can_access_wpadmin'] ) ? __( 'Yes', 'ultimate-member' ) : __( 'No', 'ultimate-member' ); }