$form->addElement('checkbox', 'email_ann', null, get_lang('EmailOption')); } $announcementInfo = AnnouncementManager::get_by_id($course_id, $id); if (isset($announcementInfo) && !empty($announcementInfo)) { $to = AnnouncementManager::load_edit_users("announcement", $id); $defaults = array('title' => $announcementInfo['title'], 'content' => $announcementInfo['content'], 'id' => $announcementInfo['id'], 'users' => $to); } else { $defaults = array(); if (!empty($to)) { $defaults['users'] = $to; } } $form->addElement('text', 'title', get_lang('EmailTitle')); $form->addElement('hidden', 'id'); $htmlTags = "<b>" . get_lang('Tags') . "</b><br /><br />"; $tags = AnnouncementManager::get_tags(); foreach ($tags as $tag) { $htmlTags .= "<b>" . $tag . "</b><br />"; } $form->addLabel(null, "<div class='alert alert-info'>" . $htmlTags . "</div>"); $form->addHtmlEditor('content', get_lang('Description'), false, false, array('ToolbarSet' => 'Announcements')); $form->addElement('file', 'user_upload', get_lang('AddAnAttachment')); $form->addElement('textarea', 'file_comment', get_lang('FileComment')); $form->addElement('hidden', 'sec_token', $stok); if (empty($sessionId)) { $form->addCheckBox('send_to_users_in_session', null, get_lang('SendToUsersInSessions')); } $form->addCheckBox('send_to_hrm_users', null, get_lang('SendAnnouncementCopyToDRH')); $form->addButtonSave(get_lang('ButtonPublishAnnouncement')); $form->setDefaults($defaults); if ($form->validate()) {
} if (!isset($title_to_modify)) { $title_to_modify = ""; } echo '<input type="hidden" name="id" value="' . $announcement_to_modify . '" />'; $oFCKeditor = new FCKeditor('newContent'); $oFCKeditor->Width = '100%'; $oFCKeditor->Height = '300'; if (!api_is_allowed_to_edit()) { $oFCKeditor->ToolbarSet = "AnnouncementsStudent"; } else { $oFCKeditor->ToolbarSet = "Announcements"; } $oFCKeditor->Value = $content_to_modify; echo '<div class="row"><div class="formw">'; echo Display::display_normal_message(get_lang('Tags') . ' <br /><br />' . implode('<br />', AnnouncementManager::get_tags()), false); echo $oFCKeditor->CreateHtml(); echo '</div></div>'; //File attachment echo ' <div class="control-group"> <div class="controls"> <a href="javascript://" onclick="return plus_attachment();"><span id="plus"><img style="vertical-align:middle;" src="../img/div_show.gif" alt="" /> ' . get_lang('AddAnAttachment') . '</span></a> <br /> <table id="options" style="display: none;"> <tr> <td colspan="2"> <label for="file_name">' . get_lang('FileName') . ' </label> <input type="file" name="user_upload"/> </td> </tr> <tr>