<?cs include:"util.cs" ?>

<?cs ### 
     ### If we're we're not doing a printer friendly version, 
     ##    print rows of command buttons along the top
## ?>

<?cs def:print_commands() ?>
<?cs with:lang=lang.news_read ?>
<?cs if:!printer_friendly ?>
<table width="100%">
<tr><td align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td rowspan="2" align="center"><a href="<?cs var:back_button_url ?>" title="<?cs var:lang.back_button_title ?>"><img src="<?cs var:image_path ?>back_arrow.gif" width="50" height="34" alt="<?cs var:lang.back_button_title ?>" /></a></td>
<td><a href="<?cs var:main_menu_url ?>" title="<?cs var:lang.main_menu_title ?>"><img src="<?cs var:image_path ?>main_menu_sm.gif" alt="<?cs var:lang.main_menu_title ?>" width="135" height="17" /></a></td>
<td><a href="<?cs var:news_topic_url ?>" title="<?cs var:lang.assign_goto_index_title ?>"><img src="<?cs var:image_path ?>index_sm.gif" alt="<?cs var:lang.assign_goto_index_title ?>" /></a></td>
<td><?cs if:reply_url ?><a href="<?cs var:reply_url ?>" title="<?cs var:lang.reply_title ?>"><img src="<?cs var:image_path ?>reply_sm.gif" alt="<?cs var:lang.reply_title ?>" width="135" height="17" /></a><?cs elif:can_write ?><img src="<?cs var:image_path ?>gr_reply_sm.gif" alt="" width="135" height="17"/><?cs else ?><img src="<?cs var:image_path ?>reply_sm.gif" alt="<?cs var:lang.command_disabled ?>" title="<?cs var:lang.command_disabled ?>" width="135" height="17" /><?cs /if ?></td>
<td><a href="assign_read?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?><?cs if:student_username ?>&amp;student=<?cs var:student_username ?><?cs /if ?><?cs if:fixed_font ?>&amp;fixed=1<?cs /if ?>&amp;print=1" title="<?cs var:lang.print_title ?>" onclick="newwin=window.open('assign_read?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?><?cs if:student_username ?>&amp;student=<?cs var:student_username ?><?cs /if ?><?cs if:fixed_font ?>&amp;fixed=1<?cs /if ?>&amp;print=1','print','menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=760,height=500'); newwin.focus(); return false"><img src="<?cs var:image_path ?>print_sm.gif" width="135" height="17" alt="<?cs var:lang.print_title ?>" /></a></td>
</tr>
<tr>
<td><?cs if:prev_msg_url ?><a href="<?cs var:prev_msg_url ?>" title="<?cs var:lang.prev_msg_title ?>"><img src="<?cs var:image_path ?>previous_sm.gif" width="135" height="17" alt="<?cs var:lang.prev_msg_title ?>" /></a><?cs else ?><img src="<?cs var:image_path ?>gr_previous_sm.gif" width="135" height="17" alt="" /><?cs /if ?></td>
<td><?cs if:next_msg_url ?><a href="<?cs var:next_msg_url ?>" title="<?cs var:lang.next_msg_title ?>"><img src="<?cs var:image_path ?>next_sm.gif"  alt="<?cs var:next_msg_title ?>" width="135" height="17" /></a><?cs else ?><img src="<?cs var:image_path ?>gr_next_sm.gif"  alt="" width="135" height="17" /><?cs /if ?></td>
<td><a href="<?cs var:info_url ?>" title="<?cs var:lang.info_title ?>"><img src="<?cs var:image_path ?>info_sm.gif" alt="<?cs var:lang.info_title ?>" /></a></td>
<td><img src="<?cs var:image_path ?>blank_sm.gif" width="135" height="17" alt="" /></td>
</tr>
</table>
</td></tr>
</table>
<?cs /if ?>
<?cs /with ?>
<?cs /def ?>




<?cs def:print_msg_warning(warning) ?>
  <td style="width:18em"><table border="0" ><tr><td valign="middle"><img src="<?cs var:image_path ?>warn.gif" alt=" " /></td><td><span style="color:red" ><?cs var:warning ?></span></td></tr></table></td>
<?cs /def ?>




<?cs def:print_release_button() ?>
<?cs with:lang=lang.news_read ?>
  <div class="center_msg">
   <div class="error"><?cs var:lang.release_instructions ?></div>
   <form method="post" action="hotpot_exam_release">
    <div>
        <input type="hidden" name="crs" value="<?cs var:crs ?>" />
        <input type="hidden" name="id" value="<?cs var:key ?>" />
        <input type="hidden" name="from" value="<?cs var:from ?>" />
        <input type="hidden" name="loc" value="<?cs var:msg.offset ?>" />
        <input type="submit" value="<?cs var:lang.release_button ?>" title="<?cs var:lang.release_button_title ?>" />
    </div>
   </form>
  </div> 
