Skip to content

Commit

Permalink
Merge pull request #23 from vistamedia/master
Browse files Browse the repository at this point in the history
+ Add some missing translations.
  • Loading branch information
dmitriitux authored Jan 9, 2021
2 parents 4dc9d6a + 9a813b3 commit ba277db
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
11 changes: 10 additions & 1 deletion elements/radicalmultifieldtreecatalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions elements/radicalmultifieldupload.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class FormFieldRadicalmultifieldupload extends JFormField
/**
* @return string
*/
protected function getInput()
public function getInput()
{
HTMLHelper::_('jquery.framework', false, null, false);

Expand All @@ -32,4 +32,4 @@ protected function getInput()
return $layout->render();
}

}
}
6 changes: 6 additions & 0 deletions language/en-GB/en-GB.plg_fields_radicalmultifield.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 6 additions & 0 deletions language/ru-RU/ru-RU.plg_fields_radicalmultifield.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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="Выбрать все файлы"
4 changes: 2 additions & 2 deletions layouts/repeatable-cards/section.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class="subform-card subform-repeatable-group-<?php echo $unique_subform_id; ?>"

<div class="subform-card-content-toolbar">
<a class="btn button btn-primary button-subform-card-title-show" >
<span class="icon-arrow-left"></span> <span>Назад</span>
<span class="icon-arrow-left"></span> <span><?= JText::_('PLG_RADICAL_MULTI_FIELD_BUTTON_BACK') ?></span>
</a>
</div>

Expand All @@ -71,7 +71,7 @@ class="subform-card subform-repeatable-group-<?php echo $unique_subform_id; ?>"

<div class="subform-card-content-foot">
<a class="btn button btn-primary button-subform-card-title-show" >
<span class="icon-arrow-left"></span> <span>Назад</span>
<span class="icon-arrow-left"></span> <span><?= JText::_('PLG_RADICAL_MULTI_FIELD_BUTTON_BACK') ?></span>
</a>
</div>

Expand Down
17 changes: 11 additions & 6 deletions media/core/js/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand All @@ -125,7 +130,7 @@ jQuery(function(){
inputPath.value = path;


let htmlfilesAndDirectories = '<div class="files-header"><div><label><input type="checkbox" class="import-files-check-all"> Выбрать все файлы</label></div><div><button class="button-prev"><span>Назад</span></button><button class="button-up"><span>Вверх</span></button><div class="button-dropdown"><button class="button-directory-trash"><span>Удалить директорию</span></button><div class="dropdown-content">Удалить: <b>" + path+ "</b>?<div><button><span>Удалить</span></button></div></div></div><button class="button-grid"><span>Сеткой</span></button><button class="button-table"><span>Списком</span></button></div></div>';
let htmlfilesAndDirectories = '<div class="files-header"><div><label><input type="checkbox" class="import-files-check-all"> ' + btnselectall + '</label></div><div><button class="button-prev"><span>' + btnback + '</span></button><button class="button-up"><span>' + btnup + '</span></button><div class="button-dropdown"><button class="button-directory-trash"><span>Удалить директорию</span></button><div class="dropdown-content">Удалить: <b>" + path+ "</b>?<div><button><span>Удалить</span></button></div></div></div><button class="button-grid"><span>' + btngrid + '</span></button><button class="button-table"><span>' + btnlist + '</span></button></div></div>';
let files = response.data[0].files;
let directories = response.data[0].directories;

Expand Down Expand Up @@ -285,7 +290,7 @@ jQuery(function(){
callback: function (value) {
let newName = value;
if (newName) {
jQuery.get("/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=raw&type=create_directory&name=" +
jQuery.get(siteUrl + "/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=raw&type=create_directory&name=" +
encodeURIComponent(newName) +
"&path=" + encodeURIComponent(active.find('.av-folderlist-label').attr('path')) +
"&importfieldpath=" + encodeURIComponent(importfieldpath) +
Expand All @@ -310,7 +315,7 @@ jQuery(function(){
jQuery('.modal-import-file .tree-reload').on('click', function() {
let lastActive = active.find('.av-folderlist-label').attr('path');
let bufferScrollTop = jQuery('.av-folderlist').scrollTop();
jQuery.get("/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=raw&type=get_directories" +
jQuery.get(siteUrl + "/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=raw&type=get_directories" +
"&importfieldpath=root" +
"&importfield=" + encodeURIComponent(importfield)
).done(function (response) {
Expand Down Expand Up @@ -655,7 +660,7 @@ jQuery(function(){
}


let url = "/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=json&type=upload_file"
let url = siteUrl + "/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=json&type=upload_file"
+ "&importfieldpath=" + encodeURIComponent(importfieldpath)
+ "&importfield=" + encodeURIComponent(importfield);
let xhr = new XMLHttpRequest();
Expand Down Expand Up @@ -782,4 +787,4 @@ jQuery(function(){
});


});
});

0 comments on commit ba277db

Please sign in to comment.