[svn r20441] FS#306 - Platform administrator's tool: Improvements for better encoding management (UTF-8 too).

skala
Ivan Tcholakov 17 years ago
parent c7631d1d5f
commit 5d9b08f8a1
  1. 2
      main/admin/access_url_edit_courses_to_url.php
  2. 2
      main/admin/access_url_edit_sessions_to_url.php
  3. 2
      main/admin/access_url_edit_users_to_url.php
  4. 4
      main/admin/access_urls.php
  5. 4
      main/admin/add_courses_to_session.php
  6. 1402
      main/admin/add_users_to_session.php
  7. 6
      main/admin/calendar.lib.php
  8. 4
      main/admin/calendar_view_print.php
  9. 6
      main/admin/class_list.php
  10. 12
      main/admin/configure_homepage.php
  11. 6
      main/admin/course_add.php
  12. 10
      main/admin/course_category.php
  13. 6
      main/admin/course_edit.php
  14. 2
      main/admin/course_import.php
  15. 4
      main/admin/course_list.php
  16. 8
      main/admin/course_virtual.php
  17. 8
      main/admin/index.php
  18. 4
      main/admin/ldap_import_students.php
  19. 4
      main/admin/ldap_import_students_to_session.php
  20. 8
      main/admin/session_add.php
  21. 4
      main/admin/session_course_edit.php
  22. 8
      main/admin/session_course_list.php
  23. 12
      main/admin/session_course_user_list.php
  24. 8
      main/admin/session_edit.php
  25. 6
      main/admin/session_export.php
  26. 70
      main/admin/session_import.php
  27. 10
      main/admin/session_list.php
  28. 18
      main/admin/settings.php
  29. 2
      main/admin/specific_fields.php
  30. 6
      main/admin/statistics/statistics.lib.php
  31. 6
      main/admin/subscribe_class2course.php
  32. 4
      main/admin/system_announcements.php
  33. 4
      main/admin/user_add.php
  34. 4
      main/admin/user_fields.php
  35. 8
      main/admin/user_import.php
  36. 6
      main/admin/user_list.php

@ -98,7 +98,7 @@ function search_courses($needle, $id)
}
}
}
$xajax_response -> addAssign('ajax_list_courses','innerHTML',utf8_encode($return));
$xajax_response -> addAssign('ajax_list_courses','innerHTML',api_utf8_encode($return));
return $xajax_response;
}

@ -95,7 +95,7 @@ function search_sessions($needle, $id)
}
}
}
$xajax_response -> addAssign('ajax_list_courses','innerHTML',utf8_encode($return));
$xajax_response -> addAssign('ajax_list_courses','innerHTML',api_utf8_encode($return));
return $xajax_response;
}

@ -99,7 +99,7 @@ function search_users($needle, $id)
}
}
}
$xajax_response -> addAssign('ajax_list_users','innerHTML',utf8_encode($return));
$xajax_response -> addAssign('ajax_list_users','innerHTML',api_utf8_encode($return));
return $xajax_response;
}

@ -167,7 +167,7 @@ function modify_filter($active, $url_params, $row) {
$url_id = $row['0'];
$result .= '<a href="access_url_edit.php?url_id='.$url_id.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>&nbsp;';
if ($url_id != '1') {
$result .= '<a href="access_urls.php?action=delete_url&amp;url_id='.$url_id.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
$result .= '<a href="access_urls.php?action=delete_url&amp;url_id='.$url_id.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
}
return $result;
}
@ -205,4 +205,4 @@ function url_count_mask() {
==============================================================================
*/
Display :: display_footer();
?>
?>

@ -87,7 +87,7 @@ function search_courses($needle,$type)
if(!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset');
$needle = mb_convert_encoding($needle, $charset, 'utf-8');
$needle = api_convert_encoding($needle, $charset, 'utf-8');
$cond_course_code = '';
if (!empty($id_session)) {
@ -168,7 +168,7 @@ function search_courses($needle,$type)
}
$return .= '</select>';
$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',utf8_encode($return));
$xajax_response -> addAssign('ajax_list_courses_multiple','innerHTML',api_utf8_encode($return));
}
}
$_SESSION['course_list'] = $course_list;

File diff suppressed because it is too large Load Diff

@ -870,7 +870,7 @@ function display_agenda_items()
echo '<a href="'.$mylink.'&amp;action=edit&amp;title="'.get_lang("ModifyCalendarItem").'">';
echo Display::return_icon('edit.gif', get_lang('ModifyCalendarItem'))."</a>";
echo "<a href=\"".$mylink."&amp;action=delete\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."')) return false;\" title=\"".get_lang("Delete")."\"> ";
echo "<a href=\"".$mylink."&amp;action=delete\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."')) return false;\" title=\"".get_lang("Delete")."\"> ";
echo Display::return_icon('delete.gif', get_lang('Delete'))."</a>";
}
@ -919,7 +919,7 @@ function display_agenda_items()
echo ' "> '.$user_filename.' </a>';
echo '<span class="forum_attach_comment" >'.$attachment_list['comment'].'</span>';
if (api_is_allowed_to_edit()) {
echo '&nbsp;&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;origin='.Security::remove_XSS($_GET['origin']).'&amp;action=delete_attach&amp;id_attach='.$attachment_list['id'].'" onclick="javascript:if(!confirm(\''.addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a><br />';
echo '&nbsp;&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;origin='.Security::remove_XSS($_GET['origin']).'&amp;action=delete_attach&amp;id_attach='.$attachment_list['id'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a><br />';
}
}
@ -1136,7 +1136,7 @@ function display_one_agenda_item($agenda_id)
$mylink = api_get_self()."?".api_get_cidreq()."&amp;origin=".Security::remove_XSS($_GET['origin'])."&amp;id=".$myrow['id'];
echo "<a href=\"".$mylink."&amp;action=edit\">",
Display::return_icon('edit.gif', get_lang('ModifyCalendarItem')), "</a>",
"<a href=\"".$mylink."&amp;action=delete\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."')) return false;\">",
"<a href=\"".$mylink."&amp;action=delete\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."')) return false;\">",
Display::return_icon('delete.gif', get_lang('Delete')),"</a>";
if ($myrow['visibility']==1) {
$image_visibility="visible";

@ -63,7 +63,7 @@ $result = api_sql_query($sql,__FILE__,__LINE__);
<body style="margin: 15px; padding: 0px;">
<center>
<input type="button" value="<?php echo htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
<input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
</center>
<br /><br />
@ -100,7 +100,7 @@ while($row=Database::fetch_array($result))
<br /><br />
<center>
<input type="button" value="<?php echo htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
<input type="button" value="<?php echo api_htmlentities(get_lang('Print'),ENT_QUOTES,$charset); ?>" onClick="javascript:window.print();" />
</center>
</body>

@ -1,5 +1,5 @@
<?php
// $Id: class_list.php 16954 2008-11-26 14:41:35Z pcool $
// $Id: class_list.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -89,7 +89,7 @@ function modify_filter($class_id)
$class_id = Security::remove_XSS($class_id);
$result = '<a href="class_information.php?id='.$class_id.'">'.Display::return_icon('synthese_view.gif', get_lang('Info')).'</a>';
$result .= '<a href="class_edit.php?idclass='.$class_id.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
$result .= '<a href="class_list.php?action=delete_class&amp;class_id='.$class_id.'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
$result .= '<a href="class_list.php?action=delete_class&amp;class_id='.$class_id.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
$result .= '<a href="subscribe_user2class.php?idclass='.$class_id.'">'.Display::return_icon('add_multiple_users.gif', get_lang('AddUsersToAClass')).'</a>';
return $result;
}
@ -153,4 +153,4 @@ $table->display();
==============================================================================
*/
Display :: display_footer();
?>
?>

