Skip to content

Commit

Permalink
Merge branch '1' into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jun 15, 2023
2 parents 20e3d4c + ec20c09 commit 6b9315d
Show file tree
Hide file tree
Showing 45 changed files with 90 additions and 162 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-file.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions client/src/entwine/TinyMCE_sslink-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ jQuery.entwine('ss', ($) => {
const editor = this.getElement().getEditor();
const selection = editor.getInstance().selection;
const selectionContent = editor.getSelection();
const folderId = this.getFolderId();
const tagName = selection.getNode().tagName;
const requireLinkText = tagName !== 'A' && selectionContent.trim() === '';

Expand All @@ -86,6 +87,7 @@ jQuery.entwine('ss', ($) => {
<InjectableInsertMediaModal
isOpen={isOpen}
type="insert-link"
folderId={folderId}
onInsert={handleInsert}
onClosed={handleHide}
title={false}
Expand Down Expand Up @@ -118,6 +120,22 @@ jQuery.entwine('ss', ($) => {
};
},

/**
* Get default upload folder
*
* @returns {(number|null)}
*/
getFolderId() {
const $field = this.getElement();
if (!$field) {
return null;
}

// Check type safely
const folderId = Number($field.data('config').upload_folder_id);
return isNaN(folderId) ? null : folderId;
},

getOriginalAttributes() {
const editor = this.getElement().getEditor();
const node = $(editor.getSelectedNode());
Expand Down
4 changes: 2 additions & 2 deletions code/Forms/AssetFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ protected function getSaveAction($record)
->setIcon('save')
->setSchemaState([
'data' => [
'pristineTitle' => _t(__CLASS__.'SAVED', 'Saved'),
'pristineTitle' => _t(__CLASS__.'.SAVED', 'Saved'),
'pristineIcon' => 'tick',
'dirtyTitle' => _t(__CLASS__.'SAVE', 'Save'),
'dirtyTitle' => _t(__CLASS__.'.SAVE', 'Save'),
'dirtyIcon' => 'save',
'pristineClass' => 'btn-outline-primary',
'dirtyClass' => '',
Expand Down
4 changes: 2 additions & 2 deletions code/Forms/FileFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ protected function getPublishAction($record)
'data' => [
'isPublished' => $record->isPublished(),
'isModified' => $record->isModifiedOnDraft(),
'pristineTitle' => _t(__CLASS__ . 'PUBLISHED', 'Published'),
'pristineTitle' => _t(__CLASS__ . '.PUBLISHED', 'Published'),
'pristineIcon' => 'tick',
'dirtyTitle' => _t(__CLASS__ . 'PUBLISH', 'Publish'),
'dirtyTitle' => _t(__CLASS__ . '.PUBLISH', 'Publish'),
'dirtyIcon' => 'rocket',
'pristineClass' => 'btn-outline-primary',
'dirtyClass' => 'btn-primary',
Expand Down
4 changes: 2 additions & 2 deletions code/Forms/MoveFormFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public function getForm(RequestHandler $controller = null, $name = self::DEFAULT
FieldList::create(
TreeDropdownField::create(
'FolderID',
_t(__CLASS__.'CHOOSEFOLDER', 'Choose a folder'),
_t(__CLASS__.'.CHOOSEFOLDER', 'Choose a folder'),
Folder::class
)->setValue((int) $context['FolderID'])
->setTitleField('Filename')
),
FieldList::create(
FormAction::create('move', _t(__CLASS__.'MOVE', 'Move'))
FormAction::create('move', _t(__CLASS__.'.MOVE', 'Move'))
->addExtraClass('btn-primary font-icon-folder-move')
)
);
Expand Down
2 changes: 0 additions & 2 deletions lang/af.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ af:
EDITINFO: 'Verander die lêer'
FIELDNOTSET: 'Die lêer informasie kan nie gevind word nie'
REMOVE: Verwyder
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/ar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ ar:
EDITINFO: 'قم بتعديل هذا الملف'
FIELDNOTSET: 'لا يوجد معلومات عن الملف'
REMOVE: حذف
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/bg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ bg:
EDITINFO: 'Редактирай този файл'
FIELDNOTSET: 'Информация за файла не беше намерена'
REMOVE: Премахни
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/bs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ bs:
Filetype: 'File type'
ImageSpecs: Dimensions
LASTEDIT: 'Last changed'
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ cs:
EDITINFO: 'Editovat tento soubor'
FIELDNOTSET: 'Žádná informace o souboru'
REMOVE: Odstranit
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
15 changes: 6 additions & 9 deletions lang/da.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
da:
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Gem
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVED: Gemt
FileFormFactory:
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISH: Udgiv
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISHED: Udgivet
MoveFormFactory:
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryCHOOSEFOLDER: 'Vælg en mappe'
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryMOVE: Flyt
SilverStripe\AssetAdmin\BatchAction\DeleteAssets:
TITLE: 'Slet mapper'
SilverStripe\AssetAdmin\Controller\AssetAdmin:
Expand Down Expand Up @@ -69,6 +60,7 @@ da:
ROOTNAME: '(Top niveau)'
SAVE: Gem
VIEWERGROUPS: Visningsgrupper
SAVED: Gemt
SilverStripe\AssetAdmin\Forms\FileFormFactory:
INSERT_LINK: 'Link til fil'
LINKDESCR: 'Link beskrivelse'
Expand All @@ -78,6 +70,8 @@ da:
OTHER_ACTIONS: 'Andre handlinger'
UNEMEDABLE_MESSAGE: '<p class="alert alert-info alert--no-border editor__top-message">Denne filtype kan kun indsættes som et link. Du kan redigere linket når det er sat ind.</p>'
USAGE: 'Brugt på'
PUBLISH: Udgiv
PUBLISHED: Udgivet
SilverStripe\AssetAdmin\Forms\FileHistoryFormFactory:
PUBLISHED: Udgivet
SAVED: Gemt
Expand All @@ -97,3 +91,6 @@ da:
FileNotFound: 'Filen eller mappen kunne ikke findes'
SilverStripe\AssetAdmin\GraphQL\FileFilter:
FileNotFound: 'Filen eller mappen kunne ikke findes'
SilverStripe\AssetAdmin\Forms\MoveFormFactory:
CHOOSEFOLDER: 'Vælg en mappe'
MOVE: Flyt
15 changes: 6 additions & 9 deletions lang/de.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
de:
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Speichern
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVED: Gespeichert
FileFormFactory:
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISH: Veröffentlichen
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISHED: Veröffentlicht
MoveFormFactory:
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryCHOOSEFOLDER: 'Ordner auswählen'
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryMOVE: Verschieben
SilverStripe\AssetAdmin\BatchAction\DeleteAssets:
TITLE: 'Ordner löschen'
SilverStripe\AssetAdmin\Controller\AssetAdmin:
Expand Down Expand Up @@ -72,6 +63,7 @@ de:
ROOTNAME: (Hauptebene)
SAVE: Speichern
VIEWERGROUPS: Betrachtergruppen
SAVED: Gespeichert
SilverStripe\AssetAdmin\Forms\FileFormFactory:
INSERT_LINK: 'Link zur Datei'
LINKDESCR: 'Beschreibung des Links'
Expand All @@ -83,6 +75,8 @@ de:
UNEMEDABLE_MESSAGE: '<p class="alert alert-info alert--no-border editor__top-message">Dieser Dateityp kann nur als Link eingefügt werden. Sie können den Link nach dem Einfügen bearbeiten.</p>'
USAGE: 'Benutzt in'
DOWNLOAD_FILE: 'Datei herunterladen'
PUBLISH: Veröffentlichen
PUBLISHED: Veröffentlicht
SilverStripe\AssetAdmin\Forms\FileHistoryFormFactory:
PUBLISHED: Veröffentlicht
SAVED: Gespeichert
Expand Down Expand Up @@ -123,3 +117,6 @@ de:
OWNER_WARNING:
one: 'Die Datei "{file}" wird an {count} Stelle verwendet.'
other: 'Die Datei "{file}" wird an {count} Stellen verwendet.'
SilverStripe\AssetAdmin\Forms\MoveFormFactory:
CHOOSEFOLDER: 'Ordner auswählen'
MOVE: Verschieben
2 changes: 0 additions & 2 deletions lang/el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ el:
Filetype: 'File type'
ImageSpecs: Dimensions
LASTEDIT: 'Last changed'
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
15 changes: 6 additions & 9 deletions lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ en:
AssetAdmin:
INSERT_FILE: 'Insert file'
UPDATE_FILE: 'Update file'
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVED: Saved
FileFormFactory:
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISH: Publish
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISHED: Published
MoveFormFactory:
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryCHOOSEFOLDER: 'Choose a folder'
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryMOVE: Move
SilverStripe\Admin\FileStatusIcon:
ACCESS_RESTRICTED: 'Restricted access'
TRACKED_FORM_UPLOAD_RESTRICTED: 'Form submission'
Expand Down Expand Up @@ -80,6 +71,7 @@ en:
ONLY_GROUPS: 'Only these groups (choose from list)'
ROOTNAME: '(Top level)'
SAVE: Save
SAVED: Saved
VIEWERGROUPS: 'Viewer Groups'
SilverStripe\AssetAdmin\Forms\FileFormFactory:
DOWNLOAD_FILE: 'Download file'
Expand All @@ -89,6 +81,8 @@ en:
LINKOPTIONS: 'Link options'
LINKTEXT: 'Link text'
OTHER_ACTIONS: 'Other actions'
PUBLISH: Publish
PUBLISHED: Published
REPLACE_FILE: 'Replace file'
UNEMEDABLE_MESSAGE: '<p class="alert alert-info alert--no-border editor__top-message">This file type can only be inserted as a link. You can edit the link once it is inserted.</p>'
USAGE: 'Used on'
Expand All @@ -99,6 +93,9 @@ en:
CREATE: Create
SilverStripe\AssetAdmin\Forms\FolderFormFactory:
FOLDERNAME: 'Folder name'
SilverStripe\AssetAdmin\Forms\MoveFormFactory:
CHOOSEFOLDER: 'Choose a folder'
MOVE: Move
SilverStripe\AssetAdmin\Forms\RemoteFileFormFactory:
AddMedia: 'Add media'
Cancel: Cancel
Expand Down
15 changes: 6 additions & 9 deletions lang/eo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ eo:
AssetAdmin:
INSERT_FILE: 'Enmeti dosieron'
UPDATE_FILE: 'Ĝisdatigi dosieron'
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Konservi
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVED: Konservita
FileFormFactory:
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISH: Publikigi
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISHED: Publikigita
MoveFormFactory:
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryCHOOSEFOLDER: 'Elekti dosierujon'
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryMOVE: Movi
SilverStripe\Admin\FileStatusIcon:
ACCESS_RESTRICTED: 'Limigita aliro'
TRACKED_FORM_UPLOAD_RESTRICTED: 'Sendi formularon'
Expand Down Expand Up @@ -81,6 +72,7 @@ eo:
ROOTNAME: '(Supra nivelo)'
SAVE: Konservi
VIEWERGROUPS: 'Grupoj de vidantoj'
SAVED: Konservita
SilverStripe\AssetAdmin\Forms\FileFormFactory:
DOWNLOAD_FILE: 'Elŝuti dosieron'
INSERT_LINK: 'Ligi al dosiero'
Expand All @@ -92,6 +84,8 @@ eo:
REPLACE_FILE: 'Anstataŭigi dosieron'
UNEMEDABLE_MESSAGE: '<p class="alert alert-info alert--no-border editor__top-message">Ĉi tiu tipo de dosiero estas enmetebla nur kiel ligilon. Vi povas redakti la ligilon post enmeto.</p>'
USAGE: 'Uzita je'
PUBLISH: Publikigi
PUBLISHED: Publikigita
SilverStripe\AssetAdmin\Forms\FileHistoryFormFactory:
PUBLISHED: Publikigita
SAVED: Konservita
Expand Down Expand Up @@ -125,3 +119,6 @@ eo:
OWNER_WARNING:
one: 'Dosiero "{file}" estas uzita en 1 loko.'
other: 'Dosiero "{file}" estas uzita en {count} lokoj.'
SilverStripe\AssetAdmin\Forms\MoveFormFactory:
CHOOSEFOLDER: 'Elekti dosierujon'
MOVE: Movi
2 changes: 0 additions & 2 deletions lang/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ es:
EDITINFO: 'Editar este archivo'
FIELDNOTSET: 'No ha sido encontrada la información del archivo'
REMOVE: Eliminar
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/et_EE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ et_EE:
EDITINFO: 'Muuda seda faili'
FIELDNOTSET: 'Failiteavet ei leitud'
REMOVE: Eemalda
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/fa_IR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ fa_IR:
EDITINFO: 'ویرایش این فایل'
FIELDNOTSET: 'اطلاعات فایل پیدا نشد'
REMOVE: حذف
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/fi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ fi:
EDITINFO: 'Muokkaa tätä tiedostoa'
FIELDNOTSET: 'Tietoja tiedostosta ei löytynyt'
REMOVE: Poista
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
15 changes: 6 additions & 9 deletions lang/fr.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
fr:
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Sauvegarder
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVED: Sauvegardé
FileFormFactory:
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISH: Publier
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISHED: Publié
MoveFormFactory:
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryCHOOSEFOLDER: 'Choisir un dossier'
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryMOVE: Déplacer
SilverStripe\AssetAdmin\BatchAction\DeleteAssets:
TITLE: 'Supprimer les dossiers'
SilverStripe\AssetAdmin\Controller\AssetAdmin:
Expand Down Expand Up @@ -69,6 +60,7 @@ fr:
ROOTNAME: (Racine)
SAVE: Sauvegarder
VIEWERGROUPS: 'Groupes de visualisation'
SAVED: Sauvegardé
SilverStripe\AssetAdmin\Forms\FileFormFactory:
INSERT_LINK: 'Lien du fichier'
LINKDESCR: 'Description du lien'
Expand All @@ -77,6 +69,8 @@ fr:
LINKTEXT: 'Texte du lien'
OTHER_ACTIONS: 'Autres actions'
UNEMEDABLE_MESSAGE: '<p class="alert alert-info alert--no-border editor__top-message">Ce type de fichier peut uniquement être inséré en tant que lien. Vous pourrez modifier le lien après qu''il aura été inséré.</p>'
PUBLISH: Publier
PUBLISHED: Publié
SilverStripe\AssetAdmin\Forms\FileHistoryFormFactory:
PUBLISHED: Publié
SAVED: Sauvegardé
Expand All @@ -99,3 +93,6 @@ fr:
FileNotFound: 'Fichier ou dossier introuvable'
SilverStripe\AssetAdmin\GraphQL\FileFilter:
FileNotFound: 'Fichier ou dossier introuvable'
SilverStripe\AssetAdmin\Forms\MoveFormFactory:
CHOOSEFOLDER: 'Choisir un dossier'
MOVE: Déplacer
2 changes: 0 additions & 2 deletions lang/gl_ES.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ gl_ES:
SilverStripe\AssetAdmin\Forms\UploadField:
EDITINFO: 'Editar este ficheiro'
FIELDNOTSET: 'Ficheiro de información non atopado'
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/he_IL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ he_IL:
Filetype: 'File type'
ImageSpecs: Dimensions
LASTEDIT: 'Last changed'
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
Loading

0 comments on commit 6b9315d

Please sign in to comment.