<?cs /with ?>
<?cs /def ?>

<?cs def:flag_image() ?><img src="<?cs var:image_path ?><?cs if:flagged ?>flag.gif" alt="<?cs var:lang.news_read.flag_title ?>" width="14" height="14"  /><?cs else ?>noflag.gif" alt="<?cs var:lang.news_read.noflag_title ?>" width="14" height="14" /><?cs /if ?><?cs /def ?>


<?cs def:print_flag() ?><a href="<?cs var:flag_url ?>" title="<?cs var:lang.news_read.flag_link_title ?>" ><?cs call:flag_image() ?></a><?cs /def ?>



<?cs def:print_message_header() ?>
<fieldset style="width:70%" >
<legend class="fieldset_legend">
 <?cs var:course_no ?> <?cs var:lang.news_read.module[grp] ?>
</legend>
<table border="0" width="100%">
<tr><td class="message_header">
<b><?cs var:lang.news_read.posted_by_label ?></b> <?cs if:user[0].url && !printer_friendly ?><a href="<?cs var:user[0].url ?>" title="<?cs var:lang.news_read.read_bio_title ?>"  onclick="newwin=window.open('<?cs var:user[0].url ?>','bio','menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes,width=760,height=500'); newwin.focus(); return false"><?cs /if ?><?cs var:msg.sender_realname ?><?cs if:user[0].url ?></a><?cs /if ?><br />
<b><?cs var:lang.news_read.posted_date_label ?></b> <?cs var:msg.time_sent ?>  

<?cs if:msg.assign_open_time ?>
<br /><br />
<b><?cs var:lang.news_read.additional_teacher_info_label ?></b><br />
&nbsp;&nbsp;<u><?cs var:lang.news_read.assignment_opened_label ?></u> <?cs var:msg.assign_open_time ?><br />
&nbsp;&nbsp;<u><?cs var:lang.news_read.unlock_label ?></u> <?cs if:msg.user_unlocked ?><?cs var:lang.news_read.unlock_yes ?><?cs else ?><?cs var:lang.news_read.unlock_no ?><?cs /if ?><br />
&nbsp;&nbsp;<u><?cs var:lang.news_read.elapsed_time_label ?></u> <?cs if:msg.open_elapsed_days ?><?cs var:msg.open_elapsed_days ?> <?cs var:lang.news_read.days_label ?> <?cs /if ?><?cs if:msg.open_elapsed_hours ?><?cs var:msg.open_elapsed_hours ?> <?cs var:lang.news_read.hours_label ?> <?cs /if ?><?cs var:msg.open_elapsed_minutes ?> <?cs var:lang.news_read.minutes_label ?><br />
<?cs /if ?>
<br />
<b><?cs var:lang.news_read.assignment_label ?></b> <?cs var:msg.escaped_topic_subject ?>
<?cs if:msg.is_topic ?><?cs if:!printer_friendly ?><?cs call:print_flag() ?><?cs /if ?><br /><br /><b><?cs var:lang.news_read.this_is_assignment ?></b><br /><br /><?cs else ?><br /><b><?cs var:lang.news_read.subject_label ?></b> <?cs var:msg.escaped_subject ?> <?cs if:!printer_friendly ?><?cs call:print_flag() ?><?cs /if ?><br /><?cs /if ?>
<?cs if:msg.include_hotpot_release_form ?><?cs call:print_release_button() ?><?cs /if ?>
</td>

<?cs ###
     ### Print warnings if this message is hidden,
     ### marked Student Read-only, or has its
     ### attachments locked
## ?>
<?cs if:msg.teacher_hidden ?>
   <?cs call:print_msg_warning(lang.news_read.teacher_hidden) ?>
<?cs elif:msg.read_only ?>
   <?cs call:print_msg_warning(lang.news_read.read_only) ?>
<?cs /if ?>
<?cs if:msg.protected ?>
      <?cs call:print_msg_warning(lang.news_read.attachments_locked) ?>
<?cs /if ?>

</tr>
</table>
</fieldset>
<?cs /def ?>





<?cs def:print_hotpot_exam_form() ?>
 <form action="">
  <div><input type="button" value="<?cs var:lang.news_read.start_exam_button ?>" <?cs if:!printer_friendly ?>onclick="window.location='<?cs var:hotpot_exam_url ?>'"<?cs /if ?> /></div>
</form>
<?cs /def ?>





