Skip to content

Commit

Permalink
Версия 1.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriitux committed Jun 30, 2019
1 parent fbf37ad commit d0bcabd
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 46 deletions.
45 changes: 35 additions & 10 deletions administrator/components/com_quantummanager/filesystem/local.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,17 +278,24 @@ public static function getMetaFile($path, $file)
'value' => implode('.', $splitFile),
];

$globalInfo[] = [
'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_EXS'),
'value' => $exs,
];

$stat = stat($filePath);

if ($stat !== false) {
if (isset($stat['mtime'])) {
if (isset($stat['mtime']))
{
$globalInfo[] = [
'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME'),
'value' => date(Text::_('DATE_FORMAT_LC5'), $stat['mtime'])
];
}

if (isset($stat['size'])) {
if (isset($stat['size']))
{
$globalInfo[] = [
'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE'),
'value' => QuantummanagerHelper::formatFileSize((int)$stat['size'])
Expand All @@ -297,7 +304,8 @@ public static function getMetaFile($path, $file)

}

if (in_array($exs, ['jpg', 'jpeg', 'png', 'gif'])) {
if (in_array($exs, ['jpg', 'jpeg', 'png', 'gif']))
{
list($width, $height, $type, $attr) = getimagesize($filePath);

$globalInfo[] = [
Expand All @@ -308,28 +316,34 @@ public static function getMetaFile($path, $file)



if (in_array($exs, ['jpg', 'jpeg'])) {
if (in_array($exs, ['jpg', 'jpeg']))
{

try
{
$tmp = exif_read_data($filePath);
foreach ($tmp as $key => $section) {
foreach ($tmp as $key => $section)
{
if (is_array($section)) {
foreach ($section as $name => $val) {
foreach ($section as $name => $val)
{
$meta['find'][] = [
'key' => $key . '.' . $name,
'value' => $val
];
}
} else {
}
else
{

if (!in_array(mb_strtolower($key), [
'filename',
'filedatetime',
'filesize',
'filetype',
'mimetype',
])) {
]))
{
$meta['find'][] = [
'key' => $key,
'value' => $section,
Expand Down Expand Up @@ -453,15 +467,26 @@ public static function getFiles($path)
}

$exs = array_pop($fileParse);
$fileDate = filemtime($directory . DIRECTORY_SEPARATOR . $file);

$stat = stat($directory . DIRECTORY_SEPARATOR . $file);

if ($stat !== false)
{
if (isset($stat['mtime']))
{
$fileDate = $stat['mtime'];
}
}

$fileMeta = [
'size' => filesize($directory . DIRECTORY_SEPARATOR . $file),
'name' => implode('.', $fileParse),
'exs' => $exs,
'file' => $file,
'fileP' => $file,
'dateC' => filemtime($directory . DIRECTORY_SEPARATOR . $file),
'dateM' => filemtime($directory . DIRECTORY_SEPARATOR . $file),
'dateC' => $fileDate,
'dateM' => $fileDate,
];

if(in_array(strtolower($exs), ['jpg', 'png', 'jpeg', 'gif', 'svg']))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,19 @@ COM_QUANTUMMANAGER_HELP_AUTHOR="Contact with the author"
COM_QUANTUMMANAGER_WINDOW_CLOSE="Close"
COM_QUANTUMMANAGER_WINDOW_INSERT="Insert file"

COM_QUANTUMMANAGER_FILE_METAINFO_DIRECTORYNAME="Folder Name"
COM_QUANTUMMANAGER_FILE_METAINFO_DIRECTORYNAME="Folder name"
COM_QUANTUMMANAGER_FILE_METAINFO_COUNTDORECTORIES="Folders"
COM_QUANTUMMANAGER_FILE_METAINFO_COUNTFILES="Files"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESSIZE="File Size"
COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME="File Name"
COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME="Change Time"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE="File Size"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESSIZE="File size"
COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME="File name"
COM_QUANTUMMANAGER_FILE_METAINFO_EXS="File extension"
COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME="Change time"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE="File size"
COM_QUANTUMMANAGER_FILE_METAINFO_FILETYPE="Type"
COM_QUANTUMMANAGER_FILE_METAINFO_RESOLUTION="Resolution"
COM_QUANTUMMANAGER_FILE_METAINFO_WIDTH="Width"
COM_QUANTUMMANAGER_FILE_METAINFO_HEIGHT="Height"
COM_QUANTUMMANAGER_FILE_METAINFO_MIMETYPE="Mime Type"
COM_QUANTUMMANAGER_FILE_METAINFO_MIMETYPE="Mime type"
COM_QUANTUMMANAGER_FILE_METAINFO_SECTIONSFOUND="Found section"
COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="View all tags"
COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Hide tags"
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,19 @@ COM_QUANTUMMANAGER_HELP_AUTHOR="Contact with the author"
COM_QUANTUMMANAGER_WINDOW_CLOSE="Close"
COM_QUANTUMMANAGER_WINDOW_INSERT="Insert file"

COM_QUANTUMMANAGER_FILE_METAINFO_DIRECTORYNAME="Folder Name"
COM_QUANTUMMANAGER_FILE_METAINFO_DIRECTORYNAME="Folder name"
COM_QUANTUMMANAGER_FILE_METAINFO_COUNTDORECTORIES="Folders"
COM_QUANTUMMANAGER_FILE_METAINFO_COUNTFILES="Files"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESSIZE="File Size"
COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME="File Name"
COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME="Change Time"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE="File Size"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESSIZE="File size"
COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME="File name"
COM_QUANTUMMANAGER_FILE_METAINFO_EXS="File extension"
COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME="Change time"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE="File size"
COM_QUANTUMMANAGER_FILE_METAINFO_FILETYPE="Type"
COM_QUANTUMMANAGER_FILE_METAINFO_RESOLUTION="Resolution"
COM_QUANTUMMANAGER_FILE_METAINFO_WIDTH="Width"
COM_QUANTUMMANAGER_FILE_METAINFO_HEIGHT="Height"
COM_QUANTUMMANAGER_FILE_METAINFO_MIMETYPE="Mime Type"
COM_QUANTUMMANAGER_FILE_METAINFO_MIMETYPE="Mime type"
COM_QUANTUMMANAGER_FILE_METAINFO_SECTIONSFOUND="Found section"
COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="View all tags"
COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Hide tags"
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ COM_QUANTUMMANAGER_FILE_METAINFO_COUNTDORECTORIES="Папок"
COM_QUANTUMMANAGER_FILE_METAINFO_COUNTFILES="Файлов"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESSIZE="Размер файлов"
COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME="Название файла"
COM_QUANTUMMANAGER_FILE_METAINFO_EXS="Расширение файла"
COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME="Время изменения"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE="Размер файла"
COM_QUANTUMMANAGER_FILE_METAINFO_FILETYPE="Тип"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ COM_QUANTUMMANAGER_FILE_METAINFO_COUNTDORECTORIES="Папок"
COM_QUANTUMMANAGER_FILE_METAINFO_COUNTFILES="Файлов"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESSIZE="Размер файлов"
COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME="Название файла"
COM_QUANTUMMANAGER_FILE_METAINFO_EXS="Расширение файла"
COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME="Время изменения"
COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE="Размер файла"
COM_QUANTUMMANAGER_FILE_METAINFO_FILETYPE="Тип"
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.1.5
- добавлен фон для метаинформации
- в режиме списка появилась метаинформация о файле
- исправлен чекбокс при клике в режиме списка
- добавление в метаинформации расширение файла

1.1.4
- исправление ошибки загрузки класса
- теперь показывается метаинформация папок
Expand Down
38 changes: 26 additions & 12 deletions media/com_quantummanager/css/quantumviewfiles.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
position: relative;
max-width: 100%;
vertical-align: middle;
z-index: 2;
}
.quantumviewfiles-module .filter-search .uk-form-icon {
position: absolute;
Expand Down Expand Up @@ -206,6 +207,9 @@
.quantumviewfiles-module .meta-file {
position: relative;
width: 25%;
margin-top: -45px;
margin-right: -15px;
background: #f6f6f6;
}
.quantumviewfiles-module .meta-file.hidden {
display: none;
Expand All @@ -226,14 +230,17 @@
}
.quantumviewfiles-module .meta-file .meta-file-list > div {
padding: 10px;
padding-top: 45px;
}
.quantumviewfiles-module .meta-file .meta-hidden {
display: none;
}
.quantumviewfiles-module .meta-file .show-all-tags {
display: inline-block;
margin-top: 10px;
padding: 6px;
color: #000000;
font-weight: bold;
}
.quantumviewfiles-module .meta-file .show-all-tags:hover {
color: #444444;
Expand Down Expand Up @@ -263,22 +270,17 @@
border-spacing: 0;
width: 100%;
}
.quantumviewfiles-module .meta-file table>tr:not(:first-child),
.quantumviewfiles-module .meta-file table>:not(:first-child)>tr,
.quantumviewfiles-module .meta-file table>:first-child>tr:not(:first-child) {
border-top: 1px solid #e5e5e5;
}
.quantumviewfiles-module .meta-file table tr {
.quantumviewfiles-module .meta-file .meta-table > div {
display: flex;
align-items: center;
transition: background-color .1s linear;
}
.quantumviewfiles-module .meta-file table td {
.quantumviewfiles-module .meta-file .meta-table > div > div {
width: 50%;
padding: 6px;
vertical-align: middle;
}
.quantumviewfiles-module .meta-file table td {
width: 50%;
}
.quantumviewfiles-module .meta-file table td:last-child {
.quantumviewfiles-module .meta-file .meta-table > div > div:last-child {
font-weight: bold;
}
.quantumviewfiles-module .field-list-files {
Expand All @@ -304,7 +306,7 @@
background: #f3dd8c73;
}
.quantumviewfiles-module .field-list-files .file {
width: 100%;
width: 50%;
display: flex;
align-self: center;
align-items: center;
Expand All @@ -324,6 +326,14 @@
line-height: 14px;
white-space: normal;
}
.quantumviewfiles-module .field-list-files .fields {
display: flex;
flex: 1;
padding: 5px 0;
}
.quantumviewfiles-module .field-list-files .fields > div {
width: 50%;
}
.quantumviewfiles-module .field-list-files .empty {
width: 100%;
height: 100%;
Expand Down Expand Up @@ -564,6 +574,10 @@
background-color: #fcf8e3;
color: #444444;
}
.quantumviewfiles-module .field-list-files .list-table .file-item input:checked ~ .fields {
background-color: #fcf8e3;
color: #444444;
}
.quantumviewfiles-module .field-list-files .list-table .file-item .file {
padding: 8px 4px;
}
Expand Down
40 changes: 29 additions & 11 deletions media/com_quantummanager/js/quantumviewfiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,21 +348,21 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
}

if(response.global !== undefined) {
html += '<table><tbody>';
html += '<div class="meta-table">';
for (let i in response.global) {
html += '<tr><td>' + response.global[i].key + '</td><td>' + response.global[i].value + '</td></tr>';
html += '<div><div>' + response.global[i].key + '</div><div>' + response.global[i].value + '</div></div>';
}
html += '</tbody></table>';
html += '</div>';
}

if(response.find !== undefined) {
if(Object.keys(response.find).length > 0) {
html += '<span class="show-all-tags">' + QuantumviewfilesLang.metaFileShow + '</span>';
html += '<table class="meta-find meta-hidden"><tbody>';
html += '<div class="meta-table meta-find meta-hidden">';
for (let i in response.find) {
html += '<tr><td>' + response.find[i].key + '</td><td>' + response.find[i].value + '</td></tr>';
html += '<div><div>' + response.find[i].key + '</div><div>' + response.find[i].value + '</div></div>';
}
html += '</tbody></table>';
html += '</div>';
}
}

Expand Down Expand Up @@ -434,21 +434,21 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
}

if(response.global !== undefined) {
html += '<table><tbody>';
html += '<div class="meta-table">';
for (let i in response.global) {
html += '<tr><td>' + response.global[i].key + '</td><td>' + response.global[i].value + '</td></tr>';
html += '<div><div>' + response.global[i].key + '</div><div>' + response.global[i].value + '</div></div>';
}
html += '</tbody></table>';
}

if(response.find !== undefined) {
if(Object.keys(response.find).length > 0) {
html += '<span class="show-all-tags">' + QuantumviewfilesLang.metaFileShow + '</span>';
html += '<table class="meta-find meta-hidden"><tbody>';
html += '<div class="meta-find meta-hidden">';
for (let i in response.find) {
html += '<tr><td>' + response.find[i].key + '</td><td>' + response.find[i].value + '</td></tr>';
html += '<div><div>' + response.find[i].key + '</div><div>' + response.find[i].value + '</div></div>';
}
html += '</tbody></table>';
html += '</div>';
}
}

Expand Down Expand Up @@ -691,6 +691,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
};

this.reloadTypeViewFiles = function(path) {
let self = this;
let filesAll = ViewfilesElement.querySelectorAll('.field-list-files .file-item');
let viewFiles = ViewfilesElement.querySelector('.field-list-files .list');

Expand Down Expand Up @@ -762,6 +763,12 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
let fileExs = filesAll[i].getAttribute('data-exs');
let filePreview = filesAll[i].querySelector('.file-exs');
let exsImage = ['jpg', 'png', 'svg', 'jpeg', 'gif'];
let fields = filesAll[i].querySelector('.fields');

if(fields !== null) {
fields.remove();
}

if(exsImage.indexOf(fileExs.toLowerCase()) !== -1) {

let file;
Expand Down Expand Up @@ -800,9 +807,20 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) {
}

if(this.lastTypeViewFiles === 'list-table') {
let htmlFields = '';
let filePreview = filesAll[i].querySelector('.file-exs');
filePreview.style.backgroundImage = "";
filePreview.innerHTML = '';

htmlFields += '<div class="fields">';
htmlFields += '<div data-type="size">' + QuantumUtils.bytesToSize(filesAll[i].getAttribute('data-size')) + '</div>';
htmlFields += '<div data-type="date">' + QuantumUtils.fromUnixTimeToDate(filesAll[i].getAttribute('data-datec')) + '</div>';
htmlFields += '</div>';
filesAll[i].innerHTML += htmlFields;
filesAll[i].querySelector('.import-files-check-file').addEventListener('click', function (ev) {
self.fileClick(filesAll[i], self);
ev.preventDefault();
});
}

}
Expand Down
Loading

0 comments on commit d0bcabd

Please sign in to comment.