AbstractDashboardTileMigration
in package
Uses
UtilsProvider
Allow to define a list of migrations in our dashboard.
Table of Contents
Constants
- OPTION_NAME_CLICKED_ACTIONS = RCB_OPT_PREFIX . '-migration-actions-clicked'
Properties
Methods
- __construct() : mixed
- C'tor. Register your actions with `$this::addAction` here!
- actions() : void
- `addAction()` your actions here.
- addAction() : mixed
- Register a new action which can be made for this migration.
- applyNewGroupTexts() : mixed
- Upgrade the group texts for a list of languages.
- deleteCustomizerTexts() : array<string|int, string>
- Delete customizer texts for given languages and option keys.
- dismiss() : bool
- Dismiss this migration.
- doAction() : mixed
- Start a given migration by ID.
- doDismiss() : mixed
- Dismiss a migration by ID.
- doRegisterActions() : mixed
- Register all actions with `AbstractDashboardTileMigration#actions()` method.
- getConfigUrl() : mixed
- Get a config URL pointing to a given route (react-router).
- getDescription() : string
- Get a description for this migration.
- getHeadline() : string
- Get a headline for this migration.
- getId() : string
- Get a unique id for this migration.
- getPluginConstantPrefix() : string
- Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
- hasMajorPreviouslyInstalled() : mixed
- Check if a given major version was previously installed.
- isActive() : bool
- Check if this migration is active.
- removeMajorVersionFromPreviouslyInstalled() : mixed
- Dismiss the migration by removing a major version from the previously installed versions.
- revisionCurrent() : mixed
- Get the migration as plain array so it can be consumed in the frontend.
- saveActionPerformed() : mixed
- Save an action as "performed" so we can show this in the UI.
- scanWebsiteAgain() : mixed
- Start the scanner and redirect to scanner tab.
- applyNewGroupTextsForLanguage() : mixed
- Upgrade the group texts for a given language.
- init() : mixed
- Initialize hooks.
Constants
OPTION_NAME_CLICKED_ACTIONS
public
mixed
OPTION_NAME_CLICKED_ACTIONS
= RCB_OPT_PREFIX . '-migration-actions-clicked'
Properties
$actions
A set of actions which can be made within this migration.
private
mixed
$actions
= []
See also $this::addAction
.
$id
private
mixed
$id
Methods
__construct()
C'tor. Register your actions with `$this::addAction` here!
public
__construct() : mixed
actions()
`addAction()` your actions here.
public
abstract actions() : void
addAction()
Register a new action which can be made for this migration.
public
addAction(string $id, string $title, string $description[, array<string|int, mixed> $args = [] ]) : mixed
Arguments:
-
[linkText] (string)
Can benull
to disable the link -
[linkClasses="button"] (string)
Class name for the button -
[linkDisabled] (boolean|"performed")
Disable the action link -
[performed] (boolean)
Force to show "Already applied!" -
[performedLabel] (string)
Change the text of "Already applied!" -
[needsPro] (boolean)
The action is only available in PRO version -
[confirmText] (string)
The user needs to confirm this migration with something like "Are you sure?" -
[callback] (callback|string)
Can benull
, a callback which is executed when clicking the link or a direct URL -
[previewImage] (string)
Absolute URL to preview image -
[info] (string)
Show an additional info notice
Parameters
- $id : string
-
Unique action ID
- $title : string
- $description : string
- $args : array<string|int, mixed> = []
-
Arguments, see above
applyNewGroupTexts()
Upgrade the group texts for a list of languages.
public
applyNewGroupTexts(array<string|int, string> $deleteLanguages) : mixed
Parameters
- $deleteLanguages : array<string|int, string>
deleteCustomizerTexts()
Delete customizer texts for given languages and option keys.
public
deleteCustomizerTexts(array<string|int, string> $languages, array<string|int, string> $ids) : array<string|int, string>
Parameters
- $languages : array<string|int, string>
- $ids : array<string|int, string>
Return values
array<string|int, string> —Deleted option keys
dismiss()
Dismiss this migration.
public
abstract dismiss() : bool
Return values
booldoAction()
Start a given migration by ID.
public
static doAction(string $migrationId, string $actionId) : mixed
Parameters
- $migrationId : string
- $actionId : string
doDismiss()
Dismiss a migration by ID.
public
static doDismiss(string $migrationId) : mixed
Parameters
- $migrationId : string
doRegisterActions()
Register all actions with `AbstractDashboardTileMigration#actions()` method.
public
static doRegisterActions() : mixed
getConfigUrl()
Get a config URL pointing to a given route (react-router).
public
getConfigUrl(string $route) : mixed
Parameters
- $route : string
getDescription()
Get a description for this migration.
public
abstract getDescription() : string
Return values
stringgetHeadline()
Get a headline for this migration.
public
abstract getHeadline() : string
Return values
stringgetId()
Get a unique id for this migration.
public
abstract getId() : string
Return values
stringgetPluginConstantPrefix()
Get the prefix of this plugin so composer packages can dynamically build other constant values on it.
public
getPluginConstantPrefix() : string
Tags
Return values
stringhasMajorPreviouslyInstalled()
Check if a given major version was previously installed.
public
hasMajorPreviouslyInstalled(int $majorVersion) : mixed
Parameters
- $majorVersion : int
isActive()
Check if this migration is active.
public
abstract isActive() : bool
Return values
boolremoveMajorVersionFromPreviouslyInstalled()
Dismiss the migration by removing a major version from the previously installed versions.
public
removeMajorVersionFromPreviouslyInstalled(int $majorVersion) : mixed
Parameters
- $majorVersion : int
revisionCurrent()
Get the migration as plain array so it can be consumed in the frontend.
public
revisionCurrent(array<string|int, mixed> $array) : mixed
Parameters
- $array : array<string|int, mixed>
saveActionPerformed()
Save an action as "performed" so we can show this in the UI.
public
saveActionPerformed(string $id) : mixed
Parameters
- $id : string
scanWebsiteAgain()
Start the scanner and redirect to scanner tab.
public
scanWebsiteAgain(array<string|int, mixed> $result) : mixed
Parameters
- $result : array<string|int, mixed>
applyNewGroupTextsForLanguage()
Upgrade the group texts for a given language.
protected
applyNewGroupTextsForLanguage(array<string|int, string> $deleteLanguages, string $locale) : mixed
Parameters
- $deleteLanguages : array<string|int, string>
- $locale : string
init()
Initialize hooks.
protected
init() : mixed