Skip to content

Commit

Permalink
Исправление для версии 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriitux committed Apr 20, 2019
1 parent f6183a0 commit 5a4e1a9
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 68 deletions.
9 changes: 7 additions & 2 deletions language/en-GB/en-GB.plg_fields_radicalmultifield.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ PLG_RADICAL_MULTI_FIELD="Field - Radical MultiField"
PLG_FIELDS_RADICALMULTIFIELD_LABEL="Radical MultiField"
PLG_RADICAL_MULTI_FIELD_XML_DESCRIPTION="Field that implements the enumerated array of data fields"

PLG_RADICAL_MULTI_FIELD_PARAMS_EXTEND_FIELDS_LABEL="Дополнительные типы полей"
PLG_RADICAL_MULTI_FIELD_PARAMS_EXTEND_FIELDS_DESC="Укажите с новой строки свои типы полей"
PLG_RADICAL_MULTI_FIELD_PARAMS_EXTEND_FIELDS_LABEL="Additional field types"
PLG_RADICAL_MULTI_FIELD_PARAMS_EXTEND_FIELDS_DESC="Specify your field types from a new line"

PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_TEMPLATE_LABEL="Template for site"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_TEMPLATE_DESC="Template that defines the appearance of the field when it is displayed on the site. If you selected a gallery or a slideshow, then the field names for the template must have the names 'image' for the image and 'alt' for the image name"
Expand All @@ -25,15 +25,20 @@ PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTEXC_DESC="Extensions are used to
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPATH_LABEL="Path for files"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPATH_DESC="Specify the path for the files for this field here. <br/> Available variables: <br /> <b> {user_id} </ b> - current user ID <br /> <b> {year} </ b> - current year <br /> <b> { month} </ b> - current month <br/> <b> {day} </ b> - current day <br/> <b> {hours} </ b> - current hour <br/> <b> {minutes} </ b> - minutes <br/> <b> {second} </ b> - seconds <br/> <b> {unix} </ b> - UNIX time in seconds <br/> <br /> Example usage: <br/> images/{user_id}/{year}-{month}-{day}"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTMAXSIZE_LABEL="Maximum file size for uploading <br /> in megabytes"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTORIGINAL_LABEL="Keep originals"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTORIGINAL_DESC="In the folder where the image is located, the folder will be created <b>_original</b>, in which the original images will be stored"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZE_LABEL="Enable image resizing"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZE_DESC="When the resize is enabled, the images will resize under the specified maximum width and height"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEMAXWIDTH_LABEL="Maximum width <br /> in pixels"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEMAXHEIGHT_LABEL="Maximum height <br /> in pixels"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPREVIEW_LABEL="Generate preview images"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPREVIEW_DESC="Creating thumbnails for the field"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPREVIEWMAXWIDTH_LABEL="Max width preview <br /> in pixels"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPREVIEWMAXHEIGHT_LABEL="Max height preview <br /> in pixels"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEOVERLAY_LABEL="Apply a watermark"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEOVERLAYFILE_LABEL="Watermark File"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEOVERLAYPERCENT_LABEL="Percent sign compression"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEOVERLAYPERCENT_VALUE_LABEL="How many percent of the original image to occupy"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEOVERLAYPOS_LABEL="Select a position for the sign"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEOVERLAYPADDING_LABEL="Indent from the edges of the image for the <br /> sign in pixels"

