Skip to content

Commit

Permalink
fix typo3 v9 compatibility; localisation initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten Walther committed Jun 15, 2020
1 parent 2abd356 commit a84c4aa
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 90 deletions.
31 changes: 9 additions & 22 deletions Classes/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException;

/**
Expand Down Expand Up @@ -33,28 +34,14 @@ class Configuration
*
* @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
*/
public function __construct(LanguageService $languageService = NULL)
{
self::$languageService = $languageService;
if (self::$languageService) {
self::$languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}
}

/**
* @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
*
* @return void
*/
public function injectLanguageService(LanguageService $languageService) : void
{
if (!self::$languageService) {
self::$languageService = $languageService;
if (self::$languageService) {
self::$languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}
}
}
public function __construct(LanguageService $languageService = NULL)
{
self::$languageService = $languageService;
if (!self::$languageService) {
self::$languageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class);
}
self::$languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}

/**
* set
Expand Down
32 changes: 8 additions & 24 deletions Classes/Controller/Html2pdfController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,15 @@ class Html2pdfController

/**
* Html2pdfController constructor.
*
* @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
*/
public function __construct(LanguageService $languageService = NULL)
{
$this->languageService = $languageService;
if ($this->languageService) {
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}
}

/**
* @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
*
* @return void
*/
public function injectLanguageService(LanguageService $languageService) : void
{
if (!$this->languageService) {
$this->languageService = $languageService;
if ($this->languageService) {
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}
}
}
public function __construct(LanguageService $languageService = NULL)
{
$this->languageService = $languageService;
if (!$this->languageService) {
$this->languageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class);
}
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}

/**
* hookOutput
Expand Down
32 changes: 10 additions & 22 deletions Classes/Converter/Converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
use Psr\Log\LoggerAwareTrait;
use RuntimeException;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\DebuggerUtility;
use TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException;
use Walther\Html2pdf\Configuration\Configuration;

Expand All @@ -30,28 +32,14 @@ class Converter implements LoggerAwareInterface
*
* @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
*/
public function __construct(LanguageService $languageService = NULL)
{
$this->languageService = $languageService;
if ($this->languageService) {
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}
}

/**
* @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
*
* @return void
*/
public function injectLanguageService(LanguageService $languageService) : void
{
if (!$this->languageService) {
$this->languageService = $languageService;
if ($this->languageService) {
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}
}
}
public function __construct(LanguageService $languageService = NULL)
{
$this->languageService = $languageService;
if (!$this->languageService) {
$this->languageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class);
}
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}

/**
* convert
Expand Down
30 changes: 8 additions & 22 deletions Classes/Report/ExtensionStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,14 @@ class ExtensionStatus implements StatusProviderInterface
*
* @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
*/
public function __construct(LanguageService $languageService = NULL)
{
$this->languageService = $languageService;
if ($this->languageService) {
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}
}

/**
* @param \TYPO3\CMS\Core\Localization\LanguageService $languageService
*
* @return void
*/
public function injectLanguageService(LanguageService $languageService) : void
{
if (!$this->languageService) {
$this->languageService = $languageService;
if ($this->languageService) {
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}
}
}
public function __construct(LanguageService $languageService = NULL)
{
$this->languageService = $languageService;
if (!$this->languageService) {
$this->languageService = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\LanguageService::class);
}
$this->languageService->includeLLFile('EXT:html2pdf/Resources/Private/Language/locallang.xlf');
}

/**
* getStatus
Expand Down

0 comments on commit a84c4aa

Please sign in to comment.