| 1 |
<?php |
| 2 |
|
| 3 |
namespace LearnPress\TemplateHooks\Admin; |
| 4 |
|
| 5 |
use LearnPress\Helpers\Singleton; |
| 6 |
use LearnPress\Helpers\Template; |
| 7 |
|
| 8 |
defined( 'ABSPATH' ) || exit(); |
| 9 |
|
| 10 |
/** |
| 11 |
* Admin Add-ons page renderer. |
| 12 |
* |
| 13 |
* @since 4.2.8 |
| 14 |
*/ |
| 15 |
class AdminAddonsPage { |
| 16 |
use Singleton; |
| 17 |
|
| 18 |
/** |
| 19 |
* Singleton initialization hook. |
| 20 |
* |
| 21 |
* @return void |
| 22 |
*/ |
| 23 |
public function init(): void {} |
| 24 |
|
| 25 |
/** |
| 26 |
* Render the LearnPress Add-ons page. |
| 27 |
* |
| 28 |
* @return void |
| 29 |
*/ |
| 30 |
public function html_page() { |
| 31 |
ob_start(); |
| 32 |
lp_skeleton_animation_html( 20 ); |
| 33 |
$html_loading = ob_get_clean(); |
| 34 |
|
| 35 |
$section = apply_filters( |
| 36 |
'learn-press/admin/manager-addons/section', |
| 37 |
array( |
| 38 |
'label' => sprintf( |
| 39 |
'<h1>%s</h1>', |
| 40 |
__( 'LearnPress Add-ons', 'learnpress' ) |
| 41 |
), |
| 42 |
'note-theme' => sprintf( |
| 43 |
'<p style="color: rgba(255,0,0,0.76)"><strong><i>%s</i></strong></p>', |
| 44 |
__( '* If you use a Premium Theme that includes LearnPress add-ons, you can go to the <strong>Plugins</strong> tab on Dashboard of theme to download or update them.', 'learnpress' ) |
| 45 |
), |
| 46 |
'note-addon' => sprintf( |
| 47 |
'<p>%s</p>', |
| 48 |
sprintf( |
| 49 |
__( 'If you have purchased a premium add-on separately, you can enter your purchase code (%s) to download or update the add-ons here.', 'learnpress' ), |
| 50 |
sprintf( |
| 51 |
'<a href="%s" target="_blank">%s</a>', |
| 52 |
'https://thimpress.com/my-account/', |
| 53 |
__( 'get from your account', 'learnpress' ) |
| 54 |
) |
| 55 |
) |
| 56 |
), |
| 57 |
'list' => sprintf( '<div class="lp-addons-page">%s</div>', $html_loading ), |
| 58 |
) |
| 59 |
); |
| 60 |
|
| 61 |
echo Template::combine_components( $section ); |
| 62 |
} |
| 63 |
} |
| 64 |
|