Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into 1.9.x

1.9.x
Yannick Warnier 11 years ago
commit ea5d6b72b7
  1. 1
      main/admin/access_url_add_courses_to_url.php
  2. 54
      main/admin/add_many_session_to_category.php
  3. 6
      main/admin/course_list.php
  4. 1
      main/admin/dashboard_add_courses_to_user.php
  5. 1
      main/admin/inactive_user_list.php
  6. 29
      main/admin/languages.php
  7. 4
      main/admin/promotions.php
  8. 4
      main/admin/session_category_add.php
  9. 5
      main/admin/session_category_edit.php
  10. 13
      main/admin/session_category_list.php
  11. 13
      main/admin/settings.lib.php
  12. 2
      main/admin/settings.php
  13. 2
      main/admin/system_announcements.php
  14. 8
      main/admin/user_add.php
  15. 12
      main/admin/user_edit.php
  16. 5
      main/admin/user_information.php
  17. 2
      main/admin/user_move_stats.php
  18. 6
      main/admin/usergroups.php
  19. 1
      main/coursecopy/classes/CourseBuilder.class.php
  20. 18
      main/coursecopy/classes/Resource.class.php
  21. 2
      main/coursecopy/copy_course.php
  22. 5
      main/create_course/add_course.php
  23. 24
      main/document/create_audio.php
  24. 6
      main/document/document.inc.php
  25. 2
      main/inc/lib/plugin.lib.php
  26. 2
      main/install/configuration.dist.php
  27. 2
      main/newscorm/lp_view.php

