Minor - format code, updating license reference.

1.9.x
Julio Montoya 10 years ago
parent c916b21c1c
commit fa59e31b48
  1. 4
      main/admin/group_add.php
  2. 2
      main/admin/group_list.php
  3. 136
      main/admin/sub_language.class.php
  4. 50
      main/admin/sub_language.php
  5. 19
      main/admin/sub_language_add.php
  6. 28
      main/admin/user_fields_add.php
  7. 10
      main/calendar/ical_export.php
  8. 7
      main/calendar/print.php
  9. 11
      main/cron/user_import/client.php
  10. 4
      main/exercice/hotspot_savescore.inc.php
  11. 9
      main/exercice/hotspot_updatescore.inc.php
  12. 6
      main/webservices/user_import/service.php
  13. 5
      tests/internationalization.lib.test_standalone.php
  14. 505
      tests/main/newscorm/learnpath.class.test.php
  15. 2
      whoisonlinesession.php

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
*/
@ -169,4 +169,4 @@ if (!empty($message)) {
$form->display();
// Footer
Display::display_footer();
Display::display_footer();

@ -1,6 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/* For licensing terms, see /dokeos_license.txt */
/**
@author Bart Mollet
* @package chamilo.admin

@ -1,26 +1,29 @@
<?php
/* For licensing terms, see /license.txt */
/**
* SubLanguageManager class definition file
* Class SubLanguageManager
* @package chamilo.admin.sublanguage
* @todo clean this lib and move to main/inc/lib
*/
class SubLanguageManager {
private function __construct() {
//void
class SubLanguageManager
{
/**
* Constructor
*/
public function __construct()
{
}
/**
* Get all files of lang folder (forum.inc.php,gradebook.inc.php,notebook.inc.php)
* @param String The lang path folder (/var/www/my_lms/main/lang/spanish)
* @param bool true if we only want the "subname" trad4all instead of trad4all.inc.php
* @return Array All file of lang folder
*
* @return Array All file of lang folder
*/
public static function get_lang_folder_files_list($path, $only_main_name = false) {
public static function get_lang_folder_files_list($path, $only_main_name = false)
{
$content_dir = array();
if (is_dir($path)) {
if ($dh = opendir($path)) {
@ -46,9 +49,11 @@ class SubLanguageManager {
* @param Integer The sub language id
* @return Array All information about sub-language
*/
public static function get_all_information_of_sub_language($parent_id, $sub_language_id) {
public static function get_all_information_of_sub_language($parent_id, $sub_language_id)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT * FROM ' . $tbl_admin_languages . ' WHERE parent_id="' . Database::escape_string($parent_id) . '" AND id="' . Database::escape_string($sub_language_id) . '"';
$sql = 'SELECT * FROM ' . $tbl_admin_languages . '
WHERE parent_id="' . Database::escape_string($parent_id) . '" AND id="' . Database::escape_string($sub_language_id) . '"';
$rs = Database::query($sql);
$all_information = array();
while ($row = Database::fetch_array($rs, 'ASSOC')) {
@ -62,7 +67,8 @@ class SubLanguageManager {
* @param Integer The parent id(Language father id)
* @return Array All information about language
*/
public static function get_all_information_of_language($parent_id) {
public static function get_all_information_of_language($parent_id)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT * FROM ' . $tbl_admin_languages . ' WHERE id = "' . intval($parent_id) . '"';
$rs = Database::query($sql);
@ -79,7 +85,8 @@ class SubLanguageManager {
* @patam Bool Whether we want to remove the '$' prefix in the results or not
* @return Array Contains all information of chamilo file
*/
public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false) {
public static function get_all_language_variable_in_file($system_path_file, $get_as_string_index = false)
{
$res_list = array();
if (!is_readable($system_path_file)) {
return $res_list;
@ -97,6 +104,7 @@ class SubLanguageManager {
}
$res_list[$var] = $val;
}
return $res_list;
}
@ -105,8 +113,8 @@ class SubLanguageManager {
* @param String The chamilo path file (/var/www/chamilo/main/lang/spanish/gradebook.inc.php)
* @return bool
*/
public static function add_file_in_language_directory($system_path_file) {
$return_value = false;
public static function add_file_in_language_directory($system_path_file)
{
$return_value = @file_put_contents($system_path_file, '<?php' . PHP_EOL);
return $return_value;
}
@ -118,7 +126,8 @@ class SubLanguageManager {
* @param String The language variable
* @return Boolean True on success, False on error
*/
public static function write_data_in_file($path_file, $new_term, $new_variable) {
public static function write_data_in_file($path_file, $new_term, $new_variable)
{
$return_value = false;
$new_data = $new_variable . '=' . $new_term;
$resource = @fopen($path_file, "a");
@ -131,15 +140,17 @@ class SubLanguageManager {
}
fclose($resource);
}
return $return_value;
}
/**
* Add directory for sub-language
* @param String The sub-language directory ( e.g. 'spanish_corporate' )
* @param string $sub_language_dir The sub-language directory ( e.g. 'spanish_corporate' )
* @return boolean True on success, false on failure
*/
public static function add_language_directory($sub_language_dir) {
public static function add_language_directory($sub_language_dir)
{
if (empty($sub_language_dir)) {
return false;
}
@ -153,15 +164,17 @@ class SubLanguageManager {
/**
* Delete sub-language.
* In order to avoid deletion of main laguages, we check the existence of a parent
* @param Integer The parent id
* @param int The parent id
* @return bool True on success, false on error
*/
public static function remove_sub_language($parent_id, $sub_language_id) {
public static function remove_sub_language($parent_id, $sub_language_id)
{
if (empty($parent_id) or (intval($parent_id) != $parent_id) or empty($sub_language_id) or (intval($sub_language_id) != $sub_language_id)) {
return false;
}
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT dokeos_folder FROM ' . $tbl_admin_languages . ' WHERE parent_id = ' . $parent_id . ' and id = ' . $sub_language_id;
$sql = 'SELECT dokeos_folder FROM ' . $tbl_admin_languages . '
WHERE parent_id = ' . $parent_id . ' and id = ' . $sub_language_id;
$res = Database::query($sql);
if ($res === false or Database::num_rows($res) < 1) {
return false;
@ -171,8 +184,10 @@ class SubLanguageManager {
if ($res === false) {
return false;
} //can't delete dir, so do not delete language record
$sql = 'DELETE FROM ' . $tbl_admin_languages . ' WHERE id="' . Database::escape_string($sub_language_id) . '" ';
$sql = 'DELETE FROM ' . $tbl_admin_languages . '
WHERE id="' . Database::escape_string($sub_language_id) . '" ';
$res = Database::query($sql);
return $res;
}
@ -181,7 +196,8 @@ class SubLanguageManager {
* @param String The sub-language path directory ( e.g. 'spanish_corporate'' )
* @return boolean True on success, false on failure
*/
public static function remove_language_directory($sub_language_dir) {
public static function remove_language_directory($sub_language_dir)
{
if (empty($sub_language_dir)) {
return false;
}
@ -204,10 +220,11 @@ class SubLanguageManager {
/**
* check if language exist by id
* @param Integer The language id
* @return Boolean
* @param int $language_id
* @return bool
*/
public static function check_if_exist_language_by_id($language_id) {
public static function check_if_exist_language_by_id($language_id)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT count(*) as count FROM ' . $tbl_admin_languages . ' WHERE id="' . intval($language_id) . '"';
$rs = Database::query($sql);
@ -219,7 +236,6 @@ class SubLanguageManager {
}
} else {
return false;
;
}
}
@ -228,7 +244,8 @@ class SubLanguageManager {
* @param Integer The language id
* @return String The original name of language
*/
public static function get_name_of_language_by_id($language_id) {
public static function get_name_of_language_by_id($language_id)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT original_name FROM ' . $tbl_admin_languages . ' WHERE id="' . Database::escape_string($language_id) . '"';
$rs = Database::query($sql);
@ -244,9 +261,11 @@ class SubLanguageManager {
* @param Integer The language id
* @return Boolean
*/
public static function check_if_language_is_sub_language($language_id) {
public static function check_if_language_is_sub_language($language_id)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT count(*) AS count FROM ' . $tbl_admin_languages . ' WHERE id="' . Database::escape_string($language_id) . '" AND NOT ISNULL(parent_id)';
$sql = 'SELECT count(*) AS count FROM ' . $tbl_admin_languages . '
WHERE id="' . Database::escape_string($language_id) . '" AND NOT ISNULL(parent_id)';
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) {
@ -255,11 +274,17 @@ class SubLanguageManager {
return false;
}
}
public static function check_if_language_is_used($language_id) {
$language_info = self::get_all_information_of_language($language_id);
/**
* @param int $language_id
* @return bool
*/
public static function check_if_language_is_used($language_id)
{
$language_info = self::get_all_information_of_language($language_id);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
$sql = 'SELECT count(*) AS count FROM ' . $user_table . ' WHERE language ="' . Database::escape_string($language_info['english_name']).'"';
$sql = 'SELECT count(*) AS count FROM ' . $user_table . '
WHERE language ="' . Database::escape_string($language_info['english_name']).'"';
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') >= 1) {
return true;
@ -273,9 +298,11 @@ class SubLanguageManager {
* @param Integer The language id
* @return Boolean
*/
public static function check_if_language_is_father($language_id) {
public static function check_if_language_is_father($language_id)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql = 'SELECT count(*) AS count FROM ' . $tbl_admin_languages . ' WHERE parent_id="' . Database::escape_string($language_id) . '" AND NOT ISNULL(parent_id);';
$sql = 'SELECT count(*) AS count FROM ' . $tbl_admin_languages . '
WHERE parent_id="' . Database::escape_string($language_id) . '" AND NOT ISNULL(parent_id);';
$rs = Database::query($sql);
if (Database::num_rows($rs) > 0 && Database::result($rs, '0', 'count') == 1) {
@ -290,7 +317,8 @@ class SubLanguageManager {
* @param Integer The language id
* @return void()
*/
public static function make_unavailable_language($language_id) {
public static function make_unavailable_language($language_id)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql_make_unavailable = "UPDATE $tbl_admin_languages SET available='0' WHERE id='" . Database::escape_string($language_id) . "'";
$result = Database::query($sql_make_unavailable);
@ -302,7 +330,8 @@ class SubLanguageManager {
* @param Integer The language id
* @return void
*/
public static function make_available_language($language_id) {
public static function make_available_language($language_id)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql_make_available = "UPDATE $tbl_admin_languages SET available='1' WHERE id='" . Database::escape_string($language_id) . "'";
$result = Database::query($sql_make_available);
@ -314,7 +343,8 @@ class SubLanguageManager {
* @param Integer The language id
* @return bool
*/
public static function set_platform_language($language_id) {
public static function set_platform_language($language_id)
{
if (empty($language_id) or (intval($language_id) != $language_id)) {
return false;
}
@ -326,6 +356,7 @@ class SubLanguageManager {
$sql_update_2 = "UPDATE " . $tbl_settings_current . " SET selected_value='" . $lang['english_name'] . "' WHERE variable='platformLanguage'";
$result_2 = Database::query($sql_update_2);
event_system(LOG_PLATFORM_LANGUAGE_CHANGE, LOG_PLATFORM_LANGUAGE, $lang['english_name']);
return $result_2 !== false;
}
@ -333,7 +364,8 @@ class SubLanguageManager {
* Get platform language ID
* @return int The platform language ID
*/
public static function get_platform_language_id() {
public static function get_platform_language_id()
{
$name = api_get_setting('platformLanguage');
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$sql = "SELECT id FROM " . $tbl_admin_languages . " WHERE english_name ='$name'";
@ -345,16 +377,22 @@ class SubLanguageManager {
return $row['id'];
}
/*
/**
* Get parent language path (or null if no parent)
* @param string Children language path
* @return string Parent language path or null
*/
public static function get_parent_language_path($language_path) {
public static function get_parent_language_path($language_path)
{
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$tbl_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$sql_update = "SELECT dokeos_folder FROM " . $tbl_admin_languages . " WHERE id=(SELECT parent_id FROM " . $tbl_admin_languages . " WHERE dokeos_folder = '" . Database::escape_string($language_path) . "')";
$result = Database::query($sql_update);
$sql = "SELECT dokeos_folder
FROM " . $tbl_admin_languages . "
WHERE id = (
SELECT parent_id FROM " . $tbl_admin_languages . "
WHERE dokeos_folder = '" . Database::escape_string($language_path) . "'
)
";
$result = Database::query($sql);
if (Database::num_rows($result) == 0) {
return null;
}
@ -367,7 +405,8 @@ class SubLanguageManager {
* @param string $isocode The language isocode (en, es, fr, zh-TW, etc)
* @return mixed English name of the matching language, or false if no active language could be found
*/
public static function getLanguageFromIsocode($isocode) {
public static function getLanguageFromIsocode($isocode)
{
$isocode = Database::escape_string($isocode);
$adminLanguagesTable = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
// select language - if case several languages match, get the last (more recent) one
@ -384,12 +423,14 @@ class SubLanguageManager {
$row = Database::fetch_assoc($res);
return $row['english_name'];
}
/**
* Get best language in browser preferences
* @param string $preferences The browser-configured language preferences (e.g. "en,es;q=0.7;en-us;q=0.3", etc)
* @return mixed English name of the matching language, or false if no active language could be found
*/
public static function getLanguageFromBrowserPreference($preferences) {
public static function getLanguageFromBrowserPreference($preferences)
{
if (empty($preferences)) {
return false;
}
@ -408,6 +449,7 @@ class SubLanguageManager {
}
}
}
return false;
}
}
}

@ -4,9 +4,7 @@
* Script for sub-language administration
* @package chamilo.admin.sub_language
*/
/**
* Init section
*/
// name of the language file that needs to be included
$language_file = 'admin';
$cidReset = true;
@ -25,7 +23,7 @@ $htmlHeadXtra[] ='<script type="text/javascript">
button_name=button_array[1];
file_id=button_array[2];
is_variable_language="$"+button_name;
is_new_language=$("#txtid_"+file_id+"_"+button_name).attr("value");
if (is_new_language=="undefined") {
is_new_language="_";
@ -39,13 +37,13 @@ $htmlHeadXtra[] ='<script type="text/javascript">
type: "POST",
url: "../admin/sub_language_ajax.inc.php",
data: "new_language="+is_new_language+"&variable_language="+is_variable_language+"&file_id="+file_id+"&id="+'.intval($_REQUEST['id']).'+"&sub="+'.intval($_REQUEST['sub_language_id']).',
success: function(datos) {
success: function(datos) {
if (datos == "1") {
$("#div_message_information_id").html("<div class=\"confirmation-message\">'.get_lang('TheNewWordHasBeenAdded').'</div>");
} else {
$("#div_message_information_id").html("<div class=\"warning-message\">" + datos +"</div>");
}
}
}
});
} else {
$("#div_message_information_id").html("<div class=\"error-message\">'.get_lang('FormHasErrorsPleaseComplete').'</div>");
@ -66,15 +64,15 @@ $sublanguage_folder_error = false;
if (isset($_GET['id']) && $_GET['id']==strval(intval($_GET['id']))) {
$language_name = SubLanguageManager::get_name_of_language_by_id ($_GET['id']);
$sub_language_name = SubLanguageManager::get_name_of_language_by_id ($_GET['sub_language_id']);
$sub_language_name = SubLanguageManager::get_name_of_language_by_id ($_GET['sub_language_id']);
$all_data_of_language = SubLanguageManager::get_all_information_of_language($_GET['id']);
$all_data_of_sublanguage = SubLanguageManager::get_all_information_of_language($_GET['sub_language_id']);
$sub_language_file = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder'];
$sub_language_file = api_get_path(SYS_LANG_PATH).$all_data_of_sublanguage['dokeos_folder'];
if (!file_exists($sub_language_file) || !is_writable($sub_language_file)) {
$sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable');
}
if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) {
$sublanguage_folder_error = $sub_language_file.' '.get_lang('IsNotWritable');
}
if (SubLanguageManager::check_if_exist_language_by_id($_GET['id'])===true) {
$language_id_exist = true;
} else {
$language_id_exist = false;
@ -98,10 +96,10 @@ echo $language_name;
echo '</div>';
if (!empty($_SESSION['msg'])) {
echo $_SESSION['msg'];
unset($_SESSION['msg']);
echo $_SESSION['msg'];
unset($_SESSION['msg']);
} else {
echo '<br />';
echo '<br />';
}
$txt_search_word = Security::remove_XSS($_REQUEST['txt_search_word']);
@ -118,7 +116,7 @@ $html.='</div>';
echo $html;
echo '<br /><br /><br />';
if (!empty($sublanguage_folder_error)) {
Display::display_warning_message($sublanguage_folder_error);
Display::display_warning_message($sublanguage_folder_error);
}
echo '<div id="div_message_information_id">&nbsp;</div>';
@ -183,9 +181,9 @@ function search_language_term($term, $search_in_variable = true , $search_in_eng
$obj_button='<button class="save" type="button" name="btn|'.$parent_name_variable.'|'.$language_files_to_load_keys[$lang_file].'" id="btnid_'.$parent_name_variable.'" />'.get_lang('Save').'</button>';
$list_info[]=array($lang_file.'.inc.php',
$parent_name_variable,
$english_name_variable,
$parent_variable_value,$obj_text,$obj_button);
$parent_name_variable,
$english_name_variable,
$parent_variable_value,$obj_text,$obj_button);
}
}
}
@ -197,7 +195,7 @@ function search_language_term($term, $search_in_variable = true , $search_in_eng
if (is_array($variable_value)) {
continue;
}
if (is_array($variable_value))
echo $lang_file;
$founded = false;
@ -230,9 +228,9 @@ function search_language_term($term, $search_in_variable = true , $search_in_eng
$english_name_variable = $english_language_array[$lang_file][$name_variable];
$list_info[]=array($lang_file.'.inc.php',
$name_variable,
$english_name_variable,
$parent_variable_value,$obj_text,$obj_button);
$name_variable,
$english_name_variable,
$parent_variable_value,$obj_text,$obj_button);
}
}
}
@ -262,9 +260,9 @@ function search_language_term($term, $search_in_variable = true , $search_in_eng
//loading variable from the english array
$english_name_variable = $english_language_array[$lang_file][$name_variable];
$list_info[]=array($lang_file.'.inc.php',
$name_variable,
$english_name_variable,
$parent_variable_value,$obj_text,$obj_button);
$name_variable,
$english_name_variable,
$parent_variable_value,$obj_text,$obj_button);
}
}
}

@ -1,12 +1,11 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
* This script allows for the addition of sub-languages
* @package chamilo.admin
*/
/**
* Initialization section
*/
// name of the language file that needs to be included
$language_file = 'admin';
$cidReset = true;
@ -41,7 +40,7 @@ function add_sub_language ($original_name,$english_name,$isocode,$sublanguage_av
$isocode = Database::escape_string($isocode);
$sublanguage_available = Database::escape_string($sublanguage_available);
$parent_id = Database::escape_string($parent_id);
$sql='INSERT INTO '.$tbl_admin_languages.'(original_name,english_name,isocode,dokeos_folder,available,parent_id) VALUES ("'.$original_name.'","'.$english_name.'","'.$isocode.'","'.$english_name.'","'.$sublanguage_available.'","'.$parent_id.'")';
$res = Database::query($sql);
if ($res === false) {
@ -86,14 +85,14 @@ function check_if_language_exist ($original_name, $english_name, $isocode, $subl
$has_error=true;
$message_information['english_name']=true;
}
$iso_list = api_get_platform_isocodes();
$iso_list = api_get_platform_isocodes();
$iso_list = array_values($iso_list);
if (!in_array($isocode, $iso_list)) {
$has_error=true;
$message_information['isocode']=true;
}
}
if ($has_error===true) {
$message_information['execute_add']=false;
}
@ -217,7 +216,7 @@ if (isset($_POST['SubmitAddNewLanguage'])) {
$english_name=str_replace(' ','_',$english_name);
//Fixes BT#1636
$english_name=api_strtolower($english_name);
$isocode=str_replace(' ','_',$isocode);
$str_info='<br/>'.get_lang('OriginalName').' : '.$original_name.'<br/>'.get_lang('EnglishName').' : '.$english_name.'<br/>'.get_lang('PlatformCharsetTitle').' : '.$isocode;

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
* @package chamilo.admin
*/
@ -18,7 +18,7 @@ api_protect_admin_script();
$htmlHeadXtra[] = '<script>
function change_image_user_field (image_value) {
if (image_value==1) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
@ -33,19 +33,19 @@ function change_image_user_field (image_value) {
} else if (image_value==3) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('add_user_field_howto.png', get_lang('AddUserFields'))."'".');
} else if (image_value==4) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_drop_down.png', get_lang('AddUserFields'))."'".');
} else if (image_value==5) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_multidropdown.png', get_lang('AddUserFields'))."'".');
@ -56,13 +56,13 @@ function change_image_user_field (image_value) {
} else if (image_value==7) {
document.getElementById(\'options\').style.display = \'none\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_date_time.png', get_lang('AddUserFields'))."'".');
} else if (image_value==8) {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
$("div#id_image_user_field").html("&nbsp;");
$("div#id_image_user_field").html('."'<br />".Display::return_icon('userfield_doubleselect.png', get_lang('AddUserFields'))."'".');
@ -81,7 +81,7 @@ function change_image_user_field (image_value) {
}
}
function advanced_parameters() {
function advanced_parameters() {
if(document.getElementById(\'options\').style.display == \'none\') {
document.getElementById(\'options\').style.display = \'block\';
document.getElementById(\'img_plus_and_minus\').innerHTML=\'&nbsp;<img style="vertical-align:middle;" src="../img/div_hide.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'\';
@ -125,7 +125,7 @@ $form->addRule('fieldtype', get_lang('ThisFieldIsRequired'), 'required');
//Advanced parameters
$form -> addElement('advanced_settings','<a href="javascript://" onclick=" return advanced_parameters()"><span id="img_plus_and_minus"><div style="vertical-align:top;" ><img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'</div></span></a>');
//When edit, the combobox displey the field type displeyed else none
//When edit, the combobox displey the field type displeyed else none
if ( (isset($_GET['action']) && $_GET['action'] == 'edit') && in_array($_GET['field_type'],array(3,4,5,8))) {
$form -> addElement('html','<div id="options" style="display:block">');
} else {
@ -180,7 +180,7 @@ $form->setDefaults($defaults);
if(isset($_GET['field_id']) && !empty($_GET['field_id'])) {
$class="save";
$text=get_lang('buttonEditUserField');
} else {
} else {
$class="add";
$text=get_lang('buttonAddUserField');
}
@ -190,11 +190,11 @@ $form->addElement('html','</div>');
$form->addElement('style_submit_button', 'submit',$text, 'class='.$class.'');
// Validate form
if( $form->validate()) {
$check = Security::check_token('post');
$check = Security::check_token('post');
if($check) {
$field = $form->exportValues();
$fieldlabel = empty($field['fieldlabel'])?$field['fieldtitle']:$field['fieldlabel'];
$fieldlabel = trim(strtolower(str_replace(" ","_",$fieldlabel)));
$fieldlabel = empty($field['fieldlabel'])?$field['fieldtitle']:$field['fieldlabel'];
$fieldlabel = trim(strtolower(str_replace(" ","_",$fieldlabel)));
$fieldtype = $field['fieldtype'];
$fieldtitle = $field['fieldtitle'];
$fielddefault = $field['fielddefaultvalue'];
@ -261,4 +261,4 @@ if(!empty($defaults['fieldtype'])) {
echo '</div>';
// footer
Display::display_footer();
Display::display_footer();

@ -3,10 +3,6 @@
/**
* This file exclusively export calendar items to iCal or similar formats
* @author Yannick Warnier <yannick.warnier@dokeos.com>
* See copyright information in the Dokeos root directory, dokeos_license.txt
*/
/**
* Initialisation
*/
// name of the language file that needs to be included
$language_file = 'agenda';
@ -53,7 +49,7 @@ $event = $agenda->get_event($id);
if (!empty($event)) {
define('ICAL_LANG',api_get_language_isocode());
$ical = new vcalendar();
$ical->setConfig('unique_id',api_get_path(WEB_PATH));
$ical->setProperty( 'method', 'PUBLISH' );
@ -136,8 +132,8 @@ if (!empty($event)) {
default:
header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));
die();
}
}
} else {
header('location:'.Security::remove_XSS($_SERVER['HTTP_REFERER']));
die();
}
}

@ -1,12 +1,9 @@
<?php
/* For licensing terms, see /license.txt */
/**
* See copyright information in the Dokeos root directory, dokeos_license.txt
* @package chamilo.calendar
*/
/**
* Code
*/
// name of the language file that needs to be included
$language_file = 'agenda';
$id=$_GET['id'];
@ -68,4 +65,4 @@ while($row=Database::fetch_array($result)) {
<input type="button" value="<?php echo api_htmlentities(get_lang('Print'), ENT_QUOTES); ?>" onClick="javascript: window.print();" />
</center>
</body>
</html>
</html>

@ -1,9 +1,6 @@
<?php //$Id: $
/*
* See license terms in /dokeos_license.txt
* Copyright (c) 2008 Dokeos SPRL
* Copyright (c) 2008 Eric Marguin <eric.marguin@dokeos.com>
*/
<?php
/* See license terms in /license.txt */
/**
* This is a script used to automatically import a list of users from
* a CSV file into Dokeos.
@ -30,4 +27,4 @@ $client = new nusoap_client(api_get_path(WEB_CODE_PATH).'cron/user_import/servic
// call import_user method
$response = $client->call('import_users', array('filepath' => api_get_path(SYS_CODE_PATH)."upload/users_import.csv", 'security_key'=>$_configuration['security_key']));
echo $response;
echo $response;

@ -1,5 +1,5 @@
<?php //$id:$
/* For licensing terms, see /dokeos_license.txt */
<?php
/* For licensing terms, see /license.txt */
/**
* This file saves every click in the hotspot tool into track_e_hotspots
* @package chamilo.exercise

@ -1,20 +1,17 @@
<?php //$id:$
/* For licensing terms, see /dokeos_license.txt */
<?php
/* For licensing terms, see /license.txt */
/**
* This file saves every click in the hotspot tool into track_e_hotspots
* @package chamilo.exercise
* @author Toon Keppens
* @version $Id: admin.php 10680 2007-01-11 21:26:23Z pcool $
*/
/**
* Code
*/
include 'exercise.class.php';
include 'question.class.php';
include 'answer.class.php';
include '../inc/global.inc.php';
$courseCode = $_GET['coursecode'];
$questionId = $_GET['questionId'];
$coordinates = $_GET['coord'];

@ -1,6 +1,6 @@
<?php //$id: $
/**
* See license terms in /dokeos_license.txt
<?php
/*
* See license terms in /license.txt
* @author Eric Marguin <eric.marguin@dokeos.com>
*/
require_once '../../inc/global.inc.php';

@ -1,10 +1,9 @@
<?php
/**
* A standalone test for the internationalization library.
* @author Ricardo Rodriguez Salazar, 2009.
* @author Ivan Tcholakov, September 2009.
* For licensing terms, see /dokeos_license.txt
* For licensing terms, see /license.txt
*/
//ini_set('memory_limit','128M');
@ -47,4 +46,4 @@ class InternationalizationTests extends TestSuite {
$test = & new InternationalizationTests();
//$test-> run( new HtmlReporter());
?>
?>

File diff suppressed because it is too large Load Diff

@ -1,5 +1,5 @@
<?php
/* For licensing terms, see /dokeos_license.txt */
/* For licensing terms, see /license.txt */
/**
* Shows who is online in a specific session
* @package chamilo.main

Loading…
Cancel
Save