TabManager
in package
Record tab manager
Tags
Table of Contents
- $config : array<string|int, mixed>
- Tab configurations
- $configManager : PluginManager
- Configuration plugin manager
- $context : string
- Current active context (defaults to 'record')
- $contextSettings : array<string|int, mixed>
- Settings for different tab contexts.
- $legacyConfig : array<string|int, mixed>
- Overall framework configuration (used for fetching configurations "the old way" -- can eventually be deprecated).
- $pluginManager : PluginManager
- RecordTab plugin manager
- __construct() : mixed
- Constructor
- getBackgroundTabNames() : array<string|int, mixed>
- Get an array of tabs names configured to load via AJAX in the background
- getDefaultTabForRecord() : string
- Get a default tab by looking up the provided record driver in the tab configuration array.
- getExtraScripts() : array<string|int, mixed>
- Get an array of extra JS scripts by looking up the provided record driver in the provided tab configuration array.
- getTabDetailsForRecord() : array<string|int, mixed>
- Convenience method to load tab information, including default, in a single pass. Returns an associative array with 'tabs' and 'default' keys.
- getTabsForRecord() : array<string|int, mixed>
- Get an array of valid tabs for the provided record driver.
- setContext() : void
- Set and (if necessary) initialize the context.
- getConfigByClass() : mixed
- Load the specified key from the configuration array using the best available match to the class of the provided driver. Return the default value if no match is found.
- getTabServiceNames() : array<string|int, mixed>
- Get an array of service names by looking up the provided record driver in the provided tab configuration array.
- initializeCurrentContext() : void
- Initialize the current context (if not already initialized).
Properties
$config
Tab configurations
protected
array<string|int, mixed>
$config
= []
$configManager
Configuration plugin manager
protected
PluginManager
$configManager
$context
Current active context (defaults to 'record')
protected
string
$context
= 'record'
$contextSettings
Settings for different tab contexts.
protected
array<string|int, mixed>
$contextSettings
= ['record' => ['configFile' => 'RecordTabs', 'legacyConfigSection' => 'recorddriver_tabs'], 'collection' => ['configFile' => 'CollectionTabs', 'legacyConfigSection' => 'recorddriver_collection_tabs']]
$legacyConfig
Overall framework configuration (used for fetching configurations "the old way" -- can eventually be deprecated).
protected
array<string|int, mixed>
$legacyConfig
$pluginManager
RecordTab plugin manager
protected
PluginManager
$pluginManager
Methods
__construct()
Constructor
public
__construct(PluginManager $pm, PluginManager $cm[, array<string|int, mixed> $legacyConfig = [] ]) : mixed
Parameters
- $pm : PluginManager
-
RecordTab plugin manager
- $cm : PluginManager
-
Configuration plugin manager
- $legacyConfig : array<string|int, mixed> = []
-
Overall framework configuration (only used for legacy config loading; optional)
Return values
mixed —getBackgroundTabNames()
Get an array of tabs names configured to load via AJAX in the background
public
getBackgroundTabNames(AbstractBase $driver) : array<string|int, mixed>
Parameters
- $driver : AbstractBase
-
Record driver
Return values
array<string|int, mixed> —getDefaultTabForRecord()
Get a default tab by looking up the provided record driver in the tab configuration array.
public
getDefaultTabForRecord(AbstractBase $driver, array<string|int, mixed> $tabs[, string $fallback = null ]) : string
Parameters
- $driver : AbstractBase
-
Record driver
- $tabs : array<string|int, mixed>
-
Details on available tabs (returned from getTabsForRecord()).
- $fallback : string = null
-
Fallback to use if no tab specified or matched.
Return values
string —getExtraScripts()
Get an array of extra JS scripts by looking up the provided record driver in the provided tab configuration array.
public
getExtraScripts() : array<string|int, mixed>
Return values
array<string|int, mixed> —getTabDetailsForRecord()
Convenience method to load tab information, including default, in a single pass. Returns an associative array with 'tabs' and 'default' keys.
public
getTabDetailsForRecord(AbstractBase $driver[, Request $request = null ][, string $fallback = null ]) : array<string|int, mixed>
Parameters
- $driver : AbstractBase
-
Record driver
- $request : Request = null
-
User request (optional)
- $fallback : string = null
-
Fallback default tab to use if no tab specified or matched.
Return values
array<string|int, mixed> —getTabsForRecord()
Get an array of valid tabs for the provided record driver.
public
getTabsForRecord(AbstractBase $driver[, Request $request = null ]) : array<string|int, mixed>
Parameters
- $driver : AbstractBase
-
Record driver
- $request : Request = null
-
User request (optional)
Return values
array<string|int, mixed> —service name => tab object
setContext()
Set and (if necessary) initialize the context.
public
setContext(string $context) : void
Parameters
- $context : string
-
Context to initialize
Tags
Return values
void —getConfigByClass()
Load the specified key from the configuration array using the best available match to the class of the provided driver. Return the default value if no match is found.
protected
getConfigByClass(AbstractBase $driver, string $setting, string $default) : mixed
Parameters
- $driver : AbstractBase
-
Record driver
- $setting : string
-
Key to load from configuration
- $default : string
-
Default to use if no setting found
Return values
mixed —getTabServiceNames()
Get an array of service names by looking up the provided record driver in the provided tab configuration array.
protected
getTabServiceNames(AbstractBase $driver) : array<string|int, mixed>
Parameters
- $driver : AbstractBase
-
Record driver
Return values
array<string|int, mixed> —initializeCurrentContext()
Initialize the current context (if not already initialized).
protected
initializeCurrentContext() : void