@ -17,6 +17,7 @@ require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
$this_section=SECTION_PLATFORM_ADMIN;
api_protect_global_admin_script();
if (!api_get_multiple_access_url()) {
header('Location: index.php');
exit;

@ -86,22 +86,21 @@ function remove_item(origin)
}
</script>';
$formSent=0;
$errorMsg = $firstLetterCourse = $firstLetterSession='';
$CourseList=$SessionList=array();
$courses=$sessions=array();
$Categoryid = intval($_POST['CategorySessionId']);
if ($_POST['formSent']) {
$formSent=$_POST['formSent'];
$formSent = 0;
$errorMsg = $firstLetterCourse = $firstLetterSession = '';
$CourseList = $SessionList = array();
$courses = $sessions = array();
$Categoryid = isset($_POST['CategorySessionId']) ? intval($_POST['CategorySessionId']) : null;
if (isset($_POST['formSent']) && $_POST['formSent']) {
$formSent = $_POST['formSent'];
$SessionCategoryList = $_POST['SessionCategoryList'];
if($Categoryid != 0 && count($SessionCategoryList)>0 ){
if ($Categoryid != 0 && count($SessionCategoryList) > 0) {
$session_id = join(',', $SessionCategoryList);
$sql = "UPDATE $tbl_session SET session_category_id = $Categoryid WHERE id in ($session_id) ";
Database::query($sql);
//header('Location: session_list.php?id_category='.$Categoryid);
header('Location: add_many_session_to_category.php?id_category='.$Categoryid.'&msg=ok');
header('Location: add_many_session_to_category.php?id_category=' . $Categoryid . '&msg=ok');
exit;
} else {
header('Location: add_many_session_to_category.php?msg=error');
@ -113,26 +112,25 @@ if (isset($_GET['id_category'])) {
$Categoryid = intval($_GET['id_category']);
}
if(isset($_GET['msg']) && $_GET['msg']=='error'){
if (isset($_GET['msg']) && $_GET['msg'] == 'error') {
$errorMsg = get_lang('MsgErrorSessionCategory');
}
if(isset($_GET['msg']) && $_GET['msg']=='ok'){
if (isset($_GET['msg']) && $_GET['msg'] == 'ok') {
$OkMsg = get_lang('SessionCategoryUpdate');
}
$page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null;
// display the dokeos header
Display::display_header($tool_name);
$where ='';
$where = '';
$rows_category_session = array();
if((isset($_POST['CategorySessionId']) && $_POST['formSent'] == 0) || isset($_GET['id_category']) ) {
if ((isset($_POST['CategorySessionId']) && $_POST['formSent'] == 0) || isset($_GET['id_category'])) {
$where = 'WHERE session_category_id !='.$Categoryid;
$sql = 'SELECT id, name FROM '.$tbl_session .' WHERE session_category_id ='.$Categoryid.' ORDER BY name';
$result=Database::query($sql);
$where = 'WHERE session_category_id !=' . $Categoryid;
$sql = 'SELECT id, name FROM ' . $tbl_session . ' WHERE session_category_id =' . $Categoryid . ' ORDER BY name';
$result = Database::query($sql);
$rows_category_session = Database::store_result($result);
}
@ -153,13 +151,17 @@ if (api_get_multiple_access_url()) {
$result=Database::query($sql);
$rows_session = Database::store_result($result);
?>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo Security::remove_XSS($_GET['page']); if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
<?php echo '<legend>'.$tool_name.'</legend>'; ?>
<input type="hidden" name="formSent" value="1" />
<?php
if(!empty($errorMsg)) {
<form name="formulaire" method="post"
action="<?php echo api_get_self(); ?>?page=<?php echo $page;
if (!empty($_GET['add'])) {
echo '&add=true';
} ?>" style="margin:0px;">
<?php echo '<legend>' . $tool_name . '</legend>'; ?>
<input type="hidden" name="formSent" value="1"/>
<?php
if (!empty($errorMsg)) {
Display::display_error_message($errorMsg); //main API
}
}
if(!empty($OkMsg)) {
Display::display_confirmation_message($OkMsg); //main API

@ -222,7 +222,7 @@ if (isset ($_POST['action'])) {
$course_codes = $_POST['course'];
if (count($course_codes) > 0) {
foreach ($course_codes as $course_code) {
CourseManager :: delete_course($course_code);
CourseManager::delete_course($course_code);
$obj_cat = new Category();
$obj_cat->update_category_delete($course_code);
}
@ -298,8 +298,8 @@ if (isset ($_GET['search']) && $_GET['search'] == 'advanced') {
break;
}
}
if (isset ($_GET['delete_course'])) {
CourseManager :: delete_course($_GET['delete_course']);
if (isset($_GET['delete_course'])) {
CourseManager::delete_course($_GET['delete_course']);
$obj_cat = new Category();
$obj_cat->update_category_delete($_GET['delete_course']);

@ -17,7 +17,6 @@ require_once '../inc/lib/xajax/xajax.inc.php';
global $_configuration;
// create an ajax object
$xajax = new xajax();
$xajax->registerFunction('search_courses');

@ -41,5 +41,4 @@ while($row = Database::fetch_array($result)) {
//$last_connection_date = UserManager:: delete_inactive_student($user_id, 2, true);
}
/* FOOTER */
Display :: display_footer();

@ -28,6 +28,7 @@ require_once 'sub_language.class.php';
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
$action = isset($_GET['action']) ? $_GET['action'] : null;
//Ajax request
if (isset($_POST['sent_http_request'])) {
@ -50,7 +51,6 @@ if (isset($_POST['sent_http_request'])) {
exit;
}
$htmlHeadXtra[] = '<script>
$(document).ready(function() {
@ -124,13 +124,6 @@ $htmlHeadXtra[] = '<script>
$tbl_admin_languages = Database :: get_main_table(TABLE_MAIN_LANGUAGE);
$tbl_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
/*
==============================================================================
STORING THE CHANGES
==============================================================================
*/
$action = isset($_GET['action']) ? $_GET['action'] : null;
// we change the availability
if ($action == 'makeunavailable') {
if (isset($_GET['id']) && $_GET['id'] == strval(intval($_GET['id']))) {
@ -186,11 +179,6 @@ if (isset($_POST['Submit']) && $_POST['Submit']) {
}
}
/*
==============================================================================
MAIN CODE
==============================================================================
*/
// setting the name of the tool
$tool_name = get_lang('PlatformLanguages');
@ -221,12 +209,6 @@ $sql_select_lang = "SELECT * FROM $tbl_settings_current WHERE category='Languag
$result_select_lang = Database::query($sql_select_lang);
$row_lang = Database::fetch_array($result_select_lang);
/*
--------------------------------------
DISPLAY THE TABLE
--------------------------------------
*/
// the table data
$language_data = array();
while ($row = Database::fetch_array($result_select)) {
@ -278,6 +260,9 @@ while ($row = Database::fetch_array($result_select)) {
$allow_add_term_sub_language = "&nbsp;<a href='sub_language.php?action=registersublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('2rightarrow.gif', get_lang('AddWordForTheSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>";
$allow_delete_sub_language = "&nbsp;<a href='sub_language_add.php?action=deletesublanguage&id=" . Security::remove_XSS($all_information_of_sub_language['parent_id']) . "&sub_language_id=" . Security::remove_XSS($row['id']) . "'>" . Display::return_icon('delete.png', get_lang('DeleteSubLanguage'), array('width' => ICON_SIZE_SMALL, 'height' => ICON_SIZE_SMALL)) . "</a>";
}
} else {
$allow_use_sub_language = '';
$allow_add_term_sub_language = '';
}
if ($row['english_name'] == $row_lang['selected_value']) {
@ -306,10 +291,4 @@ $table->set_form_actions($form_actions);
echo '<div id="id_content_message">&nbsp;</div>';
$table->display();
/*
==============================================================================
FOOTER
==============================================================================
*/
Display :: display_footer();
?>

@ -58,7 +58,7 @@ $column_model = array(
array('name'=>'career', 'index'=>'career', 'width'=>'100', 'align'=>'left'),
array('name'=>'description', 'index'=>'description', 'width'=>'500', 'align'=>'left','sortable'=>'false'),
array('name'=>'actions', 'index'=>'actions', 'width'=>'100', 'align'=>'left','formatter'=>'action_formatter','sortable'=>'false'),
);
);
$extra_params['autowidth'] = 'true'; //use the width of the parent
//$extra_params['editurl'] = $url; //use the width of the parent
@ -69,7 +69,7 @@ $action_links = 'function action_formatter (cellvalue, options, rowObject) {
'&nbsp;<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=copy&id=\'+options.rowId+\'">'.Display::return_icon('copy.png',get_lang('Copy'),'',ICON_SIZE_SMALL).'</a>'.
'&nbsp;<a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a> \';
}';
}';
?>
<script>

@ -31,7 +31,7 @@ $interbreadcrumb[]=array('url' => "session_category_list.php","name" => get_lang
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_session = Database::get_main_table(TABLE_MAIN_SESSION);
if ($_POST['formSent']) {
if (isset($_POST['formSent']) && $_POST['formSent']) {
$formSent=1;
$name= $_POST['name'];
$year_start= $_POST['year_start'];
@ -233,4 +233,4 @@ function setDisable(select) {
</script>
<?php
Display::display_footer();
?>

@ -220,11 +220,9 @@ for($i=$thisYear-5;$i <= ($thisYear+5);$i++)
</td>
</tr>
</table>
</form>
<script type="text/javascript">
<script>
<?php if($year_start=="0000") echo "setDisable(document.form.nolimit);\r\n"; ?>
function setDisable(select){
document.form.day_start.disabled = (select.checked) ? true : false;
@ -237,4 +235,3 @@ function setDisable(select){
</script>
<?php
Display::display_footer();
?>

@ -17,9 +17,8 @@ api_protect_admin_script(true);
// setting the section (for the tabs)
$this_section = SECTION_PLATFORM_ADMIN;
$htmlHeadXtra[] =
'<script>
function selectAll(idCheck,numRows,action) {
$htmlHeadXtra[] = '<script>
function selectAll(idCheck,numRows,action) {
for(i=0;i<numRows;i++) {
idcheck = document.getElementById(idCheck+"_"+i);
if (action == "true"){
@ -28,7 +27,6 @@ $htmlHeadXtra[] =
idcheck.checked = false;
}
}
}
</script>';
$tbl_session_category = Database::get_main_table(TABLE_MAIN_SESSION_CATEGORY);
@ -75,9 +73,6 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
} else {
$where .= (empty($_REQUEST['keyword']) ? "" : " WHERE name LIKE '%".Database::escape_string(trim($_REQUEST['keyword']))."%'");
}
if (empty($where)) {
$where = " WHERE access_url_id = ".api_get_current_access_url_id()." ";
} else {
@ -206,9 +201,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
?>
</table>
<br />
<div align="left">
<?php
if ($num > $limit) {
if ($page) {
@ -221,9 +214,7 @@ if (isset($_GET['search']) && $_GET['search'] == 'advanced') {
echo get_lang('Previous');
}
?>
|
<?php
if ($nbr_results > $limit) {
?>

@ -238,6 +238,8 @@ function handle_stylesheets()
}
}
// Stylesheet upload.
if (isset($_POST['stylesheet_upload'])) {
if ($form->validate()) {
$values = $form->exportValues();
@ -717,6 +719,7 @@ function handle_search()
* Wrapper for the templates
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, Belgium
* @author Julio Montoya.
* @version August 2008
* @since Dokeos 1.8.6
*/
@ -747,7 +750,6 @@ function handle_templates() {
$category = $_GET['category'];
event_system(LOG_CONFIGURATION_SETTINGS_CHANGE, LOG_CONFIGURATION_SETTINGS_CATEGORY, $category, api_get_utc_datetime(), $user_id);
}
display_templates();
}
}
@ -969,7 +971,7 @@ function add_edit_template() {
if ($_GET['action'] == 'add') {
$content_template = '<head>{CSS}<style type="text/css">.text{font-weight: normal;}</style></head><body>'.Database::escape_string($values['template_text']).'</body>';
$sql = "INSERT INTO $table_system_template (title, content, image) VALUES ('".Database::escape_string($values['title'])."','".$content_template."','".Database::escape_string($new_file_name)."')";
$result = Database::query($sql);
Database::query($sql);
// Display a feedback message.
Display::display_confirmation_message(get_lang('TemplateAdded'));
@ -981,7 +983,7 @@ function add_edit_template() {
$sql .= ", image = '".Database::escape_string($new_file_name)."'";
}
$sql .= " WHERE id='".Database::escape_string($_GET['id'])."'";
$result = Database::query($sql);
Database::query($sql);
// Display a feedback message.
Display::display_confirmation_message(get_lang('TemplateEdited'));
@ -1030,7 +1032,7 @@ function delete_template($id) {
/**
* Returns the list of timezone identifiers used to populate the select
*
* This function is called through a call_user_func() in the generate_settings_form function.
* @return array List of timezone identifiers
*
* @author Guillaume Viguier <guillaume.viguier@beeznest.com>
@ -1042,7 +1044,7 @@ function select_timezone_value() {
/**
* Returns an array containing the list of options used to populate the gradebook_number_decimals variable
*
* This function is called through a call_user_func() in the generate_settings_form function.
* @return array List of gradebook_number_decimals options
*
* @author Guillaume Viguier <guillaume.viguier@beeznest.com>
@ -1106,7 +1108,6 @@ function generate_settings_form($settings, $settings_by_access_list) {
}
$default_values = array();
$url_info = api_get_access_url($url_id);
$i = 0;

@ -164,7 +164,7 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
if (!empty($data)) {
foreach ($data as $item) {
$params = array('id' =>$item['id'], 'access_url_changeable' => $changeable);
$params = array('id' => $item['id'], 'access_url_changeable' => $changeable);
api_set_setting_simple($params);
}
}

@ -65,7 +65,7 @@ $show_announcement_list = true;
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
// Form was posted?
if (isset ($_POST['action'])) {
if (isset($_POST['action'])) {
$action_todo = true;
}

@ -163,9 +163,9 @@ if (api_get_setting('login_is_email') != 'true') {
$group = array();
$auth_sources = 0; //make available wider as we need it in case of form reset (see below)
$nb_ext_auth_source_added = 0;
if (count($extAuthSource) > 0) {
if (isset($extAuthSource) && count($extAuthSource) > 0) {
$auth_sources = array();
foreach($extAuthSource as $key => $info) {
foreach ($extAuthSource as $key => $info) {
// @todo : make uniform external authentification configuration (ex : cas and external_login ldap)
// Special case for CAS. CAS is activated from Chamilo > Administration > Configuration > CAS
// extAuthSource always on for CAS even if not activated
@ -291,9 +291,9 @@ if( $form->validate()) {
$picture = $_FILES['picture'];
$platform_admin = intval($user['admin']['platform_admin']);
$send_mail = intval($user['mail']['send_mail']);
$hr_dept_id = intval($user['hr_dept_id']);
$hr_dept_id = isset($user['hr_dept_id']) ? intval($user['hr_dept_id']) : 0;
if (count($extAuthSource) > 0 && $user['password']['password_auto'] == '2') {
if (isset($extAuthSource) && count($extAuthSource) > 0 && $user['password']['password_auto'] == '2') {
$auth_source = $user['password']['auth_source'];
$password = 'PLACEHOLDER';
} else {

@ -180,7 +180,7 @@ if (api_get_setting('login_is_email') != 'true') {
// Password
$form->addElement('radio', 'reset_password', get_lang('Password'), get_lang('DontResetPassword'), 0);
$nb_ext_auth_source_added = 0;
if (isset($extAuthSource) && count($extAuthSource) > 0) {
if (isset($extAuthSource) && !empty($extAuthSource) && count($extAuthSource) > 0) {
$auth_sources = array();
foreach ($extAuthSource as $key => $info) {
// @todo : make uniform external authentification configuration (ex : cas and external_login ldap)
@ -194,9 +194,9 @@ if (isset($extAuthSource) && count($extAuthSource) > 0) {
}
if ($nb_ext_auth_source_added > 0) {
// @todo check the radio button for external authentification and select the external authentification in the menu
$group[] =$form->createElement('radio', 'reset_password', null, get_lang('ExternalAuthentication').' ', 3);
$group[] =$form->createElement('select', 'auth_source', null, $auth_sources);
$group[] =$form->createElement('static', '', '', '<br />');
$group[] = $form->createElement('radio', 'reset_password', null, get_lang('ExternalAuthentication').' ', 3);
$group[] = $form->createElement('select', 'auth_source', null, $auth_sources);
$group[] = $form->createElement('static', '', '', '<br />');
$form->addGroup($group, 'password', null, '', false);
}
}
@ -252,8 +252,8 @@ $form->addElement('select_language', 'language', get_lang('Language'));
// Send email
$group = array();
$group[] =$form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1);
$group[] =$form->createElement('radio', 'send_mail', null, get_lang('No'), 0);
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('Yes'), 1);
$group[] = $form->createElement('radio', 'send_mail', null, get_lang('No'), 0);
$form->addGroup($group, 'mail', get_lang('SendMailToNewUser'), '&nbsp;', false);
// Registration User and Date

@ -23,10 +23,6 @@ if (!isset($_GET['user_id'])) {
}
$user = api_get_user_info($_GET['user_id']);
$tool_name = $user['complete_name'].(empty($user['official_code'])?'':' ('.$user['official_code'].')');
/**
* Display
*/
Display::display_header($tool_name);
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
@ -121,7 +117,6 @@ if (count($sessions) > 0) {
$header[] = array (get_lang('Status'), true);
$header[] = array ('', false);
foreach ($sessions as $session_item) {
$data = array ();

@ -190,7 +190,6 @@ if (isset($_REQUEST['load_ajax'])) {
}
}
//2.track_e_attempt, track_e_attempt_recording, track_e_downloads
//Nothing to do because there are not relationship with a session
@ -236,7 +235,6 @@ if (isset($_REQUEST['load_ajax'])) {
}
//5. lp_item_view
//CHECK ORIGIN
$sql = "SELECT * FROM $TBL_LP_VIEW WHERE user_id = $user_id AND session_id = $origin_session_id AND c_id = $course_id ";

@ -173,10 +173,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'add') {
$form->setConstants(array('sec_token' => $token));
$form->display();
}
}
// Action handling: deleting a note
elseif (isset($_GET['action']) && $_GET['action'] == 'delete' && is_numeric($_GET['id'])) {
} elseif (isset($_GET['action']) && $_GET['action'] == 'delete' && is_numeric($_GET['id'])) {
$res = $usergroup->delete(Security::remove_XSS($_GET['id']));
if ($res) {
Display::display_confirmation_message(get_lang('Deleted'));
@ -185,5 +182,4 @@ elseif (isset($_GET['action']) && $_GET['action'] == 'delete' && is_numeric($_GE
} else {
$usergroup->display();
}
Display :: display_footer();

@ -82,7 +82,6 @@ class CourseBuilder
$this->course->path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/';
$this->course->backup_path = api_get_path(SYS_COURSE_PATH).$_course['path'];
$this->course->encoding = api_get_system_encoding(); //current platform encoding
$this->course->db_name = $_course['dbName'];
$this->course->info = $_course;
}

@ -113,7 +113,8 @@ class Resource
* Returns the id of this resource.
* @return int The id of this resource in the source course.
*/
function get_id() {
function get_id()
{
return $this->source_id;
}
@ -121,7 +122,8 @@ class Resource
* Resturns the type of this resource
* @return constant The type.
*/
function get_type() {
function get_type()
{
return $this->type;
}
@ -133,7 +135,8 @@ class Resource
* @todo once the RESOURCE_* constants are replaced by the globally
* defined TOOL_* constants, this function will be replaced by get_type()
*/
function get_tool($for_item_property_table = true) {
function get_tool($for_item_property_table = true)
{
switch ($this->get_type()) {
case RESOURCE_DOCUMENT:
return TOOL_DOCUMENT;
@ -195,7 +198,8 @@ class Resource
* Set the destination id
* @param int $id The id of this resource in the destination course.
*/
function set_new_id($id) {
function set_new_id($id)
{
$this->destination_id = $id;
}
@ -203,14 +207,16 @@ class Resource
* Check if this resource is allready restored in the destination course.
* @return bool true if allready restored (i.e. destination_id is set).
*/
function is_restored() {
function is_restored()
{
return $this->destination_id > -1;
}
/**
* Show this resource
*/
function show() {
function show()
{
//echo 'RESOURCE: '.$this->get_id().' '.$type[$this->get_type()].' ';
}
}

@ -47,7 +47,7 @@ echo Display::page_header(get_lang('CopyCourse'));
// If a CourseSelectForm is posted or we should copy all resources, then copy them
if ((isset($_POST['action']) && $_POST['action'] == 'course_select_form') || (isset($_POST['copy_option']) && $_POST['copy_option'] == 'full_copy')) {
if (isset($_POST['action']) && $_POST['action'] == 'course_select_form') {
$course = CourseSelectForm::get_posted_course('copy_course');
$course = CourseSelectForm :: get_posted_course('copy_course');
} else {
$cb = new CourseBuilder();
$course = $cb->build();

@ -152,12 +152,10 @@ if ($course_validation_feature) {
$form->addElement('checkbox', 'legal', null, get_lang('IAcceptTermsAndConditions'), 1);
$form->addRule('legal', get_lang('YouHaveToAcceptTermsAndConditions'), 'required');
// Link to terms and conditions.
$link_terms_and_conditions = '<script type="text/JavaScript">
<!--
$link_terms_and_conditions = '<script>
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script><a href="#" onclick="javascript: MM_openBrWindow(\''.$terms_and_conditions_url.'\',\'Conditions\',\'scrollbars=yes, width=800\')">';
$link_terms_and_conditions .= get_lang('ReadTermsAndConditions').'</a>';
$form->addElement('label', null, $link_terms_and_conditions);
@ -266,7 +264,6 @@ if ($form->validate()) {
// Display the form.
$content = $form->return_form();
}
} else {
if (!$course_validation_feature) {
$message = Display :: return_message(get_lang('Explanation'));

@ -186,10 +186,9 @@ $(document).ready(function(){
</style>
<div id="textareaCallBack"></div>
<?php
if(Security::remove_XSS($_POST['text2voice_mode'])=='google'){
if (Security::remove_XSS($_POST['text2voice_mode'])=='google') {
downloadMP3_google($filepath, $dir);
}
elseif(Security::remove_XSS($_POST['text2voice_mode'])=='pediaphon'){
} elseif (Security::remove_XSS($_POST['text2voice_mode']) == 'pediaphon') {
downloadMP3_pediaphon($filepath, $dir);
}
@ -311,13 +310,10 @@ $(document).ready(function(){
$result_select = Database::query($sql_select);
echo '<select name="lang" id="select">';
while ($row = Database::fetch_array($result_select)) {
if (in_array($row['isocode'], array('ca', 'en', 'es', 'hi', 'it', 'pt'))){
if (in_array($row['isocode'], array('ca', 'en', 'es', 'hi', 'it', 'pt'))) {
if (api_get_setting('platformLanguage')==$row['english_name']){
echo '<option value="'.$row['isocode'].'" selected="selected">'.$row['original_name'].' ('.$row['english_name'].')</option>';
}
else{
} else {
echo '<option value="'.$row['isocode'].'">'.$row['original_name'].' ('.$row['english_name'].')</option>';
}
}
@ -356,7 +352,8 @@ Display :: display_footer();
* @author Juan Carlos Raña Trabado <herodoto@telefonica.net>
* @version january 2011, chamilo 1.8.8
*/
function downloadMP3_google($filepath, $dir) {
function downloadMP3_google($filepath, $dir)
{
$location='create_audio.php?'.api_get_cidreq().'&id='.Security::remove_XSS($_POST['document_id']).'&dt2a=google';
//security
@ -469,9 +466,6 @@ function downloadMP3_pediaphon($filepath, $dir){
$documentPath = $filepath.'/'.$audio_filename;
//prev for a fine unicode, borrowed from main api TODO:clean
// Safe replacements for some non-letter characters (whitout blank spaces)
$search = array("\0", "\t", "\n", "\r", "\x0B", '/', "\\", '"', "'", '?', '*', '>', '<', '|', ':', '$', '(', ')', '^', '[', ']', '#', '+', '&', '%');
@ -488,12 +482,10 @@ function downloadMP3_pediaphon($filepath, $dir){
//adding the file
if ($clean_lang=='de'){
if ($clean_lang=='de') {
$url_pediaphon='http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice.cgi';
$find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/(.*)\.mp3\"/';
}
else{
} else {
$url_pediaphon='http://www.pediaphon.org/~bischoff/radiopedia/sprich_multivoice_'.$clean_lang.'.cgi';//en, es, fr
$find_t2v = '/http\:\/\/www\.pediaphon\.org\/\~bischoff\/radiopedia\/mp3\/'.$clean_lang.'\/(.*)\.mp3\"/';
}

@ -1,5 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
/**
* EXTRA FUNCTIONS FOR DOCUMENTS TOOL
@ -180,9 +179,6 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
$tooltip_title = $title;
//Cut long titles
//$title = cut($title, 120);
$tooltip_title_alt = $tooltip_title;
if ($path == '/shared_folder') {
$tooltip_title_alt = get_lang('UserFolders');
@ -297,6 +293,7 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
(preg_match('/wav$/i', urldecode($url)) && !preg_match('/_chnano_.wav$/i', urldecode($url))) ||
preg_match('/ogg$/i', urldecode($url))) {
$sound_preview = DocumentManager::generate_media_preview($counter);
return $sound_preview;
} elseif (
//Show preview
@ -326,6 +323,7 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
(preg_match('/wav$/i', urldecode($url)) && !preg_match('/_chnano_.wav$/i', urldecode($url))) ||
preg_match('/ogg$/i', urldecode($url))) {
$sound_preview = DocumentManager::generate_media_preview($counter);
return $sound_preview;
} elseif (
//Show preview

@ -482,7 +482,7 @@ class AppPlugin
if (file_exists($plugin_path)) {
require $plugin_path;
if (isset($plugin_info) && isset($plugin_info['plugin_class'])) {
if (isset($plugin_info) && isset($plugin_info['plugin_class']) && $obj->isCoursePlugin) {
$obj->course_install($courseId);
}
}

@ -194,3 +194,5 @@ $_configuration['system_stable'] = NEW_VERSION_STABLE;
//$_configuration['save_user_last_login'] = true;
// Allow course tutors in sessions to add existing students to their session
//$_configuration['allow_tutors_to_assign_students_to_session'] = 'false';
// Allow select the return link in the LP view
//$_configuration['allow_lp_return_link'] = 'false';

@ -41,7 +41,9 @@ api_protect_course_script();
$lp_id = intval($_GET['lp_id']);
// Check if the learning path is visible for student - (LP requisites)
if (!api_is_allowed_to_edit(null, true) && !learnpath::is_lp_visible_for_student($lp_id, api_get_user_id())) {
api_not_allowed(true);
}

Loading…
Cancel
Save