mirror of
				https://github.com/Icinga/icingaweb2.git
				synced 2025-11-04 05:05:01 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			39 lines
		
	
	
		
			1017 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			1017 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
// {{{ICINGA_LICENSE_HEADER}}}
 | 
						|
// {{{ICINGA_LICENSE_HEADER}}}
 | 
						|
 | 
						|
namespace Icinga\Module\Doc;
 | 
						|
 | 
						|
use Icinga\Data\Tree\NodeRenderer;
 | 
						|
use Icinga\Web\Controller\ModuleActionController;
 | 
						|
 | 
						|
class DocController extends ModuleActionController
 | 
						|
{
 | 
						|
    /**
 | 
						|
     * Populate a chapter
 | 
						|
     *
 | 
						|
     * @param string $chapterName   Name of the chapter
 | 
						|
     * @param string $path          Path to the documentation
 | 
						|
     */
 | 
						|
    protected function populateChapter($chapterName, $path)
 | 
						|
    {
 | 
						|
        $parser = new DocParser($path);
 | 
						|
        $this->view->chapterHtml = $parser->getChapter($chapterName);
 | 
						|
        $this->view->toc = $parser->getToc();
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Populate toc
 | 
						|
     *
 | 
						|
     * @param string $path Path to the documentation
 | 
						|
     * @param string $name Name of the documentation
 | 
						|
     */
 | 
						|
    protected function populateToc($path, $name)
 | 
						|
    {
 | 
						|
        $parser = new DocParser($path);
 | 
						|
        $toc = $parser->getToc();
 | 
						|
        $this->view->tocRenderer = new NodeRenderer($toc);
 | 
						|
        $this->view->docName = $name;
 | 
						|
    }
 | 
						|
}
 |