protected function renderImage($filename, $orientation = self::RIGHT)
 {
     $parser = new Parser();
     $parser->setOutputType(OT_HTML);
     $parserOptions = new ParserOptions();
     $fakeTitle = new FakeTitle('');
     return $parser->parse($this->getWikiText($filename, $orientation), $fakeTitle, $parserOptions, false)->getText();
 }
 public static function parseText($text = "")
 {
     global $wgTitle;
     $tmpParser = new Parser();
     $tmpParser->setOutputType(OT_HTML);
     $tmpParserOptions = new ParserOptions();
     return $tmpParser->parse($text, $wgTitle, $tmpParserOptions)->getText();
 }
示例#3
0
 /**
  * easy parse of article text
  *
  * @author Tomasz Odrobny
  * @access private
  *
  */
 public static function parseArticle(&$qArticle, $text = null)
 {
     $articleText = $qArticle->getRawText();
     if ($text != null) {
         $articleText = $text;
     }
     $title = $qArticle->getTitle();
     $tmpParser = new Parser();
     $tmpParser->setOutputType(OT_HTML);
     $tmpParserOptions = new ParserOptions();
     $html = $tmpParser->parse($articleText, $title, $tmpParserOptions)->getText();
     return $html;
 }
示例#4
0
 /**
  *
  * Sort tickets in order that should be displayed on target page and prepare html
  * @param array $ticketsArray - array with
  */
 private function sortAndMakeTickets(array $ticketsArray)
 {
     //$addCommentClass = false ) {
     global $wgTitle;
     $fogbugzTicketsHtmlReady = array();
     $splitedResults = array();
     $res = array();
     $mainList = array();
     $index = -1;
     $isDone = false;
     while ($isDone == false && $index < count($ticketsArray)) {
         ++$index;
         for ($i = 0; $i < $index; $i++) {
             if (!empty($ticketsArray[$index]) && !($ticketsArray[$i]['ixBug'] != $ticketsArray[$index]['ixBugParent'])) {
                 $isDone = true;
             }
         }
     }
     // we have prepared list of cases from page (main cases that has been written as tags)
     for ($i = 0; $i < $index; $i++) {
         $mainList[] = new FogbugzContainer($ticketsArray[$i]);
         $mainList[$i]->addChildren($ticketsArray);
         $mainList[$i]->prioritySort();
         $mainList[$i]->prepareHtml($res, $i);
     }
     $tmpParser = new Parser();
     $tmpParser->setOutputType(OT_HTML);
     $tmpParserOptions = new ParserOptions();
     $parsedResults = array();
     //return $res;
     //TODO: create templating system
     for ($i = 0; $i < count($res); $i++) {
         $fullInfo = implode("", $res[$i]);
         $parsedResults[$i] = $tmpParser->parse($fullInfo, $wgTitle, $tmpParserOptions)->getText();
     }
     return $parsedResults;
 }