class Manager

Manage Angular resources.

Properties

protected CRM_Core_Resources $res
protected array|NULL $modules

Methods

__construct(CRM_Core_Resources $res)

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
resolvePatterns(array $modules)

Convert any globs in an Angular module to file names.

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.

Details

at line 37
__construct(CRM_Core_Resources $res)

Parameters

CRM_Core_Resources $res The resource manager.

at line 58
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 166
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 182
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 208
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 232
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 257
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 300
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