Skip to content

Commit

Permalink
CS
Browse files Browse the repository at this point in the history
  • Loading branch information
dergel committed Jun 20, 2024
1 parent 11f5654 commit 087e57b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions plugins/manager/lib/yform/value/be_media.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ public function enterObject()
$this->setValue(implode(',', $medias));
}

static $counter = 0;
++$counter;

$types = $this->getElement('types') ?? '';
// to be in line with upload field
if ('*' == $types) {
Expand All @@ -38,10 +35,10 @@ public function enterObject()
if (!$this->isEditable()) {
$this->params['form_output'][$this->getId()] = $this->parse(
['value.view.tpl.php', 'value.be_media-view.tpl.php'],
['counter' => $counter, 'value' => explode(',', $this->getValue()), 'types' => $types],
['value' => explode(',', $this->getValue()), 'types' => $types],
);
} else {
$this->params['form_output'][$this->getId()] = $this->parse('value.be_media.tpl.php', compact('counter', 'types'));
$this->params['form_output'][$this->getId()] = $this->parse('value.be_media.tpl.php', compact('types'));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @psalm-scope-this rex_yform_value_be_media
*/

$counter ??= 1;
$counter ??= 1000;

$buttonId = $counter;
$name = $this->getFieldName();
Expand Down

0 comments on commit 087e57b

Please sign in to comment.