| @@ -28,14 +28,8 @@ | ||
| 28 | 28 | /** |
| 29 | 29 | * Method render() |
| 30 | 30 | * |
| 31 | 31 | * Grab Child Site Notes & Render Widget. |
| 32 | - * | |
| 33 | - * @uses \MainWP\Dashboard\MainWP_DB::get_website_by_id() | |
| 34 | - * @uses \MainWP\Dashboard\MainWP_System_Utility::get_current_wpid() | |
| 35 | - * @uses \MainWP\Dashboard\MainWP_UI::render_modal_edit_notes() | |
| 36 | - * @uses \MainWP\Dashboard\MainWP_Utility::ctype_digit() | |
| 37 | - * @uses \MainWP\Dashboard\MainWP_Utility::esc_content() | |
| 38 | 32 | */ |
| 39 | 33 | public static function render() { |
| 40 | 34 | $current_wpid = MainWP_System_Utility::get_current_wpid(); |
| 41 | 35 | |
| @@ -46,9 +40,9 @@ | ||
| 46 | 40 | $website = MainWP_DB::instance()->get_website_by_id( $current_wpid, true ); |
| 47 | 41 | $note = html_entity_decode( $website->note ); |
| 48 | 42 | $esc_note = MainWP_Utility::esc_content( $note ); |
| 49 | 43 | ?> |
| 50 | - <div class="mainwp-widget-header"> | |
| 44 | + | |
| 51 | 45 | <h3 class="ui header handle-drag"> |
| 52 | 46 | <?php |
| 53 | 47 | /** |
| 54 | 48 | * Filter: mainwp_notes_widget_title |
| @@ -58,15 +52,15 @@ | ||
| 58 | 52 | * @param object $website Object containing the child site info. |
| 59 | 53 | * |
| 60 | 54 | * @since 4.1 |
| 61 | 55 | */ |
| 62 | - echo esc_html( apply_filters( 'mainwp_notes_widget_title', esc_html__( 'Notes', 'mainwp' ), $website ) ); | |
| 56 | + echo esc_html( apply_filters( 'mainwp_notes_widget_title', __( 'Notes', 'mainwp' ), $website ) ); | |
| 63 | 57 | ?> |
| 64 | 58 | <div class="sub header"><?php esc_html_e( 'Child site notes', 'mainwp' ); ?></div> |
| 65 | 59 | </h3> |
| 66 | - </div> | |
| 67 | 60 | |
| 68 | - <div class="mainwp-scrolly-overflow"> | |
| 61 | + <div class="ui section hidden divider"></div> | |
| 62 | + | |
| 69 | 63 | <?php |
| 70 | 64 | /** |
| 71 | 65 | * Action: mainwp_notes_widget_top |
| 72 | 66 | * |
| @@ -77,21 +71,27 @@ | ||
| 77 | 71 | * @since 4.1 |
| 78 | 72 | */ |
| 79 | 73 | do_action( 'mainwp_notes_widget_top', $website ); |
| 80 | 74 | |
| 81 | - if ( empty( $website->note ) ) { | |
| 82 | - MainWP_UI::render_empty_element_placeholder(); | |
| 83 | - } else { | |
| 75 | + if ( '' == $website->note ) { | |
| 84 | 76 | ?> |
| 85 | - <div class="content"> | |
| 77 | + <h2 class="ui icon header"> | |
| 78 | + <i class="info circle icon"></i> | |
| 79 | + <div class="content"> | |
| 80 | + <?php esc_html_e( 'No saved notes!', 'mainwp' ); ?> | |
| 81 | + <div class="sub header"><?php esc_html_e( 'No saved notes for the child site. ', 'mainwp' ); ?><?php echo '<a href="javascript:void(0)" class="mainwp-edit-site-note" id="mainwp-notes-' . intval( $website->id ) . '">' . __( 'Click here to add a note.', 'mainwp' ) . '</a>'; ?></div> | |
| 82 | + </div> | |
| 83 | + </h2> | |
| 86 | 84 | <?php |
| 87 | - echo wp_unslash( $esc_note ); // phpcs:ignore WordPress.Security.EscapeOutput | |
| 85 | + } else { | |
| 86 | + echo $esc_note; | |
| 88 | 87 | ?> |
| 89 | - </div> | |
| 88 | + <div class="ui section hidden divider"></div> | |
| 89 | + <a href="javascript:void(0)" class="ui button green mainwp-edit-site-note" id="mainwp-notes-<?php echo intval( $website->id ); ?>"><?php esc_html_e( 'Edit Notes', 'mainwp' ); ?></a> | |
| 90 | 90 | <?php |
| 91 | 91 | } |
| 92 | 92 | ?> |
| 93 | - <span style="display: none" id="mainwp-notes-<?php echo intval( $current_wpid ); ?>-note"><?php echo wp_unslash( $esc_note ); // phpcs:ignore WordPress.Security.EscapeOutput ?></span> | |
| 93 | + <span style="display: none" id="mainwp-notes-<?php echo intval( $current_wpid ); ?>-note"><?php echo $esc_note; ?></span> | |
| 94 | 94 | <?php |
| 95 | 95 | /** |
| 96 | 96 | * Action: mainwp_notes_widget_bottom |
| 97 | 97 | * |
| @@ -101,20 +101,9 @@ | ||
| 101 | 101 | * |
| 102 | 102 | * @since 4.1 |
| 103 | 103 | */ |
| 104 | 104 | do_action( 'mainwp_notes_widget_bottom', $website ); |
| 105 | - ?> | |
| 106 | - </div> | |
| 107 | - <?php if ( '' !== $website->note ) : ?> | |
| 108 | - <div class="ui two columns grid mainwp-widget-footer"> | |
| 109 | - <div class="column"> | |
| 110 | - <a href="javascript:void(0)" class="ui button mini fluid green mainwp-edit-site-note" id="mainwp-notes-<?php echo intval( $website->id ); ?>"><?php esc_html_e( 'Edit Notes', 'mainwp' ); ?></a> | |
| 111 | - </div> | |
| 112 | - <div class="column"> | |
| 113 | 105 | |
| 114 | - </div> | |
| 115 | - </div> | |
| 116 | - <?php endif; ?> | |
| 117 | - <?php | |
| 118 | - MainWP_UI::render_modal_edit_notes(); | |
| 106 | + MainWP_UI::render_modal_edit_notes(); | |
| 119 | 107 | } |
| 108 | + | |
| 120 | 109 | } |