mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-20 20:34:25 +02:00
parent
127e4f444f
commit
d35e0816c9
@ -44,13 +44,13 @@ class Doc_ModuleController extends DocController
|
|||||||
$moduleManager = Icinga::app()->getModuleManager();
|
$moduleManager = Icinga::app()->getModuleManager();
|
||||||
if (! $moduleManager->hasInstalled($moduleName)) {
|
if (! $moduleManager->hasInstalled($moduleName)) {
|
||||||
throw new Zend_Controller_Action_Exception(
|
throw new Zend_Controller_Action_Exception(
|
||||||
$this->translate('Module') . ' \'' . $moduleName . '\' ' . $this->translate('is not installed'),
|
$this->translate(sprintf('Module \'%s\' is not installed', $moduleName)),
|
||||||
404
|
404
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (! $moduleManager->hasEnabled($moduleName)) {
|
if (! $moduleManager->hasEnabled($moduleName)) {
|
||||||
throw new Zend_Controller_Action_Exception(
|
throw new Zend_Controller_Action_Exception(
|
||||||
$this->translate('Module') . ' \'' . $moduleName . '\' ' . $this->translate('is not enabled'),
|
$this->translate(sprintf('Module \'%s\' is not enabled', $moduleName)),
|
||||||
404
|
404
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -41,19 +41,24 @@ class DocParser
|
|||||||
{
|
{
|
||||||
if (! is_dir($path)) {
|
if (! is_dir($path)) {
|
||||||
throw new DocException(
|
throw new DocException(
|
||||||
mt('doc', 'Documentation directory') . ' \'' . $path . '\' ' . mt('doc', 'does not exist')
|
mt('doc', sprintf('Documentation directory \'%s\' does not exist', $path))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (! is_readable($path)) {
|
if (! is_readable($path)) {
|
||||||
throw new DocException(
|
throw new DocException(
|
||||||
mt('doc', 'Documentation directory') . ' \'' . $path . '\' ' . mt('doc', 'is not readable')
|
mt('doc', sprintf('Documentation directory \'%s\' is not readable', $path))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$docIterator = new DocIterator($path);
|
$docIterator = new DocIterator($path);
|
||||||
if ($docIterator->count() === 0) {
|
if ($docIterator->count() === 0) {
|
||||||
throw new DocEmptyException(
|
throw new DocEmptyException(
|
||||||
mt('doc', 'Documentation directory') . ' \'' . $path . '\' '
|
mt(
|
||||||
. mt('doc', 'does not contain any non-empty Markdown file (\'.md\' suffix')
|
'doc',
|
||||||
|
sprintf(
|
||||||
|
'Documentation directory \'%s\' does not contain any non-empty Markdown file (\'.md\' suffix)',
|
||||||
|
$path
|
||||||
|
)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
|
@ -57,7 +57,7 @@ class DocTree extends Node
|
|||||||
}
|
}
|
||||||
if (! isset($this->nodes[$parentId])) {
|
if (! isset($this->nodes[$parentId])) {
|
||||||
throw new LogicException(
|
throw new LogicException(
|
||||||
sprintf('Can\'t add child node: there\'s no parent node having the id \'%s\'', $parentId)
|
mt('doc', sprintf('Can\'t add child node: there\'s no parent node having the id \'%s\'', $parentId))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->nodes[$childId] = $this->nodes[$parentId]->appendChild($child);
|
$this->nodes[$childId] = $this->nodes[$parentId]->appendChild($child);
|
||||||
|
@ -134,7 +134,7 @@ class SectionRenderer extends Renderer
|
|||||||
$filter = new SectionFilterIterator($docTree, $chapterId);
|
$filter = new SectionFilterIterator($docTree, $chapterId);
|
||||||
if ($filter->count() === 0) {
|
if ($filter->count() === 0) {
|
||||||
throw new ChapterNotFoundException(
|
throw new ChapterNotFoundException(
|
||||||
mt('doc', 'Chapter') . ' \'' . $chapterId . '\' ' . mt('doc', 'not found')
|
mt('doc', sprintf('Chapter \'%s\' not found', $chapterId))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user