| @@ -1,13 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * MainWP Client Overview Page. |
| 4 | 4 | * |
| 5 | - * @package MainWP/Dashboard | |
| 5 | + * @package MainWP/Dashboard | |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace MainWP\Dashboard; |
| 9 | 9 | |
| 10 | +// Exit if accessed directly. | |
| 11 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 12 | + exit; | |
| 13 | +} | |
| 14 | + | |
| 10 | 15 | /** |
| 11 | 16 | * Class MainWP_Overview |
| 12 | 17 | * |
| 13 | 18 | * @package MainWP\Dashboard |
| @@ -160,9 +165,9 @@ | ||
| 160 | 165 | |
| 161 | 166 | /** |
| 162 | 167 | * Get getmetaboxes |
| 163 | 168 | * |
| 164 | - * Adds metaboxes (widgets) to the Overview page. | |
| 169 | + * Adds metaboxes (widgets) to the Operations page. | |
| 165 | 170 | * |
| 166 | 171 | * @since 4.3 |
| 167 | 172 | */ |
| 168 | 173 | $extMetaBoxs = array(); |
| @@ -193,9 +198,9 @@ | ||
| 193 | 198 | * |
| 194 | 199 | * Contains the list of enabled widgets and allows user to unset unwanted widgets. |
| 195 | 200 | * |
| 196 | 201 | * @param array $values Array containing enabled widgets. |
| 197 | - * @param int $dashboard_siteid Child site (Overview) ID. | |
| 202 | + * @param int $dashboard_siteid Child site (Operations) ID. | |
| 198 | 203 | * |
| 199 | 204 | * @since 4.3 |
| 200 | 205 | */ |
| 201 | 206 | $values = apply_filters( 'mainwp_clients_overview_enabled_widgets', $values, null ); |
| @@ -200,46 +205,41 @@ | ||
| 200 | 205 | */ |
| 201 | 206 | $values = apply_filters( 'mainwp_clients_overview_enabled_widgets', $values, null ); |
| 202 | 207 | static::$enable_widgets = array_merge( static::$enable_widgets, $values ); |
| 203 | 208 | |
| 204 | - $i = 1; | |
| 205 | - foreach ( $extMetaBoxs as $metaBox ) { | |
| 206 | - $enabled = true; | |
| 207 | - if ( isset( $metaBox['plugin'] ) ) { | |
| 208 | - $name = basename( $metaBox['plugin'], '.php' ); | |
| 209 | - if ( isset( static::$enable_widgets[ $name ] ) && ! static::$enable_widgets[ $name ] ) { | |
| 210 | - $enabled = false; | |
| 211 | - } | |
| 212 | - } | |
| 209 | + // Load the Overview widget. | |
| 210 | + if ( static::$enable_widgets['overview'] ) { | |
| 211 | + MainWP_UI::add_widget_box( 'overview', array( MainWP_Client_Overview_Info::get_class_name(), 'render' ), $page, array( -1, -1, 3, 40 ) ); | |
| 212 | + } | |
| 213 | 213 | |
| 214 | - $id = isset( $metaBox['id'] ) ? $metaBox['id'] : $i++; | |
| 215 | - $id = 'advanced-' . $id; | |
| 214 | + // Load the Notes widget. | |
| 215 | + if ( static::$enable_widgets['note'] ) { | |
| 216 | + MainWP_UI::add_widget_box( 'note', array( MainWP_Client_Overview_Note::get_class_name(), 'render' ), $page, array( -1, -1, 3, 40 ) ); | |
| 217 | + } | |
| 216 | 218 | |
| 217 | - $layout = ! empty( $metaBox['layout'] ) && is_array( $metaBox['layout'] ) ? $metaBox['layout'] : array( 1, 1, 4, 11 ); | |
| 219 | + // Load the Websites widget. | |
| 220 | + if ( static::$enable_widgets['websites'] ) { | |
| 221 | + MainWP_UI::add_widget_box( 'websites', array( MainWP_Client_Overview_Sites::get_class_name(), 'render' ), $page, array( -1, -1, 6, 40 ) ); | |
| 222 | + } | |
| 218 | 223 | |
| 219 | - if ( $enabled ) { | |
| 220 | - MainWP_UI::add_widget_box( $id, $metaBox['callback'], $page, $layout ); | |
| 221 | - } | |
| 224 | + // Load the Info widget. | |
| 225 | + if ( static::$enable_widgets['fields_info'] ) { | |
| 226 | + MainWP_UI::add_widget_box( 'fields_info', array( MainWP_Client_Overview_Custom_Info::get_class_name(), 'render' ), $page, array( -1, -1, 6, 30 ) ); | |
| 222 | 227 | } |
| 223 | 228 | |
| 224 | 229 | // Load the Non-MainWP Changes widget. |
| 225 | 230 | if ( static::$enable_widgets['non_mainwp_changes'] ) { |
| 226 | - MainWP_UI::add_widget_box( 'non_mainwp_changes', array( MainWP_Site_Actions::get_class_name(), 'render' ), $page, array( 1, 1, 4, 9 ) ); | |
| 231 | + MainWP_UI::add_widget_box( 'non_mainwp_changes', array( MainWP_Site_Actions::get_class_name(), 'render' ), $page, array( -1, -1, 6, 30 ) ); | |
| 227 | 232 | } |
| 228 | 233 | |
| 229 | - // Load the Recent Pages widget. | |
| 230 | - if ( static::$enable_widgets['recent_pages'] ) { | |
| 231 | - MainWP_UI::add_widget_box( 'recent_pages', array( MainWP_Recent_Pages::get_class_name(), 'render' ), $page, array( 1, 1, 4, 9 ) ); | |
| 232 | - } | |
| 233 | - | |
| 234 | 234 | // Load the Recent Posts widget. |
| 235 | 235 | if ( static::$enable_widgets['recent_posts'] ) { |
| 236 | - MainWP_UI::add_widget_box( 'recent_posts', array( MainWP_Recent_Posts::get_class_name(), 'render' ), $page, array( 1, 1, 4, 9 ) ); | |
| 236 | + MainWP_UI::add_widget_box( 'recent_posts', array( MainWP_Recent_Posts::get_class_name(), 'render' ), $page, array( -1, -1, 6, 30 ) ); | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | - // Load the Notes widget. | |
| 240 | - if ( static::$enable_widgets['note'] ) { | |
| 241 | - MainWP_UI::add_widget_box( 'note', array( MainWP_Client_Overview_Note::get_class_name(), 'render' ), $page, array( 1, 1, 4, 9 ) ); | |
| 239 | + // Load the Recent Pages widget. | |
| 240 | + if ( static::$enable_widgets['recent_pages'] ) { | |
| 241 | + MainWP_UI::add_widget_box( 'recent_pages', array( MainWP_Recent_Pages::get_class_name(), 'render' ), $page, array( -1, -1, 6, 30 ) ); | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | if ( is_array( $client_contacts ) ) { |
| 245 | 245 | foreach ( $client_contacts as $contact ) { |
| @@ -245,26 +245,31 @@ | ||
| 245 | 245 | foreach ( $client_contacts as $contact ) { |
| 246 | 246 | if ( isset( static::$enable_widgets[ 'contact_' . $contact['contact_id'] ] ) && static::$enable_widgets[ 'contact_' . $contact['contact_id'] ] ) { |
| 247 | 247 | $contact_widget = new MainWP_Client_Overview_Contacts(); |
| 248 | 248 | $contact_widget->contact = $contact; |
| 249 | - MainWP_UI::add_widget_box( 'contact_' . $contact['contact_id'], array( $contact_widget, 'render' ), $page, array( 1, 1, 4, 9 ) ); | |
| 249 | + MainWP_UI::add_widget_box( 'contact_' . $contact['contact_id'], array( $contact_widget, 'render' ), $page, array( -1, -1, 3, 30 ) ); | |
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - // Load the Websites widget. | |
| 255 | - if ( static::$enable_widgets['websites'] ) { | |
| 256 | - MainWP_UI::add_widget_box( 'websites', array( MainWP_Client_Overview_Sites::get_class_name(), 'render' ), $page, array( 1, 1, 4, 9 ) ); | |
| 257 | - } | |
| 254 | + $i = 1; | |
| 255 | + foreach ( $extMetaBoxs as $metaBox ) { | |
| 256 | + $enabled = true; | |
| 257 | + if ( isset( $metaBox['plugin'] ) ) { | |
| 258 | + $name = basename( $metaBox['plugin'], '.php' ); | |
| 259 | + if ( isset( static::$enable_widgets[ $name ] ) && ! static::$enable_widgets[ $name ] ) { | |
| 260 | + $enabled = false; | |
| 261 | + } | |
| 262 | + } | |
| 258 | 263 | |
| 259 | - // Load the Info widget. | |
| 260 | - if ( static::$enable_widgets['fields_info'] ) { | |
| 261 | - MainWP_UI::add_widget_box( 'fields_info', array( MainWP_Client_Overview_Custom_Info::get_class_name(), 'render' ), $page, array( 1, 1, 4, 9 ) ); | |
| 262 | - } | |
| 264 | + $id = isset( $metaBox['id'] ) ? $metaBox['id'] : $i++; | |
| 265 | + $id = 'advanced-' . $id; | |
| 263 | 266 | |
| 264 | - // Load the Overview widget. | |
| 265 | - if ( static::$enable_widgets['overview'] ) { | |
| 266 | - MainWP_UI::add_widget_box( 'overview', array( MainWP_Client_Overview_Info::get_class_name(), 'render' ), $page, array( 1, 1, 4, 9 ) ); | |
| 267 | + $layout = ! empty( $metaBox['layout'] ) && is_array( $metaBox['layout'] ) ? $metaBox['layout'] : array( -1, -1, 6, 30 ); | |
| 268 | + | |
| 269 | + if ( $enabled ) { | |
| 270 | + MainWP_UI::add_widget_box( $id, $metaBox['callback'], $page, $layout ); | |
| 271 | + } | |
| 267 | 272 | } |
| 268 | 273 | } |
| 269 | 274 | |
| 270 | 275 | /** |
| @@ -272,10 +277,10 @@ | ||
| 272 | 277 | * |
| 273 | 278 | * When the page loads render the body content. |
| 274 | 279 | */ |
| 275 | 280 | public function on_show_page() { |
| 276 | - if ( ! mainwp_current_user_have_right( 'dashboard', 'manage_clients' ) && ! mainwp_current_user_have_right( 'dashboard', 'access_client_dashboard' ) ) { | |
| 277 | - mainwp_do_not_have_permissions( esc_html__( 'client dashboard', 'mainwp' ) ); | |
| 281 | + if ( ! \mainwp_current_user_can( 'dashboard', 'manage_clients' ) && ! \mainw\mainwp_current_user_can( 'dashboard', 'access_client_dashboard' ) ) { | |
| 282 | + \mainwp_do_not_have_permissions( esc_html__( 'client dashboard', 'mainwp' ) ); | |
| 278 | 283 | return; |
| 279 | 284 | } |
| 280 | 285 | |
| 281 | 286 | /** |
| @@ -298,108 +303,123 @@ | ||
| 298 | 303 | * |
| 299 | 304 | * Render the Dashboard Body content. |
| 300 | 305 | */ |
| 301 | 306 | public static function render_dashboard_body() { |
| 307 | + | |
| 308 | + MainWP_Ui_Manage_Widgets_Layout::render_modal_save_layout(); | |
| 309 | + | |
| 302 | 310 | $screen = get_current_screen(); |
| 303 | 311 | ?> |
| 304 | 312 | <div class="mainwp-primary-content-wrap"> |
| 305 | - <div id="mainwp-message-zone" class="ui message" style="display:none;"></div> | |
| 306 | - <?php if ( MainWP_Utility::show_mainwp_message( 'notice', 'client-widgets' ) ) : ?> | |
| 307 | - <div class="ui info message"> | |
| 313 | + <div class="ui segment"> | |
| 314 | + <?php if ( MainWP_Utility::show_mainwp_message( 'notice', 'client-widgets' ) ) : ?> | |
| 315 | + <div class="ui message" style="margin:1em;"> | |
| 308 | 316 | <i class="close icon mainwp-notice-dismiss" notice-id="client-widgets"></i> |
| 309 | - <?php printf( esc_html__( 'To hide or show a widget, click the Cog (%1$s) icon.', 'mainwp' ), '<i class="cog icon"></i>' ); ?> | |
| 317 | + <?php /* translators: 1: bulb emoji, 2: cog icon, 3: layout icon */ printf( esc_html__( '%1$s Tip: You can drag and drop widgets to reorder your dashboard, use Page Settings (%2$s) to show or hide widgets, and use Layout (%3$s) in the header to save and load your widget layouts.', 'mainwp' ), '<em data-emoji=":bulb:" class="small"></em>', '<i class="cog fitted icon"></i>', '<i class="all border fitted icon"></i>' ); ?> | |
| 310 | 318 | </div> |
| 311 | - <?php endif; ?> | |
| 312 | - <?php | |
| 313 | - /** | |
| 314 | - * Action: mainwp_before_overview_widgets | |
| 315 | - * | |
| 316 | - * Fires at the top of the Overview page (before first widget). | |
| 317 | - * | |
| 318 | - * @since 4.3 | |
| 319 | - */ | |
| 320 | - do_action( 'mainwp_before_overview_widgets', 'clients' ); | |
| 321 | - ?> | |
| 322 | - <div id="mainwp-grid-wrapper" class="gridster"> | |
| 323 | - <?php MainWP_UI::do_widget_boxes( $screen->id ); ?> | |
| 324 | - </div> | |
| 325 | - <?php | |
| 326 | - /** | |
| 327 | - * Action: 'mainwp_after_overview_widgets' | |
| 328 | - * | |
| 329 | - * Fires at the bottom of the Overview page (after the last widget). | |
| 330 | - * | |
| 331 | - * @since 4.3 | |
| 332 | - */ | |
| 333 | - do_action( 'mainwp_after_overview_widgets', 'clients' ); | |
| 334 | - ?> | |
| 335 | - <script type="text/javascript"> | |
| 336 | - jQuery( document ).ready( function( $ ) { | |
| 337 | - | |
| 338 | - jQuery( '.mainwp-widget .mainwp-dropdown-tab .item' ).tab(); | |
| 339 | - | |
| 340 | - mainwp_clients_overview_screen_options = function () { | |
| 341 | - jQuery( '#mainwp-clients-overview-screen-options-modal' ).modal( { | |
| 342 | - allowMultiple: true, | |
| 343 | - onHide: function () { | |
| 344 | - } | |
| 345 | - } ).modal( 'show' ); | |
| 346 | - return false; | |
| 347 | - }; | |
| 348 | - jQuery('#reset-clients-overview-settings').on('click', function () { | |
| 349 | - mainwp_confirm(__('Are you sure.'), function(){ | |
| 350 | - jQuery('.mainwp_hide_wpmenu_checkboxes input[name="mainwp_show_widgets[]"]').prop('checked', true); | |
| 351 | - jQuery('input[name=reset_client_overview_settings]').attr('value', 1); | |
| 352 | - jQuery('#submit-client-overview-settings').click(); | |
| 353 | - }, false, false, true); | |
| 354 | - return false; | |
| 355 | - }); | |
| 356 | - } ); | |
| 357 | - </script> | |
| 358 | - <div class="ui modal" id="mainwp-clients-overview-screen-options-modal"> | |
| 359 | - <i class="close icon"></i> | |
| 360 | - <div class="header"><?php esc_html_e( 'Page Settings', 'mainwp' ); ?></div> | |
| 361 | - <div class="content ui form"> | |
| 319 | + <?php endif; ?> | |
| 320 | + <div id="mainwp-message-zone" class="ui message" style="display:none;"></div> | |
| 321 | + <?php do_action( 'mainwp_module_log_render_db_update_notice' ); ?> | |
| 322 | + <?php do_action( 'mainwp_module_log_render_db_size_notice', 300, 'client_overview' ); ?> | |
| 362 | 323 | <?php |
| 363 | 324 | /** |
| 364 | - * Action: mainwp_clients_overview_screen_options_top | |
| 325 | + * Action: mainwp_before_overview_widgets | |
| 365 | 326 | * |
| 366 | - * Fires at the top of the Sceen Options modal on the Overview page. | |
| 327 | + * Fires at the top of the Operations page (before first widget). | |
| 367 | 328 | * |
| 368 | - * @since 4.1 | |
| 329 | + * @since 4.3 | |
| 369 | 330 | */ |
| 370 | - do_action( 'mainwp_clients_overview_screen_options_top' ); | |
| 331 | + do_action( 'mainwp_before_overview_widgets', 'clients' ); | |
| 371 | 332 | ?> |
| 372 | - <form method="POST" action="" name="mainwp_clients_overview_screen_options_form" id="mainwp-clients-overview-screen-options-form"> | |
| 373 | - <?php wp_nonce_field( 'mainwp-admin-nonce' ); ?> | |
| 374 | - <input type="hidden" name="wp_scr_options_nonce" value="<?php echo esc_attr( wp_create_nonce( 'MainWPClientsScrOptions' ) ); ?>" /> | |
| 375 | - <?php static::render_screen_options( false ); ?> | |
| 333 | + <div id="mainwp-grid-wrapper" class="gridster"> | |
| 334 | + <div id="mainwp-widgets-placeholder" class="ui page dimmer"> | |
| 335 | + <div class="ui double text loader"><?php esc_html_e( 'Loading...', 'mainwp' ); ?></div> | |
| 336 | + </div> | |
| 337 | + <script> | |
| 338 | + jQuery( document ).ready( function () { | |
| 339 | + jQuery('#mainwp-widgets-placeholder').dimmer('show'); | |
| 340 | + }); | |
| 341 | + </script> | |
| 342 | + <?php MainWP_UI::do_widget_boxes( $screen->id ); ?> | |
| 343 | + </div> | |
| 344 | + <?php | |
| 345 | + /** | |
| 346 | + * Action: 'mainwp_after_overview_widgets' | |
| 347 | + * | |
| 348 | + * Fires at the bottom of the Operations page (after the last widget). | |
| 349 | + * | |
| 350 | + * @since 4.3 | |
| 351 | + */ | |
| 352 | + do_action( 'mainwp_after_overview_widgets', 'clients' ); | |
| 353 | + ?> | |
| 354 | + </div> | |
| 355 | + <script type="text/javascript"> | |
| 356 | + jQuery( document ).ready( function( $ ) { | |
| 357 | + | |
| 358 | + jQuery( '.mainwp-widget .mainwp-dropdown-tab .item' ).tab(); | |
| 359 | + | |
| 360 | + mainwp_clients_overview_screen_options = function () { | |
| 361 | + jQuery( '#mainwp-clients-overview-screen-options-modal' ).modal( { | |
| 362 | + allowMultiple: true, | |
| 363 | + onHide: function () { | |
| 364 | + } | |
| 365 | + } ).modal( 'show' ); | |
| 366 | + return false; | |
| 367 | + }; | |
| 368 | + jQuery('#reset-clients-overview-settings').on('click', function () { | |
| 369 | + mainwp_confirm(__('Are you sure?'), function(){ | |
| 370 | + jQuery('.mainwp_hide_wpmenu_checkboxes input[name="mainwp_show_widgets[]"]').prop('checked', true); | |
| 371 | + jQuery('input[name=reset_client_overview_settings]').attr('value', 1); | |
| 372 | + jQuery('#submit-client-overview-settings').click(); | |
| 373 | + }, false, false, true); | |
| 374 | + return false; | |
| 375 | + }); | |
| 376 | + } ); | |
| 377 | + </script> | |
| 378 | + <div class="ui modal" id="mainwp-clients-overview-screen-options-modal"> | |
| 379 | + <i class="close icon"></i> | |
| 380 | + <div class="header"><?php esc_html_e( 'Page Settings', 'mainwp' ); ?></div> | |
| 381 | + <div class="content ui form"> | |
| 376 | 382 | <?php |
| 377 | 383 | /** |
| 378 | - * Action: mainwp_clients_overview_screen_options_bottom | |
| 384 | + * Action: mainwp_clients_overview_screen_options_top | |
| 379 | 385 | * |
| 380 | - * Fires at the bottom of the Sceen Options modal on the Overview page. | |
| 386 | + * Fires at the top of the Sceen Options modal on the Operations page. | |
| 381 | 387 | * |
| 382 | 388 | * @since 4.1 |
| 383 | 389 | */ |
| 384 | - do_action( 'mainwp_clients_overview_screen_options_bottom' ); | |
| 390 | + do_action( 'mainwp_clients_overview_screen_options_top' ); | |
| 385 | 391 | ?> |
| 386 | - </div> | |
| 387 | - <div class="actions"> | |
| 388 | - <div class="ui two columns grid"> | |
| 389 | - <div class="left aligned column"> | |
| 390 | - <span data-tooltip="<?php esc_attr_e( 'Resets the page to its original layout and reinstates relocated widgets.', 'mainwp' ); ?>" data-inverted="" data-position="top left"><input type="button" class="ui button" name="reset" id="reset-clients-overview-settings" value="<?php esc_attr_e( 'Reset Page', 'mainwp' ); ?>" /></span> | |
| 392 | + <form method="POST" action="" name="mainwp_clients_overview_screen_options_form" id="mainwp-clients-overview-screen-options-form"> | |
| 393 | + <?php MainWP_UI::generate_wp_nonce( 'mainwp-admin-nonce' ); ?> | |
| 394 | + <input type="hidden" name="wp_scr_options_nonce" value="<?php echo esc_attr( wp_create_nonce( 'MainWPClientsScrOptions' ) ); ?>" /> | |
| 395 | + <?php static::render_screen_options( false ); ?> | |
| 396 | + <?php | |
| 397 | + /** | |
| 398 | + * Action: mainwp_clients_overview_screen_options_bottom | |
| 399 | + * | |
| 400 | + * Fires at the bottom of the Sceen Options modal on the Operations page. | |
| 401 | + * | |
| 402 | + * @since 4.1 | |
| 403 | + */ | |
| 404 | + do_action( 'mainwp_clients_overview_screen_options_bottom' ); | |
| 405 | + ?> | |
| 391 | 406 | </div> |
| 392 | - <div class="ui right aligned column"> | |
| 393 | - <input type="submit" class="ui green button" id="submit-client-overview-settings" value="<?php esc_attr_e( 'Save Settings', 'mainwp' ); ?>" /> | |
| 407 | + <div class="actions"> | |
| 408 | + <div class="ui two columns grid"> | |
| 409 | + <div class="left aligned column"> | |
| 410 | + <span data-tooltip="<?php esc_attr_e( 'Resets the page to its original layout and reinstates relocated widgets.', 'mainwp' ); ?>" data-inverted="" data-position="top left"><input type="button" class="ui button" name="reset" id="reset-clients-overview-settings" value="<?php esc_attr_e( 'Reset Page', 'mainwp' ); ?>" /></span> | |
| 411 | + </div> | |
| 412 | + <div class="ui right aligned column"> | |
| 413 | + <input type="submit" class="ui green button" id="submit-client-overview-settings" value="<?php esc_attr_e( 'Save Settings', 'mainwp' ); ?>" /> | |
| 414 | + </div> | |
| 415 | + </div> | |
| 394 | 416 | </div> |
| 395 | - </div> | |
| 396 | - </div> | |
| 397 | 417 | |
| 398 | - <input type="hidden" name="reset_client_overview_settings" value="" /> | |
| 418 | + <input type="hidden" name="reset_client_overview_settings" value="" /> | |
| 399 | 419 | </form> |
| 420 | + </div> | |
| 400 | 421 | </div> |
| 401 | - </div> | |
| 402 | 422 | <?php |
| 403 | 423 | } |
| 404 | 424 | |
| 405 | 425 | /** |
| @@ -417,9 +437,9 @@ | ||
| 417 | 437 | 'fields_info' => esc_html__( 'Addition Info', 'mainwp' ), |
| 418 | 438 | 'websites' => esc_html__( 'Websites', 'mainwp' ), |
| 419 | 439 | 'recent_posts' => esc_html__( 'Recent Posts', 'mainwp' ), |
| 420 | 440 | 'recent_pages' => esc_html__( 'Recent Pages', 'mainwp' ), |
| 421 | - 'non_mainwp_changes' => esc_html__( 'Non-MainWP Changes', 'mainwp' ), | |
| 441 | + 'non_mainwp_changes' => esc_html__( 'Network Activity', 'mainwp' ), | |
| 422 | 442 | ); |
| 423 | 443 | |
| 424 | 444 | if ( isset( $_GET['client_id'] ) && ! empty( $_GET['client_id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 425 | 445 | $client_contacts = MainWP_DB_Client::instance()->get_wp_client_contact_by( 'client_id', intval( $_GET['client_id'] ), ARRAY_A ); // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| @@ -434,9 +454,9 @@ | ||
| 434 | 454 | $custom_opts = array(); |
| 435 | 455 | /** |
| 436 | 456 | * Filter: mainwp_clients_widgets_screen_options |
| 437 | 457 | * |
| 438 | - * Filters available widgets on the Overview page allowing users to unsent unwanted widgets. | |
| 458 | + * Filters available widgets on the Operations page allowing users to unset unwanted widgets. | |
| 439 | 459 | * |
| 440 | 460 | * @since 4.0 |
| 441 | 461 | */ |
| 442 | 462 | $custom_opts = apply_filters( 'mainwp_clients_widgets_screen_options', $custom_opts ); |
| @@ -461,9 +481,9 @@ | ||
| 461 | 481 | ?> |
| 462 | 482 | <?php if ( isset( $_GET['page'] ) ) : // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized ?> |
| 463 | 483 | <div class="ui grid field"> |
| 464 | 484 | <label class="six wide column"><?php esc_html_e( 'Show widgets', 'mainwp' ); ?></label> |
| 465 | - <div class="ten wide column" <?php echo 'data-tooltip="' . esc_attr__( 'Select widgets that you want to hide in the MainWP Overview page.', 'mainwp' ) . '"'; ?> data-inverted="" data-position="top left"> | |
| 485 | + <div class="ten wide column" <?php echo 'data-tooltip="' . esc_attr__( 'Select widgets that you want to hide in the MainWP Operations page.', 'mainwp' ) . '"'; ?> data-inverted="" data-position="top left"> | |
| 466 | 486 | <ul class="mainwp_hide_wpmenu_checkboxes"> |
| 467 | 487 | <?php |
| 468 | 488 | foreach ( $default_widgets as $name => $title ) { |
| 469 | 489 | $_selected = ''; |
| @@ -499,23 +519,27 @@ | ||
| 499 | 519 | |
| 500 | 520 | /** |
| 501 | 521 | * Method mainwp_help_content() |
| 502 | 522 | * |
| 503 | - * Hook the section help content to the Help Sidebar element | |
| 504 | - * | |
| 505 | - * @return void | |
| 523 | + * Creates the MainWP Help Documentation List for the help component in the sidebar. | |
| 506 | 524 | */ |
| 507 | 525 | public static function mainwp_help_content() { |
| 508 | 526 | if ( isset( $_GET['page'] ) && 'ManageClients' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized |
| 509 | 527 | ?> |
| 510 | 528 | <p><?php esc_html_e( 'If you need help with your MainWP Dashboard, please review following help documents', 'mainwp' ); ?></p> |
| 511 | - <div class="ui relaxed bulleted list"> | |
| 512 | - <div class="item"><a href="https://kb.mainwp.com/docs/manage-clients/" target="_blank">Manage Clients</a> <i class="external alternate icon"></i></div> <?php // NOSONAR - noopener - open safe. ?> | |
| 529 | + <div class="ui list"> | |
| 530 | + <div class="item"><i class="external alternate icon"></i> <a href="https://docs.mainwp.com/clients/manage-clients" target="_blank">Manage Clients</a></div> <?php // NOSONAR - noopener - open safe. ?> | |
| 531 | + <div class="item"><i class="external alternate icon"></i> <a href="https://docs.mainwp.com/clients/manage-clients#create-a-new-client" target="_blank">Create a new Client</a></div> <?php // NOSONAR - noopener - open safe. ?> | |
| 532 | + <div class="item"><i class="external alternate icon"></i> <a href="https://docs.mainwp.com/clients/manage-clients#update-a-client" target="_blank">Update a Client</a></div> <?php // NOSONAR - noopener - open safe. ?> | |
| 533 | + <div class="item"><i class="external alternate icon"></i> <a href="https://docs.mainwp.com/clients/manage-clients#update-a-client" target="_blank">Delete a Client</a></div> <?php // NOSONAR - noopener - open safe. ?> | |
| 534 | + <div class="item"><i class="external alternate icon"></i> <a href="https://docs.mainwp.com/clients/manage-clients#customize-the-manage-clients-table" target="_blank">Customize the Manage Clients table</a></div> <?php // NOSONAR - noopener - open safe. ?> | |
| 535 | + <div class="item"><i class="external alternate icon"></i> <a href="https://docs.mainwp.com/clients/manage-clients#client-card" target="_blank">Client Card (View Client)</a></div> <?php // NOSONAR - noopener - open safe. ?> | |
| 536 | + <div class="item"><i class="external alternate icon"></i> <a href="https://docs.mainwp.com/clients/manage-clients#client-fields" target="_blank">Client Fields</a></div> <?php // NOSONAR - noopener - open safe. ?> | |
| 513 | 537 | <?php |
| 514 | 538 | /** |
| 515 | 539 | * Action: mainwp_clients_overview_help_item |
| 516 | 540 | * |
| 517 | - * Fires at the bottom of the help articles list in the Help sidebar on the Overview page. | |
| 541 | + * Fires at the bottom of the help articles list in the Help sidebar on the Clients page. | |
| 518 | 542 | * |
| 519 | 543 | * Suggested HTML markup: |
| 520 | 544 | * |
| 521 | 545 | * <div class="item"><a href="Your custom URL">Your custom text</a></div> |