Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion formats/widget/SRF_ListWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,27 @@ public function getName() {
protected function getResultText( QueryResult $res, $outputmode ) {
// Initialize
static $statNr = 0;
// $this->isHTML = true;

$this->hasTemplates = ( $this->params['template'] !== '' );
$listType = $this->params[ 'listtype' ] === 'ordered' || $this->params[ 'listtype' ] === 'ol' ? 'ol' : 'ul';

$builder = new ListResultBuilder( $res, $this->mLinker );

$builder->set( $this->params );

$builder->set( [
'format' => $listType,
'link-first' => $this->mLinkFirst,
'link-others' => $this->mLinkOthers,
'show-headers' => $this->mShowHeaders,
] );

// this does not work, it would be preferable
// to find a way to disable links when template is used
// if ( $this->hasTemplates ) {
// $builder->set( [ 'link' => 'none' ] );
// }

// Get results from \SMW\Query\ResultPrinters\ListResultPrinter
$result = $builder->getResultText();

Expand Down Expand Up @@ -127,6 +134,10 @@ public function getParamDefinitions( array $definitions ) {
'default' => 5,
];

$params['template'] = [
'message' => 'smw-paramdesc-template',
'default' => '',
];
return $params;
}
}