customizer->ot_orange_inactive_callback() == false ) { $this->sub_section = array_merge($this->sub_section,$this->sub_additional_section); } } /** * Load all neede theme backend css and js codes */ public function enqueue_scripts() { // orange themes panel wp_enqueue_style( 'asterion-orange-panel', get_template_directory_uri() . '/css/admin/orange-panel.css' ); wp_enqueue_script("jquery-ui-tabs"); wp_enqueue_script( 'asterion-orange-panel', get_template_directory_uri() . '/js/admin/backend.js' ); wp_localize_script( 'asterion-orange-panel', 'asterion', array( 'admin_url' => admin_url( 'admin-ajax.php' ), 'security' => wp_create_nonce( 'asterion-action') ) ); } function panel_section( ) { add_theme_page( esc_html__("Asterion Dashboard", 'asterion'), esc_html__("Asterion Dashboard", 'asterion'), 'administrator', 'asterion-panel', array( $this, 'asterion_panel' )); } protected function _get_plugin_basename_from_slug( $slug ) { $keys = array_keys( asterion()->tgmpa->get_plugins() ); foreach ( $keys as $key ) { if ( preg_match( '|^' . $slug . '/|', $key ) ) { return $key; } } return $slug; } function check_recomended_plugins() { //get recomended plugins list $required_plugins = asterion()->required_plugins(); $active_plugin_count = 0; //count recomended plugins $recomended_plugin_count = count($required_plugins); //count active recomended plugins foreach ( $required_plugins as $key => $plugin ) { if ( ( ! empty( $plugin['is_callable'] ) && is_callable( $plugin['is_callable'] ) ) || is_plugin_active( $this->_get_plugin_basename_from_slug( $plugin['slug'] ) ) ) { $active_plugin_count++; } } return ( $active_plugin_count == $recomended_plugin_count ) ? true : false; } function add_options( $options ) { foreach( $options as $option ) { $this->options[] = $option; } } function print_options(){ foreach ( $this->options as $option ) { $this->print_options_switch( $option['type'], $option ); } } function print_options_switch( $switch_value, $array_value) { switch ( $switch_value ) { case 'section_start': $this->print_section_start( $array_value ); break; case 'section_end': $this->print_section_end( $array_value ); break; case 'section_content': $this->print_section_content( $array_value ); break; case 'changelog': $this->print_changelog(); break; } } function print_header() { ?>