Эх сурвалжийг харах

[svn r20442] FS#306 - The announcements tool: Improvements for better encoding management.

Ivan Tcholakov 16 жил өмнө
parent
commit
a473c53c02

+ 5 - 4
main/announcements/announcements.inc.php

@@ -1,4 +1,4 @@
-<?php //$Id: announcements.inc.php 20263 2009-05-04 03:59:27Z cfasanando $
+<?php //$Id: announcements.inc.php 20442 2009-05-10 08:24:45Z ivantcholakov $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -81,7 +81,7 @@ function display_announcement($announcement_id)
 	
 	echo "<table height=\"100\" width=\"100%\" border=\"1\" cellpadding=\"5\" cellspacing=\"0\" id=\"agenda_list\">\n";
 	echo "<tr class=\"data\"><td>" . $title . "</td></tr>\n";
-	echo "<tr><td class=\"announcements_datum\">" . get_lang('AnnouncementPublishedOn') . " : " . ucfirst(format_locale_date($dateFormatLong,strtotime($last_post_date) ) ) . "</td></tr>\n";
+	echo "<tr><td class=\"announcements_datum\">" . get_lang('AnnouncementPublishedOn') . " : " . api_ucfirst(format_locale_date($dateFormatLong,strtotime($last_post_date) ) ) . "</td></tr>\n";
 	echo "<tr class=\"text\"><td>$content</td></tr>\n";
 	echo "</table>";
 }
@@ -898,6 +898,7 @@ function edit_advalvas_item($id,$emailTitle,$newContent,$to)
 */
 function send_announcement_email($user_list, $course_code, $_course, $mail_title, $mail_content)
 {
+	global $charset;
 	global $_user;
 			
 	foreach ($user_list as $this_user)
@@ -912,7 +913,7 @@ function send_announcement_email($user_list, $course_code, $_course, $mail_title
 		$mail_subject = get_lang('professorMessage').' - '.$_course['official_code'].' - '.$mail_title;
 
 		$mail_body = '['.$_course['official_code'].'] - ['.$_course['name']."]\n";
-		$mail_body .= $this_user['lastname'].' '.$this_user['firstname'].' <'.$this_user["email"]."> \n\n".stripslashes($mail_title)."\n\n".trim(stripslashes(html_entity_decode(strip_tags(str_replace(array('<p>','</p>','<br />'),array('',"\n","\n"),$mail_content)))))." \n\n-- \n";
+		$mail_body .= $this_user['lastname'].' '.$this_user['firstname'].' <'.$this_user["email"]."> \n\n".stripslashes($mail_title)."\n\n".trim(stripslashes(api_html_entity_decode(strip_tags(str_replace(array('<p>','</p>','<br />'),array('',"\n","\n"),$mail_content)), ENT_QUOTES, $charset)))." \n\n-- \n";
 		$mail_body .= $_user['firstName'].' '.$_user['lastName'].' ';
 		$mail_body .= '<'.$_user['mail'].">\n";
 		$mail_body .= $_course['official_code'].' '.$_course['name'];
@@ -967,4 +968,4 @@ function get_all_annoucement_by_user_course($course_db, $user_id)
 	} else {
 		return $content;
 	}
-}
+}

+ 3 - 3
main/announcements/announcements.php

@@ -1,4 +1,4 @@
-<?php //$Id: announcements.php 20289 2009-05-04 17:57:08Z juliomontoya $
+<?php //$Id: announcements.php 20442 2009-05-10 08:24:45Z ivantcholakov $
 /*
 ==============================================================================
 	Dokeos - elearning and course management software
@@ -1316,7 +1316,7 @@ if ($display_announcement_list && !$surveyid) {
 			echo '&nbsp;&nbsp;&nbsp;'.get_lang('By').' : &nbsp;'.$user_info['lastName'].'&nbsp;'.$user_info['firstName'];			
 			echo "\t\t\t\t\t</th>\n","\t\t\t\t</tr>\n";			
 			echo "\t\t\t\t<tr class='row_odd'>\n\t\t\t\t\t<td class=\"announcements_datum\" colspan=\"3\">";
-			echo get_lang('AnnouncementPublishedOn')," : ",ucfirst(format_locale_date($dateFormatLong,strtotime($last_post_date)));
+			echo get_lang('AnnouncementPublishedOn')," : ",api_ucfirst(format_locale_date($dateFormatLong,strtotime($last_post_date)));
 			echo "</td>\n\t\t\t\t</tr>\n";
 
 			/* CONTENT */
@@ -1342,7 +1342,7 @@ if ($display_announcement_list && !$surveyid) {
 						"</a>";
 
 				if (api_is_allowed_to_edit(false,true)) {
-					echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&id=".$myrow['id']."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset))."')) return false;\">",
+					echo "<a href=\"".api_get_self()."?".api_get_cidreq()."&action=delete&id=".$myrow['id']."&sec_token=".$stok."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset))."')) return false;\">",
 						Display::return_icon('delete.gif', get_lang('Delete')),
 						"</a>";
 				}