コード例 #1
0
ファイル: demowiki.php プロジェクト: jackalope/jr_cr_demo
 public function viewAction($path)
 {
     $doc = $this->getSource($path);
     $document = new ezcDocumentConfluenceWiki();
     $document->options->errorReporting = E_PARSE | E_ERROR | E_WARNING;
     $document->loadString($doc);
     $docbook = $document->getAsDocbook();
     $converter = new ezcDocumentDocbookToHtmlConverter();
     $converter->options->styleSheet = null;
     // Add custom CSS style sheets
     $converter->options->styleSheets = array('/styles/screen.css');
     $html = $converter->convert($docbook);
     $xml = $html->save();
     $doc = new DOMDocument();
     $doc->loadXML($xml);
     $xp = new DOMXPath($doc);
     $xp->registerNamespace("xhtml", "http://www.w3.org/1999/xhtml");
     $res = $xp->query("/xhtml:html/xhtml:body/node()");
     $html = "";
     foreach ($res as $node) {
         $html .= $doc->saveXML($node);
     }
     $html .= '<div id="action"><a href="?action=edit" accesskey="e">Edit</a></div>';
     return $html;
 }
コード例 #2
0
ファイル: document_wiki_tests.php プロジェクト: bmdevel/ezc
 public function testWriteConfluenceDocument()
 {
     $docbook = new ezcDocumentDocbook();
     $docbook->loadFile(dirname(__FILE__) . '/files/wiki/confluence/s_002_inline_markup.xml');
     try {
         $wiki = new ezcDocumentConfluenceWiki();
         $wiki->createFromDocbook($docbook);
         $wiki->save();
         $this->fail('Expected ezcDocumentMissingVisitorException');
     } catch (ezcDocumentMissingVisitorException $e) {
         /* Expected */
     }
 }