Browse Source

set the download directory for students. Management platform. Enabled by default

Juan Carlos Raña 15 years ago
parent
commit
f967554dc8

+ 13 - 1
main/document/document.inc.php

@@ -165,6 +165,7 @@ function create_document_link($www, $title, $path, $filetype, $size, $visibility
 	if (!$show_as_icon)
 	{
 		//build download link (icon)
+				
 		$forcedownload_link=($filetype=='folder')?api_get_self().'?'.api_get_cidreq().'&action=downloadfolder&path='.$url_path.$req_gid:api_get_self().'?'.api_get_cidreq().'&action=download&id='.$url_path.$req_gid;
 		//folder download or file download?
 		$forcedownload_icon=($filetype=='folder')?'folder_zip.gif':'filesave.gif';
@@ -220,7 +221,18 @@ function create_document_link($www, $title, $path, $filetype, $size, $visibility
 
 	if (!$show_as_icon)
 	{
-		$force_download_html = ($size==0)?'':'<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'</a>';
+		if($filetype=="folder")
+		{	
+			if(api_is_allowed_to_edit() || api_is_platform_admin() || api_get_setting('students_download_folders') == 'true')
+			{
+				$force_download_html = ($size==0)?'':'<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'</a>';
+			}
+		}
+		else
+		{
+			$force_download_html = ($size==0)?'':'<a href="'.$forcedownload_link.'" style="float:right"'.$prevent_multiple_click.'>'.Display::return_icon($forcedownload_icon, get_lang('Download'),array('height'=>'16', 'width' => '16')).'</a>';
+		}
+		
 		return '<a href="'.$url.'" title="'.$tooltip_title_alt.'" target="'.$target.'"'.$visibility_class.' style="float:left">'.$title.'</a>'.$force_download_html;
 	}
 	else

+ 9 - 9
main/document/document.php

@@ -144,7 +144,7 @@ $group_member_with_upload_rights = false;
 if(isset($_SESSION['_gid']) && $_SESSION['_gid']!='')
 {
 	//needed for group related stuff
-	include_once(api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
+	require_once(api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php');
 	//get group info
 	$group_properties = GroupManager::get_group_properties($_SESSION['_gid']);
 	$noPHP_SELF=true;
@@ -283,9 +283,9 @@ if (isset($_GET['action']) && $_GET['action']=="download")
 //-------------------------------------------------------------------//
 
 //download of an completed folder
-if(isset($_GET['action']) && $_GET['action']=="downloadfolder")
-{
-	include('downloadfolder.inc.php');
+if(isset($_GET['action']) && $_GET['action']=="downloadfolder" && (api_get_setting('students_download_folders') == 'true' || api_is_allowed_to_edit() || api_is_platform_admin()))
+{			
+		require('downloadfolder.inc.php');
 }
 //-------------------------------------------------------------------//
 
@@ -405,7 +405,7 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
 			}
 		}
 
-		include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
+		require_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
 		//this is needed for the update_db_info function
 		//$dbTable = $_course['dbNameGlu']."document";
 		$dbTable = Database::get_course_table(TABLE_DOCUMENT);
@@ -448,7 +448,7 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
 			}
 		}
 
-		include_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
+		require_once(api_get_path(LIBRARY_PATH) . 'fileManage.lib.php');
 
 		if(DocumentManager::delete_document($_course,$_GET['delete'],$base_work_dir))
 		{
@@ -504,7 +504,7 @@ if($is_allowed_to_edit || $group_member_with_upload_rights) // TEACHER ONLY
 	if(isset($_POST['create_dir']) && $_POST['dirname']!='')
 	{
 		//needed for directory creation
-		include_once(api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php');
+		require_once(api_get_path(LIBRARY_PATH) . 'fileUpload.lib.php');
 		$post_dir_name=Security::remove_XSS($_POST['dirname']);
 
 		if ($post_dir_name=='../' || $post_dir_name=='.' || $post_dir_name=='..')
@@ -843,7 +843,7 @@ $column_show=array();
 	}
 	if ($docs_and_folders!=null) {
 		global $total_size;
-		if ($total_size!=0){ ?>
+		if ($total_size!=0  &&  (api_get_setting('students_download_folders') == 'true' || api_is_allowed_to_edit() || api_is_platform_admin())){ ?>
 	<!-- download zipped folder -->
 			<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq();?>&action=downloadfolder"><img src="../img/zip_save.gif" border="0" title="<?php echo get_lang("Save"); ?> (ZIP)" alt="" /></a>
 			<a href="<?php echo api_get_self(); ?>?<?php echo api_get_cidreq();?>&action=downloadfolder"><?php echo get_lang("Save"); ?> (ZIP)</a>&nbsp;
@@ -851,7 +851,7 @@ $column_show=array();
 		}
 	}
 	// Slideshow by Patrick Cool, May 2004
-	include("document_slideshow.inc.php");
+	require("document_slideshow.inc.php");
 	if ($image_present)
 	{
 		echo "<a href=\"slideshow.php?".api_get_cidreq()."&curdirpath=".$curdirpathurl."\"><img src=\"../img/images_gallery.gif\" border=\"0\" title=\"".get_lang('ViewSlideshow')."\"/>&nbsp;". get_lang('ViewSlideshow') . "</a>";

+ 5 - 2
main/install/dokeos_main.sql

@@ -740,7 +740,8 @@ VALUES
 ('math_asciimathML',NULL,'radio','Editor','false','MathASCIImathMLTitle','MathASCIImathMLComment',NULL,NULL, 0),
 ('youtube_for_students',NULL,'radio','Editor','true','YoutubeForStudentsTitle','YoutubeForStudentsComment',NULL,NULL, 0),
 ('block_copy_paste_for_students',NULL,'radio','Editor','false','BlockCopyPasteForStudentsTitle','BlockCopyPasteForStudentsComment',NULL,NULL, 0),
-('more_buttons_maximized_mode',NULL,'radio','Editor','false','MoreButtonsForMaximizedModeTitle','MoreButtonsForMaximizedModeComment',NULL,NULL, 0);
+('more_buttons_maximized_mode',NULL,'radio','Editor','false','MoreButtonsForMaximizedModeTitle','MoreButtonsForMaximizedModeComment',NULL,NULL, 0),
+('students_download_folders',NULL,'radio','Tools','true','AllowStudentsDownloadFoldersTitle','AllowStudentsDownloadFoldersComment',NULL,NULL, 0);
 
 UNLOCK TABLES;
 /*!40000 ALTER TABLE settings_current ENABLE KEYS */;
@@ -940,7 +941,9 @@ VALUES
 ('block_copy_paste_for_students','true','Yes'),
 ('block_copy_paste_for_students','false','No'),
 ('more_buttons_maximized_mode','true','Yes'),
-('more_buttons_maximized_mode','false','No');
+('more_buttons_maximized_mode','false','No'),
+('students_download_folders','true','Yes'),
+('students_download_folders','false','No');
 
 UNLOCK TABLES;
 

+ 2 - 0
main/lang/english/admin.inc.php

@@ -1115,4 +1115,6 @@ $Editor = "WYSIWYG Editor";
 $GoToCourseAfterLoginTitle = "Go directly to the course after login";
 $GoToCourseAfterLoginComment = "When a user is registered in one course, go directly to the course after login";
 $GroupList = "Group List";
+$AllowStudentsDownloadFoldersTitle = "Allow students to download directories";
+$AllowStudentsDownloadFoldersComment = "Allow to students pack and download a complete directory in the document tool";
 ?>

+ 19 - 0
main/lang/portuguese/admin.inc.php

@@ -979,6 +979,7 @@ $SoberBrown = "Sober brown";
 $SteelGrey = "Steel grey";
 $TastyOlive = "Tasty olive";
 $AddNews  = "Adicionar notícias/novidades";
+$ExportCourses = "Exportar cursos";
 $SearchDatabaseOpeningError = "Erro ao tentar abrir a base-de-dados";
 $SearchDatabaseVersionError = "A base-de-dados encontra-se num formato não suportado";
 $SearchDatabaseModifiedError = "A base-de-dados foi modificada";
@@ -1096,4 +1097,22 @@ $ShowGlossaryInExtraToolsComment = "Neste local pode configurar como adicionar o
 $FieldTypeTag = "Etiqueta/comando do utilizador";
 $SendEmailToAdminTitle = "E-mail de alerta, de criação de um novo curso";
 $SendEmailToAdminComment = "Enviar um e-mail para o administardor da plataforma, de cada vez que um instrutor registrar um novo curso";
+$UserTag = "Etiqueta/comando do utilizador";
+$SelectSession = "Seleccionar sessão";
+$GroupPermissions = "Permissões do Grupo";
+$SpecialCourse = "Curso especial";
+$MathMimetexTitle = "Editor matemático mimeTEX";
+$MathMimetexComment = "Activar editor matemático mimeTEX";
+$MathASCIImathMLTitle = "Editor matemático SCIImathML";
+$MathASCIImathMLComment = "Activar editor matemático SCIImathML";
+$YoutubeForStudentsTitle = "Permitir aos alunos inserir videos do YouTube";
+$YoutubeForStudentsComment = "Activar a possibilidade dos alunos poderem inserir videos do YouTube";
+$BlockCopyPasteForStudentsTitle = "Bloquear aos alunos a opção de copiar e colar ";
+$BlockCopyPasteForStudentsComment = "Bloquear aos alunos a opção de copiar e colar para dentro do editor WYSIWYG ";
+$MoreButtonsForMaximizedModeTitle = "Barra de botões extendida";
+$MoreButtonsForMaximizedModeComment = "Activar a barra de botões extendida quando o editor WYSIWYG se encontrar maximizado";
+$Editor = "Editor WYSIWYG";
+$GoToCourseAfterLoginTitle = "Ir directamente para o curso após efectuar o login/acesso";
+$GoToCourseAfterLoginComment = "Quando um utilizador se encontra registado num curso, ir directamente para o curso após o login/acesso";
+$GroupList = "Lista do Grupo";
 ?>

+ 1 - 0
main/lang/portuguese/course_home.inc.php

@@ -27,4 +27,5 @@ $IntroductionTextDeleted = "A introdu
 $SessionIdentifier = "Identificador da sessão";
 $SessionName = "Nome da sessão";
 $SessionCategory = "Categoria da sessão";
+$SessionData = "Dados da sessão";
 ?>

+ 2 - 0
main/lang/portuguese/slideshow.inc.php

@@ -18,4 +18,6 @@ $lang_next_slide = "Imagem seguinte";
 $lang_image = "Imagem";
 $lang_of = "de";
 $lang_view_slideshow = "Ver Apresentação de slides";
+$FirstSlide = "Primeiro slide/diapositivo";
+$LastSlide = "Último slide/diapositivo";
 ?>

+ 2 - 0
main/lang/portuguese/userInfo.inc.php

@@ -92,4 +92,6 @@ $SendInvitation = "Enviar convite";
 $SocialInvitationToFriends = "Convidar para fazer parte do meu grupo de amigos";
 $MyCertificates = "Meus certificados";
 $ToChangeYourEmailMustTypeYourPassword = "Para modificar o seu e-mail deverá introduzir a sua senha/password";
+$Invitations = "Convites";
+$MyGroups = "Meus grupos";
 ?>

+ 2 - 0
main/lang/spanish/admin.inc.php

@@ -1115,4 +1115,6 @@ $Editor = "Editor WYSIWYG";
 $GoToCourseAfterLoginTitle = "Ir directamente al curso tras identificarse";
 $GoToCourseAfterLoginComment = "Cuando un usuario está inscrito sólamente en un curso, ir directamente al curso despúes de identificarse";
 $GroupList = "Lista de grupos";
+$AllowStudentsDownloadFoldersTitle = "Permitir a los estudiantes descargar directorios";
+$AllowStudentsDownloadFoldersComment = "Permitir a los estudiantes empaquetar y descargar un directorio completo en la herramienta documentos";
 ?>