Removing text_filter function calls (function is unused)

skala
Julio Montoya 13 years ago
parent 70889e4b9b
commit a308a976d3
  1. 34
      main/admin/calendar.lib.php
  2. 1
      main/admin/calendar_view_print.php
  3. 3
      main/calendar/agenda.inc.php
  4. 182
      main/calendar/myagenda.inc.php
  5. 1
      main/calendar/print.php
  6. 18
      main/course_description/listing.php
  7. 2
      main/exercice/answer_admin.inc.php
  8. 2
      main/exercice/exercise.class.php
  9. 15
      main/exercice/export/scorm/scorm_classes.php
  10. 1
      main/exercice/question.class.php
  11. 2
      main/inc/lib/course.lib.php

@ -354,7 +354,7 @@ function display_monthcalendar($month, $year) {
foreach ($data[$curday] as $key=>$agenda_item) { foreach ($data[$curday] as $key=>$agenda_item) {
foreach ($agenda_item as $key=>$value) { foreach ($agenda_item as $key=>$value) {
$start_time = api_convert_and_format_date($value['start_date'], TIME_NO_SEC_FORMAT); $start_time = api_convert_and_format_date($value['start_date'], TIME_NO_SEC_FORMAT);
$end_time = api_convert_and_format_date($value['end_date'], TIME_NO_SEC_FORMAT); $end_time = api_convert_and_format_date($value['end_date'], TIME_NO_SEC_FORMAT);
$dayheader .= '<br /><b>'.$start_time.' - '.$end_time.'</b>'; $dayheader .= '<br /><b>'.$start_time.' - '.$end_time.'</b>';
$dayheader .= ' - '; $dayheader .= ' - ';
$dayheader .= $value['title']; $dayheader .= $value['title'];
@ -469,7 +469,7 @@ function display_student_links() {
} else { } else {
//echo '<a href="'.api_get_self().'?sort=desc&amp;origin='.Security::remove_XSS($_GET['origin']).'"> '.Display::return_icon('calendar_inverse.png',get_lang('AgendaSortChronologicallyDown'),'',ICON_SIZE_MEDIUM).'</a>'; //echo '<a href="'.api_get_self().'?sort=desc&amp;origin='.Security::remove_XSS($_GET['origin']).'"> '.Display::return_icon('calendar_inverse.png',get_lang('AgendaSortChronologicallyDown'),'',ICON_SIZE_MEDIUM).'</a>';
} }
} else { } else {
echo '<a href="'.api_get_self().'?action=view&amp;view=list">'.Display::return_icon('week.png', get_lang('ListView'),'',ICON_SIZE_MEDIUM).'</a>'; echo '<a href="'.api_get_self().'?action=view&amp;view=list">'.Display::return_icon('week.png', get_lang('ListView'),'',ICON_SIZE_MEDIUM).'</a>';
} }
@ -545,10 +545,10 @@ function save_edit_agenda_item($id, $title, $content, $start_date, $end_date) {
$start_date = api_get_utc_datetime($start_date); $start_date = api_get_utc_datetime($start_date);
$start_date = Database::escape_string($start_date); $start_date = Database::escape_string($start_date);
$end_date = api_get_utc_datetime($end_date); $end_date = api_get_utc_datetime($end_date);
$end_date = Database::escape_string($end_date); $end_date = Database::escape_string($end_date);
// store the modifications in the table calendar_event // store the modifications in the table calendar_event
$sql = "UPDATE ".$TABLEAGENDA." $sql = "UPDATE ".$TABLEAGENDA."
@ -706,7 +706,7 @@ function display_agenda_items() {
echo '<table class="data_table">'; echo '<table class="data_table">';
$myrow["start_date"] = api_get_local_time($myrow["start_date"]); $myrow["start_date"] = api_get_local_time($myrow["start_date"]);
if ($month_bar != api_format_date($myrow["start_date"], "%m%Y")) { if ($month_bar != api_format_date($myrow["start_date"], "%m%Y")) {
$month_bar = api_format_date($myrow["start_date"], "%m%Y"); $month_bar = api_format_date($myrow["start_date"], "%m%Y");
echo "<tr><td class=\"agenda_month_divider\" colspan=\"3\" valign=\"top\">". echo "<tr><td class=\"agenda_month_divider\" colspan=\"3\" valign=\"top\">".
@ -768,7 +768,7 @@ function display_agenda_items() {
// display: the title // display: the title
echo "<tr class='row_odd'>"; echo "<tr class='row_odd'>";
echo "<td>".get_lang("StartTimeWindow").": "; echo "<td>".get_lang("StartTimeWindow").": ";
echo api_format_date($myrow["start_date"], DATE_TIME_FORMAT_LONG); echo api_format_date($myrow["start_date"], DATE_TIME_FORMAT_LONG);
echo "</td>"; echo "</td>";
echo "<td>"; echo "<td>";
@ -778,7 +778,7 @@ function display_agenda_items() {
echo api_format_date($myrow["end_date"], DATE_TIME_FORMAT_LONG); echo api_format_date($myrow["end_date"], DATE_TIME_FORMAT_LONG);
} }
echo "</td>"; echo "</td>";
if (!$is_repeated && (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous()))) { if (!$is_repeated && (api_is_allowed_to_edit(false,true) OR (api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous()))) {
if( ! (api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $myrow['id'] ) ) ) if( ! (api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $myrow['id'] ) ) )
{ // a coach can only delete an element belonging to his session { // a coach can only delete an element belonging to his session
@ -816,7 +816,6 @@ function display_agenda_items() {
--------------------------------------------------*/ --------------------------------------------------*/
$content = $myrow['content']; $content = $myrow['content'];
$content = make_clickable($content); $content = make_clickable($content);
$content = text_filter($content);
echo "<tr class='row_even'>"; echo "<tr class='row_even'>";
echo "<td colspan='3'>"; echo "<td colspan='3'>";
@ -1017,7 +1016,6 @@ function display_one_agenda_item($agenda_id)
$content = $myrow['content']; $content = $myrow['content'];
$content = make_clickable($content); $content = make_clickable($content);
$content = text_filter($content);
//echo "<tr><td class=\"".$text_style."\" colspan='2'>"; //echo "<tr><td class=\"".$text_style."\" colspan='2'>";
//echo $content; //echo $content;
//echo "</td></tr>"; //echo "</td></tr>";
@ -1219,22 +1217,22 @@ function show_add_form($id = '') {
// if the id is set then we are editing an agenda item // if the id is set then we are editing an agenda item
if (is_int($id)) { if (is_int($id)) {
//echo "before get_agenda_item".$_SESSION['allow_individual_calendar']; //echo "before get_agenda_item".$_SESSION['allow_individual_calendar'];
$item_2_edit=get_agenda_item($id); $item_2_edit=get_agenda_item($id);
$title = $item_2_edit['title']; $title = $item_2_edit['title'];
$content= $item_2_edit['content']; $content= $item_2_edit['content'];
// start date // start date
$item_2_edit['start_date'] = api_get_local_time($item_2_edit['start_date']); $item_2_edit['start_date'] = api_get_local_time($item_2_edit['start_date']);
// start date // start date
list($datepart, $timepart) = split(" ", $item_2_edit['start_date']); list($datepart, $timepart) = split(" ", $item_2_edit['start_date']);
list($year, $month, $day) = explode("-", $datepart); list($year, $month, $day) = explode("-", $datepart);
list($hours, $minutes, $seconds) = explode(":", $timepart); list($hours, $minutes, $seconds) = explode(":", $timepart);
// end date // end date
$item_2_edit['end_date'] = api_get_local_time($item_2_edit['end_date']); $item_2_edit['end_date'] = api_get_local_time($item_2_edit['end_date']);
list($datepart, $timepart) = split(" ", $item_2_edit['end_date']); list($datepart, $timepart) = split(" ", $item_2_edit['end_date']);
@ -1249,7 +1247,7 @@ function show_add_form($id = '') {
$title=stripslashes($title); $title=stripslashes($title);
// we start a completely new item, we do not come from the resource linker // we start a completely new item, we do not come from the resource linker
if ($_GET['originalresource']!=="no" and $_GET['action']=="add") { if ($_GET['originalresource']!=="no" and $_GET['action']=="add") {
$_SESSION["formelements"]=null; $_SESSION["formelements"]=null;
} }
?> ?>
@ -2800,12 +2798,12 @@ function agenda_add_item($title, $content, $db_start_date, $db_end_date) {
// some filtering of the input data // some filtering of the input data
$title = Database::escape_string($title); // no html allowed in the title $title = Database::escape_string($title); // no html allowed in the title
$content = Database::escape_string($content); $content = Database::escape_string($content);
$db_start_date = api_get_utc_datetime($db_start_date); $db_start_date = api_get_utc_datetime($db_start_date);
$start_date = Database::escape_string($db_start_date); $start_date = Database::escape_string($db_start_date);
$db_end_date = api_get_utc_datetime($db_end_date); $db_end_date = api_get_utc_datetime($db_end_date);
$end_date = Database::escape_string($db_end_date); $end_date = Database::escape_string($db_end_date);
// check if exists in calendar_event table // check if exists in calendar_event table
$sql = "SELECT * FROM $t_agenda WHERE title='$title' AND content = '$content' AND start_date = '$start_date' AND end_date = '$end_date' "; $sql = "SELECT * FROM $t_agenda WHERE title='$title' AND content = '$content' AND start_date = '$start_date' AND end_date = '$end_date' ";

@ -52,7 +52,6 @@ while($row=Database::fetch_array($result))
{ {
$row['content'] = $row['content']; $row['content'] = $row['content'];
$row['content'] = make_clickable($row['content']); $row['content'] = make_clickable($row['content']);
$row['content'] = text_filter($row['content']);
$row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']); $row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
if(!empty($row['title'])) if(!empty($row['title']))

@ -2135,8 +2135,7 @@ function display_one_agenda_item($agenda_id) {
// Content // Content
$content = $myrow['content']; $content = $myrow['content'];
$content = make_clickable($content); $content = make_clickable($content);
$content = text_filter($content);
echo '<tr class="row_even">'; echo '<tr class="row_even">';
echo '<td '.(api_is_allowed_to_edit()?'colspan="3"':'colspan="2"'). '>'; echo '<td '.(api_is_allowed_to_edit()?'colspan="3"':'colspan="2"'). '>';
echo $content; echo $content;

@ -2,12 +2,12 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
@author: Julio Montoya <gugli100@gmail.com> BeezNest 2011 Bugfixes @author: Julio Montoya <gugli100@gmail.com> BeezNest 2011 Bugfixes
//Original code found in Dok€os //Original code found in Dok€os
@author: Patrick Cool <patrick.cool@UGent.be>, Ghent University @author: Patrick Cool <patrick.cool@UGent.be>, Ghent University
@author: Toon Van Hoecke <toon.vanhoecke@ugent.be>, Ghent University @author: Toon Van Hoecke <toon.vanhoecke@ugent.be>, Ghent University
@author: Eric Remy (initial version) @author: Eric Remy (initial version)
@todo create a class and merge with the agenda.inc.php @todo create a class and merge with the agenda.inc.php
*/ */
@ -22,13 +22,13 @@ require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
/** /**
* This function retrieves all the agenda items of all the courses the user is subscribed to * This function retrieves all the agenda items of all the courses the user is subscribed to
*/ */
function get_myagendaitems($user_id, $courses_dbs, $month, $year) { function get_myagendaitems($user_id, $courses_dbs, $month, $year) {
global $setting_agenda_link; global $setting_agenda_link;
$user_id = intval($user_id); $user_id = intval($user_id);
$items = array(); $items = array();
$my_list = array(); $my_list = array();
// get agenda-items for every course // get agenda-items for every course
foreach ($courses_dbs as $key => $array_course_info) { foreach ($courses_dbs as $key => $array_course_info) {
//databases of the courses //databases of the courses
@ -77,29 +77,29 @@ function get_myagendaitems($user_id, $courses_dbs, $month, $year) {
} }
} }
$result = Database::query($sqlquery); $result = Database::query($sqlquery);
while ($item = Database::fetch_array($result, 'ASSOC')) { while ($item = Database::fetch_array($result, 'ASSOC')) {
$agendaday = -1; $agendaday = -1;
if ($item['start_date'] != '0000-00-00 00:00:00') { if ($item['start_date'] != '0000-00-00 00:00:00') {
$item['start_date'] = api_get_local_time($item['start_date']); $item['start_date'] = api_get_local_time($item['start_date']);
$item['start_date_tms'] = api_strtotime($item['start_date']); $item['start_date_tms'] = api_strtotime($item['start_date']);
$agendaday = date("j", $item['start_date_tms']); $agendaday = date("j", $item['start_date_tms']);
} }
if ($item['end_date'] != '0000-00-00 00:00:00') { if ($item['end_date'] != '0000-00-00 00:00:00') {
$item['end_date'] = api_get_local_time($item['end_date']); $item['end_date'] = api_get_local_time($item['end_date']);
} }
$url = api_get_path(WEB_CODE_PATH)."calendar/agenda.php?cidReq=".urlencode($array_course_info["code"])."&day=$agendaday&month=$month&year=$year#$agendaday"; $url = api_get_path(WEB_CODE_PATH)."calendar/agenda.php?cidReq=".urlencode($array_course_info["code"])."&day=$agendaday&month=$month&year=$year#$agendaday";
$item['url'] = $url; $item['url'] = $url;
$item['course_name'] = $array_course_info['title']; $item['course_name'] = $array_course_info['title'];
$item['calendar_type'] = 'course'; $item['calendar_type'] = 'course';
$item['course_id'] = $array_course_info['course_id']; $item['course_id'] = $array_course_info['course_id'];
$my_list[$agendaday][] = $item; $my_list[$agendaday][] = $item;
} }
} }
// sorting by hour for every day // sorting by hour for every day
$agendaitems = array (); $agendaitems = array ();
while (list ($agendaday, $tmpitems) = each($items)) { while (list ($agendaday, $tmpitems) = each($items)) {
@ -110,7 +110,7 @@ function get_myagendaitems($user_id, $courses_dbs, $month, $year) {
while (list ($key, $val) = each($tmpitems)) { while (list ($key, $val) = each($tmpitems)) {
$agendaitems[$agendaday] .= $val; $agendaitems[$agendaday] .= $val;
} }
} }
return $my_list; return $my_list;
} }
@ -123,8 +123,8 @@ function get_myagendaitems($user_id, $courses_dbs, $month, $year) {
* @param string The month name * @param string The month name
* @return void Direct output * @return void Direct output
*/ */
function display_mymonthcalendar($user_id, $agendaitems, $month, $year, $weekdaynames = array(), $monthName, $show_content = true) { function display_mymonthcalendar($user_id, $agendaitems, $month, $year, $weekdaynames = array(), $monthName, $show_content = true) {
global $DaysShort, $course_path; global $DaysShort, $course_path;
//Handle leap year //Handle leap year
$numberofdays = array (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31); $numberofdays = array (0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
if (($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0)) if (($year % 400 == 0) or ($year % 4 == 0 and $year % 100 <> 0))
@ -134,29 +134,29 @@ function display_mymonthcalendar($user_id, $agendaitems, $month, $year, $weekday
//Start the week on monday //Start the week on monday
$startdayofweek = $dayone['wday'] <> 0 ? ($dayone['wday'] - 1) : 6; $startdayofweek = $dayone['wday'] <> 0 ? ($dayone['wday'] - 1) : 6;
$g_cc = (isset($_GET['courseCode'])?$_GET['courseCode']:''); $g_cc = (isset($_GET['courseCode'])?$_GET['courseCode']:'');
$prev_icon = Display::return_icon('action_prev.png',get_lang('Previous')); $prev_icon = Display::return_icon('action_prev.png',get_lang('Previous'));
$next_icon = Display::return_icon('action_next.png',get_lang('Next')); $next_icon = Display::return_icon('action_next.png',get_lang('Next'));
$next_month = ($month == 1 ? 12 : $month -1); $next_month = ($month == 1 ? 12 : $month -1);
$prev_month = ($month == 12 ? 1 : $month +1); $prev_month = ($month == 12 ? 1 : $month +1);
$next_year = ($month == 1 ? $year -1 : $year); $next_year = ($month == 1 ? $year -1 : $year);
$prev_year = ($month == 12 ? $year +1 : $year); $prev_year = ($month == 12 ? $year +1 : $year);
if ($show_content) { if ($show_content) {
$back_url = Display::url($prev_icon, api_get_self()."?coursePath=".urlencode($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;action=view&amp;view=month&amp;month=".$next_month."&amp;year=".$next_year); $back_url = Display::url($prev_icon, api_get_self()."?coursePath=".urlencode($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;action=view&amp;view=month&amp;month=".$next_month."&amp;year=".$next_year);
$next_url = Display::url($next_icon, api_get_self()."?coursePath=".urlencode($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;action=view&amp;view=month&amp;month=".$prev_month."&amp;year=".$prev_year); $next_url = Display::url($next_icon, api_get_self()."?coursePath=".urlencode($course_path)."&amp;courseCode=".Security::remove_XSS($g_cc)."&amp;action=view&amp;view=month&amp;month=".$prev_month."&amp;year=".$prev_year);
} else { } else {
$back_url = Display::url($prev_icon, '', array('onclick'=>"load_calendar('".$user_id."','".$next_month."', '".$next_year."'); ")); $back_url = Display::url($prev_icon, '', array('onclick'=>"load_calendar('".$user_id."','".$next_month."', '".$next_year."'); "));
$next_url = Display::url($next_icon, '', array('onclick'=>"load_calendar('".$user_id."','".$prev_month."', '".$prev_year."'); ")); $next_url = Display::url($next_icon, '', array('onclick'=>"load_calendar('".$user_id."','".$prev_month."', '".$prev_year."'); "));
} }
echo '<table id="agenda_list"><tr>'; echo '<table id="agenda_list"><tr>';
echo '<th width="10%">'.$back_url.'</th>'; echo '<th width="10%">'.$back_url.'</th>';
echo '<th width="80%" colspan="5"><br /><h3>'.$monthName." ".$year.'</h3></th>'; echo '<th width="80%" colspan="5"><br /><h3>'.$monthName." ".$year.'</h3></th>';
echo '<th width="10%">'.$next_url.'</th>'; echo '<th width="10%">'.$next_url.'</th>';
echo '</tr>'; echo '</tr>';
echo '<tr>'; echo '<tr>';
@ -164,7 +164,7 @@ function display_mymonthcalendar($user_id, $agendaitems, $month, $year, $weekday
echo '<td class="weekdays">'.$DaysShort[$ii % 7].'</td>'; echo '<td class="weekdays">'.$DaysShort[$ii % 7].'</td>';
} }
echo '</tr>'; echo '</tr>';
$curday = -1; $curday = -1;
$today = getdate(); $today = getdate();
while ($curday <= $numberofdays[$month]) { while ($curday <= $numberofdays[$month]) {
@ -176,31 +176,31 @@ function display_mymonthcalendar($user_id, $agendaitems, $month, $year, $weekday
if (($curday > 0) && ($curday <= $numberofdays[$month])) { if (($curday > 0) && ($curday <= $numberofdays[$month])) {
$bgcolor = $class = 'class="days_week"'; $bgcolor = $class = 'class="days_week"';
$dayheader = Display::div($curday, array('class'=>'agenda_day')); $dayheader = Display::div($curday, array('class'=>'agenda_day'));
if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) { if (($curday == $today['mday']) && ($year == $today['year']) && ($month == $today['mon'])) {
$class = "class=\"days_today\" style=\"width:10%;\""; $class = "class=\"days_today\" style=\"width:10%;\"";
} }
echo "<td ".$class.">".$dayheader; echo "<td ".$class.">".$dayheader;
if (!empty($agendaitems[$curday])) { if (!empty($agendaitems[$curday])) {
$items = $agendaitems[$curday]; $items = $agendaitems[$curday];
$items = msort($items, 'start_date_tms'); $items = msort($items, 'start_date_tms');
foreach($items as $value) { foreach($items as $value) {
$value['title'] = Security::remove_XSS($value['title']); $value['title'] = Security::remove_XSS($value['title']);
$start_time = api_format_date($value['start_date'], TIME_NO_SEC_FORMAT); $start_time = api_format_date($value['start_date'], TIME_NO_SEC_FORMAT);
$end_time = ''; $end_time = '';
if (!empty($value['end_date']) && $value['end_date'] != '0000-00-00 00:00:00') { if (!empty($value['end_date']) && $value['end_date'] != '0000-00-00 00:00:00') {
$end_time = '-&nbsp;<i>'.api_format_date($value['end_date'], DATE_TIME_FORMAT_LONG).'</i>'; $end_time = '-&nbsp;<i>'.api_format_date($value['end_date'], DATE_TIME_FORMAT_LONG).'</i>';
} }
$complete_time = '<i>'.api_format_date($value['start_date'], DATE_TIME_FORMAT_LONG).'</i>&nbsp;'.$end_time; $complete_time = '<i>'.api_format_date($value['start_date'], DATE_TIME_FORMAT_LONG).'</i>&nbsp;'.$end_time;
$time = '<i>'.$start_time.'</i>'; $time = '<i>'.$start_time.'</i>';
switch($value['calendar_type']) { switch($value['calendar_type']) {
case 'personal': case 'personal':
$bg_color = '#D0E7F4'; $bg_color = '#D0E7F4';
$icon = Display::return_icon('user.png', get_lang('MyAgenda'), array(), ICON_SIZE_SMALL); $icon = Display::return_icon('user.png', get_lang('MyAgenda'), array(), ICON_SIZE_SMALL);
break; break;
case 'global': case 'global':
$bg_color = '#FFBC89'; $bg_color = '#FFBC89';
@ -216,34 +216,34 @@ function display_mymonthcalendar($user_id, $agendaitems, $month, $year, $weekday
$icon = Display::url(Display::return_icon($icon_name, $value['course_name'].' '.get_lang('Course'), array(), ICON_SIZE_SMALL), $value['url']); $icon = Display::url(Display::return_icon($icon_name, $value['course_name'].' '.get_lang('Course'), array(), ICON_SIZE_SMALL), $value['url']);
} else { } else {
$icon = Display::return_icon($icon_name, $value['course_name'].' '.get_lang('Course'), array(), ICON_SIZE_SMALL); $icon = Display::return_icon($icon_name, $value['course_name'].' '.get_lang('Course'), array(), ICON_SIZE_SMALL);
} }
break; break;
default: default:
break; break;
} }
$result = '<div class="rounded_div_agenda" style="background-color:'.$bg_color.';">'; $result = '<div class="rounded_div_agenda" style="background-color:'.$bg_color.';">';
if ($show_content) { if ($show_content) {
//Setting a personal event to green //Setting a personal event to green
$icon = Display::div($icon, array('style'=>'float:right')); $icon = Display::div($icon, array('style'=>'float:right'));
$link = $value['calendar_type'].'_'.$value['id'].'_'.$value['course_id'].'_'.$value['session_id']; $link = $value['calendar_type'].'_'.$value['id'].'_'.$value['course_id'].'_'.$value['session_id'];
//Link to bubble //Link to bubble
$url = Display::url(cut($value['title'], 40), '#', array('id'=>$link, 'class'=>'opener')); $url = Display::url(cut($value['title'], 40), '#', array('id'=>$link, 'class'=>'opener'));
$result .= $time.' '.$icon.' '.Display::div($url); $result .= $time.' '.$icon.' '.Display::div($url);
//Hidden content //Hidden content
$content = Display::div($icon.Display::tag('h2', $value['course_name']).'<hr />'.Display::tag('h3', $value['title']).$complete_time.'<hr />'.Security::remove_XSS($value['content'])); $content = Display::div($icon.Display::tag('h2', $value['course_name']).'<hr />'.Display::tag('h3', $value['title']).$complete_time.'<hr />'.Security::remove_XSS($value['content']));
//Main div //Main div
$result .= Display::div($content, array('id'=>'main_'.$link, 'class' => 'dialog', 'style' => 'display:none')); $result .= Display::div($content, array('id'=>'main_'.$link, 'class' => 'dialog', 'style' => 'display:none'));
$result .= '</div>'; $result .= '</div>';
echo $result; echo $result;
//echo Display::div($content, array('id'=>'main_'.$value['calendar_type'].'_'.$value['id'], 'class' => 'dialog')); //echo Display::div($content, array('id'=>'main_'.$value['calendar_type'].'_'.$value['id'], 'class' => 'dialog'));
} else { } else {
echo $result .= $icon.'</div>'; echo $result .= $icon.'</div>';
} }
} }
@ -334,15 +334,15 @@ function show_new_personal_item_form($id = "") {
// we construct the default time and date data (used if we are not editing a personal agenda item) // we construct the default time and date data (used if we are not editing a personal agenda item)
//$today = getdate(); //$today = getdate();
$current_date = api_strtotime(api_get_local_time()); $current_date = api_strtotime(api_get_local_time());
$year = date('Y', $current_date); $year = date('Y', $current_date);
$month = date('m', $current_date); $month = date('m', $current_date);
$day = date('d', $current_date); $day = date('d', $current_date);
$hours = date('H', $current_date); $hours = date('H', $current_date);
$minutes = date('i', $current_date); $minutes = date('i', $current_date);
//echo date('Y', $current_date); //echo date('Y', $current_date);
/* /*
$day = $today['mday']; $day = $today['mday'];
@ -366,14 +366,14 @@ function show_new_personal_item_form($id = "") {
$result = Database::query($sql); $result = Database::query($sql);
$aantal = Database::num_rows($result); $aantal = Database::num_rows($result);
if ($aantal != 0) { if ($aantal != 0) {
$row = Database::fetch_array($result); $row = Database::fetch_array($result);
$row['date'] = api_get_local_time($row['date']); $row['date'] = api_get_local_time($row['date']);
$year = substr($row['date'], 0, 4); $year = substr($row['date'], 0, 4);
$month = substr($row['date'], 5, 2); $month = substr($row['date'], 5, 2);
$day = substr($row['date'], 8, 2); $day = substr($row['date'], 8, 2);
$hours = substr($row['date'], 11, 2); $hours = substr($row['date'], 11, 2);
$minutes= substr($row['date'], 14, 2); $minutes= substr($row['date'], 14, 2);
$title = $row['title']; $title = $row['title'];
$content= $row['text']; $content= $row['text'];
} else { } else {
@ -483,7 +483,7 @@ function show_new_personal_item_form($id = "") {
echo '</div>'; echo '</div>';
// ********** The text field ********** \\ // ********** The text field ********** \\
echo '<br /><div class="formw">'; echo '<br /><div class="formw">';
require_once api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php"; require_once api_get_path(LIBRARY_PATH) . "/fckeditor/fckeditor.php";
$oFCKeditor = new FCKeditor('frm_content') ; $oFCKeditor = new FCKeditor('frm_content') ;
@ -499,7 +499,7 @@ function show_new_personal_item_form($id = "") {
$oFCKeditor->Value = $content; $oFCKeditor->Value = $content;
$return = $oFCKeditor->CreateHtml(); $return = $oFCKeditor->CreateHtml();
echo $return; echo $return;
echo '</div>'; echo '</div>';
// ********** The Submit button********** \\ // ********** The Submit button********** \\
echo '<div>'; echo '<div>';
@ -526,22 +526,22 @@ function store_personal_item($day, $month, $year, $hour, $minute, $title, $conte
//constructing the date //constructing the date
$date = $year."-".$month."-".$day." ".$hour.":".$minute.":00"; $date = $year."-".$month."-".$day." ".$hour.":".$minute.":00";
if (!empty($date)) { if (!empty($date)) {
$date = api_get_utc_datetime($date); $date = api_get_utc_datetime($date);
} }
$date = Database::escape_string($date); $date = Database::escape_string($date);
$title = Database::escape_string($title); $title = Database::escape_string($title);
$content = Database::escape_string($content); $content = Database::escape_string($content);
$id = intval($id); $id = intval($id);
if (!empty($id)) { if (!empty($id)) {
// we are updating // we are updating
$sql = "UPDATE ".$tbl_personal_agenda." SET user='".api_get_user_id()."', title='".$title."', text='".$content."', date='".$date."' WHERE id= ".$id; $sql = "UPDATE ".$tbl_personal_agenda." SET user='".api_get_user_id()."', title='".$title."', text='".$content."', date='".$date."' WHERE id= ".$id;
} else { } else {
// we are adding a new item // we are adding a new item
$sql = "INSERT INTO $tbl_personal_agenda (user, title, text, date) VALUES ('".api_get_user_id()."','$title', '$content', '$date')"; $sql = "INSERT INTO $tbl_personal_agenda (user, title, text, date) VALUES ('".api_get_user_id()."','$title', '$content', '$date')";
} }
$result = Database::query($sql); $result = Database::query($sql);
} }
@ -608,13 +608,13 @@ function get_courses_of_user() {
function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "", $year = "", $week = "", $type) { function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "", $year = "", $week = "", $type) {
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA); $tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$user_id = intval($user_id); $user_id = intval($user_id);
// 1. creating the SQL statement for getting the personal agenda items in MONTH view // 1. creating the SQL statement for getting the personal agenda items in MONTH view
if ($type == "month_view" or $type == "") { if ($type == "month_view" or $type == "") {
// we are in month view // we are in month view
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' and MONTH(date)='".$month."' AND YEAR(date) = '".$year."' ORDER BY date ASC"; $sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' and MONTH(date)='".$month."' AND YEAR(date) = '".$year."' ORDER BY date ASC";
} }
// 2. creating the SQL statement for getting the personal agenda items in WEEK view // 2. creating the SQL statement for getting the personal agenda items in WEEK view
// we are in week view // we are in week view
if ($type == "week_view") { if ($type == "week_view") {
@ -639,19 +639,19 @@ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "
$start_filter = $year."-".$month."-".$day." 00:00:00"; $start_filter = $year."-".$month."-".$day." 00:00:00";
$start_filter = api_get_utc_datetime($start_filter); $start_filter = api_get_utc_datetime($start_filter);
$end_filter = $year."-".$month."-".$day." 23:59:59"; $end_filter = $year."-".$month."-".$day." 23:59:59";
$end_filter = api_get_utc_datetime($end_filter); $end_filter = api_get_utc_datetime($end_filter);
$sql = " SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' AND date>='".$start_filter."' AND date<='".$end_filter."'"; $sql = " SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' AND date>='".$start_filter."' AND date<='".$end_filter."'";
} }
$result = Database::query($sql); $result = Database::query($sql);
while ($item = Database::fetch_array($result, 'ASSOC')) { while ($item = Database::fetch_array($result, 'ASSOC')) {
$time_minute = api_convert_and_format_date($item['date'], TIME_NO_SEC_FORMAT); $time_minute = api_convert_and_format_date($item['date'], TIME_NO_SEC_FORMAT);
$item['date'] = api_get_local_time($item['date']); $item['date'] = api_get_local_time($item['date']);
$item['start_date_tms'] = api_strtotime($item['date']); $item['start_date_tms'] = api_strtotime($item['date']);
$item['content'] = $item['text']; $item['content'] = $item['text'];
// we break the date field in the database into a date and a time part // we break the date field in the database into a date and a time part
$agenda_db_date = explode(" ", $item['date']); $agenda_db_date = explode(" ", $item['date']);
$date = $agenda_db_date[0]; $date = $agenda_db_date[0];
$time = $agenda_db_date[1]; $time = $agenda_db_date[1];
@ -662,18 +662,18 @@ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "
$day = intval($agendadate[2]); $day = intval($agendadate[2]);
// we divide the time part into hour, minutes, seconds // we divide the time part into hour, minutes, seconds
$agendatime = explode(":", $time); $agendatime = explode(":", $time);
$hour = $agendatime[0]; $hour = $agendatime[0];
$minute = $agendatime[1]; $minute = $agendatime[1];
$second = $agendatime[2]; $second = $agendatime[2];
if ($type == 'month_view') { if ($type == 'month_view') {
$item['calendar_type'] = 'personal'; $item['calendar_type'] = 'personal';
$item['start_date'] = $item['date']; $item['start_date'] = $item['date'];
$agendaitems[$day][] = $item; $agendaitems[$day][] = $item;
continue; continue;
} }
// if the student has specified a course we a add a link to that course // if the student has specified a course we a add a link to that course
if ($item['course'] <> "") { if ($item['course'] <> "") {
$url = api_get_path(WEB_CODE_PATH)."calendar/agenda.php?cidReq=".urlencode($item['course'])."&amp;day=$day&amp;month=$month&amp;year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item $url = api_get_path(WEB_CODE_PATH)."calendar/agenda.php?cidReq=".urlencode($item['course'])."&amp;day=$day&amp;month=$month&amp;year=$year#$day"; // RH //Patrick Cool: to highlight the relevant agenda item
@ -695,7 +695,7 @@ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "
if ($agendatime['1'] >= '30') { if ($agendatime['1'] >= '30') {
$halfhour = $halfhour +1; $halfhour = $halfhour +1;
} }
//Display events by list //Display events by list
$agendaitems[$halfhour] .= "<div><i>$time_minute</i> $course_link <a href=\"myagenda.php?action=view&amp;view=personal&amp;day=$day&amp;month=$month&amp;year=$year&amp;id=".$item['id']."#".$item['id']."\" class=\"personal_agenda\">".$item['title']."</a></div>"; $agendaitems[$halfhour] .= "<div><i>$time_minute</i> $course_link <a href=\"myagenda.php?action=view&amp;view=personal&amp;day=$day&amp;month=$month&amp;year=$year&amp;id=".$item['id']."#".$item['id']."\" class=\"personal_agenda\">".$item['title']."</a></div>";
} }
@ -748,16 +748,16 @@ function show_personal_agenda() {
// starting the table output // starting the table output
echo '<table class="data_table">'; echo '<table class="data_table">';
$th = Display::tag('th', get_lang('Title')); $th = Display::tag('th', get_lang('Title'));
$th .= Display::tag('th', get_lang('Content')); $th .= Display::tag('th', get_lang('Content'));
$th .= Display::tag('th', get_lang('StartTimeWindow')); $th .= Display::tag('th', get_lang('StartTimeWindow'));
$th .= Display::tag('th', get_lang('Modify')); $th .= Display::tag('th', get_lang('Modify'));
echo Display::tag('tr', $th); echo Display::tag('tr', $th);
if (Database::num_rows($result) > 0) { if (Database::num_rows($result) > 0) {
$counter = 0; $counter = 0;
while ($myrow = Database::fetch_array($result)) { while ($myrow = Database::fetch_array($result)) {
/* display: the month bar */ /* display: the month bar */
if ($month_bar != date("m", strtotime($myrow["date"])).date("Y", strtotime($myrow["date"]))) { if ($month_bar != date("m", strtotime($myrow["date"])).date("Y", strtotime($myrow["date"]))) {
@ -777,28 +777,28 @@ function show_personal_agenda() {
$class = 'row_even'; $class = 'row_even';
if ($counter % 2) { if ($counter % 2) {
$class = 'row_odd'; $class = 'row_odd';
} }
echo '<tr class="'.$class.'">'; echo '<tr class="'.$class.'">';
echo '<td>'; echo '<td>';
/* display: the title */ /* display: the title */
echo $myrow['title']; echo $myrow['title'];
echo "</td>"; echo "</td>";
// display: the content // display: the content
$content = $myrow['text']; $content = $myrow['text'];
echo "<td>"; echo "<td>";
echo $content; echo $content;
echo "</td>"; echo "</td>";
//display: date and time
//display: date and time
echo '<td>'; echo '<td>';
// adding an internal anchor // adding an internal anchor
/*echo "<a name=\"".$myrow["id"]."\"></a>"; /*echo "<a name=\"".$myrow["id"]."\"></a>";
echo date("d", strtotime($myrow["date"]))." ".$MonthsLong[date("n", strtotime($myrow["date"])) - 1]." ".date("Y", strtotime($myrow["date"]))."&nbsp;";*/ echo date("d", strtotime($myrow["date"]))." ".$MonthsLong[date("n", strtotime($myrow["date"])) - 1]." ".date("Y", strtotime($myrow["date"]))."&nbsp;";*/
$myrow["date"] = api_get_local_time($myrow["date"]); $myrow["date"] = api_get_local_time($myrow["date"]);
echo api_format_date($myrow["date"], DATE_TIME_FORMAT_LONG); echo api_format_date($myrow["date"], DATE_TIME_FORMAT_LONG);
echo "</td>"; echo "</td>";
@ -889,7 +889,7 @@ function show_simple_personal_agenda($user_id) {
/* /*
$content = $myrow['title']; $content = $myrow['title'];
$content = make_clickable($content); $content = make_clickable($content);
$content = text_filter($content);*/ */
return $content; return $content;
} }
} else { } else {

@ -48,7 +48,6 @@ $result = Database::query($sql);
while($row=Database::fetch_array($result)) { while($row=Database::fetch_array($result)) {
$row['content'] = $row['content']; $row['content'] = $row['content'];
$row['content'] = make_clickable($row['content']); $row['content'] = make_clickable($row['content']);
$row['content'] = text_filter($row['content']);
$row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']); $row['content'] = str_replace('<a ','<a target="_blank" ',$row['content']);
if(!empty($row['title'])) { if(!empty($row['title'])) {

@ -2,7 +2,7 @@
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Template (view in MVC pattern) used for listing course descriptions * Template (view in MVC pattern) used for listing course descriptions
* @author Christian Fasanando <christian1827@gmail.com> * @author Christian Fasanando <christian1827@gmail.com>
* @package chamilo.course_description * @package chamilo.course_description
*/ */
@ -49,30 +49,30 @@ $user_info = api_get_user_info();
if (isset($descriptions) && count($descriptions) > 0) { if (isset($descriptions) && count($descriptions) > 0) {
foreach ($descriptions as $id => $description) { foreach ($descriptions as $id => $description) {
echo '<div class="sectiontitle">'; echo '<div class="sectiontitle">';
if (api_is_allowed_to_edit(null,true) && !$history) { if (api_is_allowed_to_edit(null,true) && !$history) {
if (api_get_session_id() == $description['session_id']) { if (api_get_session_id() == $description['session_id']) {
$description['title'] = $description['title'].' '.api_get_session_image(api_get_session_id(), $user_info['status']); $description['title'] = $description['title'].' '.api_get_session_image(api_get_session_id(), $user_info['status']);
//delete //delete
echo '<a href="'.api_get_self().'?id='.$description['id'].'&cidReq='.api_get_course_id().'&id_session='.$description['session_id'].'&action=delete&description_type='.$description['description_type'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;">'; echo '<a href="'.api_get_self().'?id='.$description['id'].'&cidReq='.api_get_course_id().'&id_session='.$description['session_id'].'&action=delete&description_type='.$description['description_type'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;">';
echo Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL); echo Display::return_icon('delete.png', get_lang('Delete'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL);
echo '</a> '; echo '</a> ';
//edit //edit
echo '<a href="'.api_get_self().'?id='.$description['id'].'&cidReq='.api_get_course_id().'&id_session='.$description['session_id'].'&action=edit&description_type='.$description['description_type'].'">'; echo '<a href="'.api_get_self().'?id='.$description['id'].'&cidReq='.api_get_course_id().'&id_session='.$description['session_id'].'&action=edit&description_type='.$description['description_type'].'">';
echo Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align:middle;float:right; padding-right:4px;'),ICON_SIZE_SMALL); echo Display::return_icon('edit.png', get_lang('Edit'), array('style' => 'vertical-align:middle;float:right; padding-right:4px;'),ICON_SIZE_SMALL);
echo '</a> '; echo '</a> ';
} else { } else {
echo Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL); echo Display::return_icon('edit_na.png', get_lang('EditionNotAvailableFromSession'), array('style' => 'vertical-align:middle;float:right;'),ICON_SIZE_SMALL);
} }
} }
echo $description['title']; echo $description['title'];
echo '</div>'; echo '</div>';
echo '<div class="sectioncomment">'; echo '<div class="sectioncomment">';
echo text_filter($description['content']); echo $description['content'];
echo '</div>'; echo '</div>';
} }
} else { } else {

@ -254,7 +254,7 @@ if ($submitAnswers || $buttonBack) {
// we save the answer because it will be modified // we save the answer because it will be modified
//$temp=$reponse; //$temp=$reponse;
$temp = text_filter($reponse); $temp = $reponse;
/* // Deprecated code. /* // Deprecated code.
// 1. find everything between the [tex] and [/tex] tags // 1. find everything between the [tex] and [/tex] tags

@ -2736,7 +2736,7 @@ class Exercise {
} elseif($answerType==MATCHING) { } elseif($answerType==MATCHING) {
if ($origin != 'learnpath') { if ($origin != 'learnpath') {
echo '<tr>'; echo '<tr>';
echo '<td>'.text_filter($answer_matching[$answerId]).'</td><td>'.text_filter($user_answer).' / <b><span style="color: #008000;">'.text_filter($answer_matching[$answerCorrect]).'</span></b></td>'; echo '<td>'.$answer_matching[$answerId].'</td><td>'.$user_answer.' / <b><span style="color: #008000;">'.text_filter($answer_matching[$answerCorrect]).'</span></b></td>';
echo '</tr>'; echo '</tr>';
} }
} }

@ -76,11 +76,11 @@ class ScormQuestion extends Question
$this->answer->questionJSId = $this->js_id; $this->answer->questionJSId = $this->js_id;
break; break;
case HOT_SPOT_ORDER: case HOT_SPOT_ORDER:
$this->answer = new ScormAnswerHotspot($this->id); $this->answer = new ScormAnswerHotspot($this->id);
$this->answer->questionJSId = $this->js_id; $this->answer->questionJSId = $this->js_id;
break; break;
case HOT_SPOT_DELINEATION: case HOT_SPOT_DELINEATION:
$this->answer = new ScormAnswerHotspot($this->id); $this->answer = new ScormAnswerHotspot($this->id);
$this->answer->questionJSId = $this->js_id; $this->answer->questionJSId = $this->js_id;
break; break;
default : default :
@ -124,12 +124,12 @@ class ScormQuestion extends Question
$cols = 2; $cols = 2;
$s='<tr>' . $s='<tr>' .
'<td colspan="'.$cols.'" id="question_'.$this->id.'_title" valign="middle" style="background-color:#d6d6d6;">' . "\n" . '<td colspan="'.$cols.'" id="question_'.$this->id.'_title" valign="middle" style="background-color:#d6d6d6;">' . "\n" .
text_filter($title). $title.
'</td>' . "\n" . '</td>' . "\n" .
'</tr>' . "\n" . '</tr>' . "\n" .
'<tr>' . "\n" . '<tr>' . "\n" .
'<td valign="top" colspan="'.$cols.'">' . "\n" . '<td valign="top" colspan="'.$cols.'">' . "\n" .
'<i>'.text_filter($description).'</i>' . "\n" . '<i>'.$description.'</i>' . "\n" .
'</td>' . "\n" . '</td>' . "\n" .
'</tr>' . "\n"; '</tr>' . "\n";
return $s; return $s;
@ -442,12 +442,9 @@ class ScormAnswerMatching extends Answer
// options (A, B, C, ...) that will be put into the list-box // options (A, B, C, ...) that will be put into the list-box
$Select[$answerId]['Lettre']=$cpt1; $Select[$answerId]['Lettre']=$cpt1;
// answers that will be shown at the right side // answers that will be shown at the right side
$answer = text_filter($answer); $Select[$answerId]['Reponse'] = $answer;
$Select[$answerId]['Reponse']=$answer;
$cpt1++; $cpt1++;
} } else {
else
{
$s.='<tr>'."\n"; $s.='<tr>'."\n";
$s.='<td width="40%" valign="top">'."\n".'<b>'.$cpt2.'</b>.&nbsp;'.$answer."\n</td>\n"; $s.='<td width="40%" valign="top">'."\n".'<b>'.$cpt2.'</b>.&nbsp;'.$answer."\n</td>\n";
$s.='<td width="20%" align="center">&nbsp;&nbsp;<select name="'.$identifier.$cpt2.'" id="'.$identifier.$cpt2.'">'; $s.='<td width="20%" align="center">&nbsp;&nbsp;<select name="'.$identifier.$cpt2.'" id="'.$identifier.$cpt2.'">';

@ -189,7 +189,6 @@ abstract class Question
* @return - string - question title * @return - string - question title
*/ */
function selectTitle() { function selectTitle() {
$this->question=text_filter($this->question);
return $this->question; return $this->question;
} }

@ -2660,7 +2660,7 @@ class CourseManager {
$data .= $description->title; $data .= $description->title;
$data .= '</div>'; $data .= '</div>';
$data .= '<div class="sectioncomment">'; $data .= '<div class="sectioncomment">';
$data .= text_filter($description->content); $data .= $description->content;
$data .= '</div>'; $data .= '</div>';
} }
} else { } else {

Loading…
Cancel
Save