From f3845b5be7c63d7b910b8def5e2940f5837cca9d Mon Sep 17 00:00:00 2001 From: tsymb Date: Sun, 30 Jun 2019 12:18:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=B5=D1=80=D1=81=D0=B8=D1=8F=201.1.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/com_quantummanager/config.xml | 2 +- .../controllers/quantumtreecatalogs.php | 18 +++++++- .../controllers/quantumviewfiles.php | 33 ++++++++++++++ .../fields/quantumviewfiles.php | 2 +- .../com_quantummanager/filesystem/local.php | 45 +++++++++++++++---- .../helpers/quantummanager.php | 41 ++++++++++++++--- .../ru-RU/ru-RU.com_quantummanager.ini | 6 +-- .../ru-RU/ru-RU.com_quantummanager.sys.ini | 8 ++-- .../views/quantummanager/tmpl/default.php | 6 +-- .../views/quantummanager/tmpl/modal.php | 11 +++++ .../views/quantummanager/tmpl/window.php | 6 +-- changelog.md | 8 ++++ .../css/quantumviewfiles.css | 18 ++++++++ .../js/quantumtreecatalogs.js | 2 +- .../com_quantummanager/js/quantumviewfiles.js | 32 +++++++++++-- quantummanager.xml | 2 +- 16 files changed, 204 insertions(+), 36 deletions(-) diff --git a/administrator/components/com_quantummanager/config.xml b/administrator/components/com_quantummanager/config.xml index 77549d8..17f85c7 100644 --- a/administrator/components/com_quantummanager/config.xml +++ b/administrator/components/com_quantummanager/config.xml @@ -34,7 +34,7 @@ label="COM_QUANTUMMANAGER_CONFIG_GENERAL_METAFILE_LABEL" required="true" class="btn-group" - default="0"> + default="1"> diff --git a/administrator/components/com_quantummanager/controllers/quantumtreecatalogs.php b/administrator/components/com_quantummanager/controllers/quantumtreecatalogs.php index b48c6ea..bec9d69 100644 --- a/administrator/components/com_quantummanager/controllers/quantumtreecatalogs.php +++ b/administrator/components/com_quantummanager/controllers/quantumtreecatalogs.php @@ -29,10 +29,26 @@ public function getDirectories() { $app = Factory::getApplication(); $data = $app->input->getArray(); + + if(!isset($data['path'])) + { + $app->close(); + } + $path = $data['path']; + $rootSplit = explode('/', $data['root']); + + if(isset($rootSplit[0])) + { + $root = $rootSplit[0]; + } + else + { + $root = ''; + } JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php'); - echo QuantummanagerFileSystemLocal::getDirectories($path); + echo QuantummanagerFileSystemLocal::getDirectories($path, $root); $app->close(); } diff --git a/administrator/components/com_quantummanager/controllers/quantumviewfiles.php b/administrator/components/com_quantummanager/controllers/quantumviewfiles.php index 821f394..02c0bd2 100644 --- a/administrator/components/com_quantummanager/controllers/quantumviewfiles.php +++ b/administrator/components/com_quantummanager/controllers/quantumviewfiles.php @@ -29,6 +29,11 @@ public function createDirectory() $app = Factory::getApplication(); $data = $app->input->getArray(); + if(!isset($data['path']) || !isset($data['name'])) + { + $app->close(); + } + JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php'); echo QuantummanagerFileSystemLocal::createDirectory($data['path'], $data['name']); @@ -41,6 +46,11 @@ public function getFiles() $app = Factory::getApplication(); $data = $app->input->getArray(); + if(!isset($data['path'])) + { + $app->close(); + } + JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php'); echo QuantummanagerFileSystemLocal::getFiles($data['path']); @@ -53,6 +63,11 @@ public function getMetaFile() $app = Factory::getApplication(); $data = $app->input->getArray(); + if(!isset($data['path']) || !isset($data['name'])) + { + $app->close(); + } + JLoader::register('QuantummanagerFileSystemLocal', JPATH_ROOT . '/administrator/components/com_quantummanager/filesystem/local.php'); echo QuantummanagerFileSystemLocal::getMetaFile($data['path'], $data['name']); @@ -64,6 +79,12 @@ public function delete() { $app = Factory::getApplication(); $data = $app->input->getArray(); + + if(!isset($data['path']) || !isset($data['list'])) + { + $app->close(); + } + $path = $data['path']; $list = json_decode($data['list']); @@ -80,6 +101,12 @@ public function getParsePath() try { $app = Factory::getApplication(); $data = $app->input->getArray(); + + if(!isset($data['path'])) + { + $app->close(); + } + $path = $data['path']; JLoader::register('QuantummanagerHelper', JPATH_ROOT . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); @@ -101,6 +128,12 @@ public function generatePreviewImage() try { $app = Factory::getApplication(); $data = $app->input->getArray(); + + if(!isset($data['path']) || !isset($data['file'])) + { + $app->close(); + } + $path = $data['path']; $file = $data['file']; diff --git a/administrator/components/com_quantummanager/fields/quantumviewfiles.php b/administrator/components/com_quantummanager/fields/quantumviewfiles.php index 2fd043d..e6099fc 100644 --- a/administrator/components/com_quantummanager/fields/quantumviewfiles.php +++ b/administrator/components/com_quantummanager/fields/quantumviewfiles.php @@ -76,7 +76,7 @@ public function getInput() $this->__set('standalone', $this->getAttribute('standalone', true)); $this->__set('cssClass', $this->getAttribute('cssClass', '')); - $this->__set('metafile', $this->getAttribute('metafile', '0')); + $this->__set('metafile', $this->getAttribute('metafile', '1')); $this->directory = $this->getAttribute('directory', 'images'); $this->onlyfiles = $this->getAttribute('onlyfiles', '0'); diff --git a/administrator/components/com_quantummanager/filesystem/local.php b/administrator/components/com_quantummanager/filesystem/local.php index 02738b5..1587f18 100644 --- a/administrator/components/com_quantummanager/filesystem/local.php +++ b/administrator/components/com_quantummanager/filesystem/local.php @@ -13,6 +13,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; +use Joomla\CMS\Uri\Uri; use Joomla\Filesystem\File; use Joomla\Filesystem\Folder; @@ -49,14 +50,18 @@ public static function createDirectory($path, $name) /** * @param $path + * @param $root + * * @return string + * + * @since version */ - public static function getDirectories($path) + public static function getDirectories($path, $root) { JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); $path = JPATH_ROOT . DIRECTORY_SEPARATOR . QuantummanagerHelper::preparePath($path); $directories = []; - $directories = self::showdir($path, true, true); + $directories = self::showdir($path, $root,true, true); return json_encode([ 'directories' => $directories @@ -75,12 +80,14 @@ public static function getDirectories($path) protected static function showdir ( $dir, + $root = '', $folderOnly = false, $showRoot = false, $level = 0, // do not use!!! $ef = '' // do not use!!! ) { + $html = ''; if ((int)$level == 0) { @@ -95,10 +102,10 @@ protected static function showdir if ($showRoot && (int)$level == 0) { JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); - $subdir = self::showdir($dir, $folderOnly, $showRoot, $level + 1, $ef); + $subdir = self::showdir($dir, $root, $folderOnly, $showRoot, $level + 1, $ef); return [ //'path' => QuantummanagerHelper::getFolderRoot(), - 'path' => 'root', + 'path' => $root, 'subpath' => $subdir ]; } @@ -122,7 +129,7 @@ protected static function showdir $folders[] = [ 'path' => $name, - 'subpath' => self::showdir($dir . DIRECTORY_SEPARATOR . $name, $folderOnly, $showRoot, $level + 1, $ef) + 'subpath' => self::showdir($dir . DIRECTORY_SEPARATOR . $name, $root, $folderOnly, $showRoot, $level + 1, $ef) ]; } else @@ -236,10 +243,20 @@ public static function upload() */ public static function getMetaFile($path, $file) { + $sourcePath = $path; $path = QuantummanagerHelper::preparePath($path); $directory = JPATH_ROOT . DIRECTORY_SEPARATOR . $path; $filePath = $directory . DIRECTORY_SEPARATOR . $file; $meta = [ + 'preview' => [ + 'link' => 'index.php?' . http_build_query([ + 'option' => 'com_quantummanager', + 'task' => 'quantumviewfiles.generatePreviewImage', + 'file' => $file, + 'path' => $sourcePath, + 'v' => rand(111111, 999999), + ]) + ], 'global' => [], 'find' => [], ]; @@ -248,6 +265,7 @@ public static function getMetaFile($path, $file) { $splitFile = explode('.', $file); $exs = mb_strtolower(array_pop($splitFile)); + $globalInfo[] = [ 'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME'), 'value' => implode('.', $splitFile), @@ -275,7 +293,6 @@ public static function getMetaFile($path, $file) } - if(in_array($exs, ['jpg', 'jpeg', 'png', 'gif'])) { list($width, $height, $type, $attr) = getimagesize($filePath); @@ -284,6 +301,11 @@ public static function getMetaFile($path, $file) 'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_RESOLUTION'), 'value' => $width . ' x ' . $height ]; + } + + if(in_array($exs, ['jpg', 'jpeg'])) + { + $tmp = exif_read_data($filePath); foreach ($tmp as $key => $section) @@ -571,6 +593,8 @@ public static function generatePreviewImage($path, $file) $app = Factory::getApplication(); $splitFile = explode('.', $file); $exs = mb_strtolower(array_pop($splitFile)); + $mediaIconsPath = 'media/com_quantummanager/images/icons/'; + $siteUrl = Uri::root(); if(in_array($exs, ['jpg', 'jpeg', 'png', 'gif'])) { @@ -598,16 +622,21 @@ public static function generatePreviewImage($path, $file) })->save($cache . DIRECTORY_SEPARATOR . $file); } - $app->redirect(DIRECTORY_SEPARATOR . 'images/com_quantummanager/cache' . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file . '?=' . rand(111111, 999999)); + $app->redirect($siteUrl . 'images/com_quantummanager/cache' . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file . '?=' . rand(111111, 999999)); } if(in_array($exs, ['svg'])) { $path = QuantummanagerHelper::preparePath($path); - $app->redirect(DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file . '?=' . rand(111111, 999999)); + $app->redirect($siteUrl . $path . DIRECTORY_SEPARATOR . $file . '?=' . rand(111111, 999999)); } + if(in_array($exs, ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'mp3', 'ogg', 'flac', 'pdf', 'zip', 'txt', 'html', 'css', 'js', 'webp'])) + { + $app->redirect( $siteUrl . $mediaIconsPath . $exs . '.svg'); + } + $app->redirect($siteUrl . $mediaIconsPath . 'other.svg'); } diff --git a/administrator/components/com_quantummanager/helpers/quantummanager.php b/administrator/components/com_quantummanager/helpers/quantummanager.php index 3a80843..ea9b7a0 100644 --- a/administrator/components/com_quantummanager/helpers/quantummanager.php +++ b/administrator/components/com_quantummanager/helpers/quantummanager.php @@ -24,6 +24,12 @@ class QuantummanagerHelper { + /** + * @var string + * @since version + */ + public static $cachePathRoot = ''; + /** * @var string * @since version @@ -135,9 +141,28 @@ public static function getActions() */ public static function preparePath($path) { + $session = Factory::getSession(); $path = trim($path); $componentParams = ComponentHelper::getParams('com_quantummanager'); - $pathConfig = self::getParamsComponentValue('path', 'images'); + $pathConfig = ''; + + if(empty(static::$cachePathRoot)) + { + $pathConfig = static::getParamsComponentValue('path', 'images'); + $pathSession = $session->get('quantummanagerroot', ''); + static::$cachePathRoot = $pathConfig; + + if(!empty($pathSession)) + { + $pathConfig = $pathSession; + static::$cachePathRoot = $pathSession; + } + + } + else + { + $pathConfig = static::$cachePathRoot; + } $path = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path); $path = preg_replace("#" . JPATH_ROOT . "\/root?#", $pathConfig, $path); @@ -208,7 +233,7 @@ public static function preparePath($path) ], $pathConfig); //если пытаются выйти за пределы папки, то не даем этого сделать - if(!preg_match("/^" . str_replace("/", "\/", "(" . JPATH_ROOT . DIRECTORY_SEPARATOR . ")?" . $pathConfigParse) .".*?/", $path)) + if(!preg_match("/^" . str_replace("/", "\/", "\(" . JPATH_ROOT . DIRECTORY_SEPARATOR . "\)?" . $pathConfigParse) .".*?/", $path)) { if(preg_match("/.*?" . str_replace("/", "\/", JPATH_ROOT . DIRECTORY_SEPARATOR . $pathConfigParse) .".*?/", $path)) { @@ -272,12 +297,15 @@ public static function getParamsComponentValue($name, $default = '') $value = $componentParams->get($name, $default); $groups = Factory::getUser()->groups; - foreach ($profiles as $key => $profile) + if(!empty($profiles)) { - if(in_array((int)$profile->group, $groups) && ($name === $profile->config)) + foreach ($profiles as $key => $profile) { - $value = trim($profile->value); - break; + if(in_array((int)$profile->group, $groups) && ($name === $profile->config)) + { + $value = trim($profile->value); + break; + } } } @@ -294,6 +322,7 @@ public static function loadLang() $lang->load($extension, $base_dir, $language_tag, true); } + /** * @param $size * diff --git a/administrator/components/com_quantummanager/language/ru-RU/ru-RU.com_quantummanager.ini b/administrator/components/com_quantummanager/language/ru-RU/ru-RU.com_quantummanager.ini index 86117d6..779c600 100644 --- a/administrator/components/com_quantummanager/language/ru-RU/ru-RU.com_quantummanager.ini +++ b/administrator/components/com_quantummanager/language/ru-RU/ru-RU.com_quantummanager.ini @@ -11,7 +11,7 @@ COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="Укажите здесь путь COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZE_LABEL="Максимальный размер файла для загрузки
в мегабайтах" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_LABEL="Добавлять постфикс к именам файлов" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_DESC="" -COM_QUANTUMMANAGER_CONFIG_GENERAL_METAFILE_LABEL="Метатеги для файлов" +COM_QUANTUMMANAGER_CONFIG_GENERAL_METAFILE_LABEL="Метаинформация для файлов" COM_QUANTUMMANAGER_CONFIG_GENERAL_HELP_LABEL="Показывать ссылки на обратную связь" COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_LABEL="Разрешенные mime типы файлов" COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="1" @@ -111,5 +111,5 @@ COM_QUANTUMMANAGER_FILE_METAINFO_WIDTH="Ширина" COM_QUANTUMMANAGER_FILE_METAINFO_HEIGHT="Высота" COM_QUANTUMMANAGER_FILE_METAINFO_MIMETYPE="Mime тип" COM_QUANTUMMANAGER_FILE_METAINFO_SECTIONSFOUND="Найдена секция" -COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="Просмотреть все теги" -COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Скрыть теги" \ No newline at end of file +COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="Просмотреть всю информацию" +COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Скрыть информацию" \ No newline at end of file diff --git a/administrator/components/com_quantummanager/language/ru-RU/ru-RU.com_quantummanager.sys.ini b/administrator/components/com_quantummanager/language/ru-RU/ru-RU.com_quantummanager.sys.ini index 5ecfccd..779c600 100644 --- a/administrator/components/com_quantummanager/language/ru-RU/ru-RU.com_quantummanager.sys.ini +++ b/administrator/components/com_quantummanager/language/ru-RU/ru-RU.com_quantummanager.sys.ini @@ -11,10 +11,10 @@ COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="Укажите здесь путь COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZE_LABEL="Максимальный размер файла для загрузки
в мегабайтах" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_LABEL="Добавлять постфикс к именам файлов" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_DESC="" -COM_QUANTUMMANAGER_CONFIG_GENERAL_METAFILE_LABEL="Метатеги для файлов" +COM_QUANTUMMANAGER_CONFIG_GENERAL_METAFILE_LABEL="Метаинформация для файлов" COM_QUANTUMMANAGER_CONFIG_GENERAL_HELP_LABEL="Показывать ссылки на обратную связь" COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_LABEL="Разрешенные mime типы файлов" -COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="" +COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="1" COM_QUANTUMMANAGER_CONFIG_IMAGE="Изображения" COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="Здесь Вы можете настроить автоматический ресайзинг картинок, а так же наложение водяного знака и обрезки изображений" @@ -111,5 +111,5 @@ COM_QUANTUMMANAGER_FILE_METAINFO_WIDTH="Ширина" COM_QUANTUMMANAGER_FILE_METAINFO_HEIGHT="Высота" COM_QUANTUMMANAGER_FILE_METAINFO_MIMETYPE="Mime тип" COM_QUANTUMMANAGER_FILE_METAINFO_SECTIONSFOUND="Найдена секция" -COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="Просмотреть все теги" -COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Скрыть теги" \ No newline at end of file +COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="Просмотреть всю информацию" +COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Скрыть информацию" \ No newline at end of file diff --git a/administrator/components/com_quantummanager/views/quantummanager/tmpl/default.php b/administrator/components/com_quantummanager/views/quantummanager/tmpl/default.php index ad40062..ca37bbb 100644 --- a/administrator/components/com_quantummanager/views/quantummanager/tmpl/default.php +++ b/administrator/components/com_quantummanager/views/quantummanager/tmpl/default.php @@ -11,15 +11,15 @@ defined('_JEXEC') or die; use Joomla\CMS\Component\ComponentHelper; +use Joomla\CMS\Factory; -?> +$app = Factory::getApplication(); +$app->getSession()->clear('quantummanagerroot'); -input->get('folder', '', 'string'); + +if(!empty($folder)) +{ + $app->getSession()->set('quantummanagerroot', 'images/' . $folder); +} +else +{ + $app->getSession()->clear('quantummanagerroot'); +} HTMLHelper::_('stylesheet', 'com_quantummanager/modal.css', [ 'version' => filemtime(__FILE__), @@ -30,6 +40,7 @@ 'relative' => true ]); + } else { HTMLHelper::_('script', 'com_quantummanager/modalfield.js', [ diff --git a/administrator/components/com_quantummanager/views/quantummanager/tmpl/window.php b/administrator/components/com_quantummanager/views/quantummanager/tmpl/window.php index 24cffe0..529404f 100644 --- a/administrator/components/com_quantummanager/views/quantummanager/tmpl/window.php +++ b/administrator/components/com_quantummanager/views/quantummanager/tmpl/window.php @@ -10,6 +10,7 @@ defined('_JEXEC') or die; +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; @@ -23,9 +24,8 @@ 'relative' => true ]); -?> - -getSession()->clear('quantummanagerroot'); try { JLoader::register('JFormFieldQuantumCombine', JPATH_ROOT . '/administrator/components/com_quantummanager/fields/quantumcombine.php'); diff --git a/changelog.md b/changelog.md index f3a4502..182eebb 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +1.1.3 +- метаинформация по умолчанию включена +- если картинка больше не выделена, то переключается метаинформация на следующую выбранную +- добавлена картинка в метаинформации +- поправлены языковые константы +- открывается папка файла в модальном окне media поля, если поле заполнено +- менеджер теперь поддерживает windows системы + 1.1.2 - убрана ошибка при запоминании каталога и его открытия - метатеги закрываются, если файл больше не выделен diff --git a/media/com_quantummanager/css/quantumviewfiles.css b/media/com_quantummanager/css/quantumviewfiles.css index cc94476..8f4377b 100644 --- a/media/com_quantummanager/css/quantumviewfiles.css +++ b/media/com_quantummanager/css/quantumviewfiles.css @@ -224,6 +224,9 @@ -o-transform: translateZ(0); transform: translateZ(0); } +.quantumviewfiles-module .meta-file .meta-file-list > div { + padding: 10px; +} .quantumviewfiles-module .meta-file .meta-hidden { display: none; } @@ -236,6 +239,21 @@ color: #444444; cursor: pointer; } +.quantumviewfiles-module .meta-file .meta-preview { + display: flex; + justify-content: center; + align-items: center; + height: 180px; + margin-bottom: 15px; +} +.quantumviewfiles-module .meta-file .meta-preview img { + max-height: 100%; + height: auto; + max-width: 100%; + background-color: #efefef; + border: solid 5px #EFEFEF; + border-radius: 5px; +} .quantumviewfiles-module .meta-file table { border-collapse: collapse; border-spacing: 0; diff --git a/media/com_quantummanager/js/quantumtreecatalogs.js b/media/com_quantummanager/js/quantumtreecatalogs.js index 0d4022b..4370ff8 100644 --- a/media/com_quantummanager/js/quantumtreecatalogs.js +++ b/media/com_quantummanager/js/quantumtreecatalogs.js @@ -32,7 +32,7 @@ window.Quantumtreecatalogs = function(Filemanager, QuantumTreeCatalogsElement, o //Filemanager.data.path = path; } - jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumtreecatalogs.getDirectories&path=" + encodeURIComponent(path)).done(function (response) { + jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumtreecatalogs.getDirectories&path=" + encodeURIComponent(path) + '&root=' + encodeURIComponent(self.options.directory)).done(function (response) { response = JSON.parse(response); if(response.directories !== undefined) { diff --git a/media/com_quantummanager/js/quantumviewfiles.js b/media/com_quantummanager/js/quantumviewfiles.js index 141f107..f22d785 100644 --- a/media/com_quantummanager/js/quantumviewfiles.js +++ b/media/com_quantummanager/js/quantumviewfiles.js @@ -163,7 +163,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { response = JSON.parse(response); if(response.error !== undefined) { - Filemanager.data.path = 'root'; + Filemanager.data.path = self.options.directory; self.trigger('updatePath'); return; } @@ -268,7 +268,26 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { if(tmpInput.checked) { self.showMetaFile(element); } else { - self.hideMetaFile(); + + let find = false; + let findElement; + + let filesAll = ViewfilesElement.querySelectorAll('.field-list-files .file-item'); + for(let i=0;i'; + } if(response.global !== undefined) { html += ''; @@ -320,6 +343,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { } } + html += ''; self.viewMeta.querySelector('.meta-file-list').innerHTML = html; let buttonToggleTags = self.viewMeta.querySelector('.show-all-tags'); @@ -380,7 +404,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { this.initBreadcrumbs = function (callback) { let self = this; let fm = Filemanager; - jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumtreecatalogs.getDirectories&path=" + encodeURIComponent(this.options.directory)) + jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumtreecatalogs.getDirectories&path=" + encodeURIComponent(this.options.directory) + '&root=' + encodeURIComponent(this.options.directory)) .done(function (response) { response = JSON.parse(response); diff --git a/quantummanager.xml b/quantummanager.xml index 97b540d..5ad86fd 100644 --- a/quantummanager.xml +++ b/quantummanager.xml @@ -7,7 +7,7 @@ https://delo-design.ruCopyright (C) 2019 "Delo Design". All rights reserved.GNU General Public License version 2 or later; see LICENSE.txt - 1.1.2 + 1.1.3COM_QUANTUMMANAGER_XML_DESCRIPTIONscript.php