@ -1,4 +1,4 @@
<?php // $Id: configure_homepage.php 19639 2009-04-08 13:06:16Z pcool $
<?php // $Id: configure_homepage.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
===== =========================================================================
Dokeos - elearning and course management software
@ -667,11 +667,11 @@ switch($action){
<tr><td colspan="2"><?php echo '<span style="font-style: italic;">'.get_lang('LetThoseFieldsEmptyToHideTheNotice').'</span>'; ?></tr>
<tr>
<td nowrap="nowrap"><?php echo get_lang('NoticeTitle'); ?> :</td>
<td><input type="text" name="notice_title" size="30" maxlength="50" value="<?php echo htmlentities($notice_title,ENT_QUOTES,$charset); ?>" style="width: 350px;"/></td>
<td><input type="text" name="notice_title" size="30" maxlength="50" value="<?php echo api_htmlentities($notice_title,ENT_QUOTES,$charset); ?>" style="width: 350px;"/></td>
</tr>
<tr>
<td nowrap="nowrap" valign="top"><?php echo get_lang('NoticeText'); ?> :</td>
<td><textarea name="notice_text" cols="30" rows="5" wrap="virtual" style="width: 350px;"><?php echo htmlentities($notice_text,ENT_QUOTES,$charset); ?></textarea></td>
<td><textarea name="notice_text" cols="30" rows="5" wrap="virtual" style="width: 350px;"><?php echo api_htmlentities($notice_text,ENT_QUOTES,$charset); ?></textarea></td>
</tr>
<tr>
<td>&nbsp;</td>
@ -705,12 +705,12 @@ switch($action){
$form->addElement('hidden', 'filename', $action == 'edit_link' ? $filename : '');
$form->addElement('html', '<tr><td nowrap="nowrap" style="width: 15%;">'.get_lang('LinkName').' :</td><td>');
$default['link_name'] = htmlentities($link_name, ENT_QUOTES, $charset);
$default['link_name'] = api_htmlentities($link_name, ENT_QUOTES, $charset);
$form->addElement('text', 'link_name', get_lang('LinkName'), array('size' => '30', 'maxlength' => '50'));
$form->addElement('html', '</td></tr>');
$form->addElement('html', '<tr><td nowrap="nowrap">'.get_lang('LinkURL').' ('.get_lang('Optional').') :</td><td>');
$default['link_url'] = empty($link_url) ? 'http://' : htmlentities($link_url, ENT_QUOTES, $charset);
$default['link_url'] = empty($link_url) ? 'http://' : api_htmlentities($link_url, ENT_QUOTES, $charset);
$form->addElement('text', 'link_url', get_lang('LinkName'), array('size' => '30', 'maxlength' => '100', 'style' => 'width: 350px;'));
$form->addElement('html', '</td></tr>');
@ -956,7 +956,7 @@ switch($action){
if(!empty($enreg))
{
$edit_link='<a href="'.api_get_self().'?action=edit_link&amp;link_index='.$key.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>';
$delete_link='<a href="'.api_get_self().'?action=delete_link&amp;link_index='.$key.'" onclick="javascript:if(!confirm(\''.addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
$delete_link='<a href="'.api_get_self().'?action=delete_link&amp;link_index='.$key.'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
echo str_replace(array('href="'.api_get_path(WEB_PATH).'index.php?include=','</li>'),array('href="'.api_get_path(WEB_CODE_PATH).'admin/'.basename(api_get_self()).'?action=open_link&link=','<br />'.$edit_link.' '.$delete_link.'</li>'),$enreg);
}

@ -1,5 +1,5 @@
<?php
// $Id: course_add.php 20157 2009-04-28 20:21:17Z juliomontoya $
// $Id: course_add.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -87,7 +87,7 @@ $maxlength = 40 - $dbnamelength;
$form = new FormValidator('update_course');
$form->addElement('header', '', $tool_name);
$form->add_textfield( 'visual_code', get_lang('CourseCode'),false,array('size'=>'20','maxlength'=>20));
$form->applyFilter('visual_code','strtoupper');
$form->applyFilter('visual_code','api_strtoupper');
$form->applyFilter('visual_code','html_filter');
$form->addRule('wanted_code',get_lang('Max'),'maxlength',$maxlength);
@ -166,7 +166,7 @@ if( $form->validate()) {
$department_url = 'http://'.$department_url;
}
if(trim($code) == ''){
$code = generate_course_code(substr($title,0,$maxlength));
$code = generate_course_code(api_substr($title,0,$maxlength));
}
$keys = define_course_keys($code, "", $_configuration['db_prefix']);
if (sizeof($keys))

@ -1,4 +1,4 @@
<?php // $Id: course_category.php 19597 2009-04-07 14:38:36Z pcool $
<?php // $Id: course_category.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -182,11 +182,11 @@ if($action == 'add' || $action == 'edit')
<tr>
<td nowrap="nowrap"><?php echo get_lang("CategoryCode"); ?> :</td>
<td><input type="text" name="categoryCode" size="20" maxlength="20" value="<?php echo htmlentities(stripslashes($categoryCode),ENT_QUOTES,$charset); ?>" /></td>
<td><input type="text" name="categoryCode" size="20" maxlength="20" value="<?php echo api_htmlentities(stripslashes($categoryCode),ENT_QUOTES,$charset); ?>" /></td>
</tr>
<tr>
<td nowrap="nowrap"><?php echo get_lang("CategoryName"); ?> :</td>
<td><input type="text" name="categoryName" size="20" maxlength="100" value="<?php echo htmlentities(stripslashes($categoryName),ENT_QUOTES,$charset); ?>" /></td>
<td><input type="text" name="categoryName" size="20" maxlength="100" value="<?php echo api_htmlentities(stripslashes($categoryName),ENT_QUOTES,$charset); ?>" /></td>
</tr>
<tr>
<td nowrap="nowrap"><?php echo get_lang("AllowCoursesInCategory"); ?></td>
@ -248,7 +248,7 @@ if(count($Categories)>0)
<li>
<a href="<?php echo api_get_self(); ?>?category=<?php echo Security::remove_XSS($enreg['code']); ?>"><?php Display::display_icon('folder_document.gif', get_lang('OpenNode')); ?></a>
<a href="<?php echo api_get_self(); ?>?category=<?php echo Security::remove_XSS($category); ?>&amp;action=edit&amp;id=<?php echo Security::remove_XSS($enreg['code']); ?>"><?php Display::display_icon('edit.gif', get_lang('EditNode')); ?></a>
<a href="<?php echo api_get_self(); ?>?category=<?php echo Security::remove_XSS($category); ?>&amp;action=delete&amp;id=<?php echo Security::remove_XSS($enreg['code']); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;"><?php Display::display_icon('delete.gif', get_lang('DeleteNode'));?></a>
<a href="<?php echo api_get_self(); ?>?category=<?php echo Security::remove_XSS($category); ?>&amp;action=delete&amp;id=<?php echo Security::remove_XSS($enreg['code']); ?>" onclick="javascript:if(!confirm('<?php echo addslashes(api_htmlentities(get_lang('ConfirmYourChoice'),ENT_QUOTES,$charset)); ?>')) return false;"><?php Display::display_icon('delete.gif', get_lang('DeleteNode'));?></a>
<a href="<?php echo api_get_self(); ?>?category=<?php echo Security::remove_XSS($category); ?>&amp;action=moveUp&amp;id=<?php echo Security::remove_XSS($enreg['code']); ?>&amp;tree_pos=<?php echo $enreg['tree_pos']; ?>"><?php Display::display_icon('up.gif', get_lang('UpInSameLevel'));?></a>
<?php echo $enreg['name']; ?>
(<?php echo $enreg['children_count']; ?> <?php echo get_lang("Categories"); ?> - <?php echo $enreg['nbr_courses']; ?> <?php echo get_lang("Courses"); ?>)
@ -413,4 +413,4 @@ function compterFils($pere,$cpt)
return ($cpt+1);
}
?>
?>

@ -1,4 +1,4 @@
<?php // $Id: course_edit.php 20157 2009-04-28 20:21:17Z juliomontoya $
<?php // $Id: course_edit.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -165,7 +165,7 @@ $form->addElement('style_submit_button', 'button', get_lang('ModifyCourseInfo'),
// Set some default values
$course_db_name = $course['db_name'];
$course['title']=html_entity_decode($course['title'],ENT_QUOTES,$charset);
$course['title']=api_html_entity_decode($course['title'],ENT_QUOTES,$charset);
$form->setDefaults($course);
// Validate form
if( $form->validate())
@ -332,4 +332,4 @@ $form->display();
==============================================================================
*/
Display :: display_footer();
?>
?>

@ -54,7 +54,7 @@ function validate_data($courses) {
if (isset ($coursecodes[$course['Code']])) {
$course['error'] = get_lang('CodeTwiceInFile');
$errors[] = $course;
} elseif (strlen(($course['Code']) > $maxlength)) {
} elseif (api_strlen(($course['Code']) > $maxlength)) {
$course['error'] = get_lang('Max');
$errors[] = $course;
}

@ -1,4 +1,4 @@
<?php // $Id: course_list.php 19995 2009-04-22 20:32:11Z iflorespaz $
<?php // $Id: course_list.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/* For licensing terms, see /dokeos_license.txt */
/**
* This script shows a list of courses and allows searching for courses codes
@ -135,7 +135,7 @@ function modify_filter($code)
'<a href="../tracking/courseLog.php?cidReq='.$code.'">'.Display::return_icon('statistics.gif', get_lang('Tracking')).'</a>&nbsp;'.
'<a href="course_edit.php?course_code='.$code.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>&nbsp;'.
'<a href="course_list.php?delete_course='.$code.'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
'<a href="course_list.php?delete_course='.$code.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
}
/**
* Return an icon representing the visibility of the course

@ -1,4 +1,4 @@
<?php // $Id: course_virtual.php 12272 2007-05-03 14:40:45Z elixir_julian $
<?php // $Id: course_virtual.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -188,6 +188,8 @@ function display_real_course_code_select($element_name)
function display_create_virtual_course_form()
{
global $charset;
$category_table = Database::get_main_table(TABLE_MAIN_CATEGORY);
$message = make_strong(get_lang('AdminCreateVirtualCourse')) . "<br/>" . get_lang('AdminCreateVirtualCourseExplanation') . "<br/>This feature is in development phase, bug reports welcome.";
@ -254,7 +256,7 @@ function display_create_virtual_course_form()
<td>
<?php
display_real_course_code_select(REAL_COURSE_SELECT_FORM_NAME);
//echo "<input type=\"Text\" name=\"real_course_code\" maxlength=\"".FORM_ELEMENT_CODE_SIZE."\" value=\"" . htmlentities($valueTitular) . "\"/>";
//echo "<input type=\"Text\" name=\"real_course_code\" maxlength=\"".FORM_ELEMENT_CODE_SIZE."\" value=\"" . api_htmlentities($valueTitular, ENT_COMPAT, $charset) . "\"/>";
?>
</td>
</tr>
@ -421,4 +423,4 @@ switch($action)
==============================================================================
*/
Display::display_footer();
?>
?>

@ -1,4 +1,4 @@
<?php // $Id: index.php 20155 2009-04-28 19:19:31Z cfasanando $
<?php // $Id: index.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -126,7 +126,7 @@ if(api_is_platform_admin()) {
</button>
</form></li>
<li>
<a href="course_list.php?search=advanced"><?php echo ucfirst(get_lang('AdvancedSearch')); ?></a>
<a href="course_list.php?search=advanced"><?php echo api_ucfirst(get_lang('AdvancedSearch')); ?></a>
</li>
<li><a href="course_list.php"><?php echo get_lang('CourseList') ?></a></li>
@ -199,7 +199,7 @@ else if(api_is_platform_admin())
?>
<div class="admin_section">
<h4><?php Display::display_icon('group.gif', get_lang('AdminClasses')); ?> <?php echo ucfirst(get_lang('AdminClasses')); ?></h4>
<h4><?php Display::display_icon('group.gif', get_lang('AdminClasses')); ?> <?php echo api_ucfirst(get_lang('AdminClasses')); ?></h4>
<ul>
<li style="list-style-type:none"><form method="get" action="class_list.php">
@ -228,7 +228,7 @@ if(api_is_platform_admin()){
<div class="admin_section">
<h4><?php Display::display_icon('visio_meeting.gif', get_lang('ConfigureExtensions')); ?> <?php echo ucfirst(get_lang('ConfigureExtensions')); ?></h4>
<h4><?php Display::display_icon('visio_meeting.gif', get_lang('ConfigureExtensions')); ?> <?php echo api_ucfirst(get_lang('ConfigureExtensions')); ?></h4>
<ul>
<li><a href="configure_extensions.php?display=visio"><?php echo get_lang('Visioconf'); ?></a></li>
<li><a href="configure_extensions.php?display=ppt2lp"><?php echo get_lang('Ppt2lp'); ?></a></li>

@ -223,7 +223,7 @@ elseif(!empty($annee) && empty($course))
$courses = CourseManager::get_courses_list();
foreach($courses as $row)
{
echo '<option value="'.$row['code'].'">'.htmlentities($row['title']).'</option>';
echo '<option value="'.$row['code'].'">'.api_htmlentities($row['title'], ENT_COMPAT, api_get_system_encoding()).'</option>';
}
echo '</select>';
echo '<input type="submit" value="'.get_lang('Submit').'">';
@ -337,4 +337,4 @@ elseif (!empty($annee) && !empty($course) && ($_POST['confirmed']=='yes'))
echo '<br /><br />';
}
Display::display_footer();
?>
?>

@ -98,7 +98,7 @@ elseif(!empty($annee) && empty($id_session))
$nbr_results=count($sessions);
foreach($sessions as $row)
{
echo '<option value="'.$row['id'].'">'.htmlentities($row['name']).' ('.$row['date_start'].' - '.$row['date_end'].')</option>';
echo '<option value="'.$row['id'].'">'.api_htmlentities($row['name'], ENT_COMPAT, api_get_system_encoding()).' ('.$row['date_start'].' - '.$row['date_end'].')</option>';
}
echo '</select>';
echo '<input type="submit" value="'.get_lang('Submit').'">';
@ -227,4 +227,4 @@ elseif (!empty($annee) && !empty($id_session) && ($_POST['confirmed']=='yes'))
echo '<br /><br />';
}
Display::display_footer();
?>
?>

@ -67,7 +67,7 @@ function search_coachs($needle)
{
// xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset');
$needle = mb_convert_encoding($needle, $charset, 'utf-8');
$needle = api_convert_encoding($needle, $charset, 'utf-8');
// search users where username or firstname or lastname begins likes $needle
$sql = 'SELECT username, lastname, firstname FROM '.$tbl_user.' user
@ -101,7 +101,7 @@ function search_coachs($needle)
$return .= '<a href="#" onclick="fill_coach_field(\''.$user['username'].'\')">'.$user['lastname'].' '.$user['firstname'].' ('.$user['username'].')</a><br />';
}
}
$xajax_response -> addAssign('ajax_list_coachs','innerHTML',utf8_encode($return));
$xajax_response -> addAssign('ajax_list_coachs','innerHTML',api_utf8_encode($return));
return $xajax_response;
}
$xajax -> processRequests();
@ -167,7 +167,7 @@ if (!empty($return)) {
<table border="0" cellpadding="5" cellspacing="0" width="550">
<tr>
<td width="30%"><?php echo get_lang('SessionName') ?>&nbsp;&nbsp;</td>
<td width="70%"><input type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo htmlentities($name,ENT_QUOTES,$charset); ?>"></td>
<td width="70%"><input type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); ?>"></td>
</tr>
<tr>
<td width="30%"><?php echo get_lang('CoachName') ?>&nbsp;&nbsp;</td>
@ -384,4 +384,4 @@ function setDisable(select) {
</script>
<?php
Display::display_footer();
?>
?>

@ -34,7 +34,7 @@ $tool_name=$course_info['name'];
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => "session_list.php","name" => get_lang("SessionList"));
$interbreadcrumb[]=array('url' => "../admin/resume_session.php?id_session=".Security::remove_XSS($_REQUEST['id_session']),"name" => get_lang('SessionOverview'));
$interbreadcrumb[]=array('url' => "session_course_list.php?id_session=$id_session","name" =>htmlentities($session_name,ENT_QUOTES,$charset));
$interbreadcrumb[]=array('url' => "session_course_list.php?id_session=$id_session","name" =>api_htmlentities($session_name,ENT_QUOTES,$charset));
$result=api_sql_query("SELECT name,title FROM $tbl_session_course,$tbl_session,$tbl_course WHERE id_session=id AND course_code=code AND id_session='$id_session' AND course_code='".addslashes($course_code)."'",__FILE__,__LINE__);
@ -132,4 +132,4 @@ unset($coaches);
<?php
Display::display_footer();
?>
?>

