mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 17:24:16 +02:00
parent
51aa22d429
commit
712d545f48
@ -169,6 +169,13 @@ class Module
|
|||||||
*/
|
*/
|
||||||
protected $cssFiles = array();
|
protected $cssFiles = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Javascript files this module provides
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $jsFiles = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Routes to add to the route chain
|
* Routes to add to the route chain
|
||||||
*
|
*
|
||||||
@ -445,6 +452,19 @@ class Module
|
|||||||
return $files;
|
return $files;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provide an additional Javascript file
|
||||||
|
*
|
||||||
|
* @param string $path The path to the file, relative to self::$jsdir
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
protected function provideJsFile($path)
|
||||||
|
{
|
||||||
|
$this->jsFiles[] = $this->jsdir . DIRECTORY_SEPARATOR . $path;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if module provides js
|
* Test if module provides js
|
||||||
*
|
*
|
||||||
@ -452,7 +472,12 @@ class Module
|
|||||||
*/
|
*/
|
||||||
public function hasJs()
|
public function hasJs()
|
||||||
{
|
{
|
||||||
return file_exists($this->getJsFilename());
|
if (file_exists($this->getJsFilename())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->launchConfigScript();
|
||||||
|
return !empty($this->jsFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -465,6 +490,18 @@ class Module
|
|||||||
return $this->jsdir . '/module.js';
|
return $this->jsdir . '/module.js';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the Javascript files this module provides
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getJsFiles()
|
||||||
|
{
|
||||||
|
$files = $this->jsFiles;
|
||||||
|
$files[] = $this->getJsFilename();
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the module name
|
* Get the module name
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user