Skip to content

Commit

Permalink
Add default icon and trigger (repeater) to Block
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrckvzn authored and ifox committed Apr 25, 2021
1 parent 369448b commit ae162ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
'fields' => [
'block-editor' => [
'add-content' => 'Add content',
'add-item' => 'Add item',
'collapse-all' => 'Collapse all',
'create-another' => 'Create another',
'delete' => 'Delete',
Expand Down
4 changes: 2 additions & 2 deletions src/Services/Blocks/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ public function parse()
$contents = file_get_contents((string) $this->file->getPathName());

$this->title = $this->parseProperty('title', $contents, $this->name);
$this->trigger = $this->parseProperty('trigger', $contents, $this->name);
$this->trigger = $this->parseProperty('trigger', $contents, $this->name, $this->type === self::TYPE_REPEATER ? twillTrans('twill::lang.fields.block-editor.add-item') : null);
$this->max = (int) $this->parseProperty('max', $contents, $this->name, 999);
$this->group = $this->parseProperty('group', $contents, $this->name, 'app');
$this->icon = $this->parseProperty('icon', $contents, $this->name);
$this->icon = $this->parseProperty('icon', $contents, $this->name, 'text');
$this->compiled = (boolean) $this->parseProperty('compiled', $contents, $this->name, false);
$this->component = $this->parseProperty('component', $contents, $this->name, "a17-block-{$this->name}");
$this->isNewFormat = $this->isNewFormat($contents);
Expand Down

0 comments on commit ae162ac

Please sign in to comment.