@ -59,7 +59,7 @@ $Courses=api_store_result($result);
$nbr_results=sizeof($Sessions);
$tool_name = htmlentities($session_name,ENT_QUOTES,$charset).' : '.get_lang('CourseListInSession');
$tool_name = api_htmlentities($session_name,ENT_QUOTES,$charset).' : '.get_lang('CourseListInSession');
$interbreadcrumb[]=array('url' => 'index.php',"name" => get_lang('PlatformAdmin'));
$interbreadcrumb[]=array('url' => "session_list.php","name" => get_lang('SessionList'));
@ -89,10 +89,10 @@ foreach($Courses as $key=>$enreg)
{
$course = array();
$course[] = '<input type="checkbox" name="idChecked[]" value="'.$enreg['code'].'">';
$course[] = htmlentities($enreg['title'],ENT_QUOTES,$charset);
$course[] = api_htmlentities($enreg['title'],ENT_QUOTES,$charset);
$course[] = '<a href="session_course_user_list.php?id_session='.$id_session.'&course_code='.$enreg['code'].'">'.$enreg['nbr_users'].' '.get_lang('Users').'</a>';
$course[] = '<a href="session_course_edit.php?id_session='.$id_session.'&page=session_course_list.php&course_code='.$enreg['code'].'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>
<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['code'].'" onclick="javascript:if(!confirm(\''.addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
<a href="'.api_get_self().'?id_session='.$id_session.'&sort='.$sort.'&action=delete&idChecked[]='.$enreg['code'].'" onclick="javascript:if(!confirm(\''.addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset)).'\')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
$tableCourses[] = $course;
}
echo '<form method="post" action="'.api_get_self().'">';
@ -108,4 +108,4 @@ echo '
<?php
Display::display_footer();
?>
?>

