diff --git a/elements/radicalmultifieldtreecatalog.php b/elements/radicalmultifieldtreecatalog.php index 928a39d..c2bcd0a 100644 --- a/elements/radicalmultifieldtreecatalog.php +++ b/elements/radicalmultifieldtreecatalog.php @@ -145,8 +145,17 @@ public function getInput($only_directories = false) 'relative' => false ]); + // Add some JS language strings to translate + Text::script('PLG_RADICAL_MULTI_FIELD_BUTTON_BACK'); + Text::script('PLG_RADICAL_MULTI_FIELD_BUTTON_UP'); + Text::script('PLG_RADICAL_MULTI_FIELD_BUTTON_GRID'); + Text::script('PLG_RADICAL_MULTI_FIELD_BUTTON_LIST'); + Text::script('PLG_RADICAL_MULTI_FIELD_BUTTON_SELECTALL'); - $app = Factory::getApplication(); + // Add the root url as JS var + Factory::getDocument()->addScriptDeclaration("let siteUrl = '".JUri::root()."';"); + + $app = Factory::getApplication(); // get attributes $importfield = $this->getAttribute('importfield'); diff --git a/elements/radicalmultifieldupload.php b/elements/radicalmultifieldupload.php index ca174a1..4f3ccc0 100644 --- a/elements/radicalmultifieldupload.php +++ b/elements/radicalmultifieldupload.php @@ -19,7 +19,7 @@ class FormFieldRadicalmultifieldupload extends JFormField /** * @return string */ - protected function getInput() + public function getInput() { HTMLHelper::_('jquery.framework', false, null, false); @@ -32,4 +32,4 @@ protected function getInput() return $layout->render(); } -} \ No newline at end of file +} diff --git a/language/en-GB/en-GB.plg_fields_radicalmultifield.ini b/language/en-GB/en-GB.plg_fields_radicalmultifield.ini index d9d28b1..7c0d636 100644 --- a/language/en-GB/en-GB.plg_fields_radicalmultifield.ini +++ b/language/en-GB/en-GB.plg_fields_radicalmultifield.ini @@ -79,3 +79,9 @@ PLG_RADICAL_MULTI_FIELD_IMPORT_FILE_TO_LARGE_THAN_HTML_FORM_ALLOWS="The file siz PLG_RADICAL_MULTI_FIELD_IMPORT_ERROR_PARTIAL_UPLOAD="An error occurred while loading the file." PLG_RADICAL_MULTI_FIELD_IMPORT_ERROR_MIME_TYPE_UPLOAD="The specified mime file type is not allowed in the field settings." PLG_RADICAL_MULTI_FIELD_IMPORT_ERROR_MIME_TYPE_LABEL="mime type" + +PLG_RADICAL_MULTI_FIELD_BUTTON_BACK="Back" +PLG_RADICAL_MULTI_FIELD_BUTTON_UP="Up" +PLG_RADICAL_MULTI_FIELD_BUTTON_GRID="Grid" +PLG_RADICAL_MULTI_FIELD_BUTTON_LIST="List" +PLG_RADICAL_MULTI_FIELD_BUTTON_SELECTALL="Select all" diff --git a/language/ru-RU/ru-RU.plg_fields_radicalmultifield.ini b/language/ru-RU/ru-RU.plg_fields_radicalmultifield.ini index c2a3313..951279c 100644 --- a/language/ru-RU/ru-RU.plg_fields_radicalmultifield.ini +++ b/language/ru-RU/ru-RU.plg_fields_radicalmultifield.ini @@ -79,3 +79,9 @@ PLG_RADICAL_MULTI_FIELD_IMPORT_FILE_TO_LARGE_THAN_HTML_FORM_ALLOWS="Размер PLG_RADICAL_MULTI_FIELD_IMPORT_ERROR_PARTIAL_UPLOAD="Ошибка при загрузке файла." PLG_RADICAL_MULTI_FIELD_IMPORT_ERROR_MIME_TYPE_UPLOAD="Указанный mime тип файла не разрешен в настройках поля." PLG_RADICAL_MULTI_FIELD_IMPORT_ERROR_MIME_TYPE_LABEL="mime тип" + +PLG_RADICAL_MULTI_FIELD_BUTTON_BACK="Назад" +PLG_RADICAL_MULTI_FIELD_BUTTON_UP="Вверх" +PLG_RADICAL_MULTI_FIELD_BUTTON_GRID="Сеткой" +PLG_RADICAL_MULTI_FIELD_BUTTON_LIST="Списком" +PLG_RADICAL_MULTI_FIELD_BUTTON_SELECTALL="Выбрать все файлы" diff --git a/layouts/repeatable-cards/section.php b/layouts/repeatable-cards/section.php index 5b5434d..ffc6f47 100644 --- a/layouts/repeatable-cards/section.php +++ b/layouts/repeatable-cards/section.php @@ -59,7 +59,7 @@ class="subform-card subform-repeatable-group-"
@@ -71,7 +71,7 @@ class="subform-card subform-repeatable-group-" diff --git a/media/core/js/import.js b/media/core/js/import.js index c03ccb9..11d52a6 100644 --- a/media/core/js/import.js +++ b/media/core/js/import.js @@ -36,6 +36,11 @@ jQuery(function(){ vex.dialog.buttons.YES.text = 'Ок'; vex.dialog.buttons.NO.text = 'Нет'; vex.dialog.buttons.NO.text = 'Отмена'; + let btnback = Joomla.JText._('PLG_RADICAL_MULTI_FIELD_BUTTON_BACK'); + let btnup = Joomla.JText._('PLG_RADICAL_MULTI_FIELD_BUTTON_UP'); + let btngrid = Joomla.JText._('PLG_RADICAL_MULTI_FIELD_BUTTON_GRID'); + let btnlist = Joomla.JText._('PLG_RADICAL_MULTI_FIELD_BUTTON_LIST'); + let btnselectall = Joomla.JText._('PLG_RADICAL_MULTI_FIELD_BUTTON_SELECTALL'); jQuery('.button-open-modal').on('click', function() { modalName = jQuery(this).attr('href'); @@ -106,7 +111,7 @@ jQuery(function(){ list.find('.av-folderlist-label').removeClass('selected'); jQuery(this).addClass('selected'); listfiles.html(''); - jQuery.get("/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=json&type=get_files&directory=" + encodeURIComponent(self.attr('path')) + + jQuery.get(siteUrl + "/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=json&type=get_files&directory=" + encodeURIComponent(self.attr('path')) + "&importfieldpath=" + encodeURIComponent(importfieldpath) + "&importfield=" + encodeURIComponent(importfield) ).done(function (response) { @@ -125,7 +130,7 @@ jQuery(function(){ inputPath.value = path; - let htmlfilesAndDirectories = '