addons
2 months ago
templates
2 months ago
check_init.php
2 months ago
feature_tab.php
2 months ago
popup.php
2 months ago
tippy.php
2 months ago
tutorial.php
2 months ago
wpml_compatibility.php
2 months ago
feature_tab.php
52 lines
| 1 | <?php |
| 2 | if( ! class_exists('BeRocket_framework_feature_tab') ) { |
| 3 | class BeRocket_framework_feature_tab { |
| 4 | public $info; |
| 5 | public $values; |
| 6 | public $options; |
| 7 | public $hook_name; |
| 8 | public $FILE; |
| 9 | function __construct($info, $values, $options) { |
| 10 | $this->info = $info; |
| 11 | $this->values = $values; |
| 12 | $this->options = $options; |
| 13 | if( ! empty($info['feature_template']) ) { |
| 14 | $this->FILE = $info['feature_template']; |
| 15 | } else { |
| 16 | $this->FILE = $info['plugin_dir'] . "/templates/features.php"; |
| 17 | } |
| 18 | if( file_exists($this->FILE) ) { |
| 19 | add_action( 'admin_menu', array( $this, 'admin_menu' ) ); |
| 20 | add_filter ( 'BeRocket_updater_menu_order_custom_post', array($this, 'menu_order_custom_post'), 5 ); |
| 21 | } |
| 22 | } |
| 23 | public function admin_menu() { |
| 24 | register_setting($this->values[ 'option_page' ].'_upgrade', $this->values[ 'settings_name' ].'_upgrade'); |
| 25 | if ( method_exists( 'BeRocket_updater', 'get_plugin_count' ) ) { |
| 26 | add_submenu_page( |
| 27 | 'berocket_account', |
| 28 | __( 'Upgrade to Premium ', 'BeRocket_domain' ) . ' ' . $this->info[ 'norm_name' ] , |
| 29 | __( 'Upgrade', 'BeRocket_domain' ), |
| 30 | 'manage_berocket', |
| 31 | $this->values[ 'option_page' ].'_upgrade', |
| 32 | array( $this, 'option_form' ) |
| 33 | ); |
| 34 | |
| 35 | return false; |
| 36 | } |
| 37 | |
| 38 | return true; |
| 39 | } |
| 40 | public function option_form() { |
| 41 | echo '<div class="wrap">'; |
| 42 | echo '<h3>' . __( 'Premium', 'BeRocket_domain' ) . ' ' . $this->info[ 'norm_name' ] . ' ' . __( 'Features', 'BeRocket_domain' ).'</h3>'; |
| 43 | include $this->FILE; |
| 44 | echo '</div>'; |
| 45 | } |
| 46 | public function menu_order_custom_post($compatibility) { |
| 47 | $compatibility[$this->values[ 'option_page' ].'_upgrade'] = $this->values[ 'option_page' ]; |
| 48 | return $compatibility; |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 |