@ -54,11 +54,11 @@ $Users=api_store_result($result);
$nbr_results=sizeof($Users);
$tool_name = get_lang('ListOfUsersSubscribedToCourse').' &quot;'.htmlentities($course_title,ENT_QUOTES,$charset).'&quot; '.get_lang('ForTheSession').' &quot;'.htmlentities($session_name,ENT_QUOTES,$charset).'&quot;';
$tool_name = get_lang('ListOfUsersSubscribedToCourse').' &quot;'.api_htmlentities($course_title,ENT_QUOTES,$charset).'&quot; '.get_lang('ForTheSession').' &quot;'.api_htmlentities($session_name,ENT_QUOTES,$charset).'&quot;';
$interbredcrump[]=array("url" => "index.php","name" => get_lang('AdministrationTools'));
$interbredcrump[]=array("url" => "session_list.php","name" => get_lang('SessionList'));
$interbredcrump[]=array("url" => "session_course_list.php?id_session=$id_session","name" => get_lang('ListOfCoursesOfSession')." &quot;".htmlentities($session_name,ENT_QUOTES,$charset)."&quot;");
$interbredcrump[]=array("url" => "session_course_list.php?id_session=$id_session","name" => get_lang('ListOfCoursesOfSession')." &quot;".api_htmlentities($session_name,ENT_QUOTES,$charset)."&quot;");
Display::display_header($tool_name);
@ -129,9 +129,9 @@ foreach($Users as $key=>$enreg)
<tr class="<?php echo $i?'row_odd':'row_even'; ?>">
<td><input type="checkbox" name="idChecked[]" value="<?php echo $enreg['user_id']; ?>"></td>
<td><?php echo htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
<td><?php echo htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td>
<td><?php echo htmlentities($enreg['username'],ENT_QUOTES,$charset); ?></td>
<td><?php echo api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
<td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset); ?></td>
<td><?php echo api_htmlentities($enreg['username'],ENT_QUOTES,$charset); ?></td>
<td>
<a href="<?php echo api_get_self(); ?>?id_session=<?php echo $id_session; ?>&course_code=<?php echo urlencode($course_code); ?>&sort=<?php echo $sort; ?>&action=delete&idChecked[]=<?php echo $enreg['user_id']; ?>" onclick="javascript:if(!confirm('<?php echo get_lang('ConfirmYourChoice'); ?>')) return false;"><?php Display::display_icon('delete.gif', get_lang('Delete')); ?></a>
</td>
@ -197,4 +197,4 @@ else
<?php
Display::display_footer();
?>
?>

