| 1 |
<?php |
| 2 |
|
| 3 |
use LearnPress\Helpers\Template; |
| 4 |
|
| 5 |
/** |
| 6 |
* Class LP_Submenu_Addons |
| 7 |
* |
| 8 |
* @since 3.0.1 |
| 9 |
* @version 1.0.1 |
| 10 |
*/ |
| 11 |
class LP_Submenu_Addons extends LP_Abstract_Submenu { |
| 12 |
|
| 13 |
/** |
| 14 |
* LP_Submenu_Addons constructor. |
| 15 |
*/ |
| 16 |
public function __construct() { |
| 17 |
$this->id = 'learn-press-addons'; |
| 18 |
$this->menu_title = __( 'Add-ons', 'learnpress' ) . '<span class="lp-notify has-addon-update"></span>'; |
| 19 |
$this->page_title = __( 'LearnPress Add-ons', 'learnpress' ); |
| 20 |
$this->priority = 20; |
| 21 |
$this->callback = [ $this, 'display' ]; |
| 22 |
|
| 23 |
parent::__construct(); |
| 24 |
} |
| 25 |
|
| 26 |
public function display() { |
| 27 |
ob_start(); |
| 28 |
lp_skeleton_animation_html( 20 ); |
| 29 |
$html_loading = ob_get_clean(); |
| 30 |
|
| 31 |
$section = apply_filters( |
| 32 |
'learn-press/admin/manager-addons/section', |
| 33 |
[ |
| 34 |
'label' => sprintf( |
| 35 |
'<h1>%s</h1>', |
| 36 |
__( 'LearnPress Add-ons', 'learnpress' ) |
| 37 |
), |
| 38 |
'note-theme' => sprintf( |
| 39 |
'<p style="color: rgba(255,0,0,0.76)"><strong><i>%s</i></strong></p>', |
| 40 |
__( '* 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' ) |
| 41 |
), |
| 42 |
'note-addon' => sprintf( |
| 43 |
'<p>%s</p>', |
| 44 |
sprintf( |
| 45 |
__( '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' ), |
| 46 |
sprintf( |
| 47 |
'<a href="%s" target="_blank">%s</a>', |
| 48 |
'https://thimpress.com/my-account/', |
| 49 |
__( 'get from your account', 'learnpress' ) |
| 50 |
) |
| 51 |
) |
| 52 |
), |
| 53 |
'list' => sprintf( '<div class="lp-addons-page">%s</div>', $html_loading ), |
| 54 |
] |
| 55 |
); |
| 56 |
|
| 57 |
echo Template::combine_components( $section ); |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
return new LP_Submenu_Addons(); |
| 62 |
|