mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 21:49:04 +01:00
Use dynamic field values
This commit is contained in:
parent
937954b01c
commit
10cfd66fad
@ -35,7 +35,7 @@ class UserCollection extends AbstractCollection
|
||||
/**
|
||||
* Get all available roles
|
||||
*/
|
||||
public static function availableRoles(): array
|
||||
public function availableRoles(): array
|
||||
{
|
||||
$roles = [];
|
||||
foreach (static::$roles as $role => $data) {
|
||||
|
@ -32,15 +32,13 @@ fields:
|
||||
label: '{{panel.user.language}}'
|
||||
required: true
|
||||
translate: [label]
|
||||
import:
|
||||
options: 'Formwork\Panel\Panel::availableTranslations'
|
||||
options@: formwork.panel().availableTranslations()
|
||||
|
||||
role:
|
||||
type: select
|
||||
label: '{{panel.user.role}}'
|
||||
disabled: true
|
||||
import:
|
||||
options: 'Formwork\Panel\Users\UserCollection::availableRoles'
|
||||
options@: formwork.panel().users().availableRoles()
|
||||
|
||||
|
||||
colorScheme:
|
||||
|
@ -42,20 +42,17 @@ fields:
|
||||
date.format:
|
||||
type: select
|
||||
label: '{{panel.options.system.dateAndTime.dateFormat}}'
|
||||
import:
|
||||
options: 'Formwork\Panel\Utils\DateFormats::date'
|
||||
options@: dateFormats.date
|
||||
|
||||
date.timeFormat:
|
||||
type: select
|
||||
label: '{{panel.options.system.dateAndTime.hourFormat}}'
|
||||
import:
|
||||
options: 'Formwork\Panel\Utils\DateFormats::hour'
|
||||
options@: dateFormats.hour
|
||||
|
||||
date.timezone:
|
||||
type: select
|
||||
label: '{{panel.options.system.dateAndTime.timezone}}'
|
||||
import:
|
||||
options: 'Formwork\Panel\Utils\DateFormats::timezones'
|
||||
options@: dateFormats.timezones
|
||||
|
||||
date.weekStarts:
|
||||
type: select
|
||||
@ -70,8 +67,7 @@ fields:
|
||||
placeholder: '{{panel.options.system.languages.availableLanguages.noLanguages}}'
|
||||
pattern: '^[a-z]{2,3}$'
|
||||
translate: [label, placeholder]
|
||||
import:
|
||||
options: 'Formwork\Languages\LanguageCodes::names'
|
||||
options@: languages.names
|
||||
|
||||
languages.httpPreferred:
|
||||
type: togglegroup
|
||||
@ -106,8 +102,7 @@ fields:
|
||||
type: select
|
||||
label: '{{panel.options.system.adminPanel.defaultLanguage}}'
|
||||
translate: [label]
|
||||
import:
|
||||
options: 'Formwork\Panel\Panel::availableTranslations'
|
||||
options@: formwork.panel().availableTranslations()
|
||||
|
||||
panel.logoutRedirect:
|
||||
type: togglegroup
|
||||
|
Loading…
x
Reference in New Issue
Block a user