private function getExtraDownloadLinks() { $downloadLinks = ''; if ($this->m_querystring === '') { return $downloadLinks; } $params = $this->m_params; $params = SMWQueryProcessor::getProcessedParams($params, $this->m_printouts); $query = SMWQueryProcessor::createQuery($this->m_querystring, $params, SMWQueryProcessor::SPECIAL_PAGE, '', $this->m_printouts); $link = QueryLinker::get($query); $link->setParameter('true', 'prettyprint'); $link->setParameter('true', 'unescape'); $link->setParameter('json', 'format'); $link->setCaption('JSON'); $downloadLinks .= $link->getHtml(); $link = QueryLinker::get($query); $link->setCaption('CSV'); $link->setParameter('csv', 'format'); $downloadLinks .= ' | ' . $link->getHtml(); $link = QueryLinker::get($query); $link->setCaption('RSS'); $link->setParameter('rss', 'format'); $downloadLinks .= ' | ' . $link->getHtml(); $link = QueryLinker::get($query); $link->setCaption('RDF'); $link->setParameter('rdf', 'format'); $downloadLinks .= ' | ' . $link->getHtml(); return '(' . $downloadLinks . ')'; }
public function testGet() { $query = $this->getMockBuilder('\\SMWQuery')->disableOriginalConstructor()->getMock(); $query->expects($this->once())->method('getExtraPrintouts')->will($this->returnValue(array())); $this->assertInstanceOf('SMWInfolink', QueryLinker::get($query)); }
/** * Create an SMWInfolink object representing a link to further query results. * This link can then be serialised or extended by further params first. * The optional $caption can be used to set the caption of the link (though this * can also be changed afterwards with SMWInfolink::setCaption()). If empty, the * message 'smw_iq_moreresults' is used as a caption. * * @deprecated since SMW 1.8 * * @param string|false $caption * * @return SMWInfolink */ public function getQueryLink($caption = false) { $link = QueryLinker::get($this->mQuery); $link->setCaption($caption); $link->setParameter($this->mQuery->getOffset() + count($this->mResults), 'offset'); return $link; }