skala
Juan Carlos Raña 14 years ago
commit 17581b3927
  1. 4
      main/document/create_document.php
  2. 1
      main/document/document.inc.php
  3. 52
      main/document/document.php
  4. 11
      main/inc/lib/fckeditor/fcktemplates.xml.php
  5. 49
      main/inc/lib/fckeditor/toolbars/extended/documents.php
  6. 48
      main/inc/lib/fckeditor/toolbars/extended/documents_student.php
  7. 2
      main/inc/lib/fckeditor/toolbars/extended/wiki_feedback.php
  8. 5
      main/install/db_main.sql
  9. 4
      main/install/migrate-db-1.8.7-1.8.8-pre.sql

@ -169,6 +169,7 @@ require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
if (isset($_REQUEST['certificate'])) {
$nameTools = get_lang('CreateCertificate');
} else {
@ -412,7 +413,8 @@ $folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is
// If we are not in the certificates creation, display a folder chooser for the
// new document created
if (!$is_certificate_mode) {
if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $_GET['dir'], $current_session_id)) {
$folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit);
//$parent_select -> addOption(get_lang('HomeDirectory'), '/');
$parent_select = $form->addElement('select', 'curdirpath', get_lang('DestinationDirectory'));

@ -359,7 +359,6 @@ function build_edit_icons($curdirpath, $type, $path, $visibility, $id, $is_templ
} else {
$modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;remove_as_template='.$id.$req_gid.'&amp;'.$sort_params.'"><img src="../img/wizard_gray_small.gif" border="0" title="'.get_lang('RemoveAsTemplate').'" alt=""'.get_lang('RemoveAsTemplate').'" /></a>';
}
//$modify_icons .= '&nbsp;<a href="export_htmldoc2pdf.php?'.api_get_cidreq().'&curdirpath='.$curdirpath.'&amp;file='.urlencode($path).$req_gid.'"><img src="../img/file_pdf_small.gif" border="0" title="'.get_lang('Export2PDF').'" alt="" /></a>';
$modify_icons .= '&nbsp;<a href="'.api_get_self().'?'.api_get_cidreq().'&action=export_to_pdf&id='.$id.'"><img src="../img/file_pdf_small.gif" border="0" title="'.get_lang('Export2PDF').'" alt="" /></a>';
}

