Skip to content
Snippets Groups Projects
Commit b970e6b3 authored by Philipp Nowinski's avatar Philipp Nowinski
Browse files

[FEATURE] cleanup

parent 1110308d
No related branches found
No related tags found
1 merge request!6[FEATURE] add new optional FluidRenderer
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
......@@ -25,89 +25,13 @@ namespace SGalinski\DfTabs\View;
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use SGalinski\DfTabs\Domain\Model\Tab;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\SingletonInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
/**
* Renders the content
*/
class FluidView implements SingletonInterface {
/**
* @var array
*/
protected $pluginConfiguration = [];
/**
* Page Renderer Instance
*
* @var PageRenderer
*/
protected $pageRenderer;
/**
* @var ContentObjectRenderer
*/
protected $contentObject;
/**
* Internal plugin counter
*
* @var int
*/
protected $counter = 1;
/**
* Internal container that holds the used hashes
*
* @var array
*/
protected $usedHashes = [];
/**
* Injects the plugin configuration
*
* @param array $configuration
* @param string $tabId
* @return void
*/
public function injectPluginConfiguration(array $configuration, $tabId) {
$this->pluginConfiguration[$tabId] = $configuration;
$this->pluginConfiguration[$tabId]['counter'] = $this->counter;
if (\in_array($this->pluginConfiguration[$tabId]['hashName'], $this->usedHashes)) {
$this->pluginConfiguration[$tabId]['hashName'] = 'tab' . $this->counter . '-';
}
$this->usedHashes[] = $this->pluginConfiguration[$tabId]['hashName'];
++$this->counter;
}
/**
* Injects the page renderer
*
* @param PageRenderer $pageRenderer
* @return void
*/
public function injectPageRenderer($pageRenderer) {
$this->pageRenderer = $pageRenderer;
}
/**
* Injects the content object
*
* @param ContentObjectRenderer $contentObject
* @return void
*/
public function injectContentObject($contentObject) {
$this->contentObject = $contentObject;
}
/**
* Renders the tabs
......
<div class="default-content-element m-tabs" data-more-label="{f:translate(key: 'frontend.buttonLabelMore', extensionName: 'df_tabs')}">
<div class="m-tabs" data-more-label="{f:translate(key: 'frontend.buttonLabelMore', extensionName: 'df_tabs')}">
<div class="m-tabs__tablist" role="tablist">
<f:for each="{tabElements}" as="tab" iteration="iterator">
<button class="m-tabs__tab" role="tab" aria-controls="panel-{tab.record}-{iterator.index}" id="tab-{tab.record}-{iterator.index}" aria-selected="{f:if(condition: iterator.isFirst, then: 'true', else: 'false')}">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment