array( 'label' => __( 'Welcome', 'bevro' ), 'show' => ! is_network_admin(), ), ); self::$view_actions = apply_filters( 'bevro_menu_options', $actions ); } return self::$view_actions; } /** * Save All admin settings here */ static public function save_settings() { // Only admins can save settings. if ( ! current_user_can( 'manage_options' ) ){ return; } // Let extensions hook into saving. do_action( 'bevro_admin_settings_save' ); } /** * Enqueues the needed CSS/JS for the builder's admin settings page. * */ static public function styles_scripts(){ // Styles. wp_enqueue_style( 'bevro-admin-settings', BEVRO_THEME_URI . 'lib/theme-option/assets/css/bevro-admin-menu-settings.css', array(), BEVRO_THEME_VERSION ); // Script. wp_enqueue_script( 'bevro-admin-settings', BEVRO_THEME_URI . 'lib/theme-option/assets/js/bevro-admin-menu-settings.js', array( 'jquery', 'wp-util', 'updates' ), BEVRO_THEME_VERSION ); $localize = array( 'ajaxUrl' => admin_url( 'admin-ajax.php' ), 'btnActivating' => __( 'Activating Importer Plugin ', 'bevro' ) . '…', 'bevroSitesLink' => admin_url( 'themes.php?page=pt-one-click-demo-import' ), 'bevroSitesLinkTitle' => __( 'See Library', 'bevro' ), ); wp_localize_script( 'bevro-admin-settings', 'bevro', apply_filters( 'bevro_theme_js_localize', $localize ) ); } /** * Enqueues the needed CSS/JS for Backend. * */ static public function admin_scripts(){ // Styles. wp_enqueue_style( 'bevro-admin', BEVRO_THEME_URI . 'lib/theme-option/assets/css/bevro-admin.css', array(), BEVRO_THEME_VERSION ); } /** * Add main menu * */ static public function add_admin_menu() { $parent_page = self::$default_menu_position; $page_title = self::$menu_page_title; $capability = 'manage_options'; $page_menu_slug = self::$plugin_slug; $page_menu_func = __CLASS__ . '::menu_callback'; if ( apply_filters( 'bevro_dashboard_admin_menu', true ) ) { add_theme_page( $page_title, $page_title, $capability, $page_menu_slug, $page_menu_func ); } else { do_action( 'bevro_register_admin_menu', $parent_page, $page_title, $capability, $page_menu_slug, $page_menu_func ); } } /** * Menu callback * */ static public function menu_callback() { $current_slug = isset( $_GET['action'] ) ? esc_attr( $_GET['action'] ) : self::$current_slug; $active_tab = str_replace( '_', '-', $current_slug ); $current_slug = str_replace( '-', '_', $current_slug ); $bevro_icon = apply_filters( 'bevro_page_top_icon', true ); $ast_visit_site_url = apply_filters( 'bevroa_site_url', 'https://bevro.com' ); $ast_wrapper_class = apply_filters( 'bevro_welcome_wrapper_class', array( $current_slug ) ); $my_theme = wp_get_theme(); $bevro_theme_version = $my_theme->get( 'Version' ); ?>

%7$s ', esc_attr( $class ), isset( $link ) ? 'href="' . esc_url( $link ) . '"' : '', isset( $data_slug ) ? 'data-slug="' . esc_attr( $data_slug ) . '"' : '', isset( $data_init ) ? 'data-init="' . esc_attr( $data_init ) . '"' : '', isset( $data_slug1 ) ? 'data-slug1="' . esc_attr( $data_slug1 ) . '"' : '', isset( $data_init1 ) ? 'data-init1="' . esc_attr( $data_init1 ) . '"' : '', esc_html( $button_text ) ); ?>

' . esc_html( $bevro_knowledge_base_doc_link_text ) . '' : esc_html( $bevro_knowledge_base_doc_link_text ) ); ?>

' . esc_html( $bevro_community_group_link_text ) . '' : esc_html( $bevro_community_group_link_text ) ); ?>

' . esc_html( $bevro_support_link_text ) . '' : esc_html( $bevro_support_link_text ) ); ?>

' . esc_html( $bevro_pro_link_text ) . '' : esc_html( $bevro_pro_link_text ) ); ?>
array( 'title' => __( 'White Label', 'bevro' ), 'class' => 'bvr-addon', 'title_url' => 'https://themehunk.com/docs/bevro-wordpress-theme/#white-label', 'links' => array( array( 'link_class' => 'bvr-learn-more', 'link_url' => esc_url( admin_url( 'themes.php?page=bevro&action=white-label' ) ), 'link_text' => __( 'Setting', 'bevro' ), 'target_blank' => false, ), ), ), ) ); ?>
$info ) { $title_url = ( isset( $info['title_url'] ) && ! empty( $info['title_url'] ) ) ? 'href="' . esc_url( $info['title_url'] ) . '"' : ''; $anchor_target = ( isset( $info['title_url'] ) && ! empty( $info['title_url'] ) ) ? "target='_blank' rel='noopener'" : ''; echo '
' . esc_html( $info['title'] ) . '
'; } ?>
$plugin){ $plugin_info = plugins_api( 'plugin_information', array( 'slug' => $slug, 'fields' => array( 'downloaded' => false, 'sections' => true, 'homepage' => true, 'added' => false, 'compatibility' => false, 'requires' => false, 'downloadlink' => false, 'icons' => false, ) ) ); $plugin_name = $plugin_info->name; $plugin_slug = $plugin_info->slug; $version = $plugin_info->version; $author = $plugin_info->author; $download_link = $plugin_info->download_link; $status = is_dir( WP_PLUGIN_DIR . '/' . $plugin_slug ); $active_file_name = $plugin_slug . '/' . $plugin_slug . '.php'; $button_class = 'install-now button '.$plugin_slug; if ( is_plugin_active( $active_file_name ) ) { $button_class = 'button disabled '.$plugin_slug; $button_txt = esc_html__( 'Plugin Activated', 'bevro' ); $detail_link = $install_url = ''; } if ( ! is_plugin_active( $active_file_name ) ){ $button_txt = esc_html__( 'Install Now', 'bevro' ); if ( ! $status ) { $install_url = wp_nonce_url( add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin_slug ), network_admin_url( 'update.php' ) ), 'install-plugin_'.$plugin_slug ); } else { $install_url = add_query_arg(array( 'action' => 'activate', 'plugin' => rawurlencode( $active_file_name ), 'plugin_status' => 'all', 'paged' => '1', '_wpnonce' => wp_create_nonce('activate-plugin_' . $active_file_name ), ), network_admin_url('plugins.php')); $button_class = 'activate-now button-primary '.$plugin_slug; $button_txt = esc_html__( 'Activate Now', 'bevro' ); } $detail_link = add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => $plugin_slug, 'TB_iframe' => 'true', 'width' => '772', 'height' => '349', ), network_admin_url( 'plugin-install.php' ) ); } $detail = ''; echo '
'; echo '