@ -311,17 +311,18 @@ if (isset($_GET['action']) && $_GET['action'] == 'downloadfolder' && (api_get_se
if(is_my_shared_folder($_user['user_id'], $_GET['path'], $current_session_id) || api_is_allowed_to_edit() || api_is_platform_admin()){
require 'downloadfolder.inc.php';
}
} else {
}
else{
require 'downloadfolder.inc.php';
}
}
if (isset($_GET['action']) && $_GET['action'] == 'export_to_pdf') {
// Export to PDF
if (isset($_GET['action']) && $_GET['action'] == 'export_to_pdf' && (api_get_setting('students_export2pdf') == 'true' || api_is_allowed_to_edit() || api_is_platform_admin())) {
DocumentManager::export_to_pdf($_GET['id'],$course_code);
}
// Slideshow inititalisation
$_SESSION['image_files_only'] = '';
$image_files_only = '';
@ -436,10 +437,11 @@ if (isset($_GET['action']) && $_GET['action'] == 'copytomyfiles' && api_get_sett
}
}
if ($is_allowed_to_edit || $group_member_with_upload_rights) { // TEACHER ONLY
//START ACTION MENU
/* MOVE FILE OR DIRECTORY */
//Only teacher and all users into their group
if($is_allowed_to_edit || $group_member_with_upload_rights){
$my_get_move = Security::remove_XSS($_GET['move']);
if (isset($_GET['move']) && $_GET['move'] != '') {
@ -458,7 +460,6 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights) { // TEACHER ONLY
if (DocumentManager::get_document_id($_course, $my_get_move)) {
$folders = DocumentManager::get_all_document_folders($_course, $to_group_id, $is_allowed_to_edit || $group_member_with_upload_rights);
echo '<div class="row"><div class="form_header">'.get_lang('Move').'</div></div>';
echo build_move_to_selector($folders, Security::remove_XSS($_GET['curdirpath']), $my_get_move, $group_properties['directory']);
}
@ -498,9 +499,10 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights) { // TEACHER ONLY
Display::display_error_message(get_lang('Impossible'));
}
}
}
/* DELETE FILE OR DIRECTORY */
//Only teacher and all users into their group
if($is_allowed_to_edit || $group_member_with_upload_rights){
if (isset($_GET['delete'])) {
if (api_is_coach()) {
@ -555,9 +557,11 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights) { // TEACHER ONLY
break;
}
}
}
/* CREATE DIRECTORY */
//Only teacher and all users into their group
if($is_allowed_to_edit || $group_member_with_upload_rights){
// Create directory with $_POST data
if (isset($_POST['create_dir']) && $_POST['dirname'] != '') {
// Needed for directory creation
@ -593,9 +597,11 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights) { // TEACHER ONLY
if (isset($_GET['createdir'])) {
echo create_dir_form();
}
}
/* VISIBILITY COMMANDS */
//Only teacher and all users into their group
if($is_allowed_to_edit || $group_member_with_upload_rights){
if ((isset($_GET['set_invisible']) && !empty($_GET['set_invisible'])) || (isset($_GET['set_visible']) && !empty($_GET['set_visible'])) && $_GET['set_visible'] != '*' && $_GET['set_invisible'] != '*') {
// Make visible or invisible?
if (isset($_GET['set_visible'])) {
@ -625,9 +631,11 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights) { // TEACHER ONLY
Display::display_error_message(get_lang('ViModProb'));
}
}
}
/* TEMPLATE ACTION */
//Only teacher and all users into their group
if($is_allowed_to_edit || $group_member_with_upload_rights){
if (isset($_GET['add_as_template']) && !isset($_POST['create_template'])) {
$document_id_for_template = intval($_GET['add_as_template']);
@ -715,7 +723,9 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights) { // TEACHER ONLY
DocumentManager::unset_document_as_template($document_id_for_template, $course_code, $user_id);
Display::display_confirmation_message(get_lang('DocumentUnsetAsTemplate'));
}
} // END is allowed to edit
}
// END ACTION MENU
// Attach certificate in the gradebook
if (isset($_GET['curdirpath']) && $_GET['curdirpath'] == '/certificates' && isset($_GET['set_certificate']) && $_GET['set_certificate'] == strval(intval($_GET['set_certificate']))) {
@ -831,9 +841,8 @@ if (isset($docs_and_folders) && is_array($docs_and_folders)) {
$last_edit_date = api_get_local_time($last_edit_date, null, date_default_timezone_get());
$display_date = date_to_str_ago($last_edit_date).'<br /><span class="dropbox_date">'.api_format_date($last_edit_date).'</span>';
$row[] = $invisibility_span_open.$display_date.$invisibility_span_close;
// Admins get an edit column
if ($is_allowed_to_edit || $group_member_with_upload_rights) {
if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_folder($_user['user_id'], $curdirpath, $current_session_id)) {
$is_template = isset($id['is_template']) ? $id['is_template'] : false;
// If readonly, check if it the owner of the file or if the user is an admin
if ($id['insert_user_id'] == $_user['user_id'] || api_is_platform_admin()) {
@ -846,7 +855,6 @@ if (isset($docs_and_folders) && is_array($docs_and_folders)) {
$row[] = $last_edit_date;
$row[] = $size;
$total_size = $total_size + $size;
if ((isset ($_GET['keyword']) && search_keyword($document_name, $_GET['keyword'])) || !isset($_GET['keyword']) || empty($_GET['keyword'])) {
$sortable_data[] = $row;
}
@ -892,7 +900,6 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_fold
<?php Display::display_icon('filenew.gif', get_lang('CreateCertificate')); echo get_lang('CreateCertificate'); ?></a>&nbsp;
<?php
}
// File upload link
$upload_name = $is_certificate_mode ? get_lang('UploadCertificate') : get_lang('UplUploadDocument');
?>
@ -901,10 +908,15 @@ if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_fold
<?php
// Create directory
if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $curdirpath, $current_session_id)) {
if (!$is_certificate_mode) {
?>
<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq(); ?>&curdirpath=<?php echo $curdirpathurl.$req_gid; ?>&amp;createdir=1">
<?php Display::display_icon('folder_new.gif', get_lang('CreateDir')); echo get_lang('CreateDir'); ?></a>&nbsp;
<?php
}
//Show disk quota
if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $curdirpath, $current_session_id)) {
?>
<a href="quota.php?<?php echo api_get_cidreq(); ?>">
<?php Display::display_icon('statistics.gif', get_lang('ShowCourseQuotaUse')); echo get_lang('ShowCourseQuotaUse'); ?></a>&nbsp;
<?php
@ -946,7 +958,7 @@ $column_show[] = 1;
$column_show[] = 1;
$column_show[] = 1;
if ($is_allowed_to_edit || $group_member_with_upload_rights) {
if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_folder($_user['user_id'], $curdirpath, $current_session_id)) {
$column_show[] = 1;
}
$column_show[] = 0;
@ -990,8 +1002,8 @@ $table->set_header($column++, get_lang('Name'));
$table->set_header($column++, get_lang('Size'),true,array ('style' => 'width:50px;'));
$table->set_header($column++, get_lang('Date'),true,array ('style' => 'width:150px;'));
// Admins get an edit column
if ($is_allowed_to_edit || $group_member_with_upload_rights) {
$table->set_header($column++, get_lang('Modify'), false,array ('style' => 'width:150px;'));
if ($is_allowed_to_edit || $group_member_with_upload_rights || is_my_shared_folder($_user['user_id'], $curdirpath, $current_session_id)) {
$table->set_header($column++, get_lang('Actions'), false,array ('style' => 'width:150px;'));
}
// Actions on multiple selected documents

@ -51,22 +51,21 @@ $is_allowed_to_edit = api_is_allowed_to_edit(false,true);
// Start the templates node.
echo '<Templates imagesBasePath="">';
if($is_allowed_to_edit){
// Load empty template.
load_empty_template();
if($is_allowed_to_edit){
// Load the templates that were defined by the platform admin.
load_platform_templates();
// Load the personal templates.
load_personal_templates(api_get_user_id());
}
else{
// Load student templates.
load_student_templates();
}
// Load the personal templates.
load_personal_templates(api_get_user_id());
// End the templates node.
echo '</Templates>';

@ -7,37 +7,46 @@
// For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
//NOTE: Does not include Replace because it is redundant, being in the same tab to Find
//TODO: DocProps, fckeditor_wiris_openFormulaEditor,fckeditor_wiris_openCAS don't run ok here.
// Hide/show SpellCheck buttom
if ((api_get_setting('allow_spellcheck') == 'true')) {
$VSpellCheck='SpellCheck';
}
else{
$VSpellCheck='';
}
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
array('Save','FitWindow','PasteWord','-','Undo','Redo'),
array('Link','Unlink','Anchor','Glossary'),
array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath'),
array('Table','SpecialChar'),
array('Outdent','Indent','-','TextColor','BGColor','-','OrderedList','UnorderedList','-','Source'),
'/',
array('Style','FontFormat','FontName','FontSize'),
array('Bold','Italic','Underline'),
array('JustifyLeft','JustifyCenter','JustifyRight')
array('Save','NewPage','Templates','-','PasteWord'),
array('Undo','Redo'),
array('Link','Image','flvPlayer','Table','mimetex','asciimath'),
array('UnorderedList','OrderedList','Rule'),
array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'),
array('FitWindow')
);
// This is the visible toolbar set when the editor is maximized.
// If it has not been defined, then the toolbar set for the "normal" size is used.
$config['ToolbarSets']['Maximized'] = array(
array('FitWindow','DocProps','-','Save','NewPage','Preview','-','Templates'),
array('Cut','Copy','Paste','PasteText','PasteWord','-','Print'),
array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'),
array('Save','NewPage','Templates','-','Preview','Print'),
array('Cut','Copy','Paste','PasteText','PasteWord'),
array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'),
array('Link','Unlink','Anchor','Glossary'),
array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','asciimath'),
'/',
array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'),
array('OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'),
array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'),
array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'),
array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
array('Rule','SpecialChar','PageBreak'),
array('mimetex','asciimath','Image','imgmapPopup','Flash','MP3','EmbedMovies','flvPlayer','YouTube','googlemaps','Smiley'),
'/',
array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'),
array($VSpellCheck),
array('Style','FontFormat','FontName','FontSize'),
array('TextColor','BGColor'),
array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp'),
array('ShowBlocks','Source')
array('PageBreak','ShowBlocks','Source'),
array('FitWindow')
);
// Sets whether the toolbar can be collapsed/expanded or not.

@ -7,38 +7,46 @@
// For more information: http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
//NOTE: Does not include Replace because it is redundant, being in the same tab to Find
//TODO: DocProps, fckeditor_wiris_openFormulaEditor,fckeditor_wiris_openCAS don't run ok here.
// Hide/show SpellCheck buttom
if ((api_get_setting('allow_spellcheck') == 'true')) {
$VSpellCheck='SpellCheck';
}
else{
$VSpellCheck='';
}
// This is the visible toolbar set when the editor has "normal" size.
$config['ToolbarSets']['Normal'] = array(
array('Save','FitWindow','PasteWord','-','Undo','Redo'),
array('Link','Unlink','Anchor'),
array('Image','flvPlayer','Flash','EmbedMovies','YouTube','MP3','mimetex','asciimath'),
array('Table','SpecialChar'),
array('Outdent','Indent','-','TextColor','BGColor','-','OrderedList','UnorderedList'),
'/',
array('Style','FontFormat','FontName','FontSize'),
array('Bold','Italic','Underline'),
array('JustifyLeft','JustifyCenter','JustifyRight'),
array('ShowBlocks')
array('Save','NewPage','Templates','-','PasteWord'),
array('Undo','Redo'),
array('Link','Image','flvPlayer','Table','mimetex','asciimath'),
array('UnorderedList','OrderedList','Rule'),
array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
array('FontFormat','FontName','FontSize','Bold','Italic','Underline','TextColor','BGColor'),
array('FitWindow')
);
// This is the visible toolbar set when the editor is maximized.
// If it has not been defined, then the toolbar set for the "normal" size is used.
$config['ToolbarSets']['Maximized'] = array(
array('FitWindow','DocProps','-','Save','NewPage','Preview','-','Templates'),
array('Save','NewPage','Templates','-','Preview','Print'),
array('Cut','Copy','Paste','PasteText','PasteWord'),
array('Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'),
array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'),
array('Link','Unlink','Anchor','Glossary'),
array('Image','imgmapPopup','flvPlayer','EmbedMovies','YouTube','Flash','MP3','googlemaps','Smiley','SpecialChar','insertHtml','mimetex','asciimath'),
'/',
array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'),
array('OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'),
array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp','-','CreateDiv'),
array('UnorderedList','OrderedList','Rule','-','Outdent','Indent','Blockquote'),
array('JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'),
array('Rule','SpecialChar','PageBreak'),
array('mimetex','asciimath','Image','imgmapPopup','Flash','MP3','EmbedMovies','flvPlayer','googlemaps','Smiley'),
'/',
array('Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','TextColor','BGColor'),
array($VSpellCheck),
array('Style','FontFormat','FontName','FontSize'),
array('TextColor','BGColor'),
array('Table','TableInsertRowAfter','TableDeleteRows','TableInsertColumnAfter','TableDeleteColumns','TableInsertCellAfter','TableDeleteCells','TableMergeCells','TableHorizontalSplitCell','TableVerticalSplitCell','TableCellProp'),
array('ShowBlocks')
array('PageBreak','ShowBlocks'),
array('FitWindow')
);
// Sets whether the toolbar can be collapsed/expanded or not.

@ -26,7 +26,7 @@ $config['ToolbarSets']['Normal'] = array(
// This is the visible toolbar set when the editor is maximized.
// If it has not been defined, then the toolbar set for the "normal" size is used.
$config['ToolbarSets']['Maximized'] = array(
array('Save','NewPage','Templates','-','Preview','Print'),
array('NewPage','Templates','-','Preview','Print'),
array('Cut','Copy','Paste','PasteText','PasteWord'),
array('Undo','Redo','-','SelectAll','Find','-','RemoveFormat'),
array('Link','Unlink','Anchor','Glossary'),

@ -781,6 +781,7 @@ VALUES
('pdf_export_watermark_by_course', NULL,'radio', 'Platform', 'false','PDFExportWatermarkByCourseTitle', 'PDFExportWatermarkByCourseComment','platform',NULL, 1),
('pdf_export_watermark_text', NULL,'textfield', 'Platform', '', 'PDFExportWatermarkTextTitle', 'PDFExportWatermarkTextComment', 'platform',NULL, 1),
('enabled_insertHtml',NULL,'radio','Editor','false','EnabledInsertHtmlTitle','EnabledInsertHtmlComment',NULL,NULL, 0),
('students_export2pdf', NULL,'radio', 'Tools', 'true', 'EnabledStudentExport2PDFTitle','EnabledStudentExport2PDFComment',NULL,NULL, 0),
('chamilo_database_version', NULL, 'textfield', NULL, '1.8.8.13050', 'DokeosDatabaseVersion', '', NULL, NULL, 0);
@ -1021,7 +1022,9 @@ VALUES
('pdf_export_watermark_by_course','true','Yes'),
('pdf_export_watermark_by_course','false','No'),
('enabled_insertHtml','true','Yes'),
('enabled_insertHtml','false','No');
('enabled_insertHtml','false','No'),
('students_export2pdf','true','Yes'),
('students_export2pdf','false','No');
UNLOCK TABLES;

@ -90,7 +90,9 @@ INSERT INTO settings_current (variable, subkey, type, category, selected_value,
INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_insertHtml', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_insertHtml', 'false', 'No');
INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext, access_url_changeable) VALUES ('students_export2pdf',NULL,'radio','Tools','true','EnabledStudentExport2PDFTitle','EnabledStudentExport2PDFComment',NULL,NULL, 0);
INSERT INTO settings_options (variable, value, display_text) VALUES ('students_export2pdf', 'true', 'Yes');
INSERT INTO settings_options (variable, value, display_text) VALUES ('students_export2pdf', 'false', 'No');
-- xxSTATSxx

Loading…
Cancel
Save