Admin_Page.php
2 years ago
Analytics_Page.php
2 years ago
Campaign_Builder_Page.php
2 years ago
Settings_Page.php
2 years ago
Admin_Page.php
59 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP_SCOPED\IAWP\Admin_Page; |
| 4 | |
| 5 | use IAWP_SCOPED\IAWP\Capability_Manager; |
| 6 | use IAWP_SCOPED\IAWP\Dashboard_Options; |
| 7 | use IAWP_SCOPED\IAWP\Env; |
| 8 | use IAWP_SCOPED\IAWP\Migrations\Migrations; |
| 9 | use IAWP_SCOPED\IAWP\Report_Finder; |
| 10 | /** @internal */ |
| 11 | abstract class Admin_Page |
| 12 | { |
| 13 | protected abstract function render_page(); |
| 14 | public function render() : void |
| 15 | { |
| 16 | if (!Capability_Manager::can_view()) { |
| 17 | return; |
| 18 | } |
| 19 | if (Migrations::is_migrating()) { |
| 20 | echo \IAWP_SCOPED\iawp_blade()->run('interrupt.migration-is-running'); |
| 21 | return; |
| 22 | } |
| 23 | $options = new Dashboard_Options(); |
| 24 | $tab = (new Env())->get_tab(); |
| 25 | ?> |
| 26 | |
| 27 | <div id="iawp-parent" class="iawp-parent <?php |
| 28 | \esc_attr_e($tab); |
| 29 | ?>"> |
| 30 | <div id="iawp-layout" class="iawp-layout <?php |
| 31 | echo $options->is_sidebar_collapsed() ? 'collapsed' : ''; |
| 32 | ?>"> |
| 33 | |
| 34 | <?php |
| 35 | echo \IAWP_SCOPED\iawp_blade()->run('partials.sidebar', ['favorite_report' => Report_Finder::get_favorite(), 'report_finder' => new Report_Finder(), 'is_white_labeled' => Capability_Manager::white_labeled(), 'can_edit_settings' => Capability_Manager::can_edit(), 'is_dark_mode' => \get_option('iawp_dark_mode')]); |
| 36 | ?> |
| 37 | |
| 38 | <div class="iawp-layout-main"> |
| 39 | <div class="iawp-tab-content"> |
| 40 | <div id="iawp-dashboard" class="iawp-dashboard"> |
| 41 | <?php |
| 42 | $this->render_page(); |
| 43 | ?> |
| 44 | </div> |
| 45 | </div> |
| 46 | <div id="loading-icon" class="loading-icon"> |
| 47 | <img src="<?php |
| 48 | echo \esc_url(\IAWP_SCOPED\iawp_url_to('img/loading.svg')); |
| 49 | ?>" /> |
| 50 | </div> |
| 51 | <button id="scroll-to-top" class="scroll-to-top"><span class="dashicons dashicons-arrow-up-alt"></span></button> |
| 52 | </div> |
| 53 | </div> |
| 54 | </div> |
| 55 | |
| 56 | <?php |
| 57 | } |
| 58 | } |
| 59 |