function imce_unzip_form in IMCE unzip 7
Same name and namespace in other branches
- 6 imce_unzip.module \imce_unzip_form()
Unzip form.
1 call to imce_unzip_form()
- imce_unzip_form_imce_fileop_form_alter in ./
imce_unzip.module - Implements hook_form_formID_alter().
File
- ./
imce_unzip.module, line 47 - Main functions for IMCE unzip module
Code
function imce_unzip_form(&$imce) {
$form['deletezipfile'] = array(
'#type' => 'checkbox',
'#default_value' => 1,
'#title' => t('Delete the zip file after unzip ?'),
);
$max_files_nb = '';
if ($imce['maxfilestoextract']) {
if ($imce['maxfilestoextract'] != 0) {
$max_files_nb = '<div><em>' . t('Only %nb files will be extracted from the zip file', array(
'%nb' => $imce['maxfilestoextract'],
)) . '</em></div>';
}
}
elseif ($imce['maxfilestoextract'] == 0) {
$max_files_nb = '<div><em>' . t('Unlimited files will be extracted.', array(
'%nb' => $imce['maxfilestoextract'],
)) . '</em></div>';
}
else {
$max_files_nb = '<div><em>' . t('Only 50 files will be extracted from the zip file') . '</em></div>';
}
$max_size_image = '';
if ($imce['dimensions']) {
$max_size_image = '<div><em>' . t('Extracted image files exceeding the maximum allowed image size (%dimensions) will be scaled down.', array(
'%dimensions' => $imce['dimensions'],
)) . '</em></div>';
}
$form['unzip'] = array(
'#type' => 'submit',
'#value' => t('Unzip'),
// Permission for submission.
'#submit' => $imce['perm']['unzip'] ? array(
'imce_unzip_submit',
) : NULL,
'#prefix' => '<div class="container-inline">' . t('Unzip the file ?'),
'#suffix' => '</div>' . $max_files_nb . $max_size_image,
);
return $form;
}