'; echo esc_html( $plugin_name ); echo '

'; if($plugin_slug=='contact-form-7'){ echo''; $detail='Contact Form 7 can manage multiple contact forms, plus you can customize the form and the mail contents flexibly with simple markup'; }elseif($plugin_slug=='one-click-demo-import'){ echo''; $detail= 'Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple demo import for your theme demo data.'; }elseif($plugin_slug=='woocommerce'){ echo''; $detail='WooCommerce is a free eCommerce plugin that allows you to sell anything, beautifully.'; }elseif($plugin_slug=='elementor'){ echo''; $detail='The most advanced frontend drag & drop page builder. Create high-end, pixel perfect websites at record speeds. Any theme, any page, any design.'; }elseif($plugin_slug=='business-popup'){ echo''; $detail='Business Popup plugin comes with easy to use layouts, You can simply select and add your original content using live editor. Plugin contain layouts for sale, Discount offers, Deals, shop ad etc. You can popup at your desired page, post, Between post and in the widget areas as a banner ad.'; } echo '

'.esc_html($detail).'

'; echo '

Version:'.esc_html($version).' '.$author.' | '.esc_html__( 'Details', 'bevro' ).'

'; echo''; echo '
'; } } } /** * Update Admin Title. * * @since 1.0.19 * * @param string $admin_title Admin Title. * @param string $title Title. * @return string */ static public function bevro_admin_title( $admin_title, $title ){ $screen = get_current_screen(); if ( 'appearance_page_bevro' == $screen->id ) { $view_actions = self::get_view_actions(); $current_slug = isset( $_GET['action'] ) ? esc_attr( $_GET['action'] ) : self::$current_slug; $active_tab = str_replace( '_', '-', $current_slug ); if ( 'general' != $active_tab && isset( $view_actions[ $active_tab ]['label'] ) ) { $admin_title = str_replace( $title, $view_actions[ $active_tab ]['label'], $admin_title ); } } return $admin_title; } /** * Bevro Header Right Section Links * * @since 1.2.4 */ static public function top_header_right_section(){ $top_links = apply_filters( 'bevro_header_top_links', array( 'bevro-theme-info' => array( 'title' => __( 'Easy to use, Fully Customizable, Unique options', 'bevro' ), ), ) ); if ( ! empty( $top_links ) ) { ?> false, 'message' => __( 'No plugin specified', 'bevro' ), ) ); } $plugin_init = ( isset( $_POST['init'] ) ) ? esc_attr( $_POST['init'] ) : ''; $plugin_init1 = ( isset( $_POST['init1'] ) ) ? esc_attr( $_POST['init1'] ) : ''; $activate = activate_plugin( $plugin_init, '', false, true ); $activate1 = activate_plugin( $plugin_init1, '', false, true ); if ( is_wp_error( $activate ) ) { wp_send_json_error( array( 'success' => false, 'message' => $activate->get_error_message(), ) ); } if ( is_wp_error( $activate1 ) ) { wp_send_json_error( array( 'success' => false, 'message' => $activate1->get_error_message(), ) ); } wp_send_json_success( array( 'success' => true, 'message' => __( 'Plugin Successfully Activated', 'bevro' ), ) ); } } new Bevro_Admin_Settings; }