|
|
|
@ -434,8 +434,9 @@ switch ($action) { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$form->addElement('hidden', 'item_id', $item_id); |
|
|
|
$form->addElement('hidden', 'item_id', $item_id); |
|
|
|
} |
|
|
|
} |
|
|
|
$form->addElement('text', 'title', get_lang('Title'), 'id="file_upload" style="width: 350px;"'); |
|
|
|
$form->addElement('text', 'title', get_lang('Title'), array('id' => 'file_upload', 'class' => 'span4')); |
|
|
|
$form->addElement('textarea', 'description', get_lang("Description"), 'style="width: 350px; height: 60px;"'); |
|
|
|
//$form->addElement('html_editor', 'description', get_lang("Description")); |
|
|
|
|
|
|
|
$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'Work', 'Width' => '100%', 'Height' => '200')); |
|
|
|
|
|
|
|
|
|
|
|
if ($item_id && !empty($work_item)) { |
|
|
|
if ($item_id && !empty($work_item)) { |
|
|
|
$defaults['title'] = $work_item['title']; |
|
|
|
$defaults['title'] = $work_item['title']; |
|
|
|
@ -519,6 +520,8 @@ switch ($action) { |
|
|
|
if (isset($_POST['submitWork']) && !empty($is_course_member)) { |
|
|
|
if (isset($_POST['submitWork']) && !empty($is_course_member)) { |
|
|
|
$authors = api_get_person_name($currentUserFirstName, $currentUserLastName); |
|
|
|
$authors = api_get_person_name($currentUserFirstName, $currentUserLastName); |
|
|
|
$url = null; |
|
|
|
$url = null; |
|
|
|
|
|
|
|
$contains_file = 0; |
|
|
|
|
|
|
|
|
|
|
|
if ($_POST['contains_file'] && !empty($_FILES['file']['size'])) { |
|
|
|
if ($_POST['contains_file'] && !empty($_FILES['file']['size'])) { |
|
|
|
$updir = $currentCourseRepositorySys . 'work/'; //directory path to upload |
|
|
|
$updir = $currentCourseRepositorySys . 'work/'; //directory path to upload |
|
|
|
|
|
|
|
|
|
|
|
@ -549,8 +552,11 @@ switch ($action) { |
|
|
|
$new_file_name = api_get_unique_id(); |
|
|
|
$new_file_name = api_get_unique_id(); |
|
|
|
|
|
|
|
|
|
|
|
//if we come from the group tools the groupid will be saved in $work_table |
|
|
|
//if we come from the group tools the groupid will be saved in $work_table |
|
|
|
@move_uploaded_file($_FILES['file']['tmp_name'], $updir.$curdirpath.'/'.$new_file_name); |
|
|
|
$result = @move_uploaded_file($_FILES['file']['tmp_name'], $updir.$curdirpath.'/'.$new_file_name); |
|
|
|
$url = 'work'.$curdirpath.'/'.$new_file_name; |
|
|
|
if ($result) { |
|
|
|
|
|
|
|
$url = 'work'.$curdirpath.'/'.$new_file_name; |
|
|
|
|
|
|
|
$contains_file = 1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (empty($title)) { |
|
|
|
if (empty($title)) { |
|
|
|
@ -564,7 +570,7 @@ switch ($action) { |
|
|
|
title = '" . Database::escape_string($title) . "', |
|
|
|
title = '" . Database::escape_string($title) . "', |
|
|
|
description = '" . Database::escape_string($description) . "', |
|
|
|
description = '" . Database::escape_string($description) . "', |
|
|
|
author = '" . Database::escape_string($authors) . "', |
|
|
|
author = '" . Database::escape_string($authors) . "', |
|
|
|
contains_file = '".intval($_POST['contains_file'])."', |
|
|
|
contains_file = '".$contains_file."', |
|
|
|
active = '" . $active . "', |
|
|
|
active = '" . $active . "', |
|
|
|
accepted = '1', |
|
|
|
accepted = '1', |
|
|
|
post_group_id = '".$group_id."', |
|
|
|
post_group_id = '".$group_id."', |
|
|
|
@ -742,11 +748,11 @@ switch ($action) { |
|
|
|
$form->addElement('hidden', 'curdirpath', Security :: remove_XSS($curdirpath)); |
|
|
|
$form->addElement('hidden', 'curdirpath', Security :: remove_XSS($curdirpath)); |
|
|
|
// $form->addElement('hidden', 'sec_token', $token); |
|
|
|
// $form->addElement('hidden', 'sec_token', $token); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form->addElement('text', 'new_dir', get_lang('AssignmentName')); |
|
|
|
$form->addElement('text', 'new_dir', get_lang('AssignmentName')); |
|
|
|
$form->addRule('new_dir', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
$form->addRule('new_dir', get_lang('ThisFieldIsRequired'), 'required'); |
|
|
|
|
|
|
|
|
|
|
|
$form->addElement('html_editor', 'description', get_lang('Description')); |
|
|
|
//$form->addElement('html_editor', 'description', get_lang('Description')); |
|
|
|
|
|
|
|
$form->add_html_editor('description', get_lang('Description'), false, false, array('ToolbarSet' => 'Work', 'Width' => '100%', 'Height' => '200')); |
|
|
|
|
|
|
|
|
|
|
|
$form->addElement('advanced_settings', '<a href="javascript: void(0);" onclick="javascript: return plus();"><span id="plus">'.Display::return_icon('div_show.gif',get_lang('AdvancedParameters'), array('style' => 'vertical-align:center')).' '.get_lang('AdvancedParameters').'</span></a>'); |
|
|
|
$form->addElement('advanced_settings', '<a href="javascript: void(0);" onclick="javascript: return plus();"><span id="plus">'.Display::return_icon('div_show.gif',get_lang('AdvancedParameters'), array('style' => 'vertical-align:center')).' '.get_lang('AdvancedParameters').'</span></a>'); |
|
|
|
|
|
|
|
|
|
|
|
@ -761,7 +767,6 @@ switch ($action) { |
|
|
|
$form->addElement('text', 'weight', get_lang('WeightInTheGradebook')); |
|
|
|
$form->addElement('text', 'weight', get_lang('WeightInTheGradebook')); |
|
|
|
$form->addElement('html', '</div>'); |
|
|
|
$form->addElement('html', '</div>'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$form->addElement('checkbox', 'type1', null, get_lang('EnableExpiryDate'), array('id' =>'make_calification_id', 'onclick' => "javascript: if(this.checked){document.getElementById('option2').style.display='block';}else{document.getElementById('option2').style.display='none';}")); |
|
|
|
$form->addElement('checkbox', 'type1', null, get_lang('EnableExpiryDate'), array('id' =>'make_calification_id', 'onclick' => "javascript: if(this.checked){document.getElementById('option2').style.display='block';}else{document.getElementById('option2').style.display='none';}")); |
|
|
|
|
|
|
|
|
|
|
|
$form->addElement('html', '<div id="option2" style="display: none;">'); |
|
|
|
$form->addElement('html', '<div id="option2" style="display: none;">'); |
|
|
|
@ -808,20 +813,20 @@ switch ($action) { |
|
|
|
$sql_add_publication = "INSERT INTO " . $work_table . " SET |
|
|
|
$sql_add_publication = "INSERT INTO " . $work_table . " SET |
|
|
|
c_id = $course_id, |
|
|
|
c_id = $course_id, |
|
|
|
url = '".Database::escape_string($dir_name_sql)."', |
|
|
|
url = '".Database::escape_string($dir_name_sql)."', |
|
|
|
title = '".Database::escape_string($_POST['new_dir'])."', |
|
|
|
title = '".Database::escape_string($_POST['new_dir'])."', |
|
|
|
description = '".Database::escape_string($_POST['description'])."', |
|
|
|
description = '".Database::escape_string($_POST['description'])."', |
|
|
|
author = '', |
|
|
|
author = '', |
|
|
|
active = '0', |
|
|
|
active = '0', |
|
|
|
accepted = '1', |
|
|
|
accepted = '1', |
|
|
|
filetype = 'folder', |
|
|
|
filetype = 'folder', |
|
|
|
post_group_id = '".$group_id."', |
|
|
|
post_group_id = '".$group_id."', |
|
|
|
sent_date = '".$today."', |
|
|
|
sent_date = '".$today."', |
|
|
|
qualification = '".(($_POST['qualification_value']!='') ? Database::escape_string($_POST['qualification_value']) : '') ."', |
|
|
|
qualification = '".(($_POST['qualification_value']!='') ? Database::escape_string($_POST['qualification_value']) : '') ."', |
|
|
|
parent_id = '', |
|
|
|
parent_id = '', |
|
|
|
qualificator_id = '', |
|
|
|
qualificator_id = '', |
|
|
|
date_of_qualification = '0000-00-00 00:00:00', |
|
|
|
date_of_qualification = '0000-00-00 00:00:00', |
|
|
|
weight = '".Database::escape_string($_POST['weight'])."', |
|
|
|
weight = '".Database::escape_string($_POST['weight'])."', |
|
|
|
session_id = '".intval($id_session)."', |
|
|
|
session_id = '".intval($id_session)."', |
|
|
|
allow_text_assignment = '".Database::escape_string($_POST['allow_text_assignment'])."', |
|
|
|
allow_text_assignment = '".Database::escape_string($_POST['allow_text_assignment'])."', |
|
|
|
contains_file = 0, |
|
|
|
contains_file = 0, |
|
|
|
user_id = '".$user_id."'"; |
|
|
|
user_id = '".$user_id."'"; |
|
|
|
@ -1093,7 +1098,6 @@ switch ($action) { |
|
|
|
$my_cur_dir_path = $curdirpath; |
|
|
|
$my_cur_dir_path = $curdirpath; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($my_folder_data['description'])) { |
|
|
|
if (!empty($my_folder_data['description'])) { |
|
|
|
echo '<p><div><strong>'.get_lang('Description').':</strong><p>'.Security::remove_XSS($my_folder_data['description'], STUDENT).'</p></div></p>'; |
|
|
|
echo '<p><div><strong>'.get_lang('Description').':</strong><p>'.Security::remove_XSS($my_folder_data['description'], STUDENT).'</p></div></p>'; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1135,7 +1139,6 @@ switch ($action) { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$extra_params = array(); |
|
|
|
$extra_params = array(); |
|
|
|
|
|
|
|
|
|
|
|
//Autowidth |
|
|
|
//Autowidth |
|
|
|
|