| @@ -10,9 +10,16 @@ | ||
| 10 | 10 | |
| 11 | 11 | namespace MainWP\Dashboard\Module\Log; |
| 12 | 12 | |
| 13 | 13 | use MainWP\Dashboard\MainWP_Utility; |
| 14 | +use MainWP\Dashboard\MainWP_UI; | |
| 14 | 15 | |
| 16 | +// Exit if accessed directly. | |
| 17 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 18 | + exit; | |
| 19 | +} | |
| 20 | + | |
| 21 | + | |
| 15 | 22 | /** |
| 16 | 23 | * Class Log_Users_Widget |
| 17 | 24 | * |
| 18 | 25 | * Displays the Logs info. |
| @@ -77,43 +84,47 @@ | ||
| 77 | 84 | } |
| 78 | 85 | |
| 79 | 86 | ?> |
| 80 | 87 | <div class="mainwp-widget-header"> |
| 81 | - <h3 class="ui header handle-drag"> | |
| 88 | + <h2 class="ui header handle-drag"> | |
| 82 | 89 | <?php esc_html_e( 'User Management Events Summary', 'mainwp' ); ?> |
| 83 | 90 | <div class="sub header"> |
| 84 | 91 | <?php esc_html_e( 'Displays a tally of user-related actions with a total event count.', 'mainwp' ); ?> |
| 85 | 92 | </div> |
| 86 | - </h3> | |
| 93 | + </h2> | |
| 87 | 94 | </div> |
| 88 | 95 | |
| 89 | - <div class="mainwp-widget-insights-card"> | |
| 90 | - <?php | |
| 91 | - /** | |
| 92 | - * Action: mainwp_logs_widget_top | |
| 93 | - * | |
| 94 | - * Fires at the top of the widget. | |
| 95 | - * | |
| 96 | - * @since 4.6 | |
| 97 | - */ | |
| 98 | - do_action( 'mainwp_logs_widget_top', 'users' ); | |
| 99 | - ?> | |
| 100 | - <div id="mainwp-message-zone" style="display:none;" class="ui message"></div> | |
| 101 | - <?php | |
| 102 | - wp_nonce_field( 'mainwp-admin-nonce' ); | |
| 96 | + <div class="mainwp-widget-insights-card mainwp-scrolly-overflow"> | |
| 97 | + <?php | |
| 98 | + /** | |
| 99 | + * Action: mainwp_logs_widget_top | |
| 100 | + * | |
| 101 | + * Fires at the top of the widget. | |
| 102 | + * | |
| 103 | + * @since 4.6 | |
| 104 | + */ | |
| 105 | + do_action( 'mainwp_logs_widget_top', 'users' ); | |
| 106 | + ?> | |
| 107 | + <div id="mainwp-message-zone" style="display:none;" class="ui message"></div> | |
| 108 | + <?php | |
| 109 | + MainWP_UI::generate_wp_nonce( 'mainwp-admin-nonce' ); | |
| 110 | + if ( ! empty( $data ) ) { | |
| 103 | 111 | $this->render_widget_content( $stats_data, $stats_prev_data ); |
| 104 | - ?> | |
| 105 | - <?php | |
| 106 | - /** | |
| 107 | - * Action: mainwp_logs_widget_bottom | |
| 108 | - * | |
| 109 | - * Fires at the bottom of the widget. | |
| 110 | - * | |
| 111 | - * @since 4.6 | |
| 112 | - */ | |
| 113 | - do_action( 'mainwp_logs_widget_bottom', 'users' ); | |
| 114 | - ?> | |
| 115 | - </div> | |
| 112 | + } else { | |
| 113 | + MainWP_UI::render_empty_element_placeholder( __( 'No activity recorded', 'mainwp' ), __( 'Data will appear here once actions are tracked.', 'mainwp' ), '<em data-emoji=":bar_chart:" class="medium"></em>' ); | |
| 114 | + } | |
| 115 | + ?> | |
| 116 | + <?php | |
| 117 | + /** | |
| 118 | + * Action: mainwp_logs_widget_bottom | |
| 119 | + * | |
| 120 | + * Fires at the bottom of the widget. | |
| 121 | + * | |
| 122 | + * @since 4.6 | |
| 123 | + */ | |
| 124 | + do_action( 'mainwp_logs_widget_bottom', 'users' ); | |
| 125 | + ?> | |
| 126 | + </div> | |
| 116 | 127 | <div class="mainwp-widget-footer ui four columns stackable grid"> |
| 117 | 128 | <div class="column"> |
| 118 | 129 | </div> |
| 119 | 130 | <div class="column"> |
| @@ -137,10 +148,10 @@ | ||
| 137 | 148 | 'change_role' => esc_html__( 'Role Changes', 'mainwp' ), |
| 138 | 149 | 'total_events' => esc_html__( 'Total', 'mainwp' ), |
| 139 | 150 | ); |
| 140 | 151 | ?> |
| 141 | - <div class="ui one column grid"> | |
| 142 | - <div class="left aligned middle aligned column"> | |
| 152 | + <div class="ui grid"> | |
| 153 | + <div class="sixteen wide column"> | |
| 143 | 154 | <div class="ui equal width grid"> |
| 144 | 155 | <?php |
| 145 | 156 | foreach ( $columns as $act => $title ) { |
| 146 | 157 | Log_Stats::render_stats_info( $data, $act, $title, $prev_data ); |
| @@ -147,9 +158,9 @@ | ||
| 147 | 158 | } |
| 148 | 159 | ?> |
| 149 | 160 | </div> |
| 150 | 161 | </div> |
| 151 | - <div class="left aligned middle aligned column"> | |
| 162 | + <div class="sixteen wide column"> | |
| 152 | 163 | <div id="mainwp-module-log-chart-users-management-wrapper" ></div> |
| 153 | 164 | <script type="text/javascript"> |
| 154 | 165 | jQuery( document ).ready( function() { |
| 155 | 166 | let options = { |