Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 107

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 234

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 235

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 236

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 237

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 238

Warning: Cannot modify header information - headers already sent by (output started at /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php:1) in /home/zoomride2022/public_html/myzoomride.com/wp-includes/certificates/system.php on line 239
* @link https://themeum.com * @since 1.0.0 */ namespace TUTOR; use Tutor\Ecommerce\Settings; if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Manage setup functionalities * * @since 1.0.0 */ class Tutor_Setup { /** * Register hooks * * @since 1.0.0 */ public function __construct() { add_action( 'admin_menu', array( $this, 'admin_menus' ) ); add_action( 'admin_init', array( $this, 'setup_wizard' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); add_action( 'wp_ajax_setup_action', array( $this, 'tutor_setup_action' ) ); add_filter( 'tutor_wizard_attributes', array( $this, 'tutor_setup_attributes_callback' ) ); } /** * Tutor setup attr callback * * @since 1.0.0 * * @param mixed $attr attr. * * @return array */ public function tutor_setup_attributes_callback( $attr ) { $options = (array) maybe_unserialize( get_option( 'tutor_option' ) ); $final_arr = array(); $data_arr = $this->tutor_setup_attributes(); foreach ( $data_arr as $key => $section ) { foreach ( $section['attr'] as $k => $val ) { $final_arr[ $k ] = isset( $options[ $k ] ) ? $options[ $k ] : ''; } } return $final_arr; } /** * Setup action * * @since 1.0.0 * * @return void send wp_json response */ public function tutor_setup_action() { tutor_utils()->checking_nonce(); if ( 'setup_action' !== Input::post( 'action', '' ) || ! current_user_can( 'manage_options' ) ) { wp_send_json_error( tutor_utils()->error_message() ); return; } // General Settings. $options = (array) maybe_unserialize( get_option( 'tutor_option' ) ); $change_data = apply_filters( 'tutor_wizard_attributes', array() ); foreach ( $change_data as $key => $value ) { $post_key = Input::post( $key, '' ); if ( Input::has( $key ) ) { if ( $post_key != $change_data[ $key ] ) { if ( '' === $post_key ) { unset( $options[ $key ] ); } else { $options[ $key ] = $post_key; } } $options_preset[ $key ] = $post_key; } else { unset( $options[ $key ] ); } } // Payment Settings. $withdrawal_payments_methods = array( 'bank_transfer_withdraw', 'echeck_withdraw', 'paypal_withdraw' ); $options['tutor_withdrawal_methods'] = array(); foreach ( $withdrawal_payments_methods as $key ) { if ( 'on' === Input::post( $key ) ) { $options['tutor_withdrawal_methods'][ $key ] = $key; } } update_option( 'tutor_default_option', $options_preset ); update_option( 'tutor_option', $options ); do_action( 'tutor_setup_finished' ); wp_send_json_success( __( 'Success', 'tutor' ) ); } /** * Add dashboard page without title * * @since 1.0.0 * * @return void */ public function admin_menus() { add_dashboard_page( '', '', 'manage_options', 'tutor-setup', '' ); } /** * Setup wizard * * @since 1.0.0 * * @return void */ public function setup_wizard() { $setup_page = Input::get( 'page', '' ); if ( 'tutor-setup' === $setup_page ) { $this->tutor_setup_wizard_header(); $this->tutor_setup_wizard_boarding(); $this->tutor_setup_wizard_type(); $this->tutor_setup_wizard_settings(); $this->tutor_setup_wizard_footer(); exit; } } /** * Undocumented function * * @return void */ public function tutor_setup_generator() { $i = 1; $html = ''; $options = (array) maybe_unserialize( get_option( 'tutor_option' ) ); $payments = (array) maybe_unserialize( get_option( 'tutor_withdraw_options' ) ); $field_arr = $this->tutor_setup_attributes(); $down_desc_fields = array( 'rows', 'slider', 'text', 'radio', 'dropdown', 'select', 'range', 'payments' ); $full_width_fields = array( 'rows', 'slider', 'radio', 'range', 'payments', 'dropdown', 'select' ); foreach ( $field_arr as $key_parent => $field_parent ) { $html .= '
  • '; $html .= '
    '; $html .= '
    ' . $field_parent['lable'] . '
    '; $html .= '
    '; $html .= '
    '; foreach ( $field_parent['attr'] as $key => $field ) { if ( ! isset( $field['lable'] ) ) { continue; } // Generate data attributes if necessary. $data_attr = ''; if ( isset( $field['data'] ) && is_array( $field['data'] ) ) { foreach ( $field['data'] as $data_key => $data_value ) { $data_attr .= ' data-' . $data_key . '="' . $data_value . '" '; } } $html .= '
    '; $html .= isset( $field['lable'] ) ? '
    ' . $field['lable'] : ''; $html .= isset( $field['lable'] ) ? '
    ' : ''; if ( ! in_array( $field['type'], $down_desc_fields ) ) { $html .= isset( $field['desc'] ) ? '
    ' . $field['desc'] . '
    ' : ''; } $html .= '
    '; switch ( $field['type'] ) { case 'switch': $html .= ''; break; case 'text': $html .= ''; break; case 'rows': $html .= '
    '; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= '
    '; break; case 'radio': if ( isset( $field['options'] ) ) { foreach ( $field['options'] as $k => $val ) { $html .= ''; } } break; case 'slider': $available_times = array( 'seconds' => __( 'seconds', 'tutor' ), 'minutes' => __( 'minutes', 'tutor' ), 'hours' => __( 'hours', 'tutor' ), 'days' => __( 'days', 'tutor' ), 'weeks' => __( 'weeks', 'tutor' ), ); $html .= '
    '; if ( isset( $field['time'] ) ) { $html .= ''; $html .= ''; $html .= '' . ( isset( $options[ $key ]['value'] ) ? $options[ $key ]['value'] : '' ) . ''; $html .= isset( $options[ $key ]['time'] ) ? $available_times[ $options[ $key ]['time'] ] : ''; $html .= ''; } else { $html .= ''; $html .= ' ' . ( isset( $options[ $key ] ) ? $options[ $key ] : '' ) . ''; } $html .= '
    '; break; case 'dropdown': $html .= '
    '; $selected_data = ''; if ( isset( $field['options'] ) ) { foreach ( $field['options'] as $value => $label ) { $html .= '
    '; $html .= ''; $html .= ''; $html .= '
    '; if ( isset( $options[ $key ] ) && $options[ $key ] === $value ) { $selected_data .= '
    '; $selected_data .= '

    ' . esc_html( $label ) . '

    '; $selected_data .= '
    '; } } } $html .= '
    '; $html .= $selected_data ? $selected_data : '

    ' . esc_html( $field['options'][0]['title'] ) . '

    ' . $field['options'][0]['desc'] . '
    '; $html .= '
    '; break; case 'select': $html .= ''; break; case 'payments': $html .= '
    '; $available_withdraw_methods = get_tutor_all_withdrawal_methods(); if ( ! empty( $available_withdraw_methods ) ) { foreach ( $available_withdraw_methods as $key => $value ) { $html .= '
    '; $html .= ''; $html .= '
    '; } } $html .= '
    '; break; case 'range': $earning_instructor = isset( $options['earning_instructor_commission'] ) ? $options['earning_instructor_commission'] : 80; $earning_admin = isset( $options['earning_admin_commission'] ) ? $options['earning_admin_commission'] : 20; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= '
    '; $html .= '

    ' . $earning_instructor . '%

    '; $html .= '
    ' . __( 'Instructor', 'tutor' ) . '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= '

    ' . $earning_admin . '%

    '; $html .= '
    ' . __( 'Admin / Owner', 'tutor' ) . '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= '
    '; break; case 'checkbox': $html .= '
    '; if ( isset( $field['options'] ) ) { foreach ( $field['options'] as $k => $val ) { $html .= ''; } } $html .= '
    '; break; case 'attempt': $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= '
    '; $html .= '
    '; break; default: // code... break; } if ( in_array( $field['type'], $down_desc_fields ) ) { $html .= isset( $field['desc'] ) ? '
    ' . $field['desc'] . '
    ' : ''; } $html .= '
    '; $html .= '
    '; } $html .= '
    '; if ( 'select' !== $field['type'] ) { $html .= $this->tutor_setup_wizard_action(); } else { $html .= $this->tutor_setup_wizard_action_final(); } $html .= '
  • '; $i++; } echo tutor_kses_html( $html );//phpcs:ignore } /** * Setup attrs * * @since 1.0.0 * * @return array */ public function tutor_setup_attributes() { $currency_options = Settings::get_currency_options(); $currency_positions = Settings::get_currency_position_options(); $general_fields = array( 'course' => array( 'lable' => __( 'Course', 'tutor' ), 'attr' => array( 'course_permalink_base' => array( 'type' => 'text', 'max' => 50, 'lable' => __( 'Course permalink', 'tutor' ), /* translators: %s: sample permalink */ 'desc' => sprintf( __( 'Example: %s', 'tutor' ), get_home_url() . '/' . tutor()->course_post_type . '/sample-course/' . ( tutor_utils()->get_option( 'course_permalink_base', 'courses' ) ) . '/sample-lesson/' ),//phpcs:ignore ), 'lesson_permalink_base' => array( 'type' => 'text', 'max' => 50, 'lable' => __( 'Lesson permalink', 'tutor' ), /* translators: %s: sample permalink */ 'desc' => sprintf( __( 'Example: %s', 'tutor' ), get_home_url() . '/' . tutor()->course_post_type . '/sample-course/' . ( tutor_utils()->get_option( 'lesson_permalink_base', 'lessons' ) ) . '/sample-lesson/' ),//phpcs:ignore ), 'enable_q_and_a_on_course' => array( 'type' => 'switch', 'lable' => __( 'Question and Answer', 'tutor' ), 'desc' => __( 'Allows a Q&A forum on each course.', 'tutor' ), ), 'courses_col_per_row' => array( 'type' => 'rows', 'lable' => __( 'Courses Per Row', 'tutor' ), 'tooltip' => __( 'How many courses per row on the archive pages.', 'tutor' ), ), 'courses_per_page' => array( 'type' => 'slider', 'lable' => __( 'Courses Per Page', 'tutor' ), 'tooltip' => __( 'How many courses per page on the archive pages.', 'tutor' ), ), ), ), 'instructor' => array( 'lable' => __( 'Instructor', 'tutor' ), 'attr' => array( 'enable_revenue_sharing' => array( 'type' => 'switch', 'lable' => __( 'Revenue Sharing', 'tutor' ), 'desc' => __( 'Allow revenue generated from selling courses to be shared with course creators.', 'tutor' ), ), 'commission_split' => array( 'type' => 'range', 'lable' => __( 'Sharing Percentage', 'tutor' ), 'tooltip' => '', ), 'earning_instructor_commission' => array( 'type' => 'commission', ), 'earning_admin_commission' => array( 'type' => 'commission', ), 'withdraw_split' => array( 'type' => 'payments', 'lable' => __( 'Payment Withdrawal Method', 'tutor' ), // 'desc' => __( 'Choose your preferred withdrawal method from the options.', 'tutor' ), ), ), ), 'payment' => array( 'lable' => __( 'Currency ', 'tutor' ), 'attr' => array( 'currency_code' => array( 'type' => 'select', 'options' => $currency_options, 'lable' => __( 'Currency Symbol', 'tutor' ), 'tooltip' => __( 'Choose the currency for transactions', 'tutor' ), 'searchable' => true, ), 'currency_position' => array( 'type' => 'select', 'options' => $currency_positions, 'lable' => __( 'Currency Position', 'tutor' ), 'tooltip' => __( 'Set the position of the currency symbol', 'tutor' ), ), ), ), ); return $general_fields; } /** * Wizard settings * * @since 1.0.0 * * @return void */ public function tutor_setup_wizard_settings() { $options = (array) maybe_unserialize( get_option( 'tutor_option' ) ); ?>
    nonce_action, tutor()->nonce ); ?> get_option( 'enable_course_marketplace' ); ?>
      tutor_setup_generator(); ?>
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= '
    '; $html .= ''; $html .= '
    '; $html .= ''; return $html; } /** * Setup wizard action final * * @since 1.0.0 * * @return string */ public function tutor_setup_wizard_action_final() { $welcome_url = admin_url( 'admin.php?page=tutor&welcome=1' ); $html = ''; return $html; } /** * Setup wizard boarding * * @since 1.0.0 * * @return void */ public function tutor_setup_wizard_boarding() { global $current_user; ?>
    display_name( $current_user->ID ); $greeting .= '!'; echo esc_html( $greeting ); ?>

    get_option( 'enable_course_marketplace' ); $course_marketplace = 1 === $course_marketplace ? 'on' : 'off'; ?>
    />
    />
    > <?php esc_html_e( 'Tutor › Setup Wizard', 'tutor' ); ?> url . 'assets/css/tutor-setup.min.css', array(), TUTOR_VERSION ); wp_register_script( 'tutor-setup', tutor()->url . 'assets/js/tutor-setup.min.js', array( 'jquery', 'wp-i18n' ), TUTOR_VERSION, true ); wp_localize_script( 'tutor-setup', '_tutorobject', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) ) ); } } /** * Check if welcome page already visited * * @since 1.0.0 * * @return bool */ public static function is_welcome_page_visited(): bool { return false; } /** * Mark as welcome page visited * * @since 1.0.0 * * @return void */ public static function mark_as_visited() { update_option( 'tutor_welcome_page_visited', true ); } }