Expand Down
3 changes: 1 addition & 2 deletions language/ru-RU/ru-RU.plg_fields_radicalmultifield.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPATH_DESC="Укажите зде
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTMAXSIZE_LABEL="Максимальный размер файла для загрузки <br /> в мегабайтах"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTORIGINAL_LABEL="Сохранять оригиналы"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTORIGINAL_DESC="В папке, где находится изображение будет создана папка <b>_original</b>, в которой будет хранится оригиналы изображений"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTORIGINALMAXWIDTH_LABEL="Максимальная ширина оригинального изображения<br /> в пикселях"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTORIGINALMAXHEIGHT_LABEL="Максимальная высота оригинального изображения<br /> в пикселях"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZE_LABEL="Подгонять размер изображений"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZE_DESC="При включеном параметре, изображения будут изменять размер под указанные максимальную ширину и высоту в пикселях"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEMAXWIDTH_LABEL="Максимальная ширина <br /> в пикселях"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEMAXHEIGHT_LABEL="Максимальная высота <br /> в пикселях"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPREVIEW_LABEL="Генерация превью картинок"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPREVIEW_DESC="Создание файлов превью уменьшенного размера для поля"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPREVIEWMAXWIDTH_LABEL="Максимальная ширина превью <br /> в пикселях"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTPREVIEWMAXHEIGHT_LABEL="Максимальная высота превью <br /> в пикселях"
PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZEOVERLAY_LABEL="Накладывать водяной знак"
Expand Down
3 changes: 2 additions & 1 deletion media/core/css/cards.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
background-size: contain !important;
background-position: 50% 50% !important;
background-repeat: no-repeat;
border: 1px solid rgba(50, 50, 50, 0.11);
transition: all 0.2s;
}

Expand Down Expand Up @@ -80,6 +81,7 @@
}

