0){
$emailto = '';
while($row_email = Database::fetch_array($res_resp)){
if(!empty($row_email['myemail'])){
$emailto .= $row_email['myemail'].',';
}
}
$emailfromaddr = get_setting('emailAdministrator');
$emailfromname = get_setting('siteName');
$emailsubject = "[".get_setting('siteName')."] ";
// The body can be as long as you wish, and any combination of text and variables
//$emailbody=get_lang('SendMailBody').' '.api_get_path(WEB_CODE_PATH)."work/work.php?".api_get_cidreq()." ($title)\n\n".get_setting('administratorName')." ".get_setting('administratorSurname')."\n". get_lang('Manager'). " ".get_setting('siteName')."\nT. ".get_setting('administratorTelephone')."\n" .get_lang('Email') ." : ".get_setting('emailAdministrator');
$emailbody=get_lang('SendMailBody').' '.api_get_path(WEB_CODE_PATH)."work/work.php?".api_get_cidreq()." ($title)\n\n".get_setting('administratorName')." ".get_setting('administratorSurname')."\n". get_lang('Manager'). " ".get_setting('siteName')."\n" .get_lang('Email') ." : ".get_setting('emailAdministrator');
// Here we are forming one large header line
// Every header must be followed by a \n except the last
$emailheaders = "From: ".get_setting('administratorSurname')." ".get_setting('administratorName')." <".get_setting('emailAdministrator').">\n";
$emailheaders .= "Reply-To: ".get_setting('emailAdministrator');
// Because I predefined all of my variables, this api_send_mail() function looks nice and clean hmm?
@api_send_mail( $emailto, $emailsubject, $emailbody, $emailheaders);
}
$message = get_lang('DocAdd');
if ($uploadvisibledisabled && !$is_allowed_to_edit)
{
$message .= "
".get_lang('_doc_unvisible')."
";
}
//stats
if(!$Id) { $Id = $insertId; }
event_upload($Id);
$submit_success_message = $message . "
\n";
Display::display_normal_message($submit_success_message);
}
//{
/*=======================================
Display links to upload form and tool options
=======================================*/
display_action_links($always_show_tool_options, $always_show_upload_form);
/*=======================================
Display form to upload document
=======================================*/
if($is_course_member)
{
if ($display_upload_form || $edit)
{
if($edit){
//Get the author ID for that document from the item_property table
$is_author = false;
$author_sql = "SELECT * FROM $iprop_table WHERE tool = 'work' AND insert_user_id='$user_id' AND ref=".mysql_real_escape_string($edit);
$author_qry = api_sql_query($author_sql,__FILE__,__LINE__);
if(Database::num_rows($author_qry)==1)
{
$is_author = true;
}
}
echo "
"; } } else { //the user is not registered in this course echo "
" . get_lang("MustBeRegisteredUser") . "
"; } /* ============================================================================== Display of tool options ============================================================================== */ if ($display_tool_options) { display_tool_options($uploadvisibledisabled, $origin); } /* ============================================================================== Display list of student publications ============================================================================== */ /*if ( ! $id )*/ display_student_publications_list($currentCourseRepositoryWeb, $link_target_parameter, $dateFormatLong, $origin); //} /* ============================================================================== Footer ============================================================================== */ if ($origin != 'learnpath') { //we are not in the learning path tool Display::display_footer(); } ?>