SHEET_UPDATERECORD::load_options()

load_options


Return Return

(void)


Source Source

File: src/integrations/google-sheet/actions/sheet-updaterecord.php

	public function load_options() {
		$options = array(
			'options_group' => array(
				$this->action_meta => array(
					Automator()->helpers->recipe->google_sheet->options->get_google_drives(
						__( 'Drive', 'uncanny-automator' ),
						'GSDRIVE',
						array(
							'is_ajax'      => true,
							'target_field' => 'GSSPREADSHEET',
							'endpoint'     => 'select_gsspreadsheet_from_gsdrive',
						)
					),
					Automator()->helpers->recipe->google_sheet->get_google_spreadsheets(
						__( 'Spreadsheet', 'uncanny-automator' ),
						'GSSPREADSHEET',
						array(
							'is_ajax'      => true,
							'target_field' => 'GSWORKSHEET',
							'endpoint'     => 'select_gsworksheet_from_gsspreadsheet',
						)
					),
					Automator()->helpers->recipe->google_sheet->get_google_worksheets(
						__( 'Worksheet', 'uncanny-automator' ),
						'GSWORKSHEET',
						array(
							'is_ajax'      => true,
							'target_field' => 'GSWORKSHEETCOLUMN',
							'endpoint'     => 'select_gsworksheet_from_gsspreadsheet_columns',
						)
					),
					Automator()->helpers->recipe->google_sheet->get_google_sheet_columns(
						__( 'Column search', 'uncanny-automator' ),
						'GSWORKSHEETCOLUMN',
						array(
							'is_ajax' => true,
						)
					),
					Automator()->helpers->recipe->field->text(
						array(
							'option_code' => 'GSWORKSHEET_SOURCE_VALUE',
							'input_type'  => 'text',
							'label'       => esc_attr__( 'Match value', 'uncanny-automator' ),
						)
					),
					array(
						'option_code'       => 'WORKSHEET_FIELDS',
						'input_type'        => 'repeater',
						'label'             => __( 'Row', 'uncanny-automator' ),
						/* translators: 1. Button */
						'description'       => '',
						'required'          => true,
						'fields'            => array(
							array(
								'option_code' => 'GS_COLUMN_NAME',
								'label'       => __( 'Column', 'uncanny-automator' ),
								'input_type'  => 'text',
								'required'    => true,
								'read_only'   => true,
								'options'     => array(),
							),

							array(
								'option_code' => 'COLUMN_UPDATE',
								'label'       => __( 'Update?', 'uncanny-automator' ),
								'input_type'  => 'checkbox',
								'is_toggle'   => true,
							),

							Automator()->helpers->recipe->field->text_field( 'GS_COLUMN_VALUE', __( 'Value', 'uncanny-automator' ), true, 'text', '', false ),
						),
						'add_row_button'    => __( 'Add pair', 'uncanny-automator' ),
						'remove_row_button' => __( 'Remove pair', 'uncanny-automator' ),
						'hide_actions'      => true,
						'can_sort_rows'     => false,
					),
				),
			),
		);

		return $options;
	}