@ -116,7 +116,7 @@ if (!empty($return)) {
<tr>
<td width="30%"><?php echo get_lang('SessionName') ?>&nbsp;&nbsp;</td>
<td width="70%"><input type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo htmlentities($name,ENT_QUOTES,$charset); else echo htmlentities($infos['name'],ENT_QUOTES,$charset); ?>"></td>
<td width="70%"><input type="text" name="name" size="50" maxlength="50" value="<?php if($formSent) echo api_htmlentities($name,ENT_QUOTES,$charset); else echo api_htmlentities($infos['name'],ENT_QUOTES,$charset); ?>"></td>
</tr>
<tr>
<td width="30%"><?php echo get_lang('CoachName') ?>&nbsp;&nbsp;</td>
@ -301,8 +301,8 @@ for($i=$thisYear-5;$i <= ($thisYear+5);$i++)
?>
;" id="options">
<br>
<input type="text" name="nb_days_access_before" value="<?php if($formSent) echo htmlentities($nb_days_access_before,ENT_QUOTES,$charset); else echo htmlentities($infos['nb_days_access_before_beginning'],ENT_QUOTES,$charset); ?>" style="width: 30px;">&nbsp;<?php echo get_lang('DaysBefore') ?><br>
<input type="text" name="nb_days_access_after" value="<?php if($formSent) echo htmlentities($nb_days_access_after,ENT_QUOTES,$charset); else echo htmlentities($infos['nb_days_access_after_end'],ENT_QUOTES,$charset); ?>" style="width: 30px;">&nbsp;<?php echo get_lang('DaysAfter') ?>
<input type="text" name="nb_days_access_before" value="<?php if($formSent) echo api_htmlentities($nb_days_access_before,ENT_QUOTES,$charset); else echo api_htmlentities($infos['nb_days_access_before_beginning'],ENT_QUOTES,$charset); ?>" style="width: 30px;">&nbsp;<?php echo get_lang('DaysBefore') ?><br>
<input type="text" name="nb_days_access_after" value="<?php if($formSent) echo api_htmlentities($nb_days_access_after,ENT_QUOTES,$charset); else echo api_htmlentities($infos['nb_days_access_after_end'],ENT_QUOTES,$charset); ?>" style="width: 30px;">&nbsp;<?php echo get_lang('DaysAfter') ?>
<br>
</div>
</td>
@ -337,4 +337,4 @@ function setDisable(select){
</script>
<?php
Display::display_footer();
?>
?>

@ -168,7 +168,7 @@ if($_POST['formSent'] )
}
}
if(!empty($users) && $cvs)
$users = substr($users , 0, strlen($users)-1);
$users = api_substr($users , 0, api_strlen($users)-1);
if($cvs)
$users .= ';';
@ -216,7 +216,7 @@ if($_POST['formSent'] )
}
if($cvs){
if(!empty($userscourse))
$userscourse = substr($userscourse , 0, strlen($userscourse)-1);
$userscourse = api_substr($userscourse , 0, api_strlen($userscourse)-1);
$courses .= $userscourse.']|';
}
@ -225,7 +225,7 @@ if($_POST['formSent'] )
}
}
if(!empty($courses) && $cvs)
$courses = substr($courses , 0, strlen($courses)-1);
$courses = api_substr($courses , 0, api_strlen($courses)-1);
$add .= $courses;

