[svn r19702] form titles

form consistency
style improvement
skala
Patrick Cool 16 years ago
parent 73d17d023e
commit b5c41793bc
  1. 168
      main/announcements/announcements.php

@ -1,4 +1,4 @@
<?php //$Id: announcements.php 19694 2009-04-09 21:45:33Z ivantcholakov $
<?php //$Id: announcements.php 19702 2009-04-10 11:39:21Z pcool $
/*
==============================================================================
Dokeos - elearning and course management software
@ -1028,7 +1028,7 @@ if (empty($_GET['origin']) or $_GET['origin'] !== 'learnpath')
if (isset($message) && $message == true)
{
Display::display_normal_message($message);
Display::display_confirmation_message($message);
$display_announcement_list = true;
$display_form = false;
}
@ -1044,79 +1044,129 @@ if(!empty($error_message))
==================================================================================*/
if ($display_form == true) {
if ($display_form == true)
{
$content_to_modify=stripslashes($content_to_modify);
$title_to_modify=stripslashes($title_to_modify);
// DISPLAY ADD ANNOUNCEMENT COMMAND
echo "<form method=\"post\" name=\"f1\" action=\"".api_get_self()."?publish_survey=$surveyid&id=".$_GET['id']."&db_name=$db_name&cidReq=".$_GET['cidReq']."&action=".$_GET['action']."\" style=\"margin:0px;\">\n";
echo "<form method=\"post\" name=\"f1\" action=\"".api_get_self()."?publish_survey=$surveyid&id=".$_GET['id']."&db_name=$db_name&cidReq=".$_GET['cidReq']."&action=".$_GET['action']."\" style=\"margin:0px;\">\n";
if (empty($_GET['id']))
{
$form_name = get_lang('AddAnnouncement');
}
else
{
$form_name = get_lang('EditAnnouncement');
}
echo '<div class="row"><div class="form_header">'.$form_name.'</div></div>';
//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 "<table><tr><td>";
echo get_lang("SentTo").": ";
echo "</td><td>";
//this variable defines if the course administrator can send a message to a specific user / group or not
if(empty($_SESSION['toolgroup']))
{
echo ' <div class="row">
<div class="label">'.
Display::return_icon('group.gif', get_lang('ModifyRecipientList'), array ('align' => 'absmiddle')).'<a href="#" onclick="if(document.getElementById(\'recipient_list\').style.display==\'none\') document.getElementById(\'recipient_list\').style.display=\'block\'; else document.getElementById(\'recipient_list\').style.display=\'none\';">'.get_lang('SentTo').'</a>
</div>
<div class="formw">';
if(isset($_GET['id']) && is_array($to)){
echo '&nbsp;';
} 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 '&nbsp;<script type="text/javascript">document.onload = "document.getElementById(\'recipient_list\').style.display=\'block\'";</script>';
*/
} else {
}
else{
echo get_lang("Everybody");
}
echo "</td><td>";
echo Display::return_icon('group.gif', get_lang('ModifyRecipientList'), array ('align' => 'absmiddle')).'<a href="#" onclick="if(document.getElementById(\'recipient_list\').style.display==\'none\') document.getElementById(\'recipient_list\').style.display=\'block\'; else document.getElementById(\'recipient_list\').style.display=\'none\';">'.get_lang('ModifyRecipientList').'</span>';
echo "</td></tr></table>";
show_to_form($to);
echo "<br /><br />";
if (!isset($announcement_to_modify) )
$announcement_to_modify ="";
if ($announcement_to_modify=='') {
($email_ann=='1')?$checked='checked':$checked='checked';
echo "<input class=\"checkbox\" type=checkbox value=\"1\" name=\"email_ann\" $checked> ".get_lang('EmailOption')," : ",
"<br /><br />";
}
} else {
if (!isset($announcement_to_modify) )
$announcement_to_modify ="";
if ($announcement_to_modify=='') {
echo ' </div>
</div>';
($email_ann=='1' || !empty($surveyid))?$checked='checked':$checked='';
echo "<input class=\"checkbox\" type=checkbox value=\"1\" name=\"email_ann\" $checked> ".get_lang('EmailOption')," : ".get_lang('MyGroup'),
"<br><br>";
echo '<a href="#" onclick="if(document.getElementById(\'recipient_list\').style.display==\'none\') document.getElementById(\'recipient_list\').style.display=\'block\'; else document.getElementById(\'recipient_list\').style.display=\'none\';">'.get_lang('ModifyRecipientList').'</a>';
if (!isset($announcement_to_modify) ) $announcement_to_modify ='';
if ($announcement_to_modify=='')
{
($email_ann=='1')?$checked='checked':$checked='';
echo ' <div class="row">
<div class="label">
<input class="checkbox" type="checkbox" value="1" name="email_ann" '.$checked.'>
</div>
<div class="formw">'.get_lang('EmailOption').'
</div>
</div>';
}
}
else
{
if (!isset($announcement_to_modify) ) $announcement_to_modify ="";
if ($announcement_to_modify=='')
{
($email_ann=='1' || !empty($surveyid))?$checked='checked':$checked='';
echo ' <div class="row">
<div class="label">
<input class="checkbox" type="checkbox" value="1" name="email_ann" '.$checked.'>
</div>
<div class="formw">'.
get_lang('EmailOption').': '.get_lang('MyGroup').'<a href="#" onclick="if(document.getElementById(\'recipient_list\').style.display==\'none\') document.getElementById(\'recipient_list\').style.display=\'block\'; else document.getElementById(\'recipient_list\').style.display=\'none\';">'.get_lang('ModifyRecipientList').'</a>';
show_to_form_group($_SESSION['toolgroup']);
echo '<br><br>';
echo ' </div>
</div>';
}
}
if ($surveyid) {
echo get_lang('EmailAddress').": <input type=\"text\" name=\"emailsAdd\" value=\"".$emails_add."\" size=\"52\">(Comma separated for multiple)<br>";
echo get_lang('OnlyThoseAddresses').": <input type=\"checkbox\" name=\"onlyThoseMails\"><br>";
if($surveyid)
{
echo ' <div class="row">
<div class="label">
'.get_lang('EmailAddress').'
</div>
<div class="formw">
<input type="text" name="emailsAdd" value="'.$emails_add.'" size="52">(Comma separated for multiple)
</div>
</div>';
echo ' <div class="row">
<div class="label">
'.get_lang('OnlyThoseAddresses').'
</div>
<div class="formw">
<input type="checkbox" name="onlyThoseMails">
</div>
</div>';
}
echo "<div id='msg_error' style='display:none;color:red'></div>";
echo "<label style='color:red;font-size:14pt'>*</label>&nbsp;".get_lang('EmailTitle').": <input type=\"text\" id=\"emailTitle\" name=\"emailTitle\" value=\"".$title_to_modify."\" size=\"52\" onfocus=\"document.getElementById('msg_error').style.display='none';\"><br />";
// the announcement title
echo ' <div class="row">
<div class="label">
<span class="form_required">*</span> '.get_lang('EmailTitle').'
</div>
<div class="formw">
<input type="text" id="emailTitle" name="emailTitle" value="'.$title_to_modify.'">
</div>
</div>';
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 "<br />\n<input type=\"hidden\" name=\"id\" value=\"".$announcement_to_modify."\">";
if ($surveyid) {
echo '<input type="hidden" name="id" value="'.$announcement_to_modify.'" />';
if($surveyid){
$content_to_modify='<br /><a href="'.api_get_path(WEB_CODE_PATH).'/survey/#page#?temp=#temp#&surveyid=#sid#&uid=#uid#&mail=#mail#&db_name=#db_name">'.get_lang('ClickHereToOpenSurvey').'</a><br />
'.get_lang('OrCopyPasteUrl').' <br />
'.api_get_path(WEB_CODE_PATH).'/survey/#page#?temp=#temp#&surveyid=#sid#&uid=#uid#&mail=#mail#&db_name=#db_name&nbsp;';
@ -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'<br />';
if(empty($_SESSION['toolgroup'])) {
if(empty($_SESSION['toolgroup'])){
echo '<input type="hidden" name="submitAnnouncement" value="OK">';
//echo '<br /><input type="button" value="'.' '.get_lang('Send').' '.'" onclick="selectAll(this.form.elements[3],true)" /><br /><br />';
echo '<br /><button class="'.$class.'"type="submit" value="'.' '.get_lang('Send').' '.'" onclick="selectAll(this.form.elements[3],true)" >'.$text.'</button><br /><br />';
echo '<button class="save"type="submit" value="'.' '.get_lang('Send').' '.'" onclick="selectAll(this.form.elements[3],true)" >'.get_lang('Send').'</button><br /><br />';
} else {
}
else{
echo '<input type="hidden" name="submitAnnouncement" value="OK">';
//echo '<br /><input type="button" value="'.' '.get_lang('Send').' '.'" onclick="selectAll(this.form.elements[4],true)" /><br /><br />';
echo '<br /><button class="'.$class.'"type="submit" value="'.' '.get_lang('Send').' '.'" onclick="selectAll(this.form.elements[4],true)" >'.$text.'</button><br /><br />';
echo '<button class="save"type="submit" value="'.' '.get_lang('Send').' '.'" onclick="selectAll(this.form.elements[4],true)" >'.get_lang('Send').'</button><br /><br />';
}
echo '</form><br />';
@ -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 '<script>document.getElementById(\'recipient_list\').style.display=\'block\';</script>';
}
}
// displayform
} // displayform

Loading…
Cancel
Save