diff --git a/main/announcements/announcements.php b/main/announcements/announcements.php index d78ad838dc..7388ccb382 100644 --- a/main/announcements/announcements.php +++ b/main/announcements/announcements.php @@ -1,4 +1,4 @@ -\n"; - echo "
\n"; + if (empty($_GET['id'])) + { + $form_name = get_lang('AddAnnouncement'); + } + else + { + $form_name = get_lang('EditAnnouncement'); + } + echo '
'.$form_name.'
'; - //this variable defines if the course administrator can send a message to a specific user / group - // or not - //echo "sessiewaarde: ".$_SESSION['select_groupusers']; - if (empty($_SESSION['toolgroup'])) { - echo "
"; - echo get_lang("SentTo").": "; - echo ""; + //this variable defines if the course administrator can send a message to a specific user / group or not + if(empty($_SESSION['toolgroup'])) + { + echo '
+
'. + Display::return_icon('group.gif', get_lang('ModifyRecipientList'), array ('align' => 'absmiddle')).''.get_lang('SentTo').' +
+
'; if(isset($_GET['id']) && is_array($to)){ echo ' '; - } elseif(isset($_GET['remind_inactive'])) { + } + elseif(isset($_GET['remind_inactive'])) + { $email_ann = '1'; $_SESSION['select_groupusers']="show"; $content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'),api_get_setting('siteName'), 7); $title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'),api_get_setting('siteName')); - } elseif(isset($_GET['remindallinactives']) && $_GET['remindallinactives']=='true') { + } + elseif(isset($_GET['remindallinactives']) && $_GET['remindallinactives']=='true') + { $since = isset($_GET['since']) ? intval($_GET['since']) : 6; $to = Tracking :: get_inactives_students_in_course($_course['id'],$since, $_SESSION['id_session']); - foreach($to as &$user) { + foreach($to as &$user) + { $user = 'USER:'.$user; } $_SESSION['select_groupusers']="show"; $email_ann = '1'; $content_to_modify = sprintf(get_lang('RemindInactiveLearnersMailContent'),api_get_setting('siteName'),$since); $title_to_modify = sprintf(get_lang('RemindInactiveLearnersMailSubject'),api_get_setting('siteName')); + /* //echo ' '; */ - } else { + } + else{ echo get_lang("Everybody"); } - echo "
"; - echo Display::return_icon('group.gif', get_lang('ModifyRecipientList'), array ('align' => 'absmiddle')).''.get_lang('ModifyRecipientList').''; - echo "
"; show_to_form($to); - echo "

"; - if (!isset($announcement_to_modify) ) - $announcement_to_modify =""; - if ($announcement_to_modify=='') { - ($email_ann=='1')?$checked='checked':$checked='checked'; - echo " ".get_lang('EmailOption')," : ", - "

"; - } - } else { - if (!isset($announcement_to_modify) ) - $announcement_to_modify =""; - if ($announcement_to_modify=='') { + echo ' + '; - ($email_ann=='1' || !empty($surveyid))?$checked='checked':$checked=''; - echo " ".get_lang('EmailOption')," : ".get_lang('MyGroup'), - "

"; - echo ''.get_lang('ModifyRecipientList').''; + if (!isset($announcement_to_modify) ) $announcement_to_modify =''; + if ($announcement_to_modify=='') + { + ($email_ann=='1')?$checked='checked':$checked=''; + echo '
+
+ +
+
'.get_lang('EmailOption').' +
+
'; + } + } + else + { + if (!isset($announcement_to_modify) ) $announcement_to_modify =""; + if ($announcement_to_modify=='') + { + ($email_ann=='1' || !empty($surveyid))?$checked='checked':$checked=''; + echo '
+
+ +
+
'. + get_lang('EmailOption').': '.get_lang('MyGroup').''.get_lang('ModifyRecipientList').''; show_to_form_group($_SESSION['toolgroup']); - - echo '

'; + echo '
+
'; } } - if ($surveyid) { - echo get_lang('EmailAddress').": (Comma separated for multiple)
"; - echo get_lang('OnlyThoseAddresses').":
"; + if($surveyid) + { + echo '
+
+ '.get_lang('EmailAddress').' +
+
+ (Comma separated for multiple) +
+
'; + echo '
+
+ '.get_lang('OnlyThoseAddresses').' +
+
+ +
+
'; } - echo ""; - echo " ".get_lang('EmailTitle').":
"; + + // the announcement title + echo '
+
+ * '.get_lang('EmailTitle').' +
+
+ +
+
'; + unset($title_to_modify); $title_to_modify = null; @@ -1125,8 +1175,8 @@ if ($display_form == true) { if (!isset($content_to_modify) ) $content_to_modify =""; if (!isset($title_to_modify)) $title_to_modify = ""; - echo "
\n"; - if ($surveyid) { + echo ''; + if($surveyid){ $content_to_modify='
'.get_lang('ClickHereToOpenSurvey').'
'.get_lang('OrCopyPasteUrl').'
'.api_get_path(WEB_CODE_PATH).'/survey/#page#?temp=#temp#&surveyid=#sid#&uid=#uid#&mail=#mail#&db_name=#db_name '; @@ -1135,35 +1185,32 @@ if ($display_form == true) { //api_disp_html_area('newContent',$content_to_modify,'250px'); require_once(api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php"); $oFCKeditor = new FCKeditor('newContent') ; + $oFCKeditor->Width = '100%'; $oFCKeditor->Height = '300'; - if (!api_is_allowed_to_edit()) { + if(!api_is_allowed_to_edit()) + { $oFCKeditor->ToolbarSet = "Announcements_Student"; - } else { + } + else + { $oFCKeditor->ToolbarSet = "Announcements"; } - if ($_GET['action']=='add') { - $class='add'; - $text=get_lang('SendAnnouncement'); - } elseif ($_GET['action']=='modify') { - $class='save'; - $text=get_lang('ModifyAnnouncement'); - } + $oFCKeditor->Value = $content_to_modify; - $oFCKeditor->Value = $content_to_modify; echo $oFCKeditor->CreateHtml(); + echo'
'; - if(empty($_SESSION['toolgroup'])) { + if(empty($_SESSION['toolgroup'])){ echo ''; - //echo '


'; - echo '


'; + echo '

'; - } else { + } + else{ echo ''; - //echo '


'; - echo '


'; + echo '

'; } echo '

'; @@ -1171,8 +1218,7 @@ if ($display_form == true) { if((isset($_GET['action']) && isset($_GET['id']) && is_array($to))||isset($_GET['remindallinactives'])||isset($_GET['remind_inactive'])){ echo ''; } -} -// displayform + } // displayform