Google_Sheet_Helpers::__construct()

Googlesheet_Pro_Helpers constructor.


Source

File: src/integrations/google-sheet/helpers/google-sheet-helpers.php

	public function __construct() {
		// Selectively load options
		if ( method_exists( '\Uncanny_Automator\Automator_Helpers_Recipe', 'maybe_load_trigger_options' ) ) {
			global $uncanny_automator;
			$this->load_options = $uncanny_automator->helpers->recipe->maybe_load_trigger_options( __CLASS__ );
		} else {
			$this->load_options = true;
		}

		$this->setting_tab   = 'googlesheets_api';
		$this->automator_api = AUTOMATOR_API_URL . 'v2/google';

		$this->client_scope = implode(
			' ',
			array(
				self::SCOPE_DRIVE,
				self::SCOPE_SPREADSHEETS,
				self::SCOPE_USERINFO,
				self::SCOPE_USER_EMAIL,
			)
		);

		add_filter( 'uap_settings_tabs', array( $this, 'add_google_api_settings' ), 15 );
		add_action( 'init', array( $this, 'validate_oauth_tokens' ), 100, 3 );
		add_filter( 'automator_after_settings_extra_content', array( $this, 'google_sheet_connect_html' ), 10, 3 );
		add_action( 'wp_ajax_select_gsspreadsheet_from_gsdrive', array( $this, 'select_gsspreadsheet_from_gsdrive' ) );
		add_action(
			'wp_ajax_select_gsworksheet_from_gsspreadsheet',
			array(
				$this,
				'select_gsworksheet_from_gsspreadsheet',
			)
		);
		add_action( 'wp_ajax_get_worksheet_ROWS_GOOGLESHEETS', array( $this, 'get_worksheet_rows_gsspreadsheet' ) );

		add_action( 'wp_ajax_uo_google_disconnect_user', array( $this, 'disconnect_user' ) );
	}