<?cs def:print_msg_body() ?>
<?cs if:fixed_font ?>
<div>
<pre>
<?cs each:row=line ?><?cs var:row.content ?>
<?cs /each ?>
</pre>
</div>
<?cs else ?>
<div style="text-indent:4em; margin-top:2em">
<?cs each:row=line ?><div class="reply_level<?cs if:row.reply_level ?><?cs var:row.reply_level % #6 ?><?cs else ?>0<?cs /if ?>"><?cs var:row.content ?></div>
<?cs /each ?>
</div>
<?cs /if ?>
<?cs /def ?>




<?cs def:print_view_website_form() ?>
  <div>
   <?cs if:printer_friendly ?>
      <form action="">
        <div><input type="button" value="<?cs var:lang.news_read.view_website_button ?>" /></div>
    </form>
 <?cs elif:capture_mode ?>
    <a href="<?cs var:url ?>" ><?cs var:normal_website_url ?><?cs var:lang.news_read.view_website_button ?></a>
 <?cs else ?>
  <form method="post" action="web_page_start">
    <div>
    <input type="hidden" name="crs" value="<?cs var:crs ?>" />
    <input type="hidden" name="id" value="<?cs var:key ?>" />
    <input type="hidden" name="sender" value="<?cs var:msg.sender ?>" />
    <input type="hidden" name="inf" value="<?cs var:msg.info_fname ?>" />
    <input type="hidden" name="grp" value="<?cs var:grp ?>" />
    <input type="hidden" name="read" value="1" />
    <input type="hidden" name="loc" value="<?cs var:msg.offset ?>" />
    <?cs if:student_username ?><input type="hidden" name="student" value="<?cs var:student_username ?>" /><?cs /if ?>
    <input type="hidden" name="from" value="assign_read" />
    <input type="submit" value="<?cs var:lang.news_read.view_website_button ?>" title="<?cs var:lang.news_read.view_website_button_help ?>" />
     </div>
  </form>
<?cs /if ?>
</div>
<?cs /def ?>





<?cs def:wimpy_button(file_number, wimpy_button_url) ?>
<a href="javascript:window.open('<?cs var:wimpy_button_url ?>','litenewwin','resizable=yes,width=250,height=200,top=50,left=50,scrollbars=yes,toolbar=no'); newwin.focus()" ><img  src="<?cs var:image_path ?>Volume16.gif" /></a>  
<?cs /def ?>







<?cs def:print_file_attachments() ?>
<div style="margin-top:1em">
<table border="0">
<tr>
<td valign="top"><b><?cs var:lang.news_read.attachments_label ?></b></td>
<td><?cs if:msg.attachments ?><?cs loop:i=#0, msg.attachments - #1, #1 ?><?cs if:i ?><?cs if:(i % 4) ?>,&nbsp;&nbsp;&nbsp;<?cs else ?>,<br /><?cs /if ?><?cs /if ?><?cs if:!printer_friendly ?><a href="<?cs var:file[i].url ?>" ><?cs /if ?><?cs var:file[i].orig_fname ?><?cs if:!printer_friendly ?></a><?cs /if ?><?cs if:!printer_friendly && file[i].wimpy_button_url ?><?cs call:wimpy_button(i,file[i].wimpy_button_url) ?><?cs /if ?><?cs /loop ?><?cs /if ?></td>
</tr>
</table>
</div>
<?cs /def ?>




<?cs def:insert_kill_form() ?>
<form  method="post" action="news_kill" onsubmit="return verify('<?cs if:msg.is_topic ?><?cs var:lang.news_read.delete_assignment_confirm ?><?cs else ?><?cs var:lang.news_read.delete_msg_confirm ?><?cs /if ?>')" >
     <div>
	<input type="hidden" name="crs" value="<?cs var:crs ?>" />
	<input type="hidden" name="id" value="<?cs var:key ?>" />
	<input type="hidden" name="info" value="<?cs var:msg.info_fname ?>" />
	<input type="hidden" name="sender" value="<?cs var:msg.sender ?>" />
	<input type="hidden" name="grp" value="<?cs var:grp ?>" />
	<input type="hidden" name="loc" value="<?cs var:msg.offset ?>" />
        <input type="submit" value="<?cs if:msg.is_topic ?><?cs var:lang.news_read.delete_assignment_button ?><?cs else ?><?cs var:lang.news_read.delete_msg_button ?><?cs /if ?>"/>
        <input type="checkbox" name="validate" id="validate" /><span class="small"><?cs var:lang.news_read.i_am_sure ?></span>
      </div>
</form>
<?cs /def ?>



