Skip to content

Commit

Permalink
Initial commit for 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
zonky2 committed Aug 21, 2024
1 parent 8c33c21 commit b9c8606
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions src/Resources/config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ services:
- '@event_dispatcher'
- '@cca.translator.contao_translator'
public: true
# For internal use only but has to be public as the widget can't use dependency injection :(
cca.dc-general.contao_frontend.filesystem:
alias: 'filesystem'
public: true
24 changes: 12 additions & 12 deletions src/Widgets/UploadOnSteroids.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class UploadOnSteroids extends FormUpload
protected $strPrefix = 'widget widget-upload widget-upload-on-steroids';

/**
* Image sizes as serialisized string.
* Image sizes as serialized string.
*
* @var string
*/
Expand Down Expand Up @@ -579,20 +579,20 @@ private function addFiles($sortBy): void
/**
* Translate.
*
* @param string $transId The message id (may also be an object that can be cast to string).
* @param array $parameters An array of parameters for the message.
* @param string|null $domain The domain for the message or null to use the default.
* @param string|null $locale The locale or null to use the default.
* @param string $strId The message id (may also be an object that can be cast to string).
* @param array $arrParams An array of parameters for the message.
* @param string $strDomain The domain for the message or null to use the default.
* @param string $locale The locale or null to use the default.
*
* @return string
*/
public function trans(
string $transId,
array $parameters = [],
?string $domain = 'contao_default',
?string $locale = null
$strId,
array $arrParams = [],
$strDomain = 'contao_default',
$locale = null
): string {
return $this->translator()->trans($transId, $parameters, $domain, $locale);
return $this->translator()->trans($strId, $arrParams, $strDomain, $locale);
}

/**
Expand Down Expand Up @@ -643,7 +643,7 @@ private function addIsMultiple(): void

private function getCurrentRequest(): ?Request
{
$requestStack = \Contao\System::getContainer()->get('request_stack');
$requestStack = System::getContainer()->get('request_stack');
if (!$requestStack instanceof RequestStack) {
return null;
}
Expand Down Expand Up @@ -674,7 +674,7 @@ private function filesModel(): Adapter
private function filesystem(): Filesystem
{
if (null === $this->filesystem) {
$filesystem = self::getContainer()->get('filesystem');
$filesystem = self::getContainer()->get('cca.dc-general.contao_frontend.filesystem');
assert($filesystem instanceof Filesystem);
$this->filesystem = $filesystem;
}
Expand Down

0 comments on commit b9c8606

Please sign in to comment.