mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +02:00
parent
59ef54314a
commit
51aa22d429
@ -162,6 +162,13 @@ class Module
|
|||||||
*/
|
*/
|
||||||
private $app;
|
private $app;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The CSS/LESS files this module provides
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $cssFiles = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Routes to add to the route chain
|
* Routes to add to the route chain
|
||||||
*
|
*
|
||||||
@ -388,6 +395,19 @@ class Module
|
|||||||
return $manager->getModule($name);
|
return $manager->getModule($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provide an additional CSS/LESS file
|
||||||
|
*
|
||||||
|
* @param string $path The path to the file, relative to self::$cssdir
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
protected function provideCssFile($path)
|
||||||
|
{
|
||||||
|
$this->cssFiles[] = $this->cssdir . DIRECTORY_SEPARATOR . $path;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if module provides css
|
* Test if module provides css
|
||||||
*
|
*
|
||||||
@ -395,7 +415,12 @@ class Module
|
|||||||
*/
|
*/
|
||||||
public function hasCss()
|
public function hasCss()
|
||||||
{
|
{
|
||||||
return file_exists($this->getCssFilename());
|
if (file_exists($this->getCssFilename())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->launchConfigScript();
|
||||||
|
return !empty($this->cssFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -408,6 +433,18 @@ class Module
|
|||||||
return $this->cssdir . '/module.less';
|
return $this->cssdir . '/module.less';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the CSS/LESS files this module provides
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getCssFiles()
|
||||||
|
{
|
||||||
|
$files = $this->cssFiles;
|
||||||
|
$files[] = $this->getCssFilename();
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if module provides js
|
* Test if module provides js
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user