class Manager

Manage Angular resources.

Properties

protected CRM_Core_Resources $res
protected array|null $modules Modules.
protected CRM_Utils_Cache_Interface $cache
protected array $changeSets

Methods

__construct(CRM_Core_Resources $res, CRM_Utils_Cache_Interface $cache = NULL)

No description

array
getModules()

Get a list of AngularJS modules which should be autoloaded.

array
getModule(string $name)

Get the descriptor for an Angular module.

array
resolveDependencies(array $names)

Resolve a full list of Angular dependencies.

array
resolveDefaultModules(string $basePage)

Get a list of Angular modules that should be loaded on the given base-page.

array
resolvePatterns(array $modules)

Convert any globs in an Angular module to file names.

array
getRawPartials(string $name)

Get the partial HTML documents for a module (unfiltered).

array
getPartials(string $name)

Get the partial HTML documents for a module.

array
getTranslatedStrings(string $name)

Get list of translated strings for a module.

array
getStrings(string $name)

Get list of translatable strings for a module.

array
getResources(string|array $moduleNames, string $resType, string $refType)

Get resources for one or more modules.

array
getChangeSets()

No description

add(ChangeSet $changeSet)

No description

Details

at line 51
__construct(CRM_Core_Resources $res, CRM_Utils_Cache_Interface $cache = NULL)

Parameters

CRM_Core_Resources $res The resource manager.
CRM_Utils_Cache_Interface $cache

at line 73
array getModules()

Get a list of AngularJS modules which should be autoloaded.

Return Value

array Each item has some combination of these keys: - ext: string The Civi extension which defines the Angular module. - js: array(string $relativeFilePath) List of JS files (relative to the extension). - css: array(string $relativeFilePath) List of CSS files (relative to the extension). - partials: array(string $relativeFilePath) A list of partial-HTML folders (relative to the extension). This will be mapped to "~/moduleName" by crmResource. - settings: array(string $key => mixed $value) List of settings to preload.

at line 132
array getModule(string $name)

Get the descriptor for an Angular module.

Parameters

string $name Module name.

Return Value

array Details about the module: - ext: string, the name of the Civi extension which defines the module - js: array(string $relativeFilePath). - css: array(string $relativeFilePath). - partials: array(string $relativeFilePath).

Exceptions

Exception

at line 150
array resolveDependencies(array $names)

Resolve a full list of Angular dependencies.

Parameters

array $names List of Angular modules. Ex: array('crmMailing').

Return Value

array List of Angular modules, include all dependencies. Ex: array('crmMailing', 'crmUi', 'crmUtil', 'ngRoute').

at line 182
array resolveDefaultModules(string $basePage)

Get a list of Angular modules that should be loaded on the given base-page.

Parameters

string $basePage The name of the base-page for which we want a list of moudles.

Return Value

array List of Angular modules. Ex: array('crmMailing', 'crmUi', 'crmUtil', 'ngRoute').

at line 201
protected array resolvePatterns(array $modules)

Convert any globs in an Angular module to file names.

Parameters

array $modules List of Angular modules.

Return Value

array Updated list of Angular modules

at line 227
array getRawPartials(string $name)

Get the partial HTML documents for a module (unfiltered).

Parameters

string $name Angular module name.

Return Value

array Array(string $extFilePath => string $html)

Exceptions

Exception Invalid partials configuration.

at line 254
array getPartials(string $name)

Get the partial HTML documents for a module.

Parameters

string $name Angular module name.

Return Value

array Array(string $extFilePath => string $html)

Exceptions

Exception Invalid partials configuration.

at line 272
array getTranslatedStrings(string $name)

Get list of translated strings for a module.

Parameters

string $name Angular module name.

Return Value

array Translated strings: array(string $orig => string $translated).

at line 297
array getStrings(string $name)

Get list of translatable strings for a module.

Parameters

string $name Angular module name.

Return Value

array Translatable strings.

at line 330
array getResources(string|array $moduleNames, string $resType, string $refType)

Get resources for one or more modules.

Parameters

string|array $moduleNames List of module names.
string $resType Type of resource ('js', 'css', 'settings').
string $refType Type of reference to the resource ('cacheUrl', 'rawUrl', 'path', 'settings').

Return Value

array List of URLs or paths.

Exceptions

CRM_Core_Exception

at line 403
array getChangeSets()

Return Value

array Array(string $name => ChangeSet $changeSet).

at line 415
Manager add(ChangeSet $changeSet)

Parameters

ChangeSet $changeSet

Return Value

Manager