Zeige formatierte Texte überall als Klartext, wo kein HTML hingehört
Öffentliche Leser, Shop, Medienliste und Bibliothek lesen Kurzbeschreibung, Beschreibung und Lernziel als Klartext; Mitgliederseiten zu Programm, Inhalt und Artikel zeigen die formatierte Fassung. Der Editor trägt die deutsche Bezeichnung des Felds als Namen für Hilfstechnik, der Tastaturfokus landet im Editor, und der Abgleich merkt sich nur eine Prüfsumme. ADR-50 nennt Rückfall und Suche. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9fbd933e1e
commit
99122ddfee
14 files changed
+85
-33
No files matched your search
@@ -12,10 +12,11 @@
|
||||
final class RichField
|
||||
{
|
||||
/**
|
||||
* @param ?string $label Mit Bezeichnung für Formulare und Dialoge; ohne bleibt sie dem Arbeitsplatz überlassen
|
||||
* @param ?string $label Bezeichnung des Felds; sie ist auch der Name für Hilfstechnik
|
||||
* @param bool $live Arbeitsplätze gleichen beim Verlassen des Felds ab ({@see ManagesRichFields}); Dialoge nicht
|
||||
* @param bool $hideLabel Die Bezeichnung zeigt der Arbeitsplatz selbst
|
||||
*/
|
||||
public static function make(string $name, ?string $label = null, bool $live = true): RichEditor
|
||||
public static function make(string $name, ?string $label = null, bool $live = true, bool $hideLabel = false): RichEditor
|
||||
{
|
||||
$field = RichEditor::make($name)->toolbarButtons(FormattedText::TOOLBAR);
|
||||
|
||||
@@ -23,6 +24,10 @@ public static function make(string $name, ?string $label = null, bool $live = tr
|
||||
$field->live(onBlur: true);
|
||||
}
|
||||
|
||||
return $label === null ? $field->hiddenLabel() : $field->label($label);
|
||||
if ($label !== null) {
|
||||
$field->label($label);
|
||||
}
|
||||
|
||||
return $label === null || $hideLabel ? $field->hiddenLabel() : $field;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user