param('perms', 'array:integer', array()); param('edit_perms_default'); // default value when multiple files are selected param('use_default_perms', 'array:string', array()); // array of file IDs that should be set to default if (count($use_default_perms) && $edit_perms_default === '') { param_error('edit_perms_default', T_('You have to give a default permission!')); break; } // form params $perms_read_readonly = is_windows(); $field_options_read_readonly = array(array('value' => 444, 'label' => T_('Read-only')), array('value' => 666, 'label' => T_('Read and write'))); $more_than_one_selected_file = $selected_Filelist->count() > 1; if (count($perms) || count($use_default_perms)) { // New permissions given, change them $selected_Filelist->restart(); while ($l_File =& $selected_Filelist->get_next()) { if (in_array($l_File->get_md5_ID(), $use_default_perms)) { // use default $chmod = $edit_perms_default; } elseif (!isset($perms[$l_File->get_md5_ID()])) { // happens for an empty text input or when no radio option is selected $Messages->add(sprintf(T_('Permissions for «%s» have not been changed.'), $l_File->dget('name')), 'note'); continue; } else { // provided for this file $chmod = $perms[$l_File->get_md5_ID()]; } $oldperms = $l_File->get_perms('raw'); $newperms = $l_File->chmod(octdec($chmod)); if ($newperms === false) {