mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-21 12:54:26 +02:00
doc: Prefer "root" doc path over configured path
If the "root" doc path, i.e. application/doc exists, it is preferred over the configured one. refs #4075
This commit is contained in:
parent
3120a0c090
commit
d2a7254a37
@ -17,15 +17,15 @@ class Doc_IcingawebController extends DocController
|
|||||||
*/
|
*/
|
||||||
protected function getPath()
|
protected function getPath()
|
||||||
{
|
{
|
||||||
|
$path = Icinga::app()->getBaseDir('doc');
|
||||||
|
if (is_dir($path)) {
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
if (($path = $this->Config()->get('documentation', 'icingaweb2')) !== null) {
|
if (($path = $this->Config()->get('documentation', 'icingaweb2')) !== null) {
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$path = Icinga::app()->getBaseDir('doc');
|
|
||||||
if (is_dir($path)) {
|
|
||||||
return $path;
|
|
||||||
}
|
|
||||||
throw new Zend_Controller_Action_Exception(
|
throw new Zend_Controller_Action_Exception(
|
||||||
$this->translate('Documentation for Icinga Web 2 is not available'),
|
$this->translate('Documentation for Icinga Web 2 is not available'),
|
||||||
404
|
404
|
||||||
|
@ -25,15 +25,15 @@ class Doc_ModuleController extends DocController
|
|||||||
*/
|
*/
|
||||||
protected function getPath($module, $default, $suppressErrors = false)
|
protected function getPath($module, $default, $suppressErrors = false)
|
||||||
{
|
{
|
||||||
|
if (is_dir($default)) {
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
if (($path = $this->Config()->get('documentation', 'modules')) !== null) {
|
if (($path = $this->Config()->get('documentation', 'modules')) !== null) {
|
||||||
$path = str_replace('{module}', $module, $path);
|
$path = str_replace('{module}', $module, $path);
|
||||||
if (is_dir($path)) {
|
if (is_dir($path)) {
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_dir($default)) {
|
|
||||||
return $default;
|
|
||||||
}
|
|
||||||
if ($suppressErrors) {
|
if ($suppressErrors) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user