DynamicPageList3/includes/lister/InlineList.php

94 lines
1.4 KiB
PHP
Raw Normal View History

2020-11-22 20:03:02 +00:00
<?php
/**
* DynamicPageList3
* DPL InlineList Class
*
* @license GPL-2.0-or-later
* @package DynamicPageList3
*
2021-02-22 23:48:01 +00:00
*/
2020-11-22 20:03:02 +00:00
namespace DPL\Lister;
class InlineList extends Lister {
/**
* Listing style for this class.
*
2021-02-22 23:48:01 +00:00
* @var constant
2020-11-22 20:03:02 +00:00
*/
public $style = parent::LIST_INLINE;
/**
* Heading Start
*
2021-02-22 23:48:01 +00:00
* @var string
2020-11-22 20:03:02 +00:00
*/
public $headingStart = '';
/**
* Heading End
*
2021-02-22 23:48:01 +00:00
* @var string
2020-11-22 20:03:02 +00:00
*/
public $headingEnd = '';
/**
* List(Section) Start
*
2021-02-22 23:48:01 +00:00
* @var string
2020-11-22 20:03:02 +00:00
*/
public $listStart = '<div%s>';
/**
* List(Section) End
*
2021-02-22 23:48:01 +00:00
* @var string
2020-11-22 20:03:02 +00:00
*/
public $listEnd = '</div>';
/**
* Item Start
*
2021-02-22 23:48:01 +00:00
* @var string
2020-11-22 20:03:02 +00:00
*/
public $itemStart = '<span%s>';
/**
* Item End
*
2021-02-22 23:48:01 +00:00
* @var string
2020-11-22 20:03:02 +00:00
*/
public $itemEnd = '</span>';
/**
* Inline item text separator.
*
2021-02-22 23:48:01 +00:00
* @var string
2020-11-22 20:03:02 +00:00
*/
protected $textSeparator = '';
/**
* Main Constructor
*
* @access public
* @param object \DPL\Parameters
* @param object MediaWiki \Parser
* @return void
*/
2021-02-22 23:48:01 +00:00
public function __construct( \DPL\Parameters $parameters, \Parser $parser ) {
parent::__construct( $parameters, $parser );
$this->textSeparator = $parameters->getParameter( 'inlinetext' );
2020-11-22 20:03:02 +00:00
}
/**
* Join together items after being processed by formatItem().
*
* @access public
* @param array Items as formatted by formatItem().
* @return string Imploded items.
*/
2021-02-22 23:48:01 +00:00
protected function implodeItems( $items ) {
return implode( $this->textSeparator, $items );
2020-11-22 20:03:02 +00:00
}
}