.subform-repeatable-cards .subform-card .subform-card-tile .subform-card-tile-title:after {
display: none;
position: absolute;
bottom: 20px;
left: 0;
Expand All @@ -88,7 +90,6 @@
color: #fff;
text-indent: 0;
text-align: center;
display: block;
content: "Нажмите для изменения";
transition: all 0.2s;
border-radius: 3px 3px 0 0;
Expand Down
63 changes: 29 additions & 34 deletions media/core/css/tree.css
Original file line number Diff line number Diff line change
Expand Up @@ -552,18 +552,20 @@
.field-list-files .files-header {
width: 100%;
margin-bottom: 5px;
margin-left: 1%;
margin-left: 0;
margin-right: 1%;
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: nowrap;
}
.field-list-files .files-header > div {
width: 50%;
width: auto;
white-space: nowrap;
}
.field-list-files .files-header > div:last-child {
text-align: right;
}
.field-list-files .files-header > div button:first-child {
margin-right: 10px;
margin-right: 0;
}
.field-list-files .files-header > div button {
position: relative;
Expand All @@ -574,6 +576,7 @@
height: 26px;
font-size: 13px;
transition: all 0.2s;
margin-right: 10px;
}
.field-list-files .files-header > div button:hover {
background: #ebebeb;
Expand Down Expand Up @@ -622,36 +625,26 @@
.field-list-files .files-header label input {
margin-right: 5px;
}
.field-list-files .files-toolbar {
.field-list-files .files-header {
width: 100%;
padding: 0 5px;
margin-bottom: 10px;
}
.field-list-files .files-toolbar button {
position: relative;
background: transparent;
border-radius: 5px;
border: 1px solid #dddddd;
padding-left: 33px;
height: 26px;
font-size: 13px;
transition: all 0.2s;
}
.field-list-files .files-toolbar button.button-directory-trash {
.field-list-files .files-header button.button-directory-trash {
display: none;
}
.field-list-files .files-toolbar button:hover {
.field-list-files .files-header button:hover {
background: #ebebeb;
transition: all 0.2s;
}
.field-list-files .files-toolbar > * {
.field-list-files .files-header > * {
display: inline-block;
margin-right: 10px;
}
.field-list-files .files-toolbar > *:last-child {
.field-list-files .files-header > div > *:last-child {
margin-right: 0;
}
.field-list-files .files-toolbar button:before {
.field-list-files .files-header button:before {
content: "";
display: block;
position: absolute;
Expand All @@ -662,20 +655,20 @@
background-repeat: no-repeat;
background-position: 50% 50%;
}
.field-list-files .files-toolbar button.button-prev:before {
.field-list-files .files-header button.button-prev:before {
background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' data-svg='arrow-left'%3E%3Cpolyline fill='none' stroke='%23444444' points='10 14 5 9.5 10 5'%3E%3C/polyline%3E%3Cline fill='none' stroke='%23444444' x1='16' y1='9.5' x2='5' y2='9.52'%3E%3C/line%3E%3C/svg%3E");
}
.field-list-files .files-toolbar button.button-up:before {
.field-list-files .files-header button.button-up:before {
background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' data-svg='arrow-up'%3E%3Cpolygon points='10.5,4 15.37,9.4 14.63,10.08 10.5,5.49 6.37,10.08 5.63,9.4' fill='%23444444'%3E%3C/polygon%3E%3Cline fill='none' stroke='%23444444' x1='10.5' y1='16' x2='10.5' y2='5'%3E%3C/line%3E%3C/svg%3E");
}
.field-list-files .files-toolbar button.button-directory-trash:before {
.field-list-files .files-header button.button-directory-trash:before {
width: 16px;
height: 16px;
left: 5px;
top: 4px;
background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' data-svg='trash'%3E%3Cpolyline fill='none' stroke='%23444444' points='6.5 3 6.5 1.5 13.5 1.5 13.5 3'%3E%3C/polyline%3E%3Cpolyline fill='none' stroke='%23444444' points='4.5 4 4.5 18.5 15.5 18.5 15.5 4'%3E%3C/polyline%3E%3Crect x='8' y='7' width='1' height='9'%3E%3C/rect%3E%3Crect x='11' y='7' width='1' height='9'%3E%3C/rect%3E%3Crect x='2' y='3' width='16' height='1'%3E%3C/rect%3E%3C/svg%3E");
}
.field-list-files .files-toolbar button:after {
.field-list-files .files-header button:after {
content: "";
display: block;
position: absolute;
Expand All @@ -684,11 +677,11 @@
left: 25px;
bottom: 0;
}
.field-list-files .files-toolbar .button-dropdown {
.field-list-files .files-header .button-dropdown {
position: relative;
display: inline-block;
}
.field-list-files .files-toolbar .button-dropdown .dropdown-content {
.field-list-files .files-header .button-dropdown .dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
Expand All @@ -699,28 +692,28 @@
text-align: center;
left: -25px;
}
.field-list-files .files-toolbar .button-dropdown:hover .dropdown-content {
.field-list-files .files-header .button-dropdown:hover .dropdown-content {
display: block;
}
.field-list-files .files-toolbar .button-dropdown .dropdown-content > div {
.field-list-files .files-header .button-dropdown .dropdown-content > div {
margin-top: 5px;
}
.field-list-files .files-toolbar .button-dropdown .dropdown-content > div button {
.field-list-files .files-header .button-dropdown .dropdown-content > div button {
background: #83232f;
color: #fff;
border: 1px solid #51131d;
}
.field-list-files .files-toolbar .button-dropdown .dropdown-content > div button:hover {
.field-list-files .files-header .button-dropdown .dropdown-content > div button:hover {
background: #6b1a26;
}
.field-list-files .files-toolbar .button-dropdown .dropdown-content > div button:before {
.field-list-files .files-header .button-dropdown .dropdown-content > div button:before {
width: 16px;
height: 16px;
left: 5px;
top: 4px;
background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' data-svg='trash'%3E%3Cpolyline fill='none' stroke='%23ffffff' points='6.5 3 6.5 1.5 13.5 1.5 13.5 3'%3E%3C/polyline%3E%3Cpolyline fill='none' stroke='%23ffffff' points='4.5 4 4.5 18.5 15.5 18.5 15.5 4'%3E%3C/polyline%3E%3Crect x='8' y='7' width='1' fill='%23ffffff' height='9'%3E%3C/rect%3E%3Crect x='11' y='7' width='1' fill='%23ffffff' height='9'%3E%3C/rect%3E%3Crect x='2' y='3' width='16' fill='%23ffffff' height='1'%3E%3C/rect%3E%3C/svg%3E");
}
.field-list-files .files-toolbar .button-dropdown .dropdown-content > div button:after {
.field-list-files .files-header .button-dropdown .dropdown-content > div button:after {
border: 0.5px solid #51131d;
}
.field-list-files .list-grid .file-item {
Expand Down Expand Up @@ -788,6 +781,8 @@
right: 0;
bottom: 0;
width: 100%;
word-wrap: break-word;
overflow-wrap: break-word;
}
.field-list-files .list-grid .directory-item {
width: 31%;
Expand Down Expand Up @@ -849,7 +844,7 @@
padding: 6px 4px;
}
.field-list-files .list-table .file .file-exs .av-folderlist-label:after {
margin-top: 2px;
margin-top: 4px;
}
.field-list-files .list-table .directory-item {
display: flex;
Expand Down
19 changes: 10 additions & 9 deletions media/core/js/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,20 @@ jQuery(function(){


jQuery('.modal-import-file').on('click', '.av-folderlist-label', function() {
let modal = jQuery(this).closest('.modal-import-file');
let self = jQuery(this);
let modal = self.closest('.modal-import-file');
let listfiles = modal.find('.field-list-files .list');
let list = jQuery(this).closest('.av-folderlist');
path = jQuery(this).attr('path');
active = jQuery(this).closest('.av-folderlist-dir');
let list = self.closest('.av-folderlist');
active = self.closest('.av-folderlist-dir');
list.find('.av-folderlist-label').removeClass('selected');
jQuery(this).closest('.field-wrapper').find('.import-directory').val(path);
jQuery(this).addClass('selected');
jQuery.get("/administrator/index.php?option=com_ajax&plugin=radicalmultifield&group=fields&format=json&type=get_files&directory=" + encodeURIComponent(path) +
listfiles.html('');
jQuery.get("/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) {
path = self.attr('path');
self.closest('.field-wrapper').find('.import-directory').val(path);

if(inputPath.value !== '') {
if(historyDirectories.length>0) {
Expand All @@ -123,8 +125,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-grid"><span>Сеткой</span></button><button class="button-table"><span>Списком</span></button></div></div>';
htmlfilesAndDirectories += "<div class='files-toolbar'><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></div>";
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 files = response.data[0].files;
let directories = response.data[0].directories;

Expand Down Expand Up @@ -464,7 +465,7 @@ jQuery(function(){
let exs = fileName.split('.')[1];
let exsImage = ['jpg', 'png', 'svg', 'jpeg', 'bmp', 'xcf', 'gif'];
if(exsImage.indexOf(exs) !== -1) {
let file = "/" + importfieldpath + path.replace('root', '') + '/' + fileName;
let file = "/" + path.replace('root', importfieldpath) + '/' + fileName;
fileExs.style.backgroundImage = "url(" + file + ")";
} else {
let exsAvailable = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx', 'mp3', 'ogg', 'flac', 'pdf', 'zip', 'txt'];
Expand Down
22 changes: 3 additions & 19 deletions params/radicalmultifield.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,6 @@
<option value="0">JNO</option>
</field>

<field name="filesimportreoriginalmaxwidth"
type="text"
label="PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTORIGINALMAXWIDTH_LABEL"
default="20000"
class="input-xlarge"
showon="filesimportreoriginal:1[AND]filesimport:1"
/>

<field name="filesimportreoriginalmaxheight"
type="text"
label="PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTORIGINALMAXHEIGHT_LABEL"
default="20000"
class="input-xlarge"
showon="filesimportreoriginal:1[AND]filesimport:1"
/>

<field name="filesimportresize"
type="radio"
label="PLG_RADICAL_MULTI_FIELD_FIELD_PARAMS_FILESIMPORTRESIZE_LABEL"
Expand Down Expand Up @@ -160,7 +144,7 @@
required="true"
class="btn-group"
default="0"
showon="filesimport:1[AND]filesimportreoriginal:1">
showon="filesimport:1">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
Expand All @@ -171,7 +155,7 @@
required="true"
default="360"
class="input-xlarge"
showon="filesimportpreview:1[AND]filesimport:1[AND]filesimportreoriginal:1"
showon="filesimportpreview:1[AND]filesimport:1"
/>

<field name="filesimportpreviewmaxheight"
Expand All @@ -180,7 +164,7 @@
required="true"
default="360"
class="input-xlarge"
showon="filesimportpreview:1[AND]filesimport:1[AND]filesimportreoriginal:1"
showon="filesimportpreview:1[AND]filesimport:1"
/>

<field name="filesimportrezizeoverlay"
Expand Down
1 change: 0 additions & 1 deletion radicalmultifieldhelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,6 @@ public static function generateThumb(&$fieldOrParams, $source)
}
}


$image->save($fullPathThumb);
unset($image);
}
Expand Down

0 comments on commit 5a4e1a9

Please sign in to comment.