From f13af539f163962a865c16bb91e06c07a5c15568 Mon Sep 17 00:00:00 2001 From: tsymb Date: Sat, 29 Jun 2019 01:47:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=B5=D1=80=D1=81=D0=B8=D1=8F=201.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/com_quantummanager/config.xml | 41 ++++- .../controllers/quantumviewfiles.php | 21 +++ .../com_quantummanager/filesystem/local.php | 160 ++++++++++++++---- .../helpers/quantummanager.php | 87 ++++++++-- .../en-GB/en-GB.com_quantummanager.ini | 33 +++- .../en-GB/en-GB.com_quantummanager.sys.ini | 34 +++- .../ru-RU/ru-RU.com_quantummanager.ini | 28 ++- .../ru-RU/ru-RU.com_quantummanager.sys.ini | 34 +++- .../layouts/fields/quantumviewfiles.php | 4 +- .../views/quantummanager/tmpl/default.php | 3 +- .../views/quantummanager/tmpl/modal.php | 7 +- .../views/quantummanager/tmpl/window.php | 3 +- changelog.md | 6 +- .../com_quantummanager/css/quantumtoolbar.css | 6 +- .../com_quantummanager/css/quantumupload.css | 3 +- .../css/quantumviewfiles.css | 41 ++++- media/com_quantummanager/js/modaleditor.js | 93 +++++----- media/com_quantummanager/js/modalfield.js | 19 ++- .../com_quantummanager/js/quantumcropperjs.js | 32 ++-- .../js/quantumtreecatalogs.js | 9 +- .../com_quantummanager/js/quantumviewfiles.js | 59 ++++++- quantummanager.xml | 2 +- 22 files changed, 559 insertions(+), 166 deletions(-) diff --git a/administrator/components/com_quantummanager/config.xml b/administrator/components/com_quantummanager/config.xml index 5ffbeff..77549d8 100644 --- a/administrator/components/com_quantummanager/config.xml +++ b/administrator/components/com_quantummanager/config.xml @@ -4,11 +4,7 @@
+
+ + +
+ + + + + + + + + + +
diff --git a/administrator/components/com_quantummanager/controllers/quantumviewfiles.php b/administrator/components/com_quantummanager/controllers/quantumviewfiles.php index 33ca017..821f394 100644 --- a/administrator/components/com_quantummanager/controllers/quantumviewfiles.php +++ b/administrator/components/com_quantummanager/controllers/quantumviewfiles.php @@ -75,6 +75,27 @@ public function delete() } + public function getParsePath() + { + try { + $app = Factory::getApplication(); + $data = $app->input->getArray(); + $path = $data['path']; + + JLoader::register('QuantummanagerHelper', JPATH_ROOT . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); + echo json_encode([ + 'path' => QuantummanagerHelper::preparePath($path) + ]); + + $app->close(); + } + catch (Exception $e) + { + echo $e->getMessage(); + } + } + + public function generatePreviewImage() { try { diff --git a/administrator/components/com_quantummanager/filesystem/local.php b/administrator/components/com_quantummanager/filesystem/local.php index aae660a..02738b5 100644 --- a/administrator/components/com_quantummanager/filesystem/local.php +++ b/administrator/components/com_quantummanager/filesystem/local.php @@ -97,7 +97,8 @@ protected static function showdir JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); $subdir = self::showdir($dir, $folderOnly, $showRoot, $level + 1, $ef); return [ - 'path' => QuantummanagerHelper::getFolderRoot(), + //'path' => QuantummanagerHelper::getFolderRoot(), + 'path' => 'root', 'subpath' => $subdir ]; } @@ -238,25 +239,87 @@ public static function getMetaFile($path, $file) $path = QuantummanagerHelper::preparePath($path); $directory = JPATH_ROOT . DIRECTORY_SEPARATOR . $path; $filePath = $directory . DIRECTORY_SEPARATOR . $file; - $meta = []; + $meta = [ + 'global' => [], + 'find' => [], + ]; if(file_exists($filePath)) { - $tmp = exif_read_data($filePath); - foreach ($tmp as $key => $section) + $splitFile = explode('.', $file); + $exs = mb_strtolower(array_pop($splitFile)); + $globalInfo[] = [ + 'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME'), + 'value' => implode('.', $splitFile), + ]; + + $stat = stat($filePath); + + if($stat !== false) { - if(is_array($section)) + if(isset($stat['mtime'])) { - foreach ($section as $name => $val) - { - $meta[] = "$key.$name: $val"; - } + $globalInfo[] = [ + 'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME'), + 'value' => date(Text::_('DATE_FORMAT_LC5'), $stat['mtime']) + ]; } - else + + if(isset($stat['size'])) { - $meta[] = "$key: $section"; + $globalInfo[] = [ + 'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE'), + 'value' => QuantummanagerHelper::formatFileSize((int)$stat['size']) + ]; } + } + + + if(in_array($exs, ['jpg', 'jpeg', 'png', 'gif'])) + { + list($width, $height, $type, $attr) = getimagesize($filePath); + + $globalInfo[] = [ + 'key' => Text::_('COM_QUANTUMMANAGER_FILE_METAINFO_RESOLUTION'), + 'value' => $width . ' x ' . $height + ]; + + $tmp = exif_read_data($filePath); + foreach ($tmp as $key => $section) + { + if(is_array($section)) + { + foreach ($section as $name => $val) + { + $meta['find'][] = [ + 'key' => $key . '.' . $name, + 'value' => $val + ]; + } + } + else + { + + if(!in_array(mb_strtolower($key), [ + 'filename', + 'filedatetime', + 'filesize', + 'filetype', + 'mimetype', + ])) { + $meta['find'][] = [ + 'key' => $key, + 'value' => $section, + ]; + } + + } + } + } + + $meta['global'] = array_merge($meta['global'], $globalInfo); + } return json_encode($meta); @@ -274,6 +337,16 @@ public static function getFiles($path) JLoader::register('JInterventionimage', JPATH_LIBRARIES . DIRECTORY_SEPARATOR . 'jinterventionimage' . DIRECTORY_SEPARATOR . 'jinterventionimage.php'); $path = QuantummanagerHelper::preparePath($path); $directory = JPATH_ROOT . DIRECTORY_SEPARATOR . $path; + + if(!file_exists($directory)) + { + return json_encode([ + 'error' => '0', + 'message' => 'folder not create', + ]); + } + + $filesOutput = []; $files = Folder::files($directory); $directories = Folder::folders($directory); @@ -311,14 +384,15 @@ public static function getFiles($path) 'dateM' => filemtime($directory . DIRECTORY_SEPARATOR . $file), ]; - if(in_array(strtolower($exs), ['jpg', 'png', 'jpeg', 'gif'])) + if(in_array(strtolower($exs), ['jpg', 'png', 'jpeg', 'gif', 'svg'])) { $cacheSource = JPATH_ROOT . DIRECTORY_SEPARATOR . 'images/com_quantummanager/cache'; + $path = QuantummanagerHelper::preparePath($path); $cache = $cacheSource . DIRECTORY_SEPARATOR . $path; - if (!file_exists($cache . DIRECTORY_SEPARATOR . $file)) - { + //if (!file_exists($cache . DIRECTORY_SEPARATOR . $file)) + //{ $fileMeta['fileP'] = 'index.php?option=com_quantummanager&task=quantumviewfiles.generatePreviewImage&file=' . $file; - } + //} } @@ -484,34 +558,56 @@ public static function converterSave() } + /** + * @param $path + * @param $file + * + * + * @since version + * @throws Exception + */ public static function generatePreviewImage($path, $file) { - JLoader::register('JInterventionimage', JPATH_LIBRARIES . DIRECTORY_SEPARATOR . 'jinterventionimage' . DIRECTORY_SEPARATOR . 'jinterventionimage.php'); - $path = QuantummanagerHelper::preparePath($path); - $directory = JPATH_ROOT . DIRECTORY_SEPARATOR . $path; - $manager = JInterventionimage::getInstance(); - $cacheSource = JPATH_ROOT . DIRECTORY_SEPARATOR . 'images/com_quantummanager/cache'; - $cache = $cacheSource; - $pathArr = explode('/', $path); + $app = Factory::getApplication(); + $splitFile = explode('.', $file); + $exs = mb_strtolower(array_pop($splitFile)); - for($i=0;$imake($directory . DIRECTORY_SEPARATOR . $file)->resize(null, 320, function ($constraint) { + $constraint->aspectRatio(); + })->save($cache . DIRECTORY_SEPARATOR . $file); + } + + $app->redirect(DIRECTORY_SEPARATOR . 'images/com_quantummanager/cache' . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file . '?=' . rand(111111, 999999)); } - if (!file_exists($cache . DIRECTORY_SEPARATOR . $file)) + if(in_array($exs, ['svg'])) { - $manager->make($directory . DIRECTORY_SEPARATOR . $file)->resize(null, 320, function ($constraint) { - $constraint->aspectRatio(); - })->save($cache . DIRECTORY_SEPARATOR . $file); + $path = QuantummanagerHelper::preparePath($path); + $app->redirect(DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file . '?=' . rand(111111, 999999)); } - $app = Factory::getApplication(); - $app->redirect(DIRECTORY_SEPARATOR . 'images/com_quantummanager/cache' . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file . '?=' . rand(111111, 999999)); + } diff --git a/administrator/components/com_quantummanager/helpers/quantummanager.php b/administrator/components/com_quantummanager/helpers/quantummanager.php index 222f54d..3a80843 100644 --- a/administrator/components/com_quantummanager/helpers/quantummanager.php +++ b/administrator/components/com_quantummanager/helpers/quantummanager.php @@ -24,6 +24,10 @@ class QuantummanagerHelper { + /** + * @var string + * @since version + */ public static $cacheMimeType = ''; /** @@ -132,6 +136,13 @@ public static function getActions() public static function preparePath($path) { $path = trim($path); + $componentParams = ComponentHelper::getParams('com_quantummanager'); + $pathConfig = self::getParamsComponentValue('path', 'images'); + + $path = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path); + $path = preg_replace("#" . JPATH_ROOT . "\/root?#", $pathConfig, $path); + $path = preg_replace("#^root?#", $pathConfig, $path); + $path = str_replace('..' . DIRECTORY_SEPARATOR, '', $path); if(substr_count($path, '{user_id}')) { @@ -174,24 +185,38 @@ public static function preparePath($path) date('U'), ], $path); - $componentParams = ComponentHelper::getParams('com_quantummanager'); - $pathConfig = $componentParams->get('path', 'images'); - - $path = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path); - $path = preg_replace("#" . JPATH_ROOT . "\/root(\/)?#", '', $path); - $path = preg_replace("#^root(\/)?#", '', $path); - $path = str_replace('..' . DIRECTORY_SEPARATOR, '', $path); + $pathConfigParse = str_replace([ + '{user_id}', + '{item_id}', + '{year}', + '{month}', + '{day}', + '{hours}', + '{minutes}', + '{second}', + '{unix}', + ], [ + $user->id, + $item_id, + date('Y'), + date('m'), + date('d'), + date('h'), + date('i'), + date('s'), + date('U'), + ], $pathConfig); //если пытаются выйти за пределы папки, то не даем этого сделать - if(!preg_match("/^" . str_replace("/", "\/", "(" . JPATH_ROOT . DIRECTORY_SEPARATOR . ")?" . $pathConfig) .".*?/", $path)) + if(!preg_match("/^" . str_replace("/", "\/", "(" . JPATH_ROOT . DIRECTORY_SEPARATOR . ")?" . $pathConfigParse) .".*?/", $path)) { - if(preg_match("/.*?" . str_replace("/", "\/", JPATH_ROOT . DIRECTORY_SEPARATOR . $pathConfig) .".*?/", $path)) + if(preg_match("/.*?" . str_replace("/", "\/", JPATH_ROOT . DIRECTORY_SEPARATOR . $pathConfigParse) .".*?/", $path)) { - $path = JPATH_ROOT . DIRECTORY_SEPARATOR . $pathConfig . str_replace(JPATH_ROOT, '', $path); + $path = JPATH_ROOT . DIRECTORY_SEPARATOR . $pathConfigParse . str_replace(JPATH_ROOT, '', $path); } else { - $path = $pathConfig . str_replace(JPATH_ROOT, '', $path); + $path = str_replace(JPATH_ROOT, '', $path); } $path = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $path); @@ -199,7 +224,8 @@ public static function preparePath($path) $pathCurrent = str_replace(JPATH_ROOT, '', $path); $pathCurrent = str_replace(DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, $pathCurrent); - $folders = explode(DIRECTORY_SEPARATOR, $pathCurrent); + + $folders = explode(DIRECTORY_SEPARATOR, $pathConfigParse); $currentTmp = ''; foreach ($folders as $tmpFolder) @@ -233,15 +259,27 @@ public static function getFolderRoot() /** * @param $name + * @param string $default * * @return mixed * * @since version */ - public static function getParamsComponentValue($name) + public static function getParamsComponentValue($name, $default = '') { $componentParams = ComponentHelper::getParams('com_quantummanager'); - $value = $componentParams->get($name, ''); + $profiles = $componentParams->get('profiles', ''); + $value = $componentParams->get($name, $default); + $groups = Factory::getUser()->groups; + + foreach ($profiles as $key => $profile) + { + if(in_array((int)$profile->group, $groups) && ($name === $profile->config)) + { + $value = trim($profile->value); + break; + } + } return $value; } @@ -256,4 +294,25 @@ public static function loadLang() $lang->load($extension, $base_dir, $language_tag, true); } + /** + * @param $size + * + * @return string + * + * @since version + */ + public static function formatFileSize($size) { + $a = ["B", "KB", "MB", "GB", "TB", "PB"]; + $pos = 0; + + while ($size >= 1024) + { + $size /= 1024; + $pos++; + } + + return round($size,2)." ".$a[$pos]; + } + + } diff --git a/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.ini b/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.ini index aa32400..85b5a99 100644 --- a/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.ini +++ b/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.ini @@ -5,18 +5,19 @@ COM_QUANTUMMANAGER_CLEAN_WINDOW="Open in new window" COM_QUANTUMMANAGER_EMPTY_MIMETYPE="unknown mime type" COM_QUANTUMMANAGER_CONFIG_GENERAL="General Settings" -COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="" +COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="This is a common setting for the entire file manager" COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_LABEL="Default Folder" -COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="1" +COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="Enter the path for the files for this field here.
Available variables:
{user_id} - current user ID
{year} - current year
{month} - current month
{day} - current day
{hours} - current hour
{minutes} - minutes
{second} - seconds
{unix} - UNIX time in seconds

Example of usage:
images/{user_id}/{year}-{month}-{day}" COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZE_LABEL="Maximum file size for downloading
in megabytes" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_LABEL="Add postfix to file names" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_DESC="" +COM_QUANTUMMANAGER_CONFIG_GENERAL_METAFILE_LABEL="Meta tags for files" COM_QUANTUMMANAGER_CONFIG_GENERAL_HELP_LABEL="Show links to feedback" COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_LABEL="Allowed mime file types" -COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="1" +COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="" COM_QUANTUMMANAGER_CONFIG_IMAGE="Images" -COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="" +COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="Here you can configure automatic resizing of images, as well as the imposition of a watermark and cropping images" COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_LABEL="Save original images" COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_DESC="In the folder where the image is located, the folder _original will be created, in which the original images will be stored" COM_QUANTUMMANAGER_CONFIG_IMAGE_RESIZE_LABEL="Customize Image Size" @@ -29,6 +30,16 @@ COM_QUANTUMMANAGER_CONFIG_IMAGE_OVERLAY_PERCENT_LABEL="Percent Sign Compression" COM_QUANTUMMANAGER_CONFIG_IMAGE_OVERLAY_PERCENT_VALUE_LABEL="How many percent of the original image to occupy" COM_QUANTUMMANAGER_CONFIG_IMAGE_OVERLAY_POS_LABEL="Select a position for the sign" COM_QUANTUMMANAGER_CONFIG_IMAGE_OVERLAY_PADDING_LABEL="Indents from the edges of the image for the
sign in pixels" +COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP="Custom proportions
for the crop editor" +COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP_NAME="Proportion Name" +COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP_RATIO="Value of proportion (this number, for example: 1.3056 or 2.4)" + +COM_QUANTUMMANAGER_CONFIG_PROFILES="Profiles" +COM_QUANTUMMANAGER_CONFIG_PROFILES_DESC="Here you can override any variables specified in the settings for a specific user group" +COM_QUANTUMMANAGER_CONFIG_PROFILES_VARIABLES="Override List" +COM_QUANTUMMANAGER_CONFIG_PROFILES_GROUP="Group" +COM_QUANTUMMANAGER_CONFIG_PROFILES_CONFIG="Setting Name" +COM_QUANTUMMANAGER_CONFIG_PROFILES_VALUE="Override" COM_QUANTUMMANAGER_FILE_TO_LARGE_THAN_PHP_INI_ALLOWS="File size is larger than allowed by the server" COM_QUANTUMMANAGER_FILE_TO_LARGE_THAN_HTML_FORM_ALLOWS="The file size is larger than the manager’s settings allow" @@ -88,4 +99,16 @@ COM_QUANTUMMANAGER_HELP_QUESTIONS_CREATE="Ask" COM_QUANTUMMANAGER_HELP_QUESTIONS_SHOW="View all" COM_QUANTUMMANAGER_WINDOW_CLOSE="Close" -COM_QUANTUMMANAGER_WINDOW_INSERT="Insert file" \ No newline at end of file +COM_QUANTUMMANAGER_WINDOW_INSERT="Insert file" + +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_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_SECTIONSFOUND="Found section" +COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="View all tags" +COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Hide tags" \ No newline at end of file diff --git a/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.sys.ini b/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.sys.ini index 8820f9f..85b5a99 100644 --- a/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.sys.ini +++ b/administrator/components/com_quantummanager/language/en-GB/en-GB.com_quantummanager.sys.ini @@ -5,19 +5,19 @@ COM_QUANTUMMANAGER_CLEAN_WINDOW="Open in new window" COM_QUANTUMMANAGER_EMPTY_MIMETYPE="unknown mime type" COM_QUANTUMMANAGER_CONFIG_GENERAL="General Settings" -COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="" +COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="This is a common setting for the entire file manager" COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_LABEL="Default Folder" -COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="1" +COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="Enter the path for the files for this field here.
Available variables:
{user_id} - current user ID
{year} - current year
{month} - current month
{day} - current day
{hours} - current hour
{minutes} - minutes
{second} - seconds
{unix} - UNIX time in seconds

Example of usage:
images/{user_id}/{year}-{month}-{day}" COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZE_LABEL="Maximum file size for downloading
in megabytes" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_LABEL="Add postfix to file names" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_DESC="" -COM_QUANTUMMANAGER_CONFIG_GENERAL_METAFILE_LABEL="Meta Tags for Files" +COM_QUANTUMMANAGER_CONFIG_GENERAL_METAFILE_LABEL="Meta tags for files" COM_QUANTUMMANAGER_CONFIG_GENERAL_HELP_LABEL="Show links to feedback" COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_LABEL="Allowed mime file types" -COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="1" +COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="" COM_QUANTUMMANAGER_CONFIG_IMAGE="Images" -COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="" +COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="Here you can configure automatic resizing of images, as well as the imposition of a watermark and cropping images" COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_LABEL="Save original images" COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_DESC="In the folder where the image is located, the folder _original will be created, in which the original images will be stored" COM_QUANTUMMANAGER_CONFIG_IMAGE_RESIZE_LABEL="Customize Image Size" @@ -34,6 +34,13 @@ COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP="Custom proportions
for COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP_NAME="Proportion Name" COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP_RATIO="Value of proportion (this number, for example: 1.3056 or 2.4)" +COM_QUANTUMMANAGER_CONFIG_PROFILES="Profiles" +COM_QUANTUMMANAGER_CONFIG_PROFILES_DESC="Here you can override any variables specified in the settings for a specific user group" +COM_QUANTUMMANAGER_CONFIG_PROFILES_VARIABLES="Override List" +COM_QUANTUMMANAGER_CONFIG_PROFILES_GROUP="Group" +COM_QUANTUMMANAGER_CONFIG_PROFILES_CONFIG="Setting Name" +COM_QUANTUMMANAGER_CONFIG_PROFILES_VALUE="Override" + COM_QUANTUMMANAGER_FILE_TO_LARGE_THAN_PHP_INI_ALLOWS="File size is larger than allowed by the server" COM_QUANTUMMANAGER_FILE_TO_LARGE_THAN_HTML_FORM_ALLOWS="The file size is larger than the manager’s settings allow" COM_QUANTUMMANAGER_ERROR_PARTIAL_UPLOAD="Error loading file" @@ -87,12 +94,21 @@ COM_QUANTUMMANAGER_FIELDS_QUANTUMCROPPERJS_LABEL_FILE="File name" COM_QUANTUMMANAGER_FIELDS_QUANTUMCROPPERJS_LABEL_RATIO="Proportions" COM_QUANTUMMANAGER_FIELDS_QUANTUMCROPPERJS_LABEL_SAVE_RATIO="Save proportions" -COM_QUANTUMMANAGER_WRONG_JOOMLA="You need at least Joomla 3.8.1." -COM_QUANTUMMANAGER_WRONG_PHP="You need PHP version at least 5.6" - COM_QUANTUMMANAGER_HELP_QUESTIONS="Any questions?" COM_QUANTUMMANAGER_HELP_QUESTIONS_CREATE="Ask" COM_QUANTUMMANAGER_HELP_QUESTIONS_SHOW="View all" COM_QUANTUMMANAGER_WINDOW_CLOSE="Close" -COM_QUANTUMMANAGER_WINDOW_INSERT="Insert file" \ No newline at end of file +COM_QUANTUMMANAGER_WINDOW_INSERT="Insert file" + +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_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_SECTIONSFOUND="Found section" +COM_QUANTUMMANAGER_FILE_METAINFO_SHOW="View all tags" +COM_QUANTUMMANAGER_FILE_METAINFO_HIDE="Hide tags" \ No newline at end of file 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 eaaf79b..86117d6 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 @@ -5,9 +5,9 @@ COM_QUANTUMMANAGER_CLEAN_WINDOW="Открыть в новом окне" COM_QUANTUMMANAGER_EMPTY_MIMETYPE="неизвестный mime тип" COM_QUANTUMMANAGER_CONFIG_GENERAL="Общие настройки" -COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="" +COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="Это общие настройка для всего файлового менеджера" COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_LABEL="Папка по умолчанию" -COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="1" +COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="Укажите здесь путь для файлов для этого поля.
Доступные переменные:
{user_id} - ID текущего пользователя
{year} - текущий год
{month} - текущий месяц
{day} - текущий день
{hours} - текущий час
{minutes} - минуты
{second} - секунды
{unix} - время UNIX в секундах

Пример использования:
images/{user_id}/{year}-{month}-{day}" COM_QUANTUMMANAGER_CONFIG_GENERAL_MAXSIZE_LABEL="Максимальный размер файла для загрузки
в мегабайтах" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_LABEL="Добавлять постфикс к именам файлов" COM_QUANTUMMANAGER_CONFIG_GENERAL_POSTFIX_DESC="" @@ -17,7 +17,7 @@ COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_LABEL="Разрешенные mime т COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="1" COM_QUANTUMMANAGER_CONFIG_IMAGE="Изображения" -COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="" +COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="Здесь Вы можете настроить автоматический ресайзинг картинок, а так же наложение водяного знака и обрезки изображений" COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_LABEL="Сохранять оригиналы изображений" COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_DESC="В папке, где находится изображение будет создана папка _original, в которой будет хранится оригиналы изображений" COM_QUANTUMMANAGER_CONFIG_IMAGE_RESIZE_LABEL="Подгонять размер изображений" @@ -34,6 +34,13 @@ COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP="Кастомные пропо COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP_NAME="Название пропорции" COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP_RATIO="Значение пропорции (это число, например: 1.3056 или 2.4)" +COM_QUANTUMMANAGER_CONFIG_PROFILES="Профили" +COM_QUANTUMMANAGER_CONFIG_PROFILES_DESC="Здесь Вы можете переопределить любые переменные указанные в настройках для определенной группы пользоателей" +COM_QUANTUMMANAGER_CONFIG_PROFILES_VARIABLES="Список переопределений" +COM_QUANTUMMANAGER_CONFIG_PROFILES_GROUP="Группа" +COM_QUANTUMMANAGER_CONFIG_PROFILES_CONFIG="Имя настройки" +COM_QUANTUMMANAGER_CONFIG_PROFILES_VALUE="Переопределение" + COM_QUANTUMMANAGER_FILE_TO_LARGE_THAN_PHP_INI_ALLOWS="Размер файла больше, чем разрешено сервером" COM_QUANTUMMANAGER_FILE_TO_LARGE_THAN_HTML_FORM_ALLOWS="Размер файла больше, чем позволяют настройки менеджера" COM_QUANTUMMANAGER_ERROR_PARTIAL_UPLOAD="Ошибка при загрузке файла" @@ -92,4 +99,17 @@ COM_QUANTUMMANAGER_HELP_QUESTIONS_CREATE="Спросить" COM_QUANTUMMANAGER_HELP_QUESTIONS_SHOW="Просмотреть все" COM_QUANTUMMANAGER_WINDOW_CLOSE="Закрыть" -COM_QUANTUMMANAGER_WINDOW_INSERT="Вставить файл" \ No newline at end of file +COM_QUANTUMMANAGER_WINDOW_INSERT="Вставить файл" + + +COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME="Название файла" +COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME="Время изменения" +COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE="Размер файла" +COM_QUANTUMMANAGER_FILE_METAINFO_FILETYPE="Тип" +COM_QUANTUMMANAGER_FILE_METAINFO_RESOLUTION="Разрешение" +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 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 b73fbcb..5ecfccd 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 @@ -5,19 +5,19 @@ COM_QUANTUMMANAGER_CLEAN_WINDOW="Открыть в новом окне" COM_QUANTUMMANAGER_EMPTY_MIMETYPE="неизвестный mime тип" COM_QUANTUMMANAGER_CONFIG_GENERAL="Общие настройки" -COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="" +COM_QUANTUMMANAGER_CONFIG_GENERAL_DESC="Это общие настройка для всего файлового менеджера" COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_LABEL="Папка по умолчанию" -COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="1" +COM_QUANTUMMANAGER_CONFIG_GENERAL_PATH_DESC="Укажите здесь путь для файлов для этого поля.
Доступные переменные:
{user_id} - ID текущего пользователя
{year} - текущий год
{month} - текущий месяц
{day} - текущий день
{hours} - текущий час
{minutes} - минуты
{second} - секунды
{unix} - время UNIX в секундах

Пример использования:
images/{user_id}/{year}-{month}-{day}" 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_HELP_LABEL="Показывать ссылки на обратную связь" COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_LABEL="Разрешенные mime типы файлов" -COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="1" +COM_QUANTUMMANAGER_CONFIG_GENERAL_MIMETYPE_DESC="" COM_QUANTUMMANAGER_CONFIG_IMAGE="Изображения" -COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="" +COM_QUANTUMMANAGER_CONFIG_IMAGE_DESC="Здесь Вы можете настроить автоматический ресайзинг картинок, а так же наложение водяного знака и обрезки изображений" COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_LABEL="Сохранять оригиналы изображений" COM_QUANTUMMANAGER_CONFIG_IMAGE_ORIGINAL_DESC="В папке, где находится изображение будет создана папка _original, в которой будет хранится оригиналы изображений" COM_QUANTUMMANAGER_CONFIG_IMAGE_RESIZE_LABEL="Подгонять размер изображений" @@ -34,12 +34,18 @@ COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP="Кастомные пропо COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP_NAME="Название пропорции" COM_QUANTUMMANAGER_CONFIG_IMAGE_CUSTOMPRESETCROP_RATIO="Значение пропорции (это число, например: 1.3056 или 2.4)" +COM_QUANTUMMANAGER_CONFIG_PROFILES="Профили" +COM_QUANTUMMANAGER_CONFIG_PROFILES_DESC="Здесь Вы можете переопределить любые переменные указанные в настройках для определенной группы пользоателей" +COM_QUANTUMMANAGER_CONFIG_PROFILES_VARIABLES="Список переопределений" +COM_QUANTUMMANAGER_CONFIG_PROFILES_GROUP="Группа" +COM_QUANTUMMANAGER_CONFIG_PROFILES_CONFIG="Имя настройки" +COM_QUANTUMMANAGER_CONFIG_PROFILES_VALUE="Переопределение" + COM_QUANTUMMANAGER_FILE_TO_LARGE_THAN_PHP_INI_ALLOWS="Размер файла больше, чем разрешено сервером" COM_QUANTUMMANAGER_FILE_TO_LARGE_THAN_HTML_FORM_ALLOWS="Размер файла больше, чем позволяют настройки менеджера" COM_QUANTUMMANAGER_ERROR_PARTIAL_UPLOAD="Ошибка при загрузке файла" COM_QUANTUMMANAGER_ERROR_UPLOAD_ACCESS="Не разрешенный тип файла" - COM_QUANTUMMANAGER_FIELDS_QUANTUMUPLOAD_DRAG_DROP="Бросьте файлы в область для загрузки" COM_QUANTUMMANAGER_FIELDS_QUANTUMUPLOAD_UPLOAD_DROP="Для загрузки перетащите файлы или" COM_QUANTUMMANAGER_FIELDS_QUANTUMUPLOAD_UPLOAD_SELECT="выберите на своем устройстве." @@ -88,12 +94,22 @@ COM_QUANTUMMANAGER_FIELDS_QUANTUMCROPPERJS_LABEL_FILE="Название файл COM_QUANTUMMANAGER_FIELDS_QUANTUMCROPPERJS_LABEL_RATIO="Пропорции" COM_QUANTUMMANAGER_FIELDS_QUANTUMCROPPERJS_LABEL_SAVE_RATIO="Сохранять пропорции" -COM_QUANTUMMANAGER_WRONG_JOOMLA="Ваша версия Joomla слишком старая. Quantum Manager будет работать только на Joomla с версии 3.8.1." -COM_QUANTUMMANAGER_WRONG_PHP="Нужна версия PHP не ниже 5.6" - COM_QUANTUMMANAGER_HELP_QUESTIONS="Есть вопросы?" COM_QUANTUMMANAGER_HELP_QUESTIONS_CREATE="Спросить" COM_QUANTUMMANAGER_HELP_QUESTIONS_SHOW="Просмотреть все" COM_QUANTUMMANAGER_WINDOW_CLOSE="Закрыть" -COM_QUANTUMMANAGER_WINDOW_INSERT="Вставить файл" \ No newline at end of file +COM_QUANTUMMANAGER_WINDOW_INSERT="Вставить файл" + + +COM_QUANTUMMANAGER_FILE_METAINFO_FILENAME="Название файла" +COM_QUANTUMMANAGER_FILE_METAINFO_FILEDATETIME="Время изменения" +COM_QUANTUMMANAGER_FILE_METAINFO_FILESIZE="Размер файла" +COM_QUANTUMMANAGER_FILE_METAINFO_FILETYPE="Тип" +COM_QUANTUMMANAGER_FILE_METAINFO_RESOLUTION="Разрешение" +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 diff --git a/administrator/components/com_quantummanager/layouts/fields/quantumviewfiles.php b/administrator/components/com_quantummanager/layouts/fields/quantumviewfiles.php index d2c1607..fef51a9 100644 --- a/administrator/components/com_quantummanager/layouts/fields/quantumviewfiles.php +++ b/administrator/components/com_quantummanager/layouts/fields/quantumviewfiles.php @@ -51,6 +51,8 @@ 'buttonGrid': '', 'directoryName': '', 'directoryNameRequired': '', - 'changeGridViews': '' + 'changeGridViews': '', + 'metaFileShow': '', + 'metaFileHide': '', }; diff --git a/administrator/components/com_quantummanager/views/quantummanager/tmpl/default.php b/administrator/components/com_quantummanager/views/quantummanager/tmpl/default.php index 916bd3a..ad40062 100644 --- a/administrator/components/com_quantummanager/views/quantummanager/tmpl/default.php +++ b/administrator/components/com_quantummanager/views/quantummanager/tmpl/default.php @@ -19,7 +19,8 @@ try { JLoader::register('JFormFieldQuantumCombine', JPATH_ROOT . '/administrator/components/com_quantummanager/fields/quantumcombine.php'); JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); - $folderRoot = QuantummanagerHelper::getFolderRoot(); + //$folderRoot = QuantummanagerHelper::getFolderRoot(); + $folderRoot = 'root'; $buttonsBun = []; $fields = [ diff --git a/administrator/components/com_quantummanager/views/quantummanager/tmpl/modal.php b/administrator/components/com_quantummanager/views/quantummanager/tmpl/modal.php index 5e6c262..1e9dbd3 100644 --- a/administrator/components/com_quantummanager/views/quantummanager/tmpl/modal.php +++ b/administrator/components/com_quantummanager/views/quantummanager/tmpl/modal.php @@ -48,7 +48,8 @@ try { JLoader::register('JFormFieldQuantumCombine', JPATH_ROOT . '/administrator/components/com_quantummanager/fields/quantumcombine.php'); JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); - $folderRoot = QuantummanagerHelper::getFolderRoot(); + //$folderRoot = QuantummanagerHelper::getFolderRoot(); + $folderRoot = 'root'; $buttonsBun = []; $fields = [ @@ -78,8 +79,8 @@ 'position' => 'bottom' ], /*'quantumcodemirror' => [ - 'position' => 'center' - ],*/ + 'position' => 'center' + ],*/ ]; diff --git a/administrator/components/com_quantummanager/views/quantummanager/tmpl/window.php b/administrator/components/com_quantummanager/views/quantummanager/tmpl/window.php index cb90399..24cffe0 100644 --- a/administrator/components/com_quantummanager/views/quantummanager/tmpl/window.php +++ b/administrator/components/com_quantummanager/views/quantummanager/tmpl/window.php @@ -30,7 +30,8 @@ try { JLoader::register('JFormFieldQuantumCombine', JPATH_ROOT . '/administrator/components/com_quantummanager/fields/quantumcombine.php'); JLoader::register('QuantummanagerHelper', JPATH_SITE . '/administrator/components/com_quantummanager/helpers/quantummanager.php'); - $folderRoot = QuantummanagerHelper::getFolderRoot(); + //$folderRoot = QuantummanagerHelper::getFolderRoot(); + $folderRoot = 'root'; $buttonsBun = []; $fields = [ diff --git a/changelog.md b/changelog.md index 22ef59b..4ecf7d5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,15 +1,17 @@ -1.0.3 +1.1 - убрана папка com_quantummanager из images (это папка кеша менеджера) - в cropperjs модуле PX переведены в нижний регистр - убрано дерганье при открытии папки - при удалении папки указывается ее имя - в конфигурации вы можете указать свои кастомные пропорции для кропа - переделан немного интерфейс -- добавлена опция метатегов для изображений +- добавлена опция метатегов для файлов - не учитывался параметр: максимальный размер загружаемых файлов, теперь учитывается - поправлены языковые константы - исправлено удаление папки - исправлен автоматический ресайз картинок при загрузке +- добавлены переменные для путей +- добавлена возможность переопределить конфигурация менеджера под группы пользователей 1.0.2 - картинки переведены на lazyload diff --git a/media/com_quantummanager/css/quantumtoolbar.css b/media/com_quantummanager/css/quantumtoolbar.css index 87cb207..ae6fbf7 100644 --- a/media/com_quantummanager/css/quantumtoolbar.css +++ b/media/com_quantummanager/css/quantumtoolbar.css @@ -31,10 +31,10 @@ width: 25%; } .quantumtoolbar-module .center { - width: 50%; + width: 65%; } .quantumtoolbar-module .right { - width: 25%; + width: 10%; justify-content: flex-end; } .quantumtoolbar-module button { @@ -78,7 +78,7 @@ background: linear-gradient(to right, #B06AB3, #4568DC); border: 1px solid transparent; } -@media screen and (max-width: 1180px) { +@media screen and (max-width: 1360px) { .quantumtoolbar-module button.hidden-label span:last-child { display: none; } diff --git a/media/com_quantummanager/css/quantumupload.css b/media/com_quantummanager/css/quantumupload.css index 671e9e4..409c416 100644 --- a/media/com_quantummanager/css/quantumupload.css +++ b/media/com_quantummanager/css/quantumupload.css @@ -60,7 +60,8 @@ .quantumupload-module progress { display: none; width: 100%; - margin: 10px 10px 0 10px; + margin: 10px 10px 0 0; + padding: 0 10px 0 10px; } .quantumupload-module progress { vertical-align: baseline; diff --git a/media/com_quantummanager/css/quantumviewfiles.css b/media/com_quantummanager/css/quantumviewfiles.css index 515e9dd..89e0bc2 100644 --- a/media/com_quantummanager/css/quantumviewfiles.css +++ b/media/com_quantummanager/css/quantumviewfiles.css @@ -203,7 +203,7 @@ } .quantumviewfiles-module .meta-file { position: relative; - width: 20%; + width: 25%; } .quantumviewfiles-module .meta-file.hidden { display: none; @@ -222,13 +222,40 @@ -o-transform: translateZ(0); transform: translateZ(0); } -.quantumviewfiles-module .meta-file ul { - list-style: none; +.quantumviewfiles-module .meta-file .meta-hidden { + display: none; } -.quantumviewfiles-module .meta-file ul li { - display: block; - padding: 5px; - font-size: 14px; +.quantumviewfiles-module .meta-file .show-all-tags { + display: inline-block; + padding: 6px; + color: #000000; +} +.quantumviewfiles-module .meta-file .show-all-tags:hover { + color: #444444; + cursor: pointer; +} +.quantumviewfiles-module .meta-file table { + border-collapse: collapse; + 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 { + transition: background-color .1s linear; +} +.quantumviewfiles-module .meta-file table td { + padding: 6px; + vertical-align: middle; +} +.quantumviewfiles-module .meta-file table td { + width: 50%; +} +.quantumviewfiles-module .meta-file table td:last-child { + font-weight: bold; } .quantumviewfiles-module .field-list-files { width: 100%; diff --git a/media/com_quantummanager/js/modaleditor.js b/media/com_quantummanager/js/modaleditor.js index 599e910..103905d 100644 --- a/media/com_quantummanager/js/modaleditor.js +++ b/media/com_quantummanager/js/modaleditor.js @@ -25,62 +25,71 @@ document.addEventListener('DOMContentLoaded', function () { for(let i=0;i'; + // Set align attribute + if (align && !caption) + { + attr.push('class="pull-' + align + '"'); + } - // Process caption - if (caption) - { - if (align) + // Set title attribute + if (title) { - figclass = ' class="pull-' + align + '"'; + attr.push('title="' + title + '"'); } - if (c_class) + tag = ''; + + // Process caption + if (caption) { - captionclass = ' class="' + c_class + '"'; + if (align) + { + figclass = ' class="pull-' + align + '"'; + } + + if (c_class) + { + captionclass = ' class="' + c_class + '"'; + } + + tag = '' + tag + '' + caption + ''; } + } - tag = '' + tag + '' + caption + ''; + if (window.Joomla && Joomla.editors.instances.hasOwnProperty(editor)) { + Joomla.editors.instances[editor].replaceSelection(tag) + } else { + window.parent.jInsertEditorText(tag, editor); } - } - if (window.Joomla && Joomla.editors.instances.hasOwnProperty(editor)) { - Joomla.editors.instances[editor].replaceSelection(tag) - } else { - window.parent.jInsertEditorText(tag, editor); - } + window.parent.jModalClose(); - window.parent.jModalClose(); + }); ev.preventDefault(); }); diff --git a/media/com_quantummanager/js/modalfield.js b/media/com_quantummanager/js/modalfield.js index 3d3b1b0..01e2517 100644 --- a/media/com_quantummanager/js/modalfield.js +++ b/media/com_quantummanager/js/modalfield.js @@ -24,13 +24,22 @@ document.addEventListener('DOMContentLoaded', function () { setTimeout(function () { for(let i=0;i" + directories.path + ""; + return "
  • " + directories.path + "
  • "; } }; diff --git a/media/com_quantummanager/js/quantumviewfiles.js b/media/com_quantummanager/js/quantumviewfiles.js index 1b4e2e0..29fd22a 100644 --- a/media/com_quantummanager/js/quantumviewfiles.js +++ b/media/com_quantummanager/js/quantumviewfiles.js @@ -145,7 +145,6 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { this.path = path; } - if (Filemanager.data.path === undefined || Filemanager.data.path !== path) { Filemanager.data.path = path; } @@ -153,8 +152,19 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { ViewfilesElement.querySelector('.view').innerHTML = ''; this.preoloader(); + if(self.viewMeta !== null) { + self.viewMeta.classList.add('hidden'); + } + jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumviewfiles.getFiles&path=" + encodeURIComponent(path) + '&v=' + QuantumUtils.randomInteger(111111, 999999)).done(function (response) { response = JSON.parse(response); + + if(response.error !== undefined) { + Filemanager.data.path = 'root'; + self.trigger('updatePath'); + return; + } + let htmlfilesAndDirectories = '
    '; let files = response.files; let directories = response.directories; @@ -252,18 +262,50 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { qvf.trigger('clickFile', element); if(self.options.metafile === '1') { - jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumviewfiles.getMetaFile&path=" + encodeURIComponent(qvf.path) + '&name=' + encodeURIComponent(element.getAttribute('data-filep'))).done(function (response) { + jQuery.get("/administrator/index.php?option=com_quantummanager&task=quantumviewfiles.getMetaFile&path=" + encodeURIComponent(qvf.path) + '&name=' + encodeURIComponent(element.getAttribute('data-file'))).done(function (response) { response = JSON.parse(response); - if(response.length > 0) { + if(response.global !== undefined || response.find !== undefined) { self.viewMeta.classList.remove('hidden'); - let html = '
      '; - for(let i=0;i'; + let html = ''; + + if(response.global !== undefined) { + html += ''; + for (let i in response.global) { + html += ''; + } + html += '
      ' + response.global[i].key + '' + response.global[i].value + '
      '; + } + + if(response.find !== undefined) { + if(Object.keys(response.find).length > 0) { + html += '' + QuantumviewfilesLang.metaFileShow + ''; + html += ''; + for (let i in response.find) { + html += ''; + } + html += '
      ' + response.find[i].key + '' + response.find[i].value + '
      '; + } } - html += '
    '; self.viewMeta.querySelector('.meta-file-list').innerHTML = html; + let buttonToggleTags = self.viewMeta.querySelector('.show-all-tags'); + + if(buttonToggleTags !== null) { + let metaFind = self.viewMeta.querySelector('.meta-find'); + buttonToggleTags.addEventListener('click', function () { + if(this.classList.contains('active')) { + this.classList.remove('active'); + this.innerHTML = QuantumviewfilesLang.metaFileShow; + metaFind.classList.add('meta-hidden'); + } else { + this.classList.add('active'); + this.innerHTML = QuantumviewfilesLang.metaFileHide; + metaFind.classList.remove('meta-hidden'); + } + }); + } + } else { self.viewMeta.classList.add('hidden'); } @@ -568,6 +610,7 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { if(fileP.indexOf('index.php') === -1) { file = path.replace('root', path) + '/' + fileP; + file = "/images/com_quantummanager/cache/" + file + '?' + QuantumUtils.randomInteger(111111, 999999); if(fileExs.toLowerCase() === 'svg') { @@ -635,8 +678,8 @@ window.Quantumviewfiles = function(Filemanager, ViewfilesElement, options) { }); Filemanager.events.add(this, 'updatePath', function (fm, el) { - //вырубаем кнопки для выделенного + //вырубаем кнопки для выделенного if(fm.Quantumtoolbar !== undefined && fm.Quantumtoolbar.buttonsList['viewfilesDelete'] !== undefined) { fm.Quantumtoolbar.buttonsList['viewfilesDelete'].classList.add('btn-hide'); } diff --git a/quantummanager.xml b/quantummanager.xml index 255caf8..2f40dd6 100644 --- a/quantummanager.xml +++ b/quantummanager.xml @@ -7,7 +7,7 @@ https://delo-design.ru Copyright (C) 2019 "Delo Design". All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 1.0.3 + 1.1 COM_QUANTUMMANAGER_XML_DESCRIPTION script.php