Skip to main content

GravityKit\GravityExport\Save\StorageType\Dropbox

Storage type that stores to a Dropbox folder.

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:21

Details

  • Kind: class
  • Namespace: GravityKit\GravityExport\Save\StorageType
  • Extends: FlySystemStorageType

Methods

MethodDescription
__construct()Creates the storage type.
getGlobalSettings()Adds the dropbox sections to the {@see GravityExportAddon}.
getId()Should return a unique name for the storage type.
getTitle()Should return the title of the storage type.
getIcon()Should return the icon for the storage method.
isDisabled()Should return whether the storage method is properly configured in the global settings.
getFeedFields()Should return the field section for this storage type.
getStorageSettings()Updates the settings for a storage type.
getTokenProvider()Retrieves auth token from settings.
getAccessToken()Returns the access token (or an empty string).
getRefreshToken()Returns the refresh token (or an empty string).
refreshAccessToken()Refreshes the access token with the refresh token.
revokeAccessToken()Revokes the access & refresh token for this site.

Method Reference

__construct()

public function __construct( StorageService $service, PasswordService $password_service, ConnectionManagerService $connection_manager_service, string $api_base_url )

Creates the storage type.

Parameters

NameTypeDefaultDescription
$serviceStorageServiceThe storage service.
$password_servicePasswordService
$connection_manager_serviceConnectionManagerService
$api_base_urlstring

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:79

getGlobalSettings()

public function getGlobalSettings( array $sections ): array

Adds the dropbox sections to the {@see GravityExportAddon}.

Parameters

NameTypeDefaultDescription
$sectionsarrayThe sections.

Returns

  • array — The sections

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:105

getId()

public function getId(): string

Should return a unique name for the storage type.

Returns

  • string

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:193

getTitle()

public function getTitle(): string

Should return the title of the storage type.

Returns

  • string

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:203

getIcon()

public function getIcon(): string

Should return the icon for the storage method.

In GF 2.4, it must be a FontAwesome CSS class. In GF 2.5, it must be parseable by \GFCommon::get_icon_markup().

Returns

  • string

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:211

isDisabled()

public function isDisabled(): bool

Should return whether the storage method is properly configured in the global settings.

Returns

  • bool

Source: add-ons/save/src/StorageType/Dropbox.php:219

getFeedFields()

public function getFeedFields( SaveAddon $feed ): array

Should return the field section for this storage type.

Parameters

NameTypeDefaultDescription
$feedSaveAddonThe storage feed addon.

Returns

  • mixed[] — The fields for the storage type.

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:227

getStorageSettings()

public function getStorageSettings( array $settings, array $feed ): array

Updates the settings for a storage type.

Parameters

NameTypeDefaultDescription
$settingsmixed[]The current settings.
$feedmixed[]The fresh feed settings.

Returns

  • mixed[] — The updated settings.

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:245

getTokenProvider()

public function getTokenProvider(): TokenProvider

Retrieves auth token from settings.

Returns

  • TokenProvider — The token provider..

Since: 1.0

Source: add-ons/save/src/StorageType/Dropbox.php:256

getAccessToken()

public function getAccessToken(): string

Returns the access token (or an empty string).

Returns

  • string — The access token.

Since: $ver$

Source: add-ons/save/src/StorageType/Dropbox.php:337

getRefreshToken()

public function getRefreshToken(): string

Returns the refresh token (or an empty string).

Returns

  • string — The refresh token.

Since: $ver$

Source: add-ons/save/src/StorageType/Dropbox.php:348

refreshAccessToken()

public function refreshAccessToken(): bool

Refreshes the access token with the refresh token.

Returns

  • bool — Whether the access token was refreshed.

Since: $ver$

Source: add-ons/save/src/StorageType/Dropbox.php:359

revokeAccessToken()

public function revokeAccessToken(): bool

Revokes the access & refresh token for this site.

Returns

  • bool — Whether the tokens were revoked.

Since: $ver$

Source: add-ons/save/src/StorageType/Dropbox.php:396