From bdf31f1f1ddfd42d710b42e6a272cd75ea95c7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Tue, 28 Dec 2010 15:45:50 +0100 Subject: [PATCH] Feature #2484 students should not be able to change the display in groups --- main/document/document.inc.php | 8 ++++++-- main/document/document.php | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main/document/document.inc.php b/main/document/document.inc.php index 55ad1b527e..1788eaf773 100755 --- a/main/document/document.inc.php +++ b/main/document/document.inc.php @@ -295,7 +295,9 @@ function build_edit_icons($curdirpath, $type, $path, $visibility, $id, $is_templ $modify_icons = Display::return_icon('edit_na.gif', get_lang('Modify')); $modify_icons .= ' '.Display::return_icon('delete_na.gif', get_lang('Delete')); $modify_icons .= ' '.Display::return_icon('deplacer_fichier_na.gif', get_lang('Move')); - $modify_icons .= ' '.Display::return_icon($visibility_icon.'_na.gif', get_lang('VisibilityCannotBeChanged')); + if(api_is_allowed_to_edit() || api_is_platform_admin()){ + $modify_icons .= ' '.Display::return_icon($visibility_icon.'_na.gif', get_lang('VisibilityCannotBeChanged')); + } } else { if ($is_certificate_mode) { $modify_icons = ''; @@ -328,7 +330,9 @@ function build_edit_icons($curdirpath, $type, $path, $visibility, $id, $is_templ $modify_icons .= ' '; } else { $modify_icons .= ' '; - $modify_icons .= ' '; + if(api_is_allowed_to_edit() || api_is_platform_admin()){ + $modify_icons .= ' '; + } } } diff --git a/main/document/document.php b/main/document/document.php index 9161d4c697..162806c0d1 100755 --- a/main/document/document.php +++ b/main/document/document.php @@ -600,8 +600,8 @@ if (isset($_GET['action']) && $_GET['action'] == 'copytomyfiles' && api_get_sett } /* VISIBILITY COMMANDS */ - //Only teacher and all users into their group - if($is_allowed_to_edit || $group_member_with_upload_rights){ + //Only teacher + if($is_allowed_to_edit){ 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'])) {