| 1 |
<?php echo $data['warnings']; ?> |
| 2 |
<form id="acym_form" enctype="multipart/form-data" action="<?php echo acym_completeLink(acym_getVar('cmd', 'ctrl')); ?>" method="post" name="acyForm"> |
| 3 |
<div id="acym__file__select"> |
| 4 |
<div class="acym__file__select grid-x"> |
| 5 |
<div class="acym__file__select__area cell grid-x"> |
| 6 |
<?php |
| 7 |
$fileTreeType = $data['fileTreeType']; |
| 8 |
echo $fileTreeType->display($data['folders'], $data['uploadFolder'], 'currentFolder'); |
| 9 |
|
| 10 |
if (empty($data['files'])) { |
| 11 |
echo acym_translation('ACYM_NO_FILE_HERE'); |
| 12 |
} else { |
| 13 |
$preparedFiles = []; |
| 14 |
foreach ($data['files'] as $k => $file) { |
| 15 |
$ext = strtolower(substr($file, strrpos($file, '.') + 1)); |
| 16 |
|
| 17 |
if (!in_array($ext, $data['allowedExtensions'])) { |
| 18 |
continue; |
| 19 |
} |
| 20 |
|
| 21 |
if (in_array($ext, $data['imageExtensions'])) { |
| 22 |
$srcImg = ACYM_LIVE.rtrim($data['uploadFolder'], DS).'/'.$file; |
| 23 |
} else { |
| 24 |
$srcImg = ACYM_LIVE.str_replace(DS, '/', ACYM_MEDIA_FOLDER).'images/icons/file.png'; |
| 25 |
} |
| 26 |
|
| 27 |
if (strlen($file) > 20) { |
| 28 |
$title = '<span class="cell acym__file__select__title" title="'.acym_escape($file).'">'.substr(rtrim($file, $ext), 0, 12).'...'.$ext.'</span>'; |
| 29 |
} else { |
| 30 |
$title = '<span class="cell acym__file__select__title">'.$file.'</span>'; |
| 31 |
} |
| 32 |
|
| 33 |
$selected = $data['selectedFile'] === $file ? 'acym_clickme' : ''; |
| 34 |
|
| 35 |
$preparedFiles[] = [ |
| 36 |
'title' => $title, |
| 37 |
'image' => $srcImg, |
| 38 |
'file' => $file, |
| 39 |
'selected' => $selected, |
| 40 |
]; |
| 41 |
} |
| 42 |
|
| 43 |
?> |
| 44 |
<div id="acym__file__select__area__switch" class="cell medium-1 grid-x align-right"> |
| 45 |
<button type="button" id="acym__file__select__area__switch__grid" class="is-hidden"><i class="acymicon-th"></i></button> |
| 46 |
<button type="button" id="acym__file__select__area__switch__list"><i class="acymicon-menu"></i></button> |
| 47 |
</div> |
| 48 |
<?php |
| 49 |
|
| 50 |
echo '<div id="acym__file__select__area__grid" class="margin-top-1 cell grid-x large-up-4 medium-up-3 small-up-2 grid-margin-x align-center">'; |
| 51 |
foreach ($preparedFiles as $oneFile) { |
| 52 |
?> |
| 53 |
<div class="cell acym__file__select__onepic text-center"> |
| 54 |
<a href="#" class="acym__file__select__add grid-x <?php echo $oneFile['selected']; ?>" mapdata="<?php echo acym_escape($oneFile['file']); ?>"> |
| 55 |
<?php echo $oneFile['title']; ?> |
| 56 |
<div class="cell"> |
| 57 |
<img src="<?php echo acym_escape($oneFile['image']); ?>" alt="" /> |
| 58 |
</div> |
| 59 |
</a> |
| 60 |
</div> |
| 61 |
<?php |
| 62 |
} |
| 63 |
echo '</div>'; |
| 64 |
|
| 65 |
echo '<div id="acym__file__select__area__list" class="margin-top-1 is-hidden cell grid-x">'; |
| 66 |
foreach ($preparedFiles as $oneFile) { |
| 67 |
?> |
| 68 |
<a href="#" class="acym__file__select__add cell grid-x" mapdata="<?php echo acym_escape($oneFile['file']); ?>"> |
| 69 |
<?php echo $oneFile['file']; ?> |
| 70 |
</a> |
| 71 |
<?php |
| 72 |
} |
| 73 |
echo '</div>'; |
| 74 |
} |
| 75 |
?> |
| 76 |
<input type="hidden" id="acym__file__select__mapid" value="<?php echo acym_escape($data['map']); ?>"> |
| 77 |
</div> |
| 78 |
<div class="acym__file__select__area cell grid-x text-center"> |
| 79 |
<?php echo acym_inputFile('uploadedFile', '', '', 'cell medium-shrink'); ?> |
| 80 |
<input type="hidden" name="currentFolder" value="<?php echo acym_escape($data['uploadFolder']); ?>" /> |
| 81 |
<input type="hidden" name="id" value="<?php echo acym_escape($data['map']); ?>" /> |
| 82 |
<div class="cell medium-auto hide-for-small-only"></div> |
| 83 |
<button type="button" |
| 84 |
class="cell medium-shrink button button-secondary acy_button_submit" |
| 85 |
type="submit" |
| 86 |
data-task="select"> <?php echo acym_translation('ACYM_IMPORT'); ?> </button> |
| 87 |
</div> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
<?php acym_formOptions(); ?> |
| 91 |
</form> |
| 92 |
|