DashboardTileMigrationMajor2
extends AbstractDashboardTileMigration
in package
Migration for Major version 2.
Tags
Table of Contents
Constants
- DELETE_LANGUAGES = ['de', 'en']
- DELETE_OPTIONS_TEXTS = [\DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_DESCRIPTION, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_DATA_PROCESSING_IN_UNSAFE_COUNTRIES, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_AGE_NOTICE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_AGE_NOTICE_BLOCKER, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_CONSENT_FORWARDING, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_ALL, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_ESSENTIALS, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_INDIVIDUAL, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_POWERED_BY_TEXT, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_LINK_SHOW_MISSING, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_LOAD_BUTTON, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_ACCEPT_INFO, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_DESCRIPTION, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_SAVE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_SHOW_MORE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_HIDE_MORE]
- 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.
- applyNewTexts() : mixed
- Apply new customizer and groups texts and overwrite existing.
- bannerTemplates() : mixed
- Show a "NEW!" badge to the new standard templates.
- 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
DELETE_LANGUAGES
public
mixed
DELETE_LANGUAGES
= ['de', 'en']
DELETE_OPTIONS_TEXTS
public
mixed
DELETE_OPTIONS_TEXTS
= [\DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_DESCRIPTION, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_DATA_PROCESSING_IN_UNSAFE_COUNTRIES, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_AGE_NOTICE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_AGE_NOTICE_BLOCKER, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_CONSENT_FORWARDING, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_ALL, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_ESSENTIALS, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_ACCEPT_INDIVIDUAL, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_POWERED_BY_TEXT, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_LINK_SHOW_MISSING, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_LOAD_BUTTON, \DevOwl\RealCookieBanner\view\customize\banner\Texts::SETTING_BLOCKER_ACCEPT_INFO, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_HEADLINE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_DESCRIPTION, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_SAVE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_SHOW_MORE, \DevOwl\RealCookieBanner\view\customize\banner\individual\Texts::SETTING_HIDE_MORE]
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
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>
Tags
applyNewTexts()
Apply new customizer and groups texts and overwrite existing.
public
applyNewTexts(array<string|int, mixed> $result) : mixed
Parameters
- $result : array<string|int, mixed>
bannerTemplates()
Show a "NEW!" badge to the new standard templates.
public
bannerTemplates(array<string|int, mixed> $templates) : mixed
Parameters
- $templates : array<string|int, mixed>
deleteCustomizerTexts()
Delete customizer texts for given languages and option keys.
public
deleteCustomizerTexts(array<string|int, string>|null $languages, array<string|int, string> $ids) : array<string|int, string>
Parameters
- $languages : array<string|int, string>|null
-
Pass
null
to delete all languages - $ids : array<string|int, string>
Tags
Return values
array<string|int, string> —Deleted option keys
dismiss()
Dismiss this migration.
public
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
getDescription() : string
Return values
stringgetHeadline()
Get a headline for this migration.
public
getHeadline() : string
Return values
stringgetId()
Get a unique id for this migration.
public
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
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
Tags
init()
Initialize hooks.
protected
init() : mixed