/** */ protected function write_toc() { $toc_dom = XML::Builder(); $modules_dom = $toc_dom->begin_html()->begin_head()->title('Library Documentation')->link(array('rel' => 'stylesheet', 'type' => 'text/css', 'href' => 'style.css'))->end->begin_body()->begin_ul(array('class' => 'modules')); ksort($this->toc); foreach ($this->toc as $module_name => $module) { $module_dom = $modules_dom->begin_li()->a(array($module_name, 'href' => $module['href'], 'target' => 'content')); if ($module['interfaces'] != null) { $interfaces_dom = $module_dom->begin_ul(array('class' => 'interfaces')); ksort($module['interfaces']); foreach ($module['interfaces'] as $interface_name => $interface_ref) { $interfaces_dom->begin_li()->a(array($interface_name, 'href' => $interface_ref, 'target' => 'content')); } } $classes_dom = $module_dom->begin_ul(array('class' => 'classes')); ksort($module['classes']); foreach ($module['classes'] as $class_name => $class_ref) { $classes_dom->begin_li()->a(array($class_name, 'href' => $class_ref, 'target' => 'content')); } } IO_FS::File($this->path_to_html . "/toc.html")->open('w+')->write($toc_dom->document->saveHTML())->close(); }
/** * Конструктор * * @param string $name */ public function __construct($name) { $this->xml = XML::Builder(); parent::__construct($name); }