MDL-78096 tiny_media: Handle repositories if none is active

This commit is contained in:
meirzamoodle
2024-04-04 15:31:08 +07:00
parent cbbc87c7f4
commit 2d67005f21
3 changed files with 11 additions and 4 deletions
@@ -90,6 +90,7 @@ $string['presentationoraltrequired'] = 'An image must have a description, unless
$string['privacy:metadata'] = 'The media plugin for TinyMCE does not store any personal data.';
$string['remove'] = 'Remove';
$string['repositorynotpermitted'] = 'Paste an image link in the field below.';
$string['repositoryuploadnotpermitted'] = 'Paste an image link in the field below or<br>click the Browse Repositories button.';
$string['saveimage'] = 'Save';
$string['size'] = 'Width x height (in pixels)';
$string['sizecustom'] = 'Custom size';
@@ -29,7 +29,7 @@
<!-- First Column -->
<div class="col-md-6 d-flex align-items-center p-0">
<!-- Row 1: URL related label -->
<label for="{{elementid}}_tiny_image_filename" title="{{#str}} filename, tiny_media {{/str}}" class="tiny_image_filename text-truncate mr-1">{{#str}} filename, tiny_media {{/str}}</label>
<label title="{{#str}} filename, tiny_media {{/str}}" class="tiny_image_filename text-truncate mr-1">{{#str}} filename, tiny_media {{/str}}</label>
</div>
<!-- Column 2: Saving, canceling, browsing repositories buttons -->
<div class="col-md-6 text-right mt-2 md-0 p-0">
@@ -33,15 +33,21 @@
<!-- File input -->
<input type="file" id="tiny_image_fileinput" accept="image/*" class="d-none">
{{/showdropzone}}
{{^showfilepicker}}
{{^showdropzone}}
<div class="text-center">
<!-- Dropzone icon -->
<i class="fa-6x pb-2 text-secondary fa fa-cloud"></i>
<!-- Dropzone string -->
<div class="lead text-center">
<p class="mb-0">{{#str}} repositorynotpermitted, tiny_media {{/str}}</p>
<p class="mb-0">
{{#showfilepicker}}
{{#str}} repositoryuploadnotpermitted, tiny_media {{/str}}</p>
{{/showfilepicker}}
{{^showfilepicker}}
{{#str}} repositorynotpermitted, tiny_media {{/str}}
{{/showfilepicker}}
</div>
</div>
{{/showfilepicker}}
{{/showdropzone}}
</div>
</div>