@ -1,4 +1,4 @@
<?php // $Id: session_import.php 20373 2009-05-06 19:54:44Z juliomontoya $
<?php // $Id: session_import.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -61,11 +61,11 @@ if ($_POST['formSent']) {
//Creating - updating users
// from the <Sessions> <User> racine
foreach($racine->Users->User as $userNode) {
$username = mb_convert_encoding($userNode->Username,$charset,'utf-8');
$username = api_convert_encoding($userNode->Username,$charset,'utf-8');
$isCut = 0; // if the username given is too long
if(strlen($username)>20) {
if(api_strlen($username)>20) {
$user_name_dist = $username;
$username = substr($username,0,20);
$username = api_substr($username,0,20);
$isCut = 1;
}
$user_exist = UserManager::is_username_available($username);
@ -73,16 +73,16 @@ if ($_POST['formSent']) {
if ($isCut) {
$errorMsg .= get_lang('UsernameTooLongWasCut').' '.get_lang('From').' '.$user_name_dist.' '.get_lang('To').' '.$username.' <br />';
}
$lastname = mb_convert_encoding($userNode->Lastname,$charset,'utf-8');
$firstname = mb_convert_encoding($userNode->Firstname,$charset,'utf-8');
$password = mb_convert_encoding($userNode->Password,$charset,'utf-8');
$lastname = api_convert_encoding($userNode->Lastname,$charset,'utf-8');
$firstname = api_convert_encoding($userNode->Firstname,$charset,'utf-8');
$password = api_convert_encoding($userNode->Password,$charset,'utf-8');
if(empty($password)) {
$password = base64_encode(rand(1000,10000));
}
$email = mb_convert_encoding($userNode->Email,$charset,'utf-8');
$official_code = mb_convert_encoding($userNode->OfficialCode,$charset,'utf-8');
$phone = mb_convert_encoding($userNode->Phone,$charset,'utf-8');
$status = mb_convert_encoding($userNode->Status,$charset,'utf-8');
$email = api_convert_encoding($userNode->Email,$charset,'utf-8');
$official_code = api_convert_encoding($userNode->OfficialCode,$charset,'utf-8');
$phone = api_convert_encoding($userNode->Phone,$charset,'utf-8');
$status = api_convert_encoding($userNode->Status,$charset,'utf-8');
switch ($status) {
case 'student' : $status = 5; break;
case 'teacher' : $status = 1; break;
@ -125,13 +125,13 @@ if ($_POST['formSent']) {
@api_mail($recipient_name, $email, $emailsubject, $emailbody, $sender_name,$email_admin);
}
} else {
$lastname = mb_convert_encoding($userNode->Lastname,$charset,'utf-8');
$firstname = mb_convert_encoding($userNode->Firstname,$charset,'utf-8');
$password = mb_convert_encoding($userNode->Password,$charset,'utf-8');
$email = mb_convert_encoding($userNode->Email,$charset,'utf-8');
$official_code = mb_convert_encoding($userNode->OfficialCode,$charset,'utf-8');
$phone = mb_convert_encoding($userNode->Phone,$charset,'utf-8');
$status = mb_convert_encoding($userNode->Status,$charset,'utf-8');
$lastname = api_convert_encoding($userNode->Lastname,$charset,'utf-8');
$firstname = api_convert_encoding($userNode->Firstname,$charset,'utf-8');
$password = api_convert_encoding($userNode->Password,$charset,'utf-8');
$email = api_convert_encoding($userNode->Email,$charset,'utf-8');
$official_code = api_convert_encoding($userNode->OfficialCode,$charset,'utf-8');
$phone = api_convert_encoding($userNode->Phone,$charset,'utf-8');
$status = api_convert_encoding($userNode->Status,$charset,'utf-8');
switch($status) {
case 'student' : $status = 5; break;
case 'teacher' : $status = 1; break;
@ -157,11 +157,11 @@ if ($_POST['formSent']) {
// from the <Sessions> <Courses> racine
if (count($racine->Courses->Course) > 0) {
foreach($racine->Courses->Course as $courseNode) {
$course_code = mb_convert_encoding($courseNode->CourseCode,$charset,'utf-8');
$title = mb_convert_encoding($courseNode->CourseTitle,$charset,'utf-8');
$description = mb_convert_encoding($courseNode->CourseDescription,$charset,'utf-8');
$language = mb_convert_encoding($courseNode->CourseLanguage,$charset,'utf-8');
$username = mb_convert_encoding($courseNode->CourseTeacher,$charset,'utf-8');
$course_code = api_convert_encoding($courseNode->CourseCode,$charset,'utf-8');
$title = api_convert_encoding($courseNode->CourseTitle,$charset,'utf-8');
$description = api_convert_encoding($courseNode->CourseDescription,$charset,'utf-8');
$language = api_convert_encoding($courseNode->CourseLanguage,$charset,'utf-8');
$username = api_convert_encoding($courseNode->CourseTeacher,$charset,'utf-8');
//looking for the teacher
$sql = "SELECT user_id, lastname, firstname FROM $tbl_user WHERE username='$username'";
@ -179,7 +179,7 @@ if ($_POST['formSent']) {
$currentCourseRepository = $keys['currentCourseRepository'];
//creating a course
if($currentCourseId == strtoupper($course_code)) {
if($currentCourseId == api_strtoupper($course_code)) {
if (empty ($title)) {
$title = $keys['currentCourseCode'];
}
@ -232,8 +232,8 @@ if ($_POST['formSent']) {
$countCourses = 0;
$countUsers = 0;
$SessionName = mb_convert_encoding($sessionNode->SessionName,$charset,'utf-8');
$Coach = mb_convert_encoding($sessionNode->Coach,$charset,'utf-8');
$SessionName = api_convert_encoding($sessionNode->SessionName,$charset,'utf-8');
$Coach = api_convert_encoding($sessionNode->Coach,$charset,'utf-8');
if (!empty($Coach)) {
$coach_id = UserManager::get_user_id_from_username($Coach);
@ -347,7 +347,7 @@ if ($_POST['formSent']) {
// Adding users to the new session
foreach ($sessionNode->User as $userNode){
$username = mb_convert_encoding(substr($userNode,0,20),$charset,'utf-8');
$username = api_convert_encoding(api_substr($userNode,0,20),$charset,'utf-8');
$user_id = UserManager::get_user_id_from_username($username);
if($user_id!==false){
$sql = "INSERT IGNORE INTO $tbl_session_user SET
@ -389,7 +389,7 @@ if ($_POST['formSent']) {
$countCourses++;
$countUsersCourses = 0;
foreach ($courseNode->User as $userNode) {
$username = substr($userNode,0,20);
$username = api_substr($userNode,0,20);
$user_id = UserManager::get_user_id_from_username($username);
if ($user_id!==false) {
// adding to session_rel_user table
@ -489,7 +489,7 @@ if ($_POST['formSent']) {
///////////////////
$content=file($_FILES['import_file']['tmp_name']);
if(!strstr($content[0],';')) {
if(!api_strstr($content[0],';')) {
$errorMsg=get_lang('NotCSV');
} else {
$tag_names=array();
@ -502,7 +502,7 @@ if ($_POST['formSent']) {
}
} else {
foreach($enreg as $tag_name) {
$tag_names[]=eregi_replace('[^a-z0-9_-]','',$tag_name);
$tag_names[]=api_eregi_replace('[^a-z0-9_-]','',$tag_name);
}
if(!in_array('SessionName',$tag_names) || !in_array('DateStart',$tag_names) || !in_array('DateEnd',$tag_names)) {
$errorMsg=get_lang('NoNeededData');
@ -613,14 +613,14 @@ if ($_POST['formSent']) {
//var_dump($courses);
foreach ($courses as $course) {
$CourseCode = strtoupper(substr($course,0,strpos($course,'[')));
$CourseCode = api_strtoupper(api_substr($course,0,strpos($course,'[')));
if (CourseManager::course_exists($CourseCode)) {
// If the course exists we continue
$c_info = CourseManager::get_course_information($CourseCode);
$Coach = strstr($course,'[');
$Coach = substr($Coach,1,strpos($Coach,']')-1);
$Coach = api_strstr($course,'[');
$Coach = api_substr($Coach,1,api_strpos($Coach,']')-1);
if(!empty($Coach)) {
$coach_id = UserManager::get_user_id_from_username($Coach);
@ -638,7 +638,7 @@ if ($_POST['formSent']) {
$rsCourse = api_sql_query($sqlCourse,__FILE__,__LINE__);
$countCourses++;
$users = substr($course , strpos($course,'[',1)+1 , strpos($course,']',1));
$users = api_substr($course , api_strpos($course,'[',1)+1 , api_strpos($course,']',1));
$users = explode('|',$enreg['Users']);
$countUsersCourses = 0;
@ -895,4 +895,4 @@ if(!empty($errorMsg)) {
==============================================================================
*/
Display::display_footer();
?>
?>

@ -217,11 +217,11 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
<tr class="<?php echo $i?'row_odd':'row_even'; ?>">
<td><input type="checkbox" id="idChecked_<?php echo $x; ?>" name="idChecked[]" value="<?php echo $enreg['id']; ?>"></td>
<td><a href="resume_session.php?id_session=<?php echo $enreg['id']; ?>"><?php echo htmlentities($enreg['name'],ENT_QUOTES,$charset); ?></a></td>
<td><a href="resume_session.php?id_session=<?php echo $enreg['id']; ?>"><?php echo api_htmlentities($enreg['name'],ENT_QUOTES,$charset); ?></a></td>
<td><a href="session_course_list.php?id_session=<?php echo $enreg['id']; ?>"><?php echo $nb_courses; ?> cours</a></td>
<td><?php echo htmlentities($enreg['date_start'],ENT_QUOTES,$charset); ?></td>
<td><?php echo htmlentities($enreg['date_end'],ENT_QUOTES,$charset); ?></td>
<td><?php echo htmlentities($enreg['firstname'],ENT_QUOTES,$charset).' '.htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
<td><?php echo api_htmlentities($enreg['date_start'],ENT_QUOTES,$charset); ?></td>
<td><?php echo api_htmlentities($enreg['date_end'],ENT_QUOTES,$charset); ?></td>
<td><?php echo api_htmlentities($enreg['firstname'],ENT_QUOTES,$charset).' '.api_htmlentities($enreg['lastname'],ENT_QUOTES,$charset); ?></td>
<td>
<a href="add_users_to_session.php?page=session_list.php&id_session=<?php echo $enreg['id']; ?>"><?php Display::display_icon('add_user_big.gif', get_lang('SubscribeUsersToSession')); ?></a>
<a href="add_courses_to_session.php?page=session_list.php&id_session=<?php echo $enreg['id']; ?>"><?php Display::display_icon('synthese_view.gif', get_lang('SubscribeCoursesToSession')); ?></a>
@ -299,4 +299,4 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
}
Display::display_footer();
?>
?>

@ -1,4 +1,4 @@
<?php // $Id: settings.php 20161 2009-04-28 20:31:39Z juliomontoya $
<?php // $Id: settings.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -319,12 +319,12 @@ echo "\n<div class=\"actions\">";
//while ($row = mysql_fetch_array($resultcategories))
foreach($resultcategories as $row)
{
echo "\n\t<a href=\"".api_get_self()."?category=".$row['category']."\">".Display::return_icon($action_images[strtolower($row['category'])], ucfirst(get_lang($row['category']))).ucfirst(get_lang($row['category']))."</a>";
echo "\n\t<a href=\"".api_get_self()."?category=".$row['category']."\">".Display::return_icon($action_images[strtolower($row['category'])], api_ucfirst(get_lang($row['category']))).api_ucfirst(get_lang($row['category']))."</a>";
}
echo "\n\t<a href=\"".api_get_self()."?category=Plugins\">".Display::return_icon($action_images['plugins'], ucfirst(get_lang('Plugins'))).ucfirst(get_lang('Plugins'))."</a>";
echo "\n\t<a href=\"".api_get_self()."?category=stylesheets\">".Display::return_icon($action_images['stylesheets'], ucfirst(get_lang('Stylesheets'))).ucfirst(get_lang('Stylesheets'))."</a>";
echo "\n\t<a href=\"".api_get_self()."?category=Templates\">".Display::return_icon($action_images['templates'], ucfirst(get_lang('Templates'))).ucfirst(get_lang('Templates'))."</a>";
echo "\n\t<a href=\"".api_get_self()."?category=Search\">".Display::return_icon($action_images['search'], ucfirst(get_lang('Search'))).ucfirst(get_lang('Search'))."</a>";
echo "\n\t<a href=\"".api_get_self()."?category=Plugins\">".Display::return_icon($action_images['plugins'], api_ucfirst(get_lang('Plugins'))).api_ucfirst(get_lang('Plugins'))."</a>";
echo "\n\t<a href=\"".api_get_self()."?category=stylesheets\">".Display::return_icon($action_images['stylesheets'], api_ucfirst(get_lang('Stylesheets'))).api_ucfirst(get_lang('Stylesheets'))."</a>";
echo "\n\t<a href=\"".api_get_self()."?category=Templates\">".Display::return_icon($action_images['templates'], api_ucfirst(get_lang('Templates'))).api_ucfirst(get_lang('Templates'))."</a>";
echo "\n\t<a href=\"".api_get_self()."?category=Search\">".Display::return_icon($action_images['search'], api_ucfirst(get_lang('Search'))).api_ucfirst(get_lang('Search'))."</a>";
echo "\n</div>";
if (isset ($_GET['category']))
@ -642,7 +642,7 @@ function handle_stylesheets()
{
$selected = '';
}
$show_name=get_lang($style_dir);
$show_name=get_lang($style_dir, '');
if ($is_style_changeable)
{
@ -680,7 +680,7 @@ function handle_stylesheets()
function upload_stylesheet($values,$picture)
{
// valid name for the stylesheet folder
$style_name = ereg_replace("[^A-Za-z0-9]", "", $values['name_stylesheet'] );
$style_name = api_ereg_replace("[^A-Za-z0-9]", "", $values['name_stylesheet'] );
// create the folder if needed
if(!is_dir(api_get_path(SYS_CODE_PATH).'css/'.$style_name.'/'))
@ -1097,7 +1097,7 @@ function add_edit_template()
// resize image to max default and upload
require_once (api_get_path(LIBRARY_PATH).'image.lib.php');
$temp = new image($_FILES['template_image']['tmp_name']);
$picture_infos=getimagesize($_FILES['template_image']['tmp_name']);
$picture_infos=@getimagesize($_FILES['template_image']['tmp_name']);
$max_width_for_picture = 100;

@ -63,7 +63,7 @@ function edit_filter($id,$url_params,$row)
{
global $charset;
$return = '<a href="specific_fields_add.php?action=edit&field_id='.$row[0].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
return $return;
}

@ -139,9 +139,9 @@ class Statistics
foreach ($stats as $subtitle => $number)
{
$i = $i % 13;
if (strlen($subtitle) > 30)
if (api_strlen($subtitle) > 30)
{
$subtitle = '<acronym title="'.$subtitle.'">'.substr($subtitle, 0, 27).'...</acronym>';
$subtitle = '<acronym title="'.$subtitle.'">'.api_substr($subtitle, 0, 27).'...</acronym>';
}
if(!$is_file_size)
{
@ -336,4 +336,4 @@ class Statistics
}
}
}
?>
?>

@ -1,6 +1,6 @@
<?php
// $Id: subscribe_class2course.php 12269 2007-05-03 14:17:37Z elixir_julian $
// $Id: subscribe_class2course.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -73,7 +73,7 @@ if ($_POST['formSent'])
{
Display::display_error_message(get_lang('AtLeastOneClassAndOneCourse'));
}
elseif (substr($_POST['formSubmit'], -2) == '>>') // add classes to courses
elseif (api_substr($_POST['formSubmit'], -2) == '>>') // add classes to courses
{
foreach ($courses as $course_code)
{
@ -177,4 +177,4 @@ foreach ($db_courses as $course)
==============================================================================
*/
Display :: display_footer();
?>
?>

@ -1,4 +1,4 @@
<?php // $Id: system_announcements.php 20220 2009-04-30 15:37:30Z cfasanando $
<?php // $Id: system_announcements.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -295,7 +295,7 @@ if ($show_announcement_list)
$row[] = "<a href=\"?id=".$announcement->id."&amp;person=".VISIBLE_GUEST."&amp;action=". ($announcement->visible_guest ? 'make_invisible' : 'make_visible')."\">".Display::return_icon(($announcement->visible_guest ? 'visible.gif' : 'invisible.gif'), get_lang('show_hide'))."</a>";
$row[] = $announcement->title;
$row[] = $announcement->lang;
$row[] = "<a href=\"?action=edit&id=".$announcement->id."\">".Display::return_icon('edit.gif', get_lang('Edit'))."</a> <a href=\"?action=delete&id=".$announcement->id."\" onclick=\"javascript:if(!confirm('".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."')) return false;\">".Display::return_icon('delete.gif', get_lang('Delete'))."</a>";
$row[] = "<a href=\"?action=edit&id=".$announcement->id."\">".Display::return_icon('edit.gif', get_lang('Edit'))."</a> <a href=\"?action=delete&id=".$announcement->id."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."')) return false;\">".Display::return_icon('delete.gif', get_lang('Delete'))."</a>";
$announcement_data[] = $row;
}
$table = new SortableTableFromArray($announcement_data);

@ -1,4 +1,4 @@
<?php // $Id: user_add.php 20075 2009-04-24 15:05:22Z cfasanando $
<?php // $Id: user_add.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/*
==============================================================================
Dokeos - elearning and course management software
@ -485,4 +485,4 @@ $form->display();
==============================================================================
*/
Display::display_footer();
?>
?>

@ -300,7 +300,7 @@ function edit_filter($id,$url_params,$row)
{
global $charset;
$return = '<a href="user_fields_add.php?action=edit&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'">'.Display::return_icon('edit.gif',get_lang('Edit')).'</a>';
$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
$return .= ' <a href="'.api_get_self().'?action=delete&field_id='.$row[0].'&sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif',get_lang('Delete')).'</a>';
return $return;
}
/**
@ -414,4 +414,4 @@ function delete_user_fields($field_id)
return false;
}
}
?>
?>

@ -1,4 +1,4 @@
<?php // $Id: user_import.php 19597 2009-04-07 14:38:36Z pcool $
<?php // $Id: user_import.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -40,7 +40,7 @@ function validate_data($users) {
$errors[] = $user;
}
//2.3. check if username isn't longer than the 20 allowed characters
if (strlen($user['UserName']) > 20) {
if (api_strlen($user['UserName']) > 20) {
$user['error'] = get_lang('UserNameTooLong');
$errors[] = $user;
}
@ -74,7 +74,7 @@ function validate_data($users) {
function complete_missing_data($user) {
//1. Create a username if necessary
if (!isset ($user['UserName']) || strlen($user['UserName']) == 0) {
$username = strtolower(ereg_replace('[^a-zA-Z]', '', substr($user['FirstName'], 0, 3).' '.substr($user['LastName'], 0, 4)));
$username = api_strtolower(api_ereg_replace('[^a-zA-Z]', '', api_substr($user['FirstName'], 0, 3).' '.api_substr($user['LastName'], 0, 4)));
if (!UserManager :: is_username_available($username)) {
$i = 0;
$temp_username = $username.$i;
@ -423,4 +423,4 @@ if ($count_fields > 0) {
FOOTER
==============================================================================
*/
Display :: display_footer();
Display :: display_footer();

@ -1,4 +1,4 @@
<?php // $Id: user_list.php 20403 2009-05-08 08:35:16Z ndieschburg $
<?php // $Id: user_list.php 20441 2009-05-10 07:39:15Z ivantcholakov $
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
@ -82,7 +82,7 @@ function courses_of_user($arg)
{
$newContent .= '- '.get_lang('None').' -<br />';
}
$newContent = mb_convert_encoding($newContent,'utf-8',api_get_setting('platform_charset'));
$newContent = api_convert_encoding($newContent,'utf-8',api_get_setting('platform_charset'));
// Instantiate the xajaxResponse object
$objResponse = new xajaxResponse();
@ -447,7 +447,7 @@ function modify_filter($user_id,$url_params,$row)
$result .= '<a href="user_edit.php?user_id='.$user_id.'">'.Display::return_icon('edit.gif', get_lang('Edit')).'</a>&nbsp;&nbsp;';
if ($row[0]<>$_user['user_id']) { // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
$result .= '<a href="user_list.php?action=delete_user&amp;user_id='.$user_id.'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
$result .= '<a href="user_list.php?action=delete_user&amp;user_id='.$user_id.'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
} else {
$result .= Display::return_icon('delete_na.gif', get_lang('Delete'));
}

Loading…
Cancel
Save