protected function getHtmlFormat($params)
 {
     $subject = new DIWikiPage($params['subject'], $params['ns'], $params['iw'], $params['subobject']);
     $htmlContentBuilder = new HtmlContentBuilder(ApplicationFactory::getInstance()->getStore(), $subject);
     $htmlContentBuilder->setOptionsFromJsonFormat($params['options']);
     return $htmlContentBuilder->getHtml();
 }
 public function testOptions()
 {
     $subject = DIWikiPage::newFromText('Foo');
     $instance = new HtmlContentBuilder($this->store, $subject);
     $options = array('Foo' => 42);
     $instance->setOptionsFromJsonFormat(json_encode($options));
     $instance->setOption('Bar', 1001);
     $this->assertEquals(42, $instance->getOption('Foo'));
     $this->assertEquals(1001, $instance->getOption('Bar'));
 }
예제 #3
0
 private function newHtmlContentBuilder($webRequest)
 {
     $htmlContentBuilder = new HtmlContentBuilder($this->applicationFactory->getStore(), $this->subjectDV->getDataItem());
     $htmlContentBuilder->setOption('dir', $webRequest->getVal('dir'));
     $htmlContentBuilder->setOption('printable', $webRequest->getVal('printable'));
     $htmlContentBuilder->setOption('offset', $webRequest->getVal('offset'));
     $htmlContentBuilder->setOption('showInverse', $this->applicationFactory->getSettings()->get('smwgBrowseShowInverse'));
     $htmlContentBuilder->setOption('showAll', $this->applicationFactory->getSettings()->get('smwgBrowseShowAll'));
     $htmlContentBuilder->setOption('byApi', $this->applicationFactory->getSettings()->get('smwgBrowseByApi'));
     return $htmlContentBuilder;
 }