$anchor_topic = isset($_GET['anchor_topic']) ? Security::remove_XSS($_GET['anchor_topic']) : null;
$url = api_get_path(WEB_CODE_PATH) . 'social/group_topics.php?id=' . $group_id . '&anchor_topic=' . $anchor_topic . '&topics_page_nr=' . $page_topic . $param_item_page;
$form = new FormValidator('form', 'post', $url, null, array('enctype' => 'multipart/form-data'));
$form->addElement('hidden', 'action', $allowed_action);
$form->addElement('hidden', 'group_id', $group_id);
$form->addElement('hidden', 'parent_id', $message_id);
$form->addElement('hidden', 'message_id', $message_id);
$form->addElement('hidden', 'token', $tok);
$tpl = new Template(get_lang('Groups'));
if (api_get_setting('allow_message_tool') == 'true') {
    // Normal message
    $user_info = api_get_user_info($userfriend_id);
    $height = 180;
    if ($allowed_action == 'add_message_group') {
        $form->addElement('text', 'title', get_lang('Title'));
        $height = 140;
    }
    $config = ['ToolbarSet' => 'Messages'];
    $form->addHtmlEditor('content', get_lang('Message'), true, false, $config);
    $form->addElement('label', null, get_lang('AttachmentFiles'));
    $form->addElement('label', null, '<div id="link-more-attach">
        <a class="btn btn-default" href="javascript://" onclick="return add_image_form()">' . get_lang('AddOneMoreFile') . '</a>');
    $form->addElement('html', '<span id="filepaths"></span>');
    $form->addElement('file', 'attach_1', sprintf(get_lang('MaximunFileSizeX'), format_file_size(api_get_setting('message_max_upload_filesize'))));
    $form->addElement('html', '</div>');
    $form->addButtonSend(get_lang('SendMessage'));
    $form->setDefaults(['content' => $message, 'title' => $subject]);
    $form->display();
}
$tpl->display_blank_template();