class-view.php
64 lines
| 1 | <?php |
| 2 | /** |
| 3 | * BLC Dashboard admin page view. |
| 4 | * |
| 5 | * @link https://wordpress.org/plugins/broken-link-checker/ |
| 6 | * @since 2.0.0 |
| 7 | * |
| 8 | * @author WPMUDEV (https://wpmudev.com) |
| 9 | * @package WPMUDEV_BLC\App\Admin_Notice\Legacy |
| 10 | * |
| 11 | * @copyright (c) 2022, Incsub (http://incsub.com) |
| 12 | */ |
| 13 | |
| 14 | namespace WPMUDEV_BLC\App\Admin_Modals\Legacy; |
| 15 | |
| 16 | // Abort if called directly. |
| 17 | defined( 'WPINC' ) || die; |
| 18 | |
| 19 | use WPMUDEV_BLC\Core\Utils\Abstracts\Base; |
| 20 | |
| 21 | /** |
| 22 | * Class View |
| 23 | * |
| 24 | * @package WPMUDEV_BLC\App\Admin_Notice\Legacy |
| 25 | */ |
| 26 | class View extends Base { |
| 27 | /** |
| 28 | * The unique id that can be used by react. Sent over from Controller. |
| 29 | * |
| 30 | * @var int $unique_id |
| 31 | * |
| 32 | * @since 2.0.0 |
| 33 | */ |
| 34 | public static $unique_id = null; |
| 35 | |
| 36 | /** |
| 37 | * Renders the output. |
| 38 | * |
| 39 | * @param array $params Optional parameters ideal to hold the uniqueu id generated in controller. |
| 40 | * @return void Renders the output. |
| 41 | * @since 2.0.0 |
| 42 | */ |
| 43 | public function render( $params = array() ) { |
| 44 | self::$unique_id = isset( $params['unique_id'] ) ? $params['unique_id'] : null; |
| 45 | |
| 46 | ?> |
| 47 | <div class="sui-wrap wrap-blc wrap-blc-legacy-modal <?php echo 'wrap-' . esc_attr( self::$unique_id ); ?>"> |
| 48 | <?php |
| 49 | $this->render_body(); |
| 50 | ?> |
| 51 | </div> |
| 52 | <?php |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Renders view body. |
| 57 | */ |
| 58 | public function render_body() { |
| 59 | ?> |
| 60 | <div id="<?php esc_attr_e( self::$unique_id ); ?>"></div> |
| 61 | <?php |
| 62 | } |
| 63 | } |
| 64 |