PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.7.3
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.7.3
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / admin / sub-menus / class-lp-submenu-addons.php

class-lp-submenu-addons.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.7.3, at inc/admin/sub-menus/class-lp-submenu-addons.php

72 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Class LP_Submenu_Addons
4 *
5 * @since 3.0.0
6 */
7 class LP_Submenu_Addons extends LP_Abstract_Submenu {
8
9 /**
10 * LP_Submenu_Addons constructor.
11 */
12 public function __construct() {
13 $this->id = 'learn-press-addons';
14 $this->menu_title = __( 'Add-ons', 'learnpress' );
15 $this->page_title = __( 'LearnPress Add-ons', 'learnpress' );
16 $this->priority = 20;
17 $this->callback = [ $this, 'display' ];
18
19 $this->add_ons_tabs();
20
21 parent::__construct();
22 }
23
24 public function add_ons_tabs() {
25 // Check is page addons
26 $current_page = LP_Helper::getUrlCurrent();
27 $pattern = '/.*page=learn-press-addons.*/';
28 $match = preg_match( $pattern, $current_page, $matches );
29 if ( ! $match ) {
30 return;
31 }
32
33 $tabs = array(
34 'more' => sprintf( __( 'Get more (%d)', 'learnpress' ), LP_Plugins_Helper::count_plugins() ),
35 'installed' => sprintf( __( 'Installed (%d)', 'learnpress' ), LP_Plugins_Helper::count_plugins( 'installed' ) ),
36 'themes' => sprintf( __( 'Themes (%d)', 'learnpress' ), LP_Plugins_Helper::count_themes() ),
37 );
38
39 $this->tabs = apply_filters(
40 'learn-press/admin/page-addons-tabs',
41 $tabs
42 );
43 }
44
45 public function page_content_installed() {
46 $this->page_content_search_form();
47 learn_press_admin_view( 'addons/html-plugins-installed' );
48 }
49
50 public function page_content_more() {
51 $this->page_content_search_form();
52 learn_press_admin_view( 'addons/html-plugins-more' );
53 }
54
55 public function page_content_themes() {
56 $this->page_content_search_form();
57 learn_press_admin_view( 'addons/html-themes' );
58 }
59
60 public function page_content_search_form() {
61 ?>
62
63 <p class="search-box">
64 <input type="text" class="lp-search-addon" value="" placeholder="<?php esc_attr_e( 'Search...', 'learnpress' ); ?>">
65 </p>
66
67 <?php
68 }
69 }
70
71 return new LP_Submenu_Addons();
72