14 private $baseUrl =
'';
20 private $dependencies = [];
44 $this->baseUrl =
$url;
58 $path = preg_replace(
'/\.js$/',
'', $path);
61 if (!isset($this->paths[$name])) {
62 $this->paths[
$name] = [];
65 array_unshift($this->paths[$name], $path);
78 unset($this->paths[
$name]);
85 unset($this->paths[$name][
$key]);
87 if (empty($this->paths[$name])) {
88 unset($this->paths[$name]);
108 if (empty(
$deps) && empty($exports)) {
112 $this->shim[
$name] = [];
118 if (!empty($exports)) {
119 $this->shim[
$name][
'exports'] = $exports;
131 return isset($this->shim[
$name]);
142 unset($this->shim[
$name]);
153 $this->dependencies[
$name] =
true;
164 unset($this->dependencies[$name]);
173 return array_keys($this->dependencies);
184 return isset($this->dependencies[
$name]);
210 if (!empty(
$deps) || !empty($exports)) {
242 if (isset($this->shim[
$name])) {
246 if (isset($this->paths[$name])) {
260 'baseUrl' => $this->baseUrl,
261 'paths' => $this->paths,
262 'shim' => $this->shim,
removeShim($name)
Unregister the shim config for a module.
addShim(string $name, array $config)
Configures a shimmed module.
Exception thrown if an argument is not of the expected type.
$params
Saves global plugin settings.
addPath(string $name, string $path)
Add a path mapping for a module.
if(!$user||!$user->canDelete()) $name
setBaseUrl($url)
Set the base URL for the site.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
removePath($name, $path=null)
Remove a path for a module.
getDependencies()
Get registered dependencies.
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
$config
Advanced site settings, debugging section.
__construct(\Elgg\EventsService $events)
Constructor.
addModule($name, array $config=[])
Adds a standard AMD or shimmed module to the config.
getConfig()
Get the configuration of AMD.
addDependency(string $name)
Add a dependency.
Control configuration of RequireJS.
hasShim($name)
Is this shim defined.
if($container instanceof ElggGroup &&$container->guid!=elgg_get_page_owner_guid()) $key
hasModule($name)
Is module configured?
hasDependency($name)
Is this dependency registered.
foreach($plugin_guids as $guid) if(empty($deactivated_plugins)) $url
removeModule($name)
Removes all config for a module.
removeDependency(string $name)
Removes a dependency.