Commit e0c6f05e authored by Arnaud Bour's avatar Arnaud Bour

Minor fix

parent 6309e63a
......@@ -37,17 +37,16 @@ function ephoto_dam_help($route_name, RouteMatchInterface $route_match) {
}
$links = [
':config' => '/admin/config',
':config_content_formats' => '/admin/config/content/formats',
':config_content_formats_add' => '/admin/config/content/formats/add'
':config' => Url::fromRoute('system.admin_config')->toString(),
':config_content' => Url::fromRoute('system.admin_config_content')->toString()
];
$output = '<h3>' . t('Ephoto Dam Embed help') . '</h3>';
$output .= '<h4>' . t('Configuration') . '</h4>';
$output .= '<p><ul>';
$output .= '<li>' . t('Step 1- Click on the "<a href=":config">Configuration</a>" tab and then on the "<a href=":config_content_formats">Text formats and editors</a>" link to select and configure text editors.', $links) . '</li>';
$output .= '<li>' . t('Step 2- Click the "<a href=":config_content_formats_add">Add Text Format</a>" button to create and customize the text format. Enter the "Name", check the "Roles" and select "CKEditor" in the "Text editor" list.', $links) . '</li>';
$output .= '<li>' . t('Step 1- Click on the "<a href=":config">Configuration</a>" tab and then on the "<a href=":config_content">Text formats and editors</a>" link to select and configure text editors.', $links) . '</li>';
$output .= '<li>' . t('Step 2- Click the "Add Text Format" button to create and customize the text format. Enter the "Name", check the "Roles" and select "CKEditor" in the "Text editor" list.', $links) . '</li>';
$output .= '<li>' . t('Step 3- In the “Toolbar configuration” section, select the "Ephoto button" and drag and drop it into the active toolbar to add the button.') . '</li>';
$output .= '<li>' . t('Step 4- Configure the "CKEditor plugin":') . '<ul>';
$output .= '<li>' . t('"Server URL": enter your Ephoto Dam software URL.') . '</li>';
......@@ -88,7 +87,7 @@ function ephoto_dam_toolbar_filter_validate($form, FormStateInterface $form_stat
$form_state->setError(
$form['filters']['status']['ephoto_dam'],
t('To embed the fields Ephoto Dam, make sure you have enabled the filter and dragged the icon into the WYSIWYG toolbar. For more information <a href="@url">read the documentation</a>.',
['@url' => '/admin/help/ephoto_dam'])
['@url' => Url::fromRoute('help.page', ['name' => 'ephoto_dam'])->toString()])
);
}
}
......@@ -123,12 +122,12 @@ function ephoto_dam_settings_validate($form, FormStateInterface $form_state) {
$button_enabled = ephoto_dam_button_enabled($form_state);
if ($button_enabled) {
$common_settings = \Drupal::config('ephoto_dam.settings');
$common_settings = Drupal::config('ephoto_dam.settings');
$server_url = $common_settings->get('server_url');
$links = [
':config_ephoto_dam' => '/admin/config/ephoto_dam'
':config_ephoto_dam' => Url::fromRoute('ephoto_dam.admin_settings')->toString()
];
if (!$server_url) {
......
......@@ -41,7 +41,7 @@ function ephoto_dam_field_help($route_name, RouteMatchInterface $route_match) {
$links = [
':field_ui_help' => Url::fromRoute('help.page', ['name' => 'field'])->toString(),
':field_help' => \Drupal::moduleHandler()->moduleExists('field_ui') ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#'
':field_help' => Drupal::moduleHandler()->moduleExists('field_ui') ? Url::fromRoute('help.page', ['name' => 'field_ui'])->toString() : '#'
];
$output = '<h3>' . t('Ephoto Dam Field help') . '</h3>';
......@@ -68,12 +68,12 @@ function ephoto_dam_field_form_alter(&$form, FormStateInterface $form_state, $fo
*/
function ephoto_dam_field_settings_validate($form, FormStateInterface $form_state) {
$common_settings = \Drupal::config('ephoto_dam.settings');
$common_settings = Drupal::config('ephoto_dam.settings');
$server_url = $common_settings->get('server_url');
$links = [
':config_ephoto_dam' => '/admin/config/ephoto_dam'
':config_ephoto_dam' => Url::fromRoute('ephoto_dam.admin_settings')->toString()
];
if (!$server_url) {
......
......@@ -30,7 +30,7 @@ class EphotoDamField extends FieldItemBase {
*/
private const DEFAULT_SETTINGS = [
'version_support' => false,
'captions_format' => '[dc:rights]'
'captions_format' => ''
];
/**
......
......@@ -554,7 +554,7 @@
html =[
'<img src="' + src + '" alt="' + alt + '" width="' + width + '" height="' + height + '" class="ephoto_dam_file' + bookstyle + '">',
'<span class="ephoto_dam_drag" title="Cliquer et glisser pour redimensionner" style="margin-left:' + handle + 'px">​</span>',
'<span class="ephoto_dam_drag" title="' + Drupal.t('Click and drag to resize') + '" style="margin-left:' + handle + 'px">​</span>',
caption ? '<span class="ephoto_dam_caption">' + caption_data + '</span>' : ''
].join('');
......
......@@ -131,4 +131,7 @@ msgid "The version of Ephoto Dam is not compatible with this feature"
msgstr "La version d'Ephoto Dam n'est pas compatible avec cette fonctionnalité"
msgid "Please enter the server URL first from the <a href=\":config_ephoto_dam\">module configuration form</a>"
msgstr "Veuillez d'abord saisir l'URL du serveur à partir du <a href=\":config_ephoto_dam\">formulaire de configuration du module</a>"
\ No newline at end of file
msgstr "Veuillez d'abord saisir l'URL du serveur à partir du <a href=\":config_ephoto_dam\">formulaire de configuration du module</a>"
msgid "Click and drag to resize"
msgstr "Cliquer et glisser pour redimensionner"
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment