Skip to content

Commit

Permalink
Merge branch '2.0' into 2
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Jun 12, 2023
2 parents ca98e30 + 181f973 commit 31ff2e0
Show file tree
Hide file tree
Showing 46 changed files with 32 additions and 259 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 @@ -72,6 +72,7 @@ jQuery.entwine('ss', ($) => {
const attrs = this.getOriginalAttributes();
const editor = this.getElement().getEditor();
const selection = editor.getInstance().selection;
const folderId = this.getFolderId();
const selectionContent = editor.getSelection();
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
9 changes: 0 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
9 changes: 0 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
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
9 changes: 0 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
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
9 changes: 0 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
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
9 changes: 0 additions & 9 deletions lang/hr.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
hr:
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Spremi
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVED: Spremljeno
FileFormFactory:
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISH: Objavi
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISHED: Objavljeno
MoveFormFactory:
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryCHOOSEFOLDER: 'Odaberi direktorij'
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryMOVE: Premjesti
SilverStripe\AssetAdmin\BatchAction\DeleteAssets:
TITLE: 'Obriši direktorije'
SilverStripe\AssetAdmin\Controller\AssetAdmin:
Expand Down
2 changes: 0 additions & 2 deletions lang/hu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ hu:
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/id.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ id:
EDITINFO: 'Edit berkas ini'
FIELDNOTSET: 'Informasi berkas tidak ada'
REMOVE: Buang
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/is.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
is:
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Controller\AssetAdmin:
CREATED: 'First uploaded'
DELETE_BUTTON: Delete
Expand Down
9 changes: 0 additions & 9 deletions lang/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ it:
AssetAdmin:
INSERT_FILE: 'Inserire file'
UPDATE_FILE: 'Aggiorna file'
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Salva
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVED: Salvato
FileFormFactory:
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISH: Pubblica
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISHED: Pubblicato
MoveFormFactory:
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryCHOOSEFOLDER: 'Scegli una cartella'
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryMOVE: Sposta
SilverStripe\Admin\FileStatusIcon:
ACCESS_RESTRICTED: 'Accesso ristretto'
TRACKED_FORM_UPLOAD_RESTRICTED: 'Inoltro modulo'
Expand Down
2 changes: 0 additions & 2 deletions lang/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ ja:
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/ko.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ ko:
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
7 changes: 0 additions & 7 deletions lang/lt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ lt:
EDITINFO: 'Redaguoti šią bylą'
FIELDNOTSET: 'Informacija apie bylą nerasta'
REMOVE: Pašalinti
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
FileFormFactory:
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISH: Publikuoti
php.SilverStripe\AssetAdmin\Forms\FileFormFactoryPUBLISHED: Publikuota
MoveFormFactory:
php.SilverStripe\AssetAdmin\Forms\MoveFormFactoryMOVE: Perkelti
SilverStripe\Admin\FileStatusIcon:
ACCESS_RESTRICTED: 'Ribotas priėjimas'
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
Expand Down
2 changes: 0 additions & 2 deletions lang/mi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ mi:
EDITINFO: 'Whakatikatia tēnei kōnae'
FIELDNOTSET: 'Kāore i kitea te mōhiohio kōnae'
REMOVE: Tango
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
2 changes: 0 additions & 2 deletions lang/nb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ nb:
EDITINFO: 'Rediger denne filen'
FIELDNOTSET: 'Filinformasjon ikke funnet'
REMOVE: Fjern
AssetFormFactory:
php.SilverStripe\AssetAdmin\Forms\AssetFormFactorySAVE: Save
SilverStripe\AssetAdmin\Forms\AssetFormFactory:
FILENAME: Filename
SAVE: Save
Expand Down
Loading

0 comments on commit 31ff2e0

Please sign in to comment.