Merge branch 'ent-11078-quitar-las-opciones-de-crear-ficheros-y-directorios-en-el-mib-uploader' into 'develop'
Ent 11078 quitar las opciones de crear ficheros y directorios en el mib uploader See merge request artica/pandorafms!5826
This commit is contained in:
commit
d44eb102e7
|
@ -485,6 +485,11 @@ function filemanager_file_explorer(
|
|||
// Options.
|
||||
$allowZipFiles = (isset($options['all']) === true) || ((isset($options['allowZipFiles']) === true) && ($options['allowZipFiles'] === true));
|
||||
$allowCreateText = (isset($options['all']) === true) || ((isset($options['allowCreateText']) === true) && ($options['allowCreateText'] === true));
|
||||
$allowCreateFolder = (isset($options['allowCreateFolder'])) ? false : true;
|
||||
|
||||
if ($options['denyCreateText'] === true) {
|
||||
$allowCreateText = false;
|
||||
}
|
||||
|
||||
if ($homedir_filemanager === false) {
|
||||
$homedir_filemanager = $config['homedir'];
|
||||
|
@ -494,11 +499,14 @@ function filemanager_file_explorer(
|
|||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
<?php if ($allowCreateFolder === true) : ?>
|
||||
function show_form_create_folder() {
|
||||
actions_dialog('create_folder');
|
||||
$("#create_folder").css("display", "block");
|
||||
check_opened_dialog('create_folder');
|
||||
}
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($allowCreateText === true) : ?>
|
||||
function show_create_text_file() {
|
||||
actions_dialog('create_text_file');
|
||||
|
@ -514,11 +522,14 @@ function filemanager_file_explorer(
|
|||
}
|
||||
|
||||
function check_opened_dialog(check_opened) {
|
||||
<?php if ($allowCreateFolder === true) : ?>
|
||||
if (check_opened !== 'create_folder') {
|
||||
if (($("#create_folder").hasClass("ui-dialog-content") && $('#create_folder').dialog('isOpen') === true)) {
|
||||
$('#create_folder').dialog('close');
|
||||
}
|
||||
}
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($allowCreateText === true) : ?>
|
||||
if (check_opened !== 'create_text_file') {
|
||||
if (($("#create_text_file").hasClass("ui-dialog-content") && $('#create_text_file').dialog('isOpen') === true)) {
|
||||
|
@ -537,14 +548,18 @@ function filemanager_file_explorer(
|
|||
$('.' + action).addClass('file_table_modal_active');
|
||||
var title_action = '';
|
||||
switch (action) {
|
||||
<?php if ($allowCreateFolder === true) : ?>
|
||||
case 'create_folder':
|
||||
title_action = "<?php echo __('Create a Directory'); ?>";
|
||||
break;
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($allowCreateText === true) : ?>
|
||||
case 'create_text_file':
|
||||
title_action = "<?php echo __('Create File'); ?>";
|
||||
break;
|
||||
<?php endif ?>
|
||||
|
||||
case 'upload_file':
|
||||
title_action = "<?php echo __('Upload Files'); ?>";
|
||||
break;
|
||||
|
@ -809,7 +824,9 @@ function filemanager_file_explorer(
|
|||
if ($readOnly === false) {
|
||||
if (is_writable($real_directory) === true) {
|
||||
// The buttons to make actions.
|
||||
$tabs_dialog = '<ul id="file_table_modal">
|
||||
$tabs_dialog = '<ul id="file_table_modal">';
|
||||
if ($allowCreateFolder === true) {
|
||||
$tabs_dialog .= '
|
||||
<li class="create_folder">
|
||||
<a href="javascript: show_form_create_folder();">'.html_print_image(
|
||||
'images/create_directory.png',
|
||||
|
@ -821,6 +838,7 @@ function filemanager_file_explorer(
|
|||
).'<span>'.__('Create a Directory').'</span>
|
||||
</a>
|
||||
</li>';
|
||||
}
|
||||
|
||||
if ($allowCreateText === true) {
|
||||
$tabs_dialog .= '
|
||||
|
@ -853,6 +871,7 @@ function filemanager_file_explorer(
|
|||
$tabs_dialog .= '</ul>';
|
||||
|
||||
// Create folder section.
|
||||
if ($allowCreateFolder === true) {
|
||||
$createFolderElements = $tabs_dialog;
|
||||
$createFolderElements .= sprintf('<form method="POST" action="%s">', $url);
|
||||
$createFolderElements .= html_print_input_text('dirname', '', '', 30, 255, true);
|
||||
|
@ -870,6 +889,7 @@ function filemanager_file_explorer(
|
|||
'content' => $createFolderElements,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// Upload file section.
|
||||
$uploadFileElements = $tabs_dialog;
|
||||
|
@ -936,6 +956,7 @@ function filemanager_file_explorer(
|
|||
|
||||
echo "<div style='width: ".$table->width.";' class='file_table_buttons'>";
|
||||
|
||||
if ($allowCreateFolder === true) {
|
||||
$buttons[] = html_print_button(
|
||||
__('Create directory'),
|
||||
'create_directory',
|
||||
|
@ -948,6 +969,7 @@ function filemanager_file_explorer(
|
|||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
if ($allowCreateText === true) {
|
||||
$buttons[] = html_print_button(
|
||||
|
|
|
@ -109,5 +109,9 @@ filemanager_file_explorer(
|
|||
false,
|
||||
'',
|
||||
false,
|
||||
['all' => true]
|
||||
[
|
||||
'all' => true,
|
||||
'denyCreateText' => true,
|
||||
'allowCreateFolder' => true,
|
||||
]
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue