Skip to content
Browse files

Now event->name supports multilang under filterall completely.

  • Loading branch information...
1 parent 43fae8e commit fb73f3b3b2a350f2607d83caf8dd12b5afa2a185 stronk7 committed Mar 27, 2005
Showing with 9 additions and 5 deletions.
  1. +1 −1 calendar/event.php
  2. +6 −2 calendar/lib.php
  3. +2 −2 calendar/view.php
View
2 calendar/event.php
@@ -113,7 +113,7 @@
if($form = data_submitted()) {
- $form->name = strip_tags($form->name); // Strip all tags
+ $form->name = strip_tags($form->name,'<lang>'); // Strip all tags
//$form->description = clean_text($form->description , $form->format); // Clean up any bad tags
$form->timestart = make_timestamp($form->startyr, $form->startmon, $form->startday, $form->starthr, $form->startmin);
View
8 calendar/lib.php
@@ -213,7 +213,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
$popupicon = $CFG->pixpath.'/c/user.gif';
$popupalt = '';
}
- $popupcontent .= '<div><img height="16" width="16" src="'.$popupicon.'" style="vertical-align: middle; margin-right: 4px;" alt="'.$popupalt.'" /><a href="'.$dayhref.'">'.$event->name.'</a></div>';
+ $popupcontent .= '<div><img height="16" width="16" src="'.$popupicon.'" style="vertical-align: middle; margin-right: 4px;" alt="'.$popupalt.'" /><a href="'.$dayhref.'">'.format_string($event->name,true).'</a></div>';
}
$popupcaption = get_string('eventsfor', 'calendar', userdate($events[$eventid]->timestart, $strftimetimedayshort));
@@ -341,6 +341,10 @@ function calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxeve
function calendar_add_event_metadata($event) {
global $CFG;
+
+ //Support multilang in event->name
+ $event->name = format_string($event->name,true);
+
if(!empty($event->modulename)) { // Activity event
// The module name is set. I will assume that it has to be displayed, and
// also that it is an automatically-generated event. And of course that the
@@ -356,7 +360,7 @@ function calendar_add_event_metadata($event) {
$icon = $CFG->modpixpath.'/'.$event->modulename.'/icon.gif';
$event->icon = '<img height="16" width="16" src="'.$icon.'" alt="" title="'.$modulename.'" style="vertical-align: middle;" />';
- $event->referer = '<a href="'.$CFG->wwwroot.'/mod/'.$event->modulename.'/view.php?id='.$module->id.'">'.format_string($event->name,true).'</a>';
+ $event->referer = '<a href="'.$CFG->wwwroot.'/mod/'.$event->modulename.'/view.php?id='.$module->id.'">'.$event->name.'</a>';
$event->courselink = '<a href="'.$CFG->wwwroot.'/course/view.php?id='.$module->course.'">'.$coursecache[$module->course]->fullname.'</a>';
$event->cmid = $module->id;
View
4 calendar/view.php
@@ -437,14 +437,14 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
if(isset($eventsbyday[$day])) {
echo '<ul class="events-new">';
foreach($eventsbyday[$day] as $eventindex) {
- echo '<li><a href="'.$dayhref.'">'.$events[$eventindex]->name.'</a></li>';
+ echo '<li><a href="'.$dayhref.'">'.format_string($events[$eventindex]->name,true).'</a></li>';
}
echo '</ul>';
}
if(isset($durationbyday[$day])) {
echo '<ul class="events-underway">';
foreach($durationbyday[$day] as $eventindex) {
- echo '<li>['.$events[$eventindex]->name.']</li>';
+ echo '<li>['.format_string($events[$eventindex]->name,true).']</li>';
}
echo '</ul>';
}

0 comments on commit fb73f3b

Please sign in to comment.
Something went wrong with that request. Please try again.