<?cs def:insert_clipboard_copy_form() ?>
<form action="">
  <div>
  <input name="newwin" type="button" value="<?cs var:lang.news_read.clipboard_copy_button ?>"
   title="<?cs var:lang.news_read.clipboard_copy_button_title ?>"
   onclick="window.open('clipboard_copy?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?>&amp;grp=<?cs var:grp ?>','newwin','resizable=yes,width=350,height=275,top=50,left=50')" />
  </div>
</form>
<?cs /def ?>




<?cs def:insert_zip_website_form() ?>
 <?cs if:capture_mode ?>
  <a href="<?cs var:website_zip_download_url ?>"><?cs var:lang.news_read.download_website_button ?></a>
 <?cs else ?>
   <form method="post" action="web_page.zip">
   <div>
   <input type="hidden" name="crs" value="<?cs var:crs ?>" />
   <input type="hidden" name="id" value="<?cs var:key ?>" />
   <input type="hidden" name="sender" value="<?cs var:msg.sender ?>" />
   <input type="hidden" name="dir" value="<?cs var:website_dirname ?>" />
   <input type="hidden" name="grp" value="<?cs var:grp ?>" />
   <input type="submit" value="<?cs var:lang.news_read.download_website_button ?>" title="<?cs var:lang.news_read.download_website_button_title ?>" />
   </div>
   </form>
 <?cs /if ?>
<?cs /def ?>




<?cs def:print_del_copy_zip_forms() ?>
<?cs if:!printer_friendly && (!capture_mode || website_attached) ?>
  <div style="margin-top:1em">
  <table width="100%" border="0">
  <tr><td align="center">
   <hr style="width:300px" />
  <table  border="0" cellpadding="20">
  <tr>
  <?cs if:insert_kill_form && !capture_mode?>
   <?cs if:msg.is_topic ?>
      <td align="center" colspan="4"><img src="<?cs var:image_path ?>warn.gif" alt=" " /> <span style="color:red"><?cs var:lang.news_read.assign_del_warning ?></span></td></tr>
      <tr>
   <?cs /if ?>
   <td align="center">
   <?cs call:insert_kill_form() ?>
   </td>
  <?cs /if ?>

 <?cs if:(!capture_mode) ?>
  <td align="center">
   <?cs call:insert_clipboard_copy_form() ?>
  </td>
 <?cs /if ?>

 <?cs if:website_attached ?>
   <td align="center">
   <?cs call:insert_zip_website_form() ?>
   </td>
 <?cs /if ?>
</tr>
</table>
</td></tr></table>
</div>
<?cs /if ?>
<?cs /def ?>


<?cs ### html start here 
## ?>
<?cs call:html_heading() ?>
<head>
<title><?cs var:course_title ?> <?cs var:lang.news_read.module[grp] ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="StyleSheet" href="<?cs var:image_path ?>common.css" type="text/css" />
<script type="text/javascript" >
 function verify(mystring)
  {
    if(document.getElementById('validate').checked)
      {
        if(window.confirm(mystring))
           return true;
        else 
           return false;
      }
   else
     {
       window.alert("<?cs var:lang.news_read.i_am_sure_not_checked ?>");
       return false;
     }
  }
</script>
</head>
<?cs call:define_body() ?>

<?cs call:print_commands() ?>
<?cs call:print_message_header() ?>

<?cs if:!printer_friendly ?>
 <div class="font_selector" >
  <?cs if:fixed_font ?>
     <a href="assign_read?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?><?cs if:student_username ?>&amp;student=<?cs var:student_username ?><?cs /if ?>&amp;from=<?cs var:from ?>" title="<?cs var:lang.news_read.print_proportional_title ?>"><?cs var:lang.news_read.print_proportional_label ?></a>/<?cs var:lang.news_read.print_fixed_label ?>
  <?cs else ?>
     <?cs var:lang.news_read.print_proportional_label ?>/<a href="assign_read?crs=<?cs var:crs ?>&amp;id=<?cs var:key ?>&amp;loc=<?cs var:msg.offset ?><?cs if:student_username ?>&amp;student=<?cs var:student_username ?><?cs /if ?>&amp;from=<?cs var:from ?>&amp;fixed=1" title="<?cs var:lang.news_read.print_fixed_title ?>"><?cs var:lang.news_read.print_fixed_label ?></a>
  <?cs /if ?>   
 </div>
<?cs /if ?>



<?cs if:hotpot_exam ?>
   <?cs call:print_hotpot_exam_form() ?>
<?cs elif:website_attached ?>
  <?cs call:print_view_website_form() ?>
<?cs elif:file[0].url ?>
  <?cs call:print_file_attachments() ?>
<?cs /if ?>

<?cs call:print_msg_body() ?>
<?cs call:print_del_copy_zip_forms() ?>
</body>
</html>
<?cs call:runtime() ?>
