private function buildChild(SiteDocIndexXmlItem $child) { $filepath = $this->httpRoot . $child->getLink(); if ($filepath[strlen($filepath) - 1] == '/') { $filepath .= 'index.html'; } if (!is_dir(dirname($filepath))) { mkdir(dirname($filepath), 0755, true); } $presentation = new UIViewPresentation('content'); $breadScrumbs = array(); // traverse over parents $_ = $child; while ($_ = $_->getParent()) { if ($_->getName()) { array_unshift($breadScrumbs, new ViewLink($_->getName(), $_->getLink())); } } $presentation->setModel(new Model(array('siteDoc' => $child->getDoc(), 'siteDocIndexItem' => $child, 'activeMenuItem' => $child->getSitePart(), 'breadScrumbs' => $breadScrumbs))); $presentation->setRouteTable(new PhoebiusRouter()); $page = new UIPage($presentation); $page->render(new FileWriteStream($filepath)); }
/** * Helper method that creates an action method result encapsulating presentation object * * @param string $viewName relative path to a view * @param array $data business logic resulting data to be passed to presentation * * @return ViewResult */ protected function view($viewName, array $data = array()) { $this->getModel()->append($data); $presentation = new UIViewPresentation($viewName); $presentation->setModel($this->getModel()); $presentation->setTrace($this->trace); return new ViewResult(new UIPage($presentation)); }
stop(); } $frameworkPath = realpath($argv[1]); if (!is_dir($frameworkPath)) { stop('Incorrect path to Phoebius directory'); } if (!is_file($frameworkPath . '/doc/ns/groups.xml')) { stop('Incorrect path to Phoebius directory (doc/ns/groups.xml not found at ' . $frameworkPath . ')'); } $rootDoxyGroup = XmlDoxyGroupBuilder::create($frameworkPath . '/doc/ns/groups.xml')->build(); $header = new TempFile(); DoxyHeaderWriter::create($rootDoxyGroup)->write($header); $doxyGen = new DoxyGen(PHOEBIUS_SITE_DOXYGEN_PARTS_PATH . '/doxygen.conf'); $htmlHeader = new TempFile(); $presentation = new UIViewPresentation('doxy/header'); $presentation->setModel(new Model(array('activeMenuItem' => 'Support', 'breadScrumbs' => array(new ViewLink('Support', '/support/'), new ViewLink('API', '/support/api/')), 'forDoxy' => true))); $presentation->setRouteTable(new PhoebiusRouter()); $page = new UIPage($presentation); $page->render($htmlHeader); $doxyGen->setHtmlHeader($htmlHeader->getPath()); $presentation = new UIViewPresentation('parts/footer'); $presentation->setRouteTable(new PhoebiusRouter()); $page = new UIPage($presentation); $htmlFooter = new TempFile(); $page->render($htmlFooter); $doxyGen->setHtmlFooter($htmlFooter->getPath()); $doxyGen->addInputPath(PHOEBIUS_SITE_DOXYGEN_PARTS_PATH . '/mainpage.php'); $doxyGen->addInputPath($header->getPath()); $doxyGen->addInputPath($frameworkPath . '/lib'); // $doxyGen->setOptions(array( // 'PROJECT_NUMBER' => PHOEBIUS_VERSION