From 1eab561b403330d9473388aae3a3dcff9949498a Mon Sep 17 00:00:00 2001 From: rainydaysavings Date: Thu, 27 Aug 2020 03:25:44 +0100 Subject: [PATCH] [COMPONENT] Posting form now shows a random default string --- components/Posting/Posting.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/Posting/Posting.php b/components/Posting/Posting.php index 7d71be9bf0..7cefea771d 100644 --- a/components/Posting/Posting.php +++ b/components/Posting/Posting.php @@ -51,9 +51,15 @@ class Posting extends Module $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']; $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]], ['scope', ChoiceType::class, [ 'label' => 'To:',