mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-13 17:55:47 +00:00

- enhance plugin card ui - refactor components to be more consistent - invert toggler label for better UX - edit view components regex
38 lines
891 B
PHP
38 lines
891 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Plugins\Manifest;
|
|
|
|
/**
|
|
* @property 'text'|'email'|'url'|'markdown'|'number'|'switch' $type
|
|
* @property string $key
|
|
* @property string $label
|
|
* @property string $hint
|
|
* @property string $helper
|
|
* @property bool $optional
|
|
*/
|
|
class SettingsField extends ManifestObject
|
|
{
|
|
protected const VALIDATION_RULES = [
|
|
'type' => 'permit_empty|in_list[text,email,url,markdown,number,switch]',
|
|
'key' => 'required|alpha_dash',
|
|
'label' => 'required|string',
|
|
'hint' => 'permit_empty|string',
|
|
'helper' => 'permit_empty|string',
|
|
'optional' => 'permit_empty|is_boolean',
|
|
];
|
|
|
|
protected string $type = 'text';
|
|
|
|
protected string $key;
|
|
|
|
protected string $label;
|
|
|
|
protected string $hint = '';
|
|
|
|
protected string $helper = '';
|
|
|
|
protected bool $optional = false;
|
|
}
|