PluginProbe
MainWP Dashboard: Self-hosted WordPress Management for Agencies / 4.0.5
MainWP Dashboard: Self-hosted WordPress Management for Agencies v4.0.5
6.2 6.1.8 6.1.7 6.1.6 6.1.5 6.1.4 6.1.3 6.1.2 6.1.1 6.1 6.0.12 6.0.11 4.6.0.1 5.0 5.0.1 5.0.2 5.0.3 5.0.3.1 5.0.3.2 5.1 5.1.1 5.2 5.2.1 5.2.2 5.3 All 153 releases
mainwp / widgets / widget-mainwp-notes.php

widget-mainwp-notes.php in MainWP Dashboard: Self-hosted WordPress Management for Agencies 4.0.5, at widgets/widget-mainwp-notes.php

57 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class MainWP_Notes {
4
5 public static function getClassName() {
6 return __CLASS__;
7 }
8
9 public static function render() {
10 $current_wpid = MainWP_Utility::get_current_wpid();
11
12 if ( !MainWP_Utility::ctype_digit( $current_wpid ) ) {
13 return;
14 }
15
16 $website = MainWP_DB::Instance()->getWebsiteById( $current_wpid, true );
17 $note = html_entity_decode( $website->note ); // to compatible
18 $esc_note = MainWP_Utility::esc_content( $note );
19
20
21 ?>
22
23 <h3 class="ui header handle-drag">
24 <?php esc_html_e('Notes', 'mainwp'); ?>
25 <div class="sub header"><?php esc_html_e( 'Child site notes', 'mainwp' ); ?></div>
26 </h3>
27
28 <div class="ui section hidden divider"></div>
29
30 <div>
31 <?php
32 if ( $website->note == '' ) {
33 ?>
34 <h2 class="ui icon header">
35 <i class="info circle icon"></i>
36 <div class="content">
37 <?php _e( 'No saved notes!', 'mainwp' ); ?>
38 <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-' . $website->id . '">' . __( 'Click here to add a note.', 'mainwp' ) . '</a>'; ?></div>
39 </div>
40 </h2>
41 <?php
42 } else {
43 echo $esc_note;
44 ?>
45 <div class="ui section hidden divider"></div>
46 <a href="javascript:void(0)" class="ui button green mainwp-edit-site-note" id="mainwp-notes-<?php echo $website->id; ?>"><?php esc_html_e( 'Edit Notes', 'mainwp' ); ?></a>
47 <?php
48 }
49 ?>
50 </div>
51 <span style="display: none" id="mainwp-notes-<?php echo intval($current_wpid); ?>-note"><?php echo $esc_note; ?></span>
52 <?php
53 MainWP_UI::render_modal_edit_notes();
54 }
55
56 }
57