[COMPONENT] Posting form now shows a random default string

This commit is contained in:
rainydaysavings 2020-08-27 03:25:44 +01:00 committed by Hugo Sales
parent 315a70ba0d
commit 1eab561b40
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -51,9 +51,15 @@ class Posting extends Module
$to_options[$t] = $t; $to_options[$t] = $t;
} }
$empty_string = ['how are you feeling?...', 'Something to share?...', 'How was your day?...'];
$rand_keys = array_rand($empty_string, 1);
$request = $vars['request']; $request = $vars['request'];
$form = Form::create([ $form = Form::create([
['content', TextareaType::class, ['label' => ' ']], ['content', TextareaType::class, [
'label' => ' ',
'data' => $empty_string[$rand_keys],
]],
['attachments', FileType::class, ['label' => _m(' '), 'multiple' => true, 'required' => false]], ['attachments', FileType::class, ['label' => _m(' '), 'multiple' => true, 'required' => false]],
['scope', ChoiceType::class, [ ['scope', ChoiceType::class, [
'label' => 'To:', 'label' => 'To:',