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()
|
||||
{
|
||||
$path = Icinga::app()->getBaseDir('doc');
|
||||
if (is_dir($path)) {
|
||||
return $path;
|
||||
}
|
||||
if (($path = $this->Config()->get('documentation', 'icingaweb2')) !== null) {
|
||||
if (is_dir($path)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
$path = Icinga::app()->getBaseDir('doc');
|
||||
if (is_dir($path)) {
|
||||
return $path;
|
||||
}
|
||||
throw new Zend_Controller_Action_Exception(
|
||||
$this->translate('Documentation for Icinga Web 2 is not available'),
|
||||
404
|
||||
|
|
|
@ -25,15 +25,15 @@ class Doc_ModuleController extends DocController
|
|||
*/
|
||||
protected function getPath($module, $default, $suppressErrors = false)
|
||||
{
|
||||
if (is_dir($default)) {
|
||||
return $default;
|
||||
}
|
||||
if (($path = $this->Config()->get('documentation', 'modules')) !== null) {
|
||||
$path = str_replace('{module}', $module, $path);
|
||||
if (is_dir($path)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
if (is_dir($default)) {
|
||||
return $default;
|
||||
}
|
||||
if ($suppressErrors) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue